react-resizable-panels 4.5.3 → 4.5.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,26 +1,26 @@
|
|
|
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 ee, useCallback as Z, useId as nt, useLayoutEffect as Te, useEffect as Oe, useRef as k, createContext as ot, useImperativeHandle as Ae, useMemo as _e, useSyncExternalStore as it, useContext as rt } from "react";
|
|
4
|
+
function b(e, t = "Assertion error") {
|
|
5
5
|
if (!e)
|
|
6
6
|
throw Error(t);
|
|
7
7
|
}
|
|
8
|
-
function
|
|
8
|
+
function K({
|
|
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
14
|
function de(e, t) {
|
|
15
|
-
return t.sort(
|
|
16
|
-
e === "horizontal" ?
|
|
15
|
+
return Array.from(t).sort(
|
|
16
|
+
e === "horizontal" ? st : at
|
|
17
17
|
);
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function st(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 at(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
|
}
|
|
@@ -39,7 +39,7 @@ function Fe(e, t) {
|
|
|
39
39
|
)
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
|
-
function
|
|
42
|
+
function lt({
|
|
43
43
|
orientation: e,
|
|
44
44
|
rects: t,
|
|
45
45
|
targetRect: n
|
|
@@ -48,37 +48,37 @@ function at({
|
|
|
48
48
|
x: n.x + n.width / 2,
|
|
49
49
|
y: n.y + n.height / 2
|
|
50
50
|
};
|
|
51
|
-
let i,
|
|
51
|
+
let i, r = Number.MAX_VALUE;
|
|
52
52
|
for (const l of t) {
|
|
53
|
-
const { x:
|
|
54
|
-
u <
|
|
53
|
+
const { x: s, y: a } = Fe(o, l), u = e === "horizontal" ? s : a;
|
|
54
|
+
u < r && (r = u, i = l);
|
|
55
55
|
}
|
|
56
|
-
return
|
|
56
|
+
return b(i, "No rect found"), i;
|
|
57
57
|
}
|
|
58
58
|
let ie;
|
|
59
|
-
function
|
|
59
|
+
function ut() {
|
|
60
60
|
return ie === void 0 && (typeof matchMedia == "function" ? ie = !!matchMedia("(pointer:coarse)").matches : ie = !1), ie;
|
|
61
61
|
}
|
|
62
62
|
function $e(e) {
|
|
63
|
-
const { element: t, orientation: n, panels: o, separators: i } = e,
|
|
63
|
+
const { element: t, orientation: n, panels: o, separators: i } = e, r = de(
|
|
64
64
|
n,
|
|
65
65
|
Array.from(t.children).filter(Ne).map((c) => ({ element: c }))
|
|
66
66
|
).map(({ element: c }) => c), l = [];
|
|
67
|
-
let
|
|
68
|
-
for (const c of
|
|
67
|
+
let s = !1, a, u = [];
|
|
68
|
+
for (const c of r)
|
|
69
69
|
if (c.hasAttribute("data-panel")) {
|
|
70
70
|
const h = o.find(
|
|
71
|
-
(
|
|
71
|
+
(S) => S.element === c
|
|
72
72
|
);
|
|
73
73
|
if (h) {
|
|
74
74
|
if (a) {
|
|
75
|
-
const
|
|
75
|
+
const S = a.element.getBoundingClientRect(), m = c.getBoundingClientRect();
|
|
76
76
|
let f;
|
|
77
|
-
if (
|
|
78
|
-
const d = n === "horizontal" ? new DOMRect(
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
77
|
+
if (s) {
|
|
78
|
+
const d = n === "horizontal" ? new DOMRect(S.right, S.top, 0, S.height) : new DOMRect(
|
|
79
|
+
S.left,
|
|
80
|
+
S.bottom,
|
|
81
|
+
S.width,
|
|
82
82
|
0
|
|
83
83
|
), p = n === "horizontal" ? new DOMRect(m.left, m.top, 0, m.height) : new DOMRect(m.left, m.top, m.width, 0);
|
|
84
84
|
switch (u.length) {
|
|
@@ -90,14 +90,14 @@ function $e(e) {
|
|
|
90
90
|
break;
|
|
91
91
|
}
|
|
92
92
|
case 1: {
|
|
93
|
-
const g = u[0], v =
|
|
93
|
+
const g = u[0], v = lt({
|
|
94
94
|
orientation: n,
|
|
95
|
-
rects: [
|
|
95
|
+
rects: [S, m],
|
|
96
96
|
targetRect: g.element.getBoundingClientRect()
|
|
97
97
|
});
|
|
98
98
|
f = [
|
|
99
99
|
g,
|
|
100
|
-
v ===
|
|
100
|
+
v === S ? p : d
|
|
101
101
|
];
|
|
102
102
|
break;
|
|
103
103
|
}
|
|
@@ -109,20 +109,20 @@ function $e(e) {
|
|
|
109
109
|
} else
|
|
110
110
|
u.length ? f = u : f = [
|
|
111
111
|
n === "horizontal" ? new DOMRect(
|
|
112
|
-
|
|
112
|
+
S.right,
|
|
113
113
|
m.top,
|
|
114
|
-
m.left -
|
|
114
|
+
m.left - S.right,
|
|
115
115
|
m.height
|
|
116
116
|
) : new DOMRect(
|
|
117
117
|
m.left,
|
|
118
|
-
|
|
118
|
+
S.bottom,
|
|
119
119
|
m.width,
|
|
120
|
-
m.top -
|
|
120
|
+
m.top - S.bottom
|
|
121
121
|
)
|
|
122
122
|
];
|
|
123
123
|
for (const d of f) {
|
|
124
124
|
let p = "width" in d ? d : d.element.getBoundingClientRect();
|
|
125
|
-
const g =
|
|
125
|
+
const g = ut() ? e.resizeTargetMinimumSize.coarse : e.resizeTargetMinimumSize.fine;
|
|
126
126
|
if (p.width < g) {
|
|
127
127
|
const v = g - p.width;
|
|
128
128
|
p = new DOMRect(
|
|
@@ -143,39 +143,39 @@ function $e(e) {
|
|
|
143
143
|
}
|
|
144
144
|
l.push({
|
|
145
145
|
group: e,
|
|
146
|
-
groupSize:
|
|
146
|
+
groupSize: K({ group: e }),
|
|
147
147
|
panels: [a, h],
|
|
148
148
|
separator: "width" in d ? void 0 : d,
|
|
149
149
|
rect: p
|
|
150
150
|
});
|
|
151
151
|
}
|
|
152
152
|
}
|
|
153
|
-
|
|
153
|
+
s = !1, a = h, u = [];
|
|
154
154
|
}
|
|
155
155
|
} else if (c.hasAttribute("data-separator")) {
|
|
156
156
|
const h = i.find(
|
|
157
|
-
(
|
|
157
|
+
(S) => S.element === c
|
|
158
158
|
);
|
|
159
159
|
h ? u.push(h) : (a = void 0, u = []);
|
|
160
160
|
} else
|
|
161
|
-
|
|
161
|
+
s = !0;
|
|
162
162
|
return l;
|
|
163
163
|
}
|
|
164
|
-
function
|
|
164
|
+
function ct(e, t) {
|
|
165
165
|
const n = getComputedStyle(e), o = parseFloat(n.fontSize);
|
|
166
166
|
return t * o;
|
|
167
167
|
}
|
|
168
|
-
function
|
|
168
|
+
function ft(e, t) {
|
|
169
169
|
const n = getComputedStyle(e.ownerDocument.body), o = parseFloat(n.fontSize);
|
|
170
170
|
return t * o;
|
|
171
171
|
}
|
|
172
|
-
function
|
|
172
|
+
function dt(e) {
|
|
173
173
|
return e / 100 * window.innerHeight;
|
|
174
174
|
}
|
|
175
|
-
function
|
|
175
|
+
function pt(e) {
|
|
176
176
|
return e / 100 * window.innerWidth;
|
|
177
177
|
}
|
|
178
|
-
function
|
|
178
|
+
function ht(e) {
|
|
179
179
|
switch (typeof e) {
|
|
180
180
|
case "number":
|
|
181
181
|
return [e, "px"];
|
|
@@ -191,8 +191,8 @@ function re({
|
|
|
191
191
|
styleProp: n
|
|
192
192
|
}) {
|
|
193
193
|
let o;
|
|
194
|
-
const [i,
|
|
195
|
-
switch (
|
|
194
|
+
const [i, r] = ht(n);
|
|
195
|
+
switch (r) {
|
|
196
196
|
case "%": {
|
|
197
197
|
o = i / 100 * e;
|
|
198
198
|
break;
|
|
@@ -202,29 +202,29 @@ function re({
|
|
|
202
202
|
break;
|
|
203
203
|
}
|
|
204
204
|
case "rem": {
|
|
205
|
-
o =
|
|
205
|
+
o = ft(t, i);
|
|
206
206
|
break;
|
|
207
207
|
}
|
|
208
208
|
case "em": {
|
|
209
|
-
o =
|
|
209
|
+
o = ct(t, i);
|
|
210
210
|
break;
|
|
211
211
|
}
|
|
212
212
|
case "vh": {
|
|
213
|
-
o =
|
|
213
|
+
o = dt(i);
|
|
214
214
|
break;
|
|
215
215
|
}
|
|
216
216
|
case "vw": {
|
|
217
|
-
o =
|
|
217
|
+
o = pt(i);
|
|
218
218
|
break;
|
|
219
219
|
}
|
|
220
220
|
}
|
|
221
221
|
return o;
|
|
222
222
|
}
|
|
223
|
-
function
|
|
223
|
+
function T(e) {
|
|
224
224
|
return parseFloat(e.toFixed(3));
|
|
225
225
|
}
|
|
226
226
|
function ve(e) {
|
|
227
|
-
const { panels: t } = e, n =
|
|
227
|
+
const { panels: t } = e, n = K({ group: e });
|
|
228
228
|
return n === 0 ? t.map((o) => ({
|
|
229
229
|
collapsedSize: 0,
|
|
230
230
|
collapsible: o.panelConstraints.collapsible === !0,
|
|
@@ -233,54 +233,54 @@ function ve(e) {
|
|
|
233
233
|
maxSize: 100,
|
|
234
234
|
panelId: o.id
|
|
235
235
|
})) : t.map((o) => {
|
|
236
|
-
const { element: i, panelConstraints:
|
|
236
|
+
const { element: i, panelConstraints: r } = o;
|
|
237
237
|
let l = 0;
|
|
238
|
-
if (
|
|
238
|
+
if (r.collapsedSize !== void 0) {
|
|
239
239
|
const c = re({
|
|
240
240
|
groupSize: n,
|
|
241
241
|
panelElement: i,
|
|
242
|
-
styleProp:
|
|
242
|
+
styleProp: r.collapsedSize
|
|
243
243
|
});
|
|
244
|
-
l =
|
|
244
|
+
l = T(c / n * 100);
|
|
245
245
|
}
|
|
246
|
-
let
|
|
247
|
-
if (
|
|
246
|
+
let s;
|
|
247
|
+
if (r.defaultSize !== void 0) {
|
|
248
248
|
const c = re({
|
|
249
249
|
groupSize: n,
|
|
250
250
|
panelElement: i,
|
|
251
|
-
styleProp:
|
|
251
|
+
styleProp: r.defaultSize
|
|
252
252
|
});
|
|
253
|
-
|
|
253
|
+
s = T(c / n * 100);
|
|
254
254
|
}
|
|
255
255
|
let a = 0;
|
|
256
|
-
if (
|
|
256
|
+
if (r.minSize !== void 0) {
|
|
257
257
|
const c = re({
|
|
258
258
|
groupSize: n,
|
|
259
259
|
panelElement: i,
|
|
260
|
-
styleProp:
|
|
260
|
+
styleProp: r.minSize
|
|
261
261
|
});
|
|
262
|
-
a =
|
|
262
|
+
a = T(c / n * 100);
|
|
263
263
|
}
|
|
264
264
|
let u = 100;
|
|
265
|
-
if (
|
|
265
|
+
if (r.maxSize !== void 0) {
|
|
266
266
|
const c = re({
|
|
267
267
|
groupSize: n,
|
|
268
268
|
panelElement: i,
|
|
269
|
-
styleProp:
|
|
269
|
+
styleProp: r.maxSize
|
|
270
270
|
});
|
|
271
|
-
u =
|
|
271
|
+
u = T(c / n * 100);
|
|
272
272
|
}
|
|
273
273
|
return {
|
|
274
274
|
collapsedSize: l,
|
|
275
|
-
collapsible:
|
|
276
|
-
defaultSize:
|
|
275
|
+
collapsible: r.collapsible === !0,
|
|
276
|
+
defaultSize: s,
|
|
277
277
|
minSize: a,
|
|
278
278
|
maxSize: u,
|
|
279
279
|
panelId: o.id
|
|
280
280
|
};
|
|
281
281
|
});
|
|
282
282
|
}
|
|
283
|
-
class
|
|
283
|
+
class mt {
|
|
284
284
|
#e = {};
|
|
285
285
|
addListener(t, n) {
|
|
286
286
|
const o = this.#e[t];
|
|
@@ -294,18 +294,18 @@ class ht {
|
|
|
294
294
|
if (o.length === 1)
|
|
295
295
|
o[0].call(null, n);
|
|
296
296
|
else {
|
|
297
|
-
let i = !1,
|
|
297
|
+
let i = !1, r = null;
|
|
298
298
|
const l = Array.from(o);
|
|
299
|
-
for (let
|
|
300
|
-
const a = l[
|
|
299
|
+
for (let s = 0; s < l.length; s++) {
|
|
300
|
+
const a = l[s];
|
|
301
301
|
try {
|
|
302
302
|
a.call(null, n);
|
|
303
303
|
} catch (u) {
|
|
304
|
-
|
|
304
|
+
r === null && (i = !0, r = u);
|
|
305
305
|
}
|
|
306
306
|
}
|
|
307
307
|
if (i)
|
|
308
|
-
throw
|
|
308
|
+
throw r;
|
|
309
309
|
}
|
|
310
310
|
}
|
|
311
311
|
removeAllListeners() {
|
|
@@ -320,7 +320,7 @@ class ht {
|
|
|
320
320
|
}
|
|
321
321
|
}
|
|
322
322
|
function R(e, t, n = 0) {
|
|
323
|
-
return Math.abs(
|
|
323
|
+
return Math.abs(T(e) - T(t)) <= n;
|
|
324
324
|
}
|
|
325
325
|
let I = {
|
|
326
326
|
cursorFlags: 0,
|
|
@@ -329,7 +329,7 @@ let I = {
|
|
|
329
329
|
},
|
|
330
330
|
mountedGroups: /* @__PURE__ */ new Map()
|
|
331
331
|
};
|
|
332
|
-
const
|
|
332
|
+
const F = new mt();
|
|
333
333
|
function G() {
|
|
334
334
|
return I;
|
|
335
335
|
}
|
|
@@ -341,38 +341,38 @@ function M(e) {
|
|
|
341
341
|
return I = {
|
|
342
342
|
...I,
|
|
343
343
|
...t
|
|
344
|
-
}, t.cursorFlags !== void 0 &&
|
|
345
|
-
o.derivedPanelConstraints.forEach((
|
|
346
|
-
if (
|
|
344
|
+
}, t.cursorFlags !== void 0 && F.emit("cursorFlagsChange", I.cursorFlags), t.interactionState !== void 0 && F.emit("interactionStateChange", I.interactionState), t.mountedGroups !== void 0 && (I.mountedGroups.forEach((o, i) => {
|
|
345
|
+
o.derivedPanelConstraints.forEach((r) => {
|
|
346
|
+
if (r.collapsible) {
|
|
347
347
|
const { layout: l } = n.mountedGroups.get(i) ?? {};
|
|
348
348
|
if (l) {
|
|
349
|
-
const
|
|
350
|
-
|
|
351
|
-
o.layout[
|
|
349
|
+
const s = R(
|
|
350
|
+
r.collapsedSize,
|
|
351
|
+
o.layout[r.panelId]
|
|
352
352
|
), a = R(
|
|
353
|
-
|
|
354
|
-
l[
|
|
353
|
+
r.collapsedSize,
|
|
354
|
+
l[r.panelId]
|
|
355
355
|
);
|
|
356
|
-
|
|
356
|
+
s && !a && (i.inMemoryLastExpandedPanelSizes[r.panelId] = l[r.panelId]);
|
|
357
357
|
}
|
|
358
358
|
}
|
|
359
359
|
});
|
|
360
|
-
}),
|
|
360
|
+
}), F.emit("mountedGroupsChange", I.mountedGroups)), I;
|
|
361
361
|
}
|
|
362
|
-
function
|
|
362
|
+
function gt(e, t, n) {
|
|
363
363
|
let o, i = {
|
|
364
364
|
x: 1 / 0,
|
|
365
365
|
y: 1 / 0
|
|
366
366
|
};
|
|
367
|
-
for (const
|
|
368
|
-
const l = Fe(n,
|
|
367
|
+
for (const r of t) {
|
|
368
|
+
const l = Fe(n, r.rect);
|
|
369
369
|
switch (e) {
|
|
370
370
|
case "horizontal": {
|
|
371
|
-
l.x <= i.x && (o =
|
|
371
|
+
l.x <= i.x && (o = r, i = l);
|
|
372
372
|
break;
|
|
373
373
|
}
|
|
374
374
|
case "vertical": {
|
|
375
|
-
l.y <= i.y && (o =
|
|
375
|
+
l.y <= i.y && (o = r, i = l);
|
|
376
376
|
break;
|
|
377
377
|
}
|
|
378
378
|
}
|
|
@@ -382,61 +382,61 @@ function mt(e, t, n) {
|
|
|
382
382
|
hitRegion: o
|
|
383
383
|
} : void 0;
|
|
384
384
|
}
|
|
385
|
-
function
|
|
385
|
+
function yt(e) {
|
|
386
386
|
return e !== null && typeof e == "object" && "nodeType" in e && e.nodeType === Node.DOCUMENT_FRAGMENT_NODE;
|
|
387
387
|
}
|
|
388
|
-
function
|
|
388
|
+
function St(e, t) {
|
|
389
389
|
if (e === t) throw new Error("Cannot compare node with itself");
|
|
390
390
|
const n = {
|
|
391
|
-
a:
|
|
392
|
-
b:
|
|
391
|
+
a: be(e),
|
|
392
|
+
b: be(t)
|
|
393
393
|
};
|
|
394
394
|
let o;
|
|
395
395
|
for (; n.a.at(-1) === n.b.at(-1); )
|
|
396
|
-
|
|
397
|
-
|
|
396
|
+
o = n.a.pop(), n.b.pop();
|
|
397
|
+
b(
|
|
398
398
|
o,
|
|
399
399
|
"Stacking order can only be calculated for elements with a common ancestor"
|
|
400
400
|
);
|
|
401
401
|
const i = {
|
|
402
|
-
a: xe(
|
|
403
|
-
b: xe(
|
|
402
|
+
a: ze(xe(n.a)),
|
|
403
|
+
b: ze(xe(n.b))
|
|
404
404
|
};
|
|
405
405
|
if (i.a === i.b) {
|
|
406
|
-
const
|
|
406
|
+
const r = o.childNodes, l = {
|
|
407
407
|
a: n.a.at(-1),
|
|
408
408
|
b: n.b.at(-1)
|
|
409
409
|
};
|
|
410
|
-
let
|
|
411
|
-
for (;
|
|
412
|
-
const a = s
|
|
410
|
+
let s = r.length;
|
|
411
|
+
for (; s--; ) {
|
|
412
|
+
const a = r[s];
|
|
413
413
|
if (a === l.a) return 1;
|
|
414
414
|
if (a === l.b) return -1;
|
|
415
415
|
}
|
|
416
416
|
}
|
|
417
417
|
return Math.sign(i.a - i.b);
|
|
418
418
|
}
|
|
419
|
-
const
|
|
420
|
-
function
|
|
419
|
+
const vt = /\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;
|
|
420
|
+
function xt(e) {
|
|
421
421
|
const t = getComputedStyle(He(e) ?? e).display;
|
|
422
422
|
return t === "flex" || t === "inline-flex";
|
|
423
423
|
}
|
|
424
424
|
function zt(e) {
|
|
425
425
|
const t = getComputedStyle(e);
|
|
426
|
-
return !!(t.position === "fixed" || t.zIndex !== "auto" && (t.position !== "static" ||
|
|
426
|
+
return !!(t.position === "fixed" || t.zIndex !== "auto" && (t.position !== "static" || xt(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" || vt.test(t.willChange) || t.webkitOverflowScrolling === "touch");
|
|
427
427
|
}
|
|
428
|
-
function
|
|
428
|
+
function xe(e) {
|
|
429
429
|
let t = e.length;
|
|
430
430
|
for (; t--; ) {
|
|
431
431
|
const n = e[t];
|
|
432
|
-
if (
|
|
432
|
+
if (b(n, "Missing node"), zt(n)) return n;
|
|
433
433
|
}
|
|
434
434
|
return null;
|
|
435
435
|
}
|
|
436
|
-
function
|
|
436
|
+
function ze(e) {
|
|
437
437
|
return e && Number(getComputedStyle(e).zIndex) || 0;
|
|
438
438
|
}
|
|
439
|
-
function
|
|
439
|
+
function be(e) {
|
|
440
440
|
const t = [];
|
|
441
441
|
for (; e; )
|
|
442
442
|
t.push(e), e = He(e);
|
|
@@ -444,9 +444,9 @@ function we(e) {
|
|
|
444
444
|
}
|
|
445
445
|
function He(e) {
|
|
446
446
|
const { parentNode: t } = e;
|
|
447
|
-
return
|
|
447
|
+
return yt(t) ? t.host : t;
|
|
448
448
|
}
|
|
449
|
-
function
|
|
449
|
+
function bt(e, t) {
|
|
450
450
|
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;
|
|
451
451
|
}
|
|
452
452
|
function wt({
|
|
@@ -456,12 +456,12 @@ function wt({
|
|
|
456
456
|
}) {
|
|
457
457
|
if (!Ne(n) || n.contains(e) || e.contains(n))
|
|
458
458
|
return !0;
|
|
459
|
-
if (
|
|
459
|
+
if (St(n, e) > 0) {
|
|
460
460
|
let o = n;
|
|
461
461
|
for (; o; ) {
|
|
462
462
|
if (o.contains(e))
|
|
463
463
|
return !0;
|
|
464
|
-
if (
|
|
464
|
+
if (bt(o.getBoundingClientRect(), t))
|
|
465
465
|
return !1;
|
|
466
466
|
o = o.parentElement;
|
|
467
467
|
}
|
|
@@ -473,7 +473,7 @@ function pe(e, t) {
|
|
|
473
473
|
return t.forEach((o, i) => {
|
|
474
474
|
if (i.disabled)
|
|
475
475
|
return;
|
|
476
|
-
const
|
|
476
|
+
const r = $e(i), l = gt(i.orientation, r, {
|
|
477
477
|
x: e.clientX,
|
|
478
478
|
y: e.clientY
|
|
479
479
|
});
|
|
@@ -484,7 +484,7 @@ function pe(e, t) {
|
|
|
484
484
|
}) && n.push(l.hitRegion);
|
|
485
485
|
}), n;
|
|
486
486
|
}
|
|
487
|
-
function
|
|
487
|
+
function Lt(e, t) {
|
|
488
488
|
if (e.length !== t.length)
|
|
489
489
|
return !1;
|
|
490
490
|
for (let n = 0; n < e.length; n++)
|
|
@@ -492,10 +492,10 @@ function bt(e, t) {
|
|
|
492
492
|
return !1;
|
|
493
493
|
return !0;
|
|
494
494
|
}
|
|
495
|
-
function
|
|
495
|
+
function D(e, t) {
|
|
496
496
|
return R(e, t) ? 0 : e > t ? 1 : -1;
|
|
497
497
|
}
|
|
498
|
-
function
|
|
498
|
+
function B({
|
|
499
499
|
panelConstraints: e,
|
|
500
500
|
size: t
|
|
501
501
|
}) {
|
|
@@ -503,34 +503,34 @@ function U({
|
|
|
503
503
|
collapsedSize: n = 0,
|
|
504
504
|
collapsible: o,
|
|
505
505
|
maxSize: i = 100,
|
|
506
|
-
minSize:
|
|
506
|
+
minSize: r = 0
|
|
507
507
|
} = e;
|
|
508
|
-
if (
|
|
508
|
+
if (D(t, r) < 0)
|
|
509
509
|
if (o) {
|
|
510
|
-
const l = (n +
|
|
511
|
-
|
|
510
|
+
const l = (n + r) / 2;
|
|
511
|
+
D(t, l) < 0 ? t = n : t = r;
|
|
512
512
|
} else
|
|
513
|
-
t =
|
|
514
|
-
return t = Math.min(i, t), t =
|
|
513
|
+
t = r;
|
|
514
|
+
return t = Math.min(i, t), t = T(t), t;
|
|
515
515
|
}
|
|
516
|
-
function
|
|
516
|
+
function te({
|
|
517
517
|
delta: e,
|
|
518
518
|
initialLayout: t,
|
|
519
519
|
panelConstraints: n,
|
|
520
520
|
pivotIndices: o,
|
|
521
521
|
prevLayout: i,
|
|
522
|
-
trigger:
|
|
522
|
+
trigger: r
|
|
523
523
|
}) {
|
|
524
524
|
if (R(e, 0))
|
|
525
525
|
return t;
|
|
526
|
-
const l = Object.values(t),
|
|
527
|
-
|
|
526
|
+
const l = Object.values(t), s = Object.values(i), a = [...l], [u, c] = o;
|
|
527
|
+
b(u != null, "Invalid first pivot index"), b(c != null, "Invalid second pivot index");
|
|
528
528
|
let h = 0;
|
|
529
|
-
switch (
|
|
529
|
+
switch (r) {
|
|
530
530
|
case "keyboard": {
|
|
531
531
|
{
|
|
532
532
|
const f = e < 0 ? c : u, d = n[f];
|
|
533
|
-
|
|
533
|
+
b(
|
|
534
534
|
d,
|
|
535
535
|
`Panel constraints not found for index ${f}`
|
|
536
536
|
);
|
|
@@ -540,19 +540,19 @@ function J({
|
|
|
540
540
|
minSize: v = 0
|
|
541
541
|
} = d;
|
|
542
542
|
if (g) {
|
|
543
|
-
const
|
|
544
|
-
if (
|
|
545
|
-
|
|
543
|
+
const x = l[f];
|
|
544
|
+
if (b(
|
|
545
|
+
x != null,
|
|
546
546
|
`Previous layout not found for panel index ${f}`
|
|
547
|
-
), R(
|
|
548
|
-
const
|
|
549
|
-
|
|
547
|
+
), R(x, p)) {
|
|
548
|
+
const y = v - x;
|
|
549
|
+
D(y, Math.abs(e)) > 0 && (e = e < 0 ? 0 - y : y);
|
|
550
550
|
}
|
|
551
551
|
}
|
|
552
552
|
}
|
|
553
553
|
{
|
|
554
554
|
const f = e < 0 ? u : c, d = n[f];
|
|
555
|
-
|
|
555
|
+
b(
|
|
556
556
|
d,
|
|
557
557
|
`No panel constraints found for index ${f}`
|
|
558
558
|
);
|
|
@@ -562,13 +562,13 @@ function J({
|
|
|
562
562
|
minSize: v = 0
|
|
563
563
|
} = d;
|
|
564
564
|
if (g) {
|
|
565
|
-
const
|
|
566
|
-
if (
|
|
567
|
-
|
|
565
|
+
const x = l[f];
|
|
566
|
+
if (b(
|
|
567
|
+
x != null,
|
|
568
568
|
`Previous layout not found for panel index ${f}`
|
|
569
|
-
), R(
|
|
570
|
-
const
|
|
571
|
-
|
|
569
|
+
), R(x, v)) {
|
|
570
|
+
const y = x - p;
|
|
571
|
+
D(y, Math.abs(e)) > 0 && (e = e < 0 ? 0 - y : y);
|
|
572
572
|
}
|
|
573
573
|
}
|
|
574
574
|
}
|
|
@@ -576,19 +576,21 @@ function J({
|
|
|
576
576
|
}
|
|
577
577
|
default: {
|
|
578
578
|
const f = e < 0 ? c : u, d = n[f];
|
|
579
|
-
|
|
579
|
+
b(
|
|
580
580
|
d,
|
|
581
581
|
`Panel constraints not found for index ${f}`
|
|
582
582
|
);
|
|
583
583
|
const { collapsible: p, collapsedSize: g, minSize: v } = d;
|
|
584
|
-
if (p)
|
|
584
|
+
if (p) {
|
|
585
|
+
const x = f === c;
|
|
585
586
|
if (e > 0) {
|
|
586
|
-
const
|
|
587
|
-
|
|
587
|
+
const y = v - g, z = y / 2;
|
|
588
|
+
D(e, v) < 0 && (e = D(e, z) <= 0 ? 0 : y);
|
|
588
589
|
} else {
|
|
589
|
-
const
|
|
590
|
-
|
|
590
|
+
const y = v - g, z = 100 - y / 2;
|
|
591
|
+
x ? D(Math.abs(e), v) < 0 && (e = D(100 + e, z) > 0 ? 0 : -y) : D(100 + e, v) < 0 && (e = D(100 + e, z) > 0 ? 0 : -y);
|
|
591
592
|
}
|
|
593
|
+
}
|
|
592
594
|
break;
|
|
593
595
|
}
|
|
594
596
|
}
|
|
@@ -597,15 +599,15 @@ function J({
|
|
|
597
599
|
let d = e < 0 ? c : u, p = 0;
|
|
598
600
|
for (; ; ) {
|
|
599
601
|
const v = l[d];
|
|
600
|
-
|
|
602
|
+
b(
|
|
601
603
|
v != null,
|
|
602
604
|
`Previous layout not found for panel index ${d}`
|
|
603
605
|
);
|
|
604
|
-
const
|
|
606
|
+
const y = B({
|
|
605
607
|
panelConstraints: n[d],
|
|
606
608
|
size: 100
|
|
607
609
|
}) - v;
|
|
608
|
-
if (p +=
|
|
610
|
+
if (p += y, d += f, d < 0 || d >= n.length)
|
|
609
611
|
break;
|
|
610
612
|
}
|
|
611
613
|
const g = Math.min(Math.abs(e), Math.abs(p));
|
|
@@ -615,174 +617,174 @@ function J({
|
|
|
615
617
|
let d = e < 0 ? u : c;
|
|
616
618
|
for (; d >= 0 && d < n.length; ) {
|
|
617
619
|
const p = Math.abs(e) - Math.abs(h), g = l[d];
|
|
618
|
-
|
|
620
|
+
b(
|
|
619
621
|
g != null,
|
|
620
622
|
`Previous layout not found for panel index ${d}`
|
|
621
623
|
);
|
|
622
|
-
const v = g - p,
|
|
624
|
+
const v = g - p, x = B({
|
|
623
625
|
panelConstraints: n[d],
|
|
624
626
|
size: v
|
|
625
627
|
});
|
|
626
|
-
if (!R(g,
|
|
628
|
+
if (!R(g, x) && (h += g - x, a[d] = x, h.toFixed(3).localeCompare(Math.abs(e).toFixed(3), void 0, {
|
|
627
629
|
numeric: !0
|
|
628
630
|
}) >= 0))
|
|
629
631
|
break;
|
|
630
632
|
e < 0 ? d-- : d++;
|
|
631
633
|
}
|
|
632
634
|
}
|
|
633
|
-
if (
|
|
635
|
+
if (Lt(s, a))
|
|
634
636
|
return i;
|
|
635
637
|
{
|
|
636
638
|
const f = e < 0 ? c : u, d = l[f];
|
|
637
|
-
|
|
639
|
+
b(
|
|
638
640
|
d != null,
|
|
639
641
|
`Previous layout not found for panel index ${f}`
|
|
640
642
|
);
|
|
641
|
-
const p = d + h, g =
|
|
643
|
+
const p = d + h, g = B({
|
|
642
644
|
panelConstraints: n[f],
|
|
643
645
|
size: p
|
|
644
646
|
});
|
|
645
647
|
if (a[f] = g, !R(g, p)) {
|
|
646
|
-
let v = p - g,
|
|
647
|
-
for (;
|
|
648
|
-
const
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
`Previous layout not found for panel index ${
|
|
648
|
+
let v = p - g, y = e < 0 ? c : u;
|
|
649
|
+
for (; y >= 0 && y < n.length; ) {
|
|
650
|
+
const z = a[y];
|
|
651
|
+
b(
|
|
652
|
+
z != null,
|
|
653
|
+
`Previous layout not found for panel index ${y}`
|
|
652
654
|
);
|
|
653
|
-
const C =
|
|
654
|
-
panelConstraints: n[
|
|
655
|
+
const C = z + v, P = B({
|
|
656
|
+
panelConstraints: n[y],
|
|
655
657
|
size: C
|
|
656
658
|
});
|
|
657
|
-
if (R(
|
|
659
|
+
if (R(z, P) || (v -= P - z, a[y] = P), R(v, 0))
|
|
658
660
|
break;
|
|
659
|
-
e > 0 ?
|
|
661
|
+
e > 0 ? y-- : y++;
|
|
660
662
|
}
|
|
661
663
|
}
|
|
662
664
|
}
|
|
663
|
-
const
|
|
665
|
+
const S = Object.values(a).reduce(
|
|
664
666
|
(f, d) => d + f,
|
|
665
667
|
0
|
|
666
668
|
);
|
|
667
|
-
if (!R(
|
|
669
|
+
if (!R(S, 100, 0.1))
|
|
668
670
|
return i;
|
|
669
671
|
const m = Object.keys(i);
|
|
670
672
|
return a.reduce((f, d, p) => (f[m[p]] = d, f), {});
|
|
671
673
|
}
|
|
672
|
-
function
|
|
674
|
+
function $(e, t) {
|
|
673
675
|
if (Object.keys(e).length !== Object.keys(t).length)
|
|
674
676
|
return !1;
|
|
675
677
|
for (const n in e)
|
|
676
|
-
if (t[n] === void 0 ||
|
|
678
|
+
if (t[n] === void 0 || D(e[n], t[n]) !== 0)
|
|
677
679
|
return !1;
|
|
678
680
|
return !0;
|
|
679
681
|
}
|
|
680
|
-
function
|
|
682
|
+
function H({
|
|
681
683
|
layout: e,
|
|
682
684
|
panelConstraints: t
|
|
683
685
|
}) {
|
|
684
686
|
const o = [...Object.values(e)], i = o.reduce(
|
|
685
|
-
(
|
|
687
|
+
(s, a) => s + a,
|
|
686
688
|
0
|
|
687
689
|
);
|
|
688
690
|
if (o.length !== t.length)
|
|
689
691
|
throw Error(
|
|
690
|
-
`Invalid ${t.length} panel layout: ${o.map((
|
|
692
|
+
`Invalid ${t.length} panel layout: ${o.map((s) => `${s}%`).join(", ")}`
|
|
691
693
|
);
|
|
692
694
|
if (!R(i, 100) && o.length > 0)
|
|
693
|
-
for (let
|
|
694
|
-
const a = o[
|
|
695
|
-
|
|
695
|
+
for (let s = 0; s < t.length; s++) {
|
|
696
|
+
const a = o[s];
|
|
697
|
+
b(a != null, `No layout data found for index ${s}`);
|
|
696
698
|
const u = 100 / i * a;
|
|
697
|
-
o[
|
|
699
|
+
o[s] = u;
|
|
698
700
|
}
|
|
699
|
-
let
|
|
700
|
-
for (let
|
|
701
|
-
const a = o[
|
|
702
|
-
|
|
703
|
-
const u =
|
|
704
|
-
panelConstraints: t[
|
|
701
|
+
let r = 0;
|
|
702
|
+
for (let s = 0; s < t.length; s++) {
|
|
703
|
+
const a = o[s];
|
|
704
|
+
b(a != null, `No layout data found for index ${s}`);
|
|
705
|
+
const u = B({
|
|
706
|
+
panelConstraints: t[s],
|
|
705
707
|
size: a
|
|
706
708
|
});
|
|
707
|
-
a != u && (
|
|
709
|
+
a != u && (r += a - u, o[s] = u);
|
|
708
710
|
}
|
|
709
|
-
if (!R(
|
|
710
|
-
for (let
|
|
711
|
-
const a = o[
|
|
712
|
-
|
|
713
|
-
const u = a +
|
|
714
|
-
panelConstraints: t[
|
|
711
|
+
if (!R(r, 0))
|
|
712
|
+
for (let s = 0; s < t.length; s++) {
|
|
713
|
+
const a = o[s];
|
|
714
|
+
b(a != null, `No layout data found for index ${s}`);
|
|
715
|
+
const u = a + r, c = B({
|
|
716
|
+
panelConstraints: t[s],
|
|
715
717
|
size: u
|
|
716
718
|
});
|
|
717
|
-
if (a !== c && (
|
|
719
|
+
if (a !== c && (r -= c - a, o[s] = c, R(r, 0)))
|
|
718
720
|
break;
|
|
719
721
|
}
|
|
720
722
|
const l = Object.keys(e);
|
|
721
|
-
return o.reduce((
|
|
723
|
+
return o.reduce((s, a, u) => (s[l[u]] = a, s), {});
|
|
722
724
|
}
|
|
723
725
|
function je({
|
|
724
726
|
groupId: e,
|
|
725
727
|
panelId: t
|
|
726
728
|
}) {
|
|
727
729
|
const n = () => {
|
|
728
|
-
const { mountedGroups:
|
|
730
|
+
const { mountedGroups: s } = G();
|
|
729
731
|
for (const [
|
|
730
732
|
a,
|
|
731
733
|
{
|
|
732
734
|
defaultLayoutDeferred: u,
|
|
733
735
|
derivedPanelConstraints: c,
|
|
734
736
|
layout: h,
|
|
735
|
-
separatorToPanels:
|
|
737
|
+
separatorToPanels: S
|
|
736
738
|
}
|
|
737
|
-
] of
|
|
739
|
+
] of s)
|
|
738
740
|
if (a.id === e)
|
|
739
741
|
return {
|
|
740
742
|
defaultLayoutDeferred: u,
|
|
741
743
|
derivedPanelConstraints: c,
|
|
742
744
|
group: a,
|
|
743
745
|
layout: h,
|
|
744
|
-
separatorToPanels:
|
|
746
|
+
separatorToPanels: S
|
|
745
747
|
};
|
|
746
748
|
throw Error(`Group ${e} not found`);
|
|
747
749
|
}, o = () => {
|
|
748
|
-
const
|
|
750
|
+
const s = n().derivedPanelConstraints.find(
|
|
749
751
|
(a) => a.panelId === t
|
|
750
752
|
);
|
|
751
|
-
if (
|
|
752
|
-
return
|
|
753
|
+
if (s !== void 0)
|
|
754
|
+
return s;
|
|
753
755
|
throw Error(`Panel constraints not found for Panel ${t}`);
|
|
754
756
|
}, i = () => {
|
|
755
|
-
const
|
|
756
|
-
if (
|
|
757
|
-
return
|
|
757
|
+
const s = n().group.panels.find((a) => a.id === t);
|
|
758
|
+
if (s !== void 0)
|
|
759
|
+
return s;
|
|
758
760
|
throw Error(`Layout not found for Panel ${t}`);
|
|
759
|
-
},
|
|
760
|
-
const
|
|
761
|
-
if (
|
|
762
|
-
return
|
|
761
|
+
}, r = () => {
|
|
762
|
+
const s = n().layout[t];
|
|
763
|
+
if (s !== void 0)
|
|
764
|
+
return s;
|
|
763
765
|
throw Error(`Layout not found for Panel ${t}`);
|
|
764
|
-
}, l = (
|
|
765
|
-
const a =
|
|
766
|
-
if (
|
|
766
|
+
}, l = (s) => {
|
|
767
|
+
const a = r();
|
|
768
|
+
if (s === a)
|
|
767
769
|
return;
|
|
768
770
|
const {
|
|
769
771
|
defaultLayoutDeferred: u,
|
|
770
772
|
derivedPanelConstraints: c,
|
|
771
773
|
group: h,
|
|
772
|
-
layout:
|
|
774
|
+
layout: S,
|
|
773
775
|
separatorToPanels: m
|
|
774
|
-
} = n(), f = h.panels.findIndex((v) => v.id === t), d = f === h.panels.length - 1, p =
|
|
775
|
-
delta: d ? a -
|
|
776
|
-
initialLayout:
|
|
776
|
+
} = n(), f = h.panels.findIndex((v) => v.id === t), d = f === h.panels.length - 1, p = te({
|
|
777
|
+
delta: d ? a - s : s - a,
|
|
778
|
+
initialLayout: S,
|
|
777
779
|
panelConstraints: c,
|
|
778
780
|
pivotIndices: d ? [f - 1, f] : [f, f + 1],
|
|
779
|
-
prevLayout:
|
|
781
|
+
prevLayout: S,
|
|
780
782
|
trigger: "imperative-api"
|
|
781
|
-
}), g =
|
|
783
|
+
}), g = H({
|
|
782
784
|
layout: p,
|
|
783
785
|
panelConstraints: c
|
|
784
786
|
});
|
|
785
|
-
|
|
787
|
+
$(S, g) || M((v) => ({
|
|
786
788
|
mountedGroups: new Map(v.mountedGroups).set(h, {
|
|
787
789
|
defaultLayoutDeferred: u,
|
|
788
790
|
derivedPanelConstraints: c,
|
|
@@ -793,38 +795,38 @@ function je({
|
|
|
793
795
|
};
|
|
794
796
|
return {
|
|
795
797
|
collapse: () => {
|
|
796
|
-
const { collapsible:
|
|
797
|
-
|
|
798
|
+
const { collapsible: s, collapsedSize: a } = o(), { mutableValues: u } = i(), c = r();
|
|
799
|
+
s && c !== a && (u.expandToSize = c, l(a));
|
|
798
800
|
},
|
|
799
801
|
expand: () => {
|
|
800
|
-
const { collapsible:
|
|
801
|
-
if (
|
|
802
|
-
let
|
|
803
|
-
|
|
802
|
+
const { collapsible: s, collapsedSize: a, minSize: u } = o(), { mutableValues: c } = i(), h = r();
|
|
803
|
+
if (s && h === a) {
|
|
804
|
+
let S = c.expandToSize ?? u;
|
|
805
|
+
S === 0 && (S = 1), l(S);
|
|
804
806
|
}
|
|
805
807
|
},
|
|
806
808
|
getSize: () => {
|
|
807
|
-
const { group:
|
|
809
|
+
const { group: s } = n(), a = r(), { element: u } = i(), c = s.orientation === "horizontal" ? u.offsetWidth : u.offsetHeight;
|
|
808
810
|
return {
|
|
809
811
|
asPercentage: a,
|
|
810
812
|
inPixels: c
|
|
811
813
|
};
|
|
812
814
|
},
|
|
813
815
|
isCollapsed: () => {
|
|
814
|
-
const { collapsible:
|
|
815
|
-
return
|
|
816
|
+
const { collapsible: s, collapsedSize: a } = o(), u = r();
|
|
817
|
+
return s && R(a, u);
|
|
816
818
|
},
|
|
817
|
-
resize: (
|
|
818
|
-
if (
|
|
819
|
+
resize: (s) => {
|
|
820
|
+
if (r() !== s) {
|
|
819
821
|
let u;
|
|
820
|
-
switch (typeof
|
|
822
|
+
switch (typeof s) {
|
|
821
823
|
case "number": {
|
|
822
|
-
const { group: c } = n(), h =
|
|
823
|
-
u =
|
|
824
|
+
const { group: c } = n(), h = K({ group: c });
|
|
825
|
+
u = T(s / h * 100);
|
|
824
826
|
break;
|
|
825
827
|
}
|
|
826
828
|
case "string": {
|
|
827
|
-
u = parseFloat(
|
|
829
|
+
u = parseFloat(s);
|
|
828
830
|
break;
|
|
829
831
|
}
|
|
830
832
|
}
|
|
@@ -833,21 +835,21 @@ function je({
|
|
|
833
835
|
}
|
|
834
836
|
};
|
|
835
837
|
}
|
|
836
|
-
function
|
|
838
|
+
function we(e) {
|
|
837
839
|
if (e.defaultPrevented)
|
|
838
840
|
return;
|
|
839
841
|
const { mountedGroups: t } = G();
|
|
840
842
|
pe(e, t).forEach((o) => {
|
|
841
843
|
if (o.separator) {
|
|
842
844
|
const i = o.panels.find(
|
|
843
|
-
(
|
|
845
|
+
(r) => r.panelConstraints.defaultSize !== void 0
|
|
844
846
|
);
|
|
845
847
|
if (i) {
|
|
846
|
-
const
|
|
848
|
+
const r = i.panelConstraints.defaultSize, l = je({
|
|
847
849
|
groupId: o.group.id,
|
|
848
850
|
panelId: i.id
|
|
849
851
|
});
|
|
850
|
-
l &&
|
|
852
|
+
l && r !== void 0 && (l.resize(r), e.preventDefault());
|
|
851
853
|
}
|
|
852
854
|
}
|
|
853
855
|
});
|
|
@@ -880,19 +882,19 @@ function Ve({
|
|
|
880
882
|
const {
|
|
881
883
|
defaultLayoutDeferred: o,
|
|
882
884
|
derivedPanelConstraints: i,
|
|
883
|
-
group:
|
|
885
|
+
group: r,
|
|
884
886
|
layout: l,
|
|
885
|
-
separatorToPanels:
|
|
886
|
-
} = t(), a =
|
|
887
|
+
separatorToPanels: s
|
|
888
|
+
} = t(), a = H({
|
|
887
889
|
layout: n,
|
|
888
890
|
panelConstraints: i
|
|
889
891
|
});
|
|
890
|
-
return o ? l : (
|
|
891
|
-
mountedGroups: new Map(u.mountedGroups).set(
|
|
892
|
+
return o ? l : ($(l, a) || M((u) => ({
|
|
893
|
+
mountedGroups: new Map(u.mountedGroups).set(r, {
|
|
892
894
|
defaultLayoutDeferred: o,
|
|
893
895
|
derivedPanelConstraints: i,
|
|
894
896
|
layout: a,
|
|
895
|
-
separatorToPanels:
|
|
897
|
+
separatorToPanels: s
|
|
896
898
|
})
|
|
897
899
|
})), a);
|
|
898
900
|
}
|
|
@@ -900,27 +902,27 @@ function Ve({
|
|
|
900
902
|
}
|
|
901
903
|
function Ue(e) {
|
|
902
904
|
const { mountedGroups: t } = G(), n = t.get(e);
|
|
903
|
-
return
|
|
905
|
+
return b(n, `Mounted Group ${e.id} not found`), n;
|
|
904
906
|
}
|
|
905
|
-
function
|
|
907
|
+
function N(e, t) {
|
|
906
908
|
const n = ae(e), o = Ue(n), i = n.separators.find(
|
|
907
909
|
(h) => h.element === e
|
|
908
910
|
);
|
|
909
|
-
|
|
910
|
-
const
|
|
911
|
-
|
|
912
|
-
const l =
|
|
911
|
+
b(i, "Matching separator not found");
|
|
912
|
+
const r = o.separatorToPanels.get(i);
|
|
913
|
+
b(r, "Matching panels not found");
|
|
914
|
+
const l = r.map((h) => n.panels.indexOf(h)), a = Ve({ groupId: n.id }).getLayout(), u = te({
|
|
913
915
|
delta: t,
|
|
914
916
|
initialLayout: a,
|
|
915
917
|
panelConstraints: o.derivedPanelConstraints,
|
|
916
918
|
pivotIndices: l,
|
|
917
919
|
prevLayout: a,
|
|
918
920
|
trigger: "keyboard"
|
|
919
|
-
}), c =
|
|
921
|
+
}), c = H({
|
|
920
922
|
layout: u,
|
|
921
923
|
panelConstraints: o.derivedPanelConstraints
|
|
922
924
|
});
|
|
923
|
-
|
|
925
|
+
$(a, c) || M((h) => ({
|
|
924
926
|
mountedGroups: new Map(h.mountedGroups).set(n, {
|
|
925
927
|
defaultLayoutDeferred: o.defaultLayoutDeferred,
|
|
926
928
|
derivedPanelConstraints: o.derivedPanelConstraints,
|
|
@@ -936,39 +938,39 @@ function Le(e) {
|
|
|
936
938
|
if (!n.disabled)
|
|
937
939
|
switch (e.key) {
|
|
938
940
|
case "ArrowDown": {
|
|
939
|
-
e.preventDefault(), n.orientation === "vertical" &&
|
|
941
|
+
e.preventDefault(), n.orientation === "vertical" && N(t, 5);
|
|
940
942
|
break;
|
|
941
943
|
}
|
|
942
944
|
case "ArrowLeft": {
|
|
943
|
-
e.preventDefault(), n.orientation === "horizontal" &&
|
|
945
|
+
e.preventDefault(), n.orientation === "horizontal" && N(t, -5);
|
|
944
946
|
break;
|
|
945
947
|
}
|
|
946
948
|
case "ArrowRight": {
|
|
947
|
-
e.preventDefault(), n.orientation === "horizontal" &&
|
|
949
|
+
e.preventDefault(), n.orientation === "horizontal" && N(t, 5);
|
|
948
950
|
break;
|
|
949
951
|
}
|
|
950
952
|
case "ArrowUp": {
|
|
951
|
-
e.preventDefault(), n.orientation === "vertical" &&
|
|
953
|
+
e.preventDefault(), n.orientation === "vertical" && N(t, -5);
|
|
952
954
|
break;
|
|
953
955
|
}
|
|
954
956
|
case "End": {
|
|
955
|
-
e.preventDefault(),
|
|
957
|
+
e.preventDefault(), N(t, 100);
|
|
956
958
|
break;
|
|
957
959
|
}
|
|
958
960
|
case "Enter": {
|
|
959
961
|
e.preventDefault();
|
|
960
|
-
const o = ae(t), { derivedPanelConstraints: i, layout:
|
|
962
|
+
const o = ae(t), { derivedPanelConstraints: i, layout: r, separatorToPanels: l } = Ue(o), s = o.separators.find(
|
|
961
963
|
(h) => h.element === t
|
|
962
964
|
);
|
|
963
|
-
|
|
964
|
-
const a = l.get(
|
|
965
|
-
|
|
965
|
+
b(s, "Matching separator not found");
|
|
966
|
+
const a = l.get(s);
|
|
967
|
+
b(a, "Matching panels not found");
|
|
966
968
|
const u = a[0], c = i.find(
|
|
967
969
|
(h) => h.panelId === u.id
|
|
968
970
|
);
|
|
969
|
-
if (
|
|
970
|
-
const h =
|
|
971
|
-
|
|
971
|
+
if (b(c, "Panel metadata not found"), c.collapsible) {
|
|
972
|
+
const h = r[u.id], S = c.collapsedSize === h ? o.inMemoryLastExpandedPanelSizes[u.id] ?? c.minSize : c.collapsedSize;
|
|
973
|
+
N(t, S - h);
|
|
972
974
|
}
|
|
973
975
|
break;
|
|
974
976
|
}
|
|
@@ -976,16 +978,16 @@ function Le(e) {
|
|
|
976
978
|
e.preventDefault();
|
|
977
979
|
const i = ae(t).separators.map(
|
|
978
980
|
(a) => a.element
|
|
979
|
-
),
|
|
981
|
+
), r = Array.from(i).findIndex(
|
|
980
982
|
(a) => a === e.currentTarget
|
|
981
983
|
);
|
|
982
|
-
|
|
983
|
-
const l = e.shiftKey ?
|
|
984
|
+
b(r !== null, "Index not found");
|
|
985
|
+
const l = e.shiftKey ? r > 0 ? r - 1 : i.length - 1 : r + 1 < i.length ? r + 1 : 0;
|
|
984
986
|
i[l].focus();
|
|
985
987
|
break;
|
|
986
988
|
}
|
|
987
989
|
case "Home": {
|
|
988
|
-
e.preventDefault(),
|
|
990
|
+
e.preventDefault(), N(t, -100);
|
|
989
991
|
break;
|
|
990
992
|
}
|
|
991
993
|
}
|
|
@@ -995,30 +997,28 @@ function Ce(e) {
|
|
|
995
997
|
return;
|
|
996
998
|
if (e.pointerType === "mouse" && e.button > 0)
|
|
997
999
|
return;
|
|
998
|
-
const { mountedGroups: t } = G(), n = pe(e, t), o = /* @__PURE__ */ new
|
|
999
|
-
let
|
|
1000
|
-
n.forEach((
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
const u = t.get(a.group);
|
|
1005
|
-
u && l.set(a.group, u.layout);
|
|
1000
|
+
const { mountedGroups: t } = G(), n = pe(e, t), o = /* @__PURE__ */ new Map();
|
|
1001
|
+
let i = !1;
|
|
1002
|
+
n.forEach((r) => {
|
|
1003
|
+
r.separator && (i || (i = !0, r.separator.element.focus()));
|
|
1004
|
+
const l = t.get(r.group);
|
|
1005
|
+
l && o.set(r.group, l.layout);
|
|
1006
1006
|
}), M({
|
|
1007
1007
|
interactionState: {
|
|
1008
1008
|
hitRegions: n,
|
|
1009
|
-
initialLayoutMap:
|
|
1009
|
+
initialLayoutMap: o,
|
|
1010
1010
|
pointerDownAtPoint: { x: e.clientX, y: e.clientY },
|
|
1011
1011
|
state: "active"
|
|
1012
1012
|
}
|
|
1013
1013
|
}), n.length && e.preventDefault();
|
|
1014
1014
|
}
|
|
1015
|
-
const
|
|
1015
|
+
const Ct = (e) => e, ce = () => {
|
|
1016
1016
|
}, We = 1, Be = 2, Ke = 4, Xe = 8, Pe = 3, Re = 12;
|
|
1017
1017
|
let se;
|
|
1018
1018
|
function Me() {
|
|
1019
1019
|
return se === void 0 && (se = !1, typeof window < "u" && (window.navigator.userAgent.includes("Chrome") || window.navigator.userAgent.includes("Firefox")) && (se = !0)), se;
|
|
1020
1020
|
}
|
|
1021
|
-
function
|
|
1021
|
+
function Pt({
|
|
1022
1022
|
cursorFlags: e,
|
|
1023
1023
|
groups: t,
|
|
1024
1024
|
state: n
|
|
@@ -1027,9 +1027,9 @@ function Ct({
|
|
|
1027
1027
|
switch (n) {
|
|
1028
1028
|
case "active":
|
|
1029
1029
|
case "hover":
|
|
1030
|
-
t.forEach((
|
|
1031
|
-
if (!
|
|
1032
|
-
switch (
|
|
1030
|
+
t.forEach((r) => {
|
|
1031
|
+
if (!r.disableCursor)
|
|
1032
|
+
switch (r.orientation) {
|
|
1033
1033
|
case "horizontal": {
|
|
1034
1034
|
o++;
|
|
1035
1035
|
break;
|
|
@@ -1046,12 +1046,12 @@ function Ct({
|
|
|
1046
1046
|
switch (n) {
|
|
1047
1047
|
case "active": {
|
|
1048
1048
|
if (e && Me()) {
|
|
1049
|
-
const
|
|
1050
|
-
if (s)
|
|
1051
|
-
return r ? "se-resize" : a ? "ne-resize" : "e-resize";
|
|
1052
|
-
if (l)
|
|
1053
|
-
return r ? "sw-resize" : a ? "nw-resize" : "w-resize";
|
|
1049
|
+
const r = (e & We) !== 0, l = (e & Be) !== 0, s = (e & Ke) !== 0, a = (e & Xe) !== 0;
|
|
1054
1050
|
if (r)
|
|
1051
|
+
return s ? "se-resize" : a ? "ne-resize" : "e-resize";
|
|
1052
|
+
if (l)
|
|
1053
|
+
return s ? "sw-resize" : a ? "nw-resize" : "w-resize";
|
|
1054
|
+
if (s)
|
|
1055
1055
|
return "s-resize";
|
|
1056
1056
|
if (a)
|
|
1057
1057
|
return "n-resize";
|
|
@@ -1071,14 +1071,14 @@ function he(e) {
|
|
|
1071
1071
|
switch (i.state) {
|
|
1072
1072
|
case "active":
|
|
1073
1073
|
case "hover": {
|
|
1074
|
-
const
|
|
1074
|
+
const r = Pt({
|
|
1075
1075
|
cursorFlags: o,
|
|
1076
|
-
groups: i.hitRegions.map((
|
|
1076
|
+
groups: i.hitRegions.map((s) => s.group),
|
|
1077
1077
|
state: i.state
|
|
1078
|
-
}), l = `*, *:hover {cursor: ${
|
|
1078
|
+
}), l = `*, *:hover {cursor: ${r} !important; ${i.state === "active" ? "touch-action: none;" : ""} }`;
|
|
1079
1079
|
if (t === l)
|
|
1080
1080
|
return;
|
|
1081
|
-
t = l,
|
|
1081
|
+
t = l, r ? n.cssRules.length === 0 ? n.insertRule(l) : n.replaceSync(l) : n.cssRules.length === 1 && n.deleteRule(0);
|
|
1082
1082
|
break;
|
|
1083
1083
|
}
|
|
1084
1084
|
case "inactive": {
|
|
@@ -1097,56 +1097,56 @@ function qe({
|
|
|
1097
1097
|
hitRegions: n,
|
|
1098
1098
|
initialLayoutMap: o,
|
|
1099
1099
|
mountedGroups: i,
|
|
1100
|
-
pointerDownAtPoint:
|
|
1100
|
+
pointerDownAtPoint: r,
|
|
1101
1101
|
prevCursorFlags: l
|
|
1102
1102
|
}) {
|
|
1103
|
-
let
|
|
1103
|
+
let s = 0;
|
|
1104
1104
|
const a = new Map(i);
|
|
1105
1105
|
n.forEach((c) => {
|
|
1106
|
-
const { group: h, groupSize:
|
|
1106
|
+
const { group: h, groupSize: S } = c, { disableCursor: m, orientation: f, panels: d } = h;
|
|
1107
1107
|
let p = 0;
|
|
1108
|
-
|
|
1108
|
+
r ? f === "horizontal" ? p = (t.clientX - r.x) / S * 100 : p = (t.clientY - r.y) / S * 100 : f === "horizontal" ? p = t.clientX < 0 ? -100 : 100 : p = t.clientY < 0 ? -100 : 100;
|
|
1109
1109
|
const g = o.get(h), {
|
|
1110
1110
|
defaultLayoutDeferred: v,
|
|
1111
|
-
derivedPanelConstraints:
|
|
1112
|
-
layout:
|
|
1113
|
-
separatorToPanels:
|
|
1111
|
+
derivedPanelConstraints: x,
|
|
1112
|
+
layout: y,
|
|
1113
|
+
separatorToPanels: z
|
|
1114
1114
|
} = i.get(h) ?? { defaultLayoutDeferred: !1 };
|
|
1115
|
-
if (
|
|
1116
|
-
const C =
|
|
1115
|
+
if (x && g && y && z) {
|
|
1116
|
+
const C = te({
|
|
1117
1117
|
delta: p,
|
|
1118
1118
|
initialLayout: g,
|
|
1119
|
-
panelConstraints:
|
|
1119
|
+
panelConstraints: x,
|
|
1120
1120
|
pivotIndices: c.panels.map((P) => d.indexOf(P)),
|
|
1121
|
-
prevLayout:
|
|
1121
|
+
prevLayout: y,
|
|
1122
1122
|
trigger: "mouse-or-touch"
|
|
1123
1123
|
});
|
|
1124
|
-
if (
|
|
1124
|
+
if ($(C, y)) {
|
|
1125
1125
|
if (p !== 0 && !m)
|
|
1126
1126
|
switch (f) {
|
|
1127
1127
|
case "horizontal": {
|
|
1128
|
-
|
|
1128
|
+
s |= p < 0 ? We : Be;
|
|
1129
1129
|
break;
|
|
1130
1130
|
}
|
|
1131
1131
|
case "vertical": {
|
|
1132
|
-
|
|
1132
|
+
s |= p < 0 ? Ke : Xe;
|
|
1133
1133
|
break;
|
|
1134
1134
|
}
|
|
1135
1135
|
}
|
|
1136
1136
|
} else {
|
|
1137
1137
|
a.set(c.group, {
|
|
1138
1138
|
defaultLayoutDeferred: v,
|
|
1139
|
-
derivedPanelConstraints:
|
|
1139
|
+
derivedPanelConstraints: x,
|
|
1140
1140
|
layout: C,
|
|
1141
|
-
separatorToPanels:
|
|
1141
|
+
separatorToPanels: z
|
|
1142
1142
|
});
|
|
1143
|
-
const P = c.group.panels.map(({ id:
|
|
1143
|
+
const P = c.group.panels.map(({ id: O }) => O).join(",");
|
|
1144
1144
|
c.group.inMemoryLayouts[P] = C;
|
|
1145
1145
|
}
|
|
1146
1146
|
}
|
|
1147
1147
|
});
|
|
1148
1148
|
let u = 0;
|
|
1149
|
-
t.movementX === 0 ? u |= l & Pe : u |=
|
|
1149
|
+
t.movementX === 0 ? u |= l & Pe : u |= s & Pe, t.movementY === 0 ? u |= l & Re : u |= s & Re, M({
|
|
1150
1150
|
cursorFlags: u,
|
|
1151
1151
|
mountedGroups: a
|
|
1152
1152
|
}), he(e);
|
|
@@ -1233,34 +1233,34 @@ function Ie(e) {
|
|
|
1233
1233
|
function De(e) {
|
|
1234
1234
|
let t = 0, n = 0;
|
|
1235
1235
|
const o = {};
|
|
1236
|
-
for (const
|
|
1237
|
-
if (
|
|
1236
|
+
for (const r of e)
|
|
1237
|
+
if (r.defaultSize !== void 0) {
|
|
1238
1238
|
t++;
|
|
1239
|
-
const l =
|
|
1240
|
-
n += l, o[
|
|
1239
|
+
const l = T(r.defaultSize);
|
|
1240
|
+
n += l, o[r.panelId] = l;
|
|
1241
1241
|
} else
|
|
1242
|
-
o[
|
|
1242
|
+
o[r.panelId] = void 0;
|
|
1243
1243
|
const i = e.length - t;
|
|
1244
1244
|
if (i !== 0) {
|
|
1245
|
-
const
|
|
1245
|
+
const r = T((100 - n) / i);
|
|
1246
1246
|
for (const l of e)
|
|
1247
|
-
l.defaultSize === void 0 && (o[l.panelId] =
|
|
1247
|
+
l.defaultSize === void 0 && (o[l.panelId] = r);
|
|
1248
1248
|
}
|
|
1249
1249
|
return o;
|
|
1250
1250
|
}
|
|
1251
|
-
function
|
|
1251
|
+
function Rt(e, t, n) {
|
|
1252
1252
|
if (!n[0])
|
|
1253
1253
|
return;
|
|
1254
1254
|
const i = e.panels.find((u) => u.element === t);
|
|
1255
1255
|
if (!i || !i.onResize)
|
|
1256
1256
|
return;
|
|
1257
|
-
const
|
|
1258
|
-
asPercentage:
|
|
1257
|
+
const r = K({ group: e }), l = e.orientation === "horizontal" ? i.element.offsetWidth : i.element.offsetHeight, s = i.mutableValues.prevSize, a = {
|
|
1258
|
+
asPercentage: T(l / r * 100),
|
|
1259
1259
|
inPixels: l
|
|
1260
1260
|
};
|
|
1261
|
-
i.mutableValues.prevSize = a, i.onResize(a, i.id,
|
|
1261
|
+
i.mutableValues.prevSize = a, i.onResize(a, i.id, s);
|
|
1262
1262
|
}
|
|
1263
|
-
function
|
|
1263
|
+
function Mt(e, t) {
|
|
1264
1264
|
if (Object.keys(e).length !== Object.keys(t).length)
|
|
1265
1265
|
return !1;
|
|
1266
1266
|
for (const o in e)
|
|
@@ -1268,7 +1268,7 @@ function Rt(e, t) {
|
|
|
1268
1268
|
return !1;
|
|
1269
1269
|
return !0;
|
|
1270
1270
|
}
|
|
1271
|
-
function
|
|
1271
|
+
function Et(e, t) {
|
|
1272
1272
|
const n = e.map((i) => i.id), o = Object.keys(t);
|
|
1273
1273
|
if (n.length !== o.length)
|
|
1274
1274
|
return !1;
|
|
@@ -1277,119 +1277,119 @@ function Mt(e, t) {
|
|
|
1277
1277
|
return !1;
|
|
1278
1278
|
return !0;
|
|
1279
1279
|
}
|
|
1280
|
-
const
|
|
1281
|
-
function
|
|
1280
|
+
const W = /* @__PURE__ */ new Map();
|
|
1281
|
+
function kt(e) {
|
|
1282
1282
|
let t = !0;
|
|
1283
|
-
|
|
1283
|
+
b(
|
|
1284
1284
|
e.element.ownerDocument.defaultView,
|
|
1285
1285
|
"Cannot register an unmounted Group"
|
|
1286
1286
|
);
|
|
1287
|
-
const n = e.element.ownerDocument.defaultView.ResizeObserver, o = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set(),
|
|
1287
|
+
const n = e.element.ownerDocument.defaultView.ResizeObserver, o = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set(), r = new n((f) => {
|
|
1288
1288
|
for (const d of f) {
|
|
1289
1289
|
const { borderBoxSize: p, target: g } = d;
|
|
1290
1290
|
if (g === e.element) {
|
|
1291
1291
|
if (t) {
|
|
1292
|
-
if (
|
|
1292
|
+
if (K({ group: e }) === 0)
|
|
1293
1293
|
return;
|
|
1294
|
-
M((
|
|
1295
|
-
const
|
|
1296
|
-
if (
|
|
1297
|
-
const
|
|
1294
|
+
M((x) => {
|
|
1295
|
+
const y = x.mountedGroups.get(e);
|
|
1296
|
+
if (y) {
|
|
1297
|
+
const z = ve(e), C = y.defaultLayoutDeferred ? De(z) : y.layout, P = H({
|
|
1298
1298
|
layout: C,
|
|
1299
|
-
panelConstraints:
|
|
1299
|
+
panelConstraints: z
|
|
1300
1300
|
});
|
|
1301
|
-
return !
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
) ?
|
|
1305
|
-
mountedGroups: new Map(
|
|
1301
|
+
return !y.defaultLayoutDeferred && $(C, P) && Mt(
|
|
1302
|
+
y.derivedPanelConstraints,
|
|
1303
|
+
z
|
|
1304
|
+
) ? x : {
|
|
1305
|
+
mountedGroups: new Map(x.mountedGroups).set(e, {
|
|
1306
1306
|
defaultLayoutDeferred: !1,
|
|
1307
|
-
derivedPanelConstraints:
|
|
1307
|
+
derivedPanelConstraints: z,
|
|
1308
1308
|
layout: P,
|
|
1309
|
-
separatorToPanels:
|
|
1309
|
+
separatorToPanels: y.separatorToPanels
|
|
1310
1310
|
})
|
|
1311
1311
|
};
|
|
1312
1312
|
}
|
|
1313
|
-
return
|
|
1313
|
+
return x;
|
|
1314
1314
|
});
|
|
1315
1315
|
}
|
|
1316
1316
|
} else
|
|
1317
|
-
|
|
1317
|
+
Rt(e, g, p);
|
|
1318
1318
|
}
|
|
1319
1319
|
});
|
|
1320
|
-
|
|
1321
|
-
|
|
1320
|
+
r.observe(e.element), e.panels.forEach((f) => {
|
|
1321
|
+
b(
|
|
1322
1322
|
!o.has(f.id),
|
|
1323
1323
|
`Panel ids must be unique; id "${f.id}" was used more than once`
|
|
1324
|
-
), o.add(f.id), f.onResize &&
|
|
1324
|
+
), o.add(f.id), f.onResize && r.observe(f.element);
|
|
1325
1325
|
});
|
|
1326
|
-
const l =
|
|
1326
|
+
const l = K({ group: e }), s = ve(e), a = e.panels.map(({ id: f }) => f).join(",");
|
|
1327
1327
|
let u = e.defaultLayout;
|
|
1328
|
-
u && (
|
|
1329
|
-
const c = e.inMemoryLayouts[a] ?? u ?? De(
|
|
1328
|
+
u && (Et(e.panels, u) || (u = void 0));
|
|
1329
|
+
const c = e.inMemoryLayouts[a] ?? u ?? De(s), h = H({
|
|
1330
1330
|
layout: c,
|
|
1331
|
-
panelConstraints:
|
|
1332
|
-
}),
|
|
1331
|
+
panelConstraints: s
|
|
1332
|
+
}), S = $e(e), m = e.element.ownerDocument;
|
|
1333
1333
|
return M((f) => {
|
|
1334
1334
|
const d = /* @__PURE__ */ new Map();
|
|
1335
|
-
return
|
|
1335
|
+
return W.set(
|
|
1336
1336
|
m,
|
|
1337
|
-
(
|
|
1338
|
-
),
|
|
1337
|
+
(W.get(m) ?? 0) + 1
|
|
1338
|
+
), S.forEach((p) => {
|
|
1339
1339
|
p.separator && d.set(p.separator, p.panels);
|
|
1340
1340
|
}), {
|
|
1341
1341
|
mountedGroups: new Map(f.mountedGroups).set(e, {
|
|
1342
1342
|
defaultLayoutDeferred: l === 0,
|
|
1343
|
-
derivedPanelConstraints:
|
|
1343
|
+
derivedPanelConstraints: s,
|
|
1344
1344
|
layout: h,
|
|
1345
1345
|
separatorToPanels: d
|
|
1346
1346
|
})
|
|
1347
1347
|
};
|
|
1348
1348
|
}), e.separators.forEach((f) => {
|
|
1349
|
-
|
|
1349
|
+
b(
|
|
1350
1350
|
!i.has(f.id),
|
|
1351
1351
|
`Separator ids must be unique; id "${f.id}" was used more than once`
|
|
1352
1352
|
), i.add(f.id), f.element.addEventListener("keydown", Le);
|
|
1353
|
-
}),
|
|
1354
|
-
t = !1,
|
|
1353
|
+
}), W.get(m) === 1 && (m.addEventListener("dblclick", we, !0), m.addEventListener("pointerdown", Ce, !0), m.addEventListener("pointerleave", ke), m.addEventListener("pointermove", Ge), m.addEventListener("pointerup", Ie, !0)), function() {
|
|
1354
|
+
t = !1, W.set(
|
|
1355
1355
|
m,
|
|
1356
|
-
Math.max(0, (
|
|
1356
|
+
Math.max(0, (W.get(m) ?? 0) - 1)
|
|
1357
1357
|
), M((d) => {
|
|
1358
1358
|
const p = new Map(d.mountedGroups);
|
|
1359
1359
|
return p.delete(e), { mountedGroups: p };
|
|
1360
1360
|
}), e.separators.forEach((d) => {
|
|
1361
1361
|
d.element.removeEventListener("keydown", Le);
|
|
1362
|
-
}),
|
|
1362
|
+
}), W.get(m) || (m.removeEventListener(
|
|
1363
1363
|
"dblclick",
|
|
1364
|
-
|
|
1364
|
+
we,
|
|
1365
1365
|
!0
|
|
1366
1366
|
), m.removeEventListener(
|
|
1367
1367
|
"pointerdown",
|
|
1368
1368
|
Ce,
|
|
1369
1369
|
!0
|
|
1370
|
-
), m.removeEventListener("pointerleave", ke), m.removeEventListener("pointermove", Ge), m.removeEventListener("pointerup", Ie, !0)),
|
|
1370
|
+
), m.removeEventListener("pointerleave", ke), m.removeEventListener("pointermove", Ge), m.removeEventListener("pointerup", Ie, !0)), r.disconnect();
|
|
1371
1371
|
};
|
|
1372
1372
|
}
|
|
1373
1373
|
function Ye() {
|
|
1374
|
-
const [e, t] =
|
|
1374
|
+
const [e, t] = ee({}), n = Z(() => t({}), []);
|
|
1375
1375
|
return [e, n];
|
|
1376
1376
|
}
|
|
1377
1377
|
function me(e) {
|
|
1378
|
-
const t =
|
|
1378
|
+
const t = nt();
|
|
1379
1379
|
return `${e ?? t}`;
|
|
1380
1380
|
}
|
|
1381
|
-
const
|
|
1382
|
-
function
|
|
1381
|
+
const j = typeof window < "u" ? Te : Oe;
|
|
1382
|
+
function J(e) {
|
|
1383
1383
|
const t = k(e);
|
|
1384
|
-
return
|
|
1384
|
+
return j(() => {
|
|
1385
1385
|
t.current = e;
|
|
1386
|
-
}, [e]),
|
|
1386
|
+
}, [e]), Z(
|
|
1387
1387
|
(...n) => t.current?.(...n),
|
|
1388
1388
|
[t]
|
|
1389
1389
|
);
|
|
1390
1390
|
}
|
|
1391
1391
|
function ge(...e) {
|
|
1392
|
-
return
|
|
1392
|
+
return J((t) => {
|
|
1393
1393
|
e.forEach((n) => {
|
|
1394
1394
|
if (n)
|
|
1395
1395
|
switch (typeof n) {
|
|
@@ -1405,35 +1405,35 @@ function ge(...e) {
|
|
|
1405
1405
|
});
|
|
1406
1406
|
});
|
|
1407
1407
|
}
|
|
1408
|
-
function
|
|
1408
|
+
function Gt(e) {
|
|
1409
1409
|
const t = k({ ...e });
|
|
1410
|
-
return
|
|
1410
|
+
return j(() => {
|
|
1411
1411
|
for (const n in e)
|
|
1412
1412
|
t.current[n] = e[n];
|
|
1413
1413
|
}, [e]), t.current;
|
|
1414
1414
|
}
|
|
1415
|
-
const Ze =
|
|
1416
|
-
function
|
|
1415
|
+
const Ze = ot(null);
|
|
1416
|
+
function It(e, t) {
|
|
1417
1417
|
const n = k({
|
|
1418
1418
|
getLayout: () => ({}),
|
|
1419
|
-
setLayout:
|
|
1419
|
+
setLayout: Ct
|
|
1420
1420
|
});
|
|
1421
|
-
|
|
1421
|
+
Ae(t, () => n.current, []), j(() => {
|
|
1422
1422
|
Object.assign(
|
|
1423
1423
|
n.current,
|
|
1424
1424
|
Ve({ groupId: e })
|
|
1425
1425
|
);
|
|
1426
1426
|
});
|
|
1427
1427
|
}
|
|
1428
|
-
function
|
|
1428
|
+
function Dt({
|
|
1429
1429
|
children: e,
|
|
1430
1430
|
className: t,
|
|
1431
1431
|
defaultLayout: n,
|
|
1432
1432
|
disableCursor: o,
|
|
1433
1433
|
disabled: i,
|
|
1434
|
-
elementRef:
|
|
1434
|
+
elementRef: r,
|
|
1435
1435
|
groupRef: l,
|
|
1436
|
-
id:
|
|
1436
|
+
id: s,
|
|
1437
1437
|
onLayoutChange: a,
|
|
1438
1438
|
onLayoutChanged: u,
|
|
1439
1439
|
orientation: c = "horizontal",
|
|
@@ -1441,43 +1441,43 @@ function It({
|
|
|
1441
1441
|
coarse: 20,
|
|
1442
1442
|
fine: 10
|
|
1443
1443
|
},
|
|
1444
|
-
style:
|
|
1444
|
+
style: S,
|
|
1445
1445
|
...m
|
|
1446
1446
|
}) {
|
|
1447
1447
|
const f = k({
|
|
1448
1448
|
onLayoutChange: {},
|
|
1449
1449
|
onLayoutChanged: {}
|
|
1450
|
-
}), d =
|
|
1451
|
-
|
|
1452
|
-
}), p =
|
|
1453
|
-
|
|
1454
|
-
}), g = me(
|
|
1450
|
+
}), d = J((w) => {
|
|
1451
|
+
$(f.current.onLayoutChange, w) || (f.current.onLayoutChange = w, a?.(w));
|
|
1452
|
+
}), p = J((w) => {
|
|
1453
|
+
$(f.current.onLayoutChanged, w) || (f.current.onLayoutChanged = w, u?.(w));
|
|
1454
|
+
}), g = me(s), v = k(null), [x, y] = Ye(), z = k({
|
|
1455
1455
|
lastExpandedPanelSizes: {},
|
|
1456
1456
|
layouts: {},
|
|
1457
1457
|
panels: [],
|
|
1458
1458
|
resizeTargetMinimumSize: h,
|
|
1459
1459
|
separators: []
|
|
1460
|
-
}), C = ge(v,
|
|
1461
|
-
|
|
1462
|
-
const P =
|
|
1460
|
+
}), C = ge(v, r);
|
|
1461
|
+
It(g, l);
|
|
1462
|
+
const P = J(
|
|
1463
1463
|
(w, L) => {
|
|
1464
|
-
const { interactionState: E, mountedGroups:
|
|
1465
|
-
for (const
|
|
1466
|
-
if (
|
|
1467
|
-
const
|
|
1468
|
-
if (
|
|
1469
|
-
let
|
|
1464
|
+
const { interactionState: E, mountedGroups: ne } = G();
|
|
1465
|
+
for (const oe of ne.keys())
|
|
1466
|
+
if (oe.id === w) {
|
|
1467
|
+
const X = ne.get(oe);
|
|
1468
|
+
if (X) {
|
|
1469
|
+
let q = !1;
|
|
1470
1470
|
switch (E.state) {
|
|
1471
1471
|
case "active": {
|
|
1472
|
-
|
|
1473
|
-
(le) => le.group ===
|
|
1472
|
+
q = E.hitRegions.some(
|
|
1473
|
+
(le) => le.group === oe
|
|
1474
1474
|
);
|
|
1475
1475
|
break;
|
|
1476
1476
|
}
|
|
1477
1477
|
}
|
|
1478
1478
|
return {
|
|
1479
|
-
flexGrow:
|
|
1480
|
-
pointerEvents:
|
|
1479
|
+
flexGrow: X.layout[L] ?? 1,
|
|
1480
|
+
pointerEvents: q ? "none" : void 0
|
|
1481
1481
|
};
|
|
1482
1482
|
}
|
|
1483
1483
|
}
|
|
@@ -1485,88 +1485,90 @@ function It({
|
|
|
1485
1485
|
flexGrow: n?.[L] ?? 1
|
|
1486
1486
|
};
|
|
1487
1487
|
}
|
|
1488
|
-
),
|
|
1488
|
+
), O = _e(
|
|
1489
1489
|
() => ({
|
|
1490
1490
|
getPanelStyles: P,
|
|
1491
1491
|
id: g,
|
|
1492
1492
|
orientation: c,
|
|
1493
1493
|
registerPanel: (w) => {
|
|
1494
|
-
const L =
|
|
1494
|
+
const L = z.current;
|
|
1495
1495
|
return L.panels = de(c, [
|
|
1496
1496
|
...L.panels,
|
|
1497
1497
|
w
|
|
1498
|
-
]),
|
|
1498
|
+
]), y(), () => {
|
|
1499
1499
|
L.panels = L.panels.filter(
|
|
1500
1500
|
(E) => E !== w
|
|
1501
|
-
),
|
|
1501
|
+
), y();
|
|
1502
1502
|
};
|
|
1503
1503
|
},
|
|
1504
1504
|
registerSeparator: (w) => {
|
|
1505
|
-
const L =
|
|
1505
|
+
const L = z.current;
|
|
1506
1506
|
return L.separators = de(c, [
|
|
1507
1507
|
...L.separators,
|
|
1508
1508
|
w
|
|
1509
|
-
]),
|
|
1509
|
+
]), y(), () => {
|
|
1510
1510
|
L.separators = L.separators.filter(
|
|
1511
1511
|
(E) => E !== w
|
|
1512
|
-
),
|
|
1512
|
+
), y();
|
|
1513
1513
|
};
|
|
1514
1514
|
}
|
|
1515
1515
|
}),
|
|
1516
|
-
[P, g,
|
|
1517
|
-
),
|
|
1516
|
+
[P, g, y, c]
|
|
1517
|
+
), V = Gt({
|
|
1518
1518
|
defaultLayout: n,
|
|
1519
1519
|
disableCursor: o
|
|
1520
|
-
}),
|
|
1521
|
-
return
|
|
1520
|
+
}), A = k(null);
|
|
1521
|
+
return j(() => {
|
|
1522
1522
|
const w = v.current;
|
|
1523
1523
|
if (w === null)
|
|
1524
1524
|
return;
|
|
1525
|
-
const L =
|
|
1526
|
-
defaultLayout:
|
|
1527
|
-
disableCursor: !!
|
|
1525
|
+
const L = z.current, E = {
|
|
1526
|
+
defaultLayout: V.defaultLayout,
|
|
1527
|
+
disableCursor: !!V.disableCursor,
|
|
1528
1528
|
disabled: !!i,
|
|
1529
1529
|
element: w,
|
|
1530
1530
|
id: g,
|
|
1531
|
-
inMemoryLastExpandedPanelSizes:
|
|
1532
|
-
inMemoryLayouts:
|
|
1531
|
+
inMemoryLastExpandedPanelSizes: z.current.lastExpandedPanelSizes,
|
|
1532
|
+
inMemoryLayouts: z.current.layouts,
|
|
1533
1533
|
orientation: c,
|
|
1534
1534
|
panels: L.panels,
|
|
1535
1535
|
resizeTargetMinimumSize: L.resizeTargetMinimumSize,
|
|
1536
1536
|
separators: L.separators
|
|
1537
1537
|
};
|
|
1538
|
-
|
|
1539
|
-
const
|
|
1540
|
-
if (
|
|
1541
|
-
const { defaultLayoutDeferred:
|
|
1542
|
-
!
|
|
1538
|
+
A.current = E;
|
|
1539
|
+
const ne = kt(E), X = G().mountedGroups.get(E);
|
|
1540
|
+
if (X) {
|
|
1541
|
+
const { defaultLayoutDeferred: Y, derivedPanelConstraints: _, layout: U } = X;
|
|
1542
|
+
!Y && _.length > 0 && (d(U), p(U), L.panels.forEach((ue) => {
|
|
1543
1543
|
ue.scheduleUpdate();
|
|
1544
1544
|
}));
|
|
1545
1545
|
}
|
|
1546
|
-
|
|
1546
|
+
let q = !1;
|
|
1547
|
+
const le = F.addListener(
|
|
1547
1548
|
"interactionStateChange",
|
|
1548
|
-
() => {
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1549
|
+
(Y) => {
|
|
1550
|
+
const _ = Y.state === "active";
|
|
1551
|
+
q !== _ && (q = _, L.panels.forEach((U) => {
|
|
1552
|
+
U.scheduleUpdate();
|
|
1553
|
+
}));
|
|
1552
1554
|
}
|
|
1553
|
-
),
|
|
1555
|
+
), Je = F.addListener(
|
|
1554
1556
|
"mountedGroupsChange",
|
|
1555
|
-
(
|
|
1556
|
-
const
|
|
1557
|
-
if (
|
|
1558
|
-
const { defaultLayoutDeferred:
|
|
1559
|
-
if (
|
|
1557
|
+
(Y) => {
|
|
1558
|
+
const _ = Y.get(E);
|
|
1559
|
+
if (_) {
|
|
1560
|
+
const { defaultLayoutDeferred: U, derivedPanelConstraints: ue, layout: Se } = _;
|
|
1561
|
+
if (U || ue.length === 0)
|
|
1560
1562
|
return;
|
|
1561
|
-
const { interactionState:
|
|
1562
|
-
d(Se),
|
|
1563
|
-
|
|
1563
|
+
const { interactionState: Qe } = G(), et = Qe.state !== "active";
|
|
1564
|
+
d(Se), et && p(Se), L.panels.forEach((tt) => {
|
|
1565
|
+
tt.scheduleUpdate();
|
|
1564
1566
|
});
|
|
1565
1567
|
}
|
|
1566
1568
|
}
|
|
1567
1569
|
);
|
|
1568
1570
|
return () => {
|
|
1569
|
-
|
|
1571
|
+
A.current = null, ne(), le(), Je();
|
|
1570
1572
|
};
|
|
1571
1573
|
}, [
|
|
1572
1574
|
i,
|
|
@@ -1574,16 +1576,15 @@ function It({
|
|
|
1574
1576
|
p,
|
|
1575
1577
|
d,
|
|
1576
1578
|
c,
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
+
x,
|
|
1580
|
+
V
|
|
1579
1581
|
]), Oe(() => {
|
|
1580
|
-
const w =
|
|
1582
|
+
const w = A.current;
|
|
1581
1583
|
w && (w.defaultLayout = n, w.disableCursor = !!o);
|
|
1582
|
-
}), /* @__PURE__ */
|
|
1584
|
+
}), /* @__PURE__ */ Q(Ze.Provider, { value: O, children: /* @__PURE__ */ Q(
|
|
1583
1585
|
"div",
|
|
1584
1586
|
{
|
|
1585
1587
|
...m,
|
|
1586
|
-
"aria-orientation": c,
|
|
1587
1588
|
className: t,
|
|
1588
1589
|
"data-group": !0,
|
|
1589
1590
|
"data-testid": g,
|
|
@@ -1593,7 +1594,7 @@ function It({
|
|
|
1593
1594
|
height: "100%",
|
|
1594
1595
|
width: "100%",
|
|
1595
1596
|
overflow: "hidden",
|
|
1596
|
-
...
|
|
1597
|
+
...S,
|
|
1597
1598
|
display: "flex",
|
|
1598
1599
|
flexDirection: c === "horizontal" ? "row" : "column",
|
|
1599
1600
|
flexWrap: "nowrap"
|
|
@@ -1602,43 +1603,43 @@ function It({
|
|
|
1602
1603
|
}
|
|
1603
1604
|
) });
|
|
1604
1605
|
}
|
|
1605
|
-
|
|
1606
|
+
Dt.displayName = "Group";
|
|
1606
1607
|
function fe(e, t) {
|
|
1607
1608
|
return `react-resizable-panels:${[e, ...t].join(":")}`;
|
|
1608
1609
|
}
|
|
1609
|
-
function
|
|
1610
|
+
function jt({
|
|
1610
1611
|
debounceSaveMs: e = 100,
|
|
1611
1612
|
panelIds: t,
|
|
1612
1613
|
storage: n = localStorage,
|
|
1613
1614
|
...o
|
|
1614
1615
|
}) {
|
|
1615
|
-
const i = t !== void 0,
|
|
1616
|
-
|
|
1616
|
+
const i = t !== void 0, r = "id" in o ? o.id : o.groupId, l = fe(r, t ?? []), s = it(
|
|
1617
|
+
Tt,
|
|
1617
1618
|
() => n.getItem(l),
|
|
1618
1619
|
() => n.getItem(l)
|
|
1619
|
-
), a =
|
|
1620
|
-
() =>
|
|
1621
|
-
[
|
|
1622
|
-
), u = k(null), c =
|
|
1620
|
+
), a = _e(
|
|
1621
|
+
() => s ? JSON.parse(s) : void 0,
|
|
1622
|
+
[s]
|
|
1623
|
+
), u = k(null), c = Z(() => {
|
|
1623
1624
|
const m = u.current;
|
|
1624
1625
|
m && (u.current = null, clearTimeout(m));
|
|
1625
1626
|
}, []);
|
|
1626
1627
|
Te(() => () => {
|
|
1627
1628
|
c();
|
|
1628
1629
|
}, [c]);
|
|
1629
|
-
const h =
|
|
1630
|
+
const h = Z(
|
|
1630
1631
|
(m) => {
|
|
1631
1632
|
c();
|
|
1632
1633
|
let f;
|
|
1633
|
-
i ? f = fe(
|
|
1634
|
+
i ? f = fe(r, Object.keys(m)) : f = fe(r, []);
|
|
1634
1635
|
try {
|
|
1635
1636
|
n.setItem(f, JSON.stringify(m));
|
|
1636
1637
|
} catch (d) {
|
|
1637
1638
|
console.error(d);
|
|
1638
1639
|
}
|
|
1639
1640
|
},
|
|
1640
|
-
[c, i,
|
|
1641
|
-
),
|
|
1641
|
+
[c, i, r, n]
|
|
1642
|
+
), S = Z(
|
|
1642
1643
|
(m) => {
|
|
1643
1644
|
c(), e === 0 ? h(m) : u.current = setTimeout(() => {
|
|
1644
1645
|
h(m);
|
|
@@ -1656,31 +1657,31 @@ function Ht({
|
|
|
1656
1657
|
*
|
|
1657
1658
|
* @deprecated Use the {@link onLayoutChanged} prop instead.
|
|
1658
1659
|
*/
|
|
1659
|
-
onLayoutChange:
|
|
1660
|
+
onLayoutChange: S,
|
|
1660
1661
|
/**
|
|
1661
1662
|
* Attach this callback on the `Group` as the `onLayoutChanged` prop.
|
|
1662
1663
|
*/
|
|
1663
1664
|
onLayoutChanged: h
|
|
1664
1665
|
};
|
|
1665
1666
|
}
|
|
1666
|
-
function
|
|
1667
|
+
function Tt() {
|
|
1667
1668
|
return function() {
|
|
1668
1669
|
};
|
|
1669
1670
|
}
|
|
1670
|
-
function jt() {
|
|
1671
|
-
return Z(null);
|
|
1672
|
-
}
|
|
1673
1671
|
function Vt() {
|
|
1672
|
+
return ee(null);
|
|
1673
|
+
}
|
|
1674
|
+
function Ut() {
|
|
1674
1675
|
return k(null);
|
|
1675
1676
|
}
|
|
1676
1677
|
function ye() {
|
|
1677
|
-
const e =
|
|
1678
|
-
return
|
|
1678
|
+
const e = rt(Ze);
|
|
1679
|
+
return b(
|
|
1679
1680
|
e,
|
|
1680
1681
|
"Group Context not found; did you render a Panel or Separator outside of a Group?"
|
|
1681
1682
|
), e;
|
|
1682
1683
|
}
|
|
1683
|
-
function
|
|
1684
|
+
function Ot(e, t) {
|
|
1684
1685
|
const { id: n } = ye(), o = k({
|
|
1685
1686
|
collapse: ce,
|
|
1686
1687
|
expand: ce,
|
|
@@ -1691,50 +1692,50 @@ function Tt(e, t) {
|
|
|
1691
1692
|
isCollapsed: () => !1,
|
|
1692
1693
|
resize: ce
|
|
1693
1694
|
});
|
|
1694
|
-
|
|
1695
|
+
Ae(t, () => o.current, []), j(() => {
|
|
1695
1696
|
Object.assign(
|
|
1696
1697
|
o.current,
|
|
1697
1698
|
je({ groupId: n, panelId: e })
|
|
1698
1699
|
);
|
|
1699
1700
|
});
|
|
1700
1701
|
}
|
|
1701
|
-
function
|
|
1702
|
+
function At({
|
|
1702
1703
|
children: e,
|
|
1703
1704
|
className: t,
|
|
1704
1705
|
collapsedSize: n = "0%",
|
|
1705
1706
|
collapsible: o = !1,
|
|
1706
1707
|
defaultSize: i,
|
|
1707
|
-
elementRef:
|
|
1708
|
+
elementRef: r,
|
|
1708
1709
|
id: l,
|
|
1709
|
-
maxSize:
|
|
1710
|
+
maxSize: s = "100%",
|
|
1710
1711
|
minSize: a = "0%",
|
|
1711
1712
|
onResize: u,
|
|
1712
1713
|
panelRef: c,
|
|
1713
1714
|
style: h,
|
|
1714
|
-
...
|
|
1715
|
+
...S
|
|
1715
1716
|
}) {
|
|
1716
|
-
const m = !!l, f = me(l), d = k(null), p = ge(d,
|
|
1717
|
-
(
|
|
1718
|
-
u?.(
|
|
1717
|
+
const m = !!l, f = me(l), d = k(null), p = ge(d, r), [, g] = Ye(), { getPanelStyles: v, id: x, registerPanel: y } = ye(), z = u !== null, C = J(
|
|
1718
|
+
(O, V, A) => {
|
|
1719
|
+
u?.(O, l, A);
|
|
1719
1720
|
}
|
|
1720
1721
|
);
|
|
1721
|
-
|
|
1722
|
-
const
|
|
1723
|
-
if (
|
|
1724
|
-
return
|
|
1725
|
-
element:
|
|
1722
|
+
j(() => {
|
|
1723
|
+
const O = d.current;
|
|
1724
|
+
if (O !== null)
|
|
1725
|
+
return y({
|
|
1726
|
+
element: O,
|
|
1726
1727
|
id: f,
|
|
1727
1728
|
idIsStable: m,
|
|
1728
1729
|
mutableValues: {
|
|
1729
1730
|
expandToSize: void 0,
|
|
1730
1731
|
prevSize: void 0
|
|
1731
1732
|
},
|
|
1732
|
-
onResize:
|
|
1733
|
+
onResize: z ? C : void 0,
|
|
1733
1734
|
panelConstraints: {
|
|
1734
1735
|
collapsedSize: n,
|
|
1735
1736
|
collapsible: o,
|
|
1736
1737
|
defaultSize: i,
|
|
1737
|
-
maxSize:
|
|
1738
|
+
maxSize: s,
|
|
1738
1739
|
minSize: a
|
|
1739
1740
|
},
|
|
1740
1741
|
scheduleUpdate: g
|
|
@@ -1744,19 +1745,19 @@ function Ot({
|
|
|
1744
1745
|
o,
|
|
1745
1746
|
i,
|
|
1746
1747
|
g,
|
|
1747
|
-
|
|
1748
|
+
z,
|
|
1748
1749
|
f,
|
|
1749
1750
|
m,
|
|
1750
|
-
|
|
1751
|
+
s,
|
|
1751
1752
|
a,
|
|
1752
1753
|
C,
|
|
1753
|
-
|
|
1754
|
-
]),
|
|
1755
|
-
const P = v(
|
|
1756
|
-
return /* @__PURE__ */
|
|
1754
|
+
y
|
|
1755
|
+
]), Ot(f, c);
|
|
1756
|
+
const P = v(x, f);
|
|
1757
|
+
return /* @__PURE__ */ Q(
|
|
1757
1758
|
"div",
|
|
1758
1759
|
{
|
|
1759
|
-
...
|
|
1760
|
+
...S,
|
|
1760
1761
|
"data-panel": !0,
|
|
1761
1762
|
"data-testid": f,
|
|
1762
1763
|
id: f,
|
|
@@ -1770,7 +1771,7 @@ function Ot({
|
|
|
1770
1771
|
overflow: "hidden",
|
|
1771
1772
|
...P
|
|
1772
1773
|
},
|
|
1773
|
-
children: /* @__PURE__ */
|
|
1774
|
+
children: /* @__PURE__ */ Q(
|
|
1774
1775
|
"div",
|
|
1775
1776
|
{
|
|
1776
1777
|
className: t,
|
|
@@ -1786,7 +1787,7 @@ function Ot({
|
|
|
1786
1787
|
}
|
|
1787
1788
|
);
|
|
1788
1789
|
}
|
|
1789
|
-
|
|
1790
|
+
At.displayName = "Panel";
|
|
1790
1791
|
const _t = {
|
|
1791
1792
|
minHeight: 0,
|
|
1792
1793
|
maxHeight: "100%",
|
|
@@ -1799,26 +1800,26 @@ const _t = {
|
|
|
1799
1800
|
padding: 0,
|
|
1800
1801
|
margin: 0
|
|
1801
1802
|
};
|
|
1802
|
-
function Ut() {
|
|
1803
|
-
return Z(null);
|
|
1804
|
-
}
|
|
1805
1803
|
function Wt() {
|
|
1804
|
+
return ee(null);
|
|
1805
|
+
}
|
|
1806
|
+
function Bt() {
|
|
1806
1807
|
return k(null);
|
|
1807
1808
|
}
|
|
1808
|
-
function
|
|
1809
|
+
function Nt({
|
|
1809
1810
|
layout: e,
|
|
1810
1811
|
panelConstraints: t,
|
|
1811
1812
|
panelId: n,
|
|
1812
1813
|
panelIndex: o
|
|
1813
1814
|
}) {
|
|
1814
|
-
let i,
|
|
1815
|
-
const l = e[n],
|
|
1815
|
+
let i, r;
|
|
1816
|
+
const l = e[n], s = t.find(
|
|
1816
1817
|
(a) => a.panelId === n
|
|
1817
1818
|
);
|
|
1818
|
-
if (
|
|
1819
|
-
const a =
|
|
1820
|
-
|
|
1821
|
-
layout:
|
|
1819
|
+
if (s) {
|
|
1820
|
+
const a = s.maxSize, u = s.collapsible ? s.collapsedSize : s.minSize, c = [o, o + 1];
|
|
1821
|
+
r = H({
|
|
1822
|
+
layout: te({
|
|
1822
1823
|
delta: u - l,
|
|
1823
1824
|
initialLayout: e,
|
|
1824
1825
|
panelConstraints: t,
|
|
@@ -1826,8 +1827,8 @@ function At({
|
|
|
1826
1827
|
prevLayout: e
|
|
1827
1828
|
}),
|
|
1828
1829
|
panelConstraints: t
|
|
1829
|
-
})[n], i =
|
|
1830
|
-
layout:
|
|
1830
|
+
})[n], i = H({
|
|
1831
|
+
layout: te({
|
|
1831
1832
|
delta: a - l,
|
|
1832
1833
|
initialLayout: e,
|
|
1833
1834
|
panelConstraints: t,
|
|
@@ -1840,30 +1841,30 @@ function At({
|
|
|
1840
1841
|
return {
|
|
1841
1842
|
valueControls: n,
|
|
1842
1843
|
valueMax: i,
|
|
1843
|
-
valueMin:
|
|
1844
|
+
valueMin: r,
|
|
1844
1845
|
valueNow: l
|
|
1845
1846
|
};
|
|
1846
1847
|
}
|
|
1847
|
-
function
|
|
1848
|
+
function Ft({
|
|
1848
1849
|
children: e,
|
|
1849
1850
|
className: t,
|
|
1850
1851
|
elementRef: n,
|
|
1851
1852
|
id: o,
|
|
1852
1853
|
style: i,
|
|
1853
|
-
...
|
|
1854
|
+
...r
|
|
1854
1855
|
}) {
|
|
1855
|
-
const l = me(o), [
|
|
1856
|
+
const l = me(o), [s, a] = ee({}), [u, c] = ee("inactive"), h = k(null), S = ge(h, n), {
|
|
1856
1857
|
id: m,
|
|
1857
1858
|
orientation: f,
|
|
1858
1859
|
registerSeparator: d
|
|
1859
1860
|
} = ye(), p = f === "horizontal" ? "vertical" : "horizontal";
|
|
1860
|
-
return
|
|
1861
|
+
return j(() => {
|
|
1861
1862
|
const g = h.current;
|
|
1862
1863
|
if (g !== null) {
|
|
1863
1864
|
const v = {
|
|
1864
1865
|
element: g,
|
|
1865
1866
|
id: l
|
|
1866
|
-
},
|
|
1867
|
+
}, x = d(v), y = F.addListener(
|
|
1867
1868
|
"interactionStateChange",
|
|
1868
1869
|
(C) => {
|
|
1869
1870
|
c(
|
|
@@ -1872,18 +1873,18 @@ function Nt({
|
|
|
1872
1873
|
) ? C.state : "inactive"
|
|
1873
1874
|
);
|
|
1874
1875
|
}
|
|
1875
|
-
),
|
|
1876
|
+
), z = F.addListener(
|
|
1876
1877
|
"mountedGroupsChange",
|
|
1877
1878
|
(C) => {
|
|
1878
1879
|
C.forEach(
|
|
1879
|
-
({ derivedPanelConstraints: P, layout:
|
|
1880
|
-
if (
|
|
1881
|
-
const w =
|
|
1880
|
+
({ derivedPanelConstraints: P, layout: O, separatorToPanels: V }, A) => {
|
|
1881
|
+
if (A.id === m) {
|
|
1882
|
+
const w = V.get(v);
|
|
1882
1883
|
if (w) {
|
|
1883
|
-
const L = w[0], E =
|
|
1884
|
+
const L = w[0], E = A.panels.indexOf(L);
|
|
1884
1885
|
a(
|
|
1885
|
-
|
|
1886
|
-
layout:
|
|
1886
|
+
Nt({
|
|
1887
|
+
layout: O,
|
|
1887
1888
|
panelConstraints: P,
|
|
1888
1889
|
panelId: L.id,
|
|
1889
1890
|
panelIndex: E
|
|
@@ -1896,24 +1897,24 @@ function Nt({
|
|
|
1896
1897
|
}
|
|
1897
1898
|
);
|
|
1898
1899
|
return () => {
|
|
1899
|
-
|
|
1900
|
+
y(), z(), x();
|
|
1900
1901
|
};
|
|
1901
1902
|
}
|
|
1902
|
-
}, [m, l, d]), /* @__PURE__ */
|
|
1903
|
+
}, [m, l, d]), /* @__PURE__ */ Q(
|
|
1903
1904
|
"div",
|
|
1904
1905
|
{
|
|
1905
|
-
...
|
|
1906
|
-
"aria-controls":
|
|
1906
|
+
...r,
|
|
1907
|
+
"aria-controls": s.valueControls,
|
|
1907
1908
|
"aria-orientation": p,
|
|
1908
|
-
"aria-valuemax":
|
|
1909
|
-
"aria-valuemin":
|
|
1910
|
-
"aria-valuenow":
|
|
1909
|
+
"aria-valuemax": s.valueMax,
|
|
1910
|
+
"aria-valuemin": s.valueMin,
|
|
1911
|
+
"aria-valuenow": s.valueNow,
|
|
1911
1912
|
children: e,
|
|
1912
1913
|
className: t,
|
|
1913
1914
|
"data-separator": u,
|
|
1914
1915
|
"data-testid": l,
|
|
1915
1916
|
id: l,
|
|
1916
|
-
ref:
|
|
1917
|
+
ref: S,
|
|
1917
1918
|
role: "separator",
|
|
1918
1919
|
style: {
|
|
1919
1920
|
flexBasis: "auto",
|
|
@@ -1925,16 +1926,16 @@ function Nt({
|
|
|
1925
1926
|
}
|
|
1926
1927
|
);
|
|
1927
1928
|
}
|
|
1928
|
-
|
|
1929
|
+
Ft.displayName = "Separator";
|
|
1929
1930
|
export {
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1931
|
+
Dt as Group,
|
|
1932
|
+
At as Panel,
|
|
1933
|
+
Ft as Separator,
|
|
1934
|
+
ut as isCoarsePointer,
|
|
1935
|
+
jt as useDefaultLayout,
|
|
1936
|
+
Vt as useGroupCallbackRef,
|
|
1937
|
+
Ut as useGroupRef,
|
|
1938
|
+
Wt as usePanelCallbackRef,
|
|
1939
|
+
Bt as usePanelRef
|
|
1939
1940
|
};
|
|
1940
1941
|
//# sourceMappingURL=react-resizable-panels.js.map
|