@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 +8 -0
- package/app/app.vue +1 -0
- package/app/components/docs/DocsMobileNav.vue +2 -4
- package/app/components/docs/DocsPageTransition.vue +10 -8
- package/app/composables/useDocd.ts +9 -0
- package/app/composables/useUIConfig.ts +4 -0
- package/app/layouts/docs.vue +4 -5
- package/app/pages/[...slug].vue +3 -2
- package/package.json +10 -13
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
|
@@ -15,11 +15,9 @@
|
|
|
15
15
|
</UiDrawerClose>
|
|
16
16
|
</UiDrawerHeader>
|
|
17
17
|
|
|
18
|
-
<
|
|
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
|
-
</
|
|
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"
|
|
6
|
+
<AnimatePresence mode="wait">
|
|
7
7
|
<Motion
|
|
8
|
-
:key="
|
|
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
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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" },
|
package/app/layouts/docs.vue
CHANGED
|
@@ -13,11 +13,11 @@
|
|
|
13
13
|
<DocsSearchButton v-if="!hideSearch" />
|
|
14
14
|
</div>
|
|
15
15
|
</div>
|
|
16
|
-
<
|
|
17
|
-
class="h-[calc(100dvh-calc(var(--header-height)*2))] flex-1
|
|
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
|
-
</
|
|
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,
|
|
64
|
-
useDocd();
|
|
63
|
+
const { isDashed, hasGithub, hideSearch, hideLightDarkToggle, hideThemeCustomizer } = useDocd();
|
|
65
64
|
</script>
|
package/app/pages/[...slug].vue
CHANGED
|
@@ -9,8 +9,9 @@
|
|
|
9
9
|
>
|
|
10
10
|
<div
|
|
11
11
|
v-if="page"
|
|
12
|
-
class="container prose prose-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.
|
|
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.
|
|
40
|
+
"@nuxt/kit": "^4.5.0",
|
|
44
41
|
"@nuxtjs/color-mode": "^4.0.1",
|
|
45
|
-
"@nuxtjs/mcp-toolkit": "^0.
|
|
46
|
-
"@nuxtjs/mdc": "^0.22.
|
|
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.
|
|
51
|
-
"@takumi-rs/core": "^2.0
|
|
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.
|
|
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.
|
|
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.
|
|
76
|
+
"nuxt": "^4.5.0",
|
|
80
77
|
"typescript": "^6.0.3",
|
|
81
78
|
"vue": "latest",
|
|
82
|
-
"vue-router": "^5.
|
|
79
|
+
"vue-router": "^5.2.0"
|
|
83
80
|
},
|
|
84
81
|
"packageManager": "bun@1.3.14",
|
|
85
82
|
"trustedDependencies": [
|