@vite-hub/docs 0.7.0 → 0.9.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.
Files changed (73) hide show
  1. package/README.md +1 -1
  2. package/dist/{assistant-shared-JcfjK-qg.js → assistant-shared-BmCHVfEd.js} +0 -1
  3. package/dist/assistant-worker.js +1 -1
  4. package/dist/assistant.js +1 -1
  5. package/dist/{content-Chgcvz1q.js → content-Df5eeqTg.js} +1 -3
  6. package/dist/{draft-rOGhtXch.js → draft-CYScbH80.js} +1 -2
  7. package/dist/index.js +1 -1
  8. package/dist/{manifest-CQMreQZ5.js → manifest-BgBIScEV.js} +1 -17
  9. package/dist/{markdown-BzZkYb24.js → markdown-DgQg53dB.js} +0 -28
  10. package/dist/navigation.js +0 -2
  11. package/dist/nuxt.d.ts +1 -1
  12. package/dist/nuxt.js +5 -44
  13. package/dist/object-ycNFay7F.js +6 -0
  14. package/dist/primitive-rail.js +0 -4
  15. package/dist/runtime/app/assistant/DocsAssistant.vue +0 -3
  16. package/dist/runtime/app/assistant/DocsAssistantOff.vue +0 -2
  17. package/dist/runtime/app/assistant/DocsAssistantPanel.vue +0 -12
  18. package/dist/runtime/app/components/DocsAppShell.vue +0 -7
  19. package/dist/runtime/app/components/DocsArticle.vue +0 -8
  20. package/dist/runtime/app/components/DocsAsideFooter.vue +0 -5
  21. package/dist/runtime/app/components/DocsAsideLeftBody.vue +0 -18
  22. package/dist/runtime/app/components/DocsBrandMark.vue +0 -6
  23. package/dist/runtime/app/components/DocsCodePanel.vue +0 -19
  24. package/dist/runtime/app/components/DocsMarkdown.vue +0 -9
  25. package/dist/runtime/app/components/DocsPage.vue +0 -10
  26. package/dist/runtime/app/components/DocsPageCredits.vue +0 -1
  27. package/dist/runtime/app/components/DocsSidebars.vue +0 -8
  28. package/dist/runtime/app/components/OgImage/DocsPage.takumi.vue +0 -2
  29. package/dist/runtime/app/components/content/AgentOnly.vue +0 -1
  30. package/dist/runtime/app/components/content/CodeTree.vue +0 -6
  31. package/dist/runtime/app/components/content/ComarkHtml.vue +0 -9
  32. package/dist/runtime/app/components/content/Correct.vue +0 -1
  33. package/dist/runtime/app/components/content/Example.vue +0 -11
  34. package/dist/runtime/app/components/content/Examples.vue +0 -4
  35. package/dist/runtime/app/components/content/Incorrect.vue +0 -1
  36. package/dist/runtime/app/components/content/McpClient.vue +0 -5
  37. package/dist/runtime/app/components/content/McpInstall.vue +0 -4
  38. package/dist/runtime/app/components/content/PageList.vue +0 -11
  39. package/dist/runtime/app/components/content/ProductFeatureItem.vue +0 -3
  40. package/dist/runtime/app/components/content/ProductFeatures.vue +0 -3
  41. package/dist/runtime/app/composables/docs-assistant-problem.ts +0 -8
  42. package/dist/runtime/app/composables/docs-theme.ts +0 -6
  43. package/dist/runtime/app/composables/headerActions.ts +0 -1
  44. package/dist/runtime/app/composables/icons.ts +0 -1
  45. package/dist/runtime/app/composables/seo.ts +0 -11
  46. package/dist/runtime/app/composables/tutorial.ts +0 -8
  47. package/dist/runtime/app/composables/useDocsAssistant.ts +0 -2
  48. package/dist/runtime/app/error.vue +0 -4
  49. package/dist/runtime/app/layouts/docs.vue +0 -6
  50. package/dist/runtime/app/middleware/docs-layout.ts +0 -9
  51. package/dist/runtime/app/plugins/comark-css.ts +0 -5
  52. package/dist/runtime/app/plugins/icon-stroke.ts +0 -3
  53. package/dist/runtime/app/plugins/theme-color.ts +0 -5
  54. package/dist/runtime/app/utils/docs-theme.ts +0 -9
  55. package/dist/runtime/app/utils/file-tree.ts +0 -4
  56. package/dist/runtime/server/llms.js +1 -1
  57. package/dist/runtime/server/markdown.js +2 -7
  58. package/dist/runtime/server/mcp.js +1 -1
  59. package/dist/runtime/server/page.js +2 -2
  60. package/dist/runtime/server/raw.js +1 -1
  61. package/dist/runtime/server/search.js +2 -3
  62. package/dist/runtime/server/sitemap.js +1 -1
  63. package/dist/runtime/theme/design.css +1 -1
  64. package/dist/runtime/theme/vitehub.css +386 -0
  65. package/dist/{schema-CmSiwC4t.js → schema-fumnVoRZ.js} +1 -3
  66. package/dist/server.js +2 -2
  67. package/dist/snapshot-worker.mjs +0 -5
  68. package/dist/theme-DowEsyAx.js +516 -0
  69. package/dist/{theme-CgJRnVdT.d.ts → theme-aPbJMLsc.d.ts} +0 -6
  70. package/dist/theme.d.ts +1 -1
  71. package/dist/theme.js +1 -1
  72. package/package.json +12 -12
  73. package/dist/theme-DRktv19v.js +0 -235
@@ -1,235 +0,0 @@
1
- import { vitehubTheme } from "@vite-hub/ui/theme";
2
- import { defu } from "defu";
3
- // runtime/app/utils/docs-theme.ts
4
- /**
5
- * The theme as `<UTheme>` props, for the docs pages of an app with its own `app.vue`. The app's `app.config.ts` then
6
- * stays as written on the app's own pages. `<UTheme>` sets slot classes and default props only, so the docs pages keep
7
- * the app's colors, icons, and variant classes, such as the color of a callout.
8
- */
9
- function docsThemeScope(theme) {
10
- const scope = {
11
- ui: {},
12
- props: {}
13
- };
14
- for (const [name, entry] of Object.entries(theme)) {
15
- if (name === "colors" || name === "icons" || !isRecord$1(entry)) continue;
16
- if (name === "prose") {
17
- const prose = docsThemeScope(entry);
18
- scope.ui.prose = prose.ui;
19
- if (Object.keys(prose.props).length) scope.props.prose = prose.props;
20
- continue;
21
- }
22
- const slots = isRecord$1(entry.slots) ? entry.slots : typeof entry.base === "string" ? { base: entry.base } : null;
23
- if (slots) scope.ui[name] = slots;
24
- if (isRecord$1(entry.defaultVariants)) scope.props[name] = entry.defaultVariants;
25
- }
26
- return scope;
27
- }
28
- function isRecord$1(value) {
29
- return typeof value === "object" && value !== null && !Array.isArray(value);
30
- }
31
- // src/theme.ts
32
- /**
33
- * The `ui` app config of the site. What the app writes in its Nuxt config wins over the design, and the design wins
34
- * over the rest, such as the green and slate defaults that Nuxt UI adds when the app lists `@nuxt/ui` before this
35
- * module. `app.config.ts` still wins over all of it at runtime.
36
- */
37
- function docsAppConfigUi(design, current, configured) {
38
- return [
39
- ...configured,
40
- design,
41
- current
42
- ].reduce((merged, layer) => defu(merged, layer ?? {}), {});
43
- }
44
- function callout(icon) {
45
- return {
46
- base: "border-default bg-muted text-default dark:text-default [&>ul]:marker:text-muted [&_code]:text-default dark:[&_code]:text-default [&_code]:border-default [&_a]:text-default [&_a]:hover:text-highlighted [&_a]:hover:border-default [&_a]:hover:[&>code]:border-default [&_a]:hover:[&>code]:text-highlighted",
47
- icon
48
- };
49
- }
50
- const framedTabs = "my-5 gap-0 rounded-lg border border-default";
51
- /**
52
- * The docs design: the ViteHub design system (`vitehubTheme`) plus the slots that only the docs shell has, such as the
53
- * header with search in the middle, the rail of areas next to a page list, the page grid, the outline, and prose.
54
- */
55
- function docsUi(siteName) {
56
- return defu({
57
- container: { base: "w-full max-w-none mx-0 px-0 sm:px-0 lg:px-0" },
58
- header: {
59
- defaultVariants: { menu: {
60
- title: "Navigation",
61
- description: `${siteName} site navigation`
62
- } },
63
- slots: {
64
- root: "vh-grain-surface border-b border-default h-(--ui-header-height) sticky top-0 z-50",
65
- container: "flex items-center justify-between gap-4 h-full max-w-none !ps-[1.125rem] !pe-4 lg:grid lg:grid-cols-[minmax(max-content,1fr)_minmax(12rem,24rem)_minmax(max-content,1fr)]",
66
- left: "flex min-w-0 items-center gap-8",
67
- center: "hidden lg:flex lg:w-full lg:items-center",
68
- right: "flex items-center justify-end gap-1",
69
- title: "shrink-0 font-semibold text-sm text-highlighted flex items-center gap-2 tracking-normal",
70
- toggle: "lg:hidden"
71
- }
72
- },
73
- pageAside: { slots: {
74
- root: "hidden h-[calc(100dvh-var(--ui-header-height))] overflow-hidden lg:block lg:sticky lg:top-(--ui-header-height) py-0 lg:ms-0 lg:ps-0 lg:pe-0",
75
- container: "relative flex h-full min-h-0 flex-col",
76
- topHeader: "hidden",
77
- topBody: "relative pointer-events-auto flex h-full min-h-0 flex-col mx-0 px-0",
78
- topFooter: "hidden"
79
- } },
80
- commandPalette: {
81
- slots: {
82
- item: "items-center",
83
- input: "[&_.iconify]:size-4 [&_.iconify]:mx-0.5"
84
- },
85
- variants: { size: { md: { itemLeadingIcon: "size-4 mx-0.5" } } }
86
- },
87
- dropdownMenu: {
88
- slots: { item: "items-center" },
89
- variants: { size: {
90
- xs: {
91
- itemLeadingIcon: "size-3.5",
92
- itemTrailingIcon: "size-3.5"
93
- },
94
- sm: {
95
- itemLeadingIcon: "size-3.5",
96
- itemTrailingIcon: "size-3.5"
97
- },
98
- md: {
99
- itemLeadingIcon: "size-4",
100
- itemTrailingIcon: "size-4"
101
- },
102
- lg: {
103
- itemLeadingIcon: "size-4",
104
- itemTrailingIcon: "size-4"
105
- },
106
- xl: {
107
- itemLeadingIcon: "size-4.5",
108
- itemTrailingIcon: "size-4.5"
109
- }
110
- } }
111
- },
112
- contentNavigation: {
113
- defaultVariants: {
114
- variant: "link",
115
- color: "neutral"
116
- },
117
- slots: {
118
- root: "space-y-0",
119
- link: "text-sm text-muted transition-colors hover:text-highlighted px-4 py-2 data-[active=true]:bg-elevated",
120
- linkLeadingIcon: "size-4 mr-2 text-muted",
121
- linkTitle: "truncate",
122
- linkTrailing: "hidden"
123
- }
124
- },
125
- pageLinks: { slots: {
126
- linkLeadingIcon: "size-4",
127
- linkLabelExternalIcon: "size-2.5"
128
- } },
129
- page: { slots: {
130
- root: "flex flex-col lg:!grid lg:!grid-cols-[var(--vh-sidebar-width)_minmax(0,1fr)] lg:gap-0 px-0",
131
- left: "lg:!col-span-1 lg:w-[var(--vh-sidebar-width)] lg:shrink-0 lg:border-e lg:border-default",
132
- center: "lg:!col-span-1 min-w-0",
133
- right: "order-first lg:order-last lg:!col-span-1 lg:w-[var(--vh-toc-width)] lg:shrink-0"
134
- } },
135
- pageHeader: { slots: {
136
- root: "relative border-b-0 px-4 pt-10 pb-2 sm:px-8",
137
- container: "flex flex-col",
138
- headline: "mb-2 text-[0.8125rem] font-normal text-dimmed",
139
- wrapper: "flex flex-row flex-wrap items-center lg:items-center justify-between gap-x-6 gap-y-3",
140
- title: "min-w-0 flex-[1_1_18rem] text-[2rem] sm:text-[2rem] leading-[1.15] tracking-[-0.015em] text-balance font-semibold text-highlighted",
141
- description: "mt-2 max-w-[34rem] text-[1.0625rem] leading-[1.7] text-pretty text-muted",
142
- links: "flex flex-wrap items-center gap-2"
143
- } },
144
- pageBody: { base: "mt-8 px-4 pb-24 sm:px-8" },
145
- pageGrid: { base: "grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-2" },
146
- contentSearchButton: {
147
- defaultVariants: {
148
- collapsed: false,
149
- label: "Search",
150
- variant: "ghost",
151
- color: "neutral"
152
- },
153
- slots: {
154
- base: "w-full justify-start rounded-md px-3 py-2 text-muted hover:text-highlighted",
155
- trailing: "ms-auto flex items-center gap-0.5"
156
- }
157
- },
158
- contentSearch: {
159
- defaultVariants: {
160
- placeholder: "Search",
161
- transition: false
162
- },
163
- slots: {
164
- modal: "vh-docs-search-modal w-[calc(100vw-1rem)] !max-w-[36rem] !h-auto max-h-[calc(100dvh-1rem)] sm:max-h-[70vh]",
165
- input: "[&>input]:h-14 [&>input]:text-lg"
166
- }
167
- },
168
- contentToc: {
169
- defaultVariants: { highlightVariant: "circuit" },
170
- slots: {
171
- root: "sticky top-(--ui-header-height) z-10 overflow-y-auto max-h-[calc(100vh-var(--ui-header-height))] lg:mx-0",
172
- container: "flex flex-col pt-10 pb-8 border-solid",
173
- title: "text-xs font-medium text-highlighted",
174
- link: "py-1 text-[0.8125rem] text-dimmed hover:text-highlighted data-[active]:text-highlighted"
175
- }
176
- },
177
- prose: {
178
- codeIcon: {
179
- js: "i-vscode-icons-file-type-js-official",
180
- mjs: "i-vscode-icons-file-type-js-official",
181
- txt: "i-vscode-icons-file-type-text"
182
- },
183
- a: { base: "font-normal underline underline-offset-[0.2em] decoration-(--ui-border) text-highlighted hover:decoration-current transition-colors" },
184
- callout: {
185
- slots: { base: "rounded-lg" },
186
- variants: { color: {
187
- info: callout("text-info"),
188
- warning: callout("text-warning"),
189
- error: callout("text-error"),
190
- success: callout("text-success")
191
- } }
192
- },
193
- card: { slots: { base: "rounded-lg" } },
194
- h2: { slots: {
195
- base: "relative mt-14 mb-4 border-t border-default pt-5 text-lg/[1.3] tracking-[-0.01em] text-highlighted font-semibold scroll-mt-[calc(1rem+var(--ui-header-height))]",
196
- leading: "hidden",
197
- link: "group"
198
- } },
199
- h3: { slots: {
200
- base: "relative mt-9 mb-2 font-mono text-sm/6 text-highlighted font-medium scroll-mt-[calc(1rem+var(--ui-header-height))]",
201
- leading: "hidden",
202
- link: "group"
203
- } },
204
- tabs: { slots: {
205
- root: framedTabs,
206
- list: "mb-0 px-2"
207
- } },
208
- tabsItem: { base: "p-0" },
209
- codeGroup: { slots: {
210
- root: framedTabs,
211
- list: "gap-1 border-0 border-b border-default rounded-t-lg bg-transparent px-2 py-0",
212
- indicator: "inset-y-auto -bottom-px h-px bg-(--ui-text-highlighted) shadow-none",
213
- trigger: "h-8 px-2.5 py-0 text-muted data-[state=active]:text-highlighted hover:bg-transparent hover:text-highlighted"
214
- } },
215
- code: { base: "inline box-decoration-clone wrap-break-word rounded-md border-0 bg-muted px-[0.35em] py-[0.1em] font-mono text-[0.8125rem]/[1.6] text-highlighted ring ring-inset ring-default data-nowrap:inline-block data-nowrap:w-max data-nowrap:max-w-full data-nowrap:wrap-anywhere" },
216
- pre: { slots: {
217
- root: "relative my-5 group",
218
- header: "flex items-center gap-1.5 border border-default bg-muted border-b-0 relative rounded-t-lg ps-4 pe-12 py-2.5 text-[0.8125rem]",
219
- filename: "min-w-0 wrap-anywhere",
220
- base: "group font-mono text-[0.8125rem]/6 border border-default bg-muted rounded-lg [[data-slot=header]+&]:rounded-t-none px-[0.9rem] py-[0.8rem] whitespace-pre-wrap wrap-break-word overflow-x-auto",
221
- copy: "pointer-coarse:opacity-100 pointer-coarse:size-9 pointer-coarse:justify-center pointer-coarse:top-[5px] pointer-coarse:end-[5px]"
222
- } },
223
- steps: { base: "vh-docs-steps ms-4 border-s border-default ps-8 [counter-reset:step]" }
224
- }
225
- }, vitehubTheme);
226
- }
227
- /** The part of the theme that only adds keys, so an app with its own `app.vue` gets it in its app config. */
228
- function docsThemeAdditions(theme) {
229
- const prose = isRecord(theme.prose) ? theme.prose : {};
230
- return isRecord(prose.codeIcon) ? { prose: { codeIcon: prose.codeIcon } } : {};
231
- }
232
- function isRecord(value) {
233
- return typeof value === "object" && value !== null && !Array.isArray(value);
234
- }
235
- export { docsThemeScope as i, docsThemeAdditions as n, docsUi as r, docsAppConfigUi as t };