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