react-resizable-panels 4.0.12 → 4.0.14
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,30 +1,33 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as K } from "react/jsx-runtime";
|
|
3
|
-
import { useId as
|
|
3
|
+
import { useId as Ke, useLayoutEffect as Xe, useEffect as Re, useRef as D, useCallback as qe, createContext as Ye, useImperativeHandle as Ee, useState as k, useMemo as ie, useSyncExternalStore as Ze, useContext as Je } from "react";
|
|
4
4
|
function z(e, t = "Assertion error") {
|
|
5
5
|
if (!e)
|
|
6
6
|
throw Error(t);
|
|
7
7
|
}
|
|
8
|
-
function
|
|
8
|
+
function W({
|
|
9
9
|
group: e
|
|
10
10
|
}) {
|
|
11
11
|
const { orientation: t, panels: n } = e;
|
|
12
|
-
return n.reduce((o,
|
|
12
|
+
return n.reduce((o, i) => (o += t === "horizontal" ? i.element.offsetWidth : i.element.offsetHeight, o), 0);
|
|
13
13
|
}
|
|
14
|
-
function
|
|
14
|
+
function se(e, t) {
|
|
15
15
|
return t.sort(
|
|
16
|
-
e === "horizontal" ?
|
|
16
|
+
e === "horizontal" ? Qe : et
|
|
17
17
|
);
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function Qe(e, t) {
|
|
20
20
|
const n = e.element.offsetLeft - t.element.offsetLeft;
|
|
21
21
|
return n !== 0 ? n : e.element.offsetWidth - t.element.offsetWidth;
|
|
22
22
|
}
|
|
23
|
-
function
|
|
23
|
+
function et(e, t) {
|
|
24
24
|
const n = e.element.offsetTop - t.element.offsetTop;
|
|
25
25
|
return n !== 0 ? n : e.element.offsetHeight - t.element.offsetHeight;
|
|
26
26
|
}
|
|
27
|
-
function Me(e
|
|
27
|
+
function Me(e) {
|
|
28
|
+
return e !== null && typeof e == "object" && "nodeType" in e && e.nodeType === Node.ELEMENT_NODE;
|
|
29
|
+
}
|
|
30
|
+
function ke(e, t) {
|
|
28
31
|
return {
|
|
29
32
|
x: e.x >= t.left && e.x <= t.right ? 0 : Math.min(
|
|
30
33
|
Math.abs(e.x - t.left),
|
|
@@ -36,7 +39,7 @@ function Me(e, t) {
|
|
|
36
39
|
)
|
|
37
40
|
};
|
|
38
41
|
}
|
|
39
|
-
function
|
|
42
|
+
function tt({
|
|
40
43
|
orientation: e,
|
|
41
44
|
rects: t,
|
|
42
45
|
targetRect: n
|
|
@@ -45,109 +48,109 @@ function et({
|
|
|
45
48
|
x: n.x + n.width / 2,
|
|
46
49
|
y: n.y + n.height / 2
|
|
47
50
|
};
|
|
48
|
-
let
|
|
51
|
+
let i, s = Number.MAX_VALUE;
|
|
49
52
|
for (const l of t) {
|
|
50
|
-
const { x:
|
|
51
|
-
u <
|
|
53
|
+
const { x: r, y: a } = ke(o, l), u = e === "horizontal" ? r : a;
|
|
54
|
+
u < s && (s = u, i = l);
|
|
52
55
|
}
|
|
53
|
-
return z(
|
|
56
|
+
return z(i, "No rect found"), i;
|
|
54
57
|
}
|
|
55
|
-
function
|
|
56
|
-
const { element: t, orientation: n, panels: o, separators:
|
|
58
|
+
function Ie(e) {
|
|
59
|
+
const { element: t, orientation: n, panels: o, separators: i } = e, s = se(
|
|
57
60
|
n,
|
|
58
|
-
Array.from(t.children).filter(
|
|
59
|
-
).map(({ element:
|
|
60
|
-
let
|
|
61
|
-
for (const
|
|
62
|
-
if (
|
|
63
|
-
const
|
|
64
|
-
(m) => m.element ===
|
|
61
|
+
Array.from(t.children).filter(Me).map((f) => ({ element: f }))
|
|
62
|
+
).map(({ element: f }) => f), l = [];
|
|
63
|
+
let r = !1, a, u = [];
|
|
64
|
+
for (const f of s)
|
|
65
|
+
if (f.hasAttribute("data-panel")) {
|
|
66
|
+
const p = o.find(
|
|
67
|
+
(m) => m.element === f
|
|
65
68
|
);
|
|
66
|
-
if (
|
|
67
|
-
if (
|
|
68
|
-
const m =
|
|
69
|
-
let
|
|
70
|
-
if (
|
|
69
|
+
if (p) {
|
|
70
|
+
if (a) {
|
|
71
|
+
const m = a.element.getBoundingClientRect(), h = f.getBoundingClientRect();
|
|
72
|
+
let c;
|
|
73
|
+
if (r) {
|
|
71
74
|
const d = n === "horizontal" ? new DOMRect(m.right, m.top, 0, m.height) : new DOMRect(
|
|
72
75
|
m.left,
|
|
73
76
|
m.bottom,
|
|
74
77
|
m.width,
|
|
75
78
|
0
|
|
76
|
-
), y = n === "horizontal" ? new DOMRect(
|
|
79
|
+
), y = n === "horizontal" ? new DOMRect(h.left, h.top, 0, h.height) : new DOMRect(h.left, h.top, h.width, 0);
|
|
77
80
|
switch (u.length) {
|
|
78
81
|
case 0: {
|
|
79
|
-
|
|
82
|
+
c = [
|
|
80
83
|
d,
|
|
81
84
|
y
|
|
82
85
|
];
|
|
83
86
|
break;
|
|
84
87
|
}
|
|
85
88
|
case 1: {
|
|
86
|
-
const v = u[0], S =
|
|
89
|
+
const v = u[0], S = tt({
|
|
87
90
|
orientation: n,
|
|
88
|
-
rects: [m,
|
|
91
|
+
rects: [m, h],
|
|
89
92
|
targetRect: v.element.getBoundingClientRect()
|
|
90
93
|
});
|
|
91
|
-
|
|
94
|
+
c = [
|
|
92
95
|
v,
|
|
93
96
|
S === m ? y : d
|
|
94
97
|
];
|
|
95
98
|
break;
|
|
96
99
|
}
|
|
97
100
|
default: {
|
|
98
|
-
|
|
101
|
+
c = u;
|
|
99
102
|
break;
|
|
100
103
|
}
|
|
101
104
|
}
|
|
102
105
|
} else
|
|
103
|
-
u.length ?
|
|
106
|
+
u.length ? c = u : c = [
|
|
104
107
|
n === "horizontal" ? new DOMRect(
|
|
105
108
|
m.right,
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
+
h.top,
|
|
110
|
+
h.left - m.right,
|
|
111
|
+
h.height
|
|
109
112
|
) : new DOMRect(
|
|
110
|
-
|
|
113
|
+
h.left,
|
|
111
114
|
m.bottom,
|
|
112
|
-
|
|
113
|
-
|
|
115
|
+
h.width,
|
|
116
|
+
h.top - m.bottom
|
|
114
117
|
)
|
|
115
118
|
];
|
|
116
|
-
for (const d of
|
|
119
|
+
for (const d of c)
|
|
117
120
|
l.push({
|
|
118
121
|
group: e,
|
|
119
|
-
groupSize:
|
|
120
|
-
panels: [
|
|
122
|
+
groupSize: W({ group: e }),
|
|
123
|
+
panels: [a, p],
|
|
121
124
|
separator: "width" in d ? void 0 : d,
|
|
122
125
|
rect: "width" in d ? d : d.element.getBoundingClientRect()
|
|
123
126
|
});
|
|
124
127
|
}
|
|
125
|
-
|
|
128
|
+
r = !1, a = p, u = [];
|
|
126
129
|
}
|
|
127
|
-
} else if (
|
|
128
|
-
const
|
|
129
|
-
(m) => m.element ===
|
|
130
|
+
} else if (f.hasAttribute("data-separator")) {
|
|
131
|
+
const p = i.find(
|
|
132
|
+
(m) => m.element === f
|
|
130
133
|
);
|
|
131
|
-
|
|
134
|
+
p ? u.push(p) : (a = void 0, u = []);
|
|
132
135
|
} else
|
|
133
|
-
|
|
136
|
+
r = !0;
|
|
134
137
|
return l;
|
|
135
138
|
}
|
|
136
|
-
function
|
|
139
|
+
function nt(e, t) {
|
|
137
140
|
const n = getComputedStyle(e), o = parseFloat(n.fontSize);
|
|
138
141
|
return t * o;
|
|
139
142
|
}
|
|
140
|
-
function
|
|
143
|
+
function ot(e, t) {
|
|
141
144
|
const n = getComputedStyle(e.ownerDocument.body), o = parseFloat(n.fontSize);
|
|
142
145
|
return t * o;
|
|
143
146
|
}
|
|
144
|
-
function
|
|
147
|
+
function rt(e) {
|
|
145
148
|
return e / 100 * window.innerHeight;
|
|
146
149
|
}
|
|
147
150
|
function it(e) {
|
|
148
151
|
return e / 100 * window.innerWidth;
|
|
149
152
|
}
|
|
150
|
-
function
|
|
153
|
+
function st(e) {
|
|
151
154
|
switch (typeof e) {
|
|
152
155
|
case "number":
|
|
153
156
|
return [e, "px"];
|
|
@@ -163,30 +166,30 @@ function te({
|
|
|
163
166
|
styleProp: n
|
|
164
167
|
}) {
|
|
165
168
|
let o;
|
|
166
|
-
const [
|
|
167
|
-
switch (
|
|
169
|
+
const [i, s] = st(n);
|
|
170
|
+
switch (s) {
|
|
168
171
|
case "%": {
|
|
169
|
-
o =
|
|
172
|
+
o = i / 100 * e;
|
|
170
173
|
break;
|
|
171
174
|
}
|
|
172
175
|
case "px": {
|
|
173
|
-
o =
|
|
176
|
+
o = i;
|
|
174
177
|
break;
|
|
175
178
|
}
|
|
176
179
|
case "rem": {
|
|
177
|
-
o =
|
|
180
|
+
o = ot(t, i);
|
|
178
181
|
break;
|
|
179
182
|
}
|
|
180
183
|
case "em": {
|
|
181
|
-
o =
|
|
184
|
+
o = nt(t, i);
|
|
182
185
|
break;
|
|
183
186
|
}
|
|
184
187
|
case "vh": {
|
|
185
|
-
o =
|
|
188
|
+
o = rt(i);
|
|
186
189
|
break;
|
|
187
190
|
}
|
|
188
191
|
case "vw": {
|
|
189
|
-
o = it(
|
|
192
|
+
o = it(i);
|
|
190
193
|
break;
|
|
191
194
|
}
|
|
192
195
|
}
|
|
@@ -195,8 +198,8 @@ function te({
|
|
|
195
198
|
function I(e) {
|
|
196
199
|
return parseFloat(e.toFixed(3));
|
|
197
200
|
}
|
|
198
|
-
function
|
|
199
|
-
const { panels: t } = e, n =
|
|
201
|
+
function me(e) {
|
|
202
|
+
const { panels: t } = e, n = W({ group: e });
|
|
200
203
|
return n === 0 ? t.map((o) => ({
|
|
201
204
|
collapsedSize: 0,
|
|
202
205
|
collapsible: o.panelConstraints.collapsible === !0,
|
|
@@ -205,54 +208,54 @@ function ye(e) {
|
|
|
205
208
|
maxSize: 100,
|
|
206
209
|
panelId: o.id
|
|
207
210
|
})) : t.map((o) => {
|
|
208
|
-
const { element:
|
|
211
|
+
const { element: i, panelConstraints: s } = o;
|
|
209
212
|
let l = 0;
|
|
210
|
-
if (
|
|
211
|
-
const
|
|
213
|
+
if (s.collapsedSize) {
|
|
214
|
+
const f = te({
|
|
212
215
|
groupSize: n,
|
|
213
|
-
panelElement:
|
|
214
|
-
styleProp:
|
|
216
|
+
panelElement: i,
|
|
217
|
+
styleProp: s.collapsedSize
|
|
215
218
|
});
|
|
216
|
-
l = I(
|
|
219
|
+
l = I(f / n * 100);
|
|
217
220
|
}
|
|
218
|
-
let
|
|
219
|
-
if (
|
|
220
|
-
const
|
|
221
|
+
let r;
|
|
222
|
+
if (s.defaultSize) {
|
|
223
|
+
const f = te({
|
|
221
224
|
groupSize: n,
|
|
222
|
-
panelElement:
|
|
223
|
-
styleProp:
|
|
225
|
+
panelElement: i,
|
|
226
|
+
styleProp: s.defaultSize
|
|
224
227
|
});
|
|
225
|
-
|
|
228
|
+
r = I(f / n * 100);
|
|
226
229
|
}
|
|
227
|
-
let
|
|
228
|
-
if (
|
|
229
|
-
const
|
|
230
|
+
let a = 0;
|
|
231
|
+
if (s.minSize) {
|
|
232
|
+
const f = te({
|
|
230
233
|
groupSize: n,
|
|
231
|
-
panelElement:
|
|
232
|
-
styleProp:
|
|
234
|
+
panelElement: i,
|
|
235
|
+
styleProp: s.minSize
|
|
233
236
|
});
|
|
234
|
-
|
|
237
|
+
a = I(f / n * 100);
|
|
235
238
|
}
|
|
236
239
|
let u = 100;
|
|
237
|
-
if (
|
|
238
|
-
const
|
|
240
|
+
if (s.maxSize) {
|
|
241
|
+
const f = te({
|
|
239
242
|
groupSize: n,
|
|
240
|
-
panelElement:
|
|
241
|
-
styleProp:
|
|
243
|
+
panelElement: i,
|
|
244
|
+
styleProp: s.maxSize
|
|
242
245
|
});
|
|
243
|
-
u = I(
|
|
246
|
+
u = I(f / n * 100);
|
|
244
247
|
}
|
|
245
248
|
return {
|
|
246
249
|
collapsedSize: l,
|
|
247
|
-
collapsible:
|
|
248
|
-
defaultSize:
|
|
249
|
-
minSize:
|
|
250
|
+
collapsible: s.collapsible === !0,
|
|
251
|
+
defaultSize: r,
|
|
252
|
+
minSize: a,
|
|
250
253
|
maxSize: u,
|
|
251
254
|
panelId: o.id
|
|
252
255
|
};
|
|
253
256
|
});
|
|
254
257
|
}
|
|
255
|
-
class
|
|
258
|
+
class at {
|
|
256
259
|
#e = {};
|
|
257
260
|
addListener(t, n) {
|
|
258
261
|
const o = this.#e[t];
|
|
@@ -266,18 +269,18 @@ class st {
|
|
|
266
269
|
if (o.length === 1)
|
|
267
270
|
o[0].call(null, n);
|
|
268
271
|
else {
|
|
269
|
-
let
|
|
272
|
+
let i = !1, s = null;
|
|
270
273
|
const l = Array.from(o);
|
|
271
|
-
for (let
|
|
272
|
-
const
|
|
274
|
+
for (let r = 0; r < l.length; r++) {
|
|
275
|
+
const a = l[r];
|
|
273
276
|
try {
|
|
274
|
-
|
|
277
|
+
a.call(null, n);
|
|
275
278
|
} catch (u) {
|
|
276
|
-
|
|
279
|
+
s === null && (i = !0, s = u);
|
|
277
280
|
}
|
|
278
281
|
}
|
|
279
|
-
if (
|
|
280
|
-
throw
|
|
282
|
+
if (i)
|
|
283
|
+
throw s;
|
|
281
284
|
}
|
|
282
285
|
}
|
|
283
286
|
removeAllListeners() {
|
|
@@ -286,12 +289,12 @@ class st {
|
|
|
286
289
|
removeListener(t, n) {
|
|
287
290
|
const o = this.#e[t];
|
|
288
291
|
if (o !== void 0) {
|
|
289
|
-
const
|
|
290
|
-
|
|
292
|
+
const i = o.indexOf(n);
|
|
293
|
+
i >= 0 && o.splice(i, 1);
|
|
291
294
|
}
|
|
292
295
|
}
|
|
293
296
|
}
|
|
294
|
-
function
|
|
297
|
+
function C(e, t, n = 0) {
|
|
295
298
|
return Math.abs(I(e) - I(t)) <= n;
|
|
296
299
|
}
|
|
297
300
|
let R = {
|
|
@@ -301,8 +304,8 @@ let R = {
|
|
|
301
304
|
},
|
|
302
305
|
mountedGroups: /* @__PURE__ */ new Map()
|
|
303
306
|
};
|
|
304
|
-
const
|
|
305
|
-
function
|
|
307
|
+
const T = new at();
|
|
308
|
+
function G() {
|
|
306
309
|
return R;
|
|
307
310
|
}
|
|
308
311
|
function E(e) {
|
|
@@ -313,96 +316,25 @@ function E(e) {
|
|
|
313
316
|
return R = {
|
|
314
317
|
...R,
|
|
315
318
|
...t
|
|
316
|
-
}, t.cursorFlags !== void 0 &&
|
|
317
|
-
o.derivedPanelConstraints.forEach((
|
|
318
|
-
if (
|
|
319
|
-
const { layout: l } = n.mountedGroups.get(
|
|
319
|
+
}, t.cursorFlags !== void 0 && T.emit("cursorFlagsChange", R.cursorFlags), t.interactionState !== void 0 && T.emit("interactionStateChange", R.interactionState), t.mountedGroups !== void 0 && (R.mountedGroups.forEach((o, i) => {
|
|
320
|
+
o.derivedPanelConstraints.forEach((s) => {
|
|
321
|
+
if (s.collapsible) {
|
|
322
|
+
const { layout: l } = n.mountedGroups.get(i) ?? {};
|
|
320
323
|
if (l) {
|
|
321
|
-
const
|
|
322
|
-
|
|
323
|
-
o.layout[
|
|
324
|
-
),
|
|
325
|
-
|
|
326
|
-
l[
|
|
324
|
+
const r = C(
|
|
325
|
+
s.collapsedSize,
|
|
326
|
+
o.layout[s.panelId]
|
|
327
|
+
), a = C(
|
|
328
|
+
s.collapsedSize,
|
|
329
|
+
l[s.panelId]
|
|
327
330
|
);
|
|
328
|
-
|
|
331
|
+
r && !a && (i.inMemoryLastExpandedPanelSizes[s.panelId] = l[s.panelId]);
|
|
329
332
|
}
|
|
330
333
|
}
|
|
331
334
|
});
|
|
332
|
-
}),
|
|
333
|
-
}
|
|
334
|
-
const at = (e) => e, ie = () => {
|
|
335
|
-
}, Ie = 1, Ge = 2, De = 4, Oe = 8, ge = {
|
|
336
|
-
coarse: 10,
|
|
337
|
-
precise: 5
|
|
338
|
-
};
|
|
339
|
-
function lt({
|
|
340
|
-
cursorFlags: e,
|
|
341
|
-
groups: t,
|
|
342
|
-
state: n
|
|
343
|
-
}) {
|
|
344
|
-
let o = 0, r = 0;
|
|
345
|
-
switch (n) {
|
|
346
|
-
case "active":
|
|
347
|
-
case "hover":
|
|
348
|
-
t.forEach((a) => {
|
|
349
|
-
if (!a.disableCursor)
|
|
350
|
-
switch (a.orientation) {
|
|
351
|
-
case "horizontal": {
|
|
352
|
-
o++;
|
|
353
|
-
break;
|
|
354
|
-
}
|
|
355
|
-
case "vertical": {
|
|
356
|
-
r++;
|
|
357
|
-
break;
|
|
358
|
-
}
|
|
359
|
-
}
|
|
360
|
-
});
|
|
361
|
-
}
|
|
362
|
-
if (o === 0 && r === 0)
|
|
363
|
-
return null;
|
|
364
|
-
switch (n) {
|
|
365
|
-
case "active": {
|
|
366
|
-
const a = (e & Ie) !== 0, l = (e & Ge) !== 0, i = (e & De) !== 0, s = (e & Oe) !== 0;
|
|
367
|
-
if (e) {
|
|
368
|
-
if (a)
|
|
369
|
-
return i ? "se-resize" : s ? "ne-resize" : "e-resize";
|
|
370
|
-
if (l)
|
|
371
|
-
return i ? "sw-resize" : s ? "nw-resize" : "w-resize";
|
|
372
|
-
if (i)
|
|
373
|
-
return "s-resize";
|
|
374
|
-
if (s)
|
|
375
|
-
return "n-resize";
|
|
376
|
-
}
|
|
377
|
-
break;
|
|
378
|
-
}
|
|
379
|
-
}
|
|
380
|
-
return o > 0 && r > 0 ? "move" : o > 0 ? "ew-resize" : "ns-resize";
|
|
381
|
-
}
|
|
382
|
-
let re, G;
|
|
383
|
-
function le() {
|
|
384
|
-
G === void 0 && (G = new CSSStyleSheet(), document.adoptedStyleSheets = [G]);
|
|
385
|
-
const { cursorFlags: e, interactionState: t } = D();
|
|
386
|
-
switch (t.state) {
|
|
387
|
-
case "active":
|
|
388
|
-
case "hover": {
|
|
389
|
-
const n = lt({
|
|
390
|
-
cursorFlags: e,
|
|
391
|
-
groups: t.hitRegions.map((r) => r.group),
|
|
392
|
-
state: t.state
|
|
393
|
-
}), o = `*{cursor: ${n} !important; ${t.state === "active" ? "touch-action: none;" : ""} }`;
|
|
394
|
-
if (re === o)
|
|
395
|
-
return;
|
|
396
|
-
re = o, n ? G.cssRules.length === 0 ? G.insertRule(o) : G.replaceSync(o) : G.cssRules.length === 1 && G.deleteRule(0);
|
|
397
|
-
break;
|
|
398
|
-
}
|
|
399
|
-
case "inactive": {
|
|
400
|
-
re = void 0, G.cssRules.length === 1 && G.deleteRule(0);
|
|
401
|
-
break;
|
|
402
|
-
}
|
|
403
|
-
}
|
|
335
|
+
}), T.emit("mountedGroupsChange", R.mountedGroups)), R;
|
|
404
336
|
}
|
|
405
|
-
function
|
|
337
|
+
function lt(e, t) {
|
|
406
338
|
if (e.length !== t.length)
|
|
407
339
|
return !1;
|
|
408
340
|
for (let n = 0; n < e.length; n++)
|
|
@@ -411,45 +343,45 @@ function ut(e, t) {
|
|
|
411
343
|
return !0;
|
|
412
344
|
}
|
|
413
345
|
function X(e, t) {
|
|
414
|
-
return
|
|
346
|
+
return C(e, t) ? 0 : e > t ? 1 : -1;
|
|
415
347
|
}
|
|
416
|
-
function
|
|
348
|
+
function B({
|
|
417
349
|
panelConstraints: e,
|
|
418
350
|
size: t
|
|
419
351
|
}) {
|
|
420
352
|
const {
|
|
421
353
|
collapsedSize: n = 0,
|
|
422
354
|
collapsible: o,
|
|
423
|
-
maxSize:
|
|
424
|
-
minSize:
|
|
355
|
+
maxSize: i = 100,
|
|
356
|
+
minSize: s = 0
|
|
425
357
|
} = e;
|
|
426
|
-
if (X(t,
|
|
358
|
+
if (X(t, s) < 0)
|
|
427
359
|
if (o) {
|
|
428
|
-
const l = (n +
|
|
429
|
-
X(t, l) < 0 ? t = n : t =
|
|
360
|
+
const l = (n + s) / 2;
|
|
361
|
+
X(t, l) < 0 ? t = n : t = s;
|
|
430
362
|
} else
|
|
431
|
-
t =
|
|
432
|
-
return t = Math.min(
|
|
363
|
+
t = s;
|
|
364
|
+
return t = Math.min(i, t), t = I(t), t;
|
|
433
365
|
}
|
|
434
|
-
function
|
|
366
|
+
function q({
|
|
435
367
|
delta: e,
|
|
436
368
|
initialLayout: t,
|
|
437
369
|
panelConstraints: n,
|
|
438
370
|
pivotIndices: o,
|
|
439
|
-
prevLayout:
|
|
440
|
-
trigger:
|
|
371
|
+
prevLayout: i,
|
|
372
|
+
trigger: s
|
|
441
373
|
}) {
|
|
442
|
-
if (
|
|
374
|
+
if (C(e, 0))
|
|
443
375
|
return t;
|
|
444
|
-
const l = Object.values(t),
|
|
445
|
-
z(u != null, "Invalid first pivot index"), z(
|
|
446
|
-
let
|
|
447
|
-
if (
|
|
376
|
+
const l = Object.values(t), r = Object.values(i), a = [...l], [u, f] = o;
|
|
377
|
+
z(u != null, "Invalid first pivot index"), z(f != null, "Invalid second pivot index");
|
|
378
|
+
let p = 0;
|
|
379
|
+
if (s === "keyboard") {
|
|
448
380
|
{
|
|
449
|
-
const
|
|
381
|
+
const c = e < 0 ? f : u, d = n[c];
|
|
450
382
|
z(
|
|
451
383
|
d,
|
|
452
|
-
`Panel constraints not found for index ${
|
|
384
|
+
`Panel constraints not found for index ${c}`
|
|
453
385
|
);
|
|
454
386
|
const {
|
|
455
387
|
collapsedSize: y = 0,
|
|
@@ -457,21 +389,21 @@ function Y({
|
|
|
457
389
|
minSize: S = 0
|
|
458
390
|
} = d;
|
|
459
391
|
if (v) {
|
|
460
|
-
const x = l[
|
|
392
|
+
const x = l[c];
|
|
461
393
|
if (z(
|
|
462
394
|
x != null,
|
|
463
|
-
`Previous layout not found for panel index ${
|
|
464
|
-
),
|
|
395
|
+
`Previous layout not found for panel index ${c}`
|
|
396
|
+
), C(x, y)) {
|
|
465
397
|
const g = S - x;
|
|
466
398
|
X(g, Math.abs(e)) > 0 && (e = e < 0 ? 0 - g : g);
|
|
467
399
|
}
|
|
468
400
|
}
|
|
469
401
|
}
|
|
470
402
|
{
|
|
471
|
-
const
|
|
403
|
+
const c = e < 0 ? u : f, d = n[c];
|
|
472
404
|
z(
|
|
473
405
|
d,
|
|
474
|
-
`No panel constraints found for index ${
|
|
406
|
+
`No panel constraints found for index ${c}`
|
|
475
407
|
);
|
|
476
408
|
const {
|
|
477
409
|
collapsedSize: y = 0,
|
|
@@ -479,11 +411,11 @@ function Y({
|
|
|
479
411
|
minSize: S = 0
|
|
480
412
|
} = d;
|
|
481
413
|
if (v) {
|
|
482
|
-
const x = l[
|
|
414
|
+
const x = l[c];
|
|
483
415
|
if (z(
|
|
484
416
|
x != null,
|
|
485
|
-
`Previous layout not found for panel index ${
|
|
486
|
-
),
|
|
417
|
+
`Previous layout not found for panel index ${c}`
|
|
418
|
+
), C(x, S)) {
|
|
487
419
|
const g = x - y;
|
|
488
420
|
X(g, Math.abs(e)) > 0 && (e = e < 0 ? 0 - g : g);
|
|
489
421
|
}
|
|
@@ -491,226 +423,150 @@ function Y({
|
|
|
491
423
|
}
|
|
492
424
|
}
|
|
493
425
|
{
|
|
494
|
-
const
|
|
495
|
-
let d = e < 0 ?
|
|
426
|
+
const c = e < 0 ? 1 : -1;
|
|
427
|
+
let d = e < 0 ? f : u, y = 0;
|
|
496
428
|
for (; ; ) {
|
|
497
429
|
const S = l[d];
|
|
498
430
|
z(
|
|
499
431
|
S != null,
|
|
500
432
|
`Previous layout not found for panel index ${d}`
|
|
501
433
|
);
|
|
502
|
-
const g =
|
|
434
|
+
const g = B({
|
|
503
435
|
panelConstraints: n[d],
|
|
504
436
|
size: 100
|
|
505
437
|
}) - S;
|
|
506
|
-
if (y += g, d +=
|
|
438
|
+
if (y += g, d += c, d < 0 || d >= n.length)
|
|
507
439
|
break;
|
|
508
440
|
}
|
|
509
441
|
const v = Math.min(Math.abs(e), Math.abs(y));
|
|
510
442
|
e = e < 0 ? 0 - v : v;
|
|
511
443
|
}
|
|
512
444
|
{
|
|
513
|
-
let d = e < 0 ? u :
|
|
445
|
+
let d = e < 0 ? u : f;
|
|
514
446
|
for (; d >= 0 && d < n.length; ) {
|
|
515
|
-
const y = Math.abs(e) - Math.abs(
|
|
447
|
+
const y = Math.abs(e) - Math.abs(p), v = l[d];
|
|
516
448
|
z(
|
|
517
449
|
v != null,
|
|
518
450
|
`Previous layout not found for panel index ${d}`
|
|
519
451
|
);
|
|
520
|
-
const S = v - y, x =
|
|
452
|
+
const S = v - y, x = B({
|
|
521
453
|
panelConstraints: n[d],
|
|
522
454
|
size: S
|
|
523
455
|
});
|
|
524
|
-
if (!
|
|
456
|
+
if (!C(v, x) && (p += v - x, a[d] = x, p.toFixed(3).localeCompare(Math.abs(e).toFixed(3), void 0, {
|
|
525
457
|
numeric: !0
|
|
526
458
|
}) >= 0))
|
|
527
459
|
break;
|
|
528
460
|
e < 0 ? d-- : d++;
|
|
529
461
|
}
|
|
530
462
|
}
|
|
531
|
-
if (
|
|
532
|
-
return
|
|
463
|
+
if (lt(r, a))
|
|
464
|
+
return i;
|
|
533
465
|
{
|
|
534
|
-
const
|
|
466
|
+
const c = e < 0 ? f : u, d = l[c];
|
|
535
467
|
z(
|
|
536
468
|
d != null,
|
|
537
|
-
`Previous layout not found for panel index ${
|
|
469
|
+
`Previous layout not found for panel index ${c}`
|
|
538
470
|
);
|
|
539
|
-
const y = d +
|
|
540
|
-
panelConstraints: n[
|
|
471
|
+
const y = d + p, v = B({
|
|
472
|
+
panelConstraints: n[c],
|
|
541
473
|
size: y
|
|
542
474
|
});
|
|
543
|
-
if (
|
|
544
|
-
let S = y - v, g = e < 0 ?
|
|
475
|
+
if (a[c] = v, !C(v, y)) {
|
|
476
|
+
let S = y - v, g = e < 0 ? f : u;
|
|
545
477
|
for (; g >= 0 && g < n.length; ) {
|
|
546
|
-
const
|
|
478
|
+
const w = a[g];
|
|
547
479
|
z(
|
|
548
|
-
|
|
480
|
+
w != null,
|
|
549
481
|
`Previous layout not found for panel index ${g}`
|
|
550
482
|
);
|
|
551
|
-
const L =
|
|
483
|
+
const L = w + S, P = B({
|
|
552
484
|
panelConstraints: n[g],
|
|
553
485
|
size: L
|
|
554
486
|
});
|
|
555
|
-
if (
|
|
487
|
+
if (C(w, P) || (S -= P - w, a[g] = P), C(S, 0))
|
|
556
488
|
break;
|
|
557
489
|
e > 0 ? g-- : g++;
|
|
558
490
|
}
|
|
559
491
|
}
|
|
560
492
|
}
|
|
561
|
-
const m = Object.values(
|
|
562
|
-
(
|
|
493
|
+
const m = Object.values(a).reduce(
|
|
494
|
+
(c, d) => d + c,
|
|
563
495
|
0
|
|
564
496
|
);
|
|
565
|
-
if (!
|
|
566
|
-
return
|
|
567
|
-
const
|
|
568
|
-
return
|
|
569
|
-
}
|
|
570
|
-
function U(e, t) {
|
|
571
|
-
if (Object.keys(e).length !== Object.keys(t).length)
|
|
572
|
-
return !1;
|
|
573
|
-
for (const n in e)
|
|
574
|
-
if (t[n] === void 0 || X(e[n], t[n]) !== 0)
|
|
575
|
-
return !1;
|
|
576
|
-
return !0;
|
|
577
|
-
}
|
|
578
|
-
function Te({
|
|
579
|
-
event: e,
|
|
580
|
-
hitRegions: t,
|
|
581
|
-
initialLayoutMap: n,
|
|
582
|
-
mountedGroups: o,
|
|
583
|
-
pointerDownAtPoint: r
|
|
584
|
-
}) {
|
|
585
|
-
let a = 0;
|
|
586
|
-
const l = new Map(o);
|
|
587
|
-
t.forEach((i) => {
|
|
588
|
-
const { group: s, groupSize: u } = i, { disableCursor: c, orientation: h, panels: m } = s;
|
|
589
|
-
let p = 0;
|
|
590
|
-
r ? h === "horizontal" ? p = (e.clientX - r.x) / u * 100 : p = (e.clientY - r.y) / u * 100 : h === "horizontal" ? p = e.clientX < 0 ? -100 : 100 : p = e.clientY < 0 ? -100 : 100;
|
|
591
|
-
const f = n.get(s), {
|
|
592
|
-
defaultLayoutDeferred: d,
|
|
593
|
-
derivedPanelConstraints: y,
|
|
594
|
-
layout: v,
|
|
595
|
-
separatorToPanels: S
|
|
596
|
-
} = o.get(s) ?? { defaultLayoutDeferred: !1 };
|
|
597
|
-
if (y && f && v && S) {
|
|
598
|
-
const x = Y({
|
|
599
|
-
delta: p,
|
|
600
|
-
initialLayout: f,
|
|
601
|
-
panelConstraints: y,
|
|
602
|
-
pivotIndices: i.panels.map((g) => m.indexOf(g)),
|
|
603
|
-
prevLayout: v,
|
|
604
|
-
trigger: "mouse-or-touch"
|
|
605
|
-
});
|
|
606
|
-
if (U(x, v)) {
|
|
607
|
-
if (p !== 0 && !c)
|
|
608
|
-
switch (h) {
|
|
609
|
-
case "horizontal": {
|
|
610
|
-
a |= p < 0 ? Ie : Ge;
|
|
611
|
-
break;
|
|
612
|
-
}
|
|
613
|
-
case "vertical": {
|
|
614
|
-
a |= p < 0 ? De : Oe;
|
|
615
|
-
break;
|
|
616
|
-
}
|
|
617
|
-
}
|
|
618
|
-
} else {
|
|
619
|
-
l.set(i.group, {
|
|
620
|
-
defaultLayoutDeferred: d,
|
|
621
|
-
derivedPanelConstraints: y,
|
|
622
|
-
layout: x,
|
|
623
|
-
separatorToPanels: S
|
|
624
|
-
});
|
|
625
|
-
const g = i.group.panels.map(({ id: b }) => b).join(",");
|
|
626
|
-
i.group.inMemoryLayouts[g] = x;
|
|
627
|
-
}
|
|
628
|
-
}
|
|
629
|
-
}), E({
|
|
630
|
-
cursorFlags: a,
|
|
631
|
-
mountedGroups: l
|
|
632
|
-
}), le();
|
|
633
|
-
}
|
|
634
|
-
function ve(e) {
|
|
635
|
-
if (e.defaultPrevented)
|
|
636
|
-
return;
|
|
637
|
-
if (e.relatedTarget !== null)
|
|
638
|
-
return;
|
|
639
|
-
if (e.clientX === 0 && e.clientY === 0)
|
|
640
|
-
return;
|
|
641
|
-
const { interactionState: t, mountedGroups: n } = D();
|
|
642
|
-
switch (t.state) {
|
|
643
|
-
case "active":
|
|
644
|
-
t.hitRegions.forEach((o) => {
|
|
645
|
-
e.currentTarget === o.group.element && Te({
|
|
646
|
-
event: e,
|
|
647
|
-
hitRegions: t.hitRegions,
|
|
648
|
-
initialLayoutMap: t.initialLayoutMap,
|
|
649
|
-
mountedGroups: n
|
|
650
|
-
});
|
|
651
|
-
});
|
|
652
|
-
}
|
|
497
|
+
if (!C(m, 100, 0.1))
|
|
498
|
+
return i;
|
|
499
|
+
const h = Object.keys(i);
|
|
500
|
+
return a.reduce((c, d, y) => (c[h[y]] = d, c), {});
|
|
653
501
|
}
|
|
654
502
|
function oe(e) {
|
|
655
503
|
const t = e.parentElement;
|
|
656
504
|
z(t, "Parent group element not found");
|
|
657
|
-
const { mountedGroups: n } =
|
|
505
|
+
const { mountedGroups: n } = G();
|
|
658
506
|
for (const [o] of n)
|
|
659
507
|
if (o.element === t)
|
|
660
508
|
return o;
|
|
661
509
|
throw Error("Could not find parent Group for separator element");
|
|
662
510
|
}
|
|
663
|
-
function
|
|
511
|
+
function V(e, t) {
|
|
512
|
+
if (Object.keys(e).length !== Object.keys(t).length)
|
|
513
|
+
return !1;
|
|
514
|
+
for (const n in e)
|
|
515
|
+
if (t[n] === void 0 || X(e[n], t[n]) !== 0)
|
|
516
|
+
return !1;
|
|
517
|
+
return !0;
|
|
518
|
+
}
|
|
519
|
+
function _({
|
|
664
520
|
layout: e,
|
|
665
521
|
panelConstraints: t
|
|
666
522
|
}) {
|
|
667
|
-
const o = [...Object.values(e)],
|
|
668
|
-
(
|
|
523
|
+
const o = [...Object.values(e)], i = o.reduce(
|
|
524
|
+
(r, a) => r + a,
|
|
669
525
|
0
|
|
670
526
|
);
|
|
671
527
|
if (o.length !== t.length)
|
|
672
528
|
throw Error(
|
|
673
|
-
`Invalid ${t.length} panel layout: ${o.map((
|
|
529
|
+
`Invalid ${t.length} panel layout: ${o.map((r) => `${r}%`).join(", ")}`
|
|
674
530
|
);
|
|
675
|
-
if (!
|
|
676
|
-
for (let
|
|
677
|
-
const
|
|
678
|
-
z(
|
|
679
|
-
const u = 100 /
|
|
680
|
-
o[
|
|
531
|
+
if (!C(i, 100) && o.length > 0)
|
|
532
|
+
for (let r = 0; r < t.length; r++) {
|
|
533
|
+
const a = o[r];
|
|
534
|
+
z(a != null, `No layout data found for index ${r}`);
|
|
535
|
+
const u = 100 / i * a;
|
|
536
|
+
o[r] = u;
|
|
681
537
|
}
|
|
682
|
-
let
|
|
683
|
-
for (let
|
|
684
|
-
const
|
|
685
|
-
z(
|
|
686
|
-
const u =
|
|
687
|
-
panelConstraints: t[
|
|
688
|
-
size:
|
|
538
|
+
let s = 0;
|
|
539
|
+
for (let r = 0; r < t.length; r++) {
|
|
540
|
+
const a = o[r];
|
|
541
|
+
z(a != null, `No layout data found for index ${r}`);
|
|
542
|
+
const u = B({
|
|
543
|
+
panelConstraints: t[r],
|
|
544
|
+
size: a
|
|
689
545
|
});
|
|
690
|
-
|
|
546
|
+
a != u && (s += a - u, o[r] = u);
|
|
691
547
|
}
|
|
692
|
-
if (!
|
|
693
|
-
for (let
|
|
694
|
-
const
|
|
695
|
-
z(
|
|
696
|
-
const u =
|
|
697
|
-
panelConstraints: t[
|
|
548
|
+
if (!C(s, 0))
|
|
549
|
+
for (let r = 0; r < t.length; r++) {
|
|
550
|
+
const a = o[r];
|
|
551
|
+
z(a != null, `No layout data found for index ${r}`);
|
|
552
|
+
const u = a + s, f = B({
|
|
553
|
+
panelConstraints: t[r],
|
|
698
554
|
size: u
|
|
699
555
|
});
|
|
700
|
-
if (
|
|
556
|
+
if (a !== f && (s -= f - a, o[r] = f, C(s, 0)))
|
|
701
557
|
break;
|
|
702
558
|
}
|
|
703
559
|
const l = Object.keys(e);
|
|
704
|
-
return o.reduce((
|
|
560
|
+
return o.reduce((r, a, u) => (r[l[u]] = a, r), {});
|
|
705
561
|
}
|
|
706
|
-
function
|
|
562
|
+
function Ge({
|
|
707
563
|
groupId: e
|
|
708
564
|
}) {
|
|
709
565
|
const t = () => {
|
|
710
|
-
const { mountedGroups: n } =
|
|
711
|
-
for (const [o,
|
|
566
|
+
const { mountedGroups: n } = G();
|
|
567
|
+
for (const [o, i] of n)
|
|
712
568
|
if (o.id === e)
|
|
713
|
-
return { group: o, ...
|
|
569
|
+
return { group: o, ...i };
|
|
714
570
|
throw Error(`Could not find Group with id "${e}"`);
|
|
715
571
|
};
|
|
716
572
|
return {
|
|
@@ -721,137 +577,142 @@ function _e({
|
|
|
721
577
|
setLayout(n) {
|
|
722
578
|
const {
|
|
723
579
|
defaultLayoutDeferred: o,
|
|
724
|
-
derivedPanelConstraints:
|
|
725
|
-
group:
|
|
580
|
+
derivedPanelConstraints: i,
|
|
581
|
+
group: s,
|
|
726
582
|
layout: l,
|
|
727
|
-
separatorToPanels:
|
|
728
|
-
} = t(),
|
|
583
|
+
separatorToPanels: r
|
|
584
|
+
} = t(), a = _({
|
|
729
585
|
layout: n,
|
|
730
|
-
panelConstraints:
|
|
586
|
+
panelConstraints: i
|
|
731
587
|
});
|
|
732
|
-
return o ? l : (
|
|
733
|
-
mountedGroups: new Map(u.mountedGroups).set(
|
|
588
|
+
return o ? l : (V(l, a) || E((u) => ({
|
|
589
|
+
mountedGroups: new Map(u.mountedGroups).set(s, {
|
|
734
590
|
defaultLayoutDeferred: o,
|
|
735
|
-
derivedPanelConstraints:
|
|
736
|
-
layout:
|
|
737
|
-
separatorToPanels:
|
|
591
|
+
derivedPanelConstraints: i,
|
|
592
|
+
layout: a,
|
|
593
|
+
separatorToPanels: r
|
|
738
594
|
})
|
|
739
|
-
})),
|
|
595
|
+
})), a);
|
|
740
596
|
}
|
|
741
597
|
};
|
|
742
598
|
}
|
|
743
|
-
function
|
|
744
|
-
const { mountedGroups: t } =
|
|
599
|
+
function De(e) {
|
|
600
|
+
const { mountedGroups: t } = G(), n = t.get(e);
|
|
745
601
|
return z(n, `Mounted Group ${e.id} not found`), n;
|
|
746
602
|
}
|
|
747
|
-
function
|
|
748
|
-
const n = oe(e), o =
|
|
749
|
-
(
|
|
603
|
+
function O(e, t) {
|
|
604
|
+
const n = oe(e), o = De(n), i = n.separators.find(
|
|
605
|
+
(p) => p.element === e
|
|
750
606
|
);
|
|
751
|
-
z(
|
|
752
|
-
const
|
|
753
|
-
z(
|
|
754
|
-
const l =
|
|
607
|
+
z(i, "Matching separator not found");
|
|
608
|
+
const s = o.separatorToPanels.get(i);
|
|
609
|
+
z(s, "Matching panels not found");
|
|
610
|
+
const l = s.map((p) => n.panels.indexOf(p)), a = Ge({ groupId: n.id }).getLayout(), u = q({
|
|
755
611
|
delta: t,
|
|
756
|
-
initialLayout:
|
|
612
|
+
initialLayout: a,
|
|
757
613
|
panelConstraints: o.derivedPanelConstraints,
|
|
758
614
|
pivotIndices: l,
|
|
759
|
-
prevLayout:
|
|
615
|
+
prevLayout: a,
|
|
760
616
|
trigger: "keyboard"
|
|
761
|
-
}),
|
|
617
|
+
}), f = _({
|
|
762
618
|
layout: u,
|
|
763
619
|
panelConstraints: o.derivedPanelConstraints
|
|
764
620
|
});
|
|
765
|
-
|
|
766
|
-
mountedGroups: new Map(
|
|
621
|
+
V(a, f) || E((p) => ({
|
|
622
|
+
mountedGroups: new Map(p.mountedGroups).set(n, {
|
|
767
623
|
defaultLayoutDeferred: o.defaultLayoutDeferred,
|
|
768
624
|
derivedPanelConstraints: o.derivedPanelConstraints,
|
|
769
|
-
layout:
|
|
625
|
+
layout: f,
|
|
770
626
|
separatorToPanels: o.separatorToPanels
|
|
771
627
|
})
|
|
772
628
|
}));
|
|
773
629
|
}
|
|
774
|
-
function
|
|
630
|
+
function ye(e) {
|
|
775
631
|
if (e.defaultPrevented)
|
|
776
632
|
return;
|
|
777
633
|
const t = e.currentTarget, n = oe(t);
|
|
778
634
|
if (!n.disabled)
|
|
779
635
|
switch (e.key) {
|
|
780
636
|
case "ArrowDown": {
|
|
781
|
-
e.preventDefault(), n.orientation === "vertical" &&
|
|
637
|
+
e.preventDefault(), n.orientation === "vertical" && O(t, 5);
|
|
782
638
|
break;
|
|
783
639
|
}
|
|
784
640
|
case "ArrowLeft": {
|
|
785
|
-
e.preventDefault(), n.orientation === "horizontal" &&
|
|
641
|
+
e.preventDefault(), n.orientation === "horizontal" && O(t, -5);
|
|
786
642
|
break;
|
|
787
643
|
}
|
|
788
644
|
case "ArrowRight": {
|
|
789
|
-
e.preventDefault(), n.orientation === "horizontal" &&
|
|
645
|
+
e.preventDefault(), n.orientation === "horizontal" && O(t, 5);
|
|
790
646
|
break;
|
|
791
647
|
}
|
|
792
648
|
case "ArrowUp": {
|
|
793
|
-
e.preventDefault(), n.orientation === "vertical" &&
|
|
649
|
+
e.preventDefault(), n.orientation === "vertical" && O(t, -5);
|
|
794
650
|
break;
|
|
795
651
|
}
|
|
796
652
|
case "End": {
|
|
797
|
-
e.preventDefault(),
|
|
653
|
+
e.preventDefault(), O(t, 100);
|
|
798
654
|
break;
|
|
799
655
|
}
|
|
800
656
|
case "Enter": {
|
|
801
657
|
e.preventDefault();
|
|
802
|
-
const o = oe(t), { derivedPanelConstraints:
|
|
803
|
-
(
|
|
658
|
+
const o = oe(t), { derivedPanelConstraints: i, layout: s, separatorToPanels: l } = De(o), r = o.separators.find(
|
|
659
|
+
(p) => p.element === t
|
|
804
660
|
);
|
|
805
|
-
z(
|
|
806
|
-
const
|
|
807
|
-
z(
|
|
808
|
-
const u =
|
|
809
|
-
(
|
|
661
|
+
z(r, "Matching separator not found");
|
|
662
|
+
const a = l.get(r);
|
|
663
|
+
z(a, "Matching panels not found");
|
|
664
|
+
const u = a[0], f = i.find(
|
|
665
|
+
(p) => p.panelId === u.id
|
|
810
666
|
);
|
|
811
|
-
if (z(
|
|
812
|
-
const
|
|
813
|
-
|
|
667
|
+
if (z(f, "Panel metadata not found"), f.collapsible) {
|
|
668
|
+
const p = s[u.id], m = f.collapsedSize === p ? o.inMemoryLastExpandedPanelSizes[u.id] ?? f.minSize : f.collapsedSize;
|
|
669
|
+
O(t, m - p);
|
|
814
670
|
}
|
|
815
671
|
break;
|
|
816
672
|
}
|
|
817
673
|
case "F6": {
|
|
818
674
|
e.preventDefault();
|
|
819
|
-
const
|
|
820
|
-
(
|
|
821
|
-
),
|
|
822
|
-
(
|
|
675
|
+
const i = oe(t).separators.map(
|
|
676
|
+
(a) => a.element
|
|
677
|
+
), s = Array.from(i).findIndex(
|
|
678
|
+
(a) => a === e.currentTarget
|
|
823
679
|
);
|
|
824
|
-
z(
|
|
825
|
-
const l = e.shiftKey ?
|
|
826
|
-
|
|
680
|
+
z(s !== null, "Index not found");
|
|
681
|
+
const l = e.shiftKey ? s > 0 ? s - 1 : i.length - 1 : s + 1 < i.length ? s + 1 : 0;
|
|
682
|
+
i[l].focus();
|
|
827
683
|
break;
|
|
828
684
|
}
|
|
829
685
|
case "Home": {
|
|
830
|
-
e.preventDefault(),
|
|
686
|
+
e.preventDefault(), O(t, -100);
|
|
831
687
|
break;
|
|
832
688
|
}
|
|
833
689
|
}
|
|
834
690
|
}
|
|
691
|
+
const ut = (e) => e, re = () => {
|
|
692
|
+
}, Oe = 1, Te = 2, _e = 4, Ne = 8, ge = {
|
|
693
|
+
coarse: 10,
|
|
694
|
+
precise: 5
|
|
695
|
+
};
|
|
835
696
|
function ct(e, t, n) {
|
|
836
|
-
let o,
|
|
697
|
+
let o, i = {
|
|
837
698
|
x: 1 / 0,
|
|
838
699
|
y: 1 / 0
|
|
839
700
|
};
|
|
840
|
-
for (const
|
|
841
|
-
const l =
|
|
701
|
+
for (const s of t) {
|
|
702
|
+
const l = ke(n, s.rect);
|
|
842
703
|
switch (e) {
|
|
843
704
|
case "horizontal": {
|
|
844
|
-
l.x <=
|
|
705
|
+
l.x <= i.x && (o = s, i = l);
|
|
845
706
|
break;
|
|
846
707
|
}
|
|
847
708
|
case "vertical": {
|
|
848
|
-
l.y <=
|
|
709
|
+
l.y <= i.y && (o = s, i = l);
|
|
849
710
|
break;
|
|
850
711
|
}
|
|
851
712
|
}
|
|
852
713
|
}
|
|
853
714
|
return o ? {
|
|
854
|
-
distance:
|
|
715
|
+
distance: i,
|
|
855
716
|
hitRegion: o
|
|
856
717
|
} : void 0;
|
|
857
718
|
}
|
|
@@ -859,11 +720,14 @@ let ne;
|
|
|
859
720
|
function ft() {
|
|
860
721
|
return ne === void 0 && (typeof matchMedia == "function" ? ne = !!matchMedia("(pointer:coarse)").matches : ne = !1), ne;
|
|
861
722
|
}
|
|
862
|
-
function dt(e
|
|
723
|
+
function dt(e) {
|
|
724
|
+
return e !== null && typeof e == "object" && "nodeType" in e && e.nodeType === Node.DOCUMENT_FRAGMENT_NODE;
|
|
725
|
+
}
|
|
726
|
+
function pt(e, t) {
|
|
863
727
|
if (e === t) throw new Error("Cannot compare node with itself");
|
|
864
728
|
const n = {
|
|
865
|
-
a:
|
|
866
|
-
b:
|
|
729
|
+
a: xe(e),
|
|
730
|
+
b: xe(t)
|
|
867
731
|
};
|
|
868
732
|
let o;
|
|
869
733
|
for (; n.a.at(-1) === n.b.at(-1); )
|
|
@@ -872,70 +736,70 @@ function dt(e, t) {
|
|
|
872
736
|
o,
|
|
873
737
|
"Stacking order can only be calculated for elements with a common ancestor"
|
|
874
738
|
);
|
|
875
|
-
const
|
|
876
|
-
a:
|
|
877
|
-
b:
|
|
739
|
+
const i = {
|
|
740
|
+
a: Se(ve(n.a)),
|
|
741
|
+
b: Se(ve(n.b))
|
|
878
742
|
};
|
|
879
|
-
if (
|
|
880
|
-
const
|
|
743
|
+
if (i.a === i.b) {
|
|
744
|
+
const s = o.childNodes, l = {
|
|
881
745
|
a: n.a.at(-1),
|
|
882
746
|
b: n.b.at(-1)
|
|
883
747
|
};
|
|
884
|
-
let
|
|
885
|
-
for (;
|
|
886
|
-
const
|
|
887
|
-
if (
|
|
888
|
-
if (
|
|
748
|
+
let r = s.length;
|
|
749
|
+
for (; r--; ) {
|
|
750
|
+
const a = s[r];
|
|
751
|
+
if (a === l.a) return 1;
|
|
752
|
+
if (a === l.b) return -1;
|
|
889
753
|
}
|
|
890
754
|
}
|
|
891
|
-
return Math.sign(
|
|
755
|
+
return Math.sign(i.a - i.b);
|
|
892
756
|
}
|
|
893
|
-
const
|
|
894
|
-
function
|
|
895
|
-
const t = getComputedStyle(
|
|
757
|
+
const ht = /\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;
|
|
758
|
+
function mt(e) {
|
|
759
|
+
const t = getComputedStyle(Ae(e) ?? e).display;
|
|
896
760
|
return t === "flex" || t === "inline-flex";
|
|
897
761
|
}
|
|
898
|
-
function
|
|
762
|
+
function yt(e) {
|
|
899
763
|
const t = getComputedStyle(e);
|
|
900
|
-
return !!(t.position === "fixed" || t.zIndex !== "auto" && (t.position !== "static" ||
|
|
764
|
+
return !!(t.position === "fixed" || t.zIndex !== "auto" && (t.position !== "static" || mt(e)) || +t.opacity < 1 || "transform" in t && t.transform !== "none" || "webkitTransform" in t && t.webkitTransform !== "none" || "mixBlendMode" in t && t.mixBlendMode !== "normal" || "filter" in t && t.filter !== "none" || "webkitFilter" in t && t.webkitFilter !== "none" || "isolation" in t && t.isolation === "isolate" || ht.test(t.willChange) || t.webkitOverflowScrolling === "touch");
|
|
901
765
|
}
|
|
902
|
-
function
|
|
766
|
+
function ve(e) {
|
|
903
767
|
let t = e.length;
|
|
904
768
|
for (; t--; ) {
|
|
905
769
|
const n = e[t];
|
|
906
|
-
if (z(n, "Missing node"),
|
|
770
|
+
if (z(n, "Missing node"), yt(n)) return n;
|
|
907
771
|
}
|
|
908
772
|
return null;
|
|
909
773
|
}
|
|
910
|
-
function
|
|
774
|
+
function Se(e) {
|
|
911
775
|
return e && Number(getComputedStyle(e).zIndex) || 0;
|
|
912
776
|
}
|
|
913
|
-
function
|
|
777
|
+
function xe(e) {
|
|
914
778
|
const t = [];
|
|
915
779
|
for (; e; )
|
|
916
|
-
t.push(e), e =
|
|
780
|
+
t.push(e), e = Ae(e);
|
|
917
781
|
return t;
|
|
918
782
|
}
|
|
919
|
-
function
|
|
783
|
+
function Ae(e) {
|
|
920
784
|
const { parentNode: t } = e;
|
|
921
|
-
return t
|
|
785
|
+
return dt(t) ? t.host : t;
|
|
922
786
|
}
|
|
923
|
-
function
|
|
787
|
+
function gt(e, t) {
|
|
924
788
|
return e.x < t.x + t.width && e.x + e.width > t.x && e.y < t.y + t.height && e.y + e.height > t.y;
|
|
925
789
|
}
|
|
926
|
-
function
|
|
790
|
+
function vt({
|
|
927
791
|
groupElement: e,
|
|
928
792
|
hitRegion: t,
|
|
929
793
|
pointerEventTarget: n
|
|
930
794
|
}) {
|
|
931
|
-
if (!(n
|
|
795
|
+
if (!Me(n) || n.contains(e) || e.contains(n))
|
|
932
796
|
return !0;
|
|
933
|
-
if (
|
|
797
|
+
if (pt(n, e) > 0) {
|
|
934
798
|
let o = n;
|
|
935
799
|
for (; o; ) {
|
|
936
800
|
if (o.contains(e))
|
|
937
801
|
return !0;
|
|
938
|
-
if (
|
|
802
|
+
if (gt(o.getBoundingClientRect(), t))
|
|
939
803
|
return !1;
|
|
940
804
|
o = o.parentElement;
|
|
941
805
|
}
|
|
@@ -944,31 +808,31 @@ function gt({
|
|
|
944
808
|
}
|
|
945
809
|
function $e(e, t) {
|
|
946
810
|
const n = [];
|
|
947
|
-
return t.forEach((o,
|
|
948
|
-
if (
|
|
811
|
+
return t.forEach((o, i) => {
|
|
812
|
+
if (i.disabled)
|
|
949
813
|
return;
|
|
950
|
-
const
|
|
814
|
+
const s = ft() ? ge.coarse : ge.precise, l = Ie(i), r = ct(i.orientation, l, {
|
|
951
815
|
x: e.clientX,
|
|
952
816
|
y: e.clientY
|
|
953
817
|
});
|
|
954
|
-
|
|
955
|
-
groupElement:
|
|
956
|
-
hitRegion:
|
|
818
|
+
r && r.distance.x <= s && r.distance.y <= s && vt({
|
|
819
|
+
groupElement: i.element,
|
|
820
|
+
hitRegion: r.hitRegion.rect,
|
|
957
821
|
pointerEventTarget: e.target
|
|
958
|
-
}) && n.push(
|
|
822
|
+
}) && n.push(r.hitRegion);
|
|
959
823
|
}), n;
|
|
960
824
|
}
|
|
961
|
-
function
|
|
825
|
+
function ze(e) {
|
|
962
826
|
if (e.defaultPrevented)
|
|
963
827
|
return;
|
|
964
|
-
const { mountedGroups: t } =
|
|
965
|
-
let
|
|
966
|
-
n.forEach((
|
|
967
|
-
o.add(
|
|
968
|
-
|
|
969
|
-
}),
|
|
970
|
-
const u = t.get(
|
|
971
|
-
u && l.set(
|
|
828
|
+
const { mountedGroups: t } = G(), n = $e(e, t), o = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set(), s = /* @__PURE__ */ new Set(), l = /* @__PURE__ */ new Map();
|
|
829
|
+
let r = !1;
|
|
830
|
+
n.forEach((a) => {
|
|
831
|
+
o.add(a.group), a.panels.forEach((f) => {
|
|
832
|
+
i.add(f);
|
|
833
|
+
}), a.separator && (s.add(a.separator), r || (r = !0, a.separator.element.focus()));
|
|
834
|
+
const u = t.get(a.group);
|
|
835
|
+
u && l.set(a.group, u.layout);
|
|
972
836
|
}), E({
|
|
973
837
|
interactionState: {
|
|
974
838
|
hitRegions: n,
|
|
@@ -978,15 +842,158 @@ function be(e) {
|
|
|
978
842
|
}
|
|
979
843
|
}), n.length && e.preventDefault();
|
|
980
844
|
}
|
|
845
|
+
function St({
|
|
846
|
+
cursorFlags: e,
|
|
847
|
+
groups: t,
|
|
848
|
+
state: n
|
|
849
|
+
}) {
|
|
850
|
+
let o = 0, i = 0;
|
|
851
|
+
switch (n) {
|
|
852
|
+
case "active":
|
|
853
|
+
case "hover":
|
|
854
|
+
t.forEach((s) => {
|
|
855
|
+
if (!s.disableCursor)
|
|
856
|
+
switch (s.orientation) {
|
|
857
|
+
case "horizontal": {
|
|
858
|
+
o++;
|
|
859
|
+
break;
|
|
860
|
+
}
|
|
861
|
+
case "vertical": {
|
|
862
|
+
i++;
|
|
863
|
+
break;
|
|
864
|
+
}
|
|
865
|
+
}
|
|
866
|
+
});
|
|
867
|
+
}
|
|
868
|
+
if (o === 0 && i === 0)
|
|
869
|
+
return null;
|
|
870
|
+
switch (n) {
|
|
871
|
+
case "active": {
|
|
872
|
+
const s = (e & Oe) !== 0, l = (e & Te) !== 0, r = (e & _e) !== 0, a = (e & Ne) !== 0;
|
|
873
|
+
if (e) {
|
|
874
|
+
if (s)
|
|
875
|
+
return r ? "se-resize" : a ? "ne-resize" : "e-resize";
|
|
876
|
+
if (l)
|
|
877
|
+
return r ? "sw-resize" : a ? "nw-resize" : "w-resize";
|
|
878
|
+
if (r)
|
|
879
|
+
return "s-resize";
|
|
880
|
+
if (a)
|
|
881
|
+
return "n-resize";
|
|
882
|
+
}
|
|
883
|
+
break;
|
|
884
|
+
}
|
|
885
|
+
}
|
|
886
|
+
return o > 0 && i > 0 ? "move" : o > 0 ? "ew-resize" : "ns-resize";
|
|
887
|
+
}
|
|
888
|
+
const be = /* @__PURE__ */ new WeakMap();
|
|
889
|
+
function ae(e) {
|
|
890
|
+
if (e.defaultView === null)
|
|
891
|
+
return;
|
|
892
|
+
let { prevStyle: t, styleSheet: n } = be.get(e) ?? {};
|
|
893
|
+
n === void 0 && (n = new e.defaultView.CSSStyleSheet(), e.adoptedStyleSheets = [n]);
|
|
894
|
+
const { cursorFlags: o, interactionState: i } = G();
|
|
895
|
+
switch (i.state) {
|
|
896
|
+
case "active":
|
|
897
|
+
case "hover": {
|
|
898
|
+
const s = St({
|
|
899
|
+
cursorFlags: o,
|
|
900
|
+
groups: i.hitRegions.map((r) => r.group),
|
|
901
|
+
state: i.state
|
|
902
|
+
}), l = `*{cursor: ${s} !important; ${i.state === "active" ? "touch-action: none;" : ""} }`;
|
|
903
|
+
if (t === l)
|
|
904
|
+
return;
|
|
905
|
+
t = l, s ? n.cssRules.length === 0 ? n.insertRule(l) : n.replaceSync(l) : n.cssRules.length === 1 && n.deleteRule(0);
|
|
906
|
+
break;
|
|
907
|
+
}
|
|
908
|
+
case "inactive": {
|
|
909
|
+
t = void 0, n.cssRules.length === 1 && n.deleteRule(0);
|
|
910
|
+
break;
|
|
911
|
+
}
|
|
912
|
+
}
|
|
913
|
+
be.set(e, {
|
|
914
|
+
prevStyle: t,
|
|
915
|
+
styleSheet: n
|
|
916
|
+
});
|
|
917
|
+
}
|
|
918
|
+
function Fe({
|
|
919
|
+
document: e,
|
|
920
|
+
event: t,
|
|
921
|
+
hitRegions: n,
|
|
922
|
+
initialLayoutMap: o,
|
|
923
|
+
mountedGroups: i,
|
|
924
|
+
pointerDownAtPoint: s
|
|
925
|
+
}) {
|
|
926
|
+
let l = 0;
|
|
927
|
+
const r = new Map(i);
|
|
928
|
+
n.forEach((a) => {
|
|
929
|
+
const { group: u, groupSize: f } = a, { disableCursor: p, orientation: m, panels: h } = u;
|
|
930
|
+
let c = 0;
|
|
931
|
+
s ? m === "horizontal" ? c = (t.clientX - s.x) / f * 100 : c = (t.clientY - s.y) / f * 100 : m === "horizontal" ? c = t.clientX < 0 ? -100 : 100 : c = t.clientY < 0 ? -100 : 100;
|
|
932
|
+
const d = o.get(u), {
|
|
933
|
+
defaultLayoutDeferred: y,
|
|
934
|
+
derivedPanelConstraints: v,
|
|
935
|
+
layout: S,
|
|
936
|
+
separatorToPanels: x
|
|
937
|
+
} = i.get(u) ?? { defaultLayoutDeferred: !1 };
|
|
938
|
+
if (v && d && S && x) {
|
|
939
|
+
const g = q({
|
|
940
|
+
delta: c,
|
|
941
|
+
initialLayout: d,
|
|
942
|
+
panelConstraints: v,
|
|
943
|
+
pivotIndices: a.panels.map((w) => h.indexOf(w)),
|
|
944
|
+
prevLayout: S,
|
|
945
|
+
trigger: "mouse-or-touch"
|
|
946
|
+
});
|
|
947
|
+
if (V(g, S)) {
|
|
948
|
+
if (c !== 0 && !p)
|
|
949
|
+
switch (m) {
|
|
950
|
+
case "horizontal": {
|
|
951
|
+
l |= c < 0 ? Oe : Te;
|
|
952
|
+
break;
|
|
953
|
+
}
|
|
954
|
+
case "vertical": {
|
|
955
|
+
l |= c < 0 ? _e : Ne;
|
|
956
|
+
break;
|
|
957
|
+
}
|
|
958
|
+
}
|
|
959
|
+
} else {
|
|
960
|
+
r.set(a.group, {
|
|
961
|
+
defaultLayoutDeferred: y,
|
|
962
|
+
derivedPanelConstraints: v,
|
|
963
|
+
layout: g,
|
|
964
|
+
separatorToPanels: x
|
|
965
|
+
});
|
|
966
|
+
const w = a.group.panels.map(({ id: L }) => L).join(",");
|
|
967
|
+
a.group.inMemoryLayouts[w] = g;
|
|
968
|
+
}
|
|
969
|
+
}
|
|
970
|
+
}), E({
|
|
971
|
+
cursorFlags: l,
|
|
972
|
+
mountedGroups: r
|
|
973
|
+
}), ae(e);
|
|
974
|
+
}
|
|
975
|
+
function we(e) {
|
|
976
|
+
const { interactionState: t, mountedGroups: n } = G();
|
|
977
|
+
switch (t.state) {
|
|
978
|
+
case "active":
|
|
979
|
+
Fe({
|
|
980
|
+
document: e.currentTarget,
|
|
981
|
+
event: e,
|
|
982
|
+
hitRegions: t.hitRegions,
|
|
983
|
+
initialLayoutMap: t.initialLayoutMap,
|
|
984
|
+
mountedGroups: n
|
|
985
|
+
});
|
|
986
|
+
}
|
|
987
|
+
}
|
|
981
988
|
function Le(e) {
|
|
982
989
|
if (e.defaultPrevented)
|
|
983
990
|
return;
|
|
984
|
-
const { interactionState: t, mountedGroups: n } =
|
|
991
|
+
const { interactionState: t, mountedGroups: n } = G();
|
|
985
992
|
switch (t.state) {
|
|
986
993
|
case "active": {
|
|
987
994
|
if (
|
|
988
995
|
// Skip this check for "pointerleave" events, else Firefox triggers a false positive (see #514)
|
|
989
|
-
e.
|
|
996
|
+
e.buttons === 0
|
|
990
997
|
) {
|
|
991
998
|
E(
|
|
992
999
|
(o) => o.interactionState.state === "inactive" ? o : {
|
|
@@ -998,7 +1005,8 @@ function Le(e) {
|
|
|
998
1005
|
);
|
|
999
1006
|
return;
|
|
1000
1007
|
}
|
|
1001
|
-
|
|
1008
|
+
Fe({
|
|
1009
|
+
document: e.currentTarget,
|
|
1002
1010
|
event: e,
|
|
1003
1011
|
hitRegions: t.hitRegions,
|
|
1004
1012
|
initialLayoutMap: t.initialLayoutMap,
|
|
@@ -1016,7 +1024,7 @@ function Le(e) {
|
|
|
1016
1024
|
hitRegions: o,
|
|
1017
1025
|
state: "hover"
|
|
1018
1026
|
}
|
|
1019
|
-
}),
|
|
1027
|
+
}), ae(e.currentTarget);
|
|
1020
1028
|
break;
|
|
1021
1029
|
}
|
|
1022
1030
|
}
|
|
@@ -1025,7 +1033,7 @@ function Pe(e) {
|
|
|
1025
1033
|
if (e.defaultPrevented)
|
|
1026
1034
|
return;
|
|
1027
1035
|
e.preventDefault();
|
|
1028
|
-
const { interactionState: t } =
|
|
1036
|
+
const { interactionState: t } = G();
|
|
1029
1037
|
switch (t.state) {
|
|
1030
1038
|
case "active":
|
|
1031
1039
|
E({
|
|
@@ -1033,46 +1041,46 @@ function Pe(e) {
|
|
|
1033
1041
|
interactionState: {
|
|
1034
1042
|
state: "inactive"
|
|
1035
1043
|
}
|
|
1036
|
-
}),
|
|
1044
|
+
}), ae(e.currentTarget);
|
|
1037
1045
|
}
|
|
1038
1046
|
}
|
|
1039
1047
|
function Ce(e) {
|
|
1040
1048
|
let t = 0, n = 0;
|
|
1041
1049
|
const o = {};
|
|
1042
|
-
for (const
|
|
1043
|
-
if (
|
|
1050
|
+
for (const s of e)
|
|
1051
|
+
if (s.defaultSize !== void 0) {
|
|
1044
1052
|
t++;
|
|
1045
|
-
const l = I(
|
|
1046
|
-
n += l, o[
|
|
1053
|
+
const l = I(s.defaultSize);
|
|
1054
|
+
n += l, o[s.panelId] = l;
|
|
1047
1055
|
} else
|
|
1048
|
-
o[
|
|
1049
|
-
const
|
|
1050
|
-
if (
|
|
1051
|
-
const
|
|
1056
|
+
o[s.panelId] = void 0;
|
|
1057
|
+
const i = e.length - t;
|
|
1058
|
+
if (i !== 0) {
|
|
1059
|
+
const s = I((100 - n) / i);
|
|
1052
1060
|
for (const l of e)
|
|
1053
|
-
l.defaultSize === void 0 && (o[l.panelId] =
|
|
1061
|
+
l.defaultSize === void 0 && (o[l.panelId] = s);
|
|
1054
1062
|
}
|
|
1055
1063
|
return o;
|
|
1056
1064
|
}
|
|
1057
|
-
function
|
|
1065
|
+
function xt(e, t, n) {
|
|
1058
1066
|
const o = n[0];
|
|
1059
1067
|
if (!o)
|
|
1060
1068
|
return;
|
|
1061
|
-
const
|
|
1062
|
-
if (!
|
|
1069
|
+
const i = e.panels.find((l) => l.element === t);
|
|
1070
|
+
if (!i || !i.onResize)
|
|
1063
1071
|
return;
|
|
1064
|
-
const
|
|
1065
|
-
|
|
1072
|
+
const s = W({ group: e });
|
|
1073
|
+
i.onResize(
|
|
1066
1074
|
{
|
|
1067
1075
|
asPercentage: I(
|
|
1068
|
-
o.inlineSize /
|
|
1076
|
+
o.inlineSize / s * 100
|
|
1069
1077
|
),
|
|
1070
1078
|
inPixels: o.inlineSize
|
|
1071
1079
|
},
|
|
1072
|
-
|
|
1080
|
+
i.id
|
|
1073
1081
|
);
|
|
1074
1082
|
}
|
|
1075
|
-
function
|
|
1083
|
+
function zt(e, t) {
|
|
1076
1084
|
if (Object.keys(e).length !== Object.keys(t).length)
|
|
1077
1085
|
return !1;
|
|
1078
1086
|
for (const o in e)
|
|
@@ -1080,95 +1088,104 @@ function St(e, t) {
|
|
|
1080
1088
|
return !1;
|
|
1081
1089
|
return !0;
|
|
1082
1090
|
}
|
|
1083
|
-
|
|
1091
|
+
const j = /* @__PURE__ */ new Map();
|
|
1092
|
+
function bt(e) {
|
|
1084
1093
|
let t = !0;
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1094
|
+
z(
|
|
1095
|
+
e.element.ownerDocument.defaultView,
|
|
1096
|
+
"Cannot register an unmounted Group"
|
|
1097
|
+
);
|
|
1098
|
+
const n = e.element.ownerDocument.defaultView.ResizeObserver, o = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set(), s = new n((c) => {
|
|
1099
|
+
for (const d of c) {
|
|
1100
|
+
const { borderBoxSize: y, target: v } = d;
|
|
1101
|
+
if (v === e.element) {
|
|
1089
1102
|
if (t) {
|
|
1090
|
-
if (
|
|
1103
|
+
if (W({ group: e }) === 0)
|
|
1091
1104
|
return;
|
|
1092
|
-
E((
|
|
1093
|
-
const
|
|
1094
|
-
if (
|
|
1095
|
-
const
|
|
1096
|
-
layout:
|
|
1097
|
-
panelConstraints:
|
|
1105
|
+
E((x) => {
|
|
1106
|
+
const g = x.mountedGroups.get(e);
|
|
1107
|
+
if (g) {
|
|
1108
|
+
const w = me(e), L = g.defaultLayoutDeferred ? Ce(w) : g.layout, P = _({
|
|
1109
|
+
layout: L,
|
|
1110
|
+
panelConstraints: w
|
|
1098
1111
|
});
|
|
1099
|
-
return !
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
) ?
|
|
1103
|
-
mountedGroups: new Map(
|
|
1112
|
+
return !g.defaultLayoutDeferred && V(L, P) && zt(
|
|
1113
|
+
g.derivedPanelConstraints,
|
|
1114
|
+
w
|
|
1115
|
+
) ? x : {
|
|
1116
|
+
mountedGroups: new Map(x.mountedGroups).set(e, {
|
|
1104
1117
|
defaultLayoutDeferred: !1,
|
|
1105
|
-
derivedPanelConstraints:
|
|
1106
|
-
layout:
|
|
1107
|
-
separatorToPanels:
|
|
1118
|
+
derivedPanelConstraints: w,
|
|
1119
|
+
layout: P,
|
|
1120
|
+
separatorToPanels: g.separatorToPanels
|
|
1108
1121
|
})
|
|
1109
1122
|
};
|
|
1110
1123
|
}
|
|
1111
|
-
return
|
|
1124
|
+
return x;
|
|
1112
1125
|
});
|
|
1113
1126
|
}
|
|
1114
1127
|
} else
|
|
1115
|
-
|
|
1128
|
+
xt(e, v, y);
|
|
1116
1129
|
}
|
|
1117
1130
|
});
|
|
1118
|
-
|
|
1131
|
+
s.observe(e.element), e.panels.forEach((c) => {
|
|
1119
1132
|
z(
|
|
1120
|
-
!
|
|
1121
|
-
`Panel ids must be unique; id "${
|
|
1122
|
-
),
|
|
1133
|
+
!o.has(c.id),
|
|
1134
|
+
`Panel ids must be unique; id "${c.id}" was used more than once`
|
|
1135
|
+
), o.add(c.id), c.onResize && s.observe(c.element);
|
|
1123
1136
|
});
|
|
1124
|
-
const
|
|
1125
|
-
let
|
|
1126
|
-
|
|
1127
|
-
const
|
|
1128
|
-
layout:
|
|
1129
|
-
panelConstraints:
|
|
1130
|
-
}),
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1137
|
+
const l = W({ group: e }), r = me(e), a = e.panels.map(({ id: c }) => c).join(",");
|
|
1138
|
+
let u = e.defaultLayout;
|
|
1139
|
+
u && e.panels.length !== Object.keys(u).length && (u = void 0);
|
|
1140
|
+
const f = e.inMemoryLayouts[a] ?? u ?? Ce(r), p = _({
|
|
1141
|
+
layout: f,
|
|
1142
|
+
panelConstraints: r
|
|
1143
|
+
}), m = Ie(e), h = e.element.ownerDocument;
|
|
1144
|
+
return E((c) => {
|
|
1145
|
+
const d = /* @__PURE__ */ new Map();
|
|
1146
|
+
return j.set(
|
|
1147
|
+
h,
|
|
1148
|
+
(j.get(h) ?? 0) + 1
|
|
1149
|
+
), m.forEach((y) => {
|
|
1150
|
+
y.separator && d.set(y.separator, y.panels);
|
|
1134
1151
|
}), {
|
|
1135
|
-
mountedGroups: new Map(
|
|
1136
|
-
defaultLayoutDeferred:
|
|
1137
|
-
derivedPanelConstraints:
|
|
1138
|
-
layout:
|
|
1139
|
-
separatorToPanels:
|
|
1152
|
+
mountedGroups: new Map(c.mountedGroups).set(e, {
|
|
1153
|
+
defaultLayoutDeferred: l === 0,
|
|
1154
|
+
derivedPanelConstraints: r,
|
|
1155
|
+
layout: p,
|
|
1156
|
+
separatorToPanels: d
|
|
1140
1157
|
})
|
|
1141
1158
|
};
|
|
1142
|
-
})
|
|
1143
|
-
return e.element.addEventListener("pointerleave", ve), e.separators.forEach((p) => {
|
|
1159
|
+
}), e.separators.forEach((c) => {
|
|
1144
1160
|
z(
|
|
1145
|
-
!
|
|
1146
|
-
`Separator ids must be unique; id "${
|
|
1147
|
-
),
|
|
1148
|
-
}),
|
|
1149
|
-
t = !1
|
|
1150
|
-
|
|
1161
|
+
!i.has(c.id),
|
|
1162
|
+
`Separator ids must be unique; id "${c.id}" was used more than once`
|
|
1163
|
+
), i.add(c.id), c.element.addEventListener("keydown", ye);
|
|
1164
|
+
}), j.get(h) === 1 && (h.addEventListener("pointerdown", ze), h.addEventListener("pointerleave", we), h.addEventListener("pointermove", Le), h.addEventListener("pointerup", Pe)), function() {
|
|
1165
|
+
t = !1, j.set(
|
|
1166
|
+
h,
|
|
1167
|
+
Math.max(0, (j.get(h) ?? 0) - 1)
|
|
1168
|
+
), E((d) => {
|
|
1151
1169
|
const y = new Map(d.mountedGroups);
|
|
1152
1170
|
return y.delete(e), { mountedGroups: y };
|
|
1153
|
-
})
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
}), f.mountedGroups.size === 0 && (window.removeEventListener("pointerdown", be), window.removeEventListener("pointermove", Le), window.removeEventListener("pointerup", Pe)), r.disconnect();
|
|
1171
|
+
}), e.separators.forEach((d) => {
|
|
1172
|
+
d.element.removeEventListener("keydown", ye);
|
|
1173
|
+
}), j.get(h) || (h.removeEventListener("pointerdown", ze), h.removeEventListener("pointerleave", we), h.removeEventListener("pointermove", Le), h.removeEventListener("pointerup", Pe)), s.disconnect();
|
|
1157
1174
|
};
|
|
1158
1175
|
}
|
|
1159
|
-
function
|
|
1160
|
-
const t =
|
|
1176
|
+
function le(e) {
|
|
1177
|
+
const t = Ke();
|
|
1161
1178
|
return `${e ?? t}`;
|
|
1162
1179
|
}
|
|
1163
|
-
const N = typeof window < "u" ?
|
|
1164
|
-
function
|
|
1165
|
-
const t =
|
|
1180
|
+
const N = typeof window < "u" ? Xe : Re;
|
|
1181
|
+
function ue(e) {
|
|
1182
|
+
const t = D(e);
|
|
1166
1183
|
return N(() => {
|
|
1167
1184
|
t.current = e;
|
|
1168
|
-
}, [e]),
|
|
1185
|
+
}, [e]), qe((n) => t.current?.(n), [t]);
|
|
1169
1186
|
}
|
|
1170
|
-
function
|
|
1171
|
-
return
|
|
1187
|
+
function ce(...e) {
|
|
1188
|
+
return ue((t) => {
|
|
1172
1189
|
e.forEach((n) => {
|
|
1173
1190
|
if (n)
|
|
1174
1191
|
switch (typeof n) {
|
|
@@ -1184,101 +1201,101 @@ function fe(...e) {
|
|
|
1184
1201
|
});
|
|
1185
1202
|
});
|
|
1186
1203
|
}
|
|
1187
|
-
function
|
|
1188
|
-
const t =
|
|
1204
|
+
function wt(e) {
|
|
1205
|
+
const t = D({ ...e });
|
|
1189
1206
|
return N(() => {
|
|
1190
1207
|
for (const n in e)
|
|
1191
1208
|
t.current[n] = e[n];
|
|
1192
1209
|
}, [e]), t.current;
|
|
1193
1210
|
}
|
|
1194
|
-
const
|
|
1195
|
-
function
|
|
1211
|
+
const He = "--react-resizable-panels--panel--pointer-events";
|
|
1212
|
+
function je(e, t) {
|
|
1196
1213
|
const n = e.replace(/[^a-zA-Z0-9\-_]/g, ""), o = t.replace(/[^a-zA-Z0-9\-_]/g, "");
|
|
1197
1214
|
return `--react-resizable-panels--${n}--${o}`;
|
|
1198
1215
|
}
|
|
1199
|
-
const
|
|
1200
|
-
function
|
|
1201
|
-
const n =
|
|
1216
|
+
const Be = Ye(null);
|
|
1217
|
+
function Lt(e, t) {
|
|
1218
|
+
const n = D({
|
|
1202
1219
|
getLayout: () => ({}),
|
|
1203
|
-
setLayout:
|
|
1220
|
+
setLayout: ut
|
|
1204
1221
|
});
|
|
1205
1222
|
Ee(t, () => n.current, []), N(() => {
|
|
1206
1223
|
Object.assign(
|
|
1207
1224
|
n.current,
|
|
1208
|
-
|
|
1225
|
+
Ge({ groupId: e })
|
|
1209
1226
|
);
|
|
1210
1227
|
});
|
|
1211
1228
|
}
|
|
1212
|
-
function
|
|
1229
|
+
function Ot({
|
|
1213
1230
|
children: e,
|
|
1214
1231
|
className: t,
|
|
1215
1232
|
defaultLayout: n,
|
|
1216
1233
|
disableCursor: o,
|
|
1217
|
-
disabled:
|
|
1218
|
-
elementRef:
|
|
1234
|
+
disabled: i,
|
|
1235
|
+
elementRef: s,
|
|
1219
1236
|
groupRef: l,
|
|
1220
|
-
id:
|
|
1221
|
-
onLayoutChange:
|
|
1237
|
+
id: r,
|
|
1238
|
+
onLayoutChange: a,
|
|
1222
1239
|
orientation: u = "horizontal",
|
|
1223
|
-
style:
|
|
1224
|
-
...
|
|
1240
|
+
style: f,
|
|
1241
|
+
...p
|
|
1225
1242
|
}) {
|
|
1226
|
-
const m =
|
|
1227
|
-
|
|
1228
|
-
}),
|
|
1243
|
+
const m = D({}), h = ue((b) => {
|
|
1244
|
+
V(m.current, b) || (m.current = b, a?.(b));
|
|
1245
|
+
}), c = le(r), [d, y] = k(!1), [v, S] = k(null), [x, g] = k(n ?? {}), [w, L] = k([]), [P, Y] = k([]), Z = D({
|
|
1229
1246
|
lastExpandedPanelSizes: {},
|
|
1230
1247
|
layouts: {}
|
|
1231
|
-
}), J =
|
|
1232
|
-
|
|
1233
|
-
const Q =
|
|
1248
|
+
}), J = ce(S, s);
|
|
1249
|
+
Lt(c, l);
|
|
1250
|
+
const Q = ie(
|
|
1234
1251
|
() => ({
|
|
1235
|
-
id:
|
|
1252
|
+
id: c,
|
|
1236
1253
|
orientation: u,
|
|
1237
|
-
registerPanel: (
|
|
1238
|
-
L((M) => M.filter((
|
|
1254
|
+
registerPanel: (b) => (L((M) => se(u, [...M, b])), () => {
|
|
1255
|
+
L((M) => M.filter(($) => $ !== b));
|
|
1239
1256
|
}),
|
|
1240
|
-
registerSeparator: (
|
|
1241
|
-
(M) =>
|
|
1257
|
+
registerSeparator: (b) => (Y(
|
|
1258
|
+
(M) => se(u, [...M, b])
|
|
1242
1259
|
), () => {
|
|
1243
|
-
|
|
1244
|
-
(M) => M.filter((
|
|
1260
|
+
Y(
|
|
1261
|
+
(M) => M.filter(($) => $ !== b)
|
|
1245
1262
|
);
|
|
1246
1263
|
})
|
|
1247
1264
|
}),
|
|
1248
|
-
[
|
|
1249
|
-
),
|
|
1265
|
+
[c, u]
|
|
1266
|
+
), A = wt({
|
|
1250
1267
|
defaultLayout: n,
|
|
1251
1268
|
disableCursor: o
|
|
1252
|
-
}),
|
|
1269
|
+
}), U = D(null);
|
|
1253
1270
|
N(() => {
|
|
1254
1271
|
if (v === null)
|
|
1255
1272
|
return;
|
|
1256
|
-
const
|
|
1257
|
-
defaultLayout:
|
|
1258
|
-
disableCursor:
|
|
1259
|
-
disabled: !!
|
|
1273
|
+
const b = {
|
|
1274
|
+
defaultLayout: A.defaultLayout,
|
|
1275
|
+
disableCursor: !!A.disableCursor,
|
|
1276
|
+
disabled: !!i,
|
|
1260
1277
|
element: v,
|
|
1261
|
-
id:
|
|
1278
|
+
id: c,
|
|
1262
1279
|
inMemoryLastExpandedPanelSizes: Z.current.lastExpandedPanelSizes,
|
|
1263
1280
|
inMemoryLayouts: Z.current.layouts,
|
|
1264
1281
|
orientation: u,
|
|
1265
|
-
panels:
|
|
1266
|
-
separators:
|
|
1282
|
+
panels: w,
|
|
1283
|
+
separators: P
|
|
1267
1284
|
};
|
|
1268
|
-
|
|
1269
|
-
const M =
|
|
1270
|
-
if (
|
|
1271
|
-
const { defaultLayoutDeferred:
|
|
1272
|
-
!
|
|
1285
|
+
U.current = b;
|
|
1286
|
+
const M = bt(b), pe = G().mountedGroups.get(b);
|
|
1287
|
+
if (pe) {
|
|
1288
|
+
const { defaultLayoutDeferred: F, derivedPanelConstraints: H, layout: ee } = pe;
|
|
1289
|
+
!F && H.length > 0 && (g(ee), h?.(ee));
|
|
1273
1290
|
}
|
|
1274
|
-
const We =
|
|
1291
|
+
const We = T.addListener(
|
|
1275
1292
|
"interactionStateChange",
|
|
1276
|
-
(
|
|
1277
|
-
switch (
|
|
1293
|
+
(F) => {
|
|
1294
|
+
switch (F.state) {
|
|
1278
1295
|
case "active": {
|
|
1279
1296
|
y(
|
|
1280
|
-
|
|
1281
|
-
(
|
|
1297
|
+
F.hitRegions.some(
|
|
1298
|
+
(H) => H.group === b
|
|
1282
1299
|
)
|
|
1283
1300
|
);
|
|
1284
1301
|
break;
|
|
@@ -1289,54 +1306,54 @@ function Gt({
|
|
|
1289
1306
|
}
|
|
1290
1307
|
}
|
|
1291
1308
|
}
|
|
1292
|
-
),
|
|
1309
|
+
), Ve = T.addListener(
|
|
1293
1310
|
"mountedGroupsChange",
|
|
1294
|
-
(
|
|
1295
|
-
const
|
|
1296
|
-
if (
|
|
1297
|
-
const { defaultLayoutDeferred: ee, derivedPanelConstraints: Ue, layout:
|
|
1311
|
+
(F) => {
|
|
1312
|
+
const H = F.get(b);
|
|
1313
|
+
if (H) {
|
|
1314
|
+
const { defaultLayoutDeferred: ee, derivedPanelConstraints: Ue, layout: he } = H;
|
|
1298
1315
|
if (ee || Ue.length === 0)
|
|
1299
1316
|
return;
|
|
1300
|
-
g(
|
|
1317
|
+
g(he), h?.(he);
|
|
1301
1318
|
}
|
|
1302
1319
|
}
|
|
1303
1320
|
);
|
|
1304
1321
|
return () => {
|
|
1305
|
-
|
|
1322
|
+
U.current = null, M(), We(), Ve();
|
|
1306
1323
|
};
|
|
1307
1324
|
}, [
|
|
1308
|
-
|
|
1325
|
+
i,
|
|
1309
1326
|
v,
|
|
1310
|
-
|
|
1311
|
-
|
|
1327
|
+
c,
|
|
1328
|
+
h,
|
|
1312
1329
|
u,
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1330
|
+
w,
|
|
1331
|
+
P,
|
|
1332
|
+
A
|
|
1316
1333
|
]), Re(() => {
|
|
1317
|
-
const
|
|
1318
|
-
|
|
1334
|
+
const b = U.current;
|
|
1335
|
+
b && (b.defaultLayout = n, b.disableCursor = !!o);
|
|
1319
1336
|
});
|
|
1320
|
-
const
|
|
1321
|
-
[
|
|
1337
|
+
const de = {
|
|
1338
|
+
[He]: d ? "none" : void 0
|
|
1322
1339
|
};
|
|
1323
|
-
for (const
|
|
1324
|
-
const M =
|
|
1325
|
-
|
|
1340
|
+
for (const b in x) {
|
|
1341
|
+
const M = je(c, b), $ = x[b];
|
|
1342
|
+
de[M] = $;
|
|
1326
1343
|
}
|
|
1327
|
-
return /* @__PURE__ */ K(
|
|
1344
|
+
return /* @__PURE__ */ K(Be.Provider, { value: Q, children: /* @__PURE__ */ K(
|
|
1328
1345
|
"div",
|
|
1329
1346
|
{
|
|
1330
|
-
...
|
|
1347
|
+
...p,
|
|
1331
1348
|
"aria-orientation": u,
|
|
1332
1349
|
className: t,
|
|
1333
1350
|
"data-group": !0,
|
|
1334
|
-
"data-testid":
|
|
1335
|
-
id:
|
|
1351
|
+
"data-testid": c,
|
|
1352
|
+
id: c,
|
|
1336
1353
|
ref: J,
|
|
1337
1354
|
style: {
|
|
1338
|
-
...
|
|
1339
|
-
...
|
|
1355
|
+
...f,
|
|
1356
|
+
...de,
|
|
1340
1357
|
display: "flex",
|
|
1341
1358
|
flexDirection: u === "horizontal" ? "row" : "column",
|
|
1342
1359
|
flexWrap: "nowrap"
|
|
@@ -1345,7 +1362,7 @@ function Gt({
|
|
|
1345
1362
|
}
|
|
1346
1363
|
) });
|
|
1347
1364
|
}
|
|
1348
|
-
function
|
|
1365
|
+
function Pt(e, t = 10) {
|
|
1349
1366
|
let n = null;
|
|
1350
1367
|
return (o) => {
|
|
1351
1368
|
n !== null && clearTimeout(n), n = setTimeout(() => {
|
|
@@ -1353,155 +1370,155 @@ function bt(e, t = 10) {
|
|
|
1353
1370
|
}, t);
|
|
1354
1371
|
};
|
|
1355
1372
|
}
|
|
1356
|
-
function
|
|
1373
|
+
function Ct(e) {
|
|
1357
1374
|
return `react-resizable-panels:${e}`;
|
|
1358
1375
|
}
|
|
1359
|
-
function
|
|
1376
|
+
function Tt({
|
|
1360
1377
|
debounceSaveMs: e = 100,
|
|
1361
|
-
|
|
1362
|
-
|
|
1378
|
+
storage: t,
|
|
1379
|
+
...n
|
|
1363
1380
|
}) {
|
|
1364
|
-
const o =
|
|
1365
|
-
|
|
1366
|
-
() =>
|
|
1367
|
-
() =>
|
|
1368
|
-
),
|
|
1369
|
-
() =>
|
|
1370
|
-
[
|
|
1371
|
-
),
|
|
1372
|
-
const
|
|
1381
|
+
const o = "id" in n ? n.id : n.groupId, i = Ct(o), s = Ze(
|
|
1382
|
+
Rt,
|
|
1383
|
+
() => t.getItem(i),
|
|
1384
|
+
() => t.getItem(i)
|
|
1385
|
+
), l = ie(
|
|
1386
|
+
() => s ? JSON.parse(s) : void 0,
|
|
1387
|
+
[s]
|
|
1388
|
+
), r = ie(() => {
|
|
1389
|
+
const a = (u) => {
|
|
1373
1390
|
try {
|
|
1374
|
-
|
|
1375
|
-
} catch (
|
|
1376
|
-
console.error(
|
|
1391
|
+
t.setItem(i, JSON.stringify(u));
|
|
1392
|
+
} catch (f) {
|
|
1393
|
+
console.error(f);
|
|
1377
1394
|
}
|
|
1378
1395
|
};
|
|
1379
|
-
return e > 0 ?
|
|
1380
|
-
}, [e,
|
|
1396
|
+
return e > 0 ? Pt(a, e) : a;
|
|
1397
|
+
}, [e, t, i]);
|
|
1381
1398
|
return {
|
|
1382
|
-
defaultLayout:
|
|
1383
|
-
onLayoutChange:
|
|
1399
|
+
defaultLayout: l,
|
|
1400
|
+
onLayoutChange: r
|
|
1384
1401
|
};
|
|
1385
1402
|
}
|
|
1386
|
-
function
|
|
1403
|
+
function Rt() {
|
|
1387
1404
|
return function() {
|
|
1388
1405
|
};
|
|
1389
1406
|
}
|
|
1390
|
-
function
|
|
1407
|
+
function _t() {
|
|
1391
1408
|
return k(null);
|
|
1392
1409
|
}
|
|
1393
|
-
function
|
|
1394
|
-
return
|
|
1410
|
+
function Nt() {
|
|
1411
|
+
return D(null);
|
|
1395
1412
|
}
|
|
1396
|
-
function
|
|
1397
|
-
const e =
|
|
1413
|
+
function fe() {
|
|
1414
|
+
const e = Je(Be);
|
|
1398
1415
|
return z(
|
|
1399
1416
|
e,
|
|
1400
1417
|
"Group Context not found; did you render a Panel or Separator outside of a Group?"
|
|
1401
1418
|
), e;
|
|
1402
1419
|
}
|
|
1403
|
-
function
|
|
1420
|
+
function Et({
|
|
1404
1421
|
groupId: e,
|
|
1405
1422
|
panelId: t
|
|
1406
1423
|
}) {
|
|
1407
1424
|
const n = () => {
|
|
1408
|
-
const { mountedGroups:
|
|
1425
|
+
const { mountedGroups: r } = G();
|
|
1409
1426
|
for (const [
|
|
1410
|
-
|
|
1427
|
+
a,
|
|
1411
1428
|
{
|
|
1412
1429
|
defaultLayoutDeferred: u,
|
|
1413
|
-
derivedPanelConstraints:
|
|
1414
|
-
layout:
|
|
1430
|
+
derivedPanelConstraints: f,
|
|
1431
|
+
layout: p,
|
|
1415
1432
|
separatorToPanels: m
|
|
1416
1433
|
}
|
|
1417
|
-
] of
|
|
1418
|
-
if (
|
|
1434
|
+
] of r)
|
|
1435
|
+
if (a.id === e)
|
|
1419
1436
|
return {
|
|
1420
1437
|
defaultLayoutDeferred: u,
|
|
1421
|
-
derivedPanelConstraints:
|
|
1422
|
-
group:
|
|
1423
|
-
layout:
|
|
1438
|
+
derivedPanelConstraints: f,
|
|
1439
|
+
group: a,
|
|
1440
|
+
layout: p,
|
|
1424
1441
|
separatorToPanels: m
|
|
1425
1442
|
};
|
|
1426
1443
|
throw Error(`Group ${e} not found`);
|
|
1427
1444
|
}, o = () => {
|
|
1428
|
-
const
|
|
1429
|
-
(
|
|
1445
|
+
const r = n().derivedPanelConstraints.find(
|
|
1446
|
+
(a) => a.panelId === t
|
|
1430
1447
|
);
|
|
1431
|
-
if (
|
|
1432
|
-
return
|
|
1448
|
+
if (r !== void 0)
|
|
1449
|
+
return r;
|
|
1433
1450
|
throw Error(`Panel constraints not found for Panel ${t}`);
|
|
1434
|
-
},
|
|
1435
|
-
const
|
|
1436
|
-
if (
|
|
1437
|
-
return
|
|
1451
|
+
}, i = () => {
|
|
1452
|
+
const r = n().group.panels.find((a) => a.id === t);
|
|
1453
|
+
if (r !== void 0)
|
|
1454
|
+
return r;
|
|
1438
1455
|
throw Error(`Layout not found for Panel ${t}`);
|
|
1439
|
-
},
|
|
1440
|
-
const
|
|
1441
|
-
if (
|
|
1442
|
-
return
|
|
1456
|
+
}, s = () => {
|
|
1457
|
+
const r = n().layout[t];
|
|
1458
|
+
if (r !== void 0)
|
|
1459
|
+
return r;
|
|
1443
1460
|
throw Error(`Layout not found for Panel ${t}`);
|
|
1444
|
-
}, l = (
|
|
1445
|
-
const
|
|
1446
|
-
if (
|
|
1461
|
+
}, l = (r) => {
|
|
1462
|
+
const a = s();
|
|
1463
|
+
if (r === a)
|
|
1447
1464
|
return;
|
|
1448
1465
|
const {
|
|
1449
1466
|
defaultLayoutDeferred: u,
|
|
1450
|
-
derivedPanelConstraints:
|
|
1451
|
-
group:
|
|
1467
|
+
derivedPanelConstraints: f,
|
|
1468
|
+
group: p,
|
|
1452
1469
|
layout: m,
|
|
1453
|
-
separatorToPanels:
|
|
1454
|
-
} = n(),
|
|
1455
|
-
delta: d ?
|
|
1470
|
+
separatorToPanels: h
|
|
1471
|
+
} = n(), c = p.panels.findIndex((S) => S.id === t), d = c === p.panels.length - 1, y = q({
|
|
1472
|
+
delta: d ? a - r : r - a,
|
|
1456
1473
|
initialLayout: m,
|
|
1457
|
-
panelConstraints:
|
|
1458
|
-
pivotIndices: d ? [
|
|
1474
|
+
panelConstraints: f,
|
|
1475
|
+
pivotIndices: d ? [c - 1, c] : [c, c + 1],
|
|
1459
1476
|
prevLayout: m,
|
|
1460
1477
|
trigger: "imperative-api"
|
|
1461
|
-
}), v =
|
|
1478
|
+
}), v = _({
|
|
1462
1479
|
layout: y,
|
|
1463
|
-
panelConstraints:
|
|
1480
|
+
panelConstraints: f
|
|
1464
1481
|
});
|
|
1465
|
-
|
|
1466
|
-
mountedGroups: new Map(S.mountedGroups).set(
|
|
1482
|
+
V(m, v) || E((S) => ({
|
|
1483
|
+
mountedGroups: new Map(S.mountedGroups).set(p, {
|
|
1467
1484
|
defaultLayoutDeferred: u,
|
|
1468
|
-
derivedPanelConstraints:
|
|
1485
|
+
derivedPanelConstraints: f,
|
|
1469
1486
|
layout: v,
|
|
1470
|
-
separatorToPanels:
|
|
1487
|
+
separatorToPanels: h
|
|
1471
1488
|
})
|
|
1472
1489
|
}));
|
|
1473
1490
|
};
|
|
1474
1491
|
return {
|
|
1475
1492
|
collapse: () => {
|
|
1476
|
-
const { collapsible:
|
|
1477
|
-
|
|
1493
|
+
const { collapsible: r, collapsedSize: a } = o(), u = s();
|
|
1494
|
+
r && u !== a && l(a);
|
|
1478
1495
|
},
|
|
1479
1496
|
expand: () => {
|
|
1480
|
-
const { collapsible:
|
|
1481
|
-
|
|
1497
|
+
const { collapsible: r, collapsedSize: a, minSize: u } = o(), f = s();
|
|
1498
|
+
r && f === a && l(u);
|
|
1482
1499
|
},
|
|
1483
1500
|
getSize: () => {
|
|
1484
|
-
const { group:
|
|
1501
|
+
const { group: r } = n(), a = s(), { element: u } = i(), f = r.orientation === "horizontal" ? u.offsetWidth : u.offsetHeight;
|
|
1485
1502
|
return {
|
|
1486
|
-
asPercentage:
|
|
1487
|
-
inPixels:
|
|
1503
|
+
asPercentage: a,
|
|
1504
|
+
inPixels: f
|
|
1488
1505
|
};
|
|
1489
1506
|
},
|
|
1490
1507
|
isCollapsed: () => {
|
|
1491
|
-
const { collapsible:
|
|
1492
|
-
return
|
|
1508
|
+
const { collapsible: r, collapsedSize: a } = o(), u = s();
|
|
1509
|
+
return r && C(a, u);
|
|
1493
1510
|
},
|
|
1494
|
-
resize: (
|
|
1495
|
-
if (
|
|
1511
|
+
resize: (r) => {
|
|
1512
|
+
if (s() !== r) {
|
|
1496
1513
|
let u;
|
|
1497
|
-
switch (typeof
|
|
1514
|
+
switch (typeof r) {
|
|
1498
1515
|
case "number": {
|
|
1499
|
-
const { group:
|
|
1500
|
-
u = I(
|
|
1516
|
+
const { group: f } = n(), p = W({ group: f });
|
|
1517
|
+
u = I(r / p * 100);
|
|
1501
1518
|
break;
|
|
1502
1519
|
}
|
|
1503
1520
|
case "string": {
|
|
1504
|
-
u = parseFloat(
|
|
1521
|
+
u = parseFloat(r);
|
|
1505
1522
|
break;
|
|
1506
1523
|
}
|
|
1507
1524
|
}
|
|
@@ -1510,81 +1527,81 @@ function Ct({
|
|
|
1510
1527
|
}
|
|
1511
1528
|
};
|
|
1512
1529
|
}
|
|
1513
|
-
function
|
|
1514
|
-
const { id: n } =
|
|
1515
|
-
collapse:
|
|
1516
|
-
expand:
|
|
1530
|
+
function Mt(e, t) {
|
|
1531
|
+
const { id: n } = fe(), o = D({
|
|
1532
|
+
collapse: re,
|
|
1533
|
+
expand: re,
|
|
1517
1534
|
getSize: () => ({
|
|
1518
1535
|
asPercentage: 0,
|
|
1519
1536
|
inPixels: 0
|
|
1520
1537
|
}),
|
|
1521
1538
|
isCollapsed: () => !1,
|
|
1522
|
-
resize:
|
|
1539
|
+
resize: re
|
|
1523
1540
|
});
|
|
1524
1541
|
Ee(t, () => o.current, []), N(() => {
|
|
1525
1542
|
Object.assign(
|
|
1526
1543
|
o.current,
|
|
1527
|
-
|
|
1544
|
+
Et({ groupId: n, panelId: e })
|
|
1528
1545
|
);
|
|
1529
1546
|
});
|
|
1530
1547
|
}
|
|
1531
|
-
function
|
|
1548
|
+
function At({
|
|
1532
1549
|
children: e,
|
|
1533
1550
|
className: t,
|
|
1534
1551
|
collapsedSize: n = "0%",
|
|
1535
1552
|
collapsible: o = !1,
|
|
1536
|
-
defaultSize:
|
|
1537
|
-
elementRef:
|
|
1553
|
+
defaultSize: i,
|
|
1554
|
+
elementRef: s,
|
|
1538
1555
|
id: l,
|
|
1539
|
-
maxSize:
|
|
1540
|
-
minSize:
|
|
1556
|
+
maxSize: r = "100%",
|
|
1557
|
+
minSize: a = "0%",
|
|
1541
1558
|
onResize: u,
|
|
1542
|
-
panelRef:
|
|
1543
|
-
style:
|
|
1559
|
+
panelRef: f,
|
|
1560
|
+
style: p,
|
|
1544
1561
|
...m
|
|
1545
1562
|
}) {
|
|
1546
|
-
const
|
|
1547
|
-
u?.(
|
|
1563
|
+
const h = !!l, c = le(l), [d, y] = k(null), v = ce(y, s), { id: S, registerPanel: x } = fe(), g = u !== null, w = ue((P) => {
|
|
1564
|
+
u?.(P, l);
|
|
1548
1565
|
});
|
|
1549
1566
|
N(() => {
|
|
1550
1567
|
if (d !== null)
|
|
1551
1568
|
return x({
|
|
1552
1569
|
element: d,
|
|
1553
|
-
id:
|
|
1554
|
-
idIsStable:
|
|
1555
|
-
onResize: g ?
|
|
1570
|
+
id: c,
|
|
1571
|
+
idIsStable: h,
|
|
1572
|
+
onResize: g ? w : void 0,
|
|
1556
1573
|
panelConstraints: {
|
|
1557
1574
|
collapsedSize: n,
|
|
1558
1575
|
collapsible: o,
|
|
1559
|
-
defaultSize:
|
|
1560
|
-
maxSize:
|
|
1561
|
-
minSize:
|
|
1576
|
+
defaultSize: i,
|
|
1577
|
+
maxSize: r,
|
|
1578
|
+
minSize: a
|
|
1562
1579
|
}
|
|
1563
1580
|
});
|
|
1564
1581
|
}, [
|
|
1565
1582
|
n,
|
|
1566
1583
|
o,
|
|
1567
|
-
|
|
1584
|
+
i,
|
|
1568
1585
|
d,
|
|
1569
1586
|
g,
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1587
|
+
c,
|
|
1588
|
+
h,
|
|
1589
|
+
r,
|
|
1590
|
+
a,
|
|
1591
|
+
w,
|
|
1575
1592
|
x
|
|
1576
|
-
]),
|
|
1577
|
-
const L =
|
|
1593
|
+
]), Mt(c, f);
|
|
1594
|
+
const L = je(S, c);
|
|
1578
1595
|
return /* @__PURE__ */ K(
|
|
1579
1596
|
"div",
|
|
1580
1597
|
{
|
|
1581
1598
|
...m,
|
|
1582
1599
|
"data-panel": !0,
|
|
1583
|
-
"data-testid":
|
|
1584
|
-
id:
|
|
1600
|
+
"data-testid": c,
|
|
1601
|
+
id: c,
|
|
1585
1602
|
ref: v,
|
|
1586
1603
|
style: {
|
|
1587
|
-
...
|
|
1604
|
+
...kt,
|
|
1588
1605
|
flexBasis: 0,
|
|
1589
1606
|
flexGrow: `var(${L}, 1)`,
|
|
1590
1607
|
flexShrink: 1,
|
|
@@ -1592,7 +1609,7 @@ function _t({
|
|
|
1592
1609
|
overflow: "hidden",
|
|
1593
1610
|
// Disable pointer events inside of a panel during resize
|
|
1594
1611
|
// This avoid edge cases like nested iframes
|
|
1595
|
-
pointerEvents: `var(${
|
|
1612
|
+
pointerEvents: `var(${He})`
|
|
1596
1613
|
},
|
|
1597
1614
|
children: /* @__PURE__ */ K(
|
|
1598
1615
|
"div",
|
|
@@ -1601,7 +1618,7 @@ function _t({
|
|
|
1601
1618
|
style: {
|
|
1602
1619
|
width: "100%",
|
|
1603
1620
|
height: "100%",
|
|
1604
|
-
...
|
|
1621
|
+
...p
|
|
1605
1622
|
},
|
|
1606
1623
|
children: e
|
|
1607
1624
|
}
|
|
@@ -1609,7 +1626,7 @@ function _t({
|
|
|
1609
1626
|
}
|
|
1610
1627
|
);
|
|
1611
1628
|
}
|
|
1612
|
-
const
|
|
1629
|
+
const kt = {
|
|
1613
1630
|
minHeight: "unset",
|
|
1614
1631
|
maxHeight: "unset",
|
|
1615
1632
|
height: "unset",
|
|
@@ -1625,40 +1642,40 @@ const Et = {
|
|
|
1625
1642
|
padding: "unset",
|
|
1626
1643
|
margin: "unset"
|
|
1627
1644
|
};
|
|
1628
|
-
function
|
|
1645
|
+
function $t() {
|
|
1629
1646
|
return k(null);
|
|
1630
1647
|
}
|
|
1631
|
-
function
|
|
1632
|
-
return
|
|
1648
|
+
function Ft() {
|
|
1649
|
+
return D(null);
|
|
1633
1650
|
}
|
|
1634
|
-
function
|
|
1651
|
+
function It({
|
|
1635
1652
|
layout: e,
|
|
1636
1653
|
panelConstraints: t,
|
|
1637
1654
|
panelId: n,
|
|
1638
1655
|
panelIndex: o
|
|
1639
1656
|
}) {
|
|
1640
|
-
let
|
|
1641
|
-
const l = e[n],
|
|
1642
|
-
(
|
|
1657
|
+
let i, s;
|
|
1658
|
+
const l = e[n], r = t.find(
|
|
1659
|
+
(a) => a.panelId === n
|
|
1643
1660
|
);
|
|
1644
|
-
if (
|
|
1645
|
-
const
|
|
1646
|
-
|
|
1647
|
-
layout:
|
|
1661
|
+
if (r) {
|
|
1662
|
+
const a = r.maxSize, u = s = r.collapsible ? r.collapsedSize : r.minSize, f = [o, o + 1];
|
|
1663
|
+
s = _({
|
|
1664
|
+
layout: q({
|
|
1648
1665
|
delta: u - l,
|
|
1649
1666
|
initialLayout: e,
|
|
1650
1667
|
panelConstraints: t,
|
|
1651
|
-
pivotIndices:
|
|
1668
|
+
pivotIndices: f,
|
|
1652
1669
|
prevLayout: e,
|
|
1653
1670
|
trigger: "keyboard"
|
|
1654
1671
|
}),
|
|
1655
1672
|
panelConstraints: t
|
|
1656
|
-
})[n],
|
|
1657
|
-
layout:
|
|
1658
|
-
delta:
|
|
1673
|
+
})[n], i = _({
|
|
1674
|
+
layout: q({
|
|
1675
|
+
delta: a - l,
|
|
1659
1676
|
initialLayout: e,
|
|
1660
1677
|
panelConstraints: t,
|
|
1661
|
-
pivotIndices:
|
|
1678
|
+
pivotIndices: f,
|
|
1662
1679
|
prevLayout: e,
|
|
1663
1680
|
trigger: "keyboard"
|
|
1664
1681
|
}),
|
|
@@ -1667,53 +1684,53 @@ function Mt({
|
|
|
1667
1684
|
}
|
|
1668
1685
|
return {
|
|
1669
1686
|
valueControls: n,
|
|
1670
|
-
valueMax:
|
|
1671
|
-
valueMin:
|
|
1687
|
+
valueMax: i,
|
|
1688
|
+
valueMin: s,
|
|
1672
1689
|
valueNow: l
|
|
1673
1690
|
};
|
|
1674
1691
|
}
|
|
1675
|
-
function
|
|
1692
|
+
function Ht({
|
|
1676
1693
|
children: e,
|
|
1677
1694
|
className: t,
|
|
1678
1695
|
elementRef: n,
|
|
1679
1696
|
id: o,
|
|
1680
|
-
style:
|
|
1681
|
-
...
|
|
1697
|
+
style: i,
|
|
1698
|
+
...s
|
|
1682
1699
|
}) {
|
|
1683
|
-
const l =
|
|
1684
|
-
id:
|
|
1700
|
+
const l = le(o), [r, a] = k({}), [u, f] = k("inactive"), [p, m] = k(null), h = ce(m, n), {
|
|
1701
|
+
id: c,
|
|
1685
1702
|
orientation: d,
|
|
1686
1703
|
registerSeparator: y
|
|
1687
|
-
} =
|
|
1704
|
+
} = fe(), v = d === "horizontal" ? "vertical" : "horizontal";
|
|
1688
1705
|
return N(() => {
|
|
1689
|
-
if (
|
|
1706
|
+
if (p !== null) {
|
|
1690
1707
|
const S = {
|
|
1691
|
-
element:
|
|
1708
|
+
element: p,
|
|
1692
1709
|
id: l
|
|
1693
|
-
}, x = y(S), g =
|
|
1710
|
+
}, x = y(S), g = T.addListener(
|
|
1694
1711
|
"interactionStateChange",
|
|
1695
1712
|
(L) => {
|
|
1696
|
-
|
|
1713
|
+
f(
|
|
1697
1714
|
L.state !== "inactive" && L.hitRegions.some(
|
|
1698
|
-
(
|
|
1715
|
+
(P) => P.separator === S
|
|
1699
1716
|
) ? L.state : "inactive"
|
|
1700
1717
|
);
|
|
1701
1718
|
}
|
|
1702
|
-
),
|
|
1719
|
+
), w = T.addListener(
|
|
1703
1720
|
"mountedGroupsChange",
|
|
1704
1721
|
(L) => {
|
|
1705
1722
|
L.forEach(
|
|
1706
|
-
({ derivedPanelConstraints:
|
|
1707
|
-
if (J.id ===
|
|
1723
|
+
({ derivedPanelConstraints: P, layout: Y, separatorToPanels: Z }, J) => {
|
|
1724
|
+
if (J.id === c) {
|
|
1708
1725
|
const Q = Z.get(S);
|
|
1709
1726
|
if (Q) {
|
|
1710
|
-
const
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
layout:
|
|
1714
|
-
panelConstraints:
|
|
1715
|
-
panelId:
|
|
1716
|
-
panelIndex:
|
|
1727
|
+
const A = Q[0], U = J.panels.indexOf(A);
|
|
1728
|
+
a(
|
|
1729
|
+
It({
|
|
1730
|
+
layout: Y,
|
|
1731
|
+
panelConstraints: P,
|
|
1732
|
+
panelId: A.id,
|
|
1733
|
+
panelIndex: U
|
|
1717
1734
|
})
|
|
1718
1735
|
);
|
|
1719
1736
|
}
|
|
@@ -1723,28 +1740,28 @@ function $t({
|
|
|
1723
1740
|
}
|
|
1724
1741
|
);
|
|
1725
1742
|
return () => {
|
|
1726
|
-
g(),
|
|
1743
|
+
g(), w(), x();
|
|
1727
1744
|
};
|
|
1728
1745
|
}
|
|
1729
|
-
}, [
|
|
1746
|
+
}, [p, c, l, y]), /* @__PURE__ */ K(
|
|
1730
1747
|
"div",
|
|
1731
1748
|
{
|
|
1732
|
-
...
|
|
1733
|
-
"aria-controls":
|
|
1749
|
+
...s,
|
|
1750
|
+
"aria-controls": r.valueControls,
|
|
1734
1751
|
"aria-orientation": v,
|
|
1735
|
-
"aria-valuemax":
|
|
1736
|
-
"aria-valuemin":
|
|
1737
|
-
"aria-valuenow":
|
|
1752
|
+
"aria-valuemax": r.valueMax,
|
|
1753
|
+
"aria-valuemin": r.valueMin,
|
|
1754
|
+
"aria-valuenow": r.valueNow,
|
|
1738
1755
|
children: e,
|
|
1739
1756
|
className: t,
|
|
1740
1757
|
"data-separator": u,
|
|
1741
1758
|
"data-testid": l,
|
|
1742
1759
|
id: l,
|
|
1743
|
-
ref:
|
|
1760
|
+
ref: h,
|
|
1744
1761
|
role: "separator",
|
|
1745
1762
|
style: {
|
|
1746
1763
|
flexBasis: "auto",
|
|
1747
|
-
...
|
|
1764
|
+
...i,
|
|
1748
1765
|
flexGrow: 0,
|
|
1749
1766
|
flexShrink: 0
|
|
1750
1767
|
},
|
|
@@ -1753,13 +1770,13 @@ function $t({
|
|
|
1753
1770
|
);
|
|
1754
1771
|
}
|
|
1755
1772
|
export {
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1773
|
+
Ot as Group,
|
|
1774
|
+
At as Panel,
|
|
1775
|
+
Ht as Separator,
|
|
1776
|
+
Tt as useDefaultLayout,
|
|
1777
|
+
_t as useGroupCallbackRef,
|
|
1778
|
+
Nt as useGroupRef,
|
|
1779
|
+
$t as usePanelCallbackRef,
|
|
1780
|
+
Ft as usePanelRef
|
|
1764
1781
|
};
|
|
1765
1782
|
//# sourceMappingURL=react-resizable-panels.js.map
|