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