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