@takazudo/zudo-doc 0.2.21 → 1.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.
- package/bin/gen-z-index.mjs +164 -0
- package/bin/tags-audit-runner.ts +126 -0
- package/bin/tags-audit.mjs +64 -0
- package/bin/zudo-doc.mjs +83 -0
- package/dist/ai-chat-modal/index.d.ts +8 -0
- package/dist/ai-chat-modal/index.js +243 -0
- package/dist/body-foot-util/body-foot-util-area.d.ts +4 -8
- package/dist/body-foot-util/edit-link.d.ts +4 -8
- package/dist/body-foot-util/index.d.ts +4 -3
- package/dist/breadcrumb/breadcrumb.d.ts +5 -9
- package/dist/breadcrumb/find-path.d.ts +2 -5
- package/dist/breadcrumb/index.d.ts +4 -4
- package/dist/breadcrumb/types.d.ts +3 -5
- package/dist/category-nav/index.d.ts +86 -0
- package/dist/category-nav/index.js +44 -0
- package/dist/category-tree-nav/index.d.ts +65 -0
- package/dist/category-tree-nav/index.js +24 -0
- package/dist/code-group/index.d.ts +10 -0
- package/dist/code-group/index.js +37 -0
- package/dist/code-syntax/code-block-enhancer-script.d.ts +1 -3
- package/dist/code-syntax/code-block-enhancer.d.ts +3 -6
- package/dist/code-syntax/index.d.ts +9 -8
- package/dist/code-syntax/mermaid-init-script.d.ts +3 -5
- package/dist/code-syntax/mermaid-init.d.ts +4 -7
- package/dist/code-syntax/tabs-init-script.d.ts +1 -3
- package/dist/code-syntax/tabs-init.d.ts +3 -6
- package/dist/code-syntax/tabs.d.ts +4 -7
- package/dist/color-scheme-utils.d.ts +125 -0
- package/dist/color-scheme-utils.js +151 -0
- package/dist/compose-meta-title/index.d.ts +7 -0
- package/dist/compose-meta-title/index.js +10 -0
- package/dist/content/component-map.d.ts +13 -17
- package/dist/content/content-blockquote.d.ts +3 -6
- package/dist/content/content-code.d.ts +3 -6
- package/dist/content/content-code.js +1 -1
- package/dist/content/content-link.d.ts +3 -6
- package/dist/content/content-link.js +1 -1
- package/dist/content/content-ol.d.ts +3 -6
- package/dist/content/content-paragraph.d.ts +3 -6
- package/dist/content/content-strong.d.ts +3 -6
- package/dist/content/content-table.d.ts +3 -6
- package/dist/content/content-ul.d.ts +3 -6
- package/dist/content/heading-h2.d.ts +3 -6
- package/dist/content/heading-h3.d.ts +3 -6
- package/dist/content/heading-h4.d.ts +3 -6
- package/dist/content/index.d.ts +29 -13
- package/dist/content-admonition/index.d.ts +15 -0
- package/dist/content-admonition/index.js +14 -0
- package/dist/design-token-panel-bootstrap.d.ts +38 -0
- package/dist/design-token-panel-bootstrap.js +29 -0
- package/dist/desktop-sidebar-toggle-island/index.d.ts +5 -0
- package/dist/desktop-sidebar-toggle-island/index.js +62 -0
- package/dist/details/details.d.ts +3 -7
- package/dist/details/index.d.ts +2 -2
- package/dist/doc-body-end/index.d.ts +21 -0
- package/dist/doc-body-end/index.js +15 -0
- package/dist/doc-content-header/index.d.ts +69 -0
- package/dist/doc-content-header/index.js +49 -0
- package/dist/doc-history/index.d.ts +10 -0
- package/dist/doc-history/index.js +407 -0
- package/dist/doc-history-area/index.d.ts +84 -0
- package/dist/doc-history-area/index.js +76 -0
- package/dist/doc-metainfo-area/index.d.ts +46 -0
- package/dist/doc-metainfo-area/index.js +41 -0
- package/dist/doc-page-props/index.d.ts +93 -0
- package/dist/doc-page-props/index.js +0 -0
- package/dist/doc-page-renderer/index.d.ts +128 -0
- package/dist/doc-page-renderer/index.js +103 -0
- package/dist/doc-page-shell/index.d.ts +136 -0
- package/dist/doc-page-shell/index.js +127 -0
- package/dist/doc-pager/index.d.ts +25 -0
- package/dist/doc-pager/index.js +41 -0
- package/dist/doc-route-entries/index.d.ts +125 -0
- package/dist/doc-route-entries/index.js +76 -0
- package/dist/doc-route-paths/index.d.ts +54 -0
- package/dist/doc-route-paths/index.js +61 -0
- package/dist/doc-tags-area/index.d.ts +38 -0
- package/dist/doc-tags-area/index.js +30 -0
- package/dist/doclayout/anchors.d.ts +7 -9
- package/dist/doclayout/doc-layout-with-defaults.d.ts +16 -12
- package/dist/doclayout/doc-layout.d.ts +5 -9
- package/dist/doclayout/index.d.ts +6 -6
- package/dist/eject/index.d.ts +33 -0
- package/dist/eject/index.js +229 -0
- package/dist/extract-headings/index.d.ts +43 -0
- package/dist/extract-headings/index.js +111 -0
- package/dist/factory-context/index.d.ts +80 -0
- package/dist/factory-context/index.js +0 -0
- package/dist/features.css +882 -0
- package/dist/footer/footer.d.ts +4 -8
- package/dist/footer/index.d.ts +13 -3
- package/dist/footer/types.d.ts +4 -6
- package/dist/footer-with-defaults/index.d.ts +63 -0
- package/dist/footer-with-defaults/index.js +128 -0
- package/dist/frontmatter-preview-data/index.d.ts +26 -0
- package/dist/frontmatter-preview-data/index.js +23 -0
- package/dist/github-helpers/index.d.ts +17 -0
- package/dist/github-helpers/index.js +16 -0
- package/dist/head/doc-head.d.ts +3 -6
- package/dist/head/index.d.ts +9 -5
- package/dist/head/og-tags.d.ts +4 -7
- package/dist/head/twitter-card.d.ts +3 -6
- package/dist/head/types.d.ts +1 -3
- package/dist/head-with-defaults/index.d.ts +49 -0
- package/dist/head-with-defaults/index.js +62 -0
- package/dist/header/header.d.ts +6 -10
- package/dist/header/index.d.ts +16 -6
- package/dist/header/nav-active.d.ts +5 -7
- package/dist/header/nav-overflow-script.d.ts +1 -3
- package/dist/header/right-items.d.ts +3 -6
- package/dist/header/types.d.ts +10 -12
- package/dist/header-with-defaults/index.d.ts +77 -0
- package/dist/header-with-defaults/index.js +163 -0
- package/dist/html-preview-wrapper/dedent.d.ts +1 -3
- package/dist/html-preview-wrapper/highlighted-code.d.ts +3 -7
- package/dist/html-preview-wrapper/html-preview-wrapper.d.ts +6 -10
- package/dist/html-preview-wrapper/html-preview.d.ts +5 -9
- package/dist/html-preview-wrapper/index.d.ts +8 -5
- package/dist/html-preview-wrapper/preflight.d.ts +1 -3
- package/dist/html-preview-wrapper/preview-base.d.ts +4 -8
- package/dist/i18n-version/index.d.ts +7 -5
- package/dist/i18n-version/language-switcher.d.ts +5 -8
- package/dist/i18n-version/types.d.ts +3 -5
- package/dist/i18n-version/version-banner.d.ts +4 -8
- package/dist/i18n-version/version-switcher.d.ts +7 -10
- package/dist/icons/index.d.ts +9 -13
- package/dist/image-enlarge/index.d.ts +13 -0
- package/dist/image-enlarge/index.js +176 -0
- package/dist/index.d.ts +26 -2
- package/dist/inline-version-switcher/index.d.ts +31 -0
- package/dist/inline-version-switcher/index.js +44 -0
- package/dist/integrations/claude-resources/escape-for-mdx.d.ts +1 -3
- package/dist/integrations/claude-resources/generate.d.ts +2 -4
- package/dist/integrations/claude-resources/index.d.ts +7 -10
- package/dist/integrations/doc-history/index.d.ts +21 -24
- package/dist/integrations/doc-history/pre-build.d.ts +7 -9
- package/dist/integrations/llms-txt/dev-middleware.d.ts +7 -11
- package/dist/integrations/llms-txt/emit.d.ts +2 -7
- package/dist/integrations/llms-txt/generate.d.ts +3 -8
- package/dist/integrations/llms-txt/index.d.ts +33 -8
- package/dist/integrations/llms-txt/load.d.ts +3 -7
- package/dist/integrations/llms-txt/strip.d.ts +2 -6
- package/dist/integrations/llms-txt/types.d.ts +9 -13
- package/dist/integrations/search-index/build-emitter.d.ts +4 -7
- package/dist/integrations/search-index/collect.d.ts +2 -5
- package/dist/integrations/search-index/dev-middleware.d.ts +5 -8
- package/dist/integrations/search-index/index.d.ts +7 -5
- package/dist/integrations/search-index/types.d.ts +5 -7
- package/dist/island-types/index.d.ts +44 -0
- package/dist/island-types/index.js +12 -0
- package/dist/locale-merge/index.d.ts +114 -0
- package/dist/locale-merge/index.js +27 -0
- package/dist/math-block/index.d.ts +18 -0
- package/dist/math-block/index.js +29 -0
- package/dist/md-utils/index.d.ts +6 -8
- package/dist/md-utils/index.js +2 -1
- package/dist/mdx-components/index.d.ts +46 -0
- package/dist/mdx-components/index.js +161 -0
- package/dist/mermaid-enlarge/index.d.ts +11 -0
- package/dist/mermaid-enlarge/index.js +290 -0
- package/dist/metainfo/doc-metainfo.d.ts +5 -9
- package/dist/metainfo/doc-tags.d.ts +7 -11
- package/dist/metainfo/frontmatter-preview.d.ts +8 -12
- package/dist/metainfo/index.d.ts +6 -4
- package/dist/nav-data-prep/index.d.ts +72 -0
- package/dist/nav-data-prep/index.js +34 -0
- package/dist/nav-indexing/category-nav.d.ts +4 -8
- package/dist/nav-indexing/category-tree-nav.d.ts +4 -8
- package/dist/nav-indexing/doc-card-grid.d.ts +4 -8
- package/dist/nav-indexing/docs-sitemap.d.ts +4 -8
- package/dist/nav-indexing/index.d.ts +37 -10
- package/dist/nav-indexing/nav-card-grid.d.ts +4 -8
- package/dist/nav-indexing/site-tree-nav-demo.d.ts +4 -8
- package/dist/nav-indexing/tag-nav.d.ts +6 -10
- package/dist/nav-indexing/types.d.ts +6 -8
- package/dist/nav-indexing/versions-page-content.d.ts +4 -8
- package/dist/nav-scope/index.d.ts +41 -0
- package/dist/nav-scope/index.js +41 -0
- package/dist/nav-source-cache/index.d.ts +13 -0
- package/dist/nav-source-cache/index.js +28 -0
- package/dist/nav-source-docs/index.d.ts +169 -0
- package/dist/nav-source-docs/index.js +123 -0
- package/dist/page-loading/index.d.ts +1 -2
- package/dist/page-loading/page-loading-overlay.d.ts +4 -8
- package/dist/plugins/claude-resources.d.ts +3 -0
- package/dist/plugins/claude-resources.js +27 -0
- package/dist/plugins/connect-adapter.d.ts +31 -0
- package/dist/plugins/connect-adapter.js +78 -0
- package/dist/plugins/doc-history.d.ts +3 -0
- package/dist/plugins/doc-history.js +54 -0
- package/dist/plugins/llms-txt.d.ts +3 -0
- package/dist/plugins/llms-txt.js +48 -0
- package/dist/plugins/plugin-utils.d.ts +17 -0
- package/dist/plugins/plugin-utils.js +11 -0
- package/dist/plugins/routes.d.ts +2 -0
- package/dist/plugins/routes.js +100 -0
- package/dist/plugins/search-index.d.ts +3 -0
- package/dist/plugins/search-index.js +24 -0
- package/dist/preset.d.ts +198 -0
- package/dist/preset.js +185 -0
- package/dist/render-markdown/index.d.ts +5 -0
- package/dist/render-markdown/index.js +115 -0
- package/dist/robots.d.ts +36 -0
- package/dist/robots.js +17 -0
- package/dist/route-enumerators/index.d.ts +204 -0
- package/dist/route-enumerators/index.js +156 -0
- package/dist/routes/404.d.ts +7 -0
- package/dist/routes/404.js +47 -0
- package/dist/routes/_chrome.d.ts +32 -0
- package/dist/routes/_chrome.js +365 -0
- package/dist/routes/_context.d.ts +56 -0
- package/dist/routes/_context.js +222 -0
- package/dist/routes/_docs-helpers.d.ts +43 -0
- package/dist/routes/_docs-helpers.js +173 -0
- package/dist/routes/_virtual.d.js +0 -0
- package/dist/routes/api-ai-chat.d.ts +5 -0
- package/dist/routes/api-ai-chat.js +24 -0
- package/dist/routes/docs-slug.d.ts +21 -0
- package/dist/routes/docs-slug.js +26 -0
- package/dist/routes/docs-tags-index.d.ts +7 -0
- package/dist/routes/docs-tags-index.js +11 -0
- package/dist/routes/docs-tags-tag.d.ts +23 -0
- package/dist/routes/docs-tags-tag.js +19 -0
- package/dist/routes/docs-versions.d.ts +7 -0
- package/dist/routes/docs-versions.js +11 -0
- package/dist/routes/index.d.ts +7 -0
- package/dist/routes/index.js +117 -0
- package/dist/routes/locale-docs-slug.d.ts +27 -0
- package/dist/routes/locale-docs-slug.js +40 -0
- package/dist/routes/locale-docs-tags-index.d.ts +18 -0
- package/dist/routes/locale-docs-tags-index.js +15 -0
- package/dist/routes/locale-docs-tags-tag.d.ts +25 -0
- package/dist/routes/locale-docs-tags-tag.js +22 -0
- package/dist/routes/locale-docs-versions.d.ts +18 -0
- package/dist/routes/locale-docs-versions.js +15 -0
- package/dist/routes/locale-index.d.ts +24 -0
- package/dist/routes/locale-index.js +132 -0
- package/dist/routes/robots.txt.d.ts +3 -0
- package/dist/routes/robots.txt.js +8 -0
- package/dist/routes/sitemap.xml.d.ts +5 -0
- package/dist/routes/sitemap.xml.js +31 -0
- package/dist/routes/v-docs-slug.d.ts +27 -0
- package/dist/routes/v-docs-slug.js +34 -0
- package/dist/routes/v-locale-docs-slug.d.ts +31 -0
- package/dist/routes/v-locale-docs-slug.js +50 -0
- package/dist/safelist.css +1 -1
- package/dist/search-widget/index.d.ts +38 -0
- package/dist/search-widget/index.js +169 -0
- package/dist/search-widget-script/index.d.ts +18 -0
- package/dist/search-widget-script/index.js +465 -0
- package/dist/settings.d.ts +270 -0
- package/dist/settings.js +0 -0
- package/dist/sidebar/index.d.ts +21 -3
- package/dist/sidebar/sidebar.d.ts +5 -9
- package/dist/sidebar/types.d.ts +4 -6
- package/dist/sidebar-prepaint/index.d.ts +21 -0
- package/dist/sidebar-prepaint/index.js +23 -0
- package/dist/sidebar-resizer/index.d.ts +2 -6
- package/dist/sidebar-resizer/sidebar-resizer-init.d.ts +6 -10
- package/dist/sidebar-toggle-island/index.d.ts +13 -0
- package/dist/sidebar-toggle-island/index.js +122 -0
- package/dist/sidebar-tree/build-tree.d.ts +4 -8
- package/dist/sidebar-tree/category-meta.d.ts +3 -6
- package/dist/sidebar-tree/index.d.ts +18 -3
- package/dist/sidebar-tree/types.d.ts +6 -8
- package/dist/sidebar-tree-island/index.d.ts +13 -0
- package/dist/sidebar-tree-island/index.js +454 -0
- package/dist/sidebar-utils/index.d.ts +64 -0
- package/dist/sidebar-utils/index.js +88 -0
- package/dist/sidebar-with-defaults/index.d.ts +38 -0
- package/dist/sidebar-with-defaults/index.js +45 -0
- package/dist/site-tree-nav/index.d.ts +71 -0
- package/dist/site-tree-nav/index.js +36 -0
- package/dist/site-tree-nav-island/index.d.ts +11 -0
- package/dist/site-tree-nav-island/index.js +176 -0
- package/dist/slug/index.d.ts +4 -0
- package/dist/slug/index.js +19 -0
- package/dist/smart-break/index.d.ts +55 -0
- package/dist/{toc/smart-break.js → smart-break/index.js} +30 -3
- package/dist/tab-item/index.d.ts +2 -2
- package/dist/tab-item/tab-item.d.ts +6 -7
- package/dist/tag-helpers/index.d.ts +40 -0
- package/dist/tag-helpers/index.js +54 -0
- package/dist/tag-pages/index.d.ts +114 -0
- package/dist/tag-pages/index.js +146 -0
- package/dist/tags-audit.d.ts +107 -0
- package/dist/tags-audit.js +321 -0
- package/dist/theme/color-scheme-provider.d.ts +4 -8
- package/dist/theme/color-tweak-export-modal.d.ts +4 -7
- package/dist/theme/design-token-serde.d.ts +14 -17
- package/dist/theme/design-token-types.d.ts +4 -6
- package/dist/theme/iframe-bridge.d.ts +12 -14
- package/dist/theme/index.d.ts +7 -9
- package/dist/theme/theme-toggle.d.ts +3 -8
- package/dist/theme-toggle/color-scheme-sync.d.ts +5 -7
- package/dist/theme-toggle/index.d.ts +4 -8
- package/dist/toc/cx.d.ts +2 -3
- package/dist/toc/index.d.ts +8 -6
- package/dist/toc/mobile-toc.d.ts +5 -9
- package/dist/toc/mobile-toc.js +1 -1
- package/dist/toc/toc-title.d.ts +1 -3
- package/dist/toc/toc.d.ts +5 -9
- package/dist/toc/toc.js +1 -1
- package/dist/toc/types.d.ts +1 -3
- package/dist/toc/use-active-heading.d.ts +4 -7
- package/dist/transitions/index.d.ts +1 -1
- package/dist/transitions/page-events.d.ts +4 -6
- package/dist/tree-nav-shared/index.d.ts +22 -0
- package/dist/tree-nav-shared/index.js +66 -0
- package/dist/url-helpers/index.d.ts +37 -0
- package/dist/url-helpers/index.js +106 -0
- package/dist/url-normalizer/index.d.ts +39 -1
- package/dist/url-normalizer/normalize.d.ts +3 -5
- package/dist/use-modal-dialog/index.d.ts +70 -0
- package/dist/use-modal-dialog/index.js +73 -0
- package/dist/versions-page/index.d.ts +55 -0
- package/dist/versions-page/index.js +73 -0
- package/eject/breadcrumb/breadcrumb.tsx +194 -0
- package/eject/breadcrumb/find-path.ts +26 -0
- package/eject/breadcrumb/index.ts +4 -0
- package/eject/breadcrumb/types.ts +32 -0
- package/eject/code-group/index.tsx +78 -0
- package/eject/content-admonition/index.tsx +50 -0
- package/eject/details/details.tsx +34 -0
- package/eject/details/index.ts +4 -0
- package/eject/doc-pager/index.tsx +91 -0
- package/eject/footer/footer.tsx +167 -0
- package/eject/footer/index.ts +19 -0
- package/eject/footer/types.ts +60 -0
- package/eject/header/header.tsx +725 -0
- package/eject/header/index.ts +36 -0
- package/eject/header/nav-active.ts +122 -0
- package/eject/header/nav-overflow-script.ts +302 -0
- package/eject/header/right-items.ts +78 -0
- package/eject/header/types.ts +69 -0
- package/eject/page-loading/index.ts +10 -0
- package/eject/page-loading/page-loading-overlay.tsx +103 -0
- package/eject/sidebar/index.ts +27 -0
- package/eject/sidebar/sidebar.tsx +137 -0
- package/eject/sidebar/types.ts +73 -0
- package/eject/tab-item/index.ts +7 -0
- package/eject/tab-item/tab-item.tsx +70 -0
- package/eject/theme-toggle/color-scheme-sync.ts +73 -0
- package/eject/theme-toggle/index.tsx +120 -0
- package/eject/toc/cx.ts +38 -0
- package/eject/toc/index.ts +11 -0
- package/eject/toc/mobile-toc.tsx +133 -0
- package/eject/toc/toc-title.ts +33 -0
- package/eject/toc/toc.tsx +119 -0
- package/eject/toc/types.ts +14 -0
- package/eject/toc/use-active-heading.ts +162 -0
- package/package.json +371 -11
- package/routes-src/404.tsx +49 -0
- package/routes-src/_chrome.tsx +470 -0
- package/routes-src/_context.ts +314 -0
- package/routes-src/_docs-helpers.ts +284 -0
- package/routes-src/_virtual.d.ts +15 -0
- package/routes-src/api-ai-chat.tsx +46 -0
- package/routes-src/docs-slug.tsx +43 -0
- package/routes-src/docs-tags-index.tsx +14 -0
- package/routes-src/docs-tags-tag.tsx +29 -0
- package/routes-src/docs-versions.tsx +15 -0
- package/routes-src/index.tsx +134 -0
- package/routes-src/locale-docs-slug.tsx +69 -0
- package/routes-src/locale-docs-tags-index.tsx +23 -0
- package/routes-src/locale-docs-tags-tag.tsx +39 -0
- package/routes-src/locale-docs-versions.tsx +23 -0
- package/routes-src/locale-index.tsx +150 -0
- package/routes-src/robots.txt.tsx +13 -0
- package/routes-src/sitemap.xml.tsx +48 -0
- package/routes-src/v-docs-slug.tsx +64 -0
- package/routes-src/v-locale-docs-slug.tsx +85 -0
- package/dist/toc/smart-break.d.ts +0 -27
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type contract for the breadcrumb component.
|
|
3
|
+
*
|
|
4
|
+
* Breadcrumb only walks the tree to find an ancestor chain — it does not
|
|
5
|
+
* need the full SidebarNode shape from sidebar-tree. We declare a minimal
|
|
6
|
+
* structural interface here. The canonical SidebarNode (from sidebar-tree)
|
|
7
|
+
* is structurally assignable to this, so callers can pass either shape
|
|
8
|
+
* unchanged.
|
|
9
|
+
*/
|
|
10
|
+
export interface BreadcrumbNode {
|
|
11
|
+
type: "doc" | "category";
|
|
12
|
+
id: string;
|
|
13
|
+
label: string;
|
|
14
|
+
href?: string;
|
|
15
|
+
sidebar_position?: number;
|
|
16
|
+
children?: readonly BreadcrumbNode[];
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Backward-compatible alias retained for callers that previously imported
|
|
21
|
+
* `SidebarNode` from this subpath.
|
|
22
|
+
*/
|
|
23
|
+
export type SidebarNode = BreadcrumbNode;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* One rung of the breadcrumb trail. `href` is omitted on the final
|
|
27
|
+
* (current-page) item so the renderer can present it as plain text.
|
|
28
|
+
*/
|
|
29
|
+
export interface BreadcrumbItem {
|
|
30
|
+
label: string;
|
|
31
|
+
href?: string;
|
|
32
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/** @jsxRuntime automatic */
|
|
2
|
+
/** @jsxImportSource preact */
|
|
3
|
+
// CodeGroup — adapter for zfb's `:::code-group` directive (codeTabs Option A).
|
|
4
|
+
// Moved from the showcase's `src/components/content/code-group.tsx` into the
|
|
5
|
+
// shared package as part of the package-first migration (epic #2321, S4 #2327).
|
|
6
|
+
//
|
|
7
|
+
// zfb emits:
|
|
8
|
+
// <CodeGroup tabs={["label1", "label2", ...]}>
|
|
9
|
+
// <pre data-lang="ts">{RAW code text}</pre>
|
|
10
|
+
// <pre data-lang="js">{RAW code text}</pre>
|
|
11
|
+
// </CodeGroup>
|
|
12
|
+
//
|
|
13
|
+
// The existing <Tabs>/<TabItem> UI uses a children-based API, so this
|
|
14
|
+
// component zips the `tabs` label array with the `<pre data-lang>` children
|
|
15
|
+
// by index, wrapping each in a <TabItem> with the matching label.
|
|
16
|
+
//
|
|
17
|
+
// Code inside each <pre> is raw text (NOT syntect-highlighted — the Rust
|
|
18
|
+
// pipeline does not run highlight inside code-group fences). We render
|
|
19
|
+
// the <pre> inside a <TabItem> with explicit styling via Tailwind tokens
|
|
20
|
+
// so it looks like a code block visually.
|
|
21
|
+
//
|
|
22
|
+
// TabsInit (the companion init script) is expected to be present in the
|
|
23
|
+
// consumer's layout — we do not duplicate it here.
|
|
24
|
+
|
|
25
|
+
import type { ComponentChildren } from "preact";
|
|
26
|
+
import { Tabs } from "../code-syntax/index.js";
|
|
27
|
+
import { TabItem } from "../tab-item/index.js";
|
|
28
|
+
|
|
29
|
+
type Props = {
|
|
30
|
+
tabs?: string[];
|
|
31
|
+
children?: ComponentChildren;
|
|
32
|
+
[key: string]: unknown;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
function toArray(children: ComponentChildren): ComponentChildren[] {
|
|
36
|
+
if (!children) return [];
|
|
37
|
+
if (Array.isArray(children)) return children;
|
|
38
|
+
return [children];
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export function CodeGroup({ tabs = [], children, name }: Props) {
|
|
42
|
+
const childArray = toArray(children);
|
|
43
|
+
|
|
44
|
+
// Zip tabs labels with pre children by index. Extra children beyond the
|
|
45
|
+
// tabs array (shouldn't happen in normal zfb output) are ignored.
|
|
46
|
+
const items = tabs.map((label, i) => {
|
|
47
|
+
const child = childArray[i];
|
|
48
|
+
return { label, child };
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
if (items.length === 0) {
|
|
52
|
+
// Degenerate: no tabs — render children as-is.
|
|
53
|
+
return <>{children}</>;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// zfb forwards `:::code-group{name="x"}` as the `name` prop; Tabs persists
|
|
57
|
+
// the active tab per group via `groupId`.
|
|
58
|
+
const groupId = typeof name === "string" ? name : undefined;
|
|
59
|
+
|
|
60
|
+
return (
|
|
61
|
+
<Tabs groupId={groupId}>
|
|
62
|
+
{items.map(({ label, child }, i) => (
|
|
63
|
+
// value is suffixed with the index so two fences sharing a label
|
|
64
|
+
// (e.g. both titled "ts") get distinct stable tab identities; the
|
|
65
|
+
// label stays the visible text.
|
|
66
|
+
<TabItem
|
|
67
|
+
key={`${label}-${i}`}
|
|
68
|
+
label={label}
|
|
69
|
+
value={`${label}-${i}`}
|
|
70
|
+
default={i === 0 ? true : undefined}
|
|
71
|
+
>
|
|
72
|
+
{/* Raw-code <pre> from zfb: apply code-block visual treatment via tokens */}
|
|
73
|
+
<div class="code-group-panel">{child}</div>
|
|
74
|
+
</TabItem>
|
|
75
|
+
))}
|
|
76
|
+
</Tabs>
|
|
77
|
+
);
|
|
78
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/** @jsxRuntime automatic */
|
|
2
|
+
/** @jsxImportSource preact */
|
|
3
|
+
// Admonition factory for MDX callout variants (Note/Tip/Info/Warning/
|
|
4
|
+
// Danger/Caution/Important). Moved from the showcase's
|
|
5
|
+
// `src/components/content/content-admonition.tsx` into the shared package
|
|
6
|
+
// as part of the package-first migration (epic #2321, S4 #2327).
|
|
7
|
+
//
|
|
8
|
+
// Markup contract — KEEP STABLE. The structure:
|
|
9
|
+
// <div data-admonition="<variant>" class="admonition admonition-<variant>">
|
|
10
|
+
// <p class="admonition-title">…</p>
|
|
11
|
+
// <div class="admonition-body">…</div>
|
|
12
|
+
// </div>
|
|
13
|
+
// is the hook both the design-system CSS (`.admonition-<variant>` rules in
|
|
14
|
+
// the consumer's global.css) and e2e smoke specs target. Per-variant
|
|
15
|
+
// color + icon live in CSS keyed off `data-admonition`, so this component
|
|
16
|
+
// stays presentation-agnostic.
|
|
17
|
+
import type { ComponentChildren, VNode } from "preact";
|
|
18
|
+
|
|
19
|
+
export type AdmonitionVariant =
|
|
20
|
+
| "note"
|
|
21
|
+
| "tip"
|
|
22
|
+
| "info"
|
|
23
|
+
| "warning"
|
|
24
|
+
| "danger"
|
|
25
|
+
| "caution"
|
|
26
|
+
| "important";
|
|
27
|
+
|
|
28
|
+
export interface AdmonitionProps {
|
|
29
|
+
/** Custom title; falls back to the capitalized variant name (e.g. "Note"). */
|
|
30
|
+
title?: string;
|
|
31
|
+
children?: ComponentChildren;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Build the admonition component for a single variant. The title row is always
|
|
36
|
+
* rendered — defaulting to the capitalized variant name when the author gives
|
|
37
|
+
* no `title` — matching the Astro reference where every callout shows a title.
|
|
38
|
+
*/
|
|
39
|
+
export function makeAdmonition(variant: AdmonitionVariant) {
|
|
40
|
+
const defaultTitle = variant.charAt(0).toUpperCase() + variant.slice(1);
|
|
41
|
+
return function Admonition({ title, children }: AdmonitionProps): VNode {
|
|
42
|
+
const heading = title && title.length > 0 ? title : defaultTitle;
|
|
43
|
+
return (
|
|
44
|
+
<div data-admonition={variant} class={`admonition admonition-${variant}`}>
|
|
45
|
+
<p class="admonition-title">{heading}</p>
|
|
46
|
+
<div class="admonition-body">{children}</div>
|
|
47
|
+
</div>
|
|
48
|
+
);
|
|
49
|
+
};
|
|
50
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/** @jsxRuntime automatic */
|
|
2
|
+
/** @jsxImportSource preact */
|
|
3
|
+
|
|
4
|
+
import type { ComponentChildren, VNode } from "preact";
|
|
5
|
+
|
|
6
|
+
export interface DetailsProps {
|
|
7
|
+
/**
|
|
8
|
+
* Summary / toggle label shown in the `<summary>` element.
|
|
9
|
+
* Defaults to `"Details"` — the same fallback used by the legacy
|
|
10
|
+
* `src/components/details`.
|
|
11
|
+
*/
|
|
12
|
+
title?: string;
|
|
13
|
+
/** Slot content rendered inside the collapsed body. */
|
|
14
|
+
children?: ComponentChildren;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Collapsible `<details>` / `<summary>` block — JSX port of
|
|
19
|
+
* `src/components/details`.
|
|
20
|
+
*
|
|
21
|
+
* Keeps layout and token classes identical to the original template.
|
|
22
|
+
* The legacy component used Astro's `<slot />`; v2 accepts standard
|
|
23
|
+
* Preact `children`.
|
|
24
|
+
*/
|
|
25
|
+
export function Details({ title = "Details", children }: DetailsProps): VNode {
|
|
26
|
+
return (
|
|
27
|
+
<details class="my-vsp-md border border-muted rounded-lg overflow-hidden">
|
|
28
|
+
<summary class="cursor-pointer px-hsp-lg py-vsp-sm bg-surface font-medium text-fg select-none hover:text-accent">
|
|
29
|
+
{title}
|
|
30
|
+
</summary>
|
|
31
|
+
<div class="px-hsp-lg py-vsp-sm zd-content">{children}</div>
|
|
32
|
+
</details>
|
|
33
|
+
);
|
|
34
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/** @jsxRuntime automatic */
|
|
2
|
+
/** @jsxImportSource preact */
|
|
3
|
+
// doc-pager — factory for the shared prev/next pager <nav> (epic #2344, S7).
|
|
4
|
+
//
|
|
5
|
+
// The host's `pages/lib/_doc-pager.tsx` previously read the `t` function
|
|
6
|
+
// from `@/config/i18n` at module scope. This factory receives `t` as an
|
|
7
|
+
// injected dependency so the logic lives in the package while the host stub
|
|
8
|
+
// keeps the singleton imports.
|
|
9
|
+
|
|
10
|
+
import type { JSX } from "preact";
|
|
11
|
+
import { ChevronLeft, ChevronRight } from "../icons/index.js";
|
|
12
|
+
|
|
13
|
+
// NavNode is a superset; we only need the fields the pager uses.
|
|
14
|
+
interface PagerNode {
|
|
15
|
+
href?: string;
|
|
16
|
+
label: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface DocPagerProps {
|
|
20
|
+
/** Previous page node (null = no previous page → renders placeholder). */
|
|
21
|
+
prev: PagerNode | null;
|
|
22
|
+
/** Next page node (null = no next page → renders placeholder). */
|
|
23
|
+
next: PagerNode | null;
|
|
24
|
+
/** Active locale for translated "Previous" / "Next" labels. */
|
|
25
|
+
locale: string;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/** Dependencies injected by the host stub. */
|
|
29
|
+
export interface DocPagerDeps {
|
|
30
|
+
/** Translate a UI string key for a locale. */
|
|
31
|
+
t: (key: string, locale: string) => string;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Create a `DocPager` component bound to the host's injected `t` translator.
|
|
36
|
+
*/
|
|
37
|
+
export function createDocPager(
|
|
38
|
+
deps: DocPagerDeps,
|
|
39
|
+
): (props: DocPagerProps) => JSX.Element {
|
|
40
|
+
const { t } = deps;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Prev/next pagination nav shared by all four doc-route page components.
|
|
44
|
+
*
|
|
45
|
+
* Renders a two-column grid: prev card on the left, next card on the right.
|
|
46
|
+
* When a node is absent its slot is filled with an empty `<div>` to maintain
|
|
47
|
+
* the two-column layout. Placement: immediately after MDX content, before
|
|
48
|
+
* `DocHistoryArea` (Astro reference order — content → pager → utilities,
|
|
49
|
+
* per #1535).
|
|
50
|
+
*/
|
|
51
|
+
function DocPager({ prev, next, locale }: DocPagerProps): JSX.Element {
|
|
52
|
+
return (
|
|
53
|
+
<nav class="mt-vsp-2xl grid grid-cols-2 gap-hsp-xl">
|
|
54
|
+
{prev ? (
|
|
55
|
+
<a
|
|
56
|
+
href={prev.href}
|
|
57
|
+
class="group border border-muted rounded-lg p-hsp-lg hover:border-accent"
|
|
58
|
+
>
|
|
59
|
+
<div class="flex items-center gap-hsp-xs text-caption text-muted mb-vsp-2xs">
|
|
60
|
+
<ChevronLeft className="h-[1.125rem] w-[1.125rem]" />
|
|
61
|
+
<span class="no-underline">{t("nav.previous", locale)}</span>
|
|
62
|
+
</div>
|
|
63
|
+
<p class="text-small font-semibold underline group-hover:text-accent">
|
|
64
|
+
{prev.label}
|
|
65
|
+
</p>
|
|
66
|
+
</a>
|
|
67
|
+
) : (
|
|
68
|
+
<div />
|
|
69
|
+
)}
|
|
70
|
+
{next ? (
|
|
71
|
+
<a
|
|
72
|
+
href={next.href}
|
|
73
|
+
class="group border border-muted rounded-lg p-hsp-lg hover:border-accent text-right"
|
|
74
|
+
>
|
|
75
|
+
<div class="flex items-center justify-end gap-hsp-xs text-caption text-muted mb-vsp-2xs">
|
|
76
|
+
<span class="no-underline">{t("nav.next", locale)}</span>
|
|
77
|
+
<ChevronRight className="h-[1.125rem] w-[1.125rem]" />
|
|
78
|
+
</div>
|
|
79
|
+
<p class="text-small font-semibold underline group-hover:text-accent">
|
|
80
|
+
{next.label}
|
|
81
|
+
</p>
|
|
82
|
+
</a>
|
|
83
|
+
) : (
|
|
84
|
+
<div />
|
|
85
|
+
)}
|
|
86
|
+
</nav>
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
return DocPager;
|
|
91
|
+
}
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
/** @jsxRuntime automatic */
|
|
2
|
+
/** @jsxImportSource preact */
|
|
3
|
+
|
|
4
|
+
// Footer presentational shell for the documentation layout.
|
|
5
|
+
//
|
|
6
|
+
// The original template mixed data-prep (settings + getDocsCollection
|
|
7
|
+
// + tag-vocabulary lookups + locale overrides) with the presentational
|
|
8
|
+
// footer markup. Because v2 must stay decoupled from host-only helpers,
|
|
9
|
+
// only the presentational shell lives here: callers prepare the
|
|
10
|
+
// already-localized, already-resolved data upstream and feed it in via
|
|
11
|
+
// `linkColumns` / `tagColumns` / `copyright` props.
|
|
12
|
+
//
|
|
13
|
+
// Behaviour parity notes:
|
|
14
|
+
//
|
|
15
|
+
// - The `<footer>` shell is always rendered — even when all three slots
|
|
16
|
+
// are empty — so the contentinfo ARIA landmark is present on every
|
|
17
|
+
// page regardless of whether link columns or copyright are configured.
|
|
18
|
+
// (The original Astro template returned early when `!footer`; that
|
|
19
|
+
// guard lives in the host-side `FooterWithDefaults` wrapper in
|
|
20
|
+
// `pages/lib/footer-with-defaults.tsx` now.)
|
|
21
|
+
//
|
|
22
|
+
// - The link/tag column grid is only emitted when at least one column is
|
|
23
|
+
// present (mirrors the Astro `hasColumns &&` guard).
|
|
24
|
+
//
|
|
25
|
+
// - The copyright block is rendered as-is via `dangerouslySetInnerHTML`
|
|
26
|
+
// because the original template used `<Fragment set:html={copyright} />`
|
|
27
|
+
// to allow inline anchors. Callers are responsible for sanitising
|
|
28
|
+
// the string (the Astro version did the same — it trusted
|
|
29
|
+
// `settings.footer.copyright`).
|
|
30
|
+
//
|
|
31
|
+
// - When both columns and copyright exist, the copyright block is
|
|
32
|
+
// visually separated by a top border + spacing, identical to the
|
|
33
|
+
// `mt-vsp-lg border-t border-muted pt-vsp-md` that the Astro template
|
|
34
|
+
// applied via `class:list` conditional.
|
|
35
|
+
|
|
36
|
+
import type { VNode } from "preact";
|
|
37
|
+
|
|
38
|
+
import type { FooterLinkColumn, FooterTagColumn } from "./types.js";
|
|
39
|
+
|
|
40
|
+
export interface FooterProps {
|
|
41
|
+
/**
|
|
42
|
+
* Already-localized link columns. Each item's href should be
|
|
43
|
+
* base-prefixed and locale-aware; `isExternal` controls the
|
|
44
|
+
* target/rel attributes.
|
|
45
|
+
*/
|
|
46
|
+
linkColumns?: FooterLinkColumn[];
|
|
47
|
+
/**
|
|
48
|
+
* Already-resolved tag columns. Empty array (or omitted) hides the
|
|
49
|
+
* taglist entirely. Each tag's href should already be base-prefixed.
|
|
50
|
+
*/
|
|
51
|
+
tagColumns?: FooterTagColumn[];
|
|
52
|
+
/**
|
|
53
|
+
* Copyright HTML. Rendered via `dangerouslySetInnerHTML` so embedded
|
|
54
|
+
* anchors work. The caller is responsible for the contents.
|
|
55
|
+
*/
|
|
56
|
+
copyright?: string;
|
|
57
|
+
/**
|
|
58
|
+
* When provided, adds `data-zfb-transition-persist` to the `<footer>`
|
|
59
|
+
* element. Use a locale-keyed value (e.g. `footer-en`, `footer-ja`) so
|
|
60
|
+
* cross-locale swaps discard the stale footer while same-locale swaps
|
|
61
|
+
* preserve DOM-node identity. See zudolab/zudo-doc#1546.
|
|
62
|
+
*/
|
|
63
|
+
persistKey?: string;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Footer shell for the documentation layout.
|
|
68
|
+
*
|
|
69
|
+
* Always renders the `<footer>` shell so the contentinfo ARIA landmark
|
|
70
|
+
* is present on every page — even when no columns or copyright are
|
|
71
|
+
* configured. The inner content (link grid, copyright) is only emitted
|
|
72
|
+
* when the respective slots carry data.
|
|
73
|
+
*/
|
|
74
|
+
export function Footer(props: FooterProps): VNode {
|
|
75
|
+
const linkColumns = props.linkColumns ?? [];
|
|
76
|
+
const tagColumns = props.tagColumns ?? [];
|
|
77
|
+
const copyright = props.copyright ?? "";
|
|
78
|
+
const persistKey = props.persistKey;
|
|
79
|
+
|
|
80
|
+
const hasColumns = linkColumns.length > 0 || tagColumns.length > 0;
|
|
81
|
+
const hasCopyright = copyright.length > 0;
|
|
82
|
+
|
|
83
|
+
const copyrightClass = hasColumns
|
|
84
|
+
? "text-center text-caption text-muted [&_a]:text-accent [&_a]:underline mt-vsp-lg border-t border-muted pt-vsp-md"
|
|
85
|
+
: "text-center text-caption text-muted [&_a]:text-accent [&_a]:underline";
|
|
86
|
+
|
|
87
|
+
return (
|
|
88
|
+
<footer
|
|
89
|
+
class="border-t border-muted bg-surface"
|
|
90
|
+
// Strategy B: locale-keyed persist (zudolab/zudo-doc#1546).
|
|
91
|
+
// The footer's locale-aware bits (link labels, copyright) are SSR'd
|
|
92
|
+
// per locale; a locale-keyed persist key (`footer-en`, `footer-ja`)
|
|
93
|
+
// guarantees cross-locale swaps re-render the footer while
|
|
94
|
+
// same-locale swaps preserve DOM-node identity (safe — footer
|
|
95
|
+
// content is invariant page-to-page within a locale).
|
|
96
|
+
{...(persistKey
|
|
97
|
+
? { "data-zfb-transition-persist": persistKey }
|
|
98
|
+
: {})}
|
|
99
|
+
>
|
|
100
|
+
<div class="mx-auto max-w-[clamp(50rem,75vw,90rem)] px-hsp-xl py-vsp-xl lg:px-hsp-2xl lg:py-vsp-2xl">
|
|
101
|
+
{hasColumns && (
|
|
102
|
+
<div class="grid grid-cols-1 gap-vsp-lg sm:grid-cols-2 lg:grid-cols-[repeat(auto-fit,minmax(12rem,1fr))]">
|
|
103
|
+
{linkColumns.map((column, i) => (
|
|
104
|
+
<div key={`link-${i}-${column.title}`}>
|
|
105
|
+
<p class="text-small font-semibold text-fg mb-vsp-xs">
|
|
106
|
+
{column.title}
|
|
107
|
+
</p>
|
|
108
|
+
<ul class="list-none p-0">
|
|
109
|
+
{column.items.map((item, j) => (
|
|
110
|
+
<li
|
|
111
|
+
key={`item-${i}-${j}-${item.href}`}
|
|
112
|
+
class="mb-vsp-2xs"
|
|
113
|
+
>
|
|
114
|
+
<a
|
|
115
|
+
href={item.href}
|
|
116
|
+
class="text-caption text-muted hover:text-accent hover:underline focus-visible:underline"
|
|
117
|
+
{...(item.isExternal
|
|
118
|
+
? {
|
|
119
|
+
target: "_blank",
|
|
120
|
+
rel: "noopener noreferrer",
|
|
121
|
+
}
|
|
122
|
+
: {})}
|
|
123
|
+
>
|
|
124
|
+
{item.label}
|
|
125
|
+
</a>
|
|
126
|
+
</li>
|
|
127
|
+
))}
|
|
128
|
+
</ul>
|
|
129
|
+
</div>
|
|
130
|
+
))}
|
|
131
|
+
{tagColumns.map((column, i) => (
|
|
132
|
+
<div
|
|
133
|
+
key={`tag-${i}-${column.group}`}
|
|
134
|
+
data-taglist-group={column.group}
|
|
135
|
+
>
|
|
136
|
+
<h2 class="text-small font-semibold text-fg mb-vsp-xs">
|
|
137
|
+
{column.title}
|
|
138
|
+
</h2>
|
|
139
|
+
<ul class="list-none p-0">
|
|
140
|
+
{column.tags.map(({ tag, count, href }) => (
|
|
141
|
+
<li key={`tag-item-${tag}`} class="mb-vsp-2xs">
|
|
142
|
+
<a
|
|
143
|
+
href={href}
|
|
144
|
+
class="text-caption text-muted hover:text-accent hover:underline focus-visible:underline"
|
|
145
|
+
>
|
|
146
|
+
#{tag}
|
|
147
|
+
<span class="opacity-60" aria-hidden="true">
|
|
148
|
+
({count})
|
|
149
|
+
</span>
|
|
150
|
+
</a>
|
|
151
|
+
</li>
|
|
152
|
+
))}
|
|
153
|
+
</ul>
|
|
154
|
+
</div>
|
|
155
|
+
))}
|
|
156
|
+
</div>
|
|
157
|
+
)}
|
|
158
|
+
{hasCopyright && (
|
|
159
|
+
<div
|
|
160
|
+
class={copyrightClass}
|
|
161
|
+
dangerouslySetInnerHTML={{ __html: copyright }}
|
|
162
|
+
/>
|
|
163
|
+
)}
|
|
164
|
+
</div>
|
|
165
|
+
</footer>
|
|
166
|
+
);
|
|
167
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Public entry for the framework-agnostic footer shell.
|
|
3
|
+
*
|
|
4
|
+
* Consumers import from `@takazudo/zudo-doc/footer`:
|
|
5
|
+
*
|
|
6
|
+
* import { Footer, type FooterProps } from "@takazudo/zudo-doc/footer";
|
|
7
|
+
*
|
|
8
|
+
* The shell is purely presentational — see `./types.ts` for the data
|
|
9
|
+
* shapes the host project assembles upstream.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
export { Footer } from "./footer.js";
|
|
13
|
+
export type { FooterProps } from "./footer.js";
|
|
14
|
+
export type {
|
|
15
|
+
FooterLinkColumn,
|
|
16
|
+
FooterLinkItem,
|
|
17
|
+
FooterTagColumn,
|
|
18
|
+
FooterTagItem,
|
|
19
|
+
} from "./types.js";
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Public types for the framework-agnostic footer shell.
|
|
3
|
+
*
|
|
4
|
+
* The original footer template mixed three concerns:
|
|
5
|
+
* 1. Reading `settings.footer` and applying locale overrides.
|
|
6
|
+
* 2. Loading the docs collection + tag vocabulary to build the
|
|
7
|
+
* optional taglist columns.
|
|
8
|
+
* 3. Rendering the footer markup.
|
|
9
|
+
*
|
|
10
|
+
* Concerns (1) and (2) depend on host-side helpers (`@/config/settings`,
|
|
11
|
+
* `@/utils/get-docs-collection`, `tag-vocabulary`, etc.) that v2 must
|
|
12
|
+
* not reach into. So this package only ports concern (3): the
|
|
13
|
+
* presentational shell. Callers prepare the columns upstream and pass
|
|
14
|
+
* already-localized, already-resolved hrefs in.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
/** A single link rendered inside a {@link FooterLinkColumn}. */
|
|
18
|
+
export interface FooterLinkItem {
|
|
19
|
+
/** Visible label (already locale-resolved by the caller). */
|
|
20
|
+
label: string;
|
|
21
|
+
/** Resolved href (already base-prefixed and locale-aware). */
|
|
22
|
+
href: string;
|
|
23
|
+
/**
|
|
24
|
+
* When true, the rendered anchor adds `target="_blank"` and
|
|
25
|
+
* `rel="noopener noreferrer"`. Callers compute this from their own
|
|
26
|
+
* external-href detector.
|
|
27
|
+
*/
|
|
28
|
+
isExternal?: boolean;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** One column in the footer's link grid. */
|
|
32
|
+
export interface FooterLinkColumn {
|
|
33
|
+
/** Visible heading for the column (already locale-resolved). */
|
|
34
|
+
title: string;
|
|
35
|
+
items: FooterLinkItem[];
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/** A single tag rendered inside a {@link FooterTagColumn}. */
|
|
39
|
+
export interface FooterTagItem {
|
|
40
|
+
/** Canonical tag id (rendered as `#<tag>`). */
|
|
41
|
+
tag: string;
|
|
42
|
+
/** Document count shown next to the tag. */
|
|
43
|
+
count: number;
|
|
44
|
+
/** Resolved href to the tag's index page. */
|
|
45
|
+
href: string;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/** One column in the footer's tag grid. */
|
|
49
|
+
export interface FooterTagColumn {
|
|
50
|
+
/**
|
|
51
|
+
* Group identifier — usually a vocabulary group name like `"topic"`,
|
|
52
|
+
* or the literal `"__flat__"` sentinel for the ungrouped/flat column.
|
|
53
|
+
* Surfaced as `data-taglist-group` on the rendered column wrapper so
|
|
54
|
+
* downstream tests / e2e selectors keep working.
|
|
55
|
+
*/
|
|
56
|
+
group: string;
|
|
57
|
+
/** Visible heading for the column (already locale-resolved). */
|
|
58
|
+
title: string;
|
|
59
|
+
tags: FooterTagItem[];
|
|
60
|
+
}
|