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