@aiquants/markdown-explorer 0.34.0 → 0.35.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 (140) hide show
  1. package/CHANGELOG.md +515 -0
  2. package/README.md +90 -39
  3. package/dist/EditSurface-CLG70Vnn.cjs +6 -0
  4. package/dist/EditSurface-D2j1kCEE.js +990 -0
  5. package/dist/ExplorerSplit-CfP1smbT.js +1589 -0
  6. package/dist/ExplorerSplit-D_0VohOv.cjs +2 -0
  7. package/dist/{MultiLayout-kcZyVnvK.js → MultiLayout-BeJ5Lubb.js} +249 -248
  8. package/dist/MultiLayout-CxV5SI7f.cjs +1 -0
  9. package/dist/{NativeScrollBar-UNed10Na.js → NativeScrollBar-BM5NULzg.js} +2 -2
  10. package/dist/{NativeScrollBar-pUbA4Zq3.cjs → NativeScrollBar-RWXpVhbI.cjs} +1 -1
  11. package/dist/TreeLayout-AxLw-36S.js +103 -0
  12. package/dist/TreeLayout-Bg2YH-EY.cjs +1 -0
  13. package/dist/client/MarkdownExplorer.d.cts +14 -1
  14. package/dist/client/MarkdownExplorer.d.ts +14 -1
  15. package/dist/client/edit/lineEndings.d.cts +4 -0
  16. package/dist/client/edit/lineEndings.d.ts +4 -0
  17. package/dist/client/hostContract.d.cts +67 -0
  18. package/dist/client/hostContract.d.ts +67 -0
  19. package/dist/core/config.d.cts +7 -0
  20. package/dist/core/config.d.ts +7 -0
  21. package/dist/core/contracts.d.cts +10 -4
  22. package/dist/core/contracts.d.ts +10 -4
  23. package/dist/core/draftAnswer.d.cts +23 -0
  24. package/dist/core/draftAnswer.d.ts +23 -0
  25. package/dist/core/labels.d.cts +68 -0
  26. package/dist/core/labels.d.ts +68 -0
  27. package/dist/core/location.d.cts +1 -2
  28. package/dist/core/location.d.ts +1 -2
  29. package/dist/core/ownUrls.d.cts +15 -0
  30. package/dist/core/ownUrls.d.ts +15 -0
  31. package/dist/core/treeSettings.d.cts +3 -2
  32. package/dist/core/treeSettings.d.ts +3 -2
  33. package/dist/core/viewSettings.d.cts +3 -1
  34. package/dist/core/viewSettings.d.ts +3 -1
  35. package/dist/describeValue-CLlVRO8d.js +17 -0
  36. package/dist/describeValue-Ccvhbt36.cjs +1 -0
  37. package/dist/explorerCore-DLpDuSev.js +998 -0
  38. package/dist/explorerCore-DYrxS9ez.cjs +1 -0
  39. package/dist/index-C1YMH-yI.js +5816 -0
  40. package/dist/index-LQWQfpAf.cjs +18 -0
  41. package/dist/index.cjs +1 -1
  42. package/dist/index.d.cts +7 -4
  43. package/dist/index.d.ts +7 -4
  44. package/dist/index.js +49 -44
  45. package/dist/licenses/@heroicons/react/LICENSE +21 -0
  46. package/dist/licenses/entities/LICENSE +11 -0
  47. package/dist/licenses/parse5/LICENSE +19 -0
  48. package/dist/location--KvTA0Ri.js +726 -0
  49. package/dist/location-D8DyDkuA.cjs +1 -0
  50. package/dist/lru-DC8GBmkX.js +39 -0
  51. package/dist/lru-SGmUyBQU.cjs +1 -0
  52. package/dist/{merge-C1MWvhCS.js → merge-Bb_HpPhe.js} +1 -1
  53. package/dist/{merge-BziXxZkE.cjs → merge-DQUYEGCx.cjs} +1 -1
  54. package/dist/nestingGuardWorker.js +5511 -0
  55. package/dist/ownUrls-B259RGgd.cjs +1 -0
  56. package/dist/ownUrls-Dh5g6ZJi.js +370 -0
  57. package/dist/sanitizeJob-BYRk17nr.js +21 -0
  58. package/dist/sanitizeJob-Cs9o3Vpl.cjs +1 -0
  59. package/dist/sanitizePolicy-CEMdaLUB.js +139 -0
  60. package/dist/sanitizePolicy-CiQfnxyd.cjs +2 -0
  61. package/dist/sanitizeWorker.cjs +1 -1
  62. package/dist/sanitizeWorker.js +134 -139
  63. package/dist/sanitizerService-BY4CPCoA.cjs +1 -0
  64. package/dist/sanitizerService-KWXv7bPm.js +240 -0
  65. package/dist/server/assetResponse.d.cts +60 -0
  66. package/dist/server/assetResponse.d.ts +60 -0
  67. package/dist/server/browser/browserPlatform.d.cts +12 -0
  68. package/dist/server/browser/browserPlatform.d.ts +12 -0
  69. package/dist/server/createMarkdownExplorer.d.cts +0 -10
  70. package/dist/server/createMarkdownExplorer.d.ts +0 -10
  71. package/dist/server/explorerCore.d.cts +12 -0
  72. package/dist/server/explorerCore.d.ts +12 -0
  73. package/dist/server/fileSystemSource.d.cts +1 -0
  74. package/dist/server/fileSystemSource.d.ts +1 -0
  75. package/dist/server/inProcessFetch.d.cts +5 -0
  76. package/dist/server/inProcessFetch.d.ts +5 -0
  77. package/dist/server/platform.d.cts +18 -0
  78. package/dist/server/platform.d.ts +18 -0
  79. package/dist/server/ports.d.cts +36 -5
  80. package/dist/server/ports.d.ts +36 -5
  81. package/dist/server/sanitizeProtocol.d.cts +3 -0
  82. package/dist/server/sanitizeProtocol.d.ts +3 -0
  83. package/dist/server/sanitizer.d.cts +5 -40
  84. package/dist/server/sanitizer.d.ts +5 -40
  85. package/dist/server/sanitizerOptions.d.cts +24 -0
  86. package/dist/server/sanitizerOptions.d.ts +24 -0
  87. package/dist/server/sanitizerService.d.cts +41 -0
  88. package/dist/server/sanitizerService.d.ts +41 -0
  89. package/dist/server/{workerPool.d.cts → workerJobs.d.cts} +0 -16
  90. package/dist/server/{workerPool.d.ts → workerJobs.d.ts} +0 -16
  91. package/dist/server.cjs +1 -1
  92. package/dist/server.d.cts +3 -1
  93. package/dist/server.d.ts +3 -1
  94. package/dist/server.js +270 -1343
  95. package/dist/serverBrowser.cjs +1 -0
  96. package/dist/serverBrowser.d.cts +1 -0
  97. package/dist/serverBrowser.d.ts +1 -0
  98. package/dist/serverBrowser.js +120 -0
  99. package/dist/serverCore.cjs +1 -0
  100. package/dist/serverCore.d.cts +14 -0
  101. package/dist/serverCore.d.ts +14 -0
  102. package/dist/serverCore.js +46 -0
  103. package/dist/storage-BpYsprog.cjs +1 -0
  104. package/dist/{storage-CmGHg7OA.js → storage-D1uSw-xj.js} +19 -18
  105. package/dist/storage.cjs +1 -1
  106. package/dist/storage.js +1 -1
  107. package/dist/styles/markdown-explorer.css +1 -1
  108. package/dist/{tapScrollCircle-D_BpaLwY.js → tapScrollCircle-BEydRn0y.js} +1 -1
  109. package/dist/{tapScrollCircle-DigcJCsu.cjs → tapScrollCircle-DdX0Wri0.cjs} +1 -1
  110. package/dist/testing.cjs +1 -0
  111. package/dist/testing.d.cts +6 -0
  112. package/dist/testing.d.ts +6 -0
  113. package/dist/testing.js +4 -0
  114. package/dist/useSplitPersistence-B2Fj508K.cjs +1 -0
  115. package/dist/useSplitPersistence-Fkqak8G8.js +44 -0
  116. package/docs/behavior/dom-hooks.md +2 -0
  117. package/docs/behavior/hosting.md +123 -0
  118. package/docs/behavior/layout.md +5 -3
  119. package/docs/behavior/localization.md +25 -8
  120. package/docs/behavior/security.md +32 -13
  121. package/docs/behavior/url-contract.md +4 -3
  122. package/package.json +48 -10
  123. package/dist/EditSurface-CF82jZQg.cjs +0 -6
  124. package/dist/EditSurface-CqHk2R3k.js +0 -982
  125. package/dist/ExplorerSplit-D325YGEf.cjs +0 -1
  126. package/dist/ExplorerSplit-DGH9bckm.js +0 -1500
  127. package/dist/MultiLayout-CzR7yJ0m.cjs +0 -1
  128. package/dist/TreeLayout-BnIU87HX.js +0 -96
  129. package/dist/TreeLayout-DtvIpuOe.cjs +0 -1
  130. package/dist/dataRoute-D6KiSHIc.js +0 -298
  131. package/dist/dataRoute-DwYtgyt6.cjs +0 -1
  132. package/dist/index-BDCbvHDs.cjs +0 -15
  133. package/dist/index-DR31S_-4.js +0 -5012
  134. package/dist/location-C44b9H1S.js +0 -676
  135. package/dist/location-hGLhCCg4.cjs +0 -1
  136. package/dist/sanitizePolicy-CwvyPpp5.js +0 -98
  137. package/dist/sanitizePolicy-T5T-3vV5.cjs +0 -1
  138. package/dist/storage-DM0EvkVf.cjs +0 -1
  139. package/dist/useSplitPersistence-DCeYbJMx.js +0 -38
  140. package/dist/useSplitPersistence-QGcvyMAa.cjs +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,520 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.35.0 (2026-11-10) — The server half runs in the page on a browser runtime, a host drives the explorer through props and a handle, and each document carries its language
4
+
5
+ ### Breaking
6
+
7
+ - **The peers `@aiquants/markdown` and `@aiquants/resize-panels` are `^13.0.0` and `^2.3.0` (hosts).** The explorer
8
+ offers the reader's column width and colour pair in markdown 13.0.0's display popover (`CONTENT_MEASURES` and
9
+ `CONTENT_COLORS` of `@aiquants/markdown/viewer-settings`) and names the popover's sections and a diagram's notices,
10
+ marks a document's content with its language (`contentLang`) and the labels it passes with the UI language
11
+ (`labelsLang`), hands a document's tables the size of its bars' tap-scroll circle (`spreadsheetTapScrollCircle`'s
12
+ `size`), and builds the browser runtime's link-card handler from `@aiquants/markdown/link-cards`; resize-panels
13
+ 2.3.0 draws the placeholder of a split that cannot fit its panels in the explorer's labels (`PanelGroup`'s
14
+ `labels`, `PanelGroupLabelKey`). On Node.js the `link-card` operation serves markdown 13.0.0's handler, which opens
15
+ pages only through the markdown service and without it answers its own `500` (`no-store`), so a host that serves
16
+ link cards without converting through the service now needs it. markdown 13.0.0's other breaking changes concern a
17
+ host's own conversions and the markdown service (see its changelog).
18
+ - **The two types named `ExplorerDraft` are renamed by role, and the unsaved draft the handle restores gets a name of
19
+ its own (hosts).** `ExplorerDraft` from `.` (`{ path, text }`, what `ExplorerDraftConverter.convert` receives) is
20
+ now `ExplorerPreviewDraft`; `ExplorerDraft` from `./server` (`{ text, baseVersion }`, what the `edit.save` port
21
+ receives) is now `ExplorerHostSaveDraft`. Their shapes are unchanged: rename the imports. `ExplorerUnsavedDraft` is
22
+ the new unsaved draft that `restoreDrafts()` takes and `onDraftChange` reports.
23
+ - **Each Markdown and text document carries its language as a canonical BCP 47 tag its source declares (hosts).** The
24
+ `markdown` and `text` documents of `ExplorerHostDocument` (`./server`) and of `ExplorerDocument` (`.`) carry a
25
+ required `lang`, the language their content is written in, apart from the explorer's `locale`: a non-empty string
26
+ that `Intl.getCanonicalLocales()` writes back unchanged (`"ja"`, `"en-US"` and `"zh-Hant-TW"` pass; `"EN"`,
27
+ `"en-us"`, `"en_US"` and `"iw"` do not). A host's `document` port answers it from its source's settings; an answer
28
+ without it, or with a tag off the rule, breaks the contract (a `TypeError`) and the document's load is `failed`.
29
+ `createFileSystemSource()` takes a required `lang`, which its Markdown and text documents carry: a value that is not
30
+ a string, an omitted one included, throws a `TypeError`, and a string off the rule a `RangeError` naming it. The
31
+ data route's `text` operation names no language, since it shows any file as written.
32
+ - **The HTML of a document and of the editing preview keeps a URL of the app itself only under the path its use allows
33
+ (hosts, readers).** The sanitizers, on the server and in the preview, know the app's own URLs from the
34
+ configuration: its origins (`appOrigins`), the data path for images and other resources, `basePath` and the data
35
+ path for links, and for the `src` of a `video`, an `audio` or a `source` also the media path (`mediaDataPath`). A
36
+ path-only URL, and an absolute one whose origin `appOrigins` lists (its scheme, host and port) or whose scheme is
37
+ that of a listed origin with a scheme that is not special (such as `wails:`, whatever its host), stays only when its
38
+ normalised path is the one its use allows or continues it after a `/`; a URL on the media path's origin alone stays
39
+ only as a media `src` under the media path. A protocol-relative URL (`//host/…`) stays only when it does under every
40
+ scheme the page may have, and an absolute URL that does not parse is dropped. A relative URL stays in a document
41
+ link (an HTML `a` with `data-link-kind="doc"`) and, without a `.` or `..` segment (`%2e` included), in any other
42
+ link; an SVG reference keeps a fragment only, and an image's or a media file's relative URL is dropped. A URL is
43
+ read as WHATWG reads it (leading and trailing C0 controls and spaces trimmed, tabs and newlines removed), one with a
44
+ backslash is dropped from any use, a `srcset` stays only when every candidate does, and the presentation attributes
45
+ (`clip-path`, `color-profile`, `cursor`, `fill`, `filter`, `marker-start`, `marker-mid`, `marker-end`, `mask`,
46
+ `stroke`) drop a value with a backslash, an image function or a `url(` whose argument does not start with `#`.
47
+ Absolute URLs of other origins stay as before. `video` and `audio` always carry `preload`: `none` where the document
48
+ wrote `none`, `metadata` otherwise. A host names its origins in `appOrigins` and its media path in `mediaDataPath`;
49
+ a document whose HTML reaches the app elsewhere (an image or a media file outside the data path, a relative link
50
+ with `..` that is not a document link) loses those URLs until they point under the allowed paths.
51
+ - **HTML nested deeper than 256 levels is refused as too large, in every runtime (readers, hosts).** The sanitizer's
52
+ nesting limit is 256 levels (it was 512), one value on the server, in the browser runtime and in the editing
53
+ preview: a document with an element placed deeper is `too-large`. The limit keeps a margin for the parsers to agree.
54
+ - **A path segment still percent-encoded after three decodes is denied (hosts, readers).** Deny rules that have at
55
+ least one pattern also deny a path segment or an entry name that one more lenient decode would still change after
56
+ the three they look through, whichever patterns they have, as the Go path rules that run the same table
57
+ (`./testing`) do; rules without a pattern (`deny: []`) deny nothing.
58
+ - **The `sanitizer` setting must be a plain object (hosts).** `createMarkdownExplorer`'s `sanitizer` and the browser
59
+ runtime's accept only a plain object: an array, a class instance or a `Map` throws a `TypeError`
60
+ (`[markdown-explorer] sanitizer must be a plain object of { … }`, naming the fields: `workers`, `deadlineMs`,
61
+ `maxHtmlBytes`, `cacheBytes`, `workerHeapMb`, `jobsPerScope` and `maxQueuedJobs` on Node, the same without `workers`
62
+ and `workerHeapMb` in the browser). Both refuse the five fields they share in the same order with the same messages;
63
+ a valid setting behaves as before.
64
+ - **A brace outside a placeholder is refused in every template label (hosts).** A template label
65
+ (`MARKDOWN_EXPLORER_LABEL_TEMPLATES`) holds braces only as its `{name}` placeholders, in both catalogs and in a
66
+ host's overrides: those the explorer passes to `@aiquants/drag-drop-panels` (the panels'), to
67
+ `@aiquants/resize-panels` (the split placeholder's details) and to `@aiquants/markdown` (a table block's, derived
68
+ from its catalog, and an SVG image's). An unclosed or unopened brace, a doubled one, an empty `{}` or a name with a
69
+ space throws a `RangeError` naming its position when the labels are resolved; the catalogs' own templates have none.
70
+
71
+ ### Added
72
+
73
+ - **The host contract (hosts).** `MarkdownExplorer` takes as props what a host that embeds it exchanges with it, each
74
+ defaulting to what a web page does (the default in parentheses): `fetch` for the data requests and the link cards
75
+ (the global `fetch`), `persistSettings(serialized)`, which stores the serialized view settings where the server's
76
+ `readSettings` finds them (the settings cookie), `subscribeHostChanges` with `hostChangePolicy` (`"reload"`, or
77
+ `"notify"`), `guardUnload` (`true`: leaving the page with an unsaved draft asks through `beforeunload`; a host that
78
+ asks on close itself passes `false`), `onReload` (the page's reload), `onSessionEnded` (none), `onDraftChange`
79
+ (none), `accountState` (`"signed-in"`, or `"signed-out"`), `confirmUnversionedSaves` (`false`), `paletteKey` (none),
80
+ an opaque name of the palette a host binds the explorer's colour roles to, whose change makes the explorer read
81
+ again the colours it paints itself (the tree's canvas lines), and `ref`. It checks them on every render (a function
82
+ or a flag of the wrong type, or a `paletteKey` that is not a string, throws a `TypeError`; a value outside its set
83
+ or an empty `paletteKey` a `RangeError`) and always calls the latest function given, without rebuilding its
84
+ transport or redrawing its context. `EXPLORER_HOST_CHANGE_POLICIES` and `EXPLORER_ACCOUNT_STATES` list the two sets
85
+ (`ExplorerHostChangePolicy`, `ExplorerAccountState`), and `.` exports the contract's types: `ExplorerHostChange`,
86
+ `ExplorerMediaFailure`, `ExplorerUnsavedDraft`, `ExplorerDraftChange`, `ExplorerDraftRestore`,
87
+ `MarkdownExplorerHandle` and `LineEnding`.
88
+ - **The handle (hosts).** `ref` receives a `MarkdownExplorerHandle`, the same value while the explorer renders, which
89
+ acts on the current reader's explorer when it is called: `flushUnsaved()` writes out the pending edits and returns
90
+ the paths left unsaved; `confirmDiscard(paths)` asks once about the unsaved ones among them and resolves `true`
91
+ without asking when there are none; `restoreDrafts(drafts)` brings a host's `ExplorerUnsavedDraft`s back as unsaved
92
+ drafts, as they were where their base version is still the document's and through a save's three-way merge where it
93
+ is not, and resolves the paths it restored and those it could not with the reason (a read's failure, `forbidden`
94
+ where the reader must grant a permission first, `failed` where the reader already edits the document, whose draft
95
+ stays); `announce(text)` speaks through the explorer's live region; `owns(element)` tells whether the element is
96
+ inside the explorer's root; and `reportMediaFailure(failure)` reports a media URL that failed
97
+ (`ExplorerMediaFailure`). Each checks its arguments and throws, or rejects where it returns a promise.
98
+ - **Changes the host saw elsewhere (hosts, readers).** `subscribeHostChanges(listener)` hands the explorer each
99
+ `ExplorerHostChange`, `{ sourceIds, paths }`. A listed source's tree is read again while a view shows it, that
100
+ source alone (one no view shows is only marked stale). A listed document that a pane shows, has loaded and the
101
+ reader is not editing follows `hostChangePolicy`: `"reload"` reads it again and announces
102
+ `documentReloadedAfterChange(name)`, or shows the notice when it cannot read it, and `"notify"` shows a notice above
103
+ the document, `documentChangedElsewhere(name)` with Reload. The explorer subscribes again when the function or the
104
+ reader changes and applies nothing that arrives after the unsubscribe; a subscribe that returns no unsubscribe
105
+ function throws.
106
+ - **Drafts kept outside the page (hosts).** `onDraftChange` receives, at the end of the task that changed them, the
107
+ drafts as the explorer writes them, those changed since the last call (`kept`), and the paths whose drafts ended:
108
+ saved, discarded, closed, or back to the text they started from (`ended`); its first call holds every draft unsaved
109
+ by then. The explorer listens only while a function is given, and not again when only the function changes; the
110
+ handle's `restoreDrafts` brings a kept copy back.
111
+ - **A save to a source that keeps no previous versions can ask first (hosts, readers).** With
112
+ `confirmUnversionedSaves`, a save that would write a change to a document whose source keeps no previous versions
113
+ (`history: false`), from the bar's Save or the editor's Mod-S, writes out the editor's pending keystrokes and asks:
114
+ `unversionedSaveTitle` («Save without keeping the previous version?» / 「前の版を残さずに保存しますか?」) and
115
+ `unversionedSaveBody`, with `unversionedSaveConfirm` («Save» / 「保存する」) and the existing `unsavedStay` to keep
116
+ editing. The confirmation sits outside the editing surface, so Ctrl+E inside it does not switch the view.
117
+ - **Sign-in and reload on a failure (hosts, readers).** A failure's Reload calls `onReload` and, when `guardUnload` is
118
+ `false`, first asks about the unsaved drafts. With `onSessionEnded`, an `unauthorized` failure (an ended session)
119
+ offers the host's sign-in without leaving the page: the function resolves `true` once the reader is signed in again,
120
+ and the failed view tries again (calls made while a sign-in is open share its answer; a failed or cancelled sign-in
121
+ resolves `false`). `accountState` picks the words, which name no service (a host names its own through `labels`):
122
+ `failureUnauthorizedSignInBody` («Sign in again to continue.» / 「もう一度サインインすると続けられます。」) with
123
+ `signInAgain` («Sign in again» / 「もう一度サインイン」) while signed in, and `failureUnauthorizedSignedOutBody`
124
+ («Sign in to open it.» / 「サインインすると開けます。」) with `signIn` («Sign in» / 「サインイン」) while signed
125
+ out. Without `onSessionEnded` the failure offers the reload.
126
+ - **Media failures (readers, hosts).** The explorer hears the media events inside its root, following the root a host
127
+ frame that differs per view recreates, and with the reports of the handle's `reportMediaFailure` tells, in the order
128
+ they come, a file it could not load from one it cannot play. The notice names one file (`mediaLoadFailed(name)`,
129
+ `mediaUnplayable(name)`) or counts several (`mediaLoadFailedCount(count)`, `mediaUnplayableCount(count)`); the one
130
+ of files that could not be loaded has Reload, which loads them again, and the one of files that cannot be played has
131
+ none. A report's `final` tells whether the host's cut is final: a final cut shows the notice at once, any other once
132
+ the element stalls or fails, since it reads again on its own; a reported PDF frame shows it at once.
133
+ - **Notices above the document (readers).** The changes made elsewhere and the media failures show in a
134
+ `role="status"` container between the document's refresh bar and the document region
135
+ (`markdown-explorer-document-notices`, each notice `markdown-explorer-document-notice` with `data-aqmx-notice`:
136
+ `changed`, `media-load` or `media-unplayable`); the first two offer `reload` («Reload» / 「読み込み直す」).
137
+ - **Announcements wait while a block is full screen (readers).** While a block of the document is full screen (its
138
+ dialog open as `:modal`), the explorer's announcements, the host's `announce` included, wait; when the block leaves
139
+ full screen they are spoken together in the order they came, a sentence that repeats the one before it dropped.
140
+ - **The reader's column width and colours (readers, hosts).** A page view's display popover offers the column width
141
+ and the colour pair (markdown 13.0.0's width and colours sections), as a panel's does while it is maximized; an
142
+ embed's `?showStyle=false` hides them with the style, and the editing preview shows neither. The choice is kept with
143
+ the display settings: `ExplorerViewSettings` has `measure` and `documentColors`, which the cookie writes after
144
+ `align`, each only as one of `@aiquants/markdown`'s `CONTENT_MEASURES` and `CONTENT_COLORS`. Any other value is
145
+ dropped with its key (the document then shows the viewer's own default), no other key name is read for them, and a
146
+ cookie without them reads and is written back as before.
147
+ - **A document's language (readers).** A Markdown or text document's `lang` marks its content for the viewer
148
+ (`contentLang`, markdown 13.0.0), rendered, shown as written or previewed while editing, so the content is read in
149
+ its own language.
150
+ - **The explorer's labels keep the UI language inside a document (readers).** The labels the explorer passes
151
+ `MarkdownViewer` carry the UI language (`labelsLang`), so every element they name declares it itself: the controls
152
+ the viewer draws inside the content (a code block's copy button, a diagram's controls, an embed frame's title) and
153
+ those of its bar. The explorer's own controls declare no language and read in the page's; a table file's grid is not
154
+ marked, as a table file names no language. An inert link's reason (`inertLink`: its `title` and its announced text)
155
+ reads in the UI language while the link's text keeps its own language and direction, moved to an inner span; where
156
+ the content names no language, the link declares none.
157
+ - **Fragment-only links under any router (readers, hosts).** In a page view a plain click on a fragment-only link
158
+ moves to its target once whatever the router, a memory router (as a desktop webview has) included: the explorer
159
+ follows the location the router made of the browser's own fragment navigation, or the click where it made none. `#`
160
+ keeps going to the top.
161
+ - **The split's placeholder reads in the explorer's language (readers, hosts).** When a split's panels cannot fit it,
162
+ `@aiquants/resize-panels` draws a placeholder over them, whose texts are now the explorer's labels
163
+ `panelGroupMinimumExceededSummary` and `panelGroupMinimumExceededDetail` (`{required}`, `{available}`), and
164
+ `panelGroupMaximumInsufficientSummary` and `panelGroupMaximumInsufficientDetail` (`{total}`, `{needed}`), the
165
+ English word for word resize-panels' own. The explorer passes all four to `PanelGroup`'s `labels` whichever a host
166
+ overrides; they carry no `lang`, so the placeholder, outside any document's language, reads in the page's.
167
+ - **Labels for markdown 13.0.0's display popover and diagram notices (hosts, readers).** `viewerStyleSectionTitle`
168
+ («Style» / 「スタイル」) heads the popover's style section; `viewerMeasureTitle` («Width» / 「幅」) with
169
+ `viewerMeasureFill` and `viewerMeasureReading`, and `viewerColorsTitle` («Colors» / 「配色」) with
170
+ `viewerColorsDefault`, `viewerColorsSepia`, `viewerColorsDarkLowGlare` and `viewerColorsHighContrast`, name the
171
+ width and colours sections and their choices; `viewerMermaidLoading`, `viewerMermaidInitializationFailed`,
172
+ `viewerMermaidRenderFailed` and `viewerMermaidEmptyDrawing` are a diagram's notices while it is drawn and when it
173
+ cannot be. The English catalog repeats the viewer's built-in texts, and the viewer receives all of them in the UI
174
+ language.
175
+ - **Labels for a diagram's source view and the names of the diagram types (hosts, readers).** `viewerMermaidSource`
176
+ («Source» / 「ソース」) names the toggle that shows a diagram's source in place of the drawing,
177
+ `viewerMermaidSourceRegion` («Diagram source» / 「図のソース」) the region that holds the source, and
178
+ `viewerMermaidCopySource`, `viewerMermaidCopiedSource` and `viewerMermaidCopySourceFailed` that region's Copy button
179
+ and its outcomes; the 31 `viewerMermaidType…` keys (`viewerMermaidTypeFlowchart` «Flowchart» / 「流れ図」,
180
+ `viewerMermaidTypeSequence` «Sequence diagram» / 「シーケンス図」 and the others) name the diagram types, which the
181
+ drawing carries as its role description in place of the type code Mermaid writes. The English catalog repeats the
182
+ viewer's built-in texts, and the viewer receives all of them in the UI language. The viewer reads them from the
183
+ `@aiquants/markdown` release that adds the source view and the type names; an earlier one reads only its own keys.
184
+ - **The server core (hosts).** `./server/core` is the server half without a runtime:
185
+ `createExplorerServer(config, platform)` runs on an `ExplorerServerPlatform` (`prepareScope`, `createSanitizer`,
186
+ `createLinkCardHandler`, with `SanitizerSetup`) and takes an `ExplorerServerCoreConfig`: the configuration
187
+ `createMarkdownExplorer` takes (`ExplorerServerSharedConfig`) without `scopeSecret`, with the `sanitizer` limits
188
+ every runtime accepts, and with a required `readSettings(request)`, which returns the request's serialized view
189
+ settings or `undefined` (any other answer throws a `TypeError`), and a required `assetMaxRangeBytes`. A platform's
190
+ scope must be 22 base64url characters for every principal key, or the core throws a `TypeError`. The entry also
191
+ exports `createInProcessDataFetch`, `ASSET_CONTENT_SECURITY_POLICIES`, the rules a host shares with the explorer
192
+ (the deny rules, the document-path and source-id rules, `EXPLORER_MAX_HEADINGS`, the text decoding),
193
+ `ExplorerError`, and the port and platform types. `createMarkdownExplorer` (`./server`) is `createExplorerServer` on
194
+ Node's runtime, which reads the settings cookie and caps no range.
195
+ - **The browser runtime (hosts).** `./server/browser` exports
196
+ `createBrowserExplorerPlatform({ principalKey, scope, window, nestingGuardWorkerUrl, pageFetch })`
197
+ (`BrowserExplorerPlatformOptions`), a platform that runs the core in the page, as a desktop webview does. It checks
198
+ its options when created and throws a `TypeError` naming the wrong one (a window without `crypto.subtle`, outside a
199
+ secure context, among them); answers the scope of its one principal key and refuses any other without naming it;
200
+ sanitizes with the page's DOMPurify behind a Web Worker that guards the nesting, the self-contained module
201
+ `./server/browser/nesting-guard-worker` (`dist/nestingGuardWorker.js`) whose URL the host passes as
202
+ `nestingGuardWorkerUrl`; measures the HTML with the window's Web Crypto, giving Node's values; and builds the
203
+ link-card handler from markdown 13.0.0's `@aiquants/markdown/link-cards` on `pageFetch` (with `null`, a
204
+ configuration that has link cards throws a `TypeError`). Its `sanitizer` limits default to one worker's, with the
205
+ parsed-node budget of a Node worker on the default heap (81,920 at the default 4 MiB, so `maxHtmlBytes` may be at
206
+ most 14,155,776, which leaves it 4,096 nodes; a `RangeError` above it), and `workers` and `workerHeapMb`, which only
207
+ Node reads, throw a `TypeError`. A job's deadline covers the guard and DOMPurify together: a result that ends after
208
+ it is dropped and the job times out. The demo's `/browser-docs` page runs the core this way.
209
+ - **The in-process fetch (hosts).** `createInProcessDataFetch(server, { dataPath, pageAddress })` returns, for the
210
+ explorer's `fetch`, a function that answers the data route inside the page: a request for `<dataPath>/<operation>`
211
+ on the page's scheme and host goes to the server's `dataLoader` (GET, HEAD) or `dataAction` (any other method), HEAD
212
+ keeping the status and headers without the body, and any other URL fails with a `TypeError`, reaching neither the
213
+ core nor the network. It compares scheme and host rather than origins, so a `wails://` page (origin `"null"`) is
214
+ answered. A request aborted before the call never reaches the core, and one aborted while the core works rejects
215
+ with its reason at once. `dataPath` follows the configuration's mount-path rule, and `pageAddress` must be an
216
+ absolute URL the data path resolves against (not relative, `about:blank`, `data:` or `mailto:`).
217
+ - **Files a host streams itself (hosts).** `MarkdownExplorerServer.planData(args)`, given the loader's arguments,
218
+ plans a data request (`ExplorerDataPlan`) for a host that streams files itself. An `asset` GET answered with bytes
219
+ (200 or 206) is a `file`: its status, all its headers, the file's bridge (`uri`, `storageVersion`), its range and
220
+ length, and `fail(error)` for a read that fails before the first byte (the error passes the host's `readFailure`,
221
+ then the route's failure mapping, log and headers), planned without reading the bytes (a plain-text view reads only
222
+ the head that names its encoding). Every other answer is a whole `response`, as `dataLoader` gives it. A file
223
+ without a bridge whose bytes would be planned is logged as a host contract violation and answered `failed` (500),
224
+ and a table preview's workbook (`as=workbook`), which the explorer reads only through its own fetch, is refused as
225
+ `invalid` (400) without a log.
226
+ - **A file's bridge (hosts).** `ExplorerAssetFile` takes an optional `bridge`, `{ uri, storageVersion, readFailure }`,
227
+ for a host that streams the bytes itself rather than through `open`: the storage URI, its version (`null` for a
228
+ storage without versions), and `readFailure`, which maps a failed read the way `open`'s failures are mapped, so a
229
+ bridged failure answers the status a failed `open` would. The explorer copies it field by field and freezes it.
230
+ `undefined` is no bridge; `null`, a value that is not an object, an empty `uri` or `storageVersion`, and a
231
+ `readFailure` that is not a function break the contract (logged, 500). The file's version is not compared with the
232
+ storage's.
233
+ - **A range answer can be capped, and the asset answers' policies are exported (hosts).** `assetMaxRangeBytes` (a
234
+ positive safe integer or `null`) caps the range answers of `asset`, stored as is or shown as plain text: a single
235
+ satisfiable range longer than it is answered with a 206 of that many bytes from its start. A request without
236
+ `Range`, a mismatching `If-Range` and a 416 are answered as before, and `null` answers the range asked, as the Node
237
+ entry does. `ASSET_CONTENT_SECURITY_POLICIES` holds the two `Content-Security-Policy` values the asset answers
238
+ carry, `sandboxed` and `mediaDocument`.
239
+ - **The app's own origins and media path (hosts).** The configuration takes `appOrigins`, the origins the app's own
240
+ pages are served from (a frozen `[]` by default), each exactly a URL's `protocol//host` (an origin whose scheme is
241
+ not special, such as `wails://localhost`, makes every URL of that scheme the app's): an empty host, an explicit
242
+ default port or a path throws a `RangeError`, a value that is not an array or an element that is not a string a
243
+ `TypeError` naming the element's index, and repeats collapse in the order written. `mediaDataPath` (`null` by
244
+ default) is the media data path: an absolute `http:` or `https:` URL, as the browser writes it, of an origin and a
245
+ mount path only (a trailing `/`, a query, a fragment, user information, an explicit default port or a `.` or `..`
246
+ segment throws). For either, `undefined` is the same as leaving it out, and `null`, `""` or a number is an error.
247
+ - **The rule of a document's language (hosts).** `.` and `./server/core` export `isExplorerDocumentLang(value)`, the
248
+ rule a Markdown or text document's `lang` is checked with (a non-empty string that `Intl.getCanonicalLocales()`
249
+ writes back unchanged), so a host refuses a wrong tag in its own settings when its server reads them, not on each
250
+ document's load.
251
+ - **Draft conversion helpers (hosts).** `.` exports `draftAnswerOf(error)` and `draftConversionOf(setup)` for a host's
252
+ browser draft converter. `draftAnswerOf` maps a conversion's failure to the explorer's draft answer: a conversion
253
+ stopped by its size limit or its deadline is a `too-large` failure document, `invalid_argument` is `invalid`,
254
+ `internal` is `failed`, and `unavailable` leaves the draft to the data route's `preview`; any other error, a value
255
+ that only looks like a converter error and a converter error with a reason it does not know are thrown again.
256
+ `draftConversionOf` builds from the deny rules and the conversion limits (`DraftConversionSetup`,
257
+ `MarkdownConversionLimits`) the deadline (`timeoutMs`) and each draft's options (`ExplorerDraftConversionOptions`: a
258
+ copy of the deny rules, the HTML limits, the source lines). The error classes are `@aiquants/markdown/converter`'s,
259
+ which markdown 13.0.0's `@aiquants/markdown/service-client` exports as well.
260
+ - **The deny table (hosts).** `./testing` exports `denyVectors()`, the explorer's deny-rule table as 207 frozen rows
261
+ of `{ pattern, path, expect }` (`DenyVector`), for a host to check its own deny implementation against. The entry
262
+ reaches no package, and no other entry reaches it.
263
+
264
+ - **The tree setting "Show folder READMEs" (readers, hosts).** A switch right after "Reveal the open document",
265
+ offered in the tree view only (`showFolderReadme`, on in `DEFAULT_TREE_SETTINGS`; `settingShowFolderReadme`: «Show
266
+ folder READMEs», 「フォルダーの README を表示」), ties the README the tree view shows to the folders' opening and
267
+ closing. Turned off, a press on a folder only opens or closes it, and a folder URL still shows the folder's README;
268
+ a host turns it off for every reader with `defaultTreeSettings: { showFolderReadme: false }`.
269
+
270
+ ### Changed
271
+
272
+ - **The viewer's style button is its display button (readers).** `viewerStyleTitle`, `viewerSelectStyle`,
273
+ `viewerPinStyle` and `viewerUnpinStyle` read «Display», «Display options», «Pin display options» and «Unpin display
274
+ options» (「表示」「表示の設定」「表示の設定をピン留め」「表示の設定のピン留めを解除」), the built-in texts of
275
+ markdown 13.0.0's display popover, whose style section `viewerStyleSectionTitle` heads.
276
+ - **A document table's tap-scroll circle is the bars' 44 px (readers).** The explorer hands a document's tables the
277
+ size of its bars' circle, 44 px, which markdown 13.0.0 draws.
278
+ - **A notice's action into the explorer moves through the router (readers).** An `ExplorerNotice`'s `action` whose
279
+ `href` is a page of the explorer, a path-only address under `basePath` outside the data route, moves through the
280
+ router; any other stays a plain link.
281
+ - **The history dialog retries a version's text alone (readers).** A version whose text failed to load is retried by
282
+ reading that text again.
283
+ - **The bundles carry the notices of the third-party code they inline (hosts).** A legal comment at the head of each
284
+ chunk that keeps such code names the package, its version and licence, and the copy of its licence file in
285
+ `dist/licenses/<name>/`: `parse5` (MIT) and `entities` (BSD-2-Clause) in the nesting-guard worker, and
286
+ `@heroicons/react` (MIT), which the library build bundles.
287
+
288
+ - **Closing the shown folder moves the tree view up (readers).** With "Show folder READMEs" on, a press (a click,
289
+ Enter or Space) on the shown folder while it is open moves the view up once the folder closes — at the end of the
290
+ delay that tells a single press from a double click, or at the end of a double click —: to the folder above the
291
+ pressed row (its README, or the line saying it has none), or for a top-level folder to the source's README as a
292
+ document, or to the empty pane when the source has none, so repeated presses walk up one level at a time. The move
293
+ replaces the URL's document and leaves an explorer sheet open, since it picks no destination; a document the reader
294
+ shows before the folder closes stays. A double click that leaves the folder open keeps its README, a press on an
295
+ open folder that is not shown now only closes it (it showed the folder and kept it open), and the arrow keys and
296
+ Collapse all never change what the view shows. Under "Always expanded" a press on a folder whose contents are known
297
+ shows it, or on the shown folder moves up at once, and no longer flips the folder's hidden expansion.
298
+ - **The explorer's navigations carry their kind as router state (hosts).** Every navigation the explorer starts
299
+ carries `{ aqmxNavigation }` (`browse`, `close-folder`, `switch-source`, `switch-view` or `follow-link`) as its
300
+ `location.state` (it was `null`), so what watches the location reads why it changed from the navigation itself.
301
+
302
+ ### Fixed
303
+
304
+ - **Every type a public entry's declarations show is exported (hosts).** `.` exports the seven types its declarations
305
+ showed but no entry exported: `ExplorerEntryType`, `ExplorerNoticeTone`, `ExplorerTextDocument` and its
306
+ `ExplorerFileText`, `MarkdownExplorerSpreadsheetLabels`, `ExplorerHrefWriter` and `TreeReadmePlacement`. `./server`
307
+ exports `ExplorerAssetDisplay`, which its declarations showed and no entry exported either, and, as types, the new
308
+ `ExplorerDataPlan`, `SanitizerLimitsInput` and `ExplorerServerSharedConfig` its declarations show. The build checks
309
+ every public entry for such types.
310
+ - **Under `lockDocumentScroll`, the placement check follows the explorer's current root (hosts).** A host frame that
311
+ differs per view and recreates the root stays watched: the check runs once per root element, a recreated root is
312
+ checked afresh, and the removed one is no longer watched.
313
+ - **Messages name values through one describer (hosts).** A value an error, violation or warning message names (a
314
+ rejected or out-of-range value, a quoted name or candidate) is written one way: a string quoted and cut after 80
315
+ code points, ending in `…`, never inside a surrogate pair; a number, a boolean, a symbol, `null` and `undefined` as
316
+ they are (`-0` included); a bigint with its `n`; an object by its kind, never by its content or its own `toString`.
317
+ The counts, limits, lengths and positions the package itself asks for stay plain numbers. A rejected value no longer
318
+ looks valid (the string `"5"` is not written `5`, nor `null` as `object`), a bigint no longer throws a `TypeError`
319
+ that hides the package's own error, and a document of an unknown kind no longer puts its content into the message. A
320
+ message about `scopeSecret` names the value's type alone; `iframeHosts` names an element out of place with its index
321
+ (as `appOrigins` does), overlapping view sections are named by value, a source id given twice to
322
+ `withExplorerSources` is named with its indices (as the server's `sources` are), and a malformed mount path's
323
+ message says that `.` and `..` segments are refused.
324
+ - **A URL whose scheme has a digit is judged by its scheme (readers).** The sanitizer's URL check counts digits among
325
+ a scheme's characters, so a URL such as `h323:…` is no longer taken for a relative one.
326
+ - **A document invalidated during a background re-read is no longer taken as checked (readers).** When the explorer
327
+ invalidates a document no pane holds, it also forgets the background re-read already running, whose answer, the
328
+ document from before the change, counted as checking it again.
329
+
330
+ - **A tree press navigates with the URL's current overrides (readers).** After the URL's overrides changed while the
331
+ same document or folder stayed shown (an override dropped, another style chosen), a press on the tree's Tab stop —
332
+ the row that last took the tree's focus, or else the shown row — navigated with the overrides of that row's last
333
+ render (Enter, Space, or a click, also one that brings the focus back into the tree), so a dropped override came
334
+ back: the tree's rows keep the press handler they last rendered with, and only a press that moves the Tab stop
335
+ renders the pressed row again. The tree's press handler now keeps its identity and reads the pane's current
336
+ handlers.
337
+
338
+ ### Tests
339
+
340
+ - `vitest.config.ts`: the runtime-independent server suites run in four projects, `server` (Node), `server-plan`
341
+ (Node, the data route's GET and HEAD planned by `planData` and answered from the file's bridge, as a host that
342
+ streams files itself), and `server-browser-chromium` and `server-browser-webkit` (Vitest's browser mode, headless
343
+ through Playwright), while the suites that test Node's runtime itself run in `server` alone
344
+ (`tests/server/README.md` says which run where and how to write one that runs anywhere); `tests/browser/**` runs in
345
+ the two browser projects, which pre-bundle every dependency their suites load. `test` and `test:coverage` run the
346
+ `browser`, `wiring`, `server`, `server-plan` and `server-browser-chromium` projects (V8 coverage is measured in
347
+ Chromium only), `test:browser:webkit` runs WebKit, and `test:run` and `test:watch` every project. `@vitest/browser`
348
+ and `@vitest/browser-playwright` are 4.1.10 exactly, and `playwright` is the catalog's.
349
+ - `tests/server/runtimes/` (`node.ts`, `browser.ts`, chosen per project through `projectRuntime`) and
350
+ `tests/server/fixtures/memorySource.ts` (an in-memory storage with the asset port, a default bridge and reads
351
+ through it): the suites build the core on either runtime. A browser runtime answers the page's one principal, so a
352
+ test of a second one runs on Node; cookies travel in headers every runtime keeps (`SESSION_COOKIE_HEADER`,
353
+ `SETTINGS_COOKIE_HEADER`), the assertions that need a forbidden header run only where it reaches the core, and
354
+ `testRequest` refuses a header the runtime dropped.
355
+ - `tests/server/explorerCore.test.ts`, `tests/server/nodePlatform.test.ts`, `tests/server/serverCoreTypes.test.ts`:
356
+ where and how often the core calls its platform, the order of its errors, the scope contract, the settings reader
357
+ and the range cap (stored as is, plain text, `null`); Node's runtime checks nothing when created, checks the secret
358
+ when the scope is prepared and derives the scope by HMAC; the two configurations share their fields, each keeps its
359
+ own, and the core's `sanitizer` takes Node's setting as it is. `tests/server/planData.test.ts`: a table of plans (a
360
+ capped range, 416, HEAD, 304, an empty file, a file of unknown length, `as=text`, a redirect, `not-found`, no cap,
361
+ `fail`, a file without a bridge), `fail`'s four answers through the host's mapping, `as=workbook`, other operations
362
+ and methods, `.data` and an unexpected error, and a `file` plan streamed from the bridge answering what `dataLoader`
363
+ answers.
364
+ - `tests/server/inProcessFetch.test.ts`: the in-process fetch answers the data route and never calls the global fetch.
365
+ `tests/server/sanitizerOptions.test.ts`, `tests/server/sanitizer.test.ts`: the browser's and Node's resolvers accept
366
+ only a plain object and refuse with the same first error. `tests/server/sanitizeJob.test.ts`: the sanitizing step
367
+ after the nesting guard, which every runtime shares. `tests/server/documentLang.test.ts`: the `lang` rule, the
368
+ contract and the host document's copy, answering alike in Node, Chromium and WebKit. `tests/server/ownUrls.test.ts`:
369
+ the table `tests/server/fixtures/own-urls.json` (80 rows over a web, a desktop and a desktop-media configuration)
370
+ and its shape, in Node, Chromium and WebKit. `tests/server/linkCardOperation.test.ts`: without
371
+ `MARKDOWN_SOCKET_PATH` the handler's own 500 reaches GET and HEAD with its status, headers and body, while the
372
+ explorer logs nothing and fetches no local page.
373
+ - `tests/unit/denyVectors.test.ts`: the deny rules answer the 207 rows of `tests/fixtures/deny-vectors.json`, the
374
+ table `./testing` exports. `tests/server/htmlNestingParity.test.ts` (Node), with
375
+ `tests/fixtures/nesting-parity.json` and `tests/fixtures/over-limit-nesting.html`: the 23 rows within the limit
376
+ agree between the guard, jsdom's parse and the table and sanitize idempotently, while the 12 over it and the
377
+ over-limit document are refused. `tests/server/fixtures/digest-vectors.json`: Node's measure and the browser's run
378
+ the same table.
379
+ - `tests/browser/` (Chromium and WebKit, real Web Workers): `nestingGuardWorker.test.ts` (the worker and the guard in
380
+ the page answer as the nesting table, and the three rows at the limit, a `div`, a `ul`/`li` and a `table`, keep
381
+ depth 256 in a document, a fragment and a document embedded 64 levels deep), `domSanitizerPool.test.ts` (the pool's
382
+ output matches the Node step's and is idempotent, rows over the limit are `too-large`, and its failures, deadline,
383
+ yield and admission, the guard's refusals and errors coming from stand-in workers, `guardWorkers.ts`),
384
+ `browserPlatform.test.ts` (the options' checks, the scope, the limits, the budget sent to the guard, real
385
+ sanitizing, the measure, and the link cards on a stand-in port) and `fullscreenBlock.test.ts`.
386
+ - `tests/browser/fragmentLinks.test.tsx`: under a browser router and a memory router, a fragment-only link pressed by
387
+ a pointer click or by Enter (a footnote's reference and back link in remark-gfm's and goldmark's markups, a heading
388
+ the URL does not hold yet, the top, and the fragment the URL already holds) scrolls the pane once, leaves the focus
389
+ where it went and keeps the document. `tests/browser/treeLinePalettes.test.tsx`: five palettes bound as a host binds
390
+ its own and named by a new `paletteKey` are read back from the tree canvas's pixels, and one bound without a new
391
+ name stays undrawn until the name changes. `tests/browser/fullscreenAnnouncements.test.tsx`: through the real
392
+ explorer and table block, announcements wait while the block is full screen and, once it leaves by its control or by
393
+ Escape, are spoken in order with a repeat dropped. `tests/browser/unversionedSaveConfirm.test.tsx`: Mod-S right
394
+ after typing writes the pending keystrokes and asks; Enter or Escape stays and hands the focus back to the editor,
395
+ and saving sends the text over its base version.
396
+ - `tests/unit/hostContract.test.ts`, `tests/unit/hostChanges.test.ts`, `tests/components/explorerHost.test.tsx`,
397
+ `tests/components/explorerDrafts.test.tsx`: the host's options and the handle's arguments are checked; a change
398
+ reloads or notifies by the policy and skips an edited, unshown or unloaded document; the paths `onDraftChange` folds
399
+ match `flushUnsaved()` after each write (the first render, typing, back to the original text, saving, discarding, a
400
+ restored draft), with a later listener, a replaced function, `confirmDiscard` and malformed arguments; under the
401
+ lock, a frame that recreates the root moves the watch to the current root, which reports a collapse once.
402
+ `tests/unit/stores.test.ts`: `noteChanged`, `reloadSource` and `invalidate`.
403
+ `tests/components/markdownExplorer.test.tsx`: the context's defaults and relays.
404
+ - `tests/components/documentNotices.test.tsx`, `tests/components/explorerNotices.test.tsx`,
405
+ `tests/components/historyConfirm.test.tsx`, `tests/components/historyDialog.test.tsx`,
406
+ `tests/components/liveRegion.test.tsx`, `tests/components/unsavedChangesGuard.test.tsx`,
407
+ `tests/unit/documentChanges.test.ts`, `tests/unit/mediaFailure.test.ts`: the screens' side of the host contract (the
408
+ notices above the document and their Reload, a notice's link into the explorer, the history dialog's retry, the
409
+ announcements held while a block is full screen, the unload and unversioned-save checks, and the order of media
410
+ reports and events). `tests/components/singleView.test.tsx`, `tests/components/treeLayout.test.tsx`: the notices'
411
+ container between the refresh bar and the document region.
412
+ - `tests/components/modalDialog.test.tsx`, `tests/components/documentEdit.test.tsx`: closing a modal dialog hands the
413
+ focus back to the control that opened it, under the stand-in dialog of `tests/support/dialogStandIn.ts`, which,
414
+ unlike a browser closing a modal dialog, hands none back itself; each press first moves the focus as a real press
415
+ does.
416
+ - `tests/unit/labels.test.ts`: both catalogs carry the 13 viewer keys of markdown 13.0.0 (82 viewer keys in all), the
417
+ 14 keys of the host contract's screens (their texts word for word, a host's override that names a service, a wrong
418
+ type, a blank text, and the spaces around alphanumerics in Japanese) and the split placeholder's four (the English
419
+ resize-panels' defaults word for word, the Japanese spaced, the placeholders per key); a brace outside a placeholder
420
+ is refused at its position, and neither catalog's templates has one. `tests/components/panelGroupLabels.test.tsx`,
421
+ `tests/components/explorerSplit.test.tsx`, `tests/components/editSplit.test.tsx`: the split takes both catalogs and
422
+ the overrides the resolution lets through, refuses the same templates at the same position, and names its
423
+ placeholder by the UI language's summary without a `lang`, with the same labels on every render.
424
+ - `tests/components/document.test.tsx`, `tests/wiring/editTables.test.tsx`: the elements the viewer's labels name
425
+ carry the UI language's `lang` themselves, inside content of the other language and outside it, while the explorer's
426
+ own controls carry none. `tests/components/documentLinks.test.tsx`: an inert link's reason reads in the UI language
427
+ while its text keeps the document's language, or its own `lang="ar"` and `dir="rtl"`, and outside the content it
428
+ names no language; fragment-only links scroll once under a browser and a memory router.
429
+ - `tests/unit/settings.test.ts`: `measure` and `documentColors` are written in the fixed order and read back, a value
430
+ outside the viewer's lists and a key under another name are dropped, a cookie without them is unchanged, and every
431
+ value of the lists round-trips; the reshaped messages. `tests/unit/describeValue.test.ts`: the describer (the cut,
432
+ numbers, bigint, kinds, no call of an object's own `toString`), and each layer's entry cutting a long rejected
433
+ string and refusing a bigint with its own error.
434
+ - `tests/unit/draftAnswer.test.ts`: the six answers, the service client's classes being the same classes, five errors
435
+ thrown again, and the options. `tests/wiring/documentTableCircle.test.tsx`: the circle's diameter reaching a
436
+ document table's grid. `tests/components/explorerPane.test.tsx`: the tree's line colours are the computed colours
437
+ the probe resolves. `tests/components/lockDocumentScroll.test.tsx`: the watch is one function while the flag holds
438
+ and watches nothing unlocked.
439
+ - `scripts/verify-dist.mjs`, `tests/unit/entryPurity.test.ts`, `tests/server/configuration.test.ts`: `./server/core`,
440
+ `./server/browser` and the nesting-guard worker reach no Node built-in, `@aiquants/markdown/server`, `undici` or
441
+ `jsdom`; `./server/core` loads in both formats; the worker is one module that imports nothing, and its notice names
442
+ `entities` and `parse5`; every chunk's notice has its licence file; no public entry's declarations show a type that
443
+ no public entry exports; `./testing` reaches no package and no other entry reaches it; the root entry and
444
+ `./server/core` export `isExplorerDocumentLang`; the server side may import
445
+ `@aiquants/markdown/link-cards`; the built server keeps a document's `lang`; and the link-card handler answers its
446
+ own 500 without the markdown service, its dependencies read from the installed `@aiquants/markdown/server` entry.
447
+ - `tests/support/`: `dialogStandIn.ts`, `documents.ts`, `routerProbes.tsx`, `viewsFromUrl.tsx`, `linkPresses.ts`,
448
+ `linkPages.tsx`, `frames.ts`, `explorerRoot.tsx`, `thrown.ts` and `panelGroupLabels.ts` replace the copies the
449
+ component tests each carried, or support the new ones.
450
+ - `playwright.config.ts`: two projects, `chromium` (every spec) and `webkit` (Desktop Safari, `browser-core.spec.ts`
451
+ only), and the servers it starts get an empty `MARKDOWN_SOCKET_PATH`. `tests/e2e/browser-core.spec.ts` (four tests
452
+ in both engines), on the demo's `/browser-docs` page, where the core runs on the browser runtime over three bundled
453
+ Markdown files: it renders with its tree, follows a document link and starts the nesting-guard worker, reveals a
454
+ document in its folder, round-trips the display settings and keeps the scope without a cookie, and goes from the
455
+ base path to the canonical tree URL, with no request to the data route or another origin and no exception.
456
+ - `tests/e2e/link-cards.spec.ts`: the demo's data route answers with the handler's own 500 and sets no cookie.
457
+ `tests/e2e/document-viewer.spec.ts`, `tests/e2e/embeds.spec.ts`: the elements with names carry the UI language's
458
+ `lang` themselves, a diagram's controls sit inside content of the guide source's language, and an embed frame's
459
+ title comes from the UI language's catalog. `tests/e2e/spreadsheets.spec.ts`: a document table's tap-scroll circle
460
+ is `TAP_SCROLL_CIRCLE_SIZE`. `tests/e2e/single-view.spec.ts`: the style control opens the width and colours
461
+ sections, which `?showStyle=false` hides with it. `tests/e2e/focus-handoff.spec.ts`: each page view's fragment test
462
+ runs with Enter and with a pointer click. `tests/e2e/multi-view.spec.ts`: the display popover's test titles.
463
+
464
+ - `tests/components/folderReadme.test.tsx`: closing the shown folder moves up to the pressed row's parent, to the
465
+ source's README (which the reveal does not move to another source), or to the empty pane at the root, with a
466
+ `close-folder` navigation; double clicks in both modes, the arrow keys (on a row and outside the rows), Collapse
467
+ all, a document shown before the folder closes, "Always expanded" (its hidden expansion kept, a lazy folder opened
468
+ in the reader's expansion), "Show folder READMEs" off, a folder listed in two places, and, after the overrides
469
+ changed, a press on the focused row and a pointer press from outside the tree on the shown folder.
470
+ `tests/components/explorerEntries.test.tsx`: `closeTargetOf` (the folder of the row above, told apart by identity;
471
+ the source's README; nothing; a row not drawn). `tests/components/explorerSheet.test.tsx`: the sheet stays open on a
472
+ move up and closes on a press that opens a folder and on going back to the move's entry.
473
+ `tests/components/navigation.test.tsx`: each kind's router state and `explorerNavigationOf`.
474
+ `tests/components/treeLayout.test.tsx`: after the URL's overrides changed, Enter and a click on the focused row, and
475
+ a pointer press from outside the tree on the Tab stop (the shown row, and the row focused last).
476
+ `tests/components/explorerPane.test.tsx` and `tests/unit/settings.test.ts`: the new switch's row, ring, storage and
477
+ host default, and the settings the multi view hides. `tests/support/routerProbes.tsx`: `LocationProbe` shows the
478
+ router state (`data-router-state`).
479
+
480
+ ### Documentation
481
+
482
+ - README: the package's entries, with a link to the new hosting page; `appOrigins` and `mediaDataPath` in the
483
+ configuration; `planData` and an asset file's `bridge`; the host contract's props and a section on the handle (its
484
+ methods, `ExplorerUnsavedDraft` and the checks of what a host gives); the shared halves of a browser draft converter
485
+ (`draftConversionOf`, `draftAnswerOf`); the split's labels, a template's braces and the language of the viewer's
486
+ labels; the demo's `/browser-docs` page and the two E2E projects; Link cards (the handler opens pages only through
487
+ the markdown service, and without it answers its own `500`, `no-store`), `documentStyles` in the style section of
488
+ the viewer's display popover, the documents' `lang` (with `isExplorerDocumentLang` for a host's own settings) and
489
+ `createFileSystemSource`'s `lang`, the 256-level nesting limit and the deny rules' three decoding levels,
490
+ `lockDocumentScroll`'s check per root element, `./storage` importing no package, the peers' floors with what the
491
+ explorer takes from markdown 13.0.0 and resize-panels 2.3.0, and a document table's circle one control wide.
492
+ - `docs/behavior/hosting.md` (new): what each entry holds and never loads; the steps for running the server half
493
+ inside the page (the core's configuration, the browser runtime's options, the in-process fetch and the route), with
494
+ what a page host must know; the browser runtime's sanitizer; the app's own URLs (`appOrigins`, `mediaDataPath`); and
495
+ streaming files from a bridge with `planData`.
496
+ - `docs/behavior/security.md`: the sanitizing on each runtime, with the browser runtime's guard worker, its refused
497
+ worker fields, node budget, `maxHtmlBytes` cap, admission defaults, deadline across both steps and guard failures;
498
+ the app's own URLs, the presentation attributes and `preload`; the scope on each runtime; the host's duties on each,
499
+ with the `media-src`, `frame-src` and `worker-src` directives; a file of no known kind as a `file` document offered
500
+ for download (it read `unsupported`); the link cards through the markdown service, the `text` operation's answer
501
+ without `lang`, the 256-level depth limit, and the denial of a segment still encoded after three decodes, with
502
+ `deny: []` denying nothing. `docs/behavior/layout.md`: the tree's type icons reach 3:1 against `--aqmx-surface` and
503
+ each tint in both schemes, the display popover and the alignment menu among the parts that stop a held Enter,
504
+ `lockDocumentScroll` per root element, and a document table's circle one control wide.
505
+ `docs/behavior/localization.md`: the viewer's labels of the display popover,
506
+ its width and colours sections and a diagram's notices; the notices above a document, the sign-in texts of an
507
+ `unauthorized` failure, the unversioned save's confirmation and the split placeholder's texts and templates; a brace
508
+ outside a placeholder; and the viewer's labels in the UI language (`labelsLang`). `docs/behavior/dom-hooks.md`: the
509
+ notices' container and each notice with its `data-aqmx-notice`. `docs/behavior/url-contract.md`: `measure` and
510
+ `documentColors` in the display settings.
511
+ - Docstrings: `ExplorerAssetFile.open` (the plain-text view opens the file's head on a HEAD to name its encoding, and
512
+ before the range of a range request), `ExplorerTextDocument` (its text is read by the reading order, the byte-order
513
+ mark, UTF-8 and the legacy encodings, rather than always as UTF-8), and the document table's circle (44 px).
514
+ - README: "Folders and their READMEs" (opening a folder, closing the shown one, double clicks, "Always expanded", the
515
+ keys and Collapse all, and "Show folder READMEs"), `showFolderReadme` among `defaultTreeSettings`, and the tree
516
+ settings the multi view does not offer. `docs/behavior/localization.md`: `settingShowFolderReadme`.
517
+
3
518
  ## 0.34.0 (2026-11-06) — The explorer closes to a rail, the tree view's document maximizes over the page, and a touch screen gives the content its whole width
4
519
 
5
520
  ### Breaking