@takazudo/zudo-sg 0.8.3 → 0.9.1

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 CHANGED
@@ -4,6 +4,52 @@ All notable changes to `@takazudo/zudo-sg` are documented in this file.
4
4
 
5
5
  The format is based on Keep a Changelog, and release notes are generated from the changelog MDX pages.
6
6
 
7
+ ## [0.9.1] - 2026-11-11
8
+
9
+ This release fixes first-paint theme packs on host pages and engine catalog
10
+ routes, and raises the zudo-doc peer floor to the published 10.0.1 patch.
11
+
12
+ ### Bug Fixes
13
+
14
+ - Host pages and engine catalog routes server-render the configured theme pack
15
+ (`data-theme-pack` plus the theme-pack bootstrap), so a first load of `/`,
16
+ `/docs/versions`, and the catalog no longer paints Classic when the host
17
+ selected another pack.
18
+
19
+ ### Other Changes
20
+
21
+ - The `@takazudo/zudo-doc` peer is now `^10.0.1` (was `^10.0.0`).
22
+ - Engine tooling moves to Vite 8.3.7, Vitest 5.1.0, and happy-dom 21.0.4.
23
+ - Remaining Dependabot and package bumps land with this release; MSW stays at
24
+ 2.15.0 so the site bundle keeps resolving.
25
+
26
+ ## [0.9.0] - 2026-11-10
27
+
28
+ This release moves the engine onto zfb 6 and zudo-doc 10. The engine's public
29
+ API is unchanged. Hosts upgrade by moving their zfb, zudo-doc, and zdtp
30
+ installs to the new peer floors.
31
+
32
+ ### Breaking Changes
33
+
34
+ - The `@takazudo/zfb` peer is now ^6.0.1 (was ^5.2.2). zfb 5 hosts are no
35
+ longer supported. zfb 6 bundles with Rolldown only, so `ZFB_BUNDLER`,
36
+ `ZFB_ROLLDOWN_PROTOTYPE`, and `ZFB_ESBUILD_BIN` must stay unset.
37
+ - The `@takazudo/zudo-doc` peer is now ^10.0.0 (was ^9.1.4). zudo-doc 9 hosts
38
+ are no longer supported. `themePack: "default"` is now an alias for
39
+ Graphite, and Classic is `themePack: "classic"`.
40
+ - The `@takazudo/zdtp` peer is now ^0.9.3 (was ^0.9.0).
41
+
42
+ ### Bug Fixes
43
+
44
+ - Token dashboards follow the active theme pack's preview colors when that
45
+ pack ships a stylesheet, so a Graphite page and its dashboards share one
46
+ background. zudo-doc 10 also scopes the preview panel mount id to the
47
+ active pack (`storagePrefix--pack`).
48
+
49
+ ### Other Changes
50
+
51
+ - The README install line and peer list follow the new floors.
52
+
7
53
  ## [0.8.3] - 2026-11-07
8
54
 
9
55
  A patch release that moves the engine's tested zudo-doc peer floor to the
package/README.md CHANGED
@@ -132,11 +132,11 @@ output as drift and never writes it.
132
132
  ## Installation
133
133
 
134
134
  ```sh
135
- pnpm add @takazudo/zudo-sg@latest @takazudo/zfb@^5.2.2 @takazudo/zfb-md-wasm@^5.2.2 @takazudo/zfb-runtime@^5.2.2 @takazudo/zudo-doc@^9.1.4 @takazudo/zdtp@^0.9.0 diff@^8.0.4 katex@^0.19.0 zod@^4.3.6
135
+ pnpm add @takazudo/zudo-sg@latest @takazudo/zfb@^6.0.1 @takazudo/zfb-md-wasm@^6.0.1 @takazudo/zfb-runtime@^6.0.1 @takazudo/zudo-doc@^10.0.1 @takazudo/zdtp@^0.9.3 diff@^8.0.4 katex@^0.19.1 zod@^4.3.6
136
136
  ```
137
137
 
138
- The engine peers are `@takazudo/zfb ^5.2.2`, `@takazudo/zudo-doc ^9.1.4`,
139
- and `@takazudo/zdtp ^0.9.0`. zfb 5 and zudo-doc 9 require Node.js 24, and
138
+ The engine peers are `@takazudo/zfb ^6.0.1`, `@takazudo/zudo-doc ^10.0.1`,
139
+ and `@takazudo/zdtp ^0.9.3`. zfb 6 and zudo-doc 10 require Node.js 24, and
140
140
  zudo-doc requires KaTeX `^0.18.2 || ^0.19.0`. The former zudo-doc 6.2.0 /
141
141
  Node.js 22 option was retired with zfb 5. `@takazudo/zdtp` is required:
142
142
  the injected `/tokens` route loads its dashboard through the engine-owned
@@ -218,7 +218,7 @@ control. Any non-empty host navigation stays authoritative; set
218
218
  `chromeDefaults: false` in the second argument to keep an intentionally empty
219
219
  header. The engine requires `packageOwnedRoutes: true` on the host (its
220
220
  routes import zudo-doc's route-context virtual modules). On the engine's zfb
221
- peer floor (5.2.2) nothing else is needed: `zfb dev` seeds its island
221
+ peer floor (6.0.1) nothing else is needed: `zfb dev` seeds its island
222
222
  scanner from the injected routes. `@takazudo/zudo-sg/islands` remains
223
223
  exported as a side-effect module that statically imports every engine
224
224
  island — importing it once from a host `pages/` file is optional and
@@ -53,6 +53,12 @@ export interface StyleguideLayoutProps {
53
53
  enableClientRouter: boolean;
54
54
  /** Mirrors the host's `settings.noindex`. */
55
55
  noindex: boolean;
56
+ /**
57
+ * Build-static `<html data-theme-pack>` value. Engine routes compute it
58
+ * with `resolveThemePackSsrSlug` and pass it through `chromeProps`.
59
+ * Omitted when the theme-pack registry was not threaded.
60
+ */
61
+ dataThemePack?: string;
56
62
  children: Child;
57
63
  }
58
- export declare function StyleguideLayout({ title, activeSlug, lang, hideSidebar, head, header, footer, bodyEnd, codePanel, contentWide, navNodes, sidebarToggle, enableClientRouter, noindex, children, }: StyleguideLayoutProps): JSX.Element;
64
+ export declare function StyleguideLayout({ title, activeSlug, lang, hideSidebar, head, header, footer, bodyEnd, codePanel, contentWide, navNodes, sidebarToggle, enableClientRouter, noindex, dataThemePack, children, }: StyleguideLayoutProps): JSX.Element;
@@ -22,6 +22,7 @@ function StyleguideLayout({
22
22
  sidebarToggle,
23
23
  enableClientRouter,
24
24
  noindex,
25
+ dataThemePack,
25
26
  children
26
27
  }) {
27
28
  const showCodePanel = Boolean(codePanel);
@@ -45,6 +46,7 @@ function StyleguideLayout({
45
46
  title,
46
47
  enableClientRouter,
47
48
  head: composedHead,
49
+ dataThemePack,
48
50
  lang,
49
51
  noindex,
50
52
  hideSidebar,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@takazudo/zudo-sg",
3
- "version": "0.8.3",
3
+ "version": "0.9.1",
4
4
  "type": "module",
5
5
  "description": "zudo-sg styleguide engine — story registry, catalog routes and preview machinery for zfb + zudo-doc hosts.",
6
6
  "license": "MIT",
@@ -152,29 +152,29 @@
152
152
  "@codemirror/lang-javascript": "^6.0.0",
153
153
  "@codemirror/language": "^6.13.1",
154
154
  "@codemirror/state": "^6.7.6",
155
- "@codemirror/view": "^6.43.14",
155
+ "@codemirror/view": "^6.43.15",
156
156
  "@lezer/highlight": "^1.2.5",
157
- "postcss": "^8.5.28"
157
+ "postcss": "^8.5.32"
158
158
  },
159
159
  "peerDependencies": {
160
- "@takazudo/zfb": "^5.2.2",
161
- "@takazudo/zdtp": "^0.9.0",
162
- "@takazudo/zudo-doc": "^9.1.4"
160
+ "@takazudo/zfb": "^6.0.1",
161
+ "@takazudo/zdtp": "^0.9.3",
162
+ "@takazudo/zudo-doc": "^10.0.1"
163
163
  },
164
164
  "devDependencies": {
165
- "@takazudo/zdtp": "0.9.0",
166
- "@takazudo/zfb": "5.2.2",
167
- "@takazudo/zudo-doc": "9.1.4",
165
+ "@takazudo/zdtp": "0.9.3",
166
+ "@takazudo/zfb": "6.0.1",
167
+ "@takazudo/zudo-doc": "10.0.1",
168
168
  "@testing-library/jest-dom": "^7.0.1",
169
169
  "@types/culori": "^4.0.1",
170
- "@types/node": "^22.20.5",
170
+ "@types/node": "^24.19.2",
171
171
  "culori": "^4.0.2",
172
- "happy-dom": "20.14.6",
173
- "tsup": "^8.5.0",
172
+ "happy-dom": "21.0.4",
173
+ "tsup": "^9.0.0",
174
174
  "@typescript/native": "npm:typescript@^7.0.2",
175
175
  "typescript": "npm:@typescript/typescript6@^6.0.2",
176
- "vite": "7.3.5",
177
- "vitest": "4.1.11"
176
+ "vite": "8.3.7",
177
+ "vitest": "5.1.0"
178
178
  },
179
179
  "scripts": {
180
180
  "build": "tsup && tsc -p tsconfig.build.json",
@@ -13,6 +13,7 @@ import { routeContext } from "virtual:zudo-doc-route-context";
13
13
  import { chromeBindings } from "virtual:zudo-doc-chrome-bindings";
14
14
  import { createRouteContext, type RouteContextPayload } from "@takazudo/zudo-doc/route-context";
15
15
  import { createChrome } from "@takazudo/zudo-doc/chrome";
16
+ import { resolveThemePackSsrSlug } from "@takazudo/zudo-doc/theme";
16
17
  import type { StyleguideLayoutProps } from "@takazudo/zudo-sg/chrome";
17
18
  import { buildNavNodes } from "@takazudo/zudo-sg/registry";
18
19
  import { ctx, withBase } from "./_context.js";
@@ -25,6 +26,14 @@ export const locale = routeCtx.defaultLocale;
25
26
  const chrome = createChrome(routeCtx, chromeBindings);
26
27
  export const { composeMetaTitle } = chrome;
27
28
 
29
+ // Same SSR slug the package doc routes stamp on `<html>`. `?? null` keeps a
30
+ // missing registry inert — the chrome unit stub omits the field, and
31
+ // `resolveThemePackSsrSlug` only treats `null` as "feature off".
32
+ export const themePackSsrSlug = resolveThemePackSsrSlug(
33
+ routeCtx.themePackRegistry ?? null,
34
+ routeCtx.settings,
35
+ );
36
+
28
37
  /** The styleguide sidebar tree, built once and shared by every engine route. */
29
38
  export const navNodes = buildNavNodes(registry, { withBase, routes: ctx.routes });
30
39
 
@@ -43,7 +52,7 @@ export interface ChromeSlotOptions {
43
52
 
44
53
  type ChromeProps = Pick<
45
54
  StyleguideLayoutProps,
46
- "title" | "lang" | "head" | "header" | "footer" | "bodyEnd" | "navNodes" | "sidebarToggle" | "enableClientRouter" | "noindex"
55
+ "title" | "lang" | "head" | "header" | "footer" | "bodyEnd" | "navNodes" | "sidebarToggle" | "enableClientRouter" | "noindex" | "dataThemePack"
47
56
  >;
48
57
 
49
58
  /** Every StyleguideLayout prop that comes from the doc chrome and the site settings. */
@@ -90,5 +99,6 @@ export function chromeProps({ pageTitle, path, extraHead, activeSlug, hideSideba
90
99
  sidebarToggle: Boolean(settings.sidebarToggle),
91
100
  enableClientRouter: Boolean(settings.dynamicPageTransition),
92
101
  noindex: Boolean(settings.noindex),
102
+ dataThemePack: themePackSsrSlug,
93
103
  };
94
104
  }
@@ -5,7 +5,9 @@
5
5
 
6
6
  import type { JSX } from "@takazudo/zfb/zudo-react/jsx-runtime";
7
7
  import { Island } from "@takazudo/zfb";
8
+ import themePackCatalog from "@takazudo/zudo-doc/catalog";
8
9
  import { resolveRampRef } from "@takazudo/zudo-doc/color-scheme-utils";
10
+ import { resolveConfiguredThemePack } from "@takazudo/zudo-doc/theme-packs-registry";
9
11
  import { tokensManifest } from "virtual:zudo-sg-tokens";
10
12
  import { StyleguideLayout } from "@takazudo/zudo-sg/chrome";
11
13
  import { TOKENS_SLUG } from "@takazudo/zudo-sg/registry";
@@ -17,11 +19,30 @@ import { ctx } from "./_context.js";
17
19
  export const frontmatter = { title: "Design Tokens" };
18
20
 
19
21
  /**
20
- * Per-mode dashboard chrome colors resolved from the site's zudo-doc color
21
- * schemes (`--zdtp-dashboard-{light,dark}-{bg,fg}`); `undefined` when the
22
- * host passed no `colorSchemes` to the zudo-doc preset.
22
+ * Per-mode dashboard chrome colors (`--zdtp-dashboard-{light,dark}-{bg,fg}`).
23
+ *
24
+ * A theme pack with a stylesheet paints the page from its own palette, so the
25
+ * dashboards follow that pack's preview swatches. Classic (and a host with no
26
+ * pack stylesheet) keeps the color-scheme ramps. `undefined` when the host
27
+ * passed no `colorSchemes` and no styled pack is active.
23
28
  */
24
29
  function buildDashboardChromeStyle(): Record<string, string> | undefined {
30
+ const slug = resolveConfiguredThemePack({
31
+ themePack: settings.themePack,
32
+ colorMode: settings.colorMode,
33
+ customColorSchemes: Boolean(routeCtx.colorSchemes),
34
+ });
35
+ const pack = themePackCatalog.packs.find((entry) => entry.slug === slug);
36
+ if (pack?.hasStylesheet) {
37
+ const { light, dark } = pack.meta.preview;
38
+ return {
39
+ "--zdtp-dashboard-light-bg": light.bg,
40
+ "--zdtp-dashboard-light-fg": light.fg,
41
+ "--zdtp-dashboard-dark-bg": dark.bg,
42
+ "--zdtp-dashboard-dark-fg": dark.fg,
43
+ };
44
+ }
45
+
25
46
  const schemes = routeCtx.colorSchemes;
26
47
  if (!schemes) return undefined;
27
48
  const entries: Array<[string, string]> = [];