@vite-hub/docs 0.0.0-stage → 0.3.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.
Files changed (111) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +453 -2
  3. package/dist/agent-copy-BJp_Yf5d.js +33 -0
  4. package/dist/assistant-shared-CdtXowot.js +97 -0
  5. package/dist/assistant-shared-Dll_F_yy.d.ts +27 -0
  6. package/dist/assistant-worker.d.ts +11 -0
  7. package/dist/assistant-worker.js +16 -0
  8. package/dist/assistant.d.ts +14 -0
  9. package/dist/assistant.js +19 -0
  10. package/dist/content-9CINWiRf.js +171 -0
  11. package/dist/draft-DUBx--r9.js +45 -0
  12. package/dist/error-diagnostics-BoOsP6Y4.js +53 -0
  13. package/dist/index.d.ts +28 -0
  14. package/dist/index.js +27 -0
  15. package/dist/link-checker-redirects.d.ts +13 -0
  16. package/dist/link-checker-redirects.js +25 -0
  17. package/dist/manifest-D66AEF8F.js +420 -0
  18. package/dist/manifest-Dzp5-_AJ.d.ts +74 -0
  19. package/dist/markdown-Cn9-4oVG.js +378 -0
  20. package/dist/navigation.d.ts +284 -0
  21. package/dist/navigation.js +520 -0
  22. package/dist/nuxt-B5LrERKc.d.ts +240 -0
  23. package/dist/nuxt.d.ts +3 -0
  24. package/dist/nuxt.js +1485 -0
  25. package/dist/page-BbmSfZO8.js +81 -0
  26. package/dist/page-Dx2JD3y1.d.ts +74 -0
  27. package/dist/primitive-rail.d.ts +110 -0
  28. package/dist/primitive-rail.js +284 -0
  29. package/dist/raw-C03EUJKw.js +851 -0
  30. package/dist/redirects-BrbWFSzW.js +62 -0
  31. package/dist/runtime/app/app.vue +11 -0
  32. package/dist/runtime/app/assistant/DocsAssistant.vue +81 -0
  33. package/dist/runtime/app/assistant/DocsAssistantOff.vue +8 -0
  34. package/dist/runtime/app/assistant/DocsAssistantPanel.vue +322 -0
  35. package/dist/runtime/app/components/AppHeader.vue +368 -0
  36. package/dist/runtime/app/components/AppSearch.vue +68 -0
  37. package/dist/runtime/app/components/DocsAppShell.vue +62 -0
  38. package/dist/runtime/app/components/DocsArticle.vue +184 -0
  39. package/dist/runtime/app/components/DocsAsideFooter.vue +94 -0
  40. package/dist/runtime/app/components/DocsAsideLeftBody.vue +584 -0
  41. package/dist/runtime/app/components/DocsAsideLeftTop.vue +132 -0
  42. package/dist/runtime/app/components/DocsBrandMark.vue +52 -0
  43. package/dist/runtime/app/components/DocsCatalogFooter.vue +129 -0
  44. package/dist/runtime/app/components/DocsCodePanel.vue +388 -0
  45. package/dist/runtime/app/components/DocsCodePre.vue +120 -0
  46. package/dist/runtime/app/components/DocsHeaderActions.vue +4 -0
  47. package/dist/runtime/app/components/DocsLanding.vue +83 -0
  48. package/dist/runtime/app/components/DocsMarkdown.vue +64 -0
  49. package/dist/runtime/app/components/DocsPage.vue +149 -0
  50. package/dist/runtime/app/components/DocsPageCredits.vue +41 -0
  51. package/dist/runtime/app/components/DocsPageHeaderLinks.vue +120 -0
  52. package/dist/runtime/app/components/DocsRail.vue +239 -0
  53. package/dist/runtime/app/components/DocsSidebarStrip.vue +81 -0
  54. package/dist/runtime/app/components/DocsSidebars.vue +63 -0
  55. package/dist/runtime/app/components/OgImage/DocsPage.takumi.vue +33 -0
  56. package/dist/runtime/app/components/content/AgentOnly.vue +9 -0
  57. package/dist/runtime/app/components/content/CodeTree.vue +203 -0
  58. package/dist/runtime/app/components/content/ComarkHtml.vue +31 -0
  59. package/dist/runtime/app/components/content/Correct.vue +17 -0
  60. package/dist/runtime/app/components/content/Example.vue +260 -0
  61. package/dist/runtime/app/components/content/ExamplePreview.vue +6 -0
  62. package/dist/runtime/app/components/content/Examples.vue +71 -0
  63. package/dist/runtime/app/components/content/Incorrect.vue +17 -0
  64. package/dist/runtime/app/components/content/PageList.vue +206 -0
  65. package/dist/runtime/app/components/content/ProductFeatureItem.vue +43 -0
  66. package/dist/runtime/app/components/content/ProductFeatures.vue +17 -0
  67. package/dist/runtime/app/components/content/TutorialStep.vue +39 -0
  68. package/dist/runtime/app/composables/docs-assistant-problem.ts +59 -0
  69. package/dist/runtime/app/composables/docs-theme.ts +15 -0
  70. package/dist/runtime/app/composables/docs.ts +83 -0
  71. package/dist/runtime/app/composables/headerActions.ts +6 -0
  72. package/dist/runtime/app/composables/icons.ts +14 -0
  73. package/dist/runtime/app/composables/seo.ts +64 -0
  74. package/dist/runtime/app/composables/tutorial.ts +40 -0
  75. package/dist/runtime/app/composables/useDocsAssistant.ts +17 -0
  76. package/dist/runtime/app/error.vue +88 -0
  77. package/dist/runtime/app/layouts/default.vue +7 -0
  78. package/dist/runtime/app/layouts/docs.vue +104 -0
  79. package/dist/runtime/app/middleware/docs-layout.ts +23 -0
  80. package/dist/runtime/app/pages/docs-page.vue +3 -0
  81. package/dist/runtime/app/plugins/comark-css.ts +14 -0
  82. package/dist/runtime/app/plugins/icon-stroke.ts +12 -0
  83. package/dist/runtime/app/plugins/theme-color.ts +18 -0
  84. package/dist/runtime/app/utils/docs-theme.ts +43 -0
  85. package/dist/runtime/app/utils/file-tree.ts +40 -0
  86. package/dist/runtime/server/llms.d.ts +6 -0
  87. package/dist/runtime/server/llms.js +7 -0
  88. package/dist/runtime/server/markdown.d.ts +10 -0
  89. package/dist/runtime/server/markdown.js +11 -0
  90. package/dist/runtime/server/mcp.d.ts +6 -0
  91. package/dist/runtime/server/mcp.js +7 -0
  92. package/dist/runtime/server/page.d.ts +7 -0
  93. package/dist/runtime/server/page.js +27 -0
  94. package/dist/runtime/server/raw.d.ts +10 -0
  95. package/dist/runtime/server/raw.js +23 -0
  96. package/dist/runtime/server/search.d.ts +6 -0
  97. package/dist/runtime/server/search.js +32 -0
  98. package/dist/runtime/server/sitemap.d.ts +6 -0
  99. package/dist/runtime/server/sitemap.js +52 -0
  100. package/dist/runtime/server/trailing-slash.d.ts +10 -0
  101. package/dist/runtime/server/trailing-slash.js +28 -0
  102. package/dist/runtime/theme/design.css +464 -0
  103. package/dist/schema-DwpXW0VZ.js +98 -0
  104. package/dist/server.d.ts +15 -0
  105. package/dist/server.js +5 -0
  106. package/dist/theme-BXyu4uFL.d.ts +32 -0
  107. package/dist/theme-DzC8LtMH.js +237 -0
  108. package/dist/theme.d.ts +2 -0
  109. package/dist/theme.js +2 -0
  110. package/dist/types-BhG6vGfG.d.ts +212 -0
  111. package/package.json +141 -3
@@ -0,0 +1,464 @@
1
+ /*
2
+ * The docs design, after the comark-ui site: column widths, a faint grain on the page, prose, highlighted code, and the
3
+ * search modal. Colors, radii, fonts, and focus come from the ViteHub design system (`@vite-hub/ui/theme.css`), which
4
+ * the module scopes to `.vh-docs` before this file, so comark-ui's blocks, which read the Nuxt UI variables, follow along.
5
+ */
6
+
7
+ :root:where(.vh-docs) {
8
+ --ui-header-height: 3.5rem;
9
+ --ui-container: 90rem;
10
+ /* The rail is 3.5rem wide. The page panel sits next to it. The page uses the rest of the viewport. */
11
+ --vh-rail-width: 3.5rem;
12
+ --vh-panel-width: 15rem;
13
+ --vh-sidebar-width: calc(var(--vh-rail-width) + var(--vh-panel-width));
14
+ --vh-toc-width: 10rem;
15
+ /* The reading measure of prose. Code, tables, and examples are wider. */
16
+ --vh-content-width: 48rem;
17
+ /* T3 Code's surface grain, as comark-ui's typeset paints it: fractal noise at 3.5% opacity in a 256px tile. */
18
+ --vh-grain: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
19
+ --vh-ease-out: cubic-bezier(0.23, 1, 0.32, 1);
20
+ /* A raised control on a muted track, such as the thumb of a segmented switch. */
21
+ --vh-raised: var(--ui-bg);
22
+ }
23
+
24
+ :root:where(.vh-docs).dark {
25
+ --vh-raised: var(--ui-bg-accented);
26
+ }
27
+
28
+ /* The grain sits on the page, and on the sticky surfaces that cover it. It scrolls with them: a `fixed` background
29
+ would line the tiles up, but makes the browser repaint the whole page on every scrolled frame. */
30
+ :where(.vh-docs) body,
31
+ .vh-grain-surface {
32
+ background-color: var(--ui-bg);
33
+ background-image: var(--vh-grain);
34
+ background-repeat: repeat;
35
+ background-size: 256px 256px;
36
+ }
37
+
38
+ /* Highlighted code carries the light colors inline and the dark colors in variables. */
39
+ html:where(.vh-docs) .shiki span {
40
+ font-style: var(--shiki-light-font-style);
41
+ font-weight: var(--shiki-light-font-weight);
42
+ text-decoration: var(--shiki-light-text-decoration);
43
+ }
44
+
45
+ html:where(.vh-docs).dark .shiki span {
46
+ color: var(--shiki-dark) !important;
47
+ background-color: var(--shiki-dark-bg) !important;
48
+ font-style: var(--shiki-dark-font-style) !important;
49
+ font-weight: var(--shiki-dark-font-weight) !important;
50
+ text-decoration: var(--shiki-dark-text-decoration) !important;
51
+ }
52
+
53
+ /* Body text is the muted gray at 15px, and headings, links, and code take the strong color, as on the comark-ui site. */
54
+ .docs-content {
55
+ --tw-prose-headings: var(--ui-text-highlighted);
56
+ color: var(--ui-text-muted);
57
+ font-size: 0.9375rem;
58
+ line-height: 1.7;
59
+ }
60
+
61
+ .docs-content :where(p, li) {
62
+ text-wrap: pretty;
63
+ }
64
+
65
+ .docs-content strong {
66
+ color: var(--ui-text-highlighted);
67
+ font-weight: 500;
68
+ }
69
+
70
+ /* Steps keep the reading measure of prose. */
71
+ .docs-content .vh-docs-steps > :where(h3, p, ul, ol) {
72
+ max-width: var(--vh-content-width);
73
+ }
74
+
75
+ /*
76
+ * comark-ui draws the headings, and wraps one with an anchor in `.cl-heading`, so the space and the rule above a
77
+ * section go on the wrapper when there is one, and the type on the heading. A component marked `.not-prose`, such as
78
+ * a catalog of cards, styles its own headings.
79
+ */
80
+ .docs-content :where(h2, h3, h4) {
81
+ color: var(--ui-text-highlighted);
82
+ scroll-margin-top: calc(var(--ui-header-height) + 1rem);
83
+ }
84
+
85
+ .docs-content h2:not(.not-prose *) {
86
+ margin: 0;
87
+ font-size: 1.125rem;
88
+ font-weight: 600;
89
+ letter-spacing: -0.01em;
90
+ line-height: 1.3;
91
+ }
92
+
93
+ .docs-content :is(h2:not(.cl-heading > h2), .cl-heading:has(> h2)):not(.not-prose *) {
94
+ margin-top: 3.5rem;
95
+ margin-bottom: 1rem;
96
+ border-top: 1px solid var(--ui-border);
97
+ padding-top: 1.25rem;
98
+ }
99
+
100
+ .docs-content h3:not(.not-prose *) {
101
+ margin: 0;
102
+ font-family: var(--font-mono);
103
+ font-size: 0.875rem;
104
+ font-weight: 500;
105
+ line-height: 1.5;
106
+ }
107
+
108
+ .docs-content :is(h3:not(.cl-heading > h3), .cl-heading:has(> h3)):not(.not-prose *) {
109
+ margin-top: 2.25rem;
110
+ margin-bottom: 0.5rem;
111
+ }
112
+
113
+ .docs-content h4:not(.not-prose *) {
114
+ margin: 1.5rem 0 0.5rem;
115
+ font-size: 0.9375rem;
116
+ font-weight: 600;
117
+ }
118
+
119
+ /* Inside an example the headings are part of the rendered block, not sections of the page. */
120
+ .docs-content .docs-example-preview :is(h2:not(.cl-heading > h2), .cl-heading:has(> h2)) {
121
+ margin-top: 1.5rem;
122
+ border-top: 0;
123
+ padding-top: 0;
124
+ }
125
+
126
+ .docs-content h2 + p,
127
+ .docs-content h3 + p {
128
+ margin-top: 0.75rem;
129
+ }
130
+
131
+ /* comark-ui's code blocks bring their bar and leave the frame to the page: the soft surface in a hairline ring. */
132
+ .docs-content .ck {
133
+ margin-block: 1.25rem;
134
+ overflow: hidden;
135
+ border-radius: calc(var(--ui-radius) * 2);
136
+ background: var(--ui-bg-muted);
137
+ box-shadow: inset 0 0 0 1px var(--ui-border);
138
+ }
139
+
140
+ .docs-content .ck > pre {
141
+ margin: 0;
142
+ overflow-x: auto;
143
+ background: transparent !important;
144
+ padding: 0.8rem 0.9rem;
145
+ font-size: 0.8125rem;
146
+ line-height: 1.6;
147
+ }
148
+
149
+ /* Inside tabs, the tab row is the top of the frame, and the block is the rest. comark-ui puts the block's buttons in the
150
+ tab row, above the block, so the block must not clip them. */
151
+ .docs-content .ct .ck {
152
+ margin-block: 0;
153
+ overflow: visible;
154
+ border-radius: 0 0 10px 10px;
155
+ }
156
+
157
+ .docs-content blockquote {
158
+ border-left: 2px solid var(--ui-border);
159
+ padding-left: 1rem;
160
+ }
161
+
162
+ .docs-content table {
163
+ font-size: 0.875rem;
164
+ }
165
+
166
+ /* Long identifiers in prose break instead of widening the page on narrow phones. */
167
+ .docs-content :where(p, li) > code {
168
+ max-width: 100%;
169
+ overflow-wrap: break-word;
170
+ }
171
+
172
+ /* On a home page, the Markdown between the app's blocks keeps the reading measure and the gutter of a docs page. */
173
+ .vh-docs-home-prose {
174
+ width: 100%;
175
+ max-width: var(--vh-content-width);
176
+ margin-inline: auto;
177
+ padding: 0 1rem 4rem;
178
+ }
179
+
180
+ @media (min-width: 40rem) {
181
+ .vh-docs-home-prose {
182
+ padding-inline: 1.5rem;
183
+ }
184
+ }
185
+
186
+ /* Headings such as error codes have no spaces, so they break where needed on narrow phones. `anywhere`, not `break-word`, so it also works when a site puts a heading in a flex or grid item. */
187
+ .docs-content :where(h1, h2, h3, h4) {
188
+ overflow-wrap: anywhere;
189
+ }
190
+
191
+ /* A lone identifier in a table cell, such as a tool name, stays on one line. The table scrolls sideways instead. */
192
+ .docs-content td > code:only-child {
193
+ white-space: nowrap;
194
+ }
195
+
196
+ .docs-content th {
197
+ color: var(--ui-text-highlighted);
198
+ font-weight: 600;
199
+ }
200
+
201
+ /* The tabs frame the panel, so a code block inside it drops its own border and margin. */
202
+ .docs-content [role="tabpanel"] .code-block-wrapper {
203
+ margin: 0;
204
+ border: 0;
205
+ border-radius: 0;
206
+ }
207
+
208
+ /* A note under the code keeps a rule above it and the same inset as the code. */
209
+ .docs-content [role="tabpanel"] .code-block-wrapper:not(:last-child) {
210
+ border-bottom: 1px solid var(--ui-border);
211
+ }
212
+
213
+ .docs-content [role="tabpanel"] > * > :where(p, ul, ol) {
214
+ margin: 0;
215
+ padding: 0.75rem 1rem;
216
+ }
217
+
218
+ .docs-content [role="tabpanel"] pre {
219
+ border-width: 0 !important;
220
+ }
221
+
222
+ .docs-content .vh-docs-steps {
223
+ margin-top: 1rem;
224
+ margin-bottom: 2rem;
225
+ padding-left: 2rem;
226
+ }
227
+
228
+ .docs-content .vh-docs-steps > h3 {
229
+ margin-top: 1.5rem;
230
+ margin-bottom: 0.75rem;
231
+ font-size: 1rem;
232
+ line-height: 1.5rem;
233
+ }
234
+
235
+ .docs-content .vh-docs-steps > h3:first-child {
236
+ margin-top: 0;
237
+ }
238
+
239
+ .docs-content .vh-docs-steps > h3::before {
240
+ display: inline-grid;
241
+ width: 1.5rem;
242
+ height: 1.5rem;
243
+ margin-left: -3rem;
244
+ margin-right: 0.75rem;
245
+ place-items: center;
246
+ border: 1px solid var(--ui-border);
247
+ border-radius: 999px;
248
+ background: var(--ui-bg);
249
+ color: var(--ui-text-muted);
250
+ font-size: 0.75rem;
251
+ font-weight: 650;
252
+ line-height: 1;
253
+ counter-increment: step;
254
+ content: counter(step);
255
+ }
256
+
257
+ .docs-content .vh-docs-steps > p {
258
+ margin-top: 0.5rem;
259
+ margin-bottom: 0.75rem;
260
+ color: var(--ui-text-muted);
261
+ }
262
+
263
+ .docs-content .vh-docs-steps .code-block-wrapper {
264
+ margin-top: 0.75rem;
265
+ margin-bottom: 1rem;
266
+ }
267
+
268
+ .vh-docs-search-modal:has(input:placeholder-shown) [role="listbox"] {
269
+ display: none;
270
+ }
271
+
272
+ .vh-docs-search-modal {
273
+ position: fixed !important;
274
+ top: 4.5rem !important;
275
+ left: 50vw !important;
276
+ translate: -50% 0 !important;
277
+ width: min(640px, calc(100vw - 1rem)) !important;
278
+ margin: 0 !important;
279
+ overflow: hidden;
280
+ }
281
+
282
+ .vh-docs-search-modal button[aria-label="Close"] {
283
+ width: 2.5rem;
284
+ height: 2rem;
285
+ border: 1px solid var(--ui-border);
286
+ border-radius: calc(var(--ui-radius) * 1.5);
287
+ color: var(--ui-text-muted);
288
+ font-size: 0;
289
+ }
290
+
291
+ .vh-docs-search-modal button[aria-label="Close"] .iconify {
292
+ display: none;
293
+ }
294
+
295
+ .vh-docs-search-modal button[aria-label="Close"]::before {
296
+ font-size: 0.75rem;
297
+ content: "ESC";
298
+ }
299
+
300
+ /* Group labels match the small headings of the page list. */
301
+ .vh-docs-search-modal [role="group"] > [data-slot="label"] {
302
+ padding: 0.75rem 0.625rem 0.375rem;
303
+ color: var(--ui-text-highlighted);
304
+ font-size: 0.75rem;
305
+ font-weight: 500;
306
+ }
307
+
308
+ /* A result is a path line over its heading, then the matching text, like the docs catalog cards. */
309
+ .vh-docs-search-modal [role="option"] {
310
+ align-items: flex-start;
311
+ gap: 0.75rem;
312
+ padding: 0.625rem;
313
+ }
314
+
315
+ .vh-docs-search-modal [role="option"] [data-slot="itemLeadingIcon"] {
316
+ margin-top: 0.125rem;
317
+ }
318
+
319
+ .vh-docs-search-modal [data-slot="itemLabel"] {
320
+ display: flex;
321
+ flex-direction: column;
322
+ gap: 0.125rem;
323
+ overflow: visible;
324
+ white-space: normal;
325
+ }
326
+
327
+ .vh-search-path {
328
+ overflow: hidden;
329
+ color: var(--ui-text-dimmed);
330
+ font-size: 0.75rem;
331
+ line-height: 1rem;
332
+ text-overflow: ellipsis;
333
+ white-space: nowrap;
334
+ }
335
+
336
+ .vh-search-title {
337
+ color: var(--ui-text-highlighted);
338
+ font-weight: 500;
339
+ line-height: 1.25rem;
340
+ }
341
+
342
+ .vh-docs-search-modal [role="option"] [data-slot="itemDescription"] {
343
+ margin-top: 0.125rem;
344
+ font-size: 0.8125rem;
345
+ line-height: 1.25rem;
346
+ }
347
+
348
+ .vh-docs-search-modal mark {
349
+ border-radius: var(--ui-radius);
350
+ background: color-mix(in srgb, var(--ui-text-highlighted) 12%, transparent);
351
+ color: inherit;
352
+ }
353
+
354
+ /* Keep results above the bottom edge when the viewport is short, such as a tablet or phone in landscape. */
355
+ @media (min-width: 641px) {
356
+ .vh-docs-search-modal {
357
+ max-height: min(70vh, calc(100dvh - 4.5rem - 0.5rem));
358
+ }
359
+ }
360
+
361
+ @media (min-width: 641px) and (max-height: 37.5rem) {
362
+ .vh-docs-search-modal {
363
+ top: 0.5rem !important;
364
+ max-height: calc(100dvh - 1rem);
365
+ }
366
+ }
367
+
368
+ /* Touch screens have no Escape key, so the close button keeps its icon. It has no fill, so a 44px box looks the same. */
369
+ @media (pointer: coarse) {
370
+ .vh-docs-search-modal button[aria-label="Close"] {
371
+ width: 2.75rem;
372
+ height: 2.75rem;
373
+ justify-content: center;
374
+ border: 0;
375
+ }
376
+
377
+ /* Nuxt UI renders the icon as an `.iconify` span with a CSS mask, not as an inline SVG. */
378
+ .vh-docs-search-modal button[aria-label="Close"] .iconify {
379
+ display: block;
380
+ }
381
+
382
+ .vh-docs-search-modal button[aria-label="Close"]::before {
383
+ content: none;
384
+ }
385
+ }
386
+
387
+ /*
388
+ * Phones open search as a full screen sheet, as native search does. Before the first letter it lists
389
+ * the docs sections, so the sheet is never empty.
390
+ * Do not reset `translate` here: the CSS minifier merges `translate: none` into `transform`,
391
+ * so the base `translate: -50%` stayed and pushed the modal off the left edge.
392
+ */
393
+ @media (max-width: 640px) {
394
+ .vh-docs-search-modal {
395
+ top: 0 !important;
396
+ width: 100vw !important;
397
+ /* Min and max height, because the modal's important `h-auto` utility wins over a height here. */
398
+ min-height: 100dvh;
399
+ max-height: 100dvh;
400
+ border: 0;
401
+ border-radius: 0;
402
+ }
403
+
404
+ .vh-docs-search-modal > [data-slot="root"],
405
+ .vh-docs-search-modal [role="listbox"] {
406
+ flex: 1 1 auto;
407
+ min-height: 0;
408
+ }
409
+
410
+ .vh-docs-search-modal:has(input:placeholder-shown) [role="listbox"] {
411
+ display: flex;
412
+ }
413
+
414
+ .vh-docs-search-modal [data-slot="input"] {
415
+ padding-top: env(safe-area-inset-top, 0px);
416
+ }
417
+
418
+ .vh-docs-search-modal [data-slot="input"] > input {
419
+ padding-inline-end: 5rem;
420
+ }
421
+
422
+ .vh-docs-search-modal [data-slot="viewport"] {
423
+ padding-bottom: env(safe-area-inset-bottom, 0px);
424
+ }
425
+
426
+ .vh-docs-search-modal button[aria-label="Close"] {
427
+ width: auto;
428
+ height: 2.75rem;
429
+ padding-inline: 0.5rem;
430
+ border: 0;
431
+ color: var(--ui-text-highlighted);
432
+ }
433
+
434
+ .vh-docs-search-modal button[aria-label="Close"] .iconify {
435
+ display: none;
436
+ }
437
+
438
+ .vh-docs-search-modal button[aria-label="Close"]::before {
439
+ font-size: 0.9375rem;
440
+ content: "Cancel";
441
+ }
442
+ }
443
+
444
+ :where(.vh-docs) .code-block-wrapper pre {
445
+ margin: 0 !important;
446
+ overflow-x: auto;
447
+ border: none !important;
448
+ border-radius: 0 !important;
449
+ padding: 0.8rem 0.9rem !important;
450
+ font-size: 0.8125rem;
451
+ }
452
+
453
+ :where(.vh-docs) .code-block-wrapper .shiki {
454
+ min-height: 100%;
455
+ background-color: transparent !important;
456
+ }
457
+
458
+ @media (prefers-reduced-motion: reduce) {
459
+ :where(.vh-docs) *, :where(.vh-docs) *::before, :where(.vh-docs) *::after {
460
+ animation-duration: 0.01ms !important;
461
+ animation-iteration-count: 1 !important;
462
+ transition-duration: 0.01ms !important;
463
+ }
464
+ }
@@ -0,0 +1,98 @@
1
+ import { z } from "zod";
2
+ //#region src/schema.ts
3
+ /**
4
+ * How a page renders. `article` is prose with an outline, `tutorial` numbers its steps, `landing` is a wide Overview,
5
+ * and `home` is the page's own blocks at full width under the site header, without the docs sidebar, such as a
6
+ * product home page.
7
+ */
8
+ const docsLayouts = [
9
+ "article",
10
+ "tutorial",
11
+ "landing",
12
+ "home"
13
+ ];
14
+ const navigationFields = {
15
+ title: z.string().optional(),
16
+ order: z.number().optional(),
17
+ group: z.string().optional(),
18
+ kind: z.string().optional(),
19
+ panel: z.boolean().optional()
20
+ };
21
+ const seoFields = {
22
+ title: z.string().optional(),
23
+ description: z.string().optional(),
24
+ image: z.union([z.string(), z.literal(false)]).optional(),
25
+ index: z.boolean().optional()
26
+ };
27
+ const pageFields = {
28
+ title: z.string(),
29
+ description: z.string().optional(),
30
+ tagline: z.string().optional(),
31
+ eyebrow: z.string().optional(),
32
+ credits: z.string().optional(),
33
+ keywords: z.union([z.string(), z.array(z.string())]).optional(),
34
+ icon: z.string().optional(),
35
+ layout: z.enum(docsLayouts).optional(),
36
+ tutorial: z.enum(["project", "quickstart"]).optional(),
37
+ codePanel: z.boolean().optional(),
38
+ sidebar: z.union([z.boolean(), z.literal("collapsed")]).optional(),
39
+ toc: z.boolean().optional(),
40
+ navigation: z.union([z.literal(false), z.strictObject(navigationFields)]).optional(),
41
+ seo: z.strictObject(seoFields).optional()
42
+ };
43
+ /**
44
+ * Frontmatter fields of a docs page as files store them, one Standard Schema per field. `docsCollection()` passes them
45
+ * to `documents()`, so the Console editor validates the same values that the build validates, and a save writes
46
+ * dotted keys back as dotted keys.
47
+ */
48
+ const docsPageFields = {
49
+ ...pageFields,
50
+ "navigation.title": navigationFields.title,
51
+ "navigation.order": navigationFields.order,
52
+ "navigation.group": navigationFields.group,
53
+ "navigation.kind": navigationFields.kind,
54
+ "navigation.panel": navigationFields.panel,
55
+ "seo.title": seoFields.title,
56
+ "seo.description": seoFields.description,
57
+ "seo.image": seoFields.image,
58
+ "seo.index": seoFields.index
59
+ };
60
+ /** The build validates frontmatter with this schema after `docsFrontmatter()` expanded its dotted keys. */
61
+ const docsPageSchema = z.strictObject(pageFields);
62
+ const docsSectionSchema = z.strictObject({
63
+ title: z.string().optional(),
64
+ icon: z.string().optional(),
65
+ order: z.number().optional(),
66
+ category: z.string().optional(),
67
+ group: z.string().optional(),
68
+ fold: z.boolean().optional(),
69
+ related: z.array(z.string()).optional()
70
+ });
71
+ /** YAML keys such as `navigation.order: 2` become nested objects, as Markdown frontmatter writers expect. */
72
+ function expandDottedKeys(input) {
73
+ const output = {};
74
+ for (const [key, value] of Object.entries(input)) {
75
+ const parts = key.split(".");
76
+ let target = output;
77
+ for (const part of parts.slice(0, -1)) {
78
+ const next = target[part];
79
+ target = isRecord(next) ? next : target[part] = {};
80
+ }
81
+ target[parts.at(-1)] = value;
82
+ }
83
+ return output;
84
+ }
85
+ /**
86
+ * Frontmatter with its dotted keys expanded. `navigation: false` hides the page even when dotted keys such as
87
+ * `navigation.title` also set fields.
88
+ */
89
+ function docsFrontmatter(input) {
90
+ const expanded = expandDottedKeys(input);
91
+ if (input.navigation === false) expanded.navigation = false;
92
+ return expanded;
93
+ }
94
+ function isRecord(value) {
95
+ return typeof value === "object" && value !== null && !Array.isArray(value);
96
+ }
97
+ //#endregion
98
+ export { docsSectionSchema as a, docsPageSchema as i, docsLayouts as n, expandDottedKeys as o, docsPageFields as r, docsFrontmatter as t };
@@ -0,0 +1,15 @@
1
+ import { a as DocsParserOptions, c as docsSearchSections, i as DocsDocument, n as DocsPageResponse, o as createDocsParser, r as docsPageResponse, s as docsMarkdown, t as DocsPageLink } from "./page-Dx2JD3y1.js";
2
+ import { a as createDocsContent, c as checkDocsLinks, i as DocsSourceInput, n as DocsManifestOptions, o as createDocsManifest, r as DocsSource, s as DocsLinkCheckOptions, t as DocsContentSource } from "./manifest-Dzp5-_AJ.js";
3
+ //#region src/raw.d.ts
4
+ type RawMarkdownOptions = {
5
+ /** Origin that site-relative links point to, such as `https://vitehub.dev`. Empty keeps them relative. */
6
+ siteUrl?: string;
7
+ /** Rendered page path, such as `/docs/guide/install`, used to resolve document-relative links. */
8
+ pagePath?: string;
9
+ /** Keep `::agent-only` content. Defaults to `true`. */
10
+ includeAgentOnly?: boolean;
11
+ };
12
+ /** The page as an agent reads it: plain Markdown, links absolute, presentation blocks unwrapped, and a `# title`. */
13
+ export declare function toRawMarkdown(source: string, options?: RawMarkdownOptions): string;
14
+ //#endregion
15
+ export { type DocsContentSource, type DocsDocument, type DocsLinkCheckOptions, type DocsManifestOptions, type DocsPageLink, type DocsPageResponse, type DocsParserOptions, type DocsSource, type DocsSourceInput, type RawMarkdownOptions, checkDocsLinks, createDocsContent, createDocsManifest, createDocsParser, docsMarkdown, docsPageResponse, docsSearchSections };
package/dist/server.js ADDED
@@ -0,0 +1,5 @@
1
+ import { i as docsPageResponse } from "./page-BbmSfZO8.js";
2
+ import { c as checkDocsLinks, n as createDocsManifest, t as createDocsContent } from "./manifest-D66AEF8F.js";
3
+ import { t as toRawMarkdown } from "./raw-C03EUJKw.js";
4
+ import { a as docsSearchSections, i as docsMarkdown, t as createDocsParser } from "./markdown-Cn9-4oVG.js";
5
+ export { checkDocsLinks, createDocsContent, createDocsManifest, createDocsParser, docsMarkdown, docsPageResponse, docsSearchSections, toRawMarkdown };
@@ -0,0 +1,32 @@
1
+ //#region runtime/app/utils/docs-theme.d.ts
2
+ type DocsThemeUi$1 = Record<string, unknown>;
3
+ /** What Nuxt UI's `<UTheme>` takes: slot classes per component in `ui`, and default props per component in `props`. */
4
+ interface DocsThemeScope {
5
+ ui: Record<string, unknown>;
6
+ props: Record<string, unknown>;
7
+ }
8
+ /**
9
+ * The theme as `<UTheme>` props, for the docs pages of an app with its own `app.vue`. The app's `app.config.ts` then
10
+ * stays as written on the app's own pages. `<UTheme>` sets slot classes and default props only, so the docs pages keep
11
+ * the app's colors, icons, and variant classes, such as the color of a callout.
12
+ */
13
+ declare function docsThemeScope(theme: DocsThemeUi$1): DocsThemeScope;
14
+ //#endregion
15
+ //#region src/theme.d.ts
16
+ /** Nuxt UI app config of the docs design: color aliases, icons, and slot classes per component. */
17
+ type DocsThemeUi = Record<string, unknown>;
18
+ /**
19
+ * The `ui` app config of the site. What the app writes in its Nuxt config wins over the design, and the design wins
20
+ * over the rest, such as the green and slate defaults that Nuxt UI adds when the app lists `@nuxt/ui` before this
21
+ * module. `app.config.ts` still wins over all of it at runtime.
22
+ */
23
+ declare function docsAppConfigUi(design: DocsThemeUi, current: DocsThemeUi | undefined, configured: Array<DocsThemeUi | undefined>): DocsThemeUi;
24
+ /**
25
+ * The docs design: the ViteHub design system (`vitehubTheme`) plus the slots that only the docs shell has, such as the
26
+ * header with search in the middle, the rail of areas next to a page list, the page grid, the outline, and prose.
27
+ */
28
+ declare function docsUi(siteName: string): DocsThemeUi;
29
+ /** The part of the theme that only adds keys, so an app with its own `app.vue` gets it in its app config. */
30
+ declare function docsThemeAdditions(theme: DocsThemeUi): DocsThemeUi;
31
+ //#endregion
32
+ export { DocsThemeScope as a, docsUi as i, docsAppConfigUi as n, docsThemeScope as o, docsThemeAdditions as r, DocsThemeUi as t };