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