Skip to content

Commit 4983f30

Browse files
committed
wip: start v3 migration
1 parent 620009f commit 4983f30

File tree

129 files changed

+2128
-1686
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

129 files changed

+2128
-1686
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
# Icon must end with two \r
1212
Icon
13+
.data/
1314

1415

1516
# Thumbnails

app/app.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
<template>
2-
<div vaul-drawer-wrapper>
2+
<div>
33
<NuxtPwaManifest />
44
<NuxtLoadingIndicator />
5-
<NuxtPage />
5+
<NuxtLayout>
6+
<NuxtPage />
7+
</NuxtLayout>
68
<UiToastToaster />
79
<UiVueSonner />
810
</div>

app/components/CommandSearch.vue

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@
2020
:value="child.title"
2121
@select="
2222
$event.preventDefault();
23-
navigateTo(child._path);
23+
navigateTo(child.path);
2424
localModel = false;
2525
"
2626
>
27-
<Icon :name="nav.icon" class="h-4 w-4 text-muted-foreground/80" />
27+
<Icon v-if="nav.icon" :name="nav.icon" class="h-4 w-4 text-muted-foreground/80" />
2828
<span>{{ child.title }}</span>
2929
<UiBadge v-if="child.label" class="ml-4 px-2 py-0 text-[10px] dark:bg-lime-500">{{
3030
child.label
@@ -51,6 +51,10 @@
5151
</template>
5252

5353
<script lang="ts" setup>
54+
import type { ContentNavigationItem } from "@nuxt/content";
55+
56+
type L = ContentNavigationItem & { icon?: string };
57+
5458
const props = defineProps<{
5559
modelValue?: boolean;
5660
}>();
@@ -65,7 +69,7 @@
6569
}>();
6670
const localModel = useVModel(props, "modelValue", emits, { passive: true });
6771
68-
const { navigation } = useContent();
72+
const navigation = inject<Ref<L[]>>("navigation", ref([]));
6973
7074
const colorMode = useColorMode();
7175
const setTheme = (e: Event, val: string) => {

app/components/Docs/Footer.vue

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<template>
22
<div class="not-prose mt-10 py-10">
3-
<div class="grid grid-cols-1 gap-5 md:grid-cols-2 md:items-center md:justify-between">
3+
<div class="grid grid-cols-1 gap-5 md:grid-cols-2">
44
<NuxtLink
55
v-if="prev"
6-
:to="prev._path"
7-
class="flex basis-full gap-4 rounded-lg border p-5 transition hover:border-primary md:basis-1/2"
6+
:to="prev.path"
7+
class="flex gap-4 rounded-lg border p-5 transition hover:border-primary"
88
>
99
<div class="flex h-10 w-10 shrink-0 items-center justify-center rounded-full border">
1010
<Icon name="lucide:arrow-left" class="h-5 w-5 text-muted-foreground" />
@@ -18,8 +18,8 @@
1818
</NuxtLink>
1919
<NuxtLink
2020
v-if="next"
21-
:to="next._path"
22-
class="flex basis-full justify-between gap-4 rounded-lg border p-5 transition hover:border-primary md:basis-1/2"
21+
:to="next.path"
22+
class="flex justify-between gap-4 rounded-lg border p-5 transition hover:border-primary"
2323
>
2424
<div class="flex flex-col gap-1">
2525
<p class="font-semibold lg:text-sm">{{ next.title }}</p>
@@ -36,5 +36,12 @@
3636
</template>
3737

3838
<script lang="ts" setup>
39-
const { prev, next } = useContent();
39+
const route = useRoute();
40+
const { data: surround } = await useAsyncData("surround", () =>
41+
queryCollectionItemSurroundings("content", route.path, {
42+
fields: ["title", "description", "path"],
43+
})
44+
);
45+
const prev = computed(() => surround.value?.[0]);
46+
const next = computed(() => surround.value?.[1]);
4047
</script>

app/components/Docs/Header.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,7 @@
2020
</template>
2121

2222
<script lang="ts" setup>
23-
const { page } = useContent();
23+
defineProps<{
24+
page: any;
25+
}>();
2426
</script>

app/components/Docs/Navlink.vue renamed to app/components/Docs/Nav.vue

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
<div v-if="!l.children" class="flex items-center gap-4">
55
<NuxtLink
66
class="line-clamp-1 shrink-0 text-ellipsis text-base text-muted-foreground underline-offset-2 hover:underline sm:text-sm"
7-
exact-active-class="underline underline-offset-2"
8-
:to="l._path"
7+
exact-active-class="underline underline-offset-2 text-primary"
8+
:to="l.path"
99
:title="l.title"
1010
>
1111
{{ l.title }}
@@ -20,7 +20,7 @@
2020
<p class="text-[17px] font-medium sm:text-sm">{{ l.title }}</p>
2121
</div>
2222
<div class="pl-7">
23-
<DocsNavlink class="gap-4" :links="l.children" />
23+
<DocsNav class="gap-4" :links="l.children" />
2424
</div>
2525
</div>
2626
</template>
@@ -29,17 +29,11 @@
2929

3030
<script lang="ts" setup>
3131
import { tv } from "tailwind-variants";
32+
import type { ContentNavigationItem } from "@nuxt/content";
3233
33-
type Link = {
34-
_path: string;
35-
title: string;
36-
icon?: string;
37-
children?: Link[];
38-
label?: string;
39-
};
40-
34+
type L = ContentNavigationItem & { icon?: string };
4135
const props = defineProps<{
42-
links?: Link[];
36+
links?: L[];
4337
class?: any;
4438
}>();
4539

app/components/MobileNav.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,17 @@
1717
</div>
1818
<UiSeparator class="mt-4" />
1919
</div>
20-
<DocsNavlink :links="navigation" />
20+
<DocsNav :links="navigation" />
2121
</UiScrollArea>
2222
</template>
2323
</UiSheetContent>
2424
</UiSheet>
2525
</template>
2626

2727
<script lang="ts" setup>
28-
const { navigation } = useContent();
28+
import type { ContentNavigationItem } from "@nuxt/content";
29+
30+
const navigation = inject<Ref<ContentNavigationItem[]>>("navigation", ref([]));
2931
3032
const props = defineProps<{
3133
modelValue?: boolean;

app/components/content/Block/BlockShowcase.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,6 @@
136136
const { copied, copy } = useClipboard({ copiedDuring: 2500, legacy: true });
137137
138138
const externalViewLink = computed(() => {
139-
return `/block-renderer?component=${props.component}&containerClass=${props.containerClass ?? ""}`;
139+
return `/block-renderer?component=${props.component}&path=${props.blockPath}&containerClass=${props.containerClass ?? ""}`;
140140
});
141141
</script>

app/components/content/Docs/DataTable/DocsDatatableLayout.vue

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,13 +90,21 @@
9090
layout: {
9191
top1: "searchBuilder",
9292
top1Start: {
93-
buttons: true,
93+
features: {
94+
buttons: true,
95+
},
96+
className: tw`pb-5`,
9497
},
9598
topStart: null,
9699
topEnd: null,
97100
bottomStart: null,
98101
bottomEnd: {
99-
paging: true,
102+
features: [
103+
{
104+
paging: true,
105+
},
106+
],
107+
className: tw`pt-5`,
100108
},
101109
},
102110
};

app/components/content/ShowCase.vue

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,22 +23,18 @@
2323
class="mt-3 flex min-h-[300px] items-center justify-center rounded-lg border p-5 lg:p-10"
2424
>
2525
<div class="not-prose mx-auto w-full">
26-
<component :is="component" />
26+
<slot />
2727
</div>
2828
</div>
2929
</TabsContent>
3030
<TabsContent value="code">
3131
<div v-if="$slots?.code">
32-
<ContentSlot :use="$slots.code" unwrap="p" />
32+
<slot name="code" mdc-unwrap="p" />
3333
</div>
3434
</TabsContent>
3535
</TabsRoot>
3636
</template>
3737

3838
<script lang="ts" setup>
3939
import { TabsContent, TabsList, TabsRoot, TabsTrigger } from "radix-vue";
40-
41-
defineProps<{
42-
component: string;
43-
}>();
4440
</script>

0 commit comments

Comments
 (0)