react-resizable-panels 4.0.13 → 4.0.15
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 I, 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 Ie(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 } = Ie(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 ke(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
|
-
),
|
|
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
|
-
S === m ?
|
|
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 k(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 ge(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 = k(
|
|
219
|
+
l = k(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 = k(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 = k(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 = k(
|
|
246
|
+
u = k(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(k(e) - k(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
|
-
}),
|
|
335
|
+
}), T.emit("mountedGroupsChange", R.mountedGroups)), R;
|
|
333
336
|
}
|
|
334
|
-
|
|
335
|
-
}, ke = 1, Ge = 2, De = 4, Oe = 8, ye = {
|
|
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 & ke) !== 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
|
-
}
|
|
404
|
-
}
|
|
405
|
-
function ut(e, t) {
|
|
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,306 +343,230 @@ 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 = k(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
|
-
collapsedSize:
|
|
387
|
+
collapsedSize: y = 0,
|
|
456
388
|
collapsible: v,
|
|
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
|
-
),
|
|
465
|
-
const
|
|
466
|
-
X(
|
|
395
|
+
`Previous layout not found for panel index ${c}`
|
|
396
|
+
), C(x, y)) {
|
|
397
|
+
const g = S - x;
|
|
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
|
-
collapsedSize:
|
|
409
|
+
collapsedSize: y = 0,
|
|
478
410
|
collapsible: v,
|
|
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
|
-
),
|
|
487
|
-
const
|
|
488
|
-
X(
|
|
417
|
+
`Previous layout not found for panel index ${c}`
|
|
418
|
+
), C(x, S)) {
|
|
419
|
+
const g = x - y;
|
|
420
|
+
X(g, Math.abs(e)) > 0 && (e = e < 0 ? 0 - g : g);
|
|
489
421
|
}
|
|
490
422
|
}
|
|
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
|
|
434
|
+
const g = B({
|
|
503
435
|
panelConstraints: n[d],
|
|
504
436
|
size: 100
|
|
505
437
|
}) - S;
|
|
506
|
-
if (
|
|
438
|
+
if (y += g, d += c, d < 0 || d >= n.length)
|
|
507
439
|
break;
|
|
508
440
|
}
|
|
509
|
-
const v = Math.min(Math.abs(e), Math.abs(
|
|
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
|
|
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 -
|
|
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
|
|
540
|
-
panelConstraints: n[
|
|
541
|
-
size:
|
|
471
|
+
const y = d + p, v = B({
|
|
472
|
+
panelConstraints: n[c],
|
|
473
|
+
size: y
|
|
542
474
|
});
|
|
543
|
-
if (
|
|
544
|
-
let S =
|
|
545
|
-
for (;
|
|
546
|
-
const
|
|
475
|
+
if (a[c] = v, !C(v, y)) {
|
|
476
|
+
let S = y - v, g = e < 0 ? f : u;
|
|
477
|
+
for (; g >= 0 && g < n.length; ) {
|
|
478
|
+
const w = a[g];
|
|
547
479
|
z(
|
|
548
|
-
|
|
549
|
-
`Previous layout not found for panel index ${
|
|
480
|
+
w != null,
|
|
481
|
+
`Previous layout not found for panel index ${g}`
|
|
550
482
|
);
|
|
551
|
-
const L =
|
|
552
|
-
panelConstraints: n[
|
|
483
|
+
const L = w + S, P = B({
|
|
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
|
-
e > 0 ?
|
|
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: g,
|
|
594
|
-
layout: v,
|
|
595
|
-
separatorToPanels: S
|
|
596
|
-
} = o.get(s) ?? { defaultLayoutDeferred: !1 };
|
|
597
|
-
if (g && f && v && S) {
|
|
598
|
-
const x = Y({
|
|
599
|
-
delta: p,
|
|
600
|
-
initialLayout: f,
|
|
601
|
-
panelConstraints: g,
|
|
602
|
-
pivotIndices: i.panels.map((y) => m.indexOf(y)),
|
|
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 ? ke : 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: g,
|
|
622
|
-
layout: x,
|
|
623
|
-
separatorToPanels: S
|
|
624
|
-
});
|
|
625
|
-
const y = i.group.panels.map(({ id: b }) => b).join(",");
|
|
626
|
-
i.group.inMemoryLayouts[y] = 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 = Ie(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,65 +736,65 @@ 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
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))
|
|
@@ -944,31 +808,31 @@ function yt({
|
|
|
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 = ke(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 = k(
|
|
1046
|
-
n += l, o[
|
|
1053
|
+
const l = k(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 = k((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: k(
|
|
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,113 @@ function St(e, t) {
|
|
|
1080
1088
|
return !1;
|
|
1081
1089
|
return !0;
|
|
1082
1090
|
}
|
|
1083
|
-
function
|
|
1091
|
+
function bt(e, t) {
|
|
1092
|
+
const n = e.map((i) => i.id), o = Object.keys(t);
|
|
1093
|
+
if (n.length !== o.length)
|
|
1094
|
+
return !1;
|
|
1095
|
+
for (const i of n)
|
|
1096
|
+
if (!o.includes(i))
|
|
1097
|
+
return !1;
|
|
1098
|
+
return !0;
|
|
1099
|
+
}
|
|
1100
|
+
const j = /* @__PURE__ */ new Map();
|
|
1101
|
+
function wt(e) {
|
|
1084
1102
|
let t = !0;
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1103
|
+
z(
|
|
1104
|
+
e.element.ownerDocument.defaultView,
|
|
1105
|
+
"Cannot register an unmounted Group"
|
|
1106
|
+
);
|
|
1107
|
+
const n = e.element.ownerDocument.defaultView.ResizeObserver, o = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set(), s = new n((c) => {
|
|
1108
|
+
for (const d of c) {
|
|
1109
|
+
const { borderBoxSize: y, target: v } = d;
|
|
1110
|
+
if (v === e.element) {
|
|
1089
1111
|
if (t) {
|
|
1090
|
-
if (
|
|
1112
|
+
if (W({ group: e }) === 0)
|
|
1091
1113
|
return;
|
|
1092
|
-
E((
|
|
1093
|
-
const
|
|
1094
|
-
if (
|
|
1095
|
-
const
|
|
1096
|
-
layout:
|
|
1097
|
-
panelConstraints:
|
|
1114
|
+
E((x) => {
|
|
1115
|
+
const g = x.mountedGroups.get(e);
|
|
1116
|
+
if (g) {
|
|
1117
|
+
const w = me(e), L = g.defaultLayoutDeferred ? Ce(w) : g.layout, P = _({
|
|
1118
|
+
layout: L,
|
|
1119
|
+
panelConstraints: w
|
|
1098
1120
|
});
|
|
1099
|
-
return !
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
) ?
|
|
1103
|
-
mountedGroups: new Map(
|
|
1121
|
+
return !g.defaultLayoutDeferred && V(L, P) && zt(
|
|
1122
|
+
g.derivedPanelConstraints,
|
|
1123
|
+
w
|
|
1124
|
+
) ? x : {
|
|
1125
|
+
mountedGroups: new Map(x.mountedGroups).set(e, {
|
|
1104
1126
|
defaultLayoutDeferred: !1,
|
|
1105
|
-
derivedPanelConstraints:
|
|
1106
|
-
layout:
|
|
1107
|
-
separatorToPanels:
|
|
1127
|
+
derivedPanelConstraints: w,
|
|
1128
|
+
layout: P,
|
|
1129
|
+
separatorToPanels: g.separatorToPanels
|
|
1108
1130
|
})
|
|
1109
1131
|
};
|
|
1110
1132
|
}
|
|
1111
|
-
return
|
|
1133
|
+
return x;
|
|
1112
1134
|
});
|
|
1113
1135
|
}
|
|
1114
1136
|
} else
|
|
1115
|
-
|
|
1137
|
+
xt(e, v, y);
|
|
1116
1138
|
}
|
|
1117
1139
|
});
|
|
1118
|
-
|
|
1140
|
+
s.observe(e.element), e.panels.forEach((c) => {
|
|
1119
1141
|
z(
|
|
1120
|
-
!
|
|
1121
|
-
`Panel ids must be unique; id "${
|
|
1122
|
-
),
|
|
1142
|
+
!o.has(c.id),
|
|
1143
|
+
`Panel ids must be unique; id "${c.id}" was used more than once`
|
|
1144
|
+
), o.add(c.id), c.onResize && s.observe(c.element);
|
|
1123
1145
|
});
|
|
1124
|
-
const
|
|
1125
|
-
let
|
|
1126
|
-
|
|
1127
|
-
const
|
|
1128
|
-
layout:
|
|
1129
|
-
panelConstraints:
|
|
1130
|
-
}),
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1146
|
+
const l = W({ group: e }), r = me(e), a = e.panels.map(({ id: c }) => c).join(",");
|
|
1147
|
+
let u = e.defaultLayout;
|
|
1148
|
+
u && (bt(e.panels, u) || (u = void 0));
|
|
1149
|
+
const f = e.inMemoryLayouts[a] ?? u ?? Ce(r), p = _({
|
|
1150
|
+
layout: f,
|
|
1151
|
+
panelConstraints: r
|
|
1152
|
+
}), m = ke(e), h = e.element.ownerDocument;
|
|
1153
|
+
return E((c) => {
|
|
1154
|
+
const d = /* @__PURE__ */ new Map();
|
|
1155
|
+
return j.set(
|
|
1156
|
+
h,
|
|
1157
|
+
(j.get(h) ?? 0) + 1
|
|
1158
|
+
), m.forEach((y) => {
|
|
1159
|
+
y.separator && d.set(y.separator, y.panels);
|
|
1134
1160
|
}), {
|
|
1135
|
-
mountedGroups: new Map(
|
|
1136
|
-
defaultLayoutDeferred:
|
|
1137
|
-
derivedPanelConstraints:
|
|
1138
|
-
layout:
|
|
1139
|
-
separatorToPanels:
|
|
1161
|
+
mountedGroups: new Map(c.mountedGroups).set(e, {
|
|
1162
|
+
defaultLayoutDeferred: l === 0,
|
|
1163
|
+
derivedPanelConstraints: r,
|
|
1164
|
+
layout: p,
|
|
1165
|
+
separatorToPanels: d
|
|
1140
1166
|
})
|
|
1141
1167
|
};
|
|
1142
|
-
})
|
|
1143
|
-
return e.element.addEventListener("pointerleave", ve), e.separators.forEach((p) => {
|
|
1168
|
+
}), e.separators.forEach((c) => {
|
|
1144
1169
|
z(
|
|
1145
|
-
!
|
|
1146
|
-
`Separator ids must be unique; id "${
|
|
1147
|
-
),
|
|
1148
|
-
}),
|
|
1149
|
-
t = !1
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1170
|
+
!i.has(c.id),
|
|
1171
|
+
`Separator ids must be unique; id "${c.id}" was used more than once`
|
|
1172
|
+
), i.add(c.id), c.element.addEventListener("keydown", ye);
|
|
1173
|
+
}), j.get(h) === 1 && (h.addEventListener("pointerdown", ze), h.addEventListener("pointerleave", we), h.addEventListener("pointermove", Le), h.addEventListener("pointerup", Pe)), function() {
|
|
1174
|
+
t = !1, j.set(
|
|
1175
|
+
h,
|
|
1176
|
+
Math.max(0, (j.get(h) ?? 0) - 1)
|
|
1177
|
+
), E((d) => {
|
|
1178
|
+
const y = new Map(d.mountedGroups);
|
|
1179
|
+
return y.delete(e), { mountedGroups: y };
|
|
1180
|
+
}), e.separators.forEach((d) => {
|
|
1181
|
+
d.element.removeEventListener("keydown", ye);
|
|
1182
|
+
}), j.get(h) || (h.removeEventListener("pointerdown", ze), h.removeEventListener("pointerleave", we), h.removeEventListener("pointermove", Le), h.removeEventListener("pointerup", Pe)), s.disconnect();
|
|
1157
1183
|
};
|
|
1158
1184
|
}
|
|
1159
|
-
function
|
|
1160
|
-
const t =
|
|
1185
|
+
function le(e) {
|
|
1186
|
+
const t = Ke();
|
|
1161
1187
|
return `${e ?? t}`;
|
|
1162
1188
|
}
|
|
1163
|
-
const N = typeof window < "u" ?
|
|
1164
|
-
function
|
|
1165
|
-
const t =
|
|
1189
|
+
const N = typeof window < "u" ? Xe : Re;
|
|
1190
|
+
function ue(e) {
|
|
1191
|
+
const t = D(e);
|
|
1166
1192
|
return N(() => {
|
|
1167
1193
|
t.current = e;
|
|
1168
|
-
}, [e]),
|
|
1194
|
+
}, [e]), qe((n) => t.current?.(n), [t]);
|
|
1169
1195
|
}
|
|
1170
|
-
function
|
|
1171
|
-
return
|
|
1196
|
+
function ce(...e) {
|
|
1197
|
+
return ue((t) => {
|
|
1172
1198
|
e.forEach((n) => {
|
|
1173
1199
|
if (n)
|
|
1174
1200
|
switch (typeof n) {
|
|
@@ -1184,159 +1210,159 @@ function fe(...e) {
|
|
|
1184
1210
|
});
|
|
1185
1211
|
});
|
|
1186
1212
|
}
|
|
1187
|
-
function
|
|
1188
|
-
const t =
|
|
1213
|
+
function Lt(e) {
|
|
1214
|
+
const t = D({ ...e });
|
|
1189
1215
|
return N(() => {
|
|
1190
1216
|
for (const n in e)
|
|
1191
1217
|
t.current[n] = e[n];
|
|
1192
1218
|
}, [e]), t.current;
|
|
1193
1219
|
}
|
|
1194
|
-
const
|
|
1195
|
-
function
|
|
1220
|
+
const He = "--react-resizable-panels--panel--pointer-events";
|
|
1221
|
+
function je(e, t) {
|
|
1196
1222
|
const n = e.replace(/[^a-zA-Z0-9\-_]/g, ""), o = t.replace(/[^a-zA-Z0-9\-_]/g, "");
|
|
1197
1223
|
return `--react-resizable-panels--${n}--${o}`;
|
|
1198
1224
|
}
|
|
1199
|
-
const
|
|
1200
|
-
function
|
|
1201
|
-
const n =
|
|
1225
|
+
const Be = Ye(null);
|
|
1226
|
+
function Pt(e, t) {
|
|
1227
|
+
const n = D({
|
|
1202
1228
|
getLayout: () => ({}),
|
|
1203
|
-
setLayout:
|
|
1229
|
+
setLayout: ut
|
|
1204
1230
|
});
|
|
1205
1231
|
Ee(t, () => n.current, []), N(() => {
|
|
1206
1232
|
Object.assign(
|
|
1207
1233
|
n.current,
|
|
1208
|
-
|
|
1234
|
+
Ge({ groupId: e })
|
|
1209
1235
|
);
|
|
1210
1236
|
});
|
|
1211
1237
|
}
|
|
1212
|
-
function
|
|
1238
|
+
function Tt({
|
|
1213
1239
|
children: e,
|
|
1214
1240
|
className: t,
|
|
1215
1241
|
defaultLayout: n,
|
|
1216
1242
|
disableCursor: o,
|
|
1217
|
-
disabled:
|
|
1218
|
-
elementRef:
|
|
1243
|
+
disabled: i,
|
|
1244
|
+
elementRef: s,
|
|
1219
1245
|
groupRef: l,
|
|
1220
|
-
id:
|
|
1221
|
-
onLayoutChange:
|
|
1246
|
+
id: r,
|
|
1247
|
+
onLayoutChange: a,
|
|
1222
1248
|
orientation: u = "horizontal",
|
|
1223
|
-
style:
|
|
1224
|
-
...
|
|
1249
|
+
style: f,
|
|
1250
|
+
...p
|
|
1225
1251
|
}) {
|
|
1226
|
-
const m =
|
|
1227
|
-
|
|
1228
|
-
}),
|
|
1252
|
+
const m = D({}), h = ue((b) => {
|
|
1253
|
+
V(m.current, b) || (m.current = b, a?.(b));
|
|
1254
|
+
}), c = le(r), [d, y] = I(!1), [v, S] = I(null), [x, g] = I(n ?? {}), [w, L] = I([]), [P, Y] = I([]), Z = D({
|
|
1229
1255
|
lastExpandedPanelSizes: {},
|
|
1230
1256
|
layouts: {}
|
|
1231
|
-
}), J =
|
|
1232
|
-
|
|
1233
|
-
const Q =
|
|
1257
|
+
}), J = ce(S, s);
|
|
1258
|
+
Pt(c, l);
|
|
1259
|
+
const Q = ie(
|
|
1234
1260
|
() => ({
|
|
1235
|
-
id:
|
|
1261
|
+
id: c,
|
|
1236
1262
|
orientation: u,
|
|
1237
|
-
registerPanel: (
|
|
1238
|
-
L((M) => M.filter((
|
|
1263
|
+
registerPanel: (b) => (L((M) => se(u, [...M, b])), () => {
|
|
1264
|
+
L((M) => M.filter(($) => $ !== b));
|
|
1239
1265
|
}),
|
|
1240
|
-
registerSeparator: (
|
|
1241
|
-
(M) =>
|
|
1266
|
+
registerSeparator: (b) => (Y(
|
|
1267
|
+
(M) => se(u, [...M, b])
|
|
1242
1268
|
), () => {
|
|
1243
|
-
|
|
1244
|
-
(M) => M.filter((
|
|
1269
|
+
Y(
|
|
1270
|
+
(M) => M.filter(($) => $ !== b)
|
|
1245
1271
|
);
|
|
1246
1272
|
})
|
|
1247
1273
|
}),
|
|
1248
|
-
[
|
|
1249
|
-
),
|
|
1274
|
+
[c, u]
|
|
1275
|
+
), A = Lt({
|
|
1250
1276
|
defaultLayout: n,
|
|
1251
1277
|
disableCursor: o
|
|
1252
|
-
}),
|
|
1278
|
+
}), U = D(null);
|
|
1253
1279
|
N(() => {
|
|
1254
1280
|
if (v === null)
|
|
1255
1281
|
return;
|
|
1256
|
-
const
|
|
1257
|
-
defaultLayout:
|
|
1258
|
-
disableCursor:
|
|
1259
|
-
disabled: !!
|
|
1282
|
+
const b = {
|
|
1283
|
+
defaultLayout: A.defaultLayout,
|
|
1284
|
+
disableCursor: !!A.disableCursor,
|
|
1285
|
+
disabled: !!i,
|
|
1260
1286
|
element: v,
|
|
1261
|
-
id:
|
|
1287
|
+
id: c,
|
|
1262
1288
|
inMemoryLastExpandedPanelSizes: Z.current.lastExpandedPanelSizes,
|
|
1263
1289
|
inMemoryLayouts: Z.current.layouts,
|
|
1264
1290
|
orientation: u,
|
|
1265
|
-
panels:
|
|
1266
|
-
separators:
|
|
1291
|
+
panels: w,
|
|
1292
|
+
separators: P
|
|
1267
1293
|
};
|
|
1268
|
-
|
|
1269
|
-
const M =
|
|
1270
|
-
if (
|
|
1271
|
-
const { defaultLayoutDeferred:
|
|
1272
|
-
!
|
|
1294
|
+
U.current = b;
|
|
1295
|
+
const M = wt(b), pe = G().mountedGroups.get(b);
|
|
1296
|
+
if (pe) {
|
|
1297
|
+
const { defaultLayoutDeferred: F, derivedPanelConstraints: H, layout: ee } = pe;
|
|
1298
|
+
!F && H.length > 0 && (g(ee), h?.(ee));
|
|
1273
1299
|
}
|
|
1274
|
-
const We =
|
|
1300
|
+
const We = T.addListener(
|
|
1275
1301
|
"interactionStateChange",
|
|
1276
|
-
(
|
|
1277
|
-
switch (
|
|
1302
|
+
(F) => {
|
|
1303
|
+
switch (F.state) {
|
|
1278
1304
|
case "active": {
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
(
|
|
1305
|
+
y(
|
|
1306
|
+
F.hitRegions.some(
|
|
1307
|
+
(H) => H.group === b
|
|
1282
1308
|
)
|
|
1283
1309
|
);
|
|
1284
1310
|
break;
|
|
1285
1311
|
}
|
|
1286
1312
|
default: {
|
|
1287
|
-
|
|
1313
|
+
y(!1);
|
|
1288
1314
|
break;
|
|
1289
1315
|
}
|
|
1290
1316
|
}
|
|
1291
1317
|
}
|
|
1292
|
-
),
|
|
1318
|
+
), Ve = T.addListener(
|
|
1293
1319
|
"mountedGroupsChange",
|
|
1294
|
-
(
|
|
1295
|
-
const
|
|
1296
|
-
if (
|
|
1297
|
-
const { defaultLayoutDeferred: ee, derivedPanelConstraints: Ue, layout:
|
|
1320
|
+
(F) => {
|
|
1321
|
+
const H = F.get(b);
|
|
1322
|
+
if (H) {
|
|
1323
|
+
const { defaultLayoutDeferred: ee, derivedPanelConstraints: Ue, layout: he } = H;
|
|
1298
1324
|
if (ee || Ue.length === 0)
|
|
1299
1325
|
return;
|
|
1300
|
-
|
|
1326
|
+
g(he), h?.(he);
|
|
1301
1327
|
}
|
|
1302
1328
|
}
|
|
1303
1329
|
);
|
|
1304
1330
|
return () => {
|
|
1305
|
-
|
|
1331
|
+
U.current = null, M(), We(), Ve();
|
|
1306
1332
|
};
|
|
1307
1333
|
}, [
|
|
1308
|
-
|
|
1334
|
+
i,
|
|
1309
1335
|
v,
|
|
1310
|
-
|
|
1311
|
-
|
|
1336
|
+
c,
|
|
1337
|
+
h,
|
|
1312
1338
|
u,
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1339
|
+
w,
|
|
1340
|
+
P,
|
|
1341
|
+
A
|
|
1316
1342
|
]), Re(() => {
|
|
1317
|
-
const
|
|
1318
|
-
|
|
1343
|
+
const b = U.current;
|
|
1344
|
+
b && (b.defaultLayout = n, b.disableCursor = !!o);
|
|
1319
1345
|
});
|
|
1320
|
-
const
|
|
1321
|
-
[
|
|
1346
|
+
const de = {
|
|
1347
|
+
[He]: d ? "none" : void 0
|
|
1322
1348
|
};
|
|
1323
|
-
for (const
|
|
1324
|
-
const M =
|
|
1325
|
-
|
|
1349
|
+
for (const b in x) {
|
|
1350
|
+
const M = je(c, b), $ = x[b];
|
|
1351
|
+
de[M] = $;
|
|
1326
1352
|
}
|
|
1327
|
-
return /* @__PURE__ */ K(
|
|
1353
|
+
return /* @__PURE__ */ K(Be.Provider, { value: Q, children: /* @__PURE__ */ K(
|
|
1328
1354
|
"div",
|
|
1329
1355
|
{
|
|
1330
|
-
...
|
|
1356
|
+
...p,
|
|
1331
1357
|
"aria-orientation": u,
|
|
1332
1358
|
className: t,
|
|
1333
1359
|
"data-group": !0,
|
|
1334
|
-
"data-testid":
|
|
1335
|
-
id:
|
|
1360
|
+
"data-testid": c,
|
|
1361
|
+
id: c,
|
|
1336
1362
|
ref: J,
|
|
1337
1363
|
style: {
|
|
1338
|
-
...
|
|
1339
|
-
...
|
|
1364
|
+
...f,
|
|
1365
|
+
...de,
|
|
1340
1366
|
display: "flex",
|
|
1341
1367
|
flexDirection: u === "horizontal" ? "row" : "column",
|
|
1342
1368
|
flexWrap: "nowrap"
|
|
@@ -1345,7 +1371,7 @@ function Gt({
|
|
|
1345
1371
|
}
|
|
1346
1372
|
) });
|
|
1347
1373
|
}
|
|
1348
|
-
function
|
|
1374
|
+
function Ct(e, t = 10) {
|
|
1349
1375
|
let n = null;
|
|
1350
1376
|
return (o) => {
|
|
1351
1377
|
n !== null && clearTimeout(n), n = setTimeout(() => {
|
|
@@ -1353,155 +1379,155 @@ function bt(e, t = 10) {
|
|
|
1353
1379
|
}, t);
|
|
1354
1380
|
};
|
|
1355
1381
|
}
|
|
1356
|
-
function
|
|
1382
|
+
function Rt(e) {
|
|
1357
1383
|
return `react-resizable-panels:${e}`;
|
|
1358
1384
|
}
|
|
1359
|
-
function
|
|
1385
|
+
function _t({
|
|
1360
1386
|
debounceSaveMs: e = 100,
|
|
1361
1387
|
storage: t,
|
|
1362
1388
|
...n
|
|
1363
1389
|
}) {
|
|
1364
|
-
const o = "id" in n ? n.id : n.groupId,
|
|
1365
|
-
|
|
1366
|
-
() => t.getItem(
|
|
1367
|
-
() => t.getItem(
|
|
1368
|
-
), l =
|
|
1369
|
-
() =>
|
|
1370
|
-
[
|
|
1371
|
-
),
|
|
1372
|
-
const
|
|
1390
|
+
const o = "id" in n ? n.id : n.groupId, i = Rt(o), s = Ze(
|
|
1391
|
+
Et,
|
|
1392
|
+
() => t.getItem(i),
|
|
1393
|
+
() => t.getItem(i)
|
|
1394
|
+
), l = ie(
|
|
1395
|
+
() => s ? JSON.parse(s) : void 0,
|
|
1396
|
+
[s]
|
|
1397
|
+
), r = ie(() => {
|
|
1398
|
+
const a = (u) => {
|
|
1373
1399
|
try {
|
|
1374
|
-
t.setItem(
|
|
1375
|
-
} catch (
|
|
1376
|
-
console.error(
|
|
1400
|
+
t.setItem(i, JSON.stringify(u));
|
|
1401
|
+
} catch (f) {
|
|
1402
|
+
console.error(f);
|
|
1377
1403
|
}
|
|
1378
1404
|
};
|
|
1379
|
-
return e > 0 ?
|
|
1380
|
-
}, [e, t,
|
|
1405
|
+
return e > 0 ? Ct(a, e) : a;
|
|
1406
|
+
}, [e, t, i]);
|
|
1381
1407
|
return {
|
|
1382
1408
|
defaultLayout: l,
|
|
1383
|
-
onLayoutChange:
|
|
1409
|
+
onLayoutChange: r
|
|
1384
1410
|
};
|
|
1385
1411
|
}
|
|
1386
|
-
function
|
|
1412
|
+
function Et() {
|
|
1387
1413
|
return function() {
|
|
1388
1414
|
};
|
|
1389
1415
|
}
|
|
1390
|
-
function
|
|
1416
|
+
function Nt() {
|
|
1391
1417
|
return I(null);
|
|
1392
1418
|
}
|
|
1393
|
-
function
|
|
1394
|
-
return
|
|
1419
|
+
function At() {
|
|
1420
|
+
return D(null);
|
|
1395
1421
|
}
|
|
1396
|
-
function
|
|
1397
|
-
const e =
|
|
1422
|
+
function fe() {
|
|
1423
|
+
const e = Je(Be);
|
|
1398
1424
|
return z(
|
|
1399
1425
|
e,
|
|
1400
1426
|
"Group Context not found; did you render a Panel or Separator outside of a Group?"
|
|
1401
1427
|
), e;
|
|
1402
1428
|
}
|
|
1403
|
-
function
|
|
1429
|
+
function Mt({
|
|
1404
1430
|
groupId: e,
|
|
1405
1431
|
panelId: t
|
|
1406
1432
|
}) {
|
|
1407
1433
|
const n = () => {
|
|
1408
|
-
const { mountedGroups:
|
|
1434
|
+
const { mountedGroups: r } = G();
|
|
1409
1435
|
for (const [
|
|
1410
|
-
|
|
1436
|
+
a,
|
|
1411
1437
|
{
|
|
1412
1438
|
defaultLayoutDeferred: u,
|
|
1413
|
-
derivedPanelConstraints:
|
|
1414
|
-
layout:
|
|
1439
|
+
derivedPanelConstraints: f,
|
|
1440
|
+
layout: p,
|
|
1415
1441
|
separatorToPanels: m
|
|
1416
1442
|
}
|
|
1417
|
-
] of
|
|
1418
|
-
if (
|
|
1443
|
+
] of r)
|
|
1444
|
+
if (a.id === e)
|
|
1419
1445
|
return {
|
|
1420
1446
|
defaultLayoutDeferred: u,
|
|
1421
|
-
derivedPanelConstraints:
|
|
1422
|
-
group:
|
|
1423
|
-
layout:
|
|
1447
|
+
derivedPanelConstraints: f,
|
|
1448
|
+
group: a,
|
|
1449
|
+
layout: p,
|
|
1424
1450
|
separatorToPanels: m
|
|
1425
1451
|
};
|
|
1426
1452
|
throw Error(`Group ${e} not found`);
|
|
1427
1453
|
}, o = () => {
|
|
1428
|
-
const
|
|
1429
|
-
(
|
|
1454
|
+
const r = n().derivedPanelConstraints.find(
|
|
1455
|
+
(a) => a.panelId === t
|
|
1430
1456
|
);
|
|
1431
|
-
if (
|
|
1432
|
-
return
|
|
1457
|
+
if (r !== void 0)
|
|
1458
|
+
return r;
|
|
1433
1459
|
throw Error(`Panel constraints not found for Panel ${t}`);
|
|
1434
|
-
},
|
|
1435
|
-
const
|
|
1436
|
-
if (
|
|
1437
|
-
return
|
|
1460
|
+
}, i = () => {
|
|
1461
|
+
const r = n().group.panels.find((a) => a.id === t);
|
|
1462
|
+
if (r !== void 0)
|
|
1463
|
+
return r;
|
|
1438
1464
|
throw Error(`Layout not found for Panel ${t}`);
|
|
1439
|
-
},
|
|
1440
|
-
const
|
|
1441
|
-
if (
|
|
1442
|
-
return
|
|
1465
|
+
}, s = () => {
|
|
1466
|
+
const r = n().layout[t];
|
|
1467
|
+
if (r !== void 0)
|
|
1468
|
+
return r;
|
|
1443
1469
|
throw Error(`Layout not found for Panel ${t}`);
|
|
1444
|
-
}, l = (
|
|
1445
|
-
const
|
|
1446
|
-
if (
|
|
1470
|
+
}, l = (r) => {
|
|
1471
|
+
const a = s();
|
|
1472
|
+
if (r === a)
|
|
1447
1473
|
return;
|
|
1448
1474
|
const {
|
|
1449
1475
|
defaultLayoutDeferred: u,
|
|
1450
|
-
derivedPanelConstraints:
|
|
1451
|
-
group:
|
|
1476
|
+
derivedPanelConstraints: f,
|
|
1477
|
+
group: p,
|
|
1452
1478
|
layout: m,
|
|
1453
|
-
separatorToPanels:
|
|
1454
|
-
} = n(),
|
|
1455
|
-
delta: d ?
|
|
1479
|
+
separatorToPanels: h
|
|
1480
|
+
} = n(), c = p.panels.findIndex((S) => S.id === t), d = c === p.panels.length - 1, y = q({
|
|
1481
|
+
delta: d ? a - r : r - a,
|
|
1456
1482
|
initialLayout: m,
|
|
1457
|
-
panelConstraints:
|
|
1458
|
-
pivotIndices: d ? [
|
|
1483
|
+
panelConstraints: f,
|
|
1484
|
+
pivotIndices: d ? [c - 1, c] : [c, c + 1],
|
|
1459
1485
|
prevLayout: m,
|
|
1460
1486
|
trigger: "imperative-api"
|
|
1461
|
-
}), v =
|
|
1462
|
-
layout:
|
|
1463
|
-
panelConstraints:
|
|
1487
|
+
}), v = _({
|
|
1488
|
+
layout: y,
|
|
1489
|
+
panelConstraints: f
|
|
1464
1490
|
});
|
|
1465
|
-
|
|
1466
|
-
mountedGroups: new Map(S.mountedGroups).set(
|
|
1491
|
+
V(m, v) || E((S) => ({
|
|
1492
|
+
mountedGroups: new Map(S.mountedGroups).set(p, {
|
|
1467
1493
|
defaultLayoutDeferred: u,
|
|
1468
|
-
derivedPanelConstraints:
|
|
1494
|
+
derivedPanelConstraints: f,
|
|
1469
1495
|
layout: v,
|
|
1470
|
-
separatorToPanels:
|
|
1496
|
+
separatorToPanels: h
|
|
1471
1497
|
})
|
|
1472
1498
|
}));
|
|
1473
1499
|
};
|
|
1474
1500
|
return {
|
|
1475
1501
|
collapse: () => {
|
|
1476
|
-
const { collapsible:
|
|
1477
|
-
|
|
1502
|
+
const { collapsible: r, collapsedSize: a } = o(), u = s();
|
|
1503
|
+
r && u !== a && l(a);
|
|
1478
1504
|
},
|
|
1479
1505
|
expand: () => {
|
|
1480
|
-
const { collapsible:
|
|
1481
|
-
|
|
1506
|
+
const { collapsible: r, collapsedSize: a, minSize: u } = o(), f = s();
|
|
1507
|
+
r && f === a && l(u);
|
|
1482
1508
|
},
|
|
1483
1509
|
getSize: () => {
|
|
1484
|
-
const { group:
|
|
1510
|
+
const { group: r } = n(), a = s(), { element: u } = i(), f = r.orientation === "horizontal" ? u.offsetWidth : u.offsetHeight;
|
|
1485
1511
|
return {
|
|
1486
|
-
asPercentage:
|
|
1487
|
-
inPixels:
|
|
1512
|
+
asPercentage: a,
|
|
1513
|
+
inPixels: f
|
|
1488
1514
|
};
|
|
1489
1515
|
},
|
|
1490
1516
|
isCollapsed: () => {
|
|
1491
|
-
const { collapsible:
|
|
1492
|
-
return
|
|
1517
|
+
const { collapsible: r, collapsedSize: a } = o(), u = s();
|
|
1518
|
+
return r && C(a, u);
|
|
1493
1519
|
},
|
|
1494
|
-
resize: (
|
|
1495
|
-
if (
|
|
1520
|
+
resize: (r) => {
|
|
1521
|
+
if (s() !== r) {
|
|
1496
1522
|
let u;
|
|
1497
|
-
switch (typeof
|
|
1523
|
+
switch (typeof r) {
|
|
1498
1524
|
case "number": {
|
|
1499
|
-
const { group:
|
|
1500
|
-
u = k(
|
|
1525
|
+
const { group: f } = n(), p = W({ group: f });
|
|
1526
|
+
u = k(r / p * 100);
|
|
1501
1527
|
break;
|
|
1502
1528
|
}
|
|
1503
1529
|
case "string": {
|
|
1504
|
-
u = parseFloat(
|
|
1530
|
+
u = parseFloat(r);
|
|
1505
1531
|
break;
|
|
1506
1532
|
}
|
|
1507
1533
|
}
|
|
@@ -1510,81 +1536,81 @@ function Ct({
|
|
|
1510
1536
|
}
|
|
1511
1537
|
};
|
|
1512
1538
|
}
|
|
1513
|
-
function
|
|
1514
|
-
const { id: n } =
|
|
1515
|
-
collapse:
|
|
1516
|
-
expand:
|
|
1539
|
+
function It(e, t) {
|
|
1540
|
+
const { id: n } = fe(), o = D({
|
|
1541
|
+
collapse: re,
|
|
1542
|
+
expand: re,
|
|
1517
1543
|
getSize: () => ({
|
|
1518
1544
|
asPercentage: 0,
|
|
1519
1545
|
inPixels: 0
|
|
1520
1546
|
}),
|
|
1521
1547
|
isCollapsed: () => !1,
|
|
1522
|
-
resize:
|
|
1548
|
+
resize: re
|
|
1523
1549
|
});
|
|
1524
1550
|
Ee(t, () => o.current, []), N(() => {
|
|
1525
1551
|
Object.assign(
|
|
1526
1552
|
o.current,
|
|
1527
|
-
|
|
1553
|
+
Mt({ groupId: n, panelId: e })
|
|
1528
1554
|
);
|
|
1529
1555
|
});
|
|
1530
1556
|
}
|
|
1531
|
-
function
|
|
1557
|
+
function $t({
|
|
1532
1558
|
children: e,
|
|
1533
1559
|
className: t,
|
|
1534
1560
|
collapsedSize: n = "0%",
|
|
1535
1561
|
collapsible: o = !1,
|
|
1536
|
-
defaultSize:
|
|
1537
|
-
elementRef:
|
|
1562
|
+
defaultSize: i,
|
|
1563
|
+
elementRef: s,
|
|
1538
1564
|
id: l,
|
|
1539
|
-
maxSize:
|
|
1540
|
-
minSize:
|
|
1565
|
+
maxSize: r = "100%",
|
|
1566
|
+
minSize: a = "0%",
|
|
1541
1567
|
onResize: u,
|
|
1542
|
-
panelRef:
|
|
1543
|
-
style:
|
|
1568
|
+
panelRef: f,
|
|
1569
|
+
style: p,
|
|
1544
1570
|
...m
|
|
1545
1571
|
}) {
|
|
1546
|
-
const
|
|
1547
|
-
u?.(
|
|
1572
|
+
const h = !!l, c = le(l), [d, y] = I(null), v = ce(y, s), { id: S, registerPanel: x } = fe(), g = u !== null, w = ue((P) => {
|
|
1573
|
+
u?.(P, l);
|
|
1548
1574
|
});
|
|
1549
1575
|
N(() => {
|
|
1550
1576
|
if (d !== null)
|
|
1551
1577
|
return x({
|
|
1552
1578
|
element: d,
|
|
1553
|
-
id:
|
|
1554
|
-
idIsStable:
|
|
1555
|
-
onResize:
|
|
1579
|
+
id: c,
|
|
1580
|
+
idIsStable: h,
|
|
1581
|
+
onResize: g ? w : void 0,
|
|
1556
1582
|
panelConstraints: {
|
|
1557
1583
|
collapsedSize: n,
|
|
1558
1584
|
collapsible: o,
|
|
1559
|
-
defaultSize:
|
|
1560
|
-
maxSize:
|
|
1561
|
-
minSize:
|
|
1585
|
+
defaultSize: i,
|
|
1586
|
+
maxSize: r,
|
|
1587
|
+
minSize: a
|
|
1562
1588
|
}
|
|
1563
1589
|
});
|
|
1564
1590
|
}, [
|
|
1565
1591
|
n,
|
|
1566
1592
|
o,
|
|
1567
|
-
r,
|
|
1568
|
-
d,
|
|
1569
|
-
y,
|
|
1570
|
-
f,
|
|
1571
|
-
p,
|
|
1572
1593
|
i,
|
|
1573
|
-
|
|
1574
|
-
|
|
1594
|
+
d,
|
|
1595
|
+
g,
|
|
1596
|
+
c,
|
|
1597
|
+
h,
|
|
1598
|
+
r,
|
|
1599
|
+
a,
|
|
1600
|
+
w,
|
|
1575
1601
|
x
|
|
1576
|
-
]),
|
|
1577
|
-
const L =
|
|
1602
|
+
]), It(c, f);
|
|
1603
|
+
const L = je(S, c);
|
|
1578
1604
|
return /* @__PURE__ */ K(
|
|
1579
1605
|
"div",
|
|
1580
1606
|
{
|
|
1581
1607
|
...m,
|
|
1582
1608
|
"data-panel": !0,
|
|
1583
|
-
"data-testid":
|
|
1584
|
-
id:
|
|
1609
|
+
"data-testid": c,
|
|
1610
|
+
id: c,
|
|
1585
1611
|
ref: v,
|
|
1586
1612
|
style: {
|
|
1587
|
-
...
|
|
1613
|
+
...kt,
|
|
1588
1614
|
flexBasis: 0,
|
|
1589
1615
|
flexGrow: `var(${L}, 1)`,
|
|
1590
1616
|
flexShrink: 1,
|
|
@@ -1592,7 +1618,7 @@ function _t({
|
|
|
1592
1618
|
overflow: "hidden",
|
|
1593
1619
|
// Disable pointer events inside of a panel during resize
|
|
1594
1620
|
// This avoid edge cases like nested iframes
|
|
1595
|
-
pointerEvents: `var(${
|
|
1621
|
+
pointerEvents: `var(${He})`
|
|
1596
1622
|
},
|
|
1597
1623
|
children: /* @__PURE__ */ K(
|
|
1598
1624
|
"div",
|
|
@@ -1601,7 +1627,7 @@ function _t({
|
|
|
1601
1627
|
style: {
|
|
1602
1628
|
width: "100%",
|
|
1603
1629
|
height: "100%",
|
|
1604
|
-
...
|
|
1630
|
+
...p
|
|
1605
1631
|
},
|
|
1606
1632
|
children: e
|
|
1607
1633
|
}
|
|
@@ -1609,7 +1635,7 @@ function _t({
|
|
|
1609
1635
|
}
|
|
1610
1636
|
);
|
|
1611
1637
|
}
|
|
1612
|
-
const
|
|
1638
|
+
const kt = {
|
|
1613
1639
|
minHeight: "unset",
|
|
1614
1640
|
maxHeight: "unset",
|
|
1615
1641
|
height: "unset",
|
|
@@ -1625,40 +1651,40 @@ const Et = {
|
|
|
1625
1651
|
padding: "unset",
|
|
1626
1652
|
margin: "unset"
|
|
1627
1653
|
};
|
|
1628
|
-
function
|
|
1654
|
+
function Ft() {
|
|
1629
1655
|
return I(null);
|
|
1630
1656
|
}
|
|
1631
|
-
function
|
|
1632
|
-
return
|
|
1657
|
+
function Ht() {
|
|
1658
|
+
return D(null);
|
|
1633
1659
|
}
|
|
1634
|
-
function
|
|
1660
|
+
function Gt({
|
|
1635
1661
|
layout: e,
|
|
1636
1662
|
panelConstraints: t,
|
|
1637
1663
|
panelId: n,
|
|
1638
1664
|
panelIndex: o
|
|
1639
1665
|
}) {
|
|
1640
|
-
let
|
|
1641
|
-
const l = e[n],
|
|
1642
|
-
(
|
|
1666
|
+
let i, s;
|
|
1667
|
+
const l = e[n], r = t.find(
|
|
1668
|
+
(a) => a.panelId === n
|
|
1643
1669
|
);
|
|
1644
|
-
if (
|
|
1645
|
-
const
|
|
1646
|
-
|
|
1647
|
-
layout:
|
|
1670
|
+
if (r) {
|
|
1671
|
+
const a = r.maxSize, u = s = r.collapsible ? r.collapsedSize : r.minSize, f = [o, o + 1];
|
|
1672
|
+
s = _({
|
|
1673
|
+
layout: q({
|
|
1648
1674
|
delta: u - l,
|
|
1649
1675
|
initialLayout: e,
|
|
1650
1676
|
panelConstraints: t,
|
|
1651
|
-
pivotIndices:
|
|
1677
|
+
pivotIndices: f,
|
|
1652
1678
|
prevLayout: e,
|
|
1653
1679
|
trigger: "keyboard"
|
|
1654
1680
|
}),
|
|
1655
1681
|
panelConstraints: t
|
|
1656
|
-
})[n],
|
|
1657
|
-
layout:
|
|
1658
|
-
delta:
|
|
1682
|
+
})[n], i = _({
|
|
1683
|
+
layout: q({
|
|
1684
|
+
delta: a - l,
|
|
1659
1685
|
initialLayout: e,
|
|
1660
1686
|
panelConstraints: t,
|
|
1661
|
-
pivotIndices:
|
|
1687
|
+
pivotIndices: f,
|
|
1662
1688
|
prevLayout: e,
|
|
1663
1689
|
trigger: "keyboard"
|
|
1664
1690
|
}),
|
|
@@ -1667,53 +1693,53 @@ function Mt({
|
|
|
1667
1693
|
}
|
|
1668
1694
|
return {
|
|
1669
1695
|
valueControls: n,
|
|
1670
|
-
valueMax:
|
|
1671
|
-
valueMin:
|
|
1696
|
+
valueMax: i,
|
|
1697
|
+
valueMin: s,
|
|
1672
1698
|
valueNow: l
|
|
1673
1699
|
};
|
|
1674
1700
|
}
|
|
1675
|
-
function
|
|
1701
|
+
function jt({
|
|
1676
1702
|
children: e,
|
|
1677
1703
|
className: t,
|
|
1678
1704
|
elementRef: n,
|
|
1679
1705
|
id: o,
|
|
1680
|
-
style:
|
|
1681
|
-
...
|
|
1706
|
+
style: i,
|
|
1707
|
+
...s
|
|
1682
1708
|
}) {
|
|
1683
|
-
const l =
|
|
1684
|
-
id:
|
|
1709
|
+
const l = le(o), [r, a] = I({}), [u, f] = I("inactive"), [p, m] = I(null), h = ce(m, n), {
|
|
1710
|
+
id: c,
|
|
1685
1711
|
orientation: d,
|
|
1686
|
-
registerSeparator:
|
|
1687
|
-
} =
|
|
1712
|
+
registerSeparator: y
|
|
1713
|
+
} = fe(), v = d === "horizontal" ? "vertical" : "horizontal";
|
|
1688
1714
|
return N(() => {
|
|
1689
|
-
if (
|
|
1715
|
+
if (p !== null) {
|
|
1690
1716
|
const S = {
|
|
1691
|
-
element:
|
|
1717
|
+
element: p,
|
|
1692
1718
|
id: l
|
|
1693
|
-
}, x =
|
|
1719
|
+
}, x = y(S), g = T.addListener(
|
|
1694
1720
|
"interactionStateChange",
|
|
1695
1721
|
(L) => {
|
|
1696
|
-
|
|
1722
|
+
f(
|
|
1697
1723
|
L.state !== "inactive" && L.hitRegions.some(
|
|
1698
|
-
(
|
|
1724
|
+
(P) => P.separator === S
|
|
1699
1725
|
) ? L.state : "inactive"
|
|
1700
1726
|
);
|
|
1701
1727
|
}
|
|
1702
|
-
),
|
|
1728
|
+
), w = T.addListener(
|
|
1703
1729
|
"mountedGroupsChange",
|
|
1704
1730
|
(L) => {
|
|
1705
1731
|
L.forEach(
|
|
1706
|
-
({ derivedPanelConstraints:
|
|
1707
|
-
if (J.id ===
|
|
1732
|
+
({ derivedPanelConstraints: P, layout: Y, separatorToPanels: Z }, J) => {
|
|
1733
|
+
if (J.id === c) {
|
|
1708
1734
|
const Q = Z.get(S);
|
|
1709
1735
|
if (Q) {
|
|
1710
|
-
const
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
layout:
|
|
1714
|
-
panelConstraints:
|
|
1715
|
-
panelId:
|
|
1716
|
-
panelIndex:
|
|
1736
|
+
const A = Q[0], U = J.panels.indexOf(A);
|
|
1737
|
+
a(
|
|
1738
|
+
Gt({
|
|
1739
|
+
layout: Y,
|
|
1740
|
+
panelConstraints: P,
|
|
1741
|
+
panelId: A.id,
|
|
1742
|
+
panelIndex: U
|
|
1717
1743
|
})
|
|
1718
1744
|
);
|
|
1719
1745
|
}
|
|
@@ -1723,28 +1749,28 @@ function $t({
|
|
|
1723
1749
|
}
|
|
1724
1750
|
);
|
|
1725
1751
|
return () => {
|
|
1726
|
-
|
|
1752
|
+
g(), w(), x();
|
|
1727
1753
|
};
|
|
1728
1754
|
}
|
|
1729
|
-
}, [
|
|
1755
|
+
}, [p, c, l, y]), /* @__PURE__ */ K(
|
|
1730
1756
|
"div",
|
|
1731
1757
|
{
|
|
1732
|
-
...
|
|
1733
|
-
"aria-controls":
|
|
1758
|
+
...s,
|
|
1759
|
+
"aria-controls": r.valueControls,
|
|
1734
1760
|
"aria-orientation": v,
|
|
1735
|
-
"aria-valuemax":
|
|
1736
|
-
"aria-valuemin":
|
|
1737
|
-
"aria-valuenow":
|
|
1761
|
+
"aria-valuemax": r.valueMax,
|
|
1762
|
+
"aria-valuemin": r.valueMin,
|
|
1763
|
+
"aria-valuenow": r.valueNow,
|
|
1738
1764
|
children: e,
|
|
1739
1765
|
className: t,
|
|
1740
1766
|
"data-separator": u,
|
|
1741
1767
|
"data-testid": l,
|
|
1742
1768
|
id: l,
|
|
1743
|
-
ref:
|
|
1769
|
+
ref: h,
|
|
1744
1770
|
role: "separator",
|
|
1745
1771
|
style: {
|
|
1746
1772
|
flexBasis: "auto",
|
|
1747
|
-
...
|
|
1773
|
+
...i,
|
|
1748
1774
|
flexGrow: 0,
|
|
1749
1775
|
flexShrink: 0
|
|
1750
1776
|
},
|
|
@@ -1753,13 +1779,13 @@ function $t({
|
|
|
1753
1779
|
);
|
|
1754
1780
|
}
|
|
1755
1781
|
export {
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1782
|
+
Tt as Group,
|
|
1783
|
+
$t as Panel,
|
|
1784
|
+
jt as Separator,
|
|
1785
|
+
_t as useDefaultLayout,
|
|
1786
|
+
Nt as useGroupCallbackRef,
|
|
1787
|
+
At as useGroupRef,
|
|
1788
|
+
Ft as usePanelCallbackRef,
|
|
1789
|
+
Ht as usePanelRef
|
|
1764
1790
|
};
|
|
1765
1791
|
//# sourceMappingURL=react-resizable-panels.js.map
|