@takazudo/zudo-doc 3.2.0 → 4.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 +61 -0
- package/README.md +2 -2
- package/bin/tag-cli-config.ts +126 -0
- package/bin/tags-audit-runner.ts +60 -76
- package/bin/tags-audit.mjs +17 -36
- package/bin/tags-suggest-runner.ts +429 -0
- package/bin/tags-suggest.mjs +30 -0
- package/bin/zudo-doc.mjs +78 -25
- package/dist/breadcrumb/breadcrumb.d.ts +4 -4
- package/dist/breadcrumb/find-path.d.ts +2 -2
- package/dist/breadcrumb/index.d.ts +1 -1
- package/dist/breadcrumb/types.d.ts +0 -5
- package/dist/chrome/derive.d.ts +16 -4
- package/dist/chrome/derive.js +64 -4
- package/dist/chrome/index.d.ts +13 -10
- package/dist/chrome/index.js +12 -6
- package/dist/chrome/primary-slots.d.ts +21 -0
- package/dist/chrome/primary-slots.js +59 -0
- package/dist/chrome-bindings.d.ts +227 -0
- package/dist/chrome-bindings.js +6 -0
- package/dist/code-syntax/code-block-enhancer-script.d.ts +4 -0
- package/dist/code-syntax/code-block-enhancer-script.js +7 -4
- package/dist/code-syntax/code-block-enhancer.d.ts +2 -2
- package/dist/code-syntax/code-block-enhancer.js +1 -3
- package/dist/code-syntax/index.d.ts +5 -5
- package/dist/code-syntax/index.js +4 -13
- package/dist/code-syntax/mermaid-init-script.d.ts +1 -22
- package/dist/code-syntax/mermaid-init-script.js +0 -2
- package/dist/code-syntax/mermaid-init.d.ts +0 -1
- package/dist/code-syntax/mermaid-init.js +3 -4
- package/dist/code-syntax/tabs-init.d.ts +0 -1
- package/dist/code-syntax/tabs-init.js +1 -3
- package/dist/code-syntax/tabs.d.ts +0 -1
- package/dist/code-syntax/tabs.js +1 -3
- package/dist/color-scheme-utils.d.ts +72 -4
- package/dist/color-scheme-utils.js +137 -0
- package/dist/color-schemes-defaults/index.d.ts +23 -0
- package/dist/color-schemes-defaults/index.js +134 -0
- package/dist/config.d.ts +459 -0
- package/dist/config.js +125 -0
- package/dist/content/component-map.d.ts +0 -16
- package/dist/content/component-map.js +2 -4
- package/dist/content/index.d.ts +1 -1
- package/dist/content/index.js +2 -3
- package/dist/content.css +1 -1
- package/dist/design-token-panel-bootstrap.d.ts +82 -27
- package/dist/design-token-panel-bootstrap.js +110 -21
- package/dist/design-token-panel-config/index.d.ts +49 -0
- package/dist/design-token-panel-config/index.js +211 -0
- package/dist/design-token-panel-config/manifest.d.ts +46 -0
- package/dist/design-token-panel-config/manifest.js +105 -0
- package/dist/directive-vocabulary-defaults/index.d.ts +16 -0
- package/dist/directive-vocabulary-defaults/index.js +12 -0
- package/dist/doc-body-end-islands/design-token-panel-island.d.ts +15 -0
- package/dist/doc-body-end-islands/design-token-panel-island.js +31 -0
- package/dist/doc-body-end-islands/index.d.ts +52 -7
- package/dist/doc-body-end-islands/index.js +19 -0
- package/dist/doc-body-end-islands/theme-pack-switcher-island.d.ts +37 -0
- package/dist/doc-body-end-islands/theme-pack-switcher-island.js +18 -0
- package/dist/doc-content-header/index.js +1 -1
- package/dist/doc-history-area/index.d.ts +10 -4
- package/dist/doc-history-area/index.js +3 -2
- package/dist/doc-metainfo-area/index.d.ts +1 -0
- package/dist/doc-page-props/index.d.ts +7 -23
- package/dist/doc-page-renderer/index.d.ts +1 -0
- package/dist/doc-page-renderer/index.js +1 -0
- package/dist/doc-page-shell/index.js +19 -12
- package/dist/doc-pager/index.js +1 -1
- package/dist/doc-route-entries/index.d.ts +2 -2
- package/dist/doclayout/doc-layout-with-defaults.js +4 -4
- package/dist/doclayout/doc-layout.d.ts +8 -0
- package/dist/doclayout/doc-layout.js +10 -1
- package/dist/docs-schema/index.d.ts +67 -0
- package/dist/docs-schema/index.js +43 -0
- package/dist/eject/index.d.ts +16 -0
- package/dist/eject/index.js +122 -28
- package/dist/extract-headings/index.d.ts +5 -8
- package/dist/extract-headings/index.js +2 -9
- package/dist/factory-context/index.d.ts +56 -4
- package/dist/features.css +65 -43
- package/dist/find-in-page/find-bar.d.ts +9 -0
- package/dist/find-in-page/find-bar.js +114 -0
- package/dist/find-in-page/find-in-page.d.ts +17 -0
- package/dist/find-in-page/find-in-page.js +131 -0
- package/dist/find-in-page/index.d.ts +11 -0
- package/dist/find-in-page/index.js +49 -0
- package/dist/footer/footer.js +1 -0
- package/dist/frontmatter-preview-defaults/index.d.ts +16 -0
- package/dist/frontmatter-preview-defaults/index.js +25 -0
- package/dist/head-with-defaults/index.d.ts +2 -0
- package/dist/head-with-defaults/index.js +16 -0
- package/dist/header/header.d.ts +10 -5
- package/dist/header/header.js +45 -5
- package/dist/header/index.d.ts +1 -1
- package/dist/header/types.d.ts +30 -1
- package/dist/header-with-defaults/index.js +1 -0
- package/dist/home-page/index.d.ts +2 -0
- package/dist/home-page/index.js +11 -5
- package/dist/home-page/prepare-home-data.js +1 -1
- package/dist/i18n-defaults/index.d.ts +22 -0
- package/dist/i18n-defaults/index.js +167 -0
- package/dist/locale-merge/index.d.ts +9 -14
- package/dist/locale-merge/index.js +6 -4
- package/dist/mdx-components/index.js +4 -4
- package/dist/plugins/claude-resources.d.ts +1 -0
- package/dist/plugins/claude-resources.js +4 -2
- package/dist/plugins/doc-history.js +1 -1
- package/dist/{integrations → plugins/internal}/claude-resources/index.d.ts +1 -16
- package/dist/{integrations → plugins/internal}/claude-resources/index.js +0 -9
- package/dist/{integrations → plugins/internal}/doc-history/index.d.ts +0 -17
- package/dist/{integrations → plugins/internal}/doc-history/index.js +0 -4
- package/dist/{integrations → plugins/internal}/doc-history/pre-build.d.ts +2 -4
- package/dist/plugins/internal/llms-txt/index.d.ts +7 -0
- package/dist/{integrations → plugins/internal}/llms-txt/load.d.ts +1 -1
- package/dist/{integrations → plugins/internal}/llms-txt/load.js +2 -2
- package/dist/{integrations → plugins/internal}/llms-txt/strip.d.ts +2 -3
- package/dist/{integrations → plugins/internal}/llms-txt/strip.js +1 -1
- package/dist/{integrations → plugins/internal}/llms-txt/types.d.ts +13 -22
- package/dist/{integrations → plugins/internal}/search-index/collect.js +1 -1
- package/dist/plugins/internal/theme-packs/copy.d.ts +32 -0
- package/dist/plugins/internal/theme-packs/copy.js +45 -0
- package/dist/plugins/internal/theme-packs/dev-middleware.d.ts +22 -0
- package/dist/plugins/internal/theme-packs/dev-middleware.js +80 -0
- package/dist/plugins/internal/theme-packs/index.d.ts +6 -0
- package/dist/plugins/internal/theme-packs/index.js +9 -0
- package/dist/plugins/internal/theme-packs/resolve.d.ts +17 -0
- package/dist/plugins/internal/theme-packs/resolve.js +17 -0
- package/dist/plugins/internal/theme-packs/types.d.ts +22 -0
- package/dist/plugins/internal/theme-packs/types.js +0 -0
- package/dist/plugins/llms-txt.js +1 -1
- package/dist/plugins/routes.js +55 -21
- package/dist/plugins/search-index.js +1 -1
- package/dist/plugins/theme-packs.d.ts +3 -0
- package/dist/plugins/theme-packs.js +40 -0
- package/dist/preset.d.ts +28 -14
- package/dist/preset.js +24 -9
- package/dist/route-context/index.js +4 -6
- package/dist/route-enumerators/index.d.ts +6 -18
- package/dist/route-enumerators/index.js +8 -6
- package/dist/routes/404.js +3 -1
- package/dist/routes/_chrome.js +3 -2
- package/dist/routes/_context.d.ts +7 -3
- package/dist/routes/_context.js +2 -0
- package/dist/routes/_docs-helpers.js +9 -21
- package/dist/safelist.css +1 -1
- package/dist/settings.d.ts +64 -12
- package/dist/sidebar-tree/build-tree.d.ts +3 -4
- package/dist/sidebar-tree/build-tree.js +4 -3
- package/dist/sidebar-tree/index.d.ts +2 -2
- package/dist/sidebar-tree/types.d.ts +6 -17
- package/dist/site-tree-nav-island/index.d.ts +3 -1
- package/dist/site-tree-nav-island/index.js +17 -5
- package/dist/site-tree-nav-island/state.d.ts +4 -0
- package/dist/site-tree-nav-island/state.js +10 -0
- package/dist/tag-helpers/index.d.ts +6 -13
- package/dist/tag-helpers/index.js +5 -23
- package/dist/tag-pages/index.d.ts +8 -21
- package/dist/tag-pages/index.js +14 -10
- package/dist/tags-audit.d.ts +16 -44
- package/dist/tags-audit.js +9 -172
- package/dist/theme/color-scheme-provider.d.ts +2 -3
- package/dist/theme/color-scheme-provider.js +2 -10
- package/dist/theme/index.d.ts +1 -4
- package/dist/theme/index.js +2 -30
- package/dist/theme/theme-pack-provider.d.ts +42 -0
- package/dist/theme/theme-pack-provider.js +75 -0
- package/dist/theme-cli/apply.d.ts +16 -0
- package/dist/theme-cli/apply.js +61 -0
- package/dist/theme-cli/config-io.d.ts +15 -0
- package/dist/theme-cli/config-io.js +51 -0
- package/dist/theme-cli/config-rewriter.d.ts +21 -0
- package/dist/theme-cli/config-rewriter.js +141 -0
- package/dist/theme-cli/config-scanner.d.ts +63 -0
- package/dist/theme-cli/config-scanner.js +288 -0
- package/dist/theme-cli/index.d.ts +7 -0
- package/dist/theme-cli/index.js +38 -0
- package/dist/theme-cli/list.d.ts +27 -0
- package/dist/theme-cli/list.js +64 -0
- package/dist/theme-cli/provenance.d.ts +17 -0
- package/dist/theme-cli/provenance.js +35 -0
- package/dist/theme-cli/registry.d.ts +14 -0
- package/dist/theme-cli/registry.js +13 -0
- package/dist/theme-pack-dialog/dialog-state.d.ts +25 -0
- package/dist/theme-pack-dialog/dialog-state.js +40 -0
- package/dist/theme-pack-dialog/index.d.ts +5 -0
- package/dist/theme-pack-dialog/index.js +152 -0
- package/dist/theme-pack-dialog/theme-pack-card.d.ts +25 -0
- package/dist/theme-pack-dialog/theme-pack-card.js +72 -0
- package/dist/theme-pack-switcher/index.d.ts +49 -0
- package/dist/theme-pack-switcher/index.js +205 -0
- package/dist/theme-pack-switcher/switcher-state.d.ts +56 -0
- package/dist/theme-pack-switcher/switcher-state.js +43 -0
- package/dist/theme-pack-switcher/theme-pack-sync.d.ts +85 -0
- package/dist/theme-pack-switcher/theme-pack-sync.js +121 -0
- package/dist/theme-packs/beacon/fonts/AtkinsonHyperlegible-400-latin.woff2 +0 -0
- package/dist/theme-packs/beacon/fonts/AtkinsonHyperlegible-700-latin.woff2 +0 -0
- package/dist/theme-packs/beacon/fonts/AtkinsonHyperlegible-italic-400-latin.woff2 +0 -0
- package/dist/theme-packs/beacon/fonts/AtkinsonHyperlegible-italic-700-latin.woff2 +0 -0
- package/dist/theme-packs/beacon/fonts/AtkinsonHyperlegibleMono-italic-latin.woff2 +0 -0
- package/dist/theme-packs/beacon/fonts/AtkinsonHyperlegibleMono-latin.woff2 +0 -0
- package/dist/theme-packs/beacon/fonts/OFL.txt +94 -0
- package/dist/theme-packs/beacon/meta.json +37 -0
- package/dist/theme-packs/beacon/pack.css +442 -0
- package/dist/theme-packs/broadsheet/fonts/CourierPrime-400-latin.woff2 +0 -0
- package/dist/theme-packs/broadsheet/fonts/CourierPrime-700-latin.woff2 +0 -0
- package/dist/theme-packs/broadsheet/fonts/OFL.txt +95 -0
- package/dist/theme-packs/broadsheet/fonts/PlayfairDisplay-italic-latin.woff2 +0 -0
- package/dist/theme-packs/broadsheet/fonts/PlayfairDisplay-latin.woff2 +0 -0
- package/dist/theme-packs/broadsheet/fonts/SourceSerif4-italic-latin.woff2 +0 -0
- package/dist/theme-packs/broadsheet/fonts/SourceSerif4-latin.woff2 +0 -0
- package/dist/theme-packs/broadsheet/meta.json +38 -0
- package/dist/theme-packs/broadsheet/pack.css +448 -0
- package/dist/theme-packs/brutalist/fonts/ArchivoBlack-latin.woff2 +0 -0
- package/dist/theme-packs/brutalist/fonts/IBMPlexMono-400-latin.woff2 +0 -0
- package/dist/theme-packs/brutalist/fonts/IBMPlexMono-500-latin.woff2 +0 -0
- package/dist/theme-packs/brutalist/fonts/IBMPlexMono-700-latin.woff2 +0 -0
- package/dist/theme-packs/brutalist/fonts/OFL.txt +95 -0
- package/dist/theme-packs/brutalist/fonts/SpaceGrotesk-latin.woff2 +0 -0
- package/dist/theme-packs/brutalist/meta.json +38 -0
- package/dist/theme-packs/brutalist/pack.css +546 -0
- package/dist/theme-packs/default/meta.json +37 -0
- package/dist/theme-packs/drift/fonts/IBMPlexMono-400-latin-ext.woff2 +0 -0
- package/dist/theme-packs/drift/fonts/IBMPlexMono-400-latin.woff2 +0 -0
- package/dist/theme-packs/drift/fonts/IBMPlexMono-500-latin-ext.woff2 +0 -0
- package/dist/theme-packs/drift/fonts/IBMPlexMono-500-latin.woff2 +0 -0
- package/dist/theme-packs/drift/fonts/IBMPlexSans-italic-latin.woff2 +0 -0
- package/dist/theme-packs/drift/fonts/IBMPlexSans-latin-ext.woff2 +0 -0
- package/dist/theme-packs/drift/fonts/IBMPlexSans-latin.woff2 +0 -0
- package/dist/theme-packs/drift/fonts/OFL.txt +93 -0
- package/dist/theme-packs/drift/meta.json +37 -0
- package/dist/theme-packs/drift/pack.css +478 -0
- package/dist/theme-packs/fjord/fonts/Inter-latin-ext.woff2 +0 -0
- package/dist/theme-packs/fjord/fonts/Inter-latin.woff2 +0 -0
- package/dist/theme-packs/fjord/fonts/JetBrainsMono-latin-ext.woff2 +0 -0
- package/dist/theme-packs/fjord/fonts/JetBrainsMono-latin.woff2 +0 -0
- package/dist/theme-packs/fjord/fonts/OFL.txt +94 -0
- package/dist/theme-packs/fjord/meta.json +37 -0
- package/dist/theme-packs/fjord/pack.css +375 -0
- package/dist/theme-packs/foundry/fonts/Inter-latin-ext.woff2 +0 -0
- package/dist/theme-packs/foundry/fonts/Inter-latin.woff2 +0 -0
- package/dist/theme-packs/foundry/fonts/OFL.txt +93 -0
- package/dist/theme-packs/foundry/meta.json +37 -0
- package/dist/theme-packs/foundry/pack.css +202 -0
- package/dist/theme-packs/futura-editorial/fonts/Jost-latin.woff2 +0 -0
- package/dist/theme-packs/futura-editorial/fonts/NotoSans-italic-latin.woff2 +0 -0
- package/dist/theme-packs/futura-editorial/fonts/NotoSans-latin.woff2 +0 -0
- package/dist/theme-packs/futura-editorial/fonts/OFL.txt +95 -0
- package/dist/theme-packs/futura-editorial/fonts/SpaceMono-400-latin.woff2 +0 -0
- package/dist/theme-packs/futura-editorial/fonts/SpaceMono-700-latin.woff2 +0 -0
- package/dist/theme-packs/futura-editorial/meta.json +38 -0
- package/dist/theme-packs/futura-editorial/pack.css +313 -0
- package/dist/theme-packs/hearth/fonts/Fraunces-italic-latin.woff2 +0 -0
- package/dist/theme-packs/hearth/fonts/Fraunces-latin.woff2 +0 -0
- package/dist/theme-packs/hearth/fonts/Nunito-latin.woff2 +0 -0
- package/dist/theme-packs/hearth/fonts/OFL.txt +95 -0
- package/dist/theme-packs/hearth/fonts/SplineSansMono-latin.woff2 +0 -0
- package/dist/theme-packs/hearth/meta.json +38 -0
- package/dist/theme-packs/hearth/pack.css +385 -0
- package/dist/theme-packs/hollow/fonts/OFL.txt +94 -0
- package/dist/theme-packs/hollow/fonts/SpaceGrotesk-latin.woff2 +0 -0
- package/dist/theme-packs/hollow/fonts/SpaceMono-400-italic-latin.woff2 +0 -0
- package/dist/theme-packs/hollow/fonts/SpaceMono-400-latin.woff2 +0 -0
- package/dist/theme-packs/hollow/fonts/SpaceMono-700-latin.woff2 +0 -0
- package/dist/theme-packs/hollow/meta.json +37 -0
- package/dist/theme-packs/hollow/pack.css +428 -0
- package/dist/theme-packs/ledger/fonts/CrimsonPro-latin-ext-italic.woff2 +0 -0
- package/dist/theme-packs/ledger/fonts/CrimsonPro-latin-ext.woff2 +0 -0
- package/dist/theme-packs/ledger/fonts/CrimsonPro-latin-italic.woff2 +0 -0
- package/dist/theme-packs/ledger/fonts/CrimsonPro-latin.woff2 +0 -0
- package/dist/theme-packs/ledger/fonts/IBMPlexMono-400-latin-ext.woff2 +0 -0
- package/dist/theme-packs/ledger/fonts/IBMPlexMono-400-latin.woff2 +0 -0
- package/dist/theme-packs/ledger/fonts/IBMPlexMono-500-latin-ext.woff2 +0 -0
- package/dist/theme-packs/ledger/fonts/IBMPlexMono-500-latin.woff2 +0 -0
- package/dist/theme-packs/ledger/fonts/OFL.txt +94 -0
- package/dist/theme-packs/ledger/meta.json +37 -0
- package/dist/theme-packs/ledger/pack.css +463 -0
- package/dist/theme-packs/manuscript/fonts/CourierPrime-400-latin-ext.woff2 +0 -0
- package/dist/theme-packs/manuscript/fonts/CourierPrime-400-latin.woff2 +0 -0
- package/dist/theme-packs/manuscript/fonts/CourierPrime-700-latin-ext.woff2 +0 -0
- package/dist/theme-packs/manuscript/fonts/CourierPrime-700-latin.woff2 +0 -0
- package/dist/theme-packs/manuscript/fonts/EBGaramond-latin-italic.woff2 +0 -0
- package/dist/theme-packs/manuscript/fonts/EBGaramond-latin.woff2 +0 -0
- package/dist/theme-packs/manuscript/fonts/OFL.txt +94 -0
- package/dist/theme-packs/manuscript/meta.json +37 -0
- package/dist/theme-packs/manuscript/pack.css +376 -0
- package/dist/theme-packs/matcha/fonts/MPLUS1Code-latin.woff2 +0 -0
- package/dist/theme-packs/matcha/fonts/OFL.txt +95 -0
- package/dist/theme-packs/matcha/fonts/ShipporiMincho-500-latin.woff2 +0 -0
- package/dist/theme-packs/matcha/fonts/ShipporiMincho-700-latin.woff2 +0 -0
- package/dist/theme-packs/matcha/fonts/ZenKakuGothicNew-400-latin.woff2 +0 -0
- package/dist/theme-packs/matcha/fonts/ZenKakuGothicNew-500-latin.woff2 +0 -0
- package/dist/theme-packs/matcha/meta.json +38 -0
- package/dist/theme-packs/matcha/pack.css +409 -0
- package/dist/theme-packs/nocturne/fonts/CormorantGaramond-italic-latin.woff2 +0 -0
- package/dist/theme-packs/nocturne/fonts/CormorantGaramond-latin.woff2 +0 -0
- package/dist/theme-packs/nocturne/fonts/IBMPlexMono-400-latin.woff2 +0 -0
- package/dist/theme-packs/nocturne/fonts/IBMPlexMono-500-latin.woff2 +0 -0
- package/dist/theme-packs/nocturne/fonts/IBMPlexMono-italic-latin.woff2 +0 -0
- package/dist/theme-packs/nocturne/fonts/Manrope-latin.woff2 +0 -0
- package/dist/theme-packs/nocturne/fonts/OFL.txt +95 -0
- package/dist/theme-packs/nocturne/meta.json +38 -0
- package/dist/theme-packs/nocturne/pack.css +502 -0
- package/dist/theme-packs/observatory/fonts/JosefinSans-latin.woff2 +0 -0
- package/dist/theme-packs/observatory/fonts/Jost-italic-latin.woff2 +0 -0
- package/dist/theme-packs/observatory/fonts/Jost-latin.woff2 +0 -0
- package/dist/theme-packs/observatory/fonts/OFL.txt +95 -0
- package/dist/theme-packs/observatory/fonts/SpaceMono-400-latin.woff2 +0 -0
- package/dist/theme-packs/observatory/fonts/SpaceMono-700-latin.woff2 +0 -0
- package/dist/theme-packs/observatory/fonts/SpaceMono-italic-latin.woff2 +0 -0
- package/dist/theme-packs/observatory/meta.json +38 -0
- package/dist/theme-packs/observatory/pack.css +728 -0
- package/dist/theme-packs/onyx/fonts/CormorantGaramond-italic-latin.woff2 +0 -0
- package/dist/theme-packs/onyx/fonts/CormorantGaramond-latin.woff2 +0 -0
- package/dist/theme-packs/onyx/fonts/IBMPlexMono-400-latin-ext.woff2 +0 -0
- package/dist/theme-packs/onyx/fonts/IBMPlexMono-400-latin.woff2 +0 -0
- package/dist/theme-packs/onyx/fonts/IBMPlexMono-500-latin-ext.woff2 +0 -0
- package/dist/theme-packs/onyx/fonts/IBMPlexMono-500-latin.woff2 +0 -0
- package/dist/theme-packs/onyx/fonts/Jost-latin.woff2 +0 -0
- package/dist/theme-packs/onyx/fonts/OFL.txt +95 -0
- package/dist/theme-packs/onyx/meta.json +38 -0
- package/dist/theme-packs/onyx/pack.css +497 -0
- package/dist/theme-packs/phosphor/fonts/JetBrainsMono-latin-ext.woff2 +0 -0
- package/dist/theme-packs/phosphor/fonts/JetBrainsMono-latin.woff2 +0 -0
- package/dist/theme-packs/phosphor/fonts/OFL.txt +94 -0
- package/dist/theme-packs/phosphor/fonts/VT323-latin-ext.woff2 +0 -0
- package/dist/theme-packs/phosphor/fonts/VT323-latin.woff2 +0 -0
- package/dist/theme-packs/phosphor/meta.json +38 -0
- package/dist/theme-packs/phosphor/pack.css +493 -0
- package/dist/theme-packs/solar/fonts/OFL.txt +94 -0
- package/dist/theme-packs/solar/fonts/SourceCodePro-italic-latin.woff2 +0 -0
- package/dist/theme-packs/solar/fonts/SourceCodePro-latin.woff2 +0 -0
- package/dist/theme-packs/solar/fonts/SourceSans3-italic-latin.woff2 +0 -0
- package/dist/theme-packs/solar/fonts/SourceSans3-latin.woff2 +0 -0
- package/dist/theme-packs/solar/meta.json +37 -0
- package/dist/theme-packs/solar/pack.css +380 -0
- package/dist/theme-packs/sumi/fonts/IBMPlexMono-400-latin-ext.woff2 +0 -0
- package/dist/theme-packs/sumi/fonts/IBMPlexMono-400-latin.woff2 +0 -0
- package/dist/theme-packs/sumi/fonts/IBMPlexMono-500-latin-ext.woff2 +0 -0
- package/dist/theme-packs/sumi/fonts/IBMPlexMono-500-latin.woff2 +0 -0
- package/dist/theme-packs/sumi/fonts/OFL.txt +95 -0
- package/dist/theme-packs/sumi/fonts/ShipporiMinchoB1-600-latin.woff2 +0 -0
- package/dist/theme-packs/sumi/fonts/ShipporiMinchoB1-700-latin.woff2 +0 -0
- package/dist/theme-packs/sumi/fonts/ShipporiMinchoB1-800-latin.woff2 +0 -0
- package/dist/theme-packs/sumi/fonts/ZenKakuGothicNew-400-latin.woff2 +0 -0
- package/dist/theme-packs/sumi/fonts/ZenKakuGothicNew-500-latin.woff2 +0 -0
- package/dist/theme-packs/sumi/meta.json +38 -0
- package/dist/theme-packs/sumi/pack.css +502 -0
- package/dist/theme-packs/swissgrid/fonts/IBMPlexMono-400-latin-ext.woff2 +0 -0
- package/dist/theme-packs/swissgrid/fonts/IBMPlexMono-400-latin.woff2 +0 -0
- package/dist/theme-packs/swissgrid/fonts/IBMPlexMono-600-latin.woff2 +0 -0
- package/dist/theme-packs/swissgrid/fonts/Inter-latin-ext.woff2 +0 -0
- package/dist/theme-packs/swissgrid/fonts/Inter-latin.woff2 +0 -0
- package/dist/theme-packs/swissgrid/fonts/InterTight-latin.woff2 +0 -0
- package/dist/theme-packs/swissgrid/fonts/OFL.txt +95 -0
- package/dist/theme-packs/swissgrid/meta.json +38 -0
- package/dist/theme-packs/swissgrid/pack.css +518 -0
- package/dist/theme-packs/washi/fonts/MPlus1Code-400-latin.woff2 +0 -0
- package/dist/theme-packs/washi/fonts/MPlus1Code-500-latin.woff2 +0 -0
- package/dist/theme-packs/washi/fonts/OFL.txt +95 -0
- package/dist/theme-packs/washi/fonts/ShipporiMincho-500-latin.woff2 +0 -0
- package/dist/theme-packs/washi/fonts/ShipporiMincho-600-latin.woff2 +0 -0
- package/dist/theme-packs/washi/fonts/ShipporiMincho-700-latin.woff2 +0 -0
- package/dist/theme-packs/washi/fonts/ZenKakuGothicNew-400-latin.woff2 +0 -0
- package/dist/theme-packs/washi/fonts/ZenKakuGothicNew-500-latin.woff2 +0 -0
- package/dist/theme-packs/washi/fonts/ZenKakuGothicNew-700-latin.woff2 +0 -0
- package/dist/theme-packs/washi/meta.json +38 -0
- package/dist/theme-packs/washi/pack.css +479 -0
- package/dist/theme-packs-registry/index.d.ts +5 -0
- package/dist/theme-packs-registry/index.js +30 -0
- package/dist/theme-packs-registry/load-registry.d.ts +23 -0
- package/dist/theme-packs-registry/load-registry.js +64 -0
- package/dist/theme-packs-registry/meta-schema.d.ts +70 -0
- package/dist/theme-packs-registry/meta-schema.js +38 -0
- package/dist/theme-packs-registry/resolve-enabled-packs.d.ts +25 -0
- package/dist/theme-packs-registry/resolve-enabled-packs.js +43 -0
- package/dist/theme-packs-registry/token-manifest.d.ts +19 -0
- package/dist/theme-packs-registry/token-manifest.js +57 -0
- package/dist/theme-packs-registry/validator.d.ts +35 -0
- package/dist/theme-packs-registry/validator.js +284 -0
- package/dist/theme-toggle/color-scheme-sync.d.ts +2 -4
- package/dist/theme.css +319 -0
- package/dist/versions-page/index.d.ts +2 -2
- package/dist/versions-page/index.js +8 -8
- package/dist/z-index-defaults/index.d.ts +45 -0
- package/dist/z-index-defaults/index.js +34 -0
- package/eject/breadcrumb/breadcrumb.tsx +4 -4
- package/eject/breadcrumb/find-path.ts +2 -2
- package/eject/breadcrumb/index.ts +1 -1
- package/eject/breadcrumb/types.ts +0 -6
- package/eject/code-group/index.tsx +2 -2
- package/eject/doc-history/index.tsx +1 -1
- package/eject/doc-pager/index.tsx +1 -1
- package/eject/footer/footer.tsx +1 -0
- package/eject/header/header.tsx +86 -21
- package/eject/header/index.ts +3 -0
- package/eject/header/types.ts +39 -1
- package/eject/site-tree-nav-island/index.tsx +15 -3
- package/eject/site-tree-nav-island/state.ts +9 -0
- package/eject/theme-toggle/color-scheme-sync.ts +2 -4
- package/package.json +82 -29
- package/routes-src/404.tsx +4 -1
- package/routes-src/_chrome.tsx +31 -8
- package/routes-src/_context.ts +4 -0
- package/routes-src/_docs-helpers.ts +9 -29
- package/routes-src/_virtual.d.ts +38 -2
- package/tsconfig.base.json +29 -0
- package/virtual-modules.d.ts +83 -0
- package/zfb-config-shim.d.ts +210 -0
- package/dist/integrations/llms-txt/index.d.ts +0 -33
- package/dist/theme/color-tweak-export-modal.d.ts +0 -16
- package/dist/theme/color-tweak-export-modal.js +0 -138
- package/dist/theme/design-token-serde.d.ts +0 -183
- package/dist/theme/design-token-serde.js +0 -346
- package/dist/theme/design-token-types.d.ts +0 -13
- package/dist/theme/design-token-types.js +0 -6
- package/dist/theme/iframe-bridge.d.ts +0 -42
- package/dist/theme/iframe-bridge.js +0 -72
- /package/dist/{integrations → plugins/internal}/claude-resources/escape-for-mdx.d.ts +0 -0
- /package/dist/{integrations → plugins/internal}/claude-resources/escape-for-mdx.js +0 -0
- /package/dist/{integrations → plugins/internal}/claude-resources/generate.d.ts +0 -0
- /package/dist/{integrations → plugins/internal}/claude-resources/generate.js +0 -0
- /package/dist/{integrations → plugins/internal}/doc-history/pre-build.js +0 -0
- /package/dist/{integrations → plugins/internal}/llms-txt/dev-middleware.d.ts +0 -0
- /package/dist/{integrations → plugins/internal}/llms-txt/dev-middleware.js +0 -0
- /package/dist/{integrations → plugins/internal}/llms-txt/emit.d.ts +0 -0
- /package/dist/{integrations → plugins/internal}/llms-txt/emit.js +0 -0
- /package/dist/{integrations → plugins/internal}/llms-txt/generate.d.ts +0 -0
- /package/dist/{integrations → plugins/internal}/llms-txt/generate.js +0 -0
- /package/dist/{integrations → plugins/internal}/llms-txt/index.js +0 -0
- /package/dist/{integrations → plugins/internal}/llms-txt/types.js +0 -0
- /package/dist/{integrations → plugins/internal}/search-index/build-emitter.d.ts +0 -0
- /package/dist/{integrations → plugins/internal}/search-index/build-emitter.js +0 -0
- /package/dist/{integrations → plugins/internal}/search-index/collect.d.ts +0 -0
- /package/dist/{integrations → plugins/internal}/search-index/dev-middleware.d.ts +0 -0
- /package/dist/{integrations → plugins/internal}/search-index/dev-middleware.js +0 -0
- /package/dist/{integrations → plugins/internal}/search-index/index.d.ts +0 -0
- /package/dist/{integrations → plugins/internal}/search-index/index.js +0 -0
- /package/dist/{integrations → plugins/internal}/search-index/types.d.ts +0 -0
- /package/dist/{integrations → plugins/internal}/search-index/types.js +0 -0
package/dist/features.css
CHANGED
|
@@ -14,11 +14,14 @@
|
|
|
14
14
|
* --spacing-{hsp-sm,hsp-2xs,hsp-lg,hsp-md,hsp-xl,vsp-xs,vsp-2xs,vsp-md,
|
|
15
15
|
* icon-sm}
|
|
16
16
|
* --z-index-local-1
|
|
17
|
+
* --z-index-toolbar
|
|
17
18
|
* --radius-{DEFAULT,lg}
|
|
18
19
|
* --font-{mono,sans}
|
|
19
20
|
* --text-{small,caption}
|
|
20
21
|
* --leading-relaxed
|
|
21
22
|
* --zd-fg
|
|
23
|
+
* --zd-code-{bg,fg}
|
|
24
|
+
* --zd-syntax-{comment,string,number,keyword,callable,type,name,inserted,deleted}
|
|
22
25
|
* --zd-sidebar-w
|
|
23
26
|
* --zd-header-h
|
|
24
27
|
* --zd-transition-slow
|
|
@@ -28,6 +31,15 @@
|
|
|
28
31
|
* pre-condition before @importing this file).
|
|
29
32
|
* ─────────────────────────────────────────────────────────────────────────── */
|
|
30
33
|
|
|
34
|
+
/* ========================================
|
|
35
|
+
* Shared chrome defaults
|
|
36
|
+
* ======================================== */
|
|
37
|
+
|
|
38
|
+
header[data-header] {
|
|
39
|
+
background-color: var(--color-surface, var(--color-bg));
|
|
40
|
+
z-index: var(--z-index-toolbar, 20);
|
|
41
|
+
}
|
|
42
|
+
|
|
31
43
|
/* ========================================
|
|
32
44
|
* Code block buttons (copy + word wrap)
|
|
33
45
|
* ======================================== */
|
|
@@ -36,11 +48,11 @@
|
|
|
36
48
|
position: relative;
|
|
37
49
|
}
|
|
38
50
|
|
|
39
|
-
pre
|
|
51
|
+
:is(pre.hi-root, .tab-panel pre).word-wrap {
|
|
40
52
|
overflow-x: hidden;
|
|
41
53
|
}
|
|
42
54
|
|
|
43
|
-
pre
|
|
55
|
+
:is(pre.hi-root, .tab-panel pre).word-wrap code {
|
|
44
56
|
white-space: pre-wrap;
|
|
45
57
|
overflow-wrap: anywhere;
|
|
46
58
|
}
|
|
@@ -129,38 +141,49 @@ pre[class^="syntect-"].word-wrap code {
|
|
|
129
141
|
* Code-block syntax-highlight token color rule
|
|
130
142
|
* ======================================== */
|
|
131
143
|
|
|
132
|
-
/*
|
|
133
|
-
*
|
|
134
|
-
*
|
|
135
|
-
*
|
|
136
|
-
*
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
144
|
+
/* zfb's default class-mode stylesheet lives in `@layer zfb-hi`. This adapter
|
|
145
|
+
* stays unlayered, so zudo's semantic design tokens win without specificity or
|
|
146
|
+
* import-order coupling. The indirections deliberately stay as var() values:
|
|
147
|
+
* ColorSchemeProvider and the Design Token Panel can replace any --zd-* source
|
|
148
|
+
* live, and existing highlighted DOM recomputes without a renderer pass. */
|
|
149
|
+
:root {
|
|
150
|
+
--zfb-hi-fg: var(--zd-code-fg);
|
|
151
|
+
--zfb-hi-bg: var(--zd-code-bg);
|
|
152
|
+
--zfb-hi-esc: var(--zd-syntax-string);
|
|
153
|
+
--zfb-hi-op: var(--zd-code-fg);
|
|
154
|
+
--zfb-hi-com: var(--zd-syntax-comment);
|
|
155
|
+
--zfb-hi-str: var(--zd-syntax-string);
|
|
156
|
+
--zfb-hi-num: var(--zd-syntax-number);
|
|
157
|
+
--zfb-hi-const: var(--zd-syntax-number);
|
|
158
|
+
--zfb-hi-kw: var(--zd-syntax-keyword);
|
|
159
|
+
--zfb-hi-fn: var(--zd-syntax-callable);
|
|
160
|
+
--zfb-hi-ty: var(--zd-syntax-type);
|
|
161
|
+
--zfb-hi-ns: var(--zd-syntax-type);
|
|
162
|
+
--zfb-hi-prop: var(--zd-syntax-name);
|
|
163
|
+
--zfb-hi-var: var(--zd-syntax-name);
|
|
164
|
+
--zfb-hi-tag: var(--zd-syntax-name);
|
|
165
|
+
--zfb-hi-attr: var(--zd-syntax-name);
|
|
166
|
+
--zfb-hi-punct: var(--zd-code-fg);
|
|
167
|
+
--zfb-hi-ins: var(--zd-syntax-inserted);
|
|
168
|
+
--zfb-hi-ins-bg: color-mix(
|
|
169
|
+
in srgb,
|
|
170
|
+
var(--zd-syntax-inserted) 15%,
|
|
171
|
+
var(--zd-code-bg)
|
|
172
|
+
);
|
|
173
|
+
--zfb-hi-del: var(--zd-syntax-deleted);
|
|
174
|
+
--zfb-hi-del-bg: color-mix(
|
|
175
|
+
in srgb,
|
|
176
|
+
var(--zd-syntax-deleted) 15%,
|
|
177
|
+
var(--zd-code-bg)
|
|
178
|
+
);
|
|
179
|
+
--zfb-hi-hd: var(--zd-syntax-keyword);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
/* HTML Preview remains on Shiki until #2742. Its dual-theme variables resolve
|
|
183
|
+
* through color-scheme. These selectors intentionally exclude `.hi-root`,
|
|
184
|
+
* whose colors come from the semantic bridge above. */
|
|
160
185
|
[data-theme] .shiki,
|
|
161
|
-
[data-theme] .shiki span
|
|
162
|
-
[data-theme] pre[class^="syntect-"],
|
|
163
|
-
[data-theme] pre[class^="syntect-"] span {
|
|
186
|
+
[data-theme] .shiki span {
|
|
164
187
|
color: light-dark(var(--shiki-light), var(--shiki-dark));
|
|
165
188
|
font-style: light-dark(
|
|
166
189
|
var(--shiki-light-font-style, inherit),
|
|
@@ -173,8 +196,7 @@ pre[class^="syntect-"].word-wrap code {
|
|
|
173
196
|
* painting them per-span would lay an opaque base background over the
|
|
174
197
|
* translucent line-/word-highlight backgrounds that sit on the enclosing
|
|
175
198
|
* .line span (see .line.highlighted below). */
|
|
176
|
-
[data-theme] .shiki
|
|
177
|
-
[data-theme] pre[class^="syntect-"] {
|
|
199
|
+
[data-theme] .shiki {
|
|
178
200
|
background-color: light-dark(var(--shiki-light-bg), var(--shiki-dark-bg));
|
|
179
201
|
}
|
|
180
202
|
|
|
@@ -202,13 +224,13 @@ pre[class^="syntect-"].word-wrap code {
|
|
|
202
224
|
* zfb emits data-line-highlight="true" on the <span class="line"> element
|
|
203
225
|
* (verified empirically at next.13). The .highlighted class form is kept for
|
|
204
226
|
* forward-compat in case a future zfb version emits both. */
|
|
205
|
-
pre
|
|
206
|
-
pre
|
|
227
|
+
pre.hi-root .line.highlighted,
|
|
228
|
+
pre.hi-root [data-line-highlight="true"] {
|
|
207
229
|
background-color: color-mix(in srgb, var(--color-accent) 15%, transparent);
|
|
208
230
|
}
|
|
209
231
|
|
|
210
232
|
/* Word highlighting via /word/ meta syntax */
|
|
211
|
-
pre
|
|
233
|
+
pre.hi-root .line .highlighted-word {
|
|
212
234
|
background-color: color-mix(in srgb, var(--color-accent) 25%, transparent);
|
|
213
235
|
border-bottom: 1px solid var(--color-accent);
|
|
214
236
|
}
|
|
@@ -232,7 +254,7 @@ pre[class^="syntect-"] .line .highlighted-word {
|
|
|
232
254
|
padding: var(--spacing-vsp-2xs) var(--spacing-hsp-lg);
|
|
233
255
|
}
|
|
234
256
|
|
|
235
|
-
.code-block-container pre
|
|
257
|
+
.code-block-container pre.hi-root {
|
|
236
258
|
margin-top: 0 !important;
|
|
237
259
|
border-top-left-radius: 0;
|
|
238
260
|
border-top-right-radius: 0;
|
|
@@ -243,10 +265,10 @@ pre[class^="syntect-"] .line .highlighted-word {
|
|
|
243
265
|
*
|
|
244
266
|
* zfb's :::code-group emits <CodeGroup tabs={[...]}> with one
|
|
245
267
|
* <pre data-lang="…">{RAW text}</pre> child per fence. These <pre> elements
|
|
246
|
-
* are NOT
|
|
247
|
-
* code-group fences), so they get no `.
|
|
248
|
-
* code-block visual treatment via tokens to match the
|
|
249
|
-
*
|
|
268
|
+
* are NOT syntax-highlighted (the Rust pipeline doesn't highlight inside
|
|
269
|
+
* code-group fences), so they get no `.hi-root` class. Apply explicit
|
|
270
|
+
* code-block visual treatment via tokens to match the highlighted code blocks
|
|
271
|
+
* surrounding them.
|
|
250
272
|
* ======================================== */
|
|
251
273
|
|
|
252
274
|
.code-group-panel pre[data-lang] {
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { FindInPage } from "./find-in-page.js";
|
|
2
|
+
interface FindBarProps {
|
|
3
|
+
visible: boolean;
|
|
4
|
+
onClose: () => void;
|
|
5
|
+
findInPage: FindInPage;
|
|
6
|
+
containerSelector: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function FindBar({ visible, onClose, findInPage, containerSelector }: FindBarProps): import("preact").JSX.Element | null;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "preact/jsx-runtime";
|
|
3
|
+
import { useState, useRef, useEffect, useCallback } from "preact/hooks";
|
|
4
|
+
function toMatchInfo(result) {
|
|
5
|
+
return result.matches > 0 ? result : null;
|
|
6
|
+
}
|
|
7
|
+
function FindBar({ visible, onClose, findInPage, containerSelector }) {
|
|
8
|
+
const [query, setQuery] = useState("");
|
|
9
|
+
const [matchInfo, setMatchInfo] = useState(null);
|
|
10
|
+
const inputRef = useRef(null);
|
|
11
|
+
const findInPageRef = useRef(findInPage);
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
findInPageRef.current = findInPage;
|
|
14
|
+
}, [findInPage]);
|
|
15
|
+
useEffect(() => {
|
|
16
|
+
if (visible) {
|
|
17
|
+
inputRef.current?.focus();
|
|
18
|
+
inputRef.current?.select();
|
|
19
|
+
}
|
|
20
|
+
}, [visible]);
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
if (!visible) {
|
|
23
|
+
setQuery("");
|
|
24
|
+
setMatchInfo(null);
|
|
25
|
+
findInPageRef.current.stop();
|
|
26
|
+
}
|
|
27
|
+
}, [visible]);
|
|
28
|
+
const handleFind = useCallback(
|
|
29
|
+
(text) => {
|
|
30
|
+
const container = document.querySelector(containerSelector);
|
|
31
|
+
if (!text || !(container instanceof HTMLElement)) {
|
|
32
|
+
setMatchInfo(null);
|
|
33
|
+
findInPage.stop();
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
const result = findInPage.find(container, text);
|
|
37
|
+
setMatchInfo(toMatchInfo(result));
|
|
38
|
+
},
|
|
39
|
+
[findInPage, containerSelector]
|
|
40
|
+
);
|
|
41
|
+
const handleKeyDown = useCallback(
|
|
42
|
+
// Plain DOM `KeyboardEvent` — matches the ai-chat-modal onKeyDown
|
|
43
|
+
// precedent (`../ai-chat-modal/index.tsx`); Preact's JSX
|
|
44
|
+
// `onKeyDown` prop accepts it directly, no React-namespace type needed.
|
|
45
|
+
(e) => {
|
|
46
|
+
if (e.key === "Escape") {
|
|
47
|
+
onClose();
|
|
48
|
+
} else if (e.key === "Enter") {
|
|
49
|
+
const result = e.shiftKey ? findInPage.prev() : findInPage.next();
|
|
50
|
+
setMatchInfo(toMatchInfo(result));
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
[onClose, findInPage]
|
|
54
|
+
);
|
|
55
|
+
if (!visible) return null;
|
|
56
|
+
return /* @__PURE__ */ jsxs("div", { className: "fixed top-[3.5rem] right-0 z-dropdown flex items-center gap-hsp-sm py-hsp-xs px-hsp-md bg-surface border-b border-l border-muted rounded-bl-lg shadow-md", children: [
|
|
57
|
+
/* @__PURE__ */ jsx(
|
|
58
|
+
"input",
|
|
59
|
+
{
|
|
60
|
+
ref: inputRef,
|
|
61
|
+
className: "w-48 py-[4px] px-hsp-sm rounded text-small bg-bg border border-muted text-fg outline-none focus:border-accent",
|
|
62
|
+
type: "text",
|
|
63
|
+
value: query,
|
|
64
|
+
placeholder: "Find in page...",
|
|
65
|
+
"aria-label": "Find in page",
|
|
66
|
+
onChange: (e) => {
|
|
67
|
+
setQuery(e.currentTarget.value);
|
|
68
|
+
handleFind(e.currentTarget.value);
|
|
69
|
+
},
|
|
70
|
+
onKeyDown: handleKeyDown
|
|
71
|
+
}
|
|
72
|
+
),
|
|
73
|
+
/* @__PURE__ */ jsx("span", { className: "text-caption whitespace-nowrap min-w-[3rem] text-center text-fg/60", children: matchInfo ? `${matchInfo.activeMatchOrdinal}/${matchInfo.matches}` : "" }),
|
|
74
|
+
/* @__PURE__ */ jsx(
|
|
75
|
+
"button",
|
|
76
|
+
{
|
|
77
|
+
type: "button",
|
|
78
|
+
className: "py-hsp-2xs px-hsp-sm rounded text-caption bg-bg border border-muted text-fg hover:bg-surface",
|
|
79
|
+
onClick: () => {
|
|
80
|
+
const result = findInPage.prev();
|
|
81
|
+
setMatchInfo(toMatchInfo(result));
|
|
82
|
+
},
|
|
83
|
+
title: "Previous (Shift+Enter)",
|
|
84
|
+
children: "Prev"
|
|
85
|
+
}
|
|
86
|
+
),
|
|
87
|
+
/* @__PURE__ */ jsx(
|
|
88
|
+
"button",
|
|
89
|
+
{
|
|
90
|
+
type: "button",
|
|
91
|
+
className: "py-hsp-2xs px-hsp-sm rounded text-caption bg-bg border border-muted text-fg hover:bg-surface",
|
|
92
|
+
onClick: () => {
|
|
93
|
+
const result = findInPage.next();
|
|
94
|
+
setMatchInfo(toMatchInfo(result));
|
|
95
|
+
},
|
|
96
|
+
title: "Next (Enter)",
|
|
97
|
+
children: "Next"
|
|
98
|
+
}
|
|
99
|
+
),
|
|
100
|
+
/* @__PURE__ */ jsx(
|
|
101
|
+
"button",
|
|
102
|
+
{
|
|
103
|
+
type: "button",
|
|
104
|
+
className: "py-hsp-2xs px-hsp-sm rounded text-caption bg-bg border border-muted text-fg hover:bg-surface",
|
|
105
|
+
onClick: onClose,
|
|
106
|
+
title: "Close (Esc)",
|
|
107
|
+
children: "Close"
|
|
108
|
+
}
|
|
109
|
+
)
|
|
110
|
+
] });
|
|
111
|
+
}
|
|
112
|
+
export {
|
|
113
|
+
FindBar
|
|
114
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface FindResult {
|
|
2
|
+
matches: number;
|
|
3
|
+
activeMatchOrdinal: number;
|
|
4
|
+
}
|
|
5
|
+
export interface FindInPage {
|
|
6
|
+
find(container: HTMLElement, query: string): FindResult;
|
|
7
|
+
next(): FindResult;
|
|
8
|
+
prev(): FindResult;
|
|
9
|
+
stop(): void;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Create a DOM-based find-in-page utility.
|
|
13
|
+
*
|
|
14
|
+
* Limitation: only matches within single text nodes. Cross-element matching
|
|
15
|
+
* (e.g. "Hello world" spanning `<strong>Hello</strong> world`) is not supported.
|
|
16
|
+
*/
|
|
17
|
+
export declare function createFindInPage(): FindInPage;
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
const MATCH_CLASS = "find-match";
|
|
2
|
+
const ACTIVE_CLASS = "find-match-active";
|
|
3
|
+
const MATCH_ATTR = "data-find-match";
|
|
4
|
+
const ACTIVE_ATTR = "data-find-active";
|
|
5
|
+
const EMPTY_RESULT = Object.freeze({ matches: 0, activeMatchOrdinal: 0 });
|
|
6
|
+
function createFindInPage() {
|
|
7
|
+
let matchElements = [];
|
|
8
|
+
let activeIndex = -1;
|
|
9
|
+
function clearMarks() {
|
|
10
|
+
const parentsToNormalize = /* @__PURE__ */ new Set();
|
|
11
|
+
for (let i = matchElements.length - 1; i >= 0; i--) {
|
|
12
|
+
const mark = matchElements[i];
|
|
13
|
+
const parent = mark.parentNode;
|
|
14
|
+
if (parent) {
|
|
15
|
+
const textNode = document.createTextNode(mark.textContent || "");
|
|
16
|
+
parent.replaceChild(textNode, mark);
|
|
17
|
+
parentsToNormalize.add(parent);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
for (const parent of parentsToNormalize) {
|
|
21
|
+
parent.normalize();
|
|
22
|
+
}
|
|
23
|
+
matchElements = [];
|
|
24
|
+
activeIndex = -1;
|
|
25
|
+
}
|
|
26
|
+
function setActive(index) {
|
|
27
|
+
if (activeIndex >= 0 && activeIndex < matchElements.length) {
|
|
28
|
+
const prev2 = matchElements[activeIndex];
|
|
29
|
+
prev2.classList.remove(ACTIVE_CLASS);
|
|
30
|
+
prev2.removeAttribute(ACTIVE_ATTR);
|
|
31
|
+
}
|
|
32
|
+
activeIndex = index;
|
|
33
|
+
if (activeIndex >= 0 && activeIndex < matchElements.length) {
|
|
34
|
+
const current = matchElements[activeIndex];
|
|
35
|
+
current.classList.add(ACTIVE_CLASS);
|
|
36
|
+
current.setAttribute(ACTIVE_ATTR, "true");
|
|
37
|
+
current.scrollIntoView?.({ block: "center" });
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
function currentResult() {
|
|
41
|
+
if (matchElements.length === 0) {
|
|
42
|
+
return EMPTY_RESULT;
|
|
43
|
+
}
|
|
44
|
+
return {
|
|
45
|
+
matches: matchElements.length,
|
|
46
|
+
activeMatchOrdinal: activeIndex + 1
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
function find(container, query) {
|
|
50
|
+
clearMarks();
|
|
51
|
+
if (!query) {
|
|
52
|
+
return EMPTY_RESULT;
|
|
53
|
+
}
|
|
54
|
+
const lowerQuery = query.toLowerCase();
|
|
55
|
+
const walker = document.createTreeWalker(
|
|
56
|
+
container,
|
|
57
|
+
NodeFilter.SHOW_TEXT,
|
|
58
|
+
null
|
|
59
|
+
);
|
|
60
|
+
const textNodes = [];
|
|
61
|
+
let node;
|
|
62
|
+
while (node = walker.nextNode()) {
|
|
63
|
+
textNodes.push(node);
|
|
64
|
+
}
|
|
65
|
+
for (const textNode of textNodes) {
|
|
66
|
+
const text = textNode.textContent || "";
|
|
67
|
+
const lowerText = text.toLowerCase();
|
|
68
|
+
const positions = [];
|
|
69
|
+
let searchFrom = 0;
|
|
70
|
+
while (searchFrom < lowerText.length) {
|
|
71
|
+
const idx = lowerText.indexOf(lowerQuery, searchFrom);
|
|
72
|
+
if (idx === -1) break;
|
|
73
|
+
positions.push(idx);
|
|
74
|
+
searchFrom = idx + lowerQuery.length;
|
|
75
|
+
}
|
|
76
|
+
if (positions.length === 0) continue;
|
|
77
|
+
const parent = textNode.parentNode;
|
|
78
|
+
if (!parent) continue;
|
|
79
|
+
let remainingNode = textNode;
|
|
80
|
+
const nodeMarks = [];
|
|
81
|
+
for (let i = positions.length - 1; i >= 0; i--) {
|
|
82
|
+
const pos = positions[i];
|
|
83
|
+
const matchLen = query.length;
|
|
84
|
+
if (pos + matchLen < remainingNode.length) {
|
|
85
|
+
remainingNode.splitText(pos + matchLen);
|
|
86
|
+
}
|
|
87
|
+
let matchNode;
|
|
88
|
+
if (pos > 0) {
|
|
89
|
+
matchNode = remainingNode.splitText(pos);
|
|
90
|
+
} else {
|
|
91
|
+
matchNode = remainingNode;
|
|
92
|
+
}
|
|
93
|
+
const mark = document.createElement("mark");
|
|
94
|
+
mark.className = MATCH_CLASS;
|
|
95
|
+
mark.setAttribute(MATCH_ATTR, "true");
|
|
96
|
+
mark.textContent = matchNode.textContent;
|
|
97
|
+
parent.replaceChild(mark, matchNode);
|
|
98
|
+
nodeMarks.unshift(mark);
|
|
99
|
+
}
|
|
100
|
+
matchElements.push(...nodeMarks);
|
|
101
|
+
}
|
|
102
|
+
if (matchElements.length === 0) {
|
|
103
|
+
return EMPTY_RESULT;
|
|
104
|
+
}
|
|
105
|
+
setActive(0);
|
|
106
|
+
return currentResult();
|
|
107
|
+
}
|
|
108
|
+
function next() {
|
|
109
|
+
if (matchElements.length === 0) {
|
|
110
|
+
return EMPTY_RESULT;
|
|
111
|
+
}
|
|
112
|
+
const newIndex = (activeIndex + 1) % matchElements.length;
|
|
113
|
+
setActive(newIndex);
|
|
114
|
+
return currentResult();
|
|
115
|
+
}
|
|
116
|
+
function prev() {
|
|
117
|
+
if (matchElements.length === 0) {
|
|
118
|
+
return EMPTY_RESULT;
|
|
119
|
+
}
|
|
120
|
+
const newIndex = (activeIndex - 1 + matchElements.length) % matchElements.length;
|
|
121
|
+
setActive(newIndex);
|
|
122
|
+
return currentResult();
|
|
123
|
+
}
|
|
124
|
+
function stop() {
|
|
125
|
+
clearMarks();
|
|
126
|
+
}
|
|
127
|
+
return { find, next, prev, stop };
|
|
128
|
+
}
|
|
129
|
+
export {
|
|
130
|
+
createFindInPage
|
|
131
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { JSX } from "preact";
|
|
2
|
+
/**
|
|
3
|
+
* `displayName` pinned explicitly (matching
|
|
4
|
+
* `AiChatModal`/`ImageEnlarge`/`MermaidEnlarge`/`DesignTokenPanelBootstrap`)
|
|
5
|
+
* so zfb's `captureComponentName` emits a stable
|
|
6
|
+
* `data-zfb-island="FindInPageInit"` marker independent of minification.
|
|
7
|
+
*/
|
|
8
|
+
export declare function FindInPageInit(): JSX.Element | null;
|
|
9
|
+
export declare namespace FindInPageInit {
|
|
10
|
+
var displayName: string;
|
|
11
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "preact/jsx-runtime";
|
|
3
|
+
import { useState, useEffect, useRef } from "preact/compat";
|
|
4
|
+
import { FindBar } from "./find-bar.js";
|
|
5
|
+
import { createFindInPage } from "./find-in-page.js";
|
|
6
|
+
const CONTENT_SELECTOR = "article.zd-content";
|
|
7
|
+
function FindInPageInit() {
|
|
8
|
+
const [isTauri, setIsTauri] = useState(false);
|
|
9
|
+
const [visible, setVisible] = useState(false);
|
|
10
|
+
const findInPageRef = useRef(createFindInPage());
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
if (typeof window !== "undefined" && "__TAURI_INTERNALS__" in window) {
|
|
13
|
+
setIsTauri(true);
|
|
14
|
+
}
|
|
15
|
+
}, []);
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
if (!isTauri) return;
|
|
18
|
+
const handler = (e) => {
|
|
19
|
+
if ((e.metaKey || e.ctrlKey) && e.key === "f") {
|
|
20
|
+
e.preventDefault();
|
|
21
|
+
setVisible((prev) => !prev);
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
document.addEventListener("keydown", handler);
|
|
25
|
+
return () => document.removeEventListener("keydown", handler);
|
|
26
|
+
}, [isTauri]);
|
|
27
|
+
useEffect(() => {
|
|
28
|
+
const handler = () => {
|
|
29
|
+
findInPageRef.current.stop();
|
|
30
|
+
setVisible(false);
|
|
31
|
+
};
|
|
32
|
+
document.addEventListener("zfb:before-preparation", handler);
|
|
33
|
+
return () => document.removeEventListener("zfb:before-preparation", handler);
|
|
34
|
+
}, []);
|
|
35
|
+
if (!isTauri) return null;
|
|
36
|
+
return /* @__PURE__ */ jsx(
|
|
37
|
+
FindBar,
|
|
38
|
+
{
|
|
39
|
+
visible,
|
|
40
|
+
onClose: () => setVisible(false),
|
|
41
|
+
findInPage: findInPageRef.current,
|
|
42
|
+
containerSelector: CONTENT_SELECTOR
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
FindInPageInit.displayName = "FindInPageInit";
|
|
47
|
+
export {
|
|
48
|
+
FindInPageInit
|
|
49
|
+
};
|
package/dist/footer/footer.js
CHANGED
|
@@ -11,6 +11,7 @@ function Footer(props) {
|
|
|
11
11
|
"footer",
|
|
12
12
|
{
|
|
13
13
|
class: "border-t border-muted bg-surface",
|
|
14
|
+
"data-footer": true,
|
|
14
15
|
...persistKey ? { "data-zfb-transition-persist": persistKey } : {},
|
|
15
16
|
children: /* @__PURE__ */ jsxs("div", { class: "mx-auto max-w-[clamp(50rem,75vw,90rem)] px-hsp-xl py-vsp-xl lg:px-hsp-2xl lg:py-vsp-2xl", children: [
|
|
16
17
|
hasColumns && /* @__PURE__ */ jsxs("div", { class: "grid grid-cols-1 gap-vsp-lg sm:grid-cols-2 lg:grid-cols-[repeat(auto-fit,minmax(12rem,1fr))]", children: [
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Default frontmatter-preview ignore-key list.
|
|
3
|
+
*
|
|
4
|
+
* Ported verbatim from the `create-zudo-doc` base template's
|
|
5
|
+
* `src/config/frontmatter-preview-defaults.ts`
|
|
6
|
+
* `DEFAULT_FRONTMATTER_IGNORE_KEYS` export (epic zudolab/zudo-doc#2651,
|
|
7
|
+
* S4 #2654).
|
|
8
|
+
*
|
|
9
|
+
* These are the schema-managed frontmatter keys handled by the framework
|
|
10
|
+
* that should be hidden from the frontmatter preview by default. Every
|
|
11
|
+
* entry corresponds to a field declared in the default docs schema
|
|
12
|
+
* (`@takazudo/zudo-doc/docs-schema`'s `buildDocsSchema`). A project adding
|
|
13
|
+
* custom frontmatter fields via its own schema should extend this list via
|
|
14
|
+
* `ZudoDocConfig`, not edit it in place.
|
|
15
|
+
*/
|
|
16
|
+
export declare const defaultFrontmatterPreviewIgnoreKeys: readonly string[];
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
const defaultFrontmatterPreviewIgnoreKeys = [
|
|
2
|
+
"title",
|
|
3
|
+
"description",
|
|
4
|
+
"category",
|
|
5
|
+
"sidebar_position",
|
|
6
|
+
"sidebar_label",
|
|
7
|
+
"tags",
|
|
8
|
+
"search_exclude",
|
|
9
|
+
"pagination_next",
|
|
10
|
+
"pagination_prev",
|
|
11
|
+
"draft",
|
|
12
|
+
"unlisted",
|
|
13
|
+
"hide_sidebar",
|
|
14
|
+
"hide_toc",
|
|
15
|
+
"wide",
|
|
16
|
+
"doc_history",
|
|
17
|
+
"standalone",
|
|
18
|
+
"slug",
|
|
19
|
+
"generated",
|
|
20
|
+
"category_no_page",
|
|
21
|
+
"category_sort_order"
|
|
22
|
+
];
|
|
23
|
+
export {
|
|
24
|
+
defaultFrontmatterPreviewIgnoreKeys
|
|
25
|
+
};
|
|
@@ -31,6 +31,8 @@ export interface HeadWithDefaultsSettings {
|
|
|
31
31
|
siteName: string;
|
|
32
32
|
colorMode?: ColorSchemeProviderColorMode | null | false;
|
|
33
33
|
sidebarResizer?: boolean;
|
|
34
|
+
/** Configured theme-pack slug (ADR `docs/adr/theme-packs.md`, #2822). */
|
|
35
|
+
themePack?: string;
|
|
34
36
|
}
|
|
35
37
|
/**
|
|
36
38
|
* Create a `HeadWithDefaults` component from the unified {@link ChromeContext}
|
|
@@ -2,6 +2,10 @@ import { Fragment, jsx, jsxs } from "preact/jsx-runtime";
|
|
|
2
2
|
import { OgTags, TwitterCard } from "../head/index.js";
|
|
3
3
|
import { SIDEBAR_RESIZER_RESTORE_SCRIPT } from "../sidebar-resizer/index.js";
|
|
4
4
|
import ColorSchemeProvider from "../theme/color-scheme-provider.js";
|
|
5
|
+
import ThemePackProvider, {
|
|
6
|
+
themePackVersionMap
|
|
7
|
+
} from "../theme/theme-pack-provider.js";
|
|
8
|
+
import { DEFAULT_THEME_PACK_SLUG } from "../theme-pack-switcher/theme-pack-sync.js";
|
|
5
9
|
import { deriveComposeMetaTitle, deriveColorSchemeGenerators } from "../chrome/derive.js";
|
|
6
10
|
import { assertChromeContext } from "../chrome/assert-chrome-context.js";
|
|
7
11
|
function createHeadWithDefaults(ctx) {
|
|
@@ -11,6 +15,10 @@ function createHeadWithDefaults(ctx) {
|
|
|
11
15
|
const withBase = ctx.withBase;
|
|
12
16
|
const absoluteUrl = ctx.absoluteUrl;
|
|
13
17
|
const { generateCssCustomProperties, generateLightDarkCssProperties } = deriveColorSchemeGenerators(ctx);
|
|
18
|
+
const themePackRegistry = ctx.themePackRegistry;
|
|
19
|
+
const themePackEnabled = themePackRegistry !== null ? themePackVersionMap(themePackRegistry) : null;
|
|
20
|
+
const themePackConfigured = settings.themePack ?? DEFAULT_THEME_PACK_SLUG;
|
|
21
|
+
const themePackBase = withBase("/");
|
|
14
22
|
function HeadWithDefaults({
|
|
15
23
|
title,
|
|
16
24
|
description,
|
|
@@ -48,6 +56,14 @@ function createHeadWithDefaults(ctx) {
|
|
|
48
56
|
}
|
|
49
57
|
),
|
|
50
58
|
/* @__PURE__ */ jsx(ColorSchemeProvider, { cssText, colorMode }),
|
|
59
|
+
themePackEnabled !== null && /* @__PURE__ */ jsx(
|
|
60
|
+
ThemePackProvider,
|
|
61
|
+
{
|
|
62
|
+
configuredSlug: themePackConfigured,
|
|
63
|
+
enabled: themePackEnabled,
|
|
64
|
+
base: themePackBase
|
|
65
|
+
}
|
|
66
|
+
),
|
|
51
67
|
settings.sidebarResizer && /* @__PURE__ */ jsx("script", { dangerouslySetInnerHTML: { __html: SIDEBAR_RESIZER_RESTORE_SCRIPT } }),
|
|
52
68
|
/* @__PURE__ */ jsx("link", { rel: "icon", href: withBase("/favicon.ico"), sizes: "any" }),
|
|
53
69
|
/* @__PURE__ */ jsx("link", { rel: "icon", type: "image/png", sizes: "32x32", href: withBase("/favicon-32x32.png") }),
|
package/dist/header/header.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** @jsxRuntime automatic */
|
|
2
2
|
/** @jsxImportSource preact */
|
|
3
3
|
import type { ComponentChildren, JSX } from "preact";
|
|
4
|
-
import type { HeaderNavItem, HeaderRightItem, Locale } from "./types.js";
|
|
4
|
+
import type { HeaderNavItem, HeaderRightComponentRegistry, HeaderRightItem, Locale } from "./types.js";
|
|
5
5
|
/**
|
|
6
6
|
* Boundary helpers the host injects into `<Header>`. These are the URL
|
|
7
7
|
* builders the legacy header.tsx used to import from `@/utils/base` —
|
|
@@ -71,10 +71,9 @@ export interface HeaderProps {
|
|
|
71
71
|
/** Replacement for the `<Search />` Astro child. */
|
|
72
72
|
search?: ComponentChildren;
|
|
73
73
|
/**
|
|
74
|
-
*
|
|
74
|
+
* Emits `data-zfb-transition-persist={persistKey}` on the
|
|
75
75
|
* `<header>` element so zfb's client-router preserves DOM-node identity
|
|
76
|
-
* across same-locale View Transition swaps.
|
|
77
|
-
* (back-compat default — the header is re-rendered on every swap).
|
|
76
|
+
* across same-locale View Transition swaps.
|
|
78
77
|
*
|
|
79
78
|
* **Locale keying**: callers MUST key by locale (e.g. `"header-en"`,
|
|
80
79
|
* `"header-ja"`). Cross-locale swaps must NOT share the same key; a
|
|
@@ -90,7 +89,7 @@ export interface HeaderProps {
|
|
|
90
89
|
* for consistency, matching the Astro reference implementation
|
|
91
90
|
* (zudolab/zudo-doc#1546).
|
|
92
91
|
*/
|
|
93
|
-
persistKey
|
|
92
|
+
persistKey: string;
|
|
94
93
|
/** Site-name string shown in the logo anchor (host `settings.siteName`). */
|
|
95
94
|
siteName: string;
|
|
96
95
|
/** Header-nav items in render order (host `settings.headerNav`). */
|
|
@@ -105,6 +104,12 @@ export interface HeaderProps {
|
|
|
105
104
|
* wrapper, matching prior behaviour.
|
|
106
105
|
*/
|
|
107
106
|
headerRightItems: HeaderRightItem[];
|
|
107
|
+
/**
|
|
108
|
+
* Host-callable renderers for project-owned component names. The registry is
|
|
109
|
+
* carried through `chromeBindingsModule`; it is never part of the serialized
|
|
110
|
+
* settings payload. Package built-in names are reserved.
|
|
111
|
+
*/
|
|
112
|
+
headerRightComponents?: HeaderRightComponentRegistry;
|
|
108
113
|
/**
|
|
109
114
|
* Whether the host has a `colorMode` config. Required because the
|
|
110
115
|
* `theme-toggle` right-item is two-gated: the filter drops it when
|