@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
|
@@ -1,28 +1,48 @@
|
|
|
1
|
+
/** @jsxRuntime automatic */
|
|
2
|
+
/** @jsxImportSource preact */
|
|
1
3
|
/**
|
|
2
|
-
* Design-token panel (zdtp) WIRING MECHANISM
|
|
4
|
+
* Design-token panel (zdtp) WIRING MECHANISM + PACKAGE-DEFAULT ISLAND (#2658,
|
|
5
|
+
* epic Minimal Scaffold #2651).
|
|
3
6
|
*
|
|
4
|
-
*
|
|
5
|
-
* hooks to zfb's navigation events via
|
|
6
|
-
*
|
|
7
|
+
* `bootstrapDesignTokenPanel` is a callable that configures zdtp's panel and
|
|
8
|
+
* wires its lifecycle hooks to zfb's navigation events via
|
|
9
|
+
* `setLifecycleAdapter()`. It receives a mode-scoped PanelConfig builder —
|
|
10
|
+
* either a project override or the package default from
|
|
11
|
+
* `@takazudo/zudo-doc/design-token-panel-config`.
|
|
7
12
|
*
|
|
8
|
-
*
|
|
13
|
+
* The current call shape is a mode-scoped builder. It rebuilds the panel per
|
|
14
|
+
* light/dark mode on every `color-scheme-changed` toggle:
|
|
9
15
|
*
|
|
10
|
-
* // Mode-scoped builder (showcase host) — rebuilds the panel per light/dark
|
|
11
|
-
* // mode on every `color-scheme-changed` toggle:
|
|
12
16
|
* import { bootstrapDesignTokenPanel } from "@takazudo/zudo-doc/design-token-panel-bootstrap";
|
|
13
17
|
* import { buildDesignTokenPanelConfig } from "@/config/design-token-panel-config";
|
|
14
18
|
* bootstrapDesignTokenPanel(buildDesignTokenPanelConfig);
|
|
15
19
|
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
20
|
+
* `DesignTokenPanelBootstrap` (below) is the PACKAGE-OWNED island component
|
|
21
|
+
* that wires the mode-scoped builder for package-owned routes with no host
|
|
22
|
+
* config file — the #2658 "Approach (a)" package default. It resolves its
|
|
23
|
+
* builder from the `virtual:zudo-doc-design-token-panel-config` virtual
|
|
24
|
+
* module the routes plugin registers (`../plugins/routes.ts`): absent a host
|
|
25
|
+
* `designTokenPanelConfigModule` override, that resolves to
|
|
26
|
+
* `@takazudo/zudo-doc/design-token-panel-config`'s `buildDesignTokenPanelConfig`.
|
|
27
|
+
* `packages/zudo-doc/src/chrome/derive.tsx` statically imports it so zfb's
|
|
28
|
+
* island scanner walks route → chrome → derive → here (mirrors the DocHistory
|
|
29
|
+
* #2480 static-import contract). A host that ejects entirely can call
|
|
30
|
+
* `bootstrapDesignTokenPanel` with its own builder, but current package-owned
|
|
31
|
+
* routes use this component directly.
|
|
19
32
|
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
33
|
+
* KNOWN COUPLING: `DesignTokenPanelBootstrap`'s top-level import of
|
|
34
|
+
* `virtual:zudo-doc-design-token-panel-config` requires the routes plugin
|
|
35
|
+
* (`settings.packageOwnedRoutes`, default `true`) to be active in the
|
|
36
|
+
* consuming project, since that plugin is what registers the virtual module.
|
|
37
|
+
* A project that explicitly sets `packageOwnedRoutes: false` AND wants to
|
|
38
|
+
* reuse the bare `bootstrapDesignTokenPanel` export for its own component is
|
|
39
|
+
* unaffected — that import graph never reaches `DesignTokenPanelBootstrap` —
|
|
40
|
+
* but a `packageOwnedRoutes: false` project must not import the package island
|
|
41
|
+
* component itself.
|
|
22
42
|
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
43
|
+
* Package-first wiring landed in S9a zudolab/zudo-doc#2333; mode-scoped rebuild
|
|
44
|
+
* wiring was added in zudolab/zudo-doc#2610 and the package-default island in
|
|
45
|
+
* #2658.
|
|
26
46
|
*
|
|
27
47
|
* CSS is pulled via `@import "@takazudo/zdtp/styles.css"` in the project's
|
|
28
48
|
* `src/styles/global.css` so the panel chrome lands in the main page CSS
|
|
@@ -30,30 +50,65 @@
|
|
|
30
50
|
* import from the emitted JS, so the explicit CSS-side import is the
|
|
31
51
|
* required pull point. See @takazudo/zdtp PORTABLE-CONTRACT.md §7.
|
|
32
52
|
*/
|
|
53
|
+
import type { JSX } from "preact";
|
|
33
54
|
import { type PanelConfig } from "@takazudo/zdtp";
|
|
34
55
|
/** Active color-scheme mode, read from `<html data-theme>`. */
|
|
35
56
|
type ColorSchemeMode = "light" | "dark";
|
|
36
57
|
/**
|
|
37
|
-
* A per-mode PanelConfig factory.
|
|
38
|
-
* defaults
|
|
39
|
-
* in the host's `design-token-panel-config.ts`).
|
|
58
|
+
* A per-mode PanelConfig factory. The package default and host overrides use
|
|
59
|
+
* this same shape so panel defaults follow the live light/dark mode.
|
|
40
60
|
*/
|
|
41
61
|
export type PanelConfigBuilder = (mode: ColorSchemeMode) => PanelConfig;
|
|
62
|
+
/**
|
|
63
|
+
* Theme-pack storage-prefix rule (ADR theme-packs.md Decision 4), enforced
|
|
64
|
+
* CENTRALLY here — never per-builder, so host builders supplied via
|
|
65
|
+
* `designTokenPanelConfigModule` cannot cross-contaminate namespaces even if
|
|
66
|
+
* unaware of packs:
|
|
67
|
+
*
|
|
68
|
+
* - active pack `default` → the builder's `storagePrefix` stays BYTE-UNCHANGED
|
|
69
|
+
* (the existing-user carry-over guarantee: `zudo-doc-tweak` keys keep
|
|
70
|
+
* working on the stock look).
|
|
71
|
+
* - any other pack → `${storagePrefix}--<slug>` (double hyphen avoids
|
|
72
|
+
* colliding with zdtp's own `-open`/version suffixes). zdtp derives every
|
|
73
|
+
* key — including the `${prefix}-open` open-state mirror — from the prefix,
|
|
74
|
+
* so tweaks saved under pack A are invisible under pack B and restored
|
|
75
|
+
* verbatim on switch-back.
|
|
76
|
+
*
|
|
77
|
+
* The `PanelConfigBuilder` signature stays `(mode) => PanelConfig` — this is a
|
|
78
|
+
* post-process of the RETURNED config, not a builder-contract change.
|
|
79
|
+
*/
|
|
80
|
+
export declare function withPackScopedStoragePrefix(config: PanelConfig, activePack: string): PanelConfig;
|
|
42
81
|
/**
|
|
43
82
|
* Bootstrap zdtp for a project. Configures the panel, drains any pre-hydration
|
|
44
83
|
* click queue, and wires the zdtp lifecycle adapter to zfb's navigation events
|
|
45
84
|
* so persisted token overrides re-apply on every soft navigation.
|
|
46
85
|
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
86
|
+
* Wires a `color-scheme-changed` listener that rebuilds the panel per
|
|
87
|
+
* light/dark mode (see the toggle sequence below), and a parallel
|
|
88
|
+
* `theme-pack-changed` listener that rebuilds it per theme pack with a
|
|
89
|
+
* pack-scoped storage prefix (ADR theme-packs.md Decision 4, #2822).
|
|
50
90
|
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
91
|
+
* @param buildConfig - The project's `(mode) => PanelConfig` builder for
|
|
92
|
+
* mode-scoped rebuilds.
|
|
93
|
+
*/
|
|
94
|
+
export declare function bootstrapDesignTokenPanel(buildConfig: PanelConfigBuilder): void;
|
|
95
|
+
/**
|
|
96
|
+
* The package-default `<DesignTokenPanelBootstrap/>` island: mounted (via
|
|
97
|
+
* `Island({ when: "load" })`, no `ssrFallback` — it renders nothing on either
|
|
98
|
+
* side) by `../doc-body-end-islands/index.tsx` when `settings.designTokenPanel`
|
|
99
|
+
* is on, gated the same way `AiChatModal`/`ImageEnlarge`/`MermaidEnlarge` are.
|
|
100
|
+
* On first render, calls `bootstrapDesignTokenPanel` with the mode-scoped
|
|
101
|
+
* `buildDesignTokenPanelConfig` builder resolved from
|
|
102
|
+
* `virtual:zudo-doc-design-token-panel-config` (package default, or the
|
|
103
|
+
* host's `designTokenPanelConfigModule` override).
|
|
53
104
|
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
105
|
+
* `displayName` pinned explicitly (belt-and-braces, matching
|
|
106
|
+
* `AiChatModal`/`ImageEnlarge`/`MermaidEnlarge`/`DocHistory`) so zfb's
|
|
107
|
+
* `captureComponentName` emits a stable `data-zfb-island="DesignTokenPanelBootstrap"`
|
|
108
|
+
* marker independent of minification.
|
|
57
109
|
*/
|
|
58
|
-
export declare function
|
|
110
|
+
export declare function DesignTokenPanelBootstrap(): JSX.Element | null;
|
|
111
|
+
export declare namespace DesignTokenPanelBootstrap {
|
|
112
|
+
var displayName: string;
|
|
113
|
+
}
|
|
59
114
|
export {};
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import {
|
|
2
3
|
configurePanel,
|
|
4
|
+
reapplyPersistedOverrides,
|
|
3
5
|
setLifecycleAdapter,
|
|
4
6
|
showDesignTokenPanel
|
|
5
7
|
} from "@takazudo/zdtp";
|
|
@@ -7,36 +9,112 @@ import {
|
|
|
7
9
|
BEFORE_NAVIGATE_EVENT,
|
|
8
10
|
AFTER_NAVIGATE_EVENT
|
|
9
11
|
} from "./transitions/page-events.js";
|
|
12
|
+
import {
|
|
13
|
+
DEFAULT_THEME_PACK_SLUG,
|
|
14
|
+
THEME_PACK_CHANGED_EVENT,
|
|
15
|
+
readThemePackFromDom
|
|
16
|
+
} from "./theme-pack-switcher/theme-pack-sync.js";
|
|
17
|
+
import { buildDesignTokenPanelConfig } from "virtual:zudo-doc-design-token-panel-config";
|
|
10
18
|
const COLOR_SCHEME_CHANGED_EVENT = "color-scheme-changed";
|
|
11
19
|
function openStateKey(instancePrefix) {
|
|
12
20
|
return `${instancePrefix}-open`;
|
|
13
21
|
}
|
|
22
|
+
function readOpenState(instancePrefix) {
|
|
23
|
+
try {
|
|
24
|
+
return localStorage.getItem(openStateKey(instancePrefix)) === "1";
|
|
25
|
+
} catch {
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
14
29
|
function readMode() {
|
|
15
30
|
return document.documentElement.getAttribute("data-theme") === "dark" ? "dark" : "light";
|
|
16
31
|
}
|
|
17
|
-
function
|
|
18
|
-
if (
|
|
32
|
+
function withPackScopedStoragePrefix(config, activePack) {
|
|
33
|
+
if (activePack === DEFAULT_THEME_PACK_SLUG) return config;
|
|
34
|
+
return { ...config, storagePrefix: `${config.storagePrefix}--${activePack}` };
|
|
35
|
+
}
|
|
36
|
+
function collectDeclaredTokenNames(config) {
|
|
37
|
+
const names = [];
|
|
38
|
+
for (const tab of config.tabs ?? []) {
|
|
39
|
+
for (const tier of tab.tiers ?? []) {
|
|
40
|
+
for (const item of tier.items ?? []) {
|
|
41
|
+
names.push(item.cssVar);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
const baseRoles = tab.colorExtras?.baseRoles;
|
|
45
|
+
if (baseRoles) {
|
|
46
|
+
for (const cssVar of Object.values(baseRoles)) {
|
|
47
|
+
if (typeof cssVar === "string" && cssVar.length > 0) {
|
|
48
|
+
names.push(cssVar);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return names;
|
|
54
|
+
}
|
|
55
|
+
function clearAppliedTokenOverrides(config) {
|
|
56
|
+
const names = collectDeclaredTokenNames(config);
|
|
57
|
+
if (config.applySink) {
|
|
58
|
+
try {
|
|
59
|
+
config.applySink.clear(names);
|
|
60
|
+
} catch (err) {
|
|
61
|
+
console.warn(
|
|
62
|
+
"[zudo-doc] applySink.clear threw during theme-pack switch; outgoing overrides may linger.",
|
|
63
|
+
err
|
|
64
|
+
);
|
|
65
|
+
}
|
|
19
66
|
return;
|
|
20
67
|
}
|
|
21
|
-
const
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
if (timer !== null) return;
|
|
30
|
-
timer = setTimeout(() => {
|
|
31
|
-
timer = null;
|
|
32
|
-
const mode = pendingMode;
|
|
33
|
-
const wasOpen = localStorage.getItem(openStateKey(handle.instanceId)) === "1";
|
|
34
|
-
handle.destroy();
|
|
35
|
-
handle = configurePanel(builder(mode));
|
|
36
|
-
if (wasOpen) showDesignTokenPanel();
|
|
37
|
-
}, 0);
|
|
38
|
-
});
|
|
68
|
+
const style = document.documentElement.style;
|
|
69
|
+
for (const name of names) {
|
|
70
|
+
style.removeProperty(name);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
function bootstrapDesignTokenPanel(buildConfig) {
|
|
74
|
+
if (typeof window === "undefined" || typeof document === "undefined") {
|
|
75
|
+
return;
|
|
39
76
|
}
|
|
77
|
+
let currentConfig = withPackScopedStoragePrefix(
|
|
78
|
+
buildConfig(readMode()),
|
|
79
|
+
readThemePackFromDom()
|
|
80
|
+
);
|
|
81
|
+
let handle = configurePanel(currentConfig);
|
|
82
|
+
let pendingMode = readMode();
|
|
83
|
+
let timer = null;
|
|
84
|
+
window.addEventListener(COLOR_SCHEME_CHANGED_EVENT, () => {
|
|
85
|
+
pendingMode = readMode();
|
|
86
|
+
if (timer !== null) return;
|
|
87
|
+
timer = setTimeout(() => {
|
|
88
|
+
timer = null;
|
|
89
|
+
const mode = pendingMode;
|
|
90
|
+
const wasOpen = readOpenState(handle.instanceId);
|
|
91
|
+
handle.destroy();
|
|
92
|
+
currentConfig = withPackScopedStoragePrefix(
|
|
93
|
+
buildConfig(mode),
|
|
94
|
+
readThemePackFromDom()
|
|
95
|
+
);
|
|
96
|
+
handle = configurePanel(currentConfig);
|
|
97
|
+
if (wasOpen) showDesignTokenPanel();
|
|
98
|
+
}, 0);
|
|
99
|
+
});
|
|
100
|
+
let pendingPack = readThemePackFromDom();
|
|
101
|
+
let packTimer = null;
|
|
102
|
+
window.addEventListener(THEME_PACK_CHANGED_EVENT, () => {
|
|
103
|
+
pendingPack = readThemePackFromDom();
|
|
104
|
+
if (packTimer !== null) return;
|
|
105
|
+
packTimer = setTimeout(() => {
|
|
106
|
+
packTimer = null;
|
|
107
|
+
const pack = pendingPack;
|
|
108
|
+
const wasOpen = readOpenState(handle.instanceId);
|
|
109
|
+
const outgoingConfig = currentConfig;
|
|
110
|
+
handle.destroy();
|
|
111
|
+
clearAppliedTokenOverrides(outgoingConfig);
|
|
112
|
+
currentConfig = withPackScopedStoragePrefix(buildConfig(readMode()), pack);
|
|
113
|
+
handle = configurePanel(currentConfig);
|
|
114
|
+
reapplyPersistedOverrides();
|
|
115
|
+
if (wasOpen) showDesignTokenPanel();
|
|
116
|
+
}, 0);
|
|
117
|
+
});
|
|
40
118
|
window.__zdtpReadyClicks?.();
|
|
41
119
|
const adapter = {
|
|
42
120
|
onBeforeSwap(cb) {
|
|
@@ -52,6 +130,17 @@ function bootstrapDesignTokenPanel(configOrBuilder) {
|
|
|
52
130
|
};
|
|
53
131
|
setLifecycleAdapter(adapter);
|
|
54
132
|
}
|
|
133
|
+
let bootstrapped = false;
|
|
134
|
+
function DesignTokenPanelBootstrap() {
|
|
135
|
+
if (!bootstrapped) {
|
|
136
|
+
bootstrapped = true;
|
|
137
|
+
bootstrapDesignTokenPanel(buildDesignTokenPanelConfig);
|
|
138
|
+
}
|
|
139
|
+
return null;
|
|
140
|
+
}
|
|
141
|
+
DesignTokenPanelBootstrap.displayName = "DesignTokenPanelBootstrap";
|
|
55
142
|
export {
|
|
56
|
-
|
|
143
|
+
DesignTokenPanelBootstrap,
|
|
144
|
+
bootstrapDesignTokenPanel,
|
|
145
|
+
withPackScopedStoragePrefix
|
|
57
146
|
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@takazudo/zudo-doc/design-token-panel-config` — the PACKAGE-DEFAULT zdtp
|
|
3
|
+
* PanelConfig builder (#2658, epic Minimal Scaffold #2651, decision wave
|
|
4
|
+
* #2653 "Approach (a)").
|
|
5
|
+
*
|
|
6
|
+
* Ported from the showcase's `src/config/design-token-panel-config.ts` (441
|
|
7
|
+
* lines, ~90% mechanical derivation per the decision-wave audit) so
|
|
8
|
+
* `designTokenPanel: true` works with NO host config file: the Palette tab
|
|
9
|
+
* comes from `defaultColorSchemes`' shared `ramps`, the Color tab from
|
|
10
|
+
* `buildSemanticTierItems`, and Font/Spacing/Size from the manifest in
|
|
11
|
+
* `./manifest.js`. The hand-authored panel-identity constants
|
|
12
|
+
* (`storagePrefix`, `consoleNamespace`, `modalClassPrefix`, `schemaId`,
|
|
13
|
+
* `exportFilenameBase`) and the `FONT_ROLE_TO_SCALE` map are carried over
|
|
14
|
+
* verbatim — `storagePrefix: "zudo-doc-tweak"` in particular MUST NOT change
|
|
15
|
+
* (existing user-save carry-over guarantee, see `packages/zudo-doc/CLAUDE.md`
|
|
16
|
+
* and `src/CLAUDE.md`).
|
|
17
|
+
*
|
|
18
|
+
* A host that needs a fully custom panel (its own color schemes, its own
|
|
19
|
+
* token manifest) points `settings.designTokenPanelConfigModule` at a module
|
|
20
|
+
* exporting a named `buildDesignTokenPanelConfig` — see
|
|
21
|
+
* `../plugins/routes.ts` (`virtual:zudo-doc-design-token-panel-config`,
|
|
22
|
+
* mirrors the `chromeBindingsModule` contract). This module is what the
|
|
23
|
+
* routes plugin re-exports when NO override is configured.
|
|
24
|
+
*
|
|
25
|
+
* Unlike the showcase original, this builder does not resolve
|
|
26
|
+
* `settings.colorMode`/`settings.colorScheme` — the PACKAGE has no settings
|
|
27
|
+
* singleton to read (the preset's node-free eval-graph rule keeps this
|
|
28
|
+
* module out of the config eval graph too, so it must stay side-effect-free
|
|
29
|
+
* on import). It seeds the Color tab straight from `defaultColorSchemes`'
|
|
30
|
+
* "Default Light" / "Default Dark" entries for the requested `mode` — the
|
|
31
|
+
* exact pair `@takazudo/zudo-doc/theme.css` ships as the default scheme.
|
|
32
|
+
*/
|
|
33
|
+
import type { PanelConfig } from "@takazudo/zdtp";
|
|
34
|
+
type PanelMode = "light" | "dark";
|
|
35
|
+
/**
|
|
36
|
+
* Build the full PACKAGE-DEFAULT PanelConfig for a given color-scheme
|
|
37
|
+
* `mode`. Only the Color tab's semantic tier and `panelSettings.colorMode.
|
|
38
|
+
* defaultMode` vary by mode; the Palette/Font/Spacing/Size tabs are
|
|
39
|
+
* mode-independent. `@takazudo/zudo-doc/design-token-panel-bootstrap` calls
|
|
40
|
+
* this per mode on every `color-scheme-changed` toggle (destroy +
|
|
41
|
+
* reconfigure) — it is passed as the BUILDER, not a resolved config (#2610).
|
|
42
|
+
*
|
|
43
|
+
* `storagePrefix: "zudo-doc-tweak"` is the same value the showcase's own
|
|
44
|
+
* `design-token-panel-config.ts` has always used — keep it unchanged so a
|
|
45
|
+
* host migrating from an ejected config to this package default carries its
|
|
46
|
+
* existing user-saved tweaks over.
|
|
47
|
+
*/
|
|
48
|
+
export declare function buildDesignTokenPanelConfig(mode: PanelMode): PanelConfig;
|
|
49
|
+
export {};
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
import { SPACING_TOKENS, FONT_TOKENS, SIZE_TOKENS } from "./manifest.js";
|
|
2
|
+
import { STATE_ROLES, buildSemanticTierItems } from "../color-scheme-utils.js";
|
|
3
|
+
import { defaultColorSchemes } from "../color-schemes-defaults/index.js";
|
|
4
|
+
const DEFAULT_SHIKI_THEME = "github-dark";
|
|
5
|
+
function schemeNameForMode(mode) {
|
|
6
|
+
return mode === "dark" ? "Default Dark" : "Default Light";
|
|
7
|
+
}
|
|
8
|
+
function schemeForMode(mode) {
|
|
9
|
+
const scheme = defaultColorSchemes[schemeNameForMode(mode)];
|
|
10
|
+
if (!scheme) {
|
|
11
|
+
throw new Error(
|
|
12
|
+
`zudo-doc: defaultColorSchemes is missing "${schemeNameForMode(mode)}" \u2014 this is a package bug.`
|
|
13
|
+
);
|
|
14
|
+
}
|
|
15
|
+
return scheme;
|
|
16
|
+
}
|
|
17
|
+
function toTierItem(t) {
|
|
18
|
+
let kind;
|
|
19
|
+
if (t.control === "select") {
|
|
20
|
+
kind = { kind: "select", options: t.options ?? [] };
|
|
21
|
+
} else if (t.control === "text") {
|
|
22
|
+
kind = { kind: "text" };
|
|
23
|
+
} else {
|
|
24
|
+
kind = {
|
|
25
|
+
kind: "length",
|
|
26
|
+
step: t.step,
|
|
27
|
+
unit: t.unit
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
const item = {
|
|
31
|
+
id: t.id,
|
|
32
|
+
cssVar: t.cssVar,
|
|
33
|
+
label: t.label,
|
|
34
|
+
default: t.default,
|
|
35
|
+
type: kind
|
|
36
|
+
};
|
|
37
|
+
if (t.pill) item.pill = t.pill;
|
|
38
|
+
if (t.readonly) item.readonly = true;
|
|
39
|
+
return item;
|
|
40
|
+
}
|
|
41
|
+
function tierFromGroup(tokens, groupId, label) {
|
|
42
|
+
return {
|
|
43
|
+
id: groupId,
|
|
44
|
+
label,
|
|
45
|
+
items: tokens.filter((t) => t.group === groupId).map(toTierItem)
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
function buildRampTiers(mode) {
|
|
49
|
+
const { ramps } = schemeForMode(mode);
|
|
50
|
+
const baseTier = {
|
|
51
|
+
id: "base",
|
|
52
|
+
label: "Base",
|
|
53
|
+
items: ramps.base.map((color, i) => ({
|
|
54
|
+
id: `base-${i}`,
|
|
55
|
+
cssVar: `--palette-base-${i}`,
|
|
56
|
+
label: String(i),
|
|
57
|
+
default: color,
|
|
58
|
+
type: { kind: "color", format: "oklch" }
|
|
59
|
+
}))
|
|
60
|
+
};
|
|
61
|
+
const accentTier = {
|
|
62
|
+
id: "accent",
|
|
63
|
+
label: "Accent",
|
|
64
|
+
items: ramps.accent.map((color, i) => ({
|
|
65
|
+
id: `accent-${i}`,
|
|
66
|
+
cssVar: `--palette-accent-${i}`,
|
|
67
|
+
label: String(i),
|
|
68
|
+
default: color,
|
|
69
|
+
type: { kind: "color", format: "oklch" }
|
|
70
|
+
}))
|
|
71
|
+
};
|
|
72
|
+
const stateTier = {
|
|
73
|
+
id: "state",
|
|
74
|
+
label: "State",
|
|
75
|
+
items: STATE_ROLES.map((role) => ({
|
|
76
|
+
id: `state-${role}`,
|
|
77
|
+
cssVar: `--palette-state-${role}`,
|
|
78
|
+
label: role,
|
|
79
|
+
default: ramps.state[role],
|
|
80
|
+
type: { kind: "color", format: "oklch" }
|
|
81
|
+
}))
|
|
82
|
+
};
|
|
83
|
+
return [baseTier, accentTier, stateTier];
|
|
84
|
+
}
|
|
85
|
+
function buildPaletteTab(mode) {
|
|
86
|
+
return {
|
|
87
|
+
id: "palette",
|
|
88
|
+
label: "Palette",
|
|
89
|
+
tiers: buildRampTiers(mode)
|
|
90
|
+
// No colorExtras: a tab with multiple kind:'color' tiers MUST omit it so
|
|
91
|
+
// resolveColorClusterFromTab is not invoked and zdtp renders the ramps
|
|
92
|
+
// with its native curve editor (zdtp palette-tab contract).
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
function buildSemanticTier(mode) {
|
|
96
|
+
return {
|
|
97
|
+
id: "semantic",
|
|
98
|
+
label: "Semantic",
|
|
99
|
+
semantic: true,
|
|
100
|
+
referencesRamps: [
|
|
101
|
+
{ tab: "palette", tier: "base" },
|
|
102
|
+
{ tab: "palette", tier: "accent" },
|
|
103
|
+
{ tab: "palette", tier: "state" }
|
|
104
|
+
],
|
|
105
|
+
items: buildSemanticTierItems(schemeForMode(mode))
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
function buildColorExtras(mode) {
|
|
109
|
+
const lightScheme = schemeNameForMode("light");
|
|
110
|
+
const darkScheme = schemeNameForMode("dark");
|
|
111
|
+
return {
|
|
112
|
+
id: "zudo-doc",
|
|
113
|
+
label: "Zudo Doc",
|
|
114
|
+
baseRoles: {},
|
|
115
|
+
baseDefaults: {},
|
|
116
|
+
defaultShikiTheme: DEFAULT_SHIKI_THEME,
|
|
117
|
+
colorSchemes: {},
|
|
118
|
+
panelSettings: {
|
|
119
|
+
colorScheme: schemeNameForMode(mode),
|
|
120
|
+
colorMode: { defaultMode: mode, lightScheme, darkScheme }
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
function buildColorTab(mode) {
|
|
125
|
+
return {
|
|
126
|
+
id: "color",
|
|
127
|
+
label: "Color",
|
|
128
|
+
tiers: [buildSemanticTier(mode)],
|
|
129
|
+
colorExtras: buildColorExtras(mode)
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
const FONT_SCALE_TIER_ID = "font-scale";
|
|
133
|
+
const FONT_ROLE_TO_SCALE = {
|
|
134
|
+
"text-micro": "text-scale-2xs",
|
|
135
|
+
"text-caption": "text-scale-xs",
|
|
136
|
+
"text-small": "text-scale-sm",
|
|
137
|
+
"text-body": "text-scale-md",
|
|
138
|
+
"text-title": "text-scale-lg",
|
|
139
|
+
"text-heading": "text-scale-xl",
|
|
140
|
+
"text-display": "text-scale-2xl"
|
|
141
|
+
};
|
|
142
|
+
function buildFontRoleTier() {
|
|
143
|
+
const base = tierFromGroup(FONT_TOKENS, "font-size", "Font size");
|
|
144
|
+
return {
|
|
145
|
+
...base,
|
|
146
|
+
items: base.items.map((item) => {
|
|
147
|
+
const scaleId = FONT_ROLE_TO_SCALE[item.id];
|
|
148
|
+
return scaleId ? { ...item, default: scaleId } : item;
|
|
149
|
+
}),
|
|
150
|
+
referencesTier: FONT_SCALE_TIER_ID
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
function buildFontTab() {
|
|
154
|
+
return {
|
|
155
|
+
id: "font",
|
|
156
|
+
label: "Font",
|
|
157
|
+
tiers: [
|
|
158
|
+
tierFromGroup(FONT_TOKENS, FONT_SCALE_TIER_ID, "Scale"),
|
|
159
|
+
buildFontRoleTier(),
|
|
160
|
+
tierFromGroup(FONT_TOKENS, "line-height", "Line height"),
|
|
161
|
+
tierFromGroup(FONT_TOKENS, "font-weight", "Font weight"),
|
|
162
|
+
tierFromGroup(FONT_TOKENS, "font-family", "Font family")
|
|
163
|
+
]
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
function buildSpacingTab() {
|
|
167
|
+
return {
|
|
168
|
+
id: "spacing",
|
|
169
|
+
label: "Spacing",
|
|
170
|
+
tiers: [
|
|
171
|
+
tierFromGroup(SPACING_TOKENS, "hsp", "Horizontal spacing"),
|
|
172
|
+
tierFromGroup(SPACING_TOKENS, "vsp", "Vertical spacing"),
|
|
173
|
+
tierFromGroup(SPACING_TOKENS, "icon", "Icons"),
|
|
174
|
+
tierFromGroup(SPACING_TOKENS, "layout", "Layout")
|
|
175
|
+
]
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
function buildSizeTab() {
|
|
179
|
+
return {
|
|
180
|
+
id: "size",
|
|
181
|
+
label: "Size",
|
|
182
|
+
tiers: [
|
|
183
|
+
tierFromGroup(SIZE_TOKENS, "radius", "Radius"),
|
|
184
|
+
tierFromGroup(SIZE_TOKENS, "transition", "Transition")
|
|
185
|
+
]
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
function buildDesignTokenPanelConfig(mode) {
|
|
189
|
+
return {
|
|
190
|
+
storagePrefix: "zudo-doc-tweak",
|
|
191
|
+
consoleNamespace: "zudoDoc",
|
|
192
|
+
modalClassPrefix: "zudo-doc-design-token-panel-modal",
|
|
193
|
+
// DISPLAY-ONLY in zdtp 0.4.6: the panel's export hard-codes
|
|
194
|
+
// `zudo-design-tokens/v2` and auto-upgrades to `.../v3` when object leaves
|
|
195
|
+
// ({ref}/{literal}/per-mode) are present — which the semantic tier's ramp
|
|
196
|
+
// refs always are, so real exports carry v3. `schemaId` does NOT gate
|
|
197
|
+
// import, and (verified against the installed zdtp 0.4.6 bundle) zdtp's
|
|
198
|
+
// Import/Export modals do not read this field at all — their hint/error
|
|
199
|
+
// text is hardcoded to zdtp's own internal `SCHEMA_V1`/`SCHEMA_V2`/
|
|
200
|
+
// `SCHEMA_V3` constants (#498/#505), which are unrelated to this field.
|
|
201
|
+
// It is thus a purely descriptive config value with no runtime effect;
|
|
202
|
+
// set to v3 (a literal, not one of those constants) to match what real
|
|
203
|
+
// exports carry.
|
|
204
|
+
schemaId: "zudo-design-tokens/v3",
|
|
205
|
+
exportFilenameBase: "zudo-doc-design-tokens",
|
|
206
|
+
tabs: [buildPaletteTab(mode), buildColorTab(mode), buildFontTab(), buildSpacingTab(), buildSizeTab()]
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
export {
|
|
210
|
+
buildDesignTokenPanelConfig
|
|
211
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Design-token manifest data arrays — the PACKAGE-DEFAULT source of truth for
|
|
3
|
+
* the spacing/font/size tabs of `buildDesignTokenPanelConfig` (#2658, epic
|
|
4
|
+
* Minimal Scaffold #2651).
|
|
5
|
+
*
|
|
6
|
+
* Ported verbatim from the showcase's `src/config/design-tokens-manifest.ts`
|
|
7
|
+
* (values mirror the defaults shipped by `@takazudo/zudo-doc/theme.css`,
|
|
8
|
+
* #2655) so `designTokenPanel: true` works with no host manifest file. A
|
|
9
|
+
* project that needs its own token set entirely ejects via
|
|
10
|
+
* `designTokenPanelConfigModule` (see `../plugins/routes.ts`), not by editing
|
|
11
|
+
* this file — this module stays the PACKAGE default.
|
|
12
|
+
*
|
|
13
|
+
* Type strategy: arrays are typed `readonly TokenDef[]`, matching the
|
|
14
|
+
* upstream zdtp `TokenDef` shape consumed by `../color-scheme-utils.js` and
|
|
15
|
+
* `./index.ts` (which partitions them into `TabConfig.tiers` by `group`).
|
|
16
|
+
*/
|
|
17
|
+
import type { TokenDef } from "@takazudo/zdtp";
|
|
18
|
+
/**
|
|
19
|
+
* Spacing tokens — mirrors every `--spacing-*` declaration shipped by
|
|
20
|
+
* `@takazudo/zudo-doc/theme.css`, plus the `--zd-sidebar-w` layout token.
|
|
21
|
+
* Read-only rows surface tokens whose value can't be expressed on a
|
|
22
|
+
* single-axis slider (`clamp()`, structural `0`).
|
|
23
|
+
*/
|
|
24
|
+
export declare const SPACING_TOKENS: readonly TokenDef[];
|
|
25
|
+
/**
|
|
26
|
+
* Font tokens — mirrors every font-related declaration shipped by
|
|
27
|
+
* `@takazudo/zudo-doc/theme.css`.
|
|
28
|
+
*
|
|
29
|
+
* Tier 2 semantic tokens (sizes, line-heights, weights, families) are exposed
|
|
30
|
+
* as primary tiers; Tier 1 abstract scale (`--text-scale-*`) lives in its own
|
|
31
|
+
* `font-scale` tier so designers who tweak the scale see the tokens that the
|
|
32
|
+
* semantic sizes resolve from.
|
|
33
|
+
*/
|
|
34
|
+
export declare const FONT_TOKENS: readonly TokenDef[];
|
|
35
|
+
/**
|
|
36
|
+
* Size tokens — mirrors every non-breakpoint size-category custom property
|
|
37
|
+
* shipped by `@takazudo/zudo-doc/theme.css`. Breakpoints (`--breakpoint-*`)
|
|
38
|
+
* are intentionally omitted — live-changing them causes layout thrash
|
|
39
|
+
* mid-drag and adds no real tweak value.
|
|
40
|
+
*
|
|
41
|
+
* Radius defaults use `px` (matches a 0-100 slider), even though
|
|
42
|
+
* `theme.css` expresses them in `rem` — the browser accepts both.
|
|
43
|
+
* `--radius-full` carries a `pill` toggle: its design default (`9999px`) is
|
|
44
|
+
* an intentional sentinel a 0-100 slider can't reach.
|
|
45
|
+
*/
|
|
46
|
+
export declare const SIZE_TOKENS: readonly TokenDef[];
|