react-resizable-panels 4.0.8-alpha.1 → 4.0.8-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,75 +1,75 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { useId as
|
|
2
|
+
import { jsx as B } from "react/jsx-runtime";
|
|
3
|
+
import { useId as Ne, useLayoutEffect as _e, useEffect as Fe, useRef as T, useCallback as ze, createContext as He, useImperativeHandle as be, useState as G, useMemo as we, useSyncExternalStore as We, useContext as je } from "react";
|
|
4
4
|
function z(e, t = "Assertion error") {
|
|
5
5
|
if (!e)
|
|
6
6
|
throw Error(t);
|
|
7
7
|
}
|
|
8
|
-
function
|
|
8
|
+
function H({
|
|
9
|
+
group: e
|
|
10
|
+
}) {
|
|
11
|
+
const { orientation: t, panels: n } = e;
|
|
12
|
+
return n.reduce((o, r) => (o += t === "horizontal" ? r.element.offsetWidth : r.element.offsetHeight, o), 0);
|
|
13
|
+
}
|
|
14
|
+
function se(e, t) {
|
|
9
15
|
return t.sort(
|
|
10
|
-
e === "horizontal" ?
|
|
16
|
+
e === "horizontal" ? Be : Ue
|
|
11
17
|
);
|
|
12
18
|
}
|
|
13
|
-
function
|
|
19
|
+
function Be(e, t) {
|
|
14
20
|
const n = e.element.offsetLeft - t.element.offsetLeft;
|
|
15
21
|
return n !== 0 ? n : e.element.offsetWidth - t.element.offsetWidth;
|
|
16
22
|
}
|
|
17
|
-
function
|
|
23
|
+
function Ue(e, t) {
|
|
18
24
|
const n = e.element.offsetTop - t.element.offsetTop;
|
|
19
25
|
return n !== 0 ? n : e.element.offsetHeight - t.element.offsetHeight;
|
|
20
26
|
}
|
|
21
|
-
function
|
|
22
|
-
|
|
23
|
-
}) {
|
|
24
|
-
const { orientation: t, panels: n } = e;
|
|
25
|
-
return n.reduce((o, r) => (o += t === "horizontal" ? r.element.offsetWidth : r.element.offsetHeight, o), 0);
|
|
26
|
-
}
|
|
27
|
-
function Pe(e) {
|
|
28
|
-
const { element: t, orientation: n, panels: o, separators: r } = e, s = re(
|
|
27
|
+
function Le(e) {
|
|
28
|
+
const { element: t, orientation: n, panels: o, separators: r } = e, s = se(
|
|
29
29
|
n,
|
|
30
30
|
Array.from(t.children).filter((l) => l instanceof HTMLElement).map((l) => ({ element: l }))
|
|
31
|
-
).map(({ element: l }) => l),
|
|
31
|
+
).map(({ element: l }) => l), u = [];
|
|
32
32
|
let i, a;
|
|
33
33
|
for (const l of s) {
|
|
34
|
-
const
|
|
35
|
-
(
|
|
34
|
+
const c = o.find(
|
|
35
|
+
(d) => d.element === l
|
|
36
36
|
);
|
|
37
|
-
if (
|
|
37
|
+
if (c) {
|
|
38
38
|
if (i) {
|
|
39
|
-
const
|
|
40
|
-
|
|
39
|
+
const d = i.element.getBoundingClientRect(), m = l.getBoundingClientRect();
|
|
40
|
+
u.push({
|
|
41
41
|
group: e,
|
|
42
|
-
groupSize:
|
|
43
|
-
panels: [i,
|
|
42
|
+
groupSize: H({ group: e }),
|
|
43
|
+
panels: [i, c],
|
|
44
44
|
separator: a,
|
|
45
45
|
rect: n === "horizontal" ? new DOMRect(
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
46
|
+
d.right,
|
|
47
|
+
m.top,
|
|
48
|
+
m.left - d.right,
|
|
49
|
+
m.height
|
|
50
50
|
) : new DOMRect(
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
51
|
+
m.left,
|
|
52
|
+
d.bottom,
|
|
53
|
+
m.width,
|
|
54
|
+
m.top - d.bottom
|
|
55
55
|
)
|
|
56
56
|
});
|
|
57
57
|
}
|
|
58
|
-
i =
|
|
58
|
+
i = c, a = void 0;
|
|
59
59
|
} else {
|
|
60
|
-
const
|
|
61
|
-
(
|
|
60
|
+
const d = r.find(
|
|
61
|
+
(m) => m.element === l
|
|
62
62
|
);
|
|
63
|
-
|
|
63
|
+
d ? a = d : (i = void 0, a = void 0);
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
|
-
return
|
|
66
|
+
return u;
|
|
67
67
|
}
|
|
68
|
-
function
|
|
68
|
+
function Ke(e, t) {
|
|
69
69
|
const n = getComputedStyle(e), o = parseFloat(n.fontSize);
|
|
70
70
|
return t * o;
|
|
71
71
|
}
|
|
72
|
-
function
|
|
72
|
+
function Ve(e, t) {
|
|
73
73
|
const n = getComputedStyle(e.ownerDocument.body), o = parseFloat(n.fontSize);
|
|
74
74
|
return t * o;
|
|
75
75
|
}
|
|
@@ -89,7 +89,7 @@ function qe(e) {
|
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
|
-
function
|
|
92
|
+
function Q({
|
|
93
93
|
groupSize: e,
|
|
94
94
|
panelElement: t,
|
|
95
95
|
styleProp: n
|
|
@@ -106,11 +106,11 @@ function Z({
|
|
|
106
106
|
break;
|
|
107
107
|
}
|
|
108
108
|
case "rem": {
|
|
109
|
-
o =
|
|
109
|
+
o = Ve(t, r);
|
|
110
110
|
break;
|
|
111
111
|
}
|
|
112
112
|
case "em": {
|
|
113
|
-
o =
|
|
113
|
+
o = Ke(t, r);
|
|
114
114
|
break;
|
|
115
115
|
}
|
|
116
116
|
case "vh": {
|
|
@@ -127,8 +127,8 @@ function Z({
|
|
|
127
127
|
function I(e) {
|
|
128
128
|
return parseFloat(e.toFixed(3));
|
|
129
129
|
}
|
|
130
|
-
function
|
|
131
|
-
const { panels: t } = e, n =
|
|
130
|
+
function pe(e) {
|
|
131
|
+
const { panels: t } = e, n = H({ group: e });
|
|
132
132
|
return n === 0 ? t.map((o) => ({
|
|
133
133
|
collapsedSize: 0,
|
|
134
134
|
collapsible: o.panelConstraints.collapsible === !0,
|
|
@@ -138,44 +138,44 @@ function me(e) {
|
|
|
138
138
|
panelId: o.id
|
|
139
139
|
})) : t.map((o) => {
|
|
140
140
|
const { element: r, panelConstraints: s } = o;
|
|
141
|
-
let
|
|
141
|
+
let u = 0;
|
|
142
142
|
if (s.collapsedSize) {
|
|
143
|
-
const
|
|
143
|
+
const c = Q({
|
|
144
144
|
groupSize: n,
|
|
145
145
|
panelElement: r,
|
|
146
146
|
styleProp: s.collapsedSize
|
|
147
147
|
});
|
|
148
|
-
|
|
148
|
+
u = I(c / n * 100);
|
|
149
149
|
}
|
|
150
150
|
let i;
|
|
151
151
|
if (s.defaultSize) {
|
|
152
|
-
const
|
|
152
|
+
const c = Q({
|
|
153
153
|
groupSize: n,
|
|
154
154
|
panelElement: r,
|
|
155
155
|
styleProp: s.defaultSize
|
|
156
156
|
});
|
|
157
|
-
i = I(
|
|
157
|
+
i = I(c / n * 100);
|
|
158
158
|
}
|
|
159
159
|
let a = 0;
|
|
160
160
|
if (s.minSize) {
|
|
161
|
-
const
|
|
161
|
+
const c = Q({
|
|
162
162
|
groupSize: n,
|
|
163
163
|
panelElement: r,
|
|
164
164
|
styleProp: s.minSize
|
|
165
165
|
});
|
|
166
|
-
a = I(
|
|
166
|
+
a = I(c / n * 100);
|
|
167
167
|
}
|
|
168
168
|
let l = 100;
|
|
169
169
|
if (s.maxSize) {
|
|
170
|
-
const
|
|
170
|
+
const c = Q({
|
|
171
171
|
groupSize: n,
|
|
172
172
|
panelElement: r,
|
|
173
173
|
styleProp: s.maxSize
|
|
174
174
|
});
|
|
175
|
-
l = I(
|
|
175
|
+
l = I(c / n * 100);
|
|
176
176
|
}
|
|
177
177
|
return {
|
|
178
|
-
collapsedSize:
|
|
178
|
+
collapsedSize: u,
|
|
179
179
|
collapsible: s.collapsible === !0,
|
|
180
180
|
defaultSize: i,
|
|
181
181
|
minSize: a,
|
|
@@ -199,9 +199,9 @@ class Ze {
|
|
|
199
199
|
o[0].call(null, n);
|
|
200
200
|
else {
|
|
201
201
|
let r = !1, s = null;
|
|
202
|
-
const
|
|
203
|
-
for (let i = 0; i <
|
|
204
|
-
const a =
|
|
202
|
+
const u = Array.from(o);
|
|
203
|
+
for (let i = 0; i < u.length; i++) {
|
|
204
|
+
const a = u[i];
|
|
205
205
|
try {
|
|
206
206
|
a.call(null, n);
|
|
207
207
|
} catch (l) {
|
|
@@ -223,7 +223,7 @@ class Ze {
|
|
|
223
223
|
}
|
|
224
224
|
}
|
|
225
225
|
}
|
|
226
|
-
function
|
|
226
|
+
function L(e, t, n = 0) {
|
|
227
227
|
return Math.abs(I(e) - I(t)) <= n;
|
|
228
228
|
}
|
|
229
229
|
let R = {
|
|
@@ -248,23 +248,23 @@ function C(e) {
|
|
|
248
248
|
}, t.cursorFlags !== void 0 && A.emit("cursorFlagsChange", R.cursorFlags), t.interactionState !== void 0 && A.emit("interactionStateChange", R.interactionState), t.mountedGroups !== void 0 && (R.mountedGroups.forEach((o, r) => {
|
|
249
249
|
o.derivedPanelConstraints.forEach((s) => {
|
|
250
250
|
if (s.collapsible) {
|
|
251
|
-
const { layout:
|
|
252
|
-
if (
|
|
253
|
-
const i =
|
|
251
|
+
const { layout: u } = n.mountedGroups.get(r) ?? {};
|
|
252
|
+
if (u) {
|
|
253
|
+
const i = L(
|
|
254
254
|
s.collapsedSize,
|
|
255
255
|
o.layout[s.panelId]
|
|
256
|
-
), a =
|
|
256
|
+
), a = L(
|
|
257
257
|
s.collapsedSize,
|
|
258
|
-
|
|
258
|
+
u[s.panelId]
|
|
259
259
|
);
|
|
260
|
-
i && !a && (r.inMemoryLastExpandedPanelSizes[s.panelId] =
|
|
260
|
+
i && !a && (r.inMemoryLastExpandedPanelSizes[s.panelId] = u[s.panelId]);
|
|
261
261
|
}
|
|
262
262
|
}
|
|
263
263
|
});
|
|
264
264
|
}), A.emit("mountedGroupsChange", R.mountedGroups)), R;
|
|
265
265
|
}
|
|
266
266
|
const Je = (e) => e, ie = () => {
|
|
267
|
-
},
|
|
267
|
+
}, Pe = 1, Ee = 2, Re = 4, Ce = 8, me = {
|
|
268
268
|
coarse: 10,
|
|
269
269
|
precise: 5
|
|
270
270
|
};
|
|
@@ -295,11 +295,11 @@ function Qe({
|
|
|
295
295
|
return null;
|
|
296
296
|
switch (n) {
|
|
297
297
|
case "active": {
|
|
298
|
-
const s = (e &
|
|
298
|
+
const s = (e & Pe) !== 0, u = (e & Ee) !== 0, i = (e & Re) !== 0, a = (e & Ce) !== 0;
|
|
299
299
|
if (e) {
|
|
300
300
|
if (s)
|
|
301
301
|
return i ? "se-resize" : a ? "ne-resize" : "e-resize";
|
|
302
|
-
if (
|
|
302
|
+
if (u)
|
|
303
303
|
return i ? "sw-resize" : a ? "nw-resize" : "w-resize";
|
|
304
304
|
if (i)
|
|
305
305
|
return "s-resize";
|
|
@@ -311,7 +311,7 @@ function Qe({
|
|
|
311
311
|
}
|
|
312
312
|
return o > 0 && r > 0 ? "move" : o > 0 ? "ew-resize" : "ns-resize";
|
|
313
313
|
}
|
|
314
|
-
let
|
|
314
|
+
let re, k;
|
|
315
315
|
function le() {
|
|
316
316
|
k === void 0 && (k = new CSSStyleSheet(), document.adoptedStyleSheets = [k]);
|
|
317
317
|
const { cursorFlags: e, interactionState: t } = O();
|
|
@@ -323,13 +323,13 @@ function le() {
|
|
|
323
323
|
groups: t.hitRegions.map((r) => r.group),
|
|
324
324
|
state: t.state
|
|
325
325
|
}), o = `*{cursor: ${n} !important; ${t.state === "active" ? "touch-action: none;" : ""} }`;
|
|
326
|
-
if (
|
|
326
|
+
if (re === o)
|
|
327
327
|
return;
|
|
328
|
-
|
|
328
|
+
re = o, n ? k.cssRules.length === 0 ? k.insertRule(o) : k.replaceSync(o) : k.cssRules.length === 1 && k.deleteRule(0);
|
|
329
329
|
break;
|
|
330
330
|
}
|
|
331
331
|
case "inactive": {
|
|
332
|
-
|
|
332
|
+
re = void 0, k.cssRules.length === 1 && k.deleteRule(0);
|
|
333
333
|
break;
|
|
334
334
|
}
|
|
335
335
|
}
|
|
@@ -342,8 +342,8 @@ function et(e, t) {
|
|
|
342
342
|
return !1;
|
|
343
343
|
return !0;
|
|
344
344
|
}
|
|
345
|
-
function
|
|
346
|
-
return
|
|
345
|
+
function U(e, t) {
|
|
346
|
+
return L(e, t) ? 0 : e > t ? 1 : -1;
|
|
347
347
|
}
|
|
348
348
|
function F({
|
|
349
349
|
panelConstraints: e,
|
|
@@ -355,15 +355,15 @@ function F({
|
|
|
355
355
|
maxSize: r = 100,
|
|
356
356
|
minSize: s = 0
|
|
357
357
|
} = e;
|
|
358
|
-
if (
|
|
358
|
+
if (U(t, s) < 0)
|
|
359
359
|
if (o) {
|
|
360
|
-
const
|
|
361
|
-
|
|
360
|
+
const u = (n + s) / 2;
|
|
361
|
+
U(t, u) < 0 ? t = n : t = s;
|
|
362
362
|
} else
|
|
363
363
|
t = s;
|
|
364
364
|
return t = Math.min(r, t), t = I(t), t;
|
|
365
365
|
}
|
|
366
|
-
function
|
|
366
|
+
function K({
|
|
367
367
|
delta: e,
|
|
368
368
|
initialLayout: t,
|
|
369
369
|
panelConstraints: n,
|
|
@@ -371,89 +371,89 @@ function V({
|
|
|
371
371
|
prevLayout: r,
|
|
372
372
|
trigger: s
|
|
373
373
|
}) {
|
|
374
|
-
if (
|
|
374
|
+
if (L(e, 0))
|
|
375
375
|
return t;
|
|
376
|
-
const
|
|
377
|
-
z(l != null, "Invalid first pivot index"), z(
|
|
378
|
-
let
|
|
376
|
+
const u = Object.values(t), i = Object.values(r), a = [...u], [l, c] = o;
|
|
377
|
+
z(l != null, "Invalid first pivot index"), z(c != null, "Invalid second pivot index");
|
|
378
|
+
let d = 0;
|
|
379
379
|
if (s === "keyboard") {
|
|
380
380
|
{
|
|
381
|
-
const
|
|
381
|
+
const f = e < 0 ? c : l, p = n[f];
|
|
382
382
|
z(
|
|
383
383
|
p,
|
|
384
|
-
`Panel constraints not found for index ${
|
|
384
|
+
`Panel constraints not found for index ${f}`
|
|
385
385
|
);
|
|
386
386
|
const {
|
|
387
|
-
collapsedSize:
|
|
388
|
-
collapsible:
|
|
389
|
-
minSize:
|
|
387
|
+
collapsedSize: y = 0,
|
|
388
|
+
collapsible: h,
|
|
389
|
+
minSize: S = 0
|
|
390
390
|
} = p;
|
|
391
|
-
if (
|
|
392
|
-
const
|
|
391
|
+
if (h) {
|
|
392
|
+
const x = u[f];
|
|
393
393
|
if (z(
|
|
394
|
-
|
|
395
|
-
`Previous layout not found for panel index ${
|
|
396
|
-
),
|
|
397
|
-
const g =
|
|
398
|
-
|
|
394
|
+
x != null,
|
|
395
|
+
`Previous layout not found for panel index ${f}`
|
|
396
|
+
), L(x, y)) {
|
|
397
|
+
const g = S - x;
|
|
398
|
+
U(g, Math.abs(e)) > 0 && (e = e < 0 ? 0 - g : g);
|
|
399
399
|
}
|
|
400
400
|
}
|
|
401
401
|
}
|
|
402
402
|
{
|
|
403
|
-
const
|
|
403
|
+
const f = e < 0 ? l : c, p = n[f];
|
|
404
404
|
z(
|
|
405
405
|
p,
|
|
406
|
-
`No panel constraints found for index ${
|
|
406
|
+
`No panel constraints found for index ${f}`
|
|
407
407
|
);
|
|
408
408
|
const {
|
|
409
|
-
collapsedSize:
|
|
410
|
-
collapsible:
|
|
411
|
-
minSize:
|
|
409
|
+
collapsedSize: y = 0,
|
|
410
|
+
collapsible: h,
|
|
411
|
+
minSize: S = 0
|
|
412
412
|
} = p;
|
|
413
|
-
if (
|
|
414
|
-
const
|
|
413
|
+
if (h) {
|
|
414
|
+
const x = u[f];
|
|
415
415
|
if (z(
|
|
416
|
-
|
|
417
|
-
`Previous layout not found for panel index ${
|
|
418
|
-
),
|
|
419
|
-
const g =
|
|
420
|
-
|
|
416
|
+
x != null,
|
|
417
|
+
`Previous layout not found for panel index ${f}`
|
|
418
|
+
), L(x, S)) {
|
|
419
|
+
const g = x - y;
|
|
420
|
+
U(g, Math.abs(e)) > 0 && (e = e < 0 ? 0 - g : g);
|
|
421
421
|
}
|
|
422
422
|
}
|
|
423
423
|
}
|
|
424
424
|
}
|
|
425
425
|
{
|
|
426
|
-
const
|
|
427
|
-
let p = e < 0 ?
|
|
426
|
+
const f = e < 0 ? 1 : -1;
|
|
427
|
+
let p = e < 0 ? c : l, y = 0;
|
|
428
428
|
for (; ; ) {
|
|
429
|
-
const
|
|
429
|
+
const S = u[p];
|
|
430
430
|
z(
|
|
431
|
-
|
|
431
|
+
S != null,
|
|
432
432
|
`Previous layout not found for panel index ${p}`
|
|
433
433
|
);
|
|
434
434
|
const g = F({
|
|
435
435
|
panelConstraints: n[p],
|
|
436
436
|
size: 100
|
|
437
|
-
}) -
|
|
438
|
-
if (
|
|
437
|
+
}) - S;
|
|
438
|
+
if (y += g, p += f, p < 0 || p >= n.length)
|
|
439
439
|
break;
|
|
440
440
|
}
|
|
441
|
-
const
|
|
442
|
-
e = e < 0 ? 0 -
|
|
441
|
+
const h = Math.min(Math.abs(e), Math.abs(y));
|
|
442
|
+
e = e < 0 ? 0 - h : h;
|
|
443
443
|
}
|
|
444
444
|
{
|
|
445
|
-
let p = e < 0 ? l :
|
|
445
|
+
let p = e < 0 ? l : c;
|
|
446
446
|
for (; p >= 0 && p < n.length; ) {
|
|
447
|
-
const
|
|
447
|
+
const y = Math.abs(e) - Math.abs(d), h = u[p];
|
|
448
448
|
z(
|
|
449
|
-
|
|
449
|
+
h != null,
|
|
450
450
|
`Previous layout not found for panel index ${p}`
|
|
451
451
|
);
|
|
452
|
-
const
|
|
452
|
+
const S = h - y, x = F({
|
|
453
453
|
panelConstraints: n[p],
|
|
454
|
-
size:
|
|
454
|
+
size: S
|
|
455
455
|
});
|
|
456
|
-
if (!
|
|
456
|
+
if (!L(h, x) && (d += h - x, a[p] = x, d.toFixed(3).localeCompare(Math.abs(e).toFixed(3), void 0, {
|
|
457
457
|
numeric: !0
|
|
458
458
|
}) >= 0))
|
|
459
459
|
break;
|
|
@@ -463,51 +463,51 @@ function V({
|
|
|
463
463
|
if (et(i, a))
|
|
464
464
|
return r;
|
|
465
465
|
{
|
|
466
|
-
const
|
|
466
|
+
const f = e < 0 ? c : l, p = u[f];
|
|
467
467
|
z(
|
|
468
468
|
p != null,
|
|
469
|
-
`Previous layout not found for panel index ${
|
|
469
|
+
`Previous layout not found for panel index ${f}`
|
|
470
470
|
);
|
|
471
|
-
const
|
|
472
|
-
panelConstraints: n[
|
|
473
|
-
size:
|
|
471
|
+
const y = p + d, h = F({
|
|
472
|
+
panelConstraints: n[f],
|
|
473
|
+
size: y
|
|
474
474
|
});
|
|
475
|
-
if (a[
|
|
476
|
-
let
|
|
475
|
+
if (a[f] = h, !L(h, y)) {
|
|
476
|
+
let S = y - h, g = e < 0 ? c : l;
|
|
477
477
|
for (; g >= 0 && g < n.length; ) {
|
|
478
|
-
const
|
|
478
|
+
const w = a[g];
|
|
479
479
|
z(
|
|
480
|
-
|
|
480
|
+
w != null,
|
|
481
481
|
`Previous layout not found for panel index ${g}`
|
|
482
482
|
);
|
|
483
|
-
const P =
|
|
483
|
+
const P = w + S, E = F({
|
|
484
484
|
panelConstraints: n[g],
|
|
485
485
|
size: P
|
|
486
486
|
});
|
|
487
|
-
if (w
|
|
487
|
+
if (L(w, E) || (S -= E - w, a[g] = E), L(S, 0))
|
|
488
488
|
break;
|
|
489
489
|
e > 0 ? g-- : g++;
|
|
490
490
|
}
|
|
491
491
|
}
|
|
492
492
|
}
|
|
493
|
-
const
|
|
494
|
-
(
|
|
493
|
+
const m = Object.values(a).reduce(
|
|
494
|
+
(f, p) => p + f,
|
|
495
495
|
0
|
|
496
496
|
);
|
|
497
|
-
if (!
|
|
497
|
+
if (!L(m, 100, 0.1))
|
|
498
498
|
return r;
|
|
499
|
-
const
|
|
500
|
-
return a.reduce((
|
|
499
|
+
const v = Object.keys(r);
|
|
500
|
+
return a.reduce((f, p, y) => (f[v[y]] = p, f), {});
|
|
501
501
|
}
|
|
502
|
-
function
|
|
502
|
+
function W(e, t) {
|
|
503
503
|
if (Object.keys(e).length !== Object.keys(t).length)
|
|
504
504
|
return !1;
|
|
505
505
|
for (const n in e)
|
|
506
|
-
if (
|
|
506
|
+
if (U(e[n], t[n]) !== 0)
|
|
507
507
|
return !1;
|
|
508
508
|
return !0;
|
|
509
509
|
}
|
|
510
|
-
function
|
|
510
|
+
function Me({
|
|
511
511
|
event: e,
|
|
512
512
|
hitRegions: t,
|
|
513
513
|
initialLayoutMap: n,
|
|
@@ -515,53 +515,53 @@ function Ge({
|
|
|
515
515
|
pointerDownAtPoint: r
|
|
516
516
|
}) {
|
|
517
517
|
let s = 0;
|
|
518
|
-
const
|
|
518
|
+
const u = new Map(o);
|
|
519
519
|
t.forEach((i) => {
|
|
520
|
-
const { group: a, groupSize: l } = i, { disableCursor:
|
|
521
|
-
let
|
|
522
|
-
r ?
|
|
523
|
-
const
|
|
520
|
+
const { group: a, groupSize: l } = i, { disableCursor: c, orientation: d, panels: m } = a;
|
|
521
|
+
let v = 0;
|
|
522
|
+
r ? d === "horizontal" ? v = (e.clientX - r.x) / l * 100 : v = (e.clientY - r.y) / l * 100 : d === "horizontal" ? v = e.clientX < 0 ? -100 : 100 : v = e.clientY < 0 ? -100 : 100;
|
|
523
|
+
const f = n.get(a), {
|
|
524
524
|
derivedPanelConstraints: p,
|
|
525
|
-
layout:
|
|
526
|
-
separatorToPanels:
|
|
525
|
+
layout: y,
|
|
526
|
+
separatorToPanels: h
|
|
527
527
|
} = o.get(a) ?? {};
|
|
528
|
-
if (p &&
|
|
529
|
-
const
|
|
530
|
-
delta:
|
|
531
|
-
initialLayout:
|
|
528
|
+
if (p && f && y && h) {
|
|
529
|
+
const S = K({
|
|
530
|
+
delta: v,
|
|
531
|
+
initialLayout: f,
|
|
532
532
|
panelConstraints: p,
|
|
533
|
-
pivotIndices: i.panels.map((
|
|
534
|
-
prevLayout:
|
|
533
|
+
pivotIndices: i.panels.map((x) => m.indexOf(x)),
|
|
534
|
+
prevLayout: y,
|
|
535
535
|
trigger: "mouse-or-touch"
|
|
536
536
|
});
|
|
537
|
-
if (
|
|
538
|
-
if (
|
|
539
|
-
switch (
|
|
537
|
+
if (W(S, y)) {
|
|
538
|
+
if (v !== 0 && !c)
|
|
539
|
+
switch (d) {
|
|
540
540
|
case "horizontal": {
|
|
541
|
-
s |=
|
|
541
|
+
s |= v < 0 ? Pe : Ee;
|
|
542
542
|
break;
|
|
543
543
|
}
|
|
544
544
|
case "vertical": {
|
|
545
|
-
s |=
|
|
545
|
+
s |= v < 0 ? Re : Ce;
|
|
546
546
|
break;
|
|
547
547
|
}
|
|
548
548
|
}
|
|
549
549
|
} else {
|
|
550
|
-
|
|
550
|
+
u.set(i.group, {
|
|
551
551
|
derivedPanelConstraints: p,
|
|
552
|
-
layout:
|
|
553
|
-
separatorToPanels:
|
|
552
|
+
layout: S,
|
|
553
|
+
separatorToPanels: h
|
|
554
554
|
});
|
|
555
|
-
const
|
|
556
|
-
i.group.inMemoryLayouts[
|
|
555
|
+
const x = i.group.panels.map(({ id: g }) => g).join(",");
|
|
556
|
+
i.group.inMemoryLayouts[x] = S;
|
|
557
557
|
}
|
|
558
558
|
}
|
|
559
559
|
}), C({
|
|
560
560
|
cursorFlags: s,
|
|
561
|
-
mountedGroups:
|
|
561
|
+
mountedGroups: u
|
|
562
562
|
}), le();
|
|
563
563
|
}
|
|
564
|
-
function
|
|
564
|
+
function he(e) {
|
|
565
565
|
if (e.defaultPrevented)
|
|
566
566
|
return;
|
|
567
567
|
if (e.relatedTarget !== null)
|
|
@@ -572,7 +572,7 @@ function ve(e) {
|
|
|
572
572
|
switch (t.state) {
|
|
573
573
|
case "active":
|
|
574
574
|
t.hitRegions.forEach((o) => {
|
|
575
|
-
e.currentTarget === o.group.element &&
|
|
575
|
+
e.currentTarget === o.group.element && Me({
|
|
576
576
|
event: e,
|
|
577
577
|
hitRegions: t.hitRegions,
|
|
578
578
|
initialLayoutMap: t.initialLayoutMap,
|
|
@@ -581,7 +581,7 @@ function ve(e) {
|
|
|
581
581
|
});
|
|
582
582
|
}
|
|
583
583
|
}
|
|
584
|
-
function
|
|
584
|
+
function te(e) {
|
|
585
585
|
const t = e.parentElement;
|
|
586
586
|
z(t, "Parent group element not found");
|
|
587
587
|
const { mountedGroups: n } = O();
|
|
@@ -602,7 +602,7 @@ function $({
|
|
|
602
602
|
throw Error(
|
|
603
603
|
`Invalid ${t.length} panel layout: ${o.map((i) => `${i}%`).join(", ")}`
|
|
604
604
|
);
|
|
605
|
-
if (!
|
|
605
|
+
if (!L(r, 100) && o.length > 0)
|
|
606
606
|
for (let i = 0; i < t.length; i++) {
|
|
607
607
|
const a = o[i];
|
|
608
608
|
z(a != null, `No layout data found for index ${i}`);
|
|
@@ -619,21 +619,21 @@ function $({
|
|
|
619
619
|
});
|
|
620
620
|
a != l && (s += a - l, o[i] = l);
|
|
621
621
|
}
|
|
622
|
-
if (!
|
|
622
|
+
if (!L(s, 0))
|
|
623
623
|
for (let i = 0; i < t.length; i++) {
|
|
624
624
|
const a = o[i];
|
|
625
625
|
z(a != null, `No layout data found for index ${i}`);
|
|
626
|
-
const l = a + s,
|
|
626
|
+
const l = a + s, c = F({
|
|
627
627
|
panelConstraints: t[i],
|
|
628
628
|
size: l
|
|
629
629
|
});
|
|
630
|
-
if (a !==
|
|
630
|
+
if (a !== c && (s -= c - a, o[i] = c, L(s, 0)))
|
|
631
631
|
break;
|
|
632
632
|
}
|
|
633
|
-
const
|
|
634
|
-
return o.reduce((i, a, l) => (i[
|
|
633
|
+
const u = Object.keys(e);
|
|
634
|
+
return o.reduce((i, a, l) => (i[u[l]] = a, i), {});
|
|
635
635
|
}
|
|
636
|
-
function
|
|
636
|
+
function Ge({
|
|
637
637
|
groupId: e
|
|
638
638
|
}) {
|
|
639
639
|
const t = () => {
|
|
@@ -653,55 +653,55 @@ function Ie({
|
|
|
653
653
|
derivedPanelConstraints: o,
|
|
654
654
|
group: r,
|
|
655
655
|
layout: s,
|
|
656
|
-
separatorToPanels:
|
|
656
|
+
separatorToPanels: u
|
|
657
657
|
} = t(), i = $({
|
|
658
658
|
layout: n,
|
|
659
659
|
panelConstraints: o
|
|
660
660
|
});
|
|
661
|
-
return
|
|
661
|
+
return W(s, i) || C((a) => ({
|
|
662
662
|
mountedGroups: new Map(a.mountedGroups).set(r, {
|
|
663
663
|
derivedPanelConstraints: o,
|
|
664
664
|
layout: i,
|
|
665
|
-
separatorToPanels:
|
|
665
|
+
separatorToPanels: u
|
|
666
666
|
})
|
|
667
667
|
})), i;
|
|
668
668
|
}
|
|
669
669
|
};
|
|
670
670
|
}
|
|
671
|
-
function
|
|
671
|
+
function Ie(e) {
|
|
672
672
|
const { mountedGroups: t } = O(), n = t.get(e);
|
|
673
673
|
return z(n, `Mounted Group ${e.id} not found`), n;
|
|
674
674
|
}
|
|
675
675
|
function D(e, t) {
|
|
676
|
-
const n =
|
|
677
|
-
(
|
|
676
|
+
const n = te(e), o = Ie(n), r = n.separators.find(
|
|
677
|
+
(d) => d.element === e
|
|
678
678
|
);
|
|
679
679
|
z(r, "Matching separator not found");
|
|
680
680
|
const s = o.separatorToPanels.get(r);
|
|
681
681
|
z(s, "Matching panels not found");
|
|
682
|
-
const
|
|
682
|
+
const u = s.map((d) => n.panels.indexOf(d)), a = Ge({ groupId: n.id }).getLayout(), l = K({
|
|
683
683
|
delta: t,
|
|
684
684
|
initialLayout: a,
|
|
685
685
|
panelConstraints: o.derivedPanelConstraints,
|
|
686
|
-
pivotIndices:
|
|
686
|
+
pivotIndices: u,
|
|
687
687
|
prevLayout: a,
|
|
688
688
|
trigger: "keyboard"
|
|
689
|
-
}),
|
|
689
|
+
}), c = $({
|
|
690
690
|
layout: l,
|
|
691
691
|
panelConstraints: o.derivedPanelConstraints
|
|
692
692
|
});
|
|
693
|
-
|
|
694
|
-
mountedGroups: new Map(
|
|
693
|
+
W(a, c) || C((d) => ({
|
|
694
|
+
mountedGroups: new Map(d.mountedGroups).set(n, {
|
|
695
695
|
derivedPanelConstraints: o.derivedPanelConstraints,
|
|
696
|
-
layout:
|
|
696
|
+
layout: c,
|
|
697
697
|
separatorToPanels: o.separatorToPanels
|
|
698
698
|
})
|
|
699
699
|
}));
|
|
700
700
|
}
|
|
701
|
-
function
|
|
701
|
+
function ve(e) {
|
|
702
702
|
if (e.defaultPrevented)
|
|
703
703
|
return;
|
|
704
|
-
const t = e.currentTarget, n =
|
|
704
|
+
const t = e.currentTarget, n = te(t);
|
|
705
705
|
if (!n.disabled)
|
|
706
706
|
switch (e.key) {
|
|
707
707
|
case "ArrowDown": {
|
|
@@ -726,31 +726,31 @@ function ye(e) {
|
|
|
726
726
|
}
|
|
727
727
|
case "Enter": {
|
|
728
728
|
e.preventDefault();
|
|
729
|
-
const o =
|
|
730
|
-
(
|
|
729
|
+
const o = te(t), { derivedPanelConstraints: r, layout: s, separatorToPanels: u } = Ie(o), i = o.separators.find(
|
|
730
|
+
(d) => d.element === t
|
|
731
731
|
);
|
|
732
732
|
z(i, "Matching separator not found");
|
|
733
|
-
const a =
|
|
733
|
+
const a = u.get(i);
|
|
734
734
|
z(a, "Matching panels not found");
|
|
735
|
-
const l = a[0],
|
|
736
|
-
(
|
|
735
|
+
const l = a[0], c = r.find(
|
|
736
|
+
(d) => d.panelId === l.id
|
|
737
737
|
);
|
|
738
|
-
if (z(
|
|
739
|
-
const
|
|
740
|
-
D(t,
|
|
738
|
+
if (z(c, "Panel metadata not found"), c.collapsible) {
|
|
739
|
+
const d = s[l.id], m = c.collapsedSize === d ? o.inMemoryLastExpandedPanelSizes[l.id] ?? c.minSize : c.collapsedSize;
|
|
740
|
+
D(t, m - d);
|
|
741
741
|
}
|
|
742
742
|
break;
|
|
743
743
|
}
|
|
744
744
|
case "F6": {
|
|
745
745
|
e.preventDefault();
|
|
746
|
-
const r =
|
|
746
|
+
const r = te(t).separators.map(
|
|
747
747
|
(a) => a.element
|
|
748
748
|
), s = Array.from(r).findIndex(
|
|
749
749
|
(a) => a === e.currentTarget
|
|
750
750
|
);
|
|
751
751
|
z(s !== null, "Index not found");
|
|
752
|
-
const
|
|
753
|
-
r[
|
|
752
|
+
const u = e.shiftKey ? s > 0 ? s - 1 : r.length - 1 : s + 1 < r.length ? s + 1 : 0;
|
|
753
|
+
r[u].focus();
|
|
754
754
|
break;
|
|
755
755
|
}
|
|
756
756
|
case "Home": {
|
|
@@ -777,14 +777,14 @@ function nt(e, t, n) {
|
|
|
777
777
|
y: 1 / 0
|
|
778
778
|
};
|
|
779
779
|
for (const s of t) {
|
|
780
|
-
const
|
|
780
|
+
const u = tt(n, s.rect);
|
|
781
781
|
switch (e) {
|
|
782
782
|
case "horizontal": {
|
|
783
|
-
|
|
783
|
+
u.x <= r.x && (o = s, r = u);
|
|
784
784
|
break;
|
|
785
785
|
}
|
|
786
786
|
case "vertical": {
|
|
787
|
-
|
|
787
|
+
u.y <= r.y && (o = s, r = u);
|
|
788
788
|
break;
|
|
789
789
|
}
|
|
790
790
|
}
|
|
@@ -794,16 +794,16 @@ function nt(e, t, n) {
|
|
|
794
794
|
hitRegion: o
|
|
795
795
|
} : void 0;
|
|
796
796
|
}
|
|
797
|
-
let
|
|
797
|
+
let ee;
|
|
798
798
|
function ot() {
|
|
799
|
-
return
|
|
799
|
+
return ee === void 0 && (typeof matchMedia == "function" ? ee = !!matchMedia("(pointer:coarse)").matches : ee = !1), ee;
|
|
800
800
|
}
|
|
801
|
-
function
|
|
801
|
+
function ke(e, t) {
|
|
802
802
|
const n = [];
|
|
803
803
|
return t.forEach((o, r) => {
|
|
804
804
|
if (r.disabled)
|
|
805
805
|
return;
|
|
806
|
-
const s = ot() ?
|
|
806
|
+
const s = ot() ? me.coarse : me.precise, u = Le(r), i = nt(r.orientation, u, {
|
|
807
807
|
x: e.clientX,
|
|
808
808
|
y: e.clientY
|
|
809
809
|
});
|
|
@@ -813,24 +813,24 @@ function Oe(e, t) {
|
|
|
813
813
|
function ge(e) {
|
|
814
814
|
if (e.defaultPrevented)
|
|
815
815
|
return;
|
|
816
|
-
const { mountedGroups: t } = O(), n =
|
|
816
|
+
const { mountedGroups: t } = O(), n = ke(e, t), o = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), s = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Map();
|
|
817
817
|
let i = !1;
|
|
818
818
|
n.forEach((a) => {
|
|
819
|
-
o.add(a.group), a.panels.forEach((
|
|
820
|
-
r.add(
|
|
819
|
+
o.add(a.group), a.panels.forEach((c) => {
|
|
820
|
+
r.add(c);
|
|
821
821
|
}), a.separator && (s.add(a.separator), i || (i = !0, a.separator.element.focus()));
|
|
822
822
|
const l = t.get(a.group);
|
|
823
|
-
l &&
|
|
823
|
+
l && u.set(a.group, l.layout);
|
|
824
824
|
}), C({
|
|
825
825
|
interactionState: {
|
|
826
826
|
hitRegions: n,
|
|
827
|
-
initialLayoutMap:
|
|
827
|
+
initialLayoutMap: u,
|
|
828
828
|
pointerDownAtPoint: { x: e.clientX, y: e.clientY },
|
|
829
829
|
state: "active"
|
|
830
830
|
}
|
|
831
831
|
}), n.length && e.preventDefault();
|
|
832
832
|
}
|
|
833
|
-
function
|
|
833
|
+
function ye(e) {
|
|
834
834
|
if (e.defaultPrevented)
|
|
835
835
|
return;
|
|
836
836
|
const { interactionState: t, mountedGroups: n } = O();
|
|
@@ -850,7 +850,7 @@ function Se(e) {
|
|
|
850
850
|
);
|
|
851
851
|
return;
|
|
852
852
|
}
|
|
853
|
-
|
|
853
|
+
Me({
|
|
854
854
|
event: e,
|
|
855
855
|
hitRegions: t.hitRegions,
|
|
856
856
|
initialLayoutMap: t.initialLayoutMap,
|
|
@@ -860,7 +860,7 @@ function Se(e) {
|
|
|
860
860
|
break;
|
|
861
861
|
}
|
|
862
862
|
default: {
|
|
863
|
-
const o =
|
|
863
|
+
const o = ke(e, n);
|
|
864
864
|
o.length === 0 ? t.state !== "inactive" && C({
|
|
865
865
|
interactionState: { state: "inactive" }
|
|
866
866
|
}) : C({
|
|
@@ -873,7 +873,7 @@ function Se(e) {
|
|
|
873
873
|
}
|
|
874
874
|
}
|
|
875
875
|
}
|
|
876
|
-
function
|
|
876
|
+
function Se(e) {
|
|
877
877
|
if (e.defaultPrevented)
|
|
878
878
|
return;
|
|
879
879
|
e.preventDefault();
|
|
@@ -888,32 +888,32 @@ function xe(e) {
|
|
|
888
888
|
}), le();
|
|
889
889
|
}
|
|
890
890
|
}
|
|
891
|
-
function
|
|
891
|
+
function xe(e) {
|
|
892
892
|
let t = 0, n = 0;
|
|
893
893
|
const o = {};
|
|
894
894
|
for (const s of e)
|
|
895
895
|
if (s.defaultSize !== void 0) {
|
|
896
896
|
t++;
|
|
897
|
-
const
|
|
898
|
-
n +=
|
|
897
|
+
const u = I(s.defaultSize);
|
|
898
|
+
n += u, o[s.panelId] = u;
|
|
899
899
|
} else
|
|
900
900
|
o[s.panelId] = void 0;
|
|
901
901
|
const r = e.length - t;
|
|
902
902
|
if (r !== 0) {
|
|
903
903
|
const s = I((100 - n) / r);
|
|
904
|
-
for (const
|
|
905
|
-
|
|
904
|
+
for (const u of e)
|
|
905
|
+
u.defaultSize === void 0 && (o[u.panelId] = s);
|
|
906
906
|
}
|
|
907
907
|
return o;
|
|
908
908
|
}
|
|
909
|
-
function
|
|
909
|
+
function it(e, t, n) {
|
|
910
910
|
const o = n[0];
|
|
911
911
|
if (!o)
|
|
912
912
|
return;
|
|
913
|
-
const r = e.panels.find((
|
|
913
|
+
const r = e.panels.find((u) => u.element === t);
|
|
914
914
|
if (!r || !r.onResize)
|
|
915
915
|
return;
|
|
916
|
-
const s =
|
|
916
|
+
const s = H({ group: e });
|
|
917
917
|
r.onResize(
|
|
918
918
|
{
|
|
919
919
|
asPercentage: I(
|
|
@@ -930,75 +930,83 @@ function rt(e) {
|
|
|
930
930
|
e.separators.length === 0 || e.separators.length < e.panels.length,
|
|
931
931
|
"Invalid Group configuration; too many Separator components"
|
|
932
932
|
);
|
|
933
|
-
const n = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Set(), r = new ResizeObserver((
|
|
934
|
-
for (const
|
|
935
|
-
const { borderBoxSize:
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
933
|
+
const n = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Set(), r = new ResizeObserver((m) => {
|
|
934
|
+
for (const v of m) {
|
|
935
|
+
const { borderBoxSize: f, target: p } = v;
|
|
936
|
+
if (p === e.element) {
|
|
937
|
+
if (t) {
|
|
938
|
+
if (H({ group: e }) === 0)
|
|
939
|
+
return;
|
|
940
|
+
C((h) => {
|
|
941
|
+
const S = h.mountedGroups.get(e);
|
|
942
|
+
if (S) {
|
|
943
|
+
const x = pe(e), g = S.defaultLayoutDeferred ? xe(x) : S.layout, w = $({
|
|
944
|
+
layout: g,
|
|
945
|
+
panelConstraints: x
|
|
946
|
+
});
|
|
947
|
+
return !S.defaultLayoutDeferred && W(g, w) ? h : {
|
|
948
|
+
mountedGroups: new Map(h.mountedGroups).set(e, {
|
|
949
|
+
derivedPanelConstraints: x,
|
|
950
|
+
layout: w,
|
|
951
|
+
separatorToPanels: S.separatorToPanels
|
|
952
|
+
})
|
|
953
|
+
};
|
|
954
|
+
}
|
|
955
|
+
return h;
|
|
942
956
|
});
|
|
943
|
-
return {
|
|
944
|
-
mountedGroups: new Map(p.mountedGroups).set(e, {
|
|
945
|
-
derivedPanelConstraints: m,
|
|
946
|
-
layout: S,
|
|
947
|
-
separatorToPanels: v.separatorToPanels
|
|
948
|
-
})
|
|
949
|
-
};
|
|
950
957
|
}
|
|
951
|
-
|
|
952
|
-
|
|
958
|
+
} else
|
|
959
|
+
it(e, p, f);
|
|
953
960
|
}
|
|
954
961
|
});
|
|
955
|
-
r.observe(e.element), e.panels.forEach((
|
|
962
|
+
r.observe(e.element), e.panels.forEach((m) => {
|
|
956
963
|
z(
|
|
957
|
-
!n.has(
|
|
958
|
-
`Panel ids must be unique; id "${
|
|
959
|
-
), n.add(
|
|
964
|
+
!n.has(m.id),
|
|
965
|
+
`Panel ids must be unique; id "${m.id}" was used more than once`
|
|
966
|
+
), n.add(m.id), m.onResize && r.observe(m.element);
|
|
960
967
|
});
|
|
961
|
-
const s =
|
|
962
|
-
layout:
|
|
963
|
-
panelConstraints:
|
|
964
|
-
}),
|
|
965
|
-
mountedGroups: new Map(
|
|
966
|
-
|
|
967
|
-
|
|
968
|
+
const s = H({ group: e }), u = pe(e), i = e.panels.map(({ id: m }) => m).join(","), a = e.inMemoryLayouts[i] ?? e.defaultLayout ?? xe(u), l = $({
|
|
969
|
+
layout: a,
|
|
970
|
+
panelConstraints: u
|
|
971
|
+
}), c = Le(e), d = C((m) => ({
|
|
972
|
+
mountedGroups: new Map(m.mountedGroups).set(e, {
|
|
973
|
+
defaultLayoutDeferred: s === 0,
|
|
974
|
+
derivedPanelConstraints: u,
|
|
975
|
+
layout: l,
|
|
968
976
|
separatorToPanels: new Map(
|
|
969
|
-
|
|
977
|
+
c.filter((v) => v.separator).map((v) => [v.separator, v.panels])
|
|
970
978
|
)
|
|
971
979
|
})
|
|
972
980
|
}));
|
|
973
|
-
return e.element.addEventListener("pointerleave",
|
|
981
|
+
return e.element.addEventListener("pointerleave", he), e.separators.forEach((m) => {
|
|
974
982
|
z(
|
|
975
|
-
!o.has(
|
|
976
|
-
`Separator ids must be unique; id "${
|
|
977
|
-
), o.add(
|
|
978
|
-
}),
|
|
983
|
+
!o.has(m.id),
|
|
984
|
+
`Separator ids must be unique; id "${m.id}" was used more than once`
|
|
985
|
+
), o.add(m.id), m.element.addEventListener("keydown", ve);
|
|
986
|
+
}), d.mountedGroups.size === 1 && (window.addEventListener("pointerdown", ge), window.addEventListener("pointermove", ye), window.addEventListener("pointerup", Se)), function() {
|
|
979
987
|
t = !1;
|
|
980
|
-
const
|
|
981
|
-
const
|
|
982
|
-
return
|
|
988
|
+
const v = C((f) => {
|
|
989
|
+
const p = new Map(f.mountedGroups);
|
|
990
|
+
return p.delete(e), { mountedGroups: p };
|
|
983
991
|
});
|
|
984
|
-
e.element.removeEventListener("pointerleave",
|
|
985
|
-
|
|
986
|
-
}),
|
|
992
|
+
e.element.removeEventListener("pointerleave", he), e.separators.forEach((f) => {
|
|
993
|
+
f.element.removeEventListener("keydown", ve);
|
|
994
|
+
}), v.mountedGroups.size === 0 && (window.removeEventListener("pointerdown", ge), window.removeEventListener("pointermove", ye), window.removeEventListener("pointerup", Se)), r.disconnect();
|
|
987
995
|
};
|
|
988
996
|
}
|
|
989
|
-
function
|
|
990
|
-
const t =
|
|
997
|
+
function ue(e) {
|
|
998
|
+
const t = Ne();
|
|
991
999
|
return `${e ?? t}`;
|
|
992
1000
|
}
|
|
993
|
-
const
|
|
994
|
-
function
|
|
1001
|
+
const j = typeof window < "u" ? _e : Fe;
|
|
1002
|
+
function ce(e) {
|
|
995
1003
|
const t = T(e);
|
|
996
|
-
return
|
|
1004
|
+
return j(() => {
|
|
997
1005
|
t.current = e;
|
|
998
1006
|
}, [e]), ze((n) => t.current?.(n), [t]);
|
|
999
1007
|
}
|
|
1000
1008
|
function fe(...e) {
|
|
1001
|
-
return
|
|
1009
|
+
return ce((t) => {
|
|
1002
1010
|
e.forEach((n) => {
|
|
1003
1011
|
if (n)
|
|
1004
1012
|
switch (typeof n) {
|
|
@@ -1014,151 +1022,134 @@ function fe(...e) {
|
|
|
1014
1022
|
});
|
|
1015
1023
|
});
|
|
1016
1024
|
}
|
|
1017
|
-
const
|
|
1018
|
-
function
|
|
1025
|
+
const Oe = "--react-resizable-panels--panel--pointer-events";
|
|
1026
|
+
function Te(e, t) {
|
|
1019
1027
|
const n = e.replace(/[^a-zA-Z0-9\-_]/g, ""), o = t.replace(/[^a-zA-Z0-9\-_]/g, "");
|
|
1020
1028
|
return `--react-resizable-panels--${n}--${o}`;
|
|
1021
1029
|
}
|
|
1022
|
-
const
|
|
1023
|
-
function
|
|
1030
|
+
const De = He(null);
|
|
1031
|
+
function st(e, t) {
|
|
1024
1032
|
const n = T({
|
|
1025
1033
|
getLayout: () => ({}),
|
|
1026
1034
|
setLayout: Je
|
|
1027
1035
|
});
|
|
1028
|
-
be(t, () => n.current, []),
|
|
1036
|
+
be(t, () => n.current, []), j(() => {
|
|
1029
1037
|
Object.assign(
|
|
1030
1038
|
n.current,
|
|
1031
|
-
|
|
1039
|
+
Ge({ groupId: e })
|
|
1032
1040
|
);
|
|
1033
1041
|
});
|
|
1034
1042
|
}
|
|
1035
|
-
function
|
|
1036
|
-
return we(
|
|
1037
|
-
(t) => (e?.addEventListener(
|
|
1038
|
-
"contentvisibilityautostatechange",
|
|
1039
|
-
t
|
|
1040
|
-
), () => {
|
|
1041
|
-
e?.removeEventListener(
|
|
1042
|
-
"contentvisibilityautostatechange",
|
|
1043
|
-
t
|
|
1044
|
-
);
|
|
1045
|
-
}),
|
|
1046
|
-
() => typeof e?.checkVisibility == "function" ? e.checkVisibility() : !0,
|
|
1047
|
-
() => !0
|
|
1048
|
-
);
|
|
1049
|
-
}
|
|
1050
|
-
function yt({
|
|
1043
|
+
function ht({
|
|
1051
1044
|
children: e,
|
|
1052
1045
|
className: t,
|
|
1053
1046
|
defaultLayout: n,
|
|
1054
1047
|
disableCursor: o,
|
|
1055
1048
|
disabled: r,
|
|
1056
1049
|
elementRef: s,
|
|
1057
|
-
groupRef:
|
|
1050
|
+
groupRef: u,
|
|
1058
1051
|
id: i,
|
|
1059
1052
|
onLayoutChange: a,
|
|
1060
1053
|
orientation: l = "horizontal",
|
|
1061
|
-
style:
|
|
1062
|
-
...
|
|
1054
|
+
style: c,
|
|
1055
|
+
...d
|
|
1063
1056
|
}) {
|
|
1064
|
-
const
|
|
1065
|
-
|
|
1066
|
-
}),
|
|
1067
|
-
|
|
1068
|
-
const
|
|
1057
|
+
const m = T({}), v = ce((b) => {
|
|
1058
|
+
W(m.current, b) || (m.current = b, a?.(b));
|
|
1059
|
+
}), f = ue(i), [p, y] = G(!1), [h, S] = G(null), [x, g] = G(n ?? {}), [w, P] = G([]), [E, V] = G([]), ne = T({}), X = T({}), Y = fe(S, s);
|
|
1060
|
+
st(f, u);
|
|
1061
|
+
const q = we(
|
|
1069
1062
|
() => ({
|
|
1070
|
-
id:
|
|
1063
|
+
id: f,
|
|
1071
1064
|
orientation: l,
|
|
1072
|
-
registerPanel: (b) => (P((M) =>
|
|
1065
|
+
registerPanel: (b) => (P((M) => se(l, [...M, b])), () => {
|
|
1073
1066
|
P((M) => M.filter((N) => N !== b));
|
|
1074
1067
|
}),
|
|
1075
|
-
registerSeparator: (b) => (
|
|
1076
|
-
(M) =>
|
|
1068
|
+
registerSeparator: (b) => (V(
|
|
1069
|
+
(M) => se(l, [...M, b])
|
|
1077
1070
|
), () => {
|
|
1078
|
-
|
|
1071
|
+
V(
|
|
1079
1072
|
(M) => M.filter((N) => N !== b)
|
|
1080
1073
|
);
|
|
1081
1074
|
})
|
|
1082
1075
|
}),
|
|
1083
|
-
[
|
|
1076
|
+
[f, l]
|
|
1084
1077
|
);
|
|
1085
|
-
|
|
1086
|
-
if (
|
|
1078
|
+
j(() => {
|
|
1079
|
+
if (h === null || w.length === 0)
|
|
1087
1080
|
return;
|
|
1088
1081
|
const b = {
|
|
1089
1082
|
defaultLayout: n,
|
|
1090
1083
|
disableCursor: !!o,
|
|
1091
1084
|
disabled: !!r,
|
|
1092
|
-
element:
|
|
1093
|
-
id:
|
|
1094
|
-
inMemoryLastExpandedPanelSizes:
|
|
1085
|
+
element: h,
|
|
1086
|
+
id: f,
|
|
1087
|
+
inMemoryLastExpandedPanelSizes: ne.current,
|
|
1095
1088
|
inMemoryLayouts: X.current,
|
|
1096
1089
|
orientation: l,
|
|
1097
|
-
panels:
|
|
1090
|
+
panels: w,
|
|
1098
1091
|
separators: E
|
|
1099
1092
|
}, M = rt(b), oe = O().mountedGroups.get(b);
|
|
1100
|
-
oe && (g(oe.layout),
|
|
1101
|
-
const
|
|
1093
|
+
oe && (g(oe.layout), v?.(oe.layout));
|
|
1094
|
+
const Ae = A.addListener(
|
|
1102
1095
|
"interactionStateChange",
|
|
1103
|
-
(
|
|
1104
|
-
switch (
|
|
1096
|
+
(J) => {
|
|
1097
|
+
switch (J.state) {
|
|
1105
1098
|
case "active": {
|
|
1106
|
-
|
|
1107
|
-
|
|
1099
|
+
y(
|
|
1100
|
+
J.hitRegions.some(
|
|
1108
1101
|
(_) => _.group === b
|
|
1109
1102
|
)
|
|
1110
1103
|
);
|
|
1111
1104
|
break;
|
|
1112
1105
|
}
|
|
1113
1106
|
default: {
|
|
1114
|
-
|
|
1107
|
+
y(!1);
|
|
1115
1108
|
break;
|
|
1116
1109
|
}
|
|
1117
1110
|
}
|
|
1118
1111
|
}
|
|
1119
|
-
),
|
|
1112
|
+
), $e = A.addListener(
|
|
1120
1113
|
"mountedGroupsChange",
|
|
1121
|
-
(
|
|
1122
|
-
const _ =
|
|
1123
|
-
_ && _.derivedPanelConstraints.length > 0 && (g(_.layout),
|
|
1114
|
+
(J) => {
|
|
1115
|
+
const _ = J.get(b);
|
|
1116
|
+
_ && _.derivedPanelConstraints.length > 0 && (g(_.layout), v?.(_.layout));
|
|
1124
1117
|
}
|
|
1125
1118
|
);
|
|
1126
1119
|
return () => {
|
|
1127
|
-
M(),
|
|
1120
|
+
M(), Ae(), $e();
|
|
1128
1121
|
};
|
|
1129
1122
|
}, [
|
|
1130
1123
|
n,
|
|
1131
1124
|
o,
|
|
1132
1125
|
r,
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
y,
|
|
1126
|
+
h,
|
|
1127
|
+
f,
|
|
1128
|
+
v,
|
|
1137
1129
|
l,
|
|
1138
|
-
|
|
1130
|
+
w,
|
|
1139
1131
|
E
|
|
1140
1132
|
]);
|
|
1141
|
-
const
|
|
1142
|
-
[
|
|
1133
|
+
const Z = {
|
|
1134
|
+
[Oe]: p ? "none" : void 0
|
|
1143
1135
|
};
|
|
1144
|
-
for (const b in
|
|
1145
|
-
const M =
|
|
1146
|
-
|
|
1136
|
+
for (const b in x) {
|
|
1137
|
+
const M = Te(f, b), N = x[b];
|
|
1138
|
+
Z[M] = N;
|
|
1147
1139
|
}
|
|
1148
|
-
return /* @__PURE__ */
|
|
1140
|
+
return /* @__PURE__ */ B(De.Provider, { value: q, children: /* @__PURE__ */ B(
|
|
1149
1141
|
"div",
|
|
1150
1142
|
{
|
|
1151
|
-
...
|
|
1143
|
+
...d,
|
|
1152
1144
|
"aria-orientation": l,
|
|
1153
1145
|
className: t,
|
|
1154
1146
|
"data-group": !0,
|
|
1155
|
-
"data-testid":
|
|
1156
|
-
id:
|
|
1147
|
+
"data-testid": f,
|
|
1148
|
+
id: f,
|
|
1157
1149
|
ref: Y,
|
|
1158
1150
|
style: {
|
|
1159
|
-
...
|
|
1160
|
-
...
|
|
1161
|
-
contentVisibility: "auto",
|
|
1151
|
+
...c,
|
|
1152
|
+
...Z,
|
|
1162
1153
|
display: "flex",
|
|
1163
1154
|
flexDirection: l === "horizontal" ? "row" : "column",
|
|
1164
1155
|
flexWrap: "nowrap"
|
|
@@ -1170,7 +1161,7 @@ function yt({
|
|
|
1170
1161
|
function ae(e) {
|
|
1171
1162
|
return `react-resizable-panels:${e}`;
|
|
1172
1163
|
}
|
|
1173
|
-
function
|
|
1164
|
+
function at({
|
|
1174
1165
|
id: e,
|
|
1175
1166
|
layout: t,
|
|
1176
1167
|
storage: n
|
|
@@ -1182,19 +1173,19 @@ function ct({
|
|
|
1182
1173
|
console.error(o);
|
|
1183
1174
|
}
|
|
1184
1175
|
}
|
|
1185
|
-
function
|
|
1176
|
+
function vt({
|
|
1186
1177
|
groupId: e,
|
|
1187
1178
|
storage: t
|
|
1188
1179
|
}) {
|
|
1189
|
-
const n =
|
|
1190
|
-
|
|
1180
|
+
const n = We(
|
|
1181
|
+
lt,
|
|
1191
1182
|
() => t.getItem(ae(e)),
|
|
1192
1183
|
() => t.getItem(ae(e))
|
|
1193
|
-
), o =
|
|
1184
|
+
), o = we(
|
|
1194
1185
|
() => n ? JSON.parse(n) : void 0,
|
|
1195
1186
|
[n]
|
|
1196
1187
|
), r = ze(
|
|
1197
|
-
(s) =>
|
|
1188
|
+
(s) => at({
|
|
1198
1189
|
id: e,
|
|
1199
1190
|
layout: s,
|
|
1200
1191
|
storage: t
|
|
@@ -1206,24 +1197,24 @@ function gt({
|
|
|
1206
1197
|
onLayoutChange: r
|
|
1207
1198
|
};
|
|
1208
1199
|
}
|
|
1209
|
-
function
|
|
1200
|
+
function lt() {
|
|
1210
1201
|
return function() {
|
|
1211
1202
|
};
|
|
1212
1203
|
}
|
|
1213
|
-
function
|
|
1204
|
+
function gt() {
|
|
1214
1205
|
return G(null);
|
|
1215
1206
|
}
|
|
1216
|
-
function
|
|
1207
|
+
function yt() {
|
|
1217
1208
|
return T(null);
|
|
1218
1209
|
}
|
|
1219
1210
|
function de() {
|
|
1220
|
-
const e = je(
|
|
1211
|
+
const e = je(De);
|
|
1221
1212
|
return z(
|
|
1222
1213
|
e,
|
|
1223
1214
|
"Group Context not found; did you render a Panel or Separator outside of a Group?"
|
|
1224
1215
|
), e;
|
|
1225
1216
|
}
|
|
1226
|
-
function
|
|
1217
|
+
function ut({
|
|
1227
1218
|
groupId: e,
|
|
1228
1219
|
panelId: t
|
|
1229
1220
|
}) {
|
|
@@ -1231,10 +1222,10 @@ function ft({
|
|
|
1231
1222
|
const { mountedGroups: i } = O();
|
|
1232
1223
|
for (const [
|
|
1233
1224
|
a,
|
|
1234
|
-
{ derivedPanelConstraints: l, layout:
|
|
1225
|
+
{ derivedPanelConstraints: l, layout: c, separatorToPanels: d }
|
|
1235
1226
|
] of i)
|
|
1236
1227
|
if (a.id === e)
|
|
1237
|
-
return { derivedPanelConstraints: l, group: a, layout:
|
|
1228
|
+
return { derivedPanelConstraints: l, group: a, layout: c, separatorToPanels: d };
|
|
1238
1229
|
throw Error(`Group ${e} not found`);
|
|
1239
1230
|
}, o = () => {
|
|
1240
1231
|
const i = n().derivedPanelConstraints.find(
|
|
@@ -1253,61 +1244,61 @@ function ft({
|
|
|
1253
1244
|
if (i !== void 0)
|
|
1254
1245
|
return i;
|
|
1255
1246
|
throw Error(`Layout not found for Panel ${t}`);
|
|
1256
|
-
},
|
|
1247
|
+
}, u = (i) => {
|
|
1257
1248
|
const a = s();
|
|
1258
1249
|
if (i === a)
|
|
1259
1250
|
return;
|
|
1260
1251
|
const {
|
|
1261
1252
|
derivedPanelConstraints: l,
|
|
1262
|
-
group:
|
|
1263
|
-
layout:
|
|
1264
|
-
separatorToPanels:
|
|
1265
|
-
} = n(),
|
|
1266
|
-
delta:
|
|
1267
|
-
initialLayout:
|
|
1253
|
+
group: c,
|
|
1254
|
+
layout: d,
|
|
1255
|
+
separatorToPanels: m
|
|
1256
|
+
} = n(), v = c.panels.findIndex((h) => h.id === t), f = v === c.panels.length - 1, p = K({
|
|
1257
|
+
delta: f ? a - i : i - a,
|
|
1258
|
+
initialLayout: d,
|
|
1268
1259
|
panelConstraints: l,
|
|
1269
|
-
pivotIndices:
|
|
1270
|
-
prevLayout:
|
|
1260
|
+
pivotIndices: f ? [v - 1, v] : [v, v + 1],
|
|
1261
|
+
prevLayout: d,
|
|
1271
1262
|
trigger: "imperative-api"
|
|
1272
|
-
}),
|
|
1263
|
+
}), y = $({
|
|
1273
1264
|
layout: p,
|
|
1274
1265
|
panelConstraints: l
|
|
1275
1266
|
});
|
|
1276
|
-
|
|
1277
|
-
mountedGroups: new Map(
|
|
1267
|
+
W(d, y) || C((h) => ({
|
|
1268
|
+
mountedGroups: new Map(h.mountedGroups).set(c, {
|
|
1278
1269
|
derivedPanelConstraints: l,
|
|
1279
|
-
layout:
|
|
1280
|
-
separatorToPanels:
|
|
1270
|
+
layout: y,
|
|
1271
|
+
separatorToPanels: m
|
|
1281
1272
|
})
|
|
1282
1273
|
}));
|
|
1283
1274
|
};
|
|
1284
1275
|
return {
|
|
1285
1276
|
collapse: () => {
|
|
1286
1277
|
const { collapsible: i, collapsedSize: a } = o(), l = s();
|
|
1287
|
-
i && l !== a &&
|
|
1278
|
+
i && l !== a && u(a);
|
|
1288
1279
|
},
|
|
1289
1280
|
expand: () => {
|
|
1290
|
-
const { collapsible: i, collapsedSize: a, minSize: l } = o(),
|
|
1291
|
-
i &&
|
|
1281
|
+
const { collapsible: i, collapsedSize: a, minSize: l } = o(), c = s();
|
|
1282
|
+
i && c === a && u(l);
|
|
1292
1283
|
},
|
|
1293
1284
|
getSize: () => {
|
|
1294
|
-
const { group: i } = n(), a = s(), { element: l } = r(),
|
|
1285
|
+
const { group: i } = n(), a = s(), { element: l } = r(), c = i.orientation === "horizontal" ? l.offsetWidth : l.offsetHeight;
|
|
1295
1286
|
return {
|
|
1296
1287
|
asPercentage: a,
|
|
1297
|
-
inPixels:
|
|
1288
|
+
inPixels: c
|
|
1298
1289
|
};
|
|
1299
1290
|
},
|
|
1300
1291
|
isCollapsed: () => {
|
|
1301
1292
|
const { collapsible: i, collapsedSize: a } = o(), l = s();
|
|
1302
|
-
return i &&
|
|
1293
|
+
return i && L(a, l);
|
|
1303
1294
|
},
|
|
1304
1295
|
resize: (i) => {
|
|
1305
1296
|
if (s() !== i) {
|
|
1306
1297
|
let l;
|
|
1307
1298
|
switch (typeof i) {
|
|
1308
1299
|
case "number": {
|
|
1309
|
-
const { group:
|
|
1310
|
-
l = I(i /
|
|
1300
|
+
const { group: c } = n(), d = H({ group: c });
|
|
1301
|
+
l = I(i / d * 100);
|
|
1311
1302
|
break;
|
|
1312
1303
|
}
|
|
1313
1304
|
case "string": {
|
|
@@ -1315,12 +1306,12 @@ function ft({
|
|
|
1315
1306
|
break;
|
|
1316
1307
|
}
|
|
1317
1308
|
}
|
|
1318
|
-
|
|
1309
|
+
u(l);
|
|
1319
1310
|
}
|
|
1320
1311
|
}
|
|
1321
1312
|
};
|
|
1322
1313
|
}
|
|
1323
|
-
function
|
|
1314
|
+
function ct(e, t) {
|
|
1324
1315
|
const { id: n } = de(), o = T({
|
|
1325
1316
|
collapse: ie,
|
|
1326
1317
|
expand: ie,
|
|
@@ -1331,38 +1322,38 @@ function dt(e, t) {
|
|
|
1331
1322
|
isCollapsed: () => !1,
|
|
1332
1323
|
resize: ie
|
|
1333
1324
|
});
|
|
1334
|
-
be(t, () => o.current, []),
|
|
1325
|
+
be(t, () => o.current, []), j(() => {
|
|
1335
1326
|
Object.assign(
|
|
1336
1327
|
o.current,
|
|
1337
|
-
|
|
1328
|
+
ut({ groupId: n, panelId: e })
|
|
1338
1329
|
);
|
|
1339
1330
|
});
|
|
1340
1331
|
}
|
|
1341
|
-
function
|
|
1332
|
+
function St({
|
|
1342
1333
|
children: e,
|
|
1343
1334
|
className: t,
|
|
1344
1335
|
collapsedSize: n = "0%",
|
|
1345
1336
|
collapsible: o = !1,
|
|
1346
1337
|
defaultSize: r,
|
|
1347
1338
|
elementRef: s,
|
|
1348
|
-
id:
|
|
1339
|
+
id: u,
|
|
1349
1340
|
maxSize: i = "100%",
|
|
1350
1341
|
minSize: a = "0%",
|
|
1351
1342
|
onResize: l,
|
|
1352
|
-
panelRef:
|
|
1353
|
-
style:
|
|
1354
|
-
...
|
|
1343
|
+
panelRef: c,
|
|
1344
|
+
style: d,
|
|
1345
|
+
...m
|
|
1355
1346
|
}) {
|
|
1356
|
-
const
|
|
1357
|
-
l?.(E,
|
|
1347
|
+
const v = !!u, f = ue(u), [p, y] = G(null), h = fe(y, s), { id: S, registerPanel: x } = de(), g = l !== null, w = ce((E) => {
|
|
1348
|
+
l?.(E, u);
|
|
1358
1349
|
});
|
|
1359
|
-
|
|
1350
|
+
j(() => {
|
|
1360
1351
|
if (p !== null)
|
|
1361
|
-
return
|
|
1352
|
+
return x({
|
|
1362
1353
|
element: p,
|
|
1363
|
-
id:
|
|
1364
|
-
idIsStable:
|
|
1365
|
-
onResize: g ?
|
|
1354
|
+
id: f,
|
|
1355
|
+
idIsStable: v,
|
|
1356
|
+
onResize: g ? w : void 0,
|
|
1366
1357
|
panelConstraints: {
|
|
1367
1358
|
collapsedSize: n,
|
|
1368
1359
|
collapsible: o,
|
|
@@ -1377,24 +1368,24 @@ function zt({
|
|
|
1377
1368
|
r,
|
|
1378
1369
|
p,
|
|
1379
1370
|
g,
|
|
1380
|
-
|
|
1381
|
-
|
|
1371
|
+
f,
|
|
1372
|
+
v,
|
|
1382
1373
|
i,
|
|
1383
1374
|
a,
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
]),
|
|
1387
|
-
const P =
|
|
1388
|
-
return /* @__PURE__ */
|
|
1375
|
+
w,
|
|
1376
|
+
x
|
|
1377
|
+
]), ct(f, c);
|
|
1378
|
+
const P = Te(S, f);
|
|
1379
|
+
return /* @__PURE__ */ B(
|
|
1389
1380
|
"div",
|
|
1390
1381
|
{
|
|
1391
|
-
...
|
|
1382
|
+
...m,
|
|
1392
1383
|
"data-panel": !0,
|
|
1393
|
-
"data-testid":
|
|
1394
|
-
id:
|
|
1395
|
-
ref:
|
|
1384
|
+
"data-testid": f,
|
|
1385
|
+
id: f,
|
|
1386
|
+
ref: h,
|
|
1396
1387
|
style: {
|
|
1397
|
-
...
|
|
1388
|
+
...ft,
|
|
1398
1389
|
flexBasis: 0,
|
|
1399
1390
|
flexGrow: `var(${P}, 1)`,
|
|
1400
1391
|
flexShrink: 1,
|
|
@@ -1402,16 +1393,16 @@ function zt({
|
|
|
1402
1393
|
overflow: "hidden",
|
|
1403
1394
|
// Disable pointer events inside of a panel during resize
|
|
1404
1395
|
// This avoid edge cases like nested iframes
|
|
1405
|
-
pointerEvents: `var(${
|
|
1396
|
+
pointerEvents: `var(${Oe})`
|
|
1406
1397
|
},
|
|
1407
|
-
children: /* @__PURE__ */
|
|
1398
|
+
children: /* @__PURE__ */ B(
|
|
1408
1399
|
"div",
|
|
1409
1400
|
{
|
|
1410
1401
|
className: t,
|
|
1411
1402
|
style: {
|
|
1412
1403
|
width: "100%",
|
|
1413
1404
|
height: "100%",
|
|
1414
|
-
...
|
|
1405
|
+
...d
|
|
1415
1406
|
},
|
|
1416
1407
|
children: e
|
|
1417
1408
|
}
|
|
@@ -1419,7 +1410,7 @@ function zt({
|
|
|
1419
1410
|
}
|
|
1420
1411
|
);
|
|
1421
1412
|
}
|
|
1422
|
-
const
|
|
1413
|
+
const ft = {
|
|
1423
1414
|
minHeight: "unset",
|
|
1424
1415
|
maxHeight: "unset",
|
|
1425
1416
|
height: "unset",
|
|
@@ -1435,40 +1426,40 @@ const pt = {
|
|
|
1435
1426
|
padding: "unset",
|
|
1436
1427
|
margin: "unset"
|
|
1437
1428
|
};
|
|
1438
|
-
function
|
|
1429
|
+
function xt() {
|
|
1439
1430
|
return G(null);
|
|
1440
1431
|
}
|
|
1441
|
-
function
|
|
1432
|
+
function zt() {
|
|
1442
1433
|
return T(null);
|
|
1443
1434
|
}
|
|
1444
|
-
function
|
|
1435
|
+
function dt({
|
|
1445
1436
|
layout: e,
|
|
1446
1437
|
panelConstraints: t,
|
|
1447
1438
|
panelId: n,
|
|
1448
1439
|
panelIndex: o
|
|
1449
1440
|
}) {
|
|
1450
1441
|
let r, s;
|
|
1451
|
-
const
|
|
1442
|
+
const u = e[n], i = t.find(
|
|
1452
1443
|
(a) => a.panelId === n
|
|
1453
1444
|
);
|
|
1454
1445
|
if (i) {
|
|
1455
|
-
const a = i.maxSize, l = s = i.collapsible ? i.collapsedSize : i.minSize,
|
|
1446
|
+
const a = i.maxSize, l = s = i.collapsible ? i.collapsedSize : i.minSize, c = [o, o + 1];
|
|
1456
1447
|
s = $({
|
|
1457
|
-
layout:
|
|
1458
|
-
delta: l -
|
|
1448
|
+
layout: K({
|
|
1449
|
+
delta: l - u,
|
|
1459
1450
|
initialLayout: e,
|
|
1460
1451
|
panelConstraints: t,
|
|
1461
|
-
pivotIndices:
|
|
1452
|
+
pivotIndices: c,
|
|
1462
1453
|
prevLayout: e,
|
|
1463
1454
|
trigger: "keyboard"
|
|
1464
1455
|
}),
|
|
1465
1456
|
panelConstraints: t
|
|
1466
1457
|
})[n], r = $({
|
|
1467
|
-
layout:
|
|
1468
|
-
delta: a -
|
|
1458
|
+
layout: K({
|
|
1459
|
+
delta: a - u,
|
|
1469
1460
|
initialLayout: e,
|
|
1470
1461
|
panelConstraints: t,
|
|
1471
|
-
pivotIndices:
|
|
1462
|
+
pivotIndices: c,
|
|
1472
1463
|
prevLayout: e,
|
|
1473
1464
|
trigger: "keyboard"
|
|
1474
1465
|
}),
|
|
@@ -1479,10 +1470,10 @@ function mt({
|
|
|
1479
1470
|
valueControls: n,
|
|
1480
1471
|
valueMax: r,
|
|
1481
1472
|
valueMin: s,
|
|
1482
|
-
valueNow:
|
|
1473
|
+
valueNow: u
|
|
1483
1474
|
};
|
|
1484
1475
|
}
|
|
1485
|
-
function
|
|
1476
|
+
function bt({
|
|
1486
1477
|
children: e,
|
|
1487
1478
|
className: t,
|
|
1488
1479
|
elementRef: n,
|
|
@@ -1490,40 +1481,40 @@ function Lt({
|
|
|
1490
1481
|
style: r,
|
|
1491
1482
|
...s
|
|
1492
1483
|
}) {
|
|
1493
|
-
const
|
|
1494
|
-
id:
|
|
1484
|
+
const u = ue(o), [i, a] = G({}), [l, c] = G("inactive"), [d, m] = G(null), v = fe(m, n), {
|
|
1485
|
+
id: f,
|
|
1495
1486
|
orientation: p,
|
|
1496
|
-
registerSeparator:
|
|
1497
|
-
} = de(),
|
|
1498
|
-
return
|
|
1499
|
-
if (
|
|
1500
|
-
const
|
|
1501
|
-
element:
|
|
1502
|
-
id:
|
|
1503
|
-
},
|
|
1487
|
+
registerSeparator: y
|
|
1488
|
+
} = de(), h = p === "horizontal" ? "vertical" : "horizontal";
|
|
1489
|
+
return j(() => {
|
|
1490
|
+
if (d !== null) {
|
|
1491
|
+
const S = {
|
|
1492
|
+
element: d,
|
|
1493
|
+
id: u
|
|
1494
|
+
}, x = y(S), g = A.addListener(
|
|
1504
1495
|
"interactionStateChange",
|
|
1505
1496
|
(P) => {
|
|
1506
|
-
|
|
1497
|
+
c(
|
|
1507
1498
|
P.state !== "inactive" && P.hitRegions.some(
|
|
1508
|
-
(E) => E.separator ===
|
|
1499
|
+
(E) => E.separator === S
|
|
1509
1500
|
) ? P.state : "inactive"
|
|
1510
1501
|
);
|
|
1511
1502
|
}
|
|
1512
|
-
),
|
|
1503
|
+
), w = A.addListener(
|
|
1513
1504
|
"mountedGroupsChange",
|
|
1514
1505
|
(P) => {
|
|
1515
1506
|
P.forEach(
|
|
1516
|
-
({ derivedPanelConstraints: E, layout:
|
|
1517
|
-
if (
|
|
1518
|
-
const
|
|
1519
|
-
if (
|
|
1520
|
-
const
|
|
1507
|
+
({ derivedPanelConstraints: E, layout: V, separatorToPanels: ne }, X) => {
|
|
1508
|
+
if (X.id === f) {
|
|
1509
|
+
const Y = ne.get(S);
|
|
1510
|
+
if (Y) {
|
|
1511
|
+
const q = Y[0], Z = X.panels.indexOf(q);
|
|
1521
1512
|
a(
|
|
1522
|
-
|
|
1523
|
-
layout:
|
|
1513
|
+
dt({
|
|
1514
|
+
layout: V,
|
|
1524
1515
|
panelConstraints: E,
|
|
1525
|
-
panelId:
|
|
1526
|
-
panelIndex:
|
|
1516
|
+
panelId: q.id,
|
|
1517
|
+
panelIndex: Z
|
|
1527
1518
|
})
|
|
1528
1519
|
);
|
|
1529
1520
|
}
|
|
@@ -1533,24 +1524,24 @@ function Lt({
|
|
|
1533
1524
|
}
|
|
1534
1525
|
);
|
|
1535
1526
|
return () => {
|
|
1536
|
-
g(),
|
|
1527
|
+
g(), w(), x();
|
|
1537
1528
|
};
|
|
1538
1529
|
}
|
|
1539
|
-
}, [
|
|
1530
|
+
}, [d, f, u, y]), /* @__PURE__ */ B(
|
|
1540
1531
|
"div",
|
|
1541
1532
|
{
|
|
1542
1533
|
...s,
|
|
1543
1534
|
"aria-controls": i.valueControls,
|
|
1544
|
-
"aria-orientation":
|
|
1535
|
+
"aria-orientation": h,
|
|
1545
1536
|
"aria-valuemax": i.valueMax,
|
|
1546
1537
|
"aria-valuemin": i.valueMin,
|
|
1547
1538
|
"aria-valuenow": i.valueNow,
|
|
1548
1539
|
children: e,
|
|
1549
1540
|
className: t,
|
|
1550
1541
|
"data-separator": l,
|
|
1551
|
-
"data-testid":
|
|
1552
|
-
id:
|
|
1553
|
-
ref:
|
|
1542
|
+
"data-testid": u,
|
|
1543
|
+
id: u,
|
|
1544
|
+
ref: v,
|
|
1554
1545
|
role: "separator",
|
|
1555
1546
|
style: {
|
|
1556
1547
|
flexBasis: "auto",
|
|
@@ -1563,13 +1554,13 @@ function Lt({
|
|
|
1563
1554
|
);
|
|
1564
1555
|
}
|
|
1565
1556
|
export {
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1557
|
+
ht as Group,
|
|
1558
|
+
St as Panel,
|
|
1559
|
+
bt as Separator,
|
|
1560
|
+
vt as useDefaultLayout,
|
|
1561
|
+
gt as useGroupCallbackRef,
|
|
1562
|
+
yt as useGroupRef,
|
|
1563
|
+
xt as usePanelCallbackRef,
|
|
1564
|
+
zt as usePanelRef
|
|
1574
1565
|
};
|
|
1575
1566
|
//# sourceMappingURL=react-resizable-panels.js.map
|