docus 4.2.0 → 5.0.1

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/app/app.config.ts CHANGED
@@ -10,8 +10,6 @@ export default defineAppConfig({
10
10
  itemLeadingIcon: 'size-4 mx-0.5',
11
11
  },
12
12
  },
13
- },
14
- uiPro: {
15
13
  contentNavigation: {
16
14
  slots: {
17
15
  linkLeadingIcon: 'size-4 mr-1',
package/app/app.vue CHANGED
@@ -1,13 +1,13 @@
1
1
  <script setup lang="ts">
2
2
  import type { PageCollections } from '@nuxt/content'
3
- import * as nuxtUiProLocales from '@nuxt/ui-pro/locale'
3
+ import * as nuxtUiLocales from '@nuxt/ui/locale'
4
4
 
5
5
  const { seo } = useAppConfig()
6
6
  const site = useSiteConfig()
7
7
  const { locale, locales, isEnabled, switchLocalePath } = useDocusI18n()
8
8
 
9
- const lang = computed(() => nuxtUiProLocales[locale.value as keyof typeof nuxtUiProLocales]?.code || 'en')
10
- const dir = computed(() => nuxtUiProLocales[locale.value as keyof typeof nuxtUiProLocales]?.dir || 'ltr')
9
+ const lang = computed(() => nuxtUiLocales[locale.value as keyof typeof nuxtUiLocales]?.code || 'en')
10
+ const dir = computed(() => nuxtUiLocales[locale.value as keyof typeof nuxtUiLocales]?.dir || 'ltr')
11
11
  const collectionName = computed(() => isEnabled.value ? `docs_${locale.value}` : 'docs')
12
12
 
13
13
  useHead({
@@ -58,7 +58,7 @@ provide('navigation', navigation)
58
58
  </script>
59
59
 
60
60
  <template>
61
- <UApp :locale="nuxtUiProLocales[locale as keyof typeof nuxtUiProLocales]">
61
+ <UApp :locale="nuxtUiLocales[locale as keyof typeof nuxtUiLocales]">
62
62
  <NuxtLoadingIndicator color="var(--ui-primary)" />
63
63
 
64
64
  <NuxtLayout>
@@ -8,7 +8,7 @@ const links = computed(() => [
8
8
  'target': '_blank',
9
9
  'aria-label': `${key} social link`,
10
10
  })),
11
- appConfig.github?.url && {
11
+ appConfig.github && appConfig.github.url && {
12
12
  'icon': 'i-simple-icons-github',
13
13
  'to': appConfig.github.url,
14
14
  'target': '_blank',
@@ -6,7 +6,7 @@ const site = useSiteConfig()
6
6
 
7
7
  const { localePath, isEnabled, locales } = useDocusI18n()
8
8
 
9
- const links = computed(() => appConfig.github?.url
9
+ const links = computed(() => appConfig.github && appConfig.github.url
10
10
  ? [
11
11
  {
12
12
  'icon': 'i-simple-icons-github',
@@ -42,7 +42,7 @@ async function copyPage() {
42
42
  </script>
43
43
 
44
44
  <template>
45
- <UButtonGroup size="sm">
45
+ <UFieldGroup size="sm">
46
46
  <UButton
47
47
  :label="t('docs.copy.page')"
48
48
  :icon="copied ? 'i-lucide-check' : 'i-lucide-copy'"
@@ -70,5 +70,5 @@ async function copyPage() {
70
70
  class="border-l border-muted"
71
71
  />
72
72
  </UDropdownMenu>
73
- </UButtonGroup>
73
+ </UFieldGroup>
74
74
  </template>
package/app/error.vue CHANGED
@@ -1,7 +1,7 @@
1
1
  <script setup lang="ts">
2
2
  import type { NuxtError } from '#app'
3
3
  import type { PageCollections } from '@nuxt/content'
4
- import * as nuxtUiProLocales from '@nuxt/ui-pro/locale'
4
+ import * as nuxtUiLocales from '@nuxt/ui/locale'
5
5
 
6
6
  const props = defineProps<{
7
7
  error: NuxtError
@@ -9,8 +9,8 @@ const props = defineProps<{
9
9
 
10
10
  const { locale, locales, isEnabled, t, switchLocalePath } = useDocusI18n()
11
11
 
12
- const lang = computed(() => nuxtUiProLocales[locale.value as keyof typeof nuxtUiProLocales]?.code || 'en')
13
- const dir = computed(() => nuxtUiProLocales[locale.value as keyof typeof nuxtUiProLocales]?.dir || 'ltr')
12
+ const lang = computed(() => nuxtUiLocales[locale.value as keyof typeof nuxtUiLocales]?.code || 'en')
13
+ const dir = computed(() => nuxtUiLocales[locale.value as keyof typeof nuxtUiLocales]?.dir || 'ltr')
14
14
  useHead({
15
15
  htmlAttrs: {
16
16
  lang,
@@ -1,9 +1,10 @@
1
1
  <script setup lang="ts">
2
2
  import type { ContentNavigationItem } from '@nuxt/content'
3
+ import { flattenNavigation } from '../utils/navigation'
3
4
 
4
5
  const route = useRoute()
5
6
  const docsNavigation = inject<Ref<ContentNavigationItem[]>>('navigation')
6
- const docsLink = computed(() => docsNavigation?.value.flatMap(item => item.children || [item]) || [])
7
+ const docsLink = computed(() => flattenNavigation(docsNavigation?.value))
7
8
  const isDocs = computed(() => docsLink.value.findIndex(item => item.path === route.path) !== -1)
8
9
  </script>
9
10
 
@@ -46,16 +46,18 @@ defineOgImageComponent('Docs', {
46
46
  headline: headline.value,
47
47
  })
48
48
 
49
+ const github = computed(() => appConfig.github ? appConfig.github : null)
50
+
49
51
  const editLink = computed(() => {
50
- if (!appConfig.github) {
52
+ if (!github.value) {
51
53
  return
52
54
  }
53
55
 
54
56
  return [
55
- appConfig.github.url,
57
+ github.value.url,
56
58
  'edit',
57
- appConfig.github.branch,
58
- appConfig.github.rootDir,
59
+ github.value.branch,
60
+ github.value.rootDir,
59
61
  'content',
60
62
  `${page.value?.stem}.${page.value?.extension}`,
61
63
  ].filter(Boolean).join('/')
@@ -92,7 +94,7 @@ const editLink = computed(() => {
92
94
 
93
95
  <USeparator>
94
96
  <div
95
- v-if="editLink"
97
+ v-if="github"
96
98
  class="flex items-center gap-2 text-sm text-muted"
97
99
  >
98
100
  <UButton
@@ -109,7 +111,7 @@ const editLink = computed(() => {
109
111
  <UButton
110
112
  variant="link"
111
113
  color="neutral"
112
- :to="`${appConfig.github.url}/issues/new/choose`"
114
+ :to="`${github.url}/issues/new/choose`"
113
115
  target="_blank"
114
116
  icon="i-lucide-alert-circle"
115
117
  :ui="{ leadingIcon: 'size-4' }"
@@ -32,7 +32,7 @@ declare module 'nuxt/schema' {
32
32
  url: string
33
33
  branch: string
34
34
  rootDir?: string
35
- }
35
+ } | false
36
36
  }
37
37
  }
38
38
 
@@ -0,0 +1,7 @@
1
+ import type { ContentNavigationItem } from '@nuxt/content'
2
+
3
+ export const flattenNavigation = (items?: ContentNavigationItem[]): ContentNavigationItem[] => items?.flatMap(
4
+ item => item.children
5
+ ? flattenNavigation(item.children)
6
+ : [item],
7
+ ) || []
package/modules/css.ts CHANGED
@@ -11,7 +11,7 @@ export default defineNuxtModule({
11
11
  const resolver = createResolver(import.meta.url)
12
12
 
13
13
  const contentDir = joinURL(dir, 'content')
14
- const uiProPath = resolveModulePath('@nuxt/ui-pro', { from: import.meta.url, conditions: ['style'] })
14
+ const uiPath = resolveModulePath('@nuxt/ui', { from: import.meta.url, conditions: ['style'] })
15
15
  const tailwindPath = resolveModulePath('tailwindcss', { from: import.meta.url, conditions: ['style'] })
16
16
  const layerDir = resolver.resolve('../app')
17
17
 
@@ -19,7 +19,7 @@ export default defineNuxtModule({
19
19
  filename: 'docus.css',
20
20
  getContents: () => {
21
21
  return `@import ${JSON.stringify(tailwindPath)};
22
- @import ${JSON.stringify(uiProPath)};
22
+ @import ${JSON.stringify(uiPath)};
23
23
 
24
24
  @source "${contentDir.replace(/\\/g, '/')}/**/*";
25
25
  @source "${layerDir.replace(/\\/g, '/')}/**/*";
package/nuxt.config.ts CHANGED
@@ -7,7 +7,7 @@ export default defineNuxtConfig({
7
7
  resolve('./modules/config'),
8
8
  resolve('./modules/routing'),
9
9
  resolve('./modules/css'),
10
- '@nuxt/ui-pro',
10
+ '@nuxt/ui',
11
11
  '@nuxt/content',
12
12
  '@nuxt/image',
13
13
  '@nuxtjs/robots',
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "docus",
3
3
  "description": "Nuxt layer for Docus documentation theme",
4
- "version": "4.2.0",
4
+ "version": "5.0.1",
5
5
  "type": "module",
6
6
  "main": "./nuxt.config.ts",
7
7
  "repository": {
@@ -23,12 +23,12 @@
23
23
  ],
24
24
  "dependencies": {
25
25
  "@iconify-json/lucide": "^1.2.68",
26
- "@iconify-json/simple-icons": "^1.2.52",
26
+ "@iconify-json/simple-icons": "^1.2.53",
27
27
  "@iconify-json/vscode-icons": "^1.2.30",
28
28
  "@nuxt/content": "^3.7.1",
29
29
  "@nuxt/image": "^1.11.0",
30
30
  "@nuxt/kit": "^4.1.2",
31
- "@nuxt/ui-pro": "^3.3.4",
31
+ "@nuxt/ui": "^4.0.0",
32
32
  "@nuxtjs/i18n": "^10.1.0",
33
33
  "@nuxtjs/mdc": "^0.17.4",
34
34
  "@nuxtjs/robots": "^5.5.5",
@@ -37,7 +37,7 @@
37
37
  "exsolve": "^1.0.7",
38
38
  "git-url-parse": "^16.1.0",
39
39
  "minimark": "^0.2.0",
40
- "motion-v": "^1.7.1",
40
+ "motion-v": "^1.7.2",
41
41
  "nuxt-llms": "^0.1.3",
42
42
  "nuxt-og-image": "^5.1.11",
43
43
  "pkg-types": "^2.3.0",