docs: bump @nuxt-themes/ui-kit

This commit is contained in:
Benjamin Canac
2023-07-29 20:14:18 +02:00
parent 4cd38ecc5a
commit 3400e17d17
4 changed files with 48 additions and 33 deletions

View File

@@ -24,19 +24,25 @@
</template> </template>
<template #links> <template #links>
<UDocsAsideAnchors :links="anchors" /> <UAsideAnchors :links="anchors" />
<UDocsAsideLinks :links="navigation" /> <UAsideLinks :links="links" />
</template> </template>
</UHeader> </UHeader>
<UContainer> <UMain>
<UDocsLayout :links="navigation" :anchors="anchors"> <UContainer>
<NuxtPage /> <UPage>
</UDocsLayout> <template #left>
</UContainer> <UAside :links="links" :anchors="anchors" />
</template>
<NuxtPage />
</UPage>
</UContainer>
</UMain>
<ClientOnly> <ClientOnly>
<UDocsSearch :files="files" :links="navigation" /> <UDocsSearch :files="files" :links="links" />
</ClientOnly> </ClientOnly>
<UNotifications> <UNotifications>
@@ -54,10 +60,13 @@
<script setup lang="ts"> <script setup lang="ts">
const colorMode = useColorMode() const colorMode = useColorMode()
const { data: navigation } = await useAsyncData('navigation', () => fetchContentNavigation()) const { data: links } = await useAsyncData('navigation', () => fetchContentNavigation(), {
transform: (navigation) => mapContentLinks(navigation)
})
const { data: files } = await useLazyAsyncData('files', () => queryContent().where({ _type: 'markdown', navigation: { $ne: false } }).find(), { default: () => [] }) const { data: files } = await useLazyAsyncData('files', () => queryContent().where({ _type: 'markdown', navigation: { $ne: false } }).find(), { default: () => [] })
provide('navigation', navigation) provide('links', links)
const anchors = [{ const anchors = [{
label: 'Documentation', label: 'Documentation',

View File

@@ -7,7 +7,7 @@
"devDependencies": { "devDependencies": {
"@iconify-json/heroicons": "latest", "@iconify-json/heroicons": "latest",
"@iconify-json/simple-icons": "latest", "@iconify-json/simple-icons": "latest",
"@nuxt-themes/ui-kit": "npm:@nuxt-themes/ui-kit-edge@0.0.1-28177244.dca5e05", "@nuxt-themes/ui-kit": "npm:@nuxt-themes/ui-kit-edge@0.0.1-28177555.3102f36",
"@nuxt/content": "^2.7.2", "@nuxt/content": "^2.7.2",
"@nuxt/devtools": "^0.6.7", "@nuxt/devtools": "^0.6.7",
"@nuxt/eslint-config": "^0.1.1", "@nuxt/eslint-config": "^0.1.1",

View File

@@ -1,33 +1,38 @@
<template> <template>
<UDocsPage v-if="page" :page="page" :surround="(surround as ParsedContent[])"> <UPage v-if="page">
<ContentRenderer v-if="page && page.body" :value="page" class="prose prose-primary dark:prose-invert max-w-none" /> <UPageHeader v-bind="page" :headline="headline" />
<UButton <UPageBody prose>
:to="githubLink" <ContentRenderer v-if="page && page.body" :value="page" />
variant="link"
icon="i-heroicons-pencil-square" <UButton
label="Edit this page on GitHub" :to="githubLink"
:padded="false" variant="link"
class="mt-12" icon="i-heroicons-pencil-square"
/> label="Edit this page on GitHub"
:padded="false"
class="mt-12"
/>
<hr v-if="surround?.length" class="border-gray-200 dark:border-gray-800 my-8">
<UDocsSurround :surround="surround" />
<template #footer>
<Footer /> <Footer />
</UPageBody>
<template v-if="page.body?.toc?.links?.length" #right>
<UDocsToc :links="page.body.toc.links" />
</template> </template>
</UDocsPage> </UPage>
<div v-else class="pt-8"> <UPageError v-else />
Page not found
</div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import type { ParsedContent } from '@nuxt/content/dist/runtime/types'
const route = useRoute() const route = useRoute()
const { data: page } = await useAsyncData(`docs-${route.path}`, () => queryContent(route.path).findOne()) const { data: page } = await useAsyncData(`docs-${route.path}`, () => queryContent(route.path).findOne())
const { data: surround } = await useAsyncData(`docs-${route.path}-surround`, () => queryContent() const { data: surround } = await useAsyncData(`docs-${route.path}-surround`, () => queryContent()
.only(['_path', 'title', 'navigation', 'description'])
.where({ _extension: 'md', navigation: { $ne: false } }) .where({ _extension: 'md', navigation: { $ne: false } })
.findSurround(route.path.endsWith('/') ? route.path.slice(0, -1) : route.path) .findSurround(route.path.endsWith('/') ? route.path.slice(0, -1) : route.path)
) )
@@ -40,4 +45,5 @@ if (process.server && !page.value) {
useContentHead(page) useContentHead(page)
const githubLink = computed(() => `https://github.com/nuxtlabs/ui/edit/dev/docs/content/${page?.value?._file}`) const githubLink = computed(() => `https://github.com/nuxtlabs/ui/edit/dev/docs/content/${page?.value?._file}`)
const headline = computed(() => page.value._dir?.title ? page.value._dir.title : useLowerCase(page.value._dir))
</script> </script>

8
pnpm-lock.yaml generated
View File

@@ -100,8 +100,8 @@ importers:
specifier: latest specifier: latest
version: 1.1.62 version: 1.1.62
'@nuxt-themes/ui-kit': '@nuxt-themes/ui-kit':
specifier: npm:@nuxt-themes/ui-kit-edge@0.0.1-28177244.dca5e05 specifier: npm:@nuxt-themes/ui-kit-edge@0.0.1-28177555.3102f36
version: /@nuxt-themes/ui-kit-edge@0.0.1-28177244.dca5e05(@nuxt/content@2.7.2)(@nuxthq/ui@)(vue@3.3.4) version: /@nuxt-themes/ui-kit-edge@0.0.1-28177555.3102f36(@nuxt/content@2.7.2)(@nuxthq/ui@)(vue@3.3.4)
'@nuxt/content': '@nuxt/content':
specifier: ^2.7.2 specifier: ^2.7.2
version: 2.7.2(rollup@3.26.2) version: 2.7.2(rollup@3.26.2)
@@ -1231,8 +1231,8 @@ packages:
- supports-color - supports-color
dev: true dev: true
/@nuxt-themes/ui-kit-edge@0.0.1-28177244.dca5e05(@nuxt/content@2.7.2)(@nuxthq/ui@)(vue@3.3.4): /@nuxt-themes/ui-kit-edge@0.0.1-28177555.3102f36(@nuxt/content@2.7.2)(@nuxthq/ui@)(vue@3.3.4):
resolution: {integrity: sha512-AhjAIINdgNCa5ywqAW+dEbsL/eqKNPxBLOcyO+IkErjhFdgxuXur9HSlIYcWogfCsroMMyR0uHzkiFDqvtkDxA==} resolution: {integrity: sha512-Z+49i7ghTddovFiA7TKPJxSwq5BHLWAEmSc+LTUJGodzv0X4CnapC7ZRGhQ+iBCnRw6liCiFFQruO0MeDySatA==}
peerDependencies: peerDependencies:
'@nuxt/content': ^2.7.2 '@nuxt/content': ^2.7.2
'@nuxthq/ui': npm:@nuxthq/ui-edge@latest '@nuxthq/ui': npm:@nuxthq/ui-edge@latest