seemore 1.10.0 → 1.10.2

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/README.md CHANGED
@@ -61,7 +61,7 @@ And whichever preview is open, the page is also an editor: **double-click any pa
61
61
  ## Who is seemore for?
62
62
 
63
63
  <p align="center">
64
- <video src="https://github.com/user-attachments/assets/8142fcb4-2a1f-4e48-82b5-059a28fc0cf2" width="640" controls muted></video>
64
+ <video src="https://github.com/user-attachments/assets/248032a6-7e25-4f9f-8d73-089b5302afb0" width="640" controls muted></video>
65
65
  </p>
66
66
 
67
67
  Typical use cases include:
@@ -72,6 +72,7 @@ Typical use cases include:
72
72
  - **Project documentation** — READMEs, architecture docs, RFCs, API documentation, specifications and engineering handbooks.
73
73
  - **Documentation review** — read rendered pages instead of raw Markdown while making fixes directly from the preview.
74
74
  - **Static documentation sites** — publish the same Markdown with `seemore build` instead of maintaining a separate documentation stack.
75
+ - **Sharing a single page** — export one page as a self-contained HTML file to drop in Slack or email, no site or server needed.
75
76
 
76
77
  ## Features
77
78
 
@@ -79,12 +80,12 @@ Typical use cases include:
79
80
  - **Live preview** — add, rename, retitle or delete a file and the site updates immediately, navigation and search included
80
81
  - **Edit in place** — double-click any block in the preview to fix its Markdown; saves are surgical, so `git diff` shows the sentence you changed and nothing else
81
82
  - **Full MDX** — when Markdown isn't enough, `.mdx` pages take real JSX: your own React components, inline SVG, custom classes and CSS; `<Callout>`, `<Card>`, `<CodeBlockTabs>` and friends come built in, with no imports to write
82
- - **Static export** — `seemore build` prerenders every page to its own HTML file, `404.html` included, and adds the conventions individual hosts look for (`_redirects`, `200.html`, `.nojekyll`)
83
- - **Search built in** — static, zero-setup full-text search out of the box, with shareable highlighted results; [Algolia](https://algolia.com) and [Orama Cloud](https://orama.com) for hosted indexes
84
- - **Page actions** — an Actions button on every page: copy the page as Markdown, or export it as one self-contained HTML file, with the CLI equivalent in `seemore export <file>`
83
+ - **Static export** — `seemore build` prerenders the whole site to HTML, `404.html` included, ready to deploy anywhere, with the conventions individual hosts look for (`_redirects`, `200.html`, `.nojekyll`)
84
+ - **Page actions** — an Actions button on every page: copy the page as Markdown, or export it as one self-contained HTML file to share on its own — Slack, email, a USB stick, no server needed — with the CLI equivalent in `seemore export <file>`
85
85
  - **12 themes** — dark and light follow the system, with a toggle that remembers your choice; your own CSS always wins
86
86
  - **Rich Markdown** — GitHub Flavoured Markdown, admonitions, steps, `[[wikilinks]]`, [Mermaid](https://mermaid.js.org) and [D2](https://d2lang.com) diagrams, click-to-zoom images, embedded PDFs
87
87
  - **Editor integration** — one extension covers VS Code, Cursor, Antigravity and other VS Code-compatible editors, remote workspaces included
88
+ - **Search built in** — static, zero-setup full-text search out of the box, with shareable highlighted results; [Algolia](https://algolia.com) and [Orama Cloud](https://orama.com) for hosted indexes
88
89
 
89
90
  ## View in your browser
90
91
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "seemore",
3
- "version": "1.10.0",
3
+ "version": "1.10.2",
4
4
  "description": "Let AI write the Markdown. Let seemore show it better — zero config documentation framework.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -237,11 +237,14 @@ function escapeHtml(text: string): string {
237
237
  }
238
238
 
239
239
  /**
240
- * The exported file's runtime: theme toggle, code copy, click-to-zoom — the three behaviors
241
- * kept, at roughly a kilobyte instead of the site bundle. Handed to React in hydration on
242
- * the live page; here each is three lines against the static DOM.
240
+ * The exported file's runtime: theme toggle, code copy, heading anchor copy, click-to-zoom —
241
+ * the behaviors kept, at roughly a kilobyte instead of the site bundle. Handed to React in
242
+ * hydration on the live page; here each is a few lines against the static DOM.
243
243
  *
244
244
  * Kept free of `</script>`-shaped sequences by construction: it is inlined verbatim.
245
+ *
246
+ * `standalone.ts`'s `bindBehaviors` is a hand-written twin of this string (see its file
247
+ * header) — any behavior added or changed here needs the same change made there.
245
248
  */
246
249
  const RUNTIME = `(function () {
247
250
  var root = document.documentElement;
@@ -260,6 +263,23 @@ const RUNTIME = `(function () {
260
263
  });
261
264
  });
262
265
 
266
+ document.querySelectorAll('button[aria-label="Copy Anchor Link"]').forEach(function (button) {
267
+ var heading = button.closest('h1, h2, h3, h4, h5, h6');
268
+ var svg = button.querySelector('svg');
269
+ if (!heading || !heading.id || !navigator.clipboard) return;
270
+ var revert;
271
+ button.addEventListener('click', function () {
272
+ var url = new URL(window.location.href);
273
+ url.hash = heading.id;
274
+ navigator.clipboard.writeText(url.href);
275
+ if (!svg) return;
276
+ clearTimeout(revert);
277
+ var original = svg.innerHTML;
278
+ svg.innerHTML = '<polyline points="20 6 9 17 4 12"></polyline>';
279
+ revert = setTimeout(function () { svg.innerHTML = original; }, 1500);
280
+ });
281
+ });
282
+
263
283
  // The live site's TOC follows the reader with fumadocs' own scroll tracking; in the file,
264
284
  // the plainest version of the same behaviour — last heading above the fold wins.
265
285
  var tocLinks = [].slice.call(document.querySelectorAll('.seemore-export-toc a'));
@@ -285,7 +305,7 @@ const RUNTIME = `(function () {
285
305
 
286
306
  // Wide enough for the rail: open the collapsible so it reads as a list, not a disclosure.
287
307
  var tocDetails = document.querySelector('.seemore-export-toc details');
288
- if (tocDetails && window.matchMedia('(min-width: 1400px)').matches) tocDetails.open = true;
308
+ if (tocDetails && window.matchMedia('(min-width: 1440px)').matches) tocDetails.open = true;
289
309
 
290
310
  var main = document.querySelector('main');
291
311
  var overlay = document.createElement('div');
@@ -10,7 +10,8 @@
10
10
  *
11
11
  * The browser export ships a hand-written twin of the behavior half (the `RUNTIME` string
12
12
  * in `exportPage.ts`): it needs no diagram half, because its diagrams are already SVG when
13
- * the export runs. Keep the two in sync.
13
+ * the export runs. Keep the two in sync — adding, removing or changing a behavior in one
14
+ * `bindBehaviors`/`RUNTIME` requires the identical change in the other.
14
15
  */
15
16
 
16
17
  const isDark = (): boolean => document.documentElement.classList.contains('dark');
@@ -78,6 +79,23 @@ function bindBehaviors(): void {
78
79
  });
79
80
  }
80
81
 
82
+ for (const button of document.querySelectorAll('button[aria-label="Copy Anchor Link"]')) {
83
+ const heading = button.closest('h1, h2, h3, h4, h5, h6');
84
+ const svg = button.querySelector('svg');
85
+ if (heading === null || heading.id === '' || navigator.clipboard === undefined) continue;
86
+ let revert: ReturnType<typeof setTimeout> | undefined;
87
+ button.addEventListener('click', () => {
88
+ const url = new URL(window.location.href);
89
+ url.hash = heading.id;
90
+ void navigator.clipboard.writeText(url.href);
91
+ if (svg === null) return;
92
+ clearTimeout(revert);
93
+ const original = svg.innerHTML;
94
+ svg.innerHTML = '<polyline points="20 6 9 17 4 12"></polyline>';
95
+ revert = setTimeout(() => { svg.innerHTML = original; }, 1500);
96
+ });
97
+ }
98
+
81
99
  // The live site's TOC follows the reader with fumadocs' own scroll tracking; in the file,
82
100
  // the plainest version of the same behaviour — last heading above the fold wins.
83
101
  const tocLinks = Array.from(document.querySelectorAll<HTMLAnchorElement>('.seemore-export-toc a'));
@@ -106,7 +124,7 @@ function bindBehaviors(): void {
106
124
 
107
125
  // Wide enough for the rail: open the collapsible so it reads as a list, not a disclosure.
108
126
  const tocDetails = document.querySelector<HTMLDetailsElement>('.seemore-export-toc details');
109
- if (tocDetails && window.matchMedia('(min-width: 1400px)').matches) tocDetails.open = true;
127
+ if (tocDetails && window.matchMedia('(min-width: 1440px)').matches) tocDetails.open = true;
110
128
 
111
129
  const overlay = document.createElement('div');
112
130
  overlay.className = 'seemore-export-overlay';
@@ -622,11 +622,17 @@
622
622
  color: var(--color-fd-foreground, #111827);
623
623
  }
624
624
 
625
- /* From 1400px up there is room for both the reading column and the rail side by side;
626
- below that the rail would ride over the text, so the collapsible stays in flow. */
627
- @media (min-width: 1400px) {
625
+ /* From 1440px up there is room for both the reading column and the rail side by side;
626
+ below that the rail would ride over the text, so the collapsible stays in flow.
627
+
628
+ The rail's `inset-inline-end` is pinned to the article's own centring math (its
629
+ 56rem/2 half-width) rather than a flat viewport offset, so the gap between the
630
+ article's right edge and the rail stays a fixed 2rem at any width above the
631
+ breakpoint — matching the live page's `md:px-8` column padding — instead of shrinking
632
+ toward zero as the viewport narrows toward the breakpoint. */
633
+ @media (min-width: 1440px) {
628
634
  .seemore-export-toc {
629
- inset-inline-end: 2rem;
635
+ inset-inline-end: calc((100vw - 56rem) / 2 - 14rem - 2rem);
630
636
  margin-block: 0;
631
637
  max-height: calc(100vh - 8rem);
632
638
  overflow-y: auto;