@takazudo/zudo-doc 5.28.2 → 6.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +33 -0
- package/README.md +49 -16
- package/bin/gen-z-index.mjs +18 -18
- package/dist/agent-docs/identity.d.ts +4 -0
- package/dist/agent-docs/identity.js +24 -0
- package/dist/agent-docs/index.d.ts +5 -0
- package/dist/agent-docs/index.js +5 -0
- package/dist/agent-docs/limits.d.ts +11 -0
- package/dist/agent-docs/limits.js +24 -0
- package/dist/agent-docs/search.d.ts +14 -0
- package/dist/agent-docs/search.js +82 -0
- package/dist/agent-docs/tokenize.d.ts +2 -0
- package/dist/agent-docs/tokenize.js +22 -0
- package/dist/agent-docs/types.d.ts +68 -0
- package/dist/agent-docs/types.js +0 -0
- package/dist/ai-chat-modal/index.d.ts +1 -4
- package/dist/ai-chat-modal/index.js +183 -123
- package/dist/asset-components/asset-card.d.ts +1 -2
- package/dist/asset-components/asset-card.js +12 -12
- package/dist/asset-components/asset-code.d.ts +1 -2
- package/dist/asset-components/asset-code.js +10 -10
- package/dist/asset-components/shared.d.ts +3 -4
- package/dist/asset-components/shared.js +4 -4
- package/dist/asset-index-page/body.d.ts +5 -6
- package/dist/asset-index-page/body.js +6 -6
- package/dist/asset-index-page/index.d.ts +1 -2
- package/dist/asset-index-page/index.js +1 -1
- package/dist/asset-page/body.d.ts +5 -9
- package/dist/asset-page/body.js +3 -3
- package/dist/asset-page/components.d.ts +16 -17
- package/dist/asset-page/components.js +10 -9
- package/dist/asset-page/index.d.ts +1 -2
- package/dist/asset-page/index.js +1 -1
- package/dist/auto-logo/index.d.ts +1 -2
- package/dist/auto-logo/index.js +2 -2
- package/dist/body-foot-util/body-foot-util-area.d.ts +3 -4
- package/dist/body-foot-util/body-foot-util-area.js +1 -2
- package/dist/body-foot-util/edit-link.d.ts +2 -3
- package/dist/body-foot-util/edit-link.js +1 -2
- package/dist/breadcrumb/breadcrumb.d.ts +6 -6
- package/dist/breadcrumb/breadcrumb.js +3 -4
- package/dist/catalog.js +1 -1
- package/dist/category-nav/index.d.ts +1 -2
- package/dist/category-nav/index.js +11 -5
- package/dist/category-tree-nav/index.d.ts +1 -2
- package/dist/category-tree-nav/index.js +3 -3
- package/dist/chrome/derive.d.ts +18 -27
- package/dist/chrome/derive.js +47 -29
- package/dist/chrome/index.d.ts +5 -5
- package/dist/chrome/index.js +1 -1
- package/dist/chrome/island-data.d.ts +4 -0
- package/dist/chrome/island-data.js +52 -0
- package/dist/chrome/primary-slots.d.ts +2 -3
- package/dist/chrome-bindings.d.ts +30 -22
- package/dist/code-group/index.d.ts +3 -4
- package/dist/code-group/index.js +3 -7
- package/dist/code-syntax/code-block-enhancer.d.ts +1 -2
- package/dist/code-syntax/code-block-enhancer.js +2 -2
- package/dist/code-syntax/mermaid-init.d.ts +1 -2
- package/dist/code-syntax/mermaid-init.js +5 -2
- package/dist/code-syntax/tabs-init-script.js +1 -1
- package/dist/code-syntax/tabs-init.d.ts +1 -2
- package/dist/code-syntax/tabs-init.js +2 -2
- package/dist/code-syntax/tabs.d.ts +6 -6
- package/dist/code-syntax/tabs.js +8 -8
- package/dist/compiled.css +2937 -2942
- package/dist/config/component-tokens.d.ts +1 -1
- package/dist/config/component-tokens.js +22 -0
- package/dist/config-assertions/index.d.ts +13 -0
- package/dist/config-assertions/index.js +14 -0
- package/dist/config.d.ts +36 -17
- package/dist/config.js +23 -95
- package/dist/content/content-blockquote.d.ts +2 -3
- package/dist/content/content-blockquote.js +3 -3
- package/dist/content/content-code.d.ts +3 -4
- package/dist/content/content-code.js +5 -5
- package/dist/content/content-link.d.ts +3 -4
- package/dist/content/content-link.js +10 -10
- package/dist/content/content-ol.d.ts +2 -3
- package/dist/content/content-ol.js +5 -4
- package/dist/content/content-paragraph.d.ts +2 -3
- package/dist/content/content-paragraph.js +1 -1
- package/dist/content/content-strong.d.ts +2 -3
- package/dist/content/content-strong.js +3 -3
- package/dist/content/content-table.d.ts +2 -3
- package/dist/content/content-table.js +4 -4
- package/dist/content/content-ul.d.ts +2 -3
- package/dist/content/content-ul.js +4 -4
- package/dist/content/heading-h2.d.ts +2 -3
- package/dist/content/heading-h2.js +4 -4
- package/dist/content/heading-h3.d.ts +2 -3
- package/dist/content/heading-h3.js +4 -4
- package/dist/content/heading-h4.d.ts +2 -3
- package/dist/content/heading-h4.js +4 -4
- package/dist/content-admonition/index.d.ts +3 -4
- package/dist/content-admonition/index.js +2 -2
- package/dist/content.css +35 -33
- package/dist/design-token-panel-bootstrap-controller.d.ts +178 -0
- package/dist/design-token-panel-bootstrap-controller.js +359 -0
- package/dist/design-token-panel-bootstrap-island.d.ts +5 -0
- package/dist/design-token-panel-bootstrap-island.js +19 -0
- package/dist/design-token-panel-bootstrap.d.ts +5 -195
- package/dist/design-token-panel-bootstrap.js +3 -288
- package/dist/desktop-sidebar-toggle-island/index.d.ts +2 -7
- package/dist/desktop-sidebar-toggle-island/index.js +2 -58
- package/dist/desktop-sidebar-toggle-island/island.d.ts +4 -0
- package/dist/desktop-sidebar-toggle-island/island.js +43 -0
- package/dist/desktop-sidebar-toggle-island/storage.d.ts +4 -0
- package/dist/desktop-sidebar-toggle-island/storage.js +29 -0
- package/dist/desktop-toc-toggle-island/index.d.ts +2 -7
- package/dist/desktop-toc-toggle-island/index.js +2 -58
- package/dist/desktop-toc-toggle-island/island.d.ts +4 -0
- package/dist/desktop-toc-toggle-island/island.js +43 -0
- package/dist/desktop-toc-toggle-island/storage.d.ts +4 -0
- package/dist/desktop-toc-toggle-island/storage.js +29 -0
- package/dist/details/details.d.ts +3 -4
- package/dist/details/details.js +1 -1
- package/dist/doc-body-end/index.d.ts +1 -2
- package/dist/doc-body-end/index.js +1 -1
- package/dist/doc-body-end-islands/design-token-panel-island.d.ts +2 -2
- package/dist/doc-body-end-islands/design-token-panel-island.js +3 -7
- package/dist/doc-body-end-islands/index.d.ts +4 -21
- package/dist/doc-body-end-islands/index.js +5 -3
- package/dist/doc-body-end-islands/theme-pack-switcher-island.d.ts +3 -13
- package/dist/doc-body-end-islands/theme-pack-switcher-island.js +11 -13
- package/dist/doc-content-header/index.d.ts +1 -2
- package/dist/doc-content-header/index.js +1 -1
- package/dist/doc-history/index.d.ts +1 -1
- package/dist/doc-history/index.js +166 -141
- package/dist/doc-history-area/index.d.ts +6 -4
- package/dist/doc-history-area/index.js +17 -16
- package/dist/doc-metainfo-area/index.d.ts +2 -3
- package/dist/doc-metainfo-area/index.js +1 -1
- package/dist/doc-page-renderer/index.d.ts +13 -7
- package/dist/doc-page-renderer/index.js +10 -1
- package/dist/doc-page-shell/index.d.ts +20 -7
- package/dist/doc-page-shell/index.js +17 -6
- package/dist/doc-pager/index.d.ts +1 -2
- package/dist/doc-pager/index.js +3 -3
- package/dist/doc-tags-area/index.d.ts +2 -3
- package/dist/doc-tags-area/index.js +1 -1
- package/dist/doclayout/doc-layout-with-defaults.d.ts +9 -9
- package/dist/doclayout/doc-layout-with-defaults.js +5 -15
- package/dist/doclayout/doc-layout.d.ts +26 -27
- package/dist/doclayout/doc-layout.js +23 -14
- package/dist/docs-schema/index.d.ts +4 -0
- package/dist/docs-schema/index.js +1 -0
- package/dist/extract-headings/index.js +43 -12
- package/dist/factory-context/index.d.ts +22 -19
- package/dist/features.css +75 -8
- package/dist/find-in-page/find-bar.d.ts +4 -2
- package/dist/find-in-page/find-bar.js +58 -69
- package/dist/find-in-page/index.d.ts +2 -8
- package/dist/find-in-page/index.js +33 -30
- package/dist/footer/footer.d.ts +3 -4
- package/dist/footer/footer.js +3 -3
- package/dist/footer-with-defaults/index.d.ts +2 -3
- package/dist/footer-with-defaults/index.js +1 -1
- package/dist/frontmatter-preview-defaults/index.js +1 -0
- package/dist/head/doc-head.d.ts +1 -1
- package/dist/head/doc-head.js +24 -32
- package/dist/head/og-tags.d.ts +1 -1
- package/dist/head/og-tags.js +8 -7
- package/dist/head/twitter-card.d.ts +1 -1
- package/dist/head/twitter-card.js +1 -1
- package/dist/head-with-defaults/index.d.ts +7 -2
- package/dist/head-with-defaults/index.js +46 -32
- package/dist/header/header.d.ts +8 -8
- package/dist/header/header.js +9 -11
- package/dist/header/types.d.ts +7 -7
- package/dist/header-with-defaults/index.d.ts +3 -4
- package/dist/header-with-defaults/index.js +27 -14
- package/dist/home-intro/index.d.ts +2 -5
- package/dist/home-intro/index.js +7 -5
- package/dist/home-intro/prepare.js +4 -3
- package/dist/home-page/index.d.ts +3 -3
- package/dist/home-page/index.js +19 -17
- package/dist/html-preview-wrapper/highlighted-code.d.ts +3 -4
- package/dist/html-preview-wrapper/highlighted-code.js +19 -17
- package/dist/html-preview-wrapper/html-preview-wrapper.d.ts +4 -25
- package/dist/html-preview-wrapper/html-preview-wrapper.js +2 -87
- package/dist/html-preview-wrapper/html-preview.d.ts +3 -10
- package/dist/html-preview-wrapper/html-preview.js +13 -37
- package/dist/html-preview-wrapper/index.d.ts +2 -1
- package/dist/html-preview-wrapper/index.js +1 -1
- package/dist/html-preview-wrapper/preview-base.d.ts +3 -5
- package/dist/html-preview-wrapper/preview-base.js +56 -59
- package/dist/html-preview-wrapper/wrapper.d.ts +20 -0
- package/dist/html-preview-wrapper/wrapper.js +37 -0
- package/dist/hydration-pending.d.ts +3 -5
- package/dist/hydration-pending.js +7 -5
- package/dist/i18n-version/language-switcher.d.ts +5 -32
- package/dist/i18n-version/language-switcher.js +5 -106
- package/dist/i18n-version/switcher-generated-scripts.d.ts +2 -0
- package/dist/i18n-version/switcher-generated-scripts.js +107 -0
- package/dist/i18n-version/switcher-url-state.d.ts +76 -0
- package/dist/i18n-version/switcher-url-state.js +103 -0
- package/dist/i18n-version/version-banner.d.ts +2 -3
- package/dist/i18n-version/version-banner.js +1 -1
- package/dist/i18n-version/version-switcher.d.ts +5 -50
- package/dist/i18n-version/version-switcher.js +5 -157
- package/dist/icons/index.d.ts +18 -19
- package/dist/icons/index.js +17 -33
- package/dist/image-enlarge/index.d.ts +1 -10
- package/dist/image-enlarge/index.js +80 -55
- package/dist/image-enlarge/public.d.ts +2 -0
- package/dist/image-enlarge/public.js +6 -0
- package/dist/image-enlarge/ssr-fallback.d.ts +2 -0
- package/dist/image-enlarge/ssr-fallback.js +8 -0
- package/dist/index.d.ts +11 -4
- package/dist/inline-version-switcher/index.d.ts +1 -2
- package/dist/inline-version-switcher/index.js +1 -1
- package/dist/island-types/index.d.ts +2 -2
- package/dist/island-types/index.js +1 -5
- package/dist/math-block/index.d.ts +4 -7
- package/dist/math-block/index.js +5 -5
- package/dist/mcp/handler.d.ts +8 -0
- package/dist/mcp/handler.js +129 -0
- package/dist/mcp/index.d.ts +4 -0
- package/dist/mcp/index.js +7 -0
- package/dist/mcp/loader.d.ts +19 -0
- package/dist/mcp/loader.js +202 -0
- package/dist/mdx-components/index.js +40 -108
- package/dist/mermaid-enlarge/index.d.ts +1 -8
- package/dist/mermaid-enlarge/index.js +174 -158
- package/dist/mermaid-enlarge/public.d.ts +2 -0
- package/dist/mermaid-enlarge/public.js +6 -0
- package/dist/mermaid-enlarge/ssr-fallback.d.ts +2 -0
- package/dist/mermaid-enlarge/ssr-fallback.js +8 -0
- package/dist/metainfo/doc-metainfo.d.ts +2 -3
- package/dist/metainfo/doc-metainfo.js +1 -4
- package/dist/metainfo/doc-tags.d.ts +2 -3
- package/dist/metainfo/doc-tags.js +1 -1
- package/dist/metainfo/frontmatter-preview.d.ts +3 -4
- package/dist/metainfo/frontmatter-preview.js +1 -1
- package/dist/nav-data-prep/index.js +6 -4
- package/dist/nav-indexing/category-nav.d.ts +2 -3
- package/dist/nav-indexing/category-nav.js +1 -2
- package/dist/nav-indexing/category-tree-nav.d.ts +2 -3
- package/dist/nav-indexing/category-tree-nav.js +1 -1
- package/dist/nav-indexing/doc-card-grid.d.ts +2 -3
- package/dist/nav-indexing/doc-card-grid.js +1 -2
- package/dist/nav-indexing/docs-sitemap.d.ts +2 -3
- package/dist/nav-indexing/docs-sitemap.js +2 -2
- package/dist/nav-indexing/index.d.ts +1 -1
- package/dist/nav-indexing/nav-card-grid.d.ts +2 -3
- package/dist/nav-indexing/nav-card-grid.js +1 -2
- package/dist/nav-indexing/note-tray-index-parts/card-list.d.ts +1 -2
- package/dist/nav-indexing/note-tray-index-parts/card-list.js +4 -4
- package/dist/nav-indexing/note-tray-index-parts/date-line.d.ts +2 -3
- package/dist/nav-indexing/note-tray-index-parts/date-line.js +1 -1
- package/dist/nav-indexing/note-tray-index-parts/index-list.d.ts +1 -2
- package/dist/nav-indexing/note-tray-index-parts/index-list.js +2 -2
- package/dist/nav-indexing/note-tray-index-parts/timeline.d.ts +1 -2
- package/dist/nav-indexing/note-tray-index-parts/timeline.js +2 -2
- package/dist/nav-indexing/note-tray-index.d.ts +1 -2
- package/dist/nav-indexing/note-tray-index.js +1 -1
- package/dist/nav-indexing/site-tree-nav-demo.d.ts +2 -3
- package/dist/nav-indexing/site-tree-nav-demo.js +2 -2
- package/dist/nav-indexing/tag-nav.d.ts +1 -2
- package/dist/nav-indexing/tag-nav.js +1 -1
- package/dist/nav-indexing/types.d.ts +2 -2
- package/dist/nav-indexing/versions-page-content.d.ts +2 -3
- package/dist/nav-indexing/versions-page-content.js +8 -8
- package/dist/note-tray-index/index.d.ts +1 -2
- package/dist/note-tray-index/index.js +1 -1
- package/dist/page-loading/page-loading-overlay.d.ts +1 -2
- package/dist/page-loading/page-loading-overlay.js +3 -5
- package/dist/plugins/agent-export.d.ts +3 -0
- package/dist/plugins/agent-export.js +34 -0
- package/dist/plugins/internal/agent-export/chunk.d.ts +5 -0
- package/dist/plugins/internal/agent-export/chunk.js +90 -0
- package/dist/plugins/internal/agent-export/index.d.ts +24 -0
- package/dist/plugins/internal/agent-export/index.js +123 -0
- package/dist/plugins/internal/agent-export/normalize.d.ts +5 -0
- package/dist/plugins/internal/agent-export/normalize.js +73 -0
- package/dist/plugins/internal/llms-txt/dev-middleware.d.ts +6 -0
- package/dist/plugins/internal/llms-txt/dev-middleware.js +8 -3
- package/dist/plugins/internal/llms-txt/emit.js +23 -6
- package/dist/plugins/internal/llms-txt/generate.d.ts +7 -1
- package/dist/plugins/internal/llms-txt/generate.js +9 -2
- package/dist/plugins/internal/llms-txt/load.d.ts +2 -0
- package/dist/plugins/internal/llms-txt/load.js +20 -4
- package/dist/plugins/internal/llms-txt/types.d.ts +10 -0
- package/dist/plugins/routes.js +4 -0
- package/dist/preset.d.ts +19 -9
- package/dist/preset.js +20 -1
- package/dist/route-context-payload/index.js +1 -1
- package/dist/routes/404.d.ts +2 -3
- package/dist/routes/404.js +1 -1
- package/dist/routes/_chrome.d.ts +5 -5
- package/dist/routes/_chrome.js +7 -2
- package/dist/routes/_context.d.ts +4 -4
- package/dist/routes/_design-token-panel-bootstrap.d.ts +1 -4
- package/dist/routes/_design-token-panel-bootstrap.js +9 -1
- package/dist/routes/docs-slug.d.ts +2 -3
- package/dist/routes/docs-tags-index.d.ts +2 -3
- package/dist/routes/docs-tags-index.js +1 -1
- package/dist/routes/docs-tags-tag.d.ts +2 -3
- package/dist/routes/docs-tags-tag.js +1 -1
- package/dist/routes/docs-versions.d.ts +2 -3
- package/dist/routes/docs-versions.js +1 -1
- package/dist/routes/files-path.d.ts +2 -3
- package/dist/routes/files-path.js +1 -1
- package/dist/routes/index.d.ts +2 -3
- package/dist/routes/index.js +1 -1
- package/dist/routes/locale-docs-slug.d.ts +2 -3
- package/dist/routes/locale-docs-tags-index.d.ts +2 -3
- package/dist/routes/locale-docs-tags-index.js +1 -1
- package/dist/routes/locale-docs-tags-tag.d.ts +2 -3
- package/dist/routes/locale-docs-tags-tag.js +1 -1
- package/dist/routes/locale-docs-versions.d.ts +2 -3
- package/dist/routes/locale-docs-versions.js +1 -1
- package/dist/routes/locale-files-path.d.ts +2 -3
- package/dist/routes/locale-files-path.js +1 -1
- package/dist/routes/locale-index.d.ts +2 -3
- package/dist/routes/locale-index.js +1 -1
- package/dist/routes/mcp.d.ts +5 -0
- package/dist/routes/mcp.js +25 -0
- package/dist/routes/v-docs-slug.d.ts +2 -3
- package/dist/routes/v-locale-docs-slug.d.ts +2 -3
- package/dist/search-widget/index.d.ts +1 -2
- package/dist/search-widget/index.js +4 -7
- package/dist/search-widget-script/generated-script.js +12 -5
- package/dist/settings-defaults.d.ts +2 -0
- package/dist/settings-defaults.js +93 -0
- package/dist/settings.d.ts +8 -2
- package/dist/sidebar/client-data.d.ts +18 -0
- package/dist/sidebar/client-data.js +47 -0
- package/dist/sidebar/index.d.ts +3 -1
- package/dist/sidebar/index.js +3 -1
- package/dist/sidebar/sidebar.d.ts +12 -44
- package/dist/sidebar/sidebar.js +4 -3
- package/dist/sidebar/types.d.ts +14 -0
- package/dist/sidebar-prepaint/index.d.ts +1 -2
- package/dist/sidebar-prepaint/index.js +4 -6
- package/dist/sidebar-resizer/sidebar-resizer-init.d.ts +2 -3
- package/dist/sidebar-resizer/sidebar-resizer-init.js +3 -3
- package/dist/sidebar-toggle-island/index.d.ts +8 -11
- package/dist/sidebar-toggle-island/index.js +75 -62
- package/dist/sidebar-tree/build-tree.js +5 -6
- package/dist/sidebar-tree/types.d.ts +2 -0
- package/dist/sidebar-tree-island/index.d.ts +4 -19
- package/dist/sidebar-tree-island/index.js +782 -436
- package/dist/sidebar-tree-island/scope-state.d.ts +38 -0
- package/dist/sidebar-tree-island/scope-state.js +151 -0
- package/dist/sidebar-tree-island/sidebar-scroll-preserve.js +6 -2
- package/dist/sidebar-utils/index.d.ts +17 -19
- package/dist/sidebar-utils/index.js +100 -3
- package/dist/sidebar-utils/scope.d.ts +11 -0
- package/dist/sidebar-utils/scope.js +67 -0
- package/dist/sidebar-with-defaults/index.d.ts +1 -2
- package/dist/sidebar-with-defaults/index.js +19 -18
- package/dist/site-schema/nav-tree.js +15 -15
- package/dist/site-schema/types.d.ts +1 -0
- package/dist/site-tree-nav/index.d.ts +2 -3
- package/dist/site-tree-nav/index.js +11 -12
- package/dist/site-tree-nav/normalize-island-props.d.ts +16 -0
- package/dist/site-tree-nav/normalize-island-props.js +122 -0
- package/dist/site-tree-nav-island/index.d.ts +3 -3
- package/dist/site-tree-nav-island/index.js +243 -144
- package/dist/smart-break/index.d.ts +3 -4
- package/dist/smart-break/index.js +1 -1
- package/dist/tab-item/tab-item.d.ts +3 -4
- package/dist/tab-item/tab-item.js +1 -1
- package/dist/tag-pages/index.d.ts +3 -3
- package/dist/tag-pages/index.js +10 -10
- package/dist/theme/color-scheme-provider.d.ts +3 -3
- package/dist/theme/color-scheme-provider.js +3 -3
- package/dist/theme/theme-pack-provider.d.ts +1 -1
- package/dist/theme/theme-pack-provider.js +3 -3
- package/dist/theme/theme-toggle.d.ts +2 -3
- package/dist/theme/theme-toggle.js +1 -1
- package/dist/theme-pack-dialog/index.d.ts +1 -1
- package/dist/theme-pack-dialog/index.js +69 -75
- package/dist/theme-pack-dialog/theme-pack-card.d.ts +3 -4
- package/dist/theme-pack-dialog/theme-pack-card.js +19 -17
- package/dist/theme-pack-switcher/index.d.ts +4 -5
- package/dist/theme-pack-switcher/index.js +52 -49
- package/dist/theme-packs/academia/meta.json +1 -1
- package/dist/theme-packs/academia/pack.css +1 -1
- package/dist/theme-packs/bauhaus/meta.json +1 -1
- package/dist/theme-packs/bauhaus/pack.css +2 -2
- package/dist/theme-packs/blueprint/meta.json +1 -1
- package/dist/theme-packs/blueprint/pack.css +2 -2
- package/dist/theme-packs/botanica/meta.json +1 -1
- package/dist/theme-packs/botanica/pack.css +2 -2
- package/dist/theme-packs/broadsheet/meta.json +1 -1
- package/dist/theme-packs/broadsheet/pack.css +2 -2
- package/dist/theme-packs/brutalist/meta.json +1 -1
- package/dist/theme-packs/brutalist/pack.css +2 -2
- package/dist/theme-packs/eink/meta.json +1 -1
- package/dist/theme-packs/eink/pack.css +1 -1
- package/dist/theme-packs/futura-editorial/meta.json +1 -1
- package/dist/theme-packs/futura-editorial/pack.css +2 -2
- package/dist/theme-packs/hearth/meta.json +1 -1
- package/dist/theme-packs/hearth/pack.css +2 -2
- package/dist/theme-packs/ledger/meta.json +1 -1
- package/dist/theme-packs/ledger/pack.css +1 -1
- package/dist/theme-packs/manuscript/meta.json +1 -1
- package/dist/theme-packs/manuscript/pack.css +1 -1
- package/dist/theme-packs/matcha/meta.json +1 -1
- package/dist/theme-packs/matcha/pack.css +2 -2
- package/dist/theme-packs/nocturne/meta.json +1 -1
- package/dist/theme-packs/nocturne/pack.css +2 -2
- package/dist/theme-packs/observatory/meta.json +1 -1
- package/dist/theme-packs/observatory/pack.css +2 -2
- package/dist/theme-packs/onyx/meta.json +1 -1
- package/dist/theme-packs/onyx/pack.css +2 -2
- package/dist/theme-packs/phosphor/meta.json +1 -1
- package/dist/theme-packs/phosphor/pack.css +2 -2
- package/dist/theme-packs/riso/meta.json +1 -1
- package/dist/theme-packs/riso/pack.css +2 -2
- package/dist/theme-packs/sakura/meta.json +1 -1
- package/dist/theme-packs/sakura/pack.css +2 -2
- package/dist/theme-packs/scandi/meta.json +1 -1
- package/dist/theme-packs/scandi/pack.css +1 -1
- package/dist/theme-packs/solar/meta.json +1 -1
- package/dist/theme-packs/solar/pack.css +1 -1
- package/dist/theme-packs/sumi/meta.json +1 -1
- package/dist/theme-packs/sumi/pack.css +2 -2
- package/dist/theme-packs/swissgrid/meta.json +1 -1
- package/dist/theme-packs/swissgrid/pack.css +1 -1
- package/dist/theme-packs/timberline/meta.json +1 -1
- package/dist/theme-packs/timberline/pack.css +2 -2
- package/dist/theme-packs/washi/meta.json +1 -1
- package/dist/theme-packs/washi/pack.css +2 -2
- package/dist/theme-toggle/index.d.ts +1 -1
- package/dist/theme-toggle/index.js +154 -167
- package/dist/theme.css +47 -121
- package/dist/toc/mobile-toc.d.ts +3 -5
- package/dist/toc/mobile-toc.js +29 -27
- package/dist/toc/toc.d.ts +3 -4
- package/dist/toc/toc.js +18 -18
- package/dist/toc/use-active-heading.d.ts +5 -4
- package/dist/toc/use-active-heading.js +36 -30
- package/dist/toc-prepaint/index.d.ts +1 -2
- package/dist/toc-prepaint/index.js +4 -6
- package/dist/transitions/nested-island-props-refresh.d.ts +3 -16
- package/dist/transitions/nested-island-props-refresh.js +133 -151
- package/dist/transitions/page-events.d.ts +8 -13
- package/dist/tree-nav-shared/index.d.ts +4 -5
- package/dist/tree-nav-shared/index.js +6 -7
- package/dist/use-modal-dialog/index.d.ts +9 -63
- package/dist/use-modal-dialog/index.js +41 -59
- package/dist/versions-page/index.d.ts +3 -3
- package/dist/versions-page/index.js +5 -5
- package/dist/wind/index.d.ts +5 -0
- package/dist/wind/index.js +169 -0
- package/dist/wind.json +498 -0
- package/dist/z-index-defaults/index.d.ts +4 -4
- package/dist/zdtp-loader.d.ts +7 -0
- package/dist/zdtp-loader.js +8 -0
- package/eject/asset-components/asset-card.tsx +14 -16
- package/eject/asset-components/asset-code.tsx +10 -12
- package/eject/asset-components/shared.tsx +5 -7
- package/eject/breadcrumb/breadcrumb.tsx +15 -16
- package/eject/code-group/index.tsx +4 -10
- package/eject/content-admonition/index.tsx +5 -6
- package/eject/desktop-sidebar-toggle-island/index.ts +4 -0
- package/eject/desktop-sidebar-toggle-island/island.tsx +50 -0
- package/eject/desktop-sidebar-toggle-island/storage.ts +27 -0
- package/eject/details/details.tsx +3 -5
- package/eject/doc-history/index.tsx +193 -179
- package/eject/doc-pager/index.tsx +3 -4
- package/eject/footer/footer.tsx +7 -9
- package/eject/header/header.tsx +42 -54
- package/eject/header/nav-overflow-script.ts +1 -1
- package/eject/header/types.ts +12 -13
- package/eject/image-enlarge/index.tsx +84 -69
- package/eject/image-enlarge/public.ts +2 -0
- package/eject/image-enlarge/ssr-fallback.tsx +7 -0
- package/eject/page-loading/page-loading-overlay.tsx +8 -15
- package/eject/sidebar/client-data.ts +68 -0
- package/eject/sidebar/index.ts +3 -0
- package/eject/sidebar/sidebar.tsx +16 -97
- package/eject/sidebar/types.ts +15 -0
- package/eject/sidebar-toggle-island/index.tsx +103 -102
- package/eject/sidebar-tree-island/index.tsx +827 -615
- package/eject/sidebar-tree-island/scope-state.ts +154 -0
- package/eject/sidebar-tree-island/sidebar-scroll-preserve.ts +8 -2
- package/eject/site-tree-nav-island/index.tsx +349 -222
- package/eject/tab-item/tab-item.tsx +2 -4
- package/eject/theme-toggle/hydration-pending.ts +6 -10
- package/eject/theme-toggle/index.tsx +133 -173
- package/eject/toc/mobile-toc.tsx +27 -31
- package/eject/toc/toc.tsx +21 -24
- package/eject/toc/use-active-heading.ts +43 -38
- package/package.json +40 -22
- package/routes-src/404.tsx +2 -3
- package/routes-src/_chrome.tsx +7 -2
- package/routes-src/_design-token-panel-bootstrap.tsx +1 -63
- package/routes-src/docs-slug.tsx +2 -3
- package/routes-src/docs-tags-index.tsx +2 -3
- package/routes-src/docs-tags-tag.tsx +2 -3
- package/routes-src/docs-versions.tsx +2 -3
- package/routes-src/files-path.tsx +2 -4
- package/routes-src/index.tsx +2 -3
- package/routes-src/locale-docs-slug.tsx +2 -3
- package/routes-src/locale-docs-tags-index.tsx +2 -3
- package/routes-src/locale-docs-tags-tag.tsx +2 -3
- package/routes-src/locale-docs-versions.tsx +2 -3
- package/routes-src/locale-files-path.tsx +2 -4
- package/routes-src/locale-index.tsx +2 -3
- package/routes-src/mcp.tsx +25 -0
- package/routes-src/v-docs-slug.tsx +2 -3
- package/routes-src/v-locale-docs-slug.tsx +2 -3
- package/tsconfig.base.json +1 -1
- package/dist/safelist.css +0 -2
- package/dist/theme-no-reset.css +0 -379
- package/eject/desktop-sidebar-toggle-island/index.tsx +0 -110
|
@@ -1,15 +1,30 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { Fragment, jsx, jsxs } from "
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
import { Fragment, jsx, jsxs } from "@takazudo/zfb/zudo-react/jsx-runtime";
|
|
3
|
+
import {
|
|
4
|
+
computed,
|
|
5
|
+
For,
|
|
6
|
+
getScope,
|
|
7
|
+
Show,
|
|
8
|
+
signal
|
|
9
|
+
} from "@takazudo/zfb/zudo-react";
|
|
10
|
+
import {
|
|
11
|
+
INDENT,
|
|
12
|
+
BASE_PAD,
|
|
13
|
+
connectorLeft,
|
|
14
|
+
ConnectorLines,
|
|
15
|
+
CategoryLinkIcon
|
|
16
|
+
} from "../tree-nav-shared/index.js";
|
|
6
17
|
import { ChevronRight, ChevronLeft, Search } from "../icons/index.js";
|
|
7
18
|
import { ThemeToggle } from "../theme-toggle/index.js";
|
|
8
19
|
import { smartBreakToHtml } from "../smart-break/index.js";
|
|
9
|
-
import { AFTER_NAVIGATE_EVENT
|
|
20
|
+
import { AFTER_NAVIGATE_EVENT } from "../transitions/index.js";
|
|
21
|
+
import { useSidebarScope } from "./scope-state.js";
|
|
10
22
|
import { filterTree } from "../sidebar-filter/index.js";
|
|
11
23
|
import { findActiveSlug, normalizePath } from "../sidebar-active-slug/index.js";
|
|
12
|
-
import {
|
|
24
|
+
import {
|
|
25
|
+
CURRENT_PATH_DATASET_KEY,
|
|
26
|
+
readCurrentPath
|
|
27
|
+
} from "../current-path/index.js";
|
|
13
28
|
import { ensureSidebarScrollPreserve } from "./sidebar-scroll-preserve.js";
|
|
14
29
|
import {
|
|
15
30
|
formatYearLabel,
|
|
@@ -19,19 +34,26 @@ import {
|
|
|
19
34
|
rankWidth
|
|
20
35
|
} from "../note-tray-model/index.js";
|
|
21
36
|
import { formatMonthDay } from "../format-date/index.js";
|
|
22
|
-
|
|
23
|
-
|
|
37
|
+
const STORAGE_KEY = "zd-sidebar-open";
|
|
38
|
+
const GROUPED_TRAY_ITEM_DEPTH = 3;
|
|
39
|
+
function ToggleChevron({
|
|
40
|
+
isExpanded,
|
|
41
|
+
className
|
|
42
|
+
}) {
|
|
24
43
|
return /* @__PURE__ */ jsx(
|
|
25
|
-
|
|
44
|
+
For,
|
|
26
45
|
{
|
|
27
|
-
|
|
46
|
+
each: computed(() => [
|
|
47
|
+
`h-[0.625rem] w-[0.625rem] shrink-0 transition-transform duration-150 ${isExpanded.value ? "rotate-90" : ""} ${typeof className === "string" ? className : className?.value ?? ""}`
|
|
48
|
+
]),
|
|
49
|
+
by: (value) => value,
|
|
50
|
+
children: (value) => /* @__PURE__ */ jsx(ChevronRight, { class: value.value })
|
|
28
51
|
}
|
|
29
52
|
);
|
|
30
53
|
}
|
|
31
|
-
const STORAGE_KEY = "zd-sidebar-open";
|
|
32
|
-
const GROUPED_TRAY_ITEM_DEPTH = 3;
|
|
33
54
|
function padLeft(depth, forCategory) {
|
|
34
|
-
if (depth === 0)
|
|
55
|
+
if (depth === 0)
|
|
56
|
+
return `calc(${BASE_PAD} + ${forCategory ? "0.15rem" : "0rem"})`;
|
|
35
57
|
return `calc(${depth} * ${INDENT} + 1.25rem + 5px)`;
|
|
36
58
|
}
|
|
37
59
|
function getOpenSet() {
|
|
@@ -39,7 +61,9 @@ function getOpenSet() {
|
|
|
39
61
|
const raw = sessionStorage.getItem(STORAGE_KEY);
|
|
40
62
|
if (!raw) return /* @__PURE__ */ new Set();
|
|
41
63
|
const parsed = JSON.parse(raw);
|
|
42
|
-
return Array.isArray(parsed) ? new Set(
|
|
64
|
+
return Array.isArray(parsed) ? new Set(
|
|
65
|
+
parsed.filter((value) => typeof value === "string")
|
|
66
|
+
) : /* @__PURE__ */ new Set();
|
|
43
67
|
} catch {
|
|
44
68
|
return /* @__PURE__ */ new Set();
|
|
45
69
|
}
|
|
@@ -52,186 +76,305 @@ function saveOpenSet(set) {
|
|
|
52
76
|
}
|
|
53
77
|
function deriveActiveSlug(nodes, pathname) {
|
|
54
78
|
const resolved = readCurrentPath(CURRENT_PATH_DATASET_KEY, pathname);
|
|
55
|
-
|
|
56
|
-
return findActiveSlug(nodes, normalizePath(resolved));
|
|
79
|
+
return resolved ? findActiveSlug(nodes, normalizePath(resolved)) : void 0;
|
|
57
80
|
}
|
|
58
81
|
function useActiveSlug(nodes, initial, currentPath) {
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
);
|
|
62
|
-
useEffect(() => {
|
|
82
|
+
const slug = signal(initial);
|
|
83
|
+
getScope().onActivate(() => {
|
|
63
84
|
const update = (pathname) => {
|
|
64
85
|
const found = deriveActiveSlug(nodes, pathname);
|
|
65
|
-
if (found !== void 0)
|
|
86
|
+
if (found !== void 0) slug.value = found;
|
|
66
87
|
};
|
|
67
|
-
const onNavigate = () => update();
|
|
68
88
|
update(currentPath);
|
|
89
|
+
const onNavigate = () => update();
|
|
69
90
|
document.addEventListener(AFTER_NAVIGATE_EVENT, onNavigate);
|
|
70
91
|
return () => document.removeEventListener(AFTER_NAVIGATE_EVENT, onNavigate);
|
|
71
|
-
}
|
|
92
|
+
});
|
|
72
93
|
return slug;
|
|
73
94
|
}
|
|
74
|
-
function RootMenuItemEntry({
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
95
|
+
function RootMenuItemEntry({
|
|
96
|
+
item
|
|
97
|
+
}) {
|
|
98
|
+
const expanded = signal(false);
|
|
99
|
+
const hasChildren = computed(() => !!item.value.children?.length);
|
|
100
|
+
return /* @__PURE__ */ jsxs("div", { class: "border-t border-muted", children: [
|
|
101
|
+
/* @__PURE__ */ jsxs("div", { class: "flex items-center", children: [
|
|
79
102
|
/* @__PURE__ */ jsxs(
|
|
80
103
|
"a",
|
|
81
104
|
{
|
|
82
|
-
href: item.href,
|
|
83
|
-
|
|
105
|
+
href: computed(() => item.value.href ?? ""),
|
|
106
|
+
class: "flex flex-1 items-center gap-hsp-xs px-hsp-sm py-vsp-xs text-small font-semibold text-fg hover:text-accent hover:underline break-words",
|
|
84
107
|
children: [
|
|
85
|
-
/* @__PURE__ */ jsx(CategoryLinkIcon, {
|
|
86
|
-
/* @__PURE__ */ jsx("span", {
|
|
108
|
+
/* @__PURE__ */ jsx(CategoryLinkIcon, { class: "w-[14px]" }),
|
|
109
|
+
/* @__PURE__ */ jsx("span", { rawHtml: computed(() => smartBreakToHtml(item.value.label)) })
|
|
87
110
|
]
|
|
88
111
|
}
|
|
89
112
|
),
|
|
90
|
-
hasChildren
|
|
113
|
+
/* @__PURE__ */ jsx(Show, { when: hasChildren, children: () => /* @__PURE__ */ jsx(
|
|
91
114
|
"button",
|
|
92
115
|
{
|
|
93
116
|
type: "button",
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
"
|
|
117
|
+
"on:click": () => {
|
|
118
|
+
expanded.value = !expanded.value;
|
|
119
|
+
},
|
|
120
|
+
class: "flex items-center justify-center px-hsp-sm py-vsp-xs text-muted hover:text-fg",
|
|
121
|
+
"aria-expanded": computed(
|
|
122
|
+
() => expanded.value ? "true" : "false"
|
|
123
|
+
),
|
|
124
|
+
"aria-label": computed(
|
|
125
|
+
() => `${expanded.value ? "Collapse" : "Expand"} ${item.value.label}`
|
|
126
|
+
),
|
|
98
127
|
children: /* @__PURE__ */ jsx(ToggleChevron, { isExpanded: expanded, className: "text-muted" })
|
|
99
128
|
}
|
|
100
|
-
)
|
|
129
|
+
) })
|
|
101
130
|
] }),
|
|
102
|
-
hasChildren && expanded
|
|
103
|
-
|
|
131
|
+
/* @__PURE__ */ jsx(Show, { when: computed(() => hasChildren.value && expanded.value), children: () => /* @__PURE__ */ jsx("div", { class: "pb-vsp-xs", children: /* @__PURE__ */ jsx(
|
|
132
|
+
For,
|
|
104
133
|
{
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
children: /* @__PURE__ */ jsx(
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
134
|
+
each: computed(() => item.value.children ?? []),
|
|
135
|
+
by: (child) => child.href,
|
|
136
|
+
children: (child) => /* @__PURE__ */ jsx(
|
|
137
|
+
"a",
|
|
138
|
+
{
|
|
139
|
+
href: computed(() => child.value.href),
|
|
140
|
+
class: "block pl-hsp-xl pr-hsp-sm py-vsp-2xs text-small text-muted hover:text-accent hover:underline break-words",
|
|
141
|
+
children: /* @__PURE__ */ jsx(
|
|
142
|
+
"span",
|
|
143
|
+
{
|
|
144
|
+
rawHtml: computed(
|
|
145
|
+
() => smartBreakToHtml(child.value.label)
|
|
146
|
+
)
|
|
147
|
+
}
|
|
148
|
+
)
|
|
149
|
+
}
|
|
150
|
+
)
|
|
151
|
+
}
|
|
152
|
+
) }) })
|
|
111
153
|
] });
|
|
112
154
|
}
|
|
113
|
-
function SidebarFooter({
|
|
155
|
+
function SidebarFooter({
|
|
156
|
+
links,
|
|
157
|
+
themeDefaultMode,
|
|
158
|
+
themeLabels,
|
|
159
|
+
themeRespectSystem
|
|
160
|
+
}) {
|
|
114
161
|
if (!links && !themeDefaultMode) return null;
|
|
115
|
-
return (
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
162
|
+
return /* @__PURE__ */ jsxs("div", { class: "lg:hidden flex items-center gap-hsp-md border-t border-muted px-hsp-sm py-vsp-xs pb-[50vh] text-small", children: [
|
|
163
|
+
themeDefaultMode ? /* @__PURE__ */ jsx(
|
|
164
|
+
ThemeToggle,
|
|
165
|
+
{
|
|
166
|
+
defaultMode: themeDefaultMode,
|
|
167
|
+
labels: themeLabels,
|
|
168
|
+
respectPrefersColorScheme: themeRespectSystem,
|
|
169
|
+
pendingUntilHydrated: true
|
|
170
|
+
}
|
|
171
|
+
) : null,
|
|
172
|
+
/* @__PURE__ */ jsx(For, { each: computed(() => links ?? []), by: (link) => link.href, children: (link, index) => /* @__PURE__ */ jsxs("span", { class: "flex items-center gap-hsp-xs", children: [
|
|
173
|
+
/* @__PURE__ */ jsx(Show, { when: computed(() => index.value > 0), children: () => /* @__PURE__ */ jsx("span", { class: "text-muted", children: "/" }) }),
|
|
174
|
+
/* @__PURE__ */ jsx(
|
|
175
|
+
Show,
|
|
176
|
+
{
|
|
177
|
+
when: computed(() => link.value.active),
|
|
178
|
+
fallback: () => /* @__PURE__ */ jsx(
|
|
179
|
+
"a",
|
|
180
|
+
{
|
|
181
|
+
href: computed(() => link.value.href),
|
|
182
|
+
lang: computed(() => link.value.code),
|
|
183
|
+
class: "text-muted hover:text-fg",
|
|
184
|
+
children: computed(() => link.value.label)
|
|
185
|
+
}
|
|
186
|
+
),
|
|
187
|
+
children: () => /* @__PURE__ */ jsx("span", { "aria-current": "true", class: "font-medium text-fg", children: computed(() => link.value.label) })
|
|
188
|
+
}
|
|
189
|
+
)
|
|
190
|
+
] }) })
|
|
191
|
+
] });
|
|
125
192
|
}
|
|
126
|
-
function SidebarTree({
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
193
|
+
function SidebarTree({
|
|
194
|
+
nodes,
|
|
195
|
+
navigation,
|
|
196
|
+
currentSlug,
|
|
197
|
+
currentPath,
|
|
198
|
+
rootMenuItems,
|
|
199
|
+
backToMenuLabel,
|
|
200
|
+
locale: localeProp,
|
|
201
|
+
localeLinks,
|
|
202
|
+
themeDefaultMode,
|
|
203
|
+
themeLabels,
|
|
204
|
+
themeRespectSystem,
|
|
205
|
+
dateFormats
|
|
206
|
+
}) {
|
|
207
|
+
const scope = getScope();
|
|
208
|
+
const activeSlug = useActiveSlug(navigation?.roots ?? nodes, currentSlug, currentPath);
|
|
209
|
+
const query = signal("");
|
|
210
|
+
const { selected, selectedNodes, broader, labels, canRestore, changeScope, save, navRef, scopeControls } = useSidebarScope({
|
|
211
|
+
nodes,
|
|
212
|
+
navigation,
|
|
213
|
+
activeSlug,
|
|
214
|
+
query,
|
|
215
|
+
locale: localeProp ?? localeLinks?.find((link) => link.active)?.code ?? "en"
|
|
216
|
+
});
|
|
217
|
+
const showingRootMenu = signal(false);
|
|
218
|
+
const filterRef = { current: null };
|
|
219
|
+
const filterPlaceholder = signal("Filter...");
|
|
220
|
+
scope.onActivate(() => {
|
|
221
|
+
ensureSidebarScrollPreserve();
|
|
133
222
|
const platform = navigator.userAgentData?.platform ?? navigator.platform;
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
if (
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
el.select();
|
|
146
|
-
}
|
|
147
|
-
}
|
|
223
|
+
filterPlaceholder.value = /mac/i.test(platform) ? "Filter... (\u2318 + /)" : "Filter... (Ctrl + /)";
|
|
224
|
+
const handleKeyDown = (event) => {
|
|
225
|
+
const keyEvent = event;
|
|
226
|
+
if (keyEvent.isComposing || keyEvent.key !== "/" || !(keyEvent.metaKey || keyEvent.ctrlKey))
|
|
227
|
+
return;
|
|
228
|
+
const input = filterRef.current;
|
|
229
|
+
if (!input || input.offsetParent === null) return;
|
|
230
|
+
event.preventDefault();
|
|
231
|
+
input.focus();
|
|
232
|
+
input.select();
|
|
233
|
+
};
|
|
148
234
|
document.addEventListener("keydown", handleKeyDown);
|
|
149
235
|
return () => document.removeEventListener("keydown", handleKeyDown);
|
|
150
|
-
}
|
|
151
|
-
const filteredNodes =
|
|
152
|
-
() => query ? filterTree(
|
|
153
|
-
[nodes, query]
|
|
154
|
-
);
|
|
155
|
-
const footer = useMemo(
|
|
156
|
-
() => localeLinks || themeDefaultMode ? /* @__PURE__ */ jsx(SidebarFooter, { links: localeLinks, themeDefaultMode, themeLabels, themeRespectSystem }) : null,
|
|
157
|
-
[localeLinks, themeDefaultMode, themeLabels, themeRespectSystem]
|
|
236
|
+
});
|
|
237
|
+
const filteredNodes = computed(
|
|
238
|
+
() => query.value ? filterTree(selectedNodes.value, query.value) : selectedNodes.value
|
|
158
239
|
);
|
|
159
|
-
const noteTrayRoot = nodes.length === 1 && nodes[0]?.shape === "note-tray" ? nodes[0] : void 0;
|
|
160
|
-
const filteredNoteTrayRoot = noteTrayRoot ? filteredNodes.find((node) => node.slug === noteTrayRoot.slug) : void 0;
|
|
161
240
|
const locale = localeProp ?? localeLinks?.find((link) => link.active)?.code ?? "en";
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
241
|
+
const footer = /* @__PURE__ */ jsx(
|
|
242
|
+
SidebarFooter,
|
|
243
|
+
{
|
|
244
|
+
links: localeLinks,
|
|
245
|
+
themeDefaultMode,
|
|
246
|
+
themeLabels,
|
|
247
|
+
themeRespectSystem
|
|
248
|
+
}
|
|
249
|
+
);
|
|
250
|
+
const menu = /* @__PURE__ */ jsx(For, { each: computed(() => rootMenuItems ?? []), by: (item) => item.href, children: (item) => /* @__PURE__ */ jsx(RootMenuItemEntry, { item }) });
|
|
251
|
+
return /* @__PURE__ */ jsx(
|
|
252
|
+
Show,
|
|
253
|
+
{
|
|
254
|
+
when: computed(() => showingRootMenu.value && !!rootMenuItems),
|
|
255
|
+
fallback: () => /* @__PURE__ */ jsx(
|
|
256
|
+
Show,
|
|
166
257
|
{
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
children: [
|
|
171
|
-
/* @__PURE__ */
|
|
172
|
-
|
|
173
|
-
|
|
258
|
+
when: computed(
|
|
259
|
+
() => activeSlug.value === void 0 && !!rootMenuItems
|
|
260
|
+
),
|
|
261
|
+
fallback: () => /* @__PURE__ */ jsxs("nav", { ref: navRef, tabindex: -1, children: [
|
|
262
|
+
rootMenuItems ? /* @__PURE__ */ jsxs(
|
|
263
|
+
"button",
|
|
264
|
+
{
|
|
265
|
+
type: "button",
|
|
266
|
+
"on:click": () => {
|
|
267
|
+
showingRootMenu.value = true;
|
|
268
|
+
},
|
|
269
|
+
class: "lg:hidden flex w-full items-center gap-hsp-xs px-hsp-sm py-vsp-xs text-left text-small text-muted hover:text-fg border-b border-muted",
|
|
270
|
+
children: [
|
|
271
|
+
/* @__PURE__ */ jsx(ChevronLeft, { class: "h-icon-sm w-icon-sm shrink-0" }),
|
|
272
|
+
backToMenuLabel ?? "Back to main menu"
|
|
273
|
+
]
|
|
274
|
+
}
|
|
275
|
+
) : null,
|
|
276
|
+
/* @__PURE__ */ jsx("div", { class: "px-hsp-sm py-vsp-xs border-b border-muted", "data-sidebar-filter-region": true, children: /* @__PURE__ */ jsxs("div", { class: "flex items-center gap-hsp-xs bg-surface rounded px-hsp-sm py-vsp-2xs", children: [
|
|
277
|
+
/* @__PURE__ */ jsx(Search, { class: "h-[14px] w-[14px] text-muted shrink-0" }),
|
|
278
|
+
/* @__PURE__ */ jsx(
|
|
279
|
+
"input",
|
|
280
|
+
{
|
|
281
|
+
ref: filterRef,
|
|
282
|
+
type: "text",
|
|
283
|
+
"aria-label": "Filter navigation",
|
|
284
|
+
placeholder: filterPlaceholder,
|
|
285
|
+
modelValue: query,
|
|
286
|
+
"on:input": (event) => {
|
|
287
|
+
query.value = event.target.value;
|
|
288
|
+
save();
|
|
289
|
+
},
|
|
290
|
+
class: "bg-transparent text-small outline-none w-full text-fg placeholder:text-muted focus-visible:outline-2 focus-visible:outline-accent",
|
|
291
|
+
style: "outline-offset:-4px"
|
|
292
|
+
}
|
|
293
|
+
)
|
|
294
|
+
] }) }),
|
|
295
|
+
navigation ? /* @__PURE__ */ jsx(Show, { when: computed(() => broader.value !== null), children: () => /* @__PURE__ */ jsx("div", { class: "border-b border-muted px-hsp-md py-vsp-2xs text-small", "data-sidebar-scope-toolbar": true, children: /* @__PURE__ */ jsxs("div", { class: "flex items-center justify-between gap-hsp-xs", "data-sidebar-scope-actions": true, children: [
|
|
296
|
+
/* @__PURE__ */ jsxs(
|
|
297
|
+
"button",
|
|
298
|
+
{
|
|
299
|
+
type: "button",
|
|
300
|
+
"data-sidebar-broaden": true,
|
|
301
|
+
disabled: computed(() => broader.value === null),
|
|
302
|
+
"on:click": () => {
|
|
303
|
+
if (broader.value !== null) changeScope(broader.value);
|
|
304
|
+
},
|
|
305
|
+
style: "min-height:40px",
|
|
306
|
+
class: "flex items-center gap-hsp-sm px-hsp-xs font-medium rounded text-fg hover:bg-surface focus-visible:bg-surface focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent disabled:text-muted disabled:opacity-50",
|
|
307
|
+
children: [
|
|
308
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: "\u2191" }),
|
|
309
|
+
labels.broaden
|
|
310
|
+
]
|
|
311
|
+
}
|
|
312
|
+
),
|
|
313
|
+
/* @__PURE__ */ jsx(Show, { when: canRestore, children: () => /* @__PURE__ */ jsx(
|
|
314
|
+
"button",
|
|
315
|
+
{
|
|
316
|
+
type: "button",
|
|
317
|
+
"data-sidebar-restore": true,
|
|
318
|
+
"on:click": () => changeScope(null),
|
|
319
|
+
title: labels.restore,
|
|
320
|
+
"aria-label": labels.restore,
|
|
321
|
+
style: "width:40px;height:40px",
|
|
322
|
+
class: "grid place-items-center shrink-0 rounded text-muted hover:text-fg focus-visible:text-fg focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent",
|
|
323
|
+
children: /* @__PURE__ */ jsxs("svg", { width: "15", height: "15", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "aria-hidden": "true", children: [
|
|
324
|
+
/* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "10" }),
|
|
325
|
+
/* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "6" }),
|
|
326
|
+
/* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "2" })
|
|
327
|
+
] })
|
|
328
|
+
}
|
|
329
|
+
) })
|
|
330
|
+
] }) }) }) : null,
|
|
331
|
+
/* @__PURE__ */ jsx("div", { "data-sidebar-tree-root": true, children: /* @__PURE__ */ jsx(
|
|
332
|
+
Show,
|
|
333
|
+
{
|
|
334
|
+
when: computed(() => selectedNodes.value.length === 1 && selectedNodes.value[0]?.shape === "note-tray"),
|
|
335
|
+
fallback: () => /* @__PURE__ */ jsx(NodeList, { nodes: filteredNodes, currentSlug: activeSlug, depth: 0, forceOpen: computed(() => !!query.value), scopeControls }),
|
|
336
|
+
children: () => /* @__PURE__ */ jsx(Show, { when: computed(() => !!filteredNodes.value[0]), children: () => /* @__PURE__ */ jsx(
|
|
337
|
+
TrayList,
|
|
338
|
+
{
|
|
339
|
+
tray: computed(() => filteredNodes.value[0]),
|
|
340
|
+
itemCount: getNoteTrayItems(selectedNodes.value[0]).length,
|
|
341
|
+
currentSlug: activeSlug,
|
|
342
|
+
forceOpen: computed(() => !!query.value),
|
|
343
|
+
locale,
|
|
344
|
+
dateFormats,
|
|
345
|
+
scopeControls
|
|
346
|
+
}
|
|
347
|
+
) })
|
|
348
|
+
}
|
|
349
|
+
) }),
|
|
350
|
+
footer
|
|
351
|
+
] }),
|
|
352
|
+
children: () => /* @__PURE__ */ jsxs("nav", { children: [
|
|
353
|
+
menu,
|
|
354
|
+
footer
|
|
355
|
+
] })
|
|
174
356
|
}
|
|
175
357
|
),
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
]
|
|
197
|
-
}
|
|
198
|
-
),
|
|
199
|
-
/* @__PURE__ */ jsx("div", { className: "px-hsp-sm py-vsp-xs", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-hsp-xs bg-surface rounded px-hsp-sm py-vsp-2xs", children: [
|
|
200
|
-
/* @__PURE__ */ jsx(Search, { className: "h-[14px] w-[14px] text-muted shrink-0" }),
|
|
201
|
-
/* @__PURE__ */ jsx(
|
|
202
|
-
"input",
|
|
203
|
-
{
|
|
204
|
-
ref: filterRef,
|
|
205
|
-
type: "text",
|
|
206
|
-
"aria-label": "Filter navigation",
|
|
207
|
-
placeholder: filterPlaceholder,
|
|
208
|
-
value: query,
|
|
209
|
-
onInput: (e) => setQuery(e.currentTarget.value),
|
|
210
|
-
className: "bg-transparent text-small outline-none w-full text-fg placeholder:text-muted"
|
|
211
|
-
}
|
|
212
|
-
)
|
|
213
|
-
] }) }),
|
|
214
|
-
noteTrayRoot ? filteredNoteTrayRoot && /* @__PURE__ */ jsx(
|
|
215
|
-
TrayList,
|
|
216
|
-
{
|
|
217
|
-
tray: filteredNoteTrayRoot,
|
|
218
|
-
itemCount: getNoteTrayItems(noteTrayRoot).length,
|
|
219
|
-
currentSlug: activeSlug,
|
|
220
|
-
forceOpen: !!query,
|
|
221
|
-
locale,
|
|
222
|
-
dateFormats
|
|
223
|
-
}
|
|
224
|
-
) : /* @__PURE__ */ jsx(
|
|
225
|
-
NodeList,
|
|
226
|
-
{
|
|
227
|
-
nodes: filteredNodes,
|
|
228
|
-
currentSlug: activeSlug,
|
|
229
|
-
depth: 0,
|
|
230
|
-
forceOpen: !!query
|
|
231
|
-
}
|
|
232
|
-
),
|
|
233
|
-
footer
|
|
234
|
-
] });
|
|
358
|
+
children: () => /* @__PURE__ */ jsxs("nav", { children: [
|
|
359
|
+
/* @__PURE__ */ jsxs(
|
|
360
|
+
"button",
|
|
361
|
+
{
|
|
362
|
+
type: "button",
|
|
363
|
+
"on:click": () => {
|
|
364
|
+
showingRootMenu.value = false;
|
|
365
|
+
},
|
|
366
|
+
class: "flex w-full items-center gap-hsp-xs px-hsp-sm py-vsp-xs text-left text-small text-muted hover:text-fg border-b border-muted",
|
|
367
|
+
children: [
|
|
368
|
+
/* @__PURE__ */ jsx(ChevronRight, { class: "h-icon-sm w-icon-sm shrink-0" }),
|
|
369
|
+
backToMenuLabel ?? "Back to main menu"
|
|
370
|
+
]
|
|
371
|
+
}
|
|
372
|
+
),
|
|
373
|
+
menu,
|
|
374
|
+
footer
|
|
375
|
+
] })
|
|
376
|
+
}
|
|
377
|
+
);
|
|
235
378
|
}
|
|
236
379
|
SidebarTree.displayName = "SidebarTree";
|
|
237
380
|
function TrayList({
|
|
@@ -239,39 +382,77 @@ function TrayList({
|
|
|
239
382
|
itemCount,
|
|
240
383
|
currentSlug,
|
|
241
384
|
forceOpen,
|
|
385
|
+
scopeControls,
|
|
242
386
|
locale,
|
|
243
387
|
dateFormats
|
|
244
388
|
}) {
|
|
245
|
-
const items = getNoteTrayItems(tray);
|
|
246
|
-
const sidebarStyle = tray.noteTraySidebar ?? "index";
|
|
389
|
+
const items = computed(() => getNoteTrayItems(tray.value));
|
|
390
|
+
const sidebarStyle = computed(() => tray.value.noteTraySidebar ?? "index");
|
|
247
391
|
const width = rankWidth(itemCount);
|
|
248
392
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
249
|
-
/* @__PURE__ */ jsx(
|
|
250
|
-
|
|
251
|
-
TrayItem,
|
|
393
|
+
/* @__PURE__ */ jsx(
|
|
394
|
+
LeafNode,
|
|
252
395
|
{
|
|
253
|
-
|
|
396
|
+
node: tray,
|
|
254
397
|
currentSlug,
|
|
255
|
-
|
|
256
|
-
isLast:
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
TrayGroupNode,
|
|
398
|
+
depth: 0,
|
|
399
|
+
isLast: computed(() => items.value.length === 0),
|
|
400
|
+
forceOpen
|
|
401
|
+
}
|
|
402
|
+
),
|
|
403
|
+
/* @__PURE__ */ jsx(
|
|
404
|
+
Show,
|
|
263
405
|
{
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
406
|
+
when: computed(() => sidebarStyle.value === "index"),
|
|
407
|
+
fallback: () => /* @__PURE__ */ jsx(
|
|
408
|
+
For,
|
|
409
|
+
{
|
|
410
|
+
each: computed(
|
|
411
|
+
() => groupItems(
|
|
412
|
+
items.value,
|
|
413
|
+
sidebarStyle.value,
|
|
414
|
+
tray.value.sortOrder ?? "asc"
|
|
415
|
+
)
|
|
416
|
+
),
|
|
417
|
+
by: (group) => group.key,
|
|
418
|
+
children: (group, index) => /* @__PURE__ */ jsx(
|
|
419
|
+
TrayGroupNode,
|
|
420
|
+
{
|
|
421
|
+
traySlug: computed(() => tray.value.slug),
|
|
422
|
+
trayOccurrence: computed(() => tray.value.occurrenceId ?? tray.value.slug),
|
|
423
|
+
scopeControls,
|
|
424
|
+
group,
|
|
425
|
+
grouping: computed(
|
|
426
|
+
() => sidebarStyle.value
|
|
427
|
+
),
|
|
428
|
+
locale,
|
|
429
|
+
dateFormats,
|
|
430
|
+
currentSlug,
|
|
431
|
+
forceOpen,
|
|
432
|
+
isLast: computed(
|
|
433
|
+
() => index.value === groupItems(
|
|
434
|
+
items.value,
|
|
435
|
+
sidebarStyle.value,
|
|
436
|
+
tray.value.sortOrder ?? "asc"
|
|
437
|
+
).length - 1
|
|
438
|
+
)
|
|
439
|
+
}
|
|
440
|
+
)
|
|
441
|
+
}
|
|
442
|
+
),
|
|
443
|
+
children: () => /* @__PURE__ */ jsx(For, { each: items, by: (item) => item.slug, children: (item, index) => /* @__PURE__ */ jsx(
|
|
444
|
+
TrayItem,
|
|
445
|
+
{
|
|
446
|
+
item,
|
|
447
|
+
currentSlug,
|
|
448
|
+
rankDigits: width,
|
|
449
|
+
isLast: computed(() => index.value === items.value.length - 1),
|
|
450
|
+
locale,
|
|
451
|
+
dateFormats
|
|
452
|
+
}
|
|
453
|
+
) })
|
|
454
|
+
}
|
|
455
|
+
)
|
|
275
456
|
] });
|
|
276
457
|
}
|
|
277
458
|
function TrayItem({
|
|
@@ -284,34 +465,83 @@ function TrayItem({
|
|
|
284
465
|
locale,
|
|
285
466
|
dateFormats
|
|
286
467
|
}) {
|
|
287
|
-
|
|
288
|
-
const
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
return /* @__PURE__ */ jsx("div", {
|
|
292
|
-
/* @__PURE__ */ jsx(
|
|
468
|
+
const active = computed(() => item.value.slug === currentSlug.value);
|
|
469
|
+
const shortDate = computed(
|
|
470
|
+
() => item.value.date ? formatMonthDay(item.value.date, dateFormats?.numericMonthDay, locale) : void 0
|
|
471
|
+
);
|
|
472
|
+
return /* @__PURE__ */ jsx(Show, { when: computed(() => !!item.value.href), children: () => /* @__PURE__ */ jsx("div", { class: computed(() => isLast.value ? "pb-vsp-md" : ""), children: /* @__PURE__ */ jsxs("div", { class: "relative", children: [
|
|
473
|
+
/* @__PURE__ */ jsx(
|
|
474
|
+
ConnectorLinesLive,
|
|
475
|
+
{
|
|
476
|
+
depth,
|
|
477
|
+
isLast,
|
|
478
|
+
topPad: "var(--spacing-vsp-2xs)"
|
|
479
|
+
}
|
|
480
|
+
),
|
|
293
481
|
/* @__PURE__ */ jsxs(
|
|
294
482
|
"a",
|
|
295
483
|
{
|
|
296
|
-
href: item.href,
|
|
297
|
-
"aria-current":
|
|
298
|
-
"data-nav-active":
|
|
299
|
-
|
|
300
|
-
|
|
484
|
+
href: computed(() => item.value.href ?? ""),
|
|
485
|
+
"aria-current": computed(() => active.value ? "page" : "false"),
|
|
486
|
+
"data-nav-active": computed(() => active.value ? "" : null),
|
|
487
|
+
class: computed(
|
|
488
|
+
() => `flex items-start gap-hsp-xs py-vsp-2xs pr-hsp-xs lg:pr-hsp-sm text-small break-words ${active.value ? "bg-fg font-medium text-bg" : "text-muted hover:text-accent hover:underline focus:underline focus:text-accent"}`
|
|
489
|
+
),
|
|
490
|
+
style: { "padding-left": padLeft(depth, false) },
|
|
301
491
|
children: [
|
|
302
|
-
rankDigits !== void 0
|
|
303
|
-
|
|
304
|
-
|
|
492
|
+
rankDigits !== void 0 ? /* @__PURE__ */ jsx(
|
|
493
|
+
"span",
|
|
494
|
+
{
|
|
495
|
+
class: computed(
|
|
496
|
+
() => `shrink-0 tabular-nums${active.value ? "" : " text-muted"}`
|
|
497
|
+
),
|
|
498
|
+
children: computed(
|
|
499
|
+
() => item.value.rank === void 0 ? "" : String(item.value.rank).padStart(rankDigits, "0")
|
|
500
|
+
)
|
|
501
|
+
}
|
|
502
|
+
) : null,
|
|
503
|
+
/* @__PURE__ */ jsx(
|
|
504
|
+
"span",
|
|
505
|
+
{
|
|
506
|
+
class: "min-w-0 flex-1",
|
|
507
|
+
rawHtml: computed(() => smartBreakToHtml(item.value.label))
|
|
508
|
+
}
|
|
509
|
+
),
|
|
510
|
+
/* @__PURE__ */ jsx(Show, { when: computed(() => showDate && !!shortDate.value), children: () => /* @__PURE__ */ jsx(
|
|
511
|
+
"span",
|
|
512
|
+
{
|
|
513
|
+
class: computed(
|
|
514
|
+
() => `shrink-0 tabular-nums${active.value ? "" : " text-muted"}`
|
|
515
|
+
),
|
|
516
|
+
children: shortDate
|
|
517
|
+
}
|
|
518
|
+
) })
|
|
305
519
|
]
|
|
306
520
|
}
|
|
307
521
|
)
|
|
308
|
-
] }) });
|
|
522
|
+
] }) }) });
|
|
523
|
+
}
|
|
524
|
+
function ConnectorLinesLive({
|
|
525
|
+
depth,
|
|
526
|
+
isLast,
|
|
527
|
+
topPad
|
|
528
|
+
}) {
|
|
529
|
+
return /* @__PURE__ */ jsx(
|
|
530
|
+
Show,
|
|
531
|
+
{
|
|
532
|
+
when: isLast,
|
|
533
|
+
fallback: () => /* @__PURE__ */ jsx(ConnectorLines, { depth, isLast: false, topPad }),
|
|
534
|
+
children: () => /* @__PURE__ */ jsx(ConnectorLines, { depth, isLast: true, topPad })
|
|
535
|
+
}
|
|
536
|
+
);
|
|
309
537
|
}
|
|
310
538
|
function noteTrayGroupStorageKey(traySlug, groupKey) {
|
|
311
539
|
return `${traySlug}#${groupKey}`;
|
|
312
540
|
}
|
|
313
541
|
function TrayGroupNode({
|
|
314
542
|
traySlug,
|
|
543
|
+
trayOccurrence,
|
|
544
|
+
scopeControls,
|
|
315
545
|
group,
|
|
316
546
|
grouping,
|
|
317
547
|
locale,
|
|
@@ -320,274 +550,390 @@ function TrayGroupNode({
|
|
|
320
550
|
forceOpen,
|
|
321
551
|
isLast
|
|
322
552
|
}) {
|
|
323
|
-
const
|
|
324
|
-
const
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
553
|
+
const scope = getScope();
|
|
554
|
+
const containsCurrent = computed(
|
|
555
|
+
() => group.value.items.some((item) => item.slug === currentSlug.value)
|
|
556
|
+
);
|
|
557
|
+
const occurrenceKey = computed(() => `${trayOccurrence.value}#${group.value.key}`);
|
|
558
|
+
const open = signal(scopeControls?.expansion.value[occurrenceKey.value] ?? (scopeControls?.defaultGroupOpen(group.value.items) ?? containsCurrent.value));
|
|
559
|
+
const storageKey = computed(
|
|
560
|
+
() => noteTrayGroupStorageKey(traySlug.value, group.value.key)
|
|
561
|
+
);
|
|
562
|
+
const label = computed(
|
|
563
|
+
() => grouping.value === "year" ? formatYearLabel(group.value.key, locale, dateFormats?.year) : formatYearMonthLabel(group.value.key, locale, dateFormats?.yearMonth)
|
|
564
|
+
);
|
|
565
|
+
scope.onActivate(() => {
|
|
566
|
+
if (!scopeControls && getOpenSet().has(storageKey.value)) open.value = true;
|
|
567
|
+
});
|
|
568
|
+
scope.effect(() => {
|
|
569
|
+
if (containsCurrent.value) open.value = true;
|
|
570
|
+
});
|
|
571
|
+
scope.effect(() => {
|
|
572
|
+
if (!scopeControls && open.value) {
|
|
341
573
|
const stored = getOpenSet();
|
|
342
|
-
if (!stored.has(storageKey)) {
|
|
343
|
-
stored.add(storageKey);
|
|
574
|
+
if (!stored.has(storageKey.value)) {
|
|
575
|
+
stored.add(storageKey.value);
|
|
344
576
|
saveOpenSet(stored);
|
|
345
577
|
}
|
|
346
578
|
}
|
|
347
|
-
}
|
|
348
|
-
const toggle =
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
"
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
579
|
+
});
|
|
580
|
+
const toggle = () => {
|
|
581
|
+
open.value = !open.value;
|
|
582
|
+
if (scopeControls) {
|
|
583
|
+
scopeControls.expansion.value = { ...scopeControls.expansion.value, [occurrenceKey.value]: open.value };
|
|
584
|
+
scopeControls.save();
|
|
585
|
+
return;
|
|
586
|
+
}
|
|
587
|
+
const stored = getOpenSet();
|
|
588
|
+
if (open.value) stored.add(storageKey.value);
|
|
589
|
+
else stored.delete(storageKey.value);
|
|
590
|
+
saveOpenSet(stored);
|
|
591
|
+
};
|
|
592
|
+
scope.effect(() => {
|
|
593
|
+
const stored = scopeControls?.expansion.value[occurrenceKey.value];
|
|
594
|
+
if (scopeControls) open.value = stored ?? scopeControls.defaultGroupOpen(group.value.items);
|
|
595
|
+
});
|
|
596
|
+
const expanded = computed(() => forceOpen.value || open.value);
|
|
597
|
+
const items = computed(() => group.value.items);
|
|
598
|
+
return /* @__PURE__ */ jsxs(
|
|
599
|
+
"div",
|
|
600
|
+
{
|
|
601
|
+
class: computed(
|
|
602
|
+
() => !isLast.value && expanded.value ? "relative" : ""
|
|
603
|
+
),
|
|
604
|
+
children: [
|
|
605
|
+
/* @__PURE__ */ jsx(Show, { when: computed(() => !isLast.value && expanded.value), children: () => /* @__PURE__ */ jsx(
|
|
606
|
+
"div",
|
|
607
|
+
{
|
|
608
|
+
class: "absolute border-l border-solid border-muted z-local-1",
|
|
609
|
+
style: { left: connectorLeft(1), top: "0px", bottom: "0px" }
|
|
610
|
+
}
|
|
611
|
+
) }),
|
|
612
|
+
/* @__PURE__ */ jsxs("div", { class: "relative", children: [
|
|
613
|
+
/* @__PURE__ */ jsx(
|
|
614
|
+
ConnectorLinesLive,
|
|
615
|
+
{
|
|
616
|
+
depth: 1,
|
|
617
|
+
isLast,
|
|
618
|
+
topPad: "var(--spacing-vsp-xs)"
|
|
619
|
+
}
|
|
620
|
+
),
|
|
621
|
+
/* @__PURE__ */ jsxs(
|
|
622
|
+
"button",
|
|
623
|
+
{
|
|
624
|
+
type: "button",
|
|
625
|
+
"on:click": toggle,
|
|
626
|
+
class: "flex w-full items-center gap-hsp-md py-vsp-xs text-left text-small font-semibold text-fg hover:text-accent hover:underline focus:underline focus:text-accent break-words",
|
|
627
|
+
style: { "padding-left": padLeft(1, true) },
|
|
628
|
+
"aria-expanded": computed(() => expanded.value ? "true" : "false"),
|
|
629
|
+
"aria-label": computed(
|
|
630
|
+
() => `${expanded.value ? "Collapse" : "Expand"} ${label.value}`
|
|
631
|
+
),
|
|
632
|
+
"data-zd-sidebar-open-key": storageKey,
|
|
633
|
+
children: [
|
|
634
|
+
/* @__PURE__ */ jsx("span", { class: "aspect-square flex items-center justify-center w-[1.5rem] shrink-0 border border-muted", children: /* @__PURE__ */ jsx(ToggleChevron, { isExpanded: expanded, className: "text-muted" }) }),
|
|
635
|
+
/* @__PURE__ */ jsx("span", { children: label })
|
|
636
|
+
]
|
|
637
|
+
}
|
|
638
|
+
)
|
|
639
|
+
] }),
|
|
640
|
+
/* @__PURE__ */ jsx(Show, { when: expanded, children: () => /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(For, { each: items, by: (item) => item.slug, children: (item, index) => /* @__PURE__ */ jsx(
|
|
641
|
+
TrayItem,
|
|
642
|
+
{
|
|
643
|
+
item,
|
|
644
|
+
currentSlug,
|
|
645
|
+
isLast: computed(
|
|
646
|
+
() => index.value === items.value.length - 1
|
|
647
|
+
),
|
|
648
|
+
showDate: true,
|
|
649
|
+
locale,
|
|
650
|
+
dateFormats,
|
|
651
|
+
depth: GROUPED_TRAY_ITEM_DEPTH
|
|
652
|
+
}
|
|
653
|
+
) }) }) })
|
|
654
|
+
]
|
|
655
|
+
}
|
|
656
|
+
);
|
|
400
657
|
}
|
|
401
|
-
|
|
658
|
+
function NodeList({
|
|
402
659
|
nodes,
|
|
403
660
|
currentSlug,
|
|
404
661
|
depth,
|
|
405
|
-
forceOpen
|
|
662
|
+
forceOpen,
|
|
663
|
+
scopeControls
|
|
406
664
|
}) {
|
|
407
|
-
return /* @__PURE__ */ jsx(
|
|
408
|
-
const isLast = index === nodes.length - 1;
|
|
409
|
-
return
|
|
410
|
-
|
|
665
|
+
return /* @__PURE__ */ jsx(For, { each: nodes, by: (node) => node.occurrenceId ?? node.slug, children: (node, index) => {
|
|
666
|
+
const isLast = computed(() => index.value === nodes.value.length - 1);
|
|
667
|
+
return /* @__PURE__ */ jsx(
|
|
668
|
+
Show,
|
|
411
669
|
{
|
|
412
|
-
node,
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
670
|
+
when: computed(() => node.value.children.length > 0),
|
|
671
|
+
fallback: () => /* @__PURE__ */ jsx(
|
|
672
|
+
LeafNode,
|
|
673
|
+
{
|
|
674
|
+
node,
|
|
675
|
+
currentSlug,
|
|
676
|
+
depth,
|
|
677
|
+
isLast,
|
|
678
|
+
forceOpen,
|
|
679
|
+
scopeControls
|
|
680
|
+
}
|
|
681
|
+
),
|
|
682
|
+
children: () => /* @__PURE__ */ jsx(
|
|
683
|
+
CategoryNode,
|
|
684
|
+
{
|
|
685
|
+
node,
|
|
686
|
+
currentSlug,
|
|
687
|
+
depth,
|
|
688
|
+
isLast,
|
|
689
|
+
forceOpen,
|
|
690
|
+
scopeControls
|
|
691
|
+
}
|
|
692
|
+
)
|
|
693
|
+
}
|
|
428
694
|
);
|
|
429
|
-
}
|
|
430
|
-
}
|
|
695
|
+
} });
|
|
696
|
+
}
|
|
431
697
|
function subtreeContainsSlug(node, slug) {
|
|
432
|
-
|
|
433
|
-
if (node.slug === slug) return true;
|
|
434
|
-
return node.children.some((child) => subtreeContainsSlug(child, slug));
|
|
698
|
+
return slug !== void 0 && (node.slug === slug || node.children.some((child) => subtreeContainsSlug(child, slug)));
|
|
435
699
|
}
|
|
436
|
-
|
|
700
|
+
function CategoryNode({
|
|
437
701
|
node,
|
|
438
702
|
currentSlug,
|
|
439
703
|
depth,
|
|
440
704
|
isLast,
|
|
441
|
-
forceOpen
|
|
705
|
+
forceOpen,
|
|
706
|
+
scopeControls
|
|
442
707
|
}) {
|
|
443
|
-
const
|
|
444
|
-
|
|
445
|
-
|
|
708
|
+
const scope = getScope();
|
|
709
|
+
const containsCurrent = computed(
|
|
710
|
+
() => subtreeContainsSlug(node.value, currentSlug.value)
|
|
446
711
|
);
|
|
447
|
-
const
|
|
448
|
-
const
|
|
449
|
-
const
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
712
|
+
const active = computed(() => node.value.slug === currentSlug.value);
|
|
713
|
+
const occurrenceKey = () => node.value.occurrenceId ?? node.value.slug;
|
|
714
|
+
const open = signal(scopeControls?.expansion.value[occurrenceKey()] ?? (scopeControls?.defaultOpen(node.value) ?? (containsCurrent.value || !node.value.collapsed)));
|
|
715
|
+
scope.onActivate(() => {
|
|
716
|
+
if (!scopeControls && getOpenSet().has(node.value.slug)) open.value = true;
|
|
717
|
+
});
|
|
718
|
+
scope.effect(() => {
|
|
719
|
+
const slug = currentSlug.value;
|
|
720
|
+
const revision = scopeControls?.reveal.value;
|
|
721
|
+
if (slug !== void 0 && subtreeContainsSlug(node.value, slug)) open.value = true;
|
|
722
|
+
void revision;
|
|
723
|
+
});
|
|
724
|
+
scope.effect(() => {
|
|
725
|
+
if (!scopeControls && open.value) {
|
|
459
726
|
const stored = getOpenSet();
|
|
460
|
-
stored.
|
|
461
|
-
|
|
462
|
-
}
|
|
463
|
-
}, [currentSlug]);
|
|
464
|
-
useEffect(() => {
|
|
465
|
-
if (open) {
|
|
466
|
-
const stored = getOpenSet();
|
|
467
|
-
if (!stored.has(node.slug)) {
|
|
468
|
-
stored.add(node.slug);
|
|
727
|
+
if (!stored.has(node.value.slug)) {
|
|
728
|
+
stored.add(node.value.slug);
|
|
469
729
|
saveOpenSet(stored);
|
|
470
730
|
}
|
|
471
731
|
}
|
|
472
|
-
}
|
|
473
|
-
const toggle =
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
732
|
+
});
|
|
733
|
+
const toggle = () => {
|
|
734
|
+
open.value = !open.value;
|
|
735
|
+
if (scopeControls) {
|
|
736
|
+
scopeControls.expansion.value = { ...scopeControls.expansion.value, [occurrenceKey()]: open.value };
|
|
737
|
+
scopeControls.save();
|
|
738
|
+
return;
|
|
739
|
+
}
|
|
740
|
+
const stored = getOpenSet();
|
|
741
|
+
if (open.value) stored.add(node.value.slug);
|
|
742
|
+
else stored.delete(node.value.slug);
|
|
743
|
+
saveOpenSet(stored);
|
|
744
|
+
};
|
|
745
|
+
scope.effect(() => {
|
|
746
|
+
const stored = scopeControls?.expansion.value[occurrenceKey()];
|
|
747
|
+
if (scopeControls) open.value = stored ?? scopeControls.defaultOpen(node.value);
|
|
748
|
+
});
|
|
749
|
+
const expanded = computed(() => forceOpen.value || open.value);
|
|
750
|
+
const focusButton = scopeControls ? /* @__PURE__ */ jsx(
|
|
751
|
+
"button",
|
|
752
|
+
{
|
|
753
|
+
type: "button",
|
|
754
|
+
"data-sidebar-focus": true,
|
|
755
|
+
"data-sidebar-focus-scope": computed(() => node.value.occurrenceId ?? ""),
|
|
756
|
+
"on:click": () => scopeControls.focus(node.value),
|
|
757
|
+
"aria-label": computed(() => `${scopeControls.focusLabel}: ${node.value.label}`),
|
|
758
|
+
title: computed(() => `${scopeControls.focusLabel}: ${node.value.label}`),
|
|
759
|
+
class: computed(() => `ml-auto shrink-0 rounded px-hsp-xs py-vsp-2xs ${active.value ? "text-bg hover:bg-bg/10 focus-visible:bg-bg/10" : "text-muted hover:bg-surface hover:text-fg focus-visible:bg-surface focus-visible:text-fg"}`),
|
|
760
|
+
children: /* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: "\u25CE" })
|
|
761
|
+
}
|
|
762
|
+
) : null;
|
|
487
763
|
const paddingLeft = padLeft(depth, true);
|
|
488
|
-
return /* @__PURE__ */ jsxs(
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
/* @__PURE__ */ jsx(ConnectorLines, { depth, isLast, topPad: "calc(0.15rem + var(--spacing-vsp-xs))" }),
|
|
502
|
-
node.href ? /* @__PURE__ */ jsxs(
|
|
503
|
-
"div",
|
|
504
|
-
{
|
|
505
|
-
className: `flex w-full items-center text-small font-semibold pt-[0.15rem] ${isActive ? "bg-fg text-bg" : "text-fg"}`,
|
|
506
|
-
children: [
|
|
507
|
-
/* @__PURE__ */ jsxs(
|
|
508
|
-
"a",
|
|
764
|
+
return /* @__PURE__ */ jsxs(
|
|
765
|
+
"div",
|
|
766
|
+
{
|
|
767
|
+
class: computed(
|
|
768
|
+
() => `${depth === 0 ? "border-t border-muted first:border-t-0" : ""} ${depth >= 1 && !isLast.value ? "relative" : ""}`
|
|
769
|
+
),
|
|
770
|
+
children: [
|
|
771
|
+
/* @__PURE__ */ jsx(
|
|
772
|
+
Show,
|
|
773
|
+
{
|
|
774
|
+
when: computed(() => depth >= 1 && !isLast.value && expanded.value),
|
|
775
|
+
children: () => /* @__PURE__ */ jsx(
|
|
776
|
+
"div",
|
|
509
777
|
{
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
className: `flex-1 flex items-start gap-hsp-xs py-vsp-xs hover:underline focus:underline break-words ${isActive ? "text-bg" : "text-fg hover:text-accent focus:text-accent"}`,
|
|
513
|
-
style: { paddingLeft },
|
|
514
|
-
children: [
|
|
515
|
-
depth === 0 && /* @__PURE__ */ jsx("span", { className: "flex h-[1lh] items-center", children: /* @__PURE__ */ jsx(CategoryLinkIcon, { className: `w-[14px] ${isActive ? "text-bg" : ""}` }) }),
|
|
516
|
-
/* @__PURE__ */ jsx("span", { dangerouslySetInnerHTML: { __html: labelHtml } })
|
|
517
|
-
]
|
|
518
|
-
}
|
|
519
|
-
),
|
|
520
|
-
/* @__PURE__ */ jsx(
|
|
521
|
-
"button",
|
|
522
|
-
{
|
|
523
|
-
type: "button",
|
|
524
|
-
onClick: toggle,
|
|
525
|
-
className: `aspect-square flex items-center justify-center w-[1.5rem] border-y border-l hover:underline focus:underline ${isActive ? "border-bg/30" : "border-muted"}`,
|
|
526
|
-
"aria-expanded": isExpanded,
|
|
527
|
-
"aria-label": isExpanded ? `Collapse ${node.label}` : `Expand ${node.label}`,
|
|
528
|
-
children: /* @__PURE__ */ jsx(ToggleChevron, { isExpanded, className: isActive ? "text-bg" : "text-muted" })
|
|
778
|
+
class: "absolute border-l border-solid border-muted z-local-1",
|
|
779
|
+
style: { left: connectorLeft(depth), top: "0px", bottom: "0px" }
|
|
529
780
|
}
|
|
530
781
|
)
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
782
|
+
}
|
|
783
|
+
),
|
|
784
|
+
/* @__PURE__ */ jsxs("div", { class: "relative", children: [
|
|
785
|
+
/* @__PURE__ */ jsx(
|
|
786
|
+
ConnectorLinesLive,
|
|
787
|
+
{
|
|
788
|
+
depth,
|
|
789
|
+
isLast,
|
|
790
|
+
topPad: "calc(0.15rem + var(--spacing-vsp-xs))"
|
|
791
|
+
}
|
|
792
|
+
),
|
|
793
|
+
/* @__PURE__ */ jsx(
|
|
794
|
+
Show,
|
|
795
|
+
{
|
|
796
|
+
when: computed(() => !!node.value.href),
|
|
797
|
+
fallback: () => /* @__PURE__ */ jsxs("div", { class: "flex flex-wrap items-center", children: [
|
|
798
|
+
/* @__PURE__ */ jsxs(
|
|
799
|
+
"button",
|
|
800
|
+
{
|
|
801
|
+
type: "button",
|
|
802
|
+
"on:click": toggle,
|
|
803
|
+
class: "flex flex-1 max-w-full items-center gap-hsp-md text-left text-small font-semibold py-vsp-xs text-fg hover:text-accent hover:underline focus:underline focus:text-accent break-words",
|
|
804
|
+
style: { "padding-left": paddingLeft },
|
|
805
|
+
"aria-expanded": computed(
|
|
806
|
+
() => expanded.value ? "true" : "false"
|
|
807
|
+
),
|
|
808
|
+
"aria-label": computed(
|
|
809
|
+
() => `${expanded.value ? "Collapse" : "Expand"} ${node.value.label}`
|
|
810
|
+
),
|
|
811
|
+
children: [
|
|
812
|
+
/* @__PURE__ */ jsx("span", { class: "aspect-square flex items-center justify-center w-[1.5rem] shrink-0 border border-muted", children: /* @__PURE__ */ jsx(ToggleChevron, { isExpanded: expanded, className: "text-muted" }) }),
|
|
813
|
+
/* @__PURE__ */ jsx(
|
|
814
|
+
"span",
|
|
815
|
+
{
|
|
816
|
+
rawHtml: computed(() => smartBreakToHtml(node.value.label))
|
|
817
|
+
}
|
|
818
|
+
)
|
|
819
|
+
]
|
|
820
|
+
}
|
|
821
|
+
),
|
|
822
|
+
focusButton
|
|
823
|
+
] }),
|
|
824
|
+
children: () => /* @__PURE__ */ jsxs(
|
|
825
|
+
"div",
|
|
826
|
+
{
|
|
827
|
+
class: computed(
|
|
828
|
+
() => `flex w-full items-center text-small font-semibold pt-[0.15rem] ${active.value ? "bg-fg text-bg" : "text-fg"}`
|
|
829
|
+
),
|
|
830
|
+
children: [
|
|
831
|
+
/* @__PURE__ */ jsxs(
|
|
832
|
+
"a",
|
|
833
|
+
{
|
|
834
|
+
href: computed(() => node.value.href ?? ""),
|
|
835
|
+
"aria-current": computed(() => active.value ? "page" : "false"),
|
|
836
|
+
class: computed(
|
|
837
|
+
() => `flex-1 flex items-start gap-hsp-xs py-vsp-xs hover:underline focus:underline break-words ${active.value ? "text-bg" : "text-fg hover:text-accent focus:text-accent"}`
|
|
838
|
+
),
|
|
839
|
+
style: { "padding-left": paddingLeft },
|
|
840
|
+
children: [
|
|
841
|
+
depth === 0 ? /* @__PURE__ */ jsx("span", { class: "flex h-[1lh] items-center", children: /* @__PURE__ */ jsx(CategoryLinkIcon, { class: "w-[14px]" }) }) : null,
|
|
842
|
+
/* @__PURE__ */ jsx(
|
|
843
|
+
"span",
|
|
844
|
+
{
|
|
845
|
+
rawHtml: computed(() => smartBreakToHtml(node.value.label))
|
|
846
|
+
}
|
|
847
|
+
)
|
|
848
|
+
]
|
|
849
|
+
}
|
|
850
|
+
),
|
|
851
|
+
focusButton,
|
|
852
|
+
/* @__PURE__ */ jsx(
|
|
853
|
+
"button",
|
|
854
|
+
{
|
|
855
|
+
type: "button",
|
|
856
|
+
"on:click": toggle,
|
|
857
|
+
class: computed(
|
|
858
|
+
() => `aspect-square flex items-center justify-center w-[1.5rem] border-y border-l hover:underline focus:underline ${active.value ? "border-bg/30" : "border-muted"}`
|
|
859
|
+
),
|
|
860
|
+
"aria-expanded": computed(
|
|
861
|
+
() => expanded.value ? "true" : "false"
|
|
862
|
+
),
|
|
863
|
+
"aria-label": computed(
|
|
864
|
+
() => `${expanded.value ? "Collapse" : "Expand"} ${node.value.label}`
|
|
865
|
+
),
|
|
866
|
+
children: /* @__PURE__ */ jsx(
|
|
867
|
+
ToggleChevron,
|
|
868
|
+
{
|
|
869
|
+
isExpanded: expanded,
|
|
870
|
+
className: computed(
|
|
871
|
+
() => active.value ? "text-bg" : "text-muted"
|
|
872
|
+
)
|
|
873
|
+
}
|
|
874
|
+
)
|
|
875
|
+
}
|
|
876
|
+
)
|
|
877
|
+
]
|
|
878
|
+
}
|
|
879
|
+
)
|
|
880
|
+
}
|
|
881
|
+
)
|
|
882
|
+
] }),
|
|
883
|
+
/* @__PURE__ */ jsx(Show, { when: expanded, children: () => /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
|
|
884
|
+
NodeList,
|
|
885
|
+
{
|
|
886
|
+
nodes: computed(() => node.value.children),
|
|
887
|
+
currentSlug,
|
|
888
|
+
depth: depth + 1,
|
|
889
|
+
forceOpen,
|
|
890
|
+
scopeControls
|
|
891
|
+
}
|
|
892
|
+
) }) })
|
|
893
|
+
]
|
|
894
|
+
}
|
|
895
|
+
);
|
|
896
|
+
}
|
|
897
|
+
function LeafNode({ node, currentSlug, depth, isLast }) {
|
|
898
|
+
const active = computed(() => node.value.slug === currentSlug.value);
|
|
569
899
|
const isRoot = depth === 0;
|
|
570
900
|
const paddingLeft = padLeft(depth, isRoot);
|
|
571
|
-
const outerClass = isRoot ? "border-t border-muted" : !isRoot && isLast ? "pb-vsp-md" : "";
|
|
572
901
|
const topPad = isRoot ? "calc(var(--spacing-vsp-xs) + 0.15rem)" : "var(--spacing-vsp-2xs)";
|
|
573
|
-
return /* @__PURE__ */ jsx(
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
}
|
|
902
|
+
return /* @__PURE__ */ jsx(Show, { when: computed(() => !!node.value.href), children: () => /* @__PURE__ */ jsx(
|
|
903
|
+
"div",
|
|
904
|
+
{
|
|
905
|
+
class: computed(
|
|
906
|
+
() => isRoot ? "border-t border-muted first:border-t-0" : isLast.value ? "pb-vsp-md" : ""
|
|
907
|
+
),
|
|
908
|
+
children: /* @__PURE__ */ jsxs("div", { class: "relative", children: [
|
|
909
|
+
/* @__PURE__ */ jsx(ConnectorLinesLive, { depth, isLast, topPad }),
|
|
910
|
+
/* @__PURE__ */ jsxs(
|
|
911
|
+
"a",
|
|
912
|
+
{
|
|
913
|
+
href: computed(() => node.value.href ?? ""),
|
|
914
|
+
"aria-current": computed(() => active.value ? "page" : "false"),
|
|
915
|
+
"data-nav-active": computed(
|
|
916
|
+
() => !isRoot && active.value ? "" : null
|
|
917
|
+
),
|
|
918
|
+
class: computed(
|
|
919
|
+
() => isRoot ? `flex items-start gap-hsp-xs py-[calc(var(--spacing-vsp-xs)_+_0.15rem)] pr-hsp-xs lg:pr-hsp-sm text-small font-semibold break-words ${active.value ? "bg-fg text-bg" : "text-fg hover:text-accent hover:underline focus:underline focus:text-accent"}` : `block py-vsp-2xs pr-hsp-xs lg:pr-hsp-sm text-small break-words ${active.value ? "bg-fg font-medium text-bg" : "text-muted hover:text-accent hover:underline focus:underline focus:text-accent"}`
|
|
920
|
+
),
|
|
921
|
+
style: { "padding-left": paddingLeft },
|
|
922
|
+
children: [
|
|
923
|
+
isRoot ? /* @__PURE__ */ jsx("span", { class: "flex h-[1lh] items-center", children: /* @__PURE__ */ jsx(CategoryLinkIcon, { class: "w-[14px]" }) }) : null,
|
|
924
|
+
/* @__PURE__ */ jsx(
|
|
925
|
+
"span",
|
|
926
|
+
{
|
|
927
|
+
rawHtml: computed(() => smartBreakToHtml(node.value.label))
|
|
928
|
+
}
|
|
929
|
+
)
|
|
930
|
+
]
|
|
931
|
+
}
|
|
932
|
+
)
|
|
933
|
+
] })
|
|
934
|
+
}
|
|
935
|
+
) });
|
|
936
|
+
}
|
|
591
937
|
export {
|
|
592
938
|
SidebarTree
|
|
593
939
|
};
|