diff --git a/sites/docs/src/lib/components/docs/block-toolbar.svelte b/sites/docs/src/lib/components/docs/block-toolbar.svelte
index b2ef01807..538b336b5 100644
--- a/sites/docs/src/lib/components/docs/block-toolbar.svelte
+++ b/sites/docs/src/lib/components/docs/block-toolbar.svelte
@@ -5,25 +5,22 @@
import Smartphone from "lucide-svelte/icons/smartphone";
import Tablet from "lucide-svelte/icons/tablet";
import Terminal from "lucide-svelte/icons/terminal";
- import { getPackageManagerScriptCmd } from "$lib/utils.js";
import { Button } from "$lib/registry/new-york/ui/button/index.js";
import { Separator } from "$lib/registry/new-york/ui/separator/index.js";
import * as ToggleGroup from "$lib/registry/new-york/ui/toggle-group/index.js";
import type { Block } from "$lib/registry/schema.js";
import type { ResizablePane } from "$lib/registry/new-york/ui/resizable/index.js";
import { CopyToClipboard } from "$lib/utils/copy-to-clipboard.svelte.js";
- import { getPackageManager } from "$lib/stores/package-manager.js";
+ import { getCommand, getPackageManager } from "$lib/stores/package-manager.js";
let { block, resizablePaneRef }: { block: Block; resizablePaneRef: ResizablePane } = $props();
const copier = new CopyToClipboard();
const selectedPackageManager = getPackageManager();
- const addCommand = $derived.by(() => {
- const start = getPackageManagerScriptCmd($selectedPackageManager);
- const end = `shadcn-svelte@next add ${block.name}`;
- return start + " " + end;
- });
+ const addCommand = $derived(
+ getCommand($selectedPackageManager, "execute", `shadcn-svelte@next add ${block.name}`)
+ );
const blockSource = $derived(
`https://github.com/huntabyte/shadcn-svelte/tree/next/sites/docs/src/lib/registry/new-york/block/${block.name}`
@@ -40,7 +37,7 @@
class="bg-muted h-7 rounded-md border shadow-none"
size="sm"
onclick={() => {
- copier.copyToClipboard(addCommand);
+ copier.copyToClipboard(addCommand.command + " " + addCommand.args.join(" "));
}}
>
{#if copier.isCopied}
diff --git a/sites/docs/src/lib/components/docs/pm-block.svelte b/sites/docs/src/lib/components/docs/pm-block.svelte
index de9ad014f..79e1c2269 100644
--- a/sites/docs/src/lib/components/docs/pm-block.svelte
+++ b/sites/docs/src/lib/components/docs/pm-block.svelte
@@ -1,12 +1,7 @@