react-resizable-panels 4.3.2 → 4.4.0
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,33 +1,33 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { useState as
|
|
4
|
-
function
|
|
2
|
+
import { jsx as q } from "react/jsx-runtime";
|
|
3
|
+
import { useState as Y, useCallback as K, useId as qe, useLayoutEffect as Me, useEffect as Ee, useRef as k, createContext as Ye, useImperativeHandle as ke, useMemo as Ge, useSyncExternalStore as Je, useContext as Ze } from "react";
|
|
4
|
+
function b(e, t = "Assertion error") {
|
|
5
5
|
if (!e)
|
|
6
6
|
throw Error(t);
|
|
7
7
|
}
|
|
8
|
-
function
|
|
8
|
+
function U({
|
|
9
9
|
group: e
|
|
10
10
|
}) {
|
|
11
11
|
const { orientation: t, panels: n } = e;
|
|
12
12
|
return n.reduce((o, i) => (o += t === "horizontal" ? i.element.offsetWidth : i.element.offsetHeight, o), 0);
|
|
13
13
|
}
|
|
14
|
-
function
|
|
14
|
+
function ce(e, t) {
|
|
15
15
|
return t.sort(
|
|
16
|
-
e === "horizontal" ?
|
|
16
|
+
e === "horizontal" ? Qe : et
|
|
17
17
|
);
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function Qe(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 et(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 Ie(e) {
|
|
28
28
|
return e !== null && typeof e == "object" && "nodeType" in e && e.nodeType === Node.ELEMENT_NODE;
|
|
29
29
|
}
|
|
30
|
-
function
|
|
30
|
+
function De(e, t) {
|
|
31
31
|
return {
|
|
32
32
|
x: e.x >= t.left && e.x <= t.right ? 0 : Math.min(
|
|
33
33
|
Math.abs(e.x - t.left),
|
|
@@ -39,7 +39,7 @@ function Ee(e, t) {
|
|
|
39
39
|
)
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
|
-
function
|
|
42
|
+
function tt({
|
|
43
43
|
orientation: e,
|
|
44
44
|
rects: t,
|
|
45
45
|
targetRect: n
|
|
@@ -50,107 +50,107 @@ function Je({
|
|
|
50
50
|
};
|
|
51
51
|
let i, a = Number.MAX_VALUE;
|
|
52
52
|
for (const l of t) {
|
|
53
|
-
const { x: r, y: s } =
|
|
53
|
+
const { x: r, y: s } = De(o, l), u = e === "horizontal" ? r : s;
|
|
54
54
|
u < a && (a = u, i = l);
|
|
55
55
|
}
|
|
56
|
-
return
|
|
56
|
+
return b(i, "No rect found"), i;
|
|
57
57
|
}
|
|
58
|
-
function
|
|
59
|
-
const { element: t, orientation: n, panels: o, separators: i } = e, a =
|
|
58
|
+
function Oe(e) {
|
|
59
|
+
const { element: t, orientation: n, panels: o, separators: i } = e, a = ce(
|
|
60
60
|
n,
|
|
61
|
-
Array.from(t.children).filter(
|
|
62
|
-
).map(({ element:
|
|
61
|
+
Array.from(t.children).filter(Ie).map((c) => ({ element: c }))
|
|
62
|
+
).map(({ element: c }) => c), l = [];
|
|
63
63
|
let r = !1, s, u = [];
|
|
64
|
-
for (const
|
|
65
|
-
if (
|
|
66
|
-
const
|
|
67
|
-
(
|
|
64
|
+
for (const c of a)
|
|
65
|
+
if (c.hasAttribute("data-panel")) {
|
|
66
|
+
const h = o.find(
|
|
67
|
+
(m) => m.element === c
|
|
68
68
|
);
|
|
69
|
-
if (
|
|
69
|
+
if (h) {
|
|
70
70
|
if (s) {
|
|
71
|
-
const
|
|
72
|
-
let
|
|
71
|
+
const m = s.element.getBoundingClientRect(), p = c.getBoundingClientRect();
|
|
72
|
+
let f;
|
|
73
73
|
if (r) {
|
|
74
|
-
const d = n === "horizontal" ? new DOMRect(
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
74
|
+
const d = n === "horizontal" ? new DOMRect(m.right, m.top, 0, m.height) : new DOMRect(
|
|
75
|
+
m.left,
|
|
76
|
+
m.bottom,
|
|
77
|
+
m.width,
|
|
78
78
|
0
|
|
79
|
-
),
|
|
79
|
+
), y = n === "horizontal" ? new DOMRect(p.left, p.top, 0, p.height) : new DOMRect(p.left, p.top, p.width, 0);
|
|
80
80
|
switch (u.length) {
|
|
81
81
|
case 0: {
|
|
82
|
-
|
|
82
|
+
f = [
|
|
83
83
|
d,
|
|
84
|
-
|
|
84
|
+
y
|
|
85
85
|
];
|
|
86
86
|
break;
|
|
87
87
|
}
|
|
88
88
|
case 1: {
|
|
89
|
-
const
|
|
89
|
+
const S = u[0], v = tt({
|
|
90
90
|
orientation: n,
|
|
91
|
-
rects: [
|
|
92
|
-
targetRect:
|
|
91
|
+
rects: [m, p],
|
|
92
|
+
targetRect: S.element.getBoundingClientRect()
|
|
93
93
|
});
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
v ===
|
|
94
|
+
f = [
|
|
95
|
+
S,
|
|
96
|
+
v === m ? y : d
|
|
97
97
|
];
|
|
98
98
|
break;
|
|
99
99
|
}
|
|
100
100
|
default: {
|
|
101
|
-
|
|
101
|
+
f = u;
|
|
102
102
|
break;
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
105
|
} else
|
|
106
|
-
u.length ?
|
|
106
|
+
u.length ? f = u : f = [
|
|
107
107
|
n === "horizontal" ? new DOMRect(
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
108
|
+
m.right,
|
|
109
|
+
p.top,
|
|
110
|
+
p.left - m.right,
|
|
111
|
+
p.height
|
|
112
112
|
) : new DOMRect(
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
113
|
+
p.left,
|
|
114
|
+
m.bottom,
|
|
115
|
+
p.width,
|
|
116
|
+
p.top - m.bottom
|
|
117
117
|
)
|
|
118
118
|
];
|
|
119
|
-
for (const d of
|
|
119
|
+
for (const d of f)
|
|
120
120
|
l.push({
|
|
121
121
|
group: e,
|
|
122
|
-
groupSize:
|
|
123
|
-
panels: [s,
|
|
122
|
+
groupSize: U({ group: e }),
|
|
123
|
+
panels: [s, h],
|
|
124
124
|
separator: "width" in d ? void 0 : d,
|
|
125
125
|
rect: "width" in d ? d : d.element.getBoundingClientRect()
|
|
126
126
|
});
|
|
127
127
|
}
|
|
128
|
-
r = !1, s =
|
|
128
|
+
r = !1, s = h, u = [];
|
|
129
129
|
}
|
|
130
|
-
} else if (
|
|
131
|
-
const
|
|
132
|
-
(
|
|
130
|
+
} else if (c.hasAttribute("data-separator")) {
|
|
131
|
+
const h = i.find(
|
|
132
|
+
(m) => m.element === c
|
|
133
133
|
);
|
|
134
|
-
|
|
134
|
+
h ? u.push(h) : (s = void 0, u = []);
|
|
135
135
|
} else
|
|
136
136
|
r = !0;
|
|
137
137
|
return l;
|
|
138
138
|
}
|
|
139
|
-
function
|
|
139
|
+
function nt(e, t) {
|
|
140
140
|
const n = getComputedStyle(e), o = parseFloat(n.fontSize);
|
|
141
141
|
return t * o;
|
|
142
142
|
}
|
|
143
|
-
function
|
|
143
|
+
function ot(e, t) {
|
|
144
144
|
const n = getComputedStyle(e.ownerDocument.body), o = parseFloat(n.fontSize);
|
|
145
145
|
return t * o;
|
|
146
146
|
}
|
|
147
|
-
function
|
|
147
|
+
function rt(e) {
|
|
148
148
|
return e / 100 * window.innerHeight;
|
|
149
149
|
}
|
|
150
|
-
function
|
|
150
|
+
function it(e) {
|
|
151
151
|
return e / 100 * window.innerWidth;
|
|
152
152
|
}
|
|
153
|
-
function
|
|
153
|
+
function st(e) {
|
|
154
154
|
switch (typeof e) {
|
|
155
155
|
case "number":
|
|
156
156
|
return [e, "px"];
|
|
@@ -160,13 +160,13 @@ function nt(e) {
|
|
|
160
160
|
}
|
|
161
161
|
}
|
|
162
162
|
}
|
|
163
|
-
function
|
|
163
|
+
function oe({
|
|
164
164
|
groupSize: e,
|
|
165
165
|
panelElement: t,
|
|
166
166
|
styleProp: n
|
|
167
167
|
}) {
|
|
168
168
|
let o;
|
|
169
|
-
const [i, a] =
|
|
169
|
+
const [i, a] = st(n);
|
|
170
170
|
switch (a) {
|
|
171
171
|
case "%": {
|
|
172
172
|
o = i / 100 * e;
|
|
@@ -177,29 +177,29 @@ function Z({
|
|
|
177
177
|
break;
|
|
178
178
|
}
|
|
179
179
|
case "rem": {
|
|
180
|
-
o =
|
|
180
|
+
o = ot(t, i);
|
|
181
181
|
break;
|
|
182
182
|
}
|
|
183
183
|
case "em": {
|
|
184
|
-
o =
|
|
184
|
+
o = nt(t, i);
|
|
185
185
|
break;
|
|
186
186
|
}
|
|
187
187
|
case "vh": {
|
|
188
|
-
o =
|
|
188
|
+
o = rt(i);
|
|
189
189
|
break;
|
|
190
190
|
}
|
|
191
191
|
case "vw": {
|
|
192
|
-
o =
|
|
192
|
+
o = it(i);
|
|
193
193
|
break;
|
|
194
194
|
}
|
|
195
195
|
}
|
|
196
196
|
return o;
|
|
197
197
|
}
|
|
198
|
-
function
|
|
198
|
+
function D(e) {
|
|
199
199
|
return parseFloat(e.toFixed(3));
|
|
200
200
|
}
|
|
201
|
-
function
|
|
202
|
-
const { panels: t } = e, n =
|
|
201
|
+
function ye(e) {
|
|
202
|
+
const { panels: t } = e, n = U({ group: e });
|
|
203
203
|
return n === 0 ? t.map((o) => ({
|
|
204
204
|
collapsedSize: 0,
|
|
205
205
|
collapsible: o.panelConstraints.collapsible === !0,
|
|
@@ -211,39 +211,39 @@ function pe(e) {
|
|
|
211
211
|
const { element: i, panelConstraints: a } = o;
|
|
212
212
|
let l = 0;
|
|
213
213
|
if (a.collapsedSize) {
|
|
214
|
-
const
|
|
214
|
+
const c = oe({
|
|
215
215
|
groupSize: n,
|
|
216
216
|
panelElement: i,
|
|
217
217
|
styleProp: a.collapsedSize
|
|
218
218
|
});
|
|
219
|
-
l =
|
|
219
|
+
l = D(c / n * 100);
|
|
220
220
|
}
|
|
221
221
|
let r;
|
|
222
222
|
if (a.defaultSize) {
|
|
223
|
-
const
|
|
223
|
+
const c = oe({
|
|
224
224
|
groupSize: n,
|
|
225
225
|
panelElement: i,
|
|
226
226
|
styleProp: a.defaultSize
|
|
227
227
|
});
|
|
228
|
-
r =
|
|
228
|
+
r = D(c / n * 100);
|
|
229
229
|
}
|
|
230
230
|
let s = 0;
|
|
231
231
|
if (a.minSize) {
|
|
232
|
-
const
|
|
232
|
+
const c = oe({
|
|
233
233
|
groupSize: n,
|
|
234
234
|
panelElement: i,
|
|
235
235
|
styleProp: a.minSize
|
|
236
236
|
});
|
|
237
|
-
s =
|
|
237
|
+
s = D(c / n * 100);
|
|
238
238
|
}
|
|
239
239
|
let u = 100;
|
|
240
240
|
if (a.maxSize) {
|
|
241
|
-
const
|
|
241
|
+
const c = oe({
|
|
242
242
|
groupSize: n,
|
|
243
243
|
panelElement: i,
|
|
244
244
|
styleProp: a.maxSize
|
|
245
245
|
});
|
|
246
|
-
u =
|
|
246
|
+
u = D(c / n * 100);
|
|
247
247
|
}
|
|
248
248
|
return {
|
|
249
249
|
collapsedSize: l,
|
|
@@ -255,7 +255,7 @@ function pe(e) {
|
|
|
255
255
|
};
|
|
256
256
|
});
|
|
257
257
|
}
|
|
258
|
-
class
|
|
258
|
+
class at {
|
|
259
259
|
#e = {};
|
|
260
260
|
addListener(t, n) {
|
|
261
261
|
const o = this.#e[t];
|
|
@@ -294,37 +294,37 @@ class ot {
|
|
|
294
294
|
}
|
|
295
295
|
}
|
|
296
296
|
}
|
|
297
|
-
function
|
|
298
|
-
return Math.abs(
|
|
297
|
+
function C(e, t, n = 0) {
|
|
298
|
+
return Math.abs(D(e) - D(t)) <= n;
|
|
299
299
|
}
|
|
300
|
-
let
|
|
300
|
+
let G = {
|
|
301
301
|
cursorFlags: 0,
|
|
302
302
|
interactionState: {
|
|
303
303
|
state: "inactive"
|
|
304
304
|
},
|
|
305
305
|
mountedGroups: /* @__PURE__ */ new Map()
|
|
306
306
|
};
|
|
307
|
-
const
|
|
308
|
-
function
|
|
309
|
-
return
|
|
310
|
-
}
|
|
311
|
-
function
|
|
312
|
-
const t = typeof e == "function" ? e(
|
|
313
|
-
if (
|
|
314
|
-
return
|
|
315
|
-
const n =
|
|
316
|
-
return
|
|
317
|
-
...
|
|
307
|
+
const N = new at();
|
|
308
|
+
function I() {
|
|
309
|
+
return G;
|
|
310
|
+
}
|
|
311
|
+
function E(e) {
|
|
312
|
+
const t = typeof e == "function" ? e(G) : e;
|
|
313
|
+
if (G === t)
|
|
314
|
+
return G;
|
|
315
|
+
const n = G;
|
|
316
|
+
return G = {
|
|
317
|
+
...G,
|
|
318
318
|
...t
|
|
319
|
-
}, t.cursorFlags !== void 0 &&
|
|
319
|
+
}, t.cursorFlags !== void 0 && N.emit("cursorFlagsChange", G.cursorFlags), t.interactionState !== void 0 && N.emit("interactionStateChange", G.interactionState), t.mountedGroups !== void 0 && (G.mountedGroups.forEach((o, i) => {
|
|
320
320
|
o.derivedPanelConstraints.forEach((a) => {
|
|
321
321
|
if (a.collapsible) {
|
|
322
322
|
const { layout: l } = n.mountedGroups.get(i) ?? {};
|
|
323
323
|
if (l) {
|
|
324
|
-
const r =
|
|
324
|
+
const r = C(
|
|
325
325
|
a.collapsedSize,
|
|
326
326
|
o.layout[a.panelId]
|
|
327
|
-
), s =
|
|
327
|
+
), s = C(
|
|
328
328
|
a.collapsedSize,
|
|
329
329
|
l[a.panelId]
|
|
330
330
|
);
|
|
@@ -332,9 +332,9 @@ function I(e) {
|
|
|
332
332
|
}
|
|
333
333
|
}
|
|
334
334
|
});
|
|
335
|
-
}),
|
|
335
|
+
}), N.emit("mountedGroupsChange", G.mountedGroups)), G;
|
|
336
336
|
}
|
|
337
|
-
function
|
|
337
|
+
function lt(e, t) {
|
|
338
338
|
if (e.length !== t.length)
|
|
339
339
|
return !1;
|
|
340
340
|
for (let n = 0; n < e.length; n++)
|
|
@@ -342,10 +342,10 @@ function rt(e, t) {
|
|
|
342
342
|
return !1;
|
|
343
343
|
return !0;
|
|
344
344
|
}
|
|
345
|
-
function
|
|
346
|
-
return
|
|
345
|
+
function J(e, t) {
|
|
346
|
+
return C(e, t) ? 0 : e > t ? 1 : -1;
|
|
347
347
|
}
|
|
348
|
-
function
|
|
348
|
+
function V({
|
|
349
349
|
panelConstraints: e,
|
|
350
350
|
size: t
|
|
351
351
|
}) {
|
|
@@ -355,15 +355,15 @@ function H({
|
|
|
355
355
|
maxSize: i = 100,
|
|
356
356
|
minSize: a = 0
|
|
357
357
|
} = e;
|
|
358
|
-
if (
|
|
358
|
+
if (J(t, a) < 0)
|
|
359
359
|
if (o) {
|
|
360
360
|
const l = (n + a) / 2;
|
|
361
|
-
|
|
361
|
+
J(t, l) < 0 ? t = n : t = a;
|
|
362
362
|
} else
|
|
363
363
|
t = a;
|
|
364
|
-
return t = Math.min(i, t), t =
|
|
364
|
+
return t = Math.min(i, t), t = D(t), t;
|
|
365
365
|
}
|
|
366
|
-
function
|
|
366
|
+
function Z({
|
|
367
367
|
delta: e,
|
|
368
368
|
initialLayout: t,
|
|
369
369
|
panelConstraints: n,
|
|
@@ -371,136 +371,136 @@ function q({
|
|
|
371
371
|
prevLayout: i,
|
|
372
372
|
trigger: a
|
|
373
373
|
}) {
|
|
374
|
-
if (
|
|
374
|
+
if (C(e, 0))
|
|
375
375
|
return t;
|
|
376
|
-
const l = Object.values(t), r = Object.values(i), s = [...l], [u,
|
|
377
|
-
|
|
378
|
-
let
|
|
376
|
+
const l = Object.values(t), r = Object.values(i), s = [...l], [u, c] = o;
|
|
377
|
+
b(u != null, "Invalid first pivot index"), b(c != null, "Invalid second pivot index");
|
|
378
|
+
let h = 0;
|
|
379
379
|
if (a === "keyboard") {
|
|
380
380
|
{
|
|
381
|
-
const
|
|
382
|
-
|
|
381
|
+
const f = e < 0 ? c : u, d = n[f];
|
|
382
|
+
b(
|
|
383
383
|
d,
|
|
384
|
-
`Panel constraints not found for index ${
|
|
384
|
+
`Panel constraints not found for index ${f}`
|
|
385
385
|
);
|
|
386
386
|
const {
|
|
387
|
-
collapsedSize:
|
|
388
|
-
collapsible:
|
|
387
|
+
collapsedSize: y = 0,
|
|
388
|
+
collapsible: S,
|
|
389
389
|
minSize: v = 0
|
|
390
390
|
} = d;
|
|
391
|
-
if (
|
|
392
|
-
const x = l[
|
|
393
|
-
if (
|
|
391
|
+
if (S) {
|
|
392
|
+
const x = l[f];
|
|
393
|
+
if (b(
|
|
394
394
|
x != null,
|
|
395
|
-
`Previous layout not found for panel index ${
|
|
396
|
-
),
|
|
395
|
+
`Previous layout not found for panel index ${f}`
|
|
396
|
+
), C(x, y)) {
|
|
397
397
|
const g = v - x;
|
|
398
|
-
|
|
398
|
+
J(g, Math.abs(e)) > 0 && (e = e < 0 ? 0 - g : g);
|
|
399
399
|
}
|
|
400
400
|
}
|
|
401
401
|
}
|
|
402
402
|
{
|
|
403
|
-
const
|
|
404
|
-
|
|
403
|
+
const f = e < 0 ? u : c, d = n[f];
|
|
404
|
+
b(
|
|
405
405
|
d,
|
|
406
|
-
`No panel constraints found for index ${
|
|
406
|
+
`No panel constraints found for index ${f}`
|
|
407
407
|
);
|
|
408
408
|
const {
|
|
409
|
-
collapsedSize:
|
|
410
|
-
collapsible:
|
|
409
|
+
collapsedSize: y = 0,
|
|
410
|
+
collapsible: S,
|
|
411
411
|
minSize: v = 0
|
|
412
412
|
} = d;
|
|
413
|
-
if (
|
|
414
|
-
const x = l[
|
|
415
|
-
if (
|
|
413
|
+
if (S) {
|
|
414
|
+
const x = l[f];
|
|
415
|
+
if (b(
|
|
416
416
|
x != null,
|
|
417
|
-
`Previous layout not found for panel index ${
|
|
418
|
-
),
|
|
419
|
-
const g = x -
|
|
420
|
-
|
|
417
|
+
`Previous layout not found for panel index ${f}`
|
|
418
|
+
), C(x, v)) {
|
|
419
|
+
const g = x - y;
|
|
420
|
+
J(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 d = e < 0 ?
|
|
426
|
+
const f = e < 0 ? 1 : -1;
|
|
427
|
+
let d = e < 0 ? c : u, y = 0;
|
|
428
428
|
for (; ; ) {
|
|
429
429
|
const v = l[d];
|
|
430
|
-
|
|
430
|
+
b(
|
|
431
431
|
v != null,
|
|
432
432
|
`Previous layout not found for panel index ${d}`
|
|
433
433
|
);
|
|
434
|
-
const g =
|
|
434
|
+
const g = V({
|
|
435
435
|
panelConstraints: n[d],
|
|
436
436
|
size: 100
|
|
437
437
|
}) - v;
|
|
438
|
-
if (
|
|
438
|
+
if (y += g, d += f, d < 0 || d >= n.length)
|
|
439
439
|
break;
|
|
440
440
|
}
|
|
441
|
-
const
|
|
442
|
-
e = e < 0 ? 0 -
|
|
441
|
+
const S = Math.min(Math.abs(e), Math.abs(y));
|
|
442
|
+
e = e < 0 ? 0 - S : S;
|
|
443
443
|
}
|
|
444
444
|
{
|
|
445
|
-
let d = e < 0 ? u :
|
|
445
|
+
let d = e < 0 ? u : c;
|
|
446
446
|
for (; d >= 0 && d < n.length; ) {
|
|
447
|
-
const
|
|
448
|
-
|
|
449
|
-
|
|
447
|
+
const y = Math.abs(e) - Math.abs(h), S = l[d];
|
|
448
|
+
b(
|
|
449
|
+
S != null,
|
|
450
450
|
`Previous layout not found for panel index ${d}`
|
|
451
451
|
);
|
|
452
|
-
const v =
|
|
452
|
+
const v = S - y, x = V({
|
|
453
453
|
panelConstraints: n[d],
|
|
454
454
|
size: v
|
|
455
455
|
});
|
|
456
|
-
if (!
|
|
456
|
+
if (!C(S, x) && (h += S - x, s[d] = x, h.toFixed(3).localeCompare(Math.abs(e).toFixed(3), void 0, {
|
|
457
457
|
numeric: !0
|
|
458
458
|
}) >= 0))
|
|
459
459
|
break;
|
|
460
460
|
e < 0 ? d-- : d++;
|
|
461
461
|
}
|
|
462
462
|
}
|
|
463
|
-
if (
|
|
463
|
+
if (lt(r, s))
|
|
464
464
|
return i;
|
|
465
465
|
{
|
|
466
|
-
const
|
|
467
|
-
|
|
466
|
+
const f = e < 0 ? c : u, d = l[f];
|
|
467
|
+
b(
|
|
468
468
|
d != 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 = d + h, S = V({
|
|
472
|
+
panelConstraints: n[f],
|
|
473
|
+
size: y
|
|
474
474
|
});
|
|
475
|
-
if (s[
|
|
476
|
-
let v =
|
|
475
|
+
if (s[f] = S, !C(S, y)) {
|
|
476
|
+
let v = y - S, g = e < 0 ? c : u;
|
|
477
477
|
for (; g >= 0 && g < n.length; ) {
|
|
478
478
|
const L = s[g];
|
|
479
|
-
|
|
479
|
+
b(
|
|
480
480
|
L != null,
|
|
481
481
|
`Previous layout not found for panel index ${g}`
|
|
482
482
|
);
|
|
483
|
-
const P = L + v, R =
|
|
483
|
+
const P = L + v, R = V({
|
|
484
484
|
panelConstraints: n[g],
|
|
485
485
|
size: P
|
|
486
486
|
});
|
|
487
|
-
if (
|
|
487
|
+
if (C(L, R) || (v -= R - L, s[g] = R), C(v, 0))
|
|
488
488
|
break;
|
|
489
489
|
e > 0 ? g-- : g++;
|
|
490
490
|
}
|
|
491
491
|
}
|
|
492
492
|
}
|
|
493
|
-
const
|
|
494
|
-
(
|
|
493
|
+
const m = Object.values(s).reduce(
|
|
494
|
+
(f, d) => d + f,
|
|
495
495
|
0
|
|
496
496
|
);
|
|
497
|
-
if (!
|
|
497
|
+
if (!C(m, 100, 0.1))
|
|
498
498
|
return i;
|
|
499
|
-
const
|
|
500
|
-
return s.reduce((
|
|
499
|
+
const p = Object.keys(i);
|
|
500
|
+
return s.reduce((f, d, y) => (f[p[y]] = d, f), {});
|
|
501
501
|
}
|
|
502
|
-
function
|
|
503
|
-
const { mountedGroups: t } =
|
|
502
|
+
function ie(e) {
|
|
503
|
+
const { mountedGroups: t } = I();
|
|
504
504
|
for (const [n] of t)
|
|
505
505
|
if (n.separators.some(
|
|
506
506
|
(o) => o.element === e
|
|
@@ -508,15 +508,15 @@ function ee(e) {
|
|
|
508
508
|
return n;
|
|
509
509
|
throw Error("Could not find parent Group for separator element");
|
|
510
510
|
}
|
|
511
|
-
function
|
|
511
|
+
function _(e, t) {
|
|
512
512
|
if (Object.keys(e).length !== Object.keys(t).length)
|
|
513
513
|
return !1;
|
|
514
514
|
for (const n in e)
|
|
515
|
-
if (t[n] === void 0 ||
|
|
515
|
+
if (t[n] === void 0 || J(e[n], t[n]) !== 0)
|
|
516
516
|
return !1;
|
|
517
517
|
return !0;
|
|
518
518
|
}
|
|
519
|
-
function
|
|
519
|
+
function A({
|
|
520
520
|
layout: e,
|
|
521
521
|
panelConstraints: t
|
|
522
522
|
}) {
|
|
@@ -528,42 +528,42 @@ function F({
|
|
|
528
528
|
throw Error(
|
|
529
529
|
`Invalid ${t.length} panel layout: ${o.map((r) => `${r}%`).join(", ")}`
|
|
530
530
|
);
|
|
531
|
-
if (!
|
|
531
|
+
if (!C(i, 100) && o.length > 0)
|
|
532
532
|
for (let r = 0; r < t.length; r++) {
|
|
533
533
|
const s = o[r];
|
|
534
|
-
|
|
534
|
+
b(s != null, `No layout data found for index ${r}`);
|
|
535
535
|
const u = 100 / i * s;
|
|
536
536
|
o[r] = u;
|
|
537
537
|
}
|
|
538
538
|
let a = 0;
|
|
539
539
|
for (let r = 0; r < t.length; r++) {
|
|
540
540
|
const s = o[r];
|
|
541
|
-
|
|
542
|
-
const u =
|
|
541
|
+
b(s != null, `No layout data found for index ${r}`);
|
|
542
|
+
const u = V({
|
|
543
543
|
panelConstraints: t[r],
|
|
544
544
|
size: s
|
|
545
545
|
});
|
|
546
546
|
s != u && (a += s - u, o[r] = u);
|
|
547
547
|
}
|
|
548
|
-
if (!
|
|
548
|
+
if (!C(a, 0))
|
|
549
549
|
for (let r = 0; r < t.length; r++) {
|
|
550
550
|
const s = o[r];
|
|
551
|
-
|
|
552
|
-
const u = s + a,
|
|
551
|
+
b(s != null, `No layout data found for index ${r}`);
|
|
552
|
+
const u = s + a, c = V({
|
|
553
553
|
panelConstraints: t[r],
|
|
554
554
|
size: u
|
|
555
555
|
});
|
|
556
|
-
if (s !==
|
|
556
|
+
if (s !== c && (a -= c - s, o[r] = c, C(a, 0)))
|
|
557
557
|
break;
|
|
558
558
|
}
|
|
559
559
|
const l = Object.keys(e);
|
|
560
560
|
return o.reduce((r, s, u) => (r[l[u]] = s, r), {});
|
|
561
561
|
}
|
|
562
|
-
function
|
|
562
|
+
function Te({
|
|
563
563
|
groupId: e
|
|
564
564
|
}) {
|
|
565
565
|
const t = () => {
|
|
566
|
-
const { mountedGroups: n } =
|
|
566
|
+
const { mountedGroups: n } = I();
|
|
567
567
|
for (const [o, i] of n)
|
|
568
568
|
if (o.id === e)
|
|
569
569
|
return { group: o, ...i };
|
|
@@ -581,11 +581,11 @@ function Ie({
|
|
|
581
581
|
group: a,
|
|
582
582
|
layout: l,
|
|
583
583
|
separatorToPanels: r
|
|
584
|
-
} = t(), s =
|
|
584
|
+
} = t(), s = A({
|
|
585
585
|
layout: n,
|
|
586
586
|
panelConstraints: i
|
|
587
587
|
});
|
|
588
|
-
return o ? l : (
|
|
588
|
+
return o ? l : (_(l, s) || E((u) => ({
|
|
589
589
|
mountedGroups: new Map(u.mountedGroups).set(a, {
|
|
590
590
|
defaultLayoutDeferred: o,
|
|
591
591
|
derivedPanelConstraints: i,
|
|
@@ -596,110 +596,110 @@ function Ie({
|
|
|
596
596
|
}
|
|
597
597
|
};
|
|
598
598
|
}
|
|
599
|
-
function
|
|
600
|
-
const { mountedGroups: t } =
|
|
601
|
-
return
|
|
599
|
+
function Ne(e) {
|
|
600
|
+
const { mountedGroups: t } = I(), n = t.get(e);
|
|
601
|
+
return b(n, `Mounted Group ${e.id} not found`), n;
|
|
602
602
|
}
|
|
603
|
-
function
|
|
604
|
-
const n =
|
|
605
|
-
(
|
|
603
|
+
function T(e, t) {
|
|
604
|
+
const n = ie(e), o = Ne(n), i = n.separators.find(
|
|
605
|
+
(h) => h.element === e
|
|
606
606
|
);
|
|
607
|
-
|
|
607
|
+
b(i, "Matching separator not found");
|
|
608
608
|
const a = o.separatorToPanels.get(i);
|
|
609
|
-
|
|
610
|
-
const l = a.map((
|
|
609
|
+
b(a, "Matching panels not found");
|
|
610
|
+
const l = a.map((h) => n.panels.indexOf(h)), s = Te({ groupId: n.id }).getLayout(), u = Z({
|
|
611
611
|
delta: t,
|
|
612
612
|
initialLayout: s,
|
|
613
613
|
panelConstraints: o.derivedPanelConstraints,
|
|
614
614
|
pivotIndices: l,
|
|
615
615
|
prevLayout: s,
|
|
616
616
|
trigger: "keyboard"
|
|
617
|
-
}),
|
|
617
|
+
}), c = A({
|
|
618
618
|
layout: u,
|
|
619
619
|
panelConstraints: o.derivedPanelConstraints
|
|
620
620
|
});
|
|
621
|
-
|
|
622
|
-
mountedGroups: new Map(
|
|
621
|
+
_(s, c) || E((h) => ({
|
|
622
|
+
mountedGroups: new Map(h.mountedGroups).set(n, {
|
|
623
623
|
defaultLayoutDeferred: o.defaultLayoutDeferred,
|
|
624
624
|
derivedPanelConstraints: o.derivedPanelConstraints,
|
|
625
|
-
layout:
|
|
625
|
+
layout: c,
|
|
626
626
|
separatorToPanels: o.separatorToPanels
|
|
627
627
|
})
|
|
628
628
|
}));
|
|
629
629
|
}
|
|
630
|
-
function
|
|
630
|
+
function ge(e) {
|
|
631
631
|
if (e.defaultPrevented)
|
|
632
632
|
return;
|
|
633
|
-
const t = e.currentTarget, n =
|
|
633
|
+
const t = e.currentTarget, n = ie(t);
|
|
634
634
|
if (!n.disabled)
|
|
635
635
|
switch (e.key) {
|
|
636
636
|
case "ArrowDown": {
|
|
637
|
-
e.preventDefault(), n.orientation === "vertical" &&
|
|
637
|
+
e.preventDefault(), n.orientation === "vertical" && T(t, 5);
|
|
638
638
|
break;
|
|
639
639
|
}
|
|
640
640
|
case "ArrowLeft": {
|
|
641
|
-
e.preventDefault(), n.orientation === "horizontal" &&
|
|
641
|
+
e.preventDefault(), n.orientation === "horizontal" && T(t, -5);
|
|
642
642
|
break;
|
|
643
643
|
}
|
|
644
644
|
case "ArrowRight": {
|
|
645
|
-
e.preventDefault(), n.orientation === "horizontal" &&
|
|
645
|
+
e.preventDefault(), n.orientation === "horizontal" && T(t, 5);
|
|
646
646
|
break;
|
|
647
647
|
}
|
|
648
648
|
case "ArrowUp": {
|
|
649
|
-
e.preventDefault(), n.orientation === "vertical" &&
|
|
649
|
+
e.preventDefault(), n.orientation === "vertical" && T(t, -5);
|
|
650
650
|
break;
|
|
651
651
|
}
|
|
652
652
|
case "End": {
|
|
653
|
-
e.preventDefault(),
|
|
653
|
+
e.preventDefault(), T(t, 100);
|
|
654
654
|
break;
|
|
655
655
|
}
|
|
656
656
|
case "Enter": {
|
|
657
657
|
e.preventDefault();
|
|
658
|
-
const o =
|
|
659
|
-
(
|
|
658
|
+
const o = ie(t), { derivedPanelConstraints: i, layout: a, separatorToPanels: l } = Ne(o), r = o.separators.find(
|
|
659
|
+
(h) => h.element === t
|
|
660
660
|
);
|
|
661
|
-
|
|
661
|
+
b(r, "Matching separator not found");
|
|
662
662
|
const s = l.get(r);
|
|
663
|
-
|
|
664
|
-
const u = s[0],
|
|
665
|
-
(
|
|
663
|
+
b(s, "Matching panels not found");
|
|
664
|
+
const u = s[0], c = i.find(
|
|
665
|
+
(h) => h.panelId === u.id
|
|
666
666
|
);
|
|
667
|
-
if (
|
|
668
|
-
const
|
|
669
|
-
|
|
667
|
+
if (b(c, "Panel metadata not found"), c.collapsible) {
|
|
668
|
+
const h = a[u.id], m = c.collapsedSize === h ? o.inMemoryLastExpandedPanelSizes[u.id] ?? c.minSize : c.collapsedSize;
|
|
669
|
+
T(t, m - h);
|
|
670
670
|
}
|
|
671
671
|
break;
|
|
672
672
|
}
|
|
673
673
|
case "F6": {
|
|
674
674
|
e.preventDefault();
|
|
675
|
-
const i =
|
|
675
|
+
const i = ie(t).separators.map(
|
|
676
676
|
(s) => s.element
|
|
677
677
|
), a = Array.from(i).findIndex(
|
|
678
678
|
(s) => s === e.currentTarget
|
|
679
679
|
);
|
|
680
|
-
|
|
680
|
+
b(a !== null, "Index not found");
|
|
681
681
|
const l = e.shiftKey ? a > 0 ? a - 1 : i.length - 1 : a + 1 < i.length ? a + 1 : 0;
|
|
682
682
|
i[l].focus();
|
|
683
683
|
break;
|
|
684
684
|
}
|
|
685
685
|
case "Home": {
|
|
686
|
-
e.preventDefault(),
|
|
686
|
+
e.preventDefault(), T(t, -100);
|
|
687
687
|
break;
|
|
688
688
|
}
|
|
689
689
|
}
|
|
690
690
|
}
|
|
691
|
-
const
|
|
692
|
-
},
|
|
691
|
+
const ut = (e) => e, le = () => {
|
|
692
|
+
}, _e = 1, Ae = 2, Fe = 4, $e = 8, Se = {
|
|
693
693
|
coarse: 10,
|
|
694
694
|
precise: 5
|
|
695
695
|
};
|
|
696
|
-
function
|
|
696
|
+
function ct(e, t, n) {
|
|
697
697
|
let o, i = {
|
|
698
698
|
x: 1 / 0,
|
|
699
699
|
y: 1 / 0
|
|
700
700
|
};
|
|
701
701
|
for (const a of t) {
|
|
702
|
-
const l =
|
|
702
|
+
const l = De(n, a.rect);
|
|
703
703
|
switch (e) {
|
|
704
704
|
case "horizontal": {
|
|
705
705
|
l.x <= i.x && (o = a, i = l);
|
|
@@ -716,29 +716,29 @@ function st(e, t, n) {
|
|
|
716
716
|
hitRegion: o
|
|
717
717
|
} : void 0;
|
|
718
718
|
}
|
|
719
|
-
let
|
|
720
|
-
function
|
|
721
|
-
return
|
|
719
|
+
let re;
|
|
720
|
+
function ft() {
|
|
721
|
+
return re === void 0 && (typeof matchMedia == "function" ? re = !!matchMedia("(pointer:coarse)").matches : re = !1), re;
|
|
722
722
|
}
|
|
723
|
-
function
|
|
723
|
+
function dt(e) {
|
|
724
724
|
return e !== null && typeof e == "object" && "nodeType" in e && e.nodeType === Node.DOCUMENT_FRAGMENT_NODE;
|
|
725
725
|
}
|
|
726
|
-
function
|
|
726
|
+
function pt(e, t) {
|
|
727
727
|
if (e === t) throw new Error("Cannot compare node with itself");
|
|
728
728
|
const n = {
|
|
729
|
-
a:
|
|
730
|
-
b:
|
|
729
|
+
a: ze(e),
|
|
730
|
+
b: ze(t)
|
|
731
731
|
};
|
|
732
732
|
let o;
|
|
733
733
|
for (; n.a.at(-1) === n.b.at(-1); )
|
|
734
734
|
e = n.a.pop(), t = n.b.pop(), o = e;
|
|
735
|
-
|
|
735
|
+
b(
|
|
736
736
|
o,
|
|
737
737
|
"Stacking order can only be calculated for elements with a common ancestor"
|
|
738
738
|
);
|
|
739
739
|
const i = {
|
|
740
|
-
a:
|
|
741
|
-
b:
|
|
740
|
+
a: xe(ve(n.a)),
|
|
741
|
+
b: xe(ve(n.b))
|
|
742
742
|
};
|
|
743
743
|
if (i.a === i.b) {
|
|
744
744
|
const a = o.childNodes, l = {
|
|
@@ -754,88 +754,88 @@ function ut(e, t) {
|
|
|
754
754
|
}
|
|
755
755
|
return Math.sign(i.a - i.b);
|
|
756
756
|
}
|
|
757
|
-
const
|
|
758
|
-
function
|
|
759
|
-
const t = getComputedStyle(
|
|
757
|
+
const ht = /\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;
|
|
758
|
+
function mt(e) {
|
|
759
|
+
const t = getComputedStyle(je(e) ?? e).display;
|
|
760
760
|
return t === "flex" || t === "inline-flex";
|
|
761
761
|
}
|
|
762
|
-
function
|
|
762
|
+
function yt(e) {
|
|
763
763
|
const t = getComputedStyle(e);
|
|
764
|
-
return !!(t.position === "fixed" || t.zIndex !== "auto" && (t.position !== "static" ||
|
|
764
|
+
return !!(t.position === "fixed" || t.zIndex !== "auto" && (t.position !== "static" || mt(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" || ht.test(t.willChange) || t.webkitOverflowScrolling === "touch");
|
|
765
765
|
}
|
|
766
|
-
function
|
|
766
|
+
function ve(e) {
|
|
767
767
|
let t = e.length;
|
|
768
768
|
for (; t--; ) {
|
|
769
769
|
const n = e[t];
|
|
770
|
-
if (
|
|
770
|
+
if (b(n, "Missing node"), yt(n)) return n;
|
|
771
771
|
}
|
|
772
772
|
return null;
|
|
773
773
|
}
|
|
774
|
-
function
|
|
774
|
+
function xe(e) {
|
|
775
775
|
return e && Number(getComputedStyle(e).zIndex) || 0;
|
|
776
776
|
}
|
|
777
|
-
function
|
|
777
|
+
function ze(e) {
|
|
778
778
|
const t = [];
|
|
779
779
|
for (; e; )
|
|
780
|
-
t.push(e), e =
|
|
780
|
+
t.push(e), e = je(e);
|
|
781
781
|
return t;
|
|
782
782
|
}
|
|
783
|
-
function
|
|
783
|
+
function je(e) {
|
|
784
784
|
const { parentNode: t } = e;
|
|
785
|
-
return
|
|
785
|
+
return dt(t) ? t.host : t;
|
|
786
786
|
}
|
|
787
|
-
function
|
|
787
|
+
function gt(e, t) {
|
|
788
788
|
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;
|
|
789
789
|
}
|
|
790
|
-
function
|
|
790
|
+
function St({
|
|
791
791
|
groupElement: e,
|
|
792
792
|
hitRegion: t,
|
|
793
793
|
pointerEventTarget: n
|
|
794
794
|
}) {
|
|
795
|
-
if (!
|
|
795
|
+
if (!Ie(n) || n.contains(e) || e.contains(n))
|
|
796
796
|
return !0;
|
|
797
|
-
if (
|
|
797
|
+
if (pt(n, e) > 0) {
|
|
798
798
|
let o = n;
|
|
799
799
|
for (; o; ) {
|
|
800
800
|
if (o.contains(e))
|
|
801
801
|
return !0;
|
|
802
|
-
if (
|
|
802
|
+
if (gt(o.getBoundingClientRect(), t))
|
|
803
803
|
return !1;
|
|
804
804
|
o = o.parentElement;
|
|
805
805
|
}
|
|
806
806
|
}
|
|
807
807
|
return !0;
|
|
808
808
|
}
|
|
809
|
-
function
|
|
809
|
+
function He(e, t) {
|
|
810
810
|
const n = [];
|
|
811
811
|
return t.forEach((o, i) => {
|
|
812
812
|
if (i.disabled)
|
|
813
813
|
return;
|
|
814
|
-
const a =
|
|
814
|
+
const a = ft() ? Se.coarse : Se.precise, l = Oe(i), r = ct(i.orientation, l, {
|
|
815
815
|
x: e.clientX,
|
|
816
816
|
y: e.clientY
|
|
817
817
|
});
|
|
818
|
-
r && r.distance.x <= a && r.distance.y <= a &&
|
|
818
|
+
r && r.distance.x <= a && r.distance.y <= a && St({
|
|
819
819
|
groupElement: i.element,
|
|
820
820
|
hitRegion: r.hitRegion.rect,
|
|
821
821
|
pointerEventTarget: e.target
|
|
822
822
|
}) && n.push(r.hitRegion);
|
|
823
823
|
}), n;
|
|
824
824
|
}
|
|
825
|
-
function
|
|
825
|
+
function be(e) {
|
|
826
826
|
if (e.defaultPrevented)
|
|
827
827
|
return;
|
|
828
828
|
if (e.pointerType === "mouse" && e.button > 0)
|
|
829
829
|
return;
|
|
830
|
-
const { mountedGroups: t } =
|
|
830
|
+
const { mountedGroups: t } = I(), n = He(e, t), o = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set(), l = /* @__PURE__ */ new Map();
|
|
831
831
|
let r = !1;
|
|
832
832
|
n.forEach((s) => {
|
|
833
|
-
o.add(s.group), s.panels.forEach((
|
|
834
|
-
i.add(
|
|
833
|
+
o.add(s.group), s.panels.forEach((c) => {
|
|
834
|
+
i.add(c);
|
|
835
835
|
}), s.separator && (a.add(s.separator), r || (r = !0, s.separator.element.focus()));
|
|
836
836
|
const u = t.get(s.group);
|
|
837
837
|
u && l.set(s.group, u.layout);
|
|
838
|
-
}),
|
|
838
|
+
}), E({
|
|
839
839
|
interactionState: {
|
|
840
840
|
hitRegions: n,
|
|
841
841
|
initialLayoutMap: l,
|
|
@@ -844,7 +844,7 @@ function ve(e) {
|
|
|
844
844
|
}
|
|
845
845
|
}), n.length && e.preventDefault();
|
|
846
846
|
}
|
|
847
|
-
function
|
|
847
|
+
function vt({
|
|
848
848
|
cursorFlags: e,
|
|
849
849
|
groups: t,
|
|
850
850
|
state: n
|
|
@@ -871,7 +871,7 @@ function mt({
|
|
|
871
871
|
return null;
|
|
872
872
|
switch (n) {
|
|
873
873
|
case "active": {
|
|
874
|
-
const a = (e &
|
|
874
|
+
const a = (e & _e) !== 0, l = (e & Ae) !== 0, r = (e & Fe) !== 0, s = (e & $e) !== 0;
|
|
875
875
|
if (e) {
|
|
876
876
|
if (a)
|
|
877
877
|
return r ? "se-resize" : s ? "ne-resize" : "e-resize";
|
|
@@ -887,17 +887,17 @@ function mt({
|
|
|
887
887
|
}
|
|
888
888
|
return o > 0 && i > 0 ? "move" : o > 0 ? "ew-resize" : "ns-resize";
|
|
889
889
|
}
|
|
890
|
-
const
|
|
891
|
-
function
|
|
890
|
+
const we = /* @__PURE__ */ new WeakMap();
|
|
891
|
+
function fe(e) {
|
|
892
892
|
if (e.defaultView === null || e.defaultView === void 0)
|
|
893
893
|
return;
|
|
894
|
-
let { prevStyle: t, styleSheet: n } =
|
|
894
|
+
let { prevStyle: t, styleSheet: n } = we.get(e) ?? {};
|
|
895
895
|
n === void 0 && (n = new e.defaultView.CSSStyleSheet(), e.adoptedStyleSheets = [n]);
|
|
896
|
-
const { cursorFlags: o, interactionState: i } =
|
|
896
|
+
const { cursorFlags: o, interactionState: i } = I();
|
|
897
897
|
switch (i.state) {
|
|
898
898
|
case "active":
|
|
899
899
|
case "hover": {
|
|
900
|
-
const a =
|
|
900
|
+
const a = vt({
|
|
901
901
|
cursorFlags: o,
|
|
902
902
|
groups: i.hitRegions.map((r) => r.group),
|
|
903
903
|
state: i.state
|
|
@@ -912,12 +912,12 @@ function ue(e) {
|
|
|
912
912
|
break;
|
|
913
913
|
}
|
|
914
914
|
}
|
|
915
|
-
|
|
915
|
+
we.set(e, {
|
|
916
916
|
prevStyle: t,
|
|
917
917
|
styleSheet: n
|
|
918
918
|
});
|
|
919
919
|
}
|
|
920
|
-
function
|
|
920
|
+
function Ve({
|
|
921
921
|
document: e,
|
|
922
922
|
event: t,
|
|
923
923
|
hitRegions: n,
|
|
@@ -928,40 +928,40 @@ function Fe({
|
|
|
928
928
|
let l = 0;
|
|
929
929
|
const r = new Map(i);
|
|
930
930
|
n.forEach((s) => {
|
|
931
|
-
const { group: u, groupSize:
|
|
932
|
-
let
|
|
933
|
-
a ?
|
|
931
|
+
const { group: u, groupSize: c } = s, { disableCursor: h, orientation: m, panels: p } = u;
|
|
932
|
+
let f = 0;
|
|
933
|
+
a ? m === "horizontal" ? f = (t.clientX - a.x) / c * 100 : f = (t.clientY - a.y) / c * 100 : m === "horizontal" ? f = t.clientX < 0 ? -100 : 100 : f = t.clientY < 0 ? -100 : 100;
|
|
934
934
|
const d = o.get(u), {
|
|
935
|
-
defaultLayoutDeferred:
|
|
936
|
-
derivedPanelConstraints:
|
|
935
|
+
defaultLayoutDeferred: y,
|
|
936
|
+
derivedPanelConstraints: S,
|
|
937
937
|
layout: v,
|
|
938
938
|
separatorToPanels: x
|
|
939
939
|
} = i.get(u) ?? { defaultLayoutDeferred: !1 };
|
|
940
|
-
if (
|
|
941
|
-
const g =
|
|
942
|
-
delta:
|
|
940
|
+
if (S && d && v && x) {
|
|
941
|
+
const g = Z({
|
|
942
|
+
delta: f,
|
|
943
943
|
initialLayout: d,
|
|
944
|
-
panelConstraints:
|
|
945
|
-
pivotIndices: s.panels.map((L) =>
|
|
944
|
+
panelConstraints: S,
|
|
945
|
+
pivotIndices: s.panels.map((L) => p.indexOf(L)),
|
|
946
946
|
prevLayout: v,
|
|
947
947
|
trigger: "mouse-or-touch"
|
|
948
948
|
});
|
|
949
|
-
if (
|
|
950
|
-
if (
|
|
951
|
-
switch (
|
|
949
|
+
if (_(g, v)) {
|
|
950
|
+
if (f !== 0 && !h)
|
|
951
|
+
switch (m) {
|
|
952
952
|
case "horizontal": {
|
|
953
|
-
l |=
|
|
953
|
+
l |= f < 0 ? _e : Ae;
|
|
954
954
|
break;
|
|
955
955
|
}
|
|
956
956
|
case "vertical": {
|
|
957
|
-
l |=
|
|
957
|
+
l |= f < 0 ? Fe : $e;
|
|
958
958
|
break;
|
|
959
959
|
}
|
|
960
960
|
}
|
|
961
961
|
} else {
|
|
962
962
|
r.set(s.group, {
|
|
963
|
-
defaultLayoutDeferred:
|
|
964
|
-
derivedPanelConstraints:
|
|
963
|
+
defaultLayoutDeferred: y,
|
|
964
|
+
derivedPanelConstraints: S,
|
|
965
965
|
layout: g,
|
|
966
966
|
separatorToPanels: x
|
|
967
967
|
});
|
|
@@ -969,16 +969,16 @@ function Fe({
|
|
|
969
969
|
s.group.inMemoryLayouts[L] = g;
|
|
970
970
|
}
|
|
971
971
|
}
|
|
972
|
-
}),
|
|
972
|
+
}), E({
|
|
973
973
|
cursorFlags: l,
|
|
974
974
|
mountedGroups: r
|
|
975
|
-
}),
|
|
975
|
+
}), fe(e);
|
|
976
976
|
}
|
|
977
|
-
function
|
|
978
|
-
const { interactionState: t, mountedGroups: n } =
|
|
977
|
+
function Le(e) {
|
|
978
|
+
const { interactionState: t, mountedGroups: n } = I();
|
|
979
979
|
switch (t.state) {
|
|
980
980
|
case "active":
|
|
981
|
-
|
|
981
|
+
Ve({
|
|
982
982
|
document: e.currentTarget,
|
|
983
983
|
event: e,
|
|
984
984
|
hitRegions: t.hitRegions,
|
|
@@ -987,27 +987,27 @@ function ze(e) {
|
|
|
987
987
|
});
|
|
988
988
|
}
|
|
989
989
|
}
|
|
990
|
-
function
|
|
990
|
+
function Pe(e) {
|
|
991
991
|
if (e.defaultPrevented)
|
|
992
992
|
return;
|
|
993
|
-
const { interactionState: t, mountedGroups: n } =
|
|
993
|
+
const { interactionState: t, mountedGroups: n } = I();
|
|
994
994
|
switch (t.state) {
|
|
995
995
|
case "active": {
|
|
996
996
|
if (
|
|
997
997
|
// Skip this check for "pointerleave" events, else Firefox triggers a false positive (see #514)
|
|
998
998
|
e.buttons === 0
|
|
999
999
|
) {
|
|
1000
|
-
|
|
1000
|
+
E(
|
|
1001
1001
|
(o) => o.interactionState.state === "inactive" ? o : {
|
|
1002
1002
|
cursorFlags: 0,
|
|
1003
|
-
interactionState: {
|
|
1004
|
-
state: "inactive"
|
|
1005
|
-
}
|
|
1003
|
+
interactionState: { state: "inactive" }
|
|
1006
1004
|
}
|
|
1007
|
-
)
|
|
1005
|
+
), E((o) => ({
|
|
1006
|
+
mountedGroups: new Map(o.mountedGroups)
|
|
1007
|
+
}));
|
|
1008
1008
|
return;
|
|
1009
1009
|
}
|
|
1010
|
-
|
|
1010
|
+
Ve({
|
|
1011
1011
|
document: e.currentTarget,
|
|
1012
1012
|
event: e,
|
|
1013
1013
|
hitRegions: t.hitRegions,
|
|
@@ -1018,67 +1018,70 @@ function be(e) {
|
|
|
1018
1018
|
break;
|
|
1019
1019
|
}
|
|
1020
1020
|
default: {
|
|
1021
|
-
const o =
|
|
1022
|
-
o.length === 0 ? t.state !== "inactive" &&
|
|
1023
|
-
interactionState: {
|
|
1024
|
-
|
|
1021
|
+
const o = He(e, n);
|
|
1022
|
+
o.length === 0 ? t.state !== "inactive" && E({
|
|
1023
|
+
interactionState: {
|
|
1024
|
+
state: "inactive"
|
|
1025
|
+
}
|
|
1026
|
+
}) : E({
|
|
1025
1027
|
interactionState: {
|
|
1026
1028
|
hitRegions: o,
|
|
1027
1029
|
state: "hover"
|
|
1028
1030
|
}
|
|
1029
|
-
}),
|
|
1031
|
+
}), fe(e.currentTarget);
|
|
1030
1032
|
break;
|
|
1031
1033
|
}
|
|
1032
1034
|
}
|
|
1033
1035
|
}
|
|
1034
|
-
function
|
|
1036
|
+
function Ce(e) {
|
|
1035
1037
|
if (e.defaultPrevented)
|
|
1036
1038
|
return;
|
|
1037
1039
|
if (e.pointerType === "mouse" && e.button > 0)
|
|
1038
1040
|
return;
|
|
1039
|
-
|
|
1040
|
-
const { interactionState: t } = D();
|
|
1041
|
+
const { interactionState: t } = I();
|
|
1041
1042
|
switch (t.state) {
|
|
1042
1043
|
case "active":
|
|
1043
|
-
|
|
1044
|
+
E({
|
|
1044
1045
|
cursorFlags: 0,
|
|
1045
1046
|
interactionState: {
|
|
1046
1047
|
state: "inactive"
|
|
1047
1048
|
}
|
|
1048
|
-
}),
|
|
1049
|
+
}), t.hitRegions.length > 0 && (fe(e.currentTarget), E((n) => ({
|
|
1050
|
+
mountedGroups: new Map(n.mountedGroups)
|
|
1051
|
+
})), e.preventDefault());
|
|
1049
1052
|
}
|
|
1050
1053
|
}
|
|
1051
|
-
function
|
|
1054
|
+
function Re(e) {
|
|
1052
1055
|
let t = 0, n = 0;
|
|
1053
1056
|
const o = {};
|
|
1054
1057
|
for (const a of e)
|
|
1055
1058
|
if (a.defaultSize !== void 0) {
|
|
1056
1059
|
t++;
|
|
1057
|
-
const l =
|
|
1060
|
+
const l = D(a.defaultSize);
|
|
1058
1061
|
n += l, o[a.panelId] = l;
|
|
1059
1062
|
} else
|
|
1060
1063
|
o[a.panelId] = void 0;
|
|
1061
1064
|
const i = e.length - t;
|
|
1062
1065
|
if (i !== 0) {
|
|
1063
|
-
const a =
|
|
1066
|
+
const a = D((100 - n) / i);
|
|
1064
1067
|
for (const l of e)
|
|
1065
1068
|
l.defaultSize === void 0 && (o[l.panelId] = a);
|
|
1066
1069
|
}
|
|
1067
1070
|
return o;
|
|
1068
1071
|
}
|
|
1069
|
-
function
|
|
1072
|
+
function xt(e, t, n) {
|
|
1070
1073
|
if (!n[0])
|
|
1071
1074
|
return;
|
|
1072
1075
|
const i = e.panels.find((u) => u.element === t);
|
|
1073
1076
|
if (!i || !i.onResize)
|
|
1074
1077
|
return;
|
|
1075
|
-
const a =
|
|
1076
|
-
asPercentage:
|
|
1078
|
+
const a = U({ group: e }), l = e.orientation === "horizontal" ? i.element.offsetWidth : i.element.offsetHeight, r = i.mutableValues.prevSize, s = {
|
|
1079
|
+
asPercentage: D(l / a * 100),
|
|
1077
1080
|
inPixels: l
|
|
1078
1081
|
};
|
|
1079
1082
|
i.mutableValues.prevSize = s, i.onResize(s, i.id, r);
|
|
1080
1083
|
}
|
|
1081
|
-
function
|
|
1084
|
+
function zt(e, t) {
|
|
1082
1085
|
if (Object.keys(e).length !== Object.keys(t).length)
|
|
1083
1086
|
return !1;
|
|
1084
1087
|
for (const o in e)
|
|
@@ -1086,7 +1089,7 @@ function gt(e, t) {
|
|
|
1086
1089
|
return !1;
|
|
1087
1090
|
return !0;
|
|
1088
1091
|
}
|
|
1089
|
-
function
|
|
1092
|
+
function bt(e, t) {
|
|
1090
1093
|
const n = e.map((i) => i.id), o = Object.keys(t);
|
|
1091
1094
|
if (n.length !== o.length)
|
|
1092
1095
|
return !1;
|
|
@@ -1095,28 +1098,28 @@ function St(e, t) {
|
|
|
1095
1098
|
return !1;
|
|
1096
1099
|
return !0;
|
|
1097
1100
|
}
|
|
1098
|
-
const
|
|
1099
|
-
function
|
|
1101
|
+
const H = /* @__PURE__ */ new Map();
|
|
1102
|
+
function wt(e) {
|
|
1100
1103
|
let t = !0;
|
|
1101
|
-
|
|
1104
|
+
b(
|
|
1102
1105
|
e.element.ownerDocument.defaultView,
|
|
1103
1106
|
"Cannot register an unmounted Group"
|
|
1104
1107
|
);
|
|
1105
|
-
const n = e.element.ownerDocument.defaultView.ResizeObserver, o = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set(), a = new n((
|
|
1106
|
-
for (const d of
|
|
1107
|
-
const { borderBoxSize:
|
|
1108
|
-
if (
|
|
1108
|
+
const n = e.element.ownerDocument.defaultView.ResizeObserver, o = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set(), a = new n((f) => {
|
|
1109
|
+
for (const d of f) {
|
|
1110
|
+
const { borderBoxSize: y, target: S } = d;
|
|
1111
|
+
if (S === e.element) {
|
|
1109
1112
|
if (t) {
|
|
1110
|
-
if (
|
|
1113
|
+
if (U({ group: e }) === 0)
|
|
1111
1114
|
return;
|
|
1112
|
-
|
|
1115
|
+
E((x) => {
|
|
1113
1116
|
const g = x.mountedGroups.get(e);
|
|
1114
1117
|
if (g) {
|
|
1115
|
-
const L =
|
|
1118
|
+
const L = ye(e), P = g.defaultLayoutDeferred ? Re(L) : g.layout, R = A({
|
|
1116
1119
|
layout: P,
|
|
1117
1120
|
panelConstraints: L
|
|
1118
1121
|
});
|
|
1119
|
-
return !g.defaultLayoutDeferred &&
|
|
1122
|
+
return !g.defaultLayoutDeferred && _(P, R) && zt(
|
|
1120
1123
|
g.derivedPanelConstraints,
|
|
1121
1124
|
L
|
|
1122
1125
|
) ? x : {
|
|
@@ -1132,78 +1135,78 @@ function vt(e) {
|
|
|
1132
1135
|
});
|
|
1133
1136
|
}
|
|
1134
1137
|
} else
|
|
1135
|
-
|
|
1138
|
+
xt(e, S, y);
|
|
1136
1139
|
}
|
|
1137
1140
|
});
|
|
1138
|
-
a.observe(e.element), e.panels.forEach((
|
|
1139
|
-
|
|
1140
|
-
!o.has(
|
|
1141
|
-
`Panel ids must be unique; id "${
|
|
1142
|
-
), o.add(
|
|
1141
|
+
a.observe(e.element), e.panels.forEach((f) => {
|
|
1142
|
+
b(
|
|
1143
|
+
!o.has(f.id),
|
|
1144
|
+
`Panel ids must be unique; id "${f.id}" was used more than once`
|
|
1145
|
+
), o.add(f.id), f.onResize && a.observe(f.element);
|
|
1143
1146
|
});
|
|
1144
|
-
const l =
|
|
1147
|
+
const l = U({ group: e }), r = ye(e), s = e.panels.map(({ id: f }) => f).join(",");
|
|
1145
1148
|
let u = e.defaultLayout;
|
|
1146
|
-
u && (
|
|
1147
|
-
const
|
|
1148
|
-
layout:
|
|
1149
|
+
u && (bt(e.panels, u) || (u = void 0));
|
|
1150
|
+
const c = e.inMemoryLayouts[s] ?? u ?? Re(r), h = A({
|
|
1151
|
+
layout: c,
|
|
1149
1152
|
panelConstraints: r
|
|
1150
|
-
}),
|
|
1151
|
-
return
|
|
1153
|
+
}), m = Oe(e), p = e.element.ownerDocument;
|
|
1154
|
+
return E((f) => {
|
|
1152
1155
|
const d = /* @__PURE__ */ new Map();
|
|
1153
|
-
return
|
|
1154
|
-
|
|
1155
|
-
(
|
|
1156
|
-
),
|
|
1157
|
-
|
|
1156
|
+
return H.set(
|
|
1157
|
+
p,
|
|
1158
|
+
(H.get(p) ?? 0) + 1
|
|
1159
|
+
), m.forEach((y) => {
|
|
1160
|
+
y.separator && d.set(y.separator, y.panels);
|
|
1158
1161
|
}), {
|
|
1159
|
-
mountedGroups: new Map(
|
|
1162
|
+
mountedGroups: new Map(f.mountedGroups).set(e, {
|
|
1160
1163
|
defaultLayoutDeferred: l === 0,
|
|
1161
1164
|
derivedPanelConstraints: r,
|
|
1162
|
-
layout:
|
|
1165
|
+
layout: h,
|
|
1163
1166
|
separatorToPanels: d
|
|
1164
1167
|
})
|
|
1165
1168
|
};
|
|
1166
|
-
}), e.separators.forEach((
|
|
1167
|
-
|
|
1168
|
-
!i.has(
|
|
1169
|
-
`Separator ids must be unique; id "${
|
|
1170
|
-
), i.add(
|
|
1171
|
-
}),
|
|
1172
|
-
t = !1,
|
|
1173
|
-
|
|
1174
|
-
Math.max(0, (
|
|
1175
|
-
),
|
|
1176
|
-
const
|
|
1177
|
-
return
|
|
1169
|
+
}), e.separators.forEach((f) => {
|
|
1170
|
+
b(
|
|
1171
|
+
!i.has(f.id),
|
|
1172
|
+
`Separator ids must be unique; id "${f.id}" was used more than once`
|
|
1173
|
+
), i.add(f.id), f.element.addEventListener("keydown", ge);
|
|
1174
|
+
}), H.get(p) === 1 && (p.addEventListener("pointerdown", be, !0), p.addEventListener("pointerleave", Le), p.addEventListener("pointermove", Pe), p.addEventListener("pointerup", Ce, !0)), function() {
|
|
1175
|
+
t = !1, H.set(
|
|
1176
|
+
p,
|
|
1177
|
+
Math.max(0, (H.get(p) ?? 0) - 1)
|
|
1178
|
+
), E((d) => {
|
|
1179
|
+
const y = new Map(d.mountedGroups);
|
|
1180
|
+
return y.delete(e), { mountedGroups: y };
|
|
1178
1181
|
}), e.separators.forEach((d) => {
|
|
1179
|
-
d.element.removeEventListener("keydown",
|
|
1180
|
-
}),
|
|
1182
|
+
d.element.removeEventListener("keydown", ge);
|
|
1183
|
+
}), H.get(p) || (p.removeEventListener(
|
|
1181
1184
|
"pointerdown",
|
|
1182
|
-
|
|
1185
|
+
be,
|
|
1183
1186
|
!0
|
|
1184
|
-
),
|
|
1187
|
+
), p.removeEventListener("pointerleave", Le), p.removeEventListener("pointermove", Pe), p.removeEventListener("pointerup", Ce, !0)), a.disconnect();
|
|
1185
1188
|
};
|
|
1186
1189
|
}
|
|
1187
|
-
function
|
|
1188
|
-
const [e, t] =
|
|
1190
|
+
function Ue() {
|
|
1191
|
+
const [e, t] = Y({}), n = K(() => t({}), []);
|
|
1189
1192
|
return [e, n];
|
|
1190
1193
|
}
|
|
1191
|
-
function
|
|
1192
|
-
const t =
|
|
1194
|
+
function de(e) {
|
|
1195
|
+
const t = qe();
|
|
1193
1196
|
return `${e ?? t}`;
|
|
1194
1197
|
}
|
|
1195
|
-
const
|
|
1196
|
-
function
|
|
1198
|
+
const F = typeof window < "u" ? Me : Ee;
|
|
1199
|
+
function X(e) {
|
|
1197
1200
|
const t = k(e);
|
|
1198
|
-
return
|
|
1201
|
+
return F(() => {
|
|
1199
1202
|
t.current = e;
|
|
1200
|
-
}, [e]),
|
|
1203
|
+
}, [e]), K(
|
|
1201
1204
|
(...n) => t.current?.(...n),
|
|
1202
1205
|
[t]
|
|
1203
1206
|
);
|
|
1204
1207
|
}
|
|
1205
|
-
function
|
|
1206
|
-
return
|
|
1208
|
+
function pe(...e) {
|
|
1209
|
+
return X((t) => {
|
|
1207
1210
|
e.forEach((n) => {
|
|
1208
1211
|
if (n)
|
|
1209
1212
|
switch (typeof n) {
|
|
@@ -1219,27 +1222,27 @@ function fe(...e) {
|
|
|
1219
1222
|
});
|
|
1220
1223
|
});
|
|
1221
1224
|
}
|
|
1222
|
-
function
|
|
1225
|
+
function Lt(e) {
|
|
1223
1226
|
const t = k({ ...e });
|
|
1224
|
-
return
|
|
1227
|
+
return F(() => {
|
|
1225
1228
|
for (const n in e)
|
|
1226
1229
|
t.current[n] = e[n];
|
|
1227
1230
|
}, [e]), t.current;
|
|
1228
1231
|
}
|
|
1229
|
-
const
|
|
1230
|
-
function
|
|
1232
|
+
const We = Ye(null);
|
|
1233
|
+
function Pt(e, t) {
|
|
1231
1234
|
const n = k({
|
|
1232
1235
|
getLayout: () => ({}),
|
|
1233
|
-
setLayout:
|
|
1236
|
+
setLayout: ut
|
|
1234
1237
|
});
|
|
1235
|
-
|
|
1238
|
+
ke(t, () => n.current, []), F(() => {
|
|
1236
1239
|
Object.assign(
|
|
1237
1240
|
n.current,
|
|
1238
|
-
|
|
1241
|
+
Te({ groupId: e })
|
|
1239
1242
|
);
|
|
1240
1243
|
});
|
|
1241
1244
|
}
|
|
1242
|
-
function
|
|
1245
|
+
function Ct({
|
|
1243
1246
|
children: e,
|
|
1244
1247
|
className: t,
|
|
1245
1248
|
defaultLayout: n,
|
|
@@ -1249,38 +1252,44 @@ function bt({
|
|
|
1249
1252
|
groupRef: l,
|
|
1250
1253
|
id: r,
|
|
1251
1254
|
onLayoutChange: s,
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
+
onLayoutChanged: u,
|
|
1256
|
+
orientation: c = "horizontal",
|
|
1257
|
+
style: h,
|
|
1258
|
+
...m
|
|
1255
1259
|
}) {
|
|
1256
|
-
const
|
|
1257
|
-
|
|
1258
|
-
|
|
1260
|
+
const p = k({
|
|
1261
|
+
onLayoutChange: {},
|
|
1262
|
+
onLayoutChanged: {}
|
|
1263
|
+
}), f = X((z) => {
|
|
1264
|
+
_(p.current.onLayoutChange, z) || (p.current.onLayoutChange = z, s?.(z));
|
|
1265
|
+
}), d = X((z) => {
|
|
1266
|
+
_(p.current.onLayoutChanged, z) || (p.current.onLayoutChanged = z, u?.(z));
|
|
1267
|
+
}), y = de(r), S = k(null), [v, x] = Ue(), g = k({
|
|
1259
1268
|
lastExpandedPanelSizes: {},
|
|
1260
1269
|
layouts: {},
|
|
1261
1270
|
panels: [],
|
|
1262
1271
|
separators: []
|
|
1263
|
-
}),
|
|
1264
|
-
|
|
1265
|
-
const
|
|
1266
|
-
(
|
|
1267
|
-
const { interactionState:
|
|
1268
|
-
for (const
|
|
1269
|
-
if (
|
|
1270
|
-
const
|
|
1271
|
-
if (
|
|
1272
|
-
let
|
|
1273
|
-
switch (
|
|
1272
|
+
}), L = pe(S, a);
|
|
1273
|
+
Pt(y, l);
|
|
1274
|
+
const P = X(
|
|
1275
|
+
(z, w) => {
|
|
1276
|
+
const { interactionState: M, mountedGroups: j } = I();
|
|
1277
|
+
for (const Q of j.keys())
|
|
1278
|
+
if (Q.id === z) {
|
|
1279
|
+
const W = j.get(Q);
|
|
1280
|
+
if (W) {
|
|
1281
|
+
let ee = !1;
|
|
1282
|
+
switch (M.state) {
|
|
1274
1283
|
case "active": {
|
|
1275
|
-
|
|
1276
|
-
(
|
|
1284
|
+
ee = M.hitRegions.some(
|
|
1285
|
+
(se) => se.group === Q
|
|
1277
1286
|
);
|
|
1278
1287
|
break;
|
|
1279
1288
|
}
|
|
1280
1289
|
}
|
|
1281
1290
|
return {
|
|
1282
|
-
flexGrow:
|
|
1283
|
-
pointerEvents:
|
|
1291
|
+
flexGrow: W.layout[w] ?? 1,
|
|
1292
|
+
pointerEvents: ee ? "none" : void 0
|
|
1284
1293
|
};
|
|
1285
1294
|
}
|
|
1286
1295
|
}
|
|
@@ -1288,201 +1297,222 @@ function bt({
|
|
|
1288
1297
|
flexGrow: n?.[w] ?? 1
|
|
1289
1298
|
};
|
|
1290
1299
|
}
|
|
1291
|
-
),
|
|
1300
|
+
), R = Ge(
|
|
1292
1301
|
() => ({
|
|
1293
|
-
getPanelStyles:
|
|
1294
|
-
id:
|
|
1295
|
-
orientation:
|
|
1296
|
-
registerPanel: (
|
|
1297
|
-
const w =
|
|
1298
|
-
return w.panels =
|
|
1302
|
+
getPanelStyles: P,
|
|
1303
|
+
id: y,
|
|
1304
|
+
orientation: c,
|
|
1305
|
+
registerPanel: (z) => {
|
|
1306
|
+
const w = g.current;
|
|
1307
|
+
return w.panels = ce(c, [
|
|
1299
1308
|
...w.panels,
|
|
1300
|
-
|
|
1301
|
-
]),
|
|
1309
|
+
z
|
|
1310
|
+
]), x(), () => {
|
|
1302
1311
|
w.panels = w.panels.filter(
|
|
1303
|
-
(
|
|
1304
|
-
),
|
|
1312
|
+
(M) => M !== z
|
|
1313
|
+
), x();
|
|
1305
1314
|
};
|
|
1306
1315
|
},
|
|
1307
|
-
registerSeparator: (
|
|
1308
|
-
const w =
|
|
1309
|
-
return w.separators =
|
|
1316
|
+
registerSeparator: (z) => {
|
|
1317
|
+
const w = g.current;
|
|
1318
|
+
return w.separators = ce(c, [
|
|
1310
1319
|
...w.separators,
|
|
1311
|
-
|
|
1312
|
-
]),
|
|
1320
|
+
z
|
|
1321
|
+
]), x(), () => {
|
|
1313
1322
|
w.separators = w.separators.filter(
|
|
1314
|
-
(
|
|
1315
|
-
),
|
|
1323
|
+
(M) => M !== z
|
|
1324
|
+
), x();
|
|
1316
1325
|
};
|
|
1317
1326
|
}
|
|
1318
1327
|
}),
|
|
1319
|
-
[
|
|
1320
|
-
),
|
|
1328
|
+
[P, y, x, c]
|
|
1329
|
+
), O = Lt({
|
|
1321
1330
|
defaultLayout: n,
|
|
1322
1331
|
disableCursor: o
|
|
1323
|
-
}),
|
|
1324
|
-
return
|
|
1325
|
-
const
|
|
1326
|
-
if (
|
|
1332
|
+
}), $ = k(null);
|
|
1333
|
+
return F(() => {
|
|
1334
|
+
const z = S.current;
|
|
1335
|
+
if (z === null)
|
|
1327
1336
|
return;
|
|
1328
|
-
const w =
|
|
1329
|
-
defaultLayout:
|
|
1330
|
-
disableCursor: !!
|
|
1337
|
+
const w = g.current, M = {
|
|
1338
|
+
defaultLayout: O.defaultLayout,
|
|
1339
|
+
disableCursor: !!O.disableCursor,
|
|
1331
1340
|
disabled: !!i,
|
|
1332
|
-
element:
|
|
1333
|
-
id:
|
|
1334
|
-
inMemoryLastExpandedPanelSizes:
|
|
1335
|
-
inMemoryLayouts:
|
|
1336
|
-
orientation:
|
|
1341
|
+
element: z,
|
|
1342
|
+
id: y,
|
|
1343
|
+
inMemoryLastExpandedPanelSizes: g.current.lastExpandedPanelSizes,
|
|
1344
|
+
inMemoryLayouts: g.current.layouts,
|
|
1345
|
+
orientation: c,
|
|
1337
1346
|
panels: w.panels,
|
|
1338
1347
|
separators: w.separators
|
|
1339
1348
|
};
|
|
1340
|
-
|
|
1341
|
-
const
|
|
1342
|
-
if (
|
|
1343
|
-
const { defaultLayoutDeferred:
|
|
1344
|
-
!
|
|
1345
|
-
|
|
1349
|
+
$.current = M;
|
|
1350
|
+
const j = wt(M), W = I().mountedGroups.get(M);
|
|
1351
|
+
if (W) {
|
|
1352
|
+
const { defaultLayoutDeferred: B, derivedPanelConstraints: te, layout: ne } = W;
|
|
1353
|
+
!B && te.length > 0 && (f(ne), d(ne), w.panels.forEach((ae) => {
|
|
1354
|
+
ae.scheduleUpdate();
|
|
1346
1355
|
}));
|
|
1347
1356
|
}
|
|
1348
|
-
const
|
|
1357
|
+
const ee = N.addListener(
|
|
1349
1358
|
"interactionStateChange",
|
|
1350
1359
|
() => {
|
|
1351
|
-
w.panels.forEach((
|
|
1352
|
-
|
|
1360
|
+
w.panels.forEach((B) => {
|
|
1361
|
+
B.scheduleUpdate();
|
|
1353
1362
|
});
|
|
1354
1363
|
}
|
|
1355
|
-
),
|
|
1364
|
+
), se = N.addListener(
|
|
1356
1365
|
"mountedGroupsChange",
|
|
1357
|
-
(
|
|
1358
|
-
const
|
|
1359
|
-
if (
|
|
1360
|
-
const { defaultLayoutDeferred:
|
|
1361
|
-
if (
|
|
1366
|
+
(B) => {
|
|
1367
|
+
const te = B.get(M);
|
|
1368
|
+
if (te) {
|
|
1369
|
+
const { defaultLayoutDeferred: ne, derivedPanelConstraints: ae, layout: me } = te;
|
|
1370
|
+
if (ne || ae.length === 0)
|
|
1362
1371
|
return;
|
|
1363
|
-
|
|
1364
|
-
|
|
1372
|
+
const { interactionState: Be } = I(), Ke = Be.state !== "active";
|
|
1373
|
+
f(me), Ke && d(me), w.panels.forEach((Xe) => {
|
|
1374
|
+
Xe.scheduleUpdate();
|
|
1365
1375
|
});
|
|
1366
1376
|
}
|
|
1367
1377
|
}
|
|
1368
1378
|
);
|
|
1369
1379
|
return () => {
|
|
1370
|
-
|
|
1380
|
+
$.current = null, j(), ee(), se();
|
|
1371
1381
|
};
|
|
1372
1382
|
}, [
|
|
1373
1383
|
i,
|
|
1384
|
+
y,
|
|
1385
|
+
d,
|
|
1386
|
+
f,
|
|
1374
1387
|
c,
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
b && (b.defaultLayout = n, b.disableCursor = !!o);
|
|
1382
|
-
}), /* @__PURE__ */ B(je.Provider, { value: L, children: /* @__PURE__ */ B(
|
|
1388
|
+
v,
|
|
1389
|
+
O
|
|
1390
|
+
]), Ee(() => {
|
|
1391
|
+
const z = $.current;
|
|
1392
|
+
z && (z.defaultLayout = n, z.disableCursor = !!o);
|
|
1393
|
+
}), /* @__PURE__ */ q(We.Provider, { value: R, children: /* @__PURE__ */ q(
|
|
1383
1394
|
"div",
|
|
1384
1395
|
{
|
|
1385
|
-
...
|
|
1386
|
-
"aria-orientation":
|
|
1396
|
+
...m,
|
|
1397
|
+
"aria-orientation": c,
|
|
1387
1398
|
className: t,
|
|
1388
1399
|
"data-group": !0,
|
|
1389
|
-
"data-testid":
|
|
1390
|
-
id:
|
|
1391
|
-
ref:
|
|
1400
|
+
"data-testid": y,
|
|
1401
|
+
id: y,
|
|
1402
|
+
ref: L,
|
|
1392
1403
|
style: {
|
|
1393
1404
|
height: "100%",
|
|
1394
1405
|
width: "100%",
|
|
1395
1406
|
overflow: "hidden",
|
|
1396
|
-
...
|
|
1407
|
+
...h,
|
|
1397
1408
|
display: "flex",
|
|
1398
|
-
flexDirection:
|
|
1409
|
+
flexDirection: c === "horizontal" ? "row" : "column",
|
|
1399
1410
|
flexWrap: "nowrap"
|
|
1400
1411
|
},
|
|
1401
1412
|
children: e
|
|
1402
1413
|
}
|
|
1403
1414
|
) });
|
|
1404
1415
|
}
|
|
1405
|
-
|
|
1406
|
-
function
|
|
1407
|
-
let n = null;
|
|
1408
|
-
return (o) => {
|
|
1409
|
-
n !== null && clearTimeout(n), n = setTimeout(() => {
|
|
1410
|
-
e(o);
|
|
1411
|
-
}, t);
|
|
1412
|
-
};
|
|
1413
|
-
}
|
|
1414
|
-
function se(e, t) {
|
|
1416
|
+
Ct.displayName = "Group";
|
|
1417
|
+
function ue(e, t) {
|
|
1415
1418
|
return `react-resizable-panels:${[e, ...t].join(":")}`;
|
|
1416
1419
|
}
|
|
1417
|
-
function
|
|
1420
|
+
function Nt({
|
|
1418
1421
|
debounceSaveMs: e = 100,
|
|
1419
1422
|
panelIds: t,
|
|
1420
1423
|
storage: n = localStorage,
|
|
1421
1424
|
...o
|
|
1422
1425
|
}) {
|
|
1423
|
-
const i = t !== void 0, a = "id" in o ? o.id : o.groupId, l =
|
|
1424
|
-
|
|
1426
|
+
const i = t !== void 0, a = "id" in o ? o.id : o.groupId, l = ue(a, t ?? []), r = Je(
|
|
1427
|
+
Rt,
|
|
1425
1428
|
() => n.getItem(l),
|
|
1426
1429
|
() => n.getItem(l)
|
|
1427
|
-
), s =
|
|
1430
|
+
), s = Ge(
|
|
1428
1431
|
() => r ? JSON.parse(r) : void 0,
|
|
1429
1432
|
[r]
|
|
1430
|
-
), u =
|
|
1431
|
-
const
|
|
1432
|
-
|
|
1433
|
-
|
|
1433
|
+
), u = k(null), c = K(() => {
|
|
1434
|
+
const p = u.current;
|
|
1435
|
+
p && (u.current = null, clearTimeout(p));
|
|
1436
|
+
}, []);
|
|
1437
|
+
Me(() => () => {
|
|
1438
|
+
c();
|
|
1439
|
+
}, [c]);
|
|
1440
|
+
const h = K(
|
|
1441
|
+
(p) => {
|
|
1442
|
+
c();
|
|
1443
|
+
let f;
|
|
1444
|
+
i ? f = ue(a, Object.keys(p)) : f = ue(a, []);
|
|
1434
1445
|
try {
|
|
1435
|
-
n.setItem(
|
|
1436
|
-
} catch (
|
|
1437
|
-
console.error(
|
|
1446
|
+
n.setItem(f, JSON.stringify(p));
|
|
1447
|
+
} catch (d) {
|
|
1448
|
+
console.error(d);
|
|
1438
1449
|
}
|
|
1439
|
-
}
|
|
1440
|
-
|
|
1441
|
-
|
|
1450
|
+
},
|
|
1451
|
+
[c, i, a, n]
|
|
1452
|
+
), m = K(
|
|
1453
|
+
(p) => {
|
|
1454
|
+
c(), e === 0 ? h(p) : u.current = setTimeout(() => {
|
|
1455
|
+
h(p);
|
|
1456
|
+
}, e);
|
|
1457
|
+
},
|
|
1458
|
+
[c, e, h]
|
|
1459
|
+
);
|
|
1442
1460
|
return {
|
|
1461
|
+
/**
|
|
1462
|
+
* Pass this value to `Group` as the `defaultLayout` prop.
|
|
1463
|
+
*/
|
|
1443
1464
|
defaultLayout: s,
|
|
1444
|
-
|
|
1465
|
+
/**
|
|
1466
|
+
* Attach this callback on the `Group` as the `onLayoutChange` prop.
|
|
1467
|
+
*
|
|
1468
|
+
* @deprecated Use the {@link onLayoutChanged} prop instead.
|
|
1469
|
+
*/
|
|
1470
|
+
onLayoutChange: m,
|
|
1471
|
+
/**
|
|
1472
|
+
* Attach this callback on the `Group` as the `onLayoutChanged` prop.
|
|
1473
|
+
*/
|
|
1474
|
+
onLayoutChanged: h
|
|
1445
1475
|
};
|
|
1446
1476
|
}
|
|
1447
|
-
function
|
|
1477
|
+
function Rt() {
|
|
1448
1478
|
return function() {
|
|
1449
1479
|
};
|
|
1450
1480
|
}
|
|
1451
|
-
function
|
|
1452
|
-
return
|
|
1481
|
+
function _t() {
|
|
1482
|
+
return Y(null);
|
|
1453
1483
|
}
|
|
1454
|
-
function
|
|
1484
|
+
function At() {
|
|
1455
1485
|
return k(null);
|
|
1456
1486
|
}
|
|
1457
|
-
function
|
|
1458
|
-
const e =
|
|
1459
|
-
return
|
|
1487
|
+
function he() {
|
|
1488
|
+
const e = Ze(We);
|
|
1489
|
+
return b(
|
|
1460
1490
|
e,
|
|
1461
1491
|
"Group Context not found; did you render a Panel or Separator outside of a Group?"
|
|
1462
1492
|
), e;
|
|
1463
1493
|
}
|
|
1464
|
-
function
|
|
1494
|
+
function Mt({
|
|
1465
1495
|
groupId: e,
|
|
1466
1496
|
panelId: t
|
|
1467
1497
|
}) {
|
|
1468
1498
|
const n = () => {
|
|
1469
|
-
const { mountedGroups: r } =
|
|
1499
|
+
const { mountedGroups: r } = I();
|
|
1470
1500
|
for (const [
|
|
1471
1501
|
s,
|
|
1472
1502
|
{
|
|
1473
1503
|
defaultLayoutDeferred: u,
|
|
1474
|
-
derivedPanelConstraints:
|
|
1475
|
-
layout:
|
|
1476
|
-
separatorToPanels:
|
|
1504
|
+
derivedPanelConstraints: c,
|
|
1505
|
+
layout: h,
|
|
1506
|
+
separatorToPanels: m
|
|
1477
1507
|
}
|
|
1478
1508
|
] of r)
|
|
1479
1509
|
if (s.id === e)
|
|
1480
1510
|
return {
|
|
1481
1511
|
defaultLayoutDeferred: u,
|
|
1482
|
-
derivedPanelConstraints:
|
|
1512
|
+
derivedPanelConstraints: c,
|
|
1483
1513
|
group: s,
|
|
1484
|
-
layout:
|
|
1485
|
-
separatorToPanels:
|
|
1514
|
+
layout: h,
|
|
1515
|
+
separatorToPanels: m
|
|
1486
1516
|
};
|
|
1487
1517
|
throw Error(`Group ${e} not found`);
|
|
1488
1518
|
}, o = () => {
|
|
@@ -1508,60 +1538,60 @@ function Pt({
|
|
|
1508
1538
|
return;
|
|
1509
1539
|
const {
|
|
1510
1540
|
defaultLayoutDeferred: u,
|
|
1511
|
-
derivedPanelConstraints:
|
|
1512
|
-
group:
|
|
1513
|
-
layout:
|
|
1514
|
-
separatorToPanels:
|
|
1515
|
-
} = n(),
|
|
1541
|
+
derivedPanelConstraints: c,
|
|
1542
|
+
group: h,
|
|
1543
|
+
layout: m,
|
|
1544
|
+
separatorToPanels: p
|
|
1545
|
+
} = n(), f = h.panels.findIndex((v) => v.id === t), d = f === h.panels.length - 1, y = Z({
|
|
1516
1546
|
delta: d ? s - r : r - s,
|
|
1517
|
-
initialLayout:
|
|
1518
|
-
panelConstraints:
|
|
1519
|
-
pivotIndices: d ? [
|
|
1520
|
-
prevLayout:
|
|
1547
|
+
initialLayout: m,
|
|
1548
|
+
panelConstraints: c,
|
|
1549
|
+
pivotIndices: d ? [f - 1, f] : [f, f + 1],
|
|
1550
|
+
prevLayout: m,
|
|
1521
1551
|
trigger: "imperative-api"
|
|
1522
|
-
}),
|
|
1523
|
-
layout:
|
|
1524
|
-
panelConstraints:
|
|
1552
|
+
}), S = A({
|
|
1553
|
+
layout: y,
|
|
1554
|
+
panelConstraints: c
|
|
1525
1555
|
});
|
|
1526
|
-
|
|
1527
|
-
mountedGroups: new Map(v.mountedGroups).set(
|
|
1556
|
+
_(m, S) || E((v) => ({
|
|
1557
|
+
mountedGroups: new Map(v.mountedGroups).set(h, {
|
|
1528
1558
|
defaultLayoutDeferred: u,
|
|
1529
|
-
derivedPanelConstraints:
|
|
1530
|
-
layout:
|
|
1531
|
-
separatorToPanels:
|
|
1559
|
+
derivedPanelConstraints: c,
|
|
1560
|
+
layout: S,
|
|
1561
|
+
separatorToPanels: p
|
|
1532
1562
|
})
|
|
1533
1563
|
}));
|
|
1534
1564
|
};
|
|
1535
1565
|
return {
|
|
1536
1566
|
collapse: () => {
|
|
1537
|
-
const { collapsible: r, collapsedSize: s } = o(), { mutableValues: u } = i(),
|
|
1538
|
-
r &&
|
|
1567
|
+
const { collapsible: r, collapsedSize: s } = o(), { mutableValues: u } = i(), c = a();
|
|
1568
|
+
r && c !== s && (u.expandToSize = c, l(s));
|
|
1539
1569
|
},
|
|
1540
1570
|
expand: () => {
|
|
1541
|
-
const { collapsible: r, collapsedSize: s, minSize: u } = o(), { mutableValues:
|
|
1542
|
-
if (r &&
|
|
1543
|
-
let
|
|
1544
|
-
|
|
1571
|
+
const { collapsible: r, collapsedSize: s, minSize: u } = o(), { mutableValues: c } = i(), h = a();
|
|
1572
|
+
if (r && h === s) {
|
|
1573
|
+
let m = c.expandToSize ?? u;
|
|
1574
|
+
m === 0 && (m = 1), l(m);
|
|
1545
1575
|
}
|
|
1546
1576
|
},
|
|
1547
1577
|
getSize: () => {
|
|
1548
|
-
const { group: r } = n(), s = a(), { element: u } = i(),
|
|
1578
|
+
const { group: r } = n(), s = a(), { element: u } = i(), c = r.orientation === "horizontal" ? u.offsetWidth : u.offsetHeight;
|
|
1549
1579
|
return {
|
|
1550
1580
|
asPercentage: s,
|
|
1551
|
-
inPixels:
|
|
1581
|
+
inPixels: c
|
|
1552
1582
|
};
|
|
1553
1583
|
},
|
|
1554
1584
|
isCollapsed: () => {
|
|
1555
1585
|
const { collapsible: r, collapsedSize: s } = o(), u = a();
|
|
1556
|
-
return r &&
|
|
1586
|
+
return r && C(s, u);
|
|
1557
1587
|
},
|
|
1558
1588
|
resize: (r) => {
|
|
1559
1589
|
if (a() !== r) {
|
|
1560
1590
|
let u;
|
|
1561
1591
|
switch (typeof r) {
|
|
1562
1592
|
case "number": {
|
|
1563
|
-
const { group:
|
|
1564
|
-
u =
|
|
1593
|
+
const { group: c } = n(), h = U({ group: c });
|
|
1594
|
+
u = D(r / h * 100);
|
|
1565
1595
|
break;
|
|
1566
1596
|
}
|
|
1567
1597
|
case "string": {
|
|
@@ -1574,25 +1604,25 @@ function Pt({
|
|
|
1574
1604
|
}
|
|
1575
1605
|
};
|
|
1576
1606
|
}
|
|
1577
|
-
function
|
|
1578
|
-
const { id: n } =
|
|
1579
|
-
collapse:
|
|
1580
|
-
expand:
|
|
1607
|
+
function Et(e, t) {
|
|
1608
|
+
const { id: n } = he(), o = k({
|
|
1609
|
+
collapse: le,
|
|
1610
|
+
expand: le,
|
|
1581
1611
|
getSize: () => ({
|
|
1582
1612
|
asPercentage: 0,
|
|
1583
1613
|
inPixels: 0
|
|
1584
1614
|
}),
|
|
1585
1615
|
isCollapsed: () => !1,
|
|
1586
|
-
resize:
|
|
1616
|
+
resize: le
|
|
1587
1617
|
});
|
|
1588
|
-
|
|
1618
|
+
ke(t, () => o.current, []), F(() => {
|
|
1589
1619
|
Object.assign(
|
|
1590
1620
|
o.current,
|
|
1591
|
-
|
|
1621
|
+
Mt({ groupId: n, panelId: e })
|
|
1592
1622
|
);
|
|
1593
1623
|
});
|
|
1594
1624
|
}
|
|
1595
|
-
function
|
|
1625
|
+
function kt({
|
|
1596
1626
|
children: e,
|
|
1597
1627
|
className: t,
|
|
1598
1628
|
collapsedSize: n = "0%",
|
|
@@ -1603,22 +1633,22 @@ function Ct({
|
|
|
1603
1633
|
maxSize: r = "100%",
|
|
1604
1634
|
minSize: s = "0%",
|
|
1605
1635
|
onResize: u,
|
|
1606
|
-
panelRef:
|
|
1607
|
-
style:
|
|
1608
|
-
...
|
|
1636
|
+
panelRef: c,
|
|
1637
|
+
style: h,
|
|
1638
|
+
...m
|
|
1609
1639
|
}) {
|
|
1610
|
-
const
|
|
1611
|
-
(
|
|
1612
|
-
u?.(
|
|
1640
|
+
const p = !!l, f = de(l), d = k(null), y = pe(d, a), [, S] = Ue(), { getPanelStyles: v, id: x, registerPanel: g } = he(), L = u !== null, P = X(
|
|
1641
|
+
(O, $, z) => {
|
|
1642
|
+
u?.(O, l, z);
|
|
1613
1643
|
}
|
|
1614
1644
|
);
|
|
1615
|
-
|
|
1616
|
-
const
|
|
1617
|
-
if (
|
|
1645
|
+
F(() => {
|
|
1646
|
+
const O = d.current;
|
|
1647
|
+
if (O !== null)
|
|
1618
1648
|
return g({
|
|
1619
|
-
element:
|
|
1620
|
-
id:
|
|
1621
|
-
idIsStable:
|
|
1649
|
+
element: O,
|
|
1650
|
+
id: f,
|
|
1651
|
+
idIsStable: p,
|
|
1622
1652
|
mutableValues: {
|
|
1623
1653
|
expandToSize: void 0,
|
|
1624
1654
|
prevSize: void 0
|
|
@@ -1631,46 +1661,46 @@ function Ct({
|
|
|
1631
1661
|
maxSize: r,
|
|
1632
1662
|
minSize: s
|
|
1633
1663
|
},
|
|
1634
|
-
scheduleUpdate:
|
|
1664
|
+
scheduleUpdate: S
|
|
1635
1665
|
});
|
|
1636
1666
|
}, [
|
|
1637
1667
|
n,
|
|
1638
1668
|
o,
|
|
1639
1669
|
i,
|
|
1640
|
-
|
|
1670
|
+
S,
|
|
1641
1671
|
L,
|
|
1642
|
-
|
|
1643
|
-
|
|
1672
|
+
f,
|
|
1673
|
+
p,
|
|
1644
1674
|
r,
|
|
1645
1675
|
s,
|
|
1646
1676
|
P,
|
|
1647
1677
|
g
|
|
1648
|
-
]),
|
|
1649
|
-
const R = v(x,
|
|
1650
|
-
return /* @__PURE__ */
|
|
1678
|
+
]), Et(f, c);
|
|
1679
|
+
const R = v(x, f);
|
|
1680
|
+
return /* @__PURE__ */ q(
|
|
1651
1681
|
"div",
|
|
1652
1682
|
{
|
|
1653
|
-
...
|
|
1683
|
+
...m,
|
|
1654
1684
|
"data-panel": !0,
|
|
1655
|
-
"data-testid":
|
|
1656
|
-
id:
|
|
1657
|
-
ref:
|
|
1685
|
+
"data-testid": f,
|
|
1686
|
+
id: f,
|
|
1687
|
+
ref: y,
|
|
1658
1688
|
style: {
|
|
1659
|
-
...
|
|
1689
|
+
...Gt,
|
|
1660
1690
|
flexBasis: 0,
|
|
1661
1691
|
flexShrink: 1,
|
|
1662
1692
|
// Prevent Panel content from interfering with panel size
|
|
1663
1693
|
overflow: "hidden",
|
|
1664
1694
|
...R
|
|
1665
1695
|
},
|
|
1666
|
-
children: /* @__PURE__ */
|
|
1696
|
+
children: /* @__PURE__ */ q(
|
|
1667
1697
|
"div",
|
|
1668
1698
|
{
|
|
1669
1699
|
className: t,
|
|
1670
1700
|
style: {
|
|
1671
1701
|
width: "100%",
|
|
1672
1702
|
height: "100%",
|
|
1673
|
-
...
|
|
1703
|
+
...h
|
|
1674
1704
|
},
|
|
1675
1705
|
children: e
|
|
1676
1706
|
}
|
|
@@ -1678,8 +1708,8 @@ function Ct({
|
|
|
1678
1708
|
}
|
|
1679
1709
|
);
|
|
1680
1710
|
}
|
|
1681
|
-
|
|
1682
|
-
const
|
|
1711
|
+
kt.displayName = "Panel";
|
|
1712
|
+
const Gt = {
|
|
1683
1713
|
minHeight: 0,
|
|
1684
1714
|
maxHeight: "100%",
|
|
1685
1715
|
height: "auto",
|
|
@@ -1691,13 +1721,13 @@ const Mt = {
|
|
|
1691
1721
|
padding: 0,
|
|
1692
1722
|
margin: 0
|
|
1693
1723
|
};
|
|
1694
|
-
function
|
|
1695
|
-
return
|
|
1724
|
+
function Ft() {
|
|
1725
|
+
return Y(null);
|
|
1696
1726
|
}
|
|
1697
|
-
function
|
|
1727
|
+
function $t() {
|
|
1698
1728
|
return k(null);
|
|
1699
1729
|
}
|
|
1700
|
-
function
|
|
1730
|
+
function It({
|
|
1701
1731
|
layout: e,
|
|
1702
1732
|
panelConstraints: t,
|
|
1703
1733
|
panelId: n,
|
|
@@ -1708,23 +1738,23 @@ function Et({
|
|
|
1708
1738
|
(s) => s.panelId === n
|
|
1709
1739
|
);
|
|
1710
1740
|
if (r) {
|
|
1711
|
-
const s = r.maxSize, u = a = r.collapsible ? r.collapsedSize : r.minSize,
|
|
1712
|
-
a =
|
|
1713
|
-
layout:
|
|
1741
|
+
const s = r.maxSize, u = a = r.collapsible ? r.collapsedSize : r.minSize, c = [o, o + 1];
|
|
1742
|
+
a = A({
|
|
1743
|
+
layout: Z({
|
|
1714
1744
|
delta: u - l,
|
|
1715
1745
|
initialLayout: e,
|
|
1716
1746
|
panelConstraints: t,
|
|
1717
|
-
pivotIndices:
|
|
1747
|
+
pivotIndices: c,
|
|
1718
1748
|
prevLayout: e,
|
|
1719
1749
|
trigger: "keyboard"
|
|
1720
1750
|
}),
|
|
1721
1751
|
panelConstraints: t
|
|
1722
|
-
})[n], i =
|
|
1723
|
-
layout:
|
|
1752
|
+
})[n], i = A({
|
|
1753
|
+
layout: Z({
|
|
1724
1754
|
delta: s - l,
|
|
1725
1755
|
initialLayout: e,
|
|
1726
1756
|
panelConstraints: t,
|
|
1727
|
-
pivotIndices:
|
|
1757
|
+
pivotIndices: c,
|
|
1728
1758
|
prevLayout: e,
|
|
1729
1759
|
trigger: "keyboard"
|
|
1730
1760
|
}),
|
|
@@ -1738,7 +1768,7 @@ function Et({
|
|
|
1738
1768
|
valueNow: l
|
|
1739
1769
|
};
|
|
1740
1770
|
}
|
|
1741
|
-
function
|
|
1771
|
+
function Dt({
|
|
1742
1772
|
children: e,
|
|
1743
1773
|
className: t,
|
|
1744
1774
|
elementRef: n,
|
|
@@ -1746,41 +1776,41 @@ function kt({
|
|
|
1746
1776
|
style: i,
|
|
1747
1777
|
...a
|
|
1748
1778
|
}) {
|
|
1749
|
-
const l =
|
|
1750
|
-
id:
|
|
1751
|
-
orientation:
|
|
1779
|
+
const l = de(o), [r, s] = Y({}), [u, c] = Y("inactive"), h = k(null), m = pe(h, n), {
|
|
1780
|
+
id: p,
|
|
1781
|
+
orientation: f,
|
|
1752
1782
|
registerSeparator: d
|
|
1753
|
-
} =
|
|
1754
|
-
return
|
|
1755
|
-
const
|
|
1756
|
-
if (
|
|
1783
|
+
} = he(), y = f === "horizontal" ? "vertical" : "horizontal";
|
|
1784
|
+
return F(() => {
|
|
1785
|
+
const S = h.current;
|
|
1786
|
+
if (S !== null) {
|
|
1757
1787
|
const v = {
|
|
1758
|
-
element:
|
|
1788
|
+
element: S,
|
|
1759
1789
|
id: l
|
|
1760
|
-
}, x = d(v), g =
|
|
1790
|
+
}, x = d(v), g = N.addListener(
|
|
1761
1791
|
"interactionStateChange",
|
|
1762
1792
|
(P) => {
|
|
1763
|
-
|
|
1793
|
+
c(
|
|
1764
1794
|
P.state !== "inactive" && P.hitRegions.some(
|
|
1765
1795
|
(R) => R.separator === v
|
|
1766
1796
|
) ? P.state : "inactive"
|
|
1767
1797
|
);
|
|
1768
1798
|
}
|
|
1769
|
-
), L =
|
|
1799
|
+
), L = N.addListener(
|
|
1770
1800
|
"mountedGroupsChange",
|
|
1771
1801
|
(P) => {
|
|
1772
1802
|
P.forEach(
|
|
1773
|
-
({ derivedPanelConstraints: R, layout:
|
|
1774
|
-
if (
|
|
1775
|
-
const
|
|
1776
|
-
if (
|
|
1777
|
-
const
|
|
1803
|
+
({ derivedPanelConstraints: R, layout: O, separatorToPanels: $ }, z) => {
|
|
1804
|
+
if (z.id === p) {
|
|
1805
|
+
const w = $.get(v);
|
|
1806
|
+
if (w) {
|
|
1807
|
+
const M = w[0], j = z.panels.indexOf(M);
|
|
1778
1808
|
s(
|
|
1779
|
-
|
|
1780
|
-
layout:
|
|
1809
|
+
It({
|
|
1810
|
+
layout: O,
|
|
1781
1811
|
panelConstraints: R,
|
|
1782
|
-
panelId:
|
|
1783
|
-
panelIndex:
|
|
1812
|
+
panelId: M.id,
|
|
1813
|
+
panelIndex: j
|
|
1784
1814
|
})
|
|
1785
1815
|
);
|
|
1786
1816
|
}
|
|
@@ -1793,12 +1823,12 @@ function kt({
|
|
|
1793
1823
|
g(), L(), x();
|
|
1794
1824
|
};
|
|
1795
1825
|
}
|
|
1796
|
-
}, [
|
|
1826
|
+
}, [p, l, d]), /* @__PURE__ */ q(
|
|
1797
1827
|
"div",
|
|
1798
1828
|
{
|
|
1799
1829
|
...a,
|
|
1800
1830
|
"aria-controls": r.valueControls,
|
|
1801
|
-
"aria-orientation":
|
|
1831
|
+
"aria-orientation": y,
|
|
1802
1832
|
"aria-valuemax": r.valueMax,
|
|
1803
1833
|
"aria-valuemin": r.valueMin,
|
|
1804
1834
|
"aria-valuenow": r.valueNow,
|
|
@@ -1807,7 +1837,7 @@ function kt({
|
|
|
1807
1837
|
"data-separator": u,
|
|
1808
1838
|
"data-testid": l,
|
|
1809
1839
|
id: l,
|
|
1810
|
-
ref:
|
|
1840
|
+
ref: m,
|
|
1811
1841
|
role: "separator",
|
|
1812
1842
|
style: {
|
|
1813
1843
|
flexBasis: "auto",
|
|
@@ -1819,15 +1849,15 @@ function kt({
|
|
|
1819
1849
|
}
|
|
1820
1850
|
);
|
|
1821
1851
|
}
|
|
1822
|
-
|
|
1852
|
+
Dt.displayName = "Separator";
|
|
1823
1853
|
export {
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1854
|
+
Ct as Group,
|
|
1855
|
+
kt as Panel,
|
|
1856
|
+
Dt as Separator,
|
|
1857
|
+
Nt as useDefaultLayout,
|
|
1858
|
+
_t as useGroupCallbackRef,
|
|
1859
|
+
At as useGroupRef,
|
|
1860
|
+
Ft as usePanelCallbackRef,
|
|
1861
|
+
$t as usePanelRef
|
|
1832
1862
|
};
|
|
1833
1863
|
//# sourceMappingURL=react-resizable-panels.js.map
|