@tenphi/starlight 0.9.6 → 0.10.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.
@@ -366,170 +366,176 @@ export default function GlobalStyles() {
366
366
  fill: "#surface",
367
367
  });
368
368
 
369
- useGlobalStyles("#starlight__sidebar", {
370
- CurrentLink: {
371
- $: [
372
- 'a[aria-current="page"]',
373
- 'a[aria-current="page"]:hover',
374
- 'a[aria-current="page"]:focus',
375
- ],
376
- color: "#accent-text",
377
- fill: "#accent-surface-subtle",
378
- },
379
- Content: {
380
- $: ".sidebar-content",
381
- gap: "($gap * 3)",
382
- paddingBlockStart: {
383
- "": "($gap * 4)",
384
- "@medium-layout": "($gap * 1.5)",
369
+ useGlobalStyles(
370
+ "#starlight__sidebar",
371
+ resolveComponentStyles("Sidebar", {
372
+ CurrentLink: {
373
+ $: [
374
+ 'a[aria-current="page"]',
375
+ 'a[aria-current="page"]:hover',
376
+ 'a[aria-current="page"]:focus',
377
+ ],
378
+ color: "#accent-text",
379
+ fill: "#accent-surface-subtle",
385
380
  },
386
- paddingBlockEnd: "($gap * 6)",
387
- },
388
- List: {
389
- $: "ul",
390
- padding: "0",
391
- listStyle: "none",
392
- },
393
- Item: {
394
- $: "li",
395
- overflowWrap: "anywhere",
396
- },
397
- TopLevelSpacing: {
398
- $: ".top-level > li + li",
399
- marginBlockStart: "($gap * 3)",
400
- },
401
- NestedItem: {
402
- $: "ul ul li",
403
- marginInlineStart: "($gap * 0.75)",
404
- paddingInlineStart: "($gap * 0.75)",
405
- borderInlineStart: "0",
406
- },
407
- Control: {
408
- $: ["summary", "a"],
409
- padding: "($gap * 0.8) ($gap * 1.25)",
410
- color: "#text-soft",
411
- lineHeight: "1.45",
412
- radius: "$radius",
413
- textDecoration: "none",
414
- },
415
- Summary: {
416
- $: "summary",
417
- display: "flex",
418
- alignItems: "center",
419
- justifyContent: "space-between",
420
- cursor: "pointer",
421
- userSelect: "none",
422
- },
423
- GroupLabel: {
424
- $: "summary > .group-label",
425
- display: "flex",
426
- alignItems: "center",
427
- minInlineSize: "0",
428
- gap: "0.25em",
429
- },
430
- GroupLabelText: {
431
- $: "summary > .group-label > span:first-child",
432
- minInlineSize: "0",
433
- overflow: "hidden",
434
- color: "#text",
435
- fontSize: "0.9375rem",
436
- fontWeight: "$body-bold-font-weight",
437
- textOverflow: "ellipsis",
438
- whiteSpace: "nowrap",
439
- },
440
- Link: {
441
- $: "a",
442
- display: "flex",
443
- alignItems: "center",
444
- minInlineSize: "0",
445
- gap: "0.25em",
446
- fill: "#surface",
447
- fontSize: "0.9375rem",
448
- },
449
- LinkLabel: {
450
- $: "a > span:first-child",
451
- minInlineSize: "0",
452
- overflow: "hidden",
453
- textOverflow: "ellipsis",
454
- whiteSpace: "nowrap",
455
- },
456
- InteractiveControl: {
457
- $: ["a:hover", "a:focus-visible", "summary:hover"],
458
- color: "#text",
459
- fill: "#surface-2-hover",
460
- },
461
- SummaryMarker: {
462
- $: "summary::marker",
463
- hide: true,
464
- },
465
- TopLevelLink: {
466
- $: "a.large",
467
- fontSize: "0.9375rem",
468
- fontWeight: "$body-bold-font-weight",
469
- color: "#text",
470
- },
471
- });
472
-
473
- useGlobalStyles(".right-sidebar-panel", {
474
- paddingBlockStart: "($gap * 5)",
475
- paddingInlineStart: "$docs-sidebar-pad-x",
476
- paddingInlineEnd: "$docs-sidebar-pad-x",
381
+ Content: {
382
+ $: ".sidebar-content",
383
+ gap: "($gap * 3)",
384
+ paddingBlockStart: {
385
+ "": "($gap * 4)",
386
+ "@medium-layout": "($gap * 1.5)",
387
+ },
388
+ paddingBlockEnd: "($gap * 6)",
389
+ },
390
+ List: {
391
+ $: "ul",
392
+ padding: "0",
393
+ listStyle: "none",
394
+ },
395
+ Item: {
396
+ $: "li",
397
+ overflowWrap: "anywhere",
398
+ },
399
+ TopLevelSpacing: {
400
+ $: ".top-level > li + li",
401
+ marginBlockStart: "($gap * 3)",
402
+ },
403
+ NestedItem: {
404
+ $: "ul ul li",
405
+ marginInlineStart: "($gap * 0.75)",
406
+ paddingInlineStart: "($gap * 0.75)",
407
+ borderInlineStart: "0",
408
+ },
409
+ Control: {
410
+ $: ["summary", "a"],
411
+ padding: "($gap * 0.8) ($gap * 1.25)",
412
+ color: "#text-soft",
413
+ lineHeight: "1.45",
414
+ radius: "$radius",
415
+ textDecoration: "none",
416
+ },
417
+ Summary: {
418
+ $: "summary",
419
+ display: "flex",
420
+ alignItems: "center",
421
+ justifyContent: "space-between",
422
+ cursor: "pointer",
423
+ userSelect: "none",
424
+ },
425
+ GroupLabel: {
426
+ $: "summary > .group-label",
427
+ display: "flex",
428
+ alignItems: "center",
429
+ minInlineSize: "0",
430
+ gap: "0.25em",
431
+ },
432
+ GroupLabelText: {
433
+ $: "summary > .group-label > span:first-child",
434
+ minInlineSize: "0",
435
+ overflow: "hidden",
436
+ color: "#text",
437
+ fontSize: "0.9375rem",
438
+ fontWeight: "$body-bold-font-weight",
439
+ textOverflow: "ellipsis",
440
+ whiteSpace: "nowrap",
441
+ },
442
+ Link: {
443
+ $: "a",
444
+ display: "flex",
445
+ alignItems: "center",
446
+ minInlineSize: "0",
447
+ gap: "0.25em",
448
+ fill: "#surface",
449
+ fontSize: "0.9375rem",
450
+ },
451
+ LinkLabel: {
452
+ $: "a > span:first-child",
453
+ minInlineSize: "0",
454
+ overflow: "hidden",
455
+ textOverflow: "ellipsis",
456
+ whiteSpace: "nowrap",
457
+ },
458
+ InteractiveControl: {
459
+ $: ["a:hover", "a:focus-visible", "summary:hover"],
460
+ color: "#text",
461
+ fill: "#surface-2-hover",
462
+ },
463
+ SummaryMarker: {
464
+ $: "summary::marker",
465
+ hide: true,
466
+ },
467
+ TopLevelLink: {
468
+ $: "a.large",
469
+ fontSize: "0.9375rem",
470
+ fontWeight: "$body-bold-font-weight",
471
+ color: "#text",
472
+ },
473
+ }),
474
+ );
477
475
 
478
- Heading: {
479
- $: "h2",
480
- marginBlockEnd: "$gap",
481
- color: "#text",
482
- fontSize: "0.9375rem",
483
- fontWeight: "$body-bold-font-weight",
484
- lineHeight: "$heading-line-height",
485
- },
486
- List: {
487
- $: "ul",
488
- display: "grid",
489
- gridTemplateColumns: "minmax(0, 1fr)",
490
- minInlineSize: "0",
491
- gap: "1px",
492
- margin: "0",
493
- padding: "0",
494
- listStyle: "none",
495
- },
496
- Item: {
497
- $: "li",
498
- minInlineSize: "0",
499
- margin: "0",
500
- padding: "0",
501
- listStyle: "none",
502
- },
503
- Link: {
504
- $: "a",
505
- display: "block",
506
- minInlineSize: "0",
507
- maxInlineSize: "100%",
508
- paddingBlockStart: "($gap * 0.5)",
509
- paddingBlockEnd: "($gap * 0.5)",
510
- color: "#text-muted",
511
- fontSize: "$small-font-size",
512
- lineHeight: "1.45",
513
- textDecoration: "none",
514
- overflowWrap: "anywhere",
515
- },
516
- LinkLabel: {
517
- $: "a > span",
518
- display: "block",
519
- minInlineSize: "0",
520
- overflow: "hidden",
521
- textOverflow: "ellipsis",
522
- whiteSpace: "nowrap",
523
- },
524
- HoverLink: {
525
- $: "a:hover",
526
- color: "#text",
527
- },
528
- CurrentLink: {
529
- $: 'a[aria-current="true"]',
530
- color: "#accent-text",
531
- },
532
- });
476
+ useGlobalStyles(
477
+ ".right-sidebar-panel",
478
+ resolveComponentStyles("TableOfContents", {
479
+ paddingBlockStart: "($gap * 5)",
480
+ paddingInlineStart: "$docs-sidebar-pad-x",
481
+ paddingInlineEnd: "$docs-sidebar-pad-x",
482
+
483
+ Heading: {
484
+ $: "h2",
485
+ marginBlockEnd: "$gap",
486
+ color: "#text",
487
+ fontSize: "0.9375rem",
488
+ fontWeight: "$body-bold-font-weight",
489
+ lineHeight: "$heading-line-height",
490
+ },
491
+ List: {
492
+ $: "ul",
493
+ display: "grid",
494
+ gridTemplateColumns: "minmax(0, 1fr)",
495
+ minInlineSize: "0",
496
+ gap: "1px",
497
+ margin: "0",
498
+ padding: "0",
499
+ listStyle: "none",
500
+ },
501
+ Item: {
502
+ $: "li",
503
+ minInlineSize: "0",
504
+ margin: "0",
505
+ padding: "0",
506
+ listStyle: "none",
507
+ },
508
+ Link: {
509
+ $: "a",
510
+ display: "block",
511
+ minInlineSize: "0",
512
+ maxInlineSize: "100%",
513
+ paddingBlockStart: "($gap * 0.5)",
514
+ paddingBlockEnd: "($gap * 0.5)",
515
+ color: "#text-muted",
516
+ fontSize: "$small-font-size",
517
+ lineHeight: "1.45",
518
+ textDecoration: "none",
519
+ overflowWrap: "anywhere",
520
+ },
521
+ LinkLabel: {
522
+ $: "a > span",
523
+ display: "block",
524
+ minInlineSize: "0",
525
+ overflow: "hidden",
526
+ textOverflow: "ellipsis",
527
+ whiteSpace: "nowrap",
528
+ },
529
+ HoverLink: {
530
+ $: "a:hover",
531
+ color: "#text",
532
+ },
533
+ CurrentLink: {
534
+ $: 'a[aria-current="true"]',
535
+ color: "#accent-text",
536
+ },
537
+ }),
538
+ );
533
539
 
534
540
  useGlobalStyles(".content-panel", {
535
541
  padding: "($gap * 3) $docs-content-pad-x",
@@ -1494,56 +1500,59 @@ export default function GlobalStyles() {
1494
1500
  whiteSpace: "nowrap",
1495
1501
  });
1496
1502
 
1497
- useGlobalStyles("mobile-starlight-toc .dropdown .isMobile", {
1498
- display: "grid",
1499
- gridTemplateColumns: "minmax(0, 1fr)",
1500
- minInlineSize: "0",
1501
- gap: "1px",
1502
- margin: "0",
1503
- padding: "0",
1504
- listStyle: "none",
1505
-
1506
- Item: {
1507
- $: "> li",
1503
+ useGlobalStyles(
1504
+ "mobile-starlight-toc .dropdown .isMobile",
1505
+ resolveComponentStyles("MobileTableOfContents", {
1506
+ display: "grid",
1507
+ gridTemplateColumns: "minmax(0, 1fr)",
1508
1508
  minInlineSize: "0",
1509
+ gap: "1px",
1509
1510
  margin: "0",
1510
1511
  padding: "0",
1511
1512
  listStyle: "none",
1512
- },
1513
- Link: {
1514
- $: "a",
1515
- display: "flex",
1516
- alignItems: "center",
1517
- minInlineSize: "0",
1518
- minBlockSize: "2.5rem",
1519
- padding: "0.625rem 0.75rem",
1520
- color: "#text-soft",
1521
- radius: "$radius",
1522
- fill: "#surface-2",
1523
- textDecoration: "none",
1524
- },
1525
- LinkLabel: {
1526
- $: "a > span",
1527
- minInlineSize: "0",
1528
- overflow: "hidden",
1529
- textOverflow: "ellipsis",
1530
- whiteSpace: "nowrap",
1531
- },
1532
- HoverLink: {
1533
- $: "a:hover",
1534
- color: "#text",
1535
- fill: "#surface-2-hover",
1536
- },
1537
- CurrentLink: {
1538
- $: 'a[aria-current="true"]',
1539
- color: "#accent-text",
1540
- fill: "#accent-surface-2-subtle",
1541
- },
1542
- CurrentIndicator: {
1543
- $: 'a[aria-current="true"]::after',
1544
- blockSize: "1rem",
1545
- },
1546
- });
1513
+
1514
+ Item: {
1515
+ $: "> li",
1516
+ minInlineSize: "0",
1517
+ margin: "0",
1518
+ padding: "0",
1519
+ listStyle: "none",
1520
+ },
1521
+ Link: {
1522
+ $: "a",
1523
+ display: "flex",
1524
+ alignItems: "center",
1525
+ minInlineSize: "0",
1526
+ minBlockSize: "2.5rem",
1527
+ padding: "0.625rem 0.75rem",
1528
+ color: "#text-soft",
1529
+ radius: "$radius",
1530
+ fill: "#surface-2",
1531
+ textDecoration: "none",
1532
+ },
1533
+ LinkLabel: {
1534
+ $: "a > span",
1535
+ minInlineSize: "0",
1536
+ overflow: "hidden",
1537
+ textOverflow: "ellipsis",
1538
+ whiteSpace: "nowrap",
1539
+ },
1540
+ HoverLink: {
1541
+ $: "a:hover",
1542
+ color: "#text",
1543
+ fill: "#surface-2-hover",
1544
+ },
1545
+ CurrentLink: {
1546
+ $: 'a[aria-current="true"]',
1547
+ color: "#accent-text",
1548
+ fill: "#accent-surface-2-subtle",
1549
+ },
1550
+ CurrentIndicator: {
1551
+ $: 'a[aria-current="true"]::after',
1552
+ blockSize: "1rem",
1553
+ },
1554
+ }),
1555
+ );
1547
1556
 
1548
1557
  useGlobalStyles(
1549
1558
  ".sl-markdown-content :where(code):not(:where(.not-content *))",
@@ -6,7 +6,6 @@ configureCookbookStates();
6
6
 
7
7
  export const LogoRoot = customizeComponent(
8
8
  "Logo",
9
- { as: "span" },
10
9
  tasty({
11
10
  as: "span",
12
11
  styles: {
@@ -33,7 +32,6 @@ export const LogoRoot = customizeComponent(
33
32
 
34
33
  export const PackageVersionRoot = customizeComponent(
35
34
  "PackageVersion",
36
- { as: "span" },
37
35
  tasty({
38
36
  as: "span",
39
37
  styles: {
@@ -55,7 +53,6 @@ export const PackageVersionRoot = customizeComponent(
55
53
 
56
54
  export const TopNavigationRoot = customizeComponent(
57
55
  "TopNavigation",
58
- { as: "nav" },
59
56
  tasty({
60
57
  as: "nav",
61
58
  styles: {
@@ -101,7 +98,6 @@ export const TopNavigationRoot = customizeComponent(
101
98
 
102
99
  export const StarlightHeaderRoot = customizeComponent(
103
100
  "StarlightHeader",
104
- { as: "div" },
105
101
  tasty({
106
102
  as: "div",
107
103
  styles: {
@@ -345,7 +341,6 @@ const appearanceSelectStyles = {
345
341
 
346
342
  export const ThemeSelectRoot = customizeComponent(
347
343
  "ThemeSelect",
348
- { as: "starlight-theme-select" },
349
344
  tasty({
350
345
  as: "starlight-theme-select",
351
346
  styles: appearanceSelectStyles,
@@ -354,7 +349,6 @@ export const ThemeSelectRoot = customizeComponent(
354
349
 
355
350
  export const ContrastSelectRoot = customizeComponent(
356
351
  "ContrastSelect",
357
- { as: "cookbook-contrast-select" },
358
352
  tasty({
359
353
  as: "cookbook-contrast-select",
360
354
  styles: appearanceSelectStyles,
@@ -363,7 +357,6 @@ export const ContrastSelectRoot = customizeComponent(
363
357
 
364
358
  export const MobileNavigationTabsRoot = customizeComponent(
365
359
  "MobileNavigationTabs",
366
- { as: "nav" },
367
360
  tasty({
368
361
  as: "nav",
369
362
  styles: {
@@ -416,7 +409,6 @@ export const MobileNavigationTabsRoot = customizeComponent(
416
409
 
417
410
  export const MobileMenuFooterRoot = customizeComponent(
418
411
  "MobileMenuFooter",
419
- { as: "div" },
420
412
  tasty({
421
413
  as: "div",
422
414
  styles: {
@@ -442,7 +434,6 @@ export const MobileMenuFooterRoot = customizeComponent(
442
434
 
443
435
  export const FooterRoot = customizeComponent(
444
436
  "Footer",
445
- { as: "footer" },
446
437
  tasty({
447
438
  as: "footer",
448
439
  styles: {
@@ -6,7 +6,6 @@ configureCookbookStates();
6
6
 
7
7
  export const CardRoot = customizeComponent(
8
8
  "Card",
9
- { as: "article" },
10
9
  tasty({
11
10
  as: "article",
12
11
  styles: {
@@ -68,7 +67,6 @@ const previewElements = {
68
67
 
69
68
  export const PreviewRoot = customizeComponent(
70
69
  "Preview",
71
- { as: "figure", elements: previewElements },
72
70
  tasty({
73
71
  as: "figure",
74
72
  styles: {
@@ -116,7 +114,6 @@ export const PreviewRoot = customizeComponent(
116
114
 
117
115
  export const StepsRoot = customizeComponent(
118
116
  "Steps",
119
- { as: "ol" },
120
117
  tasty({
121
118
  as: "ol",
122
119
  styles: {
@@ -140,7 +137,6 @@ export const StepsRoot = customizeComponent(
140
137
 
141
138
  export const TabsRoot = customizeComponent(
142
139
  "Tabs",
143
- { as: "div" },
144
140
  tasty({
145
141
  as: "div",
146
142
  styles: {
@@ -27,45 +27,22 @@ describe("component style configuration", () => {
27
27
  });
28
28
  });
29
29
 
30
- it("supports explicit extension and complete replacement", () => {
31
- configureComponentStyles({
32
- Card: { mode: "extend", styles: { radius: "1cr" } },
33
- });
34
- expect(resolveComponentStyles("Card", defaults)).toMatchObject({
35
- color: "#text",
36
- radius: "1cr",
37
- });
38
-
39
- configureComponentStyles({
40
- Card: { mode: "replace", styles: { display: "grid" } },
41
- });
42
- expect(resolveComponentStyles("Card", defaults)).toEqual({
43
- display: "grid",
44
- });
45
- });
46
-
47
- it("normalizes configured component overrides for Tasty composition", () => {
30
+ it("returns the user override for Tasty component composition", () => {
48
31
  expect(resolveComponentStyleOverride("Card")).toBeUndefined();
49
32
 
50
33
  configureComponentStyles({ Card: { padding: "3x" } });
51
34
  expect(resolveComponentStyleOverride("Card")).toEqual({
52
- mode: "extend",
53
- styles: { padding: "3x" },
54
- });
55
-
56
- configureComponentStyles({
57
- Card: { mode: "replace", styles: { display: "grid" } },
58
- });
59
- expect(resolveComponentStyleOverride("Card")).toEqual({
60
- mode: "replace",
61
- styles: { display: "grid" },
35
+ padding: "3x",
62
36
  });
63
37
  });
64
38
 
65
- it("exposes bridged Markdown components through the same style registry", () => {
39
+ it("merges configuration into bridged component style trees", () => {
66
40
  configureComponentStyles({
67
41
  MarkdownTable: { Table: { radius: "0" } },
68
42
  Mermaid: { Diagram: { maxInlineSize: "90%" } },
43
+ MobileTableOfContents: { LinkLabel: { whiteSpace: "normal" } },
44
+ Sidebar: { Link: { padding: "1x" } },
45
+ TableOfContents: { Link: { color: "#text" } },
69
46
  });
70
47
 
71
48
  expect(
@@ -84,6 +61,39 @@ describe("component style configuration", () => {
84
61
  ).toEqual({
85
62
  Diagram: { display: "block", maxInlineSize: "90%" },
86
63
  });
64
+ expect(
65
+ resolveComponentStyles("Sidebar", {
66
+ display: "block",
67
+ Content: { gap: "3x" },
68
+ Link: { color: "#text-soft", padding: "2x" },
69
+ }),
70
+ ).toEqual({
71
+ display: "block",
72
+ Content: { gap: "3x" },
73
+ Link: { color: "#text-soft", padding: "1x" },
74
+ });
75
+ expect(
76
+ resolveComponentStyles("TableOfContents", {
77
+ paddingBlockStart: "5x",
78
+ Heading: { color: "#text" },
79
+ Link: { color: "#text-muted", preset: "small" },
80
+ }),
81
+ ).toEqual({
82
+ paddingBlockStart: "5x",
83
+ Heading: { color: "#text" },
84
+ Link: { color: "#text", preset: "small" },
85
+ });
86
+ expect(
87
+ resolveComponentStyles("MobileTableOfContents", {
88
+ display: "grid",
89
+ Item: { minInlineSize: "0" },
90
+ LinkLabel: { overflow: "hidden", whiteSpace: "nowrap" },
91
+ }),
92
+ ).toEqual({
93
+ display: "grid",
94
+ Item: { minInlineSize: "0" },
95
+ LinkLabel: { overflow: "hidden", whiteSpace: "normal" },
96
+ });
87
97
  });
88
98
 
89
99
  it("keeps custom anatomy styles on the compatibility bridge", () => {
@@ -21,32 +21,21 @@ export function configureComponentStyles(
21
21
 
22
22
  export function resolveComponentStyles(
23
23
  name: CookbookComponentName,
24
- defaults: Styles,
24
+ baseStyles: Styles,
25
25
  ): Styles {
26
- const configured = sharedConfiguration.__tenphiCookbookComponentStyles?.[
27
- name
28
- ] as ComponentStyleConfig | undefined;
29
- if (!configured) return defaults;
30
- if (isModeConfig(configured)) {
31
- const styles = configured.styles as Styles;
32
- return configured.mode === "replace"
33
- ? styles
34
- : mergeStyles(defaults, styles);
35
- }
36
- return mergeStyles(defaults, configured as Styles);
26
+ const configuredStyles = sharedConfiguration
27
+ .__tenphiCookbookComponentStyles?.[name] as
28
+ ComponentStyleConfig | undefined;
29
+ return configuredStyles
30
+ ? mergeStyles(baseStyles, configuredStyles as Styles)
31
+ : baseStyles;
37
32
  }
38
33
 
39
34
  export function resolveComponentStyleOverride(
40
35
  name: CookbookComponentName,
41
- ): { mode: "extend" | "replace"; styles: Styles } | undefined {
42
- const configured = sharedConfiguration.__tenphiCookbookComponentStyles?.[
43
- name
44
- ] as ComponentStyleConfig | undefined;
45
- if (!configured) return undefined;
46
- if (isModeConfig(configured)) {
47
- return { mode: configured.mode, styles: configured.styles as Styles };
48
- }
49
- return { mode: "extend", styles: configured as Styles };
36
+ ): Styles | undefined {
37
+ return sharedConfiguration.__tenphiCookbookComponentStyles?.[name] as
38
+ Styles | undefined;
50
39
  }
51
40
 
52
41
  /** Preserve custom anatomy names from the pre-component style API. */
@@ -59,21 +48,8 @@ export function resolveLegacyAnatomyStyles(
59
48
  (entry): entry is [string, ComponentStyleConfig] =>
60
49
  !cookbookComponentNames.has(entry[0]) && entry[1] !== undefined,
61
50
  )
62
- .map(([name, value]) => [
63
- `[data-tasty-anatomy="${name}"]`,
64
- isModeConfig(value) ? value.styles : value,
65
- ]);
51
+ .map(([name, value]) => [`[data-tasty-anatomy="${name}"]`, value]);
66
52
  return entries.length
67
53
  ? (Object.fromEntries(entries) as Record<string, Styles>)
68
54
  : undefined;
69
55
  }
70
-
71
- function isModeConfig(
72
- value: ComponentStyleConfig,
73
- ): value is Extract<ComponentStyleConfig, { mode: string }> {
74
- return (
75
- "mode" in value &&
76
- (value.mode === "extend" || value.mode === "replace") &&
77
- "styles" in value
78
- );
79
- }
@@ -1,10 +1,8 @@
1
1
  import { tasty } from "@tenphi/tasty";
2
2
  import { resolveComponentStyleOverride } from "./component-styles.js";
3
3
 
4
- export function customizeComponent(name, options, base) {
4
+ export function customizeComponent(name, base) {
5
5
  const override = resolveComponentStyleOverride(name);
6
6
  if (!override) return base;
7
- return override.mode === "replace"
8
- ? tasty({ ...options, styles: override.styles })
9
- : tasty(base, { styles: override.styles });
7
+ return tasty(base, { styles: override });
10
8
  }
package/dist/index.js CHANGED
@@ -851,12 +851,9 @@ function configureComponentStyles(styles) {
851
851
  /** Preserve custom anatomy names from the pre-component style API. */
852
852
  function resolveLegacyAnatomyStyles(styles) {
853
853
  if (!styles) return void 0;
854
- const entries = Object.entries(styles).filter((entry) => !cookbookComponentNames.has(entry[0]) && entry[1] !== void 0).map(([name, value]) => [`[data-tasty-anatomy="${name}"]`, isModeConfig(value) ? value.styles : value]);
854
+ const entries = Object.entries(styles).filter((entry) => !cookbookComponentNames.has(entry[0]) && entry[1] !== void 0).map(([name, value]) => [`[data-tasty-anatomy="${name}"]`, value]);
855
855
  return entries.length ? Object.fromEntries(entries) : void 0;
856
856
  }
857
- function isModeConfig(value) {
858
- return "mode" in value && (value.mode === "extend" || value.mode === "replace") && "styles" in value;
859
- }
860
857
  //#endregion
861
858
  //#region src/component-overrides.ts
862
859
  function resolveComponentOverrides(defaults, overrides, disabledFooterPath) {
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../src/markdown/rehype-mermaid.ts","../src/markdown/rehype-table-scroll.ts","../src/theme/defaults.ts","../src/theme/index.ts","../src/theme/shiki-theme.ts","../src/theme/tasty-config.ts","../src/components/component-styles.ts","../src/component-overrides.ts","../src/components/tasty-states.js","../src/integration.ts"],"sourcesContent":["import { renderMermaidSVG } from \"beautiful-mermaid\";\n\ntype HastNode = {\n type: string;\n value?: string;\n tagName?: string;\n properties?: Record<string, unknown>;\n children?: HastNode[];\n};\n\ntype SatteriContext = {\n replaceNode(node: Readonly<HastNode>, replacement: HastNode): void;\n setProperty(node: Readonly<HastNode>, key: string, value: unknown): void;\n textContent(node: Readonly<HastNode>): string;\n};\n\nconst sourceStyleDirective = /^\\s*(?:classDef|style|linkStyle)\\s+.*$/gim;\nconst accessibilityDirective = /^\\s*acc(?:Title|Descr):\\s*.*$/gim;\nconst svgStyleBlock = /\\s*<style>[\\s\\S]*?<\\/style>\\s*/gi;\nconst supportedDiagram =\n /^(?:(?:flowchart|graph)(?:\\s+(?:TB|TD|BT|RL|LR))?|stateDiagram(?:-v2)?|sequenceDiagram|classDiagram|erDiagram)\\b/i;\n\n/** Render supported Mermaid fences to theme-responsive SVG at build time. */\nexport function rehypeMermaid() {\n return (tree: HastNode): void => {\n replaceMermaidCodeBlocks(tree);\n };\n}\n\n/** Sätteri adapter for Astro's default Markdown processor. */\nexport const satteriMermaid = {\n name: \"cookbook:mermaid\",\n element: {\n filter: [\"pre\"],\n visit(node: Readonly<HastNode>, context: SatteriContext): void {\n if (!isMermaidCodeBlock(node)) return;\n try {\n context.replaceNode(node, {\n type: \"raw\",\n value: renderMermaidElement(context.textContent(node)),\n });\n } catch {\n context.setProperty(node, \"data-mermaid-state\", \"error\");\n }\n },\n },\n};\n\nfunction replaceMermaidCodeBlocks(parent: HastNode): void {\n if (!parent.children) return;\n for (const [index, child] of parent.children.entries()) {\n if (isMermaidCodeBlock(child)) {\n const source = textContent(child);\n try {\n parent.children[index] = {\n type: \"raw\",\n value: renderMermaidElement(source),\n };\n } catch {\n child.properties = {\n ...child.properties,\n \"data-mermaid-state\": \"error\",\n };\n }\n continue;\n }\n replaceMermaidCodeBlocks(child);\n }\n}\n\nfunction renderMermaidElement(source: string): string {\n const svg = accessibleSvg(render(source), source);\n return `<div class=\"td-mermaid\" data-mermaid-state=\"ready\">${svg}</div>`;\n}\n\nfunction isMermaidCodeBlock(node: HastNode): boolean {\n if (node.type !== \"element\" || node.tagName !== \"pre\") return false;\n return (\n node.properties?.dataLanguage === \"mermaid\" ||\n node.properties?.[\"data-language\"] === \"mermaid\"\n );\n}\n\nfunction render(source: string): string {\n const header = source\n .split(\"\\n\")\n .map((line) => line.trim())\n .find(\n (line) =>\n line && !line.startsWith(\"%%\") && !/^acc(?:Title|Descr):/i.test(line),\n );\n if (!header || !supportedDiagram.test(header)) {\n throw new Error(\"Unsupported Mermaid diagram type\");\n }\n\n // Cookbook renders package Markdown too. Do not allow diagram-authored CSS\n // to escape the diagram's visual boundary; the site theme owns all colors.\n const safeSource = source\n .replace(sourceStyleDirective, \"\")\n .replace(accessibilityDirective, \"\");\n return renderMermaidSVG(safeSource, {\n bg: \"var(--surface-2-color)\",\n fg: \"var(--text-color)\",\n line: \"var(--text-soft-color)\",\n accent: \"var(--accent-text-color)\",\n muted: \"var(--text-soft-color)\",\n surface: \"var(--surface-color)\",\n border: \"var(--border-strong-color)\",\n font: \"Onest Variable\",\n transparent: true,\n }).replace(svgStyleBlock, \"\");\n}\n\nfunction accessibleSvg(svg: string, source: string): string {\n const title = directive(source, \"accTitle\") ?? \"Diagram\";\n const description =\n directive(source, \"accDescr\") ?? \"Rendered from a Mermaid code block.\";\n return svg\n .replace(\"<svg \", `<svg role=\"img\" aria-label=\"${escapeAttribute(title)}\" `)\n .replace(\n /(<svg\\b[^>]*>)/,\n `$1<title>${escapeText(title)}</title><desc>${escapeText(description)}</desc>`,\n );\n}\n\nfunction directive(source: string, name: string): string | undefined {\n const match = source.match(new RegExp(`^\\\\s*${name}:\\\\s*(.+)$`, \"im\"));\n return match?.[1]?.trim();\n}\n\nfunction textContent(node: HastNode): string {\n if (node.type === \"text\") return node.value ?? \"\";\n return node.children?.map(textContent).join(\"\") ?? \"\";\n}\n\nfunction escapeAttribute(value: string): string {\n return escapeText(value).replaceAll('\"', \"&quot;\").replaceAll(\"'\", \"&#39;\");\n}\n\nfunction escapeText(value: string): string {\n return value\n .replaceAll(\"&\", \"&amp;\")\n .replaceAll(\"<\", \"&lt;\")\n .replaceAll(\">\", \"&gt;\");\n}\n","type HastNode = {\n type: string;\n tagName?: string;\n properties?: Record<string, unknown>;\n children?: HastNode[];\n};\n\ntype SatteriContext = {\n replaceNode(node: Readonly<HastNode>, replacement: HastNode): void;\n};\n\nconst containerClass = \"td-table-scroll\";\n\n/** Wrap Markdown tables in a dedicated horizontal scroll container. */\nexport function rehypeTableScroll() {\n return (tree: HastNode): void => {\n wrapTables(tree);\n };\n}\n\n/** Sätteri adapter for Astro's default Markdown processor. */\nexport const satteriTableScroll = {\n name: \"cookbook:table-scroll\",\n element: {\n filter: [\"table\"],\n visit(node: Readonly<HastNode>, context: SatteriContext): void {\n context.replaceNode(node, scrollContainer(node as HastNode));\n },\n },\n};\n\nfunction wrapTables(parent: HastNode): void {\n if (!parent.children || isScrollContainer(parent)) return;\n for (const [index, child] of parent.children.entries()) {\n if (child.type === \"element\" && child.tagName === \"table\") {\n parent.children[index] = scrollContainer(child);\n continue;\n }\n wrapTables(child);\n }\n}\n\nfunction scrollContainer(table: HastNode): HastNode {\n return {\n type: \"element\",\n tagName: \"div\",\n properties: { className: [containerClass] },\n children: [table],\n };\n}\n\nfunction isScrollContainer(node: HastNode): boolean {\n const className = node.properties?.className;\n return (\n node.type === \"element\" &&\n node.tagName === \"div\" &&\n Array.isArray(className) &&\n className.includes(containerClass)\n );\n}\n","import type {\n ThemeTokens,\n TypographyPreset,\n TypographyPresets,\n} from \"@tenphi/docs\";\n\nexport const DEFAULT_THEME_TOKENS = {\n $gap: \"0.5rem\",\n $radius: \"6px\",\n \"$card-radius\": \"10px\",\n \"$border-width\": \"1px\",\n \"$outline-width\": \"2px\",\n \"$outline-offset\": \"2px\",\n \"$layout-width\": \"87.5rem\",\n \"$content-width\": \"58rem\",\n \"$sidebar-width\": \"17.5rem\",\n \"$control-height\": \"2.5rem\",\n} satisfies ThemeTokens;\n\nconst BODY_FONT =\n \"'Onest Variable', Onest, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif\";\nconst MONO_FONT =\n \"'JetBrains Mono Variable', 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace\";\n\nexport const DEFAULT_TYPOGRAPHY_PRESETS: Record<string, TypographyPreset> = {\n body: {\n fontFamily: BODY_FONT,\n fontSize: \"1rem\",\n lineHeight: 1.65,\n letterSpacing: \"-0.006em\",\n fontWeight: 420,\n boldFontWeight: 640,\n },\n heading: {\n fontFamily: BODY_FONT,\n fontSize: \"1rem\",\n lineHeight: 1.15,\n letterSpacing: \"-0.025em\",\n fontWeight: 640,\n boldFontWeight: 720,\n },\n h1: heading(\"clamp(2.5rem, 5vw, 3.25rem)\", 1.05, \"-0.045em\"),\n h2: heading(\"clamp(1.75rem, 3vw, 2.125rem)\", 1.1, \"-0.035em\"),\n h3: heading(\"1.5rem\", 1.15, \"-0.025em\"),\n h4: heading(\"1.25rem\", 1.2, \"-0.018em\"),\n h5: heading(\"1.125rem\", 1.25, \"-0.012em\"),\n h6: heading(\"1rem\", 1.3, \"-0.006em\"),\n navigation: {\n fontFamily: \"var(--body-font-family)\",\n fontSize: \"0.9375rem\",\n lineHeight: 1.4,\n letterSpacing: \"-0.006em\",\n fontWeight: 540,\n boldFontWeight: 650,\n },\n small: {\n fontFamily: \"var(--body-font-family)\",\n fontSize: \"0.875rem\",\n lineHeight: 1.45,\n letterSpacing: \"-0.002em\",\n fontWeight: 420,\n boldFontWeight: 650,\n },\n code: {\n fontFamily: MONO_FONT,\n fontSize: \"0.875rem\",\n lineHeight: 1.65,\n letterSpacing: \"0\",\n fontWeight: 400,\n boldFontWeight: 650,\n },\n};\n\nexport function resolveThemeTokens(tokens: ThemeTokens = {}): ThemeTokens {\n return { ...DEFAULT_THEME_TOKENS, ...tokens };\n}\n\nexport function resolveTypographyPresets(\n presets: TypographyPresets = {},\n): Record<string, TypographyPreset> {\n const body = DEFAULT_TYPOGRAPHY_PRESETS.body;\n if (!body) throw new Error(\"The body typography preset is required.\");\n const names = new Set([\n ...Object.keys(DEFAULT_TYPOGRAPHY_PRESETS),\n ...Object.keys(presets),\n ]);\n return Object.fromEntries(\n [...names].map((name) => [\n name,\n {\n ...(DEFAULT_TYPOGRAPHY_PRESETS[name] ?? body),\n ...(presets[name] ?? {}),\n },\n ]),\n );\n}\n\nfunction heading(\n fontSize: string,\n lineHeight: number,\n letterSpacing: string,\n): TypographyPreset {\n return {\n fontFamily: \"var(--heading-font-family)\",\n fontSize,\n lineHeight,\n letterSpacing,\n fontWeight: \"var(--heading-font-weight)\",\n boldFontWeight: \"var(--heading-bold-font-weight)\",\n };\n}\n","import {\n apcaContrast,\n glaze,\n okhslToLinearSrgb,\n relativeLuminanceFromLinearRgb,\n variantToOkhsl,\n type ColorMap,\n type GlazeColorValue,\n type ResolvedColorVariant,\n} from \"@tenphi/glaze\";\nimport type {\n BrandConfig,\n DocsDiagnostic,\n ThemeConfig,\n ThemeTokens,\n TypographyPreset,\n} from \"@tenphi/docs\";\nimport { resolveThemeTokens, resolveTypographyPresets } from \"./defaults.js\";\n\nexport interface ResolvedDocsTheme {\n colors: {\n surface: Record<string, string>;\n surface2: Record<string, string>;\n surface3: Record<string, string>;\n text: Record<string, string>;\n textSoft: Record<string, string>;\n accentText: Record<string, string>;\n accentSurface: Record<string, string>;\n accentSurfaceText: Record<string, string>;\n focus: Record<string, string>;\n shadow: Record<string, string>;\n };\n /** Glaze-generated Tasty color tokens, including interaction and status roles. */\n colorTokens: Record<string, Record<string, string>>;\n tokens: ThemeTokens;\n presets: Record<string, TypographyPreset>;\n contrast: {\n light: number;\n dark: number;\n lightContrast: number;\n darkContrast: number;\n };\n diagnostics: DocsDiagnostic[];\n}\n\nexport function resolveDocsTheme(theme: ThemeConfig = {}): ResolvedDocsTheme {\n const brand = normalizeBrand(theme.brand);\n const authoredTarget = brand.contrast?.apca ?? 45;\n const normalTarget = Array.isArray(authoredTarget)\n ? authoredTarget[0]\n : authoredTarget;\n const highTarget = Array.isArray(authoredTarget)\n ? authoredTarget[1]\n : normalTarget + 15;\n const glazeOptions = {\n autoFlip: true,\n ...(theme.contrastLevel !== undefined\n ? { contrastLevel: theme.contrastLevel }\n : {}),\n } as const;\n const surfaceFrom = theme.palette?.surface ?? \"#ffffff\";\n const surfaceSeed = glaze.color({\n from: surfaceFrom,\n mode: \"auto\",\n // Near-white brand surfaces can carry a numerically large OKHSL\n // saturation that becomes vivid as the ramp moves away from white. Reduce\n // saturation along the light ramp and keep dark chrome nearly neutral.\n darkSaturation: 0.35,\n });\n const resolvedSurfaceSeed = surfaceSeed.resolve();\n const lightSurface = variantToOkhsl(resolvedSurfaceSeed.light);\n const darkSurface = variantToOkhsl(resolvedSurfaceSeed.dark);\n const colorTheme = glaze(\n {\n hue: lightSurface.h,\n saturation: lightSurface.s * 100,\n darkHue: darkSurface.h,\n // The surface definition applies its 0.35 factor again. Normalize the\n // seed so dependent dark colors retain the authored surface chroma.\n darkSaturation: Math.min(100, (darkSurface.s * 100) / 0.35),\n },\n undefined,\n glazeOptions,\n );\n colorTheme.colors({\n surface: {\n from: surfaceFrom,\n mode: \"auto\",\n darkSaturation: 0.35,\n },\n \"surface-2\": {\n base: \"surface\",\n tone: \"-2\",\n mode: \"auto\",\n saturation: 0.75,\n darkSaturation: 0.275,\n },\n \"surface-3\": {\n base: \"surface-2\",\n tone: \"-2\",\n mode: \"auto\",\n saturation: 0.65,\n darkSaturation: 0.25,\n },\n text: {\n from: theme.palette?.text ?? \"#20232a\",\n base: \"surface\",\n role: \"text\",\n contrast: { apca: [75, 90] },\n mode: \"auto\",\n },\n \"text-soft\": {\n from: theme.palette?.textSoft ?? \"#626875\",\n base: \"surface\",\n role: \"text\",\n contrast: { apca: [60, 75] },\n mode: \"auto\",\n },\n \"text-muted\": mix(\"surface\", \"text\", 66),\n \"surface-2-hover\": mix(\"surface-2\", \"text\", [3, 6]),\n \"surface-2-pressed\": mix(\"surface-2\", \"text\", [9, 14]),\n \"surface-3-hover\": mix(\"surface-3\", \"text\", [3, 6]),\n \"surface-3-pressed\": mix(\"surface-3\", \"text\", [9, 14]),\n \"accent-text\": {\n from: brand.from,\n base: \"surface\",\n role: \"text\",\n contrast: { apca: [normalTarget, highTarget] },\n mode: \"auto\",\n },\n focus: {\n from: brand.from,\n base: \"surface\",\n role: \"border\",\n contrast: { apca: [normalTarget, highTarget] },\n mode: \"auto\",\n },\n \"accent-surface\": { from: brand.from, mode: \"fixed\" },\n \"accent-surface-text\": {\n from: \"#ffffff\",\n base: \"accent-surface\",\n role: \"text\",\n contrast: { apca: [60, 75] },\n mode: \"auto\",\n },\n \"accent-surface-subtle\": mix(\"surface\", \"accent-surface\", [12, 18]),\n \"accent-surface-2-subtle\": mix(\"surface-2\", \"accent-surface\", [12, 18]),\n shadow: {\n type: \"shadow\",\n bg: \"surface\",\n fg: \"text\",\n intensity: [12, 20],\n tuning: { alphaMax: 0.28 },\n },\n overlay: {\n type: \"mix\",\n base: \"surface\",\n target: \"text\",\n value: [58, 68],\n blend: \"transparent\",\n },\n clear: { from: \"#ffffff\", mode: \"fixed\", opacity: 0 },\n ...statusColors(\"orange\", \"#d97706\"),\n ...statusColors(\"green\", \"#16a34a\"),\n ...statusColors(\"blue\", \"#2563eb\"),\n ...statusColors(\"purple\", \"#9333ea\"),\n ...statusColors(\"red\", \"#dc2626\"),\n } satisfies ColorMap);\n\n const resolvedBrandSeed = glaze\n .color({ from: brand.from, mode: \"fixed\" })\n .resolve();\n const lightBrand = variantToOkhsl(resolvedBrandSeed.light);\n const darkBrand = variantToOkhsl(resolvedBrandSeed.dark);\n const borderTheme = glaze(\n {\n hue: lightBrand.h,\n saturation: lightBrand.s * 100,\n darkHue: darkBrand.h,\n darkSaturation: darkBrand.s * 100,\n },\n undefined,\n glazeOptions,\n );\n borderTheme.colors({\n surface: {\n from: surfaceFrom,\n mode: \"auto\",\n darkSaturation: 0.35,\n },\n border: {\n base: \"surface\",\n tone: [\"-9\", \"-22\"],\n saturation: 0.205,\n mode: \"auto\",\n },\n \"border-strong\": {\n base: \"surface\",\n tone: [\"-20\", \"-38\"],\n saturation: 0.205,\n mode: \"auto\",\n },\n } satisfies ColorMap);\n\n // Syntax colors are intentionally resolved as their own Glaze palette.\n // This keeps code semantics vivid enough to scan without coupling them to\n // either the product brand ramp or the deliberately restrained UI chrome.\n const syntaxTheme = glaze(210, 90, glazeOptions);\n syntaxTheme.colors({\n bg: { tone: 100, saturation: 0.1 },\n text: {\n base: \"bg\",\n tone: 0,\n contrast: { wcag: [\"AA\", \"AAA\"] },\n saturation: 0,\n },\n comment: {\n base: \"bg\",\n contrast: { wcag: [\"AA\", \"AAA\"] },\n saturation: 0.01,\n hue: 210,\n },\n punctuation: {\n base: \"bg\",\n contrast: { wcag: [6, \"AAA\"] },\n saturation: 0.01,\n hue: 210,\n },\n keyword: {\n base: \"bg\",\n contrast: { wcag: [\"AA\", \"AAA\"] },\n saturation: 80,\n },\n string: {\n base: \"bg\",\n contrast: { wcag: [\"AA\", \"AAA\"] },\n saturation: 80,\n hue: 40,\n },\n token: {\n base: \"bg\",\n contrast: { wcag: [\"AA\", \"AAA\"] },\n saturation: 80,\n hue: 125,\n },\n property: {\n base: \"bg\",\n contrast: { wcag: [\"AA\", \"AAA\"] },\n saturation: 80,\n hue: 155,\n },\n number: {\n base: \"bg\",\n contrast: { wcag: [\"AA\", \"AAA\"] },\n saturation: 80,\n hue: 70,\n },\n function: {\n base: \"bg\",\n contrast: { wcag: [\"AA\", \"AAA\"] },\n saturation: 80,\n hue: 210,\n },\n value: {\n base: \"bg\",\n contrast: { wcag: [\"AA\", \"AAA\"] },\n saturation: 80,\n hue: 210,\n },\n operator: {\n base: \"bg\",\n contrast: { wcag: [\"AA\", \"AAA\"] },\n saturation: 80,\n hue: 340,\n },\n } satisfies ColorMap);\n\n const resolvedColors = colorTheme.resolve();\n const resolvedSurface = requiredResolvedColor(resolvedColors, \"surface\");\n const resolvedAccent = requiredResolvedColor(resolvedColors, \"accent-text\");\n\n const scores = {\n light: score(resolvedAccent.light, resolvedSurface.light),\n dark: score(resolvedAccent.dark, resolvedSurface.dark),\n lightContrast: score(\n resolvedAccent.lightContrast,\n resolvedSurface.lightContrast,\n ),\n darkContrast: score(\n resolvedAccent.darkContrast,\n resolvedSurface.darkContrast,\n ),\n };\n const diagnostics: DocsDiagnostic[] = [];\n for (const [scheme, measured] of Object.entries(scores)) {\n const required = scheme.includes(\"Contrast\") ? highTarget : normalTarget;\n if (measured + 0.05 < required) {\n diagnostics.push({\n code: \"DOCS_BRAND_CONTRAST_UNMET\",\n severity: \"error\",\n message: `Brand contrast in ${scheme} is Lc ${measured.toFixed(1)}; required Lc ${required}.`,\n hint: `Authored color: ${String(brand.from)}.`,\n });\n }\n }\n const outputOptions = { modes: { highContrast: true } } as const;\n const tastyOptions = {\n ...outputOptions,\n states: {\n dark: \"theme=dark | (@media(prefers-color-scheme: dark) & :not([data-theme]))\",\n highContrast:\n \"contrast=more | (@media(prefers-contrast: more) & :not([data-contrast]))\",\n },\n } as const;\n const resolvedPalette = colorTheme.json(outputOptions);\n const colorTokens = colorTheme.tasty(tastyOptions);\n const borderTokens = borderTheme.tasty(tastyOptions);\n const syntaxTokens = glaze.palette({ syntax: syntaxTheme }).tasty({\n ...tastyOptions,\n prefix: true,\n primary: false,\n });\n const colors = {\n surface: requiredJsonColor(resolvedPalette, \"surface\"),\n surface2: requiredJsonColor(resolvedPalette, \"surface-2\"),\n surface3: requiredJsonColor(resolvedPalette, \"surface-3\"),\n text: requiredJsonColor(resolvedPalette, \"text\"),\n textSoft: requiredJsonColor(resolvedPalette, \"text-soft\"),\n accentText: requiredJsonColor(resolvedPalette, \"accent-text\"),\n accentSurface: requiredJsonColor(resolvedPalette, \"accent-surface\"),\n accentSurfaceText: requiredJsonColor(\n resolvedPalette,\n \"accent-surface-text\",\n ),\n focus: requiredJsonColor(resolvedPalette, \"focus\"),\n shadow: requiredJsonColor(resolvedPalette, \"shadow\"),\n };\n return {\n colors,\n colorTokens: {\n ...colorTokens,\n \"#border\": requiredJsonColor(borderTokens, \"#border\"),\n \"#border-strong\": requiredJsonColor(borderTokens, \"#border-strong\"),\n ...syntaxTokens,\n },\n tokens: resolveThemeTokens(theme.tokens),\n presets: resolveTypographyPresets(theme.presets),\n contrast: scores,\n diagnostics,\n };\n}\n\nfunction mix(\n base: string,\n target: string,\n value: number | [number, number],\n space: \"okhsl\" | \"srgb\" = \"okhsl\",\n): ColorMap[string] {\n return { type: \"mix\", base, target, value, space };\n}\n\nfunction statusColors(name: string, from: GlazeColorValue): ColorMap {\n return {\n [name]: {\n from,\n base: \"surface\",\n role: \"border\",\n contrast: { apca: [30, 45] },\n mode: \"auto\",\n },\n [`${name}-text`]: {\n from,\n base: \"surface\",\n role: \"text\",\n contrast: { apca: [60, 75] },\n mode: \"auto\",\n },\n [`${name}-surface`]: mix(\"surface\", name, [12, 18], \"srgb\"),\n };\n}\n\nfunction requiredResolvedColor(\n colors: ReturnType<ReturnType<typeof glaze>[\"resolve\"]>,\n name: string,\n) {\n const color = colors.get(name);\n if (!color) throw new Error(`The Glaze ${name} color failed to resolve.`);\n return color;\n}\n\nfunction requiredJsonColor(\n colors: Record<string, Record<string, string>>,\n name: string,\n): Record<string, string> {\n const color = colors[name];\n if (!color) throw new Error(`The Glaze ${name} token failed to export.`);\n return color;\n}\n\nfunction normalizeBrand(\n brand: BrandConfig | undefined,\n): Exclude<BrandConfig, GlazeColorValue> & { from: GlazeColorValue } {\n if (typeof brand === \"object\" && brand !== null && \"from\" in brand)\n return brand;\n return { from: brand ?? \"#315efb\" };\n}\n\nfunction score(\n foreground: ResolvedColorVariant,\n background: ResolvedColorVariant,\n): number {\n return Math.abs(apcaContrast(luminance(foreground), luminance(background)));\n}\n\nfunction luminance(variant: ResolvedColorVariant): number {\n const { h, s, l } = variantToOkhsl(variant);\n return relativeLuminanceFromLinearRgb(\n okhslToLinearSrgb(h, s, l, variant.pastel),\n );\n}\n","const comment = \"var(--syntax-comment-color)\";\nconst punctuation = \"var(--syntax-punctuation-color)\";\nconst keyword = \"var(--syntax-keyword-color)\";\nconst string = \"var(--syntax-string-color)\";\nconst token = \"var(--syntax-token-color)\";\nconst property = \"var(--syntax-property-color)\";\nconst number = \"var(--syntax-number-color)\";\nconst func = \"var(--syntax-function-color)\";\nconst value = \"var(--syntax-value-color)\";\nconst operator = \"var(--syntax-operator-color)\";\nconst foreground = \"var(--syntax-text-color)\";\nconst background = \"var(--syntax-bg-color)\";\nconst inserted = \"var(--green-text-color)\";\nconst deleted = \"var(--red-text-color)\";\n\ntype HighlightToken = {\n content: string;\n offset: number;\n color?: string;\n};\n\nconst shellLanguages = new Set([\"bash\", \"sh\", \"shell\", \"shellscript\", \"zsh\"]);\nconst shellPlaceholder = /<[A-Za-z][A-Za-z0-9_-]*>/g;\n\n/**\n * Shell grammars interpret documentation placeholders such as `<plan-id>` as\n * redirections and can split the final character into an unscoped token. Keep\n * the placeholder name visually coherent while retaining the operator color\n * on the angle brackets.\n */\nconst bashPlaceholderTransformer = {\n name: \"cookbook:bash-placeholders\",\n enforce: \"post\" as const,\n tokens(\n this: { source: string; options: { lang?: string } },\n lines: HighlightToken[][],\n ): HighlightToken[][] | undefined {\n if (!this.options.lang || !shellLanguages.has(this.options.lang)) return;\n const ranges = [...this.source.matchAll(shellPlaceholder)].map((match) => ({\n start: (match.index ?? 0) + 1,\n end: (match.index ?? 0) + match[0].length - 1,\n }));\n if (ranges.length === 0) return;\n\n for (const line of lines) {\n for (const highlighted of line) {\n const start = highlighted.offset;\n const end = start + highlighted.content.length;\n if (ranges.some((range) => start < range.end && end > range.start)) {\n highlighted.color = string;\n }\n }\n }\n return lines;\n },\n};\n\ntype HastElement = {\n properties: Record<string, unknown>;\n};\n\ntype DiffTransformerContext = {\n source: string;\n options: { lang?: string };\n addClassToHast(element: HastElement, className: string): HastElement;\n};\n\nconst diffLanguages = new Set([\"diff\", \"patch\"]);\n\n/**\n * The diff grammar colors individual tokens, but it does not expose a stable\n * whole-line selector. Add semantic classes so insertions and deletions can\n * receive subtle, full-width surfaces without hiding their +/- markers.\n */\nconst diffLineTransformer = {\n name: \"cookbook:diff-lines\",\n pre(this: DiffTransformerContext, element: HastElement): void {\n if (this.options.lang && diffLanguages.has(this.options.lang)) {\n this.addClassToHast(element, \"td-diff\");\n }\n },\n line(\n this: DiffTransformerContext,\n element: HastElement,\n lineNumber: number,\n ): void {\n if (!this.options.lang || !diffLanguages.has(this.options.lang)) return;\n\n const line = this.source.split(/\\r?\\n/)[lineNumber - 1] ?? \"\";\n if (line.startsWith(\"+\") && !line.startsWith(\"+++\")) {\n this.addClassToHast(element, \"td-diff-line--inserted\");\n } else if (line.startsWith(\"-\") && !line.startsWith(\"---\")) {\n this.addClassToHast(element, \"td-diff-line--deleted\");\n }\n },\n};\n\n/**\n * Astro loads fenced-code grammars lazily. MDX embeds TSX, but loading MDX by\n * itself leaves that embedded grammar unavailable and produces partially\n * highlighted imports and JSX. Preload TSX while preserving consumer-supplied\n * languages and transformers.\n */\nexport function cookbookShikiConfig(\n config: Record<string, unknown> | undefined,\n): Record<string, unknown> {\n const languages = Array.isArray(config?.langs) ? [...config.langs] : [];\n const transformers = Array.isArray(config?.transformers)\n ? [...config.transformers]\n : [];\n const hasTsx = languages.some(\n (language) =>\n language === \"tsx\" ||\n (typeof language === \"object\" &&\n language !== null &&\n \"name\" in language &&\n language.name === \"tsx\"),\n );\n\n if (!transformers.includes(bashPlaceholderTransformer)) {\n transformers.push(bashPlaceholderTransformer);\n }\n if (!transformers.includes(diffLineTransformer)) {\n transformers.push(diffLineTransformer);\n }\n\n return {\n ...config,\n langs: hasTsx ? languages : [...languages, \"tsx\"],\n theme: tastyCodeTheme,\n transformers,\n };\n}\n\n/**\n * Shiki performs the grammatical classification, while every emitted color\n * remains a reference to a Glaze-generated token owned by Tasty.\n */\nconst tastyCodeTheme = {\n name: \"tasty-code\",\n type: \"light\" as const,\n fg: foreground,\n bg: background,\n colors: {\n \"editor.background\": background,\n \"editor.foreground\": foreground,\n },\n settings: [\n {\n scope: [\n \"comment\",\n \"comment.line\",\n \"comment.block\",\n \"punctuation.definition.comment\",\n ],\n settings: { foreground: comment, fontStyle: \"italic\" },\n },\n {\n scope: [\n \"keyword\",\n \"keyword.control\",\n \"keyword.other\",\n \"storage.type\",\n \"storage.modifier\",\n \"keyword.control.at-rule.tasty\",\n \"keyword.control.at-rule.media.tasty\",\n \"keyword.control.at-rule.media-type.tasty\",\n \"keyword.control.at-rule.starting.tasty\",\n \"keyword.control.state-alias.tasty\",\n ],\n settings: { foreground: keyword },\n },\n {\n scope: [\n \"string\",\n \"string.quoted\",\n \"string.template\",\n \"string.quoted.attribute-value.tasty\",\n \"string.unquoted.attribute-value.tasty\",\n ],\n settings: { foreground: string },\n },\n {\n scope: [\n \"support.constant.color.tasty-token\",\n \"support.constant.color.tasty-token.builtin\",\n \"constant.other.color.tasty-token\",\n \"constant.other.color.tasty\",\n \"constant.other.color.hex\",\n \"constant.other.color.rgb-value\",\n ],\n settings: { foreground: token },\n },\n {\n scope: [\n \"constant.numeric\",\n \"constant.numeric.tasty\",\n \"constant.numeric.custom-unit.tasty\",\n \"constant.numeric.css-with-unit\",\n \"constant.numeric.bare.tasty\",\n \"constant.numeric.css\",\n \"constant.numeric.keyframe-step.tasty\",\n \"constant.language.boolean.tasty\",\n ],\n settings: { foreground: number },\n },\n {\n scope: [\n \"support.type.property-name.tasty\",\n \"variable.other.constant.tasty\",\n \"entity.other.attribute-name.tsx\",\n \"entity.other.attribute-name.jsx\",\n ],\n settings: { foreground: property },\n },\n {\n scope: [\"variable\", \"variable.other\"],\n settings: { foreground },\n },\n {\n scope: [\n \"entity.name.function\",\n \"support.function\",\n \"support.function.misc.css\",\n \"entity.name.tag\",\n \"entity.name.tag.tsx\",\n \"support.class.component\",\n \"entity.name.type.tasty\",\n \"entity.name.tag.tasty\",\n ],\n settings: { foreground: func },\n },\n {\n scope: [\n \"support.constant.property-value.tasty\",\n \"support.constant.property-value.tasty-display\",\n \"support.constant.property-value.tasty-directional\",\n \"support.constant.property-value.tasty-preset\",\n \"support.constant.property-value.tasty-shape\",\n \"support.constant.property-value.tasty-scrollbar\",\n \"support.constant.property-value.tasty-state\",\n \"support.constant.property-value.tasty-cursor\",\n \"support.constant.property-value.tasty-overflow\",\n \"support.constant.property-value.tasty-position\",\n \"support.constant.property-value.tasty-flex\",\n \"support.constant.property-value.tasty-font\",\n \"support.constant.property-value.tasty-text\",\n \"support.constant.property-value.tasty-alignment\",\n \"support.constant.property-value.tasty-border-style\",\n \"support.constant.property-value.tasty-whitespace\",\n \"support.constant.property-value.tasty-global\",\n \"support.constant.property-value.tasty-transition\",\n \"support.constant.property-value.css-syntax\",\n \"entity.other.attribute-name\",\n \"entity.other.attribute-name.tasty\",\n \"entity.other.attribute-name.pseudo-class.tasty\",\n \"entity.other.attribute-name.pseudo-class.css\",\n \"entity.other.attribute-name.class.tasty\",\n \"entity.other.attribute-name.pseudo-element.css\",\n \"punctuation.definition.entity.css\",\n ],\n settings: { foreground: value },\n },\n {\n scope: [\n \"keyword.operator\",\n \"keyword.operator.logical.tasty\",\n \"keyword.operator.arithmetic.css\",\n \"keyword.operator.assignment\",\n \"keyword.operator.selector-affix.tasty\",\n \"keyword.operator.attribute-selector.tasty\",\n \"keyword.operator.comparison.tasty\",\n ],\n settings: { foreground: operator },\n },\n {\n scope: [\n \"punctuation.definition.string\",\n \"punctuation.separator\",\n \"punctuation.definition.block\",\n \"punctuation.definition.array\",\n \"punctuation.section\",\n \"punctuation.definition.auto-calc\",\n \"punctuation.definition.attribute-selector\",\n \"punctuation.definition.tag\",\n \"punctuation.definition.pseudo-class\",\n \"punctuation.definition.fallback\",\n \"meta.brace\",\n ],\n settings: { foreground: punctuation },\n },\n {\n scope: [\"keyword.control.at-rule\", \"entity.name.tag.class.css\"],\n settings: { foreground: keyword },\n },\n {\n scope: [\"support.type.property-name.css\", \"meta.property-name.css\"],\n settings: { foreground: property },\n },\n {\n scope: [\"punctuation.definition.inserted.diff\"],\n settings: { foreground: inserted, fontStyle: \"bold\" },\n },\n {\n scope: [\"punctuation.definition.deleted.diff\"],\n settings: { foreground: deleted, fontStyle: \"bold\" },\n },\n ],\n};\n","import type { ConfigTokens } from \"@tenphi/tasty/core\";\nimport type { ResolvedDocsTheme } from \"./index.js\";\n\nexport const TASTY_UNITS = {\n x: \"var(--gap)\",\n r: \"var(--radius)\",\n cr: \"var(--card-radius)\",\n bw: \"var(--border-width)\",\n} as const;\n\nexport function tastyTokens(theme: ResolvedDocsTheme): ConfigTokens {\n const tokens = Object.fromEntries(\n Object.entries(theme.tokens).filter(([name]) => name.startsWith(\"$\")),\n ) as ConfigTokens;\n\n Object.assign(tokens, theme.colorTokens as ConfigTokens);\n\n return tokens;\n}\n","import { mergeStyles, type Styles } from \"@tenphi/tasty/core\";\nimport {\n COOKBOOK_COMPONENT_NAMES,\n type ComponentStyleConfig,\n type ComponentStylesConfig,\n type CookbookComponentName,\n} from \"@tenphi/docs\";\n\n// Astro can load the integration and renderer through separate module graphs.\n// Keep their component configuration on the shared process global.\nconst sharedConfiguration = globalThis as typeof globalThis & {\n __tenphiCookbookComponentStyles?: ComponentStylesConfig;\n};\nconst cookbookComponentNames = new Set<string>(COOKBOOK_COMPONENT_NAMES);\n\nexport function configureComponentStyles(\n styles: ComponentStylesConfig | undefined,\n): void {\n sharedConfiguration.__tenphiCookbookComponentStyles = styles ?? {};\n}\n\nexport function resolveComponentStyles(\n name: CookbookComponentName,\n defaults: Styles,\n): Styles {\n const configured = sharedConfiguration.__tenphiCookbookComponentStyles?.[\n name\n ] as ComponentStyleConfig | undefined;\n if (!configured) return defaults;\n if (isModeConfig(configured)) {\n const styles = configured.styles as Styles;\n return configured.mode === \"replace\"\n ? styles\n : mergeStyles(defaults, styles);\n }\n return mergeStyles(defaults, configured as Styles);\n}\n\nexport function resolveComponentStyleOverride(\n name: CookbookComponentName,\n): { mode: \"extend\" | \"replace\"; styles: Styles } | undefined {\n const configured = sharedConfiguration.__tenphiCookbookComponentStyles?.[\n name\n ] as ComponentStyleConfig | undefined;\n if (!configured) return undefined;\n if (isModeConfig(configured)) {\n return { mode: configured.mode, styles: configured.styles as Styles };\n }\n return { mode: \"extend\", styles: configured as Styles };\n}\n\n/** Preserve custom anatomy names from the pre-component style API. */\nexport function resolveLegacyAnatomyStyles(\n styles: ComponentStylesConfig | undefined,\n): Record<string, Styles> | undefined {\n if (!styles) return undefined;\n const entries = Object.entries(styles)\n .filter(\n (entry): entry is [string, ComponentStyleConfig] =>\n !cookbookComponentNames.has(entry[0]) && entry[1] !== undefined,\n )\n .map(([name, value]) => [\n `[data-tasty-anatomy=\"${name}\"]`,\n isModeConfig(value) ? value.styles : value,\n ]);\n return entries.length\n ? (Object.fromEntries(entries) as Record<string, Styles>)\n : undefined;\n}\n\nfunction isModeConfig(\n value: ComponentStyleConfig,\n): value is Extract<ComponentStyleConfig, { mode: string }> {\n return (\n \"mode\" in value &&\n (value.mode === \"extend\" || value.mode === \"replace\") &&\n \"styles\" in value\n );\n}\n","export function resolveComponentOverrides(\n defaults: Record<string, string>,\n overrides: Record<string, string | false> | undefined,\n disabledFooterPath: string,\n): Record<string, string> {\n const resolved = { ...defaults };\n\n for (const [name, override] of Object.entries(overrides ?? {})) {\n if (name === \"Footer\" && override === false) {\n resolved.Footer = disabledFooterPath;\n } else if (typeof override === \"string\") {\n resolved[name] = override;\n }\n }\n\n return resolved;\n}\n","import { configure } from \"@tenphi/tasty\";\n\nexport const cookbookStates = {\n \"@mobile\": \"@media(w < 50rem)\",\n \"@desktop\": \"@media(w >= 50rem)\",\n \"@small\": \"@media(w <= 40rem)\",\n \"@shell-mobile\": \"@media(w <= 48rem)\",\n \"@shell-desktop\": \"@media(w > 48rem)\",\n \"@narrow-layout\": \"@media(w < 72rem)\",\n \"@medium-layout\": \"@media(w >= 50rem) & @media(w < 72rem)\",\n \"@reduced-motion\": \"@media(prefers-reduced-motion: reduce)\",\n};\n\nlet configured = false;\n\n/** Configure aliases in the renderer's Tasty module before styles are parsed. */\nexport function configureCookbookStates() {\n if (configured) return;\n configure({ states: cookbookStates });\n configured = true;\n}\n","import { existsSync } from \"node:fs\";\nimport {\n cp,\n mkdir,\n readFile,\n readdir,\n unlink,\n writeFile,\n} from \"node:fs/promises\";\nimport { createRequire } from \"node:module\";\nimport { dirname, extname, join } from \"node:path\";\nimport { fileURLToPath, pathToFileURL } from \"node:url\";\nimport starlight from \"./starlight-runtime.js\";\nimport {\n createDocsGraph,\n assertValidDocs,\n type DocsConfig,\n type NavigationItem,\n} from \"@tenphi/docs\";\nimport {\n configure,\n type ConfigTokens,\n type Styles,\n type TypographyPreset,\n} from \"@tenphi/tasty/core\";\nimport { tastyIntegration } from \"@tenphi/tasty/ssr/astro\";\nimport type { AstroIntegration, HookParameters } from \"astro\";\nimport {\n resolveNavigationLayout,\n type ResolvedNavigationLayout,\n} from \"./navigation.js\";\nimport { rehypeMermaid, satteriMermaid } from \"./markdown/rehype-mermaid.js\";\nimport {\n rehypeTableScroll,\n satteriTableScroll,\n} from \"./markdown/rehype-table-scroll.js\";\nimport { resolveDocsTheme } from \"./theme/index.js\";\nimport { cookbookShikiConfig } from \"./theme/shiki-theme.js\";\nimport { TASTY_UNITS, tastyTokens } from \"./theme/tasty-config.js\";\nimport {\n configureComponentStyles,\n resolveLegacyAnatomyStyles,\n} from \"./components/component-styles.js\";\nimport { resolveComponentOverrides } from \"./component-overrides.js\";\nimport { cookbookStates } from \"./components/tasty-states.js\";\n\nconst packageRequire = createRequire(import.meta.url);\nconst starlightRoot = dirname(packageRequire.resolve(\"@astrojs/starlight\"));\nconst tastyStaticMiddleware = packageRequire.resolve(\n \"@tenphi/tasty/ssr/astro-middleware-static\",\n);\nconst tastyExtractStaticMiddleware = packageRequire.resolve(\n \"@tenphi/tasty/ssr/astro-middleware-extract-static\",\n);\nconst astroReactServer = packageRequire.resolve(\"@astrojs/react/server.js\");\nconst astroReactClient = packageRequire.resolve(\"@astrojs/react/client.js\");\nconst astroReactIntegration = packageRequire.resolve(\"@astrojs/react\");\nconst importNative = new Function(\"specifier\", \"return import(specifier)\") as (\n specifier: string,\n) => Promise<{ default: () => AstroIntegration }>;\n\nexport interface CookbookOptions {\n config?: DocsConfig;\n root?: string;\n}\n\nexport default function cookbook(\n options: CookbookOptions = {},\n): AstroIntegration {\n const docsTheme = resolveDocsTheme(options.config?.theme);\n if (\n docsTheme.diagnostics.some((diagnostic) => diagnostic.severity === \"error\")\n ) {\n throw new Error(\n docsTheme.diagnostics.map((diagnostic) => diagnostic.message).join(\"\\n\"),\n );\n }\n configureTastyTheme(options.config?.theme, docsTheme);\n configureComponentStyles(options.config?.theme?.styles);\n const headerPath = fileURLToPath(\n new URL(\"./overrides/Header.astro\", import.meta.url),\n );\n const footerPath = fileURLToPath(\n new URL(\"./overrides/Footer.astro\", import.meta.url),\n );\n const emptyFooterPath = fileURLToPath(\n new URL(\"./overrides/EmptyFooter.astro\", import.meta.url),\n );\n const sidebarPath = fileURLToPath(\n new URL(\"./overrides/Sidebar.astro\", import.meta.url),\n );\n const mobileMenuFooterPath = fileURLToPath(\n new URL(\"./overrides/MobileMenuFooter.astro\", import.meta.url),\n );\n const mobileMenuTogglePath = fileURLToPath(\n new URL(\"./overrides/MobileMenuToggle.astro\", import.meta.url),\n );\n const themeSelectPath = fileURLToPath(\n new URL(\"./overrides/ThemeSelect.astro\", import.meta.url),\n );\n const components = resolveComponentOverrides(\n {\n Footer: footerPath,\n Header: headerPath,\n Sidebar: sidebarPath,\n MobileMenuFooter: mobileMenuFooterPath,\n MobileMenuToggle: mobileMenuTogglePath,\n ThemeSelect: themeSelectPath,\n },\n options.config?.components?.overrides,\n emptyFooterPath,\n );\n const navigation = resolveNavigationLayout(options.config?.navigation);\n // Tasty 3.6's integration shape is structurally compatible with Astro 7;\n // its published helper type still models `site` as URL-only.\n const tasty = tastyIntegration({\n islands: false,\n css: { mode: \"extract\" },\n }) as unknown as AstroIntegration;\n let inner: AstroIntegration[] = [tasty];\n let projectRoot = options.root;\n let graphConfig = options.config;\n let graph: Awaited<ReturnType<typeof createDocsGraph>> | undefined;\n let usingContentCollection = false;\n\n async function loadGraph(refresh = false) {\n if (!graph || refresh) {\n graph = await createDocsGraph({\n ...(projectRoot ? { root: projectRoot } : {}),\n ...(graphConfig ? { config: graphConfig } : {}),\n });\n assertValidDocs(graph);\n }\n return graph;\n }\n\n return {\n name: \"cookbook\",\n hooks: {\n \"astro:config:setup\": async (context) => {\n const react = (\n await importNative(pathToFileURL(astroReactIntegration).href)\n ).default();\n if (\n context.config.integrations.some(\n (integration) => integration.name === \"@astrojs/starlight\",\n )\n ) {\n throw new Error(\n \"Cookbook already includes Starlight. Remove the direct @astrojs/starlight integration before continuing.\",\n );\n }\n projectRoot ??= fileURLToPath(context.config.root);\n const base = options.config?.build?.base ?? context.config.base;\n graphConfig = {\n ...options.config,\n build: { ...options.config?.build, base },\n };\n usingContentCollection = hasContentConfig(context.config.srcDir);\n registerCookbookMarkdownPlugins(context.config.markdown.processor);\n const starlightIntegration = starlight({\n title: options.config?.site?.title ?? \"Documentation\",\n expressiveCode: false,\n ...(options.config?.head ? { head: options.config.head } : {}),\n ...(options.config?.site?.description\n ? { description: options.config.site.description }\n : {}),\n ...(options.config?.search?.enabled === false\n ? { pagefind: false }\n : {}),\n ...(!usingContentCollection ? { disable404Route: true } : {}),\n components,\n sidebar: usingContentCollection ? starlightSidebar(navigation) : [],\n });\n inner = [react, tasty, starlightIntegration];\n let markdownRuntime = {\n image: context.config.image,\n markdown: {\n ...context.config.markdown,\n syntaxHighlight: \"shiki\" as const,\n shikiConfig: cookbookShikiConfig(\n context.config.markdown.shikiConfig,\n ),\n },\n srcDir: context.config.srcDir,\n };\n let markdownRenderer: ReturnType<\n typeof markdownRuntime.markdown.processor.createRenderer\n >;\n context.updateConfig({\n base,\n output: \"static\",\n markdown: {\n syntaxHighlight: \"shiki\",\n shikiConfig: cookbookShikiConfig(\n context.config.markdown.shikiConfig,\n ),\n },\n vite: {\n ssr: {\n external: [\n \"@tenphi/docs\",\n \"react\",\n \"react-dom\",\n \"react-dom/server\",\n ],\n },\n plugins: [\n stripStarlightStylesPlugin(starlightRoot),\n virtualDocsPlugin(async () => {\n const loaded = await loadGraph();\n const entries = usingContentCollection\n ? loaded.entries\n : await Promise.all(\n loaded.entries.map(async (entry) => {\n const { image, markdown, srcDir } = markdownRuntime;\n markdownRenderer ??= markdown.processor.createRenderer({\n image,\n syntaxHighlight: markdown.syntaxHighlight,\n shikiConfig: markdown.shikiConfig,\n gfm: markdown.gfm,\n smartypants: markdown.smartypants,\n } as unknown as Parameters<\n typeof markdown.processor.createRenderer\n >[0]);\n const renderer = await markdownRenderer;\n const rendered = await renderer.render(\n entry.transformedBody,\n {\n frontmatter: entry.frontmatter,\n fileURL: starlightContentUrl(entry.route, srcDir),\n },\n );\n return {\n ...entry,\n rendered: {\n html: rendered.code,\n headings: rendered.metadata.headings,\n },\n };\n }),\n );\n return {\n entries,\n routes: loaded.routes,\n site: documentedSite(loaded),\n base: loaded.config.build.base,\n search: loaded.config.search.enabled,\n };\n }, navigation),\n ],\n resolve: {\n alias: [\n {\n find: \"@astrojs/starlight\",\n replacement: starlightRoot,\n },\n {\n find: \"@tenphi/tasty/ssr/astro-middleware-static\",\n replacement: tastyStaticMiddleware,\n },\n {\n find: \"@tenphi/tasty/ssr/astro-middleware-extract-static\",\n replacement: tastyExtractStaticMiddleware,\n },\n {\n find: \"@astrojs/react/server.js\",\n replacement: astroReactServer,\n },\n {\n find: \"@astrojs/react/client.js\",\n replacement: astroReactClient,\n },\n ],\n },\n },\n });\n await callInner(inner.slice(0, 2), \"astro:config:setup\", context);\n\n if (!usingContentCollection) {\n graph = await createDocsGraph({\n root: projectRoot,\n config: graphConfig,\n });\n assertValidDocs(graph);\n context.injectRoute({\n pattern: \"[...route]\",\n entrypoint: new URL(\"./routes/DocsPage.astro\", import.meta.url),\n prerender: true,\n });\n }\n\n // Starlight inserts its own follow-up integrations immediately after\n // itself. Give it a temporary real position so Astro processes those\n // once, after this composite integration, rather than re-visiting us.\n const starlightWithPlugins = inner[2];\n if (starlightWithPlugins) {\n const selfIndex = context.config.integrations.findIndex(\n (integration) => integration.name === \"cookbook\",\n );\n context.config.integrations.splice(\n selfIndex + 1,\n 0,\n starlightWithPlugins,\n );\n try {\n await callInner(\n [starlightWithPlugins],\n \"astro:config:setup\",\n usingContentCollection\n ? context\n : withoutStarlightDocsRoute(context),\n );\n } finally {\n const placeholderIndex =\n context.config.integrations.indexOf(starlightWithPlugins);\n if (placeholderIndex >= 0)\n context.config.integrations.splice(placeholderIndex, 1);\n }\n }\n context.config.integrations.push({\n name: \"cookbook-markdown-renderer\",\n hooks: {\n \"astro:config:setup\": ({ config }) => {\n markdownRuntime = {\n image: config.image,\n markdown: {\n ...config.markdown,\n syntaxHighlight: \"shiki\" as const,\n shikiConfig: cookbookShikiConfig(config.markdown.shikiConfig),\n },\n srcDir: config.srcDir,\n };\n },\n },\n });\n },\n \"astro:config:done\": async (context) => {\n await callInner(inner, \"astro:config:done\", context);\n },\n \"astro:server:setup\": async ({ server }) => {\n let assets = docsAssetMap(await loadGraph());\n server.middlewares.use(async (request, response, next) => {\n if (request.method !== \"GET\" && request.method !== \"HEAD\") {\n next();\n return;\n }\n const pathname = requestPath(request.url);\n if (!pathname.includes(\"/_tasty-assets/\")) {\n next();\n return;\n }\n let asset = assets.get(pathname);\n if (!asset) {\n try {\n assets = docsAssetMap(await loadGraph(true));\n } catch {\n next();\n return;\n }\n asset = assets.get(pathname);\n }\n if (!asset?.sourcePath) {\n next();\n return;\n }\n try {\n const body = await readFile(asset.sourcePath);\n response.statusCode = 200;\n response.setHeader(\"Content-Type\", assetContentType(pathname));\n response.setHeader(\"Content-Length\", body.byteLength);\n response.setHeader(\"Cache-Control\", \"no-cache\");\n response.end(request.method === \"HEAD\" ? undefined : body);\n } catch {\n next();\n }\n });\n },\n \"astro:build:start\": async (context) => {\n await loadGraph();\n await callInner(inner, \"astro:build:start\", context);\n },\n \"astro:build:done\": async (context) => {\n await callInner(inner, \"astro:build:done\", context);\n const output = fileURLToPath(context.dir);\n for (const relativePath of await readdir(output, { recursive: true })) {\n if (extname(relativePath) !== \".html\") continue;\n const path = join(output, relativePath);\n const html = await readFile(path, \"utf8\");\n const sanitized = html\n .replace(\n /\\s*<link\\b(?=[^>]*rel=\"stylesheet\")(?=[^>]*href=\"data:text\\/css,\")[^>]*>/g,\n \"\",\n )\n .replace(/\\s*<style>\\s*<\\/style>/g, \"\")\n .replace(\n /\\sstyle=\"--sl-icon-size:\\s*([^;\\\"]+);?\"/g,\n ' width=\"$1\" height=\"$1\"',\n )\n .replace(/\\sstyle=\"--depth:\\s*([^;\\\"]+);?\"/g, ' data-depth=\"$1\"')\n .replace(\n /(<kbd\\b[^>]*)\\sstyle=\"display:\\s*none;?\"([^>]*>)/g,\n \"$1$2\",\n )\n .replace(\n /(<dialog\\b[^>]*)\\sstyle=\"padding:\\s*0;?\"([^>]*>)/g,\n \"$1$2\",\n );\n if (sanitized !== html) await writeFile(path, sanitized);\n }\n const pagefindOutput = join(output, \"pagefind\");\n if (existsSync(pagefindOutput)) {\n for (const name of await readdir(pagefindOutput)) {\n if (extname(name) === \".css\") {\n await unlink(join(pagefindOutput, name));\n }\n }\n }\n if (!graph) return;\n for (const asset of graph.assets) {\n if (!asset.sourcePath || !asset.publicPath) continue;\n const target = join(output, asset.publicPath.replace(/^\\//, \"\"));\n await mkdir(dirname(target), { recursive: true });\n await cp(asset.sourcePath, target);\n }\n },\n },\n };\n}\n\nfunction registerCookbookMarkdownPlugins(processor: {\n name: string;\n options: object;\n}): void {\n if (processor.name === \"unified\") {\n const options = processor.options as { rehypePlugins?: unknown };\n const plugins = Array.isArray(options.rehypePlugins)\n ? options.rehypePlugins\n : [];\n if (!plugins.includes(rehypeMermaid)) plugins.push(rehypeMermaid);\n if (!plugins.includes(rehypeTableScroll)) plugins.push(rehypeTableScroll);\n options.rehypePlugins = plugins;\n } else if (processor.name === \"satteri\") {\n const options = processor.options as { hastPlugins?: unknown };\n const plugins = Array.isArray(options.hastPlugins)\n ? options.hastPlugins\n : [];\n if (!plugins.includes(satteriMermaid)) plugins.push(satteriMermaid);\n if (!plugins.includes(satteriTableScroll)) plugins.push(satteriTableScroll);\n options.hastPlugins = plugins;\n }\n}\n\nfunction stripStarlightStylesPlugin(root: string) {\n const normalizedRoot = root.replaceAll(\"\\\\\", \"/\");\n const emptyPrintId = \"\\0cookbook:empty-starlight-print\";\n return {\n name: \"cookbook-strip-starlight-css\",\n enforce: \"pre\" as const,\n resolveId(source: string, importer: string | undefined) {\n if (\n importer?.replaceAll(\"\\\\\", \"/\").startsWith(`${normalizedRoot}/`) &&\n source.endsWith(\"/style/print.css?url&no-inline\")\n ) {\n return emptyPrintId;\n }\n return undefined;\n },\n load(id: string) {\n if (id === emptyPrintId) return 'export default \"data:text/css,\";';\n return undefined;\n },\n transform(code: string, id: string) {\n const normalizedId = id.replaceAll(\"\\\\\", \"/\");\n if (!normalizedId.startsWith(`${normalizedRoot}/`)) return undefined;\n const [pathname, query = \"\"] = normalizedId.split(\"?\", 2);\n const isStylesheet = pathname?.endsWith(\".css\");\n const isAstroStyle =\n pathname?.endsWith(\".astro\") && query.includes(\"type=style\");\n if (!isStylesheet && !isAstroStyle) return undefined;\n return { code: \"\", map: null };\n },\n };\n}\n\nfunction starlightContentUrl(route: string, srcDir: URL): URL {\n const slug = route === \"/\" ? \"index\" : route.replace(/^\\/+|\\/+$/g, \"\");\n return new URL(`content/docs/${slug}.md`, srcDir);\n}\n\nfunction docsAssetMap(graph: Awaited<ReturnType<typeof createDocsGraph>>) {\n return new Map(\n graph.assets.flatMap((asset) =>\n asset.publicPath && asset.sourcePath\n ? [[asset.publicPath, asset] as const]\n : [],\n ),\n );\n}\n\nfunction documentedSite(\n graph: Awaited<ReturnType<typeof createDocsGraph>>,\n): Awaited<ReturnType<typeof createDocsGraph>>[\"config\"][\"site\"] {\n if (graph.config.site.version) return graph.config.site;\n const packages = new Set(\n graph.entries.flatMap((entry) =>\n entry.package?.resolved ? [entry.package.resolved] : [],\n ),\n );\n if (packages.size !== 1) return graph.config.site;\n const resolved = packages.values().next().value;\n if (!resolved) return graph.config.site;\n const separator = resolved.lastIndexOf(\"@\");\n if (separator <= 0 || separator === resolved.length - 1)\n return graph.config.site;\n return { ...graph.config.site, version: resolved.slice(separator + 1) };\n}\n\nfunction requestPath(url: string | undefined): string {\n try {\n return decodeURIComponent(new URL(url ?? \"/\", \"http://localhost\").pathname);\n } catch {\n return \"\";\n }\n}\n\nfunction assetContentType(pathname: string): string {\n switch (extname(pathname).toLowerCase()) {\n case \".avif\":\n return \"image/avif\";\n case \".gif\":\n return \"image/gif\";\n case \".jpeg\":\n case \".jpg\":\n return \"image/jpeg\";\n case \".png\":\n return \"image/png\";\n case \".svg\":\n return \"image/svg+xml\";\n case \".webp\":\n return \"image/webp\";\n default:\n return \"application/octet-stream\";\n }\n}\n\nfunction configureTastyTheme(\n theme: DocsConfig[\"theme\"],\n resolved: ReturnType<typeof resolveDocsTheme>,\n): void {\n const tokens = tastyTokens(resolved) as ConfigTokens;\n const globalStyles = resolveLegacyAnatomyStyles(theme?.styles);\n\n configure({\n states: {\n ...cookbookStates,\n ...theme?.states,\n },\n units: TASTY_UNITS,\n tokens,\n presets: resolved.presets as Record<string, TypographyPreset>,\n ...(globalStyles\n ? { globalStyles: globalStyles as Record<string, Styles> }\n : {}),\n });\n}\n\nfunction starlightSidebar(layout: ResolvedNavigationLayout): unknown[] {\n const fallback = layout.items?.length\n ? layout.items.map(starlightSidebarItem)\n : [{ autogenerate: { directory: \"\" } }];\n if (!layout.sectioned) return fallback;\n\n return [\n ...(layout.fallbackSidebarGroup !== undefined\n ? [\n {\n label: \"Documentation\",\n items: (layout.items ?? []).map(starlightSidebarItem),\n },\n ]\n : []),\n ...layout.tabs.flatMap((tab) =>\n tab.items !== undefined\n ? [{ label: tab.label, items: tab.items.map(starlightSidebarItem) }]\n : [],\n ),\n ];\n}\n\nfunction starlightSidebarItem(item: NavigationItem): unknown {\n if (typeof item === \"string\") return { slug: routeToSlug(item) };\n if (\"items\" in item) {\n return {\n label: item.label,\n items: item.items.map(starlightSidebarItem),\n };\n }\n if (\"autogenerate\" in item) {\n return {\n label: item.label,\n items: [\n {\n autogenerate: {\n directory: routeToSlug(item.autogenerate.directory, false),\n },\n },\n ],\n };\n }\n return { label: item.label, link: item.link };\n}\n\nfunction routeToSlug(route: string, rootAsIndex = true): string {\n const slug = route.replace(/^\\/+|\\/+$/g, \"\");\n return slug || (rootAsIndex ? \"index\" : \"\");\n}\n\nexport function tastyStarlight(\n config: Parameters<typeof starlight>[0],\n): AstroIntegration {\n return starlight(config);\n}\n\nasync function callInner<K extends keyof AstroIntegration[\"hooks\"]>(\n integrations: AstroIntegration[],\n hook: K,\n context: HookParameters<K>,\n): Promise<void> {\n for (const integration of integrations) {\n const handler = integration.hooks[hook];\n if (typeof handler === \"function\") {\n await (handler as (value: HookParameters<K>) => void | Promise<void>)(\n context,\n );\n }\n }\n}\n\nfunction withoutStarlightDocsRoute(\n context: HookParameters<\"astro:config:setup\">,\n): HookParameters<\"astro:config:setup\"> {\n return new Proxy(context, {\n get(target, property, receiver) {\n if (property !== \"injectRoute\") {\n return Reflect.get(target, property, receiver);\n }\n return (route: Parameters<typeof context.injectRoute>[0]) => {\n if (route.pattern !== \"[...slug]\") context.injectRoute(route);\n };\n },\n });\n}\n\nfunction virtualDocsPlugin(\n getContent: () => unknown | Promise<unknown>,\n layout: ResolvedNavigationLayout,\n) {\n const configId = \"\\0virtual:cookbook/config\";\n const layoutId = \"\\0virtual:cookbook/layout\";\n return {\n name: \"cookbook-data\",\n resolveId(id: string) {\n if (id === \"virtual:cookbook/config\") return configId;\n if (id === \"virtual:cookbook/layout\") return layoutId;\n return undefined;\n },\n async load(id: string) {\n if (id === configId) {\n return `export const content = ${JSON.stringify(await getContent())};`;\n }\n if (id === layoutId) {\n return `export const layout = ${JSON.stringify(layout)};`;\n }\n return undefined;\n },\n };\n}\n\nfunction hasContentConfig(srcDir: URL): boolean {\n const source = fileURLToPath(srcDir);\n return [\n \"content.config.ts\",\n \"content.config.mts\",\n \"content.config.js\",\n \"content.config.mjs\",\n \"content/config.ts\",\n ].some((path) => existsSync(join(source, path)));\n}\n"],"mappings":";;;;;;;;;;;;;;AAgBA,MAAM,uBAAuB;AAC7B,MAAM,yBAAyB;AAC/B,MAAM,gBAAgB;AACtB,MAAM,mBACJ;;AAGF,SAAgB,gBAAgB;CAC9B,QAAQ,SAAyB;EAC/B,yBAAyB,IAAI;CAC/B;AACF;;AAGA,MAAa,iBAAiB;CAC5B,MAAM;CACN,SAAS;EACP,QAAQ,CAAC,KAAK;EACd,MAAM,MAA0B,SAA+B;GAC7D,IAAI,CAAC,mBAAmB,IAAI,GAAG;GAC/B,IAAI;IACF,QAAQ,YAAY,MAAM;KACxB,MAAM;KACN,OAAO,qBAAqB,QAAQ,YAAY,IAAI,CAAC;IACvD,CAAC;GACH,QAAQ;IACN,QAAQ,YAAY,MAAM,sBAAsB,OAAO;GACzD;EACF;CACF;AACF;AAEA,SAAS,yBAAyB,QAAwB;CACxD,IAAI,CAAC,OAAO,UAAU;CACtB,KAAK,MAAM,CAAC,OAAO,UAAU,OAAO,SAAS,QAAQ,GAAG;EACtD,IAAI,mBAAmB,KAAK,GAAG;GAC7B,MAAM,SAAS,YAAY,KAAK;GAChC,IAAI;IACF,OAAO,SAAS,SAAS;KACvB,MAAM;KACN,OAAO,qBAAqB,MAAM;IACpC;GACF,QAAQ;IACN,MAAM,aAAa;KACjB,GAAG,MAAM;KACT,sBAAsB;IACxB;GACF;GACA;EACF;EACA,yBAAyB,KAAK;CAChC;AACF;AAEA,SAAS,qBAAqB,QAAwB;CAEpD,OAAO,sDADK,cAAc,OAAO,MAAM,GAAG,MACqB,EAAE;AACnE;AAEA,S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Q,YAAY,IACnD,CAAC,GAAG,OAAO,YAAY,IACvB,CAAC;CACL,MAAM,SAAS,UAAU,MACtB,aACC,aAAa,SACZ,OAAO,aAAa,YACnB,aAAa,QACb,UAAU,YACV,SAAS,SAAS,KACxB;CAEA,IAAI,CAAC,aAAa,SAAS,0BAA0B,GACnD,aAAa,KAAK,0BAA0B;CAE9C,IAAI,CAAC,aAAa,SAAS,mBAAmB,GAC5C,aAAa,KAAK,mBAAmB;CAGvC,OAAO;EACL,GAAG;EACH,OAAO,SAAS,YAAY,CAAC,GAAG,WAAW,KAAK;EAChD,OAAO;EACP;CACF;AACF;;;;;AAMA,MAAM,iBAAiB;CACrB,MAAM;CACN,MAAM;CACN,IAAI;CACJ,IAAI;CACJ,QAAQ;EACN,qBAAqB;EACrB,qBAAqB;CACvB;CACA,UAAU;EACR;GACE,OAAO;IACL;IACA;IACA;IACA;GACF;GACA,UAAU;IAAE,YAAY;IAAS,WAAW;GAAS;EACvD;EACA;GACE,OAAO;IACL;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;GACF;GACA,UAAU,EAAE,YAAY,QAAQ;EAClC;EACA;GACE,OAAO;IACL;IACA;IACA;IACA;IACA;GACF;GACA,UAAU,EAAE,YAAY,OAAO;EACjC;EACA;GACE,OAAO;IACL;IACA;IACA;IACA;IACA;IACA;GACF;GACA,UAAU,EAAE,YAAY,MAAM;EAChC;EACA;GACE,OAAO;IACL;IACA;IACA;IACA;IACA;IACA;IACA;IACA;GACF;GACA,UAAU,EAAE,YAAY,OAAO;EACjC;EACA;GACE,OAAO;IACL;IACA;IACA;IACA;GACF;GACA,UAAU,EAAE,YAAY,SAAS;EACnC;EACA;GACE,OAAO,CAAC,YAAY,gBAAgB;GACpC,UAAU,EAAE,WAAW;EACzB;EACA;GACE,OAAO;IACL;IACA;IACA;IACA;IACA;IACA;IACA;IACA;GACF;GACA,UAAU,EAAE,YAAY,KAAK;EAC/B;EACA;GACE,OAAO;IACL;IACA;IACA;IACA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markdown/rehype-mermaid.ts","../src/markdown/rehype-table-scroll.ts","../src/theme/defaults.ts","../src/theme/index.ts","../src/theme/shiki-theme.ts","../src/theme/tasty-config.ts","../src/components/component-styles.ts","../src/component-overrides.ts","../src/components/tasty-states.js","../src/integration.ts"],"sourcesContent":["import { renderMermaidSVG } from \"beautiful-mermaid\";\n\ntype HastNode = {\n type: string;\n value?: string;\n tagName?: string;\n properties?: Record<string, unknown>;\n children?: HastNode[];\n};\n\ntype SatteriContext = {\n replaceNode(node: Readonly<HastNode>, replacement: HastNode): void;\n setProperty(node: Readonly<HastNode>, key: string, value: unknown): void;\n textContent(node: Readonly<HastNode>): string;\n};\n\nconst sourceStyleDirective = /^\\s*(?:classDef|style|linkStyle)\\s+.*$/gim;\nconst accessibilityDirective = /^\\s*acc(?:Title|Descr):\\s*.*$/gim;\nconst svgStyleBlock = /\\s*<style>[\\s\\S]*?<\\/style>\\s*/gi;\nconst supportedDiagram =\n /^(?:(?:flowchart|graph)(?:\\s+(?:TB|TD|BT|RL|LR))?|stateDiagram(?:-v2)?|sequenceDiagram|classDiagram|erDiagram)\\b/i;\n\n/** Render supported Mermaid fences to theme-responsive SVG at build time. */\nexport function rehypeMermaid() {\n return (tree: HastNode): void => {\n replaceMermaidCodeBlocks(tree);\n };\n}\n\n/** Sätteri adapter for Astro's default Markdown processor. */\nexport const satteriMermaid = {\n name: \"cookbook:mermaid\",\n element: {\n filter: [\"pre\"],\n visit(node: Readonly<HastNode>, context: SatteriContext): void {\n if (!isMermaidCodeBlock(node)) return;\n try {\n context.replaceNode(node, {\n type: \"raw\",\n value: renderMermaidElement(context.textContent(node)),\n });\n } catch {\n context.setProperty(node, \"data-mermaid-state\", \"error\");\n }\n },\n },\n};\n\nfunction replaceMermaidCodeBlocks(parent: HastNode): void {\n if (!parent.children) return;\n for (const [index, child] of parent.children.entries()) {\n if (isMermaidCodeBlock(child)) {\n const source = textContent(child);\n try {\n parent.children[index] = {\n type: \"raw\",\n value: renderMermaidElement(source),\n };\n } catch {\n child.properties = {\n ...child.properties,\n \"data-mermaid-state\": \"error\",\n };\n }\n continue;\n }\n replaceMermaidCodeBlocks(child);\n }\n}\n\nfunction renderMermaidElement(source: string): string {\n const svg = accessibleSvg(render(source), source);\n return `<div class=\"td-mermaid\" data-mermaid-state=\"ready\">${svg}</div>`;\n}\n\nfunction isMermaidCodeBlock(node: HastNode): boolean {\n if (node.type !== \"element\" || node.tagName !== \"pre\") return false;\n return (\n node.properties?.dataLanguage === \"mermaid\" ||\n node.properties?.[\"data-language\"] === \"mermaid\"\n );\n}\n\nfunction render(source: string): string {\n const header = source\n .split(\"\\n\")\n .map((line) => line.trim())\n .find(\n (line) =>\n line && !line.startsWith(\"%%\") && !/^acc(?:Title|Descr):/i.test(line),\n );\n if (!header || !supportedDiagram.test(header)) {\n throw new Error(\"Unsupported Mermaid diagram type\");\n }\n\n // Cookbook renders package Markdown too. Do not allow diagram-authored CSS\n // to escape the diagram's visual boundary; the site theme owns all colors.\n const safeSource = source\n .replace(sourceStyleDirective, \"\")\n .replace(accessibilityDirective, \"\");\n return renderMermaidSVG(safeSource, {\n bg: \"var(--surface-2-color)\",\n fg: \"var(--text-color)\",\n line: \"var(--text-soft-color)\",\n accent: \"var(--accent-text-color)\",\n muted: \"var(--text-soft-color)\",\n surface: \"var(--surface-color)\",\n border: \"var(--border-strong-color)\",\n font: \"Onest Variable\",\n transparent: true,\n }).replace(svgStyleBlock, \"\");\n}\n\nfunction accessibleSvg(svg: string, source: string): string {\n const title = directive(source, \"accTitle\") ?? \"Diagram\";\n const description =\n directive(source, \"accDescr\") ?? \"Rendered from a Mermaid code block.\";\n return svg\n .replace(\"<svg \", `<svg role=\"img\" aria-label=\"${escapeAttribute(title)}\" `)\n .replace(\n /(<svg\\b[^>]*>)/,\n `$1<title>${escapeText(title)}</title><desc>${escapeText(description)}</desc>`,\n );\n}\n\nfunction directive(source: string, name: string): string | undefined {\n const match = source.match(new RegExp(`^\\\\s*${name}:\\\\s*(.+)$`, \"im\"));\n return match?.[1]?.trim();\n}\n\nfunction textContent(node: HastNode): string {\n if (node.type === \"text\") return node.value ?? \"\";\n return node.children?.map(textContent).join(\"\") ?? \"\";\n}\n\nfunction escapeAttribute(value: string): string {\n return escapeText(value).replaceAll('\"', \"&quot;\").replaceAll(\"'\", \"&#39;\");\n}\n\nfunction escapeText(value: string): string {\n return value\n .replaceAll(\"&\", \"&amp;\")\n .replaceAll(\"<\", \"&lt;\")\n .replaceAll(\">\", \"&gt;\");\n}\n","type HastNode = {\n type: string;\n tagName?: string;\n properties?: Record<string, unknown>;\n children?: HastNode[];\n};\n\ntype SatteriContext = {\n replaceNode(node: Readonly<HastNode>, replacement: HastNode): void;\n};\n\nconst containerClass = \"td-table-scroll\";\n\n/** Wrap Markdown tables in a dedicated horizontal scroll container. */\nexport function rehypeTableScroll() {\n return (tree: HastNode): void => {\n wrapTables(tree);\n };\n}\n\n/** Sätteri adapter for Astro's default Markdown processor. */\nexport const satteriTableScroll = {\n name: \"cookbook:table-scroll\",\n element: {\n filter: [\"table\"],\n visit(node: Readonly<HastNode>, context: SatteriContext): void {\n context.replaceNode(node, scrollContainer(node as HastNode));\n },\n },\n};\n\nfunction wrapTables(parent: HastNode): void {\n if (!parent.children || isScrollContainer(parent)) return;\n for (const [index, child] of parent.children.entries()) {\n if (child.type === \"element\" && child.tagName === \"table\") {\n parent.children[index] = scrollContainer(child);\n continue;\n }\n wrapTables(child);\n }\n}\n\nfunction scrollContainer(table: HastNode): HastNode {\n return {\n type: \"element\",\n tagName: \"div\",\n properties: { className: [containerClass] },\n children: [table],\n };\n}\n\nfunction isScrollContainer(node: HastNode): boolean {\n const className = node.properties?.className;\n return (\n node.type === \"element\" &&\n node.tagName === \"div\" &&\n Array.isArray(className) &&\n className.includes(containerClass)\n );\n}\n","import type {\n ThemeTokens,\n TypographyPreset,\n TypographyPresets,\n} from \"@tenphi/docs\";\n\nexport const DEFAULT_THEME_TOKENS = {\n $gap: \"0.5rem\",\n $radius: \"6px\",\n \"$card-radius\": \"10px\",\n \"$border-width\": \"1px\",\n \"$outline-width\": \"2px\",\n \"$outline-offset\": \"2px\",\n \"$layout-width\": \"87.5rem\",\n \"$content-width\": \"58rem\",\n \"$sidebar-width\": \"17.5rem\",\n \"$control-height\": \"2.5rem\",\n} satisfies ThemeTokens;\n\nconst BODY_FONT =\n \"'Onest Variable', Onest, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif\";\nconst MONO_FONT =\n \"'JetBrains Mono Variable', 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace\";\n\nexport const DEFAULT_TYPOGRAPHY_PRESETS: Record<string, TypographyPreset> = {\n body: {\n fontFamily: BODY_FONT,\n fontSize: \"1rem\",\n lineHeight: 1.65,\n letterSpacing: \"-0.006em\",\n fontWeight: 420,\n boldFontWeight: 640,\n },\n heading: {\n fontFamily: BODY_FONT,\n fontSize: \"1rem\",\n lineHeight: 1.15,\n letterSpacing: \"-0.025em\",\n fontWeight: 640,\n boldFontWeight: 720,\n },\n h1: heading(\"clamp(2.5rem, 5vw, 3.25rem)\", 1.05, \"-0.045em\"),\n h2: heading(\"clamp(1.75rem, 3vw, 2.125rem)\", 1.1, \"-0.035em\"),\n h3: heading(\"1.5rem\", 1.15, \"-0.025em\"),\n h4: heading(\"1.25rem\", 1.2, \"-0.018em\"),\n h5: heading(\"1.125rem\", 1.25, \"-0.012em\"),\n h6: heading(\"1rem\", 1.3, \"-0.006em\"),\n navigation: {\n fontFamily: \"var(--body-font-family)\",\n fontSize: \"0.9375rem\",\n lineHeight: 1.4,\n letterSpacing: \"-0.006em\",\n fontWeight: 540,\n boldFontWeight: 650,\n },\n small: {\n fontFamily: \"var(--body-font-family)\",\n fontSize: \"0.875rem\",\n lineHeight: 1.45,\n letterSpacing: \"-0.002em\",\n fontWeight: 420,\n boldFontWeight: 650,\n },\n code: {\n fontFamily: MONO_FONT,\n fontSize: \"0.875rem\",\n lineHeight: 1.65,\n letterSpacing: \"0\",\n fontWeight: 400,\n boldFontWeight: 650,\n },\n};\n\nexport function resolveThemeTokens(tokens: ThemeTokens = {}): ThemeTokens {\n return { ...DEFAULT_THEME_TOKENS, ...tokens };\n}\n\nexport function resolveTypographyPresets(\n presets: TypographyPresets = {},\n): Record<string, TypographyPreset> {\n const body = DEFAULT_TYPOGRAPHY_PRESETS.body;\n if (!body) throw new Error(\"The body typography preset is required.\");\n const names = new Set([\n ...Object.keys(DEFAULT_TYPOGRAPHY_PRESETS),\n ...Object.keys(presets),\n ]);\n return Object.fromEntries(\n [...names].map((name) => [\n name,\n {\n ...(DEFAULT_TYPOGRAPHY_PRESETS[name] ?? body),\n ...(presets[name] ?? {}),\n },\n ]),\n );\n}\n\nfunction heading(\n fontSize: string,\n lineHeight: number,\n letterSpacing: string,\n): TypographyPreset {\n return {\n fontFamily: \"var(--heading-font-family)\",\n fontSize,\n lineHeight,\n letterSpacing,\n fontWeight: \"var(--heading-font-weight)\",\n boldFontWeight: \"var(--heading-bold-font-weight)\",\n };\n}\n","import {\n apcaContrast,\n glaze,\n okhslToLinearSrgb,\n relativeLuminanceFromLinearRgb,\n variantToOkhsl,\n type ColorMap,\n type GlazeColorValue,\n type ResolvedColorVariant,\n} from \"@tenphi/glaze\";\nimport type {\n BrandConfig,\n DocsDiagnostic,\n ThemeConfig,\n ThemeTokens,\n TypographyPreset,\n} from \"@tenphi/docs\";\nimport { resolveThemeTokens, resolveTypographyPresets } from \"./defaults.js\";\n\nexport interface ResolvedDocsTheme {\n colors: {\n surface: Record<string, string>;\n surface2: Record<string, string>;\n surface3: Record<string, string>;\n text: Record<string, string>;\n textSoft: Record<string, string>;\n accentText: Record<string, string>;\n accentSurface: Record<string, string>;\n accentSurfaceText: Record<string, string>;\n focus: Record<string, string>;\n shadow: Record<string, string>;\n };\n /** Glaze-generated Tasty color tokens, including interaction and status roles. */\n colorTokens: Record<string, Record<string, string>>;\n tokens: ThemeTokens;\n presets: Record<string, TypographyPreset>;\n contrast: {\n light: number;\n dark: number;\n lightContrast: number;\n darkContrast: number;\n };\n diagnostics: DocsDiagnostic[];\n}\n\nexport function resolveDocsTheme(theme: ThemeConfig = {}): ResolvedDocsTheme {\n const brand = normalizeBrand(theme.brand);\n const authoredTarget = brand.contrast?.apca ?? 45;\n const normalTarget = Array.isArray(authoredTarget)\n ? authoredTarget[0]\n : authoredTarget;\n const highTarget = Array.isArray(authoredTarget)\n ? authoredTarget[1]\n : normalTarget + 15;\n const glazeOptions = {\n autoFlip: true,\n ...(theme.contrastLevel !== undefined\n ? { contrastLevel: theme.contrastLevel }\n : {}),\n } as const;\n const surfaceFrom = theme.palette?.surface ?? \"#ffffff\";\n const surfaceSeed = glaze.color({\n from: surfaceFrom,\n mode: \"auto\",\n // Near-white brand surfaces can carry a numerically large OKHSL\n // saturation that becomes vivid as the ramp moves away from white. Reduce\n // saturation along the light ramp and keep dark chrome nearly neutral.\n darkSaturation: 0.35,\n });\n const resolvedSurfaceSeed = surfaceSeed.resolve();\n const lightSurface = variantToOkhsl(resolvedSurfaceSeed.light);\n const darkSurface = variantToOkhsl(resolvedSurfaceSeed.dark);\n const colorTheme = glaze(\n {\n hue: lightSurface.h,\n saturation: lightSurface.s * 100,\n darkHue: darkSurface.h,\n // The surface definition applies its 0.35 factor again. Normalize the\n // seed so dependent dark colors retain the authored surface chroma.\n darkSaturation: Math.min(100, (darkSurface.s * 100) / 0.35),\n },\n undefined,\n glazeOptions,\n );\n colorTheme.colors({\n surface: {\n from: surfaceFrom,\n mode: \"auto\",\n darkSaturation: 0.35,\n },\n \"surface-2\": {\n base: \"surface\",\n tone: \"-2\",\n mode: \"auto\",\n saturation: 0.75,\n darkSaturation: 0.275,\n },\n \"surface-3\": {\n base: \"surface-2\",\n tone: \"-2\",\n mode: \"auto\",\n saturation: 0.65,\n darkSaturation: 0.25,\n },\n text: {\n from: theme.palette?.text ?? \"#20232a\",\n base: \"surface\",\n role: \"text\",\n contrast: { apca: [75, 90] },\n mode: \"auto\",\n },\n \"text-soft\": {\n from: theme.palette?.textSoft ?? \"#626875\",\n base: \"surface\",\n role: \"text\",\n contrast: { apca: [60, 75] },\n mode: \"auto\",\n },\n \"text-muted\": mix(\"surface\", \"text\", 66),\n \"surface-2-hover\": mix(\"surface-2\", \"text\", [3, 6]),\n \"surface-2-pressed\": mix(\"surface-2\", \"text\", [9, 14]),\n \"surface-3-hover\": mix(\"surface-3\", \"text\", [3, 6]),\n \"surface-3-pressed\": mix(\"surface-3\", \"text\", [9, 14]),\n \"accent-text\": {\n from: brand.from,\n base: \"surface\",\n role: \"text\",\n contrast: { apca: [normalTarget, highTarget] },\n mode: \"auto\",\n },\n focus: {\n from: brand.from,\n base: \"surface\",\n role: \"border\",\n contrast: { apca: [normalTarget, highTarget] },\n mode: \"auto\",\n },\n \"accent-surface\": { from: brand.from, mode: \"fixed\" },\n \"accent-surface-text\": {\n from: \"#ffffff\",\n base: \"accent-surface\",\n role: \"text\",\n contrast: { apca: [60, 75] },\n mode: \"auto\",\n },\n \"accent-surface-subtle\": mix(\"surface\", \"accent-surface\", [12, 18]),\n \"accent-surface-2-subtle\": mix(\"surface-2\", \"accent-surface\", [12, 18]),\n shadow: {\n type: \"shadow\",\n bg: \"surface\",\n fg: \"text\",\n intensity: [12, 20],\n tuning: { alphaMax: 0.28 },\n },\n overlay: {\n type: \"mix\",\n base: \"surface\",\n target: \"text\",\n value: [58, 68],\n blend: \"transparent\",\n },\n clear: { from: \"#ffffff\", mode: \"fixed\", opacity: 0 },\n ...statusColors(\"orange\", \"#d97706\"),\n ...statusColors(\"green\", \"#16a34a\"),\n ...statusColors(\"blue\", \"#2563eb\"),\n ...statusColors(\"purple\", \"#9333ea\"),\n ...statusColors(\"red\", \"#dc2626\"),\n } satisfies ColorMap);\n\n const resolvedBrandSeed = glaze\n .color({ from: brand.from, mode: \"fixed\" })\n .resolve();\n const lightBrand = variantToOkhsl(resolvedBrandSeed.light);\n const darkBrand = variantToOkhsl(resolvedBrandSeed.dark);\n const borderTheme = glaze(\n {\n hue: lightBrand.h,\n saturation: lightBrand.s * 100,\n darkHue: darkBrand.h,\n darkSaturation: darkBrand.s * 100,\n },\n undefined,\n glazeOptions,\n );\n borderTheme.colors({\n surface: {\n from: surfaceFrom,\n mode: \"auto\",\n darkSaturation: 0.35,\n },\n border: {\n base: \"surface\",\n tone: [\"-9\", \"-22\"],\n saturation: 0.205,\n mode: \"auto\",\n },\n \"border-strong\": {\n base: \"surface\",\n tone: [\"-20\", \"-38\"],\n saturation: 0.205,\n mode: \"auto\",\n },\n } satisfies ColorMap);\n\n // Syntax colors are intentionally resolved as their own Glaze palette.\n // This keeps code semantics vivid enough to scan without coupling them to\n // either the product brand ramp or the deliberately restrained UI chrome.\n const syntaxTheme = glaze(210, 90, glazeOptions);\n syntaxTheme.colors({\n bg: { tone: 100, saturation: 0.1 },\n text: {\n base: \"bg\",\n tone: 0,\n contrast: { wcag: [\"AA\", \"AAA\"] },\n saturation: 0,\n },\n comment: {\n base: \"bg\",\n contrast: { wcag: [\"AA\", \"AAA\"] },\n saturation: 0.01,\n hue: 210,\n },\n punctuation: {\n base: \"bg\",\n contrast: { wcag: [6, \"AAA\"] },\n saturation: 0.01,\n hue: 210,\n },\n keyword: {\n base: \"bg\",\n contrast: { wcag: [\"AA\", \"AAA\"] },\n saturation: 80,\n },\n string: {\n base: \"bg\",\n contrast: { wcag: [\"AA\", \"AAA\"] },\n saturation: 80,\n hue: 40,\n },\n token: {\n base: \"bg\",\n contrast: { wcag: [\"AA\", \"AAA\"] },\n saturation: 80,\n hue: 125,\n },\n property: {\n base: \"bg\",\n contrast: { wcag: [\"AA\", \"AAA\"] },\n saturation: 80,\n hue: 155,\n },\n number: {\n base: \"bg\",\n contrast: { wcag: [\"AA\", \"AAA\"] },\n saturation: 80,\n hue: 70,\n },\n function: {\n base: \"bg\",\n contrast: { wcag: [\"AA\", \"AAA\"] },\n saturation: 80,\n hue: 210,\n },\n value: {\n base: \"bg\",\n contrast: { wcag: [\"AA\", \"AAA\"] },\n saturation: 80,\n hue: 210,\n },\n operator: {\n base: \"bg\",\n contrast: { wcag: [\"AA\", \"AAA\"] },\n saturation: 80,\n hue: 340,\n },\n } satisfies ColorMap);\n\n const resolvedColors = colorTheme.resolve();\n const resolvedSurface = requiredResolvedColor(resolvedColors, \"surface\");\n const resolvedAccent = requiredResolvedColor(resolvedColors, \"accent-text\");\n\n const scores = {\n light: score(resolvedAccent.light, resolvedSurface.light),\n dark: score(resolvedAccent.dark, resolvedSurface.dark),\n lightContrast: score(\n resolvedAccent.lightContrast,\n resolvedSurface.lightContrast,\n ),\n darkContrast: score(\n resolvedAccent.darkContrast,\n resolvedSurface.darkContrast,\n ),\n };\n const diagnostics: DocsDiagnostic[] = [];\n for (const [scheme, measured] of Object.entries(scores)) {\n const required = scheme.includes(\"Contrast\") ? highTarget : normalTarget;\n if (measured + 0.05 < required) {\n diagnostics.push({\n code: \"DOCS_BRAND_CONTRAST_UNMET\",\n severity: \"error\",\n message: `Brand contrast in ${scheme} is Lc ${measured.toFixed(1)}; required Lc ${required}.`,\n hint: `Authored color: ${String(brand.from)}.`,\n });\n }\n }\n const outputOptions = { modes: { highContrast: true } } as const;\n const tastyOptions = {\n ...outputOptions,\n states: {\n dark: \"theme=dark | (@media(prefers-color-scheme: dark) & :not([data-theme]))\",\n highContrast:\n \"contrast=more | (@media(prefers-contrast: more) & :not([data-contrast]))\",\n },\n } as const;\n const resolvedPalette = colorTheme.json(outputOptions);\n const colorTokens = colorTheme.tasty(tastyOptions);\n const borderTokens = borderTheme.tasty(tastyOptions);\n const syntaxTokens = glaze.palette({ syntax: syntaxTheme }).tasty({\n ...tastyOptions,\n prefix: true,\n primary: false,\n });\n const colors = {\n surface: requiredJsonColor(resolvedPalette, \"surface\"),\n surface2: requiredJsonColor(resolvedPalette, \"surface-2\"),\n surface3: requiredJsonColor(resolvedPalette, \"surface-3\"),\n text: requiredJsonColor(resolvedPalette, \"text\"),\n textSoft: requiredJsonColor(resolvedPalette, \"text-soft\"),\n accentText: requiredJsonColor(resolvedPalette, \"accent-text\"),\n accentSurface: requiredJsonColor(resolvedPalette, \"accent-surface\"),\n accentSurfaceText: requiredJsonColor(\n resolvedPalette,\n \"accent-surface-text\",\n ),\n focus: requiredJsonColor(resolvedPalette, \"focus\"),\n shadow: requiredJsonColor(resolvedPalette, \"shadow\"),\n };\n return {\n colors,\n colorTokens: {\n ...colorTokens,\n \"#border\": requiredJsonColor(borderTokens, \"#border\"),\n \"#border-strong\": requiredJsonColor(borderTokens, \"#border-strong\"),\n ...syntaxTokens,\n },\n tokens: resolveThemeTokens(theme.tokens),\n presets: resolveTypographyPresets(theme.presets),\n contrast: scores,\n diagnostics,\n };\n}\n\nfunction mix(\n base: string,\n target: string,\n value: number | [number, number],\n space: \"okhsl\" | \"srgb\" = \"okhsl\",\n): ColorMap[string] {\n return { type: \"mix\", base, target, value, space };\n}\n\nfunction statusColors(name: string, from: GlazeColorValue): ColorMap {\n return {\n [name]: {\n from,\n base: \"surface\",\n role: \"border\",\n contrast: { apca: [30, 45] },\n mode: \"auto\",\n },\n [`${name}-text`]: {\n from,\n base: \"surface\",\n role: \"text\",\n contrast: { apca: [60, 75] },\n mode: \"auto\",\n },\n [`${name}-surface`]: mix(\"surface\", name, [12, 18], \"srgb\"),\n };\n}\n\nfunction requiredResolvedColor(\n colors: ReturnType<ReturnType<typeof glaze>[\"resolve\"]>,\n name: string,\n) {\n const color = colors.get(name);\n if (!color) throw new Error(`The Glaze ${name} color failed to resolve.`);\n return color;\n}\n\nfunction requiredJsonColor(\n colors: Record<string, Record<string, string>>,\n name: string,\n): Record<string, string> {\n const color = colors[name];\n if (!color) throw new Error(`The Glaze ${name} token failed to export.`);\n return color;\n}\n\nfunction normalizeBrand(\n brand: BrandConfig | undefined,\n): Exclude<BrandConfig, GlazeColorValue> & { from: GlazeColorValue } {\n if (typeof brand === \"object\" && brand !== null && \"from\" in brand)\n return brand;\n return { from: brand ?? \"#315efb\" };\n}\n\nfunction score(\n foreground: ResolvedColorVariant,\n background: ResolvedColorVariant,\n): number {\n return Math.abs(apcaContrast(luminance(foreground), luminance(background)));\n}\n\nfunction luminance(variant: ResolvedColorVariant): number {\n const { h, s, l } = variantToOkhsl(variant);\n return relativeLuminanceFromLinearRgb(\n okhslToLinearSrgb(h, s, l, variant.pastel),\n );\n}\n","const comment = \"var(--syntax-comment-color)\";\nconst punctuation = \"var(--syntax-punctuation-color)\";\nconst keyword = \"var(--syntax-keyword-color)\";\nconst string = \"var(--syntax-string-color)\";\nconst token = \"var(--syntax-token-color)\";\nconst property = \"var(--syntax-property-color)\";\nconst number = \"var(--syntax-number-color)\";\nconst func = \"var(--syntax-function-color)\";\nconst value = \"var(--syntax-value-color)\";\nconst operator = \"var(--syntax-operator-color)\";\nconst foreground = \"var(--syntax-text-color)\";\nconst background = \"var(--syntax-bg-color)\";\nconst inserted = \"var(--green-text-color)\";\nconst deleted = \"var(--red-text-color)\";\n\ntype HighlightToken = {\n content: string;\n offset: number;\n color?: string;\n};\n\nconst shellLanguages = new Set([\"bash\", \"sh\", \"shell\", \"shellscript\", \"zsh\"]);\nconst shellPlaceholder = /<[A-Za-z][A-Za-z0-9_-]*>/g;\n\n/**\n * Shell grammars interpret documentation placeholders such as `<plan-id>` as\n * redirections and can split the final character into an unscoped token. Keep\n * the placeholder name visually coherent while retaining the operator color\n * on the angle brackets.\n */\nconst bashPlaceholderTransformer = {\n name: \"cookbook:bash-placeholders\",\n enforce: \"post\" as const,\n tokens(\n this: { source: string; options: { lang?: string } },\n lines: HighlightToken[][],\n ): HighlightToken[][] | undefined {\n if (!this.options.lang || !shellLanguages.has(this.options.lang)) return;\n const ranges = [...this.source.matchAll(shellPlaceholder)].map((match) => ({\n start: (match.index ?? 0) + 1,\n end: (match.index ?? 0) + match[0].length - 1,\n }));\n if (ranges.length === 0) return;\n\n for (const line of lines) {\n for (const highlighted of line) {\n const start = highlighted.offset;\n const end = start + highlighted.content.length;\n if (ranges.some((range) => start < range.end && end > range.start)) {\n highlighted.color = string;\n }\n }\n }\n return lines;\n },\n};\n\ntype HastElement = {\n properties: Record<string, unknown>;\n};\n\ntype DiffTransformerContext = {\n source: string;\n options: { lang?: string };\n addClassToHast(element: HastElement, className: string): HastElement;\n};\n\nconst diffLanguages = new Set([\"diff\", \"patch\"]);\n\n/**\n * The diff grammar colors individual tokens, but it does not expose a stable\n * whole-line selector. Add semantic classes so insertions and deletions can\n * receive subtle, full-width surfaces without hiding their +/- markers.\n */\nconst diffLineTransformer = {\n name: \"cookbook:diff-lines\",\n pre(this: DiffTransformerContext, element: HastElement): void {\n if (this.options.lang && diffLanguages.has(this.options.lang)) {\n this.addClassToHast(element, \"td-diff\");\n }\n },\n line(\n this: DiffTransformerContext,\n element: HastElement,\n lineNumber: number,\n ): void {\n if (!this.options.lang || !diffLanguages.has(this.options.lang)) return;\n\n const line = this.source.split(/\\r?\\n/)[lineNumber - 1] ?? \"\";\n if (line.startsWith(\"+\") && !line.startsWith(\"+++\")) {\n this.addClassToHast(element, \"td-diff-line--inserted\");\n } else if (line.startsWith(\"-\") && !line.startsWith(\"---\")) {\n this.addClassToHast(element, \"td-diff-line--deleted\");\n }\n },\n};\n\n/**\n * Astro loads fenced-code grammars lazily. MDX embeds TSX, but loading MDX by\n * itself leaves that embedded grammar unavailable and produces partially\n * highlighted imports and JSX. Preload TSX while preserving consumer-supplied\n * languages and transformers.\n */\nexport function cookbookShikiConfig(\n config: Record<string, unknown> | undefined,\n): Record<string, unknown> {\n const languages = Array.isArray(config?.langs) ? [...config.langs] : [];\n const transformers = Array.isArray(config?.transformers)\n ? [...config.transformers]\n : [];\n const hasTsx = languages.some(\n (language) =>\n language === \"tsx\" ||\n (typeof language === \"object\" &&\n language !== null &&\n \"name\" in language &&\n language.name === \"tsx\"),\n );\n\n if (!transformers.includes(bashPlaceholderTransformer)) {\n transformers.push(bashPlaceholderTransformer);\n }\n if (!transformers.includes(diffLineTransformer)) {\n transformers.push(diffLineTransformer);\n }\n\n return {\n ...config,\n langs: hasTsx ? languages : [...languages, \"tsx\"],\n theme: tastyCodeTheme,\n transformers,\n };\n}\n\n/**\n * Shiki performs the grammatical classification, while every emitted color\n * remains a reference to a Glaze-generated token owned by Tasty.\n */\nconst tastyCodeTheme = {\n name: \"tasty-code\",\n type: \"light\" as const,\n fg: foreground,\n bg: background,\n colors: {\n \"editor.background\": background,\n \"editor.foreground\": foreground,\n },\n settings: [\n {\n scope: [\n \"comment\",\n \"comment.line\",\n \"comment.block\",\n \"punctuation.definition.comment\",\n ],\n settings: { foreground: comment, fontStyle: \"italic\" },\n },\n {\n scope: [\n \"keyword\",\n \"keyword.control\",\n \"keyword.other\",\n \"storage.type\",\n \"storage.modifier\",\n \"keyword.control.at-rule.tasty\",\n \"keyword.control.at-rule.media.tasty\",\n \"keyword.control.at-rule.media-type.tasty\",\n \"keyword.control.at-rule.starting.tasty\",\n \"keyword.control.state-alias.tasty\",\n ],\n settings: { foreground: keyword },\n },\n {\n scope: [\n \"string\",\n \"string.quoted\",\n \"string.template\",\n \"string.quoted.attribute-value.tasty\",\n \"string.unquoted.attribute-value.tasty\",\n ],\n settings: { foreground: string },\n },\n {\n scope: [\n \"support.constant.color.tasty-token\",\n \"support.constant.color.tasty-token.builtin\",\n \"constant.other.color.tasty-token\",\n \"constant.other.color.tasty\",\n \"constant.other.color.hex\",\n \"constant.other.color.rgb-value\",\n ],\n settings: { foreground: token },\n },\n {\n scope: [\n \"constant.numeric\",\n \"constant.numeric.tasty\",\n \"constant.numeric.custom-unit.tasty\",\n \"constant.numeric.css-with-unit\",\n \"constant.numeric.bare.tasty\",\n \"constant.numeric.css\",\n \"constant.numeric.keyframe-step.tasty\",\n \"constant.language.boolean.tasty\",\n ],\n settings: { foreground: number },\n },\n {\n scope: [\n \"support.type.property-name.tasty\",\n \"variable.other.constant.tasty\",\n \"entity.other.attribute-name.tsx\",\n \"entity.other.attribute-name.jsx\",\n ],\n settings: { foreground: property },\n },\n {\n scope: [\"variable\", \"variable.other\"],\n settings: { foreground },\n },\n {\n scope: [\n \"entity.name.function\",\n \"support.function\",\n \"support.function.misc.css\",\n \"entity.name.tag\",\n \"entity.name.tag.tsx\",\n \"support.class.component\",\n \"entity.name.type.tasty\",\n \"entity.name.tag.tasty\",\n ],\n settings: { foreground: func },\n },\n {\n scope: [\n \"support.constant.property-value.tasty\",\n \"support.constant.property-value.tasty-display\",\n \"support.constant.property-value.tasty-directional\",\n \"support.constant.property-value.tasty-preset\",\n \"support.constant.property-value.tasty-shape\",\n \"support.constant.property-value.tasty-scrollbar\",\n \"support.constant.property-value.tasty-state\",\n \"support.constant.property-value.tasty-cursor\",\n \"support.constant.property-value.tasty-overflow\",\n \"support.constant.property-value.tasty-position\",\n \"support.constant.property-value.tasty-flex\",\n \"support.constant.property-value.tasty-font\",\n \"support.constant.property-value.tasty-text\",\n \"support.constant.property-value.tasty-alignment\",\n \"support.constant.property-value.tasty-border-style\",\n \"support.constant.property-value.tasty-whitespace\",\n \"support.constant.property-value.tasty-global\",\n \"support.constant.property-value.tasty-transition\",\n \"support.constant.property-value.css-syntax\",\n \"entity.other.attribute-name\",\n \"entity.other.attribute-name.tasty\",\n \"entity.other.attribute-name.pseudo-class.tasty\",\n \"entity.other.attribute-name.pseudo-class.css\",\n \"entity.other.attribute-name.class.tasty\",\n \"entity.other.attribute-name.pseudo-element.css\",\n \"punctuation.definition.entity.css\",\n ],\n settings: { foreground: value },\n },\n {\n scope: [\n \"keyword.operator\",\n \"keyword.operator.logical.tasty\",\n \"keyword.operator.arithmetic.css\",\n \"keyword.operator.assignment\",\n \"keyword.operator.selector-affix.tasty\",\n \"keyword.operator.attribute-selector.tasty\",\n \"keyword.operator.comparison.tasty\",\n ],\n settings: { foreground: operator },\n },\n {\n scope: [\n \"punctuation.definition.string\",\n \"punctuation.separator\",\n \"punctuation.definition.block\",\n \"punctuation.definition.array\",\n \"punctuation.section\",\n \"punctuation.definition.auto-calc\",\n \"punctuation.definition.attribute-selector\",\n \"punctuation.definition.tag\",\n \"punctuation.definition.pseudo-class\",\n \"punctuation.definition.fallback\",\n \"meta.brace\",\n ],\n settings: { foreground: punctuation },\n },\n {\n scope: [\"keyword.control.at-rule\", \"entity.name.tag.class.css\"],\n settings: { foreground: keyword },\n },\n {\n scope: [\"support.type.property-name.css\", \"meta.property-name.css\"],\n settings: { foreground: property },\n },\n {\n scope: [\"punctuation.definition.inserted.diff\"],\n settings: { foreground: inserted, fontStyle: \"bold\" },\n },\n {\n scope: [\"punctuation.definition.deleted.diff\"],\n settings: { foreground: deleted, fontStyle: \"bold\" },\n },\n ],\n};\n","import type { ConfigTokens } from \"@tenphi/tasty/core\";\nimport type { ResolvedDocsTheme } from \"./index.js\";\n\nexport const TASTY_UNITS = {\n x: \"var(--gap)\",\n r: \"var(--radius)\",\n cr: \"var(--card-radius)\",\n bw: \"var(--border-width)\",\n} as const;\n\nexport function tastyTokens(theme: ResolvedDocsTheme): ConfigTokens {\n const tokens = Object.fromEntries(\n Object.entries(theme.tokens).filter(([name]) => name.startsWith(\"$\")),\n ) as ConfigTokens;\n\n Object.assign(tokens, theme.colorTokens as ConfigTokens);\n\n return tokens;\n}\n","import { mergeStyles, type Styles } from \"@tenphi/tasty/core\";\nimport {\n COOKBOOK_COMPONENT_NAMES,\n type ComponentStyleConfig,\n type ComponentStylesConfig,\n type CookbookComponentName,\n} from \"@tenphi/docs\";\n\n// Astro can load the integration and renderer through separate module graphs.\n// Keep their component configuration on the shared process global.\nconst sharedConfiguration = globalThis as typeof globalThis & {\n __tenphiCookbookComponentStyles?: ComponentStylesConfig;\n};\nconst cookbookComponentNames = new Set<string>(COOKBOOK_COMPONENT_NAMES);\n\nexport function configureComponentStyles(\n styles: ComponentStylesConfig | undefined,\n): void {\n sharedConfiguration.__tenphiCookbookComponentStyles = styles ?? {};\n}\n\nexport function resolveComponentStyles(\n name: CookbookComponentName,\n baseStyles: Styles,\n): Styles {\n const configuredStyles = sharedConfiguration\n .__tenphiCookbookComponentStyles?.[name] as\n ComponentStyleConfig | undefined;\n return configuredStyles\n ? mergeStyles(baseStyles, configuredStyles as Styles)\n : baseStyles;\n}\n\nexport function resolveComponentStyleOverride(\n name: CookbookComponentName,\n): Styles | undefined {\n return sharedConfiguration.__tenphiCookbookComponentStyles?.[name] as\n Styles | undefined;\n}\n\n/** Preserve custom anatomy names from the pre-component style API. */\nexport function resolveLegacyAnatomyStyles(\n styles: ComponentStylesConfig | undefined,\n): Record<string, Styles> | undefined {\n if (!styles) return undefined;\n const entries = Object.entries(styles)\n .filter(\n (entry): entry is [string, ComponentStyleConfig] =>\n !cookbookComponentNames.has(entry[0]) && entry[1] !== undefined,\n )\n .map(([name, value]) => [`[data-tasty-anatomy=\"${name}\"]`, value]);\n return entries.length\n ? (Object.fromEntries(entries) as Record<string, Styles>)\n : undefined;\n}\n","export function resolveComponentOverrides(\n defaults: Record<string, string>,\n overrides: Record<string, string | false> | undefined,\n disabledFooterPath: string,\n): Record<string, string> {\n const resolved = { ...defaults };\n\n for (const [name, override] of Object.entries(overrides ?? {})) {\n if (name === \"Footer\" && override === false) {\n resolved.Footer = disabledFooterPath;\n } else if (typeof override === \"string\") {\n resolved[name] = override;\n }\n }\n\n return resolved;\n}\n","import { configure } from \"@tenphi/tasty\";\n\nexport const cookbookStates = {\n \"@mobile\": \"@media(w < 50rem)\",\n \"@desktop\": \"@media(w >= 50rem)\",\n \"@small\": \"@media(w <= 40rem)\",\n \"@shell-mobile\": \"@media(w <= 48rem)\",\n \"@shell-desktop\": \"@media(w > 48rem)\",\n \"@narrow-layout\": \"@media(w < 72rem)\",\n \"@medium-layout\": \"@media(w >= 50rem) & @media(w < 72rem)\",\n \"@reduced-motion\": \"@media(prefers-reduced-motion: reduce)\",\n};\n\nlet configured = false;\n\n/** Configure aliases in the renderer's Tasty module before styles are parsed. */\nexport function configureCookbookStates() {\n if (configured) return;\n configure({ states: cookbookStates });\n configured = true;\n}\n","import { existsSync } from \"node:fs\";\nimport {\n cp,\n mkdir,\n readFile,\n readdir,\n unlink,\n writeFile,\n} from \"node:fs/promises\";\nimport { createRequire } from \"node:module\";\nimport { dirname, extname, join } from \"node:path\";\nimport { fileURLToPath, pathToFileURL } from \"node:url\";\nimport starlight from \"./starlight-runtime.js\";\nimport {\n createDocsGraph,\n assertValidDocs,\n type DocsConfig,\n type NavigationItem,\n} from \"@tenphi/docs\";\nimport {\n configure,\n type ConfigTokens,\n type Styles,\n type TypographyPreset,\n} from \"@tenphi/tasty/core\";\nimport { tastyIntegration } from \"@tenphi/tasty/ssr/astro\";\nimport type { AstroIntegration, HookParameters } from \"astro\";\nimport {\n resolveNavigationLayout,\n type ResolvedNavigationLayout,\n} from \"./navigation.js\";\nimport { rehypeMermaid, satteriMermaid } from \"./markdown/rehype-mermaid.js\";\nimport {\n rehypeTableScroll,\n satteriTableScroll,\n} from \"./markdown/rehype-table-scroll.js\";\nimport { resolveDocsTheme } from \"./theme/index.js\";\nimport { cookbookShikiConfig } from \"./theme/shiki-theme.js\";\nimport { TASTY_UNITS, tastyTokens } from \"./theme/tasty-config.js\";\nimport {\n configureComponentStyles,\n resolveLegacyAnatomyStyles,\n} from \"./components/component-styles.js\";\nimport { resolveComponentOverrides } from \"./component-overrides.js\";\nimport { cookbookStates } from \"./components/tasty-states.js\";\n\nconst packageRequire = createRequire(import.meta.url);\nconst starlightRoot = dirname(packageRequire.resolve(\"@astrojs/starlight\"));\nconst tastyStaticMiddleware = packageRequire.resolve(\n \"@tenphi/tasty/ssr/astro-middleware-static\",\n);\nconst tastyExtractStaticMiddleware = packageRequire.resolve(\n \"@tenphi/tasty/ssr/astro-middleware-extract-static\",\n);\nconst astroReactServer = packageRequire.resolve(\"@astrojs/react/server.js\");\nconst astroReactClient = packageRequire.resolve(\"@astrojs/react/client.js\");\nconst astroReactIntegration = packageRequire.resolve(\"@astrojs/react\");\nconst importNative = new Function(\"specifier\", \"return import(specifier)\") as (\n specifier: string,\n) => Promise<{ default: () => AstroIntegration }>;\n\nexport interface CookbookOptions {\n config?: DocsConfig;\n root?: string;\n}\n\nexport default function cookbook(\n options: CookbookOptions = {},\n): AstroIntegration {\n const docsTheme = resolveDocsTheme(options.config?.theme);\n if (\n docsTheme.diagnostics.some((diagnostic) => diagnostic.severity === \"error\")\n ) {\n throw new Error(\n docsTheme.diagnostics.map((diagnostic) => diagnostic.message).join(\"\\n\"),\n );\n }\n configureTastyTheme(options.config?.theme, docsTheme);\n configureComponentStyles(options.config?.theme?.styles);\n const headerPath = fileURLToPath(\n new URL(\"./overrides/Header.astro\", import.meta.url),\n );\n const footerPath = fileURLToPath(\n new URL(\"./overrides/Footer.astro\", import.meta.url),\n );\n const emptyFooterPath = fileURLToPath(\n new URL(\"./overrides/EmptyFooter.astro\", import.meta.url),\n );\n const sidebarPath = fileURLToPath(\n new URL(\"./overrides/Sidebar.astro\", import.meta.url),\n );\n const mobileMenuFooterPath = fileURLToPath(\n new URL(\"./overrides/MobileMenuFooter.astro\", import.meta.url),\n );\n const mobileMenuTogglePath = fileURLToPath(\n new URL(\"./overrides/MobileMenuToggle.astro\", import.meta.url),\n );\n const themeSelectPath = fileURLToPath(\n new URL(\"./overrides/ThemeSelect.astro\", import.meta.url),\n );\n const components = resolveComponentOverrides(\n {\n Footer: footerPath,\n Header: headerPath,\n Sidebar: sidebarPath,\n MobileMenuFooter: mobileMenuFooterPath,\n MobileMenuToggle: mobileMenuTogglePath,\n ThemeSelect: themeSelectPath,\n },\n options.config?.components?.overrides,\n emptyFooterPath,\n );\n const navigation = resolveNavigationLayout(options.config?.navigation);\n // Tasty 3.6's integration shape is structurally compatible with Astro 7;\n // its published helper type still models `site` as URL-only.\n const tasty = tastyIntegration({\n islands: false,\n css: { mode: \"extract\" },\n }) as unknown as AstroIntegration;\n let inner: AstroIntegration[] = [tasty];\n let projectRoot = options.root;\n let graphConfig = options.config;\n let graph: Awaited<ReturnType<typeof createDocsGraph>> | undefined;\n let usingContentCollection = false;\n\n async function loadGraph(refresh = false) {\n if (!graph || refresh) {\n graph = await createDocsGraph({\n ...(projectRoot ? { root: projectRoot } : {}),\n ...(graphConfig ? { config: graphConfig } : {}),\n });\n assertValidDocs(graph);\n }\n return graph;\n }\n\n return {\n name: \"cookbook\",\n hooks: {\n \"astro:config:setup\": async (context) => {\n const react = (\n await importNative(pathToFileURL(astroReactIntegration).href)\n ).default();\n if (\n context.config.integrations.some(\n (integration) => integration.name === \"@astrojs/starlight\",\n )\n ) {\n throw new Error(\n \"Cookbook already includes Starlight. Remove the direct @astrojs/starlight integration before continuing.\",\n );\n }\n projectRoot ??= fileURLToPath(context.config.root);\n const base = options.config?.build?.base ?? context.config.base;\n graphConfig = {\n ...options.config,\n build: { ...options.config?.build, base },\n };\n usingContentCollection = hasContentConfig(context.config.srcDir);\n registerCookbookMarkdownPlugins(context.config.markdown.processor);\n const starlightIntegration = starlight({\n title: options.config?.site?.title ?? \"Documentation\",\n expressiveCode: false,\n ...(options.config?.head ? { head: options.config.head } : {}),\n ...(options.config?.site?.description\n ? { description: options.config.site.description }\n : {}),\n ...(options.config?.search?.enabled === false\n ? { pagefind: false }\n : {}),\n ...(!usingContentCollection ? { disable404Route: true } : {}),\n components,\n sidebar: usingContentCollection ? starlightSidebar(navigation) : [],\n });\n inner = [react, tasty, starlightIntegration];\n let markdownRuntime = {\n image: context.config.image,\n markdown: {\n ...context.config.markdown,\n syntaxHighlight: \"shiki\" as const,\n shikiConfig: cookbookShikiConfig(\n context.config.markdown.shikiConfig,\n ),\n },\n srcDir: context.config.srcDir,\n };\n let markdownRenderer: ReturnType<\n typeof markdownRuntime.markdown.processor.createRenderer\n >;\n context.updateConfig({\n base,\n output: \"static\",\n markdown: {\n syntaxHighlight: \"shiki\",\n shikiConfig: cookbookShikiConfig(\n context.config.markdown.shikiConfig,\n ),\n },\n vite: {\n ssr: {\n external: [\n \"@tenphi/docs\",\n \"react\",\n \"react-dom\",\n \"react-dom/server\",\n ],\n },\n plugins: [\n stripStarlightStylesPlugin(starlightRoot),\n virtualDocsPlugin(async () => {\n const loaded = await loadGraph();\n const entries = usingContentCollection\n ? loaded.entries\n : await Promise.all(\n loaded.entries.map(async (entry) => {\n const { image, markdown, srcDir } = markdownRuntime;\n markdownRenderer ??= markdown.processor.createRenderer({\n image,\n syntaxHighlight: markdown.syntaxHighlight,\n shikiConfig: markdown.shikiConfig,\n gfm: markdown.gfm,\n smartypants: markdown.smartypants,\n } as unknown as Parameters<\n typeof markdown.processor.createRenderer\n >[0]);\n const renderer = await markdownRenderer;\n const rendered = await renderer.render(\n entry.transformedBody,\n {\n frontmatter: entry.frontmatter,\n fileURL: starlightContentUrl(entry.route, srcDir),\n },\n );\n return {\n ...entry,\n rendered: {\n html: rendered.code,\n headings: rendered.metadata.headings,\n },\n };\n }),\n );\n return {\n entries,\n routes: loaded.routes,\n site: documentedSite(loaded),\n base: loaded.config.build.base,\n search: loaded.config.search.enabled,\n };\n }, navigation),\n ],\n resolve: {\n alias: [\n {\n find: \"@astrojs/starlight\",\n replacement: starlightRoot,\n },\n {\n find: \"@tenphi/tasty/ssr/astro-middleware-static\",\n replacement: tastyStaticMiddleware,\n },\n {\n find: \"@tenphi/tasty/ssr/astro-middleware-extract-static\",\n replacement: tastyExtractStaticMiddleware,\n },\n {\n find: \"@astrojs/react/server.js\",\n replacement: astroReactServer,\n },\n {\n find: \"@astrojs/react/client.js\",\n replacement: astroReactClient,\n },\n ],\n },\n },\n });\n await callInner(inner.slice(0, 2), \"astro:config:setup\", context);\n\n if (!usingContentCollection) {\n graph = await createDocsGraph({\n root: projectRoot,\n config: graphConfig,\n });\n assertValidDocs(graph);\n context.injectRoute({\n pattern: \"[...route]\",\n entrypoint: new URL(\"./routes/DocsPage.astro\", import.meta.url),\n prerender: true,\n });\n }\n\n // Starlight inserts its own follow-up integrations immediately after\n // itself. Give it a temporary real position so Astro processes those\n // once, after this composite integration, rather than re-visiting us.\n const starlightWithPlugins = inner[2];\n if (starlightWithPlugins) {\n const selfIndex = context.config.integrations.findIndex(\n (integration) => integration.name === \"cookbook\",\n );\n context.config.integrations.splice(\n selfIndex + 1,\n 0,\n starlightWithPlugins,\n );\n try {\n await callInner(\n [starlightWithPlugins],\n \"astro:config:setup\",\n usingContentCollection\n ? context\n : withoutStarlightDocsRoute(context),\n );\n } finally {\n const placeholderIndex =\n context.config.integrations.indexOf(starlightWithPlugins);\n if (placeholderIndex >= 0)\n context.config.integrations.splice(placeholderIndex, 1);\n }\n }\n context.config.integrations.push({\n name: \"cookbook-markdown-renderer\",\n hooks: {\n \"astro:config:setup\": ({ config }) => {\n markdownRuntime = {\n image: config.image,\n markdown: {\n ...config.markdown,\n syntaxHighlight: \"shiki\" as const,\n shikiConfig: cookbookShikiConfig(config.markdown.shikiConfig),\n },\n srcDir: config.srcDir,\n };\n },\n },\n });\n },\n \"astro:config:done\": async (context) => {\n await callInner(inner, \"astro:config:done\", context);\n },\n \"astro:server:setup\": async ({ server }) => {\n let assets = docsAssetMap(await loadGraph());\n server.middlewares.use(async (request, response, next) => {\n if (request.method !== \"GET\" && request.method !== \"HEAD\") {\n next();\n return;\n }\n const pathname = requestPath(request.url);\n if (!pathname.includes(\"/_tasty-assets/\")) {\n next();\n return;\n }\n let asset = assets.get(pathname);\n if (!asset) {\n try {\n assets = docsAssetMap(await loadGraph(true));\n } catch {\n next();\n return;\n }\n asset = assets.get(pathname);\n }\n if (!asset?.sourcePath) {\n next();\n return;\n }\n try {\n const body = await readFile(asset.sourcePath);\n response.statusCode = 200;\n response.setHeader(\"Content-Type\", assetContentType(pathname));\n response.setHeader(\"Content-Length\", body.byteLength);\n response.setHeader(\"Cache-Control\", \"no-cache\");\n response.end(request.method === \"HEAD\" ? undefined : body);\n } catch {\n next();\n }\n });\n },\n \"astro:build:start\": async (context) => {\n await loadGraph();\n await callInner(inner, \"astro:build:start\", context);\n },\n \"astro:build:done\": async (context) => {\n await callInner(inner, \"astro:build:done\", context);\n const output = fileURLToPath(context.dir);\n for (const relativePath of await readdir(output, { recursive: true })) {\n if (extname(relativePath) !== \".html\") continue;\n const path = join(output, relativePath);\n const html = await readFile(path, \"utf8\");\n const sanitized = html\n .replace(\n /\\s*<link\\b(?=[^>]*rel=\"stylesheet\")(?=[^>]*href=\"data:text\\/css,\")[^>]*>/g,\n \"\",\n )\n .replace(/\\s*<style>\\s*<\\/style>/g, \"\")\n .replace(\n /\\sstyle=\"--sl-icon-size:\\s*([^;\\\"]+);?\"/g,\n ' width=\"$1\" height=\"$1\"',\n )\n .replace(/\\sstyle=\"--depth:\\s*([^;\\\"]+);?\"/g, ' data-depth=\"$1\"')\n .replace(\n /(<kbd\\b[^>]*)\\sstyle=\"display:\\s*none;?\"([^>]*>)/g,\n \"$1$2\",\n )\n .replace(\n /(<dialog\\b[^>]*)\\sstyle=\"padding:\\s*0;?\"([^>]*>)/g,\n \"$1$2\",\n );\n if (sanitized !== html) await writeFile(path, sanitized);\n }\n const pagefindOutput = join(output, \"pagefind\");\n if (existsSync(pagefindOutput)) {\n for (const name of await readdir(pagefindOutput)) {\n if (extname(name) === \".css\") {\n await unlink(join(pagefindOutput, name));\n }\n }\n }\n if (!graph) return;\n for (const asset of graph.assets) {\n if (!asset.sourcePath || !asset.publicPath) continue;\n const target = join(output, asset.publicPath.replace(/^\\//, \"\"));\n await mkdir(dirname(target), { recursive: true });\n await cp(asset.sourcePath, target);\n }\n },\n },\n };\n}\n\nfunction registerCookbookMarkdownPlugins(processor: {\n name: string;\n options: object;\n}): void {\n if (processor.name === \"unified\") {\n const options = processor.options as { rehypePlugins?: unknown };\n const plugins = Array.isArray(options.rehypePlugins)\n ? options.rehypePlugins\n : [];\n if (!plugins.includes(rehypeMermaid)) plugins.push(rehypeMermaid);\n if (!plugins.includes(rehypeTableScroll)) plugins.push(rehypeTableScroll);\n options.rehypePlugins = plugins;\n } else if (processor.name === \"satteri\") {\n const options = processor.options as { hastPlugins?: unknown };\n const plugins = Array.isArray(options.hastPlugins)\n ? options.hastPlugins\n : [];\n if (!plugins.includes(satteriMermaid)) plugins.push(satteriMermaid);\n if (!plugins.includes(satteriTableScroll)) plugins.push(satteriTableScroll);\n options.hastPlugins = plugins;\n }\n}\n\nfunction stripStarlightStylesPlugin(root: string) {\n const normalizedRoot = root.replaceAll(\"\\\\\", \"/\");\n const emptyPrintId = \"\\0cookbook:empty-starlight-print\";\n return {\n name: \"cookbook-strip-starlight-css\",\n enforce: \"pre\" as const,\n resolveId(source: string, importer: string | undefined) {\n if (\n importer?.replaceAll(\"\\\\\", \"/\").startsWith(`${normalizedRoot}/`) &&\n source.endsWith(\"/style/print.css?url&no-inline\")\n ) {\n return emptyPrintId;\n }\n return undefined;\n },\n load(id: string) {\n if (id === emptyPrintId) return 'export default \"data:text/css,\";';\n return undefined;\n },\n transform(code: string, id: string) {\n const normalizedId = id.replaceAll(\"\\\\\", \"/\");\n if (!normalizedId.startsWith(`${normalizedRoot}/`)) return undefined;\n const [pathname, query = \"\"] = normalizedId.split(\"?\", 2);\n const isStylesheet = pathname?.endsWith(\".css\");\n const isAstroStyle =\n pathname?.endsWith(\".astro\") && query.includes(\"type=style\");\n if (!isStylesheet && !isAstroStyle) return undefined;\n return { code: \"\", map: null };\n },\n };\n}\n\nfunction starlightContentUrl(route: string, srcDir: URL): URL {\n const slug = route === \"/\" ? \"index\" : route.replace(/^\\/+|\\/+$/g, \"\");\n return new URL(`content/docs/${slug}.md`, srcDir);\n}\n\nfunction docsAssetMap(graph: Awaited<ReturnType<typeof createDocsGraph>>) {\n return new Map(\n graph.assets.flatMap((asset) =>\n asset.publicPath && asset.sourcePath\n ? [[asset.publicPath, asset] as const]\n : [],\n ),\n );\n}\n\nfunction documentedSite(\n graph: Awaited<ReturnType<typeof createDocsGraph>>,\n): Awaited<ReturnType<typeof createDocsGraph>>[\"config\"][\"site\"] {\n if (graph.config.site.version) return graph.config.site;\n const packages = new Set(\n graph.entries.flatMap((entry) =>\n entry.package?.resolved ? [entry.package.resolved] : [],\n ),\n );\n if (packages.size !== 1) return graph.config.site;\n const resolved = packages.values().next().value;\n if (!resolved) return graph.config.site;\n const separator = resolved.lastIndexOf(\"@\");\n if (separator <= 0 || separator === resolved.length - 1)\n return graph.config.site;\n return { ...graph.config.site, version: resolved.slice(separator + 1) };\n}\n\nfunction requestPath(url: string | undefined): string {\n try {\n return decodeURIComponent(new URL(url ?? \"/\", \"http://localhost\").pathname);\n } catch {\n return \"\";\n }\n}\n\nfunction assetContentType(pathname: string): string {\n switch (extname(pathname).toLowerCase()) {\n case \".avif\":\n return \"image/avif\";\n case \".gif\":\n return \"image/gif\";\n case \".jpeg\":\n case \".jpg\":\n return \"image/jpeg\";\n case \".png\":\n return \"image/png\";\n case \".svg\":\n return \"image/svg+xml\";\n case \".webp\":\n return \"image/webp\";\n default:\n return \"application/octet-stream\";\n }\n}\n\nfunction configureTastyTheme(\n theme: DocsConfig[\"theme\"],\n resolved: ReturnType<typeof resolveDocsTheme>,\n): void {\n const tokens = tastyTokens(resolved) as ConfigTokens;\n const globalStyles = resolveLegacyAnatomyStyles(theme?.styles);\n\n configure({\n states: {\n ...cookbookStates,\n ...theme?.states,\n },\n units: TASTY_UNITS,\n tokens,\n presets: resolved.presets as Record<string, TypographyPreset>,\n ...(globalStyles\n ? { globalStyles: globalStyles as Record<string, Styles> }\n : {}),\n });\n}\n\nfunction starlightSidebar(layout: ResolvedNavigationLayout): unknown[] {\n const fallback = layout.items?.length\n ? layout.items.map(starlightSidebarItem)\n : [{ autogenerate: { directory: \"\" } }];\n if (!layout.sectioned) return fallback;\n\n return [\n ...(layout.fallbackSidebarGroup !== undefined\n ? [\n {\n label: \"Documentation\",\n items: (layout.items ?? []).map(starlightSidebarItem),\n },\n ]\n : []),\n ...layout.tabs.flatMap((tab) =>\n tab.items !== undefined\n ? [{ label: tab.label, items: tab.items.map(starlightSidebarItem) }]\n : [],\n ),\n ];\n}\n\nfunction starlightSidebarItem(item: NavigationItem): unknown {\n if (typeof item === \"string\") return { slug: routeToSlug(item) };\n if (\"items\" in item) {\n return {\n label: item.label,\n items: item.items.map(starlightSidebarItem),\n };\n }\n if (\"autogenerate\" in item) {\n return {\n label: item.label,\n items: [\n {\n autogenerate: {\n directory: routeToSlug(item.autogenerate.directory, false),\n },\n },\n ],\n };\n }\n return { label: item.label, link: item.link };\n}\n\nfunction routeToSlug(route: string, rootAsIndex = true): string {\n const slug = route.replace(/^\\/+|\\/+$/g, \"\");\n return slug || (rootAsIndex ? \"index\" : \"\");\n}\n\nexport function tastyStarlight(\n config: Parameters<typeof starlight>[0],\n): AstroIntegration {\n return starlight(config);\n}\n\nasync function callInner<K extends keyof AstroIntegration[\"hooks\"]>(\n integrations: AstroIntegration[],\n hook: K,\n context: HookParameters<K>,\n): Promise<void> {\n for (const integration of integrations) {\n const handler = integration.hooks[hook];\n if (typeof handler === \"function\") {\n await (handler as (value: HookParameters<K>) => void | Promise<void>)(\n context,\n );\n }\n }\n}\n\nfunction withoutStarlightDocsRoute(\n context: HookParameters<\"astro:config:setup\">,\n): HookParameters<\"astro:config:setup\"> {\n return new Proxy(context, {\n get(target, property, receiver) {\n if (property !== \"injectRoute\") {\n return Reflect.get(target, property, receiver);\n }\n return (route: Parameters<typeof context.injectRoute>[0]) => {\n if (route.pattern !== \"[...slug]\") context.injectRoute(route);\n };\n },\n });\n}\n\nfunction virtualDocsPlugin(\n getContent: () => unknown | Promise<unknown>,\n layout: ResolvedNavigationLayout,\n) {\n const configId = \"\\0virtual:cookbook/config\";\n const layoutId = \"\\0virtual:cookbook/layout\";\n return {\n name: \"cookbook-data\",\n resolveId(id: string) {\n if (id === \"virtual:cookbook/config\") return configId;\n if (id === \"virtual:cookbook/layout\") return layoutId;\n return undefined;\n },\n async load(id: string) {\n if (id === configId) {\n return `export const content = ${JSON.stringify(await getContent())};`;\n }\n if (id === layoutId) {\n return `export const layout = ${JSON.stringify(layout)};`;\n }\n return undefined;\n },\n };\n}\n\nfunction hasContentConfig(srcDir: URL): boolean {\n const source = fileURLToPath(srcDir);\n return [\n \"content.config.ts\",\n \"content.config.mts\",\n \"content.config.js\",\n \"content.config.mjs\",\n \"content/config.ts\",\n ].some((path) => existsSync(join(source, path)));\n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AC5C,aAAa,KAAK,mBAAmB;CAGvC,OAAO;EACL,GAAG;EACH,OAAO,SAAS,YAAY,CAAC,GAAG,WAAW,KAAK;EAChD,OAAO;EACP;CACF;AACF;;;;;AAMA,MAAM,iBAAiB;CACrB,MAAM;CACN,MAAM;CACN,IAAI;CACJ,IAAI;CACJ,QAAQ;EACN,qBAAqB;EACrB,qBAAqB;CACvB;CACA,UAAU;EACR;GACE,OAAO;IACL;IACA;IACA;IACA;GACF;GACA,UAAU;IAAE,YAAY;IAAS,WAAW;GAAS;EACvD;EACA;GACE,OAAO;IACL;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;GACF;GACA,UAAU,EAAE,YAAY,QAAQ;EAClC;EACA;GACE,OAAO;IACL;IACA;IACA;IACA;IACA;GACF;GACA,UAAU,EAAE,YAAY,OAAO;EACjC;EACA;GACE,OAAO;IACL;IACA;IACA;IACA;IACA;IACA;GACF;GACA,UAAU,EAAE,YAAY,MAAM;EAChC;EACA;GACE,OAAO;IACL;IACA;IACA;IACA;IACA;IACA;IACA;IACA;GACF;GACA,UAAU,EAAE,YAAY,OAAO;EACjC;EACA;GACE,OAAO;IACL;IACA;IACA;IACA;GACF;GACA,UAAU,EAAE,YAAY,SAAS;EACnC;EACA;GACE,OAAO,CAAC,YAAY,gBAAgB;GACpC,UAAU,EAAE,WAAW;EACzB;EACA;GACE,OAAO;IACL;IACA;IACA;IACA;IACA;IACA;IACA;IACA;GACF;GACA,UAAU,EAAE,YAAY,KAAK;EAC/B;EACA;GACE,OAAO;IACL;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;GACF;GACA,UAAU,EAAE,YAAY,MAAM;EAChC;EACA;GACE,OAAO;IACL;IACA;IACA;IACA;IACA;IACA;IACA;GACF;GACA,UAAU,EAAE,YAAY,SAAS;EACnC;EACA;GACE,OAAO;IACL;IACA;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AY,YACrB,MAAO,QACL,OACF;CAEJ;AACF;AAEA,SAAS,0BACP,SACsC;CACtC,OAAO,IAAI,MAAM,SAAS,EACxB,IAAI,QAAQ,UAAU,UAAU;EAC9B,IAAI,aAAa,eACf,OAAO,QAAQ,IAAI,QAAQ,UAAU,QAAQ;EAE/C,QAAQ,UAAqD;GAC3D,IAAI,MAAM,YAAY,aAAa,QAAQ,YAAY,KAAK;EAC9D;CACF,EACF,CAAC;AACH;AAEA,SAAS,kBACP,YACA,QACA;CACA,MAAM,WAAW;CACjB,MAAM,WAAW;CACjB,OAAO;EACL,MAAM;EACN,UAAU,IAAY;GACpB,IAAI,OAAO,2BAA2B,OAAO;GAC7C,IAAI,OAAO,2BAA2B,OAAO;EAE/C;EACA,MAAM,KAAK,IAAY;GACrB,IAAI,OAAO,UACT,OAAO,0BAA0B,KAAK,UAAU,MAAM,WAAW,CAAC,EAAE;GAEtE,IAAI,OAAO,UACT,OAAO,yBAAyB,KAAK,UAAU,MAAM,EAAE;EAG3D;CACF;AACF;AAEA,SAAS,iBAAiB,QAAsB;CAC9C,MAAM,SAAS,cAAc,MAAM;CACnC,OAAO;EACL;EACA;EACA;EACA;EACA;CACF,CAAC,CAAC,MAAM,SAAS,WAAW,KAAK,QAAQ,IAAI,CAAC,CAAC;AACjD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tenphi/starlight",
3
- "version": "0.9.6",
3
+ "version": "0.10.0",
4
4
  "description": "Astro and Starlight renderer for Cookbook",
5
5
  "type": "module",
6
6
  "sideEffects": [
@@ -49,7 +49,7 @@
49
49
  "@astrojs/starlight": "^0.41.10",
50
50
  "@fontsource-variable/jetbrains-mono": "^5.3.0",
51
51
  "@fontsource-variable/onest": "^5.3.0",
52
- "@tenphi/docs": "0.9.6",
52
+ "@tenphi/docs": "0.10.0",
53
53
  "@tenphi/glaze": "2.0.0",
54
54
  "@tenphi/tasty": "3.6.0",
55
55
  "beautiful-mermaid": "^1.1.3",