@aiquants/markdown-explorer 0.29.1 → 0.30.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 CHANGED
@@ -1,5 +1,29 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.30.0 (2026-10-29) — A fragment's target stays at its scroller's start while the document settles, on @aiquants/markdown 11.8.2 and @aiquants/spreadsheet 0.18.1
4
+
5
+ ### Breaking
6
+
7
+ - **The peers `@aiquants/markdown` and `@aiquants/spreadsheet` are `^11.8.2` and `^0.18.1` (hosts).** The explorer is
8
+ documented and tested on a document table's 24 px tap-scroll circle, which markdown 11.8.2 draws (0.29.1's README and
9
+ end-to-end check already expected it); markdown 11.8.1 also draws a plain table with the grid's scroll bars and rows
10
+ before the grid loads, and spreadsheet 0.18.1 ends a range's frame where the range does under a frozen row and in a
11
+ right-to-left page. None of them changes a default the explorer opts out of. A host updates the three packages
12
+ together.
13
+
14
+ ### Fixed
15
+
16
+ - **A fragment's target stays where the jump put it while what is laid out before it settles (readers).** The jump
17
+ aligned the target to its scroller's start once. Web fonts, images, math and diagrams that arrive afterwards change
18
+ the heights before it, and CSS scroll anchoring then held another node (the block peeking into the target's scroll
19
+ margin) instead: in the multi view the stage's keeping of the panel took anchoring's adjustment for a scroll of
20
+ someone else's and stopped, so a heading could stay a few pixels off its place (3.47 px once KaTeX's fonts had
21
+ loaded); the tree and single views kept nothing at all. Every view now keeps the target at the start
22
+ (`keepInView`, shared by the multi view's panels and the page views): it is aligned again whenever it or anything
23
+ laid out before it changes size, with scroll anchoring off in the scroll containers around it meanwhile
24
+ (`overflow-anchor: none`, inline, counted per element and restored when the last keeping ends), until the reader's
25
+ next key, press, wheel or touch, until a scroll the alignment did not make, or until the next jump.
26
+
3
27
  ## 0.29.1 (2026-10-28) — A document table's tap-scroll circle at WCAG 2.5.8's minimum target
4
28
 
5
29
  ### Documentation
package/README.md CHANGED
@@ -49,14 +49,14 @@ A single-view (embedding) page never downloads the tree and multi-panel views, w
49
49
 
50
50
  - React 19.2.7 or later and React Router 8 in framework mode (route modules with `loader` / `headers`).
51
51
  - Node.js 22.22 or later (the floor React Router 8 declares). The package ships ES modules and CommonJS; the CommonJS entries load the ESM-only `react-router` through `require(esm)`.
52
- - The peer packages, at these versions or later within the caret ranges the package declares: `@aiquants/markdown` ^11.8.0 (document rendering;
52
+ - The peer packages, at these versions or later within the caret ranges the package declares: `@aiquants/markdown` ^11.8.2 (document rendering;
53
53
  the gutter its scroll container keeps beside the explorer's bar for the tap-scroll circle (`scrollBarGutter`); the Source toggle of a storage SVG image that stands alone in a paragraph, read through `imageSource`, and a Copy that copies the image as a PNG image or its source, the source readable in every display style, a notice in place of a block that cannot render and plain text for a fence in a language it does not know; its components' stylesheet without utilities,
54
54
  its controls' 44 px targets under every pointer, ```spreadsheets tables — inside list items and quotes too, and in a pane of their own (`layout="fill"`) never fewer than three rows, with the display options `toolbar=`, `zoom=`, `headings=`, `autofit=`, `frame=` and `tapscroll=` (the circle in the look the explorer passes as `spreadsheetTapScrollCircle`, or `tapScrollCircle` on a table file's block),
55
55
  every row shown when `height` reaches the table's, and boxes no wider than the table — and their write-back through an editor that answers what came of each write (written, changed, a line that would close the fence, unwritable), reads a block's body back and tells them of its other changes,
56
56
  the React-free `@aiquants/markdown/code-blocks` that names the `data-code-meta` the sanitizer keeps on `code`, holds the converter's reading of a fenced block's lines and the table labels with their placeholders,
57
57
  its Mermaid labels and drawings that finish inside the document when a diagram's text changes or it unmounts mid-drawing, its math diagnostics, gantt sizing, embeds, link cards and their sizes, the React-free `@aiquants/markdown/embeds` the sanitizer worker loads and `@aiquants/markdown/source-lines` the editor and the sanitizer read, and the Node-only link-card handler of `@aiquants/markdown/server`, which needs Node.js 22.13 or later — below the explorer's own floor),
58
58
  `@aiquants/directory-tree` ^5.0.1 (rows that take paint and text styles only and have no vertical padding, a `removeRootIndent` shift that keeps the root's icon whole, and reveals of rows under the scroll bar's buttons),
59
- `@aiquants/drag-drop-panels` ^0.12.0 (the panel headers' move menu, named by the explorer's `panelMove`, their 44 px buttons under every pointer and the header arrangement the behavior docs follow), `@aiquants/resize-panels` ^2.2.0 (the source of each layout change, by which the tree pane's width is saved), `@aiquants/spreadsheet` ^0.18.0 (the grid of those tables — one `role="grid"` with header rows, the content size a box is fitted to, a keyboard move the document follows and a frame around a range,
59
+ `@aiquants/drag-drop-panels` ^0.12.0 (the panel headers' move menu, named by the explorer's `panelMove`, their 44 px buttons under every pointer and the header arrangement the behavior docs follow), `@aiquants/resize-panels` ^2.2.0 (the source of each layout change, by which the tree pane's width is saved), `@aiquants/spreadsheet` ^0.18.1 (the grid of those tables — one `role="grid"` with header rows, the content size a box is fitted to, a keyboard move the document follows and a frame around a range that ends where the range does, under a frozen row and in a right-to-left page too,
60
60
  read-only where it cannot write and named by its block — which markdown loads only for a document that holds one, and the grid of a table file's preview, whose TSV grammar (`@aiquants/spreadsheet/tsv`) reads a TSV file — `iterateTsvPrefixRows` the rows of a file read partway — and whose operation budget (`SPREADSHEET_MAX_OPERATION_CELLS` of `@aiquants/spreadsheet/view`) bounds its table) and `@aiquants/virtualscroll` ^3.22.1 (44 px scroll-to-edge pills and tap-scroll circles, the pills' text at the body step).
61
61
  The client depends on these floors, while a package manager may only warn about an older peer.
62
62
  - A Markdown parser of your choice on the server that produces HTML and its headings (the explorer sanitizes the HTML before it is sent).
@@ -727,7 +727,7 @@ Spread it into the configuration when your application has no sign-in: it provid
727
727
  Link to what survives sanitizing: a heading's id — with `@aiquants/markdown` 6 or later as your converter, GitHub's automatic ids (`#概要`, `#api-の使い方`, `#snake_case-名`, `#重複-1` for a second `重複`) and ids written as `{#id}` —, an `<a name="…">` anchor in raw HTML, or an id in the `user-content-` namespace (see [The viewer's allow list](docs/behavior/security.md#the-viewers-allow-list)). DOMPurify drops an `id` or `name` equal to a property of the document or of a form (`title`, `images`, …), except a heading's id.
728
728
  A canonical redirect keeps the fragment on a page load (the browser carries it across the loader's HTTP redirect) and on the explorer's own client-side replace (it appends the fragment), so loading `/docs#%E6%A6%82%E8%A6%81` ends on the tree view's URL with the same fragment.
729
729
  A client-side navigation from another of your routes to a non-canonical URL loses its fragment, because React Router builds the redirected location from the loader's `Location` alone: link to the canonical URL that `explorerHref` writes, with the fragment appended. A multi-view URL ignores the hash: a panel's fragment-only link scrolls the panel instead.
730
- - In a page view the explorer brings a fragment's element to the start of the pane's own scroller and moves every scroller around it only as far as needed (see [The document region](docs/behavior/layout.md#the-document-region)). Two scrolls it does not own can do more:
730
+ - In a page view the explorer brings a fragment's element to the start of the pane's own scroller, moves every scroller around it only as far as needed and keeps the element there while what is laid out before it settles (see [The document region](docs/behavior/layout.md#the-document-region)). Two scrolls it does not own can do more:
731
731
  React Router's `<ScrollRestoration>` scrolls the element whose id is the URL's hash into view itself — page-wide, aligned to the start of every scroller, the page and your own scroll containers included — on a router navigation that carries a hash to a location it has saved no window offset for (a new history entry: it keys the offsets it saves by the location's key, or by your `getKey`), whenever that element is already in the page (a link to a section of the shown document, or an entry of the document viewer's table of contents, which the explorer follows as such a link).
732
732
  On Back or Forward to an entry it saved an offset for, it restores the window's offset instead, as it does for every entry the browser made itself (a fragment-only link) once it has left one, since React Router gives all of those the key `default`. The browser scrolls to the element itself for a fragment-only link and for the hash of a page it loads, and for a link to `#top` or `#` that names no element it scrolls the page itself to its top (HTML's top of the document is the viewport's).
733
733
  They move nothing while the explorer fills a container that does not scroll (with `lockDocumentScroll`, for example); in a page that scrolls around a page view, leave `<ScrollRestoration>` off the explorer's routes if your scrollers must not move.
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const q=require("react/jsx-runtime"),h=require("react"),y=require("./index-CnX313Ss.cjs"),J=require("@aiquants/markdown/code-blocks"),K=require("@codemirror/commands"),pe=require("@codemirror/lang-markdown"),oe=require("@codemirror/language"),ge=require("@codemirror/search"),$=require("@codemirror/state"),P=require("@codemirror/view"),V=require("@lezer/highlight"),je=require("@aiquants/markdown"),ue=require("@aiquants/markdown/source-lines"),ee=require("./dataRoute-DwYtgyt6.cjs"),de=require("./sanitizePolicy-T5T-3vV5.cjs"),ze=require("isomorphic-dompurify"),se=require("@aiquants/resize-panels"),X=require("./location-l_HysaZR.cjs"),ve=require("./useSplitPersistence-9Nu6J1WF.cjs"),qe={history:K.historyField},Fe=oe.HighlightStyle.define([{tag:[V.tags.heading1,V.tags.heading2,V.tags.heading3,V.tags.heading4,V.tags.heading5,V.tags.heading6,V.tags.heading],color:"var(--aqmx-syntax-heading)",fontWeight:"700"},{tag:V.tags.strong,fontWeight:"700"},{tag:V.tags.emphasis,fontStyle:"italic"},{tag:V.tags.strikethrough,textDecoration:"line-through"},{tag:V.tags.link,color:"var(--aqmx-syntax-link)",textDecoration:"underline"},{tag:V.tags.url,color:"var(--aqmx-syntax-url)"},{tag:V.tags.monospace,color:"var(--aqmx-syntax-code)"},{tag:V.tags.quote,color:"var(--aqmx-syntax-quote)"},{tag:[V.tags.processingInstruction,V.tags.contentSeparator,V.tags.labelName,V.tags.meta],color:"var(--aqmx-syntax-mark)"}]),Ue=P.EditorView.theme({"&":{height:"100%",color:"var(--aqmx-text)",backgroundColor:"var(--aqmx-surface)",fontSize:"var(--aqmx-font-size-title)"},"&.cm-focused":{outline:"none"},".cm-scroller":{fontFamily:'ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace',lineHeight:"var(--aqmx-line-height-prose)"},".cm-content":{caretColor:"var(--aqmx-text)",paddingBlock:"var(--aqmx-space-6)"},".cm-line":{paddingInline:"var(--aqmx-space-6)"},"&.cm-focused .cm-cursor":{borderLeftColor:"var(--aqmx-text)"},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:"var(--aqmx-editor-selection)"},".cm-activeLine":{backgroundColor:"var(--aqmx-editor-active-line)"},".cm-gutters":{backgroundColor:"var(--aqmx-surface-raised)",color:"var(--aqmx-editor-gutter)",borderInlineEnd:"var(--aqmx-space-1) solid var(--aqmx-border)"},".cm-activeLineGutter":{backgroundColor:"var(--aqmx-editor-active-line)"},".cm-searchMatch":{outline:"var(--aqmx-space-1) solid var(--aqmx-border-strong)"},".cm-panels":{backgroundColor:"var(--aqmx-surface-raised)",color:"var(--aqmx-text)"}}),Me="data-aqmx-conflict-actions",Ge=P.Decoration.line({attributes:{"data-aqmx-conflict-line":"marker"}}),We=P.Decoration.line({attributes:{"data-aqmx-conflict-line":"ours"}}),Xe=P.Decoration.line({attributes:{"data-aqmx-conflict-line":"theirs"}});class $e extends P.WidgetType{constructor(t,n){super(),this.index=t,this.labels=n}index;labels;eq(t){return t.index===this.index&&t.labels===this.labels}toDOM(t){const n=document.createElement("div");n.setAttribute(Me,String(this.index));for(const[r,i]of[["ours",this.labels.useOurs],["theirs",this.labels.useTheirs],["both",this.labels.keepBoth]]){const o=document.createElement("button");o.type="button",o.textContent=i,o.setAttribute("data-aqmx-conflict-choice",r),o.addEventListener("mousedown",l=>l.preventDefault()),o.addEventListener("click",()=>{const l=re(t.state.doc)[this.index];l!==void 0&&(_e(t,l,r),t.focus())}),n.append(o)}return n}ignoreEvent(){return!0}}const re=e=>y.findConflictsInLines(e.iterLines()),we=(e,t)=>{const n=new $.RangeSetBuilder;return re(e).forEach((r,i)=>{const o=e.line(r.start);n.add(o.from,o.from,P.Decoration.widget({widget:new $e(i,t),block:!0,side:-1}));for(let l=r.start;l<=r.end;l+=1){const s=e.line(l).from,d=l===r.start||l===r.separator||l===r.end?Ge:l<r.separator?We:Xe;n.add(s,s,d)}}),n.finish()},Ke=e=>$.StateField.define({create:t=>we(t.doc,e),update:(t,n)=>n.docChanged?we(n.state.doc,e):t,provide:t=>P.EditorView.decorations.from(t)}),_e=(e,t,n)=>{const{doc:r}=e.state,i=(k,c)=>{const E=[];for(let u=k;u<=c;u+=1)E.push(r.line(u).text);return E},o=i(t.start+1,t.separator-1),l=i(t.separator+1,t.end-1),s=n==="ours"?o:n==="theirs"?l:[...o,...l];let d=r.line(t.start).from,f=r.line(t.end).to;s.length===0&&(t.end<r.lines?f+=1:t.start>1&&(d-=1));const p=s.join(`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const q=require("react/jsx-runtime"),h=require("react"),y=require("./index-DgaTEKsI.cjs"),J=require("@aiquants/markdown/code-blocks"),K=require("@codemirror/commands"),pe=require("@codemirror/lang-markdown"),oe=require("@codemirror/language"),ge=require("@codemirror/search"),$=require("@codemirror/state"),P=require("@codemirror/view"),V=require("@lezer/highlight"),je=require("@aiquants/markdown"),ue=require("@aiquants/markdown/source-lines"),ee=require("./dataRoute-DwYtgyt6.cjs"),de=require("./sanitizePolicy-T5T-3vV5.cjs"),ze=require("isomorphic-dompurify"),se=require("@aiquants/resize-panels"),X=require("./location-l_HysaZR.cjs"),ve=require("./useSplitPersistence-9Nu6J1WF.cjs"),qe={history:K.historyField},Fe=oe.HighlightStyle.define([{tag:[V.tags.heading1,V.tags.heading2,V.tags.heading3,V.tags.heading4,V.tags.heading5,V.tags.heading6,V.tags.heading],color:"var(--aqmx-syntax-heading)",fontWeight:"700"},{tag:V.tags.strong,fontWeight:"700"},{tag:V.tags.emphasis,fontStyle:"italic"},{tag:V.tags.strikethrough,textDecoration:"line-through"},{tag:V.tags.link,color:"var(--aqmx-syntax-link)",textDecoration:"underline"},{tag:V.tags.url,color:"var(--aqmx-syntax-url)"},{tag:V.tags.monospace,color:"var(--aqmx-syntax-code)"},{tag:V.tags.quote,color:"var(--aqmx-syntax-quote)"},{tag:[V.tags.processingInstruction,V.tags.contentSeparator,V.tags.labelName,V.tags.meta],color:"var(--aqmx-syntax-mark)"}]),Ue=P.EditorView.theme({"&":{height:"100%",color:"var(--aqmx-text)",backgroundColor:"var(--aqmx-surface)",fontSize:"var(--aqmx-font-size-title)"},"&.cm-focused":{outline:"none"},".cm-scroller":{fontFamily:'ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace',lineHeight:"var(--aqmx-line-height-prose)"},".cm-content":{caretColor:"var(--aqmx-text)",paddingBlock:"var(--aqmx-space-6)"},".cm-line":{paddingInline:"var(--aqmx-space-6)"},"&.cm-focused .cm-cursor":{borderLeftColor:"var(--aqmx-text)"},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:"var(--aqmx-editor-selection)"},".cm-activeLine":{backgroundColor:"var(--aqmx-editor-active-line)"},".cm-gutters":{backgroundColor:"var(--aqmx-surface-raised)",color:"var(--aqmx-editor-gutter)",borderInlineEnd:"var(--aqmx-space-1) solid var(--aqmx-border)"},".cm-activeLineGutter":{backgroundColor:"var(--aqmx-editor-active-line)"},".cm-searchMatch":{outline:"var(--aqmx-space-1) solid var(--aqmx-border-strong)"},".cm-panels":{backgroundColor:"var(--aqmx-surface-raised)",color:"var(--aqmx-text)"}}),Me="data-aqmx-conflict-actions",Ge=P.Decoration.line({attributes:{"data-aqmx-conflict-line":"marker"}}),We=P.Decoration.line({attributes:{"data-aqmx-conflict-line":"ours"}}),Xe=P.Decoration.line({attributes:{"data-aqmx-conflict-line":"theirs"}});class $e extends P.WidgetType{constructor(t,n){super(),this.index=t,this.labels=n}index;labels;eq(t){return t.index===this.index&&t.labels===this.labels}toDOM(t){const n=document.createElement("div");n.setAttribute(Me,String(this.index));for(const[r,i]of[["ours",this.labels.useOurs],["theirs",this.labels.useTheirs],["both",this.labels.keepBoth]]){const o=document.createElement("button");o.type="button",o.textContent=i,o.setAttribute("data-aqmx-conflict-choice",r),o.addEventListener("mousedown",l=>l.preventDefault()),o.addEventListener("click",()=>{const l=re(t.state.doc)[this.index];l!==void 0&&(_e(t,l,r),t.focus())}),n.append(o)}return n}ignoreEvent(){return!0}}const re=e=>y.findConflictsInLines(e.iterLines()),we=(e,t)=>{const n=new $.RangeSetBuilder;return re(e).forEach((r,i)=>{const o=e.line(r.start);n.add(o.from,o.from,P.Decoration.widget({widget:new $e(i,t),block:!0,side:-1}));for(let l=r.start;l<=r.end;l+=1){const s=e.line(l).from,d=l===r.start||l===r.separator||l===r.end?Ge:l<r.separator?We:Xe;n.add(s,s,d)}}),n.finish()},Ke=e=>$.StateField.define({create:t=>we(t.doc,e),update:(t,n)=>n.docChanged?we(n.state.doc,e):t,provide:t=>P.EditorView.decorations.from(t)}),_e=(e,t,n)=>{const{doc:r}=e.state,i=(k,c)=>{const E=[];for(let u=k;u<=c;u+=1)E.push(r.line(u).text);return E},o=i(t.start+1,t.separator-1),l=i(t.separator+1,t.end-1),s=n==="ours"?o:n==="theirs"?l:[...o,...l];let d=r.line(t.start).from,f=r.line(t.end).to;s.length===0&&(t.end<r.lines?f+=1:t.start>1&&(d-=1));const p=s.join(`
2
2
  `);e.dispatch({changes:{from:d,to:f,insert:p},selection:$.EditorSelection.cursor(d),scrollIntoView:!0,userEvent:"input.resolve"})},Ee="input.preview",Ye=20,Je=P.ViewPlugin.fromClass(class{constructor(e){this.view=e,this.schedule()}view;cancel=null;update(e){e.docChanged&&this.schedule()}schedule(){if(this.cancel!==null||oe.syntaxTreeAvailable(this.view.state))return;const e=this.view.dom.ownerDocument.defaultView;if(e===null)return;const t=()=>{this.cancel=null,oe.ensureSyntaxTree(this.view.state,this.view.state.doc.length,Ye),this.schedule()};if(typeof e.requestIdleCallback=="function"){const n=e.requestIdleCallback(t);this.cancel=()=>e.cancelIdleCallback(n)}else{const n=e.setTimeout(t,0);this.cancel=()=>e.clearTimeout(n)}}destroy(){this.cancel?.(),this.cancel=null}}),Qe=/`{3,}|~{3,}/u,te=Object.freeze({kind:"absent"}),ce=Object.freeze({kind:"unreadable"}),Ze=(e,t,n)=>{const r=[];for(let d=t.parent;d!==null;d=d.parent)(d.name==="Blockquote"||d.name==="ListItem")&&r.unshift(d);const i=[],o=[],l=d=>{const f=o.indexOf(d);return f===-1?o.length:f};for(const d of r){const f=e.lineAt(d.from).number;if(d.name==="ListItem"){const p=J.listItemWidthOn(e.line(f).text,i,l(f));if(p===null)return null;i.push({kind:"listItem",width:p})}else i.push({kind:"quote"});o.push(f)}const s=J.openingFenceOn(n.text,i,l(n.number));return s===null?null:{containers:i,...s}},et=(e,t)=>{const{doc:n}=e;let r=n.lineAt(t).to;for(;;){const i=oe.ensureSyntaxTree(e,r,Number.POSITIVE_INFINITY);if(i===null)return null;const o=i.resolveInner(t,1),l=o.parent;if(o.name!=="CodeMark"||l===null||l.name!=="FencedCode"||l.from!==o.from)return null;if(l.to<r||r>=n.length)return l;r=Math.min(n.length,l.to+Math.max(l.to-t,1))}},be=(e,t)=>{const{doc:n}=e;if(!Number.isInteger(t)||t<1||t>n.lines)return te;const r=n.line(t),i=Qe.exec(r.text);if(i===null)return te;const o=et(e,r.from+i.index);if(o===null)return te;const l=o.getChild("CodeInfo");if(l===null)return te;const s=J.fencedCodeLanguageOf(n.sliceString(l.from,l.to));if(s===null)return ce;if(s!==J.SPREADSHEETS_LANGUAGE)return te;const d=Ze(n,o,r);if(d===null)return ce;const[,...f]=o.getChildren("CodeMark"),p=f.at(-1),k=p===void 0?n.lineAt(o.to).number:n.lineAt(p.from).number-1,c=[];let E="";for(let u=t+1;u<=k;u+=1){const m=n.line(u).text,v=J.readFencedLine(m,d);if(v===null)return ce;c.push(m),E+=u<n.lines?`${v.content}
3
3
  `:v.content}return{kind:"found",firstLine:t+1,lines:c,layout:d,body:E}},tt=({parent:e,scroll:t,text:n,saved:r,labels:i,revisions:o,onChange:l,onGeometry:s,onSave:d})=>{let f=!1;const p=[P.EditorView.scrollHandler.of((u,m,v)=>(nt(u,m.head,v,t),!0)),P.lineNumbers(),P.highlightActiveLineGutter(),K.history(),P.drawSelection(),P.highlightActiveLine(),ge.highlightSelectionMatches(),P.EditorView.lineWrapping,pe.markdown({base:pe.markdownLanguage}),Je,oe.syntaxHighlighting(Fe),Ke(i),P.keymap.of([{key:"Mod-s",preventDefault:!0,run:()=>(d(),!0)},...ge.searchKeymap,...K.historyKeymap,...K.defaultKeymap]),P.EditorView.contentAttributes.of({"aria-label":i.editor,"aria-multiline":"true"}),P.EditorView.updateListener.of(u=>{for(const m of u.transactions)m.docChanged&&o.record(m.changes,m.newDoc);u.docChanged&&l(u.transactions.every(m=>!m.docChanged||m.isUserEvent(Ee))),(u.docChanged||u.heightChanged||u.geometryChanged)&&s(u.docChanged&&!f)}),Ue],k=st(r,p)??$.EditorState.create({doc:n,extensions:p}),c=new P.EditorView({state:k,parent:e});o.mount(c.state.doc);const E=u=>{f=!0;try{u()}finally{f=!1}};return{text:()=>c.state.doc.toString(),replaceText:u=>{const m=c.state.doc.toString();if(m===u)return;let v=0;const S=Math.min(m.length,u.length);for(;v<S&&m.charCodeAt(v)===u.charCodeAt(v);)v+=1;let g=0;for(;g<S-v&&m.charCodeAt(m.length-1-g)===u.charCodeAt(u.length-1-g);)g+=1;c.dispatch({changes:{from:v,to:m.length-g,insert:u.slice(v,u.length-g)},userEvent:"input.replace"})},replaceBody:(u,m,v,S)=>{const{doc:g}=c.state,L=o.lineOf(S,u);if(L===null)return"changed";const O=be(c.state,L);if(O.kind==="absent")return"changed";if(O.kind==="unreadable")return"unwritable";if(O.body!==J.fencedBodyAsRead(m,O.layout))return"changed";const I=J.planFencedBodyEdit(O.lines,O.layout,v);if(I.kind!=="edit")return I.kind;if(I.from===I.to&&I.lines.length===0)return"written";const D=j=>{const H=O.firstLine+j;return H<=g.lines?g.line(H).from:g.length},M=D(I.from),B=`${M===g.length&&g.sliceString(g.length-1)!==`
4
4
  `?`
@@ -1,6 +1,6 @@
1
1
  import { jsx as R, jsxs as le } from "react/jsx-runtime";
2
2
  import { useState as te, useRef as D, useLayoutEffect as B, useEffectEvent as ve, useEffect as Pe, useImperativeHandle as je, useMemo as J, startTransition as Ye, useCallback as X, useId as Je } from "react";
3
- import { v as ne, j as me, k as Qe, u as se, l as Ze, m as et, n as tt, o as De, p as nt, q as rt, s as ot, t as it, E as lt, w as st, x as ct, y as at, z as we, A as be, B as ut, G as Ee, H as dt, I as ft, J as mt, K as pt } from "./index-awodBw8r.js";
3
+ import { v as ne, j as me, k as Qe, u as se, l as Ze, m as et, n as tt, o as De, p as nt, q as rt, s as ot, t as it, E as lt, w as st, x as ct, y as at, z as we, A as be, B as ut, G as Ee, H as dt, I as ft, J as mt, K as pt } from "./index-auQVKY4M.js";
4
4
  import { fencedBodyAsRead as ht, planFencedBodyEdit as gt, fencedCodeLanguageOf as vt, SPREADSHEETS_LANGUAGE as wt, readFencedLine as bt, listItemWidthOn as Et, openingFenceOn as xt } from "@aiquants/markdown/code-blocks";
5
5
  import { history as St, historyKeymap as yt, defaultKeymap as kt, historyField as Tt, redo as At, undo as It, isolateHistory as Lt } from "@codemirror/commands";
6
6
  import { markdown as Ct, markdownLanguage as Ot } from "@codemirror/lang-markdown";
@@ -1,12 +1,12 @@
1
1
  import { jsx as m, jsxs as L, Fragment as Qe } from "react/jsx-runtime";
2
- import { u as $, t as At, V as Pe, R as Je, W as kt, G as Oe, X as Lt, Y as Pt, o as Ot, Z as qt, _ as Ct, $ as Ft } from "./index-awodBw8r.js";
2
+ import { u as $, t as At, Z as Pe, R as Je, _ as kt, G as Oe, $ as Lt, a0 as Pt, o as Ot, a1 as qt, a2 as Ct, a3 as Ft } from "./index-auQVKY4M.js";
3
3
  import * as f from "react";
4
4
  import { use as ye, createContext as qe, useState as F, useCallback as w, useMemo as C, useRef as E, useLayoutEffect as H, useEffect as D, useSyncExternalStore as Ce, Suspense as et, useId as Re } from "react";
5
5
  import { s as Mt, u as _t, v as tt, x as It, y as Dt, z as Ht, C as $t, F as Zt, A as Ve, B as Bt, D as zt, b as Ee, G as Vt } from "./location-CKuabtKl.js";
6
6
  import { useDirectoryTreeState as jt, DirectoryTree as Kt } from "@aiquants/directory-tree";
7
- import { TAP_SCROLL_CIRCLE as Gt } from "./tapScrollCircle-DYmzWI-8.js";
8
- import { s as Wt } from "./storage-CmGHg7OA.js";
9
- import { PanelGroup as Xt, Panel as je, PanelResizeHandle as Ut } from "@aiquants/resize-panels";
7
+ import { TAP_SCROLL_CIRCLE as Gt } from "./tapScrollCircle-DYQ8P2ag.js";
8
+ import { s as Ut } from "./storage-CmGHg7OA.js";
9
+ import { PanelGroup as Wt, Panel as je, PanelResizeHandle as Xt } from "@aiquants/resize-panels";
10
10
  import { a as Yt, u as Qt } from "./useSplitPersistence-Bf4M35Il.js";
11
11
  import { useLocation as Jt } from "react-router";
12
12
  function en({
@@ -310,8 +310,8 @@ const un = /* @__PURE__ */ f.forwardRef(dn), Fe = qe(!0), nt = "\0loop\0", rt =
310
310
  o((p) => p.state === "running" && p.opened === i ? p : { state: "running", opened: i });
311
311
  }, []);
312
312
  return C(() => ({ status: r, start: c, end: l, advance: a }), [r, c, l, a]);
313
- }, Ge = ["pointerdown", "wheel", "touchstart", "keydown", "focusin"], Pn = 8, We = { least: Number.POSITIVE_INFINITY, stalled: 0 }, On = ({ tree: e, container: t, path: n, chain: r, rows: o, cancel: c, displayed: l, placement: a }) => {
314
- const s = E(null), d = E(!0), u = E(We), i = E(null), p = E(null), h = E(r), g = E(a);
313
+ }, Ge = ["pointerdown", "wheel", "touchstart", "keydown", "focusin"], Pn = 8, Ue = { least: Number.POSITIVE_INFINITY, stalled: 0 }, On = ({ tree: e, container: t, path: n, chain: r, rows: o, cancel: c, displayed: l, placement: a }) => {
314
+ const s = E(null), d = E(!0), u = E(Ue), i = E(null), p = E(null), h = E(r), g = E(a);
315
315
  H(() => {
316
316
  h.current = r, g.current = a;
317
317
  }, [r, a]);
@@ -345,7 +345,7 @@ const un = /* @__PURE__ */ f.forwardRef(dn), Fe = qe(!0), nt = "\0loop\0", rt =
345
345
  b.phase === "opening" && h.current?.progress(b.folders, A) !== "loading" && P();
346
346
  }));
347
347
  }, [e, t, v, P]), q = w(() => {
348
- d.current = !1, u.current = We, k();
348
+ d.current = !1, u.current = Ue, k();
349
349
  }, [k]);
350
350
  D(() => {
351
351
  const R = t.current;
@@ -426,10 +426,10 @@ const un = /* @__PURE__ */ f.forwardRef(dn), Fe = qe(!0), nt = "\0loop\0", rt =
426
426
  tapScrollCircleOptions: Gt
427
427
  },
428
428
  behaviorOptions: { enablePointerDrag: !0 }
429
- }, Bn = { hoverClassName: "", directorySelectedClassName: "", itemSelectedClassName: "" }, zn = { color: "inherit", fontSize: "inherit" }, Vn = { fontSize: "inherit" }, jn = /* @__PURE__ */ new Set(), Kn = /* @__PURE__ */ new Map(), Gn = { color: "var(--aqmx-tree-line)" }, Wn = (e) => {
429
+ }, Bn = { hoverClassName: "", directorySelectedClassName: "", itemSelectedClassName: "" }, zn = { color: "inherit", fontSize: "inherit" }, Vn = { fontSize: "inherit" }, jn = /* @__PURE__ */ new Set(), Kn = /* @__PURE__ */ new Map(), Gn = { color: "var(--aqmx-tree-line)" }, Un = (e) => {
430
430
  const t = e instanceof Element ? e.closest(`[${ce}]`) : null;
431
431
  return t === null || t.getAttribute("data-entry-type") !== "file" ? null : t.getAttribute(ce);
432
- }, ct = (e, t, n, r) => n === "folder-limit" ? e.expandAllFolderLimit(r, t.maxFolders, e.expandAll) : e.expandAllDepthLimit(r, t.maxDepth), Xn = (e, t, n) => n.kind === "done" ? e.expandAllDone(n.opened, n.failed, n.complete) : ct(e, t, n.kind, n.opened), it = () => {
432
+ }, ct = (e, t, n, r) => n === "folder-limit" ? e.expandAllFolderLimit(r, t.maxFolders, e.expandAll) : e.expandAllDepthLimit(r, t.maxDepth), Wn = (e, t, n) => n.kind === "done" ? e.expandAllDone(n.opened, n.failed, n.complete) : ct(e, t, n.kind, n.opened), it = () => {
433
433
  const { labels: e } = $();
434
434
  return /* @__PURE__ */ L("div", { className: "aqmx-explorer-loading", "aria-busy": "true", "data-testid": "markdown-explorer-tree-loading", children: [
435
435
  /* @__PURE__ */ m("p", { className: "aqmx-explorer-loading-text", children: e.treeLoading }),
@@ -441,7 +441,7 @@ const un = /* @__PURE__ */ f.forwardRef(dn), Fe = qe(!0), nt = "\0loop\0", rt =
441
441
  /* @__PURE__ */ m("span", {})
442
442
  ] })
443
443
  ] });
444
- }, Un = () => {
444
+ }, Xn = () => {
445
445
  const { labels: e } = $();
446
446
  return /* @__PURE__ */ L("div", { className: "aqmx-empty", "data-testid": "markdown-explorer-tree-empty", children: [
447
447
  /* @__PURE__ */ m(un, { className: "aqmx-explorer-empty-icon", "aria-hidden": "true" }),
@@ -494,9 +494,9 @@ const un = /* @__PURE__ */ f.forwardRef(dn), Fe = qe(!0), nt = "\0loop\0", rt =
494
494
  expandAll: v,
495
495
  revealCancel: P
496
496
  }) => {
497
- const { trees: k, documents: q, labels: y, locale: Z, theme: N, data: R, config: A, sources: S, reveals: b } = $(), _ = ye(Fe), [B] = F(wn), ie = E(null), { rowHeight: re, lineColor: K } = Dn(ie, N), { isExpanded: G, toggle: ae, expandMultiple: z, collapseMultiple: Q, expanded: J, isPending: ee } = i, { alwaysExpanded: M, sortMode: le, folderPlacement: de, readmePlacement: he } = o, { direct: oe, markDirect: W, unmarkDirect: te, pruneDirect: we } = h, { running: ue, advance: me } = v, xe = E(null), se = E(null), X = C(() => _t({ sortMode: le, folderPlacement: de, readmePlacement: he }), [le, de, he]), O = C(() => gn(X), [X]), I = w((x) => k.children(r, x), [k, r]), V = C(() => bn(e), [e]), ne = w((x) => !pe(x) && (G(x) || M && !V.has(x)), [G, M, V]), U = E({ shownExpanded: ne, isExpanded: G, unloadedFolders: V, entries: e, childrenOf: I });
497
+ const { trees: k, documents: q, labels: y, locale: Z, theme: N, data: R, config: A, sources: S, reveals: b } = $(), _ = ye(Fe), [B] = F(wn), ie = E(null), { rowHeight: re, lineColor: K } = Dn(ie, N), { isExpanded: G, toggle: ae, expandMultiple: z, collapseMultiple: Q, expanded: J, isPending: ee } = i, { alwaysExpanded: M, sortMode: le, folderPlacement: de, readmePlacement: he } = o, { direct: oe, markDirect: U, unmarkDirect: te, pruneDirect: we } = h, { running: ue, advance: me } = v, xe = E(null), se = E(null), W = C(() => _t({ sortMode: le, folderPlacement: de, readmePlacement: he }), [le, de, he]), O = C(() => gn(W), [W]), I = w((x) => k.children(r, x), [k, r]), V = C(() => bn(e), [e]), ne = w((x) => !pe(x) && (G(x) || M && !V.has(x)), [G, M, V]), X = E({ shownExpanded: ne, isExpanded: G, unloadedFolders: V, entries: e, childrenOf: I });
498
498
  H(() => {
499
- U.current = { shownExpanded: ne, isExpanded: G, unloadedFolders: V, entries: e, childrenOf: I };
499
+ X.current = { shownExpanded: ne, isExpanded: G, unloadedFolders: V, entries: e, childrenOf: I };
500
500
  }, [ne, G, V, e, I]);
501
501
  const Ie = w((x) => {
502
502
  xe.current?.scrollToPath(x, { align: "nearest" }), requestAnimationFrame(() => {
@@ -509,9 +509,9 @@ const un = /* @__PURE__ */ f.forwardRef(dn), Fe = qe(!0), nt = "\0loop\0", rt =
509
509
  Ie(pn(x));
510
510
  return;
511
511
  }
512
- U.current.isExpanded(x) ? te([x]) : U.current.unloadedFolders.has(x) && W(x), ae(x);
512
+ X.current.isExpanded(x) ? te([x]) : X.current.unloadedFolders.has(x) && U(x), ae(x);
513
513
  },
514
- [Ie, W, te, ae]
514
+ [Ie, U, te, ae]
515
515
  ), Se = w(
516
516
  (x) => {
517
517
  const T = x.filter((j) => !pe(j));
@@ -521,7 +521,7 @@ const un = /* @__PURE__ */ f.forwardRef(dn), Fe = qe(!0), nt = "\0loop\0", rt =
521
521
  ), xt = w(
522
522
  (x) => {
523
523
  const T = x.filter((j) => !pe(j));
524
- T.length !== 0 && (T.length < x.length && T.every((j) => U.current.shownExpanded(j)) ? Se(T) : z(T));
524
+ T.length !== 0 && (T.length < x.length && T.every((j) => X.current.shownExpanded(j)) ? Se(T) : z(T));
525
525
  },
526
526
  [z, Se]
527
527
  ), De = w(
@@ -530,14 +530,14 @@ const un = /* @__PURE__ */ f.forwardRef(dn), Fe = qe(!0), nt = "\0loop\0", rt =
530
530
  {
531
531
  name: x.name,
532
532
  onRetry: () => {
533
- W(x.path), k.retryChildren(r, x.path), U.current.shownExpanded(x.path) || z([x.path]);
533
+ U(x.path), k.retryChildren(r, x.path), X.current.shownExpanded(x.path) || z([x.path]);
534
534
  }
535
535
  }
536
536
  ),
537
- [k, r, W, z]
538
- ), He = n === "multi" ? l : jn, { loopFolderName: $e } = y, wt = C(() => B(e, { openPaths: He, childrenOf: I, renderFailedFolder: De, loopFolderName: $e }), [B, e, He, I, De, $e, t]), gt = kt(q, Wn), Ze = E([]), ge = w(() => {
539
- for (const x of Ze.current) U.current.unloadedFolders.has(x) && W(x);
540
- }, [W]), { maxDepth: Te } = A.revealDocument, Be = E(u);
537
+ [k, r, U, z]
538
+ ), He = n === "multi" ? l : jn, { loopFolderName: $e } = y, wt = C(() => B(e, { openPaths: He, childrenOf: I, renderFailedFolder: De, loopFolderName: $e }), [B, e, He, I, De, $e, t]), gt = kt(q, Un), Ze = E([]), ge = w(() => {
539
+ for (const x of Ze.current) X.current.unloadedFolders.has(x) && U(x);
540
+ }, [U]), { maxDepth: Te } = A.revealDocument, Be = E(u);
541
541
  H(() => {
542
542
  Be.current = u;
543
543
  }, [u]);
@@ -556,19 +556,19 @@ const un = /* @__PURE__ */ f.forwardRef(dn), Fe = qe(!0), nt = "\0loop\0", rt =
556
556
  open: (x) => {
557
557
  Ze.current = x ?? [], x !== null && (ge(), z([...x]));
558
558
  },
559
- progress: (x, T) => En(U.current.entries, x, T, { isShownExpanded: U.current.shownExpanded, childrenOf: U.current.childrenOf })
559
+ progress: (x, T) => En(X.current.entries, x, T, { isShownExpanded: X.current.shownExpanded, childrenOf: X.current.childrenOf })
560
560
  }),
561
561
  [R, r, S, b, Te, ge, z]
562
562
  );
563
563
  D(() => ge(), [ge, V]);
564
564
  const bt = C(() => [e, t, J], [e, t, J]), Et = w((x) => se.current === null ? Number.POSITIVE_INFINITY : $n(se.current, x), []);
565
565
  On({ tree: xe, container: se, path: c.path, chain: c.openFolders ? vt : null, rows: bt, cancel: P, displayed: _, placement: Et });
566
- const ze = w((x) => oe.has(x), [oe]), ve = C(() => vn(e, { isShownExpanded: ne, childrenOf: I, compare: X, isDirect: ze }), [e, ne, I, X, ze, t]), be = _ && g;
566
+ const ze = w((x) => oe.has(x), [oe]), ve = C(() => vn(e, { isShownExpanded: ne, childrenOf: I, compare: W, isDirect: ze }), [e, ne, I, W, ze, t]), be = _ && g;
567
567
  H(() => {
568
568
  p(e);
569
569
  }, [e, p]), H(() => () => p(null), [p]), D(() => k.claimChildren(r, be ? ve.folders : Kn), [k, r, be, ve]), D(() => we(V), [we, V]), D(() => {
570
- be && ue && me({ entries: e, isShownExpanded: ne, childrenOf: I, compare: X, expanded: J, waiting: ve.waiting, expansionPending: ee });
571
- }, [be, ue, me, e, ne, I, X, J, ve, ee]);
570
+ be && ue && me({ entries: e, isShownExpanded: ne, childrenOf: I, compare: W, expanded: J, waiting: ve.waiting, expansionPending: ee });
571
+ }, [be, ue, me, e, ne, I, W, J, ve, ee]);
572
572
  const yt = w(
573
573
  (x) => {
574
574
  const T = x.entry.absolutePath;
@@ -660,7 +660,7 @@ const un = /* @__PURE__ */ f.forwardRef(dn), Fe = qe(!0), nt = "\0loop\0", rt =
660
660
  return /* @__PURE__ */ m("p", { className: "aqmx-explorer-expand-all-stop", "data-testid": "markdown-explorer-expand-all-stop", "data-aqmx-stop": e, children: ct(r, n, e, t) });
661
661
  }, tr = ({ entries: e, ...t }) => {
662
662
  const { trees: n } = $(), r = Ce(n.subscribe, n.version, n.version), { sourceId: o } = t, [c] = F(mn), l = C(() => c(e, (a) => n.children(o, a)), [c, e, n, o, r]);
663
- return l.length === 0 ? /* @__PURE__ */ m(Un, {}) : /* @__PURE__ */ m(Qn, { entries: l, version: r, ...t });
663
+ return l.length === 0 ? /* @__PURE__ */ m(Xn, {}) : /* @__PURE__ */ m(Qn, { entries: l, version: r, ...t });
664
664
  }, nr = ({ result: e, onRetry: t, ...n }) => {
665
665
  const { renderTreeFailure: r } = $(), o = ye(e);
666
666
  if (o.status === "deferred") return /* @__PURE__ */ m(it, {});
@@ -668,7 +668,7 @@ const un = /* @__PURE__ */ f.forwardRef(dn), Fe = qe(!0), nt = "\0loop\0", rt =
668
668
  const c = r?.(o.failure);
669
669
  return /* @__PURE__ */ m("div", { className: "aqmx-explorer-tree-message", "data-testid": "markdown-explorer-tree-failure", "data-aqmx-failure": o.failure.reason, children: c !== void 0 ? c : /* @__PURE__ */ m(At, { failure: o.failure, alert: !0, onRetry: t, testId: null }) });
670
670
  }, rr = ({ onControls: e, ...t }) => {
671
- const { trees: n, storageNamespace: r, labels: o, announcer: c, config: l } = $(), { sourceId: a } = t, s = jt({ storageKey: Wt(r).treeExpansion(a) });
671
+ const { trees: n, storageNamespace: r, labels: o, announcer: c, config: l } = $(), { sourceId: a } = t, s = jt({ storageKey: Ut(r).treeExpansion(a) });
672
672
  Ce(n.subscribe, n.version, n.version);
673
673
  const d = n.read(a), u = w(() => n.retry(a), [n, a]);
674
674
  H(() => n.open(a), [n, a]);
@@ -676,7 +676,7 @@ const un = /* @__PURE__ */ f.forwardRef(dn), Fe = qe(!0), nt = "\0loop\0", rt =
676
676
  H(() => {
677
677
  q.current = p;
678
678
  }, [p]);
679
- const y = l.expandAll, Z = w(() => c.announce(o.expandAllStarted), [c, o]), N = w((M) => c.announce(Xn(o, y, M)), [c, o, y]), R = Ln({ budget: y, expandMultiple: h, onStart: Z, onFinish: N }), { status: A, start: S, end: b, advance: _ } = R, B = A.state === "running", ie = C(() => ({ running: B, advance: _ }), [B, _]), re = E(null), [K, G] = F(!1), ae = w((M) => {
679
+ const y = l.expandAll, Z = w(() => c.announce(o.expandAllStarted), [c, o]), N = w((M) => c.announce(Wn(o, y, M)), [c, o, y]), R = Ln({ budget: y, expandMultiple: h, onStart: Z, onFinish: N }), { status: A, start: S, end: b, advance: _ } = R, B = A.state === "running", ie = C(() => ({ running: B, advance: _ }), [B, _]), re = E(null), [K, G] = F(!1), ae = w((M) => {
680
680
  re.current = M, G(M !== null);
681
681
  }, []);
682
682
  D(
@@ -722,10 +722,10 @@ function ar({
722
722
  clipRule: "evenodd"
723
723
  }));
724
724
  }
725
- const dt = /* @__PURE__ */ f.forwardRef(ar), Xe = "markdown-explorer-selection-remove", lr = ({ selection: e, onRemove: t, onClear: n, onOpenSelection: r, onLeave: o }) => {
725
+ const dt = /* @__PURE__ */ f.forwardRef(ar), We = "markdown-explorer-selection-remove", lr = ({ selection: e, onRemove: t, onClear: n, onOpenSelection: r, onLeave: o }) => {
726
726
  const { labels: c } = $(), l = Re(), a = E(null), s = [...e], d = (i, p) => {
727
727
  if (p.ownerDocument.activeElement === p) {
728
- const h = a.current === null ? [] : [...a.current.querySelectorAll(`[data-testid="${Xe}"]`)], g = h.indexOf(p), v = [h[g + 1], h[g - 1]].find((P) => P !== void 0);
728
+ const h = a.current === null ? [] : [...a.current.querySelectorAll(`[data-testid="${We}"]`)], g = h.indexOf(p), v = [h[g + 1], h[g - 1]].find((P) => P !== void 0);
729
729
  v === void 0 ? o() : v.focus();
730
730
  }
731
731
  t(i);
@@ -747,7 +747,7 @@ const dt = /* @__PURE__ */ f.forwardRef(ar), Xe = "markdown-explorer-selection-r
747
747
  className: "aqmx-icon-button aqmx-explorer-tray-remove",
748
748
  "aria-label": c.removeFromSelection(p),
749
749
  title: c.removeFromSelection(p),
750
- "data-testid": Xe,
750
+ "data-testid": We,
751
751
  "data-aqmx-path": i,
752
752
  onClick: (h) => d(i, h.currentTarget),
753
753
  children: /* @__PURE__ */ m(dt, { "aria-hidden": "true" })
@@ -1183,7 +1183,7 @@ const Fr = /* @__PURE__ */ f.forwardRef(Cr), Mr = Object.freeze({
1183
1183
  }, Dr = () => {
1184
1184
  const { treeSettings: e } = $();
1185
1185
  return { settings: Ce(e.subscribe, e.getSnapshot, e.getServerSnapshot), advance: e.advance };
1186
- }, Ue = /* @__PURE__ */ new Set(), Hr = '[role="tree"] [role="treeitem"][tabindex="0"]', $r = "[data-directory-tree-tab-stop]", ca = (e) => {
1186
+ }, Xe = /* @__PURE__ */ new Set(), Hr = '[role="tree"] [role="treeitem"][tabindex="0"]', $r = "[data-directory-tree-tab-stop]", ca = (e) => {
1187
1187
  const { mode: t, sourceId: n, currentPath: r, openPaths: o, onOpenDocument: c, onSourceChange: l, onRevealSource: a, viewSwitch: s } = e, { labels: d, sources: u, trees: i, documents: p, announcer: h, reveals: g } = $(), { settings: v, advance: P } = Dr(), k = C(() => It(t === "tree"), [t]), q = t === "tree" && v.selectionMode === "multiple";
1188
1188
  cr(q);
1189
1189
  const y = e.mode === "tree" ? e.tray.onGatheredChange : null, Z = e.mode === "tree" ? e.onOpenSelection : void 0, N = e.mode === "tree" ? e.onOpenFolder : null, R = e.mode === "tree" && e.currentFolder, A = C(() => N === null ? null : { current: r, open: N }, [N, r]), S = e.mode === "tree" && q ? e.tray.gathered : ke, b = w(
@@ -1196,7 +1196,7 @@ const Fr = /* @__PURE__ */ f.forwardRef(Cr), Mr = Object.freeze({
1196
1196
  const O = K.current;
1197
1197
  if (O === null) return;
1198
1198
  [Hr, $r, '[data-testid="markdown-explorer-tree-settings"]'].map((V) => O.querySelector(V)).find((V) => V !== null)?.focus();
1199
- }, []), ae = C(() => new Set(S.keys()), [S]), z = C(() => r === null ? Ue : /* @__PURE__ */ new Set([r]), [r]), Q = C(() => {
1199
+ }, []), ae = C(() => new Set(S.keys()), [S]), z = C(() => r === null ? Xe : /* @__PURE__ */ new Set([r]), [r]), Q = C(() => {
1200
1200
  if (t === "multi") return { mode: "multiple", items: o, shownPath: null, onChange: null };
1201
1201
  switch (v.selectionMode) {
1202
1202
  case "single":
@@ -1204,30 +1204,30 @@ const Fr = /* @__PURE__ */ f.forwardRef(Cr), Mr = Object.freeze({
1204
1204
  case "multiple":
1205
1205
  return { mode: "multiple", items: ae, shownPath: r, onChange: B };
1206
1206
  case "none":
1207
- return { mode: "none", items: Ue, shownPath: null, onChange: null };
1207
+ return { mode: "none", items: Xe, shownPath: null, onChange: null };
1208
1208
  }
1209
1209
  }, [t, o, v.selectionMode, z, r, ae, B]), J = C(() => v.revealDocument ? { path: r, openFolders: !R } : { path: Q.shownPath, openFolders: !1 }, [v.revealDocument, r, R, Q.shownPath]), ee = w(
1210
1210
  (O) => {
1211
1211
  r !== null && g.settle(r), l(O);
1212
1212
  },
1213
1213
  [r, g, l]
1214
- ), [M, le] = F(null), [de, he] = F(!1), [oe, W] = F(null), te = E(!1), we = w(async () => {
1214
+ ), [M, le] = F(null), [de, he] = F(!1), [oe, U] = F(null), te = E(!1), we = w(async () => {
1215
1215
  if (!te.current) {
1216
- te.current = !0, he(!0), W(null);
1216
+ te.current = !0, he(!0), U(null);
1217
1217
  try {
1218
1218
  const O = await i.refresh(n);
1219
1219
  if (O.status === "superseded") return;
1220
- p.invalidate(), O.status === "failed" ? W({ sourceId: n, failure: O.failure }) : h.announce(d.treeRefreshed);
1220
+ p.invalidate(), O.status === "failed" ? U({ sourceId: n, failure: O.failure }) : h.announce(d.treeRefreshed);
1221
1221
  } finally {
1222
1222
  te.current = !1, he(!1);
1223
1223
  }
1224
1224
  }
1225
- }, [i, p, n, h, d]), ue = M === null ? null : M.expandAll, me = M?.expanding === !0, xe = u.find((O) => O.id === n), se = s.target === "multi" ? sn : ln, X = s.target === "multi" ? d.switchToMulti : d.switchToTree;
1225
+ }, [i, p, n, h, d]), ue = M === null ? null : M.expandAll, me = M?.expanding === !0, xe = u.find((O) => O.id === n), se = s.target === "multi" ? sn : ln, W = s.target === "multi" ? d.switchToMulti : d.switchToTree;
1226
1226
  return /* @__PURE__ */ L("nav", { ref: K, "aria-label": d.explorerRegion, className: "aqmx-explorer", "data-testid": "markdown-explorer-explorer", "data-aqmx-mode": t, children: [
1227
1227
  /* @__PURE__ */ L("div", { className: "aqmx-explorer-header", children: [
1228
1228
  u.length > 1 ? /* @__PURE__ */ m("select", { className: "aqmx-explorer-source", "aria-label": d.sourceLabel, title: xe?.label, value: n, onChange: (O) => ee(O.currentTarget.value), "data-testid": "markdown-explorer-source-select", children: u.map((O) => /* @__PURE__ */ m("option", { value: O.id, children: O.label }, O.id)) }) : null,
1229
1229
  /* @__PURE__ */ L("div", { className: "aqmx-explorer-actions", children: [
1230
- /* @__PURE__ */ m(Pt, { to: s.href, navigation: "switch-view", className: "aqmx-icon-button", "aria-label": X, title: X, "data-testid": "markdown-explorer-view-switch", "data-aqmx-target": s.target, children: /* @__PURE__ */ m(se, { "aria-hidden": "true" }) }),
1230
+ /* @__PURE__ */ m(Pt, { to: s.href, navigation: "switch-view", className: "aqmx-icon-button", "aria-label": W, title: W, "data-testid": "markdown-explorer-view-switch", "data-aqmx-target": s.target, children: /* @__PURE__ */ m(se, { "aria-hidden": "true" }) }),
1231
1231
  /* @__PURE__ */ L(
1232
1232
  "button",
1233
1233
  {
@@ -1330,13 +1330,13 @@ const Br = /* @__PURE__ */ f.forwardRef(Zr), zr = ({ explorer: e, toggleRef: t,
1330
1330
  /* @__PURE__ */ m(Ct, { holds: s, testId: "markdown-explorer-sheet-announcer" })
1331
1331
  ] }) })
1332
1332
  ] });
1333
- }, Vr = qe(null), Me = "aqmx-explorer", ft = "aqmx-content", jr = "--aqmx-split-band", _e = '[role="tree"] [role="treeitem"]', Kr = `${_e}[tabindex="0"]`, Gr = "[data-directory-tree-tab-stop]", Wr = (e, t) => {
1333
+ }, Vr = qe(null), Me = "aqmx-explorer", ft = "aqmx-content", jr = "--aqmx-split-band", _e = '[role="tree"] [role="treeitem"]', Kr = `${_e}[tabindex="0"]`, Gr = "[data-directory-tree-tab-stop]", Ur = (e, t) => {
1334
1334
  for (const n of e.querySelectorAll(`[data-panel-id="${Me}"] ${_e}`)) if (n.getAttribute(ce) === t) return n;
1335
1335
  return null;
1336
1336
  }, Ye = (e, t) => ({
1337
1337
  inlineSize: e > 0 ? e : null,
1338
1338
  rootFontPixels: t > 0 ? t : Vt
1339
- }), Xr = (e, t) => {
1339
+ }), Wr = (e, t) => {
1340
1340
  const [n, r] = F(() => Ye(0, 0));
1341
1341
  return H(() => {
1342
1342
  const o = e.current, c = t.current;
@@ -1355,7 +1355,7 @@ const Br = /* @__PURE__ */ f.forwardRef(Zr), zr = ({ explorer: e, toggleRef: t,
1355
1355
  });
1356
1356
  return s.observe(o), s.observe(c), () => s.disconnect();
1357
1357
  }, [e, t]), n;
1358
- }, pt = (e) => `aqmx-split-handle-${e}`, Ur = (e, { frameRef: t, sheetToggleRef: n, handleId: r }) => {
1358
+ }, pt = (e) => `aqmx-split-handle-${e}`, Xr = (e, { frameRef: t, sheetToggleRef: n, handleId: r }) => {
1359
1359
  const o = E(!1), c = E(null), l = E(!1);
1360
1360
  H(() => {
1361
1361
  const s = t.current;
@@ -1397,7 +1397,7 @@ const Br = /* @__PURE__ */ f.forwardRef(Zr), zr = ({ explorer: e, toggleRef: t,
1397
1397
  if (a.current !== e || !o.current) return;
1398
1398
  const u = c.current, i = `[data-panel-id="${Me}"]`;
1399
1399
  d([
1400
- u === null ? null : Wr(s, u),
1400
+ u === null ? null : Ur(s, u),
1401
1401
  s.querySelector(`${i} ${Kr}`),
1402
1402
  s.querySelector(`${i} ${Gr}`),
1403
1403
  s.querySelector(`[data-resize-handle-id="${r}"]`)
@@ -1405,8 +1405,8 @@ const Br = /* @__PURE__ */ f.forwardRef(Zr), zr = ({ explorer: e, toggleRef: t,
1405
1405
  });
1406
1406
  }, [e, t, n, r]);
1407
1407
  }, ia = ({ view: e, explorer: t, content: n, contentCoversPage: r = !1, sheetDismissals: o = 0, onDraggingChange: c }) => {
1408
- const l = E(null), [a, s] = F(null), d = E(null), u = E(null), { inlineSize: i, rootFontPixels: p } = Xr(l, d), h = i !== null && i < Dt(p);
1409
- return Ur(h, { frameRef: l, sheetToggleRef: u, handleId: pt(e) }), /* @__PURE__ */ L("div", { ref: l, className: "aqmx-split-frame", "data-aqmx-explorer-mode": h ? "sheet" : "split", children: [
1408
+ const l = E(null), [a, s] = F(null), d = E(null), u = E(null), { inlineSize: i, rootFontPixels: p } = Wr(l, d), h = i !== null && i < Dt(p);
1409
+ return Xr(h, { frameRef: l, sheetToggleRef: u, handleId: pt(e) }), /* @__PURE__ */ L("div", { ref: l, className: "aqmx-split-frame", "data-aqmx-explorer-mode": h ? "sheet" : "split", children: [
1410
1410
  /* @__PURE__ */ m("span", { ref: d, className: "aqmx-rem-probe", "aria-hidden": "true", "data-aqmx-rem-probe": "" }),
1411
1411
  h ? /* @__PURE__ */ m(zr, { explorer: t, toggleRef: u, covered: r, onNoticeSlotChange: s, dismissals: o }) : null,
1412
1412
  /* @__PURE__ */ m(Vr, { value: h ? a : null, children: /* @__PURE__ */ m(Yr, { view: e, sheet: h, explorer: t, content: n, contentCoversPage: r, onDraggingChange: c, explorerMinPixels: Ht(p) }) })
@@ -1454,7 +1454,7 @@ const Br = /* @__PURE__ */ f.forwardRef(Zr), zr = ({ explorer: e, toggleRef: t,
1454
1454
  },
1455
1455
  [c, v]
1456
1456
  );
1457
- return /* @__PURE__ */ L(Xt, { id: `aqmx-split-${e}`, direction: "horizontal", onLayout: y, className: "aqmx-split", style: q, "data-aqmx-split": e, children: [
1457
+ return /* @__PURE__ */ L(Wt, { id: `aqmx-split-${e}`, direction: "horizontal", onLayout: y, className: "aqmx-split", style: q, "data-aqmx-split": e, children: [
1458
1458
  t ? null : /* @__PURE__ */ m(
1459
1459
  je,
1460
1460
  {
@@ -1470,7 +1470,7 @@ const Br = /* @__PURE__ */ f.forwardRef(Zr), zr = ({ explorer: e, toggleRef: t,
1470
1470
  }
1471
1471
  ),
1472
1472
  t ? null : /* @__PURE__ */ m(
1473
- Ut,
1473
+ Xt,
1474
1474
  {
1475
1475
  id: pt(e),
1476
1476
  thickness: k,