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