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