react-resizable-panels 4.12.4 → 4.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { useState as
|
|
4
|
-
function
|
|
2
|
+
import { jsx as B, jsxs as zt } from "react/jsx-runtime";
|
|
3
|
+
import { useState as Z, useCallback as ce, useId as wt, useLayoutEffect as Ze, useEffect as Se, useRef as D, createContext as Pt, useContext as Lt, isValidElement as Ct, useImperativeHandle as Qe, useMemo as Pe, useSyncExternalStore as et } from "react";
|
|
4
|
+
function Rt(e, t) {
|
|
5
5
|
const n = getComputedStyle(e), o = parseFloat(n.fontSize);
|
|
6
6
|
return t * o;
|
|
7
7
|
}
|
|
8
|
-
function
|
|
8
|
+
function Mt(e, t) {
|
|
9
9
|
const n = getComputedStyle(e.ownerDocument.documentElement), o = parseFloat(n.fontSize);
|
|
10
10
|
return t * o;
|
|
11
11
|
}
|
|
12
|
-
function
|
|
12
|
+
function Et(e) {
|
|
13
13
|
return e / 100 * window.innerHeight;
|
|
14
14
|
}
|
|
15
|
-
function
|
|
15
|
+
function It(e) {
|
|
16
16
|
return e / 100 * window.innerWidth;
|
|
17
17
|
}
|
|
18
|
-
function
|
|
18
|
+
function kt(e) {
|
|
19
19
|
switch (typeof e) {
|
|
20
20
|
case "number":
|
|
21
21
|
return [e, "px"];
|
|
@@ -25,52 +25,52 @@ function xt(e) {
|
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
|
-
function
|
|
28
|
+
function ie({
|
|
29
29
|
groupSize: e,
|
|
30
30
|
panelElement: t,
|
|
31
31
|
styleProp: n
|
|
32
32
|
}) {
|
|
33
33
|
let o;
|
|
34
|
-
const [
|
|
35
|
-
switch (
|
|
34
|
+
const [r, i] = kt(n);
|
|
35
|
+
switch (i) {
|
|
36
36
|
case "%": {
|
|
37
|
-
o =
|
|
37
|
+
o = r / 100 * e;
|
|
38
38
|
break;
|
|
39
39
|
}
|
|
40
40
|
case "px": {
|
|
41
|
-
o =
|
|
41
|
+
o = r;
|
|
42
42
|
break;
|
|
43
43
|
}
|
|
44
44
|
case "rem": {
|
|
45
|
-
o =
|
|
45
|
+
o = Mt(t, r);
|
|
46
46
|
break;
|
|
47
47
|
}
|
|
48
48
|
case "em": {
|
|
49
|
-
o =
|
|
49
|
+
o = Rt(t, r);
|
|
50
50
|
break;
|
|
51
51
|
}
|
|
52
52
|
case "vh": {
|
|
53
|
-
o =
|
|
53
|
+
o = Et(r);
|
|
54
54
|
break;
|
|
55
55
|
}
|
|
56
56
|
case "vw": {
|
|
57
|
-
o =
|
|
57
|
+
o = It(r);
|
|
58
58
|
break;
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
return o;
|
|
62
62
|
}
|
|
63
|
-
function
|
|
63
|
+
function A(e) {
|
|
64
64
|
return parseFloat(e.toFixed(3));
|
|
65
65
|
}
|
|
66
|
-
function
|
|
66
|
+
function ae({
|
|
67
67
|
group: e
|
|
68
68
|
}) {
|
|
69
69
|
const { orientation: t, panels: n } = e;
|
|
70
|
-
return n.reduce((o,
|
|
70
|
+
return n.reduce((o, r) => (o += t === "horizontal" ? r.element.offsetWidth : r.element.offsetHeight, o), 0);
|
|
71
71
|
}
|
|
72
|
-
function
|
|
73
|
-
const { panels: t } = e, n =
|
|
72
|
+
function Le(e) {
|
|
73
|
+
const { panels: t } = e, n = ae({ group: e });
|
|
74
74
|
return n === 0 ? t.map((o) => ({
|
|
75
75
|
groupResizeBehavior: o.panelConstraints.groupResizeBehavior,
|
|
76
76
|
collapsedSize: 0,
|
|
@@ -81,226 +81,66 @@ function be(e) {
|
|
|
81
81
|
maxSize: 100,
|
|
82
82
|
panelId: o.id
|
|
83
83
|
})) : t.map((o) => {
|
|
84
|
-
const { element:
|
|
85
|
-
let
|
|
86
|
-
if (
|
|
87
|
-
const
|
|
84
|
+
const { element: r, panelConstraints: i } = o;
|
|
85
|
+
let c = 0;
|
|
86
|
+
if (i.collapsedSize !== void 0) {
|
|
87
|
+
const f = ie({
|
|
88
88
|
groupSize: n,
|
|
89
|
-
panelElement:
|
|
90
|
-
styleProp:
|
|
89
|
+
panelElement: r,
|
|
90
|
+
styleProp: i.collapsedSize
|
|
91
91
|
});
|
|
92
|
-
|
|
92
|
+
c = A(f / n * 100);
|
|
93
|
+
}
|
|
94
|
+
let l;
|
|
95
|
+
if (i.collapsedThreshold !== void 0) {
|
|
96
|
+
const f = ie({
|
|
97
|
+
groupSize: n,
|
|
98
|
+
panelElement: r,
|
|
99
|
+
styleProp: i.collapsedThreshold
|
|
100
|
+
});
|
|
101
|
+
l = A(f / n * 100);
|
|
93
102
|
}
|
|
94
103
|
let a;
|
|
95
|
-
if (
|
|
96
|
-
const
|
|
104
|
+
if (i.defaultSize !== void 0) {
|
|
105
|
+
const f = ie({
|
|
97
106
|
groupSize: n,
|
|
98
|
-
panelElement:
|
|
99
|
-
styleProp:
|
|
107
|
+
panelElement: r,
|
|
108
|
+
styleProp: i.defaultSize
|
|
100
109
|
});
|
|
101
|
-
a =
|
|
110
|
+
a = A(f / n * 100);
|
|
102
111
|
}
|
|
103
|
-
let
|
|
104
|
-
if (
|
|
105
|
-
const
|
|
112
|
+
let s = 0;
|
|
113
|
+
if (i.minSize !== void 0) {
|
|
114
|
+
const f = ie({
|
|
106
115
|
groupSize: n,
|
|
107
|
-
panelElement:
|
|
108
|
-
styleProp:
|
|
116
|
+
panelElement: r,
|
|
117
|
+
styleProp: i.minSize
|
|
109
118
|
});
|
|
110
|
-
|
|
119
|
+
s = A(f / n * 100);
|
|
111
120
|
}
|
|
112
|
-
let
|
|
113
|
-
if (
|
|
114
|
-
const
|
|
121
|
+
let u = 100;
|
|
122
|
+
if (i.maxSize !== void 0) {
|
|
123
|
+
const f = ie({
|
|
115
124
|
groupSize: n,
|
|
116
|
-
panelElement:
|
|
117
|
-
styleProp:
|
|
125
|
+
panelElement: r,
|
|
126
|
+
styleProp: i.maxSize
|
|
118
127
|
});
|
|
119
|
-
|
|
128
|
+
u = A(f / n * 100);
|
|
120
129
|
}
|
|
121
130
|
return {
|
|
122
|
-
groupResizeBehavior:
|
|
123
|
-
collapsedSize:
|
|
124
|
-
|
|
131
|
+
groupResizeBehavior: i.groupResizeBehavior,
|
|
132
|
+
collapsedSize: c,
|
|
133
|
+
collapsedThreshold: l,
|
|
134
|
+
collapsible: i.collapsible === !0,
|
|
125
135
|
defaultSize: a,
|
|
126
|
-
disabled:
|
|
127
|
-
minSize:
|
|
128
|
-
maxSize:
|
|
136
|
+
disabled: i.disabled,
|
|
137
|
+
minSize: s,
|
|
138
|
+
maxSize: u,
|
|
129
139
|
panelId: o.id
|
|
130
140
|
};
|
|
131
141
|
});
|
|
132
142
|
}
|
|
133
|
-
|
|
134
|
-
if (!e)
|
|
135
|
-
throw Error(t);
|
|
136
|
-
}
|
|
137
|
-
function ze(e, t) {
|
|
138
|
-
return Array.from(t).sort(
|
|
139
|
-
e === "horizontal" ? Pt : wt
|
|
140
|
-
);
|
|
141
|
-
}
|
|
142
|
-
function Pt(e, t) {
|
|
143
|
-
const n = e.element.offsetLeft - t.element.offsetLeft;
|
|
144
|
-
return n !== 0 ? n : e.element.offsetWidth - t.element.offsetWidth;
|
|
145
|
-
}
|
|
146
|
-
function wt(e, t) {
|
|
147
|
-
const n = e.element.offsetTop - t.element.offsetTop;
|
|
148
|
-
return n !== 0 ? n : e.element.offsetHeight - t.element.offsetHeight;
|
|
149
|
-
}
|
|
150
|
-
function Ye(e) {
|
|
151
|
-
return e !== null && typeof e == "object" && "nodeType" in e && e.nodeType === Node.ELEMENT_NODE;
|
|
152
|
-
}
|
|
153
|
-
function Je(e, t) {
|
|
154
|
-
return {
|
|
155
|
-
x: e.x >= t.left && e.x <= t.right ? 0 : Math.min(
|
|
156
|
-
Math.abs(e.x - t.left),
|
|
157
|
-
Math.abs(e.x - t.right)
|
|
158
|
-
),
|
|
159
|
-
y: e.y >= t.top && e.y <= t.bottom ? 0 : Math.min(
|
|
160
|
-
Math.abs(e.y - t.top),
|
|
161
|
-
Math.abs(e.y - t.bottom)
|
|
162
|
-
)
|
|
163
|
-
};
|
|
164
|
-
}
|
|
165
|
-
function Lt({
|
|
166
|
-
orientation: e,
|
|
167
|
-
rects: t,
|
|
168
|
-
targetRect: n
|
|
169
|
-
}) {
|
|
170
|
-
const o = {
|
|
171
|
-
x: n.x + n.width / 2,
|
|
172
|
-
y: n.y + n.height / 2
|
|
173
|
-
};
|
|
174
|
-
let i, s = Number.MAX_VALUE;
|
|
175
|
-
for (const u of t) {
|
|
176
|
-
const { x: a, y: r } = Je(o, u), l = e === "horizontal" ? a : r;
|
|
177
|
-
l < s && (s = l, i = u);
|
|
178
|
-
}
|
|
179
|
-
return C(i, "No rect found"), i;
|
|
180
|
-
}
|
|
181
|
-
let de;
|
|
182
|
-
function Ct() {
|
|
183
|
-
return de === void 0 && (typeof matchMedia == "function" ? de = !!matchMedia("(pointer:coarse)").matches : de = !1), de;
|
|
184
|
-
}
|
|
185
|
-
function Ze(e) {
|
|
186
|
-
const { element: t, orientation: n, panels: o, separators: i } = e, s = ze(
|
|
187
|
-
n,
|
|
188
|
-
Array.from(t.children).filter(Ye).map((z) => ({ element: z }))
|
|
189
|
-
).map(({ element: z }) => z), u = [];
|
|
190
|
-
let a = !1, r = !1, l = -1, c = -1, m = 0, p, S = [];
|
|
191
|
-
{
|
|
192
|
-
let z = -1;
|
|
193
|
-
for (const f of s)
|
|
194
|
-
f.hasAttribute("data-panel") && (z++, f.hasAttribute("data-disabled") || (m++, l === -1 && (l = z), c = z));
|
|
195
|
-
}
|
|
196
|
-
if (m > 1) {
|
|
197
|
-
let z = -1;
|
|
198
|
-
for (const f of s)
|
|
199
|
-
if (f.hasAttribute("data-panel")) {
|
|
200
|
-
z++;
|
|
201
|
-
const d = o.find(
|
|
202
|
-
(h) => h.element === f
|
|
203
|
-
);
|
|
204
|
-
if (d) {
|
|
205
|
-
if (p) {
|
|
206
|
-
const h = p.element.getBoundingClientRect(), y = f.getBoundingClientRect();
|
|
207
|
-
let b;
|
|
208
|
-
if (r) {
|
|
209
|
-
const v = n === "horizontal" ? new DOMRect(
|
|
210
|
-
h.right,
|
|
211
|
-
h.top,
|
|
212
|
-
0,
|
|
213
|
-
h.height
|
|
214
|
-
) : new DOMRect(
|
|
215
|
-
h.left,
|
|
216
|
-
h.bottom,
|
|
217
|
-
h.width,
|
|
218
|
-
0
|
|
219
|
-
), g = n === "horizontal" ? new DOMRect(y.left, y.top, 0, y.height) : new DOMRect(y.left, y.top, y.width, 0);
|
|
220
|
-
switch (S.length) {
|
|
221
|
-
case 0: {
|
|
222
|
-
b = [
|
|
223
|
-
v,
|
|
224
|
-
g
|
|
225
|
-
];
|
|
226
|
-
break;
|
|
227
|
-
}
|
|
228
|
-
case 1: {
|
|
229
|
-
const w = S[0], E = Lt({
|
|
230
|
-
orientation: n,
|
|
231
|
-
rects: [h, y],
|
|
232
|
-
targetRect: w.element.getBoundingClientRect()
|
|
233
|
-
});
|
|
234
|
-
b = [
|
|
235
|
-
w,
|
|
236
|
-
E === h ? g : v
|
|
237
|
-
];
|
|
238
|
-
break;
|
|
239
|
-
}
|
|
240
|
-
default: {
|
|
241
|
-
b = S;
|
|
242
|
-
break;
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
} else
|
|
246
|
-
S.length ? b = S : b = [
|
|
247
|
-
n === "horizontal" ? new DOMRect(
|
|
248
|
-
h.right,
|
|
249
|
-
y.top,
|
|
250
|
-
y.left - h.right,
|
|
251
|
-
y.height
|
|
252
|
-
) : new DOMRect(
|
|
253
|
-
y.left,
|
|
254
|
-
h.bottom,
|
|
255
|
-
y.width,
|
|
256
|
-
y.top - h.bottom
|
|
257
|
-
)
|
|
258
|
-
];
|
|
259
|
-
for (const v of b) {
|
|
260
|
-
let g = "width" in v ? v : v.element.getBoundingClientRect();
|
|
261
|
-
const w = Ct() ? e.resizeTargetMinimumSize.coarse : e.resizeTargetMinimumSize.fine;
|
|
262
|
-
if (g.width < w) {
|
|
263
|
-
const L = w - g.width;
|
|
264
|
-
g = new DOMRect(
|
|
265
|
-
g.x - L / 2,
|
|
266
|
-
g.y,
|
|
267
|
-
g.width + L,
|
|
268
|
-
g.height
|
|
269
|
-
);
|
|
270
|
-
}
|
|
271
|
-
if (g.height < w) {
|
|
272
|
-
const L = w - g.height;
|
|
273
|
-
g = new DOMRect(
|
|
274
|
-
g.x,
|
|
275
|
-
g.y - L / 2,
|
|
276
|
-
g.width,
|
|
277
|
-
g.height + L
|
|
278
|
-
);
|
|
279
|
-
}
|
|
280
|
-
const E = z <= l || z > c;
|
|
281
|
-
!a && !E && u.push({
|
|
282
|
-
group: e,
|
|
283
|
-
groupSize: ne({ group: e }),
|
|
284
|
-
panels: [p, d],
|
|
285
|
-
separator: "width" in v ? void 0 : v,
|
|
286
|
-
rect: g
|
|
287
|
-
}), a = !1;
|
|
288
|
-
}
|
|
289
|
-
}
|
|
290
|
-
r = !1, p = d, S = [];
|
|
291
|
-
}
|
|
292
|
-
} else if (f.hasAttribute("data-separator")) {
|
|
293
|
-
f.ariaDisabled !== null && (a = !0);
|
|
294
|
-
const d = i.find(
|
|
295
|
-
(h) => h.element === f
|
|
296
|
-
);
|
|
297
|
-
d ? S.push(d) : (p = void 0, S = []);
|
|
298
|
-
} else
|
|
299
|
-
r = !0;
|
|
300
|
-
}
|
|
301
|
-
return u;
|
|
302
|
-
}
|
|
303
|
-
class Qe {
|
|
143
|
+
class tt {
|
|
304
144
|
#e = {};
|
|
305
145
|
addListener(t, n) {
|
|
306
146
|
const o = this.#e[t];
|
|
@@ -314,18 +154,18 @@ class Qe {
|
|
|
314
154
|
if (o.length === 1)
|
|
315
155
|
o[0].call(null, n);
|
|
316
156
|
else {
|
|
317
|
-
let
|
|
318
|
-
const
|
|
319
|
-
for (let
|
|
320
|
-
const
|
|
157
|
+
let r = !1, i = null;
|
|
158
|
+
const c = Array.from(o);
|
|
159
|
+
for (let l = 0; l < c.length; l++) {
|
|
160
|
+
const a = c[l];
|
|
321
161
|
try {
|
|
322
|
-
|
|
323
|
-
} catch (
|
|
324
|
-
|
|
162
|
+
a.call(null, n);
|
|
163
|
+
} catch (s) {
|
|
164
|
+
i === null && (r = !0, i = s);
|
|
325
165
|
}
|
|
326
166
|
}
|
|
327
|
-
if (
|
|
328
|
-
throw
|
|
167
|
+
if (r)
|
|
168
|
+
throw i;
|
|
329
169
|
}
|
|
330
170
|
}
|
|
331
171
|
removeAllListeners() {
|
|
@@ -334,106 +174,138 @@ class Qe {
|
|
|
334
174
|
removeListener(t, n) {
|
|
335
175
|
const o = this.#e[t];
|
|
336
176
|
if (o !== void 0) {
|
|
337
|
-
const
|
|
338
|
-
|
|
177
|
+
const r = o.indexOf(n);
|
|
178
|
+
r >= 0 && o.splice(r, 1);
|
|
339
179
|
}
|
|
340
180
|
}
|
|
341
181
|
}
|
|
342
|
-
let
|
|
182
|
+
let k = {
|
|
343
183
|
cursorFlags: 0,
|
|
344
184
|
state: "inactive"
|
|
345
185
|
};
|
|
346
|
-
const
|
|
347
|
-
function
|
|
348
|
-
return
|
|
186
|
+
const Re = new tt();
|
|
187
|
+
function X() {
|
|
188
|
+
return k;
|
|
349
189
|
}
|
|
350
|
-
function
|
|
351
|
-
return
|
|
190
|
+
function nt(e) {
|
|
191
|
+
return Re.addListener("change", e);
|
|
352
192
|
}
|
|
353
|
-
function
|
|
354
|
-
const
|
|
355
|
-
|
|
356
|
-
prev:
|
|
357
|
-
next:
|
|
193
|
+
function Tt(e, t = [], n) {
|
|
194
|
+
const o = k, r = { ...k };
|
|
195
|
+
r.cursorFlags = e, r.state === "active" && (r.previews = t, n && (r.previewLayoutMap = n)), k = r, Re.emit("change", {
|
|
196
|
+
prev: o,
|
|
197
|
+
next: r
|
|
358
198
|
});
|
|
359
199
|
}
|
|
360
|
-
function
|
|
361
|
-
const t =
|
|
362
|
-
|
|
200
|
+
function U(e) {
|
|
201
|
+
const t = k;
|
|
202
|
+
k = e, Re.emit("change", {
|
|
363
203
|
prev: t,
|
|
364
204
|
next: e
|
|
365
205
|
});
|
|
366
206
|
}
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
207
|
+
function Ot(e) {
|
|
208
|
+
k.state !== "active" || !k.previews.some((t) => t.separator === e) || U({
|
|
209
|
+
...k,
|
|
210
|
+
previews: k.previews.map(
|
|
211
|
+
(t) => t.separator === e ? { ...t } : t
|
|
212
|
+
)
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
function Dt(e) {
|
|
216
|
+
if (k.state === "inactive")
|
|
217
|
+
return !1;
|
|
218
|
+
const t = k.hitRegions.filter(
|
|
219
|
+
(o) => o.group !== e
|
|
220
|
+
), n = k.state === "active" && k.previews.some((o) => o.group === e);
|
|
221
|
+
if (t.length === k.hitRegions.length && !n)
|
|
222
|
+
return !1;
|
|
223
|
+
if (t.length === 0)
|
|
224
|
+
U({ cursorFlags: 0, state: "inactive" });
|
|
225
|
+
else if (k.state === "active") {
|
|
226
|
+
const o = new Map(k.initialLayoutMap), r = new Map(k.previewLayoutMap);
|
|
227
|
+
o.delete(e), r.delete(e), U({
|
|
228
|
+
...k,
|
|
229
|
+
cursorFlags: 0,
|
|
230
|
+
hitRegions: t,
|
|
231
|
+
initialLayoutMap: o,
|
|
232
|
+
previewLayoutMap: r,
|
|
233
|
+
previews: k.previews.filter((i) => i.group !== e)
|
|
234
|
+
});
|
|
235
|
+
} else
|
|
236
|
+
U({ ...k, hitRegions: t });
|
|
237
|
+
return !0;
|
|
372
238
|
}
|
|
373
|
-
|
|
239
|
+
const At = (e) => e, we = () => {
|
|
240
|
+
}, ot = 1, rt = 2, it = 4, st = 8, Ge = 3, Fe = 12;
|
|
241
|
+
let me;
|
|
242
|
+
function Ne() {
|
|
243
|
+
return me === void 0 && (me = !1, typeof window < "u" && (window.navigator.userAgent.includes("Chrome") || window.navigator.userAgent.includes("Firefox")) && (me = !0)), me;
|
|
244
|
+
}
|
|
245
|
+
function Gt({
|
|
374
246
|
cursorFlags: e,
|
|
375
247
|
groups: t,
|
|
376
248
|
state: n
|
|
377
249
|
}) {
|
|
378
|
-
let o = 0,
|
|
250
|
+
let o = 0, r = 0;
|
|
379
251
|
switch (n) {
|
|
380
252
|
case "active":
|
|
381
253
|
case "hover":
|
|
382
|
-
t.forEach((
|
|
383
|
-
if (!
|
|
384
|
-
switch (
|
|
254
|
+
t.forEach((i) => {
|
|
255
|
+
if (!i.mutableState.disableCursor)
|
|
256
|
+
switch (i.orientation) {
|
|
385
257
|
case "horizontal": {
|
|
386
258
|
o++;
|
|
387
259
|
break;
|
|
388
260
|
}
|
|
389
261
|
case "vertical": {
|
|
390
|
-
|
|
262
|
+
r++;
|
|
391
263
|
break;
|
|
392
264
|
}
|
|
393
265
|
}
|
|
394
266
|
});
|
|
395
267
|
}
|
|
396
|
-
if (!(o === 0 &&
|
|
268
|
+
if (!(o === 0 && r === 0)) {
|
|
397
269
|
switch (n) {
|
|
398
270
|
case "active": {
|
|
399
|
-
if (e &&
|
|
400
|
-
const
|
|
401
|
-
if (
|
|
402
|
-
return
|
|
403
|
-
if (
|
|
404
|
-
return
|
|
405
|
-
if (
|
|
271
|
+
if (e && Ne()) {
|
|
272
|
+
const i = (e & ot) !== 0, c = (e & rt) !== 0, l = (e & it) !== 0, a = (e & st) !== 0;
|
|
273
|
+
if (i)
|
|
274
|
+
return l ? "se-resize" : a ? "ne-resize" : "e-resize";
|
|
275
|
+
if (c)
|
|
276
|
+
return l ? "sw-resize" : a ? "nw-resize" : "w-resize";
|
|
277
|
+
if (l)
|
|
406
278
|
return "s-resize";
|
|
407
|
-
if (
|
|
279
|
+
if (a)
|
|
408
280
|
return "n-resize";
|
|
409
281
|
}
|
|
410
282
|
break;
|
|
411
283
|
}
|
|
412
284
|
}
|
|
413
|
-
return
|
|
285
|
+
return Ne() ? o > 0 && r > 0 ? "move" : o > 0 ? "ew-resize" : "ns-resize" : o > 0 && r > 0 ? "grab" : o > 0 ? "col-resize" : "row-resize";
|
|
414
286
|
}
|
|
415
287
|
}
|
|
416
|
-
const
|
|
417
|
-
function
|
|
288
|
+
const _e = /* @__PURE__ */ new WeakMap();
|
|
289
|
+
function fe(e) {
|
|
418
290
|
if (!e.defaultView || !e.adoptedStyleSheets)
|
|
419
291
|
return;
|
|
420
|
-
let { prevStyle: t, styleSheet: n } =
|
|
292
|
+
let { prevStyle: t, styleSheet: n } = _e.get(e) ?? {};
|
|
421
293
|
n === void 0 && (n = new e.defaultView.CSSStyleSheet(), e.adoptedStyleSheets && (Object.isExtensible(e.adoptedStyleSheets) ? e.adoptedStyleSheets.push(n) : e.adoptedStyleSheets = [
|
|
422
294
|
...e.adoptedStyleSheets,
|
|
423
295
|
n
|
|
424
296
|
]));
|
|
425
|
-
const o =
|
|
297
|
+
const o = X();
|
|
426
298
|
switch (o.state) {
|
|
427
299
|
case "active":
|
|
428
300
|
case "hover": {
|
|
429
|
-
const
|
|
301
|
+
const r = Gt({
|
|
430
302
|
cursorFlags: o.cursorFlags,
|
|
431
|
-
groups: o.hitRegions.map((
|
|
303
|
+
groups: o.hitRegions.map((c) => c.group),
|
|
432
304
|
state: o.state
|
|
433
|
-
}),
|
|
434
|
-
if (t ===
|
|
305
|
+
}), i = `*, *:hover {cursor: ${r} !important; }`;
|
|
306
|
+
if (t === i)
|
|
435
307
|
return;
|
|
436
|
-
t =
|
|
308
|
+
t = i, r ? n.cssRules.length === 0 ? n.insertRule(i) : n.replaceSync(i) : n.cssRules.length === 1 && n.deleteRule(0);
|
|
437
309
|
break;
|
|
438
310
|
}
|
|
439
311
|
case "inactive": {
|
|
@@ -441,600 +313,859 @@ function Pe(e) {
|
|
|
441
313
|
break;
|
|
442
314
|
}
|
|
443
315
|
}
|
|
444
|
-
|
|
316
|
+
_e.set(e, {
|
|
445
317
|
prevStyle: t,
|
|
446
318
|
styleSheet: n
|
|
447
319
|
});
|
|
448
320
|
}
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
321
|
+
function R(e, t = "Assertion error") {
|
|
322
|
+
if (!e)
|
|
323
|
+
throw Error(t);
|
|
324
|
+
}
|
|
325
|
+
function Ce(e, t) {
|
|
326
|
+
return Array.from(t).sort(
|
|
327
|
+
e === "horizontal" ? Ft : Nt
|
|
328
|
+
);
|
|
329
|
+
}
|
|
330
|
+
function Ft(e, t) {
|
|
331
|
+
const n = e.element.offsetLeft - t.element.offsetLeft;
|
|
332
|
+
return n !== 0 ? n : e.element.offsetWidth - t.element.offsetWidth;
|
|
333
|
+
}
|
|
334
|
+
function Nt(e, t) {
|
|
335
|
+
const n = e.element.offsetTop - t.element.offsetTop;
|
|
336
|
+
return n !== 0 ? n : e.element.offsetHeight - t.element.offsetHeight;
|
|
337
|
+
}
|
|
338
|
+
function at(e) {
|
|
339
|
+
return e !== null && typeof e == "object" && "nodeType" in e && e.nodeType === Node.ELEMENT_NODE;
|
|
340
|
+
}
|
|
341
|
+
function lt(e, t) {
|
|
342
|
+
return {
|
|
343
|
+
x: e.x >= t.left && e.x <= t.right ? 0 : Math.min(
|
|
344
|
+
Math.abs(e.x - t.left),
|
|
345
|
+
Math.abs(e.x - t.right)
|
|
346
|
+
),
|
|
347
|
+
y: e.y >= t.top && e.y <= t.bottom ? 0 : Math.min(
|
|
348
|
+
Math.abs(e.y - t.top),
|
|
349
|
+
Math.abs(e.y - t.bottom)
|
|
350
|
+
)
|
|
351
|
+
};
|
|
352
|
+
}
|
|
353
|
+
function _t({
|
|
354
|
+
orientation: e,
|
|
355
|
+
rects: t,
|
|
356
|
+
targetRect: n
|
|
357
|
+
}) {
|
|
358
|
+
const o = {
|
|
359
|
+
x: n.x + n.width / 2,
|
|
360
|
+
y: n.y + n.height / 2
|
|
361
|
+
};
|
|
362
|
+
let r, i = Number.MAX_VALUE;
|
|
363
|
+
for (const c of t) {
|
|
364
|
+
const { x: l, y: a } = lt(o, c), s = e === "horizontal" ? l : a;
|
|
365
|
+
s < i && (i = s, r = c);
|
|
366
|
+
}
|
|
367
|
+
return R(r, "No rect found"), r;
|
|
368
|
+
}
|
|
369
|
+
let ge;
|
|
370
|
+
function $t() {
|
|
371
|
+
return ge === void 0 && (typeof matchMedia == "function" ? ge = !!matchMedia("(pointer:coarse)").matches : ge = !1), ge;
|
|
372
|
+
}
|
|
373
|
+
function Me({
|
|
374
|
+
expandHitTargets: e = !0,
|
|
375
|
+
group: t,
|
|
376
|
+
includeDisabled: n = !1
|
|
377
|
+
}) {
|
|
378
|
+
const { element: o, orientation: r, panels: i, separators: c } = t, l = Ce(
|
|
379
|
+
r,
|
|
380
|
+
Array.from(o.children).filter(at).filter((h) => !h.hasAttribute("data-resize-preview")).map((h) => ({ element: h }))
|
|
381
|
+
).map(({ element: h }) => h), a = [];
|
|
382
|
+
let s = !1, u = !1, f = -1, d = -1, v = 0, z, p = [];
|
|
383
|
+
{
|
|
384
|
+
let h = -1;
|
|
385
|
+
for (const g of l)
|
|
386
|
+
g.hasAttribute("data-panel") && (h++, g.hasAttribute("data-disabled") || (v++, f === -1 && (f = h), d = h));
|
|
387
|
+
}
|
|
388
|
+
if (n || v > 1) {
|
|
389
|
+
let h = -1;
|
|
390
|
+
for (const g of l)
|
|
391
|
+
if (g.hasAttribute("data-panel")) {
|
|
392
|
+
h++;
|
|
393
|
+
const y = i.find(
|
|
394
|
+
(m) => m.element === g
|
|
395
|
+
);
|
|
396
|
+
if (y) {
|
|
397
|
+
if (z) {
|
|
398
|
+
const m = z.element.getBoundingClientRect(), b = g.getBoundingClientRect();
|
|
399
|
+
let x;
|
|
400
|
+
if (u) {
|
|
401
|
+
const L = r === "horizontal" ? new DOMRect(
|
|
402
|
+
m.right,
|
|
403
|
+
m.top,
|
|
404
|
+
0,
|
|
405
|
+
m.height
|
|
406
|
+
) : new DOMRect(
|
|
407
|
+
m.left,
|
|
408
|
+
m.bottom,
|
|
409
|
+
m.width,
|
|
410
|
+
0
|
|
411
|
+
), w = r === "horizontal" ? new DOMRect(b.left, b.top, 0, b.height) : new DOMRect(b.left, b.top, b.width, 0);
|
|
412
|
+
switch (p.length) {
|
|
413
|
+
case 0: {
|
|
414
|
+
x = [
|
|
415
|
+
L,
|
|
416
|
+
w
|
|
417
|
+
];
|
|
418
|
+
break;
|
|
419
|
+
}
|
|
420
|
+
case 1: {
|
|
421
|
+
const C = p[0], M = _t({
|
|
422
|
+
orientation: r,
|
|
423
|
+
rects: [m, b],
|
|
424
|
+
targetRect: C.element.getBoundingClientRect()
|
|
425
|
+
});
|
|
426
|
+
x = [
|
|
427
|
+
C,
|
|
428
|
+
M === m ? w : L
|
|
429
|
+
];
|
|
430
|
+
break;
|
|
431
|
+
}
|
|
432
|
+
default: {
|
|
433
|
+
x = p;
|
|
434
|
+
break;
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
} else
|
|
438
|
+
p.length ? x = p : x = [
|
|
439
|
+
r === "horizontal" ? new DOMRect(
|
|
440
|
+
m.right,
|
|
441
|
+
b.top,
|
|
442
|
+
b.left - m.right,
|
|
443
|
+
b.height
|
|
444
|
+
) : new DOMRect(
|
|
445
|
+
b.left,
|
|
446
|
+
m.bottom,
|
|
447
|
+
b.width,
|
|
448
|
+
b.top - m.bottom
|
|
449
|
+
)
|
|
450
|
+
];
|
|
451
|
+
for (const L of x) {
|
|
452
|
+
let w = "width" in L ? L : L.element.getBoundingClientRect();
|
|
453
|
+
const C = e ? $t() ? t.resizeTargetMinimumSize.coarse : t.resizeTargetMinimumSize.fine : 0;
|
|
454
|
+
if (w.width < C) {
|
|
455
|
+
const T = C - w.width;
|
|
456
|
+
w = new DOMRect(
|
|
457
|
+
w.x - T / 2,
|
|
458
|
+
w.y,
|
|
459
|
+
w.width + T,
|
|
460
|
+
w.height
|
|
461
|
+
);
|
|
462
|
+
}
|
|
463
|
+
if (w.height < C) {
|
|
464
|
+
const T = C - w.height;
|
|
465
|
+
w = new DOMRect(
|
|
466
|
+
w.x,
|
|
467
|
+
w.y - T / 2,
|
|
468
|
+
w.width,
|
|
469
|
+
w.height + T
|
|
470
|
+
);
|
|
471
|
+
}
|
|
472
|
+
const M = h <= f || h > d;
|
|
473
|
+
(n || !s && !M) && a.push({
|
|
474
|
+
group: t,
|
|
475
|
+
groupSize: ae({ group: t }),
|
|
476
|
+
panels: [z, y],
|
|
477
|
+
separator: "width" in L ? void 0 : L,
|
|
478
|
+
rect: w
|
|
479
|
+
}), s = !1;
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
u = !1, z = y, p = [];
|
|
483
|
+
}
|
|
484
|
+
} else if (g.hasAttribute("data-separator")) {
|
|
485
|
+
g.ariaDisabled !== null && (s = !0);
|
|
486
|
+
const y = c.find(
|
|
487
|
+
(m) => m.element === g
|
|
488
|
+
);
|
|
489
|
+
y ? p.push(y) : (z = void 0, p = []);
|
|
490
|
+
} else
|
|
491
|
+
u = !0;
|
|
492
|
+
}
|
|
493
|
+
return a;
|
|
494
|
+
}
|
|
495
|
+
let V = /* @__PURE__ */ new Map();
|
|
496
|
+
const ct = new tt();
|
|
497
|
+
function jt(e) {
|
|
498
|
+
V = new Map(V), V.delete(e);
|
|
453
499
|
}
|
|
454
|
-
function
|
|
455
|
-
for (const [n] of
|
|
500
|
+
function ut(e, t) {
|
|
501
|
+
for (const [n] of V)
|
|
456
502
|
if (n.id === e)
|
|
457
503
|
return n;
|
|
458
504
|
}
|
|
459
|
-
function
|
|
460
|
-
for (const [n, o] of
|
|
505
|
+
function Q(e, t) {
|
|
506
|
+
for (const [n, o] of V)
|
|
461
507
|
if (n.id === e)
|
|
462
508
|
return o;
|
|
463
509
|
if (t)
|
|
464
510
|
throw Error(`Could not find data for Group with id ${e}`);
|
|
465
511
|
}
|
|
466
|
-
function
|
|
467
|
-
return
|
|
512
|
+
function ee() {
|
|
513
|
+
return V;
|
|
468
514
|
}
|
|
469
|
-
function
|
|
470
|
-
return
|
|
515
|
+
function Ee(e, t) {
|
|
516
|
+
return ct.addListener("groupChange", (n) => {
|
|
471
517
|
n.group.id === e && t(n);
|
|
472
518
|
});
|
|
473
519
|
}
|
|
474
|
-
function
|
|
475
|
-
const o =
|
|
476
|
-
|
|
520
|
+
function K(e, t, n) {
|
|
521
|
+
const o = V.get(e);
|
|
522
|
+
V = new Map(V), V.set(e, t), ct.emit("groupChange", {
|
|
477
523
|
group: e,
|
|
478
524
|
isUserInteraction: n?.isUserInteraction === !0,
|
|
479
525
|
prev: o,
|
|
480
526
|
next: t
|
|
481
527
|
});
|
|
482
528
|
}
|
|
483
|
-
function
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
529
|
+
function Ht(e, t) {
|
|
530
|
+
if (e.length !== t.length)
|
|
531
|
+
return !1;
|
|
532
|
+
for (let n = 0; n < e.length; n++)
|
|
533
|
+
if (e[n] != t[n])
|
|
534
|
+
return !1;
|
|
535
|
+
return !0;
|
|
536
|
+
}
|
|
537
|
+
function O(e, t, n = 0) {
|
|
538
|
+
return Math.abs(A(e) - A(t)) <= n;
|
|
539
|
+
}
|
|
540
|
+
function H(e, t) {
|
|
541
|
+
return O(e, t) ? 0 : e > t ? 1 : -1;
|
|
542
|
+
}
|
|
543
|
+
function se({
|
|
544
|
+
overrideDisabledPanels: e,
|
|
545
|
+
panelConstraints: t,
|
|
546
|
+
prevSize: n,
|
|
547
|
+
size: o
|
|
548
|
+
}) {
|
|
549
|
+
const {
|
|
550
|
+
collapsedSize: r = 0,
|
|
551
|
+
collapsedThreshold: i,
|
|
552
|
+
collapsible: c,
|
|
553
|
+
disabled: l,
|
|
554
|
+
maxSize: a = 100,
|
|
555
|
+
minSize: s = 0
|
|
556
|
+
} = t;
|
|
557
|
+
if (l && !e)
|
|
558
|
+
return n;
|
|
559
|
+
if (H(o, s) < 0)
|
|
560
|
+
if (c) {
|
|
561
|
+
const u = i ?? (s - r) / 2, f = H(n, r) <= 0, d = f ? r + u : s - u, v = H(o, d);
|
|
562
|
+
H(o, r) <= 0 || v < 0 || i !== void 0 && f && v === 0 ? o = r : o = s;
|
|
563
|
+
} else
|
|
564
|
+
o = s;
|
|
565
|
+
return o = Math.min(a, o), o = A(o), o;
|
|
566
|
+
}
|
|
567
|
+
function de({
|
|
568
|
+
delta: e,
|
|
569
|
+
initialLayout: t,
|
|
570
|
+
panelConstraints: n,
|
|
571
|
+
pivotIndices: o,
|
|
572
|
+
prevLayout: r,
|
|
573
|
+
trigger: i
|
|
574
|
+
}) {
|
|
575
|
+
if (O(e, 0))
|
|
576
|
+
return t;
|
|
577
|
+
const c = i === "imperative-api", l = Object.values(t), a = Object.values(r), s = [...l], [u, f] = o;
|
|
578
|
+
R(u != null, "Invalid first pivot index"), R(f != null, "Invalid second pivot index");
|
|
579
|
+
let d = 0;
|
|
580
|
+
switch (i) {
|
|
581
|
+
case "keyboard": {
|
|
582
|
+
{
|
|
583
|
+
const p = e < 0 ? f : u, h = n[p];
|
|
584
|
+
R(
|
|
585
|
+
h,
|
|
586
|
+
`Panel constraints not found for index ${p}`
|
|
587
|
+
);
|
|
588
|
+
const {
|
|
589
|
+
collapsedSize: g = 0,
|
|
590
|
+
collapsible: y,
|
|
591
|
+
minSize: m = 0
|
|
592
|
+
} = h;
|
|
593
|
+
if (y) {
|
|
594
|
+
const b = l[p];
|
|
595
|
+
if (R(
|
|
596
|
+
b != null,
|
|
597
|
+
`Previous layout not found for panel index ${p}`
|
|
598
|
+
), O(b, g)) {
|
|
599
|
+
const x = m - b;
|
|
600
|
+
H(x, Math.abs(e)) > 0 && (e = e < 0 ? 0 - x : x);
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
{
|
|
605
|
+
const p = e < 0 ? u : f, h = n[p];
|
|
606
|
+
R(
|
|
607
|
+
h,
|
|
608
|
+
`No panel constraints found for index ${p}`
|
|
609
|
+
);
|
|
610
|
+
const {
|
|
611
|
+
collapsedSize: g = 0,
|
|
612
|
+
collapsible: y,
|
|
613
|
+
minSize: m = 0
|
|
614
|
+
} = h;
|
|
615
|
+
if (y) {
|
|
616
|
+
const b = l[p];
|
|
617
|
+
if (R(
|
|
618
|
+
b != null,
|
|
619
|
+
`Previous layout not found for panel index ${p}`
|
|
620
|
+
), O(b, m)) {
|
|
621
|
+
const x = b - g;
|
|
622
|
+
H(x, Math.abs(e)) > 0 && (e = e < 0 ? 0 - x : x);
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
break;
|
|
627
|
+
}
|
|
628
|
+
default: {
|
|
629
|
+
const p = e < 0 ? f : u, h = n[p];
|
|
630
|
+
R(
|
|
631
|
+
h,
|
|
632
|
+
`Panel constraints not found for index ${p}`
|
|
633
|
+
);
|
|
634
|
+
const g = l[p], { collapsedSize: y, collapsedThreshold: m, collapsible: b, minSize: x } = h;
|
|
635
|
+
if (b && H(g, x) < 0) {
|
|
636
|
+
const L = x - y, w = m ?? L / 2, C = g + Math.abs(e);
|
|
637
|
+
if (H(C, x) < 0) {
|
|
638
|
+
const M = H(Math.abs(e), w), T = m === void 0 && e < 0;
|
|
639
|
+
M > 0 || M === 0 && T ? e = e < 0 ? -L : L : e = 0;
|
|
640
|
+
}
|
|
641
|
+
}
|
|
642
|
+
break;
|
|
643
|
+
}
|
|
644
|
+
}
|
|
645
|
+
{
|
|
646
|
+
const p = e < 0 ? 1 : -1;
|
|
647
|
+
let h = e < 0 ? f : u, g = 0;
|
|
648
|
+
for (; ; ) {
|
|
649
|
+
const m = l[h];
|
|
650
|
+
R(
|
|
651
|
+
m != null,
|
|
652
|
+
`Previous layout not found for panel index ${h}`
|
|
653
|
+
);
|
|
654
|
+
const x = se({
|
|
655
|
+
overrideDisabledPanels: c,
|
|
656
|
+
panelConstraints: n[h],
|
|
657
|
+
prevSize: m,
|
|
658
|
+
size: 100
|
|
659
|
+
}) - m;
|
|
660
|
+
if (g += x, h += p, h < 0 || h >= n.length)
|
|
661
|
+
break;
|
|
662
|
+
}
|
|
663
|
+
const y = Math.min(Math.abs(e), Math.abs(g));
|
|
664
|
+
e = e < 0 ? 0 - y : y;
|
|
665
|
+
}
|
|
666
|
+
{
|
|
667
|
+
let h = e < 0 ? u : f;
|
|
668
|
+
for (; h >= 0 && h < n.length; ) {
|
|
669
|
+
const g = Math.abs(e) - Math.abs(d), y = l[h];
|
|
670
|
+
R(
|
|
671
|
+
y != null,
|
|
672
|
+
`Previous layout not found for panel index ${h}`
|
|
673
|
+
);
|
|
674
|
+
const m = y - g, b = se({
|
|
675
|
+
overrideDisabledPanels: c,
|
|
676
|
+
panelConstraints: n[h],
|
|
677
|
+
prevSize: y,
|
|
678
|
+
size: m
|
|
679
|
+
});
|
|
680
|
+
if (!O(y, b) && (d += y - b, s[h] = b, d.toFixed(3).localeCompare(Math.abs(e).toFixed(3), void 0, {
|
|
681
|
+
numeric: !0
|
|
682
|
+
}) >= 0))
|
|
683
|
+
break;
|
|
684
|
+
e < 0 ? h-- : h++;
|
|
685
|
+
}
|
|
686
|
+
}
|
|
687
|
+
if (Ht(a, s))
|
|
688
|
+
return r;
|
|
689
|
+
{
|
|
690
|
+
const p = e < 0 ? f : u, h = l[p];
|
|
691
|
+
R(
|
|
692
|
+
h != null,
|
|
693
|
+
`Previous layout not found for panel index ${p}`
|
|
694
|
+
);
|
|
695
|
+
const g = h + d, y = se({
|
|
696
|
+
overrideDisabledPanels: c,
|
|
697
|
+
panelConstraints: n[p],
|
|
698
|
+
prevSize: h,
|
|
699
|
+
size: g
|
|
700
|
+
});
|
|
701
|
+
if (s[p] = y, !O(y, g)) {
|
|
702
|
+
let m = g - y, x = e < 0 ? f : u;
|
|
703
|
+
for (; x >= 0 && x < n.length; ) {
|
|
704
|
+
const L = s[x];
|
|
705
|
+
R(
|
|
706
|
+
L != null,
|
|
707
|
+
`Previous layout not found for panel index ${x}`
|
|
708
|
+
);
|
|
709
|
+
const w = L + m, C = se({
|
|
710
|
+
overrideDisabledPanels: c,
|
|
711
|
+
panelConstraints: n[x],
|
|
712
|
+
prevSize: L,
|
|
713
|
+
size: w
|
|
714
|
+
});
|
|
715
|
+
if (O(L, C) || (m -= C - L, s[x] = C), O(m, 0))
|
|
716
|
+
break;
|
|
717
|
+
e > 0 ? x-- : x++;
|
|
718
|
+
}
|
|
719
|
+
}
|
|
720
|
+
}
|
|
721
|
+
const v = Object.values(s).reduce(
|
|
722
|
+
(p, h) => h + p,
|
|
723
|
+
0
|
|
724
|
+
);
|
|
725
|
+
if (!O(v, 100, 0.1))
|
|
726
|
+
return r;
|
|
727
|
+
const z = Object.keys(r);
|
|
728
|
+
return s.reduce((p, h, g) => (p[z[g]] = h, p), {});
|
|
729
|
+
}
|
|
730
|
+
function W(e, t) {
|
|
731
|
+
if (Object.keys(e).length !== Object.keys(t).length)
|
|
732
|
+
return !1;
|
|
733
|
+
for (const n in e)
|
|
734
|
+
if (t[n] === void 0 || H(e[n], t[n]) !== 0)
|
|
735
|
+
return !1;
|
|
736
|
+
return !0;
|
|
737
|
+
}
|
|
738
|
+
function Ie({
|
|
739
|
+
commit: e,
|
|
740
|
+
document: t,
|
|
741
|
+
event: n,
|
|
742
|
+
hitRegions: o,
|
|
743
|
+
initialLayoutMap: r,
|
|
744
|
+
mountedGroups: i,
|
|
745
|
+
pointerDownAtPoint: c,
|
|
746
|
+
prevCursorFlags: l
|
|
747
|
+
}) {
|
|
748
|
+
let a = 0;
|
|
749
|
+
const s = X();
|
|
750
|
+
let u = s.state === "active" ? s.previews : [];
|
|
751
|
+
const f = new Map(
|
|
752
|
+
s.state === "active" ? s.previewLayoutMap : void 0
|
|
753
|
+
);
|
|
754
|
+
o.forEach((v) => {
|
|
755
|
+
const { group: z, groupSize: p } = v, { orientation: h, panels: g } = z;
|
|
756
|
+
if (e && z.resizePreviewMode !== "separator")
|
|
757
|
+
return;
|
|
758
|
+
const { disableCursor: y } = z.mutableState;
|
|
759
|
+
let m = 0;
|
|
760
|
+
c ? h === "horizontal" ? m = (n.clientX - c.x) / p * 100 : m = (n.clientY - c.y) / p * 100 : h === "horizontal" ? m = n.clientX < 0 ? -100 : 100 : m = n.clientY < 0 ? -100 : 100;
|
|
761
|
+
const b = r.get(z), x = i.get(z);
|
|
762
|
+
if (!b || !x)
|
|
763
|
+
return;
|
|
764
|
+
const {
|
|
765
|
+
defaultLayoutDeferred: L,
|
|
766
|
+
derivedPanelConstraints: w,
|
|
767
|
+
groupSize: C,
|
|
768
|
+
layout: M,
|
|
769
|
+
separatorToPanels: T
|
|
770
|
+
} = x;
|
|
771
|
+
if (w && M && T) {
|
|
772
|
+
const G = z.resizePreviewMode === "separator" ? f.get(z) ?? M : M, E = de({
|
|
773
|
+
delta: m,
|
|
774
|
+
initialLayout: b,
|
|
775
|
+
panelConstraints: w,
|
|
776
|
+
pivotIndices: v.panels.map((N) => g.indexOf(N)),
|
|
777
|
+
prevLayout: G,
|
|
778
|
+
trigger: "mouse-or-touch"
|
|
779
|
+
});
|
|
780
|
+
if (z.resizePreviewMode === "separator" && !e && !W(E, G)) {
|
|
781
|
+
f.set(z, E);
|
|
782
|
+
let N = 0;
|
|
783
|
+
const _ = g.map((S) => (N += E[S.id] - b[S.id], N * (p / 100)));
|
|
784
|
+
u = u.map((S) => {
|
|
785
|
+
if (S.group !== z)
|
|
786
|
+
return S;
|
|
787
|
+
const P = _[S.panelIndex];
|
|
788
|
+
return P === S.offset ? S : { ...S, offset: P };
|
|
789
|
+
});
|
|
790
|
+
}
|
|
791
|
+
if (W(E, G) && m !== 0 && !y)
|
|
792
|
+
switch (h) {
|
|
793
|
+
case "horizontal": {
|
|
794
|
+
a |= m < 0 ? ot : rt;
|
|
795
|
+
break;
|
|
796
|
+
}
|
|
797
|
+
case "vertical": {
|
|
798
|
+
a |= m < 0 ? it : st;
|
|
799
|
+
break;
|
|
800
|
+
}
|
|
801
|
+
}
|
|
802
|
+
(z.resizePreviewMode !== "separator" || e) && !W(E, M) && K(v.group, {
|
|
803
|
+
defaultLayoutDeferred: L,
|
|
804
|
+
derivedPanelConstraints: w,
|
|
805
|
+
groupSize: C,
|
|
806
|
+
layout: E,
|
|
807
|
+
separatorToPanels: T
|
|
808
|
+
});
|
|
809
|
+
}
|
|
810
|
+
});
|
|
811
|
+
let d = 0;
|
|
812
|
+
n.movementX === 0 ? d |= l & Ge : d |= a & Ge, n.movementY === 0 ? d |= l & Fe : d |= a & Fe, Tt(d, u, f), fe(t);
|
|
813
|
+
}
|
|
814
|
+
function ft(e, t) {
|
|
815
|
+
const n = X(), o = ee();
|
|
816
|
+
let r = !1;
|
|
817
|
+
switch (n.state) {
|
|
487
818
|
case "active":
|
|
488
|
-
|
|
819
|
+
Ie({
|
|
820
|
+
commit: !0,
|
|
821
|
+
document: e,
|
|
822
|
+
event: t,
|
|
823
|
+
hitRegions: n.hitRegions,
|
|
824
|
+
initialLayoutMap: n.initialLayoutMap,
|
|
825
|
+
mountedGroups: o,
|
|
826
|
+
pointerDownAtPoint: n.pointerDownAtPoint,
|
|
827
|
+
prevCursorFlags: n.cursorFlags
|
|
828
|
+
}), U({
|
|
489
829
|
cursorFlags: 0,
|
|
490
830
|
state: "inactive"
|
|
491
|
-
}),
|
|
492
|
-
if (!
|
|
831
|
+
}), n.hitRegions.length > 0 && (fe(e), r = !0, n.hitRegions.forEach((i) => {
|
|
832
|
+
if (!o.has(i.group))
|
|
493
833
|
return;
|
|
494
|
-
const
|
|
495
|
-
|
|
834
|
+
const c = Q(i.group.id, !0);
|
|
835
|
+
K(i.group, c, {
|
|
496
836
|
isUserInteraction: !0
|
|
497
837
|
});
|
|
498
838
|
}));
|
|
499
839
|
}
|
|
500
|
-
return
|
|
840
|
+
return r;
|
|
501
841
|
}
|
|
502
|
-
function
|
|
503
|
-
e.defaultPrevented ||
|
|
842
|
+
function $e(e) {
|
|
843
|
+
e.defaultPrevented || ft(e.currentTarget, e);
|
|
504
844
|
}
|
|
505
|
-
function
|
|
506
|
-
let o,
|
|
845
|
+
function Vt(e, t, n) {
|
|
846
|
+
let o, r = {
|
|
507
847
|
x: 1 / 0,
|
|
508
848
|
y: 1 / 0
|
|
509
849
|
};
|
|
510
|
-
for (const
|
|
511
|
-
const
|
|
850
|
+
for (const i of t) {
|
|
851
|
+
const c = lt(n, i.rect);
|
|
512
852
|
switch (e) {
|
|
513
853
|
case "horizontal": {
|
|
514
|
-
|
|
854
|
+
c.x <= r.x && (o = i, r = c);
|
|
515
855
|
break;
|
|
516
856
|
}
|
|
517
857
|
case "vertical": {
|
|
518
|
-
|
|
858
|
+
c.y <= r.y && (o = i, r = c);
|
|
519
859
|
break;
|
|
520
860
|
}
|
|
521
861
|
}
|
|
522
862
|
}
|
|
523
863
|
return o ? {
|
|
524
|
-
distance:
|
|
864
|
+
distance: r,
|
|
525
865
|
hitRegion: o
|
|
526
866
|
} : void 0;
|
|
527
867
|
}
|
|
528
|
-
function
|
|
868
|
+
function Bt(e) {
|
|
529
869
|
return e !== null && typeof e == "object" && "nodeType" in e && e.nodeType === Node.DOCUMENT_FRAGMENT_NODE;
|
|
530
870
|
}
|
|
531
|
-
function
|
|
871
|
+
function Ut(e, t) {
|
|
532
872
|
if (e === t) throw new Error("Cannot compare node with itself");
|
|
533
873
|
const n = {
|
|
534
|
-
a:
|
|
535
|
-
b:
|
|
874
|
+
a: Ve(e),
|
|
875
|
+
b: Ve(t)
|
|
536
876
|
};
|
|
537
877
|
let o;
|
|
538
878
|
for (; n.a.at(-1) === n.b.at(-1); )
|
|
539
879
|
o = n.a.pop(), n.b.pop();
|
|
540
|
-
|
|
880
|
+
R(
|
|
541
881
|
o,
|
|
542
882
|
"Stacking order can only be calculated for elements with a common ancestor"
|
|
543
883
|
);
|
|
544
|
-
const
|
|
545
|
-
a:
|
|
546
|
-
b:
|
|
884
|
+
const r = {
|
|
885
|
+
a: He(je(n.a)),
|
|
886
|
+
b: He(je(n.b))
|
|
547
887
|
};
|
|
548
|
-
if (
|
|
549
|
-
const
|
|
888
|
+
if (r.a === r.b) {
|
|
889
|
+
const i = o.childNodes, c = {
|
|
550
890
|
a: n.a.at(-1),
|
|
551
891
|
b: n.b.at(-1)
|
|
552
892
|
};
|
|
553
|
-
let
|
|
554
|
-
for (;
|
|
555
|
-
const
|
|
556
|
-
if (
|
|
557
|
-
if (
|
|
893
|
+
let l = i.length;
|
|
894
|
+
for (; l--; ) {
|
|
895
|
+
const a = i[l];
|
|
896
|
+
if (a === c.a) return 1;
|
|
897
|
+
if (a === c.b) return -1;
|
|
558
898
|
}
|
|
559
899
|
}
|
|
560
|
-
return Math.sign(
|
|
900
|
+
return Math.sign(r.a - r.b);
|
|
561
901
|
}
|
|
562
|
-
const
|
|
563
|
-
function
|
|
564
|
-
const t = getComputedStyle(
|
|
902
|
+
const Wt = /\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;
|
|
903
|
+
function Kt(e) {
|
|
904
|
+
const t = getComputedStyle(dt(e) ?? e).display;
|
|
565
905
|
return t === "flex" || t === "inline-flex";
|
|
566
906
|
}
|
|
567
|
-
function
|
|
907
|
+
function qt(e) {
|
|
568
908
|
const t = getComputedStyle(e);
|
|
569
|
-
return !!(t.position === "fixed" || t.zIndex !== "auto" && (t.position !== "static" ||
|
|
909
|
+
return !!(t.position === "fixed" || t.zIndex !== "auto" && (t.position !== "static" || Kt(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" || Wt.test(t.willChange) || t.webkitOverflowScrolling === "touch");
|
|
570
910
|
}
|
|
571
|
-
function
|
|
911
|
+
function je(e) {
|
|
572
912
|
let t = e.length;
|
|
573
913
|
for (; t--; ) {
|
|
574
914
|
const n = e[t];
|
|
575
|
-
if (
|
|
915
|
+
if (R(n, "Missing node"), qt(n)) return n;
|
|
576
916
|
}
|
|
577
917
|
return null;
|
|
578
918
|
}
|
|
579
|
-
function
|
|
919
|
+
function He(e) {
|
|
580
920
|
return e && Number(getComputedStyle(e).zIndex) || 0;
|
|
581
921
|
}
|
|
582
|
-
function
|
|
922
|
+
function Ve(e) {
|
|
583
923
|
const t = [];
|
|
584
924
|
for (; e; )
|
|
585
|
-
t.push(e), e =
|
|
925
|
+
t.push(e), e = dt(e);
|
|
586
926
|
return t;
|
|
587
927
|
}
|
|
588
|
-
function
|
|
928
|
+
function dt(e) {
|
|
589
929
|
const { parentNode: t } = e;
|
|
590
|
-
return
|
|
930
|
+
return Bt(t) ? t.host : t;
|
|
591
931
|
}
|
|
592
|
-
function
|
|
932
|
+
function Xt(e, t) {
|
|
593
933
|
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;
|
|
594
934
|
}
|
|
595
|
-
function
|
|
935
|
+
function Yt({
|
|
596
936
|
groupElement: e,
|
|
597
937
|
hitRegion: t,
|
|
598
938
|
pointerEventTarget: n
|
|
599
939
|
}) {
|
|
600
|
-
if (!
|
|
940
|
+
if (!at(n) || n.contains(e) || e.contains(n))
|
|
601
941
|
return !0;
|
|
602
|
-
if (
|
|
942
|
+
if (Ut(n, e) > 0) {
|
|
603
943
|
let o = n;
|
|
604
944
|
for (; o; ) {
|
|
605
945
|
if (o.contains(e))
|
|
606
946
|
return !0;
|
|
607
|
-
if (
|
|
947
|
+
if (Xt(o.getBoundingClientRect(), t))
|
|
608
948
|
return !1;
|
|
609
949
|
o = o.parentElement;
|
|
610
950
|
}
|
|
611
951
|
}
|
|
612
952
|
return !0;
|
|
613
953
|
}
|
|
614
|
-
function
|
|
954
|
+
function ke(e, t) {
|
|
615
955
|
const n = [];
|
|
616
|
-
return t.forEach((o,
|
|
617
|
-
if (
|
|
956
|
+
return t.forEach((o, r) => {
|
|
957
|
+
if (r.disabled)
|
|
618
958
|
return;
|
|
619
|
-
const
|
|
959
|
+
const i = Me({ group: r }), c = Vt(r.orientation, i, {
|
|
620
960
|
x: e.clientX,
|
|
621
961
|
y: e.clientY
|
|
622
962
|
});
|
|
623
|
-
|
|
624
|
-
groupElement:
|
|
625
|
-
hitRegion:
|
|
963
|
+
c && c.distance.x <= 0 && c.distance.y <= 0 && Yt({
|
|
964
|
+
groupElement: r.element,
|
|
965
|
+
hitRegion: c.hitRegion.rect,
|
|
626
966
|
pointerEventTarget: e.target
|
|
627
|
-
}) && n.push(
|
|
967
|
+
}) && n.push(c.hitRegion);
|
|
628
968
|
}), n;
|
|
629
969
|
}
|
|
630
|
-
function
|
|
631
|
-
if (e.length !== t.length)
|
|
632
|
-
return !1;
|
|
633
|
-
for (let n = 0; n < e.length; n++)
|
|
634
|
-
if (e[n] != t[n])
|
|
635
|
-
return !1;
|
|
636
|
-
return !0;
|
|
637
|
-
}
|
|
638
|
-
function D(e, t, n = 0) {
|
|
639
|
-
return Math.abs(T(e) - T(t)) <= n;
|
|
640
|
-
}
|
|
641
|
-
function A(e, t) {
|
|
642
|
-
return D(e, t) ? 0 : e > t ? 1 : -1;
|
|
643
|
-
}
|
|
644
|
-
function Z({
|
|
645
|
-
overrideDisabledPanels: e,
|
|
646
|
-
panelConstraints: t,
|
|
647
|
-
prevSize: n,
|
|
648
|
-
size: o
|
|
649
|
-
}) {
|
|
650
|
-
const {
|
|
651
|
-
collapsedSize: i = 0,
|
|
652
|
-
collapsible: s,
|
|
653
|
-
disabled: u,
|
|
654
|
-
maxSize: a = 100,
|
|
655
|
-
minSize: r = 0
|
|
656
|
-
} = t;
|
|
657
|
-
if (u && !e)
|
|
658
|
-
return n;
|
|
659
|
-
if (A(o, r) < 0)
|
|
660
|
-
if (s) {
|
|
661
|
-
const l = (i + r) / 2;
|
|
662
|
-
A(o, l) < 0 ? o = i : o = r;
|
|
663
|
-
} else
|
|
664
|
-
o = r;
|
|
665
|
-
return o = Math.min(a, o), o = T(o), o;
|
|
666
|
-
}
|
|
667
|
-
function ae({
|
|
668
|
-
delta: e,
|
|
669
|
-
initialLayout: t,
|
|
670
|
-
panelConstraints: n,
|
|
671
|
-
pivotIndices: o,
|
|
672
|
-
prevLayout: i,
|
|
673
|
-
trigger: s
|
|
674
|
-
}) {
|
|
675
|
-
if (D(e, 0))
|
|
676
|
-
return t;
|
|
677
|
-
const u = s === "imperative-api", a = Object.values(t), r = Object.values(i), l = [...a], [c, m] = o;
|
|
678
|
-
C(c != null, "Invalid first pivot index"), C(m != null, "Invalid second pivot index");
|
|
679
|
-
let p = 0;
|
|
680
|
-
switch (s) {
|
|
681
|
-
case "keyboard": {
|
|
682
|
-
{
|
|
683
|
-
const f = e < 0 ? m : c, d = n[f];
|
|
684
|
-
C(
|
|
685
|
-
d,
|
|
686
|
-
`Panel constraints not found for index ${f}`
|
|
687
|
-
);
|
|
688
|
-
const {
|
|
689
|
-
collapsedSize: h = 0,
|
|
690
|
-
collapsible: y,
|
|
691
|
-
minSize: b = 0
|
|
692
|
-
} = d;
|
|
693
|
-
if (y) {
|
|
694
|
-
const v = a[f];
|
|
695
|
-
if (C(
|
|
696
|
-
v != null,
|
|
697
|
-
`Previous layout not found for panel index ${f}`
|
|
698
|
-
), D(v, h)) {
|
|
699
|
-
const g = b - v;
|
|
700
|
-
A(g, Math.abs(e)) > 0 && (e = e < 0 ? 0 - g : g);
|
|
701
|
-
}
|
|
702
|
-
}
|
|
703
|
-
}
|
|
704
|
-
{
|
|
705
|
-
const f = e < 0 ? c : m, d = n[f];
|
|
706
|
-
C(
|
|
707
|
-
d,
|
|
708
|
-
`No panel constraints found for index ${f}`
|
|
709
|
-
);
|
|
710
|
-
const {
|
|
711
|
-
collapsedSize: h = 0,
|
|
712
|
-
collapsible: y,
|
|
713
|
-
minSize: b = 0
|
|
714
|
-
} = d;
|
|
715
|
-
if (y) {
|
|
716
|
-
const v = a[f];
|
|
717
|
-
if (C(
|
|
718
|
-
v != null,
|
|
719
|
-
`Previous layout not found for panel index ${f}`
|
|
720
|
-
), D(v, b)) {
|
|
721
|
-
const g = v - h;
|
|
722
|
-
A(g, Math.abs(e)) > 0 && (e = e < 0 ? 0 - g : g);
|
|
723
|
-
}
|
|
724
|
-
}
|
|
725
|
-
}
|
|
726
|
-
break;
|
|
727
|
-
}
|
|
728
|
-
default: {
|
|
729
|
-
const f = e < 0 ? m : c, d = n[f];
|
|
730
|
-
C(
|
|
731
|
-
d,
|
|
732
|
-
`Panel constraints not found for index ${f}`
|
|
733
|
-
);
|
|
734
|
-
const h = a[f], { collapsible: y, collapsedSize: b, minSize: v } = d;
|
|
735
|
-
if (y && A(h, v) < 0)
|
|
736
|
-
if (e > 0) {
|
|
737
|
-
const g = v - b, w = g / 2, E = h + e;
|
|
738
|
-
A(E, v) < 0 && (e = A(e, w) <= 0 ? 0 : g);
|
|
739
|
-
} else {
|
|
740
|
-
const g = v - b, w = 100 - g / 2, E = h - e;
|
|
741
|
-
A(E, v) < 0 && (e = A(100 + e, w) > 0 ? 0 : -g);
|
|
742
|
-
}
|
|
743
|
-
break;
|
|
744
|
-
}
|
|
745
|
-
}
|
|
746
|
-
{
|
|
747
|
-
const f = e < 0 ? 1 : -1;
|
|
748
|
-
let d = e < 0 ? m : c, h = 0;
|
|
749
|
-
for (; ; ) {
|
|
750
|
-
const b = a[d];
|
|
751
|
-
C(
|
|
752
|
-
b != null,
|
|
753
|
-
`Previous layout not found for panel index ${d}`
|
|
754
|
-
);
|
|
755
|
-
const g = Z({
|
|
756
|
-
overrideDisabledPanels: u,
|
|
757
|
-
panelConstraints: n[d],
|
|
758
|
-
prevSize: b,
|
|
759
|
-
size: 100
|
|
760
|
-
}) - b;
|
|
761
|
-
if (h += g, d += f, d < 0 || d >= n.length)
|
|
762
|
-
break;
|
|
763
|
-
}
|
|
764
|
-
const y = Math.min(Math.abs(e), Math.abs(h));
|
|
765
|
-
e = e < 0 ? 0 - y : y;
|
|
766
|
-
}
|
|
767
|
-
{
|
|
768
|
-
let d = e < 0 ? c : m;
|
|
769
|
-
for (; d >= 0 && d < n.length; ) {
|
|
770
|
-
const h = Math.abs(e) - Math.abs(p), y = a[d];
|
|
771
|
-
C(
|
|
772
|
-
y != null,
|
|
773
|
-
`Previous layout not found for panel index ${d}`
|
|
774
|
-
);
|
|
775
|
-
const b = y - h, v = Z({
|
|
776
|
-
overrideDisabledPanels: u,
|
|
777
|
-
panelConstraints: n[d],
|
|
778
|
-
prevSize: y,
|
|
779
|
-
size: b
|
|
780
|
-
});
|
|
781
|
-
if (!D(y, v) && (p += y - v, l[d] = v, p.toFixed(3).localeCompare(Math.abs(e).toFixed(3), void 0, {
|
|
782
|
-
numeric: !0
|
|
783
|
-
}) >= 0))
|
|
784
|
-
break;
|
|
785
|
-
e < 0 ? d-- : d++;
|
|
786
|
-
}
|
|
787
|
-
}
|
|
788
|
-
if ($t(r, l))
|
|
789
|
-
return i;
|
|
790
|
-
{
|
|
791
|
-
const f = e < 0 ? m : c, d = a[f];
|
|
792
|
-
C(
|
|
793
|
-
d != null,
|
|
794
|
-
`Previous layout not found for panel index ${f}`
|
|
795
|
-
);
|
|
796
|
-
const h = d + p, y = Z({
|
|
797
|
-
overrideDisabledPanels: u,
|
|
798
|
-
panelConstraints: n[f],
|
|
799
|
-
prevSize: d,
|
|
800
|
-
size: h
|
|
801
|
-
});
|
|
802
|
-
if (l[f] = y, !D(y, h)) {
|
|
803
|
-
let b = h - y, g = e < 0 ? m : c;
|
|
804
|
-
for (; g >= 0 && g < n.length; ) {
|
|
805
|
-
const w = l[g];
|
|
806
|
-
C(
|
|
807
|
-
w != null,
|
|
808
|
-
`Previous layout not found for panel index ${g}`
|
|
809
|
-
);
|
|
810
|
-
const E = w + b, L = Z({
|
|
811
|
-
overrideDisabledPanels: u,
|
|
812
|
-
panelConstraints: n[g],
|
|
813
|
-
prevSize: w,
|
|
814
|
-
size: E
|
|
815
|
-
});
|
|
816
|
-
if (D(w, L) || (b -= L - w, l[g] = L), D(b, 0))
|
|
817
|
-
break;
|
|
818
|
-
e > 0 ? g-- : g++;
|
|
819
|
-
}
|
|
820
|
-
}
|
|
821
|
-
}
|
|
822
|
-
const S = Object.values(l).reduce(
|
|
823
|
-
(f, d) => d + f,
|
|
824
|
-
0
|
|
825
|
-
);
|
|
826
|
-
if (!D(S, 100, 0.1))
|
|
827
|
-
return i;
|
|
828
|
-
const z = Object.keys(i);
|
|
829
|
-
return l.reduce((f, d, h) => (f[z[h]] = d, f), {});
|
|
830
|
-
}
|
|
831
|
-
function K(e, t) {
|
|
832
|
-
if (Object.keys(e).length !== Object.keys(t).length)
|
|
833
|
-
return !1;
|
|
834
|
-
for (const n in e)
|
|
835
|
-
if (t[n] === void 0 || A(e[n], t[n]) !== 0)
|
|
836
|
-
return !1;
|
|
837
|
-
return !0;
|
|
838
|
-
}
|
|
839
|
-
function X({
|
|
970
|
+
function ne({
|
|
840
971
|
layout: e,
|
|
841
972
|
panelConstraints: t
|
|
842
973
|
}) {
|
|
843
|
-
const n = Object.values(e), o = [...n],
|
|
844
|
-
(
|
|
974
|
+
const n = Object.values(e), o = [...n], r = o.reduce(
|
|
975
|
+
(l, a) => l + a,
|
|
845
976
|
0
|
|
846
977
|
);
|
|
847
978
|
if (o.length !== t.length)
|
|
848
979
|
throw Error(
|
|
849
|
-
`Invalid ${t.length} panel layout: ${o.map((
|
|
980
|
+
`Invalid ${t.length} panel layout: ${o.map((l) => `${l}%`).join(", ")}`
|
|
850
981
|
);
|
|
851
|
-
if (!
|
|
852
|
-
for (let
|
|
853
|
-
const
|
|
854
|
-
|
|
855
|
-
const
|
|
856
|
-
o[
|
|
982
|
+
if (!O(r, 100) && o.length > 0)
|
|
983
|
+
for (let l = 0; l < t.length; l++) {
|
|
984
|
+
const a = o[l];
|
|
985
|
+
R(a != null, `No layout data found for index ${l}`);
|
|
986
|
+
const s = 100 / r * a;
|
|
987
|
+
o[l] = s;
|
|
857
988
|
}
|
|
858
|
-
let
|
|
859
|
-
for (let
|
|
860
|
-
const
|
|
861
|
-
|
|
862
|
-
const
|
|
863
|
-
|
|
864
|
-
const
|
|
989
|
+
let i = 0;
|
|
990
|
+
for (let l = 0; l < t.length; l++) {
|
|
991
|
+
const a = n[l];
|
|
992
|
+
R(a != null, `No layout data found for index ${l}`);
|
|
993
|
+
const s = o[l];
|
|
994
|
+
R(s != null, `No layout data found for index ${l}`);
|
|
995
|
+
const u = se({
|
|
865
996
|
overrideDisabledPanels: !0,
|
|
866
|
-
panelConstraints: t[
|
|
867
|
-
prevSize:
|
|
868
|
-
size:
|
|
997
|
+
panelConstraints: t[l],
|
|
998
|
+
prevSize: a,
|
|
999
|
+
size: s
|
|
869
1000
|
});
|
|
870
|
-
|
|
1001
|
+
s != u && (i += s - u, o[l] = u);
|
|
871
1002
|
}
|
|
872
|
-
if (!
|
|
873
|
-
for (let
|
|
874
|
-
const
|
|
875
|
-
|
|
876
|
-
const
|
|
1003
|
+
if (!O(i, 0))
|
|
1004
|
+
for (let l = 0; l < t.length; l++) {
|
|
1005
|
+
const a = o[l];
|
|
1006
|
+
R(a != null, `No layout data found for index ${l}`);
|
|
1007
|
+
const s = a + i, u = se({
|
|
877
1008
|
overrideDisabledPanels: !0,
|
|
878
|
-
panelConstraints: t[
|
|
879
|
-
prevSize:
|
|
880
|
-
size:
|
|
1009
|
+
panelConstraints: t[l],
|
|
1010
|
+
prevSize: a,
|
|
1011
|
+
size: s
|
|
881
1012
|
});
|
|
882
|
-
if (
|
|
1013
|
+
if (a !== u && (i -= u - a, o[l] = u, O(i, 0)))
|
|
883
1014
|
break;
|
|
884
1015
|
}
|
|
885
|
-
const
|
|
886
|
-
return o.reduce((
|
|
1016
|
+
const c = Object.keys(e);
|
|
1017
|
+
return o.reduce((l, a, s) => (l[c[s]] = a, l), {});
|
|
887
1018
|
}
|
|
888
|
-
function
|
|
1019
|
+
function pt({
|
|
889
1020
|
groupId: e,
|
|
890
1021
|
panelId: t
|
|
891
1022
|
}) {
|
|
892
1023
|
const n = () => {
|
|
893
|
-
const
|
|
1024
|
+
const a = ee();
|
|
894
1025
|
for (const [
|
|
895
|
-
|
|
1026
|
+
s,
|
|
896
1027
|
{
|
|
897
|
-
defaultLayoutDeferred:
|
|
898
|
-
derivedPanelConstraints:
|
|
899
|
-
layout:
|
|
900
|
-
groupSize:
|
|
1028
|
+
defaultLayoutDeferred: u,
|
|
1029
|
+
derivedPanelConstraints: f,
|
|
1030
|
+
layout: d,
|
|
1031
|
+
groupSize: v,
|
|
901
1032
|
separatorToPanels: z
|
|
902
1033
|
}
|
|
903
|
-
] of
|
|
904
|
-
if (
|
|
1034
|
+
] of a)
|
|
1035
|
+
if (s.id === e)
|
|
905
1036
|
return {
|
|
906
|
-
defaultLayoutDeferred:
|
|
907
|
-
derivedPanelConstraints:
|
|
908
|
-
group:
|
|
909
|
-
groupSize:
|
|
910
|
-
layout:
|
|
1037
|
+
defaultLayoutDeferred: u,
|
|
1038
|
+
derivedPanelConstraints: f,
|
|
1039
|
+
group: s,
|
|
1040
|
+
groupSize: v,
|
|
1041
|
+
layout: d,
|
|
911
1042
|
separatorToPanels: z
|
|
912
1043
|
};
|
|
913
1044
|
throw Error(`Group ${e} not found`);
|
|
914
1045
|
}, o = () => {
|
|
915
|
-
const
|
|
916
|
-
(
|
|
1046
|
+
const a = n().derivedPanelConstraints.find(
|
|
1047
|
+
(s) => s.panelId === t
|
|
917
1048
|
);
|
|
918
|
-
if (
|
|
919
|
-
return
|
|
1049
|
+
if (a !== void 0)
|
|
1050
|
+
return a;
|
|
920
1051
|
throw Error(`Panel constraints not found for Panel ${t}`);
|
|
921
|
-
},
|
|
922
|
-
const
|
|
923
|
-
if (
|
|
924
|
-
return
|
|
1052
|
+
}, r = () => {
|
|
1053
|
+
const a = n().group.panels.find((s) => s.id === t);
|
|
1054
|
+
if (a !== void 0)
|
|
1055
|
+
return a;
|
|
925
1056
|
throw Error(`Layout not found for Panel ${t}`);
|
|
926
|
-
},
|
|
927
|
-
const
|
|
928
|
-
if (
|
|
929
|
-
return
|
|
1057
|
+
}, i = () => {
|
|
1058
|
+
const a = n().layout[t];
|
|
1059
|
+
if (a !== void 0)
|
|
1060
|
+
return a;
|
|
930
1061
|
throw Error(`Layout not found for Panel ${t}`);
|
|
931
|
-
},
|
|
932
|
-
nextSize:
|
|
933
|
-
panels:
|
|
934
|
-
prevLayout:
|
|
935
|
-
derivedPanelConstraints:
|
|
1062
|
+
}, c = ({
|
|
1063
|
+
nextSize: a,
|
|
1064
|
+
panels: s,
|
|
1065
|
+
prevLayout: u,
|
|
1066
|
+
derivedPanelConstraints: f
|
|
936
1067
|
}) => {
|
|
937
|
-
const
|
|
938
|
-
if (
|
|
939
|
-
const
|
|
940
|
-
return
|
|
1068
|
+
const d = i(), v = s.findIndex((g) => g.id === t), z = v === 0, p = v === s.length - 1;
|
|
1069
|
+
if (p && a < d && (z || s.slice(0, v).every((g, y) => {
|
|
1070
|
+
const m = f[y];
|
|
1071
|
+
return m?.collapsible && O(m.collapsedSize, u[m.panelId]);
|
|
941
1072
|
}))) {
|
|
942
|
-
const
|
|
1073
|
+
const g = s.slice(0, v).reduce((y, m) => y + u[m.id], 0);
|
|
943
1074
|
return {
|
|
944
|
-
...
|
|
945
|
-
[t]:
|
|
1075
|
+
...u,
|
|
1076
|
+
[t]: A(100 - g)
|
|
946
1077
|
};
|
|
947
1078
|
}
|
|
948
|
-
return
|
|
949
|
-
delta:
|
|
950
|
-
initialLayout:
|
|
951
|
-
panelConstraints:
|
|
952
|
-
pivotIndices:
|
|
953
|
-
prevLayout:
|
|
1079
|
+
return de({
|
|
1080
|
+
delta: p ? d - a : a - d,
|
|
1081
|
+
initialLayout: u,
|
|
1082
|
+
panelConstraints: f,
|
|
1083
|
+
pivotIndices: p ? [v - 1, v] : [v, v + 1],
|
|
1084
|
+
prevLayout: u,
|
|
954
1085
|
trigger: "imperative-api"
|
|
955
1086
|
});
|
|
956
|
-
},
|
|
957
|
-
const
|
|
958
|
-
if (
|
|
1087
|
+
}, l = (a) => {
|
|
1088
|
+
const s = i();
|
|
1089
|
+
if (a === s)
|
|
959
1090
|
return;
|
|
960
1091
|
const {
|
|
961
|
-
defaultLayoutDeferred:
|
|
962
|
-
derivedPanelConstraints:
|
|
963
|
-
group:
|
|
964
|
-
groupSize:
|
|
1092
|
+
defaultLayoutDeferred: u,
|
|
1093
|
+
derivedPanelConstraints: f,
|
|
1094
|
+
group: d,
|
|
1095
|
+
groupSize: v,
|
|
965
1096
|
layout: z,
|
|
966
|
-
separatorToPanels:
|
|
967
|
-
} = n(),
|
|
968
|
-
nextSize:
|
|
969
|
-
panels:
|
|
1097
|
+
separatorToPanels: p
|
|
1098
|
+
} = n(), h = c({
|
|
1099
|
+
nextSize: a,
|
|
1100
|
+
panels: d.panels,
|
|
970
1101
|
prevLayout: z,
|
|
971
|
-
derivedPanelConstraints:
|
|
972
|
-
}),
|
|
973
|
-
layout: d,
|
|
974
|
-
panelConstraints: m
|
|
975
|
-
});
|
|
976
|
-
K(z, h) || j(p, {
|
|
977
|
-
defaultLayoutDeferred: c,
|
|
978
|
-
derivedPanelConstraints: m,
|
|
979
|
-
groupSize: S,
|
|
1102
|
+
derivedPanelConstraints: f
|
|
1103
|
+
}), g = ne({
|
|
980
1104
|
layout: h,
|
|
981
|
-
|
|
1105
|
+
panelConstraints: f
|
|
1106
|
+
});
|
|
1107
|
+
W(z, g) || K(d, {
|
|
1108
|
+
defaultLayoutDeferred: u,
|
|
1109
|
+
derivedPanelConstraints: f,
|
|
1110
|
+
groupSize: v,
|
|
1111
|
+
layout: g,
|
|
1112
|
+
separatorToPanels: p
|
|
982
1113
|
});
|
|
983
1114
|
};
|
|
984
1115
|
return {
|
|
985
1116
|
collapse: () => {
|
|
986
|
-
const { collapsible:
|
|
987
|
-
|
|
1117
|
+
const { collapsible: a, collapsedSize: s } = o(), { mutableValues: u } = r(), f = i();
|
|
1118
|
+
a && f !== s && (u.expandToSize = f, l(s));
|
|
988
1119
|
},
|
|
989
1120
|
expand: () => {
|
|
990
|
-
const { collapsible:
|
|
991
|
-
if (
|
|
992
|
-
let
|
|
993
|
-
|
|
1121
|
+
const { collapsible: a, collapsedSize: s, minSize: u } = o(), { mutableValues: f } = r(), d = i();
|
|
1122
|
+
if (a && d === s) {
|
|
1123
|
+
let v = f.expandToSize ?? u;
|
|
1124
|
+
v === 0 && (v = 1), l(v);
|
|
994
1125
|
}
|
|
995
1126
|
},
|
|
996
1127
|
getSize: () => {
|
|
997
|
-
const { group:
|
|
1128
|
+
const { group: a } = n(), s = i(), { element: u } = r(), f = a.orientation === "horizontal" ? u.offsetWidth : u.offsetHeight;
|
|
998
1129
|
return {
|
|
999
|
-
asPercentage:
|
|
1000
|
-
inPixels:
|
|
1130
|
+
asPercentage: s,
|
|
1131
|
+
inPixels: f
|
|
1001
1132
|
};
|
|
1002
1133
|
},
|
|
1003
1134
|
isCollapsed: () => {
|
|
1004
|
-
const { collapsible:
|
|
1005
|
-
return
|
|
1135
|
+
const { collapsible: a, collapsedSize: s } = o(), u = i();
|
|
1136
|
+
return a && O(s, u);
|
|
1006
1137
|
},
|
|
1007
|
-
resize: (
|
|
1008
|
-
const { group:
|
|
1009
|
-
groupSize:
|
|
1010
|
-
panelElement:
|
|
1011
|
-
styleProp:
|
|
1012
|
-
}),
|
|
1013
|
-
|
|
1138
|
+
resize: (a) => {
|
|
1139
|
+
const { group: s } = n(), { element: u } = r(), f = ae({ group: s }), d = ie({
|
|
1140
|
+
groupSize: f,
|
|
1141
|
+
panelElement: u,
|
|
1142
|
+
styleProp: a
|
|
1143
|
+
}), v = A(d / f * 100);
|
|
1144
|
+
l(v);
|
|
1014
1145
|
}
|
|
1015
1146
|
};
|
|
1016
1147
|
}
|
|
1017
|
-
function
|
|
1148
|
+
function Be(e) {
|
|
1018
1149
|
if (e.defaultPrevented)
|
|
1019
1150
|
return;
|
|
1020
|
-
const t =
|
|
1021
|
-
|
|
1151
|
+
const t = ee();
|
|
1152
|
+
ke(e, t).forEach((o) => {
|
|
1022
1153
|
if (o.separator && !o.separator.disableDoubleClick) {
|
|
1023
|
-
const
|
|
1024
|
-
(
|
|
1154
|
+
const r = o.panels.find(
|
|
1155
|
+
(i) => i.panelConstraints.defaultSize !== void 0
|
|
1025
1156
|
);
|
|
1026
|
-
if (
|
|
1027
|
-
const
|
|
1157
|
+
if (r) {
|
|
1158
|
+
const i = r.panelConstraints.defaultSize, c = pt({
|
|
1028
1159
|
groupId: o.group.id,
|
|
1029
|
-
panelId:
|
|
1160
|
+
panelId: r.id
|
|
1030
1161
|
});
|
|
1031
|
-
|
|
1162
|
+
c && i !== void 0 && (c.resize(i), e.preventDefault());
|
|
1032
1163
|
}
|
|
1033
1164
|
}
|
|
1034
1165
|
});
|
|
1035
1166
|
}
|
|
1036
|
-
function
|
|
1037
|
-
const t =
|
|
1167
|
+
function ye(e) {
|
|
1168
|
+
const t = ee();
|
|
1038
1169
|
for (const [n] of t)
|
|
1039
1170
|
if (n.separators.some(
|
|
1040
1171
|
(o) => o.element === e
|
|
@@ -1042,14 +1173,14 @@ function he(e) {
|
|
|
1042
1173
|
return n;
|
|
1043
1174
|
throw Error("Could not find parent Group for separator element");
|
|
1044
1175
|
}
|
|
1045
|
-
function
|
|
1176
|
+
function ht({
|
|
1046
1177
|
groupId: e
|
|
1047
1178
|
}) {
|
|
1048
1179
|
const t = () => {
|
|
1049
|
-
const n =
|
|
1050
|
-
for (const [o,
|
|
1180
|
+
const n = ee();
|
|
1181
|
+
for (const [o, r] of n)
|
|
1051
1182
|
if (o.id === e)
|
|
1052
|
-
return { group: o, ...
|
|
1183
|
+
return { group: o, ...r };
|
|
1053
1184
|
throw Error(`Could not find Group with id "${e}"`);
|
|
1054
1185
|
};
|
|
1055
1186
|
return {
|
|
@@ -1060,50 +1191,50 @@ function lt({
|
|
|
1060
1191
|
setLayout(n) {
|
|
1061
1192
|
const {
|
|
1062
1193
|
defaultLayoutDeferred: o,
|
|
1063
|
-
derivedPanelConstraints:
|
|
1064
|
-
group:
|
|
1065
|
-
groupSize:
|
|
1066
|
-
layout:
|
|
1067
|
-
separatorToPanels:
|
|
1068
|
-
} = t(),
|
|
1194
|
+
derivedPanelConstraints: r,
|
|
1195
|
+
group: i,
|
|
1196
|
+
groupSize: c,
|
|
1197
|
+
layout: l,
|
|
1198
|
+
separatorToPanels: a
|
|
1199
|
+
} = t(), s = ne({
|
|
1069
1200
|
layout: n,
|
|
1070
|
-
panelConstraints:
|
|
1201
|
+
panelConstraints: r
|
|
1071
1202
|
});
|
|
1072
|
-
return o ?
|
|
1203
|
+
return o ? l : (W(l, s) || K(i, {
|
|
1073
1204
|
defaultLayoutDeferred: o,
|
|
1074
|
-
derivedPanelConstraints:
|
|
1075
|
-
groupSize:
|
|
1076
|
-
layout:
|
|
1077
|
-
separatorToPanels:
|
|
1078
|
-
}),
|
|
1205
|
+
derivedPanelConstraints: r,
|
|
1206
|
+
groupSize: c,
|
|
1207
|
+
layout: s,
|
|
1208
|
+
separatorToPanels: a
|
|
1209
|
+
}), s);
|
|
1079
1210
|
}
|
|
1080
1211
|
};
|
|
1081
1212
|
}
|
|
1082
|
-
function
|
|
1083
|
-
const n =
|
|
1084
|
-
(
|
|
1213
|
+
function te(e, t) {
|
|
1214
|
+
const n = ye(e), o = Q(n.id, !0), r = n.separators.find(
|
|
1215
|
+
(f) => f.element === e
|
|
1085
1216
|
);
|
|
1086
|
-
|
|
1087
|
-
const
|
|
1088
|
-
|
|
1089
|
-
const
|
|
1217
|
+
R(r, "Matching separator not found");
|
|
1218
|
+
const i = o.separatorToPanels.get(r);
|
|
1219
|
+
R(i, "Matching panels not found");
|
|
1220
|
+
const c = i.map((f) => n.panels.indexOf(f)), a = ht({ groupId: n.id }).getLayout(), s = de({
|
|
1090
1221
|
delta: t,
|
|
1091
|
-
initialLayout:
|
|
1222
|
+
initialLayout: a,
|
|
1092
1223
|
panelConstraints: o.derivedPanelConstraints,
|
|
1093
|
-
pivotIndices:
|
|
1094
|
-
prevLayout:
|
|
1224
|
+
pivotIndices: c,
|
|
1225
|
+
prevLayout: a,
|
|
1095
1226
|
trigger: "keyboard"
|
|
1096
|
-
}),
|
|
1097
|
-
layout:
|
|
1227
|
+
}), u = ne({
|
|
1228
|
+
layout: s,
|
|
1098
1229
|
panelConstraints: o.derivedPanelConstraints
|
|
1099
1230
|
});
|
|
1100
|
-
|
|
1231
|
+
W(a, u) || K(
|
|
1101
1232
|
n,
|
|
1102
1233
|
{
|
|
1103
1234
|
defaultLayoutDeferred: o.defaultLayoutDeferred,
|
|
1104
1235
|
derivedPanelConstraints: o.derivedPanelConstraints,
|
|
1105
1236
|
groupSize: o.groupSize,
|
|
1106
|
-
layout:
|
|
1237
|
+
layout: u,
|
|
1107
1238
|
separatorToPanels: o.separatorToPanels
|
|
1108
1239
|
},
|
|
1109
1240
|
// Keyboard resizes (arrow keys, Home/End, Enter collapse/expand) originate
|
|
@@ -1113,155 +1244,137 @@ function B(e, t) {
|
|
|
1113
1244
|
{ isUserInteraction: !0 }
|
|
1114
1245
|
);
|
|
1115
1246
|
}
|
|
1116
|
-
function
|
|
1247
|
+
function Ue(e) {
|
|
1117
1248
|
if (e.defaultPrevented)
|
|
1118
1249
|
return;
|
|
1119
|
-
const t = e.currentTarget, n =
|
|
1250
|
+
const t = e.currentTarget, n = ye(t);
|
|
1120
1251
|
if (!n.disabled)
|
|
1121
1252
|
switch (e.key) {
|
|
1122
1253
|
case "ArrowDown": {
|
|
1123
|
-
e.preventDefault(), n.orientation === "vertical" &&
|
|
1254
|
+
e.preventDefault(), n.orientation === "vertical" && te(t, 5);
|
|
1124
1255
|
break;
|
|
1125
1256
|
}
|
|
1126
1257
|
case "ArrowLeft": {
|
|
1127
|
-
e.preventDefault(), n.orientation === "horizontal" &&
|
|
1258
|
+
e.preventDefault(), n.orientation === "horizontal" && te(t, -5);
|
|
1128
1259
|
break;
|
|
1129
1260
|
}
|
|
1130
1261
|
case "ArrowRight": {
|
|
1131
|
-
e.preventDefault(), n.orientation === "horizontal" &&
|
|
1262
|
+
e.preventDefault(), n.orientation === "horizontal" && te(t, 5);
|
|
1132
1263
|
break;
|
|
1133
1264
|
}
|
|
1134
1265
|
case "ArrowUp": {
|
|
1135
|
-
e.preventDefault(), n.orientation === "vertical" &&
|
|
1266
|
+
e.preventDefault(), n.orientation === "vertical" && te(t, -5);
|
|
1136
1267
|
break;
|
|
1137
1268
|
}
|
|
1138
1269
|
case "End": {
|
|
1139
|
-
e.preventDefault(),
|
|
1270
|
+
e.preventDefault(), te(t, 100);
|
|
1140
1271
|
break;
|
|
1141
1272
|
}
|
|
1142
1273
|
case "Enter": {
|
|
1143
1274
|
e.preventDefault();
|
|
1144
|
-
const o =
|
|
1145
|
-
(
|
|
1275
|
+
const o = ye(t), r = Q(o.id, !0), { derivedPanelConstraints: i, layout: c, separatorToPanels: l } = r, a = o.separators.find(
|
|
1276
|
+
(d) => d.element === t
|
|
1146
1277
|
);
|
|
1147
|
-
|
|
1148
|
-
const
|
|
1149
|
-
|
|
1150
|
-
const
|
|
1151
|
-
(
|
|
1278
|
+
R(a, "Matching separator not found");
|
|
1279
|
+
const s = l.get(a);
|
|
1280
|
+
R(s, "Matching panels not found");
|
|
1281
|
+
const u = s[0], f = i.find(
|
|
1282
|
+
(d) => d.panelId === u.id
|
|
1152
1283
|
);
|
|
1153
|
-
if (
|
|
1154
|
-
const
|
|
1155
|
-
|
|
1284
|
+
if (R(f, "Panel metadata not found"), f.collapsible) {
|
|
1285
|
+
const d = c[u.id], v = f.collapsedSize === d ? o.mutableState.expandedPanelSizes[u.id] ?? f.minSize : f.collapsedSize;
|
|
1286
|
+
te(t, v - d);
|
|
1156
1287
|
}
|
|
1157
1288
|
break;
|
|
1158
1289
|
}
|
|
1159
1290
|
case "F6": {
|
|
1160
1291
|
e.preventDefault();
|
|
1161
|
-
const
|
|
1162
|
-
(
|
|
1163
|
-
),
|
|
1164
|
-
(
|
|
1292
|
+
const r = ye(t).separators.map(
|
|
1293
|
+
(a) => a.element
|
|
1294
|
+
), i = Array.from(r).findIndex(
|
|
1295
|
+
(a) => a === e.currentTarget
|
|
1165
1296
|
);
|
|
1166
|
-
|
|
1167
|
-
const
|
|
1168
|
-
|
|
1297
|
+
R(i !== null, "Index not found");
|
|
1298
|
+
const c = e.shiftKey ? i > 0 ? i - 1 : r.length - 1 : i + 1 < r.length ? i + 1 : 0;
|
|
1299
|
+
r[c].focus({
|
|
1169
1300
|
preventScroll: !0
|
|
1170
1301
|
});
|
|
1171
1302
|
break;
|
|
1172
1303
|
}
|
|
1173
1304
|
case "Home": {
|
|
1174
|
-
e.preventDefault(),
|
|
1305
|
+
e.preventDefault(), te(t, -100);
|
|
1175
1306
|
break;
|
|
1176
1307
|
}
|
|
1177
1308
|
}
|
|
1178
1309
|
}
|
|
1179
|
-
function
|
|
1310
|
+
function Jt(e, t) {
|
|
1311
|
+
const { element: n, orientation: o, panels: r } = e, i = n.getBoundingClientRect(), c = o === "horizontal";
|
|
1312
|
+
return Me({
|
|
1313
|
+
expandHitTargets: !1,
|
|
1314
|
+
group: e,
|
|
1315
|
+
includeDisabled: !0
|
|
1316
|
+
}).map(
|
|
1317
|
+
({ panels: a, rect: s, separator: u }, f) => {
|
|
1318
|
+
const d = r.indexOf(a[0]), v = c ? s.left + s.width / 2 : s.top + s.height / 2;
|
|
1319
|
+
return {
|
|
1320
|
+
active: t.some((p) => {
|
|
1321
|
+
if (p.group !== e || p.panels[0] !== a[0])
|
|
1322
|
+
return !1;
|
|
1323
|
+
if (u || p.separator)
|
|
1324
|
+
return p.separator === u;
|
|
1325
|
+
const h = c ? p.rect.left + p.rect.width / 2 : p.rect.top + p.rect.height / 2;
|
|
1326
|
+
return O(v, h);
|
|
1327
|
+
}),
|
|
1328
|
+
group: e,
|
|
1329
|
+
key: u ? `separator-${u.id}` : `panel-${a[0].id}-${f}`,
|
|
1330
|
+
offset: 0,
|
|
1331
|
+
panelIndex: d,
|
|
1332
|
+
rect: new DOMRect(
|
|
1333
|
+
(c && !u ? v : s.left) - i.left - n.clientLeft + n.scrollLeft,
|
|
1334
|
+
(!c && !u ? v : s.top) - i.top - n.clientTop + n.scrollTop,
|
|
1335
|
+
c && !u ? 0 : s.width,
|
|
1336
|
+
!c && !u ? 0 : s.height
|
|
1337
|
+
),
|
|
1338
|
+
separator: u
|
|
1339
|
+
};
|
|
1340
|
+
}
|
|
1341
|
+
);
|
|
1342
|
+
}
|
|
1343
|
+
function We(e) {
|
|
1180
1344
|
if (e.defaultPrevented)
|
|
1181
1345
|
return;
|
|
1182
1346
|
if (e.pointerType === "mouse" && e.button > 0)
|
|
1183
1347
|
return;
|
|
1184
|
-
const t =
|
|
1185
|
-
let
|
|
1186
|
-
n.forEach((
|
|
1187
|
-
|
|
1348
|
+
const t = ee(), n = ke(e, t), o = /* @__PURE__ */ new Map();
|
|
1349
|
+
let r = !1;
|
|
1350
|
+
n.forEach((c) => {
|
|
1351
|
+
c.separator && (r || (r = !0, c.separator.element.focus({
|
|
1188
1352
|
// @ts-expect-error https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus#browser_compatibility
|
|
1189
1353
|
focusVisible: !1,
|
|
1190
1354
|
preventScroll: !0
|
|
1191
1355
|
})));
|
|
1192
|
-
const
|
|
1193
|
-
|
|
1194
|
-
})
|
|
1356
|
+
const l = t.get(c.group);
|
|
1357
|
+
l && o.set(c.group, l.layout);
|
|
1358
|
+
});
|
|
1359
|
+
const i = Array.from(o.keys()).flatMap(
|
|
1360
|
+
(c) => c.resizePreviewMode === "separator" ? Jt(c, n) : []
|
|
1361
|
+
);
|
|
1362
|
+
U({
|
|
1195
1363
|
cursorFlags: 0,
|
|
1196
1364
|
hitRegions: n,
|
|
1197
1365
|
initialLayoutMap: o,
|
|
1198
1366
|
pointerDownAtPoint: { x: e.clientX, y: e.clientY },
|
|
1367
|
+
previewLayoutMap: new Map(o),
|
|
1368
|
+
previews: i,
|
|
1199
1369
|
state: "active"
|
|
1200
1370
|
}), n.length && e.preventDefault();
|
|
1201
1371
|
}
|
|
1202
|
-
function
|
|
1203
|
-
|
|
1204
|
-
event: t,
|
|
1205
|
-
hitRegions: n,
|
|
1206
|
-
initialLayoutMap: o,
|
|
1207
|
-
mountedGroups: i,
|
|
1208
|
-
pointerDownAtPoint: s,
|
|
1209
|
-
prevCursorFlags: u
|
|
1210
|
-
}) {
|
|
1211
|
-
let a = 0;
|
|
1212
|
-
n.forEach((l) => {
|
|
1213
|
-
const { group: c, groupSize: m } = l, { orientation: p, panels: S } = c, { disableCursor: z } = c.mutableState;
|
|
1214
|
-
let f = 0;
|
|
1215
|
-
s ? p === "horizontal" ? f = (t.clientX - s.x) / m * 100 : f = (t.clientY - s.y) / m * 100 : p === "horizontal" ? f = t.clientX < 0 ? -100 : 100 : f = t.clientY < 0 ? -100 : 100;
|
|
1216
|
-
const d = o.get(c), h = i.get(c);
|
|
1217
|
-
if (!d || !h)
|
|
1218
|
-
return;
|
|
1219
|
-
const {
|
|
1220
|
-
defaultLayoutDeferred: y,
|
|
1221
|
-
derivedPanelConstraints: b,
|
|
1222
|
-
groupSize: v,
|
|
1223
|
-
layout: g,
|
|
1224
|
-
separatorToPanels: w
|
|
1225
|
-
} = h;
|
|
1226
|
-
if (b && g && w) {
|
|
1227
|
-
const E = ae({
|
|
1228
|
-
delta: f,
|
|
1229
|
-
initialLayout: d,
|
|
1230
|
-
panelConstraints: b,
|
|
1231
|
-
pivotIndices: l.panels.map((L) => S.indexOf(L)),
|
|
1232
|
-
prevLayout: g,
|
|
1233
|
-
trigger: "mouse-or-touch"
|
|
1234
|
-
});
|
|
1235
|
-
if (K(E, g)) {
|
|
1236
|
-
if (f !== 0 && !z)
|
|
1237
|
-
switch (p) {
|
|
1238
|
-
case "horizontal": {
|
|
1239
|
-
a |= f < 0 ? et : tt;
|
|
1240
|
-
break;
|
|
1241
|
-
}
|
|
1242
|
-
case "vertical": {
|
|
1243
|
-
a |= f < 0 ? nt : ot;
|
|
1244
|
-
break;
|
|
1245
|
-
}
|
|
1246
|
-
}
|
|
1247
|
-
} else
|
|
1248
|
-
j(l.group, {
|
|
1249
|
-
defaultLayoutDeferred: y,
|
|
1250
|
-
derivedPanelConstraints: b,
|
|
1251
|
-
groupSize: v,
|
|
1252
|
-
layout: E,
|
|
1253
|
-
separatorToPanels: w
|
|
1254
|
-
});
|
|
1255
|
-
}
|
|
1256
|
-
});
|
|
1257
|
-
let r = 0;
|
|
1258
|
-
t.movementX === 0 ? r |= u & Ie : r |= a & Ie, t.movementY === 0 ? r |= u & ke : r |= a & ke, Et(r), Pe(e);
|
|
1259
|
-
}
|
|
1260
|
-
function He(e) {
|
|
1261
|
-
const t = V(), n = W();
|
|
1372
|
+
function Ke(e) {
|
|
1373
|
+
const t = ee(), n = X();
|
|
1262
1374
|
switch (n.state) {
|
|
1263
1375
|
case "active":
|
|
1264
|
-
|
|
1376
|
+
Ie({
|
|
1377
|
+
commit: !1,
|
|
1265
1378
|
document: e.currentTarget,
|
|
1266
1379
|
event: e,
|
|
1267
1380
|
hitRegions: n.hitRegions,
|
|
@@ -1271,35 +1384,39 @@ function He(e) {
|
|
|
1271
1384
|
});
|
|
1272
1385
|
}
|
|
1273
1386
|
}
|
|
1274
|
-
function
|
|
1387
|
+
function qe(e) {
|
|
1275
1388
|
if (e.defaultPrevented)
|
|
1276
1389
|
return;
|
|
1277
|
-
const t =
|
|
1390
|
+
const t = X(), n = ee();
|
|
1278
1391
|
switch (t.state) {
|
|
1279
1392
|
case "active": {
|
|
1280
1393
|
if (
|
|
1281
1394
|
// Skip this check for "pointerleave" events, else Firefox triggers a false positive (see #514)
|
|
1282
1395
|
e.buttons === 0
|
|
1283
1396
|
) {
|
|
1284
|
-
|
|
1397
|
+
t.previewLayoutMap.forEach((o, r) => {
|
|
1398
|
+
const i = n.get(r);
|
|
1399
|
+
r.resizePreviewMode === "separator" && i && !W(o, i.layout) && K(r, { ...i, layout: o });
|
|
1400
|
+
}), U({
|
|
1285
1401
|
cursorFlags: 0,
|
|
1286
1402
|
state: "inactive"
|
|
1287
1403
|
}), t.hitRegions.forEach((o) => {
|
|
1288
1404
|
if (!n.has(o.group))
|
|
1289
1405
|
return;
|
|
1290
|
-
const
|
|
1291
|
-
|
|
1406
|
+
const r = Q(o.group.id, !0);
|
|
1407
|
+
K(o.group, r, {
|
|
1292
1408
|
isUserInteraction: !0
|
|
1293
1409
|
});
|
|
1294
|
-
});
|
|
1410
|
+
}), fe(e.currentTarget);
|
|
1295
1411
|
return;
|
|
1296
1412
|
}
|
|
1297
1413
|
for (const o of t.hitRegions)
|
|
1298
1414
|
if (o.separator) {
|
|
1299
|
-
const { element:
|
|
1300
|
-
|
|
1415
|
+
const { element: r } = o.separator;
|
|
1416
|
+
r.isConnected && !r.hasPointerCapture?.(e.pointerId) && r.setPointerCapture?.(e.pointerId);
|
|
1301
1417
|
}
|
|
1302
|
-
|
|
1418
|
+
Ie({
|
|
1419
|
+
commit: !1,
|
|
1303
1420
|
document: e.currentTarget,
|
|
1304
1421
|
event: e,
|
|
1305
1422
|
hitRegions: t.hitRegions,
|
|
@@ -1311,67 +1428,70 @@ function Ve(e) {
|
|
|
1311
1428
|
break;
|
|
1312
1429
|
}
|
|
1313
1430
|
default: {
|
|
1314
|
-
const o =
|
|
1315
|
-
o.length === 0 ? t.state !== "inactive" &&
|
|
1431
|
+
const o = ke(e, n);
|
|
1432
|
+
o.length === 0 ? t.state !== "inactive" && U({
|
|
1316
1433
|
cursorFlags: 0,
|
|
1317
1434
|
state: "inactive"
|
|
1318
|
-
}) :
|
|
1435
|
+
}) : U({
|
|
1319
1436
|
cursorFlags: 0,
|
|
1320
1437
|
hitRegions: o,
|
|
1321
1438
|
state: "hover"
|
|
1322
|
-
}),
|
|
1439
|
+
}), fe(e.currentTarget);
|
|
1323
1440
|
break;
|
|
1324
1441
|
}
|
|
1325
1442
|
}
|
|
1326
1443
|
}
|
|
1327
|
-
function
|
|
1444
|
+
function Xe(e) {
|
|
1328
1445
|
if (e.relatedTarget instanceof HTMLIFrameElement)
|
|
1329
|
-
switch (
|
|
1446
|
+
switch (X().state) {
|
|
1330
1447
|
case "hover":
|
|
1331
|
-
|
|
1448
|
+
U({
|
|
1332
1449
|
cursorFlags: 0,
|
|
1333
1450
|
state: "inactive"
|
|
1334
1451
|
});
|
|
1335
1452
|
}
|
|
1336
1453
|
}
|
|
1337
|
-
function
|
|
1454
|
+
function Ye(e) {
|
|
1338
1455
|
if (e.defaultPrevented)
|
|
1339
1456
|
return;
|
|
1340
1457
|
if (e.pointerType === "mouse" && e.button > 0)
|
|
1341
1458
|
return;
|
|
1342
|
-
|
|
1459
|
+
ft(
|
|
1460
|
+
e.currentTarget,
|
|
1461
|
+
e
|
|
1462
|
+
) && e.preventDefault();
|
|
1343
1463
|
}
|
|
1344
|
-
function
|
|
1464
|
+
function Je(e) {
|
|
1345
1465
|
let t = 0, n = 0;
|
|
1346
1466
|
const o = {};
|
|
1347
|
-
for (const
|
|
1348
|
-
if (
|
|
1467
|
+
for (const i of e)
|
|
1468
|
+
if (i.defaultSize !== void 0) {
|
|
1349
1469
|
t++;
|
|
1350
|
-
const
|
|
1351
|
-
n +=
|
|
1470
|
+
const c = A(i.defaultSize);
|
|
1471
|
+
n += c, o[i.panelId] = c;
|
|
1352
1472
|
} else
|
|
1353
|
-
o[
|
|
1354
|
-
const
|
|
1355
|
-
if (
|
|
1356
|
-
const
|
|
1357
|
-
for (const
|
|
1358
|
-
|
|
1473
|
+
o[i.panelId] = void 0;
|
|
1474
|
+
const r = e.length - t;
|
|
1475
|
+
if (r !== 0) {
|
|
1476
|
+
const i = A((100 - n) / r);
|
|
1477
|
+
for (const c of e)
|
|
1478
|
+
c.defaultSize === void 0 && (o[c.panelId] = i);
|
|
1359
1479
|
}
|
|
1360
1480
|
return o;
|
|
1361
1481
|
}
|
|
1362
|
-
function
|
|
1482
|
+
function Zt(e, t, n) {
|
|
1363
1483
|
if (!n[0])
|
|
1364
1484
|
return;
|
|
1365
|
-
const
|
|
1366
|
-
if (!
|
|
1485
|
+
const r = e.panels.find((s) => s.element === t);
|
|
1486
|
+
if (!r || !r.onResize)
|
|
1367
1487
|
return;
|
|
1368
|
-
const
|
|
1369
|
-
asPercentage:
|
|
1370
|
-
inPixels:
|
|
1488
|
+
const i = ae({ group: e }), c = e.orientation === "horizontal" ? r.element.offsetWidth : r.element.offsetHeight, l = r.mutableValues.prevSize, a = {
|
|
1489
|
+
asPercentage: A(c / i * 100),
|
|
1490
|
+
inPixels: c
|
|
1371
1491
|
};
|
|
1372
|
-
|
|
1492
|
+
r.mutableValues.prevSize = a, r.onResize(a, r.id, l);
|
|
1373
1493
|
}
|
|
1374
|
-
function
|
|
1494
|
+
function mt(e, t) {
|
|
1375
1495
|
if (Object.keys(e).length !== Object.keys(t).length)
|
|
1376
1496
|
return !1;
|
|
1377
1497
|
for (const o in e)
|
|
@@ -1379,10 +1499,10 @@ function Ht(e, t) {
|
|
|
1379
1499
|
return !1;
|
|
1380
1500
|
return !0;
|
|
1381
1501
|
}
|
|
1382
|
-
function
|
|
1383
|
-
return e.length !== t.length ? !1 : e.every((n, o) =>
|
|
1502
|
+
function Qt(e, t) {
|
|
1503
|
+
return e.length !== t.length ? !1 : e.every((n, o) => mt(n, t[o]));
|
|
1384
1504
|
}
|
|
1385
|
-
function
|
|
1505
|
+
function en({
|
|
1386
1506
|
group: e,
|
|
1387
1507
|
nextGroupSize: t,
|
|
1388
1508
|
prevGroupSize: n,
|
|
@@ -1390,172 +1510,172 @@ function Ut({
|
|
|
1390
1510
|
}) {
|
|
1391
1511
|
if (n <= 0 || t <= 0 || n === t)
|
|
1392
1512
|
return o;
|
|
1393
|
-
let
|
|
1394
|
-
const
|
|
1395
|
-
for (const
|
|
1396
|
-
const
|
|
1397
|
-
switch (
|
|
1513
|
+
let r = 0, i = 0, c = !1;
|
|
1514
|
+
const l = /* @__PURE__ */ new Map(), a = [];
|
|
1515
|
+
for (const f of e.panels) {
|
|
1516
|
+
const d = o[f.id] ?? 0;
|
|
1517
|
+
switch (f.panelConstraints.groupResizeBehavior) {
|
|
1398
1518
|
case "preserve-pixel-size": {
|
|
1399
|
-
|
|
1400
|
-
const
|
|
1401
|
-
|
|
1519
|
+
c = !0;
|
|
1520
|
+
const v = d / 100 * n, z = A(
|
|
1521
|
+
v / t * 100
|
|
1402
1522
|
);
|
|
1403
|
-
|
|
1523
|
+
l.set(f.id, z), r += z;
|
|
1404
1524
|
break;
|
|
1405
1525
|
}
|
|
1406
1526
|
case "preserve-relative-size":
|
|
1407
1527
|
default: {
|
|
1408
|
-
|
|
1528
|
+
a.push(f.id), i += d;
|
|
1409
1529
|
break;
|
|
1410
1530
|
}
|
|
1411
1531
|
}
|
|
1412
1532
|
}
|
|
1413
|
-
if (!
|
|
1533
|
+
if (!c || a.length === 0)
|
|
1414
1534
|
return o;
|
|
1415
|
-
const
|
|
1416
|
-
if (
|
|
1417
|
-
|
|
1418
|
-
}),
|
|
1419
|
-
for (const
|
|
1420
|
-
const
|
|
1421
|
-
|
|
1422
|
-
|
|
1535
|
+
const s = 100 - r, u = { ...o };
|
|
1536
|
+
if (l.forEach((f, d) => {
|
|
1537
|
+
u[d] = f;
|
|
1538
|
+
}), i > 0)
|
|
1539
|
+
for (const f of a) {
|
|
1540
|
+
const d = o[f] ?? 0;
|
|
1541
|
+
u[f] = A(
|
|
1542
|
+
d / i * s
|
|
1423
1543
|
);
|
|
1424
1544
|
}
|
|
1425
1545
|
else {
|
|
1426
|
-
const
|
|
1427
|
-
|
|
1546
|
+
const f = A(
|
|
1547
|
+
s / a.length
|
|
1428
1548
|
);
|
|
1429
|
-
for (const
|
|
1430
|
-
|
|
1549
|
+
for (const d of a)
|
|
1550
|
+
u[d] = f;
|
|
1431
1551
|
}
|
|
1432
|
-
return
|
|
1552
|
+
return u;
|
|
1433
1553
|
}
|
|
1434
|
-
function
|
|
1435
|
-
const n = e.map((
|
|
1554
|
+
function tn(e, t) {
|
|
1555
|
+
const n = e.map((r) => r.id), o = Object.keys(t);
|
|
1436
1556
|
if (n.length !== o.length)
|
|
1437
1557
|
return !1;
|
|
1438
|
-
for (const
|
|
1439
|
-
if (!o.includes(
|
|
1558
|
+
for (const r of n)
|
|
1559
|
+
if (!o.includes(r))
|
|
1440
1560
|
return !1;
|
|
1441
1561
|
return !0;
|
|
1442
1562
|
}
|
|
1443
|
-
const
|
|
1444
|
-
function
|
|
1563
|
+
const re = /* @__PURE__ */ new Map();
|
|
1564
|
+
function nn(e) {
|
|
1445
1565
|
let t = !0;
|
|
1446
|
-
|
|
1566
|
+
R(
|
|
1447
1567
|
e.element.ownerDocument.defaultView,
|
|
1448
1568
|
"Cannot register an unmounted Group"
|
|
1449
1569
|
);
|
|
1450
|
-
const n = e.element.ownerDocument.defaultView.ResizeObserver, o = /* @__PURE__ */ new Set(),
|
|
1451
|
-
for (const
|
|
1452
|
-
const { borderBoxSize:
|
|
1570
|
+
const n = e.element.ownerDocument.defaultView.ResizeObserver, o = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), i = new n((p) => {
|
|
1571
|
+
for (const h of p) {
|
|
1572
|
+
const { borderBoxSize: g, target: y } = h;
|
|
1453
1573
|
if (y === e.element) {
|
|
1454
1574
|
if (t) {
|
|
1455
|
-
const
|
|
1456
|
-
if (
|
|
1575
|
+
const m = ae({ group: e });
|
|
1576
|
+
if (m === 0)
|
|
1457
1577
|
return;
|
|
1458
|
-
const
|
|
1459
|
-
if (!
|
|
1578
|
+
const b = Q(e.id);
|
|
1579
|
+
if (!b)
|
|
1460
1580
|
return;
|
|
1461
|
-
const
|
|
1581
|
+
const x = Le(e), L = b.defaultLayoutDeferred ? Je(x) : b.layout, w = en({
|
|
1462
1582
|
group: e,
|
|
1463
|
-
nextGroupSize:
|
|
1464
|
-
prevGroupSize:
|
|
1465
|
-
prevLayout:
|
|
1466
|
-
}),
|
|
1467
|
-
layout:
|
|
1468
|
-
panelConstraints:
|
|
1583
|
+
nextGroupSize: m,
|
|
1584
|
+
prevGroupSize: b.groupSize,
|
|
1585
|
+
prevLayout: L
|
|
1586
|
+
}), C = ne({
|
|
1587
|
+
layout: w,
|
|
1588
|
+
panelConstraints: x
|
|
1469
1589
|
});
|
|
1470
|
-
if (!
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
) &&
|
|
1590
|
+
if (!b.defaultLayoutDeferred && W(b.layout, C) && Qt(
|
|
1591
|
+
b.derivedPanelConstraints,
|
|
1592
|
+
x
|
|
1593
|
+
) && b.groupSize === m)
|
|
1474
1594
|
continue;
|
|
1475
|
-
|
|
1595
|
+
K(e, {
|
|
1476
1596
|
defaultLayoutDeferred: !1,
|
|
1477
|
-
derivedPanelConstraints:
|
|
1478
|
-
groupSize:
|
|
1479
|
-
layout:
|
|
1480
|
-
separatorToPanels:
|
|
1597
|
+
derivedPanelConstraints: x,
|
|
1598
|
+
groupSize: m,
|
|
1599
|
+
layout: C,
|
|
1600
|
+
separatorToPanels: b.separatorToPanels
|
|
1481
1601
|
});
|
|
1482
1602
|
}
|
|
1483
1603
|
} else
|
|
1484
|
-
|
|
1604
|
+
Zt(e, y, g);
|
|
1485
1605
|
}
|
|
1486
1606
|
});
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
!o.has(
|
|
1490
|
-
`Panel ids must be unique; id "${
|
|
1491
|
-
), o.add(
|
|
1607
|
+
i.observe(e.element), e.panels.forEach((p) => {
|
|
1608
|
+
R(
|
|
1609
|
+
!o.has(p.id),
|
|
1610
|
+
`Panel ids must be unique; id "${p.id}" was used more than once`
|
|
1611
|
+
), o.add(p.id), p.onResize && i.observe(p.element);
|
|
1492
1612
|
});
|
|
1493
|
-
const
|
|
1494
|
-
let
|
|
1495
|
-
|
|
1496
|
-
const
|
|
1497
|
-
layout:
|
|
1498
|
-
panelConstraints:
|
|
1499
|
-
}),
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
(
|
|
1613
|
+
const c = ae({ group: e }), l = Le(e), a = e.panels.map(({ id: p }) => p).join(",");
|
|
1614
|
+
let s = e.mutableState.defaultLayout;
|
|
1615
|
+
s && (tn(e.panels, s) || (s = void 0));
|
|
1616
|
+
const u = e.mutableState.layouts[a] ?? s ?? Je(l), f = ne({
|
|
1617
|
+
layout: u,
|
|
1618
|
+
panelConstraints: l
|
|
1619
|
+
}), d = e.element.ownerDocument;
|
|
1620
|
+
re.set(
|
|
1621
|
+
d,
|
|
1622
|
+
(re.get(d) ?? 0) + 1
|
|
1503
1623
|
);
|
|
1504
|
-
const
|
|
1505
|
-
return
|
|
1506
|
-
|
|
1507
|
-
}),
|
|
1508
|
-
defaultLayoutDeferred:
|
|
1509
|
-
derivedPanelConstraints:
|
|
1510
|
-
groupSize:
|
|
1511
|
-
layout:
|
|
1512
|
-
separatorToPanels:
|
|
1513
|
-
}), e.separators.forEach((
|
|
1514
|
-
|
|
1515
|
-
!
|
|
1516
|
-
`Separator ids must be unique; id "${
|
|
1517
|
-
),
|
|
1518
|
-
}),
|
|
1519
|
-
t = !1,
|
|
1520
|
-
|
|
1521
|
-
Math.max(0, (
|
|
1522
|
-
),
|
|
1523
|
-
|
|
1524
|
-
}),
|
|
1624
|
+
const v = /* @__PURE__ */ new Map();
|
|
1625
|
+
return Me({ group: e }).forEach((p) => {
|
|
1626
|
+
p.separator && v.set(p.separator, p.panels);
|
|
1627
|
+
}), K(e, {
|
|
1628
|
+
defaultLayoutDeferred: c === 0,
|
|
1629
|
+
derivedPanelConstraints: l,
|
|
1630
|
+
groupSize: c,
|
|
1631
|
+
layout: f,
|
|
1632
|
+
separatorToPanels: v
|
|
1633
|
+
}), e.separators.forEach((p) => {
|
|
1634
|
+
R(
|
|
1635
|
+
!r.has(p.id),
|
|
1636
|
+
`Separator ids must be unique; id "${p.id}" was used more than once`
|
|
1637
|
+
), r.add(p.id), p.element.addEventListener("keydown", Ue);
|
|
1638
|
+
}), re.get(d) === 1 && (d.addEventListener("contextmenu", $e, !0), d.addEventListener("dblclick", Be, !0), d.addEventListener("pointerdown", We, !0), d.addEventListener("pointerleave", Ke), d.addEventListener("pointermove", qe), d.addEventListener("pointerout", Xe), d.addEventListener("pointerup", Ye, !0)), function() {
|
|
1639
|
+
t = !1, re.set(
|
|
1640
|
+
d,
|
|
1641
|
+
Math.max(0, (re.get(d) ?? 0) - 1)
|
|
1642
|
+
), jt(e), Dt(e) && fe(d), e.separators.forEach((h) => {
|
|
1643
|
+
h.element.removeEventListener("keydown", Ue);
|
|
1644
|
+
}), re.get(d) || (d.removeEventListener(
|
|
1525
1645
|
"contextmenu",
|
|
1526
|
-
|
|
1646
|
+
$e,
|
|
1527
1647
|
!0
|
|
1528
|
-
),
|
|
1648
|
+
), d.removeEventListener(
|
|
1529
1649
|
"dblclick",
|
|
1530
|
-
|
|
1650
|
+
Be,
|
|
1531
1651
|
!0
|
|
1532
|
-
),
|
|
1652
|
+
), d.removeEventListener(
|
|
1533
1653
|
"pointerdown",
|
|
1534
|
-
|
|
1654
|
+
We,
|
|
1535
1655
|
!0
|
|
1536
|
-
),
|
|
1656
|
+
), d.removeEventListener("pointerleave", Ke), d.removeEventListener("pointermove", qe), d.removeEventListener("pointerout", Xe), d.removeEventListener("pointerup", Ye, !0)), i.disconnect();
|
|
1537
1657
|
};
|
|
1538
1658
|
}
|
|
1539
|
-
function
|
|
1540
|
-
const [e, t] =
|
|
1659
|
+
function on() {
|
|
1660
|
+
const [e, t] = Z({}), n = ce(() => t({}), []);
|
|
1541
1661
|
return [e, n];
|
|
1542
1662
|
}
|
|
1543
|
-
function
|
|
1544
|
-
const t =
|
|
1663
|
+
function Te(e) {
|
|
1664
|
+
const t = wt();
|
|
1545
1665
|
return `${e ?? t}`;
|
|
1546
1666
|
}
|
|
1547
|
-
const
|
|
1548
|
-
function
|
|
1549
|
-
const t =
|
|
1550
|
-
return
|
|
1667
|
+
const j = typeof window < "u" ? Ze : Se;
|
|
1668
|
+
function ue(e) {
|
|
1669
|
+
const t = D(e);
|
|
1670
|
+
return j(() => {
|
|
1551
1671
|
t.current = e;
|
|
1552
|
-
}, [e]),
|
|
1672
|
+
}, [e]), ce(
|
|
1553
1673
|
(...n) => t.current?.(...n),
|
|
1554
1674
|
[t]
|
|
1555
1675
|
);
|
|
1556
1676
|
}
|
|
1557
|
-
function
|
|
1558
|
-
return
|
|
1677
|
+
function Oe(...e) {
|
|
1678
|
+
return ue((t) => {
|
|
1559
1679
|
e.forEach((n) => {
|
|
1560
1680
|
if (n)
|
|
1561
1681
|
switch (typeof n) {
|
|
@@ -1571,268 +1691,427 @@ function Re(...e) {
|
|
|
1571
1691
|
});
|
|
1572
1692
|
});
|
|
1573
1693
|
}
|
|
1574
|
-
function
|
|
1575
|
-
const t =
|
|
1576
|
-
return
|
|
1694
|
+
function De(e) {
|
|
1695
|
+
const t = D({ ...e });
|
|
1696
|
+
return j(() => {
|
|
1577
1697
|
for (const n in e)
|
|
1578
1698
|
t.current[n] = e[n];
|
|
1579
1699
|
}, [e]), t.current;
|
|
1580
1700
|
}
|
|
1581
|
-
const
|
|
1582
|
-
function
|
|
1583
|
-
|
|
1701
|
+
const gt = Pt(null);
|
|
1702
|
+
function rn({
|
|
1703
|
+
separator: e
|
|
1704
|
+
}) {
|
|
1705
|
+
const { element: t } = e, n = D(null);
|
|
1706
|
+
return j(() => {
|
|
1707
|
+
const o = t.cloneNode(!0), r = [t, ...t.querySelectorAll("*")], i = [o, ...o.querySelectorAll("*")], c = t.ownerDocument.defaultView;
|
|
1708
|
+
return r.forEach((l, a) => {
|
|
1709
|
+
const s = i[a];
|
|
1710
|
+
if (s instanceof c.HTMLElement || s instanceof c.SVGElement) {
|
|
1711
|
+
const u = c.getComputedStyle(l);
|
|
1712
|
+
for (let f = 0; f < u.length; f++) {
|
|
1713
|
+
const d = u.item(f);
|
|
1714
|
+
s.style.setProperty(
|
|
1715
|
+
d,
|
|
1716
|
+
u.getPropertyValue(d)
|
|
1717
|
+
);
|
|
1718
|
+
}
|
|
1719
|
+
}
|
|
1720
|
+
s.removeAttribute("data-testid"), s.removeAttribute("id");
|
|
1721
|
+
}), Object.assign(o.style, {
|
|
1722
|
+
boxSizing: "border-box",
|
|
1723
|
+
height: "100%",
|
|
1724
|
+
margin: "0",
|
|
1725
|
+
position: "static",
|
|
1726
|
+
transform: "none",
|
|
1727
|
+
width: "100%"
|
|
1728
|
+
}), n.current.appendChild(o), () => o.remove();
|
|
1729
|
+
}, [t]), /* @__PURE__ */ B(
|
|
1730
|
+
"div",
|
|
1731
|
+
{
|
|
1732
|
+
ref: n,
|
|
1733
|
+
style: {
|
|
1734
|
+
height: "100%",
|
|
1735
|
+
opacity: 0.65,
|
|
1736
|
+
pointerEvents: "none",
|
|
1737
|
+
width: "100%"
|
|
1738
|
+
}
|
|
1739
|
+
}
|
|
1740
|
+
);
|
|
1741
|
+
}
|
|
1742
|
+
function be() {
|
|
1743
|
+
const e = Lt(gt);
|
|
1744
|
+
return R(
|
|
1745
|
+
e,
|
|
1746
|
+
"Group Context not found; did you render a Panel or Separator outside of a Group?"
|
|
1747
|
+
), e;
|
|
1748
|
+
}
|
|
1749
|
+
function yt(e) {
|
|
1750
|
+
const { registerOverlay: t } = be(), n = D(e);
|
|
1751
|
+
mt(n.current, e) || (n.current = e);
|
|
1752
|
+
const o = n.current;
|
|
1753
|
+
return j(
|
|
1754
|
+
() => t(o),
|
|
1755
|
+
[t, o]
|
|
1756
|
+
), null;
|
|
1757
|
+
}
|
|
1758
|
+
yt.displayName = "SeparatorOverlay";
|
|
1759
|
+
function sn({
|
|
1760
|
+
active: e,
|
|
1761
|
+
orientation: t,
|
|
1762
|
+
style: n,
|
|
1763
|
+
...o
|
|
1764
|
+
}) {
|
|
1765
|
+
let r;
|
|
1766
|
+
switch (t) {
|
|
1767
|
+
case "horizontal": {
|
|
1768
|
+
r = {
|
|
1769
|
+
height: "100%",
|
|
1770
|
+
minWidth: "1px"
|
|
1771
|
+
};
|
|
1772
|
+
break;
|
|
1773
|
+
}
|
|
1774
|
+
case "vertical": {
|
|
1775
|
+
r = {
|
|
1776
|
+
minHeight: "1px",
|
|
1777
|
+
width: "100%"
|
|
1778
|
+
};
|
|
1779
|
+
break;
|
|
1780
|
+
}
|
|
1781
|
+
}
|
|
1782
|
+
return /* @__PURE__ */ B(
|
|
1783
|
+
"div",
|
|
1784
|
+
{
|
|
1785
|
+
...o,
|
|
1786
|
+
"data-separator-overlay": e ? "active" : "inactive",
|
|
1787
|
+
style: {
|
|
1788
|
+
...r,
|
|
1789
|
+
...n,
|
|
1790
|
+
flexShrink: 0,
|
|
1791
|
+
pointerEvents: "none"
|
|
1792
|
+
}
|
|
1793
|
+
}
|
|
1794
|
+
);
|
|
1795
|
+
}
|
|
1796
|
+
function an({
|
|
1797
|
+
overlay: e,
|
|
1798
|
+
preview: t
|
|
1799
|
+
}) {
|
|
1800
|
+
const { group: n, offset: o, rect: r, separator: i } = t, c = n.orientation === "horizontal";
|
|
1801
|
+
let l = i?.preview, a = e;
|
|
1802
|
+
return Ct(l) && l.type === yt && (a = l.props, l = void 0), l == null && (a ? l = /* @__PURE__ */ B(
|
|
1803
|
+
sn,
|
|
1804
|
+
{
|
|
1805
|
+
...a,
|
|
1806
|
+
active: t.active,
|
|
1807
|
+
orientation: n.orientation
|
|
1808
|
+
}
|
|
1809
|
+
) : i && (l = /* @__PURE__ */ B(rn, { separator: i }))), /* @__PURE__ */ B(
|
|
1810
|
+
"div",
|
|
1811
|
+
{
|
|
1812
|
+
"aria-hidden": "true",
|
|
1813
|
+
"data-resize-preview": !0,
|
|
1814
|
+
inert: !0,
|
|
1815
|
+
style: {
|
|
1816
|
+
height: r.height,
|
|
1817
|
+
left: r.left,
|
|
1818
|
+
pointerEvents: "none",
|
|
1819
|
+
position: "absolute",
|
|
1820
|
+
top: r.top,
|
|
1821
|
+
transform: c ? `translateX(${o}px)` : `translateY(${o}px)`,
|
|
1822
|
+
width: r.width
|
|
1823
|
+
},
|
|
1824
|
+
children: l
|
|
1825
|
+
}
|
|
1826
|
+
);
|
|
1827
|
+
}
|
|
1828
|
+
function ln(e, t) {
|
|
1829
|
+
const n = D({
|
|
1584
1830
|
getLayout: () => ({}),
|
|
1585
|
-
setLayout:
|
|
1831
|
+
setLayout: At
|
|
1586
1832
|
});
|
|
1587
|
-
|
|
1833
|
+
Qe(t, () => n.current, []), j(() => {
|
|
1588
1834
|
Object.assign(
|
|
1589
1835
|
n.current,
|
|
1590
|
-
|
|
1836
|
+
ht({ groupId: e })
|
|
1591
1837
|
);
|
|
1592
1838
|
});
|
|
1593
1839
|
}
|
|
1594
|
-
function
|
|
1840
|
+
function cn({
|
|
1841
|
+
groupId: e,
|
|
1842
|
+
resizePreviewMode: t
|
|
1843
|
+
}) {
|
|
1844
|
+
const [n, o] = Z([]), r = D(n);
|
|
1845
|
+
return j(() => {
|
|
1846
|
+
const i = (l) => {
|
|
1847
|
+
const a = ut(e), s = t === "separator" && l.state === "active" ? l.previews.filter(
|
|
1848
|
+
(f) => f.group === a && (f.active || !O(f.offset, 0))
|
|
1849
|
+
) : [], u = r.current;
|
|
1850
|
+
u.length === s.length && s.every(
|
|
1851
|
+
(f, d) => f === u[d]
|
|
1852
|
+
) || (r.current = s, o(s));
|
|
1853
|
+
};
|
|
1854
|
+
if (t !== "separator") {
|
|
1855
|
+
i(X());
|
|
1856
|
+
return;
|
|
1857
|
+
}
|
|
1858
|
+
const c = nt(
|
|
1859
|
+
({ next: l }) => i(l)
|
|
1860
|
+
);
|
|
1861
|
+
return i(X()), c;
|
|
1862
|
+
}, [e, t]), n;
|
|
1863
|
+
}
|
|
1864
|
+
function un({
|
|
1595
1865
|
children: e,
|
|
1596
1866
|
className: t,
|
|
1597
1867
|
defaultLayout: n,
|
|
1598
1868
|
disableCursor: o,
|
|
1599
|
-
disabled:
|
|
1600
|
-
elementRef:
|
|
1601
|
-
groupRef:
|
|
1602
|
-
id:
|
|
1603
|
-
onLayoutChange:
|
|
1604
|
-
onLayoutChanged:
|
|
1605
|
-
orientation:
|
|
1606
|
-
|
|
1869
|
+
disabled: r,
|
|
1870
|
+
elementRef: i,
|
|
1871
|
+
groupRef: c,
|
|
1872
|
+
id: l,
|
|
1873
|
+
onLayoutChange: a,
|
|
1874
|
+
onLayoutChanged: s,
|
|
1875
|
+
orientation: u = "horizontal",
|
|
1876
|
+
resizePreviewMode: f = "panel",
|
|
1877
|
+
resizeTargetMinimumSize: d = {
|
|
1607
1878
|
coarse: 20,
|
|
1608
1879
|
fine: 10
|
|
1609
1880
|
},
|
|
1610
|
-
style:
|
|
1611
|
-
...
|
|
1881
|
+
style: v,
|
|
1882
|
+
...z
|
|
1612
1883
|
}) {
|
|
1613
|
-
const
|
|
1884
|
+
const p = D({
|
|
1614
1885
|
onLayoutChange: {},
|
|
1615
1886
|
onLayoutChanged: {}
|
|
1616
|
-
}),
|
|
1617
|
-
|
|
1618
|
-
}),
|
|
1619
|
-
(
|
|
1620
|
-
|
|
1887
|
+
}), h = ue((S) => {
|
|
1888
|
+
W(p.current.onLayoutChange, S) || (p.current.onLayoutChange = S, a?.(S));
|
|
1889
|
+
}), g = ue(
|
|
1890
|
+
(S, P) => {
|
|
1891
|
+
W(p.current.onLayoutChanged, S) || (p.current.onLayoutChanged = S, s?.(S, { isUserInteraction: P }));
|
|
1621
1892
|
}
|
|
1622
|
-
),
|
|
1893
|
+
), y = Te(l), [m, b] = Z(), x = cn({
|
|
1894
|
+
groupId: y,
|
|
1895
|
+
resizePreviewMode: f
|
|
1896
|
+
}), L = D(null), [w, C] = on(), M = D({
|
|
1623
1897
|
lastExpandedPanelSizes: {},
|
|
1624
1898
|
layouts: {},
|
|
1625
1899
|
panels: [],
|
|
1626
|
-
resizeTargetMinimumSize:
|
|
1900
|
+
resizeTargetMinimumSize: d,
|
|
1627
1901
|
separators: []
|
|
1628
|
-
}),
|
|
1629
|
-
|
|
1630
|
-
const
|
|
1631
|
-
(
|
|
1632
|
-
const I =
|
|
1633
|
-
if (
|
|
1634
|
-
let k = !1;
|
|
1635
|
-
switch (I.state) {
|
|
1636
|
-
case "active": {
|
|
1637
|
-
k = I.hitRegions.some(
|
|
1638
|
-
(U) => U.group === R
|
|
1639
|
-
);
|
|
1640
|
-
break;
|
|
1641
|
-
}
|
|
1642
|
-
}
|
|
1902
|
+
}), T = Oe(L, i);
|
|
1903
|
+
ln(y, c);
|
|
1904
|
+
const G = ue(
|
|
1905
|
+
(S, P) => {
|
|
1906
|
+
const I = Q(S);
|
|
1907
|
+
if (I)
|
|
1643
1908
|
return {
|
|
1644
|
-
flexGrow:
|
|
1645
|
-
pointerEvents: k ? "none" : void 0
|
|
1909
|
+
flexGrow: I.layout[P] ?? 1
|
|
1646
1910
|
};
|
|
1647
|
-
}
|
|
1648
1911
|
if (n?.[P])
|
|
1649
1912
|
return {
|
|
1650
1913
|
flexGrow: n?.[P]
|
|
1651
1914
|
};
|
|
1652
1915
|
}
|
|
1653
|
-
),
|
|
1916
|
+
), E = De({
|
|
1654
1917
|
defaultLayout: n,
|
|
1655
1918
|
disableCursor: o
|
|
1656
|
-
}),
|
|
1919
|
+
}), N = Pe(
|
|
1657
1920
|
() => ({
|
|
1658
1921
|
get disableCursor() {
|
|
1659
|
-
return !!
|
|
1922
|
+
return !!E.disableCursor;
|
|
1660
1923
|
},
|
|
1661
|
-
getPanelStyles:
|
|
1662
|
-
id:
|
|
1663
|
-
orientation:
|
|
1664
|
-
registerPanel: (
|
|
1665
|
-
const P =
|
|
1666
|
-
return P.panels =
|
|
1924
|
+
getPanelStyles: G,
|
|
1925
|
+
id: y,
|
|
1926
|
+
orientation: u,
|
|
1927
|
+
registerPanel: (S) => {
|
|
1928
|
+
const P = M.current;
|
|
1929
|
+
return P.panels = Ce(u, [
|
|
1667
1930
|
...P.panels,
|
|
1668
|
-
|
|
1669
|
-
]),
|
|
1931
|
+
S
|
|
1932
|
+
]), C(), () => {
|
|
1670
1933
|
P.panels = P.panels.filter(
|
|
1671
|
-
(I) => I !==
|
|
1672
|
-
),
|
|
1934
|
+
(I) => I !== S
|
|
1935
|
+
), C();
|
|
1673
1936
|
};
|
|
1674
1937
|
},
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1938
|
+
registerOverlay: (S) => (b(S), () => {
|
|
1939
|
+
b(void 0);
|
|
1940
|
+
}),
|
|
1941
|
+
registerSeparator: (S) => {
|
|
1942
|
+
const P = M.current;
|
|
1943
|
+
return P.separators = Ce(u, [
|
|
1678
1944
|
...P.separators,
|
|
1679
|
-
|
|
1680
|
-
]),
|
|
1945
|
+
S
|
|
1946
|
+
]), C(), () => {
|
|
1681
1947
|
P.separators = P.separators.filter(
|
|
1682
|
-
(I) => I !==
|
|
1683
|
-
),
|
|
1948
|
+
(I) => I !== S
|
|
1949
|
+
), C();
|
|
1684
1950
|
};
|
|
1685
1951
|
},
|
|
1686
|
-
updatePanelProps: (
|
|
1687
|
-
const
|
|
1688
|
-
(
|
|
1952
|
+
updatePanelProps: (S, { disabled: P }) => {
|
|
1953
|
+
const F = M.current.panels.find(
|
|
1954
|
+
(oe) => oe.id === S
|
|
1689
1955
|
);
|
|
1690
|
-
|
|
1691
|
-
const
|
|
1692
|
-
|
|
1693
|
-
...
|
|
1694
|
-
derivedPanelConstraints:
|
|
1956
|
+
F && (F.panelConstraints.disabled = P);
|
|
1957
|
+
const $ = ut(y), Y = Q(y);
|
|
1958
|
+
$ && Y && K($, {
|
|
1959
|
+
...Y,
|
|
1960
|
+
derivedPanelConstraints: Le($)
|
|
1695
1961
|
});
|
|
1696
1962
|
},
|
|
1697
|
-
updateSeparatorProps: (
|
|
1963
|
+
updateSeparatorProps: (S, {
|
|
1698
1964
|
disabled: P,
|
|
1699
1965
|
disableDoubleClick: I
|
|
1700
1966
|
}) => {
|
|
1701
|
-
const
|
|
1702
|
-
(
|
|
1967
|
+
const $ = M.current.separators.find(
|
|
1968
|
+
(Y) => Y.id === S
|
|
1703
1969
|
);
|
|
1704
|
-
|
|
1970
|
+
$ && ($.disabled = P, $.disableDoubleClick = I);
|
|
1705
1971
|
}
|
|
1706
1972
|
}),
|
|
1707
|
-
[
|
|
1708
|
-
),
|
|
1709
|
-
return
|
|
1710
|
-
const
|
|
1711
|
-
if (
|
|
1973
|
+
[G, y, C, u, E]
|
|
1974
|
+
), _ = D(null);
|
|
1975
|
+
return j(() => {
|
|
1976
|
+
const S = L.current;
|
|
1977
|
+
if (S === null)
|
|
1712
1978
|
return;
|
|
1713
|
-
const P =
|
|
1979
|
+
const P = M.current;
|
|
1714
1980
|
let I;
|
|
1715
|
-
if (
|
|
1981
|
+
if (E.defaultLayout !== void 0 && Object.keys(E.defaultLayout).length === P.panels.length) {
|
|
1716
1982
|
I = {};
|
|
1717
|
-
for (const
|
|
1718
|
-
const
|
|
1719
|
-
|
|
1983
|
+
for (const J of P.panels) {
|
|
1984
|
+
const pe = E.defaultLayout[J.id];
|
|
1985
|
+
pe !== void 0 && (I[J.id] = pe);
|
|
1720
1986
|
}
|
|
1721
1987
|
}
|
|
1722
|
-
const
|
|
1723
|
-
disabled: !!
|
|
1724
|
-
element:
|
|
1725
|
-
id:
|
|
1988
|
+
const F = {
|
|
1989
|
+
disabled: !!r,
|
|
1990
|
+
element: S,
|
|
1991
|
+
id: y,
|
|
1726
1992
|
mutableState: {
|
|
1727
1993
|
defaultLayout: I,
|
|
1728
|
-
disableCursor: !!
|
|
1729
|
-
expandedPanelSizes:
|
|
1730
|
-
layouts:
|
|
1994
|
+
disableCursor: !!E.disableCursor,
|
|
1995
|
+
expandedPanelSizes: M.current.lastExpandedPanelSizes,
|
|
1996
|
+
layouts: M.current.layouts
|
|
1731
1997
|
},
|
|
1732
|
-
orientation:
|
|
1998
|
+
orientation: u,
|
|
1733
1999
|
panels: P.panels,
|
|
2000
|
+
resizePreviewMode: f,
|
|
1734
2001
|
resizeTargetMinimumSize: P.resizeTargetMinimumSize,
|
|
1735
2002
|
separators: P.separators
|
|
1736
2003
|
};
|
|
1737
|
-
|
|
1738
|
-
const
|
|
1739
|
-
!
|
|
1740
|
-
const
|
|
1741
|
-
const { defaultLayoutDeferred:
|
|
1742
|
-
if (
|
|
2004
|
+
_.current = F;
|
|
2005
|
+
const $ = nn(F), { defaultLayoutDeferred: Y, derivedPanelConstraints: oe, layout: le } = Q(F.id, !0);
|
|
2006
|
+
!Y && oe.length > 0 && (h(le), g(le, !1));
|
|
2007
|
+
const xe = Ee(y, (J) => {
|
|
2008
|
+
const { defaultLayoutDeferred: pe, derivedPanelConstraints: Ae, layout: he } = J.next;
|
|
2009
|
+
if (pe || Ae.length === 0)
|
|
1743
2010
|
return;
|
|
1744
|
-
const
|
|
1745
|
-
|
|
1746
|
-
if (
|
|
1747
|
-
const { layout:
|
|
1748
|
-
if (
|
|
1749
|
-
const
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
),
|
|
1753
|
-
|
|
1754
|
-
|
|
2011
|
+
const vt = F.panels.map(({ id: q }) => q).join(",");
|
|
2012
|
+
F.mutableState.layouts[vt] = he, Ae.forEach((q) => {
|
|
2013
|
+
if (q.collapsible) {
|
|
2014
|
+
const { layout: ze } = J.prev ?? {};
|
|
2015
|
+
if (ze) {
|
|
2016
|
+
const bt = O(
|
|
2017
|
+
q.collapsedSize,
|
|
2018
|
+
he[q.panelId]
|
|
2019
|
+
), xt = O(
|
|
2020
|
+
q.collapsedSize,
|
|
2021
|
+
ze[q.panelId]
|
|
1755
2022
|
);
|
|
1756
|
-
|
|
2023
|
+
bt && !xt && (F.mutableState.expandedPanelSizes[q.panelId] = ze[q.panelId]);
|
|
1757
2024
|
}
|
|
1758
2025
|
}
|
|
1759
2026
|
});
|
|
1760
|
-
const
|
|
1761
|
-
|
|
2027
|
+
const St = X().state !== "active";
|
|
2028
|
+
h(he), St && g(he, J.isUserInteraction);
|
|
1762
2029
|
});
|
|
1763
2030
|
return () => {
|
|
1764
|
-
|
|
2031
|
+
_.current = null, $(), xe();
|
|
1765
2032
|
};
|
|
1766
2033
|
}, [
|
|
1767
|
-
|
|
2034
|
+
r,
|
|
2035
|
+
y,
|
|
2036
|
+
g,
|
|
1768
2037
|
h,
|
|
1769
|
-
|
|
2038
|
+
u,
|
|
2039
|
+
w,
|
|
1770
2040
|
f,
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
x && (x.mutableState.defaultLayout = n, x.mutableState.disableCursor = !!o);
|
|
1777
|
-
}), /* @__PURE__ */ se(ct.Provider, { value: G, children: /* @__PURE__ */ se(
|
|
2041
|
+
E
|
|
2042
|
+
]), Se(() => {
|
|
2043
|
+
const S = _.current;
|
|
2044
|
+
S && (S.mutableState.defaultLayout = n, S.mutableState.disableCursor = !!o);
|
|
2045
|
+
}), /* @__PURE__ */ B(gt.Provider, { value: N, children: /* @__PURE__ */ zt(
|
|
1778
2046
|
"div",
|
|
1779
2047
|
{
|
|
1780
|
-
...
|
|
2048
|
+
...z,
|
|
1781
2049
|
className: t,
|
|
1782
2050
|
"data-group": !0,
|
|
1783
|
-
"data-testid":
|
|
1784
|
-
id:
|
|
1785
|
-
ref:
|
|
2051
|
+
"data-testid": y,
|
|
2052
|
+
id: y,
|
|
2053
|
+
ref: T,
|
|
1786
2054
|
style: {
|
|
1787
2055
|
height: "100%",
|
|
1788
2056
|
width: "100%",
|
|
1789
2057
|
overflow: "hidden",
|
|
1790
|
-
|
|
2058
|
+
position: f === "separator" ? "relative" : void 0,
|
|
2059
|
+
...v,
|
|
1791
2060
|
display: "flex",
|
|
1792
|
-
flexDirection:
|
|
2061
|
+
flexDirection: u === "horizontal" ? "row" : "column",
|
|
1793
2062
|
flexWrap: "nowrap",
|
|
1794
2063
|
// Inform the browser that the library is handling touch events for this element
|
|
1795
2064
|
// but still allow users to scroll content within panels in the non-resizing direction
|
|
1796
2065
|
// NOTE This is not an inherited style
|
|
1797
2066
|
// See github.com/bvaughn/react-resizable-panels/issues/662
|
|
1798
|
-
touchAction:
|
|
2067
|
+
touchAction: u === "horizontal" ? "pan-y" : "pan-x"
|
|
1799
2068
|
},
|
|
1800
|
-
children:
|
|
2069
|
+
children: [
|
|
2070
|
+
e,
|
|
2071
|
+
x.map((S) => /* @__PURE__ */ B(
|
|
2072
|
+
an,
|
|
2073
|
+
{
|
|
2074
|
+
overlay: m,
|
|
2075
|
+
preview: S
|
|
2076
|
+
},
|
|
2077
|
+
S.key
|
|
2078
|
+
))
|
|
2079
|
+
]
|
|
1801
2080
|
}
|
|
1802
2081
|
) });
|
|
1803
2082
|
}
|
|
1804
|
-
|
|
1805
|
-
function
|
|
2083
|
+
un.displayName = "Group";
|
|
2084
|
+
function ve(e, t) {
|
|
1806
2085
|
return `react-resizable-panels:${[e, ...t].join(":")}`;
|
|
1807
2086
|
}
|
|
1808
|
-
function
|
|
2087
|
+
function fn({
|
|
1809
2088
|
id: e,
|
|
1810
2089
|
panelIds: t,
|
|
1811
2090
|
storage: n
|
|
1812
2091
|
}) {
|
|
1813
|
-
const o =
|
|
1814
|
-
if (
|
|
2092
|
+
const o = ve(e, []), r = n.getItem(o);
|
|
2093
|
+
if (r)
|
|
1815
2094
|
try {
|
|
1816
|
-
const
|
|
2095
|
+
const i = JSON.parse(r);
|
|
1817
2096
|
if (t) {
|
|
1818
|
-
const
|
|
1819
|
-
if (
|
|
1820
|
-
const
|
|
1821
|
-
for (let
|
|
1822
|
-
|
|
1823
|
-
return
|
|
2097
|
+
const c = t.join(","), l = i[c];
|
|
2098
|
+
if (l && Array.isArray(l.layout) && t.length === l.layout.length) {
|
|
2099
|
+
const a = {};
|
|
2100
|
+
for (let s = 0; s < t.length; s++)
|
|
2101
|
+
a[t[s]] = l.layout[s];
|
|
2102
|
+
return a;
|
|
1824
2103
|
}
|
|
1825
2104
|
} else {
|
|
1826
|
-
const
|
|
1827
|
-
if (
|
|
1828
|
-
const
|
|
1829
|
-
if (
|
|
1830
|
-
const
|
|
1831
|
-
if (
|
|
1832
|
-
const
|
|
1833
|
-
for (let
|
|
1834
|
-
|
|
1835
|
-
return
|
|
2105
|
+
const c = Object.keys(i);
|
|
2106
|
+
if (c.length === 1) {
|
|
2107
|
+
const l = i[c[0]];
|
|
2108
|
+
if (l && Array.isArray(l.layout)) {
|
|
2109
|
+
const a = c[0].split(",");
|
|
2110
|
+
if (a.length === l.layout.length) {
|
|
2111
|
+
const s = {};
|
|
2112
|
+
for (let u = 0; u < a.length; u++)
|
|
2113
|
+
s[a[u]] = l.layout[u];
|
|
2114
|
+
return s;
|
|
1836
2115
|
}
|
|
1837
2116
|
}
|
|
1838
2117
|
}
|
|
@@ -1840,224 +2119,220 @@ function Yt({
|
|
|
1840
2119
|
} catch {
|
|
1841
2120
|
}
|
|
1842
2121
|
}
|
|
1843
|
-
function
|
|
2122
|
+
function xn({
|
|
1844
2123
|
debounceSaveMs: e = 100,
|
|
1845
2124
|
onlySaveAfterUserInteractions: t,
|
|
1846
2125
|
panelIds: n,
|
|
1847
2126
|
storage: o = localStorage,
|
|
1848
|
-
...
|
|
2127
|
+
...r
|
|
1849
2128
|
}) {
|
|
1850
|
-
const
|
|
1851
|
-
|
|
1852
|
-
() => o.getItem(
|
|
1853
|
-
() => o.getItem(
|
|
1854
|
-
),
|
|
1855
|
-
if (
|
|
1856
|
-
const
|
|
1857
|
-
if (Array.from(
|
|
1858
|
-
return
|
|
2129
|
+
const i = n !== void 0, c = "id" in r ? r.id : r.groupId, l = ve(c, n ?? []), a = et(
|
|
2130
|
+
dn,
|
|
2131
|
+
() => o.getItem(l),
|
|
2132
|
+
() => o.getItem(l)
|
|
2133
|
+
), s = Pe(() => {
|
|
2134
|
+
if (a) {
|
|
2135
|
+
const h = JSON.parse(a), g = Object.values(h);
|
|
2136
|
+
if (Array.from(g).every((y) => typeof y == "number"))
|
|
2137
|
+
return h;
|
|
1859
2138
|
}
|
|
1860
|
-
}, [
|
|
1861
|
-
if (!
|
|
1862
|
-
return
|
|
1863
|
-
id:
|
|
2139
|
+
}, [a]), u = Pe(() => {
|
|
2140
|
+
if (!s)
|
|
2141
|
+
return fn({
|
|
2142
|
+
id: c,
|
|
1864
2143
|
panelIds: n,
|
|
1865
2144
|
storage: o
|
|
1866
2145
|
});
|
|
1867
|
-
}, [
|
|
1868
|
-
const
|
|
1869
|
-
|
|
2146
|
+
}, [s, c, n, o]), f = s ?? u, d = D(null), v = ce(() => {
|
|
2147
|
+
const h = d.current;
|
|
2148
|
+
h && (d.current = null, clearTimeout(h));
|
|
1870
2149
|
}, []);
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
}, [
|
|
1874
|
-
const z =
|
|
2150
|
+
Ze(() => () => {
|
|
2151
|
+
v();
|
|
2152
|
+
}, [v]);
|
|
2153
|
+
const z = ce(
|
|
1875
2154
|
// The hook persists every layout commit -- including library-driven ones --
|
|
1876
2155
|
// because it owns its own storage and the goal is to remember whatever
|
|
1877
2156
|
// layout the user is currently looking at. Consumers that only want to
|
|
1878
2157
|
// persist on user interaction should branch on `isUserInteraction` in
|
|
1879
2158
|
// their own callback (see #716) rather than via this hook.
|
|
1880
|
-
(
|
|
1881
|
-
if (t && !
|
|
2159
|
+
(h, g) => {
|
|
2160
|
+
if (t && !g.isUserInteraction)
|
|
1882
2161
|
return;
|
|
1883
|
-
|
|
2162
|
+
v();
|
|
1884
2163
|
let y;
|
|
1885
|
-
|
|
2164
|
+
i ? y = ve(c, Object.keys(h)) : y = ve(c, []);
|
|
1886
2165
|
try {
|
|
1887
|
-
o.setItem(y, JSON.stringify(
|
|
1888
|
-
} catch (
|
|
1889
|
-
console.error(
|
|
2166
|
+
o.setItem(y, JSON.stringify(h));
|
|
2167
|
+
} catch (m) {
|
|
2168
|
+
console.error(m);
|
|
1890
2169
|
}
|
|
1891
2170
|
},
|
|
1892
2171
|
[
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
2172
|
+
v,
|
|
2173
|
+
i,
|
|
2174
|
+
c,
|
|
1896
2175
|
t,
|
|
1897
2176
|
o
|
|
1898
2177
|
]
|
|
1899
|
-
),
|
|
1900
|
-
(
|
|
1901
|
-
|
|
1902
|
-
z(
|
|
2178
|
+
), p = ce(
|
|
2179
|
+
(h) => {
|
|
2180
|
+
v(), e === 0 ? z(h, { isUserInteraction: !1 }) : d.current = setTimeout(() => {
|
|
2181
|
+
z(h, { isUserInteraction: !1 });
|
|
1903
2182
|
}, e);
|
|
1904
2183
|
},
|
|
1905
|
-
[
|
|
2184
|
+
[v, e, z]
|
|
1906
2185
|
);
|
|
1907
2186
|
return {
|
|
1908
2187
|
/**
|
|
1909
2188
|
* Pass this value to `Group` as the `defaultLayout` prop.
|
|
1910
2189
|
*/
|
|
1911
|
-
defaultLayout:
|
|
2190
|
+
defaultLayout: f,
|
|
1912
2191
|
/**
|
|
1913
2192
|
* Attach this callback on the `Group` as the `onLayoutChange` prop.
|
|
1914
2193
|
*
|
|
1915
2194
|
* @deprecated Use the {@link onLayoutChanged} prop instead.
|
|
1916
2195
|
*/
|
|
1917
|
-
onLayoutChange:
|
|
2196
|
+
onLayoutChange: p,
|
|
1918
2197
|
/**
|
|
1919
2198
|
* Attach this callback on the `Group` as the `onLayoutChanged` prop.
|
|
1920
2199
|
*/
|
|
1921
2200
|
onLayoutChanged: z
|
|
1922
2201
|
};
|
|
1923
2202
|
}
|
|
1924
|
-
function
|
|
2203
|
+
function dn() {
|
|
1925
2204
|
return function() {
|
|
1926
2205
|
};
|
|
1927
2206
|
}
|
|
1928
|
-
function
|
|
1929
|
-
return
|
|
1930
|
-
}
|
|
1931
|
-
function un() {
|
|
1932
|
-
return O(null);
|
|
2207
|
+
function zn() {
|
|
2208
|
+
return Z(null);
|
|
1933
2209
|
}
|
|
1934
|
-
function
|
|
1935
|
-
|
|
1936
|
-
return C(
|
|
1937
|
-
e,
|
|
1938
|
-
"Group Context not found; did you render a Panel or Separator outside of a Group?"
|
|
1939
|
-
), e;
|
|
2210
|
+
function wn() {
|
|
2211
|
+
return D(null);
|
|
1940
2212
|
}
|
|
1941
|
-
function
|
|
1942
|
-
const { id: n } =
|
|
1943
|
-
collapse:
|
|
1944
|
-
expand:
|
|
2213
|
+
function pn(e, t) {
|
|
2214
|
+
const { id: n } = be(), o = D({
|
|
2215
|
+
collapse: we,
|
|
2216
|
+
expand: we,
|
|
1945
2217
|
getSize: () => ({
|
|
1946
2218
|
asPercentage: 0,
|
|
1947
2219
|
inPixels: 0
|
|
1948
2220
|
}),
|
|
1949
2221
|
isCollapsed: () => !1,
|
|
1950
|
-
resize:
|
|
2222
|
+
resize: we
|
|
1951
2223
|
});
|
|
1952
|
-
|
|
2224
|
+
Qe(t, () => o.current, []), j(() => {
|
|
1953
2225
|
Object.assign(
|
|
1954
2226
|
o.current,
|
|
1955
|
-
|
|
2227
|
+
pt({ groupId: n, panelId: e })
|
|
1956
2228
|
);
|
|
1957
2229
|
});
|
|
1958
2230
|
}
|
|
1959
|
-
function
|
|
2231
|
+
function hn({
|
|
1960
2232
|
children: e,
|
|
1961
2233
|
className: t,
|
|
1962
2234
|
collapsedSize: n = "0%",
|
|
1963
|
-
|
|
2235
|
+
collapsedThreshold: o,
|
|
2236
|
+
collapsible: r = !1,
|
|
1964
2237
|
defaultSize: i,
|
|
1965
|
-
disabled:
|
|
1966
|
-
elementRef:
|
|
2238
|
+
disabled: c,
|
|
2239
|
+
elementRef: l,
|
|
1967
2240
|
groupResizeBehavior: a = "preserve-relative-size",
|
|
1968
|
-
id:
|
|
1969
|
-
maxSize:
|
|
1970
|
-
minSize:
|
|
1971
|
-
onResize:
|
|
1972
|
-
panelRef:
|
|
1973
|
-
style:
|
|
1974
|
-
...
|
|
2241
|
+
id: s,
|
|
2242
|
+
maxSize: u = "100%",
|
|
2243
|
+
minSize: f = "0%",
|
|
2244
|
+
onResize: d,
|
|
2245
|
+
panelRef: v,
|
|
2246
|
+
style: z,
|
|
2247
|
+
...p
|
|
1975
2248
|
}) {
|
|
1976
|
-
const
|
|
1977
|
-
disabled:
|
|
1978
|
-
}),
|
|
1979
|
-
getPanelStyles:
|
|
1980
|
-
id:
|
|
2249
|
+
const h = !!s, g = Te(s), y = De({
|
|
2250
|
+
disabled: c
|
|
2251
|
+
}), m = D(null), b = Oe(m, l), {
|
|
2252
|
+
getPanelStyles: x,
|
|
2253
|
+
id: L,
|
|
1981
2254
|
orientation: w,
|
|
1982
|
-
registerPanel:
|
|
1983
|
-
updatePanelProps:
|
|
1984
|
-
} =
|
|
1985
|
-
(
|
|
1986
|
-
|
|
2255
|
+
registerPanel: C,
|
|
2256
|
+
updatePanelProps: M
|
|
2257
|
+
} = be(), T = d !== null, G = ue(
|
|
2258
|
+
(S, P, I) => {
|
|
2259
|
+
d?.(S, s, I);
|
|
1987
2260
|
}
|
|
1988
2261
|
);
|
|
1989
|
-
|
|
1990
|
-
const
|
|
1991
|
-
if (
|
|
1992
|
-
const
|
|
1993
|
-
element:
|
|
1994
|
-
id:
|
|
1995
|
-
idIsStable:
|
|
2262
|
+
j(() => {
|
|
2263
|
+
const S = m.current;
|
|
2264
|
+
if (S !== null) {
|
|
2265
|
+
const P = {
|
|
2266
|
+
element: S,
|
|
2267
|
+
id: g,
|
|
2268
|
+
idIsStable: h,
|
|
1996
2269
|
mutableValues: {
|
|
1997
2270
|
expandToSize: void 0,
|
|
1998
2271
|
prevSize: void 0
|
|
1999
2272
|
},
|
|
2000
|
-
onResize:
|
|
2273
|
+
onResize: T ? G : void 0,
|
|
2001
2274
|
panelConstraints: {
|
|
2002
2275
|
groupResizeBehavior: a,
|
|
2003
2276
|
collapsedSize: n,
|
|
2004
|
-
|
|
2277
|
+
collapsedThreshold: o,
|
|
2278
|
+
collapsible: r,
|
|
2005
2279
|
defaultSize: i,
|
|
2006
|
-
disabled:
|
|
2007
|
-
maxSize:
|
|
2008
|
-
minSize:
|
|
2280
|
+
disabled: y.disabled,
|
|
2281
|
+
maxSize: u,
|
|
2282
|
+
minSize: f
|
|
2009
2283
|
}
|
|
2010
2284
|
};
|
|
2011
|
-
return
|
|
2285
|
+
return C(P);
|
|
2012
2286
|
}
|
|
2013
2287
|
}, [
|
|
2014
2288
|
a,
|
|
2015
2289
|
n,
|
|
2016
2290
|
o,
|
|
2291
|
+
r,
|
|
2017
2292
|
i,
|
|
2018
|
-
|
|
2019
|
-
|
|
2293
|
+
T,
|
|
2294
|
+
g,
|
|
2295
|
+
h,
|
|
2296
|
+
u,
|
|
2020
2297
|
f,
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2298
|
+
G,
|
|
2299
|
+
C,
|
|
2300
|
+
y
|
|
2301
|
+
]), Se(() => {
|
|
2302
|
+
M(g, { disabled: c });
|
|
2303
|
+
}, [c, g, M]), pn(g, v);
|
|
2304
|
+
const E = () => {
|
|
2305
|
+
const S = x(L, g);
|
|
2306
|
+
if (S)
|
|
2307
|
+
return JSON.stringify(S);
|
|
2308
|
+
}, N = et(
|
|
2309
|
+
(S) => Ee(L, S),
|
|
2024
2310
|
E,
|
|
2025
|
-
|
|
2026
|
-
]), ge(() => {
|
|
2027
|
-
L(d, { disabled: s });
|
|
2028
|
-
}, [s, d, L]), Zt(d, p);
|
|
2029
|
-
const x = () => {
|
|
2030
|
-
const R = v(g, d);
|
|
2031
|
-
if (R)
|
|
2032
|
-
return JSON.stringify(R);
|
|
2033
|
-
}, P = qe(
|
|
2034
|
-
(R) => we(g, R),
|
|
2035
|
-
x,
|
|
2036
|
-
x
|
|
2311
|
+
E
|
|
2037
2312
|
);
|
|
2038
|
-
let
|
|
2039
|
-
return
|
|
2313
|
+
let _;
|
|
2314
|
+
return N ? _ = JSON.parse(N) : i !== void 0 ? _ = {
|
|
2040
2315
|
flexGrow: void 0,
|
|
2041
2316
|
flexShrink: void 0,
|
|
2042
2317
|
flexBasis: i
|
|
2043
|
-
} :
|
|
2318
|
+
} : _ = { flexGrow: 1 }, /* @__PURE__ */ B(
|
|
2044
2319
|
"div",
|
|
2045
2320
|
{
|
|
2046
|
-
...
|
|
2047
|
-
"data-disabled":
|
|
2321
|
+
...p,
|
|
2322
|
+
"data-disabled": c || void 0,
|
|
2048
2323
|
"data-panel": !0,
|
|
2049
|
-
"data-testid":
|
|
2050
|
-
id:
|
|
2324
|
+
"data-testid": g,
|
|
2325
|
+
id: g,
|
|
2051
2326
|
ref: b,
|
|
2052
2327
|
style: {
|
|
2053
|
-
...
|
|
2328
|
+
...mn,
|
|
2054
2329
|
display: "flex",
|
|
2055
2330
|
flexBasis: 0,
|
|
2056
2331
|
flexShrink: 1,
|
|
2057
2332
|
overflow: "visible",
|
|
2058
|
-
...
|
|
2333
|
+
..._
|
|
2059
2334
|
},
|
|
2060
|
-
children: /* @__PURE__ */
|
|
2335
|
+
children: /* @__PURE__ */ B(
|
|
2061
2336
|
"div",
|
|
2062
2337
|
{
|
|
2063
2338
|
className: t,
|
|
@@ -2066,7 +2341,7 @@ function Qt({
|
|
|
2066
2341
|
maxWidth: "100%",
|
|
2067
2342
|
flexGrow: 1,
|
|
2068
2343
|
overflow: "auto",
|
|
2069
|
-
...
|
|
2344
|
+
...z,
|
|
2070
2345
|
// Inform the browser that the library is handling touch events for this element
|
|
2071
2346
|
// but still allow users to scroll content within panels in the non-resizing direction
|
|
2072
2347
|
// NOTE This is not an inherited style
|
|
@@ -2079,8 +2354,8 @@ function Qt({
|
|
|
2079
2354
|
}
|
|
2080
2355
|
);
|
|
2081
2356
|
}
|
|
2082
|
-
|
|
2083
|
-
const
|
|
2357
|
+
hn.displayName = "Panel";
|
|
2358
|
+
const mn = {
|
|
2084
2359
|
minHeight: 0,
|
|
2085
2360
|
maxHeight: "100%",
|
|
2086
2361
|
height: "auto",
|
|
@@ -2092,39 +2367,39 @@ const en = {
|
|
|
2092
2367
|
padding: 0,
|
|
2093
2368
|
margin: 0
|
|
2094
2369
|
};
|
|
2095
|
-
function
|
|
2096
|
-
return
|
|
2370
|
+
function Pn() {
|
|
2371
|
+
return Z(null);
|
|
2097
2372
|
}
|
|
2098
|
-
function
|
|
2099
|
-
return
|
|
2373
|
+
function Ln() {
|
|
2374
|
+
return D(null);
|
|
2100
2375
|
}
|
|
2101
|
-
function
|
|
2376
|
+
function gn({
|
|
2102
2377
|
layout: e,
|
|
2103
2378
|
panelConstraints: t,
|
|
2104
2379
|
panelId: n,
|
|
2105
2380
|
panelIndex: o
|
|
2106
2381
|
}) {
|
|
2107
|
-
let
|
|
2108
|
-
const
|
|
2109
|
-
(
|
|
2382
|
+
let r, i;
|
|
2383
|
+
const c = e[n], l = t.find(
|
|
2384
|
+
(a) => a.panelId === n
|
|
2110
2385
|
);
|
|
2111
|
-
if (
|
|
2112
|
-
const
|
|
2113
|
-
|
|
2114
|
-
layout:
|
|
2115
|
-
delta:
|
|
2386
|
+
if (l) {
|
|
2387
|
+
const a = l.maxSize, s = l.collapsible ? l.collapsedSize : l.minSize, u = [o, o + 1];
|
|
2388
|
+
i = ne({
|
|
2389
|
+
layout: de({
|
|
2390
|
+
delta: s - c,
|
|
2116
2391
|
initialLayout: e,
|
|
2117
2392
|
panelConstraints: t,
|
|
2118
|
-
pivotIndices:
|
|
2393
|
+
pivotIndices: u,
|
|
2119
2394
|
prevLayout: e
|
|
2120
2395
|
}),
|
|
2121
2396
|
panelConstraints: t
|
|
2122
|
-
})[n],
|
|
2123
|
-
layout:
|
|
2124
|
-
delta:
|
|
2397
|
+
})[n], r = ne({
|
|
2398
|
+
layout: de({
|
|
2399
|
+
delta: a - c,
|
|
2125
2400
|
initialLayout: e,
|
|
2126
2401
|
panelConstraints: t,
|
|
2127
|
-
pivotIndices:
|
|
2402
|
+
pivotIndices: u,
|
|
2128
2403
|
prevLayout: e
|
|
2129
2404
|
}),
|
|
2130
2405
|
panelConstraints: t
|
|
@@ -2132,110 +2407,132 @@ function tn({
|
|
|
2132
2407
|
}
|
|
2133
2408
|
return {
|
|
2134
2409
|
valueControls: n,
|
|
2135
|
-
valueMax:
|
|
2136
|
-
valueMin:
|
|
2137
|
-
valueNow:
|
|
2410
|
+
valueMax: r,
|
|
2411
|
+
valueMin: i,
|
|
2412
|
+
valueNow: c
|
|
2138
2413
|
};
|
|
2139
2414
|
}
|
|
2140
|
-
function
|
|
2415
|
+
function yn({
|
|
2141
2416
|
children: e,
|
|
2142
2417
|
className: t,
|
|
2143
2418
|
disabled: n,
|
|
2144
2419
|
disableDoubleClick: o,
|
|
2145
|
-
elementRef:
|
|
2146
|
-
id:
|
|
2147
|
-
|
|
2420
|
+
elementRef: r,
|
|
2421
|
+
id: i,
|
|
2422
|
+
preview: c,
|
|
2423
|
+
style: l,
|
|
2148
2424
|
...a
|
|
2149
2425
|
}) {
|
|
2150
|
-
const
|
|
2426
|
+
const s = Te(i), u = De({
|
|
2151
2427
|
disabled: n,
|
|
2152
|
-
disableDoubleClick: o
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2428
|
+
disableDoubleClick: o,
|
|
2429
|
+
children: e,
|
|
2430
|
+
className: t,
|
|
2431
|
+
preview: c,
|
|
2432
|
+
style: l
|
|
2433
|
+
}), [f, d] = Z({}), [v, z] = Z("inactive"), [p, h] = Z(!1), g = D(null), y = D(null), m = Oe(g, r), {
|
|
2434
|
+
disableCursor: b,
|
|
2435
|
+
id: x,
|
|
2436
|
+
orientation: L,
|
|
2437
|
+
registerSeparator: w,
|
|
2438
|
+
updateSeparatorProps: C
|
|
2439
|
+
} = be(), M = L === "horizontal" ? "vertical" : "horizontal";
|
|
2440
|
+
j(() => {
|
|
2441
|
+
const E = g.current;
|
|
2442
|
+
if (E !== null) {
|
|
2443
|
+
const N = {
|
|
2444
|
+
disabled: u.disabled,
|
|
2445
|
+
disableDoubleClick: u.disableDoubleClick,
|
|
2446
|
+
element: E,
|
|
2447
|
+
id: s,
|
|
2448
|
+
get children() {
|
|
2449
|
+
return u.children;
|
|
2450
|
+
},
|
|
2451
|
+
get className() {
|
|
2452
|
+
return u.className;
|
|
2453
|
+
},
|
|
2454
|
+
get preview() {
|
|
2455
|
+
return u.preview;
|
|
2456
|
+
},
|
|
2457
|
+
get style() {
|
|
2458
|
+
return u.style;
|
|
2459
|
+
}
|
|
2460
|
+
};
|
|
2461
|
+
y.current = N;
|
|
2462
|
+
const _ = w(N), S = nt(
|
|
2463
|
+
(I) => {
|
|
2464
|
+
z(
|
|
2465
|
+
I.next.state !== "inactive" && I.next.hitRegions.some(
|
|
2466
|
+
(F) => F.separator === N
|
|
2467
|
+
) ? I.next.state : "inactive"
|
|
2174
2468
|
);
|
|
2175
2469
|
}
|
|
2176
|
-
),
|
|
2177
|
-
|
|
2178
|
-
(
|
|
2179
|
-
const { derivedPanelConstraints:
|
|
2180
|
-
if (
|
|
2181
|
-
const
|
|
2182
|
-
(
|
|
2470
|
+
), P = Ee(
|
|
2471
|
+
x,
|
|
2472
|
+
(I) => {
|
|
2473
|
+
const { derivedPanelConstraints: F, layout: $, separatorToPanels: Y } = I.next, oe = Y.get(N);
|
|
2474
|
+
if (oe) {
|
|
2475
|
+
const le = oe[0], xe = F.findIndex(
|
|
2476
|
+
(J) => J.panelId === le.id
|
|
2183
2477
|
);
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
layout:
|
|
2187
|
-
panelConstraints:
|
|
2188
|
-
panelId:
|
|
2189
|
-
panelIndex:
|
|
2478
|
+
d(
|
|
2479
|
+
gn({
|
|
2480
|
+
layout: $,
|
|
2481
|
+
panelConstraints: F,
|
|
2482
|
+
panelId: le.id,
|
|
2483
|
+
panelIndex: xe
|
|
2190
2484
|
})
|
|
2191
2485
|
);
|
|
2192
2486
|
}
|
|
2193
2487
|
}
|
|
2194
2488
|
);
|
|
2195
2489
|
return () => {
|
|
2196
|
-
|
|
2490
|
+
y.current = null, S(), P(), _();
|
|
2197
2491
|
};
|
|
2198
2492
|
}
|
|
2199
|
-
}, [
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2493
|
+
}, [x, s, w, u]), j(() => {
|
|
2494
|
+
const E = y.current;
|
|
2495
|
+
E && Ot(E);
|
|
2496
|
+
}, [c]), Se(() => {
|
|
2497
|
+
C(s, { disabled: n, disableDoubleClick: o });
|
|
2498
|
+
}, [n, o, s, C]);
|
|
2499
|
+
let T;
|
|
2500
|
+
n && !b && (T = "not-allowed");
|
|
2204
2501
|
let G;
|
|
2205
2502
|
if (n)
|
|
2206
2503
|
G = "disabled";
|
|
2207
2504
|
else
|
|
2208
|
-
switch (
|
|
2505
|
+
switch (v) {
|
|
2209
2506
|
case "active": {
|
|
2210
2507
|
G = "active";
|
|
2211
2508
|
break;
|
|
2212
2509
|
}
|
|
2213
2510
|
default:
|
|
2214
|
-
|
|
2511
|
+
p ? G = "focus" : G = v;
|
|
2215
2512
|
}
|
|
2216
|
-
return /* @__PURE__ */
|
|
2513
|
+
return /* @__PURE__ */ B(
|
|
2217
2514
|
"div",
|
|
2218
2515
|
{
|
|
2219
2516
|
...a,
|
|
2220
|
-
"aria-controls":
|
|
2517
|
+
"aria-controls": f.valueControls,
|
|
2221
2518
|
"aria-disabled": n || void 0,
|
|
2222
|
-
"aria-orientation":
|
|
2223
|
-
"aria-valuemax":
|
|
2224
|
-
"aria-valuemin":
|
|
2225
|
-
"aria-valuenow":
|
|
2519
|
+
"aria-orientation": M,
|
|
2520
|
+
"aria-valuemax": f.valueMax,
|
|
2521
|
+
"aria-valuemin": f.valueMin,
|
|
2522
|
+
"aria-valuenow": f.valueNow,
|
|
2226
2523
|
children: e,
|
|
2227
2524
|
className: t,
|
|
2228
2525
|
"data-separator": G,
|
|
2229
|
-
"data-testid":
|
|
2230
|
-
id:
|
|
2231
|
-
onBlur: () =>
|
|
2232
|
-
onFocus: () =>
|
|
2233
|
-
ref:
|
|
2526
|
+
"data-testid": s,
|
|
2527
|
+
id: s,
|
|
2528
|
+
onBlur: () => h(!1),
|
|
2529
|
+
onFocus: () => h(!0),
|
|
2530
|
+
ref: m,
|
|
2234
2531
|
role: "separator",
|
|
2235
2532
|
style: {
|
|
2236
2533
|
flexBasis: "auto",
|
|
2237
|
-
cursor:
|
|
2238
|
-
...
|
|
2534
|
+
cursor: T,
|
|
2535
|
+
...l,
|
|
2239
2536
|
flexGrow: 0,
|
|
2240
2537
|
flexShrink: 0,
|
|
2241
2538
|
// Inform the browser that the library is handling touch events for this element
|
|
@@ -2246,16 +2543,17 @@ function nn({
|
|
|
2246
2543
|
}
|
|
2247
2544
|
);
|
|
2248
2545
|
}
|
|
2249
|
-
|
|
2546
|
+
yn.displayName = "Separator";
|
|
2250
2547
|
export {
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2548
|
+
un as Group,
|
|
2549
|
+
hn as Panel,
|
|
2550
|
+
yn as Separator,
|
|
2551
|
+
yt as SeparatorOverlay,
|
|
2552
|
+
$t as isCoarsePointer,
|
|
2553
|
+
xn as useDefaultLayout,
|
|
2554
|
+
zn as useGroupCallbackRef,
|
|
2555
|
+
wn as useGroupRef,
|
|
2556
|
+
Pn as usePanelCallbackRef,
|
|
2557
|
+
Ln as usePanelRef
|
|
2260
2558
|
};
|
|
2261
2559
|
//# sourceMappingURL=react-resizable-panels.js.map
|