react-resizable-panels 4.0.10 → 4.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as K } from "react/jsx-runtime";
|
|
3
|
-
import { useId as
|
|
3
|
+
import { useId as Ve, useLayoutEffect as Ke, useEffect as Re, useRef as O, useCallback as Xe, createContext as Ye, useImperativeHandle as Ee, useState as k, useMemo as se, useSyncExternalStore as qe, useContext as Ze } from "react";
|
|
4
4
|
function z(e, t = "Assertion error") {
|
|
5
5
|
if (!e)
|
|
6
6
|
throw Error(t);
|
|
@@ -11,20 +11,20 @@ function B({
|
|
|
11
11
|
const { orientation: t, panels: n } = e;
|
|
12
12
|
return n.reduce((o, r) => (o += t === "horizontal" ? r.element.offsetWidth : r.element.offsetHeight, o), 0);
|
|
13
13
|
}
|
|
14
|
-
function
|
|
14
|
+
function ae(e, t) {
|
|
15
15
|
return t.sort(
|
|
16
|
-
e === "horizontal" ?
|
|
16
|
+
e === "horizontal" ? Je : Qe
|
|
17
17
|
);
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function Je(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 Qe(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
|
}
|
|
27
|
-
function
|
|
27
|
+
function Me(e, t) {
|
|
28
28
|
return {
|
|
29
29
|
x: e.x >= t.left && e.x <= t.right ? 0 : Math.min(
|
|
30
30
|
Math.abs(e.x - t.left),
|
|
@@ -36,7 +36,7 @@ function Ge(e, t) {
|
|
|
36
36
|
)
|
|
37
37
|
};
|
|
38
38
|
}
|
|
39
|
-
function
|
|
39
|
+
function et({
|
|
40
40
|
orientation: e,
|
|
41
41
|
rects: t,
|
|
42
42
|
targetRect: n
|
|
@@ -47,13 +47,13 @@ function tt({
|
|
|
47
47
|
};
|
|
48
48
|
let r, a = Number.MAX_VALUE;
|
|
49
49
|
for (const l of t) {
|
|
50
|
-
const { x: i, y: s } =
|
|
50
|
+
const { x: i, y: s } = Me(o, l), u = e === "horizontal" ? i : s;
|
|
51
51
|
u < a && (a = u, r = l);
|
|
52
52
|
}
|
|
53
53
|
return z(r, "No rect found"), r;
|
|
54
54
|
}
|
|
55
55
|
function ke(e) {
|
|
56
|
-
const { element: t, orientation: n, panels: o, separators: r } = e, a =
|
|
56
|
+
const { element: t, orientation: n, panels: o, separators: r } = e, a = ae(
|
|
57
57
|
n,
|
|
58
58
|
Array.from(t.children).filter((c) => c instanceof HTMLElement).map((c) => ({ element: c }))
|
|
59
59
|
).map(({ element: c }) => c), l = [];
|
|
@@ -83,14 +83,14 @@ function ke(e) {
|
|
|
83
83
|
break;
|
|
84
84
|
}
|
|
85
85
|
case 1: {
|
|
86
|
-
const
|
|
86
|
+
const v = u[0], S = et({
|
|
87
87
|
orientation: n,
|
|
88
88
|
rects: [m, p],
|
|
89
|
-
targetRect:
|
|
89
|
+
targetRect: v.element.getBoundingClientRect()
|
|
90
90
|
});
|
|
91
91
|
f = [
|
|
92
|
-
|
|
93
|
-
|
|
92
|
+
v,
|
|
93
|
+
S === m ? y : d
|
|
94
94
|
];
|
|
95
95
|
break;
|
|
96
96
|
}
|
|
@@ -133,21 +133,21 @@ function ke(e) {
|
|
|
133
133
|
i = !0;
|
|
134
134
|
return l;
|
|
135
135
|
}
|
|
136
|
-
function
|
|
136
|
+
function tt(e, t) {
|
|
137
137
|
const n = getComputedStyle(e), o = parseFloat(n.fontSize);
|
|
138
138
|
return t * o;
|
|
139
139
|
}
|
|
140
|
-
function
|
|
140
|
+
function nt(e, t) {
|
|
141
141
|
const n = getComputedStyle(e.ownerDocument.body), o = parseFloat(n.fontSize);
|
|
142
142
|
return t * o;
|
|
143
143
|
}
|
|
144
|
-
function
|
|
144
|
+
function ot(e) {
|
|
145
145
|
return e / 100 * window.innerHeight;
|
|
146
146
|
}
|
|
147
|
-
function
|
|
147
|
+
function it(e) {
|
|
148
148
|
return e / 100 * window.innerWidth;
|
|
149
149
|
}
|
|
150
|
-
function
|
|
150
|
+
function rt(e) {
|
|
151
151
|
switch (typeof e) {
|
|
152
152
|
case "number":
|
|
153
153
|
return [e, "px"];
|
|
@@ -163,7 +163,7 @@ function te({
|
|
|
163
163
|
styleProp: n
|
|
164
164
|
}) {
|
|
165
165
|
let o;
|
|
166
|
-
const [r, a] =
|
|
166
|
+
const [r, a] = rt(n);
|
|
167
167
|
switch (a) {
|
|
168
168
|
case "%": {
|
|
169
169
|
o = r / 100 * e;
|
|
@@ -174,25 +174,25 @@ function te({
|
|
|
174
174
|
break;
|
|
175
175
|
}
|
|
176
176
|
case "rem": {
|
|
177
|
-
o =
|
|
177
|
+
o = nt(t, r);
|
|
178
178
|
break;
|
|
179
179
|
}
|
|
180
180
|
case "em": {
|
|
181
|
-
o =
|
|
181
|
+
o = tt(t, r);
|
|
182
182
|
break;
|
|
183
183
|
}
|
|
184
184
|
case "vh": {
|
|
185
|
-
o =
|
|
185
|
+
o = ot(r);
|
|
186
186
|
break;
|
|
187
187
|
}
|
|
188
188
|
case "vw": {
|
|
189
|
-
o =
|
|
189
|
+
o = it(r);
|
|
190
190
|
break;
|
|
191
191
|
}
|
|
192
192
|
}
|
|
193
193
|
return o;
|
|
194
194
|
}
|
|
195
|
-
function
|
|
195
|
+
function I(e) {
|
|
196
196
|
return parseFloat(e.toFixed(3));
|
|
197
197
|
}
|
|
198
198
|
function ye(e) {
|
|
@@ -213,7 +213,7 @@ function ye(e) {
|
|
|
213
213
|
panelElement: r,
|
|
214
214
|
styleProp: a.collapsedSize
|
|
215
215
|
});
|
|
216
|
-
l =
|
|
216
|
+
l = I(c / n * 100);
|
|
217
217
|
}
|
|
218
218
|
let i;
|
|
219
219
|
if (a.defaultSize) {
|
|
@@ -222,7 +222,7 @@ function ye(e) {
|
|
|
222
222
|
panelElement: r,
|
|
223
223
|
styleProp: a.defaultSize
|
|
224
224
|
});
|
|
225
|
-
i =
|
|
225
|
+
i = I(c / n * 100);
|
|
226
226
|
}
|
|
227
227
|
let s = 0;
|
|
228
228
|
if (a.minSize) {
|
|
@@ -231,7 +231,7 @@ function ye(e) {
|
|
|
231
231
|
panelElement: r,
|
|
232
232
|
styleProp: a.minSize
|
|
233
233
|
});
|
|
234
|
-
s =
|
|
234
|
+
s = I(c / n * 100);
|
|
235
235
|
}
|
|
236
236
|
let u = 100;
|
|
237
237
|
if (a.maxSize) {
|
|
@@ -240,7 +240,7 @@ function ye(e) {
|
|
|
240
240
|
panelElement: r,
|
|
241
241
|
styleProp: a.maxSize
|
|
242
242
|
});
|
|
243
|
-
u =
|
|
243
|
+
u = I(c / n * 100);
|
|
244
244
|
}
|
|
245
245
|
return {
|
|
246
246
|
collapsedSize: l,
|
|
@@ -252,7 +252,7 @@ function ye(e) {
|
|
|
252
252
|
};
|
|
253
253
|
});
|
|
254
254
|
}
|
|
255
|
-
class
|
|
255
|
+
class st {
|
|
256
256
|
#e = {};
|
|
257
257
|
addListener(t, n) {
|
|
258
258
|
const o = this.#e[t];
|
|
@@ -292,28 +292,28 @@ class at {
|
|
|
292
292
|
}
|
|
293
293
|
}
|
|
294
294
|
function P(e, t, n = 0) {
|
|
295
|
-
return Math.abs(
|
|
295
|
+
return Math.abs(I(e) - I(t)) <= n;
|
|
296
296
|
}
|
|
297
|
-
let
|
|
297
|
+
let R = {
|
|
298
298
|
cursorFlags: 0,
|
|
299
299
|
interactionState: {
|
|
300
300
|
state: "inactive"
|
|
301
301
|
},
|
|
302
302
|
mountedGroups: /* @__PURE__ */ new Map()
|
|
303
303
|
};
|
|
304
|
-
const _ = new
|
|
304
|
+
const _ = new st();
|
|
305
305
|
function D() {
|
|
306
|
-
return
|
|
306
|
+
return R;
|
|
307
307
|
}
|
|
308
308
|
function E(e) {
|
|
309
|
-
const t = typeof e == "function" ? e(
|
|
310
|
-
if (
|
|
311
|
-
return
|
|
312
|
-
const n =
|
|
313
|
-
return
|
|
314
|
-
...
|
|
309
|
+
const t = typeof e == "function" ? e(R) : e;
|
|
310
|
+
if (R === t)
|
|
311
|
+
return R;
|
|
312
|
+
const n = R;
|
|
313
|
+
return R = {
|
|
314
|
+
...R,
|
|
315
315
|
...t
|
|
316
|
-
}, t.cursorFlags !== void 0 && _.emit("cursorFlagsChange",
|
|
316
|
+
}, t.cursorFlags !== void 0 && _.emit("cursorFlagsChange", R.cursorFlags), t.interactionState !== void 0 && _.emit("interactionStateChange", R.interactionState), t.mountedGroups !== void 0 && (R.mountedGroups.forEach((o, r) => {
|
|
317
317
|
o.derivedPanelConstraints.forEach((a) => {
|
|
318
318
|
if (a.collapsible) {
|
|
319
319
|
const { layout: l } = n.mountedGroups.get(r) ?? {};
|
|
@@ -329,14 +329,14 @@ function E(e) {
|
|
|
329
329
|
}
|
|
330
330
|
}
|
|
331
331
|
});
|
|
332
|
-
}), _.emit("mountedGroupsChange",
|
|
332
|
+
}), _.emit("mountedGroupsChange", R.mountedGroups)), R;
|
|
333
333
|
}
|
|
334
|
-
const
|
|
335
|
-
},
|
|
334
|
+
const at = (e) => e, ie = () => {
|
|
335
|
+
}, Ie = 1, Ge = 2, De = 4, Oe = 8, ge = {
|
|
336
336
|
coarse: 10,
|
|
337
337
|
precise: 5
|
|
338
338
|
};
|
|
339
|
-
function
|
|
339
|
+
function lt({
|
|
340
340
|
cursorFlags: e,
|
|
341
341
|
groups: t,
|
|
342
342
|
state: n
|
|
@@ -363,7 +363,7 @@ function ut({
|
|
|
363
363
|
return null;
|
|
364
364
|
switch (n) {
|
|
365
365
|
case "active": {
|
|
366
|
-
const a = (e &
|
|
366
|
+
const a = (e & Ie) !== 0, l = (e & Ge) !== 0, i = (e & De) !== 0, s = (e & Oe) !== 0;
|
|
367
367
|
if (e) {
|
|
368
368
|
if (a)
|
|
369
369
|
return i ? "se-resize" : s ? "ne-resize" : "e-resize";
|
|
@@ -379,30 +379,30 @@ function ut({
|
|
|
379
379
|
}
|
|
380
380
|
return o > 0 && r > 0 ? "move" : o > 0 ? "ew-resize" : "ns-resize";
|
|
381
381
|
}
|
|
382
|
-
let re,
|
|
382
|
+
let re, G;
|
|
383
383
|
function le() {
|
|
384
|
-
|
|
384
|
+
G === void 0 && (G = new CSSStyleSheet(), document.adoptedStyleSheets = [G]);
|
|
385
385
|
const { cursorFlags: e, interactionState: t } = D();
|
|
386
386
|
switch (t.state) {
|
|
387
387
|
case "active":
|
|
388
388
|
case "hover": {
|
|
389
|
-
const n =
|
|
389
|
+
const n = lt({
|
|
390
390
|
cursorFlags: e,
|
|
391
391
|
groups: t.hitRegions.map((r) => r.group),
|
|
392
392
|
state: t.state
|
|
393
393
|
}), o = `*{cursor: ${n} !important; ${t.state === "active" ? "touch-action: none;" : ""} }`;
|
|
394
394
|
if (re === o)
|
|
395
395
|
return;
|
|
396
|
-
re = o, n ?
|
|
396
|
+
re = o, n ? G.cssRules.length === 0 ? G.insertRule(o) : G.replaceSync(o) : G.cssRules.length === 1 && G.deleteRule(0);
|
|
397
397
|
break;
|
|
398
398
|
}
|
|
399
399
|
case "inactive": {
|
|
400
|
-
re = void 0,
|
|
400
|
+
re = void 0, G.cssRules.length === 1 && G.deleteRule(0);
|
|
401
401
|
break;
|
|
402
402
|
}
|
|
403
403
|
}
|
|
404
404
|
}
|
|
405
|
-
function
|
|
405
|
+
function ut(e, t) {
|
|
406
406
|
if (e.length !== t.length)
|
|
407
407
|
return !1;
|
|
408
408
|
for (let n = 0; n < e.length; n++)
|
|
@@ -413,7 +413,7 @@ function ct(e, t) {
|
|
|
413
413
|
function X(e, t) {
|
|
414
414
|
return P(e, t) ? 0 : e > t ? 1 : -1;
|
|
415
415
|
}
|
|
416
|
-
function
|
|
416
|
+
function W({
|
|
417
417
|
panelConstraints: e,
|
|
418
418
|
size: t
|
|
419
419
|
}) {
|
|
@@ -429,7 +429,7 @@ function j({
|
|
|
429
429
|
X(t, l) < 0 ? t = n : t = a;
|
|
430
430
|
} else
|
|
431
431
|
t = a;
|
|
432
|
-
return t = Math.min(r, t), t =
|
|
432
|
+
return t = Math.min(r, t), t = I(t), t;
|
|
433
433
|
}
|
|
434
434
|
function Y({
|
|
435
435
|
delta: e,
|
|
@@ -453,17 +453,17 @@ function Y({
|
|
|
453
453
|
);
|
|
454
454
|
const {
|
|
455
455
|
collapsedSize: y = 0,
|
|
456
|
-
collapsible:
|
|
457
|
-
minSize:
|
|
456
|
+
collapsible: v,
|
|
457
|
+
minSize: S = 0
|
|
458
458
|
} = d;
|
|
459
|
-
if (
|
|
459
|
+
if (v) {
|
|
460
460
|
const x = l[f];
|
|
461
461
|
if (z(
|
|
462
462
|
x != null,
|
|
463
463
|
`Previous layout not found for panel index ${f}`
|
|
464
464
|
), P(x, y)) {
|
|
465
|
-
const
|
|
466
|
-
X(
|
|
465
|
+
const g = S - x;
|
|
466
|
+
X(g, Math.abs(e)) > 0 && (e = e < 0 ? 0 - g : g);
|
|
467
467
|
}
|
|
468
468
|
}
|
|
469
469
|
}
|
|
@@ -475,17 +475,17 @@ function Y({
|
|
|
475
475
|
);
|
|
476
476
|
const {
|
|
477
477
|
collapsedSize: y = 0,
|
|
478
|
-
collapsible:
|
|
479
|
-
minSize:
|
|
478
|
+
collapsible: v,
|
|
479
|
+
minSize: S = 0
|
|
480
480
|
} = d;
|
|
481
|
-
if (
|
|
481
|
+
if (v) {
|
|
482
482
|
const x = l[f];
|
|
483
483
|
if (z(
|
|
484
484
|
x != null,
|
|
485
485
|
`Previous layout not found for panel index ${f}`
|
|
486
|
-
), P(x,
|
|
487
|
-
const
|
|
488
|
-
X(
|
|
486
|
+
), P(x, S)) {
|
|
487
|
+
const g = x - y;
|
|
488
|
+
X(g, Math.abs(e)) > 0 && (e = e < 0 ? 0 - g : g);
|
|
489
489
|
}
|
|
490
490
|
}
|
|
491
491
|
}
|
|
@@ -494,41 +494,41 @@ function Y({
|
|
|
494
494
|
const f = e < 0 ? 1 : -1;
|
|
495
495
|
let d = e < 0 ? c : u, y = 0;
|
|
496
496
|
for (; ; ) {
|
|
497
|
-
const
|
|
497
|
+
const S = l[d];
|
|
498
498
|
z(
|
|
499
|
-
|
|
499
|
+
S != null,
|
|
500
500
|
`Previous layout not found for panel index ${d}`
|
|
501
501
|
);
|
|
502
|
-
const
|
|
502
|
+
const g = W({
|
|
503
503
|
panelConstraints: n[d],
|
|
504
504
|
size: 100
|
|
505
|
-
}) -
|
|
506
|
-
if (y +=
|
|
505
|
+
}) - S;
|
|
506
|
+
if (y += g, d += f, d < 0 || d >= n.length)
|
|
507
507
|
break;
|
|
508
508
|
}
|
|
509
|
-
const
|
|
510
|
-
e = e < 0 ? 0 -
|
|
509
|
+
const v = Math.min(Math.abs(e), Math.abs(y));
|
|
510
|
+
e = e < 0 ? 0 - v : v;
|
|
511
511
|
}
|
|
512
512
|
{
|
|
513
513
|
let d = e < 0 ? u : c;
|
|
514
514
|
for (; d >= 0 && d < n.length; ) {
|
|
515
|
-
const y = Math.abs(e) - Math.abs(h),
|
|
515
|
+
const y = Math.abs(e) - Math.abs(h), v = l[d];
|
|
516
516
|
z(
|
|
517
|
-
|
|
517
|
+
v != null,
|
|
518
518
|
`Previous layout not found for panel index ${d}`
|
|
519
519
|
);
|
|
520
|
-
const
|
|
520
|
+
const S = v - y, x = W({
|
|
521
521
|
panelConstraints: n[d],
|
|
522
|
-
size:
|
|
522
|
+
size: S
|
|
523
523
|
});
|
|
524
|
-
if (!P(
|
|
524
|
+
if (!P(v, x) && (h += v - x, s[d] = x, h.toFixed(3).localeCompare(Math.abs(e).toFixed(3), void 0, {
|
|
525
525
|
numeric: !0
|
|
526
526
|
}) >= 0))
|
|
527
527
|
break;
|
|
528
528
|
e < 0 ? d-- : d++;
|
|
529
529
|
}
|
|
530
530
|
}
|
|
531
|
-
if (
|
|
531
|
+
if (ut(i, s))
|
|
532
532
|
return r;
|
|
533
533
|
{
|
|
534
534
|
const f = e < 0 ? c : u, d = l[f];
|
|
@@ -536,25 +536,25 @@ function Y({
|
|
|
536
536
|
d != null,
|
|
537
537
|
`Previous layout not found for panel index ${f}`
|
|
538
538
|
);
|
|
539
|
-
const y = d + h,
|
|
539
|
+
const y = d + h, v = W({
|
|
540
540
|
panelConstraints: n[f],
|
|
541
541
|
size: y
|
|
542
542
|
});
|
|
543
|
-
if (s[f] =
|
|
544
|
-
let
|
|
545
|
-
for (;
|
|
546
|
-
const b = s[
|
|
543
|
+
if (s[f] = v, !P(v, y)) {
|
|
544
|
+
let S = y - v, g = e < 0 ? c : u;
|
|
545
|
+
for (; g >= 0 && g < n.length; ) {
|
|
546
|
+
const b = s[g];
|
|
547
547
|
z(
|
|
548
548
|
b != null,
|
|
549
|
-
`Previous layout not found for panel index ${
|
|
549
|
+
`Previous layout not found for panel index ${g}`
|
|
550
550
|
);
|
|
551
|
-
const L = b +
|
|
552
|
-
panelConstraints: n[
|
|
551
|
+
const L = b + S, C = W({
|
|
552
|
+
panelConstraints: n[g],
|
|
553
553
|
size: L
|
|
554
554
|
});
|
|
555
|
-
if (P(b,
|
|
555
|
+
if (P(b, C) || (S -= C - b, s[g] = C), P(S, 0))
|
|
556
556
|
break;
|
|
557
|
-
e > 0 ?
|
|
557
|
+
e > 0 ? g-- : g++;
|
|
558
558
|
}
|
|
559
559
|
}
|
|
560
560
|
}
|
|
@@ -575,7 +575,7 @@ function U(e, t) {
|
|
|
575
575
|
return !1;
|
|
576
576
|
return !0;
|
|
577
577
|
}
|
|
578
|
-
function
|
|
578
|
+
function Te({
|
|
579
579
|
event: e,
|
|
580
580
|
hitRegions: t,
|
|
581
581
|
initialLayoutMap: n,
|
|
@@ -591,27 +591,27 @@ function Ae({
|
|
|
591
591
|
const f = n.get(s), {
|
|
592
592
|
defaultLayoutDeferred: d,
|
|
593
593
|
derivedPanelConstraints: y,
|
|
594
|
-
layout:
|
|
595
|
-
separatorToPanels:
|
|
594
|
+
layout: v,
|
|
595
|
+
separatorToPanels: S
|
|
596
596
|
} = o.get(s) ?? { defaultLayoutDeferred: !1 };
|
|
597
|
-
if (y && f &&
|
|
597
|
+
if (y && f && v && S) {
|
|
598
598
|
const x = Y({
|
|
599
599
|
delta: p,
|
|
600
600
|
initialLayout: f,
|
|
601
601
|
panelConstraints: y,
|
|
602
|
-
pivotIndices: i.panels.map((
|
|
603
|
-
prevLayout:
|
|
602
|
+
pivotIndices: i.panels.map((g) => m.indexOf(g)),
|
|
603
|
+
prevLayout: v,
|
|
604
604
|
trigger: "mouse-or-touch"
|
|
605
605
|
});
|
|
606
|
-
if (U(x,
|
|
606
|
+
if (U(x, v)) {
|
|
607
607
|
if (p !== 0 && !c)
|
|
608
608
|
switch (h) {
|
|
609
609
|
case "horizontal": {
|
|
610
|
-
a |= p < 0 ?
|
|
610
|
+
a |= p < 0 ? Ie : Ge;
|
|
611
611
|
break;
|
|
612
612
|
}
|
|
613
613
|
case "vertical": {
|
|
614
|
-
a |= p < 0 ?
|
|
614
|
+
a |= p < 0 ? De : Oe;
|
|
615
615
|
break;
|
|
616
616
|
}
|
|
617
617
|
}
|
|
@@ -620,10 +620,10 @@ function Ae({
|
|
|
620
620
|
defaultLayoutDeferred: d,
|
|
621
621
|
derivedPanelConstraints: y,
|
|
622
622
|
layout: x,
|
|
623
|
-
separatorToPanels:
|
|
623
|
+
separatorToPanels: S
|
|
624
624
|
});
|
|
625
|
-
const
|
|
626
|
-
i.group.inMemoryLayouts[
|
|
625
|
+
const g = i.group.panels.map(({ id: b }) => b).join(",");
|
|
626
|
+
i.group.inMemoryLayouts[g] = x;
|
|
627
627
|
}
|
|
628
628
|
}
|
|
629
629
|
}), E({
|
|
@@ -642,7 +642,7 @@ function ve(e) {
|
|
|
642
642
|
switch (t.state) {
|
|
643
643
|
case "active":
|
|
644
644
|
t.hitRegions.forEach((o) => {
|
|
645
|
-
e.currentTarget === o.group.element &&
|
|
645
|
+
e.currentTarget === o.group.element && Te({
|
|
646
646
|
event: e,
|
|
647
647
|
hitRegions: t.hitRegions,
|
|
648
648
|
initialLayoutMap: t.initialLayoutMap,
|
|
@@ -683,7 +683,7 @@ function A({
|
|
|
683
683
|
for (let i = 0; i < t.length; i++) {
|
|
684
684
|
const s = o[i];
|
|
685
685
|
z(s != null, `No layout data found for index ${i}`);
|
|
686
|
-
const u =
|
|
686
|
+
const u = W({
|
|
687
687
|
panelConstraints: t[i],
|
|
688
688
|
size: s
|
|
689
689
|
});
|
|
@@ -693,7 +693,7 @@ function A({
|
|
|
693
693
|
for (let i = 0; i < t.length; i++) {
|
|
694
694
|
const s = o[i];
|
|
695
695
|
z(s != null, `No layout data found for index ${i}`);
|
|
696
|
-
const u = s + a, c =
|
|
696
|
+
const u = s + a, c = W({
|
|
697
697
|
panelConstraints: t[i],
|
|
698
698
|
size: u
|
|
699
699
|
});
|
|
@@ -703,7 +703,7 @@ function A({
|
|
|
703
703
|
const l = Object.keys(e);
|
|
704
704
|
return o.reduce((i, s, u) => (i[l[u]] = s, i), {});
|
|
705
705
|
}
|
|
706
|
-
function
|
|
706
|
+
function _e({
|
|
707
707
|
groupId: e
|
|
708
708
|
}) {
|
|
709
709
|
const t = () => {
|
|
@@ -740,18 +740,18 @@ function Ne({
|
|
|
740
740
|
}
|
|
741
741
|
};
|
|
742
742
|
}
|
|
743
|
-
function
|
|
743
|
+
function Ae(e) {
|
|
744
744
|
const { mountedGroups: t } = D(), n = t.get(e);
|
|
745
745
|
return z(n, `Mounted Group ${e.id} not found`), n;
|
|
746
746
|
}
|
|
747
747
|
function T(e, t) {
|
|
748
|
-
const n = oe(e), o =
|
|
748
|
+
const n = oe(e), o = Ae(n), r = n.separators.find(
|
|
749
749
|
(h) => h.element === e
|
|
750
750
|
);
|
|
751
751
|
z(r, "Matching separator not found");
|
|
752
752
|
const a = o.separatorToPanels.get(r);
|
|
753
753
|
z(a, "Matching panels not found");
|
|
754
|
-
const l = a.map((h) => n.panels.indexOf(h)), s =
|
|
754
|
+
const l = a.map((h) => n.panels.indexOf(h)), s = _e({ groupId: n.id }).getLayout(), u = Y({
|
|
755
755
|
delta: t,
|
|
756
756
|
initialLayout: s,
|
|
757
757
|
panelConstraints: o.derivedPanelConstraints,
|
|
@@ -799,7 +799,7 @@ function Se(e) {
|
|
|
799
799
|
}
|
|
800
800
|
case "Enter": {
|
|
801
801
|
e.preventDefault();
|
|
802
|
-
const o = oe(t), { derivedPanelConstraints: r, layout: a, separatorToPanels: l } =
|
|
802
|
+
const o = oe(t), { derivedPanelConstraints: r, layout: a, separatorToPanels: l } = Ae(o), i = o.separators.find(
|
|
803
803
|
(h) => h.element === t
|
|
804
804
|
);
|
|
805
805
|
z(i, "Matching separator not found");
|
|
@@ -832,13 +832,13 @@ function Se(e) {
|
|
|
832
832
|
}
|
|
833
833
|
}
|
|
834
834
|
}
|
|
835
|
-
function
|
|
835
|
+
function ct(e, t, n) {
|
|
836
836
|
let o, r = {
|
|
837
837
|
x: 1 / 0,
|
|
838
838
|
y: 1 / 0
|
|
839
839
|
};
|
|
840
840
|
for (const a of t) {
|
|
841
|
-
const l =
|
|
841
|
+
const l = Me(n, a.rect);
|
|
842
842
|
switch (e) {
|
|
843
843
|
case "horizontal": {
|
|
844
844
|
l.x <= r.x && (o = a, r = l);
|
|
@@ -856,10 +856,10 @@ function ft(e, t, n) {
|
|
|
856
856
|
} : void 0;
|
|
857
857
|
}
|
|
858
858
|
let ne;
|
|
859
|
-
function
|
|
859
|
+
function ft() {
|
|
860
860
|
return ne === void 0 && (typeof matchMedia == "function" ? ne = !!matchMedia("(pointer:coarse)").matches : ne = !1), ne;
|
|
861
861
|
}
|
|
862
|
-
function
|
|
862
|
+
function dt(e, t) {
|
|
863
863
|
if (e === t) throw new Error("Cannot compare node with itself");
|
|
864
864
|
const n = {
|
|
865
865
|
a: we(e),
|
|
@@ -890,20 +890,20 @@ function pt(e, t) {
|
|
|
890
890
|
}
|
|
891
891
|
return Math.sign(r.a - r.b);
|
|
892
892
|
}
|
|
893
|
-
const
|
|
894
|
-
function
|
|
895
|
-
const t = getComputedStyle(
|
|
893
|
+
const pt = /\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;
|
|
894
|
+
function ht(e) {
|
|
895
|
+
const t = getComputedStyle(Ne(e) ?? e).display;
|
|
896
896
|
return t === "flex" || t === "inline-flex";
|
|
897
897
|
}
|
|
898
|
-
function
|
|
898
|
+
function mt(e) {
|
|
899
899
|
const t = getComputedStyle(e);
|
|
900
|
-
return !!(t.position === "fixed" || t.zIndex !== "auto" && (t.position !== "static" ||
|
|
900
|
+
return !!(t.position === "fixed" || t.zIndex !== "auto" && (t.position !== "static" || ht(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" || pt.test(t.willChange) || t.webkitOverflowScrolling === "touch");
|
|
901
901
|
}
|
|
902
902
|
function xe(e) {
|
|
903
903
|
let t = e.length;
|
|
904
904
|
for (; t--; ) {
|
|
905
905
|
const n = e[t];
|
|
906
|
-
if (z(n, "Missing node"),
|
|
906
|
+
if (z(n, "Missing node"), mt(n)) return n;
|
|
907
907
|
}
|
|
908
908
|
return null;
|
|
909
909
|
}
|
|
@@ -913,45 +913,45 @@ function ze(e) {
|
|
|
913
913
|
function we(e) {
|
|
914
914
|
const t = [];
|
|
915
915
|
for (; e; )
|
|
916
|
-
t.push(e), e =
|
|
916
|
+
t.push(e), e = Ne(e);
|
|
917
917
|
return t;
|
|
918
918
|
}
|
|
919
|
-
function
|
|
919
|
+
function Ne(e) {
|
|
920
920
|
const { parentNode: t } = e;
|
|
921
921
|
return t && t instanceof ShadowRoot ? t.host : t;
|
|
922
922
|
}
|
|
923
|
-
function
|
|
923
|
+
function yt(e, t) {
|
|
924
924
|
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;
|
|
925
925
|
}
|
|
926
|
-
function
|
|
926
|
+
function gt({
|
|
927
927
|
groupElement: e,
|
|
928
928
|
hitRegion: t,
|
|
929
929
|
pointerEventTarget: n
|
|
930
930
|
}) {
|
|
931
931
|
if (!(n instanceof HTMLElement) || n.contains(e) || e.contains(n))
|
|
932
932
|
return !0;
|
|
933
|
-
if (
|
|
933
|
+
if (dt(n, e) > 0) {
|
|
934
934
|
let o = n;
|
|
935
935
|
for (; o; ) {
|
|
936
936
|
if (o.contains(e))
|
|
937
937
|
return !0;
|
|
938
|
-
if (
|
|
938
|
+
if (yt(o.getBoundingClientRect(), t))
|
|
939
939
|
return !1;
|
|
940
940
|
o = o.parentElement;
|
|
941
941
|
}
|
|
942
942
|
}
|
|
943
943
|
return !0;
|
|
944
944
|
}
|
|
945
|
-
function
|
|
945
|
+
function $e(e, t) {
|
|
946
946
|
const n = [];
|
|
947
947
|
return t.forEach((o, r) => {
|
|
948
948
|
if (r.disabled)
|
|
949
949
|
return;
|
|
950
|
-
const a =
|
|
950
|
+
const a = ft() ? ge.coarse : ge.precise, l = ke(r), i = ct(r.orientation, l, {
|
|
951
951
|
x: e.clientX,
|
|
952
952
|
y: e.clientY
|
|
953
953
|
});
|
|
954
|
-
i && i.distance.x <= a && i.distance.y <= a &&
|
|
954
|
+
i && i.distance.x <= a && i.distance.y <= a && gt({
|
|
955
955
|
groupElement: r.element,
|
|
956
956
|
hitRegion: i.hitRegion.rect,
|
|
957
957
|
pointerEventTarget: e.target
|
|
@@ -961,7 +961,7 @@ function He(e, t) {
|
|
|
961
961
|
function be(e) {
|
|
962
962
|
if (e.defaultPrevented)
|
|
963
963
|
return;
|
|
964
|
-
const { mountedGroups: t } = D(), n =
|
|
964
|
+
const { mountedGroups: t } = D(), n = $e(e, t), o = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set(), l = /* @__PURE__ */ new Map();
|
|
965
965
|
let i = !1;
|
|
966
966
|
n.forEach((s) => {
|
|
967
967
|
o.add(s.group), s.panels.forEach((c) => {
|
|
@@ -998,7 +998,7 @@ function Le(e) {
|
|
|
998
998
|
);
|
|
999
999
|
return;
|
|
1000
1000
|
}
|
|
1001
|
-
|
|
1001
|
+
Te({
|
|
1002
1002
|
event: e,
|
|
1003
1003
|
hitRegions: t.hitRegions,
|
|
1004
1004
|
initialLayoutMap: t.initialLayoutMap,
|
|
@@ -1008,7 +1008,7 @@ function Le(e) {
|
|
|
1008
1008
|
break;
|
|
1009
1009
|
}
|
|
1010
1010
|
default: {
|
|
1011
|
-
const o =
|
|
1011
|
+
const o = $e(e, n);
|
|
1012
1012
|
o.length === 0 ? t.state !== "inactive" && E({
|
|
1013
1013
|
interactionState: { state: "inactive" }
|
|
1014
1014
|
}) : E({
|
|
@@ -1036,25 +1036,25 @@ function Pe(e) {
|
|
|
1036
1036
|
}), le();
|
|
1037
1037
|
}
|
|
1038
1038
|
}
|
|
1039
|
-
function
|
|
1039
|
+
function Ce(e) {
|
|
1040
1040
|
let t = 0, n = 0;
|
|
1041
1041
|
const o = {};
|
|
1042
1042
|
for (const a of e)
|
|
1043
1043
|
if (a.defaultSize !== void 0) {
|
|
1044
1044
|
t++;
|
|
1045
|
-
const l =
|
|
1045
|
+
const l = I(a.defaultSize);
|
|
1046
1046
|
n += l, o[a.panelId] = l;
|
|
1047
1047
|
} else
|
|
1048
1048
|
o[a.panelId] = void 0;
|
|
1049
1049
|
const r = e.length - t;
|
|
1050
1050
|
if (r !== 0) {
|
|
1051
|
-
const a =
|
|
1051
|
+
const a = I((100 - n) / r);
|
|
1052
1052
|
for (const l of e)
|
|
1053
1053
|
l.defaultSize === void 0 && (o[l.panelId] = a);
|
|
1054
1054
|
}
|
|
1055
1055
|
return o;
|
|
1056
1056
|
}
|
|
1057
|
-
function
|
|
1057
|
+
function vt(e, t, n) {
|
|
1058
1058
|
const o = n[0];
|
|
1059
1059
|
if (!o)
|
|
1060
1060
|
return;
|
|
@@ -1064,7 +1064,7 @@ function St(e, t, n) {
|
|
|
1064
1064
|
const a = B({ group: e });
|
|
1065
1065
|
r.onResize(
|
|
1066
1066
|
{
|
|
1067
|
-
asPercentage:
|
|
1067
|
+
asPercentage: I(
|
|
1068
1068
|
o.inlineSize / a * 100
|
|
1069
1069
|
),
|
|
1070
1070
|
inPixels: o.inlineSize
|
|
@@ -1072,6 +1072,14 @@ function St(e, t, n) {
|
|
|
1072
1072
|
r.id
|
|
1073
1073
|
);
|
|
1074
1074
|
}
|
|
1075
|
+
function St(e, t) {
|
|
1076
|
+
if (Object.keys(e).length !== Object.keys(t).length)
|
|
1077
|
+
return !1;
|
|
1078
|
+
for (const o in e)
|
|
1079
|
+
if (e[o] !== t[o])
|
|
1080
|
+
return !1;
|
|
1081
|
+
return !0;
|
|
1082
|
+
}
|
|
1075
1083
|
function xt(e) {
|
|
1076
1084
|
let t = !0;
|
|
1077
1085
|
const n = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Set(), r = new ResizeObserver((p) => {
|
|
@@ -1081,27 +1089,30 @@ function xt(e) {
|
|
|
1081
1089
|
if (t) {
|
|
1082
1090
|
if (B({ group: e }) === 0)
|
|
1083
1091
|
return;
|
|
1084
|
-
E((
|
|
1085
|
-
const x =
|
|
1092
|
+
E((S) => {
|
|
1093
|
+
const x = S.mountedGroups.get(e);
|
|
1086
1094
|
if (x) {
|
|
1087
|
-
const
|
|
1095
|
+
const g = ye(e), b = x.defaultLayoutDeferred ? Ce(g) : x.layout, L = A({
|
|
1088
1096
|
layout: b,
|
|
1089
|
-
panelConstraints:
|
|
1097
|
+
panelConstraints: g
|
|
1090
1098
|
});
|
|
1091
|
-
return !x.defaultLayoutDeferred && U(b, L)
|
|
1092
|
-
|
|
1099
|
+
return !x.defaultLayoutDeferred && U(b, L) && St(
|
|
1100
|
+
x.derivedPanelConstraints,
|
|
1101
|
+
g
|
|
1102
|
+
) ? S : {
|
|
1103
|
+
mountedGroups: new Map(S.mountedGroups).set(e, {
|
|
1093
1104
|
defaultLayoutDeferred: !1,
|
|
1094
|
-
derivedPanelConstraints:
|
|
1105
|
+
derivedPanelConstraints: g,
|
|
1095
1106
|
layout: L,
|
|
1096
1107
|
separatorToPanels: x.separatorToPanels
|
|
1097
1108
|
})
|
|
1098
1109
|
};
|
|
1099
1110
|
}
|
|
1100
|
-
return
|
|
1111
|
+
return S;
|
|
1101
1112
|
});
|
|
1102
1113
|
}
|
|
1103
1114
|
} else
|
|
1104
|
-
|
|
1115
|
+
vt(e, y, d);
|
|
1105
1116
|
}
|
|
1106
1117
|
});
|
|
1107
1118
|
r.observe(e.element), e.panels.forEach((p) => {
|
|
@@ -1113,7 +1124,7 @@ function xt(e) {
|
|
|
1113
1124
|
const a = B({ group: e }), l = ye(e), i = e.panels.map(({ id: p }) => p).join(",");
|
|
1114
1125
|
let s = e.defaultLayout;
|
|
1115
1126
|
s && e.panels.length !== Object.keys(s).length && (s = void 0);
|
|
1116
|
-
const u = e.inMemoryLayouts[i] ?? s ??
|
|
1127
|
+
const u = e.inMemoryLayouts[i] ?? s ?? Ce(l), c = A({
|
|
1117
1128
|
layout: u,
|
|
1118
1129
|
panelConstraints: l
|
|
1119
1130
|
}), h = ke(e), m = E((p) => {
|
|
@@ -1146,15 +1157,15 @@ function xt(e) {
|
|
|
1146
1157
|
};
|
|
1147
1158
|
}
|
|
1148
1159
|
function ue(e) {
|
|
1149
|
-
const t =
|
|
1160
|
+
const t = Ve();
|
|
1150
1161
|
return `${e ?? t}`;
|
|
1151
1162
|
}
|
|
1152
|
-
const N = typeof window < "u" ?
|
|
1163
|
+
const N = typeof window < "u" ? Ke : Re;
|
|
1153
1164
|
function ce(e) {
|
|
1154
1165
|
const t = O(e);
|
|
1155
1166
|
return N(() => {
|
|
1156
1167
|
t.current = e;
|
|
1157
|
-
}, [e]),
|
|
1168
|
+
}, [e]), Xe((n) => t.current?.(n), [t]);
|
|
1158
1169
|
}
|
|
1159
1170
|
function fe(...e) {
|
|
1160
1171
|
return ce((t) => {
|
|
@@ -1180,21 +1191,21 @@ function zt(e) {
|
|
|
1180
1191
|
t.current[n] = e[n];
|
|
1181
1192
|
}, [e]), t.current;
|
|
1182
1193
|
}
|
|
1183
|
-
const
|
|
1184
|
-
function
|
|
1194
|
+
const Fe = "--react-resizable-panels--panel--pointer-events";
|
|
1195
|
+
function He(e, t) {
|
|
1185
1196
|
const n = e.replace(/[^a-zA-Z0-9\-_]/g, ""), o = t.replace(/[^a-zA-Z0-9\-_]/g, "");
|
|
1186
1197
|
return `--react-resizable-panels--${n}--${o}`;
|
|
1187
1198
|
}
|
|
1188
|
-
const
|
|
1199
|
+
const je = Ye(null);
|
|
1189
1200
|
function wt(e, t) {
|
|
1190
1201
|
const n = O({
|
|
1191
1202
|
getLayout: () => ({}),
|
|
1192
|
-
setLayout:
|
|
1203
|
+
setLayout: at
|
|
1193
1204
|
});
|
|
1194
|
-
|
|
1205
|
+
Ee(t, () => n.current, []), N(() => {
|
|
1195
1206
|
Object.assign(
|
|
1196
1207
|
n.current,
|
|
1197
|
-
|
|
1208
|
+
_e({ groupId: e })
|
|
1198
1209
|
);
|
|
1199
1210
|
});
|
|
1200
1211
|
}
|
|
@@ -1214,20 +1225,20 @@ function Gt({
|
|
|
1214
1225
|
}) {
|
|
1215
1226
|
const m = O({}), p = ce((w) => {
|
|
1216
1227
|
U(m.current, w) || (m.current = w, s?.(w));
|
|
1217
|
-
}), f = ue(i), [d, y] =
|
|
1228
|
+
}), f = ue(i), [d, y] = k(!1), [v, S] = k(null), [x, g] = k(n ?? {}), [b, L] = k([]), [C, q] = k([]), Z = O({
|
|
1218
1229
|
lastExpandedPanelSizes: {},
|
|
1219
1230
|
layouts: {}
|
|
1220
|
-
}), J = fe(
|
|
1231
|
+
}), J = fe(S, a);
|
|
1221
1232
|
wt(f, l);
|
|
1222
|
-
const Q =
|
|
1233
|
+
const Q = se(
|
|
1223
1234
|
() => ({
|
|
1224
1235
|
id: f,
|
|
1225
1236
|
orientation: u,
|
|
1226
|
-
registerPanel: (w) => (L((M) =>
|
|
1237
|
+
registerPanel: (w) => (L((M) => ae(u, [...M, w])), () => {
|
|
1227
1238
|
L((M) => M.filter((F) => F !== w));
|
|
1228
1239
|
}),
|
|
1229
1240
|
registerSeparator: (w) => (q(
|
|
1230
|
-
(M) =>
|
|
1241
|
+
(M) => ae(u, [...M, w])
|
|
1231
1242
|
), () => {
|
|
1232
1243
|
q(
|
|
1233
1244
|
(M) => M.filter((F) => F !== w)
|
|
@@ -1240,34 +1251,34 @@ function Gt({
|
|
|
1240
1251
|
disableCursor: o
|
|
1241
1252
|
}), V = O(null);
|
|
1242
1253
|
N(() => {
|
|
1243
|
-
if (
|
|
1254
|
+
if (v === null)
|
|
1244
1255
|
return;
|
|
1245
1256
|
const w = {
|
|
1246
1257
|
defaultLayout: $.defaultLayout,
|
|
1247
1258
|
disableCursor: !!$.disableCursor,
|
|
1248
1259
|
disabled: !!r,
|
|
1249
|
-
element:
|
|
1260
|
+
element: v,
|
|
1250
1261
|
id: f,
|
|
1251
1262
|
inMemoryLastExpandedPanelSizes: Z.current.lastExpandedPanelSizes,
|
|
1252
1263
|
inMemoryLayouts: Z.current.layouts,
|
|
1253
1264
|
orientation: u,
|
|
1254
1265
|
panels: b,
|
|
1255
|
-
separators:
|
|
1266
|
+
separators: C
|
|
1256
1267
|
};
|
|
1257
1268
|
V.current = w;
|
|
1258
1269
|
const M = xt(w), he = D().mountedGroups.get(w);
|
|
1259
1270
|
if (he) {
|
|
1260
|
-
const { defaultLayoutDeferred: H, derivedPanelConstraints:
|
|
1261
|
-
!H &&
|
|
1271
|
+
const { defaultLayoutDeferred: H, derivedPanelConstraints: j, layout: ee } = he;
|
|
1272
|
+
!H && j.length > 0 && (g(ee), p?.(ee));
|
|
1262
1273
|
}
|
|
1263
|
-
const
|
|
1274
|
+
const We = _.addListener(
|
|
1264
1275
|
"interactionStateChange",
|
|
1265
1276
|
(H) => {
|
|
1266
1277
|
switch (H.state) {
|
|
1267
1278
|
case "active": {
|
|
1268
1279
|
y(
|
|
1269
1280
|
H.hitRegions.some(
|
|
1270
|
-
(
|
|
1281
|
+
(j) => j.group === w
|
|
1271
1282
|
)
|
|
1272
1283
|
);
|
|
1273
1284
|
break;
|
|
@@ -1278,42 +1289,42 @@ function Gt({
|
|
|
1278
1289
|
}
|
|
1279
1290
|
}
|
|
1280
1291
|
}
|
|
1281
|
-
),
|
|
1292
|
+
), Be = _.addListener(
|
|
1282
1293
|
"mountedGroupsChange",
|
|
1283
1294
|
(H) => {
|
|
1284
|
-
const
|
|
1285
|
-
if (
|
|
1286
|
-
const { defaultLayoutDeferred: ee, derivedPanelConstraints:
|
|
1287
|
-
if (ee ||
|
|
1295
|
+
const j = H.get(w);
|
|
1296
|
+
if (j) {
|
|
1297
|
+
const { defaultLayoutDeferred: ee, derivedPanelConstraints: Ue, layout: me } = j;
|
|
1298
|
+
if (ee || Ue.length === 0)
|
|
1288
1299
|
return;
|
|
1289
|
-
|
|
1300
|
+
g(me), p?.(me);
|
|
1290
1301
|
}
|
|
1291
1302
|
}
|
|
1292
1303
|
);
|
|
1293
1304
|
return () => {
|
|
1294
|
-
V.current = null, M(),
|
|
1305
|
+
V.current = null, M(), We(), Be();
|
|
1295
1306
|
};
|
|
1296
1307
|
}, [
|
|
1297
1308
|
r,
|
|
1298
|
-
|
|
1309
|
+
v,
|
|
1299
1310
|
f,
|
|
1300
1311
|
p,
|
|
1301
1312
|
u,
|
|
1302
1313
|
b,
|
|
1303
|
-
|
|
1314
|
+
C,
|
|
1304
1315
|
$
|
|
1305
|
-
]),
|
|
1316
|
+
]), Re(() => {
|
|
1306
1317
|
const w = V.current;
|
|
1307
1318
|
w && (w.defaultLayout = n, w.disableCursor = !!o);
|
|
1308
1319
|
});
|
|
1309
1320
|
const pe = {
|
|
1310
|
-
[
|
|
1321
|
+
[Fe]: d ? "none" : void 0
|
|
1311
1322
|
};
|
|
1312
1323
|
for (const w in x) {
|
|
1313
|
-
const M =
|
|
1324
|
+
const M = He(f, w), F = x[w];
|
|
1314
1325
|
pe[M] = F;
|
|
1315
1326
|
}
|
|
1316
|
-
return /* @__PURE__ */ K(
|
|
1327
|
+
return /* @__PURE__ */ K(je.Provider, { value: Q, children: /* @__PURE__ */ K(
|
|
1317
1328
|
"div",
|
|
1318
1329
|
{
|
|
1319
1330
|
...h,
|
|
@@ -1334,63 +1345,62 @@ function Gt({
|
|
|
1334
1345
|
}
|
|
1335
1346
|
) });
|
|
1336
1347
|
}
|
|
1337
|
-
function
|
|
1348
|
+
function bt(e, t = 10) {
|
|
1349
|
+
let n = null;
|
|
1350
|
+
return (o) => {
|
|
1351
|
+
n !== null && clearTimeout(n), n = setTimeout(() => {
|
|
1352
|
+
e(o);
|
|
1353
|
+
}, t);
|
|
1354
|
+
};
|
|
1355
|
+
}
|
|
1356
|
+
function Lt(e) {
|
|
1338
1357
|
return `react-resizable-panels:${e}`;
|
|
1339
1358
|
}
|
|
1340
|
-
function
|
|
1341
|
-
|
|
1342
|
-
|
|
1359
|
+
function Dt({
|
|
1360
|
+
debounceSaveMs: e = 100,
|
|
1361
|
+
groupId: t,
|
|
1343
1362
|
storage: n
|
|
1344
1363
|
}) {
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
n.
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
[n]
|
|
1363
|
-
), r = Ee(
|
|
1364
|
-
(a) => bt({
|
|
1365
|
-
id: e,
|
|
1366
|
-
layout: a,
|
|
1367
|
-
storage: t
|
|
1368
|
-
}),
|
|
1369
|
-
[e, t]
|
|
1370
|
-
);
|
|
1364
|
+
const o = Lt(t), r = qe(
|
|
1365
|
+
Pt,
|
|
1366
|
+
() => n.getItem(o),
|
|
1367
|
+
() => n.getItem(o)
|
|
1368
|
+
), a = se(
|
|
1369
|
+
() => r ? JSON.parse(r) : void 0,
|
|
1370
|
+
[r]
|
|
1371
|
+
), l = se(() => {
|
|
1372
|
+
const i = (s) => {
|
|
1373
|
+
try {
|
|
1374
|
+
n.setItem(o, JSON.stringify(s));
|
|
1375
|
+
} catch (u) {
|
|
1376
|
+
console.error(u);
|
|
1377
|
+
}
|
|
1378
|
+
};
|
|
1379
|
+
return e > 0 ? bt(i, e) : i;
|
|
1380
|
+
}, [e, n, o]);
|
|
1371
1381
|
return {
|
|
1372
|
-
defaultLayout:
|
|
1373
|
-
onLayoutChange:
|
|
1382
|
+
defaultLayout: a,
|
|
1383
|
+
onLayoutChange: l
|
|
1374
1384
|
};
|
|
1375
1385
|
}
|
|
1376
|
-
function
|
|
1386
|
+
function Pt() {
|
|
1377
1387
|
return function() {
|
|
1378
1388
|
};
|
|
1379
1389
|
}
|
|
1380
|
-
function Dt() {
|
|
1381
|
-
return I(null);
|
|
1382
|
-
}
|
|
1383
1390
|
function Ot() {
|
|
1391
|
+
return k(null);
|
|
1392
|
+
}
|
|
1393
|
+
function Tt() {
|
|
1384
1394
|
return O(null);
|
|
1385
1395
|
}
|
|
1386
1396
|
function de() {
|
|
1387
|
-
const e =
|
|
1397
|
+
const e = Ze(je);
|
|
1388
1398
|
return z(
|
|
1389
1399
|
e,
|
|
1390
1400
|
"Group Context not found; did you render a Panel or Separator outside of a Group?"
|
|
1391
1401
|
), e;
|
|
1392
1402
|
}
|
|
1393
|
-
function
|
|
1403
|
+
function Ct({
|
|
1394
1404
|
groupId: e,
|
|
1395
1405
|
panelId: t
|
|
1396
1406
|
}) {
|
|
@@ -1441,22 +1451,22 @@ function Pt({
|
|
|
1441
1451
|
group: h,
|
|
1442
1452
|
layout: m,
|
|
1443
1453
|
separatorToPanels: p
|
|
1444
|
-
} = n(), f = h.panels.findIndex((
|
|
1454
|
+
} = n(), f = h.panels.findIndex((S) => S.id === t), d = f === h.panels.length - 1, y = Y({
|
|
1445
1455
|
delta: d ? s - i : i - s,
|
|
1446
1456
|
initialLayout: m,
|
|
1447
1457
|
panelConstraints: c,
|
|
1448
1458
|
pivotIndices: d ? [f - 1, f] : [f, f + 1],
|
|
1449
1459
|
prevLayout: m,
|
|
1450
1460
|
trigger: "imperative-api"
|
|
1451
|
-
}),
|
|
1461
|
+
}), v = A({
|
|
1452
1462
|
layout: y,
|
|
1453
1463
|
panelConstraints: c
|
|
1454
1464
|
});
|
|
1455
|
-
U(m,
|
|
1456
|
-
mountedGroups: new Map(
|
|
1465
|
+
U(m, v) || E((S) => ({
|
|
1466
|
+
mountedGroups: new Map(S.mountedGroups).set(h, {
|
|
1457
1467
|
defaultLayoutDeferred: u,
|
|
1458
1468
|
derivedPanelConstraints: c,
|
|
1459
|
-
layout:
|
|
1469
|
+
layout: v,
|
|
1460
1470
|
separatorToPanels: p
|
|
1461
1471
|
})
|
|
1462
1472
|
}));
|
|
@@ -1487,7 +1497,7 @@ function Pt({
|
|
|
1487
1497
|
switch (typeof i) {
|
|
1488
1498
|
case "number": {
|
|
1489
1499
|
const { group: c } = n(), h = B({ group: c });
|
|
1490
|
-
u =
|
|
1500
|
+
u = I(i / h * 100);
|
|
1491
1501
|
break;
|
|
1492
1502
|
}
|
|
1493
1503
|
case "string": {
|
|
@@ -1511,14 +1521,14 @@ function Rt(e, t) {
|
|
|
1511
1521
|
isCollapsed: () => !1,
|
|
1512
1522
|
resize: ie
|
|
1513
1523
|
});
|
|
1514
|
-
|
|
1524
|
+
Ee(t, () => o.current, []), N(() => {
|
|
1515
1525
|
Object.assign(
|
|
1516
1526
|
o.current,
|
|
1517
|
-
|
|
1527
|
+
Ct({ groupId: n, panelId: e })
|
|
1518
1528
|
);
|
|
1519
1529
|
});
|
|
1520
1530
|
}
|
|
1521
|
-
function
|
|
1531
|
+
function _t({
|
|
1522
1532
|
children: e,
|
|
1523
1533
|
className: t,
|
|
1524
1534
|
collapsedSize: n = "0%",
|
|
@@ -1533,8 +1543,8 @@ function Tt({
|
|
|
1533
1543
|
style: h,
|
|
1534
1544
|
...m
|
|
1535
1545
|
}) {
|
|
1536
|
-
const p = !!l, f = ue(l), [d, y] =
|
|
1537
|
-
u?.(
|
|
1546
|
+
const p = !!l, f = ue(l), [d, y] = k(null), v = fe(y, a), { id: S, registerPanel: x } = de(), g = u !== null, b = ce((C) => {
|
|
1547
|
+
u?.(C, l);
|
|
1538
1548
|
});
|
|
1539
1549
|
N(() => {
|
|
1540
1550
|
if (d !== null)
|
|
@@ -1542,7 +1552,7 @@ function Tt({
|
|
|
1542
1552
|
element: d,
|
|
1543
1553
|
id: f,
|
|
1544
1554
|
idIsStable: p,
|
|
1545
|
-
onResize:
|
|
1555
|
+
onResize: g ? b : void 0,
|
|
1546
1556
|
panelConstraints: {
|
|
1547
1557
|
collapsedSize: n,
|
|
1548
1558
|
collapsible: o,
|
|
@@ -1556,7 +1566,7 @@ function Tt({
|
|
|
1556
1566
|
o,
|
|
1557
1567
|
r,
|
|
1558
1568
|
d,
|
|
1559
|
-
|
|
1569
|
+
g,
|
|
1560
1570
|
f,
|
|
1561
1571
|
p,
|
|
1562
1572
|
i,
|
|
@@ -1564,7 +1574,7 @@ function Tt({
|
|
|
1564
1574
|
b,
|
|
1565
1575
|
x
|
|
1566
1576
|
]), Rt(f, c);
|
|
1567
|
-
const L =
|
|
1577
|
+
const L = He(S, f);
|
|
1568
1578
|
return /* @__PURE__ */ K(
|
|
1569
1579
|
"div",
|
|
1570
1580
|
{
|
|
@@ -1572,9 +1582,9 @@ function Tt({
|
|
|
1572
1582
|
"data-panel": !0,
|
|
1573
1583
|
"data-testid": f,
|
|
1574
1584
|
id: f,
|
|
1575
|
-
ref:
|
|
1585
|
+
ref: v,
|
|
1576
1586
|
style: {
|
|
1577
|
-
...
|
|
1587
|
+
...Et,
|
|
1578
1588
|
flexBasis: 0,
|
|
1579
1589
|
flexGrow: `var(${L}, 1)`,
|
|
1580
1590
|
flexShrink: 1,
|
|
@@ -1582,7 +1592,7 @@ function Tt({
|
|
|
1582
1592
|
overflow: "hidden",
|
|
1583
1593
|
// Disable pointer events inside of a panel during resize
|
|
1584
1594
|
// This avoid edge cases like nested iframes
|
|
1585
|
-
pointerEvents: `var(${
|
|
1595
|
+
pointerEvents: `var(${Fe})`
|
|
1586
1596
|
},
|
|
1587
1597
|
children: /* @__PURE__ */ K(
|
|
1588
1598
|
"div",
|
|
@@ -1599,7 +1609,7 @@ function Tt({
|
|
|
1599
1609
|
}
|
|
1600
1610
|
);
|
|
1601
1611
|
}
|
|
1602
|
-
const
|
|
1612
|
+
const Et = {
|
|
1603
1613
|
minHeight: "unset",
|
|
1604
1614
|
maxHeight: "unset",
|
|
1605
1615
|
height: "unset",
|
|
@@ -1615,13 +1625,13 @@ const Ct = {
|
|
|
1615
1625
|
padding: "unset",
|
|
1616
1626
|
margin: "unset"
|
|
1617
1627
|
};
|
|
1618
|
-
function _t() {
|
|
1619
|
-
return I(null);
|
|
1620
|
-
}
|
|
1621
1628
|
function At() {
|
|
1629
|
+
return k(null);
|
|
1630
|
+
}
|
|
1631
|
+
function Nt() {
|
|
1622
1632
|
return O(null);
|
|
1623
1633
|
}
|
|
1624
|
-
function
|
|
1634
|
+
function Mt({
|
|
1625
1635
|
layout: e,
|
|
1626
1636
|
panelConstraints: t,
|
|
1627
1637
|
panelId: n,
|
|
@@ -1662,7 +1672,7 @@ function Et({
|
|
|
1662
1672
|
valueNow: l
|
|
1663
1673
|
};
|
|
1664
1674
|
}
|
|
1665
|
-
function
|
|
1675
|
+
function $t({
|
|
1666
1676
|
children: e,
|
|
1667
1677
|
className: t,
|
|
1668
1678
|
elementRef: n,
|
|
@@ -1670,22 +1680,22 @@ function Nt({
|
|
|
1670
1680
|
style: r,
|
|
1671
1681
|
...a
|
|
1672
1682
|
}) {
|
|
1673
|
-
const l = ue(o), [i, s] =
|
|
1683
|
+
const l = ue(o), [i, s] = k({}), [u, c] = k("inactive"), [h, m] = k(null), p = fe(m, n), {
|
|
1674
1684
|
id: f,
|
|
1675
1685
|
orientation: d,
|
|
1676
1686
|
registerSeparator: y
|
|
1677
|
-
} = de(),
|
|
1687
|
+
} = de(), v = d === "horizontal" ? "vertical" : "horizontal";
|
|
1678
1688
|
return N(() => {
|
|
1679
1689
|
if (h !== null) {
|
|
1680
|
-
const
|
|
1690
|
+
const S = {
|
|
1681
1691
|
element: h,
|
|
1682
1692
|
id: l
|
|
1683
|
-
}, x = y(
|
|
1693
|
+
}, x = y(S), g = _.addListener(
|
|
1684
1694
|
"interactionStateChange",
|
|
1685
1695
|
(L) => {
|
|
1686
1696
|
c(
|
|
1687
1697
|
L.state !== "inactive" && L.hitRegions.some(
|
|
1688
|
-
(
|
|
1698
|
+
(C) => C.separator === S
|
|
1689
1699
|
) ? L.state : "inactive"
|
|
1690
1700
|
);
|
|
1691
1701
|
}
|
|
@@ -1693,15 +1703,15 @@ function Nt({
|
|
|
1693
1703
|
"mountedGroupsChange",
|
|
1694
1704
|
(L) => {
|
|
1695
1705
|
L.forEach(
|
|
1696
|
-
({ derivedPanelConstraints:
|
|
1706
|
+
({ derivedPanelConstraints: C, layout: q, separatorToPanels: Z }, J) => {
|
|
1697
1707
|
if (J.id === f) {
|
|
1698
|
-
const Q = Z.get(
|
|
1708
|
+
const Q = Z.get(S);
|
|
1699
1709
|
if (Q) {
|
|
1700
1710
|
const $ = Q[0], V = J.panels.indexOf($);
|
|
1701
1711
|
s(
|
|
1702
|
-
|
|
1712
|
+
Mt({
|
|
1703
1713
|
layout: q,
|
|
1704
|
-
panelConstraints:
|
|
1714
|
+
panelConstraints: C,
|
|
1705
1715
|
panelId: $.id,
|
|
1706
1716
|
panelIndex: V
|
|
1707
1717
|
})
|
|
@@ -1713,7 +1723,7 @@ function Nt({
|
|
|
1713
1723
|
}
|
|
1714
1724
|
);
|
|
1715
1725
|
return () => {
|
|
1716
|
-
|
|
1726
|
+
g(), b(), x();
|
|
1717
1727
|
};
|
|
1718
1728
|
}
|
|
1719
1729
|
}, [h, f, l, y]), /* @__PURE__ */ K(
|
|
@@ -1721,7 +1731,7 @@ function Nt({
|
|
|
1721
1731
|
{
|
|
1722
1732
|
...a,
|
|
1723
1733
|
"aria-controls": i.valueControls,
|
|
1724
|
-
"aria-orientation":
|
|
1734
|
+
"aria-orientation": v,
|
|
1725
1735
|
"aria-valuemax": i.valueMax,
|
|
1726
1736
|
"aria-valuemin": i.valueMin,
|
|
1727
1737
|
"aria-valuenow": i.valueNow,
|
|
@@ -1744,12 +1754,12 @@ function Nt({
|
|
|
1744
1754
|
}
|
|
1745
1755
|
export {
|
|
1746
1756
|
Gt as Group,
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1757
|
+
_t as Panel,
|
|
1758
|
+
$t as Separator,
|
|
1759
|
+
Dt as useDefaultLayout,
|
|
1760
|
+
Ot as useGroupCallbackRef,
|
|
1761
|
+
Tt as useGroupRef,
|
|
1762
|
+
At as usePanelCallbackRef,
|
|
1763
|
+
Nt as usePanelRef
|
|
1754
1764
|
};
|
|
1755
1765
|
//# sourceMappingURL=react-resizable-panels.js.map
|