react-resizable-panels 4.13.3 → 4.14.1
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,146 +1,360 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import {
|
|
4
|
-
function
|
|
5
|
-
const
|
|
6
|
-
return
|
|
2
|
+
import { jsx as W, jsxs as un } from "react/jsx-runtime";
|
|
3
|
+
import { useId as dn, useLayoutEffect as Ot, useEffect as qe, useRef as q, useCallback as te, createContext as Nt, useContext as Gt, useState as he, useMemo as Ee, useImperativeHandle as it, useSyncExternalStore as Ke, Children as fn, isValidElement as _t } from "react";
|
|
4
|
+
function ke(e) {
|
|
5
|
+
const t = dn();
|
|
6
|
+
return `${e ?? t}`;
|
|
7
7
|
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
const ne = typeof window < "u" ? Ot : qe;
|
|
9
|
+
function ge(e) {
|
|
10
|
+
const t = q(e);
|
|
11
|
+
return ne(() => {
|
|
12
|
+
t.current = e;
|
|
13
|
+
}, [e]), te(
|
|
14
|
+
(...n) => t.current?.(...n),
|
|
15
|
+
[t]
|
|
16
|
+
);
|
|
11
17
|
}
|
|
12
|
-
function
|
|
13
|
-
return
|
|
18
|
+
function Be(...e) {
|
|
19
|
+
return ge((t) => {
|
|
20
|
+
e.forEach((n) => {
|
|
21
|
+
if (n)
|
|
22
|
+
switch (typeof n) {
|
|
23
|
+
case "function": {
|
|
24
|
+
n(t);
|
|
25
|
+
break;
|
|
26
|
+
}
|
|
27
|
+
case "object": {
|
|
28
|
+
n.current = t;
|
|
29
|
+
break;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
});
|
|
14
34
|
}
|
|
15
|
-
function
|
|
16
|
-
return
|
|
35
|
+
function et(e, t) {
|
|
36
|
+
return t ? e * 2 + 1 : e + 1;
|
|
17
37
|
}
|
|
18
|
-
function
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
38
|
+
function mn(e, t) {
|
|
39
|
+
return t ? e * 2 - 1 : e;
|
|
40
|
+
}
|
|
41
|
+
function mt(e, t, n) {
|
|
42
|
+
const o = et(e, n);
|
|
43
|
+
return t === void 0 ? `${o} / -1` : `${o} / span ${mn(t, n)}`;
|
|
44
|
+
}
|
|
45
|
+
function pn(e) {
|
|
46
|
+
return `${e * 2} / span 1`;
|
|
47
|
+
}
|
|
48
|
+
function hn({
|
|
49
|
+
crossCount: e,
|
|
50
|
+
crossSpan: t,
|
|
51
|
+
crossStart: n,
|
|
52
|
+
hasGutters: o
|
|
53
|
+
}) {
|
|
54
|
+
const r = t === void 0 ? e : n + t;
|
|
55
|
+
if (n === 0 && r === e)
|
|
56
|
+
return "1 / -1";
|
|
57
|
+
let i = et(n, o), s = et(r - 1, o) + 1;
|
|
58
|
+
return o && (n > 0 && i--, r < e && s++), `${i} / ${s}`;
|
|
59
|
+
}
|
|
60
|
+
function st(e, t) {
|
|
61
|
+
return Number.isInteger(e) && e >= 1 && e < t;
|
|
62
|
+
}
|
|
63
|
+
function A(e, t = "Assertion error") {
|
|
64
|
+
if (!e)
|
|
65
|
+
throw Error(t);
|
|
66
|
+
}
|
|
67
|
+
const Ft = Nt(null);
|
|
68
|
+
function qt() {
|
|
69
|
+
const e = Gt(Ft);
|
|
70
|
+
return A(
|
|
71
|
+
e,
|
|
72
|
+
"Grid Context not found; did you render a Cell or Gridline outside of a Grid?"
|
|
73
|
+
), e;
|
|
74
|
+
}
|
|
75
|
+
function gn({
|
|
76
|
+
children: e,
|
|
77
|
+
className: t,
|
|
78
|
+
column: n,
|
|
79
|
+
columnSpan: o = 1,
|
|
80
|
+
elementRef: r,
|
|
81
|
+
id: i,
|
|
82
|
+
row: s,
|
|
83
|
+
rowSpan: l = 1,
|
|
84
|
+
style: a,
|
|
85
|
+
...c
|
|
86
|
+
}) {
|
|
87
|
+
const u = ke(i), { gutters: d, registerCell: g } = qt(), m = q(null), y = Be(m, r);
|
|
88
|
+
return ne(() => {
|
|
89
|
+
const f = m.current;
|
|
90
|
+
if (f !== null)
|
|
91
|
+
return g({
|
|
92
|
+
column: n,
|
|
93
|
+
columnSpan: o,
|
|
94
|
+
element: f,
|
|
95
|
+
id: u,
|
|
96
|
+
row: s,
|
|
97
|
+
rowSpan: l
|
|
98
|
+
});
|
|
99
|
+
}, [n, o, u, g, s, l]), /* @__PURE__ */ W(
|
|
100
|
+
"div",
|
|
101
|
+
{
|
|
102
|
+
...c,
|
|
103
|
+
className: t,
|
|
104
|
+
"data-cell": !0,
|
|
105
|
+
"data-testid": u,
|
|
106
|
+
id: u,
|
|
107
|
+
ref: y,
|
|
108
|
+
style: {
|
|
109
|
+
overflow: "auto",
|
|
110
|
+
...a,
|
|
111
|
+
// Allow cells to shrink smaller than their content
|
|
112
|
+
minHeight: 0,
|
|
113
|
+
minWidth: 0,
|
|
114
|
+
gridColumn: mt(n, o, d.column),
|
|
115
|
+
gridRow: mt(s, l, d.row)
|
|
116
|
+
},
|
|
117
|
+
children: e
|
|
25
118
|
}
|
|
119
|
+
);
|
|
120
|
+
}
|
|
121
|
+
gn.displayName = "Cell";
|
|
122
|
+
let Ue;
|
|
123
|
+
function yn() {
|
|
124
|
+
return Ue === void 0 && (typeof matchMedia == "function" ? Ue = !!matchMedia("(pointer:coarse)").matches : Ue = !1), Ue;
|
|
125
|
+
}
|
|
126
|
+
function tt({
|
|
127
|
+
expandHitTargets: e,
|
|
128
|
+
axis: t,
|
|
129
|
+
rect: n
|
|
130
|
+
}) {
|
|
131
|
+
const o = e ? yn() ? t.resizeTargetMinimumSize.coarse : t.resizeTargetMinimumSize.fine : 0;
|
|
132
|
+
if (n.width < o) {
|
|
133
|
+
const r = o - n.width;
|
|
134
|
+
n = new DOMRect(
|
|
135
|
+
n.x - r / 2,
|
|
136
|
+
n.y,
|
|
137
|
+
n.width + r,
|
|
138
|
+
n.height
|
|
139
|
+
);
|
|
140
|
+
}
|
|
141
|
+
if (n.height < o) {
|
|
142
|
+
const r = o - n.height;
|
|
143
|
+
n = new DOMRect(
|
|
144
|
+
n.x,
|
|
145
|
+
n.y - r / 2,
|
|
146
|
+
n.width,
|
|
147
|
+
n.height + r
|
|
148
|
+
);
|
|
26
149
|
}
|
|
150
|
+
return n;
|
|
27
151
|
}
|
|
28
|
-
function
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
152
|
+
function pt({
|
|
153
|
+
axis: e,
|
|
154
|
+
cells: t,
|
|
155
|
+
index: n,
|
|
156
|
+
rect: o
|
|
32
157
|
}) {
|
|
33
|
-
let o;
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
158
|
+
let r = [o];
|
|
159
|
+
for (const i of t) {
|
|
160
|
+
const s = e === "column" ? i.column : i.row, l = e === "column" ? i.columnSpan : i.rowSpan;
|
|
161
|
+
if (s >= n || s + l <= n)
|
|
162
|
+
continue;
|
|
163
|
+
const a = i.element.getBoundingClientRect(), c = e === "column" ? a.top : a.left, u = e === "column" ? a.bottom : a.right;
|
|
164
|
+
u <= c || (r = r.flatMap((d) => {
|
|
165
|
+
const g = e === "column" ? d.top : d.left, m = e === "column" ? d.bottom : d.right;
|
|
166
|
+
if (c >= m || u <= g)
|
|
167
|
+
return [d];
|
|
168
|
+
const y = [], f = (S, p) => {
|
|
169
|
+
y.push(
|
|
170
|
+
e === "column" ? new DOMRect(d.x, S, d.width, p - S) : new DOMRect(S, d.y, p - S, d.height)
|
|
171
|
+
);
|
|
172
|
+
};
|
|
173
|
+
return g < c && f(g, c), m > u && f(u, m), y;
|
|
174
|
+
}));
|
|
175
|
+
}
|
|
176
|
+
return r;
|
|
177
|
+
}
|
|
178
|
+
function Sn({
|
|
179
|
+
axis: e,
|
|
180
|
+
cells: t,
|
|
181
|
+
crossTrackCount: n,
|
|
182
|
+
expandHitTargets: o,
|
|
183
|
+
resizeAxis: r,
|
|
184
|
+
axisSize: i,
|
|
185
|
+
includeDisabled: s,
|
|
186
|
+
separatorPlacements: l
|
|
187
|
+
}) {
|
|
188
|
+
const { items: a, separators: c } = r, u = a.length;
|
|
189
|
+
let d = -1, g = -1, m = 0;
|
|
190
|
+
if (a.forEach((b, x) => {
|
|
191
|
+
b.constraintProps.disabled || (m++, d === -1 && (d = x), g = x);
|
|
192
|
+
}), !s && m < 2)
|
|
193
|
+
return [];
|
|
194
|
+
const y = (b) => s || b > d && b <= g, f = [], S = (b, x, v) => ({
|
|
195
|
+
axis: r,
|
|
196
|
+
axisSize: i,
|
|
197
|
+
items: [a[b - 1], a[b]],
|
|
198
|
+
rect: x,
|
|
199
|
+
separator: v
|
|
200
|
+
}), p = (b, x) => {
|
|
201
|
+
let v;
|
|
202
|
+
for (const E of t) {
|
|
203
|
+
const P = e === "column" ? E.row : E.column, k = e === "column" ? E.rowSpan : E.columnSpan;
|
|
204
|
+
if (x === "start" ? P === b : P + k - 1 === b) {
|
|
205
|
+
const M = E.element.getBoundingClientRect();
|
|
206
|
+
if (x === "start") {
|
|
207
|
+
const z = e === "column" ? M.top : M.left;
|
|
208
|
+
v = v === void 0 ? z : Math.min(v, z);
|
|
209
|
+
} else {
|
|
210
|
+
const z = e === "column" ? M.bottom : M.right;
|
|
211
|
+
v = v === void 0 ? z : Math.max(v, z);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
43
214
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
215
|
+
return v;
|
|
216
|
+
}, h = /* @__PURE__ */ new Set();
|
|
217
|
+
for (const b of c) {
|
|
218
|
+
const x = l.get(b);
|
|
219
|
+
if (!x || x.index < 1 || x.index >= u || (h.add(x.index), !s && (b.disabled || b.element.hasAttribute("aria-disabled"))) || !y(x.index))
|
|
220
|
+
continue;
|
|
221
|
+
let v = b.element.getBoundingClientRect();
|
|
222
|
+
const { crossSpan: E, crossStart: P } = x, k = E === void 0 ? n : P + E;
|
|
223
|
+
let M = e === "column" ? v.top : v.left, z = e === "column" ? v.bottom : v.right;
|
|
224
|
+
if (P > 0) {
|
|
225
|
+
const I = p(P - 1, "end");
|
|
226
|
+
I !== void 0 && I < M && (M = I);
|
|
47
227
|
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
228
|
+
if (k < n) {
|
|
229
|
+
const I = p(k, "start");
|
|
230
|
+
I !== void 0 && I > z && (z = I);
|
|
51
231
|
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
232
|
+
v = e === "column" ? new DOMRect(v.x, M, v.width, z - M) : new DOMRect(M, v.y, z - M, v.height), v = tt({ expandHitTargets: o, axis: r, rect: v }), s ? f.push(S(x.index, v, b)) : pt({
|
|
233
|
+
axis: e,
|
|
234
|
+
cells: t,
|
|
235
|
+
index: x.index,
|
|
236
|
+
rect: v
|
|
237
|
+
}).forEach((I) => {
|
|
238
|
+
f.push(S(x.index, I, b));
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
const L = (b, x) => {
|
|
242
|
+
pt({
|
|
243
|
+
axis: e,
|
|
244
|
+
cells: t,
|
|
245
|
+
index: b,
|
|
246
|
+
rect: tt({ expandHitTargets: o, axis: r, rect: x })
|
|
247
|
+
}).forEach((v) => {
|
|
248
|
+
f.push(S(b, v));
|
|
249
|
+
});
|
|
250
|
+
}, w = Array.from(
|
|
251
|
+
{ length: n },
|
|
252
|
+
() => new Array(u)
|
|
253
|
+
);
|
|
254
|
+
for (const b of t) {
|
|
255
|
+
const [x, v, E, P] = e === "column" ? [b.column, b.columnSpan, b.row, b.rowSpan] : [b.row, b.rowSpan, b.column, b.columnSpan];
|
|
256
|
+
for (let k = Math.max(0, E); k < Math.min(n, E + P); k++)
|
|
257
|
+
for (let M = Math.max(0, x); M < Math.min(u, x + v); M++)
|
|
258
|
+
w[k][M] ??= b;
|
|
259
|
+
}
|
|
260
|
+
const C = /* @__PURE__ */ new Map(), O = (b) => {
|
|
261
|
+
let x = C.get(b);
|
|
262
|
+
if (!x) {
|
|
263
|
+
const v = b.element.getBoundingClientRect();
|
|
264
|
+
x = e === "column" ? {
|
|
265
|
+
crossEnd: v.bottom,
|
|
266
|
+
crossStart: v.top,
|
|
267
|
+
end: v.right,
|
|
268
|
+
start: v.left
|
|
269
|
+
} : {
|
|
270
|
+
crossEnd: v.right,
|
|
271
|
+
crossStart: v.left,
|
|
272
|
+
end: v.bottom,
|
|
273
|
+
start: v.top
|
|
274
|
+
}, C.set(b, x);
|
|
55
275
|
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
276
|
+
return x;
|
|
277
|
+
}, D = ({ crossEnd: b, crossStart: x, end: v, start: E }) => e === "column" ? new DOMRect(E, x, v - E, b - x) : new DOMRect(x, E, b - x, v - E);
|
|
278
|
+
for (let b = 1; b < u; b++) {
|
|
279
|
+
if (h.has(b) || !y(b))
|
|
280
|
+
continue;
|
|
281
|
+
let x;
|
|
282
|
+
for (let v = 0; v < n; v++) {
|
|
283
|
+
const E = w[v][b - 1], P = w[v][b];
|
|
284
|
+
let k;
|
|
285
|
+
if ((E || P) && E !== P) {
|
|
286
|
+
const M = E ? O(E) : void 0, z = P ? O(P) : void 0, I = M?.end ?? z.start, _ = z?.start ?? M.end, Y = Math.max(
|
|
287
|
+
M?.crossStart ?? -1 / 0,
|
|
288
|
+
z?.crossStart ?? -1 / 0
|
|
289
|
+
), J = Math.min(
|
|
290
|
+
M?.crossEnd ?? 1 / 0,
|
|
291
|
+
z?.crossEnd ?? 1 / 0
|
|
292
|
+
);
|
|
293
|
+
k = {
|
|
294
|
+
crossEnd: Math.max(Y, J),
|
|
295
|
+
crossStart: Y,
|
|
296
|
+
end: Math.max(I, _),
|
|
297
|
+
start: Math.min(I, _)
|
|
298
|
+
};
|
|
299
|
+
}
|
|
300
|
+
k ? x = x ? {
|
|
301
|
+
crossEnd: Math.max(x.crossEnd, k.crossEnd),
|
|
302
|
+
crossStart: Math.min(x.crossStart, k.crossStart),
|
|
303
|
+
end: Math.max(x.end, k.end),
|
|
304
|
+
start: Math.min(x.start, k.start)
|
|
305
|
+
} : k : x && (L(b, D(x)), x = void 0);
|
|
59
306
|
}
|
|
307
|
+
x && L(b, D(x));
|
|
60
308
|
}
|
|
61
|
-
return
|
|
62
|
-
}
|
|
63
|
-
function
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
309
|
+
return f;
|
|
310
|
+
}
|
|
311
|
+
function le(e) {
|
|
312
|
+
const t = parseFloat(e ?? "");
|
|
313
|
+
return Number.isFinite(t) ? t : 0;
|
|
314
|
+
}
|
|
315
|
+
function vn({
|
|
316
|
+
axis: e,
|
|
317
|
+
element: t,
|
|
318
|
+
gutterSizes: n,
|
|
319
|
+
hasGutters: o,
|
|
320
|
+
layout: r,
|
|
321
|
+
trackIds: i
|
|
68
322
|
}) {
|
|
69
|
-
const
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
minSize: 0,
|
|
81
|
-
maxSize: 100,
|
|
82
|
-
panelId: o.id
|
|
83
|
-
})) : t.map((o) => {
|
|
84
|
-
const { element: r, panelConstraints: i } = o;
|
|
85
|
-
let s = 0;
|
|
86
|
-
if (i.collapsedSize !== void 0) {
|
|
87
|
-
const f = ie({
|
|
88
|
-
groupSize: n,
|
|
89
|
-
panelElement: r,
|
|
90
|
-
styleProp: i.collapsedSize
|
|
91
|
-
});
|
|
92
|
-
s = F(f / n * 100);
|
|
93
|
-
}
|
|
94
|
-
let u;
|
|
95
|
-
if (i.collapsedThreshold !== void 0) {
|
|
96
|
-
const f = ie({
|
|
97
|
-
groupSize: n,
|
|
98
|
-
panelElement: r,
|
|
99
|
-
styleProp: i.collapsedThreshold
|
|
100
|
-
});
|
|
101
|
-
u = F(f / n * 100);
|
|
102
|
-
}
|
|
103
|
-
let c;
|
|
104
|
-
if (i.defaultSize !== void 0) {
|
|
105
|
-
const f = ie({
|
|
106
|
-
groupSize: n,
|
|
107
|
-
panelElement: r,
|
|
108
|
-
styleProp: i.defaultSize
|
|
109
|
-
});
|
|
110
|
-
c = F(f / n * 100);
|
|
111
|
-
}
|
|
112
|
-
let a = 0;
|
|
113
|
-
if (i.minSize !== void 0) {
|
|
114
|
-
const f = ie({
|
|
115
|
-
groupSize: n,
|
|
116
|
-
panelElement: r,
|
|
117
|
-
styleProp: i.minSize
|
|
118
|
-
});
|
|
119
|
-
a = F(f / n * 100);
|
|
323
|
+
const s = i.length, l = o ? s * 2 - 1 : s, a = t.ownerDocument.defaultView?.getComputedStyle(t), c = e === "column" ? a?.gridTemplateColumns : a?.gridTemplateRows;
|
|
324
|
+
if (c) {
|
|
325
|
+
const f = c.trim().split(/\s+/);
|
|
326
|
+
if (f.length === l && f.every((S) => /^-?[\d.]+px$/.test(S))) {
|
|
327
|
+
const S = i.map(
|
|
328
|
+
(p, h) => le(f[o ? h * 2 : h])
|
|
329
|
+
);
|
|
330
|
+
return {
|
|
331
|
+
availableSize: S.reduce((p, h) => p + h, 0),
|
|
332
|
+
trackSizes: S
|
|
333
|
+
};
|
|
120
334
|
}
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
335
|
+
}
|
|
336
|
+
const u = e === "column" ? t.offsetWidth : t.offsetHeight, d = e === "column" ? le(a?.paddingLeft) + le(a?.paddingRight) + le(a?.borderLeftWidth) + le(a?.borderRightWidth) : le(a?.paddingTop) + le(a?.paddingBottom) + le(a?.borderTopWidth) + le(a?.borderBottomWidth), g = le(e === "column" ? a?.columnGap : a?.rowGap), m = n.reduce((f, S) => f + S, 0), y = Math.max(
|
|
337
|
+
0,
|
|
338
|
+
u - d - g * Math.max(0, l - 1) - m
|
|
339
|
+
);
|
|
340
|
+
return {
|
|
341
|
+
availableSize: y,
|
|
342
|
+
trackSizes: i.map(
|
|
343
|
+
(f) => r && r[f] !== void 0 ? r[f] / 100 * y : y / s
|
|
344
|
+
)
|
|
345
|
+
};
|
|
346
|
+
}
|
|
347
|
+
function Bt(e) {
|
|
348
|
+
switch (typeof e) {
|
|
349
|
+
case "number":
|
|
350
|
+
return [e, "px"];
|
|
351
|
+
case "string": {
|
|
352
|
+
const t = parseFloat(e);
|
|
353
|
+
return e.endsWith("%") ? [t, "%"] : e.endsWith("px") ? [t, "px"] : e.endsWith("rem") ? [t, "rem"] : e.endsWith("em") ? [t, "em"] : e.endsWith("vh") ? [t, "vh"] : e.endsWith("vw") ? [t, "vw"] : [t, "%"];
|
|
129
354
|
}
|
|
130
|
-
|
|
131
|
-
groupResizeBehavior: i.groupResizeBehavior,
|
|
132
|
-
collapsedSize: s,
|
|
133
|
-
collapsedThreshold: u,
|
|
134
|
-
collapsible: i.collapsible === !0,
|
|
135
|
-
defaultSize: c,
|
|
136
|
-
disabled: i.disabled,
|
|
137
|
-
minSize: a,
|
|
138
|
-
maxSize: l,
|
|
139
|
-
panelId: o.id
|
|
140
|
-
};
|
|
141
|
-
});
|
|
355
|
+
}
|
|
142
356
|
}
|
|
143
|
-
class
|
|
357
|
+
class Vt {
|
|
144
358
|
#e = {};
|
|
145
359
|
addListener(t, n) {
|
|
146
360
|
const o = this.#e[t];
|
|
@@ -156,12 +370,12 @@ class ot {
|
|
|
156
370
|
else {
|
|
157
371
|
let r = !1, i = null;
|
|
158
372
|
const s = Array.from(o);
|
|
159
|
-
for (let
|
|
160
|
-
const
|
|
373
|
+
for (let l = 0; l < s.length; l++) {
|
|
374
|
+
const a = s[l];
|
|
161
375
|
try {
|
|
162
|
-
|
|
163
|
-
} catch (
|
|
164
|
-
i === null && (r = !0, i =
|
|
376
|
+
a.call(null, n);
|
|
377
|
+
} catch (c) {
|
|
378
|
+
i === null && (r = !0, i = c);
|
|
165
379
|
}
|
|
166
380
|
}
|
|
167
381
|
if (r)
|
|
@@ -179,74 +393,72 @@ class ot {
|
|
|
179
393
|
}
|
|
180
394
|
}
|
|
181
395
|
}
|
|
182
|
-
let
|
|
396
|
+
let B = {
|
|
183
397
|
cursorFlags: 0,
|
|
184
398
|
state: "inactive"
|
|
185
399
|
};
|
|
186
|
-
const
|
|
187
|
-
function
|
|
188
|
-
return
|
|
400
|
+
const at = new Vt();
|
|
401
|
+
function fe() {
|
|
402
|
+
return B;
|
|
189
403
|
}
|
|
190
|
-
function
|
|
191
|
-
return
|
|
404
|
+
function Ht(e) {
|
|
405
|
+
return at.addListener("change", e);
|
|
192
406
|
}
|
|
193
|
-
function
|
|
194
|
-
const r =
|
|
195
|
-
i.cursorFlags = e, i.state === "active" && (i.didPointerMove ||= o, i.previews = t, n && (i.previewLayoutMap = n)),
|
|
407
|
+
function bn(e, t = [], n, o = !1) {
|
|
408
|
+
const r = B, i = { ...B };
|
|
409
|
+
i.cursorFlags = e, i.state === "active" && (i.didPointerMove ||= o, i.previews = t, n && (i.previewLayoutMap = n)), B = i, at.emit("change", {
|
|
196
410
|
prev: r,
|
|
197
411
|
next: i
|
|
198
412
|
});
|
|
199
413
|
}
|
|
200
|
-
function
|
|
201
|
-
const t =
|
|
202
|
-
|
|
414
|
+
function de(e) {
|
|
415
|
+
const t = B;
|
|
416
|
+
B = e, t.state === "active" && e.state !== "active" && t.didPointerMove && t.hitRegions.forEach(({ separator: n }) => {
|
|
203
417
|
n && n.element.ownerDocument.activeElement === n.element && n.element.blur();
|
|
204
|
-
}),
|
|
418
|
+
}), at.emit("change", {
|
|
205
419
|
prev: t,
|
|
206
420
|
next: e
|
|
207
421
|
});
|
|
208
422
|
}
|
|
209
|
-
function
|
|
210
|
-
|
|
211
|
-
...
|
|
212
|
-
previews:
|
|
423
|
+
function xn(e) {
|
|
424
|
+
B.state !== "active" || !B.previews.some((t) => t.separator === e) || de({
|
|
425
|
+
...B,
|
|
426
|
+
previews: B.previews.map(
|
|
213
427
|
(t) => t.separator === e ? { ...t } : t
|
|
214
428
|
)
|
|
215
429
|
});
|
|
216
430
|
}
|
|
217
|
-
function
|
|
218
|
-
if (
|
|
431
|
+
function wn(e) {
|
|
432
|
+
if (B.state === "inactive")
|
|
219
433
|
return !1;
|
|
220
|
-
const t =
|
|
221
|
-
|
|
222
|
-
), n = k.state === "active" && k.previews.some((o) => o.group === e);
|
|
223
|
-
if (t.length === k.hitRegions.length && !n)
|
|
434
|
+
const t = B.hitRegions.filter((o) => o.axis !== e), n = B.state === "active" && B.previews.some((o) => o.axis === e);
|
|
435
|
+
if (t.length === B.hitRegions.length && !n)
|
|
224
436
|
return !1;
|
|
225
437
|
if (t.length === 0)
|
|
226
|
-
|
|
227
|
-
else if (
|
|
228
|
-
const o = new Map(
|
|
229
|
-
o.delete(e), r.delete(e),
|
|
230
|
-
...
|
|
438
|
+
de({ cursorFlags: 0, state: "inactive" });
|
|
439
|
+
else if (B.state === "active") {
|
|
440
|
+
const o = new Map(B.initialLayoutMap), r = new Map(B.previewLayoutMap);
|
|
441
|
+
o.delete(e), r.delete(e), de({
|
|
442
|
+
...B,
|
|
231
443
|
cursorFlags: 0,
|
|
232
444
|
hitRegions: t,
|
|
233
445
|
initialLayoutMap: o,
|
|
234
446
|
previewLayoutMap: r,
|
|
235
|
-
previews:
|
|
447
|
+
previews: B.previews.filter((i) => i.axis !== e)
|
|
236
448
|
});
|
|
237
449
|
} else
|
|
238
|
-
|
|
450
|
+
de({ ...B, hitRegions: t });
|
|
239
451
|
return !0;
|
|
240
452
|
}
|
|
241
|
-
const
|
|
242
|
-
},
|
|
243
|
-
let
|
|
244
|
-
function
|
|
245
|
-
return
|
|
453
|
+
const zn = (e) => e, Qe = () => {
|
|
454
|
+
}, jt = 1, Ut = 2, Wt = 4, Yt = 8, ht = 3, gt = 12;
|
|
455
|
+
let We;
|
|
456
|
+
function yt() {
|
|
457
|
+
return We === void 0 && (We = !1, typeof window < "u" && (window.navigator.userAgent.includes("Chrome") || window.navigator.userAgent.includes("Firefox")) && (We = !0)), We;
|
|
246
458
|
}
|
|
247
|
-
function
|
|
459
|
+
function In({
|
|
248
460
|
cursorFlags: e,
|
|
249
|
-
|
|
461
|
+
axes: t,
|
|
250
462
|
state: n
|
|
251
463
|
}) {
|
|
252
464
|
let o = 0, r = 0;
|
|
@@ -270,39 +482,39 @@ function At({
|
|
|
270
482
|
if (!(o === 0 && r === 0)) {
|
|
271
483
|
switch (n) {
|
|
272
484
|
case "active": {
|
|
273
|
-
if (e &&
|
|
274
|
-
const i = (e &
|
|
485
|
+
if (e && yt()) {
|
|
486
|
+
const i = (e & jt) !== 0, s = (e & Ut) !== 0, l = (e & Wt) !== 0, a = (e & Yt) !== 0;
|
|
275
487
|
if (i)
|
|
276
|
-
return
|
|
488
|
+
return l ? "se-resize" : a ? "ne-resize" : "e-resize";
|
|
277
489
|
if (s)
|
|
278
|
-
return
|
|
279
|
-
if (
|
|
490
|
+
return l ? "sw-resize" : a ? "nw-resize" : "w-resize";
|
|
491
|
+
if (l)
|
|
280
492
|
return "s-resize";
|
|
281
|
-
if (
|
|
493
|
+
if (a)
|
|
282
494
|
return "n-resize";
|
|
283
495
|
}
|
|
284
496
|
break;
|
|
285
497
|
}
|
|
286
498
|
}
|
|
287
|
-
return
|
|
499
|
+
return yt() ? o > 0 && r > 0 ? "move" : o > 0 ? "ew-resize" : "ns-resize" : o > 0 && r > 0 ? "grab" : o > 0 ? "col-resize" : "row-resize";
|
|
288
500
|
}
|
|
289
501
|
}
|
|
290
|
-
const
|
|
291
|
-
function
|
|
502
|
+
const St = /* @__PURE__ */ new WeakMap();
|
|
503
|
+
function Ge(e) {
|
|
292
504
|
if (!e.defaultView || !e.adoptedStyleSheets)
|
|
293
505
|
return;
|
|
294
|
-
let { prevStyle: t, styleSheet: n } =
|
|
506
|
+
let { prevStyle: t, styleSheet: n } = St.get(e) ?? {};
|
|
295
507
|
n === void 0 && (n = new e.defaultView.CSSStyleSheet(), e.adoptedStyleSheets && (Object.isExtensible(e.adoptedStyleSheets) ? e.adoptedStyleSheets.push(n) : e.adoptedStyleSheets = [
|
|
296
508
|
...e.adoptedStyleSheets,
|
|
297
509
|
n
|
|
298
510
|
]));
|
|
299
|
-
const o =
|
|
511
|
+
const o = fe();
|
|
300
512
|
switch (o.state) {
|
|
301
513
|
case "active":
|
|
302
514
|
case "hover": {
|
|
303
|
-
const r =
|
|
515
|
+
const r = In({
|
|
304
516
|
cursorFlags: o.cursorFlags,
|
|
305
|
-
|
|
517
|
+
axes: o.hitRegions.map((s) => s.axis),
|
|
306
518
|
state: o.state
|
|
307
519
|
}), i = `*, *:hover {cursor: ${r} !important; }`;
|
|
308
520
|
if (t === i)
|
|
@@ -315,36 +527,38 @@ function fe(e) {
|
|
|
315
527
|
break;
|
|
316
528
|
}
|
|
317
529
|
}
|
|
318
|
-
|
|
530
|
+
St.set(e, {
|
|
319
531
|
prevStyle: t,
|
|
320
532
|
styleSheet: n
|
|
321
533
|
});
|
|
322
534
|
}
|
|
323
|
-
function
|
|
324
|
-
|
|
325
|
-
|
|
535
|
+
function Pe({
|
|
536
|
+
axis: e
|
|
537
|
+
}) {
|
|
538
|
+
const { layoutStrategy: t, orientation: n, items: o } = e;
|
|
539
|
+
return t ? t.calculateAvailableSize() : o.reduce((r, i) => (r += n === "horizontal" ? i.element.offsetWidth : i.element.offsetHeight, r), 0);
|
|
326
540
|
}
|
|
327
|
-
function
|
|
541
|
+
function nt(e, t) {
|
|
328
542
|
return Array.from(t).sort((n, o) => {
|
|
329
|
-
const r = e === "horizontal" ?
|
|
543
|
+
const r = e === "horizontal" ? Ln(n, o) : Cn(n, o);
|
|
330
544
|
if (r !== 0)
|
|
331
545
|
return r;
|
|
332
546
|
const i = n.element.compareDocumentPosition(o.element);
|
|
333
547
|
return i & Node.DOCUMENT_POSITION_DISCONNECTED ? 0 : i & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : i & Node.DOCUMENT_POSITION_PRECEDING ? 1 : 0;
|
|
334
548
|
});
|
|
335
549
|
}
|
|
336
|
-
function
|
|
550
|
+
function Ln(e, t) {
|
|
337
551
|
const n = e.element.offsetLeft - t.element.offsetLeft;
|
|
338
552
|
return n !== 0 ? n : e.element.offsetWidth - t.element.offsetWidth;
|
|
339
553
|
}
|
|
340
|
-
function
|
|
554
|
+
function Cn(e, t) {
|
|
341
555
|
const n = e.element.offsetTop - t.element.offsetTop;
|
|
342
556
|
return n !== 0 ? n : e.element.offsetHeight - t.element.offsetHeight;
|
|
343
557
|
}
|
|
344
|
-
function
|
|
558
|
+
function ot(e) {
|
|
345
559
|
return e !== null && typeof e == "object" && "nodeType" in e && e.nodeType === Node.ELEMENT_NODE;
|
|
346
560
|
}
|
|
347
|
-
function
|
|
561
|
+
function Kt(e, t) {
|
|
348
562
|
return {
|
|
349
563
|
x: e.x >= t.left && e.x <= t.right ? 0 : Math.min(
|
|
350
564
|
Math.abs(e.x - t.left),
|
|
@@ -356,7 +570,7 @@ function ct(e, t) {
|
|
|
356
570
|
)
|
|
357
571
|
};
|
|
358
572
|
}
|
|
359
|
-
function
|
|
573
|
+
function Rn({
|
|
360
574
|
orientation: e,
|
|
361
575
|
rects: t,
|
|
362
576
|
targetRect: n
|
|
@@ -367,172 +581,281 @@ function $t({
|
|
|
367
581
|
};
|
|
368
582
|
let r, i = Number.MAX_VALUE;
|
|
369
583
|
for (const s of t) {
|
|
370
|
-
const { x:
|
|
371
|
-
|
|
584
|
+
const { x: l, y: a } = Kt(o, s), c = e === "horizontal" ? l : a;
|
|
585
|
+
c < i && (i = c, r = s);
|
|
372
586
|
}
|
|
373
|
-
return
|
|
587
|
+
return A(r, "No rect found"), r;
|
|
374
588
|
}
|
|
375
|
-
|
|
376
|
-
function Ht() {
|
|
377
|
-
return ge === void 0 && (typeof matchMedia == "function" ? ge = !!matchMedia("(pointer:coarse)").matches : ge = !1), ge;
|
|
378
|
-
}
|
|
379
|
-
function Ee({
|
|
589
|
+
function lt({
|
|
380
590
|
expandHitTargets: e = !0,
|
|
381
|
-
|
|
591
|
+
axis: t,
|
|
382
592
|
includeDisabled: n = !1
|
|
383
593
|
}) {
|
|
384
|
-
|
|
594
|
+
if (t.layoutStrategy)
|
|
595
|
+
return t.layoutStrategy.calculateHitRegions({
|
|
596
|
+
expandHitTargets: e,
|
|
597
|
+
axis: t,
|
|
598
|
+
includeDisabled: n
|
|
599
|
+
});
|
|
600
|
+
const { element: o, orientation: r, items: i, separators: s } = t, l = nt(
|
|
385
601
|
r,
|
|
386
|
-
Array.from(o.children).filter(
|
|
387
|
-
).map(({ element:
|
|
388
|
-
let
|
|
602
|
+
Array.from(o.children).filter(ot).filter((p) => !p.hasAttribute("data-resize-preview")).map((p) => ({ element: p }))
|
|
603
|
+
).map(({ element: p }) => p), a = [];
|
|
604
|
+
let c = !1, u = !1, d = -1, g, m = -1, y = 0, f, S = [];
|
|
389
605
|
{
|
|
390
|
-
let
|
|
391
|
-
for (const
|
|
392
|
-
|
|
606
|
+
let p = -1;
|
|
607
|
+
for (const h of l)
|
|
608
|
+
h.hasAttribute("data-panel") && (p++, h.hasAttribute("data-disabled") || (y++, d === -1 && (d = p), m = p));
|
|
393
609
|
}
|
|
394
|
-
if (n ||
|
|
395
|
-
let
|
|
396
|
-
for (const
|
|
397
|
-
if (
|
|
398
|
-
|
|
399
|
-
const
|
|
400
|
-
(
|
|
610
|
+
if (n || y > 1) {
|
|
611
|
+
let p = -1;
|
|
612
|
+
for (const h of l)
|
|
613
|
+
if (h.hasAttribute("data-panel")) {
|
|
614
|
+
p++;
|
|
615
|
+
const L = i.find(
|
|
616
|
+
(w) => w.element === h
|
|
401
617
|
);
|
|
402
|
-
if (
|
|
403
|
-
if (
|
|
404
|
-
const
|
|
405
|
-
let
|
|
406
|
-
if (
|
|
407
|
-
const
|
|
408
|
-
|
|
409
|
-
|
|
618
|
+
if (L) {
|
|
619
|
+
if (f) {
|
|
620
|
+
const w = f.element.getBoundingClientRect(), C = h.getBoundingClientRect();
|
|
621
|
+
let O;
|
|
622
|
+
if (u) {
|
|
623
|
+
const D = r === "horizontal" ? new DOMRect(
|
|
624
|
+
w.right,
|
|
625
|
+
w.top,
|
|
410
626
|
0,
|
|
411
|
-
|
|
627
|
+
w.height
|
|
412
628
|
) : new DOMRect(
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
629
|
+
w.left,
|
|
630
|
+
w.bottom,
|
|
631
|
+
w.width,
|
|
416
632
|
0
|
|
417
|
-
),
|
|
418
|
-
switch (
|
|
633
|
+
), b = r === "horizontal" ? new DOMRect(C.left, C.top, 0, C.height) : new DOMRect(C.left, C.top, C.width, 0);
|
|
634
|
+
switch (S.length) {
|
|
419
635
|
case 0: {
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
636
|
+
O = [
|
|
637
|
+
D,
|
|
638
|
+
b
|
|
423
639
|
];
|
|
424
640
|
break;
|
|
425
641
|
}
|
|
426
642
|
case 1: {
|
|
427
|
-
const
|
|
643
|
+
const x = S[0], v = Rn({
|
|
428
644
|
orientation: r,
|
|
429
|
-
rects: [
|
|
430
|
-
targetRect:
|
|
645
|
+
rects: [w, C],
|
|
646
|
+
targetRect: x.element.getBoundingClientRect()
|
|
431
647
|
});
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
648
|
+
O = [
|
|
649
|
+
x,
|
|
650
|
+
v === w ? b : D
|
|
435
651
|
];
|
|
436
652
|
break;
|
|
437
653
|
}
|
|
438
654
|
default: {
|
|
439
|
-
|
|
655
|
+
O = S;
|
|
440
656
|
break;
|
|
441
657
|
}
|
|
442
658
|
}
|
|
443
659
|
} else
|
|
444
|
-
|
|
660
|
+
S.length ? O = S : O = [
|
|
445
661
|
r === "horizontal" ? new DOMRect(
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
662
|
+
w.right,
|
|
663
|
+
C.top,
|
|
664
|
+
C.left - w.right,
|
|
665
|
+
C.height
|
|
450
666
|
) : new DOMRect(
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
667
|
+
C.left,
|
|
668
|
+
w.bottom,
|
|
669
|
+
C.width,
|
|
670
|
+
C.top - w.bottom
|
|
455
671
|
)
|
|
456
672
|
];
|
|
457
|
-
for (const
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
const O = R - w.height;
|
|
471
|
-
w = new DOMRect(
|
|
472
|
-
w.x,
|
|
473
|
-
w.y - O / 2,
|
|
474
|
-
w.width,
|
|
475
|
-
w.height + O
|
|
476
|
-
);
|
|
477
|
-
}
|
|
478
|
-
const N = h <= f || h > p;
|
|
479
|
-
(n || !a && !N) && (y ??= ae({ group: t }), c.push({
|
|
480
|
-
group: t,
|
|
481
|
-
groupSize: y,
|
|
482
|
-
panels: [d, x],
|
|
483
|
-
separator: "width" in E ? void 0 : E,
|
|
484
|
-
rect: w
|
|
485
|
-
})), a = !1;
|
|
673
|
+
for (const D of O) {
|
|
674
|
+
const b = tt({
|
|
675
|
+
expandHitTargets: e,
|
|
676
|
+
axis: t,
|
|
677
|
+
rect: "width" in D ? D : D.element.getBoundingClientRect()
|
|
678
|
+
}), x = p <= d || p > m;
|
|
679
|
+
(n || !c && !x) && (g ??= Pe({ axis: t }), a.push({
|
|
680
|
+
axis: t,
|
|
681
|
+
axisSize: g,
|
|
682
|
+
items: [f, L],
|
|
683
|
+
separator: "width" in D ? void 0 : D,
|
|
684
|
+
rect: b
|
|
685
|
+
})), c = !1;
|
|
486
686
|
}
|
|
487
687
|
}
|
|
488
|
-
|
|
688
|
+
u = !1, f = L, S = [];
|
|
489
689
|
}
|
|
490
|
-
} else if (
|
|
491
|
-
|
|
492
|
-
const
|
|
493
|
-
(
|
|
690
|
+
} else if (h.hasAttribute("data-separator")) {
|
|
691
|
+
h.ariaDisabled !== null && (c = !0);
|
|
692
|
+
const L = s.find(
|
|
693
|
+
(w) => w.element === h
|
|
494
694
|
);
|
|
495
|
-
|
|
695
|
+
L ? S.push(L) : (f = void 0, S = []);
|
|
496
696
|
} else
|
|
497
|
-
|
|
697
|
+
u = !0;
|
|
698
|
+
}
|
|
699
|
+
return a;
|
|
700
|
+
}
|
|
701
|
+
function Mn(e, t) {
|
|
702
|
+
const n = getComputedStyle(e), o = parseFloat(n.fontSize);
|
|
703
|
+
return t * o;
|
|
704
|
+
}
|
|
705
|
+
function En(e, t) {
|
|
706
|
+
const n = getComputedStyle(e.ownerDocument.documentElement), o = parseFloat(n.fontSize);
|
|
707
|
+
return t * o;
|
|
708
|
+
}
|
|
709
|
+
function Pn(e) {
|
|
710
|
+
return e / 100 * window.innerHeight;
|
|
711
|
+
}
|
|
712
|
+
function kn(e) {
|
|
713
|
+
return e / 100 * window.innerWidth;
|
|
714
|
+
}
|
|
715
|
+
function Le({
|
|
716
|
+
axisSize: e,
|
|
717
|
+
itemElement: t,
|
|
718
|
+
styleProp: n
|
|
719
|
+
}) {
|
|
720
|
+
let o;
|
|
721
|
+
const [r, i] = Bt(n);
|
|
722
|
+
switch (i) {
|
|
723
|
+
case "%": {
|
|
724
|
+
o = r / 100 * e;
|
|
725
|
+
break;
|
|
726
|
+
}
|
|
727
|
+
case "px": {
|
|
728
|
+
o = r;
|
|
729
|
+
break;
|
|
730
|
+
}
|
|
731
|
+
case "rem": {
|
|
732
|
+
o = En(t, r);
|
|
733
|
+
break;
|
|
734
|
+
}
|
|
735
|
+
case "em": {
|
|
736
|
+
o = Mn(t, r);
|
|
737
|
+
break;
|
|
738
|
+
}
|
|
739
|
+
case "vh": {
|
|
740
|
+
o = Pn(r);
|
|
741
|
+
break;
|
|
742
|
+
}
|
|
743
|
+
case "vw": {
|
|
744
|
+
o = kn(r);
|
|
745
|
+
break;
|
|
746
|
+
}
|
|
498
747
|
}
|
|
499
|
-
return
|
|
748
|
+
return o;
|
|
749
|
+
}
|
|
750
|
+
function X(e) {
|
|
751
|
+
return parseFloat(e.toFixed(3));
|
|
752
|
+
}
|
|
753
|
+
function rt(e) {
|
|
754
|
+
const { items: t } = e, n = Pe({ axis: e });
|
|
755
|
+
return n === 0 ? t.map((o) => ({
|
|
756
|
+
groupResizeBehavior: o.constraintProps.groupResizeBehavior,
|
|
757
|
+
collapsedSize: 0,
|
|
758
|
+
collapsible: o.constraintProps.collapsible === !0,
|
|
759
|
+
defaultSize: void 0,
|
|
760
|
+
disabled: o.constraintProps.disabled,
|
|
761
|
+
minSize: 0,
|
|
762
|
+
maxSize: 100,
|
|
763
|
+
itemId: o.id
|
|
764
|
+
})) : t.map((o) => {
|
|
765
|
+
const { element: r, constraintProps: i } = o;
|
|
766
|
+
let s = 0;
|
|
767
|
+
if (i.collapsedSize !== void 0) {
|
|
768
|
+
const d = Le({
|
|
769
|
+
axisSize: n,
|
|
770
|
+
itemElement: r,
|
|
771
|
+
styleProp: i.collapsedSize
|
|
772
|
+
});
|
|
773
|
+
s = X(d / n * 100);
|
|
774
|
+
}
|
|
775
|
+
let l;
|
|
776
|
+
if (i.collapsedThreshold !== void 0) {
|
|
777
|
+
const d = Le({
|
|
778
|
+
axisSize: n,
|
|
779
|
+
itemElement: r,
|
|
780
|
+
styleProp: i.collapsedThreshold
|
|
781
|
+
});
|
|
782
|
+
l = X(d / n * 100);
|
|
783
|
+
}
|
|
784
|
+
let a;
|
|
785
|
+
if (i.defaultSize !== void 0) {
|
|
786
|
+
const d = Le({
|
|
787
|
+
axisSize: n,
|
|
788
|
+
itemElement: r,
|
|
789
|
+
styleProp: i.defaultSize
|
|
790
|
+
});
|
|
791
|
+
a = X(d / n * 100);
|
|
792
|
+
}
|
|
793
|
+
let c = 0;
|
|
794
|
+
if (i.minSize !== void 0) {
|
|
795
|
+
const d = Le({
|
|
796
|
+
axisSize: n,
|
|
797
|
+
itemElement: r,
|
|
798
|
+
styleProp: i.minSize
|
|
799
|
+
});
|
|
800
|
+
c = X(d / n * 100);
|
|
801
|
+
}
|
|
802
|
+
let u = 100;
|
|
803
|
+
if (i.maxSize !== void 0) {
|
|
804
|
+
const d = Le({
|
|
805
|
+
axisSize: n,
|
|
806
|
+
itemElement: r,
|
|
807
|
+
styleProp: i.maxSize
|
|
808
|
+
});
|
|
809
|
+
u = X(d / n * 100);
|
|
810
|
+
}
|
|
811
|
+
return {
|
|
812
|
+
groupResizeBehavior: i.groupResizeBehavior,
|
|
813
|
+
collapsedSize: s,
|
|
814
|
+
collapsedThreshold: l,
|
|
815
|
+
collapsible: i.collapsible === !0,
|
|
816
|
+
defaultSize: a,
|
|
817
|
+
disabled: i.disabled,
|
|
818
|
+
minSize: c,
|
|
819
|
+
maxSize: u,
|
|
820
|
+
itemId: o.id
|
|
821
|
+
};
|
|
822
|
+
});
|
|
500
823
|
}
|
|
501
|
-
let
|
|
502
|
-
const
|
|
503
|
-
function
|
|
504
|
-
|
|
824
|
+
let ue = /* @__PURE__ */ new Map();
|
|
825
|
+
const Xt = new Vt();
|
|
826
|
+
function $n(e) {
|
|
827
|
+
ue = new Map(ue), ue.delete(e);
|
|
505
828
|
}
|
|
506
|
-
function
|
|
507
|
-
for (const [n] of
|
|
829
|
+
function Re(e, t) {
|
|
830
|
+
for (const [n] of ue)
|
|
508
831
|
if (n.id === e)
|
|
509
832
|
return n;
|
|
510
833
|
}
|
|
511
|
-
function
|
|
512
|
-
for (const [n, o] of
|
|
834
|
+
function ae(e, t) {
|
|
835
|
+
for (const [n, o] of ue)
|
|
513
836
|
if (n.id === e)
|
|
514
837
|
return o;
|
|
515
838
|
if (t)
|
|
516
839
|
throw Error(`Could not find data for Group with id ${e}`);
|
|
517
840
|
}
|
|
518
|
-
function
|
|
519
|
-
return
|
|
841
|
+
function Se() {
|
|
842
|
+
return ue;
|
|
520
843
|
}
|
|
521
|
-
function
|
|
522
|
-
return
|
|
523
|
-
n.
|
|
844
|
+
function _e(e, t) {
|
|
845
|
+
return Xt.addListener("axisChange", (n) => {
|
|
846
|
+
n.axis.id === e && t(n);
|
|
524
847
|
});
|
|
525
848
|
}
|
|
526
|
-
function
|
|
527
|
-
const o =
|
|
528
|
-
|
|
529
|
-
|
|
849
|
+
function me(e, t, n) {
|
|
850
|
+
const o = ue.get(e);
|
|
851
|
+
ue = new Map(ue), ue.set(e, t), Xt.emit("axisChange", {
|
|
852
|
+
axis: e,
|
|
530
853
|
isUserInteraction: n?.isUserInteraction === !0,
|
|
531
854
|
prev: o,
|
|
532
855
|
next: t
|
|
533
856
|
});
|
|
534
857
|
}
|
|
535
|
-
function
|
|
858
|
+
function Tn(e, t) {
|
|
536
859
|
if (e.length !== t.length)
|
|
537
860
|
return !1;
|
|
538
861
|
for (let n = 0; n < e.length; n++)
|
|
@@ -540,15 +863,15 @@ function jt(e, t) {
|
|
|
540
863
|
return !1;
|
|
541
864
|
return !0;
|
|
542
865
|
}
|
|
543
|
-
function
|
|
544
|
-
return Math.abs(
|
|
866
|
+
function U(e, t, n = 0) {
|
|
867
|
+
return Math.abs(X(e) - X(t)) <= n;
|
|
545
868
|
}
|
|
546
|
-
function
|
|
547
|
-
return
|
|
869
|
+
function ce(e, t) {
|
|
870
|
+
return U(e, t) ? 0 : e > t ? 1 : -1;
|
|
548
871
|
}
|
|
549
|
-
function
|
|
550
|
-
|
|
551
|
-
|
|
872
|
+
function Me({
|
|
873
|
+
overrideDisabledItems: e,
|
|
874
|
+
itemConstraints: t,
|
|
552
875
|
prevSize: n,
|
|
553
876
|
size: o
|
|
554
877
|
}) {
|
|
@@ -556,315 +879,317 @@ function se({
|
|
|
556
879
|
collapsedSize: r = 0,
|
|
557
880
|
collapsedThreshold: i,
|
|
558
881
|
collapsible: s,
|
|
559
|
-
disabled:
|
|
560
|
-
maxSize:
|
|
561
|
-
minSize:
|
|
882
|
+
disabled: l,
|
|
883
|
+
maxSize: a = 100,
|
|
884
|
+
minSize: c = 0
|
|
562
885
|
} = t;
|
|
563
|
-
if (
|
|
886
|
+
if (l && !e)
|
|
564
887
|
return n;
|
|
565
|
-
if (
|
|
888
|
+
if (ce(o, c) < 0)
|
|
566
889
|
if (s) {
|
|
567
|
-
const
|
|
568
|
-
|
|
890
|
+
const u = i ?? (c - r) / 2, d = ce(n, r) <= 0, g = d ? r + u : c - u, m = ce(o, g);
|
|
891
|
+
ce(o, r) <= 0 || m < 0 || i !== void 0 && d && m === 0 ? o = r : o = c;
|
|
569
892
|
} else
|
|
570
|
-
o =
|
|
571
|
-
return o = Math.min(
|
|
893
|
+
o = c;
|
|
894
|
+
return o = Math.min(a, o), o = X(o), o;
|
|
572
895
|
}
|
|
573
|
-
function
|
|
896
|
+
function Fe({
|
|
574
897
|
delta: e,
|
|
575
898
|
initialLayout: t,
|
|
576
|
-
|
|
899
|
+
itemConstraints: n,
|
|
577
900
|
pivotIndices: o,
|
|
578
901
|
prevLayout: r,
|
|
579
902
|
trigger: i
|
|
580
903
|
}) {
|
|
581
|
-
if (
|
|
904
|
+
if (U(e, 0))
|
|
582
905
|
return t;
|
|
583
|
-
const s = i === "imperative-api",
|
|
584
|
-
({
|
|
585
|
-
),
|
|
586
|
-
({
|
|
587
|
-
),
|
|
588
|
-
|
|
589
|
-
let
|
|
906
|
+
const s = i === "imperative-api", l = n.map(
|
|
907
|
+
({ itemId: y }) => t[y]
|
|
908
|
+
), a = n.map(
|
|
909
|
+
({ itemId: y }) => r[y]
|
|
910
|
+
), c = [...l], [u, d] = o;
|
|
911
|
+
A(u != null, "Invalid first pivot index"), A(d != null, "Invalid second pivot index");
|
|
912
|
+
let g = 0;
|
|
590
913
|
switch (i) {
|
|
591
914
|
case "keyboard": {
|
|
592
915
|
{
|
|
593
|
-
const
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
`Panel constraints not found for index ${
|
|
916
|
+
const y = e < 0 ? d : u, f = n[y];
|
|
917
|
+
A(
|
|
918
|
+
f,
|
|
919
|
+
`Panel constraints not found for index ${y}`
|
|
597
920
|
);
|
|
598
921
|
const {
|
|
599
|
-
collapsedSize:
|
|
600
|
-
collapsible:
|
|
601
|
-
minSize:
|
|
602
|
-
} =
|
|
603
|
-
if (
|
|
604
|
-
const
|
|
605
|
-
if (
|
|
606
|
-
|
|
607
|
-
`Previous layout not found for panel index ${
|
|
608
|
-
),
|
|
609
|
-
const
|
|
610
|
-
|
|
922
|
+
collapsedSize: S = 0,
|
|
923
|
+
collapsible: p,
|
|
924
|
+
minSize: h = 0
|
|
925
|
+
} = f;
|
|
926
|
+
if (p) {
|
|
927
|
+
const L = l[y];
|
|
928
|
+
if (A(
|
|
929
|
+
L != null,
|
|
930
|
+
`Previous layout not found for panel index ${y}`
|
|
931
|
+
), U(L, S)) {
|
|
932
|
+
const w = h - L;
|
|
933
|
+
ce(w, Math.abs(e)) > 0 && (e = e < 0 ? 0 - w : w);
|
|
611
934
|
}
|
|
612
935
|
}
|
|
613
936
|
}
|
|
614
937
|
{
|
|
615
|
-
const
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
`No panel constraints found for index ${
|
|
938
|
+
const y = e < 0 ? u : d, f = n[y];
|
|
939
|
+
A(
|
|
940
|
+
f,
|
|
941
|
+
`No panel constraints found for index ${y}`
|
|
619
942
|
);
|
|
620
943
|
const {
|
|
621
|
-
collapsedSize:
|
|
622
|
-
collapsible:
|
|
623
|
-
minSize:
|
|
624
|
-
} =
|
|
625
|
-
if (
|
|
626
|
-
const
|
|
627
|
-
if (
|
|
628
|
-
|
|
629
|
-
`Previous layout not found for panel index ${
|
|
630
|
-
),
|
|
631
|
-
const
|
|
632
|
-
|
|
944
|
+
collapsedSize: S = 0,
|
|
945
|
+
collapsible: p,
|
|
946
|
+
minSize: h = 0
|
|
947
|
+
} = f;
|
|
948
|
+
if (p) {
|
|
949
|
+
const L = l[y];
|
|
950
|
+
if (A(
|
|
951
|
+
L != null,
|
|
952
|
+
`Previous layout not found for panel index ${y}`
|
|
953
|
+
), U(L, h)) {
|
|
954
|
+
const w = L - S;
|
|
955
|
+
ce(w, Math.abs(e)) > 0 && (e = e < 0 ? 0 - w : w);
|
|
633
956
|
}
|
|
634
957
|
}
|
|
635
958
|
}
|
|
636
959
|
break;
|
|
637
960
|
}
|
|
638
961
|
default: {
|
|
639
|
-
const
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
`Panel constraints not found for index ${
|
|
962
|
+
const y = e < 0 ? d : u, f = n[y];
|
|
963
|
+
A(
|
|
964
|
+
f,
|
|
965
|
+
`Panel constraints not found for index ${y}`
|
|
643
966
|
);
|
|
644
|
-
const
|
|
645
|
-
if (
|
|
646
|
-
const
|
|
647
|
-
if (
|
|
648
|
-
const
|
|
649
|
-
|
|
967
|
+
const S = l[y], { collapsedSize: p, collapsedThreshold: h, collapsible: L, minSize: w } = f;
|
|
968
|
+
if (L && ce(S, w) < 0) {
|
|
969
|
+
const C = w - p, O = h ?? C / 2, D = S + Math.abs(e);
|
|
970
|
+
if (ce(D, w) < 0) {
|
|
971
|
+
const b = ce(Math.abs(e), O), x = h === void 0 && e < 0;
|
|
972
|
+
b > 0 || b === 0 && x ? e = e < 0 ? -C : C : e = 0;
|
|
650
973
|
}
|
|
651
974
|
}
|
|
652
975
|
break;
|
|
653
976
|
}
|
|
654
977
|
}
|
|
655
978
|
{
|
|
656
|
-
const
|
|
657
|
-
let
|
|
979
|
+
const y = e < 0 ? 1 : -1;
|
|
980
|
+
let f = e < 0 ? d : u, S = 0;
|
|
658
981
|
for (; ; ) {
|
|
659
|
-
const
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
`Previous layout not found for panel index ${
|
|
982
|
+
const h = l[f];
|
|
983
|
+
A(
|
|
984
|
+
h != null,
|
|
985
|
+
`Previous layout not found for panel index ${f}`
|
|
663
986
|
);
|
|
664
|
-
const
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
prevSize:
|
|
987
|
+
const w = Me({
|
|
988
|
+
overrideDisabledItems: s,
|
|
989
|
+
itemConstraints: n[f],
|
|
990
|
+
prevSize: h,
|
|
668
991
|
size: 100
|
|
669
|
-
}) -
|
|
670
|
-
if (
|
|
992
|
+
}) - h;
|
|
993
|
+
if (S += w, f += y, f < 0 || f >= n.length)
|
|
671
994
|
break;
|
|
672
995
|
}
|
|
673
|
-
const
|
|
674
|
-
e = e < 0 ? 0 -
|
|
996
|
+
const p = Math.min(Math.abs(e), Math.abs(S));
|
|
997
|
+
e = e < 0 ? 0 - p : p;
|
|
675
998
|
}
|
|
676
999
|
{
|
|
677
|
-
let
|
|
678
|
-
for (;
|
|
679
|
-
const
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
`Previous layout not found for panel index ${
|
|
1000
|
+
let f = e < 0 ? u : d;
|
|
1001
|
+
for (; f >= 0 && f < n.length; ) {
|
|
1002
|
+
const S = Math.abs(e) - Math.abs(g), p = l[f];
|
|
1003
|
+
A(
|
|
1004
|
+
p != null,
|
|
1005
|
+
`Previous layout not found for panel index ${f}`
|
|
683
1006
|
);
|
|
684
|
-
const
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
prevSize:
|
|
688
|
-
size:
|
|
1007
|
+
const h = p - S, L = Me({
|
|
1008
|
+
overrideDisabledItems: s,
|
|
1009
|
+
itemConstraints: n[f],
|
|
1010
|
+
prevSize: p,
|
|
1011
|
+
size: h
|
|
689
1012
|
});
|
|
690
|
-
if (!
|
|
1013
|
+
if (!U(p, L) && (g += p - L, c[f] = L, g.toFixed(3).localeCompare(Math.abs(e).toFixed(3), void 0, {
|
|
691
1014
|
numeric: !0
|
|
692
1015
|
}) >= 0))
|
|
693
1016
|
break;
|
|
694
|
-
e < 0 ?
|
|
1017
|
+
e < 0 ? f-- : f++;
|
|
695
1018
|
}
|
|
696
1019
|
}
|
|
697
|
-
if (
|
|
1020
|
+
if (Tn(a, c))
|
|
698
1021
|
return r;
|
|
699
1022
|
{
|
|
700
|
-
const
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
`Previous layout not found for panel index ${
|
|
1023
|
+
const y = e < 0 ? d : u, f = l[y];
|
|
1024
|
+
A(
|
|
1025
|
+
f != null,
|
|
1026
|
+
`Previous layout not found for panel index ${y}`
|
|
704
1027
|
);
|
|
705
|
-
const
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
prevSize:
|
|
709
|
-
size:
|
|
1028
|
+
const S = f + g, p = Me({
|
|
1029
|
+
overrideDisabledItems: s,
|
|
1030
|
+
itemConstraints: n[y],
|
|
1031
|
+
prevSize: f,
|
|
1032
|
+
size: S
|
|
710
1033
|
});
|
|
711
|
-
if (
|
|
712
|
-
let
|
|
713
|
-
for (;
|
|
714
|
-
const
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
`Previous layout not found for panel index ${
|
|
1034
|
+
if (c[y] = p, !U(p, S)) {
|
|
1035
|
+
let h = S - p, w = e < 0 ? d : u;
|
|
1036
|
+
for (; w >= 0 && w < n.length; ) {
|
|
1037
|
+
const C = c[w];
|
|
1038
|
+
A(
|
|
1039
|
+
C != null,
|
|
1040
|
+
`Previous layout not found for panel index ${w}`
|
|
718
1041
|
);
|
|
719
|
-
const
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
prevSize:
|
|
723
|
-
size:
|
|
1042
|
+
const O = C + h, D = Me({
|
|
1043
|
+
overrideDisabledItems: s,
|
|
1044
|
+
itemConstraints: n[w],
|
|
1045
|
+
prevSize: C,
|
|
1046
|
+
size: O
|
|
724
1047
|
});
|
|
725
|
-
if (
|
|
1048
|
+
if (U(C, D) || (h -= D - C, c[w] = D), U(h, 0))
|
|
726
1049
|
break;
|
|
727
|
-
e > 0 ?
|
|
1050
|
+
e > 0 ? w-- : w++;
|
|
728
1051
|
}
|
|
729
1052
|
}
|
|
730
1053
|
}
|
|
731
|
-
const
|
|
732
|
-
(
|
|
1054
|
+
const m = Object.values(c).reduce(
|
|
1055
|
+
(y, f) => f + y,
|
|
733
1056
|
0
|
|
734
1057
|
);
|
|
735
|
-
return
|
|
1058
|
+
return U(m, 100, 0.1) ? c.reduce((y, f, S) => (y[n[S].itemId] = f, y), {}) : r;
|
|
736
1059
|
}
|
|
737
|
-
function
|
|
1060
|
+
function se(e, t) {
|
|
738
1061
|
if (Object.keys(e).length !== Object.keys(t).length)
|
|
739
1062
|
return !1;
|
|
740
1063
|
for (const n in e)
|
|
741
|
-
if (t[n] === void 0 ||
|
|
1064
|
+
if (t[n] === void 0 || ce(e[n], t[n]) !== 0)
|
|
742
1065
|
return !1;
|
|
743
1066
|
return !0;
|
|
744
1067
|
}
|
|
745
|
-
function
|
|
1068
|
+
function ct({
|
|
746
1069
|
commit: e,
|
|
747
1070
|
document: t,
|
|
748
1071
|
event: n,
|
|
749
1072
|
hitRegions: o,
|
|
750
1073
|
initialLayoutMap: r,
|
|
751
|
-
|
|
1074
|
+
mountedAxes: i,
|
|
752
1075
|
pointerDownAtPoint: s,
|
|
753
|
-
prevCursorFlags:
|
|
1076
|
+
prevCursorFlags: l
|
|
754
1077
|
}) {
|
|
755
|
-
let
|
|
756
|
-
const
|
|
757
|
-
let
|
|
758
|
-
const
|
|
759
|
-
|
|
1078
|
+
let a = 0;
|
|
1079
|
+
const c = fe();
|
|
1080
|
+
let u = c.state === "active" ? c.previews : [];
|
|
1081
|
+
const d = new Map(
|
|
1082
|
+
c.state === "active" ? c.previewLayoutMap : void 0
|
|
760
1083
|
);
|
|
761
|
-
o.forEach((
|
|
762
|
-
const {
|
|
763
|
-
if (e &&
|
|
1084
|
+
o.forEach((y) => {
|
|
1085
|
+
const { axis: f, axisSize: S } = y, { orientation: p, items: h } = f;
|
|
1086
|
+
if (e && f.resizePreviewMode !== "separator")
|
|
764
1087
|
return;
|
|
765
|
-
const { disableCursor:
|
|
766
|
-
let
|
|
767
|
-
s ?
|
|
768
|
-
const
|
|
769
|
-
if (!
|
|
1088
|
+
const { disableCursor: L } = f.mutableState;
|
|
1089
|
+
let w = 0;
|
|
1090
|
+
s ? p === "horizontal" ? w = (n.clientX - s.x) / S * 100 : w = (n.clientY - s.y) / S * 100 : p === "horizontal" ? w = n.clientX < 0 ? -100 : 100 : w = n.clientY < 0 ? -100 : 100;
|
|
1091
|
+
const C = r.get(f), O = i.get(f);
|
|
1092
|
+
if (!C || !O)
|
|
770
1093
|
return;
|
|
771
1094
|
const {
|
|
772
|
-
defaultLayoutDeferred:
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
layout:
|
|
776
|
-
|
|
777
|
-
} =
|
|
778
|
-
if (
|
|
779
|
-
const
|
|
780
|
-
delta:
|
|
781
|
-
initialLayout:
|
|
782
|
-
|
|
783
|
-
pivotIndices:
|
|
784
|
-
prevLayout:
|
|
1095
|
+
defaultLayoutDeferred: D,
|
|
1096
|
+
derivedItemConstraints: b,
|
|
1097
|
+
axisSize: x,
|
|
1098
|
+
layout: v,
|
|
1099
|
+
separatorToItems: E
|
|
1100
|
+
} = O;
|
|
1101
|
+
if (b && v && E) {
|
|
1102
|
+
const P = f.resizePreviewMode === "separator" ? d.get(f) ?? v : v, k = Fe({
|
|
1103
|
+
delta: w,
|
|
1104
|
+
initialLayout: C,
|
|
1105
|
+
itemConstraints: b,
|
|
1106
|
+
pivotIndices: y.items.map((M) => h.indexOf(M)),
|
|
1107
|
+
prevLayout: P,
|
|
785
1108
|
trigger: "mouse-or-touch"
|
|
786
1109
|
});
|
|
787
|
-
if (
|
|
788
|
-
|
|
789
|
-
let
|
|
790
|
-
const
|
|
791
|
-
|
|
792
|
-
if (
|
|
793
|
-
return
|
|
794
|
-
const
|
|
795
|
-
return
|
|
1110
|
+
if (f.resizePreviewMode === "separator" && !e && !se(k, P)) {
|
|
1111
|
+
d.set(f, k);
|
|
1112
|
+
let M = 0;
|
|
1113
|
+
const z = h.map((I) => (M += k[I.id] - C[I.id], M * (S / 100)));
|
|
1114
|
+
u = u.map((I) => {
|
|
1115
|
+
if (I.axis !== f)
|
|
1116
|
+
return I;
|
|
1117
|
+
const _ = z[I.itemIndex];
|
|
1118
|
+
return _ === I.offset ? I : { ...I, offset: _ };
|
|
796
1119
|
});
|
|
797
1120
|
}
|
|
798
|
-
if (
|
|
799
|
-
switch (
|
|
1121
|
+
if (se(k, P) && w !== 0 && !L)
|
|
1122
|
+
switch (p) {
|
|
800
1123
|
case "horizontal": {
|
|
801
|
-
|
|
1124
|
+
a |= w < 0 ? jt : Ut;
|
|
802
1125
|
break;
|
|
803
1126
|
}
|
|
804
1127
|
case "vertical": {
|
|
805
|
-
|
|
1128
|
+
a |= w < 0 ? Wt : Yt;
|
|
806
1129
|
break;
|
|
807
1130
|
}
|
|
808
1131
|
}
|
|
809
|
-
(
|
|
810
|
-
defaultLayoutDeferred:
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
layout:
|
|
814
|
-
|
|
1132
|
+
(f.resizePreviewMode !== "separator" || e) && !se(k, v) && me(y.axis, {
|
|
1133
|
+
defaultLayoutDeferred: D,
|
|
1134
|
+
derivedItemConstraints: b,
|
|
1135
|
+
axisSize: x,
|
|
1136
|
+
layout: k,
|
|
1137
|
+
requestedAxisSize: x,
|
|
1138
|
+
requestedLayout: k,
|
|
1139
|
+
separatorToItems: E
|
|
815
1140
|
});
|
|
816
1141
|
}
|
|
817
1142
|
});
|
|
818
|
-
let
|
|
819
|
-
n.movementX === 0 ?
|
|
820
|
-
const
|
|
821
|
-
|
|
1143
|
+
let g = 0;
|
|
1144
|
+
n.movementX === 0 ? g |= l & ht : g |= a & ht, n.movementY === 0 ? g |= l & gt : g |= a & gt;
|
|
1145
|
+
const m = c.state === "active" && (n.clientX !== c.pointerDownAtPoint.x || n.clientY !== c.pointerDownAtPoint.y);
|
|
1146
|
+
bn(g, u, d, m), Ge(t);
|
|
822
1147
|
}
|
|
823
|
-
function
|
|
824
|
-
const n =
|
|
1148
|
+
function Jt(e, t) {
|
|
1149
|
+
const n = fe(), o = Se();
|
|
825
1150
|
let r = !1;
|
|
826
1151
|
switch (n.state) {
|
|
827
1152
|
case "active":
|
|
828
|
-
|
|
1153
|
+
ct({
|
|
829
1154
|
commit: !0,
|
|
830
1155
|
document: e,
|
|
831
1156
|
event: t,
|
|
832
1157
|
hitRegions: n.hitRegions,
|
|
833
1158
|
initialLayoutMap: n.initialLayoutMap,
|
|
834
|
-
|
|
1159
|
+
mountedAxes: o,
|
|
835
1160
|
pointerDownAtPoint: n.pointerDownAtPoint,
|
|
836
1161
|
prevCursorFlags: n.cursorFlags
|
|
837
|
-
}),
|
|
1162
|
+
}), de({
|
|
838
1163
|
cursorFlags: 0,
|
|
839
1164
|
state: "inactive"
|
|
840
|
-
}), n.hitRegions.length > 0 && (
|
|
841
|
-
if (!o.has(i.
|
|
1165
|
+
}), n.hitRegions.length > 0 && (Ge(e), r = !0, n.hitRegions.forEach((i) => {
|
|
1166
|
+
if (!o.has(i.axis))
|
|
842
1167
|
return;
|
|
843
|
-
const s =
|
|
844
|
-
|
|
1168
|
+
const s = ae(i.axis.id, !0);
|
|
1169
|
+
me(i.axis, s, {
|
|
845
1170
|
isUserInteraction: !0
|
|
846
1171
|
});
|
|
847
1172
|
}));
|
|
848
1173
|
}
|
|
849
1174
|
return r;
|
|
850
1175
|
}
|
|
851
|
-
function
|
|
852
|
-
e.defaultPrevented ||
|
|
1176
|
+
function vt(e) {
|
|
1177
|
+
e.defaultPrevented || Jt(e.currentTarget, e);
|
|
853
1178
|
}
|
|
854
|
-
function
|
|
1179
|
+
function An(e, t, n) {
|
|
855
1180
|
let o, r = {
|
|
856
1181
|
x: 1 / 0,
|
|
857
1182
|
y: 1 / 0
|
|
858
1183
|
};
|
|
859
1184
|
for (const i of t) {
|
|
860
|
-
const s =
|
|
1185
|
+
const s = Kt(n, i.rect);
|
|
861
1186
|
switch (e) {
|
|
862
1187
|
case "horizontal": {
|
|
863
|
-
s.x
|
|
1188
|
+
(s.x < r.x || s.x === r.x && s.y <= r.y) && (o = i, r = s);
|
|
864
1189
|
break;
|
|
865
1190
|
}
|
|
866
1191
|
case "vertical": {
|
|
867
|
-
s.y
|
|
1192
|
+
(s.y < r.y || s.y === r.y && s.x <= r.x) && (o = i, r = s);
|
|
868
1193
|
break;
|
|
869
1194
|
}
|
|
870
1195
|
}
|
|
@@ -874,318 +1199,320 @@ function Ut(e, t, n) {
|
|
|
874
1199
|
hitRegion: o
|
|
875
1200
|
} : void 0;
|
|
876
1201
|
}
|
|
877
|
-
function
|
|
1202
|
+
function Dn(e) {
|
|
878
1203
|
return e !== null && typeof e == "object" && "nodeType" in e && e.nodeType === Node.DOCUMENT_FRAGMENT_NODE;
|
|
879
1204
|
}
|
|
880
|
-
function
|
|
1205
|
+
function On(e, t) {
|
|
881
1206
|
if (e === t) throw new Error("Cannot compare node with itself");
|
|
882
1207
|
const n = {
|
|
883
|
-
a:
|
|
884
|
-
b:
|
|
1208
|
+
a: wt(e),
|
|
1209
|
+
b: wt(t)
|
|
885
1210
|
};
|
|
886
1211
|
let o;
|
|
887
1212
|
for (; n.a.at(-1) === n.b.at(-1); )
|
|
888
1213
|
o = n.a.pop(), n.b.pop();
|
|
889
|
-
|
|
1214
|
+
A(
|
|
890
1215
|
o,
|
|
891
1216
|
"Stacking order can only be calculated for elements with a common ancestor"
|
|
892
1217
|
);
|
|
893
1218
|
const r = {
|
|
894
|
-
a:
|
|
895
|
-
b:
|
|
1219
|
+
a: xt(bt(n.a)),
|
|
1220
|
+
b: xt(bt(n.b))
|
|
896
1221
|
};
|
|
897
1222
|
if (r.a === r.b) {
|
|
898
1223
|
const i = o.childNodes, s = {
|
|
899
1224
|
a: n.a.at(-1),
|
|
900
1225
|
b: n.b.at(-1)
|
|
901
1226
|
};
|
|
902
|
-
let
|
|
903
|
-
for (;
|
|
904
|
-
const
|
|
905
|
-
if (
|
|
906
|
-
if (
|
|
1227
|
+
let l = i.length;
|
|
1228
|
+
for (; l--; ) {
|
|
1229
|
+
const a = i[l];
|
|
1230
|
+
if (a === s.a) return 1;
|
|
1231
|
+
if (a === s.b) return -1;
|
|
907
1232
|
}
|
|
908
1233
|
}
|
|
909
1234
|
return Math.sign(r.a - r.b);
|
|
910
1235
|
}
|
|
911
|
-
const
|
|
912
|
-
function
|
|
913
|
-
const t = getComputedStyle(
|
|
1236
|
+
const Nn = /\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;
|
|
1237
|
+
function Gn(e) {
|
|
1238
|
+
const t = getComputedStyle(Zt(e) ?? e).display;
|
|
914
1239
|
return t === "flex" || t === "inline-flex";
|
|
915
1240
|
}
|
|
916
|
-
function
|
|
1241
|
+
function _n(e) {
|
|
917
1242
|
const t = getComputedStyle(e);
|
|
918
|
-
return !!(t.position === "fixed" || t.zIndex !== "auto" && (t.position !== "static" ||
|
|
1243
|
+
return !!(t.position === "fixed" || t.zIndex !== "auto" && (t.position !== "static" || Gn(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" || Nn.test(t.willChange) || t.webkitOverflowScrolling === "touch");
|
|
919
1244
|
}
|
|
920
|
-
function
|
|
1245
|
+
function bt(e) {
|
|
921
1246
|
let t = e.length;
|
|
922
1247
|
for (; t--; ) {
|
|
923
1248
|
const n = e[t];
|
|
924
|
-
if (
|
|
1249
|
+
if (A(n, "Missing node"), _n(n)) return n;
|
|
925
1250
|
}
|
|
926
1251
|
return null;
|
|
927
1252
|
}
|
|
928
|
-
function
|
|
1253
|
+
function xt(e) {
|
|
929
1254
|
return e && Number(getComputedStyle(e).zIndex) || 0;
|
|
930
1255
|
}
|
|
931
|
-
function
|
|
1256
|
+
function wt(e) {
|
|
932
1257
|
const t = [];
|
|
933
1258
|
for (; e; )
|
|
934
|
-
t.push(e), e =
|
|
1259
|
+
t.push(e), e = Zt(e);
|
|
935
1260
|
return t;
|
|
936
1261
|
}
|
|
937
|
-
function
|
|
1262
|
+
function Zt(e) {
|
|
938
1263
|
const { parentNode: t } = e;
|
|
939
|
-
return
|
|
1264
|
+
return Dn(t) ? t.host : t;
|
|
940
1265
|
}
|
|
941
|
-
function
|
|
1266
|
+
function Fn(e, t) {
|
|
942
1267
|
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;
|
|
943
1268
|
}
|
|
944
|
-
function
|
|
1269
|
+
function qn(e) {
|
|
945
1270
|
try {
|
|
946
1271
|
return e.matches(":modal");
|
|
947
1272
|
} catch {
|
|
948
1273
|
return !1;
|
|
949
1274
|
}
|
|
950
1275
|
}
|
|
951
|
-
function
|
|
952
|
-
|
|
1276
|
+
function Bn({
|
|
1277
|
+
axisElement: e,
|
|
953
1278
|
hitRegion: t,
|
|
954
1279
|
pointerEventTarget: n
|
|
955
1280
|
}) {
|
|
956
|
-
if (
|
|
1281
|
+
if (ot(n)) {
|
|
957
1282
|
const o = n.closest("dialog");
|
|
958
|
-
if (o && !o.contains(e) &&
|
|
1283
|
+
if (o && !o.contains(e) && qn(o))
|
|
959
1284
|
return !1;
|
|
960
1285
|
}
|
|
961
|
-
if (!
|
|
1286
|
+
if (!ot(n) || n.contains(e) || e.contains(n))
|
|
962
1287
|
return !0;
|
|
963
|
-
if (
|
|
1288
|
+
if (On(n, e) > 0) {
|
|
964
1289
|
let o = n;
|
|
965
1290
|
for (; o; ) {
|
|
966
1291
|
if (o.contains(e))
|
|
967
1292
|
return !0;
|
|
968
|
-
if (
|
|
1293
|
+
if (Fn(o.getBoundingClientRect(), t))
|
|
969
1294
|
return !1;
|
|
970
1295
|
o = o.parentElement;
|
|
971
1296
|
}
|
|
972
1297
|
}
|
|
973
1298
|
return !0;
|
|
974
1299
|
}
|
|
975
|
-
function
|
|
1300
|
+
function ut(e, t) {
|
|
976
1301
|
const n = [];
|
|
977
1302
|
return t.forEach((o, r) => {
|
|
978
1303
|
if (r.disabled)
|
|
979
1304
|
return;
|
|
980
|
-
const i =
|
|
1305
|
+
const i = lt({ axis: r }), s = An(r.orientation, i, {
|
|
981
1306
|
x: e.clientX,
|
|
982
1307
|
y: e.clientY
|
|
983
1308
|
});
|
|
984
|
-
s && s.distance.x <= 0 && s.distance.y <= 0 &&
|
|
985
|
-
|
|
1309
|
+
s && s.distance.x <= 0 && s.distance.y <= 0 && Bn({
|
|
1310
|
+
axisElement: r.element,
|
|
986
1311
|
hitRegion: s.hitRegion.rect,
|
|
987
1312
|
pointerEventTarget: e.target
|
|
988
1313
|
}) && n.push(s.hitRegion);
|
|
989
1314
|
}), n;
|
|
990
1315
|
}
|
|
991
|
-
function
|
|
1316
|
+
function ye({
|
|
992
1317
|
layout: e,
|
|
993
|
-
|
|
1318
|
+
itemConstraints: t
|
|
994
1319
|
}) {
|
|
995
|
-
const n = t.map(({
|
|
996
|
-
(s,
|
|
1320
|
+
const n = t.map(({ itemId: s }) => e[s]), o = [...n], r = o.reduce(
|
|
1321
|
+
(s, l) => s + l,
|
|
997
1322
|
0
|
|
998
1323
|
);
|
|
999
1324
|
if (Object.keys(e).length !== t.length)
|
|
1000
1325
|
throw Error(
|
|
1001
1326
|
`Invalid ${t.length} panel layout: ${Object.values(e).map((s) => `${s}%`).join(", ")}`
|
|
1002
1327
|
);
|
|
1003
|
-
if (!
|
|
1328
|
+
if (!U(r, 100) && o.length > 0)
|
|
1004
1329
|
for (let s = 0; s < t.length; s++) {
|
|
1005
|
-
const
|
|
1006
|
-
|
|
1007
|
-
const
|
|
1008
|
-
o[s] =
|
|
1330
|
+
const l = o[s];
|
|
1331
|
+
A(l != null, `No layout data found for index ${s}`);
|
|
1332
|
+
const a = 100 / r * l;
|
|
1333
|
+
o[s] = a;
|
|
1009
1334
|
}
|
|
1010
1335
|
let i = 0;
|
|
1011
1336
|
for (let s = 0; s < t.length; s++) {
|
|
1012
|
-
const
|
|
1013
|
-
|
|
1014
|
-
const
|
|
1015
|
-
|
|
1016
|
-
const
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
prevSize:
|
|
1020
|
-
size:
|
|
1337
|
+
const l = n[s];
|
|
1338
|
+
A(l != null, `No layout data found for index ${s}`);
|
|
1339
|
+
const a = o[s];
|
|
1340
|
+
A(a != null, `No layout data found for index ${s}`);
|
|
1341
|
+
const c = Me({
|
|
1342
|
+
overrideDisabledItems: !0,
|
|
1343
|
+
itemConstraints: t[s],
|
|
1344
|
+
prevSize: l,
|
|
1345
|
+
size: a
|
|
1021
1346
|
});
|
|
1022
|
-
|
|
1347
|
+
a != c && (i += a - c, o[s] = c);
|
|
1023
1348
|
}
|
|
1024
|
-
if (!
|
|
1349
|
+
if (!U(i, 0))
|
|
1025
1350
|
for (let s = 0; s < t.length; s++) {
|
|
1026
|
-
const
|
|
1027
|
-
|
|
1028
|
-
const
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
prevSize:
|
|
1032
|
-
size:
|
|
1351
|
+
const l = o[s];
|
|
1352
|
+
A(l != null, `No layout data found for index ${s}`);
|
|
1353
|
+
const a = l + i, c = Me({
|
|
1354
|
+
overrideDisabledItems: !0,
|
|
1355
|
+
itemConstraints: t[s],
|
|
1356
|
+
prevSize: l,
|
|
1357
|
+
size: a
|
|
1033
1358
|
});
|
|
1034
|
-
if (
|
|
1359
|
+
if (l !== c && (i -= c - l, o[s] = c, U(i, 0)))
|
|
1035
1360
|
break;
|
|
1036
1361
|
}
|
|
1037
|
-
return o.reduce((s,
|
|
1362
|
+
return o.reduce((s, l, a) => (s[t[a].itemId] = l, s), {});
|
|
1038
1363
|
}
|
|
1039
|
-
function
|
|
1040
|
-
|
|
1041
|
-
|
|
1364
|
+
function dt({
|
|
1365
|
+
axisId: e,
|
|
1366
|
+
itemId: t
|
|
1042
1367
|
}) {
|
|
1043
1368
|
const n = () => {
|
|
1044
|
-
const
|
|
1369
|
+
const a = Se();
|
|
1045
1370
|
for (const [
|
|
1046
|
-
|
|
1371
|
+
c,
|
|
1047
1372
|
{
|
|
1048
|
-
defaultLayoutDeferred:
|
|
1049
|
-
|
|
1050
|
-
layout:
|
|
1051
|
-
|
|
1052
|
-
|
|
1373
|
+
defaultLayoutDeferred: u,
|
|
1374
|
+
derivedItemConstraints: d,
|
|
1375
|
+
layout: g,
|
|
1376
|
+
axisSize: m,
|
|
1377
|
+
separatorToItems: y
|
|
1053
1378
|
}
|
|
1054
|
-
] of
|
|
1055
|
-
if (
|
|
1379
|
+
] of a)
|
|
1380
|
+
if (c.id === e)
|
|
1056
1381
|
return {
|
|
1057
|
-
defaultLayoutDeferred:
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
layout:
|
|
1062
|
-
|
|
1382
|
+
defaultLayoutDeferred: u,
|
|
1383
|
+
derivedItemConstraints: d,
|
|
1384
|
+
axis: c,
|
|
1385
|
+
axisSize: m,
|
|
1386
|
+
layout: g,
|
|
1387
|
+
separatorToItems: y
|
|
1063
1388
|
};
|
|
1064
1389
|
throw Error(`Group ${e} not found`);
|
|
1065
1390
|
}, o = () => {
|
|
1066
|
-
const
|
|
1067
|
-
(
|
|
1391
|
+
const a = n().derivedItemConstraints.find(
|
|
1392
|
+
(c) => c.itemId === t
|
|
1068
1393
|
);
|
|
1069
|
-
if (
|
|
1070
|
-
return
|
|
1394
|
+
if (a !== void 0)
|
|
1395
|
+
return a;
|
|
1071
1396
|
throw Error(`Panel constraints not found for Panel ${t}`);
|
|
1072
1397
|
}, r = () => {
|
|
1073
|
-
const
|
|
1074
|
-
if (
|
|
1075
|
-
return
|
|
1398
|
+
const a = n().axis.items.find((c) => c.id === t);
|
|
1399
|
+
if (a !== void 0)
|
|
1400
|
+
return a;
|
|
1076
1401
|
throw Error(`Layout not found for Panel ${t}`);
|
|
1077
1402
|
}, i = () => {
|
|
1078
|
-
const
|
|
1079
|
-
if (
|
|
1080
|
-
return
|
|
1403
|
+
const a = n().layout[t];
|
|
1404
|
+
if (a !== void 0)
|
|
1405
|
+
return a;
|
|
1081
1406
|
throw Error(`Layout not found for Panel ${t}`);
|
|
1082
1407
|
}, s = ({
|
|
1083
|
-
nextSize:
|
|
1084
|
-
|
|
1085
|
-
prevLayout:
|
|
1086
|
-
|
|
1408
|
+
nextSize: a,
|
|
1409
|
+
items: c,
|
|
1410
|
+
prevLayout: u,
|
|
1411
|
+
derivedItemConstraints: d
|
|
1087
1412
|
}) => {
|
|
1088
|
-
const
|
|
1089
|
-
if (
|
|
1090
|
-
const
|
|
1091
|
-
return
|
|
1413
|
+
const g = i(), m = c.findIndex((p) => p.id === t), y = m === 0, f = m === c.length - 1;
|
|
1414
|
+
if (f && a < g && (y || c.slice(0, m).every((p, h) => {
|
|
1415
|
+
const L = d[h];
|
|
1416
|
+
return L?.collapsible && U(L.collapsedSize, u[L.itemId]);
|
|
1092
1417
|
}))) {
|
|
1093
|
-
const
|
|
1418
|
+
const p = c.slice(0, m).reduce((h, L) => h + u[L.id], 0);
|
|
1094
1419
|
return {
|
|
1095
|
-
...
|
|
1096
|
-
[t]:
|
|
1420
|
+
...u,
|
|
1421
|
+
[t]: X(100 - p)
|
|
1097
1422
|
};
|
|
1098
1423
|
}
|
|
1099
|
-
return
|
|
1100
|
-
delta:
|
|
1101
|
-
initialLayout:
|
|
1102
|
-
|
|
1103
|
-
pivotIndices:
|
|
1104
|
-
prevLayout:
|
|
1424
|
+
return Fe({
|
|
1425
|
+
delta: f ? g - a : a - g,
|
|
1426
|
+
initialLayout: u,
|
|
1427
|
+
itemConstraints: d,
|
|
1428
|
+
pivotIndices: f ? [m - 1, m] : [m, m + 1],
|
|
1429
|
+
prevLayout: u,
|
|
1105
1430
|
trigger: "imperative-api"
|
|
1106
1431
|
});
|
|
1107
|
-
},
|
|
1108
|
-
const
|
|
1109
|
-
if (
|
|
1432
|
+
}, l = (a) => {
|
|
1433
|
+
const c = i();
|
|
1434
|
+
if (a === c)
|
|
1110
1435
|
return;
|
|
1111
1436
|
const {
|
|
1112
|
-
defaultLayoutDeferred:
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
layout:
|
|
1117
|
-
|
|
1118
|
-
} = n(),
|
|
1119
|
-
nextSize:
|
|
1120
|
-
|
|
1121
|
-
prevLayout:
|
|
1122
|
-
|
|
1123
|
-
}),
|
|
1124
|
-
layout:
|
|
1125
|
-
|
|
1437
|
+
defaultLayoutDeferred: u,
|
|
1438
|
+
derivedItemConstraints: d,
|
|
1439
|
+
axis: g,
|
|
1440
|
+
axisSize: m,
|
|
1441
|
+
layout: y,
|
|
1442
|
+
separatorToItems: f
|
|
1443
|
+
} = n(), S = s({
|
|
1444
|
+
nextSize: a,
|
|
1445
|
+
items: g.items,
|
|
1446
|
+
prevLayout: y,
|
|
1447
|
+
derivedItemConstraints: d
|
|
1448
|
+
}), p = ye({
|
|
1449
|
+
layout: S,
|
|
1450
|
+
itemConstraints: d
|
|
1126
1451
|
});
|
|
1127
|
-
|
|
1128
|
-
defaultLayoutDeferred:
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
layout:
|
|
1132
|
-
|
|
1452
|
+
se(y, p) || me(g, {
|
|
1453
|
+
defaultLayoutDeferred: u,
|
|
1454
|
+
derivedItemConstraints: d,
|
|
1455
|
+
axisSize: m,
|
|
1456
|
+
layout: p,
|
|
1457
|
+
requestedAxisSize: m,
|
|
1458
|
+
requestedLayout: p,
|
|
1459
|
+
separatorToItems: f
|
|
1133
1460
|
});
|
|
1134
1461
|
};
|
|
1135
1462
|
return {
|
|
1136
1463
|
collapse: () => {
|
|
1137
|
-
const { collapsible:
|
|
1138
|
-
|
|
1464
|
+
const { collapsible: a, collapsedSize: c } = o(), { mutableValues: u } = r(), d = i();
|
|
1465
|
+
a && d !== c && (u.expandToSize = d, l(c));
|
|
1139
1466
|
},
|
|
1140
1467
|
expand: () => {
|
|
1141
|
-
const { collapsible:
|
|
1142
|
-
if (
|
|
1143
|
-
let
|
|
1144
|
-
|
|
1468
|
+
const { collapsible: a, collapsedSize: c, minSize: u } = o(), { mutableValues: d } = r(), g = i();
|
|
1469
|
+
if (a && g === c) {
|
|
1470
|
+
let m = d.expandToSize ?? u;
|
|
1471
|
+
m === 0 && (m = 1), l(m);
|
|
1145
1472
|
}
|
|
1146
1473
|
},
|
|
1147
1474
|
getSize: () => {
|
|
1148
|
-
const {
|
|
1475
|
+
const { axis: a } = n(), c = i(), { element: u } = r(), d = a.layoutStrategy ? a.layoutStrategy.getItemSizeInPixels(t) : a.orientation === "horizontal" ? u.offsetWidth : u.offsetHeight;
|
|
1149
1476
|
return {
|
|
1150
|
-
asPercentage:
|
|
1151
|
-
inPixels:
|
|
1477
|
+
asPercentage: c,
|
|
1478
|
+
inPixels: d
|
|
1152
1479
|
};
|
|
1153
1480
|
},
|
|
1154
1481
|
isCollapsed: () => {
|
|
1155
|
-
const { collapsible:
|
|
1156
|
-
return
|
|
1482
|
+
const { collapsible: a, collapsedSize: c } = o(), u = i();
|
|
1483
|
+
return a && U(c, u);
|
|
1157
1484
|
},
|
|
1158
|
-
resize: (
|
|
1159
|
-
const {
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
styleProp:
|
|
1163
|
-
}),
|
|
1164
|
-
|
|
1485
|
+
resize: (a) => {
|
|
1486
|
+
const { axis: c } = n(), { element: u } = r(), d = Pe({ axis: c }), g = Le({
|
|
1487
|
+
axisSize: d,
|
|
1488
|
+
itemElement: u,
|
|
1489
|
+
styleProp: a
|
|
1490
|
+
}), m = X(g / d * 100);
|
|
1491
|
+
l(m);
|
|
1165
1492
|
}
|
|
1166
1493
|
};
|
|
1167
1494
|
}
|
|
1168
|
-
function
|
|
1495
|
+
function zt(e) {
|
|
1169
1496
|
if (e.defaultPrevented)
|
|
1170
1497
|
return;
|
|
1171
|
-
const t =
|
|
1172
|
-
|
|
1498
|
+
const t = Se();
|
|
1499
|
+
ut(e, t).forEach((o) => {
|
|
1173
1500
|
if (o.separator && !o.separator.disableDoubleClick) {
|
|
1174
|
-
const r = o.
|
|
1175
|
-
(i) => i.
|
|
1501
|
+
const r = o.items.find(
|
|
1502
|
+
(i) => i.constraintProps.defaultSize !== void 0
|
|
1176
1503
|
);
|
|
1177
1504
|
if (r) {
|
|
1178
|
-
const i = r.
|
|
1179
|
-
|
|
1180
|
-
|
|
1505
|
+
const i = r.constraintProps.defaultSize, s = dt({
|
|
1506
|
+
axisId: o.axis.id,
|
|
1507
|
+
itemId: r.id
|
|
1181
1508
|
});
|
|
1182
1509
|
s && i !== void 0 && (s.resize(i), e.preventDefault());
|
|
1183
1510
|
}
|
|
1184
1511
|
}
|
|
1185
1512
|
});
|
|
1186
1513
|
}
|
|
1187
|
-
function
|
|
1188
|
-
const t =
|
|
1514
|
+
function Qt(e) {
|
|
1515
|
+
const t = Se();
|
|
1189
1516
|
for (const [n] of t)
|
|
1190
1517
|
if (n.separators.some(
|
|
1191
1518
|
(o) => o.element === e
|
|
@@ -1193,14 +1520,14 @@ function ye(e) {
|
|
|
1193
1520
|
return n;
|
|
1194
1521
|
throw Error("Could not find parent Group for separator element");
|
|
1195
1522
|
}
|
|
1196
|
-
function
|
|
1197
|
-
|
|
1523
|
+
function Ne({
|
|
1524
|
+
axisId: e
|
|
1198
1525
|
}) {
|
|
1199
1526
|
const t = () => {
|
|
1200
|
-
const n =
|
|
1527
|
+
const n = Se();
|
|
1201
1528
|
for (const [o, r] of n)
|
|
1202
1529
|
if (o.id === e)
|
|
1203
|
-
return {
|
|
1530
|
+
return { axis: o, ...r };
|
|
1204
1531
|
throw Error(`Could not find Group with id "${e}"`);
|
|
1205
1532
|
};
|
|
1206
1533
|
return {
|
|
@@ -1211,51 +1538,55 @@ function mt({
|
|
|
1211
1538
|
setLayout(n) {
|
|
1212
1539
|
const {
|
|
1213
1540
|
defaultLayoutDeferred: o,
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
layout:
|
|
1218
|
-
|
|
1219
|
-
} = t(),
|
|
1541
|
+
derivedItemConstraints: r,
|
|
1542
|
+
axis: i,
|
|
1543
|
+
axisSize: s,
|
|
1544
|
+
layout: l,
|
|
1545
|
+
separatorToItems: a
|
|
1546
|
+
} = t(), c = ye({
|
|
1220
1547
|
layout: n,
|
|
1221
|
-
|
|
1548
|
+
itemConstraints: r
|
|
1222
1549
|
});
|
|
1223
|
-
return o ?
|
|
1550
|
+
return o ? l : (se(l, c) || me(i, {
|
|
1224
1551
|
defaultLayoutDeferred: o,
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
layout:
|
|
1228
|
-
|
|
1229
|
-
|
|
1552
|
+
derivedItemConstraints: r,
|
|
1553
|
+
axisSize: s,
|
|
1554
|
+
layout: c,
|
|
1555
|
+
requestedAxisSize: s,
|
|
1556
|
+
requestedLayout: c,
|
|
1557
|
+
separatorToItems: a
|
|
1558
|
+
}), c);
|
|
1230
1559
|
}
|
|
1231
1560
|
};
|
|
1232
1561
|
}
|
|
1233
|
-
function
|
|
1234
|
-
const n =
|
|
1235
|
-
(
|
|
1562
|
+
function xe(e, t) {
|
|
1563
|
+
const n = Qt(e), o = ae(n.id, !0), r = n.separators.find(
|
|
1564
|
+
(d) => d.element === e
|
|
1236
1565
|
);
|
|
1237
|
-
|
|
1238
|
-
const i = o.
|
|
1239
|
-
|
|
1240
|
-
const s = i.map((
|
|
1566
|
+
A(r, "Matching separator not found");
|
|
1567
|
+
const i = o.separatorToItems.get(r);
|
|
1568
|
+
A(i, "Matching panels not found");
|
|
1569
|
+
const s = i.map((d) => n.items.indexOf(d)), a = Ne({ axisId: n.id }).getLayout(), c = Fe({
|
|
1241
1570
|
delta: t,
|
|
1242
|
-
initialLayout:
|
|
1243
|
-
|
|
1571
|
+
initialLayout: a,
|
|
1572
|
+
itemConstraints: o.derivedItemConstraints,
|
|
1244
1573
|
pivotIndices: s,
|
|
1245
|
-
prevLayout:
|
|
1574
|
+
prevLayout: a,
|
|
1246
1575
|
trigger: "keyboard"
|
|
1247
|
-
}),
|
|
1248
|
-
layout:
|
|
1249
|
-
|
|
1576
|
+
}), u = ye({
|
|
1577
|
+
layout: c,
|
|
1578
|
+
itemConstraints: o.derivedItemConstraints
|
|
1250
1579
|
});
|
|
1251
|
-
|
|
1580
|
+
se(a, u) || me(
|
|
1252
1581
|
n,
|
|
1253
1582
|
{
|
|
1254
1583
|
defaultLayoutDeferred: o.defaultLayoutDeferred,
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
layout:
|
|
1258
|
-
|
|
1584
|
+
derivedItemConstraints: o.derivedItemConstraints,
|
|
1585
|
+
axisSize: o.axisSize,
|
|
1586
|
+
layout: u,
|
|
1587
|
+
requestedAxisSize: o.axisSize,
|
|
1588
|
+
requestedLayout: u,
|
|
1589
|
+
separatorToItems: o.separatorToItems
|
|
1259
1590
|
},
|
|
1260
1591
|
// Keyboard resizes (arrow keys, Home/End, Enter collapse/expand) originate
|
|
1261
1592
|
// from a real DOM event on the separator, so they are user interactions
|
|
@@ -1264,110 +1595,108 @@ function te(e, t) {
|
|
|
1264
1595
|
{ isUserInteraction: !0 }
|
|
1265
1596
|
);
|
|
1266
1597
|
}
|
|
1267
|
-
function
|
|
1598
|
+
function It(e) {
|
|
1268
1599
|
if (e.defaultPrevented)
|
|
1269
1600
|
return;
|
|
1270
|
-
const t = e.currentTarget, n =
|
|
1601
|
+
const t = e.currentTarget, n = Qt(t);
|
|
1271
1602
|
if (!(n.disabled || n.separators.find(
|
|
1272
1603
|
(r) => r.element === t
|
|
1273
1604
|
)?.disabled))
|
|
1274
1605
|
switch (e.key) {
|
|
1275
1606
|
case "ArrowDown": {
|
|
1276
|
-
e.preventDefault(), n.orientation === "vertical" &&
|
|
1607
|
+
e.preventDefault(), n.orientation === "vertical" && xe(t, 5);
|
|
1277
1608
|
break;
|
|
1278
1609
|
}
|
|
1279
1610
|
case "ArrowLeft": {
|
|
1280
|
-
e.preventDefault(), n.orientation === "horizontal" &&
|
|
1611
|
+
e.preventDefault(), n.orientation === "horizontal" && xe(t, -5);
|
|
1281
1612
|
break;
|
|
1282
1613
|
}
|
|
1283
1614
|
case "ArrowRight": {
|
|
1284
|
-
e.preventDefault(), n.orientation === "horizontal" &&
|
|
1615
|
+
e.preventDefault(), n.orientation === "horizontal" && xe(t, 5);
|
|
1285
1616
|
break;
|
|
1286
1617
|
}
|
|
1287
1618
|
case "ArrowUp": {
|
|
1288
|
-
e.preventDefault(), n.orientation === "vertical" &&
|
|
1619
|
+
e.preventDefault(), n.orientation === "vertical" && xe(t, -5);
|
|
1289
1620
|
break;
|
|
1290
1621
|
}
|
|
1291
1622
|
case "End": {
|
|
1292
|
-
e.preventDefault(),
|
|
1623
|
+
e.preventDefault(), xe(t, 100);
|
|
1293
1624
|
break;
|
|
1294
1625
|
}
|
|
1295
1626
|
case "Enter": {
|
|
1296
1627
|
e.preventDefault();
|
|
1297
|
-
const r =
|
|
1298
|
-
(
|
|
1628
|
+
const r = ae(n.id, !0), { derivedItemConstraints: i, layout: s, separatorToItems: l } = r, a = n.separators.find(
|
|
1629
|
+
(g) => g.element === t
|
|
1299
1630
|
);
|
|
1300
|
-
|
|
1301
|
-
const
|
|
1302
|
-
|
|
1303
|
-
const
|
|
1304
|
-
(
|
|
1631
|
+
A(a, "Matching separator not found");
|
|
1632
|
+
const c = l.get(a);
|
|
1633
|
+
A(c, "Matching panels not found");
|
|
1634
|
+
const u = c[0], d = i.find(
|
|
1635
|
+
(g) => g.itemId === u.id
|
|
1305
1636
|
);
|
|
1306
|
-
if (
|
|
1307
|
-
const
|
|
1308
|
-
|
|
1637
|
+
if (A(d, "Panel metadata not found"), d.collapsible) {
|
|
1638
|
+
const g = s[u.id], m = d.collapsedSize === g ? n.mutableState.expandedItemSizes[u.id] ?? d.minSize : d.collapsedSize;
|
|
1639
|
+
xe(t, m - g);
|
|
1309
1640
|
}
|
|
1310
1641
|
break;
|
|
1311
1642
|
}
|
|
1312
1643
|
case "F6": {
|
|
1313
1644
|
e.preventDefault();
|
|
1314
|
-
const
|
|
1645
|
+
const r = n.separators.map(
|
|
1315
1646
|
(a) => a.element
|
|
1316
|
-
),
|
|
1647
|
+
), i = Array.from(r).findIndex(
|
|
1317
1648
|
(a) => a === e.currentTarget
|
|
1318
1649
|
);
|
|
1319
|
-
|
|
1320
|
-
const
|
|
1321
|
-
|
|
1650
|
+
A(i !== null, "Index not found");
|
|
1651
|
+
const s = e.shiftKey ? i > 0 ? i - 1 : r.length - 1 : i + 1 < r.length ? i + 1 : 0;
|
|
1652
|
+
r[s].focus({
|
|
1322
1653
|
preventScroll: !0
|
|
1323
1654
|
});
|
|
1324
1655
|
break;
|
|
1325
1656
|
}
|
|
1326
1657
|
case "Home": {
|
|
1327
|
-
e.preventDefault(),
|
|
1658
|
+
e.preventDefault(), xe(t, -100);
|
|
1328
1659
|
break;
|
|
1329
1660
|
}
|
|
1330
1661
|
}
|
|
1331
1662
|
}
|
|
1332
|
-
function
|
|
1333
|
-
const { element: n, orientation: o,
|
|
1334
|
-
return
|
|
1663
|
+
function Vn(e, t) {
|
|
1664
|
+
const { element: n, orientation: o, items: r } = e, i = n.getBoundingClientRect(), s = o === "horizontal";
|
|
1665
|
+
return lt({
|
|
1335
1666
|
expandHitTargets: !1,
|
|
1336
|
-
|
|
1667
|
+
axis: e,
|
|
1337
1668
|
includeDisabled: !0
|
|
1338
|
-
}).map(
|
|
1339
|
-
(
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
}
|
|
1363
|
-
);
|
|
1669
|
+
}).map(({ items: a, rect: c, separator: u }, d) => {
|
|
1670
|
+
const g = r.indexOf(a[0]), m = s ? c.left + c.width / 2 : c.top + c.height / 2;
|
|
1671
|
+
return {
|
|
1672
|
+
active: t.some((f) => {
|
|
1673
|
+
if (f.axis !== e || f.items[0] !== a[0])
|
|
1674
|
+
return !1;
|
|
1675
|
+
if (u || f.separator)
|
|
1676
|
+
return f.separator === u;
|
|
1677
|
+
const S = s ? f.rect.left + f.rect.width / 2 : f.rect.top + f.rect.height / 2;
|
|
1678
|
+
return U(m, S);
|
|
1679
|
+
}),
|
|
1680
|
+
axis: e,
|
|
1681
|
+
key: u ? `separator-${u.id}` : `panel-${a[0].id}-${d}`,
|
|
1682
|
+
offset: 0,
|
|
1683
|
+
itemIndex: g,
|
|
1684
|
+
rect: new DOMRect(
|
|
1685
|
+
(s && !u ? m : c.left) - i.left - n.clientLeft + n.scrollLeft,
|
|
1686
|
+
(!s && !u ? m : c.top) - i.top - n.clientTop + n.scrollTop,
|
|
1687
|
+
s && !u ? 0 : c.width,
|
|
1688
|
+
!s && !u ? 0 : c.height
|
|
1689
|
+
),
|
|
1690
|
+
separator: u
|
|
1691
|
+
};
|
|
1692
|
+
});
|
|
1364
1693
|
}
|
|
1365
|
-
function
|
|
1694
|
+
function Lt(e) {
|
|
1366
1695
|
if (e.defaultPrevented)
|
|
1367
1696
|
return;
|
|
1368
1697
|
if (e.pointerType === "mouse" && e.button > 0)
|
|
1369
1698
|
return;
|
|
1370
|
-
const t =
|
|
1699
|
+
const t = Se(), n = ut(e, t);
|
|
1371
1700
|
if (n.length === 0)
|
|
1372
1701
|
return;
|
|
1373
1702
|
const o = /* @__PURE__ */ new Map();
|
|
@@ -1378,13 +1707,13 @@ function Xe(e) {
|
|
|
1378
1707
|
focusVisible: !1,
|
|
1379
1708
|
preventScroll: !0
|
|
1380
1709
|
})));
|
|
1381
|
-
const
|
|
1382
|
-
|
|
1710
|
+
const l = t.get(s.axis);
|
|
1711
|
+
l && o.set(s.axis, l.layout);
|
|
1383
1712
|
});
|
|
1384
1713
|
const i = Array.from(o.keys()).flatMap(
|
|
1385
|
-
(s) => s.resizePreviewMode === "separator" ?
|
|
1714
|
+
(s) => s.resizePreviewMode === "separator" ? Vn(s, n) : []
|
|
1386
1715
|
);
|
|
1387
|
-
|
|
1716
|
+
de({
|
|
1388
1717
|
cursorFlags: 0,
|
|
1389
1718
|
didPointerMove: !1,
|
|
1390
1719
|
hitRegions: n,
|
|
@@ -1395,25 +1724,25 @@ function Xe(e) {
|
|
|
1395
1724
|
state: "active"
|
|
1396
1725
|
}), e.preventDefault();
|
|
1397
1726
|
}
|
|
1398
|
-
function
|
|
1399
|
-
const t =
|
|
1727
|
+
function Ct(e) {
|
|
1728
|
+
const t = Se(), n = fe();
|
|
1400
1729
|
switch (n.state) {
|
|
1401
1730
|
case "active":
|
|
1402
|
-
|
|
1731
|
+
ct({
|
|
1403
1732
|
commit: !1,
|
|
1404
1733
|
document: e.currentTarget,
|
|
1405
1734
|
event: e,
|
|
1406
1735
|
hitRegions: n.hitRegions,
|
|
1407
1736
|
initialLayoutMap: n.initialLayoutMap,
|
|
1408
|
-
|
|
1737
|
+
mountedAxes: t,
|
|
1409
1738
|
prevCursorFlags: n.cursorFlags
|
|
1410
1739
|
});
|
|
1411
1740
|
}
|
|
1412
1741
|
}
|
|
1413
|
-
function
|
|
1742
|
+
function Rt(e) {
|
|
1414
1743
|
if (e.defaultPrevented)
|
|
1415
1744
|
return;
|
|
1416
|
-
const t =
|
|
1745
|
+
const t = fe(), n = Se();
|
|
1417
1746
|
switch (t.state) {
|
|
1418
1747
|
case "active": {
|
|
1419
1748
|
if (
|
|
@@ -1422,18 +1751,23 @@ function Ye(e) {
|
|
|
1422
1751
|
) {
|
|
1423
1752
|
t.previewLayoutMap.forEach((o, r) => {
|
|
1424
1753
|
const i = n.get(r);
|
|
1425
|
-
r.resizePreviewMode === "separator" && i && !
|
|
1426
|
-
|
|
1754
|
+
r.resizePreviewMode === "separator" && i && !se(o, i.layout) && me(r, {
|
|
1755
|
+
...i,
|
|
1756
|
+
layout: o,
|
|
1757
|
+
requestedAxisSize: i.axisSize,
|
|
1758
|
+
requestedLayout: o
|
|
1759
|
+
});
|
|
1760
|
+
}), de({
|
|
1427
1761
|
cursorFlags: 0,
|
|
1428
1762
|
state: "inactive"
|
|
1429
1763
|
}), t.hitRegions.forEach((o) => {
|
|
1430
|
-
if (!n.has(o.
|
|
1764
|
+
if (!n.has(o.axis))
|
|
1431
1765
|
return;
|
|
1432
|
-
const r =
|
|
1433
|
-
|
|
1766
|
+
const r = ae(o.axis.id, !0);
|
|
1767
|
+
me(o.axis, r, {
|
|
1434
1768
|
isUserInteraction: !0
|
|
1435
1769
|
});
|
|
1436
|
-
}),
|
|
1770
|
+
}), Ge(e.currentTarget);
|
|
1437
1771
|
return;
|
|
1438
1772
|
}
|
|
1439
1773
|
for (const o of t.hitRegions)
|
|
@@ -1441,71 +1775,71 @@ function Ye(e) {
|
|
|
1441
1775
|
const { element: r } = o.separator;
|
|
1442
1776
|
r.isConnected && !r.hasPointerCapture?.(e.pointerId) && r.setPointerCapture?.(e.pointerId);
|
|
1443
1777
|
}
|
|
1444
|
-
|
|
1778
|
+
ct({
|
|
1445
1779
|
commit: !1,
|
|
1446
1780
|
document: e.currentTarget,
|
|
1447
1781
|
event: e,
|
|
1448
1782
|
hitRegions: t.hitRegions,
|
|
1449
1783
|
initialLayoutMap: t.initialLayoutMap,
|
|
1450
|
-
|
|
1784
|
+
mountedAxes: n,
|
|
1451
1785
|
pointerDownAtPoint: t.pointerDownAtPoint,
|
|
1452
1786
|
prevCursorFlags: t.cursorFlags
|
|
1453
1787
|
});
|
|
1454
1788
|
break;
|
|
1455
1789
|
}
|
|
1456
1790
|
default: {
|
|
1457
|
-
const o =
|
|
1458
|
-
o.length === 0 ? t.state !== "inactive" &&
|
|
1791
|
+
const o = ut(e, n);
|
|
1792
|
+
o.length === 0 ? t.state !== "inactive" && de({
|
|
1459
1793
|
cursorFlags: 0,
|
|
1460
1794
|
state: "inactive"
|
|
1461
|
-
}) :
|
|
1795
|
+
}) : de({
|
|
1462
1796
|
cursorFlags: 0,
|
|
1463
1797
|
hitRegions: o,
|
|
1464
1798
|
state: "hover"
|
|
1465
|
-
}),
|
|
1799
|
+
}), Ge(e.currentTarget);
|
|
1466
1800
|
break;
|
|
1467
1801
|
}
|
|
1468
1802
|
}
|
|
1469
1803
|
}
|
|
1470
|
-
function
|
|
1804
|
+
function Mt(e) {
|
|
1471
1805
|
if (e.relatedTarget instanceof HTMLIFrameElement)
|
|
1472
|
-
switch (
|
|
1806
|
+
switch (fe().state) {
|
|
1473
1807
|
case "hover":
|
|
1474
|
-
|
|
1808
|
+
de({
|
|
1475
1809
|
cursorFlags: 0,
|
|
1476
1810
|
state: "inactive"
|
|
1477
1811
|
});
|
|
1478
1812
|
}
|
|
1479
1813
|
}
|
|
1480
|
-
function
|
|
1814
|
+
function Et(e) {
|
|
1481
1815
|
if (e.defaultPrevented)
|
|
1482
1816
|
return;
|
|
1483
1817
|
if (e.pointerType === "mouse" && e.button > 0)
|
|
1484
1818
|
return;
|
|
1485
|
-
|
|
1819
|
+
Jt(
|
|
1486
1820
|
e.currentTarget,
|
|
1487
1821
|
e
|
|
1488
1822
|
) && e.preventDefault();
|
|
1489
1823
|
}
|
|
1490
|
-
function
|
|
1824
|
+
function Hn(e) {
|
|
1491
1825
|
let t = 0, n = 0;
|
|
1492
1826
|
const o = {};
|
|
1493
1827
|
for (const i of e)
|
|
1494
1828
|
if (i.defaultSize !== void 0) {
|
|
1495
1829
|
t++;
|
|
1496
|
-
const s =
|
|
1497
|
-
n += s, o[i.
|
|
1830
|
+
const s = X(i.defaultSize);
|
|
1831
|
+
n += s, o[i.itemId] = s;
|
|
1498
1832
|
} else
|
|
1499
|
-
o[i.
|
|
1833
|
+
o[i.itemId] = void 0;
|
|
1500
1834
|
const r = e.length - t;
|
|
1501
1835
|
if (r !== 0) {
|
|
1502
|
-
const i =
|
|
1836
|
+
const i = X((100 - n) / r);
|
|
1503
1837
|
for (const s of e)
|
|
1504
|
-
s.defaultSize === void 0 && (o[s.
|
|
1838
|
+
s.defaultSize === void 0 && (o[s.itemId] = i);
|
|
1505
1839
|
}
|
|
1506
1840
|
return o;
|
|
1507
1841
|
}
|
|
1508
|
-
function
|
|
1842
|
+
function jn(e, t) {
|
|
1509
1843
|
const n = e.map((r) => r.id), o = Object.keys(t);
|
|
1510
1844
|
if (n.length !== o.length)
|
|
1511
1845
|
return !1;
|
|
@@ -1514,26 +1848,43 @@ function tn(e, t) {
|
|
|
1514
1848
|
return !1;
|
|
1515
1849
|
return !0;
|
|
1516
1850
|
}
|
|
1517
|
-
function
|
|
1518
|
-
|
|
1519
|
-
|
|
1851
|
+
function Pt({
|
|
1852
|
+
axis: e,
|
|
1853
|
+
itemConstraints: t
|
|
1520
1854
|
}) {
|
|
1521
|
-
const n = e.
|
|
1522
|
-
return e.mutableState.layouts[n] ?? (o &&
|
|
1855
|
+
const n = e.items.map(({ id: r }) => r).join(","), o = e.mutableState.defaultLayout;
|
|
1856
|
+
return e.mutableState.layouts[n] ?? (o && jn(e.items, o) ? o : Hn(t));
|
|
1857
|
+
}
|
|
1858
|
+
function kt({
|
|
1859
|
+
itemIds: e,
|
|
1860
|
+
layout: t
|
|
1861
|
+
}) {
|
|
1862
|
+
return ye({
|
|
1863
|
+
layout: t,
|
|
1864
|
+
itemConstraints: e.map((n) => ({
|
|
1865
|
+
collapsedSize: 0,
|
|
1866
|
+
collapsible: !1,
|
|
1867
|
+
defaultSize: void 0,
|
|
1868
|
+
disabled: void 0,
|
|
1869
|
+
itemId: n,
|
|
1870
|
+
maxSize: 100,
|
|
1871
|
+
minSize: 0
|
|
1872
|
+
}))
|
|
1873
|
+
});
|
|
1523
1874
|
}
|
|
1524
|
-
function
|
|
1875
|
+
function Un(e, t, n) {
|
|
1525
1876
|
if (!n[0])
|
|
1526
1877
|
return;
|
|
1527
|
-
const r = e.
|
|
1878
|
+
const r = e.items.find((c) => c.element === t);
|
|
1528
1879
|
if (!r || !r.onResize)
|
|
1529
1880
|
return;
|
|
1530
|
-
const i =
|
|
1531
|
-
asPercentage:
|
|
1881
|
+
const i = Pe({ axis: e }), s = e.orientation === "horizontal" ? r.element.offsetWidth : r.element.offsetHeight, l = r.mutableValues.prevSize, a = {
|
|
1882
|
+
asPercentage: X(s / i * 100),
|
|
1532
1883
|
inPixels: s
|
|
1533
1884
|
};
|
|
1534
|
-
r.mutableValues.prevSize =
|
|
1885
|
+
r.mutableValues.prevSize = a, r.onResize(a, r.id, l);
|
|
1535
1886
|
}
|
|
1536
|
-
function
|
|
1887
|
+
function en(e, t) {
|
|
1537
1888
|
if (Object.keys(e).length !== Object.keys(t).length)
|
|
1538
1889
|
return !1;
|
|
1539
1890
|
for (const o in e)
|
|
@@ -1541,219 +1892,1020 @@ function gt(e, t) {
|
|
|
1541
1892
|
return !1;
|
|
1542
1893
|
return !0;
|
|
1543
1894
|
}
|
|
1544
|
-
function
|
|
1545
|
-
return e.length !== t.length ? !1 : e.every((n, o) =>
|
|
1895
|
+
function Wn(e, t) {
|
|
1896
|
+
return e.length !== t.length ? !1 : e.every((n, o) => en(n, t[o]));
|
|
1546
1897
|
}
|
|
1547
|
-
function
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1898
|
+
function Yn({
|
|
1899
|
+
axis: e,
|
|
1900
|
+
nextAxisSize: t,
|
|
1901
|
+
prevAxisSize: n,
|
|
1551
1902
|
prevLayout: o
|
|
1552
1903
|
}) {
|
|
1553
1904
|
if (n <= 0 || t <= 0 || n === t)
|
|
1554
1905
|
return o;
|
|
1555
1906
|
let r = 0, i = 0, s = !1;
|
|
1556
|
-
const
|
|
1557
|
-
for (const
|
|
1558
|
-
const
|
|
1559
|
-
switch (
|
|
1907
|
+
const l = /* @__PURE__ */ new Map(), a = [];
|
|
1908
|
+
for (const d of e.items) {
|
|
1909
|
+
const g = o[d.id] ?? 0;
|
|
1910
|
+
switch (d.constraintProps.groupResizeBehavior) {
|
|
1560
1911
|
case "preserve-pixel-size": {
|
|
1561
1912
|
s = !0;
|
|
1562
|
-
const
|
|
1563
|
-
|
|
1913
|
+
const m = g / 100 * n, y = X(
|
|
1914
|
+
m / t * 100
|
|
1564
1915
|
);
|
|
1565
|
-
|
|
1916
|
+
l.set(d.id, y), r += y;
|
|
1566
1917
|
break;
|
|
1567
1918
|
}
|
|
1568
1919
|
case "preserve-relative-size":
|
|
1569
1920
|
default: {
|
|
1570
|
-
|
|
1921
|
+
a.push(d.id), i += g;
|
|
1571
1922
|
break;
|
|
1572
1923
|
}
|
|
1573
1924
|
}
|
|
1574
1925
|
}
|
|
1575
|
-
if (!s ||
|
|
1926
|
+
if (!s || a.length === 0)
|
|
1576
1927
|
return o;
|
|
1577
|
-
const
|
|
1578
|
-
if (
|
|
1579
|
-
|
|
1928
|
+
const c = 100 - r, u = { ...o };
|
|
1929
|
+
if (l.forEach((d, g) => {
|
|
1930
|
+
u[g] = d;
|
|
1580
1931
|
}), i > 0)
|
|
1581
|
-
for (const
|
|
1582
|
-
const
|
|
1583
|
-
|
|
1584
|
-
|
|
1932
|
+
for (const d of a) {
|
|
1933
|
+
const g = o[d] ?? 0;
|
|
1934
|
+
u[d] = X(
|
|
1935
|
+
g / i * c
|
|
1585
1936
|
);
|
|
1586
1937
|
}
|
|
1587
1938
|
else {
|
|
1588
|
-
const
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
for (const y of c)
|
|
1592
|
-
l[y] = f;
|
|
1939
|
+
const d = X(c / a.length);
|
|
1940
|
+
for (const g of a)
|
|
1941
|
+
u[g] = d;
|
|
1593
1942
|
}
|
|
1594
|
-
return
|
|
1943
|
+
return u;
|
|
1595
1944
|
}
|
|
1596
|
-
const
|
|
1597
|
-
function
|
|
1945
|
+
const Ie = /* @__PURE__ */ new Map();
|
|
1946
|
+
function tn(e) {
|
|
1598
1947
|
let t = !0;
|
|
1599
|
-
|
|
1948
|
+
A(
|
|
1600
1949
|
e.element.ownerDocument.defaultView,
|
|
1601
1950
|
"Cannot register an unmounted Group"
|
|
1602
1951
|
);
|
|
1603
|
-
const n = e.element.ownerDocument.defaultView.ResizeObserver, o = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), i = new n((
|
|
1604
|
-
for (const
|
|
1605
|
-
const { borderBoxSize:
|
|
1606
|
-
if (
|
|
1952
|
+
const n = e.element.ownerDocument.defaultView.ResizeObserver, o = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), i = new n((m) => {
|
|
1953
|
+
for (const y of m) {
|
|
1954
|
+
const { borderBoxSize: f, target: S } = y;
|
|
1955
|
+
if (S === e.element) {
|
|
1607
1956
|
if (t) {
|
|
1608
|
-
const
|
|
1609
|
-
if (
|
|
1957
|
+
const p = Pe({ axis: e });
|
|
1958
|
+
if (p === 0)
|
|
1610
1959
|
return;
|
|
1611
|
-
const
|
|
1612
|
-
if (!
|
|
1960
|
+
const h = ae(e.id);
|
|
1961
|
+
if (!h)
|
|
1613
1962
|
return;
|
|
1614
|
-
const
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
})
|
|
1623
|
-
|
|
1624
|
-
|
|
1963
|
+
const L = rt(e);
|
|
1964
|
+
let w = h.requestedAxisSize, C = h.requestedLayout;
|
|
1965
|
+
h.defaultLayoutDeferred && (w = p, C = kt({
|
|
1966
|
+
itemIds: e.items.map(({ id: b }) => b),
|
|
1967
|
+
layout: Pt({
|
|
1968
|
+
axis: e,
|
|
1969
|
+
itemConstraints: L
|
|
1970
|
+
})
|
|
1971
|
+
}));
|
|
1972
|
+
const O = Yn({
|
|
1973
|
+
axis: e,
|
|
1974
|
+
nextAxisSize: p,
|
|
1975
|
+
prevAxisSize: w,
|
|
1976
|
+
prevLayout: C
|
|
1977
|
+
}), D = ye({
|
|
1978
|
+
layout: O,
|
|
1979
|
+
itemConstraints: L
|
|
1625
1980
|
});
|
|
1626
|
-
if (!
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
) &&
|
|
1981
|
+
if (!h.defaultLayoutDeferred && se(h.layout, D) && Wn(
|
|
1982
|
+
h.derivedItemConstraints,
|
|
1983
|
+
L
|
|
1984
|
+
) && h.axisSize === p)
|
|
1630
1985
|
continue;
|
|
1631
|
-
|
|
1986
|
+
me(e, {
|
|
1632
1987
|
defaultLayoutDeferred: !1,
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
layout:
|
|
1636
|
-
|
|
1988
|
+
derivedItemConstraints: L,
|
|
1989
|
+
axisSize: p,
|
|
1990
|
+
layout: D,
|
|
1991
|
+
requestedAxisSize: w,
|
|
1992
|
+
requestedLayout: C,
|
|
1993
|
+
separatorToItems: h.separatorToItems
|
|
1637
1994
|
});
|
|
1638
1995
|
}
|
|
1639
1996
|
} else
|
|
1640
|
-
|
|
1997
|
+
Un(e, S, f);
|
|
1641
1998
|
}
|
|
1642
1999
|
});
|
|
1643
|
-
i.observe(e.element), e.
|
|
1644
|
-
|
|
1645
|
-
!o.has(
|
|
1646
|
-
`Panel ids must be unique; id "${
|
|
1647
|
-
), o.add(
|
|
2000
|
+
i.observe(e.element), e.items.forEach((m) => {
|
|
2001
|
+
A(
|
|
2002
|
+
!o.has(m.id),
|
|
2003
|
+
`Panel ids must be unique; id "${m.id}" was used more than once`
|
|
2004
|
+
), o.add(m.id), m.onResize && i.observe(m.element);
|
|
1648
2005
|
});
|
|
1649
|
-
const s =
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
}),
|
|
1653
|
-
layout:
|
|
1654
|
-
|
|
1655
|
-
}),
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
(
|
|
2006
|
+
const s = Pe({ axis: e }), l = rt(e), a = Pt({
|
|
2007
|
+
axis: e,
|
|
2008
|
+
itemConstraints: l
|
|
2009
|
+
}), c = ye({
|
|
2010
|
+
layout: a,
|
|
2011
|
+
itemConstraints: l
|
|
2012
|
+
}), u = e.element.ownerDocument;
|
|
2013
|
+
Ie.set(
|
|
2014
|
+
u,
|
|
2015
|
+
(Ie.get(u) ?? 0) + 1
|
|
1659
2016
|
);
|
|
1660
|
-
const
|
|
1661
|
-
return
|
|
1662
|
-
|
|
1663
|
-
}),
|
|
2017
|
+
const d = /* @__PURE__ */ new Map();
|
|
2018
|
+
return lt({ axis: e, includeDisabled: !0 }).forEach((m) => {
|
|
2019
|
+
m.separator && d.set(m.separator, m.items);
|
|
2020
|
+
}), me(e, {
|
|
1664
2021
|
defaultLayoutDeferred: s === 0,
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
layout:
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
}),
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
),
|
|
1679
|
-
|
|
1680
|
-
|
|
2022
|
+
derivedItemConstraints: l,
|
|
2023
|
+
axisSize: s,
|
|
2024
|
+
layout: c,
|
|
2025
|
+
requestedAxisSize: s,
|
|
2026
|
+
requestedLayout: kt({
|
|
2027
|
+
itemIds: e.items.map(({ id: m }) => m),
|
|
2028
|
+
layout: a
|
|
2029
|
+
}),
|
|
2030
|
+
separatorToItems: d
|
|
2031
|
+
}), e.separators.forEach((m) => {
|
|
2032
|
+
A(
|
|
2033
|
+
!r.has(m.id),
|
|
2034
|
+
`Separator ids must be unique; id "${m.id}" was used more than once`
|
|
2035
|
+
), r.add(m.id), m.element.addEventListener("keydown", It);
|
|
2036
|
+
}), Ie.get(u) === 1 && (u.addEventListener("contextmenu", vt, !0), u.addEventListener("dblclick", zt, !0), u.addEventListener("pointerdown", Lt, !0), u.addEventListener("pointerleave", Ct), u.addEventListener("pointermove", Rt), u.addEventListener("pointerout", Mt), u.addEventListener("pointerup", Et, !0)), function() {
|
|
2037
|
+
t = !1, Ie.set(
|
|
2038
|
+
u,
|
|
2039
|
+
Math.max(0, (Ie.get(u) ?? 0) - 1)
|
|
2040
|
+
), $n(e), wn(e) && Ge(u), e.separators.forEach((y) => {
|
|
2041
|
+
y.element.removeEventListener("keydown", It);
|
|
2042
|
+
}), Ie.get(u) || (u.removeEventListener(
|
|
1681
2043
|
"contextmenu",
|
|
1682
|
-
|
|
2044
|
+
vt,
|
|
1683
2045
|
!0
|
|
1684
|
-
),
|
|
2046
|
+
), u.removeEventListener(
|
|
1685
2047
|
"dblclick",
|
|
1686
|
-
|
|
2048
|
+
zt,
|
|
1687
2049
|
!0
|
|
1688
|
-
),
|
|
2050
|
+
), u.removeEventListener(
|
|
1689
2051
|
"pointerdown",
|
|
1690
|
-
|
|
2052
|
+
Lt,
|
|
1691
2053
|
!0
|
|
1692
|
-
),
|
|
2054
|
+
), u.removeEventListener("pointerleave", Ct), u.removeEventListener("pointermove", Rt), u.removeEventListener("pointerout", Mt), u.removeEventListener("pointerup", Et, !0)), i.disconnect();
|
|
1693
2055
|
};
|
|
1694
2056
|
}
|
|
1695
|
-
function
|
|
1696
|
-
|
|
2057
|
+
function nn({
|
|
2058
|
+
derivedItemConstraints: e,
|
|
2059
|
+
axis: t,
|
|
2060
|
+
layout: n,
|
|
2061
|
+
prevLayout: o,
|
|
2062
|
+
requestedLayout: r
|
|
2063
|
+
}) {
|
|
2064
|
+
const i = t.items.map(({ id: s }) => s).join(",");
|
|
2065
|
+
t.mutableState.layouts[i] = r, o && e.forEach((s) => {
|
|
2066
|
+
if (s.collapsible) {
|
|
2067
|
+
const l = U(
|
|
2068
|
+
s.collapsedSize,
|
|
2069
|
+
n[s.itemId]
|
|
2070
|
+
), a = U(
|
|
2071
|
+
s.collapsedSize,
|
|
2072
|
+
o[s.itemId]
|
|
2073
|
+
);
|
|
2074
|
+
l && !a && (t.mutableState.expandedItemSizes[s.itemId] = o[s.itemId]);
|
|
2075
|
+
}
|
|
2076
|
+
});
|
|
2077
|
+
}
|
|
2078
|
+
function on() {
|
|
2079
|
+
const [e, t] = he({}), n = te(() => t({}), []);
|
|
1697
2080
|
return [e, n];
|
|
1698
2081
|
}
|
|
1699
|
-
function
|
|
1700
|
-
const t =
|
|
1701
|
-
return
|
|
2082
|
+
function Xe(e) {
|
|
2083
|
+
const t = q({ ...e });
|
|
2084
|
+
return ne(() => {
|
|
2085
|
+
for (const n in e)
|
|
2086
|
+
t.current[n] = e[n];
|
|
2087
|
+
}, [e]), t.current;
|
|
1702
2088
|
}
|
|
1703
|
-
const
|
|
1704
|
-
function
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
2089
|
+
const ft = Nt(null);
|
|
2090
|
+
function Kn({
|
|
2091
|
+
layout: e,
|
|
2092
|
+
itemConstraints: t,
|
|
2093
|
+
itemId: n,
|
|
2094
|
+
itemIndex: o
|
|
2095
|
+
}) {
|
|
2096
|
+
let r, i;
|
|
2097
|
+
const s = e[n], l = t.find(
|
|
2098
|
+
(a) => a.itemId === n
|
|
1711
2099
|
);
|
|
2100
|
+
if (l) {
|
|
2101
|
+
const a = l.maxSize, c = l.collapsible ? l.collapsedSize : l.minSize, u = [o, o + 1];
|
|
2102
|
+
i = ye({
|
|
2103
|
+
layout: Fe({
|
|
2104
|
+
delta: c - s,
|
|
2105
|
+
initialLayout: e,
|
|
2106
|
+
itemConstraints: t,
|
|
2107
|
+
pivotIndices: u,
|
|
2108
|
+
prevLayout: e
|
|
2109
|
+
}),
|
|
2110
|
+
itemConstraints: t
|
|
2111
|
+
})[n], r = ye({
|
|
2112
|
+
layout: Fe({
|
|
2113
|
+
delta: a - s,
|
|
2114
|
+
initialLayout: e,
|
|
2115
|
+
itemConstraints: t,
|
|
2116
|
+
pivotIndices: u,
|
|
2117
|
+
prevLayout: e
|
|
2118
|
+
}),
|
|
2119
|
+
itemConstraints: t
|
|
2120
|
+
})[n];
|
|
2121
|
+
}
|
|
2122
|
+
return {
|
|
2123
|
+
valueControls: n,
|
|
2124
|
+
valueMax: r,
|
|
2125
|
+
valueMin: i,
|
|
2126
|
+
valueNow: s
|
|
2127
|
+
};
|
|
1712
2128
|
}
|
|
1713
|
-
function
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
2129
|
+
function rn({
|
|
2130
|
+
attributes: e,
|
|
2131
|
+
axisId: t,
|
|
2132
|
+
axisOrientation: n,
|
|
2133
|
+
children: o,
|
|
2134
|
+
className: r,
|
|
2135
|
+
disableCursor: i,
|
|
2136
|
+
disabled: s,
|
|
2137
|
+
disableDoubleClick: l,
|
|
2138
|
+
elementRef: a,
|
|
2139
|
+
id: c,
|
|
2140
|
+
isSharedHitRegion: u,
|
|
2141
|
+
preview: d,
|
|
2142
|
+
registerSeparator: g,
|
|
2143
|
+
requiredStyle: m,
|
|
2144
|
+
style: y,
|
|
2145
|
+
styleDefaults: f,
|
|
2146
|
+
tabIndex: S = 0,
|
|
2147
|
+
updateSeparatorProps: p
|
|
2148
|
+
}) {
|
|
2149
|
+
const h = Xe({
|
|
2150
|
+
disabled: s,
|
|
2151
|
+
disableDoubleClick: l,
|
|
2152
|
+
children: o,
|
|
2153
|
+
className: r,
|
|
2154
|
+
preview: d,
|
|
2155
|
+
style: y
|
|
2156
|
+
}), [L, w] = he({}), [C, O] = he("inactive"), [D, b] = he(!1), x = q(null), v = q(null), E = Be(x, a), P = n === "horizontal" ? "vertical" : "horizontal";
|
|
2157
|
+
ne(() => {
|
|
2158
|
+
const z = x.current;
|
|
2159
|
+
if (z !== null) {
|
|
2160
|
+
const I = {
|
|
2161
|
+
disabled: h.disabled,
|
|
2162
|
+
disableDoubleClick: h.disableDoubleClick,
|
|
2163
|
+
element: z,
|
|
2164
|
+
id: c,
|
|
2165
|
+
get children() {
|
|
2166
|
+
return h.children;
|
|
2167
|
+
},
|
|
2168
|
+
get className() {
|
|
2169
|
+
return h.className;
|
|
2170
|
+
},
|
|
2171
|
+
get preview() {
|
|
2172
|
+
return h.preview;
|
|
2173
|
+
},
|
|
2174
|
+
get style() {
|
|
2175
|
+
return h.style;
|
|
2176
|
+
}
|
|
2177
|
+
};
|
|
2178
|
+
v.current = I;
|
|
2179
|
+
const _ = g(I), Y = Ht(
|
|
2180
|
+
(K) => {
|
|
2181
|
+
O(
|
|
2182
|
+
K.next.state !== "inactive" && K.next.hitRegions.some(
|
|
2183
|
+
(oe) => oe.separator === I || (u?.(oe) ?? !1)
|
|
2184
|
+
) ? K.next.state : "inactive"
|
|
2185
|
+
);
|
|
2186
|
+
}
|
|
2187
|
+
), J = _e(
|
|
2188
|
+
t,
|
|
2189
|
+
(K) => {
|
|
2190
|
+
const { derivedItemConstraints: oe, layout: we, separatorToItems: $e } = K.next, ze = $e.get(I);
|
|
2191
|
+
if (ze) {
|
|
2192
|
+
const re = ze[0], R = oe.findIndex(
|
|
2193
|
+
(N) => N.itemId === re.id
|
|
2194
|
+
), { layoutStrategy: $ } = K.axis;
|
|
2195
|
+
w({
|
|
2196
|
+
...Kn({
|
|
2197
|
+
layout: we,
|
|
2198
|
+
itemConstraints: oe,
|
|
2199
|
+
itemId: re.id,
|
|
2200
|
+
itemIndex: R
|
|
2201
|
+
}),
|
|
2202
|
+
// Items without DOM elements of their own (e.g. Grid tracks) control other elements
|
|
2203
|
+
...$?.getItemAriaControls && {
|
|
2204
|
+
valueControls: $.getItemAriaControls(
|
|
2205
|
+
re.id
|
|
2206
|
+
)
|
|
2207
|
+
}
|
|
2208
|
+
});
|
|
1721
2209
|
}
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
2210
|
+
}
|
|
2211
|
+
);
|
|
2212
|
+
return () => {
|
|
2213
|
+
v.current = null, Y(), J(), _();
|
|
2214
|
+
};
|
|
2215
|
+
}
|
|
2216
|
+
}, [t, c, u, g, h]), ne(() => {
|
|
2217
|
+
const z = v.current;
|
|
2218
|
+
z && xn(z);
|
|
2219
|
+
}, [d]), qe(() => {
|
|
2220
|
+
p(c, { disabled: s, disableDoubleClick: l });
|
|
2221
|
+
}, [s, l, c, p]);
|
|
2222
|
+
let k;
|
|
2223
|
+
s && !i && (k = "not-allowed");
|
|
2224
|
+
let M;
|
|
2225
|
+
if (s)
|
|
2226
|
+
M = "disabled";
|
|
2227
|
+
else
|
|
2228
|
+
switch (C) {
|
|
2229
|
+
case "active": {
|
|
2230
|
+
M = "active";
|
|
2231
|
+
break;
|
|
2232
|
+
}
|
|
2233
|
+
default:
|
|
2234
|
+
D ? M = "focus" : M = C;
|
|
2235
|
+
}
|
|
2236
|
+
return /* @__PURE__ */ W(
|
|
2237
|
+
"div",
|
|
2238
|
+
{
|
|
2239
|
+
...e,
|
|
2240
|
+
"aria-controls": L.valueControls,
|
|
2241
|
+
"aria-disabled": s || void 0,
|
|
2242
|
+
"aria-orientation": P,
|
|
2243
|
+
"aria-valuemax": L.valueMax,
|
|
2244
|
+
"aria-valuemin": L.valueMin,
|
|
2245
|
+
"aria-valuenow": L.valueNow,
|
|
2246
|
+
children: o,
|
|
2247
|
+
className: r,
|
|
2248
|
+
"data-separator": M,
|
|
2249
|
+
"data-testid": c,
|
|
2250
|
+
id: c,
|
|
2251
|
+
onBlur: () => b(!1),
|
|
2252
|
+
onFocus: () => b(!0),
|
|
2253
|
+
ref: E,
|
|
2254
|
+
role: "separator",
|
|
2255
|
+
style: {
|
|
2256
|
+
...f,
|
|
2257
|
+
cursor: k,
|
|
2258
|
+
...y,
|
|
2259
|
+
...m,
|
|
2260
|
+
// Inform the browser that the library is handling touch events for this element
|
|
2261
|
+
// See github.com/bvaughn/react-resizable-panels/issues/662
|
|
2262
|
+
touchAction: "none"
|
|
2263
|
+
},
|
|
2264
|
+
tabIndex: s ? void 0 : S
|
|
2265
|
+
}
|
|
2266
|
+
);
|
|
2267
|
+
}
|
|
2268
|
+
function $t({
|
|
2269
|
+
axis: e,
|
|
2270
|
+
children: t,
|
|
2271
|
+
className: n,
|
|
2272
|
+
crossSpan: o,
|
|
2273
|
+
crossStart: r,
|
|
2274
|
+
disabled: i,
|
|
2275
|
+
elementRef: s,
|
|
2276
|
+
index: l,
|
|
2277
|
+
style: a
|
|
2278
|
+
}) {
|
|
2279
|
+
const c = ke(void 0), {
|
|
2280
|
+
getDisableCursor: u,
|
|
2281
|
+
getResizeAxisId: d,
|
|
2282
|
+
gutters: g,
|
|
2283
|
+
registerSeparator: m,
|
|
2284
|
+
separatorPlacements: y,
|
|
2285
|
+
trackCounts: f,
|
|
2286
|
+
updateSeparatorProps: S
|
|
2287
|
+
} = qt(), p = d(e), h = e === "column" ? "row" : "column", L = f[h], w = !!i || !st(l, f[e]);
|
|
2288
|
+
let C = !0;
|
|
2289
|
+
for (const v of y.values())
|
|
2290
|
+
if (v.axis === e && v.index === l && !v.disabled && v.crossStart < r) {
|
|
2291
|
+
C = !1;
|
|
2292
|
+
break;
|
|
2293
|
+
}
|
|
2294
|
+
const O = te(
|
|
2295
|
+
(v) => v.axis.id === p && v.axis.items.indexOf(v.items[1]) === l,
|
|
2296
|
+
[p, l]
|
|
2297
|
+
), D = te(
|
|
2298
|
+
(v) => m(
|
|
2299
|
+
{
|
|
2300
|
+
axis: e,
|
|
2301
|
+
crossSpan: o,
|
|
2302
|
+
crossStart: r,
|
|
2303
|
+
disabled: !!i,
|
|
2304
|
+
index: l
|
|
2305
|
+
},
|
|
2306
|
+
v
|
|
2307
|
+
),
|
|
2308
|
+
[e, o, r, i, l, m]
|
|
2309
|
+
), b = pn(l), x = hn({
|
|
2310
|
+
crossCount: L,
|
|
2311
|
+
crossSpan: o,
|
|
2312
|
+
crossStart: r,
|
|
2313
|
+
hasGutters: g[h]
|
|
2314
|
+
});
|
|
2315
|
+
return /* @__PURE__ */ W(
|
|
2316
|
+
rn,
|
|
2317
|
+
{
|
|
2318
|
+
axisId: p,
|
|
2319
|
+
axisOrientation: e === "column" ? "horizontal" : "vertical",
|
|
2320
|
+
className: n,
|
|
2321
|
+
disableCursor: u(),
|
|
2322
|
+
disabled: w,
|
|
2323
|
+
disableDoubleClick: void 0,
|
|
2324
|
+
elementRef: s,
|
|
2325
|
+
id: c,
|
|
2326
|
+
isSharedHitRegion: O,
|
|
2327
|
+
registerSeparator: D,
|
|
2328
|
+
requiredStyle: {
|
|
2329
|
+
gridColumn: e === "column" ? b : x,
|
|
2330
|
+
gridRow: e === "row" ? b : x
|
|
2331
|
+
},
|
|
2332
|
+
style: a,
|
|
2333
|
+
tabIndex: C ? 0 : -1,
|
|
2334
|
+
updateSeparatorProps: S,
|
|
2335
|
+
children: t
|
|
2336
|
+
}
|
|
2337
|
+
);
|
|
2338
|
+
}
|
|
2339
|
+
function sn(e) {
|
|
2340
|
+
const { children: t, className: n, disabled: o, elementRef: r, style: i } = e;
|
|
2341
|
+
return e.type === "column" ? /* @__PURE__ */ W(
|
|
2342
|
+
$t,
|
|
2343
|
+
{
|
|
2344
|
+
axis: "column",
|
|
2345
|
+
className: n,
|
|
2346
|
+
crossSpan: e.rowSpan,
|
|
2347
|
+
crossStart: e.row ?? 0,
|
|
2348
|
+
disabled: o,
|
|
2349
|
+
elementRef: r,
|
|
2350
|
+
index: e.column,
|
|
2351
|
+
style: i,
|
|
2352
|
+
children: t
|
|
2353
|
+
}
|
|
2354
|
+
) : /* @__PURE__ */ W(
|
|
2355
|
+
$t,
|
|
2356
|
+
{
|
|
2357
|
+
axis: "row",
|
|
2358
|
+
className: n,
|
|
2359
|
+
crossSpan: e.columnSpan,
|
|
2360
|
+
crossStart: e.column ?? 0,
|
|
2361
|
+
disabled: o,
|
|
2362
|
+
elementRef: r,
|
|
2363
|
+
index: e.row,
|
|
2364
|
+
style: i,
|
|
2365
|
+
children: t
|
|
2366
|
+
}
|
|
2367
|
+
);
|
|
2368
|
+
}
|
|
2369
|
+
sn.displayName = "Gridline";
|
|
2370
|
+
const Ce = ["column", "row"], Tt = { columns: {}, rows: {} };
|
|
2371
|
+
function Xn({
|
|
2372
|
+
children: e,
|
|
2373
|
+
className: t,
|
|
2374
|
+
columns: n,
|
|
2375
|
+
defaultLayout: o,
|
|
2376
|
+
disableCursor: r,
|
|
2377
|
+
disabled: i,
|
|
2378
|
+
elementRef: s,
|
|
2379
|
+
gridRef: l,
|
|
2380
|
+
id: a,
|
|
2381
|
+
onLayoutChange: c,
|
|
2382
|
+
onLayoutChanged: u,
|
|
2383
|
+
resizeTargetMinimumSize: d = {
|
|
2384
|
+
coarse: 20,
|
|
2385
|
+
fine: 10
|
|
2386
|
+
},
|
|
2387
|
+
rows: g,
|
|
2388
|
+
style: m,
|
|
2389
|
+
...y
|
|
2390
|
+
}) {
|
|
2391
|
+
const f = ke(a), S = te(
|
|
2392
|
+
(R) => R === "column" ? `${f}:columns` : `${f}:rows`,
|
|
2393
|
+
[f]
|
|
2394
|
+
), p = At(n, "columns"), h = At(g, "rows"), L = (R) => R === "column" ? p : h, w = q({
|
|
2395
|
+
onLayoutChange: Tt,
|
|
2396
|
+
onLayoutChanged: Tt
|
|
2397
|
+
}), C = ge((R) => {
|
|
2398
|
+
Dt(w.current.onLayoutChange, R) || (w.current.onLayoutChange = R, c?.(R));
|
|
2399
|
+
}), O = ge(
|
|
2400
|
+
(R, $, N) => {
|
|
2401
|
+
Dt(w.current.onLayoutChanged, R) || (w.current.onLayoutChanged = R, u?.(R, { isUserInteraction: $, requestedLayout: N }));
|
|
2402
|
+
}
|
|
2403
|
+
), D = q(null), b = Be(D, s), [x, v] = on(), E = q({
|
|
2404
|
+
cells: [],
|
|
2405
|
+
column: { expandedItemSizes: {}, layouts: {} },
|
|
2406
|
+
loggedErrors: /* @__PURE__ */ new Set(),
|
|
2407
|
+
row: { expandedItemSizes: {}, layouts: {} },
|
|
2408
|
+
separators: /* @__PURE__ */ new Map()
|
|
2409
|
+
}), P = { column: !1, row: !1 };
|
|
2410
|
+
for (const R of E.current.separators.values())
|
|
2411
|
+
P[R.axis] = !0;
|
|
2412
|
+
an(e, P);
|
|
2413
|
+
const k = Xe({
|
|
2414
|
+
defaultLayout: o,
|
|
2415
|
+
disableCursor: r,
|
|
2416
|
+
resizeTargetMinimumSize: d
|
|
2417
|
+
}), M = ge(() => !!k.disableCursor), z = te(
|
|
2418
|
+
(R) => {
|
|
2419
|
+
const $ = E.current;
|
|
2420
|
+
return $.cells = [...$.cells, R], v(), () => {
|
|
2421
|
+
$.cells = $.cells.filter(
|
|
2422
|
+
(N) => N !== R
|
|
2423
|
+
), v();
|
|
2424
|
+
};
|
|
2425
|
+
},
|
|
2426
|
+
[v]
|
|
2427
|
+
), I = te(
|
|
2428
|
+
(R, $) => {
|
|
2429
|
+
const N = E.current;
|
|
2430
|
+
return N.separators = new Map(N.separators), N.separators.set($, R), v(), () => {
|
|
2431
|
+
N.separators = new Map(N.separators), N.separators.delete($), v();
|
|
2432
|
+
};
|
|
2433
|
+
},
|
|
2434
|
+
[v]
|
|
2435
|
+
), _ = te(
|
|
2436
|
+
(R, {
|
|
2437
|
+
disabled: $,
|
|
2438
|
+
disableDoubleClick: N
|
|
2439
|
+
}) => {
|
|
2440
|
+
for (const G of E.current.separators.keys())
|
|
2441
|
+
G.id === R && (G.disabled = $, G.disableDoubleClick = N);
|
|
2442
|
+
},
|
|
2443
|
+
[]
|
|
2444
|
+
), Y = E.current.separators, J = Ee(
|
|
2445
|
+
() => ({
|
|
2446
|
+
getDisableCursor: M,
|
|
2447
|
+
getResizeAxisId: S,
|
|
2448
|
+
gutters: {
|
|
2449
|
+
column: P.column,
|
|
2450
|
+
row: P.row
|
|
2451
|
+
},
|
|
2452
|
+
id: f,
|
|
2453
|
+
registerCell: z,
|
|
2454
|
+
registerSeparator: I,
|
|
2455
|
+
separatorPlacements: Y,
|
|
2456
|
+
trackCounts: {
|
|
2457
|
+
column: p.length,
|
|
2458
|
+
row: h.length
|
|
2459
|
+
},
|
|
2460
|
+
updateSeparatorProps: _
|
|
2461
|
+
}),
|
|
2462
|
+
[
|
|
2463
|
+
p.length,
|
|
2464
|
+
M,
|
|
2465
|
+
S,
|
|
2466
|
+
P.column,
|
|
2467
|
+
P.row,
|
|
2468
|
+
f,
|
|
2469
|
+
z,
|
|
2470
|
+
I,
|
|
2471
|
+
h.length,
|
|
2472
|
+
Y,
|
|
2473
|
+
_
|
|
2474
|
+
]
|
|
2475
|
+
), K = q([]);
|
|
2476
|
+
ne(() => {
|
|
2477
|
+
const R = D.current;
|
|
2478
|
+
if (R === null)
|
|
2479
|
+
return;
|
|
2480
|
+
const $ = E.current, N = Zn({
|
|
2481
|
+
cells: $.cells,
|
|
2482
|
+
separatorPlacements: $.separators,
|
|
2483
|
+
trackCounts: { column: p.length, row: h.length }
|
|
2484
|
+
});
|
|
2485
|
+
N.forEach((T) => {
|
|
2486
|
+
$.loggedErrors.has(T) || console.error(T);
|
|
2487
|
+
}), $.loggedErrors = new Set(N);
|
|
2488
|
+
const G = (T) => Array.from($.separators.entries()).filter(([, j]) => j.axis === T).sort(([, j], [, ve]) => j.index - ve.index).map(([j]) => j), F = (T) => {
|
|
2489
|
+
const j = T === "column" ? p : h, ve = T === "column" ? h : p, pe = j.map((Z) => Z.id), Ve = S(T), He = G(T), be = He.length > 0, je = j.map(
|
|
2490
|
+
({ id: Z, ...ee }, Q) => ({
|
|
2491
|
+
// Tracks don't have DOM elements of their own;
|
|
2492
|
+
// the Grid element is used to resolve relative size constraints (e.g. "em")
|
|
2493
|
+
element: R,
|
|
2494
|
+
id: pe[Q],
|
|
2495
|
+
idIsStable: !0,
|
|
2496
|
+
mutableValues: {
|
|
2497
|
+
expandToSize: void 0,
|
|
2498
|
+
prevSize: void 0
|
|
2499
|
+
},
|
|
2500
|
+
onResize: void 0,
|
|
2501
|
+
constraintProps: ee
|
|
2502
|
+
})
|
|
2503
|
+
), Ae = () => {
|
|
2504
|
+
const Z = [];
|
|
2505
|
+
if (be) {
|
|
2506
|
+
for (const [ee, Q] of $.separators)
|
|
2507
|
+
if (Q.axis === T && st(Q.index, j.length)) {
|
|
2508
|
+
const Oe = ee.element.getBoundingClientRect();
|
|
2509
|
+
Z[Q.index] = Math.max(
|
|
2510
|
+
Z[Q.index] ?? 0,
|
|
2511
|
+
T === "column" ? Oe.width : Oe.height
|
|
2512
|
+
);
|
|
2513
|
+
}
|
|
2514
|
+
}
|
|
2515
|
+
return vn({
|
|
2516
|
+
axis: T,
|
|
2517
|
+
element: R,
|
|
2518
|
+
gutterSizes: Z.filter((ee) => ee !== void 0),
|
|
2519
|
+
hasGutters: be,
|
|
2520
|
+
layout: ae(Ve)?.layout,
|
|
2521
|
+
trackIds: pe
|
|
2522
|
+
});
|
|
2523
|
+
};
|
|
2524
|
+
let De;
|
|
2525
|
+
const Ze = k.defaultLayout?.[T === "column" ? "columns" : "rows"];
|
|
2526
|
+
if (Ze !== void 0 && Object.keys(Ze).length === pe.length) {
|
|
2527
|
+
De = {};
|
|
2528
|
+
for (const Z of pe) {
|
|
2529
|
+
const ee = Ze[Z];
|
|
2530
|
+
ee !== void 0 && (De[Z] = ee);
|
|
2531
|
+
}
|
|
2532
|
+
}
|
|
2533
|
+
return {
|
|
2534
|
+
disabled: !!i,
|
|
2535
|
+
element: R,
|
|
2536
|
+
id: Ve,
|
|
2537
|
+
layoutStrategy: {
|
|
2538
|
+
getItemAriaControls: (Z) => {
|
|
2539
|
+
const ee = pe.indexOf(Z);
|
|
2540
|
+
return $.cells.filter((Q) => {
|
|
2541
|
+
const Oe = T === "column" ? Q.column : Q.row, cn = T === "column" ? Q.columnSpan : Q.rowSpan;
|
|
2542
|
+
return Oe <= ee && ee < Oe + cn;
|
|
2543
|
+
}).map((Q) => Q.element.id).filter(Boolean).join(" ") || void 0;
|
|
2544
|
+
},
|
|
2545
|
+
calculateAvailableSize: () => Ae().availableSize,
|
|
2546
|
+
calculateHitRegions: ({
|
|
2547
|
+
expandHitTargets: Z,
|
|
2548
|
+
axis: ee,
|
|
2549
|
+
includeDisabled: Q
|
|
2550
|
+
}) => Sn({
|
|
2551
|
+
axis: T,
|
|
2552
|
+
cells: $.cells,
|
|
2553
|
+
crossTrackCount: ve.length,
|
|
2554
|
+
expandHitTargets: Z,
|
|
2555
|
+
resizeAxis: ee,
|
|
2556
|
+
axisSize: Ae().availableSize,
|
|
2557
|
+
includeDisabled: Q,
|
|
2558
|
+
separatorPlacements: $.separators
|
|
2559
|
+
}),
|
|
2560
|
+
getItemSizeInPixels: (Z) => Ae().trackSizes[pe.indexOf(Z)] ?? 0
|
|
2561
|
+
},
|
|
2562
|
+
mutableState: {
|
|
2563
|
+
defaultLayout: De,
|
|
2564
|
+
disableCursor: !!k.disableCursor,
|
|
2565
|
+
expandedItemSizes: $[T].expandedItemSizes,
|
|
2566
|
+
layouts: $[T].layouts
|
|
2567
|
+
},
|
|
2568
|
+
orientation: T === "column" ? "horizontal" : "vertical",
|
|
2569
|
+
items: je,
|
|
2570
|
+
resizePreviewMode: "panel",
|
|
2571
|
+
get resizeTargetMinimumSize() {
|
|
2572
|
+
return k.resizeTargetMinimumSize;
|
|
2573
|
+
},
|
|
2574
|
+
separators: He
|
|
2575
|
+
};
|
|
2576
|
+
}, V = Ce.map(F);
|
|
2577
|
+
K.current = V;
|
|
2578
|
+
const H = V.map((T) => tn(T)), ie = () => {
|
|
2579
|
+
const [T, j] = V.map(
|
|
2580
|
+
(ve) => ae(ve.id)
|
|
2581
|
+
);
|
|
2582
|
+
if (!(!T || !j || T.defaultLayoutDeferred || j.defaultLayoutDeferred))
|
|
2583
|
+
return {
|
|
2584
|
+
layout: { columns: T.layout, rows: j.layout },
|
|
2585
|
+
requestedLayout: {
|
|
2586
|
+
columns: T.requestedLayout,
|
|
2587
|
+
rows: j.requestedLayout
|
|
1725
2588
|
}
|
|
2589
|
+
};
|
|
2590
|
+
};
|
|
2591
|
+
{
|
|
2592
|
+
const T = ie();
|
|
2593
|
+
T && (C(T.layout), O(T.layout, !1, T.requestedLayout));
|
|
2594
|
+
}
|
|
2595
|
+
const Te = V.map(
|
|
2596
|
+
(T) => _e(T.id, (j) => {
|
|
2597
|
+
const {
|
|
2598
|
+
defaultLayoutDeferred: ve,
|
|
2599
|
+
derivedItemConstraints: pe,
|
|
2600
|
+
layout: Ve,
|
|
2601
|
+
requestedLayout: He
|
|
2602
|
+
} = j.next;
|
|
2603
|
+
if (ve || pe.length === 0)
|
|
2604
|
+
return;
|
|
2605
|
+
nn({
|
|
2606
|
+
derivedItemConstraints: pe,
|
|
2607
|
+
axis: T,
|
|
2608
|
+
layout: Ve,
|
|
2609
|
+
prevLayout: j.prev?.layout,
|
|
2610
|
+
requestedLayout: He
|
|
2611
|
+
});
|
|
2612
|
+
const be = ie();
|
|
2613
|
+
if (be) {
|
|
2614
|
+
const je = fe(), Ae = je.state !== "active" || !je.hitRegions.some(
|
|
2615
|
+
(De) => V.includes(De.axis)
|
|
2616
|
+
);
|
|
2617
|
+
C(be.layout), Ae && O(
|
|
2618
|
+
be.layout,
|
|
2619
|
+
j.isUserInteraction,
|
|
2620
|
+
be.requestedLayout
|
|
2621
|
+
);
|
|
1726
2622
|
}
|
|
2623
|
+
})
|
|
2624
|
+
);
|
|
2625
|
+
return () => {
|
|
2626
|
+
K.current = [], H.forEach((T) => T()), Te.forEach((T) => T());
|
|
2627
|
+
};
|
|
2628
|
+
}, [
|
|
2629
|
+
p,
|
|
2630
|
+
i,
|
|
2631
|
+
S,
|
|
2632
|
+
f,
|
|
2633
|
+
O,
|
|
2634
|
+
C,
|
|
2635
|
+
h,
|
|
2636
|
+
x,
|
|
2637
|
+
k
|
|
2638
|
+
]), qe(() => {
|
|
2639
|
+
K.current.forEach((R) => {
|
|
2640
|
+
R.mutableState.defaultLayout = o?.[R.orientation === "horizontal" ? "columns" : "rows"], R.mutableState.disableCursor = !!r;
|
|
1727
2641
|
});
|
|
2642
|
+
}), it(l, () => {
|
|
2643
|
+
const R = () => {
|
|
2644
|
+
const [G, F] = Ce.map(S);
|
|
2645
|
+
return !Re(G) || !Re(F) ? { columns: {}, rows: {} } : {
|
|
2646
|
+
columns: Ne({
|
|
2647
|
+
axisId: G
|
|
2648
|
+
}).getLayout(),
|
|
2649
|
+
rows: Ne({ axisId: F }).getLayout()
|
|
2650
|
+
};
|
|
2651
|
+
}, $ = (G) => G.map((F) => `"${F}"`).join(", "), N = (G, F) => {
|
|
2652
|
+
const V = S(G), H = () => {
|
|
2653
|
+
const ie = Re(V);
|
|
2654
|
+
return A(ie, `Grid "${f}" has not been mounted`), A(
|
|
2655
|
+
ie.items.some((Te) => Te.id === F),
|
|
2656
|
+
`Grid "${f}" no longer contains a ${G} with id "${F}"; ${G} ids are ${$(ie.items.map((Te) => Te.id))}`
|
|
2657
|
+
), dt({ axisId: V, itemId: F });
|
|
2658
|
+
};
|
|
2659
|
+
return {
|
|
2660
|
+
collapse: () => H().collapse(),
|
|
2661
|
+
expand: () => H().expand(),
|
|
2662
|
+
getSize: () => H().getSize(),
|
|
2663
|
+
isCollapsed: () => H().isCollapsed(),
|
|
2664
|
+
resize: (ie) => H().resize(ie)
|
|
2665
|
+
};
|
|
2666
|
+
};
|
|
2667
|
+
return {
|
|
2668
|
+
getLayout: R,
|
|
2669
|
+
getTrackById: (G, F) => {
|
|
2670
|
+
const V = G === "column" ? p : h, H = `${F}`;
|
|
2671
|
+
return A(
|
|
2672
|
+
V.some((ie) => ie.id === H),
|
|
2673
|
+
`Grid "${f}" does not contain a ${G} with id "${H}"; ${G} ids are ${$(V.map((ie) => ie.id))}`
|
|
2674
|
+
), N(G, H);
|
|
2675
|
+
},
|
|
2676
|
+
getTrackByIndex: (G, F) => {
|
|
2677
|
+
const V = G === "column" ? p : h, H = Number.isInteger(F) ? V[F] : void 0;
|
|
2678
|
+
return A(
|
|
2679
|
+
H,
|
|
2680
|
+
`Grid "${f}" does not contain a ${G} at index ${F}; it has ${V.length} ${G}s`
|
|
2681
|
+
), N(G, H.id);
|
|
2682
|
+
},
|
|
2683
|
+
setLayout: (G) => (Ce.forEach((F) => {
|
|
2684
|
+
const V = G[F === "column" ? "columns" : "rows"], H = S(F);
|
|
2685
|
+
V && Re(H) && Ne({ axisId: H }).setLayout(V);
|
|
2686
|
+
}), R())
|
|
2687
|
+
};
|
|
2688
|
+
}, [p, S, f, h]);
|
|
2689
|
+
const oe = () => Ce.map((R) => {
|
|
2690
|
+
const $ = ae(S(R)), N = L(R);
|
|
2691
|
+
return ($ && !$.defaultLayoutDeferred ? N.map((F) => `minmax(0, ${$.layout[F.id] ?? 1}fr)`) : Jn(
|
|
2692
|
+
N,
|
|
2693
|
+
o?.[R === "column" ? "columns" : "rows"]
|
|
2694
|
+
)).join(P[R] ? " auto " : " ");
|
|
2695
|
+
}).join("|"), we = te(
|
|
2696
|
+
(R) => {
|
|
2697
|
+
const $ = Ce.map(
|
|
2698
|
+
(N) => _e(S(N), R)
|
|
2699
|
+
);
|
|
2700
|
+
return () => $.forEach((N) => N());
|
|
2701
|
+
},
|
|
2702
|
+
[S]
|
|
2703
|
+
), $e = Ke(
|
|
2704
|
+
we,
|
|
2705
|
+
oe,
|
|
2706
|
+
oe
|
|
2707
|
+
), [ze, re] = $e.split("|");
|
|
2708
|
+
return /* @__PURE__ */ W(Ft.Provider, { value: J, children: /* @__PURE__ */ W(
|
|
2709
|
+
"div",
|
|
2710
|
+
{
|
|
2711
|
+
...y,
|
|
2712
|
+
className: t,
|
|
2713
|
+
"data-grid": !0,
|
|
2714
|
+
"data-testid": f,
|
|
2715
|
+
id: f,
|
|
2716
|
+
ref: b,
|
|
2717
|
+
style: {
|
|
2718
|
+
height: "100%",
|
|
2719
|
+
width: "100%",
|
|
2720
|
+
overflow: "hidden",
|
|
2721
|
+
...m,
|
|
2722
|
+
display: "grid",
|
|
2723
|
+
gridTemplateColumns: ze,
|
|
2724
|
+
gridTemplateRows: re,
|
|
2725
|
+
// Inform the browser that the library is handling touch events for this element
|
|
2726
|
+
// NOTE This is not an inherited style
|
|
2727
|
+
touchAction: "none"
|
|
2728
|
+
},
|
|
2729
|
+
children: /* @__PURE__ */ W(ft.Provider, { value: null, children: e })
|
|
2730
|
+
}
|
|
2731
|
+
) });
|
|
2732
|
+
}
|
|
2733
|
+
Xn.displayName = "Grid";
|
|
2734
|
+
function At(e, t) {
|
|
2735
|
+
const n = JSON.stringify(e);
|
|
2736
|
+
return Ee(() => {
|
|
2737
|
+
const o = typeof e == "number" ? Array.from({ length: e }, (r, i) => ({ id: `${i}` })) : e.map((r, i) => ({
|
|
2738
|
+
...r,
|
|
2739
|
+
id: `${r.id ?? i}`
|
|
2740
|
+
}));
|
|
2741
|
+
return A(
|
|
2742
|
+
o.length > 0,
|
|
2743
|
+
`Grid must have at least one track; "${t}" is ${n}`
|
|
2744
|
+
), o;
|
|
2745
|
+
}, [n]);
|
|
2746
|
+
}
|
|
2747
|
+
function an(e, t) {
|
|
2748
|
+
fn.forEach(e, (n) => {
|
|
2749
|
+
if (_t(n))
|
|
2750
|
+
if (n.type === sn) {
|
|
2751
|
+
const { type: o } = n.props;
|
|
2752
|
+
o === "column" ? t.column = !0 : o === "row" && (t.row = !0);
|
|
2753
|
+
} else // Fragments
|
|
2754
|
+
typeof n.type == "symbol" && n.props !== null && typeof n.props == "object" && "children" in n.props && an(n.props.children, t);
|
|
1728
2755
|
});
|
|
1729
2756
|
}
|
|
1730
|
-
function
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
2757
|
+
function Jn(e, t) {
|
|
2758
|
+
if (t)
|
|
2759
|
+
return e.map(
|
|
2760
|
+
(i) => `minmax(0, ${t[i.id] ?? 1}fr)`
|
|
2761
|
+
);
|
|
2762
|
+
const n = e.map(
|
|
2763
|
+
(i) => i.defaultSize === void 0 ? void 0 : Bt(i.defaultSize)
|
|
2764
|
+
);
|
|
2765
|
+
let o = 100, r = 0;
|
|
2766
|
+
return n.forEach((i) => {
|
|
2767
|
+
i === void 0 ? r++ : i[1] === "%" && (o -= i[0]);
|
|
2768
|
+
}), n.map((i) => {
|
|
2769
|
+
if (i === void 0)
|
|
2770
|
+
return `minmax(0, ${Math.max(0, o) / Math.max(1, r)}fr)`;
|
|
2771
|
+
const [s, l] = i;
|
|
2772
|
+
return l === "%" ? `minmax(0, ${s}fr)` : `${s}${l}`;
|
|
2773
|
+
});
|
|
2774
|
+
}
|
|
2775
|
+
function Zn({
|
|
2776
|
+
cells: e,
|
|
2777
|
+
separatorPlacements: t,
|
|
2778
|
+
trackCounts: n
|
|
2779
|
+
}) {
|
|
2780
|
+
const o = [];
|
|
2781
|
+
for (const l of e)
|
|
2782
|
+
Ce.forEach((a) => {
|
|
2783
|
+
const [c, u] = a === "column" ? [l.column, l.columnSpan] : [l.row, l.rowSpan], d = n[a];
|
|
2784
|
+
(!Number.isInteger(c) || !Number.isInteger(u) || c < 0 || u < 1 || c + u > d) && o.push(
|
|
2785
|
+
`Invalid Cell ${a} placement (${a}: ${c}, ${a}Span: ${u}); Grid has ${d} ${a}s`
|
|
2786
|
+
);
|
|
2787
|
+
});
|
|
2788
|
+
const r = ({
|
|
2789
|
+
axis: l,
|
|
2790
|
+
crossSpan: a,
|
|
2791
|
+
crossStart: c,
|
|
2792
|
+
disabled: u,
|
|
2793
|
+
index: d
|
|
2794
|
+
}) => {
|
|
2795
|
+
const g = l === "column" ? "row" : "column";
|
|
2796
|
+
let m = `type="${l}" ${l}={${d}}`;
|
|
2797
|
+
return (c !== 0 || a !== void 0) && (m += ` ${g}={${c}}`), a !== void 0 && (m += ` ${g}Span={${a}}`), u && (m += " disabled"), `<Gridline ${m} />`;
|
|
2798
|
+
}, i = Array.from(t.values()).filter(
|
|
2799
|
+
(l) => {
|
|
2800
|
+
const { axis: a, crossSpan: c, crossStart: u, index: d } = l, g = a === "column" ? "row" : "column", m = n[a], y = n[g];
|
|
2801
|
+
let f = !0;
|
|
2802
|
+
return st(d, m) || (o.push(
|
|
2803
|
+
`Invalid ${a} Gridline ${a} (${d}); must be between 1 and ${m - 1}`
|
|
2804
|
+
), f = !1), !Number.isInteger(u) || u < 0 || u >= y ? (o.push(
|
|
2805
|
+
`Invalid ${a} Gridline ${g} (${u}); must be between 0 and ${y - 1}`
|
|
2806
|
+
), f = !1) : c !== void 0 && (!Number.isInteger(c) || c < 1 || u + c > y) && (o.push(
|
|
2807
|
+
`Invalid ${a} Gridline ${g}Span (${c}); Grid has ${y} ${g}s`
|
|
2808
|
+
), f = !1), f;
|
|
2809
|
+
}
|
|
2810
|
+
), s = (l) => {
|
|
2811
|
+
const a = n[l.axis === "column" ? "row" : "column"];
|
|
2812
|
+
return [
|
|
2813
|
+
l.crossStart,
|
|
2814
|
+
l.crossSpan === void 0 ? a : l.crossStart + l.crossSpan
|
|
2815
|
+
];
|
|
2816
|
+
};
|
|
2817
|
+
return i.forEach((l, a) => {
|
|
2818
|
+
const { axis: c, index: u } = l, [d, g] = s(l);
|
|
2819
|
+
for (const m of e) {
|
|
2820
|
+
const [y, f, S, p] = c === "column" ? [m.column, m.columnSpan, m.row, m.rowSpan] : [m.row, m.rowSpan, m.column, m.columnSpan];
|
|
2821
|
+
if (y < u && u < y + f && S < g && d < S + p) {
|
|
2822
|
+
const h = c === "column" ? "row" : "column";
|
|
2823
|
+
o.push(
|
|
2824
|
+
`${r(l)} overlaps a Cell that spans across it (${c}: ${y}, ${c}Span: ${f}, ${h}: ${S}, ${h}Span: ${p}); use the ${h} and ${h}Span props to render gridlines beside the Cell instead`
|
|
2825
|
+
);
|
|
2826
|
+
}
|
|
2827
|
+
}
|
|
2828
|
+
for (const m of i.slice(a + 1))
|
|
2829
|
+
if (m.axis === c && m.index === u) {
|
|
2830
|
+
const [y, f] = s(m);
|
|
2831
|
+
y < g && d < f && o.push(`${r(l)} overlaps ${r(m)}`);
|
|
2832
|
+
}
|
|
2833
|
+
}), o;
|
|
2834
|
+
}
|
|
2835
|
+
function Dt(e, t) {
|
|
2836
|
+
return se(e.columns, t.columns) && se(e.rows, t.rows);
|
|
2837
|
+
}
|
|
2838
|
+
function yo({
|
|
2839
|
+
id: e,
|
|
2840
|
+
onlySaveAfterUserInteractions: t,
|
|
2841
|
+
storage: n = localStorage
|
|
2842
|
+
}) {
|
|
2843
|
+
const o = `react-resizable-panels:grid:${e}`, r = Ke(
|
|
2844
|
+
Qn,
|
|
2845
|
+
() => n.getItem(o),
|
|
2846
|
+
() => n.getItem(o)
|
|
2847
|
+
), i = Ee(() => {
|
|
2848
|
+
if (r)
|
|
2849
|
+
try {
|
|
2850
|
+
const l = JSON.parse(r);
|
|
2851
|
+
if (l !== null && typeof l == "object")
|
|
2852
|
+
return l;
|
|
2853
|
+
} catch {
|
|
2854
|
+
}
|
|
2855
|
+
}, [r]), s = te(
|
|
2856
|
+
(l, a) => {
|
|
2857
|
+
if (!(t && !a.isUserInteraction))
|
|
2858
|
+
try {
|
|
2859
|
+
n.setItem(
|
|
2860
|
+
o,
|
|
2861
|
+
JSON.stringify(a.requestedLayout ?? l)
|
|
2862
|
+
);
|
|
2863
|
+
} catch (c) {
|
|
2864
|
+
console.error(c);
|
|
2865
|
+
}
|
|
2866
|
+
},
|
|
2867
|
+
[t, n, o]
|
|
2868
|
+
);
|
|
2869
|
+
return {
|
|
2870
|
+
/**
|
|
2871
|
+
* Pass this value to `Grid` as the `defaultLayout` prop.
|
|
2872
|
+
*/
|
|
2873
|
+
defaultLayout: i,
|
|
2874
|
+
/**
|
|
2875
|
+
* Attach this callback on the `Grid` as the `onLayoutChanged` prop.
|
|
2876
|
+
*/
|
|
2877
|
+
onLayoutChanged: s
|
|
2878
|
+
};
|
|
2879
|
+
}
|
|
2880
|
+
function Qn() {
|
|
2881
|
+
return function() {
|
|
2882
|
+
};
|
|
2883
|
+
}
|
|
2884
|
+
function So() {
|
|
2885
|
+
return he(null);
|
|
1736
2886
|
}
|
|
1737
|
-
|
|
1738
|
-
|
|
2887
|
+
function vo() {
|
|
2888
|
+
return q(null);
|
|
2889
|
+
}
|
|
2890
|
+
function eo({
|
|
1739
2891
|
separator: e
|
|
1740
2892
|
}) {
|
|
1741
|
-
const { element: t } = e, n =
|
|
1742
|
-
return
|
|
2893
|
+
const { element: t } = e, n = q(null);
|
|
2894
|
+
return ne(() => {
|
|
1743
2895
|
const o = t.cloneNode(!0), r = [t, ...t.querySelectorAll("*")], i = [o, ...o.querySelectorAll("*")], s = t.ownerDocument.defaultView;
|
|
1744
|
-
return r.forEach((
|
|
1745
|
-
const
|
|
1746
|
-
if (
|
|
1747
|
-
const
|
|
1748
|
-
for (let
|
|
1749
|
-
const
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
2896
|
+
return r.forEach((l, a) => {
|
|
2897
|
+
const c = i[a];
|
|
2898
|
+
if (c instanceof s.HTMLElement || c instanceof s.SVGElement) {
|
|
2899
|
+
const u = s.getComputedStyle(l);
|
|
2900
|
+
for (let d = 0; d < u.length; d++) {
|
|
2901
|
+
const g = u.item(d);
|
|
2902
|
+
c.style.setProperty(
|
|
2903
|
+
g,
|
|
2904
|
+
u.getPropertyValue(g)
|
|
1753
2905
|
);
|
|
1754
2906
|
}
|
|
1755
2907
|
}
|
|
1756
|
-
|
|
2908
|
+
c.removeAttribute("data-testid"), c.removeAttribute("id");
|
|
1757
2909
|
}), Object.assign(o.style, {
|
|
1758
2910
|
boxSizing: "border-box",
|
|
1759
2911
|
height: "100%",
|
|
@@ -1762,7 +2914,7 @@ function ln({
|
|
|
1762
2914
|
transform: "none",
|
|
1763
2915
|
width: "100%"
|
|
1764
2916
|
}), n.current.appendChild(o), () => o.remove();
|
|
1765
|
-
}, [t]), /* @__PURE__ */
|
|
2917
|
+
}, [t]), /* @__PURE__ */ W(
|
|
1766
2918
|
"div",
|
|
1767
2919
|
{
|
|
1768
2920
|
ref: n,
|
|
@@ -1775,24 +2927,24 @@ function ln({
|
|
|
1775
2927
|
}
|
|
1776
2928
|
);
|
|
1777
2929
|
}
|
|
1778
|
-
function
|
|
1779
|
-
const e =
|
|
1780
|
-
return
|
|
2930
|
+
function Je() {
|
|
2931
|
+
const e = Gt(ft);
|
|
2932
|
+
return A(
|
|
1781
2933
|
e,
|
|
1782
2934
|
"Group Context not found; did you render a Panel or Separator outside of a Group?"
|
|
1783
2935
|
), e;
|
|
1784
2936
|
}
|
|
1785
|
-
function
|
|
1786
|
-
const { registerOverlay: t } =
|
|
1787
|
-
|
|
2937
|
+
function ln(e) {
|
|
2938
|
+
const { registerOverlay: t } = Je(), n = q(e);
|
|
2939
|
+
en(n.current, e) || (n.current = e);
|
|
1788
2940
|
const o = n.current;
|
|
1789
|
-
return
|
|
2941
|
+
return ne(
|
|
1790
2942
|
() => t(o),
|
|
1791
2943
|
[t, o]
|
|
1792
2944
|
), null;
|
|
1793
2945
|
}
|
|
1794
|
-
|
|
1795
|
-
function
|
|
2946
|
+
ln.displayName = "SeparatorOverlay";
|
|
2947
|
+
function to({
|
|
1796
2948
|
active: e,
|
|
1797
2949
|
orientation: t,
|
|
1798
2950
|
style: n,
|
|
@@ -1815,7 +2967,7 @@ function cn({
|
|
|
1815
2967
|
break;
|
|
1816
2968
|
}
|
|
1817
2969
|
}
|
|
1818
|
-
return /* @__PURE__ */
|
|
2970
|
+
return /* @__PURE__ */ W(
|
|
1819
2971
|
"div",
|
|
1820
2972
|
{
|
|
1821
2973
|
...o,
|
|
@@ -1829,20 +2981,20 @@ function cn({
|
|
|
1829
2981
|
}
|
|
1830
2982
|
);
|
|
1831
2983
|
}
|
|
1832
|
-
function
|
|
2984
|
+
function no({
|
|
1833
2985
|
overlay: e,
|
|
1834
2986
|
preview: t
|
|
1835
2987
|
}) {
|
|
1836
|
-
const {
|
|
1837
|
-
let
|
|
1838
|
-
return
|
|
1839
|
-
|
|
2988
|
+
const { axis: n, offset: o, rect: r, separator: i } = t, s = n.orientation === "horizontal";
|
|
2989
|
+
let l = i?.preview, a = e;
|
|
2990
|
+
return _t(l) && l.type === ln && (a = l.props, l = void 0), l == null && (a ? l = /* @__PURE__ */ W(
|
|
2991
|
+
to,
|
|
1840
2992
|
{
|
|
1841
|
-
...
|
|
2993
|
+
...a,
|
|
1842
2994
|
active: t.active,
|
|
1843
2995
|
orientation: n.orientation
|
|
1844
2996
|
}
|
|
1845
|
-
) : i && (
|
|
2997
|
+
) : i && (l = /* @__PURE__ */ W(eo, { separator: i }))), /* @__PURE__ */ W(
|
|
1846
2998
|
"div",
|
|
1847
2999
|
{
|
|
1848
3000
|
"aria-hidden": "true",
|
|
@@ -1857,47 +3009,47 @@ function un({
|
|
|
1857
3009
|
transform: s ? `translateX(${o}px)` : `translateY(${o}px)`,
|
|
1858
3010
|
width: r.width
|
|
1859
3011
|
},
|
|
1860
|
-
children:
|
|
3012
|
+
children: l
|
|
1861
3013
|
}
|
|
1862
3014
|
);
|
|
1863
3015
|
}
|
|
1864
|
-
function
|
|
1865
|
-
const n =
|
|
3016
|
+
function oo(e, t) {
|
|
3017
|
+
const n = q({
|
|
1866
3018
|
getLayout: () => ({}),
|
|
1867
|
-
setLayout:
|
|
3019
|
+
setLayout: zn
|
|
1868
3020
|
});
|
|
1869
|
-
|
|
3021
|
+
it(t, () => n.current, []), ne(() => {
|
|
1870
3022
|
Object.assign(
|
|
1871
3023
|
n.current,
|
|
1872
|
-
|
|
3024
|
+
Ne({ axisId: e })
|
|
1873
3025
|
);
|
|
1874
3026
|
});
|
|
1875
3027
|
}
|
|
1876
|
-
function
|
|
3028
|
+
function ro({
|
|
1877
3029
|
groupId: e,
|
|
1878
3030
|
resizePreviewMode: t
|
|
1879
3031
|
}) {
|
|
1880
|
-
const [n, o] =
|
|
1881
|
-
return
|
|
1882
|
-
const i = (
|
|
1883
|
-
const
|
|
1884
|
-
(
|
|
1885
|
-
) : [],
|
|
1886
|
-
|
|
1887
|
-
(
|
|
1888
|
-
) || (r.current =
|
|
3032
|
+
const [n, o] = he([]), r = q(n);
|
|
3033
|
+
return ne(() => {
|
|
3034
|
+
const i = (l) => {
|
|
3035
|
+
const a = Re(e), c = t === "separator" && l.state === "active" ? l.previews.filter(
|
|
3036
|
+
(d) => d.axis === a && (d.active || !U(d.offset, 0))
|
|
3037
|
+
) : [], u = r.current;
|
|
3038
|
+
u.length === c.length && c.every(
|
|
3039
|
+
(d, g) => d === u[g]
|
|
3040
|
+
) || (r.current = c, o(c));
|
|
1889
3041
|
};
|
|
1890
3042
|
if (t !== "separator") {
|
|
1891
|
-
i(
|
|
3043
|
+
i(fe());
|
|
1892
3044
|
return;
|
|
1893
3045
|
}
|
|
1894
|
-
const s =
|
|
1895
|
-
({ next:
|
|
3046
|
+
const s = Ht(
|
|
3047
|
+
({ next: l }) => i(l)
|
|
1896
3048
|
);
|
|
1897
|
-
return i(
|
|
3049
|
+
return i(fe()), s;
|
|
1898
3050
|
}, [e, t]), n;
|
|
1899
3051
|
}
|
|
1900
|
-
function
|
|
3052
|
+
function io({
|
|
1901
3053
|
children: e,
|
|
1902
3054
|
className: t,
|
|
1903
3055
|
defaultLayout: n,
|
|
@@ -1905,251 +3057,252 @@ function pn({
|
|
|
1905
3057
|
disabled: r,
|
|
1906
3058
|
elementRef: i,
|
|
1907
3059
|
groupRef: s,
|
|
1908
|
-
id:
|
|
1909
|
-
onLayoutChange:
|
|
1910
|
-
onLayoutChanged:
|
|
1911
|
-
orientation:
|
|
1912
|
-
resizePreviewMode:
|
|
1913
|
-
resizeTargetMinimumSize:
|
|
3060
|
+
id: l,
|
|
3061
|
+
onLayoutChange: a,
|
|
3062
|
+
onLayoutChanged: c,
|
|
3063
|
+
orientation: u = "horizontal",
|
|
3064
|
+
resizePreviewMode: d = "panel",
|
|
3065
|
+
resizeTargetMinimumSize: g = {
|
|
1914
3066
|
coarse: 20,
|
|
1915
3067
|
fine: 10
|
|
1916
3068
|
},
|
|
1917
|
-
style:
|
|
1918
|
-
...
|
|
3069
|
+
style: m,
|
|
3070
|
+
...y
|
|
1919
3071
|
}) {
|
|
1920
|
-
const
|
|
3072
|
+
const f = q({
|
|
1921
3073
|
onLayoutChange: {},
|
|
1922
3074
|
onLayoutChanged: {}
|
|
1923
|
-
}),
|
|
1924
|
-
|
|
1925
|
-
}),
|
|
1926
|
-
(
|
|
1927
|
-
|
|
1928
|
-
}
|
|
1929
|
-
),
|
|
1930
|
-
groupId:
|
|
1931
|
-
resizePreviewMode:
|
|
1932
|
-
}),
|
|
3075
|
+
}), S = ge((z) => {
|
|
3076
|
+
se(f.current.onLayoutChange, z) || (f.current.onLayoutChange = z, a?.(z));
|
|
3077
|
+
}), p = ge(
|
|
3078
|
+
(z, I, _) => {
|
|
3079
|
+
se(f.current.onLayoutChanged, z) || (f.current.onLayoutChanged = z, c?.(z, { isUserInteraction: I, requestedLayout: _ }));
|
|
3080
|
+
}
|
|
3081
|
+
), h = ke(l), [L, w] = he(), C = ro({
|
|
3082
|
+
groupId: h,
|
|
3083
|
+
resizePreviewMode: d
|
|
3084
|
+
}), O = q(null), [D, b] = on(), x = q({
|
|
1933
3085
|
lastExpandedPanelSizes: {},
|
|
1934
3086
|
layouts: {},
|
|
1935
3087
|
panels: [],
|
|
1936
3088
|
separators: []
|
|
1937
|
-
}),
|
|
1938
|
-
|
|
1939
|
-
const
|
|
1940
|
-
(
|
|
1941
|
-
const
|
|
1942
|
-
if (
|
|
3089
|
+
}), v = Be(O, i);
|
|
3090
|
+
oo(h, s);
|
|
3091
|
+
const E = ge(
|
|
3092
|
+
(z, I) => {
|
|
3093
|
+
const _ = ae(z);
|
|
3094
|
+
if (_)
|
|
1943
3095
|
return {
|
|
1944
|
-
flexGrow:
|
|
3096
|
+
flexGrow: _.layout[I] ?? 1
|
|
1945
3097
|
};
|
|
1946
|
-
if (n?.[
|
|
3098
|
+
if (n?.[I])
|
|
1947
3099
|
return {
|
|
1948
|
-
flexGrow: n?.[
|
|
3100
|
+
flexGrow: n?.[I]
|
|
1949
3101
|
};
|
|
1950
3102
|
}
|
|
1951
|
-
),
|
|
3103
|
+
), P = Xe({
|
|
1952
3104
|
defaultLayout: n,
|
|
1953
3105
|
disableCursor: o,
|
|
1954
|
-
resizeTargetMinimumSize:
|
|
1955
|
-
}),
|
|
3106
|
+
resizeTargetMinimumSize: g
|
|
3107
|
+
}), k = Ee(
|
|
1956
3108
|
() => ({
|
|
1957
3109
|
get disableCursor() {
|
|
1958
|
-
return !!
|
|
3110
|
+
return !!P.disableCursor;
|
|
1959
3111
|
},
|
|
1960
|
-
getPanelStyles:
|
|
1961
|
-
id:
|
|
1962
|
-
orientation:
|
|
1963
|
-
registerPanel: (
|
|
1964
|
-
const
|
|
1965
|
-
return
|
|
1966
|
-
...
|
|
1967
|
-
|
|
1968
|
-
]),
|
|
1969
|
-
|
|
1970
|
-
(
|
|
1971
|
-
),
|
|
3112
|
+
getPanelStyles: E,
|
|
3113
|
+
id: h,
|
|
3114
|
+
orientation: u,
|
|
3115
|
+
registerPanel: (z) => {
|
|
3116
|
+
const I = x.current;
|
|
3117
|
+
return I.panels = nt(u, [
|
|
3118
|
+
...I.panels,
|
|
3119
|
+
z
|
|
3120
|
+
]), b(), () => {
|
|
3121
|
+
I.panels = I.panels.filter(
|
|
3122
|
+
(_) => _ !== z
|
|
3123
|
+
), b();
|
|
1972
3124
|
};
|
|
1973
3125
|
},
|
|
1974
|
-
registerOverlay: (
|
|
1975
|
-
|
|
3126
|
+
registerOverlay: (z) => (w(z), () => {
|
|
3127
|
+
w(void 0);
|
|
1976
3128
|
}),
|
|
1977
|
-
registerSeparator: (
|
|
1978
|
-
const
|
|
1979
|
-
return
|
|
1980
|
-
...
|
|
1981
|
-
|
|
1982
|
-
]),
|
|
1983
|
-
|
|
1984
|
-
(
|
|
1985
|
-
),
|
|
3129
|
+
registerSeparator: (z) => {
|
|
3130
|
+
const I = x.current;
|
|
3131
|
+
return I.separators = nt(u, [
|
|
3132
|
+
...I.separators,
|
|
3133
|
+
z
|
|
3134
|
+
]), b(), () => {
|
|
3135
|
+
I.separators = I.separators.filter(
|
|
3136
|
+
(_) => _ !== z
|
|
3137
|
+
), b();
|
|
1986
3138
|
};
|
|
1987
3139
|
},
|
|
1988
|
-
updatePanelProps: (
|
|
1989
|
-
const
|
|
1990
|
-
(oe) => oe.id ===
|
|
3140
|
+
updatePanelProps: (z, { disabled: I }) => {
|
|
3141
|
+
const Y = x.current.panels.find(
|
|
3142
|
+
(oe) => oe.id === z
|
|
1991
3143
|
);
|
|
1992
|
-
|
|
1993
|
-
const
|
|
1994
|
-
|
|
1995
|
-
...
|
|
1996
|
-
|
|
3144
|
+
Y && (Y.constraintProps.disabled = I);
|
|
3145
|
+
const J = Re(h), K = ae(h);
|
|
3146
|
+
J && K && me(J, {
|
|
3147
|
+
...K,
|
|
3148
|
+
derivedItemConstraints: rt(J)
|
|
1997
3149
|
});
|
|
1998
3150
|
},
|
|
1999
|
-
updateSeparatorProps: (
|
|
2000
|
-
disabled:
|
|
2001
|
-
disableDoubleClick:
|
|
3151
|
+
updateSeparatorProps: (z, {
|
|
3152
|
+
disabled: I,
|
|
3153
|
+
disableDoubleClick: _
|
|
2002
3154
|
}) => {
|
|
2003
|
-
const
|
|
2004
|
-
(
|
|
3155
|
+
const J = x.current.separators.find(
|
|
3156
|
+
(K) => K.id === z
|
|
2005
3157
|
);
|
|
2006
|
-
|
|
3158
|
+
J && (J.disabled = I, J.disableDoubleClick = _);
|
|
2007
3159
|
}
|
|
2008
3160
|
}),
|
|
2009
|
-
[
|
|
2010
|
-
),
|
|
2011
|
-
return
|
|
2012
|
-
const
|
|
2013
|
-
if (
|
|
3161
|
+
[E, h, b, u, P]
|
|
3162
|
+
), M = q(null);
|
|
3163
|
+
return ne(() => {
|
|
3164
|
+
const z = O.current;
|
|
3165
|
+
if (z === null)
|
|
2014
3166
|
return;
|
|
2015
|
-
const
|
|
2016
|
-
let
|
|
2017
|
-
if (
|
|
2018
|
-
|
|
2019
|
-
for (const
|
|
2020
|
-
const
|
|
2021
|
-
|
|
3167
|
+
const I = x.current;
|
|
3168
|
+
let _;
|
|
3169
|
+
if (P.defaultLayout !== void 0 && Object.keys(P.defaultLayout).length === I.panels.length) {
|
|
3170
|
+
_ = {};
|
|
3171
|
+
for (const re of I.panels) {
|
|
3172
|
+
const R = P.defaultLayout[re.id];
|
|
3173
|
+
R !== void 0 && (_[re.id] = R);
|
|
2022
3174
|
}
|
|
2023
3175
|
}
|
|
2024
|
-
const
|
|
3176
|
+
const Y = {
|
|
2025
3177
|
disabled: !!r,
|
|
2026
|
-
element:
|
|
2027
|
-
id:
|
|
3178
|
+
element: z,
|
|
3179
|
+
id: h,
|
|
2028
3180
|
mutableState: {
|
|
2029
|
-
defaultLayout:
|
|
2030
|
-
disableCursor: !!
|
|
2031
|
-
|
|
2032
|
-
layouts:
|
|
3181
|
+
defaultLayout: _,
|
|
3182
|
+
disableCursor: !!P.disableCursor,
|
|
3183
|
+
expandedItemSizes: x.current.lastExpandedPanelSizes,
|
|
3184
|
+
layouts: x.current.layouts
|
|
2033
3185
|
},
|
|
2034
|
-
orientation:
|
|
2035
|
-
|
|
2036
|
-
resizePreviewMode:
|
|
3186
|
+
orientation: u,
|
|
3187
|
+
items: I.panels,
|
|
3188
|
+
resizePreviewMode: d,
|
|
2037
3189
|
get resizeTargetMinimumSize() {
|
|
2038
|
-
return
|
|
3190
|
+
return P.resizeTargetMinimumSize;
|
|
2039
3191
|
},
|
|
2040
|
-
separators:
|
|
3192
|
+
separators: I.separators
|
|
2041
3193
|
};
|
|
2042
|
-
|
|
2043
|
-
const
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
3194
|
+
M.current = Y;
|
|
3195
|
+
const J = tn(Y), {
|
|
3196
|
+
defaultLayoutDeferred: K,
|
|
3197
|
+
derivedItemConstraints: oe,
|
|
3198
|
+
layout: we,
|
|
3199
|
+
requestedLayout: $e
|
|
3200
|
+
} = ae(Y.id, !0);
|
|
3201
|
+
!K && oe.length > 0 && (S(we), p(we, !1, $e));
|
|
3202
|
+
const ze = _e(h, (re) => {
|
|
3203
|
+
const {
|
|
3204
|
+
defaultLayoutDeferred: R,
|
|
3205
|
+
derivedItemConstraints: $,
|
|
3206
|
+
layout: N,
|
|
3207
|
+
requestedLayout: G
|
|
3208
|
+
} = re.next;
|
|
3209
|
+
if (R || $.length === 0)
|
|
2048
3210
|
return;
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
H.collapsedSize,
|
|
2056
|
-
he[H.panelId]
|
|
2057
|
-
), zt = D(
|
|
2058
|
-
H.collapsedSize,
|
|
2059
|
-
ze[H.panelId]
|
|
2060
|
-
);
|
|
2061
|
-
xt && !zt && (A.mutableState.expandedPanelSizes[H.panelId] = ze[H.panelId]);
|
|
2062
|
-
}
|
|
2063
|
-
}
|
|
3211
|
+
nn({
|
|
3212
|
+
derivedItemConstraints: $,
|
|
3213
|
+
axis: Y,
|
|
3214
|
+
layout: N,
|
|
3215
|
+
prevLayout: re.prev?.layout,
|
|
3216
|
+
requestedLayout: G
|
|
2064
3217
|
});
|
|
2065
|
-
const
|
|
2066
|
-
|
|
3218
|
+
const F = fe(), V = F.state !== "active" || !F.hitRegions.some((H) => H.axis === Y);
|
|
3219
|
+
S(N), V && p(N, re.isUserInteraction, G);
|
|
2067
3220
|
});
|
|
2068
3221
|
return () => {
|
|
2069
|
-
|
|
3222
|
+
M.current = null, J(), ze();
|
|
2070
3223
|
};
|
|
2071
3224
|
}, [
|
|
2072
3225
|
r,
|
|
2073
|
-
m,
|
|
2074
3226
|
h,
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
3227
|
+
p,
|
|
3228
|
+
S,
|
|
3229
|
+
u,
|
|
3230
|
+
D,
|
|
3231
|
+
d,
|
|
3232
|
+
P
|
|
3233
|
+
]), qe(() => {
|
|
3234
|
+
const z = M.current;
|
|
3235
|
+
z && (z.mutableState.defaultLayout = n, z.mutableState.disableCursor = !!o);
|
|
3236
|
+
}), /* @__PURE__ */ W(ft.Provider, { value: k, children: /* @__PURE__ */ un(
|
|
2084
3237
|
"div",
|
|
2085
3238
|
{
|
|
2086
|
-
...
|
|
3239
|
+
...y,
|
|
2087
3240
|
className: t,
|
|
2088
3241
|
"data-group": !0,
|
|
2089
|
-
"data-testid":
|
|
2090
|
-
id:
|
|
2091
|
-
ref:
|
|
3242
|
+
"data-testid": h,
|
|
3243
|
+
id: h,
|
|
3244
|
+
ref: v,
|
|
2092
3245
|
style: {
|
|
2093
3246
|
height: "100%",
|
|
2094
3247
|
width: "100%",
|
|
2095
3248
|
overflow: "hidden",
|
|
2096
|
-
position:
|
|
2097
|
-
...
|
|
3249
|
+
position: d === "separator" ? "relative" : void 0,
|
|
3250
|
+
...m,
|
|
2098
3251
|
display: "flex",
|
|
2099
|
-
flexDirection:
|
|
3252
|
+
flexDirection: u === "horizontal" ? "row" : "column",
|
|
2100
3253
|
flexWrap: "nowrap",
|
|
2101
3254
|
// Inform the browser that the library is handling touch events for this element
|
|
2102
3255
|
// but still allow users to scroll content within panels in the non-resizing direction
|
|
2103
3256
|
// NOTE This is not an inherited style
|
|
2104
3257
|
// See github.com/bvaughn/react-resizable-panels/issues/662
|
|
2105
|
-
touchAction:
|
|
3258
|
+
touchAction: u === "horizontal" ? "pan-y" : "pan-x"
|
|
2106
3259
|
},
|
|
2107
3260
|
children: [
|
|
2108
3261
|
e,
|
|
2109
|
-
|
|
2110
|
-
|
|
3262
|
+
C.map((z) => /* @__PURE__ */ W(
|
|
3263
|
+
no,
|
|
2111
3264
|
{
|
|
2112
|
-
overlay:
|
|
2113
|
-
preview:
|
|
3265
|
+
overlay: L,
|
|
3266
|
+
preview: z
|
|
2114
3267
|
},
|
|
2115
|
-
|
|
3268
|
+
z.key
|
|
2116
3269
|
))
|
|
2117
3270
|
]
|
|
2118
3271
|
}
|
|
2119
3272
|
) });
|
|
2120
3273
|
}
|
|
2121
|
-
|
|
2122
|
-
function
|
|
3274
|
+
io.displayName = "Group";
|
|
3275
|
+
function Ye(e, t) {
|
|
2123
3276
|
return `react-resizable-panels:${[e, ...t].join(":")}`;
|
|
2124
3277
|
}
|
|
2125
|
-
function
|
|
3278
|
+
function so({
|
|
2126
3279
|
id: e,
|
|
2127
3280
|
panelIds: t,
|
|
2128
3281
|
storage: n
|
|
2129
3282
|
}) {
|
|
2130
|
-
const o =
|
|
3283
|
+
const o = Ye(e, []), r = n.getItem(o);
|
|
2131
3284
|
if (r)
|
|
2132
3285
|
try {
|
|
2133
3286
|
const i = JSON.parse(r);
|
|
2134
3287
|
if (t) {
|
|
2135
|
-
const s = t.join(","),
|
|
2136
|
-
if (
|
|
2137
|
-
const
|
|
2138
|
-
for (let
|
|
2139
|
-
|
|
2140
|
-
return
|
|
3288
|
+
const s = t.join(","), l = i[s];
|
|
3289
|
+
if (l && Array.isArray(l.layout) && t.length === l.layout.length) {
|
|
3290
|
+
const a = {};
|
|
3291
|
+
for (let c = 0; c < t.length; c++)
|
|
3292
|
+
a[t[c]] = l.layout[c];
|
|
3293
|
+
return a;
|
|
2141
3294
|
}
|
|
2142
3295
|
} else {
|
|
2143
3296
|
const s = Object.keys(i);
|
|
2144
3297
|
if (s.length === 1) {
|
|
2145
|
-
const
|
|
2146
|
-
if (
|
|
2147
|
-
const
|
|
2148
|
-
if (
|
|
2149
|
-
const
|
|
2150
|
-
for (let
|
|
2151
|
-
a[
|
|
2152
|
-
return
|
|
3298
|
+
const l = i[s[0]];
|
|
3299
|
+
if (l && Array.isArray(l.layout)) {
|
|
3300
|
+
const a = s[0].split(",");
|
|
3301
|
+
if (a.length === l.layout.length) {
|
|
3302
|
+
const c = {};
|
|
3303
|
+
for (let u = 0; u < a.length; u++)
|
|
3304
|
+
c[a[u]] = l.layout[u];
|
|
3305
|
+
return c;
|
|
2153
3306
|
}
|
|
2154
3307
|
}
|
|
2155
3308
|
}
|
|
@@ -2157,116 +3310,117 @@ function hn({
|
|
|
2157
3310
|
} catch {
|
|
2158
3311
|
}
|
|
2159
3312
|
}
|
|
2160
|
-
function
|
|
3313
|
+
function bo({
|
|
2161
3314
|
debounceSaveMs: e = 100,
|
|
2162
3315
|
onlySaveAfterUserInteractions: t,
|
|
2163
3316
|
panelIds: n,
|
|
2164
3317
|
storage: o = localStorage,
|
|
2165
3318
|
...r
|
|
2166
3319
|
}) {
|
|
2167
|
-
const i = n !== void 0, s = "id" in r ? r.id : r.groupId,
|
|
2168
|
-
|
|
2169
|
-
() => o.getItem(
|
|
2170
|
-
() => o.getItem(
|
|
2171
|
-
),
|
|
2172
|
-
if (
|
|
2173
|
-
const
|
|
2174
|
-
if (Array.from(
|
|
2175
|
-
return
|
|
2176
|
-
}
|
|
2177
|
-
}, [
|
|
2178
|
-
if (!
|
|
2179
|
-
return
|
|
3320
|
+
const i = n !== void 0, s = "id" in r ? r.id : r.groupId, l = Ye(s, n ?? []), a = Ke(
|
|
3321
|
+
ao,
|
|
3322
|
+
() => o.getItem(l),
|
|
3323
|
+
() => o.getItem(l)
|
|
3324
|
+
), c = Ee(() => {
|
|
3325
|
+
if (a) {
|
|
3326
|
+
const S = JSON.parse(a), p = Object.values(S);
|
|
3327
|
+
if (Array.from(p).every((h) => typeof h == "number"))
|
|
3328
|
+
return S;
|
|
3329
|
+
}
|
|
3330
|
+
}, [a]), u = Ee(() => {
|
|
3331
|
+
if (!c)
|
|
3332
|
+
return so({
|
|
2180
3333
|
id: s,
|
|
2181
3334
|
panelIds: n,
|
|
2182
3335
|
storage: o
|
|
2183
3336
|
});
|
|
2184
|
-
}, [
|
|
2185
|
-
const
|
|
2186
|
-
|
|
3337
|
+
}, [c, s, n, o]), d = c ?? u, g = q(null), m = te(() => {
|
|
3338
|
+
const S = g.current;
|
|
3339
|
+
S && (g.current = null, clearTimeout(S));
|
|
2187
3340
|
}, []);
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
}, [
|
|
2191
|
-
const
|
|
3341
|
+
Ot(() => () => {
|
|
3342
|
+
m();
|
|
3343
|
+
}, [m]);
|
|
3344
|
+
const y = te(
|
|
2192
3345
|
// The hook persists every layout commit -- including library-driven ones --
|
|
2193
3346
|
// because it owns its own storage and the goal is to remember whatever
|
|
2194
3347
|
// layout the user is currently looking at. Consumers that only want to
|
|
2195
3348
|
// persist on user interaction should branch on `isUserInteraction` in
|
|
2196
3349
|
// their own callback (see #716) rather than via this hook.
|
|
2197
|
-
(
|
|
2198
|
-
if (t && !
|
|
3350
|
+
(S, p) => {
|
|
3351
|
+
if (t && !p.isUserInteraction)
|
|
2199
3352
|
return;
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
3353
|
+
m();
|
|
3354
|
+
const h = p.requestedLayout ?? S;
|
|
3355
|
+
let L;
|
|
3356
|
+
i ? L = Ye(s, Object.keys(h)) : L = Ye(s, []);
|
|
2203
3357
|
try {
|
|
2204
|
-
o.setItem(
|
|
2205
|
-
} catch (
|
|
2206
|
-
console.error(
|
|
3358
|
+
o.setItem(L, JSON.stringify(h));
|
|
3359
|
+
} catch (w) {
|
|
3360
|
+
console.error(w);
|
|
2207
3361
|
}
|
|
2208
3362
|
},
|
|
2209
3363
|
[
|
|
2210
|
-
|
|
3364
|
+
m,
|
|
2211
3365
|
i,
|
|
2212
3366
|
s,
|
|
2213
3367
|
t,
|
|
2214
3368
|
o
|
|
2215
3369
|
]
|
|
2216
|
-
),
|
|
2217
|
-
(
|
|
2218
|
-
|
|
2219
|
-
|
|
3370
|
+
), f = te(
|
|
3371
|
+
(S) => {
|
|
3372
|
+
m(), e === 0 ? y(S, { isUserInteraction: !1 }) : g.current = setTimeout(() => {
|
|
3373
|
+
y(S, { isUserInteraction: !1 });
|
|
2220
3374
|
}, e);
|
|
2221
3375
|
},
|
|
2222
|
-
[
|
|
3376
|
+
[m, e, y]
|
|
2223
3377
|
);
|
|
2224
3378
|
return {
|
|
2225
3379
|
/**
|
|
2226
3380
|
* Pass this value to `Group` as the `defaultLayout` prop.
|
|
2227
3381
|
*/
|
|
2228
|
-
defaultLayout:
|
|
3382
|
+
defaultLayout: d,
|
|
2229
3383
|
/**
|
|
2230
3384
|
* Attach this callback on the `Group` as the `onLayoutChange` prop.
|
|
2231
3385
|
*
|
|
2232
3386
|
* @deprecated Use the {@link onLayoutChanged} prop instead.
|
|
2233
3387
|
*/
|
|
2234
|
-
onLayoutChange:
|
|
3388
|
+
onLayoutChange: f,
|
|
2235
3389
|
/**
|
|
2236
3390
|
* Attach this callback on the `Group` as the `onLayoutChanged` prop.
|
|
2237
3391
|
*/
|
|
2238
|
-
onLayoutChanged:
|
|
3392
|
+
onLayoutChanged: y
|
|
2239
3393
|
};
|
|
2240
3394
|
}
|
|
2241
|
-
function
|
|
3395
|
+
function ao() {
|
|
2242
3396
|
return function() {
|
|
2243
3397
|
};
|
|
2244
3398
|
}
|
|
2245
|
-
function
|
|
2246
|
-
return
|
|
3399
|
+
function xo() {
|
|
3400
|
+
return he(null);
|
|
2247
3401
|
}
|
|
2248
|
-
function
|
|
2249
|
-
return
|
|
3402
|
+
function wo() {
|
|
3403
|
+
return q(null);
|
|
2250
3404
|
}
|
|
2251
|
-
function
|
|
2252
|
-
const { id: n } =
|
|
2253
|
-
collapse:
|
|
2254
|
-
expand:
|
|
3405
|
+
function lo(e, t) {
|
|
3406
|
+
const { id: n } = Je(), o = q({
|
|
3407
|
+
collapse: Qe,
|
|
3408
|
+
expand: Qe,
|
|
2255
3409
|
getSize: () => ({
|
|
2256
3410
|
asPercentage: 0,
|
|
2257
3411
|
inPixels: 0
|
|
2258
3412
|
}),
|
|
2259
3413
|
isCollapsed: () => !1,
|
|
2260
|
-
resize:
|
|
3414
|
+
resize: Qe
|
|
2261
3415
|
});
|
|
2262
|
-
|
|
3416
|
+
it(t, () => o.current, []), ne(() => {
|
|
2263
3417
|
Object.assign(
|
|
2264
3418
|
o.current,
|
|
2265
|
-
|
|
3419
|
+
dt({ axisId: n, itemId: e })
|
|
2266
3420
|
);
|
|
2267
3421
|
});
|
|
2268
3422
|
}
|
|
2269
|
-
function
|
|
3423
|
+
function co({
|
|
2270
3424
|
children: e,
|
|
2271
3425
|
className: t,
|
|
2272
3426
|
collapsedSize: n = "0%",
|
|
@@ -2274,103 +3428,103 @@ function yn({
|
|
|
2274
3428
|
collapsible: r = !1,
|
|
2275
3429
|
defaultSize: i,
|
|
2276
3430
|
disabled: s,
|
|
2277
|
-
elementRef:
|
|
2278
|
-
groupResizeBehavior:
|
|
2279
|
-
id:
|
|
2280
|
-
maxSize:
|
|
2281
|
-
minSize:
|
|
2282
|
-
onResize:
|
|
2283
|
-
panelRef:
|
|
2284
|
-
style:
|
|
2285
|
-
...
|
|
3431
|
+
elementRef: l,
|
|
3432
|
+
groupResizeBehavior: a = "preserve-relative-size",
|
|
3433
|
+
id: c,
|
|
3434
|
+
maxSize: u = "100%",
|
|
3435
|
+
minSize: d = "0%",
|
|
3436
|
+
onResize: g,
|
|
3437
|
+
panelRef: m,
|
|
3438
|
+
style: y,
|
|
3439
|
+
...f
|
|
2286
3440
|
}) {
|
|
2287
|
-
const
|
|
3441
|
+
const S = !!c, p = ke(c), h = Xe({
|
|
2288
3442
|
disabled: s
|
|
2289
|
-
}),
|
|
2290
|
-
getPanelStyles:
|
|
2291
|
-
id:
|
|
2292
|
-
orientation:
|
|
2293
|
-
registerPanel:
|
|
2294
|
-
updatePanelProps:
|
|
2295
|
-
} =
|
|
2296
|
-
(
|
|
2297
|
-
|
|
3443
|
+
}), L = q(null), w = Be(L, l), {
|
|
3444
|
+
getPanelStyles: C,
|
|
3445
|
+
id: O,
|
|
3446
|
+
orientation: D,
|
|
3447
|
+
registerPanel: b,
|
|
3448
|
+
updatePanelProps: x
|
|
3449
|
+
} = Je(), v = g !== null, E = ge(
|
|
3450
|
+
(z, I, _) => {
|
|
3451
|
+
g?.(z, c, _);
|
|
2298
3452
|
}
|
|
2299
3453
|
);
|
|
2300
|
-
|
|
2301
|
-
const
|
|
2302
|
-
if (
|
|
2303
|
-
const
|
|
2304
|
-
element:
|
|
2305
|
-
id:
|
|
2306
|
-
idIsStable:
|
|
3454
|
+
ne(() => {
|
|
3455
|
+
const z = L.current;
|
|
3456
|
+
if (z !== null) {
|
|
3457
|
+
const I = {
|
|
3458
|
+
element: z,
|
|
3459
|
+
id: p,
|
|
3460
|
+
idIsStable: S,
|
|
2307
3461
|
mutableValues: {
|
|
2308
3462
|
expandToSize: void 0,
|
|
2309
3463
|
prevSize: void 0
|
|
2310
3464
|
},
|
|
2311
|
-
onResize:
|
|
2312
|
-
|
|
2313
|
-
groupResizeBehavior:
|
|
3465
|
+
onResize: v ? E : void 0,
|
|
3466
|
+
constraintProps: {
|
|
3467
|
+
groupResizeBehavior: a,
|
|
2314
3468
|
collapsedSize: n,
|
|
2315
3469
|
collapsedThreshold: o,
|
|
2316
3470
|
collapsible: r,
|
|
2317
3471
|
defaultSize: i,
|
|
2318
|
-
disabled:
|
|
2319
|
-
maxSize:
|
|
2320
|
-
minSize:
|
|
3472
|
+
disabled: h.disabled,
|
|
3473
|
+
maxSize: u,
|
|
3474
|
+
minSize: d
|
|
2321
3475
|
}
|
|
2322
3476
|
};
|
|
2323
|
-
return
|
|
3477
|
+
return b(I);
|
|
2324
3478
|
}
|
|
2325
3479
|
}, [
|
|
2326
|
-
|
|
3480
|
+
a,
|
|
2327
3481
|
n,
|
|
2328
3482
|
o,
|
|
2329
3483
|
r,
|
|
2330
3484
|
i,
|
|
2331
|
-
N,
|
|
2332
|
-
h,
|
|
2333
3485
|
v,
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
3486
|
+
p,
|
|
3487
|
+
S,
|
|
3488
|
+
u,
|
|
3489
|
+
d,
|
|
3490
|
+
E,
|
|
3491
|
+
b,
|
|
3492
|
+
h
|
|
3493
|
+
]), qe(() => {
|
|
3494
|
+
x(p, { disabled: s });
|
|
3495
|
+
}, [s, p, x]), lo(p, m);
|
|
3496
|
+
const P = () => {
|
|
3497
|
+
const z = C(O, p);
|
|
3498
|
+
if (z)
|
|
3499
|
+
return JSON.stringify(z);
|
|
3500
|
+
}, k = Ke(
|
|
3501
|
+
(z) => _e(O, z),
|
|
3502
|
+
P,
|
|
3503
|
+
P
|
|
2350
3504
|
);
|
|
2351
|
-
let
|
|
2352
|
-
return
|
|
3505
|
+
let M;
|
|
3506
|
+
return k ? M = JSON.parse(k) : i !== void 0 ? M = {
|
|
2353
3507
|
flexGrow: void 0,
|
|
2354
3508
|
flexShrink: void 0,
|
|
2355
3509
|
flexBasis: i
|
|
2356
|
-
} :
|
|
3510
|
+
} : M = { flexGrow: 1 }, /* @__PURE__ */ W(
|
|
2357
3511
|
"div",
|
|
2358
3512
|
{
|
|
2359
|
-
...
|
|
3513
|
+
...f,
|
|
2360
3514
|
"data-disabled": s || void 0,
|
|
2361
3515
|
"data-panel": !0,
|
|
2362
|
-
"data-testid":
|
|
2363
|
-
id:
|
|
2364
|
-
ref:
|
|
3516
|
+
"data-testid": p,
|
|
3517
|
+
id: p,
|
|
3518
|
+
ref: w,
|
|
2365
3519
|
style: {
|
|
2366
|
-
...
|
|
3520
|
+
...uo,
|
|
2367
3521
|
display: "flex",
|
|
2368
3522
|
flexBasis: 0,
|
|
2369
3523
|
flexShrink: 1,
|
|
2370
3524
|
overflow: "visible",
|
|
2371
|
-
...
|
|
3525
|
+
...M
|
|
2372
3526
|
},
|
|
2373
|
-
children: /* @__PURE__ */
|
|
3527
|
+
children: /* @__PURE__ */ W(
|
|
2374
3528
|
"div",
|
|
2375
3529
|
{
|
|
2376
3530
|
className: t,
|
|
@@ -2379,12 +3533,12 @@ function yn({
|
|
|
2379
3533
|
maxWidth: "100%",
|
|
2380
3534
|
flexGrow: 1,
|
|
2381
3535
|
overflow: "auto",
|
|
2382
|
-
...
|
|
3536
|
+
...y,
|
|
2383
3537
|
// Inform the browser that the library is handling touch events for this element
|
|
2384
3538
|
// but still allow users to scroll content within panels in the non-resizing direction
|
|
2385
3539
|
// NOTE This is not an inherited style
|
|
2386
3540
|
// See github.com/bvaughn/react-resizable-panels/issues/662
|
|
2387
|
-
touchAction:
|
|
3541
|
+
touchAction: D === "horizontal" ? "pan-y" : "pan-x"
|
|
2388
3542
|
},
|
|
2389
3543
|
children: e
|
|
2390
3544
|
}
|
|
@@ -2392,8 +3546,8 @@ function yn({
|
|
|
2392
3546
|
}
|
|
2393
3547
|
);
|
|
2394
3548
|
}
|
|
2395
|
-
|
|
2396
|
-
const
|
|
3549
|
+
co.displayName = "Panel";
|
|
3550
|
+
const uo = {
|
|
2397
3551
|
minHeight: 0,
|
|
2398
3552
|
maxHeight: "100%",
|
|
2399
3553
|
height: "auto",
|
|
@@ -2405,52 +3559,14 @@ const vn = {
|
|
|
2405
3559
|
padding: 0,
|
|
2406
3560
|
margin: 0
|
|
2407
3561
|
};
|
|
2408
|
-
function
|
|
2409
|
-
return
|
|
3562
|
+
function zo() {
|
|
3563
|
+
return he(null);
|
|
2410
3564
|
}
|
|
2411
|
-
function
|
|
2412
|
-
return
|
|
3565
|
+
function Io() {
|
|
3566
|
+
return q(null);
|
|
2413
3567
|
}
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
panelConstraints: t,
|
|
2417
|
-
panelId: n,
|
|
2418
|
-
panelIndex: o
|
|
2419
|
-
}) {
|
|
2420
|
-
let r, i;
|
|
2421
|
-
const s = e[n], u = t.find(
|
|
2422
|
-
(c) => c.panelId === n
|
|
2423
|
-
);
|
|
2424
|
-
if (u) {
|
|
2425
|
-
const c = u.maxSize, a = u.collapsible ? u.collapsedSize : u.minSize, l = [o, o + 1];
|
|
2426
|
-
i = ne({
|
|
2427
|
-
layout: de({
|
|
2428
|
-
delta: a - s,
|
|
2429
|
-
initialLayout: e,
|
|
2430
|
-
panelConstraints: t,
|
|
2431
|
-
pivotIndices: l,
|
|
2432
|
-
prevLayout: e
|
|
2433
|
-
}),
|
|
2434
|
-
panelConstraints: t
|
|
2435
|
-
})[n], r = ne({
|
|
2436
|
-
layout: de({
|
|
2437
|
-
delta: c - s,
|
|
2438
|
-
initialLayout: e,
|
|
2439
|
-
panelConstraints: t,
|
|
2440
|
-
pivotIndices: l,
|
|
2441
|
-
prevLayout: e
|
|
2442
|
-
}),
|
|
2443
|
-
panelConstraints: t
|
|
2444
|
-
})[n];
|
|
2445
|
-
}
|
|
2446
|
-
return {
|
|
2447
|
-
valueControls: n,
|
|
2448
|
-
valueMax: r,
|
|
2449
|
-
valueMin: i,
|
|
2450
|
-
valueNow: s
|
|
2451
|
-
};
|
|
2452
|
-
}
|
|
2453
|
-
function bn({
|
|
3568
|
+
const fo = { flexBasis: "auto" }, mo = { flexGrow: 0, flexShrink: 0 };
|
|
3569
|
+
function po({
|
|
2454
3570
|
children: e,
|
|
2455
3571
|
className: t,
|
|
2456
3572
|
disabled: n,
|
|
@@ -2458,140 +3574,55 @@ function bn({
|
|
|
2458
3574
|
elementRef: r,
|
|
2459
3575
|
id: i,
|
|
2460
3576
|
preview: s,
|
|
2461
|
-
style:
|
|
2462
|
-
...
|
|
3577
|
+
style: l,
|
|
3578
|
+
...a
|
|
2463
3579
|
}) {
|
|
2464
|
-
const
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
id: P,
|
|
2474
|
-
orientation: C,
|
|
2475
|
-
registerSeparator: E,
|
|
2476
|
-
updateSeparatorProps: w
|
|
2477
|
-
} = be(), R = C === "horizontal" ? "vertical" : "horizontal";
|
|
2478
|
-
V(() => {
|
|
2479
|
-
const I = h.current;
|
|
2480
|
-
if (I !== null) {
|
|
2481
|
-
const G = {
|
|
2482
|
-
disabled: l.disabled,
|
|
2483
|
-
disableDoubleClick: l.disableDoubleClick,
|
|
2484
|
-
element: I,
|
|
2485
|
-
id: a,
|
|
2486
|
-
get children() {
|
|
2487
|
-
return l.children;
|
|
2488
|
-
},
|
|
2489
|
-
get className() {
|
|
2490
|
-
return l.className;
|
|
2491
|
-
},
|
|
2492
|
-
get preview() {
|
|
2493
|
-
return l.preview;
|
|
2494
|
-
},
|
|
2495
|
-
get style() {
|
|
2496
|
-
return l.style;
|
|
2497
|
-
}
|
|
2498
|
-
};
|
|
2499
|
-
m.current = G;
|
|
2500
|
-
const _ = E(G), b = rt(
|
|
2501
|
-
(M) => {
|
|
2502
|
-
g(
|
|
2503
|
-
M.next.state !== "inactive" && M.next.hitRegions.some(
|
|
2504
|
-
(A) => A.separator === G
|
|
2505
|
-
) ? M.next.state : "inactive"
|
|
2506
|
-
);
|
|
2507
|
-
}
|
|
2508
|
-
), z = Ie(
|
|
2509
|
-
P,
|
|
2510
|
-
(M) => {
|
|
2511
|
-
const { derivedPanelConstraints: A, layout: $, separatorToPanels: Y } = M.next, oe = Y.get(G);
|
|
2512
|
-
if (oe) {
|
|
2513
|
-
const le = oe[0], xe = A.findIndex(
|
|
2514
|
-
(J) => J.panelId === le.id
|
|
2515
|
-
);
|
|
2516
|
-
y(
|
|
2517
|
-
Sn({
|
|
2518
|
-
layout: $,
|
|
2519
|
-
panelConstraints: A,
|
|
2520
|
-
panelId: le.id,
|
|
2521
|
-
panelIndex: xe
|
|
2522
|
-
})
|
|
2523
|
-
);
|
|
2524
|
-
}
|
|
2525
|
-
}
|
|
2526
|
-
);
|
|
2527
|
-
return () => {
|
|
2528
|
-
m.current = null, b(), z(), _();
|
|
2529
|
-
};
|
|
2530
|
-
}
|
|
2531
|
-
}, [P, a, E, l]), V(() => {
|
|
2532
|
-
const I = m.current;
|
|
2533
|
-
I && Tt(I);
|
|
2534
|
-
}, [s]), Se(() => {
|
|
2535
|
-
w(a, { disabled: n, disableDoubleClick: o });
|
|
2536
|
-
}, [n, o, a, w]);
|
|
2537
|
-
let N;
|
|
2538
|
-
n && !S && (N = "not-allowed");
|
|
2539
|
-
let O;
|
|
2540
|
-
if (n)
|
|
2541
|
-
O = "disabled";
|
|
2542
|
-
else
|
|
2543
|
-
switch (p) {
|
|
2544
|
-
case "active": {
|
|
2545
|
-
O = "active";
|
|
2546
|
-
break;
|
|
2547
|
-
}
|
|
2548
|
-
default:
|
|
2549
|
-
d ? O = "focus" : O = p;
|
|
2550
|
-
}
|
|
2551
|
-
return /* @__PURE__ */ B(
|
|
2552
|
-
"div",
|
|
3580
|
+
const c = ke(i), {
|
|
3581
|
+
disableCursor: u,
|
|
3582
|
+
id: d,
|
|
3583
|
+
orientation: g,
|
|
3584
|
+
registerSeparator: m,
|
|
3585
|
+
updateSeparatorProps: y
|
|
3586
|
+
} = Je();
|
|
3587
|
+
return /* @__PURE__ */ W(
|
|
3588
|
+
rn,
|
|
2553
3589
|
{
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
"aria-orientation": R,
|
|
2558
|
-
"aria-valuemax": f.valueMax,
|
|
2559
|
-
"aria-valuemin": f.valueMin,
|
|
2560
|
-
"aria-valuenow": f.valueNow,
|
|
2561
|
-
children: e,
|
|
3590
|
+
attributes: a,
|
|
3591
|
+
axisId: d,
|
|
3592
|
+
axisOrientation: g,
|
|
2562
3593
|
className: t,
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
flexShrink: 0,
|
|
2576
|
-
// Inform the browser that the library is handling touch events for this element
|
|
2577
|
-
// See github.com/bvaughn/react-resizable-panels/issues/662
|
|
2578
|
-
touchAction: "none"
|
|
2579
|
-
},
|
|
2580
|
-
tabIndex: n ? void 0 : 0
|
|
3594
|
+
disableCursor: u,
|
|
3595
|
+
disabled: n,
|
|
3596
|
+
disableDoubleClick: o,
|
|
3597
|
+
elementRef: r,
|
|
3598
|
+
id: c,
|
|
3599
|
+
preview: s,
|
|
3600
|
+
registerSeparator: m,
|
|
3601
|
+
requiredStyle: mo,
|
|
3602
|
+
style: l,
|
|
3603
|
+
styleDefaults: fo,
|
|
3604
|
+
updateSeparatorProps: y,
|
|
3605
|
+
children: e
|
|
2581
3606
|
}
|
|
2582
3607
|
);
|
|
2583
3608
|
}
|
|
2584
|
-
|
|
3609
|
+
po.displayName = "Separator";
|
|
2585
3610
|
export {
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
|
|
2595
|
-
|
|
3611
|
+
gn as Cell,
|
|
3612
|
+
Xn as Grid,
|
|
3613
|
+
sn as Gridline,
|
|
3614
|
+
io as Group,
|
|
3615
|
+
co as Panel,
|
|
3616
|
+
po as Separator,
|
|
3617
|
+
ln as SeparatorOverlay,
|
|
3618
|
+
yn as isCoarsePointer,
|
|
3619
|
+
yo as useDefaultGridLayout,
|
|
3620
|
+
bo as useDefaultLayout,
|
|
3621
|
+
So as useGridCallbackRef,
|
|
3622
|
+
vo as useGridRef,
|
|
3623
|
+
xo as useGroupCallbackRef,
|
|
3624
|
+
wo as useGroupRef,
|
|
3625
|
+
zo as usePanelCallbackRef,
|
|
3626
|
+
Io as usePanelRef
|
|
2596
3627
|
};
|
|
2597
3628
|
//# sourceMappingURL=react-resizable-panels.js.map
|