@aiquants/markdown-explorer 0.16.0 → 0.17.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 +82 -15
- package/README.md +43 -18
- package/dist/{EditSurface-DGMLY7Gh.js → EditSurface-0owpPyLE.js} +1 -1
- package/dist/{EditSurface-CwKsTS11.cjs → EditSurface-D-nhilRk.cjs} +1 -1
- package/dist/{ExplorerSplit-tUCp0XdJ.js → ExplorerSplit-8c93p1hy.js} +1 -1
- package/dist/{ExplorerSplit-BLOaU5fE.cjs → ExplorerSplit-bpEvHrCo.cjs} +1 -1
- package/dist/{MultiLayout-BBP2ajz8.cjs → MultiLayout-BXfzR6XC.cjs} +1 -1
- package/dist/{MultiLayout-DYy66vcO.js → MultiLayout-Dy3DD_09.js} +2 -2
- package/dist/NativeScrollBar-CI9fTvkt.js +65 -0
- package/dist/NativeScrollBar-Ddn0iHjv.cjs +1 -0
- package/dist/{TreeLayout-C8s5lBH_.cjs → TreeLayout-CKZ-XQgn.cjs} +1 -1
- package/dist/{TreeLayout-CXX-rFO6.js → TreeLayout-eFQmzpNj.js} +2 -2
- package/dist/core/labels.d.cts +10 -0
- package/dist/core/labels.d.ts +10 -0
- package/dist/index-5gwNJ8CB.cjs +13 -0
- package/dist/{index-DTKGgaok.js → index-h9e3p5Pd.js} +827 -795
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/{merge-BkFru0eg.js → merge-CS3p9BVw.js} +1 -1
- package/dist/{merge-SRws1-Zj.cjs → merge-C_g05UGC.cjs} +1 -1
- package/docs/behavior/dom-hooks.md +5 -2
- package/docs/behavior/layout.md +68 -28
- package/docs/behavior/localization.md +10 -5
- package/package.json +5 -5
- package/dist/NativeScrollBar-BkFg1EcW.cjs +0 -1
- package/dist/NativeScrollBar-Dazd542j.js +0 -59
- package/dist/index-DffJZ8-y.cjs +0 -13
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { jsxs as F, jsx as c, Fragment as Pe } from "react/jsx-runtime";
|
|
2
2
|
import * as y from "react";
|
|
3
|
-
import { createContext as pe, use as ne, useMemo as G, useSyncExternalStore as ee, useRef as _, useLayoutEffect as H, useCallback as P, useId as Se, useEffect as te, Component as tn, Suspense as ke, lazy as it, useState as
|
|
4
|
-
import { useParams as _n, useSearchParams as
|
|
5
|
-
import { j as Un, g as rn, z as Zn, E as on, a as ln, B as Gn, D as
|
|
6
|
-
import { F as
|
|
7
|
-
import { HostedScrollArea as St, useMarkdownToolbarState as br, MarkdownViewer as
|
|
8
|
-
import { SOURCE_LINES_ATTRIBUTE as
|
|
3
|
+
import { createContext as pe, use as ne, useMemo as G, useSyncExternalStore as ee, useRef as _, useLayoutEffect as H, useCallback as P, useId as Se, useEffect as te, Component as tn, Suspense as ke, lazy as it, useState as B, useEffectEvent as le } from "react";
|
|
4
|
+
import { useParams as _n, useSearchParams as In, matchPath as Bn, useBlocker as zn, useNavigate as jn, Link as Hn, useHref as $e, useLocation as nn, useRevalidator as Vn } from "react-router";
|
|
5
|
+
import { j as Un, g as rn, z as Zn, E as on, a as ln, B as Gn, D as wt, G as Wn, H as be, e as ye, I as Kn, J as Xn, K as gt, L as Yn, M as bt, O as Jn, w as Qn, Q as er } from "./location-G7psbmv_.js";
|
|
6
|
+
import { F as se, i as tr, G as nr, y as J, x as rr, H as Et, z as Ve, I as or, J as ir, K as lr, L as ar, N as sr, f as cr, O as yt, v as dr, P as ur, Q as fr, R as mr, B as hr, w as pr, S as vr, T as wr, U as gr, u as xt } from "./dataRoute-CObbjNxG.js";
|
|
7
|
+
import { HostedScrollArea as St, useMarkdownToolbarState as br, MarkdownViewer as an } from "@aiquants/markdown";
|
|
8
|
+
import { SOURCE_LINES_ATTRIBUTE as sn, parseSourceLines as Er } from "@aiquants/markdown/source-lines";
|
|
9
9
|
import { DEFAULT_CONTENT_ALIGN as yr } from "@aiquants/markdown/viewer-settings";
|
|
10
|
-
import { w as Je, r as Qe, a as xr, b as kt, s as
|
|
10
|
+
import { w as Je, r as Qe, a as xr, b as kt, s as we, c as Sr } from "./storage-CmGHg7OA.js";
|
|
11
11
|
import { createShouldRevalidate as kr } from "@aiquants/route-revalidation";
|
|
12
|
-
const
|
|
12
|
+
const Tt = Object.freeze(["en", "ja"]), Tr = "en", Rr = Object.freeze({
|
|
13
13
|
panelMoved: Object.freeze(["title", "column", "position"]),
|
|
14
14
|
panelMoveUnavailable: Object.freeze(["title", "move"]),
|
|
15
15
|
panelDragStarted: Object.freeze(["title"]),
|
|
16
16
|
panelDragCancelled: Object.freeze(["title"]),
|
|
17
17
|
multiColumnRegion: Object.freeze(["column"])
|
|
18
|
-
}),
|
|
18
|
+
}), Mr = /\{(\w+)\}/gu, cn = {
|
|
19
19
|
explorerRegion: "Explorer",
|
|
20
20
|
sourceLabel: "Source",
|
|
21
21
|
refreshTreeLabel: "Refresh tree",
|
|
@@ -221,15 +221,25 @@ const Rt = Object.freeze(["en", "ja"]), Rr = "en", Tr = Object.freeze({
|
|
|
221
221
|
viewerAlignCenter: "Align center",
|
|
222
222
|
viewerAlignRight: "Align right",
|
|
223
223
|
viewerMermaidInteractionMode: "Mouse interaction mode",
|
|
224
|
+
viewerMermaidInteractionModeTouch: "Touch interaction mode",
|
|
224
225
|
viewerMermaidModeNone: "No interaction",
|
|
225
226
|
viewerMermaidModeZoom: "Zoom only",
|
|
226
227
|
viewerMermaidModePan: "Pan only (drag)",
|
|
227
228
|
viewerMermaidModePanShift: "Pan only (Shift+drag)",
|
|
228
229
|
viewerMermaidModeBoth: "Zoom and pan (drag)",
|
|
229
230
|
viewerMermaidModeBothShift: "Zoom and pan (Shift+drag)",
|
|
231
|
+
viewerMermaidModeNoneTouch: "No interaction (a finger scrolls the page)",
|
|
232
|
+
viewerMermaidModeZoomTouch: "Zoom only (two fingers)",
|
|
233
|
+
viewerMermaidModePanTouch: "Pan only (one-finger drag while the diagram overflows)",
|
|
234
|
+
viewerMermaidModeBothTouch: "Zoom and pan (two fingers, one finger while the diagram overflows)",
|
|
230
235
|
viewerMermaidZoomIn: "Zoom In",
|
|
231
236
|
viewerMermaidZoomOut: "Zoom Out",
|
|
232
237
|
viewerMermaidResetView: "Reset View",
|
|
238
|
+
viewerMermaidPanUp: "Pan Up",
|
|
239
|
+
viewerMermaidPanDown: "Pan Down",
|
|
240
|
+
viewerMermaidPanLeft: "Pan Left",
|
|
241
|
+
viewerMermaidPanRight: "Pan Right",
|
|
242
|
+
viewerMermaidDiagram: "Diagram (arrow keys pan, + and - zoom, 0 resets)",
|
|
233
243
|
viewerMermaidRetry: "Try again",
|
|
234
244
|
viewerEmbeddedVideo: "embedded video",
|
|
235
245
|
viewerEmbeddedPost: "embedded post",
|
|
@@ -265,7 +275,7 @@ const Rt = Object.freeze(["en", "ja"]), Rr = "en", Tr = Object.freeze({
|
|
|
265
275
|
multiColumnEmpty: "This column is empty",
|
|
266
276
|
multiColumnRegion: "Column {column}",
|
|
267
277
|
panelDropHere: "Drop the panel here"
|
|
268
|
-
},
|
|
278
|
+
}, Or = {
|
|
269
279
|
explorerRegion: "エクスプローラー",
|
|
270
280
|
sourceLabel: "ソース",
|
|
271
281
|
refreshTreeLabel: "ツリーを更新",
|
|
@@ -471,15 +481,25 @@ const Rt = Object.freeze(["en", "ja"]), Rr = "en", Tr = Object.freeze({
|
|
|
471
481
|
viewerAlignCenter: "中央揃え",
|
|
472
482
|
viewerAlignRight: "右揃え",
|
|
473
483
|
viewerMermaidInteractionMode: "マウス操作モード",
|
|
484
|
+
viewerMermaidInteractionModeTouch: "タッチ操作モード",
|
|
474
485
|
viewerMermaidModeNone: "操作なし",
|
|
475
486
|
viewerMermaidModeZoom: "拡大縮小のみ",
|
|
476
487
|
viewerMermaidModePan: "移動のみ (左ドラッグ)",
|
|
477
488
|
viewerMermaidModePanShift: "移動のみ (Shift+ドラッグ)",
|
|
478
|
-
viewerMermaidModeBoth: "
|
|
479
|
-
viewerMermaidModeBothShift: "
|
|
489
|
+
viewerMermaidModeBoth: "拡大縮小+移動 (左ドラッグ)",
|
|
490
|
+
viewerMermaidModeBothShift: "拡大縮小+移動 (Shift+ドラッグ)",
|
|
491
|
+
viewerMermaidModeNoneTouch: "操作なし (指はページをスクロール)",
|
|
492
|
+
viewerMermaidModeZoomTouch: "拡大縮小のみ (2 本指)",
|
|
493
|
+
viewerMermaidModePanTouch: "移動のみ (はみ出す図を 1 本指でドラッグ)",
|
|
494
|
+
viewerMermaidModeBothTouch: "拡大縮小+移動 (2 本指・はみ出す図は 1 本指)",
|
|
480
495
|
viewerMermaidZoomIn: "拡大",
|
|
481
496
|
viewerMermaidZoomOut: "縮小",
|
|
482
497
|
viewerMermaidResetView: "表示を元に戻す",
|
|
498
|
+
viewerMermaidPanUp: "上へ移動",
|
|
499
|
+
viewerMermaidPanDown: "下へ移動",
|
|
500
|
+
viewerMermaidPanLeft: "左へ移動",
|
|
501
|
+
viewerMermaidPanRight: "右へ移動",
|
|
502
|
+
viewerMermaidDiagram: "図 (矢印キーで移動、+ と - で拡大縮小、0 で元に戻す)",
|
|
483
503
|
viewerMermaidRetry: "再試行",
|
|
484
504
|
viewerEmbeddedVideo: "埋め込みの動画",
|
|
485
505
|
viewerEmbeddedPost: "埋め込みの投稿",
|
|
@@ -515,34 +535,34 @@ const Rt = Object.freeze(["en", "ja"]), Rr = "en", Tr = Object.freeze({
|
|
|
515
535
|
multiColumnEmpty: "この列は空です",
|
|
516
536
|
multiColumnRegion: "{column} 列目",
|
|
517
537
|
panelDropHere: "ここへパネルをドロップ"
|
|
518
|
-
},
|
|
538
|
+
}, Cr = Object.freeze({
|
|
519
539
|
en: Object.freeze(cn),
|
|
520
|
-
ja: Object.freeze(
|
|
521
|
-
}), dn = Object.freeze(Object.keys(cn)), Lr = new Set(dn),
|
|
522
|
-
if (e === void 0) return
|
|
523
|
-
if (
|
|
524
|
-
throw new RangeError(`[markdown-explorer] locale is the UI language (${
|
|
525
|
-
},
|
|
526
|
-
const n =
|
|
540
|
+
ja: Object.freeze(Or)
|
|
541
|
+
}), dn = Object.freeze(Object.keys(cn)), Lr = new Set(dn), Ar = (e) => Lr.has(e), Ce = (e) => e === null ? "null" : typeof e == "string" ? JSON.stringify(e.length > 40 ? `${e.slice(0, 40)}…` : e) : typeof e == "function" ? "a function" : Array.isArray(e) ? "an array" : typeof e, un = (e) => {
|
|
542
|
+
if (e === void 0) return Tr;
|
|
543
|
+
if (Tt.includes(e)) return e;
|
|
544
|
+
throw new RangeError(`[markdown-explorer] locale is the UI language (${Tt.map((t) => JSON.stringify(t)).join(" or ")}), not a BCP 47 tag; got ${Ce(e)}`);
|
|
545
|
+
}, Rt = (e, t) => {
|
|
546
|
+
const n = Cr[un(e)];
|
|
527
547
|
if (t === void 0) return n;
|
|
528
548
|
if (t === null || typeof t != "object")
|
|
529
|
-
throw new RangeError(`[markdown-explorer] labels must be an object; got ${
|
|
549
|
+
throw new RangeError(`[markdown-explorer] labels must be an object; got ${Ce(t)}`);
|
|
530
550
|
if (!Un(t))
|
|
531
|
-
throw new RangeError(`[markdown-explorer] labels must be a plain object; got ${
|
|
551
|
+
throw new RangeError(`[markdown-explorer] labels must be a plain object; got ${Ce(t)}`);
|
|
532
552
|
const r = t, o = { ...n };
|
|
533
553
|
for (const i of Object.keys(r)) {
|
|
534
|
-
if (!
|
|
554
|
+
if (!Ar(i))
|
|
535
555
|
throw new RangeError(`[markdown-explorer] labels.${i} is not a known label key; expected one of ${dn.join(", ")}`);
|
|
536
556
|
const l = r[i];
|
|
537
557
|
if (l === void 0) continue;
|
|
538
558
|
const u = typeof n[i];
|
|
539
559
|
if (typeof l !== u)
|
|
540
|
-
throw new TypeError(`[markdown-explorer] labels.${i} must be a ${u}; got ${
|
|
560
|
+
throw new TypeError(`[markdown-explorer] labels.${i} must be a ${u}; got ${Ce(l)}`);
|
|
541
561
|
if (typeof l == "string" && l.trim() === "")
|
|
542
562
|
throw new RangeError(`[markdown-explorer] labels.${i} must be a non-blank string`);
|
|
543
|
-
const m =
|
|
563
|
+
const m = Rr[i];
|
|
544
564
|
if (typeof l == "string" && m !== void 0) {
|
|
545
|
-
for (const [, f] of l.matchAll(
|
|
565
|
+
for (const [, f] of l.matchAll(Mr))
|
|
546
566
|
if (!m.includes(f ?? ""))
|
|
547
567
|
throw new RangeError(`[markdown-explorer] labels.${i} uses the unknown placeholder {${String(f)}}; it accepts ${m.map((d) => `{${d}}`).join(", ")}`);
|
|
548
568
|
}
|
|
@@ -554,19 +574,19 @@ const Rt = Object.freeze(["en", "ja"]), Rr = "en", Tr = Object.freeze({
|
|
|
554
574
|
if (e === null || t === null || typeof e != "object" || typeof t != "object") return !1;
|
|
555
575
|
const n = e, r = t, o = Object.keys(n), i = Object.keys(r);
|
|
556
576
|
return o.length === i.length && i.every((l) => Object.hasOwn(n, l) && Object.is(n[l], r[l]));
|
|
557
|
-
},
|
|
577
|
+
}, Mt = Object.freeze(["light", "dark"]), Dr = (e) => {
|
|
558
578
|
if (e === void 0) return "light";
|
|
559
|
-
if (
|
|
560
|
-
throw new RangeError(`[markdown-explorer] theme must be ${
|
|
579
|
+
if (Mt.includes(e)) return e;
|
|
580
|
+
throw new RangeError(`[markdown-explorer] theme must be ${Mt.map((t) => JSON.stringify(t)).join(" or ")}; got ${typeof e == "string" ? JSON.stringify(e) : typeof e}`);
|
|
561
581
|
}, fn = pe(null), D = () => {
|
|
562
582
|
const e = ne(fn);
|
|
563
583
|
if (e === null) throw new Error("[markdown-explorer] explorer components must be rendered inside <MarkdownExplorer>");
|
|
564
584
|
return e;
|
|
565
|
-
},
|
|
585
|
+
}, Ae = (e) => {
|
|
566
586
|
const { viewSettings: t } = D(), n = () => e(t.getSnapshot());
|
|
567
587
|
return ee(t.subscribe, n, n);
|
|
568
588
|
}, lt = () => {
|
|
569
|
-
const { config: e } = D(), t = _n()["*"], [n] =
|
|
589
|
+
const { config: e } = D(), t = _n()["*"], [n] = In(), r = n.toString();
|
|
570
590
|
return G(() => rn(e, t, new URLSearchParams(r)), [e, t, r]);
|
|
571
591
|
}, mn = {
|
|
572
592
|
unauthorized: ["failureUnauthorizedTitle", "failureUnauthorizedBody"],
|
|
@@ -577,8 +597,8 @@ const Rt = Object.freeze(["en", "ja"]), Rr = "en", Tr = Object.freeze({
|
|
|
577
597
|
"too-large": ["failureTooLargeTitle", "failureTooLargeBody"],
|
|
578
598
|
unsupported: ["failureUnsupportedTitle", "failureUnsupportedBody"],
|
|
579
599
|
failed: ["failureFailedTitle", "failureFailedBody"]
|
|
580
|
-
},
|
|
581
|
-
const { labels: o } = D(), i =
|
|
600
|
+
}, ae = (e, t) => e[mn[t][0]], me = ({ failure: e, alert: t, onRetry: n, testId: r }) => {
|
|
601
|
+
const { labels: o } = D(), i = ae(o, e.reason), l = o[mn[e.reason][1]], u = e.reason === "unauthorized" || e.reason === "forbidden" || e.reason === "failed" ? "danger" : "warning";
|
|
582
602
|
return /* @__PURE__ */ F("div", { className: "aqmx-callout", role: t ? "alert" : void 0, "data-aqmx-tone": u, "data-testid": r === null ? void 0 : r, "data-aqmx-failure": r === null ? void 0 : e.reason, children: [
|
|
583
603
|
/* @__PURE__ */ c("p", { className: "aqmx-callout-title", children: i }),
|
|
584
604
|
/* @__PURE__ */ c("p", { className: "aqmx-callout-body", children: l }),
|
|
@@ -592,7 +612,7 @@ const Rt = Object.freeze(["en", "ja"]), Rr = "en", Tr = Object.freeze({
|
|
|
592
612
|
case "grant":
|
|
593
613
|
return e.editGrantTitle;
|
|
594
614
|
case "failed":
|
|
595
|
-
return
|
|
615
|
+
return ae(e, n.failure.reason);
|
|
596
616
|
}
|
|
597
617
|
switch (r.kind) {
|
|
598
618
|
case "draft":
|
|
@@ -604,7 +624,7 @@ const Rt = Object.freeze(["en", "ja"]), Rr = "en", Tr = Object.freeze({
|
|
|
604
624
|
case "grant":
|
|
605
625
|
return e.editGrantTitle;
|
|
606
626
|
case "failed":
|
|
607
|
-
return e.draftSaveFailed(
|
|
627
|
+
return e.draftSaveFailed(ae(e, r.failure.reason));
|
|
608
628
|
case "saved":
|
|
609
629
|
if (!o) return r.merged ? e.draftSavedMerged : e.draftSaved;
|
|
610
630
|
break;
|
|
@@ -621,12 +641,12 @@ const Rt = Object.freeze(["en", "ja"]), Rr = "en", Tr = Object.freeze({
|
|
|
621
641
|
case "grant":
|
|
622
642
|
return e.editGrantTitle;
|
|
623
643
|
case "failed":
|
|
624
|
-
return e.draftSaveFailed(
|
|
644
|
+
return e.draftSaveFailed(ae(e, t.failure.reason));
|
|
625
645
|
case "idle":
|
|
626
646
|
case "saving":
|
|
627
647
|
return null;
|
|
628
648
|
}
|
|
629
|
-
},
|
|
649
|
+
}, Me = () => {
|
|
630
650
|
const e = /* @__PURE__ */ new Set();
|
|
631
651
|
return {
|
|
632
652
|
subscribe: (t) => (e.add(t), () => {
|
|
@@ -636,226 +656,226 @@ const Rt = Object.freeze(["en", "ja"]), Rr = "en", Tr = Object.freeze({
|
|
|
636
656
|
for (const t of [...e]) t();
|
|
637
657
|
}
|
|
638
658
|
};
|
|
639
|
-
}, Fr = "<<<<<<<", qr = "=======", _r = ">>>>>>>",
|
|
640
|
-
`)),
|
|
659
|
+
}, Fr = "<<<<<<<", qr = "=======", _r = ">>>>>>>", Ot = (e, t) => e === t || e.startsWith(`${t} `), Ct = (e) => Ir(e.split(`
|
|
660
|
+
`)), Ir = (e) => {
|
|
641
661
|
const t = [];
|
|
642
662
|
let n = null, r = null, o = 0;
|
|
643
663
|
for (const i of e) {
|
|
644
664
|
o += 1;
|
|
645
665
|
const l = i.charCodeAt(0);
|
|
646
|
-
l !== 60 && l !== 61 && l !== 62 || (
|
|
666
|
+
l !== 60 && l !== 61 && l !== 62 || (Ot(i, Fr) ? (n = o, r = null) : i === qr ? n !== null && r === null ? r = o : n = null : Ot(i, _r) && (n !== null && r !== null && t.push({ start: n, separator: r, end: o }), n = null, r = null));
|
|
647
667
|
}
|
|
648
668
|
return t;
|
|
649
669
|
}, Lt = (e) => e.includes(`\r
|
|
650
670
|
`) ? `\r
|
|
651
671
|
` : `
|
|
652
672
|
`, Ue = (e) => e.replace(/\r\n?/gu, `
|
|
653
|
-
`),
|
|
673
|
+
`), Br = (e, t) => t === `
|
|
654
674
|
` ? e : e.replaceAll(`
|
|
655
675
|
`, `\r
|
|
656
676
|
`), zr = 3, jr = /^\d+(?:\.\d+)?$/u, Hr = (e) => {
|
|
657
677
|
if (e === null || !jr.test(e)) return null;
|
|
658
678
|
const t = Number(e);
|
|
659
679
|
return t >= ln && t <= on ? t : null;
|
|
660
|
-
}, Ze = Object.freeze({ kind: "idle" }),
|
|
661
|
-
const i = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Map(), m = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Map(), d =
|
|
662
|
-
let h = null,
|
|
663
|
-
const
|
|
664
|
-
|
|
665
|
-
},
|
|
666
|
-
|
|
667
|
-
const { signal:
|
|
668
|
-
|
|
669
|
-
const
|
|
670
|
-
if (!
|
|
671
|
-
if (
|
|
672
|
-
|
|
680
|
+
}, Ze = Object.freeze({ kind: "idle" }), At = Object.freeze({ kind: "draft" }), Vr = ({ data: e, conflictLabels: t, onSaveSettled: n, sideBySideSetting: r, editorShareSetting: o }) => {
|
|
681
|
+
const i = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Map(), m = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Map(), d = Me();
|
|
682
|
+
let h = null, g = null, b = null;
|
|
683
|
+
const M = (a, s) => {
|
|
684
|
+
a.value = { ...a.value, ...s }, d.emit();
|
|
685
|
+
}, R = (a, s) => i.get(a) === s, S = async (a, s) => {
|
|
686
|
+
s.controller.abort(), s.controller = new AbortController();
|
|
687
|
+
const { signal: w } = s.controller;
|
|
688
|
+
M(s, { phase: { kind: "opening" } });
|
|
689
|
+
const T = await e.edit(a, w);
|
|
690
|
+
if (!R(a, s) || w.aborted || !("kind" in T)) return;
|
|
691
|
+
if (T.kind === "grant") {
|
|
692
|
+
M(s, { phase: { kind: "grant", href: T.href } });
|
|
673
693
|
return;
|
|
674
694
|
}
|
|
675
|
-
if (
|
|
676
|
-
|
|
695
|
+
if (T.kind === "failure") {
|
|
696
|
+
M(s, { phase: { kind: "failed", failure: T.failure } });
|
|
677
697
|
return;
|
|
678
698
|
}
|
|
679
|
-
const
|
|
680
|
-
|
|
681
|
-
},
|
|
682
|
-
const
|
|
683
|
-
|
|
684
|
-
}, L = (
|
|
685
|
-
|
|
686
|
-
}), E = (
|
|
687
|
-
|
|
688
|
-
}, v = async (
|
|
689
|
-
m.get(
|
|
690
|
-
const
|
|
691
|
-
if (
|
|
692
|
-
const { version:
|
|
693
|
-
if (
|
|
694
|
-
n(
|
|
699
|
+
const C = Ue(T.text), N = T.kind === "draft";
|
|
700
|
+
s.base = { text: C, version: N ? null : T.version }, s.draft = C, s.ending = Lt(T.text), M(s, { phase: { kind: "editing" }, history: N ? !1 : T.history, dirty: !1, save: N ? At : Ze, generation: s.value.generation + 1 });
|
|
701
|
+
}, A = (a) => {
|
|
702
|
+
const s = i.get(a);
|
|
703
|
+
s !== void 0 && (s.controller.abort(), i.delete(a), u.delete(a));
|
|
704
|
+
}, L = (a, s, w) => (a.set(s, w), () => {
|
|
705
|
+
a.get(s) === w && a.delete(s);
|
|
706
|
+
}), E = (a, s, w, T = {}) => {
|
|
707
|
+
M(s, { ...T, save: w }), n(a, w);
|
|
708
|
+
}, v = async (a) => {
|
|
709
|
+
m.get(a)?.flush();
|
|
710
|
+
const s = i.get(a);
|
|
711
|
+
if (s === void 0 || s.value.phase.kind !== "editing" || s.base === null || s.value.save.kind === "saving") return;
|
|
712
|
+
const { version: w } = s.base;
|
|
713
|
+
if (w === null) {
|
|
714
|
+
n(a, At);
|
|
695
715
|
return;
|
|
696
716
|
}
|
|
697
|
-
const
|
|
698
|
-
if (
|
|
699
|
-
E(
|
|
717
|
+
const T = Ct(s.draft).length;
|
|
718
|
+
if (T > 0) {
|
|
719
|
+
E(a, s, { kind: "conflicts", count: T });
|
|
700
720
|
return;
|
|
701
721
|
}
|
|
702
|
-
|
|
703
|
-
const { signal:
|
|
704
|
-
let N = { text:
|
|
705
|
-
|
|
722
|
+
s.controller.abort(), s.controller = new AbortController();
|
|
723
|
+
const { signal: C } = s.controller;
|
|
724
|
+
let N = { text: s.base.text, version: w }, q = s.draft, W = !1;
|
|
725
|
+
M(s, { save: { kind: "saving" } });
|
|
706
726
|
for (let z = 0; z < zr; z += 1) {
|
|
707
|
-
const j = await e.save(
|
|
708
|
-
if (!
|
|
727
|
+
const j = await e.save(a, N.version, Br(q, s.ending), C);
|
|
728
|
+
if (!R(a, s) || C.aborted || !("kind" in j)) return;
|
|
709
729
|
if (j.kind === "saved") {
|
|
710
|
-
m.get(
|
|
730
|
+
m.get(a)?.flush(), s.base = { text: q, version: j.version }, E(a, s, { kind: "saved", merged: W }, { dirty: s.draft !== q });
|
|
711
731
|
return;
|
|
712
732
|
}
|
|
713
733
|
if (j.kind === "grant") {
|
|
714
|
-
E(
|
|
734
|
+
E(a, s, { kind: "grant", href: j.href });
|
|
715
735
|
return;
|
|
716
736
|
}
|
|
717
737
|
if (j.kind === "failure") {
|
|
718
|
-
E(
|
|
738
|
+
E(a, s, { kind: "failed", failure: j.failure });
|
|
719
739
|
return;
|
|
720
740
|
}
|
|
721
|
-
const { mergeDraft: Y } = await import("./merge-
|
|
722
|
-
if (!
|
|
723
|
-
const V = m.get(
|
|
741
|
+
const { mergeDraft: Y } = await import("./merge-CS3p9BVw.js");
|
|
742
|
+
if (!R(a, s) || C.aborted) return;
|
|
743
|
+
const V = m.get(a);
|
|
724
744
|
V?.flush();
|
|
725
|
-
const re = Ue(j.text), p = Y(N.text,
|
|
726
|
-
if (N = { text: re, version: j.version },
|
|
727
|
-
E(
|
|
745
|
+
const re = Ue(j.text), p = Y(N.text, s.draft, re, t());
|
|
746
|
+
if (N = { text: re, version: j.version }, s.base = N, s.ending = Lt(j.text), s.draft = p.text, V?.adopt(p.text), p.kind === "conflicts") {
|
|
747
|
+
E(a, s, { kind: "conflicts", count: p.conflicts }, { dirty: !0, generation: s.value.generation + 1 });
|
|
728
748
|
return;
|
|
729
749
|
}
|
|
730
750
|
if (W = !0, q = p.text, q === N.text) {
|
|
731
|
-
E(
|
|
751
|
+
E(a, s, { kind: "saved", merged: W }, { dirty: !1, generation: s.value.generation + 1 });
|
|
732
752
|
return;
|
|
733
753
|
}
|
|
734
|
-
|
|
754
|
+
M(s, { dirty: !0, generation: s.value.generation + 1 });
|
|
735
755
|
}
|
|
736
|
-
E(
|
|
756
|
+
E(a, s, { kind: "failed", failure: { reason: "failed" } });
|
|
737
757
|
};
|
|
738
758
|
return {
|
|
739
|
-
session: (
|
|
759
|
+
session: (a) => i.get(a)?.value,
|
|
740
760
|
subscribe: d.subscribe,
|
|
741
|
-
start: (
|
|
742
|
-
const
|
|
743
|
-
if (
|
|
744
|
-
|
|
761
|
+
start: (a, s) => {
|
|
762
|
+
const w = i.get(a);
|
|
763
|
+
if (w !== void 0) {
|
|
764
|
+
M(w, { request: { anchor: s }, view: "editor" }), (w.value.phase.kind === "failed" || w.value.phase.kind === "grant") && S(a, w);
|
|
745
765
|
return;
|
|
746
766
|
}
|
|
747
|
-
l.delete(
|
|
748
|
-
const
|
|
749
|
-
value: { path:
|
|
767
|
+
l.delete(a);
|
|
768
|
+
const T = {
|
|
769
|
+
value: { path: a, phase: { kind: "opening" }, view: "editor", previewPrepared: !1, history: !1, dirty: !1, save: Ze, generation: 0, request: { anchor: s } },
|
|
750
770
|
base: null,
|
|
751
771
|
draft: "",
|
|
752
772
|
ending: `
|
|
753
773
|
`,
|
|
754
774
|
controller: new AbortController()
|
|
755
775
|
};
|
|
756
|
-
i.set(
|
|
776
|
+
i.set(a, T), S(a, T);
|
|
757
777
|
},
|
|
758
|
-
retry: (
|
|
759
|
-
const
|
|
760
|
-
|
|
778
|
+
retry: (a) => {
|
|
779
|
+
const s = i.get(a);
|
|
780
|
+
s === void 0 || s.value.phase.kind === "editing" || S(a, s);
|
|
761
781
|
},
|
|
762
|
-
draft: (
|
|
763
|
-
const
|
|
764
|
-
return
|
|
782
|
+
draft: (a) => {
|
|
783
|
+
const s = i.get(a);
|
|
784
|
+
return s === void 0 || s.base === null ? null : s.draft;
|
|
765
785
|
},
|
|
766
|
-
setDraft: (
|
|
767
|
-
const
|
|
768
|
-
if (
|
|
769
|
-
|
|
770
|
-
const
|
|
771
|
-
|
|
772
|
-
const { save: N } =
|
|
786
|
+
setDraft: (a, s) => {
|
|
787
|
+
const w = i.get(a);
|
|
788
|
+
if (w === void 0 || w.base === null) return;
|
|
789
|
+
w.draft = s;
|
|
790
|
+
const T = {}, C = s !== w.base.text;
|
|
791
|
+
C !== w.value.dirty && (T.dirty = C);
|
|
792
|
+
const { save: N } = w.value;
|
|
773
793
|
if (N.kind === "conflicts") {
|
|
774
|
-
const q =
|
|
775
|
-
q === 0 ?
|
|
794
|
+
const q = Ct(s).length;
|
|
795
|
+
q === 0 ? T.save = Ze : q !== N.count && (T.save = { kind: "conflicts", count: q });
|
|
776
796
|
}
|
|
777
|
-
(
|
|
797
|
+
(T.dirty !== void 0 || T.save !== void 0) && M(w, T);
|
|
778
798
|
},
|
|
779
|
-
consumeRequest: (
|
|
780
|
-
const
|
|
781
|
-
|
|
799
|
+
consumeRequest: (a) => {
|
|
800
|
+
const s = i.get(a);
|
|
801
|
+
s !== void 0 && s.value.request !== null && M(s, { request: null });
|
|
782
802
|
},
|
|
783
803
|
save: v,
|
|
784
|
-
replaceDraft: (
|
|
785
|
-
const
|
|
786
|
-
|
|
787
|
-
const
|
|
788
|
-
if (
|
|
789
|
-
const
|
|
790
|
-
|
|
804
|
+
replaceDraft: (a, s) => {
|
|
805
|
+
const w = m.get(a);
|
|
806
|
+
w?.flush();
|
|
807
|
+
const T = i.get(a);
|
|
808
|
+
if (T === void 0 || T.base === null) return;
|
|
809
|
+
const C = Ue(s);
|
|
810
|
+
T.draft = C, w?.adopt(C), M(T, { dirty: C !== T.base.text, generation: T.value.generation + 1 });
|
|
791
811
|
},
|
|
792
|
-
close: (
|
|
793
|
-
if (!i.has(
|
|
794
|
-
const
|
|
795
|
-
|
|
812
|
+
close: (a) => {
|
|
813
|
+
if (!i.has(a)) return;
|
|
814
|
+
const s = m.get(a), w = s === void 0 ? null : s.returnPoint();
|
|
815
|
+
A(a), w === null ? l.delete(a) : l.set(a, w), d.emit();
|
|
796
816
|
},
|
|
797
|
-
takeReturn: (
|
|
798
|
-
const
|
|
799
|
-
return l.delete(
|
|
817
|
+
takeReturn: (a) => {
|
|
818
|
+
const s = l.get(a) ?? null;
|
|
819
|
+
return l.delete(a), s;
|
|
800
820
|
},
|
|
801
|
-
dirtyPaths: () => [...i.values()].filter((
|
|
802
|
-
discard: (
|
|
803
|
-
for (const
|
|
804
|
-
|
|
821
|
+
dirtyPaths: () => [...i.values()].filter((a) => a.value.dirty).map((a) => a.value.path),
|
|
822
|
+
discard: (a) => {
|
|
823
|
+
for (const s of a) A(s);
|
|
824
|
+
a.length > 0 && d.emit();
|
|
805
825
|
},
|
|
806
826
|
editorState: {
|
|
807
|
-
get: (
|
|
808
|
-
set: (
|
|
809
|
-
i.has(
|
|
827
|
+
get: (a) => u.get(a),
|
|
828
|
+
set: (a, s) => {
|
|
829
|
+
i.has(a) && u.set(a, s);
|
|
810
830
|
}
|
|
811
831
|
},
|
|
812
|
-
bindEditor: (
|
|
813
|
-
bindView: (
|
|
814
|
-
viewAnchor: (
|
|
815
|
-
const
|
|
816
|
-
return
|
|
832
|
+
bindEditor: (a, s) => L(m, a, s),
|
|
833
|
+
bindView: (a, s) => L(f, a, s),
|
|
834
|
+
viewAnchor: (a) => {
|
|
835
|
+
const s = f.get(a);
|
|
836
|
+
return s === void 0 ? null : s.anchor();
|
|
817
837
|
},
|
|
818
|
-
flush: (
|
|
838
|
+
flush: (a) => m.get(a)?.flush(),
|
|
819
839
|
flushDrafts: () => {
|
|
820
|
-
for (const
|
|
840
|
+
for (const a of m.values()) a.flush();
|
|
821
841
|
},
|
|
822
|
-
nextConflict: (
|
|
842
|
+
nextConflict: (a) => m.get(a)?.nextConflict() === !0,
|
|
823
843
|
hasSessions: () => i.size > 0,
|
|
824
|
-
unsavedAmong: (
|
|
825
|
-
for (const
|
|
826
|
-
return
|
|
844
|
+
unsavedAmong: (a) => {
|
|
845
|
+
for (const s of m.values()) s.flush();
|
|
846
|
+
return a.filter((s) => i.get(s)?.value.dirty === !0);
|
|
827
847
|
},
|
|
828
|
-
askToDiscard: (
|
|
848
|
+
askToDiscard: (a) => new Promise((s) => {
|
|
829
849
|
b?.settle(!1);
|
|
830
|
-
const
|
|
831
|
-
paths:
|
|
832
|
-
settle: (
|
|
833
|
-
if (b ===
|
|
834
|
-
if (b = null,
|
|
835
|
-
d.emit(),
|
|
850
|
+
const w = {
|
|
851
|
+
paths: a,
|
|
852
|
+
settle: (T) => {
|
|
853
|
+
if (b === w) {
|
|
854
|
+
if (b = null, T) for (const C of a) A(C);
|
|
855
|
+
d.emit(), s(T);
|
|
836
856
|
}
|
|
837
857
|
}
|
|
838
858
|
};
|
|
839
|
-
b =
|
|
859
|
+
b = w, d.emit();
|
|
840
860
|
}),
|
|
841
861
|
discardRequest: () => b,
|
|
842
862
|
sideBySide: () => (h ??= r.read(), h),
|
|
843
|
-
setSideBySide: (
|
|
844
|
-
h !==
|
|
863
|
+
setSideBySide: (a) => {
|
|
864
|
+
h !== a && (h = a, r.write(a), d.emit());
|
|
845
865
|
},
|
|
846
|
-
editorShare: () => (
|
|
847
|
-
setEditorShare: (
|
|
848
|
-
if (!Number.isFinite(
|
|
849
|
-
const
|
|
850
|
-
|
|
866
|
+
editorShare: () => (g ??= o.read() ?? Zn, g),
|
|
867
|
+
setEditorShare: (a) => {
|
|
868
|
+
if (!Number.isFinite(a)) throw new RangeError(`[markdown-explorer] an editor share must be a finite number; got ${String(a)}`);
|
|
869
|
+
const s = Math.min(on, Math.max(ln, a));
|
|
870
|
+
g !== s && (g = s, o.write(s));
|
|
851
871
|
},
|
|
852
|
-
setView: (
|
|
853
|
-
const
|
|
854
|
-
|
|
872
|
+
setView: (a, s) => {
|
|
873
|
+
const w = i.get(a);
|
|
874
|
+
w === void 0 || w.value.view === s || (m.get(a)?.beforeView(s), M(w, { view: s, previewPrepared: w.value.previewPrepared || s === "preview" }));
|
|
855
875
|
},
|
|
856
|
-
preparePreview: (
|
|
857
|
-
const
|
|
858
|
-
|
|
876
|
+
preparePreview: (a) => {
|
|
877
|
+
const s = i.get(a);
|
|
878
|
+
s !== void 0 && !s.value.previewPrepared && M(s, { previewPrepared: !0 });
|
|
859
879
|
}
|
|
860
880
|
};
|
|
861
881
|
}, hn = (e) => {
|
|
@@ -885,15 +905,15 @@ const Rt = Object.freeze(["en", "ja"]), Rr = "en", Tr = Object.freeze({
|
|
|
885
905
|
const d = r.current;
|
|
886
906
|
if (!e || d === null) return;
|
|
887
907
|
const h = new ResizeObserver(() => b());
|
|
888
|
-
let
|
|
908
|
+
let g = null;
|
|
889
909
|
const b = () => {
|
|
890
|
-
const
|
|
891
|
-
|
|
910
|
+
const R = Xr(d);
|
|
911
|
+
R === null || R === g || (g !== null && h.unobserve(g), h.observe(R), g = R);
|
|
892
912
|
};
|
|
893
913
|
b(), h.observe(d);
|
|
894
|
-
const
|
|
895
|
-
return
|
|
896
|
-
h.disconnect(),
|
|
914
|
+
const M = d.ownerDocument.defaultView;
|
|
915
|
+
return M?.addEventListener("resize", b), d.ownerDocument.addEventListener("scroll", b, { capture: !0, passive: !0 }), () => {
|
|
916
|
+
h.disconnect(), M?.removeEventListener("resize", b), d.ownerDocument.removeEventListener("scroll", b, { capture: !0 });
|
|
897
917
|
};
|
|
898
918
|
}, [e]);
|
|
899
919
|
const u = P(
|
|
@@ -910,9 +930,9 @@ const Rt = Object.freeze(["en", "ja"]), Rr = "en", Tr = Object.freeze({
|
|
|
910
930
|
i.current && n();
|
|
911
931
|
}, [n]);
|
|
912
932
|
return { ref: r, onKeyDown: u, onClick: m, onCancel: Yr, onClose: f };
|
|
913
|
-
},
|
|
914
|
-
const m = _(null), f = Se(), d = Se(), h = P(() => m.current?.focus(), []),
|
|
915
|
-
return /* @__PURE__ */ c("dialog", { ...
|
|
933
|
+
}, wn = ({ open: e, title: t, body: n, confirmLabel: r, cancelLabel: o, onConfirm: i, onCancel: l, testId: u }) => {
|
|
934
|
+
const m = _(null), f = Se(), d = Se(), h = P(() => m.current?.focus(), []), g = vn({ open: e, onOpen: h, onDismiss: l });
|
|
935
|
+
return /* @__PURE__ */ c("dialog", { ...g, className: "aqmx-confirm", "aria-labelledby": f, "aria-describedby": d, "data-testid": u, children: /* @__PURE__ */ F("div", { className: "aqmx-confirm-panel", children: [
|
|
916
936
|
/* @__PURE__ */ c("p", { id: f, className: "aqmx-confirm-title", children: t }),
|
|
917
937
|
/* @__PURE__ */ c("p", { id: d, className: "aqmx-confirm-body", children: n }),
|
|
918
938
|
/* @__PURE__ */ F("div", { className: "aqmx-confirm-actions", children: [
|
|
@@ -920,7 +940,7 @@ const Rt = Object.freeze(["en", "ja"]), Rr = "en", Tr = Object.freeze({
|
|
|
920
940
|
/* @__PURE__ */ c("button", { type: "button", className: "aqmx-callout-action", "data-aqmx-tone": "danger", "data-testid": `${u}-confirm`, onClick: i, children: r })
|
|
921
941
|
] })
|
|
922
942
|
] }) });
|
|
923
|
-
},
|
|
943
|
+
}, Te = (e) => {
|
|
924
944
|
const t = e;
|
|
925
945
|
return t.status === void 0 && (t.status = "pending", e.then(
|
|
926
946
|
(n) => {
|
|
@@ -930,7 +950,7 @@ const Rt = Object.freeze(["en", "ja"]), Rr = "en", Tr = Object.freeze({
|
|
|
930
950
|
t.status = "rejected", t.reason = n;
|
|
931
951
|
}
|
|
932
952
|
)), t;
|
|
933
|
-
},
|
|
953
|
+
}, gn = (e) => Object.assign(Promise.resolve(e), { status: "fulfilled", value: e }), Ee = (e) => e.status === "fulfilled" ? e.value : void 0, Jr = Object.freeze({ readme: Object.freeze({ status: "loading" }), claim: !1 }), Qr = Object.freeze({ readme: Object.freeze({ status: "loading" }), claim: !0 }), eo = (e, t, n) => {
|
|
934
954
|
const r = /* @__PURE__ */ new Set(), o = [...e].reverse();
|
|
935
955
|
for (let i = o.pop(); i !== void 0; i = o.pop()) {
|
|
936
956
|
if (i.type !== "directory" || r.has(i.path)) continue;
|
|
@@ -945,14 +965,14 @@ const Rt = Object.freeze(["en", "ja"]), Rr = "en", Tr = Object.freeze({
|
|
|
945
965
|
if (r === void 0 || r.status === "deferred") return Jr;
|
|
946
966
|
if (r.status === "error") return { readme: { status: "failed", failure: r.failure, retry: () => e.retry(t) }, claim: !1 };
|
|
947
967
|
const o = eo(r.entries, n, (l) => e.children(t, l));
|
|
948
|
-
if (o !== null) return { readme: { status: "ok", readme:
|
|
968
|
+
if (o !== null) return { readme: { status: "ok", readme: wt(o) }, claim: !1 };
|
|
949
969
|
const i = e.children(t, n);
|
|
950
|
-
return i === void 0 || i.status === "loading" ? Qr : i.status === "failed" ? { readme: { status: "failed", failure: i.failure, retry: () => e.retryChildren(t, n) }, claim: !0 } : { readme: { status: "ok", readme:
|
|
970
|
+
return i === void 0 || i.status === "loading" ? Qr : i.status === "failed" ? { readme: { status: "failed", failure: i.failure, retry: () => e.retryChildren(t, n) }, claim: !0 } : { readme: { status: "ok", readme: wt(i.entries) }, claim: !0 };
|
|
951
971
|
}, no = (e, t, n) => {
|
|
952
972
|
const { readme: r } = to(e, t, n);
|
|
953
973
|
return r.status === "ok" ? r.readme : null;
|
|
954
974
|
}, ro = (e, t, n) => {
|
|
955
|
-
const r =
|
|
975
|
+
const r = Bn({ path: `${e.basePath}/*`, end: !0 }, t.pathname);
|
|
956
976
|
if (r === null) return /* @__PURE__ */ new Set();
|
|
957
977
|
const { location: o } = rn(e, r.params["*"], new URLSearchParams(t.search));
|
|
958
978
|
switch (o.view) {
|
|
@@ -975,28 +995,28 @@ const Rt = Object.freeze(["en", "ja"]), Rr = "en", Tr = Object.freeze({
|
|
|
975
995
|
}, lo = () => {
|
|
976
996
|
const { edits: e } = D();
|
|
977
997
|
return ee(e.subscribe, e.sideBySide, En);
|
|
978
|
-
},
|
|
998
|
+
}, ao = () => null, so = () => {
|
|
979
999
|
const { edits: e, labels: t, config: n, trees: r } = D(), o = _([]), i = P(
|
|
980
1000
|
({ nextLocation: b }) => {
|
|
981
|
-
const
|
|
982
|
-
return e.flushDrafts(), o.current = e.dirtyPaths().filter((
|
|
1001
|
+
const M = ro(n, b, (R, S) => no(r, R, S));
|
|
1002
|
+
return e.flushDrafts(), o.current = e.dirtyPaths().filter((R) => !M.has(R)), o.current.length > 0;
|
|
983
1003
|
},
|
|
984
1004
|
[e, n, r]
|
|
985
1005
|
), l = zn(i), u = io();
|
|
986
1006
|
te(() => {
|
|
987
1007
|
if (!u) return;
|
|
988
|
-
const b = (
|
|
989
|
-
e.flushDrafts(), e.dirtyPaths().length !== 0 && (
|
|
1008
|
+
const b = (M) => {
|
|
1009
|
+
e.flushDrafts(), e.dirtyPaths().length !== 0 && (M.preventDefault(), M.returnValue = !0);
|
|
990
1010
|
};
|
|
991
1011
|
return window.addEventListener("beforeunload", b), () => window.removeEventListener("beforeunload", b);
|
|
992
1012
|
}, [u, e]);
|
|
993
|
-
const m = ee(e.subscribe, e.discardRequest,
|
|
1013
|
+
const m = ee(e.subscribe, e.discardRequest, ao), f = l.state === "blocked", d = f ? o.current : m === null ? [] : m.paths, h = d.map((b) => se(b)).join(", "), g = d.length > 0 && d.every((b) => e.session(b)?.save.kind === "draft");
|
|
994
1014
|
return /* @__PURE__ */ c(
|
|
995
|
-
|
|
1015
|
+
wn,
|
|
996
1016
|
{
|
|
997
1017
|
open: f || m !== null,
|
|
998
|
-
title:
|
|
999
|
-
body:
|
|
1018
|
+
title: g ? t.draftDiscardTitle : t.unsavedTitle,
|
|
1019
|
+
body: g ? t.draftDiscardBody(h) : t.unsavedBody(h),
|
|
1000
1020
|
confirmLabel: t.unsavedDiscard,
|
|
1001
1021
|
cancelLabel: t.unsavedStay,
|
|
1002
1022
|
testId: "markdown-explorer-unsaved-guard",
|
|
@@ -1040,7 +1060,7 @@ function co({
|
|
|
1040
1060
|
}
|
|
1041
1061
|
const uo = /* @__PURE__ */ y.forwardRef(co);
|
|
1042
1062
|
let Ge = null;
|
|
1043
|
-
const yn = () => (Ge ??= import("./EditSurface-
|
|
1063
|
+
const yn = () => (Ge ??= import("./EditSurface-0owpPyLE.js").catch((e) => {
|
|
1044
1064
|
throw Ge = null, e;
|
|
1045
1065
|
}), Ge), fo = () => {
|
|
1046
1066
|
yn().catch(() => {
|
|
@@ -1059,15 +1079,15 @@ class ho extends tn {
|
|
|
1059
1079
|
return this.state.failed ? this.props.fallback(this.retry) : this.props.children;
|
|
1060
1080
|
}
|
|
1061
1081
|
}
|
|
1062
|
-
const
|
|
1082
|
+
const at = `[${sn}]`, po = "[data-aqmd-content]", vo = 'a[href], button, input, select, textarea, summary, label, [contenteditable], [role="menu"], iframe, video, audio, object, embed, svg', wo = 200, Re = (e) => Er(e.getAttribute(sn)), go = (e, t) => {
|
|
1063
1083
|
for (let r = e; r !== null && t.contains(r); r = r.parentElement) {
|
|
1064
|
-
const o =
|
|
1084
|
+
const o = Re(r);
|
|
1065
1085
|
if (o !== null) return { block: r, lines: o, own: !0 };
|
|
1066
1086
|
}
|
|
1067
1087
|
let n = null;
|
|
1068
|
-
for (const r of t.querySelectorAll(
|
|
1088
|
+
for (const r of t.querySelectorAll(at)) {
|
|
1069
1089
|
if (!(r.compareDocumentPosition(e) & Node.DOCUMENT_POSITION_FOLLOWING)) break;
|
|
1070
|
-
const o =
|
|
1090
|
+
const o = Re(r);
|
|
1071
1091
|
o !== null && (n = { block: r, lines: o });
|
|
1072
1092
|
}
|
|
1073
1093
|
return n === null ? null : { ...n, own: !1 };
|
|
@@ -1076,19 +1096,19 @@ const st = `[${an}]`, po = "[data-aqmd-content]", vo = 'a[href], button, input,
|
|
|
1076
1096
|
for (let r = e.indexOf(t); r >= 0; r = e.indexOf(t, r + t.length)) n += 1;
|
|
1077
1097
|
return n;
|
|
1078
1098
|
}, Eo = (e) => e.closest(po) !== null && e.closest(vo) === null, yo = (e, t, n) => {
|
|
1079
|
-
const r =
|
|
1099
|
+
const r = go(e, t);
|
|
1080
1100
|
if (r === null) return null;
|
|
1081
1101
|
const { block: o, own: i } = r;
|
|
1082
1102
|
if (!i) {
|
|
1083
1103
|
const u = r.lines.last + 1;
|
|
1084
1104
|
return { lines: { first: u, last: u }, word: null, occurrence: 0, clientTop: Ne(e) };
|
|
1085
1105
|
}
|
|
1086
|
-
const l =
|
|
1106
|
+
const l = To(o, n);
|
|
1087
1107
|
return l === null ? { lines: r.lines, word: null, occurrence: 0, clientTop: Ne(o) } : { lines: r.lines, word: l.text, occurrence: l.occurrence, clientTop: l.clientTop };
|
|
1088
1108
|
}, xo = (e, t) => {
|
|
1089
1109
|
let n = null, r = null, o = null;
|
|
1090
|
-
for (const l of e.querySelectorAll(
|
|
1091
|
-
const u =
|
|
1110
|
+
for (const l of e.querySelectorAll(at)) {
|
|
1111
|
+
const u = Re(l);
|
|
1092
1112
|
if (u === null) continue;
|
|
1093
1113
|
n ??= ko(t, l);
|
|
1094
1114
|
const { top: m, bottom: f } = l.getBoundingClientRect();
|
|
@@ -1099,15 +1119,15 @@ const st = `[${an}]`, po = "[data-aqmd-content]", vo = 'a[href], button, input,
|
|
|
1099
1119
|
}, So = (e) => e === e.ownerDocument.scrollingElement ? 0 : e.getBoundingClientRect().top + e.clientTop, ko = (e, t) => {
|
|
1100
1120
|
const n = Number.parseFloat(getComputedStyle(t).scrollMarginTop);
|
|
1101
1121
|
return So(e) + (Number.isFinite(n) ? n : 0);
|
|
1102
|
-
},
|
|
1122
|
+
}, To = (e, t) => {
|
|
1103
1123
|
if (t === null || t.rangeCount === 0) return null;
|
|
1104
1124
|
const n = t.getRangeAt(0);
|
|
1105
1125
|
if (!(e.contains(n.startContainer) && e.contains(n.endContainer))) return null;
|
|
1106
1126
|
const r = n.toString().trim();
|
|
1107
|
-
if (r === "" || r.length >
|
|
1127
|
+
if (r === "" || r.length > wo || /[\r\n]/u.test(r)) return null;
|
|
1108
1128
|
const o = e.ownerDocument.createRange();
|
|
1109
1129
|
return o.setStart(e, 0), o.setEnd(n.startContainer, n.startOffset), { text: r, occurrence: bo(o.toString(), r), clientTop: n.getBoundingClientRect().top };
|
|
1110
|
-
},
|
|
1130
|
+
}, Xa = (e, t) => {
|
|
1111
1131
|
const n = e.split(`
|
|
1112
1132
|
`), r = Math.min(t.lines.first, n.length), o = Math.min(t.lines.last, n.length), i = { line: r, column: 0 };
|
|
1113
1133
|
if (t.word === null) return i;
|
|
@@ -1119,22 +1139,22 @@ const st = `[${an}]`, po = "[data-aqmd-content]", vo = 'a[href], button, input,
|
|
|
1119
1139
|
l += 1;
|
|
1120
1140
|
}
|
|
1121
1141
|
}
|
|
1122
|
-
return l > 0 ?
|
|
1123
|
-
},
|
|
1142
|
+
return l > 0 ? Ro(n, r, o, t.word) ?? i : i;
|
|
1143
|
+
}, Ro = (e, t, n, r) => {
|
|
1124
1144
|
for (let o = n; o >= t; o -= 1) {
|
|
1125
1145
|
const i = (e[o - 1] ?? "").lastIndexOf(r);
|
|
1126
1146
|
if (i >= 0) return { line: o, column: i };
|
|
1127
1147
|
}
|
|
1128
1148
|
return null;
|
|
1129
|
-
},
|
|
1149
|
+
}, Mo = (e, t) => {
|
|
1130
1150
|
let n = null, r = null;
|
|
1131
|
-
for (const o of e.querySelectorAll(
|
|
1132
|
-
const i =
|
|
1151
|
+
for (const o of e.querySelectorAll(at)) {
|
|
1152
|
+
const i = Re(o);
|
|
1133
1153
|
i === null || i.first > t || (i.last >= t ? n = o : (r === null || i.last >= r.last) && (r = { element: o, last: i.last }));
|
|
1134
1154
|
}
|
|
1135
1155
|
return n !== null ? n : r === null ? null : r.element;
|
|
1136
|
-
},
|
|
1137
|
-
const { bottom: n } = e.getBoundingClientRect(), r = Ne(e), o =
|
|
1156
|
+
}, Oo = (e, t) => {
|
|
1157
|
+
const { bottom: n } = e.getBoundingClientRect(), r = Ne(e), o = Re(e);
|
|
1138
1158
|
if (o === null) return r;
|
|
1139
1159
|
const i = Math.min(Math.max(t - o.first, 0) / (o.last - o.first + 1), 1);
|
|
1140
1160
|
return r + (n - r) * i;
|
|
@@ -1149,20 +1169,20 @@ const st = `[${an}]`, po = "[data-aqmd-content]", vo = 'a[href], button, input,
|
|
|
1149
1169
|
if (u > 0) return l;
|
|
1150
1170
|
}
|
|
1151
1171
|
return e.getBoundingClientRect().top;
|
|
1152
|
-
},
|
|
1172
|
+
}, st = Object.freeze({
|
|
1153
1173
|
browse: Object.freeze({ replace: !0, preventScrollReset: !0, defaultShouldRevalidate: !1 }),
|
|
1154
1174
|
"switch-source": Object.freeze({ replace: !1, preventScrollReset: !0, defaultShouldRevalidate: !1 }),
|
|
1155
1175
|
"switch-view": Object.freeze({ replace: !1, preventScrollReset: !1, defaultShouldRevalidate: !1 }),
|
|
1156
1176
|
"follow-link": Object.freeze({ replace: !1, preventScrollReset: !1, defaultShouldRevalidate: !1 })
|
|
1157
|
-
}),
|
|
1177
|
+
}), Ya = (e) => st[e], Fe = () => {
|
|
1158
1178
|
const e = jn();
|
|
1159
1179
|
return P(
|
|
1160
1180
|
(t, n) => {
|
|
1161
|
-
e(t,
|
|
1181
|
+
e(t, st[n]);
|
|
1162
1182
|
},
|
|
1163
1183
|
[e]
|
|
1164
1184
|
);
|
|
1165
|
-
},
|
|
1185
|
+
}, Co = ({ navigation: e, ...t }) => /* @__PURE__ */ c(Hn, { ...t, ...st[e] }), xn = (e) => {
|
|
1166
1186
|
const t = e.ownerDocument;
|
|
1167
1187
|
if (e.focus({ preventScroll: !0 }), t.activeElement === e) return !0;
|
|
1168
1188
|
if (e.hasAttribute("tabindex")) return !1;
|
|
@@ -1188,9 +1208,9 @@ const st = `[${an}]`, po = "[data-aqmd-content]", vo = 'a[href], button, input,
|
|
|
1188
1208
|
e.prefetch(f);
|
|
1189
1209
|
const h = e.peek(f);
|
|
1190
1210
|
if (h?.status !== "pending") return;
|
|
1191
|
-
const
|
|
1192
|
-
o.current =
|
|
1193
|
-
o.current ===
|
|
1211
|
+
const g = Promise.allSettled([h.promise]);
|
|
1212
|
+
o.current = g, g.then(() => {
|
|
1213
|
+
o.current === g && (o.current = null);
|
|
1194
1214
|
});
|
|
1195
1215
|
},
|
|
1196
1216
|
[e]
|
|
@@ -1217,7 +1237,7 @@ const st = `[${an}]`, po = "[data-aqmd-content]", vo = 'a[href], button, input,
|
|
|
1217
1237
|
}),
|
|
1218
1238
|
[u, m]
|
|
1219
1239
|
);
|
|
1220
|
-
},
|
|
1240
|
+
}, Ao = it(() => import("./NativeScrollBar-CI9fTvkt.js").then((e) => ({ default: e.NativeScrollBar })));
|
|
1221
1241
|
class No extends tn {
|
|
1222
1242
|
state = { failed: !1 };
|
|
1223
1243
|
static getDerivedStateFromError() {
|
|
@@ -1230,7 +1250,7 @@ class No extends tn {
|
|
|
1230
1250
|
return this.state.failed ? null : this.props.children;
|
|
1231
1251
|
}
|
|
1232
1252
|
}
|
|
1233
|
-
const Do = ({ scroller: e, withCircle: t }) => /* @__PURE__ */ c(No, { children: /* @__PURE__ */ c(ke, { fallback: null, children: /* @__PURE__ */ c(
|
|
1253
|
+
const Do = ({ scroller: e, withCircle: t }) => /* @__PURE__ */ c(No, { children: /* @__PURE__ */ c(ke, { fallback: null, children: /* @__PURE__ */ c(Ao, { scroller: e, withCircle: t }) }) }), Sn = (e) => /* @__PURE__ */ c(Do, { scroller: e, withCircle: !0 }), kn = () => {
|
|
1234
1254
|
const e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Set();
|
|
1235
1255
|
let n = !1;
|
|
1236
1256
|
const r = (o) => {
|
|
@@ -1264,9 +1284,9 @@ const Do = ({ scroller: e, withCircle: t }) => /* @__PURE__ */ c(No, { children:
|
|
|
1264
1284
|
return !(Array.isArray(e) && Array.isArray(t)) || e.length !== t.length ? !1 : e.every((i, l) => De(i, t[l]));
|
|
1265
1285
|
const n = e, r = t, o = Object.keys(n);
|
|
1266
1286
|
return o.length !== Object.keys(r).length ? !1 : o.every((i) => Object.hasOwn(r, i) && De(n[i], r[i]));
|
|
1267
|
-
}, Po = 55e3, Nt = Object.freeze({ status: "deferred" }), Dt = Object.freeze({ status: "refreshed" }), We = Object.freeze({ status: "superseded" }), ue = (e) => e === void 0 || e.status === "deferred" ? null : e.status === "loaded" ? e : e.previous,
|
|
1287
|
+
}, Po = 55e3, Nt = Object.freeze({ status: "deferred" }), Dt = Object.freeze({ status: "refreshed" }), We = Object.freeze({ status: "superseded" }), ue = (e) => e === void 0 || e.status === "deferred" ? null : e.status === "loaded" ? e : e.previous, Tn = (e) => e !== void 0 && e.status === "loaded" && e.document.kind !== "failure", $o = ({ client: e, capacity: t }) => {
|
|
1268
1288
|
if (!Number.isInteger(t) || t < 1) throw new RangeError(`[markdown-explorer] the document cache capacity must be a positive integer; got ${String(t)}`);
|
|
1269
|
-
const n = /* @__PURE__ */ new Map(), r = kn(), o =
|
|
1289
|
+
const n = /* @__PURE__ */ new Map(), r = kn(), o = Me(), i = /* @__PURE__ */ new WeakSet();
|
|
1270
1290
|
let l = 0;
|
|
1271
1291
|
const u = o.emit, m = () => (l += 1, l), f = () => {
|
|
1272
1292
|
if (!(n.size <= t))
|
|
@@ -1276,33 +1296,33 @@ const Do = ({ scroller: e, withCircle: t }) => /* @__PURE__ */ c(No, { children:
|
|
|
1276
1296
|
}
|
|
1277
1297
|
}, d = (E, v) => {
|
|
1278
1298
|
n.delete(E), n.set(E, v);
|
|
1279
|
-
}, h = (E) => performance.now() - E.validatedAt >= Po,
|
|
1280
|
-
const
|
|
1281
|
-
return d(E, N), f(),
|
|
1299
|
+
}, h = (E) => performance.now() - E.validatedAt >= Po, g = (E, v, a) => {
|
|
1300
|
+
const s = n.get(E), w = ue(s?.snapshot), T = a || s?.refreshPending === !0, C = Te(e.document(E, { refresh: T }).then((q) => ({ status: "loaded", document: q }))), N = { snapshot: { status: "pending", promise: C, previous: w }, validatedAt: performance.now(), opened: v, background: null, refreshPending: !1, seeded: void 0, stamp: m() };
|
|
1301
|
+
return d(E, N), f(), C.then((q) => {
|
|
1282
1302
|
n.get(E) === N && (N.snapshot = q, N.stamp = m(), u());
|
|
1283
1303
|
}), N;
|
|
1284
|
-
}, b = (E, v,
|
|
1285
|
-
v.background ===
|
|
1286
|
-
},
|
|
1287
|
-
const
|
|
1288
|
-
if (
|
|
1289
|
-
const
|
|
1290
|
-
v.background =
|
|
1291
|
-
const
|
|
1304
|
+
}, b = (E, v, a, s, w, T) => {
|
|
1305
|
+
v.background === a && (v.background = null, !(n.get(E) !== v || v.snapshot !== s) && (w.kind === "failure" && s.document.kind !== "failure" || (v.validatedAt = T, v.stamp = m(), De(s.document, w) || (v.snapshot = { status: "loaded", document: w }), u())));
|
|
1306
|
+
}, M = async (E, v) => {
|
|
1307
|
+
const a = v.snapshot;
|
|
1308
|
+
if (a.status !== "loaded") return null;
|
|
1309
|
+
const s = {};
|
|
1310
|
+
v.background = s;
|
|
1311
|
+
const w = performance.now(), T = e.document(E, { refresh: v.refreshPending });
|
|
1292
1312
|
v.refreshPending = !1;
|
|
1293
|
-
const
|
|
1294
|
-
return b(E, v,
|
|
1295
|
-
},
|
|
1296
|
-
const { snapshot:
|
|
1297
|
-
return
|
|
1313
|
+
const C = await T, N = v.background === s && n.get(E) === v && v.snapshot === a;
|
|
1314
|
+
return b(E, v, s, a, C, w), N ? C : null;
|
|
1315
|
+
}, R = (E, v) => {
|
|
1316
|
+
const { snapshot: a } = v;
|
|
1317
|
+
return a.status === "pending" ? !1 : a.status === "loaded" && a.document.kind !== "failure" ? (M(E, v), !1) : (a.status === "loaded" && i.add(a), g(E, !0, !1), !0);
|
|
1298
1318
|
}, S = (E) => {
|
|
1299
1319
|
const v = r.hold(E);
|
|
1300
|
-
let
|
|
1320
|
+
let a = !1;
|
|
1301
1321
|
return () => {
|
|
1302
|
-
if (
|
|
1303
|
-
|
|
1304
|
-
const
|
|
1305
|
-
|
|
1322
|
+
if (a) return;
|
|
1323
|
+
a = !0, v();
|
|
1324
|
+
const s = n.get(E);
|
|
1325
|
+
s !== void 0 && d(E, s), f();
|
|
1306
1326
|
};
|
|
1307
1327
|
};
|
|
1308
1328
|
return {
|
|
@@ -1311,72 +1331,72 @@ const Do = ({ scroller: e, withCircle: t }) => /* @__PURE__ */ c(No, { children:
|
|
|
1311
1331
|
answerStampOf: (E) => n.get(E)?.stamp,
|
|
1312
1332
|
prefetch: (E) => {
|
|
1313
1333
|
const v = n.get(E);
|
|
1314
|
-
v !== void 0 && v.snapshot.status !== "deferred" || (
|
|
1334
|
+
v !== void 0 && v.snapshot.status !== "deferred" || (g(E, !1, !1), u());
|
|
1315
1335
|
},
|
|
1316
1336
|
open: (E) => {
|
|
1317
|
-
const v = r.resumes(E),
|
|
1318
|
-
if (
|
|
1319
|
-
return
|
|
1320
|
-
if (d(E,
|
|
1321
|
-
const { snapshot:
|
|
1322
|
-
return
|
|
1337
|
+
const v = r.resumes(E), a = S(E), s = n.get(E);
|
|
1338
|
+
if (s === void 0 || s.snapshot.status === "deferred")
|
|
1339
|
+
return g(E, !0, !1), u(), a;
|
|
1340
|
+
if (d(E, s), v) return a;
|
|
1341
|
+
const { snapshot: w } = s;
|
|
1342
|
+
return w.status === "pending" ? (s.opened = !0, a) : w.document.kind === "failure" ? (s.opened || h(s) ? (i.add(w), g(E, !0, !1), u()) : s.opened = !0, a) : (s.opened = !0, s.background === null && h(s) && M(E, s), a);
|
|
1323
1343
|
},
|
|
1324
1344
|
retain: S,
|
|
1325
1345
|
retry: (E) => {
|
|
1326
1346
|
const v = n.get(E);
|
|
1327
|
-
v === void 0 || v.snapshot.status !== "loaded" || v.snapshot.document.kind !== "failure" || (
|
|
1347
|
+
v === void 0 || v.snapshot.status !== "loaded" || v.snapshot.document.kind !== "failure" || (g(E, !0, !1), u());
|
|
1328
1348
|
},
|
|
1329
1349
|
seed: (E, v) => {
|
|
1330
|
-
const
|
|
1350
|
+
const a = performance.now(), s = Te(
|
|
1331
1351
|
v.then(
|
|
1332
1352
|
(q) => q === null ? Nt : { status: "loaded", document: q },
|
|
1333
1353
|
() => Nt
|
|
1334
1354
|
)
|
|
1335
|
-
),
|
|
1336
|
-
if (
|
|
1337
|
-
const q =
|
|
1338
|
-
|
|
1355
|
+
), w = n.get(E);
|
|
1356
|
+
if (w !== void 0 && w.snapshot.status === "loaded") {
|
|
1357
|
+
const q = w.snapshot, W = {};
|
|
1358
|
+
w.background = W, s.then((z) => {
|
|
1339
1359
|
if (z.status === "loaded") {
|
|
1340
|
-
b(E,
|
|
1360
|
+
b(E, w, W, q, z.document, a);
|
|
1341
1361
|
return;
|
|
1342
1362
|
}
|
|
1343
|
-
|
|
1363
|
+
w.background === W && (w.background = null);
|
|
1344
1364
|
});
|
|
1345
1365
|
return;
|
|
1346
1366
|
}
|
|
1347
|
-
const
|
|
1348
|
-
d(E, N), f(),
|
|
1349
|
-
n.get(E) === N && (q.status === "deferred" && r.isHeld(E) ?
|
|
1367
|
+
const T = w !== void 0 && w.snapshot.status === "pending" ? w.snapshot.previous : null, C = { status: "pending", promise: s, previous: T }, N = { snapshot: C, validatedAt: a, opened: w?.opened === !0, background: null, refreshPending: w?.refreshPending === !0, seeded: C, stamp: m() };
|
|
1368
|
+
d(E, N), f(), s.then((q) => {
|
|
1369
|
+
n.get(E) === N && (q.status === "deferred" && r.isHeld(E) ? g(E, N.opened, !1) : (N.snapshot = q, N.stamp = m()), u());
|
|
1350
1370
|
});
|
|
1351
1371
|
},
|
|
1352
1372
|
invalidate: () => {
|
|
1353
1373
|
let E = !1;
|
|
1354
|
-
for (const [v,
|
|
1355
|
-
if (
|
|
1356
|
-
const { snapshot:
|
|
1357
|
-
if (
|
|
1358
|
-
|
|
1374
|
+
for (const [v, a] of [...n]) {
|
|
1375
|
+
if (a.validatedAt = Number.NEGATIVE_INFINITY, a.opened = !0, a.refreshPending = !0, !r.isHeld(v)) continue;
|
|
1376
|
+
const { snapshot: s } = a;
|
|
1377
|
+
if (s.status !== "pending") {
|
|
1378
|
+
R(v, a) && (E = !0);
|
|
1359
1379
|
continue;
|
|
1360
1380
|
}
|
|
1361
|
-
|
|
1362
|
-
n.get(v) ===
|
|
1381
|
+
s.promise.then(() => {
|
|
1382
|
+
n.get(v) === a && a.refreshPending && r.isHeld(v) && R(v, a) && u();
|
|
1363
1383
|
});
|
|
1364
1384
|
}
|
|
1365
1385
|
E && u();
|
|
1366
1386
|
},
|
|
1367
1387
|
refresh: async (E) => {
|
|
1368
1388
|
const v = n.get(E);
|
|
1369
|
-
if (v !== void 0 &&
|
|
1389
|
+
if (v !== void 0 && Tn(v.snapshot)) {
|
|
1370
1390
|
v.refreshPending = !0;
|
|
1371
|
-
const
|
|
1372
|
-
return
|
|
1391
|
+
const s = await M(E, v);
|
|
1392
|
+
return s === null ? We : s.kind === "failure" ? { status: "failed", failure: s.failure } : Dt;
|
|
1373
1393
|
}
|
|
1374
|
-
const
|
|
1375
|
-
return u(),
|
|
1394
|
+
const a = g(E, !0, !0);
|
|
1395
|
+
return u(), a.snapshot.status !== "pending" ? We : (await a.snapshot.promise, n.get(E) === a ? Dt : We);
|
|
1376
1396
|
},
|
|
1377
1397
|
clear: () => {
|
|
1378
1398
|
n.clear();
|
|
1379
|
-
for (const E of r.heldKeys())
|
|
1399
|
+
for (const E of r.heldKeys()) g(E, !0, !1);
|
|
1380
1400
|
u();
|
|
1381
1401
|
},
|
|
1382
1402
|
subscribe: o.subscribe,
|
|
@@ -1432,8 +1452,8 @@ function _o({
|
|
|
1432
1452
|
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"
|
|
1433
1453
|
}));
|
|
1434
1454
|
}
|
|
1435
|
-
const
|
|
1436
|
-
function
|
|
1455
|
+
const Io = /* @__PURE__ */ y.forwardRef(_o);
|
|
1456
|
+
function Bo({
|
|
1437
1457
|
title: e,
|
|
1438
1458
|
titleId: t,
|
|
1439
1459
|
...n
|
|
@@ -1454,11 +1474,11 @@ function Io({
|
|
|
1454
1474
|
clipRule: "evenodd"
|
|
1455
1475
|
}));
|
|
1456
1476
|
}
|
|
1457
|
-
const zo = /* @__PURE__ */ y.forwardRef(
|
|
1477
|
+
const zo = /* @__PURE__ */ y.forwardRef(Bo), jo = 2e3, Pt = Object.freeze({ outcome: "idle" }), Ho = (e) => {
|
|
1458
1478
|
const t = navigator.clipboard;
|
|
1459
1479
|
return t === void 0 ? Promise.reject(new Error("[markdown-explorer] this browser has no asynchronous clipboard")) : t.writeText(e);
|
|
1460
1480
|
}, Vo = ({ text: e }) => {
|
|
1461
|
-
const { announcer: t, labels: n } = D(), [r, o] =
|
|
1481
|
+
const { announcer: t, labels: n } = D(), [r, o] = B(Pt);
|
|
1462
1482
|
te(() => {
|
|
1463
1483
|
if (r.outcome === "idle") return;
|
|
1464
1484
|
const m = setTimeout(() => o(Pt), jo);
|
|
@@ -1473,7 +1493,7 @@ const zo = /* @__PURE__ */ y.forwardRef(Io), jo = 2e3, Pt = Object.freeze({ outc
|
|
|
1473
1493
|
);
|
|
1474
1494
|
}, u = r.outcome === "copied" ? n.copiedText : r.outcome === "failed" ? n.copyTextFailed : n.copyText;
|
|
1475
1495
|
return (
|
|
1476
|
-
/* @__PURE__ */ c("button", { type: "button", className: "aqmx-icon-button", "aria-label": n.copyText, title: u, onClick: l, "data-aqmx-copy-outcome": r.outcome, "data-testid": "markdown-explorer-file-copy", children: r.outcome === "copied" ? /* @__PURE__ */ c(qo, {}) : r.outcome === "failed" ? /* @__PURE__ */ c(zo, {}) : /* @__PURE__ */ c(
|
|
1496
|
+
/* @__PURE__ */ c("button", { type: "button", className: "aqmx-icon-button", "aria-label": n.copyText, title: u, onClick: l, "data-aqmx-copy-outcome": r.outcome, "data-testid": "markdown-explorer-file-copy", children: r.outcome === "copied" ? /* @__PURE__ */ c(qo, {}) : r.outcome === "failed" ? /* @__PURE__ */ c(zo, {}) : /* @__PURE__ */ c(Io, {}) })
|
|
1477
1497
|
);
|
|
1478
1498
|
}, he = pe("fill"), Uo = Object.freeze({ blockSize: "100%" }), ve = ({ scrollerProps: e, children: t }) => ne(he) === "content" ? /* @__PURE__ */ c(St, { scrollerProps: e, children: t }) : /* @__PURE__ */ c(St, { scrollerProps: { ...e, style: Uo }, rowClassName: "aqmx-document-scroll-row", renderScrollBar: Sn, children: t });
|
|
1479
1499
|
function Zo({
|
|
@@ -1570,23 +1590,23 @@ const Yo = /* @__PURE__ */ y.forwardRef(Xo), Jo = Object.freeze({ className: "aq
|
|
|
1570
1590
|
if (!e.startsWith("#") || e.length === 1) return null;
|
|
1571
1591
|
const t = new TextEncoder(), n = e.slice(1).split(ti).flatMap((r, o) => o % 2 === 1 ? [Number.parseInt(r.slice(1), 16)] : [...t.encode(r)]);
|
|
1572
1592
|
return new TextDecoder("utf-8", { ignoreBOM: !0 }).decode(Uint8Array.from(n));
|
|
1573
|
-
},
|
|
1593
|
+
}, Rn = (e) => `#${encodeURIComponent(e)}`, ni = (e) => {
|
|
1574
1594
|
if (e === "#") return !0;
|
|
1575
1595
|
const t = ct(e);
|
|
1576
1596
|
return t !== null && t.replace(/[A-Z]/gu, (n) => n.toLowerCase()) === "top";
|
|
1577
|
-
},
|
|
1597
|
+
}, Mn = (e, t) => {
|
|
1578
1598
|
if (t === "") return null;
|
|
1579
1599
|
for (const n of e.querySelectorAll("[id]"))
|
|
1580
1600
|
if (n.id === t) return n;
|
|
1581
1601
|
return null;
|
|
1582
1602
|
}, ri = "http://www.w3.org/1999/xhtml", $t = (e, t) => {
|
|
1583
1603
|
if (t === "") return null;
|
|
1584
|
-
const n =
|
|
1604
|
+
const n = Mn(e, t);
|
|
1585
1605
|
if (n !== null) return n;
|
|
1586
1606
|
for (const r of e.querySelectorAll("a[name]"))
|
|
1587
1607
|
if (r.localName === "a" && r.namespaceURI === ri && r.getAttribute("name") === t) return r;
|
|
1588
1608
|
return null;
|
|
1589
|
-
},
|
|
1609
|
+
}, On = (e, t) => {
|
|
1590
1610
|
if (e === null || !t.startsWith("#")) return null;
|
|
1591
1611
|
const n = $t(e, t.slice(1));
|
|
1592
1612
|
if (n !== null) return n;
|
|
@@ -1615,7 +1635,7 @@ const Yo = /* @__PURE__ */ y.forwardRef(Xo), Jo = Object.freeze({ className: "aq
|
|
|
1615
1635
|
reveal: (e) => {
|
|
1616
1636
|
e.scrollIntoView(tt);
|
|
1617
1637
|
}
|
|
1618
|
-
}), tt = Object.freeze({ block: "nearest", inline: "nearest", behavior: "instant" }),
|
|
1638
|
+
}), tt = Object.freeze({ block: "nearest", inline: "nearest", behavior: "instant" }), ai = (e, t) => {
|
|
1619
1639
|
for (let n = t; n !== null && n !== e; n = n.parentElement) {
|
|
1620
1640
|
const r = n.parentElement;
|
|
1621
1641
|
if (r instanceof HTMLDetailsElement && n !== r.querySelector(":scope > summary") && (r.open = !0), n.getAttribute("hidden")?.toLowerCase() === "until-found") {
|
|
@@ -1623,7 +1643,7 @@ const Yo = /* @__PURE__ */ y.forwardRef(Xo), Jo = Object.freeze({ className: "aq
|
|
|
1623
1643
|
n.removeAttribute("hidden");
|
|
1624
1644
|
}
|
|
1625
1645
|
}
|
|
1626
|
-
},
|
|
1646
|
+
}, si = (e, t) => {
|
|
1627
1647
|
if (t.getClientRects().length === 0) return;
|
|
1628
1648
|
const n = e === e.ownerDocument.scrollingElement ? 0 : e.getBoundingClientRect().top + e.clientTop, { scrollMarginTop: r, scrollMarginBottom: o } = getComputedStyle(t), i = Number.parseFloat(r), l = t.getBoundingClientRect(), u = l.height + i + Number.parseFloat(o) > e.clientHeight;
|
|
1629
1649
|
if (!u && Math.abs(l.top - i - n) < 1) {
|
|
@@ -1636,8 +1656,8 @@ const Yo = /* @__PURE__ */ y.forwardRef(Xo), Jo = Object.freeze({ className: "aq
|
|
|
1636
1656
|
n.getClientRects().length !== 0 && (n.scrollTo({ top: 0, left: 0, behavior: "instant" }), t.reveal(n));
|
|
1637
1657
|
}, qt = (e, t, n) => {
|
|
1638
1658
|
if (e === null) return null;
|
|
1639
|
-
const r =
|
|
1640
|
-
return r === null ? (ni(t) && ci(e, n), null) : (
|
|
1659
|
+
const r = On(e, t);
|
|
1660
|
+
return r === null ? (ni(t) && ci(e, n), null) : (ai(e, r), si(n.scrollerOf(e, r), r), n.reveal(r), r);
|
|
1641
1661
|
};
|
|
1642
1662
|
function di({
|
|
1643
1663
|
title: e,
|
|
@@ -1728,7 +1748,7 @@ function vi({
|
|
|
1728
1748
|
clipRule: "evenodd"
|
|
1729
1749
|
}));
|
|
1730
1750
|
}
|
|
1731
|
-
const
|
|
1751
|
+
const wi = /* @__PURE__ */ y.forwardRef(vi), nt = "data-aqmx-key-repeat", rt = Object.freeze({ [nt]: "allow" }), gi = `[${nt}="${rt[nt]}"]`, bi = () => {
|
|
1732
1752
|
let e = null;
|
|
1733
1753
|
return {
|
|
1734
1754
|
onKeyDownCapture: (t) => {
|
|
@@ -1737,7 +1757,7 @@ const gi = /* @__PURE__ */ y.forwardRef(vi), nt = "data-aqmx-key-repeat", rt = O
|
|
|
1737
1757
|
e = t.target instanceof Element ? t.target : null;
|
|
1738
1758
|
return;
|
|
1739
1759
|
}
|
|
1740
|
-
e !== null && t.target === e && e.closest(
|
|
1760
|
+
e !== null && t.target === e && e.closest(gi) !== null || (t.preventDefault(), t.stopPropagation());
|
|
1741
1761
|
}
|
|
1742
1762
|
},
|
|
1743
1763
|
onKeyUpCapture: (t) => {
|
|
@@ -1747,7 +1767,7 @@ const gi = /* @__PURE__ */ y.forwardRef(vi), nt = "data-aqmx-key-repeat", rt = O
|
|
|
1747
1767
|
t.target === e && (e = null);
|
|
1748
1768
|
}
|
|
1749
1769
|
};
|
|
1750
|
-
}, Le = Object.freeze([1 / be ** 2, 1 / be, 1, be, be ** 2]), _t = Object.freeze({ mode: "fit" }), Ei = 1,
|
|
1770
|
+
}, Le = Object.freeze([1 / be ** 2, 1 / be, 1, be, be ** 2]), _t = Object.freeze({ mode: "fit" }), Ei = 1, Cn = Object.freeze({ className: "aqmx-document-canvas", "data-testid": "markdown-explorer-image-canvas" }), It = `[data-testid="${Cn["data-testid"]}"]`, yi = pe(null), xi = (e, t) => e.width > 0 && e.height > 0 && t.width - e.width <= Ei ? { base: e, scale: t.width / e.width } : t.width > 0 && t.height > 0 ? { base: t, scale: 1 } : null, Bt = (e, t, n) => {
|
|
1751
1771
|
if (e.mode === "level") {
|
|
1752
1772
|
const o = e.index + n;
|
|
1753
1773
|
return o >= 0 && o < Le.length ? o : null;
|
|
@@ -1757,11 +1777,11 @@ const gi = /* @__PURE__ */ y.forwardRef(vi), nt = "data-aqmx-key-repeat", rt = O
|
|
|
1757
1777
|
return r === -1 ? null : r;
|
|
1758
1778
|
}, zt = (e, t, n) => {
|
|
1759
1779
|
if (e.mode === "level") {
|
|
1760
|
-
const o =
|
|
1780
|
+
const o = Bt(e, null, n);
|
|
1761
1781
|
return o === null ? null : { mode: "level", index: o, base: e.base };
|
|
1762
1782
|
}
|
|
1763
1783
|
if (t === null) return null;
|
|
1764
|
-
const r =
|
|
1784
|
+
const r = Bt(e, t.scale, n);
|
|
1765
1785
|
return r === null ? null : { mode: "level", index: r, base: t.base };
|
|
1766
1786
|
}, Si = (e, t) => {
|
|
1767
1787
|
if (e <= 0 || t <= 0) return 0;
|
|
@@ -1774,11 +1794,11 @@ const gi = /* @__PURE__ */ y.forwardRef(vi), nt = "data-aqmx-key-repeat", rt = O
|
|
|
1774
1794
|
const t = Le[e];
|
|
1775
1795
|
if (t === void 0) throw new RangeError(`[markdown-explorer] no image zoom step ${String(e)}`);
|
|
1776
1796
|
return t;
|
|
1777
|
-
}, Ht = (e, t, n) => e !== null && e.width === t && e.height === n ? e : { width: t, height: n },
|
|
1778
|
-
const { labels: t } = D(), n = ne(yi), [r] =
|
|
1779
|
-
const { naturalWidth:
|
|
1780
|
-
u((
|
|
1781
|
-
}, []),
|
|
1797
|
+
}, Ht = (e, t, n) => e !== null && e.width === t && e.height === n ? e : { width: t, height: n }, Ti = ({ document: e }) => {
|
|
1798
|
+
const { labels: t } = D(), n = ne(yi), [r] = B(() => n === null ? null : n.read(e.url)), [o, i] = B(r === null ? _t : r.zoom), [l, u] = B(r === null ? null : r.reported), [m, f] = B(null), d = _(null), h = P((v) => {
|
|
1799
|
+
const { naturalWidth: a, naturalHeight: s } = v;
|
|
1800
|
+
u((w) => Ht(w, a, s));
|
|
1801
|
+
}, []), g = P(
|
|
1782
1802
|
(v) => {
|
|
1783
1803
|
d.current = v, !(v === null || !v.complete) && (v.naturalWidth > 0 || v.naturalHeight > 0 ? h(v) : v.decode().then(
|
|
1784
1804
|
() => h(v),
|
|
@@ -1793,47 +1813,47 @@ const gi = /* @__PURE__ */ y.forwardRef(vi), nt = "data-aqmx-key-repeat", rt = O
|
|
|
1793
1813
|
}, [n, e.url, o, l]), H(() => {
|
|
1794
1814
|
const v = d.current;
|
|
1795
1815
|
if (v === null || l === null || o.mode !== "fit") return;
|
|
1796
|
-
const
|
|
1797
|
-
if (
|
|
1798
|
-
const
|
|
1799
|
-
return
|
|
1816
|
+
const a = () => f((w) => Ht(w, v.clientWidth, v.clientHeight));
|
|
1817
|
+
if (a(), typeof ResizeObserver > "u") return;
|
|
1818
|
+
const s = new ResizeObserver(a);
|
|
1819
|
+
return s.observe(v), () => s.disconnect();
|
|
1800
1820
|
}, [l, o.mode]);
|
|
1801
|
-
const b = l === null || m === null ? null : xi(l, m),
|
|
1821
|
+
const b = l === null || m === null ? null : xi(l, m), M = zt(o, b, -1), R = zt(o, b, 1), S = o.mode === "level" ? ki(o.index) : null, A = _({ zoomIn: R, zoomOut: M });
|
|
1802
1822
|
H(() => {
|
|
1803
|
-
|
|
1823
|
+
A.current = { zoomIn: R, zoomOut: M };
|
|
1804
1824
|
});
|
|
1805
1825
|
const L = _(null);
|
|
1806
1826
|
H(() => {
|
|
1807
|
-
const v = L.current,
|
|
1808
|
-
L.current = null, !(v === null ||
|
|
1827
|
+
const v = L.current, a = d.current?.closest(It);
|
|
1828
|
+
L.current = null, !(v === null || a === null || a === void 0) && (a.scrollLeft = v.across * a.scrollWidth - v.x, a.scrollTop = v.down * a.scrollHeight - v.y);
|
|
1809
1829
|
}, [o]), te(() => {
|
|
1810
|
-
const v = d.current?.closest(
|
|
1830
|
+
const v = d.current?.closest(It);
|
|
1811
1831
|
if (v == null) return;
|
|
1812
|
-
let
|
|
1813
|
-
const
|
|
1814
|
-
const N = jt(
|
|
1815
|
-
|
|
1816
|
-
},
|
|
1817
|
-
const N = jt(
|
|
1818
|
-
if (
|
|
1819
|
-
|
|
1820
|
-
const q = Si(
|
|
1821
|
-
if (q ===
|
|
1822
|
-
const W = q >
|
|
1832
|
+
let a = null;
|
|
1833
|
+
const s = (C) => {
|
|
1834
|
+
const N = jt(C.touches);
|
|
1835
|
+
a = N === null ? null : { distance: N.distance, steps: 0 };
|
|
1836
|
+
}, w = (C) => {
|
|
1837
|
+
const N = jt(C.touches);
|
|
1838
|
+
if (a === null || N === null) return;
|
|
1839
|
+
C.preventDefault();
|
|
1840
|
+
const q = Si(a.distance, N.distance);
|
|
1841
|
+
if (q === a.steps) return;
|
|
1842
|
+
const W = q > a.steps ? 1 : -1, z = W === 1 ? A.current.zoomIn : A.current.zoomOut;
|
|
1823
1843
|
if (z === null) return;
|
|
1824
|
-
|
|
1844
|
+
a.steps += W;
|
|
1825
1845
|
const j = v.getBoundingClientRect(), Y = N.middle.x - j.left, V = N.middle.y - j.top;
|
|
1826
1846
|
L.current = v.scrollWidth > 0 && v.scrollHeight > 0 ? { x: Y, y: V, across: (v.scrollLeft + Y) / v.scrollWidth, down: (v.scrollTop + V) / v.scrollHeight } : null, i(z);
|
|
1827
|
-
},
|
|
1828
|
-
|
|
1847
|
+
}, T = (C) => {
|
|
1848
|
+
C.touches.length < 2 && (a = null);
|
|
1829
1849
|
};
|
|
1830
|
-
return v.addEventListener("touchstart",
|
|
1831
|
-
v.removeEventListener("touchstart",
|
|
1850
|
+
return v.addEventListener("touchstart", s, { passive: !0 }), v.addEventListener("touchmove", w, { passive: !1 }), v.addEventListener("touchend", T, { passive: !0 }), v.addEventListener("touchcancel", T, { passive: !0 }), () => {
|
|
1851
|
+
v.removeEventListener("touchstart", s), v.removeEventListener("touchmove", w), v.removeEventListener("touchend", T), v.removeEventListener("touchcancel", T);
|
|
1832
1852
|
};
|
|
1833
1853
|
}, []);
|
|
1834
1854
|
const E = o.mode === "level" && S !== null ? { width: `${o.base.width * S}px`, height: `${o.base.height * S}px` } : void 0;
|
|
1835
1855
|
return /* @__PURE__ */ F("div", { className: "aqmx-document-file", "data-testid": "markdown-explorer-image-view", children: [
|
|
1836
|
-
/* @__PURE__ */ F(qe, { name: e.name, openUrl: e.url, downloadUrl: e.url, icon: /* @__PURE__ */ c(
|
|
1856
|
+
/* @__PURE__ */ F(qe, { name: e.name, openUrl: e.url, downloadUrl: e.url, icon: /* @__PURE__ */ c(wi, {}), children: [
|
|
1837
1857
|
/* @__PURE__ */ c(
|
|
1838
1858
|
"button",
|
|
1839
1859
|
{
|
|
@@ -1841,9 +1861,9 @@ const gi = /* @__PURE__ */ y.forwardRef(vi), nt = "data-aqmx-key-repeat", rt = O
|
|
|
1841
1861
|
className: "aqmx-icon-button",
|
|
1842
1862
|
"aria-label": t.imageZoomOut,
|
|
1843
1863
|
title: t.imageZoomOut,
|
|
1844
|
-
"aria-disabled":
|
|
1864
|
+
"aria-disabled": M === null,
|
|
1845
1865
|
onClick: () => {
|
|
1846
|
-
|
|
1866
|
+
M !== null && i(M);
|
|
1847
1867
|
},
|
|
1848
1868
|
...rt,
|
|
1849
1869
|
children: /* @__PURE__ */ c(mi, {})
|
|
@@ -1857,9 +1877,9 @@ const gi = /* @__PURE__ */ y.forwardRef(vi), nt = "data-aqmx-key-repeat", rt = O
|
|
|
1857
1877
|
className: "aqmx-icon-button",
|
|
1858
1878
|
"aria-label": t.imageZoomIn,
|
|
1859
1879
|
title: t.imageZoomIn,
|
|
1860
|
-
"aria-disabled":
|
|
1880
|
+
"aria-disabled": R === null,
|
|
1861
1881
|
onClick: () => {
|
|
1862
|
-
|
|
1882
|
+
R !== null && i(R);
|
|
1863
1883
|
},
|
|
1864
1884
|
...rt,
|
|
1865
1885
|
children: /* @__PURE__ */ c(pi, {})
|
|
@@ -1867,21 +1887,21 @@ const gi = /* @__PURE__ */ y.forwardRef(vi), nt = "data-aqmx-key-repeat", rt = O
|
|
|
1867
1887
|
),
|
|
1868
1888
|
/* @__PURE__ */ c("button", { type: "button", className: "aqmx-icon-button", "aria-label": t.imageFit, title: t.imageFit, "aria-pressed": o.mode === "fit", onClick: () => i(_t), children: /* @__PURE__ */ c(ui, {}) })
|
|
1869
1889
|
] }),
|
|
1870
|
-
/* @__PURE__ */ c(ve, { scrollerProps:
|
|
1890
|
+
/* @__PURE__ */ c(ve, { scrollerProps: Cn, children: /* @__PURE__ */ c("img", { ref: g, className: "aqmx-document-image", src: e.url, alt: e.name, "data-aqmx-image-mode": o.mode, style: E, onLoad: (v) => h(v.currentTarget), "data-testid": "markdown-explorer-image" }) })
|
|
1871
1891
|
] });
|
|
1872
|
-
}, Ln = pe(null),
|
|
1892
|
+
}, Ln = pe(null), Ie = pe(void 0), An = pe(null), Be = () => {
|
|
1873
1893
|
const e = ne(Ln);
|
|
1874
1894
|
if (e === null) throw new Error("[markdown-explorer] document links must be rendered inside a document pane");
|
|
1875
1895
|
return e;
|
|
1876
|
-
},
|
|
1877
|
-
const e = ne(
|
|
1896
|
+
}, Ri = () => {
|
|
1897
|
+
const e = ne(An);
|
|
1878
1898
|
if (e === null) throw new Error("[markdown-explorer] table-of-contents entries must be rendered inside a document pane's links");
|
|
1879
1899
|
return e;
|
|
1880
|
-
}, ze = (e, t, n, r) => t.kind === "panel" ? ye(e, { view: "tree", source: n, doc: r }) : t.view === "single" ? ye(e, { view: "single", source: n, doc: r, overrides: t.overrides, embed: t.embed }) : ye(e, { view: "tree", source: n, doc: r, overrides: t.overrides }),
|
|
1881
|
-
const { config: t } = D(), n =
|
|
1882
|
-
return /* @__PURE__ */ c(
|
|
1883
|
-
},
|
|
1884
|
-
const t = e instanceof Element ? e.closest(
|
|
1900
|
+
}, ze = (e, t, n, r) => t.kind === "panel" ? ye(e, { view: "tree", source: n, doc: r }) : t.view === "single" ? ye(e, { view: "single", source: n, doc: r, overrides: t.overrides, embed: t.embed }) : ye(e, { view: "tree", source: n, doc: r, overrides: t.overrides }), Mi = ({ children: e }) => {
|
|
1901
|
+
const { config: t } = D(), n = Be(), r = lt(), o = r.kind === "location" ? r.location.source : void 0, i = $e(ze(t, n.navigation, o, n.currentPath));
|
|
1902
|
+
return /* @__PURE__ */ c(Ie, { value: o, children: /* @__PURE__ */ c(An, { value: i, children: e }) });
|
|
1903
|
+
}, Oi = 'a[data-link-kind="doc"][data-doc-path]:not([data-doc-exists="false"])', Ci = (e) => {
|
|
1904
|
+
const t = e instanceof Element ? e.closest(Oi) : null;
|
|
1885
1905
|
return t === null ? null : t.getAttribute("data-doc-path");
|
|
1886
1906
|
}, je = (e) => !e.defaultPrevented && e.button === 0 && !e.metaKey && !e.ctrlKey && !e.shiftKey && !e.altKey, Li = ({ to: e, docPath: t, fragment: n, exists: r, className: o, attributes: i, onDocumentLink: l, scope: u, children: m }) => {
|
|
1887
1907
|
const f = $e(e);
|
|
@@ -1894,9 +1914,9 @@ const gi = /* @__PURE__ */ y.forwardRef(vi), nt = "data-aqmx-key-repeat", rt = O
|
|
|
1894
1914
|
l(t, n);
|
|
1895
1915
|
}
|
|
1896
1916
|
}, children: m });
|
|
1897
|
-
},
|
|
1898
|
-
const { config: l } = D(), u =
|
|
1899
|
-
return d.kind === "page" ? /* @__PURE__ */ c(
|
|
1917
|
+
}, Ai = ({ href: e, docPath: t, docExists: n, className: r, attributes: o, children: i }) => {
|
|
1918
|
+
const { config: l } = D(), u = Be(), m = ne(Ie), f = ei(e), { navigation: d } = u, h = `${ze(l, d, m, t)}${f}`, g = n === !1 ? "false" : void 0;
|
|
1919
|
+
return d.kind === "page" ? /* @__PURE__ */ c(Co, { ...o, to: h, navigation: "follow-link", className: r, "data-link-kind": "doc", "data-doc-path": t, "data-doc-exists": g, children: i }) : /* @__PURE__ */ c(Li, { to: h, docPath: t, fragment: f, exists: g, className: r, attributes: o, onDocumentLink: d.onDocumentLink, scope: u, children: i });
|
|
1900
1920
|
}, Ni = ({ className: e, attributes: t, children: n }) => {
|
|
1901
1921
|
const { labels: r } = D();
|
|
1902
1922
|
return (
|
|
@@ -1910,31 +1930,31 @@ const gi = /* @__PURE__ */ y.forwardRef(vi), nt = "data-aqmx-key-repeat", rt = O
|
|
|
1910
1930
|
] })
|
|
1911
1931
|
);
|
|
1912
1932
|
}, Di = ({ href: e, className: t, attributes: n, scope: r, children: o }) => {
|
|
1913
|
-
const { config: i } = D(), l = ne(
|
|
1933
|
+
const { config: i } = D(), l = ne(Ie), u = $e(`${ze(i, r.navigation, l, r.currentPath)}${e}`);
|
|
1914
1934
|
return /* @__PURE__ */ c("a", { ...n, href: u, className: t, onClick: (f) => {
|
|
1915
1935
|
je(f) && (f.preventDefault(), r.scrollWithin(e));
|
|
1916
1936
|
}, children: o });
|
|
1917
1937
|
}, Pi = ({ href: e, className: t, attributes: n, children: r }) => {
|
|
1918
|
-
const o =
|
|
1938
|
+
const o = Be();
|
|
1919
1939
|
return o.navigation.kind === "page" ? /* @__PURE__ */ c("a", { ...n, href: e, className: t, onClick: (l) => {
|
|
1920
1940
|
if (!je(l)) return;
|
|
1921
1941
|
const u = l.currentTarget;
|
|
1922
1942
|
e === "#" ? o.followEmptyFragment(l.nativeEvent) : u.href === u.ownerDocument.URL && o.followSameUrlJump(e, l.nativeEvent);
|
|
1923
1943
|
}, children: r }) : /* @__PURE__ */ c(Di, { href: e, className: t, attributes: n, scope: o, children: r });
|
|
1924
|
-
}, $i = ({ href: e, kind: t, docPath: n, docExists: r, className: o, attributes: i, children: l }) => t === "doc" ? n === void 0 || !tr(n) ? /* @__PURE__ */ c(Ni, { className: o, attributes: i, children: l }) : /* @__PURE__ */ c(
|
|
1925
|
-
const { config: e } = D(), t =
|
|
1944
|
+
}, $i = ({ href: e, kind: t, docPath: n, docExists: r, className: o, attributes: i, children: l }) => t === "doc" ? n === void 0 || !tr(n) ? /* @__PURE__ */ c(Ni, { className: o, attributes: i, children: l }) : /* @__PURE__ */ c(Ai, { href: e, docPath: n, docExists: r, className: o, attributes: i, children: l }) : e.startsWith("#") ? /* @__PURE__ */ c(Pi, { href: e, className: o, attributes: i, children: l }) : /* @__PURE__ */ c("a", { ...i, href: e, className: o, children: l }), Fi = () => {
|
|
1945
|
+
const { config: e } = D(), t = Be(), n = ne(Ie), r = Fe();
|
|
1926
1946
|
return P(
|
|
1927
1947
|
(o, i) => {
|
|
1928
1948
|
if (!je(i)) return !0;
|
|
1929
1949
|
i.preventDefault();
|
|
1930
|
-
const l =
|
|
1950
|
+
const l = Rn(o.id), { navigation: u } = t;
|
|
1931
1951
|
return u.kind === "panel" || ct(i.currentTarget.ownerDocument.location.hash) === o.id ? (t.scrollWithin(l), !0) : (r(`${ze(e, u, n, t.currentPath)}${l}`, "follow-link"), !0);
|
|
1932
1952
|
},
|
|
1933
1953
|
[e, t, n, r]
|
|
1934
1954
|
);
|
|
1935
1955
|
}, qi = () => {
|
|
1936
|
-
const e =
|
|
1937
|
-
return P((t) => `${e}${
|
|
1956
|
+
const e = Ri();
|
|
1957
|
+
return P((t) => `${e}${Rn(t.id)}`, [e]);
|
|
1938
1958
|
};
|
|
1939
1959
|
function _i({
|
|
1940
1960
|
title: e,
|
|
@@ -1955,8 +1975,8 @@ function _i({
|
|
|
1955
1975
|
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"
|
|
1956
1976
|
}));
|
|
1957
1977
|
}
|
|
1958
|
-
const
|
|
1959
|
-
function
|
|
1978
|
+
const Ii = /* @__PURE__ */ y.forwardRef(_i);
|
|
1979
|
+
function Bi({
|
|
1960
1980
|
title: e,
|
|
1961
1981
|
titleId: t,
|
|
1962
1982
|
...n
|
|
@@ -1977,7 +1997,7 @@ function Ii({
|
|
|
1977
1997
|
clipRule: "evenodd"
|
|
1978
1998
|
}));
|
|
1979
1999
|
}
|
|
1980
|
-
const zi = /* @__PURE__ */ y.forwardRef(
|
|
2000
|
+
const zi = /* @__PURE__ */ y.forwardRef(Bi);
|
|
1981
2001
|
function ji({
|
|
1982
2002
|
title: e,
|
|
1983
2003
|
titleId: t,
|
|
@@ -2016,7 +2036,7 @@ const Hi = /* @__PURE__ */ y.forwardRef(ji), Vi = Object.freeze({ className: "aq
|
|
|
2016
2036
|
case "audio":
|
|
2017
2037
|
return /* @__PURE__ */ c(Hi, {});
|
|
2018
2038
|
case "pdf":
|
|
2019
|
-
return /* @__PURE__ */ c(
|
|
2039
|
+
return /* @__PURE__ */ c(Ii, {});
|
|
2020
2040
|
default: {
|
|
2021
2041
|
const t = e;
|
|
2022
2042
|
throw new RangeError(`[markdown-explorer] unknown media type ${String(t)}`);
|
|
@@ -2064,15 +2084,25 @@ const Hi = /* @__PURE__ */ y.forwardRef(ji), Vi = Object.freeze({ className: "aq
|
|
|
2064
2084
|
alignCenter: e.viewerAlignCenter,
|
|
2065
2085
|
alignRight: e.viewerAlignRight,
|
|
2066
2086
|
mermaidInteractionMode: e.viewerMermaidInteractionMode,
|
|
2087
|
+
mermaidInteractionModeTouch: e.viewerMermaidInteractionModeTouch,
|
|
2067
2088
|
mermaidModeNone: e.viewerMermaidModeNone,
|
|
2068
2089
|
mermaidModeZoom: e.viewerMermaidModeZoom,
|
|
2069
2090
|
mermaidModePan: e.viewerMermaidModePan,
|
|
2070
2091
|
mermaidModePanShift: e.viewerMermaidModePanShift,
|
|
2071
2092
|
mermaidModeBoth: e.viewerMermaidModeBoth,
|
|
2072
2093
|
mermaidModeBothShift: e.viewerMermaidModeBothShift,
|
|
2094
|
+
mermaidModeNoneTouch: e.viewerMermaidModeNoneTouch,
|
|
2095
|
+
mermaidModeZoomTouch: e.viewerMermaidModeZoomTouch,
|
|
2096
|
+
mermaidModePanTouch: e.viewerMermaidModePanTouch,
|
|
2097
|
+
mermaidModeBothTouch: e.viewerMermaidModeBothTouch,
|
|
2073
2098
|
mermaidZoomIn: e.viewerMermaidZoomIn,
|
|
2074
2099
|
mermaidZoomOut: e.viewerMermaidZoomOut,
|
|
2075
2100
|
mermaidResetView: e.viewerMermaidResetView,
|
|
2101
|
+
mermaidPanUp: e.viewerMermaidPanUp,
|
|
2102
|
+
mermaidPanDown: e.viewerMermaidPanDown,
|
|
2103
|
+
mermaidPanLeft: e.viewerMermaidPanLeft,
|
|
2104
|
+
mermaidPanRight: e.viewerMermaidPanRight,
|
|
2105
|
+
mermaidDiagram: e.viewerMermaidDiagram,
|
|
2076
2106
|
mermaidRetry: e.viewerMermaidRetry,
|
|
2077
2107
|
embeddedVideo: e.viewerEmbeddedVideo,
|
|
2078
2108
|
embeddedPost: e.viewerEmbeddedPost,
|
|
@@ -2098,16 +2128,16 @@ const Hi = /* @__PURE__ */ y.forwardRef(ji), Vi = Object.freeze({ className: "aq
|
|
|
2098
2128
|
}, tl = ({ absence: e, announces: t, announceFailure: n }) => {
|
|
2099
2129
|
const { labels: r, announcer: o } = D(), i = e.kind === "no-readme" ? e.folder : null, l = e.kind === "failure" ? e.folder : null, u = e.kind === "failure" ? e.failure : null;
|
|
2100
2130
|
switch (te(() => {
|
|
2101
|
-
t && i !== null && o.announce(r.folderReadmeMissing(
|
|
2131
|
+
t && i !== null && o.announce(r.folderReadmeMissing(se(i)));
|
|
2102
2132
|
}, [t, i, o, r]), te(() => {
|
|
2103
|
-
l !== null && u !== null && n(r.documentFailed(
|
|
2133
|
+
l !== null && u !== null && n(r.documentFailed(se(l), ae(r, u.reason)));
|
|
2104
2134
|
}, [l, u, n, r]), e.kind) {
|
|
2105
2135
|
case "empty":
|
|
2106
2136
|
return /* @__PURE__ */ c(xe, { kind: "empty", label: r.documentRegion, stale: !1, busy: !1, children: /* @__PURE__ */ c("div", { className: "aqmx-empty", "data-testid": "markdown-explorer-document-empty", children: /* @__PURE__ */ c("p", { className: "aqmx-empty-title", children: r.documentEmpty }) }) });
|
|
2107
2137
|
case "loading":
|
|
2108
2138
|
return /* @__PURE__ */ c(ut, { label: r.documentRegion });
|
|
2109
2139
|
case "no-readme":
|
|
2110
|
-
return /* @__PURE__ */ c(xe, { kind: "empty", label: r.documentRegion, stale: !1, busy: !1, children: /* @__PURE__ */ c("div", { className: "aqmx-empty", "data-testid": "markdown-explorer-folder-empty", children: /* @__PURE__ */ c("p", { className: "aqmx-empty-title", children: r.folderReadmeMissing(
|
|
2140
|
+
return /* @__PURE__ */ c(xe, { kind: "empty", label: r.documentRegion, stale: !1, busy: !1, children: /* @__PURE__ */ c("div", { className: "aqmx-empty", "data-testid": "markdown-explorer-folder-empty", children: /* @__PURE__ */ c("p", { className: "aqmx-empty-title", children: r.folderReadmeMissing(se(e.folder)) }) }) });
|
|
2111
2141
|
case "failure":
|
|
2112
2142
|
return /* @__PURE__ */ c(xe, { kind: "failure", label: r.documentRegion, stale: !1, busy: !1, children: /* @__PURE__ */ c(ve, { scrollerProps: ft, children: /* @__PURE__ */ c(me, { failure: e.failure, alert: !1, onRetry: e.onRetry, testId: "markdown-explorer-folder-failure" }) }) });
|
|
2113
2143
|
}
|
|
@@ -2118,71 +2148,71 @@ const Hi = /* @__PURE__ */ y.forwardRef(ji), Vi = Object.freeze({ className: "aq
|
|
|
2118
2148
|
/* @__PURE__ */ c("p", { className: "aqmx-sr-only", children: t.documentLoading })
|
|
2119
2149
|
] });
|
|
2120
2150
|
}, Vt = Object.freeze(["wheel", "touchstart", "pointerdown", "keydown"]), nl = ({ path: e, document: t, viewer: n, editing: r }) => {
|
|
2121
|
-
const { reportMathDiagnostics: o, edits: i } = D(), l = G(() => ({ htmlContent: t.htmlContent, headings: [...t.headings] }), [t]), u = Fi(), m = qi(), f = G(() => o === void 0 ? void 0 : (
|
|
2151
|
+
const { reportMathDiagnostics: o, edits: i } = D(), l = G(() => ({ htmlContent: t.htmlContent, headings: [...t.headings] }), [t]), u = Fi(), m = qi(), f = G(() => o === void 0 ? void 0 : (a) => o(e, a), [o, e]), d = _(null), { editable: h, doubleClick: g, region: b, paneScroll: M, stale: R } = r;
|
|
2122
2152
|
H(() => {
|
|
2123
2153
|
if (h)
|
|
2124
2154
|
return i.bindView(e, {
|
|
2125
2155
|
anchor: () => {
|
|
2126
|
-
const
|
|
2127
|
-
return
|
|
2156
|
+
const a = d.current, s = b(), w = a === null ? null : a.querySelector(_e);
|
|
2157
|
+
return a === null || s === null || w === null ? null : xo(a, M.scrollerOf(s, w));
|
|
2128
2158
|
}
|
|
2129
2159
|
});
|
|
2130
|
-
}, [i, e, h, b,
|
|
2131
|
-
const S = (
|
|
2132
|
-
const
|
|
2133
|
-
!
|
|
2134
|
-
},
|
|
2160
|
+
}, [i, e, h, b, M]);
|
|
2161
|
+
const S = (a) => {
|
|
2162
|
+
const s = d.current, { target: w } = a;
|
|
2163
|
+
!g || s === null || !(w instanceof Element) || !Eo(w) || (a.stopPropagation(), i.start(e, yo(w, s, s.ownerDocument.getSelection())));
|
|
2164
|
+
}, A = _(null), L = _(R);
|
|
2135
2165
|
H(() => {
|
|
2136
|
-
L.current =
|
|
2166
|
+
L.current = R;
|
|
2137
2167
|
});
|
|
2138
|
-
const E = le((
|
|
2139
|
-
const
|
|
2140
|
-
if (
|
|
2141
|
-
const
|
|
2142
|
-
return
|
|
2143
|
-
}), v = le((
|
|
2144
|
-
const
|
|
2145
|
-
if (
|
|
2146
|
-
const
|
|
2147
|
-
for (const
|
|
2148
|
-
|
|
2149
|
-
},
|
|
2150
|
-
for (const
|
|
2151
|
-
|
|
2168
|
+
const E = le((a) => {
|
|
2169
|
+
const s = d.current, w = b(), T = s === null ? null : Mo(s, a.line);
|
|
2170
|
+
if (w === null || T === null) return !1;
|
|
2171
|
+
const C = M.scrollerOf(w, T);
|
|
2172
|
+
return C.scrollTop += Oo(T, a.line) - a.clientTop, !0;
|
|
2173
|
+
}), v = le((a) => {
|
|
2174
|
+
const s = b();
|
|
2175
|
+
if (s === null) return;
|
|
2176
|
+
const w = () => {
|
|
2177
|
+
for (const C of Vt) s.removeEventListener(C, T, !0);
|
|
2178
|
+
A.current?.release === w && (A.current = null);
|
|
2179
|
+
}, T = () => w();
|
|
2180
|
+
for (const C of Vt) s.addEventListener(C, T, { capture: !0, passive: !0 });
|
|
2181
|
+
A.current = { point: a, release: w };
|
|
2152
2182
|
});
|
|
2153
2183
|
return H(() => {
|
|
2154
|
-
const
|
|
2155
|
-
if (
|
|
2184
|
+
const a = i.takeReturn(e);
|
|
2185
|
+
if (a !== null)
|
|
2156
2186
|
return queueMicrotask(() => {
|
|
2157
|
-
E(
|
|
2158
|
-
}), () =>
|
|
2187
|
+
E(a) && L.current && v(a);
|
|
2188
|
+
}), () => A.current?.release();
|
|
2159
2189
|
}, [i, e]), H(() => {
|
|
2160
|
-
const
|
|
2161
|
-
|
|
2162
|
-
}, [t,
|
|
2163
|
-
/* @__PURE__ */ c("div", { ref: d, className: "aqmx-document-viewer", onDoubleClick: S, children: /* @__PURE__ */ c(
|
|
2190
|
+
const a = A.current;
|
|
2191
|
+
a === null || R || (a.release(), E(a.point));
|
|
2192
|
+
}, [t, R]),
|
|
2193
|
+
/* @__PURE__ */ c("div", { ref: d, className: "aqmx-document-viewer", onDoubleClick: S, children: /* @__PURE__ */ c(an, { ...n, onHeadingSelect: u, headingHref: m, onMathDiagnostics: f, parseResult: l, content: null }) });
|
|
2164
2194
|
}, Pn = ({ document: e, viewer: t }) => {
|
|
2165
2195
|
const { labels: n } = D();
|
|
2166
2196
|
return /* @__PURE__ */ F(Pe, { children: [
|
|
2167
2197
|
/* @__PURE__ */ c(qe, { name: e.name, openUrl: nr(e.url), downloadUrl: e.url, icon: /* @__PURE__ */ c(uo, {}), children: e.truncated ? null : /* @__PURE__ */ c(Vo, { text: e.text }) }),
|
|
2168
2198
|
e.truncated ? /* @__PURE__ */ c("p", { className: "aqmx-callout aqmx-document-notice", role: "note", "data-testid": "markdown-explorer-text-truncated", children: n.textTruncated }) : null,
|
|
2169
|
-
/* @__PURE__ */ c("div", { className: "aqmx-document-viewer", children: /* @__PURE__ */ c(
|
|
2199
|
+
/* @__PURE__ */ c("div", { className: "aqmx-document-viewer", children: /* @__PURE__ */ c(an, { ...t, parseResult: null, content: e.text }) })
|
|
2170
2200
|
] });
|
|
2171
2201
|
}, rl = ({ path: e, name: t, viewer: n }) => {
|
|
2172
|
-
const { data: r, documents: o, announcer: i, labels: l } = D(), u = P(() => o.answerStampOf(e), [o, e]), m = ee(o.subscribe, u, u), [f, d] =
|
|
2173
|
-
b(S), S.kind === "failure" && i.announce(l.documentFailed(t,
|
|
2202
|
+
const { data: r, documents: o, announcer: i, labels: l } = D(), u = P(() => o.answerStampOf(e), [o, e]), m = ee(o.subscribe, u, u), [f, d] = B(0), h = G(() => ({ path: e, stamp: m, attempt: f }), [e, m, f]), [g, b] = B(null), M = le((S) => {
|
|
2203
|
+
b(S), S.kind === "failure" && i.announce(l.documentFailed(t, ae(l, S.failure.reason)));
|
|
2174
2204
|
});
|
|
2175
2205
|
te(() => {
|
|
2176
2206
|
const S = new AbortController();
|
|
2177
|
-
return r.text(h.path, S.signal).then((
|
|
2178
|
-
"kind" in
|
|
2207
|
+
return r.text(h.path, S.signal).then((A) => {
|
|
2208
|
+
"kind" in A && M(A);
|
|
2179
2209
|
}), () => S.abort();
|
|
2180
2210
|
}, [r, h]);
|
|
2181
|
-
const
|
|
2182
|
-
return
|
|
2211
|
+
const R = P(() => d((S) => S + 1), []);
|
|
2212
|
+
return g === null ? /* @__PURE__ */ F(Pe, { children: [
|
|
2183
2213
|
/* @__PURE__ */ c("div", { className: "aqmx-skeleton", "aria-hidden": "true", "data-testid": "markdown-explorer-markup-skeleton", children: dt.map((S) => /* @__PURE__ */ c("span", {}, S)) }),
|
|
2184
2214
|
/* @__PURE__ */ c("p", { className: "aqmx-sr-only", children: l.markupLoading })
|
|
2185
|
-
] }) :
|
|
2215
|
+
] }) : g.kind === "failure" ? /* @__PURE__ */ c(ve, { scrollerProps: ft, children: /* @__PURE__ */ c(me, { failure: g.failure, alert: !1, onRetry: R, testId: "markdown-explorer-markup-failure" }) }) : /* @__PURE__ */ c(Pn, { document: g, viewer: n });
|
|
2186
2216
|
}, ft = Object.freeze({ className: "aqmx-document-failure", "data-aqmx-document-scroller": "" }), ol = Object.freeze({ reason: "failed" }), il = (e) => /* @__PURE__ */ c(
|
|
2187
2217
|
ho,
|
|
2188
2218
|
{
|
|
@@ -2207,7 +2237,7 @@ const Hi = /* @__PURE__ */ y.forwardRef(ji), Vi = Object.freeze({ className: "aq
|
|
|
2207
2237
|
case "text":
|
|
2208
2238
|
return /* @__PURE__ */ c(Pn, { document: t, viewer: r });
|
|
2209
2239
|
case "image":
|
|
2210
|
-
return /* @__PURE__ */ c(
|
|
2240
|
+
return /* @__PURE__ */ c(Ti, { document: t });
|
|
2211
2241
|
case "media":
|
|
2212
2242
|
return /* @__PURE__ */ c(Yi, { document: t });
|
|
2213
2243
|
case "file":
|
|
@@ -2219,8 +2249,8 @@ const Hi = /* @__PURE__ */ y.forwardRef(ji), Vi = Object.freeze({ className: "aq
|
|
|
2219
2249
|
throw new RangeError(`[markdown-explorer] unknown document kind in ${JSON.stringify(l)}`);
|
|
2220
2250
|
}
|
|
2221
2251
|
}
|
|
2222
|
-
},
|
|
2223
|
-
const [r] = t.kind === "markdown" ? t.headings : [], o = [n === null ? null :
|
|
2252
|
+
}, al = 'a[href], button:not(:disabled), input:not(:disabled), select:not(:disabled), textarea:not(:disabled), iframe, audio[controls], video[controls], [tabindex]:not([tabindex="-1"])', sl = (e, t, n) => {
|
|
2253
|
+
const [r] = t.kind === "markdown" ? t.headings : [], o = [n === null ? null : On(e, n), r === void 0 ? null : Mn(e, r.id), e.querySelector(_e), e.querySelector(al)];
|
|
2224
2254
|
for (const i of o)
|
|
2225
2255
|
if (i instanceof HTMLElement && xn(i)) return i;
|
|
2226
2256
|
return null;
|
|
@@ -2235,17 +2265,17 @@ const Hi = /* @__PURE__ */ y.forwardRef(ji), Vi = Object.freeze({ className: "aq
|
|
|
2235
2265
|
const r = n.ownerDocument, o = r.defaultView;
|
|
2236
2266
|
if (o === null) throw new Error("[markdown-explorer] the document region's document has no window");
|
|
2237
2267
|
let i = !1, l;
|
|
2238
|
-
const u = (
|
|
2239
|
-
i = !(
|
|
2268
|
+
const u = (g) => {
|
|
2269
|
+
i = !(g.target instanceof Node && n.contains(g.target)), i && !n.contains(r.activeElement) && (t.current = !1), clearTimeout(l), l = setTimeout(() => {
|
|
2240
2270
|
i = !1;
|
|
2241
2271
|
}, 0);
|
|
2242
|
-
}, m = (
|
|
2243
|
-
t.current =
|
|
2244
|
-
}, f = (
|
|
2245
|
-
|
|
2272
|
+
}, m = (g) => {
|
|
2273
|
+
t.current = g.target instanceof Node && n.contains(g.target);
|
|
2274
|
+
}, f = (g) => {
|
|
2275
|
+
g.relatedTarget === null && i && (t.current = !1);
|
|
2246
2276
|
}, d = () => {
|
|
2247
|
-
const { activeElement:
|
|
2248
|
-
|
|
2277
|
+
const { activeElement: g, body: b } = r;
|
|
2278
|
+
g !== null && g !== b && (t.current = n.contains(g));
|
|
2249
2279
|
}, h = () => {
|
|
2250
2280
|
i && !n.contains(r.activeElement) && (t.current = !1);
|
|
2251
2281
|
};
|
|
@@ -2253,61 +2283,61 @@ const Hi = /* @__PURE__ */ y.forwardRef(ji), Vi = Object.freeze({ className: "aq
|
|
|
2253
2283
|
clearTimeout(l), o.removeEventListener("pointerdown", u, !0), o.removeEventListener("mousedown", u, !0), o.removeEventListener("focusin", m, !0), o.removeEventListener("blur", d), o.removeEventListener("focus", h), n.removeEventListener("focusout", f);
|
|
2254
2284
|
};
|
|
2255
2285
|
}, [e]), t;
|
|
2256
|
-
}, dl = ({ path: e, snapshot: t, markup: n, stale: r, viewer: o, editLayout: i, regionLabel: l, navigation: u, fragment: m, paneScroll: f, announces: d, announceFailure: h, onDocumentShown:
|
|
2257
|
-
const { labels: b, announcer:
|
|
2286
|
+
}, dl = ({ path: e, snapshot: t, markup: n, stale: r, viewer: o, editLayout: i, regionLabel: l, navigation: u, fragment: m, paneScroll: f, announces: d, announceFailure: h, onDocumentShown: g }) => {
|
|
2287
|
+
const { labels: b, announcer: M, documents: R } = D(), { document: S } = t, A = _(null), L = _(null), E = _(null), v = _(0), a = cl(A), s = _({ path: e, document: S }), w = _(null), T = P(
|
|
2258
2288
|
(Z) => {
|
|
2259
|
-
const X =
|
|
2260
|
-
X !== null && Q !== null && Ut(X, Q,
|
|
2289
|
+
const X = A.current, Q = qt(X, Z, f);
|
|
2290
|
+
X !== null && Q !== null && Ut(X, Q, a.current);
|
|
2261
2291
|
},
|
|
2262
|
-
[f,
|
|
2263
|
-
),
|
|
2292
|
+
[f, a]
|
|
2293
|
+
), C = P(
|
|
2264
2294
|
(Z, X) => {
|
|
2265
2295
|
const Q = v.current;
|
|
2266
2296
|
setTimeout(() => {
|
|
2267
|
-
!X.defaultPrevented && v.current === Q &&
|
|
2297
|
+
!X.defaultPrevented && v.current === Q && T(Z);
|
|
2268
2298
|
}, 0);
|
|
2269
2299
|
},
|
|
2270
|
-
[
|
|
2300
|
+
[T]
|
|
2271
2301
|
), N = P(
|
|
2272
2302
|
(Z) => {
|
|
2273
2303
|
setTimeout(() => {
|
|
2274
|
-
Z.defaultPrevented ||
|
|
2304
|
+
Z.defaultPrevented || T("#");
|
|
2275
2305
|
}, 0);
|
|
2276
2306
|
},
|
|
2277
|
-
[
|
|
2278
|
-
), q = G(() => ({ navigation: u, currentPath: e, scrollWithin:
|
|
2307
|
+
[T]
|
|
2308
|
+
), q = G(() => ({ navigation: u, currentPath: e, scrollWithin: T, followSameUrlJump: C, followEmptyFragment: N }), [u, e, T, C, N]), W = P(() => R.retry(e), [R, e]), z = Lo(R, Ci), j = bn(e), Y = j !== void 0 ? "edit" : n ? "markup" : "rendered", V = S.kind === "markdown" ? Y : void 0, re = P(() => A.current, []), p = G(() => ({ session: j, layout: i, region: re, paneScroll: f, stale: r }), [j, i, re, f, r]), x = V === "edit" ? !1 : r, k = ne(he), O = V === "edit" && i === "fill" ? "fill" : k, $ = le((Z, X) => {
|
|
2279
2309
|
const Q = L.current;
|
|
2280
2310
|
if (Q !== null && Q.path === Z && Q.snapshot === X) return;
|
|
2281
2311
|
L.current = { path: Z, snapshot: X };
|
|
2282
2312
|
const oe = X.document;
|
|
2283
2313
|
if (oe.kind === "failure") {
|
|
2284
|
-
|
|
2314
|
+
R.noteFailureShown(X) && h(b.documentFailed(se(Z), ae(b, oe.failure.reason)));
|
|
2285
2315
|
return;
|
|
2286
2316
|
}
|
|
2287
|
-
|
|
2317
|
+
g?.(Z, oe), d && (Q === null || Q.path !== Z || Q.snapshot.document.kind === "failure") && M.announce(b.documentShown(oe.name));
|
|
2288
2318
|
});
|
|
2289
2319
|
te(() => {
|
|
2290
2320
|
$(e, t);
|
|
2291
2321
|
}, [e, t]);
|
|
2292
|
-
const
|
|
2322
|
+
const I = le(() => {
|
|
2293
2323
|
m.kind === "panel" && m.consume();
|
|
2294
2324
|
}), K = le((Z) => {
|
|
2295
|
-
const X =
|
|
2296
|
-
if (X === null || !
|
|
2325
|
+
const X = A.current;
|
|
2326
|
+
if (X === null || !a.current) return null;
|
|
2297
2327
|
const { activeElement: Q, body: oe } = X.ownerDocument;
|
|
2298
|
-
return Q !== null && Q !== oe ? null :
|
|
2328
|
+
return Q !== null && Q !== oe ? null : sl(X, S, Z);
|
|
2299
2329
|
}), U = le((Z) => {
|
|
2300
|
-
const X =
|
|
2301
|
-
X !== null && Ut(X, Z,
|
|
2302
|
-
}), ie = le((Z) => f.reveal(Z)), ht = le((Z) => qt(
|
|
2330
|
+
const X = A.current;
|
|
2331
|
+
X !== null && Ut(X, Z, a.current);
|
|
2332
|
+
}), ie = le((Z) => f.reveal(Z)), ht = le((Z) => qt(A.current, Z, f));
|
|
2303
2333
|
return te(() => {
|
|
2304
2334
|
if (r) return;
|
|
2305
|
-
const Z =
|
|
2306
|
-
|
|
2307
|
-
const Q =
|
|
2308
|
-
|
|
2335
|
+
const Z = s.current.path !== e, X = Z || s.current.document !== S;
|
|
2336
|
+
s.current = { path: e, document: S };
|
|
2337
|
+
const Q = w.current !== e;
|
|
2338
|
+
w.current = e;
|
|
2309
2339
|
let oe = null;
|
|
2310
|
-
m.kind === "page" ? E.current !== m.navigation && (E.current = m.navigation, v.current += 1, oe = m.fragment) : m.fragment !== null && (oe = m.fragment,
|
|
2340
|
+
m.kind === "page" ? E.current !== m.navigation && (E.current = m.navigation, v.current += 1, oe = m.fragment) : m.fragment !== null && (oe = m.fragment, I());
|
|
2311
2341
|
const pt = () => {
|
|
2312
2342
|
const He = oe === null ? null : ht(oe);
|
|
2313
2343
|
if (!X) {
|
|
@@ -2318,7 +2348,7 @@ const Hi = /* @__PURE__ */ y.forwardRef(ji), Vi = Object.freeze({ className: "aq
|
|
|
2318
2348
|
Z && He === null && vt !== null && ie(vt);
|
|
2319
2349
|
};
|
|
2320
2350
|
Q ? queueMicrotask(pt) : pt();
|
|
2321
|
-
}, [m, e, S, r]), /* @__PURE__ */ c(he, { value:
|
|
2351
|
+
}, [m, e, S, r]), /* @__PURE__ */ c(he, { value: O, children: /* @__PURE__ */ c(xe, { kind: S.kind, view: V, label: l(e, S), stale: x, busy: x, frameRef: A, intent: z, children: /* @__PURE__ */ c(Ln, { value: q, children: /* @__PURE__ */ c(Mi, { children: /* @__PURE__ */ c(ll, { path: e, document: S, view: Y, viewer: o, onRetry: W, editing: p }, e) }) }) }) });
|
|
2322
2352
|
}, mt = Object.freeze({ kind: "skeleton" }), ul = (e, t, n, r, o) => {
|
|
2323
2353
|
if (t?.status === "loaded") return { kind: "document", path: e, snapshot: t, stale: !1 };
|
|
2324
2354
|
const i = ue(t);
|
|
@@ -2330,26 +2360,26 @@ const Hi = /* @__PURE__ */ y.forwardRef(ji), Vi = Object.freeze({ className: "aq
|
|
|
2330
2360
|
const o = t.kind === "streaming" ? fl(t.path, ne(t.promise)) : t;
|
|
2331
2361
|
return o.kind !== "document" ? /* @__PURE__ */ c(ut, { label: r.regionLabel(e, null) }) : /* @__PURE__ */ c(dl, { path: o.path, snapshot: o.snapshot, markup: n, stale: o.stale, ...r });
|
|
2332
2362
|
}, $n = ({ path: e, absence: t, markup: n, display: r, navigation: o, fragment: i, paneScroll: l, announces: u, announceFailure: m, onDocumentShown: f }) => {
|
|
2333
|
-
const { config: d, labels: h, theme:
|
|
2363
|
+
const { config: d, labels: h, theme: g, documents: b } = D(), M = br(), R = _(!1);
|
|
2334
2364
|
H(() => {
|
|
2335
|
-
|
|
2365
|
+
R.current = !0;
|
|
2336
2366
|
}, []);
|
|
2337
|
-
const [S,
|
|
2367
|
+
const [S, A] = B(null), [L, E] = B(n), v = P(() => e === null ? void 0 : b.peek(e), [b, e]), a = ee(b.subscribe, v, v), s = P(() => S === null ? void 0 : b.peek(S), [b, S]), w = ee(b.subscribe, s, s);
|
|
2338
2368
|
H(() => e === null ? void 0 : b.open(e), [b, e]), H(() => S === null ? void 0 : b.retain(S), [b, S]);
|
|
2339
|
-
const
|
|
2340
|
-
|
|
2341
|
-
const N =
|
|
2369
|
+
const T = e === null ? mt : ul(e, a, S, w, !R.current), C = e === null ? null : T.kind === "document" && !T.stale ? T.path : S;
|
|
2370
|
+
C !== S && A(C);
|
|
2371
|
+
const N = T.kind !== "document" || T.path === e;
|
|
2342
2372
|
N && n !== L && E(n);
|
|
2343
2373
|
const q = G(() => Ji(h), [h]), W = G(() => [...d.iframeHosts], [d]), z = o.kind === "panel", j = G(
|
|
2344
2374
|
() => ({
|
|
2345
2375
|
labels: q,
|
|
2346
2376
|
emptyMessage: h.documentEmpty,
|
|
2347
|
-
theme:
|
|
2377
|
+
theme: g,
|
|
2348
2378
|
availableStyles: d.documentStyles,
|
|
2349
2379
|
iFrameAllowedDomains: W,
|
|
2350
2380
|
embeds: d.embeds,
|
|
2351
2381
|
linkComponent: $i,
|
|
2352
|
-
toolbar:
|
|
2382
|
+
toolbar: M,
|
|
2353
2383
|
style: r.style,
|
|
2354
2384
|
onStyleChange: r.onStyleChange,
|
|
2355
2385
|
align: r.align,
|
|
@@ -2362,13 +2392,13 @@ const Hi = /* @__PURE__ */ y.forwardRef(ji), Vi = Object.freeze({ className: "aq
|
|
|
2362
2392
|
maxWidth: r.maxWidth === void 0 ? void 0 : `min(${r.maxWidth}, 100%)`,
|
|
2363
2393
|
renderScrollBar: z ? void 0 : Sn
|
|
2364
2394
|
}),
|
|
2365
|
-
[q, h.documentEmpty,
|
|
2366
|
-
), Y = P((re, p) => z ? p === null || p.kind === "failure" ?
|
|
2395
|
+
[q, h.documentEmpty, g, d.documentStyles, W, d.embeds, M, r, z]
|
|
2396
|
+
), Y = P((re, p) => z ? p === null || p.kind === "failure" ? se(re) : p.name : h.documentRegion, [z, h.documentRegion]), V = z ? "content" : "fill";
|
|
2367
2397
|
return e === null ? /* @__PURE__ */ c(he, { value: V, children: /* @__PURE__ */ c(tl, { absence: t, announces: u, announceFailure: m }) }) : /* @__PURE__ */ c(he, { value: V, children: /* @__PURE__ */ c(ke, { fallback: /* @__PURE__ */ c(ut, { label: Y(e, null) }), children: /* @__PURE__ */ c(
|
|
2368
2398
|
ml,
|
|
2369
2399
|
{
|
|
2370
2400
|
requestedPath: e,
|
|
2371
|
-
content:
|
|
2401
|
+
content: T,
|
|
2372
2402
|
markup: N ? n : L,
|
|
2373
2403
|
viewer: j,
|
|
2374
2404
|
editLayout: r.editLayout,
|
|
@@ -2382,47 +2412,47 @@ const Hi = /* @__PURE__ */ y.forwardRef(ji), Vi = Object.freeze({ className: "aq
|
|
|
2382
2412
|
}
|
|
2383
2413
|
) }) });
|
|
2384
2414
|
}, hl = ({ path: e, absence: t, markup: n, variant: r, onDocumentShown: o }) => {
|
|
2385
|
-
const { config: i, viewSettings: l, announcer: u } = D(), m =
|
|
2386
|
-
(
|
|
2387
|
-
if (
|
|
2388
|
-
const N = el(i,
|
|
2415
|
+
const { config: i, viewSettings: l, announcer: u } = D(), m = Ae((C) => C.style), f = Ae((C) => C.align), d = Fe(), h = nn(), g = lt(), { view: b, overrides: M, embed: R } = r, S = P(
|
|
2416
|
+
(C) => {
|
|
2417
|
+
if (g.kind !== "location") return;
|
|
2418
|
+
const N = el(i, g.location, C);
|
|
2389
2419
|
N !== null && d(N, "browse");
|
|
2390
2420
|
},
|
|
2391
|
-
[i, d,
|
|
2392
|
-
),
|
|
2393
|
-
(
|
|
2394
|
-
l.update({ style:
|
|
2421
|
+
[i, d, g]
|
|
2422
|
+
), A = P(
|
|
2423
|
+
(C) => {
|
|
2424
|
+
l.update({ style: C }), S("style");
|
|
2395
2425
|
},
|
|
2396
2426
|
[l, S]
|
|
2397
2427
|
), L = P(
|
|
2398
|
-
(
|
|
2399
|
-
l.update({ align:
|
|
2428
|
+
(C) => {
|
|
2429
|
+
l.update({ align: C }), S("align");
|
|
2400
2430
|
},
|
|
2401
2431
|
[l, S]
|
|
2402
|
-
), E = Nn(i,
|
|
2432
|
+
), E = Nn(i, M.style, m), v = Dn(M.align, f), a = G(
|
|
2403
2433
|
() => ({
|
|
2404
2434
|
style: E,
|
|
2405
|
-
onStyleChange:
|
|
2435
|
+
onStyleChange: A,
|
|
2406
2436
|
align: v,
|
|
2407
2437
|
onAlignChange: L,
|
|
2408
|
-
showToc:
|
|
2409
|
-
showStyle:
|
|
2410
|
-
showAlign:
|
|
2411
|
-
padding:
|
|
2412
|
-
width:
|
|
2413
|
-
maxWidth:
|
|
2438
|
+
showToc: R.showToc !== !1,
|
|
2439
|
+
showStyle: R.showStyle !== !1,
|
|
2440
|
+
showAlign: R.showAlign !== !1,
|
|
2441
|
+
padding: R.padding,
|
|
2442
|
+
width: R.width,
|
|
2443
|
+
maxWidth: R.maxWidth,
|
|
2414
2444
|
editLayout: "fill"
|
|
2415
2445
|
}),
|
|
2416
|
-
[E,
|
|
2417
|
-
),
|
|
2418
|
-
return /* @__PURE__ */ c($n, { path: e, absence: t, markup: n, display:
|
|
2446
|
+
[E, A, v, L, R]
|
|
2447
|
+
), s = G(() => ({ kind: "page", view: b, overrides: M, embed: R }), [b, M, R]), w = G(() => ({ kind: "page", fragment: h.hash, navigation: h }), [h]), T = P((C) => u.announce(C), [u]);
|
|
2448
|
+
return /* @__PURE__ */ c($n, { path: e, absence: t, markup: n, display: a, navigation: s, fragment: w, paneScroll: li, announces: !0, announceFailure: T, onDocumentShown: o });
|
|
2419
2449
|
}, pl = ({ path: e, absence: t, markup: n, variant: r, onDocumentShown: o }) => {
|
|
2420
|
-
const { config: i, viewSettings: l } = D(), u =
|
|
2450
|
+
const { config: i, viewSettings: l } = D(), u = Ae((s) => s.style), m = Ae((s) => s.align), [f, d] = B(() => Nn(i, void 0, u)), h = Dn(void 0, m), g = P((s) => l.update({ align: s }), [l]), { maximized: b, onDocumentLink: M, pendingHash: R, onHashConsumed: S, announceFailure: A, paneScroll: L } = r, E = G(
|
|
2421
2451
|
() => ({
|
|
2422
2452
|
style: f,
|
|
2423
2453
|
onStyleChange: d,
|
|
2424
2454
|
align: h,
|
|
2425
|
-
onAlignChange:
|
|
2455
|
+
onAlignChange: g,
|
|
2426
2456
|
showToc: b,
|
|
2427
2457
|
showStyle: b,
|
|
2428
2458
|
showAlign: b,
|
|
@@ -2431,11 +2461,11 @@ const Hi = /* @__PURE__ */ y.forwardRef(ji), Vi = Object.freeze({ className: "aq
|
|
|
2431
2461
|
maxWidth: void 0,
|
|
2432
2462
|
editLayout: b ? "fill" : "content"
|
|
2433
2463
|
}),
|
|
2434
|
-
[f, h,
|
|
2435
|
-
), v = G(() => ({ kind: "panel", onDocumentLink:
|
|
2436
|
-
return /* @__PURE__ */ c($n, { path: e, absence: t, markup: n, display: E, navigation: v, fragment:
|
|
2464
|
+
[f, h, g, b]
|
|
2465
|
+
), v = G(() => ({ kind: "panel", onDocumentLink: M }), [M]), a = G(() => ({ kind: "panel", fragment: R, consume: S }), [R, S]);
|
|
2466
|
+
return /* @__PURE__ */ c($n, { path: e, absence: t, markup: n, display: E, navigation: v, fragment: a, paneScroll: L, announces: !1, announceFailure: A, onDocumentShown: o });
|
|
2437
2467
|
}, vl = ({ path: e, absence: t, markup: n, variant: r, onDocumentShown: o }) => r.kind === "page" ? /* @__PURE__ */ c(hl, { path: e, absence: t, markup: n, variant: r, onDocumentShown: o }) : /* @__PURE__ */ c(pl, { path: e, absence: t, markup: n, variant: r, onDocumentShown: o });
|
|
2438
|
-
function
|
|
2468
|
+
function wl({
|
|
2439
2469
|
title: e,
|
|
2440
2470
|
titleId: t,
|
|
2441
2471
|
...n
|
|
@@ -2456,7 +2486,7 @@ function gl({
|
|
|
2456
2486
|
clipRule: "evenodd"
|
|
2457
2487
|
}));
|
|
2458
2488
|
}
|
|
2459
|
-
const
|
|
2489
|
+
const gl = /* @__PURE__ */ y.forwardRef(wl);
|
|
2460
2490
|
function bl({
|
|
2461
2491
|
title: e,
|
|
2462
2492
|
titleId: t,
|
|
@@ -2548,8 +2578,8 @@ function kl({
|
|
|
2548
2578
|
clipRule: "evenodd"
|
|
2549
2579
|
}));
|
|
2550
2580
|
}
|
|
2551
|
-
const
|
|
2552
|
-
function
|
|
2581
|
+
const Tl = /* @__PURE__ */ y.forwardRef(kl);
|
|
2582
|
+
function Rl({
|
|
2553
2583
|
title: e,
|
|
2554
2584
|
titleId: t,
|
|
2555
2585
|
...n
|
|
@@ -2572,8 +2602,8 @@ function Tl({
|
|
|
2572
2602
|
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"
|
|
2573
2603
|
}));
|
|
2574
2604
|
}
|
|
2575
|
-
const
|
|
2576
|
-
function
|
|
2605
|
+
const Ml = /* @__PURE__ */ y.forwardRef(Rl);
|
|
2606
|
+
function Ol({
|
|
2577
2607
|
title: e,
|
|
2578
2608
|
titleId: t,
|
|
2579
2609
|
...n
|
|
@@ -2596,7 +2626,7 @@ function Cl({
|
|
|
2596
2626
|
clipRule: "evenodd"
|
|
2597
2627
|
}));
|
|
2598
2628
|
}
|
|
2599
|
-
const
|
|
2629
|
+
const Cl = /* @__PURE__ */ y.forwardRef(Ol);
|
|
2600
2630
|
function Ll({
|
|
2601
2631
|
title: e,
|
|
2602
2632
|
titleId: t,
|
|
@@ -2618,7 +2648,7 @@ function Ll({
|
|
|
2618
2648
|
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"
|
|
2619
2649
|
}));
|
|
2620
2650
|
}
|
|
2621
|
-
const
|
|
2651
|
+
const Al = /* @__PURE__ */ y.forwardRef(Ll);
|
|
2622
2652
|
function Nl({
|
|
2623
2653
|
title: e,
|
|
2624
2654
|
titleId: t,
|
|
@@ -2639,7 +2669,7 @@ function Nl({
|
|
|
2639
2669
|
}));
|
|
2640
2670
|
}
|
|
2641
2671
|
const Dl = /* @__PURE__ */ y.forwardRef(Nl), Pl = ({ href: e, onRetry: t, testId: n }) => {
|
|
2642
|
-
const { labels: r, onEditGrant: o } = D(), [i, l] =
|
|
2672
|
+
const { labels: r, onEditGrant: o } = D(), [i, l] = B(!1), u = () => {
|
|
2643
2673
|
o === void 0 || i || (l(!0), o(e).then((m) => {
|
|
2644
2674
|
m && t();
|
|
2645
2675
|
}).finally(() => l(!1)));
|
|
@@ -2660,51 +2690,51 @@ const Dl = /* @__PURE__ */ y.forwardRef(Nl), Pl = ({ href: e, onRetry: t, testId
|
|
|
2660
2690
|
return;
|
|
2661
2691
|
}
|
|
2662
2692
|
e.setView(t, n), r && e.sideBySide() && e.setSideBySide(!1);
|
|
2663
|
-
},
|
|
2693
|
+
}, Ja = (e) => e === "split" ? null : e, ql = (e) => e === "preview" ? "editor" : "preview", _l = (e) => /Mac|iPhone|iPad|iPod/u.test(e), Il = (e, t) => {
|
|
2664
2694
|
if (e.isComposing || e.altKey || e.shiftKey || (t ? !e.metaKey || e.ctrlKey : !e.ctrlKey || e.metaKey)) return !1;
|
|
2665
2695
|
const n = e.key.toLowerCase();
|
|
2666
2696
|
return n === "e" || e.code === "KeyE" && /^\p{L}$/u.test(n) && !/^[a-z]$/u.test(n);
|
|
2667
2697
|
}, Gt = (e, t, n) => {
|
|
2668
2698
|
const r = e.modifiedAt === null ? Number.NaN : Date.parse(e.modifiedAt);
|
|
2669
2699
|
return n(Number.isNaN(r) ? e.id : t.format(r), e.author === null ? "" : e.author);
|
|
2670
|
-
},
|
|
2671
|
-
const { data: o, edits: i, labels: l, locale: u, announcer: m } = D(), f = Se(), [d, h] =
|
|
2672
|
-
|
|
2700
|
+
}, Bl = ({ path: e, documentName: t, open: n, onClose: r }) => {
|
|
2701
|
+
const { data: o, edits: i, labels: l, locale: u, announcer: m } = D(), f = Se(), [d, h] = B(null), [g, b] = B(0), [M, R] = B(null), [S, A] = B(null), L = G(() => new Intl.DateTimeFormat(u, { dateStyle: "medium", timeStyle: "short" }), [u]), E = P(() => {
|
|
2702
|
+
R(null), A(null);
|
|
2673
2703
|
}, []), v = vn({ open: n, onOpen: E, onDismiss: r });
|
|
2674
2704
|
te(() => {
|
|
2675
2705
|
if (!n) return;
|
|
2676
|
-
const
|
|
2677
|
-
return h(null), o.revisions(e,
|
|
2678
|
-
"kind" in
|
|
2679
|
-
}), () =>
|
|
2680
|
-
}, [n, o, e,
|
|
2681
|
-
if (!n ||
|
|
2682
|
-
const
|
|
2683
|
-
return
|
|
2684
|
-
"kind" in
|
|
2685
|
-
}), () =>
|
|
2686
|
-
}, [n, o, e,
|
|
2687
|
-
const
|
|
2706
|
+
const w = new AbortController();
|
|
2707
|
+
return h(null), o.revisions(e, w.signal).then((T) => {
|
|
2708
|
+
"kind" in T && h(T);
|
|
2709
|
+
}), () => w.abort();
|
|
2710
|
+
}, [n, o, e, g]), te(() => {
|
|
2711
|
+
if (!n || M === null) return;
|
|
2712
|
+
const w = new AbortController();
|
|
2713
|
+
return A(null), o.revision(e, M, w.signal).then((T) => {
|
|
2714
|
+
"kind" in T && A(T);
|
|
2715
|
+
}), () => w.abort();
|
|
2716
|
+
}, [n, o, e, M]);
|
|
2717
|
+
const a = () => {
|
|
2688
2718
|
S === null || S.kind !== "revision" || (i.replaceDraft(e, S.text), m.announce(l.historyRestored(t)), r());
|
|
2689
|
-
},
|
|
2719
|
+
}, s = d !== null && d.kind === "revisions" ? d.revisions.find((w) => w.id === M) : void 0;
|
|
2690
2720
|
return /* @__PURE__ */ c("dialog", { ...v, className: "aqmx-confirm aqmx-history", "aria-labelledby": f, "data-testid": "markdown-explorer-history", children: /* @__PURE__ */ F("div", { className: "aqmx-confirm-panel aqmx-history-panel", children: [
|
|
2691
2721
|
/* @__PURE__ */ c("p", { id: f, className: "aqmx-confirm-title", children: l.historyTitle(t) }),
|
|
2692
|
-
d === null ? /* @__PURE__ */ c("p", { className: "aqmx-history-note", "data-testid": "markdown-explorer-history-loading", children: l.historyLoading }) : d.kind === "failure" ? /* @__PURE__ */ c(me, { failure: d.failure, alert: !1, onRetry: () => b((
|
|
2693
|
-
/* @__PURE__ */ c("span", { children: Gt(
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
] }) },
|
|
2697
|
-
|
|
2698
|
-
/* @__PURE__ */ c("section", { className: "aqmx-history-text", tabIndex: 0, "aria-label":
|
|
2722
|
+
d === null ? /* @__PURE__ */ c("p", { className: "aqmx-history-note", "data-testid": "markdown-explorer-history-loading", children: l.historyLoading }) : d.kind === "failure" ? /* @__PURE__ */ c(me, { failure: d.failure, alert: !1, onRetry: () => b((w) => w + 1), testId: "markdown-explorer-history-failure" }) : d.revisions.length === 0 ? /* @__PURE__ */ c("p", { className: "aqmx-history-note", "data-testid": "markdown-explorer-history-empty", children: l.historyEmpty }) : /* @__PURE__ */ c("ul", { className: "aqmx-history-list", "data-testid": "markdown-explorer-history-list", children: d.revisions.map((w) => /* @__PURE__ */ c("li", { children: /* @__PURE__ */ F("button", { type: "button", className: "aqmx-history-entry", "aria-pressed": w.id === M, "data-testid": "markdown-explorer-history-entry", onClick: () => R(w.id), children: [
|
|
2723
|
+
/* @__PURE__ */ c("span", { children: Gt(w, L, l.historyEntry) }),
|
|
2724
|
+
w.current ? /* @__PURE__ */ c("span", { className: "aqmx-history-mark", children: l.historyCurrent }) : null,
|
|
2725
|
+
w.kept ? /* @__PURE__ */ c("span", { className: "aqmx-history-mark", children: l.historyKept }) : null
|
|
2726
|
+
] }) }, w.id)) }),
|
|
2727
|
+
M === null ? null : S === null ? /* @__PURE__ */ c("p", { className: "aqmx-history-note", children: l.historyLoading }) : S.kind === "failure" ? /* @__PURE__ */ c(me, { failure: S.failure, alert: !1, testId: "markdown-explorer-history-revision-failure" }) : (
|
|
2728
|
+
/* @__PURE__ */ c("section", { className: "aqmx-history-text", tabIndex: 0, "aria-label": s === void 0 ? l.historyTitle(t) : Gt(s, L, l.historyEntry), "data-testid": "markdown-explorer-history-text", children: /* @__PURE__ */ c("pre", { children: S.text }) })
|
|
2699
2729
|
),
|
|
2700
2730
|
/* @__PURE__ */ F("div", { className: "aqmx-confirm-actions", children: [
|
|
2701
2731
|
/* @__PURE__ */ c("button", { type: "button", className: "aqmx-callout-action", "data-testid": "markdown-explorer-history-close", onClick: r, children: l.historyClose }),
|
|
2702
|
-
/* @__PURE__ */ c("button", { type: "button", className: "aqmx-callout-action", "aria-disabled": S === null || S.kind !== "revision", "data-testid": "markdown-explorer-history-restore", onClick:
|
|
2732
|
+
/* @__PURE__ */ c("button", { type: "button", className: "aqmx-callout-action", "aria-disabled": S === null || S.kind !== "revision", "data-testid": "markdown-explorer-history-restore", onClick: a, children: l.historyRestore })
|
|
2703
2733
|
] })
|
|
2704
2734
|
] }) });
|
|
2705
2735
|
}, zl = (e) => {
|
|
2706
2736
|
const { documents: t } = D(), n = P(() => t.peek(e), [t, e]), r = P(() => t.peekSeeded(e), [t, e]), o = ee(t.subscribe, n, r), i = ue(o)?.document;
|
|
2707
|
-
return i === void 0 || i.kind === "failure" ? { edit: null, name:
|
|
2737
|
+
return i === void 0 || i.kind === "failure" ? { edit: null, name: se(e) } : { edit: i.kind === "markdown" ? i.edit : null, name: i.name };
|
|
2708
2738
|
}, ce = (e) => {
|
|
2709
2739
|
e.stopPropagation();
|
|
2710
2740
|
}, jl = ({ path: e, documentName: t, iconOnly: n, previewAvailable: r, draft: o }) => {
|
|
@@ -2712,39 +2742,39 @@ const Dl = /* @__PURE__ */ y.forwardRef(Nl), Pl = ({ href: e, onRetry: t, testId
|
|
|
2712
2742
|
l.subscribe,
|
|
2713
2743
|
() => l.session(e) !== void 0,
|
|
2714
2744
|
() => !1
|
|
2715
|
-
), [f, d] =
|
|
2745
|
+
), [f, d] = B(null), h = () => {
|
|
2716
2746
|
if (!m) {
|
|
2717
2747
|
l.start(e, l.viewAnchor(e));
|
|
2718
2748
|
return;
|
|
2719
2749
|
}
|
|
2720
2750
|
l.flush(e);
|
|
2721
|
-
const
|
|
2722
|
-
|
|
2723
|
-
},
|
|
2751
|
+
const R = l.session(e);
|
|
2752
|
+
R?.dirty === !0 ? d(R.save.kind === "draft" ? "draft" : "unsaved") : l.close(e);
|
|
2753
|
+
}, g = () => {
|
|
2724
2754
|
m || (fo(), r && l.sideBySide() && i?.prepare?.());
|
|
2725
|
-
}, b = n ? o ? u.editDraftDocumentNamed(t) : u.editDocumentNamed(t) : null,
|
|
2755
|
+
}, b = n ? o ? u.editDraftDocumentNamed(t) : u.editDocumentNamed(t) : null, M = o ? u.editDraftDocument : u.editDocument;
|
|
2726
2756
|
return /* @__PURE__ */ F(Pe, { children: [
|
|
2727
2757
|
/* @__PURE__ */ F(
|
|
2728
2758
|
"button",
|
|
2729
2759
|
{
|
|
2730
2760
|
type: "button",
|
|
2731
2761
|
className: b === null ? "aqmx-icon-button aqmx-labelled-button" : "aqmx-icon-button",
|
|
2732
|
-
title: m ? u.closeEditor : b === null ?
|
|
2762
|
+
title: m ? u.closeEditor : b === null ? M : b,
|
|
2733
2763
|
"aria-label": b === null ? void 0 : b,
|
|
2734
2764
|
"aria-pressed": m,
|
|
2735
2765
|
"data-testid": "markdown-explorer-document-edit",
|
|
2736
2766
|
onClick: h,
|
|
2737
2767
|
onDoubleClick: ce,
|
|
2738
|
-
onPointerEnter:
|
|
2739
|
-
onFocus:
|
|
2768
|
+
onPointerEnter: g,
|
|
2769
|
+
onFocus: g,
|
|
2740
2770
|
children: [
|
|
2741
|
-
/* @__PURE__ */ c(
|
|
2771
|
+
/* @__PURE__ */ c(Al, { "aria-hidden": "true" }),
|
|
2742
2772
|
b === null ? /* @__PURE__ */ c("span", { children: u.editDocumentLabel }) : null
|
|
2743
2773
|
]
|
|
2744
2774
|
}
|
|
2745
2775
|
),
|
|
2746
2776
|
/* @__PURE__ */ c(
|
|
2747
|
-
|
|
2777
|
+
wn,
|
|
2748
2778
|
{
|
|
2749
2779
|
open: f !== null,
|
|
2750
2780
|
title: f === "draft" ? u.draftDiscardTitle : u.unsavedTitle,
|
|
@@ -2781,27 +2811,27 @@ const Dl = /* @__PURE__ */ y.forwardRef(Nl), Pl = ({ href: e, onRetry: t, testId
|
|
|
2781
2811
|
}, Vl = ({ session: e }) => {
|
|
2782
2812
|
const { labels: t } = D(), n = Pr(t, e);
|
|
2783
2813
|
return /* @__PURE__ */ c("p", { className: "aqmx-edit-status", title: n === "" ? void 0 : n, "data-testid": "markdown-explorer-edit-status", "data-aqmx-save": e.save.kind, children: n });
|
|
2784
|
-
}, Ul = Object.freeze(["editor", "split", "preview"]), Zl = Object.freeze(["editor", "preview"]), Gl = Object.freeze({ editor: Fn, split: Dl, preview:
|
|
2785
|
-
const { draftConverter: i, edits: l, labels: u } = D(), m = lo(), f = Fl(r, m, o), d = o ? Ul : Zl, h = Se(),
|
|
2814
|
+
}, Ul = Object.freeze(["editor", "split", "preview"]), Zl = Object.freeze(["editor", "preview"]), Gl = Object.freeze({ editor: Fn, split: Dl, preview: Cl }), Wl = ({ path: e, documentName: t, iconOnly: n, session: r, previewAvailable: o }) => {
|
|
2815
|
+
const { draftConverter: i, edits: l, labels: u } = D(), m = lo(), f = Fl(r, m, o), d = o ? Ul : Zl, h = Se(), g = _(/* @__PURE__ */ new Map()), b = {
|
|
2786
2816
|
editor: { label: u.editViewEditor, tooltip: u.editViewEditorTooltip },
|
|
2787
2817
|
split: { label: u.editViewSplit, tooltip: u.editViewSplitTooltip },
|
|
2788
2818
|
preview: { label: u.editViewPreview, tooltip: u.editViewPreviewTooltip }
|
|
2789
|
-
},
|
|
2819
|
+
}, M = () => {
|
|
2790
2820
|
l.preparePreview(e), i?.prepare?.();
|
|
2791
|
-
},
|
|
2792
|
-
if (!
|
|
2821
|
+
}, R = (S) => {
|
|
2822
|
+
if (!Il(S.nativeEvent, _l(navigator.platform))) return;
|
|
2793
2823
|
hn(S);
|
|
2794
|
-
const
|
|
2795
|
-
Zt(l, e,
|
|
2824
|
+
const A = ql(f);
|
|
2825
|
+
Zt(l, e, A, o), g.current.get(A)?.focus();
|
|
2796
2826
|
};
|
|
2797
|
-
return /* @__PURE__ */ c("div", { role: "radiogroup", "aria-label": n ? u.editViewNamed(t) : u.editView, className: "aqmx-edit-view", "data-testid": "markdown-explorer-edit-view", onKeyDown:
|
|
2798
|
-
const
|
|
2827
|
+
return /* @__PURE__ */ c("div", { role: "radiogroup", "aria-label": n ? u.editViewNamed(t) : u.editView, className: "aqmx-edit-view", "data-testid": "markdown-explorer-edit-view", onKeyDown: R, children: d.map((S) => {
|
|
2828
|
+
const A = Gl[S], { label: L, tooltip: E } = b[S], v = S === "preview" ? M : void 0;
|
|
2799
2829
|
return /* @__PURE__ */ F("label", { className: n ? "aqmx-icon-button" : "aqmx-icon-button aqmx-labelled-button", children: [
|
|
2800
2830
|
/* @__PURE__ */ c(
|
|
2801
2831
|
"input",
|
|
2802
2832
|
{
|
|
2803
|
-
ref: (
|
|
2804
|
-
|
|
2833
|
+
ref: (a) => {
|
|
2834
|
+
a === null ? g.current.delete(S) : g.current.set(S, a);
|
|
2805
2835
|
},
|
|
2806
2836
|
type: "radio",
|
|
2807
2837
|
name: h,
|
|
@@ -2817,33 +2847,33 @@ const Dl = /* @__PURE__ */ y.forwardRef(Nl), Pl = ({ href: e, onRetry: t, testId
|
|
|
2817
2847
|
onFocus: v
|
|
2818
2848
|
}
|
|
2819
2849
|
),
|
|
2820
|
-
/* @__PURE__ */ c(
|
|
2850
|
+
/* @__PURE__ */ c(A, { "aria-hidden": "true" }),
|
|
2821
2851
|
n ? null : /* @__PURE__ */ c("span", { children: L })
|
|
2822
2852
|
] }, S);
|
|
2823
2853
|
}) });
|
|
2824
2854
|
}, Kl = ({ path: e, documentName: t, iconOnly: n, session: r, previewAvailable: o }) => {
|
|
2825
|
-
const { edits: i, labels: l } = D(), [u, m] =
|
|
2855
|
+
const { edits: i, labels: l } = D(), [u, m] = B(!1);
|
|
2826
2856
|
if (r.phase.kind !== "editing") return null;
|
|
2827
2857
|
const f = r.save.kind === "saving", d = f || !r.dirty, h = () => {
|
|
2828
2858
|
i.flush(e);
|
|
2829
2859
|
const b = i.session(e);
|
|
2830
2860
|
b === void 0 || !b.dirty || b.save.kind === "saving" || i.save(e);
|
|
2831
|
-
},
|
|
2861
|
+
}, g = (b) => n ? { className: "aqmx-icon-button", "aria-label": b } : { className: "aqmx-icon-button aqmx-labelled-button" };
|
|
2832
2862
|
return /* @__PURE__ */ F(Pe, { children: [
|
|
2833
|
-
r.save.kind === "conflicts" ? /* @__PURE__ */ F("button", { type: "button", ...
|
|
2863
|
+
r.save.kind === "conflicts" ? /* @__PURE__ */ F("button", { type: "button", ...g(l.conflictNext), title: l.conflictNext, "data-testid": "markdown-explorer-edit-next-conflict", onClick: () => i.nextConflict(e), onDoubleClick: ce, children: [
|
|
2834
2864
|
/* @__PURE__ */ c(Sl, { "aria-hidden": "true" }),
|
|
2835
2865
|
n ? null : /* @__PURE__ */ c("span", { children: l.conflictNext })
|
|
2836
2866
|
] }) : null,
|
|
2837
2867
|
/* @__PURE__ */ c(Wl, { path: e, documentName: t, iconOnly: n, session: r, previewAvailable: o }),
|
|
2838
|
-
r.history ? /* @__PURE__ */ F("button", { type: "button", ...
|
|
2839
|
-
/* @__PURE__ */ c(
|
|
2868
|
+
r.history ? /* @__PURE__ */ F("button", { type: "button", ...g(l.historyOpen), title: l.historyOpen, "aria-haspopup": "dialog", "data-testid": "markdown-explorer-edit-history", onClick: () => m(!0), onDoubleClick: ce, children: [
|
|
2869
|
+
/* @__PURE__ */ c(Tl, { "aria-hidden": "true" }),
|
|
2840
2870
|
n ? null : /* @__PURE__ */ c("span", { children: l.historyOpen })
|
|
2841
2871
|
] }) : null,
|
|
2842
|
-
r.save.kind === "draft" ? null : /* @__PURE__ */ F("button", { type: "button", ...
|
|
2843
|
-
/* @__PURE__ */ c(
|
|
2872
|
+
r.save.kind === "draft" ? null : /* @__PURE__ */ F("button", { type: "button", ...g(l.saveDraft), title: l.saveDraftTooltip, "aria-disabled": d, "aria-busy": f, "aria-keyshortcuts": "Control+S Meta+S", "data-testid": "markdown-explorer-edit-save", onClick: h, onDoubleClick: ce, children: [
|
|
2873
|
+
/* @__PURE__ */ c(Ml, { "aria-hidden": "true" }),
|
|
2844
2874
|
n ? null : /* @__PURE__ */ c("span", { children: l.saveDraft })
|
|
2845
2875
|
] }),
|
|
2846
|
-
r.history ? /* @__PURE__ */ c(
|
|
2876
|
+
r.history ? /* @__PURE__ */ c(Bl, { path: e, documentName: t, open: u, onClose: () => m(!1) }) : null
|
|
2847
2877
|
] });
|
|
2848
2878
|
}, Xl = ({ path: e, session: t }) => {
|
|
2849
2879
|
const { edits: n } = D();
|
|
@@ -2856,58 +2886,58 @@ const Dl = /* @__PURE__ */ y.forwardRef(Nl), Pl = ({ href: e, onRetry: t, testId
|
|
|
2856
2886
|
}, Jl = (e) => {
|
|
2857
2887
|
const { config: t } = D(), n = Fe(), r = P(() => n(ye(t, { ...e, markup: !e.markup }), "browse"), [t, n, e]);
|
|
2858
2888
|
return G(() => ({ shown: e.markup, toggle: r }), [e.markup, r]);
|
|
2859
|
-
}, Ql = /* @__PURE__ */ new Set(),
|
|
2860
|
-
const { documents: n, announcer: r, labels: o } = D(), i = P(() => n.peek(e), [n, e]), l = P(() => n.peekSeeded(e), [n, e]), u = ee(n.subscribe, i, l), m = P(() => n.answerStampOf(e), [n, e]), f = ee(n.subscribe, m, m), [d] =
|
|
2861
|
-
b !== null && b.path !== e &&
|
|
2862
|
-
const
|
|
2863
|
-
H(() => (
|
|
2864
|
-
|
|
2889
|
+
}, Ql = /* @__PURE__ */ new Set(), ea = (e, t) => {
|
|
2890
|
+
const { documents: n, announcer: r, labels: o } = D(), i = P(() => n.peek(e), [n, e]), l = P(() => n.peekSeeded(e), [n, e]), u = ee(n.subscribe, i, l), m = P(() => n.answerStampOf(e), [n, e]), f = ee(n.subscribe, m, m), [d] = B(() => /* @__PURE__ */ new Set()), [h, g] = B(Ql), [b, M] = B(null);
|
|
2891
|
+
b !== null && b.path !== e && M(null);
|
|
2892
|
+
const R = _(null);
|
|
2893
|
+
H(() => (R.current = e, () => {
|
|
2894
|
+
R.current = null;
|
|
2865
2895
|
}), [e]);
|
|
2866
2896
|
const S = P(() => {
|
|
2867
2897
|
const E = e, v = n.peek(E);
|
|
2868
2898
|
if (d.has(E) || v?.status === "pending") return;
|
|
2869
|
-
const
|
|
2870
|
-
d.add(E),
|
|
2899
|
+
const a = t && !Tn(v);
|
|
2900
|
+
d.add(E), g(new Set(d)), M(null), (async () => {
|
|
2871
2901
|
try {
|
|
2872
|
-
const
|
|
2873
|
-
if (
|
|
2874
|
-
if (
|
|
2875
|
-
|
|
2902
|
+
const s = await n.refresh(E);
|
|
2903
|
+
if (R.current !== E || s.status === "superseded") return;
|
|
2904
|
+
if (s.status === "failed") {
|
|
2905
|
+
M({ path: E, failure: s.failure, stamp: n.answerStampOf(E) }), r.announce(o.documentRefreshFailed(ae(o, s.failure.reason)));
|
|
2876
2906
|
return;
|
|
2877
2907
|
}
|
|
2878
|
-
const
|
|
2879
|
-
if (
|
|
2880
|
-
r.announce(o.documentRefreshed(
|
|
2908
|
+
const w = ue(n.peek(E));
|
|
2909
|
+
if (a || w === null || w.document.kind === "failure") return;
|
|
2910
|
+
r.announce(o.documentRefreshed(w.document.name));
|
|
2881
2911
|
} finally {
|
|
2882
|
-
d.delete(E),
|
|
2912
|
+
d.delete(E), g(new Set(d));
|
|
2883
2913
|
}
|
|
2884
2914
|
})();
|
|
2885
|
-
}, [e, t, d, n, r, o]),
|
|
2886
|
-
return { refreshing:
|
|
2887
|
-
},
|
|
2888
|
-
const { labels: r } = D(), { refreshing: o, unavailable: i, failure: l, refresh: u } =
|
|
2915
|
+
}, [e, t, d, n, r, o]), A = h.has(e), L = b !== null && b.path === e && b.stamp === f ? b.failure : null;
|
|
2916
|
+
return { refreshing: A, unavailable: A || u?.status === "pending", failure: L, refresh: S };
|
|
2917
|
+
}, ta = Object.freeze({ kind: "page" }), na = ({ path: e, placement: t, markup: n }) => {
|
|
2918
|
+
const { labels: r } = D(), { refreshing: o, unavailable: i, failure: l, refresh: u } = ea(e, t.kind === "page"), m = Yl(e), f = zl(e), d = bn(e), h = t.kind === "panel" ? r.refreshDocumentNamed(t.documentName) : null, g = t.kind === "panel" ? r.showMarkupNamed(t.documentName) : null, b = t.kind === "panel", M = t.kind === "panel" ? t.documentName : f.name, R = t.kind === "page" || t.maximized;
|
|
2889
2919
|
return /* @__PURE__ */ F("div", { className: "aqmx-document-refresh-bar", "data-testid": "markdown-explorer-document-refresh-bar", "data-aqmx-editing": d === void 0 ? void 0 : "true", children: [
|
|
2890
2920
|
/* @__PURE__ */ F("div", { className: "aqmx-document-refresh-row", children: [
|
|
2891
2921
|
d === void 0 ? null : /* @__PURE__ */ c(Vl, { session: d }),
|
|
2892
|
-
d === void 0 ? null : /* @__PURE__ */ c(Kl, { path: e, documentName:
|
|
2922
|
+
d === void 0 ? null : /* @__PURE__ */ c(Kl, { path: e, documentName: M, iconOnly: b, session: d, previewAvailable: R }),
|
|
2893
2923
|
d === void 0 && m ? /* @__PURE__ */ F(
|
|
2894
2924
|
"button",
|
|
2895
2925
|
{
|
|
2896
2926
|
type: "button",
|
|
2897
|
-
className:
|
|
2898
|
-
title:
|
|
2899
|
-
"aria-label":
|
|
2927
|
+
className: g === null ? "aqmx-icon-button aqmx-labelled-button" : "aqmx-icon-button",
|
|
2928
|
+
title: g === null ? r.showMarkup : g,
|
|
2929
|
+
"aria-label": g === null ? void 0 : g,
|
|
2900
2930
|
"aria-pressed": n.shown,
|
|
2901
2931
|
"data-testid": "markdown-explorer-document-markup",
|
|
2902
2932
|
onClick: n.toggle,
|
|
2903
2933
|
onDoubleClick: ce,
|
|
2904
2934
|
children: [
|
|
2905
2935
|
/* @__PURE__ */ c(Fn, { "aria-hidden": "true" }),
|
|
2906
|
-
|
|
2936
|
+
g === null ? /* @__PURE__ */ c("span", { children: r.showMarkupLabel }) : null
|
|
2907
2937
|
]
|
|
2908
2938
|
}
|
|
2909
2939
|
) : null,
|
|
2910
|
-
d !== void 0 || f.edit?.kind === "inline" || f.edit?.kind === "draft" ? /* @__PURE__ */ c(jl, { path: e, documentName:
|
|
2940
|
+
d !== void 0 || f.edit?.kind === "inline" || f.edit?.kind === "draft" ? /* @__PURE__ */ c(jl, { path: e, documentName: M, iconOnly: b, previewAvailable: R, draft: f.edit?.kind === "draft" }) : f.edit?.kind === "external" ? /* @__PURE__ */ c(Hl, { href: f.edit.href, documentName: M, iconOnly: b }) : null,
|
|
2911
2941
|
d === void 0 ? /* @__PURE__ */ F(
|
|
2912
2942
|
"button",
|
|
2913
2943
|
{
|
|
@@ -2922,27 +2952,27 @@ const Dl = /* @__PURE__ */ y.forwardRef(Nl), Pl = ({ href: e, onRetry: t, testId
|
|
|
2922
2952
|
onClick: u,
|
|
2923
2953
|
onDoubleClick: ce,
|
|
2924
2954
|
children: [
|
|
2925
|
-
/* @__PURE__ */ c(
|
|
2955
|
+
/* @__PURE__ */ c(gl, { "aria-hidden": "true" }),
|
|
2926
2956
|
h === null ? /* @__PURE__ */ c("span", { children: r.refreshDocumentLabel }) : null
|
|
2927
2957
|
]
|
|
2928
2958
|
}
|
|
2929
2959
|
) : null
|
|
2930
2960
|
] }),
|
|
2931
|
-
d !== void 0 || l === null ? null : /* @__PURE__ */ c("p", { className: "aqmx-document-refresh-failure", "data-testid": "markdown-explorer-document-refresh-failure", "data-aqmx-failure": l.reason, children: r.documentRefreshFailed(
|
|
2961
|
+
d !== void 0 || l === null ? null : /* @__PURE__ */ c("p", { className: "aqmx-document-refresh-failure", "data-testid": "markdown-explorer-document-refresh-failure", "data-aqmx-failure": l.reason, children: r.documentRefreshFailed(ae(r, l.reason)) }),
|
|
2932
2962
|
d === void 0 ? null : /* @__PURE__ */ c(Xl, { path: e, session: d })
|
|
2933
2963
|
] });
|
|
2934
|
-
},
|
|
2964
|
+
}, ra = ({ location: e }) => {
|
|
2935
2965
|
const t = e.doc, n = G(() => ({ kind: "page", view: "single", overrides: e.overrides, embed: e.embed }), [e.overrides, e.embed]), r = Jl(e);
|
|
2936
2966
|
return /* @__PURE__ */ F("div", { className: "aqmx-single aqmx-document-column", "data-testid": "markdown-explorer-single", ...et, children: [
|
|
2937
|
-
/* @__PURE__ */ c(
|
|
2967
|
+
/* @__PURE__ */ c(na, { path: t, placement: ta, markup: r }),
|
|
2938
2968
|
/* @__PURE__ */ c(vl, { path: t, absence: Qi, markup: e.markup, variant: n })
|
|
2939
2969
|
] });
|
|
2940
|
-
},
|
|
2970
|
+
}, oa = ({ holds: e, testId: t }) => {
|
|
2941
2971
|
const { labels: n, announcer: r } = D(), o = Se();
|
|
2942
2972
|
H(() => e ? r.claim(o) : void 0, [e, r, o]);
|
|
2943
2973
|
const i = P(() => r.shownIn(o), [r, o]), l = ee(r.subscribe, i, i);
|
|
2944
2974
|
return /* @__PURE__ */ c("div", { className: "aqmx-sr-only", role: "status", "aria-live": "polite", "aria-atomic": "true", "data-testid": t, children: l.length > 1 ? n.announcementSequence(l) : l[0] });
|
|
2945
|
-
}, fe = Object.freeze([]),
|
|
2975
|
+
}, fe = Object.freeze([]), ia = (e) => {
|
|
2946
2976
|
const t = /* @__PURE__ */ new Set();
|
|
2947
2977
|
let n = fe, r = [], o = !1;
|
|
2948
2978
|
const i = [], l = (d) => {
|
|
@@ -2960,7 +2990,7 @@ const Dl = /* @__PURE__ */ y.forwardRef(Nl), Pl = ({ href: e, onRetry: t, testId
|
|
|
2960
2990
|
announce: (d) => {
|
|
2961
2991
|
if (typeof d == "string") r.push({ sentence: d });
|
|
2962
2992
|
else {
|
|
2963
|
-
const h = r.find((
|
|
2993
|
+
const h = r.find((g) => "list" in g && g.list === d.list);
|
|
2964
2994
|
h !== void 0 && "items" in h ? h.items.push(d.item) : r.push({ list: d.list, items: [d.item] });
|
|
2965
2995
|
}
|
|
2966
2996
|
o || (o = !0, n !== fe && l(fe), e.request(f));
|
|
@@ -2971,75 +3001,75 @@ const Dl = /* @__PURE__ */ y.forwardRef(Nl), Pl = ({ href: e, onRetry: t, testId
|
|
|
2971
3001
|
claim: (d) => {
|
|
2972
3002
|
const h = { region: d };
|
|
2973
3003
|
return m(() => i.push(h)), () => m(() => {
|
|
2974
|
-
const
|
|
2975
|
-
|
|
3004
|
+
const g = i.indexOf(h);
|
|
3005
|
+
g !== -1 && i.splice(g, 1);
|
|
2976
3006
|
});
|
|
2977
3007
|
},
|
|
2978
3008
|
shownIn: (d) => u() === d ? n : fe
|
|
2979
3009
|
};
|
|
2980
|
-
},
|
|
3010
|
+
}, ge = Object.freeze({ status: "cancelled" }), la = (e) => {
|
|
2981
3011
|
if (e === null || typeof e != "object") return null;
|
|
2982
3012
|
const { failure: t } = e;
|
|
2983
|
-
if (
|
|
3013
|
+
if (sr(t) !== null) return null;
|
|
2984
3014
|
const { reason: n, code: r } = t;
|
|
2985
3015
|
return cr(n, r);
|
|
2986
|
-
},
|
|
2987
|
-
const r = n ?? ((f, d) => globalThis.fetch(f, d)), o = (f, d) => `${e}/${f}?${new URLSearchParams(d).toString()}`, i = async (f, d, h,
|
|
3016
|
+
}, aa = ({ dataPath: e, onScope: t, fetch: n }) => {
|
|
3017
|
+
const r = n ?? ((f, d) => globalThis.fetch(f, d)), o = (f, d) => `${e}/${f}?${new URLSearchParams(d).toString()}`, i = async (f, d, h, g) => {
|
|
2988
3018
|
let b;
|
|
2989
3019
|
try {
|
|
2990
3020
|
b = await r(f, { credentials: "same-origin", ...d, headers: { Accept: "application/json", ...d.headers } });
|
|
2991
3021
|
} catch {
|
|
2992
|
-
return
|
|
3022
|
+
return g({ reason: "failed" });
|
|
2993
3023
|
}
|
|
2994
3024
|
b.status === 401 && t(null);
|
|
2995
|
-
const
|
|
2996
|
-
|
|
2997
|
-
let
|
|
3025
|
+
const M = b.headers.get(rr);
|
|
3026
|
+
M !== null && t(M);
|
|
3027
|
+
let R;
|
|
2998
3028
|
try {
|
|
2999
|
-
|
|
3029
|
+
R = await b.json();
|
|
3000
3030
|
} catch {
|
|
3001
|
-
return
|
|
3031
|
+
return g({ reason: Et(b.status) });
|
|
3002
3032
|
}
|
|
3003
3033
|
let S;
|
|
3004
3034
|
try {
|
|
3005
|
-
S = h(
|
|
3035
|
+
S = h(R);
|
|
3006
3036
|
} catch {
|
|
3007
3037
|
S = !1;
|
|
3008
3038
|
}
|
|
3009
|
-
if (S) return
|
|
3010
|
-
const
|
|
3011
|
-
return
|
|
3039
|
+
if (S) return R;
|
|
3040
|
+
const A = la(R);
|
|
3041
|
+
return g(A !== null ? A : { reason: b.status === 200 ? "failed" : Et(b.status) });
|
|
3012
3042
|
}, l = { [xt]: dr }, u = { [xt]: pr, "Content-Type": `${hr}; charset=utf-8` }, m = async (f, d, h) => {
|
|
3013
|
-
const
|
|
3014
|
-
return d.signal.aborted ?
|
|
3043
|
+
const g = await i(f, d, h, (b) => Ve(b.reason, b.code));
|
|
3044
|
+
return d.signal.aborted ? ge : g;
|
|
3015
3045
|
};
|
|
3016
3046
|
return {
|
|
3017
3047
|
tree: (f) => i(o("tree", { [J.source]: f }), { method: "GET" }, yt, (d) => ({ status: "error", failure: d })),
|
|
3018
3048
|
children: async (f, d, h) => {
|
|
3019
|
-
const
|
|
3020
|
-
return h.aborted ?
|
|
3049
|
+
const g = await i(o("children", { [J.source]: f, [J.path]: d }), { method: "GET", signal: h }, ar, (b) => ({ status: "error", failure: b }));
|
|
3050
|
+
return h.aborted ? ge : g;
|
|
3021
3051
|
},
|
|
3022
3052
|
ancestors: async (f, d, h) => {
|
|
3023
|
-
const
|
|
3024
|
-
return h.aborted ?
|
|
3053
|
+
const g = await i(o("ancestors", { [J.source]: f, [J.path]: d }), { method: "GET", signal: h }, lr, (b) => ({ status: "error", failure: b }));
|
|
3054
|
+
return h.aborted ? ge : g;
|
|
3025
3055
|
},
|
|
3026
3056
|
reveal: async (f, d, h) => {
|
|
3027
|
-
const
|
|
3028
|
-
return h.aborted ?
|
|
3057
|
+
const g = await i(o("reveal", { [J.source]: f, [J.path]: d }), { method: "GET", signal: h }, ir, (b) => ({ status: "error", failure: b }));
|
|
3058
|
+
return h.aborted ? ge : g;
|
|
3029
3059
|
},
|
|
3030
|
-
document: (f, { refresh: d }) => i(o("document", { [J.path]: f }), d ? { method: "GET", headers: l } : { method: "GET" },
|
|
3060
|
+
document: (f, { refresh: d }) => i(o("document", { [J.path]: f }), d ? { method: "GET", headers: l } : { method: "GET" }, gr, (h) => Ve(h.reason, h.code)),
|
|
3031
3061
|
text: async (f, d) => {
|
|
3032
|
-
const h = await i(o("text", { [J.path]: f }), { method: "GET", signal: d }, or, (
|
|
3033
|
-
return d.aborted ?
|
|
3062
|
+
const h = await i(o("text", { [J.path]: f }), { method: "GET", signal: d }, or, (g) => Ve(g.reason, g.code));
|
|
3063
|
+
return d.aborted ? ge : h;
|
|
3034
3064
|
},
|
|
3035
|
-
edit: (f, d) => m(o("edit", { [J.path]: f }), { method: "GET", signal: d },
|
|
3036
|
-
save: (f, d, h,
|
|
3065
|
+
edit: (f, d) => m(o("edit", { [J.path]: f }), { method: "GET", signal: d }, wr),
|
|
3066
|
+
save: (f, d, h, g) => m(o("save", { [J.path]: f, [J.base]: d }), { method: "POST", headers: u, body: h, signal: g }, vr),
|
|
3037
3067
|
preview: (f, d, h) => m(o("preview", { [J.path]: f }), { method: "POST", headers: u, body: d, signal: h }, mr),
|
|
3038
3068
|
revisions: (f, d) => m(o("revisions", { [J.path]: f }), { method: "GET", signal: d }, fr),
|
|
3039
3069
|
revision: (f, d, h) => m(o("revision", { [J.path]: f, [J.revision]: d }), { method: "GET", signal: h }, ur),
|
|
3040
3070
|
refresh: (f) => i(o("refresh", { [J.source]: f }), { method: "POST", headers: l }, yt, (d) => ({ status: "error", failure: d }))
|
|
3041
3071
|
};
|
|
3042
|
-
},
|
|
3072
|
+
}, sa = () => {
|
|
3043
3073
|
let e = null, t = null;
|
|
3044
3074
|
return {
|
|
3045
3075
|
settle: (n) => {
|
|
@@ -3054,7 +3084,7 @@ const Dl = /* @__PURE__ */ y.forwardRef(Nl), Pl = ({ href: e, onRetry: t, testId
|
|
|
3054
3084
|
return t = null, o;
|
|
3055
3085
|
}
|
|
3056
3086
|
};
|
|
3057
|
-
},
|
|
3087
|
+
}, ca = (e) => {
|
|
3058
3088
|
const t = Qe(e);
|
|
3059
3089
|
if (t === null) return bt;
|
|
3060
3090
|
try {
|
|
@@ -3066,11 +3096,11 @@ const Dl = /* @__PURE__ */ y.forwardRef(Nl), Pl = ({ href: e, onRetry: t, testId
|
|
|
3066
3096
|
let n = null;
|
|
3067
3097
|
const r = () => {
|
|
3068
3098
|
if (n === null) {
|
|
3069
|
-
const i =
|
|
3070
|
-
n = { changes: i, settings:
|
|
3099
|
+
const i = ca(e);
|
|
3100
|
+
n = { changes: i, settings: gt(t, i) };
|
|
3071
3101
|
}
|
|
3072
3102
|
return n;
|
|
3073
|
-
}, o =
|
|
3103
|
+
}, o = Me();
|
|
3074
3104
|
return {
|
|
3075
3105
|
storageKey: e,
|
|
3076
3106
|
defaults: t,
|
|
@@ -3079,17 +3109,17 @@ const Dl = /* @__PURE__ */ y.forwardRef(Nl), Pl = ({ href: e, onRetry: t, testId
|
|
|
3079
3109
|
subscribe: o.subscribe,
|
|
3080
3110
|
advance: (i) => {
|
|
3081
3111
|
const { changes: l, settings: u } = r(), m = Kn(l, i, Xn(u, i)[i], t);
|
|
3082
|
-
return n = { changes: m, settings:
|
|
3112
|
+
return n = { changes: m, settings: gt(t, m) }, o.emit(), Je(e, Yn(m)), n.settings;
|
|
3083
3113
|
}
|
|
3084
3114
|
};
|
|
3085
|
-
},
|
|
3086
|
-
const t = /* @__PURE__ */ new Map(), n = kn(), r = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map(), u =
|
|
3115
|
+
}, da = Object.freeze({ status: "refreshed" }), ua = Object.freeze({ status: "superseded" }), ot = Object.freeze({ status: "deferred" }), fa = gn(ot), qn = 4, ma = qn - 1, Kt = Object.freeze({ status: "loading" }), ha = Object.freeze({ status: "error", failure: Object.freeze({ reason: "failed" }) }), pa = (e) => {
|
|
3116
|
+
const t = /* @__PURE__ */ new Map(), n = kn(), r = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map(), u = Me(), m = /* @__PURE__ */ new Set();
|
|
3087
3117
|
let f = 0, d = 0;
|
|
3088
|
-
const h = { direct: null, bulk: null },
|
|
3089
|
-
let b = !1,
|
|
3090
|
-
const
|
|
3091
|
-
|
|
3092
|
-
}, S = (p) => o.get(p) ?? 0,
|
|
3118
|
+
const h = { direct: null, bulk: null }, g = /* @__PURE__ */ new Set();
|
|
3119
|
+
let b = !1, M = 0;
|
|
3120
|
+
const R = () => {
|
|
3121
|
+
M += 1, u.emit();
|
|
3122
|
+
}, S = (p) => o.get(p) ?? 0, A = (p) => {
|
|
3093
3123
|
let x = l.get(p);
|
|
3094
3124
|
return x === void 0 && (x = { claims: /* @__PURE__ */ new Map(), unclaimed: /* @__PURE__ */ new Set(), direct: /* @__PURE__ */ new Set(), bulk: /* @__PURE__ */ new Set(), inFlight: /* @__PURE__ */ new Map() }, l.set(p, x)), x;
|
|
3095
3125
|
}, L = (p, x, k) => {
|
|
@@ -3097,58 +3127,58 @@ const Dl = /* @__PURE__ */ y.forwardRef(Nl), Pl = ({ href: e, onRetry: t, testId
|
|
|
3097
3127
|
}, E = (p) => {
|
|
3098
3128
|
const x = l.get(p);
|
|
3099
3129
|
if (x !== void 0) {
|
|
3100
|
-
for (const [k,
|
|
3101
|
-
L(x, k,
|
|
3130
|
+
for (const [k, O] of [...x.inFlight])
|
|
3131
|
+
L(x, k, O), O.controller.abort();
|
|
3102
3132
|
x.direct.clear(), x.bulk.clear(), x.unclaimed.clear();
|
|
3103
3133
|
}
|
|
3104
3134
|
}, v = (p) => {
|
|
3105
3135
|
const x = S(p) + 1;
|
|
3106
3136
|
return o.set(p, x), E(p), x;
|
|
3107
|
-
},
|
|
3108
|
-
const k = Ee(p),
|
|
3137
|
+
}, a = (p, x) => {
|
|
3138
|
+
const k = Ee(p), O = { promise: p, opened: x, stale: !1, loadedAt: k?.status === "ok" ? k.loadedAt : null };
|
|
3109
3139
|
return p.status === "pending" && p.then(($) => {
|
|
3110
|
-
$.status === "ok" && (
|
|
3111
|
-
}),
|
|
3112
|
-
},
|
|
3140
|
+
$.status === "ok" && (O.loadedAt = $.loadedAt);
|
|
3141
|
+
}), O;
|
|
3142
|
+
}, s = (p) => {
|
|
3113
3143
|
let x = r.get(p);
|
|
3114
3144
|
return x === void 0 && (x = /* @__PURE__ */ new Map(), r.set(p, x)), x;
|
|
3115
|
-
},
|
|
3116
|
-
const x = [...l.keys()], k = h[p],
|
|
3145
|
+
}, w = (p) => {
|
|
3146
|
+
const x = [...l.keys()], k = h[p], O = k === null ? 0 : x.indexOf(k) + 1;
|
|
3117
3147
|
for (let $ = 0; $ < x.length; $ += 1) {
|
|
3118
|
-
const
|
|
3119
|
-
if (!(
|
|
3148
|
+
const I = x[(O + $) % x.length], K = I === void 0 ? void 0 : l.get(I);
|
|
3149
|
+
if (!(I === void 0 || K === void 0)) {
|
|
3120
3150
|
for (const U of K[p])
|
|
3121
3151
|
if ((K.claims.get(U) ?? 0) !== 0)
|
|
3122
|
-
return K[p].delete(U), h[p] =
|
|
3152
|
+
return K[p].delete(U), h[p] = I, { sourceId: I, path: U };
|
|
3123
3153
|
}
|
|
3124
3154
|
}
|
|
3125
3155
|
return null;
|
|
3126
|
-
},
|
|
3156
|
+
}, T = (p, x, k, O) => {
|
|
3127
3157
|
const $ = l.get(p);
|
|
3128
3158
|
if ($ === void 0 || $.inFlight.get(x) !== k) return;
|
|
3129
3159
|
L($, x, k);
|
|
3130
|
-
const
|
|
3131
|
-
if (
|
|
3132
|
-
const U = { sourceId: p, path: x, failure:
|
|
3160
|
+
const I = ($.claims.get(x) ?? 0) > 0, K = s(p);
|
|
3161
|
+
if (O.status === "ok" ? K.set(x, { status: "loaded", entries: O.entries }) : O.status === "error" && I ? K.set(x, { status: "failed", failure: O.failure }) : K.delete(x), R(), O.status === "error" && I) {
|
|
3162
|
+
const U = { sourceId: p, path: x, failure: O.failure };
|
|
3133
3163
|
for (const ie of [...m]) ie(U);
|
|
3134
3164
|
}
|
|
3135
3165
|
N();
|
|
3136
|
-
},
|
|
3137
|
-
const
|
|
3138
|
-
|
|
3139
|
-
($) =>
|
|
3140
|
-
() =>
|
|
3166
|
+
}, C = (p, x, k) => {
|
|
3167
|
+
const O = { controller: new AbortController(), lane: k };
|
|
3168
|
+
A(p).inFlight.set(x, O), f += 1, k === "bulk" && (d += 1), e.children(p, x, O.controller.signal).then(
|
|
3169
|
+
($) => T(p, x, O, $),
|
|
3170
|
+
() => T(p, x, O, ha)
|
|
3141
3171
|
);
|
|
3142
3172
|
}, N = () => {
|
|
3143
3173
|
for (; f < qn; ) {
|
|
3144
|
-
const p =
|
|
3174
|
+
const p = w("direct");
|
|
3145
3175
|
if (p !== null) {
|
|
3146
|
-
|
|
3176
|
+
C(p.sourceId, p.path, "direct");
|
|
3147
3177
|
continue;
|
|
3148
3178
|
}
|
|
3149
|
-
const x = d <
|
|
3179
|
+
const x = d < ma ? w("bulk") : null;
|
|
3150
3180
|
if (x === null) return;
|
|
3151
|
-
|
|
3181
|
+
C(x.sourceId, x.path, "bulk");
|
|
3152
3182
|
}
|
|
3153
3183
|
}, q = (p, x, k) => {
|
|
3154
3184
|
if (!(x.direct.delete(k) || x.bulk.delete(k))) {
|
|
@@ -3160,28 +3190,28 @@ const Dl = /* @__PURE__ */ y.forwardRef(Nl), Pl = ({ href: e, onRetry: t, testId
|
|
|
3160
3190
|
}, W = () => {
|
|
3161
3191
|
b = !1;
|
|
3162
3192
|
let p = !1;
|
|
3163
|
-
for (const x of
|
|
3164
|
-
const k =
|
|
3165
|
-
for (const
|
|
3166
|
-
(k.claims.get(
|
|
3193
|
+
for (const x of g) {
|
|
3194
|
+
const k = A(x);
|
|
3195
|
+
for (const O of k.unclaimed)
|
|
3196
|
+
(k.claims.get(O) ?? 0) === 0 && q(x, k, O) && (p = !0);
|
|
3167
3197
|
k.unclaimed.clear();
|
|
3168
3198
|
}
|
|
3169
|
-
|
|
3199
|
+
g.clear(), p && (R(), N());
|
|
3170
3200
|
}, z = (p, x) => {
|
|
3171
|
-
t.set(p,
|
|
3201
|
+
t.set(p, a(Te(e.tree(p)), x));
|
|
3172
3202
|
}, j = (p, x, k) => {
|
|
3173
3203
|
v(p);
|
|
3174
|
-
const
|
|
3175
|
-
return t.set(p,
|
|
3176
|
-
}, Y = (p, x, k,
|
|
3204
|
+
const O = a(gn(x), k);
|
|
3205
|
+
return t.set(p, O), r.delete(p), R(), N(), O;
|
|
3206
|
+
}, Y = (p, x, k, O) => {
|
|
3177
3207
|
if (k !== S(p) || t.get(p) !== x) return;
|
|
3178
3208
|
const $ = Ee(x.promise);
|
|
3179
|
-
if (!(
|
|
3180
|
-
if (De($.entries,
|
|
3181
|
-
x.loadedAt =
|
|
3209
|
+
if (!(O.status !== "ok" || $?.status !== "ok" || x.loadedAt === null || O.loadedAt <= x.loadedAt)) {
|
|
3210
|
+
if (De($.entries, O.entries)) {
|
|
3211
|
+
x.loadedAt = O.loadedAt;
|
|
3182
3212
|
return;
|
|
3183
3213
|
}
|
|
3184
|
-
j(p,
|
|
3214
|
+
j(p, O, x.opened);
|
|
3185
3215
|
}
|
|
3186
3216
|
}, V = (p, x) => {
|
|
3187
3217
|
const k = t.get(p);
|
|
@@ -3189,58 +3219,58 @@ const Dl = /* @__PURE__ */ y.forwardRef(Nl), Pl = ({ href: e, onRetry: t, testId
|
|
|
3189
3219
|
}, re = (p, x) => {
|
|
3190
3220
|
x.stale = !1;
|
|
3191
3221
|
const k = S(p);
|
|
3192
|
-
e.tree(p).then((
|
|
3222
|
+
e.tree(p).then((O) => Y(p, x, k, O));
|
|
3193
3223
|
};
|
|
3194
3224
|
return {
|
|
3195
|
-
read: (p) => t.get(p)?.promise ??
|
|
3225
|
+
read: (p) => t.get(p)?.promise ?? fa,
|
|
3196
3226
|
open: (p) => {
|
|
3197
|
-
const x = n.resumes(p), k = n.hold(p),
|
|
3198
|
-
return
|
|
3227
|
+
const x = n.resumes(p), k = n.hold(p), O = t.get(p);
|
|
3228
|
+
return O === void 0 || V(p, "deferred") ? (z(p, !0), R()) : x || (O.opened && V(p, "error") ? (z(p, !0), R()) : (O.opened = !0, O.stale && V(p, "ok") && re(p, O))), k;
|
|
3199
3229
|
},
|
|
3200
3230
|
retry: (p) => {
|
|
3201
|
-
V(p, "error") && (z(p, !0),
|
|
3231
|
+
V(p, "error") && (z(p, !0), R());
|
|
3202
3232
|
},
|
|
3203
3233
|
seed: (p, x) => {
|
|
3204
3234
|
const k = x.then(
|
|
3205
|
-
(
|
|
3235
|
+
(I) => I === null ? ot : I,
|
|
3206
3236
|
() => ot
|
|
3207
|
-
),
|
|
3208
|
-
if (
|
|
3209
|
-
const
|
|
3210
|
-
k.then((K) => Y(p,
|
|
3237
|
+
), O = t.get(p);
|
|
3238
|
+
if (O !== void 0 && V(p, "ok")) {
|
|
3239
|
+
const I = S(p);
|
|
3240
|
+
k.then((K) => Y(p, O, I, K));
|
|
3211
3241
|
return;
|
|
3212
3242
|
}
|
|
3213
3243
|
v(p);
|
|
3214
|
-
const $ =
|
|
3215
|
-
t.set(p, $), r.delete(p), N(), k.then((
|
|
3216
|
-
t.get(p) === $ && (
|
|
3244
|
+
const $ = a(Te(k), O?.opened === !0);
|
|
3245
|
+
t.set(p, $), r.delete(p), N(), k.then((I) => {
|
|
3246
|
+
t.get(p) === $ && (I.status === "deferred" && n.isHeld(p) && z(p, $.opened), R());
|
|
3217
3247
|
});
|
|
3218
3248
|
},
|
|
3219
3249
|
refresh: async (p) => {
|
|
3220
3250
|
const x = (i.get(p) ?? 0) + 1;
|
|
3221
3251
|
i.set(p, x);
|
|
3222
3252
|
const k = await e.refresh(p);
|
|
3223
|
-
if (i.get(p) !== x) return
|
|
3253
|
+
if (i.get(p) !== x) return ua;
|
|
3224
3254
|
if (k.status === "error") return { status: "failed", failure: k.failure };
|
|
3225
|
-
const
|
|
3226
|
-
if (!(
|
|
3227
|
-
const
|
|
3228
|
-
if (
|
|
3255
|
+
const O = t.get(p);
|
|
3256
|
+
if (!(O !== void 0 && O.loadedAt !== null && V(p, "ok") && O.loadedAt > k.loadedAt)) {
|
|
3257
|
+
const I = j(p, k, !0);
|
|
3258
|
+
if (O !== void 0 && O.promise.status === "pending") {
|
|
3229
3259
|
const K = S(p);
|
|
3230
|
-
|
|
3260
|
+
O.promise.then((U) => Y(p, I, K, U));
|
|
3231
3261
|
}
|
|
3232
3262
|
}
|
|
3233
|
-
for (const [
|
|
3234
|
-
|
|
3235
|
-
return
|
|
3263
|
+
for (const [I, K] of t)
|
|
3264
|
+
I !== p && Ee(K.promise)?.status === "ok" && (K.stale = !0);
|
|
3265
|
+
return da;
|
|
3236
3266
|
},
|
|
3237
3267
|
children: (p, x) => r.get(p)?.get(x),
|
|
3238
3268
|
claimChildren: (p, x) => {
|
|
3239
|
-
const k =
|
|
3240
|
-
let $ = !1,
|
|
3269
|
+
const k = A(p), O = s(p);
|
|
3270
|
+
let $ = !1, I = !1;
|
|
3241
3271
|
for (const [U, ie] of x)
|
|
3242
|
-
k.claims.set(U, (k.claims.get(U) ?? 0) + 1),
|
|
3243
|
-
$ &&
|
|
3272
|
+
k.claims.set(U, (k.claims.get(U) ?? 0) + 1), O.get(U) === void 0 ? (O.set(U, Kt), k[ie].add(U), $ = !0, I = !0) : ie === "direct" && k.bulk.delete(U) && (k.direct.add(U), I = !0);
|
|
3273
|
+
$ && R(), I && N();
|
|
3244
3274
|
let K = !1;
|
|
3245
3275
|
return () => {
|
|
3246
3276
|
if (!K) {
|
|
@@ -3249,19 +3279,19 @@ const Dl = /* @__PURE__ */ y.forwardRef(Nl), Pl = ({ href: e, onRetry: t, testId
|
|
|
3249
3279
|
const ie = (k.claims.get(U) ?? 0) - 1;
|
|
3250
3280
|
ie > 0 ? k.claims.set(U, ie) : (k.claims.delete(U), k.unclaimed.add(U));
|
|
3251
3281
|
}
|
|
3252
|
-
|
|
3282
|
+
g.add(p), !b && (b = !0, queueMicrotask(W));
|
|
3253
3283
|
}
|
|
3254
3284
|
};
|
|
3255
3285
|
},
|
|
3256
3286
|
retryChildren: (p, x) => {
|
|
3257
3287
|
const k = r.get(p);
|
|
3258
3288
|
if (k === void 0 || k.get(x)?.status !== "failed") return;
|
|
3259
|
-
const
|
|
3260
|
-
if ((
|
|
3261
|
-
k.set(x, Kt),
|
|
3289
|
+
const O = A(p);
|
|
3290
|
+
if ((O.claims.get(x) ?? 0) > 0) {
|
|
3291
|
+
k.set(x, Kt), O.direct.add(x), R(), N();
|
|
3262
3292
|
return;
|
|
3263
3293
|
}
|
|
3264
|
-
k.delete(x),
|
|
3294
|
+
k.delete(x), R();
|
|
3265
3295
|
},
|
|
3266
3296
|
pendingChildren: (p) => {
|
|
3267
3297
|
const x = l.get(p);
|
|
@@ -3270,17 +3300,17 @@ const Dl = /* @__PURE__ */ y.forwardRef(Nl), Pl = ({ href: e, onRetry: t, testId
|
|
|
3270
3300
|
clear: () => {
|
|
3271
3301
|
for (const p of /* @__PURE__ */ new Set([...t.keys(), ...r.keys(), ...o.keys(), ...l.keys()])) v(p);
|
|
3272
3302
|
for (const [p, x] of i) i.set(p, x + 1);
|
|
3273
|
-
t.clear(), r.clear(),
|
|
3303
|
+
t.clear(), r.clear(), R();
|
|
3274
3304
|
},
|
|
3275
3305
|
subscribeChildrenFailures: (p) => (m.add(p), () => {
|
|
3276
3306
|
m.delete(p);
|
|
3277
3307
|
}),
|
|
3278
3308
|
subscribe: u.subscribe,
|
|
3279
|
-
version: () =>
|
|
3309
|
+
version: () => M
|
|
3280
3310
|
};
|
|
3281
|
-
},
|
|
3311
|
+
}, va = (e, t) => {
|
|
3282
3312
|
let n = e;
|
|
3283
|
-
const r =
|
|
3313
|
+
const r = Me();
|
|
3284
3314
|
return {
|
|
3285
3315
|
getSnapshot: () => n,
|
|
3286
3316
|
subscribe: r.subscribe,
|
|
@@ -3288,26 +3318,26 @@ const Dl = /* @__PURE__ */ y.forwardRef(Nl), Pl = ({ href: e, onRetry: t, testId
|
|
|
3288
3318
|
n = { ...n, ...o }, t(n), r.emit();
|
|
3289
3319
|
}
|
|
3290
3320
|
};
|
|
3291
|
-
},
|
|
3292
|
-
let
|
|
3293
|
-
const
|
|
3321
|
+
}, wa = 1;
|
|
3322
|
+
let Oe = 0, de = null;
|
|
3323
|
+
const ga = () => {
|
|
3294
3324
|
const { documentElement: e, body: t } = document;
|
|
3295
|
-
|
|
3325
|
+
Oe === 0 && (de = { 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"), Oe += 1;
|
|
3296
3326
|
let n = !1;
|
|
3297
3327
|
return () => {
|
|
3298
|
-
n || (n = !0,
|
|
3328
|
+
n || (n = !0, Oe -= 1, !(Oe > 0 || de === null) && (e.style.overflow = de.htmlOverflow, t.style.overflow = de.bodyOverflow, e.style.scrollbarGutter = de.htmlGutter, t.style.scrollbarGutter = de.bodyGutter, de = null));
|
|
3299
3329
|
};
|
|
3300
|
-
},
|
|
3330
|
+
}, ba = [
|
|
3301
3331
|
{ selector: '[data-aqmx-document-flow="fill"]', name: "document region" },
|
|
3302
3332
|
{ selector: "[data-aqmx-explorer-body]", name: "tree area" }
|
|
3303
|
-
], Xt = 1, Yt = (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.",
|
|
3333
|
+
], Xt = 1, Ea = 1e3, Yt = (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.", ya = (e) => {
|
|
3304
3334
|
if (!Yt(e)) return null;
|
|
3305
3335
|
const t = e.getBoundingClientRect(), n = window.innerHeight;
|
|
3306
|
-
if (t.bottom > n +
|
|
3336
|
+
if (t.bottom > n + wa)
|
|
3307
3337
|
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}`;
|
|
3308
3338
|
if (t.height < Xt)
|
|
3309
3339
|
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}`;
|
|
3310
|
-
for (const { selector: r, name: o } of
|
|
3340
|
+
for (const { selector: r, name: o } of ba)
|
|
3311
3341
|
for (const i of e.querySelectorAll(r)) {
|
|
3312
3342
|
if (!Yt(i)) continue;
|
|
3313
3343
|
const l = i.getBoundingClientRect().height;
|
|
@@ -3315,37 +3345,39 @@ const ws = () => {
|
|
|
3315
3345
|
return `[markdown-explorer] the explorer's ${o} collapsed to ${String(Math.round(l))}px while lockDocumentScroll stops the page from scrolling, so it cannot be read. ${Ke}`;
|
|
3316
3346
|
}
|
|
3317
3347
|
return null;
|
|
3318
|
-
},
|
|
3319
|
-
let t = !1;
|
|
3320
|
-
const
|
|
3321
|
-
|
|
3322
|
-
const
|
|
3323
|
-
|
|
3324
|
-
},
|
|
3325
|
-
|
|
3326
|
-
|
|
3348
|
+
}, xa = (e) => {
|
|
3349
|
+
let t = !1, n;
|
|
3350
|
+
const r = () => {
|
|
3351
|
+
n = void 0;
|
|
3352
|
+
const l = ya(e);
|
|
3353
|
+
l !== null && (t = !0, console.error(l));
|
|
3354
|
+
}, o = () => {
|
|
3355
|
+
t || (clearTimeout(n), n = setTimeout(r, Ea));
|
|
3356
|
+
}, i = typeof ResizeObserver > "u" ? null : new ResizeObserver(o);
|
|
3357
|
+
return i?.observe(e), window.addEventListener("resize", o), o(), () => {
|
|
3358
|
+
clearTimeout(n), i?.disconnect(), window.removeEventListener("resize", o);
|
|
3327
3359
|
};
|
|
3328
|
-
},
|
|
3329
|
-
te(() => e ?
|
|
3360
|
+
}, Sa = (e, t) => {
|
|
3361
|
+
te(() => e ? ga() : void 0, [e]), te(() => {
|
|
3330
3362
|
const n = t.current;
|
|
3331
3363
|
if (!(!e || n === null))
|
|
3332
|
-
return
|
|
3364
|
+
return xa(n);
|
|
3333
3365
|
}, [e, t]);
|
|
3334
|
-
}, Jt = '[data-testid="markdown-explorer-view-switch"]',
|
|
3366
|
+
}, Jt = '[data-testid="markdown-explorer-view-switch"]', ka = [
|
|
3335
3367
|
{ control: Jt, successors: [Jt, '[data-testid="markdown-explorer-sheet-toggle"]'] },
|
|
3336
3368
|
{ control: '[data-testid="markdown-explorer-selection-open"]', successors: ['[data-testid="markdown-explorer-panel-frame"]'] }
|
|
3337
|
-
],
|
|
3338
|
-
for (const t of
|
|
3369
|
+
], Ta = (e) => {
|
|
3370
|
+
for (const t of ka) {
|
|
3339
3371
|
const n = e.closest(t.control);
|
|
3340
3372
|
if (n !== null) return { element: n, control: t };
|
|
3341
3373
|
}
|
|
3342
3374
|
return null;
|
|
3343
|
-
},
|
|
3375
|
+
}, Ra = (e, t) => {
|
|
3344
3376
|
const n = _(null);
|
|
3345
3377
|
te(() => {
|
|
3346
3378
|
const o = (u) => {
|
|
3347
3379
|
const m = e.current;
|
|
3348
|
-
n.current = m !== null && u instanceof Element && m.contains(u) ?
|
|
3380
|
+
n.current = m !== null && u instanceof Element && m.contains(u) ? Ta(u) : null;
|
|
3349
3381
|
}, i = (u) => o(u.target);
|
|
3350
3382
|
o(document.activeElement);
|
|
3351
3383
|
const l = (u) => {
|
|
@@ -3383,7 +3415,7 @@ const ws = () => {
|
|
|
3383
3415
|
});
|
|
3384
3416
|
return u.observe(l, { childList: !0, subtree: !0 }), () => u.disconnect();
|
|
3385
3417
|
}, [t, e]);
|
|
3386
|
-
},
|
|
3418
|
+
}, Ma = it(() => import("./TreeLayout-eFQmzpNj.js").then((e) => ({ default: e.TreeLayout }))), Oa = it(() => import("./MultiLayout-Dy3DD_09.js").then((e) => ({ default: e.MultiLayout }))), Ca = 64, La = {
|
|
3387
3419
|
request: (e) => {
|
|
3388
3420
|
requestAnimationFrame(e);
|
|
3389
3421
|
}
|
|
@@ -3392,28 +3424,28 @@ const ws = () => {
|
|
|
3392
3424
|
}, Xe = (e, t) => {
|
|
3393
3425
|
t.tree !== null && e.trees.seed(t.tree.sourceId, t.tree.result);
|
|
3394
3426
|
for (const { path: n, document: r } of t.documents) e.documents.seed(n, r);
|
|
3395
|
-
},
|
|
3396
|
-
const [n, r] =
|
|
3427
|
+
}, Aa = (e, t) => {
|
|
3428
|
+
const [n, r] = B(() => ({ overrides: t, locale: e, labels: Rt(e, t) }));
|
|
3397
3429
|
if (n.locale === e && Nr(n.overrides, t)) return n.labels;
|
|
3398
|
-
const o = { overrides: t, locale: e, labels:
|
|
3430
|
+
const o = { overrides: t, locale: e, labels: Rt(e, t) };
|
|
3399
3431
|
return r(o), o.labels;
|
|
3400
|
-
},
|
|
3401
|
-
const [r, o] =
|
|
3432
|
+
}, Na = (e, t, n) => {
|
|
3433
|
+
const [r, o] = B(() => ({ scope: t, store: Wt(e, n) }));
|
|
3402
3434
|
if (r.scope === t && r.store.storageKey === e && r.store.defaults === n) return r.store;
|
|
3403
3435
|
const i = { scope: t, store: Wt(e, n) };
|
|
3404
3436
|
return o(i), i.store;
|
|
3405
3437
|
}, Ye = (e, t) => {
|
|
3406
|
-
const [n, r] =
|
|
3438
|
+
const [n, r] = B(() => ({ scope: e, value: t() }));
|
|
3407
3439
|
if (n.scope === e) return n.value;
|
|
3408
3440
|
const o = { scope: e, value: t() };
|
|
3409
3441
|
return r(o), o.value;
|
|
3410
|
-
},
|
|
3442
|
+
}, Da = () => ia(La), en = "on", Pa = "off", $a = Object.freeze({ kind: "unavailable" }), Fa = (e) => {
|
|
3411
3443
|
if (e !== void 0 && (e === null || typeof e != "object" || typeof e.convert != "function"))
|
|
3412
3444
|
throw new TypeError("[markdown-explorer] draftConverter must be an object with a convert function");
|
|
3413
|
-
},
|
|
3445
|
+
}, qa = (e, t) => {
|
|
3414
3446
|
const n = ue(e.peek(t));
|
|
3415
|
-
return n === null || n.document.kind === "failure" ?
|
|
3416
|
-
},
|
|
3447
|
+
return n === null || n.document.kind === "failure" ? se(t) : n.document.name;
|
|
3448
|
+
}, Qa = ({
|
|
3417
3449
|
data: e,
|
|
3418
3450
|
config: t,
|
|
3419
3451
|
storageNamespace: n,
|
|
@@ -3427,93 +3459,93 @@ const ws = () => {
|
|
|
3427
3459
|
onEditGrant: d,
|
|
3428
3460
|
draftConverter: h
|
|
3429
3461
|
}) => {
|
|
3430
|
-
xr(n),
|
|
3431
|
-
const
|
|
3432
|
-
}),
|
|
3433
|
-
const k =
|
|
3434
|
-
return Xe(
|
|
3462
|
+
xr(n), Fa(h);
|
|
3463
|
+
const g = un(r), b = Dr(i), M = Aa(g, o), { revalidate: R } = Vn(), S = _(() => {
|
|
3464
|
+
}), A = $e(t.dataPath), [L] = B(() => {
|
|
3465
|
+
const k = aa({ dataPath: A, onScope: ($) => S.current($) }), O = { documents: $o({ client: k, capacity: Math.max(Ca, t.multiView.maxPanels * 2) }), trees: pa(k) };
|
|
3466
|
+
return Xe(O, e), kt(n, e.scope), { data: k, ...O, aligned: { pageData: e, storageNamespace: n, pendingReader: null } };
|
|
3435
3467
|
});
|
|
3436
3468
|
if (L.aligned.pageData !== e || L.aligned.storageNamespace !== n) {
|
|
3437
3469
|
const k = L.aligned.pageData;
|
|
3438
3470
|
L.aligned.pageData = e, L.aligned.storageNamespace = n, k !== e && (k.scope !== e.scope ? L.aligned.pendingReader = e : Xe(L, e)), kt(n, e.scope);
|
|
3439
3471
|
}
|
|
3440
|
-
const E =
|
|
3472
|
+
const E = Na(we(n).treeSettings, e.scope, t.defaultTreeSettings);
|
|
3441
3473
|
H(() => {
|
|
3442
3474
|
const k = L.aligned.pendingReader;
|
|
3443
3475
|
k !== null && (L.aligned.pendingReader = null, Qt(L), Xe(L, k));
|
|
3444
3476
|
}, [e, L]), H(() => {
|
|
3445
3477
|
let k = !1;
|
|
3446
|
-
return S.current = (
|
|
3447
|
-
|
|
3478
|
+
return S.current = (O) => {
|
|
3479
|
+
O === e.scope || k || (k = !0, O !== null && (Qt(L), Sr(n)), R());
|
|
3448
3480
|
}, () => {
|
|
3449
3481
|
S.current = () => {
|
|
3450
3482
|
};
|
|
3451
3483
|
};
|
|
3452
|
-
}, [e,
|
|
3484
|
+
}, [e, R, L, n]);
|
|
3453
3485
|
const v = _(t.settingsCookie);
|
|
3454
3486
|
H(() => {
|
|
3455
3487
|
v.current = t.settingsCookie;
|
|
3456
3488
|
}, [t.settingsCookie]);
|
|
3457
|
-
const [
|
|
3458
|
-
() =>
|
|
3489
|
+
const [a] = B(
|
|
3490
|
+
() => va(e.settings, (k) => {
|
|
3459
3491
|
document.cookie = er(v.current, k, window.location.protocol === "https:");
|
|
3460
3492
|
})
|
|
3461
|
-
),
|
|
3493
|
+
), s = Ye(e.scope, Da), w = Ye(e.scope, sa), T = _(M);
|
|
3462
3494
|
H(() => {
|
|
3463
|
-
|
|
3464
|
-
}, [
|
|
3465
|
-
const
|
|
3495
|
+
T.current = M;
|
|
3496
|
+
}, [M]);
|
|
3497
|
+
const C = Ye(
|
|
3466
3498
|
e.scope,
|
|
3467
3499
|
() => Vr({
|
|
3468
3500
|
data: L.data,
|
|
3469
|
-
conflictLabels: () => ({ ours:
|
|
3470
|
-
onSaveSettled: (k,
|
|
3471
|
-
|
|
3472
|
-
const $ = $r(
|
|
3473
|
-
$ !== null &&
|
|
3501
|
+
conflictLabels: () => ({ ours: T.current.conflictOurs, theirs: T.current.conflictTheirs }),
|
|
3502
|
+
onSaveSettled: (k, O) => {
|
|
3503
|
+
O.kind === "saved" && L.documents.refresh(k);
|
|
3504
|
+
const $ = $r(T.current, O, qa(L.documents, k));
|
|
3505
|
+
$ !== null && s.announce($);
|
|
3474
3506
|
},
|
|
3475
3507
|
sideBySideSetting: {
|
|
3476
|
-
read: () => Qe(
|
|
3477
|
-
write: (k) => Je(
|
|
3508
|
+
read: () => Qe(we(n).editPreview) === en,
|
|
3509
|
+
write: (k) => Je(we(n).editPreview, k ? en : Pa)
|
|
3478
3510
|
},
|
|
3479
3511
|
editorShareSetting: {
|
|
3480
|
-
read: () => Hr(Qe(
|
|
3481
|
-
write: (k) => Je(
|
|
3512
|
+
read: () => Hr(Qe(we(n).editSplit)),
|
|
3513
|
+
write: (k) => Je(we(n).editSplit, String(k))
|
|
3482
3514
|
}
|
|
3483
3515
|
})
|
|
3484
|
-
), N = G(() =>
|
|
3516
|
+
), N = G(() => Te(e.notices.catch(() => [])), [e.notices]), q = e.sources.map((k) => k.id).join(`
|
|
3485
3517
|
`), W = G(() => Qn(t, q.split(`
|
|
3486
3518
|
`)), [t, q]), z = _(f);
|
|
3487
3519
|
H(() => {
|
|
3488
3520
|
z.current = f;
|
|
3489
3521
|
}, [f]);
|
|
3490
|
-
const [j] =
|
|
3491
|
-
z.current?.(k,
|
|
3522
|
+
const [j] = B(() => (k, O) => {
|
|
3523
|
+
z.current?.(k, O);
|
|
3492
3524
|
}), Y = f === void 0 ? void 0 : j, V = _(h);
|
|
3493
3525
|
H(() => {
|
|
3494
3526
|
V.current = h;
|
|
3495
3527
|
}, [h]);
|
|
3496
|
-
const [re] =
|
|
3528
|
+
const [re] = B(() => {
|
|
3497
3529
|
let k = !1;
|
|
3498
3530
|
return {
|
|
3499
|
-
convert: (
|
|
3500
|
-
const
|
|
3501
|
-
return
|
|
3531
|
+
convert: (O, $) => {
|
|
3532
|
+
const I = V.current;
|
|
3533
|
+
return I === void 0 ? Promise.resolve($a) : I.convert(O, $);
|
|
3502
3534
|
},
|
|
3503
3535
|
prepare: () => {
|
|
3504
3536
|
try {
|
|
3505
3537
|
V.current?.prepare?.();
|
|
3506
|
-
} catch (
|
|
3538
|
+
} catch (O) {
|
|
3507
3539
|
if (k) return;
|
|
3508
|
-
k = !0, console.error("[markdown-explorer] the draft converter's prepare threw",
|
|
3540
|
+
k = !0, console.error("[markdown-explorer] the draft converter's prepare threw", O);
|
|
3509
3541
|
}
|
|
3510
3542
|
}
|
|
3511
3543
|
};
|
|
3512
3544
|
}), p = h === void 0 ? void 0 : re, x = G(
|
|
3513
3545
|
() => ({
|
|
3514
3546
|
config: W,
|
|
3515
|
-
labels:
|
|
3516
|
-
locale:
|
|
3547
|
+
labels: M,
|
|
3548
|
+
locale: g,
|
|
3517
3549
|
theme: b,
|
|
3518
3550
|
storageNamespace: n,
|
|
3519
3551
|
scope: e.scope,
|
|
@@ -3522,80 +3554,80 @@ const ws = () => {
|
|
|
3522
3554
|
documents: L.documents,
|
|
3523
3555
|
trees: L.trees,
|
|
3524
3556
|
data: L.data,
|
|
3525
|
-
viewSettings:
|
|
3557
|
+
viewSettings: a,
|
|
3526
3558
|
treeSettings: E,
|
|
3527
|
-
announcer:
|
|
3528
|
-
reveals:
|
|
3529
|
-
edits:
|
|
3559
|
+
announcer: s,
|
|
3560
|
+
reveals: w,
|
|
3561
|
+
edits: C,
|
|
3530
3562
|
onEditGrant: d,
|
|
3531
3563
|
draftConverter: p,
|
|
3532
3564
|
renderTreeFailure: u,
|
|
3533
3565
|
reportMathDiagnostics: Y
|
|
3534
3566
|
}),
|
|
3535
|
-
[W,
|
|
3567
|
+
[W, M, g, b, n, e.scope, e.sources, N, L, a, E, s, w, C, d, p, u, Y]
|
|
3536
3568
|
);
|
|
3537
|
-
return /* @__PURE__ */ c(fn, { value: x, children: /* @__PURE__ */ c(
|
|
3538
|
-
},
|
|
3539
|
-
const [o] =
|
|
3569
|
+
return /* @__PURE__ */ c(fn, { value: x, children: /* @__PURE__ */ c(Ia, { renderFrame: l, lockDocumentScroll: m }, e.scope) });
|
|
3570
|
+
}, _a = ({ ref: e, theme: t, view: n, children: r }) => {
|
|
3571
|
+
const [o] = B(bi);
|
|
3540
3572
|
return /* @__PURE__ */ c("div", { ref: e, className: "aqmx-root", "data-aqmx-theme": t, "data-aqmx-view": n, "data-testid": "markdown-explorer", onKeyDownCapture: o.onKeyDownCapture, onKeyUpCapture: o.onKeyUpCapture, onBlurCapture: o.onBlurCapture, children: r });
|
|
3541
|
-
},
|
|
3573
|
+
}, Ia = ({ renderFrame: e, lockDocumentScroll: t }) => {
|
|
3542
3574
|
const { theme: n, labels: r } = D(), o = lt(), { hash: i } = nn(), l = Fe(), u = _(null);
|
|
3543
|
-
|
|
3575
|
+
Sa(t, u), H(() => {
|
|
3544
3576
|
o.kind === "redirect" && l(`${o.href}${i}`, "browse");
|
|
3545
3577
|
}, [o, i, l]);
|
|
3546
3578
|
const { location: m } = o, f = m.view;
|
|
3547
|
-
|
|
3548
|
-
const d = m.view === "tree" ? /* @__PURE__ */ c(ke, { fallback: /* @__PURE__ */ c("section", { className: "aqmx-split-fallback", "aria-label": r.explorerRegion, "aria-busy": "true", "data-testid": "markdown-explorer-split-loading", ...et }), children: /* @__PURE__ */ c(
|
|
3579
|
+
Ra(u, f);
|
|
3580
|
+
const d = m.view === "tree" ? /* @__PURE__ */ c(ke, { fallback: /* @__PURE__ */ c("section", { className: "aqmx-split-fallback", "aria-label": r.explorerRegion, "aria-busy": "true", "data-testid": "markdown-explorer-split-loading", ...et }), children: /* @__PURE__ */ c(Ma, { location: m }) }) : m.view === "multi" ? /* @__PURE__ */ c(ke, { fallback: /* @__PURE__ */ c("section", { className: "aqmx-stage-fallback", "aria-label": r.multiRegion, "aria-busy": "true", "data-testid": "markdown-explorer-stage-loading", ...et }), children: /* @__PURE__ */ c(Oa, { location: m }) }) : /* @__PURE__ */ c(ra, { location: m }), h = /* @__PURE__ */ F(_a, { ref: u, theme: n, view: f, children: [
|
|
3549
3581
|
d,
|
|
3550
|
-
/* @__PURE__ */ c(
|
|
3551
|
-
/* @__PURE__ */ c(
|
|
3582
|
+
/* @__PURE__ */ c(so, {}),
|
|
3583
|
+
/* @__PURE__ */ c(oa, { holds: !0, testId: "markdown-explorer-announcer" })
|
|
3552
3584
|
] });
|
|
3553
3585
|
return e === void 0 ? h : e({ view: f, children: h });
|
|
3554
|
-
},
|
|
3586
|
+
}, es = kr({ submissions: "skip", otherPath: "skip", query: "skip", hashChange: "skip" });
|
|
3555
3587
|
export {
|
|
3556
|
-
|
|
3588
|
+
Tt as $,
|
|
3557
3589
|
rt as A,
|
|
3558
3590
|
Zt as B,
|
|
3559
3591
|
Fr as C,
|
|
3560
|
-
|
|
3592
|
+
na as D,
|
|
3561
3593
|
Pl as E,
|
|
3562
3594
|
Jr as F,
|
|
3563
3595
|
ql as G,
|
|
3564
|
-
|
|
3565
|
-
|
|
3596
|
+
Me as H,
|
|
3597
|
+
Ya as I,
|
|
3566
3598
|
yi as J,
|
|
3567
3599
|
Ur as K,
|
|
3568
3600
|
xn as L,
|
|
3569
3601
|
Do as M,
|
|
3570
3602
|
Qi as N,
|
|
3571
|
-
|
|
3572
|
-
|
|
3603
|
+
gl as O,
|
|
3604
|
+
ta as P,
|
|
3573
3605
|
Lo as Q,
|
|
3574
|
-
|
|
3575
|
-
|
|
3606
|
+
Cl as R,
|
|
3607
|
+
Co as S,
|
|
3576
3608
|
lt as T,
|
|
3577
|
-
|
|
3578
|
-
|
|
3579
|
-
|
|
3580
|
-
|
|
3581
|
-
|
|
3609
|
+
oa as U,
|
|
3610
|
+
Ae as V,
|
|
3611
|
+
Tr as W,
|
|
3612
|
+
Mt as X,
|
|
3613
|
+
Cr as Y,
|
|
3582
3614
|
dn as Z,
|
|
3583
|
-
|
|
3615
|
+
Rr as _,
|
|
3584
3616
|
qr as a,
|
|
3585
|
-
|
|
3586
|
-
|
|
3587
|
-
|
|
3617
|
+
Qa as a0,
|
|
3618
|
+
Rt as a1,
|
|
3619
|
+
es as a2,
|
|
3588
3620
|
_r as b,
|
|
3589
3621
|
Fe as c,
|
|
3590
3622
|
Jl as d,
|
|
3591
3623
|
et as e,
|
|
3592
3624
|
vl as f,
|
|
3593
3625
|
So as g,
|
|
3594
|
-
|
|
3595
|
-
|
|
3626
|
+
Ir as h,
|
|
3627
|
+
Mo as i,
|
|
3596
3628
|
xo as j,
|
|
3597
|
-
|
|
3598
|
-
|
|
3629
|
+
ae as k,
|
|
3630
|
+
Oo as l,
|
|
3599
3631
|
ue as m,
|
|
3600
3632
|
Eo as n,
|
|
3601
3633
|
yo as o,
|
|
@@ -3603,11 +3635,11 @@ export {
|
|
|
3603
3635
|
lo as q,
|
|
3604
3636
|
to as r,
|
|
3605
3637
|
Fl as s,
|
|
3606
|
-
|
|
3638
|
+
Xa as t,
|
|
3607
3639
|
D as u,
|
|
3608
3640
|
ko as v,
|
|
3609
|
-
|
|
3641
|
+
Ja as w,
|
|
3610
3642
|
hn as x,
|
|
3611
|
-
|
|
3643
|
+
Il as y,
|
|
3612
3644
|
_l as z
|
|
3613
3645
|
};
|