@takazudo/zudo-doc 5.28.2 → 6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -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/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 +28 -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 +2933 -2943
- 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 +70 -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 +1 -2
- package/dist/header-with-defaults/index.js +18 -8
- 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/index.d.ts +1 -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-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/index.ts +1 -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,145 +1,216 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx, jsxs } from "
|
|
3
|
-
import {
|
|
2
|
+
import { jsx, jsxs } from "@takazudo/zfb/zudo-react/jsx-runtime";
|
|
3
|
+
import {
|
|
4
|
+
batch,
|
|
5
|
+
computed,
|
|
6
|
+
For,
|
|
7
|
+
getScope,
|
|
8
|
+
Show,
|
|
9
|
+
signal
|
|
10
|
+
} from "@takazudo/zfb/zudo-react";
|
|
4
11
|
import { renderMarkdown } from "../render-markdown/index.js";
|
|
5
12
|
import { SmartBreak } from "../smart-break/index.js";
|
|
6
13
|
import { BEFORE_NAVIGATE_EVENT } from "../transitions/index.js";
|
|
7
|
-
import {
|
|
14
|
+
import { modalDialog } from "../use-modal-dialog/index.js";
|
|
8
15
|
function isAiChatResponse(data) {
|
|
9
16
|
return typeof data === "object" && data !== null;
|
|
10
17
|
}
|
|
11
|
-
|
|
18
|
+
function ChatMessageRow({ msg }) {
|
|
12
19
|
return /* @__PURE__ */ jsxs(
|
|
13
20
|
"div",
|
|
14
21
|
{
|
|
15
|
-
|
|
22
|
+
class: `mb-vsp-xs flex ${msg.role === "user" ? "justify-end" : "justify-start"}`,
|
|
16
23
|
children: [
|
|
17
|
-
/* @__PURE__ */ jsx("span", {
|
|
18
|
-
msg.role === "user" ? /* @__PURE__ */ jsx("div", {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
+
/* @__PURE__ */ jsx("span", { class: "sr-only", children: msg.role === "user" ? "You: " : "Assistant: " }),
|
|
25
|
+
msg.role === "user" ? /* @__PURE__ */ jsx("div", { class: "max-w-[85%] rounded-t-[1rem] rounded-bl-[1rem] rounded-br-[0.25rem] bg-chat-user-bg px-hsp-md py-vsp-2xs text-small leading-relaxed text-chat-user-text", children: /* @__PURE__ */ jsx(SmartBreak, { children: msg.content }) }) : (
|
|
26
|
+
// `renderMarkdown` escapes authored content before adding its small,
|
|
27
|
+
// protocol-checked tag allowlist. This generated HTML is the only
|
|
28
|
+
// payload assigned to rawHtml; the opaque subtree has no owned children.
|
|
29
|
+
/* @__PURE__ */ jsx(
|
|
30
|
+
"div",
|
|
31
|
+
{
|
|
32
|
+
class: "ai-chat-md max-w-[85%] rounded-t-[1rem] rounded-br-[1rem] rounded-bl-[0.25rem] bg-chat-assistant-bg px-hsp-md py-vsp-2xs text-small leading-relaxed text-chat-assistant-text",
|
|
33
|
+
rawHtml: renderMarkdown(msg.content)
|
|
34
|
+
}
|
|
35
|
+
)
|
|
24
36
|
)
|
|
25
37
|
]
|
|
26
38
|
}
|
|
27
39
|
);
|
|
28
|
-
}
|
|
40
|
+
}
|
|
29
41
|
function AiChatModal({ basePath }) {
|
|
30
|
-
const
|
|
31
|
-
const
|
|
32
|
-
const
|
|
33
|
-
const
|
|
34
|
-
const
|
|
35
|
-
const
|
|
36
|
-
const
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
const
|
|
42
|
+
const scope = getScope();
|
|
43
|
+
const messagesEndRef = { current: null };
|
|
44
|
+
const inputRef = { current: null };
|
|
45
|
+
const isOpen = signal(false);
|
|
46
|
+
const messages = signal([]);
|
|
47
|
+
const input = signal("");
|
|
48
|
+
const loading = signal(false);
|
|
49
|
+
const error = signal(null);
|
|
50
|
+
const isComposing = signal(false);
|
|
51
|
+
let nextMessageId = 0;
|
|
52
|
+
let requestVersion = 0;
|
|
53
|
+
let activeRequest = null;
|
|
54
|
+
let cleanupActiveRequest = null;
|
|
55
|
+
const busy = computed(() => loading.value);
|
|
56
|
+
const sendDisabled = computed(() => busy.value || input.value.trim().length === 0);
|
|
57
|
+
const showEmptyState = computed(() => messages.value.length === 0 && !busy.value);
|
|
58
|
+
const hasError = computed(() => error.value !== null);
|
|
59
|
+
const latestAssistantMessage = computed(() => {
|
|
60
|
+
const current = messages.value;
|
|
61
|
+
for (let index = current.length - 1; index >= 0; index--) {
|
|
62
|
+
const message = current[index];
|
|
63
|
+
if (message?.role === "assistant") return message.content;
|
|
64
|
+
}
|
|
65
|
+
return "";
|
|
66
|
+
});
|
|
67
|
+
const cancelActiveRequest = () => {
|
|
68
|
+
requestVersion++;
|
|
69
|
+
activeRequest?.abort();
|
|
70
|
+
cleanupActiveRequest?.();
|
|
71
|
+
activeRequest = null;
|
|
72
|
+
cleanupActiveRequest = null;
|
|
73
|
+
};
|
|
74
|
+
const resetState = () => {
|
|
75
|
+
cancelActiveRequest();
|
|
76
|
+
batch(() => {
|
|
77
|
+
isOpen.value = false;
|
|
78
|
+
messages.value = [];
|
|
79
|
+
input.value = "";
|
|
80
|
+
error.value = null;
|
|
81
|
+
loading.value = false;
|
|
82
|
+
isComposing.value = false;
|
|
83
|
+
});
|
|
84
|
+
};
|
|
85
|
+
const { dialogRef, handleBackdropClick } = modalDialog(scope, {
|
|
45
86
|
isOpen,
|
|
46
87
|
onClose: resetState,
|
|
47
88
|
navigateEvent: BEFORE_NAVIGATE_EVENT,
|
|
48
89
|
backdropClickClose: true,
|
|
49
90
|
restoreFocusOnly: true
|
|
50
91
|
});
|
|
51
|
-
|
|
52
|
-
|
|
92
|
+
scope.onActivate(() => {
|
|
93
|
+
const handleToggle = (_event) => {
|
|
53
94
|
const dialog = dialogRef.current;
|
|
54
|
-
if (!dialog
|
|
95
|
+
if (!dialog?.isConnected) return;
|
|
55
96
|
if (dialog.open) {
|
|
56
97
|
dialog.close();
|
|
57
98
|
} else {
|
|
58
|
-
|
|
99
|
+
isOpen.value = true;
|
|
59
100
|
}
|
|
60
|
-
}
|
|
101
|
+
};
|
|
61
102
|
window.addEventListener("toggle-ai-chat", handleToggle);
|
|
62
103
|
return () => window.removeEventListener("toggle-ai-chat", handleToggle);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
104
|
+
});
|
|
105
|
+
scope.onCleanup(cancelActiveRequest);
|
|
106
|
+
scope.effect(() => {
|
|
107
|
+
if (isOpen.value) inputRef.current?.focus();
|
|
108
|
+
});
|
|
109
|
+
scope.effect(() => {
|
|
110
|
+
messages.value;
|
|
111
|
+
loading.value;
|
|
112
|
+
messagesEndRef.current?.scrollIntoView?.({ behavior: "smooth" });
|
|
113
|
+
});
|
|
114
|
+
const sendMessage = async () => {
|
|
115
|
+
const trimmed = input.value.trim();
|
|
116
|
+
if (!trimmed || loading.value || isComposing.value || scope.abortSignal.aborted) {
|
|
117
|
+
return;
|
|
67
118
|
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
const
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
119
|
+
const requestMessages = messages.value.map(({ role, content }) => ({ role, content }));
|
|
120
|
+
const userMessage = {
|
|
121
|
+
id: ++nextMessageId,
|
|
122
|
+
role: "user",
|
|
123
|
+
content: trimmed
|
|
124
|
+
};
|
|
125
|
+
const controller = new AbortController();
|
|
126
|
+
const currentRequest = ++requestVersion;
|
|
127
|
+
activeRequest = controller;
|
|
128
|
+
const abortForScope = () => controller.abort();
|
|
129
|
+
scope.abortSignal.addEventListener("abort", abortForScope, { once: true });
|
|
130
|
+
const cleanupScopeAbort = () => scope.abortSignal.removeEventListener("abort", abortForScope);
|
|
131
|
+
cleanupActiveRequest = cleanupScopeAbort;
|
|
132
|
+
const isCurrentRequest = () => currentRequest === requestVersion && activeRequest === controller && !controller.signal.aborted && !scope.abortSignal.aborted;
|
|
133
|
+
let assistantMessage = null;
|
|
134
|
+
let responseError;
|
|
135
|
+
batch(() => {
|
|
136
|
+
messages.value = [...messages.value, userMessage];
|
|
137
|
+
input.value = "";
|
|
138
|
+
error.value = null;
|
|
139
|
+
loading.value = true;
|
|
140
|
+
});
|
|
81
141
|
try {
|
|
82
142
|
const base = basePath.replace(/\/+$/, "");
|
|
83
|
-
const
|
|
143
|
+
const response = await fetch(`${base}/api/ai-chat`, {
|
|
84
144
|
method: "POST",
|
|
85
145
|
headers: { "Content-Type": "application/json" },
|
|
86
|
-
body: JSON.stringify({
|
|
87
|
-
|
|
88
|
-
history: messages
|
|
89
|
-
})
|
|
146
|
+
body: JSON.stringify({ message: trimmed, history: requestMessages }),
|
|
147
|
+
signal: controller.signal
|
|
90
148
|
});
|
|
91
|
-
|
|
149
|
+
if (!isCurrentRequest()) return;
|
|
150
|
+
const raw = await response.json();
|
|
151
|
+
if (!isCurrentRequest()) return;
|
|
92
152
|
const data = isAiChatResponse(raw) ? raw : {};
|
|
93
|
-
if (!
|
|
94
|
-
|
|
153
|
+
if (!response.ok) {
|
|
154
|
+
responseError = ("error" in data && typeof data.error === "string" ? data.error : null) || "Something went wrong";
|
|
95
155
|
} else if ("response" in data && typeof data.response === "string" && data.response) {
|
|
96
|
-
|
|
97
|
-
...prev,
|
|
98
|
-
{ role: "assistant", content: data.response }
|
|
99
|
-
]);
|
|
156
|
+
assistantMessage = { id: ++nextMessageId, role: "assistant", content: data.response };
|
|
100
157
|
} else {
|
|
101
|
-
|
|
158
|
+
responseError = "Received an empty or invalid response";
|
|
102
159
|
}
|
|
103
160
|
} catch {
|
|
104
|
-
|
|
161
|
+
if (isCurrentRequest()) responseError = "Failed to connect to the AI assistant";
|
|
105
162
|
} finally {
|
|
106
|
-
|
|
163
|
+
cleanupScopeAbort();
|
|
164
|
+
if (activeRequest === controller) cleanupActiveRequest = null;
|
|
165
|
+
if (isCurrentRequest()) {
|
|
166
|
+
activeRequest = null;
|
|
167
|
+
batch(() => {
|
|
168
|
+
if (assistantMessage) messages.value = [...messages.value, assistantMessage];
|
|
169
|
+
if (responseError !== void 0) error.value = responseError;
|
|
170
|
+
loading.value = false;
|
|
171
|
+
});
|
|
172
|
+
}
|
|
107
173
|
}
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
174
|
+
};
|
|
175
|
+
const handleKeyDown = (event) => {
|
|
176
|
+
const keyboard = event;
|
|
177
|
+
if (keyboard.key !== "Enter" || keyboard.shiftKey || keyboard.isComposing || isComposing.value || event.defaultPrevented) {
|
|
178
|
+
return;
|
|
113
179
|
}
|
|
114
|
-
|
|
180
|
+
event.preventDefault();
|
|
181
|
+
void sendMessage();
|
|
182
|
+
};
|
|
183
|
+
const handleSendClick = (event) => {
|
|
184
|
+
if (event.defaultPrevented || isComposing.value) return;
|
|
185
|
+
void sendMessage();
|
|
186
|
+
};
|
|
115
187
|
return /* @__PURE__ */ jsx(
|
|
116
188
|
"dialog",
|
|
117
189
|
{
|
|
118
190
|
ref: dialogRef,
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
children: /* @__PURE__ */ jsxs("div", {
|
|
122
|
-
/* @__PURE__ */ jsxs("div", {
|
|
123
|
-
/* @__PURE__ */ jsx("h2", {
|
|
191
|
+
"on:click": handleBackdropClick,
|
|
192
|
+
class: "z-modal m-0 h-dvh max-h-none w-dvw max-w-none border-none bg-surface p-0 text-fg backdrop:z-modal-backdrop backdrop:bg-bg/80 lg:m-auto lg:h-[90vh] lg:max-h-[90vh] lg:w-[90vw] lg:max-w-[52.5rem] lg:border-solid lg:border lg:border-fg",
|
|
193
|
+
children: /* @__PURE__ */ jsxs("div", { class: "flex h-full flex-col", children: [
|
|
194
|
+
/* @__PURE__ */ jsxs("div", { class: "flex shrink-0 items-center justify-between border-b border-muted px-hsp-lg py-vsp-xs", children: [
|
|
195
|
+
/* @__PURE__ */ jsx("h2", { class: "text-title font-bold text-fg", children: "AI Assistant" }),
|
|
124
196
|
/* @__PURE__ */ jsx(
|
|
125
197
|
"button",
|
|
126
198
|
{
|
|
127
199
|
type: "button",
|
|
128
|
-
|
|
129
|
-
|
|
200
|
+
"on:click": () => dialogRef.current?.close(),
|
|
201
|
+
class: "flex items-center justify-center text-muted transition-colors duration-0 hover:text-fg",
|
|
130
202
|
"aria-label": "Close",
|
|
131
203
|
children: /* @__PURE__ */ jsxs(
|
|
132
204
|
"svg",
|
|
133
205
|
{
|
|
134
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
135
206
|
width: "20",
|
|
136
207
|
height: "20",
|
|
137
208
|
viewBox: "0 0 24 24",
|
|
138
209
|
fill: "none",
|
|
139
210
|
stroke: "currentColor",
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
211
|
+
"stroke-width": "2",
|
|
212
|
+
"stroke-linecap": "round",
|
|
213
|
+
"stroke-linejoin": "round",
|
|
143
214
|
"aria-hidden": "true",
|
|
144
215
|
children: [
|
|
145
216
|
/* @__PURE__ */ jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
|
|
@@ -150,79 +221,69 @@ function AiChatModal({ basePath }) {
|
|
|
150
221
|
}
|
|
151
222
|
)
|
|
152
223
|
] }),
|
|
153
|
-
/* @__PURE__ */ jsxs("div", { role: "log", "aria-label": "Chat messages",
|
|
154
|
-
|
|
155
|
-
messages.
|
|
156
|
-
/* @__PURE__ */ jsx(
|
|
157
|
-
|
|
158
|
-
{
|
|
159
|
-
"aria-live": "polite",
|
|
160
|
-
"aria-atomic": "true",
|
|
161
|
-
className: "sr-only",
|
|
162
|
-
children: (() => {
|
|
163
|
-
for (let i = messages.length - 1; i >= 0; i--) {
|
|
164
|
-
const msg = messages[i];
|
|
165
|
-
if (msg && msg.role === "assistant") return msg.content;
|
|
166
|
-
}
|
|
167
|
-
return "";
|
|
168
|
-
})()
|
|
169
|
-
}
|
|
170
|
-
),
|
|
171
|
-
loading && /* @__PURE__ */ jsx("div", { className: "mb-vsp-xs flex justify-start", children: /* @__PURE__ */ jsx(
|
|
224
|
+
/* @__PURE__ */ jsxs("div", { role: "log", "aria-label": "Chat messages", class: "flex-1 overflow-y-auto px-hsp-lg py-vsp-sm", children: [
|
|
225
|
+
/* @__PURE__ */ jsx(Show, { when: showEmptyState, children: () => /* @__PURE__ */ jsx("p", { class: "py-vsp-xl text-center text-small text-muted", children: "Ask a question about the documentation." }) }),
|
|
226
|
+
/* @__PURE__ */ jsx(For, { each: messages, by: (message) => message.id, children: (message) => /* @__PURE__ */ jsx(ChatMessageRow, { msg: message.value }) }),
|
|
227
|
+
/* @__PURE__ */ jsx("div", { "aria-live": "polite", "aria-atomic": "true", class: "sr-only", children: latestAssistantMessage }),
|
|
228
|
+
/* @__PURE__ */ jsx(Show, { when: busy, children: () => /* @__PURE__ */ jsx("div", { class: "mb-vsp-xs flex justify-start", children: /* @__PURE__ */ jsx(
|
|
172
229
|
"div",
|
|
173
230
|
{
|
|
174
231
|
role: "status",
|
|
175
|
-
|
|
232
|
+
class: "rounded-t-[1rem] rounded-br-[1rem] rounded-bl-[0.25rem] bg-chat-assistant-bg px-hsp-md py-vsp-2xs text-small text-muted",
|
|
176
233
|
children: "Thinking..."
|
|
177
234
|
}
|
|
178
|
-
) }),
|
|
179
|
-
|
|
235
|
+
) }) }),
|
|
236
|
+
/* @__PURE__ */ jsx(Show, { when: hasError, children: () => /* @__PURE__ */ jsx(
|
|
180
237
|
"div",
|
|
181
238
|
{
|
|
182
239
|
role: "alert",
|
|
183
|
-
|
|
184
|
-
children: error
|
|
240
|
+
class: "mb-vsp-xs rounded-[0.75rem] border border-danger bg-bg px-hsp-md py-vsp-2xs text-small text-danger",
|
|
241
|
+
children: computed(() => error.value ?? "")
|
|
185
242
|
}
|
|
186
|
-
),
|
|
243
|
+
) }),
|
|
187
244
|
/* @__PURE__ */ jsx("div", { ref: messagesEndRef })
|
|
188
245
|
] }),
|
|
189
|
-
/* @__PURE__ */ jsx("div", {
|
|
246
|
+
/* @__PURE__ */ jsx("div", { class: "shrink-0 border-t border-muted px-hsp-lg py-vsp-xs", children: /* @__PURE__ */ jsxs("div", { class: "flex items-center gap-x-hsp-sm", children: [
|
|
190
247
|
/* @__PURE__ */ jsx(
|
|
191
248
|
"input",
|
|
192
249
|
{
|
|
193
250
|
ref: inputRef,
|
|
194
251
|
type: "text",
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
252
|
+
modelValue: input,
|
|
253
|
+
"on:compositionstart": () => {
|
|
254
|
+
isComposing.value = true;
|
|
255
|
+
},
|
|
256
|
+
"on:compositionend": () => {
|
|
257
|
+
isComposing.value = false;
|
|
258
|
+
},
|
|
259
|
+
"on:keydown": handleKeyDown,
|
|
260
|
+
disabled: busy,
|
|
199
261
|
"aria-label": "Type your message",
|
|
200
|
-
"aria-busy":
|
|
262
|
+
"aria-busy": busy,
|
|
201
263
|
placeholder: "Type your message...",
|
|
202
|
-
|
|
264
|
+
class: "flex-1 rounded-full border border-muted bg-bg px-hsp-lg py-vsp-2xs text-small text-fg placeholder:text-muted focus:border-accent focus:outline-none disabled:opacity-50"
|
|
203
265
|
}
|
|
204
266
|
),
|
|
205
267
|
/* @__PURE__ */ jsx(
|
|
206
268
|
"button",
|
|
207
269
|
{
|
|
208
270
|
type: "button",
|
|
209
|
-
|
|
210
|
-
disabled:
|
|
211
|
-
"aria-busy":
|
|
212
|
-
|
|
271
|
+
"on:click": handleSendClick,
|
|
272
|
+
disabled: sendDisabled,
|
|
273
|
+
"aria-busy": busy,
|
|
274
|
+
class: "flex h-[2rem] w-[2rem] shrink-0 items-center justify-center rounded-full bg-accent text-bg transition-colors duration-0 hover:bg-accent-hover disabled:opacity-50",
|
|
213
275
|
"aria-label": "Send message",
|
|
214
276
|
children: /* @__PURE__ */ jsxs(
|
|
215
277
|
"svg",
|
|
216
278
|
{
|
|
217
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
218
279
|
width: "16",
|
|
219
280
|
height: "16",
|
|
220
281
|
viewBox: "0 0 24 24",
|
|
221
282
|
fill: "none",
|
|
222
283
|
stroke: "currentColor",
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
284
|
+
"stroke-width": "2",
|
|
285
|
+
"stroke-linecap": "round",
|
|
286
|
+
"stroke-linejoin": "round",
|
|
226
287
|
"aria-hidden": "true",
|
|
227
288
|
children: [
|
|
228
289
|
/* @__PURE__ */ jsx("line", { x1: "22", y1: "2", x2: "11", y2: "13" }),
|
|
@@ -237,7 +298,6 @@ function AiChatModal({ basePath }) {
|
|
|
237
298
|
}
|
|
238
299
|
);
|
|
239
300
|
}
|
|
240
|
-
AiChatModal.displayName = "AiChatModal";
|
|
241
301
|
export {
|
|
242
302
|
AiChatModal
|
|
243
303
|
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/** @jsxRuntime automatic */
|
|
2
|
-
|
|
3
|
-
import type { JSX } from "preact";
|
|
2
|
+
import type { JSX } from "@takazudo/zfb/zudo-react/jsx-runtime";
|
|
4
3
|
import { type AssetComponentContext } from "./shared.js";
|
|
5
4
|
export interface AssetCardProps {
|
|
6
5
|
src: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx, jsxs } from "
|
|
1
|
+
import { jsx, jsxs } from "@takazudo/zfb/zudo-react/jsx-runtime";
|
|
2
2
|
import { assetRawHref, assetViewerHref } from "../asset-path/index.js";
|
|
3
3
|
import {
|
|
4
4
|
AssetFileIcon,
|
|
@@ -39,23 +39,23 @@ function createAssetCard(context) {
|
|
|
39
39
|
)
|
|
40
40
|
].filter((value) => value !== void 0);
|
|
41
41
|
const finalDescription = description ?? entry.description;
|
|
42
|
-
return /* @__PURE__ */ jsx("article", {
|
|
43
|
-
/* @__PURE__ */ jsx("span", {
|
|
44
|
-
/* @__PURE__ */ jsxs("div", {
|
|
45
|
-
/* @__PURE__ */ jsxs("div", {
|
|
46
|
-
entry.dir ? /* @__PURE__ */ jsxs("span", {
|
|
42
|
+
return /* @__PURE__ */ jsx("article", { class: "rounded-lg border border-muted bg-surface px-hsp-lg py-vsp-sm", children: /* @__PURE__ */ jsxs("div", { class: "flex items-start gap-x-hsp-md", children: [
|
|
43
|
+
/* @__PURE__ */ jsx("span", { class: "flex h-icon-lg w-icon-lg shrink-0 items-center justify-center text-muted", children: /* @__PURE__ */ jsx(AssetFileIcon, { class: "h-icon-lg w-icon-lg" }) }),
|
|
44
|
+
/* @__PURE__ */ jsxs("div", { class: "min-w-0 flex-1", children: [
|
|
45
|
+
/* @__PURE__ */ jsxs("div", { class: "font-mono text-small text-fg", children: [
|
|
46
|
+
entry.dir ? /* @__PURE__ */ jsxs("span", { class: "text-muted", children: [
|
|
47
47
|
entry.dir,
|
|
48
48
|
"/"
|
|
49
49
|
] }) : null,
|
|
50
50
|
/* @__PURE__ */ jsx("strong", { children: title ?? entry.name })
|
|
51
51
|
] }),
|
|
52
|
-
/* @__PURE__ */ jsx("div", {
|
|
53
|
-
finalDescription ? /* @__PURE__ */ jsx("p", {
|
|
54
|
-
/* @__PURE__ */ jsxs("div", {
|
|
52
|
+
/* @__PURE__ */ jsx("div", { class: "mt-vsp-3xs text-caption text-muted", children: details.join(" \xB7 ") }),
|
|
53
|
+
finalDescription ? /* @__PURE__ */ jsx("p", { class: "mt-vsp-xs text-small text-muted", children: finalDescription }) : null,
|
|
54
|
+
/* @__PURE__ */ jsxs("div", { class: "mt-vsp-xs flex gap-x-hsp-lg text-caption", children: [
|
|
55
55
|
/* @__PURE__ */ jsxs(
|
|
56
56
|
"a",
|
|
57
57
|
{
|
|
58
|
-
|
|
58
|
+
class: "text-fg hover:text-accent focus-visible:text-accent hover:underline focus-visible:underline",
|
|
59
59
|
href: viewerHref,
|
|
60
60
|
children: [
|
|
61
61
|
assetComponentText(
|
|
@@ -70,9 +70,9 @@ function createAssetCard(context) {
|
|
|
70
70
|
/* @__PURE__ */ jsxs(
|
|
71
71
|
"a",
|
|
72
72
|
{
|
|
73
|
-
|
|
73
|
+
class: "text-fg hover:text-accent focus-visible:text-accent hover:underline focus-visible:underline",
|
|
74
74
|
href: rawHref,
|
|
75
|
-
download:
|
|
75
|
+
download: "",
|
|
76
76
|
children: [
|
|
77
77
|
assetComponentText(
|
|
78
78
|
context,
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/** @jsxRuntime automatic */
|
|
2
|
-
|
|
3
|
-
import type { JSX } from "preact";
|
|
2
|
+
import type { JSX } from "@takazudo/zfb/zudo-react/jsx-runtime";
|
|
4
3
|
import { type AssetComponentContext } from "./shared.js";
|
|
5
4
|
export interface AssetCodeProps {
|
|
6
5
|
src: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx, jsxs } from "
|
|
1
|
+
import { jsx, jsxs } from "@takazudo/zfb/zudo-react/jsx-runtime";
|
|
2
2
|
import { assetViewerHref } from "../asset-path/index.js";
|
|
3
3
|
import {
|
|
4
4
|
AssetFileIcon,
|
|
@@ -49,22 +49,22 @@ function createAssetCode(context) {
|
|
|
49
49
|
});
|
|
50
50
|
const shown = Math.max(0, excerpt.endLine - excerpt.startLine + 1);
|
|
51
51
|
const rangeLabel = requested.end === void 0 ? `lines ${requested.start}\u2013end` : requested.start === requested.end ? `line ${requested.start}` : `lines ${requested.start}\u2013${requested.end}`;
|
|
52
|
-
return /* @__PURE__ */ jsxs("section", {
|
|
53
|
-
/* @__PURE__ */ jsxs("header", {
|
|
54
|
-
/* @__PURE__ */ jsxs("span", {
|
|
55
|
-
/* @__PURE__ */ jsx(AssetFileIcon, {
|
|
52
|
+
return /* @__PURE__ */ jsxs("section", { class: "overflow-hidden rounded-lg border border-muted bg-surface", children: [
|
|
53
|
+
/* @__PURE__ */ jsxs("header", { class: "flex items-center justify-between gap-x-hsp-md border-b border-muted px-hsp-lg py-vsp-2xs text-caption", children: [
|
|
54
|
+
/* @__PURE__ */ jsxs("span", { class: "flex min-w-0 items-center gap-x-hsp-xs font-mono text-fg", children: [
|
|
55
|
+
/* @__PURE__ */ jsx(AssetFileIcon, { class: "h-icon-sm w-icon-sm shrink-0" }),
|
|
56
56
|
/* @__PURE__ */ jsx("span", { children: title ?? resolved.path })
|
|
57
57
|
] }),
|
|
58
|
-
/* @__PURE__ */ jsx("span", {
|
|
58
|
+
/* @__PURE__ */ jsx("span", { class: "shrink-0 text-muted", children: rangeLabel })
|
|
59
59
|
] }),
|
|
60
60
|
/* @__PURE__ */ jsx(
|
|
61
61
|
"div",
|
|
62
62
|
{
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
class: "overflow-x-auto bg-code-bg text-code-fg text-caption",
|
|
64
|
+
rawHtml: excerpt.html
|
|
65
65
|
}
|
|
66
66
|
),
|
|
67
|
-
/* @__PURE__ */ jsxs("footer", {
|
|
67
|
+
/* @__PURE__ */ jsxs("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", children: [
|
|
68
68
|
/* @__PURE__ */ jsx("span", { children: assetComponentText(
|
|
69
69
|
context,
|
|
70
70
|
"asset.showingLines",
|
|
@@ -74,7 +74,7 @@ function createAssetCode(context) {
|
|
|
74
74
|
/* @__PURE__ */ jsxs(
|
|
75
75
|
"a",
|
|
76
76
|
{
|
|
77
|
-
|
|
77
|
+
class: "text-fg hover:text-accent focus-visible:text-accent hover:underline focus-visible:underline",
|
|
78
78
|
href: viewerHref,
|
|
79
79
|
children: [
|
|
80
80
|
assetComponentText(
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/** @jsxRuntime automatic */
|
|
2
|
-
|
|
3
|
-
import type { JSX } from "preact";
|
|
2
|
+
import type { JSX } from "@takazudo/zfb/zudo-react/jsx-runtime";
|
|
4
3
|
import type { AssetIndexEntry, AssetManifest } from "../route-context-payload/types.js";
|
|
5
4
|
export interface AssetComponentContext {
|
|
6
5
|
base: string;
|
|
@@ -22,8 +21,8 @@ export declare function resolveAssetEntry(src: string, context: AssetComponentCo
|
|
|
22
21
|
} | null;
|
|
23
22
|
export declare function formatAssetBytes(bytes: number): string;
|
|
24
23
|
export declare function formatAssetLanguage(language: string | undefined): string;
|
|
25
|
-
export declare function AssetFileIcon({ className, }: {
|
|
26
|
-
|
|
24
|
+
export declare function AssetFileIcon({ class: className, }: {
|
|
25
|
+
class?: string;
|
|
27
26
|
}): JSX.Element;
|
|
28
27
|
export declare function MissingAssetWarning({ children, }: {
|
|
29
28
|
children: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx, jsxs } from "
|
|
1
|
+
import { jsx, jsxs } from "@takazudo/zfb/zudo-react/jsx-runtime";
|
|
2
2
|
import { decodeAuthoredHref } from "../asset-path/index.js";
|
|
3
3
|
function assetComponentViewerLocale(context, path) {
|
|
4
4
|
if (context.isDefaultLocaleOnlyPath?.(`/${context.routePrefix}/${path}`)) {
|
|
@@ -53,12 +53,12 @@ function formatAssetLanguage(language) {
|
|
|
53
53
|
return known[language.toLowerCase()] ?? language;
|
|
54
54
|
}
|
|
55
55
|
function AssetFileIcon({
|
|
56
|
-
className
|
|
56
|
+
class: className
|
|
57
57
|
}) {
|
|
58
58
|
return /* @__PURE__ */ jsxs(
|
|
59
59
|
"svg",
|
|
60
60
|
{
|
|
61
|
-
className,
|
|
61
|
+
class: className,
|
|
62
62
|
viewBox: "0 0 24 24",
|
|
63
63
|
fill: "none",
|
|
64
64
|
stroke: "currentColor",
|
|
@@ -79,7 +79,7 @@ function MissingAssetWarning({
|
|
|
79
79
|
return /* @__PURE__ */ jsx(
|
|
80
80
|
"div",
|
|
81
81
|
{
|
|
82
|
-
|
|
82
|
+
class: "rounded border border-warning/30 bg-warning/5 px-hsp-lg py-vsp-xs text-small text-warning",
|
|
83
83
|
role: "status",
|
|
84
84
|
children
|
|
85
85
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/** @jsxRuntime automatic */
|
|
2
|
-
|
|
3
|
-
import type { ComponentType, VNode } from "preact";
|
|
2
|
+
import type { Child, Component } from "@takazudo/zfb/zudo-react";
|
|
4
3
|
import type { AssetIndexEntry } from "../route-context-payload/types.js";
|
|
5
4
|
import { type AssetTreeNode } from "./tree.js";
|
|
6
5
|
/**
|
|
@@ -43,8 +42,8 @@ export interface AssetIndexPageLabels {
|
|
|
43
42
|
* own strings even when `t` itself falls back internally.
|
|
44
43
|
*/
|
|
45
44
|
export declare function resolveAssetIndexPageLabels(t: (key: string, locale?: string) => string, locale: string): AssetIndexPageLabels;
|
|
46
|
-
export declare function iconFor(asset: AssetIndexEntry):
|
|
47
|
-
|
|
45
|
+
export declare function iconFor(asset: AssetIndexEntry): Component<{
|
|
46
|
+
class?: string;
|
|
48
47
|
}>;
|
|
49
48
|
export declare function AssetTree({ node, base, routePrefix, locale, fileCountLabel, fileCountSingleLabel, linesLabel, root }: {
|
|
50
49
|
node: AssetTreeNode;
|
|
@@ -55,7 +54,7 @@ export declare function AssetTree({ node, base, routePrefix, locale, fileCountLa
|
|
|
55
54
|
fileCountSingleLabel: string;
|
|
56
55
|
linesLabel: string;
|
|
57
56
|
root?: boolean;
|
|
58
|
-
}):
|
|
57
|
+
}): Child;
|
|
59
58
|
export interface AssetIndexPageBodyProps {
|
|
60
59
|
/** Every asset entry in the index. */
|
|
61
60
|
entries: AssetIndexEntry[];
|
|
@@ -77,4 +76,4 @@ export interface AssetIndexPageBodyProps {
|
|
|
77
76
|
* `DocLayoutWithDefaults`'s children before the #4223 split. Plain props
|
|
78
77
|
* only, no `ChromeContext`.
|
|
79
78
|
*/
|
|
80
|
-
export declare function AssetIndexPageBody({ entries, labels, base, routePrefix, dir, locale }: AssetIndexPageBodyProps):
|
|
79
|
+
export declare function AssetIndexPageBody({ entries, labels, base, routePrefix, dir, locale }: AssetIndexPageBodyProps): Child;
|