@takazudo/zudo-doc 0.1.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 (255) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +18 -0
  3. package/dist/body-foot-util/body-foot-util-area.d.ts +55 -0
  4. package/dist/body-foot-util/body-foot-util-area.js +71 -0
  5. package/dist/body-foot-util/edit-link.d.ts +45 -0
  6. package/dist/body-foot-util/edit-link.js +42 -0
  7. package/dist/body-foot-util/index.d.ts +3 -0
  8. package/dist/body-foot-util/index.js +11 -0
  9. package/dist/breadcrumb/breadcrumb.d.ts +57 -0
  10. package/dist/breadcrumb/breadcrumb.js +113 -0
  11. package/dist/breadcrumb/find-path.d.ts +16 -0
  12. package/dist/breadcrumb/find-path.js +13 -0
  13. package/dist/breadcrumb/index.d.ts +4 -0
  14. package/dist/breadcrumb/index.js +7 -0
  15. package/dist/breadcrumb/types.d.ts +32 -0
  16. package/dist/breadcrumb/types.js +0 -0
  17. package/dist/code-syntax/code-block-enhancer-script.d.ts +3 -0
  18. package/dist/code-syntax/code-block-enhancer-script.js +165 -0
  19. package/dist/code-syntax/code-block-enhancer.d.ts +22 -0
  20. package/dist/code-syntax/code-block-enhancer.js +13 -0
  21. package/dist/code-syntax/index.d.ts +8 -0
  22. package/dist/code-syntax/index.js +29 -0
  23. package/dist/code-syntax/mermaid-init-script.d.ts +51 -0
  24. package/dist/code-syntax/mermaid-init-script.js +225 -0
  25. package/dist/code-syntax/mermaid-init.d.ts +48 -0
  26. package/dist/code-syntax/mermaid-init.js +14 -0
  27. package/dist/code-syntax/tabs-init-script.d.ts +3 -0
  28. package/dist/code-syntax/tabs-init-script.js +106 -0
  29. package/dist/code-syntax/tabs-init.d.ts +24 -0
  30. package/dist/code-syntax/tabs-init.js +10 -0
  31. package/dist/code-syntax/tabs.d.ts +36 -0
  32. package/dist/code-syntax/tabs.js +62 -0
  33. package/dist/content/component-map.d.ts +51 -0
  34. package/dist/content/component-map.js +29 -0
  35. package/dist/content/content-blockquote.d.ts +11 -0
  36. package/dist/content/content-blockquote.js +14 -0
  37. package/dist/content/content-code.d.ts +26 -0
  38. package/dist/content/content-code.js +39 -0
  39. package/dist/content/content-link.d.ts +12 -0
  40. package/dist/content/content-link.js +43 -0
  41. package/dist/content/content-ol.d.ts +11 -0
  42. package/dist/content/content-ol.js +15 -0
  43. package/dist/content/content-paragraph.d.ts +10 -0
  44. package/dist/content/content-paragraph.js +7 -0
  45. package/dist/content/content-strong.d.ts +11 -0
  46. package/dist/content/content-strong.js +14 -0
  47. package/dist/content/content-table.d.ts +11 -0
  48. package/dist/content/content-table.js +14 -0
  49. package/dist/content/content-ul.d.ts +11 -0
  50. package/dist/content/content-ul.js +15 -0
  51. package/dist/content/heading-h2.d.ts +14 -0
  52. package/dist/content/heading-h2.js +18 -0
  53. package/dist/content/heading-h3.d.ts +14 -0
  54. package/dist/content/heading-h3.js +18 -0
  55. package/dist/content/heading-h4.d.ts +14 -0
  56. package/dist/content/heading-h4.js +18 -0
  57. package/dist/content/index.d.ts +13 -0
  58. package/dist/content/index.js +27 -0
  59. package/dist/details/details.d.ts +26 -0
  60. package/dist/details/details.js +10 -0
  61. package/dist/details/index.d.ts +2 -0
  62. package/dist/details/index.js +4 -0
  63. package/dist/doclayout/anchors.d.ts +55 -0
  64. package/dist/doclayout/anchors.js +42 -0
  65. package/dist/doclayout/doc-layout-with-defaults.d.ts +83 -0
  66. package/dist/doclayout/doc-layout-with-defaults.js +159 -0
  67. package/dist/doclayout/doc-layout.d.ts +121 -0
  68. package/dist/doclayout/doc-layout.js +89 -0
  69. package/dist/doclayout/index.d.ts +6 -0
  70. package/dist/doclayout/index.js +17 -0
  71. package/dist/footer/footer.d.ts +42 -0
  72. package/dist/footer/footer.js +79 -0
  73. package/dist/footer/index.d.ts +3 -0
  74. package/dist/footer/index.js +4 -0
  75. package/dist/footer/types.d.ts +58 -0
  76. package/dist/footer/types.js +0 -0
  77. package/dist/head/doc-head.d.ts +33 -0
  78. package/dist/head/doc-head.js +90 -0
  79. package/dist/head/index.d.ts +5 -0
  80. package/dist/head/index.js +8 -0
  81. package/dist/head/og-tags.d.ts +25 -0
  82. package/dist/head/og-tags.js +16 -0
  83. package/dist/head/twitter-card.d.ts +21 -0
  84. package/dist/head/twitter-card.js +14 -0
  85. package/dist/head/types.d.ts +83 -0
  86. package/dist/head/types.js +0 -0
  87. package/dist/header/header.d.ts +158 -0
  88. package/dist/header/header.js +367 -0
  89. package/dist/header/index.d.ts +6 -0
  90. package/dist/header/index.js +18 -0
  91. package/dist/header/nav-active.d.ts +39 -0
  92. package/dist/header/nav-active.js +24 -0
  93. package/dist/header/nav-overflow-script.d.ts +3 -0
  94. package/dist/header/nav-overflow-script.js +169 -0
  95. package/dist/header/right-items.d.ts +38 -0
  96. package/dist/header/right-items.js +30 -0
  97. package/dist/header/types.d.ts +40 -0
  98. package/dist/header/types.js +0 -0
  99. package/dist/html-preview-wrapper/dedent.d.ts +10 -0
  100. package/dist/html-preview-wrapper/dedent.js +16 -0
  101. package/dist/html-preview-wrapper/highlighted-code.d.ts +18 -0
  102. package/dist/html-preview-wrapper/highlighted-code.js +53 -0
  103. package/dist/html-preview-wrapper/html-preview-wrapper.d.ts +60 -0
  104. package/dist/html-preview-wrapper/html-preview-wrapper.js +36 -0
  105. package/dist/html-preview-wrapper/html-preview.d.ts +35 -0
  106. package/dist/html-preview-wrapper/html-preview.js +75 -0
  107. package/dist/html-preview-wrapper/index.d.ts +5 -0
  108. package/dist/html-preview-wrapper/index.js +12 -0
  109. package/dist/html-preview-wrapper/preflight.d.ts +13 -0
  110. package/dist/html-preview-wrapper/preflight.js +108 -0
  111. package/dist/html-preview-wrapper/preview-base.d.ts +29 -0
  112. package/dist/html-preview-wrapper/preview-base.js +127 -0
  113. package/dist/i18n-version/index.d.ts +5 -0
  114. package/dist/i18n-version/index.js +14 -0
  115. package/dist/i18n-version/language-switcher.d.ts +24 -0
  116. package/dist/i18n-version/language-switcher.js +25 -0
  117. package/dist/i18n-version/types.d.ts +43 -0
  118. package/dist/i18n-version/types.js +0 -0
  119. package/dist/i18n-version/version-banner.d.ts +30 -0
  120. package/dist/i18n-version/version-banner.js +21 -0
  121. package/dist/i18n-version/version-switcher.d.ts +112 -0
  122. package/dist/i18n-version/version-switcher.js +157 -0
  123. package/dist/index.d.ts +2 -0
  124. package/dist/index.js +0 -0
  125. package/dist/integrations/claude-resources/escape-for-mdx.d.ts +8 -0
  126. package/dist/integrations/claude-resources/escape-for-mdx.js +131 -0
  127. package/dist/integrations/claude-resources/generate.d.ts +13 -0
  128. package/dist/integrations/claude-resources/generate.js +404 -0
  129. package/dist/integrations/claude-resources/index.d.ts +46 -0
  130. package/dist/integrations/claude-resources/index.js +24 -0
  131. package/dist/integrations/doc-history/index.d.ts +137 -0
  132. package/dist/integrations/doc-history/index.js +138 -0
  133. package/dist/integrations/doc-history/pre-build.d.ts +58 -0
  134. package/dist/integrations/doc-history/pre-build.js +67 -0
  135. package/dist/integrations/llms-txt/dev-middleware.d.ts +40 -0
  136. package/dist/integrations/llms-txt/dev-middleware.js +76 -0
  137. package/dist/integrations/llms-txt/emit.d.ts +22 -0
  138. package/dist/integrations/llms-txt/emit.js +55 -0
  139. package/dist/integrations/llms-txt/generate.d.ts +26 -0
  140. package/dist/integrations/llms-txt/generate.js +36 -0
  141. package/dist/integrations/llms-txt/index.d.ts +7 -0
  142. package/dist/integrations/llms-txt/index.js +27 -0
  143. package/dist/integrations/llms-txt/load.d.ts +51 -0
  144. package/dist/integrations/llms-txt/load.js +83 -0
  145. package/dist/integrations/llms-txt/strip.d.ts +22 -0
  146. package/dist/integrations/llms-txt/strip.js +10 -0
  147. package/dist/integrations/llms-txt/types.d.ts +145 -0
  148. package/dist/integrations/llms-txt/types.js +0 -0
  149. package/dist/integrations/search-index/build-emitter.d.ts +30 -0
  150. package/dist/integrations/search-index/build-emitter.js +15 -0
  151. package/dist/integrations/search-index/collect.d.ts +12 -0
  152. package/dist/integrations/search-index/collect.js +48 -0
  153. package/dist/integrations/search-index/content-files.d.ts +32 -0
  154. package/dist/integrations/search-index/content-files.js +50 -0
  155. package/dist/integrations/search-index/dev-middleware.d.ts +16 -0
  156. package/dist/integrations/search-index/dev-middleware.js +30 -0
  157. package/dist/integrations/search-index/index.d.ts +5 -0
  158. package/dist/integrations/search-index/index.js +14 -0
  159. package/dist/integrations/search-index/types.d.ts +38 -0
  160. package/dist/integrations/search-index/types.js +6 -0
  161. package/dist/metainfo/doc-metainfo.d.ts +50 -0
  162. package/dist/metainfo/doc-metainfo.js +107 -0
  163. package/dist/metainfo/doc-tags.d.ts +66 -0
  164. package/dist/metainfo/doc-tags.js +53 -0
  165. package/dist/metainfo/frontmatter-preview.d.ts +95 -0
  166. package/dist/metainfo/frontmatter-preview.js +55 -0
  167. package/dist/metainfo/index.d.ts +4 -0
  168. package/dist/metainfo/index.js +28 -0
  169. package/dist/nav-indexing/category-nav.d.ts +28 -0
  170. package/dist/nav-indexing/category-nav.js +41 -0
  171. package/dist/nav-indexing/category-tree-nav.d.ts +27 -0
  172. package/dist/nav-indexing/category-tree-nav.js +49 -0
  173. package/dist/nav-indexing/doc-card-grid.d.ts +38 -0
  174. package/dist/nav-indexing/doc-card-grid.js +40 -0
  175. package/dist/nav-indexing/docs-sitemap.d.ts +25 -0
  176. package/dist/nav-indexing/docs-sitemap.js +40 -0
  177. package/dist/nav-indexing/index.d.ts +10 -0
  178. package/dist/nav-indexing/index.js +18 -0
  179. package/dist/nav-indexing/nav-card-grid.d.ts +31 -0
  180. package/dist/nav-indexing/nav-card-grid.js +43 -0
  181. package/dist/nav-indexing/site-tree-nav-demo.d.ts +39 -0
  182. package/dist/nav-indexing/site-tree-nav-demo.js +65 -0
  183. package/dist/nav-indexing/tag-nav.d.ts +38 -0
  184. package/dist/nav-indexing/tag-nav.js +96 -0
  185. package/dist/nav-indexing/types.d.ts +95 -0
  186. package/dist/nav-indexing/types.js +0 -0
  187. package/dist/nav-indexing/versions-page-content.d.ts +29 -0
  188. package/dist/nav-indexing/versions-page-content.js +76 -0
  189. package/dist/page-loading/index.d.ts +2 -0
  190. package/dist/page-loading/index.js +10 -0
  191. package/dist/page-loading/page-loading-overlay.d.ts +35 -0
  192. package/dist/page-loading/page-loading-overlay.js +50 -0
  193. package/dist/sidebar/index.d.ts +3 -0
  194. package/dist/sidebar/index.js +4 -0
  195. package/dist/sidebar/sidebar.d.ts +54 -0
  196. package/dist/sidebar/sidebar.js +35 -0
  197. package/dist/sidebar/types.d.ts +71 -0
  198. package/dist/sidebar/types.js +0 -0
  199. package/dist/sidebar-resizer/index.d.ts +14 -0
  200. package/dist/sidebar-resizer/index.js +165 -0
  201. package/dist/sidebar-resizer/sidebar-resizer-init.d.ts +20 -0
  202. package/dist/sidebar-resizer/sidebar-resizer-init.js +119 -0
  203. package/dist/sidebar-tree/build-tree.d.ts +43 -0
  204. package/dist/sidebar-tree/build-tree.js +127 -0
  205. package/dist/sidebar-tree/category-meta.d.ts +19 -0
  206. package/dist/sidebar-tree/category-meta.js +63 -0
  207. package/dist/sidebar-tree/index.d.ts +3 -0
  208. package/dist/sidebar-tree/index.js +13 -0
  209. package/dist/sidebar-tree/types.d.ts +120 -0
  210. package/dist/sidebar-tree/types.js +0 -0
  211. package/dist/tab-item/index.d.ts +2 -0
  212. package/dist/tab-item/index.js +5 -0
  213. package/dist/tab-item/tab-item.d.ts +38 -0
  214. package/dist/tab-item/tab-item.js +25 -0
  215. package/dist/theme/color-scheme-provider.d.ts +32 -0
  216. package/dist/theme/color-scheme-provider.js +43 -0
  217. package/dist/theme/color-tweak-export-modal.d.ts +20 -0
  218. package/dist/theme/color-tweak-export-modal.js +138 -0
  219. package/dist/theme/design-token-serde.d.ts +136 -0
  220. package/dist/theme/design-token-serde.js +254 -0
  221. package/dist/theme/design-token-tweak-panel.d.ts +11 -0
  222. package/dist/theme/design-token-tweak-panel.js +10 -0
  223. package/dist/theme/design-token-types.d.ts +19 -0
  224. package/dist/theme/design-token-types.js +6 -0
  225. package/dist/theme/iframe-bridge.d.ts +44 -0
  226. package/dist/theme/iframe-bridge.js +70 -0
  227. package/dist/theme/index.d.ts +9 -0
  228. package/dist/theme/index.js +42 -0
  229. package/dist/theme/theme-toggle.d.ts +17 -0
  230. package/dist/theme/theme-toggle.js +91 -0
  231. package/dist/toc/cx.d.ts +16 -0
  232. package/dist/toc/cx.js +22 -0
  233. package/dist/toc/index.d.ts +5 -0
  234. package/dist/toc/index.js +9 -0
  235. package/dist/toc/mobile-toc.d.ts +46 -0
  236. package/dist/toc/mobile-toc.js +88 -0
  237. package/dist/toc/smart-break.d.ts +27 -0
  238. package/dist/toc/smart-break.js +36 -0
  239. package/dist/toc/toc-title.d.ts +10 -0
  240. package/dist/toc/toc-title.js +14 -0
  241. package/dist/toc/toc.d.ts +60 -0
  242. package/dist/toc/toc.js +56 -0
  243. package/dist/toc/types.d.ts +23 -0
  244. package/dist/toc/types.js +0 -0
  245. package/dist/toc/use-active-heading.d.ts +30 -0
  246. package/dist/toc/use-active-heading.js +106 -0
  247. package/dist/transitions/index.d.ts +1 -0
  248. package/dist/transitions/index.js +12 -0
  249. package/dist/transitions/page-events.d.ts +41 -0
  250. package/dist/transitions/page-events.js +20 -0
  251. package/dist/url-normalizer/index.d.ts +1 -0
  252. package/dist/url-normalizer/index.js +6 -0
  253. package/dist/url-normalizer/normalize.d.ts +104 -0
  254. package/dist/url-normalizer/normalize.js +22 -0
  255. package/package.json +186 -0
@@ -0,0 +1,40 @@
1
+ import { jsx, jsxs } from "preact/jsx-runtime";
2
+ function flattenTree(nodes) {
3
+ const result = [];
4
+ function collect(n) {
5
+ for (const node of n) {
6
+ if (node.hasPage) result.push(node);
7
+ collect(node.children);
8
+ }
9
+ }
10
+ collect(nodes);
11
+ return result;
12
+ }
13
+ function SitemapSection({ node, index }) {
14
+ const leaves = flattenTree(node.children);
15
+ return /* @__PURE__ */ jsxs("details", { class: "group border border-muted overflow-hidden", open: true, children: [
16
+ /* @__PURE__ */ jsxs("summary", { class: "flex items-center gap-x-hsp-md px-hsp-xl py-vsp-md text-title font-bold cursor-pointer select-none bg-surface list-none [&::-webkit-details-marker]:hidden", children: [
17
+ /* @__PURE__ */ jsx("span", { class: "inline-block text-caption text-muted transition-transform duration-200 group-open:rotate-90", children: "\u25B6" }),
18
+ node.href ? /* @__PURE__ */ jsx("a", { href: node.href, class: "hover:underline focus:underline", children: node.label }) : /* @__PURE__ */ jsx("span", { children: node.label })
19
+ ] }),
20
+ leaves.length > 0 && /* @__PURE__ */ jsx("div", { class: "px-hsp-xl py-vsp-md", children: /* @__PURE__ */ jsx("ul", { class: "space-y-vsp-2xs pl-[1.25rem] list-none", children: leaves.map((leaf, li) => /* @__PURE__ */ jsxs("li", { children: [
21
+ /* @__PURE__ */ jsx(
22
+ "a",
23
+ {
24
+ href: leaf.href,
25
+ class: "text-accent hover:underline focus:underline",
26
+ children: leaf.label
27
+ }
28
+ ),
29
+ leaf.description && /* @__PURE__ */ jsx("span", { class: "ml-hsp-sm text-small text-muted", children: leaf.description })
30
+ ] }, `leaf-${index}-${li}`)) }) })
31
+ ] }, `section-${index}`);
32
+ }
33
+ function DocsSitemap(props) {
34
+ const { tree } = props;
35
+ if (tree.length === 0) return null;
36
+ return /* @__PURE__ */ jsx("div", { class: "flex flex-col gap-y-vsp-lg", children: tree.map((node, i) => /* @__PURE__ */ jsx(SitemapSection, { node, index: i }, `sitemap-${i}`)) });
37
+ }
38
+ export {
39
+ DocsSitemap
40
+ };
@@ -0,0 +1,10 @@
1
+ export { CategoryNav, CategoryNavProps } from './category-nav.js';
2
+ export { CategoryTreeNav, CategoryTreeNavProps } from './category-tree-nav.js';
3
+ export { SiteTreeNavDemo, SiteTreeNavDemoProps } from './site-tree-nav-demo.js';
4
+ export { TagNav, TagNavAllProps, TagNavPageProps, TagNavProps } from './tag-nav.js';
5
+ export { DocsSitemap, DocsSitemapProps } from './docs-sitemap.js';
6
+ export { NavCardGrid, NavCardGridProps } from './nav-card-grid.js';
7
+ export { DocCardGrid, DocCardGridProps, DocCardItem } from './doc-card-grid.js';
8
+ export { VersionsPageContent, VersionsPageContentProps } from './versions-page-content.js';
9
+ export { NavNode, TagItem, TagLink, TagNavLabels, VersionPageEntry, VersionsPageLabels } from './types.js';
10
+ import 'preact';
@@ -0,0 +1,18 @@
1
+ import { CategoryNav } from "./category-nav.js";
2
+ import { CategoryTreeNav } from "./category-tree-nav.js";
3
+ import { SiteTreeNavDemo } from "./site-tree-nav-demo.js";
4
+ import { TagNav } from "./tag-nav.js";
5
+ import { DocsSitemap } from "./docs-sitemap.js";
6
+ import { NavCardGrid } from "./nav-card-grid.js";
7
+ import { DocCardGrid } from "./doc-card-grid.js";
8
+ import { VersionsPageContent } from "./versions-page-content.js";
9
+ export {
10
+ CategoryNav,
11
+ CategoryTreeNav,
12
+ DocCardGrid,
13
+ DocsSitemap,
14
+ NavCardGrid,
15
+ SiteTreeNavDemo,
16
+ TagNav,
17
+ VersionsPageContent
18
+ };
@@ -0,0 +1,31 @@
1
+ import { JSX } from 'preact';
2
+ import { NavNode } from './types.js';
3
+
4
+ /** @jsxRuntime automatic */
5
+ /** @jsxImportSource preact */
6
+
7
+ interface NavCardGridProps {
8
+ /**
9
+ * Direct children of the target category node. The consumer should
10
+ * pre-resolve `href` for each node (e.g. via `docsUrl(slug, locale)`).
11
+ * Nodes without `href` are skipped.
12
+ */
13
+ children: NavNode[];
14
+ /** Optional extra CSS classes appended to the `<nav>` element. */
15
+ class?: string;
16
+ }
17
+ /**
18
+ * NavCardGrid — JSX port of `src/components/nav-card-grid.astro`.
19
+ *
20
+ * Renders direct children of a category as a two-column grid of card links.
21
+ * Unlike `CategoryNav`, the arrow icon uses `text-accent` and sits inline with
22
+ * the label via `items-center`. Description lines have a hover-underline effect.
23
+ *
24
+ * The caller must pre-resolve `href` for each node. Nodes with neither
25
+ * `hasPage` nor children are excluded; nodes without an `href` are skipped.
26
+ *
27
+ * Returns `null` when no renderable items remain.
28
+ */
29
+ declare function NavCardGrid(props: NavCardGridProps): JSX.Element | null;
30
+
31
+ export { NavCardGrid, type NavCardGridProps };
@@ -0,0 +1,43 @@
1
+ import { jsx, jsxs } from "preact/jsx-runtime";
2
+ function ArrowIcon() {
3
+ return /* @__PURE__ */ jsx(
4
+ "svg",
5
+ {
6
+ xmlns: "http://www.w3.org/2000/svg",
7
+ fill: "currentColor",
8
+ viewBox: "0 0 103.395 107.049",
9
+ "aria-hidden": "true",
10
+ class: "w-[16px] shrink-0 text-accent",
11
+ children: /* @__PURE__ */ jsx("path", { d: "M5.746 5.74 0 11.49l20.987 20.96C34.126 45.572 41.963 53.45 41.948 53.523c-.012.062-9.456 9.544-20.986 21.07L0 95.55l5.714 5.715c3.142 3.143 5.748 5.715 5.79 5.715s2.63-2.563 5.75-5.696l17.939-18.001c21.867-21.94 29.443-29.599 29.443-29.768 0-.114-.665-.804-5.084-5.275C51.872 40.47 11.71.125 11.565.036 11.525.01 8.906 2.578 5.746 5.74m38.345-.066c-3.132 3.13-5.696 5.71-5.696 5.732-.001.022 2.16 2.185 4.8 4.807 2.641 2.623 8.382 8.338 12.758 12.702 15.38 15.337 23.763 23.641 24.314 24.086.19.153.346.336.346.405 0 .07-1.738 1.847-3.887 3.976a17515 17515 0 0 0-20.35 20.264 19555 19555 0 0 1-17.223 17.158c-.416.409-.757.77-.757.8 0 .083 11.415 11.485 11.457 11.445.235-.22 53.542-53.528 53.542-53.543C103.395 53.472 49.891.02 49.837 0c-.028-.01-2.613 2.543-5.746 5.674" })
12
+ }
13
+ );
14
+ }
15
+ function NavCardGrid(props) {
16
+ const { children, class: className } = props;
17
+ const items = children.filter(
18
+ (c) => (c.hasPage || c.children.length > 0) && c.href
19
+ );
20
+ if (items.length === 0) return null;
21
+ const navClass = [
22
+ "grid grid-cols-1 gap-x-hsp-lg gap-y-vsp-md sm:grid-cols-2",
23
+ className
24
+ ].filter(Boolean).join(" ");
25
+ return /* @__PURE__ */ jsx("nav", { "aria-label": "Child pages", class: navClass, children: items.map((child, i) => /* @__PURE__ */ jsxs(
26
+ "a",
27
+ {
28
+ href: child.href,
29
+ class: "group block rounded border border-muted bg-surface px-hsp-lg py-vsp-md hover:border-accent",
30
+ children: [
31
+ /* @__PURE__ */ jsxs("span", { class: "flex items-center gap-hsp-sm", children: [
32
+ /* @__PURE__ */ jsx(ArrowIcon, {}),
33
+ /* @__PURE__ */ jsx("span", { class: "font-medium text-accent group-hover:underline", children: child.label })
34
+ ] }),
35
+ child.description && /* @__PURE__ */ jsx("span", { class: "mt-vsp-2xs block text-small text-muted group-hover:underline decoration-muted", children: child.description })
36
+ ]
37
+ },
38
+ `nav-card-${i}`
39
+ )) });
40
+ }
41
+ export {
42
+ NavCardGrid
43
+ };
@@ -0,0 +1,39 @@
1
+ import { JSX } from 'preact';
2
+ import { NavNode } from './types.js';
3
+
4
+ /** @jsxRuntime automatic */
5
+ /** @jsxImportSource preact */
6
+
7
+ interface SiteTreeNavDemoProps {
8
+ /**
9
+ * Pre-built top-level tree nodes. The host calls buildNavTree (or
10
+ * buildSidebarTree) + groupSatelliteNodes before rendering this component.
11
+ */
12
+ tree: NavNode[];
13
+ /**
14
+ * Category slugs to pin at the front of the list, in order.
15
+ * Unmatched slugs are appended after the ordered ones.
16
+ */
17
+ categoryOrder?: string[];
18
+ /**
19
+ * Category slugs to exclude from the rendered tree entirely.
20
+ */
21
+ categoryIgnore?: string[];
22
+ /** aria-label for the wrapping <nav>. Defaults to "Site index". */
23
+ ariaLabel?: string;
24
+ }
25
+ /**
26
+ * SiteTreeNavDemo — JSX port of `src/components/site-tree-nav-demo.astro`.
27
+ *
28
+ * Renders the full site tree as a static collapsible section-by-section view.
29
+ * Each top-level category becomes a `<details>` block; leaves within each
30
+ * section are listed as links.
31
+ *
32
+ * The host assembles the tree (e.g. via `buildSidebarTree` from
33
+ * `@takazudo/zudo-doc/sidebar-tree`) and passes it as `tree`.
34
+ *
35
+ * Returns `null` when the tree is empty after filtering.
36
+ */
37
+ declare function SiteTreeNavDemo(props: SiteTreeNavDemoProps): JSX.Element | null;
38
+
39
+ export { SiteTreeNavDemo, type SiteTreeNavDemoProps };
@@ -0,0 +1,65 @@
1
+ import { jsx, jsxs } from "preact/jsx-runtime";
2
+ function flattenTree(nodes) {
3
+ const result = [];
4
+ function collect(n) {
5
+ for (const node of n) {
6
+ if (node.hasPage) result.push(node);
7
+ collect(node.children);
8
+ }
9
+ }
10
+ collect(nodes);
11
+ return result;
12
+ }
13
+ function reorder(nodes, order) {
14
+ if (!order.length) return nodes;
15
+ const remaining = [...nodes];
16
+ const result = [];
17
+ for (const slug of order) {
18
+ const idx = remaining.findIndex(
19
+ (n) => n.href?.includes(`/${slug}/`) || n.href?.includes(`/${slug}`)
20
+ );
21
+ if (idx !== -1) {
22
+ result.push(remaining.splice(idx, 1)[0]);
23
+ }
24
+ }
25
+ return [...result, ...remaining];
26
+ }
27
+ function Section({ node }) {
28
+ const leaves = flattenTree(node.children);
29
+ return /* @__PURE__ */ jsxs("details", { class: "group border border-muted overflow-hidden", open: true, children: [
30
+ /* @__PURE__ */ jsxs("summary", { class: "flex items-center gap-x-hsp-md px-hsp-xl py-vsp-md text-title font-bold cursor-pointer select-none bg-surface list-none [&::-webkit-details-marker]:hidden", children: [
31
+ /* @__PURE__ */ jsx("span", { class: "inline-block text-caption text-muted transition-transform duration-200 group-open:rotate-90", children: "\u25B6" }),
32
+ node.href ? /* @__PURE__ */ jsx("a", { href: node.href, class: "hover:underline focus:underline", children: node.label }) : /* @__PURE__ */ jsx("span", { children: node.label })
33
+ ] }),
34
+ leaves.length > 0 && /* @__PURE__ */ jsx("div", { class: "px-hsp-xl py-vsp-md", children: /* @__PURE__ */ jsx("ul", { class: "space-y-vsp-2xs pl-[1.25rem] list-none", children: leaves.map((leaf, i) => /* @__PURE__ */ jsxs("li", { children: [
35
+ /* @__PURE__ */ jsx(
36
+ "a",
37
+ {
38
+ href: leaf.href,
39
+ class: "text-accent hover:underline focus:underline",
40
+ children: leaf.label
41
+ }
42
+ ),
43
+ leaf.description && /* @__PURE__ */ jsx("span", { class: "ml-hsp-sm text-small text-muted", children: leaf.description })
44
+ ] }, `leaf-${i}`)) }) })
45
+ ] });
46
+ }
47
+ function SiteTreeNavDemo(props) {
48
+ const {
49
+ tree,
50
+ categoryOrder = [],
51
+ categoryIgnore = [],
52
+ ariaLabel = "Site index"
53
+ } = props;
54
+ const ignoreSet = new Set(categoryIgnore);
55
+ let visible = tree.filter((node) => {
56
+ const slug = node.href?.replace(/^\/(?:[\w-]+\/)?docs\//, "").replace(/\/$/, "") ?? node.label.toLowerCase().replace(/\s+/g, "-");
57
+ return !ignoreSet.has(slug);
58
+ });
59
+ visible = reorder(visible, categoryOrder);
60
+ if (visible.length === 0) return null;
61
+ return /* @__PURE__ */ jsx("nav", { "aria-label": ariaLabel, children: /* @__PURE__ */ jsx("div", { class: "flex flex-col gap-y-vsp-lg", children: visible.map((node, i) => /* @__PURE__ */ jsx(Section, { node }, `section-${i}`)) }) });
62
+ }
63
+ export {
64
+ SiteTreeNavDemo
65
+ };
@@ -0,0 +1,38 @@
1
+ import { JSX } from 'preact';
2
+ import { TagItem, TagNavLabels, TagLink } from './types.js';
3
+
4
+ /** @jsxRuntime automatic */
5
+ /** @jsxImportSource preact */
6
+
7
+ interface TagNavAllProps {
8
+ variant: "all";
9
+ /** Pre-sorted tag list with counts and pre-resolved hrefs. */
10
+ tags: TagItem[];
11
+ /** i18n strings for aria-labels. */
12
+ labels: TagNavLabels;
13
+ }
14
+ interface TagNavPageProps {
15
+ variant: "page";
16
+ /** Tags for the current page with pre-resolved hrefs. */
17
+ tagLinks: TagLink[];
18
+ /** i18n strings for aria-labels. */
19
+ labels: TagNavLabels;
20
+ }
21
+ type TagNavProps = TagNavAllProps | TagNavPageProps;
22
+ /**
23
+ * TagNav — JSX port of `src/components/tag-nav.astro`.
24
+ *
25
+ * Two variants:
26
+ *
27
+ * - `variant="all"` — full tag cloud with count badges, sorted alphabetically
28
+ * by the caller. The host resolves `TagItem[]` (tag + count + href) before
29
+ * passing them in.
30
+ *
31
+ * - `variant="page"` — small per-page chip strip. The host maps the
32
+ * frontmatter `tags: string[]` to `TagLink[]` (tag + href) before passing.
33
+ *
34
+ * Returns `null` when the relevant data is empty.
35
+ */
36
+ declare function TagNav(props: TagNavProps): JSX.Element | null;
37
+
38
+ export { TagNav, type TagNavAllProps, type TagNavPageProps, type TagNavProps };
@@ -0,0 +1,96 @@
1
+ import { jsx, jsxs } from "preact/jsx-runtime";
2
+ function AllTagChip({
3
+ tag,
4
+ count,
5
+ href,
6
+ labels
7
+ }) {
8
+ return /* @__PURE__ */ jsx("li", { class: "inline-flex whitespace-nowrap", children: /* @__PURE__ */ jsxs(
9
+ "a",
10
+ {
11
+ href,
12
+ "aria-label": `${labels.taggedWith}: ${tag}`,
13
+ class: "group relative inline-flex no-underline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent",
14
+ children: [
15
+ /* @__PURE__ */ jsx(
16
+ "span",
17
+ {
18
+ class: "absolute inset-0 bg-muted group-hover:bg-fg",
19
+ style: "clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 50%, calc(100% - 16px) 100%, 0 100%)"
20
+ }
21
+ ),
22
+ /* @__PURE__ */ jsxs(
23
+ "span",
24
+ {
25
+ class: "relative inline-flex items-center text-small text-fg bg-bg pl-hsp-sm pr-hsp-xl py-vsp-2xs group-hover:text-bg group-hover:bg-fg",
26
+ style: "clip-path: polygon(1px 1px, calc(100% - 17px) 1px, calc(100% - 1px) 50%, calc(100% - 17px) calc(100% - 1px), 1px calc(100% - 1px))",
27
+ children: [
28
+ /* @__PURE__ */ jsxs("span", { children: [
29
+ "#",
30
+ tag
31
+ ] }),
32
+ /* @__PURE__ */ jsxs("span", { class: "text-caption opacity-60", children: [
33
+ "\xA0(",
34
+ count,
35
+ ")"
36
+ ] })
37
+ ]
38
+ }
39
+ )
40
+ ]
41
+ }
42
+ ) });
43
+ }
44
+ function PageTagChip({
45
+ tag,
46
+ href,
47
+ labels
48
+ }) {
49
+ return /* @__PURE__ */ jsxs(
50
+ "a",
51
+ {
52
+ href,
53
+ "aria-label": `${labels.taggedWith}: ${tag}`,
54
+ class: "group relative inline-flex no-underline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent",
55
+ children: [
56
+ /* @__PURE__ */ jsx(
57
+ "span",
58
+ {
59
+ class: "absolute inset-0 bg-muted group-hover:bg-fg",
60
+ style: "clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%)"
61
+ }
62
+ ),
63
+ /* @__PURE__ */ jsxs(
64
+ "span",
65
+ {
66
+ class: "relative inline-flex items-center text-caption text-fg bg-bg pl-hsp-sm pr-hsp-lg py-vsp-2xs group-hover:text-bg group-hover:bg-fg",
67
+ style: "clip-path: polygon(1px 1px, calc(100% - 13px) 1px, calc(100% - 1px) 50%, calc(100% - 13px) calc(100% - 1px), 1px calc(100% - 1px))",
68
+ children: [
69
+ "#",
70
+ tag
71
+ ]
72
+ }
73
+ )
74
+ ]
75
+ }
76
+ );
77
+ }
78
+ function TagNav(props) {
79
+ if (props.variant === "all") {
80
+ const { tags, labels: labels2 } = props;
81
+ if (tags.length === 0) return null;
82
+ return /* @__PURE__ */ jsx("ul", { class: "flex flex-wrap gap-x-hsp-xs gap-y-vsp-xs", children: tags.map((item) => /* @__PURE__ */ jsx(AllTagChip, { ...item, labels: labels2 }, `tag-${item.tag}`)) });
83
+ }
84
+ const { tagLinks, labels } = props;
85
+ if (tagLinks.length === 0) return null;
86
+ return /* @__PURE__ */ jsxs("div", { class: "flex flex-wrap items-center gap-x-hsp-xs gap-y-vsp-xs", children: [
87
+ /* @__PURE__ */ jsxs("span", { class: "text-caption text-muted", children: [
88
+ labels.tags,
89
+ ":"
90
+ ] }),
91
+ tagLinks.map((tl) => /* @__PURE__ */ jsx(PageTagChip, { ...tl, labels }, `ptag-${tl.tag}`))
92
+ ] });
93
+ }
94
+ export {
95
+ TagNav
96
+ };
@@ -0,0 +1,95 @@
1
+ /**
2
+ * Shared types for the nav-indexing v2 primitives.
3
+ *
4
+ * All types are presentational: every value the components need to render
5
+ * arrives via props. No host-project imports, no Astro collection queries.
6
+ */
7
+ /**
8
+ * Minimal tree node used by tree-based nav components (CategoryNav,
9
+ * CategoryTreeNav, NavCardGrid, DocsSitemap, SiteTreeNavDemo).
10
+ *
11
+ * Structurally compatible with the host project's `NavNode` from
12
+ * `src/utils/docs.ts` and with `SidebarNode` from `sidebar-tree/`, so
13
+ * callers can pass either through with minor adapter mapping if needed.
14
+ */
15
+ interface NavNode {
16
+ label: string;
17
+ description?: string;
18
+ /** Pre-resolved href. Undefined for category-only nodes without an index page. */
19
+ href?: string;
20
+ /** True when an MDX page backs this node. */
21
+ hasPage: boolean;
22
+ children: NavNode[];
23
+ }
24
+ /**
25
+ * A single tag entry with pre-resolved href — for `TagNav` "all" variant.
26
+ */
27
+ interface TagItem {
28
+ tag: string;
29
+ count: number;
30
+ /** Pre-resolved href including locale prefix and base path. */
31
+ href: string;
32
+ }
33
+ /**
34
+ * A tag with its pre-resolved href — for `TagNav` "page" variant.
35
+ */
36
+ interface TagLink {
37
+ tag: string;
38
+ /** Pre-resolved href. */
39
+ href: string;
40
+ }
41
+ /**
42
+ * i18n label bag for `TagNav`. Keeps v2 decoupled from the host's `t()`
43
+ * function — the consumer resolves strings for the active locale and passes
44
+ * them in.
45
+ */
46
+ interface TagNavLabels {
47
+ /** e.g. "Tags" / "タグ" — prefix label shown before the chips. */
48
+ tags: string;
49
+ /** e.g. "Pages tagged with" — used for aria-label on each chip link. */
50
+ taggedWith: string;
51
+ }
52
+ /**
53
+ * A single past version entry for `VersionsPageContent`.
54
+ *
55
+ * Extends `VersionEntry` from `@takazudo/zudo-doc/i18n-version/types`
56
+ * with the pre-resolved doc href and optional status banner.
57
+ */
58
+ interface VersionPageEntry {
59
+ slug: string;
60
+ label: string;
61
+ /** Pre-resolved href to the version's default doc page. */
62
+ docsHref: string;
63
+ /** Optional status badge rendered in the Status column. */
64
+ banner?: "unmaintained" | "unreleased";
65
+ }
66
+ /**
67
+ * i18n label bag for `VersionsPageContent`. The consumer resolves all
68
+ * strings for the active locale and passes them in.
69
+ */
70
+ interface VersionsPageLabels {
71
+ /** Page `<h1>` text, e.g. "Documentation Versions". */
72
+ pageTitle: string;
73
+ /** Latest version section heading, e.g. "Latest Version (Current)". */
74
+ latestTitle: string;
75
+ /** Description below the latest heading. */
76
+ latestDescription: string;
77
+ /** Link label for the latest docs link. */
78
+ latestLink: string;
79
+ /** Past versions section heading, e.g. "Past Versions". */
80
+ pastTitle: string;
81
+ /** Description below past versions heading. */
82
+ pastDescription: string;
83
+ /** "Unmaintained" badge label. */
84
+ unmaintained: string;
85
+ /** "Unreleased" badge label. */
86
+ unreleased: string;
87
+ /** Table column: version label heading. */
88
+ versionCol: string;
89
+ /** Table column: status heading. */
90
+ statusCol: string;
91
+ /** Table column: docs link heading (also used as the link text). */
92
+ docsCol: string;
93
+ }
94
+
95
+ export type { NavNode, TagItem, TagLink, TagNavLabels, VersionPageEntry, VersionsPageLabels };
File without changes
@@ -0,0 +1,29 @@
1
+ import { JSX } from 'preact';
2
+ import { VersionPageEntry, VersionsPageLabels } from './types.js';
3
+
4
+ /** @jsxRuntime automatic */
5
+ /** @jsxImportSource preact */
6
+
7
+ interface VersionsPageContentProps {
8
+ /** Pre-resolved href to the latest version's default docs page. */
9
+ latestHref: string;
10
+ /** Past version entries. Empty array hides the past-versions section. */
11
+ versions: VersionPageEntry[];
12
+ /** Localized label strings. */
13
+ labels: VersionsPageLabels;
14
+ }
15
+ /**
16
+ * VersionsPageContent — JSX port of `src/components/versions-page-content.astro`.
17
+ *
18
+ * Renders the full documentation versions page:
19
+ * - An `<h1>` heading (from `labels.pageTitle`).
20
+ * - A "Latest version" section with a link to the current docs.
21
+ * - A "Past versions" table (only when `versions` is non-empty) showing
22
+ * each version's label, status badge, and a docs link.
23
+ *
24
+ * All strings and hrefs are pre-resolved by the consumer so this component
25
+ * stays locale- and settings-agnostic.
26
+ */
27
+ declare function VersionsPageContent(props: VersionsPageContentProps): JSX.Element;
28
+
29
+ export { VersionsPageContent, type VersionsPageContentProps };
@@ -0,0 +1,76 @@
1
+ import { Fragment, jsx, jsxs } from "preact/jsx-runtime";
2
+ function VersionsPageContent(props) {
3
+ const { latestHref, versions, labels } = props;
4
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
5
+ /* @__PURE__ */ jsx("h1", { class: "text-heading font-bold mb-vsp-lg", children: labels.pageTitle }),
6
+ /* @__PURE__ */ jsxs("section", { class: "mb-vsp-xl", children: [
7
+ /* @__PURE__ */ jsx("h2", { class: "text-title font-bold mb-vsp-xs", children: labels.latestTitle }),
8
+ /* @__PURE__ */ jsx("p", { class: "text-small text-muted mb-vsp-sm", children: labels.latestDescription }),
9
+ /* @__PURE__ */ jsxs(
10
+ "a",
11
+ {
12
+ href: latestHref,
13
+ class: "inline-flex items-center gap-hsp-xs text-small text-accent underline hover:text-accent-hover",
14
+ children: [
15
+ labels.latestLink,
16
+ /* @__PURE__ */ jsx(
17
+ "svg",
18
+ {
19
+ xmlns: "http://www.w3.org/2000/svg",
20
+ class: "h-[0.875rem] w-[0.875rem]",
21
+ fill: "none",
22
+ viewBox: "0 0 24 24",
23
+ stroke: "currentColor",
24
+ "stroke-width": "2",
25
+ children: /* @__PURE__ */ jsx(
26
+ "path",
27
+ {
28
+ "stroke-linecap": "round",
29
+ "stroke-linejoin": "round",
30
+ d: "M9 5l7 7-7 7"
31
+ }
32
+ )
33
+ }
34
+ )
35
+ ]
36
+ }
37
+ )
38
+ ] }),
39
+ versions.length > 0 && /* @__PURE__ */ jsxs("section", { children: [
40
+ /* @__PURE__ */ jsx("h2", { class: "text-title font-bold mb-vsp-xs", children: labels.pastTitle }),
41
+ /* @__PURE__ */ jsx("p", { class: "text-small text-muted mb-vsp-md", children: labels.pastDescription }),
42
+ /* @__PURE__ */ jsx("div", { class: "border border-muted rounded overflow-hidden", children: /* @__PURE__ */ jsxs("table", { class: "w-full text-small", children: [
43
+ /* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { class: "border-b border-muted bg-surface", children: [
44
+ /* @__PURE__ */ jsx("th", { class: "px-hsp-lg py-vsp-sm text-left font-medium text-muted", children: labels.versionCol }),
45
+ /* @__PURE__ */ jsx("th", { class: "px-hsp-lg py-vsp-sm text-left font-medium text-muted", children: labels.statusCol }),
46
+ /* @__PURE__ */ jsx("th", { class: "px-hsp-lg py-vsp-sm text-left font-medium text-muted", children: labels.docsCol })
47
+ ] }) }),
48
+ /* @__PURE__ */ jsx("tbody", { children: versions.map((v) => /* @__PURE__ */ jsxs(
49
+ "tr",
50
+ {
51
+ class: "border-b border-muted last:border-b-0",
52
+ children: [
53
+ /* @__PURE__ */ jsx("td", { class: "px-hsp-lg py-vsp-sm font-medium text-fg", children: v.label }),
54
+ /* @__PURE__ */ jsxs("td", { class: "px-hsp-lg py-vsp-sm", children: [
55
+ v.banner === "unmaintained" && /* @__PURE__ */ jsx("span", { class: "inline-block rounded px-hsp-xs py-vsp-3xs text-caption bg-warning/10 text-warning", children: labels.unmaintained }),
56
+ v.banner === "unreleased" && /* @__PURE__ */ jsx("span", { class: "inline-block rounded px-hsp-xs py-vsp-3xs text-caption bg-info/10 text-info", children: labels.unreleased })
57
+ ] }),
58
+ /* @__PURE__ */ jsx("td", { class: "px-hsp-lg py-vsp-sm", children: /* @__PURE__ */ jsx(
59
+ "a",
60
+ {
61
+ href: v.docsHref,
62
+ class: "text-accent underline hover:text-accent-hover",
63
+ children: labels.docsCol
64
+ }
65
+ ) })
66
+ ]
67
+ },
68
+ `version-${v.slug}`
69
+ )) })
70
+ ] }) })
71
+ ] })
72
+ ] });
73
+ }
74
+ export {
75
+ VersionsPageContent
76
+ };
@@ -0,0 +1,2 @@
1
+ export { PAGE_LOADING_OVERLAY_ID, default as PageLoadingOverlay, PageLoadingOverlayProps, buildPageLoadingOverlayBootstrap } from './page-loading-overlay.js';
2
+ import 'preact';
@@ -0,0 +1,10 @@
1
+ import {
2
+ default as default2,
3
+ PAGE_LOADING_OVERLAY_ID,
4
+ buildPageLoadingOverlayBootstrap
5
+ } from "./page-loading-overlay.js";
6
+ export {
7
+ PAGE_LOADING_OVERLAY_ID,
8
+ default2 as PageLoadingOverlay,
9
+ buildPageLoadingOverlayBootstrap
10
+ };
@@ -0,0 +1,35 @@
1
+ import * as preact from 'preact';
2
+
3
+ /** @jsxRuntime automatic */
4
+ /** @jsxImportSource preact */
5
+ /** Default `id` for the overlay element. Stable so test rigs can target it. */
6
+ declare const PAGE_LOADING_OVERLAY_ID = "page-loading-overlay";
7
+ interface PageLoadingOverlayProps {
8
+ /**
9
+ * Override the DOM `id` used by both the overlay element and the
10
+ * bootstrap script. Useful when multiple overlays could co-exist on
11
+ * the page (e.g. tests). Defaults to `PAGE_LOADING_OVERLAY_ID`.
12
+ */
13
+ id?: string;
14
+ }
15
+ /**
16
+ * Build the inline bootstrap script body. Exported so test rigs can
17
+ * inspect / snapshot it without rendering the component.
18
+ */
19
+ declare function buildPageLoadingOverlayBootstrap(overlayId: string): string;
20
+ /**
21
+ * Full-page loading overlay shown during view-transition navigations.
22
+ *
23
+ * Mount this once per layout (typically inside `DocLayoutWithDefaults`'s
24
+ * `bodyEnd` slot, alongside the existing body-end providers). It is
25
+ * server-rendered and self-wires its visibility — no hydration needed.
26
+ *
27
+ * CSS lives in the host project's `src/styles/global.css` (`.page-loading-overlay`,
28
+ * `.page-loading-spinner`, `[data-zd-nav-pending]` rules) rather than in an
29
+ * inline `<style>` block here — a `<style>` inside `<body>` violates HTML5
30
+ * element-permitted-content and fails html-validate (same fix applied to the
31
+ * version-switcher in zudolab/zudo-doc#1505; regression caught in W2A #1543).
32
+ */
33
+ declare function PageLoadingOverlay({ id, }?: PageLoadingOverlayProps): preact.JSX.Element;
34
+
35
+ export { PAGE_LOADING_OVERLAY_ID, type PageLoadingOverlayProps, buildPageLoadingOverlayBootstrap, PageLoadingOverlay as default };