@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.
Files changed (45) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/README.md +1 -1
  3. package/dist/ai-chat-modal/index.js +1 -0
  4. package/dist/catalog.js +1 -1
  5. package/dist/chrome/derive.js +2 -2
  6. package/dist/config.d.ts +13 -7
  7. package/dist/config.js +6 -0
  8. package/dist/footer/footer.js +1 -1
  9. package/dist/head-with-defaults/index.js +2 -2
  10. package/dist/metainfo/doc-tags.js +3 -0
  11. package/dist/nav-indexing/tag-nav.js +7 -1
  12. package/dist/preset.d.ts +10 -4
  13. package/dist/preset.js +11 -1
  14. package/dist/route-context-payload/index.d.ts +4 -1
  15. package/dist/route-context-payload/index.js +6 -0
  16. package/dist/settings-defaults.js +3 -1
  17. package/dist/settings.d.ts +9 -5
  18. package/dist/theme/theme-pack-provider.d.ts +4 -2
  19. package/dist/theme/theme-pack-provider.js +2 -1
  20. package/dist/theme-cli/config-io.js +26 -3
  21. package/dist/theme-cli/list.js +1 -1
  22. package/dist/theme-packs/default/meta.json +2 -2
  23. package/dist/theme-packs/drift/pack.css +50 -15
  24. package/dist/theme-packs/fjord/pack.css +55 -14
  25. package/dist/theme-packs/graphite/meta.json +37 -0
  26. package/dist/theme-packs/graphite/pack.css +401 -0
  27. package/dist/theme-packs/hollow/pack.css +51 -16
  28. package/dist/theme-packs/manuscript/pack.css +57 -12
  29. package/dist/theme-packs/matcha/pack.css +46 -13
  30. package/dist/theme-packs/nocturne/pack.css +46 -10
  31. package/dist/theme-packs/observatory/pack.css +61 -20
  32. package/dist/theme-packs/quiet-slate/meta.json +37 -0
  33. package/dist/theme-packs/quiet-slate/pack.css +401 -0
  34. package/dist/theme-packs/sakura/pack.css +58 -16
  35. package/dist/theme-packs/solar/pack.css +43 -10
  36. package/dist/theme-packs/warm-mineral/meta.json +37 -0
  37. package/dist/theme-packs/warm-mineral/pack.css +401 -0
  38. package/dist/theme-packs-registry/configured-theme-pack.d.ts +21 -0
  39. package/dist/theme-packs-registry/configured-theme-pack.js +13 -0
  40. package/dist/theme-packs-registry/index.d.ts +1 -0
  41. package/dist/theme-packs-registry/index.js +6 -0
  42. package/dist/theme-packs-registry/resolve-enabled-packs.d.ts +13 -6
  43. package/dist/theme-packs-registry/resolve-enabled-packs.js +15 -5
  44. package/eject/footer/footer.tsx +1 -1
  45. package/package.json +9 -9
@@ -11,6 +11,7 @@ import {
11
11
  THEME_PACK_STORAGE_KEY,
12
12
  buildPackCssUrl
13
13
  } from "../theme-pack-switcher/theme-pack-sync.js";
14
+ import { resolveConfiguredThemePack } from "../theme-packs-registry/configured-theme-pack.js";
14
15
  const THEME_PACK_LOADING_ATTR = "data-zd-theme-pack-loading";
15
16
  const THEME_PACK_LOAD_WATCHDOG_MS = 2e3;
16
17
  const THEME_PACK_LATCH_CSS = `html[${THEME_PACK_LOADING_ATTR}] body{visibility:hidden}`;
@@ -23,7 +24,7 @@ function themePackVersionMap(registry) {
23
24
  }
24
25
  function resolveThemePackSsrSlug(registry, settings) {
25
26
  if (registry === null) return void 0;
26
- return settings.themePack ?? DEFAULT_THEME_PACK_SLUG;
27
+ return resolveConfiguredThemePack(settings);
27
28
  }
28
29
  function buildThemePackBootstrap(configuredSlug, enabled, base) {
29
30
  const configured = JSON.stringify(configuredSlug);
@@ -1,6 +1,9 @@
1
1
  import fs from "fs-extra";
2
2
  import path from "node:path";
3
- import { DEFAULT_THEME_PACK_SLUG } from "../theme-packs-registry/index.js";
3
+ import {
4
+ CONFIGURED_DEFAULT_THEME_PACK_SLUG,
5
+ DEFAULT_THEME_PACK_SLUG
6
+ } from "../theme-packs-registry/index.js";
4
7
  import {
5
8
  ConfigSyntaxError,
6
9
  findMatchingBrace,
@@ -16,7 +19,10 @@ function resolveZfbConfigPath(cwd) {
16
19
  }
17
20
  async function detectActiveThemePack(cwd) {
18
21
  const configPath = resolveZfbConfigPath(cwd);
19
- const fallback = { slug: DEFAULT_THEME_PACK_SLUG, detected: false };
22
+ const fallback = {
23
+ slug: CONFIGURED_DEFAULT_THEME_PACK_SLUG,
24
+ detected: false
25
+ };
20
26
  if (!await fs.pathExists(configPath)) return fallback;
21
27
  let source;
22
28
  try {
@@ -33,7 +39,24 @@ async function detectActiveThemePack(cwd) {
33
39
  const members = splitTopLevelMembers(source, braceOpenIdx + 1, braceCloseIdx);
34
40
  if (members.some((m) => m.isSpread)) return fallback;
35
41
  const themePackMember = members.find((m) => m.key === "themePack");
36
- if (!themePackMember) return { slug: DEFAULT_THEME_PACK_SLUG, detected: true };
42
+ if (!themePackMember) {
43
+ const valueText = (key) => {
44
+ const member = members.find((m) => m.key === key);
45
+ if (!member) return void 0;
46
+ if (member.valueStart === null || member.valueEnd === null) return null;
47
+ return source.slice(member.valueStart, member.valueEnd).trim();
48
+ };
49
+ const colorSchemes = valueText("colorSchemes");
50
+ const colorMode = valueText("colorMode");
51
+ if (colorSchemes === null || colorMode === null) return fallback;
52
+ const customSchemes = colorSchemes !== void 0 && colorSchemes !== "undefined" && colorSchemes !== "null" && colorSchemes !== "defaultColorSchemes";
53
+ if (customSchemes || colorMode === "false") {
54
+ return { slug: DEFAULT_THEME_PACK_SLUG, detected: true };
55
+ }
56
+ const colorModeKnownNotFalse = colorMode === void 0 || colorMode === "undefined" || colorMode === "true" || colorMode.startsWith("{");
57
+ if (!colorModeKnownNotFalse) return fallback;
58
+ return { slug: CONFIGURED_DEFAULT_THEME_PACK_SLUG, detected: true };
59
+ }
37
60
  if (themePackMember.valueStart === null || themePackMember.valueEnd === null || !isPlainStringLiteralSpan(source, themePackMember.valueStart, themePackMember.valueEnd)) {
38
61
  return fallback;
39
62
  }
@@ -50,7 +50,7 @@ function formatThemeList(result) {
50
50
  } else {
51
51
  lines.push(
52
52
  pc.dim(
53
- `Active theme pack: ${activeSlug} (default \u2014 no zfb.config.ts "themePack" field found or readable)`
53
+ `Active theme pack: ${activeSlug} (assumed default \u2014 no zfb.config.ts "themePack" field found or readable)`
54
54
  )
55
55
  );
56
56
  }
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
3
  "slug": "default",
4
- "name": "Default",
5
- "description": "The stock zudo-doc look. No pack stylesheet is loaded — your project's configured color scheme and fonts render unchanged.",
4
+ "name": "Classic",
5
+ "description": "Classic — the original zudo-doc default look. No pack stylesheet is loaded — your project's configured color scheme and fonts render unchanged.",
6
6
  "mode": "dark",
7
7
  "version": "1.0.0",
8
8
  "fonts": {
@@ -307,27 +307,62 @@ html[data-theme-pack="drift"] a[data-nav-active] {
307
307
  0 0 18px -4px color-mix(in oklch, var(--zd-accent) 45%, transparent);
308
308
  }
309
309
 
310
- /* headings: quiet luminance instead of heavy rules. The h2 keeps a
311
- gradient bar but fades it into the accent glow — !important
312
- defeats the SSR-inlined `style="border-image:linear-gradient(...)"`
313
- (Decision 6.6's sole allowlisted carve-out). */
310
+ /* headings: quiet luminance plus a top-only rule hierarchy. h2 carries
311
+ a 2px accent rule, h3 a quieter 1px muted rule, h4 no rule at all.
312
+ The rules are top-anchored background gradients; border-image none
313
+ !important (Decision 6.6's sole allowlisted carve-out) keeps the
314
+ SSR-inlined `style="border-image:linear-gradient(...)"` from painting
315
+ a second bar. */
314
316
  html[data-theme-pack="drift"] .zd-content h1 {
315
317
  text-shadow: 0 0 34px color-mix(in oklch, var(--zd-accent) 32%, transparent);
316
318
  }
317
319
  html[data-theme-pack="drift"] .zd-content h2:where(:not(.zd-home-heading)):where(:not(.zd-compact-prose *)) {
318
- font-size: 1.6rem;
319
- }
320
- html[data-theme-pack="drift"] .zd-content h2 {
321
- border-top-width: 1px;
322
- border-image: linear-gradient(
323
- to right,
324
- color-mix(in oklch, var(--zd-accent) 55%, transparent),
325
- transparent 72%
326
- )
327
- 1 !important;
320
+ border-image: none !important;
321
+ border-top-width: 0;
322
+ border-bottom-width: 0;
323
+ padding-top: 1.25rem;
324
+ padding-bottom: 0;
325
+ font-size: 1.75rem;
326
+ font-weight: 600;
327
+ line-height: 1.3;
328
+ background-image: linear-gradient(
329
+ to right,
330
+ var(--zd-accent) 0%,
331
+ var(--zd-accent) 32%,
332
+ color-mix(in oklch, var(--zd-accent) 58%, transparent) 72%,
333
+ transparent 100%
334
+ );
335
+ background-size: 100% 2px;
336
+ background-repeat: no-repeat;
337
+ background-position: top left;
328
338
  }
329
339
  html[data-theme-pack="drift"] .zd-content h3:where(:not(.zd-compact-prose *)) {
330
- border-top-width: 1px;
340
+ border-image: none !important;
341
+ border-top-width: 0;
342
+ border-bottom-width: 0;
343
+ padding-top: 0.875rem;
344
+ padding-bottom: 0;
345
+ font-size: 1.375rem;
346
+ font-weight: 600;
347
+ line-height: 1.4;
348
+ background-image: linear-gradient(
349
+ to right,
350
+ color-mix(in oklch, var(--zd-muted) 42%, transparent),
351
+ color-mix(in oklch, var(--zd-muted) 22%, transparent) 40%,
352
+ transparent 76%
353
+ );
354
+ background-size: 100% 1px;
355
+ background-repeat: no-repeat;
356
+ background-position: top left;
357
+ }
358
+ html[data-theme-pack="drift"] .zd-content h4:where(:not(.zd-compact-prose *)) {
359
+ border-width: 0;
360
+ padding-top: 0;
361
+ padding-bottom: 0;
362
+ font-size: 1.2rem;
363
+ font-weight: 500;
364
+ line-height: 1.45;
365
+ background-image: none;
331
366
  }
332
367
 
333
368
  /* links: airy underline that brightens on approach */
@@ -232,21 +232,62 @@ html[data-theme-pack="fjord"] a[data-nav-active] {
232
232
  box-shadow: 0 0 16px -4px color-mix(in oklch, var(--zd-accent) 55%, transparent);
233
233
  }
234
234
 
235
- /* headings: aurora rule over every h2 instead of the default fg
236
- fade. The SSR-inlined `style="border-image:linear-gradient(...)"`
237
- is defeated with !important (Decision 6.6's sole allowlisted
238
- carve-out) — here it is REPLACED by the aurora ribbon, not
239
- removed. */
240
- html[data-theme-pack="fjord"] .zd-content h2 {
241
- border-top-width: 2px;
242
- border-image: linear-gradient(
243
- to right,
244
- light-dark(oklch(0.6 0.1 195), oklch(0.78 0.11 185)),
245
- light-dark(oklch(0.58 0.09 250), oklch(0.66 0.1 255)) 42%,
246
- transparent 88%
247
- )
248
- 1 !important;
235
+ /* headings: a top-only rule hierarchy. h2 carries the 2px aurora
236
+ ribbon (cyan into blue) instead of the default fg fade, h3 a quieter
237
+ 1px muted rule, h4 no rule. The rules are top-anchored background
238
+ gradients; border-image none !important (Decision 6.6's sole
239
+ allowlisted carve-out) keeps the SSR-inlined
240
+ `style="border-image:linear-gradient(...)"` from painting a second
241
+ bar. */
242
+ html[data-theme-pack="fjord"] .zd-content h2:where(:not(.zd-home-heading)):where(:not(.zd-compact-prose *)) {
243
+ border-image: none !important;
244
+ border-top-width: 0;
245
+ border-bottom-width: 0;
246
+ padding-top: 1.25rem;
247
+ padding-bottom: 0;
248
+ font-size: 1.75rem;
249
+ font-weight: 700;
250
+ line-height: 1.3;
251
+ background-image: linear-gradient(
252
+ to right,
253
+ light-dark(oklch(0.6 0.1 195), oklch(0.78 0.11 185)) 0%,
254
+ light-dark(oklch(0.6 0.1 195), oklch(0.78 0.11 185)) 24%,
255
+ light-dark(oklch(0.58 0.09 250), oklch(0.66 0.1 255)) 64%,
256
+ transparent 100%
257
+ );
258
+ background-size: 100% 2px;
259
+ background-repeat: no-repeat;
260
+ background-position: top left;
249
261
  }
262
+ html[data-theme-pack="fjord"] .zd-content h3:where(:not(.zd-compact-prose *)) {
263
+ border-image: none !important;
264
+ border-top-width: 0;
265
+ border-bottom-width: 0;
266
+ padding-top: 0.875rem;
267
+ padding-bottom: 0;
268
+ font-size: 1.375rem;
269
+ font-weight: 600;
270
+ line-height: 1.4;
271
+ background-image: linear-gradient(
272
+ to right,
273
+ color-mix(in oklch, var(--zd-muted) 42%, transparent),
274
+ color-mix(in oklch, var(--zd-muted) 22%, transparent) 40%,
275
+ transparent 76%
276
+ );
277
+ background-size: 100% 1px;
278
+ background-repeat: no-repeat;
279
+ background-position: top left;
280
+ }
281
+ html[data-theme-pack="fjord"] .zd-content h4:where(:not(.zd-compact-prose *)) {
282
+ border-width: 0;
283
+ padding-top: 0;
284
+ padding-bottom: 0;
285
+ font-size: 1.2rem;
286
+ font-weight: 500;
287
+ line-height: 1.45;
288
+ background-image: none;
289
+ }
290
+
250
291
  html[data-theme-pack="fjord"] .zd-content h1 {
251
292
  color: color-mix(in oklch, var(--zd-accent) 10%, var(--zd-fg));
252
293
  }
@@ -0,0 +1,37 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "slug": "graphite",
4
+ "name": "Graphite",
5
+ "description": "Soft neutral graphite — low-glare grey paper by day, deep graphite at night, one warm copper accent, quiet hairline rules. The configured default.",
6
+ "mode": "dark",
7
+ "version": "1.0.0",
8
+ "fonts": {
9
+ "sans": "System",
10
+ "mono": "System",
11
+ "loaded": []
12
+ },
13
+ "preview": {
14
+ "light": {
15
+ "bg": "#F2F3F2",
16
+ "fg": "#3A4146",
17
+ "accent": "#9A4919",
18
+ "syntax": {
19
+ "keyword": "#9A4919",
20
+ "string": "#4E6552",
21
+ "comment": "#566168",
22
+ "callable": "#4B6373"
23
+ }
24
+ },
25
+ "dark": {
26
+ "bg": "#242629",
27
+ "fg": "#D3D5D9",
28
+ "accent": "#E9AA79",
29
+ "syntax": {
30
+ "keyword": "#E9AA79",
31
+ "string": "#9DBA9A",
32
+ "comment": "#ADB2B8",
33
+ "callable": "#9DB6C5"
34
+ }
35
+ }
36
+ }
37
+ }