react-resizable-panels 4.6.4 → 4.6.5
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,21 +1,21 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as te } from "react/jsx-runtime";
|
|
3
|
-
import { useState as ne, useCallback as Q, useId as
|
|
4
|
-
function
|
|
3
|
+
import { useState as ne, useCallback as Q, useId as rt, useLayoutEffect as Ae, useEffect as ue, useRef as O, createContext as st, useImperativeHandle as Ne, useMemo as _e, useSyncExternalStore as Fe, useContext as at } from "react";
|
|
4
|
+
function lt(e, t) {
|
|
5
5
|
const n = getComputedStyle(e), o = parseFloat(n.fontSize);
|
|
6
6
|
return t * o;
|
|
7
7
|
}
|
|
8
|
-
function
|
|
8
|
+
function ut(e, t) {
|
|
9
9
|
const n = getComputedStyle(e.ownerDocument.body), o = parseFloat(n.fontSize);
|
|
10
10
|
return t * o;
|
|
11
11
|
}
|
|
12
|
-
function
|
|
12
|
+
function ct(e) {
|
|
13
13
|
return e / 100 * window.innerHeight;
|
|
14
14
|
}
|
|
15
|
-
function
|
|
15
|
+
function ft(e) {
|
|
16
16
|
return e / 100 * window.innerWidth;
|
|
17
17
|
}
|
|
18
|
-
function
|
|
18
|
+
function dt(e) {
|
|
19
19
|
switch (typeof e) {
|
|
20
20
|
case "number":
|
|
21
21
|
return [e, "px"];
|
|
@@ -31,7 +31,7 @@ function re({
|
|
|
31
31
|
styleProp: n
|
|
32
32
|
}) {
|
|
33
33
|
let o;
|
|
34
|
-
const [i, s] =
|
|
34
|
+
const [i, s] = dt(n);
|
|
35
35
|
switch (s) {
|
|
36
36
|
case "%": {
|
|
37
37
|
o = i / 100 * e;
|
|
@@ -42,19 +42,19 @@ function re({
|
|
|
42
42
|
break;
|
|
43
43
|
}
|
|
44
44
|
case "rem": {
|
|
45
|
-
o =
|
|
45
|
+
o = ut(t, i);
|
|
46
46
|
break;
|
|
47
47
|
}
|
|
48
48
|
case "em": {
|
|
49
|
-
o =
|
|
49
|
+
o = lt(t, i);
|
|
50
50
|
break;
|
|
51
51
|
}
|
|
52
52
|
case "vh": {
|
|
53
|
-
o =
|
|
53
|
+
o = ct(i);
|
|
54
54
|
break;
|
|
55
55
|
}
|
|
56
56
|
case "vw": {
|
|
57
|
-
o =
|
|
57
|
+
o = ft(i);
|
|
58
58
|
break;
|
|
59
59
|
}
|
|
60
60
|
}
|
|
@@ -69,7 +69,7 @@ function J({
|
|
|
69
69
|
const { orientation: t, panels: n } = e;
|
|
70
70
|
return n.reduce((o, i) => (o += t === "horizontal" ? i.element.offsetWidth : i.element.offsetHeight, o), 0);
|
|
71
71
|
}
|
|
72
|
-
function
|
|
72
|
+
function pe(e) {
|
|
73
73
|
const { panels: t } = e, n = J({ group: e });
|
|
74
74
|
return n === 0 ? t.map((o) => ({
|
|
75
75
|
collapsedSize: 0,
|
|
@@ -83,39 +83,39 @@ function de(e) {
|
|
|
83
83
|
const { element: i, panelConstraints: s } = o;
|
|
84
84
|
let l = 0;
|
|
85
85
|
if (s.collapsedSize !== void 0) {
|
|
86
|
-
const
|
|
86
|
+
const c = re({
|
|
87
87
|
groupSize: n,
|
|
88
88
|
panelElement: i,
|
|
89
89
|
styleProp: s.collapsedSize
|
|
90
90
|
});
|
|
91
|
-
l = _(
|
|
91
|
+
l = _(c / n * 100);
|
|
92
92
|
}
|
|
93
93
|
let r;
|
|
94
94
|
if (s.defaultSize !== void 0) {
|
|
95
|
-
const
|
|
95
|
+
const c = re({
|
|
96
96
|
groupSize: n,
|
|
97
97
|
panelElement: i,
|
|
98
98
|
styleProp: s.defaultSize
|
|
99
99
|
});
|
|
100
|
-
r = _(
|
|
100
|
+
r = _(c / n * 100);
|
|
101
101
|
}
|
|
102
102
|
let a = 0;
|
|
103
103
|
if (s.minSize !== void 0) {
|
|
104
|
-
const
|
|
104
|
+
const c = re({
|
|
105
105
|
groupSize: n,
|
|
106
106
|
panelElement: i,
|
|
107
107
|
styleProp: s.minSize
|
|
108
108
|
});
|
|
109
|
-
a = _(
|
|
109
|
+
a = _(c / n * 100);
|
|
110
110
|
}
|
|
111
|
-
let
|
|
111
|
+
let u = 100;
|
|
112
112
|
if (s.maxSize !== void 0) {
|
|
113
|
-
const
|
|
113
|
+
const c = re({
|
|
114
114
|
groupSize: n,
|
|
115
115
|
panelElement: i,
|
|
116
116
|
styleProp: s.maxSize
|
|
117
117
|
});
|
|
118
|
-
|
|
118
|
+
u = _(c / n * 100);
|
|
119
119
|
}
|
|
120
120
|
return {
|
|
121
121
|
collapsedSize: l,
|
|
@@ -123,7 +123,7 @@ function de(e) {
|
|
|
123
123
|
defaultSize: r,
|
|
124
124
|
disabled: s.disabled,
|
|
125
125
|
minSize: a,
|
|
126
|
-
maxSize:
|
|
126
|
+
maxSize: u,
|
|
127
127
|
panelId: o.id
|
|
128
128
|
};
|
|
129
129
|
});
|
|
@@ -132,16 +132,16 @@ function P(e, t = "Assertion error") {
|
|
|
132
132
|
if (!e)
|
|
133
133
|
throw Error(t);
|
|
134
134
|
}
|
|
135
|
-
function
|
|
135
|
+
function he(e, t) {
|
|
136
136
|
return Array.from(t).sort(
|
|
137
|
-
e === "horizontal" ?
|
|
137
|
+
e === "horizontal" ? pt : ht
|
|
138
138
|
);
|
|
139
139
|
}
|
|
140
|
-
function
|
|
140
|
+
function pt(e, t) {
|
|
141
141
|
const n = e.element.offsetLeft - t.element.offsetLeft;
|
|
142
142
|
return n !== 0 ? n : e.element.offsetWidth - t.element.offsetWidth;
|
|
143
143
|
}
|
|
144
|
-
function
|
|
144
|
+
function ht(e, t) {
|
|
145
145
|
const n = e.element.offsetTop - t.element.offsetTop;
|
|
146
146
|
return n !== 0 ? n : e.element.offsetHeight - t.element.offsetHeight;
|
|
147
147
|
}
|
|
@@ -160,7 +160,7 @@ function He(e, t) {
|
|
|
160
160
|
)
|
|
161
161
|
};
|
|
162
162
|
}
|
|
163
|
-
function
|
|
163
|
+
function mt({
|
|
164
164
|
orientation: e,
|
|
165
165
|
rects: t,
|
|
166
166
|
targetRect: n
|
|
@@ -171,48 +171,48 @@ function pt({
|
|
|
171
171
|
};
|
|
172
172
|
let i, s = Number.MAX_VALUE;
|
|
173
173
|
for (const l of t) {
|
|
174
|
-
const { x: r, y: a } = He(o, l),
|
|
175
|
-
|
|
174
|
+
const { x: r, y: a } = He(o, l), u = e === "horizontal" ? r : a;
|
|
175
|
+
u < s && (s = u, i = l);
|
|
176
176
|
}
|
|
177
177
|
return P(i, "No rect found"), i;
|
|
178
178
|
}
|
|
179
179
|
let se;
|
|
180
|
-
function
|
|
180
|
+
function gt() {
|
|
181
181
|
return se === void 0 && (typeof matchMedia == "function" ? se = !!matchMedia("(pointer:coarse)").matches : se = !1), se;
|
|
182
182
|
}
|
|
183
183
|
function Ve(e) {
|
|
184
|
-
const { element: t, orientation: n, panels: o, separators: i } = e, s =
|
|
184
|
+
const { element: t, orientation: n, panels: o, separators: i } = e, s = he(
|
|
185
185
|
n,
|
|
186
|
-
Array.from(t.children).filter($e).map((
|
|
187
|
-
).map(({ element:
|
|
188
|
-
let r = !1, a = !1,
|
|
186
|
+
Array.from(t.children).filter($e).map((m) => ({ element: m }))
|
|
187
|
+
).map(({ element: m }) => m), l = [];
|
|
188
|
+
let r = !1, a = !1, u = -1, c = -1, g = 0, b, S = [];
|
|
189
189
|
{
|
|
190
|
-
let
|
|
190
|
+
let m = -1;
|
|
191
191
|
for (const d of s)
|
|
192
|
-
d.hasAttribute("data-panel") && (
|
|
192
|
+
d.hasAttribute("data-panel") && (m++, d.ariaDisabled === null && (g++, u === -1 && (u = m), c = m));
|
|
193
193
|
}
|
|
194
194
|
if (g > 1) {
|
|
195
|
-
let
|
|
195
|
+
let m = -1;
|
|
196
196
|
for (const d of s)
|
|
197
197
|
if (d.hasAttribute("data-panel")) {
|
|
198
|
-
|
|
198
|
+
m++;
|
|
199
199
|
const f = o.find(
|
|
200
|
-
(
|
|
200
|
+
(h) => h.element === d
|
|
201
201
|
);
|
|
202
202
|
if (f) {
|
|
203
203
|
if (b) {
|
|
204
|
-
const
|
|
204
|
+
const h = b.element.getBoundingClientRect(), v = d.getBoundingClientRect();
|
|
205
205
|
let x;
|
|
206
206
|
if (a) {
|
|
207
207
|
const y = n === "horizontal" ? new DOMRect(
|
|
208
|
-
|
|
209
|
-
|
|
208
|
+
h.right,
|
|
209
|
+
h.top,
|
|
210
210
|
0,
|
|
211
|
-
|
|
211
|
+
h.height
|
|
212
212
|
) : new DOMRect(
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
213
|
+
h.left,
|
|
214
|
+
h.bottom,
|
|
215
|
+
h.width,
|
|
216
216
|
0
|
|
217
217
|
), p = n === "horizontal" ? new DOMRect(v.left, v.top, 0, v.height) : new DOMRect(v.left, v.top, v.width, 0);
|
|
218
218
|
switch (S.length) {
|
|
@@ -224,14 +224,14 @@ function Ve(e) {
|
|
|
224
224
|
break;
|
|
225
225
|
}
|
|
226
226
|
case 1: {
|
|
227
|
-
const w = S[0], C =
|
|
227
|
+
const w = S[0], C = mt({
|
|
228
228
|
orientation: n,
|
|
229
|
-
rects: [
|
|
229
|
+
rects: [h, v],
|
|
230
230
|
targetRect: w.element.getBoundingClientRect()
|
|
231
231
|
});
|
|
232
232
|
x = [
|
|
233
233
|
w,
|
|
234
|
-
C ===
|
|
234
|
+
C === h ? p : y
|
|
235
235
|
];
|
|
236
236
|
break;
|
|
237
237
|
}
|
|
@@ -243,20 +243,20 @@ function Ve(e) {
|
|
|
243
243
|
} else
|
|
244
244
|
S.length ? x = S : x = [
|
|
245
245
|
n === "horizontal" ? new DOMRect(
|
|
246
|
-
|
|
246
|
+
h.right,
|
|
247
247
|
v.top,
|
|
248
|
-
v.left -
|
|
248
|
+
v.left - h.right,
|
|
249
249
|
v.height
|
|
250
250
|
) : new DOMRect(
|
|
251
251
|
v.left,
|
|
252
|
-
|
|
252
|
+
h.bottom,
|
|
253
253
|
v.width,
|
|
254
|
-
v.top -
|
|
254
|
+
v.top - h.bottom
|
|
255
255
|
)
|
|
256
256
|
];
|
|
257
257
|
for (const y of x) {
|
|
258
258
|
let p = "width" in y ? y : y.element.getBoundingClientRect();
|
|
259
|
-
const w =
|
|
259
|
+
const w = gt() ? e.resizeTargetMinimumSize.coarse : e.resizeTargetMinimumSize.fine;
|
|
260
260
|
if (p.width < w) {
|
|
261
261
|
const R = w - p.width;
|
|
262
262
|
p = new DOMRect(
|
|
@@ -275,7 +275,7 @@ function Ve(e) {
|
|
|
275
275
|
p.height + R
|
|
276
276
|
);
|
|
277
277
|
}
|
|
278
|
-
const C =
|
|
278
|
+
const C = m <= u || m > c;
|
|
279
279
|
!r && !C && l.push({
|
|
280
280
|
group: e,
|
|
281
281
|
groupSize: J({ group: e }),
|
|
@@ -290,7 +290,7 @@ function Ve(e) {
|
|
|
290
290
|
} else if (d.hasAttribute("data-separator")) {
|
|
291
291
|
d.ariaDisabled !== null && (r = !0);
|
|
292
292
|
const f = i.find(
|
|
293
|
-
(
|
|
293
|
+
(h) => h.element === d
|
|
294
294
|
);
|
|
295
295
|
f ? S.push(f) : (b = void 0, S = []);
|
|
296
296
|
} else
|
|
@@ -298,7 +298,7 @@ function Ve(e) {
|
|
|
298
298
|
}
|
|
299
299
|
return l;
|
|
300
300
|
}
|
|
301
|
-
class
|
|
301
|
+
class yt {
|
|
302
302
|
#e = {};
|
|
303
303
|
addListener(t, n) {
|
|
304
304
|
const o = this.#e[t];
|
|
@@ -318,8 +318,8 @@ class ht {
|
|
|
318
318
|
const a = l[r];
|
|
319
319
|
try {
|
|
320
320
|
a.call(null, n);
|
|
321
|
-
} catch (
|
|
322
|
-
s === null && (i = !0, s =
|
|
321
|
+
} catch (u) {
|
|
322
|
+
s === null && (i = !0, s = u);
|
|
323
323
|
}
|
|
324
324
|
}
|
|
325
325
|
if (i)
|
|
@@ -347,7 +347,7 @@ let A = {
|
|
|
347
347
|
},
|
|
348
348
|
mountedGroups: /* @__PURE__ */ new Map()
|
|
349
349
|
};
|
|
350
|
-
const $ = new
|
|
350
|
+
const $ = new yt();
|
|
351
351
|
function G() {
|
|
352
352
|
return A;
|
|
353
353
|
}
|
|
@@ -377,7 +377,7 @@ function I(e) {
|
|
|
377
377
|
});
|
|
378
378
|
}), $.emit("mountedGroupsChange", A.mountedGroups)), A;
|
|
379
379
|
}
|
|
380
|
-
function
|
|
380
|
+
function St(e, t, n) {
|
|
381
381
|
let o, i = {
|
|
382
382
|
x: 1 / 0,
|
|
383
383
|
y: 1 / 0
|
|
@@ -400,10 +400,10 @@ function gt(e, t, n) {
|
|
|
400
400
|
hitRegion: o
|
|
401
401
|
} : void 0;
|
|
402
402
|
}
|
|
403
|
-
function
|
|
403
|
+
function vt(e) {
|
|
404
404
|
return e !== null && typeof e == "object" && "nodeType" in e && e.nodeType === Node.DOCUMENT_FRAGMENT_NODE;
|
|
405
405
|
}
|
|
406
|
-
function
|
|
406
|
+
function xt(e, t) {
|
|
407
407
|
if (e === t) throw new Error("Cannot compare node with itself");
|
|
408
408
|
const n = {
|
|
409
409
|
a: we(e),
|
|
@@ -434,20 +434,20 @@ function St(e, t) {
|
|
|
434
434
|
}
|
|
435
435
|
return Math.sign(i.a - i.b);
|
|
436
436
|
}
|
|
437
|
-
const
|
|
438
|
-
function
|
|
437
|
+
const zt = /\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;
|
|
438
|
+
function bt(e) {
|
|
439
439
|
const t = getComputedStyle(je(e) ?? e).display;
|
|
440
440
|
return t === "flex" || t === "inline-flex";
|
|
441
441
|
}
|
|
442
|
-
function
|
|
442
|
+
function wt(e) {
|
|
443
443
|
const t = getComputedStyle(e);
|
|
444
|
-
return !!(t.position === "fixed" || t.zIndex !== "auto" && (t.position !== "static" ||
|
|
444
|
+
return !!(t.position === "fixed" || t.zIndex !== "auto" && (t.position !== "static" || bt(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" || zt.test(t.willChange) || t.webkitOverflowScrolling === "touch");
|
|
445
445
|
}
|
|
446
446
|
function ze(e) {
|
|
447
447
|
let t = e.length;
|
|
448
448
|
for (; t--; ) {
|
|
449
449
|
const n = e[t];
|
|
450
|
-
if (P(n, "Missing node"),
|
|
450
|
+
if (P(n, "Missing node"), wt(n)) return n;
|
|
451
451
|
}
|
|
452
452
|
return null;
|
|
453
453
|
}
|
|
@@ -462,24 +462,24 @@ function we(e) {
|
|
|
462
462
|
}
|
|
463
463
|
function je(e) {
|
|
464
464
|
const { parentNode: t } = e;
|
|
465
|
-
return
|
|
465
|
+
return vt(t) ? t.host : t;
|
|
466
466
|
}
|
|
467
|
-
function
|
|
467
|
+
function Lt(e, t) {
|
|
468
468
|
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;
|
|
469
469
|
}
|
|
470
|
-
function
|
|
470
|
+
function Pt({
|
|
471
471
|
groupElement: e,
|
|
472
472
|
hitRegion: t,
|
|
473
473
|
pointerEventTarget: n
|
|
474
474
|
}) {
|
|
475
475
|
if (!$e(n) || n.contains(e) || e.contains(n))
|
|
476
476
|
return !0;
|
|
477
|
-
if (
|
|
477
|
+
if (xt(n, e) > 0) {
|
|
478
478
|
let o = n;
|
|
479
479
|
for (; o; ) {
|
|
480
480
|
if (o.contains(e))
|
|
481
481
|
return !0;
|
|
482
|
-
if (
|
|
482
|
+
if (Lt(o.getBoundingClientRect(), t))
|
|
483
483
|
return !1;
|
|
484
484
|
o = o.parentElement;
|
|
485
485
|
}
|
|
@@ -491,18 +491,18 @@ function me(e, t) {
|
|
|
491
491
|
return t.forEach((o, i) => {
|
|
492
492
|
if (i.disabled)
|
|
493
493
|
return;
|
|
494
|
-
const s = Ve(i), l =
|
|
494
|
+
const s = Ve(i), l = St(i.orientation, s, {
|
|
495
495
|
x: e.clientX,
|
|
496
496
|
y: e.clientY
|
|
497
497
|
});
|
|
498
|
-
l && l.distance.x <= 0 && l.distance.y <= 0 &&
|
|
498
|
+
l && l.distance.x <= 0 && l.distance.y <= 0 && Pt({
|
|
499
499
|
groupElement: i.element,
|
|
500
500
|
hitRegion: l.hitRegion.rect,
|
|
501
501
|
pointerEventTarget: e.target
|
|
502
502
|
}) && n.push(l.hitRegion);
|
|
503
503
|
}), n;
|
|
504
504
|
}
|
|
505
|
-
function
|
|
505
|
+
function Ct(e, t) {
|
|
506
506
|
if (e.length !== t.length)
|
|
507
507
|
return !1;
|
|
508
508
|
for (let n = 0; n < e.length; n++)
|
|
@@ -530,8 +530,8 @@ function Y({
|
|
|
530
530
|
return n;
|
|
531
531
|
if (F(o, a) < 0)
|
|
532
532
|
if (s) {
|
|
533
|
-
const
|
|
534
|
-
F(o,
|
|
533
|
+
const u = (i + a) / 2;
|
|
534
|
+
F(o, u) < 0 ? o = i : o = a;
|
|
535
535
|
} else
|
|
536
536
|
o = a;
|
|
537
537
|
return o = Math.min(r, o), o = _(o), o;
|
|
@@ -546,19 +546,19 @@ function oe({
|
|
|
546
546
|
}) {
|
|
547
547
|
if (k(e, 0))
|
|
548
548
|
return t;
|
|
549
|
-
const l = s === "imperative-api", r = Object.values(t), a = Object.values(i),
|
|
550
|
-
P(
|
|
549
|
+
const l = s === "imperative-api", r = Object.values(t), a = Object.values(i), u = [...r], [c, g] = o;
|
|
550
|
+
P(c != null, "Invalid first pivot index"), P(g != null, "Invalid second pivot index");
|
|
551
551
|
let b = 0;
|
|
552
552
|
switch (s) {
|
|
553
553
|
case "keyboard": {
|
|
554
554
|
{
|
|
555
|
-
const d = e < 0 ? g :
|
|
555
|
+
const d = e < 0 ? g : c, f = n[d];
|
|
556
556
|
P(
|
|
557
557
|
f,
|
|
558
558
|
`Panel constraints not found for index ${d}`
|
|
559
559
|
);
|
|
560
560
|
const {
|
|
561
|
-
collapsedSize:
|
|
561
|
+
collapsedSize: h = 0,
|
|
562
562
|
collapsible: v,
|
|
563
563
|
minSize: x = 0
|
|
564
564
|
} = f;
|
|
@@ -567,20 +567,20 @@ function oe({
|
|
|
567
567
|
if (P(
|
|
568
568
|
y != null,
|
|
569
569
|
`Previous layout not found for panel index ${d}`
|
|
570
|
-
), k(y,
|
|
570
|
+
), k(y, h)) {
|
|
571
571
|
const p = x - y;
|
|
572
572
|
F(p, Math.abs(e)) > 0 && (e = e < 0 ? 0 - p : p);
|
|
573
573
|
}
|
|
574
574
|
}
|
|
575
575
|
}
|
|
576
576
|
{
|
|
577
|
-
const d = e < 0 ?
|
|
577
|
+
const d = e < 0 ? c : g, f = n[d];
|
|
578
578
|
P(
|
|
579
579
|
f,
|
|
580
580
|
`No panel constraints found for index ${d}`
|
|
581
581
|
);
|
|
582
582
|
const {
|
|
583
|
-
collapsedSize:
|
|
583
|
+
collapsedSize: h = 0,
|
|
584
584
|
collapsible: v,
|
|
585
585
|
minSize: x = 0
|
|
586
586
|
} = f;
|
|
@@ -590,7 +590,7 @@ function oe({
|
|
|
590
590
|
y != null,
|
|
591
591
|
`Previous layout not found for panel index ${d}`
|
|
592
592
|
), k(y, x)) {
|
|
593
|
-
const p = y -
|
|
593
|
+
const p = y - h;
|
|
594
594
|
F(p, Math.abs(e)) > 0 && (e = e < 0 ? 0 - p : p);
|
|
595
595
|
}
|
|
596
596
|
}
|
|
@@ -598,18 +598,18 @@ function oe({
|
|
|
598
598
|
break;
|
|
599
599
|
}
|
|
600
600
|
default: {
|
|
601
|
-
const d = e < 0 ? g :
|
|
601
|
+
const d = e < 0 ? g : c, f = n[d];
|
|
602
602
|
P(
|
|
603
603
|
f,
|
|
604
604
|
`Panel constraints not found for index ${d}`
|
|
605
605
|
);
|
|
606
|
-
const
|
|
607
|
-
if (v && F(
|
|
606
|
+
const h = r[d], { collapsible: v, collapsedSize: x, minSize: y } = f;
|
|
607
|
+
if (v && F(h, y) < 0)
|
|
608
608
|
if (e > 0) {
|
|
609
|
-
const p = y - x, w = p / 2, C =
|
|
609
|
+
const p = y - x, w = p / 2, C = h + e;
|
|
610
610
|
F(C, y) < 0 && (e = F(e, w) <= 0 ? 0 : p);
|
|
611
611
|
} else {
|
|
612
|
-
const p = y - x, w = 100 - p / 2, C =
|
|
612
|
+
const p = y - x, w = 100 - p / 2, C = h - e;
|
|
613
613
|
F(C, y) < 0 && (e = F(100 + e, w) > 0 ? 0 : -p);
|
|
614
614
|
}
|
|
615
615
|
break;
|
|
@@ -617,7 +617,7 @@ function oe({
|
|
|
617
617
|
}
|
|
618
618
|
{
|
|
619
619
|
const d = e < 0 ? 1 : -1;
|
|
620
|
-
let f = e < 0 ? g :
|
|
620
|
+
let f = e < 0 ? g : c, h = 0;
|
|
621
621
|
for (; ; ) {
|
|
622
622
|
const x = r[f];
|
|
623
623
|
P(
|
|
@@ -630,51 +630,51 @@ function oe({
|
|
|
630
630
|
prevSize: x,
|
|
631
631
|
size: 100
|
|
632
632
|
}) - x;
|
|
633
|
-
if (
|
|
633
|
+
if (h += p, f += d, f < 0 || f >= n.length)
|
|
634
634
|
break;
|
|
635
635
|
}
|
|
636
|
-
const v = Math.min(Math.abs(e), Math.abs(
|
|
636
|
+
const v = Math.min(Math.abs(e), Math.abs(h));
|
|
637
637
|
e = e < 0 ? 0 - v : v;
|
|
638
638
|
}
|
|
639
639
|
{
|
|
640
|
-
let f = e < 0 ?
|
|
640
|
+
let f = e < 0 ? c : g;
|
|
641
641
|
for (; f >= 0 && f < n.length; ) {
|
|
642
|
-
const
|
|
642
|
+
const h = Math.abs(e) - Math.abs(b), v = r[f];
|
|
643
643
|
P(
|
|
644
644
|
v != null,
|
|
645
645
|
`Previous layout not found for panel index ${f}`
|
|
646
646
|
);
|
|
647
|
-
const x = v -
|
|
647
|
+
const x = v - h, y = Y({
|
|
648
648
|
overrideDisabledPanels: l,
|
|
649
649
|
panelConstraints: n[f],
|
|
650
650
|
prevSize: v,
|
|
651
651
|
size: x
|
|
652
652
|
});
|
|
653
|
-
if (!k(v, y) && (b += v - y,
|
|
653
|
+
if (!k(v, y) && (b += v - y, u[f] = y, b.toFixed(3).localeCompare(Math.abs(e).toFixed(3), void 0, {
|
|
654
654
|
numeric: !0
|
|
655
655
|
}) >= 0))
|
|
656
656
|
break;
|
|
657
657
|
e < 0 ? f-- : f++;
|
|
658
658
|
}
|
|
659
659
|
}
|
|
660
|
-
if (
|
|
660
|
+
if (Ct(a, u))
|
|
661
661
|
return i;
|
|
662
662
|
{
|
|
663
|
-
const d = e < 0 ? g :
|
|
663
|
+
const d = e < 0 ? g : c, f = r[d];
|
|
664
664
|
P(
|
|
665
665
|
f != null,
|
|
666
666
|
`Previous layout not found for panel index ${d}`
|
|
667
667
|
);
|
|
668
|
-
const
|
|
668
|
+
const h = f + b, v = Y({
|
|
669
669
|
overrideDisabledPanels: l,
|
|
670
670
|
panelConstraints: n[d],
|
|
671
671
|
prevSize: f,
|
|
672
|
-
size:
|
|
672
|
+
size: h
|
|
673
673
|
});
|
|
674
|
-
if (
|
|
675
|
-
let x =
|
|
674
|
+
if (u[d] = v, !k(v, h)) {
|
|
675
|
+
let x = h - v, p = e < 0 ? g : c;
|
|
676
676
|
for (; p >= 0 && p < n.length; ) {
|
|
677
|
-
const w =
|
|
677
|
+
const w = u[p];
|
|
678
678
|
P(
|
|
679
679
|
w != null,
|
|
680
680
|
`Previous layout not found for panel index ${p}`
|
|
@@ -685,20 +685,20 @@ function oe({
|
|
|
685
685
|
prevSize: w,
|
|
686
686
|
size: C
|
|
687
687
|
});
|
|
688
|
-
if (k(w, R) || (x -= R - w,
|
|
688
|
+
if (k(w, R) || (x -= R - w, u[p] = R), k(x, 0))
|
|
689
689
|
break;
|
|
690
690
|
e > 0 ? p-- : p++;
|
|
691
691
|
}
|
|
692
692
|
}
|
|
693
693
|
}
|
|
694
|
-
const S = Object.values(
|
|
694
|
+
const S = Object.values(u).reduce(
|
|
695
695
|
(d, f) => f + d,
|
|
696
696
|
0
|
|
697
697
|
);
|
|
698
698
|
if (!k(S, 100, 0.1))
|
|
699
699
|
return i;
|
|
700
|
-
const
|
|
701
|
-
return
|
|
700
|
+
const m = Object.keys(i);
|
|
701
|
+
return u.reduce((d, f, h) => (d[m[h]] = f, d), {});
|
|
702
702
|
}
|
|
703
703
|
function U(e, t) {
|
|
704
704
|
if (Object.keys(e).length !== Object.keys(t).length)
|
|
@@ -724,38 +724,38 @@ function B({
|
|
|
724
724
|
for (let r = 0; r < t.length; r++) {
|
|
725
725
|
const a = o[r];
|
|
726
726
|
P(a != null, `No layout data found for index ${r}`);
|
|
727
|
-
const
|
|
728
|
-
o[r] =
|
|
727
|
+
const u = 100 / i * a;
|
|
728
|
+
o[r] = u;
|
|
729
729
|
}
|
|
730
730
|
let s = 0;
|
|
731
731
|
for (let r = 0; r < t.length; r++) {
|
|
732
732
|
const a = n[r];
|
|
733
733
|
P(a != null, `No layout data found for index ${r}`);
|
|
734
|
-
const
|
|
735
|
-
P(
|
|
736
|
-
const
|
|
734
|
+
const u = o[r];
|
|
735
|
+
P(u != null, `No layout data found for index ${r}`);
|
|
736
|
+
const c = Y({
|
|
737
737
|
overrideDisabledPanels: !0,
|
|
738
738
|
panelConstraints: t[r],
|
|
739
739
|
prevSize: a,
|
|
740
|
-
size:
|
|
740
|
+
size: u
|
|
741
741
|
});
|
|
742
|
-
|
|
742
|
+
u != c && (s += u - c, o[r] = c);
|
|
743
743
|
}
|
|
744
744
|
if (!k(s, 0))
|
|
745
745
|
for (let r = 0; r < t.length; r++) {
|
|
746
746
|
const a = o[r];
|
|
747
747
|
P(a != null, `No layout data found for index ${r}`);
|
|
748
|
-
const
|
|
748
|
+
const u = a + s, c = Y({
|
|
749
749
|
overrideDisabledPanels: !0,
|
|
750
750
|
panelConstraints: t[r],
|
|
751
751
|
prevSize: a,
|
|
752
|
-
size:
|
|
752
|
+
size: u
|
|
753
753
|
});
|
|
754
|
-
if (a !==
|
|
754
|
+
if (a !== c && (s -= c - a, o[r] = c, k(s, 0)))
|
|
755
755
|
break;
|
|
756
756
|
}
|
|
757
757
|
const l = Object.keys(e);
|
|
758
|
-
return o.reduce((r, a,
|
|
758
|
+
return o.reduce((r, a, u) => (r[l[u]] = a, r), {});
|
|
759
759
|
}
|
|
760
760
|
function We({
|
|
761
761
|
groupId: e,
|
|
@@ -766,16 +766,16 @@ function We({
|
|
|
766
766
|
for (const [
|
|
767
767
|
a,
|
|
768
768
|
{
|
|
769
|
-
defaultLayoutDeferred:
|
|
770
|
-
derivedPanelConstraints:
|
|
769
|
+
defaultLayoutDeferred: u,
|
|
770
|
+
derivedPanelConstraints: c,
|
|
771
771
|
layout: g,
|
|
772
772
|
separatorToPanels: b
|
|
773
773
|
}
|
|
774
774
|
] of r)
|
|
775
775
|
if (a.id === e)
|
|
776
776
|
return {
|
|
777
|
-
defaultLayoutDeferred:
|
|
778
|
-
derivedPanelConstraints:
|
|
777
|
+
defaultLayoutDeferred: u,
|
|
778
|
+
derivedPanelConstraints: c,
|
|
779
779
|
group: a,
|
|
780
780
|
layout: g,
|
|
781
781
|
separatorToPanels: b
|
|
@@ -803,69 +803,69 @@ function We({
|
|
|
803
803
|
if (r === a)
|
|
804
804
|
return;
|
|
805
805
|
const {
|
|
806
|
-
defaultLayoutDeferred:
|
|
807
|
-
derivedPanelConstraints:
|
|
806
|
+
defaultLayoutDeferred: u,
|
|
807
|
+
derivedPanelConstraints: c,
|
|
808
808
|
group: g,
|
|
809
809
|
layout: b,
|
|
810
810
|
separatorToPanels: S
|
|
811
|
-
} = n(),
|
|
811
|
+
} = n(), m = g.panels.findIndex((v) => v.id === t), d = m === g.panels.length - 1, f = oe({
|
|
812
812
|
delta: d ? a - r : r - a,
|
|
813
813
|
initialLayout: b,
|
|
814
|
-
panelConstraints:
|
|
815
|
-
pivotIndices: d ? [
|
|
814
|
+
panelConstraints: c,
|
|
815
|
+
pivotIndices: d ? [m - 1, m] : [m, m + 1],
|
|
816
816
|
prevLayout: b,
|
|
817
817
|
trigger: "imperative-api"
|
|
818
|
-
}),
|
|
818
|
+
}), h = B({
|
|
819
819
|
layout: f,
|
|
820
|
-
panelConstraints:
|
|
820
|
+
panelConstraints: c
|
|
821
821
|
});
|
|
822
|
-
U(b,
|
|
822
|
+
U(b, h) || I((v) => ({
|
|
823
823
|
mountedGroups: new Map(v.mountedGroups).set(g, {
|
|
824
|
-
defaultLayoutDeferred:
|
|
825
|
-
derivedPanelConstraints:
|
|
826
|
-
layout:
|
|
824
|
+
defaultLayoutDeferred: u,
|
|
825
|
+
derivedPanelConstraints: c,
|
|
826
|
+
layout: h,
|
|
827
827
|
separatorToPanels: S
|
|
828
828
|
})
|
|
829
829
|
}));
|
|
830
830
|
};
|
|
831
831
|
return {
|
|
832
832
|
collapse: () => {
|
|
833
|
-
const { collapsible: r, collapsedSize: a } = o(), { mutableValues:
|
|
834
|
-
r &&
|
|
833
|
+
const { collapsible: r, collapsedSize: a } = o(), { mutableValues: u } = i(), c = s();
|
|
834
|
+
r && c !== a && (u.expandToSize = c, l(a));
|
|
835
835
|
},
|
|
836
836
|
expand: () => {
|
|
837
|
-
const { collapsible: r, collapsedSize: a, minSize:
|
|
837
|
+
const { collapsible: r, collapsedSize: a, minSize: u } = o(), { mutableValues: c } = i(), g = s();
|
|
838
838
|
if (r && g === a) {
|
|
839
|
-
let b =
|
|
839
|
+
let b = c.expandToSize ?? u;
|
|
840
840
|
b === 0 && (b = 1), l(b);
|
|
841
841
|
}
|
|
842
842
|
},
|
|
843
843
|
getSize: () => {
|
|
844
|
-
const { group: r } = n(), a = s(), { element:
|
|
844
|
+
const { group: r } = n(), a = s(), { element: u } = i(), c = r.orientation === "horizontal" ? u.offsetWidth : u.offsetHeight;
|
|
845
845
|
return {
|
|
846
846
|
asPercentage: a,
|
|
847
|
-
inPixels:
|
|
847
|
+
inPixels: c
|
|
848
848
|
};
|
|
849
849
|
},
|
|
850
850
|
isCollapsed: () => {
|
|
851
|
-
const { collapsible: r, collapsedSize: a } = o(),
|
|
852
|
-
return r && k(a,
|
|
851
|
+
const { collapsible: r, collapsedSize: a } = o(), u = s();
|
|
852
|
+
return r && k(a, u);
|
|
853
853
|
},
|
|
854
854
|
resize: (r) => {
|
|
855
855
|
if (s() !== r) {
|
|
856
|
-
let
|
|
856
|
+
let u;
|
|
857
857
|
switch (typeof r) {
|
|
858
858
|
case "number": {
|
|
859
|
-
const { group:
|
|
860
|
-
|
|
859
|
+
const { group: c } = n(), g = J({ group: c });
|
|
860
|
+
u = _(r / g * 100);
|
|
861
861
|
break;
|
|
862
862
|
}
|
|
863
863
|
case "string": {
|
|
864
|
-
|
|
864
|
+
u = parseFloat(r);
|
|
865
865
|
break;
|
|
866
866
|
}
|
|
867
867
|
}
|
|
868
|
-
l(
|
|
868
|
+
l(u);
|
|
869
869
|
}
|
|
870
870
|
}
|
|
871
871
|
};
|
|
@@ -924,21 +924,14 @@ function Ue({
|
|
|
924
924
|
layout: n,
|
|
925
925
|
panelConstraints: i
|
|
926
926
|
});
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
separatorToPanels: r
|
|
936
|
-
})
|
|
937
|
-
}));
|
|
938
|
-
const c = s.panels.map(({ id: u }) => u).join(",");
|
|
939
|
-
s.inMemoryLayouts[c] = a;
|
|
940
|
-
}
|
|
941
|
-
return a;
|
|
927
|
+
return o ? l : (U(l, a) || I((u) => ({
|
|
928
|
+
mountedGroups: new Map(u.mountedGroups).set(s, {
|
|
929
|
+
defaultLayoutDeferred: o,
|
|
930
|
+
derivedPanelConstraints: i,
|
|
931
|
+
layout: a,
|
|
932
|
+
separatorToPanels: r
|
|
933
|
+
})
|
|
934
|
+
})), a);
|
|
942
935
|
}
|
|
943
936
|
};
|
|
944
937
|
}
|
|
@@ -953,22 +946,22 @@ function W(e, t) {
|
|
|
953
946
|
P(i, "Matching separator not found");
|
|
954
947
|
const s = o.separatorToPanels.get(i);
|
|
955
948
|
P(s, "Matching panels not found");
|
|
956
|
-
const l = s.map((g) => n.panels.indexOf(g)), a = Ue({ groupId: n.id }).getLayout(),
|
|
949
|
+
const l = s.map((g) => n.panels.indexOf(g)), a = Ue({ groupId: n.id }).getLayout(), u = oe({
|
|
957
950
|
delta: t,
|
|
958
951
|
initialLayout: a,
|
|
959
952
|
panelConstraints: o.derivedPanelConstraints,
|
|
960
953
|
pivotIndices: l,
|
|
961
954
|
prevLayout: a,
|
|
962
955
|
trigger: "keyboard"
|
|
963
|
-
}),
|
|
964
|
-
layout:
|
|
956
|
+
}), c = B({
|
|
957
|
+
layout: u,
|
|
965
958
|
panelConstraints: o.derivedPanelConstraints
|
|
966
959
|
});
|
|
967
|
-
U(a,
|
|
960
|
+
U(a, c) || I((g) => ({
|
|
968
961
|
mountedGroups: new Map(g.mountedGroups).set(n, {
|
|
969
962
|
defaultLayoutDeferred: o.defaultLayoutDeferred,
|
|
970
963
|
derivedPanelConstraints: o.derivedPanelConstraints,
|
|
971
|
-
layout:
|
|
964
|
+
layout: c,
|
|
972
965
|
separatorToPanels: o.separatorToPanels
|
|
973
966
|
})
|
|
974
967
|
}));
|
|
@@ -1007,11 +1000,11 @@ function Pe(e) {
|
|
|
1007
1000
|
P(r, "Matching separator not found");
|
|
1008
1001
|
const a = l.get(r);
|
|
1009
1002
|
P(a, "Matching panels not found");
|
|
1010
|
-
const
|
|
1011
|
-
(g) => g.panelId ===
|
|
1003
|
+
const u = a[0], c = i.find(
|
|
1004
|
+
(g) => g.panelId === u.id
|
|
1012
1005
|
);
|
|
1013
|
-
if (P(
|
|
1014
|
-
const g = s[
|
|
1006
|
+
if (P(c, "Panel metadata not found"), c.collapsible) {
|
|
1007
|
+
const g = s[u.id], b = c.collapsedSize === g ? o.inMemoryLastExpandedPanelSizes[u.id] ?? c.minSize : c.collapsedSize;
|
|
1015
1008
|
W(t, b - g);
|
|
1016
1009
|
}
|
|
1017
1010
|
break;
|
|
@@ -1054,13 +1047,13 @@ function Ce(e) {
|
|
|
1054
1047
|
}
|
|
1055
1048
|
}), n.length && e.preventDefault();
|
|
1056
1049
|
}
|
|
1057
|
-
const
|
|
1050
|
+
const Rt = (e) => e, fe = () => {
|
|
1058
1051
|
}, Ke = 1, Xe = 2, qe = 4, Ye = 8, Re = 3, Me = 12;
|
|
1059
1052
|
let ae;
|
|
1060
1053
|
function Ee() {
|
|
1061
1054
|
return ae === void 0 && (ae = !1, typeof window < "u" && (window.navigator.userAgent.includes("Chrome") || window.navigator.userAgent.includes("Firefox")) && (ae = !0)), ae;
|
|
1062
1055
|
}
|
|
1063
|
-
function
|
|
1056
|
+
function Mt({
|
|
1064
1057
|
cursorFlags: e,
|
|
1065
1058
|
groups: t,
|
|
1066
1059
|
state: n
|
|
@@ -1104,16 +1097,16 @@ function Ct({
|
|
|
1104
1097
|
}
|
|
1105
1098
|
}
|
|
1106
1099
|
const ke = /* @__PURE__ */ new WeakMap();
|
|
1107
|
-
function
|
|
1100
|
+
function ge(e) {
|
|
1108
1101
|
if (e.defaultView === null || e.defaultView === void 0)
|
|
1109
1102
|
return;
|
|
1110
1103
|
let { prevStyle: t, styleSheet: n } = ke.get(e) ?? {};
|
|
1111
|
-
n === void 0 && (n = new e.defaultView.CSSStyleSheet(), e.adoptedStyleSheets.push(n));
|
|
1104
|
+
n === void 0 && (n = new e.defaultView.CSSStyleSheet(), e.adoptedStyleSheets && e.adoptedStyleSheets.push(n));
|
|
1112
1105
|
const { cursorFlags: o, interactionState: i } = G();
|
|
1113
1106
|
switch (i.state) {
|
|
1114
1107
|
case "active":
|
|
1115
1108
|
case "hover": {
|
|
1116
|
-
const s =
|
|
1109
|
+
const s = Mt({
|
|
1117
1110
|
cursorFlags: o,
|
|
1118
1111
|
groups: i.hitRegions.map((r) => r.group),
|
|
1119
1112
|
state: i.state
|
|
@@ -1144,28 +1137,28 @@ function Je({
|
|
|
1144
1137
|
}) {
|
|
1145
1138
|
let r = 0;
|
|
1146
1139
|
const a = new Map(i);
|
|
1147
|
-
n.forEach((
|
|
1148
|
-
const { group: g, groupSize: b } =
|
|
1140
|
+
n.forEach((c) => {
|
|
1141
|
+
const { group: g, groupSize: b } = c, { disableCursor: S, orientation: m, panels: d } = g;
|
|
1149
1142
|
let f = 0;
|
|
1150
|
-
s ?
|
|
1151
|
-
const
|
|
1143
|
+
s ? m === "horizontal" ? f = (t.clientX - s.x) / b * 100 : f = (t.clientY - s.y) / b * 100 : m === "horizontal" ? f = t.clientX < 0 ? -100 : 100 : f = t.clientY < 0 ? -100 : 100;
|
|
1144
|
+
const h = o.get(g), {
|
|
1152
1145
|
defaultLayoutDeferred: v,
|
|
1153
1146
|
derivedPanelConstraints: x,
|
|
1154
1147
|
layout: y,
|
|
1155
1148
|
separatorToPanels: p
|
|
1156
1149
|
} = i.get(g) ?? { defaultLayoutDeferred: !1 };
|
|
1157
|
-
if (x &&
|
|
1150
|
+
if (x && h && y && p) {
|
|
1158
1151
|
const w = oe({
|
|
1159
1152
|
delta: f,
|
|
1160
|
-
initialLayout:
|
|
1153
|
+
initialLayout: h,
|
|
1161
1154
|
panelConstraints: x,
|
|
1162
|
-
pivotIndices:
|
|
1155
|
+
pivotIndices: c.panels.map((C) => d.indexOf(C)),
|
|
1163
1156
|
prevLayout: y,
|
|
1164
1157
|
trigger: "mouse-or-touch"
|
|
1165
1158
|
});
|
|
1166
1159
|
if (U(w, y)) {
|
|
1167
1160
|
if (f !== 0 && !S)
|
|
1168
|
-
switch (
|
|
1161
|
+
switch (m) {
|
|
1169
1162
|
case "horizontal": {
|
|
1170
1163
|
r |= f < 0 ? Ke : Xe;
|
|
1171
1164
|
break;
|
|
@@ -1175,23 +1168,20 @@ function Je({
|
|
|
1175
1168
|
break;
|
|
1176
1169
|
}
|
|
1177
1170
|
}
|
|
1178
|
-
} else
|
|
1179
|
-
a.set(
|
|
1171
|
+
} else
|
|
1172
|
+
a.set(c.group, {
|
|
1180
1173
|
defaultLayoutDeferred: v,
|
|
1181
1174
|
derivedPanelConstraints: x,
|
|
1182
1175
|
layout: w,
|
|
1183
1176
|
separatorToPanels: p
|
|
1184
1177
|
});
|
|
1185
|
-
const C = u.group.panels.map(({ id: R }) => R).join(",");
|
|
1186
|
-
u.group.inMemoryLayouts[C] = w;
|
|
1187
|
-
}
|
|
1188
1178
|
}
|
|
1189
1179
|
});
|
|
1190
|
-
let
|
|
1191
|
-
t.movementX === 0 ?
|
|
1192
|
-
cursorFlags:
|
|
1180
|
+
let u = 0;
|
|
1181
|
+
t.movementX === 0 ? u |= l & Re : u |= r & Re, t.movementY === 0 ? u |= l & Me : u |= r & Me, I({
|
|
1182
|
+
cursorFlags: u,
|
|
1193
1183
|
mountedGroups: a
|
|
1194
|
-
}),
|
|
1184
|
+
}), ge(e);
|
|
1195
1185
|
}
|
|
1196
1186
|
function Ge(e) {
|
|
1197
1187
|
const { cursorFlags: t, interactionState: n, mountedGroups: o } = G();
|
|
@@ -1249,7 +1239,7 @@ function Ie(e) {
|
|
|
1249
1239
|
hitRegions: i,
|
|
1250
1240
|
state: "hover"
|
|
1251
1241
|
}
|
|
1252
|
-
}),
|
|
1242
|
+
}), ge(e.currentTarget);
|
|
1253
1243
|
break;
|
|
1254
1244
|
}
|
|
1255
1245
|
}
|
|
@@ -1280,7 +1270,7 @@ function Oe(e) {
|
|
|
1280
1270
|
interactionState: {
|
|
1281
1271
|
state: "inactive"
|
|
1282
1272
|
}
|
|
1283
|
-
}), t.hitRegions.length > 0 && (
|
|
1273
|
+
}), t.hitRegions.length > 0 && (ge(e.currentTarget), I((n) => ({
|
|
1284
1274
|
mountedGroups: new Map(n.mountedGroups)
|
|
1285
1275
|
})), e.preventDefault());
|
|
1286
1276
|
}
|
|
@@ -1303,10 +1293,10 @@ function Te(e) {
|
|
|
1303
1293
|
}
|
|
1304
1294
|
return o;
|
|
1305
1295
|
}
|
|
1306
|
-
function
|
|
1296
|
+
function Et(e, t, n) {
|
|
1307
1297
|
if (!n[0])
|
|
1308
1298
|
return;
|
|
1309
|
-
const i = e.panels.find((
|
|
1299
|
+
const i = e.panels.find((u) => u.element === t);
|
|
1310
1300
|
if (!i || !i.onResize)
|
|
1311
1301
|
return;
|
|
1312
1302
|
const s = J({ group: e }), l = e.orientation === "horizontal" ? i.element.offsetWidth : i.element.offsetHeight, r = i.mutableValues.prevSize, a = {
|
|
@@ -1315,7 +1305,7 @@ function Rt(e, t, n) {
|
|
|
1315
1305
|
};
|
|
1316
1306
|
i.mutableValues.prevSize = a, i.onResize(a, i.id, r);
|
|
1317
1307
|
}
|
|
1318
|
-
function
|
|
1308
|
+
function kt(e, t) {
|
|
1319
1309
|
if (Object.keys(e).length !== Object.keys(t).length)
|
|
1320
1310
|
return !1;
|
|
1321
1311
|
for (const o in e)
|
|
@@ -1323,7 +1313,7 @@ function Mt(e, t) {
|
|
|
1323
1313
|
return !1;
|
|
1324
1314
|
return !0;
|
|
1325
1315
|
}
|
|
1326
|
-
function
|
|
1316
|
+
function Gt(e, t) {
|
|
1327
1317
|
const n = e.map((i) => i.id), o = Object.keys(t);
|
|
1328
1318
|
if (n.length !== o.length)
|
|
1329
1319
|
return !1;
|
|
@@ -1333,27 +1323,27 @@ function Et(e, t) {
|
|
|
1333
1323
|
return !0;
|
|
1334
1324
|
}
|
|
1335
1325
|
const q = /* @__PURE__ */ new Map();
|
|
1336
|
-
function
|
|
1326
|
+
function It(e) {
|
|
1337
1327
|
let t = !0;
|
|
1338
1328
|
P(
|
|
1339
1329
|
e.element.ownerDocument.defaultView,
|
|
1340
1330
|
"Cannot register an unmounted Group"
|
|
1341
1331
|
);
|
|
1342
|
-
const n = e.element.ownerDocument.defaultView.ResizeObserver, o = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set(), s = new n((
|
|
1343
|
-
for (const d of
|
|
1344
|
-
const { borderBoxSize: f, target:
|
|
1345
|
-
if (
|
|
1332
|
+
const n = e.element.ownerDocument.defaultView.ResizeObserver, o = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set(), s = new n((m) => {
|
|
1333
|
+
for (const d of m) {
|
|
1334
|
+
const { borderBoxSize: f, target: h } = d;
|
|
1335
|
+
if (h === e.element) {
|
|
1346
1336
|
if (t) {
|
|
1347
1337
|
if (J({ group: e }) === 0)
|
|
1348
1338
|
return;
|
|
1349
1339
|
I((x) => {
|
|
1350
1340
|
const y = x.mountedGroups.get(e);
|
|
1351
1341
|
if (y) {
|
|
1352
|
-
const p =
|
|
1342
|
+
const p = pe(e), w = y.defaultLayoutDeferred ? Te(p) : y.layout, C = B({
|
|
1353
1343
|
layout: w,
|
|
1354
1344
|
panelConstraints: p
|
|
1355
1345
|
});
|
|
1356
|
-
return !y.defaultLayoutDeferred && U(w, C) &&
|
|
1346
|
+
return !y.defaultLayoutDeferred && U(w, C) && kt(
|
|
1357
1347
|
y.derivedPanelConstraints,
|
|
1358
1348
|
p
|
|
1359
1349
|
) ? x : {
|
|
@@ -1369,23 +1359,23 @@ function kt(e) {
|
|
|
1369
1359
|
});
|
|
1370
1360
|
}
|
|
1371
1361
|
} else
|
|
1372
|
-
|
|
1362
|
+
Et(e, h, f);
|
|
1373
1363
|
}
|
|
1374
1364
|
});
|
|
1375
|
-
s.observe(e.element), e.panels.forEach((
|
|
1365
|
+
s.observe(e.element), e.panels.forEach((m) => {
|
|
1376
1366
|
P(
|
|
1377
|
-
!o.has(
|
|
1378
|
-
`Panel ids must be unique; id "${
|
|
1379
|
-
), o.add(
|
|
1367
|
+
!o.has(m.id),
|
|
1368
|
+
`Panel ids must be unique; id "${m.id}" was used more than once`
|
|
1369
|
+
), o.add(m.id), m.onResize && s.observe(m.element);
|
|
1380
1370
|
});
|
|
1381
|
-
const l = J({ group: e }), r =
|
|
1382
|
-
let
|
|
1383
|
-
|
|
1384
|
-
const
|
|
1385
|
-
layout:
|
|
1371
|
+
const l = J({ group: e }), r = pe(e), a = e.panels.map(({ id: m }) => m).join(",");
|
|
1372
|
+
let u = e.defaultLayout;
|
|
1373
|
+
u && (Gt(e.panels, u) || (u = void 0));
|
|
1374
|
+
const c = e.inMemoryLayouts[a] ?? u ?? Te(r), g = B({
|
|
1375
|
+
layout: c,
|
|
1386
1376
|
panelConstraints: r
|
|
1387
1377
|
}), b = Ve(e), S = e.element.ownerDocument;
|
|
1388
|
-
return I((
|
|
1378
|
+
return I((m) => {
|
|
1389
1379
|
const d = /* @__PURE__ */ new Map();
|
|
1390
1380
|
return q.set(
|
|
1391
1381
|
S,
|
|
@@ -1393,18 +1383,18 @@ function kt(e) {
|
|
|
1393
1383
|
), b.forEach((f) => {
|
|
1394
1384
|
f.separator && d.set(f.separator, f.panels);
|
|
1395
1385
|
}), {
|
|
1396
|
-
mountedGroups: new Map(
|
|
1386
|
+
mountedGroups: new Map(m.mountedGroups).set(e, {
|
|
1397
1387
|
defaultLayoutDeferred: l === 0,
|
|
1398
1388
|
derivedPanelConstraints: r,
|
|
1399
1389
|
layout: g,
|
|
1400
1390
|
separatorToPanels: d
|
|
1401
1391
|
})
|
|
1402
1392
|
};
|
|
1403
|
-
}), e.separators.forEach((
|
|
1393
|
+
}), e.separators.forEach((m) => {
|
|
1404
1394
|
P(
|
|
1405
|
-
!i.has(
|
|
1406
|
-
`Separator ids must be unique; id "${
|
|
1407
|
-
), i.add(
|
|
1395
|
+
!i.has(m.id),
|
|
1396
|
+
`Separator ids must be unique; id "${m.id}" was used more than once`
|
|
1397
|
+
), i.add(m.id), m.element.addEventListener("keydown", Pe);
|
|
1408
1398
|
}), q.get(S) === 1 && (S.addEventListener("dblclick", Le, !0), S.addEventListener("pointerdown", Ce, !0), S.addEventListener("pointerleave", Ge), S.addEventListener("pointermove", Ie), S.addEventListener("pointerout", De), S.addEventListener("pointerup", Oe, !0)), function() {
|
|
1409
1399
|
t = !1, q.set(
|
|
1410
1400
|
S,
|
|
@@ -1425,12 +1415,12 @@ function kt(e) {
|
|
|
1425
1415
|
), S.removeEventListener("pointerleave", Ge), S.removeEventListener("pointermove", Ie), S.removeEventListener("pointerout", De), S.removeEventListener("pointerup", Oe, !0)), s.disconnect();
|
|
1426
1416
|
};
|
|
1427
1417
|
}
|
|
1428
|
-
function
|
|
1418
|
+
function Dt() {
|
|
1429
1419
|
const [e, t] = ne({}), n = Q(() => t({}), []);
|
|
1430
1420
|
return [e, n];
|
|
1431
1421
|
}
|
|
1432
|
-
function
|
|
1433
|
-
const t =
|
|
1422
|
+
function ye(e) {
|
|
1423
|
+
const t = rt();
|
|
1434
1424
|
return `${e ?? t}`;
|
|
1435
1425
|
}
|
|
1436
1426
|
const K = typeof window < "u" ? Ae : ue;
|
|
@@ -1443,7 +1433,7 @@ function ee(e) {
|
|
|
1443
1433
|
[t]
|
|
1444
1434
|
);
|
|
1445
1435
|
}
|
|
1446
|
-
function
|
|
1436
|
+
function Se(...e) {
|
|
1447
1437
|
return ee((t) => {
|
|
1448
1438
|
e.forEach((n) => {
|
|
1449
1439
|
if (n)
|
|
@@ -1460,18 +1450,18 @@ function ye(...e) {
|
|
|
1460
1450
|
});
|
|
1461
1451
|
});
|
|
1462
1452
|
}
|
|
1463
|
-
function
|
|
1453
|
+
function ve(e) {
|
|
1464
1454
|
const t = O({ ...e });
|
|
1465
1455
|
return K(() => {
|
|
1466
1456
|
for (const n in e)
|
|
1467
1457
|
t.current[n] = e[n];
|
|
1468
1458
|
}, [e]), t.current;
|
|
1469
1459
|
}
|
|
1470
|
-
const Ze =
|
|
1471
|
-
function
|
|
1460
|
+
const Ze = st(null);
|
|
1461
|
+
function Ot(e, t) {
|
|
1472
1462
|
const n = O({
|
|
1473
1463
|
getLayout: () => ({}),
|
|
1474
|
-
setLayout:
|
|
1464
|
+
setLayout: Rt
|
|
1475
1465
|
});
|
|
1476
1466
|
Ne(t, () => n.current, []), K(() => {
|
|
1477
1467
|
Object.assign(
|
|
@@ -1480,7 +1470,7 @@ function It(e, t) {
|
|
|
1480
1470
|
);
|
|
1481
1471
|
});
|
|
1482
1472
|
}
|
|
1483
|
-
function
|
|
1473
|
+
function Tt({
|
|
1484
1474
|
children: e,
|
|
1485
1475
|
className: t,
|
|
1486
1476
|
defaultLayout: n,
|
|
@@ -1490,8 +1480,8 @@ function Dt({
|
|
|
1490
1480
|
groupRef: l,
|
|
1491
1481
|
id: r,
|
|
1492
1482
|
onLayoutChange: a,
|
|
1493
|
-
onLayoutChanged:
|
|
1494
|
-
orientation:
|
|
1483
|
+
onLayoutChanged: u,
|
|
1484
|
+
orientation: c = "horizontal",
|
|
1495
1485
|
resizeTargetMinimumSize: g = {
|
|
1496
1486
|
coarse: 20,
|
|
1497
1487
|
fine: 10
|
|
@@ -1499,32 +1489,32 @@ function Dt({
|
|
|
1499
1489
|
style: b,
|
|
1500
1490
|
...S
|
|
1501
1491
|
}) {
|
|
1502
|
-
const
|
|
1492
|
+
const m = O({
|
|
1503
1493
|
onLayoutChange: {},
|
|
1504
1494
|
onLayoutChanged: {}
|
|
1505
1495
|
}), d = ee((z) => {
|
|
1506
|
-
U(
|
|
1496
|
+
U(m.current.onLayoutChange, z) || (m.current.onLayoutChange = z, a?.(z));
|
|
1507
1497
|
}), f = ee((z) => {
|
|
1508
|
-
U(
|
|
1509
|
-
}),
|
|
1498
|
+
U(m.current.onLayoutChanged, z) || (m.current.onLayoutChanged = z, u?.(z));
|
|
1499
|
+
}), h = ye(r), v = O(null), [x, y] = Dt(), p = O({
|
|
1510
1500
|
lastExpandedPanelSizes: {},
|
|
1511
1501
|
layouts: {},
|
|
1512
1502
|
panels: [],
|
|
1513
1503
|
resizeTargetMinimumSize: g,
|
|
1514
1504
|
separators: []
|
|
1515
|
-
}), w =
|
|
1516
|
-
|
|
1505
|
+
}), w = Se(v, s);
|
|
1506
|
+
Ot(h, l);
|
|
1517
1507
|
const C = ee(
|
|
1518
1508
|
(z, L) => {
|
|
1519
|
-
const { interactionState:
|
|
1520
|
-
for (const D of
|
|
1509
|
+
const { interactionState: E, mountedGroups: M } = G();
|
|
1510
|
+
for (const D of M.keys())
|
|
1521
1511
|
if (D.id === z) {
|
|
1522
|
-
const T =
|
|
1512
|
+
const T = M.get(D);
|
|
1523
1513
|
if (T) {
|
|
1524
1514
|
let N = !1;
|
|
1525
|
-
switch (
|
|
1515
|
+
switch (E.state) {
|
|
1526
1516
|
case "active": {
|
|
1527
|
-
N =
|
|
1517
|
+
N = E.hitRegions.some(
|
|
1528
1518
|
(Z) => Z.group === D
|
|
1529
1519
|
);
|
|
1530
1520
|
break;
|
|
@@ -1540,7 +1530,7 @@ function Dt({
|
|
|
1540
1530
|
flexGrow: n?.[L] ?? 1
|
|
1541
1531
|
};
|
|
1542
1532
|
}
|
|
1543
|
-
), R =
|
|
1533
|
+
), R = ve({
|
|
1544
1534
|
defaultLayout: n,
|
|
1545
1535
|
disableCursor: o
|
|
1546
1536
|
}), X = _e(
|
|
@@ -1549,79 +1539,79 @@ function Dt({
|
|
|
1549
1539
|
return !!R.disableCursor;
|
|
1550
1540
|
},
|
|
1551
1541
|
getPanelStyles: C,
|
|
1552
|
-
id:
|
|
1553
|
-
orientation:
|
|
1542
|
+
id: h,
|
|
1543
|
+
orientation: c,
|
|
1554
1544
|
registerPanel: (z) => {
|
|
1555
1545
|
const L = p.current;
|
|
1556
|
-
return L.panels =
|
|
1546
|
+
return L.panels = he(c, [
|
|
1557
1547
|
...L.panels,
|
|
1558
1548
|
z
|
|
1559
1549
|
]), y(), () => {
|
|
1560
1550
|
L.panels = L.panels.filter(
|
|
1561
|
-
(
|
|
1551
|
+
(E) => E !== z
|
|
1562
1552
|
), y();
|
|
1563
1553
|
};
|
|
1564
1554
|
},
|
|
1565
1555
|
registerSeparator: (z) => {
|
|
1566
1556
|
const L = p.current;
|
|
1567
|
-
return L.separators =
|
|
1557
|
+
return L.separators = he(c, [
|
|
1568
1558
|
...L.separators,
|
|
1569
1559
|
z
|
|
1570
1560
|
]), y(), () => {
|
|
1571
1561
|
L.separators = L.separators.filter(
|
|
1572
|
-
(
|
|
1562
|
+
(E) => E !== z
|
|
1573
1563
|
), y();
|
|
1574
1564
|
};
|
|
1575
1565
|
},
|
|
1576
1566
|
togglePanelDisabled: (z, L) => {
|
|
1577
|
-
const
|
|
1567
|
+
const M = p.current.panels.find(
|
|
1578
1568
|
(T) => T.id === z
|
|
1579
1569
|
);
|
|
1580
|
-
|
|
1570
|
+
M && (M.panelConstraints.disabled = L);
|
|
1581
1571
|
const { mountedGroups: D } = G();
|
|
1582
1572
|
for (const T of D.keys())
|
|
1583
|
-
if (T.id ===
|
|
1573
|
+
if (T.id === h) {
|
|
1584
1574
|
const N = D.get(T);
|
|
1585
|
-
N && (N.derivedPanelConstraints =
|
|
1575
|
+
N && (N.derivedPanelConstraints = pe(T));
|
|
1586
1576
|
}
|
|
1587
1577
|
},
|
|
1588
1578
|
toggleSeparatorDisabled: (z, L) => {
|
|
1589
|
-
const
|
|
1579
|
+
const M = p.current.separators.find(
|
|
1590
1580
|
(D) => D.id === z
|
|
1591
1581
|
);
|
|
1592
|
-
|
|
1582
|
+
M && (M.disabled = L);
|
|
1593
1583
|
}
|
|
1594
1584
|
}),
|
|
1595
|
-
[C,
|
|
1585
|
+
[C, h, y, c, R]
|
|
1596
1586
|
), V = O(null);
|
|
1597
1587
|
return K(() => {
|
|
1598
1588
|
const z = v.current;
|
|
1599
1589
|
if (z === null)
|
|
1600
1590
|
return;
|
|
1601
1591
|
const L = p.current;
|
|
1602
|
-
let
|
|
1592
|
+
let E;
|
|
1603
1593
|
if (R.defaultLayout !== void 0 && Object.keys(R.defaultLayout).length === L.panels.length) {
|
|
1604
|
-
|
|
1594
|
+
E = {};
|
|
1605
1595
|
for (const H of L.panels) {
|
|
1606
1596
|
const j = R.defaultLayout[H.id];
|
|
1607
|
-
j !== void 0 && (
|
|
1597
|
+
j !== void 0 && (E[H.id] = j);
|
|
1608
1598
|
}
|
|
1609
1599
|
}
|
|
1610
|
-
const
|
|
1611
|
-
defaultLayout:
|
|
1600
|
+
const M = {
|
|
1601
|
+
defaultLayout: E,
|
|
1612
1602
|
disableCursor: !!R.disableCursor,
|
|
1613
1603
|
disabled: !!i,
|
|
1614
1604
|
element: z,
|
|
1615
|
-
id:
|
|
1605
|
+
id: h,
|
|
1616
1606
|
inMemoryLastExpandedPanelSizes: p.current.lastExpandedPanelSizes,
|
|
1617
1607
|
inMemoryLayouts: p.current.layouts,
|
|
1618
|
-
orientation:
|
|
1608
|
+
orientation: c,
|
|
1619
1609
|
panels: L.panels,
|
|
1620
1610
|
resizeTargetMinimumSize: L.resizeTargetMinimumSize,
|
|
1621
1611
|
separators: L.separators
|
|
1622
1612
|
};
|
|
1623
|
-
V.current =
|
|
1624
|
-
const D =
|
|
1613
|
+
V.current = M;
|
|
1614
|
+
const D = It(M), N = G().mountedGroups.get(M);
|
|
1625
1615
|
if (N) {
|
|
1626
1616
|
const { defaultLayoutDeferred: H, derivedPanelConstraints: j, layout: ie } = N;
|
|
1627
1617
|
!H && j.length > 0 && (d(ie), f(ie));
|
|
@@ -1634,13 +1624,15 @@ function Dt({
|
|
|
1634
1624
|
), Qe = $.addListener(
|
|
1635
1625
|
"mountedGroupsChange",
|
|
1636
1626
|
(H) => {
|
|
1637
|
-
const j = H.get(
|
|
1627
|
+
const j = H.get(M);
|
|
1638
1628
|
if (j) {
|
|
1639
|
-
const { defaultLayoutDeferred: ie, derivedPanelConstraints: et, layout:
|
|
1629
|
+
const { defaultLayoutDeferred: ie, derivedPanelConstraints: et, layout: ce } = j;
|
|
1640
1630
|
if (ie || et.length === 0)
|
|
1641
1631
|
return;
|
|
1642
|
-
const {
|
|
1643
|
-
|
|
1632
|
+
const tt = M.panels.map(({ id: it }) => it).join(",");
|
|
1633
|
+
M.inMemoryLayouts[tt] = ce;
|
|
1634
|
+
const { interactionState: nt } = G(), ot = nt.state !== "active";
|
|
1635
|
+
d(ce), ot && f(ce);
|
|
1644
1636
|
}
|
|
1645
1637
|
}
|
|
1646
1638
|
);
|
|
@@ -1649,10 +1641,10 @@ function Dt({
|
|
|
1649
1641
|
};
|
|
1650
1642
|
}, [
|
|
1651
1643
|
i,
|
|
1652
|
-
|
|
1644
|
+
h,
|
|
1653
1645
|
f,
|
|
1654
1646
|
d,
|
|
1655
|
-
|
|
1647
|
+
c,
|
|
1656
1648
|
x,
|
|
1657
1649
|
R
|
|
1658
1650
|
]), ue(() => {
|
|
@@ -1664,8 +1656,8 @@ function Dt({
|
|
|
1664
1656
|
...S,
|
|
1665
1657
|
className: t,
|
|
1666
1658
|
"data-group": !0,
|
|
1667
|
-
"data-testid":
|
|
1668
|
-
id:
|
|
1659
|
+
"data-testid": h,
|
|
1660
|
+
id: h,
|
|
1669
1661
|
ref: w,
|
|
1670
1662
|
style: {
|
|
1671
1663
|
height: "100%",
|
|
@@ -1673,61 +1665,61 @@ function Dt({
|
|
|
1673
1665
|
overflow: "hidden",
|
|
1674
1666
|
...b,
|
|
1675
1667
|
display: "flex",
|
|
1676
|
-
flexDirection:
|
|
1668
|
+
flexDirection: c === "horizontal" ? "row" : "column",
|
|
1677
1669
|
flexWrap: "nowrap",
|
|
1678
1670
|
// Inform the browser that the library is handling touch events for this element
|
|
1679
1671
|
// but still allow users to scroll content within panels in the non-resizing direction
|
|
1680
1672
|
// NOTE This is not an inherited style
|
|
1681
1673
|
// See github.com/bvaughn/react-resizable-panels/issues/662
|
|
1682
|
-
touchAction:
|
|
1674
|
+
touchAction: c === "horizontal" ? "pan-y" : "pan-x"
|
|
1683
1675
|
},
|
|
1684
1676
|
children: e
|
|
1685
1677
|
}
|
|
1686
1678
|
) });
|
|
1687
1679
|
}
|
|
1688
|
-
|
|
1689
|
-
function
|
|
1680
|
+
Tt.displayName = "Group";
|
|
1681
|
+
function de(e, t) {
|
|
1690
1682
|
return `react-resizable-panels:${[e, ...t].join(":")}`;
|
|
1691
1683
|
}
|
|
1692
|
-
function
|
|
1684
|
+
function Wt({
|
|
1693
1685
|
debounceSaveMs: e = 100,
|
|
1694
1686
|
panelIds: t,
|
|
1695
1687
|
storage: n = localStorage,
|
|
1696
1688
|
...o
|
|
1697
1689
|
}) {
|
|
1698
|
-
const i = t !== void 0, s = "id" in o ? o.id : o.groupId, l =
|
|
1699
|
-
|
|
1690
|
+
const i = t !== void 0, s = "id" in o ? o.id : o.groupId, l = de(s, t ?? []), r = Fe(
|
|
1691
|
+
At,
|
|
1700
1692
|
() => n.getItem(l),
|
|
1701
1693
|
() => n.getItem(l)
|
|
1702
1694
|
), a = _e(
|
|
1703
1695
|
() => r ? JSON.parse(r) : void 0,
|
|
1704
1696
|
[r]
|
|
1705
|
-
),
|
|
1706
|
-
const S =
|
|
1707
|
-
S && (
|
|
1697
|
+
), u = O(null), c = Q(() => {
|
|
1698
|
+
const S = u.current;
|
|
1699
|
+
S && (u.current = null, clearTimeout(S));
|
|
1708
1700
|
}, []);
|
|
1709
1701
|
Ae(() => () => {
|
|
1710
|
-
|
|
1711
|
-
}, [
|
|
1702
|
+
c();
|
|
1703
|
+
}, [c]);
|
|
1712
1704
|
const g = Q(
|
|
1713
1705
|
(S) => {
|
|
1714
|
-
|
|
1715
|
-
let
|
|
1716
|
-
i ?
|
|
1706
|
+
c();
|
|
1707
|
+
let m;
|
|
1708
|
+
i ? m = de(s, Object.keys(S)) : m = de(s, []);
|
|
1717
1709
|
try {
|
|
1718
|
-
n.setItem(
|
|
1710
|
+
n.setItem(m, JSON.stringify(S));
|
|
1719
1711
|
} catch (d) {
|
|
1720
1712
|
console.error(d);
|
|
1721
1713
|
}
|
|
1722
1714
|
},
|
|
1723
|
-
[
|
|
1715
|
+
[c, i, s, n]
|
|
1724
1716
|
), b = Q(
|
|
1725
1717
|
(S) => {
|
|
1726
|
-
|
|
1718
|
+
c(), e === 0 ? g(S) : u.current = setTimeout(() => {
|
|
1727
1719
|
g(S);
|
|
1728
1720
|
}, e);
|
|
1729
1721
|
},
|
|
1730
|
-
[
|
|
1722
|
+
[c, e, g]
|
|
1731
1723
|
);
|
|
1732
1724
|
return {
|
|
1733
1725
|
/**
|
|
@@ -1746,33 +1738,33 @@ function Vt({
|
|
|
1746
1738
|
onLayoutChanged: g
|
|
1747
1739
|
};
|
|
1748
1740
|
}
|
|
1749
|
-
function
|
|
1741
|
+
function At() {
|
|
1750
1742
|
return function() {
|
|
1751
1743
|
};
|
|
1752
1744
|
}
|
|
1753
|
-
function
|
|
1745
|
+
function Ut() {
|
|
1754
1746
|
return ne(null);
|
|
1755
1747
|
}
|
|
1756
|
-
function
|
|
1748
|
+
function Bt() {
|
|
1757
1749
|
return O(null);
|
|
1758
1750
|
}
|
|
1759
|
-
function
|
|
1760
|
-
const e =
|
|
1751
|
+
function xe() {
|
|
1752
|
+
const e = at(Ze);
|
|
1761
1753
|
return P(
|
|
1762
1754
|
e,
|
|
1763
1755
|
"Group Context not found; did you render a Panel or Separator outside of a Group?"
|
|
1764
1756
|
), e;
|
|
1765
1757
|
}
|
|
1766
|
-
function
|
|
1767
|
-
const { id: n } =
|
|
1768
|
-
collapse:
|
|
1769
|
-
expand:
|
|
1758
|
+
function Nt(e, t) {
|
|
1759
|
+
const { id: n } = xe(), o = O({
|
|
1760
|
+
collapse: fe,
|
|
1761
|
+
expand: fe,
|
|
1770
1762
|
getSize: () => ({
|
|
1771
1763
|
asPercentage: 0,
|
|
1772
1764
|
inPixels: 0
|
|
1773
1765
|
}),
|
|
1774
1766
|
isCollapsed: () => !1,
|
|
1775
|
-
resize:
|
|
1767
|
+
resize: fe
|
|
1776
1768
|
});
|
|
1777
1769
|
Ne(t, () => o.current, []), K(() => {
|
|
1778
1770
|
Object.assign(
|
|
@@ -1781,7 +1773,7 @@ function Tt(e, t) {
|
|
|
1781
1773
|
);
|
|
1782
1774
|
});
|
|
1783
1775
|
}
|
|
1784
|
-
function
|
|
1776
|
+
function _t({
|
|
1785
1777
|
children: e,
|
|
1786
1778
|
className: t,
|
|
1787
1779
|
collapsedSize: n = "0%",
|
|
@@ -1791,32 +1783,32 @@ function At({
|
|
|
1791
1783
|
elementRef: l,
|
|
1792
1784
|
id: r,
|
|
1793
1785
|
maxSize: a = "100%",
|
|
1794
|
-
minSize:
|
|
1795
|
-
onResize:
|
|
1786
|
+
minSize: u = "0%",
|
|
1787
|
+
onResize: c,
|
|
1796
1788
|
panelRef: g,
|
|
1797
1789
|
style: b,
|
|
1798
1790
|
...S
|
|
1799
1791
|
}) {
|
|
1800
|
-
const
|
|
1792
|
+
const m = !!r, d = ye(r), f = ve({
|
|
1801
1793
|
disabled: s
|
|
1802
|
-
}),
|
|
1794
|
+
}), h = O(null), v = Se(h, l), {
|
|
1803
1795
|
getPanelStyles: x,
|
|
1804
1796
|
id: y,
|
|
1805
1797
|
orientation: p,
|
|
1806
1798
|
registerPanel: w,
|
|
1807
1799
|
togglePanelDisabled: C
|
|
1808
|
-
} =
|
|
1809
|
-
(z, L,
|
|
1810
|
-
|
|
1800
|
+
} = xe(), R = c !== null, X = ee(
|
|
1801
|
+
(z, L, E) => {
|
|
1802
|
+
c?.(z, r, E);
|
|
1811
1803
|
}
|
|
1812
1804
|
);
|
|
1813
1805
|
K(() => {
|
|
1814
|
-
const z =
|
|
1806
|
+
const z = h.current;
|
|
1815
1807
|
if (z !== null) {
|
|
1816
1808
|
const L = {
|
|
1817
1809
|
element: z,
|
|
1818
1810
|
id: d,
|
|
1819
|
-
idIsStable:
|
|
1811
|
+
idIsStable: m,
|
|
1820
1812
|
mutableValues: {
|
|
1821
1813
|
expandToSize: void 0,
|
|
1822
1814
|
prevSize: void 0
|
|
@@ -1828,7 +1820,7 @@ function At({
|
|
|
1828
1820
|
defaultSize: i,
|
|
1829
1821
|
disabled: f.disabled,
|
|
1830
1822
|
maxSize: a,
|
|
1831
|
-
minSize:
|
|
1823
|
+
minSize: u
|
|
1832
1824
|
}
|
|
1833
1825
|
};
|
|
1834
1826
|
return w(L);
|
|
@@ -1839,15 +1831,15 @@ function At({
|
|
|
1839
1831
|
i,
|
|
1840
1832
|
R,
|
|
1841
1833
|
d,
|
|
1842
|
-
|
|
1834
|
+
m,
|
|
1843
1835
|
a,
|
|
1844
|
-
|
|
1836
|
+
u,
|
|
1845
1837
|
X,
|
|
1846
1838
|
w,
|
|
1847
1839
|
f
|
|
1848
1840
|
]), ue(() => {
|
|
1849
1841
|
C(d, !!s);
|
|
1850
|
-
}, [s, d, C]),
|
|
1842
|
+
}, [s, d, C]), Nt(d, g);
|
|
1851
1843
|
const V = Fe(
|
|
1852
1844
|
(z) => ($.addListener("mountedGroupsChange", z), () => {
|
|
1853
1845
|
$.removeListener("mountedGroupsChange", z);
|
|
@@ -1867,7 +1859,7 @@ function At({
|
|
|
1867
1859
|
id: d,
|
|
1868
1860
|
ref: v,
|
|
1869
1861
|
style: {
|
|
1870
|
-
...
|
|
1862
|
+
...Ft,
|
|
1871
1863
|
display: "flex",
|
|
1872
1864
|
flexBasis: 0,
|
|
1873
1865
|
flexShrink: 1,
|
|
@@ -1896,8 +1888,8 @@ function At({
|
|
|
1896
1888
|
}
|
|
1897
1889
|
);
|
|
1898
1890
|
}
|
|
1899
|
-
|
|
1900
|
-
const
|
|
1891
|
+
_t.displayName = "Panel";
|
|
1892
|
+
const Ft = {
|
|
1901
1893
|
minHeight: 0,
|
|
1902
1894
|
maxHeight: "100%",
|
|
1903
1895
|
height: "auto",
|
|
@@ -1909,13 +1901,13 @@ const Nt = {
|
|
|
1909
1901
|
padding: 0,
|
|
1910
1902
|
margin: 0
|
|
1911
1903
|
};
|
|
1912
|
-
function
|
|
1904
|
+
function Kt() {
|
|
1913
1905
|
return ne(null);
|
|
1914
1906
|
}
|
|
1915
|
-
function
|
|
1907
|
+
function Xt() {
|
|
1916
1908
|
return O(null);
|
|
1917
1909
|
}
|
|
1918
|
-
function
|
|
1910
|
+
function $t({
|
|
1919
1911
|
layout: e,
|
|
1920
1912
|
panelConstraints: t,
|
|
1921
1913
|
panelId: n,
|
|
@@ -1926,13 +1918,13 @@ function _t({
|
|
|
1926
1918
|
(a) => a.panelId === n
|
|
1927
1919
|
);
|
|
1928
1920
|
if (r) {
|
|
1929
|
-
const a = r.maxSize,
|
|
1921
|
+
const a = r.maxSize, u = r.collapsible ? r.collapsedSize : r.minSize, c = [o, o + 1];
|
|
1930
1922
|
s = B({
|
|
1931
1923
|
layout: oe({
|
|
1932
|
-
delta:
|
|
1924
|
+
delta: u - l,
|
|
1933
1925
|
initialLayout: e,
|
|
1934
1926
|
panelConstraints: t,
|
|
1935
|
-
pivotIndices:
|
|
1927
|
+
pivotIndices: c,
|
|
1936
1928
|
prevLayout: e
|
|
1937
1929
|
}),
|
|
1938
1930
|
panelConstraints: t
|
|
@@ -1941,7 +1933,7 @@ function _t({
|
|
|
1941
1933
|
delta: a - l,
|
|
1942
1934
|
initialLayout: e,
|
|
1943
1935
|
panelConstraints: t,
|
|
1944
|
-
pivotIndices:
|
|
1936
|
+
pivotIndices: c,
|
|
1945
1937
|
prevLayout: e
|
|
1946
1938
|
}),
|
|
1947
1939
|
panelConstraints: t
|
|
@@ -1954,7 +1946,7 @@ function _t({
|
|
|
1954
1946
|
valueNow: l
|
|
1955
1947
|
};
|
|
1956
1948
|
}
|
|
1957
|
-
function
|
|
1949
|
+
function Ht({
|
|
1958
1950
|
children: e,
|
|
1959
1951
|
className: t,
|
|
1960
1952
|
disabled: n,
|
|
@@ -1963,15 +1955,15 @@ function Ft({
|
|
|
1963
1955
|
style: s,
|
|
1964
1956
|
...l
|
|
1965
1957
|
}) {
|
|
1966
|
-
const r =
|
|
1958
|
+
const r = ye(i), a = ve({
|
|
1967
1959
|
disabled: n
|
|
1968
|
-
}), [
|
|
1960
|
+
}), [u, c] = ne({}), [g, b] = ne("inactive"), S = O(null), m = Se(S, o), {
|
|
1969
1961
|
disableCursor: d,
|
|
1970
1962
|
id: f,
|
|
1971
|
-
orientation:
|
|
1963
|
+
orientation: h,
|
|
1972
1964
|
registerSeparator: v,
|
|
1973
1965
|
toggleSeparatorDisabled: x
|
|
1974
|
-
} =
|
|
1966
|
+
} = xe(), y = h === "horizontal" ? "vertical" : "horizontal";
|
|
1975
1967
|
K(() => {
|
|
1976
1968
|
const w = S.current;
|
|
1977
1969
|
if (w !== null) {
|
|
@@ -1992,14 +1984,14 @@ function Ft({
|
|
|
1992
1984
|
"mountedGroupsChange",
|
|
1993
1985
|
(z) => {
|
|
1994
1986
|
z.forEach(
|
|
1995
|
-
({ derivedPanelConstraints: L, layout:
|
|
1987
|
+
({ derivedPanelConstraints: L, layout: E, separatorToPanels: M }, D) => {
|
|
1996
1988
|
if (D.id === f) {
|
|
1997
|
-
const T =
|
|
1989
|
+
const T = M.get(C);
|
|
1998
1990
|
if (T) {
|
|
1999
1991
|
const N = T[0], Z = D.panels.indexOf(N);
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
layout:
|
|
1992
|
+
c(
|
|
1993
|
+
$t({
|
|
1994
|
+
layout: E,
|
|
2003
1995
|
panelConstraints: L,
|
|
2004
1996
|
panelId: N.id,
|
|
2005
1997
|
panelIndex: Z
|
|
@@ -2023,18 +2015,18 @@ function Ft({
|
|
|
2023
2015
|
"div",
|
|
2024
2016
|
{
|
|
2025
2017
|
...l,
|
|
2026
|
-
"aria-controls":
|
|
2018
|
+
"aria-controls": u.valueControls,
|
|
2027
2019
|
"aria-disabled": n || void 0,
|
|
2028
2020
|
"aria-orientation": y,
|
|
2029
|
-
"aria-valuemax":
|
|
2030
|
-
"aria-valuemin":
|
|
2031
|
-
"aria-valuenow":
|
|
2021
|
+
"aria-valuemax": u.valueMax,
|
|
2022
|
+
"aria-valuemin": u.valueMin,
|
|
2023
|
+
"aria-valuenow": u.valueNow,
|
|
2032
2024
|
children: e,
|
|
2033
2025
|
className: t,
|
|
2034
2026
|
"data-separator": n ? "disabled" : g,
|
|
2035
2027
|
"data-testid": r,
|
|
2036
2028
|
id: r,
|
|
2037
|
-
ref:
|
|
2029
|
+
ref: m,
|
|
2038
2030
|
role: "separator",
|
|
2039
2031
|
style: {
|
|
2040
2032
|
flexBasis: "auto",
|
|
@@ -2050,16 +2042,16 @@ function Ft({
|
|
|
2050
2042
|
}
|
|
2051
2043
|
);
|
|
2052
2044
|
}
|
|
2053
|
-
|
|
2045
|
+
Ht.displayName = "Separator";
|
|
2054
2046
|
export {
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2047
|
+
Tt as Group,
|
|
2048
|
+
_t as Panel,
|
|
2049
|
+
Ht as Separator,
|
|
2050
|
+
gt as isCoarsePointer,
|
|
2051
|
+
Wt as useDefaultLayout,
|
|
2052
|
+
Ut as useGroupCallbackRef,
|
|
2053
|
+
Bt as useGroupRef,
|
|
2054
|
+
Kt as usePanelCallbackRef,
|
|
2055
|
+
Xt as usePanelRef
|
|
2064
2056
|
};
|
|
2065
2057
|
//# sourceMappingURL=react-resizable-panels.js.map
|