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