@aiquants/markdown-explorer 0.38.0 → 0.40.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 +86 -0
- package/README.md +4 -2
- package/dist/{EditSurface-Dis52Iwq.cjs → EditSurface-DFHZLbWC.cjs} +2 -2
- package/dist/{EditSurface-BTrQ1viw.js → EditSurface-DV4FuQVx.js} +211 -211
- package/dist/{ExplorerSplit-Dq7HfNre.js → ExplorerSplit-DTkr0q2C.js} +407 -407
- package/dist/{ExplorerSplit-13nPIuf0.cjs → ExplorerSplit-DnuuUifU.cjs} +1 -1
- package/dist/{MultiLayout-B7RvBpCj.cjs → MultiLayout-CC0VPiFf.cjs} +1 -1
- package/dist/{MultiLayout-1rKm2Hzt.js → MultiLayout-S77I1xQr.js} +3 -3
- package/dist/{NativeScrollBar-D63-6AL1.cjs → NativeScrollBar-C2n-DzEJ.cjs} +1 -1
- package/dist/{NativeScrollBar-Bg05yuzM.js → NativeScrollBar-DMCPxFeR.js} +2 -2
- package/dist/{TreeLayout-9eEP62LF.js → TreeLayout-BGTzh0L4.js} +3 -3
- package/dist/{TreeLayout-CNE0XkWz.cjs → TreeLayout-DjJMAxWJ.cjs} +1 -1
- package/dist/core/config.d.cts +2 -0
- package/dist/core/config.d.ts +2 -0
- package/dist/core/geometry.d.cts +0 -1
- package/dist/core/geometry.d.ts +0 -1
- package/dist/{explorerCore-GCqatHTO.js → explorerCore-COhVrnGO.js} +1 -1
- package/dist/{explorerCore-5qeC3-gt.cjs → explorerCore-diILGZTv.cjs} +1 -1
- package/dist/{index-_XNluAcx.cjs → index-AfEbgYQI.cjs} +8 -8
- package/dist/{index-C52Nj37x.js → index-CWFyLa0N.js} +9 -8
- package/dist/index.cjs +1 -1
- package/dist/index.js +15 -15
- package/dist/location-Csj3eAm_.cjs +1 -0
- package/dist/{location-CJvL6JNs.js → location-DFfbnUZ9.js} +95 -89
- package/dist/{merge-CnrrjXmc.js → merge-D-Oak4Xy.js} +1 -1
- package/dist/{merge-CKpFyeqR.cjs → merge-DvoikrFp.cjs} +1 -1
- package/dist/server.cjs +1 -1
- package/dist/server.js +3 -3
- package/dist/serverCore.cjs +1 -1
- package/dist/serverCore.js +3 -3
- package/dist/styles/markdown-explorer.css +1 -1
- package/dist/{tapScrollCircle-6etmzCb7.cjs → tapScrollCircle-CS3hbyGb.cjs} +1 -1
- package/dist/{tapScrollCircle-D-Lgzdxx.js → tapScrollCircle-DKoj17z6.js} +1 -1
- package/dist/{useSplitPersistence-CD_n1ivo.cjs → useSplitPersistence-C6s7a4Iu.cjs} +1 -1
- package/dist/{useSplitPersistence-tbTu3P5m.js → useSplitPersistence-CC9bx9iq.js} +1 -1
- package/package.json +5 -5
- package/dist/location-DOIG84V9.cjs +0 -1
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
/*! Bundled third-party code: @heroicons/react 2.2.0 (MIT, ./licenses/@heroicons/react/LICENSE) */
|
|
2
|
-
import { jsx as d, jsxs as
|
|
3
|
-
import { u as
|
|
2
|
+
import { jsx as d, jsxs as C, Fragment as mt } from "react/jsx-runtime";
|
|
3
|
+
import { u as D, a4 as xt, w as Ze, A as wt, y as Qt, a5 as ze, c as Jt, Y as gt, a6 as en, a7 as tn, a8 as nn, M as Ve, a9 as rn, aa as ln, ab as an, x as on, ac as sn, ad as cn, ae as dn, af as un, ag as vt, ah as fn, ai as pn, aj as hn } from "./index-CWFyLa0N.js";
|
|
4
4
|
import * as h from "react";
|
|
5
|
-
import { use as
|
|
6
|
-
import { x as mn, y as xn, z as wn, A as
|
|
7
|
-
import { useHref as ot, useLocation as
|
|
5
|
+
import { use as Re, createContext as Ce, useState as q, useCallback as w, useMemo as I, useRef as E, useLayoutEffect as $, useEffect as Z, useSyncExternalStore as je, Suspense as bt, useId as qe } from "react";
|
|
6
|
+
import { x as mn, y as xn, z as wn, A as Et, B as gn, D as vn, F as bn, G as at, H as En, I as yn, n as Fe, C as Rn, J as Sn } from "./location-DFfbnUZ9.js";
|
|
7
|
+
import { useHref as ot, useLocation as Tn, useNavigationType as An } from "react-router";
|
|
8
8
|
import { V as st } from "./ownUrls-DD0cSCsF.js";
|
|
9
|
-
import { useDirectoryTreeState as
|
|
10
|
-
import { TOUCH_TAP_SCROLL_CIRCLE as
|
|
11
|
-
import { s as
|
|
9
|
+
import { useDirectoryTreeState as On, DirectoryTree as Nn } from "@aiquants/directory-tree";
|
|
10
|
+
import { TOUCH_TAP_SCROLL_CIRCLE as Ln, TAP_SCROLL_CIRCLE as kn } from "./tapScrollCircle-DKoj17z6.js";
|
|
11
|
+
import { s as Fn } from "./storage-D1uSw-xj.js";
|
|
12
12
|
import { d as yt } from "./describeValue-CLlVRO8d.js";
|
|
13
|
-
import { PanelGroup as
|
|
14
|
-
import { t as
|
|
15
|
-
function
|
|
13
|
+
import { PanelGroup as Cn, Panel as ct, PanelResizeHandle as qn } from "@aiquants/resize-panels";
|
|
14
|
+
import { t as Pn, u as Mn } from "./useSplitPersistence-CC9bx9iq.js";
|
|
15
|
+
function _n({
|
|
16
16
|
title: e,
|
|
17
17
|
titleId: t,
|
|
18
18
|
...n
|
|
@@ -33,8 +33,8 @@ function In({
|
|
|
33
33
|
clipRule: "evenodd"
|
|
34
34
|
}));
|
|
35
35
|
}
|
|
36
|
-
const
|
|
37
|
-
function
|
|
36
|
+
const In = /* @__PURE__ */ h.forwardRef(_n);
|
|
37
|
+
function Dn({
|
|
38
38
|
title: e,
|
|
39
39
|
titleId: t,
|
|
40
40
|
...n
|
|
@@ -55,8 +55,8 @@ function Hn({
|
|
|
55
55
|
clipRule: "evenodd"
|
|
56
56
|
}));
|
|
57
57
|
}
|
|
58
|
-
const
|
|
59
|
-
function
|
|
58
|
+
const Hn = /* @__PURE__ */ h.forwardRef(Dn);
|
|
59
|
+
function Bn({
|
|
60
60
|
title: e,
|
|
61
61
|
titleId: t,
|
|
62
62
|
...n
|
|
@@ -77,8 +77,8 @@ function $n({
|
|
|
77
77
|
d: "M18 7.5a3 3 0 0 1 3 3V18a3 3 0 0 1-3 3h-7.5a3 3 0 0 1-3-3v-7.5a3 3 0 0 1 3-3H18Z"
|
|
78
78
|
}));
|
|
79
79
|
}
|
|
80
|
-
const
|
|
81
|
-
function
|
|
80
|
+
const $n = /* @__PURE__ */ h.forwardRef(Bn);
|
|
81
|
+
function Zn({
|
|
82
82
|
title: e,
|
|
83
83
|
titleId: t,
|
|
84
84
|
...n
|
|
@@ -99,16 +99,16 @@ function zn({
|
|
|
99
99
|
clipRule: "evenodd"
|
|
100
100
|
}));
|
|
101
101
|
}
|
|
102
|
-
const
|
|
103
|
-
const o = e.replace(
|
|
102
|
+
const zn = /* @__PURE__ */ h.forwardRef(Zn), Vn = "http://path.invalid", jn = /[\t\n\r]/gu, Kn = (e, t, n, r) => {
|
|
103
|
+
const o = e.replace(jn, "");
|
|
104
104
|
if (!o.startsWith("/") || o.startsWith("//") || o.includes("\\")) return null;
|
|
105
|
-
const { pathname: s, search: l, hash: a } = new URL(o,
|
|
105
|
+
const { pathname: s, search: l, hash: a } = new URL(o, Vn);
|
|
106
106
|
return !st(s, [t]) || st(s, [n]) ? null : `${r}${s.slice(t.length)}${l}${a}`;
|
|
107
|
-
},
|
|
108
|
-
const { notices: e, config: t } =
|
|
107
|
+
}, Un = () => {
|
|
108
|
+
const { notices: e, config: t } = D(), n = Re(e), r = ot(t.basePath), o = ot(t.dataPath);
|
|
109
109
|
return n.length === 0 ? null : /* @__PURE__ */ d("div", { className: "aqmx-explorer-notices", children: n.map((s) => {
|
|
110
|
-
const l = s.action === void 0 ? null :
|
|
111
|
-
return /* @__PURE__ */
|
|
110
|
+
const l = s.action === void 0 ? null : Kn(s.action.href, r, o, t.basePath);
|
|
111
|
+
return /* @__PURE__ */ C("div", { className: "aqmx-callout", "data-aqmx-tone": s.tone, "data-testid": "markdown-explorer-notice", "data-aqmx-notice": s.id, children: [
|
|
112
112
|
/* @__PURE__ */ d("p", { className: "aqmx-callout-title", children: s.title }),
|
|
113
113
|
s.body === void 0 ? null : /* @__PURE__ */ d("p", { className: "aqmx-callout-body", children: s.body }),
|
|
114
114
|
s.action === void 0 ? null : l === null ? (
|
|
@@ -117,7 +117,7 @@ const Vn = /* @__PURE__ */ h.forwardRef(zn), jn = "http://path.invalid", Kn = /[
|
|
|
117
117
|
] }, s.id);
|
|
118
118
|
}) });
|
|
119
119
|
};
|
|
120
|
-
function
|
|
120
|
+
function Wn({
|
|
121
121
|
title: e,
|
|
122
122
|
titleId: t,
|
|
123
123
|
...n
|
|
@@ -138,7 +138,7 @@ function Gn({
|
|
|
138
138
|
clipRule: "evenodd"
|
|
139
139
|
}));
|
|
140
140
|
}
|
|
141
|
-
const
|
|
141
|
+
const Gn = /* @__PURE__ */ h.forwardRef(Wn), Ke = Ce(!0), Rt = Ce(null), St = "\0loop\0", Tt = "\0", Xn = () => {
|
|
142
142
|
const e = /* @__PURE__ */ new WeakMap(), t = /* @__PURE__ */ new WeakMap(), n = /* @__PURE__ */ new WeakMap(), r = (l) => {
|
|
143
143
|
const a = e.get(l);
|
|
144
144
|
if (a !== void 0) return a;
|
|
@@ -167,7 +167,7 @@ const Xn = /* @__PURE__ */ h.forwardRef(Gn), Ke = Ce(!0), St = Ce(null), Tt = "\
|
|
|
167
167
|
return t.set(l, { state: u, children: p, grafted: g }), g;
|
|
168
168
|
};
|
|
169
169
|
return (l, a) => o(l, a, /* @__PURE__ */ new Set());
|
|
170
|
-
},
|
|
170
|
+
}, Yn = (e, t) => `${St}${e}${Tt}${t}`, ve = (e) => e.startsWith(St), Qn = (e) => e.slice(e.lastIndexOf(Tt) + 1), de = "data-aqmx-path", Jn = (e, t, n, r, o) => {
|
|
171
171
|
const s = { aqmxPath: e.path };
|
|
172
172
|
return e.modifiedAt !== void 0 && (s.aqmxModifiedAt = e.modifiedAt), n && (s.aqmxOpen = !0), (r === "loading" || r === "failed") && (s.aqmxChildren = r), {
|
|
173
173
|
name: e.name,
|
|
@@ -179,27 +179,27 @@ const Xn = /* @__PURE__ */ h.forwardRef(Gn), Ke = Ce(!0), St = Ce(null), Tt = "\
|
|
|
179
179
|
label: o,
|
|
180
180
|
data: s
|
|
181
181
|
};
|
|
182
|
-
},
|
|
183
|
-
const o =
|
|
182
|
+
}, er = (e, t, n, r) => {
|
|
183
|
+
const o = Yn(t, e.path);
|
|
184
184
|
return { name: n, type: "directory", absolutePath: o, relativePath: o, children: r, data: { aqmxLoop: e.path } };
|
|
185
|
-
},
|
|
185
|
+
}, tr = () => {
|
|
186
186
|
const e = /* @__PURE__ */ new WeakMap(), t = /* @__PURE__ */ new WeakMap(), n = /* @__PURE__ */ new WeakMap(), r = [], o = (a, f, u) => {
|
|
187
187
|
const i = a.map((p) => p.type === "loop" ? s(p, f, u) : l(p, f)), c = n.get(a);
|
|
188
188
|
return c !== void 0 && c.length === i.length && c.every((p, x) => p === i[x]) ? c : (n.set(a, i), i);
|
|
189
189
|
}, s = (a, f, u) => {
|
|
190
190
|
const i = t.get(a);
|
|
191
191
|
if (i !== void 0 && i.parentKey === u && i.loopFolderName === f.loopFolderName) return i.row;
|
|
192
|
-
const c =
|
|
192
|
+
const c = er(a, u, f.loopFolderName(a.name), r);
|
|
193
193
|
return t.set(a, { row: c, parentKey: u, loopFolderName: f.loopFolderName }), c;
|
|
194
194
|
}, l = (a, f) => {
|
|
195
195
|
const u = a.type === "directory" ? a.children === void 0 ? r : o(a.children, f, a.path) : void 0, i = f.openPaths.has(a.path), c = a.type === "directory" && a.lazy === !0 ? f.childrenOf(a.path)?.status : void 0, p = c === "failed" ? f.renderFailedFolder : void 0, x = e.get(a);
|
|
196
196
|
if (x !== void 0 && x.open === i && x.childrenStatus === c && x.children === u && x.renderFailedFolder === p)
|
|
197
197
|
return x.row;
|
|
198
|
-
const g =
|
|
198
|
+
const g = Jn(a, u, i, c, p === void 0 ? void 0 : p(a));
|
|
199
199
|
return e.set(a, { row: g, open: i, childrenStatus: c, children: u, renderFailedFolder: p }), g;
|
|
200
200
|
};
|
|
201
201
|
return (a, f) => o(a, f, "");
|
|
202
|
-
},
|
|
202
|
+
}, nr = (e) => {
|
|
203
203
|
if (e === void 0) return;
|
|
204
204
|
const t = (n) => {
|
|
205
205
|
const r = n.data?.aqmxModifiedAt;
|
|
@@ -209,7 +209,7 @@ const Xn = /* @__PURE__ */ h.forwardRef(Gn), Ke = Ce(!0), St = Ce(null), Tt = "\
|
|
|
209
209
|
}, Be = (e, t) => {
|
|
210
210
|
const n = e.filter((r) => r.type === "directory");
|
|
211
211
|
return t === void 0 ? n : n.sort(t);
|
|
212
|
-
},
|
|
212
|
+
}, rr = (e, t) => {
|
|
213
213
|
const n = /* @__PURE__ */ new Map();
|
|
214
214
|
let r = 0;
|
|
215
215
|
const o = (s) => {
|
|
@@ -223,34 +223,34 @@ const Xn = /* @__PURE__ */ h.forwardRef(Gn), Ke = Ce(!0), St = Ce(null), Tt = "\
|
|
|
223
223
|
}
|
|
224
224
|
};
|
|
225
225
|
return o(e), { folders: n, waiting: r };
|
|
226
|
-
},
|
|
226
|
+
}, lr = (e) => {
|
|
227
227
|
const t = /* @__PURE__ */ new Set(), n = (r) => {
|
|
228
228
|
for (const o of r)
|
|
229
229
|
o.type === "directory" && (o.lazy === !0 && t.add(o.path), o.children !== void 0 && n(o.children));
|
|
230
230
|
};
|
|
231
231
|
return n(e), t;
|
|
232
|
-
},
|
|
232
|
+
}, At = (e, t) => {
|
|
233
233
|
for (const n of e) {
|
|
234
234
|
if (n.type !== "directory") continue;
|
|
235
235
|
if (n.path === t) return n;
|
|
236
|
-
const r = n.children === void 0 ? null :
|
|
236
|
+
const r = n.children === void 0 ? null : At(n.children, t);
|
|
237
237
|
if (r !== null) return r;
|
|
238
238
|
}
|
|
239
239
|
return null;
|
|
240
|
-
},
|
|
240
|
+
}, Ot = (e, t, n) => {
|
|
241
241
|
for (const r of e) {
|
|
242
242
|
if (r === t) return { parent: n };
|
|
243
|
-
const o = r.children === void 0 ? null :
|
|
243
|
+
const o = r.children === void 0 ? null : Ot(r.children, t, r);
|
|
244
244
|
if (o !== null) return o;
|
|
245
245
|
}
|
|
246
246
|
return null;
|
|
247
|
-
},
|
|
248
|
-
const r =
|
|
247
|
+
}, ar = (e, t, n) => {
|
|
248
|
+
const r = Ot(e, n, null);
|
|
249
249
|
if (r === null) throw new Error(`[markdown-explorer] the pressed folder's row is not among the tree's rows: ${yt(n.absolutePath)}`);
|
|
250
250
|
if (r.parent !== null) return { kind: "folder", path: r.parent.absolutePath };
|
|
251
251
|
const o = mn(t.filter((s) => s.type !== "loop"));
|
|
252
252
|
return o === null ? { kind: "nothing" } : { kind: "document", path: o };
|
|
253
|
-
},
|
|
253
|
+
}, or = (e, t, n, r) => {
|
|
254
254
|
let o = e;
|
|
255
255
|
for (const s of t) {
|
|
256
256
|
const l = o.find((a) => a.type === "directory" && a.path === s);
|
|
@@ -260,14 +260,14 @@ const Xn = /* @__PURE__ */ h.forwardRef(Gn), Ke = Ce(!0), St = Ce(null), Tt = "\
|
|
|
260
260
|
o = l.children ?? [];
|
|
261
261
|
}
|
|
262
262
|
return o.some((s) => s.type === "file" && s.path === n) ? "ready" : "missing";
|
|
263
|
-
}, it = /* @__PURE__ */ new Set(),
|
|
263
|
+
}, it = /* @__PURE__ */ new Set(), sr = (e, t) => e.has(t) ? e : new Set(e).add(t), cr = (e, t) => {
|
|
264
264
|
if (!t.some((r) => e.has(r))) return e;
|
|
265
265
|
const n = new Set(t);
|
|
266
266
|
return new Set([...e].filter((r) => !n.has(r)));
|
|
267
|
-
},
|
|
268
|
-
const [e, t] =
|
|
267
|
+
}, ir = (e, t) => [...e].every((n) => t.has(n)) ? e : new Set([...e].filter((n) => t.has(n))), dr = () => {
|
|
268
|
+
const [e, t] = q(it), n = w((l) => t((a) => sr(a, l)), []), r = w((l) => t((a) => cr(a, l)), []), o = w((l) => t((a) => ir(a, l)), []), s = w(() => t(it), []);
|
|
269
269
|
return I(() => ({ direct: e, markDirect: n, unmarkDirect: r, pruneDirect: o, clearDirect: s }), [e, n, r, o, s]);
|
|
270
|
-
},
|
|
270
|
+
}, ur = (e) => ({
|
|
271
271
|
budget: e,
|
|
272
272
|
handled: /* @__PURE__ */ new Set(),
|
|
273
273
|
loads: /* @__PURE__ */ new Set(),
|
|
@@ -276,7 +276,7 @@ const Xn = /* @__PURE__ */ h.forwardRef(Gn), Ke = Ce(!0), St = Ce(null), Tt = "\
|
|
|
276
276
|
depthLimited: !1,
|
|
277
277
|
announcedStart: !1,
|
|
278
278
|
issuedAgainst: null
|
|
279
|
-
}),
|
|
279
|
+
}), fr = (e, t) => {
|
|
280
280
|
const n = [];
|
|
281
281
|
let r = Be(t.entries, t.compare);
|
|
282
282
|
for (let o = 1; r.length > 0; o += 1) {
|
|
@@ -305,28 +305,28 @@ const Xn = /* @__PURE__ */ h.forwardRef(Gn), Ke = Ce(!0), St = Ce(null), Tt = "\
|
|
|
305
305
|
r = s;
|
|
306
306
|
}
|
|
307
307
|
return n;
|
|
308
|
-
},
|
|
308
|
+
}, Nt = (e, t) => e.every((n) => n.type !== "directory" || t(n.path) && (n.lazy === !0 || n.children === void 0 || Nt(n.children, t))), pr = (e, t) => {
|
|
309
309
|
if (e.folderLimited) return { kind: "folder-limit", opened: e.opened };
|
|
310
310
|
if (e.depthLimited) return { kind: "depth-limit", opened: e.opened };
|
|
311
311
|
let n = 0;
|
|
312
312
|
for (const r of e.loads) t.childrenOf(r)?.status === "failed" && (n += 1);
|
|
313
|
-
return { kind: "done", opened: e.opened, failed: n, complete:
|
|
314
|
-
}, De = Object.freeze({ state: "idle" }),
|
|
315
|
-
const t = E(null), n = E(e), [r, o] =
|
|
316
|
-
|
|
313
|
+
return { kind: "done", opened: e.opened, failed: n, complete: Nt(t.entries, t.isShownExpanded) };
|
|
314
|
+
}, De = Object.freeze({ state: "idle" }), hr = (e) => {
|
|
315
|
+
const t = E(null), n = E(e), [r, o] = q(De);
|
|
316
|
+
$(() => {
|
|
317
317
|
n.current = e;
|
|
318
318
|
});
|
|
319
319
|
const s = w(() => {
|
|
320
|
-
t.current === null && (t.current =
|
|
320
|
+
t.current === null && (t.current = ur(n.current.budget), o({ state: "running", opened: 0 }));
|
|
321
321
|
}, []), l = w(() => {
|
|
322
322
|
t.current = null, o(De);
|
|
323
323
|
}, []), a = w((f) => {
|
|
324
324
|
const u = t.current;
|
|
325
325
|
if (u === null) return;
|
|
326
|
-
const i =
|
|
326
|
+
const i = fr(u, f);
|
|
327
327
|
if (i.length > 0 && (u.issuedAgainst = f.expanded, n.current.expandMultiple([...i])), !u.announcedStart && (u.loads.size > 0 || f.waiting > 0) && (u.announcedStart = !0, n.current.onStart()), i.length === 0 && !f.expansionPending && f.expanded !== u.issuedAgainst && f.waiting === 0) {
|
|
328
328
|
t.current = null;
|
|
329
|
-
const p =
|
|
329
|
+
const p = pr(u, f);
|
|
330
330
|
o(p.kind === "done" ? De : { state: "stopped", stop: p.kind, opened: p.opened }), n.current.onFinish(p);
|
|
331
331
|
return;
|
|
332
332
|
}
|
|
@@ -334,93 +334,93 @@ const Xn = /* @__PURE__ */ h.forwardRef(Gn), Ke = Ce(!0), St = Ce(null), Tt = "\
|
|
|
334
334
|
o((p) => p.state === "running" && p.opened === c ? p : { state: "running", opened: c });
|
|
335
335
|
}, []);
|
|
336
336
|
return I(() => ({ status: r, start: s, end: l, advance: a }), [r, s, l, a]);
|
|
337
|
-
}, dt = ["pointerdown", "wheel", "touchstart", "keydown", "focusin"],
|
|
337
|
+
}, dt = ["pointerdown", "wheel", "touchstart", "keydown", "focusin"], mr = 8, ut = { least: Number.POSITIVE_INFINITY, stalled: 0 }, xr = ({ tree: e, container: t, path: n, chain: r, rows: o, cancel: s, displayed: l, placement: a }) => {
|
|
338
338
|
const f = E(null), u = E(!0), i = E(ut), c = E(null), p = E(null), x = E(r), g = E(a);
|
|
339
|
-
|
|
339
|
+
$(() => {
|
|
340
340
|
x.current = r, g.current = a;
|
|
341
341
|
}, [r, a]);
|
|
342
342
|
const b = w(() => {
|
|
343
|
-
const
|
|
344
|
-
|
|
343
|
+
const T = c.current;
|
|
344
|
+
T !== null && (c.current = null, T.phase === "asking" ? T.controller.abort() : x.current?.open(null));
|
|
345
345
|
}, []), S = w(() => {
|
|
346
346
|
f.current = null, b();
|
|
347
347
|
}, [b]), N = w(() => {
|
|
348
|
-
const
|
|
349
|
-
f.current === null || p.current !== null ||
|
|
348
|
+
const T = t.current;
|
|
349
|
+
f.current === null || p.current !== null || T === null || T.getClientRects().length === 0 || (p.current = requestAnimationFrame(() => {
|
|
350
350
|
p.current = null;
|
|
351
|
-
const
|
|
352
|
-
if (
|
|
353
|
-
const _ = g.current(
|
|
351
|
+
const L = f.current;
|
|
352
|
+
if (L === null) return;
|
|
353
|
+
const _ = g.current(L);
|
|
354
354
|
if (_ === 0) {
|
|
355
355
|
u.current = !0, c.current?.phase === "opening" && b();
|
|
356
356
|
return;
|
|
357
357
|
}
|
|
358
|
-
if (e.current?.scrollToPath(
|
|
358
|
+
if (e.current?.scrollToPath(L, { align: "nearest" }) === !0) {
|
|
359
359
|
c.current?.phase === "opening" && b();
|
|
360
|
-
const { least:
|
|
361
|
-
i.current = _ <
|
|
360
|
+
const { least: A, stalled: B } = i.current;
|
|
361
|
+
i.current = _ < A ? { least: _, stalled: 0 } : { least: A, stalled: B + 1 }, i.current.stalled < mr && N();
|
|
362
362
|
return;
|
|
363
363
|
}
|
|
364
|
-
const
|
|
365
|
-
if (
|
|
364
|
+
const R = c.current;
|
|
365
|
+
if (R === null) {
|
|
366
366
|
f.current = null;
|
|
367
367
|
return;
|
|
368
368
|
}
|
|
369
|
-
|
|
369
|
+
R.phase === "opening" && x.current?.progress(R.folders, L) !== "loading" && S();
|
|
370
370
|
}));
|
|
371
|
-
}, [e, t, b, S]),
|
|
371
|
+
}, [e, t, b, S]), k = w(() => {
|
|
372
372
|
u.current = !1, i.current = ut, N();
|
|
373
373
|
}, [N]);
|
|
374
374
|
Z(() => {
|
|
375
|
-
const
|
|
376
|
-
if (
|
|
377
|
-
const
|
|
378
|
-
|
|
379
|
-
for (const _ of dt)
|
|
375
|
+
const T = t.current;
|
|
376
|
+
if (T === null) return;
|
|
377
|
+
const L = typeof ResizeObserver > "u" ? null : new ResizeObserver(k);
|
|
378
|
+
L?.observe(T);
|
|
379
|
+
for (const _ of dt) T.addEventListener(_, S, { passive: !0 });
|
|
380
380
|
return () => {
|
|
381
|
-
|
|
382
|
-
for (const _ of dt)
|
|
381
|
+
L?.disconnect();
|
|
382
|
+
for (const _ of dt) T.removeEventListener(_, S);
|
|
383
383
|
p.current !== null && cancelAnimationFrame(p.current), p.current = null, b();
|
|
384
384
|
};
|
|
385
|
-
}, [t,
|
|
385
|
+
}, [t, k, S, b]);
|
|
386
386
|
const y = r !== null;
|
|
387
387
|
Z(() => {
|
|
388
|
-
const
|
|
389
|
-
if (S(), n === null ||
|
|
388
|
+
const T = t.current;
|
|
389
|
+
if (S(), n === null || T === null || T.contains(T.ownerDocument.activeElement)) return;
|
|
390
390
|
f.current = n;
|
|
391
|
-
const
|
|
392
|
-
if (y &&
|
|
393
|
-
const _ = new AbortController(),
|
|
394
|
-
c.current =
|
|
395
|
-
c.current ===
|
|
391
|
+
const L = x.current;
|
|
392
|
+
if (y && L !== null) {
|
|
393
|
+
const _ = new AbortController(), R = { phase: "asking", controller: _ };
|
|
394
|
+
c.current = R, L.ancestors(n, _.signal).then((A) => {
|
|
395
|
+
c.current === R && (A === null ? c.current = null : (c.current = { phase: "opening", folders: A }, x.current?.open(A)), k());
|
|
396
396
|
});
|
|
397
397
|
}
|
|
398
|
-
|
|
399
|
-
}, [n, y, t, S,
|
|
400
|
-
(c.current?.phase === "opening" || f.current !== null && !u.current) &&
|
|
401
|
-
}, [o,
|
|
402
|
-
const
|
|
398
|
+
k();
|
|
399
|
+
}, [n, y, t, S, k]), Z(() => {
|
|
400
|
+
(c.current?.phase === "opening" || f.current !== null && !u.current) && k();
|
|
401
|
+
}, [o, k]);
|
|
402
|
+
const z = E(s);
|
|
403
403
|
Z(() => {
|
|
404
|
-
|
|
404
|
+
z.current !== s && (z.current = s, S());
|
|
405
405
|
}, [s, S]);
|
|
406
|
-
const
|
|
406
|
+
const H = E(l);
|
|
407
407
|
Z(() => {
|
|
408
|
-
|
|
408
|
+
H.current && !l && b(), H.current = l;
|
|
409
409
|
}, [l, b]);
|
|
410
|
-
},
|
|
411
|
-
const [r, o] =
|
|
412
|
-
return
|
|
410
|
+
}, wr = "--aqmx-tree-line", gr = Object.freeze(["(forced-colors: active)", "(prefers-color-scheme: dark)"]), vr = "data-aqmx-tree-probe", br = Object.freeze({ rowHeight: xn, lineColor: null }), Er = (e, t, n) => {
|
|
411
|
+
const [r, o] = q(br);
|
|
412
|
+
return $(() => {
|
|
413
413
|
const s = e.current;
|
|
414
414
|
if (s === null) return;
|
|
415
415
|
const l = () => {
|
|
416
|
-
const u = Math.round(s.getBoundingClientRect().height), i = getComputedStyle(s), c = i.getPropertyValue(
|
|
416
|
+
const u = Math.round(s.getBoundingClientRect().height), i = getComputedStyle(s), c = i.getPropertyValue(wr).trim() === "" ? null : i.color;
|
|
417
417
|
o((p) => {
|
|
418
418
|
const x = Number.isFinite(u) && u > 0 ? u : p.rowHeight;
|
|
419
419
|
return p.rowHeight === x && p.lineColor === c ? p : { rowHeight: x, lineColor: c };
|
|
420
420
|
});
|
|
421
421
|
};
|
|
422
422
|
l();
|
|
423
|
-
const a =
|
|
423
|
+
const a = gr.map((u) => window.matchMedia(u));
|
|
424
424
|
for (const u of a) u.addEventListener("change", l);
|
|
425
425
|
const f = typeof ResizeObserver > "u" ? null : new ResizeObserver(l);
|
|
426
426
|
return f?.observe(s), () => {
|
|
@@ -428,13 +428,13 @@ const Xn = /* @__PURE__ */ h.forwardRef(Gn), Ke = Ce(!0), St = Ce(null), Tt = "\
|
|
|
428
428
|
f?.disconnect();
|
|
429
429
|
};
|
|
430
430
|
}, [e, t, n]), r;
|
|
431
|
-
},
|
|
432
|
-
const n =
|
|
431
|
+
}, Lt = "markdown-explorer-tree-scroll", yr = 0.5, kt = (e, t) => [...e.querySelectorAll(`[role="treeitem"][${de}]`)].find((n) => n.getAttribute(de) === t), Rr = (e, t) => {
|
|
432
|
+
const n = kt(e, t), r = n?.closest(`[data-testid="${Lt}"]`);
|
|
433
433
|
if (n === void 0 || r === null || r === void 0) return Number.POSITIVE_INFINITY;
|
|
434
434
|
const o = r.getBoundingClientRect(), s = n.getBoundingClientRect(), l = o.top - s.top, a = s.height > o.height ? Math.abs(l) : Math.max(0, l) + Math.max(0, s.bottom - o.bottom);
|
|
435
435
|
return a <= yr ? 0 : a;
|
|
436
436
|
}, $e = Object.freeze({
|
|
437
|
-
testId:
|
|
437
|
+
testId: Lt,
|
|
438
438
|
overscanCount: 13,
|
|
439
439
|
callbackThrottleMs: 13,
|
|
440
440
|
scrollBarOptions: Object.freeze({
|
|
@@ -443,24 +443,24 @@ const Xn = /* @__PURE__ */ h.forwardRef(Gn), Ke = Ce(!0), St = Ce(null), Tt = "\
|
|
|
443
443
|
enableArrowButtons: !0,
|
|
444
444
|
enableArrowButtonTabStops: !1,
|
|
445
445
|
enableScrollToTopBottomButtons: !0,
|
|
446
|
-
tapScrollCircleOptions:
|
|
446
|
+
tapScrollCircleOptions: kn
|
|
447
447
|
}),
|
|
448
448
|
behaviorOptions: Object.freeze({ enablePointerDrag: !0 })
|
|
449
|
-
}),
|
|
449
|
+
}), Sr = Object.freeze({
|
|
450
450
|
...$e,
|
|
451
451
|
scrollBarOptions: Object.freeze({
|
|
452
452
|
...$e.scrollBarOptions,
|
|
453
453
|
...tn,
|
|
454
|
-
tapScrollCircleOptions:
|
|
454
|
+
tapScrollCircleOptions: Ln
|
|
455
455
|
})
|
|
456
|
-
}),
|
|
457
|
-
const t =
|
|
456
|
+
}), Tr = (e) => e ? Sr : $e, Ar = { hoverClassName: "", directorySelectedClassName: "", itemSelectedClassName: "" }, Or = { color: "inherit", fontSize: "inherit" }, Nr = { fontSize: "inherit" }, Lr = /* @__PURE__ */ new Set(), kr = /* @__PURE__ */ new Map(), Fr = { color: "var(--aqmx-tree-line)" }, Ft = (e) => e instanceof Element ? e.closest(`[${de}]`) : null, Cr = (e) => {
|
|
457
|
+
const t = Ft(e);
|
|
458
458
|
return t === null || t.getAttribute("data-entry-type") !== "file" ? null : t.getAttribute(de);
|
|
459
|
-
},
|
|
460
|
-
const { labels: e } =
|
|
461
|
-
return /* @__PURE__ */
|
|
459
|
+
}, Ct = (e, t, n, r) => n === "folder-limit" ? e.expandAllFolderLimit(r, t.maxFolders, e.expandAll) : e.expandAllDepthLimit(r, t.maxDepth), qr = (e, t, n) => n.kind === "done" ? e.expandAllDone(n.opened, n.failed, n.complete) : Ct(e, t, n.kind, n.opened), qt = () => {
|
|
460
|
+
const { labels: e } = D();
|
|
461
|
+
return /* @__PURE__ */ C("div", { className: "aqmx-explorer-loading", "aria-busy": "true", "data-testid": "markdown-explorer-tree-loading", children: [
|
|
462
462
|
/* @__PURE__ */ d("p", { className: "aqmx-explorer-loading-text", children: e.treeLoading }),
|
|
463
|
-
/* @__PURE__ */
|
|
463
|
+
/* @__PURE__ */ C("div", { className: "aqmx-skeleton", "aria-hidden": "true", children: [
|
|
464
464
|
/* @__PURE__ */ d("span", {}),
|
|
465
465
|
/* @__PURE__ */ d("span", {}),
|
|
466
466
|
/* @__PURE__ */ d("span", {}),
|
|
@@ -468,19 +468,19 @@ const Xn = /* @__PURE__ */ h.forwardRef(Gn), Ke = Ce(!0), St = Ce(null), Tt = "\
|
|
|
468
468
|
/* @__PURE__ */ d("span", {})
|
|
469
469
|
] })
|
|
470
470
|
] });
|
|
471
|
-
},
|
|
472
|
-
const { labels: e } =
|
|
473
|
-
return /* @__PURE__ */
|
|
474
|
-
/* @__PURE__ */ d(
|
|
471
|
+
}, Pr = () => {
|
|
472
|
+
const { labels: e } = D();
|
|
473
|
+
return /* @__PURE__ */ C("div", { className: "aqmx-empty", "data-testid": "markdown-explorer-tree-empty", children: [
|
|
474
|
+
/* @__PURE__ */ d(Gn, { className: "aqmx-explorer-empty-icon", "aria-hidden": "true" }),
|
|
475
475
|
/* @__PURE__ */ d("p", { className: "aqmx-empty-title", children: e.treeEmptyTitle }),
|
|
476
476
|
/* @__PURE__ */ d("p", { className: "aqmx-explorer-empty-body", children: e.treeEmptyBody })
|
|
477
477
|
] });
|
|
478
|
-
},
|
|
479
|
-
const { labels: n } =
|
|
480
|
-
return /* @__PURE__ */
|
|
478
|
+
}, Mr = ({ name: e, onRetry: t }) => {
|
|
479
|
+
const { labels: n } = D(), r = qe();
|
|
480
|
+
return /* @__PURE__ */ C("span", { className: "aqmx-explorer-folder-failed", children: [
|
|
481
481
|
/* @__PURE__ */ d("span", { className: "aqmx-explorer-folder-name", children: e }),
|
|
482
482
|
/* @__PURE__ */ d("span", { id: r, className: "aqmx-explorer-folder-error", children: n.folderLoadFailed }),
|
|
483
|
-
/* @__PURE__ */
|
|
483
|
+
/* @__PURE__ */ C(
|
|
484
484
|
"button",
|
|
485
485
|
{
|
|
486
486
|
type: "button",
|
|
@@ -490,7 +490,7 @@ const Xn = /* @__PURE__ */ h.forwardRef(Gn), Ke = Ce(!0), St = Ce(null), Tt = "\
|
|
|
490
490
|
onClick: (o) => {
|
|
491
491
|
o.stopPropagation();
|
|
492
492
|
const s = o.currentTarget, l = s.ownerDocument.activeElement === s ? s.closest('[role="treeitem"]') : null;
|
|
493
|
-
l instanceof HTMLElement &&
|
|
493
|
+
l instanceof HTMLElement && gt(l), t();
|
|
494
494
|
},
|
|
495
495
|
onKeyDown: (o) => {
|
|
496
496
|
o.key !== "Escape" && o.stopPropagation();
|
|
@@ -502,7 +502,7 @@ const Xn = /* @__PURE__ */ h.forwardRef(Gn), Ke = Ce(!0), St = Ce(null), Tt = "\
|
|
|
502
502
|
}
|
|
503
503
|
)
|
|
504
504
|
] });
|
|
505
|
-
},
|
|
505
|
+
}, _r = ({
|
|
506
506
|
entries: e,
|
|
507
507
|
version: t,
|
|
508
508
|
mode: n,
|
|
@@ -521,49 +521,49 @@ const Xn = /* @__PURE__ */ h.forwardRef(Gn), Ke = Ce(!0), St = Ce(null), Tt = "\
|
|
|
521
521
|
expandAll: b,
|
|
522
522
|
revealCancel: S
|
|
523
523
|
}) => {
|
|
524
|
-
const { trees: N, documents:
|
|
525
|
-
|
|
524
|
+
const { trees: N, documents: k, labels: y, locale: z, theme: H, paletteKey: T, data: L, config: _, sources: R, reveals: A } = D(), B = Re(Ke), O = Re(Rt), [V] = q(() => O?.get(r)), J = Tr(Jt()), pe = I(() => V === void 0 ? J : { ...J, initialScrollAnchor: V }, [J, V]), [he] = q(tr), X = E(null), { rowHeight: ue, lineColor: ee } = Er(X, H, T), { isExpanded: ne, toggle: fe, expandMultiple: j, collapseMultiple: me, expanded: Y, isPending: P } = c, { alwaysExpanded: re, sortMode: Q, folderPlacement: xe, readmePlacement: we } = o, { direct: Se, markDirect: le, unmarkDirect: oe, pruneDirect: Te } = x, { running: be, advance: Ee } = b, F = E(null), W = E(null);
|
|
525
|
+
$(() => {
|
|
526
526
|
if (O === null) return;
|
|
527
|
-
const m =
|
|
527
|
+
const m = F;
|
|
528
528
|
return () => {
|
|
529
529
|
const v = m.current === null ? null : m.current.getScrollAnchor();
|
|
530
530
|
v === null ? O.delete(r) : O.set(r, v);
|
|
531
531
|
};
|
|
532
532
|
}, [O, r]);
|
|
533
|
-
const te = I(() => wn({ sortMode:
|
|
534
|
-
|
|
535
|
-
K.current = { shownExpanded: ce, isExpanded: ne, isHeld:
|
|
536
|
-
}, [ce, ne,
|
|
537
|
-
const [ie] =
|
|
533
|
+
const te = I(() => wn({ sortMode: Q, folderPlacement: xe, readmePlacement: we }), [Q, xe, we]), Ht = I(() => nr(te), [te]), ae = w((m) => N.children(r, m), [N, r]), se = I(() => lr(e), [e]), ye = w((m) => re && !se.has(m), [re, se]), ce = w((m) => !ve(m) && (ne(m) || ye(m)), [ne, ye]), K = E({ shownExpanded: ce, isExpanded: ne, isHeld: ye, unloadedFolders: se, entries: e, childrenOf: ae, folderSelection: u, openDocument: f });
|
|
534
|
+
$(() => {
|
|
535
|
+
K.current = { shownExpanded: ce, isExpanded: ne, isHeld: ye, unloadedFolders: se, entries: e, childrenOf: ae, folderSelection: u, openDocument: f };
|
|
536
|
+
}, [ce, ne, ye, se, e, ae, u, f]);
|
|
537
|
+
const [ie] = q(() => /* @__PURE__ */ new Map()), Pe = w(
|
|
538
538
|
(m, v) => {
|
|
539
|
-
|
|
539
|
+
A.settle(v), m.open(v);
|
|
540
540
|
},
|
|
541
|
-
[
|
|
541
|
+
[A]
|
|
542
542
|
), Ae = w(
|
|
543
543
|
(m, v) => {
|
|
544
|
-
v.kind !== "nothing" &&
|
|
544
|
+
v.kind !== "nothing" && A.settle(v.path), m.close(v);
|
|
545
545
|
},
|
|
546
|
-
[
|
|
546
|
+
[A]
|
|
547
547
|
), ge = w(
|
|
548
548
|
(m, v) => {
|
|
549
549
|
for (const M of m) {
|
|
550
550
|
const U = ie.get(M);
|
|
551
551
|
if (U === void 0) continue;
|
|
552
552
|
ie.delete(M);
|
|
553
|
-
const
|
|
554
|
-
!v &&
|
|
553
|
+
const G = K.current.folderSelection;
|
|
554
|
+
!v && G !== null && G.current === M && Ae(G, U);
|
|
555
555
|
}
|
|
556
556
|
},
|
|
557
557
|
[ie, Ae]
|
|
558
558
|
), Xe = w((m) => {
|
|
559
|
-
|
|
560
|
-
const v =
|
|
561
|
-
M !== void 0 &&
|
|
559
|
+
F.current?.scrollToPath(m, { align: "nearest" }), requestAnimationFrame(() => {
|
|
560
|
+
const v = W.current, M = v === null ? void 0 : kt(v, m);
|
|
561
|
+
M !== void 0 && gt(M);
|
|
562
562
|
});
|
|
563
|
-
}, []),
|
|
563
|
+
}, []), Bt = w(
|
|
564
564
|
(m) => {
|
|
565
565
|
if (ve(m)) {
|
|
566
|
-
Xe(
|
|
566
|
+
Xe(Qn(m));
|
|
567
567
|
return;
|
|
568
568
|
}
|
|
569
569
|
ge([m], !K.current.shownExpanded(m)), K.current.isExpanded(m) ? oe([m]) : K.current.unloadedFolders.has(m) && le(m), fe(m);
|
|
@@ -575,7 +575,7 @@ const Xn = /* @__PURE__ */ h.forwardRef(Gn), Ke = Ce(!0), St = Ce(null), Tt = "\
|
|
|
575
575
|
v.length !== 0 && (ge(v, !1), oe(v), me(v));
|
|
576
576
|
},
|
|
577
577
|
[ge, oe, me]
|
|
578
|
-
),
|
|
578
|
+
), $t = w(
|
|
579
579
|
(m) => {
|
|
580
580
|
const v = m.filter((M) => !ve(M));
|
|
581
581
|
if (v.length !== 0) {
|
|
@@ -589,7 +589,7 @@ const Xn = /* @__PURE__ */ h.forwardRef(Gn), Ke = Ce(!0), St = Ce(null), Tt = "\
|
|
|
589
589
|
[ge, j, Me]
|
|
590
590
|
), Ye = w(
|
|
591
591
|
(m) => /* @__PURE__ */ d(
|
|
592
|
-
|
|
592
|
+
Mr,
|
|
593
593
|
{
|
|
594
594
|
name: m.name,
|
|
595
595
|
onRetry: () => {
|
|
@@ -598,73 +598,73 @@ const Xn = /* @__PURE__ */ h.forwardRef(Gn), Ke = Ce(!0), St = Ce(null), Tt = "\
|
|
|
598
598
|
}
|
|
599
599
|
),
|
|
600
600
|
[N, r, le, j]
|
|
601
|
-
), Qe = n === "multi" ? l :
|
|
602
|
-
|
|
601
|
+
), Qe = n === "multi" ? l : Lr, { loopFolderName: Je } = y, Oe = I(() => he(e, { openPaths: Qe, childrenOf: ae, renderFailedFolder: Ye, loopFolderName: Je }), [he, e, Qe, ae, Ye, Je, t]), et = E(Oe);
|
|
602
|
+
$(() => {
|
|
603
603
|
et.current = Oe;
|
|
604
604
|
}, [Oe]);
|
|
605
|
-
const
|
|
605
|
+
const Zt = en(k, Cr), tt = E([]), Ne = w(() => {
|
|
606
606
|
for (const m of tt.current) K.current.unloadedFolders.has(m) && le(m);
|
|
607
607
|
}, [le]), { maxDepth: _e } = _.revealDocument, nt = E(i);
|
|
608
|
-
|
|
608
|
+
$(() => {
|
|
609
609
|
nt.current = i;
|
|
610
610
|
}, [i]);
|
|
611
|
-
const
|
|
611
|
+
const zt = I(
|
|
612
612
|
() => ({
|
|
613
613
|
ancestors: async (m, v) => {
|
|
614
|
-
const M =
|
|
614
|
+
const M = A.take(r, m);
|
|
615
615
|
if (M !== null) return M;
|
|
616
|
-
if (!
|
|
617
|
-
const
|
|
618
|
-
return
|
|
616
|
+
if (!A.mayMove(m)) {
|
|
617
|
+
const G = await L.ancestors(r, m, v);
|
|
618
|
+
return G.status !== "ok" || G.ancestors === null || G.ancestors.length > _e ? null : G.ancestors;
|
|
619
619
|
}
|
|
620
|
-
const U = await
|
|
621
|
-
return U.status !== "ok" || U.source === null || U.ancestors.length > _e ? null : U.source === r ? U.ancestors : (v.aborted || !
|
|
620
|
+
const U = await L.reveal(r, m, v);
|
|
621
|
+
return U.status !== "ok" || U.source === null || U.ancestors.length > _e ? null : U.source === r ? U.ancestors : (v.aborted || !R.some((G) => G.id === U.source) || (A.move(U.source, m, U.ancestors), nt.current(U.source)), null);
|
|
622
622
|
},
|
|
623
623
|
open: (m) => {
|
|
624
624
|
tt.current = m ?? [], m !== null && (Ne(), j([...m]));
|
|
625
625
|
},
|
|
626
|
-
progress: (m, v) =>
|
|
626
|
+
progress: (m, v) => or(K.current.entries, m, v, { isShownExpanded: K.current.shownExpanded, childrenOf: K.current.childrenOf })
|
|
627
627
|
}),
|
|
628
|
-
[
|
|
628
|
+
[L, r, R, A, _e, Ne, j]
|
|
629
629
|
);
|
|
630
630
|
Z(() => Ne(), [Ne, se]);
|
|
631
|
-
const
|
|
632
|
-
|
|
633
|
-
const rt = w((m) => Se.has(m), [Se]), Le = I(() =>
|
|
634
|
-
|
|
631
|
+
const Vt = I(() => [e, t, Y], [e, t, Y]), jt = w((m) => W.current === null ? Number.POSITIVE_INFINITY : Rr(W.current, m), []);
|
|
632
|
+
xr({ tree: F, container: W, path: s.path, chain: s.openFolders ? zt : null, rows: Vt, cancel: S, displayed: B, placement: jt });
|
|
633
|
+
const rt = w((m) => Se.has(m), [Se]), Le = I(() => rr(e, { isShownExpanded: ce, childrenOf: ae, compare: te, isDirect: rt }), [e, ce, ae, te, rt, t]), ke = B && g;
|
|
634
|
+
$(() => {
|
|
635
635
|
p(e);
|
|
636
|
-
}, [e, p]),
|
|
637
|
-
ke && be && Ee({ entries: e, isShownExpanded: ce, childrenOf: ae, compare: te, expanded:
|
|
638
|
-
}, [ke, be, Ee, e, ce, ae, te,
|
|
639
|
-
const
|
|
636
|
+
}, [e, p]), $(() => () => p(null), [p]), Z(() => N.claimChildren(r, ke ? Le.folders : kr), [N, r, ke, Le]), Z(() => Te(se), [Te, se]), Z(() => {
|
|
637
|
+
ke && be && Ee({ entries: e, isShownExpanded: ce, childrenOf: ae, compare: te, expanded: Y, waiting: Le.waiting, expansionPending: P });
|
|
638
|
+
}, [ke, be, Ee, e, ce, ae, te, Y, Le, P]);
|
|
639
|
+
const Kt = w(
|
|
640
640
|
(m) => {
|
|
641
641
|
const v = m.entry.absolutePath, { folderSelection: M, openDocument: U } = K.current;
|
|
642
642
|
if (m.isDirectory) {
|
|
643
643
|
if (M === null || ve(v)) return;
|
|
644
|
-
const
|
|
644
|
+
const G = v === M.current, lt = ar(et.current, K.current.entries, m.entry);
|
|
645
645
|
if (K.current.isHeld(v)) {
|
|
646
|
-
m.preventDefault(), ie.delete(v),
|
|
646
|
+
m.preventDefault(), ie.delete(v), G ? Ae(M, lt) : Pe(M, v);
|
|
647
647
|
return;
|
|
648
648
|
}
|
|
649
|
-
ie.set(v, lt), m.isExpanded ||
|
|
649
|
+
ie.set(v, lt), m.isExpanded || G || Pe(M, v);
|
|
650
650
|
return;
|
|
651
651
|
}
|
|
652
|
-
|
|
652
|
+
A.settle(v), U(v);
|
|
653
653
|
},
|
|
654
|
-
[
|
|
655
|
-
),
|
|
654
|
+
[A, ie, Ae, Pe]
|
|
655
|
+
), Ut = w(
|
|
656
656
|
(m) => {
|
|
657
657
|
if (m.key !== "ArrowLeft" && m.key !== "ArrowRight") return;
|
|
658
|
-
const v =
|
|
658
|
+
const v = Ft(m.target), M = v === null ? null : v.getAttribute(de);
|
|
659
659
|
M !== null && ie.delete(M);
|
|
660
660
|
},
|
|
661
661
|
[ie]
|
|
662
|
-
), { onChange: Ie } = a,
|
|
662
|
+
), { onChange: Ie } = a, Wt = I(
|
|
663
663
|
() => Ie === null ? void 0 : (m, v) => {
|
|
664
664
|
ve(m.absolutePath) || Ie({ path: m.absolutePath, name: m.name, selected: v });
|
|
665
665
|
},
|
|
666
666
|
[Ie]
|
|
667
|
-
),
|
|
667
|
+
), Gt = I(() => new Set(a.items), [a.items]), Xt = I(
|
|
668
668
|
() => ({
|
|
669
669
|
entryKindDirectory: y.treeEntryKindDirectory,
|
|
670
670
|
entryKindFile: y.treeEntryKindFile,
|
|
@@ -674,48 +674,48 @@ const Xn = /* @__PURE__ */ h.forwardRef(Gn), Ke = Ce(!0), St = Ce(null), Tt = "\
|
|
|
674
674
|
scrollToBottom: y.treeScrollToBottom
|
|
675
675
|
}),
|
|
676
676
|
[y]
|
|
677
|
-
),
|
|
678
|
-
return /* @__PURE__ */
|
|
679
|
-
/* @__PURE__ */ d("span", { ref:
|
|
677
|
+
), Yt = ee === null ? { showTreeLines: !1 } : { showTreeLines: o.lines, lineColor: ee };
|
|
678
|
+
return /* @__PURE__ */ C("div", { ref: W, className: "aqmx-explorer-tree", "data-testid": "markdown-explorer-tree", onKeyDownCapture: Ut, ...Zt, children: [
|
|
679
|
+
/* @__PURE__ */ d("span", { ref: X, className: "aqmx-explorer-tree-probe", "aria-hidden": "true", [vr]: "" }),
|
|
680
680
|
/* @__PURE__ */ d(
|
|
681
|
-
|
|
681
|
+
Nn,
|
|
682
682
|
{
|
|
683
|
-
ref:
|
|
683
|
+
ref: F,
|
|
684
684
|
entries: Oe,
|
|
685
685
|
expansion: {
|
|
686
|
-
toggle:
|
|
686
|
+
toggle: Bt,
|
|
687
687
|
isExpanded: ce,
|
|
688
|
-
expandMultiple:
|
|
688
|
+
expandMultiple: $t,
|
|
689
689
|
collapseMultiple: Me,
|
|
690
|
-
isPending:
|
|
690
|
+
isPending: P && !be,
|
|
691
691
|
doubleClickAction: o.doubleClickAction
|
|
692
692
|
},
|
|
693
|
-
selection: { mode: a.mode, selectedPath: a.shownPath, currentPath: a.shownPath, selectedItems:
|
|
693
|
+
selection: { mode: a.mode, selectedPath: a.shownPath, currentPath: a.shownPath, selectedItems: Gt, onEntryClick: Kt, onSelectionChange: Wt },
|
|
694
694
|
visual: {
|
|
695
695
|
className: "aqmx-explorer-tree-view",
|
|
696
696
|
ariaLabel: y.treeRegion,
|
|
697
|
-
...
|
|
697
|
+
...Yt,
|
|
698
698
|
showExpandIcons: o.expandIcons,
|
|
699
|
-
expandIconStyle:
|
|
699
|
+
expandIconStyle: Fr,
|
|
700
700
|
showDirectoryIcons: o.directoryIcons,
|
|
701
701
|
showFileIcons: o.fileIcons,
|
|
702
702
|
expandIconSize: o.expandIconSize,
|
|
703
703
|
itemHeight: ue,
|
|
704
704
|
removeRootIndent: o.removeRootIndent,
|
|
705
|
-
highlightStyles:
|
|
706
|
-
entryStyle:
|
|
707
|
-
nameStyle:
|
|
705
|
+
highlightStyles: Ar,
|
|
706
|
+
entryStyle: Nr,
|
|
707
|
+
nameStyle: Or
|
|
708
708
|
},
|
|
709
709
|
virtualScroll: pe,
|
|
710
|
-
sort:
|
|
711
|
-
locale:
|
|
712
|
-
labels:
|
|
710
|
+
sort: Ht,
|
|
711
|
+
locale: z,
|
|
712
|
+
labels: Xt
|
|
713
713
|
}
|
|
714
714
|
)
|
|
715
715
|
] });
|
|
716
|
-
},
|
|
717
|
-
const { labels: n } =
|
|
718
|
-
|
|
716
|
+
}, Ir = ({ pending: e, status: t }) => {
|
|
717
|
+
const { labels: n } = D(), r = t.state !== "running", [o, s] = q(0), l = E(!0);
|
|
718
|
+
$(() => {
|
|
719
719
|
const f = l.current;
|
|
720
720
|
if (l.current = r, !r || e > 0 && !f) {
|
|
721
721
|
s(0);
|
|
@@ -730,40 +730,40 @@ const Xn = /* @__PURE__ */ h.forwardRef(Gn), Ke = Ce(!0), St = Ce(null), Tt = "\
|
|
|
730
730
|
return () => clearTimeout(u);
|
|
731
731
|
}, [r, e, o]);
|
|
732
732
|
const a = r && e === 0 ? o : e;
|
|
733
|
-
return a === 0 && r ? null : /* @__PURE__ */
|
|
733
|
+
return a === 0 && r ? null : /* @__PURE__ */ C("p", { className: "aqmx-explorer-tree-progress", "data-testid": "markdown-explorer-tree-progress", "data-aqmx-loading": String(a), "data-aqmx-expand-all": t.state, children: [
|
|
734
734
|
a > 0 ? /* @__PURE__ */ d(ze, { className: "aqmx-explorer-tree-progress-icon", "aria-hidden": "true" }) : null,
|
|
735
735
|
/* @__PURE__ */ d("span", { children: t.state === "running" ? n.expandAllProgress(t.opened, a) : n.foldersLoading(a) })
|
|
736
736
|
] });
|
|
737
|
-
},
|
|
738
|
-
const { labels: r } =
|
|
739
|
-
return /* @__PURE__ */ d("p", { className: "aqmx-explorer-expand-all-stop", "data-testid": "markdown-explorer-expand-all-stop", "data-aqmx-stop": e, children:
|
|
740
|
-
},
|
|
741
|
-
const { trees: n } =
|
|
742
|
-
return l.length === 0 ? /* @__PURE__ */ d(
|
|
743
|
-
},
|
|
744
|
-
const { renderTreeFailure: r } =
|
|
737
|
+
}, Dr = ({ stop: e, opened: t, budget: n }) => {
|
|
738
|
+
const { labels: r } = D();
|
|
739
|
+
return /* @__PURE__ */ d("p", { className: "aqmx-explorer-expand-all-stop", "data-testid": "markdown-explorer-expand-all-stop", "data-aqmx-stop": e, children: Ct(r, n, e, t) });
|
|
740
|
+
}, Hr = ({ entries: e, ...t }) => {
|
|
741
|
+
const { trees: n } = D(), r = je(n.subscribe, n.version, n.version), { sourceId: o } = t, [s] = q(Xn), l = I(() => s(e, (a) => n.children(o, a)), [s, e, n, o, r]);
|
|
742
|
+
return l.length === 0 ? /* @__PURE__ */ d(Pr, {}) : /* @__PURE__ */ d(_r, { entries: l, version: r, ...t });
|
|
743
|
+
}, Br = ({ result: e, onRetry: t, ...n }) => {
|
|
744
|
+
const { renderTreeFailure: r } = D(), o = Re(e);
|
|
745
745
|
if (o.status === "deferred") return /* @__PURE__ */ d(qt, {});
|
|
746
|
-
if (o.status === "ok") return /* @__PURE__ */ d(
|
|
746
|
+
if (o.status === "ok") return /* @__PURE__ */ d(Hr, { entries: o.entries, ...n });
|
|
747
747
|
const s = r?.(o.failure);
|
|
748
|
-
return /* @__PURE__ */ d("div", { className: "aqmx-explorer-tree-message", "data-testid": "markdown-explorer-tree-failure", "data-aqmx-failure": o.failure.reason, children: s !== void 0 ? s : /* @__PURE__ */ d(
|
|
749
|
-
},
|
|
750
|
-
const { trees: n, storageNamespace: r, labels: o, announcer: s, config: l } =
|
|
748
|
+
return /* @__PURE__ */ d("div", { className: "aqmx-explorer-tree-message", "data-testid": "markdown-explorer-tree-failure", "data-aqmx-failure": o.failure.reason, children: s !== void 0 ? s : /* @__PURE__ */ d(Qt, { failure: o.failure, alert: !0, onRetry: t, testId: null }) });
|
|
749
|
+
}, $r = Object.freeze([]), Zr = (e) => e !== void 0 && e.status === "failed" && Ze(e.failure.reason), zr = ({ failure: e, onRetry: t }) => /* @__PURE__ */ d(wt, { failure: e, place: "read", deniedSentence: null, retry: t, testId: "markdown-explorer-folder-access-failure" }), Vr = ({ onControls: e, ...t }) => {
|
|
750
|
+
const { trees: n, storageNamespace: r, labels: o, announcer: s, config: l } = D(), { sourceId: a } = t, f = On({ storageKey: Fn(r).treeExpansion(a) });
|
|
751
751
|
je(n.subscribe, n.version, n.version);
|
|
752
752
|
const u = n.read(a), i = w(() => n.retry(a), [n, a]);
|
|
753
|
-
|
|
754
|
-
const c =
|
|
755
|
-
|
|
756
|
-
|
|
753
|
+
$(() => n.open(a), [n, a]);
|
|
754
|
+
const c = dr(), { expanded: p, expandMultiple: x, collapseAll: g } = f, [b, S] = q(null), N = b !== p, k = E(p);
|
|
755
|
+
$(() => {
|
|
756
|
+
k.current = p;
|
|
757
757
|
}, [p]);
|
|
758
|
-
const y = l.expandAll,
|
|
759
|
-
|
|
760
|
-
}, []), [
|
|
758
|
+
const y = l.expandAll, z = w(() => s.announce(o.expandAllStarted), [s, o]), H = w((P) => s.announce(qr(o, y, P)), [s, o, y]), T = hr({ budget: y, expandMultiple: x, onStart: z, onFinish: H }), { status: L, start: _, end: R, advance: A } = T, B = L.state === "running", O = I(() => ({ running: B, advance: A }), [B, A]), V = E(null), [J, pe] = q(!1), he = w((P) => {
|
|
759
|
+
V.current = P, pe(P !== null);
|
|
760
|
+
}, []), [X, ue] = q(null);
|
|
761
761
|
Z(
|
|
762
|
-
() => n.subscribeChildrenFailures((
|
|
763
|
-
const re =
|
|
762
|
+
() => n.subscribeChildrenFailures((P) => {
|
|
763
|
+
const re = P.sourceId === a && V.current !== null ? At(V.current, P.path) : null;
|
|
764
764
|
if (re !== null) {
|
|
765
|
-
if (Ze(
|
|
766
|
-
ue((
|
|
765
|
+
if (Ze(P.failure.reason)) {
|
|
766
|
+
ue((Q) => Q === null ? { failure: P.failure, paths: [P.path] } : Q.paths.includes(P.path) ? Q : { failure: Q.failure, paths: [...Q.paths, P.path] });
|
|
767
767
|
return;
|
|
768
768
|
}
|
|
769
769
|
s.announce({ list: o.foldersLoadFailedNamed, item: re.name });
|
|
@@ -771,27 +771,27 @@ const Xn = /* @__PURE__ */ h.forwardRef(Gn), Ke = Ce(!0), St = Ce(null), Tt = "\
|
|
|
771
771
|
}),
|
|
772
772
|
[n, a, s, o]
|
|
773
773
|
);
|
|
774
|
-
const ee =
|
|
775
|
-
|
|
774
|
+
const ee = X === null ? $r : X.paths.filter((P) => Zr(n.children(a, P)));
|
|
775
|
+
X !== null && ee.length === 0 && ue(null);
|
|
776
776
|
const ne = () => {
|
|
777
|
-
for (const
|
|
778
|
-
}, { clearDirect: fe } = c, [j, me] =
|
|
779
|
-
me((
|
|
780
|
-
}, [
|
|
777
|
+
for (const P of ee) n.retryChildren(a, P);
|
|
778
|
+
}, { clearDirect: fe } = c, [j, me] = q(0), Y = w(() => {
|
|
779
|
+
me((P) => P + 1), R(), fe(), S(k.current), g();
|
|
780
|
+
}, [R, fe, g]);
|
|
781
781
|
return Z(() => {
|
|
782
|
-
e({ collapseAll:
|
|
783
|
-
}, [e,
|
|
784
|
-
|
|
785
|
-
}, [
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
/* @__PURE__ */
|
|
789
|
-
/* @__PURE__ */ d(
|
|
790
|
-
/* @__PURE__ */ d(
|
|
782
|
+
e({ collapseAll: Y, expandAll: J ? _ : null, expanding: B });
|
|
783
|
+
}, [e, Y, _, J, B]), Z(() => () => e(null), [e]), Z(() => {
|
|
784
|
+
J || R();
|
|
785
|
+
}, [J, R]), /* @__PURE__ */ C(mt, { children: [
|
|
786
|
+
X === null || ee.length === 0 ? null : /* @__PURE__ */ d(zr, { failure: X.failure, onRetry: ne }),
|
|
787
|
+
L.state === "stopped" ? /* @__PURE__ */ d(Dr, { stop: L.stop, opened: L.opened, budget: y }) : null,
|
|
788
|
+
/* @__PURE__ */ C("div", { className: "aqmx-explorer-tree-area", children: [
|
|
789
|
+
/* @__PURE__ */ d(bt, { fallback: /* @__PURE__ */ d(qt, {}), children: /* @__PURE__ */ d(Br, { result: u, onRetry: i, expansion: f, onShown: he, marks: c, claimsHeld: N, expandAll: O, revealCancel: j, ...t }) }),
|
|
790
|
+
/* @__PURE__ */ d(Ir, { pending: n.pendingChildren(a), status: L })
|
|
791
791
|
] })
|
|
792
792
|
] });
|
|
793
793
|
};
|
|
794
|
-
function
|
|
794
|
+
function jr({
|
|
795
795
|
title: e,
|
|
796
796
|
titleId: t,
|
|
797
797
|
...n
|
|
@@ -812,8 +812,8 @@ function Kr({
|
|
|
812
812
|
clipRule: "evenodd"
|
|
813
813
|
}));
|
|
814
814
|
}
|
|
815
|
-
const Ue = /* @__PURE__ */ h.forwardRef(
|
|
816
|
-
const { labels: s } =
|
|
815
|
+
const Ue = /* @__PURE__ */ h.forwardRef(jr), ft = "markdown-explorer-selection-remove", Kr = ({ selection: e, onRemove: t, onClear: n, onOpenSelection: r, onLeave: o }) => {
|
|
816
|
+
const { labels: s } = D(), l = qe(), a = E(null), f = [...e], u = (c, p) => {
|
|
817
817
|
if (p.ownerDocument.activeElement === p) {
|
|
818
818
|
const x = a.current === null ? [] : [...a.current.querySelectorAll(`[data-testid="${ft}"]`)], g = x.indexOf(p), b = [x[g + 1], x[g - 1]].find((S) => S !== void 0);
|
|
819
819
|
b === void 0 ? o() : b.focus();
|
|
@@ -823,12 +823,12 @@ const Ue = /* @__PURE__ */ h.forwardRef(Kr), ft = "markdown-explorer-selection-r
|
|
|
823
823
|
const c = a.current;
|
|
824
824
|
c !== null && c.contains(c.ownerDocument.activeElement) && o(), n();
|
|
825
825
|
};
|
|
826
|
-
return /* @__PURE__ */
|
|
827
|
-
/* @__PURE__ */
|
|
826
|
+
return /* @__PURE__ */ C("section", { ref: a, className: "aqmx-explorer-tray", "aria-labelledby": l, "data-testid": "markdown-explorer-selection-tray", children: [
|
|
827
|
+
/* @__PURE__ */ C("div", { className: "aqmx-explorer-tray-header", children: [
|
|
828
828
|
/* @__PURE__ */ d("p", { id: l, className: "aqmx-explorer-tray-title", children: s.selectionTitle(f.length) }),
|
|
829
829
|
/* @__PURE__ */ d("button", { type: "button", className: "aqmx-explorer-tray-button", "data-testid": "markdown-explorer-selection-clear", onClick: i, children: s.clearSelection })
|
|
830
830
|
] }),
|
|
831
|
-
/* @__PURE__ */ d("ul", { className: "aqmx-explorer-tray-list", children: f.map(([c, p]) => /* @__PURE__ */
|
|
831
|
+
/* @__PURE__ */ d("ul", { className: "aqmx-explorer-tray-list", children: f.map(([c, p]) => /* @__PURE__ */ C("li", { className: "aqmx-explorer-tray-item", children: [
|
|
832
832
|
/* @__PURE__ */ d("span", { className: "aqmx-explorer-tray-name", title: c, children: p }),
|
|
833
833
|
/* @__PURE__ */ d(
|
|
834
834
|
"button",
|
|
@@ -846,22 +846,22 @@ const Ue = /* @__PURE__ */ h.forwardRef(Kr), ft = "markdown-explorer-selection-r
|
|
|
846
846
|
] }, c)) }),
|
|
847
847
|
r === void 0 ? null : /* @__PURE__ */ d("button", { type: "button", className: "aqmx-explorer-tray-open", "data-testid": "markdown-explorer-selection-open", onClick: () => r(f.map(([c]) => c)), children: s.openSelectionInMulti(f.length) })
|
|
848
848
|
] });
|
|
849
|
-
}, He = /* @__PURE__ */ new Map(),
|
|
849
|
+
}, He = /* @__PURE__ */ new Map(), Ur = (e, t) => {
|
|
850
850
|
if (t.selected === e.has(t.path)) return e;
|
|
851
851
|
const n = new Map(e);
|
|
852
852
|
return t.selected ? n.set(t.path, t.name) : n.delete(t.path), n;
|
|
853
|
-
},
|
|
853
|
+
}, Wr = (e, t) => {
|
|
854
854
|
if (!e.has(t)) return e;
|
|
855
855
|
const n = new Map(e);
|
|
856
856
|
return n.delete(t), n;
|
|
857
|
-
},
|
|
858
|
-
const t =
|
|
859
|
-
|
|
857
|
+
}, Pt = Ce(null), Gr = (e) => {
|
|
858
|
+
const t = Re(Pt);
|
|
859
|
+
$(() => {
|
|
860
860
|
if (t !== null)
|
|
861
861
|
return t(e), () => t(!1);
|
|
862
862
|
}, [t, e]);
|
|
863
863
|
};
|
|
864
|
-
function
|
|
864
|
+
function Xr({
|
|
865
865
|
title: e,
|
|
866
866
|
titleId: t,
|
|
867
867
|
...n
|
|
@@ -882,8 +882,8 @@ function Yr({
|
|
|
882
882
|
clipRule: "evenodd"
|
|
883
883
|
}));
|
|
884
884
|
}
|
|
885
|
-
const
|
|
886
|
-
function
|
|
885
|
+
const Yr = /* @__PURE__ */ h.forwardRef(Xr);
|
|
886
|
+
function Qr({
|
|
887
887
|
title: e,
|
|
888
888
|
titleId: t,
|
|
889
889
|
...n
|
|
@@ -902,8 +902,8 @@ function Jr({
|
|
|
902
902
|
d: "M11.25 4.533A9.707 9.707 0 0 0 6 3a9.735 9.735 0 0 0-3.25.555.75.75 0 0 0-.5.707v14.25a.75.75 0 0 0 1 .707A8.237 8.237 0 0 1 6 18.75c1.995 0 3.823.707 5.25 1.886V4.533ZM12.75 20.636A8.214 8.214 0 0 1 18 18.75c.966 0 1.89.166 2.75.47a.75.75 0 0 0 1-.708V4.262a.75.75 0 0 0-.5-.707A9.735 9.735 0 0 0 18 3a9.707 9.707 0 0 0-5.25 1.533v16.103Z"
|
|
903
903
|
}));
|
|
904
904
|
}
|
|
905
|
-
const
|
|
906
|
-
function
|
|
905
|
+
const Jr = /* @__PURE__ */ h.forwardRef(Qr);
|
|
906
|
+
function el({
|
|
907
907
|
title: e,
|
|
908
908
|
titleId: t,
|
|
909
909
|
...n
|
|
@@ -924,8 +924,8 @@ function tl({
|
|
|
924
924
|
clipRule: "evenodd"
|
|
925
925
|
}));
|
|
926
926
|
}
|
|
927
|
-
const
|
|
928
|
-
function
|
|
927
|
+
const tl = /* @__PURE__ */ h.forwardRef(el);
|
|
928
|
+
function nl({
|
|
929
929
|
title: e,
|
|
930
930
|
titleId: t,
|
|
931
931
|
...n
|
|
@@ -946,8 +946,8 @@ function rl({
|
|
|
946
946
|
clipRule: "evenodd"
|
|
947
947
|
}));
|
|
948
948
|
}
|
|
949
|
-
const
|
|
950
|
-
function
|
|
949
|
+
const rl = /* @__PURE__ */ h.forwardRef(nl);
|
|
950
|
+
function ll({
|
|
951
951
|
title: e,
|
|
952
952
|
titleId: t,
|
|
953
953
|
...n
|
|
@@ -968,8 +968,8 @@ function al({
|
|
|
968
968
|
clipRule: "evenodd"
|
|
969
969
|
}));
|
|
970
970
|
}
|
|
971
|
-
const
|
|
972
|
-
function
|
|
971
|
+
const al = /* @__PURE__ */ h.forwardRef(ll);
|
|
972
|
+
function ol({
|
|
973
973
|
title: e,
|
|
974
974
|
titleId: t,
|
|
975
975
|
...n
|
|
@@ -990,8 +990,8 @@ function sl({
|
|
|
990
990
|
clipRule: "evenodd"
|
|
991
991
|
}));
|
|
992
992
|
}
|
|
993
|
-
const
|
|
994
|
-
function
|
|
993
|
+
const sl = /* @__PURE__ */ h.forwardRef(ol);
|
|
994
|
+
function cl({
|
|
995
995
|
title: e,
|
|
996
996
|
titleId: t,
|
|
997
997
|
...n
|
|
@@ -1012,8 +1012,8 @@ function il({
|
|
|
1012
1012
|
clipRule: "evenodd"
|
|
1013
1013
|
}));
|
|
1014
1014
|
}
|
|
1015
|
-
const
|
|
1016
|
-
function
|
|
1015
|
+
const il = /* @__PURE__ */ h.forwardRef(cl);
|
|
1016
|
+
function dl({
|
|
1017
1017
|
title: e,
|
|
1018
1018
|
titleId: t,
|
|
1019
1019
|
...n
|
|
@@ -1036,8 +1036,8 @@ function ul({
|
|
|
1036
1036
|
d: "M12.971 1.816A5.23 5.23 0 0 1 14.25 5.25v1.875c0 .207.168.375.375.375H16.5a5.23 5.23 0 0 1 3.434 1.279 9.768 9.768 0 0 0-6.963-6.963Z"
|
|
1037
1037
|
}));
|
|
1038
1038
|
}
|
|
1039
|
-
const
|
|
1040
|
-
function
|
|
1039
|
+
const ul = /* @__PURE__ */ h.forwardRef(dl);
|
|
1040
|
+
function fl({
|
|
1041
1041
|
title: e,
|
|
1042
1042
|
titleId: t,
|
|
1043
1043
|
...n
|
|
@@ -1056,8 +1056,8 @@ function pl({
|
|
|
1056
1056
|
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"
|
|
1057
1057
|
}));
|
|
1058
1058
|
}
|
|
1059
|
-
const
|
|
1060
|
-
function
|
|
1059
|
+
const pl = /* @__PURE__ */ h.forwardRef(fl);
|
|
1060
|
+
function hl({
|
|
1061
1061
|
title: e,
|
|
1062
1062
|
titleId: t,
|
|
1063
1063
|
...n
|
|
@@ -1076,8 +1076,8 @@ function ml({
|
|
|
1076
1076
|
d: "M19.906 9c.382 0 .749.057 1.094.162V9a3 3 0 0 0-3-3h-3.879a.75.75 0 0 1-.53-.22L11.47 3.66A2.25 2.25 0 0 0 9.879 3H6a3 3 0 0 0-3 3v3.162A3.756 3.756 0 0 1 4.094 9h15.812ZM4.094 10.5a2.25 2.25 0 0 0-2.227 2.568l.857 6A2.25 2.25 0 0 0 4.951 21H19.05a2.25 2.25 0 0 0 2.227-1.932l.857-6a2.25 2.25 0 0 0-2.227-2.568H4.094Z"
|
|
1077
1077
|
}));
|
|
1078
1078
|
}
|
|
1079
|
-
const
|
|
1080
|
-
function
|
|
1079
|
+
const ml = /* @__PURE__ */ h.forwardRef(hl);
|
|
1080
|
+
function xl({
|
|
1081
1081
|
title: e,
|
|
1082
1082
|
titleId: t,
|
|
1083
1083
|
...n
|
|
@@ -1098,8 +1098,8 @@ function wl({
|
|
|
1098
1098
|
clipRule: "evenodd"
|
|
1099
1099
|
}));
|
|
1100
1100
|
}
|
|
1101
|
-
const
|
|
1102
|
-
function
|
|
1101
|
+
const wl = /* @__PURE__ */ h.forwardRef(xl);
|
|
1102
|
+
function gl({
|
|
1103
1103
|
title: e,
|
|
1104
1104
|
titleId: t,
|
|
1105
1105
|
...n
|
|
@@ -1122,8 +1122,8 @@ function vl({
|
|
|
1122
1122
|
d: "M18.75 6.75h1.875c.621 0 1.125.504 1.125 1.125V18a1.5 1.5 0 0 1-3 0V6.75Z"
|
|
1123
1123
|
}));
|
|
1124
1124
|
}
|
|
1125
|
-
const
|
|
1126
|
-
function
|
|
1125
|
+
const vl = /* @__PURE__ */ h.forwardRef(gl);
|
|
1126
|
+
function bl({
|
|
1127
1127
|
title: e,
|
|
1128
1128
|
titleId: t,
|
|
1129
1129
|
...n
|
|
@@ -1142,27 +1142,27 @@ function El({
|
|
|
1142
1142
|
d: "M5.625 3.75a2.625 2.625 0 1 0 0 5.25h12.75a2.625 2.625 0 0 0 0-5.25H5.625ZM3.75 11.25a.75.75 0 0 0 0 1.5h16.5a.75.75 0 0 0 0-1.5H3.75ZM3 15.75a.75.75 0 0 1 .75-.75h16.5a.75.75 0 0 1 0 1.5H3.75a.75.75 0 0 1-.75-.75ZM3.75 18.75a.75.75 0 0 0 0 1.5h16.5a.75.75 0 0 0 0-1.5H3.75Z"
|
|
1143
1143
|
}));
|
|
1144
1144
|
}
|
|
1145
|
-
const
|
|
1146
|
-
sortMode:
|
|
1147
|
-
folderPlacement:
|
|
1148
|
-
readmePlacement:
|
|
1149
|
-
selectionMode:
|
|
1150
|
-
doubleClickAction:
|
|
1151
|
-
expandIconSize:
|
|
1145
|
+
const El = /* @__PURE__ */ h.forwardRef(bl), yl = Object.freeze({
|
|
1146
|
+
sortMode: Yr,
|
|
1147
|
+
folderPlacement: pl,
|
|
1148
|
+
readmePlacement: Jr,
|
|
1149
|
+
selectionMode: tl,
|
|
1150
|
+
doubleClickAction: il,
|
|
1151
|
+
expandIconSize: wl,
|
|
1152
1152
|
alwaysExpanded: ln,
|
|
1153
1153
|
revealDocument: rn,
|
|
1154
|
-
showFolderReadme:
|
|
1155
|
-
removeRootIndent:
|
|
1156
|
-
lines:
|
|
1157
|
-
expandIcons:
|
|
1158
|
-
directoryIcons:
|
|
1159
|
-
fileIcons:
|
|
1160
|
-
}),
|
|
1154
|
+
showFolderReadme: vl,
|
|
1155
|
+
removeRootIndent: rl,
|
|
1156
|
+
lines: El,
|
|
1157
|
+
expandIcons: al,
|
|
1158
|
+
directoryIcons: ml,
|
|
1159
|
+
fileIcons: ul
|
|
1160
|
+
}), Mt = (e, t) => {
|
|
1161
1161
|
const n = e[t.labelKey];
|
|
1162
1162
|
if (typeof n != "string") throw new TypeError(`[markdown-explorer] the tree setting ${t.key} must name a string label; labels.${t.labelKey} is ${yt(n)}`);
|
|
1163
1163
|
return n;
|
|
1164
|
-
},
|
|
1165
|
-
const { labels: l } =
|
|
1164
|
+
}, Rl = ({ id: e, settings: t, descriptors: n, onAdvance: r, onClose: o, ref: s }) => {
|
|
1165
|
+
const { labels: l } = D(), a = E([]);
|
|
1166
1166
|
Z(() => {
|
|
1167
1167
|
a.current[0]?.focus();
|
|
1168
1168
|
}, []);
|
|
@@ -1198,8 +1198,8 @@ const Rl = /* @__PURE__ */ h.forwardRef(El), yl = Object.freeze({
|
|
|
1198
1198
|
[n.length, f, o]
|
|
1199
1199
|
);
|
|
1200
1200
|
return /* @__PURE__ */ d("div", { ref: s, id: e, role: "menu", "aria-label": l.treeSettings, className: "aqmx-explorer-menu", "data-testid": "markdown-explorer-tree-settings-menu", children: n.map((i, c) => {
|
|
1201
|
-
const p = yl[i.key], x =
|
|
1202
|
-
return /* @__PURE__ */
|
|
1201
|
+
const p = yl[i.key], x = Mt(l, i), g = Et(l, t, i.key), b = t[i.key], S = typeof b == "boolean" ? { role: "menuitemcheckbox", "aria-checked": b, "aria-label": x } : { role: "menuitem", "aria-label": `${x}: ${g}` };
|
|
1202
|
+
return /* @__PURE__ */ C(
|
|
1203
1203
|
"button",
|
|
1204
1204
|
{
|
|
1205
1205
|
ref: (N) => {
|
|
@@ -1223,8 +1223,8 @@ const Rl = /* @__PURE__ */ h.forwardRef(El), yl = Object.freeze({
|
|
|
1223
1223
|
i.key
|
|
1224
1224
|
);
|
|
1225
1225
|
}) });
|
|
1226
|
-
},
|
|
1227
|
-
const { labels: r, announcer: o } =
|
|
1226
|
+
}, Sl = ({ settings: e, descriptors: t, onAdvance: n }) => {
|
|
1227
|
+
const { labels: r, announcer: o } = D(), [s, l] = q(!1), a = E(null), f = E(null), u = E(null), i = qe(), c = w(() => {
|
|
1228
1228
|
a.current?.focus(), l(!1);
|
|
1229
1229
|
}, []);
|
|
1230
1230
|
Z(() => {
|
|
@@ -1249,7 +1249,7 @@ const Rl = /* @__PURE__ */ h.forwardRef(El), yl = Object.freeze({
|
|
|
1249
1249
|
), x = w(
|
|
1250
1250
|
(g) => {
|
|
1251
1251
|
const b = n(g.key);
|
|
1252
|
-
o.announce(r.settingAnnouncement(
|
|
1252
|
+
o.announce(r.settingAnnouncement(Mt(r, g), Et(r, b, g.key)));
|
|
1253
1253
|
},
|
|
1254
1254
|
[o, r, n]
|
|
1255
1255
|
);
|
|
@@ -1268,70 +1268,70 @@ const Rl = /* @__PURE__ */ h.forwardRef(El), yl = Object.freeze({
|
|
|
1268
1268
|
"data-testid": "markdown-explorer-tree-settings",
|
|
1269
1269
|
onClick: () => l((g) => !g),
|
|
1270
1270
|
onKeyDown: p,
|
|
1271
|
-
children: /* @__PURE__ */ d(
|
|
1271
|
+
children: /* @__PURE__ */ d(sl, { "aria-hidden": "true" })
|
|
1272
1272
|
}
|
|
1273
1273
|
),
|
|
1274
|
-
menu: s ? /* @__PURE__ */ d(
|
|
1274
|
+
menu: s ? /* @__PURE__ */ d(Rl, { ref: f, id: i, settings: e, descriptors: t, onAdvance: x, onClose: c }) : null
|
|
1275
1275
|
};
|
|
1276
|
-
},
|
|
1277
|
-
const { treeSettings: e } =
|
|
1276
|
+
}, Tl = () => {
|
|
1277
|
+
const { treeSettings: e } = D();
|
|
1278
1278
|
return { settings: je(e.subscribe, e.getSnapshot, e.getServerSnapshot), advance: e.advance };
|
|
1279
|
-
}, pt = /* @__PURE__ */ new Set(),
|
|
1280
|
-
const { mode: t, sourceId: n, currentPath: r, openPaths: o, onOpenDocument: s, onSourceChange: l, onRevealSource: a, viewSwitch: f } = e, { labels: u, sources: i, trees: c, documents: p, announcer: x, reveals: g } =
|
|
1281
|
-
|
|
1282
|
-
const y = e.mode === "tree" ? e.tray.onGatheredChange : null,
|
|
1283
|
-
(
|
|
1284
|
-
const
|
|
1285
|
-
return
|
|
1279
|
+
}, pt = /* @__PURE__ */ new Set(), Al = '[role="tree"] [role="treeitem"][tabindex="0"]', Ol = "[data-directory-tree-tab-stop]", Ql = (e) => {
|
|
1280
|
+
const { mode: t, sourceId: n, currentPath: r, openPaths: o, onOpenDocument: s, onSourceChange: l, onRevealSource: a, viewSwitch: f } = e, { labels: u, sources: i, trees: c, documents: p, announcer: x, reveals: g } = D(), { settings: b, advance: S } = Tl(), N = I(() => gn(t), [t]), k = t === "tree" && b.selectionMode === "multiple";
|
|
1281
|
+
Gr(k);
|
|
1282
|
+
const y = e.mode === "tree" ? e.tray.onGatheredChange : null, z = e.mode === "tree" ? e.onOpenSelection : void 0, H = e.mode === "tree" ? e.onOpenFolder : null, T = e.mode === "tree" ? e.onCloseFolder : null, L = e.mode === "tree" && e.currentFolder, _ = I(() => H === null || T === null || !b.showFolderReadme ? null : { current: r, open: H, close: T }, [H, T, r, b.showFolderReadme]), R = e.mode === "tree" && k ? e.tray.gathered : He, A = w(
|
|
1283
|
+
(F) => {
|
|
1284
|
+
const W = S(F);
|
|
1285
|
+
return W.selectionMode !== "multiple" && y?.(He), W;
|
|
1286
1286
|
},
|
|
1287
1287
|
[S, y]
|
|
1288
|
-
),
|
|
1289
|
-
const
|
|
1290
|
-
if (
|
|
1291
|
-
[
|
|
1292
|
-
}, []),
|
|
1288
|
+
), B = Sl({ settings: b, descriptors: N, onAdvance: A }), O = w((F) => y?.((W) => Ur(W, F)), [y]), V = w((F) => y?.((W) => Wr(W, F)), [y]), J = w(() => y?.(He), [y]), pe = E(null), he = w(() => {
|
|
1289
|
+
const F = pe.current;
|
|
1290
|
+
if (F === null) return;
|
|
1291
|
+
[Al, Ol, '[data-testid="markdown-explorer-tree-settings"]'].map((te) => F.querySelector(te)).find((te) => te !== null)?.focus();
|
|
1292
|
+
}, []), X = I(() => new Set(R.keys()), [R]), ue = I(() => r === null ? pt : /* @__PURE__ */ new Set([r]), [r]), ee = I(() => {
|
|
1293
1293
|
if (t === "multi") return { mode: "multiple", items: o, shownPath: null, onChange: null };
|
|
1294
1294
|
switch (b.selectionMode) {
|
|
1295
1295
|
case "single":
|
|
1296
1296
|
return { mode: "single", items: ue, shownPath: r, onChange: null };
|
|
1297
1297
|
case "multiple":
|
|
1298
|
-
return { mode: "multiple", items:
|
|
1298
|
+
return { mode: "multiple", items: X, shownPath: r, onChange: O };
|
|
1299
1299
|
case "none":
|
|
1300
1300
|
return { mode: "none", items: pt, shownPath: null, onChange: null };
|
|
1301
1301
|
}
|
|
1302
|
-
}, [t, o, b.selectionMode, ue, r,
|
|
1303
|
-
(
|
|
1304
|
-
r !== null && g.settle(r), l(
|
|
1302
|
+
}, [t, o, b.selectionMode, ue, r, X, O]), ne = I(() => b.revealDocument ? { path: r, openFolders: !L } : { path: ee.shownPath, openFolders: !1 }, [b.revealDocument, r, L, ee.shownPath]), fe = w(
|
|
1303
|
+
(F) => {
|
|
1304
|
+
r !== null && g.settle(r), l(F);
|
|
1305
1305
|
},
|
|
1306
1306
|
[r, g, l]
|
|
1307
|
-
), [j, me] =
|
|
1307
|
+
), [j, me] = q(null), [Y, P] = q(!1), [re, Q] = q(null), xe = E(!1), we = w(async () => {
|
|
1308
1308
|
if (!xe.current) {
|
|
1309
|
-
xe.current = !0,
|
|
1309
|
+
xe.current = !0, P(!0), Q(null);
|
|
1310
1310
|
try {
|
|
1311
|
-
const
|
|
1312
|
-
if (
|
|
1313
|
-
p.invalidate(),
|
|
1311
|
+
const F = await c.refresh(n);
|
|
1312
|
+
if (F.status === "superseded") return;
|
|
1313
|
+
p.invalidate(), F.status === "failed" ? Q({ sourceId: n, failure: F.failure }) : x.announce(u.treeRefreshed);
|
|
1314
1314
|
} finally {
|
|
1315
|
-
xe.current = !1,
|
|
1315
|
+
xe.current = !1, P(!1);
|
|
1316
1316
|
}
|
|
1317
1317
|
}
|
|
1318
1318
|
}, [c, p, n, x, u]), Se = w(() => {
|
|
1319
1319
|
we();
|
|
1320
|
-
}, [we]), le = j === null ? null : j.expandAll, oe = j?.expanding === !0, Te = i.find((
|
|
1321
|
-
return /* @__PURE__ */
|
|
1322
|
-
/* @__PURE__ */
|
|
1323
|
-
i.length > 1 ? /* @__PURE__ */ d("select", { className: "aqmx-explorer-source", "aria-label": u.sourceLabel, title: Te?.label, value: n, onChange: (
|
|
1324
|
-
/* @__PURE__ */
|
|
1320
|
+
}, [we]), le = j === null ? null : j.expandAll, oe = j?.expanding === !0, Te = i.find((F) => F.id === n), be = f.target === "multi" ? zn : $n, Ee = f.target === "multi" ? u.switchToMulti : u.switchToTree;
|
|
1321
|
+
return /* @__PURE__ */ C("nav", { ref: pe, "aria-label": u.explorerRegion, className: "aqmx-explorer", "data-testid": "markdown-explorer-explorer", "data-aqmx-mode": t, children: [
|
|
1322
|
+
/* @__PURE__ */ C("div", { className: "aqmx-explorer-header", children: [
|
|
1323
|
+
i.length > 1 ? /* @__PURE__ */ d("select", { className: "aqmx-explorer-source", "aria-label": u.sourceLabel, title: Te?.label, value: n, onChange: (F) => fe(F.currentTarget.value), "data-testid": "markdown-explorer-source-select", children: i.map((F) => /* @__PURE__ */ d("option", { value: F.id, children: F.label }, F.id)) }) : null,
|
|
1324
|
+
/* @__PURE__ */ C("div", { className: "aqmx-explorer-actions", children: [
|
|
1325
1325
|
/* @__PURE__ */ d(xt, { to: f.href, navigation: "switch-view", className: "aqmx-icon-button", "aria-label": Ee, title: Ee, "data-testid": "markdown-explorer-view-switch", "data-aqmx-target": f.target, children: /* @__PURE__ */ d(be, { "aria-hidden": "true" }) }),
|
|
1326
|
-
/* @__PURE__ */
|
|
1326
|
+
/* @__PURE__ */ C(
|
|
1327
1327
|
"button",
|
|
1328
1328
|
{
|
|
1329
1329
|
type: "button",
|
|
1330
1330
|
className: "aqmx-icon-button aqmx-labelled-button",
|
|
1331
1331
|
title: u.refreshTree,
|
|
1332
|
-
"aria-disabled":
|
|
1333
|
-
"aria-busy":
|
|
1334
|
-
"data-aqmx-busy":
|
|
1332
|
+
"aria-disabled": Y,
|
|
1333
|
+
"aria-busy": Y,
|
|
1334
|
+
"data-aqmx-busy": Y ? "true" : void 0,
|
|
1335
1335
|
"data-testid": "markdown-explorer-refresh",
|
|
1336
1336
|
onClick: () => {
|
|
1337
1337
|
we();
|
|
@@ -1354,27 +1354,27 @@ const Rl = /* @__PURE__ */ h.forwardRef(El), yl = Object.freeze({
|
|
|
1354
1354
|
"data-aqmx-busy": oe ? "true" : void 0,
|
|
1355
1355
|
"data-testid": "markdown-explorer-expand-all",
|
|
1356
1356
|
onClick: () => le?.(),
|
|
1357
|
-
children: /* @__PURE__ */ d(
|
|
1357
|
+
children: /* @__PURE__ */ d(Hn, { "aria-hidden": "true" })
|
|
1358
1358
|
}
|
|
1359
1359
|
),
|
|
1360
|
-
/* @__PURE__ */ d("button", { type: "button", className: "aqmx-icon-button", "aria-label": u.collapseAll, title: u.collapseAll, "aria-disabled": j === null, "data-testid": "markdown-explorer-collapse-all", onClick: () => j?.collapseAll(), children: /* @__PURE__ */ d(
|
|
1361
|
-
|
|
1360
|
+
/* @__PURE__ */ d("button", { type: "button", className: "aqmx-icon-button", "aria-label": u.collapseAll, title: u.collapseAll, "aria-disabled": j === null, "data-testid": "markdown-explorer-collapse-all", onClick: () => j?.collapseAll(), children: /* @__PURE__ */ d(In, { "aria-hidden": "true" }) }),
|
|
1361
|
+
B.trigger
|
|
1362
1362
|
] })
|
|
1363
1363
|
] }),
|
|
1364
|
-
/* @__PURE__ */
|
|
1364
|
+
/* @__PURE__ */ C("div", { className: "aqmx-explorer-body", "data-aqmx-explorer-body": "", children: [
|
|
1365
1365
|
/* @__PURE__ */ d(an, {}),
|
|
1366
|
-
re !== null && re.sourceId === n ? /* @__PURE__ */ d(
|
|
1367
|
-
/* @__PURE__ */ d(
|
|
1368
|
-
/* @__PURE__ */ d(
|
|
1369
|
-
|
|
1370
|
-
|
|
1366
|
+
re !== null && re.sourceId === n ? /* @__PURE__ */ d(Nl, { failure: re.failure, onRetry: Se }) : null,
|
|
1367
|
+
/* @__PURE__ */ d(bt, { fallback: null, children: /* @__PURE__ */ d(Un, {}) }),
|
|
1368
|
+
/* @__PURE__ */ d(Vr, { mode: t, sourceId: n, settings: b, reveal: ne, openPaths: o, selection: ee, onOpenDocument: s, folders: _, onRevealSource: a, onControls: me }, n),
|
|
1369
|
+
k && R.size > 0 ? /* @__PURE__ */ d(Kr, { selection: R, onRemove: V, onClear: J, onOpenSelection: z, onLeave: he }) : null,
|
|
1370
|
+
B.menu
|
|
1371
1371
|
] })
|
|
1372
1372
|
] });
|
|
1373
|
-
},
|
|
1374
|
-
const { labels: n } =
|
|
1373
|
+
}, Nl = ({ failure: e, onRetry: t }) => {
|
|
1374
|
+
const { labels: n } = D(), { reason: r } = e;
|
|
1375
1375
|
return Ze(r) ? /* @__PURE__ */ d(wt, { failure: e, place: "read", deniedSentence: null, retry: t, testId: "markdown-explorer-refresh-failure" }) : /* @__PURE__ */ d("p", { role: "alert", className: "aqmx-explorer-refresh-failure", "data-testid": "markdown-explorer-refresh-failure", "data-aqmx-failure": r, children: n.treeRefreshFailed(on(n, r)) });
|
|
1376
1376
|
};
|
|
1377
|
-
function
|
|
1377
|
+
function Ll({
|
|
1378
1378
|
title: e,
|
|
1379
1379
|
titleId: t,
|
|
1380
1380
|
...n
|
|
@@ -1395,49 +1395,49 @@ function kl({
|
|
|
1395
1395
|
clipRule: "evenodd"
|
|
1396
1396
|
}));
|
|
1397
1397
|
}
|
|
1398
|
-
const
|
|
1399
|
-
const { labels: a } =
|
|
1398
|
+
const _t = /* @__PURE__ */ h.forwardRef(Ll), kl = ({ explorer: e, toggleRef: t, covered: n, merged: r, onNoticeSlotChange: o, accessFailures: s, dismissals: l }) => {
|
|
1399
|
+
const { labels: a } = D(), f = Tn(), u = An(), { location: i } = sn(), [c, p] = q(!1), [x, g] = q({ navigated: f, source: i.source }), [b, S] = q(!1);
|
|
1400
1400
|
x.navigated !== f && (g({ navigated: f, source: i.source }), x.source === i.source && !b && cn(u, f.state) !== "close-folder" && p(!1));
|
|
1401
|
-
const [N,
|
|
1402
|
-
N !== l && (
|
|
1403
|
-
const y = E(null),
|
|
1404
|
-
|
|
1401
|
+
const [N, k] = q(l);
|
|
1402
|
+
N !== l && (k(l), p(!1));
|
|
1403
|
+
const y = E(null), z = E(null), H = E(null), T = E(!1), L = qe();
|
|
1404
|
+
$(() => {
|
|
1405
1405
|
const O = y.current;
|
|
1406
|
-
O !== null && (c && !O.open ? (O.showModal(),
|
|
1407
|
-
}, [c, t, o]),
|
|
1406
|
+
O !== null && (c && !O.open ? (O.showModal(), z.current?.focus()) : !c && O.open && (O.close(), t.current?.focus()), o(c ? H.current : null));
|
|
1407
|
+
}, [c, t, o]), $(() => () => o(null), [o]);
|
|
1408
1408
|
const _ = w((O) => {
|
|
1409
1409
|
O.key !== "Escape" || O.defaultPrevented || (Ve(O), p(!1));
|
|
1410
|
-
}, []), P = w((O) => {
|
|
1411
|
-
A.current = O.target === O.currentTarget;
|
|
1412
1410
|
}, []), R = w((O) => {
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1411
|
+
T.current = O.target === O.currentTarget;
|
|
1412
|
+
}, []), A = w((O) => {
|
|
1413
|
+
const V = T.current;
|
|
1414
|
+
T.current = !1, V && O.target === O.currentTarget && p(!1);
|
|
1415
|
+
}, []), B = w(() => {
|
|
1416
1416
|
p(!1);
|
|
1417
1417
|
}, []);
|
|
1418
|
-
return /* @__PURE__ */
|
|
1419
|
-
/* @__PURE__ */ d("div", { className: "aqmx-sheet-bar", inert: n, "data-testid": "markdown-explorer-sheet-bar", "data-aqmx-sheet-bar-merged": r ? "true" : "false", children: /* @__PURE__ */
|
|
1420
|
-
/* @__PURE__ */ d(
|
|
1418
|
+
return /* @__PURE__ */ C(mt, { children: [
|
|
1419
|
+
/* @__PURE__ */ d("div", { className: "aqmx-sheet-bar", inert: n, "data-testid": "markdown-explorer-sheet-bar", "data-aqmx-sheet-bar-merged": r ? "true" : "false", children: /* @__PURE__ */ C("button", { ref: t, type: "button", className: "aqmx-explorer-toggle", title: r ? a.showExplorer : void 0, "aria-haspopup": "dialog", "aria-expanded": c, "aria-controls": L, "data-testid": "markdown-explorer-sheet-toggle", onClick: () => p(!0), children: [
|
|
1420
|
+
/* @__PURE__ */ d(_t, { "aria-hidden": "true" }),
|
|
1421
1421
|
/* @__PURE__ */ d("span", { className: r ? "aqmx-sr-only" : void 0, children: a.showExplorer })
|
|
1422
1422
|
] }) }),
|
|
1423
|
-
/* @__PURE__ */ d("dialog", { ref: y, id:
|
|
1424
|
-
/* @__PURE__ */
|
|
1425
|
-
/* @__PURE__ */ d("div", { ref:
|
|
1426
|
-
/* @__PURE__ */ d("button", { ref:
|
|
1423
|
+
/* @__PURE__ */ d("dialog", { ref: y, id: L, className: "aqmx-sheet", "aria-label": a.explorerRegion, "data-testid": "markdown-explorer-sheet", onKeyDown: _, onPointerDown: R, onClick: A, onClose: B, children: /* @__PURE__ */ C("div", { className: "aqmx-sheet-panel", children: [
|
|
1424
|
+
/* @__PURE__ */ C("div", { className: "aqmx-explorer-chrome", children: [
|
|
1425
|
+
/* @__PURE__ */ d("div", { ref: H, className: "aqmx-sheet-notice-slot" }),
|
|
1426
|
+
/* @__PURE__ */ d("button", { ref: z, type: "button", className: "aqmx-explorer-close", "aria-label": a.hideExplorer, title: a.hideExplorer, "data-testid": "markdown-explorer-sheet-close", onClick: () => p(!1), children: /* @__PURE__ */ d(Ue, { "aria-hidden": "true" }) })
|
|
1427
1427
|
] }),
|
|
1428
|
-
/* @__PURE__ */ d("div", { className: "aqmx-sheet-body", children: /* @__PURE__ */ d(Ke, { value: c, children: /* @__PURE__ */ d(dn, { value: s, children: /* @__PURE__ */ d(
|
|
1428
|
+
/* @__PURE__ */ d("div", { className: "aqmx-sheet-body", children: /* @__PURE__ */ d(Ke, { value: c, children: /* @__PURE__ */ d(dn, { value: s, children: /* @__PURE__ */ d(Pt, { value: S, children: e }) }) }) }),
|
|
1429
1429
|
/* @__PURE__ */ d(un, { holds: c, deferWhileFullscreenIn: null, testId: "markdown-explorer-sheet-announcer" })
|
|
1430
1430
|
] }) })
|
|
1431
1431
|
] });
|
|
1432
|
-
},
|
|
1432
|
+
}, Fl = Ce(null), We = "aqmx-explorer", It = "aqmx-content", Ge = '[role="tree"] [role="treeitem"]', Cl = `${Ge}[tabindex="0"]`, ql = "[data-directory-tree-tab-stop]", Pl = (e, t) => {
|
|
1433
1433
|
for (const n of e.querySelectorAll(`[data-panel-id="${We}"] ${Ge}`)) if (n.getAttribute(de) === t) return n;
|
|
1434
1434
|
return null;
|
|
1435
1435
|
}, ht = (e, t) => ({
|
|
1436
1436
|
inlineSize: e > 0 ? e : null,
|
|
1437
|
-
rootFontPixels: t > 0 ? t :
|
|
1438
|
-
}),
|
|
1439
|
-
const [n, r] =
|
|
1440
|
-
return
|
|
1437
|
+
rootFontPixels: t > 0 ? t : Sn
|
|
1438
|
+
}), Ml = (e, t) => {
|
|
1439
|
+
const [n, r] = q(() => ht(0, 0));
|
|
1440
|
+
return $(() => {
|
|
1441
1441
|
const o = e.current, s = t.current;
|
|
1442
1442
|
if (o === null || s === null) throw new Error("[markdown-explorer] the split frame is not mounted");
|
|
1443
1443
|
const l = { frame: o.getBoundingClientRect().width, rem: s.getBoundingClientRect().width }, a = () => {
|
|
@@ -1454,14 +1454,14 @@ const It = /* @__PURE__ */ h.forwardRef(kl), Fl = ({ explorer: e, toggleRef: t,
|
|
|
1454
1454
|
});
|
|
1455
1455
|
return f.observe(o), f.observe(s), () => f.disconnect();
|
|
1456
1456
|
}, [e, t]), n;
|
|
1457
|
-
},
|
|
1457
|
+
}, Dt = (e) => `aqmx-split-handle-${e}`, _l = (e, { frameRef: t, sheetToggleRef: n, railToggleRef: r, closeButtonRef: o, handleId: s }) => {
|
|
1458
1458
|
const l = E(!1), a = E(null), f = E(!1);
|
|
1459
|
-
|
|
1459
|
+
$(() => {
|
|
1460
1460
|
const i = t.current;
|
|
1461
1461
|
if (i === null) throw new Error("[markdown-explorer] the split frame is not mounted");
|
|
1462
1462
|
const c = (x) => {
|
|
1463
1463
|
const g = x.target instanceof Element ? x.target : null;
|
|
1464
|
-
l.current = g !== null && g.closest(`[data-panel-id="${
|
|
1464
|
+
l.current = g !== null && g.closest(`[data-panel-id="${It}"]`) === null, !f.current && (a.current = g?.closest(`${Ge}[${de}]`)?.getAttribute(de) ?? null);
|
|
1465
1465
|
}, p = (x) => {
|
|
1466
1466
|
x.relatedTarget instanceof Node && !i.contains(x.relatedTarget) && (l.current = !1);
|
|
1467
1467
|
};
|
|
@@ -1470,7 +1470,7 @@ const It = /* @__PURE__ */ h.forwardRef(kl), Fl = ({ explorer: e, toggleRef: t,
|
|
|
1470
1470
|
};
|
|
1471
1471
|
}, [t]);
|
|
1472
1472
|
const u = E(e);
|
|
1473
|
-
|
|
1473
|
+
$(() => {
|
|
1474
1474
|
const i = u.current;
|
|
1475
1475
|
if (i === e) return;
|
|
1476
1476
|
u.current = e;
|
|
@@ -1505,24 +1505,24 @@ const It = /* @__PURE__ */ h.forwardRef(kl), Fl = ({ explorer: e, toggleRef: t,
|
|
|
1505
1505
|
if (u.current !== e || !l.current) return;
|
|
1506
1506
|
const x = a.current, g = `[data-panel-id="${We}"]`;
|
|
1507
1507
|
p([
|
|
1508
|
-
x === null ? null :
|
|
1509
|
-
c.querySelector(`${g} ${
|
|
1508
|
+
x === null ? null : Pl(c, x),
|
|
1509
|
+
c.querySelector(`${g} ${Cl}`),
|
|
1510
1510
|
c.querySelector(`${g} ${ql}`),
|
|
1511
1511
|
c.querySelector(`[data-resize-handle-id="${s}"]`)
|
|
1512
1512
|
]);
|
|
1513
1513
|
});
|
|
1514
1514
|
}, [e, t, n, r, o, s]);
|
|
1515
|
-
},
|
|
1516
|
-
const { viewSettings: l } =
|
|
1517
|
-
|
|
1518
|
-
const
|
|
1519
|
-
return /* @__PURE__ */ d(
|
|
1515
|
+
}, Il = (e) => e === "tree" ? "treeExplorerHidden" : "multiExplorerHidden", Jl = ({ view: e, explorer: t, content: n, contentCoversPage: r = !1, sheetDismissals: o = 0, onDraggingChange: s }) => {
|
|
1516
|
+
const { viewSettings: l } = D(), a = E(null), [f, u] = q(null), i = E(null), c = E(null), p = E(null), x = E(null), { inlineSize: g, rootFontPixels: b } = Ml(a, i), S = Il(e), N = vt((O) => O[S] === !0), k = g !== null && g < vn(b), y = k ? "sheet" : N ? "rail" : "split";
|
|
1517
|
+
_l(y, { frameRef: a, sheetToggleRef: c, railToggleRef: p, closeButtonRef: x, handleId: Dt(e) });
|
|
1518
|
+
const z = w(() => l.update({ [S]: !0 }), [l, S]), H = w(() => l.update({ [S]: !1 }), [l, S]), [T, L] = q(!1), _ = I(() => k ? { lane: !r, onBar: L } : null, [k, r]), [R] = q(() => /* @__PURE__ */ new Map()), [A] = q(fn);
|
|
1519
|
+
return /* @__PURE__ */ d(Rt, { value: R, children: /* @__PURE__ */ C("div", { ref: a, className: "aqmx-split-frame", "data-aqmx-explorer-mode": y, "data-aqmx-measured": g === null ? "false" : "true", "data-aqmx-content-covers-page": r ? "true" : "false", children: [
|
|
1520
1520
|
/* @__PURE__ */ d("span", { ref: i, className: "aqmx-rem-probe", "aria-hidden": "true", "data-aqmx-rem-probe": "" }),
|
|
1521
|
-
|
|
1522
|
-
/* @__PURE__ */
|
|
1523
|
-
y === "rail" ? /* @__PURE__ */ d(
|
|
1524
|
-
/* @__PURE__ */ d(
|
|
1525
|
-
|
|
1521
|
+
k ? /* @__PURE__ */ d(kl, { explorer: t, toggleRef: c, covered: r, merged: T, onNoticeSlotChange: u, accessFailures: A, dismissals: o }) : null,
|
|
1522
|
+
/* @__PURE__ */ C("div", { className: "aqmx-split-row", children: [
|
|
1523
|
+
y === "rail" ? /* @__PURE__ */ d(Dl, { toggleRef: p, covered: r, onOpen: H }) : null,
|
|
1524
|
+
/* @__PURE__ */ d(Fl, { value: k ? f : null, children: /* @__PURE__ */ d(pn, { value: k && f !== null ? A : null, children: /* @__PURE__ */ d(hn, { value: _, children: /* @__PURE__ */ d(
|
|
1525
|
+
Hl,
|
|
1526
1526
|
{
|
|
1527
1527
|
view: e,
|
|
1528
1528
|
mode: y,
|
|
@@ -1532,53 +1532,53 @@ const It = /* @__PURE__ */ h.forwardRef(kl), Fl = ({ explorer: e, toggleRef: t,
|
|
|
1532
1532
|
onDraggingChange: s,
|
|
1533
1533
|
explorerMinPixels: bn(b),
|
|
1534
1534
|
closeButtonRef: x,
|
|
1535
|
-
onHide:
|
|
1535
|
+
onHide: z
|
|
1536
1536
|
}
|
|
1537
1537
|
) }) }) })
|
|
1538
1538
|
] })
|
|
1539
1539
|
] }) });
|
|
1540
|
-
},
|
|
1541
|
-
const { labels: r } =
|
|
1542
|
-
return /* @__PURE__ */ d("div", { className: "aqmx-split-rail", inert: t, "data-testid": "markdown-explorer-rail", children: /* @__PURE__ */ d("button", { ref: e, type: "button", className: "aqmx-explorer-toggle", "aria-expanded": !1, "aria-label": r.showExplorer, title: r.showExplorer, "data-testid": "markdown-explorer-rail-toggle", onClick: n, children: /* @__PURE__ */ d(
|
|
1543
|
-
},
|
|
1544
|
-
const { viewSettings: u, labels: i } =
|
|
1545
|
-
|
|
1546
|
-
|
|
1540
|
+
}, Dl = ({ toggleRef: e, covered: t, onOpen: n }) => {
|
|
1541
|
+
const { labels: r } = D();
|
|
1542
|
+
return /* @__PURE__ */ d("div", { className: "aqmx-split-rail", inert: t, "data-testid": "markdown-explorer-rail", children: /* @__PURE__ */ d("button", { ref: e, type: "button", className: "aqmx-explorer-toggle", "aria-expanded": !1, "aria-label": r.showExplorer, title: r.showExplorer, "data-testid": "markdown-explorer-rail-toggle", onClick: n, children: /* @__PURE__ */ d(_t, { "aria-hidden": "true" }) }) });
|
|
1543
|
+
}, Hl = ({ view: e, mode: t, explorer: n, content: r, contentCoversPage: o, onDraggingChange: s, explorerMinPixels: l, closeButtonRef: a, onHide: f }) => {
|
|
1544
|
+
const { viewSettings: u, labels: i } = D(), c = I(() => Pn(i), [i]), x = vt((R) => e === "tree" ? R.treeExplorer : R.multiExplorer) ?? (e === "tree" ? En : yn), g = E(!1), [b, S] = q(!1), N = E(!1), k = E(s);
|
|
1545
|
+
$(() => {
|
|
1546
|
+
k.current = s;
|
|
1547
1547
|
}, [s]);
|
|
1548
|
-
const y =
|
|
1548
|
+
const y = Mn(
|
|
1549
1549
|
w(
|
|
1550
1550
|
(R) => {
|
|
1551
1551
|
if (R.length !== 2) return;
|
|
1552
|
-
const [
|
|
1553
|
-
if (
|
|
1554
|
-
const
|
|
1555
|
-
u.update(e === "tree" ? { treeExplorer:
|
|
1552
|
+
const [A = 0, B = 0] = R, O = A + B;
|
|
1553
|
+
if (O <= 0 || A <= 0) return;
|
|
1554
|
+
const V = Math.min(at, A / O * 100);
|
|
1555
|
+
u.update(e === "tree" ? { treeExplorer: V } : { multiExplorer: V });
|
|
1556
1556
|
},
|
|
1557
1557
|
[u, e]
|
|
1558
1558
|
)
|
|
1559
1559
|
);
|
|
1560
1560
|
Z(
|
|
1561
1561
|
() => () => {
|
|
1562
|
-
g.current &&
|
|
1562
|
+
g.current && k.current?.(!1);
|
|
1563
1563
|
},
|
|
1564
1564
|
[]
|
|
1565
1565
|
);
|
|
1566
|
-
const
|
|
1566
|
+
const z = Rn, H = t === "split", T = w(() => {
|
|
1567
1567
|
N.current = !1, S(!1), f();
|
|
1568
|
-
}, [f]),
|
|
1569
|
-
(R,
|
|
1570
|
-
const [
|
|
1571
|
-
R.length === 2 &&
|
|
1568
|
+
}, [f]), L = w(
|
|
1569
|
+
(R, A) => {
|
|
1570
|
+
const [B = 0, O = 0] = R;
|
|
1571
|
+
R.length === 2 && O > 0 && (N.current = B <= 0, S(N.current)), y.layoutChanged(R, A), N.current && A.source === "keyboard" && T();
|
|
1572
1572
|
},
|
|
1573
1573
|
[y, T]
|
|
1574
|
-
),
|
|
1574
|
+
), _ = w(
|
|
1575
1575
|
(R) => {
|
|
1576
1576
|
g.current = R, s?.(R), y.draggingChanged(R), !R && N.current && T();
|
|
1577
1577
|
},
|
|
1578
1578
|
[s, y, T]
|
|
1579
1579
|
);
|
|
1580
|
-
return /* @__PURE__ */
|
|
1581
|
-
|
|
1580
|
+
return /* @__PURE__ */ C(Cn, { id: `aqmx-split-${e}`, direction: "horizontal", onLayout: L, labels: c, className: "aqmx-split", "data-aqmx-split": e, children: [
|
|
1581
|
+
H ? /* @__PURE__ */ C(
|
|
1582
1582
|
ct,
|
|
1583
1583
|
{
|
|
1584
1584
|
id: We,
|
|
@@ -1595,25 +1595,25 @@ const It = /* @__PURE__ */ h.forwardRef(kl), Fl = ({ explorer: e, toggleRef: t,
|
|
|
1595
1595
|
]
|
|
1596
1596
|
}
|
|
1597
1597
|
) : null,
|
|
1598
|
-
|
|
1598
|
+
H ? /* @__PURE__ */ d(
|
|
1599
1599
|
qn,
|
|
1600
1600
|
{
|
|
1601
|
-
id:
|
|
1602
|
-
thickness:
|
|
1601
|
+
id: Dt(e),
|
|
1602
|
+
thickness: z,
|
|
1603
1603
|
indicator: { visible: !0, thickness: Fe.gripThickness, length: Fe.gripLength, barThickness: Fe.barThickness, barLength: Fe.barLength },
|
|
1604
1604
|
title: i.resizeExplorer,
|
|
1605
1605
|
"aria-label": i.resizeExplorer,
|
|
1606
|
-
onDragging:
|
|
1606
|
+
onDragging: _,
|
|
1607
1607
|
inert: o,
|
|
1608
1608
|
className: "aqmx-split-handle"
|
|
1609
1609
|
}
|
|
1610
1610
|
) : null,
|
|
1611
|
-
/* @__PURE__ */ d(ct, { id:
|
|
1611
|
+
/* @__PURE__ */ d(ct, { id: It, defaultSize: { value: H ? 100 - x : 100, unit: "percentage" }, contentOverflow: "hidden", className: "aqmx-split-content", ...o ? { style: { isolation: "auto" } } : {}, children: r })
|
|
1612
1612
|
] });
|
|
1613
1613
|
};
|
|
1614
1614
|
export {
|
|
1615
1615
|
He as E,
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1616
|
+
Fl as S,
|
|
1617
|
+
Jl as a,
|
|
1618
|
+
Ql as b
|
|
1619
1619
|
};
|