react-resizable-panels 4.0.0-alpha.2 → 4.0.0-alpha.3
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,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as j } from "react/jsx-runtime";
|
|
3
|
-
import { useId as
|
|
3
|
+
import { useId as Te, useLayoutEffect as De, useEffect as Ae, useRef as T, useCallback as ge, createContext as $e, useImperativeHandle as Se, useState as M, useMemo as xe, useSyncExternalStore as Ne, useContext as _e } from "react";
|
|
4
|
+
function S(e, t = "Assertion error") {
|
|
5
|
+
if (!e)
|
|
6
|
+
throw Error(t);
|
|
7
|
+
}
|
|
4
8
|
function re(e, t) {
|
|
5
9
|
return t.sort(
|
|
6
10
|
e === "horizontal" ? Fe : He
|
|
@@ -15,22 +19,22 @@ function He(e, t) {
|
|
|
15
19
|
return n !== 0 ? n : e.element.offsetHeight - t.element.offsetHeight;
|
|
16
20
|
}
|
|
17
21
|
function ze(e) {
|
|
18
|
-
const { element: t, orientation: n, panels: o, separators: s } = e,
|
|
22
|
+
const { element: t, orientation: n, panels: o, separators: s } = e, r = re(
|
|
19
23
|
n,
|
|
20
|
-
Array.from(t.children).filter((
|
|
21
|
-
).map(({ element:
|
|
22
|
-
let
|
|
23
|
-
for (const
|
|
24
|
+
Array.from(t.children).filter((l) => l instanceof HTMLElement).map((l) => ({ element: l }))
|
|
25
|
+
).map(({ element: l }) => l), c = [];
|
|
26
|
+
let i, a;
|
|
27
|
+
for (const l of r) {
|
|
24
28
|
const u = o.find(
|
|
25
|
-
(f) => f.element ===
|
|
29
|
+
(f) => f.element === l
|
|
26
30
|
);
|
|
27
31
|
if (u) {
|
|
28
|
-
if (
|
|
29
|
-
const f =
|
|
30
|
-
|
|
32
|
+
if (i) {
|
|
33
|
+
const f = i.element.getBoundingClientRect(), m = l.getBoundingClientRect();
|
|
34
|
+
c.push({
|
|
31
35
|
group: e,
|
|
32
|
-
panels: [
|
|
33
|
-
separator:
|
|
36
|
+
panels: [i, u],
|
|
37
|
+
separator: a,
|
|
34
38
|
rect: n === "horizontal" ? new DOMRect(
|
|
35
39
|
f.right,
|
|
36
40
|
m.top,
|
|
@@ -44,15 +48,15 @@ function ze(e) {
|
|
|
44
48
|
)
|
|
45
49
|
});
|
|
46
50
|
}
|
|
47
|
-
|
|
51
|
+
i = u, a = void 0;
|
|
48
52
|
} else {
|
|
49
53
|
const f = s.find(
|
|
50
|
-
(m) => m.element ===
|
|
54
|
+
(m) => m.element === l
|
|
51
55
|
);
|
|
52
|
-
f ?
|
|
56
|
+
f ? a = f : (i = void 0, a = void 0);
|
|
53
57
|
}
|
|
54
58
|
}
|
|
55
|
-
return
|
|
59
|
+
return c;
|
|
56
60
|
}
|
|
57
61
|
function je(e, t) {
|
|
58
62
|
const n = getComputedStyle(e), o = parseFloat(n.fontSize);
|
|
@@ -78,14 +82,14 @@ function Ke(e) {
|
|
|
78
82
|
}
|
|
79
83
|
}
|
|
80
84
|
}
|
|
81
|
-
function
|
|
85
|
+
function Z({
|
|
82
86
|
groupSize: e,
|
|
83
87
|
panelElement: t,
|
|
84
88
|
styleProp: n
|
|
85
89
|
}) {
|
|
86
90
|
let o;
|
|
87
|
-
const [s,
|
|
88
|
-
switch (
|
|
91
|
+
const [s, r] = Ke(n);
|
|
92
|
+
switch (r) {
|
|
89
93
|
case "%": {
|
|
90
94
|
o = s / 100 * e;
|
|
91
95
|
break;
|
|
@@ -113,7 +117,7 @@ function Y({
|
|
|
113
117
|
}
|
|
114
118
|
return o;
|
|
115
119
|
}
|
|
116
|
-
function
|
|
120
|
+
function R(e) {
|
|
117
121
|
return parseFloat(e.toFixed(3));
|
|
118
122
|
}
|
|
119
123
|
function le({
|
|
@@ -125,57 +129,53 @@ function le({
|
|
|
125
129
|
function pe(e) {
|
|
126
130
|
const { panels: t } = e, n = le({ group: e });
|
|
127
131
|
return t.map((o) => {
|
|
128
|
-
const { element: s, panelConstraints:
|
|
129
|
-
let
|
|
130
|
-
if (
|
|
131
|
-
const u =
|
|
132
|
+
const { element: s, panelConstraints: r } = o;
|
|
133
|
+
let c = 0;
|
|
134
|
+
if (r.collapsedSize) {
|
|
135
|
+
const u = Z({
|
|
132
136
|
groupSize: n,
|
|
133
137
|
panelElement: s,
|
|
134
|
-
styleProp:
|
|
138
|
+
styleProp: r.collapsedSize
|
|
135
139
|
});
|
|
136
|
-
|
|
140
|
+
c = R(u / n * 100);
|
|
137
141
|
}
|
|
138
|
-
let
|
|
139
|
-
if (
|
|
140
|
-
const u =
|
|
142
|
+
let i;
|
|
143
|
+
if (r.defaultSize) {
|
|
144
|
+
const u = Z({
|
|
141
145
|
groupSize: n,
|
|
142
146
|
panelElement: s,
|
|
143
|
-
styleProp:
|
|
147
|
+
styleProp: r.defaultSize
|
|
144
148
|
});
|
|
145
|
-
|
|
149
|
+
i = R(u / n * 100);
|
|
146
150
|
}
|
|
147
|
-
let
|
|
148
|
-
if (
|
|
149
|
-
const u =
|
|
151
|
+
let a = 0;
|
|
152
|
+
if (r.minSize) {
|
|
153
|
+
const u = Z({
|
|
150
154
|
groupSize: n,
|
|
151
155
|
panelElement: s,
|
|
152
|
-
styleProp:
|
|
156
|
+
styleProp: r.minSize
|
|
153
157
|
});
|
|
154
|
-
|
|
158
|
+
a = R(u / n * 100);
|
|
155
159
|
}
|
|
156
|
-
let
|
|
157
|
-
if (
|
|
158
|
-
const u =
|
|
160
|
+
let l = 100;
|
|
161
|
+
if (r.maxSize) {
|
|
162
|
+
const u = Z({
|
|
159
163
|
groupSize: n,
|
|
160
164
|
panelElement: s,
|
|
161
|
-
styleProp:
|
|
165
|
+
styleProp: r.maxSize
|
|
162
166
|
});
|
|
163
|
-
|
|
167
|
+
l = R(u / n * 100);
|
|
164
168
|
}
|
|
165
169
|
return {
|
|
166
|
-
collapsedSize:
|
|
167
|
-
collapsible:
|
|
168
|
-
defaultSize:
|
|
169
|
-
minSize:
|
|
170
|
-
maxSize:
|
|
170
|
+
collapsedSize: c,
|
|
171
|
+
collapsible: r.collapsible === !0,
|
|
172
|
+
defaultSize: i,
|
|
173
|
+
minSize: a,
|
|
174
|
+
maxSize: l,
|
|
171
175
|
panelId: o.id
|
|
172
176
|
};
|
|
173
177
|
});
|
|
174
178
|
}
|
|
175
|
-
function S(e, t = "Assertion error") {
|
|
176
|
-
if (!e)
|
|
177
|
-
throw console.error(t), Error(t);
|
|
178
|
-
}
|
|
179
179
|
class Ve {
|
|
180
180
|
#e = {};
|
|
181
181
|
addListener(t, n) {
|
|
@@ -190,18 +190,18 @@ class Ve {
|
|
|
190
190
|
if (o.length === 1)
|
|
191
191
|
o[0].call(null, n);
|
|
192
192
|
else {
|
|
193
|
-
let s = !1,
|
|
194
|
-
const
|
|
195
|
-
for (let
|
|
196
|
-
const
|
|
193
|
+
let s = !1, r = null;
|
|
194
|
+
const c = Array.from(o);
|
|
195
|
+
for (let i = 0; i < c.length; i++) {
|
|
196
|
+
const a = c[i];
|
|
197
197
|
try {
|
|
198
|
-
|
|
199
|
-
} catch (
|
|
200
|
-
|
|
198
|
+
a.call(null, n);
|
|
199
|
+
} catch (l) {
|
|
200
|
+
r === null && (s = !0, r = l);
|
|
201
201
|
}
|
|
202
202
|
}
|
|
203
203
|
if (s)
|
|
204
|
-
throw
|
|
204
|
+
throw r;
|
|
205
205
|
}
|
|
206
206
|
}
|
|
207
207
|
removeAllListeners() {
|
|
@@ -216,7 +216,7 @@ class Ve {
|
|
|
216
216
|
}
|
|
217
217
|
}
|
|
218
218
|
function L(e, t, n = 0) {
|
|
219
|
-
return Math.abs(
|
|
219
|
+
return Math.abs(R(e) - R(t)) <= n;
|
|
220
220
|
}
|
|
221
221
|
let P = {
|
|
222
222
|
cursorFlags: 0,
|
|
@@ -229,7 +229,7 @@ const A = new Ve();
|
|
|
229
229
|
function k() {
|
|
230
230
|
return P;
|
|
231
231
|
}
|
|
232
|
-
function
|
|
232
|
+
function E(e) {
|
|
233
233
|
const t = typeof e == "function" ? e(P) : e;
|
|
234
234
|
if (P === t)
|
|
235
235
|
return P;
|
|
@@ -238,24 +238,24 @@ function M(e) {
|
|
|
238
238
|
...P,
|
|
239
239
|
...t
|
|
240
240
|
}, t.cursorFlags !== void 0 && A.emit("cursorFlagsChange", P.cursorFlags), t.interactionState !== void 0 && A.emit("interactionStateChange", P.interactionState), t.mountedGroups !== void 0 && (P.mountedGroups.forEach((o, s) => {
|
|
241
|
-
o.derivedPanelConstraints.forEach((
|
|
242
|
-
if (
|
|
243
|
-
const { layout:
|
|
244
|
-
if (
|
|
245
|
-
const
|
|
246
|
-
|
|
247
|
-
o.layout[
|
|
248
|
-
),
|
|
249
|
-
|
|
250
|
-
|
|
241
|
+
o.derivedPanelConstraints.forEach((r) => {
|
|
242
|
+
if (r.collapsible) {
|
|
243
|
+
const { layout: c } = n.mountedGroups.get(s) ?? {};
|
|
244
|
+
if (c) {
|
|
245
|
+
const i = L(
|
|
246
|
+
r.collapsedSize,
|
|
247
|
+
o.layout[r.panelId]
|
|
248
|
+
), a = L(
|
|
249
|
+
r.collapsedSize,
|
|
250
|
+
c[r.panelId]
|
|
251
251
|
);
|
|
252
|
-
|
|
252
|
+
i && !a && (s.inMemoryLastExpandedPanelSizes[r.panelId] = c[r.panelId]);
|
|
253
253
|
}
|
|
254
254
|
}
|
|
255
255
|
});
|
|
256
256
|
}), A.emit("mountedGroupsChange", P.mountedGroups)), P;
|
|
257
257
|
}
|
|
258
|
-
function
|
|
258
|
+
function qe(e, t) {
|
|
259
259
|
if (e.length !== t.length)
|
|
260
260
|
return !1;
|
|
261
261
|
for (let n = 0; n < e.length; n++)
|
|
@@ -266,7 +266,7 @@ function Xe(e, t) {
|
|
|
266
266
|
function W(e, t) {
|
|
267
267
|
return L(e, t) ? 0 : e > t ? 1 : -1;
|
|
268
268
|
}
|
|
269
|
-
function
|
|
269
|
+
function F({
|
|
270
270
|
panelConstraints: e,
|
|
271
271
|
size: t
|
|
272
272
|
}) {
|
|
@@ -274,153 +274,153 @@ function _({
|
|
|
274
274
|
collapsedSize: n = 0,
|
|
275
275
|
collapsible: o,
|
|
276
276
|
maxSize: s = 100,
|
|
277
|
-
minSize:
|
|
277
|
+
minSize: r = 0
|
|
278
278
|
} = e;
|
|
279
|
-
if (W(t,
|
|
279
|
+
if (W(t, r) < 0)
|
|
280
280
|
if (o) {
|
|
281
|
-
const
|
|
282
|
-
W(t,
|
|
281
|
+
const c = (n + r) / 2;
|
|
282
|
+
W(t, c) < 0 ? t = n : t = r;
|
|
283
283
|
} else
|
|
284
|
-
t =
|
|
285
|
-
return t = Math.min(s, t), t =
|
|
284
|
+
t = r;
|
|
285
|
+
return t = Math.min(s, t), t = R(t), t;
|
|
286
286
|
}
|
|
287
|
-
function
|
|
287
|
+
function U({
|
|
288
288
|
delta: e,
|
|
289
289
|
initialLayout: t,
|
|
290
290
|
panelConstraints: n,
|
|
291
291
|
pivotIndices: o,
|
|
292
292
|
prevLayout: s,
|
|
293
|
-
trigger:
|
|
293
|
+
trigger: r
|
|
294
294
|
}) {
|
|
295
295
|
if (L(e, 0))
|
|
296
296
|
return t;
|
|
297
|
-
const
|
|
298
|
-
S(
|
|
297
|
+
const c = Object.values(t), i = Object.values(s), a = [...c], [l, u] = o;
|
|
298
|
+
S(l != null, "Invalid first pivot index"), S(u != null, "Invalid second pivot index");
|
|
299
299
|
let f = 0;
|
|
300
|
-
if (
|
|
300
|
+
if (r === "keyboard") {
|
|
301
301
|
{
|
|
302
|
-
const p = e < 0 ? u :
|
|
302
|
+
const p = e < 0 ? u : l, d = n[p];
|
|
303
303
|
S(
|
|
304
304
|
d,
|
|
305
305
|
`Panel constraints not found for index ${p}`
|
|
306
306
|
);
|
|
307
307
|
const {
|
|
308
308
|
collapsedSize: h = 0,
|
|
309
|
-
collapsible:
|
|
309
|
+
collapsible: y,
|
|
310
310
|
minSize: z = 0
|
|
311
311
|
} = d;
|
|
312
|
-
if (
|
|
313
|
-
const x =
|
|
312
|
+
if (y) {
|
|
313
|
+
const x = c[p];
|
|
314
314
|
if (S(
|
|
315
315
|
x != null,
|
|
316
316
|
`Previous layout not found for panel index ${p}`
|
|
317
317
|
), L(x, h)) {
|
|
318
|
-
const
|
|
319
|
-
W(
|
|
318
|
+
const g = z - x;
|
|
319
|
+
W(g, Math.abs(e)) > 0 && (e = e < 0 ? 0 - g : g);
|
|
320
320
|
}
|
|
321
321
|
}
|
|
322
322
|
}
|
|
323
323
|
{
|
|
324
|
-
const p = e < 0 ?
|
|
324
|
+
const p = e < 0 ? l : u, d = n[p];
|
|
325
325
|
S(
|
|
326
326
|
d,
|
|
327
327
|
`No panel constraints found for index ${p}`
|
|
328
328
|
);
|
|
329
329
|
const {
|
|
330
330
|
collapsedSize: h = 0,
|
|
331
|
-
collapsible:
|
|
331
|
+
collapsible: y,
|
|
332
332
|
minSize: z = 0
|
|
333
333
|
} = d;
|
|
334
|
-
if (
|
|
335
|
-
const x =
|
|
334
|
+
if (y) {
|
|
335
|
+
const x = c[p];
|
|
336
336
|
if (S(
|
|
337
337
|
x != null,
|
|
338
338
|
`Previous layout not found for panel index ${p}`
|
|
339
339
|
), L(x, z)) {
|
|
340
|
-
const
|
|
341
|
-
W(
|
|
340
|
+
const g = x - h;
|
|
341
|
+
W(g, Math.abs(e)) > 0 && (e = e < 0 ? 0 - g : g);
|
|
342
342
|
}
|
|
343
343
|
}
|
|
344
344
|
}
|
|
345
345
|
}
|
|
346
346
|
{
|
|
347
347
|
const p = e < 0 ? 1 : -1;
|
|
348
|
-
let d = e < 0 ? u :
|
|
348
|
+
let d = e < 0 ? u : l, h = 0;
|
|
349
349
|
for (; ; ) {
|
|
350
|
-
const z =
|
|
350
|
+
const z = c[d];
|
|
351
351
|
S(
|
|
352
352
|
z != null,
|
|
353
353
|
`Previous layout not found for panel index ${d}`
|
|
354
354
|
);
|
|
355
|
-
const
|
|
355
|
+
const g = F({
|
|
356
356
|
panelConstraints: n[d],
|
|
357
357
|
size: 100
|
|
358
358
|
}) - z;
|
|
359
|
-
if (h +=
|
|
359
|
+
if (h += g, d += p, d < 0 || d >= n.length)
|
|
360
360
|
break;
|
|
361
361
|
}
|
|
362
|
-
const
|
|
363
|
-
e = e < 0 ? 0 -
|
|
362
|
+
const y = Math.min(Math.abs(e), Math.abs(h));
|
|
363
|
+
e = e < 0 ? 0 - y : y;
|
|
364
364
|
}
|
|
365
365
|
{
|
|
366
|
-
let d = e < 0 ?
|
|
366
|
+
let d = e < 0 ? l : u;
|
|
367
367
|
for (; d >= 0 && d < n.length; ) {
|
|
368
|
-
const h = Math.abs(e) - Math.abs(f),
|
|
368
|
+
const h = Math.abs(e) - Math.abs(f), y = c[d];
|
|
369
369
|
S(
|
|
370
|
-
|
|
370
|
+
y != null,
|
|
371
371
|
`Previous layout not found for panel index ${d}`
|
|
372
372
|
);
|
|
373
|
-
const z =
|
|
373
|
+
const z = y - h, x = F({
|
|
374
374
|
panelConstraints: n[d],
|
|
375
375
|
size: z
|
|
376
376
|
});
|
|
377
|
-
if (!L(
|
|
377
|
+
if (!L(y, x) && (f += y - x, a[d] = x, f.toFixed(3).localeCompare(Math.abs(e).toFixed(3), void 0, {
|
|
378
378
|
numeric: !0
|
|
379
379
|
}) >= 0))
|
|
380
380
|
break;
|
|
381
381
|
e < 0 ? d-- : d++;
|
|
382
382
|
}
|
|
383
383
|
}
|
|
384
|
-
if (
|
|
384
|
+
if (qe(i, a))
|
|
385
385
|
return s;
|
|
386
386
|
{
|
|
387
|
-
const p = e < 0 ? u :
|
|
387
|
+
const p = e < 0 ? u : l, d = c[p];
|
|
388
388
|
S(
|
|
389
389
|
d != null,
|
|
390
390
|
`Previous layout not found for panel index ${p}`
|
|
391
391
|
);
|
|
392
|
-
const h = d + f,
|
|
392
|
+
const h = d + f, y = F({
|
|
393
393
|
panelConstraints: n[p],
|
|
394
394
|
size: h
|
|
395
395
|
});
|
|
396
|
-
if (
|
|
397
|
-
let z = h -
|
|
398
|
-
for (;
|
|
399
|
-
const w =
|
|
396
|
+
if (a[p] = y, !L(y, h)) {
|
|
397
|
+
let z = h - y, g = e < 0 ? u : l;
|
|
398
|
+
for (; g >= 0 && g < n.length; ) {
|
|
399
|
+
const w = a[g];
|
|
400
400
|
S(
|
|
401
401
|
w != null,
|
|
402
|
-
`Previous layout not found for panel index ${
|
|
402
|
+
`Previous layout not found for panel index ${g}`
|
|
403
403
|
);
|
|
404
|
-
const G = w + z, O =
|
|
405
|
-
panelConstraints: n[
|
|
404
|
+
const G = w + z, O = F({
|
|
405
|
+
panelConstraints: n[g],
|
|
406
406
|
size: G
|
|
407
407
|
});
|
|
408
|
-
if (L(w, O) || (z -= O - w,
|
|
408
|
+
if (L(w, O) || (z -= O - w, a[g] = O), L(z, 0))
|
|
409
409
|
break;
|
|
410
|
-
e > 0 ?
|
|
410
|
+
e > 0 ? g-- : g++;
|
|
411
411
|
}
|
|
412
412
|
}
|
|
413
413
|
}
|
|
414
|
-
const m = Object.values(
|
|
414
|
+
const m = Object.values(a).reduce(
|
|
415
415
|
(p, d) => d + p,
|
|
416
416
|
0
|
|
417
417
|
);
|
|
418
418
|
if (!L(m, 100, 0.1))
|
|
419
419
|
return s;
|
|
420
|
-
const
|
|
421
|
-
return
|
|
420
|
+
const v = Object.keys(s);
|
|
421
|
+
return a.reduce((p, d, h) => (p[v[h]] = d, p), {});
|
|
422
422
|
}
|
|
423
|
-
function
|
|
423
|
+
function ee(e) {
|
|
424
424
|
const t = e.parentElement;
|
|
425
425
|
S(t, "Parent group element not found");
|
|
426
426
|
const { mountedGroups: n } = k();
|
|
@@ -429,7 +429,7 @@ function J(e) {
|
|
|
429
429
|
return o;
|
|
430
430
|
throw Error("Could not find parent Group for separator element");
|
|
431
431
|
}
|
|
432
|
-
function
|
|
432
|
+
function B(e, t) {
|
|
433
433
|
if (Object.keys(e).length !== Object.keys(t).length)
|
|
434
434
|
return !1;
|
|
435
435
|
for (const n in e)
|
|
@@ -437,48 +437,48 @@ function ee(e, t) {
|
|
|
437
437
|
return !1;
|
|
438
438
|
return !0;
|
|
439
439
|
}
|
|
440
|
-
function
|
|
440
|
+
function $({
|
|
441
441
|
layout: e,
|
|
442
442
|
panelConstraints: t
|
|
443
443
|
}) {
|
|
444
444
|
const o = [...Object.values(e)], s = o.reduce(
|
|
445
|
-
(
|
|
445
|
+
(i, a) => i + a,
|
|
446
446
|
0
|
|
447
447
|
);
|
|
448
448
|
if (o.length !== t.length)
|
|
449
449
|
throw Error(
|
|
450
|
-
`Invalid ${t.length} panel layout: ${o.map((
|
|
450
|
+
`Invalid ${t.length} panel layout: ${o.map((i) => `${i}%`).join(", ")}`
|
|
451
451
|
);
|
|
452
452
|
if (!L(s, 100) && o.length > 0)
|
|
453
|
-
for (let
|
|
454
|
-
const
|
|
455
|
-
S(
|
|
456
|
-
const
|
|
457
|
-
o[
|
|
453
|
+
for (let i = 0; i < t.length; i++) {
|
|
454
|
+
const a = o[i];
|
|
455
|
+
S(a != null, `No layout data found for index ${i}`);
|
|
456
|
+
const l = 100 / s * a;
|
|
457
|
+
o[i] = l;
|
|
458
458
|
}
|
|
459
|
-
let
|
|
460
|
-
for (let
|
|
461
|
-
const
|
|
462
|
-
S(
|
|
463
|
-
const
|
|
464
|
-
panelConstraints: t[
|
|
465
|
-
size:
|
|
459
|
+
let r = 0;
|
|
460
|
+
for (let i = 0; i < t.length; i++) {
|
|
461
|
+
const a = o[i];
|
|
462
|
+
S(a != null, `No layout data found for index ${i}`);
|
|
463
|
+
const l = F({
|
|
464
|
+
panelConstraints: t[i],
|
|
465
|
+
size: a
|
|
466
466
|
});
|
|
467
|
-
|
|
467
|
+
a != l && (r += a - l, o[i] = l);
|
|
468
468
|
}
|
|
469
|
-
if (!L(
|
|
470
|
-
for (let
|
|
471
|
-
const
|
|
472
|
-
S(
|
|
473
|
-
const
|
|
474
|
-
panelConstraints: t[
|
|
475
|
-
size:
|
|
469
|
+
if (!L(r, 0))
|
|
470
|
+
for (let i = 0; i < t.length; i++) {
|
|
471
|
+
const a = o[i];
|
|
472
|
+
S(a != null, `No layout data found for index ${i}`);
|
|
473
|
+
const l = a + r, u = F({
|
|
474
|
+
panelConstraints: t[i],
|
|
475
|
+
size: l
|
|
476
476
|
});
|
|
477
|
-
if (
|
|
477
|
+
if (a !== u && (r -= u - a, o[i] = u, L(r, 0)))
|
|
478
478
|
break;
|
|
479
479
|
}
|
|
480
|
-
const
|
|
481
|
-
return o.reduce((
|
|
480
|
+
const c = Object.keys(e);
|
|
481
|
+
return o.reduce((i, a, l) => (i[c[l]] = a, i), {});
|
|
482
482
|
}
|
|
483
483
|
function be({
|
|
484
484
|
groupId: e
|
|
@@ -499,19 +499,19 @@ function be({
|
|
|
499
499
|
const {
|
|
500
500
|
derivedPanelConstraints: o,
|
|
501
501
|
group: s,
|
|
502
|
-
layout:
|
|
503
|
-
separatorToPanels:
|
|
504
|
-
} = t(),
|
|
502
|
+
layout: r,
|
|
503
|
+
separatorToPanels: c
|
|
504
|
+
} = t(), i = $({
|
|
505
505
|
layout: n,
|
|
506
506
|
panelConstraints: o
|
|
507
507
|
});
|
|
508
|
-
return
|
|
509
|
-
mountedGroups: new Map(
|
|
508
|
+
return B(r, i) || E((a) => ({
|
|
509
|
+
mountedGroups: new Map(a.mountedGroups).set(s, {
|
|
510
510
|
derivedPanelConstraints: o,
|
|
511
|
-
layout:
|
|
512
|
-
separatorToPanels:
|
|
511
|
+
layout: i,
|
|
512
|
+
separatorToPanels: c
|
|
513
513
|
})
|
|
514
|
-
})),
|
|
514
|
+
})), i;
|
|
515
515
|
}
|
|
516
516
|
};
|
|
517
517
|
}
|
|
@@ -519,25 +519,25 @@ function we(e) {
|
|
|
519
519
|
const { mountedGroups: t } = k(), n = t.get(e);
|
|
520
520
|
return S(n, `Mounted Group ${e.id} not found`), n;
|
|
521
521
|
}
|
|
522
|
-
function
|
|
523
|
-
const n =
|
|
522
|
+
function D(e, t) {
|
|
523
|
+
const n = ee(e), o = we(n), s = n.separators.find(
|
|
524
524
|
(f) => f.element === e
|
|
525
525
|
);
|
|
526
526
|
S(s, "Matching separator not found");
|
|
527
|
-
const
|
|
528
|
-
S(
|
|
529
|
-
const
|
|
527
|
+
const r = o.separatorToPanels.get(s);
|
|
528
|
+
S(r, "Matching panels not found");
|
|
529
|
+
const c = r.map((f) => n.panels.indexOf(f)), a = be({ groupId: n.id }).getLayout(), l = U({
|
|
530
530
|
delta: t,
|
|
531
|
-
initialLayout:
|
|
531
|
+
initialLayout: a,
|
|
532
532
|
panelConstraints: o.derivedPanelConstraints,
|
|
533
|
-
pivotIndices:
|
|
534
|
-
prevLayout:
|
|
533
|
+
pivotIndices: c,
|
|
534
|
+
prevLayout: a,
|
|
535
535
|
trigger: "keyboard"
|
|
536
|
-
}), u =
|
|
537
|
-
layout:
|
|
536
|
+
}), u = $({
|
|
537
|
+
layout: l,
|
|
538
538
|
panelConstraints: o.derivedPanelConstraints
|
|
539
539
|
});
|
|
540
|
-
|
|
540
|
+
B(a, u) || E((f) => ({
|
|
541
541
|
mountedGroups: new Map(f.mountedGroups).set(n, {
|
|
542
542
|
derivedPanelConstraints: o.derivedPanelConstraints,
|
|
543
543
|
layout: u,
|
|
@@ -548,70 +548,70 @@ function T(e, t) {
|
|
|
548
548
|
function me(e) {
|
|
549
549
|
if (e.defaultPrevented)
|
|
550
550
|
return;
|
|
551
|
-
const t = e.currentTarget, n =
|
|
551
|
+
const t = e.currentTarget, n = ee(t);
|
|
552
552
|
if (!n.disabled)
|
|
553
553
|
switch (e.key) {
|
|
554
554
|
case "ArrowDown": {
|
|
555
|
-
e.preventDefault(), n.orientation === "vertical" &&
|
|
555
|
+
e.preventDefault(), n.orientation === "vertical" && D(t, 5);
|
|
556
556
|
break;
|
|
557
557
|
}
|
|
558
558
|
case "ArrowLeft": {
|
|
559
|
-
e.preventDefault(), n.orientation === "horizontal" &&
|
|
559
|
+
e.preventDefault(), n.orientation === "horizontal" && D(t, -5);
|
|
560
560
|
break;
|
|
561
561
|
}
|
|
562
562
|
case "ArrowRight": {
|
|
563
|
-
e.preventDefault(), n.orientation === "horizontal" &&
|
|
563
|
+
e.preventDefault(), n.orientation === "horizontal" && D(t, 5);
|
|
564
564
|
break;
|
|
565
565
|
}
|
|
566
566
|
case "ArrowUp": {
|
|
567
|
-
e.preventDefault(), n.orientation === "vertical" &&
|
|
567
|
+
e.preventDefault(), n.orientation === "vertical" && D(t, -5);
|
|
568
568
|
break;
|
|
569
569
|
}
|
|
570
570
|
case "End": {
|
|
571
|
-
e.preventDefault(),
|
|
571
|
+
e.preventDefault(), D(t, 100);
|
|
572
572
|
break;
|
|
573
573
|
}
|
|
574
574
|
case "Enter": {
|
|
575
575
|
e.preventDefault();
|
|
576
|
-
const o =
|
|
576
|
+
const o = ee(t), { derivedPanelConstraints: s, layout: r, separatorToPanels: c } = we(o), i = o.separators.find(
|
|
577
577
|
(f) => f.element === t
|
|
578
578
|
);
|
|
579
|
-
S(
|
|
580
|
-
const
|
|
581
|
-
S(
|
|
582
|
-
const
|
|
583
|
-
(f) => f.panelId ===
|
|
579
|
+
S(i, "Matching separator not found");
|
|
580
|
+
const a = c.get(i);
|
|
581
|
+
S(a, "Matching panels not found");
|
|
582
|
+
const l = a[0], u = s.find(
|
|
583
|
+
(f) => f.panelId === l.id
|
|
584
584
|
);
|
|
585
585
|
if (S(u, "Panel metadata not found"), u.collapsible) {
|
|
586
|
-
const f =
|
|
587
|
-
|
|
586
|
+
const f = r[l.id], m = u.collapsedSize === f ? o.inMemoryLastExpandedPanelSizes[l.id] ?? u.minSize : u.collapsedSize;
|
|
587
|
+
D(t, m - f);
|
|
588
588
|
}
|
|
589
589
|
break;
|
|
590
590
|
}
|
|
591
591
|
case "F6": {
|
|
592
592
|
e.preventDefault();
|
|
593
|
-
const s =
|
|
594
|
-
(
|
|
595
|
-
),
|
|
596
|
-
(
|
|
593
|
+
const s = ee(t).separators.map(
|
|
594
|
+
(a) => a.element
|
|
595
|
+
), r = Array.from(s).findIndex(
|
|
596
|
+
(a) => a === e.currentTarget
|
|
597
597
|
);
|
|
598
|
-
S(
|
|
599
|
-
const
|
|
600
|
-
s[
|
|
598
|
+
S(r !== null, "Index not found");
|
|
599
|
+
const c = e.shiftKey ? r > 0 ? r - 1 : s.length - 1 : r + 1 < s.length ? r + 1 : 0;
|
|
600
|
+
s[c].focus();
|
|
601
601
|
break;
|
|
602
602
|
}
|
|
603
603
|
case "Home": {
|
|
604
|
-
e.preventDefault(),
|
|
604
|
+
e.preventDefault(), D(t, -100);
|
|
605
605
|
break;
|
|
606
606
|
}
|
|
607
607
|
}
|
|
608
608
|
}
|
|
609
|
-
const
|
|
610
|
-
}, Le = 1, Pe = 2, Ee = 4,
|
|
609
|
+
const Xe = (e) => e, oe = () => {
|
|
610
|
+
}, Le = 1, Pe = 2, Ee = 4, Ce = 8, he = {
|
|
611
611
|
coarse: 10,
|
|
612
612
|
precise: 5
|
|
613
613
|
};
|
|
614
|
-
function
|
|
614
|
+
function Ye(e, t) {
|
|
615
615
|
return {
|
|
616
616
|
x: e.x >= t.left && e.x <= t.right ? 0 : Math.min(
|
|
617
617
|
Math.abs(e.x - t.left),
|
|
@@ -623,20 +623,20 @@ function Ze(e, t) {
|
|
|
623
623
|
)
|
|
624
624
|
};
|
|
625
625
|
}
|
|
626
|
-
function
|
|
626
|
+
function Ze(e, t, n) {
|
|
627
627
|
let o, s = {
|
|
628
628
|
x: 1 / 0,
|
|
629
629
|
y: 1 / 0
|
|
630
630
|
};
|
|
631
|
-
for (const
|
|
632
|
-
const
|
|
631
|
+
for (const r of t) {
|
|
632
|
+
const c = Ye(n, r.rect);
|
|
633
633
|
switch (e) {
|
|
634
634
|
case "horizontal": {
|
|
635
|
-
|
|
635
|
+
c.x <= s.x && (o = r, s = c);
|
|
636
636
|
break;
|
|
637
637
|
}
|
|
638
638
|
case "vertical": {
|
|
639
|
-
|
|
639
|
+
c.y <= s.y && (o = r, s = c);
|
|
640
640
|
break;
|
|
641
641
|
}
|
|
642
642
|
}
|
|
@@ -646,36 +646,36 @@ function qe(e, t, n) {
|
|
|
646
646
|
hitRegion: o
|
|
647
647
|
} : void 0;
|
|
648
648
|
}
|
|
649
|
-
let
|
|
649
|
+
let J;
|
|
650
650
|
function Je() {
|
|
651
|
-
return
|
|
651
|
+
return J === void 0 && (typeof matchMedia == "function" ? J = !!matchMedia("(pointer:coarse)").matches : J = !1), J;
|
|
652
652
|
}
|
|
653
|
-
function
|
|
653
|
+
function Me(e, t) {
|
|
654
654
|
const n = [];
|
|
655
655
|
return t.forEach((o, s) => {
|
|
656
656
|
if (s.disabled)
|
|
657
657
|
return;
|
|
658
|
-
const
|
|
658
|
+
const r = Je() ? he.coarse : he.precise, c = ze(s), i = Ze(s.orientation, c, {
|
|
659
659
|
x: e.clientX,
|
|
660
660
|
y: e.clientY
|
|
661
661
|
});
|
|
662
|
-
|
|
662
|
+
i && i.distance.x <= r && i.distance.y <= r && n.push(i.hitRegion);
|
|
663
663
|
}), n;
|
|
664
664
|
}
|
|
665
665
|
function ve(e) {
|
|
666
666
|
if (e.defaultPrevented)
|
|
667
667
|
return;
|
|
668
|
-
const { mountedGroups: t } = k(), n =
|
|
669
|
-
n.forEach((
|
|
670
|
-
o.add(
|
|
671
|
-
s.add(
|
|
672
|
-
}),
|
|
673
|
-
const
|
|
674
|
-
|
|
675
|
-
}),
|
|
668
|
+
const { mountedGroups: t } = k(), n = Me(e, t), o = /* @__PURE__ */ new Set(), s = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), c = /* @__PURE__ */ new Map();
|
|
669
|
+
n.forEach((i) => {
|
|
670
|
+
o.add(i.group), i.panels.forEach((l) => {
|
|
671
|
+
s.add(l);
|
|
672
|
+
}), i.separator && r.add(i.separator);
|
|
673
|
+
const a = t.get(i.group);
|
|
674
|
+
a && c.set(i.group, a.layout);
|
|
675
|
+
}), E({
|
|
676
676
|
interactionState: {
|
|
677
677
|
hitRegions: n,
|
|
678
|
-
initialLayoutMap:
|
|
678
|
+
initialLayoutMap: c,
|
|
679
679
|
pointerDownAtPoint: { x: e.clientX, y: e.clientY },
|
|
680
680
|
state: "active"
|
|
681
681
|
}
|
|
@@ -690,9 +690,9 @@ function Qe({
|
|
|
690
690
|
switch (n) {
|
|
691
691
|
case "active":
|
|
692
692
|
case "hover":
|
|
693
|
-
t.forEach((
|
|
694
|
-
if (!
|
|
695
|
-
switch (
|
|
693
|
+
t.forEach((r) => {
|
|
694
|
+
if (!r.disableCursor)
|
|
695
|
+
switch (r.orientation) {
|
|
696
696
|
case "horizontal": {
|
|
697
697
|
o++;
|
|
698
698
|
break;
|
|
@@ -708,15 +708,15 @@ function Qe({
|
|
|
708
708
|
return null;
|
|
709
709
|
switch (n) {
|
|
710
710
|
case "active": {
|
|
711
|
-
const
|
|
711
|
+
const r = (e & Le) !== 0, c = (e & Pe) !== 0, i = (e & Ee) !== 0, a = (e & Ce) !== 0;
|
|
712
712
|
if (e) {
|
|
713
|
-
if (i)
|
|
714
|
-
return r ? "se-resize" : l ? "ne-resize" : "e-resize";
|
|
715
|
-
if (a)
|
|
716
|
-
return r ? "sw-resize" : l ? "nw-resize" : "w-resize";
|
|
717
713
|
if (r)
|
|
714
|
+
return i ? "se-resize" : a ? "ne-resize" : "e-resize";
|
|
715
|
+
if (c)
|
|
716
|
+
return i ? "sw-resize" : a ? "nw-resize" : "w-resize";
|
|
717
|
+
if (i)
|
|
718
718
|
return "s-resize";
|
|
719
|
-
if (
|
|
719
|
+
if (a)
|
|
720
720
|
return "n-resize";
|
|
721
721
|
}
|
|
722
722
|
break;
|
|
@@ -747,7 +747,7 @@ function se() {
|
|
|
747
747
|
}
|
|
748
748
|
}
|
|
749
749
|
}
|
|
750
|
-
function
|
|
750
|
+
function Q(e) {
|
|
751
751
|
if (e.defaultPrevented)
|
|
752
752
|
return;
|
|
753
753
|
const { interactionState: t, mountedGroups: n } = k();
|
|
@@ -757,8 +757,8 @@ function q(e) {
|
|
|
757
757
|
// Skip this check for "pointerleave" events, else Firefox triggers a false positive (see #514)
|
|
758
758
|
e.type !== "pointerleave" && e.buttons === 0
|
|
759
759
|
) {
|
|
760
|
-
|
|
761
|
-
(
|
|
760
|
+
E(
|
|
761
|
+
(r) => r.interactionState.state === "inactive" ? r : {
|
|
762
762
|
cursorFlags: 0,
|
|
763
763
|
interactionState: {
|
|
764
764
|
state: "inactive"
|
|
@@ -769,59 +769,59 @@ function q(e) {
|
|
|
769
769
|
}
|
|
770
770
|
let o = 0;
|
|
771
771
|
const s = new Map(n);
|
|
772
|
-
t.hitRegions.forEach((
|
|
773
|
-
const { disableCursor:
|
|
772
|
+
t.hitRegions.forEach((r) => {
|
|
773
|
+
const { disableCursor: c, element: i, orientation: a, panels: l } = r.group;
|
|
774
774
|
let u = 0;
|
|
775
|
-
t.state === "active" && (
|
|
775
|
+
t.state === "active" && (a === "horizontal" ? u = (e.clientX - t.pointerDownAtPoint.x) / i.offsetWidth * 100 : u = (e.clientY - t.pointerDownAtPoint.y) / i.offsetHeight * 100);
|
|
776
776
|
const f = t.initialLayoutMap.get(
|
|
777
|
-
|
|
777
|
+
r.group
|
|
778
778
|
), {
|
|
779
779
|
derivedPanelConstraints: m,
|
|
780
|
-
layout:
|
|
780
|
+
layout: v,
|
|
781
781
|
separatorToPanels: p
|
|
782
|
-
} = n.get(
|
|
783
|
-
if (m && f &&
|
|
784
|
-
const d =
|
|
782
|
+
} = n.get(r.group) ?? {};
|
|
783
|
+
if (m && f && v && p) {
|
|
784
|
+
const d = U({
|
|
785
785
|
delta: u,
|
|
786
786
|
initialLayout: f,
|
|
787
787
|
panelConstraints: m,
|
|
788
|
-
pivotIndices:
|
|
789
|
-
prevLayout:
|
|
788
|
+
pivotIndices: r.panels.map((h) => l.indexOf(h)),
|
|
789
|
+
prevLayout: v,
|
|
790
790
|
trigger: "mouse-or-touch"
|
|
791
791
|
});
|
|
792
|
-
if (
|
|
793
|
-
if (u !== 0 && !
|
|
794
|
-
switch (
|
|
792
|
+
if (B(d, v)) {
|
|
793
|
+
if (u !== 0 && !c)
|
|
794
|
+
switch (a) {
|
|
795
795
|
case "horizontal": {
|
|
796
796
|
o |= u < 0 ? Le : Pe;
|
|
797
797
|
break;
|
|
798
798
|
}
|
|
799
799
|
case "vertical": {
|
|
800
|
-
o |= u < 0 ? Ee :
|
|
800
|
+
o |= u < 0 ? Ee : Ce;
|
|
801
801
|
break;
|
|
802
802
|
}
|
|
803
803
|
}
|
|
804
804
|
} else {
|
|
805
|
-
s.set(
|
|
805
|
+
s.set(r.group, {
|
|
806
806
|
derivedPanelConstraints: m,
|
|
807
807
|
layout: d,
|
|
808
808
|
separatorToPanels: p
|
|
809
809
|
});
|
|
810
|
-
const h =
|
|
811
|
-
|
|
810
|
+
const h = r.group.panels.map(({ id: y }) => y).join(",");
|
|
811
|
+
r.group.inMemoryLayouts[h] = d;
|
|
812
812
|
}
|
|
813
813
|
}
|
|
814
|
-
}),
|
|
814
|
+
}), E({
|
|
815
815
|
cursorFlags: o,
|
|
816
816
|
mountedGroups: s
|
|
817
817
|
}), se();
|
|
818
818
|
break;
|
|
819
819
|
}
|
|
820
820
|
default: {
|
|
821
|
-
const o =
|
|
822
|
-
o.length === 0 ? t.state !== "inactive" &&
|
|
821
|
+
const o = Me(e, n);
|
|
822
|
+
o.length === 0 ? t.state !== "inactive" && E({
|
|
823
823
|
interactionState: { state: "inactive" }
|
|
824
|
-
}) :
|
|
824
|
+
}) : E({
|
|
825
825
|
interactionState: {
|
|
826
826
|
hitRegions: o,
|
|
827
827
|
state: "hover"
|
|
@@ -838,7 +838,7 @@ function ye(e) {
|
|
|
838
838
|
const { interactionState: t } = k();
|
|
839
839
|
switch (t.state) {
|
|
840
840
|
case "active":
|
|
841
|
-
|
|
841
|
+
E({
|
|
842
842
|
cursorFlags: 0,
|
|
843
843
|
interactionState: {
|
|
844
844
|
state: "inactive"
|
|
@@ -849,18 +849,18 @@ function ye(e) {
|
|
|
849
849
|
function et(e) {
|
|
850
850
|
let t = 0, n = 0;
|
|
851
851
|
const o = {};
|
|
852
|
-
for (const
|
|
853
|
-
if (
|
|
852
|
+
for (const r of e)
|
|
853
|
+
if (r.defaultSize !== void 0) {
|
|
854
854
|
t++;
|
|
855
|
-
const
|
|
856
|
-
n +=
|
|
855
|
+
const c = R(r.defaultSize);
|
|
856
|
+
n += c, o[r.panelId] = c;
|
|
857
857
|
} else
|
|
858
|
-
o[
|
|
858
|
+
o[r.panelId] = void 0;
|
|
859
859
|
const s = e.length - t;
|
|
860
860
|
if (s !== 0) {
|
|
861
|
-
const
|
|
862
|
-
for (const
|
|
863
|
-
|
|
861
|
+
const r = R((100 - n) / s);
|
|
862
|
+
for (const c of e)
|
|
863
|
+
c.defaultSize === void 0 && (o[c.panelId] = r);
|
|
864
864
|
}
|
|
865
865
|
return o;
|
|
866
866
|
}
|
|
@@ -868,14 +868,14 @@ function tt(e, t, n) {
|
|
|
868
868
|
const o = n[0];
|
|
869
869
|
if (!o)
|
|
870
870
|
return;
|
|
871
|
-
const s = e.panels.find((
|
|
871
|
+
const s = e.panels.find((c) => c.element === t);
|
|
872
872
|
if (!s || !s.onResize)
|
|
873
873
|
return;
|
|
874
|
-
const
|
|
874
|
+
const r = le({ group: e });
|
|
875
875
|
s.onResize(
|
|
876
876
|
{
|
|
877
|
-
asPercentage:
|
|
878
|
-
o.inlineSize /
|
|
877
|
+
asPercentage: R(
|
|
878
|
+
o.inlineSize / r * 100
|
|
879
879
|
),
|
|
880
880
|
inPixels: o.inlineSize
|
|
881
881
|
},
|
|
@@ -884,63 +884,73 @@ function tt(e, t, n) {
|
|
|
884
884
|
}
|
|
885
885
|
function nt(e) {
|
|
886
886
|
let t = !0;
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
887
|
+
S(
|
|
888
|
+
e.separators.length === 0 || e.separators.length < e.panels.length,
|
|
889
|
+
"Invalid Group configuration; too many Separator components"
|
|
890
|
+
);
|
|
891
|
+
const n = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Set(), s = new ResizeObserver((f) => {
|
|
892
|
+
for (const m of f) {
|
|
893
|
+
const { borderBoxSize: v, target: p } = m;
|
|
894
|
+
p === e.element ? t && E((d) => {
|
|
895
|
+
const h = d.mountedGroups.get(e);
|
|
896
|
+
if (h) {
|
|
897
|
+
const y = pe(e), z = h.layout, x = $({
|
|
898
|
+
layout: z,
|
|
899
|
+
panelConstraints: y
|
|
896
900
|
});
|
|
897
901
|
return {
|
|
898
|
-
mountedGroups: new Map(
|
|
899
|
-
derivedPanelConstraints:
|
|
900
|
-
layout:
|
|
901
|
-
separatorToPanels:
|
|
902
|
+
mountedGroups: new Map(d.mountedGroups).set(e, {
|
|
903
|
+
derivedPanelConstraints: y,
|
|
904
|
+
layout: x,
|
|
905
|
+
separatorToPanels: h.separatorToPanels
|
|
902
906
|
})
|
|
903
907
|
};
|
|
904
908
|
}
|
|
905
|
-
return
|
|
906
|
-
}) : tt(e,
|
|
909
|
+
return d;
|
|
910
|
+
}) : tt(e, p, v);
|
|
907
911
|
}
|
|
908
912
|
});
|
|
909
|
-
|
|
910
|
-
|
|
913
|
+
s.observe(e.element), e.panels.forEach((f) => {
|
|
914
|
+
S(
|
|
915
|
+
!n.has(f.id),
|
|
916
|
+
`Panel ids must be unique; id "${f.id}" was used more than once`
|
|
917
|
+
), n.add(f.id), f.onResize && s.observe(f.element);
|
|
911
918
|
});
|
|
912
|
-
const
|
|
919
|
+
const r = pe(e), c = e.panels.map(({ id: f }) => f).join(","), i = e.inMemoryLayouts[c] ?? e.defaultLayout ?? et(r), a = $({
|
|
913
920
|
layout: i,
|
|
914
|
-
panelConstraints:
|
|
915
|
-
}),
|
|
916
|
-
mountedGroups: new Map(
|
|
917
|
-
derivedPanelConstraints:
|
|
921
|
+
panelConstraints: r
|
|
922
|
+
}), l = ze(e), u = E((f) => ({
|
|
923
|
+
mountedGroups: new Map(f.mountedGroups).set(e, {
|
|
924
|
+
derivedPanelConstraints: r,
|
|
918
925
|
layout: a,
|
|
919
926
|
separatorToPanels: new Map(
|
|
920
|
-
|
|
927
|
+
l.filter((m) => m.separator).map((m) => [m.separator, m.panels])
|
|
921
928
|
)
|
|
922
929
|
})
|
|
923
930
|
}));
|
|
924
|
-
return e.separators.forEach((
|
|
925
|
-
|
|
926
|
-
|
|
931
|
+
return e.separators.forEach((f) => {
|
|
932
|
+
S(
|
|
933
|
+
!o.has(f.id),
|
|
934
|
+
`Separator ids must be unique; id "${f.id}" was used more than once`
|
|
935
|
+
), o.add(f.id), f.element.addEventListener("keydown", me);
|
|
936
|
+
}), u.mountedGroups.size === 1 && (window.addEventListener("pointerdown", ve), window.addEventListener("pointerleave", Q), window.addEventListener("pointermove", Q), window.addEventListener("pointerup", ye)), function() {
|
|
927
937
|
t = !1;
|
|
928
|
-
const
|
|
929
|
-
const
|
|
930
|
-
return
|
|
938
|
+
const m = E((v) => {
|
|
939
|
+
const p = new Map(v.mountedGroups);
|
|
940
|
+
return p.delete(e), { mountedGroups: p };
|
|
931
941
|
});
|
|
932
|
-
e.separators.forEach((
|
|
933
|
-
|
|
934
|
-
}),
|
|
942
|
+
e.separators.forEach((v) => {
|
|
943
|
+
v.element.removeEventListener("keydown", me);
|
|
944
|
+
}), m.mountedGroups.size === 0 && (window.removeEventListener("pointerdown", ve), window.removeEventListener("pointerleave", Q), window.removeEventListener("pointermove", Q), window.removeEventListener("pointerup", ye)), s.disconnect();
|
|
935
945
|
};
|
|
936
946
|
}
|
|
937
947
|
function ce(e) {
|
|
938
|
-
const t =
|
|
948
|
+
const t = Te();
|
|
939
949
|
return `${e ?? t}`;
|
|
940
950
|
}
|
|
941
|
-
const H = typeof window < "u" ?
|
|
951
|
+
const H = typeof window < "u" ? De : Ae;
|
|
942
952
|
function ue(e) {
|
|
943
|
-
const t =
|
|
953
|
+
const t = T(e);
|
|
944
954
|
return H(() => {
|
|
945
955
|
t.current = e;
|
|
946
956
|
}, [e]), ge((n) => t.current?.(n), [t]);
|
|
@@ -962,16 +972,16 @@ function fe(...e) {
|
|
|
962
972
|
});
|
|
963
973
|
});
|
|
964
974
|
}
|
|
965
|
-
const
|
|
975
|
+
const Re = "--react-resizable-panels--panel--pointer-events";
|
|
966
976
|
function Ge(e, t) {
|
|
967
977
|
const n = e.replace(/[^a-zA-Z0-9\-_]/g, ""), o = t.replace(/[^a-zA-Z0-9\-_]/g, "");
|
|
968
978
|
return `--react-resizable-panels--${n}--${o}`;
|
|
969
979
|
}
|
|
970
980
|
const Ie = $e(null);
|
|
971
981
|
function ot(e, t) {
|
|
972
|
-
const n =
|
|
982
|
+
const n = T({
|
|
973
983
|
getLayout: () => ({}),
|
|
974
|
-
setLayout:
|
|
984
|
+
setLayout: Xe
|
|
975
985
|
});
|
|
976
986
|
Se(t, () => n.current, []), H(() => {
|
|
977
987
|
Object.assign(
|
|
@@ -986,58 +996,58 @@ function ft({
|
|
|
986
996
|
defaultLayout: n,
|
|
987
997
|
disableCursor: o,
|
|
988
998
|
disabled: s,
|
|
989
|
-
elementRef:
|
|
990
|
-
groupRef:
|
|
991
|
-
id:
|
|
992
|
-
onLayoutChange:
|
|
993
|
-
orientation:
|
|
999
|
+
elementRef: r,
|
|
1000
|
+
groupRef: c,
|
|
1001
|
+
id: i,
|
|
1002
|
+
onLayoutChange: a,
|
|
1003
|
+
orientation: l = "horizontal",
|
|
994
1004
|
style: u
|
|
995
1005
|
}) {
|
|
996
|
-
const f =
|
|
997
|
-
|
|
998
|
-
}),
|
|
999
|
-
ot(
|
|
1000
|
-
const
|
|
1006
|
+
const f = T({}), m = ue((b) => {
|
|
1007
|
+
B(f.current, b) || (f.current = b, a?.(b));
|
|
1008
|
+
}), v = ce(i), [p, d] = M(!1), [h, y] = M(null), [z, x] = M(n ?? {}), [g, w] = M([]), [G, O] = M([]), te = T({}), K = T({}), V = fe(y, r);
|
|
1009
|
+
ot(v, c);
|
|
1010
|
+
const q = xe(
|
|
1001
1011
|
() => ({
|
|
1002
|
-
id:
|
|
1003
|
-
orientation:
|
|
1004
|
-
registerPanel: (b) => (w((
|
|
1005
|
-
w((
|
|
1012
|
+
id: v,
|
|
1013
|
+
orientation: l,
|
|
1014
|
+
registerPanel: (b) => (w((C) => re(l, [...C, b])), () => {
|
|
1015
|
+
w((C) => C.filter((N) => N !== b));
|
|
1006
1016
|
}),
|
|
1007
1017
|
registerSeparator: (b) => (O(
|
|
1008
|
-
(
|
|
1018
|
+
(C) => re(l, [...C, b])
|
|
1009
1019
|
), () => {
|
|
1010
1020
|
O(
|
|
1011
|
-
(
|
|
1021
|
+
(C) => C.filter((N) => N !== b)
|
|
1012
1022
|
);
|
|
1013
1023
|
})
|
|
1014
1024
|
}),
|
|
1015
|
-
[
|
|
1025
|
+
[v, l]
|
|
1016
1026
|
);
|
|
1017
1027
|
H(() => {
|
|
1018
|
-
if (h !== null &&
|
|
1028
|
+
if (h !== null && g.length > 0) {
|
|
1019
1029
|
const b = {
|
|
1020
1030
|
defaultLayout: n,
|
|
1021
1031
|
disableCursor: !!o,
|
|
1022
1032
|
disabled: !!s,
|
|
1023
1033
|
element: h,
|
|
1024
|
-
id:
|
|
1034
|
+
id: v,
|
|
1025
1035
|
inMemoryLastExpandedPanelSizes: te.current,
|
|
1026
|
-
inMemoryLayouts:
|
|
1027
|
-
orientation:
|
|
1028
|
-
panels:
|
|
1036
|
+
inMemoryLayouts: K.current,
|
|
1037
|
+
orientation: l,
|
|
1038
|
+
panels: g,
|
|
1029
1039
|
separators: G
|
|
1030
|
-
},
|
|
1040
|
+
}, C = nt(b), ne = k().mountedGroups.get(b);
|
|
1031
1041
|
ne && (x(ne.layout), m?.(ne.layout));
|
|
1032
1042
|
const ke = A.addListener(
|
|
1033
1043
|
"interactionStateChange",
|
|
1034
|
-
(
|
|
1035
|
-
switch (
|
|
1044
|
+
(Y) => {
|
|
1045
|
+
switch (Y.state) {
|
|
1036
1046
|
case "active":
|
|
1037
1047
|
case "hover": {
|
|
1038
1048
|
d(
|
|
1039
|
-
|
|
1040
|
-
(
|
|
1049
|
+
Y.hitRegions.some(
|
|
1050
|
+
(_) => _.group === b
|
|
1041
1051
|
)
|
|
1042
1052
|
);
|
|
1043
1053
|
break;
|
|
@@ -1046,13 +1056,13 @@ function ft({
|
|
|
1046
1056
|
}
|
|
1047
1057
|
), Oe = A.addListener(
|
|
1048
1058
|
"mountedGroupsChange",
|
|
1049
|
-
(
|
|
1050
|
-
const
|
|
1051
|
-
|
|
1059
|
+
(Y) => {
|
|
1060
|
+
const _ = Y.get(b);
|
|
1061
|
+
_ && _.derivedPanelConstraints.length > 0 && (x(_.layout), m?.(_.layout));
|
|
1052
1062
|
}
|
|
1053
1063
|
);
|
|
1054
1064
|
return () => {
|
|
1055
|
-
|
|
1065
|
+
C(), ke(), Oe();
|
|
1056
1066
|
};
|
|
1057
1067
|
}
|
|
1058
1068
|
}, [
|
|
@@ -1060,32 +1070,32 @@ function ft({
|
|
|
1060
1070
|
o,
|
|
1061
1071
|
s,
|
|
1062
1072
|
h,
|
|
1063
|
-
|
|
1073
|
+
v,
|
|
1064
1074
|
m,
|
|
1065
|
-
|
|
1066
|
-
|
|
1075
|
+
l,
|
|
1076
|
+
g,
|
|
1067
1077
|
G
|
|
1068
1078
|
]);
|
|
1069
|
-
const
|
|
1070
|
-
[
|
|
1079
|
+
const X = {
|
|
1080
|
+
[Re]: p ? "none" : void 0
|
|
1071
1081
|
};
|
|
1072
1082
|
for (const b in z) {
|
|
1073
|
-
const
|
|
1074
|
-
|
|
1083
|
+
const C = Ge(v, b), N = z[b];
|
|
1084
|
+
X[C] = N;
|
|
1075
1085
|
}
|
|
1076
|
-
return /* @__PURE__ */ j(Ie.Provider, { value:
|
|
1086
|
+
return /* @__PURE__ */ j(Ie.Provider, { value: q, children: /* @__PURE__ */ j(
|
|
1077
1087
|
"div",
|
|
1078
1088
|
{
|
|
1079
|
-
"aria-orientation":
|
|
1089
|
+
"aria-orientation": l,
|
|
1080
1090
|
className: t,
|
|
1081
1091
|
"data-group": !0,
|
|
1082
|
-
"data-testid":
|
|
1083
|
-
ref:
|
|
1092
|
+
"data-testid": i ?? void 0,
|
|
1093
|
+
ref: V,
|
|
1084
1094
|
style: {
|
|
1085
1095
|
...u,
|
|
1086
|
-
...
|
|
1096
|
+
...X,
|
|
1087
1097
|
display: "flex",
|
|
1088
|
-
flexDirection:
|
|
1098
|
+
flexDirection: l === "horizontal" ? "row" : "column",
|
|
1089
1099
|
flexWrap: "nowrap"
|
|
1090
1100
|
},
|
|
1091
1101
|
children: e
|
|
@@ -1119,9 +1129,9 @@ function dt({
|
|
|
1119
1129
|
() => n ? JSON.parse(n) : null,
|
|
1120
1130
|
[n]
|
|
1121
1131
|
), s = ge(
|
|
1122
|
-
(
|
|
1132
|
+
(r) => it({
|
|
1123
1133
|
id: e,
|
|
1124
|
-
layout:
|
|
1134
|
+
layout: r,
|
|
1125
1135
|
storage: t
|
|
1126
1136
|
}),
|
|
1127
1137
|
[e, t]
|
|
@@ -1136,77 +1146,117 @@ function rt() {
|
|
|
1136
1146
|
};
|
|
1137
1147
|
}
|
|
1138
1148
|
function pt() {
|
|
1139
|
-
return
|
|
1149
|
+
return M(null);
|
|
1140
1150
|
}
|
|
1141
1151
|
function mt() {
|
|
1142
|
-
return
|
|
1152
|
+
return T(null);
|
|
1143
1153
|
}
|
|
1144
1154
|
function de() {
|
|
1145
1155
|
const e = _e(Ie);
|
|
1146
|
-
return S(
|
|
1156
|
+
return S(
|
|
1157
|
+
e,
|
|
1158
|
+
"Group Context not found; did you render a Panel or Separator outside of a Group?"
|
|
1159
|
+
), e;
|
|
1147
1160
|
}
|
|
1148
1161
|
function st({
|
|
1149
1162
|
groupId: e,
|
|
1150
1163
|
panelId: t
|
|
1151
1164
|
}) {
|
|
1152
1165
|
const n = () => {
|
|
1153
|
-
const { mountedGroups:
|
|
1154
|
-
for (const [
|
|
1155
|
-
|
|
1156
|
-
|
|
1166
|
+
const { mountedGroups: i } = k();
|
|
1167
|
+
for (const [
|
|
1168
|
+
a,
|
|
1169
|
+
{ derivedPanelConstraints: l, layout: u, separatorToPanels: f }
|
|
1170
|
+
] of i)
|
|
1171
|
+
if (a.id === e)
|
|
1172
|
+
return { derivedPanelConstraints: l, group: a, layout: u, separatorToPanels: f };
|
|
1157
1173
|
throw Error(`Group ${e} not found`);
|
|
1158
1174
|
}, o = () => {
|
|
1159
|
-
const
|
|
1160
|
-
(
|
|
1175
|
+
const i = n().derivedPanelConstraints.find(
|
|
1176
|
+
(a) => a.panelId === t
|
|
1161
1177
|
);
|
|
1162
|
-
if (
|
|
1163
|
-
return
|
|
1178
|
+
if (i !== void 0)
|
|
1179
|
+
return i;
|
|
1164
1180
|
throw Error(`Panel constraints not found for Panel ${t}`);
|
|
1165
1181
|
}, s = () => {
|
|
1166
|
-
const
|
|
1167
|
-
if (
|
|
1168
|
-
return
|
|
1182
|
+
const i = n().group.panels.find((a) => a.id === t);
|
|
1183
|
+
if (i !== void 0)
|
|
1184
|
+
return i;
|
|
1169
1185
|
throw Error(`Layout not found for Panel ${t}`);
|
|
1170
|
-
},
|
|
1171
|
-
const
|
|
1172
|
-
if (
|
|
1173
|
-
return
|
|
1186
|
+
}, r = () => {
|
|
1187
|
+
const i = n().layout[t];
|
|
1188
|
+
if (i !== void 0)
|
|
1189
|
+
return i;
|
|
1174
1190
|
throw Error(`Layout not found for Panel ${t}`);
|
|
1191
|
+
}, c = (i) => {
|
|
1192
|
+
const a = r();
|
|
1193
|
+
if (i === a)
|
|
1194
|
+
return;
|
|
1195
|
+
const {
|
|
1196
|
+
derivedPanelConstraints: l,
|
|
1197
|
+
group: u,
|
|
1198
|
+
layout: f,
|
|
1199
|
+
separatorToPanels: m
|
|
1200
|
+
} = n(), v = u.panels.findIndex((y) => y.id === t), p = v === u.panels.length - 1, d = U({
|
|
1201
|
+
delta: p ? a - i : i - a,
|
|
1202
|
+
initialLayout: f,
|
|
1203
|
+
panelConstraints: l,
|
|
1204
|
+
pivotIndices: p ? [v - 1, v] : [v, v + 1],
|
|
1205
|
+
prevLayout: f,
|
|
1206
|
+
trigger: "imperative-api"
|
|
1207
|
+
}), h = $({
|
|
1208
|
+
layout: d,
|
|
1209
|
+
panelConstraints: l
|
|
1210
|
+
});
|
|
1211
|
+
B(f, h) || E((y) => ({
|
|
1212
|
+
mountedGroups: new Map(y.mountedGroups).set(u, {
|
|
1213
|
+
derivedPanelConstraints: l,
|
|
1214
|
+
layout: h,
|
|
1215
|
+
separatorToPanels: m
|
|
1216
|
+
})
|
|
1217
|
+
}));
|
|
1175
1218
|
};
|
|
1176
1219
|
return {
|
|
1177
1220
|
collapse: () => {
|
|
1178
|
-
const { collapsible:
|
|
1179
|
-
i();
|
|
1221
|
+
const { collapsible: i, collapsedSize: a } = o(), l = r();
|
|
1222
|
+
i && l !== a && c(a);
|
|
1180
1223
|
},
|
|
1181
1224
|
expand: () => {
|
|
1182
|
-
const { collapsible:
|
|
1183
|
-
i();
|
|
1225
|
+
const { collapsible: i, collapsedSize: a, minSize: l } = o(), u = r();
|
|
1226
|
+
i && u === a && c(l);
|
|
1184
1227
|
},
|
|
1185
1228
|
getSize: () => {
|
|
1186
|
-
const { group:
|
|
1229
|
+
const { group: i } = n(), a = r(), { element: l } = s(), u = i.orientation === "horizontal" ? l.offsetWidth : l.offsetHeight;
|
|
1187
1230
|
return {
|
|
1188
|
-
asPercentage:
|
|
1189
|
-
inPixels:
|
|
1231
|
+
asPercentage: a,
|
|
1232
|
+
inPixels: u
|
|
1190
1233
|
};
|
|
1191
1234
|
},
|
|
1192
1235
|
isCollapsed: () => {
|
|
1193
|
-
const { collapsible:
|
|
1194
|
-
return
|
|
1236
|
+
const { collapsible: i, collapsedSize: a } = o(), l = r();
|
|
1237
|
+
return i && L(a, l);
|
|
1195
1238
|
},
|
|
1196
|
-
resize: (
|
|
1197
|
-
if (
|
|
1198
|
-
|
|
1239
|
+
resize: (i) => {
|
|
1240
|
+
if (r() !== i) {
|
|
1241
|
+
let l;
|
|
1242
|
+
switch (typeof i) {
|
|
1199
1243
|
case "number": {
|
|
1200
|
-
const { group:
|
|
1201
|
-
|
|
1244
|
+
const { group: u } = n(), f = le({ group: u });
|
|
1245
|
+
l = R(i / f * 100);
|
|
1246
|
+
break;
|
|
1247
|
+
}
|
|
1248
|
+
case "string": {
|
|
1249
|
+
l = parseFloat(i);
|
|
1202
1250
|
break;
|
|
1203
1251
|
}
|
|
1204
1252
|
}
|
|
1253
|
+
c(l);
|
|
1254
|
+
}
|
|
1205
1255
|
}
|
|
1206
1256
|
};
|
|
1207
1257
|
}
|
|
1208
1258
|
function at(e, t) {
|
|
1209
|
-
const { id: n } = de(), o =
|
|
1259
|
+
const { id: n } = de(), o = T({
|
|
1210
1260
|
collapse: oe,
|
|
1211
1261
|
expand: oe,
|
|
1212
1262
|
getSize: () => ({
|
|
@@ -1229,30 +1279,30 @@ function ht({
|
|
|
1229
1279
|
collapsedSize: n = 0,
|
|
1230
1280
|
collapsible: o = !1,
|
|
1231
1281
|
defaultSize: s,
|
|
1232
|
-
elementRef:
|
|
1233
|
-
id:
|
|
1234
|
-
maxSize:
|
|
1235
|
-
minSize:
|
|
1236
|
-
onResize:
|
|
1282
|
+
elementRef: r,
|
|
1283
|
+
id: c,
|
|
1284
|
+
maxSize: i = "100",
|
|
1285
|
+
minSize: a = "0",
|
|
1286
|
+
onResize: l,
|
|
1237
1287
|
panelRef: u,
|
|
1238
1288
|
style: f
|
|
1239
1289
|
}) {
|
|
1240
|
-
const m = !!
|
|
1241
|
-
|
|
1290
|
+
const m = !!c, v = ce(c), [p, d] = M(null), h = fe(d, r), { id: y, registerPanel: z } = de(), x = l !== null, g = ue((G) => {
|
|
1291
|
+
l?.(G, c);
|
|
1242
1292
|
});
|
|
1243
1293
|
H(() => {
|
|
1244
1294
|
if (p !== null)
|
|
1245
1295
|
return z({
|
|
1246
1296
|
element: p,
|
|
1247
|
-
id:
|
|
1297
|
+
id: v,
|
|
1248
1298
|
idIsStable: m,
|
|
1249
|
-
onResize: x ?
|
|
1299
|
+
onResize: x ? g : void 0,
|
|
1250
1300
|
panelConstraints: {
|
|
1251
1301
|
collapsedSize: n,
|
|
1252
1302
|
collapsible: o,
|
|
1253
1303
|
defaultSize: s,
|
|
1254
|
-
maxSize:
|
|
1255
|
-
minSize:
|
|
1304
|
+
maxSize: i,
|
|
1305
|
+
minSize: a
|
|
1256
1306
|
}
|
|
1257
1307
|
});
|
|
1258
1308
|
}, [
|
|
@@ -1261,19 +1311,19 @@ function ht({
|
|
|
1261
1311
|
s,
|
|
1262
1312
|
p,
|
|
1263
1313
|
x,
|
|
1264
|
-
|
|
1314
|
+
v,
|
|
1265
1315
|
m,
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1316
|
+
i,
|
|
1317
|
+
a,
|
|
1318
|
+
g,
|
|
1269
1319
|
z
|
|
1270
|
-
]), at(
|
|
1271
|
-
const w = Ge(
|
|
1320
|
+
]), at(v, u);
|
|
1321
|
+
const w = Ge(y, v);
|
|
1272
1322
|
return /* @__PURE__ */ j(
|
|
1273
1323
|
"div",
|
|
1274
1324
|
{
|
|
1275
1325
|
"data-panel": !0,
|
|
1276
|
-
"data-testid":
|
|
1326
|
+
"data-testid": c ?? void 0,
|
|
1277
1327
|
ref: h,
|
|
1278
1328
|
style: {
|
|
1279
1329
|
flexBasis: 0,
|
|
@@ -1283,7 +1333,7 @@ function ht({
|
|
|
1283
1333
|
overflow: "hidden",
|
|
1284
1334
|
// Disable pointer events inside of a panel during resize
|
|
1285
1335
|
// This avoid edge cases like nested iframes
|
|
1286
|
-
pointerEvents: `var(${
|
|
1336
|
+
pointerEvents: `var(${Re})`
|
|
1287
1337
|
},
|
|
1288
1338
|
children: /* @__PURE__ */ j(
|
|
1289
1339
|
"div",
|
|
@@ -1301,10 +1351,10 @@ function ht({
|
|
|
1301
1351
|
);
|
|
1302
1352
|
}
|
|
1303
1353
|
function vt() {
|
|
1304
|
-
return
|
|
1354
|
+
return M(null);
|
|
1305
1355
|
}
|
|
1306
1356
|
function yt() {
|
|
1307
|
-
return
|
|
1357
|
+
return T(null);
|
|
1308
1358
|
}
|
|
1309
1359
|
function lt({
|
|
1310
1360
|
layout: e,
|
|
@@ -1312,15 +1362,15 @@ function lt({
|
|
|
1312
1362
|
panelId: n,
|
|
1313
1363
|
panelIndex: o
|
|
1314
1364
|
}) {
|
|
1315
|
-
let s,
|
|
1316
|
-
const
|
|
1317
|
-
(
|
|
1365
|
+
let s, r;
|
|
1366
|
+
const c = e[n], i = t.find(
|
|
1367
|
+
(a) => a.panelId === n
|
|
1318
1368
|
);
|
|
1319
|
-
if (
|
|
1320
|
-
const
|
|
1321
|
-
|
|
1322
|
-
layout:
|
|
1323
|
-
delta:
|
|
1369
|
+
if (i) {
|
|
1370
|
+
const a = i.maxSize, l = r = i.collapsible ? i.collapsedSize : i.minSize, u = [o, o + 1];
|
|
1371
|
+
r = $({
|
|
1372
|
+
layout: U({
|
|
1373
|
+
delta: l - c,
|
|
1324
1374
|
initialLayout: e,
|
|
1325
1375
|
panelConstraints: t,
|
|
1326
1376
|
pivotIndices: u,
|
|
@@ -1328,9 +1378,9 @@ function lt({
|
|
|
1328
1378
|
trigger: "keyboard"
|
|
1329
1379
|
}),
|
|
1330
1380
|
panelConstraints: t
|
|
1331
|
-
})[n], s =
|
|
1332
|
-
layout:
|
|
1333
|
-
delta:
|
|
1381
|
+
})[n], s = $({
|
|
1382
|
+
layout: U({
|
|
1383
|
+
delta: a - c,
|
|
1334
1384
|
initialLayout: e,
|
|
1335
1385
|
panelConstraints: t,
|
|
1336
1386
|
pivotIndices: u,
|
|
@@ -1342,8 +1392,8 @@ function lt({
|
|
|
1342
1392
|
}
|
|
1343
1393
|
return {
|
|
1344
1394
|
valueMax: s,
|
|
1345
|
-
valueMin:
|
|
1346
|
-
valueNow:
|
|
1395
|
+
valueMin: r,
|
|
1396
|
+
valueNow: c
|
|
1347
1397
|
};
|
|
1348
1398
|
}
|
|
1349
1399
|
function gt({
|
|
@@ -1353,40 +1403,40 @@ function gt({
|
|
|
1353
1403
|
id: o,
|
|
1354
1404
|
style: s
|
|
1355
1405
|
}) {
|
|
1356
|
-
const
|
|
1357
|
-
id:
|
|
1406
|
+
const r = ce(o), [c, i] = M({}), [a, l] = M("inactive"), [u, f] = M(null), m = fe(f, n), {
|
|
1407
|
+
id: v,
|
|
1358
1408
|
orientation: p,
|
|
1359
1409
|
registerSeparator: d
|
|
1360
1410
|
} = de(), h = p === "horizontal" ? "vertical" : "horizontal";
|
|
1361
1411
|
return H(() => {
|
|
1362
1412
|
if (u !== null) {
|
|
1363
|
-
const
|
|
1413
|
+
const y = {
|
|
1364
1414
|
element: u,
|
|
1365
|
-
id:
|
|
1366
|
-
}, z = d(
|
|
1415
|
+
id: r
|
|
1416
|
+
}, z = d(y), x = A.addListener(
|
|
1367
1417
|
"interactionStateChange",
|
|
1368
1418
|
(w) => {
|
|
1369
|
-
|
|
1419
|
+
l(
|
|
1370
1420
|
w.state !== "inactive" && w.hitRegions.some(
|
|
1371
|
-
(G) => G.separator ===
|
|
1421
|
+
(G) => G.separator === y
|
|
1372
1422
|
) ? w.state : "inactive"
|
|
1373
1423
|
);
|
|
1374
1424
|
}
|
|
1375
|
-
),
|
|
1425
|
+
), g = A.addListener(
|
|
1376
1426
|
"mountedGroupsChange",
|
|
1377
1427
|
(w) => {
|
|
1378
1428
|
w.forEach(
|
|
1379
|
-
({ derivedPanelConstraints: G, layout: O, separatorToPanels: te },
|
|
1380
|
-
if (
|
|
1381
|
-
const
|
|
1382
|
-
if (
|
|
1383
|
-
const
|
|
1384
|
-
|
|
1429
|
+
({ derivedPanelConstraints: G, layout: O, separatorToPanels: te }, K) => {
|
|
1430
|
+
if (K.id === v) {
|
|
1431
|
+
const V = te.get(y);
|
|
1432
|
+
if (V) {
|
|
1433
|
+
const q = V[0], X = K.panels.indexOf(q);
|
|
1434
|
+
i(
|
|
1385
1435
|
lt({
|
|
1386
1436
|
layout: O,
|
|
1387
1437
|
panelConstraints: G,
|
|
1388
|
-
panelId:
|
|
1389
|
-
panelIndex:
|
|
1438
|
+
panelId: q.id,
|
|
1439
|
+
panelIndex: X
|
|
1390
1440
|
})
|
|
1391
1441
|
);
|
|
1392
1442
|
}
|
|
@@ -1396,19 +1446,19 @@ function gt({
|
|
|
1396
1446
|
}
|
|
1397
1447
|
);
|
|
1398
1448
|
return () => {
|
|
1399
|
-
x(),
|
|
1449
|
+
x(), g(), z();
|
|
1400
1450
|
};
|
|
1401
1451
|
}
|
|
1402
|
-
}, [u,
|
|
1452
|
+
}, [u, v, r, d]), /* @__PURE__ */ j(
|
|
1403
1453
|
"div",
|
|
1404
1454
|
{
|
|
1405
1455
|
"aria-orientation": h,
|
|
1406
|
-
"aria-valuemax":
|
|
1407
|
-
"aria-valuemin":
|
|
1408
|
-
"aria-valuenow":
|
|
1456
|
+
"aria-valuemax": c.valueMax,
|
|
1457
|
+
"aria-valuemin": c.valueMin,
|
|
1458
|
+
"aria-valuenow": c.valueNow,
|
|
1409
1459
|
children: e,
|
|
1410
1460
|
className: t,
|
|
1411
|
-
"data-separator":
|
|
1461
|
+
"data-separator": a,
|
|
1412
1462
|
"data-testid": o ?? void 0,
|
|
1413
1463
|
ref: m,
|
|
1414
1464
|
role: "separator",
|