@takazudo/zudo-doc 10.0.3 → 12.0.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 (129) hide show
  1. package/CHANGELOG.md +47 -0
  2. package/dist/agent-docs/search.js +6 -3
  3. package/dist/asset-index-page/index.js +1 -1
  4. package/dist/asset-page/index.js +1 -1
  5. package/dist/asset-path/index.d.ts +2 -0
  6. package/dist/asset-path/index.js +1 -0
  7. package/dist/catalog.js +1 -1
  8. package/dist/chrome/derive.js +14 -2
  9. package/dist/compiled.css +178 -30
  10. package/dist/config-assertions/index.d.ts +54 -0
  11. package/dist/config-assertions/index.js +205 -0
  12. package/dist/config.d.ts +12 -9
  13. package/dist/config.js +13 -0
  14. package/dist/content/index.d.ts +1 -0
  15. package/dist/content/index.js +2 -0
  16. package/dist/content/wide-section-heading.d.ts +12 -0
  17. package/dist/content/wide-section-heading.js +8 -0
  18. package/dist/content-admonition/index.d.ts +2 -1
  19. package/dist/content-admonition/index.js +2 -1
  20. package/dist/doc-body-end-islands/index.d.ts +0 -7
  21. package/dist/doc-body-end-islands/index.js +0 -6
  22. package/dist/doc-card-nav/index.d.ts +78 -0
  23. package/dist/doc-card-nav/index.js +82 -0
  24. package/dist/doc-card-nav/slug.d.ts +6 -0
  25. package/dist/doc-card-nav/slug.js +6 -0
  26. package/dist/doc-page-renderer/index.d.ts +5 -0
  27. package/dist/doc-page-renderer/index.js +7 -0
  28. package/dist/doc-page-shell/index.d.ts +12 -0
  29. package/dist/doc-page-shell/index.js +6 -1
  30. package/dist/docs-schema/index.d.ts +2 -0
  31. package/dist/docs-schema/index.js +9 -0
  32. package/dist/features.css +201 -0
  33. package/dist/frontmatter-preview-defaults/index.js +3 -1
  34. package/dist/head-with-defaults/index.d.ts +20 -0
  35. package/dist/head-with-defaults/index.js +25 -3
  36. package/dist/home-hero/index.d.ts +36 -0
  37. package/dist/home-hero/index.js +128 -0
  38. package/dist/home-page/index.js +157 -58
  39. package/dist/i18n-defaults/index.js +8 -0
  40. package/dist/mcp/constants.d.ts +11 -0
  41. package/dist/mcp/constants.js +20 -0
  42. package/dist/mcp/discovery.d.ts +45 -0
  43. package/dist/mcp/discovery.js +138 -0
  44. package/dist/mcp/handler.js +5 -9
  45. package/dist/mcp/index.d.ts +3 -0
  46. package/dist/mcp/index.js +37 -1
  47. package/dist/md-utils/index.d.ts +6 -1
  48. package/dist/md-utils/index.js +3 -2
  49. package/dist/mdx-components/index.js +4 -7
  50. package/dist/mdx-components/vocabulary.d.ts +19 -0
  51. package/dist/mdx-components/vocabulary.js +32 -0
  52. package/dist/nav-indexing/doc-card-grid.d.ts +6 -0
  53. package/dist/nav-indexing/doc-card-grid.js +26 -16
  54. package/dist/plugins/internal/agent-export/components.d.ts +27 -0
  55. package/dist/plugins/internal/agent-export/components.js +125 -0
  56. package/dist/plugins/internal/agent-export/index.d.ts +4 -0
  57. package/dist/plugins/internal/agent-export/index.js +29 -8
  58. package/dist/plugins/internal/agent-export/normalize.d.ts +18 -1
  59. package/dist/plugins/internal/agent-export/normalize.js +91 -5
  60. package/dist/plugins/internal/llms-txt/dev-middleware.d.ts +2 -0
  61. package/dist/plugins/internal/llms-txt/dev-middleware.js +6 -1
  62. package/dist/plugins/internal/llms-txt/emit.js +8 -1
  63. package/dist/plugins/internal/llms-txt/generate.d.ts +2 -0
  64. package/dist/plugins/internal/llms-txt/generate.js +3 -0
  65. package/dist/plugins/internal/llms-txt/load.js +2 -2
  66. package/dist/plugins/internal/llms-txt/types.d.ts +4 -0
  67. package/dist/plugins/internal/search-index/collect.js +5 -4
  68. package/dist/plugins/internal/search-index/types.d.ts +2 -0
  69. package/dist/plugins/routes.js +6 -1
  70. package/dist/preset.d.ts +6 -1
  71. package/dist/preset.js +13 -1
  72. package/dist/robots.d.ts +14 -0
  73. package/dist/robots.js +22 -4
  74. package/dist/route-enumerators/index.d.ts +63 -2
  75. package/dist/route-enumerators/index.js +124 -21
  76. package/dist/routes/404.js +1 -1
  77. package/dist/routes/_context.d.ts +1 -1
  78. package/dist/routes/_context.js +6 -0
  79. package/dist/routes/ai-catalog.d.ts +5 -0
  80. package/dist/routes/ai-catalog.js +28 -0
  81. package/dist/routes/mcp-server-card.d.ts +5 -0
  82. package/dist/routes/mcp-server-card.js +24 -0
  83. package/dist/routes/sitemap.xml.js +19 -9
  84. package/dist/settings-defaults.js +1 -1
  85. package/dist/settings.d.ts +102 -6
  86. package/dist/sidebar/client-data.d.ts +1 -1
  87. package/dist/sidebar/client-data.js +2 -0
  88. package/dist/sidebar/types.d.ts +4 -0
  89. package/dist/sidebar-tree/build-tree.js +1 -0
  90. package/dist/sidebar-tree/types.d.ts +4 -0
  91. package/dist/site-schema/nav-tree.js +2 -0
  92. package/dist/site-schema/types.d.ts +3 -0
  93. package/dist/site-tree-nav/index.d.ts +18 -0
  94. package/dist/site-tree-nav/index.js +18 -3
  95. package/dist/site-tree-nav/normalize-island-props.d.ts +6 -0
  96. package/dist/site-tree-nav/normalize-island-props.js +15 -0
  97. package/dist/site-tree-nav-island/count.d.ts +3 -0
  98. package/dist/site-tree-nav-island/count.js +11 -0
  99. package/dist/site-tree-nav-island/index.d.ts +22 -2
  100. package/dist/site-tree-nav-island/index.js +272 -221
  101. package/dist/tag-pages/index.d.ts +1 -0
  102. package/dist/tag-pages/index.js +2 -2
  103. package/dist/theme-packs/bauhaus/meta.json +1 -1
  104. package/dist/theme-packs/bauhaus/pack.css +2 -2
  105. package/dist/theme-packs/beacon/meta.json +1 -1
  106. package/dist/theme-packs/beacon/pack.css +0 -15
  107. package/dist/theme-packs/eink/meta.json +1 -1
  108. package/dist/theme-packs/eink/pack.css +1 -14
  109. package/dist/theme.css +0 -16
  110. package/dist/versions-page/index.d.ts +1 -0
  111. package/dist/versions-page/index.js +1 -1
  112. package/dist/wind.json +4 -6
  113. package/eject/content-admonition/index.tsx +4 -9
  114. package/eject/sidebar/client-data.ts +3 -1
  115. package/eject/sidebar/types.ts +4 -0
  116. package/eject/site-tree-nav-island/count.ts +11 -0
  117. package/eject/site-tree-nav-island/index.tsx +359 -256
  118. package/package.json +19 -7
  119. package/routes-src/404.tsx +1 -1
  120. package/routes-src/_context.ts +3 -0
  121. package/routes-src/ai-catalog.tsx +26 -0
  122. package/routes-src/mcp-server-card.tsx +21 -0
  123. package/routes-src/sitemap.xml.tsx +36 -12
  124. package/dist/find-in-page/find-bar.d.ts +0 -11
  125. package/dist/find-in-page/find-bar.js +0 -103
  126. package/dist/find-in-page/find-in-page.d.ts +0 -17
  127. package/dist/find-in-page/find-in-page.js +0 -131
  128. package/dist/find-in-page/index.d.ts +0 -5
  129. package/dist/find-in-page/index.js +0 -52
@@ -4,6 +4,13 @@ import { SiteTreeNav } from "../site-tree-nav-island/index.js";
4
4
  import { remapVersionedHrefs } from "../nav-data-prep/index.js";
5
5
  import { resolveDateFormats } from "../date-format-resolve/index.js";
6
6
  import { normalizeSiteTreeNavProps } from "./normalize-island-props.js";
7
+ function resolveSiteTreeNavCountLabels(t, locale) {
8
+ if (!t) return void 0;
9
+ return {
10
+ one: t("siteTreeNav.documentCount.one", locale),
11
+ other: t("siteTreeNav.documentCount.other", locale)
12
+ };
13
+ }
7
14
  function createSiteTreeNavWrapper(deps) {
8
15
  const {
9
16
  defaultLocale,
@@ -14,12 +21,15 @@ function createSiteTreeNavWrapper(deps) {
14
21
  versionedDocsUrl,
15
22
  categoryIgnore,
16
23
  initiallyCollapsedCategorySlugs,
17
- dateFormat
24
+ dateFormat,
25
+ t
18
26
  } = deps;
19
27
  function SiteTreeNavWrapper({
20
28
  lang = defaultLocale,
21
29
  ariaLabel,
22
- currentVersion
30
+ currentVersion,
31
+ variant,
32
+ idPrefix
23
33
  }) {
24
34
  const locale = lang;
25
35
  const { navDocs, categoryMeta } = resolveNavSource(locale, currentVersion, {
@@ -40,12 +50,16 @@ function createSiteTreeNavWrapper(deps) {
40
50
  }
41
51
  }
42
52
  if (tree.length === 0) return null;
53
+ const countLabels = resolveSiteTreeNavCountLabels(t, locale);
43
54
  const islandProps = normalizeSiteTreeNavProps({
44
55
  tree,
45
56
  categoryOrder,
46
57
  ...categoryIgnore !== void 0 ? { categoryIgnore } : {},
47
58
  ...initiallyCollapsedCategorySlugs !== void 0 ? { initiallyCollapsedCategorySlugs } : {},
48
59
  ...ariaLabel !== void 0 ? { ariaLabel } : {},
60
+ ...variant !== void 0 && variant !== "default" ? { variant } : {},
61
+ ...variant === "described" && countLabels ? { countLabels } : {},
62
+ ...idPrefix !== void 0 ? { idPrefix } : {},
49
63
  locale,
50
64
  dateFormats: resolveDateFormats(dateFormat, locale)
51
65
  });
@@ -57,5 +71,6 @@ function createSiteTreeNavWrapper(deps) {
57
71
  return SiteTreeNavWrapper;
58
72
  }
59
73
  export {
60
- createSiteTreeNavWrapper
74
+ createSiteTreeNavWrapper,
75
+ resolveSiteTreeNavCountLabels
61
76
  };
@@ -2,6 +2,12 @@ import type { ResolvedDateFormats } from "../settings.js";
2
2
  import type { SidebarNavNode } from "../sidebar/types.js";
3
3
  export interface SiteTreeNavIslandProps {
4
4
  tree: SidebarNavNode[];
5
+ variant?: "default" | "described";
6
+ countLabels?: {
7
+ one: string;
8
+ other: string;
9
+ };
10
+ idPrefix?: string;
5
11
  categoryOrder: string[];
6
12
  categoryIgnore?: string[];
7
13
  initiallyCollapsedCategorySlugs?: string[];
@@ -21,6 +21,21 @@ function normalizeSiteTreeNavProps(input) {
21
21
  if (input.ariaLabel !== void 0) {
22
22
  normalized.ariaLabel = requireString(input.ariaLabel, "ariaLabel");
23
23
  }
24
+ if (input.variant !== void 0) {
25
+ if (input.variant !== "default" && input.variant !== "described") {
26
+ throw new TypeError("[zudo-doc] SiteTreeNav island variant is invalid.");
27
+ }
28
+ normalized.variant = input.variant;
29
+ }
30
+ if (input.countLabels !== void 0) {
31
+ normalized.countLabels = {
32
+ one: requireString(input.countLabels.one, "countLabels.one"),
33
+ other: requireString(input.countLabels.other, "countLabels.other")
34
+ };
35
+ }
36
+ if (input.idPrefix !== void 0) {
37
+ normalized.idPrefix = requireString(input.idPrefix, "idPrefix");
38
+ }
24
39
  return normalized;
25
40
  }
26
41
  function normalizeNodeArray(nodes, ancestors) {
@@ -0,0 +1,3 @@
1
+ import type { SidebarNavNode } from "../sidebar/types.js";
2
+ /** Published documents below a category (the category's own page excluded). */
3
+ export declare function countCategoryDocuments(node: SidebarNavNode): number;
@@ -0,0 +1,11 @@
1
+ function countCategoryDocuments(node) {
2
+ let count = 0;
3
+ for (const child of node.children) {
4
+ if (child.hasPage && child.href) count += 1;
5
+ count += countCategoryDocuments(child);
6
+ }
7
+ return count;
8
+ }
9
+ export {
10
+ countCategoryDocuments
11
+ };
@@ -1,5 +1,11 @@
1
1
  import type { SidebarNavNode } from "../sidebar/types.js";
2
2
  import type { ResolvedDateFormats } from "../settings.js";
3
+ /** Pluralized "N documents" templates for the described variant; `{count}` is replaced. */
4
+ export interface SiteTreeNavCountLabels {
5
+ one: string;
6
+ other: string;
7
+ }
8
+ export type SiteTreeNavVariant = "default" | "described";
3
9
  export interface SiteTreeNavProps {
4
10
  tree: SidebarNavNode[];
5
11
  ariaLabel?: string;
@@ -7,7 +13,7 @@ export interface SiteTreeNavProps {
7
13
  categoryIgnore?: string[];
8
14
  /** Exact full category slugs at any depth that should start collapsed. */
9
15
  initiallyCollapsedCategorySlugs?: string[];
10
- /** Locale used by dated note-tray rows. */
16
+ /** Locale used by dated note-tray rows and the described document count. */
11
17
  locale?: string;
12
18
  /**
13
19
  * Per-role date patterns already resolved for the page's locale, serialized
@@ -18,8 +24,22 @@ export interface SiteTreeNavProps {
18
24
  dateFormats?: ResolvedDateFormats;
19
25
  /** @deprecated — no longer rendered (created date only). */
20
26
  updatedLabel?: string;
27
+ /**
28
+ * `"described"` shows available category/document descriptions and each
29
+ * category's document count in a ~22rem-column grid; a lone category splits
30
+ * into summary + tree columns when its own box is wide enough. Omitted (or
31
+ * `"default"`) keeps the standard compact grid.
32
+ */
33
+ variant?: SiteTreeNavVariant;
34
+ /** Described-variant count templates (`{count}` placeholder). English when omitted. */
35
+ countLabels?: SiteTreeNavCountLabels;
36
+ /**
37
+ * Prefix for the disclosure-target ids. Give distinct values when several
38
+ * site trees share one page. @default "zd-site-tree"
39
+ */
40
+ idPrefix?: string;
21
41
  }
22
- export declare function SiteTreeNav({ tree, ariaLabel, categoryOrder, categoryIgnore, initiallyCollapsedCategorySlugs, locale, dateFormats, updatedLabel, }: SiteTreeNavProps): import("@takazudo/zfb").Description;
42
+ export declare function SiteTreeNav({ tree, ariaLabel, categoryOrder, categoryIgnore, initiallyCollapsedCategorySlugs, locale, dateFormats, updatedLabel, variant, countLabels, idPrefix, }: SiteTreeNavProps): import("@takazudo/zfb").Description;
23
43
  export declare namespace SiteTreeNav {
24
44
  var displayName: string;
25
45
  }