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