@vite-hub/docs 0.6.1 → 0.8.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 (55) hide show
  1. package/README.md +3 -3
  2. package/dist/agent-copy-DTCo8cLy.js +48 -0
  3. package/dist/{content-C_WXjV3y.js → content-Chgcvz1q.js} +2 -2
  4. package/dist/{draft-rOGhtXch.js → draft-BKQg2PLU.js} +1 -1
  5. package/dist/index.d.ts +5 -5
  6. package/dist/index.js +1 -1
  7. package/dist/{manifest-DJ2DyNue.d.ts → manifest-DmITPRKL.d.ts} +1 -1
  8. package/dist/{manifest-Bti_WxDZ.js → manifest-E4mohC7O.js} +4 -4
  9. package/dist/{markdown-B97RuMXs.d.ts → markdown-Ul8Z9B5A.d.ts} +1 -1
  10. package/dist/navigation.d.ts +6 -1
  11. package/dist/navigation.js +21 -4
  12. package/dist/{nuxt-CPt71DeE.d.ts → nuxt-B0kdfz6P.d.ts} +8 -3
  13. package/dist/nuxt.d.ts +1 -1
  14. package/dist/nuxt.js +40 -21
  15. package/dist/object-ycNFay7F.js +6 -0
  16. package/dist/{page-B8_70-5D.d.ts → page-Cp7sifcg.d.ts} +2 -2
  17. package/dist/primitive-rail.d.ts +1 -1
  18. package/dist/primitive-rail.js +3 -2
  19. package/dist/{raw-CQukuLuj.js → raw-Dh38kL9g.js} +1 -0
  20. package/dist/runnable.d.ts +2 -2
  21. package/dist/runtime/app/assistant/DocsAssistantPanel.vue +9 -5
  22. package/dist/runtime/app/components/AppHeader.vue +3 -9
  23. package/dist/runtime/app/components/DocsAsideLeftTop.vue +4 -10
  24. package/dist/runtime/app/components/DocsLearn.vue +9 -8
  25. package/dist/runtime/app/components/DocsLearnCodePre.vue +9 -20
  26. package/dist/runtime/app/components/DocsPageHeaderLinks.vue +1 -3
  27. package/dist/runtime/app/components/DocsPlayground.vue +3 -3
  28. package/dist/runtime/app/components/DocsRail.vue +14 -30
  29. package/dist/runtime/app/components/DocsRailTooltip.vue +18 -0
  30. package/dist/runtime/app/components/DocsSidebarStrip.vue +3 -7
  31. package/dist/runtime/app/components/DocsSidebars.vue +2 -1
  32. package/dist/runtime/app/components/content/CopyPrompt.vue +72 -0
  33. package/dist/runtime/app/components/content/Example.vue +2 -1
  34. package/dist/runtime/app/composables/docs.ts +11 -24
  35. package/dist/runtime/app/layouts/docs.vue +7 -0
  36. package/dist/runtime/app/plugins/vitehub-ui.ts +22 -0
  37. package/dist/runtime/server/llms.js +1 -1
  38. package/dist/runtime/server/markdown.js +2 -2
  39. package/dist/runtime/server/mcp.js +1 -1
  40. package/dist/runtime/server/page.d.ts +1 -1
  41. package/dist/runtime/server/page.js +2 -2
  42. package/dist/runtime/server/raw.js +1 -1
  43. package/dist/runtime/server/search.d.ts +1 -1
  44. package/dist/runtime/server/search.js +3 -3
  45. package/dist/runtime/server/sitemap.js +1 -1
  46. package/dist/runtime/theme/design.css +15 -0
  47. package/dist/{schema-CmSiwC4t.js → schema-fumnVoRZ.js} +1 -3
  48. package/dist/server.d.ts +3 -3
  49. package/dist/server.js +2 -2
  50. package/dist/{steps-C3tGwhNK.d.ts → steps-DzSu3r8K.d.ts} +1 -1
  51. package/dist/{theme-DRktv19v.js → theme-Bju84I9x.js} +7 -9
  52. package/dist/theme.js +1 -1
  53. package/dist/{types-B6YlHil4.d.ts → types-Dl6yjlwV.d.ts} +2 -0
  54. package/package.json +14 -11
  55. package/dist/agent-copy-CY9_RkHN.js +0 -32
@@ -1,4 +1,4 @@
1
- import { i as readDocsRawCopy } from "../../content-C_WXjV3y.js";
1
+ import { i as readDocsRawCopy } from "../../content-Chgcvz1q.js";
2
2
  import { HTTPError, defineHandler } from "nitro/h3";
3
3
  // src/runtime/server/raw.ts
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { a as DocsSearchSection } from "../../types-B6YlHil4.js";
1
+ import { a as DocsSearchSection } from "../../types-Dl6yjlwV.js";
2
2
  import { EventHandler, EventHandlerRequest } from "nitro/h3";
3
3
  declare const handler: EventHandler<EventHandlerRequest, Promise<DocsSearchSection[]>>;
4
4
  export { handler as default };
@@ -1,6 +1,6 @@
1
- import { docsIndexedPages, docsManifestPages, docsUnindexedSearchSections } from "../../navigation.js";
1
+ import { docsIndexedPages, docsManifestPages, docsPanelSearchSections, docsUnindexedSearchSections } from "../../navigation.js";
2
2
  import { a as docsSearchSections } from "../../markdown-BzZkYb24.js";
3
- import { r as readDocsPage } from "../../content-C_WXjV3y.js";
3
+ import { r as readDocsPage } from "../../content-Chgcvz1q.js";
4
4
  import manifest from "#docs/manifest";
5
5
  import { defineHandler } from "nitro/h3";
6
6
  // src/runtime/server/search.ts
@@ -19,7 +19,7 @@ async function buildIndex() {
19
19
  }
20
20
  sections.push(...docsUnindexedSearchSections(manifest));
21
21
  const listed = new Set(docsManifestPages(manifest).filter((page) => page.navigation).map((page) => page.path));
22
- return sections.filter((record) => listed.has(record.id.split("#")[0] ?? record.id));
22
+ return docsPanelSearchSections(manifest, sections.filter((record) => listed.has(record.id.split("#")[0] ?? record.id)));
23
23
  }
24
24
  let indexed;
25
25
  const handler = defineHandler(() => {
@@ -1,5 +1,5 @@
1
1
  import { docsCanonicalUrl } from "../../navigation.js";
2
- import { n as docsContent } from "../../content-C_WXjV3y.js";
2
+ import { n as docsContent } from "../../content-Chgcvz1q.js";
3
3
  import { useRuntimeConfig } from "nitro/runtime-config";
4
4
  import { defineHandler } from "nitro/h3";
5
5
  // ../internal/dist/sitemap.js
@@ -169,6 +169,21 @@ html:where(.vh-docs).dark .shiki span {
169
169
  overflow-wrap: break-word;
170
170
  }
171
171
 
172
+ /* A guide sits in a `ui-sdk` scope root, where the kit underlines plain links and boxes code. Its prose keeps the docs look. */
173
+ @layer kit {
174
+ .vh-docs-workspace .vh-ws-guide-content a:not([data-slot]) {
175
+ color: inherit;
176
+ text-decoration: inherit;
177
+ }
178
+
179
+ .vh-docs-workspace .vh-ws-guide-content pre code {
180
+ padding: 0;
181
+ border-radius: 0;
182
+ background: none;
183
+ font-size: inherit;
184
+ }
185
+ }
186
+
172
187
  /* On a home page, the Markdown between the app's blocks keeps the reading measure and the gutter of a docs page. */
173
188
  .vh-docs-home-prose {
174
189
  width: 100%;
@@ -1,3 +1,4 @@
1
+ import { t as isRecord } from "./object-ycNFay7F.js";
1
2
  import { z } from "zod";
2
3
  // src/schema.ts
3
4
  /**
@@ -183,7 +184,4 @@ function docsFrontmatter(input) {
183
184
  if (input.navigation === false) expanded.navigation = false;
184
185
  return expanded;
185
186
  }
186
- function isRecord(value) {
187
- return typeof value === "object" && value !== null && !Array.isArray(value);
188
- }
189
187
  export { docsSectionSchema as a, docsPageSchema as i, docsLayouts as n, expandDottedKeys as o, docsPageFields as r, docsFrontmatter as t };
package/dist/server.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- 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-DJ2DyNue.js";
2
- import { a as docsSearchSections, i as docsMarkdown, n as DocsParserOptions, r as createDocsParser, t as DocsDocument } from "./markdown-B97RuMXs.js";
3
- import { n as DocsPageResponse, r as docsPageResponse, t as DocsPageLink } from "./page-B8_70-5D.js";
1
+ 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-DmITPRKL.js";
2
+ import { a as docsSearchSections, i as docsMarkdown, n as DocsParserOptions, r as createDocsParser, t as DocsDocument } from "./markdown-Ul8Z9B5A.js";
3
+ import { n as DocsPageResponse, r as docsPageResponse, t as DocsPageLink } from "./page-Cp7sifcg.js";
4
4
  type RawMarkdownOptions = {
5
5
  /** Origin that site-relative links point to, such as `https://vitehub.dev`. Empty keeps them relative. */
6
6
  siteUrl?: string;
package/dist/server.js CHANGED
@@ -1,5 +1,5 @@
1
- import { l as checkDocsLinks, n as createDocsContent, r as createDocsManifest } from "./manifest-Bti_WxDZ.js";
1
+ import { l as checkDocsLinks, n as createDocsContent, r as createDocsManifest } from "./manifest-E4mohC7O.js";
2
2
  import { a as docsSearchSections, i as docsMarkdown, t as createDocsParser } from "./markdown-BzZkYb24.js";
3
- import { t as toRawMarkdown } from "./raw-CQukuLuj.js";
3
+ import { t as toRawMarkdown } from "./raw-Dh38kL9g.js";
4
4
  import { i as docsPageResponse } from "./page-DWsretqk.js";
5
5
  export { checkDocsLinks, createDocsContent, createDocsManifest, createDocsParser, docsMarkdown, docsPageResponse, docsSearchSections, toRawMarkdown };
@@ -1,4 +1,4 @@
1
- import { c as DocsConnectProvider } from "./types-B6YlHil4.js";
1
+ import { c as DocsConnectProvider } from "./types-Dl6yjlwV.js";
2
2
  import { WorkspaceRenderContext, WorkspaceRenderResult } from "@vite-hub/ui/workspace";
3
3
  import { Component } from "vue";
4
4
  /** Text files of an app, keyed by a relative path such as `server/api/greet.post.ts`. */
@@ -1,3 +1,4 @@
1
+ import { t as isRecord$1 } from "./object-ycNFay7F.js";
1
2
  import { vitehubTheme } from "@vite-hub/ui/theme";
2
3
  import { defu } from "defu";
3
4
  // runtime/app/utils/docs-theme.ts
@@ -12,20 +13,20 @@ function docsThemeScope(theme) {
12
13
  props: {}
13
14
  };
14
15
  for (const [name, entry] of Object.entries(theme)) {
15
- if (name === "colors" || name === "icons" || !isRecord$1(entry)) continue;
16
+ if (name === "colors" || name === "icons" || !isRecord(entry)) continue;
16
17
  if (name === "prose") {
17
18
  const prose = docsThemeScope(entry);
18
19
  scope.ui.prose = prose.ui;
19
20
  if (Object.keys(prose.props).length) scope.props.prose = prose.props;
20
21
  continue;
21
22
  }
22
- const slots = isRecord$1(entry.slots) ? entry.slots : typeof entry.base === "string" ? { base: entry.base } : null;
23
+ const slots = isRecord(entry.slots) ? entry.slots : typeof entry.base === "string" ? { base: entry.base } : null;
23
24
  if (slots) scope.ui[name] = slots;
24
- if (isRecord$1(entry.defaultVariants)) scope.props[name] = entry.defaultVariants;
25
+ if (isRecord(entry.defaultVariants)) scope.props[name] = entry.defaultVariants;
25
26
  }
26
27
  return scope;
27
28
  }
28
- function isRecord$1(value) {
29
+ function isRecord(value) {
29
30
  return typeof value === "object" && value !== null && !Array.isArray(value);
30
31
  }
31
32
  // src/theme.ts
@@ -226,10 +227,7 @@ function docsUi(siteName) {
226
227
  }
227
228
  /** The part of the theme that only adds keys, so an app with its own `app.vue` gets it in its app config. */
228
229
  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);
230
+ const prose = isRecord$1(theme.prose) ? theme.prose : {};
231
+ return isRecord$1(prose.codeIcon) ? { prose: { codeIcon: prose.codeIcon } } : {};
234
232
  }
235
233
  export { docsThemeScope as i, docsThemeAdditions as n, docsUi as r, docsAppConfigUi as t };
package/dist/theme.js CHANGED
@@ -1 +1 @@
1
- export { t as docsAppConfigUi, n as docsThemeAdditions, i as docsThemeScope, r as docsUi } from "./theme-DRktv19v.js";
1
+ export { t as docsAppConfigUi, n as docsThemeAdditions, i as docsThemeScope, r as docsUi } from "./theme-Bju84I9x.js";
@@ -269,5 +269,7 @@ interface DocsSearchSection {
269
269
  keywords?: string[];
270
270
  /** `false` on the one record of a page that search engines skip, such as a generated error code page. */
271
271
  indexed?: false;
272
+ /** `true` on the records of a panel's Overview and the pages inside the panel, such as the diagnostics of a section. */
273
+ panel?: true;
272
274
  }
273
275
  export { docsPageFields as _, DocsSearchSection as a, expandDottedKeys as b, DocsConnectProvider as c, DocsPageFrontmatter as d, DocsPageNavigation as f, docsLayouts as g, DocsSectionFile as h, DocsPageWorkspace as i, DocsLayout as l, DocsPlaygroundTab as m, DocsManifest as n, DocsSection as o, DocsPlaygroundExample as p, DocsPage as r, DocsTocLink as s, DocsAppPage as t, DocsPageFile as u, docsPageSchema as v, docsSectionSchema as y };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vite-hub/docs",
3
- "version": "0.6.1",
3
+ "version": "0.8.0",
4
4
  "description": "A documentation site on ViteHub primitives: typed Markdown pages, navigation, tutorials, search, agent resources, Console editing, and a docs assistant.",
5
5
  "keywords": [
6
6
  "content",
@@ -71,12 +71,15 @@
71
71
  "@nuxt/fonts": "^1.2.0",
72
72
  "@nuxt/kit": "4.6.4",
73
73
  "@takumi-rs/core": "2.22.1",
74
- "@vite-hub/content": "0.6.1",
75
- "@vite-hub/rate-limit": "0.6.1",
76
- "@vite-hub/source": "0.6.1",
77
- "@vite-hub/ui": "0.6.1",
78
- "@vite-hub/web-container": "0.6.1",
79
- "@vite-hub/workspace": "0.6.1",
74
+ "@ui-sdk/core": "0.1.0-beta.20",
75
+ "@ui-sdk/vue": "0.1.0-beta.20",
76
+ "@vite-hub/content": "0.8.0",
77
+ "@vite-hub/kit": "0.8.0",
78
+ "@vite-hub/rate-limit": "0.8.0",
79
+ "@vite-hub/source": "0.8.0",
80
+ "@vite-hub/ui": "0.8.0",
81
+ "@vite-hub/web-container": "0.8.0",
82
+ "@vite-hub/workspace": "0.8.0",
80
83
  "@vueuse/core": "^15.0.0",
81
84
  "comark-content": "0.5.1",
82
85
  "comark-zoom": "^0.14.3",
@@ -100,8 +103,8 @@
100
103
  "@nuxt/ui": "^4.13.0",
101
104
  "@types/node": "^24.19.2",
102
105
  "@vue/test-utils": "2.6.0",
103
- "@vite-hub/agent": "0.6.1",
104
- "@vite-hub/gateways": "0.6.1",
106
+ "@vite-hub/agent": "0.8.0",
107
+ "@vite-hub/gateways": "0.8.0",
105
108
  "@vite-hub/icons": "0.1.0",
106
109
  "@vite-hub/internal": "0.0.1",
107
110
  "comark": "^0.9.2",
@@ -125,8 +128,8 @@
125
128
  "@comark/html": "^0.8.1 || ^0.9.0",
126
129
  "@comark/vue": "^0.8.1 || ^0.9.0",
127
130
  "@nuxt/ui": "^4.11.0",
128
- "@vite-hub/agent": "0.6.1",
129
- "@vite-hub/gateways": "0.6.1",
131
+ "@vite-hub/agent": "0.8.0",
132
+ "@vite-hub/gateways": "0.8.0",
130
133
  "comark": "^0.8.1 || ^0.9.0",
131
134
  "comark-ui": "^0.14.3",
132
135
  "nuxt": "^4.7.0 || >=5.0.0-0",
@@ -1,32 +0,0 @@
1
- import { docsManifestPages, docsRawSectionLinks } from "./navigation.js";
2
- import { t as toRawMarkdown } from "./raw-CQukuLuj.js";
3
- // src/agent-copy.ts
4
- /**
5
- * The copy of a page that agents read at `/raw/<page>.md`: the source as plain Markdown with absolute links, then the
6
- * links of its section. `siteUrl` is the public origin with the app base, such as `https://docs.example.com/portal`.
7
- */
8
- function docsAgentCopy(manifest, page, source, siteUrl) {
9
- return {
10
- markdown: toRawMarkdown(source, {
11
- siteUrl,
12
- pagePath: page.path
13
- }),
14
- footer: docsRawSectionLinks(manifest, page.path, siteUrl)
15
- };
16
- }
17
- /** The Content Source of a page, named like `createDocsContent()` names it: `docs_<index>` for the server asset `docs-<index>`. */
18
- function docsContentSource(page) {
19
- return `docs_${page.source ? page.source.slice(5) : 0}`;
20
- }
21
- /** The pages of each Content Source of the docs, `docs_<index>`, by their file in the Source. */
22
- function docsAgentPages(manifest) {
23
- const sources = /* @__PURE__ */ new Map();
24
- for (const page of docsManifestPages(manifest)) {
25
- const name = docsContentSource(page);
26
- const pages = sources.get(name) ?? /* @__PURE__ */ new Map();
27
- pages.set(page.file, page);
28
- sources.set(name, pages);
29
- }
30
- return sources;
31
- }
32
- export { docsAgentPages as n, docsContentSource as r, docsAgentCopy as t };