@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.
- package/bin/gen-z-index.mjs +164 -0
- package/bin/tags-audit-runner.ts +126 -0
- package/bin/tags-audit.mjs +64 -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/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/search-index.d.ts +3 -0
- package/dist/plugins/search-index.js +24 -0
- package/dist/preset.d.ts +152 -0
- package/dist/preset.js +169 -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/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 +255 -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/package.json +290 -10
- package/dist/toc/smart-break.d.ts +0 -27
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { jsx, jsxs } from "preact/jsx-runtime";
|
|
2
|
+
import { Island } from "@takazudo/zfb";
|
|
3
|
+
import { BodyFootUtilArea } from "../body-foot-util/index.js";
|
|
4
|
+
function createDocHistoryArea(deps) {
|
|
5
|
+
const {
|
|
6
|
+
settings,
|
|
7
|
+
defaultLocale,
|
|
8
|
+
docHistoryMeta,
|
|
9
|
+
t,
|
|
10
|
+
toHistorySlug,
|
|
11
|
+
buildGitHubSourceUrl,
|
|
12
|
+
DocHistory
|
|
13
|
+
} = deps;
|
|
14
|
+
DocHistory.displayName = "DocHistory";
|
|
15
|
+
function DocHistoryArea({
|
|
16
|
+
slug,
|
|
17
|
+
locale,
|
|
18
|
+
entrySlug,
|
|
19
|
+
contentDir,
|
|
20
|
+
isFallback
|
|
21
|
+
}) {
|
|
22
|
+
if (!settings.docHistory) return null;
|
|
23
|
+
const historySlug = toHistorySlug(slug);
|
|
24
|
+
const effectiveHistoryLocale = isFallback ? defaultLocale : locale;
|
|
25
|
+
const composedSlug = effectiveHistoryLocale === defaultLocale ? historySlug : `${effectiveHistoryLocale}/${historySlug}`;
|
|
26
|
+
const meta = docHistoryMeta[composedSlug];
|
|
27
|
+
const createdLabel = t("doc.created", locale);
|
|
28
|
+
const updatedLabel = t("doc.updated", locale);
|
|
29
|
+
const historyLabel = t("doc.history", locale);
|
|
30
|
+
const docHistoryLocale = effectiveHistoryLocale === defaultLocale ? void 0 : effectiveHistoryLocale;
|
|
31
|
+
const docHistoryBasePath = settings.base ?? "/";
|
|
32
|
+
const author = meta?.author;
|
|
33
|
+
const createdDate = meta?.createdDate;
|
|
34
|
+
const updatedDate = meta?.updatedDate;
|
|
35
|
+
const fallback = /* @__PURE__ */ jsxs("div", { class: "sr-only", children: [
|
|
36
|
+
author && /* @__PURE__ */ jsx("span", { children: author }),
|
|
37
|
+
/* @__PURE__ */ jsxs("span", { children: [
|
|
38
|
+
createdLabel,
|
|
39
|
+
createdDate ? `: ${createdDate}` : ""
|
|
40
|
+
] }),
|
|
41
|
+
/* @__PURE__ */ jsxs("span", { children: [
|
|
42
|
+
updatedLabel,
|
|
43
|
+
updatedDate ? `: ${updatedDate}` : ""
|
|
44
|
+
] })
|
|
45
|
+
] });
|
|
46
|
+
const docHistoryIsland = Island({
|
|
47
|
+
when: "idle",
|
|
48
|
+
ssrFallback: fallback,
|
|
49
|
+
children: /* @__PURE__ */ jsx(
|
|
50
|
+
DocHistory,
|
|
51
|
+
{
|
|
52
|
+
slug: historySlug,
|
|
53
|
+
locale: docHistoryLocale,
|
|
54
|
+
basePath: docHistoryBasePath
|
|
55
|
+
}
|
|
56
|
+
)
|
|
57
|
+
});
|
|
58
|
+
const utilSettings = settings.bodyFootUtilArea;
|
|
59
|
+
const sourceExt = meta?.ext ?? ".mdx";
|
|
60
|
+
const sourceUrl = utilSettings && utilSettings.viewSourceLink && entrySlug && contentDir ? buildGitHubSourceUrl(contentDir, entrySlug + sourceExt) : null;
|
|
61
|
+
const viewSourceLabel = t("doc.viewSource", locale);
|
|
62
|
+
void historyLabel;
|
|
63
|
+
return /* @__PURE__ */ jsx(
|
|
64
|
+
BodyFootUtilArea,
|
|
65
|
+
{
|
|
66
|
+
docHistoryIsland,
|
|
67
|
+
sourceUrl,
|
|
68
|
+
viewSourceLabel
|
|
69
|
+
}
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
return DocHistoryArea;
|
|
73
|
+
}
|
|
74
|
+
export {
|
|
75
|
+
createDocHistoryArea
|
|
76
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/** @jsxRuntime automatic */
|
|
2
|
+
/** @jsxImportSource preact */
|
|
3
|
+
import type { VNode } from "preact";
|
|
4
|
+
/** Per-entry metadata shape from the doc-history manifest. */
|
|
5
|
+
export interface DocHistoryMetaEntry {
|
|
6
|
+
author: string;
|
|
7
|
+
createdDate: string;
|
|
8
|
+
updatedDate: string;
|
|
9
|
+
}
|
|
10
|
+
/** Settings subset read by the DocMetainfoArea factory. */
|
|
11
|
+
export interface DocMetainfoAreaSettings {
|
|
12
|
+
docMetainfo: boolean;
|
|
13
|
+
}
|
|
14
|
+
/** Dependencies injected by the host stub. */
|
|
15
|
+
export interface DocMetainfoAreaDeps {
|
|
16
|
+
settings: DocMetainfoAreaSettings;
|
|
17
|
+
/** Default locale code (e.g. "en"). */
|
|
18
|
+
defaultLocale: string;
|
|
19
|
+
/** The parsed `#doc-history-meta` JSON manifest (host-side import). */
|
|
20
|
+
docHistoryMeta: Record<string, DocHistoryMetaEntry>;
|
|
21
|
+
/** Translate a UI string key for a locale. */
|
|
22
|
+
t: (key: string, locale: string) => string;
|
|
23
|
+
/** Convert a canonical route slug to a history slug (sentinel: "" → "index"). */
|
|
24
|
+
toHistorySlug: (slug: string) => string;
|
|
25
|
+
}
|
|
26
|
+
export interface DocMetainfoAreaProps {
|
|
27
|
+
/** Page slug, e.g. "getting-started/intro". */
|
|
28
|
+
slug: string;
|
|
29
|
+
/** Active locale string, e.g. "en", "ja". */
|
|
30
|
+
locale: string;
|
|
31
|
+
/**
|
|
32
|
+
* True when this locale page falls back to the base EN collection
|
|
33
|
+
* (i.e. the slug has no translation for the active locale). When true,
|
|
34
|
+
* the manifest lookup uses defaultLocale so the visible block resolves
|
|
35
|
+
* the bare-slug key — the only key that exists for EN-origin files —
|
|
36
|
+
* matching the dropdown's `effectiveHistoryLocale` derivation in
|
|
37
|
+
* _doc-history-area.tsx. Display formatting (dates + labels) still uses
|
|
38
|
+
* the active locale so JA users see JA formatting on fallback pages.
|
|
39
|
+
*/
|
|
40
|
+
isFallback?: boolean;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Create a `DocMetainfoArea` component bound to the host's settings and
|
|
44
|
+
* injected dependencies.
|
|
45
|
+
*/
|
|
46
|
+
export declare function createDocMetainfoArea(deps: DocMetainfoAreaDeps): (props: DocMetainfoAreaProps) => VNode | null;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { jsx } from "preact/jsx-runtime";
|
|
2
|
+
import { DocMetainfo } from "../metainfo/index.js";
|
|
3
|
+
const LOCALE_TO_BCP47 = {
|
|
4
|
+
en: "en-US",
|
|
5
|
+
ja: "ja-JP",
|
|
6
|
+
de: "de-DE"
|
|
7
|
+
};
|
|
8
|
+
function formatDate(isoDate, locale) {
|
|
9
|
+
const d = new Date(isoDate);
|
|
10
|
+
if (isNaN(d.getTime())) return isoDate;
|
|
11
|
+
return d.toLocaleDateString(LOCALE_TO_BCP47[locale] ?? "en-US", {
|
|
12
|
+
year: "numeric",
|
|
13
|
+
month: "short",
|
|
14
|
+
day: "numeric"
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
function createDocMetainfoArea(deps) {
|
|
18
|
+
const { settings, defaultLocale, docHistoryMeta, t, toHistorySlug } = deps;
|
|
19
|
+
function DocMetainfoArea({ slug, locale, isFallback }) {
|
|
20
|
+
if (!settings.docMetainfo) return null;
|
|
21
|
+
const historySlug = toHistorySlug(slug);
|
|
22
|
+
const effectiveHistoryLocale = isFallback ? defaultLocale : locale;
|
|
23
|
+
const composedSlug = effectiveHistoryLocale === defaultLocale ? historySlug : `${effectiveHistoryLocale}/${historySlug}`;
|
|
24
|
+
const meta = docHistoryMeta[composedSlug];
|
|
25
|
+
if (!meta) return null;
|
|
26
|
+
return /* @__PURE__ */ jsx(
|
|
27
|
+
DocMetainfo,
|
|
28
|
+
{
|
|
29
|
+
createdAt: meta.createdDate ? formatDate(meta.createdDate, locale) : null,
|
|
30
|
+
updatedAt: meta.updatedDate ? formatDate(meta.updatedDate, locale) : null,
|
|
31
|
+
author: meta.author || null,
|
|
32
|
+
createdLabel: t("doc.created", locale),
|
|
33
|
+
updatedLabel: t("doc.updated", locale)
|
|
34
|
+
}
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
return DocMetainfoArea;
|
|
38
|
+
}
|
|
39
|
+
export {
|
|
40
|
+
createDocMetainfoArea
|
|
41
|
+
};
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
export type { HeadingItem } from "../extract-headings/index.js";
|
|
2
|
+
import type { HeadingItem } from "../extract-headings/index.js";
|
|
3
|
+
import type { BreadcrumbItem } from "../breadcrumb/types.js";
|
|
4
|
+
/**
|
|
5
|
+
* Nav tree node shape as consumed by doc-route pages.
|
|
6
|
+
*
|
|
7
|
+
* Structurally identical to the host project's `NavNode` from
|
|
8
|
+
* `src/utils/docs.ts`. Defined here so the package types do not import
|
|
9
|
+
* the host `@/` alias. The host's `NavNode` is a structural subtype and
|
|
10
|
+
* assignable wherever `DocNavNode` is expected.
|
|
11
|
+
*/
|
|
12
|
+
export interface DocNavNode {
|
|
13
|
+
slug: string;
|
|
14
|
+
label: string;
|
|
15
|
+
description?: string;
|
|
16
|
+
position: number;
|
|
17
|
+
href?: string;
|
|
18
|
+
hasPage: boolean;
|
|
19
|
+
children: DocNavNode[];
|
|
20
|
+
sortOrder?: "asc" | "desc";
|
|
21
|
+
collapsed?: boolean;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Minimal docs frontmatter shape consumed by the doc-page types.
|
|
25
|
+
*
|
|
26
|
+
* A structural subset of the host's `DocsData` — only the fields that
|
|
27
|
+
* `DocPageEntry` and `DocPageBaseProps` actually read. The full `DocsData`
|
|
28
|
+
* (from `src/config/docs-schema.ts`) is a structural supertype and is
|
|
29
|
+
* assignable here.
|
|
30
|
+
*/
|
|
31
|
+
export interface DocPageFrontmatter {
|
|
32
|
+
title: string;
|
|
33
|
+
description?: string;
|
|
34
|
+
slug?: string;
|
|
35
|
+
draft?: boolean;
|
|
36
|
+
unlisted?: boolean;
|
|
37
|
+
standalone?: boolean;
|
|
38
|
+
category_no_page?: boolean;
|
|
39
|
+
pagination_prev?: string | null;
|
|
40
|
+
pagination_next?: string | null;
|
|
41
|
+
tags?: string[];
|
|
42
|
+
[key: string]: unknown;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* A zfb content collection entry augmented with the `id`/`collection` fields
|
|
46
|
+
* the host's `@/utils/docs` helpers expect, plus the typed `data` and
|
|
47
|
+
* renderer surface.
|
|
48
|
+
*
|
|
49
|
+
* Structural counterpart of the host's `DocPageEntry` (from
|
|
50
|
+
* `pages/lib/doc-page-props.ts`). The host stub re-exports this type under
|
|
51
|
+
* the original name.
|
|
52
|
+
*/
|
|
53
|
+
export interface DocPageEntry {
|
|
54
|
+
/** zfb content engine slug (filename without `.md`/`.mdx`). */
|
|
55
|
+
slug: string;
|
|
56
|
+
/** Bridged from `slug` for host `@/utils/docs` compat. */
|
|
57
|
+
id: string;
|
|
58
|
+
/** Collection name, e.g. "docs", "docs-ja", "docs-v-1.0". */
|
|
59
|
+
collection: string;
|
|
60
|
+
/** Parsed frontmatter. Structural superset of `DocPageFrontmatter`. */
|
|
61
|
+
data: DocPageFrontmatter;
|
|
62
|
+
/** Raw MDX body (for heading extraction). */
|
|
63
|
+
body?: string;
|
|
64
|
+
/** zfb module specifier (for Content bridge). */
|
|
65
|
+
module_specifier: string;
|
|
66
|
+
/** zfb content renderer — callable Preact component. */
|
|
67
|
+
Content: unknown;
|
|
68
|
+
}
|
|
69
|
+
export interface AutoIndexNode extends DocNavNode {
|
|
70
|
+
children: DocNavNode[];
|
|
71
|
+
}
|
|
72
|
+
/** Shared fields present in every doc-page route. */
|
|
73
|
+
interface DocPagePropsBase {
|
|
74
|
+
breadcrumbs: BreadcrumbItem[];
|
|
75
|
+
prev: DocNavNode | null;
|
|
76
|
+
next: DocNavNode | null;
|
|
77
|
+
/** Depth-2/3/4 headings extracted from the MDX body, for SSG TOC links. */
|
|
78
|
+
headings: HeadingItem[];
|
|
79
|
+
}
|
|
80
|
+
/** Branch: a real content entry. `autoIndex` is absent. */
|
|
81
|
+
export interface DocPageEntryProps extends DocPagePropsBase {
|
|
82
|
+
kind: "entry";
|
|
83
|
+
entry: DocPageEntry;
|
|
84
|
+
autoIndex?: undefined;
|
|
85
|
+
}
|
|
86
|
+
/** Branch: an auto-generated category index. `entry` is absent. */
|
|
87
|
+
export interface DocPageAutoIndexProps extends DocPagePropsBase {
|
|
88
|
+
kind: "autoIndex";
|
|
89
|
+
autoIndex: AutoIndexNode;
|
|
90
|
+
entry?: undefined;
|
|
91
|
+
}
|
|
92
|
+
/** Discriminated union for the `kind` prop. Narrow via `props.kind === "entry"`. */
|
|
93
|
+
export type DocPageBaseProps = DocPageEntryProps | DocPageAutoIndexProps;
|
|
File without changes
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
/** @jsxRuntime automatic */
|
|
2
|
+
/** @jsxImportSource preact */
|
|
3
|
+
import type { JSX, VNode } from "preact";
|
|
4
|
+
import type { DocPageBaseProps, DocNavNode, DocPageEntry } from "../doc-page-props/index.js";
|
|
5
|
+
import type { VersionBannerLabels } from "../i18n-version/index.js";
|
|
6
|
+
export type { DocPageBaseProps };
|
|
7
|
+
/**
|
|
8
|
+
* Version config shape — structural subset of the host's `VersionConfig`.
|
|
9
|
+
* Defined here so the package does not import the host `@/` alias.
|
|
10
|
+
*/
|
|
11
|
+
export interface RenderDocPageVersionConfig {
|
|
12
|
+
/** Version slug, e.g. "1.0". */
|
|
13
|
+
slug: string;
|
|
14
|
+
/** Banner type drives the VersionBanner element (`false` = no banner). */
|
|
15
|
+
banner?: "unmaintained" | "unreleased" | false;
|
|
16
|
+
}
|
|
17
|
+
export interface RenderDocPageOptions {
|
|
18
|
+
/** Active locale — drives nav wrappers, labels, and URL building. */
|
|
19
|
+
locale: string;
|
|
20
|
+
/** Version config when rendering a versioned route; undefined = latest. */
|
|
21
|
+
version?: RenderDocPageVersionConfig;
|
|
22
|
+
/** True when this page falls back to the base EN collection (locale
|
|
23
|
+
* routes). Drives the fallback notice + history-area hint. */
|
|
24
|
+
isFallback?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Content directory for the doc-history view-source link (e.g. the active
|
|
27
|
+
* locale's dir, or the base docsDir for EN/fallback pages). Latest routes
|
|
28
|
+
* pass it; versioned routes omit it — doc history is hidden on versioned
|
|
29
|
+
* pages regardless (#1916 #5).
|
|
30
|
+
*/
|
|
31
|
+
docHistoryContentDir?: string;
|
|
32
|
+
}
|
|
33
|
+
/** Dependencies injected by the host stub. */
|
|
34
|
+
export interface DocPageRendererDeps {
|
|
35
|
+
/** Build a docs URL: `docsUrl(slug, lang?)` → base-prefixed path. */
|
|
36
|
+
docsUrl: (slug: string, lang?: string) => string;
|
|
37
|
+
/** Build a versioned docs URL: `versionedDocsUrl(slug, versionSlug, lang?)`. */
|
|
38
|
+
versionedDocsUrl: (slug: string, versionSlug: string, lang?: string) => string;
|
|
39
|
+
/** Build an absolute URL: `absoluteUrl(path)` → siteUrl-prefixed. */
|
|
40
|
+
absoluteUrl: (path: string) => string | undefined;
|
|
41
|
+
/** Determine the nav section (categoryMatch) for a slug. */
|
|
42
|
+
getNavSectionForSlug: (slug: string) => string | undefined;
|
|
43
|
+
/** Convert a content entry slug to a canonical route slug. */
|
|
44
|
+
toRouteSlug: (id: string) => string;
|
|
45
|
+
/**
|
|
46
|
+
* Build locale-aware MDX components bag.
|
|
47
|
+
* Host passes `createMdxComponents` (from `pages/_mdx-components.ts`).
|
|
48
|
+
*/
|
|
49
|
+
createMdxComponents: (locale: string) => Record<string, unknown>;
|
|
50
|
+
/** Translate a UI string key for a locale. */
|
|
51
|
+
t: (key: string, locale: string) => string;
|
|
52
|
+
/**
|
|
53
|
+
* Build an inline version switcher VNode for the breadcrumb rightSlot.
|
|
54
|
+
* Host passes `buildInlineVersionSwitcher` from `pages/lib/_inline-version-switcher.tsx`.
|
|
55
|
+
*/
|
|
56
|
+
buildInlineVersionSwitcher: (slug: string, locale: string, currentVersion?: string) => JSX.Element | undefined;
|
|
57
|
+
/**
|
|
58
|
+
* The `DocPageShell` component (host-side factory result from
|
|
59
|
+
* `@takazudo/zudo-doc/doc-page-shell`).
|
|
60
|
+
*/
|
|
61
|
+
DocPageShell: (props: {
|
|
62
|
+
kind: "entry" | "autoIndex";
|
|
63
|
+
locale: string;
|
|
64
|
+
slug: string;
|
|
65
|
+
title: string;
|
|
66
|
+
description?: string;
|
|
67
|
+
canonical?: string;
|
|
68
|
+
breadcrumbs: Array<{
|
|
69
|
+
label: string;
|
|
70
|
+
href?: string;
|
|
71
|
+
}>;
|
|
72
|
+
prev: DocNavNode | null;
|
|
73
|
+
next: DocNavNode | null;
|
|
74
|
+
headings: Array<{
|
|
75
|
+
depth: number;
|
|
76
|
+
slug: string;
|
|
77
|
+
text: string;
|
|
78
|
+
}>;
|
|
79
|
+
navSection: string | undefined;
|
|
80
|
+
sidebarPersistKey: string | undefined;
|
|
81
|
+
hideSidebar?: boolean;
|
|
82
|
+
hideToc?: boolean;
|
|
83
|
+
currentPath: string;
|
|
84
|
+
currentVersion?: string;
|
|
85
|
+
versionSwitcher: JSX.Element | undefined;
|
|
86
|
+
versionBanner?: "unmaintained" | "unreleased";
|
|
87
|
+
versionBannerLatestUrl?: string;
|
|
88
|
+
versionBannerLabels?: VersionBannerLabels;
|
|
89
|
+
autoIndexLabel?: string;
|
|
90
|
+
autoIndexChildren?: DocNavNode[];
|
|
91
|
+
metainfoSlot?: VNode | null;
|
|
92
|
+
contentHeaderSlot?: VNode;
|
|
93
|
+
contentSlot?: VNode;
|
|
94
|
+
docHistorySlot?: VNode | null;
|
|
95
|
+
}) => JSX.Element;
|
|
96
|
+
/**
|
|
97
|
+
* The `DocContentHeader` component (host-side factory result).
|
|
98
|
+
*/
|
|
99
|
+
DocContentHeader: (props: {
|
|
100
|
+
entry: DocPageEntry;
|
|
101
|
+
slug: string;
|
|
102
|
+
locale: string;
|
|
103
|
+
isFallback?: boolean;
|
|
104
|
+
version?: string;
|
|
105
|
+
}) => JSX.Element;
|
|
106
|
+
/**
|
|
107
|
+
* The `DocMetainfoArea` component (host-side factory result).
|
|
108
|
+
*/
|
|
109
|
+
DocMetainfoArea: (props: {
|
|
110
|
+
slug: string;
|
|
111
|
+
locale: string;
|
|
112
|
+
isFallback?: boolean;
|
|
113
|
+
}) => JSX.Element | null;
|
|
114
|
+
/**
|
|
115
|
+
* The `DocHistoryArea` component (host-side factory result).
|
|
116
|
+
*/
|
|
117
|
+
DocHistoryArea: (props: {
|
|
118
|
+
slug: string;
|
|
119
|
+
locale: string;
|
|
120
|
+
entrySlug?: string;
|
|
121
|
+
contentDir?: string;
|
|
122
|
+
isFallback?: boolean;
|
|
123
|
+
}) => VNode | null;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Create a `renderDocPage` function bound to the host's injected dependencies.
|
|
127
|
+
*/
|
|
128
|
+
export declare function createRenderDocPage(deps: DocPageRendererDeps): (props: DocPageBaseProps, opts: RenderDocPageOptions) => JSX.Element;
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { jsx } from "preact/jsx-runtime";
|
|
2
|
+
function createRenderDocPage(deps) {
|
|
3
|
+
const {
|
|
4
|
+
docsUrl,
|
|
5
|
+
versionedDocsUrl,
|
|
6
|
+
absoluteUrl,
|
|
7
|
+
getNavSectionForSlug,
|
|
8
|
+
toRouteSlug,
|
|
9
|
+
createMdxComponents,
|
|
10
|
+
t,
|
|
11
|
+
buildInlineVersionSwitcher,
|
|
12
|
+
DocPageShell,
|
|
13
|
+
DocContentHeader,
|
|
14
|
+
DocMetainfoArea,
|
|
15
|
+
DocHistoryArea
|
|
16
|
+
} = deps;
|
|
17
|
+
function renderDocPage(props, opts) {
|
|
18
|
+
const { breadcrumbs, prev, next, headings } = props;
|
|
19
|
+
const { locale, version, isFallback } = opts;
|
|
20
|
+
const slug = props.kind === "autoIndex" ? props.autoIndex.slug : props.entry.data.slug ?? toRouteSlug(props.entry.slug);
|
|
21
|
+
const title = props.kind === "autoIndex" ? props.autoIndex.label : props.entry.data.title;
|
|
22
|
+
const description = props.kind === "autoIndex" ? props.autoIndex.description : props.entry.data.description;
|
|
23
|
+
const components = createMdxComponents(locale);
|
|
24
|
+
const autoIndexChildren = props.kind === "autoIndex" ? version ? props.autoIndex.children.filter((c) => c.hasPage || c.children.length > 0) : props.autoIndex.children.filter((c) => c.hasPage || c.children.length > 0).map((c) => ({
|
|
25
|
+
...c,
|
|
26
|
+
href: c.href ?? docsUrl(c.slug, locale)
|
|
27
|
+
})) : [];
|
|
28
|
+
const versionBannerType = version?.banner ? version.banner : void 0;
|
|
29
|
+
const versionBannerLatestUrl = versionBannerType ? docsUrl(slug, locale) : void 0;
|
|
30
|
+
const versionBannerLabels = versionBannerType ? {
|
|
31
|
+
message: versionBannerType === "unmaintained" ? t("version.banner.unmaintained", locale) : t("version.banner.unreleased", locale),
|
|
32
|
+
latestLink: t("version.banner.latestLink", locale)
|
|
33
|
+
} : void 0;
|
|
34
|
+
const currentPath = version ? versionedDocsUrl(slug, version.slug, locale) : docsUrl(slug, locale);
|
|
35
|
+
const canonical = absoluteUrl(currentPath);
|
|
36
|
+
const navSection = getNavSectionForSlug(slug);
|
|
37
|
+
const hideSidebar = props.kind === "entry" ? props.entry.data.hide_sidebar : void 0;
|
|
38
|
+
const sidebarPersistKey = hideSidebar ? void 0 : `sidebar-${locale}-${navSection ?? "default"}`;
|
|
39
|
+
const ContentComponent = props.kind === "entry" ? props.entry.Content : null;
|
|
40
|
+
return /* @__PURE__ */ jsx(
|
|
41
|
+
DocPageShell,
|
|
42
|
+
{
|
|
43
|
+
kind: props.kind,
|
|
44
|
+
locale,
|
|
45
|
+
slug,
|
|
46
|
+
title,
|
|
47
|
+
description,
|
|
48
|
+
canonical,
|
|
49
|
+
breadcrumbs,
|
|
50
|
+
prev,
|
|
51
|
+
next,
|
|
52
|
+
headings,
|
|
53
|
+
navSection,
|
|
54
|
+
sidebarPersistKey,
|
|
55
|
+
hideSidebar,
|
|
56
|
+
hideToc: props.kind === "entry" ? props.entry.data.hide_toc : void 0,
|
|
57
|
+
currentPath,
|
|
58
|
+
currentVersion: version?.slug,
|
|
59
|
+
versionSwitcher: buildInlineVersionSwitcher(slug, locale, version?.slug),
|
|
60
|
+
versionBanner: versionBannerType,
|
|
61
|
+
versionBannerLatestUrl,
|
|
62
|
+
versionBannerLabels,
|
|
63
|
+
autoIndexLabel: props.kind === "autoIndex" ? props.autoIndex.label : void 0,
|
|
64
|
+
autoIndexChildren,
|
|
65
|
+
metainfoSlot: (
|
|
66
|
+
// Versioned gate mirrors DocContentHeader: the doc-history-meta
|
|
67
|
+
// manifest is built from latest dirs only, so a bare versioned slug
|
|
68
|
+
// would surface the LATEST page's Created/Updated/Author.
|
|
69
|
+
!version && props.kind === "autoIndex" ? /* @__PURE__ */ jsx(DocMetainfoArea, { slug, locale, isFallback }) : null
|
|
70
|
+
),
|
|
71
|
+
contentHeaderSlot: props.kind === "entry" ? /* @__PURE__ */ jsx(
|
|
72
|
+
DocContentHeader,
|
|
73
|
+
{
|
|
74
|
+
entry: props.entry,
|
|
75
|
+
slug,
|
|
76
|
+
locale,
|
|
77
|
+
isFallback,
|
|
78
|
+
version: version?.slug
|
|
79
|
+
}
|
|
80
|
+
) : void 0,
|
|
81
|
+
contentSlot: ContentComponent ? /* @__PURE__ */ jsx(ContentComponent, { components }) : void 0,
|
|
82
|
+
docHistorySlot: (
|
|
83
|
+
// #1916 #5: doc-history hidden on versioned pages until versioned
|
|
84
|
+
// history is supported.
|
|
85
|
+
!version && opts.docHistoryContentDir !== void 0 && props.kind === "entry" && !props.entry.data.unlisted ? /* @__PURE__ */ jsx(
|
|
86
|
+
DocHistoryArea,
|
|
87
|
+
{
|
|
88
|
+
slug,
|
|
89
|
+
locale,
|
|
90
|
+
entrySlug: props.entry.slug,
|
|
91
|
+
contentDir: opts.docHistoryContentDir,
|
|
92
|
+
isFallback
|
|
93
|
+
}
|
|
94
|
+
) : null
|
|
95
|
+
)
|
|
96
|
+
}
|
|
97
|
+
);
|
|
98
|
+
}
|
|
99
|
+
return renderDocPage;
|
|
100
|
+
}
|
|
101
|
+
export {
|
|
102
|
+
createRenderDocPage
|
|
103
|
+
};
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
/** @jsxRuntime automatic */
|
|
2
|
+
/** @jsxImportSource preact */
|
|
3
|
+
import type { ComponentChildren, JSX, VNode } from "preact";
|
|
4
|
+
import type { VersionBannerLabels } from "../i18n-version/index.js";
|
|
5
|
+
/** A heading item for the TOC. */
|
|
6
|
+
export interface DocPageHeading {
|
|
7
|
+
depth: number;
|
|
8
|
+
slug: string;
|
|
9
|
+
text: string;
|
|
10
|
+
}
|
|
11
|
+
/** A breadcrumb item. */
|
|
12
|
+
export interface DocPageBreadcrumbItem {
|
|
13
|
+
label: string;
|
|
14
|
+
href?: string;
|
|
15
|
+
}
|
|
16
|
+
/** A nav node for prev/next/autoIndex. */
|
|
17
|
+
export interface DocPageNavNode {
|
|
18
|
+
slug: string;
|
|
19
|
+
label: string;
|
|
20
|
+
href?: string;
|
|
21
|
+
hasPage: boolean;
|
|
22
|
+
children: DocPageNavNode[];
|
|
23
|
+
}
|
|
24
|
+
/** Slots and parameters that vary between the 4 doc routes. */
|
|
25
|
+
export interface DocPageShellProps {
|
|
26
|
+
/** Discriminates the body: a real entry vs an auto-generated category index. */
|
|
27
|
+
kind: "entry" | "autoIndex";
|
|
28
|
+
/** Active locale string, e.g. "en", "ja". */
|
|
29
|
+
locale: string;
|
|
30
|
+
/** Canonical route slug for this page (no version/locale prefix). */
|
|
31
|
+
slug: string;
|
|
32
|
+
/** Page title (entry title or auto-index label). */
|
|
33
|
+
title: string;
|
|
34
|
+
/** Page description (may be undefined). */
|
|
35
|
+
description?: string;
|
|
36
|
+
/** Absolute canonical URL, or undefined when siteUrl is unset. */
|
|
37
|
+
canonical?: string;
|
|
38
|
+
/** Pre-resolved breadcrumb trail (hrefs already remapped per route). */
|
|
39
|
+
breadcrumbs: DocPageBreadcrumbItem[];
|
|
40
|
+
/** Pre-resolved prev/next nav nodes (hrefs already remapped per route). */
|
|
41
|
+
prev: DocPageNavNode | null;
|
|
42
|
+
next: DocPageNavNode | null;
|
|
43
|
+
/** Depth-2/3/4 headings for the SSG TOC. */
|
|
44
|
+
headings: DocPageHeading[];
|
|
45
|
+
/** Sidebar/header nav-section key for this slug. */
|
|
46
|
+
navSection: string | undefined;
|
|
47
|
+
/** Per-page sidebar persist key (undefined when the sidebar is hidden). */
|
|
48
|
+
sidebarPersistKey: string | undefined;
|
|
49
|
+
/** Whether to hide the sidebar entirely (entry frontmatter). */
|
|
50
|
+
hideSidebar?: boolean;
|
|
51
|
+
/** Whether to hide the TOC (entry frontmatter). */
|
|
52
|
+
hideToc?: boolean;
|
|
53
|
+
/** Path of THIS page used by Header/Sidebar to mark the active item. */
|
|
54
|
+
currentPath: string;
|
|
55
|
+
/** Version slug for Header/Sidebar active-state, or undefined on latest routes. */
|
|
56
|
+
currentVersion?: string;
|
|
57
|
+
/** Inline version switcher VNode for the breadcrumb right-slot. */
|
|
58
|
+
versionSwitcher: ComponentChildren;
|
|
59
|
+
/** Version banner type ("unmaintained" | "unreleased") or undefined on latest. */
|
|
60
|
+
versionBanner?: "unmaintained" | "unreleased";
|
|
61
|
+
/** URL of the latest equivalent page for the version banner link. */
|
|
62
|
+
versionBannerLatestUrl?: string;
|
|
63
|
+
/** Localized version-banner labels. */
|
|
64
|
+
versionBannerLabels?: VersionBannerLabels;
|
|
65
|
+
/** Auto-index branch: label heading text. */
|
|
66
|
+
autoIndexLabel?: string;
|
|
67
|
+
/** Auto-index branch: pre-filtered + href-remapped child cards. */
|
|
68
|
+
autoIndexChildren?: DocPageNavNode[];
|
|
69
|
+
/**
|
|
70
|
+
* Auto-index branch slot: the build-time date block (DocMetainfoArea), or
|
|
71
|
+
* null to omit it.
|
|
72
|
+
*/
|
|
73
|
+
metainfoSlot?: VNode | null;
|
|
74
|
+
/**
|
|
75
|
+
* Entry branch slot: the content header (h1 + meta + tags + description +
|
|
76
|
+
* frontmatter preview), built per route (carries isFallback).
|
|
77
|
+
*/
|
|
78
|
+
contentHeaderSlot?: VNode;
|
|
79
|
+
/** Entry branch slot: the rendered MDX `<Content />`. */
|
|
80
|
+
contentSlot?: VNode;
|
|
81
|
+
/**
|
|
82
|
+
* Entry branch slot: the document-utilities area (DocHistoryArea), or null
|
|
83
|
+
* to omit it.
|
|
84
|
+
*/
|
|
85
|
+
docHistorySlot?: VNode | null;
|
|
86
|
+
}
|
|
87
|
+
/** Settings subset read by {@link createDocPageShell}. */
|
|
88
|
+
export interface DocPageShellSettings {
|
|
89
|
+
metaTags: {
|
|
90
|
+
description?: boolean | null;
|
|
91
|
+
};
|
|
92
|
+
noindex?: boolean;
|
|
93
|
+
dynamicPageTransition?: boolean;
|
|
94
|
+
}
|
|
95
|
+
/** Dependencies injected by the host stub. */
|
|
96
|
+
export interface DocPageShellDeps {
|
|
97
|
+
settings: DocPageShellSettings;
|
|
98
|
+
composeMetaTitle: (title: string) => string;
|
|
99
|
+
getTocTitle: (locale: string) => string;
|
|
100
|
+
HeadWithDefaults: (props: {
|
|
101
|
+
title: string;
|
|
102
|
+
description?: string;
|
|
103
|
+
canonical?: string;
|
|
104
|
+
}) => JSX.Element;
|
|
105
|
+
SidebarWithDefaults: (props: {
|
|
106
|
+
currentSlug?: string;
|
|
107
|
+
lang?: string;
|
|
108
|
+
navSection?: string;
|
|
109
|
+
currentVersion?: string;
|
|
110
|
+
currentPath?: string;
|
|
111
|
+
}) => JSX.Element;
|
|
112
|
+
HeaderWithDefaults: (props: {
|
|
113
|
+
lang?: string;
|
|
114
|
+
currentSlug?: string;
|
|
115
|
+
navSection?: string;
|
|
116
|
+
currentVersion?: string;
|
|
117
|
+
currentPath?: string;
|
|
118
|
+
}) => JSX.Element;
|
|
119
|
+
FooterWithDefaults: (props: {
|
|
120
|
+
lang?: string;
|
|
121
|
+
}) => JSX.Element;
|
|
122
|
+
SidebarPrepaint: (props: {
|
|
123
|
+
hideSidebar?: boolean;
|
|
124
|
+
}) => JSX.Element | undefined;
|
|
125
|
+
DocBodyEnd: (props: Record<string, never>) => JSX.Element;
|
|
126
|
+
DocPager: (props: {
|
|
127
|
+
prev: DocPageNavNode | null;
|
|
128
|
+
next: DocPageNavNode | null;
|
|
129
|
+
locale: string;
|
|
130
|
+
}) => JSX.Element;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Create a `DocPageShell` component bound to the host's settings and
|
|
134
|
+
* component dependencies.
|
|
135
|
+
*/
|
|
136
|
+
export declare function createDocPageShell(deps: DocPageShellDeps): (props: DocPageShellProps) => JSX.Element;
|