@aiquants/markdown-explorer 0.9.0 → 0.10.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 +9 -0
- package/README.md +4 -2
- package/dist/{EditSurface-DJ9pJlDd.js → EditSurface-1Jf0CG-f.js} +1 -1
- package/dist/{EditSurface-BQ5QAdDd.cjs → EditSurface-B-l3Do_C.cjs} +1 -1
- package/dist/{ExplorerSplit-BwUurHbM.js → ExplorerSplit-D0zf7Cr_.js} +2 -2
- package/dist/{ExplorerSplit-Brdh9fCW.cjs → ExplorerSplit-WX8afxrQ.cjs} +1 -1
- package/dist/{MultiLayout-xWd9nYaD.cjs → MultiLayout-Bq10p3a3.cjs} +1 -1
- package/dist/{MultiLayout-DPE2GP2T.js → MultiLayout-Jy9BKofx.js} +4 -4
- package/dist/{NativeScrollBar-CwgalDjg.js → NativeScrollBar-CyiyL47o.js} +1 -1
- package/dist/{NativeScrollBar-PBnODPEM.cjs → NativeScrollBar-Dt6xH5Mb.cjs} +1 -1
- package/dist/{TreeLayout-B3i_63hs.js → TreeLayout-8pRo1ANN.js} +3 -3
- package/dist/{TreeLayout-DilrAILF.cjs → TreeLayout-kVWFEKJD.cjs} +1 -1
- package/dist/dataRoute-8pyILcjL.cjs +1 -0
- package/dist/dataRoute-Csl1WBDz.js +278 -0
- package/dist/{index-CPoNWk1T.js → index-CfcJEnrC.js} +384 -384
- package/dist/index-sNJrKoGN.cjs +13 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +14 -14
- package/dist/{location-DmzVAFvo.cjs → location-CRYkEWiC.cjs} +1 -1
- package/dist/{location-Q4sgRrUm.js → location-Dc1qNEGm.js} +1 -1
- package/dist/{merge-DgAmnpnO.cjs → merge-D0aGvFKC.cjs} +1 -1
- package/dist/{merge-D_qmtwWR.js → merge-SRCxtHk2.js} +1 -1
- package/dist/sanitizeWorker.cjs +1 -1
- package/dist/sanitizeWorker.js +1 -1
- package/dist/server.cjs +1 -1
- package/dist/server.js +632 -621
- package/docs/behavior/dom-hooks.md +1 -1
- package/docs/behavior/layout.md +2 -2
- package/docs/behavior/security.md +2 -1
- package/docs/behavior/url-contract.md +1 -0
- package/package.json +1 -1
- package/dist/dataRoute-CcZ8PK00.cjs +0 -1
- package/dist/dataRoute-D1vE1wFW.js +0 -270
- package/dist/index-BBtIYTXJ.cjs +0 -13
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { jsxs as F, jsx as a, Fragment as Ne } from "react/jsx-runtime";
|
|
2
2
|
import * as b from "react";
|
|
3
|
-
import { createContext as me, use as re, useMemo as
|
|
3
|
+
import { createContext as me, use as re, useMemo as U, useSyncExternalStore as te, useRef as B, useId as Oe, useLayoutEffect as V, useCallback as P, useEffect as ne, Component as Vt, Suspense as ge, lazy as tt, useState as I, useEffectEvent as ie } from "react";
|
|
4
4
|
import { useParams as Cn, useSearchParams as On, matchPath as An, useBlocker as Ln, useNavigate as Mn, Link as Nn, useHref as De, useLocation as Gt, useRevalidator as Dn } from "react-router";
|
|
5
|
-
import { f as $n, a as Kt, u as Pn, G as ke, e as pe, x as Fn, y as qn, z as ft, B as _n, D as mt, H as Bn, w as In, I as jn } from "./location-
|
|
6
|
-
import {
|
|
7
|
-
import { HostedScrollArea as vt, useMarkdownToolbarState as
|
|
8
|
-
import { SOURCE_LINES_ATTRIBUTE as Xt, parseSourceLines as
|
|
9
|
-
import { DEFAULT_CONTENT_ALIGN as
|
|
10
|
-
import { w as Yt, r as Jt, a as
|
|
11
|
-
const bt = Object.freeze(["en", "ja"]),
|
|
5
|
+
import { f as $n, a as Kt, u as Pn, G as ke, e as pe, x as Fn, y as qn, z as ft, B as _n, D as mt, H as Bn, w as In, I as jn } from "./location-Dc1qNEGm.js";
|
|
6
|
+
import { C as Ee, i as Hn, F as zn, x as Y, w as Un, G as ht, y as He, H as Zn, I as Vn, J as Gn, K as Kn, L as Wn, f as Xn, N as pt, u as Yn, O as Jn, P as Qn, Q as er, A as tr, v as nr, R as rr, S as or, T as lr, t as gt } from "./dataRoute-Csl1WBDz.js";
|
|
7
|
+
import { HostedScrollArea as vt, useMarkdownToolbarState as ir, MarkdownViewer as Wt } from "@aiquants/markdown";
|
|
8
|
+
import { SOURCE_LINES_ATTRIBUTE as Xt, parseSourceLines as sr } from "@aiquants/markdown/source-lines";
|
|
9
|
+
import { DEFAULT_CONTENT_ALIGN as ar } from "@aiquants/markdown/viewer-settings";
|
|
10
|
+
import { w as Yt, r as Jt, a as cr, b as wt, s as ze, c as dr } from "./storage-BSthKLSG.js";
|
|
11
|
+
const bt = Object.freeze(["en", "ja"]), ur = "en", fr = Object.freeze({
|
|
12
12
|
panelMoved: Object.freeze(["title", "column", "position"]),
|
|
13
13
|
panelMoveUnavailable: Object.freeze(["title", "move"]),
|
|
14
14
|
panelDragStarted: Object.freeze(["title"]),
|
|
15
15
|
panelDragCancelled: Object.freeze(["title"]),
|
|
16
16
|
multiColumnRegion: Object.freeze(["column"])
|
|
17
|
-
}),
|
|
17
|
+
}), mr = /\{(\w+)\}/gu, Qt = {
|
|
18
18
|
explorerRegion: "Explorer",
|
|
19
19
|
sourceLabel: "Source",
|
|
20
20
|
refreshTreeLabel: "Refresh tree",
|
|
@@ -242,7 +242,7 @@ const bt = Object.freeze(["en", "ja"]), dr = "en", ur = Object.freeze({
|
|
|
242
242
|
multiColumnEmpty: "This column is empty",
|
|
243
243
|
multiColumnRegion: "Column {column}",
|
|
244
244
|
panelDropHere: "Drop the panel here"
|
|
245
|
-
},
|
|
245
|
+
}, hr = {
|
|
246
246
|
explorerRegion: "エクスプローラー",
|
|
247
247
|
sourceLabel: "ソース",
|
|
248
248
|
refreshTreeLabel: "ツリーを更新",
|
|
@@ -470,15 +470,15 @@ const bt = Object.freeze(["en", "ja"]), dr = "en", ur = Object.freeze({
|
|
|
470
470
|
multiColumnEmpty: "この列は空です",
|
|
471
471
|
multiColumnRegion: "{column} 列目",
|
|
472
472
|
panelDropHere: "ここへパネルをドロップ"
|
|
473
|
-
},
|
|
473
|
+
}, pr = Object.freeze({
|
|
474
474
|
en: Object.freeze(Qt),
|
|
475
|
-
ja: Object.freeze(
|
|
476
|
-
}), en = Object.freeze(Object.keys(Qt)),
|
|
477
|
-
if (e === void 0) return
|
|
475
|
+
ja: Object.freeze(hr)
|
|
476
|
+
}), en = Object.freeze(Object.keys(Qt)), gr = new Set(en), vr = (e) => gr.has(e), Te = (e) => e === null ? "null" : typeof e == "string" ? JSON.stringify(e.length > 40 ? `${e.slice(0, 40)}…` : e) : typeof e == "function" ? "a function" : Array.isArray(e) ? "an array" : typeof e, tn = (e) => {
|
|
477
|
+
if (e === void 0) return ur;
|
|
478
478
|
if (bt.includes(e)) return e;
|
|
479
479
|
throw new RangeError(`[markdown-explorer] locale is the UI language (${bt.map((t) => JSON.stringify(t)).join(" or ")}), not a BCP 47 tag; got ${Te(e)}`);
|
|
480
480
|
}, Et = (e, t) => {
|
|
481
|
-
const n =
|
|
481
|
+
const n = pr[tn(e)];
|
|
482
482
|
if (t === void 0) return n;
|
|
483
483
|
if (t === null || typeof t != "object")
|
|
484
484
|
throw new RangeError(`[markdown-explorer] labels must be an object; got ${Te(t)}`);
|
|
@@ -486,7 +486,7 @@ const bt = Object.freeze(["en", "ja"]), dr = "en", ur = Object.freeze({
|
|
|
486
486
|
throw new RangeError(`[markdown-explorer] labels must be a plain object; got ${Te(t)}`);
|
|
487
487
|
const r = t, o = { ...n };
|
|
488
488
|
for (const l of Object.keys(r)) {
|
|
489
|
-
if (!
|
|
489
|
+
if (!vr(l))
|
|
490
490
|
throw new RangeError(`[markdown-explorer] labels.${l} is not a known label key; expected one of ${en.join(", ")}`);
|
|
491
491
|
const i = r[l];
|
|
492
492
|
if (i === void 0) continue;
|
|
@@ -495,21 +495,21 @@ const bt = Object.freeze(["en", "ja"]), dr = "en", ur = Object.freeze({
|
|
|
495
495
|
throw new TypeError(`[markdown-explorer] labels.${l} must be a ${d}; got ${Te(i)}`);
|
|
496
496
|
if (typeof i == "string" && i.trim() === "")
|
|
497
497
|
throw new RangeError(`[markdown-explorer] labels.${l} must be a non-blank string`);
|
|
498
|
-
const g =
|
|
498
|
+
const g = fr[l];
|
|
499
499
|
if (typeof i == "string" && g !== void 0) {
|
|
500
|
-
for (const [, f] of i.matchAll(
|
|
500
|
+
for (const [, f] of i.matchAll(mr))
|
|
501
501
|
if (!g.includes(f ?? ""))
|
|
502
502
|
throw new RangeError(`[markdown-explorer] labels.${l} uses the unknown placeholder {${String(f)}}; it accepts ${g.map((u) => `{${u}}`).join(", ")}`);
|
|
503
503
|
}
|
|
504
504
|
o[l] = i;
|
|
505
505
|
}
|
|
506
506
|
return Object.freeze(o);
|
|
507
|
-
},
|
|
507
|
+
}, wr = (e, t) => {
|
|
508
508
|
if (Object.is(e, t)) return !0;
|
|
509
509
|
if (e === null || t === null || typeof e != "object" || typeof t != "object") return !1;
|
|
510
510
|
const n = e, r = t, o = Object.keys(n), l = Object.keys(r);
|
|
511
511
|
return o.length === l.length && l.every((i) => Object.hasOwn(n, i) && Object.is(n[i], r[i]));
|
|
512
|
-
}, yt = Object.freeze(["light", "dark"]),
|
|
512
|
+
}, yt = Object.freeze(["light", "dark"]), br = (e) => {
|
|
513
513
|
if (e === void 0) return "light";
|
|
514
514
|
if (yt.includes(e)) return e;
|
|
515
515
|
throw new RangeError(`[markdown-explorer] theme must be ${yt.map((t) => JSON.stringify(t)).join(" or ")}; got ${typeof e == "string" ? JSON.stringify(e) : typeof e}`);
|
|
@@ -522,7 +522,7 @@ const bt = Object.freeze(["en", "ja"]), dr = "en", ur = Object.freeze({
|
|
|
522
522
|
return te(t.subscribe, n, n);
|
|
523
523
|
}, nt = () => {
|
|
524
524
|
const { config: e } = D(), t = Cn()["*"], [n] = On(), r = n.toString();
|
|
525
|
-
return
|
|
525
|
+
return U(() => Kt(e, t, new URLSearchParams(r)), [e, t, r]);
|
|
526
526
|
}, rn = {
|
|
527
527
|
unauthorized: ["failureUnauthorizedTitle", "failureUnauthorizedBody"],
|
|
528
528
|
forbidden: ["failureForbiddenTitle", "failureForbiddenBody"],
|
|
@@ -539,7 +539,7 @@ const bt = Object.freeze(["en", "ja"]), dr = "en", ur = Object.freeze({
|
|
|
539
539
|
/* @__PURE__ */ a("p", { className: "aqmx-callout-body", children: i }),
|
|
540
540
|
e.reason === "unauthorized" ? /* @__PURE__ */ a("button", { type: "button", className: "aqmx-callout-action", onClick: () => window.location.reload(), children: o.reloadPage }) : n !== void 0 && e.reason === "failed" ? /* @__PURE__ */ a("button", { type: "button", className: "aqmx-callout-action", onClick: n, children: o.retry }) : null
|
|
541
541
|
] });
|
|
542
|
-
},
|
|
542
|
+
}, Er = (e, t) => {
|
|
543
543
|
const { phase: n, save: r, dirty: o } = t;
|
|
544
544
|
switch (n.kind) {
|
|
545
545
|
case "opening":
|
|
@@ -563,7 +563,7 @@ const bt = Object.freeze(["en", "ja"]), dr = "en", ur = Object.freeze({
|
|
|
563
563
|
break;
|
|
564
564
|
}
|
|
565
565
|
return o ? e.draftUnsaved : "";
|
|
566
|
-
},
|
|
566
|
+
}, yr = (e, t, n) => {
|
|
567
567
|
switch (t.kind) {
|
|
568
568
|
case "saved":
|
|
569
569
|
return t.merged ? e.documentSavedMerged(n) : e.documentSaved(n);
|
|
@@ -587,24 +587,24 @@ const bt = Object.freeze(["en", "ja"]), dr = "en", ur = Object.freeze({
|
|
|
587
587
|
for (const t of [...e]) t();
|
|
588
588
|
}
|
|
589
589
|
};
|
|
590
|
-
},
|
|
591
|
-
`)),
|
|
590
|
+
}, xr = "<<<<<<<", kr = "=======", Sr = ">>>>>>>", xt = (e, t) => e === t || e.startsWith(`${t} `), kt = (e) => Rr(e.split(`
|
|
591
|
+
`)), Rr = (e) => {
|
|
592
592
|
const t = [];
|
|
593
593
|
let n = null, r = null, o = 0;
|
|
594
594
|
for (const l of e) {
|
|
595
595
|
o += 1;
|
|
596
596
|
const i = l.charCodeAt(0);
|
|
597
|
-
i !== 60 && i !== 61 && i !== 62 || (xt(l,
|
|
597
|
+
i !== 60 && i !== 61 && i !== 62 || (xt(l, xr) ? (n = o, r = null) : l === kr ? n !== null && r === null ? r = o : n = null : xt(l, Sr) && (n !== null && r !== null && t.push({ start: n, separator: r, end: o }), n = null, r = null));
|
|
598
598
|
}
|
|
599
599
|
return t;
|
|
600
600
|
}, St = (e) => e.includes(`\r
|
|
601
601
|
`) ? `\r
|
|
602
602
|
` : `
|
|
603
|
-
`,
|
|
604
|
-
`),
|
|
603
|
+
`, Ue = (e) => e.replace(/\r\n?/gu, `
|
|
604
|
+
`), Tr = (e, t) => t === `
|
|
605
605
|
` ? e : e.replaceAll(`
|
|
606
606
|
`, `\r
|
|
607
|
-
`),
|
|
607
|
+
`), Cr = 3, Ze = Object.freeze({ kind: "idle" }), Or = ({ data: e, conflictLabels: t, onSaveSettled: n, previewSetting: r }) => {
|
|
608
608
|
const o = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), d = /* @__PURE__ */ new Map(), g = /* @__PURE__ */ new Map(), f = ye();
|
|
609
609
|
let u = null, p = null;
|
|
610
610
|
const m = (s, c) => {
|
|
@@ -623,8 +623,8 @@ const bt = Object.freeze(["en", "ja"]), dr = "en", ur = Object.freeze({
|
|
|
623
623
|
m(c, { phase: { kind: "failed", failure: w.failure } });
|
|
624
624
|
return;
|
|
625
625
|
}
|
|
626
|
-
const k =
|
|
627
|
-
c.base = { text: k, version: w.version }, c.draft = k, c.ending = St(w.text), m(c, { phase: { kind: "editing" }, history: w.history, dirty: !1, save:
|
|
626
|
+
const k = Ue(w.text);
|
|
627
|
+
c.base = { text: k, version: w.version }, c.draft = k, c.ending = St(w.text), m(c, { phase: { kind: "editing" }, history: w.history, dirty: !1, save: Ze, generation: c.value.generation + 1 });
|
|
628
628
|
}, y = (s) => {
|
|
629
629
|
const c = o.get(s);
|
|
630
630
|
c !== void 0 && (c.controller.abort(), o.delete(s), i.delete(s));
|
|
@@ -645,8 +645,8 @@ const bt = Object.freeze(["en", "ja"]), dr = "en", ur = Object.freeze({
|
|
|
645
645
|
const { signal: w } = c.controller;
|
|
646
646
|
let k = c.base, L = c.draft, R = !1;
|
|
647
647
|
m(c, { save: { kind: "saving" } });
|
|
648
|
-
for (let N = 0; N <
|
|
649
|
-
const q = await e.save(s, k.version,
|
|
648
|
+
for (let N = 0; N < Cr; N += 1) {
|
|
649
|
+
const q = await e.save(s, k.version, Tr(L, c.ending), w);
|
|
650
650
|
if (!x(s, c) || w.aborted || !("kind" in q)) return;
|
|
651
651
|
if (q.kind === "saved") {
|
|
652
652
|
d.get(s)?.flush(), c.base = { text: L, version: q.version }, S(s, c, { kind: "saved", merged: R }, { dirty: c.draft !== L });
|
|
@@ -660,11 +660,11 @@ const bt = Object.freeze(["en", "ja"]), dr = "en", ur = Object.freeze({
|
|
|
660
660
|
S(s, c, { kind: "failed", failure: q.failure });
|
|
661
661
|
return;
|
|
662
662
|
}
|
|
663
|
-
const { mergeDraft: W } = await import("./merge-
|
|
663
|
+
const { mergeDraft: W } = await import("./merge-SRCxtHk2.js");
|
|
664
664
|
if (!x(s, c) || w.aborted) return;
|
|
665
665
|
const J = d.get(s);
|
|
666
666
|
J?.flush();
|
|
667
|
-
const ee =
|
|
667
|
+
const ee = Ue(q.text), X = W(k.text, c.draft, ee, t());
|
|
668
668
|
if (k = { text: ee, version: q.version }, c.base = k, c.ending = St(q.text), c.draft = X.text, J?.adopt(X.text), X.kind === "conflicts") {
|
|
669
669
|
S(s, c, { kind: "conflicts", count: X.conflicts }, { dirty: !0, generation: c.value.generation + 1 });
|
|
670
670
|
return;
|
|
@@ -688,7 +688,7 @@ const bt = Object.freeze(["en", "ja"]), dr = "en", ur = Object.freeze({
|
|
|
688
688
|
}
|
|
689
689
|
l.delete(s);
|
|
690
690
|
const w = {
|
|
691
|
-
value: { path: s, phase: { kind: "opening" }, history: !1, dirty: !1, save:
|
|
691
|
+
value: { path: s, phase: { kind: "opening" }, history: !1, dirty: !1, save: Ze, generation: 0, request: { anchor: c } },
|
|
692
692
|
base: null,
|
|
693
693
|
draft: "",
|
|
694
694
|
ending: `
|
|
@@ -714,7 +714,7 @@ const bt = Object.freeze(["en", "ja"]), dr = "en", ur = Object.freeze({
|
|
|
714
714
|
const { save: L } = h.value;
|
|
715
715
|
if (L.kind === "conflicts") {
|
|
716
716
|
const R = kt(c).length;
|
|
717
|
-
R === 0 ? w.save =
|
|
717
|
+
R === 0 ? w.save = Ze : R !== L.count && (w.save = { kind: "conflicts", count: R });
|
|
718
718
|
}
|
|
719
719
|
(w.dirty !== void 0 || w.save !== void 0) && m(h, w);
|
|
720
720
|
},
|
|
@@ -728,7 +728,7 @@ const bt = Object.freeze(["en", "ja"]), dr = "en", ur = Object.freeze({
|
|
|
728
728
|
h?.flush();
|
|
729
729
|
const w = o.get(s);
|
|
730
730
|
if (w === void 0 || w.base === null) return;
|
|
731
|
-
const k =
|
|
731
|
+
const k = Ue(c);
|
|
732
732
|
w.draft = k, h?.adopt(k), m(w, { dirty: k !== w.base.text, generation: w.value.generation + 1 });
|
|
733
733
|
},
|
|
734
734
|
close: (s) => {
|
|
@@ -809,7 +809,7 @@ const bt = Object.freeze(["en", "ja"]), dr = "en", ur = Object.freeze({
|
|
|
809
809
|
/* @__PURE__ */ a("button", { type: "button", className: "aqmx-callout-action", "data-aqmx-tone": "danger", "data-testid": `${d}-confirm`, onClick: l, children: r })
|
|
810
810
|
] })
|
|
811
811
|
] }) });
|
|
812
|
-
},
|
|
812
|
+
}, Ar = (e, t) => {
|
|
813
813
|
const n = An({ path: `${e.basePath}/*`, end: !0 }, t.pathname);
|
|
814
814
|
if (n === null) return /* @__PURE__ */ new Set();
|
|
815
815
|
const { location: r } = Kt(e, n.params["*"], new URLSearchParams(t.search));
|
|
@@ -823,22 +823,22 @@ const bt = Object.freeze(["en", "ja"]), dr = "en", ur = Object.freeze({
|
|
|
823
823
|
}
|
|
824
824
|
}, sn = (e) => {
|
|
825
825
|
const { edits: t } = D(), n = P(() => t.session(e), [t, e]);
|
|
826
|
-
return te(t.subscribe, n,
|
|
827
|
-
}, an = () => !1,
|
|
828
|
-
},
|
|
826
|
+
return te(t.subscribe, n, Lr);
|
|
827
|
+
}, an = () => !1, Lr = () => {
|
|
828
|
+
}, Mr = () => {
|
|
829
829
|
const { edits: e } = D();
|
|
830
830
|
return te(e.subscribe, e.hasSessions, an);
|
|
831
|
-
},
|
|
831
|
+
}, Nr = () => {
|
|
832
832
|
const { edits: e } = D();
|
|
833
833
|
return te(e.subscribe, e.previewShown, an);
|
|
834
|
-
},
|
|
834
|
+
}, Dr = () => null, $r = () => {
|
|
835
835
|
const { edits: e, labels: t, config: n } = D(), r = B([]), o = P(
|
|
836
836
|
({ nextLocation: p }) => {
|
|
837
|
-
const m =
|
|
837
|
+
const m = Ar(n, p);
|
|
838
838
|
return e.flushDrafts(), r.current = e.dirtyPaths().filter((x) => !m.has(x)), r.current.length > 0;
|
|
839
839
|
},
|
|
840
840
|
[e, n]
|
|
841
|
-
), l = Ln(o), i =
|
|
841
|
+
), l = Ln(o), i = Mr();
|
|
842
842
|
ne(() => {
|
|
843
843
|
if (!i) return;
|
|
844
844
|
const p = (m) => {
|
|
@@ -846,7 +846,7 @@ const bt = Object.freeze(["en", "ja"]), dr = "en", ur = Object.freeze({
|
|
|
846
846
|
};
|
|
847
847
|
return window.addEventListener("beforeunload", p), () => window.removeEventListener("beforeunload", p);
|
|
848
848
|
}, [i, e]);
|
|
849
|
-
const d = te(e.subscribe, e.discardRequest,
|
|
849
|
+
const d = te(e.subscribe, e.discardRequest, Dr), g = l.state === "blocked", u = (g ? r.current : d === null ? [] : d.paths).map((p) => Ee(p)).join(", ");
|
|
850
850
|
return /* @__PURE__ */ a(
|
|
851
851
|
ln,
|
|
852
852
|
{
|
|
@@ -873,7 +873,7 @@ const bt = Object.freeze(["en", "ja"]), dr = "en", ur = Object.freeze({
|
|
|
873
873
|
}
|
|
874
874
|
);
|
|
875
875
|
};
|
|
876
|
-
function
|
|
876
|
+
function Pr({
|
|
877
877
|
title: e,
|
|
878
878
|
titleId: t,
|
|
879
879
|
...n
|
|
@@ -894,18 +894,18 @@ function $r({
|
|
|
894
894
|
clipRule: "evenodd"
|
|
895
895
|
}));
|
|
896
896
|
}
|
|
897
|
-
const
|
|
897
|
+
const Fr = /* @__PURE__ */ b.forwardRef(Pr);
|
|
898
898
|
let Ve = null;
|
|
899
|
-
const cn = () => (Ve ??= import("./EditSurface-
|
|
899
|
+
const cn = () => (Ve ??= import("./EditSurface-1Jf0CG-f.js").catch((e) => {
|
|
900
900
|
throw Ve = null, e;
|
|
901
901
|
}), Ve), Rt = () => {
|
|
902
902
|
cn().catch(() => {
|
|
903
903
|
});
|
|
904
|
-
},
|
|
904
|
+
}, qr = (e) => {
|
|
905
905
|
const { default: t } = re(cn());
|
|
906
906
|
return /* @__PURE__ */ a(t, { ...e });
|
|
907
907
|
};
|
|
908
|
-
class
|
|
908
|
+
class _r extends Vt {
|
|
909
909
|
state = { failed: !1 };
|
|
910
910
|
static getDerivedStateFromError() {
|
|
911
911
|
return { failed: !0 };
|
|
@@ -915,7 +915,7 @@ class qr extends Vt {
|
|
|
915
915
|
return this.state.failed ? this.props.fallback(this.retry) : this.props.children;
|
|
916
916
|
}
|
|
917
917
|
}
|
|
918
|
-
const rt = `[${Xt}]`,
|
|
918
|
+
const rt = `[${Xt}]`, Br = "[data-aqmd-content]", Ir = 'a[href], button, input, select, textarea, summary, label, [contenteditable], [role="menu"], iframe, video, audio, object, embed, svg', jr = 200, we = (e) => sr(e.getAttribute(Xt)), Hr = (e, t) => {
|
|
919
919
|
for (let r = e; r !== null && t.contains(r); r = r.parentElement) {
|
|
920
920
|
const o = we(r);
|
|
921
921
|
if (o !== null) return { block: r, lines: o, own: !0 };
|
|
@@ -927,43 +927,43 @@ const rt = `[${Xt}]`, _r = "[data-aqmd-content]", Br = 'a[href], button, input,
|
|
|
927
927
|
o !== null && (n = { block: r, lines: o });
|
|
928
928
|
}
|
|
929
929
|
return n === null ? null : { ...n, own: !1 };
|
|
930
|
-
},
|
|
930
|
+
}, zr = (e, t) => {
|
|
931
931
|
let n = 0;
|
|
932
932
|
for (let r = e.indexOf(t); r >= 0; r = e.indexOf(t, r + t.length)) n += 1;
|
|
933
933
|
return n;
|
|
934
|
-
},
|
|
935
|
-
const r =
|
|
934
|
+
}, Ur = (e) => e.closest(Br) !== null && e.closest(Ir) === null, Zr = (e, t, n) => {
|
|
935
|
+
const r = Hr(e, t);
|
|
936
936
|
if (r === null) return null;
|
|
937
937
|
const { block: o, own: l } = r;
|
|
938
938
|
if (!l) {
|
|
939
939
|
const d = r.lines.last + 1;
|
|
940
940
|
return { lines: { first: d, last: d }, word: null, occurrence: 0, clientTop: Le(e) };
|
|
941
941
|
}
|
|
942
|
-
const i =
|
|
942
|
+
const i = Wr(o, n);
|
|
943
943
|
return i === null ? { lines: r.lines, word: null, occurrence: 0, clientTop: Le(o) } : { lines: r.lines, word: i.text, occurrence: i.occurrence, clientTop: i.clientTop };
|
|
944
|
-
},
|
|
944
|
+
}, Vr = (e, t) => {
|
|
945
945
|
let n = null, r = null, o = null;
|
|
946
946
|
for (const i of e.querySelectorAll(rt)) {
|
|
947
947
|
const d = we(i);
|
|
948
948
|
if (d === null) continue;
|
|
949
|
-
n ??=
|
|
949
|
+
n ??= Kr(t, i);
|
|
950
950
|
const { top: g, bottom: f } = i.getBoundingClientRect();
|
|
951
951
|
g <= n && n < f ? r = { lines: d, block: i } : o === null && g >= n && (o = { lines: d, block: i });
|
|
952
952
|
}
|
|
953
953
|
const l = r === null ? o : r;
|
|
954
954
|
return l === null ? null : { lines: l.lines, word: null, occurrence: 0, clientTop: Le(l.block) };
|
|
955
|
-
},
|
|
955
|
+
}, Gr = (e) => e === e.ownerDocument.scrollingElement ? 0 : e.getBoundingClientRect().top + e.clientTop, Kr = (e, t) => {
|
|
956
956
|
const n = Number.parseFloat(getComputedStyle(t).scrollMarginTop);
|
|
957
|
-
return
|
|
958
|
-
},
|
|
957
|
+
return Gr(e) + (Number.isFinite(n) ? n : 0);
|
|
958
|
+
}, Wr = (e, t) => {
|
|
959
959
|
if (t === null || t.rangeCount === 0) return null;
|
|
960
960
|
const n = t.getRangeAt(0);
|
|
961
961
|
if (!(e.contains(n.startContainer) && e.contains(n.endContainer))) return null;
|
|
962
962
|
const r = n.toString().trim();
|
|
963
|
-
if (r === "" || r.length >
|
|
963
|
+
if (r === "" || r.length > jr || /[\r\n]/u.test(r)) return null;
|
|
964
964
|
const o = e.ownerDocument.createRange();
|
|
965
|
-
return o.setStart(e, 0), o.setEnd(n.startContainer, n.startOffset), { text: r, occurrence:
|
|
966
|
-
},
|
|
965
|
+
return o.setStart(e, 0), o.setEnd(n.startContainer, n.startOffset), { text: r, occurrence: zr(o.toString(), r), clientTop: n.getBoundingClientRect().top };
|
|
966
|
+
}, ns = (e, t) => {
|
|
967
967
|
const n = e.split(`
|
|
968
968
|
`), r = Math.min(t.lines.first, n.length), o = Math.min(t.lines.last, n.length), l = { line: r, column: 0 };
|
|
969
969
|
if (t.word === null) return l;
|
|
@@ -975,21 +975,21 @@ const rt = `[${Xt}]`, _r = "[data-aqmd-content]", Br = 'a[href], button, input,
|
|
|
975
975
|
i += 1;
|
|
976
976
|
}
|
|
977
977
|
}
|
|
978
|
-
return i > 0 ?
|
|
979
|
-
},
|
|
978
|
+
return i > 0 ? Xr(n, r, o, t.word) ?? l : l;
|
|
979
|
+
}, Xr = (e, t, n, r) => {
|
|
980
980
|
for (let o = n; o >= t; o -= 1) {
|
|
981
981
|
const l = (e[o - 1] ?? "").lastIndexOf(r);
|
|
982
982
|
if (l >= 0) return { line: o, column: l };
|
|
983
983
|
}
|
|
984
984
|
return null;
|
|
985
|
-
},
|
|
985
|
+
}, Yr = (e, t) => {
|
|
986
986
|
let n = null, r = null;
|
|
987
987
|
for (const o of e.querySelectorAll(rt)) {
|
|
988
988
|
const l = we(o);
|
|
989
989
|
l === null || l.first > t || (l.last >= t ? n = o : (r === null || l.last >= r.last) && (r = { element: o, last: l.last }));
|
|
990
990
|
}
|
|
991
991
|
return n !== null ? n : r === null ? null : r.element;
|
|
992
|
-
},
|
|
992
|
+
}, Jr = (e, t) => {
|
|
993
993
|
const { bottom: n } = e.getBoundingClientRect(), r = Le(e), o = we(e);
|
|
994
994
|
if (o === null) return r;
|
|
995
995
|
const l = Math.min(Math.max(t - o.first, 0) / (o.last - o.first + 1), 1);
|
|
@@ -1010,7 +1010,7 @@ const rt = `[${Xt}]`, _r = "[data-aqmd-content]", Br = 'a[href], button, input,
|
|
|
1010
1010
|
"switch-source": Object.freeze({ replace: !1, preventScrollReset: !0, defaultShouldRevalidate: !1 }),
|
|
1011
1011
|
"switch-view": Object.freeze({ replace: !1, preventScrollReset: !1, defaultShouldRevalidate: !1 }),
|
|
1012
1012
|
"follow-link": Object.freeze({ replace: !1, preventScrollReset: !1, defaultShouldRevalidate: !1 })
|
|
1013
|
-
}),
|
|
1013
|
+
}), rs = (e) => ot[e], $e = () => {
|
|
1014
1014
|
const e = Mn();
|
|
1015
1015
|
return P(
|
|
1016
1016
|
(t, n) => {
|
|
@@ -1018,7 +1018,7 @@ const rt = `[${Xt}]`, _r = "[data-aqmd-content]", Br = 'a[href], button, input,
|
|
|
1018
1018
|
},
|
|
1019
1019
|
[e]
|
|
1020
1020
|
);
|
|
1021
|
-
},
|
|
1021
|
+
}, Qr = ({ navigation: e, ...t }) => /* @__PURE__ */ a(Nn, { ...t, ...ot[e] }), dn = (e) => {
|
|
1022
1022
|
const t = e.ownerDocument;
|
|
1023
1023
|
if (e.focus({ preventScroll: !0 }), t.activeElement === e) return !0;
|
|
1024
1024
|
if (e.hasAttribute("tabindex")) return !1;
|
|
@@ -1028,7 +1028,7 @@ const rt = `[${Xt}]`, _r = "[data-aqmd-content]", Br = 'a[href], button, input,
|
|
|
1028
1028
|
t.activeElement !== e && (e.removeAttribute("tabindex"), e.removeEventListener("blur", n));
|
|
1029
1029
|
};
|
|
1030
1030
|
return e.addEventListener("blur", n), !0;
|
|
1031
|
-
},
|
|
1031
|
+
}, eo = (e, t) => {
|
|
1032
1032
|
const n = B(null), r = B(null), o = B(null), l = P(() => {
|
|
1033
1033
|
n.current !== null && window.clearTimeout(n.current), n.current = null, r.current = null;
|
|
1034
1034
|
}, []);
|
|
@@ -1064,7 +1064,7 @@ const rt = `[${Xt}]`, _r = "[data-aqmd-content]", Br = 'a[href], button, input,
|
|
|
1064
1064
|
},
|
|
1065
1065
|
[l, t]
|
|
1066
1066
|
);
|
|
1067
|
-
return
|
|
1067
|
+
return U(
|
|
1068
1068
|
() => ({
|
|
1069
1069
|
onPointerOver: (f) => d(f.target),
|
|
1070
1070
|
onPointerOut: (f) => g(f.relatedTarget),
|
|
@@ -1073,8 +1073,8 @@ const rt = `[${Xt}]`, _r = "[data-aqmd-content]", Br = 'a[href], button, input,
|
|
|
1073
1073
|
}),
|
|
1074
1074
|
[d, g]
|
|
1075
1075
|
);
|
|
1076
|
-
},
|
|
1077
|
-
class
|
|
1076
|
+
}, to = tt(() => import("./NativeScrollBar-CyiyL47o.js").then((e) => ({ default: e.NativeScrollBar })));
|
|
1077
|
+
class no extends Vt {
|
|
1078
1078
|
state = { failed: !1 };
|
|
1079
1079
|
static getDerivedStateFromError() {
|
|
1080
1080
|
return { failed: !0 };
|
|
@@ -1086,7 +1086,7 @@ class to extends Vt {
|
|
|
1086
1086
|
return this.state.failed ? null : this.props.children;
|
|
1087
1087
|
}
|
|
1088
1088
|
}
|
|
1089
|
-
const
|
|
1089
|
+
const ro = ({ scroller: e, withCircle: t }) => /* @__PURE__ */ a(no, { children: /* @__PURE__ */ a(ge, { fallback: null, children: /* @__PURE__ */ a(to, { scroller: e, withCircle: t }) }) }), un = (e) => /* @__PURE__ */ a(ro, { scroller: e, withCircle: !0 }), fn = () => {
|
|
1090
1090
|
const e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Set();
|
|
1091
1091
|
let n = !1;
|
|
1092
1092
|
const r = (o) => {
|
|
@@ -1130,7 +1130,7 @@ const no = ({ scroller: e, withCircle: t }) => /* @__PURE__ */ a(to, { children:
|
|
|
1130
1130
|
t.status = "rejected", t.reason = n;
|
|
1131
1131
|
}
|
|
1132
1132
|
)), t;
|
|
1133
|
-
}, mn = (e) => Object.assign(Promise.resolve(e), { status: "fulfilled", value: e }), Se = (e) => e.status === "fulfilled" ? e.value : void 0,
|
|
1133
|
+
}, mn = (e) => Object.assign(Promise.resolve(e), { status: "fulfilled", value: e }), Se = (e) => e.status === "fulfilled" ? e.value : void 0, oo = 55e3, Tt = Object.freeze({ status: "deferred" }), Ct = Object.freeze({ status: "refreshed" }), Ge = Object.freeze({ status: "superseded" }), de = (e) => e === void 0 || e.status === "deferred" ? null : e.status === "loaded" ? e : e.previous, hn = (e) => e !== void 0 && e.status === "loaded" && e.document.kind !== "failure", lo = ({ client: e, capacity: t }) => {
|
|
1134
1134
|
if (!Number.isInteger(t) || t < 1) throw new RangeError(`[markdown-explorer] the document cache capacity must be a positive integer; got ${String(t)}`);
|
|
1135
1135
|
const n = /* @__PURE__ */ new Map(), r = fn(), o = ye(), l = /* @__PURE__ */ new WeakSet();
|
|
1136
1136
|
let i = 0;
|
|
@@ -1142,7 +1142,7 @@ const no = ({ scroller: e, withCircle: t }) => /* @__PURE__ */ a(to, { children:
|
|
|
1142
1142
|
}
|
|
1143
1143
|
}, u = (s, c) => {
|
|
1144
1144
|
n.delete(s), n.set(s, c);
|
|
1145
|
-
}, p = (s) => performance.now() - s.validatedAt >=
|
|
1145
|
+
}, p = (s) => performance.now() - s.validatedAt >= oo, m = (s, c, h) => {
|
|
1146
1146
|
const w = n.get(s), k = de(w?.snapshot), L = h || w?.refreshPending === !0, R = be(e.document(s, { refresh: L }).then((q) => ({ status: "loaded", document: q }))), N = { snapshot: { status: "pending", promise: R, previous: k }, validatedAt: performance.now(), opened: c, background: null, refreshPending: !1, seeded: void 0, stamp: g() };
|
|
1147
1147
|
return u(s, N), f(), R.then((q) => {
|
|
1148
1148
|
n.get(s) === N && (N.snapshot = q, N.stamp = g(), d());
|
|
@@ -1249,7 +1249,7 @@ const no = ({ scroller: e, withCircle: t }) => /* @__PURE__ */ a(to, { children:
|
|
|
1249
1249
|
noteFailureShown: (s) => l.has(s) ? !1 : (l.add(s), !0)
|
|
1250
1250
|
};
|
|
1251
1251
|
};
|
|
1252
|
-
function
|
|
1252
|
+
function io({
|
|
1253
1253
|
title: e,
|
|
1254
1254
|
titleId: t,
|
|
1255
1255
|
...n
|
|
@@ -1274,8 +1274,8 @@ function lo({
|
|
|
1274
1274
|
clipRule: "evenodd"
|
|
1275
1275
|
}));
|
|
1276
1276
|
}
|
|
1277
|
-
const
|
|
1278
|
-
function
|
|
1277
|
+
const so = /* @__PURE__ */ b.forwardRef(io);
|
|
1278
|
+
function ao({
|
|
1279
1279
|
title: e,
|
|
1280
1280
|
titleId: t,
|
|
1281
1281
|
...n
|
|
@@ -1298,8 +1298,8 @@ function so({
|
|
|
1298
1298
|
d: "M3.5 6A1.5 1.5 0 0 0 2 7.5v9A1.5 1.5 0 0 0 3.5 18h7a1.5 1.5 0 0 0 1.5-1.5v-5.879a1.5 1.5 0 0 0-.44-1.06L8.44 6.439A1.5 1.5 0 0 0 7.378 6H3.5Z"
|
|
1299
1299
|
}));
|
|
1300
1300
|
}
|
|
1301
|
-
const
|
|
1302
|
-
function
|
|
1301
|
+
const co = /* @__PURE__ */ b.forwardRef(ao);
|
|
1302
|
+
function uo({
|
|
1303
1303
|
title: e,
|
|
1304
1304
|
titleId: t,
|
|
1305
1305
|
...n
|
|
@@ -1320,29 +1320,29 @@ function co({
|
|
|
1320
1320
|
clipRule: "evenodd"
|
|
1321
1321
|
}));
|
|
1322
1322
|
}
|
|
1323
|
-
const
|
|
1323
|
+
const fo = /* @__PURE__ */ b.forwardRef(uo), mo = 2e3, Ot = Object.freeze({ outcome: "idle" }), ho = (e) => {
|
|
1324
1324
|
const t = navigator.clipboard;
|
|
1325
1325
|
return t === void 0 ? Promise.reject(new Error("[markdown-explorer] this browser has no asynchronous clipboard")) : t.writeText(e);
|
|
1326
|
-
},
|
|
1326
|
+
}, po = ({ text: e }) => {
|
|
1327
1327
|
const { announcer: t, labels: n } = D(), [r, o] = I(Ot);
|
|
1328
1328
|
ne(() => {
|
|
1329
1329
|
if (r.outcome === "idle") return;
|
|
1330
|
-
const g = setTimeout(() => o(Ot),
|
|
1330
|
+
const g = setTimeout(() => o(Ot), mo);
|
|
1331
1331
|
return () => clearTimeout(g);
|
|
1332
1332
|
}, [r]);
|
|
1333
1333
|
const l = (g) => {
|
|
1334
1334
|
o({ outcome: g }), t.announce(g === "copied" ? n.copiedText : n.copyTextFailed);
|
|
1335
1335
|
}, i = () => {
|
|
1336
|
-
|
|
1336
|
+
ho(e).then(
|
|
1337
1337
|
() => l("copied"),
|
|
1338
1338
|
() => l("failed")
|
|
1339
1339
|
);
|
|
1340
1340
|
}, d = r.outcome === "copied" ? n.copiedText : r.outcome === "failed" ? n.copyTextFailed : n.copyText;
|
|
1341
1341
|
return (
|
|
1342
|
-
/* @__PURE__ */ a("button", { type: "button", className: "aqmx-icon-button", "aria-label": n.copyText, title: d, onClick: i, "data-aqmx-copy-outcome": r.outcome, "data-testid": "markdown-explorer-file-copy", children: r.outcome === "copied" ? /* @__PURE__ */ a(
|
|
1342
|
+
/* @__PURE__ */ a("button", { type: "button", className: "aqmx-icon-button", "aria-label": n.copyText, title: d, onClick: i, "data-aqmx-copy-outcome": r.outcome, "data-testid": "markdown-explorer-file-copy", children: r.outcome === "copied" ? /* @__PURE__ */ a(so, {}) : r.outcome === "failed" ? /* @__PURE__ */ a(fo, {}) : /* @__PURE__ */ a(co, {}) })
|
|
1343
1343
|
);
|
|
1344
|
-
}, fe = me("fill"),
|
|
1345
|
-
function
|
|
1344
|
+
}, fe = me("fill"), go = Object.freeze({ blockSize: "100%" }), xe = ({ scrollerProps: e, children: t }) => re(fe) === "content" ? /* @__PURE__ */ a(vt, { scrollerProps: e, children: t }) : /* @__PURE__ */ a(vt, { scrollerProps: { ...e, style: go }, rowClassName: "aqmx-document-scroll-row", renderScrollBar: un, children: t });
|
|
1345
|
+
function vo({
|
|
1346
1346
|
title: e,
|
|
1347
1347
|
titleId: t,
|
|
1348
1348
|
...n
|
|
@@ -1363,8 +1363,8 @@ function go({
|
|
|
1363
1363
|
d: "M3.5 12.75a.75.75 0 0 0-1.5 0v2.5A2.75 2.75 0 0 0 4.75 18h10.5A2.75 2.75 0 0 0 18 15.25v-2.5a.75.75 0 0 0-1.5 0v2.5c0 .69-.56 1.25-1.25 1.25H4.75c-.69 0-1.25-.56-1.25-1.25v-2.5Z"
|
|
1364
1364
|
}));
|
|
1365
1365
|
}
|
|
1366
|
-
const
|
|
1367
|
-
function
|
|
1366
|
+
const wo = /* @__PURE__ */ b.forwardRef(vo);
|
|
1367
|
+
function bo({
|
|
1368
1368
|
title: e,
|
|
1369
1369
|
titleId: t,
|
|
1370
1370
|
...n
|
|
@@ -1389,17 +1389,17 @@ function wo({
|
|
|
1389
1389
|
clipRule: "evenodd"
|
|
1390
1390
|
}));
|
|
1391
1391
|
}
|
|
1392
|
-
const
|
|
1393
|
-
const { labels:
|
|
1392
|
+
const Eo = /* @__PURE__ */ b.forwardRef(bo), Pe = ({ name: e, openUrl: t, downloadUrl: n, icon: r, children: o }) => {
|
|
1393
|
+
const { labels: l } = D();
|
|
1394
1394
|
return /* @__PURE__ */ F("div", { className: "aqmx-document-toolbar", children: [
|
|
1395
|
-
/* @__PURE__ */ a("span", { className: "aqmx-document-file-icon", "aria-hidden": "true", children:
|
|
1395
|
+
/* @__PURE__ */ a("span", { className: "aqmx-document-file-icon", "aria-hidden": "true", children: r }),
|
|
1396
1396
|
/* @__PURE__ */ a("span", { className: "aqmx-document-title", title: e, "data-testid": "markdown-explorer-file-name", children: e }),
|
|
1397
|
-
|
|
1398
|
-
/* @__PURE__ */ a("a", { className: "aqmx-icon-button", href: t, target: "_blank", rel: "noopener noreferrer", "aria-label":
|
|
1399
|
-
/* @__PURE__ */ a("a", { className: "aqmx-icon-button", href:
|
|
1397
|
+
o,
|
|
1398
|
+
/* @__PURE__ */ a("a", { className: "aqmx-icon-button", href: t, target: "_blank", rel: "noopener noreferrer", "aria-label": l.openInNewTab, title: l.openInNewTab, "data-testid": "markdown-explorer-file-open", children: /* @__PURE__ */ a(Eo, {}) }),
|
|
1399
|
+
/* @__PURE__ */ a("a", { className: "aqmx-icon-button", href: n, download: e, "aria-label": l.download, title: l.download, "data-testid": "markdown-explorer-file-download", children: /* @__PURE__ */ a(wo, {}) })
|
|
1400
1400
|
] });
|
|
1401
1401
|
};
|
|
1402
|
-
function
|
|
1402
|
+
function yo({
|
|
1403
1403
|
title: e,
|
|
1404
1404
|
titleId: t,
|
|
1405
1405
|
...n
|
|
@@ -1420,23 +1420,23 @@ function Eo({
|
|
|
1420
1420
|
clipRule: "evenodd"
|
|
1421
1421
|
}));
|
|
1422
1422
|
}
|
|
1423
|
-
const
|
|
1423
|
+
const xo = /* @__PURE__ */ b.forwardRef(yo), ko = Object.freeze({ className: "aqmx-document-stage" }), So = ({ document: e }) => {
|
|
1424
1424
|
const { labels: t } = D();
|
|
1425
1425
|
return /* @__PURE__ */ F("div", { className: "aqmx-document-file", "data-testid": "markdown-explorer-file-view", children: [
|
|
1426
|
-
/* @__PURE__ */ a(Pe, { name: e.name, url: e.url, icon: /* @__PURE__ */ a(
|
|
1427
|
-
/* @__PURE__ */ a(xe, { scrollerProps:
|
|
1426
|
+
/* @__PURE__ */ a(Pe, { name: e.name, openUrl: e.url, downloadUrl: e.url, icon: /* @__PURE__ */ a(xo, {}) }),
|
|
1427
|
+
/* @__PURE__ */ a(xe, { scrollerProps: ko, children: /* @__PURE__ */ F("div", { className: "aqmx-callout", role: "note", "data-testid": "markdown-explorer-file-not-shown", children: [
|
|
1428
1428
|
/* @__PURE__ */ a("p", { className: "aqmx-callout-body", children: t.fileNotShown }),
|
|
1429
1429
|
/* @__PURE__ */ a("a", { className: "aqmx-callout-action", href: e.url, download: e.name, "data-testid": "markdown-explorer-file-not-shown-download", children: t.download })
|
|
1430
1430
|
] }) })
|
|
1431
1431
|
] });
|
|
1432
|
-
}, Fe = "[data-aqmd-scroll-container], [data-aqmx-document-scroller]",
|
|
1432
|
+
}, Fe = "[data-aqmd-scroll-container], [data-aqmx-document-scroller]", Ro = (e) => {
|
|
1433
1433
|
const t = e.indexOf("#");
|
|
1434
1434
|
return t === -1 ? "" : e.slice(t);
|
|
1435
|
-
},
|
|
1435
|
+
}, To = /(%[0-9A-Fa-f]{2})/u, lt = (e) => {
|
|
1436
1436
|
if (!e.startsWith("#") || e.length === 1) return null;
|
|
1437
|
-
const t = new TextEncoder(), n = e.slice(1).split(
|
|
1437
|
+
const t = new TextEncoder(), n = e.slice(1).split(To).flatMap((r, o) => o % 2 === 1 ? [Number.parseInt(r.slice(1), 16)] : [...t.encode(r)]);
|
|
1438
1438
|
return new TextDecoder("utf-8", { ignoreBOM: !0 }).decode(Uint8Array.from(n));
|
|
1439
|
-
}, pn = (e) => `#${encodeURIComponent(e)}`,
|
|
1439
|
+
}, pn = (e) => `#${encodeURIComponent(e)}`, Co = (e) => {
|
|
1440
1440
|
if (e === "#") return !0;
|
|
1441
1441
|
const t = lt(e);
|
|
1442
1442
|
return t !== null && t.replace(/[A-Z]/gu, (n) => n.toLowerCase()) === "top";
|
|
@@ -1445,12 +1445,12 @@ const yo = /* @__PURE__ */ b.forwardRef(Eo), xo = Object.freeze({ className: "aq
|
|
|
1445
1445
|
for (const n of e.querySelectorAll("[id]"))
|
|
1446
1446
|
if (n.id === t) return n;
|
|
1447
1447
|
return null;
|
|
1448
|
-
},
|
|
1448
|
+
}, Oo = "http://www.w3.org/1999/xhtml", At = (e, t) => {
|
|
1449
1449
|
if (t === "") return null;
|
|
1450
1450
|
const n = gn(e, t);
|
|
1451
1451
|
if (n !== null) return n;
|
|
1452
1452
|
for (const r of e.querySelectorAll("a[name]"))
|
|
1453
|
-
if (r.localName === "a" && r.namespaceURI ===
|
|
1453
|
+
if (r.localName === "a" && r.namespaceURI === Oo && r.getAttribute("name") === t) return r;
|
|
1454
1454
|
return null;
|
|
1455
1455
|
}, vn = (e, t) => {
|
|
1456
1456
|
if (e === null || !t.startsWith("#")) return null;
|
|
@@ -1466,22 +1466,22 @@ const yo = /* @__PURE__ */ b.forwardRef(Eo), xo = Object.freeze({ className: "aq
|
|
|
1466
1466
|
}
|
|
1467
1467
|
const { overflowY: r } = getComputedStyle(e);
|
|
1468
1468
|
return r === "auto" || r === "scroll";
|
|
1469
|
-
},
|
|
1469
|
+
}, Ao = (e) => {
|
|
1470
1470
|
const { body: t, documentElement: n } = e, r = getComputedStyle(n), o = r.overflowX === "visible" && r.overflowY === "visible" && t !== null ? getComputedStyle(t).overflowY : r.overflowY;
|
|
1471
1471
|
return o !== "hidden" && o !== "clip";
|
|
1472
|
-
},
|
|
1472
|
+
}, Lo = (e, t) => {
|
|
1473
1473
|
const n = t.closest(Fe), r = n !== null && e.contains(n) ? n : e;
|
|
1474
1474
|
if (r.scrollHeight > r.clientHeight && Lt(r)) return r;
|
|
1475
1475
|
const o = e.getBoundingClientRect().height, { documentElement: l, scrollingElement: i } = e.ownerDocument;
|
|
1476
1476
|
for (let d = e.parentElement; d !== null && d !== l; d = d.parentElement)
|
|
1477
1477
|
if (Lt(d) && d.scrollHeight > d.clientHeight && d.clientHeight < o) return d;
|
|
1478
|
-
return i instanceof Element &&
|
|
1479
|
-
},
|
|
1480
|
-
scrollerOf:
|
|
1478
|
+
return i instanceof Element && Ao(e.ownerDocument) && i.scrollHeight > i.clientHeight && i.clientHeight < o ? i : r;
|
|
1479
|
+
}, Mo = Object.freeze({
|
|
1480
|
+
scrollerOf: Lo,
|
|
1481
1481
|
reveal: (e) => {
|
|
1482
1482
|
e.scrollIntoView(Ye);
|
|
1483
1483
|
}
|
|
1484
|
-
}), Ye = Object.freeze({ block: "nearest", inline: "nearest", behavior: "instant" }),
|
|
1484
|
+
}), Ye = Object.freeze({ block: "nearest", inline: "nearest", behavior: "instant" }), No = (e, t) => {
|
|
1485
1485
|
for (let n = t; n !== null && n !== e; n = n.parentElement) {
|
|
1486
1486
|
const r = n.parentElement;
|
|
1487
1487
|
if (r instanceof HTMLDetailsElement && n !== r.querySelector(":scope > summary") && (r.open = !0), n.getAttribute("hidden")?.toLowerCase() === "until-found") {
|
|
@@ -1489,7 +1489,7 @@ const yo = /* @__PURE__ */ b.forwardRef(Eo), xo = Object.freeze({ className: "aq
|
|
|
1489
1489
|
n.removeAttribute("hidden");
|
|
1490
1490
|
}
|
|
1491
1491
|
}
|
|
1492
|
-
},
|
|
1492
|
+
}, Do = (e, t) => {
|
|
1493
1493
|
if (t.getClientRects().length === 0) return;
|
|
1494
1494
|
const n = e === e.ownerDocument.scrollingElement ? 0 : e.getBoundingClientRect().top + e.clientTop, { scrollMarginTop: r, scrollMarginBottom: o } = getComputedStyle(t), l = Number.parseFloat(r), i = t.getBoundingClientRect(), d = i.height + l + Number.parseFloat(o) > e.clientHeight;
|
|
1495
1495
|
if (!d && Math.abs(i.top - l - n) < 1) {
|
|
@@ -1497,15 +1497,15 @@ const yo = /* @__PURE__ */ b.forwardRef(Eo), xo = Object.freeze({ className: "aq
|
|
|
1497
1497
|
return;
|
|
1498
1498
|
}
|
|
1499
1499
|
e.scrollBy({ top: d ? i.top - n - e.clientHeight : i.bottom - n + e.clientHeight, behavior: "instant" }), t.scrollIntoView(Ye);
|
|
1500
|
-
},
|
|
1500
|
+
}, $o = (e, t) => {
|
|
1501
1501
|
const n = t.scrollerOf(e, e.querySelector(Fe) ?? e);
|
|
1502
1502
|
n.getClientRects().length !== 0 && (n.scrollTo({ top: 0, left: 0, behavior: "instant" }), t.reveal(n));
|
|
1503
1503
|
}, Mt = (e, t, n) => {
|
|
1504
1504
|
if (e === null) return null;
|
|
1505
1505
|
const r = vn(e, t);
|
|
1506
|
-
return r === null ? (
|
|
1506
|
+
return r === null ? (Co(t) && $o(e, n), null) : (No(e, r), Do(n.scrollerOf(e, r), r), n.reveal(r), r);
|
|
1507
1507
|
};
|
|
1508
|
-
function
|
|
1508
|
+
function Po({
|
|
1509
1509
|
title: e,
|
|
1510
1510
|
titleId: t,
|
|
1511
1511
|
...n
|
|
@@ -1524,8 +1524,8 @@ function $o({
|
|
|
1524
1524
|
d: "M3.28 2.22a.75.75 0 0 0-1.06 1.06L5.44 6.5H2.75a.75.75 0 0 0 0 1.5h4.5A.75.75 0 0 0 8 7.25v-4.5a.75.75 0 0 0-1.5 0v2.69L3.28 2.22ZM13.5 2.75a.75.75 0 0 0-1.5 0v4.5c0 .414.336.75.75.75h4.5a.75.75 0 0 0 0-1.5h-2.69l3.22-3.22a.75.75 0 0 0-1.06-1.06L13.5 5.44V2.75ZM3.28 17.78l3.22-3.22v2.69a.75.75 0 0 0 1.5 0v-4.5a.75.75 0 0 0-.75-.75h-4.5a.75.75 0 0 0 0 1.5h2.69l-3.22 3.22a.75.75 0 1 0 1.06 1.06ZM13.5 14.56l3.22 3.22a.75.75 0 1 0 1.06-1.06l-3.22-3.22h2.69a.75.75 0 0 0 0-1.5h-4.5a.75.75 0 0 0-.75.75v4.5a.75.75 0 0 0 1.5 0v-2.69Z"
|
|
1525
1525
|
}));
|
|
1526
1526
|
}
|
|
1527
|
-
const
|
|
1528
|
-
function
|
|
1527
|
+
const Fo = /* @__PURE__ */ b.forwardRef(Po);
|
|
1528
|
+
function qo({
|
|
1529
1529
|
title: e,
|
|
1530
1530
|
titleId: t,
|
|
1531
1531
|
...n
|
|
@@ -1548,8 +1548,8 @@ function Fo({
|
|
|
1548
1548
|
clipRule: "evenodd"
|
|
1549
1549
|
}));
|
|
1550
1550
|
}
|
|
1551
|
-
const
|
|
1552
|
-
function
|
|
1551
|
+
const _o = /* @__PURE__ */ b.forwardRef(qo);
|
|
1552
|
+
function Bo({
|
|
1553
1553
|
title: e,
|
|
1554
1554
|
titleId: t,
|
|
1555
1555
|
...n
|
|
@@ -1572,8 +1572,8 @@ function _o({
|
|
|
1572
1572
|
clipRule: "evenodd"
|
|
1573
1573
|
}));
|
|
1574
1574
|
}
|
|
1575
|
-
const
|
|
1576
|
-
function
|
|
1575
|
+
const Io = /* @__PURE__ */ b.forwardRef(Bo);
|
|
1576
|
+
function jo({
|
|
1577
1577
|
title: e,
|
|
1578
1578
|
titleId: t,
|
|
1579
1579
|
...n
|
|
@@ -1594,7 +1594,7 @@ function Io({
|
|
|
1594
1594
|
clipRule: "evenodd"
|
|
1595
1595
|
}));
|
|
1596
1596
|
}
|
|
1597
|
-
const
|
|
1597
|
+
const Ho = /* @__PURE__ */ b.forwardRef(jo), Je = "data-aqmx-key-repeat", Qe = Object.freeze({ [Je]: "allow" }), zo = `[${Je}="${Qe[Je]}"]`, Uo = () => {
|
|
1598
1598
|
let e = null;
|
|
1599
1599
|
return {
|
|
1600
1600
|
onKeyDownCapture: (t) => {
|
|
@@ -1603,7 +1603,7 @@ const jo = /* @__PURE__ */ b.forwardRef(Io), Je = "data-aqmx-key-repeat", Qe = O
|
|
|
1603
1603
|
e = t.target instanceof Element ? t.target : null;
|
|
1604
1604
|
return;
|
|
1605
1605
|
}
|
|
1606
|
-
e !== null && t.target === e && e.closest(
|
|
1606
|
+
e !== null && t.target === e && e.closest(zo) !== null || (t.preventDefault(), t.stopPropagation());
|
|
1607
1607
|
}
|
|
1608
1608
|
},
|
|
1609
1609
|
onKeyUpCapture: (t) => {
|
|
@@ -1613,7 +1613,7 @@ const jo = /* @__PURE__ */ b.forwardRef(Io), Je = "data-aqmx-key-repeat", Qe = O
|
|
|
1613
1613
|
t.target === e && (e = null);
|
|
1614
1614
|
}
|
|
1615
1615
|
};
|
|
1616
|
-
}, Ce = Object.freeze([1 / ke ** 2, 1 / ke, 1, ke, ke ** 2]), Nt = Object.freeze({ mode: "fit" }), Zo = 1,
|
|
1616
|
+
}, Ce = Object.freeze([1 / ke ** 2, 1 / ke, 1, ke, ke ** 2]), Nt = Object.freeze({ mode: "fit" }), Zo = 1, Vo = Object.freeze({ className: "aqmx-document-canvas", "data-testid": "markdown-explorer-image-canvas" }), Go = me(null), Ko = (e, t) => e.width > 0 && e.height > 0 && t.width - e.width <= Zo ? { base: e, scale: t.width / e.width } : t.width > 0 && t.height > 0 ? { base: t, scale: 1 } : null, Dt = (e, t, n) => {
|
|
1617
1617
|
if (e.mode === "level") {
|
|
1618
1618
|
const o = e.index + n;
|
|
1619
1619
|
return o >= 0 && o < Ce.length ? o : null;
|
|
@@ -1629,12 +1629,12 @@ const jo = /* @__PURE__ */ b.forwardRef(Io), Je = "data-aqmx-key-repeat", Qe = O
|
|
|
1629
1629
|
if (t === null) return null;
|
|
1630
1630
|
const r = Dt(e, t.scale, n);
|
|
1631
1631
|
return r === null ? null : { mode: "level", index: r, base: t.base };
|
|
1632
|
-
},
|
|
1632
|
+
}, Wo = (e) => {
|
|
1633
1633
|
const t = Ce[e];
|
|
1634
1634
|
if (t === void 0) throw new RangeError(`[markdown-explorer] no image zoom step ${String(e)}`);
|
|
1635
1635
|
return t;
|
|
1636
|
-
}, Pt = (e, t, n) => e !== null && e.width === t && e.height === n ? e : { width: t, height: n },
|
|
1637
|
-
const { labels: t } = D(), n = re(
|
|
1636
|
+
}, Pt = (e, t, n) => e !== null && e.width === t && e.height === n ? e : { width: t, height: n }, Xo = ({ document: e }) => {
|
|
1637
|
+
const { labels: t } = D(), n = re(Go), [r] = I(() => n === null ? null : n.read(e.url)), [o, l] = I(r === null ? Nt : r.zoom), [i, d] = I(r === null ? null : r.reported), [g, f] = I(null), u = B(null), p = P((M) => {
|
|
1638
1638
|
const { naturalWidth: s, naturalHeight: c } = M;
|
|
1639
1639
|
d((h) => Pt(h, s, c));
|
|
1640
1640
|
}, []), m = P(
|
|
@@ -1657,9 +1657,9 @@ const jo = /* @__PURE__ */ b.forwardRef(Io), Je = "data-aqmx-key-repeat", Qe = O
|
|
|
1657
1657
|
const c = new ResizeObserver(s);
|
|
1658
1658
|
return c.observe(M), () => c.disconnect();
|
|
1659
1659
|
}, [i, o.mode]);
|
|
1660
|
-
const x = i === null || g === null ? null :
|
|
1660
|
+
const x = i === null || g === null ? null : Ko(i, g), O = $t(o, x, -1), y = $t(o, x, 1), T = o.mode === "level" ? Wo(o.index) : null, S = o.mode === "level" && T !== null ? { width: `${o.base.width * T}px`, height: `${o.base.height * T}px` } : void 0;
|
|
1661
1661
|
return /* @__PURE__ */ F("div", { className: "aqmx-document-file", "data-testid": "markdown-explorer-image-view", children: [
|
|
1662
|
-
/* @__PURE__ */ F(Pe, { name: e.name, url: e.url, icon: /* @__PURE__ */ a(
|
|
1662
|
+
/* @__PURE__ */ F(Pe, { name: e.name, openUrl: e.url, downloadUrl: e.url, icon: /* @__PURE__ */ a(Ho, {}), children: [
|
|
1663
1663
|
/* @__PURE__ */ a(
|
|
1664
1664
|
"button",
|
|
1665
1665
|
{
|
|
@@ -1672,7 +1672,7 @@ const jo = /* @__PURE__ */ b.forwardRef(Io), Je = "data-aqmx-key-repeat", Qe = O
|
|
|
1672
1672
|
O !== null && l(O);
|
|
1673
1673
|
},
|
|
1674
1674
|
...Qe,
|
|
1675
|
-
children: /* @__PURE__ */ a(
|
|
1675
|
+
children: /* @__PURE__ */ a(_o, {})
|
|
1676
1676
|
}
|
|
1677
1677
|
),
|
|
1678
1678
|
/* @__PURE__ */ a("output", { className: "aqmx-document-level", "aria-live": "polite", "data-testid": "markdown-explorer-image-level", children: T === null ? t.imageFitLevel : t.imageZoomLevel(Math.round(T * 100)) }),
|
|
@@ -1688,28 +1688,28 @@ const jo = /* @__PURE__ */ b.forwardRef(Io), Je = "data-aqmx-key-repeat", Qe = O
|
|
|
1688
1688
|
y !== null && l(y);
|
|
1689
1689
|
},
|
|
1690
1690
|
...Qe,
|
|
1691
|
-
children: /* @__PURE__ */ a(
|
|
1691
|
+
children: /* @__PURE__ */ a(Io, {})
|
|
1692
1692
|
}
|
|
1693
1693
|
),
|
|
1694
|
-
/* @__PURE__ */ a("button", { type: "button", className: "aqmx-icon-button", "aria-label": t.imageFit, title: t.imageFit, "aria-pressed": o.mode === "fit", onClick: () => l(Nt), children: /* @__PURE__ */ a(
|
|
1694
|
+
/* @__PURE__ */ a("button", { type: "button", className: "aqmx-icon-button", "aria-label": t.imageFit, title: t.imageFit, "aria-pressed": o.mode === "fit", onClick: () => l(Nt), children: /* @__PURE__ */ a(Fo, {}) })
|
|
1695
1695
|
] }),
|
|
1696
|
-
/* @__PURE__ */ a(xe, { scrollerProps:
|
|
1696
|
+
/* @__PURE__ */ a(xe, { scrollerProps: Vo, children: /* @__PURE__ */ a("img", { ref: m, className: "aqmx-document-image", src: e.url, alt: e.name, "data-aqmx-image-mode": o.mode, style: S, onLoad: (M) => p(M.currentTarget), "data-testid": "markdown-explorer-image" }) })
|
|
1697
1697
|
] });
|
|
1698
1698
|
}, wn = me(null), qe = me(void 0), bn = me(null), _e = () => {
|
|
1699
1699
|
const e = re(wn);
|
|
1700
1700
|
if (e === null) throw new Error("[markdown-explorer] document links must be rendered inside a document pane");
|
|
1701
1701
|
return e;
|
|
1702
|
-
},
|
|
1702
|
+
}, Yo = () => {
|
|
1703
1703
|
const e = re(bn);
|
|
1704
1704
|
if (e === null) throw new Error("[markdown-explorer] table-of-contents entries must be rendered inside a document pane's links");
|
|
1705
1705
|
return e;
|
|
1706
|
-
}, Be = (e, t, n, r) => t.kind === "panel" ? pe(e, { view: "tree", source: n, doc: r }) : t.view === "single" ? pe(e, { view: "single", source: n, doc: r, overrides: t.overrides, embed: t.embed }) : pe(e, { view: "tree", source: n, doc: r, overrides: t.overrides }),
|
|
1706
|
+
}, Be = (e, t, n, r) => t.kind === "panel" ? pe(e, { view: "tree", source: n, doc: r }) : t.view === "single" ? pe(e, { view: "single", source: n, doc: r, overrides: t.overrides, embed: t.embed }) : pe(e, { view: "tree", source: n, doc: r, overrides: t.overrides }), Jo = ({ children: e }) => {
|
|
1707
1707
|
const { config: t } = D(), n = _e(), r = nt(), o = r.kind === "location" ? r.location.source : void 0, l = De(Be(t, n.navigation, o, n.currentPath));
|
|
1708
1708
|
return /* @__PURE__ */ a(qe, { value: o, children: /* @__PURE__ */ a(bn, { value: l, children: e }) });
|
|
1709
|
-
},
|
|
1710
|
-
const t = e instanceof Element ? e.closest(
|
|
1709
|
+
}, Qo = 'a[data-link-kind="doc"][data-doc-path]:not([data-doc-exists="false"])', el = (e) => {
|
|
1710
|
+
const t = e instanceof Element ? e.closest(Qo) : null;
|
|
1711
1711
|
return t === null ? null : t.getAttribute("data-doc-path");
|
|
1712
|
-
}, Ie = (e) => !e.defaultPrevented && e.button === 0 && !e.metaKey && !e.ctrlKey && !e.shiftKey && !e.altKey,
|
|
1712
|
+
}, Ie = (e) => !e.defaultPrevented && e.button === 0 && !e.metaKey && !e.ctrlKey && !e.shiftKey && !e.altKey, tl = ({ to: e, docPath: t, fragment: n, exists: r, className: o, attributes: l, onDocumentLink: i, scope: d, children: g }) => {
|
|
1713
1713
|
const f = De(e);
|
|
1714
1714
|
return /* @__PURE__ */ a("a", { ...l, href: f, className: o, "data-link-kind": "doc", "data-doc-path": t, "data-doc-exists": r, onClick: (p) => {
|
|
1715
1715
|
if (Ie(p)) {
|
|
@@ -1720,10 +1720,10 @@ const jo = /* @__PURE__ */ b.forwardRef(Io), Je = "data-aqmx-key-repeat", Qe = O
|
|
|
1720
1720
|
i(t, n);
|
|
1721
1721
|
}
|
|
1722
1722
|
}, children: g });
|
|
1723
|
-
},
|
|
1724
|
-
const { config: i } = D(), d = _e(), g = re(qe), f =
|
|
1725
|
-
return u.kind === "page" ? /* @__PURE__ */ a(
|
|
1726
|
-
},
|
|
1723
|
+
}, nl = ({ href: e, docPath: t, docExists: n, className: r, attributes: o, children: l }) => {
|
|
1724
|
+
const { config: i } = D(), d = _e(), g = re(qe), f = Ro(e), { navigation: u } = d, p = `${Be(i, u, g, t)}${f}`, m = n === !1 ? "false" : void 0;
|
|
1725
|
+
return u.kind === "page" ? /* @__PURE__ */ a(Qr, { ...o, to: p, navigation: "follow-link", className: r, "data-link-kind": "doc", "data-doc-path": t, "data-doc-exists": m, children: l }) : /* @__PURE__ */ a(tl, { to: p, docPath: t, fragment: f, exists: m, className: r, attributes: o, onDocumentLink: u.onDocumentLink, scope: d, children: l });
|
|
1726
|
+
}, rl = ({ className: e, attributes: t, children: n }) => {
|
|
1727
1727
|
const { labels: r } = D();
|
|
1728
1728
|
return (
|
|
1729
1729
|
/* @__PURE__ */ F("a", { ...t, className: e === void 0 ? "aqmx-document-inert-link" : `${e} aqmx-document-inert-link`, title: r.inertLink, "data-link-kind": "doc", "data-doc-exists": "false", children: [
|
|
@@ -1735,19 +1735,19 @@ const jo = /* @__PURE__ */ b.forwardRef(Io), Je = "data-aqmx-key-repeat", Qe = O
|
|
|
1735
1735
|
] })
|
|
1736
1736
|
] })
|
|
1737
1737
|
);
|
|
1738
|
-
},
|
|
1738
|
+
}, ol = ({ href: e, className: t, attributes: n, scope: r, children: o }) => {
|
|
1739
1739
|
const { config: l } = D(), i = re(qe), d = De(`${Be(l, r.navigation, i, r.currentPath)}${e}`);
|
|
1740
1740
|
return /* @__PURE__ */ a("a", { ...n, href: d, className: t, onClick: (f) => {
|
|
1741
1741
|
Ie(f) && (f.preventDefault(), r.scrollWithin(e));
|
|
1742
1742
|
}, children: o });
|
|
1743
|
-
},
|
|
1743
|
+
}, ll = ({ href: e, className: t, attributes: n, children: r }) => {
|
|
1744
1744
|
const o = _e();
|
|
1745
1745
|
return o.navigation.kind === "page" ? /* @__PURE__ */ a("a", { ...n, href: e, className: t, onClick: (i) => {
|
|
1746
1746
|
if (!Ie(i)) return;
|
|
1747
1747
|
const d = i.currentTarget;
|
|
1748
1748
|
e === "#" ? o.followEmptyFragment(i.nativeEvent) : d.href === d.ownerDocument.URL && o.followSameUrlJump(e, i.nativeEvent);
|
|
1749
|
-
}, children: r }) : /* @__PURE__ */ a(
|
|
1750
|
-
},
|
|
1749
|
+
}, children: r }) : /* @__PURE__ */ a(ol, { href: e, className: t, attributes: n, scope: o, children: r });
|
|
1750
|
+
}, il = ({ href: e, kind: t, docPath: n, docExists: r, className: o, attributes: l, children: i }) => t === "doc" ? n === void 0 || !Hn(n) ? /* @__PURE__ */ a(rl, { className: o, attributes: l, children: i }) : /* @__PURE__ */ a(nl, { href: e, docPath: n, docExists: r, className: o, attributes: l, children: i }) : e.startsWith("#") ? /* @__PURE__ */ a(ll, { href: e, className: o, attributes: l, children: i }) : /* @__PURE__ */ a("a", { ...l, href: e, className: o, children: i }), sl = () => {
|
|
1751
1751
|
const { config: e } = D(), t = _e(), n = re(qe), r = $e();
|
|
1752
1752
|
return P(
|
|
1753
1753
|
(o, l) => {
|
|
@@ -1758,11 +1758,11 @@ const jo = /* @__PURE__ */ b.forwardRef(Io), Je = "data-aqmx-key-repeat", Qe = O
|
|
|
1758
1758
|
},
|
|
1759
1759
|
[e, t, n, r]
|
|
1760
1760
|
);
|
|
1761
|
-
},
|
|
1762
|
-
const e =
|
|
1761
|
+
}, al = () => {
|
|
1762
|
+
const e = Yo();
|
|
1763
1763
|
return P((t) => `${e}${pn(t.id)}`, [e]);
|
|
1764
1764
|
};
|
|
1765
|
-
function
|
|
1765
|
+
function cl({
|
|
1766
1766
|
title: e,
|
|
1767
1767
|
titleId: t,
|
|
1768
1768
|
...n
|
|
@@ -1781,8 +1781,8 @@ function al({
|
|
|
1781
1781
|
d: "M3 3.5A1.5 1.5 0 0 1 4.5 2h6.879a1.5 1.5 0 0 1 1.06.44l4.122 4.12A1.5 1.5 0 0 1 17 7.622V16.5a1.5 1.5 0 0 1-1.5 1.5h-11A1.5 1.5 0 0 1 3 16.5v-13Z"
|
|
1782
1782
|
}));
|
|
1783
1783
|
}
|
|
1784
|
-
const
|
|
1785
|
-
function
|
|
1784
|
+
const dl = /* @__PURE__ */ b.forwardRef(cl);
|
|
1785
|
+
function ul({
|
|
1786
1786
|
title: e,
|
|
1787
1787
|
titleId: t,
|
|
1788
1788
|
...n
|
|
@@ -1803,8 +1803,8 @@ function dl({
|
|
|
1803
1803
|
clipRule: "evenodd"
|
|
1804
1804
|
}));
|
|
1805
1805
|
}
|
|
1806
|
-
const
|
|
1807
|
-
function
|
|
1806
|
+
const fl = /* @__PURE__ */ b.forwardRef(ul);
|
|
1807
|
+
function ml({
|
|
1808
1808
|
title: e,
|
|
1809
1809
|
titleId: t,
|
|
1810
1810
|
...n
|
|
@@ -1825,20 +1825,20 @@ function fl({
|
|
|
1825
1825
|
clipRule: "evenodd"
|
|
1826
1826
|
}));
|
|
1827
1827
|
}
|
|
1828
|
-
const
|
|
1828
|
+
const hl = /* @__PURE__ */ b.forwardRef(ml), pl = Object.freeze({ className: "aqmx-document-stage" }), gl = (e) => {
|
|
1829
1829
|
switch (e) {
|
|
1830
1830
|
case "video":
|
|
1831
|
-
return /* @__PURE__ */ a(
|
|
1831
|
+
return /* @__PURE__ */ a(fl, {});
|
|
1832
1832
|
case "audio":
|
|
1833
|
-
return /* @__PURE__ */ a(
|
|
1833
|
+
return /* @__PURE__ */ a(hl, {});
|
|
1834
1834
|
case "pdf":
|
|
1835
|
-
return /* @__PURE__ */ a(
|
|
1835
|
+
return /* @__PURE__ */ a(dl, {});
|
|
1836
1836
|
default: {
|
|
1837
1837
|
const t = e;
|
|
1838
1838
|
throw new RangeError(`[markdown-explorer] unknown media type ${String(t)}`);
|
|
1839
1839
|
}
|
|
1840
1840
|
}
|
|
1841
|
-
},
|
|
1841
|
+
}, vl = ({ document: e }) => {
|
|
1842
1842
|
const { labels: t } = D();
|
|
1843
1843
|
switch (e.mediaType) {
|
|
1844
1844
|
case "video":
|
|
@@ -1856,10 +1856,10 @@ const ml = /* @__PURE__ */ b.forwardRef(fl), hl = Object.freeze({ className: "aq
|
|
|
1856
1856
|
throw new RangeError(`[markdown-explorer] unknown media type ${String(n)}`);
|
|
1857
1857
|
}
|
|
1858
1858
|
}
|
|
1859
|
-
},
|
|
1860
|
-
/* @__PURE__ */ a(Pe, { name: e.name, url: e.url, icon:
|
|
1861
|
-
/* @__PURE__ */ a(xe, { scrollerProps:
|
|
1862
|
-
] }),
|
|
1859
|
+
}, wl = ({ document: e }) => /* @__PURE__ */ F("div", { className: "aqmx-document-file", "data-testid": "markdown-explorer-media-view", "data-aqmx-media-type": e.mediaType, children: [
|
|
1860
|
+
/* @__PURE__ */ a(Pe, { name: e.name, openUrl: e.url, downloadUrl: e.url, icon: gl(e.mediaType) }),
|
|
1861
|
+
/* @__PURE__ */ a(xe, { scrollerProps: pl, children: /* @__PURE__ */ a(vl, { document: e }) })
|
|
1862
|
+
] }), bl = (e) => ({
|
|
1863
1863
|
loading: e.viewerLoading,
|
|
1864
1864
|
errorPrefix: e.viewerErrorPrefix,
|
|
1865
1865
|
styleTitle: e.viewerStyleTitle,
|
|
@@ -1899,7 +1899,7 @@ const ml = /* @__PURE__ */ b.forwardRef(fl), hl = Object.freeze({ className: "aq
|
|
|
1899
1899
|
const [r] = e.documentStyles;
|
|
1900
1900
|
if (r === void 0) throw new Error("[markdown-explorer] the configuration has no document style");
|
|
1901
1901
|
return r.name;
|
|
1902
|
-
}, yn = (e, t) => e !== void 0 ? e : t !== void 0 ? t :
|
|
1902
|
+
}, yn = (e, t) => e !== void 0 ? e : t !== void 0 ? t : ar, it = Object.freeze(["l1", "l2", "l3", "l4", "l5", "l6", "l7", "l8"]), El = (e, t, n) => {
|
|
1903
1903
|
if (t.view === "multi" || t.overrides[n] === void 0) return null;
|
|
1904
1904
|
const r = n === "style" ? { align: t.overrides.align } : { style: t.overrides.style };
|
|
1905
1905
|
return pe(e, { ...t, overrides: r });
|
|
@@ -1911,7 +1911,7 @@ const ml = /* @__PURE__ */ b.forwardRef(fl), hl = Object.freeze({ className: "aq
|
|
|
1911
1911
|
d
|
|
1912
1912
|
] })
|
|
1913
1913
|
);
|
|
1914
|
-
},
|
|
1914
|
+
}, yl = () => {
|
|
1915
1915
|
const { labels: e } = D();
|
|
1916
1916
|
return /* @__PURE__ */ a(st, { kind: "empty", label: e.documentRegion, stale: !1, busy: !1, children: /* @__PURE__ */ a("div", { className: "aqmx-empty", "data-testid": "markdown-explorer-document-empty", children: /* @__PURE__ */ a("p", { className: "aqmx-empty-title", children: e.documentEmpty }) }) });
|
|
1917
1917
|
}, xn = ({ label: e }) => {
|
|
@@ -1920,29 +1920,29 @@ const ml = /* @__PURE__ */ b.forwardRef(fl), hl = Object.freeze({ className: "aq
|
|
|
1920
1920
|
/* @__PURE__ */ a("div", { className: "aqmx-skeleton", "aria-hidden": "true", "data-testid": "markdown-explorer-document-skeleton", children: it.map((n) => /* @__PURE__ */ a("span", {}, n)) }),
|
|
1921
1921
|
/* @__PURE__ */ a("p", { className: "aqmx-sr-only", children: t.documentLoading })
|
|
1922
1922
|
] });
|
|
1923
|
-
}, Ft = Object.freeze(["wheel", "touchstart", "pointerdown", "keydown"]),
|
|
1924
|
-
const { reportMathDiagnostics: o, edits: l } = D(), i =
|
|
1923
|
+
}, Ft = Object.freeze(["wheel", "touchstart", "pointerdown", "keydown"]), xl = ({ path: e, document: t, viewer: n, editing: r }) => {
|
|
1924
|
+
const { reportMathDiagnostics: o, edits: l } = D(), i = U(() => ({ htmlContent: t.htmlContent, headings: [...t.headings] }), [t]), d = sl(), g = al(), f = U(() => o === void 0 ? void 0 : (h) => o(e, h), [o, e]), u = B(null), { editable: p, doubleClick: m, region: x, paneScroll: O, stale: y } = r;
|
|
1925
1925
|
V(() => {
|
|
1926
1926
|
if (p)
|
|
1927
1927
|
return l.bindView(e, {
|
|
1928
1928
|
anchor: () => {
|
|
1929
1929
|
const h = u.current, w = x(), k = h === null ? null : h.querySelector(Fe);
|
|
1930
|
-
return h === null || w === null || k === null ? null :
|
|
1930
|
+
return h === null || w === null || k === null ? null : Vr(h, O.scrollerOf(w, k));
|
|
1931
1931
|
}
|
|
1932
1932
|
});
|
|
1933
1933
|
}, [l, e, p, x, O]);
|
|
1934
1934
|
const T = (h) => {
|
|
1935
1935
|
const w = u.current, { target: k } = h;
|
|
1936
|
-
!m || w === null || !(k instanceof Element) || !
|
|
1936
|
+
!m || w === null || !(k instanceof Element) || !Ur(k) || (h.stopPropagation(), l.start(e, Zr(k, w, w.ownerDocument.getSelection())));
|
|
1937
1937
|
}, S = B(null), M = B(y);
|
|
1938
1938
|
V(() => {
|
|
1939
1939
|
M.current = y;
|
|
1940
1940
|
});
|
|
1941
1941
|
const s = ie((h) => {
|
|
1942
|
-
const w = u.current, k = x(), L = w === null ? null :
|
|
1942
|
+
const w = u.current, k = x(), L = w === null ? null : Yr(w, h.line);
|
|
1943
1943
|
if (k === null || L === null) return !1;
|
|
1944
1944
|
const R = O.scrollerOf(k, L);
|
|
1945
|
-
return R.scrollTop +=
|
|
1945
|
+
return R.scrollTop += Jr(L, h.line) - h.clientTop, !0;
|
|
1946
1946
|
}), c = ie((h) => {
|
|
1947
1947
|
const w = x();
|
|
1948
1948
|
if (w === null) return;
|
|
@@ -1967,12 +1967,12 @@ const ml = /* @__PURE__ */ b.forwardRef(fl), hl = Object.freeze({ className: "aq
|
|
|
1967
1967
|
}, kn = ({ document: e, viewer: t }) => {
|
|
1968
1968
|
const { labels: n } = D();
|
|
1969
1969
|
return /* @__PURE__ */ F(Ne, { children: [
|
|
1970
|
-
/* @__PURE__ */ a(Pe, { name: e.name, url: e.url, icon: /* @__PURE__ */ a(
|
|
1970
|
+
/* @__PURE__ */ a(Pe, { name: e.name, openUrl: zn(e.url), downloadUrl: e.url, icon: /* @__PURE__ */ a(Fr, {}), children: e.truncated ? null : /* @__PURE__ */ a(po, { text: e.text }) }),
|
|
1971
1971
|
e.truncated ? /* @__PURE__ */ a("p", { className: "aqmx-callout aqmx-document-notice", role: "note", "data-testid": "markdown-explorer-text-truncated", children: n.textTruncated }) : null,
|
|
1972
1972
|
/* @__PURE__ */ a("div", { className: "aqmx-document-viewer", children: /* @__PURE__ */ a(Wt, { ...t, parseResult: null, content: e.text }) })
|
|
1973
1973
|
] });
|
|
1974
|
-
},
|
|
1975
|
-
const { data: r, documents: o, announcer: l, labels: i } = D(), d = P(() => o.answerStampOf(e), [o, e]), g = te(o.subscribe, d, d), [f, u] = I(0), p =
|
|
1974
|
+
}, kl = ({ path: e, name: t, viewer: n }) => {
|
|
1975
|
+
const { data: r, documents: o, announcer: l, labels: i } = D(), d = P(() => o.answerStampOf(e), [o, e]), g = te(o.subscribe, d, d), [f, u] = I(0), p = U(() => ({ path: e, stamp: g, attempt: f }), [e, g, f]), [m, x] = I(null), O = ie((T) => {
|
|
1976
1976
|
x(T), T.kind === "failure" && l.announce(i.documentFailed(t, ae(i, T.failure.reason)));
|
|
1977
1977
|
});
|
|
1978
1978
|
ne(() => {
|
|
@@ -1986,35 +1986,35 @@ const ml = /* @__PURE__ */ b.forwardRef(fl), hl = Object.freeze({ className: "aq
|
|
|
1986
1986
|
/* @__PURE__ */ a("div", { className: "aqmx-skeleton", "aria-hidden": "true", "data-testid": "markdown-explorer-markup-skeleton", children: it.map((T) => /* @__PURE__ */ a("span", {}, T)) }),
|
|
1987
1987
|
/* @__PURE__ */ a("p", { className: "aqmx-sr-only", children: i.markupLoading })
|
|
1988
1988
|
] }) : m.kind === "failure" ? /* @__PURE__ */ a(xe, { scrollerProps: Sn, children: /* @__PURE__ */ a(ve, { failure: m.failure, alert: !1, onRetry: y, testId: "markdown-explorer-markup-failure" }) }) : /* @__PURE__ */ a(kn, { document: m, viewer: n });
|
|
1989
|
-
}, Sn = Object.freeze({ className: "aqmx-document-failure", "data-aqmx-document-scroller": "" }),
|
|
1990
|
-
|
|
1989
|
+
}, Sn = Object.freeze({ className: "aqmx-document-failure", "data-aqmx-document-scroller": "" }), Sl = Object.freeze({ reason: "failed" }), Rl = (e) => /* @__PURE__ */ a(
|
|
1990
|
+
_r,
|
|
1991
1991
|
{
|
|
1992
|
-
fallback: (t) => /* @__PURE__ */ a("div", { className: "aqmx-edit-message", children: /* @__PURE__ */ a(ve, { failure:
|
|
1992
|
+
fallback: (t) => /* @__PURE__ */ a("div", { className: "aqmx-edit-message", children: /* @__PURE__ */ a(ve, { failure: Sl, alert: !1, onRetry: t, testId: "markdown-explorer-edit-load-failure" }) }),
|
|
1993
1993
|
children: /* @__PURE__ */ a(
|
|
1994
1994
|
ge,
|
|
1995
1995
|
{
|
|
1996
1996
|
fallback: /* @__PURE__ */ a("div", { className: "aqmx-skeleton", "aria-hidden": "true", "data-testid": "markdown-explorer-edit-skeleton", children: it.map((t) => /* @__PURE__ */ a("span", {}, t)) }),
|
|
1997
|
-
children: /* @__PURE__ */ a(
|
|
1997
|
+
children: /* @__PURE__ */ a(qr, { ...e })
|
|
1998
1998
|
}
|
|
1999
1999
|
)
|
|
2000
2000
|
}
|
|
2001
|
-
),
|
|
2001
|
+
), Tl = ({ path: e, document: t, view: n, viewer: r, onRetry: o, editing: l }) => {
|
|
2002
2002
|
switch (t.kind) {
|
|
2003
2003
|
case "markdown": {
|
|
2004
2004
|
const { session: i, layout: d, region: g, paneScroll: f, stale: u } = l;
|
|
2005
|
-
if (n === "edit" && i !== void 0) return /* @__PURE__ */ a(
|
|
2006
|
-
if (n === "markup") return /* @__PURE__ */ a(
|
|
2005
|
+
if (n === "edit" && i !== void 0) return /* @__PURE__ */ a(Rl, { path: e, name: t.name, session: i, layout: d, viewer: r, region: g, paneScroll: f });
|
|
2006
|
+
if (n === "markup") return /* @__PURE__ */ a(kl, { path: e, name: t.name, viewer: r });
|
|
2007
2007
|
const p = t.edit !== null && t.edit.kind === "inline";
|
|
2008
|
-
return /* @__PURE__ */ a(
|
|
2008
|
+
return /* @__PURE__ */ a(xl, { path: e, document: t, viewer: r, editing: { editable: p, doubleClick: p && d === "fill", region: g, paneScroll: f, stale: u } });
|
|
2009
2009
|
}
|
|
2010
2010
|
case "text":
|
|
2011
2011
|
return /* @__PURE__ */ a(kn, { document: t, viewer: r });
|
|
2012
2012
|
case "image":
|
|
2013
|
-
return /* @__PURE__ */ a(
|
|
2013
|
+
return /* @__PURE__ */ a(Xo, { document: t });
|
|
2014
2014
|
case "media":
|
|
2015
|
-
return /* @__PURE__ */ a(
|
|
2015
|
+
return /* @__PURE__ */ a(wl, { document: t });
|
|
2016
2016
|
case "file":
|
|
2017
|
-
return /* @__PURE__ */ a(
|
|
2017
|
+
return /* @__PURE__ */ a(So, { document: t });
|
|
2018
2018
|
case "failure":
|
|
2019
2019
|
return /* @__PURE__ */ a(xe, { scrollerProps: Sn, children: /* @__PURE__ */ a(ve, { failure: t.failure, alert: !1, onRetry: o, testId: "markdown-explorer-document-failure" }) });
|
|
2020
2020
|
default: {
|
|
@@ -2022,15 +2022,15 @@ const ml = /* @__PURE__ */ b.forwardRef(fl), hl = Object.freeze({ className: "aq
|
|
|
2022
2022
|
throw new RangeError(`[markdown-explorer] unknown document kind in ${JSON.stringify(i)}`);
|
|
2023
2023
|
}
|
|
2024
2024
|
}
|
|
2025
|
-
},
|
|
2026
|
-
const [r] = t.kind === "markdown" ? t.headings : [], o = [n === null ? null : vn(e, n), r === void 0 ? null : gn(e, r.id), e.querySelector(Fe), e.querySelector(
|
|
2025
|
+
}, Cl = 'a[href], button:not(:disabled), input:not(:disabled), select:not(:disabled), textarea:not(:disabled), iframe, audio[controls], video[controls], [tabindex]:not([tabindex="-1"])', Ol = (e, t, n) => {
|
|
2026
|
+
const [r] = t.kind === "markdown" ? t.headings : [], o = [n === null ? null : vn(e, n), r === void 0 ? null : gn(e, r.id), e.querySelector(Fe), e.querySelector(Cl)];
|
|
2027
2027
|
for (const l of o)
|
|
2028
2028
|
if (l instanceof HTMLElement && dn(l)) return l;
|
|
2029
2029
|
return null;
|
|
2030
2030
|
}, qt = (e, t, n) => {
|
|
2031
2031
|
const { activeElement: r, body: o } = e.ownerDocument, l = r === null || r === o;
|
|
2032
2032
|
t instanceof HTMLElement && n && (l || e.contains(r)) && dn(t);
|
|
2033
|
-
},
|
|
2033
|
+
}, Al = (e) => {
|
|
2034
2034
|
const t = B(!1);
|
|
2035
2035
|
return V(() => {
|
|
2036
2036
|
const n = e.current;
|
|
@@ -2056,8 +2056,8 @@ const ml = /* @__PURE__ */ b.forwardRef(fl), hl = Object.freeze({ className: "aq
|
|
|
2056
2056
|
clearTimeout(i), o.removeEventListener("pointerdown", d, !0), o.removeEventListener("mousedown", d, !0), o.removeEventListener("focusin", g, !0), o.removeEventListener("blur", u), o.removeEventListener("focus", p), n.removeEventListener("focusout", f);
|
|
2057
2057
|
};
|
|
2058
2058
|
}, [e]), t;
|
|
2059
|
-
},
|
|
2060
|
-
const { labels: x, announcer: O, documents: y } = D(), { document: T } = t, S = B(null), M = B(null), s = B(null), c = B(0), h =
|
|
2059
|
+
}, Ll = ({ path: e, snapshot: t, markup: n, stale: r, viewer: o, editLayout: l, regionLabel: i, navigation: d, fragment: g, paneScroll: f, announces: u, announceFailure: p, onDocumentShown: m }) => {
|
|
2060
|
+
const { labels: x, announcer: O, documents: y } = D(), { document: T } = t, S = B(null), M = B(null), s = B(null), c = B(0), h = Al(S), w = B({ path: e, document: T }), k = B(null), L = P(
|
|
2061
2061
|
(z) => {
|
|
2062
2062
|
const K = S.current, Q = Mt(K, z, f);
|
|
2063
2063
|
K !== null && Q !== null && qt(K, Q, h.current);
|
|
@@ -2078,7 +2078,7 @@ const ml = /* @__PURE__ */ b.forwardRef(fl), hl = Object.freeze({ className: "aq
|
|
|
2078
2078
|
}, 0);
|
|
2079
2079
|
},
|
|
2080
2080
|
[L]
|
|
2081
|
-
), q =
|
|
2081
|
+
), q = U(() => ({ navigation: d, currentPath: e, scrollWithin: L, followSameUrlJump: R, followEmptyFragment: N }), [d, e, L, R, N]), W = P(() => y.retry(e), [y, e]), J = eo(y, el), ee = sn(e), X = ee !== void 0 ? "edit" : n ? "markup" : "rendered", $ = T.kind === "markdown" ? X : void 0, G = P(() => S.current, []), v = U(() => ({ session: ee, layout: l, region: G, paneScroll: f, stale: r }), [ee, l, G, f, r]), E = $ === "edit" ? !1 : r, C = re(fe), A = $ === "edit" && l === "fill" ? "fill" : C, _ = ie((z, K) => {
|
|
2082
2082
|
const Q = M.current;
|
|
2083
2083
|
if (Q !== null && Q.path === z && Q.snapshot === K) return;
|
|
2084
2084
|
M.current = { path: z, snapshot: K };
|
|
@@ -2094,11 +2094,11 @@ const ml = /* @__PURE__ */ b.forwardRef(fl), hl = Object.freeze({ className: "aq
|
|
|
2094
2094
|
}, [e, t]);
|
|
2095
2095
|
const j = ie(() => {
|
|
2096
2096
|
g.kind === "panel" && g.consume();
|
|
2097
|
-
}),
|
|
2097
|
+
}), Z = ie((z) => {
|
|
2098
2098
|
const K = S.current;
|
|
2099
2099
|
if (K === null || !h.current) return null;
|
|
2100
2100
|
const { activeElement: Q, body: oe } = K.ownerDocument;
|
|
2101
|
-
return Q !== null && Q !== oe ? null :
|
|
2101
|
+
return Q !== null && Q !== oe ? null : Ol(K, T, z);
|
|
2102
2102
|
}), H = ie((z) => {
|
|
2103
2103
|
const K = S.current;
|
|
2104
2104
|
K !== null && qt(K, z, h.current);
|
|
@@ -2117,33 +2117,33 @@ const ml = /* @__PURE__ */ b.forwardRef(fl), hl = Object.freeze({ className: "aq
|
|
|
2117
2117
|
je !== null && H(je);
|
|
2118
2118
|
return;
|
|
2119
2119
|
}
|
|
2120
|
-
const ut =
|
|
2120
|
+
const ut = Z(g.fragment);
|
|
2121
2121
|
z && je === null && ut !== null && le(ut);
|
|
2122
2122
|
};
|
|
2123
2123
|
Q ? queueMicrotask(dt) : dt();
|
|
2124
|
-
}, [g, e, T, r]), /* @__PURE__ */ a(fe, { value: A, children: /* @__PURE__ */ a(st, { kind: T.kind, view: $, label: i(e, T), stale: E, busy: E, frameRef: S, intent: J, children: /* @__PURE__ */ a(wn, { value: q, children: /* @__PURE__ */ a(
|
|
2125
|
-
}, at = Object.freeze({ kind: "skeleton" }),
|
|
2124
|
+
}, [g, e, T, r]), /* @__PURE__ */ a(fe, { value: A, children: /* @__PURE__ */ a(st, { kind: T.kind, view: $, label: i(e, T), stale: E, busy: E, frameRef: S, intent: J, children: /* @__PURE__ */ a(wn, { value: q, children: /* @__PURE__ */ a(Jo, { children: /* @__PURE__ */ a(Tl, { path: e, document: T, view: X, viewer: o, onRetry: W, editing: v }, e) }) }) }) });
|
|
2125
|
+
}, at = Object.freeze({ kind: "skeleton" }), Ml = (e, t, n, r, o) => {
|
|
2126
2126
|
if (t?.status === "loaded") return { kind: "document", path: e, snapshot: t, stale: !1 };
|
|
2127
2127
|
const l = de(t);
|
|
2128
2128
|
if (l !== null) return { kind: "document", path: e, snapshot: l, stale: !0 };
|
|
2129
2129
|
if (o && t?.status === "pending") return { kind: "streaming", path: e, promise: t.promise };
|
|
2130
2130
|
const i = n === null || n === e ? null : de(r);
|
|
2131
2131
|
return n === null || i === null ? at : { kind: "document", path: n, snapshot: i, stale: !0 };
|
|
2132
|
-
},
|
|
2133
|
-
const o = t.kind === "streaming" ?
|
|
2134
|
-
return o.kind !== "document" ? /* @__PURE__ */ a(xn, { label: r.regionLabel(e, null) }) : /* @__PURE__ */ a(
|
|
2132
|
+
}, Nl = (e, t) => t.status === "deferred" ? at : { kind: "document", path: e, snapshot: t, stale: !1 }, Dl = ({ requestedPath: e, content: t, markup: n, ...r }) => {
|
|
2133
|
+
const o = t.kind === "streaming" ? Nl(t.path, re(t.promise)) : t;
|
|
2134
|
+
return o.kind !== "document" ? /* @__PURE__ */ a(xn, { label: r.regionLabel(e, null) }) : /* @__PURE__ */ a(Ll, { path: o.path, snapshot: o.snapshot, markup: n, stale: o.stale, ...r });
|
|
2135
2135
|
}, Rn = ({ path: e, markup: t, display: n, navigation: r, fragment: o, paneScroll: l, announces: i, announceFailure: d, onDocumentShown: g }) => {
|
|
2136
|
-
const { config: f, labels: u, theme: p, documents: m } = D(), x =
|
|
2136
|
+
const { config: f, labels: u, theme: p, documents: m } = D(), x = ir(), O = B(!1);
|
|
2137
2137
|
V(() => {
|
|
2138
2138
|
O.current = !0;
|
|
2139
2139
|
}, []);
|
|
2140
2140
|
const [y, T] = I(null), [S, M] = I(t), s = P(() => e === null ? void 0 : m.peek(e), [m, e]), c = te(m.subscribe, s, s), h = P(() => y === null ? void 0 : m.peek(y), [m, y]), w = te(m.subscribe, h, h);
|
|
2141
2141
|
V(() => e === null ? void 0 : m.open(e), [m, e]), V(() => y === null ? void 0 : m.retain(y), [m, y]);
|
|
2142
|
-
const k = e === null ? at :
|
|
2142
|
+
const k = e === null ? at : Ml(e, c, y, w, !O.current), L = e === null ? null : k.kind === "document" && !k.stale ? k.path : y;
|
|
2143
2143
|
L !== y && T(L);
|
|
2144
2144
|
const R = k.kind !== "document" || k.path === e;
|
|
2145
2145
|
R && t !== S && M(t);
|
|
2146
|
-
const N =
|
|
2146
|
+
const N = U(() => bl(u), [u]), q = U(() => [...f.iframeHosts], [f]), W = r.kind === "panel", J = U(
|
|
2147
2147
|
() => ({
|
|
2148
2148
|
labels: N,
|
|
2149
2149
|
emptyMessage: u.documentEmpty,
|
|
@@ -2151,7 +2151,7 @@ const ml = /* @__PURE__ */ b.forwardRef(fl), hl = Object.freeze({ className: "aq
|
|
|
2151
2151
|
availableStyles: f.documentStyles,
|
|
2152
2152
|
iFrameAllowedDomains: q,
|
|
2153
2153
|
embeds: f.embeds,
|
|
2154
|
-
linkComponent:
|
|
2154
|
+
linkComponent: il,
|
|
2155
2155
|
toolbar: x,
|
|
2156
2156
|
style: n.style,
|
|
2157
2157
|
onStyleChange: n.onStyleChange,
|
|
@@ -2167,8 +2167,8 @@ const ml = /* @__PURE__ */ b.forwardRef(fl), hl = Object.freeze({ className: "aq
|
|
|
2167
2167
|
}),
|
|
2168
2168
|
[N, u.documentEmpty, p, f.documentStyles, q, f.embeds, x, n, W]
|
|
2169
2169
|
), ee = P(($, G) => W ? G === null || G.kind === "failure" ? Ee($) : G.name : u.documentRegion, [W, u.documentRegion]), X = W ? "content" : "fill";
|
|
2170
|
-
return e === null ? /* @__PURE__ */ a(fe, { value: X, children: /* @__PURE__ */ a(
|
|
2171
|
-
|
|
2170
|
+
return e === null ? /* @__PURE__ */ a(fe, { value: X, children: /* @__PURE__ */ a(yl, {}) }) : /* @__PURE__ */ a(fe, { value: X, children: /* @__PURE__ */ a(ge, { fallback: /* @__PURE__ */ a(xn, { label: ee(e, null) }), children: /* @__PURE__ */ a(
|
|
2171
|
+
Dl,
|
|
2172
2172
|
{
|
|
2173
2173
|
requestedPath: e,
|
|
2174
2174
|
content: k,
|
|
@@ -2184,11 +2184,11 @@ const ml = /* @__PURE__ */ b.forwardRef(fl), hl = Object.freeze({ className: "aq
|
|
|
2184
2184
|
onDocumentShown: g
|
|
2185
2185
|
}
|
|
2186
2186
|
) }) });
|
|
2187
|
-
},
|
|
2187
|
+
}, $l = ({ path: e, markup: t, variant: n, onDocumentShown: r }) => {
|
|
2188
2188
|
const { config: o, viewSettings: l, announcer: i } = D(), d = Ae((L) => L.style), g = Ae((L) => L.align), f = $e(), u = Gt(), p = nt(), { view: m, overrides: x, embed: O } = n, y = P(
|
|
2189
2189
|
(L) => {
|
|
2190
2190
|
if (p.kind !== "location") return;
|
|
2191
|
-
const R =
|
|
2191
|
+
const R = El(o, p.location, L);
|
|
2192
2192
|
R !== null && f(R, "browse");
|
|
2193
2193
|
},
|
|
2194
2194
|
[o, f, p]
|
|
@@ -2202,7 +2202,7 @@ const ml = /* @__PURE__ */ b.forwardRef(fl), hl = Object.freeze({ className: "aq
|
|
|
2202
2202
|
l.update({ align: L }), y("align");
|
|
2203
2203
|
},
|
|
2204
2204
|
[l, y]
|
|
2205
|
-
), M = En(o, x.style, d), s = yn(x.align, g), c =
|
|
2205
|
+
), M = En(o, x.style, d), s = yn(x.align, g), c = U(
|
|
2206
2206
|
() => ({
|
|
2207
2207
|
style: M,
|
|
2208
2208
|
onStyleChange: T,
|
|
@@ -2217,10 +2217,10 @@ const ml = /* @__PURE__ */ b.forwardRef(fl), hl = Object.freeze({ className: "aq
|
|
|
2217
2217
|
editLayout: "fill"
|
|
2218
2218
|
}),
|
|
2219
2219
|
[M, T, s, S, O]
|
|
2220
|
-
), h =
|
|
2221
|
-
return /* @__PURE__ */ a(Rn, { path: e, markup: t, display: c, navigation: h, fragment: w, paneScroll:
|
|
2222
|
-
},
|
|
2223
|
-
const { config: o, viewSettings: l } = D(), i = Ae((h) => h.style), d = Ae((h) => h.align), [g, f] = I(() => En(o, void 0, i)), u = yn(void 0, d), p = P((h) => l.update({ align: h }), [l]), { maximized: m, onDocumentLink: x, pendingHash: O, onHashConsumed: y, announceFailure: T, paneScroll: S } = n, M =
|
|
2220
|
+
), h = U(() => ({ kind: "page", view: m, overrides: x, embed: O }), [m, x, O]), w = U(() => ({ kind: "page", fragment: u.hash, navigation: u }), [u]), k = P((L) => i.announce(L), [i]);
|
|
2221
|
+
return /* @__PURE__ */ a(Rn, { path: e, markup: t, display: c, navigation: h, fragment: w, paneScroll: Mo, announces: !0, announceFailure: k, onDocumentShown: r });
|
|
2222
|
+
}, Pl = ({ path: e, markup: t, variant: n, onDocumentShown: r }) => {
|
|
2223
|
+
const { config: o, viewSettings: l } = D(), i = Ae((h) => h.style), d = Ae((h) => h.align), [g, f] = I(() => En(o, void 0, i)), u = yn(void 0, d), p = P((h) => l.update({ align: h }), [l]), { maximized: m, onDocumentLink: x, pendingHash: O, onHashConsumed: y, announceFailure: T, paneScroll: S } = n, M = U(
|
|
2224
2224
|
() => ({
|
|
2225
2225
|
style: g,
|
|
2226
2226
|
onStyleChange: f,
|
|
@@ -2235,10 +2235,10 @@ const ml = /* @__PURE__ */ b.forwardRef(fl), hl = Object.freeze({ className: "aq
|
|
|
2235
2235
|
editLayout: m ? "fill" : "content"
|
|
2236
2236
|
}),
|
|
2237
2237
|
[g, u, p, m]
|
|
2238
|
-
), s =
|
|
2238
|
+
), s = U(() => ({ kind: "panel", onDocumentLink: x }), [x]), c = U(() => ({ kind: "panel", fragment: O, consume: y }), [O, y]);
|
|
2239
2239
|
return /* @__PURE__ */ a(Rn, { path: e, markup: t, display: M, navigation: s, fragment: c, paneScroll: S, announces: !1, announceFailure: T, onDocumentShown: r });
|
|
2240
|
-
},
|
|
2241
|
-
function
|
|
2240
|
+
}, Fl = ({ path: e, markup: t, variant: n, onDocumentShown: r }) => n.kind === "page" ? /* @__PURE__ */ a($l, { path: e, markup: t, variant: n, onDocumentShown: r }) : /* @__PURE__ */ a(Pl, { path: e, markup: t, variant: n, onDocumentShown: r });
|
|
2241
|
+
function ql({
|
|
2242
2242
|
title: e,
|
|
2243
2243
|
titleId: t,
|
|
2244
2244
|
...n
|
|
@@ -2259,8 +2259,8 @@ function Fl({
|
|
|
2259
2259
|
clipRule: "evenodd"
|
|
2260
2260
|
}));
|
|
2261
2261
|
}
|
|
2262
|
-
const
|
|
2263
|
-
function
|
|
2262
|
+
const _l = /* @__PURE__ */ b.forwardRef(ql);
|
|
2263
|
+
function Bl({
|
|
2264
2264
|
title: e,
|
|
2265
2265
|
titleId: t,
|
|
2266
2266
|
...n
|
|
@@ -2281,8 +2281,8 @@ function _l({
|
|
|
2281
2281
|
clipRule: "evenodd"
|
|
2282
2282
|
}));
|
|
2283
2283
|
}
|
|
2284
|
-
const
|
|
2285
|
-
function
|
|
2284
|
+
const Il = /* @__PURE__ */ b.forwardRef(Bl);
|
|
2285
|
+
function jl({
|
|
2286
2286
|
title: e,
|
|
2287
2287
|
titleId: t,
|
|
2288
2288
|
...n
|
|
@@ -2303,8 +2303,8 @@ function Il({
|
|
|
2303
2303
|
clipRule: "evenodd"
|
|
2304
2304
|
}));
|
|
2305
2305
|
}
|
|
2306
|
-
const
|
|
2307
|
-
function
|
|
2306
|
+
const Hl = /* @__PURE__ */ b.forwardRef(jl);
|
|
2307
|
+
function zl({
|
|
2308
2308
|
title: e,
|
|
2309
2309
|
titleId: t,
|
|
2310
2310
|
...n
|
|
@@ -2329,7 +2329,7 @@ function Hl({
|
|
|
2329
2329
|
clipRule: "evenodd"
|
|
2330
2330
|
}));
|
|
2331
2331
|
}
|
|
2332
|
-
const
|
|
2332
|
+
const Ul = /* @__PURE__ */ b.forwardRef(zl);
|
|
2333
2333
|
function Zl({
|
|
2334
2334
|
title: e,
|
|
2335
2335
|
titleId: t,
|
|
@@ -2351,8 +2351,8 @@ function Zl({
|
|
|
2351
2351
|
clipRule: "evenodd"
|
|
2352
2352
|
}));
|
|
2353
2353
|
}
|
|
2354
|
-
const
|
|
2355
|
-
function
|
|
2354
|
+
const Vl = /* @__PURE__ */ b.forwardRef(Zl);
|
|
2355
|
+
function Gl({
|
|
2356
2356
|
title: e,
|
|
2357
2357
|
titleId: t,
|
|
2358
2358
|
...n
|
|
@@ -2375,8 +2375,8 @@ function Vl({
|
|
|
2375
2375
|
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"
|
|
2376
2376
|
}));
|
|
2377
2377
|
}
|
|
2378
|
-
const
|
|
2379
|
-
function
|
|
2378
|
+
const Kl = /* @__PURE__ */ b.forwardRef(Gl);
|
|
2379
|
+
function Wl({
|
|
2380
2380
|
title: e,
|
|
2381
2381
|
titleId: t,
|
|
2382
2382
|
...n
|
|
@@ -2399,8 +2399,8 @@ function Kl({
|
|
|
2399
2399
|
clipRule: "evenodd"
|
|
2400
2400
|
}));
|
|
2401
2401
|
}
|
|
2402
|
-
const
|
|
2403
|
-
function
|
|
2402
|
+
const Xl = /* @__PURE__ */ b.forwardRef(Wl);
|
|
2403
|
+
function Yl({
|
|
2404
2404
|
title: e,
|
|
2405
2405
|
titleId: t,
|
|
2406
2406
|
...n
|
|
@@ -2421,7 +2421,7 @@ function Xl({
|
|
|
2421
2421
|
d: "M5.25 5.25a3 3 0 0 0-3 3v10.5a3 3 0 0 0 3 3h10.5a3 3 0 0 0 3-3V13.5a.75.75 0 0 0-1.5 0v5.25a1.5 1.5 0 0 1-1.5 1.5H5.25a1.5 1.5 0 0 1-1.5-1.5V8.25a1.5 1.5 0 0 1 1.5-1.5h5.25a.75.75 0 0 0 0-1.5H5.25Z"
|
|
2422
2422
|
}));
|
|
2423
2423
|
}
|
|
2424
|
-
const
|
|
2424
|
+
const Jl = /* @__PURE__ */ b.forwardRef(Yl), Ql = ({ href: e, onRetry: t, testId: n }) => {
|
|
2425
2425
|
const { labels: r, onEditGrant: o } = D(), [l, i] = I(!1), d = () => {
|
|
2426
2426
|
o === void 0 || l || (i(!0), o(e).then((g) => {
|
|
2427
2427
|
g && t();
|
|
@@ -2440,8 +2440,8 @@ const Yl = /* @__PURE__ */ b.forwardRef(Xl), Jl = ({ href: e, onRetry: t, testId
|
|
|
2440
2440
|
}, _t = (e, t, n) => {
|
|
2441
2441
|
const r = e.modifiedAt === null ? Number.NaN : Date.parse(e.modifiedAt);
|
|
2442
2442
|
return n(Number.isNaN(r) ? e.id : t.format(r), e.author === null ? "" : e.author);
|
|
2443
|
-
},
|
|
2444
|
-
const { data: o, edits: l, labels: i, locale: d, announcer: g } = D(), f = B(null), u = B(null), p = Oe(), [m, x] = I(null), [O, y] = I(0), [T, S] = I(null), [M, s] = I(null), c =
|
|
2443
|
+
}, ei = ({ path: e, documentName: t, open: n, onClose: r }) => {
|
|
2444
|
+
const { data: o, edits: l, labels: i, locale: d, announcer: g } = D(), f = B(null), u = B(null), p = Oe(), [m, x] = I(null), [O, y] = I(0), [T, S] = I(null), [M, s] = I(null), c = U(() => new Intl.DateTimeFormat(d, { dateStyle: "medium", timeStyle: "short" }), [d]);
|
|
2445
2445
|
V(() => {
|
|
2446
2446
|
const R = f.current;
|
|
2447
2447
|
if (R !== null)
|
|
@@ -2484,12 +2484,12 @@ const Yl = /* @__PURE__ */ b.forwardRef(Xl), Jl = ({ href: e, onRetry: t, testId
|
|
|
2484
2484
|
/* @__PURE__ */ a("button", { type: "button", className: "aqmx-callout-action", "aria-disabled": M === null || M.kind !== "revision", "data-testid": "markdown-explorer-history-restore", onClick: h, children: i.historyRestore })
|
|
2485
2485
|
] })
|
|
2486
2486
|
] }) });
|
|
2487
|
-
},
|
|
2487
|
+
}, ti = (e) => {
|
|
2488
2488
|
const { documents: t } = D(), n = P(() => t.peek(e), [t, e]), r = P(() => t.peekSeeded(e), [t, e]), o = te(t.subscribe, n, r), l = de(o)?.document;
|
|
2489
2489
|
return l === void 0 || l.kind === "failure" ? { edit: null, name: Ee(e) } : { edit: l.kind === "markdown" ? l.edit : null, name: l.name };
|
|
2490
2490
|
}, se = (e) => {
|
|
2491
2491
|
e.stopPropagation();
|
|
2492
|
-
},
|
|
2492
|
+
}, ni = ({ path: e, documentName: t, iconOnly: n }) => {
|
|
2493
2493
|
const { edits: r, labels: o } = D(), l = te(
|
|
2494
2494
|
r.subscribe,
|
|
2495
2495
|
() => r.session(e) !== void 0,
|
|
@@ -2516,7 +2516,7 @@ const Yl = /* @__PURE__ */ b.forwardRef(Xl), Jl = ({ href: e, onRetry: t, testId
|
|
|
2516
2516
|
onPointerEnter: Rt,
|
|
2517
2517
|
onFocus: Rt,
|
|
2518
2518
|
children: [
|
|
2519
|
-
/* @__PURE__ */ a(
|
|
2519
|
+
/* @__PURE__ */ a(Jl, { "aria-hidden": "true" }),
|
|
2520
2520
|
f === null ? /* @__PURE__ */ a("span", { children: o.editDocumentLabel }) : null
|
|
2521
2521
|
]
|
|
2522
2522
|
}
|
|
@@ -2537,7 +2537,7 @@ const Yl = /* @__PURE__ */ b.forwardRef(Xl), Jl = ({ href: e, onRetry: t, testId
|
|
|
2537
2537
|
}
|
|
2538
2538
|
)
|
|
2539
2539
|
] });
|
|
2540
|
-
},
|
|
2540
|
+
}, ri = ({ href: e, documentName: t, iconOnly: n }) => {
|
|
2541
2541
|
const { labels: r } = D(), o = n ? r.editExternallyNamed(t) : null;
|
|
2542
2542
|
return /* @__PURE__ */ F(
|
|
2543
2543
|
"a",
|
|
@@ -2551,16 +2551,16 @@ const Yl = /* @__PURE__ */ b.forwardRef(Xl), Jl = ({ href: e, onRetry: t, testId
|
|
|
2551
2551
|
"data-testid": "markdown-explorer-document-edit-external",
|
|
2552
2552
|
onDoubleClick: se,
|
|
2553
2553
|
children: [
|
|
2554
|
-
/* @__PURE__ */ a(
|
|
2554
|
+
/* @__PURE__ */ a(Hl, { "aria-hidden": "true" }),
|
|
2555
2555
|
o === null ? /* @__PURE__ */ a("span", { children: r.editExternallyLabel }) : null
|
|
2556
2556
|
]
|
|
2557
2557
|
}
|
|
2558
2558
|
);
|
|
2559
|
-
},
|
|
2560
|
-
const { labels: t } = D(), n =
|
|
2559
|
+
}, oi = ({ session: e }) => {
|
|
2560
|
+
const { labels: t } = D(), n = Er(t, e);
|
|
2561
2561
|
return /* @__PURE__ */ a("p", { className: "aqmx-edit-status", title: n === "" ? void 0 : n, "data-testid": "markdown-explorer-edit-status", "data-aqmx-save": e.save.kind, children: n });
|
|
2562
|
-
},
|
|
2563
|
-
const { edits: l, labels: i } = D(), d =
|
|
2562
|
+
}, li = ({ path: e, documentName: t, iconOnly: n, session: r, previewAvailable: o }) => {
|
|
2563
|
+
const { edits: l, labels: i } = D(), d = Nr(), [g, f] = I(!1);
|
|
2564
2564
|
if (r.phase.kind !== "editing") return null;
|
|
2565
2565
|
const u = r.save.kind === "saving", p = u || !r.dirty, m = () => {
|
|
2566
2566
|
l.flush(e);
|
|
@@ -2569,36 +2569,36 @@ const Yl = /* @__PURE__ */ b.forwardRef(Xl), Jl = ({ href: e, onRetry: t, testId
|
|
|
2569
2569
|
}, x = (O) => n ? { className: "aqmx-icon-button", "aria-label": O } : { className: "aqmx-icon-button aqmx-labelled-button" };
|
|
2570
2570
|
return /* @__PURE__ */ F(Ne, { children: [
|
|
2571
2571
|
r.save.kind === "conflicts" ? /* @__PURE__ */ F("button", { type: "button", ...x(i.conflictNext), title: i.conflictNext, "data-testid": "markdown-explorer-edit-next-conflict", onClick: () => l.nextConflict(e), onDoubleClick: se, children: [
|
|
2572
|
-
/* @__PURE__ */ a(
|
|
2572
|
+
/* @__PURE__ */ a(Ul, { "aria-hidden": "true" }),
|
|
2573
2573
|
n ? null : /* @__PURE__ */ a("span", { children: i.conflictNext })
|
|
2574
2574
|
] }) : null,
|
|
2575
2575
|
o ? /* @__PURE__ */ F("button", { type: "button", ...x(i.previewToggle), title: i.previewToggle, "aria-pressed": d, "data-testid": "markdown-explorer-edit-preview-toggle", onClick: () => l.setPreviewShown(!d), onDoubleClick: se, children: [
|
|
2576
|
-
/* @__PURE__ */ a(
|
|
2576
|
+
/* @__PURE__ */ a(Xl, { "aria-hidden": "true" }),
|
|
2577
2577
|
n ? null : /* @__PURE__ */ a("span", { children: i.previewToggle })
|
|
2578
2578
|
] }) : null,
|
|
2579
2579
|
r.history ? /* @__PURE__ */ F("button", { type: "button", ...x(i.historyOpen), title: i.historyOpen, "aria-haspopup": "dialog", "data-testid": "markdown-explorer-edit-history", onClick: () => f(!0), onDoubleClick: se, children: [
|
|
2580
|
-
/* @__PURE__ */ a(
|
|
2580
|
+
/* @__PURE__ */ a(Vl, { "aria-hidden": "true" }),
|
|
2581
2581
|
n ? null : /* @__PURE__ */ a("span", { children: i.historyOpen })
|
|
2582
2582
|
] }) : null,
|
|
2583
2583
|
/* @__PURE__ */ F("button", { type: "button", ...x(i.saveDraft), title: i.saveDraftTooltip, "aria-disabled": p, "aria-busy": u, "aria-keyshortcuts": "Control+S Meta+S", "data-testid": "markdown-explorer-edit-save", onClick: m, onDoubleClick: se, children: [
|
|
2584
|
-
/* @__PURE__ */ a(
|
|
2584
|
+
/* @__PURE__ */ a(Kl, { "aria-hidden": "true" }),
|
|
2585
2585
|
n ? null : /* @__PURE__ */ a("span", { children: i.saveDraft })
|
|
2586
2586
|
] }),
|
|
2587
|
-
r.history ? /* @__PURE__ */ a(
|
|
2587
|
+
r.history ? /* @__PURE__ */ a(ei, { path: e, documentName: t, open: g, onClose: () => f(!1) }) : null
|
|
2588
2588
|
] });
|
|
2589
|
-
},
|
|
2589
|
+
}, ii = ({ path: e, session: t }) => {
|
|
2590
2590
|
const { edits: n } = D();
|
|
2591
|
-
return t.save.kind !== "grant" ? null : /* @__PURE__ */ a(
|
|
2591
|
+
return t.save.kind !== "grant" ? null : /* @__PURE__ */ a(Ql, { href: t.save.href, onRetry: () => {
|
|
2592
2592
|
n.save(e);
|
|
2593
2593
|
}, testId: "markdown-explorer-save-grant" });
|
|
2594
|
-
},
|
|
2594
|
+
}, si = (e) => {
|
|
2595
2595
|
const { documents: t } = D(), n = P(() => t.peek(e), [t, e]), r = P(() => t.peekSeeded(e), [t, e]), o = te(t.subscribe, n, r);
|
|
2596
2596
|
return de(o)?.document.kind === "markdown";
|
|
2597
|
-
},
|
|
2597
|
+
}, ai = (e) => {
|
|
2598
2598
|
const { config: t } = D(), n = $e(), r = P(() => n(pe(t, { ...e, markup: !e.markup }), "browse"), [t, n, e]);
|
|
2599
|
-
return
|
|
2600
|
-
},
|
|
2601
|
-
const { documents: n, announcer: r, labels: o } = D(), l = P(() => n.peek(e), [n, e]), i = P(() => n.peekSeeded(e), [n, e]), d = te(n.subscribe, l, i), g = P(() => n.answerStampOf(e), [n, e]), f = te(n.subscribe, g, g), [u] = I(() => /* @__PURE__ */ new Set()), [p, m] = I(
|
|
2599
|
+
return U(() => ({ shown: e.markup, toggle: r }), [e.markup, r]);
|
|
2600
|
+
}, ci = /* @__PURE__ */ new Set(), di = (e, t) => {
|
|
2601
|
+
const { documents: n, announcer: r, labels: o } = D(), l = P(() => n.peek(e), [n, e]), i = P(() => n.peekSeeded(e), [n, e]), d = te(n.subscribe, l, i), g = P(() => n.answerStampOf(e), [n, e]), f = te(n.subscribe, g, g), [u] = I(() => /* @__PURE__ */ new Set()), [p, m] = I(ci), [x, O] = I(null);
|
|
2602
2602
|
x !== null && x.path !== e && O(null);
|
|
2603
2603
|
const y = B(null);
|
|
2604
2604
|
V(() => (y.current = e, () => {
|
|
@@ -2625,12 +2625,12 @@ const Yl = /* @__PURE__ */ b.forwardRef(Xl), Jl = ({ href: e, onRetry: t, testId
|
|
|
2625
2625
|
})();
|
|
2626
2626
|
}, [e, t, u, n, r, o]), S = p.has(e), M = x !== null && x.path === e && x.stamp === f ? x.failure : null;
|
|
2627
2627
|
return { refreshing: S, unavailable: S || d?.status === "pending", failure: M, refresh: T };
|
|
2628
|
-
},
|
|
2629
|
-
const { labels: r } = D(), { refreshing: o, unavailable: l, failure: i, refresh: d } =
|
|
2628
|
+
}, ui = Object.freeze({ kind: "page" }), fi = ({ path: e, placement: t, markup: n }) => {
|
|
2629
|
+
const { labels: r } = D(), { refreshing: o, unavailable: l, failure: i, refresh: d } = di(e, t.kind === "page"), g = si(e), f = ti(e), u = sn(e), p = t.kind === "panel" ? r.refreshDocumentNamed(t.documentName) : null, m = t.kind === "panel" ? r.showMarkupNamed(t.documentName) : null, x = t.kind === "panel", O = t.kind === "panel" ? t.documentName : f.name, y = t.kind === "page" || t.maximized;
|
|
2630
2630
|
return /* @__PURE__ */ F("div", { className: "aqmx-document-refresh-bar", "data-testid": "markdown-explorer-document-refresh-bar", "data-aqmx-editing": u === void 0 ? void 0 : "true", children: [
|
|
2631
2631
|
/* @__PURE__ */ F("div", { className: "aqmx-document-refresh-row", children: [
|
|
2632
|
-
u === void 0 ? null : /* @__PURE__ */ a(
|
|
2633
|
-
u === void 0 ? null : /* @__PURE__ */ a(
|
|
2632
|
+
u === void 0 ? null : /* @__PURE__ */ a(oi, { session: u }),
|
|
2633
|
+
u === void 0 ? null : /* @__PURE__ */ a(li, { path: e, documentName: O, iconOnly: x, session: u, previewAvailable: y }),
|
|
2634
2634
|
u === void 0 && g ? /* @__PURE__ */ F(
|
|
2635
2635
|
"button",
|
|
2636
2636
|
{
|
|
@@ -2643,12 +2643,12 @@ const Yl = /* @__PURE__ */ b.forwardRef(Xl), Jl = ({ href: e, onRetry: t, testId
|
|
|
2643
2643
|
onClick: n.toggle,
|
|
2644
2644
|
onDoubleClick: se,
|
|
2645
2645
|
children: [
|
|
2646
|
-
/* @__PURE__ */ a(
|
|
2646
|
+
/* @__PURE__ */ a(Il, { "aria-hidden": "true" }),
|
|
2647
2647
|
m === null ? /* @__PURE__ */ a("span", { children: r.showMarkupLabel }) : null
|
|
2648
2648
|
]
|
|
2649
2649
|
}
|
|
2650
2650
|
) : null,
|
|
2651
|
-
u !== void 0 || f.edit?.kind === "inline" ? /* @__PURE__ */ a(
|
|
2651
|
+
u !== void 0 || f.edit?.kind === "inline" ? /* @__PURE__ */ a(ni, { path: e, documentName: O, iconOnly: x }) : f.edit?.kind === "external" ? /* @__PURE__ */ a(ri, { href: f.edit.href, documentName: O, iconOnly: x }) : null,
|
|
2652
2652
|
u === void 0 ? /* @__PURE__ */ F(
|
|
2653
2653
|
"button",
|
|
2654
2654
|
{
|
|
@@ -2663,27 +2663,27 @@ const Yl = /* @__PURE__ */ b.forwardRef(Xl), Jl = ({ href: e, onRetry: t, testId
|
|
|
2663
2663
|
onClick: d,
|
|
2664
2664
|
onDoubleClick: se,
|
|
2665
2665
|
children: [
|
|
2666
|
-
/* @__PURE__ */ a(
|
|
2666
|
+
/* @__PURE__ */ a(_l, { "aria-hidden": "true" }),
|
|
2667
2667
|
p === null ? /* @__PURE__ */ a("span", { children: r.refreshDocumentLabel }) : null
|
|
2668
2668
|
]
|
|
2669
2669
|
}
|
|
2670
2670
|
) : null
|
|
2671
2671
|
] }),
|
|
2672
2672
|
u !== void 0 || i === null ? null : /* @__PURE__ */ a("p", { className: "aqmx-document-refresh-failure", "data-testid": "markdown-explorer-document-refresh-failure", "data-aqmx-failure": i.reason, children: r.documentRefreshFailed(ae(r, i.reason)) }),
|
|
2673
|
-
u === void 0 ? null : /* @__PURE__ */ a(
|
|
2673
|
+
u === void 0 ? null : /* @__PURE__ */ a(ii, { path: e, session: u })
|
|
2674
2674
|
] });
|
|
2675
|
-
},
|
|
2676
|
-
const t = e.doc, n =
|
|
2675
|
+
}, mi = ({ location: e }) => {
|
|
2676
|
+
const t = e.doc, n = U(() => ({ kind: "page", view: "single", overrides: e.overrides, embed: e.embed }), [e.overrides, e.embed]), r = ai(e);
|
|
2677
2677
|
return /* @__PURE__ */ F("div", { className: "aqmx-single aqmx-document-column", "data-testid": "markdown-explorer-single", children: [
|
|
2678
|
-
/* @__PURE__ */ a(
|
|
2679
|
-
/* @__PURE__ */ a(
|
|
2678
|
+
/* @__PURE__ */ a(fi, { path: t, placement: ui, markup: r }),
|
|
2679
|
+
/* @__PURE__ */ a(Fl, { path: t, markup: e.markup, variant: n })
|
|
2680
2680
|
] });
|
|
2681
|
-
},
|
|
2681
|
+
}, hi = ({ holds: e, testId: t }) => {
|
|
2682
2682
|
const { labels: n, announcer: r } = D(), o = Oe();
|
|
2683
2683
|
V(() => e ? r.claim(o) : void 0, [e, r, o]);
|
|
2684
2684
|
const l = P(() => r.shownIn(o), [r, o]), i = te(r.subscribe, l, l);
|
|
2685
2685
|
return /* @__PURE__ */ a("div", { className: "aqmx-sr-only", role: "status", "aria-live": "polite", "aria-atomic": "true", "data-testid": t, children: i.length > 1 ? n.announcementSequence(i) : i[0] });
|
|
2686
|
-
}, ue = Object.freeze([]),
|
|
2686
|
+
}, ue = Object.freeze([]), pi = (e) => {
|
|
2687
2687
|
const t = /* @__PURE__ */ new Set();
|
|
2688
2688
|
let n = ue, r = [], o = !1;
|
|
2689
2689
|
const l = [], i = (u) => {
|
|
@@ -2718,13 +2718,13 @@ const Yl = /* @__PURE__ */ b.forwardRef(Xl), Jl = ({ href: e, onRetry: t, testId
|
|
|
2718
2718
|
},
|
|
2719
2719
|
shownIn: (u) => d() === u ? n : ue
|
|
2720
2720
|
};
|
|
2721
|
-
}, he = Object.freeze({ status: "cancelled" }),
|
|
2721
|
+
}, he = Object.freeze({ status: "cancelled" }), gi = (e) => {
|
|
2722
2722
|
if (e === null || typeof e != "object") return null;
|
|
2723
2723
|
const { failure: t } = e;
|
|
2724
|
-
if (
|
|
2724
|
+
if (Wn(t) !== null) return null;
|
|
2725
2725
|
const { reason: n, code: r } = t;
|
|
2726
|
-
return
|
|
2727
|
-
},
|
|
2726
|
+
return Xn(n, r);
|
|
2727
|
+
}, vi = ({ dataPath: e, onScope: t, fetch: n }) => {
|
|
2728
2728
|
const r = n ?? ((f, u) => globalThis.fetch(f, u)), o = (f, u) => `${e}/${f}?${new URLSearchParams(u).toString()}`, l = async (f, u, p, m) => {
|
|
2729
2729
|
let x;
|
|
2730
2730
|
try {
|
|
@@ -2733,7 +2733,7 @@ const Yl = /* @__PURE__ */ b.forwardRef(Xl), Jl = ({ href: e, onRetry: t, testId
|
|
|
2733
2733
|
return m({ reason: "failed" });
|
|
2734
2734
|
}
|
|
2735
2735
|
x.status === 401 && t(null);
|
|
2736
|
-
const O = x.headers.get(
|
|
2736
|
+
const O = x.headers.get(Un);
|
|
2737
2737
|
O !== null && t(O);
|
|
2738
2738
|
let y;
|
|
2739
2739
|
try {
|
|
@@ -2748,39 +2748,39 @@ const Yl = /* @__PURE__ */ b.forwardRef(Xl), Jl = ({ href: e, onRetry: t, testId
|
|
|
2748
2748
|
T = !1;
|
|
2749
2749
|
}
|
|
2750
2750
|
if (T) return y;
|
|
2751
|
-
const S =
|
|
2751
|
+
const S = gi(y);
|
|
2752
2752
|
return m(S !== null ? S : { reason: x.status === 200 ? "failed" : ht(x.status) });
|
|
2753
|
-
}, i = { [gt]:
|
|
2753
|
+
}, i = { [gt]: Yn }, d = { [gt]: nr, "Content-Type": `${tr}; charset=utf-8` }, g = async (f, u, p) => {
|
|
2754
2754
|
const m = await l(f, u, p, (x) => He(x.reason, x.code));
|
|
2755
2755
|
return u.signal.aborted ? he : m;
|
|
2756
2756
|
};
|
|
2757
2757
|
return {
|
|
2758
2758
|
tree: (f) => l(o("tree", { [Y.source]: f }), { method: "GET" }, pt, (u) => ({ status: "error", failure: u })),
|
|
2759
2759
|
children: async (f, u, p) => {
|
|
2760
|
-
const m = await l(o("children", { [Y.source]: f, [Y.path]: u }), { method: "GET", signal: p },
|
|
2760
|
+
const m = await l(o("children", { [Y.source]: f, [Y.path]: u }), { method: "GET", signal: p }, Kn, (x) => ({ status: "error", failure: x }));
|
|
2761
2761
|
return p.aborted ? he : m;
|
|
2762
2762
|
},
|
|
2763
2763
|
ancestors: async (f, u, p) => {
|
|
2764
|
-
const m = await l(o("ancestors", { [Y.source]: f, [Y.path]: u }), { method: "GET", signal: p },
|
|
2764
|
+
const m = await l(o("ancestors", { [Y.source]: f, [Y.path]: u }), { method: "GET", signal: p }, Gn, (x) => ({ status: "error", failure: x }));
|
|
2765
2765
|
return p.aborted ? he : m;
|
|
2766
2766
|
},
|
|
2767
2767
|
reveal: async (f, u, p) => {
|
|
2768
|
-
const m = await l(o("reveal", { [Y.source]: f, [Y.path]: u }), { method: "GET", signal: p },
|
|
2768
|
+
const m = await l(o("reveal", { [Y.source]: f, [Y.path]: u }), { method: "GET", signal: p }, Vn, (x) => ({ status: "error", failure: x }));
|
|
2769
2769
|
return p.aborted ? he : m;
|
|
2770
2770
|
},
|
|
2771
|
-
document: (f, { refresh: u }) => l(o("document", { [Y.path]: f }), u ? { method: "GET", headers: i } : { method: "GET" },
|
|
2771
|
+
document: (f, { refresh: u }) => l(o("document", { [Y.path]: f }), u ? { method: "GET", headers: i } : { method: "GET" }, lr, (p) => He(p.reason, p.code)),
|
|
2772
2772
|
text: async (f, u) => {
|
|
2773
2773
|
const p = await l(o("text", { [Y.path]: f }), { method: "GET", signal: u }, Zn, (m) => He(m.reason, m.code));
|
|
2774
2774
|
return u.aborted ? he : p;
|
|
2775
2775
|
},
|
|
2776
|
-
edit: (f, u) => g(o("edit", { [Y.path]: f }), { method: "GET", signal: u },
|
|
2777
|
-
save: (f, u, p, m) => g(o("save", { [Y.path]: f, [Y.base]: u }), { method: "POST", headers: d, body: p, signal: m },
|
|
2778
|
-
preview: (f, u, p) => g(o("preview", { [Y.path]: f }), { method: "POST", headers: d, body: u, signal: p },
|
|
2779
|
-
revisions: (f, u) => g(o("revisions", { [Y.path]: f }), { method: "GET", signal: u },
|
|
2780
|
-
revision: (f, u, p) => g(o("revision", { [Y.path]: f, [Y.revision]: u }), { method: "GET", signal: p },
|
|
2776
|
+
edit: (f, u) => g(o("edit", { [Y.path]: f }), { method: "GET", signal: u }, or),
|
|
2777
|
+
save: (f, u, p, m) => g(o("save", { [Y.path]: f, [Y.base]: u }), { method: "POST", headers: d, body: p, signal: m }, rr),
|
|
2778
|
+
preview: (f, u, p) => g(o("preview", { [Y.path]: f }), { method: "POST", headers: d, body: u, signal: p }, er),
|
|
2779
|
+
revisions: (f, u) => g(o("revisions", { [Y.path]: f }), { method: "GET", signal: u }, Qn),
|
|
2780
|
+
revision: (f, u, p) => g(o("revision", { [Y.path]: f, [Y.revision]: u }), { method: "GET", signal: p }, Jn),
|
|
2781
2781
|
refresh: (f) => l(o("refresh", { [Y.source]: f }), { method: "POST", headers: i }, pt, (u) => ({ status: "error", failure: u }))
|
|
2782
2782
|
};
|
|
2783
|
-
},
|
|
2783
|
+
}, wi = () => {
|
|
2784
2784
|
let e = null, t = null;
|
|
2785
2785
|
return {
|
|
2786
2786
|
settle: (n) => {
|
|
@@ -2795,7 +2795,7 @@ const Yl = /* @__PURE__ */ b.forwardRef(Xl), Jl = ({ href: e, onRetry: t, testId
|
|
|
2795
2795
|
return t = null, o;
|
|
2796
2796
|
}
|
|
2797
2797
|
};
|
|
2798
|
-
},
|
|
2798
|
+
}, bi = (e) => {
|
|
2799
2799
|
const t = Jt(e);
|
|
2800
2800
|
if (t === null) return mt;
|
|
2801
2801
|
try {
|
|
@@ -2807,7 +2807,7 @@ const Yl = /* @__PURE__ */ b.forwardRef(Xl), Jl = ({ href: e, onRetry: t, testId
|
|
|
2807
2807
|
let n = null;
|
|
2808
2808
|
const r = () => {
|
|
2809
2809
|
if (n === null) {
|
|
2810
|
-
const l =
|
|
2810
|
+
const l = bi(e);
|
|
2811
2811
|
n = { changes: l, settings: ft(t, l) };
|
|
2812
2812
|
}
|
|
2813
2813
|
return n;
|
|
@@ -2823,7 +2823,7 @@ const Yl = /* @__PURE__ */ b.forwardRef(Xl), Jl = ({ href: e, onRetry: t, testId
|
|
|
2823
2823
|
return n = { changes: g, settings: ft(t, g) }, o.emit(), Yt(e, _n(g)), n.settings;
|
|
2824
2824
|
}
|
|
2825
2825
|
};
|
|
2826
|
-
},
|
|
2826
|
+
}, Ei = Object.freeze({ status: "refreshed" }), yi = Object.freeze({ status: "superseded" }), et = Object.freeze({ status: "deferred" }), xi = mn(et), Tn = 4, ki = Tn - 1, It = Object.freeze({ status: "loading" }), Si = Object.freeze({ status: "error", failure: Object.freeze({ reason: "failed" }) }), Ri = (e) => {
|
|
2827
2827
|
const t = /* @__PURE__ */ new Map(), n = fn(), r = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), d = ye(), g = /* @__PURE__ */ new Set();
|
|
2828
2828
|
let f = 0, u = 0;
|
|
2829
2829
|
const p = { direct: null, bulk: null }, m = /* @__PURE__ */ new Set();
|
|
@@ -2856,11 +2856,11 @@ const Yl = /* @__PURE__ */ b.forwardRef(Xl), Jl = ({ href: e, onRetry: t, testId
|
|
|
2856
2856
|
}, k = (v) => {
|
|
2857
2857
|
const E = [...i.keys()], C = p[v], A = C === null ? 0 : E.indexOf(C) + 1;
|
|
2858
2858
|
for (let _ = 0; _ < E.length; _ += 1) {
|
|
2859
|
-
const j = E[(A + _) % E.length],
|
|
2860
|
-
if (!(j === void 0 ||
|
|
2861
|
-
for (const H of
|
|
2862
|
-
if ((
|
|
2863
|
-
return
|
|
2859
|
+
const j = E[(A + _) % E.length], Z = j === void 0 ? void 0 : i.get(j);
|
|
2860
|
+
if (!(j === void 0 || Z === void 0)) {
|
|
2861
|
+
for (const H of Z[v])
|
|
2862
|
+
if ((Z.claims.get(H) ?? 0) !== 0)
|
|
2863
|
+
return Z[v].delete(H), p[v] = j, { sourceId: j, path: H };
|
|
2864
2864
|
}
|
|
2865
2865
|
}
|
|
2866
2866
|
return null;
|
|
@@ -2868,8 +2868,8 @@ const Yl = /* @__PURE__ */ b.forwardRef(Xl), Jl = ({ href: e, onRetry: t, testId
|
|
|
2868
2868
|
const _ = i.get(v);
|
|
2869
2869
|
if (_ === void 0 || _.inFlight.get(E) !== C) return;
|
|
2870
2870
|
M(_, E, C);
|
|
2871
|
-
const j = (_.claims.get(E) ?? 0) > 0,
|
|
2872
|
-
if (A.status === "ok" ?
|
|
2871
|
+
const j = (_.claims.get(E) ?? 0) > 0, Z = w(v);
|
|
2872
|
+
if (A.status === "ok" ? Z.set(E, { status: "loaded", entries: A.entries }) : A.status === "error" && j ? Z.set(E, { status: "failed", failure: A.failure }) : Z.delete(E), y(), A.status === "error" && j) {
|
|
2873
2873
|
const H = { sourceId: v, path: E, failure: A.failure };
|
|
2874
2874
|
for (const le of [...g]) le(H);
|
|
2875
2875
|
}
|
|
@@ -2878,7 +2878,7 @@ const Yl = /* @__PURE__ */ b.forwardRef(Xl), Jl = ({ href: e, onRetry: t, testId
|
|
|
2878
2878
|
const A = { controller: new AbortController(), lane: C };
|
|
2879
2879
|
S(v).inFlight.set(E, A), f += 1, C === "bulk" && (u += 1), e.children(v, E, A.controller.signal).then(
|
|
2880
2880
|
(_) => L(v, E, A, _),
|
|
2881
|
-
() => L(v, E, A,
|
|
2881
|
+
() => L(v, E, A, Si)
|
|
2882
2882
|
);
|
|
2883
2883
|
}, N = () => {
|
|
2884
2884
|
for (; f < Tn; ) {
|
|
@@ -2887,7 +2887,7 @@ const Yl = /* @__PURE__ */ b.forwardRef(Xl), Jl = ({ href: e, onRetry: t, testId
|
|
|
2887
2887
|
R(v.sourceId, v.path, "direct");
|
|
2888
2888
|
continue;
|
|
2889
2889
|
}
|
|
2890
|
-
const E = u <
|
|
2890
|
+
const E = u < ki ? k("bulk") : null;
|
|
2891
2891
|
if (E === null) return;
|
|
2892
2892
|
R(E.sourceId, E.path, "bulk");
|
|
2893
2893
|
}
|
|
@@ -2933,7 +2933,7 @@ const Yl = /* @__PURE__ */ b.forwardRef(Xl), Jl = ({ href: e, onRetry: t, testId
|
|
|
2933
2933
|
e.tree(v).then((A) => X(v, E, C, A));
|
|
2934
2934
|
};
|
|
2935
2935
|
return {
|
|
2936
|
-
read: (v) => t.get(v)?.promise ??
|
|
2936
|
+
read: (v) => t.get(v)?.promise ?? xi,
|
|
2937
2937
|
open: (v) => {
|
|
2938
2938
|
const E = n.resumes(v), C = n.hold(v), A = t.get(v);
|
|
2939
2939
|
return A === void 0 || $(v, "deferred") ? (J(v, !0), y()) : E || (A.opened && $(v, "error") ? (J(v, !0), y()) : (A.opened = !0, A.stale && $(v, "ok") && G(v, A))), C;
|
|
@@ -2948,7 +2948,7 @@ const Yl = /* @__PURE__ */ b.forwardRef(Xl), Jl = ({ href: e, onRetry: t, testId
|
|
|
2948
2948
|
), A = t.get(v);
|
|
2949
2949
|
if (A !== void 0 && $(v, "ok")) {
|
|
2950
2950
|
const j = T(v);
|
|
2951
|
-
C.then((
|
|
2951
|
+
C.then((Z) => X(v, A, j, Z));
|
|
2952
2952
|
return;
|
|
2953
2953
|
}
|
|
2954
2954
|
c(v);
|
|
@@ -2961,19 +2961,19 @@ const Yl = /* @__PURE__ */ b.forwardRef(Xl), Jl = ({ href: e, onRetry: t, testId
|
|
|
2961
2961
|
const E = (l.get(v) ?? 0) + 1;
|
|
2962
2962
|
l.set(v, E);
|
|
2963
2963
|
const C = await e.refresh(v);
|
|
2964
|
-
if (l.get(v) !== E) return
|
|
2964
|
+
if (l.get(v) !== E) return yi;
|
|
2965
2965
|
if (C.status === "error") return { status: "failed", failure: C.failure };
|
|
2966
2966
|
const A = t.get(v);
|
|
2967
2967
|
if (!(A !== void 0 && A.loadedAt !== null && $(v, "ok") && A.loadedAt > C.loadedAt)) {
|
|
2968
2968
|
const j = ee(v, C, !0);
|
|
2969
2969
|
if (A !== void 0 && A.promise.status === "pending") {
|
|
2970
|
-
const
|
|
2971
|
-
A.promise.then((H) => X(v, j,
|
|
2970
|
+
const Z = T(v);
|
|
2971
|
+
A.promise.then((H) => X(v, j, Z, H));
|
|
2972
2972
|
}
|
|
2973
2973
|
}
|
|
2974
|
-
for (const [j,
|
|
2975
|
-
j !== v && Se(
|
|
2976
|
-
return
|
|
2974
|
+
for (const [j, Z] of t)
|
|
2975
|
+
j !== v && Se(Z.promise)?.status === "ok" && (Z.stale = !0);
|
|
2976
|
+
return Ei;
|
|
2977
2977
|
},
|
|
2978
2978
|
children: (v, E) => r.get(v)?.get(E),
|
|
2979
2979
|
claimChildren: (v, E) => {
|
|
@@ -2982,10 +2982,10 @@ const Yl = /* @__PURE__ */ b.forwardRef(Xl), Jl = ({ href: e, onRetry: t, testId
|
|
|
2982
2982
|
for (const [H, le] of E)
|
|
2983
2983
|
C.claims.set(H, (C.claims.get(H) ?? 0) + 1), A.get(H) === void 0 ? (A.set(H, It), C[le].add(H), _ = !0, j = !0) : le === "direct" && C.bulk.delete(H) && (C.direct.add(H), j = !0);
|
|
2984
2984
|
_ && y(), j && N();
|
|
2985
|
-
let
|
|
2985
|
+
let Z = !1;
|
|
2986
2986
|
return () => {
|
|
2987
|
-
if (!
|
|
2988
|
-
|
|
2987
|
+
if (!Z) {
|
|
2988
|
+
Z = !0;
|
|
2989
2989
|
for (const H of E.keys()) {
|
|
2990
2990
|
const le = (C.claims.get(H) ?? 0) - 1;
|
|
2991
2991
|
le > 0 ? C.claims.set(H, le) : (C.claims.delete(H), C.unclaimed.add(H));
|
|
@@ -3019,7 +3019,7 @@ const Yl = /* @__PURE__ */ b.forwardRef(Xl), Jl = ({ href: e, onRetry: t, testId
|
|
|
3019
3019
|
subscribe: d.subscribe,
|
|
3020
3020
|
version: () => O
|
|
3021
3021
|
};
|
|
3022
|
-
},
|
|
3022
|
+
}, Ti = (e, t) => {
|
|
3023
3023
|
let n = e;
|
|
3024
3024
|
const r = ye();
|
|
3025
3025
|
return {
|
|
@@ -3029,26 +3029,26 @@ const Yl = /* @__PURE__ */ b.forwardRef(Xl), Jl = ({ href: e, onRetry: t, testId
|
|
|
3029
3029
|
n = { ...n, ...o }, t(n), r.emit();
|
|
3030
3030
|
}
|
|
3031
3031
|
};
|
|
3032
|
-
},
|
|
3032
|
+
}, Ci = 1;
|
|
3033
3033
|
let Re = 0, ce = null;
|
|
3034
|
-
const
|
|
3034
|
+
const Oi = () => {
|
|
3035
3035
|
const { documentElement: e, body: t } = document;
|
|
3036
3036
|
Re === 0 && (ce = { htmlOverflow: e.style.overflow, bodyOverflow: t.style.overflow, htmlGutter: e.style.scrollbarGutter, bodyGutter: t.style.scrollbarGutter }, e.style.overflow = "hidden", t.style.overflow = "hidden", e.style.scrollbarGutter = "auto", t.style.scrollbarGutter = "auto"), Re += 1;
|
|
3037
3037
|
let n = !1;
|
|
3038
3038
|
return () => {
|
|
3039
3039
|
n || (n = !0, Re -= 1, !(Re > 0 || ce === null) && (e.style.overflow = ce.htmlOverflow, t.style.overflow = ce.bodyOverflow, e.style.scrollbarGutter = ce.htmlGutter, t.style.scrollbarGutter = ce.bodyGutter, ce = null));
|
|
3040
3040
|
};
|
|
3041
|
-
},
|
|
3041
|
+
}, Ai = [
|
|
3042
3042
|
{ selector: '[data-aqmx-document-flow="fill"]', name: "document region" },
|
|
3043
3043
|
{ selector: "[data-aqmx-explorer-body]", name: "tree area" }
|
|
3044
|
-
], jt = 1, Ht = (e) => e.getClientRects().length > 0, Ke = "Give the explorer's container a definite block size (for example height: 100dvh, or a flex column of definite height whose item has flex: 1 and min-height: 0; in a fresh React Router app also html and body at height: 100%) instead of an auto or only a minimum height.",
|
|
3044
|
+
], jt = 1, Ht = (e) => e.getClientRects().length > 0, Ke = "Give the explorer's container a definite block size (for example height: 100dvh, or a flex column of definite height whose item has flex: 1 and min-height: 0; in a fresh React Router app also html and body at height: 100%) instead of an auto or only a minimum height.", Li = (e) => {
|
|
3045
3045
|
if (!Ht(e)) return null;
|
|
3046
3046
|
const t = e.getBoundingClientRect(), n = window.innerHeight;
|
|
3047
|
-
if (t.bottom > n +
|
|
3047
|
+
if (t.bottom > n + Ci)
|
|
3048
3048
|
return `[markdown-explorer] the explorer ends ${String(Math.round(t.bottom))}px down a ${String(n)}px viewport while lockDocumentScroll stops the page from scrolling, so the rest cannot be reached. ${Ke}`;
|
|
3049
3049
|
if (t.height < jt)
|
|
3050
3050
|
return `[markdown-explorer] the explorer collapsed to ${String(Math.round(t.height))}px while lockDocumentScroll stops the page from scrolling, so nothing can be read. ${Ke}`;
|
|
3051
|
-
for (const { selector: r, name: o } of
|
|
3051
|
+
for (const { selector: r, name: o } of Ai)
|
|
3052
3052
|
for (const l of e.querySelectorAll(r)) {
|
|
3053
3053
|
if (!Ht(l)) continue;
|
|
3054
3054
|
const i = l.getBoundingClientRect().height;
|
|
@@ -3056,37 +3056,37 @@ const Ci = () => {
|
|
|
3056
3056
|
return `[markdown-explorer] the explorer's ${o} collapsed to ${String(Math.round(i))}px while lockDocumentScroll stops the page from scrolling, so it cannot be read. ${Ke}`;
|
|
3057
3057
|
}
|
|
3058
3058
|
return null;
|
|
3059
|
-
},
|
|
3059
|
+
}, Mi = (e) => {
|
|
3060
3060
|
let t = !1;
|
|
3061
3061
|
const n = () => {
|
|
3062
3062
|
if (t) return;
|
|
3063
|
-
const o =
|
|
3063
|
+
const o = Li(e);
|
|
3064
3064
|
o !== null && (t = !0, console.error(o));
|
|
3065
3065
|
}, r = typeof ResizeObserver > "u" ? null : new ResizeObserver(n);
|
|
3066
3066
|
return r?.observe(e), window.addEventListener("resize", n), n(), () => {
|
|
3067
3067
|
r?.disconnect(), window.removeEventListener("resize", n);
|
|
3068
3068
|
};
|
|
3069
|
-
},
|
|
3070
|
-
ne(() => e ?
|
|
3069
|
+
}, Ni = (e, t) => {
|
|
3070
|
+
ne(() => e ? Oi() : void 0, [e]), ne(() => {
|
|
3071
3071
|
const n = t.current;
|
|
3072
3072
|
if (!(!e || n === null))
|
|
3073
|
-
return
|
|
3073
|
+
return Mi(n);
|
|
3074
3074
|
}, [e, t]);
|
|
3075
|
-
}, zt = '[data-testid="markdown-explorer-view-switch"]',
|
|
3075
|
+
}, zt = '[data-testid="markdown-explorer-view-switch"]', Di = [
|
|
3076
3076
|
{ control: zt, successors: [zt, '[data-testid="markdown-explorer-sheet-toggle"]'] },
|
|
3077
3077
|
{ control: '[data-testid="markdown-explorer-selection-open"]', successors: ['[data-testid="markdown-explorer-panel-frame"]'] }
|
|
3078
|
-
],
|
|
3079
|
-
for (const t of
|
|
3078
|
+
], $i = (e) => {
|
|
3079
|
+
for (const t of Di) {
|
|
3080
3080
|
const n = e.closest(t.control);
|
|
3081
3081
|
if (n !== null) return { element: n, control: t };
|
|
3082
3082
|
}
|
|
3083
3083
|
return null;
|
|
3084
|
-
},
|
|
3084
|
+
}, Pi = (e, t) => {
|
|
3085
3085
|
const n = B(null);
|
|
3086
3086
|
ne(() => {
|
|
3087
3087
|
const o = (d) => {
|
|
3088
3088
|
const g = e.current;
|
|
3089
|
-
n.current = g !== null && d instanceof Element && g.contains(d) ?
|
|
3089
|
+
n.current = g !== null && d instanceof Element && g.contains(d) ? $i(d) : null;
|
|
3090
3090
|
}, l = (d) => o(d.target);
|
|
3091
3091
|
o(document.activeElement);
|
|
3092
3092
|
const i = (d) => {
|
|
@@ -3124,21 +3124,21 @@ const Ci = () => {
|
|
|
3124
3124
|
});
|
|
3125
3125
|
return d.observe(i, { childList: !0, subtree: !0 }), () => d.disconnect();
|
|
3126
3126
|
}, [t, e]);
|
|
3127
|
-
},
|
|
3127
|
+
}, Fi = tt(() => import("./TreeLayout-8pRo1ANN.js").then((e) => ({ default: e.TreeLayout }))), qi = tt(() => import("./MultiLayout-Jy9BKofx.js").then((e) => ({ default: e.MultiLayout }))), _i = 64, Bi = {
|
|
3128
3128
|
request: (e) => {
|
|
3129
3129
|
requestAnimationFrame(e);
|
|
3130
3130
|
}
|
|
3131
|
-
},
|
|
3131
|
+
}, Ut = (e) => {
|
|
3132
3132
|
e.documents.clear(), e.trees.clear();
|
|
3133
3133
|
}, We = (e, t) => {
|
|
3134
3134
|
t.tree !== null && e.trees.seed(t.tree.sourceId, t.tree.result);
|
|
3135
3135
|
for (const { path: n, document: r } of t.documents) e.documents.seed(n, r);
|
|
3136
|
-
},
|
|
3136
|
+
}, Ii = (e, t) => {
|
|
3137
3137
|
const [n, r] = I(() => ({ overrides: t, locale: e, labels: Et(e, t) }));
|
|
3138
|
-
if (n.locale === e &&
|
|
3138
|
+
if (n.locale === e && wr(n.overrides, t)) return n.labels;
|
|
3139
3139
|
const o = { overrides: t, locale: e, labels: Et(e, t) };
|
|
3140
3140
|
return r(o), o.labels;
|
|
3141
|
-
},
|
|
3141
|
+
}, ji = (e, t, n) => {
|
|
3142
3142
|
const [r, o] = I(() => ({ scope: t, store: Bt(e, n) }));
|
|
3143
3143
|
if (r.scope === t && r.store.storageKey === e && r.store.defaults === n) return r.store;
|
|
3144
3144
|
const l = { scope: t, store: Bt(e, n) };
|
|
@@ -3148,28 +3148,28 @@ const Ci = () => {
|
|
|
3148
3148
|
if (n.scope === e) return n.value;
|
|
3149
3149
|
const o = { scope: e, value: t() };
|
|
3150
3150
|
return r(o), o.value;
|
|
3151
|
-
},
|
|
3151
|
+
}, Hi = () => pi(Bi), Zt = "on", zi = "off", Ui = (e, t) => {
|
|
3152
3152
|
const n = de(e.peek(t));
|
|
3153
3153
|
return n === null || n.document.kind === "failure" ? Ee(t) : n.document.name;
|
|
3154
|
-
},
|
|
3155
|
-
|
|
3156
|
-
const p = tn(r), m =
|
|
3154
|
+
}, os = ({ data: e, config: t, storageNamespace: n, locale: r, labels: o, theme: l, renderFrame: i, renderTreeFailure: d, lockDocumentScroll: g = !1, onMathDiagnostics: f, onEditGrant: u }) => {
|
|
3155
|
+
cr(n);
|
|
3156
|
+
const p = tn(r), m = br(l), x = Ii(p, o), { revalidate: O } = Dn(), y = B(() => {
|
|
3157
3157
|
}), T = De(t.dataPath), [S] = I(() => {
|
|
3158
|
-
const $ =
|
|
3158
|
+
const $ = vi({ dataPath: T, onScope: (v) => y.current(v) }), G = { documents: lo({ client: $, capacity: Math.max(_i, t.multiView.maxPanels * 2) }), trees: Ri($) };
|
|
3159
3159
|
return We(G, e), wt(n, e.scope), { data: $, ...G, aligned: { pageData: e, storageNamespace: n, pendingReader: null } };
|
|
3160
3160
|
});
|
|
3161
3161
|
if (S.aligned.pageData !== e || S.aligned.storageNamespace !== n) {
|
|
3162
3162
|
const $ = S.aligned.pageData;
|
|
3163
3163
|
S.aligned.pageData = e, S.aligned.storageNamespace = n, $ !== e && ($.scope !== e.scope ? S.aligned.pendingReader = e : We(S, e)), wt(n, e.scope);
|
|
3164
3164
|
}
|
|
3165
|
-
const M =
|
|
3165
|
+
const M = ji(ze(n).treeSettings, e.scope, t.defaultTreeSettings);
|
|
3166
3166
|
V(() => {
|
|
3167
3167
|
const $ = S.aligned.pendingReader;
|
|
3168
|
-
$ !== null && (S.aligned.pendingReader = null,
|
|
3168
|
+
$ !== null && (S.aligned.pendingReader = null, Ut(S), We(S, $));
|
|
3169
3169
|
}, [e, S]), V(() => {
|
|
3170
3170
|
let $ = !1;
|
|
3171
3171
|
return y.current = (G) => {
|
|
3172
|
-
G === e.scope || $ || ($ = !0, G !== null && (
|
|
3172
|
+
G === e.scope || $ || ($ = !0, G !== null && (Ut(S), dr(n)), O());
|
|
3173
3173
|
}, () => {
|
|
3174
3174
|
y.current = () => {
|
|
3175
3175
|
};
|
|
@@ -3180,37 +3180,37 @@ const Ci = () => {
|
|
|
3180
3180
|
s.current = t.settingsCookie;
|
|
3181
3181
|
}, [t.settingsCookie]);
|
|
3182
3182
|
const [c] = I(
|
|
3183
|
-
() =>
|
|
3183
|
+
() => Ti(e.settings, ($) => {
|
|
3184
3184
|
document.cookie = jn(s.current, $, window.location.protocol === "https:");
|
|
3185
3185
|
})
|
|
3186
|
-
), h = Xe(e.scope,
|
|
3186
|
+
), h = Xe(e.scope, Hi), w = Xe(e.scope, wi), k = B(x);
|
|
3187
3187
|
V(() => {
|
|
3188
3188
|
k.current = x;
|
|
3189
3189
|
}, [x]);
|
|
3190
3190
|
const L = Xe(
|
|
3191
3191
|
e.scope,
|
|
3192
|
-
() =>
|
|
3192
|
+
() => Or({
|
|
3193
3193
|
data: S.data,
|
|
3194
3194
|
conflictLabels: () => ({ ours: k.current.conflictOurs, theirs: k.current.conflictTheirs }),
|
|
3195
3195
|
onSaveSettled: ($, G) => {
|
|
3196
3196
|
G.kind === "saved" && S.documents.refresh($);
|
|
3197
|
-
const v =
|
|
3197
|
+
const v = yr(k.current, G, Ui(S.documents, $));
|
|
3198
3198
|
v !== null && h.announce(v);
|
|
3199
3199
|
},
|
|
3200
3200
|
previewSetting: {
|
|
3201
|
-
read: () => Jt(ze(n).editPreview) ===
|
|
3202
|
-
write: ($) => Yt(ze(n).editPreview, $ ?
|
|
3201
|
+
read: () => Jt(ze(n).editPreview) === Zt,
|
|
3202
|
+
write: ($) => Yt(ze(n).editPreview, $ ? Zt : zi)
|
|
3203
3203
|
}
|
|
3204
3204
|
})
|
|
3205
|
-
), R =
|
|
3206
|
-
`), q =
|
|
3205
|
+
), R = U(() => be(e.notices.catch(() => [])), [e.notices]), N = e.sources.map(($) => $.id).join(`
|
|
3206
|
+
`), q = U(() => In(t, N.split(`
|
|
3207
3207
|
`)), [t, N]), W = B(f);
|
|
3208
3208
|
V(() => {
|
|
3209
3209
|
W.current = f;
|
|
3210
3210
|
}, [f]);
|
|
3211
3211
|
const [J] = I(() => ($, G) => {
|
|
3212
3212
|
W.current?.($, G);
|
|
3213
|
-
}), ee = f === void 0 ? void 0 : J, X =
|
|
3213
|
+
}), ee = f === void 0 ? void 0 : J, X = U(
|
|
3214
3214
|
() => ({
|
|
3215
3215
|
config: q,
|
|
3216
3216
|
labels: x,
|
|
@@ -3234,65 +3234,65 @@ const Ci = () => {
|
|
|
3234
3234
|
}),
|
|
3235
3235
|
[q, x, p, m, n, e.scope, e.sources, R, S, c, M, h, w, L, u, d, ee]
|
|
3236
3236
|
);
|
|
3237
|
-
return /* @__PURE__ */ a(nn, { value: X, children: /* @__PURE__ */ a(
|
|
3237
|
+
return /* @__PURE__ */ a(nn, { value: X, children: /* @__PURE__ */ a(Vi, { renderFrame: i, lockDocumentScroll: g }, e.scope) });
|
|
3238
3238
|
}, Zi = ({ ref: e, theme: t, view: n, children: r }) => {
|
|
3239
|
-
const [o] = I(
|
|
3239
|
+
const [o] = I(Uo);
|
|
3240
3240
|
return /* @__PURE__ */ a("div", { ref: e, className: "aqmx-root", "data-aqmx-theme": t, "data-aqmx-view": n, "data-testid": "markdown-explorer", onKeyDownCapture: o.onKeyDownCapture, onKeyUpCapture: o.onKeyUpCapture, onBlurCapture: o.onBlurCapture, children: r });
|
|
3241
|
-
},
|
|
3241
|
+
}, Vi = ({ renderFrame: e, lockDocumentScroll: t }) => {
|
|
3242
3242
|
const { theme: n, labels: r } = D(), o = nt(), { hash: l } = Gt(), i = $e(), d = B(null);
|
|
3243
|
-
|
|
3243
|
+
Ni(t, d), V(() => {
|
|
3244
3244
|
o.kind === "redirect" && i(`${o.href}${l}`, "browse");
|
|
3245
3245
|
}, [o, l, i]);
|
|
3246
3246
|
const { location: g } = o, f = g.view;
|
|
3247
|
-
|
|
3248
|
-
const u = g.view === "tree" ? /* @__PURE__ */ a(ge, { fallback: /* @__PURE__ */ a("section", { className: "aqmx-split-fallback", "aria-label": r.explorerRegion, "aria-busy": "true", "data-testid": "markdown-explorer-split-loading" }), children: /* @__PURE__ */ a(
|
|
3247
|
+
Pi(d, f);
|
|
3248
|
+
const u = g.view === "tree" ? /* @__PURE__ */ a(ge, { fallback: /* @__PURE__ */ a("section", { className: "aqmx-split-fallback", "aria-label": r.explorerRegion, "aria-busy": "true", "data-testid": "markdown-explorer-split-loading" }), children: /* @__PURE__ */ a(Fi, { location: g }) }) : g.view === "multi" ? /* @__PURE__ */ a(ge, { fallback: /* @__PURE__ */ a("section", { className: "aqmx-stage-fallback", "aria-label": r.multiRegion, "aria-busy": "true", "data-testid": "markdown-explorer-stage-loading" }), children: /* @__PURE__ */ a(qi, { location: g }) }) : /* @__PURE__ */ a(mi, { location: g }), p = /* @__PURE__ */ F(Zi, { ref: d, theme: n, view: f, children: [
|
|
3249
3249
|
u,
|
|
3250
|
-
/* @__PURE__ */ a(
|
|
3251
|
-
/* @__PURE__ */ a(
|
|
3250
|
+
/* @__PURE__ */ a($r, {}),
|
|
3251
|
+
/* @__PURE__ */ a(hi, { holds: !0, testId: "markdown-explorer-announcer" })
|
|
3252
3252
|
] });
|
|
3253
3253
|
return e === void 0 ? p : e({ view: f, children: p });
|
|
3254
|
-
},
|
|
3254
|
+
}, ls = ({ currentUrl: e, nextUrl: t, formMethod: n, defaultShouldRevalidate: r }) => n === void 0 && e.href === t.href && r;
|
|
3255
3255
|
export {
|
|
3256
3256
|
Qe as A,
|
|
3257
3257
|
yt as B,
|
|
3258
|
-
|
|
3259
|
-
|
|
3260
|
-
|
|
3258
|
+
xr as C,
|
|
3259
|
+
fi as D,
|
|
3260
|
+
Ql as E,
|
|
3261
3261
|
ve as F,
|
|
3262
3262
|
en as G,
|
|
3263
|
-
|
|
3264
|
-
|
|
3263
|
+
fr as H,
|
|
3264
|
+
Go as I,
|
|
3265
3265
|
bt as J,
|
|
3266
|
-
|
|
3267
|
-
|
|
3268
|
-
|
|
3266
|
+
os as K,
|
|
3267
|
+
ro as L,
|
|
3268
|
+
pr as M,
|
|
3269
3269
|
Et as N,
|
|
3270
|
-
|
|
3271
|
-
|
|
3270
|
+
ls as O,
|
|
3271
|
+
ui as P,
|
|
3272
3272
|
$e as a,
|
|
3273
|
-
|
|
3274
|
-
|
|
3275
|
-
|
|
3276
|
-
|
|
3277
|
-
|
|
3278
|
-
|
|
3273
|
+
ai as b,
|
|
3274
|
+
Fl as c,
|
|
3275
|
+
kr as d,
|
|
3276
|
+
Sr as e,
|
|
3277
|
+
Gr as f,
|
|
3278
|
+
Rr as g,
|
|
3279
3279
|
ae as h,
|
|
3280
|
-
|
|
3281
|
-
|
|
3280
|
+
Yr as i,
|
|
3281
|
+
Nr as j,
|
|
3282
3282
|
on as k,
|
|
3283
|
-
|
|
3283
|
+
Jr as l,
|
|
3284
3284
|
ye as m,
|
|
3285
|
-
|
|
3285
|
+
rs as n,
|
|
3286
3286
|
dn as o,
|
|
3287
|
-
|
|
3288
|
-
|
|
3289
|
-
|
|
3290
|
-
|
|
3291
|
-
|
|
3287
|
+
ns as p,
|
|
3288
|
+
_l as q,
|
|
3289
|
+
eo as r,
|
|
3290
|
+
Xl as s,
|
|
3291
|
+
Qr as t,
|
|
3292
3292
|
D as u,
|
|
3293
|
-
|
|
3293
|
+
Kr as v,
|
|
3294
3294
|
nt as w,
|
|
3295
|
-
|
|
3295
|
+
hi as x,
|
|
3296
3296
|
Ae as y,
|
|
3297
|
-
|
|
3297
|
+
ur as z
|
|
3298
3298
|
};
|