@aiquants/markdown-explorer 0.15.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.
Files changed (58) hide show
  1. package/CHANGELOG.md +173 -15
  2. package/README.md +73 -27
  3. package/dist/EditSurface-0owpPyLE.js +786 -0
  4. package/dist/EditSurface-D-nhilRk.cjs +2 -0
  5. package/dist/{ExplorerSplit-BPLECNpv.js → ExplorerSplit-8c93p1hy.js} +613 -592
  6. package/dist/ExplorerSplit-bpEvHrCo.cjs +1 -0
  7. package/dist/MultiLayout-BXfzR6XC.cjs +1 -0
  8. package/dist/MultiLayout-Dy3DD_09.js +963 -0
  9. package/dist/NativeScrollBar-CI9fTvkt.js +65 -0
  10. package/dist/NativeScrollBar-Ddn0iHjv.cjs +1 -0
  11. package/dist/TreeLayout-CKZ-XQgn.cjs +1 -0
  12. package/dist/TreeLayout-eFQmzpNj.js +72 -0
  13. package/dist/client/storage.d.cts +1 -0
  14. package/dist/client/storage.d.ts +1 -0
  15. package/dist/core/geometry.d.cts +20 -1
  16. package/dist/core/geometry.d.ts +20 -1
  17. package/dist/core/labels.d.cts +17 -0
  18. package/dist/core/labels.d.ts +17 -0
  19. package/dist/core/location.d.cts +3 -0
  20. package/dist/core/location.d.ts +3 -0
  21. package/dist/core/treeSettings.d.cts +3 -1
  22. package/dist/core/treeSettings.d.ts +3 -1
  23. package/dist/index-5gwNJ8CB.cjs +13 -0
  24. package/dist/index-h9e3p5Pd.js +3645 -0
  25. package/dist/index.cjs +1 -1
  26. package/dist/index.js +25 -25
  27. package/dist/location-D85EXiPt.cjs +1 -0
  28. package/dist/location-G7psbmv_.js +499 -0
  29. package/dist/{merge-Bi2VedIr.js → merge-CS3p9BVw.js} +5 -5
  30. package/dist/{merge-BFk7nT59.cjs → merge-C_g05UGC.cjs} +1 -1
  31. package/dist/server.cjs +1 -1
  32. package/dist/server.js +1 -1
  33. package/dist/{storage-BSthKLSG.js → storage-CmGHg7OA.js} +11 -10
  34. package/dist/storage-DM0EvkVf.cjs +1 -0
  35. package/dist/storage.cjs +1 -1
  36. package/dist/storage.js +1 -1
  37. package/dist/styles/markdown-explorer.css +1 -1
  38. package/dist/useSplitPersistence-B1b5Lg5E.js +42 -0
  39. package/dist/useSplitPersistence-DRjsPZdH.cjs +1 -0
  40. package/docs/behavior/dom-hooks.md +19 -11
  41. package/docs/behavior/layout.md +121 -42
  42. package/docs/behavior/localization.md +12 -6
  43. package/docs/behavior/url-contract.md +18 -6
  44. package/package.json +5 -5
  45. package/dist/EditSurface-BLlu5zEt.cjs +0 -2
  46. package/dist/EditSurface-CF2io496.js +0 -705
  47. package/dist/ExplorerSplit-Cjvy0JHP.cjs +0 -1
  48. package/dist/MultiLayout-BjA0k-5n.cjs +0 -1
  49. package/dist/MultiLayout-D8F0BfxA.js +0 -947
  50. package/dist/NativeScrollBar-BFF12oEd.js +0 -59
  51. package/dist/NativeScrollBar-BUWXPvTV.cjs +0 -1
  52. package/dist/TreeLayout-CQUpgsxz.cjs +0 -1
  53. package/dist/TreeLayout-rhyVTfrI.js +0 -29
  54. package/dist/index-Dn7cYy-4.cjs +0 -13
  55. package/dist/index-v997iKxe.js +0 -3464
  56. package/dist/location-D6RE3wAN.cjs +0 -1
  57. package/dist/location-IRD9h42r.js +0 -444
  58. package/dist/storage-Dgi4JXaB.cjs +0 -1
@@ -0,0 +1,65 @@
1
+ import { jsx as p } from "react/jsx-runtime";
2
+ import { ScrollBar as m } from "@aiquants/virtualscroll";
3
+ import { useCallback as b, useMemo as S, useSyncExternalStore as h } from "react";
4
+ import { u as T } from "./index-h9e3p5Pd.js";
5
+ import { N as f } from "./scrollBarGeometry-DOBdGNV-.js";
6
+ import { T as d, N as v } from "./tapScrollCircle-u4EXeLhx.js";
7
+ const u = (e) => ({ scrollTop: e.scrollTop, scrollHeight: e.scrollHeight, clientHeight: e.clientHeight }), g = (e, t) => e.scrollTop === t.scrollTop && e.scrollHeight === t.scrollHeight && e.clientHeight === t.clientHeight, C = (e) => {
8
+ let t = u(e);
9
+ return {
10
+ getSnapshot: () => t,
11
+ subscribe: (s) => {
12
+ const r = () => {
13
+ const l = u(e);
14
+ g(t, l) || (t = l, s());
15
+ };
16
+ let n = 0;
17
+ const c = () => {
18
+ n === 0 && (n = requestAnimationFrame(() => {
19
+ n = 0, r();
20
+ }));
21
+ }, o = typeof ResizeObserver > "u" ? null : new ResizeObserver(c), i = () => {
22
+ if (o !== null) {
23
+ o.disconnect(), o.observe(e);
24
+ for (const l of e.children) o.observe(l);
25
+ }
26
+ };
27
+ i();
28
+ const a = typeof MutationObserver > "u" ? null : new MutationObserver(() => {
29
+ i(), c();
30
+ });
31
+ return a?.observe(e, { childList: !0 }), e.addEventListener("scroll", r, { passive: !0 }), r(), () => {
32
+ e.removeEventListener("scroll", r), a?.disconnect(), o?.disconnect(), cancelAnimationFrame(n);
33
+ };
34
+ }
35
+ };
36
+ }, H = (e) => {
37
+ const t = S(() => C(e), [e]);
38
+ return h(t.subscribe, t.getSnapshot, t.getSnapshot);
39
+ }, L = (e, t) => {
40
+ const s = typeof t == "function" ? t(e.scrollTop) : t;
41
+ return e.scrollTo({ top: s, behavior: "instant" }), e.scrollTop;
42
+ }, M = ({ scroller: e, withCircle: t }) => {
43
+ const { locale: s } = T(), { scrollTop: r, scrollHeight: n, clientHeight: c } = H(e), o = b((i) => L(e, i), [e]);
44
+ return /* @__PURE__ */ p(
45
+ m,
46
+ {
47
+ contentSize: n,
48
+ viewportSize: c,
49
+ scrollPosition: r,
50
+ onScroll: o,
51
+ scrollBarWidth: f,
52
+ enableThumbDrag: !0,
53
+ enableTrackClick: !0,
54
+ enableArrowButtons: !0,
55
+ enableArrowButtonTabStops: !1,
56
+ tapScrollCircleOptions: t ? d : v,
57
+ locale: s
58
+ }
59
+ );
60
+ };
61
+ export {
62
+ M as NativeScrollBar,
63
+ L as scrollScrollerTo,
64
+ H as useScrollerMetrics
65
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=require("react/jsx-runtime"),h=require("@aiquants/virtualscroll"),a=require("react"),v=require("./index-5gwNJ8CB.cjs"),g=require("./scrollBarGeometry-C46jBtmM.cjs"),S=require("./tapScrollCircle-C5DGI-0H.cjs"),p=e=>({scrollTop:e.scrollTop,scrollHeight:e.scrollHeight,clientHeight:e.clientHeight}),m=(e,t)=>e.scrollTop===t.scrollTop&&e.scrollHeight===t.scrollHeight&&e.clientHeight===t.clientHeight,f=e=>{let t=p(e);return{getSnapshot:()=>t,subscribe:s=>{const o=()=>{const i=p(e);m(t,i)||(t=i,s())};let n=0;const c=()=>{n===0&&(n=requestAnimationFrame(()=>{n=0,o()}))},r=typeof ResizeObserver>"u"?null:new ResizeObserver(c),l=()=>{if(r!==null){r.disconnect(),r.observe(e);for(const i of e.children)r.observe(i)}};l();const u=typeof MutationObserver>"u"?null:new MutationObserver(()=>{l(),c()});return u?.observe(e,{childList:!0}),e.addEventListener("scroll",o,{passive:!0}),o(),()=>{e.removeEventListener("scroll",o),u?.disconnect(),r?.disconnect(),cancelAnimationFrame(n)}}}},b=e=>{const t=a.useMemo(()=>f(e),[e]);return a.useSyncExternalStore(t.subscribe,t.getSnapshot,t.getSnapshot)},d=(e,t)=>{const s=typeof t=="function"?t(e.scrollTop):t;return e.scrollTo({top:s,behavior:"instant"}),e.scrollTop},C=({scroller:e,withCircle:t})=>{const{locale:s}=v.useExplorer(),{scrollTop:o,scrollHeight:n,clientHeight:c}=b(e),r=a.useCallback(l=>d(e,l),[e]);return T.jsx(h.ScrollBar,{contentSize:n,viewportSize:c,scrollPosition:o,onScroll:r,scrollBarWidth:g.NATIVE_SCROLL_BAR_WIDTH,enableThumbDrag:!0,enableTrackClick:!0,enableArrowButtons:!0,enableArrowButtonTabStops:!1,tapScrollCircleOptions:t?S.TAP_SCROLL_CIRCLE:S.NO_TAP_SCROLL_CIRCLE,locale:s})};exports.NativeScrollBar=C;exports.scrollScrollerTo=d;exports.useScrollerMetrics=b;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("react/jsx-runtime"),u=require("react"),T=require("react-router"),p=require("./location-D85EXiPt.cjs"),d=require("./index-5gwNJ8CB.cjs"),x=require("./ExplorerSplit-bpEvHrCo.cjs"),P=(t,e)=>t.claim!==e.claim||t.readme.status!==e.readme.status?!1:t.readme.status==="failed"&&e.readme.status==="failed"?t.readme.failure===e.readme.failure:t.readme.status==="ok"&&e.readme.status==="ok"?t.readme.readme===e.readme.readme:!0,F=(t,e,n)=>{let r=null;return()=>{const a=t.version(),c=t.read(e),o=c.status!=="pending";if(r!==null&&r.version===a&&r.tree===c&&r.settled===o)return r.state;const l=d.readFolderReadme(t,e,n),s=r!==null&&P(r.state,l)?r.state:l;return r={version:a,tree:c,settled:o,state:s},s}},_=(t,e,n)=>{let r=!0,a=null;const c=()=>{r&&n()},o=()=>{const s=t.read(e);s===a||s.status!=="pending"||(a=s,s.then(c,c))};o();const l=t.subscribe(()=>{o(),n()});return()=>{r=!1,l()}},j=()=>d.FOLDER_README_LOADING,q=(t,e)=>{const{trees:n}=d.useExplorer(),r=u.useMemo(()=>e===null?null:F(n,t,e),[n,t,e]),a=u.useCallback(f=>r===null?()=>{}:_(n,t,f),[r,n,t]),c=u.useCallback(()=>r===null?null:r(),[r]),o=u.useCallback(()=>r===null?null:j(),[r]),l=u.useSyncExternalStore(a,c,o),s=l?.claim===!0;return u.useEffect(()=>e===null?void 0:n.open(t),[n,t,e]),u.useEffect(()=>e===null||!s?void 0:n.claimChildren(t,new Map([[e,"direct"]])),[n,t,e,s]),l===null?null:l.readme},y=new Set,H=Object.freeze({kind:"loading"}),L=(t,e)=>e.status==="loading"?H:e.status==="failed"?{kind:"failure",folder:t,failure:e.failure,onRetry:e.retry}:{kind:"no-readme",folder:t},A=({location:t})=>{const{config:e}=d.useExplorer(),n=d.useExplorerNavigate(),{hash:r}=T.useLocation(),{source:a,doc:c,folder:o,overrides:l,markup:s}=t,[f,S]=u.useState(x.EMPTY_SELECTION),w=u.useMemo(()=>({gathered:f,onGatheredChange:S}),[f]),v=q(a,o),i=v===null?c:v.status==="ok"?v.readme:null,k=u.useMemo(()=>o===null||v===null?d.NO_DOCUMENT:L(o,v),[o,v]),h=u.useCallback(m=>n(p.explorerHref(e,{view:"tree",source:a,doc:m,overrides:l}),"browse"),[n,e,a,l]),O=u.useCallback(m=>n(p.explorerHref(e,{view:"tree",source:a,folder:m,overrides:l}),"browse"),[n,e,a,l]),g=u.useCallback(m=>n(p.explorerHref(e,{view:"tree",source:m,doc:c,folder:o,overrides:l,markup:s}),"switch-source"),[n,e,c,o,l,s]),C=u.useCallback(m=>n(`${p.explorerHref(e,{view:"tree",source:m,doc:c,folder:o,overrides:l,markup:s})}${r}`,"browse"),[n,e,c,o,l,s,r]),R=u.useCallback(m=>{const E=p.canonicalMultiDocuments(e,m);n(p.explorerHref(e,{view:"multi",source:a,docs:E,markup:s&&i!==null&&E.includes(i)?[i]:[]}),"switch-view")},[n,e,a,i,s]),M=u.useMemo(()=>({href:p.explorerHref(e,i===null?{view:"multi",source:a}:{view:"multi",source:a,docs:[i],markup:s?[i]:[]}),target:"multi"}),[e,a,i,s]),D=u.useMemo(()=>({kind:"page",view:"tree",overrides:l,embed:{}}),[l]),N=d.usePageMarkupToggle(t);return b.jsx(x.ExplorerSplit,{view:"tree",explorer:b.jsx(x.ExplorerPane,{mode:"tree",sourceId:a,currentPath:o===null?c:o,openPaths:y,onOpenDocument:h,onOpenFolder:O,currentFolder:o!==null,onSourceChange:g,onRevealSource:C,viewSwitch:M,tray:w,onOpenSelection:R}),content:b.jsxs("div",{className:"aqmx-document-column aqmx-tree-document",...d.CONTENT_PANE,children:[i===null?null:b.jsx(d.DocumentRefreshBar,{path:i,placement:d.PAGE_DOCUMENT_REFRESH,markup:N}),b.jsx(d.DocumentPane,{path:i,absence:k,markup:s,variant:D})]})})};exports.TreeLayout=A;
@@ -0,0 +1,72 @@
1
+ import { jsx as w, jsxs as _ } from "react/jsx-runtime";
2
+ import { useMemo as v, useCallback as m, useSyncExternalStore as C, useEffect as S, useState as M } from "react";
3
+ import { useLocation as A } from "react-router";
4
+ import { e as p, c as L } from "./location-G7psbmv_.js";
5
+ import { u as h, r as y, F as G, c as j, N as H, d as q, e as U, D as $, P as z, f as B } from "./index-h9e3p5Pd.js";
6
+ import { E as Y, a as J, b as K } from "./ExplorerSplit-8c93p1hy.js";
7
+ const Q = (t, e) => t.claim !== e.claim || t.readme.status !== e.readme.status ? !1 : t.readme.status === "failed" && e.readme.status === "failed" ? t.readme.failure === e.readme.failure : t.readme.status === "ok" && e.readme.status === "ok" ? t.readme.readme === e.readme.readme : !0, V = (t, e, n) => {
8
+ let r = null;
9
+ return () => {
10
+ const a = t.version(), l = t.read(e), o = l.status !== "pending";
11
+ if (r !== null && r.version === a && r.tree === l && r.settled === o) return r.state;
12
+ const u = y(t, e, n), s = r !== null && Q(r.state, u) ? r.state : u;
13
+ return r = { version: a, tree: l, settled: o, state: s }, s;
14
+ };
15
+ }, W = (t, e, n) => {
16
+ let r = !0, a = null;
17
+ const l = () => {
18
+ r && n();
19
+ }, o = () => {
20
+ const s = t.read(e);
21
+ s === a || s.status !== "pending" || (a = s, s.then(l, l));
22
+ };
23
+ o();
24
+ const u = t.subscribe(() => {
25
+ o(), n();
26
+ });
27
+ return () => {
28
+ r = !1, u();
29
+ };
30
+ }, X = () => G, Z = (t, e) => {
31
+ const { trees: n } = h(), r = v(() => e === null ? null : V(n, t, e), [n, t, e]), a = m((f) => r === null ? () => {
32
+ } : W(n, t, f), [r, n, t]), l = m(() => r === null ? null : r(), [r]), o = m(() => r === null ? null : X(), [r]), u = C(a, l, o), s = u?.claim === !0;
33
+ return S(() => e === null ? void 0 : n.open(t), [n, t, e]), S(() => e === null || !s ? void 0 : n.claimChildren(t, /* @__PURE__ */ new Map([[e, "direct"]])), [n, t, e, s]), u === null ? null : u.readme;
34
+ }, I = /* @__PURE__ */ new Set(), ee = Object.freeze({ kind: "loading" }), te = (t, e) => e.status === "loading" ? ee : e.status === "failed" ? { kind: "failure", folder: t, failure: e.failure, onRetry: e.retry } : { kind: "no-readme", folder: t }, le = ({ location: t }) => {
35
+ const { config: e } = h(), n = j(), { hash: r } = A(), { source: a, doc: l, folder: o, overrides: u, markup: s } = t, [f, b] = M(Y), O = v(() => ({ gathered: f, onGatheredChange: b }), [f]), d = Z(a, o), c = d === null ? l : d.status === "ok" ? d.readme : null, k = v(() => o === null || d === null ? H : te(o, d), [o, d]), g = m((i) => n(p(e, { view: "tree", source: a, doc: i, overrides: u }), "browse"), [n, e, a, u]), x = m((i) => n(p(e, { view: "tree", source: a, folder: i, overrides: u }), "browse"), [n, e, a, u]), D = m((i) => n(p(e, { view: "tree", source: i, doc: l, folder: o, overrides: u, markup: s }), "switch-source"), [n, e, l, o, u, s]), N = m((i) => n(`${p(e, { view: "tree", source: i, doc: l, folder: o, overrides: u, markup: s })}${r}`, "browse"), [n, e, l, o, u, s, r]), R = m(
36
+ (i) => {
37
+ const E = L(e, i);
38
+ n(p(e, { view: "multi", source: a, docs: E, markup: s && c !== null && E.includes(c) ? [c] : [] }), "switch-view");
39
+ },
40
+ [n, e, a, c, s]
41
+ ), F = v(() => ({ href: p(e, c === null ? { view: "multi", source: a } : { view: "multi", source: a, docs: [c], markup: s ? [c] : [] }), target: "multi" }), [e, a, c, s]), P = v(() => ({ kind: "page", view: "tree", overrides: u, embed: {} }), [u]), T = q(t);
42
+ return /* @__PURE__ */ w(
43
+ J,
44
+ {
45
+ view: "tree",
46
+ explorer: /* @__PURE__ */ w(
47
+ K,
48
+ {
49
+ mode: "tree",
50
+ sourceId: a,
51
+ currentPath: o === null ? l : o,
52
+ openPaths: I,
53
+ onOpenDocument: g,
54
+ onOpenFolder: x,
55
+ currentFolder: o !== null,
56
+ onSourceChange: D,
57
+ onRevealSource: N,
58
+ viewSwitch: F,
59
+ tray: O,
60
+ onOpenSelection: R
61
+ }
62
+ ),
63
+ content: /* @__PURE__ */ _("div", { className: "aqmx-document-column aqmx-tree-document", ...U, children: [
64
+ c === null ? null : /* @__PURE__ */ w($, { path: c, placement: z, markup: T }),
65
+ /* @__PURE__ */ w(B, { path: c, absence: k, markup: s, variant: P })
66
+ ] })
67
+ }
68
+ );
69
+ };
70
+ export {
71
+ le as TreeLayout
72
+ };
@@ -4,6 +4,7 @@ export declare const storageKeys: (namespace: string) => Readonly<{
4
4
  multiLayout: `${string}:multi-layout`;
5
5
  scope: `${string}:scope`;
6
6
  editPreview: `${string}:edit-preview`;
7
+ editSplit: `${string}:edit-split`;
7
8
  treeExpansion: (sourceId: string) => string;
8
9
  }>;
9
10
  export declare const readStorage: (key: string) => string | null;
@@ -4,6 +4,7 @@ export declare const storageKeys: (namespace: string) => Readonly<{
4
4
  multiLayout: `${string}:multi-layout`;
5
5
  scope: `${string}:scope`;
6
6
  editPreview: `${string}:edit-preview`;
7
+ editSplit: `${string}:edit-split`;
7
8
  treeExpansion: (sourceId: string) => string;
8
9
  }>;
9
10
  export declare const readStorage: (key: string) => string | null;
@@ -35,7 +35,10 @@ export declare const PANEL_MIN_BLOCK_RATIO: number;
35
35
  export declare const COLUMN_MIN_MEASURE = "40ch";
36
36
  export declare const explorerMinPixels: (rootFontPixels: number) => number;
37
37
  export declare const explorerSheetBelowPixels: (rootFontPixels: number) => number;
38
- export declare const EXPLORER_WIDTH_PERSIST_DELAY_MS = 233;
38
+ export declare const SPLIT_PERSIST_DELAY_MS = 233;
39
+ export declare const EDIT_SPLIT_DEFAULT_PERCENT = 50;
40
+ export declare const EDIT_SPLIT_MIN_PERCENT: number;
41
+ export declare const EDIT_SPLIT_MAX_PERCENT: number;
39
42
  export declare const PREFETCH_DWELL_MS: 89;
40
43
  export type ColumnPlanInput = {
41
44
  readonly trackInlineSize: number;
@@ -49,3 +52,19 @@ export declare const columnGroups: (logicalColumns: number, visibleColumns: numb
49
52
  start: number,
50
53
  end: number
51
54
  ]>;
55
+ export type EditSplitOrientation = "beside" | "stacked";
56
+ export declare const editSplitOrientation: (surfaceInlineSize: number, measure: number, handlePixels: number) => EditSplitOrientation;
57
+ export type ViewportBox = {
58
+ readonly left: number;
59
+ readonly top: number;
60
+ readonly right: number;
61
+ readonly bottom: number;
62
+ };
63
+ export type BoxSize = {
64
+ readonly width: number;
65
+ readonly height: number;
66
+ };
67
+ export declare const centeredDialogPosition: (anchor: ViewportBox, marginBox: BoxSize, viewport: BoxSize) => {
68
+ readonly left: number;
69
+ readonly top: number;
70
+ };
@@ -35,7 +35,10 @@ export declare const PANEL_MIN_BLOCK_RATIO: number;
35
35
  export declare const COLUMN_MIN_MEASURE = "40ch";
36
36
  export declare const explorerMinPixels: (rootFontPixels: number) => number;
37
37
  export declare const explorerSheetBelowPixels: (rootFontPixels: number) => number;
38
- export declare const EXPLORER_WIDTH_PERSIST_DELAY_MS = 233;
38
+ export declare const SPLIT_PERSIST_DELAY_MS = 233;
39
+ export declare const EDIT_SPLIT_DEFAULT_PERCENT = 50;
40
+ export declare const EDIT_SPLIT_MIN_PERCENT: number;
41
+ export declare const EDIT_SPLIT_MAX_PERCENT: number;
39
42
  export declare const PREFETCH_DWELL_MS: 89;
40
43
  export type ColumnPlanInput = {
41
44
  readonly trackInlineSize: number;
@@ -49,3 +52,19 @@ export declare const columnGroups: (logicalColumns: number, visibleColumns: numb
49
52
  start: number,
50
53
  end: number
51
54
  ]>;
55
+ export type EditSplitOrientation = "beside" | "stacked";
56
+ export declare const editSplitOrientation: (surfaceInlineSize: number, measure: number, handlePixels: number) => EditSplitOrientation;
57
+ export type ViewportBox = {
58
+ readonly left: number;
59
+ readonly top: number;
60
+ readonly right: number;
61
+ readonly bottom: number;
62
+ };
63
+ export type BoxSize = {
64
+ readonly width: number;
65
+ readonly height: number;
66
+ };
67
+ export declare const centeredDialogPosition: (anchor: ViewportBox, marginBox: BoxSize, viewport: BoxSize) => {
68
+ readonly left: number;
69
+ readonly top: number;
70
+ };
@@ -40,6 +40,7 @@ export type MarkdownExplorerLabels = {
40
40
  readonly editViewEditorTooltip: string;
41
41
  readonly editViewSplit: string;
42
42
  readonly editViewSplitTooltip: string;
43
+ readonly editViewSplitResize: string;
43
44
  readonly editViewPreview: string;
44
45
  readonly editViewPreviewTooltip: string;
45
46
  readonly historyOpen: string;
@@ -122,6 +123,10 @@ export type MarkdownExplorerLabels = {
122
123
  readonly folderPlacementMixed: string;
123
124
  readonly folderPlacementFirst: string;
124
125
  readonly folderPlacementLast: string;
126
+ readonly settingReadmePlacement: string;
127
+ readonly readmePlacementMixed: string;
128
+ readonly readmePlacementFirst: string;
129
+ readonly readmePlacementLast: string;
125
130
  readonly settingSelectionMode: string;
126
131
  readonly selectionSingle: string;
127
132
  readonly selectionMultiple: string;
@@ -143,6 +148,7 @@ export type MarkdownExplorerLabels = {
143
148
  readonly settingAnnouncement: (setting: string, value: string) => string;
144
149
  readonly documentRegion: string;
145
150
  readonly documentEmpty: string;
151
+ readonly folderReadmeMissing: (name: string) => string;
146
152
  readonly documentLoading: string;
147
153
  readonly markupLoading: string;
148
154
  readonly documentShown: (name: string) => string;
@@ -180,6 +186,7 @@ export type MarkdownExplorerLabels = {
180
186
  readonly copyTextFailed: string;
181
187
  readonly mediaUnsupported: string;
182
188
  readonly fileNotShown: string;
189
+ readonly pdfNotShown: string;
183
190
  readonly viewerLoading: string;
184
191
  readonly viewerErrorPrefix: string;
185
192
  readonly viewerStyleTitle: string;
@@ -200,15 +207,25 @@ export type MarkdownExplorerLabels = {
200
207
  readonly viewerAlignCenter: string;
201
208
  readonly viewerAlignRight: string;
202
209
  readonly viewerMermaidInteractionMode: string;
210
+ readonly viewerMermaidInteractionModeTouch: string;
203
211
  readonly viewerMermaidModeNone: string;
204
212
  readonly viewerMermaidModeZoom: string;
205
213
  readonly viewerMermaidModePan: string;
206
214
  readonly viewerMermaidModePanShift: string;
207
215
  readonly viewerMermaidModeBoth: string;
208
216
  readonly viewerMermaidModeBothShift: string;
217
+ readonly viewerMermaidModeNoneTouch: string;
218
+ readonly viewerMermaidModeZoomTouch: string;
219
+ readonly viewerMermaidModePanTouch: string;
220
+ readonly viewerMermaidModeBothTouch: string;
209
221
  readonly viewerMermaidZoomIn: string;
210
222
  readonly viewerMermaidZoomOut: string;
211
223
  readonly viewerMermaidResetView: string;
224
+ readonly viewerMermaidPanUp: string;
225
+ readonly viewerMermaidPanDown: string;
226
+ readonly viewerMermaidPanLeft: string;
227
+ readonly viewerMermaidPanRight: string;
228
+ readonly viewerMermaidDiagram: string;
212
229
  readonly viewerMermaidRetry: string;
213
230
  readonly viewerEmbeddedVideo: string;
214
231
  readonly viewerEmbeddedPost: string;
@@ -40,6 +40,7 @@ export type MarkdownExplorerLabels = {
40
40
  readonly editViewEditorTooltip: string;
41
41
  readonly editViewSplit: string;
42
42
  readonly editViewSplitTooltip: string;
43
+ readonly editViewSplitResize: string;
43
44
  readonly editViewPreview: string;
44
45
  readonly editViewPreviewTooltip: string;
45
46
  readonly historyOpen: string;
@@ -122,6 +123,10 @@ export type MarkdownExplorerLabels = {
122
123
  readonly folderPlacementMixed: string;
123
124
  readonly folderPlacementFirst: string;
124
125
  readonly folderPlacementLast: string;
126
+ readonly settingReadmePlacement: string;
127
+ readonly readmePlacementMixed: string;
128
+ readonly readmePlacementFirst: string;
129
+ readonly readmePlacementLast: string;
125
130
  readonly settingSelectionMode: string;
126
131
  readonly selectionSingle: string;
127
132
  readonly selectionMultiple: string;
@@ -143,6 +148,7 @@ export type MarkdownExplorerLabels = {
143
148
  readonly settingAnnouncement: (setting: string, value: string) => string;
144
149
  readonly documentRegion: string;
145
150
  readonly documentEmpty: string;
151
+ readonly folderReadmeMissing: (name: string) => string;
146
152
  readonly documentLoading: string;
147
153
  readonly markupLoading: string;
148
154
  readonly documentShown: (name: string) => string;
@@ -180,6 +186,7 @@ export type MarkdownExplorerLabels = {
180
186
  readonly copyTextFailed: string;
181
187
  readonly mediaUnsupported: string;
182
188
  readonly fileNotShown: string;
189
+ readonly pdfNotShown: string;
183
190
  readonly viewerLoading: string;
184
191
  readonly viewerErrorPrefix: string;
185
192
  readonly viewerStyleTitle: string;
@@ -200,15 +207,25 @@ export type MarkdownExplorerLabels = {
200
207
  readonly viewerAlignCenter: string;
201
208
  readonly viewerAlignRight: string;
202
209
  readonly viewerMermaidInteractionMode: string;
210
+ readonly viewerMermaidInteractionModeTouch: string;
203
211
  readonly viewerMermaidModeNone: string;
204
212
  readonly viewerMermaidModeZoom: string;
205
213
  readonly viewerMermaidModePan: string;
206
214
  readonly viewerMermaidModePanShift: string;
207
215
  readonly viewerMermaidModeBoth: string;
208
216
  readonly viewerMermaidModeBothShift: string;
217
+ readonly viewerMermaidModeNoneTouch: string;
218
+ readonly viewerMermaidModeZoomTouch: string;
219
+ readonly viewerMermaidModePanTouch: string;
220
+ readonly viewerMermaidModeBothTouch: string;
209
221
  readonly viewerMermaidZoomIn: string;
210
222
  readonly viewerMermaidZoomOut: string;
211
223
  readonly viewerMermaidResetView: string;
224
+ readonly viewerMermaidPanUp: string;
225
+ readonly viewerMermaidPanDown: string;
226
+ readonly viewerMermaidPanLeft: string;
227
+ readonly viewerMermaidPanRight: string;
228
+ readonly viewerMermaidDiagram: string;
212
229
  readonly viewerMermaidRetry: string;
213
230
  readonly viewerEmbeddedVideo: string;
214
231
  readonly viewerEmbeddedPost: string;
@@ -16,6 +16,7 @@ export type ExplorerLocation = {
16
16
  readonly view: "tree";
17
17
  readonly source: string;
18
18
  readonly doc: string | null;
19
+ readonly folder: string | null;
19
20
  readonly overrides: ExplorerOverrides;
20
21
  readonly markup: boolean;
21
22
  } | {
@@ -44,6 +45,7 @@ export type ExplorerHrefTarget = {
44
45
  readonly view: "tree";
45
46
  readonly source?: string;
46
47
  readonly doc?: string | null;
48
+ readonly folder?: string | null;
47
49
  readonly overrides?: ExplorerOverrides;
48
50
  readonly markup?: boolean;
49
51
  } | {
@@ -81,6 +83,7 @@ export declare const EXPLORER_QUERY: Readonly<{
81
83
  readonly maxWidth: "maxWidth";
82
84
  readonly markup: "markup";
83
85
  }>;
86
+ export declare const FOLDER_SEGMENT_MARK = "/";
84
87
  export declare const encodeDocumentSegment: (path: string) => string;
85
88
  export declare const decodeDocumentSegment: (segment: string) => string;
86
89
  export declare const canonicalMultiDocuments: (config: ExplorerConfig, docs: readonly string[]) => readonly string[];
@@ -16,6 +16,7 @@ export type ExplorerLocation = {
16
16
  readonly view: "tree";
17
17
  readonly source: string;
18
18
  readonly doc: string | null;
19
+ readonly folder: string | null;
19
20
  readonly overrides: ExplorerOverrides;
20
21
  readonly markup: boolean;
21
22
  } | {
@@ -44,6 +45,7 @@ export type ExplorerHrefTarget = {
44
45
  readonly view: "tree";
45
46
  readonly source?: string;
46
47
  readonly doc?: string | null;
48
+ readonly folder?: string | null;
47
49
  readonly overrides?: ExplorerOverrides;
48
50
  readonly markup?: boolean;
49
51
  } | {
@@ -81,6 +83,7 @@ export declare const EXPLORER_QUERY: Readonly<{
81
83
  readonly maxWidth: "maxWidth";
82
84
  readonly markup: "markup";
83
85
  }>;
86
+ export declare const FOLDER_SEGMENT_MARK = "/";
84
87
  export declare const encodeDocumentSegment: (path: string) => string;
85
88
  export declare const decodeDocumentSegment: (segment: string) => string;
86
89
  export declare const canonicalMultiDocuments: (config: ExplorerConfig, docs: readonly string[]) => readonly string[];
@@ -1,11 +1,13 @@
1
1
  import { MarkdownExplorerLabels } from "./labels.cjs";
2
2
  export type TreeSortMode = "native" | "asc" | "desc" | "oldest" | "newest";
3
3
  export type TreeFolderPlacement = "mixed" | "first" | "last";
4
+ export type TreeReadmePlacement = "mixed" | "first" | "last";
4
5
  export type TreeDoubleClickAction = "recursive" | "toggle";
5
6
  export type TreeSelectionMode = "single" | "multiple" | "none";
6
7
  export type TreeSettings = {
7
8
  readonly sortMode: TreeSortMode;
8
9
  readonly folderPlacement: TreeFolderPlacement;
10
+ readonly readmePlacement: TreeReadmePlacement;
9
11
  readonly selectionMode: TreeSelectionMode;
10
12
  readonly doubleClickAction: TreeDoubleClickAction;
11
13
  readonly expandIconSize: number;
@@ -47,5 +49,5 @@ export type SortableEntry = {
47
49
  readonly modifiedAt?: number;
48
50
  };
49
51
  export type EntryComparator = (left: SortableEntry, right: SortableEntry) => number;
50
- export declare const createEntryComparator: (settings: Pick<TreeSettings, "sortMode" | "folderPlacement">) => EntryComparator | undefined;
52
+ export declare const createEntryComparator: (settings: Pick<TreeSettings, "sortMode" | "folderPlacement" | "readmePlacement">) => EntryComparator | undefined;
51
53
  export {};
@@ -1,11 +1,13 @@
1
1
  import { MarkdownExplorerLabels } from "./labels.js";
2
2
  export type TreeSortMode = "native" | "asc" | "desc" | "oldest" | "newest";
3
3
  export type TreeFolderPlacement = "mixed" | "first" | "last";
4
+ export type TreeReadmePlacement = "mixed" | "first" | "last";
4
5
  export type TreeDoubleClickAction = "recursive" | "toggle";
5
6
  export type TreeSelectionMode = "single" | "multiple" | "none";
6
7
  export type TreeSettings = {
7
8
  readonly sortMode: TreeSortMode;
8
9
  readonly folderPlacement: TreeFolderPlacement;
10
+ readonly readmePlacement: TreeReadmePlacement;
9
11
  readonly selectionMode: TreeSelectionMode;
10
12
  readonly doubleClickAction: TreeDoubleClickAction;
11
13
  readonly expandIconSize: number;
@@ -47,5 +49,5 @@ export type SortableEntry = {
47
49
  readonly modifiedAt?: number;
48
50
  };
49
51
  export type EntryComparator = (left: SortableEntry, right: SortableEntry) => number;
50
- export declare const createEntryComparator: (settings: Pick<TreeSettings, "sortMode" | "folderPlacement">) => EntryComparator | undefined;
52
+ export declare const createEntryComparator: (settings: Pick<TreeSettings, "sortMode" | "folderPlacement" | "readmePlacement">) => EntryComparator | undefined;
51
53
  export {};