react-resizable-panels 4.0.0-alpha.3 → 4.0.0-alpha.4
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,78 +1,78 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as j } from "react/jsx-runtime";
|
|
3
|
-
import { useId as
|
|
3
|
+
import { useId as De, useLayoutEffect as Ae, useEffect as $e, useRef as T, useCallback as Se, createContext as Ne, useImperativeHandle as xe, useState as G, useMemo as ze, useSyncExternalStore as _e, useContext as Fe } from "react";
|
|
4
4
|
function S(e, t = "Assertion error") {
|
|
5
5
|
if (!e)
|
|
6
6
|
throw Error(t);
|
|
7
7
|
}
|
|
8
|
-
function
|
|
8
|
+
function se(e, t) {
|
|
9
9
|
return t.sort(
|
|
10
|
-
e === "horizontal" ?
|
|
10
|
+
e === "horizontal" ? He : je
|
|
11
11
|
);
|
|
12
12
|
}
|
|
13
|
-
function
|
|
13
|
+
function He(e, t) {
|
|
14
14
|
const n = e.element.offsetLeft - t.element.offsetLeft;
|
|
15
15
|
return n !== 0 ? n : e.element.offsetWidth - t.element.offsetWidth;
|
|
16
16
|
}
|
|
17
|
-
function
|
|
17
|
+
function je(e, t) {
|
|
18
18
|
const n = e.element.offsetTop - t.element.offsetTop;
|
|
19
19
|
return n !== 0 ? n : e.element.offsetHeight - t.element.offsetHeight;
|
|
20
20
|
}
|
|
21
|
-
function
|
|
22
|
-
const { element: t, orientation: n, panels: o, separators: s } = e, r =
|
|
21
|
+
function be(e) {
|
|
22
|
+
const { element: t, orientation: n, panels: o, separators: s } = e, r = se(
|
|
23
23
|
n,
|
|
24
24
|
Array.from(t.children).filter((l) => l instanceof HTMLElement).map((l) => ({ element: l }))
|
|
25
25
|
).map(({ element: l }) => l), c = [];
|
|
26
26
|
let i, a;
|
|
27
27
|
for (const l of r) {
|
|
28
|
-
const
|
|
29
|
-
(
|
|
28
|
+
const f = o.find(
|
|
29
|
+
(u) => u.element === l
|
|
30
30
|
);
|
|
31
|
-
if (
|
|
31
|
+
if (f) {
|
|
32
32
|
if (i) {
|
|
33
|
-
const
|
|
33
|
+
const u = i.element.getBoundingClientRect(), m = l.getBoundingClientRect();
|
|
34
34
|
c.push({
|
|
35
35
|
group: e,
|
|
36
|
-
panels: [i,
|
|
36
|
+
panels: [i, f],
|
|
37
37
|
separator: a,
|
|
38
38
|
rect: n === "horizontal" ? new DOMRect(
|
|
39
|
-
|
|
39
|
+
u.right,
|
|
40
40
|
m.top,
|
|
41
|
-
m.left -
|
|
41
|
+
m.left - u.right,
|
|
42
42
|
m.height
|
|
43
43
|
) : new DOMRect(
|
|
44
44
|
m.left,
|
|
45
|
-
|
|
45
|
+
u.bottom,
|
|
46
46
|
m.width,
|
|
47
|
-
m.top -
|
|
47
|
+
m.top - u.bottom
|
|
48
48
|
)
|
|
49
49
|
});
|
|
50
50
|
}
|
|
51
|
-
i =
|
|
51
|
+
i = f, a = void 0;
|
|
52
52
|
} else {
|
|
53
|
-
const
|
|
53
|
+
const u = s.find(
|
|
54
54
|
(m) => m.element === l
|
|
55
55
|
);
|
|
56
|
-
|
|
56
|
+
u ? a = u : (i = void 0, a = void 0);
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
return c;
|
|
60
60
|
}
|
|
61
|
-
function
|
|
61
|
+
function We(e, t) {
|
|
62
62
|
const n = getComputedStyle(e), o = parseFloat(n.fontSize);
|
|
63
63
|
return t * o;
|
|
64
64
|
}
|
|
65
|
-
function
|
|
65
|
+
function Ue(e, t) {
|
|
66
66
|
const n = getComputedStyle(e.ownerDocument.body), o = parseFloat(n.fontSize);
|
|
67
67
|
return t * o;
|
|
68
68
|
}
|
|
69
|
-
function
|
|
69
|
+
function Be(e) {
|
|
70
70
|
return e / 100 * window.innerHeight;
|
|
71
71
|
}
|
|
72
|
-
function
|
|
72
|
+
function Ke(e) {
|
|
73
73
|
return e / 100 * window.innerWidth;
|
|
74
74
|
}
|
|
75
|
-
function
|
|
75
|
+
function Ve(e) {
|
|
76
76
|
switch (typeof e) {
|
|
77
77
|
case "number":
|
|
78
78
|
return [e, "px"];
|
|
@@ -82,13 +82,13 @@ function Ke(e) {
|
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
|
-
function
|
|
85
|
+
function J({
|
|
86
86
|
groupSize: e,
|
|
87
87
|
panelElement: t,
|
|
88
88
|
styleProp: n
|
|
89
89
|
}) {
|
|
90
90
|
let o;
|
|
91
|
-
const [s, r] =
|
|
91
|
+
const [s, r] = Ve(n);
|
|
92
92
|
switch (r) {
|
|
93
93
|
case "%": {
|
|
94
94
|
o = s / 100 * e;
|
|
@@ -99,72 +99,72 @@ function Z({
|
|
|
99
99
|
break;
|
|
100
100
|
}
|
|
101
101
|
case "rem": {
|
|
102
|
-
o =
|
|
102
|
+
o = Ue(t, s);
|
|
103
103
|
break;
|
|
104
104
|
}
|
|
105
105
|
case "em": {
|
|
106
|
-
o =
|
|
106
|
+
o = We(t, s);
|
|
107
107
|
break;
|
|
108
108
|
}
|
|
109
109
|
case "vh": {
|
|
110
|
-
o =
|
|
110
|
+
o = Be(s);
|
|
111
111
|
break;
|
|
112
112
|
}
|
|
113
113
|
case "vw": {
|
|
114
|
-
o =
|
|
114
|
+
o = Ke(s);
|
|
115
115
|
break;
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
118
|
return o;
|
|
119
119
|
}
|
|
120
|
-
function
|
|
120
|
+
function I(e) {
|
|
121
121
|
return parseFloat(e.toFixed(3));
|
|
122
122
|
}
|
|
123
|
-
function
|
|
123
|
+
function ce({
|
|
124
124
|
group: e
|
|
125
125
|
}) {
|
|
126
126
|
const { orientation: t, panels: n } = e;
|
|
127
127
|
return n.reduce((o, s) => (o += t === "horizontal" ? s.element.offsetWidth : s.element.offsetHeight, o), 0);
|
|
128
128
|
}
|
|
129
|
-
function
|
|
130
|
-
const { panels: t } = e, n =
|
|
129
|
+
function me(e) {
|
|
130
|
+
const { panels: t } = e, n = ce({ group: e });
|
|
131
131
|
return t.map((o) => {
|
|
132
132
|
const { element: s, panelConstraints: r } = o;
|
|
133
133
|
let c = 0;
|
|
134
134
|
if (r.collapsedSize) {
|
|
135
|
-
const
|
|
135
|
+
const f = J({
|
|
136
136
|
groupSize: n,
|
|
137
137
|
panelElement: s,
|
|
138
138
|
styleProp: r.collapsedSize
|
|
139
139
|
});
|
|
140
|
-
c =
|
|
140
|
+
c = I(f / n * 100);
|
|
141
141
|
}
|
|
142
142
|
let i;
|
|
143
143
|
if (r.defaultSize) {
|
|
144
|
-
const
|
|
144
|
+
const f = J({
|
|
145
145
|
groupSize: n,
|
|
146
146
|
panelElement: s,
|
|
147
147
|
styleProp: r.defaultSize
|
|
148
148
|
});
|
|
149
|
-
i =
|
|
149
|
+
i = I(f / n * 100);
|
|
150
150
|
}
|
|
151
151
|
let a = 0;
|
|
152
152
|
if (r.minSize) {
|
|
153
|
-
const
|
|
153
|
+
const f = J({
|
|
154
154
|
groupSize: n,
|
|
155
155
|
panelElement: s,
|
|
156
156
|
styleProp: r.minSize
|
|
157
157
|
});
|
|
158
|
-
a =
|
|
158
|
+
a = I(f / n * 100);
|
|
159
159
|
}
|
|
160
160
|
let l = 100;
|
|
161
161
|
if (r.maxSize) {
|
|
162
|
-
const
|
|
162
|
+
const f = J({
|
|
163
163
|
groupSize: n,
|
|
164
164
|
panelElement: s,
|
|
165
165
|
styleProp: r.maxSize
|
|
166
166
|
});
|
|
167
|
-
l =
|
|
167
|
+
l = I(f / n * 100);
|
|
168
168
|
}
|
|
169
169
|
return {
|
|
170
170
|
collapsedSize: c,
|
|
@@ -176,7 +176,7 @@ function pe(e) {
|
|
|
176
176
|
};
|
|
177
177
|
});
|
|
178
178
|
}
|
|
179
|
-
class
|
|
179
|
+
class qe {
|
|
180
180
|
#e = {};
|
|
181
181
|
addListener(t, n) {
|
|
182
182
|
const o = this.#e[t];
|
|
@@ -215,37 +215,37 @@ class Ve {
|
|
|
215
215
|
}
|
|
216
216
|
}
|
|
217
217
|
}
|
|
218
|
-
function
|
|
219
|
-
return Math.abs(
|
|
218
|
+
function w(e, t, n = 0) {
|
|
219
|
+
return Math.abs(I(e) - I(t)) <= n;
|
|
220
220
|
}
|
|
221
|
-
let
|
|
221
|
+
let C = {
|
|
222
222
|
cursorFlags: 0,
|
|
223
223
|
interactionState: {
|
|
224
224
|
state: "inactive"
|
|
225
225
|
},
|
|
226
226
|
mountedGroups: /* @__PURE__ */ new Map()
|
|
227
227
|
};
|
|
228
|
-
const A = new
|
|
229
|
-
function
|
|
230
|
-
return
|
|
228
|
+
const A = new qe();
|
|
229
|
+
function O() {
|
|
230
|
+
return C;
|
|
231
231
|
}
|
|
232
|
-
function
|
|
233
|
-
const t = typeof e == "function" ? e(
|
|
234
|
-
if (
|
|
235
|
-
return
|
|
236
|
-
const n =
|
|
237
|
-
return
|
|
238
|
-
...
|
|
232
|
+
function M(e) {
|
|
233
|
+
const t = typeof e == "function" ? e(C) : e;
|
|
234
|
+
if (C === t)
|
|
235
|
+
return C;
|
|
236
|
+
const n = C;
|
|
237
|
+
return C = {
|
|
238
|
+
...C,
|
|
239
239
|
...t
|
|
240
|
-
}, t.cursorFlags !== void 0 && A.emit("cursorFlagsChange",
|
|
240
|
+
}, t.cursorFlags !== void 0 && A.emit("cursorFlagsChange", C.cursorFlags), t.interactionState !== void 0 && A.emit("interactionStateChange", C.interactionState), t.mountedGroups !== void 0 && (C.mountedGroups.forEach((o, s) => {
|
|
241
241
|
o.derivedPanelConstraints.forEach((r) => {
|
|
242
242
|
if (r.collapsible) {
|
|
243
243
|
const { layout: c } = n.mountedGroups.get(s) ?? {};
|
|
244
244
|
if (c) {
|
|
245
|
-
const i =
|
|
245
|
+
const i = w(
|
|
246
246
|
r.collapsedSize,
|
|
247
247
|
o.layout[r.panelId]
|
|
248
|
-
), a =
|
|
248
|
+
), a = w(
|
|
249
249
|
r.collapsedSize,
|
|
250
250
|
c[r.panelId]
|
|
251
251
|
);
|
|
@@ -253,9 +253,9 @@ function E(e) {
|
|
|
253
253
|
}
|
|
254
254
|
}
|
|
255
255
|
});
|
|
256
|
-
}), A.emit("mountedGroupsChange",
|
|
256
|
+
}), A.emit("mountedGroupsChange", C.mountedGroups)), C;
|
|
257
257
|
}
|
|
258
|
-
function
|
|
258
|
+
function Xe(e, t) {
|
|
259
259
|
if (e.length !== t.length)
|
|
260
260
|
return !1;
|
|
261
261
|
for (let n = 0; n < e.length; n++)
|
|
@@ -264,7 +264,7 @@ function qe(e, t) {
|
|
|
264
264
|
return !0;
|
|
265
265
|
}
|
|
266
266
|
function W(e, t) {
|
|
267
|
-
return
|
|
267
|
+
return w(e, t) ? 0 : e > t ? 1 : -1;
|
|
268
268
|
}
|
|
269
269
|
function F({
|
|
270
270
|
panelConstraints: e,
|
|
@@ -282,7 +282,7 @@ function F({
|
|
|
282
282
|
W(t, c) < 0 ? t = n : t = r;
|
|
283
283
|
} else
|
|
284
284
|
t = r;
|
|
285
|
-
return t = Math.min(s, t), t =
|
|
285
|
+
return t = Math.min(s, t), t = I(t), t;
|
|
286
286
|
}
|
|
287
287
|
function U({
|
|
288
288
|
delta: e,
|
|
@@ -292,51 +292,51 @@ function U({
|
|
|
292
292
|
prevLayout: s,
|
|
293
293
|
trigger: r
|
|
294
294
|
}) {
|
|
295
|
-
if (
|
|
295
|
+
if (w(e, 0))
|
|
296
296
|
return t;
|
|
297
|
-
const c = Object.values(t), i = Object.values(s), a = [...c], [l,
|
|
298
|
-
S(l != null, "Invalid first pivot index"), S(
|
|
299
|
-
let
|
|
297
|
+
const c = Object.values(t), i = Object.values(s), a = [...c], [l, f] = o;
|
|
298
|
+
S(l != null, "Invalid first pivot index"), S(f != null, "Invalid second pivot index");
|
|
299
|
+
let u = 0;
|
|
300
300
|
if (r === "keyboard") {
|
|
301
301
|
{
|
|
302
|
-
const
|
|
302
|
+
const d = e < 0 ? f : l, p = n[d];
|
|
303
303
|
S(
|
|
304
|
-
|
|
305
|
-
`Panel constraints not found for index ${
|
|
304
|
+
p,
|
|
305
|
+
`Panel constraints not found for index ${d}`
|
|
306
306
|
);
|
|
307
307
|
const {
|
|
308
308
|
collapsedSize: h = 0,
|
|
309
|
-
collapsible:
|
|
309
|
+
collapsible: v,
|
|
310
310
|
minSize: z = 0
|
|
311
|
-
} =
|
|
312
|
-
if (
|
|
313
|
-
const x = c[
|
|
311
|
+
} = p;
|
|
312
|
+
if (v) {
|
|
313
|
+
const x = c[d];
|
|
314
314
|
if (S(
|
|
315
315
|
x != null,
|
|
316
|
-
`Previous layout not found for panel index ${
|
|
317
|
-
),
|
|
316
|
+
`Previous layout not found for panel index ${d}`
|
|
317
|
+
), w(x, h)) {
|
|
318
318
|
const g = z - x;
|
|
319
319
|
W(g, Math.abs(e)) > 0 && (e = e < 0 ? 0 - g : g);
|
|
320
320
|
}
|
|
321
321
|
}
|
|
322
322
|
}
|
|
323
323
|
{
|
|
324
|
-
const
|
|
324
|
+
const d = e < 0 ? l : f, p = n[d];
|
|
325
325
|
S(
|
|
326
|
-
|
|
327
|
-
`No panel constraints found for index ${
|
|
326
|
+
p,
|
|
327
|
+
`No panel constraints found for index ${d}`
|
|
328
328
|
);
|
|
329
329
|
const {
|
|
330
330
|
collapsedSize: h = 0,
|
|
331
|
-
collapsible:
|
|
331
|
+
collapsible: v,
|
|
332
332
|
minSize: z = 0
|
|
333
|
-
} =
|
|
334
|
-
if (
|
|
335
|
-
const x = c[
|
|
333
|
+
} = p;
|
|
334
|
+
if (v) {
|
|
335
|
+
const x = c[d];
|
|
336
336
|
if (S(
|
|
337
337
|
x != null,
|
|
338
|
-
`Previous layout not found for panel index ${
|
|
339
|
-
),
|
|
338
|
+
`Previous layout not found for panel index ${d}`
|
|
339
|
+
), w(x, z)) {
|
|
340
340
|
const g = x - h;
|
|
341
341
|
W(g, Math.abs(e)) > 0 && (e = e < 0 ? 0 - g : g);
|
|
342
342
|
}
|
|
@@ -344,86 +344,86 @@ function U({
|
|
|
344
344
|
}
|
|
345
345
|
}
|
|
346
346
|
{
|
|
347
|
-
const
|
|
348
|
-
let
|
|
347
|
+
const d = e < 0 ? 1 : -1;
|
|
348
|
+
let p = e < 0 ? f : l, h = 0;
|
|
349
349
|
for (; ; ) {
|
|
350
|
-
const z = c[
|
|
350
|
+
const z = c[p];
|
|
351
351
|
S(
|
|
352
352
|
z != null,
|
|
353
|
-
`Previous layout not found for panel index ${
|
|
353
|
+
`Previous layout not found for panel index ${p}`
|
|
354
354
|
);
|
|
355
355
|
const g = F({
|
|
356
|
-
panelConstraints: n[
|
|
356
|
+
panelConstraints: n[p],
|
|
357
357
|
size: 100
|
|
358
358
|
}) - z;
|
|
359
|
-
if (h += g,
|
|
359
|
+
if (h += g, p += d, p < 0 || p >= n.length)
|
|
360
360
|
break;
|
|
361
361
|
}
|
|
362
|
-
const
|
|
363
|
-
e = e < 0 ? 0 -
|
|
362
|
+
const v = Math.min(Math.abs(e), Math.abs(h));
|
|
363
|
+
e = e < 0 ? 0 - v : v;
|
|
364
364
|
}
|
|
365
365
|
{
|
|
366
|
-
let
|
|
367
|
-
for (;
|
|
368
|
-
const h = Math.abs(e) - Math.abs(
|
|
366
|
+
let p = e < 0 ? l : f;
|
|
367
|
+
for (; p >= 0 && p < n.length; ) {
|
|
368
|
+
const h = Math.abs(e) - Math.abs(u), v = c[p];
|
|
369
369
|
S(
|
|
370
|
-
|
|
371
|
-
`Previous layout not found for panel index ${
|
|
370
|
+
v != null,
|
|
371
|
+
`Previous layout not found for panel index ${p}`
|
|
372
372
|
);
|
|
373
|
-
const z =
|
|
374
|
-
panelConstraints: n[
|
|
373
|
+
const z = v - h, x = F({
|
|
374
|
+
panelConstraints: n[p],
|
|
375
375
|
size: z
|
|
376
376
|
});
|
|
377
|
-
if (!
|
|
377
|
+
if (!w(v, x) && (u += v - x, a[p] = x, u.toFixed(3).localeCompare(Math.abs(e).toFixed(3), void 0, {
|
|
378
378
|
numeric: !0
|
|
379
379
|
}) >= 0))
|
|
380
380
|
break;
|
|
381
|
-
e < 0 ?
|
|
381
|
+
e < 0 ? p-- : p++;
|
|
382
382
|
}
|
|
383
383
|
}
|
|
384
|
-
if (
|
|
384
|
+
if (Xe(i, a))
|
|
385
385
|
return s;
|
|
386
386
|
{
|
|
387
|
-
const
|
|
387
|
+
const d = e < 0 ? f : l, p = c[d];
|
|
388
388
|
S(
|
|
389
|
-
|
|
390
|
-
`Previous layout not found for panel index ${
|
|
389
|
+
p != null,
|
|
390
|
+
`Previous layout not found for panel index ${d}`
|
|
391
391
|
);
|
|
392
|
-
const h =
|
|
393
|
-
panelConstraints: n[
|
|
392
|
+
const h = p + u, v = F({
|
|
393
|
+
panelConstraints: n[d],
|
|
394
394
|
size: h
|
|
395
395
|
});
|
|
396
|
-
if (a[
|
|
397
|
-
let z = h -
|
|
396
|
+
if (a[d] = v, !w(v, h)) {
|
|
397
|
+
let z = h - v, g = e < 0 ? f : l;
|
|
398
398
|
for (; g >= 0 && g < n.length; ) {
|
|
399
|
-
const
|
|
399
|
+
const L = a[g];
|
|
400
400
|
S(
|
|
401
|
-
|
|
401
|
+
L != null,
|
|
402
402
|
`Previous layout not found for panel index ${g}`
|
|
403
403
|
);
|
|
404
|
-
const
|
|
404
|
+
const P = L + z, E = F({
|
|
405
405
|
panelConstraints: n[g],
|
|
406
|
-
size:
|
|
406
|
+
size: P
|
|
407
407
|
});
|
|
408
|
-
if (L
|
|
408
|
+
if (w(L, E) || (z -= E - L, a[g] = E), w(z, 0))
|
|
409
409
|
break;
|
|
410
410
|
e > 0 ? g-- : g++;
|
|
411
411
|
}
|
|
412
412
|
}
|
|
413
413
|
}
|
|
414
414
|
const m = Object.values(a).reduce(
|
|
415
|
-
(
|
|
415
|
+
(d, p) => p + d,
|
|
416
416
|
0
|
|
417
417
|
);
|
|
418
|
-
if (!
|
|
418
|
+
if (!w(m, 100, 0.1))
|
|
419
419
|
return s;
|
|
420
|
-
const
|
|
421
|
-
return a.reduce((
|
|
420
|
+
const y = Object.keys(s);
|
|
421
|
+
return a.reduce((d, p, h) => (d[y[h]] = p, d), {});
|
|
422
422
|
}
|
|
423
|
-
function
|
|
423
|
+
function te(e) {
|
|
424
424
|
const t = e.parentElement;
|
|
425
425
|
S(t, "Parent group element not found");
|
|
426
|
-
const { mountedGroups: n } =
|
|
426
|
+
const { mountedGroups: n } = O();
|
|
427
427
|
for (const [o] of n)
|
|
428
428
|
if (o.element === t)
|
|
429
429
|
return o;
|
|
@@ -449,7 +449,7 @@ function $({
|
|
|
449
449
|
throw Error(
|
|
450
450
|
`Invalid ${t.length} panel layout: ${o.map((i) => `${i}%`).join(", ")}`
|
|
451
451
|
);
|
|
452
|
-
if (!
|
|
452
|
+
if (!w(s, 100) && o.length > 0)
|
|
453
453
|
for (let i = 0; i < t.length; i++) {
|
|
454
454
|
const a = o[i];
|
|
455
455
|
S(a != null, `No layout data found for index ${i}`);
|
|
@@ -466,25 +466,25 @@ function $({
|
|
|
466
466
|
});
|
|
467
467
|
a != l && (r += a - l, o[i] = l);
|
|
468
468
|
}
|
|
469
|
-
if (!
|
|
469
|
+
if (!w(r, 0))
|
|
470
470
|
for (let i = 0; i < t.length; i++) {
|
|
471
471
|
const a = o[i];
|
|
472
472
|
S(a != null, `No layout data found for index ${i}`);
|
|
473
|
-
const l = a + r,
|
|
473
|
+
const l = a + r, f = F({
|
|
474
474
|
panelConstraints: t[i],
|
|
475
475
|
size: l
|
|
476
476
|
});
|
|
477
|
-
if (a !==
|
|
477
|
+
if (a !== f && (r -= f - a, o[i] = f, w(r, 0)))
|
|
478
478
|
break;
|
|
479
479
|
}
|
|
480
480
|
const c = Object.keys(e);
|
|
481
481
|
return o.reduce((i, a, l) => (i[c[l]] = a, i), {});
|
|
482
482
|
}
|
|
483
|
-
function
|
|
483
|
+
function we({
|
|
484
484
|
groupId: e
|
|
485
485
|
}) {
|
|
486
486
|
const t = () => {
|
|
487
|
-
const { mountedGroups: n } =
|
|
487
|
+
const { mountedGroups: n } = O();
|
|
488
488
|
for (const [o, s] of n)
|
|
489
489
|
if (o.id === e)
|
|
490
490
|
return { group: o, ...s };
|
|
@@ -505,7 +505,7 @@ function be({
|
|
|
505
505
|
layout: n,
|
|
506
506
|
panelConstraints: o
|
|
507
507
|
});
|
|
508
|
-
return B(r, i) ||
|
|
508
|
+
return B(r, i) || M((a) => ({
|
|
509
509
|
mountedGroups: new Map(a.mountedGroups).set(s, {
|
|
510
510
|
derivedPanelConstraints: o,
|
|
511
511
|
layout: i,
|
|
@@ -515,40 +515,40 @@ function be({
|
|
|
515
515
|
}
|
|
516
516
|
};
|
|
517
517
|
}
|
|
518
|
-
function
|
|
519
|
-
const { mountedGroups: t } =
|
|
518
|
+
function Le(e) {
|
|
519
|
+
const { mountedGroups: t } = O(), n = t.get(e);
|
|
520
520
|
return S(n, `Mounted Group ${e.id} not found`), n;
|
|
521
521
|
}
|
|
522
522
|
function D(e, t) {
|
|
523
|
-
const n =
|
|
524
|
-
(
|
|
523
|
+
const n = te(e), o = Le(n), s = n.separators.find(
|
|
524
|
+
(u) => u.element === e
|
|
525
525
|
);
|
|
526
526
|
S(s, "Matching separator not found");
|
|
527
527
|
const r = o.separatorToPanels.get(s);
|
|
528
528
|
S(r, "Matching panels not found");
|
|
529
|
-
const c = r.map((
|
|
529
|
+
const c = r.map((u) => n.panels.indexOf(u)), a = we({ groupId: n.id }).getLayout(), l = U({
|
|
530
530
|
delta: t,
|
|
531
531
|
initialLayout: a,
|
|
532
532
|
panelConstraints: o.derivedPanelConstraints,
|
|
533
533
|
pivotIndices: c,
|
|
534
534
|
prevLayout: a,
|
|
535
535
|
trigger: "keyboard"
|
|
536
|
-
}),
|
|
536
|
+
}), f = $({
|
|
537
537
|
layout: l,
|
|
538
538
|
panelConstraints: o.derivedPanelConstraints
|
|
539
539
|
});
|
|
540
|
-
B(a,
|
|
541
|
-
mountedGroups: new Map(
|
|
540
|
+
B(a, f) || M((u) => ({
|
|
541
|
+
mountedGroups: new Map(u.mountedGroups).set(n, {
|
|
542
542
|
derivedPanelConstraints: o.derivedPanelConstraints,
|
|
543
|
-
layout:
|
|
543
|
+
layout: f,
|
|
544
544
|
separatorToPanels: o.separatorToPanels
|
|
545
545
|
})
|
|
546
546
|
}));
|
|
547
547
|
}
|
|
548
|
-
function
|
|
548
|
+
function he(e) {
|
|
549
549
|
if (e.defaultPrevented)
|
|
550
550
|
return;
|
|
551
|
-
const t = e.currentTarget, n =
|
|
551
|
+
const t = e.currentTarget, n = te(t);
|
|
552
552
|
if (!n.disabled)
|
|
553
553
|
switch (e.key) {
|
|
554
554
|
case "ArrowDown": {
|
|
@@ -573,24 +573,24 @@ function me(e) {
|
|
|
573
573
|
}
|
|
574
574
|
case "Enter": {
|
|
575
575
|
e.preventDefault();
|
|
576
|
-
const o =
|
|
577
|
-
(
|
|
576
|
+
const o = te(t), { derivedPanelConstraints: s, layout: r, separatorToPanels: c } = Le(o), i = o.separators.find(
|
|
577
|
+
(u) => u.element === t
|
|
578
578
|
);
|
|
579
579
|
S(i, "Matching separator not found");
|
|
580
580
|
const a = c.get(i);
|
|
581
581
|
S(a, "Matching panels not found");
|
|
582
|
-
const l = a[0],
|
|
583
|
-
(
|
|
582
|
+
const l = a[0], f = s.find(
|
|
583
|
+
(u) => u.panelId === l.id
|
|
584
584
|
);
|
|
585
|
-
if (S(
|
|
586
|
-
const
|
|
587
|
-
D(t, m -
|
|
585
|
+
if (S(f, "Panel metadata not found"), f.collapsible) {
|
|
586
|
+
const u = r[l.id], m = f.collapsedSize === u ? o.inMemoryLastExpandedPanelSizes[l.id] ?? f.minSize : f.collapsedSize;
|
|
587
|
+
D(t, m - u);
|
|
588
588
|
}
|
|
589
589
|
break;
|
|
590
590
|
}
|
|
591
591
|
case "F6": {
|
|
592
592
|
e.preventDefault();
|
|
593
|
-
const s =
|
|
593
|
+
const s = te(t).separators.map(
|
|
594
594
|
(a) => a.element
|
|
595
595
|
), r = Array.from(s).findIndex(
|
|
596
596
|
(a) => a === e.currentTarget
|
|
@@ -606,12 +606,12 @@ function me(e) {
|
|
|
606
606
|
}
|
|
607
607
|
}
|
|
608
608
|
}
|
|
609
|
-
const
|
|
610
|
-
},
|
|
609
|
+
const Ye = (e) => e, ie = () => {
|
|
610
|
+
}, Pe = 1, Ee = 2, Ce = 4, Me = 8, ve = {
|
|
611
611
|
coarse: 10,
|
|
612
612
|
precise: 5
|
|
613
613
|
};
|
|
614
|
-
function
|
|
614
|
+
function Ze(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,13 +623,13 @@ function Ye(e, t) {
|
|
|
623
623
|
)
|
|
624
624
|
};
|
|
625
625
|
}
|
|
626
|
-
function
|
|
626
|
+
function Je(e, t, n) {
|
|
627
627
|
let o, s = {
|
|
628
628
|
x: 1 / 0,
|
|
629
629
|
y: 1 / 0
|
|
630
630
|
};
|
|
631
631
|
for (const r of t) {
|
|
632
|
-
const c =
|
|
632
|
+
const c = Ze(n, r.rect);
|
|
633
633
|
switch (e) {
|
|
634
634
|
case "horizontal": {
|
|
635
635
|
c.x <= s.x && (o = r, s = c);
|
|
@@ -646,33 +646,33 @@ function Ze(e, t, n) {
|
|
|
646
646
|
hitRegion: o
|
|
647
647
|
} : void 0;
|
|
648
648
|
}
|
|
649
|
-
let
|
|
650
|
-
function
|
|
651
|
-
return
|
|
649
|
+
let Q;
|
|
650
|
+
function Qe() {
|
|
651
|
+
return Q === void 0 && (typeof matchMedia == "function" ? Q = !!matchMedia("(pointer:coarse)").matches : Q = !1), Q;
|
|
652
652
|
}
|
|
653
|
-
function
|
|
653
|
+
function Re(e, t) {
|
|
654
654
|
const n = [];
|
|
655
655
|
return t.forEach((o, s) => {
|
|
656
656
|
if (s.disabled)
|
|
657
657
|
return;
|
|
658
|
-
const r =
|
|
658
|
+
const r = Qe() ? ve.coarse : ve.precise, c = be(s), i = Je(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
|
-
function
|
|
665
|
+
function ye(e) {
|
|
666
666
|
if (e.defaultPrevented)
|
|
667
667
|
return;
|
|
668
|
-
const { mountedGroups: t } =
|
|
668
|
+
const { mountedGroups: t } = O(), n = Re(e, t), o = /* @__PURE__ */ new Set(), s = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), c = /* @__PURE__ */ new Map();
|
|
669
669
|
n.forEach((i) => {
|
|
670
670
|
o.add(i.group), i.panels.forEach((l) => {
|
|
671
671
|
s.add(l);
|
|
672
672
|
}), i.separator && r.add(i.separator);
|
|
673
673
|
const a = t.get(i.group);
|
|
674
674
|
a && c.set(i.group, a.layout);
|
|
675
|
-
}),
|
|
675
|
+
}), M({
|
|
676
676
|
interactionState: {
|
|
677
677
|
hitRegions: n,
|
|
678
678
|
initialLayoutMap: c,
|
|
@@ -681,7 +681,7 @@ function ve(e) {
|
|
|
681
681
|
}
|
|
682
682
|
}), n.length && e.preventDefault();
|
|
683
683
|
}
|
|
684
|
-
function
|
|
684
|
+
function et({
|
|
685
685
|
cursorFlags: e,
|
|
686
686
|
groups: t,
|
|
687
687
|
state: n
|
|
@@ -708,7 +708,7 @@ function Qe({
|
|
|
708
708
|
return null;
|
|
709
709
|
switch (n) {
|
|
710
710
|
case "active": {
|
|
711
|
-
const r = (e &
|
|
711
|
+
const r = (e & Pe) !== 0, c = (e & Ee) !== 0, i = (e & Ce) !== 0, a = (e & Me) !== 0;
|
|
712
712
|
if (e) {
|
|
713
713
|
if (r)
|
|
714
714
|
return i ? "se-resize" : a ? "ne-resize" : "e-resize";
|
|
@@ -724,40 +724,40 @@ function Qe({
|
|
|
724
724
|
}
|
|
725
725
|
return o > 0 && s > 0 ? "move" : o > 0 ? "ew-resize" : "ns-resize";
|
|
726
726
|
}
|
|
727
|
-
let
|
|
728
|
-
function
|
|
729
|
-
|
|
730
|
-
const { cursorFlags: e, interactionState: t } =
|
|
727
|
+
let re = null, k;
|
|
728
|
+
function ae() {
|
|
729
|
+
k === void 0 && (k = new CSSStyleSheet(), document.adoptedStyleSheets = [k]);
|
|
730
|
+
const { cursorFlags: e, interactionState: t } = O();
|
|
731
731
|
switch (t.state) {
|
|
732
732
|
case "active":
|
|
733
733
|
case "hover": {
|
|
734
|
-
const n =
|
|
734
|
+
const n = et({
|
|
735
735
|
cursorFlags: e,
|
|
736
736
|
groups: t.hitRegions.map((o) => o.group),
|
|
737
737
|
state: t.state
|
|
738
738
|
});
|
|
739
|
-
if (
|
|
739
|
+
if (re === n)
|
|
740
740
|
return;
|
|
741
|
-
|
|
741
|
+
re = n, n ? k.cssRules.length === 0 ? k.insertRule(`*{cursor: ${n} !important;}`) : k.replaceSync(`*{cursor: ${n} !important;}`) : k.cssRules.length === 1 && k.deleteRule(0);
|
|
742
742
|
break;
|
|
743
743
|
}
|
|
744
744
|
case "inactive": {
|
|
745
|
-
|
|
745
|
+
re = null, k.cssRules.length === 1 && k.deleteRule(0);
|
|
746
746
|
break;
|
|
747
747
|
}
|
|
748
748
|
}
|
|
749
749
|
}
|
|
750
|
-
function
|
|
750
|
+
function ee(e) {
|
|
751
751
|
if (e.defaultPrevented)
|
|
752
752
|
return;
|
|
753
|
-
const { interactionState: t, mountedGroups: n } =
|
|
753
|
+
const { interactionState: t, mountedGroups: n } = O();
|
|
754
754
|
switch (t.state) {
|
|
755
755
|
case "active": {
|
|
756
756
|
if (
|
|
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
|
-
|
|
760
|
+
M(
|
|
761
761
|
(r) => r.interactionState.state === "inactive" ? r : {
|
|
762
762
|
cursorFlags: 0,
|
|
763
763
|
interactionState: {
|
|
@@ -771,110 +771,110 @@ function Q(e) {
|
|
|
771
771
|
const s = new Map(n);
|
|
772
772
|
t.hitRegions.forEach((r) => {
|
|
773
773
|
const { disableCursor: c, element: i, orientation: a, panels: l } = r.group;
|
|
774
|
-
let
|
|
775
|
-
t.state === "active" && (a === "horizontal" ?
|
|
776
|
-
const
|
|
774
|
+
let f = 0;
|
|
775
|
+
t.state === "active" && (a === "horizontal" ? f = (e.clientX - t.pointerDownAtPoint.x) / i.offsetWidth * 100 : f = (e.clientY - t.pointerDownAtPoint.y) / i.offsetHeight * 100);
|
|
776
|
+
const u = t.initialLayoutMap.get(
|
|
777
777
|
r.group
|
|
778
778
|
), {
|
|
779
779
|
derivedPanelConstraints: m,
|
|
780
|
-
layout:
|
|
781
|
-
separatorToPanels:
|
|
780
|
+
layout: y,
|
|
781
|
+
separatorToPanels: d
|
|
782
782
|
} = n.get(r.group) ?? {};
|
|
783
|
-
if (m &&
|
|
784
|
-
const
|
|
785
|
-
delta:
|
|
786
|
-
initialLayout:
|
|
783
|
+
if (m && u && y && d) {
|
|
784
|
+
const p = U({
|
|
785
|
+
delta: f,
|
|
786
|
+
initialLayout: u,
|
|
787
787
|
panelConstraints: m,
|
|
788
788
|
pivotIndices: r.panels.map((h) => l.indexOf(h)),
|
|
789
|
-
prevLayout:
|
|
789
|
+
prevLayout: y,
|
|
790
790
|
trigger: "mouse-or-touch"
|
|
791
791
|
});
|
|
792
|
-
if (B(
|
|
793
|
-
if (
|
|
792
|
+
if (B(p, y)) {
|
|
793
|
+
if (f !== 0 && !c)
|
|
794
794
|
switch (a) {
|
|
795
795
|
case "horizontal": {
|
|
796
|
-
o |=
|
|
796
|
+
o |= f < 0 ? Pe : Ee;
|
|
797
797
|
break;
|
|
798
798
|
}
|
|
799
799
|
case "vertical": {
|
|
800
|
-
o |=
|
|
800
|
+
o |= f < 0 ? Ce : Me;
|
|
801
801
|
break;
|
|
802
802
|
}
|
|
803
803
|
}
|
|
804
804
|
} else {
|
|
805
805
|
s.set(r.group, {
|
|
806
806
|
derivedPanelConstraints: m,
|
|
807
|
-
layout:
|
|
808
|
-
separatorToPanels:
|
|
807
|
+
layout: p,
|
|
808
|
+
separatorToPanels: d
|
|
809
809
|
});
|
|
810
|
-
const h = r.group.panels.map(({ id:
|
|
811
|
-
r.group.inMemoryLayouts[h] =
|
|
810
|
+
const h = r.group.panels.map(({ id: v }) => v).join(",");
|
|
811
|
+
r.group.inMemoryLayouts[h] = p;
|
|
812
812
|
}
|
|
813
813
|
}
|
|
814
|
-
}),
|
|
814
|
+
}), M({
|
|
815
815
|
cursorFlags: o,
|
|
816
816
|
mountedGroups: s
|
|
817
|
-
}),
|
|
817
|
+
}), ae();
|
|
818
818
|
break;
|
|
819
819
|
}
|
|
820
820
|
default: {
|
|
821
|
-
const o =
|
|
822
|
-
o.length === 0 ? t.state !== "inactive" &&
|
|
821
|
+
const o = Re(e, n);
|
|
822
|
+
o.length === 0 ? t.state !== "inactive" && M({
|
|
823
823
|
interactionState: { state: "inactive" }
|
|
824
|
-
}) :
|
|
824
|
+
}) : M({
|
|
825
825
|
interactionState: {
|
|
826
826
|
hitRegions: o,
|
|
827
827
|
state: "hover"
|
|
828
828
|
}
|
|
829
|
-
}),
|
|
829
|
+
}), ae();
|
|
830
830
|
break;
|
|
831
831
|
}
|
|
832
832
|
}
|
|
833
833
|
}
|
|
834
|
-
function
|
|
834
|
+
function ge(e) {
|
|
835
835
|
if (e.defaultPrevented)
|
|
836
836
|
return;
|
|
837
837
|
e.preventDefault();
|
|
838
|
-
const { interactionState: t } =
|
|
838
|
+
const { interactionState: t } = O();
|
|
839
839
|
switch (t.state) {
|
|
840
840
|
case "active":
|
|
841
|
-
|
|
841
|
+
M({
|
|
842
842
|
cursorFlags: 0,
|
|
843
843
|
interactionState: {
|
|
844
844
|
state: "inactive"
|
|
845
845
|
}
|
|
846
|
-
}),
|
|
846
|
+
}), ae();
|
|
847
847
|
}
|
|
848
848
|
}
|
|
849
|
-
function
|
|
849
|
+
function tt(e) {
|
|
850
850
|
let t = 0, n = 0;
|
|
851
851
|
const o = {};
|
|
852
852
|
for (const r of e)
|
|
853
853
|
if (r.defaultSize !== void 0) {
|
|
854
854
|
t++;
|
|
855
|
-
const c =
|
|
855
|
+
const c = I(r.defaultSize);
|
|
856
856
|
n += c, o[r.panelId] = c;
|
|
857
857
|
} else
|
|
858
858
|
o[r.panelId] = void 0;
|
|
859
859
|
const s = e.length - t;
|
|
860
860
|
if (s !== 0) {
|
|
861
|
-
const r =
|
|
861
|
+
const r = I((100 - n) / s);
|
|
862
862
|
for (const c of e)
|
|
863
863
|
c.defaultSize === void 0 && (o[c.panelId] = r);
|
|
864
864
|
}
|
|
865
865
|
return o;
|
|
866
866
|
}
|
|
867
|
-
function
|
|
867
|
+
function nt(e, t, n) {
|
|
868
868
|
const o = n[0];
|
|
869
869
|
if (!o)
|
|
870
870
|
return;
|
|
871
871
|
const s = e.panels.find((c) => c.element === t);
|
|
872
872
|
if (!s || !s.onResize)
|
|
873
873
|
return;
|
|
874
|
-
const r =
|
|
874
|
+
const r = ce({ group: e });
|
|
875
875
|
s.onResize(
|
|
876
876
|
{
|
|
877
|
-
asPercentage:
|
|
877
|
+
asPercentage: I(
|
|
878
878
|
o.inlineSize / r * 100
|
|
879
879
|
),
|
|
880
880
|
inPixels: o.inlineSize
|
|
@@ -882,45 +882,45 @@ function tt(e, t, n) {
|
|
|
882
882
|
s.id
|
|
883
883
|
);
|
|
884
884
|
}
|
|
885
|
-
function
|
|
885
|
+
function ot(e) {
|
|
886
886
|
let t = !0;
|
|
887
887
|
S(
|
|
888
888
|
e.separators.length === 0 || e.separators.length < e.panels.length,
|
|
889
889
|
"Invalid Group configuration; too many Separator components"
|
|
890
890
|
);
|
|
891
|
-
const n = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Set(), s = new ResizeObserver((
|
|
892
|
-
for (const m of
|
|
893
|
-
const { borderBoxSize:
|
|
894
|
-
|
|
895
|
-
const h =
|
|
891
|
+
const n = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Set(), s = new ResizeObserver((u) => {
|
|
892
|
+
for (const m of u) {
|
|
893
|
+
const { borderBoxSize: y, target: d } = m;
|
|
894
|
+
d === e.element ? t && M((p) => {
|
|
895
|
+
const h = p.mountedGroups.get(e);
|
|
896
896
|
if (h) {
|
|
897
|
-
const
|
|
897
|
+
const v = me(e), z = h.layout, x = $({
|
|
898
898
|
layout: z,
|
|
899
|
-
panelConstraints:
|
|
899
|
+
panelConstraints: v
|
|
900
900
|
});
|
|
901
901
|
return {
|
|
902
|
-
mountedGroups: new Map(
|
|
903
|
-
derivedPanelConstraints:
|
|
902
|
+
mountedGroups: new Map(p.mountedGroups).set(e, {
|
|
903
|
+
derivedPanelConstraints: v,
|
|
904
904
|
layout: x,
|
|
905
905
|
separatorToPanels: h.separatorToPanels
|
|
906
906
|
})
|
|
907
907
|
};
|
|
908
908
|
}
|
|
909
|
-
return
|
|
910
|
-
}) :
|
|
909
|
+
return p;
|
|
910
|
+
}) : nt(e, d, y);
|
|
911
911
|
}
|
|
912
912
|
});
|
|
913
|
-
s.observe(e.element), e.panels.forEach((
|
|
913
|
+
s.observe(e.element), e.panels.forEach((u) => {
|
|
914
914
|
S(
|
|
915
|
-
!n.has(
|
|
916
|
-
`Panel ids must be unique; id "${
|
|
917
|
-
), n.add(
|
|
915
|
+
!n.has(u.id),
|
|
916
|
+
`Panel ids must be unique; id "${u.id}" was used more than once`
|
|
917
|
+
), n.add(u.id), u.onResize && s.observe(u.element);
|
|
918
918
|
});
|
|
919
|
-
const r =
|
|
919
|
+
const r = me(e), c = e.panels.map(({ id: u }) => u).join(","), i = e.inMemoryLayouts[c] ?? e.defaultLayout ?? tt(r), a = $({
|
|
920
920
|
layout: i,
|
|
921
921
|
panelConstraints: r
|
|
922
|
-
}), l =
|
|
923
|
-
mountedGroups: new Map(
|
|
922
|
+
}), l = be(e), f = M((u) => ({
|
|
923
|
+
mountedGroups: new Map(u.mountedGroups).set(e, {
|
|
924
924
|
derivedPanelConstraints: r,
|
|
925
925
|
layout: a,
|
|
926
926
|
separatorToPanels: new Map(
|
|
@@ -928,35 +928,35 @@ function nt(e) {
|
|
|
928
928
|
)
|
|
929
929
|
})
|
|
930
930
|
}));
|
|
931
|
-
return e.separators.forEach((
|
|
931
|
+
return e.separators.forEach((u) => {
|
|
932
932
|
S(
|
|
933
|
-
!o.has(
|
|
934
|
-
`Separator ids must be unique; id "${
|
|
935
|
-
), o.add(
|
|
936
|
-
}),
|
|
933
|
+
!o.has(u.id),
|
|
934
|
+
`Separator ids must be unique; id "${u.id}" was used more than once`
|
|
935
|
+
), o.add(u.id), u.element.addEventListener("keydown", he);
|
|
936
|
+
}), f.mountedGroups.size === 1 && (window.addEventListener("pointerdown", ye), window.addEventListener("pointerleave", ee), window.addEventListener("pointermove", ee), window.addEventListener("pointerup", ge)), function() {
|
|
937
937
|
t = !1;
|
|
938
|
-
const m =
|
|
939
|
-
const
|
|
940
|
-
return
|
|
938
|
+
const m = M((y) => {
|
|
939
|
+
const d = new Map(y.mountedGroups);
|
|
940
|
+
return d.delete(e), { mountedGroups: d };
|
|
941
941
|
});
|
|
942
|
-
e.separators.forEach((
|
|
943
|
-
|
|
944
|
-
}), m.mountedGroups.size === 0 && (window.removeEventListener("pointerdown",
|
|
942
|
+
e.separators.forEach((y) => {
|
|
943
|
+
y.element.removeEventListener("keydown", he);
|
|
944
|
+
}), m.mountedGroups.size === 0 && (window.removeEventListener("pointerdown", ye), window.removeEventListener("pointerleave", ee), window.removeEventListener("pointermove", ee), window.removeEventListener("pointerup", ge)), s.disconnect();
|
|
945
945
|
};
|
|
946
946
|
}
|
|
947
|
-
function
|
|
948
|
-
const t =
|
|
947
|
+
function ue(e) {
|
|
948
|
+
const t = De();
|
|
949
949
|
return `${e ?? t}`;
|
|
950
950
|
}
|
|
951
|
-
const H = typeof window < "u" ?
|
|
952
|
-
function
|
|
951
|
+
const H = typeof window < "u" ? Ae : $e;
|
|
952
|
+
function fe(e) {
|
|
953
953
|
const t = T(e);
|
|
954
954
|
return H(() => {
|
|
955
955
|
t.current = e;
|
|
956
|
-
}, [e]),
|
|
956
|
+
}, [e]), Se((n) => t.current?.(n), [t]);
|
|
957
957
|
}
|
|
958
|
-
function
|
|
959
|
-
return
|
|
958
|
+
function de(...e) {
|
|
959
|
+
return fe((t) => {
|
|
960
960
|
e.forEach((n) => {
|
|
961
961
|
if (n)
|
|
962
962
|
switch (typeof n) {
|
|
@@ -972,25 +972,25 @@ function fe(...e) {
|
|
|
972
972
|
});
|
|
973
973
|
});
|
|
974
974
|
}
|
|
975
|
-
const
|
|
976
|
-
function
|
|
975
|
+
const Ge = "--react-resizable-panels--panel--pointer-events";
|
|
976
|
+
function Ie(e, t) {
|
|
977
977
|
const n = e.replace(/[^a-zA-Z0-9\-_]/g, ""), o = t.replace(/[^a-zA-Z0-9\-_]/g, "");
|
|
978
978
|
return `--react-resizable-panels--${n}--${o}`;
|
|
979
979
|
}
|
|
980
|
-
const
|
|
981
|
-
function
|
|
980
|
+
const ke = Ne(null);
|
|
981
|
+
function it(e, t) {
|
|
982
982
|
const n = T({
|
|
983
983
|
getLayout: () => ({}),
|
|
984
|
-
setLayout:
|
|
984
|
+
setLayout: Ye
|
|
985
985
|
});
|
|
986
|
-
|
|
986
|
+
xe(t, () => n.current, []), H(() => {
|
|
987
987
|
Object.assign(
|
|
988
988
|
n.current,
|
|
989
|
-
|
|
989
|
+
we({ groupId: e })
|
|
990
990
|
);
|
|
991
991
|
});
|
|
992
992
|
}
|
|
993
|
-
function
|
|
993
|
+
function dt({
|
|
994
994
|
children: e,
|
|
995
995
|
className: t,
|
|
996
996
|
defaultLayout: n,
|
|
@@ -1001,52 +1001,53 @@ function ft({
|
|
|
1001
1001
|
id: i,
|
|
1002
1002
|
onLayoutChange: a,
|
|
1003
1003
|
orientation: l = "horizontal",
|
|
1004
|
-
style:
|
|
1004
|
+
style: f,
|
|
1005
|
+
...u
|
|
1005
1006
|
}) {
|
|
1006
|
-
const
|
|
1007
|
-
B(
|
|
1008
|
-
}),
|
|
1009
|
-
|
|
1010
|
-
const
|
|
1007
|
+
const m = T({}), y = fe((b) => {
|
|
1008
|
+
B(m.current, b) || (m.current = b, a?.(b));
|
|
1009
|
+
}), d = ue(i), [p, h] = G(!1), [v, z] = G(null), [x, g] = G(n ?? {}), [L, P] = G([]), [E, K] = G([]), ne = T({}), V = T({}), q = de(z, r);
|
|
1010
|
+
it(d, c);
|
|
1011
|
+
const X = ze(
|
|
1011
1012
|
() => ({
|
|
1012
|
-
id:
|
|
1013
|
+
id: d,
|
|
1013
1014
|
orientation: l,
|
|
1014
|
-
registerPanel: (b) => (
|
|
1015
|
-
|
|
1015
|
+
registerPanel: (b) => (P((R) => se(l, [...R, b])), () => {
|
|
1016
|
+
P((R) => R.filter((N) => N !== b));
|
|
1016
1017
|
}),
|
|
1017
|
-
registerSeparator: (b) => (
|
|
1018
|
-
(
|
|
1018
|
+
registerSeparator: (b) => (K(
|
|
1019
|
+
(R) => se(l, [...R, b])
|
|
1019
1020
|
), () => {
|
|
1020
|
-
|
|
1021
|
-
(
|
|
1021
|
+
K(
|
|
1022
|
+
(R) => R.filter((N) => N !== b)
|
|
1022
1023
|
);
|
|
1023
1024
|
})
|
|
1024
1025
|
}),
|
|
1025
|
-
[
|
|
1026
|
+
[d, l]
|
|
1026
1027
|
);
|
|
1027
1028
|
H(() => {
|
|
1028
|
-
if (
|
|
1029
|
+
if (v !== null && L.length > 0) {
|
|
1029
1030
|
const b = {
|
|
1030
1031
|
defaultLayout: n,
|
|
1031
1032
|
disableCursor: !!o,
|
|
1032
1033
|
disabled: !!s,
|
|
1033
|
-
element:
|
|
1034
|
-
id:
|
|
1035
|
-
inMemoryLastExpandedPanelSizes:
|
|
1036
|
-
inMemoryLayouts:
|
|
1034
|
+
element: v,
|
|
1035
|
+
id: d,
|
|
1036
|
+
inMemoryLastExpandedPanelSizes: ne.current,
|
|
1037
|
+
inMemoryLayouts: V.current,
|
|
1037
1038
|
orientation: l,
|
|
1038
|
-
panels:
|
|
1039
|
-
separators:
|
|
1040
|
-
},
|
|
1041
|
-
|
|
1042
|
-
const
|
|
1039
|
+
panels: L,
|
|
1040
|
+
separators: E
|
|
1041
|
+
}, R = ot(b), oe = O().mountedGroups.get(b);
|
|
1042
|
+
oe && (g(oe.layout), y?.(oe.layout));
|
|
1043
|
+
const Oe = A.addListener(
|
|
1043
1044
|
"interactionStateChange",
|
|
1044
|
-
(
|
|
1045
|
-
switch (
|
|
1045
|
+
(Z) => {
|
|
1046
|
+
switch (Z.state) {
|
|
1046
1047
|
case "active":
|
|
1047
1048
|
case "hover": {
|
|
1048
|
-
|
|
1049
|
-
|
|
1049
|
+
h(
|
|
1050
|
+
Z.hitRegions.some(
|
|
1050
1051
|
(_) => _.group === b
|
|
1051
1052
|
)
|
|
1052
1053
|
);
|
|
@@ -1054,46 +1055,48 @@ function ft({
|
|
|
1054
1055
|
}
|
|
1055
1056
|
}
|
|
1056
1057
|
}
|
|
1057
|
-
),
|
|
1058
|
+
), Te = A.addListener(
|
|
1058
1059
|
"mountedGroupsChange",
|
|
1059
|
-
(
|
|
1060
|
-
const _ =
|
|
1061
|
-
_ && _.derivedPanelConstraints.length > 0 && (
|
|
1060
|
+
(Z) => {
|
|
1061
|
+
const _ = Z.get(b);
|
|
1062
|
+
_ && _.derivedPanelConstraints.length > 0 && (g(_.layout), y?.(_.layout));
|
|
1062
1063
|
}
|
|
1063
1064
|
);
|
|
1064
1065
|
return () => {
|
|
1065
|
-
|
|
1066
|
+
R(), Oe(), Te();
|
|
1066
1067
|
};
|
|
1067
1068
|
}
|
|
1068
1069
|
}, [
|
|
1069
1070
|
n,
|
|
1070
1071
|
o,
|
|
1071
1072
|
s,
|
|
1072
|
-
h,
|
|
1073
1073
|
v,
|
|
1074
|
-
|
|
1074
|
+
d,
|
|
1075
|
+
y,
|
|
1075
1076
|
l,
|
|
1076
|
-
|
|
1077
|
-
|
|
1077
|
+
L,
|
|
1078
|
+
E
|
|
1078
1079
|
]);
|
|
1079
|
-
const
|
|
1080
|
-
[
|
|
1080
|
+
const Y = {
|
|
1081
|
+
[Ge]: p ? "none" : void 0
|
|
1081
1082
|
};
|
|
1082
|
-
for (const b in
|
|
1083
|
-
const
|
|
1084
|
-
|
|
1083
|
+
for (const b in x) {
|
|
1084
|
+
const R = Ie(d, b), N = x[b];
|
|
1085
|
+
Y[R] = N;
|
|
1085
1086
|
}
|
|
1086
|
-
return /* @__PURE__ */ j(
|
|
1087
|
+
return /* @__PURE__ */ j(ke.Provider, { value: X, children: /* @__PURE__ */ j(
|
|
1087
1088
|
"div",
|
|
1088
1089
|
{
|
|
1090
|
+
...u,
|
|
1089
1091
|
"aria-orientation": l,
|
|
1090
1092
|
className: t,
|
|
1091
1093
|
"data-group": !0,
|
|
1092
|
-
"data-testid":
|
|
1093
|
-
|
|
1094
|
+
"data-testid": d,
|
|
1095
|
+
id: d,
|
|
1096
|
+
ref: q,
|
|
1094
1097
|
style: {
|
|
1095
|
-
...
|
|
1096
|
-
...
|
|
1098
|
+
...f,
|
|
1099
|
+
...Y,
|
|
1097
1100
|
display: "flex",
|
|
1098
1101
|
flexDirection: l === "horizontal" ? "row" : "column",
|
|
1099
1102
|
flexWrap: "nowrap"
|
|
@@ -1102,34 +1105,34 @@ function ft({
|
|
|
1102
1105
|
}
|
|
1103
1106
|
) });
|
|
1104
1107
|
}
|
|
1105
|
-
function
|
|
1108
|
+
function le(e) {
|
|
1106
1109
|
return `react-resizable-panels:${e}`;
|
|
1107
1110
|
}
|
|
1108
|
-
function
|
|
1111
|
+
function rt({
|
|
1109
1112
|
id: e,
|
|
1110
1113
|
layout: t,
|
|
1111
1114
|
storage: n
|
|
1112
1115
|
}) {
|
|
1113
1116
|
try {
|
|
1114
|
-
const o =
|
|
1117
|
+
const o = le(e);
|
|
1115
1118
|
n.setItem(o, JSON.stringify(t));
|
|
1116
1119
|
} catch (o) {
|
|
1117
1120
|
console.error(o);
|
|
1118
1121
|
}
|
|
1119
1122
|
}
|
|
1120
|
-
function
|
|
1123
|
+
function pt({
|
|
1121
1124
|
groupId: e,
|
|
1122
1125
|
storage: t
|
|
1123
1126
|
}) {
|
|
1124
|
-
const n =
|
|
1125
|
-
|
|
1126
|
-
() => t.getItem(
|
|
1127
|
-
() => t.getItem(
|
|
1128
|
-
), o =
|
|
1127
|
+
const n = _e(
|
|
1128
|
+
st,
|
|
1129
|
+
() => t.getItem(le(e)),
|
|
1130
|
+
() => t.getItem(le(e))
|
|
1131
|
+
), o = ze(
|
|
1129
1132
|
() => n ? JSON.parse(n) : null,
|
|
1130
1133
|
[n]
|
|
1131
|
-
), s =
|
|
1132
|
-
(r) =>
|
|
1134
|
+
), s = Se(
|
|
1135
|
+
(r) => rt({
|
|
1133
1136
|
id: e,
|
|
1134
1137
|
layout: r,
|
|
1135
1138
|
storage: t
|
|
@@ -1141,35 +1144,35 @@ function dt({
|
|
|
1141
1144
|
onLayoutChange: s
|
|
1142
1145
|
};
|
|
1143
1146
|
}
|
|
1144
|
-
function
|
|
1147
|
+
function st() {
|
|
1145
1148
|
return function() {
|
|
1146
1149
|
};
|
|
1147
1150
|
}
|
|
1148
|
-
function pt() {
|
|
1149
|
-
return M(null);
|
|
1150
|
-
}
|
|
1151
1151
|
function mt() {
|
|
1152
|
+
return G(null);
|
|
1153
|
+
}
|
|
1154
|
+
function ht() {
|
|
1152
1155
|
return T(null);
|
|
1153
1156
|
}
|
|
1154
|
-
function
|
|
1155
|
-
const e =
|
|
1157
|
+
function pe() {
|
|
1158
|
+
const e = Fe(ke);
|
|
1156
1159
|
return S(
|
|
1157
1160
|
e,
|
|
1158
1161
|
"Group Context not found; did you render a Panel or Separator outside of a Group?"
|
|
1159
1162
|
), e;
|
|
1160
1163
|
}
|
|
1161
|
-
function
|
|
1164
|
+
function at({
|
|
1162
1165
|
groupId: e,
|
|
1163
1166
|
panelId: t
|
|
1164
1167
|
}) {
|
|
1165
1168
|
const n = () => {
|
|
1166
|
-
const { mountedGroups: i } =
|
|
1169
|
+
const { mountedGroups: i } = O();
|
|
1167
1170
|
for (const [
|
|
1168
1171
|
a,
|
|
1169
|
-
{ derivedPanelConstraints: l, layout:
|
|
1172
|
+
{ derivedPanelConstraints: l, layout: f, separatorToPanels: u }
|
|
1170
1173
|
] of i)
|
|
1171
1174
|
if (a.id === e)
|
|
1172
|
-
return { derivedPanelConstraints: l, group: a, layout:
|
|
1175
|
+
return { derivedPanelConstraints: l, group: a, layout: f, separatorToPanels: u };
|
|
1173
1176
|
throw Error(`Group ${e} not found`);
|
|
1174
1177
|
}, o = () => {
|
|
1175
1178
|
const i = n().derivedPanelConstraints.find(
|
|
@@ -1194,22 +1197,22 @@ function st({
|
|
|
1194
1197
|
return;
|
|
1195
1198
|
const {
|
|
1196
1199
|
derivedPanelConstraints: l,
|
|
1197
|
-
group:
|
|
1198
|
-
layout:
|
|
1200
|
+
group: f,
|
|
1201
|
+
layout: u,
|
|
1199
1202
|
separatorToPanels: m
|
|
1200
|
-
} = n(),
|
|
1201
|
-
delta:
|
|
1202
|
-
initialLayout:
|
|
1203
|
+
} = n(), y = f.panels.findIndex((v) => v.id === t), d = y === f.panels.length - 1, p = U({
|
|
1204
|
+
delta: d ? a - i : i - a,
|
|
1205
|
+
initialLayout: u,
|
|
1203
1206
|
panelConstraints: l,
|
|
1204
|
-
pivotIndices:
|
|
1205
|
-
prevLayout:
|
|
1207
|
+
pivotIndices: d ? [y - 1, y] : [y, y + 1],
|
|
1208
|
+
prevLayout: u,
|
|
1206
1209
|
trigger: "imperative-api"
|
|
1207
1210
|
}), h = $({
|
|
1208
|
-
layout:
|
|
1211
|
+
layout: p,
|
|
1209
1212
|
panelConstraints: l
|
|
1210
1213
|
});
|
|
1211
|
-
B(
|
|
1212
|
-
mountedGroups: new Map(
|
|
1214
|
+
B(u, h) || M((v) => ({
|
|
1215
|
+
mountedGroups: new Map(v.mountedGroups).set(f, {
|
|
1213
1216
|
derivedPanelConstraints: l,
|
|
1214
1217
|
layout: h,
|
|
1215
1218
|
separatorToPanels: m
|
|
@@ -1222,27 +1225,27 @@ function st({
|
|
|
1222
1225
|
i && l !== a && c(a);
|
|
1223
1226
|
},
|
|
1224
1227
|
expand: () => {
|
|
1225
|
-
const { collapsible: i, collapsedSize: a, minSize: l } = o(),
|
|
1226
|
-
i &&
|
|
1228
|
+
const { collapsible: i, collapsedSize: a, minSize: l } = o(), f = r();
|
|
1229
|
+
i && f === a && c(l);
|
|
1227
1230
|
},
|
|
1228
1231
|
getSize: () => {
|
|
1229
|
-
const { group: i } = n(), a = r(), { element: l } = s(),
|
|
1232
|
+
const { group: i } = n(), a = r(), { element: l } = s(), f = i.orientation === "horizontal" ? l.offsetWidth : l.offsetHeight;
|
|
1230
1233
|
return {
|
|
1231
1234
|
asPercentage: a,
|
|
1232
|
-
inPixels:
|
|
1235
|
+
inPixels: f
|
|
1233
1236
|
};
|
|
1234
1237
|
},
|
|
1235
1238
|
isCollapsed: () => {
|
|
1236
1239
|
const { collapsible: i, collapsedSize: a } = o(), l = r();
|
|
1237
|
-
return i &&
|
|
1240
|
+
return i && w(a, l);
|
|
1238
1241
|
},
|
|
1239
1242
|
resize: (i) => {
|
|
1240
1243
|
if (r() !== i) {
|
|
1241
1244
|
let l;
|
|
1242
1245
|
switch (typeof i) {
|
|
1243
1246
|
case "number": {
|
|
1244
|
-
const { group:
|
|
1245
|
-
l =
|
|
1247
|
+
const { group: f } = n(), u = ce({ group: f });
|
|
1248
|
+
l = I(i / u * 100);
|
|
1246
1249
|
break;
|
|
1247
1250
|
}
|
|
1248
1251
|
case "string": {
|
|
@@ -1255,25 +1258,25 @@ function st({
|
|
|
1255
1258
|
}
|
|
1256
1259
|
};
|
|
1257
1260
|
}
|
|
1258
|
-
function
|
|
1259
|
-
const { id: n } =
|
|
1260
|
-
collapse:
|
|
1261
|
-
expand:
|
|
1261
|
+
function lt(e, t) {
|
|
1262
|
+
const { id: n } = pe(), o = T({
|
|
1263
|
+
collapse: ie,
|
|
1264
|
+
expand: ie,
|
|
1262
1265
|
getSize: () => ({
|
|
1263
1266
|
asPercentage: 0,
|
|
1264
1267
|
inPixels: 0
|
|
1265
1268
|
}),
|
|
1266
1269
|
isCollapsed: () => !1,
|
|
1267
|
-
resize:
|
|
1270
|
+
resize: ie
|
|
1268
1271
|
});
|
|
1269
|
-
|
|
1272
|
+
xe(t, () => o.current, []), H(() => {
|
|
1270
1273
|
Object.assign(
|
|
1271
1274
|
o.current,
|
|
1272
|
-
|
|
1275
|
+
at({ groupId: n, panelId: e })
|
|
1273
1276
|
);
|
|
1274
1277
|
});
|
|
1275
1278
|
}
|
|
1276
|
-
function
|
|
1279
|
+
function vt({
|
|
1277
1280
|
children: e,
|
|
1278
1281
|
className: t,
|
|
1279
1282
|
collapsedSize: n = 0,
|
|
@@ -1284,19 +1287,20 @@ function ht({
|
|
|
1284
1287
|
maxSize: i = "100",
|
|
1285
1288
|
minSize: a = "0",
|
|
1286
1289
|
onResize: l,
|
|
1287
|
-
panelRef:
|
|
1288
|
-
style:
|
|
1290
|
+
panelRef: f,
|
|
1291
|
+
style: u,
|
|
1292
|
+
...m
|
|
1289
1293
|
}) {
|
|
1290
|
-
const
|
|
1291
|
-
l?.(
|
|
1294
|
+
const y = !!c, d = ue(c), [p, h] = G(null), v = de(h, r), { id: z, registerPanel: x } = pe(), g = l !== null, L = fe((E) => {
|
|
1295
|
+
l?.(E, c);
|
|
1292
1296
|
});
|
|
1293
1297
|
H(() => {
|
|
1294
1298
|
if (p !== null)
|
|
1295
|
-
return
|
|
1299
|
+
return x({
|
|
1296
1300
|
element: p,
|
|
1297
|
-
id:
|
|
1298
|
-
idIsStable:
|
|
1299
|
-
onResize:
|
|
1301
|
+
id: d,
|
|
1302
|
+
idIsStable: y,
|
|
1303
|
+
onResize: g ? L : void 0,
|
|
1300
1304
|
panelConstraints: {
|
|
1301
1305
|
collapsedSize: n,
|
|
1302
1306
|
collapsible: o,
|
|
@@ -1310,30 +1314,32 @@ function ht({
|
|
|
1310
1314
|
o,
|
|
1311
1315
|
s,
|
|
1312
1316
|
p,
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1317
|
+
g,
|
|
1318
|
+
d,
|
|
1319
|
+
y,
|
|
1316
1320
|
i,
|
|
1317
1321
|
a,
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
]),
|
|
1321
|
-
const
|
|
1322
|
+
L,
|
|
1323
|
+
x
|
|
1324
|
+
]), lt(d, f);
|
|
1325
|
+
const P = Ie(z, d);
|
|
1322
1326
|
return /* @__PURE__ */ j(
|
|
1323
1327
|
"div",
|
|
1324
1328
|
{
|
|
1329
|
+
...m,
|
|
1325
1330
|
"data-panel": !0,
|
|
1326
|
-
"data-testid":
|
|
1327
|
-
|
|
1331
|
+
"data-testid": d,
|
|
1332
|
+
id: d,
|
|
1333
|
+
ref: v,
|
|
1328
1334
|
style: {
|
|
1329
1335
|
flexBasis: 0,
|
|
1330
|
-
flexGrow: `var(${
|
|
1336
|
+
flexGrow: `var(${P}, 1)`,
|
|
1331
1337
|
flexShrink: 1,
|
|
1332
1338
|
// Prevent Panel content from interfering with panel size
|
|
1333
1339
|
overflow: "hidden",
|
|
1334
1340
|
// Disable pointer events inside of a panel during resize
|
|
1335
1341
|
// This avoid edge cases like nested iframes
|
|
1336
|
-
pointerEvents: `var(${
|
|
1342
|
+
pointerEvents: `var(${Ge})`
|
|
1337
1343
|
},
|
|
1338
1344
|
children: /* @__PURE__ */ j(
|
|
1339
1345
|
"div",
|
|
@@ -1342,7 +1348,7 @@ function ht({
|
|
|
1342
1348
|
style: {
|
|
1343
1349
|
width: "100%",
|
|
1344
1350
|
height: "100%",
|
|
1345
|
-
...
|
|
1351
|
+
...u
|
|
1346
1352
|
},
|
|
1347
1353
|
children: e
|
|
1348
1354
|
}
|
|
@@ -1350,13 +1356,13 @@ function ht({
|
|
|
1350
1356
|
}
|
|
1351
1357
|
);
|
|
1352
1358
|
}
|
|
1353
|
-
function vt() {
|
|
1354
|
-
return M(null);
|
|
1355
|
-
}
|
|
1356
1359
|
function yt() {
|
|
1360
|
+
return G(null);
|
|
1361
|
+
}
|
|
1362
|
+
function gt() {
|
|
1357
1363
|
return T(null);
|
|
1358
1364
|
}
|
|
1359
|
-
function
|
|
1365
|
+
function ct({
|
|
1360
1366
|
layout: e,
|
|
1361
1367
|
panelConstraints: t,
|
|
1362
1368
|
panelId: n,
|
|
@@ -1367,13 +1373,13 @@ function lt({
|
|
|
1367
1373
|
(a) => a.panelId === n
|
|
1368
1374
|
);
|
|
1369
1375
|
if (i) {
|
|
1370
|
-
const a = i.maxSize, l = r = i.collapsible ? i.collapsedSize : i.minSize,
|
|
1376
|
+
const a = i.maxSize, l = r = i.collapsible ? i.collapsedSize : i.minSize, f = [o, o + 1];
|
|
1371
1377
|
r = $({
|
|
1372
1378
|
layout: U({
|
|
1373
1379
|
delta: l - c,
|
|
1374
1380
|
initialLayout: e,
|
|
1375
1381
|
panelConstraints: t,
|
|
1376
|
-
pivotIndices:
|
|
1382
|
+
pivotIndices: f,
|
|
1377
1383
|
prevLayout: e,
|
|
1378
1384
|
trigger: "keyboard"
|
|
1379
1385
|
}),
|
|
@@ -1383,7 +1389,7 @@ function lt({
|
|
|
1383
1389
|
delta: a - c,
|
|
1384
1390
|
initialLayout: e,
|
|
1385
1391
|
panelConstraints: t,
|
|
1386
|
-
pivotIndices:
|
|
1392
|
+
pivotIndices: f,
|
|
1387
1393
|
prevLayout: e,
|
|
1388
1394
|
trigger: "keyboard"
|
|
1389
1395
|
}),
|
|
@@ -1391,52 +1397,54 @@ function lt({
|
|
|
1391
1397
|
})[n];
|
|
1392
1398
|
}
|
|
1393
1399
|
return {
|
|
1400
|
+
valueControls: n,
|
|
1394
1401
|
valueMax: s,
|
|
1395
1402
|
valueMin: r,
|
|
1396
1403
|
valueNow: c
|
|
1397
1404
|
};
|
|
1398
1405
|
}
|
|
1399
|
-
function
|
|
1406
|
+
function St({
|
|
1400
1407
|
children: e,
|
|
1401
1408
|
className: t,
|
|
1402
1409
|
elementRef: n,
|
|
1403
1410
|
id: o,
|
|
1404
|
-
style: s
|
|
1411
|
+
style: s,
|
|
1412
|
+
...r
|
|
1405
1413
|
}) {
|
|
1406
|
-
const
|
|
1407
|
-
id:
|
|
1414
|
+
const c = ue(o), [i, a] = G({}), [l, f] = G("inactive"), [u, m] = G(null), y = de(m, n), {
|
|
1415
|
+
id: d,
|
|
1408
1416
|
orientation: p,
|
|
1409
|
-
registerSeparator:
|
|
1410
|
-
} =
|
|
1417
|
+
registerSeparator: h
|
|
1418
|
+
} = pe(), v = p === "horizontal" ? "vertical" : "horizontal";
|
|
1411
1419
|
return H(() => {
|
|
1412
1420
|
if (u !== null) {
|
|
1413
|
-
const
|
|
1421
|
+
const z = {
|
|
1414
1422
|
element: u,
|
|
1415
|
-
id:
|
|
1416
|
-
},
|
|
1423
|
+
id: c
|
|
1424
|
+
}, x = h(z), g = A.addListener(
|
|
1417
1425
|
"interactionStateChange",
|
|
1418
|
-
(
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
(
|
|
1422
|
-
) ?
|
|
1426
|
+
(P) => {
|
|
1427
|
+
f(
|
|
1428
|
+
P.state !== "inactive" && P.hitRegions.some(
|
|
1429
|
+
(E) => E.separator === z
|
|
1430
|
+
) ? P.state : "inactive"
|
|
1423
1431
|
);
|
|
1424
1432
|
}
|
|
1425
|
-
),
|
|
1433
|
+
), L = A.addListener(
|
|
1426
1434
|
"mountedGroupsChange",
|
|
1427
|
-
(
|
|
1428
|
-
|
|
1429
|
-
({ derivedPanelConstraints:
|
|
1430
|
-
if (
|
|
1431
|
-
const
|
|
1432
|
-
if (
|
|
1433
|
-
const
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
layout:
|
|
1437
|
-
panelConstraints:
|
|
1438
|
-
panelId:
|
|
1439
|
-
panelIndex:
|
|
1435
|
+
(P) => {
|
|
1436
|
+
P.forEach(
|
|
1437
|
+
({ derivedPanelConstraints: E, layout: K, separatorToPanels: ne }, V) => {
|
|
1438
|
+
if (V.id === d) {
|
|
1439
|
+
const q = ne.get(z);
|
|
1440
|
+
if (q) {
|
|
1441
|
+
const X = q[0], Y = V.panels.indexOf(X);
|
|
1442
|
+
a(
|
|
1443
|
+
ct({
|
|
1444
|
+
layout: K,
|
|
1445
|
+
panelConstraints: E,
|
|
1446
|
+
panelId: X.id,
|
|
1447
|
+
panelIndex: Y
|
|
1440
1448
|
})
|
|
1441
1449
|
);
|
|
1442
1450
|
}
|
|
@@ -1446,21 +1454,24 @@ function gt({
|
|
|
1446
1454
|
}
|
|
1447
1455
|
);
|
|
1448
1456
|
return () => {
|
|
1449
|
-
|
|
1457
|
+
g(), L(), x();
|
|
1450
1458
|
};
|
|
1451
1459
|
}
|
|
1452
|
-
}, [u,
|
|
1460
|
+
}, [u, d, c, h]), /* @__PURE__ */ j(
|
|
1453
1461
|
"div",
|
|
1454
1462
|
{
|
|
1455
|
-
|
|
1456
|
-
"aria-
|
|
1457
|
-
"aria-
|
|
1458
|
-
"aria-
|
|
1463
|
+
...r,
|
|
1464
|
+
"aria-controls": i.valueControls,
|
|
1465
|
+
"aria-orientation": v,
|
|
1466
|
+
"aria-valuemax": i.valueMax,
|
|
1467
|
+
"aria-valuemin": i.valueMin,
|
|
1468
|
+
"aria-valuenow": i.valueNow,
|
|
1459
1469
|
children: e,
|
|
1460
1470
|
className: t,
|
|
1461
|
-
"data-separator":
|
|
1462
|
-
"data-testid":
|
|
1463
|
-
|
|
1471
|
+
"data-separator": l,
|
|
1472
|
+
"data-testid": c,
|
|
1473
|
+
id: c,
|
|
1474
|
+
ref: y,
|
|
1464
1475
|
role: "separator",
|
|
1465
1476
|
style: {
|
|
1466
1477
|
flexBasis: "auto",
|
|
@@ -1473,13 +1484,13 @@ function gt({
|
|
|
1473
1484
|
);
|
|
1474
1485
|
}
|
|
1475
1486
|
export {
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1487
|
+
dt as Group,
|
|
1488
|
+
vt as Panel,
|
|
1489
|
+
St as Separator,
|
|
1490
|
+
pt as useDefaultLayout,
|
|
1491
|
+
mt as useGroupCallbackRef,
|
|
1492
|
+
ht as useGroupRef,
|
|
1493
|
+
yt as usePanelCallbackRef,
|
|
1494
|
+
gt as usePanelRef
|
|
1484
1495
|
};
|
|
1485
1496
|
//# sourceMappingURL=react-resizable-panels.js.map
|