@farming-labs/nuxt-theme 0.0.9-beta.1 → 0.0.10

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@farming-labs/nuxt-theme",
3
- "version": "0.0.9-beta.1",
3
+ "version": "0.0.10",
4
4
  "description": "Nuxt/Vue UI components for @farming-labs/docs — layout, sidebar, TOC, search, and theme toggle",
5
5
  "keywords": [
6
6
  "docs",
@@ -60,7 +60,7 @@
60
60
  },
61
61
  "dependencies": {
62
62
  "sugar-high": "^0.9.5",
63
- "@farming-labs/docs": "0.0.9-beta.1"
63
+ "@farming-labs/docs": "0.0.10"
64
64
  },
65
65
  "peerDependencies": {
66
66
  "nuxt": ">=3.0.0",
@@ -56,7 +56,16 @@ function wireInteractive() {
56
56
  .replace(/>/g, ">")
57
57
  .replace(/"/g, '"');
58
58
  if (!code) return;
59
+ const block = btn.closest(".fd-codeblock");
60
+ const title = block?.querySelector(".fd-codeblock-title-text")?.textContent?.trim() ?? undefined;
61
+ const language = block?.getAttribute("data-language") ?? undefined;
62
+ const url = typeof window !== "undefined" ? window.location.href : "";
63
+ const data = { title, content: code, url, language };
59
64
  navigator.clipboard.writeText(code).then(() => {
65
+ try {
66
+ if (typeof window !== "undefined" && (window as any).__fdOnCopyClick__) (window as any).__fdOnCopyClick__(data);
67
+ if (typeof window !== "undefined") window.dispatchEvent(new CustomEvent("fd:code-block-copy", { detail: data }));
68
+ } catch (_) {}
60
69
  btn.classList.add("fd-copy-btn-copied");
61
70
  btn.innerHTML =
62
71
  '<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"/></svg>';