Skip to content

Commit

Permalink
fix: docs preview import paths (#810)
Browse files Browse the repository at this point in the history
  • Loading branch information
huntabyte authored Feb 24, 2024
1 parent 922ebb3 commit 4d9a200
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 11 deletions.
10 changes: 8 additions & 2 deletions apps/www/mdsx.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,10 +166,16 @@ export function rehypeComponentExample() {
const component = Index[style.name][name];
const src = component.files[0];
let sourceCode = getComponentSourceFileContent(src);
if (!sourceCode) return;
if (!sourceCode || sourceCode === null) return;

// @ts-expect-error - not dealing with this rn
sourceCode = sourceCode.replaceAll(
"@/registry/new-york/",
"$lib/components/"
);
// @ts-expect-error - not dealing with this rn
sourceCode = sourceCode.replaceAll(
`@/registry/${style.name}/`,
"@/registry/default/",
"$lib/components/"
);

Expand Down
4 changes: 3 additions & 1 deletion apps/www/static/registry/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,9 @@
},
{
"name": "resizable",
"dependencies": [],
"dependencies": [
"paneforge"
],
"registryDependencies": [],
"files": [
"ui/resizable/index.ts",
Expand Down
6 changes: 4 additions & 2 deletions apps/www/static/registry/styles/default-js/resizable.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"name": "resizable",
"dependencies": [],
"dependencies": [
"paneforge"
],
"registryDependencies": [],
"files": [
{
Expand All @@ -9,7 +11,7 @@
},
{
"name": "resizable-handle.svelte",
"content": "<script>\n\timport GripVertical from \"lucide-svelte/icons/grip-vertical\";\n\timport * as ResizablePrimitive from \"paneforge\";\n\timport { cn } from \"$lib/utils\";\n\texport let withHandle = false;\n\texport let el = undefined;\n\tlet className = undefined;\n\texport { className as class };\n</script>\n\n<ResizablePrimitive.PaneResizer\n\tbind:el\n\tclass={cn(\n\t\t\"bg-border focus-visible:ring-ring relative flex w-px items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-offset-1 data-[direction=vertical]:h-px data-[direction=vertical]:w-full data-[direction=vertical]:after:left-0 data-[direction=vertical]:after:h-1 data-[direction=vertical]:after:w-full data-[direction=vertical]:after:-translate-y-1/2 data-[direction=vertical]:after:translate-x-0 [&[data-direction=vertical]>div]:rotate-90\",\n\t\tclassName\n\t)}\n>\n\t{#if withHandle}\n\t\t<div class=\"bg-border z-10 flex h-4 w-3 items-center justify-center rounded-sm border\">\n\t\t\t<GripVertical class=\"h-2.5 w-2.5\" />\n\t\t</div>\n\t{/if}\n</ResizablePrimitive.PaneResizer>\n"
"content": "<script>\n\timport GripVertical from \"lucide-svelte/icons/grip-vertical\";\n\timport * as ResizablePrimitive from \"paneforge\";\n\timport { cn } from \"$lib/utils\";\n\texport let withHandle = false;\n\texport let el = undefined;\n\tlet className = undefined;\n\texport { className as class };\n</script>\n\n<ResizablePrimitive.PaneResizer\n\tbind:el\n\tclass={cn(\n\t\t\"relative flex w-px items-center justify-center bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 data-[direction=vertical]:h-px data-[direction=vertical]:w-full data-[direction=vertical]:after:left-0 data-[direction=vertical]:after:h-1 data-[direction=vertical]:after:w-full data-[direction=vertical]:after:-translate-y-1/2 data-[direction=vertical]:after:translate-x-0 [&[data-direction=vertical]>div]:rotate-90\",\n\t\tclassName\n\t)}\n>\n\t{#if withHandle}\n\t\t<div class=\"z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border\">\n\t\t\t<GripVertical class=\"h-2.5 w-2.5\" />\n\t\t</div>\n\t{/if}\n</ResizablePrimitive.PaneResizer>\n"
},
{
"name": "resizable-pane-group.svelte",
Expand Down
6 changes: 4 additions & 2 deletions apps/www/static/registry/styles/default/resizable.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"name": "resizable",
"dependencies": [],
"dependencies": [
"paneforge"
],
"registryDependencies": [],
"files": [
{
Expand All @@ -9,7 +11,7 @@
},
{
"name": "resizable-handle.svelte",
"content": "<script lang=\"ts\">\n\timport GripVertical from \"lucide-svelte/icons/grip-vertical\";\n\timport * as ResizablePrimitive from \"paneforge\";\n\timport { cn } from \"$lib/utils\";\n\n\ttype $$Props = ResizablePrimitive.PaneResizerProps & {\n\t\twithHandle?: boolean;\n\t};\n\n\texport let withHandle: $$Props[\"withHandle\"] = false;\n\texport let el: $$Props[\"el\"] = undefined;\n\tlet className: $$Props[\"class\"] = undefined;\n\texport { className as class };\n</script>\n\n<ResizablePrimitive.PaneResizer\n\tbind:el\n\tclass={cn(\n\t\t\"bg-border focus-visible:ring-ring relative flex w-px items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-offset-1 data-[direction=vertical]:h-px data-[direction=vertical]:w-full data-[direction=vertical]:after:left-0 data-[direction=vertical]:after:h-1 data-[direction=vertical]:after:w-full data-[direction=vertical]:after:-translate-y-1/2 data-[direction=vertical]:after:translate-x-0 [&[data-direction=vertical]>div]:rotate-90\",\n\t\tclassName\n\t)}\n>\n\t{#if withHandle}\n\t\t<div class=\"bg-border z-10 flex h-4 w-3 items-center justify-center rounded-sm border\">\n\t\t\t<GripVertical class=\"h-2.5 w-2.5\" />\n\t\t</div>\n\t{/if}\n</ResizablePrimitive.PaneResizer>\n"
"content": "<script lang=\"ts\">\n\timport GripVertical from \"lucide-svelte/icons/grip-vertical\";\n\timport * as ResizablePrimitive from \"paneforge\";\n\timport { cn } from \"$lib/utils\";\n\n\ttype $$Props = ResizablePrimitive.PaneResizerProps & {\n\t\twithHandle?: boolean;\n\t};\n\n\texport let withHandle: $$Props[\"withHandle\"] = false;\n\texport let el: $$Props[\"el\"] = undefined;\n\tlet className: $$Props[\"class\"] = undefined;\n\texport { className as class };\n</script>\n\n<ResizablePrimitive.PaneResizer\n\tbind:el\n\tclass={cn(\n\t\t\"relative flex w-px items-center justify-center bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 data-[direction=vertical]:h-px data-[direction=vertical]:w-full data-[direction=vertical]:after:left-0 data-[direction=vertical]:after:h-1 data-[direction=vertical]:after:w-full data-[direction=vertical]:after:-translate-y-1/2 data-[direction=vertical]:after:translate-x-0 [&[data-direction=vertical]>div]:rotate-90\",\n\t\tclassName\n\t)}\n>\n\t{#if withHandle}\n\t\t<div class=\"z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border\">\n\t\t\t<GripVertical class=\"h-2.5 w-2.5\" />\n\t\t</div>\n\t{/if}\n</ResizablePrimitive.PaneResizer>\n"
},
{
"name": "resizable-pane-group.svelte",
Expand Down
6 changes: 4 additions & 2 deletions apps/www/static/registry/styles/new-york-js/resizable.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"name": "resizable",
"dependencies": [],
"dependencies": [
"paneforge"
],
"registryDependencies": [],
"files": [
{
Expand All @@ -9,7 +11,7 @@
},
{
"name": "resizable-handle.svelte",
"content": "<script>\n\timport DragHandleDots2 from \"svelte-radix/DragHandleDots2.svelte\";\n\timport * as ResizablePrimitive from \"paneforge\";\n\timport { cn } from \"$lib/utils\";\n\texport let withHandle = false;\n\texport let el = undefined;\n\tlet className = undefined;\n\texport { className as class };\n</script>\n\n<ResizablePrimitive.PaneResizer\n\tbind:el\n\tclass={cn(\n\t\t\"bg-border focus-visible:ring-ring relative flex w-px items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-offset-1 data-[direction=vertical]:h-px data-[direction=vertical]:w-full data-[direction=vertical]:after:left-0 data-[direction=vertical]:after:h-1 data-[direction=vertical]:after:w-full data-[direction=vertical]:after:-translate-y-1/2 data-[direction=vertical]:after:translate-x-0 [&[data-direction=vertical]>div]:rotate-90\",\n\t\tclassName\n\t)}\n>\n\t{#if withHandle}\n\t\t<div class=\"bg-border z-10 flex h-4 w-3 items-center justify-center rounded-sm border\">\n\t\t\t<DragHandleDots2 class=\"h-2.5 w-2.5\" />\n\t\t</div>\n\t{/if}\n</ResizablePrimitive.PaneResizer>\n"
"content": "<script>\n\timport DragHandleDots2 from \"svelte-radix/DragHandleDots2.svelte\";\n\timport * as ResizablePrimitive from \"paneforge\";\n\timport { cn } from \"$lib/utils\";\n\texport let withHandle = false;\n\texport let el = undefined;\n\tlet className = undefined;\n\texport { className as class };\n</script>\n\n<ResizablePrimitive.PaneResizer\n\tbind:el\n\tclass={cn(\n\t\t\"relative flex w-px items-center justify-center bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 data-[direction=vertical]:h-px data-[direction=vertical]:w-full data-[direction=vertical]:after:left-0 data-[direction=vertical]:after:h-1 data-[direction=vertical]:after:w-full data-[direction=vertical]:after:-translate-y-1/2 data-[direction=vertical]:after:translate-x-0 [&[data-direction=vertical]>div]:rotate-90\",\n\t\tclassName\n\t)}\n>\n\t{#if withHandle}\n\t\t<div class=\"z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border\">\n\t\t\t<DragHandleDots2 class=\"h-2.5 w-2.5\" />\n\t\t</div>\n\t{/if}\n</ResizablePrimitive.PaneResizer>\n"
},
{
"name": "resizable-pane-group.svelte",
Expand Down
6 changes: 4 additions & 2 deletions apps/www/static/registry/styles/new-york/resizable.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"name": "resizable",
"dependencies": [],
"dependencies": [
"paneforge"
],
"registryDependencies": [],
"files": [
{
Expand All @@ -9,7 +11,7 @@
},
{
"name": "resizable-handle.svelte",
"content": "<script lang=\"ts\">\n\timport DragHandleDots2 from \"svelte-radix/DragHandleDots2.svelte\";\n\timport * as ResizablePrimitive from \"paneforge\";\n\timport { cn } from \"$lib/utils\";\n\n\ttype $$Props = ResizablePrimitive.PaneResizerProps & {\n\t\twithHandle?: boolean;\n\t};\n\n\texport let withHandle: $$Props[\"withHandle\"] = false;\n\texport let el: $$Props[\"el\"] = undefined;\n\tlet className: $$Props[\"class\"] = undefined;\n\texport { className as class };\n</script>\n\n<ResizablePrimitive.PaneResizer\n\tbind:el\n\tclass={cn(\n\t\t\"bg-border focus-visible:ring-ring relative flex w-px items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-offset-1 data-[direction=vertical]:h-px data-[direction=vertical]:w-full data-[direction=vertical]:after:left-0 data-[direction=vertical]:after:h-1 data-[direction=vertical]:after:w-full data-[direction=vertical]:after:-translate-y-1/2 data-[direction=vertical]:after:translate-x-0 [&[data-direction=vertical]>div]:rotate-90\",\n\t\tclassName\n\t)}\n>\n\t{#if withHandle}\n\t\t<div class=\"bg-border z-10 flex h-4 w-3 items-center justify-center rounded-sm border\">\n\t\t\t<DragHandleDots2 class=\"h-2.5 w-2.5\" />\n\t\t</div>\n\t{/if}\n</ResizablePrimitive.PaneResizer>\n"
"content": "<script lang=\"ts\">\n\timport DragHandleDots2 from \"svelte-radix/DragHandleDots2.svelte\";\n\timport * as ResizablePrimitive from \"paneforge\";\n\timport { cn } from \"$lib/utils\";\n\n\ttype $$Props = ResizablePrimitive.PaneResizerProps & {\n\t\twithHandle?: boolean;\n\t};\n\n\texport let withHandle: $$Props[\"withHandle\"] = false;\n\texport let el: $$Props[\"el\"] = undefined;\n\tlet className: $$Props[\"class\"] = undefined;\n\texport { className as class };\n</script>\n\n<ResizablePrimitive.PaneResizer\n\tbind:el\n\tclass={cn(\n\t\t\"relative flex w-px items-center justify-center bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 data-[direction=vertical]:h-px data-[direction=vertical]:w-full data-[direction=vertical]:after:left-0 data-[direction=vertical]:after:h-1 data-[direction=vertical]:after:w-full data-[direction=vertical]:after:-translate-y-1/2 data-[direction=vertical]:after:translate-x-0 [&[data-direction=vertical]>div]:rotate-90\",\n\t\tclassName\n\t)}\n>\n\t{#if withHandle}\n\t\t<div class=\"z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border\">\n\t\t\t<DragHandleDots2 class=\"h-2.5 w-2.5\" />\n\t\t</div>\n\t{/if}\n</ResizablePrimitive.PaneResizer>\n"
},
{
"name": "resizable-pane-group.svelte",
Expand Down

0 comments on commit 4d9a200

Please sign in to comment.