@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
package/dist/icons/index.d.ts
CHANGED
|
@@ -1,18 +1,14 @@
|
|
|
1
|
-
import { VNode } from 'preact';
|
|
2
|
-
|
|
3
1
|
/** @jsxRuntime automatic */
|
|
4
2
|
/** @jsxImportSource preact */
|
|
5
|
-
|
|
6
|
-
interface IconProps {
|
|
3
|
+
import type { VNode } from "preact";
|
|
4
|
+
export interface IconProps {
|
|
7
5
|
/** CSS class string forwarded to the root `<svg>` element. */
|
|
8
6
|
className?: string;
|
|
9
7
|
}
|
|
10
|
-
declare function ChevronRight({ className }: IconProps): VNode;
|
|
11
|
-
declare function ChevronLeft({ className }: IconProps): VNode;
|
|
12
|
-
declare function Search({ className }: IconProps): VNode;
|
|
13
|
-
declare function History({ className }: IconProps): VNode;
|
|
14
|
-
declare function Close({ className }: IconProps): VNode;
|
|
15
|
-
declare function ArrowLeft({ className }: IconProps): VNode;
|
|
16
|
-
declare function GitHub({ className }: IconProps): VNode;
|
|
17
|
-
|
|
18
|
-
export { ArrowLeft, ChevronLeft, ChevronRight, Close, GitHub, History, type IconProps, Search };
|
|
8
|
+
export declare function ChevronRight({ className }: IconProps): VNode;
|
|
9
|
+
export declare function ChevronLeft({ className }: IconProps): VNode;
|
|
10
|
+
export declare function Search({ className }: IconProps): VNode;
|
|
11
|
+
export declare function History({ className }: IconProps): VNode;
|
|
12
|
+
export declare function Close({ className }: IconProps): VNode;
|
|
13
|
+
export declare function ArrowLeft({ className }: IconProps): VNode;
|
|
14
|
+
export declare function GitHub({ className }: IconProps): VNode;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare function ImageEnlarge(): import("preact").JSX.Element;
|
|
2
|
+
export declare namespace ImageEnlarge {
|
|
3
|
+
var displayName: string;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Static SSR fallback for the {@link ImageEnlarge} island.
|
|
7
|
+
*
|
|
8
|
+
* Renders an empty, closed `<dialog class="zd-enlarge-dialog ...">` so the
|
|
9
|
+
* dist HTML carries the dialog shell even before hydration. Sources its
|
|
10
|
+
* class and inline style from the shared constants in island-types so the
|
|
11
|
+
* SSR fallback cannot drift from the hydrated dialog above.
|
|
12
|
+
*/
|
|
13
|
+
export declare function ImageEnlargeSsrFallback(): import("preact").JSX.Element;
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "preact/jsx-runtime";
|
|
3
|
+
import { useState, useEffect } from "preact/compat";
|
|
4
|
+
import { AFTER_NAVIGATE_EVENT } from "../transitions/index.js";
|
|
5
|
+
import { useModalDialog } from "../use-modal-dialog/index.js";
|
|
6
|
+
import {
|
|
7
|
+
IMAGE_ENLARGE_DIALOG_CLASS,
|
|
8
|
+
ENLARGE_DIALOG_STYLE
|
|
9
|
+
} from "../island-types/index.js";
|
|
10
|
+
function ImageEnlarge() {
|
|
11
|
+
const [imgData, setImgData] = useState(null);
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
const observedImages = /* @__PURE__ */ new Set();
|
|
14
|
+
const sharedResizeObserver = new ResizeObserver((entries) => {
|
|
15
|
+
for (const entry of entries) {
|
|
16
|
+
evaluateEligibility(entry.target);
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
let mutationObserver = null;
|
|
20
|
+
let resizeTimer = 0;
|
|
21
|
+
let loadAbortController = new AbortController();
|
|
22
|
+
function evaluateEligibility(img) {
|
|
23
|
+
const container = img.closest(".zd-enlargeable");
|
|
24
|
+
if (!container) return;
|
|
25
|
+
const btn = container.querySelector(".zd-enlarge-btn");
|
|
26
|
+
if (!btn) return;
|
|
27
|
+
const eligible = img.naturalWidth > img.clientWidth * window.devicePixelRatio;
|
|
28
|
+
if (eligible) {
|
|
29
|
+
btn.removeAttribute("hidden");
|
|
30
|
+
} else {
|
|
31
|
+
btn.setAttribute("hidden", "");
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
function observeImage(img) {
|
|
35
|
+
if (observedImages.has(img)) return;
|
|
36
|
+
observedImages.add(img);
|
|
37
|
+
sharedResizeObserver.observe(img);
|
|
38
|
+
if (img.complete) {
|
|
39
|
+
evaluateEligibility(img);
|
|
40
|
+
} else {
|
|
41
|
+
img.addEventListener(
|
|
42
|
+
"load",
|
|
43
|
+
() => evaluateEligibility(img),
|
|
44
|
+
{ once: true, signal: loadAbortController.signal }
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
function scanContent() {
|
|
49
|
+
const scope = document.querySelector("main .zd-content");
|
|
50
|
+
if (!scope) return;
|
|
51
|
+
scope.querySelectorAll(".zd-enlargeable img").forEach(observeImage);
|
|
52
|
+
}
|
|
53
|
+
function startObserving() {
|
|
54
|
+
const scope = document.querySelector("main .zd-content");
|
|
55
|
+
if (scope) {
|
|
56
|
+
mutationObserver = new MutationObserver((mutations) => {
|
|
57
|
+
for (const mutation of mutations) {
|
|
58
|
+
for (const node of mutation.addedNodes) {
|
|
59
|
+
if (!(node instanceof Element)) continue;
|
|
60
|
+
if (node.matches(".zd-enlargeable")) {
|
|
61
|
+
node.querySelectorAll("img").forEach(observeImage);
|
|
62
|
+
}
|
|
63
|
+
node.querySelectorAll(".zd-enlargeable img").forEach(observeImage);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
mutationObserver.observe(scope, { childList: true, subtree: true });
|
|
68
|
+
}
|
|
69
|
+
scanContent();
|
|
70
|
+
}
|
|
71
|
+
function handleWindowResize() {
|
|
72
|
+
clearTimeout(resizeTimer);
|
|
73
|
+
resizeTimer = window.setTimeout(() => {
|
|
74
|
+
observedImages.forEach((img) => evaluateEligibility(img));
|
|
75
|
+
}, 150);
|
|
76
|
+
}
|
|
77
|
+
function handleAfterSwap() {
|
|
78
|
+
sharedResizeObserver.disconnect();
|
|
79
|
+
observedImages.clear();
|
|
80
|
+
mutationObserver?.disconnect();
|
|
81
|
+
mutationObserver = null;
|
|
82
|
+
loadAbortController.abort();
|
|
83
|
+
loadAbortController = new AbortController();
|
|
84
|
+
startObserving();
|
|
85
|
+
}
|
|
86
|
+
startObserving();
|
|
87
|
+
window.addEventListener("resize", handleWindowResize);
|
|
88
|
+
document.addEventListener(AFTER_NAVIGATE_EVENT, handleAfterSwap);
|
|
89
|
+
return () => {
|
|
90
|
+
sharedResizeObserver.disconnect();
|
|
91
|
+
observedImages.clear();
|
|
92
|
+
mutationObserver?.disconnect();
|
|
93
|
+
loadAbortController.abort();
|
|
94
|
+
window.removeEventListener("resize", handleWindowResize);
|
|
95
|
+
document.removeEventListener(AFTER_NAVIGATE_EVENT, handleAfterSwap);
|
|
96
|
+
clearTimeout(resizeTimer);
|
|
97
|
+
};
|
|
98
|
+
}, []);
|
|
99
|
+
useEffect(() => {
|
|
100
|
+
function handleDocumentClick(e) {
|
|
101
|
+
const sel = window.getSelection();
|
|
102
|
+
if (sel && !sel.isCollapsed) return;
|
|
103
|
+
const target = e.target;
|
|
104
|
+
const container = target.closest(".zd-enlargeable");
|
|
105
|
+
if (!container) return;
|
|
106
|
+
if (!target.closest(".zd-enlarge-btn") && !target.closest("img")) return;
|
|
107
|
+
const btn = container.querySelector(".zd-enlarge-btn");
|
|
108
|
+
if (!btn || btn.hasAttribute("hidden")) return;
|
|
109
|
+
const img = container.querySelector("img");
|
|
110
|
+
if (!img) return;
|
|
111
|
+
setImgData({
|
|
112
|
+
src: img.src,
|
|
113
|
+
currentSrc: img.currentSrc,
|
|
114
|
+
srcset: img.srcset || void 0,
|
|
115
|
+
sizes: img.sizes || void 0,
|
|
116
|
+
alt: img.alt,
|
|
117
|
+
naturalWidth: img.naturalWidth,
|
|
118
|
+
naturalHeight: img.naturalHeight
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
document.addEventListener("click", handleDocumentClick);
|
|
122
|
+
return () => document.removeEventListener("click", handleDocumentClick);
|
|
123
|
+
}, []);
|
|
124
|
+
const handleClose = () => setImgData(null);
|
|
125
|
+
const { dialogRef, handleBackdropClick } = useModalDialog({
|
|
126
|
+
isOpen: imgData !== null,
|
|
127
|
+
onClose: handleClose,
|
|
128
|
+
navigateEvent: AFTER_NAVIGATE_EVENT,
|
|
129
|
+
backdropClickClose: true
|
|
130
|
+
});
|
|
131
|
+
return /* @__PURE__ */ jsx(
|
|
132
|
+
"dialog",
|
|
133
|
+
{
|
|
134
|
+
ref: dialogRef,
|
|
135
|
+
onClick: handleBackdropClick,
|
|
136
|
+
className: IMAGE_ENLARGE_DIALOG_CLASS,
|
|
137
|
+
style: ENLARGE_DIALOG_STYLE,
|
|
138
|
+
children: imgData && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
139
|
+
/* @__PURE__ */ jsx("div", { className: "relative", children: /* @__PURE__ */ jsx(
|
|
140
|
+
"img",
|
|
141
|
+
{
|
|
142
|
+
src: imgData.currentSrc || imgData.src,
|
|
143
|
+
srcSet: imgData.srcset,
|
|
144
|
+
sizes: imgData.srcset ? "85vw" : void 0,
|
|
145
|
+
alt: imgData.alt,
|
|
146
|
+
className: "block max-h-[85vh] max-w-[85vw] object-contain"
|
|
147
|
+
}
|
|
148
|
+
) }),
|
|
149
|
+
/* @__PURE__ */ jsx(
|
|
150
|
+
"button",
|
|
151
|
+
{
|
|
152
|
+
type: "button",
|
|
153
|
+
onClick: () => dialogRef.current?.close(),
|
|
154
|
+
className: "zd-enlarge-dialog-close",
|
|
155
|
+
"aria-label": "Close enlarged image",
|
|
156
|
+
children: /* @__PURE__ */ jsx("svg", { viewBox: "0 0 161.03 161.03", fill: "currentColor", "aria-hidden": "true", focusable: "false", children: /* @__PURE__ */ jsx("polygon", { points: "161.03 10.27 150.76 0 80.51 70.24 10.27 0 0 10.27 70.24 80.51 0 150.76 10.27 161.03 80.51 90.78 150.76 161.03 161.03 150.76 90.78 80.51 161.03 10.27" }) })
|
|
157
|
+
}
|
|
158
|
+
)
|
|
159
|
+
] })
|
|
160
|
+
}
|
|
161
|
+
);
|
|
162
|
+
}
|
|
163
|
+
ImageEnlarge.displayName = "ImageEnlarge";
|
|
164
|
+
function ImageEnlargeSsrFallback() {
|
|
165
|
+
return /* @__PURE__ */ jsx(
|
|
166
|
+
"dialog",
|
|
167
|
+
{
|
|
168
|
+
className: IMAGE_ENLARGE_DIALOG_CLASS,
|
|
169
|
+
style: ENLARGE_DIALOG_STYLE
|
|
170
|
+
}
|
|
171
|
+
);
|
|
172
|
+
}
|
|
173
|
+
export {
|
|
174
|
+
ImageEnlarge,
|
|
175
|
+
ImageEnlargeSsrFallback
|
|
176
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @takazudo/zudo-doc — framework primitives that sit on top of zfb's engine.
|
|
3
|
+
*
|
|
4
|
+
* **Use the subpath exports for actual imports.** This root barrel deliberately
|
|
5
|
+
* stays empty so consumers don't drag in the entire framework when they only
|
|
6
|
+
* need one piece. Each topic area publishes its own subpath (declared in
|
|
7
|
+
* `package.json#exports`):
|
|
8
|
+
*
|
|
9
|
+
* import { buildSidebarTree, type SidebarNode } from "@takazudo/zudo-doc/sidebar-tree";
|
|
10
|
+
* import { DocHead, type HeadProps } from "@takazudo/zudo-doc/head";
|
|
11
|
+
* import { Toc, MobileToc } from "@takazudo/zudo-doc/toc";
|
|
12
|
+
* import { Breadcrumb } from "@takazudo/zudo-doc/breadcrumb";
|
|
13
|
+
* import { DocLayout, DocLayoutWithDefaults } from "@takazudo/zudo-doc/doclayout";
|
|
14
|
+
* import { ColorSchemeProvider, ThemeToggle } from "@takazudo/zudo-doc/theme";
|
|
15
|
+
* import { startViewTransition, sidebarPersistName } from "@takazudo/zudo-doc/transitions";
|
|
16
|
+
* import { initSidebarResizer } from "@takazudo/zudo-doc/sidebar-resizer";
|
|
17
|
+
*
|
|
18
|
+
* The SSR-skip wrapper subpath (`@takazudo/zudo-doc/ssr-skip`) was
|
|
19
|
+
* removed in Wave 8 (super-epic #1333 / child epic #1355). Hosts now
|
|
20
|
+
* compose body-end islands directly with zfb's native `<Island
|
|
21
|
+
* ssrFallback>` API so the page → real-component import chain stays
|
|
22
|
+
* walkable by zfb's island scanner.
|
|
23
|
+
*
|
|
24
|
+
* See packages/zudo-doc/README.md for the topic map.
|
|
25
|
+
*/
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/** @jsxRuntime automatic */
|
|
2
|
+
/** @jsxImportSource preact */
|
|
3
|
+
import type { JSX } from "preact";
|
|
4
|
+
/** Minimal version config entry needed by the inline version switcher. */
|
|
5
|
+
export interface InlineVersionSwitcherVersionEntry {
|
|
6
|
+
slug: string;
|
|
7
|
+
label?: string;
|
|
8
|
+
}
|
|
9
|
+
/** Settings subset read by the inline version switcher factory. */
|
|
10
|
+
export interface InlineVersionSwitcherSettings {
|
|
11
|
+
versions: InlineVersionSwitcherVersionEntry[] | false;
|
|
12
|
+
}
|
|
13
|
+
/** Injected dependencies for {@link createInlineVersionSwitcher}. */
|
|
14
|
+
export interface InlineVersionSwitcherDeps {
|
|
15
|
+
settings: InlineVersionSwitcherSettings;
|
|
16
|
+
/** Default locale code (e.g. `"en"`). */
|
|
17
|
+
defaultLocale: string;
|
|
18
|
+
/** Translate a UI string key for a locale. */
|
|
19
|
+
t: (key: string, locale: string) => string;
|
|
20
|
+
/** Build a docs URL for the given slug and lang. */
|
|
21
|
+
docsUrl: (slug: string, lang?: string) => string;
|
|
22
|
+
/** Build a versioned docs URL for the given slug, version, and lang. */
|
|
23
|
+
versionedDocsUrl: (slug: string, versionSlug: string, lang?: string) => string;
|
|
24
|
+
/** Prefix a path with the configured base directory. */
|
|
25
|
+
withBase: (path: string) => string;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Build the `buildInlineVersionSwitcher` function bound to the host's settings
|
|
29
|
+
* and dependencies.
|
|
30
|
+
*/
|
|
31
|
+
export declare function createInlineVersionSwitcher(deps: InlineVersionSwitcherDeps): (slug: string, locale: string, currentVersion?: string) => JSX.Element | undefined;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { jsx } from "preact/jsx-runtime";
|
|
2
|
+
import {
|
|
3
|
+
VersionSwitcher
|
|
4
|
+
} from "../i18n-version/index.js";
|
|
5
|
+
function createInlineVersionSwitcher(deps) {
|
|
6
|
+
const { settings, defaultLocale, t, docsUrl, versionedDocsUrl, withBase } = deps;
|
|
7
|
+
function buildInlineVersionSwitcher(slug, locale, currentVersion) {
|
|
8
|
+
if (!settings.versions || settings.versions.length === 0) return void 0;
|
|
9
|
+
const isNonDefaultLocale = locale !== defaultLocale;
|
|
10
|
+
const versionsPageUrl = withBase(
|
|
11
|
+
isNonDefaultLocale ? `/${locale}/docs/versions` : "/docs/versions"
|
|
12
|
+
);
|
|
13
|
+
const latestUrl = docsUrl(slug, locale);
|
|
14
|
+
const versionUrls = {};
|
|
15
|
+
for (const v of settings.versions) {
|
|
16
|
+
versionUrls[v.slug] = versionedDocsUrl(slug, v.slug, locale);
|
|
17
|
+
}
|
|
18
|
+
const labels = {
|
|
19
|
+
latest: t("version.latest", locale),
|
|
20
|
+
switcher: t("version.switcher.label", locale),
|
|
21
|
+
unavailable: t("version.switcher.unavailable", locale),
|
|
22
|
+
allVersions: t("version.switcher.allVersions", locale)
|
|
23
|
+
};
|
|
24
|
+
return /* @__PURE__ */ jsx(
|
|
25
|
+
VersionSwitcher,
|
|
26
|
+
{
|
|
27
|
+
versions: settings.versions.map((v) => ({
|
|
28
|
+
slug: v.slug,
|
|
29
|
+
label: v.label ?? v.slug
|
|
30
|
+
})),
|
|
31
|
+
currentVersion,
|
|
32
|
+
latestUrl,
|
|
33
|
+
versionsPageUrl,
|
|
34
|
+
versionUrls,
|
|
35
|
+
labels,
|
|
36
|
+
idSuffix: "inline"
|
|
37
|
+
}
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
return buildInlineVersionSwitcher;
|
|
41
|
+
}
|
|
42
|
+
export {
|
|
43
|
+
createInlineVersionSwitcher
|
|
44
|
+
};
|
|
@@ -3,6 +3,4 @@
|
|
|
3
3
|
* Preserves content inside code blocks (``` ... ```) and inline code (` ... `).
|
|
4
4
|
* Handles 3+ backtick fenced blocks correctly.
|
|
5
5
|
*/
|
|
6
|
-
declare function escapeForMdx(content: string): string;
|
|
7
|
-
|
|
8
|
-
export { escapeForMdx };
|
|
6
|
+
export declare function escapeForMdx(content: string): string;
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
interface ClaudeResourcesConfig {
|
|
1
|
+
export interface ClaudeResourcesConfig {
|
|
2
2
|
claudeDir: string;
|
|
3
3
|
projectRoot?: string;
|
|
4
4
|
docsDir: string;
|
|
5
5
|
}
|
|
6
|
-
declare function generateClaudeResourcesDocs(config: ClaudeResourcesConfig): {
|
|
6
|
+
export declare function generateClaudeResourcesDocs(config: ClaudeResourcesConfig): {
|
|
7
7
|
claudemd: number;
|
|
8
8
|
commands: number;
|
|
9
9
|
skills: number;
|
|
10
10
|
agents: number;
|
|
11
11
|
};
|
|
12
|
-
|
|
13
|
-
export { type ClaudeResourcesConfig, generateClaudeResourcesDocs };
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import { generateClaudeResourcesDocs } from
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
interface ZfbPluginConfig {
|
|
1
|
+
import { generateClaudeResourcesDocs, type ClaudeResourcesConfig } from "./generate.js";
|
|
2
|
+
export interface ZfbPluginConfig {
|
|
5
3
|
name: string;
|
|
6
4
|
options?: Record<string, unknown>;
|
|
7
5
|
}
|
|
8
|
-
declare const CLAUDE_RESOURCES_PLUGIN_NAME = "@takazudo/zudo-doc-claude-resources";
|
|
6
|
+
export declare const CLAUDE_RESOURCES_PLUGIN_NAME = "@takazudo/zudo-doc-claude-resources";
|
|
9
7
|
/** Options accepted by both the plugin entry and the imperative runner. */
|
|
10
|
-
interface ClaudeResourcesPluginOptions {
|
|
8
|
+
export interface ClaudeResourcesPluginOptions {
|
|
11
9
|
/**
|
|
12
10
|
* Path to the project's `.claude/` directory holding `commands/`,
|
|
13
11
|
* `skills/`, `agents/`. Resolved against `projectRoot` when relative.
|
|
@@ -34,13 +32,12 @@ interface ClaudeResourcesPluginOptions {
|
|
|
34
32
|
* `runClaudeResourcesPreStep` from a `prebuild`-style script until the
|
|
35
33
|
* lifecycle hook lands. The plugin entry itself is forward-compatible.
|
|
36
34
|
*/
|
|
37
|
-
declare function claudeResourcesPlugin(options: ClaudeResourcesPluginOptions): ZfbPluginConfig;
|
|
35
|
+
export declare function claudeResourcesPlugin(options: ClaudeResourcesPluginOptions): ZfbPluginConfig;
|
|
38
36
|
/**
|
|
39
37
|
* Imperative pre-step runner. Resolves relative paths against
|
|
40
38
|
* `projectRoot` (defaults to `process.cwd()`) and invokes the underlying
|
|
41
39
|
* generator. Output is byte-equivalent to the Astro integration when
|
|
42
40
|
* given the same inputs.
|
|
43
41
|
*/
|
|
44
|
-
declare function runClaudeResourcesPreStep(options: ClaudeResourcesPluginOptions): ReturnType<typeof generateClaudeResourcesDocs>;
|
|
45
|
-
|
|
46
|
-
export { CLAUDE_RESOURCES_PLUGIN_NAME, type ClaudeResourcesPluginOptions, type ZfbPluginConfig, claudeResourcesPlugin, generateClaudeResourcesDocs, runClaudeResourcesPreStep };
|
|
42
|
+
export declare function runClaudeResourcesPreStep(options: ClaudeResourcesPluginOptions): ReturnType<typeof generateClaudeResourcesDocs>;
|
|
43
|
+
export { generateClaudeResourcesDocs, type ClaudeResourcesConfig, };
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { IncomingMessage, ServerResponse } from
|
|
2
|
-
export { DocHistoryMetaEntry, DocHistoryMetaLocaleConfig, DocHistoryMetaManifest, DocHistoryMetaVersionConfig,
|
|
3
|
-
|
|
1
|
+
import type { IncomingMessage, ServerResponse } from "node:http";
|
|
2
|
+
export { runDocHistoryMetaStep, type RunDocHistoryMetaOptions, type DocHistoryMetaEntry, type DocHistoryMetaLocaleConfig, type DocHistoryMetaManifest, type DocHistoryMetaVersionConfig, } from "./pre-build.js";
|
|
4
3
|
/** A single non-default locale entry; mirrors `settings.locales[*]`. */
|
|
5
|
-
interface DocHistoryLocaleConfig {
|
|
4
|
+
export interface DocHistoryLocaleConfig {
|
|
6
5
|
/** Absolute or project-relative directory holding this locale's MDX content. */
|
|
7
6
|
dir: string;
|
|
8
7
|
}
|
|
9
8
|
/** Build-time + dev-time options for the doc-history integration. */
|
|
10
|
-
interface DocHistoryOptions {
|
|
9
|
+
export interface DocHistoryOptions {
|
|
11
10
|
/** Default-locale content directory (e.g. `src/content/docs`). */
|
|
12
11
|
docsDir: string;
|
|
13
12
|
/** Optional non-default locales, keyed by locale code (e.g. `{ ja: { dir: "src/content/docs-ja" } }`). */
|
|
@@ -26,22 +25,22 @@ interface DocHistoryOptions {
|
|
|
26
25
|
maxEntries?: number;
|
|
27
26
|
}
|
|
28
27
|
/** zfb v0 plugin descriptor — mirrors `PluginConfig` in `zfb/config`. */
|
|
29
|
-
interface DocHistoryPluginDescriptor {
|
|
28
|
+
export interface DocHistoryPluginDescriptor {
|
|
30
29
|
/** Stable plugin id used by the future zfb plugin runtime to dispatch hooks. */
|
|
31
30
|
name: "doc-history";
|
|
32
31
|
/** Options forwarded verbatim into the zfb config; must be JSON-serialisable. */
|
|
33
32
|
options: DocHistoryOptions;
|
|
34
33
|
}
|
|
35
34
|
/** Default doc-history-server port — matches `@takazudo/zudo-doc-history-server`. */
|
|
36
|
-
declare const DEFAULT_SERVER_PORT = 4322;
|
|
35
|
+
export declare const DEFAULT_SERVER_PORT = 4322;
|
|
37
36
|
/** Default git history depth — matches `@takazudo/zudo-doc-history-server`. */
|
|
38
|
-
declare const DEFAULT_MAX_ENTRIES = 50;
|
|
37
|
+
export declare const DEFAULT_MAX_ENTRIES = 50;
|
|
39
38
|
/** Public route prefix the dev middleware and the standalone server agree on. */
|
|
40
|
-
declare const DOC_HISTORY_ROUTE_PREFIX = "/doc-history/";
|
|
39
|
+
export declare const DOC_HISTORY_ROUTE_PREFIX = "/doc-history/";
|
|
41
40
|
/** Subdirectory within the build output that receives the generated JSON files. */
|
|
42
|
-
declare const DOC_HISTORY_OUTPUT_DIRNAME = "doc-history";
|
|
41
|
+
export declare const DOC_HISTORY_OUTPUT_DIRNAME = "doc-history";
|
|
43
42
|
/** CLI bin name exposed by `@takazudo/zudo-doc-history-server` for inline generation. */
|
|
44
|
-
declare const DOC_HISTORY_GENERATE_BIN = "doc-history-generate";
|
|
43
|
+
export declare const DOC_HISTORY_GENERATE_BIN = "doc-history-generate";
|
|
45
44
|
/**
|
|
46
45
|
* Build the zfb config-side descriptor. Add the return value to the
|
|
47
46
|
* `plugins: [...]` array in `zfb.config.ts`.
|
|
@@ -51,11 +50,11 @@ declare const DOC_HISTORY_GENERATE_BIN = "doc-history-generate";
|
|
|
51
50
|
* Rust `PluginConfig` struct in zfb's `config.rs`). Runtime wiring is
|
|
52
51
|
* done through the sibling helpers in this module.
|
|
53
52
|
*/
|
|
54
|
-
declare function docHistoryPlugin(options: DocHistoryOptions): DocHistoryPluginDescriptor;
|
|
53
|
+
export declare function docHistoryPlugin(options: DocHistoryOptions): DocHistoryPluginDescriptor;
|
|
55
54
|
/** Connect-style middleware signature — works as a Vite plugin middleware. */
|
|
56
|
-
type ConnectMiddleware = (req: IncomingMessage, res: ServerResponse, next: (err?: unknown) => void) => void;
|
|
55
|
+
export type ConnectMiddleware = (req: IncomingMessage, res: ServerResponse, next: (err?: unknown) => void) => void;
|
|
57
56
|
/** Minimal logger surface used by the middleware on proxy failure. */
|
|
58
|
-
interface MiddlewareLogger {
|
|
57
|
+
export interface MiddlewareLogger {
|
|
59
58
|
warn(msg: string): void;
|
|
60
59
|
}
|
|
61
60
|
/**
|
|
@@ -74,21 +73,21 @@ interface MiddlewareLogger {
|
|
|
74
73
|
* with a stable error envelope so the client island can render a
|
|
75
74
|
* graceful empty state.
|
|
76
75
|
*/
|
|
77
|
-
declare function createDocHistoryDevMiddleware(options: DocHistoryOptions, logger?: MiddlewareLogger): ConnectMiddleware;
|
|
76
|
+
export declare function createDocHistoryDevMiddleware(options: DocHistoryOptions, logger?: MiddlewareLogger): ConnectMiddleware;
|
|
78
77
|
/** Minimal logger surface used by the post-build hook. */
|
|
79
|
-
interface PostBuildLogger {
|
|
78
|
+
export interface PostBuildLogger {
|
|
80
79
|
info(msg: string): void;
|
|
81
80
|
warn(msg: string): void;
|
|
82
81
|
}
|
|
83
82
|
/** Invocation context for the post-build hook. */
|
|
84
|
-
interface PostBuildContext {
|
|
83
|
+
export interface PostBuildContext {
|
|
85
84
|
/** Absolute path to the build output directory (zfb `outDir`). */
|
|
86
85
|
outDir: string;
|
|
87
86
|
/** Optional logger; falls back to silent no-ops when omitted. */
|
|
88
87
|
logger?: PostBuildLogger;
|
|
89
88
|
}
|
|
90
89
|
/** Env var that opts a LOCAL build back into postBuild per-page JSON generation. */
|
|
91
|
-
declare const DOC_HISTORY_GEN_ENV = "GEN_DOC_HISTORY";
|
|
90
|
+
export declare const DOC_HISTORY_GEN_ENV = "GEN_DOC_HISTORY";
|
|
92
91
|
/**
|
|
93
92
|
* Decide whether the postBuild hook should generate per-page doc-history JSON.
|
|
94
93
|
*
|
|
@@ -111,7 +110,7 @@ declare const DOC_HISTORY_GEN_ENV = "GEN_DOC_HISTORY";
|
|
|
111
110
|
* `SKIP_DOC_HISTORY` alone — so a plain local build still shows real page
|
|
112
111
|
* metadata; only the per-page history dropdown JSON is absent until opt-in.
|
|
113
112
|
*/
|
|
114
|
-
declare function shouldGeneratePostBuild(env?: NodeJS.ProcessEnv): {
|
|
113
|
+
export declare function shouldGeneratePostBuild(env?: NodeJS.ProcessEnv): {
|
|
115
114
|
generate: boolean;
|
|
116
115
|
reason: string;
|
|
117
116
|
};
|
|
@@ -128,13 +127,13 @@ declare function shouldGeneratePostBuild(env?: NodeJS.ProcessEnv): {
|
|
|
128
127
|
* paths are never interpolated into a command line. Output is inherited so
|
|
129
128
|
* progress and warnings surface in the user's terminal exactly as in CI.
|
|
130
129
|
*/
|
|
131
|
-
declare function runDocHistoryPostBuild(options: DocHistoryOptions, ctx: PostBuildContext): Promise<void>;
|
|
130
|
+
export declare function runDocHistoryPostBuild(options: DocHistoryOptions, ctx: PostBuildContext): Promise<void>;
|
|
132
131
|
/**
|
|
133
132
|
* Build the argv passed to `doc-history-generate`. Exposed for unit
|
|
134
133
|
* tests; the CLI surface is documented in
|
|
135
134
|
* `packages/doc-history-server/src/args.ts`.
|
|
136
135
|
*/
|
|
137
|
-
declare function buildGenerateCliArgs(options: DocHistoryOptions, outDir: string): string[];
|
|
136
|
+
export declare function buildGenerateCliArgs(options: DocHistoryOptions, outDir: string): string[];
|
|
138
137
|
/**
|
|
139
138
|
* Resolve the absolute path of the `doc-history-generate` script
|
|
140
139
|
* shipped by `@takazudo/zudo-doc-history-server`.
|
|
@@ -157,6 +156,4 @@ declare function buildGenerateCliArgs(options: DocHistoryOptions, outDir: string
|
|
|
157
156
|
* unconditionally), so this is safe even if the package later
|
|
158
157
|
* tightens its exports surface.
|
|
159
158
|
*/
|
|
160
|
-
declare function resolveDocHistoryGenerateBin(): string;
|
|
161
|
-
|
|
162
|
-
export { type ConnectMiddleware, DEFAULT_MAX_ENTRIES, DEFAULT_SERVER_PORT, DOC_HISTORY_GENERATE_BIN, DOC_HISTORY_GEN_ENV, DOC_HISTORY_OUTPUT_DIRNAME, DOC_HISTORY_ROUTE_PREFIX, type DocHistoryLocaleConfig, type DocHistoryOptions, type DocHistoryPluginDescriptor, type MiddlewareLogger, type PostBuildContext, type PostBuildLogger, buildGenerateCliArgs, createDocHistoryDevMiddleware, docHistoryPlugin, resolveDocHistoryGenerateBin, runDocHistoryPostBuild, shouldGeneratePostBuild };
|
|
159
|
+
export declare function resolveDocHistoryGenerateBin(): string;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/** A single non-default locale entry; mirrors `settings.locales[*]`. */
|
|
2
|
-
interface DocHistoryMetaLocaleConfig {
|
|
2
|
+
export interface DocHistoryMetaLocaleConfig {
|
|
3
3
|
/** Absolute or project-relative directory holding this locale's MDX content. */
|
|
4
4
|
dir: string;
|
|
5
5
|
}
|
|
6
6
|
/** A versioned docs entry; mirrors `settings.versions[*]`. */
|
|
7
|
-
interface DocHistoryMetaVersionConfig {
|
|
7
|
+
export interface DocHistoryMetaVersionConfig {
|
|
8
8
|
/** Slug used to namespace the version (e.g. `"1.0"`). */
|
|
9
9
|
slug: string;
|
|
10
10
|
/** Default-locale content directory for this version. */
|
|
@@ -13,7 +13,7 @@ interface DocHistoryMetaVersionConfig {
|
|
|
13
13
|
locales?: Record<string, DocHistoryMetaLocaleConfig>;
|
|
14
14
|
}
|
|
15
15
|
/** Options accepted by the preBuild runner. */
|
|
16
|
-
interface RunDocHistoryMetaOptions {
|
|
16
|
+
export interface RunDocHistoryMetaOptions {
|
|
17
17
|
/** Project root — directory containing `zfb.config.ts`. Resolves all relative paths. */
|
|
18
18
|
projectRoot: string;
|
|
19
19
|
/** Default-locale content directory (e.g. `"src/content/docs"`). */
|
|
@@ -35,7 +35,7 @@ interface RunDocHistoryMetaOptions {
|
|
|
35
35
|
};
|
|
36
36
|
}
|
|
37
37
|
/** A single manifest entry. */
|
|
38
|
-
interface DocHistoryMetaEntry {
|
|
38
|
+
export interface DocHistoryMetaEntry {
|
|
39
39
|
author: string;
|
|
40
40
|
createdDate: string;
|
|
41
41
|
updatedDate: string;
|
|
@@ -49,13 +49,13 @@ interface DocHistoryMetaEntry {
|
|
|
49
49
|
ext?: ".mdx" | ".md";
|
|
50
50
|
}
|
|
51
51
|
/** Manifest shape — keyed by composedSlug. */
|
|
52
|
-
type DocHistoryMetaManifest = Record<string, DocHistoryMetaEntry>;
|
|
52
|
+
export type DocHistoryMetaManifest = Record<string, DocHistoryMetaEntry>;
|
|
53
53
|
/**
|
|
54
54
|
* Derive the manifest `ext` value from a content file path. The walkers
|
|
55
55
|
* only collect `.md` / `.mdx` files (`collectContentFiles` matches
|
|
56
56
|
* `\.mdx?$`), so anything not ending in ".md" is ".mdx".
|
|
57
57
|
*/
|
|
58
|
-
declare function deriveSourceExt(filePath: string): ".mdx" | ".md";
|
|
58
|
+
export declare function deriveSourceExt(filePath: string): ".mdx" | ".md";
|
|
59
59
|
/**
|
|
60
60
|
* Emit `<projectRoot>/.zfb/doc-history-meta.json` from git history.
|
|
61
61
|
*
|
|
@@ -67,6 +67,4 @@ declare function deriveSourceExt(filePath: string): ".mdx" | ".md";
|
|
|
67
67
|
* omitting them from the manifest — the page-side wrapper treats
|
|
68
68
|
* undefined entries as "no SSR data".
|
|
69
69
|
*/
|
|
70
|
-
declare function runDocHistoryMetaStep(options: RunDocHistoryMetaOptions): Promise<void>;
|
|
71
|
-
|
|
72
|
-
export { type DocHistoryMetaEntry, type DocHistoryMetaLocaleConfig, type DocHistoryMetaManifest, type DocHistoryMetaVersionConfig, type RunDocHistoryMetaOptions, deriveSourceExt, runDocHistoryMetaStep };
|
|
70
|
+
export declare function runDocHistoryMetaStep(options: RunDocHistoryMetaOptions): Promise<void>;
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import { IncomingMessage, ServerResponse } from
|
|
2
|
-
import {
|
|
3
|
-
import '../../md-utils/index.js';
|
|
4
|
-
|
|
1
|
+
import type { IncomingMessage, ServerResponse } from "node:http";
|
|
2
|
+
import type { LlmsTxtLocaleConfig, LlmsTxtSiteMeta } from "./types.js";
|
|
5
3
|
/** Connect-style middleware signature — works as a Vite plugin middleware. */
|
|
6
|
-
type LlmsTxtNextFn = (err?: unknown) => void;
|
|
7
|
-
type LlmsTxtMiddleware = (req: IncomingMessage, res: ServerResponse, next: LlmsTxtNextFn) => void;
|
|
4
|
+
export type LlmsTxtNextFn = (err?: unknown) => void;
|
|
5
|
+
export type LlmsTxtMiddleware = (req: IncomingMessage, res: ServerResponse, next: LlmsTxtNextFn) => void;
|
|
8
6
|
/** Minimal logger surface used by the middleware on generation failure. */
|
|
9
|
-
interface LlmsTxtMiddlewareLogger {
|
|
7
|
+
export interface LlmsTxtMiddlewareLogger {
|
|
10
8
|
warn(msg: string): void;
|
|
11
9
|
}
|
|
12
10
|
/**
|
|
@@ -15,7 +13,7 @@ interface LlmsTxtMiddlewareLogger {
|
|
|
15
13
|
* so callers can hand a single options object to both `emitLlmsTxt`
|
|
16
14
|
* (build) and `createLlmsTxtDevMiddleware` (dev).
|
|
17
15
|
*/
|
|
18
|
-
interface LlmsTxtDevMiddlewareOptions extends LlmsTxtSiteMeta {
|
|
16
|
+
export interface LlmsTxtDevMiddlewareOptions extends LlmsTxtSiteMeta {
|
|
19
17
|
/** URL base used when materialising per-page links. */
|
|
20
18
|
base: string;
|
|
21
19
|
/** Optional absolute site URL; see `LlmsTxtLoadOptions.siteUrl`. */
|
|
@@ -36,6 +34,4 @@ interface LlmsTxtDevMiddlewareOptions extends LlmsTxtSiteMeta {
|
|
|
36
34
|
* sibling `searchIndex` middleware uses — so authoring loops surface
|
|
37
35
|
* content edits without a dev-server restart.
|
|
38
36
|
*/
|
|
39
|
-
declare function createLlmsTxtDevMiddleware(options: LlmsTxtDevMiddlewareOptions, logger?: LlmsTxtMiddlewareLogger): LlmsTxtMiddleware;
|
|
40
|
-
|
|
41
|
-
export { type LlmsTxtDevMiddlewareOptions, type LlmsTxtMiddleware, type LlmsTxtMiddlewareLogger, type LlmsTxtNextFn, createLlmsTxtDevMiddleware };
|
|
37
|
+
export declare function createLlmsTxtDevMiddleware(options: LlmsTxtDevMiddlewareOptions, logger?: LlmsTxtMiddlewareLogger): LlmsTxtMiddleware;
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import { LlmsTxtEmitOptions, LlmsTxtEmitResult } from './types.js';
|
|
2
|
-
import '../../md-utils/index.js';
|
|
3
|
-
|
|
4
1
|
/**
|
|
5
2
|
* Build-time emitter that writes `llms.txt` and `llms-full.txt` for the
|
|
6
3
|
* default locale plus every additional locale.
|
|
@@ -11,13 +8,11 @@ import '../../md-utils/index.js';
|
|
|
11
8
|
* Astro's `astro:build:done`, a future zfb plugin's `onBuildDone`,
|
|
12
9
|
* a Node CLI in CI, etc.
|
|
13
10
|
*/
|
|
14
|
-
|
|
11
|
+
import type { LlmsTxtEmitOptions, LlmsTxtEmitResult } from "./types.js";
|
|
15
12
|
/**
|
|
16
13
|
* Walk every configured content root, generate the two files per
|
|
17
14
|
* locale, and write them to `outDir` (default locale) and
|
|
18
15
|
* `outDir/<code>/` (additional locales). The output directory is
|
|
19
16
|
* created if needed; existing files are overwritten.
|
|
20
17
|
*/
|
|
21
|
-
declare function emitLlmsTxt(options: LlmsTxtEmitOptions): LlmsTxtEmitResult;
|
|
22
|
-
|
|
23
|
-
export { emitLlmsTxt };
|
|
18
|
+
export declare function emitLlmsTxt(options: LlmsTxtEmitOptions): LlmsTxtEmitResult;
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import { LlmsDocEntry, LlmsTxtSiteMeta } from './types.js';
|
|
2
|
-
import '../../md-utils/index.js';
|
|
3
|
-
|
|
4
1
|
/**
|
|
5
2
|
* Pure string generators for `llms.txt` and `llms-full.txt`.
|
|
6
3
|
*
|
|
@@ -12,16 +9,14 @@ import '../../md-utils/index.js';
|
|
|
12
9
|
* Output format must remain byte-identical to the legacy Astro emitter
|
|
13
10
|
* — the file shape is part of the project's public surface.
|
|
14
11
|
*/
|
|
15
|
-
|
|
12
|
+
import type { LlmsDocEntry, LlmsTxtSiteMeta } from "./types.js";
|
|
16
13
|
/**
|
|
17
14
|
* Slim index — site header followed by a markdown bullet per page with
|
|
18
15
|
* `[title](url): description`.
|
|
19
16
|
*/
|
|
20
|
-
declare function generateLlmsTxt(entries: readonly LlmsDocEntry[], meta: LlmsTxtSiteMeta): string;
|
|
17
|
+
export declare function generateLlmsTxt(entries: readonly LlmsDocEntry[], meta: LlmsTxtSiteMeta): string;
|
|
21
18
|
/**
|
|
22
19
|
* Full content concatenation — site header followed by every page's
|
|
23
20
|
* stripped body separated by `---` rules.
|
|
24
21
|
*/
|
|
25
|
-
declare function generateLlmsFullTxt(entries: readonly LlmsDocEntry[], meta: LlmsTxtSiteMeta): string;
|
|
26
|
-
|
|
27
|
-
export { generateLlmsFullTxt, generateLlmsTxt };
|
|
22
|
+
export declare function generateLlmsFullTxt(entries: readonly LlmsDocEntry[], meta: LlmsTxtSiteMeta): string;
|