@takazudo/zudo-doc 8.1.2 → 9.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +29 -0
- package/README.md +1 -1
- package/dist/ai-chat-modal/index.js +1 -0
- package/dist/catalog.js +1 -1
- package/dist/chrome/derive.js +2 -2
- package/dist/config.d.ts +13 -7
- package/dist/config.js +6 -0
- package/dist/footer/footer.js +1 -1
- package/dist/head-with-defaults/index.js +2 -2
- package/dist/metainfo/doc-tags.js +3 -0
- package/dist/nav-indexing/tag-nav.js +7 -1
- package/dist/preset.d.ts +10 -4
- package/dist/preset.js +11 -1
- package/dist/route-context-payload/index.d.ts +4 -1
- package/dist/route-context-payload/index.js +6 -0
- package/dist/settings-defaults.js +3 -1
- package/dist/settings.d.ts +9 -5
- package/dist/theme/theme-pack-provider.d.ts +4 -2
- package/dist/theme/theme-pack-provider.js +2 -1
- package/dist/theme-cli/config-io.js +26 -3
- package/dist/theme-cli/list.js +1 -1
- package/dist/theme-packs/default/meta.json +2 -2
- package/dist/theme-packs/drift/pack.css +50 -15
- package/dist/theme-packs/fjord/pack.css +55 -14
- package/dist/theme-packs/graphite/meta.json +37 -0
- package/dist/theme-packs/graphite/pack.css +401 -0
- package/dist/theme-packs/hollow/pack.css +51 -16
- package/dist/theme-packs/manuscript/pack.css +57 -12
- package/dist/theme-packs/matcha/pack.css +46 -13
- package/dist/theme-packs/nocturne/pack.css +46 -10
- package/dist/theme-packs/observatory/pack.css +61 -20
- package/dist/theme-packs/quiet-slate/meta.json +37 -0
- package/dist/theme-packs/quiet-slate/pack.css +401 -0
- package/dist/theme-packs/sakura/pack.css +58 -16
- package/dist/theme-packs/solar/pack.css +43 -10
- package/dist/theme-packs/warm-mineral/meta.json +37 -0
- package/dist/theme-packs/warm-mineral/pack.css +401 -0
- package/dist/theme-packs-registry/configured-theme-pack.d.ts +21 -0
- package/dist/theme-packs-registry/configured-theme-pack.js +13 -0
- package/dist/theme-packs-registry/index.d.ts +1 -0
- package/dist/theme-packs-registry/index.js +6 -0
- package/dist/theme-packs-registry/resolve-enabled-packs.d.ts +13 -6
- package/dist/theme-packs-registry/resolve-enabled-packs.js +15 -5
- package/eject/footer/footer.tsx +1 -1
- package/package.json +9 -9
|
@@ -1,21 +1,28 @@
|
|
|
1
1
|
import type { ThemePackRegistry } from "./types.js";
|
|
2
2
|
/** The subset of settings this resolver reads. */
|
|
3
3
|
export interface ResolveEnabledPacksSettings {
|
|
4
|
-
/** Active pack slug — must end up a member of the resolved list.
|
|
5
|
-
|
|
4
|
+
/** Active pack slug — must end up a member of the resolved list. Omitted
|
|
5
|
+
* means the configured default (`"graphite"`); callers that must honour
|
|
6
|
+
* the custom-scheme / fixed-scheme Classic exception normalize it first
|
|
7
|
+
* via `resolveConfiguredThemePack`. */
|
|
8
|
+
themePack?: string | null;
|
|
9
|
+
/** The resolved `colorMode`; `false` makes an omitted `themePack` Classic. */
|
|
10
|
+
colorMode?: unknown;
|
|
6
11
|
/** Explicit enabled-pack order, or `undefined` for the canonical default
|
|
7
|
-
* order (`"
|
|
12
|
+
* order (`"graphite"` first, `"default"` (Classic) second, then the rest
|
|
13
|
+
* alphabetically). */
|
|
8
14
|
themePacks?: string[];
|
|
9
15
|
}
|
|
10
16
|
/**
|
|
11
17
|
* Resolve the ENABLED, ORDERED subset of `registry` per `settings.themePacks`
|
|
12
18
|
* / `settings.themePack` (Decision 7):
|
|
13
19
|
*
|
|
14
|
-
* - `themePacks` omitted → every bundled pack
|
|
15
|
-
*
|
|
20
|
+
* - `themePacks` omitted → every bundled pack: the configured default
|
|
21
|
+
* (`"graphite"`) first, `"default"` (Classic) second, then the rest in
|
|
22
|
+
* canonical (alphabetical-by-slug) order.
|
|
16
23
|
* - `themePacks` an explicit array → authoritative: may omit `"default"`,
|
|
17
24
|
* reorder freely. Duplicate or unknown slugs throw loudly.
|
|
18
|
-
* - `themePack` (the active slug, default `"
|
|
25
|
+
* - `themePack` (the active slug, default `"graphite"`) must be a member of
|
|
19
26
|
* the resolved list — an unknown/excluded active slug throws loudly,
|
|
20
27
|
* naming the bad slug and the available ones.
|
|
21
28
|
*
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
import { DEFAULT_THEME_PACK_SLUG } from "./meta-schema.js";
|
|
2
|
+
import {
|
|
3
|
+
CONFIGURED_DEFAULT_THEME_PACK_SLUG,
|
|
4
|
+
resolveConfiguredThemePack
|
|
5
|
+
} from "./configured-theme-pack.js";
|
|
2
6
|
function resolveEnabledPacks(registry, settings) {
|
|
3
7
|
const bySlug = new Map(registry.map((entry) => [entry.slug, entry]));
|
|
4
8
|
const availableSlugs = registry.map((e) => e.slug);
|
|
5
9
|
let orderedSlugs;
|
|
6
10
|
if (settings.themePacks === void 0) {
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
11
|
+
const leading = [CONFIGURED_DEFAULT_THEME_PACK_SLUG, DEFAULT_THEME_PACK_SLUG].filter(
|
|
12
|
+
(slug) => bySlug.has(slug)
|
|
13
|
+
);
|
|
14
|
+
const rest = availableSlugs.filter((s) => !leading.includes(s)).sort();
|
|
15
|
+
orderedSlugs = [...leading, ...rest];
|
|
10
16
|
} else {
|
|
11
17
|
const requested = settings.themePacks;
|
|
12
18
|
const seen = /* @__PURE__ */ new Set();
|
|
@@ -30,10 +36,14 @@ function resolveEnabledPacks(registry, settings) {
|
|
|
30
36
|
orderedSlugs = [...requested];
|
|
31
37
|
}
|
|
32
38
|
const enabled = orderedSlugs.map((slug) => bySlug.get(slug));
|
|
33
|
-
const activeSlug =
|
|
39
|
+
const activeSlug = resolveConfiguredThemePack({
|
|
40
|
+
themePack: settings.themePack,
|
|
41
|
+
colorMode: settings.colorMode
|
|
42
|
+
});
|
|
34
43
|
if (!enabled.some((e) => e.slug === activeSlug)) {
|
|
44
|
+
const migrationHint = activeSlug === CONFIGURED_DEFAULT_THEME_PACK_SLUG && settings.themePacks !== void 0 ? ` "${CONFIGURED_DEFAULT_THEME_PACK_SLUG}" is the default pack when themePack is omitted; add it to themePacks, or set themePack explicitly to an enabled pack (themePack: "default" keeps the Classic look).` : "";
|
|
35
45
|
throw new Error(
|
|
36
|
-
`zudo-doc: settings.themePack "${activeSlug}" is not one of the enabled theme packs. Enabled packs: ${enabled.map((e) => e.slug).join(", ") || "(none)"}.`
|
|
46
|
+
`zudo-doc: settings.themePack "${activeSlug}" is not one of the enabled theme packs. Enabled packs: ${enabled.map((e) => e.slug).join(", ") || "(none)"}.` + migrationHint
|
|
37
47
|
);
|
|
38
48
|
}
|
|
39
49
|
return enabled;
|
package/eject/footer/footer.tsx
CHANGED
|
@@ -143,7 +143,7 @@ export function Footer(props: FooterProps): Child {
|
|
|
143
143
|
class="text-caption text-muted hover:text-accent hover:underline focus-visible:text-accent focus-visible:underline"
|
|
144
144
|
>
|
|
145
145
|
#{tag}
|
|
146
|
-
<span class="opacity-60" aria-hidden="true">
|
|
146
|
+
<span data-zd-tag-count class="opacity-60" aria-hidden="true">
|
|
147
147
|
({count})
|
|
148
148
|
</span>
|
|
149
149
|
</a>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@takazudo/zudo-doc",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "9.0.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "zudo-doc framework primitives layer that sits on top of zfb's engine — sidebar, theme, TOC, breadcrumb, layouts, head injection, View Transitions, SSR-skip wrappers (per ADR-003).",
|
|
6
6
|
"license": "MIT",
|
|
@@ -753,10 +753,10 @@
|
|
|
753
753
|
"peerDependencies": {
|
|
754
754
|
"@modelcontextprotocol/sdk": "1.32.2",
|
|
755
755
|
"@takazudo/zdtp": "^0.5.2 || ^0.6.0 || ^0.7.0 || ^0.8.0",
|
|
756
|
-
"@takazudo/zfb": "^5.1.
|
|
757
|
-
"@takazudo/zfb-md-wasm": "^5.1.
|
|
758
|
-
"@takazudo/zfb-runtime": "^5.1.
|
|
759
|
-
"@takazudo/zudo-doc-history-server": "^
|
|
756
|
+
"@takazudo/zfb": "^5.1.5",
|
|
757
|
+
"@takazudo/zfb-md-wasm": "^5.1.5",
|
|
758
|
+
"@takazudo/zfb-runtime": "^5.1.5",
|
|
759
|
+
"@takazudo/zudo-doc-history-server": "^9.0.0",
|
|
760
760
|
"diff": "^8.0.0",
|
|
761
761
|
"katex": "^0.18.2 || ^0.19.0",
|
|
762
762
|
"zod": "^4.3.6"
|
|
@@ -796,9 +796,9 @@
|
|
|
796
796
|
"devDependencies": {
|
|
797
797
|
"@modelcontextprotocol/sdk": "1.32.2",
|
|
798
798
|
"@takazudo/mdx-formatter": "1.3.0",
|
|
799
|
-
"@takazudo/zfb": "5.1.
|
|
800
|
-
"@takazudo/zfb-md-wasm": "5.1.
|
|
801
|
-
"@takazudo/zfb-runtime": "5.1.
|
|
799
|
+
"@takazudo/zfb": "5.1.5",
|
|
800
|
+
"@takazudo/zfb-md-wasm": "5.1.5",
|
|
801
|
+
"@takazudo/zfb-runtime": "5.1.5",
|
|
802
802
|
"@types/fs-extra": "^11.0.4",
|
|
803
803
|
"@types/minimist": "^1.2.5",
|
|
804
804
|
"@types/node": "^25.3.5",
|
|
@@ -808,7 +808,7 @@
|
|
|
808
808
|
"typescript": "^5.0.0",
|
|
809
809
|
"vitest": "^4.1.0",
|
|
810
810
|
"zod": "^4.3.6",
|
|
811
|
-
"@takazudo/zudo-doc-history-server": "
|
|
811
|
+
"@takazudo/zudo-doc-history-server": "9.0.0"
|
|
812
812
|
},
|
|
813
813
|
"scripts": {
|
|
814
814
|
"gen:search-widget-script": "node scripts/gen-search-widget-script.mjs",
|