@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
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Ported from the `create-zudo-doc` base template's
|
|
5
5
|
* `src/config/z-index-tokens.ts` `Z_INDEX_TIERS` export (epic
|
|
6
6
|
* zudolab/zudo-doc#2651, S4 #2654). Consumed by the theme-CSS default
|
|
7
|
-
* (#2655) for the shipped
|
|
7
|
+
* (#2655) for the shipped `:root` z-index block; a project's own
|
|
8
8
|
* `gen-z-index` codegen (from `@takazudo/zudo-doc`'s `gen-z-index` bin)
|
|
9
9
|
* becomes opt-in customization on top of this default rather than the only
|
|
10
10
|
* source.
|
|
@@ -16,9 +16,9 @@
|
|
|
16
16
|
* Strategy (from zudolab/zudo-css-wisdom z-index-strategy): semantic single-
|
|
17
17
|
* namespace tokens — names describe ROLES, never magnitudes. One flat ordered
|
|
18
18
|
* list. Values are deliberately gapped but otherwise arbitrary: renaming and
|
|
19
|
-
* reordering is cheap, which is the whole point.
|
|
20
|
-
* `--z-index-<name>`
|
|
21
|
-
*
|
|
19
|
+
* reordering is cheap, which is the whole point. zudo-wind reads the
|
|
20
|
+
* `--z-index-<name>` token and generates a `z-<name>` utility, so e.g.
|
|
21
|
+
* `:root { --z-index-toolbar: 20 }` produces `.z-toolbar { z-index: 20 }`.
|
|
22
22
|
*
|
|
23
23
|
* `local-1`/`local-2`/`local-3` ("local" kind in the template) are anonymous
|
|
24
24
|
* reusable helpers for promoting a child WITHIN a parent stacking context
|
package/dist/zdtp-loader.d.ts
CHANGED
|
@@ -1 +1,8 @@
|
|
|
1
|
+
import type { PanelConfig, PanelInstanceHandle } from "@takazudo/zdtp";
|
|
1
2
|
export * from "@takazudo/zdtp";
|
|
3
|
+
/**
|
|
4
|
+
* Mount zdtp's opaque Preact root only while the activating island still owns
|
|
5
|
+
* the pending import. Once configured, zdtp keeps its document-lifetime root
|
|
6
|
+
* and its existing navigation cleanup semantics.
|
|
7
|
+
*/
|
|
8
|
+
export declare function configurePanelIfActive(signal: AbortSignal | undefined, config: PanelConfig): PanelInstanceHandle | null;
|
package/dist/zdtp-loader.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
/** @jsxRuntime automatic */
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import type { JSX } from "preact";
|
|
2
|
+
import type { JSX } from "@takazudo/zfb/zudo-react/jsx-runtime";
|
|
5
3
|
import { assetRawHref, assetViewerHref } from "../asset-path/index.js";
|
|
6
4
|
import {
|
|
7
5
|
AssetFileIcon,
|
|
@@ -59,27 +57,27 @@ export function createAssetCard(context: AssetComponentContext) {
|
|
|
59
57
|
const finalDescription = description ?? entry.description;
|
|
60
58
|
|
|
61
59
|
return (
|
|
62
|
-
<article
|
|
63
|
-
<div
|
|
64
|
-
<span
|
|
65
|
-
<AssetFileIcon
|
|
60
|
+
<article class="rounded-lg border border-muted bg-surface px-hsp-lg py-vsp-sm">
|
|
61
|
+
<div class="flex items-start gap-x-hsp-md">
|
|
62
|
+
<span class="flex h-icon-lg w-icon-lg shrink-0 items-center justify-center text-muted">
|
|
63
|
+
<AssetFileIcon class="h-icon-lg w-icon-lg" />
|
|
66
64
|
</span>
|
|
67
|
-
<div
|
|
68
|
-
<div
|
|
69
|
-
{entry.dir ? <span
|
|
65
|
+
<div class="min-w-0 flex-1">
|
|
66
|
+
<div class="font-mono text-small text-fg">
|
|
67
|
+
{entry.dir ? <span class="text-muted">{entry.dir}/</span> : null}
|
|
70
68
|
<strong>{title ?? entry.name}</strong>
|
|
71
69
|
</div>
|
|
72
|
-
<div
|
|
70
|
+
<div class="mt-vsp-3xs text-caption text-muted">
|
|
73
71
|
{details.join(" · ")}
|
|
74
72
|
</div>
|
|
75
73
|
{finalDescription ? (
|
|
76
|
-
<p
|
|
74
|
+
<p class="mt-vsp-xs text-small text-muted">
|
|
77
75
|
{finalDescription}
|
|
78
76
|
</p>
|
|
79
77
|
) : null}
|
|
80
|
-
<div
|
|
78
|
+
<div class="mt-vsp-xs flex gap-x-hsp-lg text-caption">
|
|
81
79
|
<a
|
|
82
|
-
|
|
80
|
+
class="text-fg hover:text-accent focus-visible:text-accent hover:underline focus-visible:underline"
|
|
83
81
|
href={viewerHref}
|
|
84
82
|
>
|
|
85
83
|
{assetComponentText(
|
|
@@ -89,9 +87,9 @@ export function createAssetCard(context: AssetComponentContext) {
|
|
|
89
87
|
)} →
|
|
90
88
|
</a>
|
|
91
89
|
<a
|
|
92
|
-
|
|
90
|
+
class="text-fg hover:text-accent focus-visible:text-accent hover:underline focus-visible:underline"
|
|
93
91
|
href={rawHref}
|
|
94
|
-
download
|
|
92
|
+
download=""
|
|
95
93
|
>
|
|
96
94
|
{assetComponentText(
|
|
97
95
|
context,
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
/** @jsxRuntime automatic */
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import type { JSX } from "preact";
|
|
2
|
+
import type { JSX } from "@takazudo/zfb/zudo-react/jsx-runtime";
|
|
5
3
|
import { assetViewerHref } from "../asset-path/index.js";
|
|
6
4
|
import {
|
|
7
5
|
AssetFileIcon,
|
|
@@ -91,19 +89,19 @@ export function createAssetCode(context: AssetComponentContext) {
|
|
|
91
89
|
: `lines ${requested.start}–${requested.end}`;
|
|
92
90
|
|
|
93
91
|
return (
|
|
94
|
-
<section
|
|
95
|
-
<header
|
|
96
|
-
<span
|
|
97
|
-
<AssetFileIcon
|
|
92
|
+
<section class="overflow-hidden rounded-lg border border-muted bg-surface">
|
|
93
|
+
<header class="flex items-center justify-between gap-x-hsp-md border-b border-muted px-hsp-lg py-vsp-2xs text-caption">
|
|
94
|
+
<span class="flex min-w-0 items-center gap-x-hsp-xs font-mono text-fg">
|
|
95
|
+
<AssetFileIcon class="h-icon-sm w-icon-sm shrink-0" />
|
|
98
96
|
<span>{title ?? resolved.path}</span>
|
|
99
97
|
</span>
|
|
100
|
-
<span
|
|
98
|
+
<span class="shrink-0 text-muted">{rangeLabel}</span>
|
|
101
99
|
</header>
|
|
102
100
|
<div
|
|
103
|
-
|
|
104
|
-
|
|
101
|
+
class="overflow-x-auto bg-code-bg text-code-fg text-caption"
|
|
102
|
+
rawHtml={excerpt.html}
|
|
105
103
|
/>
|
|
106
|
-
<footer
|
|
104
|
+
<footer class="flex flex-wrap items-center justify-between gap-x-hsp-md gap-y-vsp-3xs border-t border-muted px-hsp-lg py-vsp-2xs text-caption text-muted">
|
|
107
105
|
<span>
|
|
108
106
|
{assetComponentText(
|
|
109
107
|
context,
|
|
@@ -113,7 +111,7 @@ export function createAssetCode(context: AssetComponentContext) {
|
|
|
113
111
|
)}
|
|
114
112
|
</span>
|
|
115
113
|
<a
|
|
116
|
-
|
|
114
|
+
class="text-fg hover:text-accent focus-visible:text-accent hover:underline focus-visible:underline"
|
|
117
115
|
href={viewerHref}
|
|
118
116
|
>
|
|
119
117
|
{assetComponentText(
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
/** @jsxRuntime automatic */
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import type { JSX } from "preact";
|
|
2
|
+
import type { JSX } from "@takazudo/zfb/zudo-react/jsx-runtime";
|
|
5
3
|
import { decodeAuthoredHref } from "../asset-path/index.js";
|
|
6
4
|
import type {
|
|
7
5
|
AssetIndexEntry,
|
|
@@ -92,13 +90,13 @@ export function formatAssetLanguage(language: string | undefined): string {
|
|
|
92
90
|
}
|
|
93
91
|
|
|
94
92
|
export function AssetFileIcon({
|
|
95
|
-
className,
|
|
93
|
+
class: className,
|
|
96
94
|
}: {
|
|
97
|
-
|
|
95
|
+
class?: string;
|
|
98
96
|
}): JSX.Element {
|
|
99
97
|
return (
|
|
100
98
|
<svg
|
|
101
|
-
|
|
99
|
+
class={className}
|
|
102
100
|
viewBox="0 0 24 24"
|
|
103
101
|
fill="none"
|
|
104
102
|
stroke="currentColor"
|
|
@@ -120,7 +118,7 @@ export function MissingAssetWarning({
|
|
|
120
118
|
}): JSX.Element {
|
|
121
119
|
return (
|
|
122
120
|
<div
|
|
123
|
-
|
|
121
|
+
class="rounded border border-warning/30 bg-warning/5 px-hsp-lg py-vsp-xs text-small text-warning"
|
|
124
122
|
role="status"
|
|
125
123
|
>
|
|
126
124
|
{children}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
/** @jsxRuntime automatic */
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import type { ComponentChildren, VNode } from "preact";
|
|
2
|
+
import type { Child, Description } from "@takazudo/zfb/zudo-react";
|
|
5
3
|
import { findPath } from "./find-path.js";
|
|
6
4
|
import type { BreadcrumbItem, BreadcrumbNode } from "./types.js";
|
|
7
5
|
import { ChevronRight } from "../icons/index.js";
|
|
@@ -46,14 +44,14 @@ interface SmartLabelProps {
|
|
|
46
44
|
* v2 package — the legacy smart-break util lives in the host project's
|
|
47
45
|
* src/utils/, which v2 must not reach into.
|
|
48
46
|
*
|
|
49
|
-
* Inserts a
|
|
47
|
+
* Inserts a zudo-react <wbr/> after each delimiter character when the label
|
|
50
48
|
* looks "path-like" (URLs, slash-separated paths, etc.). Prose labels
|
|
51
49
|
* pass through unchanged.
|
|
52
50
|
*/
|
|
53
|
-
function SmartLabel({ label }: SmartLabelProps):
|
|
51
|
+
function SmartLabel({ label }: SmartLabelProps): Child {
|
|
54
52
|
if (!isPathLike(label)) return label;
|
|
55
53
|
const parts = label.split(DELIM_SPLIT);
|
|
56
|
-
const nodes:
|
|
54
|
+
const nodes: Child[] = [];
|
|
57
55
|
for (let i = 0; i < parts.length; i++) {
|
|
58
56
|
const part = parts[i];
|
|
59
57
|
if (!part) continue;
|
|
@@ -83,14 +81,13 @@ function isPathLike(text: string): boolean {
|
|
|
83
81
|
return false;
|
|
84
82
|
}
|
|
85
83
|
|
|
86
|
-
function ChevronIcon():
|
|
87
|
-
return <ChevronRight
|
|
84
|
+
function ChevronIcon(): Child {
|
|
85
|
+
return <ChevronRight class="h-icon-xs w-icon-xs text-muted shrink-0" />;
|
|
88
86
|
}
|
|
89
87
|
|
|
90
|
-
function HomeIcon():
|
|
88
|
+
function HomeIcon(): Child {
|
|
91
89
|
return (
|
|
92
90
|
<svg
|
|
93
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
94
91
|
class="h-[1.575rem] w-[1.575rem] shrink-0"
|
|
95
92
|
fill="none"
|
|
96
93
|
viewBox="0 0 24 24"
|
|
@@ -123,14 +120,15 @@ export interface BreadcrumbProps {
|
|
|
123
120
|
* breadcrumb + version-switcher row:
|
|
124
121
|
*
|
|
125
122
|
* class="mb-vsp-sm flex flex-col items-start gap-vsp-xs
|
|
126
|
-
* sm:flex-row sm:items-center sm:justify-between
|
|
123
|
+
* sm:flex-row sm:items-center sm:justify-between zd-breadcrumb-nav-no-margin"
|
|
127
124
|
*
|
|
128
|
-
* The `
|
|
125
|
+
* The `zd-breadcrumb-nav-no-margin` rule strips the nav's own
|
|
126
|
+
* `mb-vsp-md` so the
|
|
129
127
|
* wrapper margin controls spacing instead. Use this to place the
|
|
130
128
|
* VersionSwitcher pill inline at the right of the breadcrumb row,
|
|
131
129
|
* matching the reference site's layout on category index pages.
|
|
132
130
|
*/
|
|
133
|
-
rightSlot?:
|
|
131
|
+
rightSlot?: Child;
|
|
134
132
|
}
|
|
135
133
|
|
|
136
134
|
/**
|
|
@@ -144,7 +142,7 @@ export interface BreadcrumbProps {
|
|
|
144
142
|
* Returns null when no items resolve, matching the documented
|
|
145
143
|
* `items.length > 0 &&` guard.
|
|
146
144
|
*/
|
|
147
|
-
export function Breadcrumb(props: BreadcrumbProps):
|
|
145
|
+
export function Breadcrumb(props: BreadcrumbProps): Child {
|
|
148
146
|
const items =
|
|
149
147
|
props.items ??
|
|
150
148
|
(props.tree && props.currentId !== undefined
|
|
@@ -187,11 +185,12 @@ export function Breadcrumb(props: BreadcrumbProps): VNode | null {
|
|
|
187
185
|
|
|
188
186
|
// When a rightSlot is provided, wrap both elements in a flex row that
|
|
189
187
|
// matches the original Astro doc-layout's breadcrumb + version-switcher
|
|
190
|
-
// row. The `
|
|
188
|
+
// row. The `zd-breadcrumb-nav-no-margin` rule cancels the nav's own bottom
|
|
189
|
+
// margin so
|
|
191
190
|
// the wrapper margin controls spacing instead (matching the Astro
|
|
192
191
|
// reference which used `mb-vsp-sm` on the outer div).
|
|
193
192
|
return (
|
|
194
|
-
<div class="mb-vsp-sm flex flex-col items-start gap-vsp-xs sm:flex-row sm:items-center sm:justify-between
|
|
193
|
+
<div class="mb-vsp-sm flex flex-col items-start gap-vsp-xs sm:flex-row sm:items-center sm:justify-between zd-breadcrumb-nav-no-margin">
|
|
195
194
|
{nav}
|
|
196
195
|
{props.rightSlot}
|
|
197
196
|
</div>
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/** @jsxRuntime automatic */
|
|
2
|
-
/** @jsxImportSource preact */
|
|
3
2
|
// CodeGroup — adapter for zfb's `:::code-group` directive (codeTabs Option A).
|
|
4
3
|
// Moved from the showcase's `src/components/content/code-group.tsx` into the
|
|
5
4
|
// shared package as part of the package-first migration (epic #2321, S4 #2327).
|
|
@@ -22,24 +21,19 @@
|
|
|
22
21
|
// TabsInit (the companion init script) is expected to be present in the
|
|
23
22
|
// consumer's layout — we do not duplicate it here.
|
|
24
23
|
|
|
25
|
-
import
|
|
24
|
+
import { flattenChildren } from "@takazudo/zfb/zudo-react";
|
|
25
|
+
import type { Child } from "@takazudo/zfb/zudo-react";
|
|
26
26
|
import { Tabs } from "../code-syntax/index.js";
|
|
27
27
|
import { TabItem } from "../tab-item/index.js";
|
|
28
28
|
|
|
29
29
|
type Props = {
|
|
30
30
|
tabs?: string[];
|
|
31
|
-
children?:
|
|
31
|
+
children?: Child;
|
|
32
32
|
[key: string]: unknown;
|
|
33
33
|
};
|
|
34
34
|
|
|
35
|
-
function toArray(children: ComponentChildren): ComponentChildren[] {
|
|
36
|
-
if (!children) return [];
|
|
37
|
-
if (Array.isArray(children)) return children;
|
|
38
|
-
return [children];
|
|
39
|
-
}
|
|
40
|
-
|
|
41
35
|
export function CodeGroup({ tabs = [], children, name }: Props) {
|
|
42
|
-
const childArray =
|
|
36
|
+
const childArray = flattenChildren(children);
|
|
43
37
|
|
|
44
38
|
// Zip tabs labels with pre children by index. Extra children beyond the
|
|
45
39
|
// tabs array (shouldn't happen in normal zfb output) are ignored.
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
/** @jsxRuntime automatic */
|
|
2
|
-
/** @jsxImportSource preact */
|
|
3
2
|
// Admonition factory for MDX callout variants (Note/Tip/Info/Warning/
|
|
4
3
|
// Danger/Caution/Important). Moved from the showcase's
|
|
5
4
|
// `src/components/content/content-admonition.tsx` into the shared package
|
|
6
5
|
// as part of the package-first migration (epic #2321, S4 #2327).
|
|
7
6
|
//
|
|
8
7
|
// Markup contract — KEEP STABLE. The structure:
|
|
9
|
-
// <div data-admonition="<variant>" class="admonition
|
|
8
|
+
// <div data-admonition="<variant>" class="admonition-<variant>">
|
|
10
9
|
// <p class="admonition-title">…</p>
|
|
11
10
|
// <div class="admonition-body">…</div>
|
|
12
11
|
// </div>
|
|
@@ -14,7 +13,7 @@
|
|
|
14
13
|
// the consumer's global.css) and e2e smoke specs target. Per-variant
|
|
15
14
|
// color + icon live in CSS keyed off `data-admonition`, so this component
|
|
16
15
|
// stays presentation-agnostic.
|
|
17
|
-
import type {
|
|
16
|
+
import type { Child } from "@takazudo/zfb/zudo-react";
|
|
18
17
|
|
|
19
18
|
export type AdmonitionVariant =
|
|
20
19
|
| "note"
|
|
@@ -28,7 +27,7 @@ export type AdmonitionVariant =
|
|
|
28
27
|
export interface AdmonitionProps {
|
|
29
28
|
/** Custom title; falls back to the capitalized variant name (e.g. "Note"). */
|
|
30
29
|
title?: string;
|
|
31
|
-
children?:
|
|
30
|
+
children?: Child;
|
|
32
31
|
}
|
|
33
32
|
|
|
34
33
|
/**
|
|
@@ -38,10 +37,10 @@ export interface AdmonitionProps {
|
|
|
38
37
|
*/
|
|
39
38
|
export function makeAdmonition(variant: AdmonitionVariant) {
|
|
40
39
|
const defaultTitle = variant.charAt(0).toUpperCase() + variant.slice(1);
|
|
41
|
-
return function Admonition({ title, children }: AdmonitionProps):
|
|
40
|
+
return function Admonition({ title, children }: AdmonitionProps): Child {
|
|
42
41
|
const heading = title && title.length > 0 ? title : defaultTitle;
|
|
43
42
|
return (
|
|
44
|
-
<div data-admonition={variant} class={`admonition
|
|
43
|
+
<div data-admonition={variant} class={`admonition-${variant}`}>
|
|
45
44
|
<p class="admonition-title">{heading}</p>
|
|
46
45
|
<div class="admonition-body">{children}</div>
|
|
47
46
|
</div>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
// Keep storage helpers available to existing package consumers from this
|
|
2
|
+
// ordinary facade. The zudo-react island entry exports only its component.
|
|
3
|
+
export { DesktopSidebarToggle } from "./island.js";
|
|
4
|
+
export { SIDEBAR_STORAGE_KEY, readState, setDataAttribute } from "./storage.js";
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
/** @jsxRuntime automatic */
|
|
4
|
+
import { computed, getScope, Show, signal } from "@takazudo/zfb/zudo-react";
|
|
5
|
+
import { ChevronLeft, ChevronRight } from "../icons/index.js";
|
|
6
|
+
import { AFTER_NAVIGATE_EVENT } from "../transitions/index.js";
|
|
7
|
+
import { readState, setDataAttribute, writeState } from "./storage.js";
|
|
8
|
+
|
|
9
|
+
export function DesktopSidebarToggle() {
|
|
10
|
+
// Keep SSR and the initial client render visible. The activation callback
|
|
11
|
+
// reads storage only after hydration, when browser APIs are available.
|
|
12
|
+
const visible = signal(true);
|
|
13
|
+
const scope = getScope();
|
|
14
|
+
|
|
15
|
+
scope.onActivate(() => {
|
|
16
|
+
const initialVisibility = readState();
|
|
17
|
+
visible.value = initialVisibility;
|
|
18
|
+
setDataAttribute(initialVisibility);
|
|
19
|
+
|
|
20
|
+
const restoreDocumentAttribute = () => setDataAttribute(readState());
|
|
21
|
+
document.addEventListener(AFTER_NAVIGATE_EVENT, restoreDocumentAttribute);
|
|
22
|
+
return () => document.removeEventListener(AFTER_NAVIGATE_EVENT, restoreDocumentAttribute);
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
const toggle = () => {
|
|
26
|
+
const next = !visible.value;
|
|
27
|
+
visible.value = next;
|
|
28
|
+
writeState(next);
|
|
29
|
+
setDataAttribute(next);
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
return (
|
|
33
|
+
<button
|
|
34
|
+
type="button"
|
|
35
|
+
on:click={toggle}
|
|
36
|
+
class="zd-desktop-sidebar-toggle hidden lg:flex fixed bottom-vsp-xl z-sidebar items-center justify-center w-[1.5rem] h-[3rem] bg-surface border border-muted border-l-0 text-muted cursor-pointer transition-[left,color] duration-200 hover:text-fg"
|
|
37
|
+
style="border-radius:0 var(--radius-DEFAULT) var(--radius-DEFAULT) 0"
|
|
38
|
+
aria-label={computed(() => visible.value ? "Hide sidebar" : "Show sidebar")}
|
|
39
|
+
aria-pressed={visible}
|
|
40
|
+
>
|
|
41
|
+
<Show when={computed(() => visible.value)}>
|
|
42
|
+
{() => <ChevronLeft class="h-icon-sm w-icon-sm" />}
|
|
43
|
+
</Show>
|
|
44
|
+
<Show when={computed(() => !visible.value)}>
|
|
45
|
+
{() => <ChevronRight class="h-icon-sm w-icon-sm" />}
|
|
46
|
+
</Show>
|
|
47
|
+
</button>
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
DesktopSidebarToggle.displayName = "DesktopSidebarToggle";
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export const SIDEBAR_STORAGE_KEY = "zudo-doc-sidebar-visible";
|
|
2
|
+
|
|
3
|
+
export function readState(): boolean {
|
|
4
|
+
if (typeof window === "undefined") return true;
|
|
5
|
+
try {
|
|
6
|
+
return localStorage.getItem(SIDEBAR_STORAGE_KEY) !== "false";
|
|
7
|
+
} catch {
|
|
8
|
+
return true;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function writeState(isVisible: boolean): void {
|
|
13
|
+
try {
|
|
14
|
+
localStorage.setItem(SIDEBAR_STORAGE_KEY, String(isVisible));
|
|
15
|
+
} catch {
|
|
16
|
+
// Private browsing and disabled storage must not block the toggle.
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function setDataAttribute(isVisible: boolean): void {
|
|
21
|
+
if (typeof document === "undefined") return;
|
|
22
|
+
if (isVisible) {
|
|
23
|
+
document.documentElement.removeAttribute("data-sidebar-hidden");
|
|
24
|
+
} else {
|
|
25
|
+
document.documentElement.setAttribute("data-sidebar-hidden", "");
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
/** @jsxRuntime automatic */
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import type { ComponentChildren, VNode } from "preact";
|
|
2
|
+
import type { Child } from "@takazudo/zfb/zudo-react";
|
|
5
3
|
|
|
6
4
|
export interface DetailsProps {
|
|
7
5
|
/**
|
|
@@ -11,7 +9,7 @@ export interface DetailsProps {
|
|
|
11
9
|
*/
|
|
12
10
|
title?: string;
|
|
13
11
|
/** Slot content rendered inside the collapsed body. */
|
|
14
|
-
children?:
|
|
12
|
+
children?: Child;
|
|
15
13
|
}
|
|
16
14
|
|
|
17
15
|
/**
|
|
@@ -22,7 +20,7 @@ export interface DetailsProps {
|
|
|
22
20
|
* The legacy component used Astro's `<slot />`; v2 accepts standard
|
|
23
21
|
* Preact `children`.
|
|
24
22
|
*/
|
|
25
|
-
export function Details({ title = "Details", children }: DetailsProps):
|
|
23
|
+
export function Details({ title = "Details", children }: DetailsProps): Child {
|
|
26
24
|
return (
|
|
27
25
|
<details class="my-vsp-md border border-muted rounded-lg overflow-hidden">
|
|
28
26
|
<summary class="cursor-pointer px-hsp-lg py-vsp-sm bg-surface font-medium text-fg select-none hover:text-accent">
|