@aiquants/markdown-explorer 0.27.0 → 0.29.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +34 -0
- package/README.md +12 -5
- package/dist/{EditSurface-B1yD7ywF.cjs → EditSurface-B9IpZlBX.cjs} +2 -2
- package/dist/{EditSurface-sUNqYw9o.js → EditSurface-BrdChI9n.js} +54 -54
- package/dist/{ExplorerSplit-pClUl3-e.js → ExplorerSplit-B-fr2nlU.js} +99 -99
- package/dist/{ExplorerSplit-Bn3ZnEMZ.cjs → ExplorerSplit-B99KbYXc.cjs} +1 -1
- package/dist/MultiLayout-BZ0zTAoi.cjs +1 -0
- package/dist/{MultiLayout-B-ft4_Vs.js → MultiLayout-Pf-6yPif.js} +167 -168
- package/dist/NativeScrollBar-Bj5_LmwY.cjs +1 -0
- package/dist/{NativeScrollBar-ByawerpG.js → NativeScrollBar-ybJw3OHE.js} +6 -7
- package/dist/{TreeLayout-DjIVKBG4.js → TreeLayout-C4l591Nc.js} +9 -9
- package/dist/{TreeLayout-CXHbKdxy.cjs → TreeLayout-CblPMzQi.cjs} +1 -1
- package/dist/index-CnX313Ss.cjs +15 -0
- package/dist/{index-BNAkC0g3.js → index-awodBw8r.js} +1054 -1021
- package/dist/index.cjs +1 -1
- package/dist/index.js +10 -10
- package/dist/{location-BNFdxzhn.js → location-CKuabtKl.js} +83 -82
- package/dist/location-l_HysaZR.cjs +1 -0
- package/dist/{merge-BBU1pDoT.cjs → merge-DffWW96L.cjs} +1 -1
- package/dist/{merge-DhHzRcAI.js → merge-qfptirid.js} +1 -1
- package/dist/server.cjs +1 -1
- package/dist/server.js +2 -2
- package/dist/styles/markdown-explorer.css +1 -1
- package/dist/tapScrollCircle-CDBXEKvI.cjs +1 -0
- package/dist/tapScrollCircle-DYmzWI-8.js +12 -0
- package/dist/{useSplitPersistence-xGOSwpLM.cjs → useSplitPersistence-9Nu6J1WF.cjs} +1 -1
- package/dist/{useSplitPersistence-D5EjJwCg.js → useSplitPersistence-Bf4M35Il.js} +1 -1
- package/docs/behavior/layout.md +6 -2
- package/package.json +5 -5
- package/dist/MultiLayout-0Jh08fxo.cjs +0 -1
- package/dist/NativeScrollBar-D9QrjRJa.cjs +0 -1
- package/dist/index-DRMNpWDJ.cjs +0 -15
- package/dist/location-yvU5HUY1.cjs +0 -1
- package/dist/scrollBarGeometry-C46jBtmM.cjs +0 -1
- package/dist/scrollBarGeometry-DOBdGNV-.js +0 -4
- package/dist/tapScrollCircle-C5DGI-0H.cjs +0 -1
- package/dist/tapScrollCircle-u4EXeLhx.js +0 -6
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsx as m, jsxs as L, Fragment as Qe } from "react/jsx-runtime";
|
|
2
|
-
import { u as $,
|
|
2
|
+
import { u as $, t as At, V as Pe, R as Je, W as kt, G as Oe, X as Lt, Y as Pt, o as Ot, Z as qt, _ as Ct, $ as Ft } from "./index-awodBw8r.js";
|
|
3
3
|
import * as f from "react";
|
|
4
4
|
import { use as ye, createContext as qe, useState as F, useCallback as w, useMemo as C, useRef as E, useLayoutEffect as H, useEffect as D, useSyncExternalStore as Ce, Suspense as et, useId as Re } from "react";
|
|
5
|
-
import { s as Mt, u as _t, v as tt, x as It, y as Dt, z as Ht, C as $t, F as Zt, A as Ve, B as Bt, D as zt, b as Ee, G as Vt } from "./location-
|
|
5
|
+
import { s as Mt, u as _t, v as tt, x as It, y as Dt, z as Ht, C as $t, F as Zt, A as Ve, B as Bt, D as zt, b as Ee, G as Vt } from "./location-CKuabtKl.js";
|
|
6
6
|
import { useDirectoryTreeState as jt, DirectoryTree as Kt } from "@aiquants/directory-tree";
|
|
7
|
-
import {
|
|
8
|
-
import { s as
|
|
9
|
-
import { PanelGroup as
|
|
10
|
-
import { a as Yt, u as Qt } from "./useSplitPersistence-
|
|
7
|
+
import { TAP_SCROLL_CIRCLE as Gt } from "./tapScrollCircle-DYmzWI-8.js";
|
|
8
|
+
import { s as Wt } from "./storage-CmGHg7OA.js";
|
|
9
|
+
import { PanelGroup as Xt, Panel as je, PanelResizeHandle as Ut } from "@aiquants/resize-panels";
|
|
10
|
+
import { a as Yt, u as Qt } from "./useSplitPersistence-Bf4M35Il.js";
|
|
11
11
|
import { useLocation as Jt } from "react-router";
|
|
12
12
|
function en({
|
|
13
13
|
title: e,
|
|
@@ -252,7 +252,7 @@ const un = /* @__PURE__ */ f.forwardRef(dn), Fe = qe(!0), nt = "\0loop\0", rt =
|
|
|
252
252
|
depthLimited: !1,
|
|
253
253
|
announcedStart: !1,
|
|
254
254
|
issuedAgainst: null
|
|
255
|
-
}),
|
|
255
|
+
}), An = (e, t) => {
|
|
256
256
|
const n = [];
|
|
257
257
|
let r = Le(t.entries, t.compare);
|
|
258
258
|
for (let o = 1; r.length > 0; o += 1) {
|
|
@@ -281,37 +281,37 @@ const un = /* @__PURE__ */ f.forwardRef(dn), Fe = qe(!0), nt = "\0loop\0", rt =
|
|
|
281
281
|
r = c;
|
|
282
282
|
}
|
|
283
283
|
return n;
|
|
284
|
-
}, lt = (e, t) => e.every((n) => n.type !== "directory" || t(n.path) && (n.lazy === !0 || n.children === void 0 || lt(n.children, t))),
|
|
284
|
+
}, lt = (e, t) => e.every((n) => n.type !== "directory" || t(n.path) && (n.lazy === !0 || n.children === void 0 || lt(n.children, t))), kn = (e, t) => {
|
|
285
285
|
if (e.folderLimited) return { kind: "folder-limit", opened: e.opened };
|
|
286
286
|
if (e.depthLimited) return { kind: "depth-limit", opened: e.opened };
|
|
287
287
|
let n = 0;
|
|
288
288
|
for (const r of e.loads) t.childrenOf(r)?.status === "failed" && (n += 1);
|
|
289
289
|
return { kind: "done", opened: e.opened, failed: n, complete: lt(t.entries, t.isShownExpanded) };
|
|
290
|
-
},
|
|
291
|
-
const t = E(null), n = E(e), [r, o] = F(
|
|
290
|
+
}, Ae = Object.freeze({ state: "idle" }), Ln = (e) => {
|
|
291
|
+
const t = E(null), n = E(e), [r, o] = F(Ae);
|
|
292
292
|
H(() => {
|
|
293
293
|
n.current = e;
|
|
294
294
|
});
|
|
295
295
|
const c = w(() => {
|
|
296
296
|
t.current === null && (t.current = Nn(n.current.budget), o({ state: "running", opened: 0 }));
|
|
297
297
|
}, []), l = w(() => {
|
|
298
|
-
t.current = null, o(
|
|
298
|
+
t.current = null, o(Ae);
|
|
299
299
|
}, []), a = w((s) => {
|
|
300
300
|
const d = t.current;
|
|
301
301
|
if (d === null) return;
|
|
302
|
-
const u =
|
|
302
|
+
const u = An(d, s);
|
|
303
303
|
if (u.length > 0 && (d.issuedAgainst = s.expanded, n.current.expandMultiple([...u])), !d.announcedStart && (d.loads.size > 0 || s.waiting > 0) && (d.announcedStart = !0, n.current.onStart()), u.length === 0 && !s.expansionPending && s.expanded !== d.issuedAgainst && s.waiting === 0) {
|
|
304
304
|
t.current = null;
|
|
305
|
-
const p =
|
|
306
|
-
o(p.kind === "done" ?
|
|
305
|
+
const p = kn(d, s);
|
|
306
|
+
o(p.kind === "done" ? Ae : { state: "stopped", stop: p.kind, opened: p.opened }), n.current.onFinish(p);
|
|
307
307
|
return;
|
|
308
308
|
}
|
|
309
309
|
const { opened: i } = d;
|
|
310
310
|
o((p) => p.state === "running" && p.opened === i ? p : { state: "running", opened: i });
|
|
311
311
|
}, []);
|
|
312
312
|
return C(() => ({ status: r, start: c, end: l, advance: a }), [r, c, l, a]);
|
|
313
|
-
}, Ge = ["pointerdown", "wheel", "touchstart", "keydown", "focusin"], Pn = 8,
|
|
314
|
-
const s = E(null), d = E(!0), u = E(
|
|
313
|
+
}, Ge = ["pointerdown", "wheel", "touchstart", "keydown", "focusin"], Pn = 8, We = { least: Number.POSITIVE_INFINITY, stalled: 0 }, On = ({ tree: e, container: t, path: n, chain: r, rows: o, cancel: c, displayed: l, placement: a }) => {
|
|
314
|
+
const s = E(null), d = E(!0), u = E(We), i = E(null), p = E(null), h = E(r), g = E(a);
|
|
315
315
|
H(() => {
|
|
316
316
|
h.current = r, g.current = a;
|
|
317
317
|
}, [r, a]);
|
|
@@ -320,21 +320,21 @@ const un = /* @__PURE__ */ f.forwardRef(dn), Fe = qe(!0), nt = "\0loop\0", rt =
|
|
|
320
320
|
R !== null && (i.current = null, R.phase === "asking" ? R.controller.abort() : h.current?.open(null));
|
|
321
321
|
}, []), P = w(() => {
|
|
322
322
|
s.current = null, v();
|
|
323
|
-
}, [v]),
|
|
323
|
+
}, [v]), k = w(() => {
|
|
324
324
|
const R = t.current;
|
|
325
325
|
s.current === null || p.current !== null || R === null || R.getClientRects().length === 0 || (p.current = requestAnimationFrame(() => {
|
|
326
326
|
p.current = null;
|
|
327
|
-
const
|
|
328
|
-
if (
|
|
329
|
-
const S = g.current(
|
|
327
|
+
const A = s.current;
|
|
328
|
+
if (A === null) return;
|
|
329
|
+
const S = g.current(A);
|
|
330
330
|
if (S === 0) {
|
|
331
331
|
d.current = !0, i.current?.phase === "opening" && v();
|
|
332
332
|
return;
|
|
333
333
|
}
|
|
334
|
-
if (e.current?.scrollToPath(
|
|
334
|
+
if (e.current?.scrollToPath(A, { align: "nearest" }) === !0) {
|
|
335
335
|
i.current?.phase === "opening" && v();
|
|
336
336
|
const { least: _, stalled: B } = u.current;
|
|
337
|
-
u.current = S < _ ? { least: S, stalled: 0 } : { least: _, stalled: B + 1 }, u.current.stalled < Pn &&
|
|
337
|
+
u.current = S < _ ? { least: S, stalled: 0 } : { least: _, stalled: B + 1 }, u.current.stalled < Pn && k();
|
|
338
338
|
return;
|
|
339
339
|
}
|
|
340
340
|
const b = i.current;
|
|
@@ -342,19 +342,19 @@ const un = /* @__PURE__ */ f.forwardRef(dn), Fe = qe(!0), nt = "\0loop\0", rt =
|
|
|
342
342
|
s.current = null;
|
|
343
343
|
return;
|
|
344
344
|
}
|
|
345
|
-
b.phase === "opening" && h.current?.progress(b.folders,
|
|
345
|
+
b.phase === "opening" && h.current?.progress(b.folders, A) !== "loading" && P();
|
|
346
346
|
}));
|
|
347
347
|
}, [e, t, v, P]), q = w(() => {
|
|
348
|
-
d.current = !1, u.current =
|
|
349
|
-
}, [
|
|
348
|
+
d.current = !1, u.current = We, k();
|
|
349
|
+
}, [k]);
|
|
350
350
|
D(() => {
|
|
351
351
|
const R = t.current;
|
|
352
352
|
if (R === null) return;
|
|
353
|
-
const
|
|
354
|
-
|
|
353
|
+
const A = typeof ResizeObserver > "u" ? null : new ResizeObserver(q);
|
|
354
|
+
A?.observe(R);
|
|
355
355
|
for (const S of Ge) R.addEventListener(S, P, { passive: !0 });
|
|
356
356
|
return () => {
|
|
357
|
-
|
|
357
|
+
A?.disconnect();
|
|
358
358
|
for (const S of Ge) R.removeEventListener(S, P);
|
|
359
359
|
p.current !== null && cancelAnimationFrame(p.current), p.current = null, v();
|
|
360
360
|
};
|
|
@@ -364,10 +364,10 @@ const un = /* @__PURE__ */ f.forwardRef(dn), Fe = qe(!0), nt = "\0loop\0", rt =
|
|
|
364
364
|
const R = t.current;
|
|
365
365
|
if (P(), n === null || R === null || R.contains(R.ownerDocument.activeElement)) return;
|
|
366
366
|
s.current = n;
|
|
367
|
-
const
|
|
368
|
-
if (y &&
|
|
367
|
+
const A = h.current;
|
|
368
|
+
if (y && A !== null) {
|
|
369
369
|
const S = new AbortController(), b = { phase: "asking", controller: S };
|
|
370
|
-
i.current = b,
|
|
370
|
+
i.current = b, A.ancestors(n, S.signal).then((_) => {
|
|
371
371
|
i.current === b && (_ === null ? i.current = null : (i.current = { phase: "opening", folders: _ }, h.current?.open(_)), q());
|
|
372
372
|
});
|
|
373
373
|
}
|
|
@@ -426,10 +426,10 @@ const un = /* @__PURE__ */ f.forwardRef(dn), Fe = qe(!0), nt = "\0loop\0", rt =
|
|
|
426
426
|
tapScrollCircleOptions: Gt
|
|
427
427
|
},
|
|
428
428
|
behaviorOptions: { enablePointerDrag: !0 }
|
|
429
|
-
}, Bn = { hoverClassName: "", directorySelectedClassName: "", itemSelectedClassName: "" }, zn = { color: "inherit", fontSize: "inherit" }, Vn = { fontSize: "inherit" }, jn = /* @__PURE__ */ new Set(), Kn = /* @__PURE__ */ new Map(), Gn = { color: "var(--aqmx-tree-line)" },
|
|
429
|
+
}, Bn = { hoverClassName: "", directorySelectedClassName: "", itemSelectedClassName: "" }, zn = { color: "inherit", fontSize: "inherit" }, Vn = { fontSize: "inherit" }, jn = /* @__PURE__ */ new Set(), Kn = /* @__PURE__ */ new Map(), Gn = { color: "var(--aqmx-tree-line)" }, Wn = (e) => {
|
|
430
430
|
const t = e instanceof Element ? e.closest(`[${ce}]`) : null;
|
|
431
431
|
return t === null || t.getAttribute("data-entry-type") !== "file" ? null : t.getAttribute(ce);
|
|
432
|
-
}, ct = (e, t, n, r) => n === "folder-limit" ? e.expandAllFolderLimit(r, t.maxFolders, e.expandAll) : e.expandAllDepthLimit(r, t.maxDepth),
|
|
432
|
+
}, ct = (e, t, n, r) => n === "folder-limit" ? e.expandAllFolderLimit(r, t.maxFolders, e.expandAll) : e.expandAllDepthLimit(r, t.maxDepth), Xn = (e, t, n) => n.kind === "done" ? e.expandAllDone(n.opened, n.failed, n.complete) : ct(e, t, n.kind, n.opened), it = () => {
|
|
433
433
|
const { labels: e } = $();
|
|
434
434
|
return /* @__PURE__ */ L("div", { className: "aqmx-explorer-loading", "aria-busy": "true", "data-testid": "markdown-explorer-tree-loading", children: [
|
|
435
435
|
/* @__PURE__ */ m("p", { className: "aqmx-explorer-loading-text", children: e.treeLoading }),
|
|
@@ -441,7 +441,7 @@ const un = /* @__PURE__ */ f.forwardRef(dn), Fe = qe(!0), nt = "\0loop\0", rt =
|
|
|
441
441
|
/* @__PURE__ */ m("span", {})
|
|
442
442
|
] })
|
|
443
443
|
] });
|
|
444
|
-
},
|
|
444
|
+
}, Un = () => {
|
|
445
445
|
const { labels: e } = $();
|
|
446
446
|
return /* @__PURE__ */ L("div", { className: "aqmx-empty", "data-testid": "markdown-explorer-tree-empty", children: [
|
|
447
447
|
/* @__PURE__ */ m(un, { className: "aqmx-explorer-empty-icon", "aria-hidden": "true" }),
|
|
@@ -494,9 +494,9 @@ const un = /* @__PURE__ */ f.forwardRef(dn), Fe = qe(!0), nt = "\0loop\0", rt =
|
|
|
494
494
|
expandAll: v,
|
|
495
495
|
revealCancel: P
|
|
496
496
|
}) => {
|
|
497
|
-
const { trees:
|
|
497
|
+
const { trees: k, documents: q, labels: y, locale: Z, theme: N, data: R, config: A, sources: S, reveals: b } = $(), _ = ye(Fe), [B] = F(wn), ie = E(null), { rowHeight: re, lineColor: K } = Dn(ie, N), { isExpanded: G, toggle: ae, expandMultiple: z, collapseMultiple: Q, expanded: J, isPending: ee } = i, { alwaysExpanded: M, sortMode: le, folderPlacement: de, readmePlacement: he } = o, { direct: oe, markDirect: W, unmarkDirect: te, pruneDirect: we } = h, { running: ue, advance: me } = v, xe = E(null), se = E(null), X = C(() => _t({ sortMode: le, folderPlacement: de, readmePlacement: he }), [le, de, he]), O = C(() => gn(X), [X]), I = w((x) => k.children(r, x), [k, r]), V = C(() => bn(e), [e]), ne = w((x) => !pe(x) && (G(x) || M && !V.has(x)), [G, M, V]), U = E({ shownExpanded: ne, isExpanded: G, unloadedFolders: V, entries: e, childrenOf: I });
|
|
498
498
|
H(() => {
|
|
499
|
-
|
|
499
|
+
U.current = { shownExpanded: ne, isExpanded: G, unloadedFolders: V, entries: e, childrenOf: I };
|
|
500
500
|
}, [ne, G, V, e, I]);
|
|
501
501
|
const Ie = w((x) => {
|
|
502
502
|
xe.current?.scrollToPath(x, { align: "nearest" }), requestAnimationFrame(() => {
|
|
@@ -509,9 +509,9 @@ const un = /* @__PURE__ */ f.forwardRef(dn), Fe = qe(!0), nt = "\0loop\0", rt =
|
|
|
509
509
|
Ie(pn(x));
|
|
510
510
|
return;
|
|
511
511
|
}
|
|
512
|
-
|
|
512
|
+
U.current.isExpanded(x) ? te([x]) : U.current.unloadedFolders.has(x) && W(x), ae(x);
|
|
513
513
|
},
|
|
514
|
-
[Ie,
|
|
514
|
+
[Ie, W, te, ae]
|
|
515
515
|
), Se = w(
|
|
516
516
|
(x) => {
|
|
517
517
|
const T = x.filter((j) => !pe(j));
|
|
@@ -521,7 +521,7 @@ const un = /* @__PURE__ */ f.forwardRef(dn), Fe = qe(!0), nt = "\0loop\0", rt =
|
|
|
521
521
|
), xt = w(
|
|
522
522
|
(x) => {
|
|
523
523
|
const T = x.filter((j) => !pe(j));
|
|
524
|
-
T.length !== 0 && (T.length < x.length && T.every((j) =>
|
|
524
|
+
T.length !== 0 && (T.length < x.length && T.every((j) => U.current.shownExpanded(j)) ? Se(T) : z(T));
|
|
525
525
|
},
|
|
526
526
|
[z, Se]
|
|
527
527
|
), De = w(
|
|
@@ -530,14 +530,14 @@ const un = /* @__PURE__ */ f.forwardRef(dn), Fe = qe(!0), nt = "\0loop\0", rt =
|
|
|
530
530
|
{
|
|
531
531
|
name: x.name,
|
|
532
532
|
onRetry: () => {
|
|
533
|
-
|
|
533
|
+
W(x.path), k.retryChildren(r, x.path), U.current.shownExpanded(x.path) || z([x.path]);
|
|
534
534
|
}
|
|
535
535
|
}
|
|
536
536
|
),
|
|
537
|
-
[
|
|
538
|
-
), He = n === "multi" ? l : jn, { loopFolderName: $e } = y, wt = C(() => B(e, { openPaths: He, childrenOf: I, renderFailedFolder: De, loopFolderName: $e }), [B, e, He, I, De, $e, t]), gt =
|
|
539
|
-
for (const x of Ze.current)
|
|
540
|
-
}, [
|
|
537
|
+
[k, r, W, z]
|
|
538
|
+
), He = n === "multi" ? l : jn, { loopFolderName: $e } = y, wt = C(() => B(e, { openPaths: He, childrenOf: I, renderFailedFolder: De, loopFolderName: $e }), [B, e, He, I, De, $e, t]), gt = kt(q, Wn), Ze = E([]), ge = w(() => {
|
|
539
|
+
for (const x of Ze.current) U.current.unloadedFolders.has(x) && W(x);
|
|
540
|
+
}, [W]), { maxDepth: Te } = A.revealDocument, Be = E(u);
|
|
541
541
|
H(() => {
|
|
542
542
|
Be.current = u;
|
|
543
543
|
}, [u]);
|
|
@@ -556,19 +556,19 @@ const un = /* @__PURE__ */ f.forwardRef(dn), Fe = qe(!0), nt = "\0loop\0", rt =
|
|
|
556
556
|
open: (x) => {
|
|
557
557
|
Ze.current = x ?? [], x !== null && (ge(), z([...x]));
|
|
558
558
|
},
|
|
559
|
-
progress: (x, T) => En(
|
|
559
|
+
progress: (x, T) => En(U.current.entries, x, T, { isShownExpanded: U.current.shownExpanded, childrenOf: U.current.childrenOf })
|
|
560
560
|
}),
|
|
561
561
|
[R, r, S, b, Te, ge, z]
|
|
562
562
|
);
|
|
563
563
|
D(() => ge(), [ge, V]);
|
|
564
564
|
const bt = C(() => [e, t, J], [e, t, J]), Et = w((x) => se.current === null ? Number.POSITIVE_INFINITY : $n(se.current, x), []);
|
|
565
565
|
On({ tree: xe, container: se, path: c.path, chain: c.openFolders ? vt : null, rows: bt, cancel: P, displayed: _, placement: Et });
|
|
566
|
-
const ze = w((x) => oe.has(x), [oe]), ve = C(() => vn(e, { isShownExpanded: ne, childrenOf: I, compare:
|
|
566
|
+
const ze = w((x) => oe.has(x), [oe]), ve = C(() => vn(e, { isShownExpanded: ne, childrenOf: I, compare: X, isDirect: ze }), [e, ne, I, X, ze, t]), be = _ && g;
|
|
567
567
|
H(() => {
|
|
568
568
|
p(e);
|
|
569
|
-
}, [e, p]), H(() => () => p(null), [p]), D(() =>
|
|
570
|
-
be && ue && me({ entries: e, isShownExpanded: ne, childrenOf: I, compare:
|
|
571
|
-
}, [be, ue, me, e, ne, I,
|
|
569
|
+
}, [e, p]), H(() => () => p(null), [p]), D(() => k.claimChildren(r, be ? ve.folders : Kn), [k, r, be, ve]), D(() => we(V), [we, V]), D(() => {
|
|
570
|
+
be && ue && me({ entries: e, isShownExpanded: ne, childrenOf: I, compare: X, expanded: J, waiting: ve.waiting, expansionPending: ee });
|
|
571
|
+
}, [be, ue, me, e, ne, I, X, J, ve, ee]);
|
|
572
572
|
const yt = w(
|
|
573
573
|
(x) => {
|
|
574
574
|
const T = x.entry.absolutePath;
|
|
@@ -660,23 +660,23 @@ const un = /* @__PURE__ */ f.forwardRef(dn), Fe = qe(!0), nt = "\0loop\0", rt =
|
|
|
660
660
|
return /* @__PURE__ */ m("p", { className: "aqmx-explorer-expand-all-stop", "data-testid": "markdown-explorer-expand-all-stop", "data-aqmx-stop": e, children: ct(r, n, e, t) });
|
|
661
661
|
}, tr = ({ entries: e, ...t }) => {
|
|
662
662
|
const { trees: n } = $(), r = Ce(n.subscribe, n.version, n.version), { sourceId: o } = t, [c] = F(mn), l = C(() => c(e, (a) => n.children(o, a)), [c, e, n, o, r]);
|
|
663
|
-
return l.length === 0 ? /* @__PURE__ */ m(
|
|
663
|
+
return l.length === 0 ? /* @__PURE__ */ m(Un, {}) : /* @__PURE__ */ m(Qn, { entries: l, version: r, ...t });
|
|
664
664
|
}, nr = ({ result: e, onRetry: t, ...n }) => {
|
|
665
665
|
const { renderTreeFailure: r } = $(), o = ye(e);
|
|
666
666
|
if (o.status === "deferred") return /* @__PURE__ */ m(it, {});
|
|
667
667
|
if (o.status === "ok") return /* @__PURE__ */ m(tr, { entries: o.entries, ...n });
|
|
668
668
|
const c = r?.(o.failure);
|
|
669
|
-
return /* @__PURE__ */ m("div", { className: "aqmx-explorer-tree-message", "data-testid": "markdown-explorer-tree-failure", "data-aqmx-failure": o.failure.reason, children: c !== void 0 ? c : /* @__PURE__ */ m(
|
|
669
|
+
return /* @__PURE__ */ m("div", { className: "aqmx-explorer-tree-message", "data-testid": "markdown-explorer-tree-failure", "data-aqmx-failure": o.failure.reason, children: c !== void 0 ? c : /* @__PURE__ */ m(At, { failure: o.failure, alert: !0, onRetry: t, testId: null }) });
|
|
670
670
|
}, rr = ({ onControls: e, ...t }) => {
|
|
671
|
-
const { trees: n, storageNamespace: r, labels: o, announcer: c, config: l } = $(), { sourceId: a } = t, s = jt({ storageKey:
|
|
671
|
+
const { trees: n, storageNamespace: r, labels: o, announcer: c, config: l } = $(), { sourceId: a } = t, s = jt({ storageKey: Wt(r).treeExpansion(a) });
|
|
672
672
|
Ce(n.subscribe, n.version, n.version);
|
|
673
673
|
const d = n.read(a), u = w(() => n.retry(a), [n, a]);
|
|
674
674
|
H(() => n.open(a), [n, a]);
|
|
675
|
-
const i = Tn(), { expanded: p, expandMultiple: h, collapseAll: g } = s, [v, P] = F(null),
|
|
675
|
+
const i = Tn(), { expanded: p, expandMultiple: h, collapseAll: g } = s, [v, P] = F(null), k = v !== p, q = E(p);
|
|
676
676
|
H(() => {
|
|
677
677
|
q.current = p;
|
|
678
678
|
}, [p]);
|
|
679
|
-
const y = l.expandAll, Z = w(() => c.announce(o.expandAllStarted), [c, o]), N = w((M) => c.announce(
|
|
679
|
+
const y = l.expandAll, Z = w(() => c.announce(o.expandAllStarted), [c, o]), N = w((M) => c.announce(Xn(o, y, M)), [c, o, y]), R = Ln({ budget: y, expandMultiple: h, onStart: Z, onFinish: N }), { status: A, start: S, end: b, advance: _ } = R, B = A.state === "running", ie = C(() => ({ running: B, advance: _ }), [B, _]), re = E(null), [K, G] = F(!1), ae = w((M) => {
|
|
680
680
|
re.current = M, G(M !== null);
|
|
681
681
|
}, []);
|
|
682
682
|
D(
|
|
@@ -694,10 +694,10 @@ const un = /* @__PURE__ */ f.forwardRef(dn), Fe = qe(!0), nt = "\0loop\0", rt =
|
|
|
694
694
|
}, [e, ee, S, K, B]), D(() => () => e(null), [e]), D(() => {
|
|
695
695
|
K || b();
|
|
696
696
|
}, [K, b]), /* @__PURE__ */ L(Qe, { children: [
|
|
697
|
-
|
|
697
|
+
A.state === "stopped" ? /* @__PURE__ */ m(er, { stop: A.stop, opened: A.opened, budget: y }) : null,
|
|
698
698
|
/* @__PURE__ */ L("div", { className: "aqmx-explorer-tree-area", children: [
|
|
699
|
-
/* @__PURE__ */ m(et, { fallback: /* @__PURE__ */ m(it, {}), children: /* @__PURE__ */ m(nr, { result: d, onRetry: u, expansion: s, onShown: ae, marks: i, claimsHeld:
|
|
700
|
-
/* @__PURE__ */ m(Jn, { pending: n.pendingChildren(a), status:
|
|
699
|
+
/* @__PURE__ */ m(et, { fallback: /* @__PURE__ */ m(it, {}), children: /* @__PURE__ */ m(nr, { result: d, onRetry: u, expansion: s, onShown: ae, marks: i, claimsHeld: k, expandAll: ie, revealCancel: Q, ...t }) }),
|
|
700
|
+
/* @__PURE__ */ m(Jn, { pending: n.pendingChildren(a), status: A })
|
|
701
701
|
] })
|
|
702
702
|
] });
|
|
703
703
|
};
|
|
@@ -722,10 +722,10 @@ function ar({
|
|
|
722
722
|
clipRule: "evenodd"
|
|
723
723
|
}));
|
|
724
724
|
}
|
|
725
|
-
const dt = /* @__PURE__ */ f.forwardRef(ar),
|
|
725
|
+
const dt = /* @__PURE__ */ f.forwardRef(ar), Xe = "markdown-explorer-selection-remove", lr = ({ selection: e, onRemove: t, onClear: n, onOpenSelection: r, onLeave: o }) => {
|
|
726
726
|
const { labels: c } = $(), l = Re(), a = E(null), s = [...e], d = (i, p) => {
|
|
727
727
|
if (p.ownerDocument.activeElement === p) {
|
|
728
|
-
const h = a.current === null ? [] : [...a.current.querySelectorAll(`[data-testid="${
|
|
728
|
+
const h = a.current === null ? [] : [...a.current.querySelectorAll(`[data-testid="${Xe}"]`)], g = h.indexOf(p), v = [h[g + 1], h[g - 1]].find((P) => P !== void 0);
|
|
729
729
|
v === void 0 ? o() : v.focus();
|
|
730
730
|
}
|
|
731
731
|
t(i);
|
|
@@ -747,7 +747,7 @@ const dt = /* @__PURE__ */ f.forwardRef(ar), We = "markdown-explorer-selection-r
|
|
|
747
747
|
className: "aqmx-icon-button aqmx-explorer-tray-remove",
|
|
748
748
|
"aria-label": c.removeFromSelection(p),
|
|
749
749
|
title: c.removeFromSelection(p),
|
|
750
|
-
"data-testid":
|
|
750
|
+
"data-testid": Xe,
|
|
751
751
|
"data-aqmx-path": i,
|
|
752
752
|
onClick: (h) => d(i, h.currentTarget),
|
|
753
753
|
children: /* @__PURE__ */ m(dt, { "aria-hidden": "true" })
|
|
@@ -756,7 +756,7 @@ const dt = /* @__PURE__ */ f.forwardRef(ar), We = "markdown-explorer-selection-r
|
|
|
756
756
|
] }, i)) }),
|
|
757
757
|
r === void 0 ? null : /* @__PURE__ */ m("button", { type: "button", className: "aqmx-explorer-tray-open", "data-testid": "markdown-explorer-selection-open", onClick: () => r(s.map(([i]) => i)), children: c.openSelectionInMulti(s.length) })
|
|
758
758
|
] });
|
|
759
|
-
},
|
|
759
|
+
}, ke = /* @__PURE__ */ new Map(), or = (e, t) => {
|
|
760
760
|
if (t.selected === e.has(t.path)) return e;
|
|
761
761
|
const n = new Map(e);
|
|
762
762
|
return t.selected ? n.set(t.path, t.name) : n.delete(t.path), n;
|
|
@@ -969,7 +969,7 @@ function Tr({
|
|
|
969
969
|
}));
|
|
970
970
|
}
|
|
971
971
|
const Nr = /* @__PURE__ */ f.forwardRef(Tr);
|
|
972
|
-
function
|
|
972
|
+
function Ar({
|
|
973
973
|
title: e,
|
|
974
974
|
titleId: t,
|
|
975
975
|
...n
|
|
@@ -988,7 +988,7 @@ function kr({
|
|
|
988
988
|
d: "M19.5 21a3 3 0 0 0 3-3v-4.5a3 3 0 0 0-3-3h-15a3 3 0 0 0-3 3V18a3 3 0 0 0 3 3h15ZM1.5 10.146V6a3 3 0 0 1 3-3h5.379a2.25 2.25 0 0 1 1.59.659l2.122 2.121c.14.141.331.22.53.22H19.5a3 3 0 0 1 3 3v1.146A4.483 4.483 0 0 0 19.5 9h-15a4.483 4.483 0 0 0-3 1.146Z"
|
|
989
989
|
}));
|
|
990
990
|
}
|
|
991
|
-
const
|
|
991
|
+
const kr = /* @__PURE__ */ f.forwardRef(Ar);
|
|
992
992
|
function Lr({
|
|
993
993
|
title: e,
|
|
994
994
|
titleId: t,
|
|
@@ -1052,7 +1052,7 @@ function Cr({
|
|
|
1052
1052
|
}
|
|
1053
1053
|
const Fr = /* @__PURE__ */ f.forwardRef(Cr), Mr = Object.freeze({
|
|
1054
1054
|
sortMode: mr,
|
|
1055
|
-
folderPlacement:
|
|
1055
|
+
folderPlacement: kr,
|
|
1056
1056
|
readmePlacement: pr,
|
|
1057
1057
|
selectionMode: xr,
|
|
1058
1058
|
doubleClickAction: Sr,
|
|
@@ -1109,8 +1109,8 @@ const Fr = /* @__PURE__ */ f.forwardRef(Cr), Mr = Object.freeze({
|
|
|
1109
1109
|
return /* @__PURE__ */ L(
|
|
1110
1110
|
"button",
|
|
1111
1111
|
{
|
|
1112
|
-
ref: (
|
|
1113
|
-
a.current[i] =
|
|
1112
|
+
ref: (k) => {
|
|
1113
|
+
a.current[i] = k;
|
|
1114
1114
|
},
|
|
1115
1115
|
type: "button",
|
|
1116
1116
|
tabIndex: -1,
|
|
@@ -1120,7 +1120,7 @@ const Fr = /* @__PURE__ */ f.forwardRef(Cr), Mr = Object.freeze({
|
|
|
1120
1120
|
"data-testid": "markdown-explorer-tree-settings-item",
|
|
1121
1121
|
"data-aqmx-setting": u.key,
|
|
1122
1122
|
onClick: () => r(u),
|
|
1123
|
-
onKeyDown: (
|
|
1123
|
+
onKeyDown: (k) => d(k, i),
|
|
1124
1124
|
children: [
|
|
1125
1125
|
/* @__PURE__ */ m(p, { className: "aqmx-explorer-menu-icon", "aria-hidden": "true" }),
|
|
1126
1126
|
/* @__PURE__ */ m("span", { className: "aqmx-explorer-menu-name", children: h }),
|
|
@@ -1183,20 +1183,20 @@ const Fr = /* @__PURE__ */ f.forwardRef(Cr), Mr = Object.freeze({
|
|
|
1183
1183
|
}, Dr = () => {
|
|
1184
1184
|
const { treeSettings: e } = $();
|
|
1185
1185
|
return { settings: Ce(e.subscribe, e.getSnapshot, e.getServerSnapshot), advance: e.advance };
|
|
1186
|
-
},
|
|
1187
|
-
const { mode: t, sourceId: n, currentPath: r, openPaths: o, onOpenDocument: c, onSourceChange: l, onRevealSource: a, viewSwitch: s } = e, { labels: d, sources: u, trees: i, documents: p, announcer: h, reveals: g } = $(), { settings: v, advance: P } = Dr(),
|
|
1186
|
+
}, Ue = /* @__PURE__ */ new Set(), Hr = '[role="tree"] [role="treeitem"][tabindex="0"]', $r = "[data-directory-tree-tab-stop]", ca = (e) => {
|
|
1187
|
+
const { mode: t, sourceId: n, currentPath: r, openPaths: o, onOpenDocument: c, onSourceChange: l, onRevealSource: a, viewSwitch: s } = e, { labels: d, sources: u, trees: i, documents: p, announcer: h, reveals: g } = $(), { settings: v, advance: P } = Dr(), k = C(() => It(t === "tree"), [t]), q = t === "tree" && v.selectionMode === "multiple";
|
|
1188
1188
|
cr(q);
|
|
1189
|
-
const y = e.mode === "tree" ? e.tray.onGatheredChange : null, Z = e.mode === "tree" ? e.onOpenSelection : void 0, N = e.mode === "tree" ? e.onOpenFolder : null, R = e.mode === "tree" && e.currentFolder,
|
|
1189
|
+
const y = e.mode === "tree" ? e.tray.onGatheredChange : null, Z = e.mode === "tree" ? e.onOpenSelection : void 0, N = e.mode === "tree" ? e.onOpenFolder : null, R = e.mode === "tree" && e.currentFolder, A = C(() => N === null ? null : { current: r, open: N }, [N, r]), S = e.mode === "tree" && q ? e.tray.gathered : ke, b = w(
|
|
1190
1190
|
(O) => {
|
|
1191
1191
|
const I = P(O);
|
|
1192
|
-
return I.selectionMode !== "multiple" && y?.(
|
|
1192
|
+
return I.selectionMode !== "multiple" && y?.(ke), I;
|
|
1193
1193
|
},
|
|
1194
1194
|
[P, y]
|
|
1195
|
-
), _ = Ir({ settings: v, descriptors:
|
|
1195
|
+
), _ = Ir({ settings: v, descriptors: k, onAdvance: b }), B = w((O) => y?.((I) => or(I, O)), [y]), ie = w((O) => y?.((I) => sr(I, O)), [y]), re = w(() => y?.(ke), [y]), K = E(null), G = w(() => {
|
|
1196
1196
|
const O = K.current;
|
|
1197
1197
|
if (O === null) return;
|
|
1198
1198
|
[Hr, $r, '[data-testid="markdown-explorer-tree-settings"]'].map((V) => O.querySelector(V)).find((V) => V !== null)?.focus();
|
|
1199
|
-
}, []), ae = C(() => new Set(S.keys()), [S]), z = C(() => r === null ?
|
|
1199
|
+
}, []), ae = C(() => new Set(S.keys()), [S]), z = C(() => r === null ? Ue : /* @__PURE__ */ new Set([r]), [r]), Q = C(() => {
|
|
1200
1200
|
if (t === "multi") return { mode: "multiple", items: o, shownPath: null, onChange: null };
|
|
1201
1201
|
switch (v.selectionMode) {
|
|
1202
1202
|
case "single":
|
|
@@ -1204,30 +1204,30 @@ const Fr = /* @__PURE__ */ f.forwardRef(Cr), Mr = Object.freeze({
|
|
|
1204
1204
|
case "multiple":
|
|
1205
1205
|
return { mode: "multiple", items: ae, shownPath: r, onChange: B };
|
|
1206
1206
|
case "none":
|
|
1207
|
-
return { mode: "none", items:
|
|
1207
|
+
return { mode: "none", items: Ue, shownPath: null, onChange: null };
|
|
1208
1208
|
}
|
|
1209
1209
|
}, [t, o, v.selectionMode, z, r, ae, B]), J = C(() => v.revealDocument ? { path: r, openFolders: !R } : { path: Q.shownPath, openFolders: !1 }, [v.revealDocument, r, R, Q.shownPath]), ee = w(
|
|
1210
1210
|
(O) => {
|
|
1211
1211
|
r !== null && g.settle(r), l(O);
|
|
1212
1212
|
},
|
|
1213
1213
|
[r, g, l]
|
|
1214
|
-
), [M, le] = F(null), [de, he] = F(!1), [oe,
|
|
1214
|
+
), [M, le] = F(null), [de, he] = F(!1), [oe, W] = F(null), te = E(!1), we = w(async () => {
|
|
1215
1215
|
if (!te.current) {
|
|
1216
|
-
te.current = !0, he(!0),
|
|
1216
|
+
te.current = !0, he(!0), W(null);
|
|
1217
1217
|
try {
|
|
1218
1218
|
const O = await i.refresh(n);
|
|
1219
1219
|
if (O.status === "superseded") return;
|
|
1220
|
-
p.invalidate(), O.status === "failed" ?
|
|
1220
|
+
p.invalidate(), O.status === "failed" ? W({ sourceId: n, failure: O.failure }) : h.announce(d.treeRefreshed);
|
|
1221
1221
|
} finally {
|
|
1222
1222
|
te.current = !1, he(!1);
|
|
1223
1223
|
}
|
|
1224
1224
|
}
|
|
1225
|
-
}, [i, p, n, h, d]), ue = M === null ? null : M.expandAll, me = M?.expanding === !0, xe = u.find((O) => O.id === n), se = s.target === "multi" ? sn : ln,
|
|
1225
|
+
}, [i, p, n, h, d]), ue = M === null ? null : M.expandAll, me = M?.expanding === !0, xe = u.find((O) => O.id === n), se = s.target === "multi" ? sn : ln, X = s.target === "multi" ? d.switchToMulti : d.switchToTree;
|
|
1226
1226
|
return /* @__PURE__ */ L("nav", { ref: K, "aria-label": d.explorerRegion, className: "aqmx-explorer", "data-testid": "markdown-explorer-explorer", "data-aqmx-mode": t, children: [
|
|
1227
1227
|
/* @__PURE__ */ L("div", { className: "aqmx-explorer-header", children: [
|
|
1228
1228
|
u.length > 1 ? /* @__PURE__ */ m("select", { className: "aqmx-explorer-source", "aria-label": d.sourceLabel, title: xe?.label, value: n, onChange: (O) => ee(O.currentTarget.value), "data-testid": "markdown-explorer-source-select", children: u.map((O) => /* @__PURE__ */ m("option", { value: O.id, children: O.label }, O.id)) }) : null,
|
|
1229
1229
|
/* @__PURE__ */ L("div", { className: "aqmx-explorer-actions", children: [
|
|
1230
|
-
/* @__PURE__ */ m(Pt, { to: s.href, navigation: "switch-view", className: "aqmx-icon-button", "aria-label":
|
|
1230
|
+
/* @__PURE__ */ m(Pt, { to: s.href, navigation: "switch-view", className: "aqmx-icon-button", "aria-label": X, title: X, "data-testid": "markdown-explorer-view-switch", "data-aqmx-target": s.target, children: /* @__PURE__ */ m(se, { "aria-hidden": "true" }) }),
|
|
1231
1231
|
/* @__PURE__ */ L(
|
|
1232
1232
|
"button",
|
|
1233
1233
|
{
|
|
@@ -1269,7 +1269,7 @@ const Fr = /* @__PURE__ */ f.forwardRef(Cr), Mr = Object.freeze({
|
|
|
1269
1269
|
/* @__PURE__ */ L("div", { className: "aqmx-explorer-body", "data-aqmx-explorer-body": "", children: [
|
|
1270
1270
|
oe !== null && oe.sourceId === n ? /* @__PURE__ */ m("p", { role: "alert", className: "aqmx-explorer-refresh-failure", "data-testid": "markdown-explorer-refresh-failure", "data-aqmx-failure": oe.failure.reason, children: d.treeRefreshFailed(Ot(d, oe.failure.reason)) }) : null,
|
|
1271
1271
|
/* @__PURE__ */ m(et, { fallback: null, children: /* @__PURE__ */ m(cn, {}) }),
|
|
1272
|
-
/* @__PURE__ */ m(rr, { mode: t, sourceId: n, settings: v, reveal: J, openPaths: o, selection: Q, onOpenDocument: c, folders:
|
|
1272
|
+
/* @__PURE__ */ m(rr, { mode: t, sourceId: n, settings: v, reveal: J, openPaths: o, selection: Q, onOpenDocument: c, folders: A, onRevealSource: a, onControls: le }, n),
|
|
1273
1273
|
q && S.size > 0 ? /* @__PURE__ */ m(lr, { selection: S, onRemove: ie, onClear: re, onOpenSelection: Z, onLeave: G }) : null,
|
|
1274
1274
|
_.menu
|
|
1275
1275
|
] })
|
|
@@ -1301,16 +1301,16 @@ const Br = /* @__PURE__ */ f.forwardRef(Zr), zr = ({ explorer: e, toggleRef: t,
|
|
|
1301
1301
|
u.navigated !== l && (i({ navigated: l, source: a.source }), u.source === a.source && !p && d(!1));
|
|
1302
1302
|
const [g, v] = F(o);
|
|
1303
1303
|
g !== o && (v(o), d(!1));
|
|
1304
|
-
const P = E(null),
|
|
1304
|
+
const P = E(null), k = E(null), q = E(null), y = E(!1), Z = Re();
|
|
1305
1305
|
H(() => {
|
|
1306
1306
|
const b = P.current;
|
|
1307
|
-
b !== null && (s && !b.open ? (b.showModal(),
|
|
1307
|
+
b !== null && (s && !b.open ? (b.showModal(), k.current?.focus()) : !s && b.open && (b.close(), t.current?.focus()), r(s ? q.current : null));
|
|
1308
1308
|
}, [s, t, r]), H(() => () => r(null), [r]);
|
|
1309
1309
|
const N = w((b) => {
|
|
1310
1310
|
b.key !== "Escape" || b.defaultPrevented || (Oe(b), d(!1));
|
|
1311
1311
|
}, []), R = w((b) => {
|
|
1312
1312
|
y.current = b.target === b.currentTarget;
|
|
1313
|
-
}, []),
|
|
1313
|
+
}, []), A = w((b) => {
|
|
1314
1314
|
const _ = y.current;
|
|
1315
1315
|
y.current = !1, _ && b.target === b.currentTarget && d(!1);
|
|
1316
1316
|
}, []), S = w(() => {
|
|
@@ -1321,22 +1321,22 @@ const Br = /* @__PURE__ */ f.forwardRef(Zr), zr = ({ explorer: e, toggleRef: t,
|
|
|
1321
1321
|
/* @__PURE__ */ m(Br, { "aria-hidden": "true" }),
|
|
1322
1322
|
/* @__PURE__ */ m("span", { children: c.showExplorer })
|
|
1323
1323
|
] }) }),
|
|
1324
|
-
/* @__PURE__ */ m("dialog", { ref: P, id: Z, className: "aqmx-sheet", "aria-label": c.explorerRegion, "data-testid": "markdown-explorer-sheet", onKeyDown: N, onPointerDown: R, onClick:
|
|
1324
|
+
/* @__PURE__ */ m("dialog", { ref: P, id: Z, className: "aqmx-sheet", "aria-label": c.explorerRegion, "data-testid": "markdown-explorer-sheet", onKeyDown: N, onPointerDown: R, onClick: A, onClose: S, children: /* @__PURE__ */ L("div", { className: "aqmx-sheet-panel", children: [
|
|
1325
1325
|
/* @__PURE__ */ L("div", { className: "aqmx-sheet-header", children: [
|
|
1326
1326
|
/* @__PURE__ */ m("div", { ref: q, className: "aqmx-sheet-notice-slot" }),
|
|
1327
|
-
/* @__PURE__ */ m("button", { ref:
|
|
1327
|
+
/* @__PURE__ */ m("button", { ref: k, type: "button", className: "aqmx-sheet-close", "aria-label": c.hideExplorer, title: c.hideExplorer, "data-testid": "markdown-explorer-sheet-close", onClick: () => d(!1), children: /* @__PURE__ */ m(dt, { "aria-hidden": "true" }) })
|
|
1328
1328
|
] }),
|
|
1329
1329
|
/* @__PURE__ */ m("div", { className: "aqmx-sheet-body", children: /* @__PURE__ */ m(Fe, { value: s, children: /* @__PURE__ */ m(ut, { value: h, children: e }) }) }),
|
|
1330
1330
|
/* @__PURE__ */ m(Ct, { holds: s, testId: "markdown-explorer-sheet-announcer" })
|
|
1331
1331
|
] }) })
|
|
1332
1332
|
] });
|
|
1333
|
-
}, Vr = qe(null), Me = "aqmx-explorer", ft = "aqmx-content", jr = "--aqmx-split-band", _e = '[role="tree"] [role="treeitem"]', Kr = `${_e}[tabindex="0"]`, Gr = "[data-directory-tree-tab-stop]",
|
|
1333
|
+
}, Vr = qe(null), Me = "aqmx-explorer", ft = "aqmx-content", jr = "--aqmx-split-band", _e = '[role="tree"] [role="treeitem"]', Kr = `${_e}[tabindex="0"]`, Gr = "[data-directory-tree-tab-stop]", Wr = (e, t) => {
|
|
1334
1334
|
for (const n of e.querySelectorAll(`[data-panel-id="${Me}"] ${_e}`)) if (n.getAttribute(ce) === t) return n;
|
|
1335
1335
|
return null;
|
|
1336
1336
|
}, Ye = (e, t) => ({
|
|
1337
1337
|
inlineSize: e > 0 ? e : null,
|
|
1338
1338
|
rootFontPixels: t > 0 ? t : Vt
|
|
1339
|
-
}),
|
|
1339
|
+
}), Xr = (e, t) => {
|
|
1340
1340
|
const [n, r] = F(() => Ye(0, 0));
|
|
1341
1341
|
return H(() => {
|
|
1342
1342
|
const o = e.current, c = t.current;
|
|
@@ -1355,7 +1355,7 @@ const Br = /* @__PURE__ */ f.forwardRef(Zr), zr = ({ explorer: e, toggleRef: t,
|
|
|
1355
1355
|
});
|
|
1356
1356
|
return s.observe(o), s.observe(c), () => s.disconnect();
|
|
1357
1357
|
}, [e, t]), n;
|
|
1358
|
-
}, pt = (e) => `aqmx-split-handle-${e}`,
|
|
1358
|
+
}, pt = (e) => `aqmx-split-handle-${e}`, Ur = (e, { frameRef: t, sheetToggleRef: n, handleId: r }) => {
|
|
1359
1359
|
const o = E(!1), c = E(null), l = E(!1);
|
|
1360
1360
|
H(() => {
|
|
1361
1361
|
const s = t.current;
|
|
@@ -1397,7 +1397,7 @@ const Br = /* @__PURE__ */ f.forwardRef(Zr), zr = ({ explorer: e, toggleRef: t,
|
|
|
1397
1397
|
if (a.current !== e || !o.current) return;
|
|
1398
1398
|
const u = c.current, i = `[data-panel-id="${Me}"]`;
|
|
1399
1399
|
d([
|
|
1400
|
-
u === null ? null :
|
|
1400
|
+
u === null ? null : Wr(s, u),
|
|
1401
1401
|
s.querySelector(`${i} ${Kr}`),
|
|
1402
1402
|
s.querySelector(`${i} ${Gr}`),
|
|
1403
1403
|
s.querySelector(`[data-resize-handle-id="${r}"]`)
|
|
@@ -1405,8 +1405,8 @@ const Br = /* @__PURE__ */ f.forwardRef(Zr), zr = ({ explorer: e, toggleRef: t,
|
|
|
1405
1405
|
});
|
|
1406
1406
|
}, [e, t, n, r]);
|
|
1407
1407
|
}, ia = ({ view: e, explorer: t, content: n, contentCoversPage: r = !1, sheetDismissals: o = 0, onDraggingChange: c }) => {
|
|
1408
|
-
const l = E(null), [a, s] = F(null), d = E(null), u = E(null), { inlineSize: i, rootFontPixels: p } =
|
|
1409
|
-
return
|
|
1408
|
+
const l = E(null), [a, s] = F(null), d = E(null), u = E(null), { inlineSize: i, rootFontPixels: p } = Xr(l, d), h = i !== null && i < Dt(p);
|
|
1409
|
+
return Ur(h, { frameRef: l, sheetToggleRef: u, handleId: pt(e) }), /* @__PURE__ */ L("div", { ref: l, className: "aqmx-split-frame", "data-aqmx-explorer-mode": h ? "sheet" : "split", children: [
|
|
1410
1410
|
/* @__PURE__ */ m("span", { ref: d, className: "aqmx-rem-probe", "aria-hidden": "true", "data-aqmx-rem-probe": "" }),
|
|
1411
1411
|
h ? /* @__PURE__ */ m(zr, { explorer: t, toggleRef: u, covered: r, onNoticeSlotChange: s, dismissals: o }) : null,
|
|
1412
1412
|
/* @__PURE__ */ m(Vr, { value: h ? a : null, children: /* @__PURE__ */ m(Yr, { view: e, sheet: h, explorer: t, content: n, contentCoversPage: r, onDraggingChange: c, explorerMinPixels: Ht(p) }) })
|
|
@@ -1428,7 +1428,7 @@ const Br = /* @__PURE__ */ f.forwardRef(Zr), zr = ({ explorer: e, toggleRef: t,
|
|
|
1428
1428
|
w(
|
|
1429
1429
|
(N) => {
|
|
1430
1430
|
if (N.length !== 2) return;
|
|
1431
|
-
const [R = 0,
|
|
1431
|
+
const [R = 0, A = 0] = N, S = R + A;
|
|
1432
1432
|
if (S <= 0 || R <= 0) return;
|
|
1433
1433
|
const b = Math.min(Ve, R / S * 100);
|
|
1434
1434
|
a.update(e === "tree" ? { treeExplorer: b } : { multiExplorer: b });
|
|
@@ -1442,10 +1442,10 @@ const Br = /* @__PURE__ */ f.forwardRef(Zr), zr = ({ explorer: e, toggleRef: t,
|
|
|
1442
1442
|
},
|
|
1443
1443
|
[]
|
|
1444
1444
|
);
|
|
1445
|
-
const
|
|
1445
|
+
const k = Qt() ? $t : Zt, q = C(() => ({ [jr]: `${String(t ? 0 : k)}px` }), [t, k]), y = w(
|
|
1446
1446
|
(N, R) => {
|
|
1447
|
-
const [
|
|
1448
|
-
N.length === 2 && S > 0 && h(
|
|
1447
|
+
const [A = 0, S = 0] = N;
|
|
1448
|
+
N.length === 2 && S > 0 && h(A <= 0), v.layoutChanged(N, R);
|
|
1449
1449
|
},
|
|
1450
1450
|
[v]
|
|
1451
1451
|
), Z = w(
|
|
@@ -1454,7 +1454,7 @@ const Br = /* @__PURE__ */ f.forwardRef(Zr), zr = ({ explorer: e, toggleRef: t,
|
|
|
1454
1454
|
},
|
|
1455
1455
|
[c, v]
|
|
1456
1456
|
);
|
|
1457
|
-
return /* @__PURE__ */ L(
|
|
1457
|
+
return /* @__PURE__ */ L(Xt, { id: `aqmx-split-${e}`, direction: "horizontal", onLayout: y, className: "aqmx-split", style: q, "data-aqmx-split": e, children: [
|
|
1458
1458
|
t ? null : /* @__PURE__ */ m(
|
|
1459
1459
|
je,
|
|
1460
1460
|
{
|
|
@@ -1470,10 +1470,10 @@ const Br = /* @__PURE__ */ f.forwardRef(Zr), zr = ({ explorer: e, toggleRef: t,
|
|
|
1470
1470
|
}
|
|
1471
1471
|
),
|
|
1472
1472
|
t ? null : /* @__PURE__ */ m(
|
|
1473
|
-
|
|
1473
|
+
Ut,
|
|
1474
1474
|
{
|
|
1475
1475
|
id: pt(e),
|
|
1476
|
-
thickness:
|
|
1476
|
+
thickness: k,
|
|
1477
1477
|
indicator: { visible: !0, thickness: Ee.gripThickness, length: Ee.gripLength, barThickness: Ee.barThickness, barLength: Ee.barLength },
|
|
1478
1478
|
title: s.resizeExplorer,
|
|
1479
1479
|
"aria-label": s.resizeExplorer,
|
|
@@ -1486,7 +1486,7 @@ const Br = /* @__PURE__ */ f.forwardRef(Zr), zr = ({ explorer: e, toggleRef: t,
|
|
|
1486
1486
|
] });
|
|
1487
1487
|
};
|
|
1488
1488
|
export {
|
|
1489
|
-
|
|
1489
|
+
ke as E,
|
|
1490
1490
|
Vr as S,
|
|
1491
1491
|
ia as a,
|
|
1492
1492
|
ca as b
|