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