@aiquants/markdown-explorer 0.14.0 → 0.16.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 (60) hide show
  1. package/CHANGELOG.md +111 -0
  2. package/README.md +60 -12
  3. package/dist/EditSurface-CwKsTS11.cjs +2 -0
  4. package/dist/EditSurface-DGMLY7Gh.js +786 -0
  5. package/dist/ExplorerSplit-BLOaU5fE.cjs +1 -0
  6. package/dist/{ExplorerSplit-BPLECNpv.js → ExplorerSplit-tUCp0XdJ.js} +613 -592
  7. package/dist/MultiLayout-BBP2ajz8.cjs +1 -0
  8. package/dist/MultiLayout-DYy66vcO.js +963 -0
  9. package/dist/{NativeScrollBar-BUWXPvTV.cjs → NativeScrollBar-BkFg1EcW.cjs} +1 -1
  10. package/dist/{NativeScrollBar-BFF12oEd.js → NativeScrollBar-Dazd542j.js} +1 -1
  11. package/dist/TreeLayout-C8s5lBH_.cjs +1 -0
  12. package/dist/TreeLayout-CXX-rFO6.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 +7 -0
  18. package/dist/core/labels.d.ts +7 -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-DTKGgaok.js +3613 -0
  24. package/dist/index-DffJZ8-y.cjs +13 -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-BkFru0eg.js} +5 -5
  30. package/dist/{merge-BFk7nT59.cjs → merge-SRws1-Zj.cjs} +1 -1
  31. package/dist/server/ports.d.cts +8 -1
  32. package/dist/server/ports.d.ts +8 -1
  33. package/dist/server.cjs +1 -1
  34. package/dist/server.d.cts +1 -1
  35. package/dist/server.d.ts +1 -1
  36. package/dist/server.js +512 -499
  37. package/dist/{storage-BSthKLSG.js → storage-CmGHg7OA.js} +11 -10
  38. package/dist/storage-DM0EvkVf.cjs +1 -0
  39. package/dist/storage.cjs +1 -1
  40. package/dist/storage.js +1 -1
  41. package/dist/styles/markdown-explorer.css +1 -1
  42. package/dist/useSplitPersistence-B1b5Lg5E.js +42 -0
  43. package/dist/useSplitPersistence-DRjsPZdH.cjs +1 -0
  44. package/docs/behavior/dom-hooks.md +15 -10
  45. package/docs/behavior/layout.md +53 -14
  46. package/docs/behavior/localization.md +2 -1
  47. package/docs/behavior/url-contract.md +18 -6
  48. package/package.json +12 -10
  49. package/dist/EditSurface-BLlu5zEt.cjs +0 -2
  50. package/dist/EditSurface-CF2io496.js +0 -705
  51. package/dist/ExplorerSplit-Cjvy0JHP.cjs +0 -1
  52. package/dist/MultiLayout-BjA0k-5n.cjs +0 -1
  53. package/dist/MultiLayout-D8F0BfxA.js +0 -947
  54. package/dist/TreeLayout-CQUpgsxz.cjs +0 -1
  55. package/dist/TreeLayout-rhyVTfrI.js +0 -29
  56. package/dist/index-Dn7cYy-4.cjs +0 -13
  57. package/dist/index-v997iKxe.js +0 -3464
  58. package/dist/location-D6RE3wAN.cjs +0 -1
  59. package/dist/location-IRD9h42r.js +0 -444
  60. package/dist/storage-Dgi4JXaB.cjs +0 -1
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("react/jsx-runtime"),T=require("@aiquants/virtualscroll"),i=require("react"),d=require("./index-Dn7cYy-4.cjs"),h=require("./scrollBarGeometry-C46jBtmM.cjs"),u=require("./tapScrollCircle-C5DGI-0H.cjs"),a=e=>({scrollTop:e.scrollTop,scrollHeight:e.scrollHeight,clientHeight:e.clientHeight}),v=(e,t)=>e.scrollTop===t.scrollTop&&e.scrollHeight===t.scrollHeight&&e.clientHeight===t.clientHeight,g=e=>{let t=a(e);return{getSnapshot:()=>t,subscribe:s=>{const o=()=>{const n=a(e);v(t,n)||(t=n,s())},r=typeof ResizeObserver>"u"?null:new ResizeObserver(o),c=()=>{if(r!==null){r.disconnect(),r.observe(e);for(const n of e.children)r.observe(n)}};c();const l=typeof MutationObserver>"u"?null:new MutationObserver(()=>{c(),o()});return l?.observe(e,{childList:!0}),e.addEventListener("scroll",o,{passive:!0}),o(),()=>{e.removeEventListener("scroll",o),l?.disconnect(),r?.disconnect()}}}},S=e=>{const t=i.useMemo(()=>g(e),[e]);return i.useSyncExternalStore(t.subscribe,t.getSnapshot,t.getSnapshot)},p=(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}=d.useExplorer(),{scrollTop:o,scrollHeight:r,clientHeight:c}=S(e),l=i.useCallback(n=>p(e,n),[e]);return b.jsx(T.ScrollBar,{contentSize:r,viewportSize:c,scrollPosition:o,onScroll:l,scrollBarWidth:h.NATIVE_SCROLL_BAR_WIDTH,enableThumbDrag:!0,enableTrackClick:!0,enableArrowButtons:!0,enableArrowButtonTabStops:!1,tapScrollCircleOptions:t?u.TAP_SCROLL_CIRCLE:u.NO_TAP_SCROLL_CIRCLE,locale:s})};exports.NativeScrollBar=C;exports.scrollScrollerTo=p;exports.useScrollerMetrics=S;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("react/jsx-runtime"),T=require("@aiquants/virtualscroll"),i=require("react"),d=require("./index-DffJZ8-y.cjs"),h=require("./scrollBarGeometry-C46jBtmM.cjs"),u=require("./tapScrollCircle-C5DGI-0H.cjs"),a=e=>({scrollTop:e.scrollTop,scrollHeight:e.scrollHeight,clientHeight:e.clientHeight}),v=(e,t)=>e.scrollTop===t.scrollTop&&e.scrollHeight===t.scrollHeight&&e.clientHeight===t.clientHeight,g=e=>{let t=a(e);return{getSnapshot:()=>t,subscribe:s=>{const o=()=>{const n=a(e);v(t,n)||(t=n,s())},r=typeof ResizeObserver>"u"?null:new ResizeObserver(o),c=()=>{if(r!==null){r.disconnect(),r.observe(e);for(const n of e.children)r.observe(n)}};c();const l=typeof MutationObserver>"u"?null:new MutationObserver(()=>{c(),o()});return l?.observe(e,{childList:!0}),e.addEventListener("scroll",o,{passive:!0}),o(),()=>{e.removeEventListener("scroll",o),l?.disconnect(),r?.disconnect()}}}},S=e=>{const t=i.useMemo(()=>g(e),[e]);return i.useSyncExternalStore(t.subscribe,t.getSnapshot,t.getSnapshot)},p=(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}=d.useExplorer(),{scrollTop:o,scrollHeight:r,clientHeight:c}=S(e),l=i.useCallback(n=>p(e,n),[e]);return b.jsx(T.ScrollBar,{contentSize:r,viewportSize:c,scrollPosition:o,onScroll:l,scrollBarWidth:h.NATIVE_SCROLL_BAR_WIDTH,enableThumbDrag:!0,enableTrackClick:!0,enableArrowButtons:!0,enableArrowButtonTabStops:!1,tapScrollCircleOptions:t?u.TAP_SCROLL_CIRCLE:u.NO_TAP_SCROLL_CIRCLE,locale:s})};exports.NativeScrollBar=C;exports.scrollScrollerTo=p;exports.useScrollerMetrics=S;
@@ -1,7 +1,7 @@
1
1
  import { jsx as a } from "react/jsx-runtime";
2
2
  import { ScrollBar as u } from "@aiquants/virtualscroll";
3
3
  import { useCallback as p, useMemo as b, useSyncExternalStore as S } from "react";
4
- import { u as h } from "./index-v997iKxe.js";
4
+ import { u as h } from "./index-DTKGgaok.js";
5
5
  import { N as m } from "./scrollBarGeometry-DOBdGNV-.js";
6
6
  import { T, N as d } from "./tapScrollCircle-u4EXeLhx.js";
7
7
  const l = (e) => ({ scrollTop: e.scrollTop, scrollHeight: e.scrollHeight, clientHeight: e.clientHeight }), f = (e, t) => e.scrollTop === t.scrollTop && e.scrollHeight === t.scrollHeight && e.clientHeight === t.clientHeight, v = (e) => {
@@ -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-DffJZ8-y.cjs"),x=require("./ExplorerSplit-BLOaU5fE.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-DTKGgaok.js";
6
+ import { E as Y, a as J, b as K } from "./ExplorerSplit-tUCp0XdJ.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;
@@ -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;
@@ -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 {};