@baybreezy/docd 0.2.0 → 0.3.0

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
@@ -153,6 +153,14 @@ export type DocdConfig = {
153
153
  /** Logo configuration for the header. */
154
154
  logo?: DocLogoConfig;
155
155
  };
156
+ body?: {
157
+ /**
158
+ * Maximum width for the main content area.
159
+ *
160
+ * @default "1280px"
161
+ */
162
+ maxWidth?: `${number}px`;
163
+ };
156
164
  footer?: {
157
165
  /**
158
166
  * Whether to hide the theme customizer in the sidebar
package/app/app.vue CHANGED
@@ -1,5 +1,6 @@
1
1
  <template>
2
2
  <ConfigProvider :use-id="useId">
3
+ <NuxtAnnouncer />
3
4
  <NuxtRouteAnnouncer />
4
5
  <NuxtLoadingIndicator color="var(--primary)" />
5
6
  <NuxtLayout>
@@ -15,11 +15,9 @@
15
15
  </UiDrawerClose>
16
16
  </UiDrawerHeader>
17
17
 
18
- <UiScrollArea
19
- class="min-h-0 flex-1 mask-[linear-gradient(to_bottom,transparent,white_12px,white_calc(100%-12px),transparent)] px-4 py-4"
20
- >
18
+ <div class="min-h-0 flex-1 scroll-fade overflow-y-auto px-4 py-4">
21
19
  <DocsNav v-if="navigation" :items="navigation" />
22
- </UiScrollArea>
20
+ </div>
23
21
 
24
22
  <div
25
23
  class="mt-auto flex h-(--header-height) items-center justify-between gap-3 border-t px-2"
@@ -3,9 +3,9 @@
3
3
  class="w-full min-w-0 overflow-x-clip"
4
4
  :class="[isAnimating && 'pointer-events-none overflow-clip']"
5
5
  >
6
- <AnimatePresence mode="wait" @exit-complete="isAnimating = false">
6
+ <AnimatePresence mode="wait">
7
7
  <Motion
8
- :key="route.path"
8
+ :key="$router.currentRoute.value.path"
9
9
  :initial="preset.initial"
10
10
  :animate="animate"
11
11
  :exit="preset.exit"
@@ -20,13 +20,15 @@
20
20
 
21
21
  <script lang="ts" setup>
22
22
  const route = useRoute();
23
+ const activeRoute = computed(() => route.path);
23
24
  const { preset, animate, duration, easing } = useDocd();
24
25
 
25
26
  const isAnimating = ref(false);
26
- watch(
27
- () => route.path,
28
- () => {
29
- isAnimating.value = true;
30
- }
31
- );
27
+ watch(activeRoute, () => {
28
+ isAnimating.value = true;
29
+ });
30
+
31
+ useNuxtApp().hook("page:finish", () => {
32
+ isAnimating.value = false;
33
+ });
32
34
  </script>
@@ -38,6 +38,12 @@ export function useDocd() {
38
38
  const headerTitle = computed(() => header.value.title ?? "");
39
39
  const hideSearch = computed(() => header.value.hideSearch ?? false);
40
40
 
41
+ /* =====================================
42
+ = Body. =
43
+ ===================================== */
44
+ const body = useUIConfig("body");
45
+ const maxWidth = computed(() => body.value.maxWidth ?? "1280px");
46
+
41
47
  /* =====================================
42
48
  = Logo =
43
49
  ===================================== */
@@ -107,5 +113,8 @@ export function useDocd() {
107
113
  // footer
108
114
  hideThemeCustomizer,
109
115
  hideLightDarkToggle,
116
+ // body
117
+ body,
118
+ maxWidth,
110
119
  };
111
120
  }
@@ -6,6 +6,9 @@ interface DocdUIMap {
6
6
  hideSearch?: boolean;
7
7
  logo?: DocLogoConfig;
8
8
  };
9
+ body: {
10
+ maxWidth?: `${number}px`;
11
+ };
9
12
  footer?: {
10
13
  hideThemeCustomizer?: boolean;
11
14
  hideLightDarkToggle?: boolean;
@@ -30,6 +33,7 @@ export function useUIConfig<K extends keyof DocdUIMap>(section: K): ComputedRef<
30
33
 
31
34
  const defaultValues: DocdUIMap = {
32
35
  header: {},
36
+ body: { maxWidth: "1280px" },
33
37
  toc: { title: "On this page", icon: "lucide:list" },
34
38
  borderType: "dashed",
35
39
  transition: { name: "fade", duration: 0.35, easing: "easeOut" },
@@ -13,11 +13,11 @@
13
13
  <DocsSearchButton v-if="!hideSearch" />
14
14
  </div>
15
15
  </div>
16
- <UiScrollArea
17
- class="h-[calc(100dvh-calc(var(--header-height)*2))] flex-1 mask-[linear-gradient(to_bottom,transparent,white_12px,white_calc(100%-12px),transparent)] px-4"
16
+ <div
17
+ class="h-[calc(100dvh-calc(var(--header-height)*2))] flex-1 scroll-fade overflow-y-auto px-4"
18
18
  >
19
19
  <DocsNav v-if="navigation" :items="navigation" />
20
- </UiScrollArea>
20
+ </div>
21
21
  <div
22
22
  class="mt-auto flex h-(--header-height) items-center justify-between gap-3 border-t px-2"
23
23
  :class="isDashed ? 'border-dashed' : ''"
@@ -60,6 +60,5 @@
60
60
 
61
61
  <script lang="ts" setup>
62
62
  const { navigation } = await useDocPage();
63
- const { isDashed, github, hasGithub, hideSearch, hideLightDarkToggle, hideThemeCustomizer } =
64
- useDocd();
63
+ const { isDashed, hasGithub, hideSearch, hideLightDarkToggle, hideThemeCustomizer } = useDocd();
65
64
  </script>
@@ -9,8 +9,9 @@
9
9
  >
10
10
  <div
11
11
  v-if="page"
12
- class="container prose prose-base max-w-7xl min-w-0 py-5 dark:prose-invert prose-headings:scroll-mt-20 prose-headings:tracking-tight prose-h2:mt-6 prose-h2:border-b prose-h2:pb-3 first:prose-h2:mt-10 prose-a:text-primary prose-a:no-underline prose-a:hover:underline prose-a:hover:underline-offset-2 prose-pre:my-0 prose-pre:rounded-sm prose-pre:p-2 prose-pre:px-0 prose-pre:text-base"
12
+ class="container prose prose-base min-w-0 py-5 dark:prose-invert prose-headings:scroll-mt-20 prose-headings:tracking-tight prose-h2:mt-6 prose-h2:border-b prose-h2:pb-3 first:prose-h2:mt-10 prose-a:text-primary prose-a:no-underline prose-a:hover:underline prose-a:hover:underline-offset-2 prose-pre:my-0 prose-pre:rounded-sm prose-pre:p-2 prose-pre:px-0 prose-pre:text-base"
13
13
  :class="[isDashed ? 'prose-headings:border-dashed' : '']"
14
+ :style="{ maxWidth: maxWidth }"
14
15
  >
15
16
  <PageHeader />
16
17
  <ContentRenderer :value="page" />
@@ -28,7 +29,7 @@
28
29
  const route = useRoute();
29
30
 
30
31
  const { page, navigation, headline, breadcrumbs } = await useDocPage();
31
- const { isDashed } = useDocd();
32
+ const { isDashed, maxWidth } = useDocd();
32
33
 
33
34
  if (!page.value) {
34
35
  throw createError({ statusCode: 404, statusMessage: "Page not found", fatal: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@baybreezy/docd",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "A Nuxt layer for building documentation sites with UI Thing.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -31,24 +31,21 @@
31
31
  },
32
32
  "dependencies": {
33
33
  "@baybreezy/file-extension-icon": "^0.0.5",
34
- "@iconify-json/lucide": "^1.2.116",
35
- "@iconify-json/material-icon-theme": "^1.2.69",
36
- "@iconify-json/simple-icons": "^1.2.89",
37
34
  "@iconify/utils": "^3.1.4",
38
35
  "@morev/vue-transitions": "^3.0.5",
39
36
  "@nuxt/content": "3.15.0",
40
37
  "@nuxt/fonts": "^0.14.0",
41
38
  "@nuxt/icon": "^2.3.1",
42
39
  "@nuxt/image": "2.0.0",
43
- "@nuxt/kit": "^4.4.8",
40
+ "@nuxt/kit": "^4.5.0",
44
41
  "@nuxtjs/color-mode": "^4.0.1",
45
- "@nuxtjs/mcp-toolkit": "^0.17.2",
46
- "@nuxtjs/mdc": "^0.22.1",
42
+ "@nuxtjs/mcp-toolkit": "^0.18.0",
43
+ "@nuxtjs/mdc": "^0.22.2",
47
44
  "@nuxtjs/robots": "^6.1.2",
48
45
  "@tailwindcss/forms": "^0.5.11",
49
46
  "@tailwindcss/typography": "^0.5.20",
50
- "@tailwindcss/vite": "^4.3.2",
51
- "@takumi-rs/core": "^2.0.3",
47
+ "@tailwindcss/vite": "^4.3.3",
48
+ "@takumi-rs/core": "^2.3.0",
52
49
  "@vueuse/core": "^14.3.0",
53
50
  "@vueuse/nuxt": "^14.3.0",
54
51
  "better-sqlite3": "^12.11.1",
@@ -57,7 +54,7 @@
57
54
  "lodash-es": "^4.18.1",
58
55
  "mermaid": "^11.16.0",
59
56
  "motion-v": "^2.3.0",
60
- "nuxt-component-meta": "^0.17.2",
57
+ "nuxt-component-meta": "^0.18.0",
61
58
  "nuxt-gtag": "4.1.0",
62
59
  "nuxt-llms": "^0.2.0",
63
60
  "nuxt-og-image": "^6.7.2",
@@ -66,7 +63,7 @@
66
63
  "shiki": "^4.3.1",
67
64
  "tailwind-merge": "^3.6.0",
68
65
  "tailwind-variants": "^3.2.2",
69
- "tailwindcss": "^4.3.2",
66
+ "tailwindcss": "^4.3.3",
70
67
  "tw-animate-css": "^1.4.0",
71
68
  "ufo": "^1.6.4",
72
69
  "vaul-vue": "^0.4.1",
@@ -76,10 +73,10 @@
76
73
  },
77
74
  "devDependencies": {
78
75
  "@types/lodash-es": "^4.17.12",
79
- "nuxt": "^4.4.8",
76
+ "nuxt": "^4.5.0",
80
77
  "typescript": "^6.0.3",
81
78
  "vue": "latest",
82
- "vue-router": "^5.1.0"
79
+ "vue-router": "^5.2.0"
83
80
  },
84
81
  "packageManager": "bun@1.3.14",
85
82
  "trustedDependencies": [