@takazudo/zudo-doc 0.2.21 → 0.2.22
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/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/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/search-index.d.ts +3 -0
- package/dist/plugins/search-index.js +24 -0
- package/dist/preset.d.ts +152 -0
- package/dist/preset.js +169 -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/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 +255 -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/package.json +290 -10
- package/dist/toc/smart-break.d.ts +0 -27
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** Minimal shape the active-path resolver needs from a header nav item. */
|
|
2
|
-
interface NavItemLike {
|
|
2
|
+
export interface NavItemLike {
|
|
3
3
|
path: string;
|
|
4
4
|
/**
|
|
5
5
|
* The "big category" this nav entry claims (mirrors the host's
|
|
@@ -24,14 +24,14 @@ interface NavItemLike {
|
|
|
24
24
|
* pathForMatch("/docs/intro", "en", "en") === "/docs/intro"
|
|
25
25
|
* pathForMatch(null, "ja", "en") === ""
|
|
26
26
|
*/
|
|
27
|
-
declare function pathForMatch(pathWithoutBase: string, lang: string | undefined, defaultLocale: string): string;
|
|
28
|
-
declare function computeActiveNavPath(navItems: readonly NavItemLike[], pathForMatchValue: string): string | undefined;
|
|
27
|
+
export declare function pathForMatch(pathWithoutBase: string, lang: string | undefined, defaultLocale: string): string;
|
|
28
|
+
export declare function computeActiveNavPath(navItems: readonly NavItemLike[], pathForMatchValue: string): string | undefined;
|
|
29
29
|
/**
|
|
30
30
|
* Active-state predicate for a top-level nav item: the item itself, or
|
|
31
31
|
* any of its children, matches the active path. Mirrors the inline
|
|
32
32
|
* `isNavItemActive` helper in the legacy template.
|
|
33
33
|
*/
|
|
34
|
-
declare function isNavItemActive(item: NavItemLike, activeNavPath: string | undefined): boolean;
|
|
34
|
+
export declare function isNavItemActive(item: NavItemLike, activeNavPath: string | undefined): boolean;
|
|
35
35
|
/**
|
|
36
36
|
* Category-based active-state predicate. A nav entry is active when its
|
|
37
37
|
* own `categoryMatch` equals the page's resolved big category
|
|
@@ -49,6 +49,4 @@ declare function isNavItemActive(item: NavItemLike, activeNavPath: string | unde
|
|
|
49
49
|
* `children` of its own, so the call collapses to a single
|
|
50
50
|
* `categoryMatch` comparison.
|
|
51
51
|
*/
|
|
52
|
-
declare function isNavItemActiveByCategory(item: NavItemLike, activeCategory: string | undefined): boolean;
|
|
53
|
-
|
|
54
|
-
export { type NavItemLike, computeActiveNavPath, isNavItemActive, isNavItemActiveByCategory, pathForMatch };
|
|
52
|
+
export declare function isNavItemActiveByCategory(item: NavItemLike, activeCategory: string | undefined): boolean;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { HeaderRightItem } from
|
|
2
|
-
|
|
1
|
+
import type { HeaderRightItem } from "./types.js";
|
|
3
2
|
/**
|
|
4
3
|
* Runtime gates for `filterHeaderRightItems`.
|
|
5
4
|
*
|
|
@@ -14,7 +13,7 @@ import { HeaderRightItem } from './types.js';
|
|
|
14
13
|
* - `hasVersions` — `Boolean(settings.versions)`
|
|
15
14
|
* - `hasGithubUrl` — `Boolean(settings.githubUrl)`
|
|
16
15
|
*/
|
|
17
|
-
interface HeaderRightItemFlags {
|
|
16
|
+
export interface HeaderRightItemFlags {
|
|
18
17
|
designTokenPanel: boolean;
|
|
19
18
|
aiAssistant: boolean;
|
|
20
19
|
colorMode: boolean;
|
|
@@ -29,6 +28,4 @@ interface HeaderRightItemFlags {
|
|
|
29
28
|
* Items not gated by any flag (links, raw HTML, version-switcher when
|
|
30
29
|
* versions are configured, search, …) pass through untouched.
|
|
31
30
|
*/
|
|
32
|
-
declare function filterHeaderRightItems(items: HeaderRightItem[], flags: HeaderRightItemFlags): HeaderRightItem[];
|
|
33
|
-
|
|
34
|
-
export { type HeaderRightItemFlags, filterHeaderRightItems };
|
|
31
|
+
export declare function filterHeaderRightItems(items: HeaderRightItem[], flags: HeaderRightItemFlags): HeaderRightItem[];
|
package/dist/header/types.d.ts
CHANGED
|
@@ -4,37 +4,35 @@
|
|
|
4
4
|
* package can render for any project's locale set without a generic
|
|
5
5
|
* parameter (super-epic #1724, sub-issue #1729).
|
|
6
6
|
*/
|
|
7
|
-
type Locale = string;
|
|
8
|
-
interface HeaderNavChildItem {
|
|
7
|
+
export type Locale = string;
|
|
8
|
+
export interface HeaderNavChildItem {
|
|
9
9
|
label: string;
|
|
10
10
|
labelKey?: string;
|
|
11
11
|
path: string;
|
|
12
12
|
categoryMatch?: string;
|
|
13
13
|
}
|
|
14
|
-
interface HeaderNavItem extends HeaderNavChildItem {
|
|
14
|
+
export interface HeaderNavItem extends HeaderNavChildItem {
|
|
15
15
|
children?: HeaderNavChildItem[];
|
|
16
16
|
}
|
|
17
|
-
type HeaderRightComponentName = "theme-toggle" | "language-switcher" | "version-switcher" | "github-link" | "search";
|
|
18
|
-
type HeaderRightTriggerName = "design-token-panel" | "ai-chat";
|
|
19
|
-
interface HeaderRightComponentItem {
|
|
17
|
+
export type HeaderRightComponentName = "theme-toggle" | "language-switcher" | "version-switcher" | "github-link" | "search";
|
|
18
|
+
export type HeaderRightTriggerName = "design-token-panel" | "ai-chat";
|
|
19
|
+
export interface HeaderRightComponentItem {
|
|
20
20
|
type: "component";
|
|
21
21
|
component: HeaderRightComponentName;
|
|
22
22
|
}
|
|
23
|
-
interface HeaderRightTriggerItem {
|
|
23
|
+
export interface HeaderRightTriggerItem {
|
|
24
24
|
type: "trigger";
|
|
25
25
|
trigger: HeaderRightTriggerName;
|
|
26
26
|
}
|
|
27
|
-
interface HeaderRightLinkItem {
|
|
27
|
+
export interface HeaderRightLinkItem {
|
|
28
28
|
type: "link";
|
|
29
29
|
href: string;
|
|
30
30
|
label?: string;
|
|
31
31
|
ariaLabel?: string;
|
|
32
32
|
icon?: "github";
|
|
33
33
|
}
|
|
34
|
-
interface HeaderRightHtmlItem {
|
|
34
|
+
export interface HeaderRightHtmlItem {
|
|
35
35
|
type: "html";
|
|
36
36
|
html: string;
|
|
37
37
|
}
|
|
38
|
-
type HeaderRightItem = HeaderRightComponentItem | HeaderRightTriggerItem | HeaderRightLinkItem | HeaderRightHtmlItem;
|
|
39
|
-
|
|
40
|
-
export type { HeaderNavChildItem, HeaderNavItem, HeaderRightComponentItem, HeaderRightComponentName, HeaderRightHtmlItem, HeaderRightItem, HeaderRightLinkItem, HeaderRightTriggerItem, HeaderRightTriggerName, Locale };
|
|
38
|
+
export type HeaderRightItem = HeaderRightComponentItem | HeaderRightTriggerItem | HeaderRightLinkItem | HeaderRightHtmlItem;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/** @jsxRuntime automatic */
|
|
2
|
+
/** @jsxImportSource preact */
|
|
3
|
+
import type { JSX } from "preact";
|
|
4
|
+
import type { SidebarNavNode, SidebarRootMenuItem } from "../sidebar/types.js";
|
|
5
|
+
import type { LocaleLink } from "../url-helpers/index.js";
|
|
6
|
+
export interface HeaderWithDefaultsProps {
|
|
7
|
+
/** Active locale; defaults to the configured defaultLocale. */
|
|
8
|
+
lang?: string;
|
|
9
|
+
/** Current page URL path. Used to compute the active nav item. */
|
|
10
|
+
currentPath?: string;
|
|
11
|
+
/** Active version slug, when rendering inside /v/{version}/... routes. */
|
|
12
|
+
currentVersion?: string;
|
|
13
|
+
/** Slug of the active doc page. */
|
|
14
|
+
currentSlug?: string;
|
|
15
|
+
/** Header-nav category matcher used to scope the sidebar tree. */
|
|
16
|
+
navSection?: string;
|
|
17
|
+
}
|
|
18
|
+
/** Version config entry subset the factory reads. */
|
|
19
|
+
export interface HeaderVersionEntry {
|
|
20
|
+
slug: string;
|
|
21
|
+
label?: string;
|
|
22
|
+
}
|
|
23
|
+
/** Settings subset read by {@link createHeaderWithDefaults}. */
|
|
24
|
+
export interface HeaderWithDefaultsSettings {
|
|
25
|
+
siteName: string;
|
|
26
|
+
headerNav: Array<{
|
|
27
|
+
label: string;
|
|
28
|
+
labelKey?: string;
|
|
29
|
+
path: string;
|
|
30
|
+
categoryMatch?: string;
|
|
31
|
+
children?: Array<{
|
|
32
|
+
label: string;
|
|
33
|
+
labelKey?: string;
|
|
34
|
+
path: string;
|
|
35
|
+
}>;
|
|
36
|
+
}>;
|
|
37
|
+
headerRightItems?: unknown[];
|
|
38
|
+
designTokenPanel?: boolean;
|
|
39
|
+
aiAssistant?: boolean;
|
|
40
|
+
colorMode?: {
|
|
41
|
+
defaultMode?: string;
|
|
42
|
+
} | null | false;
|
|
43
|
+
locales: Record<string, unknown>;
|
|
44
|
+
versions?: HeaderVersionEntry[] | false;
|
|
45
|
+
githubUrl?: string | false;
|
|
46
|
+
}
|
|
47
|
+
/** Dependencies injected by the host stub. */
|
|
48
|
+
export interface HeaderWithDefaultsDeps {
|
|
49
|
+
settings: HeaderWithDefaultsSettings;
|
|
50
|
+
defaultLocale: string;
|
|
51
|
+
locales: readonly string[];
|
|
52
|
+
t: (key: string, lang: string) => string;
|
|
53
|
+
withBase: (path: string) => string;
|
|
54
|
+
stripBase: (path: string) => string;
|
|
55
|
+
docsUrl: (slug: string, lang: string) => string;
|
|
56
|
+
navHref: (path: string, lang: string | undefined, version: string | undefined) => string;
|
|
57
|
+
versionedDocsUrl: (slug: string, versionSlug: string, lang: string) => string;
|
|
58
|
+
buildLocaleLinksForNav: (currentPath: string, lang: string, localeCount: number) => LocaleLink[] | undefined;
|
|
59
|
+
buildRootMenuItems: (lang: string, currentVersion: string | undefined) => SidebarRootMenuItem[];
|
|
60
|
+
buildSidebarNodes: (lang: string, navSection: string | undefined, currentVersion: string | undefined) => SidebarNavNode[];
|
|
61
|
+
getThemeDefaultMode: () => "light" | "dark" | undefined;
|
|
62
|
+
buildGitHubRepoUrl: () => string | null;
|
|
63
|
+
SearchWidget: (props: {
|
|
64
|
+
placeholderText: string;
|
|
65
|
+
shortcutHint: string;
|
|
66
|
+
resultCountTemplate: string;
|
|
67
|
+
searchLabel: string;
|
|
68
|
+
searchUnavailableText: string;
|
|
69
|
+
loadingIndexText: string;
|
|
70
|
+
noResultsText: string;
|
|
71
|
+
}) => JSX.Element;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Create a `HeaderWithDefaults` component bound to the host's settings
|
|
75
|
+
* and data-prep utilities.
|
|
76
|
+
*/
|
|
77
|
+
export declare function createHeaderWithDefaults(deps: HeaderWithDefaultsDeps): (props: HeaderWithDefaultsProps) => JSX.Element;
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import { jsx } from "preact/jsx-runtime";
|
|
2
|
+
import { Island } from "@takazudo/zfb";
|
|
3
|
+
import { Header, filterHeaderRightItems } from "../header/index.js";
|
|
4
|
+
import {
|
|
5
|
+
LanguageSwitcher,
|
|
6
|
+
VersionSwitcher
|
|
7
|
+
} from "../i18n-version/index.js";
|
|
8
|
+
import { ThemeToggle } from "../theme-toggle/index.js";
|
|
9
|
+
import { SidebarToggle } from "../sidebar-toggle-island/index.js";
|
|
10
|
+
function createHeaderWithDefaults(deps) {
|
|
11
|
+
const {
|
|
12
|
+
settings,
|
|
13
|
+
defaultLocale,
|
|
14
|
+
locales,
|
|
15
|
+
t,
|
|
16
|
+
withBase,
|
|
17
|
+
stripBase,
|
|
18
|
+
docsUrl,
|
|
19
|
+
navHref,
|
|
20
|
+
versionedDocsUrl,
|
|
21
|
+
buildLocaleLinksForNav,
|
|
22
|
+
buildRootMenuItems,
|
|
23
|
+
buildSidebarNodes,
|
|
24
|
+
getThemeDefaultMode,
|
|
25
|
+
buildGitHubRepoUrl,
|
|
26
|
+
SearchWidget
|
|
27
|
+
} = deps;
|
|
28
|
+
function HeaderWithDefaults(props) {
|
|
29
|
+
const {
|
|
30
|
+
lang: langProp = defaultLocale,
|
|
31
|
+
currentPath = "",
|
|
32
|
+
currentVersion,
|
|
33
|
+
currentSlug,
|
|
34
|
+
navSection
|
|
35
|
+
} = props;
|
|
36
|
+
const lang = langProp;
|
|
37
|
+
const rootMenuItems = buildRootMenuItems(lang, currentVersion);
|
|
38
|
+
const backToMenuLabel = t("nav.backToMenu", lang);
|
|
39
|
+
const localeLinks = buildLocaleLinksForNav(currentPath, lang, locales.length);
|
|
40
|
+
const themeDefaultMode = getThemeDefaultMode();
|
|
41
|
+
const sidebarNodes = buildSidebarNodes(lang, navSection, currentVersion);
|
|
42
|
+
const sidebarToggle = Island({
|
|
43
|
+
when: "visible",
|
|
44
|
+
children: /* @__PURE__ */ jsx(
|
|
45
|
+
SidebarToggle,
|
|
46
|
+
{
|
|
47
|
+
nodes: sidebarNodes,
|
|
48
|
+
currentSlug,
|
|
49
|
+
rootMenuItems,
|
|
50
|
+
backToMenuLabel,
|
|
51
|
+
localeLinks,
|
|
52
|
+
themeDefaultMode
|
|
53
|
+
}
|
|
54
|
+
)
|
|
55
|
+
});
|
|
56
|
+
const themeToggle = Island({
|
|
57
|
+
when: "load",
|
|
58
|
+
children: /* @__PURE__ */ jsx(ThemeToggle, { defaultMode: themeDefaultMode })
|
|
59
|
+
});
|
|
60
|
+
const searchWidget = /* @__PURE__ */ jsx(
|
|
61
|
+
SearchWidget,
|
|
62
|
+
{
|
|
63
|
+
placeholderText: t("search.placeholder", lang),
|
|
64
|
+
shortcutHint: t("search.shortcutHint", lang),
|
|
65
|
+
resultCountTemplate: t("search.resultCount", lang),
|
|
66
|
+
searchLabel: t("search.label", lang),
|
|
67
|
+
searchUnavailableText: t("search.unavailable", lang),
|
|
68
|
+
loadingIndexText: t("search.loadingIndex", lang),
|
|
69
|
+
noResultsText: t("search.noResults", lang)
|
|
70
|
+
}
|
|
71
|
+
);
|
|
72
|
+
let versionSwitcher;
|
|
73
|
+
if (settings.versions && settings.versions.length > 0) {
|
|
74
|
+
const isNonDefaultLocale = lang !== defaultLocale;
|
|
75
|
+
const versionsPageUrl = withBase(
|
|
76
|
+
isNonDefaultLocale ? `/${lang}/docs/versions` : "/docs/versions"
|
|
77
|
+
);
|
|
78
|
+
const latestUrl = currentSlug != null ? docsUrl(currentSlug, lang) : versionsPageUrl;
|
|
79
|
+
const versionUrls = {};
|
|
80
|
+
for (const v of settings.versions) {
|
|
81
|
+
versionUrls[v.slug] = currentSlug != null ? versionedDocsUrl(currentSlug, v.slug, lang) : versionsPageUrl;
|
|
82
|
+
}
|
|
83
|
+
const labels = {
|
|
84
|
+
latest: t("version.latest", lang),
|
|
85
|
+
switcher: t("version.switcher.label", lang),
|
|
86
|
+
unavailable: t("version.switcher.unavailable", lang),
|
|
87
|
+
allVersions: t("version.switcher.allVersions", lang)
|
|
88
|
+
};
|
|
89
|
+
versionSwitcher = /* @__PURE__ */ jsx(
|
|
90
|
+
VersionSwitcher,
|
|
91
|
+
{
|
|
92
|
+
versions: settings.versions.map((v) => ({
|
|
93
|
+
slug: v.slug,
|
|
94
|
+
label: v.label ?? v.slug
|
|
95
|
+
})),
|
|
96
|
+
currentVersion,
|
|
97
|
+
latestUrl,
|
|
98
|
+
versionsPageUrl,
|
|
99
|
+
versionUrls,
|
|
100
|
+
labels,
|
|
101
|
+
idSuffix: "header"
|
|
102
|
+
}
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
const languageSwitcher = localeLinks != null ? /* @__PURE__ */ jsx(
|
|
106
|
+
LanguageSwitcher,
|
|
107
|
+
{
|
|
108
|
+
links: localeLinks
|
|
109
|
+
}
|
|
110
|
+
) : void 0;
|
|
111
|
+
const persistKey = `header-${lang}`;
|
|
112
|
+
const headerRightItems = filterHeaderRightItems(
|
|
113
|
+
settings.headerRightItems ?? [],
|
|
114
|
+
{
|
|
115
|
+
designTokenPanel: Boolean(settings.designTokenPanel),
|
|
116
|
+
aiAssistant: Boolean(settings.aiAssistant),
|
|
117
|
+
colorMode: Boolean(settings.colorMode),
|
|
118
|
+
hasLocales: Object.keys(settings.locales).length > 0,
|
|
119
|
+
hasVersions: Boolean(settings.versions),
|
|
120
|
+
hasGithubUrl: Boolean(settings.githubUrl)
|
|
121
|
+
}
|
|
122
|
+
);
|
|
123
|
+
const githubRepoUrl = buildGitHubRepoUrl();
|
|
124
|
+
const githubLabel = t("header.github", lang);
|
|
125
|
+
return /* @__PURE__ */ jsx(
|
|
126
|
+
Header,
|
|
127
|
+
{
|
|
128
|
+
lang,
|
|
129
|
+
currentPath,
|
|
130
|
+
currentVersion,
|
|
131
|
+
activeCategory: navSection,
|
|
132
|
+
sidebarToggle,
|
|
133
|
+
themeToggle,
|
|
134
|
+
search: searchWidget,
|
|
135
|
+
versionSwitcher,
|
|
136
|
+
languageSwitcher,
|
|
137
|
+
persistKey,
|
|
138
|
+
siteName: settings.siteName,
|
|
139
|
+
headerNav: settings.headerNav,
|
|
140
|
+
headerRightItems,
|
|
141
|
+
colorModeEnabled: Boolean(settings.colorMode),
|
|
142
|
+
hasLocales: locales.length > 1,
|
|
143
|
+
hasVersions: Boolean(settings.versions),
|
|
144
|
+
githubRepoUrl,
|
|
145
|
+
githubLabel,
|
|
146
|
+
urlHelpers: {
|
|
147
|
+
withBase,
|
|
148
|
+
stripBase,
|
|
149
|
+
navHref: (path, l, v) => navHref(path, l, v)
|
|
150
|
+
},
|
|
151
|
+
i18n: {
|
|
152
|
+
defaultLocale,
|
|
153
|
+
locales,
|
|
154
|
+
t
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
);
|
|
158
|
+
}
|
|
159
|
+
return HeaderWithDefaults;
|
|
160
|
+
}
|
|
161
|
+
export {
|
|
162
|
+
createHeaderWithDefaults
|
|
163
|
+
};
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import { VNode } from 'preact';
|
|
2
|
-
|
|
3
1
|
/** @jsxRuntime automatic */
|
|
4
2
|
/** @jsxImportSource preact */
|
|
5
|
-
|
|
6
|
-
interface HighlightedCodeProps {
|
|
3
|
+
import type { VNode } from "preact";
|
|
4
|
+
export interface HighlightedCodeProps {
|
|
7
5
|
code: string;
|
|
8
6
|
language: string;
|
|
9
7
|
}
|
|
@@ -13,6 +11,4 @@ interface HighlightedCodeProps {
|
|
|
13
11
|
*
|
|
14
12
|
* JSX port of src/components/html-preview/highlighted-code.tsx.
|
|
15
13
|
*/
|
|
16
|
-
declare function HighlightedCode({ code, language, }: HighlightedCodeProps): VNode;
|
|
17
|
-
|
|
18
|
-
export { HighlightedCode, type HighlightedCodeProps };
|
|
14
|
+
export declare function HighlightedCode({ code, language, }: HighlightedCodeProps): VNode;
|
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
import { VNode } from 'preact';
|
|
2
|
-
|
|
3
1
|
/** @jsxRuntime automatic */
|
|
4
2
|
/** @jsxImportSource preact */
|
|
5
|
-
|
|
3
|
+
import type { VNode } from "preact";
|
|
6
4
|
/**
|
|
7
5
|
* Global HTML preview configuration. Mirrors the `settings.htmlPreview`
|
|
8
6
|
* shape from the host project so callers can pass the resolved config
|
|
9
7
|
* object directly.
|
|
10
8
|
*/
|
|
11
|
-
interface HtmlPreviewGlobalConfig {
|
|
9
|
+
export interface HtmlPreviewGlobalConfig {
|
|
12
10
|
/** CSS appended to every preview iframe (e.g. global component library styles). */
|
|
13
11
|
css?: string;
|
|
14
12
|
/** HTML injected into the `<head>` of every preview iframe. */
|
|
@@ -16,7 +14,7 @@ interface HtmlPreviewGlobalConfig {
|
|
|
16
14
|
/** JavaScript appended to every preview iframe's `<body>`. */
|
|
17
15
|
js?: string;
|
|
18
16
|
}
|
|
19
|
-
interface HtmlPreviewWrapperProps {
|
|
17
|
+
export interface HtmlPreviewWrapperProps {
|
|
20
18
|
/**
|
|
21
19
|
* Site-wide HTML preview configuration (resolved from
|
|
22
20
|
* `settings.htmlPreview` by the caller). When provided, its
|
|
@@ -83,8 +81,8 @@ interface HtmlPreviewWrapperProps {
|
|
|
83
81
|
* (`HtmlPreviewWrapperInner`) and is exported, so the marker resolves to
|
|
84
82
|
* THIS bare component and the bundle hydrates it in-place.
|
|
85
83
|
*/
|
|
86
|
-
declare function HtmlPreviewWrapperInner(props: HtmlPreviewWrapperProps): VNode;
|
|
87
|
-
declare namespace HtmlPreviewWrapperInner {
|
|
84
|
+
export declare function HtmlPreviewWrapperInner(props: HtmlPreviewWrapperProps): VNode;
|
|
85
|
+
export declare namespace HtmlPreviewWrapperInner {
|
|
88
86
|
var displayName: string;
|
|
89
87
|
}
|
|
90
88
|
/**
|
|
@@ -103,6 +101,4 @@ declare namespace HtmlPreviewWrapperInner {
|
|
|
103
101
|
* `HtmlPreview: HtmlPreviewWrapper` keep working (and now hydrate correctly)
|
|
104
102
|
* with no call-site change.
|
|
105
103
|
*/
|
|
106
|
-
declare function HtmlPreviewWrapper(props: HtmlPreviewWrapperProps): VNode;
|
|
107
|
-
|
|
108
|
-
export { type HtmlPreviewGlobalConfig, HtmlPreviewWrapper, HtmlPreviewWrapperInner, type HtmlPreviewWrapperProps };
|
|
104
|
+
export declare function HtmlPreviewWrapper(props: HtmlPreviewWrapperProps): VNode;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import { VNode } from 'preact';
|
|
2
|
-
|
|
3
1
|
/** @jsxRuntime automatic */
|
|
4
2
|
/** @jsxImportSource preact */
|
|
5
|
-
|
|
6
|
-
interface HtmlPreviewProps {
|
|
3
|
+
import type { VNode } from "preact";
|
|
4
|
+
export interface HtmlPreviewProps {
|
|
7
5
|
html: string;
|
|
8
6
|
css?: string;
|
|
9
7
|
head?: string;
|
|
@@ -39,7 +37,7 @@ interface HtmlPreviewProps {
|
|
|
39
37
|
/** Per-component js for code block display (before global merge) */
|
|
40
38
|
componentJs?: string;
|
|
41
39
|
}
|
|
42
|
-
declare function containsScript(head?: string, js?: string): boolean;
|
|
40
|
+
export declare function containsScript(head?: string, js?: string): boolean;
|
|
43
41
|
/**
|
|
44
42
|
* Resolve the iframe `sandbox` attribute value.
|
|
45
43
|
*
|
|
@@ -58,7 +56,7 @@ declare function containsScript(head?: string, js?: string): boolean;
|
|
|
58
56
|
* author-trusted MDX. See {@link HtmlPreviewProps.sandbox} for the downstream
|
|
59
57
|
* trust note.
|
|
60
58
|
*/
|
|
61
|
-
declare function resolveSandbox(sandbox: string | undefined, hasScripts: boolean): string;
|
|
59
|
+
export declare function resolveSandbox(sandbox: string | undefined, hasScripts: boolean): string;
|
|
62
60
|
/**
|
|
63
61
|
* HTML preview widget — renders an isolated iframe with viewport
|
|
64
62
|
* controls and a collapsible code section.
|
|
@@ -71,6 +69,4 @@ declare function resolveSandbox(sandbox: string | undefined, hasScripts: boolean
|
|
|
71
69
|
* Astro, or wire up the SSR-skip placeholder pattern for non-Astro
|
|
72
70
|
* consumers.
|
|
73
71
|
*/
|
|
74
|
-
declare function HtmlPreview({ html, css, head, js, title, height, defaultOpen, sandbox, componentCss, componentHead, componentJs, }: HtmlPreviewProps): VNode;
|
|
75
|
-
|
|
76
|
-
export { HtmlPreview, type HtmlPreviewProps, containsScript, resolveSandbox };
|
|
72
|
+
export declare function HtmlPreview({ html, css, head, js, title, height, defaultOpen, sandbox, componentCss, componentHead, componentJs, }: HtmlPreviewProps): VNode;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
5
|
-
|
|
1
|
+
export { HtmlPreviewWrapper, HtmlPreviewWrapperInner, } from "./html-preview-wrapper.js";
|
|
2
|
+
export type { HtmlPreviewWrapperProps, HtmlPreviewGlobalConfig, } from "./html-preview-wrapper.js";
|
|
3
|
+
export { HtmlPreview } from "./html-preview.js";
|
|
4
|
+
export type { HtmlPreviewProps } from "./html-preview.js";
|
|
5
|
+
export { PreviewBase } from "./preview-base.js";
|
|
6
|
+
export type { PreviewBaseProps, CodeBlockData } from "./preview-base.js";
|
|
7
|
+
export { HighlightedCode } from "./highlighted-code.js";
|
|
8
|
+
export type { HighlightedCodeProps } from "./highlighted-code.js";
|
|
@@ -8,6 +8,4 @@
|
|
|
8
8
|
* Copied verbatim from src/components/html-preview/preflight.ts so the
|
|
9
9
|
* v2 package has no upward dependency on the host project's source.
|
|
10
10
|
*/
|
|
11
|
-
declare const preflightCss = "\n*,\n::after,\n::before,\n::backdrop,\n::file-selector-button {\n box-sizing: border-box;\n margin: 0;\n padding: 0;\n border: 0 solid;\n}\n\nhtml,\n:host {\n line-height: 1.5;\n -webkit-text-size-adjust: 100%;\n tab-size: 4;\n font-family: ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';\n -webkit-tap-highlight-color: transparent;\n}\n\nhr {\n height: 0;\n color: inherit;\n border-top-width: 1px;\n}\n\nabbr:where([title]) {\n -webkit-text-decoration: underline dotted;\n text-decoration: underline dotted;\n}\n\nh1, h2, h3, h4, h5, h6 {\n font-size: inherit;\n font-weight: inherit;\n}\n\na {\n color: inherit;\n -webkit-text-decoration: inherit;\n text-decoration: inherit;\n}\n\nb, strong {\n font-weight: bolder;\n}\n\ncode, kbd, samp, pre {\n font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;\n font-size: 1em;\n}\n\nsmall {\n font-size: 80%;\n}\n\nsub, sup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n}\n\nsub { bottom: -0.25em; }\nsup { top: -0.5em; }\n\ntable {\n text-indent: 0;\n border-color: inherit;\n border-collapse: collapse;\n}\n\nol, ul, menu {\n list-style: none;\n}\n\nimg, svg, video, canvas, audio, iframe, embed, object {\n display: block;\n vertical-align: middle;\n}\n\nimg, video {\n max-width: 100%;\n height: auto;\n}\n\nbutton, input, select, optgroup, textarea, ::file-selector-button {\n font: inherit;\n font-feature-settings: inherit;\n font-variation-settings: inherit;\n letter-spacing: inherit;\n color: inherit;\n border-radius: 0;\n background-color: transparent;\n opacity: 1;\n}\n\ntextarea {\n resize: vertical;\n}\n\n[hidden]:where(:not([hidden='until-found'])) {\n display: none !important;\n}\n";
|
|
12
|
-
|
|
13
|
-
export { preflightCss };
|
|
11
|
+
export declare const preflightCss = "\n*,\n::after,\n::before,\n::backdrop,\n::file-selector-button {\n box-sizing: border-box;\n margin: 0;\n padding: 0;\n border: 0 solid;\n}\n\nhtml,\n:host {\n line-height: 1.5;\n -webkit-text-size-adjust: 100%;\n tab-size: 4;\n font-family: ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';\n -webkit-tap-highlight-color: transparent;\n}\n\nhr {\n height: 0;\n color: inherit;\n border-top-width: 1px;\n}\n\nabbr:where([title]) {\n -webkit-text-decoration: underline dotted;\n text-decoration: underline dotted;\n}\n\nh1, h2, h3, h4, h5, h6 {\n font-size: inherit;\n font-weight: inherit;\n}\n\na {\n color: inherit;\n -webkit-text-decoration: inherit;\n text-decoration: inherit;\n}\n\nb, strong {\n font-weight: bolder;\n}\n\ncode, kbd, samp, pre {\n font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;\n font-size: 1em;\n}\n\nsmall {\n font-size: 80%;\n}\n\nsub, sup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n}\n\nsub { bottom: -0.25em; }\nsup { top: -0.5em; }\n\ntable {\n text-indent: 0;\n border-color: inherit;\n border-collapse: collapse;\n}\n\nol, ul, menu {\n list-style: none;\n}\n\nimg, svg, video, canvas, audio, iframe, embed, object {\n display: block;\n vertical-align: middle;\n}\n\nimg, video {\n max-width: 100%;\n height: auto;\n}\n\nbutton, input, select, optgroup, textarea, ::file-selector-button {\n font: inherit;\n font-feature-settings: inherit;\n font-variation-settings: inherit;\n letter-spacing: inherit;\n color: inherit;\n border-radius: 0;\n background-color: transparent;\n opacity: 1;\n}\n\ntextarea {\n resize: vertical;\n}\n\n[hidden]:where(:not([hidden='until-found'])) {\n display: none !important;\n}\n";
|
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
import { VNode } from 'preact';
|
|
2
|
-
|
|
3
1
|
/** @jsxRuntime automatic */
|
|
4
2
|
/** @jsxImportSource preact */
|
|
5
|
-
|
|
6
|
-
interface CodeBlockData {
|
|
3
|
+
import type { VNode } from "preact";
|
|
4
|
+
export interface CodeBlockData {
|
|
7
5
|
language: string;
|
|
8
6
|
title: string;
|
|
9
7
|
code: string;
|
|
10
8
|
}
|
|
11
|
-
interface PreviewBaseProps {
|
|
9
|
+
export interface PreviewBaseProps {
|
|
12
10
|
title?: string;
|
|
13
11
|
height?: number;
|
|
14
12
|
srcdoc: string;
|
|
@@ -24,6 +22,4 @@ interface PreviewBaseProps {
|
|
|
24
22
|
* JSX port of src/components/html-preview/preview-base.tsx with
|
|
25
23
|
* React → Preact hook imports and `className` → `class` attribute.
|
|
26
24
|
*/
|
|
27
|
-
declare function PreviewBase({ title, height, srcdoc, sandbox, syncDelay, codeBlocks, defaultOpen, }: PreviewBaseProps): VNode;
|
|
28
|
-
|
|
29
|
-
export { type CodeBlockData, PreviewBase, type PreviewBaseProps };
|
|
25
|
+
export declare function PreviewBase({ title, height, srcdoc, sandbox, syncDelay, codeBlocks, defaultOpen, }: PreviewBaseProps): VNode;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
export { LanguageSwitcher
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
5
|
-
|
|
1
|
+
export { LanguageSwitcher } from "./language-switcher.js";
|
|
2
|
+
export type { LanguageSwitcherProps } from "./language-switcher.js";
|
|
3
|
+
export { VersionSwitcher, VERSION_SWITCHER_INIT_SCRIPT, VERSION_SWITCHER_VISIBILITY_STYLE, } from "./version-switcher.js";
|
|
4
|
+
export type { VersionSwitcherProps } from "./version-switcher.js";
|
|
5
|
+
export { VersionBanner } from "./version-banner.js";
|
|
6
|
+
export type { VersionBannerProps, VersionBannerLabels } from "./version-banner.js";
|
|
7
|
+
export type { LocaleLink, VersionEntry, VersionSwitcherLabels, } from "./types.js";
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import { VNode } from 'preact';
|
|
2
|
-
import { LocaleLink } from './types.js';
|
|
3
|
-
|
|
4
1
|
/** @jsxRuntime automatic */
|
|
5
2
|
/** @jsxImportSource preact */
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
import type { VNode } from "preact";
|
|
4
|
+
import type { LocaleLink } from "./types.js";
|
|
5
|
+
export interface LanguageSwitcherProps {
|
|
8
6
|
/**
|
|
9
7
|
* Pre-built locale links, ordered as they should appear in the bar.
|
|
10
8
|
* The host project typically derives this with its own
|
|
@@ -19,6 +17,5 @@ interface LanguageSwitcherProps {
|
|
|
19
17
|
* template's `localeLinks.length > 1 &&` guard so call-sites can mount
|
|
20
18
|
* the component unconditionally).
|
|
21
19
|
*/
|
|
22
|
-
declare function LanguageSwitcher({ links }: LanguageSwitcherProps): VNode | null;
|
|
23
|
-
|
|
24
|
-
export { LanguageSwitcher, type LanguageSwitcherProps, LocaleLink };
|
|
20
|
+
export declare function LanguageSwitcher({ links }: LanguageSwitcherProps): VNode | null;
|
|
21
|
+
export type { LocaleLink };
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Mirrors the shape of `LocaleLink` from src/types/locale.ts so existing
|
|
5
5
|
* call-sites can pass their already-built links straight through.
|
|
6
6
|
*/
|
|
7
|
-
interface LocaleLink {
|
|
7
|
+
export interface LocaleLink {
|
|
8
8
|
/** BCP-47 code, e.g. "en", "ja". Rendered as the anchor's `lang` attribute. */
|
|
9
9
|
code: string;
|
|
10
10
|
/** Display label (typically the uppercased code). */
|
|
@@ -20,7 +20,7 @@ interface LocaleLink {
|
|
|
20
20
|
* Slug is the URL-segment identifier; label is the user-visible string
|
|
21
21
|
* (e.g. "v2.0", "1.x").
|
|
22
22
|
*/
|
|
23
|
-
interface VersionEntry {
|
|
23
|
+
export interface VersionEntry {
|
|
24
24
|
slug: string;
|
|
25
25
|
label: string;
|
|
26
26
|
}
|
|
@@ -29,7 +29,7 @@ interface VersionEntry {
|
|
|
29
29
|
* than wired to a host-side i18n module so the v2 package stays
|
|
30
30
|
* locale-system agnostic.
|
|
31
31
|
*/
|
|
32
|
-
interface VersionSwitcherLabels {
|
|
32
|
+
export interface VersionSwitcherLabels {
|
|
33
33
|
/** Label for the "latest" entry, e.g. "Latest" / "最新". */
|
|
34
34
|
latest: string;
|
|
35
35
|
/** Trigger-button prefix, e.g. "Version" / "バージョン". */
|
|
@@ -39,5 +39,3 @@ interface VersionSwitcherLabels {
|
|
|
39
39
|
/** Footer link label, e.g. "All versions". */
|
|
40
40
|
allVersions: string;
|
|
41
41
|
}
|
|
42
|
-
|
|
43
|
-
export type { LocaleLink, VersionEntry, VersionSwitcherLabels };
|
|
@@ -1,15 +1,13 @@
|
|
|
1
|
-
import { VNode } from 'preact';
|
|
2
|
-
|
|
3
1
|
/** @jsxRuntime automatic */
|
|
4
2
|
/** @jsxImportSource preact */
|
|
5
|
-
|
|
6
|
-
interface VersionBannerLabels {
|
|
3
|
+
import type { VNode } from "preact";
|
|
4
|
+
export interface VersionBannerLabels {
|
|
7
5
|
/** Banner body text (e.g. "You are viewing documentation for an older version."). */
|
|
8
6
|
message: string;
|
|
9
7
|
/** Link label to the latest version (e.g. "View the latest version"). */
|
|
10
8
|
latestLink: string;
|
|
11
9
|
}
|
|
12
|
-
interface VersionBannerProps {
|
|
10
|
+
export interface VersionBannerProps {
|
|
13
11
|
/** Variant — drives icon/colour selection downstream and is exposed via `data-variant`. */
|
|
14
12
|
type: "unmaintained" | "unreleased";
|
|
15
13
|
/** Pre-resolved href to the latest version of the current page. */
|
|
@@ -25,6 +23,4 @@ interface VersionBannerProps {
|
|
|
25
23
|
* The host typically resolves `labels` via `t("version.banner.*", lang)`
|
|
26
24
|
* and `latestUrl` via the project's URL helpers.
|
|
27
25
|
*/
|
|
28
|
-
declare function VersionBanner(props: VersionBannerProps): VNode;
|
|
29
|
-
|
|
30
|
-
export { VersionBanner, type VersionBannerLabels, type VersionBannerProps };
|
|
26
|
+
export declare function VersionBanner(props: VersionBannerProps): VNode;
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import { VNode } from 'preact';
|
|
2
|
-
import { VersionEntry, VersionSwitcherLabels } from './types.js';
|
|
3
|
-
|
|
4
1
|
/** @jsxRuntime automatic */
|
|
5
2
|
/** @jsxImportSource preact */
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
import type { VNode } from "preact";
|
|
4
|
+
import type { VersionEntry, VersionSwitcherLabels } from "./types.js";
|
|
5
|
+
export interface VersionSwitcherProps {
|
|
8
6
|
/**
|
|
9
7
|
* All known versions, in display order (latest at top of the dropdown
|
|
10
8
|
* is rendered separately via `latestUrl` — this list is the
|
|
@@ -74,7 +72,7 @@ interface VersionSwitcherProps {
|
|
|
74
72
|
* also wins over `@layer utilities` regardless of specificity, so this rule
|
|
75
73
|
* reliably overrides the wrapper's `display: none` at `>= 64rem`.
|
|
76
74
|
*/
|
|
77
|
-
declare const VERSION_SWITCHER_VISIBILITY_STYLE = "@media (min-width:64rem){.hidden:has(> [data-version-switcher]){display:block}}";
|
|
75
|
+
export declare const VERSION_SWITCHER_VISIBILITY_STYLE = "@media (min-width:64rem){.hidden:has(> [data-version-switcher]){display:block}}";
|
|
78
76
|
/**
|
|
79
77
|
* Drop-down version switcher rendered in the header.
|
|
80
78
|
*
|
|
@@ -82,7 +80,7 @@ declare const VERSION_SWITCHER_VISIBILITY_STYLE = "@media (min-width:64rem){.hid
|
|
|
82
80
|
* `VERSION_SWITCHER_INIT_SCRIPT` — mount it once at body-end on any
|
|
83
81
|
* page that includes a `<VersionSwitcher>`.
|
|
84
82
|
*/
|
|
85
|
-
declare function VersionSwitcher(props: VersionSwitcherProps): VNode;
|
|
83
|
+
export declare function VersionSwitcher(props: VersionSwitcherProps): VNode;
|
|
86
84
|
/**
|
|
87
85
|
* Self-contained init script for the version-switcher's interactive
|
|
88
86
|
* behavior. Mount once per page (e.g. inside the layout's body-end
|
|
@@ -99,6 +97,5 @@ declare function VersionSwitcher(props: VersionSwitcherProps): VNode;
|
|
|
99
97
|
* version-switcher; behaviour is unchanged modulo the lifecycle
|
|
100
98
|
* vocabulary swap.
|
|
101
99
|
*/
|
|
102
|
-
declare const VERSION_SWITCHER_INIT_SCRIPT: string;
|
|
103
|
-
|
|
104
|
-
export { VERSION_SWITCHER_INIT_SCRIPT, VERSION_SWITCHER_VISIBILITY_STYLE, VersionEntry, VersionSwitcher, VersionSwitcherLabels, type VersionSwitcherProps };
|
|
100
|
+
export declare const VERSION_SWITCHER_INIT_SCRIPT: string;
|
|
101
|
+
export type { VersionEntry, VersionSwitcherLabels };
|