@aiquants/markdown-explorer 0.37.1 → 0.39.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 (37) hide show
  1. package/CHANGELOG.md +63 -1
  2. package/README.md +3 -2
  3. package/dist/{EditSurface-BvwgM4lC.js → EditSurface-CUPN9dUY.js} +211 -211
  4. package/dist/{EditSurface-Ce4bpuvh.cjs → EditSurface-CZnjX0sv.cjs} +2 -2
  5. package/dist/{ExplorerSplit-DKpqQBsQ.js → ExplorerSplit-DHpgdXhb.js} +407 -407
  6. package/dist/{ExplorerSplit-DBUFhlo_.cjs → ExplorerSplit-DWBhCe7m.cjs} +1 -1
  7. package/dist/{MultiLayout-BfGxy2pf.cjs → MultiLayout-BkHbfUuh.cjs} +1 -1
  8. package/dist/{MultiLayout-CVj5iam0.js → MultiLayout-HmvjE8ht.js} +3 -3
  9. package/dist/{NativeScrollBar-BQpaWt45.cjs → NativeScrollBar-CzGhZ-w3.cjs} +1 -1
  10. package/dist/{NativeScrollBar-BkZPkphH.js → NativeScrollBar-DAukiH01.js} +2 -2
  11. package/dist/{TreeLayout-Df4HLMP-.cjs → TreeLayout-BEvPaxLb.cjs} +1 -1
  12. package/dist/{TreeLayout-B83wJ2CL.js → TreeLayout-dtnugwQ7.js} +3 -3
  13. package/dist/core/config.d.cts +3 -0
  14. package/dist/core/config.d.ts +3 -0
  15. package/dist/core/geometry.d.cts +0 -1
  16. package/dist/core/geometry.d.ts +0 -1
  17. package/dist/{explorerCore-EkU0mwdW.js → explorerCore-CUtc1Vmx.js} +1 -1
  18. package/dist/{explorerCore-DivWkFQF.cjs → explorerCore-Dj7RxZRd.cjs} +1 -1
  19. package/dist/{index-CVnGqEmh.js → index-BBJoJu-b.js} +13 -12
  20. package/dist/{index-Bz-n0dl1.cjs → index-D6at9qMs.cjs} +6 -6
  21. package/dist/index.cjs +1 -1
  22. package/dist/index.js +15 -15
  23. package/dist/location-DFXJSMit.cjs +1 -0
  24. package/dist/{location-Dh6K-y7w.js → location-T9o5XYpX.js} +245 -241
  25. package/dist/{merge-BGr72noP.js → merge-CkMe5hqA.js} +1 -1
  26. package/dist/{merge-hFiGx_ND.cjs → merge-XyuOlVWP.cjs} +1 -1
  27. package/dist/server.cjs +1 -1
  28. package/dist/server.js +3 -3
  29. package/dist/serverCore.cjs +1 -1
  30. package/dist/serverCore.js +3 -3
  31. package/dist/styles/markdown-explorer.css +1 -1
  32. package/dist/{tapScrollCircle-BTCGTQ8T.js → tapScrollCircle-CvWJKtbF.js} +1 -1
  33. package/dist/{tapScrollCircle-DDwYa54Q.cjs → tapScrollCircle-ExxyHVWY.cjs} +1 -1
  34. package/dist/{useSplitPersistence-BUa_KMsV.cjs → useSplitPersistence-BCitqdAe.cjs} +1 -1
  35. package/dist/{useSplitPersistence-pnb21dsr.js → useSplitPersistence-C86jW1yY.js} +1 -1
  36. package/package.json +6 -6
  37. package/dist/location-DrOP6t1F.cjs +0 -1
package/CHANGELOG.md CHANGED
@@ -1,6 +1,68 @@
1
1
  # Changelog
2
2
 
3
- ## Unreleased
3
+ ## 0.39.0 (2026-11-16) — A 44 px resize divider, prose line heights and an opt-in document floor (WCAG 2.2); the auth-core peer floor rises to ^0.9.0
4
+
5
+ ### Breaking
6
+
7
+ - **The `@aiquants/auth-core` peer floor rises from `^0.8.0` to `^0.9.0`.** auth-core 0.9.0's access-failure policy now
8
+ requires `signedIn`: a policy is `{ signedIn: true; keepsWork: boolean }` or `{ signedIn: false; keepsWork: false }`, and
9
+ `accessFailureView` throws a `RangeError` on `signedIn: false` with `keepsWork: true` (a policy without a sign-in cannot
10
+ keep work). Hosts that pass a policy to `accessFailureView` must add `signedIn` — `signedIn: true` for the explorer,
11
+ which keeps the reader's unsaved drafts — so the demo and README examples now pass `{ signedIn: true, keepsWork: true }`.
12
+
13
+ ### Added
14
+
15
+ - **An opt-in `--aqmx-document-min-block-size` floor for the single view's document scroll box (WCAG 2.2 1.4.10).** The
16
+ neutral token (default `0px`, the host writes it) sets the `min-block-size` of the single view's document scroll boxes
17
+ (the viewer, `DocumentScrollArea` and the editor's preview), which also `contain: size` so a tall document does not
18
+ stretch them. It is a scroll-box minimum, not a page-growth mechanism: the explorer root is `block-size: 100%` (it
19
+ fills the host's container), so a host that wants the floor to show must size the explorer's container to at least the
20
+ bar plus the floor — a shorter container clips the floored box. §6.2's `F_d` is `calc(5 * 1rem * φ)`, the golden ratio
21
+ φ (≈ 129.4 px at a 16 px root).
22
+
23
+ ### Changed
24
+
25
+ - **The explorer/content resize divider is a 44 px hit band under every pointer (WCAG 2.2 2.5.5).** `ExplorerSplit` and
26
+ `EditSplit` size the handle to `COARSE_TARGET_PIXELS` (44 px, one control) for every pointer, not 24 px for a fine
27
+ pointer; the visible grip is unchanged and the band insets its neighbours by half its width (22 px), so it covers
28
+ neither the tree's scroll bar nor the content's edge. The edit split's side-by-side threshold rises by 20 px to match,
29
+ and `FINE_TARGET_PIXELS` is gone.
30
+ - **Multi-line text blocks take the prose line height (WCAG 2.2 1.4.8).** Notices, failure sentences, toasts, the tree
31
+ and edit messages and the dialog bodies use `--aqmx-line-height-prose` (the golden ratio φ ≈ 1.618); single-line
32
+ controls, titles and bars keep the compact `1.382`.
33
+
34
+ ### Tests
35
+
36
+ - The target-size E2E no longer exempts the resize divider (it measures 44 × 44), and the divider threshold tests assert
37
+ 44 px under every pointer. A new `document-floor` E2E checks, in a window too short to hold it, that the floor holds the
38
+ single view's document scroll box at `F_d` and that the default `0px` leaves it collapsed.
39
+
40
+ ## 0.38.0 (2026-11-16) — A config option names the mermaid pan and zoom modifier key
41
+
42
+ ### Added
43
+
44
+ - **`mermaidModifier` config option for the mermaid pan and zoom modifier key.** `defineExplorerConfig` now takes
45
+ `mermaidModifier?: "ctrl" | "shift"` and passes it through to `@aiquants/markdown`'s viewer, so a plain mouse drag
46
+ stays for text selection and node clicks and only a drag or wheel held with the modifier pans and zooms the diagram.
47
+ Omitted or `undefined`, the value is passed through unchanged and the viewer applies its own
48
+ `DEFAULT_PAN_ZOOM_MODIFIER` (`"ctrl"`), keeping the default's single source of truth in the viewer; a value that is
49
+ not `"ctrl"` or `"shift"` throws a `RangeError` naming them. The package ships this as a component option with no UI
50
+ of its own — a host app surfaces the choice in its own settings — and the diagram's mode labels take the viewer's
51
+ neutral form (`"修飾キー+ドラッグ"` / `"modifier+drag"`) so the app names the key.
52
+
53
+ ### Changed
54
+
55
+ - **The `@aiquants/markdown` peer floor rises from `^13.0.0` to `^13.3.0`.** The pass-through needs 13.3.0's
56
+ `PanZoomModifier` type, the viewer's `mermaidModifier` prop and the neutral mermaid mode labels.
57
+
58
+ ### Tests
59
+
60
+ - `tests/unit/settings.test.ts`: `defineExplorerConfig` resolves `"ctrl"` and `"shift"` to themselves and an omitted
61
+ or `undefined` `mermaidModifier` to `undefined` (the viewer applies its default), and rejects a value that is not one
62
+ of them with a `RangeError`; `revalidateExplorerConfig` round-trips `"shift"` and rejects `"alt"`; the sorted option
63
+ keys and the options string include `mermaidModifier`.
64
+
65
+ ## 0.37.1 (2026-11-15) — Access failures: a 401 keeps the page and the reader's work, and each failure gets its own node
4
66
 
5
67
  ### Fixed
6
68
 
package/README.md CHANGED
@@ -50,7 +50,7 @@ A single-view (embedding) page never downloads the tree and multi-panel views, w
50
50
 
51
51
  - React 19.2.7 or later and React Router 8 in framework mode (route modules with `loader` / `headers`).
52
52
  - 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)`.
53
- - The peer packages, at these versions or later within the caret ranges the package declares: `@aiquants/auth-core` ^0.8.0 (the access failure contract: the occurrence the host's presenter draws, and the 403 refusal of the page loader, `accessFailureResponse`), `@aiquants/markdown` ^13.0.0 (document rendering;
53
+ - The peer packages, at these versions or later within the caret ranges the package declares: `@aiquants/auth-core` ^0.9.0 (the access failure contract: the occurrence the host's presenter draws, and the 403 refusal of the page loader, `accessFailureResponse`), `@aiquants/markdown` ^13.3.0 (document rendering;
54
54
  the column width and colour pair a reader picks in its display popover (`CONTENT_MEASURES` and `CONTENT_COLORS` of `@aiquants/markdown/viewer-settings`) and the labels of the popover's sections and of a diagram's notices, a document's language for its content (`contentLang`) apart from the UI language of the labels the explorer passes (`labelsLang`), and the size of a document table's tap-scroll circle (`spreadsheetTapScrollCircle`'s `size`);
55
55
  the gutter its scroll container keeps beside the explorer's bar for the tap-scroll circle (`scrollBarGutter`, given as a custom property that a media query sets), code blocks whose Copy button sits in a header row above the code, and documents whose front matter does not render; 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;
56
56
  the full screen of its tables, Mermaid diagrams and SVG images, which every block marks with the same DOM hook (`data-aqmd-fullscreen`), and `DEFAULT_MARKDOWN_STYLE`, the style a document starts in by default; its components' stylesheet without utilities,
@@ -115,6 +115,7 @@ The source ids are not part of it: they are the ids of the server's `sources` (a
115
115
  | `revealDocument?` | `{ maxDepth? }` | The deepest document whose folders the reader's "Reveal the open document" setting opens, counted in folders between the source's top level and the document (1–64, default 16, `REVEAL_DOCUMENT_DEPTH_LIMITS`); a deeper document is not revealed. Each folder of the chain takes at most one listing, so this also bounds a reveal's listings. The field defaults on its own, also when given as `undefined`; an unknown key throws a `RangeError`, anything but a plain object a `TypeError` (see [Revealing the open document](#revealing-the-open-document)). |
116
116
  | `documentStyles?` | `readonly { name, className }[]` | Document styles, in the order the style section of the viewer's display popover lists them; `@aiquants/markdown`'s `DEFAULT_MARKDOWN_STYLES` (None, GitHub, Zenn; also exported without React from `@aiquants/markdown/viewer-settings`) when omitted. |
117
117
  | `defaultDocumentStyle?` | `string` | The style a document starts in while neither the URL (`style`) nor the reader's saved preference names one: the name of one of `documentStyles`, matched exactly (`"zenn"` is not `"Zenn"`). `@aiquants/markdown`'s `DEFAULT_MARKDOWN_STYLE` (`"Zenn"`, also exported from `@aiquants/markdown/viewer-settings`) when omitted, also when given as `undefined`; it never falls back to the first style, so a host whose `documentStyles` leave Zenn out names its own, or the configuration throws. A name that is not one of `documentStyles` throws a `RangeError` naming the styles, and anything but a string a `TypeError`. |
118
+ | `mermaidModifier?` | `PanZoomModifier` | The modifier key that gates a mermaid diagram's pan and zoom with the mouse (drag and wheel), so a plain drag still selects text and clicks nodes: `"ctrl"` or `"shift"`. The explorer passes it through to `@aiquants/markdown`'s viewer, which gates on it and keeps the diagram's mode label neutral so the app names the key in its own setting; the viewer applies `DEFAULT_PAN_ZOOM_MODIFIER` (`"ctrl"`) when this is omitted or `undefined`. A value that is not `"ctrl"` or `"shift"` throws a `RangeError` naming them. |
118
119
  | `iframeHosts?` | `readonly string[]` | Host names whose `https:` iframes written in documents may load (exact match); none when omitted. They gate only iframes written in documents; provider frames come from `embeds`, and no iframe of the page's own origin ever renders, whatever is listed. |
119
120
  | `appOrigins?` | `readonly string[]` | The origins the app's own pages are served from, as the browser writes them (`scheme://host[:port]`, such as `http://wails.localhost` or `wails://localhost`): a document's absolute URL of one of them is the app's own, like a relative or path-absolute one, and stays only under the paths its use allows (see [Security](docs/behavior/security.md#html)). None by default. |
120
121
  | `mediaDataPath?` | `string` | An absolute `http:` or `https:` URL, of an origin and a mount path, that the asset URLs of videos, audio and PDF documents are built on instead of the data route (a separate media server's data route, for example); a document's `video`, `audio` and `source` may then use it too. None by default (see [Hosting](docs/behavior/hosting.md#the-apps-own-urls-apporigins-and-mediadatapath)). |
@@ -241,7 +242,7 @@ const follow = (action: AccessFailureAction, retry: (() => void) | null): void =
241
242
 
242
243
  // The explorer keeps the reader's unsaved drafts in the page, so it keeps work.
243
244
  export const presentAccessFailure: AccessFailurePresenter<ReactNode> = (occurrence) => {
244
- const view = accessFailureView(occurrence, { keepsWork: true }, labels)
245
+ const view = accessFailureView(occurrence, { signedIn: true, keepsWork: true }, labels)
245
246
  return (
246
247
  <div role={view.politeness}>
247
248
  <p>{view.title}</p>