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