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