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