@aiquants/markdown-explorer 0.13.0 → 0.14.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 +12 -0
- package/README.md +1 -0
- package/dist/{EditSurface-omuATGni.cjs → EditSurface-BLlu5zEt.cjs} +1 -1
- package/dist/{EditSurface-DheIbHJi.js → EditSurface-CF2io496.js} +1 -1
- package/dist/{ExplorerSplit-DvcNMIjl.js → ExplorerSplit-BPLECNpv.js} +1 -1
- package/dist/{ExplorerSplit-DMizcKaY.cjs → ExplorerSplit-Cjvy0JHP.cjs} +1 -1
- package/dist/{MultiLayout-Cq4y1I1g.cjs → MultiLayout-BjA0k-5n.cjs} +1 -1
- package/dist/{MultiLayout-C2R85L4x.js → MultiLayout-D8F0BfxA.js} +2 -2
- package/dist/{NativeScrollBar-CKfD2qpM.js → NativeScrollBar-BFF12oEd.js} +1 -1
- package/dist/{NativeScrollBar-qvtXkNTx.cjs → NativeScrollBar-BUWXPvTV.cjs} +1 -1
- package/dist/{TreeLayout-8_V4L9s6.cjs → TreeLayout-CQUpgsxz.cjs} +1 -1
- package/dist/{TreeLayout-FCp9WPFO.js → TreeLayout-rhyVTfrI.js} +2 -2
- package/dist/core/revalidation.d.cts +1 -2
- package/dist/core/revalidation.d.ts +1 -2
- package/dist/{index-afZWk187.cjs → index-Dn7cYy-4.cjs} +6 -6
- package/dist/{index-CdydPdP7.js → index-v997iKxe.js} +343 -342
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/{merge-Dm_uFthw.cjs → merge-BFk7nT59.cjs} +1 -1
- package/dist/{merge-Bb7YRgn4.js → merge-Bi2VedIr.js} +1 -1
- package/package.json +6 -5
|
@@ -8,13 +8,14 @@ import { HostedScrollArea as gt, useMarkdownToolbarState as sr, MarkdownViewer a
|
|
|
8
8
|
import { SOURCE_LINES_ATTRIBUTE as Jt, parseSourceLines as cr } from "@aiquants/markdown/source-lines";
|
|
9
9
|
import { DEFAULT_CONTENT_ALIGN as dr } from "@aiquants/markdown/viewer-settings";
|
|
10
10
|
import { w as Qt, r as en, a as ur, b as bt, s as Ve, c as fr } from "./storage-BSthKLSG.js";
|
|
11
|
-
|
|
11
|
+
import { createShouldRevalidate as mr } from "@aiquants/route-revalidation";
|
|
12
|
+
const Et = Object.freeze(["en", "ja"]), hr = "en", pr = Object.freeze({
|
|
12
13
|
panelMoved: Object.freeze(["title", "column", "position"]),
|
|
13
14
|
panelMoveUnavailable: Object.freeze(["title", "move"]),
|
|
14
15
|
panelDragStarted: Object.freeze(["title"]),
|
|
15
16
|
panelDragCancelled: Object.freeze(["title"]),
|
|
16
17
|
multiColumnRegion: Object.freeze(["column"])
|
|
17
|
-
}),
|
|
18
|
+
}), vr = /\{(\w+)\}/gu, tn = {
|
|
18
19
|
explorerRegion: "Explorer",
|
|
19
20
|
sourceLabel: "Source",
|
|
20
21
|
refreshTreeLabel: "Refresh tree",
|
|
@@ -257,7 +258,7 @@ const Et = Object.freeze(["en", "ja"]), mr = "en", hr = Object.freeze({
|
|
|
257
258
|
multiColumnEmpty: "This column is empty",
|
|
258
259
|
multiColumnRegion: "Column {column}",
|
|
259
260
|
panelDropHere: "Drop the panel here"
|
|
260
|
-
},
|
|
261
|
+
}, wr = {
|
|
261
262
|
explorerRegion: "エクスプローラー",
|
|
262
263
|
sourceLabel: "ソース",
|
|
263
264
|
refreshTreeLabel: "ツリーを更新",
|
|
@@ -500,15 +501,15 @@ const Et = Object.freeze(["en", "ja"]), mr = "en", hr = Object.freeze({
|
|
|
500
501
|
multiColumnEmpty: "この列は空です",
|
|
501
502
|
multiColumnRegion: "{column} 列目",
|
|
502
503
|
panelDropHere: "ここへパネルをドロップ"
|
|
503
|
-
},
|
|
504
|
+
}, gr = Object.freeze({
|
|
504
505
|
en: Object.freeze(tn),
|
|
505
|
-
ja: Object.freeze(
|
|
506
|
-
}), nn = Object.freeze(Object.keys(tn)),
|
|
507
|
-
if (e === void 0) return
|
|
506
|
+
ja: Object.freeze(wr)
|
|
507
|
+
}), nn = Object.freeze(Object.keys(tn)), br = new Set(nn), Er = (e) => br.has(e), Ce = (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, rn = (e) => {
|
|
508
|
+
if (e === void 0) return hr;
|
|
508
509
|
if (Et.includes(e)) return e;
|
|
509
510
|
throw new RangeError(`[markdown-explorer] locale is the UI language (${Et.map((t) => JSON.stringify(t)).join(" or ")}), not a BCP 47 tag; got ${Ce(e)}`);
|
|
510
511
|
}, yt = (e, t) => {
|
|
511
|
-
const n =
|
|
512
|
+
const n = gr[rn(e)];
|
|
512
513
|
if (t === void 0) return n;
|
|
513
514
|
if (t === null || typeof t != "object")
|
|
514
515
|
throw new RangeError(`[markdown-explorer] labels must be an object; got ${Ce(t)}`);
|
|
@@ -516,7 +517,7 @@ const Et = Object.freeze(["en", "ja"]), mr = "en", hr = Object.freeze({
|
|
|
516
517
|
throw new RangeError(`[markdown-explorer] labels must be a plain object; got ${Ce(t)}`);
|
|
517
518
|
const r = t, o = { ...n };
|
|
518
519
|
for (const i of Object.keys(r)) {
|
|
519
|
-
if (!
|
|
520
|
+
if (!Er(i))
|
|
520
521
|
throw new RangeError(`[markdown-explorer] labels.${i} is not a known label key; expected one of ${nn.join(", ")}`);
|
|
521
522
|
const l = r[i];
|
|
522
523
|
if (l === void 0) continue;
|
|
@@ -525,21 +526,21 @@ const Et = Object.freeze(["en", "ja"]), mr = "en", hr = Object.freeze({
|
|
|
525
526
|
throw new TypeError(`[markdown-explorer] labels.${i} must be a ${d}; got ${Ce(l)}`);
|
|
526
527
|
if (typeof l == "string" && l.trim() === "")
|
|
527
528
|
throw new RangeError(`[markdown-explorer] labels.${i} must be a non-blank string`);
|
|
528
|
-
const p =
|
|
529
|
+
const p = pr[i];
|
|
529
530
|
if (typeof l == "string" && p !== void 0) {
|
|
530
|
-
for (const [, f] of l.matchAll(
|
|
531
|
+
for (const [, f] of l.matchAll(vr))
|
|
531
532
|
if (!p.includes(f ?? ""))
|
|
532
533
|
throw new RangeError(`[markdown-explorer] labels.${i} uses the unknown placeholder {${String(f)}}; it accepts ${p.map((u) => `{${u}}`).join(", ")}`);
|
|
533
534
|
}
|
|
534
535
|
o[i] = l;
|
|
535
536
|
}
|
|
536
537
|
return Object.freeze(o);
|
|
537
|
-
},
|
|
538
|
+
}, yr = (e, t) => {
|
|
538
539
|
if (Object.is(e, t)) return !0;
|
|
539
540
|
if (e === null || t === null || typeof e != "object" || typeof t != "object") return !1;
|
|
540
541
|
const n = e, r = t, o = Object.keys(n), i = Object.keys(r);
|
|
541
542
|
return o.length === i.length && i.every((l) => Object.hasOwn(n, l) && Object.is(n[l], r[l]));
|
|
542
|
-
}, kt = Object.freeze(["light", "dark"]),
|
|
543
|
+
}, kt = Object.freeze(["light", "dark"]), kr = (e) => {
|
|
543
544
|
if (e === void 0) return "light";
|
|
544
545
|
if (kt.includes(e)) return e;
|
|
545
546
|
throw new RangeError(`[markdown-explorer] theme must be ${kt.map((t) => JSON.stringify(t)).join(" or ")}; got ${typeof e == "string" ? JSON.stringify(e) : typeof e}`);
|
|
@@ -569,7 +570,7 @@ const Et = Object.freeze(["en", "ja"]), mr = "en", hr = Object.freeze({
|
|
|
569
570
|
/* @__PURE__ */ c("p", { className: "aqmx-callout-body", children: l }),
|
|
570
571
|
e.reason === "unauthorized" ? /* @__PURE__ */ c("button", { type: "button", className: "aqmx-callout-action", onClick: () => window.location.reload(), children: o.reloadPage }) : n !== void 0 && e.reason === "failed" ? /* @__PURE__ */ c("button", { type: "button", className: "aqmx-callout-action", onClick: n, children: o.retry }) : null
|
|
571
572
|
] });
|
|
572
|
-
},
|
|
573
|
+
}, xr = (e, t) => {
|
|
573
574
|
const { phase: n, save: r, dirty: o } = t;
|
|
574
575
|
switch (n.kind) {
|
|
575
576
|
case "opening":
|
|
@@ -595,7 +596,7 @@ const Et = Object.freeze(["en", "ja"]), mr = "en", hr = Object.freeze({
|
|
|
595
596
|
break;
|
|
596
597
|
}
|
|
597
598
|
return o ? e.draftUnsaved : "";
|
|
598
|
-
},
|
|
599
|
+
}, Sr = (e, t, n) => {
|
|
599
600
|
switch (t.kind) {
|
|
600
601
|
case "draft":
|
|
601
602
|
return e.draftNotSaved;
|
|
@@ -621,24 +622,24 @@ const Et = Object.freeze(["en", "ja"]), mr = "en", hr = Object.freeze({
|
|
|
621
622
|
for (const t of [...e]) t();
|
|
622
623
|
}
|
|
623
624
|
};
|
|
624
|
-
},
|
|
625
|
-
`)),
|
|
625
|
+
}, Rr = "<<<<<<<", Tr = "=======", Cr = ">>>>>>>", xt = (e, t) => e === t || e.startsWith(`${t} `), St = (e) => Or(e.split(`
|
|
626
|
+
`)), Or = (e) => {
|
|
626
627
|
const t = [];
|
|
627
628
|
let n = null, r = null, o = 0;
|
|
628
629
|
for (const i of e) {
|
|
629
630
|
o += 1;
|
|
630
631
|
const l = i.charCodeAt(0);
|
|
631
|
-
l !== 60 && l !== 61 && l !== 62 || (xt(i,
|
|
632
|
+
l !== 60 && l !== 61 && l !== 62 || (xt(i, Rr) ? (n = o, r = null) : i === Tr ? n !== null && r === null ? r = o : n = null : xt(i, Cr) && (n !== null && r !== null && t.push({ start: n, separator: r, end: o }), n = null, r = null));
|
|
632
633
|
}
|
|
633
634
|
return t;
|
|
634
635
|
}, Rt = (e) => e.includes(`\r
|
|
635
636
|
`) ? `\r
|
|
636
637
|
` : `
|
|
637
638
|
`, ze = (e) => e.replace(/\r\n?/gu, `
|
|
638
|
-
`),
|
|
639
|
+
`), Ar = (e, t) => t === `
|
|
639
640
|
` ? e : e.replaceAll(`
|
|
640
641
|
`, `\r
|
|
641
|
-
`),
|
|
642
|
+
`), Lr = 3, Ue = Object.freeze({ kind: "idle" }), Tt = Object.freeze({ kind: "draft" }), Mr = ({ data: e, conflictLabels: t, onSaveSettled: n, sideBySideSetting: r }) => {
|
|
642
643
|
const o = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map(), d = /* @__PURE__ */ new Map(), p = /* @__PURE__ */ new Map(), f = ke();
|
|
643
644
|
let u = null, v = null;
|
|
644
645
|
const m = (a, s) => {
|
|
@@ -684,8 +685,8 @@ const Et = Object.freeze(["en", "ja"]), mr = "en", hr = Object.freeze({
|
|
|
684
685
|
const { signal: R } = s.controller;
|
|
685
686
|
let L = { text: s.base.text, version: h }, O = s.draft, N = !1;
|
|
686
687
|
m(s, { save: { kind: "saving" } });
|
|
687
|
-
for (let j = 0; j <
|
|
688
|
-
const I = await e.save(a, L.version,
|
|
688
|
+
for (let j = 0; j < Lr; j += 1) {
|
|
689
|
+
const I = await e.save(a, L.version, Ar(O, s.ending), R);
|
|
689
690
|
if (!y(a, s) || R.aborted || !("kind" in I)) return;
|
|
690
691
|
if (I.kind === "saved") {
|
|
691
692
|
d.get(a)?.flush(), s.base = { text: O, version: I.version }, M(a, s, { kind: "saved", merged: N }, { dirty: s.draft !== O });
|
|
@@ -699,7 +700,7 @@ const Et = Object.freeze(["en", "ja"]), mr = "en", hr = Object.freeze({
|
|
|
699
700
|
M(a, s, { kind: "failed", failure: I.failure });
|
|
700
701
|
return;
|
|
701
702
|
}
|
|
702
|
-
const { mergeDraft: X } = await import("./merge-
|
|
703
|
+
const { mergeDraft: X } = await import("./merge-Bi2VedIr.js");
|
|
703
704
|
if (!y(a, s) || R.aborted) return;
|
|
704
705
|
const Q = d.get(a);
|
|
705
706
|
Q?.flush();
|
|
@@ -856,7 +857,7 @@ const Et = Object.freeze(["en", "ja"]), mr = "en", hr = Object.freeze({
|
|
|
856
857
|
/* @__PURE__ */ c("button", { type: "button", className: "aqmx-callout-action", "data-aqmx-tone": "danger", "data-testid": `${d}-confirm`, onClick: i, children: r })
|
|
857
858
|
] })
|
|
858
859
|
] }) });
|
|
859
|
-
},
|
|
860
|
+
}, Nr = (e, t) => {
|
|
860
861
|
const n = Mn({ path: `${e.basePath}/*`, end: !0 }, t.pathname);
|
|
861
862
|
if (n === null) return /* @__PURE__ */ new Set();
|
|
862
863
|
const { location: r } = Xt(e, n.params["*"], new URLSearchParams(t.search));
|
|
@@ -870,22 +871,22 @@ const Et = Object.freeze(["en", "ja"]), mr = "en", hr = Object.freeze({
|
|
|
870
871
|
}
|
|
871
872
|
}, sn = (e) => {
|
|
872
873
|
const { edits: t } = D(), n = $(() => t.session(e), [t, e]);
|
|
873
|
-
return ee(t.subscribe, n,
|
|
874
|
-
}, cn = () => !1,
|
|
875
|
-
},
|
|
874
|
+
return ee(t.subscribe, n, Dr);
|
|
875
|
+
}, cn = () => !1, Dr = () => {
|
|
876
|
+
}, Pr = () => {
|
|
876
877
|
const { edits: e } = D();
|
|
877
878
|
return ee(e.subscribe, e.hasSessions, cn);
|
|
878
|
-
},
|
|
879
|
+
}, $r = () => {
|
|
879
880
|
const { edits: e } = D();
|
|
880
881
|
return ee(e.subscribe, e.sideBySide, cn);
|
|
881
|
-
},
|
|
882
|
+
}, Fr = () => null, qr = () => {
|
|
882
883
|
const { edits: e, labels: t, config: n } = D(), r = q([]), o = $(
|
|
883
884
|
({ nextLocation: m }) => {
|
|
884
|
-
const y =
|
|
885
|
+
const y = Nr(n, m);
|
|
885
886
|
return e.flushDrafts(), r.current = e.dirtyPaths().filter((A) => !y.has(A)), r.current.length > 0;
|
|
886
887
|
},
|
|
887
888
|
[e, n]
|
|
888
|
-
), i = Nn(o), l =
|
|
889
|
+
), i = Nn(o), l = Pr();
|
|
889
890
|
te(() => {
|
|
890
891
|
if (!l) return;
|
|
891
892
|
const m = (y) => {
|
|
@@ -893,7 +894,7 @@ const Et = Object.freeze(["en", "ja"]), mr = "en", hr = Object.freeze({
|
|
|
893
894
|
};
|
|
894
895
|
return window.addEventListener("beforeunload", m), () => window.removeEventListener("beforeunload", m);
|
|
895
896
|
}, [l, e]);
|
|
896
|
-
const d = ee(e.subscribe, e.discardRequest,
|
|
897
|
+
const d = ee(e.subscribe, e.discardRequest, Fr), p = i.state === "blocked", f = p ? r.current : d === null ? [] : d.paths, u = f.map((m) => ye(m)).join(", "), v = f.length > 0 && f.every((m) => e.session(m)?.save.kind === "draft");
|
|
897
898
|
return /* @__PURE__ */ c(
|
|
898
899
|
an,
|
|
899
900
|
{
|
|
@@ -920,7 +921,7 @@ const Et = Object.freeze(["en", "ja"]), mr = "en", hr = Object.freeze({
|
|
|
920
921
|
}
|
|
921
922
|
);
|
|
922
923
|
};
|
|
923
|
-
function
|
|
924
|
+
function _r({
|
|
924
925
|
title: e,
|
|
925
926
|
titleId: t,
|
|
926
927
|
...n
|
|
@@ -941,18 +942,18 @@ function qr({
|
|
|
941
942
|
clipRule: "evenodd"
|
|
942
943
|
}));
|
|
943
944
|
}
|
|
944
|
-
const
|
|
945
|
+
const Br = /* @__PURE__ */ b.forwardRef(_r);
|
|
945
946
|
let Ze = null;
|
|
946
|
-
const dn = () => (Ze ??= import("./EditSurface-
|
|
947
|
+
const dn = () => (Ze ??= import("./EditSurface-CF2io496.js").catch((e) => {
|
|
947
948
|
throw Ze = null, e;
|
|
948
|
-
}), Ze),
|
|
949
|
+
}), Ze), Ir = () => {
|
|
949
950
|
dn().catch(() => {
|
|
950
951
|
});
|
|
951
|
-
},
|
|
952
|
+
}, jr = (e) => {
|
|
952
953
|
const { default: t } = ne(dn());
|
|
953
954
|
return /* @__PURE__ */ c(t, { ...e });
|
|
954
955
|
};
|
|
955
|
-
class
|
|
956
|
+
class Hr extends Kt {
|
|
956
957
|
state = { failed: !1 };
|
|
957
958
|
static getDerivedStateFromError() {
|
|
958
959
|
return { failed: !0 };
|
|
@@ -962,7 +963,7 @@ class jr extends Kt {
|
|
|
962
963
|
return this.state.failed ? this.props.fallback(this.retry) : this.props.children;
|
|
963
964
|
}
|
|
964
965
|
}
|
|
965
|
-
const ot = `[${Jt}]`,
|
|
966
|
+
const ot = `[${Jt}]`, Vr = "[data-aqmd-content]", zr = 'a[href], button, input, select, textarea, summary, label, [contenteditable], [role="menu"], iframe, video, audio, object, embed, svg', Ur = 200, be = (e) => cr(e.getAttribute(Jt)), Zr = (e, t) => {
|
|
966
967
|
for (let r = e; r !== null && t.contains(r); r = r.parentElement) {
|
|
967
968
|
const o = be(r);
|
|
968
969
|
if (o !== null) return { block: r, lines: o, own: !0 };
|
|
@@ -974,43 +975,43 @@ const ot = `[${Jt}]`, Hr = "[data-aqmd-content]", Vr = 'a[href], button, input,
|
|
|
974
975
|
o !== null && (n = { block: r, lines: o });
|
|
975
976
|
}
|
|
976
977
|
return n === null ? null : { ...n, own: !1 };
|
|
977
|
-
},
|
|
978
|
+
}, Gr = (e, t) => {
|
|
978
979
|
let n = 0;
|
|
979
980
|
for (let r = e.indexOf(t); r >= 0; r = e.indexOf(t, r + t.length)) n += 1;
|
|
980
981
|
return n;
|
|
981
|
-
},
|
|
982
|
-
const r =
|
|
982
|
+
}, Kr = (e) => e.closest(Vr) !== null && e.closest(zr) === null, Wr = (e, t, n) => {
|
|
983
|
+
const r = Zr(e, t);
|
|
983
984
|
if (r === null) return null;
|
|
984
985
|
const { block: o, own: i } = r;
|
|
985
986
|
if (!i) {
|
|
986
987
|
const d = r.lines.last + 1;
|
|
987
988
|
return { lines: { first: d, last: d }, word: null, occurrence: 0, clientTop: Le(e) };
|
|
988
989
|
}
|
|
989
|
-
const l =
|
|
990
|
+
const l = Qr(o, n);
|
|
990
991
|
return l === null ? { lines: r.lines, word: null, occurrence: 0, clientTop: Le(o) } : { lines: r.lines, word: l.text, occurrence: l.occurrence, clientTop: l.clientTop };
|
|
991
|
-
},
|
|
992
|
+
}, Xr = (e, t) => {
|
|
992
993
|
let n = null, r = null, o = null;
|
|
993
994
|
for (const l of e.querySelectorAll(ot)) {
|
|
994
995
|
const d = be(l);
|
|
995
996
|
if (d === null) continue;
|
|
996
|
-
n ??=
|
|
997
|
+
n ??= Jr(t, l);
|
|
997
998
|
const { top: p, bottom: f } = l.getBoundingClientRect();
|
|
998
999
|
p <= n && n < f ? r = { lines: d, block: l } : o === null && p >= n && (o = { lines: d, block: l });
|
|
999
1000
|
}
|
|
1000
1001
|
const i = r === null ? o : r;
|
|
1001
1002
|
return i === null ? null : { lines: i.lines, word: null, occurrence: 0, clientTop: Le(i.block) };
|
|
1002
|
-
},
|
|
1003
|
+
}, Yr = (e) => e === e.ownerDocument.scrollingElement ? 0 : e.getBoundingClientRect().top + e.clientTop, Jr = (e, t) => {
|
|
1003
1004
|
const n = Number.parseFloat(getComputedStyle(t).scrollMarginTop);
|
|
1004
|
-
return
|
|
1005
|
-
},
|
|
1005
|
+
return Yr(e) + (Number.isFinite(n) ? n : 0);
|
|
1006
|
+
}, Qr = (e, t) => {
|
|
1006
1007
|
if (t === null || t.rangeCount === 0) return null;
|
|
1007
1008
|
const n = t.getRangeAt(0);
|
|
1008
1009
|
if (!(e.contains(n.startContainer) && e.contains(n.endContainer))) return null;
|
|
1009
1010
|
const r = n.toString().trim();
|
|
1010
|
-
if (r === "" || r.length >
|
|
1011
|
+
if (r === "" || r.length > Ur || /[\r\n]/u.test(r)) return null;
|
|
1011
1012
|
const o = e.ownerDocument.createRange();
|
|
1012
|
-
return o.setStart(e, 0), o.setEnd(n.startContainer, n.startOffset), { text: r, occurrence:
|
|
1013
|
-
},
|
|
1013
|
+
return o.setStart(e, 0), o.setEnd(n.startContainer, n.startOffset), { text: r, occurrence: Gr(o.toString(), r), clientTop: n.getBoundingClientRect().top };
|
|
1014
|
+
}, ba = (e, t) => {
|
|
1014
1015
|
const n = e.split(`
|
|
1015
1016
|
`), r = Math.min(t.lines.first, n.length), o = Math.min(t.lines.last, n.length), i = { line: r, column: 0 };
|
|
1016
1017
|
if (t.word === null) return i;
|
|
@@ -1022,21 +1023,21 @@ const ot = `[${Jt}]`, Hr = "[data-aqmd-content]", Vr = 'a[href], button, input,
|
|
|
1022
1023
|
l += 1;
|
|
1023
1024
|
}
|
|
1024
1025
|
}
|
|
1025
|
-
return l > 0 ?
|
|
1026
|
-
},
|
|
1026
|
+
return l > 0 ? eo(n, r, o, t.word) ?? i : i;
|
|
1027
|
+
}, eo = (e, t, n, r) => {
|
|
1027
1028
|
for (let o = n; o >= t; o -= 1) {
|
|
1028
1029
|
const i = (e[o - 1] ?? "").lastIndexOf(r);
|
|
1029
1030
|
if (i >= 0) return { line: o, column: i };
|
|
1030
1031
|
}
|
|
1031
1032
|
return null;
|
|
1032
|
-
},
|
|
1033
|
+
}, to = (e, t) => {
|
|
1033
1034
|
let n = null, r = null;
|
|
1034
1035
|
for (const o of e.querySelectorAll(ot)) {
|
|
1035
1036
|
const i = be(o);
|
|
1036
1037
|
i === null || i.first > t || (i.last >= t ? n = o : (r === null || i.last >= r.last) && (r = { element: o, last: i.last }));
|
|
1037
1038
|
}
|
|
1038
1039
|
return n !== null ? n : r === null ? null : r.element;
|
|
1039
|
-
},
|
|
1040
|
+
}, no = (e, t) => {
|
|
1040
1041
|
const { bottom: n } = e.getBoundingClientRect(), r = Le(e), o = be(e);
|
|
1041
1042
|
if (o === null) return r;
|
|
1042
1043
|
const i = Math.min(Math.max(t - o.first, 0) / (o.last - o.first + 1), 1);
|
|
@@ -1057,7 +1058,7 @@ const ot = `[${Jt}]`, Hr = "[data-aqmd-content]", Vr = 'a[href], button, input,
|
|
|
1057
1058
|
"switch-source": Object.freeze({ replace: !1, preventScrollReset: !0, defaultShouldRevalidate: !1 }),
|
|
1058
1059
|
"switch-view": Object.freeze({ replace: !1, preventScrollReset: !1, defaultShouldRevalidate: !1 }),
|
|
1059
1060
|
"follow-link": Object.freeze({ replace: !1, preventScrollReset: !1, defaultShouldRevalidate: !1 })
|
|
1060
|
-
}),
|
|
1061
|
+
}), Ea = (e) => it[e], Pe = () => {
|
|
1061
1062
|
const e = Dn();
|
|
1062
1063
|
return $(
|
|
1063
1064
|
(t, n) => {
|
|
@@ -1065,7 +1066,7 @@ const ot = `[${Jt}]`, Hr = "[data-aqmd-content]", Vr = 'a[href], button, input,
|
|
|
1065
1066
|
},
|
|
1066
1067
|
[e]
|
|
1067
1068
|
);
|
|
1068
|
-
},
|
|
1069
|
+
}, ro = ({ navigation: e, ...t }) => /* @__PURE__ */ c(Pn, { ...t, ...it[e] }), un = (e) => {
|
|
1069
1070
|
const t = e.ownerDocument;
|
|
1070
1071
|
if (e.focus({ preventScroll: !0 }), t.activeElement === e) return !0;
|
|
1071
1072
|
if (e.hasAttribute("tabindex")) return !1;
|
|
@@ -1075,7 +1076,7 @@ const ot = `[${Jt}]`, Hr = "[data-aqmd-content]", Vr = 'a[href], button, input,
|
|
|
1075
1076
|
t.activeElement !== e && (e.removeAttribute("tabindex"), e.removeEventListener("blur", n));
|
|
1076
1077
|
};
|
|
1077
1078
|
return e.addEventListener("blur", n), !0;
|
|
1078
|
-
},
|
|
1079
|
+
}, oo = (e, t) => {
|
|
1079
1080
|
const n = q(null), r = q(null), o = q(null), i = $(() => {
|
|
1080
1081
|
n.current !== null && window.clearTimeout(n.current), n.current = null, r.current = null;
|
|
1081
1082
|
}, []);
|
|
@@ -1120,8 +1121,8 @@ const ot = `[${Jt}]`, Hr = "[data-aqmd-content]", Vr = 'a[href], button, input,
|
|
|
1120
1121
|
}),
|
|
1121
1122
|
[d, p]
|
|
1122
1123
|
);
|
|
1123
|
-
},
|
|
1124
|
-
class
|
|
1124
|
+
}, io = tt(() => import("./NativeScrollBar-BFF12oEd.js").then((e) => ({ default: e.NativeScrollBar })));
|
|
1125
|
+
class lo extends Kt {
|
|
1125
1126
|
state = { failed: !1 };
|
|
1126
1127
|
static getDerivedStateFromError() {
|
|
1127
1128
|
return { failed: !0 };
|
|
@@ -1133,7 +1134,7 @@ class io extends Kt {
|
|
|
1133
1134
|
return this.state.failed ? null : this.props.children;
|
|
1134
1135
|
}
|
|
1135
1136
|
}
|
|
1136
|
-
const
|
|
1137
|
+
const ao = ({ scroller: e, withCircle: t }) => /* @__PURE__ */ c(lo, { children: /* @__PURE__ */ c(we, { fallback: null, children: /* @__PURE__ */ c(io, { scroller: e, withCircle: t }) }) }), fn = (e) => /* @__PURE__ */ c(ao, { scroller: e, withCircle: !0 }), mn = () => {
|
|
1137
1138
|
const e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Set();
|
|
1138
1139
|
let n = !1;
|
|
1139
1140
|
const r = (o) => {
|
|
@@ -1177,7 +1178,7 @@ const lo = ({ scroller: e, withCircle: t }) => /* @__PURE__ */ c(io, { children:
|
|
|
1177
1178
|
t.status = "rejected", t.reason = n;
|
|
1178
1179
|
}
|
|
1179
1180
|
)), t;
|
|
1180
|
-
}, hn = (e) => Object.assign(Promise.resolve(e), { status: "fulfilled", value: e }), Re = (e) => e.status === "fulfilled" ? e.value : void 0,
|
|
1181
|
+
}, hn = (e) => Object.assign(Promise.resolve(e), { status: "fulfilled", value: e }), Re = (e) => e.status === "fulfilled" ? e.value : void 0, so = 55e3, Ct = Object.freeze({ status: "deferred" }), Ot = Object.freeze({ status: "refreshed" }), Ge = Object.freeze({ status: "superseded" }), de = (e) => e === void 0 || e.status === "deferred" ? null : e.status === "loaded" ? e : e.previous, pn = (e) => e !== void 0 && e.status === "loaded" && e.document.kind !== "failure", co = ({ client: e, capacity: t }) => {
|
|
1181
1182
|
if (!Number.isInteger(t) || t < 1) throw new RangeError(`[markdown-explorer] the document cache capacity must be a positive integer; got ${String(t)}`);
|
|
1182
1183
|
const n = /* @__PURE__ */ new Map(), r = mn(), o = ke(), i = /* @__PURE__ */ new WeakSet();
|
|
1183
1184
|
let l = 0;
|
|
@@ -1189,7 +1190,7 @@ const lo = ({ scroller: e, withCircle: t }) => /* @__PURE__ */ c(io, { children:
|
|
|
1189
1190
|
}
|
|
1190
1191
|
}, u = (a, s) => {
|
|
1191
1192
|
n.delete(a), n.set(a, s);
|
|
1192
|
-
}, v = (a) => performance.now() - a.validatedAt >=
|
|
1193
|
+
}, v = (a) => performance.now() - a.validatedAt >= so, m = (a, s, h) => {
|
|
1193
1194
|
const g = n.get(a), R = de(g?.snapshot), L = h || g?.refreshPending === !0, O = Ee(e.document(a, { refresh: L }).then((j) => ({ status: "loaded", document: j }))), N = { snapshot: { status: "pending", promise: O, previous: R }, validatedAt: performance.now(), opened: s, background: null, refreshPending: !1, seeded: void 0, stamp: p() };
|
|
1194
1195
|
return u(a, N), f(), O.then((j) => {
|
|
1195
1196
|
n.get(a) === N && (N.snapshot = j, N.stamp = p(), d());
|
|
@@ -1296,7 +1297,7 @@ const lo = ({ scroller: e, withCircle: t }) => /* @__PURE__ */ c(io, { children:
|
|
|
1296
1297
|
noteFailureShown: (a) => i.has(a) ? !1 : (i.add(a), !0)
|
|
1297
1298
|
};
|
|
1298
1299
|
};
|
|
1299
|
-
function
|
|
1300
|
+
function uo({
|
|
1300
1301
|
title: e,
|
|
1301
1302
|
titleId: t,
|
|
1302
1303
|
...n
|
|
@@ -1321,8 +1322,8 @@ function co({
|
|
|
1321
1322
|
clipRule: "evenodd"
|
|
1322
1323
|
}));
|
|
1323
1324
|
}
|
|
1324
|
-
const
|
|
1325
|
-
function
|
|
1325
|
+
const fo = /* @__PURE__ */ b.forwardRef(uo);
|
|
1326
|
+
function mo({
|
|
1326
1327
|
title: e,
|
|
1327
1328
|
titleId: t,
|
|
1328
1329
|
...n
|
|
@@ -1345,8 +1346,8 @@ function fo({
|
|
|
1345
1346
|
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"
|
|
1346
1347
|
}));
|
|
1347
1348
|
}
|
|
1348
|
-
const
|
|
1349
|
-
function
|
|
1349
|
+
const ho = /* @__PURE__ */ b.forwardRef(mo);
|
|
1350
|
+
function po({
|
|
1350
1351
|
title: e,
|
|
1351
1352
|
titleId: t,
|
|
1352
1353
|
...n
|
|
@@ -1367,29 +1368,29 @@ function ho({
|
|
|
1367
1368
|
clipRule: "evenodd"
|
|
1368
1369
|
}));
|
|
1369
1370
|
}
|
|
1370
|
-
const
|
|
1371
|
+
const vo = /* @__PURE__ */ b.forwardRef(po), wo = 2e3, At = Object.freeze({ outcome: "idle" }), go = (e) => {
|
|
1371
1372
|
const t = navigator.clipboard;
|
|
1372
1373
|
return t === void 0 ? Promise.reject(new Error("[markdown-explorer] this browser has no asynchronous clipboard")) : t.writeText(e);
|
|
1373
|
-
},
|
|
1374
|
+
}, bo = ({ text: e }) => {
|
|
1374
1375
|
const { announcer: t, labels: n } = D(), [r, o] = B(At);
|
|
1375
1376
|
te(() => {
|
|
1376
1377
|
if (r.outcome === "idle") return;
|
|
1377
|
-
const p = setTimeout(() => o(At),
|
|
1378
|
+
const p = setTimeout(() => o(At), wo);
|
|
1378
1379
|
return () => clearTimeout(p);
|
|
1379
1380
|
}, [r]);
|
|
1380
1381
|
const i = (p) => {
|
|
1381
1382
|
o({ outcome: p }), t.announce(p === "copied" ? n.copiedText : n.copyTextFailed);
|
|
1382
1383
|
}, l = () => {
|
|
1383
|
-
|
|
1384
|
+
go(e).then(
|
|
1384
1385
|
() => i("copied"),
|
|
1385
1386
|
() => i("failed")
|
|
1386
1387
|
);
|
|
1387
1388
|
}, d = r.outcome === "copied" ? n.copiedText : r.outcome === "failed" ? n.copyTextFailed : n.copyText;
|
|
1388
1389
|
return (
|
|
1389
|
-
/* @__PURE__ */ c("button", { type: "button", className: "aqmx-icon-button", "aria-label": n.copyText, title: d, onClick: l, "data-aqmx-copy-outcome": r.outcome, "data-testid": "markdown-explorer-file-copy", children: r.outcome === "copied" ? /* @__PURE__ */ c(
|
|
1390
|
+
/* @__PURE__ */ c("button", { type: "button", className: "aqmx-icon-button", "aria-label": n.copyText, title: d, onClick: l, "data-aqmx-copy-outcome": r.outcome, "data-testid": "markdown-explorer-file-copy", children: r.outcome === "copied" ? /* @__PURE__ */ c(fo, {}) : r.outcome === "failed" ? /* @__PURE__ */ c(vo, {}) : /* @__PURE__ */ c(ho, {}) })
|
|
1390
1391
|
);
|
|
1391
|
-
}, fe = me("fill"),
|
|
1392
|
-
function
|
|
1392
|
+
}, fe = me("fill"), Eo = Object.freeze({ blockSize: "100%" }), xe = ({ scrollerProps: e, children: t }) => ne(fe) === "content" ? /* @__PURE__ */ c(gt, { scrollerProps: e, children: t }) : /* @__PURE__ */ c(gt, { scrollerProps: { ...e, style: Eo }, rowClassName: "aqmx-document-scroll-row", renderScrollBar: fn, children: t });
|
|
1393
|
+
function yo({
|
|
1393
1394
|
title: e,
|
|
1394
1395
|
titleId: t,
|
|
1395
1396
|
...n
|
|
@@ -1410,8 +1411,8 @@ function Eo({
|
|
|
1410
1411
|
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"
|
|
1411
1412
|
}));
|
|
1412
1413
|
}
|
|
1413
|
-
const
|
|
1414
|
-
function
|
|
1414
|
+
const ko = /* @__PURE__ */ b.forwardRef(yo);
|
|
1415
|
+
function xo({
|
|
1415
1416
|
title: e,
|
|
1416
1417
|
titleId: t,
|
|
1417
1418
|
...n
|
|
@@ -1436,17 +1437,17 @@ function ko({
|
|
|
1436
1437
|
clipRule: "evenodd"
|
|
1437
1438
|
}));
|
|
1438
1439
|
}
|
|
1439
|
-
const
|
|
1440
|
+
const So = /* @__PURE__ */ b.forwardRef(xo), $e = ({ name: e, openUrl: t, downloadUrl: n, icon: r, children: o }) => {
|
|
1440
1441
|
const { labels: i } = D();
|
|
1441
1442
|
return /* @__PURE__ */ F("div", { className: "aqmx-document-toolbar", children: [
|
|
1442
1443
|
/* @__PURE__ */ c("span", { className: "aqmx-document-file-icon", "aria-hidden": "true", children: r }),
|
|
1443
1444
|
/* @__PURE__ */ c("span", { className: "aqmx-document-title", title: e, "data-testid": "markdown-explorer-file-name", children: e }),
|
|
1444
1445
|
o,
|
|
1445
|
-
/* @__PURE__ */ c("a", { className: "aqmx-icon-button", href: t, target: "_blank", rel: "noopener noreferrer", "aria-label": i.openInNewTab, title: i.openInNewTab, "data-testid": "markdown-explorer-file-open", children: /* @__PURE__ */ c(
|
|
1446
|
-
/* @__PURE__ */ c("a", { className: "aqmx-icon-button", href: n, download: e, "aria-label": i.download, title: i.download, "data-testid": "markdown-explorer-file-download", children: /* @__PURE__ */ c(
|
|
1446
|
+
/* @__PURE__ */ c("a", { className: "aqmx-icon-button", href: t, target: "_blank", rel: "noopener noreferrer", "aria-label": i.openInNewTab, title: i.openInNewTab, "data-testid": "markdown-explorer-file-open", children: /* @__PURE__ */ c(So, {}) }),
|
|
1447
|
+
/* @__PURE__ */ c("a", { className: "aqmx-icon-button", href: n, download: e, "aria-label": i.download, title: i.download, "data-testid": "markdown-explorer-file-download", children: /* @__PURE__ */ c(ko, {}) })
|
|
1447
1448
|
] });
|
|
1448
1449
|
};
|
|
1449
|
-
function
|
|
1450
|
+
function Ro({
|
|
1450
1451
|
title: e,
|
|
1451
1452
|
titleId: t,
|
|
1452
1453
|
...n
|
|
@@ -1467,23 +1468,23 @@ function So({
|
|
|
1467
1468
|
clipRule: "evenodd"
|
|
1468
1469
|
}));
|
|
1469
1470
|
}
|
|
1470
|
-
const
|
|
1471
|
+
const To = /* @__PURE__ */ b.forwardRef(Ro), Co = Object.freeze({ className: "aqmx-document-stage" }), Oo = ({ document: e }) => {
|
|
1471
1472
|
const { labels: t } = D();
|
|
1472
1473
|
return /* @__PURE__ */ F("div", { className: "aqmx-document-file", "data-testid": "markdown-explorer-file-view", children: [
|
|
1473
|
-
/* @__PURE__ */ c($e, { name: e.name, openUrl: e.url, downloadUrl: e.url, icon: /* @__PURE__ */ c(
|
|
1474
|
-
/* @__PURE__ */ c(xe, { scrollerProps:
|
|
1474
|
+
/* @__PURE__ */ c($e, { name: e.name, openUrl: e.url, downloadUrl: e.url, icon: /* @__PURE__ */ c(To, {}) }),
|
|
1475
|
+
/* @__PURE__ */ c(xe, { scrollerProps: Co, children: /* @__PURE__ */ F("div", { className: "aqmx-callout", role: "note", "data-testid": "markdown-explorer-file-not-shown", children: [
|
|
1475
1476
|
/* @__PURE__ */ c("p", { className: "aqmx-callout-body", children: t.fileNotShown }),
|
|
1476
1477
|
/* @__PURE__ */ c("a", { className: "aqmx-callout-action", href: e.url, download: e.name, "data-testid": "markdown-explorer-file-not-shown-download", children: t.download })
|
|
1477
1478
|
] }) })
|
|
1478
1479
|
] });
|
|
1479
|
-
}, Fe = "[data-aqmd-scroll-container], [data-aqmx-document-scroller]",
|
|
1480
|
+
}, Fe = "[data-aqmd-scroll-container], [data-aqmx-document-scroller]", Ao = (e) => {
|
|
1480
1481
|
const t = e.indexOf("#");
|
|
1481
1482
|
return t === -1 ? "" : e.slice(t);
|
|
1482
|
-
},
|
|
1483
|
+
}, Lo = /(%[0-9A-Fa-f]{2})/u, lt = (e) => {
|
|
1483
1484
|
if (!e.startsWith("#") || e.length === 1) return null;
|
|
1484
|
-
const t = new TextEncoder(), n = e.slice(1).split(
|
|
1485
|
+
const t = new TextEncoder(), n = e.slice(1).split(Lo).flatMap((r, o) => o % 2 === 1 ? [Number.parseInt(r.slice(1), 16)] : [...t.encode(r)]);
|
|
1485
1486
|
return new TextDecoder("utf-8", { ignoreBOM: !0 }).decode(Uint8Array.from(n));
|
|
1486
|
-
}, vn = (e) => `#${encodeURIComponent(e)}`,
|
|
1487
|
+
}, vn = (e) => `#${encodeURIComponent(e)}`, Mo = (e) => {
|
|
1487
1488
|
if (e === "#") return !0;
|
|
1488
1489
|
const t = lt(e);
|
|
1489
1490
|
return t !== null && t.replace(/[A-Z]/gu, (n) => n.toLowerCase()) === "top";
|
|
@@ -1492,12 +1493,12 @@ const Ro = /* @__PURE__ */ b.forwardRef(So), To = Object.freeze({ className: "aq
|
|
|
1492
1493
|
for (const n of e.querySelectorAll("[id]"))
|
|
1493
1494
|
if (n.id === t) return n;
|
|
1494
1495
|
return null;
|
|
1495
|
-
},
|
|
1496
|
+
}, No = "http://www.w3.org/1999/xhtml", Lt = (e, t) => {
|
|
1496
1497
|
if (t === "") return null;
|
|
1497
1498
|
const n = wn(e, t);
|
|
1498
1499
|
if (n !== null) return n;
|
|
1499
1500
|
for (const r of e.querySelectorAll("a[name]"))
|
|
1500
|
-
if (r.localName === "a" && r.namespaceURI ===
|
|
1501
|
+
if (r.localName === "a" && r.namespaceURI === No && r.getAttribute("name") === t) return r;
|
|
1501
1502
|
return null;
|
|
1502
1503
|
}, gn = (e, t) => {
|
|
1503
1504
|
if (e === null || !t.startsWith("#")) return null;
|
|
@@ -1513,22 +1514,22 @@ const Ro = /* @__PURE__ */ b.forwardRef(So), To = Object.freeze({ className: "aq
|
|
|
1513
1514
|
}
|
|
1514
1515
|
const { overflowY: r } = getComputedStyle(e);
|
|
1515
1516
|
return r === "auto" || r === "scroll";
|
|
1516
|
-
},
|
|
1517
|
+
}, Do = (e) => {
|
|
1517
1518
|
const { body: t, documentElement: n } = e, r = getComputedStyle(n), o = r.overflowX === "visible" && r.overflowY === "visible" && t !== null ? getComputedStyle(t).overflowY : r.overflowY;
|
|
1518
1519
|
return o !== "hidden" && o !== "clip";
|
|
1519
|
-
},
|
|
1520
|
+
}, Po = (e, t) => {
|
|
1520
1521
|
const n = t.closest(Fe), r = n !== null && e.contains(n) ? n : e;
|
|
1521
1522
|
if (r.scrollHeight > r.clientHeight && Mt(r)) return r;
|
|
1522
1523
|
const o = e.getBoundingClientRect().height, { documentElement: i, scrollingElement: l } = e.ownerDocument;
|
|
1523
1524
|
for (let d = e.parentElement; d !== null && d !== i; d = d.parentElement)
|
|
1524
1525
|
if (Mt(d) && d.scrollHeight > d.clientHeight && d.clientHeight < o) return d;
|
|
1525
|
-
return l instanceof Element &&
|
|
1526
|
-
},
|
|
1527
|
-
scrollerOf:
|
|
1526
|
+
return l instanceof Element && Do(e.ownerDocument) && l.scrollHeight > l.clientHeight && l.clientHeight < o ? l : r;
|
|
1527
|
+
}, $o = Object.freeze({
|
|
1528
|
+
scrollerOf: Po,
|
|
1528
1529
|
reveal: (e) => {
|
|
1529
1530
|
e.scrollIntoView(Ye);
|
|
1530
1531
|
}
|
|
1531
|
-
}), Ye = Object.freeze({ block: "nearest", inline: "nearest", behavior: "instant" }),
|
|
1532
|
+
}), Ye = Object.freeze({ block: "nearest", inline: "nearest", behavior: "instant" }), Fo = (e, t) => {
|
|
1532
1533
|
for (let n = t; n !== null && n !== e; n = n.parentElement) {
|
|
1533
1534
|
const r = n.parentElement;
|
|
1534
1535
|
if (r instanceof HTMLDetailsElement && n !== r.querySelector(":scope > summary") && (r.open = !0), n.getAttribute("hidden")?.toLowerCase() === "until-found") {
|
|
@@ -1536,7 +1537,7 @@ const Ro = /* @__PURE__ */ b.forwardRef(So), To = Object.freeze({ className: "aq
|
|
|
1536
1537
|
n.removeAttribute("hidden");
|
|
1537
1538
|
}
|
|
1538
1539
|
}
|
|
1539
|
-
},
|
|
1540
|
+
}, qo = (e, t) => {
|
|
1540
1541
|
if (t.getClientRects().length === 0) return;
|
|
1541
1542
|
const n = e === e.ownerDocument.scrollingElement ? 0 : e.getBoundingClientRect().top + e.clientTop, { scrollMarginTop: r, scrollMarginBottom: o } = getComputedStyle(t), i = Number.parseFloat(r), l = t.getBoundingClientRect(), d = l.height + i + Number.parseFloat(o) > e.clientHeight;
|
|
1542
1543
|
if (!d && Math.abs(l.top - i - n) < 1) {
|
|
@@ -1544,15 +1545,15 @@ const Ro = /* @__PURE__ */ b.forwardRef(So), To = Object.freeze({ className: "aq
|
|
|
1544
1545
|
return;
|
|
1545
1546
|
}
|
|
1546
1547
|
e.scrollBy({ top: d ? l.top - n - e.clientHeight : l.bottom - n + e.clientHeight, behavior: "instant" }), t.scrollIntoView(Ye);
|
|
1547
|
-
},
|
|
1548
|
+
}, _o = (e, t) => {
|
|
1548
1549
|
const n = t.scrollerOf(e, e.querySelector(Fe) ?? e);
|
|
1549
1550
|
n.getClientRects().length !== 0 && (n.scrollTo({ top: 0, left: 0, behavior: "instant" }), t.reveal(n));
|
|
1550
1551
|
}, Nt = (e, t, n) => {
|
|
1551
1552
|
if (e === null) return null;
|
|
1552
1553
|
const r = gn(e, t);
|
|
1553
|
-
return r === null ? (
|
|
1554
|
+
return r === null ? (Mo(t) && _o(e, n), null) : (Fo(e, r), qo(n.scrollerOf(e, r), r), n.reveal(r), r);
|
|
1554
1555
|
};
|
|
1555
|
-
function
|
|
1556
|
+
function Bo({
|
|
1556
1557
|
title: e,
|
|
1557
1558
|
titleId: t,
|
|
1558
1559
|
...n
|
|
@@ -1571,8 +1572,8 @@ function _o({
|
|
|
1571
1572
|
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"
|
|
1572
1573
|
}));
|
|
1573
1574
|
}
|
|
1574
|
-
const
|
|
1575
|
-
function
|
|
1575
|
+
const Io = /* @__PURE__ */ b.forwardRef(Bo);
|
|
1576
|
+
function jo({
|
|
1576
1577
|
title: e,
|
|
1577
1578
|
titleId: t,
|
|
1578
1579
|
...n
|
|
@@ -1595,8 +1596,8 @@ function Io({
|
|
|
1595
1596
|
clipRule: "evenodd"
|
|
1596
1597
|
}));
|
|
1597
1598
|
}
|
|
1598
|
-
const
|
|
1599
|
-
function
|
|
1599
|
+
const Ho = /* @__PURE__ */ b.forwardRef(jo);
|
|
1600
|
+
function Vo({
|
|
1600
1601
|
title: e,
|
|
1601
1602
|
titleId: t,
|
|
1602
1603
|
...n
|
|
@@ -1619,8 +1620,8 @@ function Ho({
|
|
|
1619
1620
|
clipRule: "evenodd"
|
|
1620
1621
|
}));
|
|
1621
1622
|
}
|
|
1622
|
-
const
|
|
1623
|
-
function
|
|
1623
|
+
const zo = /* @__PURE__ */ b.forwardRef(Vo);
|
|
1624
|
+
function Uo({
|
|
1624
1625
|
title: e,
|
|
1625
1626
|
titleId: t,
|
|
1626
1627
|
...n
|
|
@@ -1641,7 +1642,7 @@ function zo({
|
|
|
1641
1642
|
clipRule: "evenodd"
|
|
1642
1643
|
}));
|
|
1643
1644
|
}
|
|
1644
|
-
const
|
|
1645
|
+
const Zo = /* @__PURE__ */ b.forwardRef(Uo), Je = "data-aqmx-key-repeat", Qe = Object.freeze({ [Je]: "allow" }), Go = `[${Je}="${Qe[Je]}"]`, Ko = () => {
|
|
1645
1646
|
let e = null;
|
|
1646
1647
|
return {
|
|
1647
1648
|
onKeyDownCapture: (t) => {
|
|
@@ -1650,7 +1651,7 @@ const Uo = /* @__PURE__ */ b.forwardRef(zo), Je = "data-aqmx-key-repeat", Qe = O
|
|
|
1650
1651
|
e = t.target instanceof Element ? t.target : null;
|
|
1651
1652
|
return;
|
|
1652
1653
|
}
|
|
1653
|
-
e !== null && t.target === e && e.closest(
|
|
1654
|
+
e !== null && t.target === e && e.closest(Go) !== null || (t.preventDefault(), t.stopPropagation());
|
|
1654
1655
|
}
|
|
1655
1656
|
},
|
|
1656
1657
|
onKeyUpCapture: (t) => {
|
|
@@ -1660,7 +1661,7 @@ const Uo = /* @__PURE__ */ b.forwardRef(zo), Je = "data-aqmx-key-repeat", Qe = O
|
|
|
1660
1661
|
t.target === e && (e = null);
|
|
1661
1662
|
}
|
|
1662
1663
|
};
|
|
1663
|
-
}, Oe = Object.freeze([1 / Se ** 2, 1 / Se, 1, Se, Se ** 2]), Dt = Object.freeze({ mode: "fit" }),
|
|
1664
|
+
}, Oe = Object.freeze([1 / Se ** 2, 1 / Se, 1, Se, Se ** 2]), Dt = Object.freeze({ mode: "fit" }), Wo = 1, Xo = Object.freeze({ className: "aqmx-document-canvas", "data-testid": "markdown-explorer-image-canvas" }), Yo = me(null), Jo = (e, t) => e.width > 0 && e.height > 0 && t.width - e.width <= Wo ? { base: e, scale: t.width / e.width } : t.width > 0 && t.height > 0 ? { base: t, scale: 1 } : null, Pt = (e, t, n) => {
|
|
1664
1665
|
if (e.mode === "level") {
|
|
1665
1666
|
const o = e.index + n;
|
|
1666
1667
|
return o >= 0 && o < Oe.length ? o : null;
|
|
@@ -1676,12 +1677,12 @@ const Uo = /* @__PURE__ */ b.forwardRef(zo), Je = "data-aqmx-key-repeat", Qe = O
|
|
|
1676
1677
|
if (t === null) return null;
|
|
1677
1678
|
const r = Pt(e, t.scale, n);
|
|
1678
1679
|
return r === null ? null : { mode: "level", index: r, base: t.base };
|
|
1679
|
-
},
|
|
1680
|
+
}, Qo = (e) => {
|
|
1680
1681
|
const t = Oe[e];
|
|
1681
1682
|
if (t === void 0) throw new RangeError(`[markdown-explorer] no image zoom step ${String(e)}`);
|
|
1682
1683
|
return t;
|
|
1683
|
-
}, Ft = (e, t, n) => e !== null && e.width === t && e.height === n ? e : { width: t, height: n },
|
|
1684
|
-
const { labels: t } = D(), n = ne(
|
|
1684
|
+
}, Ft = (e, t, n) => e !== null && e.width === t && e.height === n ? e : { width: t, height: n }, ei = ({ document: e }) => {
|
|
1685
|
+
const { labels: t } = D(), n = ne(Yo), [r] = B(() => n === null ? null : n.read(e.url)), [o, i] = B(r === null ? Dt : r.zoom), [l, d] = B(r === null ? null : r.reported), [p, f] = B(null), u = q(null), v = $((T) => {
|
|
1685
1686
|
const { naturalWidth: a, naturalHeight: s } = T;
|
|
1686
1687
|
d((h) => Ft(h, a, s));
|
|
1687
1688
|
}, []), m = $(
|
|
@@ -1704,9 +1705,9 @@ const Uo = /* @__PURE__ */ b.forwardRef(zo), Je = "data-aqmx-key-repeat", Qe = O
|
|
|
1704
1705
|
const s = new ResizeObserver(a);
|
|
1705
1706
|
return s.observe(T), () => s.disconnect();
|
|
1706
1707
|
}, [l, o.mode]);
|
|
1707
|
-
const y = l === null || p === null ? null :
|
|
1708
|
+
const y = l === null || p === null ? null : Jo(l, p), A = $t(o, y, -1), k = $t(o, y, 1), S = o.mode === "level" ? Qo(o.index) : null, M = o.mode === "level" && S !== null ? { width: `${o.base.width * S}px`, height: `${o.base.height * S}px` } : void 0;
|
|
1708
1709
|
return /* @__PURE__ */ F("div", { className: "aqmx-document-file", "data-testid": "markdown-explorer-image-view", children: [
|
|
1709
|
-
/* @__PURE__ */ F($e, { name: e.name, openUrl: e.url, downloadUrl: e.url, icon: /* @__PURE__ */ c(
|
|
1710
|
+
/* @__PURE__ */ F($e, { name: e.name, openUrl: e.url, downloadUrl: e.url, icon: /* @__PURE__ */ c(Zo, {}), children: [
|
|
1710
1711
|
/* @__PURE__ */ c(
|
|
1711
1712
|
"button",
|
|
1712
1713
|
{
|
|
@@ -1719,7 +1720,7 @@ const Uo = /* @__PURE__ */ b.forwardRef(zo), Je = "data-aqmx-key-repeat", Qe = O
|
|
|
1719
1720
|
A !== null && i(A);
|
|
1720
1721
|
},
|
|
1721
1722
|
...Qe,
|
|
1722
|
-
children: /* @__PURE__ */ c(
|
|
1723
|
+
children: /* @__PURE__ */ c(Ho, {})
|
|
1723
1724
|
}
|
|
1724
1725
|
),
|
|
1725
1726
|
/* @__PURE__ */ c("output", { className: "aqmx-document-level", "aria-live": "polite", "data-testid": "markdown-explorer-image-level", children: S === null ? t.imageFitLevel : t.imageZoomLevel(Math.round(S * 100)) }),
|
|
@@ -1735,28 +1736,28 @@ const Uo = /* @__PURE__ */ b.forwardRef(zo), Je = "data-aqmx-key-repeat", Qe = O
|
|
|
1735
1736
|
k !== null && i(k);
|
|
1736
1737
|
},
|
|
1737
1738
|
...Qe,
|
|
1738
|
-
children: /* @__PURE__ */ c(
|
|
1739
|
+
children: /* @__PURE__ */ c(zo, {})
|
|
1739
1740
|
}
|
|
1740
1741
|
),
|
|
1741
|
-
/* @__PURE__ */ c("button", { type: "button", className: "aqmx-icon-button", "aria-label": t.imageFit, title: t.imageFit, "aria-pressed": o.mode === "fit", onClick: () => i(Dt), children: /* @__PURE__ */ c(
|
|
1742
|
+
/* @__PURE__ */ c("button", { type: "button", className: "aqmx-icon-button", "aria-label": t.imageFit, title: t.imageFit, "aria-pressed": o.mode === "fit", onClick: () => i(Dt), children: /* @__PURE__ */ c(Io, {}) })
|
|
1742
1743
|
] }),
|
|
1743
|
-
/* @__PURE__ */ c(xe, { scrollerProps:
|
|
1744
|
+
/* @__PURE__ */ c(xe, { scrollerProps: Xo, children: /* @__PURE__ */ c("img", { ref: m, className: "aqmx-document-image", src: e.url, alt: e.name, "data-aqmx-image-mode": o.mode, style: M, onLoad: (T) => v(T.currentTarget), "data-testid": "markdown-explorer-image" }) })
|
|
1744
1745
|
] });
|
|
1745
1746
|
}, bn = me(null), qe = me(void 0), En = me(null), _e = () => {
|
|
1746
1747
|
const e = ne(bn);
|
|
1747
1748
|
if (e === null) throw new Error("[markdown-explorer] document links must be rendered inside a document pane");
|
|
1748
1749
|
return e;
|
|
1749
|
-
},
|
|
1750
|
+
}, ti = () => {
|
|
1750
1751
|
const e = ne(En);
|
|
1751
1752
|
if (e === null) throw new Error("[markdown-explorer] table-of-contents entries must be rendered inside a document pane's links");
|
|
1752
1753
|
return e;
|
|
1753
|
-
}, 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 }),
|
|
1754
|
+
}, 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 }), ni = ({ children: e }) => {
|
|
1754
1755
|
const { config: t } = D(), n = _e(), r = nt(), o = r.kind === "location" ? r.location.source : void 0, i = De(Be(t, n.navigation, o, n.currentPath));
|
|
1755
1756
|
return /* @__PURE__ */ c(qe, { value: o, children: /* @__PURE__ */ c(En, { value: i, children: e }) });
|
|
1756
|
-
},
|
|
1757
|
-
const t = e instanceof Element ? e.closest(
|
|
1757
|
+
}, ri = 'a[data-link-kind="doc"][data-doc-path]:not([data-doc-exists="false"])', oi = (e) => {
|
|
1758
|
+
const t = e instanceof Element ? e.closest(ri) : null;
|
|
1758
1759
|
return t === null ? null : t.getAttribute("data-doc-path");
|
|
1759
|
-
}, Ie = (e) => !e.defaultPrevented && e.button === 0 && !e.metaKey && !e.ctrlKey && !e.shiftKey && !e.altKey,
|
|
1760
|
+
}, Ie = (e) => !e.defaultPrevented && e.button === 0 && !e.metaKey && !e.ctrlKey && !e.shiftKey && !e.altKey, ii = ({ to: e, docPath: t, fragment: n, exists: r, className: o, attributes: i, onDocumentLink: l, scope: d, children: p }) => {
|
|
1760
1761
|
const f = De(e);
|
|
1761
1762
|
return /* @__PURE__ */ c("a", { ...i, href: f, className: o, "data-link-kind": "doc", "data-doc-path": t, "data-doc-exists": r, onClick: (v) => {
|
|
1762
1763
|
if (Ie(v)) {
|
|
@@ -1767,10 +1768,10 @@ const Uo = /* @__PURE__ */ b.forwardRef(zo), Je = "data-aqmx-key-repeat", Qe = O
|
|
|
1767
1768
|
l(t, n);
|
|
1768
1769
|
}
|
|
1769
1770
|
}, children: p });
|
|
1770
|
-
},
|
|
1771
|
-
const { config: l } = D(), d = _e(), p = ne(qe), f =
|
|
1772
|
-
return u.kind === "page" ? /* @__PURE__ */ c(
|
|
1773
|
-
},
|
|
1771
|
+
}, li = ({ href: e, docPath: t, docExists: n, className: r, attributes: o, children: i }) => {
|
|
1772
|
+
const { config: l } = D(), d = _e(), p = ne(qe), f = Ao(e), { navigation: u } = d, v = `${Be(l, u, p, t)}${f}`, m = n === !1 ? "false" : void 0;
|
|
1773
|
+
return u.kind === "page" ? /* @__PURE__ */ c(ro, { ...o, to: v, navigation: "follow-link", className: r, "data-link-kind": "doc", "data-doc-path": t, "data-doc-exists": m, children: i }) : /* @__PURE__ */ c(ii, { to: v, docPath: t, fragment: f, exists: m, className: r, attributes: o, onDocumentLink: u.onDocumentLink, scope: d, children: i });
|
|
1774
|
+
}, ai = ({ className: e, attributes: t, children: n }) => {
|
|
1774
1775
|
const { labels: r } = D();
|
|
1775
1776
|
return (
|
|
1776
1777
|
/* @__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: [
|
|
@@ -1782,19 +1783,19 @@ const Uo = /* @__PURE__ */ b.forwardRef(zo), Je = "data-aqmx-key-repeat", Qe = O
|
|
|
1782
1783
|
] })
|
|
1783
1784
|
] })
|
|
1784
1785
|
);
|
|
1785
|
-
},
|
|
1786
|
+
}, si = ({ href: e, className: t, attributes: n, scope: r, children: o }) => {
|
|
1786
1787
|
const { config: i } = D(), l = ne(qe), d = De(`${Be(i, r.navigation, l, r.currentPath)}${e}`);
|
|
1787
1788
|
return /* @__PURE__ */ c("a", { ...n, href: d, className: t, onClick: (f) => {
|
|
1788
1789
|
Ie(f) && (f.preventDefault(), r.scrollWithin(e));
|
|
1789
1790
|
}, children: o });
|
|
1790
|
-
},
|
|
1791
|
+
}, ci = ({ href: e, className: t, attributes: n, children: r }) => {
|
|
1791
1792
|
const o = _e();
|
|
1792
1793
|
return o.navigation.kind === "page" ? /* @__PURE__ */ c("a", { ...n, href: e, className: t, onClick: (l) => {
|
|
1793
1794
|
if (!Ie(l)) return;
|
|
1794
1795
|
const d = l.currentTarget;
|
|
1795
1796
|
e === "#" ? o.followEmptyFragment(l.nativeEvent) : d.href === d.ownerDocument.URL && o.followSameUrlJump(e, l.nativeEvent);
|
|
1796
|
-
}, children: r }) : /* @__PURE__ */ c(
|
|
1797
|
-
},
|
|
1797
|
+
}, children: r }) : /* @__PURE__ */ c(si, { href: e, className: t, attributes: n, scope: o, children: r });
|
|
1798
|
+
}, di = ({ href: e, kind: t, docPath: n, docExists: r, className: o, attributes: i, children: l }) => t === "doc" ? n === void 0 || !zn(n) ? /* @__PURE__ */ c(ai, { className: o, attributes: i, children: l }) : /* @__PURE__ */ c(li, { href: e, docPath: n, docExists: r, className: o, attributes: i, children: l }) : e.startsWith("#") ? /* @__PURE__ */ c(ci, { href: e, className: o, attributes: i, children: l }) : /* @__PURE__ */ c("a", { ...i, href: e, className: o, children: l }), ui = () => {
|
|
1798
1799
|
const { config: e } = D(), t = _e(), n = ne(qe), r = Pe();
|
|
1799
1800
|
return $(
|
|
1800
1801
|
(o, i) => {
|
|
@@ -1805,11 +1806,11 @@ const Uo = /* @__PURE__ */ b.forwardRef(zo), Je = "data-aqmx-key-repeat", Qe = O
|
|
|
1805
1806
|
},
|
|
1806
1807
|
[e, t, n, r]
|
|
1807
1808
|
);
|
|
1808
|
-
},
|
|
1809
|
-
const e =
|
|
1809
|
+
}, fi = () => {
|
|
1810
|
+
const e = ti();
|
|
1810
1811
|
return $((t) => `${e}${vn(t.id)}`, [e]);
|
|
1811
1812
|
};
|
|
1812
|
-
function
|
|
1813
|
+
function mi({
|
|
1813
1814
|
title: e,
|
|
1814
1815
|
titleId: t,
|
|
1815
1816
|
...n
|
|
@@ -1828,8 +1829,8 @@ function fi({
|
|
|
1828
1829
|
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"
|
|
1829
1830
|
}));
|
|
1830
1831
|
}
|
|
1831
|
-
const
|
|
1832
|
-
function
|
|
1832
|
+
const hi = /* @__PURE__ */ b.forwardRef(mi);
|
|
1833
|
+
function pi({
|
|
1833
1834
|
title: e,
|
|
1834
1835
|
titleId: t,
|
|
1835
1836
|
...n
|
|
@@ -1850,8 +1851,8 @@ function hi({
|
|
|
1850
1851
|
clipRule: "evenodd"
|
|
1851
1852
|
}));
|
|
1852
1853
|
}
|
|
1853
|
-
const
|
|
1854
|
-
function
|
|
1854
|
+
const vi = /* @__PURE__ */ b.forwardRef(pi);
|
|
1855
|
+
function wi({
|
|
1855
1856
|
title: e,
|
|
1856
1857
|
titleId: t,
|
|
1857
1858
|
...n
|
|
@@ -1872,20 +1873,20 @@ function vi({
|
|
|
1872
1873
|
clipRule: "evenodd"
|
|
1873
1874
|
}));
|
|
1874
1875
|
}
|
|
1875
|
-
const
|
|
1876
|
+
const gi = /* @__PURE__ */ b.forwardRef(wi), bi = Object.freeze({ className: "aqmx-document-stage" }), Ei = (e) => {
|
|
1876
1877
|
switch (e) {
|
|
1877
1878
|
case "video":
|
|
1878
|
-
return /* @__PURE__ */ c(
|
|
1879
|
+
return /* @__PURE__ */ c(vi, {});
|
|
1879
1880
|
case "audio":
|
|
1880
|
-
return /* @__PURE__ */ c(
|
|
1881
|
+
return /* @__PURE__ */ c(gi, {});
|
|
1881
1882
|
case "pdf":
|
|
1882
|
-
return /* @__PURE__ */ c(
|
|
1883
|
+
return /* @__PURE__ */ c(hi, {});
|
|
1883
1884
|
default: {
|
|
1884
1885
|
const t = e;
|
|
1885
1886
|
throw new RangeError(`[markdown-explorer] unknown media type ${String(t)}`);
|
|
1886
1887
|
}
|
|
1887
1888
|
}
|
|
1888
|
-
},
|
|
1889
|
+
}, yi = ({ document: e }) => {
|
|
1889
1890
|
const { labels: t } = D();
|
|
1890
1891
|
switch (e.mediaType) {
|
|
1891
1892
|
case "video":
|
|
@@ -1903,10 +1904,10 @@ const wi = /* @__PURE__ */ b.forwardRef(vi), gi = Object.freeze({ className: "aq
|
|
|
1903
1904
|
throw new RangeError(`[markdown-explorer] unknown media type ${String(n)}`);
|
|
1904
1905
|
}
|
|
1905
1906
|
}
|
|
1906
|
-
},
|
|
1907
|
-
/* @__PURE__ */ c($e, { name: e.name, openUrl: e.url, downloadUrl: e.url, icon:
|
|
1908
|
-
/* @__PURE__ */ c(xe, { scrollerProps:
|
|
1909
|
-
] }),
|
|
1907
|
+
}, ki = ({ document: e }) => /* @__PURE__ */ F("div", { className: "aqmx-document-file", "data-testid": "markdown-explorer-media-view", "data-aqmx-media-type": e.mediaType, children: [
|
|
1908
|
+
/* @__PURE__ */ c($e, { name: e.name, openUrl: e.url, downloadUrl: e.url, icon: Ei(e.mediaType) }),
|
|
1909
|
+
/* @__PURE__ */ c(xe, { scrollerProps: bi, children: /* @__PURE__ */ c(yi, { document: e }) })
|
|
1910
|
+
] }), xi = (e) => ({
|
|
1910
1911
|
loading: e.viewerLoading,
|
|
1911
1912
|
errorPrefix: e.viewerErrorPrefix,
|
|
1912
1913
|
styleTitle: e.viewerStyleTitle,
|
|
@@ -1946,7 +1947,7 @@ const wi = /* @__PURE__ */ b.forwardRef(vi), gi = Object.freeze({ className: "aq
|
|
|
1946
1947
|
const [r] = e.documentStyles;
|
|
1947
1948
|
if (r === void 0) throw new Error("[markdown-explorer] the configuration has no document style");
|
|
1948
1949
|
return r.name;
|
|
1949
|
-
}, kn = (e, t) => e !== void 0 ? e : t !== void 0 ? t : dr, at = Object.freeze(["l1", "l2", "l3", "l4", "l5", "l6", "l7", "l8"]),
|
|
1950
|
+
}, kn = (e, t) => e !== void 0 ? e : t !== void 0 ? t : dr, at = Object.freeze(["l1", "l2", "l3", "l4", "l5", "l6", "l7", "l8"]), Si = (e, t, n) => {
|
|
1950
1951
|
if (t.view === "multi" || t.overrides[n] === void 0) return null;
|
|
1951
1952
|
const r = n === "style" ? { align: t.overrides.align } : { style: t.overrides.style };
|
|
1952
1953
|
return pe(e, { ...t, overrides: r });
|
|
@@ -1958,7 +1959,7 @@ const wi = /* @__PURE__ */ b.forwardRef(vi), gi = Object.freeze({ className: "aq
|
|
|
1958
1959
|
d
|
|
1959
1960
|
] })
|
|
1960
1961
|
);
|
|
1961
|
-
},
|
|
1962
|
+
}, Ri = () => {
|
|
1962
1963
|
const { labels: e } = D();
|
|
1963
1964
|
return /* @__PURE__ */ c(st, { kind: "empty", label: e.documentRegion, stale: !1, busy: !1, children: /* @__PURE__ */ c("div", { className: "aqmx-empty", "data-testid": "markdown-explorer-document-empty", children: /* @__PURE__ */ c("p", { className: "aqmx-empty-title", children: e.documentEmpty }) }) });
|
|
1964
1965
|
}, xn = ({ label: e }) => {
|
|
@@ -1967,29 +1968,29 @@ const wi = /* @__PURE__ */ b.forwardRef(vi), gi = Object.freeze({ className: "aq
|
|
|
1967
1968
|
/* @__PURE__ */ c("div", { className: "aqmx-skeleton", "aria-hidden": "true", "data-testid": "markdown-explorer-document-skeleton", children: at.map((n) => /* @__PURE__ */ c("span", {}, n)) }),
|
|
1968
1969
|
/* @__PURE__ */ c("p", { className: "aqmx-sr-only", children: t.documentLoading })
|
|
1969
1970
|
] });
|
|
1970
|
-
}, qt = Object.freeze(["wheel", "touchstart", "pointerdown", "keydown"]),
|
|
1971
|
-
const { reportMathDiagnostics: o, edits: i } = D(), l = U(() => ({ htmlContent: t.htmlContent, headings: [...t.headings] }), [t]), d =
|
|
1971
|
+
}, qt = Object.freeze(["wheel", "touchstart", "pointerdown", "keydown"]), Ti = ({ path: e, document: t, viewer: n, editing: r }) => {
|
|
1972
|
+
const { reportMathDiagnostics: o, edits: i } = D(), l = U(() => ({ htmlContent: t.htmlContent, headings: [...t.headings] }), [t]), d = ui(), p = fi(), f = U(() => o === void 0 ? void 0 : (h) => o(e, h), [o, e]), u = q(null), { editable: v, doubleClick: m, region: y, paneScroll: A, stale: k } = r;
|
|
1972
1973
|
Z(() => {
|
|
1973
1974
|
if (v)
|
|
1974
1975
|
return i.bindView(e, {
|
|
1975
1976
|
anchor: () => {
|
|
1976
1977
|
const h = u.current, g = y(), R = h === null ? null : h.querySelector(Fe);
|
|
1977
|
-
return h === null || g === null || R === null ? null :
|
|
1978
|
+
return h === null || g === null || R === null ? null : Xr(h, A.scrollerOf(g, R));
|
|
1978
1979
|
}
|
|
1979
1980
|
});
|
|
1980
1981
|
}, [i, e, v, y, A]);
|
|
1981
1982
|
const S = (h) => {
|
|
1982
1983
|
const g = u.current, { target: R } = h;
|
|
1983
|
-
!m || g === null || !(R instanceof Element) || !
|
|
1984
|
+
!m || g === null || !(R instanceof Element) || !Kr(R) || (h.stopPropagation(), i.start(e, Wr(R, g, g.ownerDocument.getSelection())));
|
|
1984
1985
|
}, M = q(null), T = q(k);
|
|
1985
1986
|
Z(() => {
|
|
1986
1987
|
T.current = k;
|
|
1987
1988
|
});
|
|
1988
1989
|
const a = le((h) => {
|
|
1989
|
-
const g = u.current, R = y(), L = g === null ? null :
|
|
1990
|
+
const g = u.current, R = y(), L = g === null ? null : to(g, h.line);
|
|
1990
1991
|
if (R === null || L === null) return !1;
|
|
1991
1992
|
const O = A.scrollerOf(R, L);
|
|
1992
|
-
return O.scrollTop +=
|
|
1993
|
+
return O.scrollTop += no(L, h.line) - h.clientTop, !0;
|
|
1993
1994
|
}), s = le((h) => {
|
|
1994
1995
|
const g = y();
|
|
1995
1996
|
if (g === null) return;
|
|
@@ -2014,11 +2015,11 @@ const wi = /* @__PURE__ */ b.forwardRef(vi), gi = Object.freeze({ className: "aq
|
|
|
2014
2015
|
}, Sn = ({ document: e, viewer: t }) => {
|
|
2015
2016
|
const { labels: n } = D();
|
|
2016
2017
|
return /* @__PURE__ */ F(Ne, { children: [
|
|
2017
|
-
/* @__PURE__ */ c($e, { name: e.name, openUrl: Un(e.url), downloadUrl: e.url, icon: /* @__PURE__ */ c(
|
|
2018
|
+
/* @__PURE__ */ c($e, { name: e.name, openUrl: Un(e.url), downloadUrl: e.url, icon: /* @__PURE__ */ c(Br, {}), children: e.truncated ? null : /* @__PURE__ */ c(bo, { text: e.text }) }),
|
|
2018
2019
|
e.truncated ? /* @__PURE__ */ c("p", { className: "aqmx-callout aqmx-document-notice", role: "note", "data-testid": "markdown-explorer-text-truncated", children: n.textTruncated }) : null,
|
|
2019
2020
|
/* @__PURE__ */ c("div", { className: "aqmx-document-viewer", children: /* @__PURE__ */ c(Yt, { ...t, parseResult: null, content: e.text }) })
|
|
2020
2021
|
] });
|
|
2021
|
-
},
|
|
2022
|
+
}, Ci = ({ path: e, name: t, viewer: n }) => {
|
|
2022
2023
|
const { data: r, documents: o, announcer: i, labels: l } = D(), d = $(() => o.answerStampOf(e), [o, e]), p = ee(o.subscribe, d, d), [f, u] = B(0), v = U(() => ({ path: e, stamp: p, attempt: f }), [e, p, f]), [m, y] = B(null), A = le((S) => {
|
|
2023
2024
|
y(S), S.kind === "failure" && i.announce(l.documentFailed(t, se(l, S.failure.reason)));
|
|
2024
2025
|
});
|
|
@@ -2033,35 +2034,35 @@ const wi = /* @__PURE__ */ b.forwardRef(vi), gi = Object.freeze({ className: "aq
|
|
|
2033
2034
|
/* @__PURE__ */ c("div", { className: "aqmx-skeleton", "aria-hidden": "true", "data-testid": "markdown-explorer-markup-skeleton", children: at.map((S) => /* @__PURE__ */ c("span", {}, S)) }),
|
|
2034
2035
|
/* @__PURE__ */ c("p", { className: "aqmx-sr-only", children: l.markupLoading })
|
|
2035
2036
|
] }) : m.kind === "failure" ? /* @__PURE__ */ c(xe, { scrollerProps: Rn, children: /* @__PURE__ */ c(ge, { failure: m.failure, alert: !1, onRetry: k, testId: "markdown-explorer-markup-failure" }) }) : /* @__PURE__ */ c(Sn, { document: m, viewer: n });
|
|
2036
|
-
}, Rn = Object.freeze({ className: "aqmx-document-failure", "data-aqmx-document-scroller": "" }),
|
|
2037
|
-
|
|
2037
|
+
}, Rn = Object.freeze({ className: "aqmx-document-failure", "data-aqmx-document-scroller": "" }), Oi = Object.freeze({ reason: "failed" }), Ai = (e) => /* @__PURE__ */ c(
|
|
2038
|
+
Hr,
|
|
2038
2039
|
{
|
|
2039
|
-
fallback: (t) => /* @__PURE__ */ c("div", { className: "aqmx-edit-message", children: /* @__PURE__ */ c(ge, { failure:
|
|
2040
|
+
fallback: (t) => /* @__PURE__ */ c("div", { className: "aqmx-edit-message", children: /* @__PURE__ */ c(ge, { failure: Oi, alert: !1, onRetry: t, testId: "markdown-explorer-edit-load-failure" }) }),
|
|
2040
2041
|
children: /* @__PURE__ */ c(
|
|
2041
2042
|
we,
|
|
2042
2043
|
{
|
|
2043
2044
|
fallback: /* @__PURE__ */ c("div", { className: "aqmx-skeleton", "aria-hidden": "true", "data-testid": "markdown-explorer-edit-skeleton", children: at.map((t) => /* @__PURE__ */ c("span", {}, t)) }),
|
|
2044
|
-
children: /* @__PURE__ */ c(
|
|
2045
|
+
children: /* @__PURE__ */ c(jr, { ...e })
|
|
2045
2046
|
}
|
|
2046
2047
|
)
|
|
2047
2048
|
}
|
|
2048
|
-
),
|
|
2049
|
+
), Li = ({ path: e, document: t, view: n, viewer: r, onRetry: o, editing: i }) => {
|
|
2049
2050
|
switch (t.kind) {
|
|
2050
2051
|
case "markdown": {
|
|
2051
2052
|
const { session: l, layout: d, region: p, paneScroll: f, stale: u } = i;
|
|
2052
|
-
if (n === "edit" && l !== void 0) return /* @__PURE__ */ c(
|
|
2053
|
-
if (n === "markup") return /* @__PURE__ */ c(
|
|
2053
|
+
if (n === "edit" && l !== void 0) return /* @__PURE__ */ c(Ai, { path: e, name: t.name, session: l, layout: d, viewer: r, region: p, paneScroll: f });
|
|
2054
|
+
if (n === "markup") return /* @__PURE__ */ c(Ci, { path: e, name: t.name, viewer: r });
|
|
2054
2055
|
const v = t.edit !== null && (t.edit.kind === "inline" || t.edit.kind === "draft");
|
|
2055
|
-
return /* @__PURE__ */ c(
|
|
2056
|
+
return /* @__PURE__ */ c(Ti, { path: e, document: t, viewer: r, editing: { editable: v, doubleClick: v && d === "fill", region: p, paneScroll: f, stale: u } });
|
|
2056
2057
|
}
|
|
2057
2058
|
case "text":
|
|
2058
2059
|
return /* @__PURE__ */ c(Sn, { document: t, viewer: r });
|
|
2059
2060
|
case "image":
|
|
2060
|
-
return /* @__PURE__ */ c(
|
|
2061
|
+
return /* @__PURE__ */ c(ei, { document: t });
|
|
2061
2062
|
case "media":
|
|
2062
|
-
return /* @__PURE__ */ c(
|
|
2063
|
+
return /* @__PURE__ */ c(ki, { document: t });
|
|
2063
2064
|
case "file":
|
|
2064
|
-
return /* @__PURE__ */ c(
|
|
2065
|
+
return /* @__PURE__ */ c(Oo, { document: t });
|
|
2065
2066
|
case "failure":
|
|
2066
2067
|
return /* @__PURE__ */ c(xe, { scrollerProps: Rn, children: /* @__PURE__ */ c(ge, { failure: t.failure, alert: !1, onRetry: o, testId: "markdown-explorer-document-failure" }) });
|
|
2067
2068
|
default: {
|
|
@@ -2069,15 +2070,15 @@ const wi = /* @__PURE__ */ b.forwardRef(vi), gi = Object.freeze({ className: "aq
|
|
|
2069
2070
|
throw new RangeError(`[markdown-explorer] unknown document kind in ${JSON.stringify(l)}`);
|
|
2070
2071
|
}
|
|
2071
2072
|
}
|
|
2072
|
-
},
|
|
2073
|
-
const [r] = t.kind === "markdown" ? t.headings : [], o = [n === null ? null : gn(e, n), r === void 0 ? null : wn(e, r.id), e.querySelector(Fe), e.querySelector(
|
|
2073
|
+
}, Mi = 'a[href], button:not(:disabled), input:not(:disabled), select:not(:disabled), textarea:not(:disabled), iframe, audio[controls], video[controls], [tabindex]:not([tabindex="-1"])', Ni = (e, t, n) => {
|
|
2074
|
+
const [r] = t.kind === "markdown" ? t.headings : [], o = [n === null ? null : gn(e, n), r === void 0 ? null : wn(e, r.id), e.querySelector(Fe), e.querySelector(Mi)];
|
|
2074
2075
|
for (const i of o)
|
|
2075
2076
|
if (i instanceof HTMLElement && un(i)) return i;
|
|
2076
2077
|
return null;
|
|
2077
2078
|
}, _t = (e, t, n) => {
|
|
2078
2079
|
const { activeElement: r, body: o } = e.ownerDocument, i = r === null || r === o;
|
|
2079
2080
|
t instanceof HTMLElement && n && (i || e.contains(r)) && un(t);
|
|
2080
|
-
},
|
|
2081
|
+
}, Di = (e) => {
|
|
2081
2082
|
const t = q(!1);
|
|
2082
2083
|
return Z(() => {
|
|
2083
2084
|
const n = e.current;
|
|
@@ -2103,8 +2104,8 @@ const wi = /* @__PURE__ */ b.forwardRef(vi), gi = Object.freeze({ className: "aq
|
|
|
2103
2104
|
clearTimeout(l), o.removeEventListener("pointerdown", d, !0), o.removeEventListener("mousedown", d, !0), o.removeEventListener("focusin", p, !0), o.removeEventListener("blur", u), o.removeEventListener("focus", v), n.removeEventListener("focusout", f);
|
|
2104
2105
|
};
|
|
2105
2106
|
}, [e]), t;
|
|
2106
|
-
},
|
|
2107
|
-
const { labels: y, announcer: A, documents: k } = D(), { document: S } = t, M = q(null), T = q(null), a = q(null), s = q(0), h =
|
|
2107
|
+
}, Pi = ({ path: e, snapshot: t, markup: n, stale: r, viewer: o, editLayout: i, regionLabel: l, navigation: d, fragment: p, paneScroll: f, announces: u, announceFailure: v, onDocumentShown: m }) => {
|
|
2108
|
+
const { labels: y, announcer: A, documents: k } = D(), { document: S } = t, M = q(null), T = q(null), a = q(null), s = q(0), h = Di(M), g = q({ path: e, document: S }), R = q(null), L = $(
|
|
2108
2109
|
(z) => {
|
|
2109
2110
|
const K = M.current, Y = Nt(K, z, f);
|
|
2110
2111
|
K !== null && Y !== null && _t(K, Y, h.current);
|
|
@@ -2125,7 +2126,7 @@ const wi = /* @__PURE__ */ b.forwardRef(vi), gi = Object.freeze({ className: "aq
|
|
|
2125
2126
|
}, 0);
|
|
2126
2127
|
},
|
|
2127
2128
|
[L]
|
|
2128
|
-
), j = U(() => ({ navigation: d, currentPath: e, scrollWithin: L, followSameUrlJump: O, followEmptyFragment: N }), [d, e, L, O, N]), I = $(() => k.retry(e), [k, e]), X =
|
|
2129
|
+
), j = U(() => ({ navigation: d, currentPath: e, scrollWithin: L, followSameUrlJump: O, followEmptyFragment: N }), [d, e, L, O, N]), I = $(() => k.retry(e), [k, e]), X = oo(k, oi), Q = sn(e), J = Q !== void 0 ? "edit" : n ? "markup" : "rendered", H = S.kind === "markdown" ? J : void 0, oe = $(() => M.current, []), w = U(() => ({ session: Q, layout: i, region: oe, paneScroll: f, stale: r }), [Q, i, oe, f, r]), E = H === "edit" ? !1 : r, x = ne(fe), C = H === "edit" && i === "fill" ? "fill" : x, P = le((z, K) => {
|
|
2129
2130
|
const Y = T.current;
|
|
2130
2131
|
if (Y !== null && Y.path === z && Y.snapshot === K) return;
|
|
2131
2132
|
T.current = { path: z, snapshot: K };
|
|
@@ -2145,7 +2146,7 @@ const wi = /* @__PURE__ */ b.forwardRef(vi), gi = Object.freeze({ className: "aq
|
|
|
2145
2146
|
const K = M.current;
|
|
2146
2147
|
if (K === null || !h.current) return null;
|
|
2147
2148
|
const { activeElement: Y, body: re } = K.ownerDocument;
|
|
2148
|
-
return Y !== null && Y !== re ? null :
|
|
2149
|
+
return Y !== null && Y !== re ? null : Ni(K, S, z);
|
|
2149
2150
|
}), V = le((z) => {
|
|
2150
2151
|
const K = M.current;
|
|
2151
2152
|
K !== null && _t(K, z, h.current);
|
|
@@ -2168,17 +2169,17 @@ const wi = /* @__PURE__ */ b.forwardRef(vi), gi = Object.freeze({ className: "aq
|
|
|
2168
2169
|
z && je === null && ft !== null && ie(ft);
|
|
2169
2170
|
};
|
|
2170
2171
|
Y ? queueMicrotask(ut) : ut();
|
|
2171
|
-
}, [p, e, S, r]), /* @__PURE__ */ c(fe, { value: C, children: /* @__PURE__ */ c(st, { kind: S.kind, view: H, label: l(e, S), stale: E, busy: E, frameRef: M, intent: X, children: /* @__PURE__ */ c(bn, { value: j, children: /* @__PURE__ */ c(
|
|
2172
|
-
}, ct = Object.freeze({ kind: "skeleton" }),
|
|
2172
|
+
}, [p, e, S, r]), /* @__PURE__ */ c(fe, { value: C, children: /* @__PURE__ */ c(st, { kind: S.kind, view: H, label: l(e, S), stale: E, busy: E, frameRef: M, intent: X, children: /* @__PURE__ */ c(bn, { value: j, children: /* @__PURE__ */ c(ni, { children: /* @__PURE__ */ c(Li, { path: e, document: S, view: J, viewer: o, onRetry: I, editing: w }, e) }) }) }) });
|
|
2173
|
+
}, ct = Object.freeze({ kind: "skeleton" }), $i = (e, t, n, r, o) => {
|
|
2173
2174
|
if (t?.status === "loaded") return { kind: "document", path: e, snapshot: t, stale: !1 };
|
|
2174
2175
|
const i = de(t);
|
|
2175
2176
|
if (i !== null) return { kind: "document", path: e, snapshot: i, stale: !0 };
|
|
2176
2177
|
if (o && t?.status === "pending") return { kind: "streaming", path: e, promise: t.promise };
|
|
2177
2178
|
const l = n === null || n === e ? null : de(r);
|
|
2178
2179
|
return n === null || l === null ? ct : { kind: "document", path: n, snapshot: l, stale: !0 };
|
|
2179
|
-
},
|
|
2180
|
-
const o = t.kind === "streaming" ?
|
|
2181
|
-
return o.kind !== "document" ? /* @__PURE__ */ c(xn, { label: r.regionLabel(e, null) }) : /* @__PURE__ */ c(
|
|
2180
|
+
}, Fi = (e, t) => t.status === "deferred" ? ct : { kind: "document", path: e, snapshot: t, stale: !1 }, qi = ({ requestedPath: e, content: t, markup: n, ...r }) => {
|
|
2181
|
+
const o = t.kind === "streaming" ? Fi(t.path, ne(t.promise)) : t;
|
|
2182
|
+
return o.kind !== "document" ? /* @__PURE__ */ c(xn, { label: r.regionLabel(e, null) }) : /* @__PURE__ */ c(Pi, { path: o.path, snapshot: o.snapshot, markup: n, stale: o.stale, ...r });
|
|
2182
2183
|
}, Tn = ({ path: e, markup: t, display: n, navigation: r, fragment: o, paneScroll: i, announces: l, announceFailure: d, onDocumentShown: p }) => {
|
|
2183
2184
|
const { config: f, labels: u, theme: v, documents: m } = D(), y = sr(), A = q(!1);
|
|
2184
2185
|
Z(() => {
|
|
@@ -2186,11 +2187,11 @@ const wi = /* @__PURE__ */ b.forwardRef(vi), gi = Object.freeze({ className: "aq
|
|
|
2186
2187
|
}, []);
|
|
2187
2188
|
const [k, S] = B(null), [M, T] = B(t), a = $(() => e === null ? void 0 : m.peek(e), [m, e]), s = ee(m.subscribe, a, a), h = $(() => k === null ? void 0 : m.peek(k), [m, k]), g = ee(m.subscribe, h, h);
|
|
2188
2189
|
Z(() => e === null ? void 0 : m.open(e), [m, e]), Z(() => k === null ? void 0 : m.retain(k), [m, k]);
|
|
2189
|
-
const R = e === null ? ct :
|
|
2190
|
+
const R = e === null ? ct : $i(e, s, k, g, !A.current), L = e === null ? null : R.kind === "document" && !R.stale ? R.path : k;
|
|
2190
2191
|
L !== k && S(L);
|
|
2191
2192
|
const O = R.kind !== "document" || R.path === e;
|
|
2192
2193
|
O && t !== M && T(t);
|
|
2193
|
-
const N = U(() =>
|
|
2194
|
+
const N = U(() => xi(u), [u]), j = U(() => [...f.iframeHosts], [f]), I = r.kind === "panel", X = U(
|
|
2194
2195
|
() => ({
|
|
2195
2196
|
labels: N,
|
|
2196
2197
|
emptyMessage: u.documentEmpty,
|
|
@@ -2198,7 +2199,7 @@ const wi = /* @__PURE__ */ b.forwardRef(vi), gi = Object.freeze({ className: "aq
|
|
|
2198
2199
|
availableStyles: f.documentStyles,
|
|
2199
2200
|
iFrameAllowedDomains: j,
|
|
2200
2201
|
embeds: f.embeds,
|
|
2201
|
-
linkComponent:
|
|
2202
|
+
linkComponent: di,
|
|
2202
2203
|
toolbar: y,
|
|
2203
2204
|
style: n.style,
|
|
2204
2205
|
onStyleChange: n.onStyleChange,
|
|
@@ -2214,8 +2215,8 @@ const wi = /* @__PURE__ */ b.forwardRef(vi), gi = Object.freeze({ className: "aq
|
|
|
2214
2215
|
}),
|
|
2215
2216
|
[N, u.documentEmpty, v, f.documentStyles, j, f.embeds, y, n, I]
|
|
2216
2217
|
), Q = $((H, oe) => I ? oe === null || oe.kind === "failure" ? ye(H) : oe.name : u.documentRegion, [I, u.documentRegion]), J = I ? "content" : "fill";
|
|
2217
|
-
return e === null ? /* @__PURE__ */ c(fe, { value: J, children: /* @__PURE__ */ c(
|
|
2218
|
-
|
|
2218
|
+
return e === null ? /* @__PURE__ */ c(fe, { value: J, children: /* @__PURE__ */ c(Ri, {}) }) : /* @__PURE__ */ c(fe, { value: J, children: /* @__PURE__ */ c(we, { fallback: /* @__PURE__ */ c(xn, { label: Q(e, null) }), children: /* @__PURE__ */ c(
|
|
2219
|
+
qi,
|
|
2219
2220
|
{
|
|
2220
2221
|
requestedPath: e,
|
|
2221
2222
|
content: R,
|
|
@@ -2231,11 +2232,11 @@ const wi = /* @__PURE__ */ b.forwardRef(vi), gi = Object.freeze({ className: "aq
|
|
|
2231
2232
|
onDocumentShown: p
|
|
2232
2233
|
}
|
|
2233
2234
|
) }) });
|
|
2234
|
-
},
|
|
2235
|
+
}, _i = ({ path: e, markup: t, variant: n, onDocumentShown: r }) => {
|
|
2235
2236
|
const { config: o, viewSettings: i, announcer: l } = D(), d = Ae((L) => L.style), p = Ae((L) => L.align), f = Pe(), u = Wt(), v = nt(), { view: m, overrides: y, embed: A } = n, k = $(
|
|
2236
2237
|
(L) => {
|
|
2237
2238
|
if (v.kind !== "location") return;
|
|
2238
|
-
const O =
|
|
2239
|
+
const O = Si(o, v.location, L);
|
|
2239
2240
|
O !== null && f(O, "browse");
|
|
2240
2241
|
},
|
|
2241
2242
|
[o, f, v]
|
|
@@ -2265,8 +2266,8 @@ const wi = /* @__PURE__ */ b.forwardRef(vi), gi = Object.freeze({ className: "aq
|
|
|
2265
2266
|
}),
|
|
2266
2267
|
[T, S, a, M, A]
|
|
2267
2268
|
), h = U(() => ({ kind: "page", view: m, overrides: y, embed: A }), [m, y, A]), g = U(() => ({ kind: "page", fragment: u.hash, navigation: u }), [u]), R = $((L) => l.announce(L), [l]);
|
|
2268
|
-
return /* @__PURE__ */ c(Tn, { path: e, markup: t, display: s, navigation: h, fragment: g, paneScroll:
|
|
2269
|
-
},
|
|
2269
|
+
return /* @__PURE__ */ c(Tn, { path: e, markup: t, display: s, navigation: h, fragment: g, paneScroll: $o, announces: !0, announceFailure: R, onDocumentShown: r });
|
|
2270
|
+
}, Bi = ({ path: e, markup: t, variant: n, onDocumentShown: r }) => {
|
|
2270
2271
|
const { config: o, viewSettings: i } = D(), l = Ae((h) => h.style), d = Ae((h) => h.align), [p, f] = B(() => yn(o, void 0, l)), u = kn(void 0, d), v = $((h) => i.update({ align: h }), [i]), { maximized: m, onDocumentLink: y, pendingHash: A, onHashConsumed: k, announceFailure: S, paneScroll: M } = n, T = U(
|
|
2271
2272
|
() => ({
|
|
2272
2273
|
style: p,
|
|
@@ -2284,8 +2285,8 @@ const wi = /* @__PURE__ */ b.forwardRef(vi), gi = Object.freeze({ className: "aq
|
|
|
2284
2285
|
[p, u, v, m]
|
|
2285
2286
|
), a = U(() => ({ kind: "panel", onDocumentLink: y }), [y]), s = U(() => ({ kind: "panel", fragment: A, consume: k }), [A, k]);
|
|
2286
2287
|
return /* @__PURE__ */ c(Tn, { path: e, markup: t, display: T, navigation: a, fragment: s, paneScroll: M, announces: !1, announceFailure: S, onDocumentShown: r });
|
|
2287
|
-
},
|
|
2288
|
-
function
|
|
2288
|
+
}, Ii = ({ path: e, markup: t, variant: n, onDocumentShown: r }) => n.kind === "page" ? /* @__PURE__ */ c(_i, { path: e, markup: t, variant: n, onDocumentShown: r }) : /* @__PURE__ */ c(Bi, { path: e, markup: t, variant: n, onDocumentShown: r });
|
|
2289
|
+
function ji({
|
|
2289
2290
|
title: e,
|
|
2290
2291
|
titleId: t,
|
|
2291
2292
|
...n
|
|
@@ -2306,8 +2307,8 @@ function Ii({
|
|
|
2306
2307
|
clipRule: "evenodd"
|
|
2307
2308
|
}));
|
|
2308
2309
|
}
|
|
2309
|
-
const
|
|
2310
|
-
function
|
|
2310
|
+
const Hi = /* @__PURE__ */ b.forwardRef(ji);
|
|
2311
|
+
function Vi({
|
|
2311
2312
|
title: e,
|
|
2312
2313
|
titleId: t,
|
|
2313
2314
|
...n
|
|
@@ -2328,8 +2329,8 @@ function Hi({
|
|
|
2328
2329
|
clipRule: "evenodd"
|
|
2329
2330
|
}));
|
|
2330
2331
|
}
|
|
2331
|
-
const Cn = /* @__PURE__ */ b.forwardRef(
|
|
2332
|
-
function
|
|
2332
|
+
const Cn = /* @__PURE__ */ b.forwardRef(Vi);
|
|
2333
|
+
function zi({
|
|
2333
2334
|
title: e,
|
|
2334
2335
|
titleId: t,
|
|
2335
2336
|
...n
|
|
@@ -2350,8 +2351,8 @@ function Vi({
|
|
|
2350
2351
|
clipRule: "evenodd"
|
|
2351
2352
|
}));
|
|
2352
2353
|
}
|
|
2353
|
-
const
|
|
2354
|
-
function
|
|
2354
|
+
const Ui = /* @__PURE__ */ b.forwardRef(zi);
|
|
2355
|
+
function Zi({
|
|
2355
2356
|
title: e,
|
|
2356
2357
|
titleId: t,
|
|
2357
2358
|
...n
|
|
@@ -2376,8 +2377,8 @@ function Ui({
|
|
|
2376
2377
|
clipRule: "evenodd"
|
|
2377
2378
|
}));
|
|
2378
2379
|
}
|
|
2379
|
-
const
|
|
2380
|
-
function
|
|
2380
|
+
const Gi = /* @__PURE__ */ b.forwardRef(Zi);
|
|
2381
|
+
function Ki({
|
|
2381
2382
|
title: e,
|
|
2382
2383
|
titleId: t,
|
|
2383
2384
|
...n
|
|
@@ -2398,8 +2399,8 @@ function Gi({
|
|
|
2398
2399
|
clipRule: "evenodd"
|
|
2399
2400
|
}));
|
|
2400
2401
|
}
|
|
2401
|
-
const
|
|
2402
|
-
function
|
|
2402
|
+
const Wi = /* @__PURE__ */ b.forwardRef(Ki);
|
|
2403
|
+
function Xi({
|
|
2403
2404
|
title: e,
|
|
2404
2405
|
titleId: t,
|
|
2405
2406
|
...n
|
|
@@ -2422,8 +2423,8 @@ function Wi({
|
|
|
2422
2423
|
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"
|
|
2423
2424
|
}));
|
|
2424
2425
|
}
|
|
2425
|
-
const
|
|
2426
|
-
function
|
|
2426
|
+
const Yi = /* @__PURE__ */ b.forwardRef(Xi);
|
|
2427
|
+
function Ji({
|
|
2427
2428
|
title: e,
|
|
2428
2429
|
titleId: t,
|
|
2429
2430
|
...n
|
|
@@ -2446,8 +2447,8 @@ function Yi({
|
|
|
2446
2447
|
clipRule: "evenodd"
|
|
2447
2448
|
}));
|
|
2448
2449
|
}
|
|
2449
|
-
const
|
|
2450
|
-
function
|
|
2450
|
+
const Qi = /* @__PURE__ */ b.forwardRef(Ji);
|
|
2451
|
+
function el({
|
|
2451
2452
|
title: e,
|
|
2452
2453
|
titleId: t,
|
|
2453
2454
|
...n
|
|
@@ -2468,8 +2469,8 @@ function Qi({
|
|
|
2468
2469
|
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"
|
|
2469
2470
|
}));
|
|
2470
2471
|
}
|
|
2471
|
-
const
|
|
2472
|
-
function
|
|
2472
|
+
const tl = /* @__PURE__ */ b.forwardRef(el);
|
|
2473
|
+
function nl({
|
|
2473
2474
|
title: e,
|
|
2474
2475
|
titleId: t,
|
|
2475
2476
|
...n
|
|
@@ -2488,7 +2489,7 @@ function tl({
|
|
|
2488
2489
|
d: "M15 3.75H9v16.5h6V3.75ZM16.5 20.25h3.375c1.035 0 1.875-.84 1.875-1.875V5.625c0-1.036-.84-1.875-1.875-1.875H16.5v16.5ZM4.125 3.75H7.5v16.5H4.125a1.875 1.875 0 0 1-1.875-1.875V5.625c0-1.036.84-1.875 1.875-1.875Z"
|
|
2489
2490
|
}));
|
|
2490
2491
|
}
|
|
2491
|
-
const
|
|
2492
|
+
const rl = /* @__PURE__ */ b.forwardRef(nl), ol = ({ href: e, onRetry: t, testId: n }) => {
|
|
2492
2493
|
const { labels: r, onEditGrant: o } = D(), [i, l] = B(!1), d = () => {
|
|
2493
2494
|
o === void 0 || i || (l(!0), o(e).then((p) => {
|
|
2494
2495
|
p && t();
|
|
@@ -2504,20 +2505,20 @@ const nl = /* @__PURE__ */ b.forwardRef(tl), rl = ({ href: e, onRetry: t, testId
|
|
|
2504
2505
|
/* @__PURE__ */ c("button", { type: "button", className: "aqmx-callout-action", "data-testid": `${n}-retry`, onClick: t, children: r.editGrantRetry })
|
|
2505
2506
|
] })
|
|
2506
2507
|
] });
|
|
2507
|
-
},
|
|
2508
|
+
}, il = "Control+E Meta+E", ll = (e, t, n) => n && t ? "split" : e.view, Bt = (e, t, n, r) => {
|
|
2508
2509
|
if (n === "split") {
|
|
2509
2510
|
e.setSideBySide(!0);
|
|
2510
2511
|
return;
|
|
2511
2512
|
}
|
|
2512
2513
|
e.setView(t, n), r && e.sideBySide() && e.setSideBySide(!1);
|
|
2513
|
-
},
|
|
2514
|
+
}, ya = (e) => e === "split" ? null : e, al = (e) => e === "preview" ? "editor" : "preview", sl = (e) => /Mac|iPhone|iPad|iPod/u.test(e), cl = (e, t) => {
|
|
2514
2515
|
if (e.isComposing || e.altKey || e.shiftKey || (t ? !e.metaKey || e.ctrlKey : !e.ctrlKey || e.metaKey)) return !1;
|
|
2515
2516
|
const n = e.key.toLowerCase();
|
|
2516
2517
|
return n === "e" || e.code === "KeyE" && /^\p{L}$/u.test(n) && !/^[a-z]$/u.test(n);
|
|
2517
2518
|
}, It = (e, t, n) => {
|
|
2518
2519
|
const r = e.modifiedAt === null ? Number.NaN : Date.parse(e.modifiedAt);
|
|
2519
2520
|
return n(Number.isNaN(r) ? e.id : t.format(r), e.author === null ? "" : e.author);
|
|
2520
|
-
},
|
|
2521
|
+
}, dl = ({ path: e, documentName: t, open: n, onClose: r }) => {
|
|
2521
2522
|
const { data: o, edits: i, labels: l, locale: d, announcer: p } = D(), f = q(null), u = q(null), v = ve(), [m, y] = B(null), [A, k] = B(0), [S, M] = B(null), [T, a] = B(null), s = U(() => new Intl.DateTimeFormat(d, { dateStyle: "medium", timeStyle: "short" }), [d]);
|
|
2522
2523
|
Z(() => {
|
|
2523
2524
|
const O = f.current;
|
|
@@ -2561,12 +2562,12 @@ const nl = /* @__PURE__ */ b.forwardRef(tl), rl = ({ href: e, onRetry: t, testId
|
|
|
2561
2562
|
/* @__PURE__ */ c("button", { type: "button", className: "aqmx-callout-action", "aria-disabled": T === null || T.kind !== "revision", "data-testid": "markdown-explorer-history-restore", onClick: h, children: l.historyRestore })
|
|
2562
2563
|
] })
|
|
2563
2564
|
] }) });
|
|
2564
|
-
},
|
|
2565
|
+
}, ul = (e) => {
|
|
2565
2566
|
const { documents: t } = D(), n = $(() => t.peek(e), [t, e]), r = $(() => t.peekSeeded(e), [t, e]), o = ee(t.subscribe, n, r), i = de(o)?.document;
|
|
2566
2567
|
return i === void 0 || i.kind === "failure" ? { edit: null, name: ye(e) } : { edit: i.kind === "markdown" ? i.edit : null, name: i.name };
|
|
2567
2568
|
}, ae = (e) => {
|
|
2568
2569
|
e.stopPropagation();
|
|
2569
|
-
},
|
|
2570
|
+
}, fl = ({ path: e, documentName: t, iconOnly: n, previewAvailable: r, draft: o }) => {
|
|
2570
2571
|
const { draftConverter: i, edits: l, labels: d } = D(), p = ee(
|
|
2571
2572
|
l.subscribe,
|
|
2572
2573
|
() => l.session(e) !== void 0,
|
|
@@ -2580,7 +2581,7 @@ const nl = /* @__PURE__ */ b.forwardRef(tl), rl = ({ href: e, onRetry: t, testId
|
|
|
2580
2581
|
const k = l.session(e);
|
|
2581
2582
|
k?.dirty === !0 ? u(k.save.kind === "draft" ? "draft" : "unsaved") : l.close(e);
|
|
2582
2583
|
}, m = () => {
|
|
2583
|
-
p || (
|
|
2584
|
+
p || (Ir(), r && l.sideBySide() && i?.prepare?.());
|
|
2584
2585
|
}, y = n ? o ? d.editDraftDocumentNamed(t) : d.editDocumentNamed(t) : null, A = o ? d.editDraftDocument : d.editDocument;
|
|
2585
2586
|
return /* @__PURE__ */ F(Ne, { children: [
|
|
2586
2587
|
/* @__PURE__ */ F(
|
|
@@ -2597,7 +2598,7 @@ const nl = /* @__PURE__ */ b.forwardRef(tl), rl = ({ href: e, onRetry: t, testId
|
|
|
2597
2598
|
onPointerEnter: m,
|
|
2598
2599
|
onFocus: m,
|
|
2599
2600
|
children: [
|
|
2600
|
-
/* @__PURE__ */ c(
|
|
2601
|
+
/* @__PURE__ */ c(tl, { "aria-hidden": "true" }),
|
|
2601
2602
|
y === null ? /* @__PURE__ */ c("span", { children: d.editDocumentLabel }) : null
|
|
2602
2603
|
]
|
|
2603
2604
|
}
|
|
@@ -2618,7 +2619,7 @@ const nl = /* @__PURE__ */ b.forwardRef(tl), rl = ({ href: e, onRetry: t, testId
|
|
|
2618
2619
|
}
|
|
2619
2620
|
)
|
|
2620
2621
|
] });
|
|
2621
|
-
},
|
|
2622
|
+
}, ml = ({ href: e, documentName: t, iconOnly: n }) => {
|
|
2622
2623
|
const { labels: r } = D(), o = n ? r.editExternallyNamed(t) : null;
|
|
2623
2624
|
return /* @__PURE__ */ F(
|
|
2624
2625
|
"a",
|
|
@@ -2632,29 +2633,29 @@ const nl = /* @__PURE__ */ b.forwardRef(tl), rl = ({ href: e, onRetry: t, testId
|
|
|
2632
2633
|
"data-testid": "markdown-explorer-document-edit-external",
|
|
2633
2634
|
onDoubleClick: ae,
|
|
2634
2635
|
children: [
|
|
2635
|
-
/* @__PURE__ */ c(
|
|
2636
|
+
/* @__PURE__ */ c(Ui, { "aria-hidden": "true" }),
|
|
2636
2637
|
o === null ? /* @__PURE__ */ c("span", { children: r.editExternallyLabel }) : null
|
|
2637
2638
|
]
|
|
2638
2639
|
}
|
|
2639
2640
|
);
|
|
2640
|
-
},
|
|
2641
|
-
const { labels: t } = D(), n =
|
|
2641
|
+
}, hl = ({ session: e }) => {
|
|
2642
|
+
const { labels: t } = D(), n = xr(t, e);
|
|
2642
2643
|
return /* @__PURE__ */ c("p", { className: "aqmx-edit-status", title: n === "" ? void 0 : n, "data-testid": "markdown-explorer-edit-status", "data-aqmx-save": e.save.kind, children: n });
|
|
2643
|
-
},
|
|
2644
|
-
const { draftConverter: i, edits: l, labels: d } = D(), p =
|
|
2644
|
+
}, pl = Object.freeze(["editor", "split", "preview"]), vl = Object.freeze(["editor", "preview"]), wl = Object.freeze({ editor: Cn, split: rl, preview: Qi }), gl = ({ path: e, documentName: t, iconOnly: n, session: r, previewAvailable: o }) => {
|
|
2645
|
+
const { draftConverter: i, edits: l, labels: d } = D(), p = $r(), f = ll(r, p, o), u = o ? pl : vl, v = ve(), m = q(/* @__PURE__ */ new Map()), y = {
|
|
2645
2646
|
editor: { label: d.editViewEditor, tooltip: d.editViewEditorTooltip },
|
|
2646
2647
|
split: { label: d.editViewSplit, tooltip: d.editViewSplitTooltip },
|
|
2647
2648
|
preview: { label: d.editViewPreview, tooltip: d.editViewPreviewTooltip }
|
|
2648
2649
|
}, A = () => {
|
|
2649
2650
|
l.preparePreview(e), i?.prepare?.();
|
|
2650
2651
|
}, k = (S) => {
|
|
2651
|
-
if (!
|
|
2652
|
+
if (!cl(S.nativeEvent, sl(navigator.platform))) return;
|
|
2652
2653
|
rt(S);
|
|
2653
|
-
const M =
|
|
2654
|
+
const M = al(f);
|
|
2654
2655
|
Bt(l, e, M, o), m.current.get(M)?.focus();
|
|
2655
2656
|
};
|
|
2656
2657
|
return /* @__PURE__ */ c("div", { role: "radiogroup", "aria-label": n ? d.editViewNamed(t) : d.editView, className: "aqmx-edit-view", "data-testid": "markdown-explorer-edit-view", onKeyDown: k, children: u.map((S) => {
|
|
2657
|
-
const M =
|
|
2658
|
+
const M = wl[S], { label: T, tooltip: a } = y[S], s = S === "preview" ? A : void 0;
|
|
2658
2659
|
return /* @__PURE__ */ F("label", { className: n ? "aqmx-icon-button" : "aqmx-icon-button aqmx-labelled-button", children: [
|
|
2659
2660
|
/* @__PURE__ */ c(
|
|
2660
2661
|
"input",
|
|
@@ -2667,7 +2668,7 @@ const nl = /* @__PURE__ */ b.forwardRef(tl), rl = ({ href: e, onRetry: t, testId
|
|
|
2667
2668
|
value: S,
|
|
2668
2669
|
checked: S === f,
|
|
2669
2670
|
"aria-label": T,
|
|
2670
|
-
"aria-keyshortcuts": S === "split" ? void 0 :
|
|
2671
|
+
"aria-keyshortcuts": S === "split" ? void 0 : il,
|
|
2671
2672
|
title: a,
|
|
2672
2673
|
"data-testid": `markdown-explorer-edit-view-${S}`,
|
|
2673
2674
|
onChange: () => Bt(l, e, S, o),
|
|
@@ -2680,7 +2681,7 @@ const nl = /* @__PURE__ */ b.forwardRef(tl), rl = ({ href: e, onRetry: t, testId
|
|
|
2680
2681
|
n ? null : /* @__PURE__ */ c("span", { children: T })
|
|
2681
2682
|
] }, S);
|
|
2682
2683
|
}) });
|
|
2683
|
-
},
|
|
2684
|
+
}, bl = ({ path: e, documentName: t, iconOnly: n, session: r, previewAvailable: o }) => {
|
|
2684
2685
|
const { edits: i, labels: l } = D(), [d, p] = B(!1);
|
|
2685
2686
|
if (r.phase.kind !== "editing") return null;
|
|
2686
2687
|
const f = r.save.kind === "saving", u = f || !r.dirty, v = () => {
|
|
@@ -2690,33 +2691,33 @@ const nl = /* @__PURE__ */ b.forwardRef(tl), rl = ({ href: e, onRetry: t, testId
|
|
|
2690
2691
|
}, m = (y) => n ? { className: "aqmx-icon-button", "aria-label": y } : { className: "aqmx-icon-button aqmx-labelled-button" };
|
|
2691
2692
|
return /* @__PURE__ */ F(Ne, { children: [
|
|
2692
2693
|
r.save.kind === "conflicts" ? /* @__PURE__ */ F("button", { type: "button", ...m(l.conflictNext), title: l.conflictNext, "data-testid": "markdown-explorer-edit-next-conflict", onClick: () => i.nextConflict(e), onDoubleClick: ae, children: [
|
|
2693
|
-
/* @__PURE__ */ c(
|
|
2694
|
+
/* @__PURE__ */ c(Gi, { "aria-hidden": "true" }),
|
|
2694
2695
|
n ? null : /* @__PURE__ */ c("span", { children: l.conflictNext })
|
|
2695
2696
|
] }) : null,
|
|
2696
|
-
/* @__PURE__ */ c(
|
|
2697
|
+
/* @__PURE__ */ c(gl, { path: e, documentName: t, iconOnly: n, session: r, previewAvailable: o }),
|
|
2697
2698
|
r.history ? /* @__PURE__ */ F("button", { type: "button", ...m(l.historyOpen), title: l.historyOpen, "aria-haspopup": "dialog", "data-testid": "markdown-explorer-edit-history", onClick: () => p(!0), onDoubleClick: ae, children: [
|
|
2698
|
-
/* @__PURE__ */ c(
|
|
2699
|
+
/* @__PURE__ */ c(Wi, { "aria-hidden": "true" }),
|
|
2699
2700
|
n ? null : /* @__PURE__ */ c("span", { children: l.historyOpen })
|
|
2700
2701
|
] }) : null,
|
|
2701
2702
|
r.save.kind === "draft" ? null : /* @__PURE__ */ F("button", { type: "button", ...m(l.saveDraft), title: l.saveDraftTooltip, "aria-disabled": u, "aria-busy": f, "aria-keyshortcuts": "Control+S Meta+S", "data-testid": "markdown-explorer-edit-save", onClick: v, onDoubleClick: ae, children: [
|
|
2702
|
-
/* @__PURE__ */ c(
|
|
2703
|
+
/* @__PURE__ */ c(Yi, { "aria-hidden": "true" }),
|
|
2703
2704
|
n ? null : /* @__PURE__ */ c("span", { children: l.saveDraft })
|
|
2704
2705
|
] }),
|
|
2705
|
-
r.history ? /* @__PURE__ */ c(
|
|
2706
|
+
r.history ? /* @__PURE__ */ c(dl, { path: e, documentName: t, open: d, onClose: () => p(!1) }) : null
|
|
2706
2707
|
] });
|
|
2707
|
-
},
|
|
2708
|
+
}, El = ({ path: e, session: t }) => {
|
|
2708
2709
|
const { edits: n } = D();
|
|
2709
|
-
return t.save.kind !== "grant" ? null : /* @__PURE__ */ c(
|
|
2710
|
+
return t.save.kind !== "grant" ? null : /* @__PURE__ */ c(ol, { href: t.save.href, onRetry: () => {
|
|
2710
2711
|
n.save(e);
|
|
2711
2712
|
}, testId: "markdown-explorer-save-grant" });
|
|
2712
|
-
},
|
|
2713
|
+
}, yl = (e) => {
|
|
2713
2714
|
const { documents: t } = D(), n = $(() => t.peek(e), [t, e]), r = $(() => t.peekSeeded(e), [t, e]), o = ee(t.subscribe, n, r);
|
|
2714
2715
|
return de(o)?.document.kind === "markdown";
|
|
2715
|
-
},
|
|
2716
|
+
}, kl = (e) => {
|
|
2716
2717
|
const { config: t } = D(), n = Pe(), r = $(() => n(pe(t, { ...e, markup: !e.markup }), "browse"), [t, n, e]);
|
|
2717
2718
|
return U(() => ({ shown: e.markup, toggle: r }), [e.markup, r]);
|
|
2718
|
-
},
|
|
2719
|
-
const { documents: n, announcer: r, labels: o } = D(), i = $(() => n.peek(e), [n, e]), l = $(() => n.peekSeeded(e), [n, e]), d = ee(n.subscribe, i, l), p = $(() => n.answerStampOf(e), [n, e]), f = ee(n.subscribe, p, p), [u] = B(() => /* @__PURE__ */ new Set()), [v, m] = B(
|
|
2719
|
+
}, xl = /* @__PURE__ */ new Set(), Sl = (e, t) => {
|
|
2720
|
+
const { documents: n, announcer: r, labels: o } = D(), i = $(() => n.peek(e), [n, e]), l = $(() => n.peekSeeded(e), [n, e]), d = ee(n.subscribe, i, l), p = $(() => n.answerStampOf(e), [n, e]), f = ee(n.subscribe, p, p), [u] = B(() => /* @__PURE__ */ new Set()), [v, m] = B(xl), [y, A] = B(null);
|
|
2720
2721
|
y !== null && y.path !== e && A(null);
|
|
2721
2722
|
const k = q(null);
|
|
2722
2723
|
Z(() => (k.current = e, () => {
|
|
@@ -2743,12 +2744,12 @@ const nl = /* @__PURE__ */ b.forwardRef(tl), rl = ({ href: e, onRetry: t, testId
|
|
|
2743
2744
|
})();
|
|
2744
2745
|
}, [e, t, u, n, r, o]), M = v.has(e), T = y !== null && y.path === e && y.stamp === f ? y.failure : null;
|
|
2745
2746
|
return { refreshing: M, unavailable: M || d?.status === "pending", failure: T, refresh: S };
|
|
2746
|
-
},
|
|
2747
|
-
const { labels: r } = D(), { refreshing: o, unavailable: i, failure: l, refresh: d } =
|
|
2747
|
+
}, Rl = Object.freeze({ kind: "page" }), Tl = ({ path: e, placement: t, markup: n }) => {
|
|
2748
|
+
const { labels: r } = D(), { refreshing: o, unavailable: i, failure: l, refresh: d } = Sl(e, t.kind === "page"), p = yl(e), f = ul(e), u = sn(e), v = t.kind === "panel" ? r.refreshDocumentNamed(t.documentName) : null, m = t.kind === "panel" ? r.showMarkupNamed(t.documentName) : null, y = t.kind === "panel", A = t.kind === "panel" ? t.documentName : f.name, k = t.kind === "page" || t.maximized;
|
|
2748
2749
|
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: [
|
|
2749
2750
|
/* @__PURE__ */ F("div", { className: "aqmx-document-refresh-row", children: [
|
|
2750
|
-
u === void 0 ? null : /* @__PURE__ */ c(
|
|
2751
|
-
u === void 0 ? null : /* @__PURE__ */ c(
|
|
2751
|
+
u === void 0 ? null : /* @__PURE__ */ c(hl, { session: u }),
|
|
2752
|
+
u === void 0 ? null : /* @__PURE__ */ c(bl, { path: e, documentName: A, iconOnly: y, session: u, previewAvailable: k }),
|
|
2752
2753
|
u === void 0 && p ? /* @__PURE__ */ F(
|
|
2753
2754
|
"button",
|
|
2754
2755
|
{
|
|
@@ -2766,7 +2767,7 @@ const nl = /* @__PURE__ */ b.forwardRef(tl), rl = ({ href: e, onRetry: t, testId
|
|
|
2766
2767
|
]
|
|
2767
2768
|
}
|
|
2768
2769
|
) : null,
|
|
2769
|
-
u !== void 0 || f.edit?.kind === "inline" || f.edit?.kind === "draft" ? /* @__PURE__ */ c(
|
|
2770
|
+
u !== void 0 || f.edit?.kind === "inline" || f.edit?.kind === "draft" ? /* @__PURE__ */ c(fl, { path: e, documentName: A, iconOnly: y, previewAvailable: k, draft: f.edit?.kind === "draft" }) : f.edit?.kind === "external" ? /* @__PURE__ */ c(ml, { href: f.edit.href, documentName: A, iconOnly: y }) : null,
|
|
2770
2771
|
u === void 0 ? /* @__PURE__ */ F(
|
|
2771
2772
|
"button",
|
|
2772
2773
|
{
|
|
@@ -2781,27 +2782,27 @@ const nl = /* @__PURE__ */ b.forwardRef(tl), rl = ({ href: e, onRetry: t, testId
|
|
|
2781
2782
|
onClick: d,
|
|
2782
2783
|
onDoubleClick: ae,
|
|
2783
2784
|
children: [
|
|
2784
|
-
/* @__PURE__ */ c(
|
|
2785
|
+
/* @__PURE__ */ c(Hi, { "aria-hidden": "true" }),
|
|
2785
2786
|
v === null ? /* @__PURE__ */ c("span", { children: r.refreshDocumentLabel }) : null
|
|
2786
2787
|
]
|
|
2787
2788
|
}
|
|
2788
2789
|
) : null
|
|
2789
2790
|
] }),
|
|
2790
2791
|
u !== void 0 || l === null ? null : /* @__PURE__ */ c("p", { className: "aqmx-document-refresh-failure", "data-testid": "markdown-explorer-document-refresh-failure", "data-aqmx-failure": l.reason, children: r.documentRefreshFailed(se(r, l.reason)) }),
|
|
2791
|
-
u === void 0 ? null : /* @__PURE__ */ c(
|
|
2792
|
+
u === void 0 ? null : /* @__PURE__ */ c(El, { path: e, session: u })
|
|
2792
2793
|
] });
|
|
2793
|
-
},
|
|
2794
|
-
const t = e.doc, n = U(() => ({ kind: "page", view: "single", overrides: e.overrides, embed: e.embed }), [e.overrides, e.embed]), r =
|
|
2794
|
+
}, Cl = ({ location: e }) => {
|
|
2795
|
+
const t = e.doc, n = U(() => ({ kind: "page", view: "single", overrides: e.overrides, embed: e.embed }), [e.overrides, e.embed]), r = kl(e);
|
|
2795
2796
|
return /* @__PURE__ */ F("div", { className: "aqmx-single aqmx-document-column", "data-testid": "markdown-explorer-single", children: [
|
|
2796
|
-
/* @__PURE__ */ c(
|
|
2797
|
-
/* @__PURE__ */ c(
|
|
2797
|
+
/* @__PURE__ */ c(Tl, { path: t, placement: Rl, markup: r }),
|
|
2798
|
+
/* @__PURE__ */ c(Ii, { path: t, markup: e.markup, variant: n })
|
|
2798
2799
|
] });
|
|
2799
|
-
},
|
|
2800
|
+
}, Ol = ({ holds: e, testId: t }) => {
|
|
2800
2801
|
const { labels: n, announcer: r } = D(), o = ve();
|
|
2801
2802
|
Z(() => e ? r.claim(o) : void 0, [e, r, o]);
|
|
2802
2803
|
const i = $(() => r.shownIn(o), [r, o]), l = ee(r.subscribe, i, i);
|
|
2803
2804
|
return /* @__PURE__ */ c("div", { className: "aqmx-sr-only", role: "status", "aria-live": "polite", "aria-atomic": "true", "data-testid": t, children: l.length > 1 ? n.announcementSequence(l) : l[0] });
|
|
2804
|
-
}, ue = Object.freeze([]),
|
|
2805
|
+
}, ue = Object.freeze([]), Al = (e) => {
|
|
2805
2806
|
const t = /* @__PURE__ */ new Set();
|
|
2806
2807
|
let n = ue, r = [], o = !1;
|
|
2807
2808
|
const i = [], l = (u) => {
|
|
@@ -2836,13 +2837,13 @@ const nl = /* @__PURE__ */ b.forwardRef(tl), rl = ({ href: e, onRetry: t, testId
|
|
|
2836
2837
|
},
|
|
2837
2838
|
shownIn: (u) => d() === u ? n : ue
|
|
2838
2839
|
};
|
|
2839
|
-
}, he = Object.freeze({ status: "cancelled" }),
|
|
2840
|
+
}, he = Object.freeze({ status: "cancelled" }), Ll = (e) => {
|
|
2840
2841
|
if (e === null || typeof e != "object") return null;
|
|
2841
2842
|
const { failure: t } = e;
|
|
2842
2843
|
if (Yn(t) !== null) return null;
|
|
2843
2844
|
const { reason: n, code: r } = t;
|
|
2844
2845
|
return Jn(n, r);
|
|
2845
|
-
},
|
|
2846
|
+
}, Ml = ({ dataPath: e, onScope: t, fetch: n }) => {
|
|
2846
2847
|
const r = n ?? ((f, u) => globalThis.fetch(f, u)), o = (f, u) => `${e}/${f}?${new URLSearchParams(u).toString()}`, i = async (f, u, v, m) => {
|
|
2847
2848
|
let y;
|
|
2848
2849
|
try {
|
|
@@ -2866,7 +2867,7 @@ const nl = /* @__PURE__ */ b.forwardRef(tl), rl = ({ href: e, onRetry: t, testId
|
|
|
2866
2867
|
S = !1;
|
|
2867
2868
|
}
|
|
2868
2869
|
if (S) return k;
|
|
2869
|
-
const M =
|
|
2870
|
+
const M = Ll(k);
|
|
2870
2871
|
return m(M !== null ? M : { reason: y.status === 200 ? "failed" : pt(y.status) });
|
|
2871
2872
|
}, l = { [wt]: Qn }, d = { [wt]: or, "Content-Type": `${rr}; charset=utf-8` }, p = async (f, u, v) => {
|
|
2872
2873
|
const m = await i(f, u, v, (y) => He(y.reason, y.code));
|
|
@@ -2898,7 +2899,7 @@ const nl = /* @__PURE__ */ b.forwardRef(tl), rl = ({ href: e, onRetry: t, testId
|
|
|
2898
2899
|
revision: (f, u, v) => p(o("revision", { [W.path]: f, [W.revision]: u }), { method: "GET", signal: v }, er),
|
|
2899
2900
|
refresh: (f) => i(o("refresh", { [W.source]: f }), { method: "POST", headers: l }, vt, (u) => ({ status: "error", failure: u }))
|
|
2900
2901
|
};
|
|
2901
|
-
},
|
|
2902
|
+
}, Nl = () => {
|
|
2902
2903
|
let e = null, t = null;
|
|
2903
2904
|
return {
|
|
2904
2905
|
settle: (n) => {
|
|
@@ -2913,7 +2914,7 @@ const nl = /* @__PURE__ */ b.forwardRef(tl), rl = ({ href: e, onRetry: t, testId
|
|
|
2913
2914
|
return t = null, o;
|
|
2914
2915
|
}
|
|
2915
2916
|
};
|
|
2916
|
-
},
|
|
2917
|
+
}, Dl = (e) => {
|
|
2917
2918
|
const t = en(e);
|
|
2918
2919
|
if (t === null) return ht;
|
|
2919
2920
|
try {
|
|
@@ -2925,7 +2926,7 @@ const nl = /* @__PURE__ */ b.forwardRef(tl), rl = ({ href: e, onRetry: t, testId
|
|
|
2925
2926
|
let n = null;
|
|
2926
2927
|
const r = () => {
|
|
2927
2928
|
if (n === null) {
|
|
2928
|
-
const i =
|
|
2929
|
+
const i = Dl(e);
|
|
2929
2930
|
n = { changes: i, settings: mt(t, i) };
|
|
2930
2931
|
}
|
|
2931
2932
|
return n;
|
|
@@ -2941,7 +2942,7 @@ const nl = /* @__PURE__ */ b.forwardRef(tl), rl = ({ href: e, onRetry: t, testId
|
|
|
2941
2942
|
return n = { changes: p, settings: mt(t, p) }, o.emit(), Qt(e, In(p)), n.settings;
|
|
2942
2943
|
}
|
|
2943
2944
|
};
|
|
2944
|
-
},
|
|
2945
|
+
}, Pl = Object.freeze({ status: "refreshed" }), $l = Object.freeze({ status: "superseded" }), et = Object.freeze({ status: "deferred" }), Fl = hn(et), On = 4, ql = On - 1, Ht = Object.freeze({ status: "loading" }), _l = Object.freeze({ status: "error", failure: Object.freeze({ reason: "failed" }) }), Bl = (e) => {
|
|
2945
2946
|
const t = /* @__PURE__ */ new Map(), n = mn(), r = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map(), d = ke(), p = /* @__PURE__ */ new Set();
|
|
2946
2947
|
let f = 0, u = 0;
|
|
2947
2948
|
const v = { direct: null, bulk: null }, m = /* @__PURE__ */ new Set();
|
|
@@ -2996,7 +2997,7 @@ const nl = /* @__PURE__ */ b.forwardRef(tl), rl = ({ href: e, onRetry: t, testId
|
|
|
2996
2997
|
const C = { controller: new AbortController(), lane: x };
|
|
2997
2998
|
M(w).inFlight.set(E, C), f += 1, x === "bulk" && (u += 1), e.children(w, E, C.controller.signal).then(
|
|
2998
2999
|
(P) => L(w, E, C, P),
|
|
2999
|
-
() => L(w, E, C,
|
|
3000
|
+
() => L(w, E, C, _l)
|
|
3000
3001
|
);
|
|
3001
3002
|
}, N = () => {
|
|
3002
3003
|
for (; f < On; ) {
|
|
@@ -3005,7 +3006,7 @@ const nl = /* @__PURE__ */ b.forwardRef(tl), rl = ({ href: e, onRetry: t, testId
|
|
|
3005
3006
|
O(w.sourceId, w.path, "direct");
|
|
3006
3007
|
continue;
|
|
3007
3008
|
}
|
|
3008
|
-
const E = u <
|
|
3009
|
+
const E = u < ql ? R("bulk") : null;
|
|
3009
3010
|
if (E === null) return;
|
|
3010
3011
|
O(E.sourceId, E.path, "bulk");
|
|
3011
3012
|
}
|
|
@@ -3051,7 +3052,7 @@ const nl = /* @__PURE__ */ b.forwardRef(tl), rl = ({ href: e, onRetry: t, testId
|
|
|
3051
3052
|
e.tree(w).then((C) => J(w, E, x, C));
|
|
3052
3053
|
};
|
|
3053
3054
|
return {
|
|
3054
|
-
read: (w) => t.get(w)?.promise ??
|
|
3055
|
+
read: (w) => t.get(w)?.promise ?? Fl,
|
|
3055
3056
|
open: (w) => {
|
|
3056
3057
|
const E = n.resumes(w), x = n.hold(w), C = t.get(w);
|
|
3057
3058
|
return C === void 0 || H(w, "deferred") ? (X(w, !0), k()) : E || (C.opened && H(w, "error") ? (X(w, !0), k()) : (C.opened = !0, C.stale && H(w, "ok") && oe(w, C))), x;
|
|
@@ -3079,7 +3080,7 @@ const nl = /* @__PURE__ */ b.forwardRef(tl), rl = ({ href: e, onRetry: t, testId
|
|
|
3079
3080
|
const E = (i.get(w) ?? 0) + 1;
|
|
3080
3081
|
i.set(w, E);
|
|
3081
3082
|
const x = await e.refresh(w);
|
|
3082
|
-
if (i.get(w) !== E) return
|
|
3083
|
+
if (i.get(w) !== E) return $l;
|
|
3083
3084
|
if (x.status === "error") return { status: "failed", failure: x.failure };
|
|
3084
3085
|
const C = t.get(w);
|
|
3085
3086
|
if (!(C !== void 0 && C.loadedAt !== null && H(w, "ok") && C.loadedAt > x.loadedAt)) {
|
|
@@ -3091,7 +3092,7 @@ const nl = /* @__PURE__ */ b.forwardRef(tl), rl = ({ href: e, onRetry: t, testId
|
|
|
3091
3092
|
}
|
|
3092
3093
|
for (const [_, G] of t)
|
|
3093
3094
|
_ !== w && Re(G.promise)?.status === "ok" && (G.stale = !0);
|
|
3094
|
-
return
|
|
3095
|
+
return Pl;
|
|
3095
3096
|
},
|
|
3096
3097
|
children: (w, E) => r.get(w)?.get(E),
|
|
3097
3098
|
claimChildren: (w, E) => {
|
|
@@ -3137,7 +3138,7 @@ const nl = /* @__PURE__ */ b.forwardRef(tl), rl = ({ href: e, onRetry: t, testId
|
|
|
3137
3138
|
subscribe: d.subscribe,
|
|
3138
3139
|
version: () => A
|
|
3139
3140
|
};
|
|
3140
|
-
},
|
|
3141
|
+
}, Il = (e, t) => {
|
|
3141
3142
|
let n = e;
|
|
3142
3143
|
const r = ke();
|
|
3143
3144
|
return {
|
|
@@ -3147,26 +3148,26 @@ const nl = /* @__PURE__ */ b.forwardRef(tl), rl = ({ href: e, onRetry: t, testId
|
|
|
3147
3148
|
n = { ...n, ...o }, t(n), r.emit();
|
|
3148
3149
|
}
|
|
3149
3150
|
};
|
|
3150
|
-
},
|
|
3151
|
+
}, jl = 1;
|
|
3151
3152
|
let Te = 0, ce = null;
|
|
3152
|
-
const
|
|
3153
|
+
const Hl = () => {
|
|
3153
3154
|
const { documentElement: e, body: t } = document;
|
|
3154
3155
|
Te === 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"), Te += 1;
|
|
3155
3156
|
let n = !1;
|
|
3156
3157
|
return () => {
|
|
3157
3158
|
n || (n = !0, Te -= 1, !(Te > 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));
|
|
3158
3159
|
};
|
|
3159
|
-
},
|
|
3160
|
+
}, Vl = [
|
|
3160
3161
|
{ selector: '[data-aqmx-document-flow="fill"]', name: "document region" },
|
|
3161
3162
|
{ selector: "[data-aqmx-explorer-body]", name: "tree area" }
|
|
3162
|
-
], Vt = 1, zt = (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.",
|
|
3163
|
+
], Vt = 1, zt = (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.", zl = (e) => {
|
|
3163
3164
|
if (!zt(e)) return null;
|
|
3164
3165
|
const t = e.getBoundingClientRect(), n = window.innerHeight;
|
|
3165
|
-
if (t.bottom > n +
|
|
3166
|
+
if (t.bottom > n + jl)
|
|
3166
3167
|
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}`;
|
|
3167
3168
|
if (t.height < Vt)
|
|
3168
3169
|
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}`;
|
|
3169
|
-
for (const { selector: r, name: o } of
|
|
3170
|
+
for (const { selector: r, name: o } of Vl)
|
|
3170
3171
|
for (const i of e.querySelectorAll(r)) {
|
|
3171
3172
|
if (!zt(i)) continue;
|
|
3172
3173
|
const l = i.getBoundingClientRect().height;
|
|
@@ -3174,37 +3175,37 @@ const jl = () => {
|
|
|
3174
3175
|
return `[markdown-explorer] the explorer's ${o} collapsed to ${String(Math.round(l))}px while lockDocumentScroll stops the page from scrolling, so it cannot be read. ${Ke}`;
|
|
3175
3176
|
}
|
|
3176
3177
|
return null;
|
|
3177
|
-
},
|
|
3178
|
+
}, Ul = (e) => {
|
|
3178
3179
|
let t = !1;
|
|
3179
3180
|
const n = () => {
|
|
3180
3181
|
if (t) return;
|
|
3181
|
-
const o =
|
|
3182
|
+
const o = zl(e);
|
|
3182
3183
|
o !== null && (t = !0, console.error(o));
|
|
3183
3184
|
}, r = typeof ResizeObserver > "u" ? null : new ResizeObserver(n);
|
|
3184
3185
|
return r?.observe(e), window.addEventListener("resize", n), n(), () => {
|
|
3185
3186
|
r?.disconnect(), window.removeEventListener("resize", n);
|
|
3186
3187
|
};
|
|
3187
|
-
},
|
|
3188
|
-
te(() => e ?
|
|
3188
|
+
}, Zl = (e, t) => {
|
|
3189
|
+
te(() => e ? Hl() : void 0, [e]), te(() => {
|
|
3189
3190
|
const n = t.current;
|
|
3190
3191
|
if (!(!e || n === null))
|
|
3191
|
-
return
|
|
3192
|
+
return Ul(n);
|
|
3192
3193
|
}, [e, t]);
|
|
3193
|
-
}, Ut = '[data-testid="markdown-explorer-view-switch"]',
|
|
3194
|
+
}, Ut = '[data-testid="markdown-explorer-view-switch"]', Gl = [
|
|
3194
3195
|
{ control: Ut, successors: [Ut, '[data-testid="markdown-explorer-sheet-toggle"]'] },
|
|
3195
3196
|
{ control: '[data-testid="markdown-explorer-selection-open"]', successors: ['[data-testid="markdown-explorer-panel-frame"]'] }
|
|
3196
|
-
],
|
|
3197
|
-
for (const t of
|
|
3197
|
+
], Kl = (e) => {
|
|
3198
|
+
for (const t of Gl) {
|
|
3198
3199
|
const n = e.closest(t.control);
|
|
3199
3200
|
if (n !== null) return { element: n, control: t };
|
|
3200
3201
|
}
|
|
3201
3202
|
return null;
|
|
3202
|
-
},
|
|
3203
|
+
}, Wl = (e, t) => {
|
|
3203
3204
|
const n = q(null);
|
|
3204
3205
|
te(() => {
|
|
3205
3206
|
const o = (d) => {
|
|
3206
3207
|
const p = e.current;
|
|
3207
|
-
n.current = p !== null && d instanceof Element && p.contains(d) ?
|
|
3208
|
+
n.current = p !== null && d instanceof Element && p.contains(d) ? Kl(d) : null;
|
|
3208
3209
|
}, i = (d) => o(d.target);
|
|
3209
3210
|
o(document.activeElement);
|
|
3210
3211
|
const l = (d) => {
|
|
@@ -3242,7 +3243,7 @@ const jl = () => {
|
|
|
3242
3243
|
});
|
|
3243
3244
|
return d.observe(l, { childList: !0, subtree: !0 }), () => d.disconnect();
|
|
3244
3245
|
}, [t, e]);
|
|
3245
|
-
},
|
|
3246
|
+
}, Xl = tt(() => import("./TreeLayout-rhyVTfrI.js").then((e) => ({ default: e.TreeLayout }))), Yl = tt(() => import("./MultiLayout-D8F0BfxA.js").then((e) => ({ default: e.MultiLayout }))), Jl = 64, Ql = {
|
|
3246
3247
|
request: (e) => {
|
|
3247
3248
|
requestAnimationFrame(e);
|
|
3248
3249
|
}
|
|
@@ -3251,12 +3252,12 @@ const jl = () => {
|
|
|
3251
3252
|
}, We = (e, t) => {
|
|
3252
3253
|
t.tree !== null && e.trees.seed(t.tree.sourceId, t.tree.result);
|
|
3253
3254
|
for (const { path: n, document: r } of t.documents) e.documents.seed(n, r);
|
|
3254
|
-
},
|
|
3255
|
+
}, ea = (e, t) => {
|
|
3255
3256
|
const [n, r] = B(() => ({ overrides: t, locale: e, labels: yt(e, t) }));
|
|
3256
|
-
if (n.locale === e &&
|
|
3257
|
+
if (n.locale === e && yr(n.overrides, t)) return n.labels;
|
|
3257
3258
|
const o = { overrides: t, locale: e, labels: yt(e, t) };
|
|
3258
3259
|
return r(o), o.labels;
|
|
3259
|
-
},
|
|
3260
|
+
}, ta = (e, t, n) => {
|
|
3260
3261
|
const [r, o] = B(() => ({ scope: t, store: jt(e, n) }));
|
|
3261
3262
|
if (r.scope === t && r.store.storageKey === e && r.store.defaults === n) return r.store;
|
|
3262
3263
|
const i = { scope: t, store: jt(e, n) };
|
|
@@ -3266,13 +3267,13 @@ const jl = () => {
|
|
|
3266
3267
|
if (n.scope === e) return n.value;
|
|
3267
3268
|
const o = { scope: e, value: t() };
|
|
3268
3269
|
return r(o), o.value;
|
|
3269
|
-
},
|
|
3270
|
+
}, na = () => Al(Ql), Gt = "on", ra = "off", oa = Object.freeze({ kind: "unavailable" }), ia = (e) => {
|
|
3270
3271
|
if (e !== void 0 && (e === null || typeof e != "object" || typeof e.convert != "function"))
|
|
3271
3272
|
throw new TypeError("[markdown-explorer] draftConverter must be an object with a convert function");
|
|
3272
|
-
},
|
|
3273
|
+
}, la = (e, t) => {
|
|
3273
3274
|
const n = de(e.peek(t));
|
|
3274
3275
|
return n === null || n.document.kind === "failure" ? ye(t) : n.document.name;
|
|
3275
|
-
},
|
|
3276
|
+
}, ka = ({
|
|
3276
3277
|
data: e,
|
|
3277
3278
|
config: t,
|
|
3278
3279
|
storageNamespace: n,
|
|
@@ -3286,17 +3287,17 @@ const jl = () => {
|
|
|
3286
3287
|
onEditGrant: u,
|
|
3287
3288
|
draftConverter: v
|
|
3288
3289
|
}) => {
|
|
3289
|
-
ur(n),
|
|
3290
|
-
const m = rn(r), y =
|
|
3290
|
+
ur(n), ia(v);
|
|
3291
|
+
const m = rn(r), y = kr(i), A = ea(m, o), { revalidate: k } = $n(), S = q(() => {
|
|
3291
3292
|
}), M = De(t.dataPath), [T] = B(() => {
|
|
3292
|
-
const x =
|
|
3293
|
+
const x = Ml({ dataPath: M, onScope: (P) => S.current(P) }), C = { documents: co({ client: x, capacity: Math.max(Jl, t.multiView.maxPanels * 2) }), trees: Bl(x) };
|
|
3293
3294
|
return We(C, e), bt(n, e.scope), { data: x, ...C, aligned: { pageData: e, storageNamespace: n, pendingReader: null } };
|
|
3294
3295
|
});
|
|
3295
3296
|
if (T.aligned.pageData !== e || T.aligned.storageNamespace !== n) {
|
|
3296
3297
|
const x = T.aligned.pageData;
|
|
3297
3298
|
T.aligned.pageData = e, T.aligned.storageNamespace = n, x !== e && (x.scope !== e.scope ? T.aligned.pendingReader = e : We(T, e)), bt(n, e.scope);
|
|
3298
3299
|
}
|
|
3299
|
-
const a =
|
|
3300
|
+
const a = ta(Ve(n).treeSettings, e.scope, t.defaultTreeSettings);
|
|
3300
3301
|
Z(() => {
|
|
3301
3302
|
const x = T.aligned.pendingReader;
|
|
3302
3303
|
x !== null && (T.aligned.pendingReader = null, Zt(T), We(T, x));
|
|
@@ -3314,26 +3315,26 @@ const jl = () => {
|
|
|
3314
3315
|
s.current = t.settingsCookie;
|
|
3315
3316
|
}, [t.settingsCookie]);
|
|
3316
3317
|
const [h] = B(
|
|
3317
|
-
() =>
|
|
3318
|
+
() => Il(e.settings, (x) => {
|
|
3318
3319
|
document.cookie = Vn(s.current, x, window.location.protocol === "https:");
|
|
3319
3320
|
})
|
|
3320
|
-
), g = Xe(e.scope,
|
|
3321
|
+
), g = Xe(e.scope, na), R = Xe(e.scope, Nl), L = q(A);
|
|
3321
3322
|
Z(() => {
|
|
3322
3323
|
L.current = A;
|
|
3323
3324
|
}, [A]);
|
|
3324
3325
|
const O = Xe(
|
|
3325
3326
|
e.scope,
|
|
3326
|
-
() =>
|
|
3327
|
+
() => Mr({
|
|
3327
3328
|
data: T.data,
|
|
3328
3329
|
conflictLabels: () => ({ ours: L.current.conflictOurs, theirs: L.current.conflictTheirs }),
|
|
3329
3330
|
onSaveSettled: (x, C) => {
|
|
3330
3331
|
C.kind === "saved" && T.documents.refresh(x);
|
|
3331
|
-
const P =
|
|
3332
|
+
const P = Sr(L.current, C, la(T.documents, x));
|
|
3332
3333
|
P !== null && g.announce(P);
|
|
3333
3334
|
},
|
|
3334
3335
|
sideBySideSetting: {
|
|
3335
3336
|
read: () => en(Ve(n).editPreview) === Gt,
|
|
3336
|
-
write: (x) => Qt(Ve(n).editPreview, x ? Gt :
|
|
3337
|
+
write: (x) => Qt(Ve(n).editPreview, x ? Gt : ra)
|
|
3337
3338
|
}
|
|
3338
3339
|
})
|
|
3339
3340
|
), N = U(() => Ee(e.notices.catch(() => [])), [e.notices]), j = e.sources.map((x) => x.id).join(`
|
|
@@ -3353,7 +3354,7 @@ const jl = () => {
|
|
|
3353
3354
|
return {
|
|
3354
3355
|
convert: (C, P) => {
|
|
3355
3356
|
const _ = H.current;
|
|
3356
|
-
return _ === void 0 ? Promise.resolve(
|
|
3357
|
+
return _ === void 0 ? Promise.resolve(oa) : _.convert(C, P);
|
|
3357
3358
|
},
|
|
3358
3359
|
prepare: () => {
|
|
3359
3360
|
try {
|
|
@@ -3389,75 +3390,75 @@ const jl = () => {
|
|
|
3389
3390
|
}),
|
|
3390
3391
|
[I, A, m, y, n, e.scope, e.sources, N, T, h, a, g, R, O, u, w, d, J]
|
|
3391
3392
|
);
|
|
3392
|
-
return /* @__PURE__ */ c(on, { value: E, children: /* @__PURE__ */ c(
|
|
3393
|
-
},
|
|
3394
|
-
const [o] = B(
|
|
3393
|
+
return /* @__PURE__ */ c(on, { value: E, children: /* @__PURE__ */ c(sa, { renderFrame: l, lockDocumentScroll: p }, e.scope) });
|
|
3394
|
+
}, aa = ({ ref: e, theme: t, view: n, children: r }) => {
|
|
3395
|
+
const [o] = B(Ko);
|
|
3395
3396
|
return /* @__PURE__ */ c("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 });
|
|
3396
|
-
},
|
|
3397
|
+
}, sa = ({ renderFrame: e, lockDocumentScroll: t }) => {
|
|
3397
3398
|
const { theme: n, labels: r } = D(), o = nt(), { hash: i } = Wt(), l = Pe(), d = q(null);
|
|
3398
|
-
|
|
3399
|
+
Zl(t, d), Z(() => {
|
|
3399
3400
|
o.kind === "redirect" && l(`${o.href}${i}`, "browse");
|
|
3400
3401
|
}, [o, i, l]);
|
|
3401
3402
|
const { location: p } = o, f = p.view;
|
|
3402
|
-
|
|
3403
|
-
const u = p.view === "tree" ? /* @__PURE__ */ c(we, { fallback: /* @__PURE__ */ c("section", { className: "aqmx-split-fallback", "aria-label": r.explorerRegion, "aria-busy": "true", "data-testid": "markdown-explorer-split-loading" }), children: /* @__PURE__ */ c(
|
|
3403
|
+
Wl(d, f);
|
|
3404
|
+
const u = p.view === "tree" ? /* @__PURE__ */ c(we, { fallback: /* @__PURE__ */ c("section", { className: "aqmx-split-fallback", "aria-label": r.explorerRegion, "aria-busy": "true", "data-testid": "markdown-explorer-split-loading" }), children: /* @__PURE__ */ c(Xl, { location: p }) }) : p.view === "multi" ? /* @__PURE__ */ c(we, { fallback: /* @__PURE__ */ c("section", { className: "aqmx-stage-fallback", "aria-label": r.multiRegion, "aria-busy": "true", "data-testid": "markdown-explorer-stage-loading" }), children: /* @__PURE__ */ c(Yl, { location: p }) }) : /* @__PURE__ */ c(Cl, { location: p }), v = /* @__PURE__ */ F(aa, { ref: d, theme: n, view: f, children: [
|
|
3404
3405
|
u,
|
|
3405
|
-
/* @__PURE__ */ c(
|
|
3406
|
-
/* @__PURE__ */ c(
|
|
3406
|
+
/* @__PURE__ */ c(qr, {}),
|
|
3407
|
+
/* @__PURE__ */ c(Ol, { holds: !0, testId: "markdown-explorer-announcer" })
|
|
3407
3408
|
] });
|
|
3408
3409
|
return e === void 0 ? v : e({ view: f, children: v });
|
|
3409
|
-
},
|
|
3410
|
+
}, xa = mr({ submissions: "skip", otherPath: "skip", query: "skip", hashChange: "skip" });
|
|
3410
3411
|
export {
|
|
3411
3412
|
Qe as A,
|
|
3412
|
-
|
|
3413
|
-
|
|
3414
|
-
|
|
3415
|
-
|
|
3413
|
+
Ea as B,
|
|
3414
|
+
Rr as C,
|
|
3415
|
+
Tl as D,
|
|
3416
|
+
ol as E,
|
|
3416
3417
|
ge as F,
|
|
3417
3418
|
un as G,
|
|
3418
|
-
|
|
3419
|
-
|
|
3420
|
-
|
|
3421
|
-
|
|
3422
|
-
|
|
3423
|
-
|
|
3419
|
+
Hi as H,
|
|
3420
|
+
Yo as I,
|
|
3421
|
+
oo as J,
|
|
3422
|
+
Qi as K,
|
|
3423
|
+
ao as L,
|
|
3424
|
+
ro as M,
|
|
3424
3425
|
nt as N,
|
|
3425
|
-
|
|
3426
|
-
|
|
3426
|
+
Ol as O,
|
|
3427
|
+
Rl as P,
|
|
3427
3428
|
Ae as Q,
|
|
3428
|
-
|
|
3429
|
+
hr as R,
|
|
3429
3430
|
kt as S,
|
|
3430
|
-
|
|
3431
|
+
gr as T,
|
|
3431
3432
|
nn as U,
|
|
3432
|
-
|
|
3433
|
+
pr as V,
|
|
3433
3434
|
Et as W,
|
|
3434
|
-
|
|
3435
|
+
ka as X,
|
|
3435
3436
|
yt as Y,
|
|
3436
|
-
|
|
3437
|
+
xa as Z,
|
|
3437
3438
|
Pe as a,
|
|
3438
|
-
|
|
3439
|
-
|
|
3440
|
-
|
|
3441
|
-
|
|
3442
|
-
|
|
3443
|
-
|
|
3444
|
-
|
|
3445
|
-
|
|
3439
|
+
kl as b,
|
|
3440
|
+
Ii as c,
|
|
3441
|
+
Tr as d,
|
|
3442
|
+
Cr as e,
|
|
3443
|
+
Yr as f,
|
|
3444
|
+
Or as g,
|
|
3445
|
+
to as h,
|
|
3446
|
+
Xr as i,
|
|
3446
3447
|
se as j,
|
|
3447
3448
|
de as k,
|
|
3448
|
-
|
|
3449
|
-
|
|
3450
|
-
|
|
3451
|
-
|
|
3452
|
-
|
|
3453
|
-
|
|
3454
|
-
|
|
3449
|
+
no as l,
|
|
3450
|
+
Kr as m,
|
|
3451
|
+
Wr as n,
|
|
3452
|
+
$r as o,
|
|
3453
|
+
ll as p,
|
|
3454
|
+
ba as q,
|
|
3455
|
+
ya as r,
|
|
3455
3456
|
rt as s,
|
|
3456
|
-
|
|
3457
|
+
cl as t,
|
|
3457
3458
|
D as u,
|
|
3458
|
-
|
|
3459
|
-
|
|
3459
|
+
Jr as v,
|
|
3460
|
+
sl as w,
|
|
3460
3461
|
Bt as x,
|
|
3461
|
-
|
|
3462
|
+
al as y,
|
|
3462
3463
|
ke as z
|
|
3463
3464
|
};
|