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