react-resizable-panels 4.6.4 → 4.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { useState as
|
|
4
|
-
function
|
|
2
|
+
import { jsx as oe } from "react/jsx-runtime";
|
|
3
|
+
import { useState as ie, useCallback as te, useId as pt, useLayoutEffect as Be, useEffect as de, useRef as T, createContext as ht, useImperativeHandle as We, useMemo as Ue, useSyncExternalStore as Ke, useContext as mt } from "react";
|
|
4
|
+
function gt(e, t) {
|
|
5
5
|
const n = getComputedStyle(e), o = parseFloat(n.fontSize);
|
|
6
6
|
return t * o;
|
|
7
7
|
}
|
|
8
|
-
function
|
|
8
|
+
function St(e, t) {
|
|
9
9
|
const n = getComputedStyle(e.ownerDocument.body), o = parseFloat(n.fontSize);
|
|
10
10
|
return t * o;
|
|
11
11
|
}
|
|
12
|
-
function
|
|
12
|
+
function yt(e) {
|
|
13
13
|
return e / 100 * window.innerHeight;
|
|
14
14
|
}
|
|
15
|
-
function
|
|
15
|
+
function vt(e) {
|
|
16
16
|
return e / 100 * window.innerWidth;
|
|
17
17
|
}
|
|
18
|
-
function
|
|
18
|
+
function zt(e) {
|
|
19
19
|
switch (typeof e) {
|
|
20
20
|
case "number":
|
|
21
21
|
return [e, "px"];
|
|
@@ -25,53 +25,54 @@ function ct(e) {
|
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
|
-
function
|
|
28
|
+
function le({
|
|
29
29
|
groupSize: e,
|
|
30
30
|
panelElement: t,
|
|
31
31
|
styleProp: n
|
|
32
32
|
}) {
|
|
33
33
|
let o;
|
|
34
|
-
const [
|
|
35
|
-
switch (
|
|
34
|
+
const [r, a] = zt(n);
|
|
35
|
+
switch (a) {
|
|
36
36
|
case "%": {
|
|
37
|
-
o =
|
|
37
|
+
o = r / 100 * e;
|
|
38
38
|
break;
|
|
39
39
|
}
|
|
40
40
|
case "px": {
|
|
41
|
-
o =
|
|
41
|
+
o = r;
|
|
42
42
|
break;
|
|
43
43
|
}
|
|
44
44
|
case "rem": {
|
|
45
|
-
o =
|
|
45
|
+
o = St(t, r);
|
|
46
46
|
break;
|
|
47
47
|
}
|
|
48
48
|
case "em": {
|
|
49
|
-
o =
|
|
49
|
+
o = gt(t, r);
|
|
50
50
|
break;
|
|
51
51
|
}
|
|
52
52
|
case "vh": {
|
|
53
|
-
o =
|
|
53
|
+
o = yt(r);
|
|
54
54
|
break;
|
|
55
55
|
}
|
|
56
56
|
case "vw": {
|
|
57
|
-
o =
|
|
57
|
+
o = vt(r);
|
|
58
58
|
break;
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
return o;
|
|
62
62
|
}
|
|
63
|
-
function
|
|
63
|
+
function D(e) {
|
|
64
64
|
return parseFloat(e.toFixed(3));
|
|
65
65
|
}
|
|
66
|
-
function
|
|
66
|
+
function Q({
|
|
67
67
|
group: e
|
|
68
68
|
}) {
|
|
69
69
|
const { orientation: t, panels: n } = e;
|
|
70
|
-
return n.reduce((o,
|
|
70
|
+
return n.reduce((o, r) => (o += t === "horizontal" ? r.element.offsetWidth : r.element.offsetHeight, o), 0);
|
|
71
71
|
}
|
|
72
|
-
function
|
|
73
|
-
const { panels: t } = e, n =
|
|
72
|
+
function ge(e) {
|
|
73
|
+
const { panels: t } = e, n = Q({ group: e });
|
|
74
74
|
return n === 0 ? t.map((o) => ({
|
|
75
|
+
groupResizeBehavior: o.panelConstraints.groupResizeBehavior,
|
|
75
76
|
collapsedSize: 0,
|
|
76
77
|
collapsible: o.panelConstraints.collapsible === !0,
|
|
77
78
|
defaultSize: void 0,
|
|
@@ -80,75 +81,76 @@ function de(e) {
|
|
|
80
81
|
maxSize: 100,
|
|
81
82
|
panelId: o.id
|
|
82
83
|
})) : t.map((o) => {
|
|
83
|
-
const { element:
|
|
84
|
-
let
|
|
85
|
-
if (
|
|
86
|
-
const
|
|
84
|
+
const { element: r, panelConstraints: a } = o;
|
|
85
|
+
let u = 0;
|
|
86
|
+
if (a.collapsedSize !== void 0) {
|
|
87
|
+
const c = le({
|
|
87
88
|
groupSize: n,
|
|
88
|
-
panelElement:
|
|
89
|
-
styleProp:
|
|
89
|
+
panelElement: r,
|
|
90
|
+
styleProp: a.collapsedSize
|
|
90
91
|
});
|
|
91
|
-
|
|
92
|
+
u = D(c / n * 100);
|
|
92
93
|
}
|
|
93
|
-
let
|
|
94
|
-
if (
|
|
95
|
-
const
|
|
94
|
+
let i;
|
|
95
|
+
if (a.defaultSize !== void 0) {
|
|
96
|
+
const c = le({
|
|
96
97
|
groupSize: n,
|
|
97
|
-
panelElement:
|
|
98
|
-
styleProp:
|
|
98
|
+
panelElement: r,
|
|
99
|
+
styleProp: a.defaultSize
|
|
99
100
|
});
|
|
100
|
-
|
|
101
|
+
i = D(c / n * 100);
|
|
101
102
|
}
|
|
102
|
-
let
|
|
103
|
-
if (
|
|
104
|
-
const
|
|
103
|
+
let s = 0;
|
|
104
|
+
if (a.minSize !== void 0) {
|
|
105
|
+
const c = le({
|
|
105
106
|
groupSize: n,
|
|
106
|
-
panelElement:
|
|
107
|
-
styleProp:
|
|
107
|
+
panelElement: r,
|
|
108
|
+
styleProp: a.minSize
|
|
108
109
|
});
|
|
109
|
-
|
|
110
|
+
s = D(c / n * 100);
|
|
110
111
|
}
|
|
111
|
-
let
|
|
112
|
-
if (
|
|
113
|
-
const
|
|
112
|
+
let l = 100;
|
|
113
|
+
if (a.maxSize !== void 0) {
|
|
114
|
+
const c = le({
|
|
114
115
|
groupSize: n,
|
|
115
|
-
panelElement:
|
|
116
|
-
styleProp:
|
|
116
|
+
panelElement: r,
|
|
117
|
+
styleProp: a.maxSize
|
|
117
118
|
});
|
|
118
|
-
|
|
119
|
+
l = D(c / n * 100);
|
|
119
120
|
}
|
|
120
121
|
return {
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
122
|
+
groupResizeBehavior: a.groupResizeBehavior,
|
|
123
|
+
collapsedSize: u,
|
|
124
|
+
collapsible: a.collapsible === !0,
|
|
125
|
+
defaultSize: i,
|
|
126
|
+
disabled: a.disabled,
|
|
127
|
+
minSize: s,
|
|
128
|
+
maxSize: l,
|
|
127
129
|
panelId: o.id
|
|
128
130
|
};
|
|
129
131
|
});
|
|
130
132
|
}
|
|
131
|
-
function
|
|
133
|
+
function L(e, t = "Assertion error") {
|
|
132
134
|
if (!e)
|
|
133
135
|
throw Error(t);
|
|
134
136
|
}
|
|
135
|
-
function
|
|
137
|
+
function Se(e, t) {
|
|
136
138
|
return Array.from(t).sort(
|
|
137
|
-
e === "horizontal" ?
|
|
139
|
+
e === "horizontal" ? bt : xt
|
|
138
140
|
);
|
|
139
141
|
}
|
|
140
|
-
function
|
|
142
|
+
function bt(e, t) {
|
|
141
143
|
const n = e.element.offsetLeft - t.element.offsetLeft;
|
|
142
144
|
return n !== 0 ? n : e.element.offsetWidth - t.element.offsetWidth;
|
|
143
145
|
}
|
|
144
|
-
function
|
|
146
|
+
function xt(e, t) {
|
|
145
147
|
const n = e.element.offsetTop - t.element.offsetTop;
|
|
146
148
|
return n !== 0 ? n : e.element.offsetHeight - t.element.offsetHeight;
|
|
147
149
|
}
|
|
148
|
-
function
|
|
150
|
+
function Xe(e) {
|
|
149
151
|
return e !== null && typeof e == "object" && "nodeType" in e && e.nodeType === Node.ELEMENT_NODE;
|
|
150
152
|
}
|
|
151
|
-
function
|
|
153
|
+
function qe(e, t) {
|
|
152
154
|
return {
|
|
153
155
|
x: e.x >= t.left && e.x <= t.right ? 0 : Math.min(
|
|
154
156
|
Math.abs(e.x - t.left),
|
|
@@ -160,7 +162,7 @@ function He(e, t) {
|
|
|
160
162
|
)
|
|
161
163
|
};
|
|
162
164
|
}
|
|
163
|
-
function
|
|
165
|
+
function wt({
|
|
164
166
|
orientation: e,
|
|
165
167
|
rects: t,
|
|
166
168
|
targetRect: n
|
|
@@ -169,136 +171,136 @@ function pt({
|
|
|
169
171
|
x: n.x + n.width / 2,
|
|
170
172
|
y: n.y + n.height / 2
|
|
171
173
|
};
|
|
172
|
-
let
|
|
173
|
-
for (const
|
|
174
|
-
const { x:
|
|
175
|
-
|
|
174
|
+
let r, a = Number.MAX_VALUE;
|
|
175
|
+
for (const u of t) {
|
|
176
|
+
const { x: i, y: s } = qe(o, u), l = e === "horizontal" ? i : s;
|
|
177
|
+
l < a && (a = l, r = u);
|
|
176
178
|
}
|
|
177
|
-
return
|
|
179
|
+
return L(r, "No rect found"), r;
|
|
178
180
|
}
|
|
179
|
-
let
|
|
180
|
-
function
|
|
181
|
-
return
|
|
181
|
+
let ue;
|
|
182
|
+
function Pt() {
|
|
183
|
+
return ue === void 0 && (typeof matchMedia == "function" ? ue = !!matchMedia("(pointer:coarse)").matches : ue = !1), ue;
|
|
182
184
|
}
|
|
183
|
-
function
|
|
184
|
-
const { element: t, orientation: n, panels: o, separators:
|
|
185
|
+
function Ye(e) {
|
|
186
|
+
const { element: t, orientation: n, panels: o, separators: r } = e, a = Se(
|
|
185
187
|
n,
|
|
186
|
-
Array.from(t.children).filter(
|
|
187
|
-
).map(({ element:
|
|
188
|
-
let
|
|
188
|
+
Array.from(t.children).filter(Xe).map((x) => ({ element: x }))
|
|
189
|
+
).map(({ element: x }) => x), u = [];
|
|
190
|
+
let i = !1, s = !1, l = -1, c = -1, m = 0, p, v = [];
|
|
189
191
|
{
|
|
190
|
-
let
|
|
191
|
-
for (const
|
|
192
|
-
|
|
192
|
+
let x = -1;
|
|
193
|
+
for (const f of a)
|
|
194
|
+
f.hasAttribute("data-panel") && (x++, f.ariaDisabled === null && (m++, l === -1 && (l = x), c = x));
|
|
193
195
|
}
|
|
194
|
-
if (
|
|
195
|
-
let
|
|
196
|
-
for (const
|
|
197
|
-
if (
|
|
198
|
-
|
|
199
|
-
const
|
|
200
|
-
(
|
|
196
|
+
if (m > 1) {
|
|
197
|
+
let x = -1;
|
|
198
|
+
for (const f of a)
|
|
199
|
+
if (f.hasAttribute("data-panel")) {
|
|
200
|
+
x++;
|
|
201
|
+
const h = o.find(
|
|
202
|
+
(g) => g.element === f
|
|
201
203
|
);
|
|
202
|
-
if (
|
|
203
|
-
if (
|
|
204
|
-
const
|
|
205
|
-
let
|
|
206
|
-
if (
|
|
207
|
-
const
|
|
208
|
-
|
|
209
|
-
|
|
204
|
+
if (h) {
|
|
205
|
+
if (p) {
|
|
206
|
+
const g = p.element.getBoundingClientRect(), y = f.getBoundingClientRect();
|
|
207
|
+
let z;
|
|
208
|
+
if (s) {
|
|
209
|
+
const S = n === "horizontal" ? new DOMRect(
|
|
210
|
+
g.right,
|
|
211
|
+
g.top,
|
|
210
212
|
0,
|
|
211
|
-
|
|
213
|
+
g.height
|
|
212
214
|
) : new DOMRect(
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
215
|
+
g.left,
|
|
216
|
+
g.bottom,
|
|
217
|
+
g.width,
|
|
216
218
|
0
|
|
217
|
-
),
|
|
218
|
-
switch (
|
|
219
|
+
), d = n === "horizontal" ? new DOMRect(y.left, y.top, 0, y.height) : new DOMRect(y.left, y.top, y.width, 0);
|
|
220
|
+
switch (v.length) {
|
|
219
221
|
case 0: {
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
222
|
+
z = [
|
|
223
|
+
S,
|
|
224
|
+
d
|
|
223
225
|
];
|
|
224
226
|
break;
|
|
225
227
|
}
|
|
226
228
|
case 1: {
|
|
227
|
-
const
|
|
229
|
+
const P = v[0], R = wt({
|
|
228
230
|
orientation: n,
|
|
229
|
-
rects: [
|
|
230
|
-
targetRect:
|
|
231
|
+
rects: [g, y],
|
|
232
|
+
targetRect: P.element.getBoundingClientRect()
|
|
231
233
|
});
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
234
|
+
z = [
|
|
235
|
+
P,
|
|
236
|
+
R === g ? d : S
|
|
235
237
|
];
|
|
236
238
|
break;
|
|
237
239
|
}
|
|
238
240
|
default: {
|
|
239
|
-
|
|
241
|
+
z = v;
|
|
240
242
|
break;
|
|
241
243
|
}
|
|
242
244
|
}
|
|
243
245
|
} else
|
|
244
|
-
|
|
246
|
+
v.length ? z = v : z = [
|
|
245
247
|
n === "horizontal" ? new DOMRect(
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
248
|
+
g.right,
|
|
249
|
+
y.top,
|
|
250
|
+
y.left - g.right,
|
|
251
|
+
y.height
|
|
250
252
|
) : new DOMRect(
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
253
|
+
y.left,
|
|
254
|
+
g.bottom,
|
|
255
|
+
y.width,
|
|
256
|
+
y.top - g.bottom
|
|
255
257
|
)
|
|
256
258
|
];
|
|
257
|
-
for (const
|
|
258
|
-
let
|
|
259
|
-
const
|
|
260
|
-
if (
|
|
261
|
-
const
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
259
|
+
for (const S of z) {
|
|
260
|
+
let d = "width" in S ? S : S.element.getBoundingClientRect();
|
|
261
|
+
const P = Pt() ? e.resizeTargetMinimumSize.coarse : e.resizeTargetMinimumSize.fine;
|
|
262
|
+
if (d.width < P) {
|
|
263
|
+
const C = P - d.width;
|
|
264
|
+
d = new DOMRect(
|
|
265
|
+
d.x - C / 2,
|
|
266
|
+
d.y,
|
|
267
|
+
d.width + C,
|
|
268
|
+
d.height
|
|
267
269
|
);
|
|
268
270
|
}
|
|
269
|
-
if (
|
|
270
|
-
const
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
271
|
+
if (d.height < P) {
|
|
272
|
+
const C = P - d.height;
|
|
273
|
+
d = new DOMRect(
|
|
274
|
+
d.x,
|
|
275
|
+
d.y - C / 2,
|
|
276
|
+
d.width,
|
|
277
|
+
d.height + C
|
|
276
278
|
);
|
|
277
279
|
}
|
|
278
|
-
const
|
|
279
|
-
!
|
|
280
|
+
const R = x <= l || x > c;
|
|
281
|
+
!i && !R && u.push({
|
|
280
282
|
group: e,
|
|
281
|
-
groupSize:
|
|
282
|
-
panels: [
|
|
283
|
-
separator: "width" in
|
|
284
|
-
rect:
|
|
285
|
-
}),
|
|
283
|
+
groupSize: Q({ group: e }),
|
|
284
|
+
panels: [p, h],
|
|
285
|
+
separator: "width" in S ? void 0 : S,
|
|
286
|
+
rect: d
|
|
287
|
+
}), i = !1;
|
|
286
288
|
}
|
|
287
289
|
}
|
|
288
|
-
|
|
290
|
+
s = !1, p = h, v = [];
|
|
289
291
|
}
|
|
290
|
-
} else if (
|
|
291
|
-
|
|
292
|
-
const
|
|
293
|
-
(
|
|
292
|
+
} else if (f.hasAttribute("data-separator")) {
|
|
293
|
+
f.ariaDisabled !== null && (i = !0);
|
|
294
|
+
const h = r.find(
|
|
295
|
+
(g) => g.element === f
|
|
294
296
|
);
|
|
295
|
-
|
|
297
|
+
h ? v.push(h) : (p = void 0, v = []);
|
|
296
298
|
} else
|
|
297
|
-
|
|
299
|
+
s = !0;
|
|
298
300
|
}
|
|
299
|
-
return
|
|
301
|
+
return u;
|
|
300
302
|
}
|
|
301
|
-
class
|
|
303
|
+
class Je {
|
|
302
304
|
#e = {};
|
|
303
305
|
addListener(t, n) {
|
|
304
306
|
const o = this.#e[t];
|
|
@@ -312,18 +314,18 @@ class ht {
|
|
|
312
314
|
if (o.length === 1)
|
|
313
315
|
o[0].call(null, n);
|
|
314
316
|
else {
|
|
315
|
-
let
|
|
316
|
-
const
|
|
317
|
-
for (let
|
|
318
|
-
const
|
|
317
|
+
let r = !1, a = null;
|
|
318
|
+
const u = Array.from(o);
|
|
319
|
+
for (let i = 0; i < u.length; i++) {
|
|
320
|
+
const s = u[i];
|
|
319
321
|
try {
|
|
320
|
-
|
|
321
|
-
} catch (
|
|
322
|
-
|
|
322
|
+
s.call(null, n);
|
|
323
|
+
} catch (l) {
|
|
324
|
+
a === null && (r = !0, a = l);
|
|
323
325
|
}
|
|
324
326
|
}
|
|
325
|
-
if (
|
|
326
|
-
throw
|
|
327
|
+
if (r)
|
|
328
|
+
throw a;
|
|
327
329
|
}
|
|
328
330
|
}
|
|
329
331
|
removeAllListeners() {
|
|
@@ -332,177 +334,170 @@ class ht {
|
|
|
332
334
|
removeListener(t, n) {
|
|
333
335
|
const o = this.#e[t];
|
|
334
336
|
if (o !== void 0) {
|
|
335
|
-
const
|
|
336
|
-
|
|
337
|
+
const r = o.indexOf(n);
|
|
338
|
+
r >= 0 && o.splice(r, 1);
|
|
337
339
|
}
|
|
338
340
|
}
|
|
339
341
|
}
|
|
340
|
-
|
|
341
|
-
|
|
342
|
+
let A = /* @__PURE__ */ new Map();
|
|
343
|
+
const Ze = new Je();
|
|
344
|
+
function Lt(e) {
|
|
345
|
+
A = new Map(A), A.delete(e);
|
|
342
346
|
}
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
347
|
+
function Me(e, t) {
|
|
348
|
+
for (const [n] of A)
|
|
349
|
+
if (n.id === e)
|
|
350
|
+
return n;
|
|
351
|
+
}
|
|
352
|
+
function $(e, t) {
|
|
353
|
+
for (const [n, o] of A)
|
|
354
|
+
if (n.id === e)
|
|
355
|
+
return o;
|
|
356
|
+
if (t)
|
|
357
|
+
throw Error(`Could not find data for Group with id ${e}`);
|
|
358
|
+
}
|
|
359
|
+
function U() {
|
|
352
360
|
return A;
|
|
353
361
|
}
|
|
354
|
-
function
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
if (l) {
|
|
367
|
-
const r = k(
|
|
368
|
-
s.collapsedSize,
|
|
369
|
-
o.layout[s.panelId]
|
|
370
|
-
), a = k(
|
|
371
|
-
s.collapsedSize,
|
|
372
|
-
l[s.panelId]
|
|
373
|
-
);
|
|
374
|
-
r && !a && (i.inMemoryLastExpandedPanelSizes[s.panelId] = l[s.panelId]);
|
|
375
|
-
}
|
|
376
|
-
}
|
|
377
|
-
});
|
|
378
|
-
}), $.emit("mountedGroupsChange", A.mountedGroups)), A;
|
|
362
|
+
function ye(e, t) {
|
|
363
|
+
return Ze.addListener("groupChange", (n) => {
|
|
364
|
+
n.group.id === e && t(n);
|
|
365
|
+
});
|
|
366
|
+
}
|
|
367
|
+
function F(e, t) {
|
|
368
|
+
const n = A.get(e);
|
|
369
|
+
A = new Map(A), A.set(e, t), Ze.emit("groupChange", {
|
|
370
|
+
group: e,
|
|
371
|
+
prev: n,
|
|
372
|
+
next: t
|
|
373
|
+
});
|
|
379
374
|
}
|
|
380
|
-
function
|
|
381
|
-
let o,
|
|
375
|
+
function Ct(e, t, n) {
|
|
376
|
+
let o, r = {
|
|
382
377
|
x: 1 / 0,
|
|
383
378
|
y: 1 / 0
|
|
384
379
|
};
|
|
385
|
-
for (const
|
|
386
|
-
const
|
|
380
|
+
for (const a of t) {
|
|
381
|
+
const u = qe(n, a.rect);
|
|
387
382
|
switch (e) {
|
|
388
383
|
case "horizontal": {
|
|
389
|
-
|
|
384
|
+
u.x <= r.x && (o = a, r = u);
|
|
390
385
|
break;
|
|
391
386
|
}
|
|
392
387
|
case "vertical": {
|
|
393
|
-
|
|
388
|
+
u.y <= r.y && (o = a, r = u);
|
|
394
389
|
break;
|
|
395
390
|
}
|
|
396
391
|
}
|
|
397
392
|
}
|
|
398
393
|
return o ? {
|
|
399
|
-
distance:
|
|
394
|
+
distance: r,
|
|
400
395
|
hitRegion: o
|
|
401
396
|
} : void 0;
|
|
402
397
|
}
|
|
403
|
-
function
|
|
398
|
+
function Rt(e) {
|
|
404
399
|
return e !== null && typeof e == "object" && "nodeType" in e && e.nodeType === Node.DOCUMENT_FRAGMENT_NODE;
|
|
405
400
|
}
|
|
406
|
-
function
|
|
401
|
+
function Mt(e, t) {
|
|
407
402
|
if (e === t) throw new Error("Cannot compare node with itself");
|
|
408
403
|
const n = {
|
|
409
|
-
a:
|
|
410
|
-
b:
|
|
404
|
+
a: ke(e),
|
|
405
|
+
b: ke(t)
|
|
411
406
|
};
|
|
412
407
|
let o;
|
|
413
408
|
for (; n.a.at(-1) === n.b.at(-1); )
|
|
414
409
|
o = n.a.pop(), n.b.pop();
|
|
415
|
-
|
|
410
|
+
L(
|
|
416
411
|
o,
|
|
417
412
|
"Stacking order can only be calculated for elements with a common ancestor"
|
|
418
413
|
);
|
|
419
|
-
const
|
|
420
|
-
a:
|
|
421
|
-
b:
|
|
414
|
+
const r = {
|
|
415
|
+
a: Ie(Ee(n.a)),
|
|
416
|
+
b: Ie(Ee(n.b))
|
|
422
417
|
};
|
|
423
|
-
if (
|
|
424
|
-
const
|
|
418
|
+
if (r.a === r.b) {
|
|
419
|
+
const a = o.childNodes, u = {
|
|
425
420
|
a: n.a.at(-1),
|
|
426
421
|
b: n.b.at(-1)
|
|
427
422
|
};
|
|
428
|
-
let
|
|
429
|
-
for (;
|
|
430
|
-
const
|
|
431
|
-
if (
|
|
432
|
-
if (
|
|
423
|
+
let i = a.length;
|
|
424
|
+
for (; i--; ) {
|
|
425
|
+
const s = a[i];
|
|
426
|
+
if (s === u.a) return 1;
|
|
427
|
+
if (s === u.b) return -1;
|
|
433
428
|
}
|
|
434
429
|
}
|
|
435
|
-
return Math.sign(
|
|
430
|
+
return Math.sign(r.a - r.b);
|
|
436
431
|
}
|
|
437
|
-
const
|
|
438
|
-
function
|
|
439
|
-
const t = getComputedStyle(
|
|
432
|
+
const Et = /\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;
|
|
433
|
+
function It(e) {
|
|
434
|
+
const t = getComputedStyle(Qe(e) ?? e).display;
|
|
440
435
|
return t === "flex" || t === "inline-flex";
|
|
441
436
|
}
|
|
442
|
-
function
|
|
437
|
+
function kt(e) {
|
|
443
438
|
const t = getComputedStyle(e);
|
|
444
|
-
return !!(t.position === "fixed" || t.zIndex !== "auto" && (t.position !== "static" ||
|
|
439
|
+
return !!(t.position === "fixed" || t.zIndex !== "auto" && (t.position !== "static" || It(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" || Et.test(t.willChange) || t.webkitOverflowScrolling === "touch");
|
|
445
440
|
}
|
|
446
|
-
function
|
|
441
|
+
function Ee(e) {
|
|
447
442
|
let t = e.length;
|
|
448
443
|
for (; t--; ) {
|
|
449
444
|
const n = e[t];
|
|
450
|
-
if (
|
|
445
|
+
if (L(n, "Missing node"), kt(n)) return n;
|
|
451
446
|
}
|
|
452
447
|
return null;
|
|
453
448
|
}
|
|
454
|
-
function
|
|
449
|
+
function Ie(e) {
|
|
455
450
|
return e && Number(getComputedStyle(e).zIndex) || 0;
|
|
456
451
|
}
|
|
457
|
-
function
|
|
452
|
+
function ke(e) {
|
|
458
453
|
const t = [];
|
|
459
454
|
for (; e; )
|
|
460
|
-
t.push(e), e =
|
|
455
|
+
t.push(e), e = Qe(e);
|
|
461
456
|
return t;
|
|
462
457
|
}
|
|
463
|
-
function
|
|
458
|
+
function Qe(e) {
|
|
464
459
|
const { parentNode: t } = e;
|
|
465
|
-
return
|
|
460
|
+
return Rt(t) ? t.host : t;
|
|
466
461
|
}
|
|
467
|
-
function
|
|
462
|
+
function Dt(e, t) {
|
|
468
463
|
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;
|
|
469
464
|
}
|
|
470
|
-
function
|
|
465
|
+
function Tt({
|
|
471
466
|
groupElement: e,
|
|
472
467
|
hitRegion: t,
|
|
473
468
|
pointerEventTarget: n
|
|
474
469
|
}) {
|
|
475
|
-
if (
|
|
470
|
+
if (!Xe(n) || n.contains(e) || e.contains(n))
|
|
476
471
|
return !0;
|
|
477
|
-
if (
|
|
472
|
+
if (Mt(n, e) > 0) {
|
|
478
473
|
let o = n;
|
|
479
474
|
for (; o; ) {
|
|
480
475
|
if (o.contains(e))
|
|
481
476
|
return !0;
|
|
482
|
-
if (
|
|
477
|
+
if (Dt(o.getBoundingClientRect(), t))
|
|
483
478
|
return !1;
|
|
484
479
|
o = o.parentElement;
|
|
485
480
|
}
|
|
486
481
|
}
|
|
487
482
|
return !0;
|
|
488
483
|
}
|
|
489
|
-
function
|
|
484
|
+
function ve(e, t) {
|
|
490
485
|
const n = [];
|
|
491
|
-
return t.forEach((o,
|
|
492
|
-
if (
|
|
486
|
+
return t.forEach((o, r) => {
|
|
487
|
+
if (r.disabled)
|
|
493
488
|
return;
|
|
494
|
-
const
|
|
489
|
+
const a = Ye(r), u = Ct(r.orientation, a, {
|
|
495
490
|
x: e.clientX,
|
|
496
491
|
y: e.clientY
|
|
497
492
|
});
|
|
498
|
-
|
|
499
|
-
groupElement:
|
|
500
|
-
hitRegion:
|
|
493
|
+
u && u.distance.x <= 0 && u.distance.y <= 0 && Tt({
|
|
494
|
+
groupElement: r.element,
|
|
495
|
+
hitRegion: u.hitRegion.rect,
|
|
501
496
|
pointerEventTarget: e.target
|
|
502
|
-
}) && n.push(
|
|
497
|
+
}) && n.push(u.hitRegion);
|
|
503
498
|
}), n;
|
|
504
499
|
}
|
|
505
|
-
function
|
|
500
|
+
function Ot(e, t) {
|
|
506
501
|
if (e.length !== t.length)
|
|
507
502
|
return !1;
|
|
508
503
|
for (let n = 0; n < e.length; n++)
|
|
@@ -510,8 +505,11 @@ function Lt(e, t) {
|
|
|
510
505
|
return !1;
|
|
511
506
|
return !0;
|
|
512
507
|
}
|
|
513
|
-
function
|
|
514
|
-
return
|
|
508
|
+
function I(e, t, n = 0) {
|
|
509
|
+
return Math.abs(D(e) - D(t)) <= n;
|
|
510
|
+
}
|
|
511
|
+
function G(e, t) {
|
|
512
|
+
return I(e, t) ? 0 : e > t ? 1 : -1;
|
|
515
513
|
}
|
|
516
514
|
function Y({
|
|
517
515
|
overrideDisabledPanels: e,
|
|
@@ -520,191 +518,191 @@ function Y({
|
|
|
520
518
|
size: o
|
|
521
519
|
}) {
|
|
522
520
|
const {
|
|
523
|
-
collapsedSize:
|
|
524
|
-
collapsible:
|
|
525
|
-
disabled:
|
|
526
|
-
maxSize:
|
|
527
|
-
minSize:
|
|
521
|
+
collapsedSize: r = 0,
|
|
522
|
+
collapsible: a,
|
|
523
|
+
disabled: u,
|
|
524
|
+
maxSize: i = 100,
|
|
525
|
+
minSize: s = 0
|
|
528
526
|
} = t;
|
|
529
|
-
if (
|
|
527
|
+
if (u && !e)
|
|
530
528
|
return n;
|
|
531
|
-
if (
|
|
532
|
-
if (
|
|
533
|
-
const
|
|
534
|
-
|
|
529
|
+
if (G(o, s) < 0)
|
|
530
|
+
if (a) {
|
|
531
|
+
const l = (r + s) / 2;
|
|
532
|
+
G(o, l) < 0 ? o = r : o = s;
|
|
535
533
|
} else
|
|
536
|
-
o =
|
|
537
|
-
return o = Math.min(
|
|
534
|
+
o = s;
|
|
535
|
+
return o = Math.min(i, o), o = D(o), o;
|
|
538
536
|
}
|
|
539
|
-
function
|
|
537
|
+
function re({
|
|
540
538
|
delta: e,
|
|
541
539
|
initialLayout: t,
|
|
542
540
|
panelConstraints: n,
|
|
543
541
|
pivotIndices: o,
|
|
544
|
-
prevLayout:
|
|
545
|
-
trigger:
|
|
542
|
+
prevLayout: r,
|
|
543
|
+
trigger: a
|
|
546
544
|
}) {
|
|
547
|
-
if (
|
|
545
|
+
if (I(e, 0))
|
|
548
546
|
return t;
|
|
549
|
-
const
|
|
550
|
-
|
|
551
|
-
let
|
|
552
|
-
switch (
|
|
547
|
+
const u = a === "imperative-api", i = Object.values(t), s = Object.values(r), l = [...i], [c, m] = o;
|
|
548
|
+
L(c != null, "Invalid first pivot index"), L(m != null, "Invalid second pivot index");
|
|
549
|
+
let p = 0;
|
|
550
|
+
switch (a) {
|
|
553
551
|
case "keyboard": {
|
|
554
552
|
{
|
|
555
|
-
const
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
`Panel constraints not found for index ${
|
|
553
|
+
const f = e < 0 ? m : c, h = n[f];
|
|
554
|
+
L(
|
|
555
|
+
h,
|
|
556
|
+
`Panel constraints not found for index ${f}`
|
|
559
557
|
);
|
|
560
558
|
const {
|
|
561
|
-
collapsedSize:
|
|
562
|
-
collapsible:
|
|
563
|
-
minSize:
|
|
564
|
-
} =
|
|
565
|
-
if (
|
|
566
|
-
const
|
|
567
|
-
if (
|
|
568
|
-
|
|
569
|
-
`Previous layout not found for panel index ${
|
|
570
|
-
),
|
|
571
|
-
const
|
|
572
|
-
|
|
559
|
+
collapsedSize: g = 0,
|
|
560
|
+
collapsible: y,
|
|
561
|
+
minSize: z = 0
|
|
562
|
+
} = h;
|
|
563
|
+
if (y) {
|
|
564
|
+
const S = i[f];
|
|
565
|
+
if (L(
|
|
566
|
+
S != null,
|
|
567
|
+
`Previous layout not found for panel index ${f}`
|
|
568
|
+
), I(S, g)) {
|
|
569
|
+
const d = z - S;
|
|
570
|
+
G(d, Math.abs(e)) > 0 && (e = e < 0 ? 0 - d : d);
|
|
573
571
|
}
|
|
574
572
|
}
|
|
575
573
|
}
|
|
576
574
|
{
|
|
577
|
-
const
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
`No panel constraints found for index ${
|
|
575
|
+
const f = e < 0 ? c : m, h = n[f];
|
|
576
|
+
L(
|
|
577
|
+
h,
|
|
578
|
+
`No panel constraints found for index ${f}`
|
|
581
579
|
);
|
|
582
580
|
const {
|
|
583
|
-
collapsedSize:
|
|
584
|
-
collapsible:
|
|
585
|
-
minSize:
|
|
586
|
-
} =
|
|
587
|
-
if (
|
|
588
|
-
const
|
|
589
|
-
if (
|
|
590
|
-
|
|
591
|
-
`Previous layout not found for panel index ${
|
|
592
|
-
),
|
|
593
|
-
const
|
|
594
|
-
|
|
581
|
+
collapsedSize: g = 0,
|
|
582
|
+
collapsible: y,
|
|
583
|
+
minSize: z = 0
|
|
584
|
+
} = h;
|
|
585
|
+
if (y) {
|
|
586
|
+
const S = i[f];
|
|
587
|
+
if (L(
|
|
588
|
+
S != null,
|
|
589
|
+
`Previous layout not found for panel index ${f}`
|
|
590
|
+
), I(S, z)) {
|
|
591
|
+
const d = S - g;
|
|
592
|
+
G(d, Math.abs(e)) > 0 && (e = e < 0 ? 0 - d : d);
|
|
595
593
|
}
|
|
596
594
|
}
|
|
597
595
|
}
|
|
598
596
|
break;
|
|
599
597
|
}
|
|
600
598
|
default: {
|
|
601
|
-
const
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
`Panel constraints not found for index ${
|
|
599
|
+
const f = e < 0 ? m : c, h = n[f];
|
|
600
|
+
L(
|
|
601
|
+
h,
|
|
602
|
+
`Panel constraints not found for index ${f}`
|
|
605
603
|
);
|
|
606
|
-
const
|
|
607
|
-
if (
|
|
604
|
+
const g = i[f], { collapsible: y, collapsedSize: z, minSize: S } = h;
|
|
605
|
+
if (y && G(g, S) < 0)
|
|
608
606
|
if (e > 0) {
|
|
609
|
-
const
|
|
610
|
-
|
|
607
|
+
const d = S - z, P = d / 2, R = g + e;
|
|
608
|
+
G(R, S) < 0 && (e = G(e, P) <= 0 ? 0 : d);
|
|
611
609
|
} else {
|
|
612
|
-
const
|
|
613
|
-
|
|
610
|
+
const d = S - z, P = 100 - d / 2, R = g - e;
|
|
611
|
+
G(R, S) < 0 && (e = G(100 + e, P) > 0 ? 0 : -d);
|
|
614
612
|
}
|
|
615
613
|
break;
|
|
616
614
|
}
|
|
617
615
|
}
|
|
618
616
|
{
|
|
619
|
-
const
|
|
620
|
-
let
|
|
617
|
+
const f = e < 0 ? 1 : -1;
|
|
618
|
+
let h = e < 0 ? m : c, g = 0;
|
|
621
619
|
for (; ; ) {
|
|
622
|
-
const
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
`Previous layout not found for panel index ${
|
|
620
|
+
const z = i[h];
|
|
621
|
+
L(
|
|
622
|
+
z != null,
|
|
623
|
+
`Previous layout not found for panel index ${h}`
|
|
626
624
|
);
|
|
627
|
-
const
|
|
628
|
-
overrideDisabledPanels:
|
|
629
|
-
panelConstraints: n[
|
|
630
|
-
prevSize:
|
|
625
|
+
const d = Y({
|
|
626
|
+
overrideDisabledPanels: u,
|
|
627
|
+
panelConstraints: n[h],
|
|
628
|
+
prevSize: z,
|
|
631
629
|
size: 100
|
|
632
|
-
}) -
|
|
633
|
-
if (
|
|
630
|
+
}) - z;
|
|
631
|
+
if (g += d, h += f, h < 0 || h >= n.length)
|
|
634
632
|
break;
|
|
635
633
|
}
|
|
636
|
-
const
|
|
637
|
-
e = e < 0 ? 0 -
|
|
634
|
+
const y = Math.min(Math.abs(e), Math.abs(g));
|
|
635
|
+
e = e < 0 ? 0 - y : y;
|
|
638
636
|
}
|
|
639
637
|
{
|
|
640
|
-
let
|
|
641
|
-
for (;
|
|
642
|
-
const
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
`Previous layout not found for panel index ${
|
|
638
|
+
let h = e < 0 ? c : m;
|
|
639
|
+
for (; h >= 0 && h < n.length; ) {
|
|
640
|
+
const g = Math.abs(e) - Math.abs(p), y = i[h];
|
|
641
|
+
L(
|
|
642
|
+
y != null,
|
|
643
|
+
`Previous layout not found for panel index ${h}`
|
|
646
644
|
);
|
|
647
|
-
const
|
|
648
|
-
overrideDisabledPanels:
|
|
649
|
-
panelConstraints: n[
|
|
650
|
-
prevSize:
|
|
651
|
-
size:
|
|
645
|
+
const z = y - g, S = Y({
|
|
646
|
+
overrideDisabledPanels: u,
|
|
647
|
+
panelConstraints: n[h],
|
|
648
|
+
prevSize: y,
|
|
649
|
+
size: z
|
|
652
650
|
});
|
|
653
|
-
if (!
|
|
651
|
+
if (!I(y, S) && (p += y - S, l[h] = S, p.toFixed(3).localeCompare(Math.abs(e).toFixed(3), void 0, {
|
|
654
652
|
numeric: !0
|
|
655
653
|
}) >= 0))
|
|
656
654
|
break;
|
|
657
|
-
e < 0 ?
|
|
655
|
+
e < 0 ? h-- : h++;
|
|
658
656
|
}
|
|
659
657
|
}
|
|
660
|
-
if (
|
|
661
|
-
return
|
|
658
|
+
if (Ot(s, l))
|
|
659
|
+
return r;
|
|
662
660
|
{
|
|
663
|
-
const
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
`Previous layout not found for panel index ${
|
|
661
|
+
const f = e < 0 ? m : c, h = i[f];
|
|
662
|
+
L(
|
|
663
|
+
h != null,
|
|
664
|
+
`Previous layout not found for panel index ${f}`
|
|
667
665
|
);
|
|
668
|
-
const
|
|
669
|
-
overrideDisabledPanels:
|
|
670
|
-
panelConstraints: n[
|
|
671
|
-
prevSize:
|
|
672
|
-
size:
|
|
666
|
+
const g = h + p, y = Y({
|
|
667
|
+
overrideDisabledPanels: u,
|
|
668
|
+
panelConstraints: n[f],
|
|
669
|
+
prevSize: h,
|
|
670
|
+
size: g
|
|
673
671
|
});
|
|
674
|
-
if (
|
|
675
|
-
let
|
|
676
|
-
for (;
|
|
677
|
-
const
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
`Previous layout not found for panel index ${
|
|
672
|
+
if (l[f] = y, !I(y, g)) {
|
|
673
|
+
let z = g - y, d = e < 0 ? m : c;
|
|
674
|
+
for (; d >= 0 && d < n.length; ) {
|
|
675
|
+
const P = l[d];
|
|
676
|
+
L(
|
|
677
|
+
P != null,
|
|
678
|
+
`Previous layout not found for panel index ${d}`
|
|
681
679
|
);
|
|
682
|
-
const
|
|
683
|
-
overrideDisabledPanels:
|
|
684
|
-
panelConstraints: n[
|
|
685
|
-
prevSize:
|
|
686
|
-
size:
|
|
680
|
+
const R = P + z, C = Y({
|
|
681
|
+
overrideDisabledPanels: u,
|
|
682
|
+
panelConstraints: n[d],
|
|
683
|
+
prevSize: P,
|
|
684
|
+
size: R
|
|
687
685
|
});
|
|
688
|
-
if (
|
|
686
|
+
if (I(P, C) || (z -= C - P, l[d] = C), I(z, 0))
|
|
689
687
|
break;
|
|
690
|
-
e > 0 ?
|
|
688
|
+
e > 0 ? d-- : d++;
|
|
691
689
|
}
|
|
692
690
|
}
|
|
693
691
|
}
|
|
694
|
-
const
|
|
695
|
-
(
|
|
692
|
+
const v = Object.values(l).reduce(
|
|
693
|
+
(f, h) => h + f,
|
|
696
694
|
0
|
|
697
695
|
);
|
|
698
|
-
if (!
|
|
699
|
-
return
|
|
700
|
-
const
|
|
701
|
-
return
|
|
696
|
+
if (!I(v, 100, 0.1))
|
|
697
|
+
return r;
|
|
698
|
+
const x = Object.keys(r);
|
|
699
|
+
return l.reduce((f, h, g) => (f[x[g]] = h, f), {});
|
|
702
700
|
}
|
|
703
|
-
function
|
|
701
|
+
function j(e, t) {
|
|
704
702
|
if (Object.keys(e).length !== Object.keys(t).length)
|
|
705
703
|
return !1;
|
|
706
704
|
for (const n in e)
|
|
707
|
-
if (t[n] === void 0 ||
|
|
705
|
+
if (t[n] === void 0 || G(e[n], t[n]) !== 0)
|
|
708
706
|
return !1;
|
|
709
707
|
return !0;
|
|
710
708
|
}
|
|
@@ -712,185 +710,187 @@ function B({
|
|
|
712
710
|
layout: e,
|
|
713
711
|
panelConstraints: t
|
|
714
712
|
}) {
|
|
715
|
-
const n = Object.values(e), o = [...n],
|
|
716
|
-
(
|
|
713
|
+
const n = Object.values(e), o = [...n], r = o.reduce(
|
|
714
|
+
(i, s) => i + s,
|
|
717
715
|
0
|
|
718
716
|
);
|
|
719
717
|
if (o.length !== t.length)
|
|
720
718
|
throw Error(
|
|
721
|
-
`Invalid ${t.length} panel layout: ${o.map((
|
|
719
|
+
`Invalid ${t.length} panel layout: ${o.map((i) => `${i}%`).join(", ")}`
|
|
722
720
|
);
|
|
723
|
-
if (!
|
|
724
|
-
for (let
|
|
725
|
-
const
|
|
726
|
-
|
|
727
|
-
const
|
|
728
|
-
o[
|
|
721
|
+
if (!I(r, 100) && o.length > 0)
|
|
722
|
+
for (let i = 0; i < t.length; i++) {
|
|
723
|
+
const s = o[i];
|
|
724
|
+
L(s != null, `No layout data found for index ${i}`);
|
|
725
|
+
const l = 100 / r * s;
|
|
726
|
+
o[i] = l;
|
|
729
727
|
}
|
|
730
|
-
let
|
|
731
|
-
for (let
|
|
732
|
-
const
|
|
733
|
-
|
|
734
|
-
const
|
|
735
|
-
|
|
736
|
-
const
|
|
728
|
+
let a = 0;
|
|
729
|
+
for (let i = 0; i < t.length; i++) {
|
|
730
|
+
const s = n[i];
|
|
731
|
+
L(s != null, `No layout data found for index ${i}`);
|
|
732
|
+
const l = o[i];
|
|
733
|
+
L(l != null, `No layout data found for index ${i}`);
|
|
734
|
+
const c = Y({
|
|
737
735
|
overrideDisabledPanels: !0,
|
|
738
|
-
panelConstraints: t[
|
|
739
|
-
prevSize:
|
|
740
|
-
size:
|
|
736
|
+
panelConstraints: t[i],
|
|
737
|
+
prevSize: s,
|
|
738
|
+
size: l
|
|
741
739
|
});
|
|
742
|
-
|
|
740
|
+
l != c && (a += l - c, o[i] = c);
|
|
743
741
|
}
|
|
744
|
-
if (!
|
|
745
|
-
for (let
|
|
746
|
-
const
|
|
747
|
-
|
|
748
|
-
const
|
|
742
|
+
if (!I(a, 0))
|
|
743
|
+
for (let i = 0; i < t.length; i++) {
|
|
744
|
+
const s = o[i];
|
|
745
|
+
L(s != null, `No layout data found for index ${i}`);
|
|
746
|
+
const l = s + a, c = Y({
|
|
749
747
|
overrideDisabledPanels: !0,
|
|
750
|
-
panelConstraints: t[
|
|
751
|
-
prevSize:
|
|
752
|
-
size:
|
|
748
|
+
panelConstraints: t[i],
|
|
749
|
+
prevSize: s,
|
|
750
|
+
size: l
|
|
753
751
|
});
|
|
754
|
-
if (
|
|
752
|
+
if (s !== c && (a -= c - s, o[i] = c, I(a, 0)))
|
|
755
753
|
break;
|
|
756
754
|
}
|
|
757
|
-
const
|
|
758
|
-
return o.reduce((
|
|
755
|
+
const u = Object.keys(e);
|
|
756
|
+
return o.reduce((i, s, l) => (i[u[l]] = s, i), {});
|
|
759
757
|
}
|
|
760
|
-
function
|
|
758
|
+
function et({
|
|
761
759
|
groupId: e,
|
|
762
760
|
panelId: t
|
|
763
761
|
}) {
|
|
764
762
|
const n = () => {
|
|
765
|
-
const
|
|
763
|
+
const i = U();
|
|
766
764
|
for (const [
|
|
767
|
-
|
|
765
|
+
s,
|
|
768
766
|
{
|
|
769
|
-
defaultLayoutDeferred:
|
|
770
|
-
derivedPanelConstraints:
|
|
771
|
-
layout:
|
|
772
|
-
|
|
767
|
+
defaultLayoutDeferred: l,
|
|
768
|
+
derivedPanelConstraints: c,
|
|
769
|
+
layout: m,
|
|
770
|
+
groupSize: p,
|
|
771
|
+
separatorToPanels: v
|
|
773
772
|
}
|
|
774
|
-
] of
|
|
775
|
-
if (
|
|
773
|
+
] of i)
|
|
774
|
+
if (s.id === e)
|
|
776
775
|
return {
|
|
777
|
-
defaultLayoutDeferred:
|
|
778
|
-
derivedPanelConstraints:
|
|
779
|
-
group:
|
|
780
|
-
|
|
781
|
-
|
|
776
|
+
defaultLayoutDeferred: l,
|
|
777
|
+
derivedPanelConstraints: c,
|
|
778
|
+
group: s,
|
|
779
|
+
groupSize: p,
|
|
780
|
+
layout: m,
|
|
781
|
+
separatorToPanels: v
|
|
782
782
|
};
|
|
783
783
|
throw Error(`Group ${e} not found`);
|
|
784
784
|
}, o = () => {
|
|
785
|
-
const
|
|
786
|
-
(
|
|
785
|
+
const i = n().derivedPanelConstraints.find(
|
|
786
|
+
(s) => s.panelId === t
|
|
787
787
|
);
|
|
788
|
-
if (
|
|
789
|
-
return
|
|
788
|
+
if (i !== void 0)
|
|
789
|
+
return i;
|
|
790
790
|
throw Error(`Panel constraints not found for Panel ${t}`);
|
|
791
|
-
},
|
|
792
|
-
const
|
|
793
|
-
if (
|
|
794
|
-
return
|
|
791
|
+
}, r = () => {
|
|
792
|
+
const i = n().group.panels.find((s) => s.id === t);
|
|
793
|
+
if (i !== void 0)
|
|
794
|
+
return i;
|
|
795
795
|
throw Error(`Layout not found for Panel ${t}`);
|
|
796
|
-
},
|
|
797
|
-
const
|
|
798
|
-
if (
|
|
799
|
-
return
|
|
796
|
+
}, a = () => {
|
|
797
|
+
const i = n().layout[t];
|
|
798
|
+
if (i !== void 0)
|
|
799
|
+
return i;
|
|
800
800
|
throw Error(`Layout not found for Panel ${t}`);
|
|
801
|
-
},
|
|
802
|
-
const
|
|
803
|
-
if (
|
|
801
|
+
}, u = (i) => {
|
|
802
|
+
const s = a();
|
|
803
|
+
if (i === s)
|
|
804
804
|
return;
|
|
805
805
|
const {
|
|
806
|
-
defaultLayoutDeferred:
|
|
807
|
-
derivedPanelConstraints:
|
|
808
|
-
group:
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
806
|
+
defaultLayoutDeferred: l,
|
|
807
|
+
derivedPanelConstraints: c,
|
|
808
|
+
group: m,
|
|
809
|
+
groupSize: p,
|
|
810
|
+
layout: v,
|
|
811
|
+
separatorToPanels: x
|
|
812
|
+
} = n(), f = m.panels.findIndex((z) => z.id === t), h = f === m.panels.length - 1, g = re({
|
|
813
|
+
delta: h ? s - i : i - s,
|
|
814
|
+
initialLayout: v,
|
|
815
|
+
panelConstraints: c,
|
|
816
|
+
pivotIndices: h ? [f - 1, f] : [f, f + 1],
|
|
817
|
+
prevLayout: v,
|
|
817
818
|
trigger: "imperative-api"
|
|
818
|
-
}),
|
|
819
|
-
layout:
|
|
820
|
-
panelConstraints:
|
|
819
|
+
}), y = B({
|
|
820
|
+
layout: g,
|
|
821
|
+
panelConstraints: c
|
|
822
|
+
});
|
|
823
|
+
j(v, y) || F(m, {
|
|
824
|
+
defaultLayoutDeferred: l,
|
|
825
|
+
derivedPanelConstraints: c,
|
|
826
|
+
groupSize: p,
|
|
827
|
+
layout: y,
|
|
828
|
+
separatorToPanels: x
|
|
821
829
|
});
|
|
822
|
-
U(b, m) || I((v) => ({
|
|
823
|
-
mountedGroups: new Map(v.mountedGroups).set(g, {
|
|
824
|
-
defaultLayoutDeferred: c,
|
|
825
|
-
derivedPanelConstraints: u,
|
|
826
|
-
layout: m,
|
|
827
|
-
separatorToPanels: S
|
|
828
|
-
})
|
|
829
|
-
}));
|
|
830
830
|
};
|
|
831
831
|
return {
|
|
832
832
|
collapse: () => {
|
|
833
|
-
const { collapsible:
|
|
834
|
-
|
|
833
|
+
const { collapsible: i, collapsedSize: s } = o(), { mutableValues: l } = r(), c = a();
|
|
834
|
+
i && c !== s && (l.expandToSize = c, u(s));
|
|
835
835
|
},
|
|
836
836
|
expand: () => {
|
|
837
|
-
const { collapsible:
|
|
838
|
-
if (
|
|
839
|
-
let
|
|
840
|
-
|
|
837
|
+
const { collapsible: i, collapsedSize: s, minSize: l } = o(), { mutableValues: c } = r(), m = a();
|
|
838
|
+
if (i && m === s) {
|
|
839
|
+
let p = c.expandToSize ?? l;
|
|
840
|
+
p === 0 && (p = 1), u(p);
|
|
841
841
|
}
|
|
842
842
|
},
|
|
843
843
|
getSize: () => {
|
|
844
|
-
const { group:
|
|
844
|
+
const { group: i } = n(), s = a(), { element: l } = r(), c = i.orientation === "horizontal" ? l.offsetWidth : l.offsetHeight;
|
|
845
845
|
return {
|
|
846
|
-
asPercentage:
|
|
847
|
-
inPixels:
|
|
846
|
+
asPercentage: s,
|
|
847
|
+
inPixels: c
|
|
848
848
|
};
|
|
849
849
|
},
|
|
850
850
|
isCollapsed: () => {
|
|
851
|
-
const { collapsible:
|
|
852
|
-
return
|
|
851
|
+
const { collapsible: i, collapsedSize: s } = o(), l = a();
|
|
852
|
+
return i && I(s, l);
|
|
853
853
|
},
|
|
854
|
-
resize: (
|
|
855
|
-
if (
|
|
856
|
-
let
|
|
857
|
-
switch (typeof
|
|
854
|
+
resize: (i) => {
|
|
855
|
+
if (a() !== i) {
|
|
856
|
+
let l;
|
|
857
|
+
switch (typeof i) {
|
|
858
858
|
case "number": {
|
|
859
|
-
const { group:
|
|
860
|
-
|
|
859
|
+
const { group: c } = n(), m = Q({ group: c });
|
|
860
|
+
l = D(i / m * 100);
|
|
861
861
|
break;
|
|
862
862
|
}
|
|
863
863
|
case "string": {
|
|
864
|
-
|
|
864
|
+
l = parseFloat(i);
|
|
865
865
|
break;
|
|
866
866
|
}
|
|
867
867
|
}
|
|
868
|
-
l
|
|
868
|
+
u(l);
|
|
869
869
|
}
|
|
870
870
|
}
|
|
871
871
|
};
|
|
872
872
|
}
|
|
873
|
-
function
|
|
873
|
+
function De(e) {
|
|
874
874
|
if (e.defaultPrevented)
|
|
875
875
|
return;
|
|
876
|
-
const
|
|
877
|
-
|
|
876
|
+
const t = U();
|
|
877
|
+
ve(e, t).forEach((o) => {
|
|
878
878
|
if (o.separator) {
|
|
879
|
-
const
|
|
880
|
-
(
|
|
879
|
+
const r = o.panels.find(
|
|
880
|
+
(a) => a.panelConstraints.defaultSize !== void 0
|
|
881
881
|
);
|
|
882
|
-
if (
|
|
883
|
-
const
|
|
882
|
+
if (r) {
|
|
883
|
+
const a = r.panelConstraints.defaultSize, u = et({
|
|
884
884
|
groupId: o.group.id,
|
|
885
|
-
panelId:
|
|
885
|
+
panelId: r.id
|
|
886
886
|
});
|
|
887
|
-
|
|
887
|
+
u && a !== void 0 && (u.resize(a), e.preventDefault());
|
|
888
888
|
}
|
|
889
889
|
}
|
|
890
890
|
});
|
|
891
891
|
}
|
|
892
|
-
function
|
|
893
|
-
const
|
|
892
|
+
function fe(e) {
|
|
893
|
+
const t = U();
|
|
894
894
|
for (const [n] of t)
|
|
895
895
|
if (n.separators.some(
|
|
896
896
|
(o) => o.element === e
|
|
@@ -898,14 +898,14 @@ function le(e) {
|
|
|
898
898
|
return n;
|
|
899
899
|
throw Error("Could not find parent Group for separator element");
|
|
900
900
|
}
|
|
901
|
-
function
|
|
901
|
+
function tt({
|
|
902
902
|
groupId: e
|
|
903
903
|
}) {
|
|
904
904
|
const t = () => {
|
|
905
|
-
const
|
|
906
|
-
for (const [o,
|
|
905
|
+
const n = U();
|
|
906
|
+
for (const [o, r] of n)
|
|
907
907
|
if (o.id === e)
|
|
908
|
-
return { group: o, ...
|
|
908
|
+
return { group: o, ...r };
|
|
909
909
|
throw Error(`Could not find Group with id "${e}"`);
|
|
910
910
|
};
|
|
911
911
|
return {
|
|
@@ -916,211 +916,223 @@ function Ue({
|
|
|
916
916
|
setLayout(n) {
|
|
917
917
|
const {
|
|
918
918
|
defaultLayoutDeferred: o,
|
|
919
|
-
derivedPanelConstraints:
|
|
920
|
-
group:
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
919
|
+
derivedPanelConstraints: r,
|
|
920
|
+
group: a,
|
|
921
|
+
groupSize: u,
|
|
922
|
+
layout: i,
|
|
923
|
+
separatorToPanels: s
|
|
924
|
+
} = t(), l = B({
|
|
924
925
|
layout: n,
|
|
925
|
-
panelConstraints:
|
|
926
|
+
panelConstraints: r
|
|
926
927
|
});
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
layout: a,
|
|
935
|
-
separatorToPanels: r
|
|
936
|
-
})
|
|
937
|
-
}));
|
|
938
|
-
const c = s.panels.map(({ id: u }) => u).join(",");
|
|
939
|
-
s.inMemoryLayouts[c] = a;
|
|
940
|
-
}
|
|
941
|
-
return a;
|
|
928
|
+
return o ? i : (j(i, l) || F(a, {
|
|
929
|
+
defaultLayoutDeferred: o,
|
|
930
|
+
derivedPanelConstraints: r,
|
|
931
|
+
groupSize: u,
|
|
932
|
+
layout: l,
|
|
933
|
+
separatorToPanels: s
|
|
934
|
+
}), l);
|
|
942
935
|
}
|
|
943
936
|
};
|
|
944
937
|
}
|
|
945
|
-
function
|
|
946
|
-
const
|
|
947
|
-
|
|
948
|
-
}
|
|
949
|
-
function W(e, t) {
|
|
950
|
-
const n = le(e), o = Be(n), i = n.separators.find(
|
|
951
|
-
(g) => g.element === e
|
|
938
|
+
function V(e, t) {
|
|
939
|
+
const n = fe(e), o = $(n.id, !0), r = n.separators.find(
|
|
940
|
+
(m) => m.element === e
|
|
952
941
|
);
|
|
953
|
-
|
|
954
|
-
const
|
|
955
|
-
|
|
956
|
-
const
|
|
942
|
+
L(r, "Matching separator not found");
|
|
943
|
+
const a = o.separatorToPanels.get(r);
|
|
944
|
+
L(a, "Matching panels not found");
|
|
945
|
+
const u = a.map((m) => n.panels.indexOf(m)), s = tt({ groupId: n.id }).getLayout(), l = re({
|
|
957
946
|
delta: t,
|
|
958
|
-
initialLayout:
|
|
947
|
+
initialLayout: s,
|
|
959
948
|
panelConstraints: o.derivedPanelConstraints,
|
|
960
|
-
pivotIndices:
|
|
961
|
-
prevLayout:
|
|
949
|
+
pivotIndices: u,
|
|
950
|
+
prevLayout: s,
|
|
962
951
|
trigger: "keyboard"
|
|
963
|
-
}),
|
|
964
|
-
layout:
|
|
952
|
+
}), c = B({
|
|
953
|
+
layout: l,
|
|
965
954
|
panelConstraints: o.derivedPanelConstraints
|
|
966
955
|
});
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
}));
|
|
956
|
+
j(s, c) || F(n, {
|
|
957
|
+
defaultLayoutDeferred: o.defaultLayoutDeferred,
|
|
958
|
+
derivedPanelConstraints: o.derivedPanelConstraints,
|
|
959
|
+
groupSize: o.groupSize,
|
|
960
|
+
layout: c,
|
|
961
|
+
separatorToPanels: o.separatorToPanels
|
|
962
|
+
});
|
|
975
963
|
}
|
|
976
|
-
function
|
|
964
|
+
function Te(e) {
|
|
977
965
|
if (e.defaultPrevented)
|
|
978
966
|
return;
|
|
979
|
-
const t = e.currentTarget, n =
|
|
967
|
+
const t = e.currentTarget, n = fe(t);
|
|
980
968
|
if (!n.disabled)
|
|
981
969
|
switch (e.key) {
|
|
982
970
|
case "ArrowDown": {
|
|
983
|
-
e.preventDefault(), n.orientation === "vertical" &&
|
|
971
|
+
e.preventDefault(), n.orientation === "vertical" && V(t, 5);
|
|
984
972
|
break;
|
|
985
973
|
}
|
|
986
974
|
case "ArrowLeft": {
|
|
987
|
-
e.preventDefault(), n.orientation === "horizontal" &&
|
|
975
|
+
e.preventDefault(), n.orientation === "horizontal" && V(t, -5);
|
|
988
976
|
break;
|
|
989
977
|
}
|
|
990
978
|
case "ArrowRight": {
|
|
991
|
-
e.preventDefault(), n.orientation === "horizontal" &&
|
|
979
|
+
e.preventDefault(), n.orientation === "horizontal" && V(t, 5);
|
|
992
980
|
break;
|
|
993
981
|
}
|
|
994
982
|
case "ArrowUp": {
|
|
995
|
-
e.preventDefault(), n.orientation === "vertical" &&
|
|
983
|
+
e.preventDefault(), n.orientation === "vertical" && V(t, -5);
|
|
996
984
|
break;
|
|
997
985
|
}
|
|
998
986
|
case "End": {
|
|
999
|
-
e.preventDefault(),
|
|
987
|
+
e.preventDefault(), V(t, 100);
|
|
1000
988
|
break;
|
|
1001
989
|
}
|
|
1002
990
|
case "Enter": {
|
|
1003
991
|
e.preventDefault();
|
|
1004
|
-
const o =
|
|
1005
|
-
(
|
|
992
|
+
const o = fe(t), r = $(o.id, !0), { derivedPanelConstraints: a, layout: u, separatorToPanels: i } = r, s = o.separators.find(
|
|
993
|
+
(p) => p.element === t
|
|
1006
994
|
);
|
|
1007
|
-
|
|
1008
|
-
const
|
|
1009
|
-
|
|
1010
|
-
const c =
|
|
1011
|
-
(
|
|
995
|
+
L(s, "Matching separator not found");
|
|
996
|
+
const l = i.get(s);
|
|
997
|
+
L(l, "Matching panels not found");
|
|
998
|
+
const c = l[0], m = a.find(
|
|
999
|
+
(p) => p.panelId === c.id
|
|
1012
1000
|
);
|
|
1013
|
-
if (
|
|
1014
|
-
const
|
|
1015
|
-
|
|
1001
|
+
if (L(m, "Panel metadata not found"), m.collapsible) {
|
|
1002
|
+
const p = u[c.id], v = m.collapsedSize === p ? o.mutableState.expandedPanelSizes[c.id] ?? m.minSize : m.collapsedSize;
|
|
1003
|
+
V(t, v - p);
|
|
1016
1004
|
}
|
|
1017
1005
|
break;
|
|
1018
1006
|
}
|
|
1019
1007
|
case "F6": {
|
|
1020
1008
|
e.preventDefault();
|
|
1021
|
-
const
|
|
1022
|
-
(
|
|
1023
|
-
),
|
|
1024
|
-
(
|
|
1009
|
+
const r = fe(t).separators.map(
|
|
1010
|
+
(s) => s.element
|
|
1011
|
+
), a = Array.from(r).findIndex(
|
|
1012
|
+
(s) => s === e.currentTarget
|
|
1025
1013
|
);
|
|
1026
|
-
|
|
1027
|
-
const
|
|
1028
|
-
|
|
1014
|
+
L(a !== null, "Index not found");
|
|
1015
|
+
const u = e.shiftKey ? a > 0 ? a - 1 : r.length - 1 : a + 1 < r.length ? a + 1 : 0;
|
|
1016
|
+
r[u].focus();
|
|
1029
1017
|
break;
|
|
1030
1018
|
}
|
|
1031
1019
|
case "Home": {
|
|
1032
|
-
e.preventDefault(),
|
|
1020
|
+
e.preventDefault(), V(t, -100);
|
|
1033
1021
|
break;
|
|
1034
1022
|
}
|
|
1035
1023
|
}
|
|
1036
1024
|
}
|
|
1037
|
-
|
|
1025
|
+
let J = {
|
|
1026
|
+
cursorFlags: 0,
|
|
1027
|
+
state: "inactive"
|
|
1028
|
+
};
|
|
1029
|
+
const ze = new Je();
|
|
1030
|
+
function W() {
|
|
1031
|
+
return J;
|
|
1032
|
+
}
|
|
1033
|
+
function Gt(e) {
|
|
1034
|
+
return ze.addListener("change", e);
|
|
1035
|
+
}
|
|
1036
|
+
function At(e) {
|
|
1037
|
+
const t = J, n = { ...J };
|
|
1038
|
+
n.cursorFlags = e, J = n, ze.emit("change", {
|
|
1039
|
+
prev: t,
|
|
1040
|
+
next: n
|
|
1041
|
+
});
|
|
1042
|
+
}
|
|
1043
|
+
function Z(e) {
|
|
1044
|
+
const t = J;
|
|
1045
|
+
J = e, ze.emit("change", {
|
|
1046
|
+
prev: t,
|
|
1047
|
+
next: e
|
|
1048
|
+
});
|
|
1049
|
+
}
|
|
1050
|
+
function Oe(e) {
|
|
1038
1051
|
if (e.defaultPrevented)
|
|
1039
1052
|
return;
|
|
1040
1053
|
if (e.pointerType === "mouse" && e.button > 0)
|
|
1041
1054
|
return;
|
|
1042
|
-
const
|
|
1043
|
-
let
|
|
1044
|
-
n.forEach((
|
|
1045
|
-
|
|
1046
|
-
const
|
|
1047
|
-
|
|
1048
|
-
}),
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
}
|
|
1055
|
+
const t = U(), n = ve(e, t), o = /* @__PURE__ */ new Map();
|
|
1056
|
+
let r = !1;
|
|
1057
|
+
n.forEach((a) => {
|
|
1058
|
+
a.separator && (r || (r = !0, a.separator.element.focus()));
|
|
1059
|
+
const u = t.get(a.group);
|
|
1060
|
+
u && o.set(a.group, u.layout);
|
|
1061
|
+
}), Z({
|
|
1062
|
+
cursorFlags: 0,
|
|
1063
|
+
hitRegions: n,
|
|
1064
|
+
initialLayoutMap: o,
|
|
1065
|
+
pointerDownAtPoint: { x: e.clientX, y: e.clientY },
|
|
1066
|
+
state: "active"
|
|
1055
1067
|
}), n.length && e.preventDefault();
|
|
1056
1068
|
}
|
|
1057
|
-
const
|
|
1058
|
-
},
|
|
1059
|
-
let
|
|
1060
|
-
function
|
|
1061
|
-
return
|
|
1069
|
+
const Nt = (e) => e, he = () => {
|
|
1070
|
+
}, nt = 1, ot = 2, it = 4, rt = 8, Ge = 3, Ae = 12;
|
|
1071
|
+
let ce;
|
|
1072
|
+
function Ne() {
|
|
1073
|
+
return ce === void 0 && (ce = !1, typeof window < "u" && (window.navigator.userAgent.includes("Chrome") || window.navigator.userAgent.includes("Firefox")) && (ce = !0)), ce;
|
|
1062
1074
|
}
|
|
1063
|
-
function
|
|
1075
|
+
function Ft({
|
|
1064
1076
|
cursorFlags: e,
|
|
1065
1077
|
groups: t,
|
|
1066
1078
|
state: n
|
|
1067
1079
|
}) {
|
|
1068
|
-
let o = 0,
|
|
1080
|
+
let o = 0, r = 0;
|
|
1069
1081
|
switch (n) {
|
|
1070
1082
|
case "active":
|
|
1071
1083
|
case "hover":
|
|
1072
|
-
t.forEach((
|
|
1073
|
-
if (!
|
|
1074
|
-
switch (
|
|
1084
|
+
t.forEach((a) => {
|
|
1085
|
+
if (!a.mutableState.disableCursor)
|
|
1086
|
+
switch (a.orientation) {
|
|
1075
1087
|
case "horizontal": {
|
|
1076
1088
|
o++;
|
|
1077
1089
|
break;
|
|
1078
1090
|
}
|
|
1079
1091
|
case "vertical": {
|
|
1080
|
-
|
|
1092
|
+
r++;
|
|
1081
1093
|
break;
|
|
1082
1094
|
}
|
|
1083
1095
|
}
|
|
1084
1096
|
});
|
|
1085
1097
|
}
|
|
1086
|
-
if (!(o === 0 &&
|
|
1098
|
+
if (!(o === 0 && r === 0)) {
|
|
1087
1099
|
switch (n) {
|
|
1088
1100
|
case "active": {
|
|
1089
|
-
if (e &&
|
|
1090
|
-
const
|
|
1091
|
-
if (s)
|
|
1092
|
-
return r ? "se-resize" : a ? "ne-resize" : "e-resize";
|
|
1093
|
-
if (l)
|
|
1094
|
-
return r ? "sw-resize" : a ? "nw-resize" : "w-resize";
|
|
1095
|
-
if (r)
|
|
1096
|
-
return "s-resize";
|
|
1101
|
+
if (e && Ne()) {
|
|
1102
|
+
const a = (e & nt) !== 0, u = (e & ot) !== 0, i = (e & it) !== 0, s = (e & rt) !== 0;
|
|
1097
1103
|
if (a)
|
|
1104
|
+
return i ? "se-resize" : s ? "ne-resize" : "e-resize";
|
|
1105
|
+
if (u)
|
|
1106
|
+
return i ? "sw-resize" : s ? "nw-resize" : "w-resize";
|
|
1107
|
+
if (i)
|
|
1108
|
+
return "s-resize";
|
|
1109
|
+
if (s)
|
|
1098
1110
|
return "n-resize";
|
|
1099
1111
|
}
|
|
1100
1112
|
break;
|
|
1101
1113
|
}
|
|
1102
1114
|
}
|
|
1103
|
-
return
|
|
1115
|
+
return Ne() ? o > 0 && r > 0 ? "move" : o > 0 ? "ew-resize" : "ns-resize" : o > 0 && r > 0 ? "grab" : o > 0 ? "col-resize" : "row-resize";
|
|
1104
1116
|
}
|
|
1105
1117
|
}
|
|
1106
|
-
const
|
|
1107
|
-
function
|
|
1118
|
+
const Fe = /* @__PURE__ */ new WeakMap();
|
|
1119
|
+
function be(e) {
|
|
1108
1120
|
if (e.defaultView === null || e.defaultView === void 0)
|
|
1109
1121
|
return;
|
|
1110
|
-
let { prevStyle: t, styleSheet: n } =
|
|
1111
|
-
n === void 0 && (n = new e.defaultView.CSSStyleSheet(), e.adoptedStyleSheets.push(n));
|
|
1112
|
-
const
|
|
1113
|
-
switch (
|
|
1122
|
+
let { prevStyle: t, styleSheet: n } = Fe.get(e) ?? {};
|
|
1123
|
+
n === void 0 && (n = new e.defaultView.CSSStyleSheet(), e.adoptedStyleSheets && e.adoptedStyleSheets.push(n));
|
|
1124
|
+
const o = W();
|
|
1125
|
+
switch (o.state) {
|
|
1114
1126
|
case "active":
|
|
1115
1127
|
case "hover": {
|
|
1116
|
-
const
|
|
1117
|
-
cursorFlags: o,
|
|
1118
|
-
groups:
|
|
1119
|
-
state:
|
|
1120
|
-
}),
|
|
1121
|
-
if (t ===
|
|
1128
|
+
const r = Ft({
|
|
1129
|
+
cursorFlags: o.cursorFlags,
|
|
1130
|
+
groups: o.hitRegions.map((u) => u.group),
|
|
1131
|
+
state: o.state
|
|
1132
|
+
}), a = `*, *:hover {cursor: ${r} !important; }`;
|
|
1133
|
+
if (t === a)
|
|
1122
1134
|
return;
|
|
1123
|
-
t =
|
|
1135
|
+
t = a, r ? n.cssRules.length === 0 ? n.insertRule(a) : n.replaceSync(a) : n.cssRules.length === 1 && n.deleteRule(0);
|
|
1124
1136
|
break;
|
|
1125
1137
|
}
|
|
1126
1138
|
case "inactive": {
|
|
@@ -1128,194 +1140,185 @@ function he(e) {
|
|
|
1128
1140
|
break;
|
|
1129
1141
|
}
|
|
1130
1142
|
}
|
|
1131
|
-
|
|
1143
|
+
Fe.set(e, {
|
|
1132
1144
|
prevStyle: t,
|
|
1133
1145
|
styleSheet: n
|
|
1134
1146
|
});
|
|
1135
1147
|
}
|
|
1136
|
-
function
|
|
1148
|
+
function at({
|
|
1137
1149
|
document: e,
|
|
1138
1150
|
event: t,
|
|
1139
1151
|
hitRegions: n,
|
|
1140
1152
|
initialLayoutMap: o,
|
|
1141
|
-
mountedGroups:
|
|
1142
|
-
pointerDownAtPoint:
|
|
1143
|
-
prevCursorFlags:
|
|
1153
|
+
mountedGroups: r,
|
|
1154
|
+
pointerDownAtPoint: a,
|
|
1155
|
+
prevCursorFlags: u
|
|
1144
1156
|
}) {
|
|
1145
|
-
let
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
const { group: g, groupSize: b } = u, { disableCursor: S, orientation: h, panels: d } = g;
|
|
1157
|
+
let i = 0;
|
|
1158
|
+
n.forEach((l) => {
|
|
1159
|
+
const { group: c, groupSize: m } = l, { orientation: p, panels: v } = c, { disableCursor: x } = c.mutableState;
|
|
1149
1160
|
let f = 0;
|
|
1150
|
-
|
|
1151
|
-
const
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1161
|
+
a ? p === "horizontal" ? f = (t.clientX - a.x) / m * 100 : f = (t.clientY - a.y) / m * 100 : p === "horizontal" ? f = t.clientX < 0 ? -100 : 100 : f = t.clientY < 0 ? -100 : 100;
|
|
1162
|
+
const h = o.get(c), g = r.get(c);
|
|
1163
|
+
if (!h || !g)
|
|
1164
|
+
return;
|
|
1165
|
+
const {
|
|
1166
|
+
defaultLayoutDeferred: y,
|
|
1167
|
+
derivedPanelConstraints: z,
|
|
1168
|
+
groupSize: S,
|
|
1169
|
+
layout: d,
|
|
1170
|
+
separatorToPanels: P
|
|
1171
|
+
} = g;
|
|
1172
|
+
if (z && d && P) {
|
|
1173
|
+
const R = re({
|
|
1159
1174
|
delta: f,
|
|
1160
|
-
initialLayout:
|
|
1161
|
-
panelConstraints:
|
|
1162
|
-
pivotIndices:
|
|
1163
|
-
prevLayout:
|
|
1175
|
+
initialLayout: h,
|
|
1176
|
+
panelConstraints: z,
|
|
1177
|
+
pivotIndices: l.panels.map((C) => v.indexOf(C)),
|
|
1178
|
+
prevLayout: d,
|
|
1164
1179
|
trigger: "mouse-or-touch"
|
|
1165
1180
|
});
|
|
1166
|
-
if (
|
|
1167
|
-
if (f !== 0 && !
|
|
1168
|
-
switch (
|
|
1181
|
+
if (j(R, d)) {
|
|
1182
|
+
if (f !== 0 && !x)
|
|
1183
|
+
switch (p) {
|
|
1169
1184
|
case "horizontal": {
|
|
1170
|
-
|
|
1185
|
+
i |= f < 0 ? nt : ot;
|
|
1171
1186
|
break;
|
|
1172
1187
|
}
|
|
1173
1188
|
case "vertical": {
|
|
1174
|
-
|
|
1189
|
+
i |= f < 0 ? it : rt;
|
|
1175
1190
|
break;
|
|
1176
1191
|
}
|
|
1177
1192
|
}
|
|
1178
|
-
} else
|
|
1179
|
-
|
|
1180
|
-
defaultLayoutDeferred:
|
|
1181
|
-
derivedPanelConstraints:
|
|
1182
|
-
|
|
1183
|
-
|
|
1193
|
+
} else
|
|
1194
|
+
F(l.group, {
|
|
1195
|
+
defaultLayoutDeferred: y,
|
|
1196
|
+
derivedPanelConstraints: z,
|
|
1197
|
+
groupSize: S,
|
|
1198
|
+
layout: R,
|
|
1199
|
+
separatorToPanels: P
|
|
1184
1200
|
});
|
|
1185
|
-
const C = u.group.panels.map(({ id: R }) => R).join(",");
|
|
1186
|
-
u.group.inMemoryLayouts[C] = w;
|
|
1187
|
-
}
|
|
1188
1201
|
}
|
|
1189
1202
|
});
|
|
1190
|
-
let
|
|
1191
|
-
t.movementX === 0 ?
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
}
|
|
1196
|
-
function Ge(e) {
|
|
1197
|
-
const { cursorFlags: t, interactionState: n, mountedGroups: o } = G();
|
|
1203
|
+
let s = 0;
|
|
1204
|
+
t.movementX === 0 ? s |= u & Ge : s |= i & Ge, t.movementY === 0 ? s |= u & Ae : s |= i & Ae, At(s), be(e);
|
|
1205
|
+
}
|
|
1206
|
+
function _e(e) {
|
|
1207
|
+
const t = U(), n = W();
|
|
1198
1208
|
switch (n.state) {
|
|
1199
1209
|
case "active":
|
|
1200
|
-
|
|
1210
|
+
at({
|
|
1201
1211
|
document: e.currentTarget,
|
|
1202
1212
|
event: e,
|
|
1203
1213
|
hitRegions: n.hitRegions,
|
|
1204
1214
|
initialLayoutMap: n.initialLayoutMap,
|
|
1205
|
-
mountedGroups:
|
|
1206
|
-
prevCursorFlags:
|
|
1215
|
+
mountedGroups: t,
|
|
1216
|
+
prevCursorFlags: n.cursorFlags
|
|
1207
1217
|
});
|
|
1208
1218
|
}
|
|
1209
1219
|
}
|
|
1210
|
-
function
|
|
1220
|
+
function $e(e) {
|
|
1211
1221
|
if (e.defaultPrevented)
|
|
1212
1222
|
return;
|
|
1213
|
-
const
|
|
1214
|
-
switch (
|
|
1223
|
+
const t = W(), n = U();
|
|
1224
|
+
switch (t.state) {
|
|
1215
1225
|
case "active": {
|
|
1216
1226
|
if (
|
|
1217
1227
|
// Skip this check for "pointerleave" events, else Firefox triggers a false positive (see #514)
|
|
1218
1228
|
e.buttons === 0
|
|
1219
1229
|
) {
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
}));
|
|
1230
|
+
Z({
|
|
1231
|
+
cursorFlags: 0,
|
|
1232
|
+
state: "inactive"
|
|
1233
|
+
}), t.hitRegions.forEach((o) => {
|
|
1234
|
+
const r = $(o.group.id, !0);
|
|
1235
|
+
F(o.group, r);
|
|
1236
|
+
});
|
|
1228
1237
|
return;
|
|
1229
1238
|
}
|
|
1230
|
-
|
|
1239
|
+
at({
|
|
1231
1240
|
document: e.currentTarget,
|
|
1232
1241
|
event: e,
|
|
1233
|
-
hitRegions:
|
|
1234
|
-
initialLayoutMap:
|
|
1235
|
-
mountedGroups:
|
|
1236
|
-
pointerDownAtPoint:
|
|
1237
|
-
prevCursorFlags: t
|
|
1242
|
+
hitRegions: t.hitRegions,
|
|
1243
|
+
initialLayoutMap: t.initialLayoutMap,
|
|
1244
|
+
mountedGroups: n,
|
|
1245
|
+
pointerDownAtPoint: t.pointerDownAtPoint,
|
|
1246
|
+
prevCursorFlags: t.cursorFlags
|
|
1238
1247
|
});
|
|
1239
1248
|
break;
|
|
1240
1249
|
}
|
|
1241
1250
|
default: {
|
|
1242
|
-
const
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
}
|
|
1252
|
-
}), he(e.currentTarget);
|
|
1251
|
+
const o = ve(e, n);
|
|
1252
|
+
o.length === 0 ? t.state !== "inactive" && Z({
|
|
1253
|
+
cursorFlags: 0,
|
|
1254
|
+
state: "inactive"
|
|
1255
|
+
}) : Z({
|
|
1256
|
+
cursorFlags: 0,
|
|
1257
|
+
hitRegions: o,
|
|
1258
|
+
state: "hover"
|
|
1259
|
+
}), be(e.currentTarget);
|
|
1253
1260
|
break;
|
|
1254
1261
|
}
|
|
1255
1262
|
}
|
|
1256
1263
|
}
|
|
1257
|
-
function
|
|
1258
|
-
if (e.relatedTarget instanceof HTMLIFrameElement)
|
|
1259
|
-
|
|
1260
|
-
switch (t.state) {
|
|
1264
|
+
function He(e) {
|
|
1265
|
+
if (e.relatedTarget instanceof HTMLIFrameElement)
|
|
1266
|
+
switch (W().state) {
|
|
1261
1267
|
case "hover":
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
}
|
|
1268
|
+
Z({
|
|
1269
|
+
cursorFlags: 0,
|
|
1270
|
+
state: "inactive"
|
|
1266
1271
|
});
|
|
1267
1272
|
}
|
|
1268
|
-
}
|
|
1269
1273
|
}
|
|
1270
|
-
function
|
|
1274
|
+
function Ve(e) {
|
|
1271
1275
|
if (e.defaultPrevented)
|
|
1272
1276
|
return;
|
|
1273
1277
|
if (e.pointerType === "mouse" && e.button > 0)
|
|
1274
1278
|
return;
|
|
1275
|
-
const
|
|
1279
|
+
const t = W();
|
|
1276
1280
|
switch (t.state) {
|
|
1277
1281
|
case "active":
|
|
1278
|
-
|
|
1282
|
+
Z({
|
|
1279
1283
|
cursorFlags: 0,
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
})), e.preventDefault());
|
|
1284
|
+
state: "inactive"
|
|
1285
|
+
}), t.hitRegions.length > 0 && (be(e.currentTarget), t.hitRegions.forEach((n) => {
|
|
1286
|
+
const o = $(n.group.id, !0);
|
|
1287
|
+
F(n.group, o);
|
|
1288
|
+
}), e.preventDefault());
|
|
1286
1289
|
}
|
|
1287
1290
|
}
|
|
1288
|
-
function
|
|
1291
|
+
function je(e) {
|
|
1289
1292
|
let t = 0, n = 0;
|
|
1290
1293
|
const o = {};
|
|
1291
|
-
for (const
|
|
1292
|
-
if (
|
|
1294
|
+
for (const a of e)
|
|
1295
|
+
if (a.defaultSize !== void 0) {
|
|
1293
1296
|
t++;
|
|
1294
|
-
const
|
|
1295
|
-
n +=
|
|
1297
|
+
const u = D(a.defaultSize);
|
|
1298
|
+
n += u, o[a.panelId] = u;
|
|
1296
1299
|
} else
|
|
1297
|
-
o[
|
|
1298
|
-
const
|
|
1299
|
-
if (
|
|
1300
|
-
const
|
|
1301
|
-
for (const
|
|
1302
|
-
|
|
1300
|
+
o[a.panelId] = void 0;
|
|
1301
|
+
const r = e.length - t;
|
|
1302
|
+
if (r !== 0) {
|
|
1303
|
+
const a = D((100 - n) / r);
|
|
1304
|
+
for (const u of e)
|
|
1305
|
+
u.defaultSize === void 0 && (o[u.panelId] = a);
|
|
1303
1306
|
}
|
|
1304
1307
|
return o;
|
|
1305
1308
|
}
|
|
1306
|
-
function
|
|
1309
|
+
function _t(e, t, n) {
|
|
1307
1310
|
if (!n[0])
|
|
1308
1311
|
return;
|
|
1309
|
-
const
|
|
1310
|
-
if (!
|
|
1312
|
+
const r = e.panels.find((l) => l.element === t);
|
|
1313
|
+
if (!r || !r.onResize)
|
|
1311
1314
|
return;
|
|
1312
|
-
const
|
|
1313
|
-
asPercentage:
|
|
1314
|
-
inPixels:
|
|
1315
|
+
const a = Q({ group: e }), u = e.orientation === "horizontal" ? r.element.offsetWidth : r.element.offsetHeight, i = r.mutableValues.prevSize, s = {
|
|
1316
|
+
asPercentage: D(u / a * 100),
|
|
1317
|
+
inPixels: u
|
|
1315
1318
|
};
|
|
1316
|
-
|
|
1319
|
+
r.mutableValues.prevSize = s, r.onResize(s, r.id, i);
|
|
1317
1320
|
}
|
|
1318
|
-
function
|
|
1321
|
+
function $t(e, t) {
|
|
1319
1322
|
if (Object.keys(e).length !== Object.keys(t).length)
|
|
1320
1323
|
return !1;
|
|
1321
1324
|
for (const o in e)
|
|
@@ -1323,128 +1326,176 @@ function Mt(e, t) {
|
|
|
1323
1326
|
return !1;
|
|
1324
1327
|
return !0;
|
|
1325
1328
|
}
|
|
1326
|
-
function
|
|
1327
|
-
|
|
1329
|
+
function Ht({
|
|
1330
|
+
group: e,
|
|
1331
|
+
nextGroupSize: t,
|
|
1332
|
+
prevGroupSize: n,
|
|
1333
|
+
prevLayout: o
|
|
1334
|
+
}) {
|
|
1335
|
+
if (n <= 0 || t <= 0 || n === t)
|
|
1336
|
+
return o;
|
|
1337
|
+
let r = 0, a = 0, u = !1;
|
|
1338
|
+
const i = /* @__PURE__ */ new Map(), s = [];
|
|
1339
|
+
for (const m of e.panels) {
|
|
1340
|
+
const p = o[m.id] ?? 0;
|
|
1341
|
+
switch (m.panelConstraints.groupResizeBehavior) {
|
|
1342
|
+
case "preserve-pixel-size": {
|
|
1343
|
+
u = !0;
|
|
1344
|
+
const v = p / 100 * n, x = D(
|
|
1345
|
+
v / t * 100
|
|
1346
|
+
);
|
|
1347
|
+
i.set(m.id, x), r += x;
|
|
1348
|
+
break;
|
|
1349
|
+
}
|
|
1350
|
+
case "preserve-relative-size":
|
|
1351
|
+
default: {
|
|
1352
|
+
s.push(m.id), a += p;
|
|
1353
|
+
break;
|
|
1354
|
+
}
|
|
1355
|
+
}
|
|
1356
|
+
}
|
|
1357
|
+
if (!u || s.length === 0)
|
|
1358
|
+
return o;
|
|
1359
|
+
const l = 100 - r, c = { ...o };
|
|
1360
|
+
if (i.forEach((m, p) => {
|
|
1361
|
+
c[p] = m;
|
|
1362
|
+
}), a > 0)
|
|
1363
|
+
for (const m of s) {
|
|
1364
|
+
const p = o[m] ?? 0;
|
|
1365
|
+
c[m] = D(
|
|
1366
|
+
p / a * l
|
|
1367
|
+
);
|
|
1368
|
+
}
|
|
1369
|
+
else {
|
|
1370
|
+
const m = D(
|
|
1371
|
+
l / s.length
|
|
1372
|
+
);
|
|
1373
|
+
for (const p of s)
|
|
1374
|
+
c[p] = m;
|
|
1375
|
+
}
|
|
1376
|
+
return c;
|
|
1377
|
+
}
|
|
1378
|
+
function Vt(e, t) {
|
|
1379
|
+
const n = e.map((r) => r.id), o = Object.keys(t);
|
|
1328
1380
|
if (n.length !== o.length)
|
|
1329
1381
|
return !1;
|
|
1330
|
-
for (const
|
|
1331
|
-
if (!o.includes(
|
|
1382
|
+
for (const r of n)
|
|
1383
|
+
if (!o.includes(r))
|
|
1332
1384
|
return !1;
|
|
1333
1385
|
return !0;
|
|
1334
1386
|
}
|
|
1335
1387
|
const q = /* @__PURE__ */ new Map();
|
|
1336
|
-
function
|
|
1388
|
+
function jt(e) {
|
|
1337
1389
|
let t = !0;
|
|
1338
|
-
|
|
1390
|
+
L(
|
|
1339
1391
|
e.element.ownerDocument.defaultView,
|
|
1340
1392
|
"Cannot register an unmounted Group"
|
|
1341
1393
|
);
|
|
1342
|
-
const n = e.element.ownerDocument.defaultView.ResizeObserver, o = /* @__PURE__ */ new Set(),
|
|
1343
|
-
for (const
|
|
1344
|
-
const { borderBoxSize:
|
|
1345
|
-
if (
|
|
1394
|
+
const n = e.element.ownerDocument.defaultView.ResizeObserver, o = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), a = new n((f) => {
|
|
1395
|
+
for (const h of f) {
|
|
1396
|
+
const { borderBoxSize: g, target: y } = h;
|
|
1397
|
+
if (y === e.element) {
|
|
1346
1398
|
if (t) {
|
|
1347
|
-
|
|
1399
|
+
const z = Q({ group: e });
|
|
1400
|
+
if (z === 0)
|
|
1348
1401
|
return;
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1402
|
+
const S = $(e.id);
|
|
1403
|
+
if (!S)
|
|
1404
|
+
return;
|
|
1405
|
+
const d = ge(e), P = S.defaultLayoutDeferred ? je(d) : S.layout, R = Ht({
|
|
1406
|
+
group: e,
|
|
1407
|
+
nextGroupSize: z,
|
|
1408
|
+
prevGroupSize: S.groupSize,
|
|
1409
|
+
prevLayout: P
|
|
1410
|
+
}), C = B({
|
|
1411
|
+
layout: R,
|
|
1412
|
+
panelConstraints: d
|
|
1413
|
+
});
|
|
1414
|
+
if (!S.defaultLayoutDeferred && j(S.layout, C) && $t(
|
|
1415
|
+
S.derivedPanelConstraints,
|
|
1416
|
+
d
|
|
1417
|
+
) && S.groupSize === z)
|
|
1418
|
+
return;
|
|
1419
|
+
F(e, {
|
|
1420
|
+
defaultLayoutDeferred: !1,
|
|
1421
|
+
derivedPanelConstraints: d,
|
|
1422
|
+
groupSize: z,
|
|
1423
|
+
layout: C,
|
|
1424
|
+
separatorToPanels: S.separatorToPanels
|
|
1369
1425
|
});
|
|
1370
1426
|
}
|
|
1371
1427
|
} else
|
|
1372
|
-
|
|
1428
|
+
_t(e, y, g);
|
|
1373
1429
|
}
|
|
1374
1430
|
});
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
!o.has(
|
|
1378
|
-
`Panel ids must be unique; id "${
|
|
1379
|
-
), o.add(
|
|
1431
|
+
a.observe(e.element), e.panels.forEach((f) => {
|
|
1432
|
+
L(
|
|
1433
|
+
!o.has(f.id),
|
|
1434
|
+
`Panel ids must be unique; id "${f.id}" was used more than once`
|
|
1435
|
+
), o.add(f.id), f.onResize && a.observe(f.element);
|
|
1380
1436
|
});
|
|
1381
|
-
const
|
|
1382
|
-
let
|
|
1383
|
-
|
|
1384
|
-
const
|
|
1385
|
-
layout:
|
|
1386
|
-
panelConstraints:
|
|
1387
|
-
}),
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
), i.add(h.id), h.element.addEventListener("keydown", Pe);
|
|
1408
|
-
}), q.get(S) === 1 && (S.addEventListener("dblclick", Le, !0), S.addEventListener("pointerdown", Ce, !0), S.addEventListener("pointerleave", Ge), S.addEventListener("pointermove", Ie), S.addEventListener("pointerout", De), S.addEventListener("pointerup", Oe, !0)), function() {
|
|
1437
|
+
const u = Q({ group: e }), i = ge(e), s = e.panels.map(({ id: f }) => f).join(",");
|
|
1438
|
+
let l = e.mutableState.defaultLayout;
|
|
1439
|
+
l && (Vt(e.panels, l) || (l = void 0));
|
|
1440
|
+
const c = e.mutableState.layouts[s] ?? l ?? je(i), m = B({
|
|
1441
|
+
layout: c,
|
|
1442
|
+
panelConstraints: i
|
|
1443
|
+
}), p = e.element.ownerDocument;
|
|
1444
|
+
q.set(
|
|
1445
|
+
p,
|
|
1446
|
+
(q.get(p) ?? 0) + 1
|
|
1447
|
+
);
|
|
1448
|
+
const v = /* @__PURE__ */ new Map();
|
|
1449
|
+
return Ye(e).forEach((f) => {
|
|
1450
|
+
f.separator && v.set(f.separator, f.panels);
|
|
1451
|
+
}), F(e, {
|
|
1452
|
+
defaultLayoutDeferred: u === 0,
|
|
1453
|
+
derivedPanelConstraints: i,
|
|
1454
|
+
groupSize: u,
|
|
1455
|
+
layout: m,
|
|
1456
|
+
separatorToPanels: v
|
|
1457
|
+
}), e.separators.forEach((f) => {
|
|
1458
|
+
L(
|
|
1459
|
+
!r.has(f.id),
|
|
1460
|
+
`Separator ids must be unique; id "${f.id}" was used more than once`
|
|
1461
|
+
), r.add(f.id), f.element.addEventListener("keydown", Te);
|
|
1462
|
+
}), q.get(p) === 1 && (p.addEventListener("dblclick", De, !0), p.addEventListener("pointerdown", Oe, !0), p.addEventListener("pointerleave", _e), p.addEventListener("pointermove", $e), p.addEventListener("pointerout", He), p.addEventListener("pointerup", Ve, !0)), function() {
|
|
1409
1463
|
t = !1, q.set(
|
|
1410
|
-
|
|
1411
|
-
Math.max(0, (q.get(
|
|
1412
|
-
),
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
}), e.separators.forEach((d) => {
|
|
1416
|
-
d.element.removeEventListener("keydown", Pe);
|
|
1417
|
-
}), q.get(S) || (S.removeEventListener(
|
|
1464
|
+
p,
|
|
1465
|
+
Math.max(0, (q.get(p) ?? 0) - 1)
|
|
1466
|
+
), Lt(e), e.separators.forEach((h) => {
|
|
1467
|
+
h.element.removeEventListener("keydown", Te);
|
|
1468
|
+
}), q.get(p) || (p.removeEventListener(
|
|
1418
1469
|
"dblclick",
|
|
1419
|
-
|
|
1470
|
+
De,
|
|
1420
1471
|
!0
|
|
1421
|
-
),
|
|
1472
|
+
), p.removeEventListener(
|
|
1422
1473
|
"pointerdown",
|
|
1423
|
-
|
|
1474
|
+
Oe,
|
|
1424
1475
|
!0
|
|
1425
|
-
),
|
|
1476
|
+
), p.removeEventListener("pointerleave", _e), p.removeEventListener("pointermove", $e), p.removeEventListener("pointerout", He), p.removeEventListener("pointerup", Ve, !0)), a.disconnect();
|
|
1426
1477
|
};
|
|
1427
1478
|
}
|
|
1428
|
-
function
|
|
1429
|
-
const [e, t] =
|
|
1479
|
+
function Bt() {
|
|
1480
|
+
const [e, t] = ie({}), n = te(() => t({}), []);
|
|
1430
1481
|
return [e, n];
|
|
1431
1482
|
}
|
|
1432
|
-
function
|
|
1433
|
-
const t =
|
|
1483
|
+
function xe(e) {
|
|
1484
|
+
const t = pt();
|
|
1434
1485
|
return `${e ?? t}`;
|
|
1435
1486
|
}
|
|
1436
|
-
const K = typeof window < "u" ?
|
|
1437
|
-
function
|
|
1438
|
-
const t =
|
|
1487
|
+
const K = typeof window < "u" ? Be : de;
|
|
1488
|
+
function ne(e) {
|
|
1489
|
+
const t = T(e);
|
|
1439
1490
|
return K(() => {
|
|
1440
1491
|
t.current = e;
|
|
1441
|
-
}, [e]),
|
|
1492
|
+
}, [e]), te(
|
|
1442
1493
|
(...n) => t.current?.(...n),
|
|
1443
1494
|
[t]
|
|
1444
1495
|
);
|
|
1445
1496
|
}
|
|
1446
|
-
function
|
|
1447
|
-
return
|
|
1497
|
+
function we(...e) {
|
|
1498
|
+
return ne((t) => {
|
|
1448
1499
|
e.forEach((n) => {
|
|
1449
1500
|
if (n)
|
|
1450
1501
|
switch (typeof n) {
|
|
@@ -1460,422 +1511,422 @@ function ye(...e) {
|
|
|
1460
1511
|
});
|
|
1461
1512
|
});
|
|
1462
1513
|
}
|
|
1463
|
-
function
|
|
1464
|
-
const t =
|
|
1514
|
+
function Pe(e) {
|
|
1515
|
+
const t = T({ ...e });
|
|
1465
1516
|
return K(() => {
|
|
1466
1517
|
for (const n in e)
|
|
1467
1518
|
t.current[n] = e[n];
|
|
1468
1519
|
}, [e]), t.current;
|
|
1469
1520
|
}
|
|
1470
|
-
const
|
|
1471
|
-
function
|
|
1472
|
-
const n =
|
|
1521
|
+
const st = ht(null);
|
|
1522
|
+
function Wt(e, t) {
|
|
1523
|
+
const n = T({
|
|
1473
1524
|
getLayout: () => ({}),
|
|
1474
|
-
setLayout:
|
|
1525
|
+
setLayout: Nt
|
|
1475
1526
|
});
|
|
1476
|
-
|
|
1527
|
+
We(t, () => n.current, []), K(() => {
|
|
1477
1528
|
Object.assign(
|
|
1478
1529
|
n.current,
|
|
1479
|
-
|
|
1530
|
+
tt({ groupId: e })
|
|
1480
1531
|
);
|
|
1481
1532
|
});
|
|
1482
1533
|
}
|
|
1483
|
-
function
|
|
1534
|
+
function Ut({
|
|
1484
1535
|
children: e,
|
|
1485
1536
|
className: t,
|
|
1486
1537
|
defaultLayout: n,
|
|
1487
1538
|
disableCursor: o,
|
|
1488
|
-
disabled:
|
|
1489
|
-
elementRef:
|
|
1490
|
-
groupRef:
|
|
1491
|
-
id:
|
|
1492
|
-
onLayoutChange:
|
|
1493
|
-
onLayoutChanged:
|
|
1494
|
-
orientation:
|
|
1495
|
-
resizeTargetMinimumSize:
|
|
1539
|
+
disabled: r,
|
|
1540
|
+
elementRef: a,
|
|
1541
|
+
groupRef: u,
|
|
1542
|
+
id: i,
|
|
1543
|
+
onLayoutChange: s,
|
|
1544
|
+
onLayoutChanged: l,
|
|
1545
|
+
orientation: c = "horizontal",
|
|
1546
|
+
resizeTargetMinimumSize: m = {
|
|
1496
1547
|
coarse: 20,
|
|
1497
1548
|
fine: 10
|
|
1498
1549
|
},
|
|
1499
|
-
style:
|
|
1500
|
-
...
|
|
1550
|
+
style: p,
|
|
1551
|
+
...v
|
|
1501
1552
|
}) {
|
|
1502
|
-
const
|
|
1553
|
+
const x = T({
|
|
1503
1554
|
onLayoutChange: {},
|
|
1504
1555
|
onLayoutChanged: {}
|
|
1505
|
-
}),
|
|
1506
|
-
|
|
1507
|
-
}),
|
|
1508
|
-
|
|
1509
|
-
}),
|
|
1556
|
+
}), f = ne((b) => {
|
|
1557
|
+
j(x.current.onLayoutChange, b) || (x.current.onLayoutChange = b, s?.(b));
|
|
1558
|
+
}), h = ne((b) => {
|
|
1559
|
+
j(x.current.onLayoutChanged, b) || (x.current.onLayoutChanged = b, l?.(b));
|
|
1560
|
+
}), g = xe(i), y = T(null), [z, S] = Bt(), d = T({
|
|
1510
1561
|
lastExpandedPanelSizes: {},
|
|
1511
1562
|
layouts: {},
|
|
1512
1563
|
panels: [],
|
|
1513
|
-
resizeTargetMinimumSize:
|
|
1564
|
+
resizeTargetMinimumSize: m,
|
|
1514
1565
|
separators: []
|
|
1515
|
-
}),
|
|
1516
|
-
|
|
1517
|
-
const
|
|
1518
|
-
(
|
|
1519
|
-
const
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
(Z) => Z.group === D
|
|
1529
|
-
);
|
|
1530
|
-
break;
|
|
1531
|
-
}
|
|
1532
|
-
}
|
|
1533
|
-
return {
|
|
1534
|
-
flexGrow: T.layout[L] ?? 1,
|
|
1535
|
-
pointerEvents: N ? "none" : void 0
|
|
1536
|
-
};
|
|
1566
|
+
}), P = we(y, a);
|
|
1567
|
+
Wt(g, u);
|
|
1568
|
+
const R = ne(
|
|
1569
|
+
(b, w) => {
|
|
1570
|
+
const E = W(), M = Me(b), k = $(b);
|
|
1571
|
+
if (k) {
|
|
1572
|
+
let O = !1;
|
|
1573
|
+
switch (E.state) {
|
|
1574
|
+
case "active": {
|
|
1575
|
+
O = E.hitRegions.some(
|
|
1576
|
+
(H) => H.group === M
|
|
1577
|
+
);
|
|
1578
|
+
break;
|
|
1537
1579
|
}
|
|
1538
1580
|
}
|
|
1581
|
+
return {
|
|
1582
|
+
flexGrow: k.layout[w] ?? 1,
|
|
1583
|
+
pointerEvents: O ? "none" : void 0
|
|
1584
|
+
};
|
|
1585
|
+
}
|
|
1539
1586
|
return {
|
|
1540
|
-
flexGrow: n?.[
|
|
1587
|
+
flexGrow: n?.[w] ?? 1
|
|
1541
1588
|
};
|
|
1542
1589
|
}
|
|
1543
|
-
),
|
|
1590
|
+
), C = Pe({
|
|
1544
1591
|
defaultLayout: n,
|
|
1545
1592
|
disableCursor: o
|
|
1546
|
-
}), X =
|
|
1593
|
+
}), X = Ue(
|
|
1547
1594
|
() => ({
|
|
1548
1595
|
get disableCursor() {
|
|
1549
|
-
return !!
|
|
1596
|
+
return !!C.disableCursor;
|
|
1550
1597
|
},
|
|
1551
|
-
getPanelStyles:
|
|
1552
|
-
id:
|
|
1553
|
-
orientation:
|
|
1554
|
-
registerPanel: (
|
|
1555
|
-
const
|
|
1556
|
-
return
|
|
1557
|
-
...
|
|
1558
|
-
|
|
1559
|
-
]),
|
|
1560
|
-
|
|
1561
|
-
(
|
|
1562
|
-
),
|
|
1598
|
+
getPanelStyles: R,
|
|
1599
|
+
id: g,
|
|
1600
|
+
orientation: c,
|
|
1601
|
+
registerPanel: (b) => {
|
|
1602
|
+
const w = d.current;
|
|
1603
|
+
return w.panels = Se(c, [
|
|
1604
|
+
...w.panels,
|
|
1605
|
+
b
|
|
1606
|
+
]), S(), () => {
|
|
1607
|
+
w.panels = w.panels.filter(
|
|
1608
|
+
(E) => E !== b
|
|
1609
|
+
), S();
|
|
1563
1610
|
};
|
|
1564
1611
|
},
|
|
1565
|
-
registerSeparator: (
|
|
1566
|
-
const
|
|
1567
|
-
return
|
|
1568
|
-
...
|
|
1569
|
-
|
|
1570
|
-
]),
|
|
1571
|
-
|
|
1572
|
-
(
|
|
1573
|
-
),
|
|
1612
|
+
registerSeparator: (b) => {
|
|
1613
|
+
const w = d.current;
|
|
1614
|
+
return w.separators = Se(c, [
|
|
1615
|
+
...w.separators,
|
|
1616
|
+
b
|
|
1617
|
+
]), S(), () => {
|
|
1618
|
+
w.separators = w.separators.filter(
|
|
1619
|
+
(E) => E !== b
|
|
1620
|
+
), S();
|
|
1574
1621
|
};
|
|
1575
1622
|
},
|
|
1576
|
-
togglePanelDisabled: (
|
|
1577
|
-
const
|
|
1578
|
-
(
|
|
1623
|
+
togglePanelDisabled: (b, w) => {
|
|
1624
|
+
const M = d.current.panels.find(
|
|
1625
|
+
(H) => H.id === b
|
|
1579
1626
|
);
|
|
1580
|
-
|
|
1581
|
-
const
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
}
|
|
1627
|
+
M && (M.panelConstraints.disabled = w);
|
|
1628
|
+
const k = Me(g), O = $(g);
|
|
1629
|
+
k && O && F(k, {
|
|
1630
|
+
...O,
|
|
1631
|
+
derivedPanelConstraints: ge(k)
|
|
1632
|
+
});
|
|
1587
1633
|
},
|
|
1588
|
-
toggleSeparatorDisabled: (
|
|
1589
|
-
const
|
|
1590
|
-
(
|
|
1634
|
+
toggleSeparatorDisabled: (b, w) => {
|
|
1635
|
+
const M = d.current.separators.find(
|
|
1636
|
+
(k) => k.id === b
|
|
1591
1637
|
);
|
|
1592
|
-
|
|
1638
|
+
M && (M.disabled = w);
|
|
1593
1639
|
}
|
|
1594
1640
|
}),
|
|
1595
|
-
[
|
|
1596
|
-
),
|
|
1641
|
+
[R, g, S, c, C]
|
|
1642
|
+
), _ = T(null);
|
|
1597
1643
|
return K(() => {
|
|
1598
|
-
const
|
|
1599
|
-
if (
|
|
1644
|
+
const b = y.current;
|
|
1645
|
+
if (b === null)
|
|
1600
1646
|
return;
|
|
1601
|
-
const
|
|
1602
|
-
let
|
|
1603
|
-
if (
|
|
1604
|
-
|
|
1605
|
-
for (const
|
|
1606
|
-
const
|
|
1607
|
-
|
|
1647
|
+
const w = d.current;
|
|
1648
|
+
let E;
|
|
1649
|
+
if (C.defaultLayout !== void 0 && Object.keys(C.defaultLayout).length === w.panels.length) {
|
|
1650
|
+
E = {};
|
|
1651
|
+
for (const ee of w.panels) {
|
|
1652
|
+
const ae = C.defaultLayout[ee.id];
|
|
1653
|
+
ae !== void 0 && (E[ee.id] = ae);
|
|
1608
1654
|
}
|
|
1609
1655
|
}
|
|
1610
|
-
const
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1656
|
+
const M = {
|
|
1657
|
+
disabled: !!r,
|
|
1658
|
+
element: b,
|
|
1659
|
+
id: g,
|
|
1660
|
+
mutableState: {
|
|
1661
|
+
defaultLayout: E,
|
|
1662
|
+
disableCursor: !!C.disableCursor,
|
|
1663
|
+
expandedPanelSizes: d.current.lastExpandedPanelSizes,
|
|
1664
|
+
layouts: d.current.layouts
|
|
1665
|
+
},
|
|
1666
|
+
orientation: c,
|
|
1667
|
+
panels: w.panels,
|
|
1668
|
+
resizeTargetMinimumSize: w.resizeTargetMinimumSize,
|
|
1669
|
+
separators: w.separators
|
|
1622
1670
|
};
|
|
1623
|
-
|
|
1624
|
-
const
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
"
|
|
1631
|
-
(
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1671
|
+
_.current = M;
|
|
1672
|
+
const k = jt(M), { defaultLayoutDeferred: O, derivedPanelConstraints: H, layout: Ce } = $(M.id, !0);
|
|
1673
|
+
!O && H.length > 0 && (f(Ce), h(Ce));
|
|
1674
|
+
const lt = ye(g, (ee) => {
|
|
1675
|
+
const { defaultLayoutDeferred: ae, derivedPanelConstraints: Re, layout: se } = ee.next;
|
|
1676
|
+
if (ae || Re.length === 0)
|
|
1677
|
+
return;
|
|
1678
|
+
const ut = M.panels.map(({ id: N }) => N).join(",");
|
|
1679
|
+
M.mutableState.layouts[ut] = se, Re.forEach((N) => {
|
|
1680
|
+
if (N.collapsible) {
|
|
1681
|
+
const { layout: pe } = ee.prev ?? {};
|
|
1682
|
+
if (pe) {
|
|
1683
|
+
const ft = I(
|
|
1684
|
+
N.collapsedSize,
|
|
1685
|
+
se[N.panelId]
|
|
1686
|
+
), dt = I(
|
|
1687
|
+
N.collapsedSize,
|
|
1688
|
+
pe[N.panelId]
|
|
1689
|
+
);
|
|
1690
|
+
ft && !dt && (M.mutableState.expandedPanelSizes[N.panelId] = pe[N.panelId]);
|
|
1691
|
+
}
|
|
1644
1692
|
}
|
|
1645
|
-
}
|
|
1646
|
-
|
|
1693
|
+
});
|
|
1694
|
+
const ct = W().state !== "active";
|
|
1695
|
+
f(se), ct && h(se);
|
|
1696
|
+
});
|
|
1647
1697
|
return () => {
|
|
1648
|
-
|
|
1698
|
+
_.current = null, k(), lt();
|
|
1649
1699
|
};
|
|
1650
1700
|
}, [
|
|
1651
|
-
|
|
1652
|
-
|
|
1701
|
+
r,
|
|
1702
|
+
g,
|
|
1703
|
+
h,
|
|
1653
1704
|
f,
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
}), /* @__PURE__ */ te(Ze.Provider, { value: X, children: /* @__PURE__ */ te(
|
|
1705
|
+
c,
|
|
1706
|
+
z,
|
|
1707
|
+
C
|
|
1708
|
+
]), de(() => {
|
|
1709
|
+
const b = _.current;
|
|
1710
|
+
b && (b.mutableState.defaultLayout = n, b.mutableState.disableCursor = !!o);
|
|
1711
|
+
}), /* @__PURE__ */ oe(st.Provider, { value: X, children: /* @__PURE__ */ oe(
|
|
1662
1712
|
"div",
|
|
1663
1713
|
{
|
|
1664
|
-
...
|
|
1714
|
+
...v,
|
|
1665
1715
|
className: t,
|
|
1666
1716
|
"data-group": !0,
|
|
1667
|
-
"data-testid":
|
|
1668
|
-
id:
|
|
1669
|
-
ref:
|
|
1717
|
+
"data-testid": g,
|
|
1718
|
+
id: g,
|
|
1719
|
+
ref: P,
|
|
1670
1720
|
style: {
|
|
1671
1721
|
height: "100%",
|
|
1672
1722
|
width: "100%",
|
|
1673
1723
|
overflow: "hidden",
|
|
1674
|
-
...
|
|
1724
|
+
...p,
|
|
1675
1725
|
display: "flex",
|
|
1676
|
-
flexDirection:
|
|
1726
|
+
flexDirection: c === "horizontal" ? "row" : "column",
|
|
1677
1727
|
flexWrap: "nowrap",
|
|
1678
1728
|
// Inform the browser that the library is handling touch events for this element
|
|
1679
1729
|
// but still allow users to scroll content within panels in the non-resizing direction
|
|
1680
1730
|
// NOTE This is not an inherited style
|
|
1681
1731
|
// See github.com/bvaughn/react-resizable-panels/issues/662
|
|
1682
|
-
touchAction:
|
|
1732
|
+
touchAction: c === "horizontal" ? "pan-y" : "pan-x"
|
|
1683
1733
|
},
|
|
1684
1734
|
children: e
|
|
1685
1735
|
}
|
|
1686
1736
|
) });
|
|
1687
1737
|
}
|
|
1688
|
-
|
|
1689
|
-
function
|
|
1738
|
+
Ut.displayName = "Group";
|
|
1739
|
+
function me(e, t) {
|
|
1690
1740
|
return `react-resizable-panels:${[e, ...t].join(":")}`;
|
|
1691
1741
|
}
|
|
1692
|
-
function
|
|
1742
|
+
function nn({
|
|
1693
1743
|
debounceSaveMs: e = 100,
|
|
1694
1744
|
panelIds: t,
|
|
1695
1745
|
storage: n = localStorage,
|
|
1696
1746
|
...o
|
|
1697
1747
|
}) {
|
|
1698
|
-
const
|
|
1699
|
-
|
|
1700
|
-
() => n.getItem(
|
|
1701
|
-
() => n.getItem(
|
|
1702
|
-
),
|
|
1703
|
-
() =>
|
|
1704
|
-
[
|
|
1705
|
-
),
|
|
1706
|
-
const
|
|
1707
|
-
|
|
1748
|
+
const r = t !== void 0, a = "id" in o ? o.id : o.groupId, u = me(a, t ?? []), i = Ke(
|
|
1749
|
+
Kt,
|
|
1750
|
+
() => n.getItem(u),
|
|
1751
|
+
() => n.getItem(u)
|
|
1752
|
+
), s = Ue(
|
|
1753
|
+
() => i ? JSON.parse(i) : void 0,
|
|
1754
|
+
[i]
|
|
1755
|
+
), l = T(null), c = te(() => {
|
|
1756
|
+
const v = l.current;
|
|
1757
|
+
v && (l.current = null, clearTimeout(v));
|
|
1708
1758
|
}, []);
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
}, [
|
|
1712
|
-
const
|
|
1713
|
-
(
|
|
1714
|
-
|
|
1715
|
-
let
|
|
1716
|
-
|
|
1759
|
+
Be(() => () => {
|
|
1760
|
+
c();
|
|
1761
|
+
}, [c]);
|
|
1762
|
+
const m = te(
|
|
1763
|
+
(v) => {
|
|
1764
|
+
c();
|
|
1765
|
+
let x;
|
|
1766
|
+
r ? x = me(a, Object.keys(v)) : x = me(a, []);
|
|
1717
1767
|
try {
|
|
1718
|
-
n.setItem(
|
|
1719
|
-
} catch (
|
|
1720
|
-
console.error(
|
|
1768
|
+
n.setItem(x, JSON.stringify(v));
|
|
1769
|
+
} catch (f) {
|
|
1770
|
+
console.error(f);
|
|
1721
1771
|
}
|
|
1722
1772
|
},
|
|
1723
|
-
[
|
|
1724
|
-
),
|
|
1725
|
-
(
|
|
1726
|
-
|
|
1727
|
-
|
|
1773
|
+
[c, r, a, n]
|
|
1774
|
+
), p = te(
|
|
1775
|
+
(v) => {
|
|
1776
|
+
c(), e === 0 ? m(v) : l.current = setTimeout(() => {
|
|
1777
|
+
m(v);
|
|
1728
1778
|
}, e);
|
|
1729
1779
|
},
|
|
1730
|
-
[
|
|
1780
|
+
[c, e, m]
|
|
1731
1781
|
);
|
|
1732
1782
|
return {
|
|
1733
1783
|
/**
|
|
1734
1784
|
* Pass this value to `Group` as the `defaultLayout` prop.
|
|
1735
1785
|
*/
|
|
1736
|
-
defaultLayout:
|
|
1786
|
+
defaultLayout: s,
|
|
1737
1787
|
/**
|
|
1738
1788
|
* Attach this callback on the `Group` as the `onLayoutChange` prop.
|
|
1739
1789
|
*
|
|
1740
1790
|
* @deprecated Use the {@link onLayoutChanged} prop instead.
|
|
1741
1791
|
*/
|
|
1742
|
-
onLayoutChange:
|
|
1792
|
+
onLayoutChange: p,
|
|
1743
1793
|
/**
|
|
1744
1794
|
* Attach this callback on the `Group` as the `onLayoutChanged` prop.
|
|
1745
1795
|
*/
|
|
1746
|
-
onLayoutChanged:
|
|
1796
|
+
onLayoutChanged: m
|
|
1747
1797
|
};
|
|
1748
1798
|
}
|
|
1749
|
-
function
|
|
1799
|
+
function Kt() {
|
|
1750
1800
|
return function() {
|
|
1751
1801
|
};
|
|
1752
1802
|
}
|
|
1753
|
-
function
|
|
1754
|
-
return
|
|
1803
|
+
function on() {
|
|
1804
|
+
return ie(null);
|
|
1755
1805
|
}
|
|
1756
|
-
function
|
|
1757
|
-
return
|
|
1806
|
+
function rn() {
|
|
1807
|
+
return T(null);
|
|
1758
1808
|
}
|
|
1759
|
-
function
|
|
1760
|
-
const e =
|
|
1761
|
-
return
|
|
1809
|
+
function Le() {
|
|
1810
|
+
const e = mt(st);
|
|
1811
|
+
return L(
|
|
1762
1812
|
e,
|
|
1763
1813
|
"Group Context not found; did you render a Panel or Separator outside of a Group?"
|
|
1764
1814
|
), e;
|
|
1765
1815
|
}
|
|
1766
|
-
function
|
|
1767
|
-
const { id: n } =
|
|
1768
|
-
collapse:
|
|
1769
|
-
expand:
|
|
1816
|
+
function Xt(e, t) {
|
|
1817
|
+
const { id: n } = Le(), o = T({
|
|
1818
|
+
collapse: he,
|
|
1819
|
+
expand: he,
|
|
1770
1820
|
getSize: () => ({
|
|
1771
1821
|
asPercentage: 0,
|
|
1772
1822
|
inPixels: 0
|
|
1773
1823
|
}),
|
|
1774
1824
|
isCollapsed: () => !1,
|
|
1775
|
-
resize:
|
|
1825
|
+
resize: he
|
|
1776
1826
|
});
|
|
1777
|
-
|
|
1827
|
+
We(t, () => o.current, []), K(() => {
|
|
1778
1828
|
Object.assign(
|
|
1779
1829
|
o.current,
|
|
1780
|
-
|
|
1830
|
+
et({ groupId: n, panelId: e })
|
|
1781
1831
|
);
|
|
1782
1832
|
});
|
|
1783
1833
|
}
|
|
1784
|
-
function
|
|
1834
|
+
function qt({
|
|
1785
1835
|
children: e,
|
|
1786
1836
|
className: t,
|
|
1787
1837
|
collapsedSize: n = "0%",
|
|
1788
1838
|
collapsible: o = !1,
|
|
1789
|
-
defaultSize:
|
|
1790
|
-
disabled:
|
|
1791
|
-
elementRef:
|
|
1792
|
-
|
|
1793
|
-
|
|
1839
|
+
defaultSize: r,
|
|
1840
|
+
disabled: a,
|
|
1841
|
+
elementRef: u,
|
|
1842
|
+
groupResizeBehavior: i = "preserve-relative-size",
|
|
1843
|
+
id: s,
|
|
1844
|
+
maxSize: l = "100%",
|
|
1794
1845
|
minSize: c = "0%",
|
|
1795
|
-
onResize:
|
|
1796
|
-
panelRef:
|
|
1797
|
-
style:
|
|
1798
|
-
...
|
|
1846
|
+
onResize: m,
|
|
1847
|
+
panelRef: p,
|
|
1848
|
+
style: v,
|
|
1849
|
+
...x
|
|
1799
1850
|
}) {
|
|
1800
|
-
const
|
|
1801
|
-
disabled:
|
|
1802
|
-
}),
|
|
1803
|
-
getPanelStyles:
|
|
1804
|
-
id:
|
|
1805
|
-
orientation:
|
|
1806
|
-
registerPanel:
|
|
1851
|
+
const f = !!s, h = xe(s), g = Pe({
|
|
1852
|
+
disabled: a
|
|
1853
|
+
}), y = T(null), z = we(y, u), {
|
|
1854
|
+
getPanelStyles: S,
|
|
1855
|
+
id: d,
|
|
1856
|
+
orientation: P,
|
|
1857
|
+
registerPanel: R,
|
|
1807
1858
|
togglePanelDisabled: C
|
|
1808
|
-
} =
|
|
1809
|
-
(
|
|
1810
|
-
|
|
1859
|
+
} = Le(), X = m !== null, _ = ne(
|
|
1860
|
+
(w, E, M) => {
|
|
1861
|
+
m?.(w, s, M);
|
|
1811
1862
|
}
|
|
1812
1863
|
);
|
|
1813
1864
|
K(() => {
|
|
1814
|
-
const
|
|
1815
|
-
if (
|
|
1816
|
-
const
|
|
1817
|
-
element:
|
|
1818
|
-
id:
|
|
1819
|
-
idIsStable:
|
|
1865
|
+
const w = y.current;
|
|
1866
|
+
if (w !== null) {
|
|
1867
|
+
const E = {
|
|
1868
|
+
element: w,
|
|
1869
|
+
id: h,
|
|
1870
|
+
idIsStable: f,
|
|
1820
1871
|
mutableValues: {
|
|
1821
1872
|
expandToSize: void 0,
|
|
1822
1873
|
prevSize: void 0
|
|
1823
1874
|
},
|
|
1824
|
-
onResize:
|
|
1875
|
+
onResize: X ? _ : void 0,
|
|
1825
1876
|
panelConstraints: {
|
|
1877
|
+
groupResizeBehavior: i,
|
|
1826
1878
|
collapsedSize: n,
|
|
1827
1879
|
collapsible: o,
|
|
1828
|
-
defaultSize:
|
|
1829
|
-
disabled:
|
|
1830
|
-
maxSize:
|
|
1880
|
+
defaultSize: r,
|
|
1881
|
+
disabled: g.disabled,
|
|
1882
|
+
maxSize: l,
|
|
1831
1883
|
minSize: c
|
|
1832
1884
|
}
|
|
1833
1885
|
};
|
|
1834
|
-
return
|
|
1886
|
+
return R(E);
|
|
1835
1887
|
}
|
|
1836
1888
|
}, [
|
|
1889
|
+
i,
|
|
1837
1890
|
n,
|
|
1838
1891
|
o,
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
d,
|
|
1892
|
+
r,
|
|
1893
|
+
X,
|
|
1842
1894
|
h,
|
|
1843
|
-
|
|
1895
|
+
f,
|
|
1896
|
+
l,
|
|
1844
1897
|
c,
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
]),
|
|
1849
|
-
C(
|
|
1850
|
-
}, [
|
|
1851
|
-
const
|
|
1852
|
-
(
|
|
1853
|
-
$.removeListener("mountedGroupsChange", z);
|
|
1854
|
-
}),
|
|
1898
|
+
_,
|
|
1899
|
+
R,
|
|
1900
|
+
g
|
|
1901
|
+
]), de(() => {
|
|
1902
|
+
C(h, !!a);
|
|
1903
|
+
}, [a, h, C]), Xt(h, p);
|
|
1904
|
+
const b = Ke(
|
|
1905
|
+
(w) => ye(d, w),
|
|
1855
1906
|
// useSyncExternalStore does not support a custom equality check
|
|
1856
1907
|
// stringify avoids re-rendering when the style value hasn't changed
|
|
1857
|
-
() => JSON.stringify(
|
|
1858
|
-
() => JSON.stringify(
|
|
1908
|
+
() => JSON.stringify(S(d, h)),
|
|
1909
|
+
() => JSON.stringify(S(d, h))
|
|
1859
1910
|
);
|
|
1860
|
-
return /* @__PURE__ */
|
|
1911
|
+
return /* @__PURE__ */ oe(
|
|
1861
1912
|
"div",
|
|
1862
1913
|
{
|
|
1863
|
-
...
|
|
1864
|
-
"aria-disabled":
|
|
1914
|
+
...x,
|
|
1915
|
+
"aria-disabled": a || void 0,
|
|
1865
1916
|
"data-panel": !0,
|
|
1866
|
-
"data-testid":
|
|
1867
|
-
id:
|
|
1868
|
-
ref:
|
|
1917
|
+
"data-testid": h,
|
|
1918
|
+
id: h,
|
|
1919
|
+
ref: z,
|
|
1869
1920
|
style: {
|
|
1870
|
-
...
|
|
1921
|
+
...Yt,
|
|
1871
1922
|
display: "flex",
|
|
1872
1923
|
flexBasis: 0,
|
|
1873
1924
|
flexShrink: 1,
|
|
1874
1925
|
// Prevent Panel content from interfering with panel size
|
|
1875
1926
|
overflow: "hidden",
|
|
1876
|
-
...JSON.parse(
|
|
1927
|
+
...JSON.parse(b)
|
|
1877
1928
|
},
|
|
1878
|
-
children: /* @__PURE__ */
|
|
1929
|
+
children: /* @__PURE__ */ oe(
|
|
1879
1930
|
"div",
|
|
1880
1931
|
{
|
|
1881
1932
|
className: t,
|
|
@@ -1883,12 +1934,12 @@ function At({
|
|
|
1883
1934
|
maxHeight: "100%",
|
|
1884
1935
|
maxWidth: "100%",
|
|
1885
1936
|
flexGrow: 1,
|
|
1886
|
-
...
|
|
1937
|
+
...v,
|
|
1887
1938
|
// Inform the browser that the library is handling touch events for this element
|
|
1888
1939
|
// but still allow users to scroll content within panels in the non-resizing direction
|
|
1889
1940
|
// NOTE This is not an inherited style
|
|
1890
1941
|
// See github.com/bvaughn/react-resizable-panels/issues/662
|
|
1891
|
-
touchAction:
|
|
1942
|
+
touchAction: P === "horizontal" ? "pan-y" : "pan-x"
|
|
1892
1943
|
},
|
|
1893
1944
|
children: e
|
|
1894
1945
|
}
|
|
@@ -1896,8 +1947,8 @@ function At({
|
|
|
1896
1947
|
}
|
|
1897
1948
|
);
|
|
1898
1949
|
}
|
|
1899
|
-
|
|
1900
|
-
const
|
|
1950
|
+
qt.displayName = "Panel";
|
|
1951
|
+
const Yt = {
|
|
1901
1952
|
minHeight: 0,
|
|
1902
1953
|
maxHeight: "100%",
|
|
1903
1954
|
height: "auto",
|
|
@@ -1909,39 +1960,39 @@ const Nt = {
|
|
|
1909
1960
|
padding: 0,
|
|
1910
1961
|
margin: 0
|
|
1911
1962
|
};
|
|
1912
|
-
function
|
|
1913
|
-
return
|
|
1963
|
+
function an() {
|
|
1964
|
+
return ie(null);
|
|
1914
1965
|
}
|
|
1915
|
-
function
|
|
1916
|
-
return
|
|
1966
|
+
function sn() {
|
|
1967
|
+
return T(null);
|
|
1917
1968
|
}
|
|
1918
|
-
function
|
|
1969
|
+
function Jt({
|
|
1919
1970
|
layout: e,
|
|
1920
1971
|
panelConstraints: t,
|
|
1921
1972
|
panelId: n,
|
|
1922
1973
|
panelIndex: o
|
|
1923
1974
|
}) {
|
|
1924
|
-
let
|
|
1925
|
-
const
|
|
1926
|
-
(
|
|
1975
|
+
let r, a;
|
|
1976
|
+
const u = e[n], i = t.find(
|
|
1977
|
+
(s) => s.panelId === n
|
|
1927
1978
|
);
|
|
1928
|
-
if (
|
|
1929
|
-
const
|
|
1930
|
-
|
|
1931
|
-
layout:
|
|
1932
|
-
delta:
|
|
1979
|
+
if (i) {
|
|
1980
|
+
const s = i.maxSize, l = i.collapsible ? i.collapsedSize : i.minSize, c = [o, o + 1];
|
|
1981
|
+
a = B({
|
|
1982
|
+
layout: re({
|
|
1983
|
+
delta: l - u,
|
|
1933
1984
|
initialLayout: e,
|
|
1934
1985
|
panelConstraints: t,
|
|
1935
|
-
pivotIndices:
|
|
1986
|
+
pivotIndices: c,
|
|
1936
1987
|
prevLayout: e
|
|
1937
1988
|
}),
|
|
1938
1989
|
panelConstraints: t
|
|
1939
|
-
})[n],
|
|
1940
|
-
layout:
|
|
1941
|
-
delta:
|
|
1990
|
+
})[n], r = B({
|
|
1991
|
+
layout: re({
|
|
1992
|
+
delta: s - u,
|
|
1942
1993
|
initialLayout: e,
|
|
1943
1994
|
panelConstraints: t,
|
|
1944
|
-
pivotIndices:
|
|
1995
|
+
pivotIndices: c,
|
|
1945
1996
|
prevLayout: e
|
|
1946
1997
|
}),
|
|
1947
1998
|
panelConstraints: t
|
|
@@ -1949,97 +2000,90 @@ function _t({
|
|
|
1949
2000
|
}
|
|
1950
2001
|
return {
|
|
1951
2002
|
valueControls: n,
|
|
1952
|
-
valueMax:
|
|
1953
|
-
valueMin:
|
|
1954
|
-
valueNow:
|
|
2003
|
+
valueMax: r,
|
|
2004
|
+
valueMin: a,
|
|
2005
|
+
valueNow: u
|
|
1955
2006
|
};
|
|
1956
2007
|
}
|
|
1957
|
-
function
|
|
2008
|
+
function Zt({
|
|
1958
2009
|
children: e,
|
|
1959
2010
|
className: t,
|
|
1960
2011
|
disabled: n,
|
|
1961
2012
|
elementRef: o,
|
|
1962
|
-
id:
|
|
1963
|
-
style:
|
|
1964
|
-
...
|
|
2013
|
+
id: r,
|
|
2014
|
+
style: a,
|
|
2015
|
+
...u
|
|
1965
2016
|
}) {
|
|
1966
|
-
const
|
|
2017
|
+
const i = xe(r), s = Pe({
|
|
1967
2018
|
disabled: n
|
|
1968
|
-
}), [
|
|
1969
|
-
disableCursor:
|
|
1970
|
-
id:
|
|
1971
|
-
orientation:
|
|
1972
|
-
registerSeparator:
|
|
1973
|
-
toggleSeparatorDisabled:
|
|
1974
|
-
} =
|
|
2019
|
+
}), [l, c] = ie({}), [m, p] = ie("inactive"), v = T(null), x = we(v, o), {
|
|
2020
|
+
disableCursor: f,
|
|
2021
|
+
id: h,
|
|
2022
|
+
orientation: g,
|
|
2023
|
+
registerSeparator: y,
|
|
2024
|
+
toggleSeparatorDisabled: z
|
|
2025
|
+
} = Le(), S = g === "horizontal" ? "vertical" : "horizontal";
|
|
1975
2026
|
K(() => {
|
|
1976
|
-
const
|
|
1977
|
-
if (
|
|
1978
|
-
const
|
|
1979
|
-
disabled:
|
|
1980
|
-
element:
|
|
1981
|
-
id:
|
|
1982
|
-
},
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
) ? z.state : "inactive"
|
|
2027
|
+
const P = v.current;
|
|
2028
|
+
if (P !== null) {
|
|
2029
|
+
const R = {
|
|
2030
|
+
disabled: s.disabled,
|
|
2031
|
+
element: P,
|
|
2032
|
+
id: i
|
|
2033
|
+
}, C = y(R), X = Gt(
|
|
2034
|
+
(b) => {
|
|
2035
|
+
p(
|
|
2036
|
+
b.next.state !== "inactive" && b.next.hitRegions.some(
|
|
2037
|
+
(w) => w.separator === R
|
|
2038
|
+
) ? b.next.state : "inactive"
|
|
1989
2039
|
);
|
|
1990
2040
|
}
|
|
1991
|
-
),
|
|
1992
|
-
|
|
1993
|
-
(
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
})
|
|
2007
|
-
);
|
|
2008
|
-
}
|
|
2009
|
-
}
|
|
2010
|
-
}
|
|
2011
|
-
);
|
|
2041
|
+
), _ = ye(
|
|
2042
|
+
h,
|
|
2043
|
+
(b) => {
|
|
2044
|
+
const { derivedPanelConstraints: w, layout: E, separatorToPanels: M } = b.next, k = M.get(R);
|
|
2045
|
+
if (k) {
|
|
2046
|
+
const O = k[0], H = k.indexOf(O);
|
|
2047
|
+
c(
|
|
2048
|
+
Jt({
|
|
2049
|
+
layout: E,
|
|
2050
|
+
panelConstraints: w,
|
|
2051
|
+
panelId: O.id,
|
|
2052
|
+
panelIndex: H
|
|
2053
|
+
})
|
|
2054
|
+
);
|
|
2055
|
+
}
|
|
2012
2056
|
}
|
|
2013
2057
|
);
|
|
2014
2058
|
return () => {
|
|
2015
|
-
X(),
|
|
2059
|
+
X(), _(), C();
|
|
2016
2060
|
};
|
|
2017
2061
|
}
|
|
2018
|
-
}, [
|
|
2019
|
-
|
|
2020
|
-
}, [n,
|
|
2021
|
-
let
|
|
2022
|
-
return n && !
|
|
2062
|
+
}, [h, i, y, s]), de(() => {
|
|
2063
|
+
z(i, !!n);
|
|
2064
|
+
}, [n, i, z]);
|
|
2065
|
+
let d;
|
|
2066
|
+
return n && !f && (d = "not-allowed"), /* @__PURE__ */ oe(
|
|
2023
2067
|
"div",
|
|
2024
2068
|
{
|
|
2025
|
-
...
|
|
2026
|
-
"aria-controls":
|
|
2069
|
+
...u,
|
|
2070
|
+
"aria-controls": l.valueControls,
|
|
2027
2071
|
"aria-disabled": n || void 0,
|
|
2028
|
-
"aria-orientation":
|
|
2029
|
-
"aria-valuemax":
|
|
2030
|
-
"aria-valuemin":
|
|
2031
|
-
"aria-valuenow":
|
|
2072
|
+
"aria-orientation": S,
|
|
2073
|
+
"aria-valuemax": l.valueMax,
|
|
2074
|
+
"aria-valuemin": l.valueMin,
|
|
2075
|
+
"aria-valuenow": l.valueNow,
|
|
2032
2076
|
children: e,
|
|
2033
2077
|
className: t,
|
|
2034
|
-
"data-separator": n ? "disabled" :
|
|
2035
|
-
"data-testid":
|
|
2036
|
-
id:
|
|
2037
|
-
ref:
|
|
2078
|
+
"data-separator": n ? "disabled" : m,
|
|
2079
|
+
"data-testid": i,
|
|
2080
|
+
id: i,
|
|
2081
|
+
ref: x,
|
|
2038
2082
|
role: "separator",
|
|
2039
2083
|
style: {
|
|
2040
2084
|
flexBasis: "auto",
|
|
2041
|
-
cursor:
|
|
2042
|
-
...
|
|
2085
|
+
cursor: d,
|
|
2086
|
+
...a,
|
|
2043
2087
|
flexGrow: 0,
|
|
2044
2088
|
flexShrink: 0,
|
|
2045
2089
|
// Inform the browser that the library is handling touch events for this element
|
|
@@ -2050,16 +2094,16 @@ function Ft({
|
|
|
2050
2094
|
}
|
|
2051
2095
|
);
|
|
2052
2096
|
}
|
|
2053
|
-
|
|
2097
|
+
Zt.displayName = "Separator";
|
|
2054
2098
|
export {
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2099
|
+
Ut as Group,
|
|
2100
|
+
qt as Panel,
|
|
2101
|
+
Zt as Separator,
|
|
2102
|
+
Pt as isCoarsePointer,
|
|
2103
|
+
nn as useDefaultLayout,
|
|
2104
|
+
on as useGroupCallbackRef,
|
|
2105
|
+
rn as useGroupRef,
|
|
2106
|
+
an as usePanelCallbackRef,
|
|
2107
|
+
sn as usePanelRef
|
|
2064
2108
|
};
|
|
2065
2109
|
//# sourceMappingURL=react-resizable-panels.js.map
|