@takazudo/zudo-doc 3.3.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 +32 -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 -10
- package/dist/chrome/derive.js +53 -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 +68 -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 +71 -3
- package/dist/color-scheme-utils.js +137 -0
- package/dist/color-schemes-defaults/index.js +13 -0
- package/dist/config.d.ts +28 -12
- package/dist/config.js +11 -2
- 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 +45 -40
- package/dist/design-token-panel-bootstrap.js +98 -21
- package/dist/design-token-panel-config/index.js +1 -4
- 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 +39 -17
- package/dist/doc-body-end-islands/index.js +13 -21
- 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.js +1 -5
- 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 +42 -4
- package/dist/features.css +55 -43
- package/dist/footer/footer.js +1 -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/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 +11 -1
- 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 +19 -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 +2 -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 +27 -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/versions-page/index.d.ts +2 -2
- package/dist/versions-page/index.js +8 -8
- 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 +35 -29
- package/routes-src/404.tsx +4 -1
- package/routes-src/_chrome.tsx +6 -5
- package/routes-src/_context.ts +4 -0
- package/routes-src/_docs-helpers.ts +9 -29
- package/routes-src/_virtual.d.ts +4 -0
- package/virtual-modules.d.ts +4 -0
- package/zfb-config-shim.d.ts +40 -18
- 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/chrome/derive.d.ts
CHANGED
|
@@ -4,7 +4,6 @@ import type { JSX, VNode } from "preact";
|
|
|
4
4
|
import type { ChromeContext, FactoryComponent } from "../factory-context/index.js";
|
|
5
5
|
import type { Settings } from "../settings.js";
|
|
6
6
|
import { type ColorScheme } from "../color-scheme-utils.js";
|
|
7
|
-
import { createBodyEndIslands } from "../doc-body-end-islands/index.js";
|
|
8
7
|
/** Package-default color scheme used when `colorSchemes` is `null` or a key is
|
|
9
8
|
* missing. Exported so `createChrome` keeps the identical fallback. Base roles
|
|
10
9
|
* follow the epic's Default Dark defaults on the minimized 5-base ramp
|
|
@@ -46,15 +45,22 @@ export declare function deriveSearchWidgetSlot(ctx: ChromeContext): (props: {
|
|
|
46
45
|
loadingIndexText: string;
|
|
47
46
|
noResultsText: string;
|
|
48
47
|
}) => JSX.Element;
|
|
49
|
-
/**
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
|
|
48
|
+
/**
|
|
49
|
+
* Derive the body-end islands. The package owns the settings-gated
|
|
50
|
+
* DesignTokenPanelBootstrap + ThemePackSwitcher mounts even when a host
|
|
51
|
+
* supplies a BodyEndIslands override; the override is composed with those
|
|
52
|
+
* package islands rather than replacing them. Without an override,
|
|
53
|
+
* `createBodyEndIslands` already contains the same package islands, so the
|
|
54
|
+
* two paths are deliberately exclusive.
|
|
55
|
+
*
|
|
56
|
+
* The components default to the statically imported package islands
|
|
57
|
+
* (#2658 gate-2 fix; #2821), preserving route → chrome → derive → component
|
|
58
|
+
* scanner reachability for bare `createChrome(routeCtx)` callers. A host may
|
|
59
|
+
* still replace the DTP component through
|
|
60
|
+
* `hostBindings.DesignTokenPanelBootstrap`, but the package remains the sole
|
|
61
|
+
* owner of the mounts and settings gates.
|
|
62
|
+
*/
|
|
63
|
+
export declare function deriveBodyEndIslands(ctx: ChromeContext): (props: import("../doc-body-end-islands/index.js").BodyEndIslandsProps) => JSX.Element;
|
|
58
64
|
/** Derive the DocHistory island: `ctx.hostBindings.DocHistory` when supplied,
|
|
59
65
|
* else the package no-op stub. */
|
|
60
66
|
export declare function deriveDocHistorySlot(ctx: ChromeContext): typeof DocHistoryStub;
|
package/dist/chrome/derive.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Fragment, jsx } from "preact/jsx-runtime";
|
|
1
|
+
import { Fragment, jsx, jsxs } from "preact/jsx-runtime";
|
|
2
2
|
import { createComposeMetaTitle } from "../compose-meta-title/index.js";
|
|
3
3
|
import {
|
|
4
4
|
generateCssCustomProperties,
|
|
@@ -6,7 +6,11 @@ import {
|
|
|
6
6
|
SEMANTIC_RAMP_DEFAULTS
|
|
7
7
|
} from "../color-scheme-utils.js";
|
|
8
8
|
import { createBodyEndIslands } from "../doc-body-end-islands/index.js";
|
|
9
|
+
import { createDesignTokenPanelIsland } from "../doc-body-end-islands/design-token-panel-island.js";
|
|
9
10
|
import { DesignTokenPanelBootstrap } from "../design-token-panel-bootstrap.js";
|
|
11
|
+
import { ThemePackSwitcher } from "../theme-pack-switcher/index.js";
|
|
12
|
+
import { createThemePackSwitcherIsland } from "../doc-body-end-islands/theme-pack-switcher-island.js";
|
|
13
|
+
import { DEFAULT_THEME_PACK_SLUG } from "../theme-pack-switcher/theme-pack-sync.js";
|
|
10
14
|
import { SearchWidget } from "../search-widget/index.js";
|
|
11
15
|
import { createMdxComponents } from "../mdx-components/index.js";
|
|
12
16
|
import { createCategoryNavWrapper } from "../category-nav/index.js";
|
|
@@ -51,7 +55,8 @@ const DEFAULT_SCHEME = {
|
|
|
51
55
|
fg: { base: 0 },
|
|
52
56
|
selectionBg: { base: 2 },
|
|
53
57
|
selectionFg: { base: 0 },
|
|
54
|
-
semantic: { ...SEMANTIC_RAMP_DEFAULTS }
|
|
58
|
+
semantic: { ...SEMANTIC_RAMP_DEFAULTS },
|
|
59
|
+
syntax: {}
|
|
55
60
|
}
|
|
56
61
|
};
|
|
57
62
|
function DocHistoryStub(_props) {
|
|
@@ -146,11 +151,55 @@ function deriveSearchWidgetSlot(ctx) {
|
|
|
146
151
|
}
|
|
147
152
|
return ctx.hostBindings.SearchWidget ?? SearchWidgetBound;
|
|
148
153
|
}
|
|
154
|
+
function deriveThemePackSwitcherProps(ctx) {
|
|
155
|
+
const registry = ctx.themePackRegistry;
|
|
156
|
+
if (registry == null) return null;
|
|
157
|
+
return {
|
|
158
|
+
active: ctx.settings.themePack ?? DEFAULT_THEME_PACK_SLUG,
|
|
159
|
+
order: registry.map((entry) => ({
|
|
160
|
+
slug: entry.slug,
|
|
161
|
+
name: entry.meta.name,
|
|
162
|
+
mode: entry.meta.mode,
|
|
163
|
+
description: entry.meta.description
|
|
164
|
+
})),
|
|
165
|
+
// Base prefix WITH trailing slash — the head-with-defaults themePackBase
|
|
166
|
+
// convention; the dialog (#2825) concatenates "theme-packs/index.json".
|
|
167
|
+
base: ctx.withBase("/")
|
|
168
|
+
};
|
|
169
|
+
}
|
|
149
170
|
function deriveBodyEndIslands(ctx) {
|
|
150
|
-
|
|
151
|
-
settings: ctx.settings,
|
|
171
|
+
const designTokenPanelDeps = {
|
|
152
172
|
DesignTokenPanelBootstrap: ctx.hostBindings.DesignTokenPanelBootstrap ?? DesignTokenPanelBootstrap
|
|
173
|
+
};
|
|
174
|
+
const themePackSwitcherDeps = {
|
|
175
|
+
themePackSwitcherProps: deriveThemePackSwitcherProps(ctx),
|
|
176
|
+
ThemePackSwitcher
|
|
177
|
+
};
|
|
178
|
+
const HostBodyEndIslands = ctx.hostBindings.BodyEndIslands;
|
|
179
|
+
if (!HostBodyEndIslands) {
|
|
180
|
+
return createBodyEndIslands({
|
|
181
|
+
settings: ctx.settings,
|
|
182
|
+
...designTokenPanelDeps,
|
|
183
|
+
...themePackSwitcherDeps
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
const DesignTokenPanelIsland = createDesignTokenPanelIsland({
|
|
187
|
+
designTokenPanel: ctx.settings.designTokenPanel,
|
|
188
|
+
...designTokenPanelDeps
|
|
153
189
|
});
|
|
190
|
+
const ThemePackSwitcherIsland = createThemePackSwitcherIsland({
|
|
191
|
+
themePackSwitcher: ctx.settings.themePackSwitcher === true,
|
|
192
|
+
...themePackSwitcherDeps
|
|
193
|
+
});
|
|
194
|
+
const HostBodyEnd = HostBodyEndIslands;
|
|
195
|
+
function BodyEndIslands(props) {
|
|
196
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
197
|
+
/* @__PURE__ */ jsx(HostBodyEnd, { ...props }),
|
|
198
|
+
/* @__PURE__ */ jsx(DesignTokenPanelIsland, {}),
|
|
199
|
+
/* @__PURE__ */ jsx(ThemePackSwitcherIsland, {})
|
|
200
|
+
] });
|
|
201
|
+
}
|
|
202
|
+
return BodyEndIslands;
|
|
154
203
|
}
|
|
155
204
|
function deriveDocHistorySlot(ctx) {
|
|
156
205
|
return ctx.hostBindings.DocHistory ?? DocHistoryStub;
|
package/dist/chrome/index.d.ts
CHANGED
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
/** @jsxImportSource preact */
|
|
3
3
|
import type { RouteContext, ChromeHostBindings } from "../factory-context/index.js";
|
|
4
4
|
import type { Settings } from "../settings.js";
|
|
5
|
+
import type { JSX, VNode } from "preact";
|
|
6
|
+
import type { HeaderWithDefaultsProps } from "../header-with-defaults/index.js";
|
|
7
|
+
import type { SidebarWithDefaultsProps } from "../sidebar-with-defaults/index.js";
|
|
5
8
|
/**
|
|
6
9
|
* Build the wired page-chrome factories from a reconstructed route context plus
|
|
7
10
|
* the host-bound slots. Assembles a {@link ChromeContext} (route context +
|
|
@@ -12,27 +15,27 @@ import type { Settings } from "../settings.js";
|
|
|
12
15
|
*/
|
|
13
16
|
export declare function createChrome<S extends Settings = Settings>(context: RouteContext<S>, hostBindings?: ChromeHostBindings): {
|
|
14
17
|
composeMetaTitle: (title: string) => string;
|
|
15
|
-
HeadWithDefaults: (props: import("../head-with-defaults/index.js").HeadWithDefaultsProps) =>
|
|
16
|
-
HeaderWithDefaults: (props:
|
|
18
|
+
HeadWithDefaults: (props: import("../head-with-defaults/index.js").HeadWithDefaultsProps) => JSX.Element;
|
|
19
|
+
HeaderWithDefaults: (props: HeaderWithDefaultsProps) => JSX.Element;
|
|
17
20
|
FooterWithDefaults: (props: {
|
|
18
21
|
lang?: string;
|
|
19
|
-
}) =>
|
|
20
|
-
SidebarWithDefaults: (props:
|
|
21
|
-
renderDocPage: (props: import("../doc-page-props/index.js").DocPageBaseProps, opts: import("../doc-page-renderer/index.js").RenderDocPageOptions) =>
|
|
22
|
-
VersionsPageView: (props: import("../versions-page/index.js").VersionsPageViewProps) =>
|
|
22
|
+
}) => VNode;
|
|
23
|
+
SidebarWithDefaults: (props: SidebarWithDefaultsProps) => JSX.Element;
|
|
24
|
+
renderDocPage: (props: import("../doc-page-props/index.js").DocPageBaseProps, opts: import("../doc-page-renderer/index.js").RenderDocPageOptions) => JSX.Element;
|
|
25
|
+
VersionsPageView: (props: import("../versions-page/index.js").VersionsPageViewProps) => JSX.Element;
|
|
23
26
|
collectTagMapForLocale: (locale: string) => Map<string, import("../tag-pages/index.js").TagInfo>;
|
|
24
27
|
TagDetailPageView: (props: {
|
|
25
28
|
locale: string;
|
|
26
29
|
tag: string;
|
|
27
30
|
tagInfo: import("../tag-pages/index.js").TagInfo;
|
|
28
|
-
}) =>
|
|
31
|
+
}) => JSX.Element;
|
|
29
32
|
TagsIndexPageView: (props: {
|
|
30
33
|
locale: string;
|
|
31
34
|
children?: import("preact").ComponentChildren;
|
|
32
|
-
}) =>
|
|
35
|
+
}) => JSX.Element;
|
|
33
36
|
SiteTreeNavWrapper: import("../factory-context/index.js").FactoryComponent;
|
|
34
|
-
BodyEndIslands: (props: import("../doc-body-end-islands/index.js").BodyEndIslandsProps) =>
|
|
35
|
-
HomePageView: (props: import("../home-page/index.js").HomePageViewProps) =>
|
|
37
|
+
BodyEndIslands: (props: import("../doc-body-end-islands/index.js").BodyEndIslandsProps) => JSX.Element;
|
|
38
|
+
HomePageView: (props: import("../home-page/index.js").HomePageViewProps) => JSX.Element;
|
|
36
39
|
};
|
|
37
40
|
/** The wired page-chrome surface returned by {@link createChrome}. */
|
|
38
41
|
export type Chrome = ReturnType<typeof createChrome>;
|
package/dist/chrome/index.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
+
import { Fragment, jsx } from "preact/jsx-runtime";
|
|
1
2
|
import { createHeadWithDefaults } from "../head-with-defaults/index.js";
|
|
2
|
-
import { createHeaderWithDefaults } from "../header-with-defaults/index.js";
|
|
3
|
-
import { createFooterWithDefaults } from "../footer-with-defaults/index.js";
|
|
4
|
-
import { createSidebarWithDefaults } from "../sidebar-with-defaults/index.js";
|
|
5
3
|
import { createRenderDocPage } from "../doc-page-renderer/index.js";
|
|
6
4
|
import { createVersionsPageView } from "../versions-page/index.js";
|
|
7
5
|
import { createTagPages } from "../tag-pages/index.js";
|
|
@@ -11,14 +9,22 @@ import {
|
|
|
11
9
|
deriveBodyEndIslands,
|
|
12
10
|
deriveMdxComponents
|
|
13
11
|
} from "./derive.js";
|
|
12
|
+
import { derivePrimaryChromeSlots } from "./primary-slots.js";
|
|
14
13
|
function createChrome(context, hostBindings = {}) {
|
|
15
14
|
const components = {};
|
|
16
15
|
const ctx = { ...context, components, hostBindings };
|
|
17
16
|
const composeMetaTitle = deriveComposeMetaTitle(ctx);
|
|
18
17
|
const HeadWithDefaults = createHeadWithDefaults(ctx);
|
|
19
|
-
const
|
|
20
|
-
const
|
|
21
|
-
const
|
|
18
|
+
const primary = derivePrimaryChromeSlots(ctx);
|
|
19
|
+
const HeaderWithDefaults = (props) => /* @__PURE__ */ jsx(Fragment, { children: primary.Header({ ...props, lang: props.lang ?? context.defaultLocale }) });
|
|
20
|
+
const FooterWithDefaults = (props) => /* @__PURE__ */ jsx(Fragment, { children: primary.Footer({ lang: props.lang ?? context.defaultLocale }) });
|
|
21
|
+
const SidebarWithDefaults = (props) => /* @__PURE__ */ jsx(Fragment, { children: primary.Sidebar({
|
|
22
|
+
currentSlug: props.currentSlug ?? "",
|
|
23
|
+
lang: props.lang ?? context.defaultLocale,
|
|
24
|
+
navSection: props.navSection,
|
|
25
|
+
currentVersion: props.currentVersion,
|
|
26
|
+
currentPath: props.currentPath ?? ""
|
|
27
|
+
}) });
|
|
22
28
|
const renderDocPage = createRenderDocPage(ctx);
|
|
23
29
|
const VersionsPageView = createVersionsPageView(ctx);
|
|
24
30
|
const { collectTagMapForLocale, TagDetailPageView, TagsIndexPageView } = createTagPages(ctx);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/** @jsxRuntime automatic */
|
|
2
|
+
/** @jsxImportSource preact */
|
|
3
|
+
import type { ComponentChildren } from "preact";
|
|
4
|
+
import type { ChromeContext } from "../factory-context/index.js";
|
|
5
|
+
import type { BreadcrumbSlotProps, DocPagerSlotProps, FooterSlotProps, HeaderSlotProps, SidebarSlotProps, TocSlotProps } from "../chrome-bindings.js";
|
|
6
|
+
import type { Settings } from "../settings.js";
|
|
7
|
+
type PrimarySlot<P> = (props: P) => ComponentChildren;
|
|
8
|
+
/**
|
|
9
|
+
* Resolve all six primary chrome components through one binding object.
|
|
10
|
+
* Accessors keep package defaults lazy: a home view that only reads Header and
|
|
11
|
+
* Footer does not construct the doc-only Sidebar or DocPager factories.
|
|
12
|
+
*/
|
|
13
|
+
export declare function derivePrimaryChromeSlots<S extends Settings = Settings>(ctx: ChromeContext<S>): {
|
|
14
|
+
readonly Header: PrimarySlot<HeaderSlotProps>;
|
|
15
|
+
readonly Footer: PrimarySlot<FooterSlotProps>;
|
|
16
|
+
readonly Sidebar: PrimarySlot<SidebarSlotProps>;
|
|
17
|
+
readonly Toc: PrimarySlot<TocSlotProps>;
|
|
18
|
+
readonly Breadcrumb: PrimarySlot<BreadcrumbSlotProps>;
|
|
19
|
+
readonly DocPager: PrimarySlot<DocPagerSlotProps>;
|
|
20
|
+
};
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { createHeaderWithDefaults } from "../header-with-defaults/index.js";
|
|
2
|
+
import { createFooterWithDefaults } from "../footer-with-defaults/index.js";
|
|
3
|
+
import { createSidebarWithDefaults } from "../sidebar-with-defaults/index.js";
|
|
4
|
+
import { Toc } from "../toc/index.js";
|
|
5
|
+
import { Breadcrumb } from "../breadcrumb/index.js";
|
|
6
|
+
import { createDocPager } from "../doc-pager/index.js";
|
|
7
|
+
function resolvePrimarySlot(slot, replacement, createPackageDefault) {
|
|
8
|
+
if (replacement !== void 0 && typeof replacement !== "function") {
|
|
9
|
+
throw new TypeError(
|
|
10
|
+
`Invalid primary chrome replacement at chromeBindings.${slot}: expected a callable component. Export ${slot} from the object built with defineChromeBindings() and point settings.chromeBindingsModule at that module.`
|
|
11
|
+
);
|
|
12
|
+
}
|
|
13
|
+
return replacement ? replacement : createPackageDefault();
|
|
14
|
+
}
|
|
15
|
+
function derivePrimaryChromeSlots(ctx) {
|
|
16
|
+
return {
|
|
17
|
+
get Header() {
|
|
18
|
+
return resolvePrimarySlot(
|
|
19
|
+
"Header",
|
|
20
|
+
ctx.hostBindings.Header,
|
|
21
|
+
() => createHeaderWithDefaults(ctx)
|
|
22
|
+
);
|
|
23
|
+
},
|
|
24
|
+
get Footer() {
|
|
25
|
+
return resolvePrimarySlot(
|
|
26
|
+
"Footer",
|
|
27
|
+
ctx.hostBindings.Footer,
|
|
28
|
+
() => createFooterWithDefaults(ctx)
|
|
29
|
+
);
|
|
30
|
+
},
|
|
31
|
+
get Sidebar() {
|
|
32
|
+
return resolvePrimarySlot(
|
|
33
|
+
"Sidebar",
|
|
34
|
+
ctx.hostBindings.Sidebar,
|
|
35
|
+
() => createSidebarWithDefaults(ctx)
|
|
36
|
+
);
|
|
37
|
+
},
|
|
38
|
+
get Toc() {
|
|
39
|
+
return resolvePrimarySlot("Toc", ctx.hostBindings.Toc, () => Toc);
|
|
40
|
+
},
|
|
41
|
+
get Breadcrumb() {
|
|
42
|
+
return resolvePrimarySlot(
|
|
43
|
+
"Breadcrumb",
|
|
44
|
+
ctx.hostBindings.Breadcrumb,
|
|
45
|
+
() => Breadcrumb
|
|
46
|
+
);
|
|
47
|
+
},
|
|
48
|
+
get DocPager() {
|
|
49
|
+
return resolvePrimarySlot(
|
|
50
|
+
"DocPager",
|
|
51
|
+
ctx.hostBindings.DocPager,
|
|
52
|
+
() => createDocPager(ctx)
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
export {
|
|
58
|
+
derivePrimaryChromeSlots
|
|
59
|
+
};
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
+
import type { ComponentChildren } from "preact";
|
|
2
|
+
import type { BreadcrumbItem } from "./breadcrumb/index.js";
|
|
3
|
+
import type { DocPageNavNode } from "./doc-page-shell/index.js";
|
|
4
|
+
import type { HeadingItem } from "./toc/index.js";
|
|
1
5
|
import type { ChromeHostBindings } from "./factory-context/index.js";
|
|
6
|
+
import type { HeaderRightComponentRegistry } from "./header/types.js";
|
|
2
7
|
/**
|
|
3
8
|
* Props the header passes to the `SearchWidget` slot — the 7 locale-aware
|
|
4
9
|
* strings from `header-with-defaults`'s `<SearchWidget … />` render (via
|
|
@@ -68,13 +73,76 @@ export interface FrontmatterRendererSlotProps {
|
|
|
68
73
|
data: Record<string, unknown>;
|
|
69
74
|
locale?: string;
|
|
70
75
|
}
|
|
76
|
+
/**
|
|
77
|
+
* Props supplied at every package `Header` replacement call site. `lang` is
|
|
78
|
+
* always present; the remaining fields are route-specific.
|
|
79
|
+
*/
|
|
80
|
+
export interface HeaderSlotProps {
|
|
81
|
+
lang: string;
|
|
82
|
+
currentPath?: string;
|
|
83
|
+
currentVersion?: string;
|
|
84
|
+
currentSlug?: string;
|
|
85
|
+
navSection?: string;
|
|
86
|
+
}
|
|
87
|
+
/** Props supplied at every package `Footer` replacement call site. */
|
|
88
|
+
export interface FooterSlotProps {
|
|
89
|
+
lang: string;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Props supplied to the doc-route `Sidebar` replacement. Properties whose
|
|
93
|
+
* values may be absent remain present with `undefined`, matching the real JSX
|
|
94
|
+
* call site.
|
|
95
|
+
*/
|
|
96
|
+
export interface SidebarSlotProps {
|
|
97
|
+
currentSlug: string;
|
|
98
|
+
lang: string;
|
|
99
|
+
navSection: string | undefined;
|
|
100
|
+
currentVersion: string | undefined;
|
|
101
|
+
currentPath: string;
|
|
102
|
+
}
|
|
103
|
+
/** Props supplied to the desktop `Toc` replacement. */
|
|
104
|
+
export interface TocSlotProps {
|
|
105
|
+
headings: readonly HeadingItem[];
|
|
106
|
+
title: string;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Props supplied to `Breadcrumb` replacements. All package call sites provide
|
|
110
|
+
* pre-built items; doc routes additionally provide the optional right slot.
|
|
111
|
+
*/
|
|
112
|
+
export interface BreadcrumbSlotProps {
|
|
113
|
+
items: BreadcrumbItem[];
|
|
114
|
+
rightSlot?: ComponentChildren;
|
|
115
|
+
}
|
|
116
|
+
/** Props supplied to the doc-route `DocPager` replacement. */
|
|
117
|
+
export interface DocPagerSlotProps {
|
|
118
|
+
prev: DocPageNavNode | null;
|
|
119
|
+
next: DocPageNavNode | null;
|
|
120
|
+
locale: string;
|
|
121
|
+
}
|
|
71
122
|
/**
|
|
72
123
|
* The compile-time-checked input for {@link defineChromeBindings}. See the
|
|
73
124
|
* module header for the drift-detection rationale.
|
|
74
125
|
*/
|
|
75
126
|
export interface ChromeBindingsInput {
|
|
127
|
+
/** Primary header replacement — see {@link HeaderSlotProps}. */
|
|
128
|
+
Header?: (props: HeaderSlotProps) => unknown;
|
|
129
|
+
/** Primary footer replacement — see {@link FooterSlotProps}. */
|
|
130
|
+
Footer?: (props: FooterSlotProps) => unknown;
|
|
131
|
+
/** Primary doc-sidebar replacement — see {@link SidebarSlotProps}. */
|
|
132
|
+
Sidebar?: (props: SidebarSlotProps) => unknown;
|
|
133
|
+
/** Primary desktop TOC replacement — see {@link TocSlotProps}. */
|
|
134
|
+
Toc?: (props: TocSlotProps) => unknown;
|
|
135
|
+
/** Primary breadcrumb replacement — see {@link BreadcrumbSlotProps}. */
|
|
136
|
+
Breadcrumb?: (props: BreadcrumbSlotProps) => unknown;
|
|
137
|
+
/** Primary previous/next pager replacement — see {@link DocPagerSlotProps}. */
|
|
138
|
+
DocPager?: (props: DocPagerSlotProps) => unknown;
|
|
76
139
|
/** Header search widget — see {@link SearchWidgetSlotProps}. */
|
|
77
140
|
SearchWidget?: (props: SearchWidgetSlotProps) => unknown;
|
|
141
|
+
/**
|
|
142
|
+
* Named header-right renderers. Values are callable-only and receive the
|
|
143
|
+
* exact `HeaderRightComponentProps` used by the header renderer.
|
|
144
|
+
*/
|
|
145
|
+
headerRightComponents?: HeaderRightComponentRegistry;
|
|
78
146
|
/** Body-end bootstrap islands — see {@link BodyEndIslandsSlotProps}. */
|
|
79
147
|
BodyEndIslands?: (props: BodyEndIslandsSlotProps) => unknown;
|
|
80
148
|
/** DocHistory island — see {@link DocHistorySlotProps}. */
|
|
@@ -1 +1,5 @@
|
|
|
1
|
+
/** Highlighted blocks emitted by the current class-mode highlighter. */
|
|
2
|
+
export declare const HIGHLIGHTED_CODE_BLOCK_SELECTOR = "pre.hi-root";
|
|
3
|
+
/** Highlighted blocks plus the intentional raw-code fallback inside tabs. */
|
|
4
|
+
export declare const CODE_BLOCK_ENHANCER_SELECTOR = "pre.hi-root, .tab-panel pre";
|
|
1
5
|
export declare const CODE_BLOCK_ENHANCER_SCRIPT: string;
|
|
@@ -2,6 +2,8 @@ import {
|
|
|
2
2
|
AFTER_NAVIGATE_EVENT,
|
|
3
3
|
BEFORE_NAVIGATE_EVENT
|
|
4
4
|
} from "../transitions/page-events.js";
|
|
5
|
+
const HIGHLIGHTED_CODE_BLOCK_SELECTOR = "pre.hi-root";
|
|
6
|
+
const CODE_BLOCK_ENHANCER_SELECTOR = `${HIGHLIGHTED_CODE_BLOCK_SELECTOR}, .tab-panel pre`;
|
|
5
7
|
const CODE_BLOCK_ENHANCER_SCRIPT = `(function () {
|
|
6
8
|
// Single shared ResizeObserver for all code blocks on the page.
|
|
7
9
|
var wrapButtons = new Map();
|
|
@@ -14,15 +16,14 @@ const CODE_BLOCK_ENHANCER_SCRIPT = `(function () {
|
|
|
14
16
|
|
|
15
17
|
function enhanceCodeBlocks() {
|
|
16
18
|
// Selector covers two shapes:
|
|
17
|
-
// 1. pre.
|
|
18
|
-
// is anchored or merged with other classes).
|
|
19
|
+
// 1. pre.hi-root from the class-mode highlighter.
|
|
19
20
|
// 2. bare pre inside .tab-panel (TabItem) wrappers where some
|
|
20
21
|
// pipelines emit class-less pre elements.
|
|
21
22
|
// No backticks in this comment: this whole script body lives inside
|
|
22
23
|
// a template literal in the host .ts module, so an inline backtick
|
|
23
24
|
// would close the literal and make 'panel' a free identifier.
|
|
24
25
|
var pres = document.querySelectorAll(
|
|
25
|
-
|
|
26
|
+
${JSON.stringify(CODE_BLOCK_ENHANCER_SELECTOR)},
|
|
26
27
|
);
|
|
27
28
|
|
|
28
29
|
for (var pi = 0; pi < pres.length; pi++) {
|
|
@@ -161,5 +162,7 @@ const CODE_BLOCK_ENHANCER_SCRIPT = `(function () {
|
|
|
161
162
|
document.addEventListener(${JSON.stringify(AFTER_NAVIGATE_EVENT)}, enhanceCodeBlocks);
|
|
162
163
|
})();`;
|
|
163
164
|
export {
|
|
164
|
-
CODE_BLOCK_ENHANCER_SCRIPT
|
|
165
|
+
CODE_BLOCK_ENHANCER_SCRIPT,
|
|
166
|
+
CODE_BLOCK_ENHANCER_SELECTOR,
|
|
167
|
+
HIGHLIGHTED_CODE_BLOCK_SELECTOR
|
|
165
168
|
};
|
|
@@ -8,7 +8,8 @@ import type { JSX } from "preact";
|
|
|
8
8
|
* and emits the code-block enhancer init script via `dangerouslySetInnerHTML`.
|
|
9
9
|
*
|
|
10
10
|
* The script:
|
|
11
|
-
* - Wraps each `<pre
|
|
11
|
+
* - Wraps each highlighted `<pre>` (`.hi-root`) and raw tab-panel fallback in
|
|
12
|
+
* a `.code-block-wrapper` container.
|
|
12
13
|
* - Adds a copy-to-clipboard button and a word-wrap toggle button.
|
|
13
14
|
* - Observes resize events to hide the wrap button when content fits.
|
|
14
15
|
* - Handles before-navigate cleanup and after-navigate re-init for View
|
|
@@ -16,4 +17,3 @@ import type { JSX } from "preact";
|
|
|
16
17
|
* `AFTER_NAVIGATE_EVENT` in `../transitions/page-events.ts`.
|
|
17
18
|
*/
|
|
18
19
|
export declare function CodeBlockEnhancer(): JSX.Element;
|
|
19
|
-
export default CodeBlockEnhancer;
|
|
@@ -6,8 +6,6 @@ function CodeBlockEnhancer() {
|
|
|
6
6
|
/* @__PURE__ */ jsx("script", { dangerouslySetInnerHTML: { __html: CODE_BLOCK_ENHANCER_SCRIPT } })
|
|
7
7
|
] });
|
|
8
8
|
}
|
|
9
|
-
var code_block_enhancer_default = CodeBlockEnhancer;
|
|
10
9
|
export {
|
|
11
|
-
CodeBlockEnhancer
|
|
12
|
-
code_block_enhancer_default as default
|
|
10
|
+
CodeBlockEnhancer
|
|
13
11
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export { CodeBlockEnhancer
|
|
1
|
+
export { CodeBlockEnhancer } from "./code-block-enhancer.js";
|
|
2
2
|
export { CODE_BLOCK_ENHANCER_SCRIPT } from "./code-block-enhancer-script.js";
|
|
3
|
-
export { MermaidInit
|
|
3
|
+
export { MermaidInit } from "./mermaid-init.js";
|
|
4
4
|
export type { MermaidInitProps } from "./mermaid-init.js";
|
|
5
|
-
export {
|
|
6
|
-
export { Tabs
|
|
5
|
+
export { MERMAID_CDN_MODULE_URL, buildMermaidInitScript, } from "./mermaid-init-script.js";
|
|
6
|
+
export { Tabs } from "./tabs.js";
|
|
7
7
|
export type { TabsProps } from "./tabs.js";
|
|
8
|
-
export { TabsInit
|
|
8
|
+
export { TabsInit } from "./tabs-init.js";
|
|
9
9
|
export { TABS_INIT_SCRIPT } from "./tabs-init-script.js";
|
|
@@ -1,29 +1,20 @@
|
|
|
1
|
-
import { CodeBlockEnhancer
|
|
1
|
+
import { CodeBlockEnhancer } from "./code-block-enhancer.js";
|
|
2
2
|
import { CODE_BLOCK_ENHANCER_SCRIPT } from "./code-block-enhancer-script.js";
|
|
3
|
+
import { MermaidInit } from "./mermaid-init.js";
|
|
3
4
|
import {
|
|
4
|
-
MermaidInit,
|
|
5
|
-
default as default3
|
|
6
|
-
} from "./mermaid-init.js";
|
|
7
|
-
import {
|
|
8
|
-
MERMAID_INIT_SCRIPT,
|
|
9
5
|
MERMAID_CDN_MODULE_URL,
|
|
10
6
|
buildMermaidInitScript
|
|
11
7
|
} from "./mermaid-init-script.js";
|
|
12
|
-
import { Tabs
|
|
13
|
-
import { TabsInit
|
|
8
|
+
import { Tabs } from "./tabs.js";
|
|
9
|
+
import { TabsInit } from "./tabs-init.js";
|
|
14
10
|
import { TABS_INIT_SCRIPT } from "./tabs-init-script.js";
|
|
15
11
|
export {
|
|
16
12
|
CODE_BLOCK_ENHANCER_SCRIPT,
|
|
17
13
|
CodeBlockEnhancer,
|
|
18
|
-
default2 as CodeBlockEnhancerDefault,
|
|
19
14
|
MERMAID_CDN_MODULE_URL,
|
|
20
|
-
MERMAID_INIT_SCRIPT,
|
|
21
15
|
MermaidInit,
|
|
22
|
-
default3 as MermaidInitDefault,
|
|
23
16
|
TABS_INIT_SCRIPT,
|
|
24
17
|
Tabs,
|
|
25
|
-
default4 as TabsDefault,
|
|
26
18
|
TabsInit,
|
|
27
|
-
default5 as TabsInitDefault,
|
|
28
19
|
buildMermaidInitScript
|
|
29
20
|
};
|
|
@@ -20,30 +20,9 @@ export declare const MERMAID_CDN_MODULE_URL = "https://esm.sh/mermaid@11.15.0";
|
|
|
20
20
|
/**
|
|
21
21
|
* Build the inline init script with a caller-supplied module URL.
|
|
22
22
|
*
|
|
23
|
-
*
|
|
24
|
-
* constant interpolates `MERMAID_CDN_MODULE_URL` at module-load time,
|
|
25
|
-
* so reassigning the exported binding has no runtime effect — ESM
|
|
26
|
-
* exports are read-only and the script string is already frozen by
|
|
27
|
-
* the time consumers see it. Hosts that need a self-hosted /
|
|
23
|
+
* Hosts that need a self-hosted /
|
|
28
24
|
* version-pinned / CSP-allowlisted mermaid URL call this builder
|
|
29
25
|
* with their URL and pass the result to `<MermaidInit script={…}/>`
|
|
30
26
|
* (or to their own `<script dangerouslySetInnerHTML>` site).
|
|
31
|
-
*
|
|
32
|
-
* The default-URL flow stays available via `MERMAID_INIT_SCRIPT`
|
|
33
|
-
* (built once below by calling this builder with
|
|
34
|
-
* `MERMAID_CDN_MODULE_URL`) so existing callers keep working
|
|
35
|
-
* unchanged.
|
|
36
27
|
*/
|
|
37
28
|
export declare function buildMermaidInitScript(cdnUrl: string): string;
|
|
38
|
-
/**
|
|
39
|
-
* Default-URL init script. Built once at module load by passing
|
|
40
|
-
* `MERMAID_CDN_MODULE_URL` to `buildMermaidInitScript`. Kept as the
|
|
41
|
-
* primary export for backward compatibility — `<MermaidInit/>` (no
|
|
42
|
-
* props) and any direct consumer that grabs this string both end up
|
|
43
|
-
* importing mermaid from `https://esm.sh/mermaid@11`.
|
|
44
|
-
*
|
|
45
|
-
* For a custom URL (self-hosted mirror, version-pinned package,
|
|
46
|
-
* CSP-allowlisted host) call `buildMermaidInitScript(yourUrl)` and
|
|
47
|
-
* pass the result to `<MermaidInit script={…}/>`.
|
|
48
|
-
*/
|
|
49
|
-
export declare const MERMAID_INIT_SCRIPT: string;
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { jsx } from "preact/jsx-runtime";
|
|
2
2
|
import {
|
|
3
|
-
|
|
3
|
+
MERMAID_CDN_MODULE_URL,
|
|
4
4
|
buildMermaidInitScript
|
|
5
5
|
} from "./mermaid-init-script.js";
|
|
6
|
+
const MERMAID_INIT_SCRIPT = buildMermaidInitScript(MERMAID_CDN_MODULE_URL);
|
|
6
7
|
function MermaidInit(props = {}) {
|
|
7
8
|
const script = props.script ?? (props.cdnUrl ? buildMermaidInitScript(props.cdnUrl) : MERMAID_INIT_SCRIPT);
|
|
8
9
|
return /* @__PURE__ */ jsx("script", { dangerouslySetInnerHTML: { __html: script } });
|
|
9
10
|
}
|
|
10
|
-
var mermaid_init_default = MermaidInit;
|
|
11
11
|
export {
|
|
12
|
-
MermaidInit
|
|
13
|
-
mermaid_init_default as default
|
|
12
|
+
MermaidInit
|
|
14
13
|
};
|
|
@@ -3,8 +3,6 @@ import { TABS_INIT_SCRIPT } from "./tabs-init-script.js";
|
|
|
3
3
|
function TabsInit() {
|
|
4
4
|
return /* @__PURE__ */ jsx("script", { dangerouslySetInnerHTML: { __html: TABS_INIT_SCRIPT } });
|
|
5
5
|
}
|
|
6
|
-
var tabs_init_default = TabsInit;
|
|
7
6
|
export {
|
|
8
|
-
TabsInit
|
|
9
|
-
tabs_init_default as default
|
|
7
|
+
TabsInit
|
|
10
8
|
};
|