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