@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
package/dist/theme.css
CHANGED
|
@@ -1,85 +1,5 @@
|
|
|
1
|
-
/*
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
* Shipped to consumers as `@takazudo/zudo-doc/theme.css` (copied to
|
|
5
|
-
* `dist/theme.css` by scripts/copy-theme-css.mjs on build). Single source of
|
|
6
|
-
* truth for the default `@theme` token block (colors, spacing, icon sizes,
|
|
7
|
-
* elevation, typography, radius, breakpoints, z-index) plus the small set of
|
|
8
|
-
* project-agnostic base rules (scroll-margin, selection color, focus ring,
|
|
9
|
-
* search / find-in-page highlight, version-switcher visibility) every
|
|
10
|
-
* zudo-doc project needs. See zudolab/zudo-doc#2655.
|
|
11
|
-
*
|
|
12
|
-
* ── @import order (load-bearing) ────────────────────────────────────────────
|
|
13
|
-
* The consumer's global.css MUST import this file:
|
|
14
|
-
* 1. AFTER `@layer zd-preflight, zd-flow;` and the two Tailwind imports
|
|
15
|
-
* (`tailwindcss/preflight` layer(zd-preflight), `tailwindcss/utilities`).
|
|
16
|
-
* Those three lines stay project-side — path-relative `@source`/`@layer`
|
|
17
|
-
* resolution requires them to live in the consumer's own CSS file (see
|
|
18
|
-
* packages/create-zudo-doc/templates/base/src/styles/global.css).
|
|
19
|
-
* 2. BEFORE `@takazudo/zudo-doc/safelist.css`, `content.css`,
|
|
20
|
-
* `page-loading.css`, and `features.css` — all four consume the
|
|
21
|
-
* `@theme` tokens defined here (colors, spacing, typography, z-index),
|
|
22
|
-
* and `content.css`'s `@layer zd-flow` rule depends on the cascade
|
|
23
|
-
* layer order already being established by the time it loads.
|
|
24
|
-
* 3. BEFORE the project's own token-override `@theme { … }` block — Tailwind
|
|
25
|
-
* v4 `@theme` resolution is last-declaration-wins per custom property,
|
|
26
|
-
* so a later project block can redefine any default declared here.
|
|
27
|
-
*
|
|
28
|
-
* ── Consumer contract ────────────────────────────────────────────────────────
|
|
29
|
-
* The consumer must inject the `--zd-*` ramp/role custom properties this file
|
|
30
|
-
* aliases into `--color-*` tokens (`ColorSchemeProvider`, see
|
|
31
|
-
* `@takazudo/zudo-doc/theme`). Without them every `--color-*` token below
|
|
32
|
-
* resolves to nothing (the tight-token guardrail below wipes Tailwind's
|
|
33
|
-
* default palette; only `--zd-*`-backed aliases repopulate it).
|
|
34
|
-
*
|
|
35
|
-
* Namespace contract: zudo-doc reserves the 23 bare `--color-*` alias names
|
|
36
|
-
* declared in the first block plus the `--color-zd-*` prefix. Every other
|
|
37
|
-
* `--color-*` name, such as `--color-acme-*`, belongs to the embedder. A
|
|
38
|
-
* second `@theme` block that defines any reserved bare name in the same
|
|
39
|
-
* document is unsupported: Tailwind merges every `@theme` block reached from
|
|
40
|
-
* the entry, last declaration wins, and no error is reported. Embedders must
|
|
41
|
-
* namespace their own tokens (`--color-<theirs>-*`), import this file before
|
|
42
|
-
* their own `@theme` block so this reset cannot reach their tokens, or import
|
|
43
|
-
* `@takazudo/zudo-doc/theme-no-reset.css` (#4055) when import order is outside
|
|
44
|
-
* their control. Consume zudo-doc colors through `--color-zd-*` / `bg-zd-*`.
|
|
45
|
-
*
|
|
46
|
-
* Deliberately NOT shipped here: `--color-page-loading-overlay`. That scrim
|
|
47
|
-
* token stays feature-injected by a project's `dynamicPageTransition` wiring
|
|
48
|
-
* (its default depends on `--color-overlay`, which IS defined below) — do
|
|
49
|
-
* not add it to this base block.
|
|
50
|
-
*
|
|
51
|
-
* ── Z-index defaults ─────────────────────────────────────────────────────────
|
|
52
|
-
* The 13 `--z-index-*` entries below are the package DEFAULT tiers (mirrors
|
|
53
|
-
* `defaultZIndexTiers` from `@takazudo/zudo-doc/z-index-defaults`, #2654).
|
|
54
|
-
* A project only needs its own `src/config/z-index-tokens.ts` +
|
|
55
|
-
* `gen:z-index`/`check:z-index` codegen wiring if it OVERRIDES a tier — its
|
|
56
|
-
* own `@theme` block (declared after this file's import) simply redefines
|
|
57
|
-
* the specific `--z-index-<name>` it wants to change.
|
|
58
|
-
* ============================================================================ */
|
|
59
|
-
|
|
60
|
-
@theme {
|
|
61
|
-
/* ========================================
|
|
62
|
-
* Tight-token color reset
|
|
63
|
-
*
|
|
64
|
-
* Wipes all Tailwind default color tokens (`--color-*`) so only
|
|
65
|
-
* project-defined palette and semantic tokens remain. This enforces
|
|
66
|
-
* zudo-doc's tight-token policy: "NEVER use Tailwind default colors"
|
|
67
|
-
* (documented per-project in src/CLAUDE.md's Color Rules). Semantic color
|
|
68
|
-
* tokens (defined below) are added back after this reset.
|
|
69
|
-
*
|
|
70
|
-
* The upstream split-import fix (zfb#159 / 9e37551, shipped in f68a9ba)
|
|
71
|
-
* eliminated the original leak cause (zfb no longer prepends the full
|
|
72
|
-
* @import "tailwindcss" bundle). The reset is retained as an explicit
|
|
73
|
-
* design guardrail — it prevents accidental default palette bleed from any
|
|
74
|
-
* future upstream change and keeps the color surface intentional.
|
|
75
|
-
*
|
|
76
|
-
* NOT reset: `--spacing` (the base spacing scale, default 0.25rem).
|
|
77
|
-
* Tailwind spacing utilities compute as calc(var(--spacing) * N); wiping
|
|
78
|
-
* `--spacing` collapses them to zero (observed in Wave 4 Sub-7 #1403).
|
|
79
|
-
* This guardrail resets ONLY the color namespace — never widen it.
|
|
80
|
-
* ======================================== */
|
|
81
|
-
--color-*: initial;
|
|
82
|
-
|
|
1
|
+
/* Authored design properties backing zudo-wind tokens. */
|
|
2
|
+
:root {
|
|
83
3
|
/* ========================================
|
|
84
4
|
* Colors — Three-tier token system
|
|
85
5
|
* ======================================== */
|
|
@@ -148,14 +68,7 @@
|
|
|
148
68
|
/* Image overlay button chrome */
|
|
149
69
|
--spacing-image-overlay-inset: 0.5rem; /* 8px — overlay button corner inset + internal padding */
|
|
150
70
|
|
|
151
|
-
/*
|
|
152
|
-
* Elevation — the tight `@import "tailwindcss/utilities"` (no default
|
|
153
|
-
* @theme) drops Tailwind's default shadow scale, so `shadow-*` utilities
|
|
154
|
-
* generate nothing. Re-add the one elevation the components use: header
|
|
155
|
-
* and version-switcher dropdown panels apply `shadow-lg`. Value is
|
|
156
|
-
* Tailwind v4's default shadow-lg; the black is intentionally
|
|
157
|
-
* theme-independent (a drop shadow is absence of light, not a themed color).
|
|
158
|
-
* ======================================== */
|
|
71
|
+
/* Package elevation used by the header and dropdown panels. */
|
|
159
72
|
--shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
|
|
160
73
|
|
|
161
74
|
/* ========================================
|
|
@@ -186,6 +99,7 @@
|
|
|
186
99
|
--leading-snug: 1.375;
|
|
187
100
|
--leading-normal: 1.5;
|
|
188
101
|
--leading-relaxed: 1.625;
|
|
102
|
+
--leading-none: 1;
|
|
189
103
|
|
|
190
104
|
/* Letter spacing / tracking (4 steps) */
|
|
191
105
|
--tracking-tight: -0.025em; /* headings, display text */
|
|
@@ -198,7 +112,8 @@
|
|
|
198
112
|
* ======================================== */
|
|
199
113
|
--radius-DEFAULT: 0.25rem; /* 4px — rounded */
|
|
200
114
|
--radius-lg: 0.5rem; /* 8px — rounded-lg */
|
|
201
|
-
--radius-full: 9999px;
|
|
115
|
+
--radius-full: 9999px;
|
|
116
|
+
--ease-in-out: cubic-bezier(0.4, 0, 0.2, 1); /* rounded-full */
|
|
202
117
|
|
|
203
118
|
/* ========================================
|
|
204
119
|
* Breakpoints (3 steps)
|
|
@@ -208,30 +123,8 @@
|
|
|
208
123
|
--breakpoint-xl: 1280px;
|
|
209
124
|
}
|
|
210
125
|
|
|
211
|
-
/*
|
|
212
|
-
|
|
213
|
-
*
|
|
214
|
-
* zudolab/zudo-doc#4051 needs a collision-free surface for code outside
|
|
215
|
-
* zudo-doc. An embedder's own components can use `bg-zd-*` / `var(--color-zd-*)`
|
|
216
|
-
* without touching the bare tier consumed by the package chrome.
|
|
217
|
-
*
|
|
218
|
-
* This block is `static` because Tailwind v4 emits a plain `@theme` token into
|
|
219
|
-
* `:root` only when something in its own scan consumes it. zudo-doc never
|
|
220
|
-
* scans the code that consumes these aliases, so the variables must always be
|
|
221
|
-
* emitted. `static` guarantees the variables; `bg-zd-*` utilities are still
|
|
222
|
-
* generated only when the consumer's own Tailwind scan sees those classes.
|
|
223
|
-
*
|
|
224
|
-
* Keep this block after the reset: `--color-*: initial` clears every
|
|
225
|
-
* `--color-*` declared before it in the merged theme, regardless of the file
|
|
226
|
-
* that declared it. The package chrome deliberately continues consuming the
|
|
227
|
-
* bare tier; do not migrate call sites ad hoc.
|
|
228
|
-
*
|
|
229
|
-
* The raw tier is prefix-first (`--zd-*`) outside `@theme`; this semantic tier
|
|
230
|
-
* is category-first (`--color-zd-*`) inside `@theme`. A third ordering that
|
|
231
|
-
* puts the namespace before the category is disconnected from both tiers and
|
|
232
|
-
* must never be introduced.
|
|
233
|
-
* ========================================================================== */
|
|
234
|
-
@theme static {
|
|
126
|
+
/* Namespaced color aliases remain available to external consumers. */
|
|
127
|
+
:root {
|
|
235
128
|
--color-zd-bg: var(--zd-bg);
|
|
236
129
|
--color-zd-fg: var(--zd-fg);
|
|
237
130
|
--color-zd-sel-bg: var(--zd-selection-bg);
|
|
@@ -261,9 +154,8 @@
|
|
|
261
154
|
* Z-index tiers — semantic, single-namespace default scale.
|
|
262
155
|
*
|
|
263
156
|
* The 13 tokens below are the package DEFAULTS (mirrors defaultZIndexTiers
|
|
264
|
-
* from @takazudo/zudo-doc/z-index-defaults, #2654).
|
|
265
|
-
* --z-index-<name>
|
|
266
|
-
* --z-index-toolbar: 20 produces `.z-toolbar { z-index: 20 }`; raw CSS can
|
|
157
|
+
* from @takazudo/zudo-doc/z-index-defaults, #2654). The wind config points at each
|
|
158
|
+
* --z-index-<name> property and generates a `z-<name>` utility. Raw CSS can
|
|
267
159
|
* also reference `z-index: var(--z-index-<name>)`.
|
|
268
160
|
*
|
|
269
161
|
* A project only needs its own src/config/z-index-tokens.ts +
|
|
@@ -271,7 +163,7 @@
|
|
|
271
163
|
* GENERATED:Z_INDEX block that used to live in every project's global.css is
|
|
272
164
|
* now opt-in customization only, not a mandatory per-project artifact.
|
|
273
165
|
* ======================================== */
|
|
274
|
-
|
|
166
|
+
:root {
|
|
275
167
|
--z-index-content: 0;
|
|
276
168
|
--z-index-local-1: 1;
|
|
277
169
|
--z-index-local-2: 2;
|
|
@@ -301,7 +193,7 @@
|
|
|
301
193
|
--text-scale-xl: 3rem; /* 48px */
|
|
302
194
|
--text-scale-2xl: 3.75rem; /* 60px */
|
|
303
195
|
|
|
304
|
-
--default-transition-duration: 150ms; /* consumed by image-enlarge
|
|
196
|
+
--default-transition-duration: 150ms; /* consumed by image-enlarge transitions */
|
|
305
197
|
--zd-transition-slow: 200ms; /* sidebar transform/visibility and content-band max-width */
|
|
306
198
|
--zd-transition-slower: 300ms; /* view-transition fade-in (contentFadeIn animation) */
|
|
307
199
|
--zd-header-h: 80px; /* sticky header height; consumed by scroll-margin-top on [id] anchors */
|
|
@@ -326,6 +218,40 @@ body {
|
|
|
326
218
|
}
|
|
327
219
|
|
|
328
220
|
@layer base {
|
|
221
|
+
/* zudo-wind preflight parity missing from zudo-wind owned-v1. */
|
|
222
|
+
::backdrop, ::file-selector-button {
|
|
223
|
+
box-sizing: border-box;
|
|
224
|
+
margin: 0;
|
|
225
|
+
padding: 0;
|
|
226
|
+
border: 0 solid;
|
|
227
|
+
}
|
|
228
|
+
[hidden]:where(:not([hidden="until-found"])) { display: none !important; }
|
|
229
|
+
html { font-family: var(--font-sans); -webkit-tap-highlight-color: transparent; }
|
|
230
|
+
code, kbd, samp, pre { font-family: var(--font-mono); }
|
|
231
|
+
button, input, select, optgroup, textarea, ::file-selector-button {
|
|
232
|
+
background-color: transparent;
|
|
233
|
+
border-radius: 0;
|
|
234
|
+
}
|
|
235
|
+
button, ::file-selector-button { appearance: button; }
|
|
236
|
+
:disabled { opacity: 1; }
|
|
237
|
+
::placeholder { opacity: 1; color: color-mix(in oklab, currentColor 50%, transparent); }
|
|
238
|
+
::file-selector-button {
|
|
239
|
+
font: inherit;
|
|
240
|
+
font-feature-settings: inherit;
|
|
241
|
+
font-variation-settings: inherit;
|
|
242
|
+
letter-spacing: inherit;
|
|
243
|
+
color: inherit;
|
|
244
|
+
opacity: 1;
|
|
245
|
+
margin-inline-end: 4px;
|
|
246
|
+
}
|
|
247
|
+
hr { color: inherit; }
|
|
248
|
+
abbr:where([title]) { text-decoration: underline dotted; }
|
|
249
|
+
small { font-size: 80%; }
|
|
250
|
+
sub, sup { font-size: 75%; line-height: 0; position: relative; vertical-align: baseline; }
|
|
251
|
+
sub { bottom: -0.25em; }
|
|
252
|
+
sup { top: -0.5em; }
|
|
253
|
+
/* Keep emoji fallback after the authored font stack. */
|
|
254
|
+
html { font-family: var(--font-sans), "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; }
|
|
329
255
|
a {
|
|
330
256
|
text-underline-offset: 4px;
|
|
331
257
|
}
|
|
@@ -351,7 +277,7 @@ body {
|
|
|
351
277
|
* <style>-inside-<div> HTML5 content-model violation flagged by
|
|
352
278
|
* html-validate — see zudolab/zudo-doc#1505).
|
|
353
279
|
*
|
|
354
|
-
* Pins onto the `.hidden`
|
|
280
|
+
* Pins onto the generated `.hidden` utility so
|
|
355
281
|
* consumers wrapping <VersionSwitcher> in `<div class="hidden lg:block">`
|
|
356
282
|
* still get the desktop override even when the content scanner did not
|
|
357
283
|
* generate `.lg:block`. Mobile (<64rem) falls through to `.hidden`'s
|
package/dist/toc/mobile-toc.d.ts
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
/** @jsxImportSource preact */
|
|
3
|
-
import type { VNode } from "preact";
|
|
1
|
+
import type { Child } from "@takazudo/zfb/zudo-react";
|
|
4
2
|
import type { HeadingItem } from "./types.js";
|
|
5
3
|
export interface MobileTocProps {
|
|
6
4
|
headings: readonly HeadingItem[];
|
|
7
5
|
title?: string;
|
|
8
6
|
}
|
|
9
7
|
/**
|
|
10
|
-
* Collapsible TOC for narrow viewports (`xl:hidden`) — a
|
|
8
|
+
* Collapsible TOC for narrow viewports (`xl:hidden`) — a zudo-react island
|
|
11
9
|
* component. Closed by default; tapping the header toggles, and tapping
|
|
12
10
|
* any entry closes the panel after navigation.
|
|
13
11
|
*
|
|
@@ -36,7 +34,7 @@ export interface MobileTocProps {
|
|
|
36
34
|
* crawlers can still find the locale label in the static markup. When
|
|
37
35
|
* headings are present the full interactive toggle UI is rendered.
|
|
38
36
|
*/
|
|
39
|
-
export declare function MobileToc({ headings, title, }: MobileTocProps):
|
|
37
|
+
export declare function MobileToc({ headings, title, }: MobileTocProps): Child;
|
|
40
38
|
export declare namespace MobileToc {
|
|
41
39
|
var displayName: string;
|
|
42
40
|
}
|
package/dist/toc/mobile-toc.js
CHANGED
|
@@ -1,48 +1,51 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx, jsxs } from "
|
|
3
|
-
import {
|
|
2
|
+
import { jsx, jsxs } from "@takazudo/zfb/zudo-react/jsx-runtime";
|
|
3
|
+
import { computed, signal } from "@takazudo/zfb/zudo-react";
|
|
4
4
|
import { SmartBreak } from "../smart-break/index.js";
|
|
5
5
|
import { cx } from "./cx.js";
|
|
6
6
|
function MobileToc({
|
|
7
7
|
headings,
|
|
8
8
|
title = "On this page"
|
|
9
9
|
}) {
|
|
10
|
-
const filtered =
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
const filtered = headings.filter((h) => h.depth >= 2 && h.depth <= 4);
|
|
11
|
+
const open = signal(false);
|
|
12
|
+
const chevronClass = computed(() => cx(
|
|
13
|
+
"h-icon-sm w-icon-sm text-muted transition-transform duration-150",
|
|
14
|
+
open.value && "rotate-180"
|
|
15
|
+
));
|
|
16
|
+
const itemsClass = computed(() => cx(
|
|
17
|
+
"border-t border-muted px-hsp-lg py-vsp-xs space-y-vsp-2xs",
|
|
18
|
+
!open.value && "hidden"
|
|
19
|
+
));
|
|
15
20
|
if (filtered.length === 0) {
|
|
16
|
-
return /* @__PURE__ */ jsx("div", {
|
|
21
|
+
return /* @__PURE__ */ jsx("div", { class: "hidden", "aria-hidden": "true", children: title });
|
|
17
22
|
}
|
|
18
|
-
return /* @__PURE__ */ jsxs("div", { "data-zd-mobile-toc": true,
|
|
23
|
+
return /* @__PURE__ */ jsxs("div", { "data-zd-mobile-toc": true, class: "xl:hidden border border-muted mb-vsp-lg", children: [
|
|
19
24
|
/* @__PURE__ */ jsxs(
|
|
20
25
|
"button",
|
|
21
26
|
{
|
|
22
27
|
type: "button",
|
|
23
|
-
|
|
28
|
+
"on:click": () => {
|
|
29
|
+
open.value = !open.value;
|
|
30
|
+
},
|
|
24
31
|
"aria-expanded": open,
|
|
25
|
-
|
|
32
|
+
class: "flex w-full items-center justify-between px-hsp-lg py-vsp-xs text-small font-medium text-fg",
|
|
26
33
|
children: [
|
|
27
34
|
/* @__PURE__ */ jsx("span", { children: title }),
|
|
28
35
|
/* @__PURE__ */ jsx(
|
|
29
36
|
"svg",
|
|
30
37
|
{
|
|
31
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
32
38
|
"aria-hidden": "true",
|
|
33
|
-
|
|
34
|
-
"h-icon-sm w-icon-sm text-muted transition-transform duration-150",
|
|
35
|
-
open && "rotate-180"
|
|
36
|
-
),
|
|
39
|
+
class: chevronClass,
|
|
37
40
|
fill: "none",
|
|
38
41
|
viewBox: "0 0 24 24",
|
|
39
42
|
stroke: "currentColor",
|
|
40
|
-
|
|
43
|
+
"stroke-width": 2,
|
|
41
44
|
children: /* @__PURE__ */ jsx(
|
|
42
45
|
"path",
|
|
43
46
|
{
|
|
44
|
-
|
|
45
|
-
|
|
47
|
+
"stroke-linecap": "round",
|
|
48
|
+
"stroke-linejoin": "round",
|
|
46
49
|
d: "M19 9l-7 7-7-7"
|
|
47
50
|
}
|
|
48
51
|
)
|
|
@@ -54,15 +57,12 @@ function MobileToc({
|
|
|
54
57
|
/* @__PURE__ */ jsx(
|
|
55
58
|
"ul",
|
|
56
59
|
{
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
!open && "hidden"
|
|
60
|
-
),
|
|
61
|
-
"aria-hidden": !open,
|
|
60
|
+
class: itemsClass,
|
|
61
|
+
"aria-hidden": computed(() => !open.value),
|
|
62
62
|
children: filtered.map((heading, index) => /* @__PURE__ */ jsx(
|
|
63
63
|
"li",
|
|
64
64
|
{
|
|
65
|
-
|
|
65
|
+
class: cx(
|
|
66
66
|
heading.depth === 3 && "ml-hsp-lg",
|
|
67
67
|
heading.depth === 4 && "ml-hsp-2xl"
|
|
68
68
|
),
|
|
@@ -70,8 +70,10 @@ function MobileToc({
|
|
|
70
70
|
"a",
|
|
71
71
|
{
|
|
72
72
|
href: `#${heading.slug}`,
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
"on:click": () => {
|
|
74
|
+
open.value = false;
|
|
75
|
+
},
|
|
76
|
+
class: "block py-vsp-2xs text-small text-muted hover:text-fg hover:underline focus-visible:underline",
|
|
75
77
|
children: /* @__PURE__ */ jsx(SmartBreak, { children: heading.text })
|
|
76
78
|
}
|
|
77
79
|
)
|
package/dist/toc/toc.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/** @jsxRuntime automatic */
|
|
2
|
-
|
|
3
|
-
import type { VNode } from "preact";
|
|
2
|
+
import { type Child } from "@takazudo/zfb/zudo-react";
|
|
4
3
|
import type { HeadingItem } from "./types.js";
|
|
5
4
|
export interface TocProps {
|
|
6
5
|
headings: readonly HeadingItem[];
|
|
@@ -13,7 +12,7 @@ export interface TocProps {
|
|
|
13
12
|
title?: string;
|
|
14
13
|
}
|
|
15
14
|
/**
|
|
16
|
-
* Desktop right-rail Table of Contents — a
|
|
15
|
+
* Desktop right-rail Table of Contents — a zudo-react island component.
|
|
17
16
|
*
|
|
18
17
|
* Renders the `<nav aria-label="Table of contents">` directly. **The
|
|
19
18
|
* caller is responsible for wrapping this in `<Island when="load">`**
|
|
@@ -50,7 +49,7 @@ export interface TocProps {
|
|
|
50
49
|
* `<nav aria-label="Table of contents">` landmark provides the section
|
|
51
50
|
* semantics for screen readers. Issue #1655 / T1.
|
|
52
51
|
*/
|
|
53
|
-
export declare function Toc({ headings, title }: TocProps):
|
|
52
|
+
export declare function Toc({ headings, title }: TocProps): Child;
|
|
54
53
|
export declare namespace Toc {
|
|
55
54
|
var displayName: string;
|
|
56
55
|
}
|
package/dist/toc/toc.js
CHANGED
|
@@ -1,33 +1,36 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx } from "
|
|
3
|
-
import {
|
|
2
|
+
import { jsx } from "@takazudo/zfb/zudo-react/jsx-runtime";
|
|
3
|
+
import { computed, getScope } from "@takazudo/zfb/zudo-react";
|
|
4
4
|
import { useActiveHeading } from "./use-active-heading.js";
|
|
5
5
|
import { SmartBreak } from "../smart-break/index.js";
|
|
6
6
|
import { cx } from "./cx.js";
|
|
7
7
|
function Toc({ headings, title = "On this page" }) {
|
|
8
|
-
const filtered =
|
|
9
|
-
|
|
10
|
-
[headings]
|
|
11
|
-
);
|
|
12
|
-
const { activeId, activate } = useActiveHeading(filtered);
|
|
8
|
+
const filtered = headings.filter((h) => h.depth >= 2 && h.depth <= 4);
|
|
9
|
+
const { activeId, activate } = useActiveHeading(getScope(), filtered);
|
|
13
10
|
return /* @__PURE__ */ jsx(
|
|
14
11
|
"nav",
|
|
15
12
|
{
|
|
16
13
|
"aria-label": "Table of contents",
|
|
17
14
|
"data-zd-toc": true,
|
|
18
|
-
|
|
15
|
+
class: cx(
|
|
19
16
|
"hidden xl:flex flex-col",
|
|
20
17
|
"w-[280px] shrink-0",
|
|
21
18
|
"sticky top-[3.5rem] self-start z-sidebar",
|
|
22
19
|
"pt-vsp-xl lg:pt-vsp-2xl",
|
|
23
|
-
"h-[calc(
|
|
20
|
+
"h-[calc(100vh_-_3.5rem)]"
|
|
24
21
|
),
|
|
25
|
-
children: filtered.length > 0 && /* @__PURE__ */ jsx("ul", {
|
|
26
|
-
const isActive = heading.slug === activeId;
|
|
22
|
+
children: filtered.length > 0 && /* @__PURE__ */ jsx("ul", { class: "border-l border-muted pl-hsp-lg overflow-y-auto", children: filtered.map((heading, index) => {
|
|
23
|
+
const isActive = computed(() => heading.slug === activeId.value);
|
|
24
|
+
const linkClass = computed(
|
|
25
|
+
() => cx(
|
|
26
|
+
"block py-vsp-2xs text-small leading-snug transition-colors duration-0",
|
|
27
|
+
isActive.value ? "bg-fg text-bg font-medium" : "text-muted hover:underline focus:underline"
|
|
28
|
+
)
|
|
29
|
+
);
|
|
27
30
|
return /* @__PURE__ */ jsx(
|
|
28
31
|
"li",
|
|
29
32
|
{
|
|
30
|
-
|
|
33
|
+
class: cx(
|
|
31
34
|
heading.depth === 3 && "ml-hsp-lg",
|
|
32
35
|
heading.depth === 4 && "ml-hsp-2xl"
|
|
33
36
|
),
|
|
@@ -35,12 +38,9 @@ function Toc({ headings, title = "On this page" }) {
|
|
|
35
38
|
"a",
|
|
36
39
|
{
|
|
37
40
|
href: `#${heading.slug}`,
|
|
38
|
-
|
|
39
|
-
"aria-current": isActive ? "true" : void 0,
|
|
40
|
-
|
|
41
|
-
"block py-vsp-2xs text-small leading-snug transition-colors",
|
|
42
|
-
isActive ? "bg-fg text-bg font-medium" : "text-muted hover:underline focus:underline"
|
|
43
|
-
),
|
|
41
|
+
"on:click": () => activate(heading.slug),
|
|
42
|
+
"aria-current": computed(() => isActive.value ? "true" : void 0),
|
|
43
|
+
class: linkClass,
|
|
44
44
|
children: /* @__PURE__ */ jsx(SmartBreak, { children: heading.text })
|
|
45
45
|
}
|
|
46
46
|
)
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import type { Scope, Signal } from "@takazudo/zfb/zudo-react";
|
|
1
2
|
import type { HeadingItem } from "./types.js";
|
|
2
3
|
/**
|
|
3
4
|
* Pure helper that picks the active heading id given the heading slug
|
|
4
|
-
* order and a slug→element map. Extracted from the
|
|
5
|
+
* order and a slug→element map. Extracted from the setup helper so it is unit-
|
|
5
6
|
* testable without DOM event plumbing.
|
|
6
7
|
*
|
|
7
8
|
* Algorithm: find the first heading whose top is at or below the
|
|
@@ -13,15 +14,15 @@ import type { HeadingItem } from "./types.js";
|
|
|
13
14
|
*/
|
|
14
15
|
export declare function getActiveHeadingId(headingIds: readonly string[], elementMap: ReadonlyMap<string, HTMLElement>, viewportHeight: number): string | null;
|
|
15
16
|
export interface UseActiveHeadingResult {
|
|
16
|
-
activeId: string | null
|
|
17
|
+
activeId: Signal<string | null>;
|
|
17
18
|
activate: (id: string) => void;
|
|
18
19
|
}
|
|
19
20
|
/**
|
|
20
|
-
* Scroll-spy
|
|
21
|
+
* Scroll-spy setup helper. Tracks which heading slug should be highlighted
|
|
21
22
|
* based on the current scroll position. Provides an `activate(id)`
|
|
22
23
|
* imperatively-callable helper used by click handlers — sets the
|
|
23
24
|
* active id immediately and suppresses the scroll-driven update until
|
|
24
25
|
* the smooth-scroll completes (`scrollend`, with a timeout fallback
|
|
25
26
|
* for older Safari).
|
|
26
27
|
*/
|
|
27
|
-
export declare function useActiveHeading(headings: readonly HeadingItem[]): UseActiveHeadingResult;
|
|
28
|
+
export declare function useActiveHeading(scope: Scope, headings: readonly HeadingItem[]): UseActiveHeadingResult;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { signal } from "@takazudo/zfb/zudo-react";
|
|
2
2
|
const SCROLL_MARGIN_TOP = 80;
|
|
3
3
|
const DEBOUNCE_MS = 200;
|
|
4
4
|
function getActiveHeadingId(headingIds, elementMap, viewportHeight) {
|
|
@@ -35,41 +35,37 @@ function getActiveHeadingId(headingIds, elementMap, viewportHeight) {
|
|
|
35
35
|
}
|
|
36
36
|
return headingIds[firstVisibleIndex - 1] ?? null;
|
|
37
37
|
}
|
|
38
|
-
function useActiveHeading(headings) {
|
|
39
|
-
const
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
const activate =
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
38
|
+
function useActiveHeading(scope, headings) {
|
|
39
|
+
const activeId = signal(null);
|
|
40
|
+
const headingIds = headings.map((heading) => heading.slug);
|
|
41
|
+
let activateInScope = () => {
|
|
42
|
+
};
|
|
43
|
+
const activate = (id) => activateInScope(id);
|
|
44
|
+
scope.onActivate(() => {
|
|
45
|
+
let suppressed = false;
|
|
46
|
+
let timerId = null;
|
|
47
|
+
let fallbackTimerId = null;
|
|
48
|
+
let suppressionTimerId = null;
|
|
49
|
+
activateInScope = (id) => {
|
|
50
|
+
activeId.value = id;
|
|
51
|
+
suppressed = true;
|
|
52
|
+
if (suppressionTimerId !== null) clearTimeout(suppressionTimerId);
|
|
53
|
+
suppressionTimerId = setTimeout(() => {
|
|
54
|
+
suppressionTimerId = null;
|
|
55
|
+
suppressed = false;
|
|
56
|
+
}, 2e3);
|
|
57
|
+
};
|
|
53
58
|
const map = /* @__PURE__ */ new Map();
|
|
54
|
-
for (const id of
|
|
59
|
+
for (const id of headingIds) {
|
|
55
60
|
const el = document.getElementById(id);
|
|
56
61
|
if (el) map.set(id, el);
|
|
57
62
|
}
|
|
58
|
-
elementMapRef.current = map;
|
|
59
|
-
let timerId = null;
|
|
60
63
|
function update() {
|
|
61
64
|
timerId = null;
|
|
62
|
-
|
|
63
|
-
getActiveHeadingId(
|
|
64
|
-
headingIdsRef.current,
|
|
65
|
-
elementMapRef.current,
|
|
66
|
-
window.innerHeight
|
|
67
|
-
)
|
|
68
|
-
);
|
|
65
|
+
activeId.value = getActiveHeadingId(headingIds, map, window.innerHeight);
|
|
69
66
|
}
|
|
70
|
-
let fallbackTimerId = null;
|
|
71
67
|
function onScroll() {
|
|
72
|
-
if (
|
|
68
|
+
if (suppressed) {
|
|
73
69
|
if (fallbackTimerId !== null) clearTimeout(fallbackTimerId);
|
|
74
70
|
fallbackTimerId = setTimeout(onScrollEnd, 1500);
|
|
75
71
|
return;
|
|
@@ -78,7 +74,11 @@ function useActiveHeading(headings) {
|
|
|
78
74
|
timerId = setTimeout(update, DEBOUNCE_MS);
|
|
79
75
|
}
|
|
80
76
|
function onScrollEnd() {
|
|
81
|
-
|
|
77
|
+
suppressed = false;
|
|
78
|
+
if (suppressionTimerId !== null) {
|
|
79
|
+
clearTimeout(suppressionTimerId);
|
|
80
|
+
suppressionTimerId = null;
|
|
81
|
+
}
|
|
82
82
|
if (fallbackTimerId !== null) {
|
|
83
83
|
clearTimeout(fallbackTimerId);
|
|
84
84
|
fallbackTimerId = null;
|
|
@@ -91,13 +91,19 @@ function useActiveHeading(headings) {
|
|
|
91
91
|
window.addEventListener("resize", onScroll, { passive: true });
|
|
92
92
|
window.addEventListener("scrollend", onScrollEnd, { passive: true });
|
|
93
93
|
return () => {
|
|
94
|
+
activateInScope = () => {
|
|
95
|
+
};
|
|
94
96
|
window.removeEventListener("scroll", onScroll);
|
|
95
97
|
window.removeEventListener("resize", onScroll);
|
|
96
98
|
window.removeEventListener("scrollend", onScrollEnd);
|
|
97
99
|
if (timerId !== null) clearTimeout(timerId);
|
|
100
|
+
timerId = null;
|
|
98
101
|
if (fallbackTimerId !== null) clearTimeout(fallbackTimerId);
|
|
102
|
+
fallbackTimerId = null;
|
|
103
|
+
if (suppressionTimerId !== null) clearTimeout(suppressionTimerId);
|
|
104
|
+
suppressionTimerId = null;
|
|
99
105
|
};
|
|
100
|
-
}
|
|
106
|
+
});
|
|
101
107
|
return { activeId, activate };
|
|
102
108
|
}
|
|
103
109
|
export {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/** @jsxRuntime automatic */
|
|
2
|
-
|
|
3
|
-
import type { JSX } from "preact";
|
|
2
|
+
import type { JSX } from "@takazudo/zfb/zudo-react/jsx-runtime";
|
|
4
3
|
export interface TocPrepaintProps {
|
|
5
4
|
/**
|
|
6
5
|
* Whether the page actually renders the package's own default TOC (i.e.
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import { Fragment, jsx } from "
|
|
1
|
+
import { Fragment, jsx } from "@takazudo/zfb/zudo-react/jsx-runtime";
|
|
2
2
|
import { Island } from "@takazudo/zfb";
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
TOC_STORAGE_KEY
|
|
6
|
-
} from "../desktop-toc-toggle-island/index.js";
|
|
3
|
+
import { DesktopTocToggle } from "../desktop-toc-toggle-island/index.js";
|
|
4
|
+
import { TOC_STORAGE_KEY } from "../desktop-toc-toggle-island/storage.js";
|
|
7
5
|
function tocPrepaintActive(settings, shouldRenderDefaultToc) {
|
|
8
6
|
return Boolean(settings.tocToggle) && Boolean(shouldRenderDefaultToc);
|
|
9
7
|
}
|
|
@@ -18,7 +16,7 @@ function createTocVisibilityPrepaint(settings) {
|
|
|
18
16
|
return /* @__PURE__ */ jsx(
|
|
19
17
|
"script",
|
|
20
18
|
{
|
|
21
|
-
|
|
19
|
+
rawHtml: TOC_VISIBILITY_PREPAINT_SCRIPT
|
|
22
20
|
}
|
|
23
21
|
);
|
|
24
22
|
}
|
|
@@ -1,21 +1,8 @@
|
|
|
1
|
-
interface
|
|
1
|
+
interface Options {
|
|
2
2
|
document: Document;
|
|
3
|
-
/** Explicit error seam for hosts/tests; omitted errors surface in a microtask. */
|
|
4
3
|
reportError?: (error: unknown) => void;
|
|
5
4
|
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
*
|
|
9
|
-
* This low-level entrypoint owns an explicit cleanup for focused tests and
|
|
10
|
-
* non-singleton hosts. Browser modules use the durable, duplicate-safe
|
|
11
|
-
* `ensureNestedIslandPropsRefresh` wrapper below instead.
|
|
12
|
-
*/
|
|
13
|
-
export declare function installNestedIslandPropsRefresh({ document, reportError, }: NestedIslandPropsRefreshOptions): () => void;
|
|
14
|
-
/**
|
|
15
|
-
* Install exactly one document-lifetime controller for a browser document.
|
|
16
|
-
* Repeated calls from component renders or duplicate boot paths are no-ops.
|
|
17
|
-
*/
|
|
18
|
-
export declare function ensureNestedIslandPropsRefresh(options?: NestedIslandPropsRefreshOptions): void;
|
|
19
|
-
/** Test/HMR teardown for a controller installed through the singleton wrapper. */
|
|
5
|
+
export declare function installNestedIslandPropsRefresh({ document, reportError }: Options): () => void;
|
|
6
|
+
export declare function ensureNestedIslandPropsRefresh(options?: Options): void;
|
|
20
7
|
export declare function disposeNestedIslandPropsRefresh(document: Document): void;
|
|
21
8
|
export {};
|