react-resizable-panels 4.5.3-alpha.0 → 4.5.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { useState as
|
|
2
|
+
import { jsx as Q } from "react/jsx-runtime";
|
|
3
|
+
import { useState as ee, useCallback as Z, useId as nt, useLayoutEffect as Te, useEffect as Oe, useRef as k, createContext as ot, useImperativeHandle as Ae, useMemo as _e, useSyncExternalStore as it, useContext as rt } from "react";
|
|
4
4
|
function z(e, t = "Assertion error") {
|
|
5
5
|
if (!e)
|
|
6
6
|
throw Error(t);
|
|
7
7
|
}
|
|
8
|
-
function
|
|
8
|
+
function K({
|
|
9
9
|
group: e
|
|
10
10
|
}) {
|
|
11
11
|
const { orientation: t, panels: n } = e;
|
|
12
12
|
return n.reduce((o, i) => (o += t === "horizontal" ? i.element.offsetWidth : i.element.offsetHeight, o), 0);
|
|
13
13
|
}
|
|
14
14
|
function de(e, t) {
|
|
15
|
-
return t.sort(
|
|
16
|
-
e === "horizontal" ?
|
|
15
|
+
return Array.from(t).sort(
|
|
16
|
+
e === "horizontal" ? st : at
|
|
17
17
|
);
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function st(e, t) {
|
|
20
20
|
const n = e.element.offsetLeft - t.element.offsetLeft;
|
|
21
21
|
return n !== 0 ? n : e.element.offsetWidth - t.element.offsetWidth;
|
|
22
22
|
}
|
|
23
|
-
function
|
|
23
|
+
function at(e, t) {
|
|
24
24
|
const n = e.element.offsetTop - t.element.offsetTop;
|
|
25
25
|
return n !== 0 ? n : e.element.offsetHeight - t.element.offsetHeight;
|
|
26
26
|
}
|
|
@@ -39,7 +39,7 @@ function Fe(e, t) {
|
|
|
39
39
|
)
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
|
-
function
|
|
42
|
+
function lt({
|
|
43
43
|
orientation: e,
|
|
44
44
|
rects: t,
|
|
45
45
|
targetRect: n
|
|
@@ -48,24 +48,24 @@ function at({
|
|
|
48
48
|
x: n.x + n.width / 2,
|
|
49
49
|
y: n.y + n.height / 2
|
|
50
50
|
};
|
|
51
|
-
let i,
|
|
51
|
+
let i, r = Number.MAX_VALUE;
|
|
52
52
|
for (const l of t) {
|
|
53
|
-
const { x:
|
|
54
|
-
u <
|
|
53
|
+
const { x: s, y: a } = Fe(o, l), u = e === "horizontal" ? s : a;
|
|
54
|
+
u < r && (r = u, i = l);
|
|
55
55
|
}
|
|
56
56
|
return z(i, "No rect found"), i;
|
|
57
57
|
}
|
|
58
58
|
let ie;
|
|
59
|
-
function
|
|
59
|
+
function ut() {
|
|
60
60
|
return ie === void 0 && (typeof matchMedia == "function" ? ie = !!matchMedia("(pointer:coarse)").matches : ie = !1), ie;
|
|
61
61
|
}
|
|
62
62
|
function $e(e) {
|
|
63
|
-
const { element: t, orientation: n, panels: o, separators: i } = e,
|
|
63
|
+
const { element: t, orientation: n, panels: o, separators: i } = e, r = de(
|
|
64
64
|
n,
|
|
65
65
|
Array.from(t.children).filter(Ne).map((c) => ({ element: c }))
|
|
66
66
|
).map(({ element: c }) => c), l = [];
|
|
67
|
-
let
|
|
68
|
-
for (const c of
|
|
67
|
+
let s = !1, a, u = [];
|
|
68
|
+
for (const c of r)
|
|
69
69
|
if (c.hasAttribute("data-panel")) {
|
|
70
70
|
const h = o.find(
|
|
71
71
|
(y) => y.element === c
|
|
@@ -74,7 +74,7 @@ function $e(e) {
|
|
|
74
74
|
if (a) {
|
|
75
75
|
const y = a.element.getBoundingClientRect(), m = c.getBoundingClientRect();
|
|
76
76
|
let f;
|
|
77
|
-
if (
|
|
77
|
+
if (s) {
|
|
78
78
|
const d = n === "horizontal" ? new DOMRect(y.right, y.top, 0, y.height) : new DOMRect(
|
|
79
79
|
y.left,
|
|
80
80
|
y.bottom,
|
|
@@ -90,7 +90,7 @@ function $e(e) {
|
|
|
90
90
|
break;
|
|
91
91
|
}
|
|
92
92
|
case 1: {
|
|
93
|
-
const g = u[0], v =
|
|
93
|
+
const g = u[0], v = lt({
|
|
94
94
|
orientation: n,
|
|
95
95
|
rects: [y, m],
|
|
96
96
|
targetRect: g.element.getBoundingClientRect()
|
|
@@ -122,7 +122,7 @@ function $e(e) {
|
|
|
122
122
|
];
|
|
123
123
|
for (const d of f) {
|
|
124
124
|
let p = "width" in d ? d : d.element.getBoundingClientRect();
|
|
125
|
-
const g =
|
|
125
|
+
const g = ut() ? e.resizeTargetMinimumSize.coarse : e.resizeTargetMinimumSize.fine;
|
|
126
126
|
if (p.width < g) {
|
|
127
127
|
const v = g - p.width;
|
|
128
128
|
p = new DOMRect(
|
|
@@ -143,14 +143,14 @@ function $e(e) {
|
|
|
143
143
|
}
|
|
144
144
|
l.push({
|
|
145
145
|
group: e,
|
|
146
|
-
groupSize:
|
|
146
|
+
groupSize: K({ group: e }),
|
|
147
147
|
panels: [a, h],
|
|
148
148
|
separator: "width" in d ? void 0 : d,
|
|
149
149
|
rect: p
|
|
150
150
|
});
|
|
151
151
|
}
|
|
152
152
|
}
|
|
153
|
-
|
|
153
|
+
s = !1, a = h, u = [];
|
|
154
154
|
}
|
|
155
155
|
} else if (c.hasAttribute("data-separator")) {
|
|
156
156
|
const h = i.find(
|
|
@@ -158,24 +158,24 @@ function $e(e) {
|
|
|
158
158
|
);
|
|
159
159
|
h ? u.push(h) : (a = void 0, u = []);
|
|
160
160
|
} else
|
|
161
|
-
|
|
161
|
+
s = !0;
|
|
162
162
|
return l;
|
|
163
163
|
}
|
|
164
|
-
function
|
|
164
|
+
function ct(e, t) {
|
|
165
165
|
const n = getComputedStyle(e), o = parseFloat(n.fontSize);
|
|
166
166
|
return t * o;
|
|
167
167
|
}
|
|
168
|
-
function
|
|
168
|
+
function ft(e, t) {
|
|
169
169
|
const n = getComputedStyle(e.ownerDocument.body), o = parseFloat(n.fontSize);
|
|
170
170
|
return t * o;
|
|
171
171
|
}
|
|
172
|
-
function
|
|
172
|
+
function dt(e) {
|
|
173
173
|
return e / 100 * window.innerHeight;
|
|
174
174
|
}
|
|
175
|
-
function
|
|
175
|
+
function pt(e) {
|
|
176
176
|
return e / 100 * window.innerWidth;
|
|
177
177
|
}
|
|
178
|
-
function
|
|
178
|
+
function ht(e) {
|
|
179
179
|
switch (typeof e) {
|
|
180
180
|
case "number":
|
|
181
181
|
return [e, "px"];
|
|
@@ -191,8 +191,8 @@ function re({
|
|
|
191
191
|
styleProp: n
|
|
192
192
|
}) {
|
|
193
193
|
let o;
|
|
194
|
-
const [i,
|
|
195
|
-
switch (
|
|
194
|
+
const [i, r] = ht(n);
|
|
195
|
+
switch (r) {
|
|
196
196
|
case "%": {
|
|
197
197
|
o = i / 100 * e;
|
|
198
198
|
break;
|
|
@@ -202,19 +202,19 @@ function re({
|
|
|
202
202
|
break;
|
|
203
203
|
}
|
|
204
204
|
case "rem": {
|
|
205
|
-
o =
|
|
205
|
+
o = ft(t, i);
|
|
206
206
|
break;
|
|
207
207
|
}
|
|
208
208
|
case "em": {
|
|
209
|
-
o =
|
|
209
|
+
o = ct(t, i);
|
|
210
210
|
break;
|
|
211
211
|
}
|
|
212
212
|
case "vh": {
|
|
213
|
-
o =
|
|
213
|
+
o = dt(i);
|
|
214
214
|
break;
|
|
215
215
|
}
|
|
216
216
|
case "vw": {
|
|
217
|
-
o =
|
|
217
|
+
o = pt(i);
|
|
218
218
|
break;
|
|
219
219
|
}
|
|
220
220
|
}
|
|
@@ -224,7 +224,7 @@ function D(e) {
|
|
|
224
224
|
return parseFloat(e.toFixed(3));
|
|
225
225
|
}
|
|
226
226
|
function ve(e) {
|
|
227
|
-
const { panels: t } = e, n =
|
|
227
|
+
const { panels: t } = e, n = K({ group: e });
|
|
228
228
|
return n === 0 ? t.map((o) => ({
|
|
229
229
|
collapsedSize: 0,
|
|
230
230
|
collapsible: o.panelConstraints.collapsible === !0,
|
|
@@ -233,54 +233,54 @@ function ve(e) {
|
|
|
233
233
|
maxSize: 100,
|
|
234
234
|
panelId: o.id
|
|
235
235
|
})) : t.map((o) => {
|
|
236
|
-
const { element: i, panelConstraints:
|
|
236
|
+
const { element: i, panelConstraints: r } = o;
|
|
237
237
|
let l = 0;
|
|
238
|
-
if (
|
|
238
|
+
if (r.collapsedSize !== void 0) {
|
|
239
239
|
const c = re({
|
|
240
240
|
groupSize: n,
|
|
241
241
|
panelElement: i,
|
|
242
|
-
styleProp:
|
|
242
|
+
styleProp: r.collapsedSize
|
|
243
243
|
});
|
|
244
244
|
l = D(c / n * 100);
|
|
245
245
|
}
|
|
246
|
-
let
|
|
247
|
-
if (
|
|
246
|
+
let s;
|
|
247
|
+
if (r.defaultSize !== void 0) {
|
|
248
248
|
const c = re({
|
|
249
249
|
groupSize: n,
|
|
250
250
|
panelElement: i,
|
|
251
|
-
styleProp:
|
|
251
|
+
styleProp: r.defaultSize
|
|
252
252
|
});
|
|
253
|
-
|
|
253
|
+
s = D(c / n * 100);
|
|
254
254
|
}
|
|
255
255
|
let a = 0;
|
|
256
|
-
if (
|
|
256
|
+
if (r.minSize !== void 0) {
|
|
257
257
|
const c = re({
|
|
258
258
|
groupSize: n,
|
|
259
259
|
panelElement: i,
|
|
260
|
-
styleProp:
|
|
260
|
+
styleProp: r.minSize
|
|
261
261
|
});
|
|
262
262
|
a = D(c / n * 100);
|
|
263
263
|
}
|
|
264
264
|
let u = 100;
|
|
265
|
-
if (
|
|
265
|
+
if (r.maxSize !== void 0) {
|
|
266
266
|
const c = re({
|
|
267
267
|
groupSize: n,
|
|
268
268
|
panelElement: i,
|
|
269
|
-
styleProp:
|
|
269
|
+
styleProp: r.maxSize
|
|
270
270
|
});
|
|
271
271
|
u = D(c / n * 100);
|
|
272
272
|
}
|
|
273
273
|
return {
|
|
274
274
|
collapsedSize: l,
|
|
275
|
-
collapsible:
|
|
276
|
-
defaultSize:
|
|
275
|
+
collapsible: r.collapsible === !0,
|
|
276
|
+
defaultSize: s,
|
|
277
277
|
minSize: a,
|
|
278
278
|
maxSize: u,
|
|
279
279
|
panelId: o.id
|
|
280
280
|
};
|
|
281
281
|
});
|
|
282
282
|
}
|
|
283
|
-
class
|
|
283
|
+
class mt {
|
|
284
284
|
#e = {};
|
|
285
285
|
addListener(t, n) {
|
|
286
286
|
const o = this.#e[t];
|
|
@@ -294,18 +294,18 @@ class ht {
|
|
|
294
294
|
if (o.length === 1)
|
|
295
295
|
o[0].call(null, n);
|
|
296
296
|
else {
|
|
297
|
-
let i = !1,
|
|
297
|
+
let i = !1, r = null;
|
|
298
298
|
const l = Array.from(o);
|
|
299
|
-
for (let
|
|
300
|
-
const a = l[
|
|
299
|
+
for (let s = 0; s < l.length; s++) {
|
|
300
|
+
const a = l[s];
|
|
301
301
|
try {
|
|
302
302
|
a.call(null, n);
|
|
303
303
|
} catch (u) {
|
|
304
|
-
|
|
304
|
+
r === null && (i = !0, r = u);
|
|
305
305
|
}
|
|
306
306
|
}
|
|
307
307
|
if (i)
|
|
308
|
-
throw
|
|
308
|
+
throw r;
|
|
309
309
|
}
|
|
310
310
|
}
|
|
311
311
|
removeAllListeners() {
|
|
@@ -329,7 +329,7 @@ let I = {
|
|
|
329
329
|
},
|
|
330
330
|
mountedGroups: /* @__PURE__ */ new Map()
|
|
331
331
|
};
|
|
332
|
-
const
|
|
332
|
+
const F = new mt();
|
|
333
333
|
function G() {
|
|
334
334
|
return I;
|
|
335
335
|
}
|
|
@@ -341,38 +341,38 @@ function M(e) {
|
|
|
341
341
|
return I = {
|
|
342
342
|
...I,
|
|
343
343
|
...t
|
|
344
|
-
}, t.cursorFlags !== void 0 &&
|
|
345
|
-
o.derivedPanelConstraints.forEach((
|
|
346
|
-
if (
|
|
344
|
+
}, t.cursorFlags !== void 0 && F.emit("cursorFlagsChange", I.cursorFlags), t.interactionState !== void 0 && F.emit("interactionStateChange", I.interactionState), t.mountedGroups !== void 0 && (I.mountedGroups.forEach((o, i) => {
|
|
345
|
+
o.derivedPanelConstraints.forEach((r) => {
|
|
346
|
+
if (r.collapsible) {
|
|
347
347
|
const { layout: l } = n.mountedGroups.get(i) ?? {};
|
|
348
348
|
if (l) {
|
|
349
|
-
const
|
|
350
|
-
|
|
351
|
-
o.layout[
|
|
349
|
+
const s = R(
|
|
350
|
+
r.collapsedSize,
|
|
351
|
+
o.layout[r.panelId]
|
|
352
352
|
), a = R(
|
|
353
|
-
|
|
354
|
-
l[
|
|
353
|
+
r.collapsedSize,
|
|
354
|
+
l[r.panelId]
|
|
355
355
|
);
|
|
356
|
-
|
|
356
|
+
s && !a && (i.inMemoryLastExpandedPanelSizes[r.panelId] = l[r.panelId]);
|
|
357
357
|
}
|
|
358
358
|
}
|
|
359
359
|
});
|
|
360
|
-
}),
|
|
360
|
+
}), F.emit("mountedGroupsChange", I.mountedGroups)), I;
|
|
361
361
|
}
|
|
362
|
-
function
|
|
362
|
+
function gt(e, t, n) {
|
|
363
363
|
let o, i = {
|
|
364
364
|
x: 1 / 0,
|
|
365
365
|
y: 1 / 0
|
|
366
366
|
};
|
|
367
|
-
for (const
|
|
368
|
-
const l = Fe(n,
|
|
367
|
+
for (const r of t) {
|
|
368
|
+
const l = Fe(n, r.rect);
|
|
369
369
|
switch (e) {
|
|
370
370
|
case "horizontal": {
|
|
371
|
-
l.x <= i.x && (o =
|
|
371
|
+
l.x <= i.x && (o = r, i = l);
|
|
372
372
|
break;
|
|
373
373
|
}
|
|
374
374
|
case "vertical": {
|
|
375
|
-
l.y <= i.y && (o =
|
|
375
|
+
l.y <= i.y && (o = r, i = l);
|
|
376
376
|
break;
|
|
377
377
|
}
|
|
378
378
|
}
|
|
@@ -382,10 +382,10 @@ function mt(e, t, n) {
|
|
|
382
382
|
hitRegion: o
|
|
383
383
|
} : void 0;
|
|
384
384
|
}
|
|
385
|
-
function
|
|
385
|
+
function yt(e) {
|
|
386
386
|
return e !== null && typeof e == "object" && "nodeType" in e && e.nodeType === Node.DOCUMENT_FRAGMENT_NODE;
|
|
387
387
|
}
|
|
388
|
-
function
|
|
388
|
+
function St(e, t) {
|
|
389
389
|
if (e === t) throw new Error("Cannot compare node with itself");
|
|
390
390
|
const n = {
|
|
391
391
|
a: be(e),
|
|
@@ -393,7 +393,7 @@ function yt(e, t) {
|
|
|
393
393
|
};
|
|
394
394
|
let o;
|
|
395
395
|
for (; n.a.at(-1) === n.b.at(-1); )
|
|
396
|
-
|
|
396
|
+
o = n.a.pop(), n.b.pop();
|
|
397
397
|
z(
|
|
398
398
|
o,
|
|
399
399
|
"Stacking order can only be calculated for elements with a common ancestor"
|
|
@@ -403,33 +403,33 @@ function yt(e, t) {
|
|
|
403
403
|
b: ze(xe(n.b))
|
|
404
404
|
};
|
|
405
405
|
if (i.a === i.b) {
|
|
406
|
-
const
|
|
406
|
+
const r = o.childNodes, l = {
|
|
407
407
|
a: n.a.at(-1),
|
|
408
408
|
b: n.b.at(-1)
|
|
409
409
|
};
|
|
410
|
-
let
|
|
411
|
-
for (;
|
|
412
|
-
const a = s
|
|
410
|
+
let s = r.length;
|
|
411
|
+
for (; s--; ) {
|
|
412
|
+
const a = r[s];
|
|
413
413
|
if (a === l.a) return 1;
|
|
414
414
|
if (a === l.b) return -1;
|
|
415
415
|
}
|
|
416
416
|
}
|
|
417
417
|
return Math.sign(i.a - i.b);
|
|
418
418
|
}
|
|
419
|
-
const
|
|
420
|
-
function
|
|
419
|
+
const vt = /\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;
|
|
420
|
+
function xt(e) {
|
|
421
421
|
const t = getComputedStyle(He(e) ?? e).display;
|
|
422
422
|
return t === "flex" || t === "inline-flex";
|
|
423
423
|
}
|
|
424
|
-
function
|
|
424
|
+
function zt(e) {
|
|
425
425
|
const t = getComputedStyle(e);
|
|
426
|
-
return !!(t.position === "fixed" || t.zIndex !== "auto" && (t.position !== "static" ||
|
|
426
|
+
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" || vt.test(t.willChange) || t.webkitOverflowScrolling === "touch");
|
|
427
427
|
}
|
|
428
428
|
function xe(e) {
|
|
429
429
|
let t = e.length;
|
|
430
430
|
for (; t--; ) {
|
|
431
431
|
const n = e[t];
|
|
432
|
-
if (z(n, "Missing node"),
|
|
432
|
+
if (z(n, "Missing node"), zt(n)) return n;
|
|
433
433
|
}
|
|
434
434
|
return null;
|
|
435
435
|
}
|
|
@@ -444,24 +444,24 @@ function be(e) {
|
|
|
444
444
|
}
|
|
445
445
|
function He(e) {
|
|
446
446
|
const { parentNode: t } = e;
|
|
447
|
-
return
|
|
447
|
+
return yt(t) ? t.host : t;
|
|
448
448
|
}
|
|
449
|
-
function
|
|
449
|
+
function bt(e, t) {
|
|
450
450
|
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
451
|
}
|
|
452
|
-
function
|
|
452
|
+
function wt({
|
|
453
453
|
groupElement: e,
|
|
454
454
|
hitRegion: t,
|
|
455
455
|
pointerEventTarget: n
|
|
456
456
|
}) {
|
|
457
457
|
if (!Ne(n) || n.contains(e) || e.contains(n))
|
|
458
458
|
return !0;
|
|
459
|
-
if (
|
|
459
|
+
if (St(n, e) > 0) {
|
|
460
460
|
let o = n;
|
|
461
461
|
for (; o; ) {
|
|
462
462
|
if (o.contains(e))
|
|
463
463
|
return !0;
|
|
464
|
-
if (
|
|
464
|
+
if (bt(o.getBoundingClientRect(), t))
|
|
465
465
|
return !1;
|
|
466
466
|
o = o.parentElement;
|
|
467
467
|
}
|
|
@@ -473,18 +473,18 @@ function pe(e, t) {
|
|
|
473
473
|
return t.forEach((o, i) => {
|
|
474
474
|
if (i.disabled)
|
|
475
475
|
return;
|
|
476
|
-
const
|
|
476
|
+
const r = $e(i), l = gt(i.orientation, r, {
|
|
477
477
|
x: e.clientX,
|
|
478
478
|
y: e.clientY
|
|
479
479
|
});
|
|
480
|
-
l && l.distance.x <= 0 && l.distance.y <= 0 &&
|
|
480
|
+
l && l.distance.x <= 0 && l.distance.y <= 0 && wt({
|
|
481
481
|
groupElement: i.element,
|
|
482
482
|
hitRegion: l.hitRegion.rect,
|
|
483
483
|
pointerEventTarget: e.target
|
|
484
484
|
}) && n.push(l.hitRegion);
|
|
485
485
|
}), n;
|
|
486
486
|
}
|
|
487
|
-
function
|
|
487
|
+
function Lt(e, t) {
|
|
488
488
|
if (e.length !== t.length)
|
|
489
489
|
return !1;
|
|
490
490
|
for (let n = 0; n < e.length; n++)
|
|
@@ -492,10 +492,10 @@ function wt(e, t) {
|
|
|
492
492
|
return !1;
|
|
493
493
|
return !0;
|
|
494
494
|
}
|
|
495
|
-
function
|
|
495
|
+
function O(e, t) {
|
|
496
496
|
return R(e, t) ? 0 : e > t ? 1 : -1;
|
|
497
497
|
}
|
|
498
|
-
function
|
|
498
|
+
function B({
|
|
499
499
|
panelConstraints: e,
|
|
500
500
|
size: t
|
|
501
501
|
}) {
|
|
@@ -503,73 +503,93 @@ function V({
|
|
|
503
503
|
collapsedSize: n = 0,
|
|
504
504
|
collapsible: o,
|
|
505
505
|
maxSize: i = 100,
|
|
506
|
-
minSize:
|
|
506
|
+
minSize: r = 0
|
|
507
507
|
} = e;
|
|
508
|
-
if (
|
|
508
|
+
if (O(t, r) < 0)
|
|
509
509
|
if (o) {
|
|
510
|
-
const l = (n +
|
|
511
|
-
|
|
510
|
+
const l = (n + r) / 2;
|
|
511
|
+
O(t, l) < 0 ? t = n : t = r;
|
|
512
512
|
} else
|
|
513
|
-
t =
|
|
513
|
+
t = r;
|
|
514
514
|
return t = Math.min(i, t), t = D(t), t;
|
|
515
515
|
}
|
|
516
|
-
function
|
|
516
|
+
function te({
|
|
517
517
|
delta: e,
|
|
518
518
|
initialLayout: t,
|
|
519
519
|
panelConstraints: n,
|
|
520
520
|
pivotIndices: o,
|
|
521
521
|
prevLayout: i,
|
|
522
|
-
trigger:
|
|
522
|
+
trigger: r
|
|
523
523
|
}) {
|
|
524
524
|
if (R(e, 0))
|
|
525
525
|
return t;
|
|
526
|
-
const l = Object.values(t),
|
|
526
|
+
const l = Object.values(t), s = Object.values(i), a = [...l], [u, c] = o;
|
|
527
527
|
z(u != null, "Invalid first pivot index"), z(c != null, "Invalid second pivot index");
|
|
528
528
|
let h = 0;
|
|
529
|
-
|
|
530
|
-
{
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
529
|
+
switch (r) {
|
|
530
|
+
case "keyboard": {
|
|
531
|
+
{
|
|
532
|
+
const f = e < 0 ? c : u, d = n[f];
|
|
533
|
+
z(
|
|
534
|
+
d,
|
|
535
|
+
`Panel constraints not found for index ${f}`
|
|
536
|
+
);
|
|
537
|
+
const {
|
|
538
|
+
collapsedSize: p = 0,
|
|
539
|
+
collapsible: g,
|
|
540
|
+
minSize: v = 0
|
|
541
|
+
} = d;
|
|
542
|
+
if (g) {
|
|
543
|
+
const x = l[f];
|
|
544
|
+
if (z(
|
|
545
|
+
x != null,
|
|
546
|
+
`Previous layout not found for panel index ${f}`
|
|
547
|
+
), R(x, p)) {
|
|
548
|
+
const S = v - x;
|
|
549
|
+
O(S, Math.abs(e)) > 0 && (e = e < 0 ? 0 - S : S);
|
|
550
|
+
}
|
|
549
551
|
}
|
|
550
552
|
}
|
|
553
|
+
{
|
|
554
|
+
const f = e < 0 ? u : c, d = n[f];
|
|
555
|
+
z(
|
|
556
|
+
d,
|
|
557
|
+
`No panel constraints found for index ${f}`
|
|
558
|
+
);
|
|
559
|
+
const {
|
|
560
|
+
collapsedSize: p = 0,
|
|
561
|
+
collapsible: g,
|
|
562
|
+
minSize: v = 0
|
|
563
|
+
} = d;
|
|
564
|
+
if (g) {
|
|
565
|
+
const x = l[f];
|
|
566
|
+
if (z(
|
|
567
|
+
x != null,
|
|
568
|
+
`Previous layout not found for panel index ${f}`
|
|
569
|
+
), R(x, v)) {
|
|
570
|
+
const S = x - p;
|
|
571
|
+
O(S, Math.abs(e)) > 0 && (e = e < 0 ? 0 - S : S);
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
break;
|
|
551
576
|
}
|
|
552
|
-
{
|
|
553
|
-
const f = e < 0 ?
|
|
577
|
+
default: {
|
|
578
|
+
const f = e < 0 ? c : u, d = n[f];
|
|
554
579
|
z(
|
|
555
580
|
d,
|
|
556
|
-
`
|
|
581
|
+
`Panel constraints not found for index ${f}`
|
|
557
582
|
);
|
|
558
|
-
const {
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
x != null,
|
|
567
|
-
`Previous layout not found for panel index ${f}`
|
|
568
|
-
), R(x, v)) {
|
|
569
|
-
const S = x - p;
|
|
570
|
-
Z(S, Math.abs(e)) > 0 && (e = e < 0 ? 0 - S : S);
|
|
583
|
+
const { collapsible: p, collapsedSize: g, minSize: v } = d;
|
|
584
|
+
if (p)
|
|
585
|
+
if (e > 0) {
|
|
586
|
+
const x = v - g, S = x / 2;
|
|
587
|
+
O(e, v) < 0 && (e = O(e, S) <= 0 ? 0 : x);
|
|
588
|
+
} else {
|
|
589
|
+
const x = v - g, S = 100 - x / 2;
|
|
590
|
+
O(100 + e, v) > 0 && (e = O(100 + e, S) > 0 ? 0 : -x);
|
|
571
591
|
}
|
|
572
|
-
|
|
592
|
+
break;
|
|
573
593
|
}
|
|
574
594
|
}
|
|
575
595
|
{
|
|
@@ -581,7 +601,7 @@ function J({
|
|
|
581
601
|
v != null,
|
|
582
602
|
`Previous layout not found for panel index ${d}`
|
|
583
603
|
);
|
|
584
|
-
const S =
|
|
604
|
+
const S = B({
|
|
585
605
|
panelConstraints: n[d],
|
|
586
606
|
size: 100
|
|
587
607
|
}) - v;
|
|
@@ -599,7 +619,7 @@ function J({
|
|
|
599
619
|
g != null,
|
|
600
620
|
`Previous layout not found for panel index ${d}`
|
|
601
621
|
);
|
|
602
|
-
const v = g - p, x =
|
|
622
|
+
const v = g - p, x = B({
|
|
603
623
|
panelConstraints: n[d],
|
|
604
624
|
size: v
|
|
605
625
|
});
|
|
@@ -610,7 +630,7 @@ function J({
|
|
|
610
630
|
e < 0 ? d-- : d++;
|
|
611
631
|
}
|
|
612
632
|
}
|
|
613
|
-
if (
|
|
633
|
+
if (Lt(s, a))
|
|
614
634
|
return i;
|
|
615
635
|
{
|
|
616
636
|
const f = e < 0 ? c : u, d = l[f];
|
|
@@ -618,7 +638,7 @@ function J({
|
|
|
618
638
|
d != null,
|
|
619
639
|
`Previous layout not found for panel index ${f}`
|
|
620
640
|
);
|
|
621
|
-
const p = d + h, g =
|
|
641
|
+
const p = d + h, g = B({
|
|
622
642
|
panelConstraints: n[f],
|
|
623
643
|
size: p
|
|
624
644
|
});
|
|
@@ -630,7 +650,7 @@ function J({
|
|
|
630
650
|
w != null,
|
|
631
651
|
`Previous layout not found for panel index ${S}`
|
|
632
652
|
);
|
|
633
|
-
const C = w + v, P =
|
|
653
|
+
const C = w + v, P = B({
|
|
634
654
|
panelConstraints: n[S],
|
|
635
655
|
size: C
|
|
636
656
|
});
|
|
@@ -649,63 +669,63 @@ function J({
|
|
|
649
669
|
const m = Object.keys(i);
|
|
650
670
|
return a.reduce((f, d, p) => (f[m[p]] = d, f), {});
|
|
651
671
|
}
|
|
652
|
-
function
|
|
672
|
+
function $(e, t) {
|
|
653
673
|
if (Object.keys(e).length !== Object.keys(t).length)
|
|
654
674
|
return !1;
|
|
655
675
|
for (const n in e)
|
|
656
|
-
if (t[n] === void 0 ||
|
|
676
|
+
if (t[n] === void 0 || O(e[n], t[n]) !== 0)
|
|
657
677
|
return !1;
|
|
658
678
|
return !0;
|
|
659
679
|
}
|
|
660
|
-
function
|
|
680
|
+
function H({
|
|
661
681
|
layout: e,
|
|
662
682
|
panelConstraints: t
|
|
663
683
|
}) {
|
|
664
684
|
const o = [...Object.values(e)], i = o.reduce(
|
|
665
|
-
(
|
|
685
|
+
(s, a) => s + a,
|
|
666
686
|
0
|
|
667
687
|
);
|
|
668
688
|
if (o.length !== t.length)
|
|
669
689
|
throw Error(
|
|
670
|
-
`Invalid ${t.length} panel layout: ${o.map((
|
|
690
|
+
`Invalid ${t.length} panel layout: ${o.map((s) => `${s}%`).join(", ")}`
|
|
671
691
|
);
|
|
672
692
|
if (!R(i, 100) && o.length > 0)
|
|
673
|
-
for (let
|
|
674
|
-
const a = o[
|
|
675
|
-
z(a != null, `No layout data found for index ${
|
|
693
|
+
for (let s = 0; s < t.length; s++) {
|
|
694
|
+
const a = o[s];
|
|
695
|
+
z(a != null, `No layout data found for index ${s}`);
|
|
676
696
|
const u = 100 / i * a;
|
|
677
|
-
o[
|
|
697
|
+
o[s] = u;
|
|
678
698
|
}
|
|
679
|
-
let
|
|
680
|
-
for (let
|
|
681
|
-
const a = o[
|
|
682
|
-
z(a != null, `No layout data found for index ${
|
|
683
|
-
const u =
|
|
684
|
-
panelConstraints: t[
|
|
699
|
+
let r = 0;
|
|
700
|
+
for (let s = 0; s < t.length; s++) {
|
|
701
|
+
const a = o[s];
|
|
702
|
+
z(a != null, `No layout data found for index ${s}`);
|
|
703
|
+
const u = B({
|
|
704
|
+
panelConstraints: t[s],
|
|
685
705
|
size: a
|
|
686
706
|
});
|
|
687
|
-
a != u && (
|
|
707
|
+
a != u && (r += a - u, o[s] = u);
|
|
688
708
|
}
|
|
689
|
-
if (!R(
|
|
690
|
-
for (let
|
|
691
|
-
const a = o[
|
|
692
|
-
z(a != null, `No layout data found for index ${
|
|
693
|
-
const u = a +
|
|
694
|
-
panelConstraints: t[
|
|
709
|
+
if (!R(r, 0))
|
|
710
|
+
for (let s = 0; s < t.length; s++) {
|
|
711
|
+
const a = o[s];
|
|
712
|
+
z(a != null, `No layout data found for index ${s}`);
|
|
713
|
+
const u = a + r, c = B({
|
|
714
|
+
panelConstraints: t[s],
|
|
695
715
|
size: u
|
|
696
716
|
});
|
|
697
|
-
if (a !== c && (
|
|
717
|
+
if (a !== c && (r -= c - a, o[s] = c, R(r, 0)))
|
|
698
718
|
break;
|
|
699
719
|
}
|
|
700
720
|
const l = Object.keys(e);
|
|
701
|
-
return o.reduce((
|
|
721
|
+
return o.reduce((s, a, u) => (s[l[u]] = a, s), {});
|
|
702
722
|
}
|
|
703
723
|
function je({
|
|
704
724
|
groupId: e,
|
|
705
725
|
panelId: t
|
|
706
726
|
}) {
|
|
707
727
|
const n = () => {
|
|
708
|
-
const { mountedGroups:
|
|
728
|
+
const { mountedGroups: s } = G();
|
|
709
729
|
for (const [
|
|
710
730
|
a,
|
|
711
731
|
{
|
|
@@ -714,7 +734,7 @@ function je({
|
|
|
714
734
|
layout: h,
|
|
715
735
|
separatorToPanels: y
|
|
716
736
|
}
|
|
717
|
-
] of
|
|
737
|
+
] of s)
|
|
718
738
|
if (a.id === e)
|
|
719
739
|
return {
|
|
720
740
|
defaultLayoutDeferred: u,
|
|
@@ -725,25 +745,25 @@ function je({
|
|
|
725
745
|
};
|
|
726
746
|
throw Error(`Group ${e} not found`);
|
|
727
747
|
}, o = () => {
|
|
728
|
-
const
|
|
748
|
+
const s = n().derivedPanelConstraints.find(
|
|
729
749
|
(a) => a.panelId === t
|
|
730
750
|
);
|
|
731
|
-
if (
|
|
732
|
-
return
|
|
751
|
+
if (s !== void 0)
|
|
752
|
+
return s;
|
|
733
753
|
throw Error(`Panel constraints not found for Panel ${t}`);
|
|
734
754
|
}, i = () => {
|
|
735
|
-
const
|
|
736
|
-
if (
|
|
737
|
-
return
|
|
755
|
+
const s = n().group.panels.find((a) => a.id === t);
|
|
756
|
+
if (s !== void 0)
|
|
757
|
+
return s;
|
|
738
758
|
throw Error(`Layout not found for Panel ${t}`);
|
|
739
|
-
},
|
|
740
|
-
const
|
|
741
|
-
if (
|
|
742
|
-
return
|
|
759
|
+
}, r = () => {
|
|
760
|
+
const s = n().layout[t];
|
|
761
|
+
if (s !== void 0)
|
|
762
|
+
return s;
|
|
743
763
|
throw Error(`Layout not found for Panel ${t}`);
|
|
744
|
-
}, l = (
|
|
745
|
-
const a =
|
|
746
|
-
if (
|
|
764
|
+
}, l = (s) => {
|
|
765
|
+
const a = r();
|
|
766
|
+
if (s === a)
|
|
747
767
|
return;
|
|
748
768
|
const {
|
|
749
769
|
defaultLayoutDeferred: u,
|
|
@@ -751,18 +771,18 @@ function je({
|
|
|
751
771
|
group: h,
|
|
752
772
|
layout: y,
|
|
753
773
|
separatorToPanels: m
|
|
754
|
-
} = n(), f = h.panels.findIndex((v) => v.id === t), d = f === h.panels.length - 1, p =
|
|
755
|
-
delta: d ? a -
|
|
774
|
+
} = n(), f = h.panels.findIndex((v) => v.id === t), d = f === h.panels.length - 1, p = te({
|
|
775
|
+
delta: d ? a - s : s - a,
|
|
756
776
|
initialLayout: y,
|
|
757
777
|
panelConstraints: c,
|
|
758
778
|
pivotIndices: d ? [f - 1, f] : [f, f + 1],
|
|
759
779
|
prevLayout: y,
|
|
760
780
|
trigger: "imperative-api"
|
|
761
|
-
}), g =
|
|
781
|
+
}), g = H({
|
|
762
782
|
layout: p,
|
|
763
783
|
panelConstraints: c
|
|
764
784
|
});
|
|
765
|
-
|
|
785
|
+
$(y, g) || M((v) => ({
|
|
766
786
|
mountedGroups: new Map(v.mountedGroups).set(h, {
|
|
767
787
|
defaultLayoutDeferred: u,
|
|
768
788
|
derivedPanelConstraints: c,
|
|
@@ -773,38 +793,38 @@ function je({
|
|
|
773
793
|
};
|
|
774
794
|
return {
|
|
775
795
|
collapse: () => {
|
|
776
|
-
const { collapsible:
|
|
777
|
-
|
|
796
|
+
const { collapsible: s, collapsedSize: a } = o(), { mutableValues: u } = i(), c = r();
|
|
797
|
+
s && c !== a && (u.expandToSize = c, l(a));
|
|
778
798
|
},
|
|
779
799
|
expand: () => {
|
|
780
|
-
const { collapsible:
|
|
781
|
-
if (
|
|
800
|
+
const { collapsible: s, collapsedSize: a, minSize: u } = o(), { mutableValues: c } = i(), h = r();
|
|
801
|
+
if (s && h === a) {
|
|
782
802
|
let y = c.expandToSize ?? u;
|
|
783
803
|
y === 0 && (y = 1), l(y);
|
|
784
804
|
}
|
|
785
805
|
},
|
|
786
806
|
getSize: () => {
|
|
787
|
-
const { group:
|
|
807
|
+
const { group: s } = n(), a = r(), { element: u } = i(), c = s.orientation === "horizontal" ? u.offsetWidth : u.offsetHeight;
|
|
788
808
|
return {
|
|
789
809
|
asPercentage: a,
|
|
790
810
|
inPixels: c
|
|
791
811
|
};
|
|
792
812
|
},
|
|
793
813
|
isCollapsed: () => {
|
|
794
|
-
const { collapsible:
|
|
795
|
-
return
|
|
814
|
+
const { collapsible: s, collapsedSize: a } = o(), u = r();
|
|
815
|
+
return s && R(a, u);
|
|
796
816
|
},
|
|
797
|
-
resize: (
|
|
798
|
-
if (
|
|
817
|
+
resize: (s) => {
|
|
818
|
+
if (r() !== s) {
|
|
799
819
|
let u;
|
|
800
|
-
switch (typeof
|
|
820
|
+
switch (typeof s) {
|
|
801
821
|
case "number": {
|
|
802
|
-
const { group: c } = n(), h =
|
|
803
|
-
u = D(
|
|
822
|
+
const { group: c } = n(), h = K({ group: c });
|
|
823
|
+
u = D(s / h * 100);
|
|
804
824
|
break;
|
|
805
825
|
}
|
|
806
826
|
case "string": {
|
|
807
|
-
u = parseFloat(
|
|
827
|
+
u = parseFloat(s);
|
|
808
828
|
break;
|
|
809
829
|
}
|
|
810
830
|
}
|
|
@@ -820,14 +840,14 @@ function we(e) {
|
|
|
820
840
|
pe(e, t).forEach((o) => {
|
|
821
841
|
if (o.separator) {
|
|
822
842
|
const i = o.panels.find(
|
|
823
|
-
(
|
|
843
|
+
(r) => r.panelConstraints.defaultSize !== void 0
|
|
824
844
|
);
|
|
825
845
|
if (i) {
|
|
826
|
-
const
|
|
846
|
+
const r = i.panelConstraints.defaultSize, l = je({
|
|
827
847
|
groupId: o.group.id,
|
|
828
848
|
panelId: i.id
|
|
829
849
|
});
|
|
830
|
-
l &&
|
|
850
|
+
l && r !== void 0 && (l.resize(r), e.preventDefault());
|
|
831
851
|
}
|
|
832
852
|
}
|
|
833
853
|
});
|
|
@@ -860,19 +880,19 @@ function Ve({
|
|
|
860
880
|
const {
|
|
861
881
|
defaultLayoutDeferred: o,
|
|
862
882
|
derivedPanelConstraints: i,
|
|
863
|
-
group:
|
|
883
|
+
group: r,
|
|
864
884
|
layout: l,
|
|
865
|
-
separatorToPanels:
|
|
866
|
-
} = t(), a =
|
|
885
|
+
separatorToPanels: s
|
|
886
|
+
} = t(), a = H({
|
|
867
887
|
layout: n,
|
|
868
888
|
panelConstraints: i
|
|
869
889
|
});
|
|
870
|
-
return o ? l : (
|
|
871
|
-
mountedGroups: new Map(u.mountedGroups).set(
|
|
890
|
+
return o ? l : ($(l, a) || M((u) => ({
|
|
891
|
+
mountedGroups: new Map(u.mountedGroups).set(r, {
|
|
872
892
|
defaultLayoutDeferred: o,
|
|
873
893
|
derivedPanelConstraints: i,
|
|
874
894
|
layout: a,
|
|
875
|
-
separatorToPanels:
|
|
895
|
+
separatorToPanels: s
|
|
876
896
|
})
|
|
877
897
|
})), a);
|
|
878
898
|
}
|
|
@@ -882,25 +902,25 @@ function Ue(e) {
|
|
|
882
902
|
const { mountedGroups: t } = G(), n = t.get(e);
|
|
883
903
|
return z(n, `Mounted Group ${e.id} not found`), n;
|
|
884
904
|
}
|
|
885
|
-
function
|
|
905
|
+
function N(e, t) {
|
|
886
906
|
const n = ae(e), o = Ue(n), i = n.separators.find(
|
|
887
907
|
(h) => h.element === e
|
|
888
908
|
);
|
|
889
909
|
z(i, "Matching separator not found");
|
|
890
|
-
const
|
|
891
|
-
z(
|
|
892
|
-
const l =
|
|
910
|
+
const r = o.separatorToPanels.get(i);
|
|
911
|
+
z(r, "Matching panels not found");
|
|
912
|
+
const l = r.map((h) => n.panels.indexOf(h)), a = Ve({ groupId: n.id }).getLayout(), u = te({
|
|
893
913
|
delta: t,
|
|
894
914
|
initialLayout: a,
|
|
895
915
|
panelConstraints: o.derivedPanelConstraints,
|
|
896
916
|
pivotIndices: l,
|
|
897
917
|
prevLayout: a,
|
|
898
918
|
trigger: "keyboard"
|
|
899
|
-
}), c =
|
|
919
|
+
}), c = H({
|
|
900
920
|
layout: u,
|
|
901
921
|
panelConstraints: o.derivedPanelConstraints
|
|
902
922
|
});
|
|
903
|
-
|
|
923
|
+
$(a, c) || M((h) => ({
|
|
904
924
|
mountedGroups: new Map(h.mountedGroups).set(n, {
|
|
905
925
|
defaultLayoutDeferred: o.defaultLayoutDeferred,
|
|
906
926
|
derivedPanelConstraints: o.derivedPanelConstraints,
|
|
@@ -916,39 +936,39 @@ function Le(e) {
|
|
|
916
936
|
if (!n.disabled)
|
|
917
937
|
switch (e.key) {
|
|
918
938
|
case "ArrowDown": {
|
|
919
|
-
e.preventDefault(), n.orientation === "vertical" &&
|
|
939
|
+
e.preventDefault(), n.orientation === "vertical" && N(t, 5);
|
|
920
940
|
break;
|
|
921
941
|
}
|
|
922
942
|
case "ArrowLeft": {
|
|
923
|
-
e.preventDefault(), n.orientation === "horizontal" &&
|
|
943
|
+
e.preventDefault(), n.orientation === "horizontal" && N(t, -5);
|
|
924
944
|
break;
|
|
925
945
|
}
|
|
926
946
|
case "ArrowRight": {
|
|
927
|
-
e.preventDefault(), n.orientation === "horizontal" &&
|
|
947
|
+
e.preventDefault(), n.orientation === "horizontal" && N(t, 5);
|
|
928
948
|
break;
|
|
929
949
|
}
|
|
930
950
|
case "ArrowUp": {
|
|
931
|
-
e.preventDefault(), n.orientation === "vertical" &&
|
|
951
|
+
e.preventDefault(), n.orientation === "vertical" && N(t, -5);
|
|
932
952
|
break;
|
|
933
953
|
}
|
|
934
954
|
case "End": {
|
|
935
|
-
e.preventDefault(),
|
|
955
|
+
e.preventDefault(), N(t, 100);
|
|
936
956
|
break;
|
|
937
957
|
}
|
|
938
958
|
case "Enter": {
|
|
939
959
|
e.preventDefault();
|
|
940
|
-
const o = ae(t), { derivedPanelConstraints: i, layout:
|
|
960
|
+
const o = ae(t), { derivedPanelConstraints: i, layout: r, separatorToPanels: l } = Ue(o), s = o.separators.find(
|
|
941
961
|
(h) => h.element === t
|
|
942
962
|
);
|
|
943
|
-
z(
|
|
944
|
-
const a = l.get(
|
|
963
|
+
z(s, "Matching separator not found");
|
|
964
|
+
const a = l.get(s);
|
|
945
965
|
z(a, "Matching panels not found");
|
|
946
966
|
const u = a[0], c = i.find(
|
|
947
967
|
(h) => h.panelId === u.id
|
|
948
968
|
);
|
|
949
969
|
if (z(c, "Panel metadata not found"), c.collapsible) {
|
|
950
|
-
const h =
|
|
951
|
-
|
|
970
|
+
const h = r[u.id], y = c.collapsedSize === h ? o.inMemoryLastExpandedPanelSizes[u.id] ?? c.minSize : c.collapsedSize;
|
|
971
|
+
N(t, y - h);
|
|
952
972
|
}
|
|
953
973
|
break;
|
|
954
974
|
}
|
|
@@ -956,16 +976,16 @@ function Le(e) {
|
|
|
956
976
|
e.preventDefault();
|
|
957
977
|
const i = ae(t).separators.map(
|
|
958
978
|
(a) => a.element
|
|
959
|
-
),
|
|
979
|
+
), r = Array.from(i).findIndex(
|
|
960
980
|
(a) => a === e.currentTarget
|
|
961
981
|
);
|
|
962
|
-
z(
|
|
963
|
-
const l = e.shiftKey ?
|
|
982
|
+
z(r !== null, "Index not found");
|
|
983
|
+
const l = e.shiftKey ? r > 0 ? r - 1 : i.length - 1 : r + 1 < i.length ? r + 1 : 0;
|
|
964
984
|
i[l].focus();
|
|
965
985
|
break;
|
|
966
986
|
}
|
|
967
987
|
case "Home": {
|
|
968
|
-
e.preventDefault(),
|
|
988
|
+
e.preventDefault(), N(t, -100);
|
|
969
989
|
break;
|
|
970
990
|
}
|
|
971
991
|
}
|
|
@@ -975,30 +995,28 @@ function Ce(e) {
|
|
|
975
995
|
return;
|
|
976
996
|
if (e.pointerType === "mouse" && e.button > 0)
|
|
977
997
|
return;
|
|
978
|
-
const { mountedGroups: t } = G(), n = pe(e, t), o = /* @__PURE__ */ new
|
|
979
|
-
let
|
|
980
|
-
n.forEach((
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
const u = t.get(a.group);
|
|
985
|
-
u && l.set(a.group, u.layout);
|
|
998
|
+
const { mountedGroups: t } = G(), n = pe(e, t), o = /* @__PURE__ */ new Map();
|
|
999
|
+
let i = !1;
|
|
1000
|
+
n.forEach((r) => {
|
|
1001
|
+
r.separator && (i || (i = !0, r.separator.element.focus()));
|
|
1002
|
+
const l = t.get(r.group);
|
|
1003
|
+
l && o.set(r.group, l.layout);
|
|
986
1004
|
}), M({
|
|
987
1005
|
interactionState: {
|
|
988
1006
|
hitRegions: n,
|
|
989
|
-
initialLayoutMap:
|
|
1007
|
+
initialLayoutMap: o,
|
|
990
1008
|
pointerDownAtPoint: { x: e.clientX, y: e.clientY },
|
|
991
1009
|
state: "active"
|
|
992
1010
|
}
|
|
993
1011
|
}), n.length && e.preventDefault();
|
|
994
1012
|
}
|
|
995
|
-
const
|
|
1013
|
+
const Ct = (e) => e, ce = () => {
|
|
996
1014
|
}, We = 1, Be = 2, Ke = 4, Xe = 8, Pe = 3, Re = 12;
|
|
997
1015
|
let se;
|
|
998
1016
|
function Me() {
|
|
999
1017
|
return se === void 0 && (se = !1, typeof window < "u" && (window.navigator.userAgent.includes("Chrome") || window.navigator.userAgent.includes("Firefox")) && (se = !0)), se;
|
|
1000
1018
|
}
|
|
1001
|
-
function
|
|
1019
|
+
function Pt({
|
|
1002
1020
|
cursorFlags: e,
|
|
1003
1021
|
groups: t,
|
|
1004
1022
|
state: n
|
|
@@ -1007,9 +1025,9 @@ function Ct({
|
|
|
1007
1025
|
switch (n) {
|
|
1008
1026
|
case "active":
|
|
1009
1027
|
case "hover":
|
|
1010
|
-
t.forEach((
|
|
1011
|
-
if (!
|
|
1012
|
-
switch (
|
|
1028
|
+
t.forEach((r) => {
|
|
1029
|
+
if (!r.disableCursor)
|
|
1030
|
+
switch (r.orientation) {
|
|
1013
1031
|
case "horizontal": {
|
|
1014
1032
|
o++;
|
|
1015
1033
|
break;
|
|
@@ -1026,12 +1044,12 @@ function Ct({
|
|
|
1026
1044
|
switch (n) {
|
|
1027
1045
|
case "active": {
|
|
1028
1046
|
if (e && Me()) {
|
|
1029
|
-
const
|
|
1030
|
-
if (s)
|
|
1031
|
-
return r ? "se-resize" : a ? "ne-resize" : "e-resize";
|
|
1032
|
-
if (l)
|
|
1033
|
-
return r ? "sw-resize" : a ? "nw-resize" : "w-resize";
|
|
1047
|
+
const r = (e & We) !== 0, l = (e & Be) !== 0, s = (e & Ke) !== 0, a = (e & Xe) !== 0;
|
|
1034
1048
|
if (r)
|
|
1049
|
+
return s ? "se-resize" : a ? "ne-resize" : "e-resize";
|
|
1050
|
+
if (l)
|
|
1051
|
+
return s ? "sw-resize" : a ? "nw-resize" : "w-resize";
|
|
1052
|
+
if (s)
|
|
1035
1053
|
return "s-resize";
|
|
1036
1054
|
if (a)
|
|
1037
1055
|
return "n-resize";
|
|
@@ -1051,14 +1069,14 @@ function he(e) {
|
|
|
1051
1069
|
switch (i.state) {
|
|
1052
1070
|
case "active":
|
|
1053
1071
|
case "hover": {
|
|
1054
|
-
const
|
|
1072
|
+
const r = Pt({
|
|
1055
1073
|
cursorFlags: o,
|
|
1056
|
-
groups: i.hitRegions.map((
|
|
1074
|
+
groups: i.hitRegions.map((s) => s.group),
|
|
1057
1075
|
state: i.state
|
|
1058
|
-
}), l = `*, *:hover {cursor: ${
|
|
1076
|
+
}), l = `*, *:hover {cursor: ${r} !important; ${i.state === "active" ? "touch-action: none;" : ""} }`;
|
|
1059
1077
|
if (t === l)
|
|
1060
1078
|
return;
|
|
1061
|
-
t = l,
|
|
1079
|
+
t = l, r ? n.cssRules.length === 0 ? n.insertRule(l) : n.replaceSync(l) : n.cssRules.length === 1 && n.deleteRule(0);
|
|
1062
1080
|
break;
|
|
1063
1081
|
}
|
|
1064
1082
|
case "inactive": {
|
|
@@ -1077,15 +1095,15 @@ function qe({
|
|
|
1077
1095
|
hitRegions: n,
|
|
1078
1096
|
initialLayoutMap: o,
|
|
1079
1097
|
mountedGroups: i,
|
|
1080
|
-
pointerDownAtPoint:
|
|
1098
|
+
pointerDownAtPoint: r,
|
|
1081
1099
|
prevCursorFlags: l
|
|
1082
1100
|
}) {
|
|
1083
|
-
let
|
|
1101
|
+
let s = 0;
|
|
1084
1102
|
const a = new Map(i);
|
|
1085
1103
|
n.forEach((c) => {
|
|
1086
1104
|
const { group: h, groupSize: y } = c, { disableCursor: m, orientation: f, panels: d } = h;
|
|
1087
1105
|
let p = 0;
|
|
1088
|
-
|
|
1106
|
+
r ? f === "horizontal" ? p = (t.clientX - r.x) / y * 100 : p = (t.clientY - r.y) / y * 100 : f === "horizontal" ? p = t.clientX < 0 ? -100 : 100 : p = t.clientY < 0 ? -100 : 100;
|
|
1089
1107
|
const g = o.get(h), {
|
|
1090
1108
|
defaultLayoutDeferred: v,
|
|
1091
1109
|
derivedPanelConstraints: x,
|
|
@@ -1093,7 +1111,7 @@ function qe({
|
|
|
1093
1111
|
separatorToPanels: w
|
|
1094
1112
|
} = i.get(h) ?? { defaultLayoutDeferred: !1 };
|
|
1095
1113
|
if (x && g && S && w) {
|
|
1096
|
-
const C =
|
|
1114
|
+
const C = te({
|
|
1097
1115
|
delta: p,
|
|
1098
1116
|
initialLayout: g,
|
|
1099
1117
|
panelConstraints: x,
|
|
@@ -1101,15 +1119,15 @@ function qe({
|
|
|
1101
1119
|
prevLayout: S,
|
|
1102
1120
|
trigger: "mouse-or-touch"
|
|
1103
1121
|
});
|
|
1104
|
-
if (
|
|
1122
|
+
if ($(C, S)) {
|
|
1105
1123
|
if (p !== 0 && !m)
|
|
1106
1124
|
switch (f) {
|
|
1107
1125
|
case "horizontal": {
|
|
1108
|
-
|
|
1126
|
+
s |= p < 0 ? We : Be;
|
|
1109
1127
|
break;
|
|
1110
1128
|
}
|
|
1111
1129
|
case "vertical": {
|
|
1112
|
-
|
|
1130
|
+
s |= p < 0 ? Ke : Xe;
|
|
1113
1131
|
break;
|
|
1114
1132
|
}
|
|
1115
1133
|
}
|
|
@@ -1126,7 +1144,7 @@ function qe({
|
|
|
1126
1144
|
}
|
|
1127
1145
|
});
|
|
1128
1146
|
let u = 0;
|
|
1129
|
-
t.movementX === 0 ? u |= l & Pe : u |=
|
|
1147
|
+
t.movementX === 0 ? u |= l & Pe : u |= s & Pe, t.movementY === 0 ? u |= l & Re : u |= s & Re, M({
|
|
1130
1148
|
cursorFlags: u,
|
|
1131
1149
|
mountedGroups: a
|
|
1132
1150
|
}), he(e);
|
|
@@ -1213,34 +1231,34 @@ function Ie(e) {
|
|
|
1213
1231
|
function De(e) {
|
|
1214
1232
|
let t = 0, n = 0;
|
|
1215
1233
|
const o = {};
|
|
1216
|
-
for (const
|
|
1217
|
-
if (
|
|
1234
|
+
for (const r of e)
|
|
1235
|
+
if (r.defaultSize !== void 0) {
|
|
1218
1236
|
t++;
|
|
1219
|
-
const l = D(
|
|
1220
|
-
n += l, o[
|
|
1237
|
+
const l = D(r.defaultSize);
|
|
1238
|
+
n += l, o[r.panelId] = l;
|
|
1221
1239
|
} else
|
|
1222
|
-
o[
|
|
1240
|
+
o[r.panelId] = void 0;
|
|
1223
1241
|
const i = e.length - t;
|
|
1224
1242
|
if (i !== 0) {
|
|
1225
|
-
const
|
|
1243
|
+
const r = D((100 - n) / i);
|
|
1226
1244
|
for (const l of e)
|
|
1227
|
-
l.defaultSize === void 0 && (o[l.panelId] =
|
|
1245
|
+
l.defaultSize === void 0 && (o[l.panelId] = r);
|
|
1228
1246
|
}
|
|
1229
1247
|
return o;
|
|
1230
1248
|
}
|
|
1231
|
-
function
|
|
1249
|
+
function Rt(e, t, n) {
|
|
1232
1250
|
if (!n[0])
|
|
1233
1251
|
return;
|
|
1234
1252
|
const i = e.panels.find((u) => u.element === t);
|
|
1235
1253
|
if (!i || !i.onResize)
|
|
1236
1254
|
return;
|
|
1237
|
-
const
|
|
1238
|
-
asPercentage: D(l /
|
|
1255
|
+
const r = K({ group: e }), l = e.orientation === "horizontal" ? i.element.offsetWidth : i.element.offsetHeight, s = i.mutableValues.prevSize, a = {
|
|
1256
|
+
asPercentage: D(l / r * 100),
|
|
1239
1257
|
inPixels: l
|
|
1240
1258
|
};
|
|
1241
|
-
i.mutableValues.prevSize = a, i.onResize(a, i.id,
|
|
1259
|
+
i.mutableValues.prevSize = a, i.onResize(a, i.id, s);
|
|
1242
1260
|
}
|
|
1243
|
-
function
|
|
1261
|
+
function Mt(e, t) {
|
|
1244
1262
|
if (Object.keys(e).length !== Object.keys(t).length)
|
|
1245
1263
|
return !1;
|
|
1246
1264
|
for (const o in e)
|
|
@@ -1248,7 +1266,7 @@ function Rt(e, t) {
|
|
|
1248
1266
|
return !1;
|
|
1249
1267
|
return !0;
|
|
1250
1268
|
}
|
|
1251
|
-
function
|
|
1269
|
+
function Et(e, t) {
|
|
1252
1270
|
const n = e.map((i) => i.id), o = Object.keys(t);
|
|
1253
1271
|
if (n.length !== o.length)
|
|
1254
1272
|
return !1;
|
|
@@ -1257,28 +1275,28 @@ function Mt(e, t) {
|
|
|
1257
1275
|
return !1;
|
|
1258
1276
|
return !0;
|
|
1259
1277
|
}
|
|
1260
|
-
const
|
|
1261
|
-
function
|
|
1278
|
+
const W = /* @__PURE__ */ new Map();
|
|
1279
|
+
function kt(e) {
|
|
1262
1280
|
let t = !0;
|
|
1263
1281
|
z(
|
|
1264
1282
|
e.element.ownerDocument.defaultView,
|
|
1265
1283
|
"Cannot register an unmounted Group"
|
|
1266
1284
|
);
|
|
1267
|
-
const n = e.element.ownerDocument.defaultView.ResizeObserver, o = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set(),
|
|
1285
|
+
const n = e.element.ownerDocument.defaultView.ResizeObserver, o = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set(), r = new n((f) => {
|
|
1268
1286
|
for (const d of f) {
|
|
1269
1287
|
const { borderBoxSize: p, target: g } = d;
|
|
1270
1288
|
if (g === e.element) {
|
|
1271
1289
|
if (t) {
|
|
1272
|
-
if (
|
|
1290
|
+
if (K({ group: e }) === 0)
|
|
1273
1291
|
return;
|
|
1274
1292
|
M((x) => {
|
|
1275
1293
|
const S = x.mountedGroups.get(e);
|
|
1276
1294
|
if (S) {
|
|
1277
|
-
const w = ve(e), C = S.defaultLayoutDeferred ? De(w) : S.layout, P =
|
|
1295
|
+
const w = ve(e), C = S.defaultLayoutDeferred ? De(w) : S.layout, P = H({
|
|
1278
1296
|
layout: C,
|
|
1279
1297
|
panelConstraints: w
|
|
1280
1298
|
});
|
|
1281
|
-
return !S.defaultLayoutDeferred &&
|
|
1299
|
+
return !S.defaultLayoutDeferred && $(C, P) && Mt(
|
|
1282
1300
|
S.derivedPanelConstraints,
|
|
1283
1301
|
w
|
|
1284
1302
|
) ? x : {
|
|
@@ -1294,33 +1312,33 @@ function Et(e) {
|
|
|
1294
1312
|
});
|
|
1295
1313
|
}
|
|
1296
1314
|
} else
|
|
1297
|
-
|
|
1315
|
+
Rt(e, g, p);
|
|
1298
1316
|
}
|
|
1299
1317
|
});
|
|
1300
|
-
|
|
1318
|
+
r.observe(e.element), e.panels.forEach((f) => {
|
|
1301
1319
|
z(
|
|
1302
1320
|
!o.has(f.id),
|
|
1303
1321
|
`Panel ids must be unique; id "${f.id}" was used more than once`
|
|
1304
|
-
), o.add(f.id), f.onResize &&
|
|
1322
|
+
), o.add(f.id), f.onResize && r.observe(f.element);
|
|
1305
1323
|
});
|
|
1306
|
-
const l =
|
|
1324
|
+
const l = K({ group: e }), s = ve(e), a = e.panels.map(({ id: f }) => f).join(",");
|
|
1307
1325
|
let u = e.defaultLayout;
|
|
1308
|
-
u && (
|
|
1309
|
-
const c = e.inMemoryLayouts[a] ?? u ?? De(
|
|
1326
|
+
u && (Et(e.panels, u) || (u = void 0));
|
|
1327
|
+
const c = e.inMemoryLayouts[a] ?? u ?? De(s), h = H({
|
|
1310
1328
|
layout: c,
|
|
1311
|
-
panelConstraints:
|
|
1329
|
+
panelConstraints: s
|
|
1312
1330
|
}), y = $e(e), m = e.element.ownerDocument;
|
|
1313
1331
|
return M((f) => {
|
|
1314
1332
|
const d = /* @__PURE__ */ new Map();
|
|
1315
|
-
return
|
|
1333
|
+
return W.set(
|
|
1316
1334
|
m,
|
|
1317
|
-
(
|
|
1335
|
+
(W.get(m) ?? 0) + 1
|
|
1318
1336
|
), y.forEach((p) => {
|
|
1319
1337
|
p.separator && d.set(p.separator, p.panels);
|
|
1320
1338
|
}), {
|
|
1321
1339
|
mountedGroups: new Map(f.mountedGroups).set(e, {
|
|
1322
1340
|
defaultLayoutDeferred: l === 0,
|
|
1323
|
-
derivedPanelConstraints:
|
|
1341
|
+
derivedPanelConstraints: s,
|
|
1324
1342
|
layout: h,
|
|
1325
1343
|
separatorToPanels: d
|
|
1326
1344
|
})
|
|
@@ -1330,16 +1348,16 @@ function Et(e) {
|
|
|
1330
1348
|
!i.has(f.id),
|
|
1331
1349
|
`Separator ids must be unique; id "${f.id}" was used more than once`
|
|
1332
1350
|
), i.add(f.id), f.element.addEventListener("keydown", Le);
|
|
1333
|
-
}),
|
|
1334
|
-
t = !1,
|
|
1351
|
+
}), W.get(m) === 1 && (m.addEventListener("dblclick", we, !0), m.addEventListener("pointerdown", Ce, !0), m.addEventListener("pointerleave", ke), m.addEventListener("pointermove", Ge), m.addEventListener("pointerup", Ie, !0)), function() {
|
|
1352
|
+
t = !1, W.set(
|
|
1335
1353
|
m,
|
|
1336
|
-
Math.max(0, (
|
|
1354
|
+
Math.max(0, (W.get(m) ?? 0) - 1)
|
|
1337
1355
|
), M((d) => {
|
|
1338
1356
|
const p = new Map(d.mountedGroups);
|
|
1339
1357
|
return p.delete(e), { mountedGroups: p };
|
|
1340
1358
|
}), e.separators.forEach((d) => {
|
|
1341
1359
|
d.element.removeEventListener("keydown", Le);
|
|
1342
|
-
}),
|
|
1360
|
+
}), W.get(m) || (m.removeEventListener(
|
|
1343
1361
|
"dblclick",
|
|
1344
1362
|
we,
|
|
1345
1363
|
!0
|
|
@@ -1347,29 +1365,29 @@ function Et(e) {
|
|
|
1347
1365
|
"pointerdown",
|
|
1348
1366
|
Ce,
|
|
1349
1367
|
!0
|
|
1350
|
-
), m.removeEventListener("pointerleave", ke), m.removeEventListener("pointermove", Ge), m.removeEventListener("pointerup", Ie, !0)),
|
|
1368
|
+
), m.removeEventListener("pointerleave", ke), m.removeEventListener("pointermove", Ge), m.removeEventListener("pointerup", Ie, !0)), r.disconnect();
|
|
1351
1369
|
};
|
|
1352
1370
|
}
|
|
1353
1371
|
function Ye() {
|
|
1354
|
-
const [e, t] =
|
|
1372
|
+
const [e, t] = ee({}), n = Z(() => t({}), []);
|
|
1355
1373
|
return [e, n];
|
|
1356
1374
|
}
|
|
1357
1375
|
function me(e) {
|
|
1358
|
-
const t =
|
|
1376
|
+
const t = nt();
|
|
1359
1377
|
return `${e ?? t}`;
|
|
1360
1378
|
}
|
|
1361
|
-
const
|
|
1362
|
-
function
|
|
1379
|
+
const j = typeof window < "u" ? Te : Oe;
|
|
1380
|
+
function J(e) {
|
|
1363
1381
|
const t = k(e);
|
|
1364
|
-
return
|
|
1382
|
+
return j(() => {
|
|
1365
1383
|
t.current = e;
|
|
1366
|
-
}, [e]),
|
|
1384
|
+
}, [e]), Z(
|
|
1367
1385
|
(...n) => t.current?.(...n),
|
|
1368
1386
|
[t]
|
|
1369
1387
|
);
|
|
1370
1388
|
}
|
|
1371
1389
|
function ge(...e) {
|
|
1372
|
-
return
|
|
1390
|
+
return J((t) => {
|
|
1373
1391
|
e.forEach((n) => {
|
|
1374
1392
|
if (n)
|
|
1375
1393
|
switch (typeof n) {
|
|
@@ -1385,35 +1403,35 @@ function ge(...e) {
|
|
|
1385
1403
|
});
|
|
1386
1404
|
});
|
|
1387
1405
|
}
|
|
1388
|
-
function
|
|
1406
|
+
function Gt(e) {
|
|
1389
1407
|
const t = k({ ...e });
|
|
1390
|
-
return
|
|
1408
|
+
return j(() => {
|
|
1391
1409
|
for (const n in e)
|
|
1392
1410
|
t.current[n] = e[n];
|
|
1393
1411
|
}, [e]), t.current;
|
|
1394
1412
|
}
|
|
1395
|
-
const Ze =
|
|
1396
|
-
function
|
|
1413
|
+
const Ze = ot(null);
|
|
1414
|
+
function It(e, t) {
|
|
1397
1415
|
const n = k({
|
|
1398
1416
|
getLayout: () => ({}),
|
|
1399
|
-
setLayout:
|
|
1417
|
+
setLayout: Ct
|
|
1400
1418
|
});
|
|
1401
|
-
|
|
1419
|
+
Ae(t, () => n.current, []), j(() => {
|
|
1402
1420
|
Object.assign(
|
|
1403
1421
|
n.current,
|
|
1404
1422
|
Ve({ groupId: e })
|
|
1405
1423
|
);
|
|
1406
1424
|
});
|
|
1407
1425
|
}
|
|
1408
|
-
function
|
|
1426
|
+
function Dt({
|
|
1409
1427
|
children: e,
|
|
1410
1428
|
className: t,
|
|
1411
1429
|
defaultLayout: n,
|
|
1412
1430
|
disableCursor: o,
|
|
1413
1431
|
disabled: i,
|
|
1414
|
-
elementRef:
|
|
1432
|
+
elementRef: r,
|
|
1415
1433
|
groupRef: l,
|
|
1416
|
-
id:
|
|
1434
|
+
id: s,
|
|
1417
1435
|
onLayoutChange: a,
|
|
1418
1436
|
onLayoutChanged: u,
|
|
1419
1437
|
orientation: c = "horizontal",
|
|
@@ -1427,37 +1445,37 @@ function It({
|
|
|
1427
1445
|
const f = k({
|
|
1428
1446
|
onLayoutChange: {},
|
|
1429
1447
|
onLayoutChanged: {}
|
|
1430
|
-
}), d =
|
|
1431
|
-
|
|
1432
|
-
}), p =
|
|
1433
|
-
|
|
1434
|
-
}), g = me(
|
|
1448
|
+
}), d = J((b) => {
|
|
1449
|
+
$(f.current.onLayoutChange, b) || (f.current.onLayoutChange = b, a?.(b));
|
|
1450
|
+
}), p = J((b) => {
|
|
1451
|
+
$(f.current.onLayoutChanged, b) || (f.current.onLayoutChanged = b, u?.(b));
|
|
1452
|
+
}), g = me(s), v = k(null), [x, S] = Ye(), w = k({
|
|
1435
1453
|
lastExpandedPanelSizes: {},
|
|
1436
1454
|
layouts: {},
|
|
1437
1455
|
panels: [],
|
|
1438
1456
|
resizeTargetMinimumSize: h,
|
|
1439
1457
|
separators: []
|
|
1440
|
-
}), C = ge(v,
|
|
1441
|
-
|
|
1442
|
-
const P =
|
|
1458
|
+
}), C = ge(v, r);
|
|
1459
|
+
It(g, l);
|
|
1460
|
+
const P = J(
|
|
1443
1461
|
(b, L) => {
|
|
1444
|
-
const { interactionState: E, mountedGroups:
|
|
1445
|
-
for (const
|
|
1446
|
-
if (
|
|
1447
|
-
const
|
|
1448
|
-
if (
|
|
1449
|
-
let
|
|
1462
|
+
const { interactionState: E, mountedGroups: ne } = G();
|
|
1463
|
+
for (const oe of ne.keys())
|
|
1464
|
+
if (oe.id === b) {
|
|
1465
|
+
const X = ne.get(oe);
|
|
1466
|
+
if (X) {
|
|
1467
|
+
let q = !1;
|
|
1450
1468
|
switch (E.state) {
|
|
1451
1469
|
case "active": {
|
|
1452
|
-
|
|
1453
|
-
(le) => le.group ===
|
|
1470
|
+
q = E.hitRegions.some(
|
|
1471
|
+
(le) => le.group === oe
|
|
1454
1472
|
);
|
|
1455
1473
|
break;
|
|
1456
1474
|
}
|
|
1457
1475
|
}
|
|
1458
1476
|
return {
|
|
1459
|
-
flexGrow:
|
|
1460
|
-
pointerEvents:
|
|
1477
|
+
flexGrow: X.layout[L] ?? 1,
|
|
1478
|
+
pointerEvents: q ? "none" : void 0
|
|
1461
1479
|
};
|
|
1462
1480
|
}
|
|
1463
1481
|
}
|
|
@@ -1465,7 +1483,7 @@ function It({
|
|
|
1465
1483
|
flexGrow: n?.[L] ?? 1
|
|
1466
1484
|
};
|
|
1467
1485
|
}
|
|
1468
|
-
), T =
|
|
1486
|
+
), T = _e(
|
|
1469
1487
|
() => ({
|
|
1470
1488
|
getPanelStyles: P,
|
|
1471
1489
|
id: g,
|
|
@@ -1494,17 +1512,17 @@ function It({
|
|
|
1494
1512
|
}
|
|
1495
1513
|
}),
|
|
1496
1514
|
[P, g, S, c]
|
|
1497
|
-
),
|
|
1515
|
+
), V = Gt({
|
|
1498
1516
|
defaultLayout: n,
|
|
1499
1517
|
disableCursor: o
|
|
1500
|
-
}),
|
|
1501
|
-
return
|
|
1518
|
+
}), A = k(null);
|
|
1519
|
+
return j(() => {
|
|
1502
1520
|
const b = v.current;
|
|
1503
1521
|
if (b === null)
|
|
1504
1522
|
return;
|
|
1505
1523
|
const L = w.current, E = {
|
|
1506
|
-
defaultLayout:
|
|
1507
|
-
disableCursor: !!
|
|
1524
|
+
defaultLayout: V.defaultLayout,
|
|
1525
|
+
disableCursor: !!V.disableCursor,
|
|
1508
1526
|
disabled: !!i,
|
|
1509
1527
|
element: b,
|
|
1510
1528
|
id: g,
|
|
@@ -1515,38 +1533,40 @@ function It({
|
|
|
1515
1533
|
resizeTargetMinimumSize: L.resizeTargetMinimumSize,
|
|
1516
1534
|
separators: L.separators
|
|
1517
1535
|
};
|
|
1518
|
-
|
|
1519
|
-
const
|
|
1520
|
-
if (
|
|
1521
|
-
const { defaultLayoutDeferred:
|
|
1522
|
-
!
|
|
1536
|
+
A.current = E;
|
|
1537
|
+
const ne = kt(E), X = G().mountedGroups.get(E);
|
|
1538
|
+
if (X) {
|
|
1539
|
+
const { defaultLayoutDeferred: Y, derivedPanelConstraints: _, layout: U } = X;
|
|
1540
|
+
!Y && _.length > 0 && (d(U), p(U), L.panels.forEach((ue) => {
|
|
1523
1541
|
ue.scheduleUpdate();
|
|
1524
1542
|
}));
|
|
1525
1543
|
}
|
|
1526
|
-
|
|
1544
|
+
let q = !1;
|
|
1545
|
+
const le = F.addListener(
|
|
1527
1546
|
"interactionStateChange",
|
|
1528
|
-
() => {
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1547
|
+
(Y) => {
|
|
1548
|
+
const _ = Y.state === "active";
|
|
1549
|
+
q !== _ && (q = _, L.panels.forEach((U) => {
|
|
1550
|
+
U.scheduleUpdate();
|
|
1551
|
+
}));
|
|
1532
1552
|
}
|
|
1533
|
-
),
|
|
1553
|
+
), Je = F.addListener(
|
|
1534
1554
|
"mountedGroupsChange",
|
|
1535
|
-
(
|
|
1536
|
-
const
|
|
1537
|
-
if (
|
|
1538
|
-
const { defaultLayoutDeferred:
|
|
1539
|
-
if (
|
|
1555
|
+
(Y) => {
|
|
1556
|
+
const _ = Y.get(E);
|
|
1557
|
+
if (_) {
|
|
1558
|
+
const { defaultLayoutDeferred: U, derivedPanelConstraints: ue, layout: Se } = _;
|
|
1559
|
+
if (U || ue.length === 0)
|
|
1540
1560
|
return;
|
|
1541
|
-
const { interactionState:
|
|
1542
|
-
d(Se),
|
|
1543
|
-
|
|
1561
|
+
const { interactionState: Qe } = G(), et = Qe.state !== "active";
|
|
1562
|
+
d(Se), et && p(Se), L.panels.forEach((tt) => {
|
|
1563
|
+
tt.scheduleUpdate();
|
|
1544
1564
|
});
|
|
1545
1565
|
}
|
|
1546
1566
|
}
|
|
1547
1567
|
);
|
|
1548
1568
|
return () => {
|
|
1549
|
-
|
|
1569
|
+
A.current = null, ne(), le(), Je();
|
|
1550
1570
|
};
|
|
1551
1571
|
}, [
|
|
1552
1572
|
i,
|
|
@@ -1555,11 +1575,11 @@ function It({
|
|
|
1555
1575
|
d,
|
|
1556
1576
|
c,
|
|
1557
1577
|
x,
|
|
1558
|
-
|
|
1578
|
+
V
|
|
1559
1579
|
]), Oe(() => {
|
|
1560
|
-
const b =
|
|
1580
|
+
const b = A.current;
|
|
1561
1581
|
b && (b.defaultLayout = n, b.disableCursor = !!o);
|
|
1562
|
-
}), /* @__PURE__ */
|
|
1582
|
+
}), /* @__PURE__ */ Q(Ze.Provider, { value: T, children: /* @__PURE__ */ Q(
|
|
1563
1583
|
"div",
|
|
1564
1584
|
{
|
|
1565
1585
|
...m,
|
|
@@ -1582,43 +1602,43 @@ function It({
|
|
|
1582
1602
|
}
|
|
1583
1603
|
) });
|
|
1584
1604
|
}
|
|
1585
|
-
|
|
1605
|
+
Dt.displayName = "Group";
|
|
1586
1606
|
function fe(e, t) {
|
|
1587
1607
|
return `react-resizable-panels:${[e, ...t].join(":")}`;
|
|
1588
1608
|
}
|
|
1589
|
-
function
|
|
1609
|
+
function jt({
|
|
1590
1610
|
debounceSaveMs: e = 100,
|
|
1591
1611
|
panelIds: t,
|
|
1592
1612
|
storage: n = localStorage,
|
|
1593
1613
|
...o
|
|
1594
1614
|
}) {
|
|
1595
|
-
const i = t !== void 0,
|
|
1596
|
-
|
|
1615
|
+
const i = t !== void 0, r = "id" in o ? o.id : o.groupId, l = fe(r, t ?? []), s = it(
|
|
1616
|
+
Tt,
|
|
1597
1617
|
() => n.getItem(l),
|
|
1598
1618
|
() => n.getItem(l)
|
|
1599
|
-
), a =
|
|
1600
|
-
() =>
|
|
1601
|
-
[
|
|
1602
|
-
), u = k(null), c =
|
|
1619
|
+
), a = _e(
|
|
1620
|
+
() => s ? JSON.parse(s) : void 0,
|
|
1621
|
+
[s]
|
|
1622
|
+
), u = k(null), c = Z(() => {
|
|
1603
1623
|
const m = u.current;
|
|
1604
1624
|
m && (u.current = null, clearTimeout(m));
|
|
1605
1625
|
}, []);
|
|
1606
1626
|
Te(() => () => {
|
|
1607
1627
|
c();
|
|
1608
1628
|
}, [c]);
|
|
1609
|
-
const h =
|
|
1629
|
+
const h = Z(
|
|
1610
1630
|
(m) => {
|
|
1611
1631
|
c();
|
|
1612
1632
|
let f;
|
|
1613
|
-
i ? f = fe(
|
|
1633
|
+
i ? f = fe(r, Object.keys(m)) : f = fe(r, []);
|
|
1614
1634
|
try {
|
|
1615
1635
|
n.setItem(f, JSON.stringify(m));
|
|
1616
1636
|
} catch (d) {
|
|
1617
1637
|
console.error(d);
|
|
1618
1638
|
}
|
|
1619
1639
|
},
|
|
1620
|
-
[c, i,
|
|
1621
|
-
), y =
|
|
1640
|
+
[c, i, r, n]
|
|
1641
|
+
), y = Z(
|
|
1622
1642
|
(m) => {
|
|
1623
1643
|
c(), e === 0 ? h(m) : u.current = setTimeout(() => {
|
|
1624
1644
|
h(m);
|
|
@@ -1643,24 +1663,24 @@ function Ht({
|
|
|
1643
1663
|
onLayoutChanged: h
|
|
1644
1664
|
};
|
|
1645
1665
|
}
|
|
1646
|
-
function
|
|
1666
|
+
function Tt() {
|
|
1647
1667
|
return function() {
|
|
1648
1668
|
};
|
|
1649
1669
|
}
|
|
1650
|
-
function jt() {
|
|
1651
|
-
return Y(null);
|
|
1652
|
-
}
|
|
1653
1670
|
function Vt() {
|
|
1671
|
+
return ee(null);
|
|
1672
|
+
}
|
|
1673
|
+
function Ut() {
|
|
1654
1674
|
return k(null);
|
|
1655
1675
|
}
|
|
1656
1676
|
function ye() {
|
|
1657
|
-
const e =
|
|
1677
|
+
const e = rt(Ze);
|
|
1658
1678
|
return z(
|
|
1659
1679
|
e,
|
|
1660
1680
|
"Group Context not found; did you render a Panel or Separator outside of a Group?"
|
|
1661
1681
|
), e;
|
|
1662
1682
|
}
|
|
1663
|
-
function
|
|
1683
|
+
function Ot(e, t) {
|
|
1664
1684
|
const { id: n } = ye(), o = k({
|
|
1665
1685
|
collapse: ce,
|
|
1666
1686
|
expand: ce,
|
|
@@ -1671,34 +1691,34 @@ function Tt(e, t) {
|
|
|
1671
1691
|
isCollapsed: () => !1,
|
|
1672
1692
|
resize: ce
|
|
1673
1693
|
});
|
|
1674
|
-
|
|
1694
|
+
Ae(t, () => o.current, []), j(() => {
|
|
1675
1695
|
Object.assign(
|
|
1676
1696
|
o.current,
|
|
1677
1697
|
je({ groupId: n, panelId: e })
|
|
1678
1698
|
);
|
|
1679
1699
|
});
|
|
1680
1700
|
}
|
|
1681
|
-
function
|
|
1701
|
+
function At({
|
|
1682
1702
|
children: e,
|
|
1683
1703
|
className: t,
|
|
1684
1704
|
collapsedSize: n = "0%",
|
|
1685
1705
|
collapsible: o = !1,
|
|
1686
1706
|
defaultSize: i,
|
|
1687
|
-
elementRef:
|
|
1707
|
+
elementRef: r,
|
|
1688
1708
|
id: l,
|
|
1689
|
-
maxSize:
|
|
1709
|
+
maxSize: s = "100%",
|
|
1690
1710
|
minSize: a = "0%",
|
|
1691
1711
|
onResize: u,
|
|
1692
1712
|
panelRef: c,
|
|
1693
1713
|
style: h,
|
|
1694
1714
|
...y
|
|
1695
1715
|
}) {
|
|
1696
|
-
const m = !!l, f = me(l), d = k(null), p = ge(d,
|
|
1697
|
-
(T,
|
|
1698
|
-
u?.(T, l,
|
|
1716
|
+
const m = !!l, f = me(l), d = k(null), p = ge(d, r), [, g] = Ye(), { getPanelStyles: v, id: x, registerPanel: S } = ye(), w = u !== null, C = J(
|
|
1717
|
+
(T, V, A) => {
|
|
1718
|
+
u?.(T, l, A);
|
|
1699
1719
|
}
|
|
1700
1720
|
);
|
|
1701
|
-
|
|
1721
|
+
j(() => {
|
|
1702
1722
|
const T = d.current;
|
|
1703
1723
|
if (T !== null)
|
|
1704
1724
|
return S({
|
|
@@ -1714,7 +1734,7 @@ function Ot({
|
|
|
1714
1734
|
collapsedSize: n,
|
|
1715
1735
|
collapsible: o,
|
|
1716
1736
|
defaultSize: i,
|
|
1717
|
-
maxSize:
|
|
1737
|
+
maxSize: s,
|
|
1718
1738
|
minSize: a
|
|
1719
1739
|
},
|
|
1720
1740
|
scheduleUpdate: g
|
|
@@ -1727,13 +1747,13 @@ function Ot({
|
|
|
1727
1747
|
w,
|
|
1728
1748
|
f,
|
|
1729
1749
|
m,
|
|
1730
|
-
|
|
1750
|
+
s,
|
|
1731
1751
|
a,
|
|
1732
1752
|
C,
|
|
1733
1753
|
S
|
|
1734
|
-
]),
|
|
1754
|
+
]), Ot(f, c);
|
|
1735
1755
|
const P = v(x, f);
|
|
1736
|
-
return /* @__PURE__ */
|
|
1756
|
+
return /* @__PURE__ */ Q(
|
|
1737
1757
|
"div",
|
|
1738
1758
|
{
|
|
1739
1759
|
...y,
|
|
@@ -1750,7 +1770,7 @@ function Ot({
|
|
|
1750
1770
|
overflow: "hidden",
|
|
1751
1771
|
...P
|
|
1752
1772
|
},
|
|
1753
|
-
children: /* @__PURE__ */
|
|
1773
|
+
children: /* @__PURE__ */ Q(
|
|
1754
1774
|
"div",
|
|
1755
1775
|
{
|
|
1756
1776
|
className: t,
|
|
@@ -1766,7 +1786,7 @@ function Ot({
|
|
|
1766
1786
|
}
|
|
1767
1787
|
);
|
|
1768
1788
|
}
|
|
1769
|
-
|
|
1789
|
+
At.displayName = "Panel";
|
|
1770
1790
|
const _t = {
|
|
1771
1791
|
minHeight: 0,
|
|
1772
1792
|
maxHeight: "100%",
|
|
@@ -1779,42 +1799,40 @@ const _t = {
|
|
|
1779
1799
|
padding: 0,
|
|
1780
1800
|
margin: 0
|
|
1781
1801
|
};
|
|
1782
|
-
function Ut() {
|
|
1783
|
-
return Y(null);
|
|
1784
|
-
}
|
|
1785
1802
|
function Wt() {
|
|
1803
|
+
return ee(null);
|
|
1804
|
+
}
|
|
1805
|
+
function Bt() {
|
|
1786
1806
|
return k(null);
|
|
1787
1807
|
}
|
|
1788
|
-
function
|
|
1808
|
+
function Nt({
|
|
1789
1809
|
layout: e,
|
|
1790
1810
|
panelConstraints: t,
|
|
1791
1811
|
panelId: n,
|
|
1792
1812
|
panelIndex: o
|
|
1793
1813
|
}) {
|
|
1794
|
-
let i,
|
|
1795
|
-
const l = e[n],
|
|
1814
|
+
let i, r;
|
|
1815
|
+
const l = e[n], s = t.find(
|
|
1796
1816
|
(a) => a.panelId === n
|
|
1797
1817
|
);
|
|
1798
|
-
if (
|
|
1799
|
-
const a =
|
|
1800
|
-
|
|
1801
|
-
layout:
|
|
1818
|
+
if (s) {
|
|
1819
|
+
const a = s.maxSize, u = s.collapsible ? s.collapsedSize : s.minSize, c = [o, o + 1];
|
|
1820
|
+
r = H({
|
|
1821
|
+
layout: te({
|
|
1802
1822
|
delta: u - l,
|
|
1803
1823
|
initialLayout: e,
|
|
1804
1824
|
panelConstraints: t,
|
|
1805
1825
|
pivotIndices: c,
|
|
1806
|
-
prevLayout: e
|
|
1807
|
-
trigger: "keyboard"
|
|
1826
|
+
prevLayout: e
|
|
1808
1827
|
}),
|
|
1809
1828
|
panelConstraints: t
|
|
1810
|
-
})[n], i =
|
|
1811
|
-
layout:
|
|
1829
|
+
})[n], i = H({
|
|
1830
|
+
layout: te({
|
|
1812
1831
|
delta: a - l,
|
|
1813
1832
|
initialLayout: e,
|
|
1814
1833
|
panelConstraints: t,
|
|
1815
1834
|
pivotIndices: c,
|
|
1816
|
-
prevLayout: e
|
|
1817
|
-
trigger: "keyboard"
|
|
1835
|
+
prevLayout: e
|
|
1818
1836
|
}),
|
|
1819
1837
|
panelConstraints: t
|
|
1820
1838
|
})[n];
|
|
@@ -1822,30 +1840,30 @@ function At({
|
|
|
1822
1840
|
return {
|
|
1823
1841
|
valueControls: n,
|
|
1824
1842
|
valueMax: i,
|
|
1825
|
-
valueMin:
|
|
1843
|
+
valueMin: r,
|
|
1826
1844
|
valueNow: l
|
|
1827
1845
|
};
|
|
1828
1846
|
}
|
|
1829
|
-
function
|
|
1847
|
+
function Ft({
|
|
1830
1848
|
children: e,
|
|
1831
1849
|
className: t,
|
|
1832
1850
|
elementRef: n,
|
|
1833
1851
|
id: o,
|
|
1834
1852
|
style: i,
|
|
1835
|
-
...
|
|
1853
|
+
...r
|
|
1836
1854
|
}) {
|
|
1837
|
-
const l = me(o), [
|
|
1855
|
+
const l = me(o), [s, a] = ee({}), [u, c] = ee("inactive"), h = k(null), y = ge(h, n), {
|
|
1838
1856
|
id: m,
|
|
1839
1857
|
orientation: f,
|
|
1840
1858
|
registerSeparator: d
|
|
1841
1859
|
} = ye(), p = f === "horizontal" ? "vertical" : "horizontal";
|
|
1842
|
-
return
|
|
1860
|
+
return j(() => {
|
|
1843
1861
|
const g = h.current;
|
|
1844
1862
|
if (g !== null) {
|
|
1845
1863
|
const v = {
|
|
1846
1864
|
element: g,
|
|
1847
1865
|
id: l
|
|
1848
|
-
}, x = d(v), S =
|
|
1866
|
+
}, x = d(v), S = F.addListener(
|
|
1849
1867
|
"interactionStateChange",
|
|
1850
1868
|
(C) => {
|
|
1851
1869
|
c(
|
|
@@ -1854,17 +1872,17 @@ function Nt({
|
|
|
1854
1872
|
) ? C.state : "inactive"
|
|
1855
1873
|
);
|
|
1856
1874
|
}
|
|
1857
|
-
), w =
|
|
1875
|
+
), w = F.addListener(
|
|
1858
1876
|
"mountedGroupsChange",
|
|
1859
1877
|
(C) => {
|
|
1860
1878
|
C.forEach(
|
|
1861
|
-
({ derivedPanelConstraints: P, layout: T, separatorToPanels:
|
|
1862
|
-
if (
|
|
1863
|
-
const b =
|
|
1879
|
+
({ derivedPanelConstraints: P, layout: T, separatorToPanels: V }, A) => {
|
|
1880
|
+
if (A.id === m) {
|
|
1881
|
+
const b = V.get(v);
|
|
1864
1882
|
if (b) {
|
|
1865
|
-
const L = b[0], E =
|
|
1883
|
+
const L = b[0], E = A.panels.indexOf(L);
|
|
1866
1884
|
a(
|
|
1867
|
-
|
|
1885
|
+
Nt({
|
|
1868
1886
|
layout: T,
|
|
1869
1887
|
panelConstraints: P,
|
|
1870
1888
|
panelId: L.id,
|
|
@@ -1881,15 +1899,15 @@ function Nt({
|
|
|
1881
1899
|
S(), w(), x();
|
|
1882
1900
|
};
|
|
1883
1901
|
}
|
|
1884
|
-
}, [m, l, d]), /* @__PURE__ */
|
|
1902
|
+
}, [m, l, d]), /* @__PURE__ */ Q(
|
|
1885
1903
|
"div",
|
|
1886
1904
|
{
|
|
1887
|
-
...
|
|
1888
|
-
"aria-controls":
|
|
1905
|
+
...r,
|
|
1906
|
+
"aria-controls": s.valueControls,
|
|
1889
1907
|
"aria-orientation": p,
|
|
1890
|
-
"aria-valuemax":
|
|
1891
|
-
"aria-valuemin":
|
|
1892
|
-
"aria-valuenow":
|
|
1908
|
+
"aria-valuemax": s.valueMax,
|
|
1909
|
+
"aria-valuemin": s.valueMin,
|
|
1910
|
+
"aria-valuenow": s.valueNow,
|
|
1893
1911
|
children: e,
|
|
1894
1912
|
className: t,
|
|
1895
1913
|
"data-separator": u,
|
|
@@ -1907,16 +1925,16 @@ function Nt({
|
|
|
1907
1925
|
}
|
|
1908
1926
|
);
|
|
1909
1927
|
}
|
|
1910
|
-
|
|
1928
|
+
Ft.displayName = "Separator";
|
|
1911
1929
|
export {
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1930
|
+
Dt as Group,
|
|
1931
|
+
At as Panel,
|
|
1932
|
+
Ft as Separator,
|
|
1933
|
+
ut as isCoarsePointer,
|
|
1934
|
+
jt as useDefaultLayout,
|
|
1935
|
+
Vt as useGroupCallbackRef,
|
|
1936
|
+
Ut as useGroupRef,
|
|
1937
|
+
Wt as usePanelCallbackRef,
|
|
1938
|
+
Bt as usePanelRef
|
|
1921
1939
|
};
|
|
1922
1940
|
//# sourceMappingURL=react-resizable-panels.js.map
|