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