react-resizable-panels 4.3.3 → 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,66 +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
|
-
const { interactionState: t } =
|
|
1041
|
+
const { interactionState: t } = I();
|
|
1040
1042
|
switch (t.state) {
|
|
1041
1043
|
case "active":
|
|
1042
|
-
|
|
1044
|
+
E({
|
|
1043
1045
|
cursorFlags: 0,
|
|
1044
1046
|
interactionState: {
|
|
1045
1047
|
state: "inactive"
|
|
1046
1048
|
}
|
|
1047
|
-
}), t.hitRegions.length > 0 && (
|
|
1049
|
+
}), t.hitRegions.length > 0 && (fe(e.currentTarget), E((n) => ({
|
|
1050
|
+
mountedGroups: new Map(n.mountedGroups)
|
|
1051
|
+
})), e.preventDefault());
|
|
1048
1052
|
}
|
|
1049
1053
|
}
|
|
1050
|
-
function
|
|
1054
|
+
function Re(e) {
|
|
1051
1055
|
let t = 0, n = 0;
|
|
1052
1056
|
const o = {};
|
|
1053
1057
|
for (const a of e)
|
|
1054
1058
|
if (a.defaultSize !== void 0) {
|
|
1055
1059
|
t++;
|
|
1056
|
-
const l =
|
|
1060
|
+
const l = D(a.defaultSize);
|
|
1057
1061
|
n += l, o[a.panelId] = l;
|
|
1058
1062
|
} else
|
|
1059
1063
|
o[a.panelId] = void 0;
|
|
1060
1064
|
const i = e.length - t;
|
|
1061
1065
|
if (i !== 0) {
|
|
1062
|
-
const a =
|
|
1066
|
+
const a = D((100 - n) / i);
|
|
1063
1067
|
for (const l of e)
|
|
1064
1068
|
l.defaultSize === void 0 && (o[l.panelId] = a);
|
|
1065
1069
|
}
|
|
1066
1070
|
return o;
|
|
1067
1071
|
}
|
|
1068
|
-
function
|
|
1072
|
+
function xt(e, t, n) {
|
|
1069
1073
|
if (!n[0])
|
|
1070
1074
|
return;
|
|
1071
1075
|
const i = e.panels.find((u) => u.element === t);
|
|
1072
1076
|
if (!i || !i.onResize)
|
|
1073
1077
|
return;
|
|
1074
|
-
const a =
|
|
1075
|
-
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),
|
|
1076
1080
|
inPixels: l
|
|
1077
1081
|
};
|
|
1078
1082
|
i.mutableValues.prevSize = s, i.onResize(s, i.id, r);
|
|
1079
1083
|
}
|
|
1080
|
-
function
|
|
1084
|
+
function zt(e, t) {
|
|
1081
1085
|
if (Object.keys(e).length !== Object.keys(t).length)
|
|
1082
1086
|
return !1;
|
|
1083
1087
|
for (const o in e)
|
|
@@ -1085,7 +1089,7 @@ function gt(e, t) {
|
|
|
1085
1089
|
return !1;
|
|
1086
1090
|
return !0;
|
|
1087
1091
|
}
|
|
1088
|
-
function
|
|
1092
|
+
function bt(e, t) {
|
|
1089
1093
|
const n = e.map((i) => i.id), o = Object.keys(t);
|
|
1090
1094
|
if (n.length !== o.length)
|
|
1091
1095
|
return !1;
|
|
@@ -1094,28 +1098,28 @@ function St(e, t) {
|
|
|
1094
1098
|
return !1;
|
|
1095
1099
|
return !0;
|
|
1096
1100
|
}
|
|
1097
|
-
const
|
|
1098
|
-
function
|
|
1101
|
+
const H = /* @__PURE__ */ new Map();
|
|
1102
|
+
function wt(e) {
|
|
1099
1103
|
let t = !0;
|
|
1100
|
-
|
|
1104
|
+
b(
|
|
1101
1105
|
e.element.ownerDocument.defaultView,
|
|
1102
1106
|
"Cannot register an unmounted Group"
|
|
1103
1107
|
);
|
|
1104
|
-
const n = e.element.ownerDocument.defaultView.ResizeObserver, o = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set(), a = new n((
|
|
1105
|
-
for (const d of
|
|
1106
|
-
const { borderBoxSize:
|
|
1107
|
-
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) {
|
|
1108
1112
|
if (t) {
|
|
1109
|
-
if (
|
|
1113
|
+
if (U({ group: e }) === 0)
|
|
1110
1114
|
return;
|
|
1111
|
-
|
|
1115
|
+
E((x) => {
|
|
1112
1116
|
const g = x.mountedGroups.get(e);
|
|
1113
1117
|
if (g) {
|
|
1114
|
-
const L =
|
|
1118
|
+
const L = ye(e), P = g.defaultLayoutDeferred ? Re(L) : g.layout, R = A({
|
|
1115
1119
|
layout: P,
|
|
1116
1120
|
panelConstraints: L
|
|
1117
1121
|
});
|
|
1118
|
-
return !g.defaultLayoutDeferred &&
|
|
1122
|
+
return !g.defaultLayoutDeferred && _(P, R) && zt(
|
|
1119
1123
|
g.derivedPanelConstraints,
|
|
1120
1124
|
L
|
|
1121
1125
|
) ? x : {
|
|
@@ -1131,78 +1135,78 @@ function vt(e) {
|
|
|
1131
1135
|
});
|
|
1132
1136
|
}
|
|
1133
1137
|
} else
|
|
1134
|
-
|
|
1138
|
+
xt(e, S, y);
|
|
1135
1139
|
}
|
|
1136
1140
|
});
|
|
1137
|
-
a.observe(e.element), e.panels.forEach((
|
|
1138
|
-
|
|
1139
|
-
!o.has(
|
|
1140
|
-
`Panel ids must be unique; id "${
|
|
1141
|
-
), 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);
|
|
1142
1146
|
});
|
|
1143
|
-
const l =
|
|
1147
|
+
const l = U({ group: e }), r = ye(e), s = e.panels.map(({ id: f }) => f).join(",");
|
|
1144
1148
|
let u = e.defaultLayout;
|
|
1145
|
-
u && (
|
|
1146
|
-
const
|
|
1147
|
-
layout:
|
|
1149
|
+
u && (bt(e.panels, u) || (u = void 0));
|
|
1150
|
+
const c = e.inMemoryLayouts[s] ?? u ?? Re(r), h = A({
|
|
1151
|
+
layout: c,
|
|
1148
1152
|
panelConstraints: r
|
|
1149
|
-
}),
|
|
1150
|
-
return
|
|
1153
|
+
}), m = Oe(e), p = e.element.ownerDocument;
|
|
1154
|
+
return E((f) => {
|
|
1151
1155
|
const d = /* @__PURE__ */ new Map();
|
|
1152
|
-
return
|
|
1153
|
-
|
|
1154
|
-
(
|
|
1155
|
-
),
|
|
1156
|
-
|
|
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);
|
|
1157
1161
|
}), {
|
|
1158
|
-
mountedGroups: new Map(
|
|
1162
|
+
mountedGroups: new Map(f.mountedGroups).set(e, {
|
|
1159
1163
|
defaultLayoutDeferred: l === 0,
|
|
1160
1164
|
derivedPanelConstraints: r,
|
|
1161
|
-
layout:
|
|
1165
|
+
layout: h,
|
|
1162
1166
|
separatorToPanels: d
|
|
1163
1167
|
})
|
|
1164
1168
|
};
|
|
1165
|
-
}), e.separators.forEach((
|
|
1166
|
-
|
|
1167
|
-
!i.has(
|
|
1168
|
-
`Separator ids must be unique; id "${
|
|
1169
|
-
), i.add(
|
|
1170
|
-
}),
|
|
1171
|
-
t = !1,
|
|
1172
|
-
|
|
1173
|
-
Math.max(0, (
|
|
1174
|
-
),
|
|
1175
|
-
const
|
|
1176
|
-
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 };
|
|
1177
1181
|
}), e.separators.forEach((d) => {
|
|
1178
|
-
d.element.removeEventListener("keydown",
|
|
1179
|
-
}),
|
|
1182
|
+
d.element.removeEventListener("keydown", ge);
|
|
1183
|
+
}), H.get(p) || (p.removeEventListener(
|
|
1180
1184
|
"pointerdown",
|
|
1181
|
-
|
|
1185
|
+
be,
|
|
1182
1186
|
!0
|
|
1183
|
-
),
|
|
1187
|
+
), p.removeEventListener("pointerleave", Le), p.removeEventListener("pointermove", Pe), p.removeEventListener("pointerup", Ce, !0)), a.disconnect();
|
|
1184
1188
|
};
|
|
1185
1189
|
}
|
|
1186
|
-
function
|
|
1187
|
-
const [e, t] =
|
|
1190
|
+
function Ue() {
|
|
1191
|
+
const [e, t] = Y({}), n = K(() => t({}), []);
|
|
1188
1192
|
return [e, n];
|
|
1189
1193
|
}
|
|
1190
|
-
function
|
|
1191
|
-
const t =
|
|
1194
|
+
function de(e) {
|
|
1195
|
+
const t = qe();
|
|
1192
1196
|
return `${e ?? t}`;
|
|
1193
1197
|
}
|
|
1194
|
-
const
|
|
1195
|
-
function
|
|
1198
|
+
const F = typeof window < "u" ? Me : Ee;
|
|
1199
|
+
function X(e) {
|
|
1196
1200
|
const t = k(e);
|
|
1197
|
-
return
|
|
1201
|
+
return F(() => {
|
|
1198
1202
|
t.current = e;
|
|
1199
|
-
}, [e]),
|
|
1203
|
+
}, [e]), K(
|
|
1200
1204
|
(...n) => t.current?.(...n),
|
|
1201
1205
|
[t]
|
|
1202
1206
|
);
|
|
1203
1207
|
}
|
|
1204
|
-
function
|
|
1205
|
-
return
|
|
1208
|
+
function pe(...e) {
|
|
1209
|
+
return X((t) => {
|
|
1206
1210
|
e.forEach((n) => {
|
|
1207
1211
|
if (n)
|
|
1208
1212
|
switch (typeof n) {
|
|
@@ -1218,27 +1222,27 @@ function fe(...e) {
|
|
|
1218
1222
|
});
|
|
1219
1223
|
});
|
|
1220
1224
|
}
|
|
1221
|
-
function
|
|
1225
|
+
function Lt(e) {
|
|
1222
1226
|
const t = k({ ...e });
|
|
1223
|
-
return
|
|
1227
|
+
return F(() => {
|
|
1224
1228
|
for (const n in e)
|
|
1225
1229
|
t.current[n] = e[n];
|
|
1226
1230
|
}, [e]), t.current;
|
|
1227
1231
|
}
|
|
1228
|
-
const
|
|
1229
|
-
function
|
|
1232
|
+
const We = Ye(null);
|
|
1233
|
+
function Pt(e, t) {
|
|
1230
1234
|
const n = k({
|
|
1231
1235
|
getLayout: () => ({}),
|
|
1232
|
-
setLayout:
|
|
1236
|
+
setLayout: ut
|
|
1233
1237
|
});
|
|
1234
|
-
|
|
1238
|
+
ke(t, () => n.current, []), F(() => {
|
|
1235
1239
|
Object.assign(
|
|
1236
1240
|
n.current,
|
|
1237
|
-
|
|
1241
|
+
Te({ groupId: e })
|
|
1238
1242
|
);
|
|
1239
1243
|
});
|
|
1240
1244
|
}
|
|
1241
|
-
function
|
|
1245
|
+
function Ct({
|
|
1242
1246
|
children: e,
|
|
1243
1247
|
className: t,
|
|
1244
1248
|
defaultLayout: n,
|
|
@@ -1248,38 +1252,44 @@ function bt({
|
|
|
1248
1252
|
groupRef: l,
|
|
1249
1253
|
id: r,
|
|
1250
1254
|
onLayoutChange: s,
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1255
|
+
onLayoutChanged: u,
|
|
1256
|
+
orientation: c = "horizontal",
|
|
1257
|
+
style: h,
|
|
1258
|
+
...m
|
|
1254
1259
|
}) {
|
|
1255
|
-
const
|
|
1256
|
-
|
|
1257
|
-
|
|
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({
|
|
1258
1268
|
lastExpandedPanelSizes: {},
|
|
1259
1269
|
layouts: {},
|
|
1260
1270
|
panels: [],
|
|
1261
1271
|
separators: []
|
|
1262
|
-
}),
|
|
1263
|
-
|
|
1264
|
-
const
|
|
1265
|
-
(
|
|
1266
|
-
const { interactionState:
|
|
1267
|
-
for (const
|
|
1268
|
-
if (
|
|
1269
|
-
const
|
|
1270
|
-
if (
|
|
1271
|
-
let
|
|
1272
|
-
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) {
|
|
1273
1283
|
case "active": {
|
|
1274
|
-
|
|
1275
|
-
(
|
|
1284
|
+
ee = M.hitRegions.some(
|
|
1285
|
+
(se) => se.group === Q
|
|
1276
1286
|
);
|
|
1277
1287
|
break;
|
|
1278
1288
|
}
|
|
1279
1289
|
}
|
|
1280
1290
|
return {
|
|
1281
|
-
flexGrow:
|
|
1282
|
-
pointerEvents:
|
|
1291
|
+
flexGrow: W.layout[w] ?? 1,
|
|
1292
|
+
pointerEvents: ee ? "none" : void 0
|
|
1283
1293
|
};
|
|
1284
1294
|
}
|
|
1285
1295
|
}
|
|
@@ -1287,201 +1297,222 @@ function bt({
|
|
|
1287
1297
|
flexGrow: n?.[w] ?? 1
|
|
1288
1298
|
};
|
|
1289
1299
|
}
|
|
1290
|
-
),
|
|
1300
|
+
), R = Ge(
|
|
1291
1301
|
() => ({
|
|
1292
|
-
getPanelStyles:
|
|
1293
|
-
id:
|
|
1294
|
-
orientation:
|
|
1295
|
-
registerPanel: (
|
|
1296
|
-
const w =
|
|
1297
|
-
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, [
|
|
1298
1308
|
...w.panels,
|
|
1299
|
-
|
|
1300
|
-
]),
|
|
1309
|
+
z
|
|
1310
|
+
]), x(), () => {
|
|
1301
1311
|
w.panels = w.panels.filter(
|
|
1302
|
-
(
|
|
1303
|
-
),
|
|
1312
|
+
(M) => M !== z
|
|
1313
|
+
), x();
|
|
1304
1314
|
};
|
|
1305
1315
|
},
|
|
1306
|
-
registerSeparator: (
|
|
1307
|
-
const w =
|
|
1308
|
-
return w.separators =
|
|
1316
|
+
registerSeparator: (z) => {
|
|
1317
|
+
const w = g.current;
|
|
1318
|
+
return w.separators = ce(c, [
|
|
1309
1319
|
...w.separators,
|
|
1310
|
-
|
|
1311
|
-
]),
|
|
1320
|
+
z
|
|
1321
|
+
]), x(), () => {
|
|
1312
1322
|
w.separators = w.separators.filter(
|
|
1313
|
-
(
|
|
1314
|
-
),
|
|
1323
|
+
(M) => M !== z
|
|
1324
|
+
), x();
|
|
1315
1325
|
};
|
|
1316
1326
|
}
|
|
1317
1327
|
}),
|
|
1318
|
-
[
|
|
1319
|
-
),
|
|
1328
|
+
[P, y, x, c]
|
|
1329
|
+
), O = Lt({
|
|
1320
1330
|
defaultLayout: n,
|
|
1321
1331
|
disableCursor: o
|
|
1322
|
-
}),
|
|
1323
|
-
return
|
|
1324
|
-
const
|
|
1325
|
-
if (
|
|
1332
|
+
}), $ = k(null);
|
|
1333
|
+
return F(() => {
|
|
1334
|
+
const z = S.current;
|
|
1335
|
+
if (z === null)
|
|
1326
1336
|
return;
|
|
1327
|
-
const w =
|
|
1328
|
-
defaultLayout:
|
|
1329
|
-
disableCursor: !!
|
|
1337
|
+
const w = g.current, M = {
|
|
1338
|
+
defaultLayout: O.defaultLayout,
|
|
1339
|
+
disableCursor: !!O.disableCursor,
|
|
1330
1340
|
disabled: !!i,
|
|
1331
|
-
element:
|
|
1332
|
-
id:
|
|
1333
|
-
inMemoryLastExpandedPanelSizes:
|
|
1334
|
-
inMemoryLayouts:
|
|
1335
|
-
orientation:
|
|
1341
|
+
element: z,
|
|
1342
|
+
id: y,
|
|
1343
|
+
inMemoryLastExpandedPanelSizes: g.current.lastExpandedPanelSizes,
|
|
1344
|
+
inMemoryLayouts: g.current.layouts,
|
|
1345
|
+
orientation: c,
|
|
1336
1346
|
panels: w.panels,
|
|
1337
1347
|
separators: w.separators
|
|
1338
1348
|
};
|
|
1339
|
-
|
|
1340
|
-
const
|
|
1341
|
-
if (
|
|
1342
|
-
const { defaultLayoutDeferred:
|
|
1343
|
-
!
|
|
1344
|
-
|
|
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();
|
|
1345
1355
|
}));
|
|
1346
1356
|
}
|
|
1347
|
-
const
|
|
1357
|
+
const ee = N.addListener(
|
|
1348
1358
|
"interactionStateChange",
|
|
1349
1359
|
() => {
|
|
1350
|
-
w.panels.forEach((
|
|
1351
|
-
|
|
1360
|
+
w.panels.forEach((B) => {
|
|
1361
|
+
B.scheduleUpdate();
|
|
1352
1362
|
});
|
|
1353
1363
|
}
|
|
1354
|
-
),
|
|
1364
|
+
), se = N.addListener(
|
|
1355
1365
|
"mountedGroupsChange",
|
|
1356
|
-
(
|
|
1357
|
-
const
|
|
1358
|
-
if (
|
|
1359
|
-
const { defaultLayoutDeferred:
|
|
1360
|
-
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)
|
|
1361
1371
|
return;
|
|
1362
|
-
|
|
1363
|
-
|
|
1372
|
+
const { interactionState: Be } = I(), Ke = Be.state !== "active";
|
|
1373
|
+
f(me), Ke && d(me), w.panels.forEach((Xe) => {
|
|
1374
|
+
Xe.scheduleUpdate();
|
|
1364
1375
|
});
|
|
1365
1376
|
}
|
|
1366
1377
|
}
|
|
1367
1378
|
);
|
|
1368
1379
|
return () => {
|
|
1369
|
-
|
|
1380
|
+
$.current = null, j(), ee(), se();
|
|
1370
1381
|
};
|
|
1371
1382
|
}, [
|
|
1372
1383
|
i,
|
|
1384
|
+
y,
|
|
1385
|
+
d,
|
|
1386
|
+
f,
|
|
1373
1387
|
c,
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
b && (b.defaultLayout = n, b.disableCursor = !!o);
|
|
1381
|
-
}), /* @__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(
|
|
1382
1394
|
"div",
|
|
1383
1395
|
{
|
|
1384
|
-
...
|
|
1385
|
-
"aria-orientation":
|
|
1396
|
+
...m,
|
|
1397
|
+
"aria-orientation": c,
|
|
1386
1398
|
className: t,
|
|
1387
1399
|
"data-group": !0,
|
|
1388
|
-
"data-testid":
|
|
1389
|
-
id:
|
|
1390
|
-
ref:
|
|
1400
|
+
"data-testid": y,
|
|
1401
|
+
id: y,
|
|
1402
|
+
ref: L,
|
|
1391
1403
|
style: {
|
|
1392
1404
|
height: "100%",
|
|
1393
1405
|
width: "100%",
|
|
1394
1406
|
overflow: "hidden",
|
|
1395
|
-
...
|
|
1407
|
+
...h,
|
|
1396
1408
|
display: "flex",
|
|
1397
|
-
flexDirection:
|
|
1409
|
+
flexDirection: c === "horizontal" ? "row" : "column",
|
|
1398
1410
|
flexWrap: "nowrap"
|
|
1399
1411
|
},
|
|
1400
1412
|
children: e
|
|
1401
1413
|
}
|
|
1402
1414
|
) });
|
|
1403
1415
|
}
|
|
1404
|
-
|
|
1405
|
-
function
|
|
1406
|
-
let n = null;
|
|
1407
|
-
return (o) => {
|
|
1408
|
-
n !== null && clearTimeout(n), n = setTimeout(() => {
|
|
1409
|
-
e(o);
|
|
1410
|
-
}, t);
|
|
1411
|
-
};
|
|
1412
|
-
}
|
|
1413
|
-
function se(e, t) {
|
|
1416
|
+
Ct.displayName = "Group";
|
|
1417
|
+
function ue(e, t) {
|
|
1414
1418
|
return `react-resizable-panels:${[e, ...t].join(":")}`;
|
|
1415
1419
|
}
|
|
1416
|
-
function
|
|
1420
|
+
function Nt({
|
|
1417
1421
|
debounceSaveMs: e = 100,
|
|
1418
1422
|
panelIds: t,
|
|
1419
1423
|
storage: n = localStorage,
|
|
1420
1424
|
...o
|
|
1421
1425
|
}) {
|
|
1422
|
-
const i = t !== void 0, a = "id" in o ? o.id : o.groupId, l =
|
|
1423
|
-
|
|
1426
|
+
const i = t !== void 0, a = "id" in o ? o.id : o.groupId, l = ue(a, t ?? []), r = Je(
|
|
1427
|
+
Rt,
|
|
1424
1428
|
() => n.getItem(l),
|
|
1425
1429
|
() => n.getItem(l)
|
|
1426
|
-
), s =
|
|
1430
|
+
), s = Ge(
|
|
1427
1431
|
() => r ? JSON.parse(r) : void 0,
|
|
1428
1432
|
[r]
|
|
1429
|
-
), u =
|
|
1430
|
-
const
|
|
1431
|
-
|
|
1432
|
-
|
|
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, []);
|
|
1433
1445
|
try {
|
|
1434
|
-
n.setItem(
|
|
1435
|
-
} catch (
|
|
1436
|
-
console.error(
|
|
1446
|
+
n.setItem(f, JSON.stringify(p));
|
|
1447
|
+
} catch (d) {
|
|
1448
|
+
console.error(d);
|
|
1437
1449
|
}
|
|
1438
|
-
}
|
|
1439
|
-
|
|
1440
|
-
|
|
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
|
+
);
|
|
1441
1460
|
return {
|
|
1461
|
+
/**
|
|
1462
|
+
* Pass this value to `Group` as the `defaultLayout` prop.
|
|
1463
|
+
*/
|
|
1442
1464
|
defaultLayout: s,
|
|
1443
|
-
|
|
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
|
|
1444
1475
|
};
|
|
1445
1476
|
}
|
|
1446
|
-
function
|
|
1477
|
+
function Rt() {
|
|
1447
1478
|
return function() {
|
|
1448
1479
|
};
|
|
1449
1480
|
}
|
|
1450
|
-
function
|
|
1451
|
-
return
|
|
1481
|
+
function _t() {
|
|
1482
|
+
return Y(null);
|
|
1452
1483
|
}
|
|
1453
|
-
function
|
|
1484
|
+
function At() {
|
|
1454
1485
|
return k(null);
|
|
1455
1486
|
}
|
|
1456
|
-
function
|
|
1457
|
-
const e =
|
|
1458
|
-
return
|
|
1487
|
+
function he() {
|
|
1488
|
+
const e = Ze(We);
|
|
1489
|
+
return b(
|
|
1459
1490
|
e,
|
|
1460
1491
|
"Group Context not found; did you render a Panel or Separator outside of a Group?"
|
|
1461
1492
|
), e;
|
|
1462
1493
|
}
|
|
1463
|
-
function
|
|
1494
|
+
function Mt({
|
|
1464
1495
|
groupId: e,
|
|
1465
1496
|
panelId: t
|
|
1466
1497
|
}) {
|
|
1467
1498
|
const n = () => {
|
|
1468
|
-
const { mountedGroups: r } =
|
|
1499
|
+
const { mountedGroups: r } = I();
|
|
1469
1500
|
for (const [
|
|
1470
1501
|
s,
|
|
1471
1502
|
{
|
|
1472
1503
|
defaultLayoutDeferred: u,
|
|
1473
|
-
derivedPanelConstraints:
|
|
1474
|
-
layout:
|
|
1475
|
-
separatorToPanels:
|
|
1504
|
+
derivedPanelConstraints: c,
|
|
1505
|
+
layout: h,
|
|
1506
|
+
separatorToPanels: m
|
|
1476
1507
|
}
|
|
1477
1508
|
] of r)
|
|
1478
1509
|
if (s.id === e)
|
|
1479
1510
|
return {
|
|
1480
1511
|
defaultLayoutDeferred: u,
|
|
1481
|
-
derivedPanelConstraints:
|
|
1512
|
+
derivedPanelConstraints: c,
|
|
1482
1513
|
group: s,
|
|
1483
|
-
layout:
|
|
1484
|
-
separatorToPanels:
|
|
1514
|
+
layout: h,
|
|
1515
|
+
separatorToPanels: m
|
|
1485
1516
|
};
|
|
1486
1517
|
throw Error(`Group ${e} not found`);
|
|
1487
1518
|
}, o = () => {
|
|
@@ -1507,60 +1538,60 @@ function Pt({
|
|
|
1507
1538
|
return;
|
|
1508
1539
|
const {
|
|
1509
1540
|
defaultLayoutDeferred: u,
|
|
1510
|
-
derivedPanelConstraints:
|
|
1511
|
-
group:
|
|
1512
|
-
layout:
|
|
1513
|
-
separatorToPanels:
|
|
1514
|
-
} = 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({
|
|
1515
1546
|
delta: d ? s - r : r - s,
|
|
1516
|
-
initialLayout:
|
|
1517
|
-
panelConstraints:
|
|
1518
|
-
pivotIndices: d ? [
|
|
1519
|
-
prevLayout:
|
|
1547
|
+
initialLayout: m,
|
|
1548
|
+
panelConstraints: c,
|
|
1549
|
+
pivotIndices: d ? [f - 1, f] : [f, f + 1],
|
|
1550
|
+
prevLayout: m,
|
|
1520
1551
|
trigger: "imperative-api"
|
|
1521
|
-
}),
|
|
1522
|
-
layout:
|
|
1523
|
-
panelConstraints:
|
|
1552
|
+
}), S = A({
|
|
1553
|
+
layout: y,
|
|
1554
|
+
panelConstraints: c
|
|
1524
1555
|
});
|
|
1525
|
-
|
|
1526
|
-
mountedGroups: new Map(v.mountedGroups).set(
|
|
1556
|
+
_(m, S) || E((v) => ({
|
|
1557
|
+
mountedGroups: new Map(v.mountedGroups).set(h, {
|
|
1527
1558
|
defaultLayoutDeferred: u,
|
|
1528
|
-
derivedPanelConstraints:
|
|
1529
|
-
layout:
|
|
1530
|
-
separatorToPanels:
|
|
1559
|
+
derivedPanelConstraints: c,
|
|
1560
|
+
layout: S,
|
|
1561
|
+
separatorToPanels: p
|
|
1531
1562
|
})
|
|
1532
1563
|
}));
|
|
1533
1564
|
};
|
|
1534
1565
|
return {
|
|
1535
1566
|
collapse: () => {
|
|
1536
|
-
const { collapsible: r, collapsedSize: s } = o(), { mutableValues: u } = i(),
|
|
1537
|
-
r &&
|
|
1567
|
+
const { collapsible: r, collapsedSize: s } = o(), { mutableValues: u } = i(), c = a();
|
|
1568
|
+
r && c !== s && (u.expandToSize = c, l(s));
|
|
1538
1569
|
},
|
|
1539
1570
|
expand: () => {
|
|
1540
|
-
const { collapsible: r, collapsedSize: s, minSize: u } = o(), { mutableValues:
|
|
1541
|
-
if (r &&
|
|
1542
|
-
let
|
|
1543
|
-
|
|
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);
|
|
1544
1575
|
}
|
|
1545
1576
|
},
|
|
1546
1577
|
getSize: () => {
|
|
1547
|
-
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;
|
|
1548
1579
|
return {
|
|
1549
1580
|
asPercentage: s,
|
|
1550
|
-
inPixels:
|
|
1581
|
+
inPixels: c
|
|
1551
1582
|
};
|
|
1552
1583
|
},
|
|
1553
1584
|
isCollapsed: () => {
|
|
1554
1585
|
const { collapsible: r, collapsedSize: s } = o(), u = a();
|
|
1555
|
-
return r &&
|
|
1586
|
+
return r && C(s, u);
|
|
1556
1587
|
},
|
|
1557
1588
|
resize: (r) => {
|
|
1558
1589
|
if (a() !== r) {
|
|
1559
1590
|
let u;
|
|
1560
1591
|
switch (typeof r) {
|
|
1561
1592
|
case "number": {
|
|
1562
|
-
const { group:
|
|
1563
|
-
u =
|
|
1593
|
+
const { group: c } = n(), h = U({ group: c });
|
|
1594
|
+
u = D(r / h * 100);
|
|
1564
1595
|
break;
|
|
1565
1596
|
}
|
|
1566
1597
|
case "string": {
|
|
@@ -1573,25 +1604,25 @@ function Pt({
|
|
|
1573
1604
|
}
|
|
1574
1605
|
};
|
|
1575
1606
|
}
|
|
1576
|
-
function
|
|
1577
|
-
const { id: n } =
|
|
1578
|
-
collapse:
|
|
1579
|
-
expand:
|
|
1607
|
+
function Et(e, t) {
|
|
1608
|
+
const { id: n } = he(), o = k({
|
|
1609
|
+
collapse: le,
|
|
1610
|
+
expand: le,
|
|
1580
1611
|
getSize: () => ({
|
|
1581
1612
|
asPercentage: 0,
|
|
1582
1613
|
inPixels: 0
|
|
1583
1614
|
}),
|
|
1584
1615
|
isCollapsed: () => !1,
|
|
1585
|
-
resize:
|
|
1616
|
+
resize: le
|
|
1586
1617
|
});
|
|
1587
|
-
|
|
1618
|
+
ke(t, () => o.current, []), F(() => {
|
|
1588
1619
|
Object.assign(
|
|
1589
1620
|
o.current,
|
|
1590
|
-
|
|
1621
|
+
Mt({ groupId: n, panelId: e })
|
|
1591
1622
|
);
|
|
1592
1623
|
});
|
|
1593
1624
|
}
|
|
1594
|
-
function
|
|
1625
|
+
function kt({
|
|
1595
1626
|
children: e,
|
|
1596
1627
|
className: t,
|
|
1597
1628
|
collapsedSize: n = "0%",
|
|
@@ -1602,22 +1633,22 @@ function Ct({
|
|
|
1602
1633
|
maxSize: r = "100%",
|
|
1603
1634
|
minSize: s = "0%",
|
|
1604
1635
|
onResize: u,
|
|
1605
|
-
panelRef:
|
|
1606
|
-
style:
|
|
1607
|
-
...
|
|
1636
|
+
panelRef: c,
|
|
1637
|
+
style: h,
|
|
1638
|
+
...m
|
|
1608
1639
|
}) {
|
|
1609
|
-
const
|
|
1610
|
-
(
|
|
1611
|
-
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);
|
|
1612
1643
|
}
|
|
1613
1644
|
);
|
|
1614
|
-
|
|
1615
|
-
const
|
|
1616
|
-
if (
|
|
1645
|
+
F(() => {
|
|
1646
|
+
const O = d.current;
|
|
1647
|
+
if (O !== null)
|
|
1617
1648
|
return g({
|
|
1618
|
-
element:
|
|
1619
|
-
id:
|
|
1620
|
-
idIsStable:
|
|
1649
|
+
element: O,
|
|
1650
|
+
id: f,
|
|
1651
|
+
idIsStable: p,
|
|
1621
1652
|
mutableValues: {
|
|
1622
1653
|
expandToSize: void 0,
|
|
1623
1654
|
prevSize: void 0
|
|
@@ -1630,46 +1661,46 @@ function Ct({
|
|
|
1630
1661
|
maxSize: r,
|
|
1631
1662
|
minSize: s
|
|
1632
1663
|
},
|
|
1633
|
-
scheduleUpdate:
|
|
1664
|
+
scheduleUpdate: S
|
|
1634
1665
|
});
|
|
1635
1666
|
}, [
|
|
1636
1667
|
n,
|
|
1637
1668
|
o,
|
|
1638
1669
|
i,
|
|
1639
|
-
|
|
1670
|
+
S,
|
|
1640
1671
|
L,
|
|
1641
|
-
|
|
1642
|
-
|
|
1672
|
+
f,
|
|
1673
|
+
p,
|
|
1643
1674
|
r,
|
|
1644
1675
|
s,
|
|
1645
1676
|
P,
|
|
1646
1677
|
g
|
|
1647
|
-
]),
|
|
1648
|
-
const R = v(x,
|
|
1649
|
-
return /* @__PURE__ */
|
|
1678
|
+
]), Et(f, c);
|
|
1679
|
+
const R = v(x, f);
|
|
1680
|
+
return /* @__PURE__ */ q(
|
|
1650
1681
|
"div",
|
|
1651
1682
|
{
|
|
1652
|
-
...
|
|
1683
|
+
...m,
|
|
1653
1684
|
"data-panel": !0,
|
|
1654
|
-
"data-testid":
|
|
1655
|
-
id:
|
|
1656
|
-
ref:
|
|
1685
|
+
"data-testid": f,
|
|
1686
|
+
id: f,
|
|
1687
|
+
ref: y,
|
|
1657
1688
|
style: {
|
|
1658
|
-
...
|
|
1689
|
+
...Gt,
|
|
1659
1690
|
flexBasis: 0,
|
|
1660
1691
|
flexShrink: 1,
|
|
1661
1692
|
// Prevent Panel content from interfering with panel size
|
|
1662
1693
|
overflow: "hidden",
|
|
1663
1694
|
...R
|
|
1664
1695
|
},
|
|
1665
|
-
children: /* @__PURE__ */
|
|
1696
|
+
children: /* @__PURE__ */ q(
|
|
1666
1697
|
"div",
|
|
1667
1698
|
{
|
|
1668
1699
|
className: t,
|
|
1669
1700
|
style: {
|
|
1670
1701
|
width: "100%",
|
|
1671
1702
|
height: "100%",
|
|
1672
|
-
...
|
|
1703
|
+
...h
|
|
1673
1704
|
},
|
|
1674
1705
|
children: e
|
|
1675
1706
|
}
|
|
@@ -1677,8 +1708,8 @@ function Ct({
|
|
|
1677
1708
|
}
|
|
1678
1709
|
);
|
|
1679
1710
|
}
|
|
1680
|
-
|
|
1681
|
-
const
|
|
1711
|
+
kt.displayName = "Panel";
|
|
1712
|
+
const Gt = {
|
|
1682
1713
|
minHeight: 0,
|
|
1683
1714
|
maxHeight: "100%",
|
|
1684
1715
|
height: "auto",
|
|
@@ -1690,13 +1721,13 @@ const Mt = {
|
|
|
1690
1721
|
padding: 0,
|
|
1691
1722
|
margin: 0
|
|
1692
1723
|
};
|
|
1693
|
-
function
|
|
1694
|
-
return
|
|
1724
|
+
function Ft() {
|
|
1725
|
+
return Y(null);
|
|
1695
1726
|
}
|
|
1696
|
-
function
|
|
1727
|
+
function $t() {
|
|
1697
1728
|
return k(null);
|
|
1698
1729
|
}
|
|
1699
|
-
function
|
|
1730
|
+
function It({
|
|
1700
1731
|
layout: e,
|
|
1701
1732
|
panelConstraints: t,
|
|
1702
1733
|
panelId: n,
|
|
@@ -1707,23 +1738,23 @@ function Et({
|
|
|
1707
1738
|
(s) => s.panelId === n
|
|
1708
1739
|
);
|
|
1709
1740
|
if (r) {
|
|
1710
|
-
const s = r.maxSize, u = a = r.collapsible ? r.collapsedSize : r.minSize,
|
|
1711
|
-
a =
|
|
1712
|
-
layout:
|
|
1741
|
+
const s = r.maxSize, u = a = r.collapsible ? r.collapsedSize : r.minSize, c = [o, o + 1];
|
|
1742
|
+
a = A({
|
|
1743
|
+
layout: Z({
|
|
1713
1744
|
delta: u - l,
|
|
1714
1745
|
initialLayout: e,
|
|
1715
1746
|
panelConstraints: t,
|
|
1716
|
-
pivotIndices:
|
|
1747
|
+
pivotIndices: c,
|
|
1717
1748
|
prevLayout: e,
|
|
1718
1749
|
trigger: "keyboard"
|
|
1719
1750
|
}),
|
|
1720
1751
|
panelConstraints: t
|
|
1721
|
-
})[n], i =
|
|
1722
|
-
layout:
|
|
1752
|
+
})[n], i = A({
|
|
1753
|
+
layout: Z({
|
|
1723
1754
|
delta: s - l,
|
|
1724
1755
|
initialLayout: e,
|
|
1725
1756
|
panelConstraints: t,
|
|
1726
|
-
pivotIndices:
|
|
1757
|
+
pivotIndices: c,
|
|
1727
1758
|
prevLayout: e,
|
|
1728
1759
|
trigger: "keyboard"
|
|
1729
1760
|
}),
|
|
@@ -1737,7 +1768,7 @@ function Et({
|
|
|
1737
1768
|
valueNow: l
|
|
1738
1769
|
};
|
|
1739
1770
|
}
|
|
1740
|
-
function
|
|
1771
|
+
function Dt({
|
|
1741
1772
|
children: e,
|
|
1742
1773
|
className: t,
|
|
1743
1774
|
elementRef: n,
|
|
@@ -1745,41 +1776,41 @@ function kt({
|
|
|
1745
1776
|
style: i,
|
|
1746
1777
|
...a
|
|
1747
1778
|
}) {
|
|
1748
|
-
const l =
|
|
1749
|
-
id:
|
|
1750
|
-
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,
|
|
1751
1782
|
registerSeparator: d
|
|
1752
|
-
} =
|
|
1753
|
-
return
|
|
1754
|
-
const
|
|
1755
|
-
if (
|
|
1783
|
+
} = he(), y = f === "horizontal" ? "vertical" : "horizontal";
|
|
1784
|
+
return F(() => {
|
|
1785
|
+
const S = h.current;
|
|
1786
|
+
if (S !== null) {
|
|
1756
1787
|
const v = {
|
|
1757
|
-
element:
|
|
1788
|
+
element: S,
|
|
1758
1789
|
id: l
|
|
1759
|
-
}, x = d(v), g =
|
|
1790
|
+
}, x = d(v), g = N.addListener(
|
|
1760
1791
|
"interactionStateChange",
|
|
1761
1792
|
(P) => {
|
|
1762
|
-
|
|
1793
|
+
c(
|
|
1763
1794
|
P.state !== "inactive" && P.hitRegions.some(
|
|
1764
1795
|
(R) => R.separator === v
|
|
1765
1796
|
) ? P.state : "inactive"
|
|
1766
1797
|
);
|
|
1767
1798
|
}
|
|
1768
|
-
), L =
|
|
1799
|
+
), L = N.addListener(
|
|
1769
1800
|
"mountedGroupsChange",
|
|
1770
1801
|
(P) => {
|
|
1771
1802
|
P.forEach(
|
|
1772
|
-
({ derivedPanelConstraints: R, layout:
|
|
1773
|
-
if (
|
|
1774
|
-
const
|
|
1775
|
-
if (
|
|
1776
|
-
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);
|
|
1777
1808
|
s(
|
|
1778
|
-
|
|
1779
|
-
layout:
|
|
1809
|
+
It({
|
|
1810
|
+
layout: O,
|
|
1780
1811
|
panelConstraints: R,
|
|
1781
|
-
panelId:
|
|
1782
|
-
panelIndex:
|
|
1812
|
+
panelId: M.id,
|
|
1813
|
+
panelIndex: j
|
|
1783
1814
|
})
|
|
1784
1815
|
);
|
|
1785
1816
|
}
|
|
@@ -1792,12 +1823,12 @@ function kt({
|
|
|
1792
1823
|
g(), L(), x();
|
|
1793
1824
|
};
|
|
1794
1825
|
}
|
|
1795
|
-
}, [
|
|
1826
|
+
}, [p, l, d]), /* @__PURE__ */ q(
|
|
1796
1827
|
"div",
|
|
1797
1828
|
{
|
|
1798
1829
|
...a,
|
|
1799
1830
|
"aria-controls": r.valueControls,
|
|
1800
|
-
"aria-orientation":
|
|
1831
|
+
"aria-orientation": y,
|
|
1801
1832
|
"aria-valuemax": r.valueMax,
|
|
1802
1833
|
"aria-valuemin": r.valueMin,
|
|
1803
1834
|
"aria-valuenow": r.valueNow,
|
|
@@ -1806,7 +1837,7 @@ function kt({
|
|
|
1806
1837
|
"data-separator": u,
|
|
1807
1838
|
"data-testid": l,
|
|
1808
1839
|
id: l,
|
|
1809
|
-
ref:
|
|
1840
|
+
ref: m,
|
|
1810
1841
|
role: "separator",
|
|
1811
1842
|
style: {
|
|
1812
1843
|
flexBasis: "auto",
|
|
@@ -1818,15 +1849,15 @@ function kt({
|
|
|
1818
1849
|
}
|
|
1819
1850
|
);
|
|
1820
1851
|
}
|
|
1821
|
-
|
|
1852
|
+
Dt.displayName = "Separator";
|
|
1822
1853
|
export {
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
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
|
|
1831
1862
|
};
|
|
1832
1863
|
//# sourceMappingURL=react-resizable-panels.js.map
|