undocs 0.2.8 → 0.2.10

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.vue CHANGED
@@ -31,7 +31,7 @@ provide('navigation', navigation)
31
31
  <AppFooter />
32
32
 
33
33
  <ClientOnly>
34
- <LazyUDocsSearch :files="files" :navigation="navigation" />
34
+ <LazyUContentSearch :files="files" :navigation="navigation" />
35
35
  </ClientOnly>
36
36
 
37
37
  <UNotifications />
@@ -33,18 +33,17 @@ const navLinks = computed(() => {
33
33
  {{ appConfig.site.name }}
34
34
  </span>
35
35
  </NuxtLink>
36
- <div class="hidden lg:flex ml-8">
37
- <UDocsSearchButton label="Search..." />
38
- </div>
39
36
  </template>
40
37
 
41
- <template #center> </template>
38
+ <template #center>
39
+ <UContentSearchButton label="Search..." class="hidden lg:flex" />
40
+ </template>
42
41
 
43
42
  <template #right>
44
43
  <UHeaderLinks :links="navLinks" class="mr-4" v-if="navLinks.length > 1" />
45
44
 
46
45
  <UTooltip class="lg:hidden" text="Search" :shortcuts="[metaSymbol, 'K']">
47
- <UDocsSearchButton :label="null" />
46
+ <UContentSearchButton :label="null" />
48
47
  </UTooltip>
49
48
 
50
49
  <!-- <ColorPicker /> -->
@@ -38,6 +38,7 @@ const socialLinks = computed(() => {
38
38
  :to="link.to"
39
39
  target="_blank"
40
40
  rel="noopener noreferrer"
41
- v-bind="$ui.button.secondary as any"
41
+ color="gray"
42
+ variant="ghost"
42
43
  ></UButton>
43
44
  </template>
package/app/error.vue CHANGED
@@ -41,7 +41,7 @@ provide('navigation', navigation)
41
41
  <AppFooter />
42
42
 
43
43
  <ClientOnly>
44
- <LazyUDocsSearch :files="files" :navigation="navigation" />
44
+ <LazyUContentSearch :files="files" :navigation="navigation" />
45
45
  </ClientOnly>
46
46
 
47
47
  <UNotifications />
@@ -1,16 +1,5 @@
1
- import { createRequire } from 'node:module'
2
1
  import { defineNuxtModule } from 'nuxt/kit'
3
2
 
4
- // Remove deprecated color warnings for Bun
5
- // https://github.com/nuxt/ui/issues/809
6
- const _require = createRequire(import.meta.url)
7
- const defaultColors = _require('tailwindcss/colors.js')
8
- delete defaultColors.lightBlue
9
- delete defaultColors.warmGray
10
- delete defaultColors.trueGray
11
- delete defaultColors.coolGray
12
- delete defaultColors.blueGray
13
-
14
3
  export default defineNuxtModule({
15
4
  setup(_, nuxt) {
16
5
  if (nuxt.options._prepare) {
@@ -1,4 +1,3 @@
1
- import { join } from 'node:path'
2
1
  import { defineNuxtConfig } from 'nuxt/config'
3
2
 
4
3
  // Flag enabled when developing docs theme
@@ -99,12 +98,6 @@ export default defineNuxtConfig({
99
98
  tailwindcss: {
100
99
  viewer: dev,
101
100
  quiet: !dev,
102
- config: {
103
- content: {
104
- // eslint-disable-next-line unicorn/prefer-module
105
- files: [join(__dirname, '{components,pages,layouts}/**/*.vue')],
106
- },
107
- },
108
101
  },
109
102
  typescript: {
110
103
  strict: false,
@@ -53,6 +53,10 @@ const tocLinks = computed(() =>
53
53
  href: `#${link.id}`,
54
54
  })),
55
55
  )
56
+
57
+ const scrollToTop = () => {
58
+ window.scrollTo({ top: 0, left: 0, behavior: 'smooth' })
59
+ }
56
60
  </script>
57
61
 
58
62
  <template>
@@ -60,18 +64,21 @@ const tocLinks = computed(() =>
60
64
  <UPageHeader :title="page.title" :description="page.description" :links="page.links" :headline="headline">
61
65
  </UPageHeader>
62
66
 
63
- <UDropdown
64
- v-if="tocLinks.length > 2"
65
- :items="[/*[{ label: 'Return to top', href: '#' }] TODO: once sticky */ tocLinks]"
66
- v-model:open="tocOpen"
67
- class="mt-4 lg:sticky"
68
- >
69
- <UButton
70
- color="white"
71
- label="On this page"
72
- :trailing-icon="`i-heroicons-chevron-${tocOpen ? 'down' : 'right'}-20-solid`"
73
- />
74
- </UDropdown>
67
+ <div class="mt-4 top-[calc(var(--header-height)_+_0.5rem)] z-10 flex justify-end lg:sticky">
68
+ <UDropdown
69
+ v-if="tocLinks.length > 2"
70
+ :items="[[{ label: 'Return to top', click: scrollToTop }], tocLinks]"
71
+ :popper="{ placement: 'bottom-end' }"
72
+ v-model:open="tocOpen"
73
+ >
74
+ <UButton
75
+ color="white"
76
+ label="On this page"
77
+ :trailing="false"
78
+ :icon="`i-heroicons-chevron-${tocOpen ? 'down' : 'left'}-20-solid`"
79
+ />
80
+ </UDropdown>
81
+ </div>
75
82
 
76
83
  <UPageBody prose>
77
84
  <ContentRenderer v-if="page.body" :value="page" />
@@ -91,7 +98,7 @@ const tocLinks = computed(() =>
91
98
  ]"
92
99
  />
93
100
  </div>
94
- <UDocsSurround v-if="surround?.length" class="mb-4" :surround="surround" />
101
+ <UContentSurround v-if="surround?.length" class="mb-4" :surround="surround" />
95
102
  </div>
96
103
  </UPageBody>
97
104
  </UPage>
@@ -1,8 +1,28 @@
1
+ import { resolve, join } from 'node:path'
1
2
  import type { Config } from 'tailwindcss'
2
3
  import defaultTheme from 'tailwindcss/defaultTheme'
3
4
 
5
+ // eslint-disable-next-line unicorn/prefer-module
6
+ const uiDir = resolve(require.resolve('@nuxt/ui'), '..')
7
+
8
+ // eslint-disable-next-line unicorn/prefer-module
9
+ const uiProDir = resolve(require.resolve('@nuxt/ui-pro'), '..')
10
+
11
+ // eslint-disable-next-line unicorn/prefer-module
12
+ const appDir = __dirname
13
+
14
+ const contentFiles = [
15
+ join(appDir, '{components,pages,layouts}/**/*.{vue,mjs,js,cjs,ts}'),
16
+ join(appDir, '.unjs/{components,pages,layouts}/**/*.{vue,mjs,js,cjs,ts}'),
17
+ join(uiDir, 'runtime/**/*.{vue,mjs,js,cjs,ts}'),
18
+ join(uiProDir, 'components/**/*.{vue,mjs,js,cjs,ts}'),
19
+ join(uiProDir, 'modules/pro/runtime/**/*.{vue,mjs,js,cjs,ts}'),
20
+ ]
21
+
4
22
  export default <Partial<Config>>{
5
- content: ['./nuxt.config.ts'],
23
+ content: {
24
+ files: contentFiles,
25
+ },
6
26
  theme: {
7
27
  extend: {
8
28
  fontFamily: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "undocs",
3
- "version": "0.2.8",
3
+ "version": "0.2.10",
4
4
  "repository": "unjs/undocs",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -30,22 +30,23 @@
30
30
  "undocs": "./cli/main.mjs"
31
31
  },
32
32
  "dependencies": {
33
+ "@headlessui/vue": "^1.7.19",
33
34
  "@nuxt/content": "^2.12.0",
34
- "@nuxt/ui": "^2.13.0",
35
- "@nuxt/ui-pro": "^0.7.5",
35
+ "@nuxt/ui": "^2.14.0",
36
+ "@nuxt/ui-pro": "^1.0.0",
36
37
  "@nuxtjs/fontaine": "^0.4.1",
37
38
  "@nuxtjs/google-fonts": "^3.1.3",
38
39
  "@nuxtjs/plausible": "^0.2.4",
39
40
  "@nuxtjs/seo": "^2.0.0-rc.8",
40
- "@nuxtjs/tailwindcss": "^6.11.3",
41
- "automd": "^0.3.4",
42
- "c12": "^1.7.0",
43
- "citty": "^0.1.5",
41
+ "@nuxtjs/tailwindcss": "^6.11.4",
42
+ "automd": "^0.3.5",
43
+ "c12": "^1.9.0",
44
+ "citty": "^0.1.6",
44
45
  "consola": "^3.2.3",
45
46
  "defu": "^6.1.4",
46
47
  "is-buffer": "^2.0.5",
47
48
  "nuxi": "^3.10.1",
48
- "nuxt": "^3.10.2",
49
+ "nuxt": "^3.10.3",
49
50
  "nuxt-build-cache": "^0.1.1",
50
51
  "pkg-types": "^1.0.3",
51
52
  "scule": "^1.3.0",
@@ -53,12 +54,12 @@
53
54
  "theme-colors": "^0.1.0",
54
55
  "unctx": "^2.3.1",
55
56
  "unstorage": "^1.10.1",
56
- "vue": "~3.3.13",
57
- "vue-router": "^4.2.5"
57
+ "vue": "^3.4.19",
58
+ "vue-router": "^4.3.0"
58
59
  },
59
60
  "devDependencies": {
60
61
  "@nuxt/eslint-config": "^0.2.0",
61
- "@types/node": "^20.11.16",
62
+ "@types/node": "^20.11.20",
62
63
  "changelogen": "^0.5.5",
63
64
  "eslint": "^8.56.0",
64
65
  "eslint-config-unjs": "^0.2.1",