seemore 1.1.1 → 1.1.3

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
@@ -131,7 +131,7 @@ export default defineConfig({
131
131
  nav: [{ text: 'GitHub', link: 'https://github.com/you/repo' }],
132
132
  footer: { text: '© 2026' },
133
133
  editLink: { base: 'https://github.com/you/repo/edit/main/docs' },
134
- search: 'static',
134
+ search: 'static', // or { provider: 'orama-cloud', endpoint, apiKey } / { provider: 'algolia', appId, apiKey, indexName }
135
135
  exclude: ['drafts/**'],
136
136
  });
137
137
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "seemore",
3
- "version": "1.1.1",
3
+ "version": "1.1.3",
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",
@@ -19,6 +19,7 @@ import { Header } from './Header.js';
19
19
  import { Sidebar } from './Sidebar.js';
20
20
  import { Breadcrumb } from './Breadcrumb.js';
21
21
  import { BackToTop, PageFooter, SiteFooter } from './Footer.js';
22
+ import { SelectionCopyButton } from './SelectionCopyButton.js';
22
23
  import { IntegratedToc, Toc, TocProvider } from './Toc.js';
23
24
 
24
25
  /**
@@ -82,6 +83,7 @@ export function DocPage({ entry }: { entry: RouteEntry }) {
82
83
 
83
84
  {feature('navigation.top') ? <BackToTop /> : undefined}
84
85
  <PagePreview />
86
+ <SelectionCopyButton />
85
87
  </div>
86
88
  </TocProvider>
87
89
  );
@@ -0,0 +1,56 @@
1
+ import { useEffect, useState } from 'react';
2
+
3
+ /**
4
+ * A floating "Copy" button that appears over the current text selection.
5
+ *
6
+ * Only matters embedded in the VS Code extension's webview: the page runs there inside a
7
+ * nested, cross-origin iframe, and the workbench's own Ctrl+C/Cmd+C handling never reaches a
8
+ * selection made inside it. A click does — but the write itself still can't happen here:
9
+ * VS Code webviews deny the Clipboard API to embedded content regardless of how it's
10
+ * triggered, so the click instead posts the selected text up to the extension host (see
11
+ * `panelHtml.ts`/`panel.ts`), which is the only side actually allowed to touch the OS
12
+ * clipboard (`vscode.env.clipboard`). A plain browser tab already has native copy and is
13
+ * never embedded this way, so this renders nothing there.
14
+ */
15
+ export function SelectionCopyButton() {
16
+ const [rect, setRect] = useState<DOMRect>();
17
+ const [copied, setCopied] = useState(false);
18
+
19
+ useEffect(() => {
20
+ if (window.parent === window) return;
21
+
22
+ function onSelectionChange() {
23
+ const selection = window.getSelection();
24
+ if (selection === null || selection.isCollapsed || selection.toString().trim() === '') {
25
+ setRect(undefined);
26
+ return;
27
+ }
28
+ setRect(selection.getRangeAt(0).getBoundingClientRect());
29
+ setCopied(false);
30
+ }
31
+
32
+ document.addEventListener('selectionchange', onSelectionChange);
33
+ return () => document.removeEventListener('selectionchange', onSelectionChange);
34
+ }, []);
35
+
36
+ if (rect === undefined) return undefined;
37
+
38
+ return (
39
+ <button
40
+ type="button"
41
+ className="seemore-selection-copy"
42
+ style={{ top: Math.max(rect.top - 36, 8), left: rect.left }}
43
+ // A button's default mousedown behaviour collapses whatever is currently selected
44
+ // before the click ever fires — this is what keeps the selection alive through it.
45
+ onMouseDown={(event) => event.preventDefault()}
46
+ onClick={() => {
47
+ const text = window.getSelection()?.toString() ?? '';
48
+ if (text === '') return;
49
+ window.parent.postMessage({ type: 'seemore:copy', text }, '*');
50
+ setCopied(true);
51
+ }}
52
+ >
53
+ {copied ? 'Copied' : 'Copy'}
54
+ </button>
55
+ );
56
+ }
@@ -244,6 +244,10 @@
244
244
  @apply fixed bottom-6 end-6 inline-flex items-center gap-2 rounded-full border border-fd-border bg-fd-background px-4 py-2 text-sm shadow;
245
245
  }
246
246
 
247
+ .seemore-selection-copy {
248
+ @apply fixed z-50 rounded-md border border-fd-border bg-fd-popover px-2 py-1 text-xs font-medium shadow-lg;
249
+ }
250
+
247
251
  .seemore-preview {
248
252
  @apply pointer-events-none fixed z-50 max-h-80 w-[400px] overflow-hidden rounded-xl border border-fd-border bg-fd-popover p-4 text-sm shadow-lg;
249
253
  }