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