create-zudo-doc 0.2.18 → 0.2.19

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.
@@ -10,7 +10,12 @@ import type { FeatureModule } from "../compose.js";
10
10
  * - Wires the ClientRouterBootstrap island and the PageLoadingOverlay (pure
11
11
  * SSR) into body-end-islands — the island is now a redundant fallback;
12
12
  * PageLoadingOverlay provides the loading spinner UI.
13
- * - Injects the View-Transitions CSS + page-loading overlay CSS into global.css.
13
+ * - Injects `@import "@takazudo/zudo-doc/page-loading.css"` at the
14
+ * `@slot:global-css:imports` anchor (top of global.css, before rule blocks).
15
+ * - Injects the `--color-page-loading-overlay` token into `@theme` at the
16
+ * `@slot:global-css:theme-tokens` anchor.
17
+ * - Injects the View-Transitions CSS into global.css at
18
+ * `@slot:global-css:feature-styles`.
14
19
  *
15
20
  * Bug fix (#2265): the page-loading overlay CSS (.page-loading-overlay /
16
21
  * .page-loading-spinner / @keyframes page-loading-spin / [data-zd-nav-pending])
@@ -18,6 +23,12 @@ import type { FeatureModule } from "../compose.js";
18
23
  * the host global.css but had no corresponding injection for the template.
19
24
  * Gating this feature makes both the JS island and the CSS land together.
20
25
  *
26
+ * The page-loading CSS now ships as a package artifact
27
+ * `@takazudo/zudo-doc/page-loading.css` (Topic A, #2283) — the generator
28
+ * injects a gated `@import` instead of inline rule bodies. The
29
+ * `--color-page-loading-overlay` token is defined inline (inside `@theme`) so
30
+ * it lives alongside the other project tokens and can be overridden per-project.
31
+ *
21
32
  * The ClientRouterBootstrap component lives in
22
33
  * templates/features/dynamicPageTransition/files/src/components/ and is
23
34
  * byte-identical to the host src/components/client-router-bootstrap.tsx.
@@ -9,7 +9,12 @@
9
9
  * - Wires the ClientRouterBootstrap island and the PageLoadingOverlay (pure
10
10
  * SSR) into body-end-islands — the island is now a redundant fallback;
11
11
  * PageLoadingOverlay provides the loading spinner UI.
12
- * - Injects the View-Transitions CSS + page-loading overlay CSS into global.css.
12
+ * - Injects `@import "@takazudo/zudo-doc/page-loading.css"` at the
13
+ * `@slot:global-css:imports` anchor (top of global.css, before rule blocks).
14
+ * - Injects the `--color-page-loading-overlay` token into `@theme` at the
15
+ * `@slot:global-css:theme-tokens` anchor.
16
+ * - Injects the View-Transitions CSS into global.css at
17
+ * `@slot:global-css:feature-styles`.
13
18
  *
14
19
  * Bug fix (#2265): the page-loading overlay CSS (.page-loading-overlay /
15
20
  * .page-loading-spinner / @keyframes page-loading-spin / [data-zd-nav-pending])
@@ -17,6 +22,12 @@
17
22
  * the host global.css but had no corresponding injection for the template.
18
23
  * Gating this feature makes both the JS island and the CSS land together.
19
24
  *
25
+ * The page-loading CSS now ships as a package artifact
26
+ * `@takazudo/zudo-doc/page-loading.css` (Topic A, #2283) — the generator
27
+ * injects a gated `@import` instead of inline rule bodies. The
28
+ * `--color-page-loading-overlay` token is defined inline (inside `@theme`) so
29
+ * it lives alongside the other project tokens and can be overridden per-project.
30
+ *
20
31
  * The ClientRouterBootstrap component lives in
21
32
  * templates/features/dynamicPageTransition/files/src/components/ and is
22
33
  * byte-identical to the host src/components/client-router-bootstrap.tsx.
@@ -69,7 +80,28 @@ import { PageLoadingOverlay } from "@takazudo/zudo-doc/page-loading";`,
69
80
  </>
70
81
  ) : null}`,
71
82
  },
72
- // 4. View-Transitions CSS (chrome extraction + cross-fade + reduced motion).
83
+ // 4. Page-loading CSS import gated at the top-of-file imports anchor.
84
+ // `@import` must precede rule blocks in CSS; the `@slot:global-css:imports`
85
+ // anchor sits immediately after the content.css import line so this lands
86
+ // in a legal position. The CSS itself (overlay, spinner, keyframes) now
87
+ // ships as a package artifact `@takazudo/zudo-doc/page-loading.css`
88
+ // (see #2283 — Topic A) instead of being duplicated inline here.
89
+ {
90
+ file: "src/styles/global.css",
91
+ anchor: "/* @slot:global-css:imports */",
92
+ position: "after",
93
+ content: `@import "@takazudo/zudo-doc/page-loading.css";`,
94
+ },
95
+ // 5. `--color-page-loading-overlay` token — injected inside `@theme`.
96
+ // Defined here so each scaffolded project can override it per-project.
97
+ // Uses the same `--color-overlay` base token as the dialog backdrops.
98
+ {
99
+ file: "src/styles/global.css",
100
+ anchor: "/* @slot:global-css:theme-tokens */",
101
+ position: "after",
102
+ content: `--color-page-loading-overlay: color-mix(in oklch, var(--color-overlay) 60%, transparent);`,
103
+ },
104
+ // 6. View-Transitions CSS (chrome extraction + cross-fade + reduced motion).
73
105
  // Injected AFTER `/* @slot:global-css:feature-styles */` in global.css.
74
106
  // These rules are required for SPA page transitions via ClientRouter.
75
107
  {
@@ -178,67 +210,6 @@ import { PageLoadingOverlay } from "@takazudo/zudo-doc/page-loading";`,
178
210
  ::view-transition-new(zfb-sidebar-toggle):only-child {
179
211
  animation: none;
180
212
  }
181
- }
182
-
183
- /* Page-loading overlay CSS — moved out of PageLoadingOverlay's inline
184
- * <style> block to avoid the <style>-inside-<body> HTML5 content-model
185
- * violation flagged by html-validate (same pattern as version-switcher
186
- * fix in zudolab/zudo-doc#1505; see W2A confirm zudolab/zudo-doc#1543). */
187
- .page-loading-overlay {
188
- position: fixed;
189
- inset: 0;
190
- /* Full-screen blocking load overlay — modal tier (was a raw z-index:9999).
191
- It sits below the transient \`drag\` tier (sidebar-resizer ghost), which is
192
- fine: a full page-load overlay and an active pointer-drag never coexist. */
193
- z-index: var(--z-index-modal);
194
- display: flex;
195
- align-items: center;
196
- justify-content: center;
197
- background: color-mix(in oklch, var(--color-overlay) 60%, transparent);
198
- opacity: 0;
199
- pointer-events: none;
200
- transition: opacity 150ms ease-out;
201
- }
202
-
203
- .page-loading-overlay[data-visible] {
204
- opacity: 1;
205
- }
206
-
207
- a[data-zd-nav-pending],
208
- button[data-zd-nav-pending] {
209
- color: var(--color-accent);
210
- }
211
-
212
- .page-loading-spinner {
213
- width: 48px;
214
- height: 48px;
215
- border: 5px solid var(--color-fg, #fff);
216
- border-bottom-color: transparent;
217
- border-radius: 50%;
218
- display: inline-block;
219
- box-sizing: border-box;
220
- animation: page-loading-spin 1s linear infinite;
221
- }
222
-
223
- @media (min-width: 1024px) {
224
- .page-loading-spinner {
225
- width: 64px;
226
- height: 64px;
227
- border-width: 6px;
228
- }
229
- }
230
-
231
- @keyframes page-loading-spin {
232
- 0% { transform: rotate(0deg); }
233
- 100% { transform: rotate(360deg); }
234
- }
235
-
236
- @media (prefers-reduced-motion: reduce) {
237
- .page-loading-spinner {
238
- animation: none;
239
- border-bottom-color: var(--color-fg, #fff);
240
- opacity: 0.5;
241
- }
242
213
  }`,
243
214
  },
244
215
  ],
package/dist/scaffold.js CHANGED
@@ -340,7 +340,8 @@ export async function scaffold(choices) {
340
340
  }
341
341
  function generatePackageJson(choices) {
342
342
  // Intentionally absent from scaffolded deps:
343
- // @takazudo/zudo-doc-md-plugins — zero references in generator templates/source
343
+ // @takazudo/zudo-doc-md-plugins — private fixture/parity-test asset; not published,
344
+ // not for app import. Zero references in generator templates/source.
344
345
  const deps = {
345
346
  // zfb engine — distributed as published npm packages (the prebuilt binary
346
347
  // ships via an optionalDependency of @takazudo/zfb-<platform>); pinned to
@@ -447,11 +448,11 @@ function generatePackageJson(choices) {
447
448
  // stability, multi-valued response headers (e.g. multiple Set-Cookie),
448
449
  // supplementary-plane CJK reading-time, plus CLI/server/runtime hardening
449
450
  // and render perf passes. No consumer-facing / CLI breaking change.
450
- "@takazudo/zfb": "0.1.0-next.55",
451
- "@takazudo/zfb-runtime": "0.1.0-next.55",
451
+ "@takazudo/zfb": "0.1.0-next.57",
452
+ "@takazudo/zfb-runtime": "0.1.0-next.57",
452
453
  // zfb-adapter-cloudflare — required for any route with `prerender = false`.
453
454
  // Pinned in lockstep with @takazudo/zfb.
454
- "@takazudo/zfb-adapter-cloudflare": "0.1.0-next.55",
455
+ "@takazudo/zfb-adapter-cloudflare": "0.1.0-next.57",
455
456
  // @takazudo/zudo-doc — published from this monorepo via
456
457
  // .github/workflows/publish-zudo-doc.yml. The pin here is bumped in
457
458
  // lockstep by scripts/release-create-zudo-doc.sh whenever zudo-doc's
@@ -463,7 +464,7 @@ function generatePackageJson(choices) {
463
464
  // ties this pin to packages/zudo-doc's version, so the lockstep release
464
465
  // bumps both together; do not cut a create-zudo-doc release until the
465
466
  // matching @takazudo/zudo-doc version (with content.css) is on npm.
466
- "@takazudo/zudo-doc": "^0.2.18",
467
+ "@takazudo/zudo-doc": "^0.2.19",
467
468
  // zod — used by the generated zfb.config.ts. zfb-config-gen emits
468
469
  // `import { z } from "zod"` for the content-collection schema +
469
470
  // `z.toJSONSchema(...)` conversion. Without this dep, the consumer
@@ -517,7 +518,7 @@ function generatePackageJson(choices) {
517
518
  // @takazudo/zudo-doc/integrations/doc-history which in turn imports
518
519
  // @takazudo/zudo-doc-history-server/git-history. Without this dep the
519
520
  // plugin host fails at init with ERR_MODULE_NOT_FOUND — W8A (#1739).
520
- deps["@takazudo/zudo-doc-history-server"] = "^0.2.18";
521
+ deps["@takazudo/zudo-doc-history-server"] = "^0.2.19";
521
522
  // W7A (#1736): doc-history-plugin.mjs spawns `tsx -e <inline-script>` to
522
523
  // run the v2 runtime in a TS-aware Node subprocess; without tsx the
523
524
  // plugin's preBuild step exits with ENOENT before zfb finishes config
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-zudo-doc",
3
- "version": "0.2.18",
3
+ "version": "0.2.19",
4
4
  "description": "Create a new zudo-doc documentation site",
5
5
  "license": "MIT",
6
6
  "author": "Takeshi Takatsudo",
@@ -116,7 +116,7 @@ export function schemeToCssPairs(scheme: ColorScheme): [string, string][] {
116
116
  return [
117
117
  ["--zd-bg", resolveColor(scheme.background, p, p[0])],
118
118
  ["--zd-fg", resolveColor(scheme.foreground, p, p[15])],
119
- ["--zd-cursor", resolveColor(scheme.cursor, p, p[6])],
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
120
  ["--zd-sel-bg", resolveColor(scheme.selectionBg, p, resolveColor(scheme.background, p, p[0]))],
121
121
  ["--zd-sel-fg", resolveColor(scheme.selectionFg, p, resolveColor(scheme.foreground, p, p[15]))],
122
122
  ...p.map((color, i) => [`--zd-${i}`, color] as [string, string]),
@@ -81,8 +81,8 @@ export const colorSchemes: Record<string, ColorScheme> = {
81
81
  selectionBg: 11,
82
82
  selectionFg: 10,
83
83
  palette: [
84
- "#303030", "#dd3131", "#266538", "#a83838", // p0-3: dark surface, danger, success, warning
85
- "#3277c8", "#a35e0f", "#90a1b9", "#7a5218", // p4-7: info, accent, neutral, secondary
84
+ "#303030", "#a01515", "#1f5429", "#903030", // p0-3: dark surface, danger, success, warning — darkened for WCAG AA (#2298)
85
+ "#174fa0", "#7d470b", "#90a1b9", "#7a5218", // p4-7: info, accent, neutral, secondary — darkened for WCAG AA (#2298)
86
86
  "#6b6b6b", "#e2ddda", "#ece9e9", "#303030", // p8-11: muted, background, surface, text
87
87
  "#5b99dc", "#b89ee7", "#8590a0", "#654516", // p12-15: accent variant, decorative, hover, muted foreground
88
88
  ],
@@ -42,6 +42,7 @@
42
42
  above (line 11); the safelist import above generates the component utilities
43
43
  its headings/links/etc. depend on. */
44
44
  @import "@takazudo/zudo-doc/content.css";
45
+ /* @slot:global-css:imports */
45
46
 
46
47
  /* ========================================
47
48
  * Tailwind v4 content sources
@@ -269,6 +270,11 @@
269
270
  --text-scale-lg: 1.4rem; /* 22.4px */
270
271
  --text-scale-xl: 3rem; /* 48px */
271
272
  --text-scale-2xl: 3.75rem; /* 60px */
273
+
274
+ --default-transition-duration: 150ms; /* consumed by hash-link opacity fade */
275
+ --zd-transition-slow: 200ms; /* sidebar transform/visibility and content-band max-width */
276
+ --zd-transition-slower: 300ms; /* view-transition fade-in (contentFadeIn animation) */
277
+ --zd-header-h: 80px; /* sticky header height; consumed by scroll-margin-top on [id] anchors */
272
278
  }
273
279
 
274
280
  /* ========================================
@@ -276,7 +282,7 @@
276
282
  * ======================================== */
277
283
 
278
284
  [id] {
279
- scroll-margin-top: 80px;
285
+ scroll-margin-top: var(--zd-header-h);
280
286
  }
281
287
 
282
288
  body {
@@ -580,8 +586,8 @@ pre[class^="syntect-"] .line .highlighted-word {
580
586
  @media (min-width: 1024px) {
581
587
  #desktop-sidebar {
582
588
  transition:
583
- transform 200ms ease-in-out,
584
- visibility 200ms;
589
+ transform var(--zd-transition-slow) ease-in-out,
590
+ visibility var(--zd-transition-slow);
585
591
  }
586
592
 
587
593
  html[data-sidebar-hidden] #desktop-sidebar {
@@ -590,7 +596,7 @@ pre[class^="syntect-"] .line .highlighted-word {
590
596
  }
591
597
 
592
598
  .zd-sidebar-content-wrapper {
593
- transition: margin-left 200ms ease-in-out;
599
+ transition: margin-left var(--zd-transition-slow) ease-in-out;
594
600
  }
595
601
 
596
602
  html[data-sidebar-hidden] .zd-sidebar-content-wrapper {
@@ -604,7 +610,7 @@ pre[class^="syntect-"] .line .highlighted-word {
604
610
  * branch in doc-layout.tsx. These rules are unlayered, so they win over
605
611
  * the Tailwind `max-w-[clamp(...)]` utility (utilities layer). (#2002) */
606
612
  .zd-doc-content-band {
607
- transition: max-width 200ms ease-in-out;
613
+ transition: max-width var(--zd-transition-slow) ease-in-out;
608
614
  }
609
615
 
610
616
  html[data-sidebar-hidden] .zd-doc-content-band {