create-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/dist/compose.d.ts +6 -3
- package/dist/compose.js +6 -4
- package/dist/features/image-enlarge.d.ts +22 -12
- package/dist/features/image-enlarge.js +23 -191
- package/dist/scaffold.d.ts +11 -0
- package/dist/scaffold.js +51 -24
- package/dist/settings-gen.js +4 -0
- package/dist/zfb-config-gen.d.ts +16 -10
- package/dist/zfb-config-gen.js +34 -239
- package/package.json +1 -1
- package/templates/base/pages/_mdx-components.ts +64 -185
- package/templates/base/pages/index.tsx +1 -1
- package/templates/base/pages/lib/_body-end-islands.tsx +6 -13
- package/templates/base/pages/lib/_category-nav.tsx +30 -115
- package/templates/base/pages/lib/_category-tree-nav.tsx +38 -65
- package/templates/base/pages/lib/_compose-meta-title.ts +2 -6
- package/templates/base/pages/lib/_doc-body-end.tsx +3 -35
- package/templates/base/pages/lib/_doc-content-header.tsx +10 -111
- package/templates/base/pages/lib/_doc-history-area.tsx +19 -211
- package/templates/base/pages/lib/_doc-metainfo-area.tsx +10 -113
- package/templates/base/pages/lib/_doc-page-renderer.tsx +22 -183
- package/templates/base/pages/lib/_doc-page-shell.tsx +17 -251
- package/templates/base/pages/lib/_doc-pager.tsx +4 -74
- package/templates/base/pages/lib/_doc-route-entries.ts +43 -177
- package/templates/base/pages/lib/_doc-route-paths.ts +16 -101
- package/templates/base/pages/lib/_doc-tags-area.tsx +14 -77
- package/templates/base/pages/lib/_extract-headings.ts +21 -295
- package/templates/base/pages/lib/_footer-with-defaults.tsx +37 -225
- package/templates/base/pages/lib/_frontmatter-preview-data.ts +5 -31
- package/templates/base/pages/lib/_head-with-defaults.tsx +13 -138
- package/templates/base/pages/lib/_header-with-defaults.tsx +24 -324
- package/templates/base/pages/lib/_inline-version-switcher.tsx +16 -78
- package/templates/base/pages/lib/_math-block.tsx +4 -63
- package/templates/base/pages/lib/_nav-data-prep.ts +32 -51
- package/templates/base/pages/lib/_nav-source-cache.ts +12 -57
- package/templates/base/pages/lib/_nav-source-docs.ts +33 -233
- package/templates/base/pages/lib/_search-widget-script.ts +2 -470
- package/templates/base/pages/lib/_search-widget.tsx +9 -195
- package/templates/base/pages/lib/_sidebar-prepaint.tsx +6 -59
- package/templates/base/pages/lib/_sidebar-with-defaults.tsx +16 -118
- package/templates/base/pages/lib/_site-tree-nav.tsx +29 -80
- package/templates/base/pages/lib/doc-page-props.ts +26 -44
- package/templates/base/pages/lib/locale-merge.ts +32 -145
- package/templates/base/pages/lib/route-enumerators.ts +52 -286
- package/templates/base/src/components/ai-chat-modal.tsx +9 -8
- package/templates/base/src/components/content/code-group.tsx +3 -76
- package/templates/base/src/components/content/content-admonition.tsx +4 -56
- package/templates/base/src/components/doc-history.tsx +9 -8
- package/templates/base/src/components/image-enlarge.tsx +11 -8
- package/templates/base/src/components/sidebar-toggle.tsx +6 -170
- package/templates/base/src/components/sidebar-tree.tsx +6 -548
- package/templates/base/src/config/color-scheme-utils.ts +34 -158
- package/templates/base/src/config/i18n.ts +9 -0
- package/templates/base/src/config/settings-types.ts +34 -172
- package/templates/base/src/config/z-index-tokens.ts +5 -4
- package/templates/base/src/styles/global.css +40 -587
- package/templates/base/src/utils/base.ts +1 -1
- package/templates/base/src/utils/docs.ts +47 -16
- package/templates/base/src/utils/github.ts +12 -9
- package/templates/base/src/utils/nav-scope.ts +13 -42
- package/templates/base/src/utils/sidebar.ts +18 -86
- package/templates/base/src/utils/slug.ts +10 -53
- package/templates/base/src/utils/smart-break.tsx +12 -120
- package/templates/base/src/utils/tags.ts +25 -68
- package/templates/features/bodyFootUtil/files/src/utils/github.ts +12 -9
- package/templates/features/designTokenPanel/files/src/lib/design-token-panel-bootstrap.ts +13 -39
- package/templates/features/docHistory/files/src/components/doc-history.tsx +8 -636
- package/templates/features/docHistory/files/src/types/doc-history.ts +7 -23
- package/templates/features/docTags/files/pages/lib/_tag-pages.tsx +35 -201
- package/templates/features/i18n/files/pages/[locale]/index.tsx +1 -1
- package/templates/features/imageEnlarge/files/src/components/image-enlarge.tsx +8 -269
- package/templates/features/sidebarToggle/files/src/components/desktop-sidebar-toggle.tsx +6 -99
- package/templates/features/tagGovernance/files/scripts/tags-audit.ts +67 -515
- package/templates/features/versioning/files/pages/lib/_versions-page.tsx +21 -73
- package/templates/base/pages/404.tsx +0 -61
- package/templates/base/pages/robots.txt.tsx +0 -29
- package/templates/base/pages/sitemap.xml.tsx +0 -59
- package/templates/base/plugins/connect-adapter.mjs +0 -169
- package/templates/base/plugins/copy-public-plugin.mjs +0 -58
- package/templates/base/plugins/search-index-plugin.mjs +0 -66
- package/templates/base/scripts/gen-z-index.mjs +0 -157
- package/templates/base/src/components/mermaid-enlarge.tsx +0 -490
- package/templates/base/src/components/site-tree-nav.tsx +0 -220
- package/templates/features/claudeResources/files/plugins/claude-resources-plugin.mjs +0 -47
- package/templates/features/docHistory/files/plugins/doc-history-plugin.mjs +0 -111
- package/templates/features/docTags/files/pages/[locale]/docs/tags/[tag].tsx +0 -59
- package/templates/features/docTags/files/pages/[locale]/docs/tags/index.tsx +0 -39
- package/templates/features/docTags/files/pages/docs/tags/[tag].tsx +0 -43
- package/templates/features/docTags/files/pages/docs/tags/index.tsx +0 -20
- package/templates/features/llmsTxt/files/plugins/llms-txt-plugin.mjs +0 -93
- package/templates/features/versioning/files/pages/[locale]/docs/versions.tsx +0 -48
- package/templates/features/versioning/files/pages/docs/versions.tsx +0 -20
|
@@ -1,64 +1,39 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Project-side color-scheme helpers.
|
|
3
|
+
*
|
|
4
|
+
* The MECHANISM (palette→CSS injection logic) now lives in the package:
|
|
5
|
+
* `@takazudo/zudo-doc/color-scheme-utils`. This file re-exports those
|
|
6
|
+
* mechanism symbols and adds project-specific thin wrappers that read from
|
|
7
|
+
* this project's `colorSchemes` map and `settings`. The DATA (palette values,
|
|
8
|
+
* scheme names) stays in `./color-schemes` and `./settings`.
|
|
9
|
+
*
|
|
10
|
+
* S9a package-first migration — zudolab/zudo-doc#2333.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
export {
|
|
14
|
+
type ColorRef,
|
|
15
|
+
type ColorScheme,
|
|
16
|
+
SEMANTIC_DEFAULTS,
|
|
17
|
+
SEMANTIC_CSS_NAMES,
|
|
18
|
+
resolveColor,
|
|
19
|
+
resolveSemanticColors,
|
|
20
|
+
schemeToCssPairs,
|
|
21
|
+
generateCssCustomProperties as generateCssCustomPropertiesFromScheme,
|
|
22
|
+
generateLightDarkCssProperties as generateLightDarkCssPropertiesFromSchemes,
|
|
23
|
+
} from "@takazudo/zudo-doc/color-scheme-utils";
|
|
24
|
+
import {
|
|
25
|
+
generateCssCustomProperties as _generateCssCustomProperties,
|
|
26
|
+
generateLightDarkCssProperties as _generateLightDarkCssProperties,
|
|
27
|
+
} from "@takazudo/zudo-doc/color-scheme-utils";
|
|
28
|
+
|
|
29
|
+
import { colorSchemes } from "./color-schemes";
|
|
2
30
|
import { settings } from "./settings";
|
|
3
31
|
|
|
4
|
-
/** Default mapping: semantic token name → palette index */
|
|
5
|
-
export const SEMANTIC_DEFAULTS: Record<string, number> = {
|
|
6
|
-
surface: 0,
|
|
7
|
-
muted: 8,
|
|
8
|
-
accent: 5,
|
|
9
|
-
accentHover: 14,
|
|
10
|
-
codeBg: 10,
|
|
11
|
-
codeFg: 11,
|
|
12
|
-
success: 2,
|
|
13
|
-
danger: 1,
|
|
14
|
-
warning: 3,
|
|
15
|
-
info: 4,
|
|
16
|
-
mermaidNodeBg: 9,
|
|
17
|
-
mermaidText: 11,
|
|
18
|
-
mermaidLine: 8,
|
|
19
|
-
mermaidLabelBg: 10,
|
|
20
|
-
mermaidNoteBg: 0,
|
|
21
|
-
chatUserBg: 5,
|
|
22
|
-
chatUserText: 9,
|
|
23
|
-
chatAssistantBg: 9,
|
|
24
|
-
chatAssistantText: 11,
|
|
25
|
-
imageOverlayBg: 0,
|
|
26
|
-
imageOverlayFg: 11,
|
|
27
|
-
matchedKeywordBg: 3,
|
|
28
|
-
matchedKeywordFg: 15,
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
export const SEMANTIC_CSS_NAMES: Record<string, string> = {
|
|
32
|
-
surface: "--zd-surface",
|
|
33
|
-
muted: "--zd-muted",
|
|
34
|
-
accent: "--zd-accent",
|
|
35
|
-
accentHover: "--zd-accent-hover",
|
|
36
|
-
codeBg: "--zd-code-bg",
|
|
37
|
-
codeFg: "--zd-code-fg",
|
|
38
|
-
success: "--zd-success",
|
|
39
|
-
danger: "--zd-danger",
|
|
40
|
-
warning: "--zd-warning",
|
|
41
|
-
info: "--zd-info",
|
|
42
|
-
mermaidNodeBg: "--zd-mermaid-node-bg",
|
|
43
|
-
mermaidText: "--zd-mermaid-text",
|
|
44
|
-
mermaidLine: "--zd-mermaid-line",
|
|
45
|
-
mermaidLabelBg: "--zd-mermaid-label-bg",
|
|
46
|
-
mermaidNoteBg: "--zd-mermaid-note-bg",
|
|
47
|
-
chatUserBg: "--zd-chat-user-bg",
|
|
48
|
-
chatUserText: "--zd-chat-user-text",
|
|
49
|
-
chatAssistantBg: "--zd-chat-assistant-bg",
|
|
50
|
-
chatAssistantText: "--zd-chat-assistant-text",
|
|
51
|
-
imageOverlayBg: "--zd-image-overlay-bg",
|
|
52
|
-
imageOverlayFg: "--zd-image-overlay-fg",
|
|
53
|
-
matchedKeywordBg: "--zd-matched-keyword-bg",
|
|
54
|
-
matchedKeywordFg: "--zd-matched-keyword-fg",
|
|
55
|
-
};
|
|
56
|
-
|
|
57
32
|
export const lightDarkPairings = [
|
|
58
33
|
{ light: "Default Light", dark: "Default Dark", label: "Default" },
|
|
59
34
|
];
|
|
60
35
|
|
|
61
|
-
export function getActiveScheme()
|
|
36
|
+
export function getActiveScheme() {
|
|
62
37
|
const scheme = colorSchemes[settings.colorScheme];
|
|
63
38
|
if (!scheme) {
|
|
64
39
|
throw new Error(`Unknown color scheme: "${settings.colorScheme}". Available: ${Object.keys(colorSchemes).join(", ")}`);
|
|
@@ -66,93 +41,12 @@ export function getActiveScheme(): ColorScheme {
|
|
|
66
41
|
return scheme;
|
|
67
42
|
}
|
|
68
43
|
|
|
69
|
-
/**
|
|
70
|
-
* - number → palette[value]
|
|
71
|
-
* - string → used as-is
|
|
72
|
-
* - undefined → fallback */
|
|
73
|
-
export function resolveColor(
|
|
74
|
-
value: ColorRef | undefined,
|
|
75
|
-
palette: string[],
|
|
76
|
-
fallback: string,
|
|
77
|
-
): string {
|
|
78
|
-
if (value === undefined) return fallback;
|
|
79
|
-
if (typeof value === "number") return palette[value] ?? fallback;
|
|
80
|
-
return value;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
/** Resolve semantic colors with fallbacks to default palette slots */
|
|
84
|
-
export function resolveSemanticColors(scheme: ColorScheme) {
|
|
85
|
-
const p = scheme.palette;
|
|
86
|
-
return {
|
|
87
|
-
surface: resolveColor(scheme.semantic?.surface, p, p[0]),
|
|
88
|
-
muted: resolveColor(scheme.semantic?.muted, p, p[8]),
|
|
89
|
-
accent: resolveColor(scheme.semantic?.accent, p, p[5]),
|
|
90
|
-
accentHover: resolveColor(scheme.semantic?.accentHover, p, p[14]),
|
|
91
|
-
codeBg: resolveColor(scheme.semantic?.codeBg, p, p[10]),
|
|
92
|
-
codeFg: resolveColor(scheme.semantic?.codeFg, p, p[11]),
|
|
93
|
-
success: resolveColor(scheme.semantic?.success, p, p[2]),
|
|
94
|
-
danger: resolveColor(scheme.semantic?.danger, p, p[1]),
|
|
95
|
-
warning: resolveColor(scheme.semantic?.warning, p, p[3]),
|
|
96
|
-
info: resolveColor(scheme.semantic?.info, p, p[4]),
|
|
97
|
-
mermaidNodeBg: resolveColor(scheme.semantic?.mermaidNodeBg, p, p[9]),
|
|
98
|
-
mermaidText: resolveColor(scheme.semantic?.mermaidText, p, p[11]),
|
|
99
|
-
mermaidLine: resolveColor(scheme.semantic?.mermaidLine, p, p[8]),
|
|
100
|
-
mermaidLabelBg: resolveColor(scheme.semantic?.mermaidLabelBg, p, p[10]),
|
|
101
|
-
mermaidNoteBg: resolveColor(scheme.semantic?.mermaidNoteBg, p, p[0]),
|
|
102
|
-
chatUserBg: resolveColor(scheme.semantic?.chatUserBg, p, p[5]),
|
|
103
|
-
chatUserText: resolveColor(scheme.semantic?.chatUserText, p, p[9]),
|
|
104
|
-
chatAssistantBg: resolveColor(scheme.semantic?.chatAssistantBg, p, p[9]),
|
|
105
|
-
chatAssistantText: resolveColor(scheme.semantic?.chatAssistantText, p, p[11]),
|
|
106
|
-
imageOverlayBg: resolveColor(scheme.semantic?.imageOverlayBg, p, p[0]),
|
|
107
|
-
imageOverlayFg: resolveColor(scheme.semantic?.imageOverlayFg, p, p[11]),
|
|
108
|
-
matchedKeywordBg: resolveColor(scheme.semantic?.matchedKeywordBg, p, p[3]),
|
|
109
|
-
matchedKeywordFg: resolveColor(scheme.semantic?.matchedKeywordFg, p, p[15]),
|
|
110
|
-
};
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
export function schemeToCssPairs(scheme: ColorScheme): [string, string][] {
|
|
114
|
-
const p = scheme.palette;
|
|
115
|
-
const sem = resolveSemanticColors(scheme);
|
|
116
|
-
return [
|
|
117
|
-
["--zd-bg", resolveColor(scheme.background, p, p[0])],
|
|
118
|
-
["--zd-fg", resolveColor(scheme.foreground, p, p[15])],
|
|
119
|
-
["--zd-cursor", resolveColor(scheme.cursor, p, p[6])], // intentionally inert/vestigial: exposed in the design-token panel but no CSS rule consumes it (no caret-color wiring); mirrors shikiTheme's status
|
|
120
|
-
["--zd-sel-bg", resolveColor(scheme.selectionBg, p, resolveColor(scheme.background, p, p[0]))],
|
|
121
|
-
["--zd-sel-fg", resolveColor(scheme.selectionFg, p, resolveColor(scheme.foreground, p, p[15]))],
|
|
122
|
-
...p.map((color, i) => [`--zd-${i}`, color] as [string, string]),
|
|
123
|
-
["--zd-surface", sem.surface],
|
|
124
|
-
["--zd-muted", sem.muted],
|
|
125
|
-
["--zd-accent", sem.accent],
|
|
126
|
-
["--zd-accent-hover", sem.accentHover],
|
|
127
|
-
["--zd-code-bg", sem.codeBg],
|
|
128
|
-
["--zd-code-fg", sem.codeFg],
|
|
129
|
-
["--zd-success", sem.success],
|
|
130
|
-
["--zd-danger", sem.danger],
|
|
131
|
-
["--zd-warning", sem.warning],
|
|
132
|
-
["--zd-info", sem.info],
|
|
133
|
-
["--zd-mermaid-node-bg", sem.mermaidNodeBg],
|
|
134
|
-
["--zd-mermaid-text", sem.mermaidText],
|
|
135
|
-
["--zd-mermaid-line", sem.mermaidLine],
|
|
136
|
-
["--zd-mermaid-label-bg", sem.mermaidLabelBg],
|
|
137
|
-
["--zd-mermaid-note-bg", sem.mermaidNoteBg],
|
|
138
|
-
["--zd-chat-user-bg", sem.chatUserBg],
|
|
139
|
-
["--zd-chat-user-text", sem.chatUserText],
|
|
140
|
-
["--zd-chat-assistant-bg", sem.chatAssistantBg],
|
|
141
|
-
["--zd-chat-assistant-text", sem.chatAssistantText],
|
|
142
|
-
["--zd-image-overlay-bg", sem.imageOverlayBg],
|
|
143
|
-
["--zd-image-overlay-fg", sem.imageOverlayFg],
|
|
144
|
-
["--zd-matched-keyword-bg", sem.matchedKeywordBg],
|
|
145
|
-
["--zd-matched-keyword-fg", sem.matchedKeywordFg],
|
|
146
|
-
];
|
|
147
|
-
}
|
|
148
|
-
|
|
44
|
+
/** Generate `:root { --zd-* }` CSS for the project's active single scheme. */
|
|
149
45
|
export function generateCssCustomProperties(): string {
|
|
150
|
-
|
|
151
|
-
const pairs = schemeToCssPairs(scheme);
|
|
152
|
-
const lines = [":root {", ...pairs.map(([prop, value]) => ` ${prop}: ${value};`), "}"];
|
|
153
|
-
return lines.join("\n");
|
|
46
|
+
return _generateCssCustomProperties(getActiveScheme());
|
|
154
47
|
}
|
|
155
48
|
|
|
49
|
+
/** Generate `:root { --zd-*: light-dark(…) }` CSS for the project's configured light/dark pair. */
|
|
156
50
|
export function generateLightDarkCssProperties(): string {
|
|
157
51
|
if (!settings.colorMode) {
|
|
158
52
|
throw new Error("colorMode is not configured");
|
|
@@ -162,23 +56,5 @@ export function generateLightDarkCssProperties(): string {
|
|
|
162
56
|
const dark = colorSchemes[darkScheme];
|
|
163
57
|
if (!light) throw new Error(`Unknown light scheme: "${lightScheme}"`);
|
|
164
58
|
if (!dark) throw new Error(`Unknown dark scheme: "${darkScheme}"`);
|
|
165
|
-
|
|
166
|
-
const lightPairs = schemeToCssPairs(light);
|
|
167
|
-
const darkPairs = schemeToCssPairs(dark);
|
|
168
|
-
|
|
169
|
-
if (lightPairs.length !== darkPairs.length) {
|
|
170
|
-
throw new Error(`Light scheme has ${lightPairs.length} properties but dark scheme has ${darkPairs.length}`);
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
const lines = [":root {", " color-scheme: light dark;"];
|
|
174
|
-
for (let i = 0; i < lightPairs.length; i++) {
|
|
175
|
-
const lightPair = lightPairs[i];
|
|
176
|
-
const darkPair = darkPairs[i];
|
|
177
|
-
if (!lightPair || !darkPair) continue;
|
|
178
|
-
const [prop, lightVal] = lightPair;
|
|
179
|
-
const darkVal = darkPair[1];
|
|
180
|
-
lines.push(` ${prop}: light-dark(${lightVal}, ${darkVal});`);
|
|
181
|
-
}
|
|
182
|
-
lines.push("}");
|
|
183
|
-
return lines.join("\n");
|
|
59
|
+
return _generateLightDarkCssProperties(light, dark);
|
|
184
60
|
}
|
|
@@ -74,6 +74,9 @@ const translations: Record<string, Record<string, string>> = {
|
|
|
74
74
|
"search.placeholder": "Type to search...",
|
|
75
75
|
"search.shortcutHint": "to open search from anywhere",
|
|
76
76
|
"search.resultCount": "{count} results",
|
|
77
|
+
"search.unavailable": "Search unavailable",
|
|
78
|
+
"search.loadingIndex": "Loading search index…",
|
|
79
|
+
"search.noResults": "No results found.",
|
|
77
80
|
"code.copy": "Copy code",
|
|
78
81
|
"code.copied": "Copied!",
|
|
79
82
|
"code.wrapToggle": "Toggle word wrap",
|
|
@@ -134,6 +137,9 @@ const translations: Record<string, Record<string, string>> = {
|
|
|
134
137
|
"search.placeholder": "検索したい単語を入力",
|
|
135
138
|
"search.shortcutHint": "いつでも検索バーを開ける",
|
|
136
139
|
"search.resultCount": "{count} 件",
|
|
140
|
+
"search.unavailable": "検索を利用できません",
|
|
141
|
+
"search.loadingIndex": "検索インデックスを読み込み中…",
|
|
142
|
+
"search.noResults": "検索結果が見つかりませんでした。",
|
|
137
143
|
"code.copy": "コードをコピー",
|
|
138
144
|
"code.copied": "コピーしました!",
|
|
139
145
|
"code.wrapToggle": "折り返し切替",
|
|
@@ -194,6 +200,9 @@ const translations: Record<string, Record<string, string>> = {
|
|
|
194
200
|
"search.placeholder": "Suchbegriff eingeben...",
|
|
195
201
|
"search.shortcutHint": "Suche von überall öffnen",
|
|
196
202
|
"search.resultCount": "{count} Ergebnisse",
|
|
203
|
+
"search.unavailable": "Suche nicht verfügbar",
|
|
204
|
+
"search.loadingIndex": "Suchindex wird geladen…",
|
|
205
|
+
"search.noResults": "Keine Ergebnisse gefunden.",
|
|
197
206
|
"code.copy": "Code kopieren",
|
|
198
207
|
"code.copied": "Kopiert!",
|
|
199
208
|
"code.wrapToggle": "Zeilenumbruch umschalten",
|
|
@@ -1,181 +1,43 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
1
|
+
// Re-export most types from the shared package — moved to @takazudo/zudo-doc/settings
|
|
2
|
+
// as part of the package-first migration (epic #2321, S4 #2327).
|
|
3
|
+
// HeaderRightTriggerName and HeaderRightTriggerItem are defined locally rather than
|
|
4
|
+
// re-exported from the package because the designTokenPanel feature injects its
|
|
5
|
+
// extra trigger-name variant into HeaderRightTriggerName via the @slot anchor; the
|
|
6
|
+
// package unconditionally includes both trigger names but the base template
|
|
7
|
+
// ships only "ai-chat", and the feature overlay adds the panel trigger variant
|
|
8
|
+
// via the compose engine. HeaderRightTriggerItem references the local
|
|
9
|
+
// HeaderRightTriggerName, so it stays local too.
|
|
10
|
+
export type {
|
|
11
|
+
TagGovernanceMode,
|
|
12
|
+
TagVocabularyEntry,
|
|
13
|
+
HeaderNavChildItem,
|
|
14
|
+
HeaderNavItem,
|
|
15
|
+
HeaderRightComponentName,
|
|
16
|
+
HeaderRightComponentItem,
|
|
17
|
+
HeaderRightLinkItem,
|
|
18
|
+
HeaderRightHtmlItem,
|
|
19
|
+
HeaderRightItem,
|
|
20
|
+
BodyFootUtilAreaConfig,
|
|
21
|
+
ColorModeConfig,
|
|
22
|
+
LocaleConfig,
|
|
23
|
+
FooterLinkItem,
|
|
24
|
+
FooterLinkColumn,
|
|
25
|
+
FooterTaglistLocaleConfig,
|
|
26
|
+
FooterTaglistConfig,
|
|
27
|
+
FooterConfig,
|
|
28
|
+
HtmlPreviewConfig,
|
|
29
|
+
FrontmatterPreviewConfig,
|
|
30
|
+
TagPlacement,
|
|
31
|
+
VersionConfig,
|
|
32
|
+
MetaTagsConfig,
|
|
33
|
+
Settings,
|
|
34
|
+
} from "@takazudo/zudo-doc/settings";
|
|
18
35
|
|
|
19
36
|
// @slot:settings-types:trigger-names:start
|
|
20
37
|
export type HeaderRightTriggerName = "ai-chat";
|
|
21
38
|
// @slot:settings-types:trigger-names:end
|
|
22
39
|
|
|
23
|
-
export interface HeaderRightComponentItem {
|
|
24
|
-
type: "component";
|
|
25
|
-
component: HeaderRightComponentName;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
40
|
export interface HeaderRightTriggerItem {
|
|
29
41
|
type: "trigger";
|
|
30
42
|
trigger: HeaderRightTriggerName;
|
|
31
43
|
}
|
|
32
|
-
|
|
33
|
-
export interface HeaderRightLinkItem {
|
|
34
|
-
type: "link";
|
|
35
|
-
href: string;
|
|
36
|
-
label?: string;
|
|
37
|
-
ariaLabel?: string;
|
|
38
|
-
icon?: "github";
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export interface HeaderRightHtmlItem {
|
|
42
|
-
type: "html";
|
|
43
|
-
html: string;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export type HeaderRightItem =
|
|
47
|
-
| HeaderRightComponentItem
|
|
48
|
-
| HeaderRightTriggerItem
|
|
49
|
-
| HeaderRightLinkItem
|
|
50
|
-
| HeaderRightHtmlItem;
|
|
51
|
-
|
|
52
|
-
export interface BodyFootUtilAreaConfig {
|
|
53
|
-
docHistory?: boolean;
|
|
54
|
-
viewSourceLink?: boolean;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
export interface ColorModeConfig {
|
|
58
|
-
defaultMode: "light" | "dark";
|
|
59
|
-
lightScheme: string;
|
|
60
|
-
darkScheme: string;
|
|
61
|
-
respectPrefersColorScheme: boolean;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
export interface LocaleConfig {
|
|
65
|
-
label: string;
|
|
66
|
-
dir: string;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
export interface FooterLinkItem {
|
|
70
|
-
label: string;
|
|
71
|
-
href: string;
|
|
72
|
-
locales?: Record<string, { label: string }>;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
export interface FooterLinkColumn {
|
|
76
|
-
title: string;
|
|
77
|
-
items: FooterLinkItem[];
|
|
78
|
-
locales?: Record<string, { title: string }>;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* Per-locale overrides for the footer taglist labels.
|
|
83
|
-
*
|
|
84
|
-
* `title` — overrides `taglist.title` on this locale.
|
|
85
|
-
* `groupTitles` — per-group title overrides keyed by vocabulary `group`.
|
|
86
|
-
*/
|
|
87
|
-
export interface FooterTaglistLocaleConfig {
|
|
88
|
-
title?: string;
|
|
89
|
-
groupTitles?: Record<string, string>;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* Opt-in footer tag index.
|
|
94
|
-
*
|
|
95
|
-
* Renders one or more columns of tag links inside the existing footer grid.
|
|
96
|
-
* Off by default: when `enabled: false` (or the field is omitted entirely),
|
|
97
|
-
* the footer renders unchanged.
|
|
98
|
-
*
|
|
99
|
-
* - `groupBy: "group"` — one column per vocabulary `group`, in the order the
|
|
100
|
-
* groups first appear in `tag-vocabulary.ts`. Each column's title comes from
|
|
101
|
-
* `groupTitles[group]`, falling back to a capitalised version of the group
|
|
102
|
-
* name.
|
|
103
|
-
* - `groupBy: "flat"` — a single column titled `title` listing every tag
|
|
104
|
-
* alphabetically. This is also the fallback used when the vocabulary is
|
|
105
|
-
* inactive (`tagVocabulary: false` or `tagGovernance: "off"`).
|
|
106
|
-
*/
|
|
107
|
-
export interface FooterTaglistConfig {
|
|
108
|
-
enabled: boolean;
|
|
109
|
-
/** Column title used in flat mode (and as fallback for ungrouped tags). */
|
|
110
|
-
title?: string;
|
|
111
|
-
/** Default `"group"` when the vocabulary is active, otherwise forced to `"flat"`. */
|
|
112
|
-
groupBy?: "group" | "flat";
|
|
113
|
-
/** English (default-locale) group titles, e.g. `{ type: "By type" }`. */
|
|
114
|
-
groupTitles?: Record<string, string>;
|
|
115
|
-
/** Locale-specific overrides for `title` and `groupTitles`. */
|
|
116
|
-
locales?: Record<string, FooterTaglistLocaleConfig>;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
export interface FooterConfig {
|
|
120
|
-
links: FooterLinkColumn[];
|
|
121
|
-
/** Copyright text displayed at the bottom of the footer. HTML is supported. */
|
|
122
|
-
copyright?: string;
|
|
123
|
-
/** Opt-in footer tag index. Off by default. */
|
|
124
|
-
taglist?: FooterTaglistConfig;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
export interface HtmlPreviewConfig {
|
|
128
|
-
/** Raw HTML injected into <head> (links, meta, fonts) */
|
|
129
|
-
head?: string;
|
|
130
|
-
/** CSS injected as <style> after preflight */
|
|
131
|
-
css?: string;
|
|
132
|
-
/** JS injected as <script> before </body> */
|
|
133
|
-
js?: string;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
export interface FrontmatterPreviewConfig {
|
|
137
|
-
/**
|
|
138
|
-
* Completely replaces the default ignore list.
|
|
139
|
-
* When set, `extraIgnoreKeys` is ignored.
|
|
140
|
-
*/
|
|
141
|
-
ignoreKeys?: string[];
|
|
142
|
-
/**
|
|
143
|
-
* Additional keys to ignore on top of the defaults.
|
|
144
|
-
* Has no effect when `ignoreKeys` is also set.
|
|
145
|
-
*/
|
|
146
|
-
extraIgnoreKeys?: string[];
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
export type TagPlacement = "after-title" | "before-pager";
|
|
150
|
-
|
|
151
|
-
export type { TagGovernanceMode, TagVocabularyEntry } from "./tag-vocabulary-types";
|
|
152
|
-
|
|
153
|
-
export interface VersionConfig {
|
|
154
|
-
/** Version identifier, used in URL path (e.g., "1.0", "v1") */
|
|
155
|
-
slug: string;
|
|
156
|
-
/** Display label (e.g., "1.0.0", "Version 1") */
|
|
157
|
-
label: string;
|
|
158
|
-
/** Content directory for this version's English docs */
|
|
159
|
-
docsDir: string;
|
|
160
|
-
/** Per-locale content directories for this version */
|
|
161
|
-
locales?: Record<string, { dir: string }>;
|
|
162
|
-
/** Banner text shown on versioned pages (e.g., "unmaintained", "unreleased") */
|
|
163
|
-
banner?: "unmaintained" | "unreleased" | false;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
export interface MetaTagsConfig {
|
|
167
|
-
/** Emit <meta name="description">. Default true. */
|
|
168
|
-
description: boolean;
|
|
169
|
-
/** Emit <meta name="keywords"> with a comma-separated string. false = omit. Default false. */
|
|
170
|
-
keywords: string | false;
|
|
171
|
-
/** og:image (and twitter:image) path. false = omit. Default false. Showcase: '/img/ogp.png'. */
|
|
172
|
-
ogImage: string | false;
|
|
173
|
-
/** Emit og:site_name. Default true (preserves current og:site_name). */
|
|
174
|
-
ogSiteName: boolean;
|
|
175
|
-
/** TwitterCard type. false = omit entire twitter:card block. Default false. Showcase: 'summary_large_image'. */
|
|
176
|
-
twitterCard: "summary" | "summary_large_image" | false;
|
|
177
|
-
/** twitter:site handle (e.g. '@yourbrand'). Optional. */
|
|
178
|
-
twitterSite?: string;
|
|
179
|
-
/** twitter:creator handle. Optional. */
|
|
180
|
-
twitterCreator?: string;
|
|
181
|
-
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
// z-index design tokens — single source of truth.
|
|
2
2
|
//
|
|
3
3
|
// This file is the ONE place z-index tiers are defined. The CSS `@theme` block
|
|
4
|
-
// in `src/styles/global.css` is GENERATED from this list by
|
|
5
|
-
// `
|
|
6
|
-
// generated block. `pnpm check:z-index` re-runs the generator
|
|
7
|
-
// fails on drift, so the committed CSS can never silently
|
|
4
|
+
// in `src/styles/global.css` is GENERATED from this list by the
|
|
5
|
+
// `gen-z-index` bin from `@takazudo/zudo-doc` (run `pnpm gen:z-index`); never
|
|
6
|
+
// hand-edit the generated block. `pnpm check:z-index` re-runs the generator
|
|
7
|
+
// into a buffer and fails on drift, so the committed CSS can never silently
|
|
8
|
+
// diverge from this list.
|
|
8
9
|
//
|
|
9
10
|
// Strategy (from zudolab/zudo-css-wisdom z-index-strategy): semantic single-
|
|
10
11
|
// namespace tokens — names describe ROLES, never magnitudes. One flat ordered
|