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