create-zudo-doc 3.1.0 → 3.3.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/claude-md-gen.d.ts +8 -0
- package/dist/claude-md-gen.js +43 -26
- package/dist/compose.d.ts +14 -20
- package/dist/compose.js +15 -25
- package/dist/features/body-foot-util.d.ts +8 -4
- package/dist/features/body-foot-util.js +8 -4
- package/dist/features/claude-resources.d.ts +12 -0
- package/dist/features/claude-resources.js +13 -6
- package/dist/features/design-token-panel.d.ts +0 -12
- package/dist/features/design-token-panel.js +32 -93
- package/dist/features/doc-history.d.ts +18 -3
- package/dist/features/doc-history.js +45 -60
- package/dist/features/doc-tags.d.ts +9 -13
- package/dist/features/doc-tags.js +10 -26
- package/dist/features/dynamic-page-transition.d.ts +19 -30
- package/dist/features/dynamic-page-transition.js +21 -209
- package/dist/features/footer-taglist.d.ts +1 -1
- package/dist/features/footer-taglist.js +1 -1
- package/dist/features/footer.d.ts +3 -2
- package/dist/features/footer.js +3 -2
- package/dist/features/i18n.d.ts +13 -8
- package/dist/features/i18n.js +14 -9
- package/dist/features/image-enlarge.d.ts +7 -26
- package/dist/features/image-enlarge.js +7 -26
- package/dist/features/llms-txt.d.ts +3 -5
- package/dist/features/llms-txt.js +3 -5
- package/dist/features/search.d.ts +7 -3
- package/dist/features/search.js +7 -3
- package/dist/features/sidebar-resizer.d.ts +4 -8
- package/dist/features/sidebar-resizer.js +4 -8
- package/dist/features/sidebar-toggle.d.ts +7 -7
- package/dist/features/sidebar-toggle.js +7 -7
- package/dist/features/tag-governance.d.ts +14 -7
- package/dist/features/tag-governance.js +52 -8
- package/dist/features/tauri.d.ts +13 -10
- package/dist/features/tauri.js +16 -52
- package/dist/features/versioning.d.ts +12 -24
- package/dist/features/versioning.js +13 -39
- package/dist/index.js +2 -3
- package/dist/preset.d.ts +1 -0
- package/dist/preset.js +5 -0
- package/dist/prompts.d.ts +2 -0
- package/dist/prompts.js +1 -0
- package/dist/scaffold.d.ts +13 -6
- package/dist/scaffold.js +78 -59
- package/dist/utils.d.ts +10 -0
- package/dist/utils.js +14 -0
- package/dist/zfb-config-gen.d.ts +32 -20
- package/dist/zfb-config-gen.js +400 -53
- package/package.json +2 -2
- package/templates/base/pages/docs/[[...slug]].tsx +59 -0
- package/templates/base/pages/index.tsx +6 -41
- package/templates/base/scripts/setup-doc-skill.sh +261 -0
- package/templates/base/src/styles/global.css +15 -340
- package/templates/base/tsconfig.json +3 -26
- package/templates/features/i18n/files/pages/[locale]/docs/[[...slug]].tsx +88 -0
- package/templates/features/tagGovernance/files/scripts/tags-suggest.ts +3 -1
- package/dist/settings-gen.d.ts +0 -2
- package/dist/settings-gen.js +0 -319
- package/templates/base/.htmlvalidate.json +0 -5
- package/templates/base/.zfb/doc-history-meta.json +0 -1
- package/templates/base/pages/_data.ts +0 -160
- package/templates/base/pages/lib/_body-end-islands.tsx +0 -165
- package/templates/base/pages/lib/_chrome.ts +0 -167
- package/templates/base/pages/lib/_details.tsx +0 -29
- package/templates/base/pages/lib/_doc-route-entries.ts +0 -10
- package/templates/base/pages/lib/_extract-headings.ts +0 -37
- package/templates/base/pages/lib/_frontmatter-preview-data.ts +0 -27
- package/templates/base/pages/lib/_nav-source-cache.ts +0 -100
- package/templates/base/pages/lib/_nav-source-docs.ts +0 -17
- package/templates/base/pages/lib/_preset-generator.tsx +0 -81
- package/templates/base/pages/lib/_route-context.ts +0 -32
- package/templates/base/pages/lib/_search-widget.tsx +0 -17
- package/templates/base/pages/lib/doc-page-props.ts +0 -30
- package/templates/base/pages/lib/locale-merge.ts +0 -59
- package/templates/base/scripts/run-b4push.sh +0 -102
- package/templates/base/src/components/ai-chat-modal.tsx +0 -18
- package/templates/base/src/components/content/code-group.tsx +0 -3
- package/templates/base/src/components/content/content-admonition.tsx +0 -4
- package/templates/base/src/components/desktop-sidebar-toggle.tsx +0 -15
- package/templates/base/src/components/doc-history.tsx +0 -21
- package/templates/base/src/components/image-enlarge.tsx +0 -24
- package/templates/base/src/components/preset-generator.tsx +0 -14
- package/templates/base/src/components/sidebar-toggle.tsx +0 -6
- package/templates/base/src/components/sidebar-tree.tsx +0 -6
- package/templates/base/src/config/color-scheme-utils.ts +0 -69
- package/templates/base/src/config/color-schemes.ts +0 -165
- package/templates/base/src/config/docs-schema.ts +0 -95
- package/templates/base/src/config/frontmatter-preview-defaults.ts +0 -27
- package/templates/base/src/config/frontmatter-preview-renderers.tsx +0 -46
- package/templates/base/src/config/i18n.ts +0 -239
- package/templates/base/src/config/settings-types.ts +0 -45
- package/templates/base/src/config/sidebars.ts +0 -66
- package/templates/base/src/config/tag-vocabulary-types.ts +0 -4
- package/templates/base/src/config/tag-vocabulary.ts +0 -20
- package/templates/base/src/config/z-index-tokens.ts +0 -128
- package/templates/base/src/types/docs-entry.ts +0 -28
- package/templates/base/src/types/heading.ts +0 -5
- package/templates/base/src/types/locale.ts +0 -10
- package/templates/base/src/utils/base.ts +0 -164
- package/templates/base/src/utils/docs.ts +0 -446
- package/templates/base/src/utils/git-info.ts +0 -70
- package/templates/base/src/utils/github.ts +0 -22
- package/templates/base/src/utils/nav-scope.ts +0 -34
- package/templates/base/src/utils/sidebar.ts +0 -36
- package/templates/base/src/utils/slug.ts +0 -10
- package/templates/base/src/utils/smart-break.tsx +0 -12
- package/templates/base/src/utils/tags.ts +0 -83
- package/templates/base/zfb-shim.d.ts +0 -178
- package/templates/features/bodyFootUtil/files/src/utils/github.ts +0 -22
- package/templates/features/claudeResources/files/src/integrations/claude-resources/__tests__/escape-for-mdx.test.ts +0 -42
- package/templates/features/claudeResources/files/src/integrations/claude-resources/__tests__/generate.test.ts +0 -752
- package/templates/features/claudeResources/files/src/integrations/claude-resources/escape-for-mdx.ts +0 -97
- package/templates/features/claudeResources/files/src/integrations/claude-resources/generate.ts +0 -735
- package/templates/features/designTokenPanel/files/src/components/design-token-panel-bootstrap.tsx +0 -15
- package/templates/features/designTokenPanel/files/src/config/design-token-panel-config.ts +0 -435
- package/templates/features/designTokenPanel/files/src/config/design-tokens-manifest.ts +0 -174
- package/templates/features/designTokenPanel/files/src/lib/design-token-panel-bootstrap.ts +0 -30
- package/templates/features/docHistory/files/src/components/doc-history.tsx +0 -10
- package/templates/features/docHistory/files/src/types/doc-history.ts +0 -7
- package/templates/features/dynamicPageTransition/files/src/components/client-router-bootstrap.tsx +0 -72
- package/templates/features/i18n/files/pages/[locale]/index.tsx +0 -72
- package/templates/features/imageEnlarge/files/src/components/image-enlarge.tsx +0 -11
- package/templates/features/sidebarToggle/files/src/components/desktop-sidebar-toggle.tsx +0 -6
- package/templates/features/tauri/files/src/components/find-bar.tsx +0 -122
- package/templates/features/tauri/files/src/components/find-in-page-init.tsx +0 -59
- package/templates/features/tauri/files/src/utils/find-in-page.ts +0 -175
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
// Host route context — the reconstructed RouteContext (settings + i18n + URL
|
|
2
|
-
// helpers + nav/slug helpers + identity-stable nav-source resolvers + doc-route
|
|
3
|
-
// + route enumerators), built ONCE via the public `createRouteContext`
|
|
4
|
-
// (epic Collapse Wiring Shells #2420, FACTORIES #2424).
|
|
5
|
-
//
|
|
6
|
-
// Kept SEPARATE from `_chrome.ts` so the data shells (`_nav-source-docs`
|
|
7
|
-
// / `_doc-route-entries` / `route-enumerators`) — and the unit tests that import
|
|
8
|
-
// them — depend ONLY on this lightweight module, NOT on the chrome host bindings
|
|
9
|
-
// (which pull the build-time `#doc-history-meta` alias + island components that
|
|
10
|
-
// don't resolve under vitest).
|
|
11
|
-
//
|
|
12
|
-
// The host content bridge (`stableDocs`) is injected so the docs read + nav
|
|
13
|
-
// enumeration match the project's existing `pages/*` paths() exactly (host
|
|
14
|
-
// `bridgeDocsEntries` over the `zfb/content` snapshot), not the package default.
|
|
15
|
-
|
|
16
|
-
import { createRouteContext } from "@takazudo/zudo-doc/route-context";
|
|
17
|
-
import type { ColorScheme } from "@takazudo/zudo-doc/color-scheme-utils";
|
|
18
|
-
import { settings } from "@/config/settings";
|
|
19
|
-
import { translations } from "@/config/i18n";
|
|
20
|
-
import { tagVocabulary } from "@/config/tag-vocabulary";
|
|
21
|
-
import { colorSchemes } from "@/config/color-schemes";
|
|
22
|
-
import { stableDocs } from "./_nav-source-cache";
|
|
23
|
-
|
|
24
|
-
export const routeContext = createRouteContext(
|
|
25
|
-
{
|
|
26
|
-
settings,
|
|
27
|
-
translations,
|
|
28
|
-
tagVocabulary,
|
|
29
|
-
colorSchemes: colorSchemes as unknown as Record<string, ColorScheme>,
|
|
30
|
-
},
|
|
31
|
-
{ stableDocs },
|
|
32
|
-
);
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/** @jsxRuntime automatic */
|
|
2
|
-
/** @jsxImportSource preact */
|
|
3
|
-
// Host thin-stub — see @takazudo/zudo-doc/search-widget (epic #2344, S5).
|
|
4
|
-
// Injects the host's base path and re-exports the package SearchWidget.
|
|
5
|
-
import type { JSX } from "preact";
|
|
6
|
-
import {
|
|
7
|
-
SearchWidget as PackageSearchWidget,
|
|
8
|
-
type SearchWidgetProps as PackageSearchWidgetProps,
|
|
9
|
-
} from "@takazudo/zudo-doc/search-widget";
|
|
10
|
-
import { withBase } from "@/utils/base";
|
|
11
|
-
|
|
12
|
-
export type SearchWidgetProps = Omit<PackageSearchWidgetProps, "base">;
|
|
13
|
-
|
|
14
|
-
/** Locale-aware search widget — thin host stub that injects the base path. */
|
|
15
|
-
export function SearchWidget(props: SearchWidgetProps): JSX.Element {
|
|
16
|
-
return <PackageSearchWidget {...props} base={withBase("/")} />;
|
|
17
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
// Thin stub — types moved to the package (epic #2344, S6).
|
|
2
|
-
// Re-exports the shared discriminated-union props types for all 4 doc-route
|
|
3
|
-
// pages from @takazudo/zudo-doc/doc-page-props.
|
|
4
|
-
//
|
|
5
|
-
// S5 and downstream (S7) consumers import `DocPageBaseProps`, `DocPageEntry`,
|
|
6
|
-
// `AutoIndexNode`, `DocPageEntryProps`, `DocPageAutoIndexProps` from this path
|
|
7
|
-
// unchanged — all are re-exported below.
|
|
8
|
-
|
|
9
|
-
export type {
|
|
10
|
-
DocNavNode,
|
|
11
|
-
DocPageEntry,
|
|
12
|
-
DocPageFrontmatter,
|
|
13
|
-
AutoIndexNode,
|
|
14
|
-
DocPageEntryProps,
|
|
15
|
-
DocPageAutoIndexProps,
|
|
16
|
-
DocPageBaseProps,
|
|
17
|
-
HeadingItem,
|
|
18
|
-
} from "@takazudo/zudo-doc/doc-page-props";
|
|
19
|
-
|
|
20
|
-
// Backward-compatible alias: downstream callers that import `NavNode` from
|
|
21
|
-
// this path (e.g. _doc-route-entries.ts, route-enumerators.ts) continue to
|
|
22
|
-
// resolve. `DocNavNode` is structurally identical to the host's `NavNode` from
|
|
23
|
-
// src/utils/docs.ts (same required fields, same optional fields).
|
|
24
|
-
export type { DocNavNode as NavNode } from "@takazudo/zudo-doc/doc-page-props";
|
|
25
|
-
|
|
26
|
-
// Backward-compatible alias: `BreadcrumbItem` was previously imported from
|
|
27
|
-
// @/utils/docs in some files. The package's `DocPageBaseProps` uses
|
|
28
|
-
// `BreadcrumbItem` from @takazudo/zudo-doc/breadcrumb/types — re-export it
|
|
29
|
-
// here so callers importing from this path still resolve.
|
|
30
|
-
export type { BreadcrumbItem } from "@takazudo/zudo-doc/breadcrumb";
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
// Thin stub — locale-merge moved to the package (epic #2344, S6).
|
|
2
|
-
// Re-exports the pure merge functions from @takazudo/zudo-doc/locale-merge
|
|
3
|
-
// and provides backward-compatible wrappers that inject the host singletons.
|
|
4
|
-
//
|
|
5
|
-
// `mergeLocaleDocs` is the main export: now the package function accepts an
|
|
6
|
-
// optional `isDefaultLocaleOnlyPath` injection in its options object. The host
|
|
7
|
-
// wrapper below injects the host's `isDefaultLocaleOnlyPath` automatically
|
|
8
|
-
// so all existing call sites — which pass `applyDefaultLocaleOnlyFilter: true`
|
|
9
|
-
// without explicitly passing the predicate — continue to work unchanged.
|
|
10
|
-
//
|
|
11
|
-
// `mergeCategoryMeta` is kept as a host-only helper (it wraps `loadCategoryMeta`
|
|
12
|
-
// from @/utils/docs which is a host import). The package's `nav-source-docs`
|
|
13
|
-
// factory now owns the merged-category-meta caching; this re-export is kept
|
|
14
|
-
// for any remaining host call sites.
|
|
15
|
-
|
|
16
|
-
export type {
|
|
17
|
-
MergeDocsEntry,
|
|
18
|
-
MergeLocaleDocsOptions,
|
|
19
|
-
MergeLocaleDocsResult,
|
|
20
|
-
} from "@takazudo/zudo-doc/locale-merge";
|
|
21
|
-
import { mergeLocaleDocs as _mergeLocaleDocs } from "@takazudo/zudo-doc/locale-merge";
|
|
22
|
-
import type { MergeLocaleDocsOptions, MergeLocaleDocsResult, MergeDocsEntry } from "@takazudo/zudo-doc/locale-merge";
|
|
23
|
-
import { isDefaultLocaleOnlyPath } from "@/utils/base";
|
|
24
|
-
import { loadCategoryMeta } from "@/utils/docs";
|
|
25
|
-
import type { CategoryMeta } from "@/utils/docs";
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Merge locale docs with base-locale fallbacks.
|
|
29
|
-
*
|
|
30
|
-
* Thin host wrapper around the package's `mergeLocaleDocs` that injects
|
|
31
|
-
* `isDefaultLocaleOnlyPath` from `@/utils/base` automatically. Existing call
|
|
32
|
-
* sites that pass `applyDefaultLocaleOnlyFilter: true` continue to work
|
|
33
|
-
* without change — the predicate is now injected rather than module-imported.
|
|
34
|
-
*/
|
|
35
|
-
export function mergeLocaleDocs<T extends MergeDocsEntry = MergeDocsEntry>(
|
|
36
|
-
options: Omit<MergeLocaleDocsOptions<T>, "isDefaultLocaleOnlyPath">,
|
|
37
|
-
): MergeLocaleDocsResult<T> {
|
|
38
|
-
return _mergeLocaleDocs({
|
|
39
|
-
...options,
|
|
40
|
-
isDefaultLocaleOnlyPath,
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* Merge category metadata for a locale: base metadata first, locale overrides
|
|
46
|
-
* win on overlapping keys.
|
|
47
|
-
*
|
|
48
|
-
* This matches the category-meta merge order used in route enumerators,
|
|
49
|
-
* nav helpers, and page paths() sections.
|
|
50
|
-
*/
|
|
51
|
-
export function mergeCategoryMeta(
|
|
52
|
-
baseDir: string,
|
|
53
|
-
localeDir: string,
|
|
54
|
-
): Map<string, CategoryMeta> {
|
|
55
|
-
return new Map<string, CategoryMeta>([
|
|
56
|
-
...loadCategoryMeta(baseDir),
|
|
57
|
-
...loadCategoryMeta(localeDir),
|
|
58
|
-
]);
|
|
59
|
-
}
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
set -euo pipefail
|
|
3
|
-
|
|
4
|
-
# b4push — local quality gate run before pushing.
|
|
5
|
-
#
|
|
6
|
-
# Step order (cheap → expensive):
|
|
7
|
-
# 1. Type checking (zfb check)
|
|
8
|
-
# 2. Build (zfb build)
|
|
9
|
-
# 3. HTML validation (html-validate dist/**/*.html)
|
|
10
|
-
# 4. Manual interactive smoke (operator-driven)
|
|
11
|
-
#
|
|
12
|
-
# Env overrides for non-interactive use:
|
|
13
|
-
# B4PUSH_SKIP_HTML_VALIDATE=1 — skip HTML validation (step 3)
|
|
14
|
-
# B4PUSH_SKIP_MANUAL_SMOKE=1 — skip the manual interactive smoke
|
|
15
|
-
|
|
16
|
-
START_TIME=$(date +%s)
|
|
17
|
-
FAILURES=()
|
|
18
|
-
TOTAL_STEPS=4
|
|
19
|
-
CURRENT_STEP=0
|
|
20
|
-
|
|
21
|
-
step() {
|
|
22
|
-
CURRENT_STEP=$((CURRENT_STEP + 1))
|
|
23
|
-
echo ""
|
|
24
|
-
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
25
|
-
echo "▶ Step $CURRENT_STEP/$TOTAL_STEPS: $1"
|
|
26
|
-
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
pass() { echo "✅ $1"; }
|
|
30
|
-
fail() { echo "❌ $1"; FAILURES+=("$1"); }
|
|
31
|
-
skip() { echo "⏭ $1 (skipped)"; }
|
|
32
|
-
|
|
33
|
-
ROOT_DIR="$(cd "$(dirname "$0")/.." && pwd)"
|
|
34
|
-
|
|
35
|
-
# ── Step 1: Type checking ─────────────────────────────
|
|
36
|
-
step "Type checking (zfb check)"
|
|
37
|
-
if (cd "$ROOT_DIR" && pnpm check); then
|
|
38
|
-
pass "Type checking passed"
|
|
39
|
-
else
|
|
40
|
-
fail "Type checking"
|
|
41
|
-
fi
|
|
42
|
-
|
|
43
|
-
# ── Step 2: Build ─────────────────────────────────────
|
|
44
|
-
step "Build (zfb build)"
|
|
45
|
-
if (cd "$ROOT_DIR" && pnpm build); then
|
|
46
|
-
pass "Build passed"
|
|
47
|
-
else
|
|
48
|
-
fail "Build"
|
|
49
|
-
fi
|
|
50
|
-
|
|
51
|
-
# ── Step 3: HTML validation ───────────────────────────
|
|
52
|
-
step "HTML validation (html-validate)"
|
|
53
|
-
if [[ "${B4PUSH_SKIP_HTML_VALIDATE:-}" == "1" ]]; then
|
|
54
|
-
skip "HTML validation (B4PUSH_SKIP_HTML_VALIDATE=1)"
|
|
55
|
-
else
|
|
56
|
-
if (cd "$ROOT_DIR" && pnpm check:html); then
|
|
57
|
-
pass "HTML validation passed"
|
|
58
|
-
else
|
|
59
|
-
fail "HTML validation"
|
|
60
|
-
fi
|
|
61
|
-
fi
|
|
62
|
-
|
|
63
|
-
# ── Step 4: Manual interactive smoke ─────────────────
|
|
64
|
-
step "Manual interactive smoke"
|
|
65
|
-
if [[ "${B4PUSH_SKIP_MANUAL_SMOKE:-}" == "1" ]]; then
|
|
66
|
-
skip "Manual smoke (B4PUSH_SKIP_MANUAL_SMOKE=1)"
|
|
67
|
-
else
|
|
68
|
-
cat <<'MANUAL'
|
|
69
|
-
Run `pnpm preview` in another terminal and exercise:
|
|
70
|
-
• theme toggle (light/dark)
|
|
71
|
-
• mobile menu (narrow viewport)
|
|
72
|
-
• search dropdown (header search)
|
|
73
|
-
• code-block syntax highlighting
|
|
74
|
-
|
|
75
|
-
Press [Enter] when all flows look healthy, or Ctrl-C to abort.
|
|
76
|
-
MANUAL
|
|
77
|
-
if read -r _; then
|
|
78
|
-
pass "Manual smoke acknowledged"
|
|
79
|
-
else
|
|
80
|
-
fail "Manual smoke (aborted)"
|
|
81
|
-
fi
|
|
82
|
-
fi
|
|
83
|
-
|
|
84
|
-
# ── Summary ──────────────────────────────────────────
|
|
85
|
-
END_TIME=$(date +%s)
|
|
86
|
-
DURATION=$((END_TIME - START_TIME))
|
|
87
|
-
|
|
88
|
-
echo ""
|
|
89
|
-
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
90
|
-
echo " SUMMARY (${DURATION}s)"
|
|
91
|
-
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
92
|
-
|
|
93
|
-
if [ ${#FAILURES[@]} -eq 0 ]; then
|
|
94
|
-
echo "✅ All $TOTAL_STEPS checks passed (or skipped). Safe to push."
|
|
95
|
-
exit 0
|
|
96
|
-
else
|
|
97
|
-
echo "❌ ${#FAILURES[@]} check(s) failed:"
|
|
98
|
-
for f in "${FAILURES[@]}"; do
|
|
99
|
-
echo " - $f"
|
|
100
|
-
done
|
|
101
|
-
exit 1
|
|
102
|
-
fi
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
// W6A stub — no-op default + AiChatModal named exports.
|
|
2
|
-
//
|
|
3
|
-
// The AiChatModal island now ships from the package
|
|
4
|
-
// (`@takazudo/zudo-doc/ai-chat-modal`); the unconditional
|
|
5
|
-
// `pages/lib/_body-end-islands.tsx` imports it directly from there. This
|
|
6
|
-
// stub exists only so any project-local code that references the
|
|
7
|
-
// `@/components/ai-chat-modal` path still resolves — it renders nothing.
|
|
8
|
-
// Replace this file to wire a project-specific modal.
|
|
9
|
-
import type { JSX } from "preact";
|
|
10
|
-
|
|
11
|
-
function AiChatModal(): JSX.Element | null {
|
|
12
|
-
return null;
|
|
13
|
-
}
|
|
14
|
-
AiChatModal.displayName = "AiChatModal";
|
|
15
|
-
|
|
16
|
-
export default AiChatModal;
|
|
17
|
-
|
|
18
|
-
export { AiChatModal };
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
// Re-export from the shared package — moved to @takazudo/zudo-doc/content-admonition
|
|
2
|
-
// as part of the package-first migration (epic #2321, S4 #2327).
|
|
3
|
-
export type { AdmonitionVariant, AdmonitionProps } from "@takazudo/zudo-doc/content-admonition";
|
|
4
|
-
export { makeAdmonition } from "@takazudo/zudo-doc/content-admonition";
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
// W6A stub — no-op default export.
|
|
2
|
-
//
|
|
3
|
-
// When the sidebarToggle feature is enabled, the feature template
|
|
4
|
-
// overwrites this file with the real desktop sidebar-toggle island.
|
|
5
|
-
// Generated projects without the feature ship the no-op so the
|
|
6
|
-
// unconditional `pages/lib/_body-end-islands` (or sidebar wrapper)
|
|
7
|
-
// import resolves at typecheck time.
|
|
8
|
-
import type { JSX } from "preact";
|
|
9
|
-
|
|
10
|
-
function DesktopSidebarToggle(): JSX.Element | null {
|
|
11
|
-
return null;
|
|
12
|
-
}
|
|
13
|
-
DesktopSidebarToggle.displayName = "DesktopSidebarToggle";
|
|
14
|
-
|
|
15
|
-
export default DesktopSidebarToggle;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
// W6A stub — no-op default + DocHistory named exports.
|
|
2
|
-
//
|
|
3
|
-
// The real DocHistory island now ships from the package
|
|
4
|
-
// (`@takazudo/zudo-doc/doc-history`); the unconditional
|
|
5
|
-
// `pages/lib/_doc-history-area.tsx` imports it directly from there. When
|
|
6
|
-
// the docHistory feature is enabled the feature template overwrites this
|
|
7
|
-
// file with a re-export shim pointing at the package island. Generated
|
|
8
|
-
// projects without the feature ship this no-op so any project-local code
|
|
9
|
-
// that references the `@/components/doc-history` path still resolves. The
|
|
10
|
-
// host module exposes `DocHistory` as a named export, so the stub mirrors
|
|
11
|
-
// both the default and named shapes to keep the import surface stable.
|
|
12
|
-
import type { JSX } from "preact";
|
|
13
|
-
|
|
14
|
-
function DocHistoryComponent(): JSX.Element | null {
|
|
15
|
-
return null;
|
|
16
|
-
}
|
|
17
|
-
DocHistoryComponent.displayName = "DocHistory";
|
|
18
|
-
|
|
19
|
-
export default DocHistoryComponent;
|
|
20
|
-
|
|
21
|
-
export const DocHistory = DocHistoryComponent;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
// W6A stub — no-op default + ImageEnlarge / ImageEnlargeSsrFallback exports.
|
|
2
|
-
//
|
|
3
|
-
// The real ImageEnlarge island and its SSR fallback now ship from the
|
|
4
|
-
// package (`@takazudo/zudo-doc/image-enlarge`); the unconditional
|
|
5
|
-
// `pages/lib/_body-end-islands.tsx` imports them directly from there. When
|
|
6
|
-
// the imageEnlarge feature is enabled the feature template overwrites this
|
|
7
|
-
// file with a re-export shim pointing at the package island. Generated
|
|
8
|
-
// projects without the feature ship this no-op so any project-local code
|
|
9
|
-
// that references the `@/components/image-enlarge` path still resolves (the
|
|
10
|
-
// body-end renderer references both the default and the SSR fallback).
|
|
11
|
-
import type { JSX } from "preact";
|
|
12
|
-
|
|
13
|
-
function ImageEnlarge(): JSX.Element | null {
|
|
14
|
-
return null;
|
|
15
|
-
}
|
|
16
|
-
ImageEnlarge.displayName = "ImageEnlarge";
|
|
17
|
-
|
|
18
|
-
export default ImageEnlarge;
|
|
19
|
-
|
|
20
|
-
export { ImageEnlarge };
|
|
21
|
-
|
|
22
|
-
export function ImageEnlargeSsrFallback(): JSX.Element | null {
|
|
23
|
-
return null;
|
|
24
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
// W6A stub — no-op default export.
|
|
2
|
-
//
|
|
3
|
-
// The host (zudo-doc showcase) ships an interactive preset-generator
|
|
4
|
-
// island used by its onboarding pages. Generated downstream projects
|
|
5
|
-
// ship the no-op so unconditional page imports (`pages/lib/_preset-generator`)
|
|
6
|
-
// resolve. Wire a real implementation by replacing this file.
|
|
7
|
-
import type { JSX } from "preact";
|
|
8
|
-
|
|
9
|
-
function PresetGenerator(): JSX.Element | null {
|
|
10
|
-
return null;
|
|
11
|
-
}
|
|
12
|
-
PresetGenerator.displayName = "PresetGenerator";
|
|
13
|
-
|
|
14
|
-
export default PresetGenerator;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
// Thin re-export shim. SidebarToggle moved into the package
|
|
2
|
-
// (`@takazudo/zudo-doc/sidebar-toggle-island`) as part of the package-first
|
|
3
|
-
// migration (#2344, S2). Host code using `@/components/sidebar-toggle`
|
|
4
|
-
// still resolves correctly; the implementation lives in the package.
|
|
5
|
-
export { SidebarToggle } from "@takazudo/zudo-doc/sidebar-toggle-island";
|
|
6
|
-
export type { SidebarToggleProps } from "@takazudo/zudo-doc/sidebar-toggle-island";
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
// Thin re-export shim. SidebarTree moved into the package
|
|
2
|
-
// (`@takazudo/zudo-doc/sidebar-tree-island`) as part of the package-first
|
|
3
|
-
// migration (#2344, S2). Host code using `@/components/sidebar-tree`
|
|
4
|
-
// still resolves correctly; the implementation lives in the package.
|
|
5
|
-
export { SidebarTree } from "@takazudo/zudo-doc/sidebar-tree-island";
|
|
6
|
-
export type { SidebarTreeProps } from "@takazudo/zudo-doc/sidebar-tree-island";
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Project-side color-scheme helpers.
|
|
3
|
-
*
|
|
4
|
-
* The MECHANISM (ramp→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 (ramp values,
|
|
8
|
-
* scheme names) stays in `./color-schemes` and `./settings`.
|
|
9
|
-
*
|
|
10
|
-
* S9a package-first migration — zudolab/zudo-doc#2333.
|
|
11
|
-
* Ramp-native rewrite — zudolab/zudo-doc#2585/#2586.
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
export {
|
|
15
|
-
type OKLCH,
|
|
16
|
-
type StateRole,
|
|
17
|
-
type SemanticKey,
|
|
18
|
-
type RampRef,
|
|
19
|
-
type Ramps,
|
|
20
|
-
type ModeMap,
|
|
21
|
-
type ColorScheme,
|
|
22
|
-
type CssEmitScope,
|
|
23
|
-
STATE_ROLES,
|
|
24
|
-
SEMANTIC_KEYS,
|
|
25
|
-
SEMANTIC_RAMP_DEFAULTS,
|
|
26
|
-
SEMANTIC_CSS_NAMES,
|
|
27
|
-
resolveRampRef,
|
|
28
|
-
resolveSemanticColors,
|
|
29
|
-
schemeToCssPairs,
|
|
30
|
-
generateCssCustomProperties as generateCssCustomPropertiesFromScheme,
|
|
31
|
-
generateLightDarkCssProperties as generateLightDarkCssPropertiesFromSchemes,
|
|
32
|
-
} from "@takazudo/zudo-doc/color-scheme-utils";
|
|
33
|
-
import {
|
|
34
|
-
generateCssCustomProperties as _generateCssCustomProperties,
|
|
35
|
-
generateLightDarkCssProperties as _generateLightDarkCssProperties,
|
|
36
|
-
} from "@takazudo/zudo-doc/color-scheme-utils";
|
|
37
|
-
|
|
38
|
-
import { colorSchemes } from "./color-schemes";
|
|
39
|
-
import { settings } from "./settings";
|
|
40
|
-
|
|
41
|
-
export const lightDarkPairings = [
|
|
42
|
-
{ light: "Default Light", dark: "Default Dark", label: "Default" },
|
|
43
|
-
];
|
|
44
|
-
|
|
45
|
-
export function getActiveScheme() {
|
|
46
|
-
const scheme = colorSchemes[settings.colorScheme];
|
|
47
|
-
if (!scheme) {
|
|
48
|
-
throw new Error(`Unknown color scheme: "${settings.colorScheme}". Available: ${Object.keys(colorSchemes).join(", ")}`);
|
|
49
|
-
}
|
|
50
|
-
return scheme;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
/** Generate `:root { --zd-* }` CSS for the project's active single scheme. */
|
|
54
|
-
export function generateCssCustomProperties(): string {
|
|
55
|
-
return _generateCssCustomProperties(getActiveScheme());
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
/** Generate `:root { --zd-*: light-dark(…) }` CSS for the project's configured light/dark pair. */
|
|
59
|
-
export function generateLightDarkCssProperties(): string {
|
|
60
|
-
if (!settings.colorMode) {
|
|
61
|
-
throw new Error("colorMode is not configured");
|
|
62
|
-
}
|
|
63
|
-
const { lightScheme, darkScheme } = settings.colorMode;
|
|
64
|
-
const light = colorSchemes[lightScheme];
|
|
65
|
-
const dark = colorSchemes[darkScheme];
|
|
66
|
-
if (!light) throw new Error(`Unknown light scheme: "${lightScheme}"`);
|
|
67
|
-
if (!dark) throw new Error(`Unknown dark scheme: "${darkScheme}"`);
|
|
68
|
-
return _generateLightDarkCssProperties(light, dark);
|
|
69
|
-
}
|
|
@@ -1,165 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Ramp-native color schemes (Color Ramp Restructure — zudolab/zudo-doc#2584;
|
|
3
|
-
* minimize pass #2601 / #2602).
|
|
4
|
-
*
|
|
5
|
-
* A `ColorScheme` is `{ ramps, map }` (the MECHANISM types live in the package
|
|
6
|
-
* and are re-exported by `./color-scheme-utils`):
|
|
7
|
-
* - `ramps` — the shared Tier-1 source of truth: a warm-neutral `base` ramp
|
|
8
|
-
* (5 stops, index 0 = lightest), an `accent` ramp (3 stops), and 4 `state`
|
|
9
|
-
* colors. Light and dark modes SHARE these values.
|
|
10
|
-
* - `map` — the per-mode Tier-2 wiring: which ramp stop (or literal OKLCH)
|
|
11
|
-
* each UI role points at.
|
|
12
|
-
*
|
|
13
|
-
* The palette was minimized from base=12 / accent=7 to **base=5 / accent=3**
|
|
14
|
-
* (#2602): the ramp-native engine is length-agnostic, so this is a DATA change.
|
|
15
|
-
* Semantic roles are aggressively merged onto shared stops to keep the number of
|
|
16
|
-
* distinct tones small — most notably `surface`, `codeBg`(light) and
|
|
17
|
-
* `chatAssistantBg` collapse onto `bg`, so header Version boxes and doc cards
|
|
18
|
-
* render as page-bg + border only (no gray fill). 5 stops leave no subtle
|
|
19
|
-
* near-white, so light-mode elevated fills are border-only by design.
|
|
20
|
-
*
|
|
21
|
-
* `ColorScheme` is re-exported here so the many sites that still
|
|
22
|
-
* `import { ColorScheme } from "./color-schemes"` (contrast tooling,
|
|
23
|
-
* zfb.config.ts, …) keep resolving until their own waves port them.
|
|
24
|
-
*/
|
|
25
|
-
|
|
26
|
-
import type { ColorScheme, Ramps, ModeMap } from "./color-scheme-utils";
|
|
27
|
-
|
|
28
|
-
export type { ColorScheme } from "./color-scheme-utils";
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Shared Tier-1 ramps — identical across Default Light and Default Dark.
|
|
32
|
-
* Minimized to 5 base / 3 accent (#2602). The warm-neutral spine keeps hue 65;
|
|
33
|
-
* the accent stops are the three tuned orange stops carried over from the 7-stop
|
|
34
|
-
* ramp (old accent2/3/6, re-indexed). Index 0 = lightest.
|
|
35
|
-
*/
|
|
36
|
-
const ramps: Ramps = {
|
|
37
|
-
base: [
|
|
38
|
-
"oklch(.965 .004 65)", // 0 — lightest (light bg / dark fg)
|
|
39
|
-
"oklch(.705 .008 65)", // 1 — dark muted / light selection & mermaid fill
|
|
40
|
-
"oklch(.480 .008 65)", // 2 — light muted / dark selection & mermaid note
|
|
41
|
-
"oklch(.300 .006 65)", // 3 — dark codeBg / mermaid fill
|
|
42
|
-
"oklch(.185 .005 65)", // 4 — darkest (dark bg / light fg)
|
|
43
|
-
],
|
|
44
|
-
accent: [
|
|
45
|
-
"oklch(.755 .130 64)", // 0 — dark hover (was accent2)
|
|
46
|
-
"oklch(.700 .158 62)", // 1 — dark accent (was accent3)
|
|
47
|
-
"oklch(.470 .120 56)", // 2 — light accent (was accent6)
|
|
48
|
-
],
|
|
49
|
-
state: {
|
|
50
|
-
danger: "oklch(.640 .170 25)",
|
|
51
|
-
success: "oklch(.680 .145 145)",
|
|
52
|
-
warning: "oklch(.760 .135 82)",
|
|
53
|
-
info: "oklch(.680 .130 245)",
|
|
54
|
-
},
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* Default Dark — the authored reference scheme (epic #2584; minimized #2602).
|
|
59
|
-
* bg = darkest base stop, fg = lightest. Roles merged onto shared stops:
|
|
60
|
-
* `surface`, `chatAssistantBg`, `imageOverlayBg` all = `bg` (b4) so elevated
|
|
61
|
-
* panels are bg + border only. Per-mode AA-tuned literals: `danger`,
|
|
62
|
-
* `matchedKeyword*` (carried from #2593). Full WCAG matrix passes at
|
|
63
|
-
* threshold+0.1.
|
|
64
|
-
*/
|
|
65
|
-
const darkMap: ModeMap = {
|
|
66
|
-
bg: { base: 4 },
|
|
67
|
-
fg: { base: 0 },
|
|
68
|
-
selectionBg: { base: 2 },
|
|
69
|
-
selectionFg: { base: 0 },
|
|
70
|
-
semantic: {
|
|
71
|
-
// Merged onto bg (b4) — elevated panels read as page-bg + border, no gray fill.
|
|
72
|
-
surface: { base: 4 },
|
|
73
|
-
muted: { base: 1 },
|
|
74
|
-
accent: { accent: 1 },
|
|
75
|
-
accentHover: { accent: 0 },
|
|
76
|
-
codeBg: { base: 3 },
|
|
77
|
-
codeFg: { base: 0 },
|
|
78
|
-
success: { state: "success" },
|
|
79
|
-
// Per-mode AA-tuned literal — shared state.danger oklch(.640 .170 25) is too
|
|
80
|
-
// dark for the danger-admonition title on its 12%-tint dark bg. L .640→.655
|
|
81
|
-
// (H/C fixed) — admonition-danger at threshold+0.1; carried from #2593.
|
|
82
|
-
danger: "oklch(.655 .170 25)",
|
|
83
|
-
warning: { state: "warning" },
|
|
84
|
-
info: { state: "info" },
|
|
85
|
-
mermaidNodeBg: { base: 3 },
|
|
86
|
-
mermaidText: { base: 0 },
|
|
87
|
-
mermaidLine: { base: 1 },
|
|
88
|
-
mermaidLabelBg: { base: 3 },
|
|
89
|
-
mermaidNoteBg: { base: 2 },
|
|
90
|
-
chatUserBg: { accent: 1 },
|
|
91
|
-
chatUserText: { base: 4 },
|
|
92
|
-
// Merged onto bg (b4) — the chat assistant bubble reads as page-bg + border.
|
|
93
|
-
chatAssistantBg: { base: 4 },
|
|
94
|
-
chatAssistantText: { base: 0 },
|
|
95
|
-
imageOverlayBg: { base: 4 },
|
|
96
|
-
imageOverlayFg: { base: 0 },
|
|
97
|
-
// Search-result <mark> highlight: an amber (accent-hue) fill with dark text —
|
|
98
|
-
// the classic highlighter look, identical in both modes. Kept as literals so
|
|
99
|
-
// the amber fill is scheme-stable; matchedKeywordFg dark so text clears AA on
|
|
100
|
-
// the amber bg — matched-keyword at threshold+0.1; carried from #2593.
|
|
101
|
-
matchedKeywordBg: "oklch(.700 .158 62)",
|
|
102
|
-
matchedKeywordFg: "oklch(.300 .003 65)",
|
|
103
|
-
},
|
|
104
|
-
};
|
|
105
|
-
|
|
106
|
-
/**
|
|
107
|
-
* Default Light — the authored light-mode scheme (epic #2584; minimized #2602).
|
|
108
|
-
* Shares `ramps` with Default Dark; the `map` inverts (light bg = lightest base
|
|
109
|
-
* stop, dark fg = darkest). Roles merged onto shared stops: `surface`, `codeBg`,
|
|
110
|
-
* `chatAssistantBg` all = `bg` (b0) so elevated panels are bg + border only
|
|
111
|
-
* (the intended flat, few-tone look — 5 stops leave no subtle near-white fill).
|
|
112
|
-
* The accent/state colors — authored for a dark bg — need darker per-mode
|
|
113
|
-
* literals to clear AA on a near-white bg. Full WCAG matrix passes at
|
|
114
|
-
* threshold+0.1; ramps untouched so Default Dark is unaffected.
|
|
115
|
-
*/
|
|
116
|
-
const lightMap: ModeMap = {
|
|
117
|
-
bg: { base: 0 },
|
|
118
|
-
fg: { base: 4 },
|
|
119
|
-
selectionBg: { base: 1 },
|
|
120
|
-
selectionFg: { base: 4 },
|
|
121
|
-
semantic: {
|
|
122
|
-
// Merged onto bg (b0) — elevated panels read as page-bg + border, no gray fill.
|
|
123
|
-
surface: { base: 0 },
|
|
124
|
-
muted: { base: 2 },
|
|
125
|
-
accent: { accent: 2 },
|
|
126
|
-
// Light: per-mode literal — the accent ramp has no stop darker than accent2,
|
|
127
|
-
// so the link-hover state darkens further (hover-darkens-on-light
|
|
128
|
-
// convention). L .400, C fitted to the sRGB gamut edge at that L; carried
|
|
129
|
-
// from #2595. accent-hover-vs-bg clears threshold+0.1.
|
|
130
|
-
accentHover: "oklch(.400 .096 56)",
|
|
131
|
-
// Merged onto bg (b0) — inline/code-block fill reads as page-bg + border.
|
|
132
|
-
codeBg: { base: 0 },
|
|
133
|
-
codeFg: { base: 4 },
|
|
134
|
-
// Light: per-mode literals — the shared state colors are authored for a dark
|
|
135
|
-
// bg and are too light on the 12%-tint admonition backgrounds over a light
|
|
136
|
-
// page bg. Each darkened (H fixed; C at gamut max, clipped where noted) to
|
|
137
|
-
// clear its admonition pair at threshold+0.1; carried from #2595.
|
|
138
|
-
success: "oklch(.470 .140 145)",
|
|
139
|
-
danger: "oklch(.505 .170 25)",
|
|
140
|
-
warning: "oklch(.490 .100 82)", // C .135→.100 (gamut-clips at this L)
|
|
141
|
-
info: "oklch(.485 .122 245)",
|
|
142
|
-
mermaidNodeBg: { base: 1 },
|
|
143
|
-
mermaidText: { base: 4 },
|
|
144
|
-
mermaidLine: { base: 2 },
|
|
145
|
-
mermaidLabelBg: { base: 1 },
|
|
146
|
-
mermaidNoteBg: { base: 1 },
|
|
147
|
-
chatUserBg: { accent: 1 },
|
|
148
|
-
// Dark text on the amber user bubble (matches Default Dark).
|
|
149
|
-
chatUserText: { base: 4 },
|
|
150
|
-
// Merged onto bg (b0) — the chat assistant bubble reads as page-bg + border.
|
|
151
|
-
chatAssistantBg: { base: 0 },
|
|
152
|
-
chatAssistantText: { base: 4 },
|
|
153
|
-
imageOverlayBg: { base: 4 },
|
|
154
|
-
imageOverlayFg: { base: 0 },
|
|
155
|
-
// Search-result <mark>: amber highlighter fill with dark text — same look as
|
|
156
|
-
// Default Dark (an amber-on-white highlight reads identically in both modes).
|
|
157
|
-
matchedKeywordBg: "oklch(.700 .158 62)",
|
|
158
|
-
matchedKeywordFg: "oklch(.300 .003 65)",
|
|
159
|
-
},
|
|
160
|
-
};
|
|
161
|
-
|
|
162
|
-
export const colorSchemes: Record<string, ColorScheme> = {
|
|
163
|
-
"Default Light": { ramps, map: lightMap },
|
|
164
|
-
"Default Dark": { ramps, map: darkMap },
|
|
165
|
-
};
|