@takazudo/zudo-doc 0.2.21 → 1.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/bin/gen-z-index.mjs +164 -0
- package/bin/tags-audit-runner.ts +126 -0
- package/bin/tags-audit.mjs +64 -0
- package/bin/zudo-doc.mjs +83 -0
- package/dist/ai-chat-modal/index.d.ts +8 -0
- package/dist/ai-chat-modal/index.js +243 -0
- package/dist/body-foot-util/body-foot-util-area.d.ts +4 -8
- package/dist/body-foot-util/edit-link.d.ts +4 -8
- package/dist/body-foot-util/index.d.ts +4 -3
- package/dist/breadcrumb/breadcrumb.d.ts +5 -9
- package/dist/breadcrumb/find-path.d.ts +2 -5
- package/dist/breadcrumb/index.d.ts +4 -4
- package/dist/breadcrumb/types.d.ts +3 -5
- package/dist/category-nav/index.d.ts +86 -0
- package/dist/category-nav/index.js +44 -0
- package/dist/category-tree-nav/index.d.ts +65 -0
- package/dist/category-tree-nav/index.js +24 -0
- package/dist/code-group/index.d.ts +10 -0
- package/dist/code-group/index.js +37 -0
- package/dist/code-syntax/code-block-enhancer-script.d.ts +1 -3
- package/dist/code-syntax/code-block-enhancer.d.ts +3 -6
- package/dist/code-syntax/index.d.ts +9 -8
- package/dist/code-syntax/mermaid-init-script.d.ts +3 -5
- package/dist/code-syntax/mermaid-init.d.ts +4 -7
- package/dist/code-syntax/tabs-init-script.d.ts +1 -3
- package/dist/code-syntax/tabs-init.d.ts +3 -6
- package/dist/code-syntax/tabs.d.ts +4 -7
- package/dist/color-scheme-utils.d.ts +125 -0
- package/dist/color-scheme-utils.js +151 -0
- package/dist/compose-meta-title/index.d.ts +7 -0
- package/dist/compose-meta-title/index.js +10 -0
- package/dist/content/component-map.d.ts +13 -17
- package/dist/content/content-blockquote.d.ts +3 -6
- package/dist/content/content-code.d.ts +3 -6
- package/dist/content/content-code.js +1 -1
- package/dist/content/content-link.d.ts +3 -6
- package/dist/content/content-link.js +1 -1
- package/dist/content/content-ol.d.ts +3 -6
- package/dist/content/content-paragraph.d.ts +3 -6
- package/dist/content/content-strong.d.ts +3 -6
- package/dist/content/content-table.d.ts +3 -6
- package/dist/content/content-ul.d.ts +3 -6
- package/dist/content/heading-h2.d.ts +3 -6
- package/dist/content/heading-h3.d.ts +3 -6
- package/dist/content/heading-h4.d.ts +3 -6
- package/dist/content/index.d.ts +29 -13
- package/dist/content-admonition/index.d.ts +15 -0
- package/dist/content-admonition/index.js +14 -0
- package/dist/design-token-panel-bootstrap.d.ts +38 -0
- package/dist/design-token-panel-bootstrap.js +29 -0
- package/dist/desktop-sidebar-toggle-island/index.d.ts +5 -0
- package/dist/desktop-sidebar-toggle-island/index.js +62 -0
- package/dist/details/details.d.ts +3 -7
- package/dist/details/index.d.ts +2 -2
- package/dist/doc-body-end/index.d.ts +21 -0
- package/dist/doc-body-end/index.js +15 -0
- package/dist/doc-content-header/index.d.ts +69 -0
- package/dist/doc-content-header/index.js +49 -0
- package/dist/doc-history/index.d.ts +10 -0
- package/dist/doc-history/index.js +407 -0
- package/dist/doc-history-area/index.d.ts +84 -0
- package/dist/doc-history-area/index.js +76 -0
- package/dist/doc-metainfo-area/index.d.ts +46 -0
- package/dist/doc-metainfo-area/index.js +41 -0
- package/dist/doc-page-props/index.d.ts +93 -0
- package/dist/doc-page-props/index.js +0 -0
- package/dist/doc-page-renderer/index.d.ts +128 -0
- package/dist/doc-page-renderer/index.js +103 -0
- package/dist/doc-page-shell/index.d.ts +136 -0
- package/dist/doc-page-shell/index.js +127 -0
- package/dist/doc-pager/index.d.ts +25 -0
- package/dist/doc-pager/index.js +41 -0
- package/dist/doc-route-entries/index.d.ts +125 -0
- package/dist/doc-route-entries/index.js +76 -0
- package/dist/doc-route-paths/index.d.ts +54 -0
- package/dist/doc-route-paths/index.js +61 -0
- package/dist/doc-tags-area/index.d.ts +38 -0
- package/dist/doc-tags-area/index.js +30 -0
- package/dist/doclayout/anchors.d.ts +7 -9
- package/dist/doclayout/doc-layout-with-defaults.d.ts +16 -12
- package/dist/doclayout/doc-layout.d.ts +5 -9
- package/dist/doclayout/index.d.ts +6 -6
- package/dist/eject/index.d.ts +33 -0
- package/dist/eject/index.js +229 -0
- package/dist/extract-headings/index.d.ts +43 -0
- package/dist/extract-headings/index.js +111 -0
- package/dist/factory-context/index.d.ts +80 -0
- package/dist/factory-context/index.js +0 -0
- package/dist/features.css +882 -0
- package/dist/footer/footer.d.ts +4 -8
- package/dist/footer/index.d.ts +13 -3
- package/dist/footer/types.d.ts +4 -6
- package/dist/footer-with-defaults/index.d.ts +63 -0
- package/dist/footer-with-defaults/index.js +128 -0
- package/dist/frontmatter-preview-data/index.d.ts +26 -0
- package/dist/frontmatter-preview-data/index.js +23 -0
- package/dist/github-helpers/index.d.ts +17 -0
- package/dist/github-helpers/index.js +16 -0
- package/dist/head/doc-head.d.ts +3 -6
- package/dist/head/index.d.ts +9 -5
- package/dist/head/og-tags.d.ts +4 -7
- package/dist/head/twitter-card.d.ts +3 -6
- package/dist/head/types.d.ts +1 -3
- package/dist/head-with-defaults/index.d.ts +49 -0
- package/dist/head-with-defaults/index.js +62 -0
- package/dist/header/header.d.ts +6 -10
- package/dist/header/index.d.ts +16 -6
- package/dist/header/nav-active.d.ts +5 -7
- package/dist/header/nav-overflow-script.d.ts +1 -3
- package/dist/header/right-items.d.ts +3 -6
- package/dist/header/types.d.ts +10 -12
- package/dist/header-with-defaults/index.d.ts +77 -0
- package/dist/header-with-defaults/index.js +163 -0
- package/dist/html-preview-wrapper/dedent.d.ts +1 -3
- package/dist/html-preview-wrapper/highlighted-code.d.ts +3 -7
- package/dist/html-preview-wrapper/html-preview-wrapper.d.ts +6 -10
- package/dist/html-preview-wrapper/html-preview.d.ts +5 -9
- package/dist/html-preview-wrapper/index.d.ts +8 -5
- package/dist/html-preview-wrapper/preflight.d.ts +1 -3
- package/dist/html-preview-wrapper/preview-base.d.ts +4 -8
- package/dist/i18n-version/index.d.ts +7 -5
- package/dist/i18n-version/language-switcher.d.ts +5 -8
- package/dist/i18n-version/types.d.ts +3 -5
- package/dist/i18n-version/version-banner.d.ts +4 -8
- package/dist/i18n-version/version-switcher.d.ts +7 -10
- package/dist/icons/index.d.ts +9 -13
- package/dist/image-enlarge/index.d.ts +13 -0
- package/dist/image-enlarge/index.js +176 -0
- package/dist/index.d.ts +26 -2
- package/dist/inline-version-switcher/index.d.ts +31 -0
- package/dist/inline-version-switcher/index.js +44 -0
- package/dist/integrations/claude-resources/escape-for-mdx.d.ts +1 -3
- package/dist/integrations/claude-resources/generate.d.ts +2 -4
- package/dist/integrations/claude-resources/index.d.ts +7 -10
- package/dist/integrations/doc-history/index.d.ts +21 -24
- package/dist/integrations/doc-history/pre-build.d.ts +7 -9
- package/dist/integrations/llms-txt/dev-middleware.d.ts +7 -11
- package/dist/integrations/llms-txt/emit.d.ts +2 -7
- package/dist/integrations/llms-txt/generate.d.ts +3 -8
- package/dist/integrations/llms-txt/index.d.ts +33 -8
- package/dist/integrations/llms-txt/load.d.ts +3 -7
- package/dist/integrations/llms-txt/strip.d.ts +2 -6
- package/dist/integrations/llms-txt/types.d.ts +9 -13
- package/dist/integrations/search-index/build-emitter.d.ts +4 -7
- package/dist/integrations/search-index/collect.d.ts +2 -5
- package/dist/integrations/search-index/dev-middleware.d.ts +5 -8
- package/dist/integrations/search-index/index.d.ts +7 -5
- package/dist/integrations/search-index/types.d.ts +5 -7
- package/dist/island-types/index.d.ts +44 -0
- package/dist/island-types/index.js +12 -0
- package/dist/locale-merge/index.d.ts +114 -0
- package/dist/locale-merge/index.js +27 -0
- package/dist/math-block/index.d.ts +18 -0
- package/dist/math-block/index.js +29 -0
- package/dist/md-utils/index.d.ts +6 -8
- package/dist/md-utils/index.js +2 -1
- package/dist/mdx-components/index.d.ts +46 -0
- package/dist/mdx-components/index.js +161 -0
- package/dist/mermaid-enlarge/index.d.ts +11 -0
- package/dist/mermaid-enlarge/index.js +290 -0
- package/dist/metainfo/doc-metainfo.d.ts +5 -9
- package/dist/metainfo/doc-tags.d.ts +7 -11
- package/dist/metainfo/frontmatter-preview.d.ts +8 -12
- package/dist/metainfo/index.d.ts +6 -4
- package/dist/nav-data-prep/index.d.ts +72 -0
- package/dist/nav-data-prep/index.js +34 -0
- package/dist/nav-indexing/category-nav.d.ts +4 -8
- package/dist/nav-indexing/category-tree-nav.d.ts +4 -8
- package/dist/nav-indexing/doc-card-grid.d.ts +4 -8
- package/dist/nav-indexing/docs-sitemap.d.ts +4 -8
- package/dist/nav-indexing/index.d.ts +37 -10
- package/dist/nav-indexing/nav-card-grid.d.ts +4 -8
- package/dist/nav-indexing/site-tree-nav-demo.d.ts +4 -8
- package/dist/nav-indexing/tag-nav.d.ts +6 -10
- package/dist/nav-indexing/types.d.ts +6 -8
- package/dist/nav-indexing/versions-page-content.d.ts +4 -8
- package/dist/nav-scope/index.d.ts +41 -0
- package/dist/nav-scope/index.js +41 -0
- package/dist/nav-source-cache/index.d.ts +13 -0
- package/dist/nav-source-cache/index.js +28 -0
- package/dist/nav-source-docs/index.d.ts +169 -0
- package/dist/nav-source-docs/index.js +123 -0
- package/dist/page-loading/index.d.ts +1 -2
- package/dist/page-loading/page-loading-overlay.d.ts +4 -8
- package/dist/plugins/claude-resources.d.ts +3 -0
- package/dist/plugins/claude-resources.js +27 -0
- package/dist/plugins/connect-adapter.d.ts +31 -0
- package/dist/plugins/connect-adapter.js +78 -0
- package/dist/plugins/doc-history.d.ts +3 -0
- package/dist/plugins/doc-history.js +54 -0
- package/dist/plugins/llms-txt.d.ts +3 -0
- package/dist/plugins/llms-txt.js +48 -0
- package/dist/plugins/plugin-utils.d.ts +17 -0
- package/dist/plugins/plugin-utils.js +11 -0
- package/dist/plugins/routes.d.ts +2 -0
- package/dist/plugins/routes.js +100 -0
- package/dist/plugins/search-index.d.ts +3 -0
- package/dist/plugins/search-index.js +24 -0
- package/dist/preset.d.ts +198 -0
- package/dist/preset.js +185 -0
- package/dist/render-markdown/index.d.ts +5 -0
- package/dist/render-markdown/index.js +115 -0
- package/dist/robots.d.ts +36 -0
- package/dist/robots.js +17 -0
- package/dist/route-enumerators/index.d.ts +204 -0
- package/dist/route-enumerators/index.js +156 -0
- package/dist/routes/404.d.ts +7 -0
- package/dist/routes/404.js +47 -0
- package/dist/routes/_chrome.d.ts +32 -0
- package/dist/routes/_chrome.js +365 -0
- package/dist/routes/_context.d.ts +56 -0
- package/dist/routes/_context.js +222 -0
- package/dist/routes/_docs-helpers.d.ts +43 -0
- package/dist/routes/_docs-helpers.js +173 -0
- package/dist/routes/_virtual.d.js +0 -0
- package/dist/routes/api-ai-chat.d.ts +5 -0
- package/dist/routes/api-ai-chat.js +24 -0
- package/dist/routes/docs-slug.d.ts +21 -0
- package/dist/routes/docs-slug.js +26 -0
- package/dist/routes/docs-tags-index.d.ts +7 -0
- package/dist/routes/docs-tags-index.js +11 -0
- package/dist/routes/docs-tags-tag.d.ts +23 -0
- package/dist/routes/docs-tags-tag.js +19 -0
- package/dist/routes/docs-versions.d.ts +7 -0
- package/dist/routes/docs-versions.js +11 -0
- package/dist/routes/index.d.ts +7 -0
- package/dist/routes/index.js +117 -0
- package/dist/routes/locale-docs-slug.d.ts +27 -0
- package/dist/routes/locale-docs-slug.js +40 -0
- package/dist/routes/locale-docs-tags-index.d.ts +18 -0
- package/dist/routes/locale-docs-tags-index.js +15 -0
- package/dist/routes/locale-docs-tags-tag.d.ts +25 -0
- package/dist/routes/locale-docs-tags-tag.js +22 -0
- package/dist/routes/locale-docs-versions.d.ts +18 -0
- package/dist/routes/locale-docs-versions.js +15 -0
- package/dist/routes/locale-index.d.ts +24 -0
- package/dist/routes/locale-index.js +132 -0
- package/dist/routes/robots.txt.d.ts +3 -0
- package/dist/routes/robots.txt.js +8 -0
- package/dist/routes/sitemap.xml.d.ts +5 -0
- package/dist/routes/sitemap.xml.js +31 -0
- package/dist/routes/v-docs-slug.d.ts +27 -0
- package/dist/routes/v-docs-slug.js +34 -0
- package/dist/routes/v-locale-docs-slug.d.ts +31 -0
- package/dist/routes/v-locale-docs-slug.js +50 -0
- package/dist/safelist.css +1 -1
- package/dist/search-widget/index.d.ts +38 -0
- package/dist/search-widget/index.js +169 -0
- package/dist/search-widget-script/index.d.ts +18 -0
- package/dist/search-widget-script/index.js +465 -0
- package/dist/settings.d.ts +270 -0
- package/dist/settings.js +0 -0
- package/dist/sidebar/index.d.ts +21 -3
- package/dist/sidebar/sidebar.d.ts +5 -9
- package/dist/sidebar/types.d.ts +4 -6
- package/dist/sidebar-prepaint/index.d.ts +21 -0
- package/dist/sidebar-prepaint/index.js +23 -0
- package/dist/sidebar-resizer/index.d.ts +2 -6
- package/dist/sidebar-resizer/sidebar-resizer-init.d.ts +6 -10
- package/dist/sidebar-toggle-island/index.d.ts +13 -0
- package/dist/sidebar-toggle-island/index.js +122 -0
- package/dist/sidebar-tree/build-tree.d.ts +4 -8
- package/dist/sidebar-tree/category-meta.d.ts +3 -6
- package/dist/sidebar-tree/index.d.ts +18 -3
- package/dist/sidebar-tree/types.d.ts +6 -8
- package/dist/sidebar-tree-island/index.d.ts +13 -0
- package/dist/sidebar-tree-island/index.js +454 -0
- package/dist/sidebar-utils/index.d.ts +64 -0
- package/dist/sidebar-utils/index.js +88 -0
- package/dist/sidebar-with-defaults/index.d.ts +38 -0
- package/dist/sidebar-with-defaults/index.js +45 -0
- package/dist/site-tree-nav/index.d.ts +71 -0
- package/dist/site-tree-nav/index.js +36 -0
- package/dist/site-tree-nav-island/index.d.ts +11 -0
- package/dist/site-tree-nav-island/index.js +176 -0
- package/dist/slug/index.d.ts +4 -0
- package/dist/slug/index.js +19 -0
- package/dist/smart-break/index.d.ts +55 -0
- package/dist/{toc/smart-break.js → smart-break/index.js} +30 -3
- package/dist/tab-item/index.d.ts +2 -2
- package/dist/tab-item/tab-item.d.ts +6 -7
- package/dist/tag-helpers/index.d.ts +40 -0
- package/dist/tag-helpers/index.js +54 -0
- package/dist/tag-pages/index.d.ts +114 -0
- package/dist/tag-pages/index.js +146 -0
- package/dist/tags-audit.d.ts +107 -0
- package/dist/tags-audit.js +321 -0
- package/dist/theme/color-scheme-provider.d.ts +4 -8
- package/dist/theme/color-tweak-export-modal.d.ts +4 -7
- package/dist/theme/design-token-serde.d.ts +14 -17
- package/dist/theme/design-token-types.d.ts +4 -6
- package/dist/theme/iframe-bridge.d.ts +12 -14
- package/dist/theme/index.d.ts +7 -9
- package/dist/theme/theme-toggle.d.ts +3 -8
- package/dist/theme-toggle/color-scheme-sync.d.ts +5 -7
- package/dist/theme-toggle/index.d.ts +4 -8
- package/dist/toc/cx.d.ts +2 -3
- package/dist/toc/index.d.ts +8 -6
- package/dist/toc/mobile-toc.d.ts +5 -9
- package/dist/toc/mobile-toc.js +1 -1
- package/dist/toc/toc-title.d.ts +1 -3
- package/dist/toc/toc.d.ts +5 -9
- package/dist/toc/toc.js +1 -1
- package/dist/toc/types.d.ts +1 -3
- package/dist/toc/use-active-heading.d.ts +4 -7
- package/dist/transitions/index.d.ts +1 -1
- package/dist/transitions/page-events.d.ts +4 -6
- package/dist/tree-nav-shared/index.d.ts +22 -0
- package/dist/tree-nav-shared/index.js +66 -0
- package/dist/url-helpers/index.d.ts +37 -0
- package/dist/url-helpers/index.js +106 -0
- package/dist/url-normalizer/index.d.ts +39 -1
- package/dist/url-normalizer/normalize.d.ts +3 -5
- package/dist/use-modal-dialog/index.d.ts +70 -0
- package/dist/use-modal-dialog/index.js +73 -0
- package/dist/versions-page/index.d.ts +55 -0
- package/dist/versions-page/index.js +73 -0
- package/eject/breadcrumb/breadcrumb.tsx +194 -0
- package/eject/breadcrumb/find-path.ts +26 -0
- package/eject/breadcrumb/index.ts +4 -0
- package/eject/breadcrumb/types.ts +32 -0
- package/eject/code-group/index.tsx +78 -0
- package/eject/content-admonition/index.tsx +50 -0
- package/eject/details/details.tsx +34 -0
- package/eject/details/index.ts +4 -0
- package/eject/doc-pager/index.tsx +91 -0
- package/eject/footer/footer.tsx +167 -0
- package/eject/footer/index.ts +19 -0
- package/eject/footer/types.ts +60 -0
- package/eject/header/header.tsx +725 -0
- package/eject/header/index.ts +36 -0
- package/eject/header/nav-active.ts +122 -0
- package/eject/header/nav-overflow-script.ts +302 -0
- package/eject/header/right-items.ts +78 -0
- package/eject/header/types.ts +69 -0
- package/eject/page-loading/index.ts +10 -0
- package/eject/page-loading/page-loading-overlay.tsx +103 -0
- package/eject/sidebar/index.ts +27 -0
- package/eject/sidebar/sidebar.tsx +137 -0
- package/eject/sidebar/types.ts +73 -0
- package/eject/tab-item/index.ts +7 -0
- package/eject/tab-item/tab-item.tsx +70 -0
- package/eject/theme-toggle/color-scheme-sync.ts +73 -0
- package/eject/theme-toggle/index.tsx +120 -0
- package/eject/toc/cx.ts +38 -0
- package/eject/toc/index.ts +11 -0
- package/eject/toc/mobile-toc.tsx +133 -0
- package/eject/toc/toc-title.ts +33 -0
- package/eject/toc/toc.tsx +119 -0
- package/eject/toc/types.ts +14 -0
- package/eject/toc/use-active-heading.ts +162 -0
- package/package.json +371 -11
- package/routes-src/404.tsx +49 -0
- package/routes-src/_chrome.tsx +470 -0
- package/routes-src/_context.ts +314 -0
- package/routes-src/_docs-helpers.ts +284 -0
- package/routes-src/_virtual.d.ts +15 -0
- package/routes-src/api-ai-chat.tsx +46 -0
- package/routes-src/docs-slug.tsx +43 -0
- package/routes-src/docs-tags-index.tsx +14 -0
- package/routes-src/docs-tags-tag.tsx +29 -0
- package/routes-src/docs-versions.tsx +15 -0
- package/routes-src/index.tsx +134 -0
- package/routes-src/locale-docs-slug.tsx +69 -0
- package/routes-src/locale-docs-tags-index.tsx +23 -0
- package/routes-src/locale-docs-tags-tag.tsx +39 -0
- package/routes-src/locale-docs-versions.tsx +23 -0
- package/routes-src/locale-index.tsx +150 -0
- package/routes-src/robots.txt.tsx +13 -0
- package/routes-src/sitemap.xml.tsx +48 -0
- package/routes-src/v-docs-slug.tsx +64 -0
- package/routes-src/v-locale-docs-slug.tsx +85 -0
- package/dist/toc/smart-break.d.ts +0 -27
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Color-scheme MECHANISM — palette → `--zd-*` CSS custom-property injection.
|
|
3
|
+
*
|
|
4
|
+
* This module ships the pure computation layer used by every project that
|
|
5
|
+
* builds on @takazudo/zudo-doc. It is DATA-free: callers pass in their own
|
|
6
|
+
* color-scheme manifest and settings.
|
|
7
|
+
*
|
|
8
|
+
* Moved from the host's `src/config/color-scheme-utils.ts` as part of the
|
|
9
|
+
* package-first migration (S9a zudolab/zudo-doc#2333). The DATA (palette
|
|
10
|
+
* values, scheme names, `colorMode` settings) stays project-side.
|
|
11
|
+
*/
|
|
12
|
+
/** A color reference: palette index (number) or direct color value (string) */
|
|
13
|
+
export type ColorRef = number | string;
|
|
14
|
+
export interface ColorScheme {
|
|
15
|
+
background: ColorRef;
|
|
16
|
+
foreground: ColorRef;
|
|
17
|
+
cursor: ColorRef;
|
|
18
|
+
selectionBg: ColorRef;
|
|
19
|
+
selectionFg: ColorRef;
|
|
20
|
+
palette: [
|
|
21
|
+
string,
|
|
22
|
+
string,
|
|
23
|
+
string,
|
|
24
|
+
string,
|
|
25
|
+
string,
|
|
26
|
+
string,
|
|
27
|
+
string,
|
|
28
|
+
string,
|
|
29
|
+
string,
|
|
30
|
+
string,
|
|
31
|
+
string,
|
|
32
|
+
string,
|
|
33
|
+
string,
|
|
34
|
+
string,
|
|
35
|
+
string,
|
|
36
|
+
string
|
|
37
|
+
];
|
|
38
|
+
/** Optional, vestigial — no visible effect on rendering; carried only for
|
|
39
|
+
* the zdtp design-token panel config envelope. See project CLAUDE.md. */
|
|
40
|
+
shikiTheme?: string;
|
|
41
|
+
/** Optional semantic overrides. When omitted, defaults from
|
|
42
|
+
* `SEMANTIC_DEFAULTS` are used (surface=p0, muted=p8, accent=p5, …). */
|
|
43
|
+
semantic?: {
|
|
44
|
+
surface?: ColorRef;
|
|
45
|
+
muted?: ColorRef;
|
|
46
|
+
accent?: ColorRef;
|
|
47
|
+
accentHover?: ColorRef;
|
|
48
|
+
codeBg?: ColorRef;
|
|
49
|
+
codeFg?: ColorRef;
|
|
50
|
+
success?: ColorRef;
|
|
51
|
+
danger?: ColorRef;
|
|
52
|
+
warning?: ColorRef;
|
|
53
|
+
info?: ColorRef;
|
|
54
|
+
mermaidNodeBg?: ColorRef;
|
|
55
|
+
mermaidText?: ColorRef;
|
|
56
|
+
mermaidLine?: ColorRef;
|
|
57
|
+
mermaidLabelBg?: ColorRef;
|
|
58
|
+
mermaidNoteBg?: ColorRef;
|
|
59
|
+
chatUserBg?: ColorRef;
|
|
60
|
+
chatUserText?: ColorRef;
|
|
61
|
+
chatAssistantBg?: ColorRef;
|
|
62
|
+
chatAssistantText?: ColorRef;
|
|
63
|
+
/** UI chrome over user images — enlarge/close overlay buttons */
|
|
64
|
+
imageOverlayBg?: ColorRef;
|
|
65
|
+
imageOverlayFg?: ColorRef;
|
|
66
|
+
/** <mark> highlight for matched keywords in search results */
|
|
67
|
+
matchedKeywordBg?: ColorRef;
|
|
68
|
+
matchedKeywordFg?: ColorRef;
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
/** Default mapping: semantic token name → palette index */
|
|
72
|
+
export declare const SEMANTIC_DEFAULTS: Record<string, number>;
|
|
73
|
+
export declare const SEMANTIC_CSS_NAMES: Record<string, string>;
|
|
74
|
+
/** Resolve a ColorRef to a concrete color string.
|
|
75
|
+
* - number → palette[value]
|
|
76
|
+
* - string → used as-is
|
|
77
|
+
* - undefined → fallback */
|
|
78
|
+
export declare function resolveColor(value: ColorRef | undefined, palette: string[], fallback: string): string;
|
|
79
|
+
/** Resolve semantic colors with fallbacks to default palette slots */
|
|
80
|
+
export declare function resolveSemanticColors(scheme: ColorScheme): {
|
|
81
|
+
surface: string;
|
|
82
|
+
muted: string;
|
|
83
|
+
accent: string;
|
|
84
|
+
accentHover: string;
|
|
85
|
+
codeBg: string;
|
|
86
|
+
codeFg: string;
|
|
87
|
+
success: string;
|
|
88
|
+
danger: string;
|
|
89
|
+
warning: string;
|
|
90
|
+
info: string;
|
|
91
|
+
mermaidNodeBg: string;
|
|
92
|
+
mermaidText: string;
|
|
93
|
+
mermaidLine: string;
|
|
94
|
+
mermaidLabelBg: string;
|
|
95
|
+
mermaidNoteBg: string;
|
|
96
|
+
chatUserBg: string;
|
|
97
|
+
chatUserText: string;
|
|
98
|
+
chatAssistantBg: string;
|
|
99
|
+
chatAssistantText: string;
|
|
100
|
+
imageOverlayBg: string;
|
|
101
|
+
imageOverlayFg: string;
|
|
102
|
+
matchedKeywordBg: string;
|
|
103
|
+
matchedKeywordFg: string;
|
|
104
|
+
};
|
|
105
|
+
/** Convert a ColorScheme to a flat list of [cssProperty, value] pairs.
|
|
106
|
+
* The result is the exact set of `--zd-*` custom properties that the
|
|
107
|
+
* ColorSchemeProvider emits onto `:root`. */
|
|
108
|
+
export declare function schemeToCssPairs(scheme: ColorScheme): [string, string][];
|
|
109
|
+
/**
|
|
110
|
+
* Generate the `:root { --zd-* }` CSS block for a single active color scheme.
|
|
111
|
+
*
|
|
112
|
+
* The caller passes in the active `ColorScheme` object — resolved from the
|
|
113
|
+
* project's `colorSchemes` map and `settings.colorScheme`. This function is
|
|
114
|
+
* DATA-free: it performs no settings lookup itself.
|
|
115
|
+
*/
|
|
116
|
+
export declare function generateCssCustomProperties(scheme: ColorScheme): string;
|
|
117
|
+
/**
|
|
118
|
+
* Generate the `:root { --zd-*: light-dark(…, …); }` CSS block for a
|
|
119
|
+
* light/dark pair.
|
|
120
|
+
*
|
|
121
|
+
* The caller passes in the `light` and `dark` `ColorScheme` objects — resolved
|
|
122
|
+
* from the project's `colorSchemes` map and `settings.colorMode`. This
|
|
123
|
+
* function is DATA-free.
|
|
124
|
+
*/
|
|
125
|
+
export declare function generateLightDarkCssProperties(light: ColorScheme, dark: ColorScheme): string;
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
const SEMANTIC_DEFAULTS = {
|
|
2
|
+
surface: 0,
|
|
3
|
+
muted: 8,
|
|
4
|
+
accent: 5,
|
|
5
|
+
accentHover: 14,
|
|
6
|
+
codeBg: 10,
|
|
7
|
+
codeFg: 11,
|
|
8
|
+
success: 2,
|
|
9
|
+
danger: 1,
|
|
10
|
+
warning: 3,
|
|
11
|
+
info: 4,
|
|
12
|
+
mermaidNodeBg: 9,
|
|
13
|
+
mermaidText: 11,
|
|
14
|
+
mermaidLine: 8,
|
|
15
|
+
mermaidLabelBg: 10,
|
|
16
|
+
mermaidNoteBg: 0,
|
|
17
|
+
chatUserBg: 5,
|
|
18
|
+
chatUserText: 9,
|
|
19
|
+
chatAssistantBg: 9,
|
|
20
|
+
chatAssistantText: 11,
|
|
21
|
+
imageOverlayBg: 0,
|
|
22
|
+
imageOverlayFg: 11,
|
|
23
|
+
matchedKeywordBg: 3,
|
|
24
|
+
matchedKeywordFg: 15
|
|
25
|
+
};
|
|
26
|
+
const SEMANTIC_CSS_NAMES = {
|
|
27
|
+
surface: "--zd-surface",
|
|
28
|
+
muted: "--zd-muted",
|
|
29
|
+
accent: "--zd-accent",
|
|
30
|
+
accentHover: "--zd-accent-hover",
|
|
31
|
+
codeBg: "--zd-code-bg",
|
|
32
|
+
codeFg: "--zd-code-fg",
|
|
33
|
+
success: "--zd-success",
|
|
34
|
+
danger: "--zd-danger",
|
|
35
|
+
warning: "--zd-warning",
|
|
36
|
+
info: "--zd-info",
|
|
37
|
+
mermaidNodeBg: "--zd-mermaid-node-bg",
|
|
38
|
+
mermaidText: "--zd-mermaid-text",
|
|
39
|
+
mermaidLine: "--zd-mermaid-line",
|
|
40
|
+
mermaidLabelBg: "--zd-mermaid-label-bg",
|
|
41
|
+
mermaidNoteBg: "--zd-mermaid-note-bg",
|
|
42
|
+
chatUserBg: "--zd-chat-user-bg",
|
|
43
|
+
chatUserText: "--zd-chat-user-text",
|
|
44
|
+
chatAssistantBg: "--zd-chat-assistant-bg",
|
|
45
|
+
chatAssistantText: "--zd-chat-assistant-text",
|
|
46
|
+
imageOverlayBg: "--zd-image-overlay-bg",
|
|
47
|
+
imageOverlayFg: "--zd-image-overlay-fg",
|
|
48
|
+
matchedKeywordBg: "--zd-matched-keyword-bg",
|
|
49
|
+
matchedKeywordFg: "--zd-matched-keyword-fg"
|
|
50
|
+
};
|
|
51
|
+
function resolveColor(value, palette, fallback) {
|
|
52
|
+
if (value === void 0) return fallback;
|
|
53
|
+
if (typeof value === "number") return palette[value] ?? fallback;
|
|
54
|
+
return value;
|
|
55
|
+
}
|
|
56
|
+
function resolveSemanticColors(scheme) {
|
|
57
|
+
const p = scheme.palette;
|
|
58
|
+
return {
|
|
59
|
+
surface: resolveColor(scheme.semantic?.surface, p, p[0]),
|
|
60
|
+
muted: resolveColor(scheme.semantic?.muted, p, p[8]),
|
|
61
|
+
accent: resolveColor(scheme.semantic?.accent, p, p[5]),
|
|
62
|
+
accentHover: resolveColor(scheme.semantic?.accentHover, p, p[14]),
|
|
63
|
+
codeBg: resolveColor(scheme.semantic?.codeBg, p, p[10]),
|
|
64
|
+
codeFg: resolveColor(scheme.semantic?.codeFg, p, p[11]),
|
|
65
|
+
success: resolveColor(scheme.semantic?.success, p, p[2]),
|
|
66
|
+
danger: resolveColor(scheme.semantic?.danger, p, p[1]),
|
|
67
|
+
warning: resolveColor(scheme.semantic?.warning, p, p[3]),
|
|
68
|
+
info: resolveColor(scheme.semantic?.info, p, p[4]),
|
|
69
|
+
mermaidNodeBg: resolveColor(scheme.semantic?.mermaidNodeBg, p, p[9]),
|
|
70
|
+
mermaidText: resolveColor(scheme.semantic?.mermaidText, p, p[11]),
|
|
71
|
+
mermaidLine: resolveColor(scheme.semantic?.mermaidLine, p, p[8]),
|
|
72
|
+
mermaidLabelBg: resolveColor(scheme.semantic?.mermaidLabelBg, p, p[10]),
|
|
73
|
+
mermaidNoteBg: resolveColor(scheme.semantic?.mermaidNoteBg, p, p[0]),
|
|
74
|
+
chatUserBg: resolveColor(scheme.semantic?.chatUserBg, p, p[5]),
|
|
75
|
+
chatUserText: resolveColor(scheme.semantic?.chatUserText, p, p[9]),
|
|
76
|
+
chatAssistantBg: resolveColor(scheme.semantic?.chatAssistantBg, p, p[9]),
|
|
77
|
+
chatAssistantText: resolveColor(scheme.semantic?.chatAssistantText, p, p[11]),
|
|
78
|
+
imageOverlayBg: resolveColor(scheme.semantic?.imageOverlayBg, p, p[0]),
|
|
79
|
+
imageOverlayFg: resolveColor(scheme.semantic?.imageOverlayFg, p, p[11]),
|
|
80
|
+
matchedKeywordBg: resolveColor(scheme.semantic?.matchedKeywordBg, p, p[3]),
|
|
81
|
+
matchedKeywordFg: resolveColor(scheme.semantic?.matchedKeywordFg, p, p[15])
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
function schemeToCssPairs(scheme) {
|
|
85
|
+
const p = scheme.palette;
|
|
86
|
+
const sem = resolveSemanticColors(scheme);
|
|
87
|
+
return [
|
|
88
|
+
["--zd-bg", resolveColor(scheme.background, p, p[0])],
|
|
89
|
+
["--zd-fg", resolveColor(scheme.foreground, p, p[15])],
|
|
90
|
+
["--zd-cursor", resolveColor(scheme.cursor, p, p[6])],
|
|
91
|
+
// intentionally inert/vestigial: exposed in the design-token panel but no CSS rule consumes it (no caret-color wiring); mirrors shikiTheme's status
|
|
92
|
+
["--zd-sel-bg", resolveColor(scheme.selectionBg, p, resolveColor(scheme.background, p, p[0]))],
|
|
93
|
+
["--zd-sel-fg", resolveColor(scheme.selectionFg, p, resolveColor(scheme.foreground, p, p[15]))],
|
|
94
|
+
...p.map((color, i) => [`--zd-${i}`, color]),
|
|
95
|
+
["--zd-surface", sem.surface],
|
|
96
|
+
["--zd-muted", sem.muted],
|
|
97
|
+
["--zd-accent", sem.accent],
|
|
98
|
+
["--zd-accent-hover", sem.accentHover],
|
|
99
|
+
["--zd-code-bg", sem.codeBg],
|
|
100
|
+
["--zd-code-fg", sem.codeFg],
|
|
101
|
+
["--zd-success", sem.success],
|
|
102
|
+
["--zd-danger", sem.danger],
|
|
103
|
+
["--zd-warning", sem.warning],
|
|
104
|
+
["--zd-info", sem.info],
|
|
105
|
+
["--zd-mermaid-node-bg", sem.mermaidNodeBg],
|
|
106
|
+
["--zd-mermaid-text", sem.mermaidText],
|
|
107
|
+
["--zd-mermaid-line", sem.mermaidLine],
|
|
108
|
+
["--zd-mermaid-label-bg", sem.mermaidLabelBg],
|
|
109
|
+
["--zd-mermaid-note-bg", sem.mermaidNoteBg],
|
|
110
|
+
["--zd-chat-user-bg", sem.chatUserBg],
|
|
111
|
+
["--zd-chat-user-text", sem.chatUserText],
|
|
112
|
+
["--zd-chat-assistant-bg", sem.chatAssistantBg],
|
|
113
|
+
["--zd-chat-assistant-text", sem.chatAssistantText],
|
|
114
|
+
["--zd-image-overlay-bg", sem.imageOverlayBg],
|
|
115
|
+
["--zd-image-overlay-fg", sem.imageOverlayFg],
|
|
116
|
+
["--zd-matched-keyword-bg", sem.matchedKeywordBg],
|
|
117
|
+
["--zd-matched-keyword-fg", sem.matchedKeywordFg]
|
|
118
|
+
];
|
|
119
|
+
}
|
|
120
|
+
function generateCssCustomProperties(scheme) {
|
|
121
|
+
const pairs = schemeToCssPairs(scheme);
|
|
122
|
+
const lines = [":root {", ...pairs.map(([prop, value]) => ` ${prop}: ${value};`), "}"];
|
|
123
|
+
return lines.join("\n");
|
|
124
|
+
}
|
|
125
|
+
function generateLightDarkCssProperties(light, dark) {
|
|
126
|
+
const lightPairs = schemeToCssPairs(light);
|
|
127
|
+
const darkPairs = schemeToCssPairs(dark);
|
|
128
|
+
if (lightPairs.length !== darkPairs.length) {
|
|
129
|
+
throw new Error(`Light scheme has ${lightPairs.length} properties but dark scheme has ${darkPairs.length}`);
|
|
130
|
+
}
|
|
131
|
+
const lines = [":root {", " color-scheme: light dark;"];
|
|
132
|
+
for (let i = 0; i < lightPairs.length; i++) {
|
|
133
|
+
const lightPair = lightPairs[i];
|
|
134
|
+
const darkPair = darkPairs[i];
|
|
135
|
+
if (!lightPair || !darkPair) continue;
|
|
136
|
+
const [prop, lightVal] = lightPair;
|
|
137
|
+
const darkVal = darkPair[1];
|
|
138
|
+
lines.push(` ${prop}: light-dark(${lightVal}, ${darkVal});`);
|
|
139
|
+
}
|
|
140
|
+
lines.push("}");
|
|
141
|
+
return lines.join("\n");
|
|
142
|
+
}
|
|
143
|
+
export {
|
|
144
|
+
SEMANTIC_CSS_NAMES,
|
|
145
|
+
SEMANTIC_DEFAULTS,
|
|
146
|
+
generateCssCustomProperties,
|
|
147
|
+
generateLightDarkCssProperties,
|
|
148
|
+
resolveColor,
|
|
149
|
+
resolveSemanticColors,
|
|
150
|
+
schemeToCssPairs
|
|
151
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Create a `composeMetaTitle` helper bound to the given site name.
|
|
3
|
+
*
|
|
4
|
+
* Mirrors the shape of `makeUrlHelpers` (S1a) — the host stub calls this
|
|
5
|
+
* once with its concrete `settings.siteName` and re-exports the result.
|
|
6
|
+
*/
|
|
7
|
+
export declare function createComposeMetaTitle(siteName: string): (title: string) => string;
|
|
@@ -1,16 +1,14 @@
|
|
|
1
|
-
import { HeadingH2 } from
|
|
2
|
-
import { HeadingH3 } from
|
|
3
|
-
import { HeadingH4 } from
|
|
4
|
-
import { ContentParagraph } from
|
|
5
|
-
import { ContentLink } from
|
|
6
|
-
import { ContentStrong } from
|
|
7
|
-
import { ContentBlockquote } from
|
|
8
|
-
import { ContentUl } from
|
|
9
|
-
import { ContentOl } from
|
|
10
|
-
import { ContentTable } from
|
|
11
|
-
import { ContentCode } from
|
|
12
|
-
import 'preact';
|
|
13
|
-
|
|
1
|
+
import { HeadingH2 } from "./heading-h2.js";
|
|
2
|
+
import { HeadingH3 } from "./heading-h3.js";
|
|
3
|
+
import { HeadingH4 } from "./heading-h4.js";
|
|
4
|
+
import { ContentParagraph } from "./content-paragraph.js";
|
|
5
|
+
import { ContentLink } from "./content-link.js";
|
|
6
|
+
import { ContentStrong } from "./content-strong.js";
|
|
7
|
+
import { ContentBlockquote } from "./content-blockquote.js";
|
|
8
|
+
import { ContentUl } from "./content-ul.js";
|
|
9
|
+
import { ContentOl } from "./content-ol.js";
|
|
10
|
+
import { ContentTable } from "./content-table.js";
|
|
11
|
+
import { ContentCode } from "./content-code.js";
|
|
14
12
|
/**
|
|
15
13
|
* MDX component overrides map for the HTML elements used in doc content.
|
|
16
14
|
*
|
|
@@ -18,7 +16,7 @@ import 'preact';
|
|
|
18
16
|
* into a larger components object that also includes admonition overrides,
|
|
19
17
|
* custom shortcodes, etc.) at the Astro page layer.
|
|
20
18
|
*/
|
|
21
|
-
declare const htmlOverrides: {
|
|
19
|
+
export declare const htmlOverrides: {
|
|
22
20
|
h2: typeof HeadingH2;
|
|
23
21
|
h3: typeof HeadingH3;
|
|
24
22
|
h4: typeof HeadingH4;
|
|
@@ -34,7 +32,7 @@ declare const htmlOverrides: {
|
|
|
34
32
|
/**
|
|
35
33
|
* Alias for `htmlOverrides`. Prefer this name in new consumer code.
|
|
36
34
|
*/
|
|
37
|
-
declare const defaultComponents: {
|
|
35
|
+
export declare const defaultComponents: {
|
|
38
36
|
h2: typeof HeadingH2;
|
|
39
37
|
h3: typeof HeadingH3;
|
|
40
38
|
h4: typeof HeadingH4;
|
|
@@ -47,5 +45,3 @@ declare const defaultComponents: {
|
|
|
47
45
|
table: typeof ContentTable;
|
|
48
46
|
code: typeof ContentCode;
|
|
49
47
|
};
|
|
50
|
-
|
|
51
|
-
export { defaultComponents, htmlOverrides };
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import { JSX } from 'preact';
|
|
2
|
-
|
|
3
1
|
/** @jsxRuntime automatic */
|
|
4
2
|
/** @jsxImportSource preact */
|
|
5
|
-
|
|
3
|
+
import type { JSX } from "preact";
|
|
6
4
|
type Props = JSX.IntrinsicElements["blockquote"];
|
|
7
|
-
declare function ContentBlockquote({ children, className, ...rest }: Props): JSX.Element;
|
|
8
|
-
|
|
9
|
-
export { ContentBlockquote };
|
|
5
|
+
export declare function ContentBlockquote({ children, className, ...rest }: Props): JSX.Element;
|
|
6
|
+
export {};
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import { JSX } from 'preact';
|
|
2
|
-
|
|
3
1
|
/** @jsxRuntime automatic */
|
|
4
2
|
/** @jsxImportSource preact */
|
|
5
|
-
|
|
3
|
+
import type { JSX } from "preact";
|
|
6
4
|
type Props = JSX.IntrinsicElements["code"];
|
|
7
5
|
/**
|
|
8
6
|
* Override for inline `<code>` in MDX. Wraps text-only inline code with
|
|
@@ -19,6 +17,5 @@ type Props = JSX.IntrinsicElements["code"];
|
|
|
19
17
|
* `extractText` unwraps that so the heuristic works regardless of MDX's
|
|
20
18
|
* internal wrapping.
|
|
21
19
|
*/
|
|
22
|
-
declare function ContentCode({ children, className, ...rest }: Props): JSX.Element;
|
|
23
|
-
|
|
24
|
-
export { ContentCode };
|
|
20
|
+
export declare function ContentCode({ children, className, ...rest }: Props): JSX.Element;
|
|
21
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx } from "preact/jsx-runtime";
|
|
2
|
-
import { SmartBreak as SmartBreakImpl } from "../
|
|
2
|
+
import { SmartBreak as SmartBreakImpl } from "../smart-break/index.js";
|
|
3
3
|
const SmartBreak = SmartBreakImpl;
|
|
4
4
|
function ContentCode({ children, className, ...rest }) {
|
|
5
5
|
const isShikiBlock = typeof className === "string" && /(^|\s)language-/.test(className);
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import { JSX } from 'preact';
|
|
2
|
-
|
|
3
1
|
/** @jsxRuntime automatic */
|
|
4
2
|
/** @jsxImportSource preact */
|
|
5
|
-
|
|
3
|
+
import type { JSX } from "preact";
|
|
6
4
|
type Props = JSX.IntrinsicElements["a"];
|
|
7
|
-
declare function ContentLink({ href, className, children, ...rest }: Props): JSX.Element;
|
|
8
|
-
|
|
9
|
-
export { ContentLink };
|
|
5
|
+
export declare function ContentLink({ href, className, children, ...rest }: Props): JSX.Element;
|
|
6
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx } from "preact/jsx-runtime";
|
|
2
|
-
import { SmartBreak as SmartBreakBase } from "../
|
|
2
|
+
import { SmartBreak as SmartBreakBase } from "../smart-break/index.js";
|
|
3
3
|
const SmartBreak = SmartBreakBase;
|
|
4
4
|
function ContentLink({ href, className, children, ...rest }) {
|
|
5
5
|
const classes = typeof className === "string" ? className.split(" ") : [];
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import { JSX } from 'preact';
|
|
2
|
-
|
|
3
1
|
/** @jsxRuntime automatic */
|
|
4
2
|
/** @jsxImportSource preact */
|
|
5
|
-
|
|
3
|
+
import type { JSX } from "preact";
|
|
6
4
|
type Props = JSX.IntrinsicElements["ol"];
|
|
7
|
-
declare function ContentOl({ children, className, ...rest }: Props): JSX.Element;
|
|
8
|
-
|
|
9
|
-
export { ContentOl };
|
|
5
|
+
export declare function ContentOl({ children, className, ...rest }: Props): JSX.Element;
|
|
6
|
+
export {};
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import { JSX } from 'preact';
|
|
2
|
-
|
|
3
1
|
/** @jsxRuntime automatic */
|
|
4
2
|
/** @jsxImportSource preact */
|
|
5
|
-
|
|
3
|
+
import type { JSX } from "preact";
|
|
6
4
|
type Props = JSX.IntrinsicElements["p"];
|
|
7
|
-
declare function ContentParagraph({ children, ...rest }: Props): JSX.Element;
|
|
8
|
-
|
|
9
|
-
export { ContentParagraph };
|
|
5
|
+
export declare function ContentParagraph({ children, ...rest }: Props): JSX.Element;
|
|
6
|
+
export {};
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import { JSX } from 'preact';
|
|
2
|
-
|
|
3
1
|
/** @jsxRuntime automatic */
|
|
4
2
|
/** @jsxImportSource preact */
|
|
5
|
-
|
|
3
|
+
import type { JSX } from "preact";
|
|
6
4
|
type Props = JSX.IntrinsicElements["strong"];
|
|
7
|
-
declare function ContentStrong({ children, className, ...rest }: Props): JSX.Element;
|
|
8
|
-
|
|
9
|
-
export { ContentStrong };
|
|
5
|
+
export declare function ContentStrong({ children, className, ...rest }: Props): JSX.Element;
|
|
6
|
+
export {};
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import { JSX } from 'preact';
|
|
2
|
-
|
|
3
1
|
/** @jsxRuntime automatic */
|
|
4
2
|
/** @jsxImportSource preact */
|
|
5
|
-
|
|
3
|
+
import type { JSX } from "preact";
|
|
6
4
|
type Props = JSX.IntrinsicElements["table"];
|
|
7
|
-
declare function ContentTable({ children, className, ...rest }: Props): JSX.Element;
|
|
8
|
-
|
|
9
|
-
export { ContentTable };
|
|
5
|
+
export declare function ContentTable({ children, className, ...rest }: Props): JSX.Element;
|
|
6
|
+
export {};
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import { JSX } from 'preact';
|
|
2
|
-
|
|
3
1
|
/** @jsxRuntime automatic */
|
|
4
2
|
/** @jsxImportSource preact */
|
|
5
|
-
|
|
3
|
+
import type { JSX } from "preact";
|
|
6
4
|
type Props = JSX.IntrinsicElements["ul"];
|
|
7
|
-
declare function ContentUl({ children, className, ...rest }: Props): JSX.Element;
|
|
8
|
-
|
|
9
|
-
export { ContentUl };
|
|
5
|
+
export declare function ContentUl({ children, className, ...rest }: Props): JSX.Element;
|
|
6
|
+
export {};
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import { JSX } from 'preact';
|
|
2
|
-
|
|
3
1
|
/** @jsxRuntime automatic */
|
|
4
2
|
/** @jsxImportSource preact */
|
|
5
|
-
|
|
3
|
+
import type { JSX } from "preact";
|
|
6
4
|
type Props = JSX.IntrinsicElements["h2"];
|
|
7
|
-
declare function HeadingH2({ id, children, className, ...rest }: Props): JSX.Element;
|
|
8
|
-
|
|
9
|
-
export { HeadingH2 };
|
|
5
|
+
export declare function HeadingH2({ id, children, className, ...rest }: Props): JSX.Element;
|
|
6
|
+
export {};
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import { JSX } from 'preact';
|
|
2
|
-
|
|
3
1
|
/** @jsxRuntime automatic */
|
|
4
2
|
/** @jsxImportSource preact */
|
|
5
|
-
|
|
3
|
+
import type { JSX } from "preact";
|
|
6
4
|
type Props = JSX.IntrinsicElements["h3"];
|
|
7
|
-
declare function HeadingH3({ id, children, className, ...rest }: Props): JSX.Element;
|
|
8
|
-
|
|
9
|
-
export { HeadingH3 };
|
|
5
|
+
export declare function HeadingH3({ id, children, className, ...rest }: Props): JSX.Element;
|
|
6
|
+
export {};
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import { JSX } from 'preact';
|
|
2
|
-
|
|
3
1
|
/** @jsxRuntime automatic */
|
|
4
2
|
/** @jsxImportSource preact */
|
|
5
|
-
|
|
3
|
+
import type { JSX } from "preact";
|
|
6
4
|
type Props = JSX.IntrinsicElements["h4"];
|
|
7
|
-
declare function HeadingH4({ id, children, className, ...rest }: Props): JSX.Element;
|
|
8
|
-
|
|
9
|
-
export { HeadingH4 };
|
|
5
|
+
export declare function HeadingH4({ id, children, className, ...rest }: Props): JSX.Element;
|
|
6
|
+
export {};
|
package/dist/content/index.d.ts
CHANGED
|
@@ -1,13 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Public entry for `@takazudo/zudo-doc/content`.
|
|
3
|
+
*
|
|
4
|
+
* Exports the 11 MDX typography override components and the pre-assembled
|
|
5
|
+
* component map. Consumers compose the map at the Astro page layer:
|
|
6
|
+
*
|
|
7
|
+
* import { defaultComponents } from "@takazudo/zudo-doc/content";
|
|
8
|
+
*
|
|
9
|
+
* const components = {
|
|
10
|
+
* ...defaultComponents,
|
|
11
|
+
* Note,
|
|
12
|
+
* Tip,
|
|
13
|
+
* // ... admonitions, shortcodes, etc.
|
|
14
|
+
* };
|
|
15
|
+
*
|
|
16
|
+
* <Content components={components} />
|
|
17
|
+
*/
|
|
18
|
+
export { HeadingH2 } from "./heading-h2.js";
|
|
19
|
+
export { HeadingH3 } from "./heading-h3.js";
|
|
20
|
+
export { HeadingH4 } from "./heading-h4.js";
|
|
21
|
+
export { ContentParagraph } from "./content-paragraph.js";
|
|
22
|
+
export { ContentLink } from "./content-link.js";
|
|
23
|
+
export { ContentStrong } from "./content-strong.js";
|
|
24
|
+
export { ContentBlockquote } from "./content-blockquote.js";
|
|
25
|
+
export { ContentUl } from "./content-ul.js";
|
|
26
|
+
export { ContentOl } from "./content-ol.js";
|
|
27
|
+
export { ContentTable } from "./content-table.js";
|
|
28
|
+
export { ContentCode } from "./content-code.js";
|
|
29
|
+
export { htmlOverrides, defaultComponents } from "./component-map.js";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** @jsxRuntime automatic */
|
|
2
|
+
/** @jsxImportSource preact */
|
|
3
|
+
import type { ComponentChildren, VNode } from "preact";
|
|
4
|
+
export type AdmonitionVariant = "note" | "tip" | "info" | "warning" | "danger" | "caution" | "important";
|
|
5
|
+
export interface AdmonitionProps {
|
|
6
|
+
/** Custom title; falls back to the capitalized variant name (e.g. "Note"). */
|
|
7
|
+
title?: string;
|
|
8
|
+
children?: ComponentChildren;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Build the admonition component for a single variant. The title row is always
|
|
12
|
+
* rendered — defaulting to the capitalized variant name when the author gives
|
|
13
|
+
* no `title` — matching the Astro reference where every callout shows a title.
|
|
14
|
+
*/
|
|
15
|
+
export declare function makeAdmonition(variant: AdmonitionVariant): ({ title, children }: AdmonitionProps) => VNode;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx, jsxs } from "preact/jsx-runtime";
|
|
2
|
+
function makeAdmonition(variant) {
|
|
3
|
+
const defaultTitle = variant.charAt(0).toUpperCase() + variant.slice(1);
|
|
4
|
+
return function Admonition({ title, children }) {
|
|
5
|
+
const heading = title && title.length > 0 ? title : defaultTitle;
|
|
6
|
+
return /* @__PURE__ */ jsxs("div", { "data-admonition": variant, class: `admonition admonition-${variant}`, children: [
|
|
7
|
+
/* @__PURE__ */ jsx("p", { class: "admonition-title", children: heading }),
|
|
8
|
+
/* @__PURE__ */ jsx("div", { class: "admonition-body", children })
|
|
9
|
+
] });
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export {
|
|
13
|
+
makeAdmonition
|
|
14
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Design-token panel (zdtp) WIRING MECHANISM.
|
|
3
|
+
*
|
|
4
|
+
* A side-effect module that calls `configurePanel(panelConfig)` and wires
|
|
5
|
+
* zdtp's lifecycle hooks to zfb's navigation events via
|
|
6
|
+
* `setLifecycleAdapter()`. Projects import this with their own
|
|
7
|
+
* `designTokenPanelConfig` object — the DATA stays project-side.
|
|
8
|
+
*
|
|
9
|
+
* Usage (project-side `src/lib/design-token-panel-bootstrap.ts`):
|
|
10
|
+
*
|
|
11
|
+
* import { bootstrapDesignTokenPanel } from "@takazudo/zudo-doc/design-token-panel-bootstrap";
|
|
12
|
+
* import { designTokenPanelConfig } from "@/config/design-token-panel-config";
|
|
13
|
+
* bootstrapDesignTokenPanel(designTokenPanelConfig);
|
|
14
|
+
*
|
|
15
|
+
* Moved from the host's `src/lib/design-token-panel-bootstrap.ts` as part of
|
|
16
|
+
* the package-first migration (S9a zudolab/zudo-doc#2333). The PanelConfig
|
|
17
|
+
* DATA stays project-side.
|
|
18
|
+
*
|
|
19
|
+
* CSS is pulled via `@import "@takazudo/zdtp/styles.css"` in the project's
|
|
20
|
+
* `src/styles/global.css` so the panel chrome lands in the main page CSS
|
|
21
|
+
* bundle (not a deferred chunk). Vite library mode strips the source CSS
|
|
22
|
+
* import from the emitted JS, so the explicit CSS-side import is the
|
|
23
|
+
* required pull point. See @takazudo/zdtp PORTABLE-CONTRACT.md §7.
|
|
24
|
+
*/
|
|
25
|
+
import { type PanelConfig } from "@takazudo/zdtp";
|
|
26
|
+
/**
|
|
27
|
+
* Bootstrap zdtp for a project. Calls `configurePanel(panelConfig)`,
|
|
28
|
+
* drains any pre-hydration click queue, and wires the zdtp lifecycle
|
|
29
|
+
* adapter to zfb's navigation events so persisted token overrides are
|
|
30
|
+
* re-applied on every soft navigation.
|
|
31
|
+
*
|
|
32
|
+
* Call this once, as a side-effect import from the project's island
|
|
33
|
+
* wrapper (`src/components/design-token-panel-bootstrap.tsx`).
|
|
34
|
+
*
|
|
35
|
+
* @param panelConfig - The project's `PanelConfig` object (data stays
|
|
36
|
+
* project-side in `src/config/design-token-panel-config.ts`).
|
|
37
|
+
*/
|
|
38
|
+
export declare function bootstrapDesignTokenPanel(panelConfig: PanelConfig): void;
|