@takazudo/zudo-doc 0.2.21 → 0.2.22

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 (275) hide show
  1. package/bin/gen-z-index.mjs +164 -0
  2. package/bin/tags-audit-runner.ts +126 -0
  3. package/bin/tags-audit.mjs +64 -0
  4. package/dist/ai-chat-modal/index.d.ts +8 -0
  5. package/dist/ai-chat-modal/index.js +243 -0
  6. package/dist/body-foot-util/body-foot-util-area.d.ts +4 -8
  7. package/dist/body-foot-util/edit-link.d.ts +4 -8
  8. package/dist/body-foot-util/index.d.ts +4 -3
  9. package/dist/breadcrumb/breadcrumb.d.ts +5 -9
  10. package/dist/breadcrumb/find-path.d.ts +2 -5
  11. package/dist/breadcrumb/index.d.ts +4 -4
  12. package/dist/breadcrumb/types.d.ts +3 -5
  13. package/dist/category-nav/index.d.ts +86 -0
  14. package/dist/category-nav/index.js +44 -0
  15. package/dist/category-tree-nav/index.d.ts +65 -0
  16. package/dist/category-tree-nav/index.js +24 -0
  17. package/dist/code-group/index.d.ts +10 -0
  18. package/dist/code-group/index.js +37 -0
  19. package/dist/code-syntax/code-block-enhancer-script.d.ts +1 -3
  20. package/dist/code-syntax/code-block-enhancer.d.ts +3 -6
  21. package/dist/code-syntax/index.d.ts +9 -8
  22. package/dist/code-syntax/mermaid-init-script.d.ts +3 -5
  23. package/dist/code-syntax/mermaid-init.d.ts +4 -7
  24. package/dist/code-syntax/tabs-init-script.d.ts +1 -3
  25. package/dist/code-syntax/tabs-init.d.ts +3 -6
  26. package/dist/code-syntax/tabs.d.ts +4 -7
  27. package/dist/color-scheme-utils.d.ts +125 -0
  28. package/dist/color-scheme-utils.js +151 -0
  29. package/dist/compose-meta-title/index.d.ts +7 -0
  30. package/dist/compose-meta-title/index.js +10 -0
  31. package/dist/content/component-map.d.ts +13 -17
  32. package/dist/content/content-blockquote.d.ts +3 -6
  33. package/dist/content/content-code.d.ts +3 -6
  34. package/dist/content/content-code.js +1 -1
  35. package/dist/content/content-link.d.ts +3 -6
  36. package/dist/content/content-link.js +1 -1
  37. package/dist/content/content-ol.d.ts +3 -6
  38. package/dist/content/content-paragraph.d.ts +3 -6
  39. package/dist/content/content-strong.d.ts +3 -6
  40. package/dist/content/content-table.d.ts +3 -6
  41. package/dist/content/content-ul.d.ts +3 -6
  42. package/dist/content/heading-h2.d.ts +3 -6
  43. package/dist/content/heading-h3.d.ts +3 -6
  44. package/dist/content/heading-h4.d.ts +3 -6
  45. package/dist/content/index.d.ts +29 -13
  46. package/dist/content-admonition/index.d.ts +15 -0
  47. package/dist/content-admonition/index.js +14 -0
  48. package/dist/design-token-panel-bootstrap.d.ts +38 -0
  49. package/dist/design-token-panel-bootstrap.js +29 -0
  50. package/dist/desktop-sidebar-toggle-island/index.d.ts +5 -0
  51. package/dist/desktop-sidebar-toggle-island/index.js +62 -0
  52. package/dist/details/details.d.ts +3 -7
  53. package/dist/details/index.d.ts +2 -2
  54. package/dist/doc-body-end/index.d.ts +21 -0
  55. package/dist/doc-body-end/index.js +15 -0
  56. package/dist/doc-content-header/index.d.ts +69 -0
  57. package/dist/doc-content-header/index.js +49 -0
  58. package/dist/doc-history/index.d.ts +10 -0
  59. package/dist/doc-history/index.js +407 -0
  60. package/dist/doc-history-area/index.d.ts +84 -0
  61. package/dist/doc-history-area/index.js +76 -0
  62. package/dist/doc-metainfo-area/index.d.ts +46 -0
  63. package/dist/doc-metainfo-area/index.js +41 -0
  64. package/dist/doc-page-props/index.d.ts +93 -0
  65. package/dist/doc-page-props/index.js +0 -0
  66. package/dist/doc-page-renderer/index.d.ts +128 -0
  67. package/dist/doc-page-renderer/index.js +103 -0
  68. package/dist/doc-page-shell/index.d.ts +136 -0
  69. package/dist/doc-page-shell/index.js +127 -0
  70. package/dist/doc-pager/index.d.ts +25 -0
  71. package/dist/doc-pager/index.js +41 -0
  72. package/dist/doc-route-entries/index.d.ts +125 -0
  73. package/dist/doc-route-entries/index.js +76 -0
  74. package/dist/doc-route-paths/index.d.ts +54 -0
  75. package/dist/doc-route-paths/index.js +61 -0
  76. package/dist/doc-tags-area/index.d.ts +38 -0
  77. package/dist/doc-tags-area/index.js +30 -0
  78. package/dist/doclayout/anchors.d.ts +7 -9
  79. package/dist/doclayout/doc-layout-with-defaults.d.ts +16 -12
  80. package/dist/doclayout/doc-layout.d.ts +5 -9
  81. package/dist/doclayout/index.d.ts +6 -6
  82. package/dist/extract-headings/index.d.ts +43 -0
  83. package/dist/extract-headings/index.js +111 -0
  84. package/dist/factory-context/index.d.ts +80 -0
  85. package/dist/factory-context/index.js +0 -0
  86. package/dist/features.css +882 -0
  87. package/dist/footer/footer.d.ts +4 -8
  88. package/dist/footer/index.d.ts +13 -3
  89. package/dist/footer/types.d.ts +4 -6
  90. package/dist/footer-with-defaults/index.d.ts +63 -0
  91. package/dist/footer-with-defaults/index.js +128 -0
  92. package/dist/frontmatter-preview-data/index.d.ts +26 -0
  93. package/dist/frontmatter-preview-data/index.js +23 -0
  94. package/dist/github-helpers/index.d.ts +17 -0
  95. package/dist/github-helpers/index.js +16 -0
  96. package/dist/head/doc-head.d.ts +3 -6
  97. package/dist/head/index.d.ts +9 -5
  98. package/dist/head/og-tags.d.ts +4 -7
  99. package/dist/head/twitter-card.d.ts +3 -6
  100. package/dist/head/types.d.ts +1 -3
  101. package/dist/head-with-defaults/index.d.ts +49 -0
  102. package/dist/head-with-defaults/index.js +62 -0
  103. package/dist/header/header.d.ts +6 -10
  104. package/dist/header/index.d.ts +16 -6
  105. package/dist/header/nav-active.d.ts +5 -7
  106. package/dist/header/nav-overflow-script.d.ts +1 -3
  107. package/dist/header/right-items.d.ts +3 -6
  108. package/dist/header/types.d.ts +10 -12
  109. package/dist/header-with-defaults/index.d.ts +77 -0
  110. package/dist/header-with-defaults/index.js +163 -0
  111. package/dist/html-preview-wrapper/dedent.d.ts +1 -3
  112. package/dist/html-preview-wrapper/highlighted-code.d.ts +3 -7
  113. package/dist/html-preview-wrapper/html-preview-wrapper.d.ts +6 -10
  114. package/dist/html-preview-wrapper/html-preview.d.ts +5 -9
  115. package/dist/html-preview-wrapper/index.d.ts +8 -5
  116. package/dist/html-preview-wrapper/preflight.d.ts +1 -3
  117. package/dist/html-preview-wrapper/preview-base.d.ts +4 -8
  118. package/dist/i18n-version/index.d.ts +7 -5
  119. package/dist/i18n-version/language-switcher.d.ts +5 -8
  120. package/dist/i18n-version/types.d.ts +3 -5
  121. package/dist/i18n-version/version-banner.d.ts +4 -8
  122. package/dist/i18n-version/version-switcher.d.ts +7 -10
  123. package/dist/icons/index.d.ts +9 -13
  124. package/dist/image-enlarge/index.d.ts +13 -0
  125. package/dist/image-enlarge/index.js +176 -0
  126. package/dist/index.d.ts +26 -2
  127. package/dist/inline-version-switcher/index.d.ts +31 -0
  128. package/dist/inline-version-switcher/index.js +44 -0
  129. package/dist/integrations/claude-resources/escape-for-mdx.d.ts +1 -3
  130. package/dist/integrations/claude-resources/generate.d.ts +2 -4
  131. package/dist/integrations/claude-resources/index.d.ts +7 -10
  132. package/dist/integrations/doc-history/index.d.ts +21 -24
  133. package/dist/integrations/doc-history/pre-build.d.ts +7 -9
  134. package/dist/integrations/llms-txt/dev-middleware.d.ts +7 -11
  135. package/dist/integrations/llms-txt/emit.d.ts +2 -7
  136. package/dist/integrations/llms-txt/generate.d.ts +3 -8
  137. package/dist/integrations/llms-txt/index.d.ts +33 -8
  138. package/dist/integrations/llms-txt/load.d.ts +3 -7
  139. package/dist/integrations/llms-txt/strip.d.ts +2 -6
  140. package/dist/integrations/llms-txt/types.d.ts +9 -13
  141. package/dist/integrations/search-index/build-emitter.d.ts +4 -7
  142. package/dist/integrations/search-index/collect.d.ts +2 -5
  143. package/dist/integrations/search-index/dev-middleware.d.ts +5 -8
  144. package/dist/integrations/search-index/index.d.ts +7 -5
  145. package/dist/integrations/search-index/types.d.ts +5 -7
  146. package/dist/island-types/index.d.ts +44 -0
  147. package/dist/island-types/index.js +12 -0
  148. package/dist/locale-merge/index.d.ts +114 -0
  149. package/dist/locale-merge/index.js +27 -0
  150. package/dist/math-block/index.d.ts +18 -0
  151. package/dist/math-block/index.js +29 -0
  152. package/dist/md-utils/index.d.ts +6 -8
  153. package/dist/md-utils/index.js +2 -1
  154. package/dist/mdx-components/index.d.ts +46 -0
  155. package/dist/mdx-components/index.js +161 -0
  156. package/dist/mermaid-enlarge/index.d.ts +11 -0
  157. package/dist/mermaid-enlarge/index.js +290 -0
  158. package/dist/metainfo/doc-metainfo.d.ts +5 -9
  159. package/dist/metainfo/doc-tags.d.ts +7 -11
  160. package/dist/metainfo/frontmatter-preview.d.ts +8 -12
  161. package/dist/metainfo/index.d.ts +6 -4
  162. package/dist/nav-data-prep/index.d.ts +72 -0
  163. package/dist/nav-data-prep/index.js +34 -0
  164. package/dist/nav-indexing/category-nav.d.ts +4 -8
  165. package/dist/nav-indexing/category-tree-nav.d.ts +4 -8
  166. package/dist/nav-indexing/doc-card-grid.d.ts +4 -8
  167. package/dist/nav-indexing/docs-sitemap.d.ts +4 -8
  168. package/dist/nav-indexing/index.d.ts +37 -10
  169. package/dist/nav-indexing/nav-card-grid.d.ts +4 -8
  170. package/dist/nav-indexing/site-tree-nav-demo.d.ts +4 -8
  171. package/dist/nav-indexing/tag-nav.d.ts +6 -10
  172. package/dist/nav-indexing/types.d.ts +6 -8
  173. package/dist/nav-indexing/versions-page-content.d.ts +4 -8
  174. package/dist/nav-scope/index.d.ts +41 -0
  175. package/dist/nav-scope/index.js +41 -0
  176. package/dist/nav-source-cache/index.d.ts +13 -0
  177. package/dist/nav-source-cache/index.js +28 -0
  178. package/dist/nav-source-docs/index.d.ts +169 -0
  179. package/dist/nav-source-docs/index.js +123 -0
  180. package/dist/page-loading/index.d.ts +1 -2
  181. package/dist/page-loading/page-loading-overlay.d.ts +4 -8
  182. package/dist/plugins/claude-resources.d.ts +3 -0
  183. package/dist/plugins/claude-resources.js +27 -0
  184. package/dist/plugins/connect-adapter.d.ts +31 -0
  185. package/dist/plugins/connect-adapter.js +78 -0
  186. package/dist/plugins/doc-history.d.ts +3 -0
  187. package/dist/plugins/doc-history.js +54 -0
  188. package/dist/plugins/llms-txt.d.ts +3 -0
  189. package/dist/plugins/llms-txt.js +48 -0
  190. package/dist/plugins/plugin-utils.d.ts +17 -0
  191. package/dist/plugins/plugin-utils.js +11 -0
  192. package/dist/plugins/search-index.d.ts +3 -0
  193. package/dist/plugins/search-index.js +24 -0
  194. package/dist/preset.d.ts +152 -0
  195. package/dist/preset.js +169 -0
  196. package/dist/render-markdown/index.d.ts +5 -0
  197. package/dist/render-markdown/index.js +115 -0
  198. package/dist/robots.d.ts +36 -0
  199. package/dist/robots.js +17 -0
  200. package/dist/route-enumerators/index.d.ts +204 -0
  201. package/dist/route-enumerators/index.js +156 -0
  202. package/dist/safelist.css +1 -1
  203. package/dist/search-widget/index.d.ts +38 -0
  204. package/dist/search-widget/index.js +169 -0
  205. package/dist/search-widget-script/index.d.ts +18 -0
  206. package/dist/search-widget-script/index.js +465 -0
  207. package/dist/settings.d.ts +255 -0
  208. package/dist/settings.js +0 -0
  209. package/dist/sidebar/index.d.ts +21 -3
  210. package/dist/sidebar/sidebar.d.ts +5 -9
  211. package/dist/sidebar/types.d.ts +4 -6
  212. package/dist/sidebar-prepaint/index.d.ts +21 -0
  213. package/dist/sidebar-prepaint/index.js +23 -0
  214. package/dist/sidebar-resizer/index.d.ts +2 -6
  215. package/dist/sidebar-resizer/sidebar-resizer-init.d.ts +6 -10
  216. package/dist/sidebar-toggle-island/index.d.ts +13 -0
  217. package/dist/sidebar-toggle-island/index.js +122 -0
  218. package/dist/sidebar-tree/build-tree.d.ts +4 -8
  219. package/dist/sidebar-tree/category-meta.d.ts +3 -6
  220. package/dist/sidebar-tree/index.d.ts +18 -3
  221. package/dist/sidebar-tree/types.d.ts +6 -8
  222. package/dist/sidebar-tree-island/index.d.ts +13 -0
  223. package/dist/sidebar-tree-island/index.js +454 -0
  224. package/dist/sidebar-utils/index.d.ts +64 -0
  225. package/dist/sidebar-utils/index.js +88 -0
  226. package/dist/sidebar-with-defaults/index.d.ts +38 -0
  227. package/dist/sidebar-with-defaults/index.js +45 -0
  228. package/dist/site-tree-nav/index.d.ts +71 -0
  229. package/dist/site-tree-nav/index.js +36 -0
  230. package/dist/site-tree-nav-island/index.d.ts +11 -0
  231. package/dist/site-tree-nav-island/index.js +176 -0
  232. package/dist/slug/index.d.ts +4 -0
  233. package/dist/slug/index.js +19 -0
  234. package/dist/smart-break/index.d.ts +55 -0
  235. package/dist/{toc/smart-break.js → smart-break/index.js} +30 -3
  236. package/dist/tab-item/index.d.ts +2 -2
  237. package/dist/tab-item/tab-item.d.ts +6 -7
  238. package/dist/tag-helpers/index.d.ts +40 -0
  239. package/dist/tag-helpers/index.js +54 -0
  240. package/dist/tag-pages/index.d.ts +114 -0
  241. package/dist/tag-pages/index.js +146 -0
  242. package/dist/tags-audit.d.ts +107 -0
  243. package/dist/tags-audit.js +321 -0
  244. package/dist/theme/color-scheme-provider.d.ts +4 -8
  245. package/dist/theme/color-tweak-export-modal.d.ts +4 -7
  246. package/dist/theme/design-token-serde.d.ts +14 -17
  247. package/dist/theme/design-token-types.d.ts +4 -6
  248. package/dist/theme/iframe-bridge.d.ts +12 -14
  249. package/dist/theme/index.d.ts +7 -9
  250. package/dist/theme/theme-toggle.d.ts +3 -8
  251. package/dist/theme-toggle/color-scheme-sync.d.ts +5 -7
  252. package/dist/theme-toggle/index.d.ts +4 -8
  253. package/dist/toc/cx.d.ts +2 -3
  254. package/dist/toc/index.d.ts +8 -6
  255. package/dist/toc/mobile-toc.d.ts +5 -9
  256. package/dist/toc/mobile-toc.js +1 -1
  257. package/dist/toc/toc-title.d.ts +1 -3
  258. package/dist/toc/toc.d.ts +5 -9
  259. package/dist/toc/toc.js +1 -1
  260. package/dist/toc/types.d.ts +1 -3
  261. package/dist/toc/use-active-heading.d.ts +4 -7
  262. package/dist/transitions/index.d.ts +1 -1
  263. package/dist/transitions/page-events.d.ts +4 -6
  264. package/dist/tree-nav-shared/index.d.ts +22 -0
  265. package/dist/tree-nav-shared/index.js +66 -0
  266. package/dist/url-helpers/index.d.ts +37 -0
  267. package/dist/url-helpers/index.js +106 -0
  268. package/dist/url-normalizer/index.d.ts +39 -1
  269. package/dist/url-normalizer/normalize.d.ts +3 -5
  270. package/dist/use-modal-dialog/index.d.ts +70 -0
  271. package/dist/use-modal-dialog/index.js +73 -0
  272. package/dist/versions-page/index.d.ts +55 -0
  273. package/dist/versions-page/index.js +73 -0
  274. package/package.json +290 -10
  275. package/dist/toc/smart-break.d.ts +0 -27
@@ -1,9 +1,7 @@
1
- import { ComponentChildren, VNode } from 'preact';
2
- import { BreadcrumbItem, SidebarNode } from './types.js';
3
-
4
1
  /** @jsxRuntime automatic */
5
2
  /** @jsxImportSource preact */
6
-
3
+ import type { ComponentChildren, VNode } from "preact";
4
+ import type { BreadcrumbItem, SidebarNode } from "./types.js";
7
5
  /**
8
6
  * Convert a sidebar tree + the current page's id into the ordered list
9
7
  * of crumbs the renderer walks. The first crumb is the home rung
@@ -15,8 +13,8 @@ import { BreadcrumbItem, SidebarNode } from './types.js';
15
13
  * src/utils/docs.ts so the rendered output stays parity-equivalent
16
14
  * with the original Astro breadcrumb component.
17
15
  */
18
- declare function buildBreadcrumbItems(tree: SidebarNode[], currentId: string, homeHref: string): BreadcrumbItem[];
19
- interface BreadcrumbProps {
16
+ export declare function buildBreadcrumbItems(tree: SidebarNode[], currentId: string, homeHref: string): BreadcrumbItem[];
17
+ export interface BreadcrumbProps {
20
18
  /** Pre-built items, or omit and pass `tree` + `currentId` instead. */
21
19
  items?: BreadcrumbItem[];
22
20
  /** Sidebar tree to derive the trail from. Required when `items` is omitted. */
@@ -52,6 +50,4 @@ interface BreadcrumbProps {
52
50
  * Returns null when no items resolve, matching the documented
53
51
  * `items.length > 0 &&` guard.
54
52
  */
55
- declare function Breadcrumb(props: BreadcrumbProps): VNode | null;
56
-
57
- export { Breadcrumb, type BreadcrumbProps, buildBreadcrumbItems };
53
+ export declare function Breadcrumb(props: BreadcrumbProps): VNode | null;
@@ -1,5 +1,4 @@
1
- import { BreadcrumbNode, SidebarNode } from './types.js';
2
-
1
+ import type { BreadcrumbNode, SidebarNode } from "./types.js";
3
2
  /**
4
3
  * Walk the sidebar tree and return the chain of nodes from the root
5
4
  * level down to (and including) the node whose `id` matches `targetId`.
@@ -11,6 +10,4 @@ import { BreadcrumbNode, SidebarNode } from './types.js';
11
10
  * ancestry. The home/root crumb is the renderer's responsibility — this
12
11
  * helper deals strictly with the tree itself.
13
12
  */
14
- declare function findPath<T extends BreadcrumbNode = SidebarNode>(nodes: readonly T[], targetId: string): T[];
15
-
16
- export { findPath };
13
+ export declare function findPath<T extends BreadcrumbNode = SidebarNode>(nodes: readonly T[], targetId: string): T[];
@@ -1,4 +1,4 @@
1
- export { Breadcrumb, BreadcrumbProps, buildBreadcrumbItems } from './breadcrumb.js';
2
- export { findPath } from './find-path.js';
3
- export { BreadcrumbItem, SidebarNode } from './types.js';
4
- import 'preact';
1
+ export { Breadcrumb, buildBreadcrumbItems } from "./breadcrumb.js";
2
+ export type { BreadcrumbProps } from "./breadcrumb.js";
3
+ export { findPath } from "./find-path.js";
4
+ export type { BreadcrumbItem, SidebarNode } from "./types.js";
@@ -7,7 +7,7 @@
7
7
  * is structurally assignable to this, so callers can pass either shape
8
8
  * unchanged.
9
9
  */
10
- interface BreadcrumbNode {
10
+ export interface BreadcrumbNode {
11
11
  type: "doc" | "category";
12
12
  id: string;
13
13
  label: string;
@@ -19,14 +19,12 @@ interface BreadcrumbNode {
19
19
  * Backward-compatible alias retained for callers that previously imported
20
20
  * `SidebarNode` from this subpath.
21
21
  */
22
- type SidebarNode = BreadcrumbNode;
22
+ export type SidebarNode = BreadcrumbNode;
23
23
  /**
24
24
  * One rung of the breadcrumb trail. `href` is omitted on the final
25
25
  * (current-page) item so the renderer can present it as plain text.
26
26
  */
27
- interface BreadcrumbItem {
27
+ export interface BreadcrumbItem {
28
28
  label: string;
29
29
  href?: string;
30
30
  }
31
-
32
- export type { BreadcrumbItem, BreadcrumbNode, SidebarNode };
@@ -0,0 +1,86 @@
1
+ /** @jsxRuntime automatic */
2
+ /** @jsxImportSource preact */
3
+ import type { JSX } from "preact";
4
+ /** Minimal nav node shape required by the category-nav factory. */
5
+ export interface CategoryNavNode {
6
+ label: string;
7
+ description?: string;
8
+ href?: string;
9
+ hasPage: boolean;
10
+ children: CategoryNavNode[];
11
+ }
12
+ /** Minimal nav source needed by the category-nav factory. */
13
+ export interface CategoryNavSource {
14
+ navDocs: unknown[];
15
+ categoryMeta: Map<string, unknown>;
16
+ }
17
+ /** Props for the CategoryNavWrapper component. */
18
+ export interface CategoryNavWrapperProps {
19
+ /**
20
+ * Slug of the category whose immediate children should be listed, e.g.
21
+ * "getting-started" or "guides/layout-demos".
22
+ */
23
+ category?: string;
24
+ /**
25
+ * Explicit list of top-level category slugs to render as cards. Use this
26
+ * when the target categories are not children of a single parent node in
27
+ * the nav tree (e.g. "claude-md", "claude-skills" are top-level siblings
28
+ * of "claude", not children). Each slug is resolved to its nav node; nodes
29
+ * not found in the tree are silently skipped.
30
+ *
31
+ * A `category_no_page` category has no route of its own, so its card links to
32
+ * the first routed descendant page (via firstRoutedHref); categories with no
33
+ * reachable page are skipped rather than emitting a dead link.
34
+ */
35
+ categories?: string[];
36
+ /**
37
+ * Active locale. Injected via createMdxComponents() closure.
38
+ * Defaults to defaultLocale when not provided.
39
+ */
40
+ lang?: string;
41
+ /** Optional extra CSS classes forwarded to the <nav> element. */
42
+ class?: string;
43
+ }
44
+ /** Injected dependencies for {@link createCategoryNavWrapper}. */
45
+ export interface CategoryNavDeps {
46
+ /** Default locale code (e.g. `"en"`). */
47
+ defaultLocale: string;
48
+ /**
49
+ * Resolve the identity-stable nav source for an EN/locale context.
50
+ * Host passes `resolveNavSource` from `pages/lib/_nav-source-docs.ts`.
51
+ */
52
+ resolveNavSource: (lang: string, currentVersion: string | undefined, options?: {
53
+ applyDefaultLocaleOnlyFilter?: boolean;
54
+ keepUnlisted?: boolean;
55
+ }) => CategoryNavSource;
56
+ /**
57
+ * Build the nav tree for a locale.
58
+ * Host passes `buildNavTree` from `@/utils/docs`.
59
+ */
60
+ buildNavTree: (docs: unknown[], locale: string, categoryMeta: Map<string, unknown>) => CategoryNavNode[];
61
+ /**
62
+ * Find a node by slug in the nav tree.
63
+ * Host passes `findNode` from `@/utils/docs`.
64
+ */
65
+ findNode: (tree: CategoryNavNode[], slug: string) => CategoryNavNode | undefined;
66
+ /**
67
+ * Recursively find the first href in a node's subtree.
68
+ * Host passes `firstRoutedHref` from `@/utils/docs`.
69
+ */
70
+ firstRoutedHref: (node: CategoryNavNode) => string | undefined;
71
+ }
72
+ /**
73
+ * Create the `CategoryNavWrapper` component bound to the host's nav source
74
+ * and tree-building dependencies.
75
+ *
76
+ * Supports two modes:
77
+ * - `category`: resolves immediate children of a single category node.
78
+ * - `categories`: resolves an explicit list of top-level slugs as cards.
79
+ * Use this when the target categories are siblings in the nav tree rather
80
+ * than children of a common parent (e.g. claude-md / claude-skills are
81
+ * top-level peers of claude, not children of it). A noPage category card
82
+ * links to its first routed descendant page (it has no route of its own).
83
+ *
84
+ * Returns null when no visible children are resolved.
85
+ */
86
+ export declare function createCategoryNavWrapper(deps: CategoryNavDeps): (props: CategoryNavWrapperProps) => JSX.Element | null;
@@ -0,0 +1,44 @@
1
+ import { jsx } from "preact/jsx-runtime";
2
+ import { CategoryNav as CategoryNavV2 } from "../nav-indexing/index.js";
3
+ function createCategoryNavWrapper(deps) {
4
+ const { defaultLocale, resolveNavSource, buildNavTree, findNode, firstRoutedHref } = deps;
5
+ function CategoryNavWrapper({
6
+ category,
7
+ categories,
8
+ lang = defaultLocale,
9
+ class: className
10
+ }) {
11
+ const locale = lang;
12
+ const { navDocs, categoryMeta } = resolveNavSource(locale, void 0, {
13
+ keepUnlisted: true
14
+ });
15
+ const tree = buildNavTree(navDocs, locale, categoryMeta);
16
+ let children;
17
+ if (categories !== void 0) {
18
+ children = categories.map((slug) => {
19
+ const node = findNode(tree, slug);
20
+ if (!node) return null;
21
+ const href = node.href ?? firstRoutedHref(node);
22
+ if (!href) return null;
23
+ return {
24
+ label: node.label,
25
+ description: node.description,
26
+ href,
27
+ hasPage: true,
28
+ children: []
29
+ };
30
+ }).filter((n) => n !== null);
31
+ } else if (category !== void 0) {
32
+ const categoryNode = findNode(tree, category);
33
+ children = categoryNode?.children.filter((c) => c.hasPage) ?? [];
34
+ } else {
35
+ return null;
36
+ }
37
+ if (children.length === 0) return null;
38
+ return /* @__PURE__ */ jsx(CategoryNavV2, { children, class: className });
39
+ }
40
+ return CategoryNavWrapper;
41
+ }
42
+ export {
43
+ createCategoryNavWrapper
44
+ };
@@ -0,0 +1,65 @@
1
+ /** @jsxRuntime automatic */
2
+ /** @jsxImportSource preact */
3
+ import type { JSX } from "preact";
4
+ /** Minimal nav node shape required by the category-tree-nav factory. */
5
+ export interface CategoryTreeNavNode {
6
+ label: string;
7
+ description?: string;
8
+ href?: string;
9
+ hasPage: boolean;
10
+ children: CategoryTreeNavNode[];
11
+ }
12
+ /** Minimal nav source needed by the category-tree-nav factory. */
13
+ export interface CategoryTreeNavSource {
14
+ navDocs: unknown[];
15
+ categoryMeta: Map<string, unknown>;
16
+ }
17
+ /** Props for the CategoryTreeNavWrapper component. */
18
+ export interface CategoryTreeNavWrapperProps {
19
+ /**
20
+ * Slug of the category whose children should be rendered as a tree,
21
+ * e.g. "guides" or "getting-started".
22
+ */
23
+ category: string;
24
+ /**
25
+ * Active locale. Injected via createMdxComponents() closure.
26
+ * Defaults to defaultLocale when not provided.
27
+ */
28
+ lang?: string;
29
+ }
30
+ /** Injected dependencies for {@link createCategoryTreeNavWrapper}. */
31
+ export interface CategoryTreeNavDeps {
32
+ /** Default locale code (e.g. `"en"`). */
33
+ defaultLocale: string;
34
+ /**
35
+ * Resolve the identity-stable nav source for an EN/locale context.
36
+ * Host passes `resolveNavSource` from `pages/lib/_nav-source-docs.ts`.
37
+ */
38
+ resolveNavSource: (lang: string, currentVersion: string | undefined, options?: {
39
+ applyDefaultLocaleOnlyFilter?: boolean;
40
+ keepUnlisted?: boolean;
41
+ }) => CategoryTreeNavSource;
42
+ /**
43
+ * Build the nav tree for a locale.
44
+ * Host passes `buildNavTree` from `@/utils/docs`.
45
+ */
46
+ buildNavTree: (docs: unknown[], locale: string, categoryMeta: Map<string, unknown>) => CategoryTreeNavNode[];
47
+ /**
48
+ * Group satellite nodes under target category prefixes in the nav tree.
49
+ * Host passes `groupSatelliteNodes` from `@/utils/docs`.
50
+ */
51
+ groupSatelliteNodes: (tree: CategoryTreeNavNode[], prefixes: string[]) => CategoryTreeNavNode[];
52
+ /**
53
+ * Find a node by slug in the nav tree.
54
+ * Host passes `findNode` from `@/utils/docs`.
55
+ */
56
+ findNode: (tree: CategoryTreeNavNode[], slug: string) => CategoryTreeNavNode | undefined;
57
+ }
58
+ /**
59
+ * Create the `CategoryTreeNavWrapper` component bound to the host's nav source
60
+ * and tree-building dependencies.
61
+ *
62
+ * Returns null when the category is not found or has no renderable children —
63
+ * matching the original Astro component's guard.
64
+ */
65
+ export declare function createCategoryTreeNavWrapper(deps: CategoryTreeNavDeps): (props: CategoryTreeNavWrapperProps) => JSX.Element | null;
@@ -0,0 +1,24 @@
1
+ import { jsx } from "preact/jsx-runtime";
2
+ import { CategoryTreeNav as CategoryTreeNavV2 } from "../nav-indexing/index.js";
3
+ function createCategoryTreeNavWrapper(deps) {
4
+ const { defaultLocale, resolveNavSource, buildNavTree, groupSatelliteNodes, findNode } = deps;
5
+ function CategoryTreeNavWrapper({
6
+ category,
7
+ lang = defaultLocale
8
+ }) {
9
+ const locale = lang;
10
+ const { navDocs, categoryMeta } = resolveNavSource(locale, void 0, {
11
+ keepUnlisted: true
12
+ });
13
+ const rawTree = buildNavTree(navDocs, locale, categoryMeta);
14
+ const tree = groupSatelliteNodes(rawTree, [category]);
15
+ const categoryNode = findNode(tree, category);
16
+ const children = categoryNode?.children.filter((c) => c.hasPage || c.children.length > 0) ?? [];
17
+ if (children.length === 0) return null;
18
+ return /* @__PURE__ */ jsx(CategoryTreeNavV2, { children });
19
+ }
20
+ return CategoryTreeNavWrapper;
21
+ }
22
+ export {
23
+ createCategoryTreeNavWrapper
24
+ };
@@ -0,0 +1,10 @@
1
+ /** @jsxRuntime automatic */
2
+ /** @jsxImportSource preact */
3
+ import type { ComponentChildren } from "preact";
4
+ type Props = {
5
+ tabs?: string[];
6
+ children?: ComponentChildren;
7
+ [key: string]: unknown;
8
+ };
9
+ export declare function CodeGroup({ tabs, children, name }: Props): import("preact").JSX.Element;
10
+ export {};
@@ -0,0 +1,37 @@
1
+ import { Fragment, jsx } from "preact/jsx-runtime";
2
+ import { Tabs } from "../code-syntax/index.js";
3
+ import { TabItem } from "../tab-item/index.js";
4
+ function toArray(children) {
5
+ if (!children) return [];
6
+ if (Array.isArray(children)) return children;
7
+ return [children];
8
+ }
9
+ function CodeGroup({ tabs = [], children, name }) {
10
+ const childArray = toArray(children);
11
+ const items = tabs.map((label, i) => {
12
+ const child = childArray[i];
13
+ return { label, child };
14
+ });
15
+ if (items.length === 0) {
16
+ return /* @__PURE__ */ jsx(Fragment, { children });
17
+ }
18
+ const groupId = typeof name === "string" ? name : void 0;
19
+ return /* @__PURE__ */ jsx(Tabs, { groupId, children: items.map(({ label, child }, i) => (
20
+ // value is suffixed with the index so two fences sharing a label
21
+ // (e.g. both titled "ts") get distinct stable tab identities; the
22
+ // label stays the visible text.
23
+ /* @__PURE__ */ jsx(
24
+ TabItem,
25
+ {
26
+ label,
27
+ value: `${label}-${i}`,
28
+ default: i === 0 ? true : void 0,
29
+ children: /* @__PURE__ */ jsx("div", { class: "code-group-panel", children: child })
30
+ },
31
+ `${label}-${i}`
32
+ )
33
+ )) });
34
+ }
35
+ export {
36
+ CodeGroup
37
+ };
@@ -1,3 +1 @@
1
- declare const CODE_BLOCK_ENHANCER_SCRIPT: string;
2
-
3
- export { CODE_BLOCK_ENHANCER_SCRIPT };
1
+ export declare const CODE_BLOCK_ENHANCER_SCRIPT: string;
@@ -1,8 +1,6 @@
1
- import { JSX } from 'preact';
2
-
3
1
  /** @jsxRuntime automatic */
4
2
  /** @jsxImportSource preact */
5
-
3
+ import type { JSX } from "preact";
6
4
  /**
7
5
  * Drop-in JSX replacement for the legacy `code-block-enhancer` component.
8
6
  *
@@ -17,6 +15,5 @@ import { JSX } from 'preact';
17
15
  * Transitions. Event names come from `BEFORE_NAVIGATE_EVENT` /
18
16
  * `AFTER_NAVIGATE_EVENT` in `../transitions/page-events.ts`.
19
17
  */
20
- declare function CodeBlockEnhancer(): JSX.Element;
21
-
22
- export { CodeBlockEnhancer, CodeBlockEnhancer as default };
18
+ export declare function CodeBlockEnhancer(): JSX.Element;
19
+ export default CodeBlockEnhancer;
@@ -1,8 +1,9 @@
1
- export { CodeBlockEnhancer, CodeBlockEnhancer as CodeBlockEnhancerDefault } from './code-block-enhancer.js';
2
- export { CODE_BLOCK_ENHANCER_SCRIPT } from './code-block-enhancer-script.js';
3
- export { MermaidInit, MermaidInit as MermaidInitDefault, MermaidInitProps } from './mermaid-init.js';
4
- export { MERMAID_CDN_MODULE_URL, MERMAID_INIT_SCRIPT, buildMermaidInitScript } from './mermaid-init-script.js';
5
- export { Tabs, Tabs as TabsDefault, TabsProps } from './tabs.js';
6
- export { TabsInit, TabsInit as TabsInitDefault } from './tabs-init.js';
7
- export { TABS_INIT_SCRIPT } from './tabs-init-script.js';
8
- import 'preact';
1
+ export { CodeBlockEnhancer, default as CodeBlockEnhancerDefault } from "./code-block-enhancer.js";
2
+ export { CODE_BLOCK_ENHANCER_SCRIPT } from "./code-block-enhancer-script.js";
3
+ export { MermaidInit, default as MermaidInitDefault, } from "./mermaid-init.js";
4
+ export type { MermaidInitProps } from "./mermaid-init.js";
5
+ export { MERMAID_INIT_SCRIPT, MERMAID_CDN_MODULE_URL, buildMermaidInitScript, } from "./mermaid-init-script.js";
6
+ export { Tabs, default as TabsDefault } from "./tabs.js";
7
+ export type { TabsProps } from "./tabs.js";
8
+ export { TabsInit, default as TabsInitDefault } from "./tabs-init.js";
9
+ export { TABS_INIT_SCRIPT } from "./tabs-init-script.js";
@@ -16,7 +16,7 @@
16
16
  * tests can override the URL — e.g. self-hosted mirrors, version-
17
17
  * locked deployments — without re-templating the whole script.
18
18
  */
19
- declare const MERMAID_CDN_MODULE_URL = "https://esm.sh/mermaid@11.15.0";
19
+ export declare const MERMAID_CDN_MODULE_URL = "https://esm.sh/mermaid@11.15.0";
20
20
  /**
21
21
  * Build the inline init script with a caller-supplied module URL.
22
22
  *
@@ -34,7 +34,7 @@ declare const MERMAID_CDN_MODULE_URL = "https://esm.sh/mermaid@11.15.0";
34
34
  * `MERMAID_CDN_MODULE_URL`) so existing callers keep working
35
35
  * unchanged.
36
36
  */
37
- declare function buildMermaidInitScript(cdnUrl: string): string;
37
+ export declare function buildMermaidInitScript(cdnUrl: string): string;
38
38
  /**
39
39
  * Default-URL init script. Built once at module load by passing
40
40
  * `MERMAID_CDN_MODULE_URL` to `buildMermaidInitScript`. Kept as the
@@ -46,6 +46,4 @@ declare function buildMermaidInitScript(cdnUrl: string): string;
46
46
  * CSP-allowlisted host) call `buildMermaidInitScript(yourUrl)` and
47
47
  * pass the result to `<MermaidInit script={…}/>`.
48
48
  */
49
- declare const MERMAID_INIT_SCRIPT: string;
50
-
51
- export { MERMAID_CDN_MODULE_URL, MERMAID_INIT_SCRIPT, buildMermaidInitScript };
49
+ export declare const MERMAID_INIT_SCRIPT: string;
@@ -1,8 +1,6 @@
1
- import { JSX } from 'preact';
2
-
3
1
  /** @jsxRuntime automatic */
4
2
  /** @jsxImportSource preact */
5
-
3
+ import type { JSX } from "preact";
6
4
  /**
7
5
  * Props for `<MermaidInit/>`.
8
6
  *
@@ -12,7 +10,7 @@ import { JSX } from 'preact';
12
10
  * `script` wins over `cdnUrl` when both are provided so a fully
13
11
  * hand-rolled script can short-circuit the builder entirely.
14
12
  */
15
- interface MermaidInitProps {
13
+ export interface MermaidInitProps {
16
14
  /**
17
15
  * Override the mermaid module URL the inline script imports at
18
16
  * runtime. Use this for self-hosted mirrors, version-pinned
@@ -43,6 +41,5 @@ interface MermaidInitProps {
43
41
  * a `MutationObserver` on `:root[style]` to re-render when the user
44
42
  * changes the color scheme via the color-tweak panel.
45
43
  */
46
- declare function MermaidInit(props?: MermaidInitProps): JSX.Element;
47
-
48
- export { MermaidInit, type MermaidInitProps, MermaidInit as default };
44
+ export declare function MermaidInit(props?: MermaidInitProps): JSX.Element;
45
+ export default MermaidInit;
@@ -1,3 +1 @@
1
- declare const TABS_INIT_SCRIPT: string;
2
-
3
- export { TABS_INIT_SCRIPT };
1
+ export declare const TABS_INIT_SCRIPT: string;
@@ -1,8 +1,6 @@
1
- import { JSX } from 'preact';
2
-
3
1
  /** @jsxRuntime automatic */
4
2
  /** @jsxImportSource preact */
5
-
3
+ import type { JSX } from "preact";
6
4
  /**
7
5
  * Drop-in JSX replacement for the legacy `tabs-init` component.
8
6
  *
@@ -19,6 +17,5 @@ import { JSX } from 'preact';
19
17
  *
20
18
  * Requires `<Tabs>` to have server-rendered the tab buttons in the DOM.
21
19
  */
22
- declare function TabsInit(): JSX.Element;
23
-
24
- export { TabsInit, TabsInit as default };
20
+ export declare function TabsInit(): JSX.Element;
21
+ export default TabsInit;
@@ -1,9 +1,7 @@
1
- import { ComponentChildren, JSX } from 'preact';
2
-
3
1
  /** @jsxRuntime automatic */
4
2
  /** @jsxImportSource preact */
5
-
6
- interface TabsProps {
3
+ import type { ComponentChildren, JSX } from "preact";
4
+ export interface TabsProps {
7
5
  /**
8
6
  * When set, clicking a tab in this group persists the chosen value to
9
7
  * `localStorage` under `tabs-group-{groupId}` and syncs all other
@@ -31,6 +29,5 @@ interface TabsProps {
31
29
  * </Tabs>
32
30
  * ```
33
31
  */
34
- declare function Tabs({ groupId, children }: TabsProps): JSX.Element;
35
-
36
- export { Tabs, type TabsProps, Tabs as default };
32
+ export declare function Tabs({ groupId, children }: TabsProps): JSX.Element;
33
+ export default Tabs;
@@ -0,0 +1,125 @@
1
+ /**
2
+ * Color-scheme MECHANISM — palette → `--zd-*` CSS custom-property injection.
3
+ *
4
+ * This module ships the pure computation layer used by every project that
5
+ * builds on @takazudo/zudo-doc. It is DATA-free: callers pass in their own
6
+ * color-scheme manifest and settings.
7
+ *
8
+ * Moved from the host's `src/config/color-scheme-utils.ts` as part of the
9
+ * package-first migration (S9a zudolab/zudo-doc#2333). The DATA (palette
10
+ * values, scheme names, `colorMode` settings) stays project-side.
11
+ */
12
+ /** A color reference: palette index (number) or direct color value (string) */
13
+ export type ColorRef = number | string;
14
+ export interface ColorScheme {
15
+ background: ColorRef;
16
+ foreground: ColorRef;
17
+ cursor: ColorRef;
18
+ selectionBg: ColorRef;
19
+ selectionFg: ColorRef;
20
+ palette: [
21
+ string,
22
+ string,
23
+ string,
24
+ string,
25
+ string,
26
+ string,
27
+ string,
28
+ string,
29
+ string,
30
+ string,
31
+ string,
32
+ string,
33
+ string,
34
+ string,
35
+ string,
36
+ string
37
+ ];
38
+ /** Optional, vestigial — no visible effect on rendering; carried only for
39
+ * the zdtp design-token panel config envelope. See project CLAUDE.md. */
40
+ shikiTheme?: string;
41
+ /** Optional semantic overrides. When omitted, defaults from
42
+ * `SEMANTIC_DEFAULTS` are used (surface=p0, muted=p8, accent=p5, …). */
43
+ semantic?: {
44
+ surface?: ColorRef;
45
+ muted?: ColorRef;
46
+ accent?: ColorRef;
47
+ accentHover?: ColorRef;
48
+ codeBg?: ColorRef;
49
+ codeFg?: ColorRef;
50
+ success?: ColorRef;
51
+ danger?: ColorRef;
52
+ warning?: ColorRef;
53
+ info?: ColorRef;
54
+ mermaidNodeBg?: ColorRef;
55
+ mermaidText?: ColorRef;
56
+ mermaidLine?: ColorRef;
57
+ mermaidLabelBg?: ColorRef;
58
+ mermaidNoteBg?: ColorRef;
59
+ chatUserBg?: ColorRef;
60
+ chatUserText?: ColorRef;
61
+ chatAssistantBg?: ColorRef;
62
+ chatAssistantText?: ColorRef;
63
+ /** UI chrome over user images — enlarge/close overlay buttons */
64
+ imageOverlayBg?: ColorRef;
65
+ imageOverlayFg?: ColorRef;
66
+ /** <mark> highlight for matched keywords in search results */
67
+ matchedKeywordBg?: ColorRef;
68
+ matchedKeywordFg?: ColorRef;
69
+ };
70
+ }
71
+ /** Default mapping: semantic token name → palette index */
72
+ export declare const SEMANTIC_DEFAULTS: Record<string, number>;
73
+ export declare const SEMANTIC_CSS_NAMES: Record<string, string>;
74
+ /** Resolve a ColorRef to a concrete color string.
75
+ * - number → palette[value]
76
+ * - string → used as-is
77
+ * - undefined → fallback */
78
+ export declare function resolveColor(value: ColorRef | undefined, palette: string[], fallback: string): string;
79
+ /** Resolve semantic colors with fallbacks to default palette slots */
80
+ export declare function resolveSemanticColors(scheme: ColorScheme): {
81
+ surface: string;
82
+ muted: string;
83
+ accent: string;
84
+ accentHover: string;
85
+ codeBg: string;
86
+ codeFg: string;
87
+ success: string;
88
+ danger: string;
89
+ warning: string;
90
+ info: string;
91
+ mermaidNodeBg: string;
92
+ mermaidText: string;
93
+ mermaidLine: string;
94
+ mermaidLabelBg: string;
95
+ mermaidNoteBg: string;
96
+ chatUserBg: string;
97
+ chatUserText: string;
98
+ chatAssistantBg: string;
99
+ chatAssistantText: string;
100
+ imageOverlayBg: string;
101
+ imageOverlayFg: string;
102
+ matchedKeywordBg: string;
103
+ matchedKeywordFg: string;
104
+ };
105
+ /** Convert a ColorScheme to a flat list of [cssProperty, value] pairs.
106
+ * The result is the exact set of `--zd-*` custom properties that the
107
+ * ColorSchemeProvider emits onto `:root`. */
108
+ export declare function schemeToCssPairs(scheme: ColorScheme): [string, string][];
109
+ /**
110
+ * Generate the `:root { --zd-* }` CSS block for a single active color scheme.
111
+ *
112
+ * The caller passes in the active `ColorScheme` object — resolved from the
113
+ * project's `colorSchemes` map and `settings.colorScheme`. This function is
114
+ * DATA-free: it performs no settings lookup itself.
115
+ */
116
+ export declare function generateCssCustomProperties(scheme: ColorScheme): string;
117
+ /**
118
+ * Generate the `:root { --zd-*: light-dark(…, …); }` CSS block for a
119
+ * light/dark pair.
120
+ *
121
+ * The caller passes in the `light` and `dark` `ColorScheme` objects — resolved
122
+ * from the project's `colorSchemes` map and `settings.colorMode`. This
123
+ * function is DATA-free.
124
+ */
125
+ export declare function generateLightDarkCssProperties(light: ColorScheme, dark: ColorScheme): string;