@brandon_m_behring/book-scaffold-astro 4.26.2 → 4.26.3

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/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { AstroUserConfig, AstroIntegration, MarkdownHeading } from 'astro';
2
- import { c as BookConfigOptions, f as BookScaffoldIntegrationOptions, h as ChaptersRenderer, l as Style } from './types-Hue-uSeQ.js';
3
- export { B as BOOK_PRESETS, a as BOOK_PROFILES, b as BookConfigError, d as BookPreset, e as BookProfile, g as BookSchemasOptions, C as ChapterFor, F as FreshnessAffordance, i as FrontmatterRouteConfig, P as PartKey, j as PartialRouteToggles, k as ProfileDefinition, R as RouteToggles, S as StatusBadge, m as StyleInput, V as VolatilityBadge, n as composeStyles, o as defineProfile, p as defineStyle, q as normalizeFrontmatterConfig, r as resolvePreset, s as resolveProfile } from './types-Hue-uSeQ.js';
2
+ import { c as BookConfigOptions, f as BookScaffoldIntegrationOptions, h as ChaptersRenderer, m as Style } from './types-CWXP1S4b.js';
3
+ export { B as BOOK_PRESETS, a as BOOK_PROFILES, b as BookConfigError, d as BookPreset, e as BookProfile, g as BookSchemasOptions, C as ChapterFor, F as FreshnessAffordance, i as FrontmatterRouteConfig, P as PartKey, j as PartialRouteToggles, k as ProfileDefinition, R as ReleaseStatusConfig, l as RouteToggles, S as StatusBadge, n as StyleInput, V as VolatilityBadge, o as composeStyles, p as defineProfile, q as defineStyle, r as normalizeFrontmatterConfig, s as resolvePreset, t as resolveProfile } from './types-CWXP1S4b.js';
4
4
  import { E as volatilityLevels, c as academicParts, Q as Question } from './schemas-CKipJ5Ie.js';
5
5
  export { A as AcademicChapter, B as BloomLevel, C as CourseNotesChapter, G as GlossaryTerm, M as MinimalChapter, P as Provenance, a as QuestionType, R as ResearchPortfolioChapter, T as ToolsChapter, b as academicChapterSchema, d as bloomLevels, e as changeKinds, f as changelogSchema, g as chapterStatus, h as citationBackstops, i as courseNotesChapterSchema, j as glossarySchema, l as layoutModes, m as minimalChapterSchema, p as patternCategories, k as patternsSchema, n as provenanceObject, o as provenanceSchema, q as questionDifficulties, r as questionSchema, s as questionTypes, t as refineQuestion, u as refinedQuestionSchema, v as researchPortfolioChapterSchema, w as sourceTiers, x as sourceTiersResearch, y as sourcesSchema, z as toolSlugs, D as toolsChapterSchema } from './schemas-CKipJ5Ie.js';
6
6
  export { KIND_LABEL, ResolvedTheoremLabel, THEOREM_KINDS, TheoremKind, TheoremLabelProps, resolveTheoremNumber, theoremLabel } from './lib/theorem-label.js';
package/dist/index.mjs CHANGED
@@ -983,6 +983,9 @@ function composeStyles(styles) {
983
983
  if (style.preset !== void 0) merged.preset = style.preset;
984
984
  if (style.site !== void 0) merged.site = style.site;
985
985
  if (style.deploy !== void 0) merged.deploy = style.deploy;
986
+ if (style.releaseStatus !== void 0) {
987
+ merged.releaseStatus = style.releaseStatus;
988
+ }
986
989
  if (style.mdxComponentsModule !== void 0) {
987
990
  merged.mdxComponentsModule = style.mdxComponentsModule;
988
991
  }
@@ -1378,6 +1381,7 @@ async function defineBookConfig(opts) {
1378
1381
  const mdxComponentsModule = opts.mdxComponentsModule ?? composed.mdxComponentsModule;
1379
1382
  const composedMarkdown = composed.markdown ?? {};
1380
1383
  const userMarkdown = opts.markdown ?? {};
1384
+ const resolvedReleaseStatus = opts.releaseStatus !== void 0 ? opts.releaseStatus : composed.releaseStatus;
1381
1385
  const wantsKatex = PROFILES[profile]?.katex === true;
1382
1386
  const remarkPlugins = [];
1383
1387
  const rehypePlugins = [];
@@ -1427,8 +1431,8 @@ async function defineBookConfig(opts) {
1427
1431
  title: opts.title,
1428
1432
  // v4.23.0 (#135): sidebar brand subtitle.
1429
1433
  subtitle: opts.subtitle,
1430
- // v4.27.0 (#149): release-state banner (top-level beats the style chain).
1431
- releaseStatus: opts.releaseStatus ?? composed.releaseStatus,
1434
+ // v4.26.2 (#149; style inheritance + opt-out fixed in v4.26.3).
1435
+ releaseStatus: resolvedReleaseStatus === false ? void 0 : resolvedReleaseStatus,
1432
1436
  description: opts.description,
1433
1437
  portfolio: resolvedPortfolio,
1434
1438
  // v4.6.0: book-level author + SEO config (ogImage, twitterHandle),
@@ -1486,7 +1490,7 @@ async function defineBookConfig(opts) {
1486
1490
  // v4.5.0: strip new landing-related opts so they don't leak into AstroUserConfig.
1487
1491
  title: _title,
1488
1492
  subtitle: _subtitle,
1489
- // v4.27.0 (#149): strip the release-state banner config.
1493
+ // v4.26.2 (#149): strip the release-state banner config.
1490
1494
  releaseStatus: _releaseStatus,
1491
1495
  description: _description,
1492
1496
  portfolio: _portfolio,
package/dist/schemas.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { defineCollection } from 'astro:content';
2
- import { g as BookSchemasOptions } from './types-Hue-uSeQ.js';
2
+ import { g as BookSchemasOptions } from './types-CWXP1S4b.js';
3
3
  import 'astro';
4
4
  import './schemas-CKipJ5Ie.js';
5
5
  import 'astro/zod';
@@ -379,12 +379,12 @@ interface Style {
379
379
  * - `'pages'`: Cloudflare Pages (default for research-portfolio/course-notes)
380
380
  * Closes #50. */
381
381
  readonly deploy?: 'pages' | 'workers';
382
- /** v4.27.0 (#149): release-state banner; shallow override (last wins). */
383
- readonly releaseStatus?: {
384
- state: 'alpha' | 'beta' | 'rc' | 'locked';
385
- dismissAt?: string;
386
- message?: string;
387
- };
382
+ /**
383
+ * v4.26.2 (#149; style inheritance fixed in v4.26.3): release-state
384
+ * banner. Shallow override (last defined wins); `false` suppresses a
385
+ * banner inherited from an earlier style.
386
+ */
387
+ readonly releaseStatus?: ReleaseStatusConfig | false;
388
388
  /**
389
389
  * Scoped consumer-side metadata. Ignored by the toolkit; survives composition
390
390
  * as per-key spread (last wins per key). Use this for workflow data that
@@ -445,7 +445,8 @@ declare function defineStyle(opts: StyleInput): Style;
445
445
  * - Top-level `defineBookConfig` fields beat any style (handled in config.ts)
446
446
  *
447
447
  * Per-key merge strategy:
448
- * - `preset`, `site`, `deploy`, `mdxComponentsModule`, `name` → shallow override (last wins)
448
+ * - `preset`, `site`, `deploy`, `mdxComponentsModule`, `name`, `releaseStatus`
449
+ * → shallow override (last defined wins; `releaseStatus: false` suppresses)
449
450
  * - `routes` → per-route spread (each route key independently overridable)
450
451
  * - `katexMacros` → per-macro spread (each macro key independently overridable)
451
452
  * - `extra` → per-key spread (consumer metadata accumulates across the chain)
@@ -481,6 +482,17 @@ declare function normalizeFrontmatterConfig(v: FrontmatterRouteConfig | undefine
481
482
 
482
483
  type BookPreset = BookProfile;
483
484
  declare const BOOK_PRESETS: readonly ("academic" | "tools" | "minimal" | "course-notes" | "research-portfolio")[];
485
+ /**
486
+ * v4.26.2 (#149): book-level release state rendered by
487
+ * `<PreReleaseBanner>` across every page.
488
+ *
489
+ * Style inheritance and explicit suppression were fixed in v4.26.3.
490
+ */
491
+ interface ReleaseStatusConfig {
492
+ state: 'alpha' | 'beta' | 'rc' | 'locked';
493
+ dismissAt?: string;
494
+ message?: string;
495
+ }
484
496
  /**
485
497
  * Options for `defineBookConfig`. See PACKAGE_DESIGN.md §4.
486
498
  *
@@ -607,16 +619,12 @@ interface BookConfigOptions {
607
619
  */
608
620
  subtitle?: string;
609
621
  /**
610
- * v4.27.0 (#149): book-level release state. When set, Base.astro renders
611
- * the existing <PreReleaseBanner> site-wide (top of <body>) with these
612
- * props previously the banner was author-import-only, so auto-layout
613
- * consumers (ssm-foundations) had no way to wire it. Omit for no banner.
622
+ * v4.26.2 (#149; style inheritance fixed in v4.26.3): book-level release
623
+ * state. When set, Base.astro renders the existing <PreReleaseBanner>
624
+ * site-wide (top of <body>) with these props. Omit to inherit from the
625
+ * composed style chain; set `false` to suppress an inherited banner.
614
626
  */
615
- releaseStatus?: {
616
- state: 'alpha' | 'beta' | 'rc' | 'locked';
617
- dismissAt?: string;
618
- message?: string;
619
- };
627
+ releaseStatus?: ReleaseStatusConfig | false;
620
628
  /**
621
629
  * v4.5.0: Book description. Read by the auto-injected `/` landing page (lead paragraph + <meta description>).
622
630
  * Optional; landing renders no description paragraph if unset.
@@ -769,13 +777,9 @@ interface BookScaffoldIntegrationOptions {
769
777
  /** v4.23.0 (#135): sidebar brand subtitle, propagated via the book-config
770
778
  * virtual module to Sidebar.astro. */
771
779
  subtitle?: string;
772
- /** v4.27.0 (#149): release-state banner, propagated via the book-config
773
- * virtual module; Base.astro renders <PreReleaseBanner> when set. */
774
- releaseStatus?: {
775
- state: 'alpha' | 'beta' | 'rc' | 'locked';
776
- dismissAt?: string;
777
- message?: string;
778
- };
780
+ /** v4.26.2 (#149; style inheritance fixed in v4.26.3): resolved
781
+ * release-state banner propagated via the book-config virtual module. */
782
+ releaseStatus?: ReleaseStatusConfig;
779
783
  /** v4.5.0: book description, propagated to `/` landing via vite.define. */
780
784
  description?: string;
781
785
  /**
@@ -851,4 +855,4 @@ declare function resolvePreset(explicitPreset?: BookPreset, explicitProfile?: Bo
851
855
  */
852
856
  declare function resolveProfile(explicit?: BookProfile): BookProfile;
853
857
 
854
- export { BOOK_PRESETS as B, type ChapterFor as C, type FreshnessAffordance as F, type PartKey as P, type RouteToggles as R, type StatusBadge as S, type VolatilityBadge as V, BOOK_PROFILES as a, BookConfigError as b, type BookConfigOptions as c, type BookPreset as d, type BookProfile as e, type BookScaffoldIntegrationOptions as f, type BookSchemasOptions as g, type ChaptersRenderer as h, type FrontmatterRouteConfig as i, type PartialRouteToggles as j, type ProfileDefinition as k, type Style as l, type StyleInput as m, composeStyles as n, defineProfile as o, defineStyle as p, normalizeFrontmatterConfig as q, resolvePreset as r, resolveProfile as s };
858
+ export { BOOK_PRESETS as B, type ChapterFor as C, type FreshnessAffordance as F, type PartKey as P, type ReleaseStatusConfig as R, type StatusBadge as S, type VolatilityBadge as V, BOOK_PROFILES as a, BookConfigError as b, type BookConfigOptions as c, type BookPreset as d, type BookProfile as e, type BookScaffoldIntegrationOptions as f, type BookSchemasOptions as g, type ChaptersRenderer as h, type FrontmatterRouteConfig as i, type PartialRouteToggles as j, type ProfileDefinition as k, type RouteToggles as l, type Style as m, type StyleInput as n, composeStyles as o, defineProfile as p, defineStyle as q, normalizeFrontmatterConfig as r, resolvePreset as s, resolveProfile as t };
@@ -59,7 +59,8 @@ import '../styles/print.css';
59
59
  import VersionSelector from '@brandon_m_behring/book-scaffold-astro/components/VersionSelector';
60
60
  import ToolFilter from '@brandon_m_behring/book-scaffold-astro/components/ToolFilter';
61
61
  import Sidebar from '../components/Sidebar.astro';
62
- // v4.27.0 (#149): site-wide release-state banner, driven by defineBookConfig.
62
+ // v4.26.2 (#149; style inheritance fixed in v4.26.3): site-wide
63
+ // release-state banner, driven by defineBookConfig.
63
64
  import PreReleaseBanner from '../components/PreReleaseBanner.astro';
64
65
  // v4.26.0 (#80): the mobile/tablet drawer reuses the same book-scoped nav source.
65
66
  import NavContent from '../components/NavContent.astro';
@@ -167,7 +168,7 @@ const baseUrl = (import.meta.env.BASE_URL ?? '/').replace(/\/*$/, '/');
167
168
  <slot name="head" />
168
169
  </head>
169
170
  <body>
170
- {/* v4.27.0 (#149): book-level release banner — first element in <body> so
171
+ {/* v4.26.2 (#149; style inheritance fixed in v4.26.3): book-level release banner — first element in <body> so
171
172
  every page (chapters, apparatus, landing) declares its state. Renders
172
173
  only when defineBookConfig({ releaseStatus }) is set. */}
173
174
  {bookConfig.releaseStatus && (
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@brandon_m_behring/book-scaffold-astro",
3
3
  "description": "Astro 6 + MDX toolkit for long-form technical books. Profile-aware (academic / tools / minimal); ships Tufte typography, KaTeX, BibTeX citations, Pagefind, Cloudflare Workers deploy. See PACKAGE_DESIGN.md for the API contract.",
4
- "version": "4.26.2",
4
+ "version": "4.26.3",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "author": "Brandon Behring",
@@ -122,7 +122,8 @@ Different fields have different merge semantics. Documented:
122
122
 
123
123
  | Field | Strategy |
124
124
  |---|---|
125
- | `name`, `preset`, `site`, `deploy`, `mdxComponentsModule` | Shallow override (last wins) |
125
+ | `name`, `preset`, `site`, `deploy`, `mdxComponentsModule` | Shallow override (last defined wins) |
126
+ | `releaseStatus` | Shallow override (last defined object replaces the whole earlier object); `false` suppresses an inherited banner |
126
127
  | `routes` | Per-route spread (each route key independently overridable) |
127
128
  | `routes.frontmatter` | Per-route spread; later value (boolean OR object) wholly replaces earlier |
128
129
  | `katexMacros` | Object spread (per-macro override) |
@@ -27,7 +27,7 @@
27
27
  * for migration from the v3 `preset:` shorthand.
28
28
  */
29
29
  import type { AstroIntegration, AstroUserConfig } from 'astro';
30
- import type { BookPreset, RouteToggles } from '../types.js';
30
+ import type { BookPreset, ReleaseStatusConfig, RouteToggles } from '../types.js';
31
31
 
32
32
  // ===== Branded nominal type =====
33
33
 
@@ -123,8 +123,12 @@ export interface Style {
123
123
  * - `'pages'`: Cloudflare Pages (default for research-portfolio/course-notes)
124
124
  * Closes #50. */
125
125
  readonly deploy?: 'pages' | 'workers';
126
- /** v4.27.0 (#149): release-state banner; shallow override (last wins). */
127
- readonly releaseStatus?: { state: 'alpha' | 'beta' | 'rc' | 'locked'; dismissAt?: string; message?: string };
126
+ /**
127
+ * v4.26.2 (#149; style inheritance fixed in v4.26.3): release-state
128
+ * banner. Shallow override (last defined wins); `false` suppresses a
129
+ * banner inherited from an earlier style.
130
+ */
131
+ readonly releaseStatus?: ReleaseStatusConfig | false;
128
132
 
129
133
  /**
130
134
  * Scoped consumer-side metadata. Ignored by the toolkit; survives composition
@@ -195,7 +199,8 @@ export function defineStyle(opts: StyleInput): Style {
195
199
  * - Top-level `defineBookConfig` fields beat any style (handled in config.ts)
196
200
  *
197
201
  * Per-key merge strategy:
198
- * - `preset`, `site`, `deploy`, `mdxComponentsModule`, `name` → shallow override (last wins)
202
+ * - `preset`, `site`, `deploy`, `mdxComponentsModule`, `name`, `releaseStatus`
203
+ * → shallow override (last defined wins; `releaseStatus: false` suppresses)
199
204
  * - `routes` → per-route spread (each route key independently overridable)
200
205
  * - `katexMacros` → per-macro spread (each macro key independently overridable)
201
206
  * - `extra` → per-key spread (consumer metadata accumulates across the chain)
@@ -218,6 +223,9 @@ export function composeStyles(styles: readonly Style[]): Style {
218
223
  if (style.preset !== undefined) merged.preset = style.preset;
219
224
  if (style.site !== undefined) merged.site = style.site;
220
225
  if (style.deploy !== undefined) merged.deploy = style.deploy;
226
+ if (style.releaseStatus !== undefined) {
227
+ merged.releaseStatus = style.releaseStatus;
228
+ }
221
229
  if (style.mdxComponentsModule !== undefined) {
222
230
  merged.mdxComponentsModule = style.mdxComponentsModule;
223
231
  }