@brandon_m_behring/book-scaffold-astro 4.12.0 → 4.13.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/dist/index.mjs CHANGED
@@ -368,6 +368,13 @@ var ACADEMIC_PART_ORDINAL = {
368
368
  synthesis: 5
369
369
  };
370
370
  var UNKNOWN_PART_ORDINAL = 99;
371
+ var ACADEMIC_PART_LABEL = {
372
+ foundations: "Foundations",
373
+ "ssm-core": "SSM Core",
374
+ "beyond-ssm": "Beyond SSM",
375
+ integration: "Integration",
376
+ synthesis: "Synthesis"
377
+ };
371
378
  function titleCase(part) {
372
379
  return part.split("-").map((w) => w.length > 0 ? w.charAt(0).toUpperCase() + w.slice(1) : "").join(" ");
373
380
  }
@@ -377,7 +384,7 @@ var academicChaptersRenderer = {
377
384
  },
378
385
  formatPartLabel(part) {
379
386
  if (typeof part === "string" && part.length > 0) {
380
- return titleCase(part);
387
+ return ACADEMIC_PART_LABEL[part] ?? titleCase(part);
381
388
  }
382
389
  return String(part);
383
390
  },
package/dist/schemas.mjs CHANGED
@@ -252,6 +252,13 @@ var ACADEMIC_PART_ORDINAL = {
252
252
  synthesis: 5
253
253
  };
254
254
  var UNKNOWN_PART_ORDINAL = 99;
255
+ var ACADEMIC_PART_LABEL = {
256
+ foundations: "Foundations",
257
+ "ssm-core": "SSM Core",
258
+ "beyond-ssm": "Beyond SSM",
259
+ integration: "Integration",
260
+ synthesis: "Synthesis"
261
+ };
255
262
  function titleCase(part) {
256
263
  return part.split("-").map((w) => w.length > 0 ? w.charAt(0).toUpperCase() + w.slice(1) : "").join(" ");
257
264
  }
@@ -261,7 +268,7 @@ var academicChaptersRenderer = {
261
268
  },
262
269
  formatPartLabel(part) {
263
270
  if (typeof part === "string" && part.length > 0) {
264
- return titleCase(part);
271
+ return ACADEMIC_PART_LABEL[part] ?? titleCase(part);
265
272
  }
266
273
  return String(part);
267
274
  },
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.12.0",
4
+ "version": "4.13.0",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "author": "Brandon Behring",
@@ -28,7 +28,22 @@ const ACADEMIC_PART_ORDINAL: Record<string, number> = {
28
28
 
29
29
  const UNKNOWN_PART_ORDINAL = 99;
30
30
 
31
- /** Title-case an enum string: "ssm-core" → "Ssm Core". */
31
+ /**
32
+ * Display labels for the academic-profile `part` enum. An explicit map (not
33
+ * naive title-casing) so acronyms render correctly: `ssm-core` → "SSM Core",
34
+ * not "Ssm Core" (#91). Keys mirror ACADEMIC_PART_ORDINAL; unknown/custom
35
+ * parts fall back to titleCase() in formatPartLabel.
36
+ */
37
+ const ACADEMIC_PART_LABEL: Record<string, string> = {
38
+ foundations: 'Foundations',
39
+ 'ssm-core': 'SSM Core',
40
+ 'beyond-ssm': 'Beyond SSM',
41
+ integration: 'Integration',
42
+ synthesis: 'Synthesis',
43
+ };
44
+
45
+ /** Title-case an enum string: "ssm-core" → "Ssm Core". Fallback for parts
46
+ * outside the known ACADEMIC_PART_LABEL map (e.g. consumer-custom parts). */
32
47
  function titleCase(part: string): string {
33
48
  return part
34
49
  .split('-')
@@ -43,7 +58,7 @@ export const academicChaptersRenderer: ChaptersRenderer = {
43
58
 
44
59
  formatPartLabel(part) {
45
60
  if (typeof part === 'string' && part.length > 0) {
46
- return titleCase(part);
61
+ return ACADEMIC_PART_LABEL[part] ?? titleCase(part);
47
62
  }
48
63
  return String(part);
49
64
  },
package/styles/tokens.css CHANGED
@@ -34,7 +34,9 @@
34
34
  --color-bg: var(--paper);
35
35
  --color-bg-subtle: var(--code-bg);
36
36
  --color-text: var(--dark-text);
37
- --color-text-muted: color-mix(in srgb, var(--dark-text) 55%, var(--paper));
37
+ /* 65% clears WCAG AA on --paper (~5.4:1); 55% computed to ≈#807F7E ≈3.9:1, failing AA (#91).
38
+ color-mix re-resolves in the dark scope (cream over deep bg → higher contrast). */
39
+ --color-text-muted: color-mix(in srgb, var(--dark-text) 65%, var(--paper));
38
40
  --color-border: var(--code-frame);
39
41
  --color-link: var(--warm-blue);
40
42
  --color-heading: var(--warm-blue);