react-resizable-panels 4.10.0 → 4.11.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,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as ae } from "react/jsx-runtime";
|
|
3
|
-
import { useState as Q, useCallback as re, useId as pt, useLayoutEffect as Ue, useEffect as me, useRef as
|
|
3
|
+
import { useState as Q, useCallback as re, useId as pt, useLayoutEffect as Ue, useEffect as me, useRef as T, createContext as ht, useImperativeHandle as Ke, useMemo as Se, useSyncExternalStore as Xe, useContext as mt } from "react";
|
|
4
4
|
function gt(e, t) {
|
|
5
5
|
const n = getComputedStyle(e), o = parseFloat(n.fontSize);
|
|
6
6
|
return t * o;
|
|
@@ -31,8 +31,8 @@ function ie({
|
|
|
31
31
|
styleProp: n
|
|
32
32
|
}) {
|
|
33
33
|
let o;
|
|
34
|
-
const [i,
|
|
35
|
-
switch (
|
|
34
|
+
const [i, r] = bt(n);
|
|
35
|
+
switch (r) {
|
|
36
36
|
case "%": {
|
|
37
37
|
o = i / 100 * e;
|
|
38
38
|
break;
|
|
@@ -60,7 +60,7 @@ function ie({
|
|
|
60
60
|
}
|
|
61
61
|
return o;
|
|
62
62
|
}
|
|
63
|
-
function
|
|
63
|
+
function O(e) {
|
|
64
64
|
return parseFloat(e.toFixed(3));
|
|
65
65
|
}
|
|
66
66
|
function ne({
|
|
@@ -81,51 +81,51 @@ function ve(e) {
|
|
|
81
81
|
maxSize: 100,
|
|
82
82
|
panelId: o.id
|
|
83
83
|
})) : t.map((o) => {
|
|
84
|
-
const { element: i, panelConstraints:
|
|
85
|
-
let
|
|
86
|
-
if (
|
|
87
|
-
const
|
|
84
|
+
const { element: i, panelConstraints: r } = o;
|
|
85
|
+
let f = 0;
|
|
86
|
+
if (r.collapsedSize !== void 0) {
|
|
87
|
+
const u = ie({
|
|
88
88
|
groupSize: n,
|
|
89
89
|
panelElement: i,
|
|
90
|
-
styleProp:
|
|
90
|
+
styleProp: r.collapsedSize
|
|
91
91
|
});
|
|
92
|
-
|
|
92
|
+
f = O(u / n * 100);
|
|
93
93
|
}
|
|
94
|
-
let
|
|
95
|
-
if (
|
|
96
|
-
const
|
|
94
|
+
let a;
|
|
95
|
+
if (r.defaultSize !== void 0) {
|
|
96
|
+
const u = ie({
|
|
97
97
|
groupSize: n,
|
|
98
98
|
panelElement: i,
|
|
99
|
-
styleProp:
|
|
99
|
+
styleProp: r.defaultSize
|
|
100
100
|
});
|
|
101
|
-
|
|
101
|
+
a = O(u / n * 100);
|
|
102
102
|
}
|
|
103
|
-
let
|
|
104
|
-
if (
|
|
105
|
-
const
|
|
103
|
+
let s = 0;
|
|
104
|
+
if (r.minSize !== void 0) {
|
|
105
|
+
const u = ie({
|
|
106
106
|
groupSize: n,
|
|
107
107
|
panelElement: i,
|
|
108
|
-
styleProp:
|
|
108
|
+
styleProp: r.minSize
|
|
109
109
|
});
|
|
110
|
-
|
|
110
|
+
s = O(u / n * 100);
|
|
111
111
|
}
|
|
112
|
-
let
|
|
113
|
-
if (
|
|
114
|
-
const
|
|
112
|
+
let l = 100;
|
|
113
|
+
if (r.maxSize !== void 0) {
|
|
114
|
+
const u = ie({
|
|
115
115
|
groupSize: n,
|
|
116
116
|
panelElement: i,
|
|
117
|
-
styleProp:
|
|
117
|
+
styleProp: r.maxSize
|
|
118
118
|
});
|
|
119
|
-
|
|
119
|
+
l = O(u / n * 100);
|
|
120
120
|
}
|
|
121
121
|
return {
|
|
122
|
-
groupResizeBehavior:
|
|
123
|
-
collapsedSize:
|
|
124
|
-
collapsible:
|
|
125
|
-
defaultSize:
|
|
126
|
-
disabled:
|
|
127
|
-
minSize:
|
|
128
|
-
maxSize:
|
|
122
|
+
groupResizeBehavior: r.groupResizeBehavior,
|
|
123
|
+
collapsedSize: f,
|
|
124
|
+
collapsible: r.collapsible === !0,
|
|
125
|
+
defaultSize: a,
|
|
126
|
+
disabled: r.disabled,
|
|
127
|
+
minSize: s,
|
|
128
|
+
maxSize: l,
|
|
129
129
|
panelId: o.id
|
|
130
130
|
};
|
|
131
131
|
});
|
|
@@ -162,7 +162,7 @@ function Ye(e, t) {
|
|
|
162
162
|
)
|
|
163
163
|
};
|
|
164
164
|
}
|
|
165
|
-
function
|
|
165
|
+
function Pt({
|
|
166
166
|
orientation: e,
|
|
167
167
|
rects: t,
|
|
168
168
|
targetRect: n
|
|
@@ -171,41 +171,41 @@ function wt({
|
|
|
171
171
|
x: n.x + n.width / 2,
|
|
172
172
|
y: n.y + n.height / 2
|
|
173
173
|
};
|
|
174
|
-
let i,
|
|
175
|
-
for (const
|
|
176
|
-
const { x:
|
|
177
|
-
|
|
174
|
+
let i, r = Number.MAX_VALUE;
|
|
175
|
+
for (const f of t) {
|
|
176
|
+
const { x: a, y: s } = Ye(o, f), l = e === "horizontal" ? a : s;
|
|
177
|
+
l < r && (r = l, i = f);
|
|
178
178
|
}
|
|
179
179
|
return C(i, "No rect found"), i;
|
|
180
180
|
}
|
|
181
181
|
let fe;
|
|
182
|
-
function
|
|
182
|
+
function wt() {
|
|
183
183
|
return fe === void 0 && (typeof matchMedia == "function" ? fe = !!matchMedia("(pointer:coarse)").matches : fe = !1), fe;
|
|
184
184
|
}
|
|
185
185
|
function Je(e) {
|
|
186
|
-
const { element: t, orientation: n, panels: o, separators: i } = e,
|
|
186
|
+
const { element: t, orientation: n, panels: o, separators: i } = e, r = be(
|
|
187
187
|
n,
|
|
188
|
-
Array.from(t.children).filter(qe).map((
|
|
189
|
-
).map(({ element:
|
|
190
|
-
let
|
|
188
|
+
Array.from(t.children).filter(qe).map((z) => ({ element: z }))
|
|
189
|
+
).map(({ element: z }) => z), f = [];
|
|
190
|
+
let a = !1, s = !1, l = -1, u = -1, h = 0, d, S = [];
|
|
191
191
|
{
|
|
192
|
-
let
|
|
193
|
-
for (const
|
|
194
|
-
|
|
192
|
+
let z = -1;
|
|
193
|
+
for (const c of r)
|
|
194
|
+
c.hasAttribute("data-panel") && (z++, c.hasAttribute("data-disabled") || (h++, l === -1 && (l = z), u = z));
|
|
195
195
|
}
|
|
196
|
-
if (
|
|
197
|
-
let
|
|
198
|
-
for (const
|
|
199
|
-
if (
|
|
200
|
-
|
|
196
|
+
if (h > 1) {
|
|
197
|
+
let z = -1;
|
|
198
|
+
for (const c of r)
|
|
199
|
+
if (c.hasAttribute("data-panel")) {
|
|
200
|
+
z++;
|
|
201
201
|
const p = o.find(
|
|
202
|
-
(m) => m.element ===
|
|
202
|
+
(m) => m.element === c
|
|
203
203
|
);
|
|
204
204
|
if (p) {
|
|
205
205
|
if (d) {
|
|
206
|
-
const m = d.element.getBoundingClientRect(),
|
|
207
|
-
let
|
|
208
|
-
if (
|
|
206
|
+
const m = d.element.getBoundingClientRect(), v = c.getBoundingClientRect();
|
|
207
|
+
let b;
|
|
208
|
+
if (s) {
|
|
209
209
|
const y = n === "horizontal" ? new DOMRect(
|
|
210
210
|
m.right,
|
|
211
211
|
m.top,
|
|
@@ -216,89 +216,89 @@ function Je(e) {
|
|
|
216
216
|
m.bottom,
|
|
217
217
|
m.width,
|
|
218
218
|
0
|
|
219
|
-
),
|
|
220
|
-
switch (
|
|
219
|
+
), g = n === "horizontal" ? new DOMRect(v.left, v.top, 0, v.height) : new DOMRect(v.left, v.top, v.width, 0);
|
|
220
|
+
switch (S.length) {
|
|
221
221
|
case 0: {
|
|
222
|
-
|
|
222
|
+
b = [
|
|
223
223
|
y,
|
|
224
|
-
|
|
224
|
+
g
|
|
225
225
|
];
|
|
226
226
|
break;
|
|
227
227
|
}
|
|
228
228
|
case 1: {
|
|
229
|
-
const
|
|
229
|
+
const P = S[0], M = Pt({
|
|
230
230
|
orientation: n,
|
|
231
|
-
rects: [m,
|
|
232
|
-
targetRect:
|
|
231
|
+
rects: [m, v],
|
|
232
|
+
targetRect: P.element.getBoundingClientRect()
|
|
233
233
|
});
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
M === m ?
|
|
234
|
+
b = [
|
|
235
|
+
P,
|
|
236
|
+
M === m ? g : y
|
|
237
237
|
];
|
|
238
238
|
break;
|
|
239
239
|
}
|
|
240
240
|
default: {
|
|
241
|
-
|
|
241
|
+
b = S;
|
|
242
242
|
break;
|
|
243
243
|
}
|
|
244
244
|
}
|
|
245
245
|
} else
|
|
246
|
-
|
|
246
|
+
S.length ? b = S : b = [
|
|
247
247
|
n === "horizontal" ? new DOMRect(
|
|
248
248
|
m.right,
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
249
|
+
v.top,
|
|
250
|
+
v.left - m.right,
|
|
251
|
+
v.height
|
|
252
252
|
) : new DOMRect(
|
|
253
|
-
|
|
253
|
+
v.left,
|
|
254
254
|
m.bottom,
|
|
255
|
-
|
|
256
|
-
|
|
255
|
+
v.width,
|
|
256
|
+
v.top - m.bottom
|
|
257
257
|
)
|
|
258
258
|
];
|
|
259
|
-
for (const y of
|
|
260
|
-
let
|
|
261
|
-
const
|
|
262
|
-
if (
|
|
263
|
-
const
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
259
|
+
for (const y of b) {
|
|
260
|
+
let g = "width" in y ? y : y.element.getBoundingClientRect();
|
|
261
|
+
const P = wt() ? e.resizeTargetMinimumSize.coarse : e.resizeTargetMinimumSize.fine;
|
|
262
|
+
if (g.width < P) {
|
|
263
|
+
const w = P - g.width;
|
|
264
|
+
g = new DOMRect(
|
|
265
|
+
g.x - w / 2,
|
|
266
|
+
g.y,
|
|
267
|
+
g.width + w,
|
|
268
|
+
g.height
|
|
269
269
|
);
|
|
270
270
|
}
|
|
271
|
-
if (
|
|
272
|
-
const
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
271
|
+
if (g.height < P) {
|
|
272
|
+
const w = P - g.height;
|
|
273
|
+
g = new DOMRect(
|
|
274
|
+
g.x,
|
|
275
|
+
g.y - w / 2,
|
|
276
|
+
g.width,
|
|
277
|
+
g.height + w
|
|
278
278
|
);
|
|
279
279
|
}
|
|
280
|
-
const M =
|
|
281
|
-
!
|
|
280
|
+
const M = z <= l || z > u;
|
|
281
|
+
!a && !M && f.push({
|
|
282
282
|
group: e,
|
|
283
283
|
groupSize: ne({ group: e }),
|
|
284
284
|
panels: [d, p],
|
|
285
285
|
separator: "width" in y ? void 0 : y,
|
|
286
|
-
rect:
|
|
287
|
-
}),
|
|
286
|
+
rect: g
|
|
287
|
+
}), a = !1;
|
|
288
288
|
}
|
|
289
289
|
}
|
|
290
|
-
|
|
290
|
+
s = !1, d = p, S = [];
|
|
291
291
|
}
|
|
292
|
-
} else if (
|
|
293
|
-
|
|
292
|
+
} else if (c.hasAttribute("data-separator")) {
|
|
293
|
+
c.ariaDisabled !== null && (a = !0);
|
|
294
294
|
const p = i.find(
|
|
295
|
-
(m) => m.element ===
|
|
295
|
+
(m) => m.element === c
|
|
296
296
|
);
|
|
297
|
-
p ?
|
|
297
|
+
p ? S.push(p) : (d = void 0, S = []);
|
|
298
298
|
} else
|
|
299
|
-
|
|
299
|
+
s = !0;
|
|
300
300
|
}
|
|
301
|
-
return
|
|
301
|
+
return f;
|
|
302
302
|
}
|
|
303
303
|
class Ze {
|
|
304
304
|
#e = {};
|
|
@@ -314,18 +314,18 @@ class Ze {
|
|
|
314
314
|
if (o.length === 1)
|
|
315
315
|
o[0].call(null, n);
|
|
316
316
|
else {
|
|
317
|
-
let i = !1,
|
|
318
|
-
const
|
|
319
|
-
for (let
|
|
320
|
-
const
|
|
317
|
+
let i = !1, r = null;
|
|
318
|
+
const f = Array.from(o);
|
|
319
|
+
for (let a = 0; a < f.length; a++) {
|
|
320
|
+
const s = f[a];
|
|
321
321
|
try {
|
|
322
|
-
|
|
323
|
-
} catch (
|
|
324
|
-
|
|
322
|
+
s.call(null, n);
|
|
323
|
+
} catch (l) {
|
|
324
|
+
r === null && (i = !0, r = l);
|
|
325
325
|
}
|
|
326
326
|
}
|
|
327
327
|
if (i)
|
|
328
|
-
throw
|
|
328
|
+
throw r;
|
|
329
329
|
}
|
|
330
330
|
}
|
|
331
331
|
removeAllListeners() {
|
|
@@ -377,15 +377,15 @@ function Ct(e, t, n) {
|
|
|
377
377
|
x: 1 / 0,
|
|
378
378
|
y: 1 / 0
|
|
379
379
|
};
|
|
380
|
-
for (const
|
|
381
|
-
const
|
|
380
|
+
for (const r of t) {
|
|
381
|
+
const f = Ye(n, r.rect);
|
|
382
382
|
switch (e) {
|
|
383
383
|
case "horizontal": {
|
|
384
|
-
|
|
384
|
+
f.x <= i.x && (o = r, i = f);
|
|
385
385
|
break;
|
|
386
386
|
}
|
|
387
387
|
case "vertical": {
|
|
388
|
-
|
|
388
|
+
f.y <= i.y && (o = r, i = f);
|
|
389
389
|
break;
|
|
390
390
|
}
|
|
391
391
|
}
|
|
@@ -401,8 +401,8 @@ function Rt(e) {
|
|
|
401
401
|
function Mt(e, t) {
|
|
402
402
|
if (e === t) throw new Error("Cannot compare node with itself");
|
|
403
403
|
const n = {
|
|
404
|
-
a:
|
|
405
|
-
b:
|
|
404
|
+
a: Oe(e),
|
|
405
|
+
b: Oe(t)
|
|
406
406
|
};
|
|
407
407
|
let o;
|
|
408
408
|
for (; n.a.at(-1) === n.b.at(-1); )
|
|
@@ -416,15 +416,15 @@ function Mt(e, t) {
|
|
|
416
416
|
b: De(Ie(n.b))
|
|
417
417
|
};
|
|
418
418
|
if (i.a === i.b) {
|
|
419
|
-
const
|
|
419
|
+
const r = o.childNodes, f = {
|
|
420
420
|
a: n.a.at(-1),
|
|
421
421
|
b: n.b.at(-1)
|
|
422
422
|
};
|
|
423
|
-
let
|
|
424
|
-
for (;
|
|
425
|
-
const
|
|
426
|
-
if (
|
|
427
|
-
if (
|
|
423
|
+
let a = r.length;
|
|
424
|
+
for (; a--; ) {
|
|
425
|
+
const s = r[a];
|
|
426
|
+
if (s === f.a) return 1;
|
|
427
|
+
if (s === f.b) return -1;
|
|
428
428
|
}
|
|
429
429
|
}
|
|
430
430
|
return Math.sign(i.a - i.b);
|
|
@@ -449,7 +449,7 @@ function Ie(e) {
|
|
|
449
449
|
function De(e) {
|
|
450
450
|
return e && Number(getComputedStyle(e).zIndex) || 0;
|
|
451
451
|
}
|
|
452
|
-
function
|
|
452
|
+
function Oe(e) {
|
|
453
453
|
const t = [];
|
|
454
454
|
for (; e; )
|
|
455
455
|
t.push(e), e = et(e);
|
|
@@ -462,7 +462,7 @@ function et(e) {
|
|
|
462
462
|
function Dt(e, t) {
|
|
463
463
|
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;
|
|
464
464
|
}
|
|
465
|
-
function
|
|
465
|
+
function Ot({
|
|
466
466
|
groupElement: e,
|
|
467
467
|
hitRegion: t,
|
|
468
468
|
pointerEventTarget: n
|
|
@@ -486,18 +486,18 @@ function xe(e, t) {
|
|
|
486
486
|
return t.forEach((o, i) => {
|
|
487
487
|
if (i.disabled)
|
|
488
488
|
return;
|
|
489
|
-
const
|
|
489
|
+
const r = Je(i), f = Ct(i.orientation, r, {
|
|
490
490
|
x: e.clientX,
|
|
491
491
|
y: e.clientY
|
|
492
492
|
});
|
|
493
|
-
|
|
493
|
+
f && f.distance.x <= 0 && f.distance.y <= 0 && Ot({
|
|
494
494
|
groupElement: i.element,
|
|
495
|
-
hitRegion:
|
|
495
|
+
hitRegion: f.hitRegion.rect,
|
|
496
496
|
pointerEventTarget: e.target
|
|
497
|
-
}) && n.push(
|
|
497
|
+
}) && n.push(f.hitRegion);
|
|
498
498
|
}), n;
|
|
499
499
|
}
|
|
500
|
-
function
|
|
500
|
+
function Tt(e, t) {
|
|
501
501
|
if (e.length !== t.length)
|
|
502
502
|
return !1;
|
|
503
503
|
for (let n = 0; n < e.length; n++)
|
|
@@ -505,11 +505,11 @@ function Ot(e, t) {
|
|
|
505
505
|
return !1;
|
|
506
506
|
return !0;
|
|
507
507
|
}
|
|
508
|
-
function
|
|
509
|
-
return Math.abs(
|
|
508
|
+
function I(e, t, n = 0) {
|
|
509
|
+
return Math.abs(O(e) - O(t)) <= n;
|
|
510
510
|
}
|
|
511
511
|
function A(e, t) {
|
|
512
|
-
return
|
|
512
|
+
return I(e, t) ? 0 : e > t ? 1 : -1;
|
|
513
513
|
}
|
|
514
514
|
function Z({
|
|
515
515
|
overrideDisabledPanels: e,
|
|
@@ -519,20 +519,20 @@ function Z({
|
|
|
519
519
|
}) {
|
|
520
520
|
const {
|
|
521
521
|
collapsedSize: i = 0,
|
|
522
|
-
collapsible:
|
|
523
|
-
disabled:
|
|
524
|
-
maxSize:
|
|
525
|
-
minSize:
|
|
522
|
+
collapsible: r,
|
|
523
|
+
disabled: f,
|
|
524
|
+
maxSize: a = 100,
|
|
525
|
+
minSize: s = 0
|
|
526
526
|
} = t;
|
|
527
|
-
if (
|
|
527
|
+
if (f && !e)
|
|
528
528
|
return n;
|
|
529
|
-
if (A(o,
|
|
530
|
-
if (
|
|
531
|
-
const
|
|
532
|
-
A(o,
|
|
529
|
+
if (A(o, s) < 0)
|
|
530
|
+
if (r) {
|
|
531
|
+
const l = (i + s) / 2;
|
|
532
|
+
A(o, l) < 0 ? o = i : o = s;
|
|
533
533
|
} else
|
|
534
|
-
o =
|
|
535
|
-
return o = Math.min(
|
|
534
|
+
o = s;
|
|
535
|
+
return o = Math.min(a, o), o = O(o), o;
|
|
536
536
|
}
|
|
537
537
|
function le({
|
|
538
538
|
delta: e,
|
|
@@ -540,163 +540,163 @@ function le({
|
|
|
540
540
|
panelConstraints: n,
|
|
541
541
|
pivotIndices: o,
|
|
542
542
|
prevLayout: i,
|
|
543
|
-
trigger:
|
|
543
|
+
trigger: r
|
|
544
544
|
}) {
|
|
545
|
-
if (
|
|
545
|
+
if (I(e, 0))
|
|
546
546
|
return t;
|
|
547
|
-
const
|
|
548
|
-
C(
|
|
547
|
+
const f = r === "imperative-api", a = Object.values(t), s = Object.values(i), l = [...a], [u, h] = o;
|
|
548
|
+
C(u != null, "Invalid first pivot index"), C(h != null, "Invalid second pivot index");
|
|
549
549
|
let d = 0;
|
|
550
|
-
switch (
|
|
550
|
+
switch (r) {
|
|
551
551
|
case "keyboard": {
|
|
552
552
|
{
|
|
553
|
-
const
|
|
553
|
+
const c = e < 0 ? h : u, p = n[c];
|
|
554
554
|
C(
|
|
555
555
|
p,
|
|
556
|
-
`Panel constraints not found for index ${
|
|
556
|
+
`Panel constraints not found for index ${c}`
|
|
557
557
|
);
|
|
558
558
|
const {
|
|
559
559
|
collapsedSize: m = 0,
|
|
560
|
-
collapsible:
|
|
561
|
-
minSize:
|
|
560
|
+
collapsible: v,
|
|
561
|
+
minSize: b = 0
|
|
562
562
|
} = p;
|
|
563
|
-
if (
|
|
564
|
-
const y =
|
|
563
|
+
if (v) {
|
|
564
|
+
const y = a[c];
|
|
565
565
|
if (C(
|
|
566
566
|
y != null,
|
|
567
|
-
`Previous layout not found for panel index ${
|
|
568
|
-
),
|
|
569
|
-
const
|
|
570
|
-
A(
|
|
567
|
+
`Previous layout not found for panel index ${c}`
|
|
568
|
+
), I(y, m)) {
|
|
569
|
+
const g = b - y;
|
|
570
|
+
A(g, Math.abs(e)) > 0 && (e = e < 0 ? 0 - g : g);
|
|
571
571
|
}
|
|
572
572
|
}
|
|
573
573
|
}
|
|
574
574
|
{
|
|
575
|
-
const
|
|
575
|
+
const c = e < 0 ? u : h, p = n[c];
|
|
576
576
|
C(
|
|
577
577
|
p,
|
|
578
|
-
`No panel constraints found for index ${
|
|
578
|
+
`No panel constraints found for index ${c}`
|
|
579
579
|
);
|
|
580
580
|
const {
|
|
581
581
|
collapsedSize: m = 0,
|
|
582
|
-
collapsible:
|
|
583
|
-
minSize:
|
|
582
|
+
collapsible: v,
|
|
583
|
+
minSize: b = 0
|
|
584
584
|
} = p;
|
|
585
|
-
if (
|
|
586
|
-
const y =
|
|
585
|
+
if (v) {
|
|
586
|
+
const y = a[c];
|
|
587
587
|
if (C(
|
|
588
588
|
y != null,
|
|
589
|
-
`Previous layout not found for panel index ${
|
|
590
|
-
),
|
|
591
|
-
const
|
|
592
|
-
A(
|
|
589
|
+
`Previous layout not found for panel index ${c}`
|
|
590
|
+
), I(y, b)) {
|
|
591
|
+
const g = y - m;
|
|
592
|
+
A(g, Math.abs(e)) > 0 && (e = e < 0 ? 0 - g : g);
|
|
593
593
|
}
|
|
594
594
|
}
|
|
595
595
|
}
|
|
596
596
|
break;
|
|
597
597
|
}
|
|
598
598
|
default: {
|
|
599
|
-
const
|
|
599
|
+
const c = e < 0 ? h : u, p = n[c];
|
|
600
600
|
C(
|
|
601
601
|
p,
|
|
602
|
-
`Panel constraints not found for index ${
|
|
602
|
+
`Panel constraints not found for index ${c}`
|
|
603
603
|
);
|
|
604
|
-
const m =
|
|
605
|
-
if (
|
|
604
|
+
const m = a[c], { collapsible: v, collapsedSize: b, minSize: y } = p;
|
|
605
|
+
if (v && A(m, y) < 0)
|
|
606
606
|
if (e > 0) {
|
|
607
|
-
const
|
|
608
|
-
A(M, y) < 0 && (e = A(e,
|
|
607
|
+
const g = y - b, P = g / 2, M = m + e;
|
|
608
|
+
A(M, y) < 0 && (e = A(e, P) <= 0 ? 0 : g);
|
|
609
609
|
} else {
|
|
610
|
-
const
|
|
611
|
-
A(M, y) < 0 && (e = A(100 + e,
|
|
610
|
+
const g = y - b, P = 100 - g / 2, M = m - e;
|
|
611
|
+
A(M, y) < 0 && (e = A(100 + e, P) > 0 ? 0 : -g);
|
|
612
612
|
}
|
|
613
613
|
break;
|
|
614
614
|
}
|
|
615
615
|
}
|
|
616
616
|
{
|
|
617
|
-
const
|
|
618
|
-
let p = e < 0 ?
|
|
617
|
+
const c = e < 0 ? 1 : -1;
|
|
618
|
+
let p = e < 0 ? h : u, m = 0;
|
|
619
619
|
for (; ; ) {
|
|
620
|
-
const
|
|
620
|
+
const b = a[p];
|
|
621
621
|
C(
|
|
622
|
-
|
|
622
|
+
b != null,
|
|
623
623
|
`Previous layout not found for panel index ${p}`
|
|
624
624
|
);
|
|
625
|
-
const
|
|
626
|
-
overrideDisabledPanels:
|
|
625
|
+
const g = Z({
|
|
626
|
+
overrideDisabledPanels: f,
|
|
627
627
|
panelConstraints: n[p],
|
|
628
|
-
prevSize:
|
|
628
|
+
prevSize: b,
|
|
629
629
|
size: 100
|
|
630
|
-
}) -
|
|
631
|
-
if (m +=
|
|
630
|
+
}) - b;
|
|
631
|
+
if (m += g, p += c, p < 0 || p >= n.length)
|
|
632
632
|
break;
|
|
633
633
|
}
|
|
634
|
-
const
|
|
635
|
-
e = e < 0 ? 0 -
|
|
634
|
+
const v = Math.min(Math.abs(e), Math.abs(m));
|
|
635
|
+
e = e < 0 ? 0 - v : v;
|
|
636
636
|
}
|
|
637
637
|
{
|
|
638
|
-
let p = e < 0 ?
|
|
638
|
+
let p = e < 0 ? u : h;
|
|
639
639
|
for (; p >= 0 && p < n.length; ) {
|
|
640
|
-
const m = Math.abs(e) - Math.abs(d),
|
|
640
|
+
const m = Math.abs(e) - Math.abs(d), v = a[p];
|
|
641
641
|
C(
|
|
642
|
-
|
|
642
|
+
v != null,
|
|
643
643
|
`Previous layout not found for panel index ${p}`
|
|
644
644
|
);
|
|
645
|
-
const
|
|
646
|
-
overrideDisabledPanels:
|
|
645
|
+
const b = v - m, y = Z({
|
|
646
|
+
overrideDisabledPanels: f,
|
|
647
647
|
panelConstraints: n[p],
|
|
648
|
-
prevSize:
|
|
649
|
-
size:
|
|
648
|
+
prevSize: v,
|
|
649
|
+
size: b
|
|
650
650
|
});
|
|
651
|
-
if (!
|
|
651
|
+
if (!I(v, y) && (d += v - y, l[p] = y, d.toFixed(3).localeCompare(Math.abs(e).toFixed(3), void 0, {
|
|
652
652
|
numeric: !0
|
|
653
653
|
}) >= 0))
|
|
654
654
|
break;
|
|
655
655
|
e < 0 ? p-- : p++;
|
|
656
656
|
}
|
|
657
657
|
}
|
|
658
|
-
if (
|
|
658
|
+
if (Tt(s, l))
|
|
659
659
|
return i;
|
|
660
660
|
{
|
|
661
|
-
const
|
|
661
|
+
const c = e < 0 ? h : u, p = a[c];
|
|
662
662
|
C(
|
|
663
663
|
p != null,
|
|
664
|
-
`Previous layout not found for panel index ${
|
|
664
|
+
`Previous layout not found for panel index ${c}`
|
|
665
665
|
);
|
|
666
|
-
const m = p + d,
|
|
667
|
-
overrideDisabledPanels:
|
|
668
|
-
panelConstraints: n[
|
|
666
|
+
const m = p + d, v = Z({
|
|
667
|
+
overrideDisabledPanels: f,
|
|
668
|
+
panelConstraints: n[c],
|
|
669
669
|
prevSize: p,
|
|
670
670
|
size: m
|
|
671
671
|
});
|
|
672
|
-
if (c
|
|
673
|
-
let
|
|
674
|
-
for (;
|
|
675
|
-
const
|
|
672
|
+
if (l[c] = v, !I(v, m)) {
|
|
673
|
+
let b = m - v, g = e < 0 ? h : u;
|
|
674
|
+
for (; g >= 0 && g < n.length; ) {
|
|
675
|
+
const P = l[g];
|
|
676
676
|
C(
|
|
677
|
-
|
|
678
|
-
`Previous layout not found for panel index ${
|
|
677
|
+
P != null,
|
|
678
|
+
`Previous layout not found for panel index ${g}`
|
|
679
679
|
);
|
|
680
|
-
const M =
|
|
681
|
-
overrideDisabledPanels:
|
|
682
|
-
panelConstraints: n[
|
|
683
|
-
prevSize:
|
|
680
|
+
const M = P + b, w = Z({
|
|
681
|
+
overrideDisabledPanels: f,
|
|
682
|
+
panelConstraints: n[g],
|
|
683
|
+
prevSize: P,
|
|
684
684
|
size: M
|
|
685
685
|
});
|
|
686
|
-
if (
|
|
686
|
+
if (I(P, w) || (b -= w - P, l[g] = w), I(b, 0))
|
|
687
687
|
break;
|
|
688
|
-
e > 0 ?
|
|
688
|
+
e > 0 ? g-- : g++;
|
|
689
689
|
}
|
|
690
690
|
}
|
|
691
691
|
}
|
|
692
|
-
const
|
|
693
|
-
(
|
|
692
|
+
const S = Object.values(l).reduce(
|
|
693
|
+
(c, p) => p + c,
|
|
694
694
|
0
|
|
695
695
|
);
|
|
696
|
-
if (!
|
|
696
|
+
if (!I(S, 100, 0.1))
|
|
697
697
|
return i;
|
|
698
|
-
const
|
|
699
|
-
return
|
|
698
|
+
const z = Object.keys(i);
|
|
699
|
+
return l.reduce((c, p, m) => (c[z[m]] = p, c), {});
|
|
700
700
|
}
|
|
701
701
|
function W(e, t) {
|
|
702
702
|
if (Object.keys(e).length !== Object.keys(t).length)
|
|
@@ -711,171 +711,194 @@ function U({
|
|
|
711
711
|
panelConstraints: t
|
|
712
712
|
}) {
|
|
713
713
|
const n = Object.values(e), o = [...n], i = o.reduce(
|
|
714
|
-
(
|
|
714
|
+
(a, s) => a + s,
|
|
715
715
|
0
|
|
716
716
|
);
|
|
717
717
|
if (o.length !== t.length)
|
|
718
718
|
throw Error(
|
|
719
|
-
`Invalid ${t.length} panel layout: ${o.map((
|
|
719
|
+
`Invalid ${t.length} panel layout: ${o.map((a) => `${a}%`).join(", ")}`
|
|
720
720
|
);
|
|
721
|
-
if (!
|
|
722
|
-
for (let
|
|
723
|
-
const
|
|
724
|
-
C(
|
|
725
|
-
const
|
|
726
|
-
o[
|
|
721
|
+
if (!I(i, 100) && o.length > 0)
|
|
722
|
+
for (let a = 0; a < t.length; a++) {
|
|
723
|
+
const s = o[a];
|
|
724
|
+
C(s != null, `No layout data found for index ${a}`);
|
|
725
|
+
const l = 100 / i * s;
|
|
726
|
+
o[a] = l;
|
|
727
727
|
}
|
|
728
|
-
let
|
|
729
|
-
for (let
|
|
730
|
-
const
|
|
731
|
-
C(
|
|
732
|
-
const
|
|
733
|
-
C(
|
|
734
|
-
const
|
|
728
|
+
let r = 0;
|
|
729
|
+
for (let a = 0; a < t.length; a++) {
|
|
730
|
+
const s = n[a];
|
|
731
|
+
C(s != null, `No layout data found for index ${a}`);
|
|
732
|
+
const l = o[a];
|
|
733
|
+
C(l != null, `No layout data found for index ${a}`);
|
|
734
|
+
const u = Z({
|
|
735
735
|
overrideDisabledPanels: !0,
|
|
736
|
-
panelConstraints: t[
|
|
737
|
-
prevSize:
|
|
738
|
-
size:
|
|
736
|
+
panelConstraints: t[a],
|
|
737
|
+
prevSize: s,
|
|
738
|
+
size: l
|
|
739
739
|
});
|
|
740
|
-
|
|
740
|
+
l != u && (r += l - u, o[a] = u);
|
|
741
741
|
}
|
|
742
|
-
if (!
|
|
743
|
-
for (let
|
|
744
|
-
const
|
|
745
|
-
C(
|
|
746
|
-
const
|
|
742
|
+
if (!I(r, 0))
|
|
743
|
+
for (let a = 0; a < t.length; a++) {
|
|
744
|
+
const s = o[a];
|
|
745
|
+
C(s != null, `No layout data found for index ${a}`);
|
|
746
|
+
const l = s + r, u = Z({
|
|
747
747
|
overrideDisabledPanels: !0,
|
|
748
|
-
panelConstraints: t[
|
|
749
|
-
prevSize:
|
|
750
|
-
size:
|
|
748
|
+
panelConstraints: t[a],
|
|
749
|
+
prevSize: s,
|
|
750
|
+
size: l
|
|
751
751
|
});
|
|
752
|
-
if (
|
|
752
|
+
if (s !== u && (r -= u - s, o[a] = u, I(r, 0)))
|
|
753
753
|
break;
|
|
754
754
|
}
|
|
755
|
-
const
|
|
756
|
-
return o.reduce((
|
|
755
|
+
const f = Object.keys(e);
|
|
756
|
+
return o.reduce((a, s, l) => (a[f[l]] = s, a), {});
|
|
757
757
|
}
|
|
758
758
|
function tt({
|
|
759
759
|
groupId: e,
|
|
760
760
|
panelId: t
|
|
761
761
|
}) {
|
|
762
762
|
const n = () => {
|
|
763
|
-
const
|
|
763
|
+
const s = X();
|
|
764
764
|
for (const [
|
|
765
|
-
|
|
765
|
+
l,
|
|
766
766
|
{
|
|
767
|
-
defaultLayoutDeferred:
|
|
768
|
-
derivedPanelConstraints:
|
|
769
|
-
layout:
|
|
770
|
-
groupSize:
|
|
771
|
-
separatorToPanels:
|
|
767
|
+
defaultLayoutDeferred: u,
|
|
768
|
+
derivedPanelConstraints: h,
|
|
769
|
+
layout: d,
|
|
770
|
+
groupSize: S,
|
|
771
|
+
separatorToPanels: z
|
|
772
772
|
}
|
|
773
|
-
] of
|
|
774
|
-
if (
|
|
773
|
+
] of s)
|
|
774
|
+
if (l.id === e)
|
|
775
775
|
return {
|
|
776
|
-
defaultLayoutDeferred:
|
|
777
|
-
derivedPanelConstraints:
|
|
778
|
-
group:
|
|
779
|
-
groupSize:
|
|
780
|
-
layout:
|
|
781
|
-
separatorToPanels:
|
|
776
|
+
defaultLayoutDeferred: u,
|
|
777
|
+
derivedPanelConstraints: h,
|
|
778
|
+
group: l,
|
|
779
|
+
groupSize: S,
|
|
780
|
+
layout: d,
|
|
781
|
+
separatorToPanels: z
|
|
782
782
|
};
|
|
783
783
|
throw Error(`Group ${e} not found`);
|
|
784
784
|
}, o = () => {
|
|
785
|
-
const
|
|
786
|
-
(
|
|
785
|
+
const s = n().derivedPanelConstraints.find(
|
|
786
|
+
(l) => l.panelId === t
|
|
787
787
|
);
|
|
788
|
-
if (
|
|
789
|
-
return
|
|
788
|
+
if (s !== void 0)
|
|
789
|
+
return s;
|
|
790
790
|
throw Error(`Panel constraints not found for Panel ${t}`);
|
|
791
791
|
}, i = () => {
|
|
792
|
-
const
|
|
793
|
-
if (
|
|
794
|
-
return
|
|
792
|
+
const s = n().group.panels.find((l) => l.id === t);
|
|
793
|
+
if (s !== void 0)
|
|
794
|
+
return s;
|
|
795
795
|
throw Error(`Layout not found for Panel ${t}`);
|
|
796
|
-
},
|
|
797
|
-
const
|
|
798
|
-
if (
|
|
799
|
-
return
|
|
796
|
+
}, r = () => {
|
|
797
|
+
const s = n().layout[t];
|
|
798
|
+
if (s !== void 0)
|
|
799
|
+
return s;
|
|
800
800
|
throw Error(`Layout not found for Panel ${t}`);
|
|
801
|
-
},
|
|
802
|
-
|
|
803
|
-
|
|
801
|
+
}, f = ({
|
|
802
|
+
nextSize: s,
|
|
803
|
+
panels: l,
|
|
804
|
+
prevLayout: u,
|
|
805
|
+
derivedPanelConstraints: h
|
|
806
|
+
}) => {
|
|
807
|
+
const d = r(), S = l.findIndex((m) => m.id === t), z = S === 0, c = S === l.length - 1;
|
|
808
|
+
if (c && s < d && (z || l.slice(0, S).every((m, v) => {
|
|
809
|
+
const b = h[v];
|
|
810
|
+
return b?.collapsible && I(b.collapsedSize, u[b.panelId]);
|
|
811
|
+
}))) {
|
|
812
|
+
const m = l.slice(0, S).reduce((v, b) => v + u[b.id], 0);
|
|
813
|
+
return {
|
|
814
|
+
...u,
|
|
815
|
+
[t]: O(100 - m)
|
|
816
|
+
};
|
|
817
|
+
}
|
|
818
|
+
return le({
|
|
819
|
+
delta: c ? d - s : s - d,
|
|
820
|
+
initialLayout: u,
|
|
821
|
+
panelConstraints: h,
|
|
822
|
+
pivotIndices: c ? [S - 1, S] : [S, S + 1],
|
|
823
|
+
prevLayout: u,
|
|
824
|
+
trigger: "imperative-api"
|
|
825
|
+
});
|
|
826
|
+
}, a = (s) => {
|
|
827
|
+
const l = r();
|
|
828
|
+
if (s === l)
|
|
804
829
|
return;
|
|
805
830
|
const {
|
|
806
|
-
defaultLayoutDeferred:
|
|
807
|
-
derivedPanelConstraints:
|
|
808
|
-
group:
|
|
809
|
-
groupSize:
|
|
810
|
-
layout:
|
|
811
|
-
separatorToPanels:
|
|
812
|
-
} = n(),
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
layout: m,
|
|
821
|
-
panelConstraints: f
|
|
831
|
+
defaultLayoutDeferred: u,
|
|
832
|
+
derivedPanelConstraints: h,
|
|
833
|
+
group: d,
|
|
834
|
+
groupSize: S,
|
|
835
|
+
layout: z,
|
|
836
|
+
separatorToPanels: c
|
|
837
|
+
} = n(), p = f({
|
|
838
|
+
nextSize: s,
|
|
839
|
+
panels: d.panels,
|
|
840
|
+
prevLayout: z,
|
|
841
|
+
derivedPanelConstraints: h
|
|
842
|
+
}), m = U({
|
|
843
|
+
layout: p,
|
|
844
|
+
panelConstraints: h
|
|
822
845
|
});
|
|
823
|
-
W(
|
|
824
|
-
defaultLayoutDeferred:
|
|
825
|
-
derivedPanelConstraints:
|
|
826
|
-
groupSize:
|
|
827
|
-
layout:
|
|
828
|
-
separatorToPanels:
|
|
846
|
+
W(z, m) || $(d, {
|
|
847
|
+
defaultLayoutDeferred: u,
|
|
848
|
+
derivedPanelConstraints: h,
|
|
849
|
+
groupSize: S,
|
|
850
|
+
layout: m,
|
|
851
|
+
separatorToPanels: c
|
|
829
852
|
});
|
|
830
853
|
};
|
|
831
854
|
return {
|
|
832
855
|
collapse: () => {
|
|
833
|
-
const { collapsible:
|
|
834
|
-
|
|
856
|
+
const { collapsible: s, collapsedSize: l } = o(), { mutableValues: u } = i(), h = r();
|
|
857
|
+
s && h !== l && (u.expandToSize = h, a(l));
|
|
835
858
|
},
|
|
836
859
|
expand: () => {
|
|
837
|
-
const { collapsible:
|
|
838
|
-
if (
|
|
839
|
-
let
|
|
840
|
-
|
|
860
|
+
const { collapsible: s, collapsedSize: l, minSize: u } = o(), { mutableValues: h } = i(), d = r();
|
|
861
|
+
if (s && d === l) {
|
|
862
|
+
let S = h.expandToSize ?? u;
|
|
863
|
+
S === 0 && (S = 1), a(S);
|
|
841
864
|
}
|
|
842
865
|
},
|
|
843
866
|
getSize: () => {
|
|
844
|
-
const { group:
|
|
867
|
+
const { group: s } = n(), l = r(), { element: u } = i(), h = s.orientation === "horizontal" ? u.offsetWidth : u.offsetHeight;
|
|
845
868
|
return {
|
|
846
|
-
asPercentage:
|
|
847
|
-
inPixels:
|
|
869
|
+
asPercentage: l,
|
|
870
|
+
inPixels: h
|
|
848
871
|
};
|
|
849
872
|
},
|
|
850
873
|
isCollapsed: () => {
|
|
851
|
-
const { collapsible:
|
|
852
|
-
return
|
|
874
|
+
const { collapsible: s, collapsedSize: l } = o(), u = r();
|
|
875
|
+
return s && I(l, u);
|
|
853
876
|
},
|
|
854
|
-
resize: (
|
|
855
|
-
const { group:
|
|
856
|
-
groupSize:
|
|
857
|
-
panelElement:
|
|
858
|
-
styleProp:
|
|
859
|
-
}),
|
|
860
|
-
|
|
877
|
+
resize: (s) => {
|
|
878
|
+
const { group: l } = n(), { element: u } = i(), h = ne({ group: l }), d = ie({
|
|
879
|
+
groupSize: h,
|
|
880
|
+
panelElement: u,
|
|
881
|
+
styleProp: s
|
|
882
|
+
}), S = O(d / h * 100);
|
|
883
|
+
a(S);
|
|
861
884
|
}
|
|
862
885
|
};
|
|
863
886
|
}
|
|
864
|
-
function
|
|
887
|
+
function Te(e) {
|
|
865
888
|
if (e.defaultPrevented)
|
|
866
889
|
return;
|
|
867
890
|
const t = X();
|
|
868
891
|
xe(e, t).forEach((o) => {
|
|
869
892
|
if (o.separator && !o.separator.disableDoubleClick) {
|
|
870
893
|
const i = o.panels.find(
|
|
871
|
-
(
|
|
894
|
+
(r) => r.panelConstraints.defaultSize !== void 0
|
|
872
895
|
);
|
|
873
896
|
if (i) {
|
|
874
|
-
const
|
|
897
|
+
const r = i.panelConstraints.defaultSize, f = tt({
|
|
875
898
|
groupId: o.group.id,
|
|
876
899
|
panelId: i.id
|
|
877
900
|
});
|
|
878
|
-
|
|
901
|
+
f && r !== void 0 && (f.resize(r), e.preventDefault());
|
|
879
902
|
}
|
|
880
903
|
}
|
|
881
904
|
});
|
|
@@ -908,47 +931,47 @@ function nt({
|
|
|
908
931
|
const {
|
|
909
932
|
defaultLayoutDeferred: o,
|
|
910
933
|
derivedPanelConstraints: i,
|
|
911
|
-
group:
|
|
912
|
-
groupSize:
|
|
913
|
-
layout:
|
|
914
|
-
separatorToPanels:
|
|
915
|
-
} = t(),
|
|
934
|
+
group: r,
|
|
935
|
+
groupSize: f,
|
|
936
|
+
layout: a,
|
|
937
|
+
separatorToPanels: s
|
|
938
|
+
} = t(), l = U({
|
|
916
939
|
layout: n,
|
|
917
940
|
panelConstraints: i
|
|
918
941
|
});
|
|
919
|
-
return o ?
|
|
942
|
+
return o ? a : (W(a, l) || $(r, {
|
|
920
943
|
defaultLayoutDeferred: o,
|
|
921
944
|
derivedPanelConstraints: i,
|
|
922
|
-
groupSize:
|
|
923
|
-
layout:
|
|
924
|
-
separatorToPanels:
|
|
925
|
-
}),
|
|
945
|
+
groupSize: f,
|
|
946
|
+
layout: l,
|
|
947
|
+
separatorToPanels: s
|
|
948
|
+
}), l);
|
|
926
949
|
}
|
|
927
950
|
};
|
|
928
951
|
}
|
|
929
952
|
function B(e, t) {
|
|
930
953
|
const n = pe(e), o = H(n.id, !0), i = n.separators.find(
|
|
931
|
-
(
|
|
954
|
+
(h) => h.element === e
|
|
932
955
|
);
|
|
933
956
|
C(i, "Matching separator not found");
|
|
934
|
-
const
|
|
935
|
-
C(
|
|
936
|
-
const
|
|
957
|
+
const r = o.separatorToPanels.get(i);
|
|
958
|
+
C(r, "Matching panels not found");
|
|
959
|
+
const f = r.map((h) => n.panels.indexOf(h)), s = nt({ groupId: n.id }).getLayout(), l = le({
|
|
937
960
|
delta: t,
|
|
938
|
-
initialLayout:
|
|
961
|
+
initialLayout: s,
|
|
939
962
|
panelConstraints: o.derivedPanelConstraints,
|
|
940
|
-
pivotIndices:
|
|
941
|
-
prevLayout:
|
|
963
|
+
pivotIndices: f,
|
|
964
|
+
prevLayout: s,
|
|
942
965
|
trigger: "keyboard"
|
|
943
|
-
}),
|
|
944
|
-
layout:
|
|
966
|
+
}), u = U({
|
|
967
|
+
layout: l,
|
|
945
968
|
panelConstraints: o.derivedPanelConstraints
|
|
946
969
|
});
|
|
947
|
-
W(
|
|
970
|
+
W(s, u) || $(n, {
|
|
948
971
|
defaultLayoutDeferred: o.defaultLayoutDeferred,
|
|
949
972
|
derivedPanelConstraints: o.derivedPanelConstraints,
|
|
950
973
|
groupSize: o.groupSize,
|
|
951
|
-
layout:
|
|
974
|
+
layout: u,
|
|
952
975
|
separatorToPanels: o.separatorToPanels
|
|
953
976
|
});
|
|
954
977
|
}
|
|
@@ -980,31 +1003,31 @@ function Ge(e) {
|
|
|
980
1003
|
}
|
|
981
1004
|
case "Enter": {
|
|
982
1005
|
e.preventDefault();
|
|
983
|
-
const o = pe(t), i = H(o.id, !0), { derivedPanelConstraints:
|
|
1006
|
+
const o = pe(t), i = H(o.id, !0), { derivedPanelConstraints: r, layout: f, separatorToPanels: a } = i, s = o.separators.find(
|
|
984
1007
|
(d) => d.element === t
|
|
985
1008
|
);
|
|
986
|
-
C(
|
|
987
|
-
const
|
|
988
|
-
C(
|
|
989
|
-
const
|
|
990
|
-
(d) => d.panelId ===
|
|
1009
|
+
C(s, "Matching separator not found");
|
|
1010
|
+
const l = a.get(s);
|
|
1011
|
+
C(l, "Matching panels not found");
|
|
1012
|
+
const u = l[0], h = r.find(
|
|
1013
|
+
(d) => d.panelId === u.id
|
|
991
1014
|
);
|
|
992
|
-
if (C(
|
|
993
|
-
const d =
|
|
994
|
-
B(t,
|
|
1015
|
+
if (C(h, "Panel metadata not found"), h.collapsible) {
|
|
1016
|
+
const d = f[u.id], S = h.collapsedSize === d ? o.mutableState.expandedPanelSizes[u.id] ?? h.minSize : h.collapsedSize;
|
|
1017
|
+
B(t, S - d);
|
|
995
1018
|
}
|
|
996
1019
|
break;
|
|
997
1020
|
}
|
|
998
1021
|
case "F6": {
|
|
999
1022
|
e.preventDefault();
|
|
1000
1023
|
const i = pe(t).separators.map(
|
|
1001
|
-
(
|
|
1002
|
-
),
|
|
1003
|
-
(
|
|
1024
|
+
(s) => s.element
|
|
1025
|
+
), r = Array.from(i).findIndex(
|
|
1026
|
+
(s) => s === e.currentTarget
|
|
1004
1027
|
);
|
|
1005
|
-
C(
|
|
1006
|
-
const
|
|
1007
|
-
i[
|
|
1028
|
+
C(r !== null, "Index not found");
|
|
1029
|
+
const f = e.shiftKey ? r > 0 ? r - 1 : i.length - 1 : r + 1 < i.length ? r + 1 : 0;
|
|
1030
|
+
i[f].focus({
|
|
1008
1031
|
preventScroll: !0
|
|
1009
1032
|
});
|
|
1010
1033
|
break;
|
|
@@ -1019,23 +1042,23 @@ let ee = {
|
|
|
1019
1042
|
cursorFlags: 0,
|
|
1020
1043
|
state: "inactive"
|
|
1021
1044
|
};
|
|
1022
|
-
const
|
|
1045
|
+
const Pe = new Ze();
|
|
1023
1046
|
function K() {
|
|
1024
1047
|
return ee;
|
|
1025
1048
|
}
|
|
1026
1049
|
function Gt(e) {
|
|
1027
|
-
return
|
|
1050
|
+
return Pe.addListener("change", e);
|
|
1028
1051
|
}
|
|
1029
1052
|
function At(e) {
|
|
1030
1053
|
const t = ee, n = { ...ee };
|
|
1031
|
-
n.cursorFlags = e, ee = n,
|
|
1054
|
+
n.cursorFlags = e, ee = n, Pe.emit("change", {
|
|
1032
1055
|
prev: t,
|
|
1033
1056
|
next: n
|
|
1034
1057
|
});
|
|
1035
1058
|
}
|
|
1036
1059
|
function te(e) {
|
|
1037
1060
|
const t = ee;
|
|
1038
|
-
ee = e,
|
|
1061
|
+
ee = e, Pe.emit("change", {
|
|
1039
1062
|
prev: t,
|
|
1040
1063
|
next: e
|
|
1041
1064
|
});
|
|
@@ -1047,12 +1070,14 @@ function Ae(e) {
|
|
|
1047
1070
|
return;
|
|
1048
1071
|
const t = X(), n = xe(e, t), o = /* @__PURE__ */ new Map();
|
|
1049
1072
|
let i = !1;
|
|
1050
|
-
n.forEach((
|
|
1051
|
-
|
|
1073
|
+
n.forEach((r) => {
|
|
1074
|
+
r.separator && (i || (i = !0, r.separator.element.focus({
|
|
1075
|
+
// @ts-expect-error https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus#browser_compatibility
|
|
1076
|
+
focusVisible: !1,
|
|
1052
1077
|
preventScroll: !0
|
|
1053
1078
|
})));
|
|
1054
|
-
const
|
|
1055
|
-
|
|
1079
|
+
const f = t.get(r.group);
|
|
1080
|
+
f && o.set(r.group, f.layout);
|
|
1056
1081
|
}), te({
|
|
1057
1082
|
cursorFlags: 0,
|
|
1058
1083
|
hitRegions: n,
|
|
@@ -1076,9 +1101,9 @@ function Nt({
|
|
|
1076
1101
|
switch (n) {
|
|
1077
1102
|
case "active":
|
|
1078
1103
|
case "hover":
|
|
1079
|
-
t.forEach((
|
|
1080
|
-
if (!
|
|
1081
|
-
switch (
|
|
1104
|
+
t.forEach((r) => {
|
|
1105
|
+
if (!r.mutableState.disableCursor)
|
|
1106
|
+
switch (r.orientation) {
|
|
1082
1107
|
case "horizontal": {
|
|
1083
1108
|
o++;
|
|
1084
1109
|
break;
|
|
@@ -1094,14 +1119,14 @@ function Nt({
|
|
|
1094
1119
|
switch (n) {
|
|
1095
1120
|
case "active": {
|
|
1096
1121
|
if (e && _e()) {
|
|
1097
|
-
const
|
|
1098
|
-
if (s)
|
|
1099
|
-
return r ? "se-resize" : a ? "ne-resize" : "e-resize";
|
|
1100
|
-
if (l)
|
|
1101
|
-
return r ? "sw-resize" : a ? "nw-resize" : "w-resize";
|
|
1122
|
+
const r = (e & ot) !== 0, f = (e & it) !== 0, a = (e & rt) !== 0, s = (e & st) !== 0;
|
|
1102
1123
|
if (r)
|
|
1103
|
-
return "s-resize";
|
|
1124
|
+
return a ? "se-resize" : s ? "ne-resize" : "e-resize";
|
|
1125
|
+
if (f)
|
|
1126
|
+
return a ? "sw-resize" : s ? "nw-resize" : "w-resize";
|
|
1104
1127
|
if (a)
|
|
1128
|
+
return "s-resize";
|
|
1129
|
+
if (s)
|
|
1105
1130
|
return "n-resize";
|
|
1106
1131
|
}
|
|
1107
1132
|
break;
|
|
@@ -1111,23 +1136,26 @@ function Nt({
|
|
|
1111
1136
|
}
|
|
1112
1137
|
}
|
|
1113
1138
|
const $e = /* @__PURE__ */ new WeakMap();
|
|
1114
|
-
function
|
|
1139
|
+
function we(e) {
|
|
1115
1140
|
if (e.defaultView === null || e.defaultView === void 0)
|
|
1116
1141
|
return;
|
|
1117
1142
|
let { prevStyle: t, styleSheet: n } = $e.get(e) ?? {};
|
|
1118
|
-
n === void 0 && (n = new e.defaultView.CSSStyleSheet(), e.adoptedStyleSheets && e.adoptedStyleSheets.push(n)
|
|
1143
|
+
n === void 0 && (n = new e.defaultView.CSSStyleSheet(), e.adoptedStyleSheets && (Object.isExtensible(e.adoptedStyleSheets) ? e.adoptedStyleSheets.push(n) : e.adoptedStyleSheets = [
|
|
1144
|
+
...e.adoptedStyleSheets,
|
|
1145
|
+
n
|
|
1146
|
+
]));
|
|
1119
1147
|
const o = K();
|
|
1120
1148
|
switch (o.state) {
|
|
1121
1149
|
case "active":
|
|
1122
1150
|
case "hover": {
|
|
1123
1151
|
const i = Nt({
|
|
1124
1152
|
cursorFlags: o.cursorFlags,
|
|
1125
|
-
groups: o.hitRegions.map((
|
|
1153
|
+
groups: o.hitRegions.map((f) => f.group),
|
|
1126
1154
|
state: o.state
|
|
1127
|
-
}),
|
|
1128
|
-
if (t ===
|
|
1155
|
+
}), r = `*, *:hover {cursor: ${i} !important; }`;
|
|
1156
|
+
if (t === r)
|
|
1129
1157
|
return;
|
|
1130
|
-
t =
|
|
1158
|
+
t = r, i ? n.cssRules.length === 0 ? n.insertRule(r) : n.replaceSync(r) : n.cssRules.length === 1 && n.deleteRule(0);
|
|
1131
1159
|
break;
|
|
1132
1160
|
}
|
|
1133
1161
|
case "inactive": {
|
|
@@ -1146,57 +1174,57 @@ function at({
|
|
|
1146
1174
|
hitRegions: n,
|
|
1147
1175
|
initialLayoutMap: o,
|
|
1148
1176
|
mountedGroups: i,
|
|
1149
|
-
pointerDownAtPoint:
|
|
1150
|
-
prevCursorFlags:
|
|
1177
|
+
pointerDownAtPoint: r,
|
|
1178
|
+
prevCursorFlags: f
|
|
1151
1179
|
}) {
|
|
1152
|
-
let
|
|
1153
|
-
n.forEach((
|
|
1154
|
-
const { group:
|
|
1155
|
-
let
|
|
1156
|
-
|
|
1157
|
-
const p = o.get(
|
|
1180
|
+
let a = 0;
|
|
1181
|
+
n.forEach((l) => {
|
|
1182
|
+
const { group: u, groupSize: h } = l, { orientation: d, panels: S } = u, { disableCursor: z } = u.mutableState;
|
|
1183
|
+
let c = 0;
|
|
1184
|
+
r ? d === "horizontal" ? c = (t.clientX - r.x) / h * 100 : c = (t.clientY - r.y) / h * 100 : d === "horizontal" ? c = t.clientX < 0 ? -100 : 100 : c = t.clientY < 0 ? -100 : 100;
|
|
1185
|
+
const p = o.get(u), m = i.get(u);
|
|
1158
1186
|
if (!p || !m)
|
|
1159
1187
|
return;
|
|
1160
1188
|
const {
|
|
1161
|
-
defaultLayoutDeferred:
|
|
1162
|
-
derivedPanelConstraints:
|
|
1189
|
+
defaultLayoutDeferred: v,
|
|
1190
|
+
derivedPanelConstraints: b,
|
|
1163
1191
|
groupSize: y,
|
|
1164
|
-
layout:
|
|
1165
|
-
separatorToPanels:
|
|
1192
|
+
layout: g,
|
|
1193
|
+
separatorToPanels: P
|
|
1166
1194
|
} = m;
|
|
1167
|
-
if (
|
|
1195
|
+
if (b && g && P) {
|
|
1168
1196
|
const M = le({
|
|
1169
|
-
delta:
|
|
1197
|
+
delta: c,
|
|
1170
1198
|
initialLayout: p,
|
|
1171
|
-
panelConstraints:
|
|
1172
|
-
pivotIndices:
|
|
1173
|
-
prevLayout:
|
|
1199
|
+
panelConstraints: b,
|
|
1200
|
+
pivotIndices: l.panels.map((w) => S.indexOf(w)),
|
|
1201
|
+
prevLayout: g,
|
|
1174
1202
|
trigger: "mouse-or-touch"
|
|
1175
1203
|
});
|
|
1176
|
-
if (W(M,
|
|
1177
|
-
if (
|
|
1204
|
+
if (W(M, g)) {
|
|
1205
|
+
if (c !== 0 && !z)
|
|
1178
1206
|
switch (d) {
|
|
1179
1207
|
case "horizontal": {
|
|
1180
|
-
|
|
1208
|
+
a |= c < 0 ? ot : it;
|
|
1181
1209
|
break;
|
|
1182
1210
|
}
|
|
1183
1211
|
case "vertical": {
|
|
1184
|
-
|
|
1212
|
+
a |= c < 0 ? rt : st;
|
|
1185
1213
|
break;
|
|
1186
1214
|
}
|
|
1187
1215
|
}
|
|
1188
1216
|
} else
|
|
1189
|
-
$(
|
|
1190
|
-
defaultLayoutDeferred:
|
|
1191
|
-
derivedPanelConstraints:
|
|
1217
|
+
$(l.group, {
|
|
1218
|
+
defaultLayoutDeferred: v,
|
|
1219
|
+
derivedPanelConstraints: b,
|
|
1192
1220
|
groupSize: y,
|
|
1193
1221
|
layout: M,
|
|
1194
|
-
separatorToPanels:
|
|
1222
|
+
separatorToPanels: P
|
|
1195
1223
|
});
|
|
1196
1224
|
}
|
|
1197
1225
|
});
|
|
1198
|
-
let
|
|
1199
|
-
t.movementX === 0 ?
|
|
1226
|
+
let s = 0;
|
|
1227
|
+
t.movementX === 0 ? s |= f & Fe : s |= a & Fe, t.movementY === 0 ? s |= f & Ne : s |= a & Ne, At(s), we(e);
|
|
1200
1228
|
}
|
|
1201
1229
|
function je(e) {
|
|
1202
1230
|
const t = X(), n = K();
|
|
@@ -1256,7 +1284,7 @@ function He(e) {
|
|
|
1256
1284
|
cursorFlags: 0,
|
|
1257
1285
|
hitRegions: o,
|
|
1258
1286
|
state: "hover"
|
|
1259
|
-
}),
|
|
1287
|
+
}), we(e.currentTarget);
|
|
1260
1288
|
break;
|
|
1261
1289
|
}
|
|
1262
1290
|
}
|
|
@@ -1282,7 +1310,7 @@ function Be(e) {
|
|
|
1282
1310
|
te({
|
|
1283
1311
|
cursorFlags: 0,
|
|
1284
1312
|
state: "inactive"
|
|
1285
|
-
}), t.hitRegions.length > 0 && (
|
|
1313
|
+
}), t.hitRegions.length > 0 && (we(e.currentTarget), t.hitRegions.forEach((n) => {
|
|
1286
1314
|
const o = H(n.group.id, !0);
|
|
1287
1315
|
$(n.group, o);
|
|
1288
1316
|
}), e.preventDefault());
|
|
@@ -1291,32 +1319,32 @@ function Be(e) {
|
|
|
1291
1319
|
function We(e) {
|
|
1292
1320
|
let t = 0, n = 0;
|
|
1293
1321
|
const o = {};
|
|
1294
|
-
for (const
|
|
1295
|
-
if (
|
|
1322
|
+
for (const r of e)
|
|
1323
|
+
if (r.defaultSize !== void 0) {
|
|
1296
1324
|
t++;
|
|
1297
|
-
const
|
|
1298
|
-
n +=
|
|
1325
|
+
const f = O(r.defaultSize);
|
|
1326
|
+
n += f, o[r.panelId] = f;
|
|
1299
1327
|
} else
|
|
1300
|
-
o[
|
|
1328
|
+
o[r.panelId] = void 0;
|
|
1301
1329
|
const i = e.length - t;
|
|
1302
1330
|
if (i !== 0) {
|
|
1303
|
-
const
|
|
1304
|
-
for (const
|
|
1305
|
-
|
|
1331
|
+
const r = O((100 - n) / i);
|
|
1332
|
+
for (const f of e)
|
|
1333
|
+
f.defaultSize === void 0 && (o[f.panelId] = r);
|
|
1306
1334
|
}
|
|
1307
1335
|
return o;
|
|
1308
1336
|
}
|
|
1309
1337
|
function _t(e, t, n) {
|
|
1310
1338
|
if (!n[0])
|
|
1311
1339
|
return;
|
|
1312
|
-
const i = e.panels.find((
|
|
1340
|
+
const i = e.panels.find((l) => l.element === t);
|
|
1313
1341
|
if (!i || !i.onResize)
|
|
1314
1342
|
return;
|
|
1315
|
-
const
|
|
1316
|
-
asPercentage:
|
|
1317
|
-
inPixels:
|
|
1343
|
+
const r = ne({ group: e }), f = e.orientation === "horizontal" ? i.element.offsetWidth : i.element.offsetHeight, a = i.mutableValues.prevSize, s = {
|
|
1344
|
+
asPercentage: O(f / r * 100),
|
|
1345
|
+
inPixels: f
|
|
1318
1346
|
};
|
|
1319
|
-
i.mutableValues.prevSize =
|
|
1347
|
+
i.mutableValues.prevSize = s, i.onResize(s, i.id, a);
|
|
1320
1348
|
}
|
|
1321
1349
|
function $t(e, t) {
|
|
1322
1350
|
if (Object.keys(e).length !== Object.keys(t).length)
|
|
@@ -1334,46 +1362,46 @@ function jt({
|
|
|
1334
1362
|
}) {
|
|
1335
1363
|
if (n <= 0 || t <= 0 || n === t)
|
|
1336
1364
|
return o;
|
|
1337
|
-
let i = 0,
|
|
1338
|
-
const
|
|
1339
|
-
for (const
|
|
1340
|
-
const d = o[
|
|
1341
|
-
switch (
|
|
1365
|
+
let i = 0, r = 0, f = !1;
|
|
1366
|
+
const a = /* @__PURE__ */ new Map(), s = [];
|
|
1367
|
+
for (const h of e.panels) {
|
|
1368
|
+
const d = o[h.id] ?? 0;
|
|
1369
|
+
switch (h.panelConstraints.groupResizeBehavior) {
|
|
1342
1370
|
case "preserve-pixel-size": {
|
|
1343
|
-
|
|
1344
|
-
const
|
|
1345
|
-
|
|
1371
|
+
f = !0;
|
|
1372
|
+
const S = d / 100 * n, z = O(
|
|
1373
|
+
S / t * 100
|
|
1346
1374
|
);
|
|
1347
|
-
|
|
1375
|
+
a.set(h.id, z), i += z;
|
|
1348
1376
|
break;
|
|
1349
1377
|
}
|
|
1350
1378
|
case "preserve-relative-size":
|
|
1351
1379
|
default: {
|
|
1352
|
-
|
|
1380
|
+
s.push(h.id), r += d;
|
|
1353
1381
|
break;
|
|
1354
1382
|
}
|
|
1355
1383
|
}
|
|
1356
1384
|
}
|
|
1357
|
-
if (!
|
|
1385
|
+
if (!f || s.length === 0)
|
|
1358
1386
|
return o;
|
|
1359
|
-
const
|
|
1360
|
-
if (
|
|
1361
|
-
|
|
1362
|
-
}),
|
|
1363
|
-
for (const
|
|
1364
|
-
const d = o[
|
|
1365
|
-
|
|
1366
|
-
d /
|
|
1387
|
+
const l = 100 - i, u = { ...o };
|
|
1388
|
+
if (a.forEach((h, d) => {
|
|
1389
|
+
u[d] = h;
|
|
1390
|
+
}), r > 0)
|
|
1391
|
+
for (const h of s) {
|
|
1392
|
+
const d = o[h] ?? 0;
|
|
1393
|
+
u[h] = O(
|
|
1394
|
+
d / r * l
|
|
1367
1395
|
);
|
|
1368
1396
|
}
|
|
1369
1397
|
else {
|
|
1370
|
-
const
|
|
1371
|
-
|
|
1398
|
+
const h = O(
|
|
1399
|
+
l / s.length
|
|
1372
1400
|
);
|
|
1373
|
-
for (const d of
|
|
1374
|
-
|
|
1401
|
+
for (const d of s)
|
|
1402
|
+
u[d] = h;
|
|
1375
1403
|
}
|
|
1376
|
-
return
|
|
1404
|
+
return u;
|
|
1377
1405
|
}
|
|
1378
1406
|
function Ht(e, t) {
|
|
1379
1407
|
const n = e.map((i) => i.id), o = Object.keys(t);
|
|
@@ -1391,75 +1419,75 @@ function Vt(e) {
|
|
|
1391
1419
|
e.element.ownerDocument.defaultView,
|
|
1392
1420
|
"Cannot register an unmounted Group"
|
|
1393
1421
|
);
|
|
1394
|
-
const n = e.element.ownerDocument.defaultView.ResizeObserver, o = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set(),
|
|
1395
|
-
for (const p of
|
|
1396
|
-
const { borderBoxSize: m, target:
|
|
1397
|
-
if (
|
|
1422
|
+
const n = e.element.ownerDocument.defaultView.ResizeObserver, o = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set(), r = new n((c) => {
|
|
1423
|
+
for (const p of c) {
|
|
1424
|
+
const { borderBoxSize: m, target: v } = p;
|
|
1425
|
+
if (v === e.element) {
|
|
1398
1426
|
if (t) {
|
|
1399
|
-
const
|
|
1400
|
-
if (
|
|
1427
|
+
const b = ne({ group: e });
|
|
1428
|
+
if (b === 0)
|
|
1401
1429
|
return;
|
|
1402
1430
|
const y = H(e.id);
|
|
1403
1431
|
if (!y)
|
|
1404
1432
|
return;
|
|
1405
|
-
const
|
|
1433
|
+
const g = ve(e), P = y.defaultLayoutDeferred ? We(g) : y.layout, M = jt({
|
|
1406
1434
|
group: e,
|
|
1407
|
-
nextGroupSize:
|
|
1435
|
+
nextGroupSize: b,
|
|
1408
1436
|
prevGroupSize: y.groupSize,
|
|
1409
|
-
prevLayout:
|
|
1410
|
-
}),
|
|
1437
|
+
prevLayout: P
|
|
1438
|
+
}), w = U({
|
|
1411
1439
|
layout: M,
|
|
1412
|
-
panelConstraints:
|
|
1440
|
+
panelConstraints: g
|
|
1413
1441
|
});
|
|
1414
|
-
if (!y.defaultLayoutDeferred && W(y.layout,
|
|
1442
|
+
if (!y.defaultLayoutDeferred && W(y.layout, w) && $t(
|
|
1415
1443
|
y.derivedPanelConstraints,
|
|
1416
|
-
|
|
1417
|
-
) && y.groupSize ===
|
|
1444
|
+
g
|
|
1445
|
+
) && y.groupSize === b)
|
|
1418
1446
|
return;
|
|
1419
1447
|
$(e, {
|
|
1420
1448
|
defaultLayoutDeferred: !1,
|
|
1421
|
-
derivedPanelConstraints:
|
|
1422
|
-
groupSize:
|
|
1423
|
-
layout:
|
|
1449
|
+
derivedPanelConstraints: g,
|
|
1450
|
+
groupSize: b,
|
|
1451
|
+
layout: w,
|
|
1424
1452
|
separatorToPanels: y.separatorToPanels
|
|
1425
1453
|
});
|
|
1426
1454
|
}
|
|
1427
1455
|
} else
|
|
1428
|
-
_t(e,
|
|
1456
|
+
_t(e, v, m);
|
|
1429
1457
|
}
|
|
1430
1458
|
});
|
|
1431
|
-
|
|
1459
|
+
r.observe(e.element), e.panels.forEach((c) => {
|
|
1432
1460
|
C(
|
|
1433
|
-
!o.has(
|
|
1434
|
-
`Panel ids must be unique; id "${
|
|
1435
|
-
), o.add(
|
|
1461
|
+
!o.has(c.id),
|
|
1462
|
+
`Panel ids must be unique; id "${c.id}" was used more than once`
|
|
1463
|
+
), o.add(c.id), c.onResize && r.observe(c.element);
|
|
1436
1464
|
});
|
|
1437
|
-
const
|
|
1438
|
-
let
|
|
1439
|
-
|
|
1440
|
-
const
|
|
1441
|
-
layout:
|
|
1442
|
-
panelConstraints:
|
|
1465
|
+
const f = ne({ group: e }), a = ve(e), s = e.panels.map(({ id: c }) => c).join(",");
|
|
1466
|
+
let l = e.mutableState.defaultLayout;
|
|
1467
|
+
l && (Ht(e.panels, l) || (l = void 0));
|
|
1468
|
+
const u = e.mutableState.layouts[s] ?? l ?? We(a), h = U({
|
|
1469
|
+
layout: u,
|
|
1470
|
+
panelConstraints: a
|
|
1443
1471
|
}), d = e.element.ownerDocument;
|
|
1444
1472
|
J.set(
|
|
1445
1473
|
d,
|
|
1446
1474
|
(J.get(d) ?? 0) + 1
|
|
1447
1475
|
);
|
|
1448
|
-
const
|
|
1449
|
-
return Je(e).forEach((
|
|
1450
|
-
|
|
1476
|
+
const S = /* @__PURE__ */ new Map();
|
|
1477
|
+
return Je(e).forEach((c) => {
|
|
1478
|
+
c.separator && S.set(c.separator, c.panels);
|
|
1451
1479
|
}), $(e, {
|
|
1452
|
-
defaultLayoutDeferred:
|
|
1453
|
-
derivedPanelConstraints:
|
|
1454
|
-
groupSize:
|
|
1455
|
-
layout:
|
|
1456
|
-
separatorToPanels:
|
|
1457
|
-
}), e.separators.forEach((
|
|
1480
|
+
defaultLayoutDeferred: f === 0,
|
|
1481
|
+
derivedPanelConstraints: a,
|
|
1482
|
+
groupSize: f,
|
|
1483
|
+
layout: h,
|
|
1484
|
+
separatorToPanels: S
|
|
1485
|
+
}), e.separators.forEach((c) => {
|
|
1458
1486
|
C(
|
|
1459
|
-
!i.has(
|
|
1460
|
-
`Separator ids must be unique; id "${
|
|
1461
|
-
), i.add(
|
|
1462
|
-
}), J.get(d) === 1 && (d.addEventListener("dblclick",
|
|
1487
|
+
!i.has(c.id),
|
|
1488
|
+
`Separator ids must be unique; id "${c.id}" was used more than once`
|
|
1489
|
+
), i.add(c.id), c.element.addEventListener("keydown", Ge);
|
|
1490
|
+
}), J.get(d) === 1 && (d.addEventListener("dblclick", Te, !0), d.addEventListener("pointerdown", Ae, !0), d.addEventListener("pointerleave", je), d.addEventListener("pointermove", He), d.addEventListener("pointerout", Ve), d.addEventListener("pointerup", Be, !0)), function() {
|
|
1463
1491
|
t = !1, J.set(
|
|
1464
1492
|
d,
|
|
1465
1493
|
Math.max(0, (J.get(d) ?? 0) - 1)
|
|
@@ -1467,13 +1495,13 @@ function Vt(e) {
|
|
|
1467
1495
|
p.element.removeEventListener("keydown", Ge);
|
|
1468
1496
|
}), J.get(d) || (d.removeEventListener(
|
|
1469
1497
|
"dblclick",
|
|
1470
|
-
|
|
1498
|
+
Te,
|
|
1471
1499
|
!0
|
|
1472
1500
|
), d.removeEventListener(
|
|
1473
1501
|
"pointerdown",
|
|
1474
1502
|
Ae,
|
|
1475
1503
|
!0
|
|
1476
|
-
), d.removeEventListener("pointerleave", je), d.removeEventListener("pointermove", He), d.removeEventListener("pointerout", Ve), d.removeEventListener("pointerup", Be, !0)),
|
|
1504
|
+
), d.removeEventListener("pointerleave", je), d.removeEventListener("pointermove", He), d.removeEventListener("pointerout", Ve), d.removeEventListener("pointerup", Be, !0)), r.disconnect();
|
|
1477
1505
|
};
|
|
1478
1506
|
}
|
|
1479
1507
|
function Bt() {
|
|
@@ -1486,7 +1514,7 @@ function Le(e) {
|
|
|
1486
1514
|
}
|
|
1487
1515
|
const q = typeof window < "u" ? Ue : me;
|
|
1488
1516
|
function se(e) {
|
|
1489
|
-
const t =
|
|
1517
|
+
const t = T(e);
|
|
1490
1518
|
return q(() => {
|
|
1491
1519
|
t.current = e;
|
|
1492
1520
|
}, [e]), re(
|
|
@@ -1512,7 +1540,7 @@ function Ce(...e) {
|
|
|
1512
1540
|
});
|
|
1513
1541
|
}
|
|
1514
1542
|
function Re(e) {
|
|
1515
|
-
const t =
|
|
1543
|
+
const t = T({ ...e });
|
|
1516
1544
|
return q(() => {
|
|
1517
1545
|
for (const n in e)
|
|
1518
1546
|
t.current[n] = e[n];
|
|
@@ -1520,7 +1548,7 @@ function Re(e) {
|
|
|
1520
1548
|
}
|
|
1521
1549
|
const lt = ht(null);
|
|
1522
1550
|
function Wt(e, t) {
|
|
1523
|
-
const n =
|
|
1551
|
+
const n = T({
|
|
1524
1552
|
getLayout: () => ({}),
|
|
1525
1553
|
setLayout: Ft
|
|
1526
1554
|
});
|
|
@@ -1537,42 +1565,42 @@ function Ut({
|
|
|
1537
1565
|
defaultLayout: n,
|
|
1538
1566
|
disableCursor: o,
|
|
1539
1567
|
disabled: i,
|
|
1540
|
-
elementRef:
|
|
1541
|
-
groupRef:
|
|
1542
|
-
id:
|
|
1543
|
-
onLayoutChange:
|
|
1544
|
-
onLayoutChanged:
|
|
1545
|
-
orientation:
|
|
1546
|
-
resizeTargetMinimumSize:
|
|
1568
|
+
elementRef: r,
|
|
1569
|
+
groupRef: f,
|
|
1570
|
+
id: a,
|
|
1571
|
+
onLayoutChange: s,
|
|
1572
|
+
onLayoutChanged: l,
|
|
1573
|
+
orientation: u = "horizontal",
|
|
1574
|
+
resizeTargetMinimumSize: h = {
|
|
1547
1575
|
coarse: 20,
|
|
1548
1576
|
fine: 10
|
|
1549
1577
|
},
|
|
1550
1578
|
style: d,
|
|
1551
|
-
...
|
|
1579
|
+
...S
|
|
1552
1580
|
}) {
|
|
1553
|
-
const
|
|
1581
|
+
const z = T({
|
|
1554
1582
|
onLayoutChange: {},
|
|
1555
1583
|
onLayoutChanged: {}
|
|
1556
|
-
}),
|
|
1557
|
-
W(
|
|
1558
|
-
}), p = se((
|
|
1559
|
-
W(
|
|
1560
|
-
}), m = Le(
|
|
1584
|
+
}), c = se((x) => {
|
|
1585
|
+
W(z.current.onLayoutChange, x) || (z.current.onLayoutChange = x, s?.(x));
|
|
1586
|
+
}), p = se((x) => {
|
|
1587
|
+
W(z.current.onLayoutChanged, x) || (z.current.onLayoutChanged = x, l?.(x));
|
|
1588
|
+
}), m = Le(a), v = T(null), [b, y] = Bt(), g = T({
|
|
1561
1589
|
lastExpandedPanelSizes: {},
|
|
1562
1590
|
layouts: {},
|
|
1563
1591
|
panels: [],
|
|
1564
|
-
resizeTargetMinimumSize:
|
|
1592
|
+
resizeTargetMinimumSize: h,
|
|
1565
1593
|
separators: []
|
|
1566
|
-
}),
|
|
1567
|
-
Wt(m,
|
|
1594
|
+
}), P = Ce(v, r);
|
|
1595
|
+
Wt(m, f);
|
|
1568
1596
|
const M = se(
|
|
1569
|
-
(
|
|
1570
|
-
const k = K(), R = ke(
|
|
1597
|
+
(x, L) => {
|
|
1598
|
+
const k = K(), R = ke(x), E = H(x);
|
|
1571
1599
|
if (E) {
|
|
1572
|
-
let
|
|
1600
|
+
let D = !1;
|
|
1573
1601
|
switch (k.state) {
|
|
1574
1602
|
case "active": {
|
|
1575
|
-
|
|
1603
|
+
D = k.hitRegions.some(
|
|
1576
1604
|
(V) => V.group === R
|
|
1577
1605
|
);
|
|
1578
1606
|
break;
|
|
@@ -1580,7 +1608,7 @@ function Ut({
|
|
|
1580
1608
|
}
|
|
1581
1609
|
return {
|
|
1582
1610
|
flexGrow: E.layout[L] ?? 1,
|
|
1583
|
-
pointerEvents:
|
|
1611
|
+
pointerEvents: D ? "none" : void 0
|
|
1584
1612
|
};
|
|
1585
1613
|
}
|
|
1586
1614
|
if (n?.[L])
|
|
@@ -1588,93 +1616,93 @@ function Ut({
|
|
|
1588
1616
|
flexGrow: n?.[L]
|
|
1589
1617
|
};
|
|
1590
1618
|
}
|
|
1591
|
-
),
|
|
1619
|
+
), w = Re({
|
|
1592
1620
|
defaultLayout: n,
|
|
1593
1621
|
disableCursor: o
|
|
1594
1622
|
}), G = Se(
|
|
1595
1623
|
() => ({
|
|
1596
1624
|
get disableCursor() {
|
|
1597
|
-
return !!
|
|
1625
|
+
return !!w.disableCursor;
|
|
1598
1626
|
},
|
|
1599
1627
|
getPanelStyles: M,
|
|
1600
1628
|
id: m,
|
|
1601
|
-
orientation:
|
|
1602
|
-
registerPanel: (
|
|
1603
|
-
const L =
|
|
1604
|
-
return L.panels = be(
|
|
1629
|
+
orientation: u,
|
|
1630
|
+
registerPanel: (x) => {
|
|
1631
|
+
const L = g.current;
|
|
1632
|
+
return L.panels = be(u, [
|
|
1605
1633
|
...L.panels,
|
|
1606
|
-
|
|
1634
|
+
x
|
|
1607
1635
|
]), y(), () => {
|
|
1608
1636
|
L.panels = L.panels.filter(
|
|
1609
|
-
(k) => k !==
|
|
1637
|
+
(k) => k !== x
|
|
1610
1638
|
), y();
|
|
1611
1639
|
};
|
|
1612
1640
|
},
|
|
1613
|
-
registerSeparator: (
|
|
1614
|
-
const L =
|
|
1615
|
-
return L.separators = be(
|
|
1641
|
+
registerSeparator: (x) => {
|
|
1642
|
+
const L = g.current;
|
|
1643
|
+
return L.separators = be(u, [
|
|
1616
1644
|
...L.separators,
|
|
1617
|
-
|
|
1645
|
+
x
|
|
1618
1646
|
]), y(), () => {
|
|
1619
1647
|
L.separators = L.separators.filter(
|
|
1620
|
-
(k) => k !==
|
|
1648
|
+
(k) => k !== x
|
|
1621
1649
|
), y();
|
|
1622
1650
|
};
|
|
1623
1651
|
},
|
|
1624
|
-
updatePanelProps: (
|
|
1625
|
-
const R =
|
|
1626
|
-
(V) => V.id ===
|
|
1652
|
+
updatePanelProps: (x, { disabled: L }) => {
|
|
1653
|
+
const R = g.current.panels.find(
|
|
1654
|
+
(V) => V.id === x
|
|
1627
1655
|
);
|
|
1628
1656
|
R && (R.panelConstraints.disabled = L);
|
|
1629
|
-
const E = ke(m),
|
|
1630
|
-
E &&
|
|
1631
|
-
...
|
|
1657
|
+
const E = ke(m), D = H(m);
|
|
1658
|
+
E && D && $(E, {
|
|
1659
|
+
...D,
|
|
1632
1660
|
derivedPanelConstraints: ve(E)
|
|
1633
1661
|
});
|
|
1634
1662
|
},
|
|
1635
|
-
updateSeparatorProps: (
|
|
1663
|
+
updateSeparatorProps: (x, {
|
|
1636
1664
|
disabled: L,
|
|
1637
1665
|
disableDoubleClick: k
|
|
1638
1666
|
}) => {
|
|
1639
|
-
const E =
|
|
1640
|
-
(
|
|
1667
|
+
const E = g.current.separators.find(
|
|
1668
|
+
(D) => D.id === x
|
|
1641
1669
|
);
|
|
1642
1670
|
E && (E.disabled = L, E.disableDoubleClick = k);
|
|
1643
1671
|
}
|
|
1644
1672
|
}),
|
|
1645
|
-
[M, m, y,
|
|
1646
|
-
), N =
|
|
1673
|
+
[M, m, y, u, w]
|
|
1674
|
+
), N = T(null);
|
|
1647
1675
|
return q(() => {
|
|
1648
|
-
const
|
|
1649
|
-
if (
|
|
1676
|
+
const x = v.current;
|
|
1677
|
+
if (x === null)
|
|
1650
1678
|
return;
|
|
1651
|
-
const L =
|
|
1679
|
+
const L = g.current;
|
|
1652
1680
|
let k;
|
|
1653
|
-
if (
|
|
1681
|
+
if (w.defaultLayout !== void 0 && Object.keys(w.defaultLayout).length === L.panels.length) {
|
|
1654
1682
|
k = {};
|
|
1655
1683
|
for (const j of L.panels) {
|
|
1656
|
-
const Y =
|
|
1684
|
+
const Y = w.defaultLayout[j.id];
|
|
1657
1685
|
Y !== void 0 && (k[j.id] = Y);
|
|
1658
1686
|
}
|
|
1659
1687
|
}
|
|
1660
1688
|
const R = {
|
|
1661
1689
|
disabled: !!i,
|
|
1662
|
-
element:
|
|
1690
|
+
element: x,
|
|
1663
1691
|
id: m,
|
|
1664
1692
|
mutableState: {
|
|
1665
1693
|
defaultLayout: k,
|
|
1666
|
-
disableCursor: !!
|
|
1667
|
-
expandedPanelSizes:
|
|
1668
|
-
layouts:
|
|
1694
|
+
disableCursor: !!w.disableCursor,
|
|
1695
|
+
expandedPanelSizes: g.current.lastExpandedPanelSizes,
|
|
1696
|
+
layouts: g.current.layouts
|
|
1669
1697
|
},
|
|
1670
|
-
orientation:
|
|
1698
|
+
orientation: u,
|
|
1671
1699
|
panels: L.panels,
|
|
1672
1700
|
resizeTargetMinimumSize: L.resizeTargetMinimumSize,
|
|
1673
1701
|
separators: L.separators
|
|
1674
1702
|
};
|
|
1675
1703
|
N.current = R;
|
|
1676
|
-
const E = Vt(R), { defaultLayoutDeferred:
|
|
1677
|
-
!
|
|
1704
|
+
const E = Vt(R), { defaultLayoutDeferred: D, derivedPanelConstraints: V, layout: ue } = H(R.id, !0);
|
|
1705
|
+
!D && V.length > 0 && (c(ue), p(ue));
|
|
1678
1706
|
const oe = ze(m, (j) => {
|
|
1679
1707
|
const { defaultLayoutDeferred: Y, derivedPanelConstraints: Ee, layout: ce } = j.next;
|
|
1680
1708
|
if (Y || Ee.length === 0)
|
|
@@ -1684,10 +1712,10 @@ function Ut({
|
|
|
1684
1712
|
if (_.collapsible) {
|
|
1685
1713
|
const { layout: ge } = j.prev ?? {};
|
|
1686
1714
|
if (ge) {
|
|
1687
|
-
const ft =
|
|
1715
|
+
const ft = I(
|
|
1688
1716
|
_.collapsedSize,
|
|
1689
1717
|
ce[_.panelId]
|
|
1690
|
-
), dt =
|
|
1718
|
+
), dt = I(
|
|
1691
1719
|
_.collapsedSize,
|
|
1692
1720
|
ge[_.panelId]
|
|
1693
1721
|
);
|
|
@@ -1696,7 +1724,7 @@ function Ut({
|
|
|
1696
1724
|
}
|
|
1697
1725
|
});
|
|
1698
1726
|
const ct = K().state !== "active";
|
|
1699
|
-
|
|
1727
|
+
c(ce), ct && p(ce);
|
|
1700
1728
|
});
|
|
1701
1729
|
return () => {
|
|
1702
1730
|
N.current = null, E(), oe();
|
|
@@ -1705,35 +1733,35 @@ function Ut({
|
|
|
1705
1733
|
i,
|
|
1706
1734
|
m,
|
|
1707
1735
|
p,
|
|
1736
|
+
c,
|
|
1708
1737
|
u,
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
P
|
|
1738
|
+
b,
|
|
1739
|
+
w
|
|
1712
1740
|
]), me(() => {
|
|
1713
|
-
const
|
|
1714
|
-
|
|
1741
|
+
const x = N.current;
|
|
1742
|
+
x && (x.mutableState.defaultLayout = n, x.mutableState.disableCursor = !!o);
|
|
1715
1743
|
}), /* @__PURE__ */ ae(lt.Provider, { value: G, children: /* @__PURE__ */ ae(
|
|
1716
1744
|
"div",
|
|
1717
1745
|
{
|
|
1718
|
-
...
|
|
1746
|
+
...S,
|
|
1719
1747
|
className: t,
|
|
1720
1748
|
"data-group": !0,
|
|
1721
1749
|
"data-testid": m,
|
|
1722
1750
|
id: m,
|
|
1723
|
-
ref:
|
|
1751
|
+
ref: P,
|
|
1724
1752
|
style: {
|
|
1725
1753
|
height: "100%",
|
|
1726
1754
|
width: "100%",
|
|
1727
1755
|
overflow: "hidden",
|
|
1728
1756
|
...d,
|
|
1729
1757
|
display: "flex",
|
|
1730
|
-
flexDirection:
|
|
1758
|
+
flexDirection: u === "horizontal" ? "row" : "column",
|
|
1731
1759
|
flexWrap: "nowrap",
|
|
1732
1760
|
// Inform the browser that the library is handling touch events for this element
|
|
1733
1761
|
// but still allow users to scroll content within panels in the non-resizing direction
|
|
1734
1762
|
// NOTE This is not an inherited style
|
|
1735
1763
|
// See github.com/bvaughn/react-resizable-panels/issues/662
|
|
1736
|
-
touchAction:
|
|
1764
|
+
touchAction: u === "horizontal" ? "pan-y" : "pan-x"
|
|
1737
1765
|
},
|
|
1738
1766
|
children: e
|
|
1739
1767
|
}
|
|
@@ -1751,26 +1779,26 @@ function Kt({
|
|
|
1751
1779
|
const o = he(e, []), i = n.getItem(o);
|
|
1752
1780
|
if (i)
|
|
1753
1781
|
try {
|
|
1754
|
-
const
|
|
1782
|
+
const r = JSON.parse(i);
|
|
1755
1783
|
if (t) {
|
|
1756
|
-
const
|
|
1757
|
-
if (
|
|
1758
|
-
const
|
|
1759
|
-
for (let
|
|
1760
|
-
|
|
1761
|
-
return
|
|
1784
|
+
const f = t.join(","), a = r[f];
|
|
1785
|
+
if (a && Array.isArray(a.layout) && t.length === a.layout.length) {
|
|
1786
|
+
const s = {};
|
|
1787
|
+
for (let l = 0; l < t.length; l++)
|
|
1788
|
+
s[t[l]] = a.layout[l];
|
|
1789
|
+
return s;
|
|
1762
1790
|
}
|
|
1763
1791
|
} else {
|
|
1764
|
-
const
|
|
1765
|
-
if (
|
|
1766
|
-
const
|
|
1767
|
-
if (
|
|
1768
|
-
const
|
|
1769
|
-
if (
|
|
1770
|
-
const
|
|
1771
|
-
for (let
|
|
1772
|
-
|
|
1773
|
-
return
|
|
1792
|
+
const f = Object.keys(r);
|
|
1793
|
+
if (f.length === 1) {
|
|
1794
|
+
const a = r[f[0]];
|
|
1795
|
+
if (a && Array.isArray(a.layout)) {
|
|
1796
|
+
const s = f[0].split(",");
|
|
1797
|
+
if (s.length === a.layout.length) {
|
|
1798
|
+
const l = {};
|
|
1799
|
+
for (let u = 0; u < s.length; u++)
|
|
1800
|
+
l[s[u]] = a.layout[u];
|
|
1801
|
+
return l;
|
|
1774
1802
|
}
|
|
1775
1803
|
}
|
|
1776
1804
|
}
|
|
@@ -1784,65 +1812,65 @@ function on({
|
|
|
1784
1812
|
storage: n = localStorage,
|
|
1785
1813
|
...o
|
|
1786
1814
|
}) {
|
|
1787
|
-
const i = t !== void 0,
|
|
1815
|
+
const i = t !== void 0, r = "id" in o ? o.id : o.groupId, f = he(r, t ?? []), a = Xe(
|
|
1788
1816
|
Xt,
|
|
1789
|
-
() => n.getItem(
|
|
1790
|
-
() => n.getItem(
|
|
1791
|
-
),
|
|
1792
|
-
if (
|
|
1793
|
-
const
|
|
1817
|
+
() => n.getItem(f),
|
|
1818
|
+
() => n.getItem(f)
|
|
1819
|
+
), s = Se(() => {
|
|
1820
|
+
if (a) {
|
|
1821
|
+
const c = JSON.parse(a), p = Object.values(c);
|
|
1794
1822
|
if (Array.from(p).every((m) => typeof m == "number"))
|
|
1795
|
-
return
|
|
1823
|
+
return c;
|
|
1796
1824
|
}
|
|
1797
|
-
}, [
|
|
1798
|
-
if (!
|
|
1825
|
+
}, [a]), l = Se(() => {
|
|
1826
|
+
if (!s)
|
|
1799
1827
|
return Kt({
|
|
1800
|
-
id:
|
|
1828
|
+
id: r,
|
|
1801
1829
|
panelIds: t,
|
|
1802
1830
|
storage: n
|
|
1803
1831
|
});
|
|
1804
|
-
}, [
|
|
1805
|
-
const
|
|
1806
|
-
|
|
1832
|
+
}, [s, r, t, n]), u = s ?? l, h = T(null), d = re(() => {
|
|
1833
|
+
const c = h.current;
|
|
1834
|
+
c && (h.current = null, clearTimeout(c));
|
|
1807
1835
|
}, []);
|
|
1808
1836
|
Ue(() => () => {
|
|
1809
1837
|
d();
|
|
1810
1838
|
}, [d]);
|
|
1811
|
-
const
|
|
1812
|
-
(
|
|
1839
|
+
const S = re(
|
|
1840
|
+
(c) => {
|
|
1813
1841
|
d();
|
|
1814
1842
|
let p;
|
|
1815
|
-
i ? p = he(
|
|
1843
|
+
i ? p = he(r, Object.keys(c)) : p = he(r, []);
|
|
1816
1844
|
try {
|
|
1817
|
-
n.setItem(p, JSON.stringify(
|
|
1845
|
+
n.setItem(p, JSON.stringify(c));
|
|
1818
1846
|
} catch (m) {
|
|
1819
1847
|
console.error(m);
|
|
1820
1848
|
}
|
|
1821
1849
|
},
|
|
1822
|
-
[d, i,
|
|
1823
|
-
),
|
|
1824
|
-
(
|
|
1825
|
-
d(), e === 0 ?
|
|
1826
|
-
|
|
1850
|
+
[d, i, r, n]
|
|
1851
|
+
), z = re(
|
|
1852
|
+
(c) => {
|
|
1853
|
+
d(), e === 0 ? S(c) : h.current = setTimeout(() => {
|
|
1854
|
+
S(c);
|
|
1827
1855
|
}, e);
|
|
1828
1856
|
},
|
|
1829
|
-
[d, e,
|
|
1857
|
+
[d, e, S]
|
|
1830
1858
|
);
|
|
1831
1859
|
return {
|
|
1832
1860
|
/**
|
|
1833
1861
|
* Pass this value to `Group` as the `defaultLayout` prop.
|
|
1834
1862
|
*/
|
|
1835
|
-
defaultLayout:
|
|
1863
|
+
defaultLayout: u,
|
|
1836
1864
|
/**
|
|
1837
1865
|
* Attach this callback on the `Group` as the `onLayoutChange` prop.
|
|
1838
1866
|
*
|
|
1839
1867
|
* @deprecated Use the {@link onLayoutChanged} prop instead.
|
|
1840
1868
|
*/
|
|
1841
|
-
onLayoutChange:
|
|
1869
|
+
onLayoutChange: z,
|
|
1842
1870
|
/**
|
|
1843
1871
|
* Attach this callback on the `Group` as the `onLayoutChanged` prop.
|
|
1844
1872
|
*/
|
|
1845
|
-
onLayoutChanged:
|
|
1873
|
+
onLayoutChanged: S
|
|
1846
1874
|
};
|
|
1847
1875
|
}
|
|
1848
1876
|
function Xt() {
|
|
@@ -1853,7 +1881,7 @@ function rn() {
|
|
|
1853
1881
|
return Q(null);
|
|
1854
1882
|
}
|
|
1855
1883
|
function sn() {
|
|
1856
|
-
return
|
|
1884
|
+
return T(null);
|
|
1857
1885
|
}
|
|
1858
1886
|
function Me() {
|
|
1859
1887
|
const e = mt(lt);
|
|
@@ -1863,7 +1891,7 @@ function Me() {
|
|
|
1863
1891
|
), e;
|
|
1864
1892
|
}
|
|
1865
1893
|
function qt(e, t) {
|
|
1866
|
-
const { id: n } = Me(), o =
|
|
1894
|
+
const { id: n } = Me(), o = T({
|
|
1867
1895
|
collapse: ye,
|
|
1868
1896
|
expand: ye,
|
|
1869
1897
|
getSize: () => ({
|
|
@@ -1886,78 +1914,78 @@ function Yt({
|
|
|
1886
1914
|
collapsedSize: n = "0%",
|
|
1887
1915
|
collapsible: o = !1,
|
|
1888
1916
|
defaultSize: i,
|
|
1889
|
-
disabled:
|
|
1890
|
-
elementRef:
|
|
1891
|
-
groupResizeBehavior:
|
|
1892
|
-
id:
|
|
1893
|
-
maxSize:
|
|
1894
|
-
minSize:
|
|
1895
|
-
onResize:
|
|
1917
|
+
disabled: r,
|
|
1918
|
+
elementRef: f,
|
|
1919
|
+
groupResizeBehavior: a = "preserve-relative-size",
|
|
1920
|
+
id: s,
|
|
1921
|
+
maxSize: l = "100%",
|
|
1922
|
+
minSize: u = "0%",
|
|
1923
|
+
onResize: h,
|
|
1896
1924
|
panelRef: d,
|
|
1897
|
-
style:
|
|
1898
|
-
...
|
|
1925
|
+
style: S,
|
|
1926
|
+
...z
|
|
1899
1927
|
}) {
|
|
1900
|
-
const
|
|
1901
|
-
disabled:
|
|
1902
|
-
}),
|
|
1928
|
+
const c = !!s, p = Le(s), m = Re({
|
|
1929
|
+
disabled: r
|
|
1930
|
+
}), v = T(null), b = Ce(v, f), {
|
|
1903
1931
|
getPanelStyles: y,
|
|
1904
|
-
id:
|
|
1905
|
-
orientation:
|
|
1932
|
+
id: g,
|
|
1933
|
+
orientation: P,
|
|
1906
1934
|
registerPanel: M,
|
|
1907
|
-
updatePanelProps:
|
|
1908
|
-
} = Me(), G =
|
|
1909
|
-
(R, E,
|
|
1910
|
-
|
|
1935
|
+
updatePanelProps: w
|
|
1936
|
+
} = Me(), G = h !== null, N = se(
|
|
1937
|
+
(R, E, D) => {
|
|
1938
|
+
h?.(R, s, D);
|
|
1911
1939
|
}
|
|
1912
1940
|
);
|
|
1913
1941
|
q(() => {
|
|
1914
|
-
const R =
|
|
1942
|
+
const R = v.current;
|
|
1915
1943
|
if (R !== null) {
|
|
1916
1944
|
const E = {
|
|
1917
1945
|
element: R,
|
|
1918
1946
|
id: p,
|
|
1919
|
-
idIsStable:
|
|
1947
|
+
idIsStable: c,
|
|
1920
1948
|
mutableValues: {
|
|
1921
1949
|
expandToSize: void 0,
|
|
1922
1950
|
prevSize: void 0
|
|
1923
1951
|
},
|
|
1924
1952
|
onResize: G ? N : void 0,
|
|
1925
1953
|
panelConstraints: {
|
|
1926
|
-
groupResizeBehavior:
|
|
1954
|
+
groupResizeBehavior: a,
|
|
1927
1955
|
collapsedSize: n,
|
|
1928
1956
|
collapsible: o,
|
|
1929
1957
|
defaultSize: i,
|
|
1930
1958
|
disabled: m.disabled,
|
|
1931
|
-
maxSize:
|
|
1932
|
-
minSize:
|
|
1959
|
+
maxSize: l,
|
|
1960
|
+
minSize: u
|
|
1933
1961
|
}
|
|
1934
1962
|
};
|
|
1935
1963
|
return M(E);
|
|
1936
1964
|
}
|
|
1937
1965
|
}, [
|
|
1938
|
-
|
|
1966
|
+
a,
|
|
1939
1967
|
n,
|
|
1940
1968
|
o,
|
|
1941
1969
|
i,
|
|
1942
1970
|
G,
|
|
1943
1971
|
p,
|
|
1944
|
-
u,
|
|
1945
1972
|
c,
|
|
1946
|
-
|
|
1973
|
+
l,
|
|
1974
|
+
u,
|
|
1947
1975
|
N,
|
|
1948
1976
|
M,
|
|
1949
1977
|
m
|
|
1950
1978
|
]), me(() => {
|
|
1951
|
-
|
|
1952
|
-
}, [
|
|
1953
|
-
const
|
|
1954
|
-
const R = y(
|
|
1979
|
+
w(p, { disabled: r });
|
|
1980
|
+
}, [r, p, w]), qt(p, d);
|
|
1981
|
+
const x = () => {
|
|
1982
|
+
const R = y(g, p);
|
|
1955
1983
|
if (R)
|
|
1956
1984
|
return JSON.stringify(R);
|
|
1957
1985
|
}, L = Xe(
|
|
1958
|
-
(R) => ze(
|
|
1959
|
-
|
|
1960
|
-
|
|
1986
|
+
(R) => ze(g, R),
|
|
1987
|
+
x,
|
|
1988
|
+
x
|
|
1961
1989
|
);
|
|
1962
1990
|
let k;
|
|
1963
1991
|
return L ? k = JSON.parse(L) : i ? k = {
|
|
@@ -1967,12 +1995,12 @@ function Yt({
|
|
|
1967
1995
|
} : k = { flexGrow: 1 }, /* @__PURE__ */ ae(
|
|
1968
1996
|
"div",
|
|
1969
1997
|
{
|
|
1970
|
-
...
|
|
1971
|
-
"data-disabled":
|
|
1998
|
+
...z,
|
|
1999
|
+
"data-disabled": r || void 0,
|
|
1972
2000
|
"data-panel": !0,
|
|
1973
2001
|
"data-testid": p,
|
|
1974
2002
|
id: p,
|
|
1975
|
-
ref:
|
|
2003
|
+
ref: b,
|
|
1976
2004
|
style: {
|
|
1977
2005
|
...Jt,
|
|
1978
2006
|
display: "flex",
|
|
@@ -1990,12 +2018,12 @@ function Yt({
|
|
|
1990
2018
|
maxWidth: "100%",
|
|
1991
2019
|
flexGrow: 1,
|
|
1992
2020
|
overflow: "auto",
|
|
1993
|
-
...
|
|
2021
|
+
...S,
|
|
1994
2022
|
// Inform the browser that the library is handling touch events for this element
|
|
1995
2023
|
// but still allow users to scroll content within panels in the non-resizing direction
|
|
1996
2024
|
// NOTE This is not an inherited style
|
|
1997
2025
|
// See github.com/bvaughn/react-resizable-panels/issues/662
|
|
1998
|
-
touchAction:
|
|
2026
|
+
touchAction: P === "horizontal" ? "pan-y" : "pan-x"
|
|
1999
2027
|
},
|
|
2000
2028
|
children: e
|
|
2001
2029
|
}
|
|
@@ -2020,7 +2048,7 @@ function an() {
|
|
|
2020
2048
|
return Q(null);
|
|
2021
2049
|
}
|
|
2022
2050
|
function ln() {
|
|
2023
|
-
return
|
|
2051
|
+
return T(null);
|
|
2024
2052
|
}
|
|
2025
2053
|
function Zt({
|
|
2026
2054
|
layout: e,
|
|
@@ -2028,27 +2056,27 @@ function Zt({
|
|
|
2028
2056
|
panelId: n,
|
|
2029
2057
|
panelIndex: o
|
|
2030
2058
|
}) {
|
|
2031
|
-
let i,
|
|
2032
|
-
const
|
|
2033
|
-
(
|
|
2059
|
+
let i, r;
|
|
2060
|
+
const f = e[n], a = t.find(
|
|
2061
|
+
(s) => s.panelId === n
|
|
2034
2062
|
);
|
|
2035
|
-
if (
|
|
2036
|
-
const
|
|
2037
|
-
|
|
2063
|
+
if (a) {
|
|
2064
|
+
const s = a.maxSize, l = a.collapsible ? a.collapsedSize : a.minSize, u = [o, o + 1];
|
|
2065
|
+
r = U({
|
|
2038
2066
|
layout: le({
|
|
2039
|
-
delta:
|
|
2067
|
+
delta: l - f,
|
|
2040
2068
|
initialLayout: e,
|
|
2041
2069
|
panelConstraints: t,
|
|
2042
|
-
pivotIndices:
|
|
2070
|
+
pivotIndices: u,
|
|
2043
2071
|
prevLayout: e
|
|
2044
2072
|
}),
|
|
2045
2073
|
panelConstraints: t
|
|
2046
2074
|
})[n], i = U({
|
|
2047
2075
|
layout: le({
|
|
2048
|
-
delta:
|
|
2076
|
+
delta: s - f,
|
|
2049
2077
|
initialLayout: e,
|
|
2050
2078
|
panelConstraints: t,
|
|
2051
|
-
pivotIndices:
|
|
2079
|
+
pivotIndices: u,
|
|
2052
2080
|
prevLayout: e
|
|
2053
2081
|
}),
|
|
2054
2082
|
panelConstraints: t
|
|
@@ -2057,8 +2085,8 @@ function Zt({
|
|
|
2057
2085
|
return {
|
|
2058
2086
|
valueControls: n,
|
|
2059
2087
|
valueMax: i,
|
|
2060
|
-
valueMin:
|
|
2061
|
-
valueNow:
|
|
2088
|
+
valueMin: r,
|
|
2089
|
+
valueNow: f
|
|
2062
2090
|
};
|
|
2063
2091
|
}
|
|
2064
2092
|
function Qt({
|
|
@@ -2067,46 +2095,46 @@ function Qt({
|
|
|
2067
2095
|
disabled: n,
|
|
2068
2096
|
disableDoubleClick: o,
|
|
2069
2097
|
elementRef: i,
|
|
2070
|
-
id:
|
|
2071
|
-
style:
|
|
2072
|
-
...
|
|
2098
|
+
id: r,
|
|
2099
|
+
style: f,
|
|
2100
|
+
...a
|
|
2073
2101
|
}) {
|
|
2074
|
-
const
|
|
2102
|
+
const s = Le(r), l = Re({
|
|
2075
2103
|
disabled: n,
|
|
2076
2104
|
disableDoubleClick: o
|
|
2077
|
-
}), [
|
|
2078
|
-
disableCursor:
|
|
2079
|
-
id:
|
|
2105
|
+
}), [u, h] = Q({}), [d, S] = Q("inactive"), [z, c] = Q(!1), p = T(null), m = Ce(p, i), {
|
|
2106
|
+
disableCursor: v,
|
|
2107
|
+
id: b,
|
|
2080
2108
|
orientation: y,
|
|
2081
|
-
registerSeparator:
|
|
2082
|
-
updateSeparatorProps:
|
|
2109
|
+
registerSeparator: g,
|
|
2110
|
+
updateSeparatorProps: P
|
|
2083
2111
|
} = Me(), M = y === "horizontal" ? "vertical" : "horizontal";
|
|
2084
2112
|
q(() => {
|
|
2085
2113
|
const N = p.current;
|
|
2086
2114
|
if (N !== null) {
|
|
2087
|
-
const
|
|
2088
|
-
disabled:
|
|
2089
|
-
disableDoubleClick:
|
|
2115
|
+
const x = {
|
|
2116
|
+
disabled: l.disabled,
|
|
2117
|
+
disableDoubleClick: l.disableDoubleClick,
|
|
2090
2118
|
element: N,
|
|
2091
|
-
id:
|
|
2092
|
-
}, L =
|
|
2119
|
+
id: s
|
|
2120
|
+
}, L = g(x), k = Gt(
|
|
2093
2121
|
(E) => {
|
|
2094
|
-
|
|
2122
|
+
S(
|
|
2095
2123
|
E.next.state !== "inactive" && E.next.hitRegions.some(
|
|
2096
|
-
(
|
|
2124
|
+
(D) => D.separator === x
|
|
2097
2125
|
) ? E.next.state : "inactive"
|
|
2098
2126
|
);
|
|
2099
2127
|
}
|
|
2100
2128
|
), R = ze(
|
|
2101
|
-
|
|
2129
|
+
b,
|
|
2102
2130
|
(E) => {
|
|
2103
|
-
const { derivedPanelConstraints:
|
|
2131
|
+
const { derivedPanelConstraints: D, layout: V, separatorToPanels: ue } = E.next, oe = ue.get(x);
|
|
2104
2132
|
if (oe) {
|
|
2105
2133
|
const j = oe[0], Y = oe.indexOf(j);
|
|
2106
|
-
|
|
2134
|
+
h(
|
|
2107
2135
|
Zt({
|
|
2108
2136
|
layout: V,
|
|
2109
|
-
panelConstraints:
|
|
2137
|
+
panelConstraints: D,
|
|
2110
2138
|
panelId: j.id,
|
|
2111
2139
|
panelIndex: Y
|
|
2112
2140
|
})
|
|
@@ -2118,11 +2146,11 @@ function Qt({
|
|
|
2118
2146
|
k(), R(), L();
|
|
2119
2147
|
};
|
|
2120
2148
|
}
|
|
2121
|
-
}, [
|
|
2122
|
-
|
|
2123
|
-
}, [n, o,
|
|
2124
|
-
let
|
|
2125
|
-
n && !
|
|
2149
|
+
}, [b, s, g, l]), me(() => {
|
|
2150
|
+
P(s, { disabled: n, disableDoubleClick: o });
|
|
2151
|
+
}, [n, o, s, P]);
|
|
2152
|
+
let w;
|
|
2153
|
+
n && !v && (w = "not-allowed");
|
|
2126
2154
|
let G;
|
|
2127
2155
|
if (n)
|
|
2128
2156
|
G = "disabled";
|
|
@@ -2133,31 +2161,31 @@ function Qt({
|
|
|
2133
2161
|
break;
|
|
2134
2162
|
}
|
|
2135
2163
|
default:
|
|
2136
|
-
|
|
2164
|
+
z ? G = "focus" : G = d;
|
|
2137
2165
|
}
|
|
2138
2166
|
return /* @__PURE__ */ ae(
|
|
2139
2167
|
"div",
|
|
2140
2168
|
{
|
|
2141
|
-
...
|
|
2142
|
-
"aria-controls":
|
|
2169
|
+
...a,
|
|
2170
|
+
"aria-controls": u.valueControls,
|
|
2143
2171
|
"aria-disabled": n || void 0,
|
|
2144
2172
|
"aria-orientation": M,
|
|
2145
|
-
"aria-valuemax":
|
|
2146
|
-
"aria-valuemin":
|
|
2147
|
-
"aria-valuenow":
|
|
2173
|
+
"aria-valuemax": u.valueMax,
|
|
2174
|
+
"aria-valuemin": u.valueMin,
|
|
2175
|
+
"aria-valuenow": u.valueNow,
|
|
2148
2176
|
children: e,
|
|
2149
2177
|
className: t,
|
|
2150
2178
|
"data-separator": G,
|
|
2151
|
-
"data-testid":
|
|
2152
|
-
id:
|
|
2153
|
-
onBlur: () =>
|
|
2154
|
-
onFocus: () =>
|
|
2179
|
+
"data-testid": s,
|
|
2180
|
+
id: s,
|
|
2181
|
+
onBlur: () => c(!1),
|
|
2182
|
+
onFocus: () => c(!0),
|
|
2155
2183
|
ref: m,
|
|
2156
2184
|
role: "separator",
|
|
2157
2185
|
style: {
|
|
2158
2186
|
flexBasis: "auto",
|
|
2159
|
-
cursor:
|
|
2160
|
-
...
|
|
2187
|
+
cursor: w,
|
|
2188
|
+
...f,
|
|
2161
2189
|
flexGrow: 0,
|
|
2162
2190
|
flexShrink: 0,
|
|
2163
2191
|
// Inform the browser that the library is handling touch events for this element
|
|
@@ -2173,7 +2201,7 @@ export {
|
|
|
2173
2201
|
Ut as Group,
|
|
2174
2202
|
Yt as Panel,
|
|
2175
2203
|
Qt as Separator,
|
|
2176
|
-
|
|
2204
|
+
wt as isCoarsePointer,
|
|
2177
2205
|
on as useDefaultLayout,
|
|
2178
2206
|
rn as useGroupCallbackRef,
|
|
2179
2207
|
sn as useGroupRef,
|