@baybreezy/docd 0.0.12 → 0.1.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
@@ -202,6 +202,14 @@ export type DocdConfig = {
202
202
  * The color mode to use for the site by default.
203
203
  */
204
204
  colorMode?: "light" | "dark";
205
+ /**
206
+ * Controls which collapsible sections in the navigation sidebar are expanded by default.
207
+ *
208
+ * - `true`: expand all collapsibles
209
+ * - `number`: expand the collapsible at this 1-based position (e.g. `2` = second group)
210
+ * - `number[]`: expand collapsibles at these 1-based positions (e.g. `[2, 3]` = second and third groups)
211
+ */
212
+ expandNav?: true | number | number[];
205
213
  /**
206
214
  * Page transition configuration. Set `name` to `"none"` to disable transitions entirely.
207
215
  *
@@ -50,7 +50,7 @@
50
50
  <!-- Collapsible item -->
51
51
  <UiCollapsible
52
52
  v-else
53
- :default-open="route.path.includes(group.item.path)"
53
+ :default-open="isDefaultOpen(group.item, gi)"
54
54
  class="flex flex-col border-b pb-4"
55
55
  :class="[
56
56
  isDashed ? 'border-dashed' : '',
@@ -76,7 +76,12 @@
76
76
  <div
77
77
  class="relative pt-1 pl-8 before:absolute before:left-2 before:h-[calc(100%-23px)] before:w-px before:bg-border dark:before:bg-accent"
78
78
  >
79
- <DocsNav class="gap-4 first:mt-2" :items="group.item.children!" :nested="true" />
79
+ <DocsNav
80
+ class="gap-4 first:mt-2"
81
+ :items="group.item.children!"
82
+ :nested="true"
83
+ :depth="(props.depth ?? 1) + 1"
84
+ />
80
85
  </div>
81
86
  </UiCollapsibleContent>
82
87
  </UiCollapsible>
@@ -127,10 +132,26 @@
127
132
  const props = defineProps<{
128
133
  items: ContentNavigationItem[];
129
134
  nested?: boolean;
135
+ depth?: number;
130
136
  }>();
131
137
 
132
138
  const route = useRoute();
133
139
  const { isDashed } = useDocd();
140
+ const expandNav = useUIConfig("expandNav");
141
+
142
+ function isDefaultOpen(item: ContentNavigationItem, gi: number): boolean {
143
+ if (route.path.includes(item.path)) return true;
144
+ const cfg = expandNav.value;
145
+ if (cfg === true) return true;
146
+ // 1-based index among collapsible groups only
147
+ let collapsibleIdx = 0;
148
+ for (let i = 0; i <= gi; i++) {
149
+ if (groups.value[i]?.type === "collapsible") collapsibleIdx++;
150
+ }
151
+ if (typeof cfg === "number") return collapsibleIdx === cfg;
152
+ if (Array.isArray(cfg)) return cfg.includes(collapsibleIdx);
153
+ return false;
154
+ }
134
155
 
135
156
  type Group =
136
157
  | { type: "flat"; items: ContentNavigationItem[] }
@@ -17,6 +17,7 @@ interface DocdUIMap {
17
17
  borderType: BorderType;
18
18
  transition: DocdTransitionConfig;
19
19
  extraLinks: DocdExtraLink[];
20
+ expandNav: true | number | number[] | undefined;
20
21
  }
21
22
 
22
23
  export function useUIConfig<K extends keyof DocdUIMap>(section: K): ComputedRef<DocdUIMap[K]> {
@@ -33,4 +34,5 @@ const defaultValues: DocdUIMap = {
33
34
  borderType: "dashed",
34
35
  transition: { name: "fade", duration: 0.35, easing: "easeOut" },
35
36
  extraLinks: [],
37
+ expandNav: undefined,
36
38
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@baybreezy/docd",
3
- "version": "0.0.12",
3
+ "version": "0.1.1",
4
4
  "description": "A Nuxt layer for building documentation sites with UI Thing.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -31,16 +31,16 @@
31
31
  },
32
32
  "dependencies": {
33
33
  "@baybreezy/file-extension-icon": "^0.0.4",
34
- "@iconify-json/lucide": "^1.2.103",
35
- "@iconify-json/material-icon-theme": "^1.2.60",
36
- "@iconify-json/simple-icons": "^1.2.79",
34
+ "@iconify-json/lucide": "^1.2.105",
35
+ "@iconify-json/material-icon-theme": "^1.2.62",
36
+ "@iconify-json/simple-icons": "^1.2.80",
37
37
  "@iconify/utils": "^3.1.1",
38
38
  "@morev/vue-transitions": "^3.0.5",
39
39
  "@nuxt/content": "3.13.0",
40
40
  "@nuxt/fonts": "^0.14.0",
41
41
  "@nuxt/icon": "^2.2.1",
42
42
  "@nuxt/image": "2.0.0",
43
- "@nuxt/kit": "^4.4.2",
43
+ "@nuxt/kit": "^4.4.4",
44
44
  "@nuxtjs/color-mode": "^4.0.0",
45
45
  "@nuxtjs/mcp-toolkit": "^0.14.0",
46
46
  "@nuxtjs/mdc": "^0.21.1",
@@ -49,8 +49,8 @@
49
49
  "@tailwindcss/typography": "^0.5.19",
50
50
  "@tailwindcss/vite": "^4.2.4",
51
51
  "@takumi-rs/core": "^1.1.2",
52
- "@vueuse/core": "^14.2.1",
53
- "@vueuse/nuxt": "^14.2.1",
52
+ "@vueuse/core": "^14.3.0",
53
+ "@vueuse/nuxt": "^14.3.0",
54
54
  "better-sqlite3": "^12.9.0",
55
55
  "defu": "^6.1.7",
56
56
  "git-url-parse": "^16.1.0",
@@ -60,23 +60,23 @@
60
60
  "nuxt-component-meta": "^0.17.2",
61
61
  "nuxt-gtag": "4.1.0",
62
62
  "nuxt-llms": "^0.2.0",
63
- "nuxt-og-image": "^6.4.8",
64
- "pkg-types": "^2.3.0",
63
+ "nuxt-og-image": "^6.4.9",
64
+ "pkg-types": "^2.3.1",
65
65
  "reka-ui": "^2.9.6",
66
66
  "shiki": "^4.0.2",
67
67
  "tailwind-merge": "^3.5.0",
68
68
  "tailwind-variants": "^3.2.2",
69
69
  "tailwindcss": "^4.2.4",
70
70
  "tw-animate-css": "^1.4.0",
71
- "ufo": "^1.6.3",
71
+ "ufo": "^1.6.4",
72
72
  "vaul-vue": "^0.4.1",
73
73
  "vue-sonner": "^2.0.9",
74
74
  "yaml": "^2.8.3",
75
- "zod": "^4.3.6"
75
+ "zod": "^4.4.1"
76
76
  },
77
77
  "devDependencies": {
78
78
  "@types/lodash-es": "^4.17.12",
79
- "nuxt": "^4.4.2",
79
+ "nuxt": "^4.4.4",
80
80
  "typescript": "^6.0.3",
81
81
  "vue": "latest",
82
82
  "vue-router": "^5.0.6"