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