@takazudo/zudo-doc 5.28.2 → 6.0.1
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/CHANGELOG.md +33 -0
- package/README.md +49 -16
- package/bin/gen-z-index.mjs +18 -18
- package/dist/agent-docs/identity.d.ts +4 -0
- package/dist/agent-docs/identity.js +24 -0
- package/dist/agent-docs/index.d.ts +5 -0
- package/dist/agent-docs/index.js +5 -0
- package/dist/agent-docs/limits.d.ts +11 -0
- package/dist/agent-docs/limits.js +24 -0
- package/dist/agent-docs/search.d.ts +14 -0
- package/dist/agent-docs/search.js +82 -0
- package/dist/agent-docs/tokenize.d.ts +2 -0
- package/dist/agent-docs/tokenize.js +22 -0
- package/dist/agent-docs/types.d.ts +68 -0
- package/dist/agent-docs/types.js +0 -0
- package/dist/ai-chat-modal/index.d.ts +1 -4
- package/dist/ai-chat-modal/index.js +183 -123
- package/dist/asset-components/asset-card.d.ts +1 -2
- package/dist/asset-components/asset-card.js +12 -12
- package/dist/asset-components/asset-code.d.ts +1 -2
- package/dist/asset-components/asset-code.js +10 -10
- package/dist/asset-components/shared.d.ts +3 -4
- package/dist/asset-components/shared.js +4 -4
- package/dist/asset-index-page/body.d.ts +5 -6
- package/dist/asset-index-page/body.js +6 -6
- package/dist/asset-index-page/index.d.ts +1 -2
- package/dist/asset-index-page/index.js +1 -1
- package/dist/asset-page/body.d.ts +5 -9
- package/dist/asset-page/body.js +3 -3
- package/dist/asset-page/components.d.ts +16 -17
- package/dist/asset-page/components.js +10 -9
- package/dist/asset-page/index.d.ts +1 -2
- package/dist/asset-page/index.js +1 -1
- package/dist/auto-logo/index.d.ts +1 -2
- package/dist/auto-logo/index.js +2 -2
- package/dist/body-foot-util/body-foot-util-area.d.ts +3 -4
- package/dist/body-foot-util/body-foot-util-area.js +1 -2
- package/dist/body-foot-util/edit-link.d.ts +2 -3
- package/dist/body-foot-util/edit-link.js +1 -2
- package/dist/breadcrumb/breadcrumb.d.ts +6 -6
- package/dist/breadcrumb/breadcrumb.js +3 -4
- package/dist/catalog.js +1 -1
- package/dist/category-nav/index.d.ts +1 -2
- package/dist/category-nav/index.js +11 -5
- package/dist/category-tree-nav/index.d.ts +1 -2
- package/dist/category-tree-nav/index.js +3 -3
- package/dist/chrome/derive.d.ts +18 -27
- package/dist/chrome/derive.js +47 -29
- package/dist/chrome/index.d.ts +5 -5
- package/dist/chrome/index.js +1 -1
- package/dist/chrome/island-data.d.ts +4 -0
- package/dist/chrome/island-data.js +52 -0
- package/dist/chrome/primary-slots.d.ts +2 -3
- package/dist/chrome-bindings.d.ts +30 -22
- package/dist/code-group/index.d.ts +3 -4
- package/dist/code-group/index.js +3 -7
- package/dist/code-syntax/code-block-enhancer.d.ts +1 -2
- package/dist/code-syntax/code-block-enhancer.js +2 -2
- package/dist/code-syntax/mermaid-init.d.ts +1 -2
- package/dist/code-syntax/mermaid-init.js +5 -2
- package/dist/code-syntax/tabs-init-script.js +1 -1
- package/dist/code-syntax/tabs-init.d.ts +1 -2
- package/dist/code-syntax/tabs-init.js +2 -2
- package/dist/code-syntax/tabs.d.ts +6 -6
- package/dist/code-syntax/tabs.js +8 -8
- package/dist/compiled.css +2937 -2942
- package/dist/config/component-tokens.d.ts +1 -1
- package/dist/config/component-tokens.js +22 -0
- package/dist/config-assertions/index.d.ts +13 -0
- package/dist/config-assertions/index.js +14 -0
- package/dist/config.d.ts +36 -17
- package/dist/config.js +23 -95
- package/dist/content/content-blockquote.d.ts +2 -3
- package/dist/content/content-blockquote.js +3 -3
- package/dist/content/content-code.d.ts +3 -4
- package/dist/content/content-code.js +5 -5
- package/dist/content/content-link.d.ts +3 -4
- package/dist/content/content-link.js +10 -10
- package/dist/content/content-ol.d.ts +2 -3
- package/dist/content/content-ol.js +5 -4
- package/dist/content/content-paragraph.d.ts +2 -3
- package/dist/content/content-paragraph.js +1 -1
- package/dist/content/content-strong.d.ts +2 -3
- package/dist/content/content-strong.js +3 -3
- package/dist/content/content-table.d.ts +2 -3
- package/dist/content/content-table.js +4 -4
- package/dist/content/content-ul.d.ts +2 -3
- package/dist/content/content-ul.js +4 -4
- package/dist/content/heading-h2.d.ts +2 -3
- package/dist/content/heading-h2.js +4 -4
- package/dist/content/heading-h3.d.ts +2 -3
- package/dist/content/heading-h3.js +4 -4
- package/dist/content/heading-h4.d.ts +2 -3
- package/dist/content/heading-h4.js +4 -4
- package/dist/content-admonition/index.d.ts +3 -4
- package/dist/content-admonition/index.js +2 -2
- package/dist/content.css +35 -33
- package/dist/design-token-panel-bootstrap-controller.d.ts +178 -0
- package/dist/design-token-panel-bootstrap-controller.js +359 -0
- package/dist/design-token-panel-bootstrap-island.d.ts +5 -0
- package/dist/design-token-panel-bootstrap-island.js +19 -0
- package/dist/design-token-panel-bootstrap.d.ts +5 -195
- package/dist/design-token-panel-bootstrap.js +3 -288
- package/dist/desktop-sidebar-toggle-island/index.d.ts +2 -7
- package/dist/desktop-sidebar-toggle-island/index.js +2 -58
- package/dist/desktop-sidebar-toggle-island/island.d.ts +4 -0
- package/dist/desktop-sidebar-toggle-island/island.js +43 -0
- package/dist/desktop-sidebar-toggle-island/storage.d.ts +4 -0
- package/dist/desktop-sidebar-toggle-island/storage.js +29 -0
- package/dist/desktop-toc-toggle-island/index.d.ts +2 -7
- package/dist/desktop-toc-toggle-island/index.js +2 -58
- package/dist/desktop-toc-toggle-island/island.d.ts +4 -0
- package/dist/desktop-toc-toggle-island/island.js +43 -0
- package/dist/desktop-toc-toggle-island/storage.d.ts +4 -0
- package/dist/desktop-toc-toggle-island/storage.js +29 -0
- package/dist/details/details.d.ts +3 -4
- package/dist/details/details.js +1 -1
- package/dist/doc-body-end/index.d.ts +1 -2
- package/dist/doc-body-end/index.js +1 -1
- package/dist/doc-body-end-islands/design-token-panel-island.d.ts +2 -2
- package/dist/doc-body-end-islands/design-token-panel-island.js +3 -7
- package/dist/doc-body-end-islands/index.d.ts +4 -21
- package/dist/doc-body-end-islands/index.js +5 -3
- package/dist/doc-body-end-islands/theme-pack-switcher-island.d.ts +3 -13
- package/dist/doc-body-end-islands/theme-pack-switcher-island.js +11 -13
- package/dist/doc-content-header/index.d.ts +1 -2
- package/dist/doc-content-header/index.js +1 -1
- package/dist/doc-history/index.d.ts +1 -1
- package/dist/doc-history/index.js +166 -141
- package/dist/doc-history-area/index.d.ts +6 -4
- package/dist/doc-history-area/index.js +17 -16
- package/dist/doc-metainfo-area/index.d.ts +2 -3
- package/dist/doc-metainfo-area/index.js +1 -1
- package/dist/doc-page-renderer/index.d.ts +13 -7
- package/dist/doc-page-renderer/index.js +10 -1
- package/dist/doc-page-shell/index.d.ts +20 -7
- package/dist/doc-page-shell/index.js +17 -6
- package/dist/doc-pager/index.d.ts +1 -2
- package/dist/doc-pager/index.js +3 -3
- package/dist/doc-tags-area/index.d.ts +2 -3
- package/dist/doc-tags-area/index.js +1 -1
- package/dist/doclayout/doc-layout-with-defaults.d.ts +9 -9
- package/dist/doclayout/doc-layout-with-defaults.js +5 -15
- package/dist/doclayout/doc-layout.d.ts +26 -27
- package/dist/doclayout/doc-layout.js +23 -14
- package/dist/docs-schema/index.d.ts +4 -0
- package/dist/docs-schema/index.js +1 -0
- package/dist/extract-headings/index.js +43 -12
- package/dist/factory-context/index.d.ts +22 -19
- package/dist/features.css +75 -8
- package/dist/find-in-page/find-bar.d.ts +4 -2
- package/dist/find-in-page/find-bar.js +58 -69
- package/dist/find-in-page/index.d.ts +2 -8
- package/dist/find-in-page/index.js +33 -30
- package/dist/footer/footer.d.ts +3 -4
- package/dist/footer/footer.js +3 -3
- package/dist/footer-with-defaults/index.d.ts +2 -3
- package/dist/footer-with-defaults/index.js +1 -1
- package/dist/frontmatter-preview-defaults/index.js +1 -0
- package/dist/head/doc-head.d.ts +1 -1
- package/dist/head/doc-head.js +24 -32
- package/dist/head/og-tags.d.ts +1 -1
- package/dist/head/og-tags.js +8 -7
- package/dist/head/twitter-card.d.ts +1 -1
- package/dist/head/twitter-card.js +1 -1
- package/dist/head-with-defaults/index.d.ts +7 -2
- package/dist/head-with-defaults/index.js +46 -32
- package/dist/header/header.d.ts +8 -8
- package/dist/header/header.js +9 -11
- package/dist/header/types.d.ts +7 -7
- package/dist/header-with-defaults/index.d.ts +3 -4
- package/dist/header-with-defaults/index.js +27 -14
- package/dist/home-intro/index.d.ts +2 -5
- package/dist/home-intro/index.js +7 -5
- package/dist/home-intro/prepare.js +4 -3
- package/dist/home-page/index.d.ts +3 -3
- package/dist/home-page/index.js +19 -17
- package/dist/html-preview-wrapper/highlighted-code.d.ts +3 -4
- package/dist/html-preview-wrapper/highlighted-code.js +19 -17
- package/dist/html-preview-wrapper/html-preview-wrapper.d.ts +4 -25
- package/dist/html-preview-wrapper/html-preview-wrapper.js +2 -87
- package/dist/html-preview-wrapper/html-preview.d.ts +3 -10
- package/dist/html-preview-wrapper/html-preview.js +13 -37
- package/dist/html-preview-wrapper/index.d.ts +2 -1
- package/dist/html-preview-wrapper/index.js +1 -1
- package/dist/html-preview-wrapper/preview-base.d.ts +3 -5
- package/dist/html-preview-wrapper/preview-base.js +56 -59
- package/dist/html-preview-wrapper/wrapper.d.ts +20 -0
- package/dist/html-preview-wrapper/wrapper.js +37 -0
- package/dist/hydration-pending.d.ts +3 -5
- package/dist/hydration-pending.js +7 -5
- package/dist/i18n-version/language-switcher.d.ts +5 -32
- package/dist/i18n-version/language-switcher.js +5 -106
- package/dist/i18n-version/switcher-generated-scripts.d.ts +2 -0
- package/dist/i18n-version/switcher-generated-scripts.js +107 -0
- package/dist/i18n-version/switcher-url-state.d.ts +76 -0
- package/dist/i18n-version/switcher-url-state.js +103 -0
- package/dist/i18n-version/version-banner.d.ts +2 -3
- package/dist/i18n-version/version-banner.js +1 -1
- package/dist/i18n-version/version-switcher.d.ts +5 -50
- package/dist/i18n-version/version-switcher.js +5 -157
- package/dist/icons/index.d.ts +18 -19
- package/dist/icons/index.js +17 -33
- package/dist/image-enlarge/index.d.ts +1 -10
- package/dist/image-enlarge/index.js +80 -55
- package/dist/image-enlarge/public.d.ts +2 -0
- package/dist/image-enlarge/public.js +6 -0
- package/dist/image-enlarge/ssr-fallback.d.ts +2 -0
- package/dist/image-enlarge/ssr-fallback.js +8 -0
- package/dist/index.d.ts +11 -4
- package/dist/inline-version-switcher/index.d.ts +1 -2
- package/dist/inline-version-switcher/index.js +1 -1
- package/dist/island-types/index.d.ts +2 -2
- package/dist/island-types/index.js +1 -5
- package/dist/math-block/index.d.ts +4 -7
- package/dist/math-block/index.js +5 -5
- package/dist/mcp/handler.d.ts +8 -0
- package/dist/mcp/handler.js +129 -0
- package/dist/mcp/index.d.ts +4 -0
- package/dist/mcp/index.js +7 -0
- package/dist/mcp/loader.d.ts +19 -0
- package/dist/mcp/loader.js +202 -0
- package/dist/mdx-components/index.js +40 -108
- package/dist/mermaid-enlarge/index.d.ts +1 -8
- package/dist/mermaid-enlarge/index.js +174 -158
- package/dist/mermaid-enlarge/public.d.ts +2 -0
- package/dist/mermaid-enlarge/public.js +6 -0
- package/dist/mermaid-enlarge/ssr-fallback.d.ts +2 -0
- package/dist/mermaid-enlarge/ssr-fallback.js +8 -0
- package/dist/metainfo/doc-metainfo.d.ts +2 -3
- package/dist/metainfo/doc-metainfo.js +1 -4
- package/dist/metainfo/doc-tags.d.ts +2 -3
- package/dist/metainfo/doc-tags.js +1 -1
- package/dist/metainfo/frontmatter-preview.d.ts +3 -4
- package/dist/metainfo/frontmatter-preview.js +1 -1
- package/dist/nav-data-prep/index.js +6 -4
- package/dist/nav-indexing/category-nav.d.ts +2 -3
- package/dist/nav-indexing/category-nav.js +1 -2
- package/dist/nav-indexing/category-tree-nav.d.ts +2 -3
- package/dist/nav-indexing/category-tree-nav.js +1 -1
- package/dist/nav-indexing/doc-card-grid.d.ts +2 -3
- package/dist/nav-indexing/doc-card-grid.js +1 -2
- package/dist/nav-indexing/docs-sitemap.d.ts +2 -3
- package/dist/nav-indexing/docs-sitemap.js +2 -2
- package/dist/nav-indexing/index.d.ts +1 -1
- package/dist/nav-indexing/nav-card-grid.d.ts +2 -3
- package/dist/nav-indexing/nav-card-grid.js +1 -2
- package/dist/nav-indexing/note-tray-index-parts/card-list.d.ts +1 -2
- package/dist/nav-indexing/note-tray-index-parts/card-list.js +4 -4
- package/dist/nav-indexing/note-tray-index-parts/date-line.d.ts +2 -3
- package/dist/nav-indexing/note-tray-index-parts/date-line.js +1 -1
- package/dist/nav-indexing/note-tray-index-parts/index-list.d.ts +1 -2
- package/dist/nav-indexing/note-tray-index-parts/index-list.js +2 -2
- package/dist/nav-indexing/note-tray-index-parts/timeline.d.ts +1 -2
- package/dist/nav-indexing/note-tray-index-parts/timeline.js +2 -2
- package/dist/nav-indexing/note-tray-index.d.ts +1 -2
- package/dist/nav-indexing/note-tray-index.js +1 -1
- package/dist/nav-indexing/site-tree-nav-demo.d.ts +2 -3
- package/dist/nav-indexing/site-tree-nav-demo.js +2 -2
- package/dist/nav-indexing/tag-nav.d.ts +1 -2
- package/dist/nav-indexing/tag-nav.js +1 -1
- package/dist/nav-indexing/types.d.ts +2 -2
- package/dist/nav-indexing/versions-page-content.d.ts +2 -3
- package/dist/nav-indexing/versions-page-content.js +8 -8
- package/dist/note-tray-index/index.d.ts +1 -2
- package/dist/note-tray-index/index.js +1 -1
- package/dist/page-loading/page-loading-overlay.d.ts +1 -2
- package/dist/page-loading/page-loading-overlay.js +3 -5
- package/dist/plugins/agent-export.d.ts +3 -0
- package/dist/plugins/agent-export.js +34 -0
- package/dist/plugins/internal/agent-export/chunk.d.ts +5 -0
- package/dist/plugins/internal/agent-export/chunk.js +90 -0
- package/dist/plugins/internal/agent-export/index.d.ts +24 -0
- package/dist/plugins/internal/agent-export/index.js +123 -0
- package/dist/plugins/internal/agent-export/normalize.d.ts +5 -0
- package/dist/plugins/internal/agent-export/normalize.js +73 -0
- package/dist/plugins/internal/llms-txt/dev-middleware.d.ts +6 -0
- package/dist/plugins/internal/llms-txt/dev-middleware.js +8 -3
- package/dist/plugins/internal/llms-txt/emit.js +23 -6
- package/dist/plugins/internal/llms-txt/generate.d.ts +7 -1
- package/dist/plugins/internal/llms-txt/generate.js +9 -2
- package/dist/plugins/internal/llms-txt/load.d.ts +2 -0
- package/dist/plugins/internal/llms-txt/load.js +20 -4
- package/dist/plugins/internal/llms-txt/types.d.ts +10 -0
- package/dist/plugins/routes.js +4 -0
- package/dist/preset.d.ts +19 -9
- package/dist/preset.js +20 -1
- package/dist/route-context-payload/index.js +1 -1
- package/dist/routes/404.d.ts +2 -3
- package/dist/routes/404.js +1 -1
- package/dist/routes/_chrome.d.ts +5 -5
- package/dist/routes/_chrome.js +7 -2
- package/dist/routes/_context.d.ts +4 -4
- package/dist/routes/_design-token-panel-bootstrap.d.ts +1 -4
- package/dist/routes/_design-token-panel-bootstrap.js +9 -1
- package/dist/routes/docs-slug.d.ts +2 -3
- package/dist/routes/docs-tags-index.d.ts +2 -3
- package/dist/routes/docs-tags-index.js +1 -1
- package/dist/routes/docs-tags-tag.d.ts +2 -3
- package/dist/routes/docs-tags-tag.js +1 -1
- package/dist/routes/docs-versions.d.ts +2 -3
- package/dist/routes/docs-versions.js +1 -1
- package/dist/routes/files-path.d.ts +2 -3
- package/dist/routes/files-path.js +1 -1
- package/dist/routes/index.d.ts +2 -3
- package/dist/routes/index.js +1 -1
- package/dist/routes/locale-docs-slug.d.ts +2 -3
- package/dist/routes/locale-docs-tags-index.d.ts +2 -3
- package/dist/routes/locale-docs-tags-index.js +1 -1
- package/dist/routes/locale-docs-tags-tag.d.ts +2 -3
- package/dist/routes/locale-docs-tags-tag.js +1 -1
- package/dist/routes/locale-docs-versions.d.ts +2 -3
- package/dist/routes/locale-docs-versions.js +1 -1
- package/dist/routes/locale-files-path.d.ts +2 -3
- package/dist/routes/locale-files-path.js +1 -1
- package/dist/routes/locale-index.d.ts +2 -3
- package/dist/routes/locale-index.js +1 -1
- package/dist/routes/mcp.d.ts +5 -0
- package/dist/routes/mcp.js +25 -0
- package/dist/routes/v-docs-slug.d.ts +2 -3
- package/dist/routes/v-locale-docs-slug.d.ts +2 -3
- package/dist/search-widget/index.d.ts +1 -2
- package/dist/search-widget/index.js +4 -7
- package/dist/search-widget-script/generated-script.js +12 -5
- package/dist/settings-defaults.d.ts +2 -0
- package/dist/settings-defaults.js +93 -0
- package/dist/settings.d.ts +8 -2
- package/dist/sidebar/client-data.d.ts +18 -0
- package/dist/sidebar/client-data.js +47 -0
- package/dist/sidebar/index.d.ts +3 -1
- package/dist/sidebar/index.js +3 -1
- package/dist/sidebar/sidebar.d.ts +12 -44
- package/dist/sidebar/sidebar.js +4 -3
- package/dist/sidebar/types.d.ts +14 -0
- package/dist/sidebar-prepaint/index.d.ts +1 -2
- package/dist/sidebar-prepaint/index.js +4 -6
- package/dist/sidebar-resizer/sidebar-resizer-init.d.ts +2 -3
- package/dist/sidebar-resizer/sidebar-resizer-init.js +3 -3
- package/dist/sidebar-toggle-island/index.d.ts +8 -11
- package/dist/sidebar-toggle-island/index.js +75 -62
- package/dist/sidebar-tree/build-tree.js +5 -6
- package/dist/sidebar-tree/types.d.ts +2 -0
- package/dist/sidebar-tree-island/index.d.ts +4 -19
- package/dist/sidebar-tree-island/index.js +782 -436
- package/dist/sidebar-tree-island/scope-state.d.ts +38 -0
- package/dist/sidebar-tree-island/scope-state.js +151 -0
- package/dist/sidebar-tree-island/sidebar-scroll-preserve.js +6 -2
- package/dist/sidebar-utils/index.d.ts +17 -19
- package/dist/sidebar-utils/index.js +100 -3
- package/dist/sidebar-utils/scope.d.ts +11 -0
- package/dist/sidebar-utils/scope.js +67 -0
- package/dist/sidebar-with-defaults/index.d.ts +1 -2
- package/dist/sidebar-with-defaults/index.js +19 -18
- package/dist/site-schema/nav-tree.js +15 -15
- package/dist/site-schema/types.d.ts +1 -0
- package/dist/site-tree-nav/index.d.ts +2 -3
- package/dist/site-tree-nav/index.js +11 -12
- package/dist/site-tree-nav/normalize-island-props.d.ts +16 -0
- package/dist/site-tree-nav/normalize-island-props.js +122 -0
- package/dist/site-tree-nav-island/index.d.ts +3 -3
- package/dist/site-tree-nav-island/index.js +243 -144
- package/dist/smart-break/index.d.ts +3 -4
- package/dist/smart-break/index.js +1 -1
- package/dist/tab-item/tab-item.d.ts +3 -4
- package/dist/tab-item/tab-item.js +1 -1
- package/dist/tag-pages/index.d.ts +3 -3
- package/dist/tag-pages/index.js +10 -10
- package/dist/theme/color-scheme-provider.d.ts +3 -3
- package/dist/theme/color-scheme-provider.js +3 -3
- package/dist/theme/theme-pack-provider.d.ts +1 -1
- package/dist/theme/theme-pack-provider.js +3 -3
- package/dist/theme/theme-toggle.d.ts +2 -3
- package/dist/theme/theme-toggle.js +1 -1
- package/dist/theme-pack-dialog/index.d.ts +1 -1
- package/dist/theme-pack-dialog/index.js +69 -75
- package/dist/theme-pack-dialog/theme-pack-card.d.ts +3 -4
- package/dist/theme-pack-dialog/theme-pack-card.js +19 -17
- package/dist/theme-pack-switcher/index.d.ts +4 -5
- package/dist/theme-pack-switcher/index.js +52 -49
- package/dist/theme-packs/academia/meta.json +1 -1
- package/dist/theme-packs/academia/pack.css +1 -1
- package/dist/theme-packs/bauhaus/meta.json +1 -1
- package/dist/theme-packs/bauhaus/pack.css +2 -2
- package/dist/theme-packs/blueprint/meta.json +1 -1
- package/dist/theme-packs/blueprint/pack.css +2 -2
- package/dist/theme-packs/botanica/meta.json +1 -1
- package/dist/theme-packs/botanica/pack.css +2 -2
- package/dist/theme-packs/broadsheet/meta.json +1 -1
- package/dist/theme-packs/broadsheet/pack.css +2 -2
- package/dist/theme-packs/brutalist/meta.json +1 -1
- package/dist/theme-packs/brutalist/pack.css +2 -2
- package/dist/theme-packs/eink/meta.json +1 -1
- package/dist/theme-packs/eink/pack.css +1 -1
- package/dist/theme-packs/futura-editorial/meta.json +1 -1
- package/dist/theme-packs/futura-editorial/pack.css +2 -2
- package/dist/theme-packs/hearth/meta.json +1 -1
- package/dist/theme-packs/hearth/pack.css +2 -2
- package/dist/theme-packs/ledger/meta.json +1 -1
- package/dist/theme-packs/ledger/pack.css +1 -1
- package/dist/theme-packs/manuscript/meta.json +1 -1
- package/dist/theme-packs/manuscript/pack.css +1 -1
- package/dist/theme-packs/matcha/meta.json +1 -1
- package/dist/theme-packs/matcha/pack.css +2 -2
- package/dist/theme-packs/nocturne/meta.json +1 -1
- package/dist/theme-packs/nocturne/pack.css +2 -2
- package/dist/theme-packs/observatory/meta.json +1 -1
- package/dist/theme-packs/observatory/pack.css +2 -2
- package/dist/theme-packs/onyx/meta.json +1 -1
- package/dist/theme-packs/onyx/pack.css +2 -2
- package/dist/theme-packs/phosphor/meta.json +1 -1
- package/dist/theme-packs/phosphor/pack.css +2 -2
- package/dist/theme-packs/riso/meta.json +1 -1
- package/dist/theme-packs/riso/pack.css +2 -2
- package/dist/theme-packs/sakura/meta.json +1 -1
- package/dist/theme-packs/sakura/pack.css +2 -2
- package/dist/theme-packs/scandi/meta.json +1 -1
- package/dist/theme-packs/scandi/pack.css +1 -1
- package/dist/theme-packs/solar/meta.json +1 -1
- package/dist/theme-packs/solar/pack.css +1 -1
- package/dist/theme-packs/sumi/meta.json +1 -1
- package/dist/theme-packs/sumi/pack.css +2 -2
- package/dist/theme-packs/swissgrid/meta.json +1 -1
- package/dist/theme-packs/swissgrid/pack.css +1 -1
- package/dist/theme-packs/timberline/meta.json +1 -1
- package/dist/theme-packs/timberline/pack.css +2 -2
- package/dist/theme-packs/washi/meta.json +1 -1
- package/dist/theme-packs/washi/pack.css +2 -2
- package/dist/theme-toggle/index.d.ts +1 -1
- package/dist/theme-toggle/index.js +154 -167
- package/dist/theme.css +47 -121
- package/dist/toc/mobile-toc.d.ts +3 -5
- package/dist/toc/mobile-toc.js +29 -27
- package/dist/toc/toc.d.ts +3 -4
- package/dist/toc/toc.js +18 -18
- package/dist/toc/use-active-heading.d.ts +5 -4
- package/dist/toc/use-active-heading.js +36 -30
- package/dist/toc-prepaint/index.d.ts +1 -2
- package/dist/toc-prepaint/index.js +4 -6
- package/dist/transitions/nested-island-props-refresh.d.ts +3 -16
- package/dist/transitions/nested-island-props-refresh.js +133 -151
- package/dist/transitions/page-events.d.ts +8 -13
- package/dist/tree-nav-shared/index.d.ts +4 -5
- package/dist/tree-nav-shared/index.js +6 -7
- package/dist/use-modal-dialog/index.d.ts +9 -63
- package/dist/use-modal-dialog/index.js +41 -59
- package/dist/versions-page/index.d.ts +3 -3
- package/dist/versions-page/index.js +5 -5
- package/dist/wind/index.d.ts +5 -0
- package/dist/wind/index.js +169 -0
- package/dist/wind.json +498 -0
- package/dist/z-index-defaults/index.d.ts +4 -4
- package/dist/zdtp-loader.d.ts +7 -0
- package/dist/zdtp-loader.js +8 -0
- package/eject/asset-components/asset-card.tsx +14 -16
- package/eject/asset-components/asset-code.tsx +10 -12
- package/eject/asset-components/shared.tsx +5 -7
- package/eject/breadcrumb/breadcrumb.tsx +15 -16
- package/eject/code-group/index.tsx +4 -10
- package/eject/content-admonition/index.tsx +5 -6
- package/eject/desktop-sidebar-toggle-island/index.ts +4 -0
- package/eject/desktop-sidebar-toggle-island/island.tsx +50 -0
- package/eject/desktop-sidebar-toggle-island/storage.ts +27 -0
- package/eject/details/details.tsx +3 -5
- package/eject/doc-history/index.tsx +193 -179
- package/eject/doc-pager/index.tsx +3 -4
- package/eject/footer/footer.tsx +7 -9
- package/eject/header/header.tsx +42 -54
- package/eject/header/nav-overflow-script.ts +1 -1
- package/eject/header/types.ts +12 -13
- package/eject/image-enlarge/index.tsx +84 -69
- package/eject/image-enlarge/public.ts +2 -0
- package/eject/image-enlarge/ssr-fallback.tsx +7 -0
- package/eject/page-loading/page-loading-overlay.tsx +8 -15
- package/eject/sidebar/client-data.ts +68 -0
- package/eject/sidebar/index.ts +3 -0
- package/eject/sidebar/sidebar.tsx +16 -97
- package/eject/sidebar/types.ts +15 -0
- package/eject/sidebar-toggle-island/index.tsx +103 -102
- package/eject/sidebar-tree-island/index.tsx +827 -615
- package/eject/sidebar-tree-island/scope-state.ts +154 -0
- package/eject/sidebar-tree-island/sidebar-scroll-preserve.ts +8 -2
- package/eject/site-tree-nav-island/index.tsx +349 -222
- package/eject/tab-item/tab-item.tsx +2 -4
- package/eject/theme-toggle/hydration-pending.ts +6 -10
- package/eject/theme-toggle/index.tsx +133 -173
- package/eject/toc/mobile-toc.tsx +27 -31
- package/eject/toc/toc.tsx +21 -24
- package/eject/toc/use-active-heading.ts +43 -38
- package/package.json +40 -22
- package/routes-src/404.tsx +2 -3
- package/routes-src/_chrome.tsx +7 -2
- package/routes-src/_design-token-panel-bootstrap.tsx +1 -63
- package/routes-src/docs-slug.tsx +2 -3
- package/routes-src/docs-tags-index.tsx +2 -3
- package/routes-src/docs-tags-tag.tsx +2 -3
- package/routes-src/docs-versions.tsx +2 -3
- package/routes-src/files-path.tsx +2 -4
- package/routes-src/index.tsx +2 -3
- package/routes-src/locale-docs-slug.tsx +2 -3
- package/routes-src/locale-docs-tags-index.tsx +2 -3
- package/routes-src/locale-docs-tags-tag.tsx +2 -3
- package/routes-src/locale-docs-versions.tsx +2 -3
- package/routes-src/locale-files-path.tsx +2 -4
- package/routes-src/locale-index.tsx +2 -3
- package/routes-src/mcp.tsx +25 -0
- package/routes-src/v-docs-slug.tsx +2 -3
- package/routes-src/v-locale-docs-slug.tsx +2 -3
- package/tsconfig.base.json +1 -1
- package/dist/safelist.css +0 -2
- package/dist/theme-no-reset.css +0 -379
- package/eject/desktop-sidebar-toggle-island/index.tsx +0 -110
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/** @jsxRuntime automatic */
|
|
2
|
-
/** @jsxImportSource preact */
|
|
3
2
|
// doc-pager — factory for the shared prev/next pager <nav> (epic #2344, S7).
|
|
4
3
|
//
|
|
5
4
|
// The host's `pages/lib/_doc-pager.tsx` previously read the `t` function
|
|
@@ -7,7 +6,7 @@
|
|
|
7
6
|
// injected dependency so the logic lives in the package while the host stub
|
|
8
7
|
// keeps the singleton imports.
|
|
9
8
|
|
|
10
|
-
import type { JSX } from "
|
|
9
|
+
import type { JSX } from "@takazudo/zfb/zudo-react/jsx-runtime";
|
|
11
10
|
import { ChevronLeft, ChevronRight } from "../icons/index.js";
|
|
12
11
|
import type { ChromeContext } from "../factory-context/index.js";
|
|
13
12
|
import type { Settings } from "../settings.js";
|
|
@@ -66,7 +65,7 @@ export function createDocPager<S extends Settings = Settings>(
|
|
|
66
65
|
class="group border border-muted rounded-lg p-hsp-lg hover:border-accent"
|
|
67
66
|
>
|
|
68
67
|
<div class="flex items-center gap-hsp-xs text-caption text-muted mb-vsp-2xs group-hover:text-accent group-focus-visible:text-accent">
|
|
69
|
-
<ChevronLeft
|
|
68
|
+
<ChevronLeft class="h-[1.125rem] w-[1.125rem]" />
|
|
70
69
|
<span class="no-underline">{t("nav.previous", locale)}</span>
|
|
71
70
|
</div>
|
|
72
71
|
<p class="text-small font-semibold text-fg group-hover:text-accent group-hover:underline group-focus-visible:text-accent group-focus-visible:underline">
|
|
@@ -88,7 +87,7 @@ export function createDocPager<S extends Settings = Settings>(
|
|
|
88
87
|
>
|
|
89
88
|
<div class="flex items-center justify-end gap-hsp-xs text-caption text-muted mb-vsp-2xs group-hover:text-accent group-focus-visible:text-accent">
|
|
90
89
|
<span class="no-underline">{t("nav.next", locale)}</span>
|
|
91
|
-
<ChevronRight
|
|
90
|
+
<ChevronRight class="h-[1.125rem] w-[1.125rem]" />
|
|
92
91
|
</div>
|
|
93
92
|
<p class="text-small font-semibold text-fg group-hover:text-accent group-hover:underline group-focus-visible:text-accent group-focus-visible:underline">
|
|
94
93
|
{next.label}
|
package/eject/footer/footer.tsx
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
/** @jsxRuntime automatic */
|
|
2
|
-
/** @jsxImportSource preact */
|
|
3
|
-
|
|
4
2
|
// Footer presentational shell for the documentation layout.
|
|
5
3
|
//
|
|
6
4
|
// The original template mixed data-prep (settings + getDocsCollection
|
|
@@ -22,7 +20,7 @@
|
|
|
22
20
|
// - The link/tag column grid is only emitted when at least one column is
|
|
23
21
|
// present (mirrors the Astro `hasColumns &&` guard).
|
|
24
22
|
//
|
|
25
|
-
// - The copyright block is rendered as-is via `
|
|
23
|
+
// - The copyright block is rendered as-is via `rawHtml`
|
|
26
24
|
// because the original template used `<Fragment set:html={copyright} />`
|
|
27
25
|
// to allow inline anchors. Callers are responsible for sanitising
|
|
28
26
|
// the string (the Astro version did the same — it trusted
|
|
@@ -33,7 +31,7 @@
|
|
|
33
31
|
// `mt-vsp-lg border-t border-muted pt-vsp-md` that the Astro template
|
|
34
32
|
// applied via `class:list` conditional.
|
|
35
33
|
|
|
36
|
-
import type {
|
|
34
|
+
import type { Child } from "@takazudo/zfb/zudo-react";
|
|
37
35
|
|
|
38
36
|
import type { FooterLinkColumn, FooterTagColumn } from "./types.js";
|
|
39
37
|
|
|
@@ -50,7 +48,7 @@ export interface FooterProps {
|
|
|
50
48
|
*/
|
|
51
49
|
tagColumns?: FooterTagColumn[];
|
|
52
50
|
/**
|
|
53
|
-
* Copyright HTML. Rendered via `
|
|
51
|
+
* Copyright HTML. Rendered via `rawHtml` so embedded
|
|
54
52
|
* anchors work. The caller is responsible for the contents.
|
|
55
53
|
*/
|
|
56
54
|
copyright?: string;
|
|
@@ -71,7 +69,7 @@ export interface FooterProps {
|
|
|
71
69
|
* configured. The inner content (link grid, copyright) is only emitted
|
|
72
70
|
* when the respective slots carry data.
|
|
73
71
|
*/
|
|
74
|
-
export function Footer(props: FooterProps):
|
|
72
|
+
export function Footer(props: FooterProps): Child {
|
|
75
73
|
const linkColumns = props.linkColumns ?? [];
|
|
76
74
|
const tagColumns = props.tagColumns ?? [];
|
|
77
75
|
const copyright = props.copyright ?? "";
|
|
@@ -81,8 +79,8 @@ export function Footer(props: FooterProps): VNode {
|
|
|
81
79
|
const hasCopyright = copyright.length > 0;
|
|
82
80
|
|
|
83
81
|
const copyrightClass = hasColumns
|
|
84
|
-
? "text-center text-caption text-muted
|
|
85
|
-
: "text-center text-caption text-muted
|
|
82
|
+
? "text-center text-caption text-muted zd-footer-copyright-links mt-vsp-lg border-t border-muted pt-vsp-md"
|
|
83
|
+
: "text-center text-caption text-muted zd-footer-copyright-links";
|
|
86
84
|
|
|
87
85
|
return (
|
|
88
86
|
<footer
|
|
@@ -159,7 +157,7 @@ export function Footer(props: FooterProps): VNode {
|
|
|
159
157
|
{hasCopyright && (
|
|
160
158
|
<div
|
|
161
159
|
class={copyrightClass}
|
|
162
|
-
|
|
160
|
+
rawHtml={copyright}
|
|
163
161
|
/>
|
|
164
162
|
)}
|
|
165
163
|
</div>
|
package/eject/header/header.tsx
CHANGED
|
@@ -1,23 +1,18 @@
|
|
|
1
1
|
/** @jsxRuntime automatic */
|
|
2
|
-
/** @jsxImportSource preact */
|
|
3
|
-
|
|
4
2
|
// Layout-level JSX port of `src/components/header` for the
|
|
5
3
|
// zudo-doc framework primitives layer (super-epic #473, sub-issue
|
|
6
4
|
// #476). The component is intentionally server-render-friendly: it
|
|
7
5
|
// emits the same markup the legacy Astro template did, leaving the two
|
|
8
6
|
// interactive child islands (the mobile sidebar toggle and the dropdown
|
|
9
7
|
// "..." overflow controller) as either consumer-supplied slots or an
|
|
10
|
-
// inline-script `<script
|
|
8
|
+
// inline-script `<script rawHtml>`.
|
|
11
9
|
//
|
|
12
10
|
// Why this shape:
|
|
13
|
-
// * The Astro template embeds
|
|
14
|
-
//
|
|
15
|
-
//
|
|
16
|
-
//
|
|
17
|
-
//
|
|
18
|
-
// `header` until the sibling ports land — this file exists
|
|
19
|
-
// so consumers of the v2 package can opt into the JSX path early.
|
|
20
|
-
// * The two Preact islands (`SidebarToggle`, `ThemeToggle`) are also
|
|
11
|
+
// * The Astro template embeds locale/version switchers and a search
|
|
12
|
+
// widget. Their ports remain injectable through `languageSwitcher` /
|
|
13
|
+
// `versionSwitcher` / `search` slot props so this host-agnostic header
|
|
14
|
+
// does not depend on the concrete widget configuration.
|
|
15
|
+
// * The two interactive islands (`SidebarToggle`, `ThemeToggle`) are also
|
|
21
16
|
// accepted as slots so consumers control hydration boundaries
|
|
22
17
|
// (e.g. wrap them in zfb's `<Island when="media">` / `<Island
|
|
23
18
|
// when="load">`). The matching `<slot name="sidebar" />` in the
|
|
@@ -32,12 +27,13 @@
|
|
|
32
27
|
// `./nav-active.ts` so they stay unit-testable without booting the
|
|
33
28
|
// host config.
|
|
34
29
|
// * The inline overflow script is a pure-JS string emitted via
|
|
35
|
-
// `
|
|
30
|
+
// `rawHtml` (see `./nav-overflow-script.ts`). The
|
|
36
31
|
// behaviour is identical to the original `<script>` block — only
|
|
37
32
|
// the TypeScript syntax was stripped because a raw `<script>` tag
|
|
38
33
|
// ships its body to the browser as-is.
|
|
39
34
|
|
|
40
|
-
import type {
|
|
35
|
+
import type { Child } from "@takazudo/zfb/zudo-react";
|
|
36
|
+
import type { JSX } from "@takazudo/zfb/zudo-react/jsx-runtime";
|
|
41
37
|
import {
|
|
42
38
|
computeActiveNavPath,
|
|
43
39
|
isNavItemActive,
|
|
@@ -120,7 +116,7 @@ export interface HeaderProps {
|
|
|
120
116
|
* replaces the legacy `<slot name="sidebar" />`. Consumers pass the
|
|
121
117
|
* sidebar tree they want to surface in the mobile sheet.
|
|
122
118
|
*/
|
|
123
|
-
sidebarSlot?:
|
|
119
|
+
sidebarSlot?: Child;
|
|
124
120
|
|
|
125
121
|
/**
|
|
126
122
|
* Replacement for the `<SidebarToggle client:media="...">` element in
|
|
@@ -130,23 +126,23 @@ export interface HeaderProps {
|
|
|
130
126
|
* that slot — the layout is still valid (e.g. doc pages with
|
|
131
127
|
* `hide_sidebar`).
|
|
132
128
|
*/
|
|
133
|
-
sidebarToggle?:
|
|
129
|
+
sidebarToggle?: Child;
|
|
134
130
|
|
|
135
131
|
/**
|
|
136
132
|
* Replacement for `<ThemeToggle client:load />`. Rendered only when
|
|
137
133
|
* `colorModeEnabled` is `true` AND a `theme-toggle` entry survives
|
|
138
134
|
* `filterHeaderRightItems` — matching the original template.
|
|
139
135
|
*/
|
|
140
|
-
themeToggle?:
|
|
136
|
+
themeToggle?: Child;
|
|
141
137
|
|
|
142
138
|
/** Replacement for the `<LanguageSwitcher />` Astro child. */
|
|
143
|
-
languageSwitcher?:
|
|
139
|
+
languageSwitcher?: Child;
|
|
144
140
|
|
|
145
141
|
/** Replacement for the `<VersionSwitcher />` Astro child. */
|
|
146
|
-
versionSwitcher?:
|
|
142
|
+
versionSwitcher?: Child;
|
|
147
143
|
|
|
148
144
|
/** Replacement for the `<Search />` Astro child. */
|
|
149
|
-
search?:
|
|
145
|
+
search?: Child;
|
|
150
146
|
|
|
151
147
|
/**
|
|
152
148
|
* Emits `data-zfb-transition-persist={persistKey}` on the
|
|
@@ -314,9 +310,9 @@ export function Header(props: HeaderProps): JSX.Element {
|
|
|
314
310
|
rightItemDispatch,
|
|
315
311
|
),
|
|
316
312
|
}))
|
|
317
|
-
.filter((entry): entry is typeof entry & { node:
|
|
318
|
-
const rightGroups:
|
|
319
|
-
let iconGroup:
|
|
313
|
+
.filter((entry): entry is typeof entry & { node: Child } => entry.node !== null);
|
|
314
|
+
const rightGroups: Child[] = [];
|
|
315
|
+
let iconGroup: Child[] = [];
|
|
320
316
|
|
|
321
317
|
const flushIconGroup = () => {
|
|
322
318
|
if (iconGroup.length === 0) return;
|
|
@@ -358,20 +354,14 @@ export function Header(props: HeaderProps): JSX.Element {
|
|
|
358
354
|
// re-binds the dropdown toggle on AFTER_NAVIGATE_EVENT, and
|
|
359
355
|
// VERSION_SWITCHER_REWIRE_SCRIPT recomputes the menu from
|
|
360
356
|
// window.location on the same event (zudolab/zudo-doc#2553).
|
|
361
|
-
// - Search: <site-search>
|
|
362
|
-
//
|
|
357
|
+
// - Search: the persisted <site-search> instance refreshes its
|
|
358
|
+
// page-level state on AFTER_NAVIGATE_EVENT.
|
|
363
359
|
// - SidebarToggle (mobile): closes on AFTER_NAVIGATE_EVENT
|
|
364
|
-
// (sidebar-toggle-island/index.tsx
|
|
365
|
-
//
|
|
366
|
-
//
|
|
367
|
-
//
|
|
368
|
-
//
|
|
369
|
-
// (transitions/nested-island-props-refresh.ts, registered from the
|
|
370
|
-
// island module): on BEFORE_SWAP_EVENT it copies the incoming
|
|
371
|
-
// document's data-props onto the live nested islands, and
|
|
372
|
-
// mountNewIslands re-reads the attribute at mount time (#3530)
|
|
373
|
-
// Host islands can opt out with data-zd-props-preserve on the live
|
|
374
|
-
// island or an ancestor inside this persisted root (#3555).
|
|
360
|
+
// (sidebar-toggle-island/index.tsx). zfb 3.1 keeps unchanged island
|
|
361
|
+
// roots live and applies changed incoming props natively. The
|
|
362
|
+
// transition adapter copies old props only for islands opted into
|
|
363
|
+
// host preservation with data-zd-props-preserve; unsafe incoming
|
|
364
|
+
// structure drops persistence before native reconciliation.
|
|
375
365
|
// - Header nav + aria-current: NAV_OVERFLOW_SCRIPT re-runs on
|
|
376
366
|
// AFTER_NAVIGATE_EVENT (frozen by zudolab/zudo-doc#3534 — the
|
|
377
367
|
// `addEventListener(${afterNavigateEventLiteral}, initNavOverflow)`
|
|
@@ -458,14 +448,14 @@ export function Header(props: HeaderProps): JSX.Element {
|
|
|
458
448
|
{rightGroups}
|
|
459
449
|
</div>
|
|
460
450
|
|
|
461
|
-
<script
|
|
451
|
+
<script rawHtml={NAV_OVERFLOW_SCRIPT} />
|
|
462
452
|
{hasLocales ? (
|
|
463
453
|
// Keeps the persisted header's language-switcher hrefs pointing at the
|
|
464
454
|
// current page's equivalent in each other locale across same-locale SPA
|
|
465
455
|
// navigation (#2551). Registers a document-level AFTER_NAVIGATE_EVENT
|
|
466
456
|
// listener once; idempotent across re-execution.
|
|
467
457
|
<script
|
|
468
|
-
|
|
458
|
+
rawHtml={LANGUAGE_SWITCHER_INIT_SCRIPT}
|
|
469
459
|
/>
|
|
470
460
|
) : null}
|
|
471
461
|
{hasVersions ? (
|
|
@@ -474,7 +464,7 @@ export function Header(props: HeaderProps): JSX.Element {
|
|
|
474
464
|
// navigation (#2553). Registers a document-level AFTER_NAVIGATE_EVENT
|
|
475
465
|
// listener once; idempotent across re-execution.
|
|
476
466
|
<script
|
|
477
|
-
|
|
467
|
+
rawHtml={VERSION_SWITCHER_REWIRE_SCRIPT}
|
|
478
468
|
/>
|
|
479
469
|
) : null}
|
|
480
470
|
</header>
|
|
@@ -488,8 +478,8 @@ export function Header(props: HeaderProps): JSX.Element {
|
|
|
488
478
|
function SidebarSlotFallback({
|
|
489
479
|
children,
|
|
490
480
|
}: {
|
|
491
|
-
children?:
|
|
492
|
-
}):
|
|
481
|
+
children?: Child;
|
|
482
|
+
}): Child {
|
|
493
483
|
if (children === undefined || children === null) return null;
|
|
494
484
|
return <span hidden>{children}</span>;
|
|
495
485
|
}
|
|
@@ -502,7 +492,7 @@ function renderNavItem(
|
|
|
502
492
|
currentVersion: string | undefined,
|
|
503
493
|
urlHelpers: HeaderUrlHelpers,
|
|
504
494
|
i18n: HeaderI18n,
|
|
505
|
-
):
|
|
495
|
+
): Child {
|
|
506
496
|
// Category matching (the page's resolved big category) is the primary
|
|
507
497
|
// signal; URL-path matching stays as a secondary fallback so items that
|
|
508
498
|
// declare no `categoryMatch`, and pages with no resolved section (home,
|
|
@@ -527,7 +517,7 @@ function renderNavItem(
|
|
|
527
517
|
aria-haspopup="true"
|
|
528
518
|
aria-expanded="false"
|
|
529
519
|
class={[
|
|
530
|
-
"flex items-center gap-x-hsp-xs px-hsp-md py-vsp-2xs text-small font-medium transition-colors",
|
|
520
|
+
"flex items-center gap-x-hsp-xs px-hsp-md py-vsp-2xs text-small font-medium transition-colors duration-0",
|
|
531
521
|
isActive
|
|
532
522
|
? NAV_TOP_ACTIVE.join(" ")
|
|
533
523
|
: NAV_TOP_INACTIVE.join(" "),
|
|
@@ -589,7 +579,7 @@ function renderNavItem(
|
|
|
589
579
|
data-nav-category={item.categoryMatch}
|
|
590
580
|
data-nav-item
|
|
591
581
|
class={[
|
|
592
|
-
"px-hsp-md py-vsp-2xs text-small font-medium transition-colors shrink-0",
|
|
582
|
+
"px-hsp-md py-vsp-2xs text-small font-medium transition-colors duration-0 shrink-0",
|
|
593
583
|
isActive
|
|
594
584
|
? NAV_TOP_ACTIVE.join(" ")
|
|
595
585
|
: NAV_TOP_INACTIVE.join(" "),
|
|
@@ -645,8 +635,8 @@ function TriggerButton({
|
|
|
645
635
|
id: string;
|
|
646
636
|
ariaLabel: string;
|
|
647
637
|
event: string;
|
|
648
|
-
children:
|
|
649
|
-
}):
|
|
638
|
+
children: Child;
|
|
639
|
+
}): Child {
|
|
650
640
|
const inlineOnclick: Record<string, string> = {
|
|
651
641
|
onclick: `window.dispatchEvent(new CustomEvent('${event}'))`,
|
|
652
642
|
};
|
|
@@ -655,7 +645,7 @@ function TriggerButton({
|
|
|
655
645
|
key={`right-${index}`}
|
|
656
646
|
id={id}
|
|
657
647
|
type="button"
|
|
658
|
-
class="flex h-[40px] w-[40px] shrink-0 items-center justify-center text-muted transition-colors hover:text-fg focus-visible:outline-2 focus-visible:outline-accent focus-visible:outline-offset-2"
|
|
648
|
+
class="flex h-[40px] w-[40px] shrink-0 items-center justify-center text-muted transition-colors duration-0 hover:text-fg focus-visible:outline-2 focus-visible:outline-accent focus-visible:outline-offset-2"
|
|
659
649
|
aria-label={ariaLabel}
|
|
660
650
|
{...inlineOnclick}
|
|
661
651
|
>
|
|
@@ -676,8 +666,8 @@ function SlotWrapper({
|
|
|
676
666
|
}: {
|
|
677
667
|
index: number;
|
|
678
668
|
className?: string;
|
|
679
|
-
children:
|
|
680
|
-
}):
|
|
669
|
+
children: Child;
|
|
670
|
+
}): Child {
|
|
681
671
|
return (
|
|
682
672
|
<div key={`right-${index}`} class={className}>
|
|
683
673
|
{children}
|
|
@@ -689,7 +679,7 @@ type RightItemHandler = (
|
|
|
689
679
|
item: HeaderRightItem,
|
|
690
680
|
index: number,
|
|
691
681
|
ctx: RightItemContext,
|
|
692
|
-
) =>
|
|
682
|
+
) => Child;
|
|
693
683
|
|
|
694
684
|
// Dispatch table keyed by `${type}:${trigger|component}`, or just `type`
|
|
695
685
|
// for link/html items that carry no sub-type discriminant.
|
|
@@ -710,7 +700,6 @@ const BASE_RIGHT_ITEM_DISPATCH: Readonly<Record<string, RightItemHandler>> = {
|
|
|
710
700
|
event="toggle-design-token-panel"
|
|
711
701
|
>
|
|
712
702
|
<svg
|
|
713
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
714
703
|
width="20"
|
|
715
704
|
height="20"
|
|
716
705
|
viewBox="0 0 24 24"
|
|
@@ -738,7 +727,6 @@ const BASE_RIGHT_ITEM_DISPATCH: Readonly<Record<string, RightItemHandler>> = {
|
|
|
738
727
|
event="toggle-ai-chat"
|
|
739
728
|
>
|
|
740
729
|
<svg
|
|
741
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
742
730
|
width="20"
|
|
743
731
|
height="20"
|
|
744
732
|
viewBox="0 0 24 24"
|
|
@@ -765,7 +753,7 @@ const BASE_RIGHT_ITEM_DISPATCH: Readonly<Record<string, RightItemHandler>> = {
|
|
|
765
753
|
href={ctx.githubRepoUrl}
|
|
766
754
|
target="_blank"
|
|
767
755
|
rel="noopener noreferrer"
|
|
768
|
-
class="flex h-[40px] w-[40px] shrink-0 items-center justify-center text-muted transition-colors hover:text-fg focus-visible:outline-2 focus-visible:outline-accent focus-visible:outline-offset-2"
|
|
756
|
+
class="flex h-[40px] w-[40px] shrink-0 items-center justify-center text-muted transition-colors duration-0 hover:text-fg focus-visible:outline-2 focus-visible:outline-accent focus-visible:outline-offset-2"
|
|
769
757
|
aria-label={ctx.githubLabel}
|
|
770
758
|
title={ctx.githubLabel}
|
|
771
759
|
>
|
|
@@ -843,7 +831,7 @@ const BASE_RIGHT_ITEM_DISPATCH: Readonly<Record<string, RightItemHandler>> = {
|
|
|
843
831
|
// Mirrors `<Fragment set:html={item.html} />` from the Astro
|
|
844
832
|
// template — the legacy code already trusts this string, and
|
|
845
833
|
// this port preserves that contract.
|
|
846
|
-
|
|
834
|
+
rawHtml={item.html}
|
|
847
835
|
/>
|
|
848
836
|
);
|
|
849
837
|
},
|
|
@@ -898,7 +886,7 @@ function renderRightItem(
|
|
|
898
886
|
index: number,
|
|
899
887
|
ctx: RightItemContext,
|
|
900
888
|
dispatch: ReadonlyMap<string, RightItemHandler>,
|
|
901
|
-
):
|
|
889
|
+
): Child {
|
|
902
890
|
const key =
|
|
903
891
|
item.type === "trigger"
|
|
904
892
|
? `trigger:${item.trigger}`
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// In the original `header` template the script lived directly
|
|
4
4
|
// inside a `<script>` tag (which Astro pipes through the bundler). For
|
|
5
5
|
// the JSX port we emit the same logic verbatim via
|
|
6
|
-
// `
|
|
6
|
+
// `rawHtml`, so the value below is plain ECMAScript —
|
|
7
7
|
// any TypeScript-only constructs (generic params, type casts, parameter
|
|
8
8
|
// type annotations) have been dropped so the browser can parse it
|
|
9
9
|
// directly.
|
package/eject/header/types.ts
CHANGED
|
@@ -1,21 +1,20 @@
|
|
|
1
|
-
// Boundary types for the
|
|
1
|
+
// Boundary types for the package-owned `<Header />` shell.
|
|
2
2
|
//
|
|
3
3
|
// The host project (`src/config/settings-types.ts`) owns the canonical
|
|
4
|
-
// shapes for these structures. We copy them here so
|
|
4
|
+
// shapes for these structures. We copy them here so the package has its own
|
|
5
5
|
// self-contained type surface — consumers import `HeaderNavItem` /
|
|
6
6
|
// `HeaderRightItem` from `@takazudo/zudo-doc/header` and don't reach
|
|
7
7
|
// into the host's `@/config` alias.
|
|
8
8
|
//
|
|
9
|
-
// Structural-only:
|
|
10
|
-
//
|
|
11
|
-
//
|
|
12
|
-
// package itself widens them. Changes here are v2 breaking changes.
|
|
9
|
+
// Structural-only: these package types stay independent of host config
|
|
10
|
+
// aliases. They preserve the serialized header-data contract while using
|
|
11
|
+
// zfb's `Component` and `Child` types for render callbacks and slots.
|
|
13
12
|
|
|
14
|
-
import type {
|
|
13
|
+
import type { Child, Component } from "@takazudo/zfb/zudo-react";
|
|
15
14
|
|
|
16
15
|
/**
|
|
17
16
|
* Locale code as seen by the header. Widened from the host's literal
|
|
18
|
-
* union (`"en" | "ja" | …`) to plain `string` at the
|
|
17
|
+
* union (`"en" | "ja" | …`) to plain `string` at the package boundary so the
|
|
19
18
|
* package can render for any project's locale set without a generic
|
|
20
19
|
* parameter (super-epic #1724, sub-issue #1729).
|
|
21
20
|
*/
|
|
@@ -75,10 +74,10 @@ export interface HeaderRightComponentProps {
|
|
|
75
74
|
lang: Locale | undefined;
|
|
76
75
|
githubRepoUrl: string | null;
|
|
77
76
|
githubLabel: string;
|
|
78
|
-
themeToggle:
|
|
79
|
-
languageSwitcher:
|
|
80
|
-
versionSwitcher:
|
|
81
|
-
search:
|
|
77
|
+
themeToggle: Child;
|
|
78
|
+
languageSwitcher: Child;
|
|
79
|
+
versionSwitcher: Child;
|
|
80
|
+
search: Child;
|
|
82
81
|
colorModeEnabled: boolean;
|
|
83
82
|
hasLocales: boolean;
|
|
84
83
|
}
|
|
@@ -86,7 +85,7 @@ export interface HeaderRightComponentProps {
|
|
|
86
85
|
/** A callable-only host registry keyed by serialized component name. */
|
|
87
86
|
export type HeaderRightComponentRegistry = Record<
|
|
88
87
|
string,
|
|
89
|
-
|
|
88
|
+
Component<HeaderRightComponentProps>
|
|
90
89
|
>;
|
|
91
90
|
|
|
92
91
|
export interface HeaderRightTriggerItem {
|