@tenphi/starlight 0.10.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/code-copy.d.ts +1 -0
- package/dist/client/code-copy.js +57 -0
- package/dist/client/code-copy.js.map +1 -0
- package/dist/components/GlobalStyles.js +296 -145
- package/dist/components/LayoutComponents.js +6 -2
- package/dist/components/LayoutComponents.test.ts +8 -0
- package/dist/components/TastyComponents.js +1 -1
- package/dist/components/tasty-states.js +1 -0
- package/dist/icons/check.svg +1 -0
- package/dist/icons/favicon.svg +11 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +337 -14
- package/dist/index.js.map +1 -1
- package/dist/markdown/rendered-content.d.ts +6 -0
- package/dist/markdown/rendered-content.d.ts.map +1 -0
- package/dist/markdown/rendered-content.js +33 -0
- package/dist/markdown/rendered-content.js.map +1 -0
- package/dist/overrides/Header.astro +2 -0
- package/dist/overrides/MarkdownContent.astro +7 -0
- package/dist/routes/DocsPage.astro +9 -0
- package/package.json +4 -3
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('\"', \""\").replaceAll(\"'\", \"'\");\n}\n\nfunction escapeText(value: string): string {\n return value\n .replaceAll(\"&\", \"&\")\n .replaceAll(\"<\", \"<\")\n .replaceAll(\">\", \">\");\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}\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,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Y,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;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;GACF;GACA,UAAU,EAAE,YAAY,YAAY;EACtC;EACA;GACE,OAAO,CAAC,2BAA2B,2BAA2B;GAC9D,UAAU,EAAE,YAAY,QAAQ;EAClC;EACA;GACE,OAAO,CAAC,kCAAkC,wBAAwB;GAClE,UAAU,EAAE,YAAY,SAAS;EACnC;EACA;GACE,OAAO,CAAC,sCAAsC;GAC9C,UAAU;IAAE,YAAY;IAAU,WAAW;GAAO;EACtD;EACA;GACE,OAAO,CAAC,qCAAqC;GAC7C,UAAU;IAAE,YAAY;IAAS,WAAW;GAAO;EACrD;CACF;AACF;;;ACjTA,MAAa,cAAc;CACzB,GAAG;CACH,GAAG;CACH,IAAI;CACJ,IAAI;AACN;AAEA,SAAgB,YAAY,OAAwC;CAClE,M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AAO,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"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["errorMessage"],"sources":["../src/markdown/rehype-mermaid.ts","../src/markdown/rehype-table-scroll.ts","../src/markdown/rehype-page-affordances.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/site-icons.ts","../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('\"', \""\").replaceAll(\"'\", \"'\");\n}\n\nfunction escapeText(value: string): string {\n return value\n .replaceAll(\"&\", \"&\")\n .replaceAll(\"<\", \"<\")\n .replaceAll(\">\", \">\");\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","type 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 textContent(node: Readonly<HastNode>): string;\n};\n\n/** Add copy controls to rendered Markdown code blocks. */\nexport function rehypePageAffordances() {\n return (tree: HastNode): void => addPageAffordances(tree);\n}\n\n/** Sätteri adapter for Astro's default Markdown processor. */\nexport const satteriPageAffordances = {\n name: \"cookbook:page-affordances\",\n element: {\n filter: [\"pre\"],\n visit(node: Readonly<HastNode>, context: SatteriContext): void {\n const replacement = pageAffordance(node as HastNode);\n if (replacement !== node) context.replaceNode(node, replacement);\n },\n },\n};\n\nfunction addPageAffordances(parent: HastNode): void {\n if (!parent.children) return;\n for (const [index, child] of parent.children.entries()) {\n const replacement = pageAffordance(child);\n if (replacement !== child) {\n parent.children[index] = replacement;\n continue;\n }\n addPageAffordances(child);\n }\n}\n\nfunction pageAffordance(node: HastNode): HastNode {\n if (isOrdinaryCodeBlock(node)) return codeBlockWithCopy(node);\n return node;\n}\n\nfunction isOrdinaryCodeBlock(node: HastNode): boolean {\n if (node.type !== \"element\" || node.tagName !== \"pre\") return false;\n const language =\n node.properties?.dataLanguage ?? node.properties?.[\"data-language\"];\n return language !== \"mermaid\" && node.children?.[0]?.tagName === \"code\";\n}\n\nfunction codeBlockWithCopy(pre: HastNode): HastNode {\n return element(\n \"cookbook-code-block\",\n { className: [\"td-code-block\"], dataTastyAnatomy: \"MarkdownCodeBlock\" },\n [\n pre,\n element(\n \"button\",\n {\n type: \"button\",\n dataCopyCode: \"\",\n ariaLabel: \"Copy code\",\n title: \"Copy code\",\n },\n [element(\"span\", { dataCopyIcon: \"\", ariaHidden: \"true\" }, [])],\n ),\n ],\n );\n}\n\nfunction element(\n tagName: string,\n properties: Record<string, unknown>,\n children: HastNode[],\n): HastNode {\n return { type: \"element\", tagName, properties, children };\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\",\n fontWeight: 420,\n boldFontWeight: 640,\n },\n heading: {\n fontFamily: BODY_FONT,\n fontSize: \"1rem\",\n lineHeight: 1.15,\n letterSpacing: \"-0.01em\",\n fontWeight: 640,\n boldFontWeight: 720,\n },\n h1: heading(\"clamp(2.5rem, 5vw, 3.25rem)\", 1.05, \"-0.025em\"),\n h2: heading(\"clamp(1.75rem, 3vw, 2.125rem)\", 1.1, \"-0.018em\"),\n h3: heading(\"1.5rem\", 1.15, \"-0.012em\"),\n h4: heading(\"1.25rem\", 1.2, \"-0.008em\"),\n h5: heading(\"1.125rem\", 1.25, \"-0.004em\"),\n h6: heading(\"1rem\", 1.3, \"0\"),\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 \"@compact\": \"@media(w <= 23rem)\",\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 { readFile } from \"node:fs/promises\";\nimport { extname, isAbsolute, resolve } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\nimport type { HeadConfig, SiteConfig } from \"@tenphi/docs\";\nimport sharp from \"sharp\";\n\nconst ICON_DIRECTORY = \"_cookbook/icons\";\nconst DEFAULT_ICON_BACKGROUND = \"#315efb\";\nconst SUPPORTED_SOURCE_FORMATS = new Set([\n \"avif\",\n \"gif\",\n \"heif\",\n \"jpeg\",\n \"jpg\",\n \"png\",\n \"svg\",\n \"webp\",\n]);\n\ninterface SiteIconAsset {\n body: Buffer;\n contentType: string;\n outputPath: string;\n publicPath: string;\n}\n\nexport interface SiteIconSet {\n assets: SiteIconAsset[];\n faviconPath: string;\n head: HeadConfig[];\n sourcePath: string;\n}\n\ninterface SiteIconOptions {\n base: string;\n root: string;\n site?: SiteConfig;\n themeColors: {\n dark: string;\n light: string;\n };\n}\n\nexport async function createSiteIcons({\n base,\n root,\n site = {},\n themeColors,\n}: SiteIconOptions): Promise<SiteIconSet> {\n const configured = site.favicon;\n const source =\n typeof configured === \"string\" ? configured : configured?.source;\n const sourcePath = source\n ? resolveSourcePath(source, root)\n : fileURLToPath(new URL(\"./icons/favicon.svg\", import.meta.url));\n const background =\n typeof configured === \"object\" && configured?.background\n ? configured.background\n : DEFAULT_ICON_BACKGROUND;\n const input = await readFile(sourcePath).catch((error: unknown) => {\n throw new Error(\n `Unable to read site.favicon source at ${sourcePath}: ${errorMessage(error)}`,\n );\n });\n const metadata = await sharp(input, { animated: false }).metadata();\n const format = metadata.format?.toLowerCase();\n if (!format || !SUPPORTED_SOURCE_FORMATS.has(format)) {\n throw new Error(\n \"site.favicon must point to an SVG, PNG, JPEG, WebP, AVIF, or GIF image.\",\n );\n }\n\n const definitions = [\n await pngAsset(input, base, \"favicon-32x32.png\", 32),\n await safePngAsset(input, base, \"apple-touch-icon.png\", 180, background),\n await pngAsset(input, base, \"icon-192x192.png\", 192),\n await pngAsset(input, base, \"icon-512x512.png\", 512),\n await safePngAsset(\n input,\n base,\n \"icon-192x192-maskable.png\",\n 192,\n background,\n ),\n await safePngAsset(\n input,\n base,\n \"icon-512x512-maskable.png\",\n 512,\n background,\n ),\n ];\n\n const scalable =\n format === \"svg\"\n ? asset(base, \"favicon.svg\", input, \"image/svg+xml\")\n : undefined;\n const faviconPath = `/${ICON_DIRECTORY}/${scalable ? \"favicon.svg\" : \"favicon-32x32.png\"}`;\n const iconEntries = [\n {\n src: pathWithBase(base, `/${ICON_DIRECTORY}/icon-192x192.png`),\n sizes: \"192x192\",\n type: \"image/png\",\n purpose: \"any\",\n },\n {\n src: pathWithBase(base, `/${ICON_DIRECTORY}/icon-512x512.png`),\n sizes: \"512x512\",\n type: \"image/png\",\n purpose: \"any\",\n },\n {\n src: pathWithBase(base, `/${ICON_DIRECTORY}/icon-192x192-maskable.png`),\n sizes: \"192x192\",\n type: \"image/png\",\n purpose: \"maskable\",\n },\n {\n src: pathWithBase(base, `/${ICON_DIRECTORY}/icon-512x512-maskable.png`),\n sizes: \"512x512\",\n type: \"image/png\",\n purpose: \"maskable\",\n },\n ...(scalable\n ? [\n {\n src: scalable.publicPath,\n sizes: \"any\",\n type: \"image/svg+xml\",\n purpose: \"any\",\n },\n ]\n : []),\n ];\n const manifest = asset(\n base,\n \"site.webmanifest\",\n Buffer.from(\n `${JSON.stringify(\n {\n name: site.title ?? \"Documentation\",\n short_name: site.title ?? \"Documentation\",\n ...(site.description ? { description: site.description } : {}),\n id: normalizedBase(base),\n start_url: normalizedBase(base),\n scope: normalizedBase(base),\n display: \"standalone\",\n background_color: background,\n theme_color: themeColors.light,\n icons: iconEntries,\n },\n null,\n 2,\n )}\\n`,\n ),\n \"application/manifest+json\",\n );\n const favicon32 = definitions[0];\n const appleTouchIcon = definitions[1];\n if (!favicon32 || !appleTouchIcon) {\n throw new Error(\"Cookbook failed to generate the required site icons.\");\n }\n\n return {\n assets: [...definitions, ...(scalable ? [scalable] : []), manifest],\n faviconPath,\n head: [\n {\n tag: \"link\",\n attrs: {\n rel: \"icon\",\n href: favicon32.publicPath,\n sizes: \"32x32\",\n type: favicon32.contentType,\n },\n },\n ...(scalable\n ? [\n {\n tag: \"link\",\n attrs: {\n rel: \"icon\",\n href: scalable.publicPath,\n sizes: \"any\",\n type: scalable.contentType,\n },\n } satisfies HeadConfig,\n ]\n : []),\n {\n tag: \"link\",\n attrs: {\n rel: \"apple-touch-icon\",\n href: appleTouchIcon.publicPath,\n sizes: \"180x180\",\n },\n },\n {\n tag: \"link\",\n attrs: { rel: \"manifest\", href: manifest.publicPath },\n },\n {\n tag: \"meta\",\n attrs: {\n name: \"theme-color\",\n content: themeColors.light,\n media: \"(prefers-color-scheme: light)\",\n },\n },\n {\n tag: \"meta\",\n attrs: {\n name: \"theme-color\",\n content: themeColors.dark,\n media: \"(prefers-color-scheme: dark)\",\n },\n },\n ],\n sourcePath,\n };\n}\n\nasync function pngAsset(\n input: Buffer,\n base: string,\n name: string,\n size: number,\n): Promise<SiteIconAsset> {\n const body = await sharp(input, { animated: false, density: 512 })\n .resize(size, size, {\n fit: \"contain\",\n background: { r: 0, g: 0, b: 0, alpha: 0 },\n })\n .png()\n .toBuffer();\n return asset(base, name, body, \"image/png\");\n}\n\nasync function safePngAsset(\n input: Buffer,\n base: string,\n name: string,\n size: number,\n background: string,\n): Promise<SiteIconAsset> {\n const safeSize = Math.round(size * 0.8);\n const foreground = await sharp(input, { animated: false, density: 512 })\n .resize(safeSize, safeSize, {\n fit: \"contain\",\n background: { r: 0, g: 0, b: 0, alpha: 0 },\n })\n .png()\n .toBuffer();\n const body = await sharp({\n create: {\n width: size,\n height: size,\n channels: 4,\n background,\n },\n })\n .composite([{ input: foreground, gravity: \"center\" }])\n .png()\n .toBuffer()\n .catch((error: unknown) => {\n throw new Error(\n `Unable to use site.favicon.background ${JSON.stringify(background)}: ${errorMessage(error)}`,\n );\n });\n return asset(base, name, body, \"image/png\");\n}\n\nfunction asset(\n base: string,\n name: string,\n body: Buffer,\n contentType: string,\n): SiteIconAsset {\n const outputPath = `${ICON_DIRECTORY}/${name}`;\n return {\n body,\n contentType,\n outputPath,\n publicPath: pathWithBase(base, `/${outputPath}`),\n };\n}\n\nfunction resolveSourcePath(source: string, root: string): string {\n if (/^[a-z][a-z\\d+.-]*:/i.test(source)) {\n throw new Error(\"site.favicon must reference a local image path.\");\n }\n return isAbsolute(source) ? source : resolve(root, source);\n}\n\nfunction pathWithBase(base: string, pathname: string): string {\n const prefix = normalizedBase(base);\n return `${prefix === \"/\" ? \"\" : prefix.replace(/\\/$/, \"\")}${pathname}`;\n}\n\nfunction normalizedBase(base: string): string {\n const value = base.replace(/^\\/+|\\/+$/g, \"\");\n return value ? `/${value}/` : \"/\";\n}\n\nfunction errorMessage(error: unknown): string {\n return error instanceof Error ? error.message : String(error);\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 {\n rehypePageAffordances,\n satteriPageAffordances,\n} from \"./markdown/rehype-page-affordances.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\";\nimport { createSiteIcons, type SiteIconSet } from \"./site-icons.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 markdownContentPath = fileURLToPath(\n new URL(\"./overrides/MarkdownContent.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 MarkdownContent: markdownContentPath,\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.8'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 let siteIconBase = options.config?.build?.base ?? \"/\";\n let siteIcons: SiteIconSet | undefined;\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 async function loadSiteIcons(): Promise<SiteIconSet> {\n if (!projectRoot) {\n throw new Error(\n \"Cookbook cannot generate site icons without a project root.\",\n );\n }\n return createSiteIcons({\n base: siteIconBase,\n root: projectRoot,\n ...(options.config?.site ? { site: options.config.site } : {}),\n themeColors: {\n light: docsTheme.colors.surface.light ?? \"#ffffff\",\n dark: docsTheme.colors.surface.dark ?? \"#20232a\",\n },\n });\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 siteIconBase = base;\n siteIcons = await loadSiteIcons();\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 favicon: siteIcons.faviconPath,\n head: [...siteIcons.head, ...(options.config?.head ?? [])],\n ...(options.config?.editLink\n ? { editLink: options.config.editLink }\n : {}),\n ...(options.config?.lastUpdated !== undefined\n ? { lastUpdated: options.config.lastUpdated }\n : {}),\n ...(options.config?.locales\n ? { locales: options.config.locales }\n : {}),\n ...(options.config?.defaultLocale\n ? { defaultLocale: options.config.defaultLocale }\n : {}),\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, logger }) => {\n let assets = docsAssetMap(await loadGraph());\n if (options.config?.site?.favicon && siteIcons) {\n server.watcher.add(siteIcons.sourcePath);\n server.watcher.on(\"change\", async (changedPath) => {\n if (changedPath !== siteIcons?.sourcePath) return;\n try {\n siteIcons = await loadSiteIcons();\n server.ws.send({ type: \"full-reload\" });\n } catch (error) {\n logger.error(errorMessage(error));\n }\n });\n }\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 const siteIcon = siteIcons?.assets.find(\n (asset) => asset.publicPath === pathname,\n );\n if (siteIcon) {\n response.statusCode = 200;\n response.setHeader(\"Content-Type\", siteIcon.contentType);\n response.setHeader(\"Content-Length\", siteIcon.body.byteLength);\n response.setHeader(\"Cache-Control\", \"no-cache\");\n response.end(request.method === \"HEAD\" ? undefined : siteIcon.body);\n return;\n }\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 siteIcons = await loadSiteIcons();\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 for (const asset of siteIcons?.assets ?? []) {\n const target = join(output, asset.outputPath);\n await mkdir(dirname(target), { recursive: true });\n await writeFile(target, asset.body);\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 if (!plugins.includes(rehypePageAffordances))\n plugins.push(rehypePageAffordances);\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 if (!plugins.includes(satteriPageAffordances))\n plugins.push(satteriPageAffordances);\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 errorMessage(error: unknown): string {\n return error instanceof Error ? error.message : String(error);\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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AU;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;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;GACF;GACA,UAAU,EAAE,YAAY,YAAY;EACtC;EACA;GACE,OAAO,CAAC,2BAA2B,2BAA2B;GAC9D,UAAU,EAAE,YAAY,QAAQ;EAClC;EACA;GACE,OAAO,CAAC,kCAAkC,wBAAwB;GAClE,UAAU,EAAE,YAAY,SAAS;EACnC;EACA;GACE,OAAO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E/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"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
//#region src/markdown/rendered-content.d.ts
|
|
2
|
+
/** Wrap rendered headings with a visible, accessible permalink. */
|
|
3
|
+
declare function addHeadingPermalinks(html: string): string;
|
|
4
|
+
//#endregion
|
|
5
|
+
export { addHeadingPermalinks };
|
|
6
|
+
//# sourceMappingURL=rendered-content.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rendered-content.d.ts","names":[],"sources":["../../src/markdown/rendered-content.ts"],"mappings":";;iBAKgB,qBAAqB"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
//#region src/markdown/rendered-content.ts
|
|
2
|
+
const headingPattern = /<h([1-6])\b([^>]*)>([\s\S]*?)<\/h\1>/gi;
|
|
3
|
+
const idPattern = /\sid=(['"])(.*?)\1/i;
|
|
4
|
+
const tags = /<[^>]*>/g;
|
|
5
|
+
/** Wrap rendered headings with a visible, accessible permalink. */
|
|
6
|
+
function addHeadingPermalinks(html) {
|
|
7
|
+
return html.replace(headingPattern, (heading, level, attributes, content) => {
|
|
8
|
+
const id = idPattern.exec(attributes)?.[2];
|
|
9
|
+
if (!id) return heading;
|
|
10
|
+
const title = escapeAttribute(decodeEntities(content.replace(tags, "").trim()));
|
|
11
|
+
return `<div class="sl-heading-wrapper level-h${level}">${heading}<a class="sl-anchor-link" href="#${escapeAttribute(id)}" aria-label="Permalink to “${title}”">#</a></div>`;
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
function decodeEntities(value) {
|
|
15
|
+
const named = {
|
|
16
|
+
amp: "&",
|
|
17
|
+
apos: "'",
|
|
18
|
+
gt: ">",
|
|
19
|
+
lt: "<",
|
|
20
|
+
quot: "\""
|
|
21
|
+
};
|
|
22
|
+
return value.replace(/&(?:#(\d+)|#x([\da-f]+)|(amp|apos|gt|lt|quot));/gi, (entity, decimal, hexadecimal, name) => {
|
|
23
|
+
const point = decimal ? Number.parseInt(decimal, 10) : hexadecimal ? Number.parseInt(hexadecimal, 16) : void 0;
|
|
24
|
+
return point === void 0 ? named[name.toLowerCase()] ?? entity : String.fromCodePoint(point);
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
function escapeAttribute(value) {
|
|
28
|
+
return value.replaceAll("&", "&").replaceAll("\"", """).replaceAll("'", "'").replaceAll("<", "<").replaceAll(">", ">");
|
|
29
|
+
}
|
|
30
|
+
//#endregion
|
|
31
|
+
export { addHeadingPermalinks };
|
|
32
|
+
|
|
33
|
+
//# sourceMappingURL=rendered-content.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rendered-content.js","names":[],"sources":["../../src/markdown/rendered-content.ts"],"sourcesContent":["const headingPattern = /<h([1-6])\\b([^>]*)>([\\s\\S]*?)<\\/h\\1>/gi;\nconst idPattern = /\\sid=(['\"])(.*?)\\1/i;\nconst tags = /<[^>]*>/g;\n\n/** Wrap rendered headings with a visible, accessible permalink. */\nexport function addHeadingPermalinks(html: string): string {\n return html.replace(\n headingPattern,\n (heading, level: string, attributes: string, content: string) => {\n const id = idPattern.exec(attributes)?.[2];\n if (!id) return heading;\n const title = escapeAttribute(\n decodeEntities(content.replace(tags, \"\").trim()),\n );\n return `<div class=\"sl-heading-wrapper level-h${level}\">${heading}<a class=\"sl-anchor-link\" href=\"#${escapeAttribute(id)}\" aria-label=\"Permalink to “${title}”\">#</a></div>`;\n },\n );\n}\n\nfunction decodeEntities(value: string): string {\n const named: Record<string, string> = {\n amp: \"&\",\n apos: \"'\",\n gt: \">\",\n lt: \"<\",\n quot: '\"',\n };\n return value.replace(\n /&(?:#(\\d+)|#x([\\da-f]+)|(amp|apos|gt|lt|quot));/gi,\n (entity, decimal: string, hexadecimal: string, name: string) => {\n const point = decimal\n ? Number.parseInt(decimal, 10)\n : hexadecimal\n ? Number.parseInt(hexadecimal, 16)\n : undefined;\n return point === undefined\n ? (named[name.toLowerCase()] ?? entity)\n : String.fromCodePoint(point);\n },\n );\n}\n\nfunction escapeAttribute(value: string): string {\n return value\n .replaceAll(\"&\", \"&\")\n .replaceAll('\"', \""\")\n .replaceAll(\"'\", \"'\")\n .replaceAll(\"<\", \"<\")\n .replaceAll(\">\", \">\");\n}\n"],"mappings":";AAAA,MAAM,iBAAiB;AACvB,MAAM,YAAY;AAClB,MAAM,OAAO;;AAGb,SAAgB,qBAAqB,MAAsB;CACzD,OAAO,KAAK,QACV,iBACC,SAAS,OAAe,YAAoB,YAAoB;EAC/D,MAAM,KAAK,UAAU,KAAK,UAAU,CAAC,GAAG;EACxC,IAAI,CAAC,IAAI,OAAO;EAChB,MAAM,QAAQ,gBACZ,eAAe,QAAQ,QAAQ,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,CACjD;EACA,OAAO,yCAAyC,MAAM,IAAI,QAAQ,mCAAmC,gBAAgB,EAAE,EAAE,8BAA8B,MAAM;CAC/J,CACF;AACF;AAEA,SAAS,eAAe,OAAuB;CAC7C,MAAM,QAAgC;EACpC,KAAK;EACL,MAAM;EACN,IAAI;EACJ,IAAI;EACJ,MAAM;CACR;CACA,OAAO,MAAM,QACX,sDACC,QAAQ,SAAiB,aAAqB,SAAiB;EAC9D,MAAM,QAAQ,UACV,OAAO,SAAS,SAAS,EAAE,IAC3B,cACE,OAAO,SAAS,aAAa,EAAE,IAC/B,KAAA;EACN,OAAO,UAAU,KAAA,IACZ,MAAM,KAAK,YAAY,MAAM,SAC9B,OAAO,cAAc,KAAK;CAChC,CACF;AACF;AAEA,SAAS,gBAAgB,OAAuB;CAC9C,OAAO,MACJ,WAAW,KAAK,OAAO,CAAC,CACxB,WAAW,MAAK,QAAQ,CAAC,CACzB,WAAW,KAAK,OAAO,CAAC,CACxB,WAAW,KAAK,MAAM,CAAC,CACvB,WAAW,KAAK,MAAM;AAC3B"}
|
|
@@ -31,6 +31,15 @@ const frontmatter = {
|
|
|
31
31
|
...(entry.frontmatter.editUrl !== undefined
|
|
32
32
|
? { editUrl: entry.frontmatter.editUrl }
|
|
33
33
|
: {}),
|
|
34
|
+
...(entry.frontmatter.template !== undefined
|
|
35
|
+
? { template: entry.frontmatter.template }
|
|
36
|
+
: {}),
|
|
37
|
+
...(entry.frontmatter.hero !== undefined
|
|
38
|
+
? { hero: entry.frontmatter.hero }
|
|
39
|
+
: {}),
|
|
40
|
+
...(entry.frontmatter.lastUpdated !== undefined
|
|
41
|
+
? { lastUpdated: entry.frontmatter.lastUpdated }
|
|
42
|
+
: {}),
|
|
34
43
|
...(entry.frontmatter.prev !== undefined
|
|
35
44
|
? { prev: entry.frontmatter.prev }
|
|
36
45
|
: {}),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tenphi/starlight",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "Astro and Starlight renderer for Cookbook",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": [
|
|
@@ -49,12 +49,13 @@
|
|
|
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.
|
|
52
|
+
"@tenphi/docs": "0.11.0",
|
|
53
53
|
"@tenphi/glaze": "2.0.0",
|
|
54
|
-
"@tenphi/tasty": "3.
|
|
54
|
+
"@tenphi/tasty": "3.8.0",
|
|
55
55
|
"beautiful-mermaid": "^1.1.3",
|
|
56
56
|
"react": "^18.3.1 || ^19.0.0",
|
|
57
57
|
"react-dom": "^18.3.1 || ^19.0.0",
|
|
58
|
+
"sharp": "0.35.4",
|
|
58
59
|
"tsx": "^4.20.6"
|
|
59
60
|
},
|
|
60
61
|
"peerDependencies": {
|