@ox-content/vite-plugin 2.90.0 → 3.0.0-alpha.2
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/api.cjs +6563 -0
- package/dist/api.cjs.map +1 -0
- package/dist/api.mjs +6456 -0
- package/dist/api.mjs.map +1 -0
- package/dist/index.cjs +6958 -935
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1782 -92
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +1782 -92
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +6932 -955
- package/dist/index.mjs.map +1 -1
- package/dist/tabs.mjs +1 -1
- package/dist/vitepress.cjs +91 -6
- package/dist/vitepress.cjs.map +1 -1
- package/dist/vitepress.mjs +68 -7
- package/dist/vitepress.mjs.map +1 -1
- package/package.json +11 -7
package/dist/vitepress.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vitepress.mjs","names":[],"sources":["../src/napi.ts","../src/theme-tokens.ts","../src/theme.ts","../src/vitepress.ts"],"sourcesContent":["import { createRequire } from \"node:module\";\n\ntype NapiModule = typeof import(\"@ox-content/napi\");\nconst requireNapi = createRequire(import.meta.url);\n\nfunction getDefaultExport(value: unknown): object | undefined {\n if (!value || typeof value !== \"object\" || !(\"default\" in value)) {\n return undefined;\n }\n\n const defaultExport = value.default;\n return defaultExport && typeof defaultExport === \"object\" ? defaultExport : undefined;\n}\n\nfunction normalizeNapiModule(mod: NapiModule): NapiModule {\n const defaultExport = getDefaultExport(mod);\n return defaultExport\n ? ({\n ...defaultExport,\n ...mod,\n } as NapiModule)\n : mod;\n}\n\nexport async function importNapiModule(): Promise<NapiModule> {\n return normalizeNapiModule((await import(\"@ox-content/napi\")) as NapiModule);\n}\n\nlet syncNapiModule: NapiModule | null | undefined;\n\nexport function importNapiModuleSync(): NapiModule {\n if (syncNapiModule) {\n return syncNapiModule;\n }\n\n if (syncNapiModule === null) {\n throw new Error(\n \"[ox-content] @ox-content/napi is required. Please ensure the NAPI module is built.\",\n );\n }\n\n try {\n const mod = requireNapi(\"@ox-content/napi\") as NapiModule;\n syncNapiModule = normalizeNapiModule(mod);\n return syncNapiModule;\n } catch {\n syncNapiModule = null;\n throw new Error(\n \"[ox-content] @ox-content/napi is required. Please ensure the NAPI module is built.\",\n );\n }\n}\n","/**\n * Free-form `--octc-*` custom properties for themes that need more than the\n * typed `colors` / `fonts` / `layout` fields.\n *\n * Keys are written **without** the `--octc-` prefix, so `\"surface-glass\"`\n * becomes `--octc-surface-glass`. This is the seam that keeps the two theme\n * axes independent: a color package can restyle code-block line markers, brand\n * accents, and surface textures purely through tokens, while a skin package\n * lays out geometry against those same tokens without knowing any color.\n */\nexport type ThemeTokens = Record<string, string>;\n\nconst TOKEN_PREFIX = \"--octc-\";\nconst TOKEN_NAME_PATTERN = /^[a-z][a-z0-9-]*$/;\n\n/**\n * Renders light and dark token records as the three selectors the SSG runtime\n * switches between: an explicit `[data-theme=\"dark\"]` opt-in, the OS\n * `prefers-color-scheme` fallback, and the `:root` base.\n *\n * Emitted after the typed color variables and before the theme's own `css`, so\n * a token can override a typed color and raw `css` can override a token.\n */\nexport function tokensToCss(light: ThemeTokens, dark: ThemeTokens): string {\n const lightBody = declarations(light, \" \");\n const darkBody = declarations(dark, \" \");\n const blocks: string[] = [];\n\n if (lightBody) {\n blocks.push(`:root {\\n${lightBody}\\n}`);\n }\n if (darkBody) {\n blocks.push(`[data-theme=\"dark\"] {\\n${darkBody}\\n}`);\n blocks.push(\n `@media (prefers-color-scheme: dark) {\\n :root:not([data-theme=\"light\"]) {\\n${declarations(dark, \" \")}\\n }\\n}`,\n );\n }\n\n return blocks.join(\"\\n\");\n}\n\nfunction declarations(tokens: ThemeTokens, indent: string): string {\n return Object.entries(tokens)\n .filter(([, value]) => value !== undefined && value !== \"\")\n .map(([name, value]) => `${indent}${TOKEN_PREFIX}${assertTokenName(name)}: ${value};`)\n .join(\"\\n\");\n}\n\nfunction assertTokenName(name: string): string {\n // Token names land verbatim inside a declaration block, so a stray `:` or `}`\n // would silently break every rule after it. Fail the build with the offending\n // key instead of shipping a corrupt stylesheet.\n if (!TOKEN_NAME_PATTERN.test(name)) {\n throw new Error(\n `Invalid theme token name: ${JSON.stringify(name)}. ` +\n `Token names are lowercase kebab-case without the \"${TOKEN_PREFIX}\" prefix (e.g. \"surface-glass\").`,\n );\n }\n return name;\n}\n","/**\n * Theme API for ox-content SSG\n *\n * Provides VitePress-like theming with default theme + customization.\n */\n\nimport { tokensToCss, type ThemeTokens } from \"./theme-tokens\";\n\nexport type { ThemeTokens } from \"./theme-tokens\";\n\n/**\n * Theme color configuration.\n */\nexport interface ThemeColors {\n /** Primary accent color */\n primary?: string;\n /** Primary color on hover */\n primaryHover?: string;\n /** Background color */\n background?: string;\n /** Alternative background color (sidebar, code blocks) */\n backgroundAlt?: string;\n /** Main text color */\n text?: string;\n /** Muted/secondary text color */\n textMuted?: string;\n /** Border color */\n border?: string;\n /** Code block background color */\n codeBackground?: string;\n /** Code block gradient color at the top; defaults to `codeBackground` when customized */\n codeBackgroundTop?: string;\n /** Code block text color */\n codeText?: string;\n}\n\n/**\n * Theme layout configuration.\n */\nexport interface ThemeLayout {\n /** Sidebar width (CSS value, e.g., \"260px\") */\n sidebarWidth?: string;\n /** Header height (CSS value, e.g., \"60px\") */\n headerHeight?: string;\n /** Maximum content width (CSS value, e.g., \"960px\") */\n maxContentWidth?: string;\n}\n\n/**\n * Theme font configuration.\n */\nexport interface ThemeFonts {\n /** Sans-serif font stack */\n sans?: string;\n /** Monospace font stack */\n mono?: string;\n}\n\n/**\n * Entry page theme configuration.\n */\nexport interface ThemeEntryPage {\n /** Landing page presentation mode */\n mode?: \"default\" | \"subtle\";\n}\n\n/**\n * Theme header configuration.\n */\nexport interface ThemeHeader {\n /** Logo image URL */\n logo?: string;\n /** Light mode logo image URL */\n logoLight?: string;\n /** Dark mode logo image URL */\n logoDark?: string;\n /** Whether to render the site name text next to the logo */\n showSiteNameText?: boolean;\n /** Logo width in pixels */\n logoWidth?: number;\n /** Logo height in pixels */\n logoHeight?: number;\n}\n\n/**\n * Theme footer configuration.\n */\nexport interface ThemeFooter {\n /** Footer message (supports HTML) */\n message?: string;\n /** Copyright text (supports HTML) */\n copyright?: string;\n}\n\n/** Custom social link icon. */\nexport type SocialLinkIcon = string | { svg: string };\n\n/** Custom social link. */\nexport interface SocialLink {\n icon: SocialLinkIcon;\n link: string;\n ariaLabel?: string;\n}\n\n/** Legacy social links configuration. */\nexport interface LegacySocialLinks {\n /** GitHub URL */\n github?: string;\n /** Twitter/X URL */\n twitter?: string;\n /** Discord URL */\n discord?: string;\n}\n\n/** Social links configuration. */\nexport type SocialLinks = LegacySocialLinks | SocialLink[];\n\n/**\n * Embedded HTML content for specific positions in the page layout.\n */\nexport interface ThemeEmbed {\n /** Content to embed into <head> */\n head?: string;\n /** Content before header */\n headerBefore?: string;\n /** Content after header */\n headerAfter?: string;\n /** Content before sidebar navigation */\n sidebarBefore?: string;\n /** Content after sidebar navigation */\n sidebarAfter?: string;\n /** Content before main content */\n contentBefore?: string;\n /** Content after main content */\n contentAfter?: string;\n /** Content before footer */\n footerBefore?: string;\n /** Custom footer content (replaces default footer) */\n footer?: string;\n}\n\nexport interface SidebarItem {\n text?: string;\n link?: string;\n items?: SidebarItem[];\n collapsed?: boolean;\n stickyCollapsed?: boolean;\n}\n\n/**\n * Complete theme configuration.\n */\nexport interface ThemeConfig {\n /** Theme name for identification */\n name?: string;\n /** Base theme to extend */\n extends?: ThemeConfig;\n /** Light mode colors (maps to CSS variables) */\n colors?: ThemeColors;\n /** Dark mode colors (maps to CSS variables) */\n darkColors?: ThemeColors;\n /** Font configuration (maps to CSS variables) */\n fonts?: ThemeFonts;\n /** Entry page configuration */\n entryPage?: ThemeEntryPage;\n /** Layout configuration (maps to CSS variables) */\n layout?: ThemeLayout;\n /** Header configuration */\n header?: ThemeHeader;\n /** Footer configuration */\n footer?: ThemeFooter;\n /** Social links configuration */\n socialLinks?: SocialLinks;\n sidebar?: SidebarItem[];\n /** Embedded HTML content at specific positions */\n embed?: ThemeEmbed;\n /**\n * Extra `--octc-*` custom properties for light mode, keyed without the\n * prefix. Merged key-by-key across composed layers, so a later layer can\n * restyle one token without redeclaring the rest.\n */\n tokens?: ThemeTokens;\n /** Extra `--octc-*` custom properties for dark mode. */\n darkTokens?: ThemeTokens;\n /**\n * Additional custom CSS. Composed layers **concatenate** this rather than\n * overwrite, so stacking a skin and a color scheme keeps both stylesheets.\n */\n css?: string;\n /** Additional custom JavaScript. Concatenated across composed layers. */\n js?: string;\n}\n\n/**\n * Resolved theme configuration (after merging with defaults).\n */\nexport interface ResolvedThemeConfig {\n name: string;\n colors: ThemeColors;\n darkColors: ThemeColors;\n fonts: ThemeFonts;\n entryPage: ThemeEntryPage;\n layout: ThemeLayout;\n header: ThemeHeader;\n footer: ThemeFooter;\n socialLinks: SocialLinks;\n sidebar: SidebarItem[];\n embed: ThemeEmbed;\n tokens: ThemeTokens;\n darkTokens: ThemeTokens;\n css: string;\n js: string;\n}\n\n/**\n * Default theme configuration.\n * Based on the current ox-content SSG styles.\n */\nexport const defaultTheme: ThemeConfig = {\n name: \"default\",\n colors: {\n primary: \"#4f6fae\",\n primaryHover: \"#425f96\",\n background: \"#ffffff\",\n backgroundAlt: \"#f5f7fb\",\n text: \"#131a30\",\n textMuted: \"#4f607b\",\n border: \"#d2dbea\",\n codeBackground: \"#101a31\",\n codeBackgroundTop: \"#18264a\",\n codeText: \"#edf3ff\",\n },\n darkColors: {\n primary: \"#86a4da\",\n primaryHover: \"#a3bbe8\",\n background: \"#060816\",\n backgroundAlt: \"#0d1528\",\n text: \"#ebf2ff\",\n textMuted: \"#8ea0bf\",\n border: \"#223252\",\n codeBackground: \"#0a1020\",\n codeBackgroundTop: \"#0a1020\",\n codeText: \"#e7f0ff\",\n },\n fonts: {\n sans: '\"IBM Plex Sans\", \"Avenir Next\", \"Segoe UI Variable\", \"Segoe UI\", sans-serif',\n mono: '\"IBM Plex Mono\", \"SFMono-Regular\", Consolas, monospace',\n },\n entryPage: {\n mode: \"default\",\n },\n layout: {\n sidebarWidth: \"260px\",\n headerHeight: \"60px\",\n maxContentWidth: \"960px\",\n },\n header: {\n logo: undefined,\n logoLight: undefined,\n logoDark: undefined,\n showSiteNameText: true,\n logoWidth: 28,\n logoHeight: 28,\n },\n footer: {\n message: undefined,\n copyright: undefined,\n },\n socialLinks: {},\n embed: {},\n tokens: {},\n darkTokens: {},\n css: \"\",\n js: \"\",\n};\n\n/**\n * Deep merge two objects.\n */\nfunction deepMerge<T extends Record<string, unknown>>(target: T, source: Partial<T>): T {\n const result = { ...target };\n\n for (const key of Object.keys(source) as (keyof T)[]) {\n const sourceValue = source[key];\n const targetValue = target[key];\n\n if (\n sourceValue !== undefined &&\n typeof sourceValue === \"object\" &&\n sourceValue !== null &&\n !Array.isArray(sourceValue) &&\n typeof targetValue === \"object\" &&\n targetValue !== null &&\n !Array.isArray(targetValue)\n ) {\n result[key] = deepMerge(\n targetValue as Record<string, unknown>,\n sourceValue as Record<string, unknown>,\n ) as T[keyof T];\n } else if (sourceValue !== undefined) {\n result[key] = sourceValue as T[keyof T];\n }\n }\n\n return result;\n}\n\n/**\n * Defines a theme configuration with type checking.\n *\n * @example\n * ```ts\n * const myTheme = defineTheme({\n * extends: defaultTheme,\n * colors: {\n * primary: '#3498db',\n * },\n * footer: {\n * copyright: '2025 My Company',\n * },\n * });\n * ```\n */\nexport function defineTheme(config: ThemeConfig): ThemeConfig {\n return config;\n}\n\n/**\n * Merges multiple theme configurations.\n * Later themes override earlier ones.\n *\n * Object fields (`colors`, `tokens`, `layout`, …) merge key-by-key, but `css`\n * and `js` **concatenate** in layer order — overwriting them would throw away\n * one half of a `[skin, colorScheme]` stack. Identical fragments are joined\n * once, so a layer reached through both an array and an `extends` chain does\n * not emit its stylesheet twice.\n *\n * @example\n * ```ts\n * const merged = mergeThemes(defaultTheme, pixelSkin, tokyoNight, overrides);\n * ```\n */\nexport function mergeThemes(...themes: (ThemeConfig | ThemeConfig[])[]): ThemeConfig {\n const layers = themes.flat();\n if (layers.length === 0) {\n return { ...defaultTheme };\n }\n\n let result: ThemeConfig = {};\n\n for (const theme of layers) {\n const { css, js, ...rest } = theme;\n result = deepMerge(\n result as Record<string, unknown>,\n rest as Record<string, unknown>,\n ) as ThemeConfig;\n\n const mergedCss = appendSource(result.css, css);\n if (mergedCss) {\n result.css = mergedCss;\n }\n const mergedJs = appendSource(result.js, js);\n if (mergedJs) {\n result.js = mergedJs;\n }\n }\n\n return result;\n}\n\nfunction appendSource(existing: string | undefined, addition: string | undefined): string {\n const next = addition?.trim() ?? \"\";\n const current = existing ?? \"\";\n if (!next || current.includes(next)) {\n return current;\n }\n return current ? `${current}\\n${next}` : next;\n}\n\n/**\n * Resolves a theme configuration by merging with its extends chain and defaults.\n *\n * An array composes independent layers left to right, which is how a skin\n * package and a color package are stacked:\n *\n * ```ts\n * resolveTheme([pixelSkin, tokyoNight, { footer: { copyright: \"2026\" } }]);\n * ```\n */\nexport function resolveTheme(config?: ThemeConfig | ThemeConfig[]): ResolvedThemeConfig {\n const layers = config === undefined ? [defaultTheme] : Array.isArray(config) ? config : [config];\n const chain = layers.flatMap(expandExtendsChain);\n\n // Always start with default theme\n if (chain.length === 0) {\n chain.push(defaultTheme);\n }\n if (chain[0] !== defaultTheme && chain[0]?.name !== \"default\") {\n chain.unshift(defaultTheme);\n }\n\n // Merge all themes in the chain\n const merged = mergeThemes(...chain.map(withDerivedCodeBackgroundTop));\n\n // Return resolved config with all required fields\n return {\n name: merged.name ?? \"custom\",\n colors: merged.colors ?? defaultTheme.colors!,\n darkColors: merged.darkColors ?? defaultTheme.darkColors!,\n fonts: merged.fonts ?? defaultTheme.fonts!,\n entryPage: merged.entryPage ?? defaultTheme.entryPage!,\n layout: merged.layout ?? defaultTheme.layout!,\n header: merged.header ?? defaultTheme.header!,\n footer: merged.footer ?? defaultTheme.footer!,\n socialLinks: merged.socialLinks ?? defaultTheme.socialLinks!,\n sidebar: merged.sidebar ?? [],\n embed: merged.embed ?? {},\n tokens: merged.tokens ?? {},\n darkTokens: merged.darkTokens ?? {},\n css: merged.css ?? \"\",\n js: merged.js ?? \"\",\n };\n}\n\n/**\n * Flattens one layer's `extends` chain into base-first order.\n *\n * The `seen` guard keeps a theme that accidentally extends itself (or forms a\n * cycle through two packages) from hanging the build.\n */\nfunction expandExtendsChain(config: ThemeConfig): ThemeConfig[] {\n const chain: ThemeConfig[] = [];\n const seen = new Set<ThemeConfig>();\n let current: ThemeConfig | undefined = config;\n\n while (current && !seen.has(current)) {\n seen.add(current);\n chain.unshift(current);\n current = current.extends;\n }\n\n return chain;\n}\n\nfunction withDerivedCodeBackgroundTop(theme: ThemeConfig): ThemeConfig {\n const derive = (colors: ThemeColors | undefined): ThemeColors | undefined => {\n if (colors?.codeBackground !== undefined && colors.codeBackgroundTop === undefined) {\n return { ...colors, codeBackgroundTop: colors.codeBackground };\n }\n return colors;\n };\n\n return {\n ...theme,\n colors: derive(theme.colors),\n darkColors: derive(theme.darkColors),\n };\n}\n\n/**\n * Converts resolved theme to the format expected by Rust NAPI.\n */\nexport function themeToNapi(theme: ResolvedThemeConfig): NapiThemeConfig {\n const socialLinks = socialLinksToNapi(theme.socialLinks);\n\n return {\n colors: theme.colors.primary\n ? {\n primary: theme.colors.primary,\n primaryHover: theme.colors.primaryHover,\n background: theme.colors.background,\n backgroundAlt: theme.colors.backgroundAlt,\n text: theme.colors.text,\n textMuted: theme.colors.textMuted,\n border: theme.colors.border,\n codeBackground: theme.colors.codeBackground,\n codeBackgroundTop: theme.colors.codeBackgroundTop,\n codeText: theme.colors.codeText,\n }\n : undefined,\n darkColors: theme.darkColors.primary\n ? {\n primary: theme.darkColors.primary,\n primaryHover: theme.darkColors.primaryHover,\n background: theme.darkColors.background,\n backgroundAlt: theme.darkColors.backgroundAlt,\n text: theme.darkColors.text,\n textMuted: theme.darkColors.textMuted,\n border: theme.darkColors.border,\n codeBackground: theme.darkColors.codeBackground,\n codeBackgroundTop: theme.darkColors.codeBackgroundTop,\n codeText: theme.darkColors.codeText,\n }\n : undefined,\n fonts: theme.fonts.sans\n ? {\n sans: theme.fonts.sans,\n mono: theme.fonts.mono,\n }\n : undefined,\n entryPage: theme.entryPage.mode\n ? {\n mode: theme.entryPage.mode,\n }\n : undefined,\n layout: theme.layout.sidebarWidth\n ? {\n sidebarWidth: theme.layout.sidebarWidth,\n headerHeight: theme.layout.headerHeight,\n maxContentWidth: theme.layout.maxContentWidth,\n }\n : undefined,\n header:\n theme.header.logo || theme.header.logoLight || theme.header.logoDark\n ? {\n logo: theme.header.logo,\n logoLight: theme.header.logoLight,\n logoDark: theme.header.logoDark,\n showSiteNameText: theme.header.showSiteNameText,\n logoWidth: theme.header.logoWidth,\n logoHeight: theme.header.logoHeight,\n }\n : undefined,\n footer:\n theme.footer.message || theme.footer.copyright\n ? {\n message: theme.footer.message,\n copyright: theme.footer.copyright,\n }\n : undefined,\n socialLinks,\n embed: Object.keys(theme.embed).length > 0 ? theme.embed : undefined,\n css: themeCss(theme) || undefined,\n js: theme.js || undefined,\n };\n}\n\n/**\n * Token blocks come first so a theme's own `css` stays the final word, and both\n * land after the typed color variables the Rust renderer emits.\n */\nfunction themeCss(theme: ResolvedThemeConfig): string {\n const tokenCss = tokensToCss(theme.tokens, theme.darkTokens);\n if (!tokenCss) {\n return theme.css;\n }\n return theme.css ? `${tokenCss}\\n${theme.css}` : tokenCss;\n}\n\nfunction socialLinksToNapi(links: SocialLinks): NapiSocialLinks | undefined {\n if (Array.isArray(links)) {\n const items = links.map((item) => {\n const icon = typeof item.icon === \"string\" ? item.icon : undefined;\n const iconSvg = typeof item.icon === \"object\" ? item.icon.svg : undefined;\n return { icon, iconSvg, link: item.link, ariaLabel: item.ariaLabel };\n });\n return items.length > 0 ? { links: items } : undefined;\n }\n\n return links.github || links.twitter || links.discord\n ? { github: links.github, twitter: links.twitter, discord: links.discord }\n : undefined;\n}\n\n/**\n * NAPI-compatible theme colors type.\n */\nexport interface NapiThemeColors {\n primary?: string;\n primaryHover?: string;\n background?: string;\n backgroundAlt?: string;\n text?: string;\n textMuted?: string;\n border?: string;\n codeBackground?: string;\n codeBackgroundTop?: string;\n codeText?: string;\n}\n\n/**\n * NAPI-compatible theme fonts type.\n */\nexport interface NapiThemeFonts {\n sans?: string;\n mono?: string;\n}\n\n/**\n * NAPI-compatible entry page theme type.\n */\nexport interface NapiThemeEntryPage {\n mode?: \"default\" | \"subtle\";\n}\n\n/**\n * NAPI-compatible theme layout type.\n */\nexport interface NapiThemeLayout {\n sidebarWidth?: string;\n headerHeight?: string;\n maxContentWidth?: string;\n}\n\n/**\n * NAPI-compatible theme header type.\n */\nexport interface NapiThemeHeader {\n logo?: string;\n logoLight?: string;\n logoDark?: string;\n showSiteNameText?: boolean;\n logoWidth?: number;\n logoHeight?: number;\n}\n\n/**\n * NAPI-compatible theme footer type.\n */\nexport interface NapiThemeFooter {\n message?: string;\n copyright?: string;\n}\n\n/**\n * NAPI-compatible social links type.\n */\nexport interface NapiSocialLinks {\n github?: string;\n twitter?: string;\n discord?: string;\n links?: NapiSocialLink[];\n}\n\nexport interface NapiSocialLink {\n icon?: string;\n iconSvg?: string;\n link: string;\n ariaLabel?: string;\n}\n\n/**\n * NAPI-compatible theme embed type.\n */\nexport interface NapiThemeEmbed {\n head?: string;\n headerBefore?: string;\n headerAfter?: string;\n sidebarBefore?: string;\n sidebarAfter?: string;\n contentBefore?: string;\n contentAfter?: string;\n footerBefore?: string;\n footer?: string;\n}\n\n/**\n * NAPI-compatible theme configuration type.\n */\nexport interface NapiThemeConfig {\n colors?: NapiThemeColors;\n darkColors?: NapiThemeColors;\n fonts?: NapiThemeFonts;\n entryPage?: NapiThemeEntryPage;\n layout?: NapiThemeLayout;\n header?: NapiThemeHeader;\n footer?: NapiThemeFooter;\n socialLinks?: NapiSocialLinks;\n embed?: NapiThemeEmbed;\n css?: string;\n js?: string;\n}\n","import { importNapiModuleSync } from \"./napi\";\nimport { defineTheme, mergeThemes, type ThemeConfig } from \"./theme\";\nimport type { OxContentOptions, SsgNavigationGroup, SsgNavigationItem } from \"./types\";\n\nexport interface VitePressLogo {\n light?: string;\n dark?: string;\n src?: string;\n alt?: string;\n}\n\nexport interface VitePressSocialLink {\n icon: string;\n link: string;\n ariaLabel?: string;\n}\n\nexport interface VitePressFooter {\n message?: string;\n copyright?: string;\n}\n\nexport interface VitePressSidebarItem {\n text?: string;\n link?: string;\n items?: VitePressSidebarItem[];\n collapsed?: boolean;\n}\n\nexport type VitePressSidebar = VitePressSidebarItem[] | Record<string, VitePressSidebarItem[]>;\n\nexport interface VitePressNavItem {\n text?: string;\n link?: string;\n items?: VitePressNavItem[];\n activeMatch?: string;\n}\n\nexport interface VitePressThemeConfig {\n siteTitle?: string | false;\n logo?: string | VitePressLogo;\n nav?: VitePressNavItem[];\n sidebar?: VitePressSidebar;\n socialLinks?: VitePressSocialLink[];\n footer?: VitePressFooter;\n search?: {\n placeholder?: string;\n };\n}\n\nexport interface VitePressConfig {\n title?: string;\n description?: string;\n base?: string;\n themeConfig?: VitePressThemeConfig;\n}\n\nexport interface GenerateVitePressMigrationConfigOptions {\n importSource?: string;\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\nfunction isExternalLink(value: string): boolean {\n return /^[a-z][a-z0-9+.-]*:/i.test(value) || value.startsWith(\"//\");\n}\n\nfunction splitLink(value: string): { pathname: string; suffix: string } {\n const match = /^([^?#]*)([?#].*)?$/.exec(value);\n return {\n pathname: match?.[1] ?? value,\n suffix: match?.[2] ?? \"\",\n };\n}\n\nfunction normalizeInternalPath(value: string): string {\n const { pathname } = splitLink(value.trim());\n let normalized = pathname || \"/\";\n\n if (!normalized.startsWith(\"/\")) {\n normalized = `/${normalized}`;\n }\n\n normalized = normalized\n .replace(/\\/index(?:\\.(?:html?|md|markdown))?$/i, \"/\")\n .replace(/\\.(?:html?|md|markdown)$/i, \"\");\n\n if (normalized !== \"/\") {\n normalized = normalized.replace(/\\/+$/, \"\");\n }\n\n return normalized || \"/\";\n}\n\nfunction formatTitle(value: string): string {\n return value\n .replace(/[-_]([a-z])/g, (_, char: string) => ` ${char.toUpperCase()}`)\n .replace(/^[a-z]/, (char) => char.toUpperCase());\n}\n\nfunction titleFromPath(value: string): string {\n const normalized = normalizeInternalPath(value);\n if (normalized === \"/\") {\n return \"Home\";\n }\n\n const segment = normalized.split(\"/\").filter(Boolean).pop() ?? \"Page\";\n return formatTitle(segment);\n}\n\nfunction titleFromSidebarKey(value: string): string {\n const segment = value\n .replace(/^\\/+|\\/+$/g, \"\")\n .split(\"/\")\n .filter(Boolean)\n .pop();\n return formatTitle(segment ?? \"guide\");\n}\n\nfunction toNavigationItem(text: string | undefined, link: string): SsgNavigationItem {\n const title = text?.trim() || titleFromPath(link);\n\n if (isExternalLink(link) || link.startsWith(\"#\")) {\n return { title, href: link };\n }\n\n const { suffix } = splitLink(link);\n const path = normalizeInternalPath(link);\n\n return suffix ? { title, path, href: `${path}${suffix}` } : { title, path };\n}\n\nfunction dedupeNavigationItems(items: SsgNavigationItem[]): SsgNavigationItem[] {\n const seen = new Set<string>();\n const next: SsgNavigationItem[] = [];\n\n for (const item of items) {\n const key = `${item.title}::${item.path ?? \"\"}::${item.href ?? \"\"}`;\n if (seen.has(key)) {\n continue;\n }\n seen.add(key);\n next.push(item);\n }\n\n return next;\n}\n\nfunction dedupeNavigationGroups(groups: SsgNavigationGroup[]): SsgNavigationGroup[] {\n const merged = new Map<string, SsgNavigationItem[]>();\n const orderedTitles: string[] = [];\n\n for (const group of groups) {\n if (group.items.length === 0) {\n continue;\n }\n\n if (!merged.has(group.title)) {\n merged.set(group.title, []);\n orderedTitles.push(group.title);\n }\n\n merged.get(group.title)!.push(...group.items);\n }\n\n return orderedTitles.map((title) => ({\n title,\n items: dedupeNavigationItems(merged.get(title) ?? []),\n }));\n}\n\nfunction collectSidebarLinks(items: VitePressSidebarItem[]): SsgNavigationItem[] {\n const links: SsgNavigationItem[] = [];\n\n for (const item of items) {\n if (item.link) {\n links.push(toNavigationItem(item.text, item.link));\n }\n\n if (item.items?.length) {\n links.push(...collectSidebarLinks(item.items));\n }\n }\n\n return dedupeNavigationItems(links);\n}\n\nfunction sidebarArrayToGroups(\n items: VitePressSidebarItem[],\n fallbackTitle: string,\n): SsgNavigationGroup[] {\n const groups: SsgNavigationGroup[] = [];\n const rootItems: SsgNavigationItem[] = [];\n\n for (const item of items) {\n if (item.link) {\n rootItems.push(toNavigationItem(item.text, item.link));\n }\n\n if (item.items?.length) {\n const children = collectSidebarLinks(item.items);\n if (children.length > 0) {\n groups.push({\n title: item.text?.trim() || fallbackTitle,\n items: children,\n });\n }\n }\n }\n\n if (rootItems.length > 0) {\n groups.unshift({\n title: fallbackTitle,\n items: dedupeNavigationItems(rootItems),\n });\n }\n\n return groups;\n}\n\nfunction collectNavLinks(items: VitePressNavItem[]): SsgNavigationItem[] {\n const links: SsgNavigationItem[] = [];\n\n for (const item of items) {\n if (item.link) {\n links.push(toNavigationItem(item.text, item.link));\n }\n\n if (item.items?.length) {\n links.push(...collectNavLinks(item.items));\n }\n }\n\n return dedupeNavigationItems(links);\n}\n\nfunction resolveLogoSrc(logo: string | VitePressLogo | undefined): string | undefined {\n if (!logo) {\n return undefined;\n }\n\n if (typeof logo === \"string\") {\n return logo;\n }\n\n return logo.light ?? logo.dark ?? logo.src;\n}\n\nfunction normalizeSocialIcon(icon: string): \"github\" | \"twitter\" | \"discord\" | undefined {\n const normalized = icon.trim().toLowerCase();\n\n if (normalized === \"github\") return \"github\";\n if (normalized === \"discord\") return \"discord\";\n if (normalized === \"twitter\" || normalized === \"x\" || normalized === \"x-twitter\") {\n return \"twitter\";\n }\n\n return undefined;\n}\n\nfunction toThemeConfig(themeConfig: VitePressThemeConfig | undefined): ThemeConfig | undefined {\n if (!themeConfig) {\n return undefined;\n }\n\n const logo = resolveLogoSrc(themeConfig.logo);\n const socialLinks = Object.fromEntries(\n (themeConfig.socialLinks ?? [])\n .map((link) => {\n const key = normalizeSocialIcon(link.icon);\n return key ? [key, link.link] : null;\n })\n .filter((entry): entry is [string, string] => entry !== null),\n );\n\n const theme: ThemeConfig = {\n ...(logo\n ? {\n header: {\n logo,\n },\n }\n : {}),\n ...(themeConfig.footer?.message || themeConfig.footer?.copyright\n ? {\n footer: {\n message: themeConfig.footer.message,\n copyright: themeConfig.footer.copyright,\n },\n }\n : {}),\n ...(Object.keys(socialLinks).length > 0\n ? {\n socialLinks,\n }\n : {}),\n };\n\n return logo || Object.keys(socialLinks).length > 0 || themeConfig.footer\n ? defineTheme(theme)\n : undefined;\n}\n\nfunction resolveSiteName(config: VitePressConfig): string | undefined {\n const siteTitle = config.themeConfig?.siteTitle;\n if (typeof siteTitle === \"string\" && siteTitle.trim()) {\n return siteTitle;\n }\n\n return config.title;\n}\n\nfunction mergeOxContentOptions(\n baseOptions: OxContentOptions,\n overrides: OxContentOptions,\n): OxContentOptions {\n const mergedSsg =\n overrides.ssg === false\n ? false\n : {\n ...(typeof baseOptions.ssg === \"object\" ? baseOptions.ssg : {}),\n ...(typeof overrides.ssg === \"object\" ? overrides.ssg : {}),\n theme:\n typeof baseOptions.ssg === \"object\" &&\n typeof overrides.ssg === \"object\" &&\n baseOptions.ssg.theme &&\n overrides.ssg.theme\n ? defineTheme(mergeThemes(baseOptions.ssg.theme, overrides.ssg.theme))\n : typeof overrides.ssg === \"object\" && overrides.ssg.theme\n ? overrides.ssg.theme\n : typeof baseOptions.ssg === \"object\"\n ? baseOptions.ssg.theme\n : undefined,\n };\n\n const mergedSearch =\n overrides.search === false\n ? false\n : typeof overrides.search === \"object\"\n ? {\n ...(typeof baseOptions.search === \"object\" ? baseOptions.search : {}),\n ...overrides.search,\n }\n : baseOptions.search;\n\n return {\n ...baseOptions,\n ...overrides,\n ssg: mergedSsg,\n search: mergedSearch,\n };\n}\n\n/**\n * Converts a VitePress sidebar config into ox-content navigation groups.\n * Nested VitePress items are flattened into the nearest ox-content group.\n */\nexport function convertVitePressSidebar(sidebar: VitePressSidebar): SsgNavigationGroup[] {\n if (Array.isArray(sidebar)) {\n return dedupeNavigationGroups(sidebarArrayToGroups(sidebar, \"Guide\"));\n }\n\n const groups = Object.entries(sidebar).flatMap(([key, items]) =>\n sidebarArrayToGroups(items, titleFromSidebarKey(key)),\n );\n\n return dedupeNavigationGroups(groups);\n}\n\n/**\n * Converts VitePress top navigation into ox-content sidebar groups.\n * This is used as a fallback when no explicit sidebar is defined.\n */\nexport function convertVitePressNav(nav: VitePressNavItem[]): SsgNavigationGroup[] {\n const groups: SsgNavigationGroup[] = [];\n const rootItems: SsgNavigationItem[] = [];\n\n for (const item of nav) {\n if (item.link) {\n rootItems.push(toNavigationItem(item.text, item.link));\n }\n\n if (item.items?.length) {\n const children = collectNavLinks(item.items);\n if (children.length > 0) {\n groups.push({\n title: item.text?.trim() || \"Navigation\",\n items: children,\n });\n }\n }\n }\n\n if (rootItems.length > 0) {\n groups.unshift({\n title: \"Navigation\",\n items: dedupeNavigationItems(rootItems),\n });\n }\n\n return dedupeNavigationGroups(groups);\n}\n\n/**\n * Creates ox-content plugin options from an existing VitePress config.\n */\nexport function fromVitePressConfig(\n config: VitePressConfig,\n overrides: OxContentOptions = {},\n): OxContentOptions {\n const theme = toThemeConfig(config.themeConfig);\n const navigation = config.themeConfig?.sidebar\n ? convertVitePressSidebar(config.themeConfig.sidebar)\n : config.themeConfig?.nav\n ? convertVitePressNav(config.themeConfig.nav)\n : undefined;\n\n const migrated: OxContentOptions = {\n ...(config.base ? { base: config.base } : {}),\n ...(config.themeConfig?.search?.placeholder\n ? {\n search: {\n placeholder: config.themeConfig.search.placeholder,\n },\n }\n : {}),\n ssg: {\n ...(resolveSiteName(config) ? { siteName: resolveSiteName(config) } : {}),\n ...(theme ? { theme } : {}),\n ...(navigation ? { navigation } : {}),\n },\n };\n\n return mergeOxContentOptions(migrated, overrides);\n}\n\n/**\n * Generates a TypeScript module exporting migrated ox-content options.\n *\n * This is used by the migration CLI so users can inspect and edit the resulting\n * object instead of keeping a runtime dependency on their VitePress config.\n */\nexport function generateVitePressMigrationConfig(\n config: VitePressConfig,\n overrides: OxContentOptions = {},\n options: GenerateVitePressMigrationConfigOptions = {},\n): string {\n const importSource = options.importSource ?? \"@ox-content/vite-plugin\";\n const migrated = fromVitePressConfig(config, overrides);\n\n return `import type { OxContentOptions } from ${JSON.stringify(importSource)};\n\nconst config = ${formatTsValue(migrated)} satisfies OxContentOptions;\n\nexport default config;\n`;\n}\n\nfunction formatTsValue(value: unknown, depth = 0): string {\n if (value === undefined) {\n return \"undefined\";\n }\n\n if (value === null || typeof value === \"boolean\" || typeof value === \"number\") {\n return JSON.stringify(value);\n }\n\n if (typeof value === \"string\") {\n return JSON.stringify(value);\n }\n\n if (Array.isArray(value)) {\n if (value.length === 0) {\n return \"[]\";\n }\n\n const indent = \" \".repeat(depth + 1);\n const closingIndent = \" \".repeat(depth);\n return `[\\n${value.map((item) => `${indent}${formatTsValue(item, depth + 1)},`).join(\"\\n\")}\\n${closingIndent}]`;\n }\n\n if (isRecord(value)) {\n const entries = Object.entries(value).filter(([, entryValue]) => entryValue !== undefined);\n if (entries.length === 0) {\n return \"{}\";\n }\n\n const indent = \" \".repeat(depth + 1);\n const closingIndent = \" \".repeat(depth);\n return `{\\n${entries\n .map(\n ([key, entryValue]) =>\n `${indent}${formatObjectKey(key)}: ${formatTsValue(entryValue, depth + 1)},`,\n )\n .join(\"\\n\")}\\n${closingIndent}}`;\n }\n\n return \"undefined\";\n}\n\nfunction formatObjectKey(key: string): string {\n return /^[A-Za-z_$][\\w$]*$/.test(key) ? key : JSON.stringify(key);\n}\n\n/**\n * Normalizes VitePress-specific frontmatter into ox-content's entry-page shape.\n */\nexport function normalizeVitePressFrontmatter(\n frontmatter: Record<string, unknown>,\n): Record<string, unknown> {\n return importNapiModuleSync().normalizeVitePressFrontmatter(frontmatter);\n}\n"],"mappings":";;AAGA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AK;CAG7B,IAAI,OAAO,UAAU,UACnB,OAAO,KAAK,UAAU,KAAK;CAG7B,IAAI,MAAM,QAAQ,KAAK,GAAG;EACxB,IAAI,MAAM,WAAW,GACnB,OAAO;EAGT,MAAM,SAAS,KAAK,OAAO,QAAQ,CAAC;EACpC,MAAM,gBAAgB,KAAK,OAAO,KAAK;EACvC,OAAO,MAAM,MAAM,KAAK,SAAS,GAAG,SAAS,cAAc,MAAM,QAAQ,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,IAAI,EAAE,IAAI,cAAc;CAC/G;CAEA,IAAI,SAAS,KAAK,GAAG;EACnB,MAAM,UAAU,OAAO,QAAQ,KAAK,CAAC,CAAC,QAAQ,GAAG,gBAAgB,eAAe,KAAA,CAAS;EACzF,IAAI,QAAQ,WAAW,GACrB,OAAO;EAGT,MAAM,SAAS,KAAK,OAAO,QAAQ,CAAC;EACpC,MAAM,gBAAgB,KAAK,OAAO,KAAK;EACvC,OAAO,MAAM,QACV,KACE,CAAC,KAAK,gBACL,GAAG,SAAS,gBAAgB,GAAG,EAAE,IAAI,cAAc,YAAY,QAAQ,CAAC,EAAE,EAC9E,CAAC,CACA,KAAK,IAAI,EAAE,IAAI,cAAc;CAClC;CAEA,OAAO;AACT;AAEA,SAAS,gBAAgB,KAAqB;CAC5C,OAAO,qBAAqB,KAAK,GAAG,IAAI,MAAM,KAAK,UAAU,GAAG;AAClE;;;;AAKA,SAAgB,8BACd,aACyB;CACzB,OAAO,qBAAqB,CAAC,CAAC,8BAA8B,WAAW;AACzE"}
|
|
1
|
+
{"version":3,"file":"vitepress.mjs","names":[],"sources":["../src/napi.ts","../src/header-chrome.ts","../src/theme-tokens.ts","../src/theme.ts","../src/vitepress.ts"],"sourcesContent":["import { createRequire } from \"node:module\";\n\ntype NapiModule = typeof import(\"@ox-content/napi\");\nconst requireNapi = createRequire(import.meta.url);\n\nfunction getDefaultExport(value: unknown): object | undefined {\n if (!value || typeof value !== \"object\" || !(\"default\" in value)) {\n return undefined;\n }\n\n const defaultExport = value.default;\n return defaultExport && typeof defaultExport === \"object\" ? defaultExport : undefined;\n}\n\nfunction normalizeNapiModule(mod: NapiModule): NapiModule {\n const defaultExport = getDefaultExport(mod);\n return defaultExport\n ? ({\n ...defaultExport,\n ...mod,\n } as NapiModule)\n : mod;\n}\n\nexport async function importNapiModule(): Promise<NapiModule> {\n return normalizeNapiModule((await import(\"@ox-content/napi\")) as NapiModule);\n}\n\nlet syncNapiModule: NapiModule | null | undefined;\n\nexport function importNapiModuleSync(): NapiModule {\n if (syncNapiModule) {\n return syncNapiModule;\n }\n\n if (syncNapiModule === null) {\n throw new Error(\n \"[ox-content] @ox-content/napi is required. Please ensure the NAPI module is built.\",\n );\n }\n\n try {\n const mod = requireNapi(\"@ox-content/napi\") as NapiModule;\n syncNapiModule = normalizeNapiModule(mod);\n return syncNapiModule;\n } catch {\n syncNapiModule = null;\n throw new Error(\n \"[ox-content] @ox-content/napi is required. Please ensure the NAPI module is built.\",\n );\n }\n}\n","/**\n * Opt-in header nav, announcement, and per-page chrome helpers.\n */\n\n/** Plain label or locale map (`{ en: \"Guide\", ja: \"ガイド\" }`). */\nexport type LocaleLabel = string | Record<string, string>;\n\n/** Header nav link or dropdown. */\nexport interface HeaderNavItem {\n text: LocaleLabel;\n link?: string;\n items?: HeaderNavItem[];\n}\n\n/** Announcement bar. Text is escaped; no raw HTML slot. */\nexport interface ThemeAnnouncement {\n text: string;\n /** https or same-origin only. */\n link?: string;\n /** Best-effort localStorage key for dismiss. */\n dismissKey?: string;\n}\n\n/** Per-page frontmatter chrome flags. `false` hides that region. */\nexport interface PageChromeFlags {\n sidebar?: boolean;\n outline?: boolean;\n aside?: boolean;\n footer?: boolean;\n navbar?: boolean;\n lastUpdated?: boolean;\n editLink?: boolean;\n}\n\n/** `false` or omitted stays off. `true` or `{}` enables default flag reading. */\nexport function resolvePageChromeOption(\n value: boolean | Record<string, unknown> | undefined,\n): boolean {\n return value === true || (typeof value === \"object\" && value !== null);\n}\n\n/** Reads hide flags from frontmatter. Non-boolean values are ignored. */\nexport function parsePageChromeFlags(frontmatter: Record<string, unknown>): PageChromeFlags {\n return {\n sidebar: readBool(frontmatter.sidebar),\n outline: readBool(frontmatter.outline),\n aside: readBool(frontmatter.aside),\n footer: readBool(frontmatter.footer),\n navbar: readBool(frontmatter.navbar),\n lastUpdated: readBool(frontmatter.lastUpdated),\n editLink: readBool(frontmatter.editLink),\n };\n}\n\nfunction readBool(value: unknown): boolean | undefined {\n return typeof value === \"boolean\" ? value : undefined;\n}\n\n/**\n * Picks the exact locale, its language, the default locale, then the first\n * non-empty own string in declaration order.\n */\nexport function resolveLocaleLabel(\n text: LocaleLabel,\n locale?: string,\n defaultLocale?: string,\n): string {\n if (typeof text === \"string\") {\n return text;\n }\n const candidates = [locale, locale?.split(\"-\")[0], defaultLocale, defaultLocale?.split(\"-\")[0]];\n for (const candidate of candidates) {\n if (!candidate || !Object.hasOwn(text, candidate)) {\n continue;\n }\n const value = text[candidate];\n if (typeof value === \"string\" && value.length > 0) {\n return value;\n }\n }\n for (const value of Object.values(text)) {\n if (typeof value === \"string\" && value.length > 0) {\n return value;\n }\n }\n return \"\";\n}\n\n/** Nav item after locale maps are flattened to strings. */\nexport interface ResolvedHeaderNavItem {\n text: string;\n link?: string;\n items?: ResolvedHeaderNavItem[];\n}\n\n/** Resolves locale maps so NAPI always receives string labels. */\nexport function resolveHeaderNavItems(\n items: HeaderNavItem[] | undefined,\n locale?: string,\n defaultLocale?: string,\n): ResolvedHeaderNavItem[] | undefined {\n if (!items?.length) {\n return undefined;\n }\n return items.map((item) => ({\n text: resolveLocaleLabel(item.text, locale, defaultLocale),\n link: item.link,\n items: resolveHeaderNavItems(item.items, locale, defaultLocale),\n }));\n}\n","/**\n * Free-form `--octc-*` custom properties for themes that need more than the\n * typed `colors` / `fonts` / `layout` fields.\n *\n * Keys are written **without** the `--octc-` prefix, so `\"surface-glass\"`\n * becomes `--octc-surface-glass`. This is the seam that keeps the two theme\n * axes independent: a color package can restyle code-block line markers, brand\n * accents, and surface textures purely through tokens, while a skin package\n * lays out geometry against those same tokens without knowing any color.\n */\nexport type ThemeTokens = Record<string, string>;\n\nconst TOKEN_PREFIX = \"--octc-\";\nconst TOKEN_NAME_PATTERN = /^[a-z][a-z0-9-]*$/;\n\n/**\n * Renders light and dark token records as the three selectors the SSG runtime\n * switches between: an explicit `[data-theme=\"dark\"]` opt-in, the OS\n * `prefers-color-scheme` fallback, and the `:root` base.\n *\n * Emitted after the typed color variables and before the theme's own `css`, so\n * a token can override a typed color and raw `css` can override a token.\n */\nexport function tokensToCss(light: ThemeTokens, dark: ThemeTokens): string {\n const lightBody = declarations(light, \" \");\n const darkBody = declarations(dark, \" \");\n const blocks: string[] = [];\n\n if (lightBody) {\n blocks.push(`:root {\\n${lightBody}\\n}`);\n }\n if (darkBody) {\n blocks.push(`[data-theme=\"dark\"] {\\n${darkBody}\\n}`);\n blocks.push(\n `@media (prefers-color-scheme: dark) {\\n :root:not([data-theme=\"light\"]) {\\n${declarations(dark, \" \")}\\n }\\n}`,\n );\n }\n\n return blocks.join(\"\\n\");\n}\n\nfunction declarations(tokens: ThemeTokens, indent: string): string {\n return Object.entries(tokens)\n .filter(([, value]) => value !== undefined && value !== \"\")\n .map(([name, value]) => `${indent}${TOKEN_PREFIX}${assertTokenName(name)}: ${value};`)\n .join(\"\\n\");\n}\n\nfunction assertTokenName(name: string): string {\n // Token names land verbatim inside a declaration block, so a stray `:` or `}`\n // would silently break every rule after it. Fail the build with the offending\n // key instead of shipping a corrupt stylesheet.\n if (!TOKEN_NAME_PATTERN.test(name)) {\n throw new Error(\n `Invalid theme token name: ${JSON.stringify(name)}. ` +\n `Token names are lowercase kebab-case without the \"${TOKEN_PREFIX}\" prefix (e.g. \"surface-glass\").`,\n );\n }\n return name;\n}\n","/**\n * Theme API for ox-content SSG\n *\n * Provides VitePress-like theming with default theme + customization.\n */\n\nimport type {\n HeaderNavItem,\n LocaleLabel,\n ResolvedHeaderNavItem,\n ThemeAnnouncement,\n} from \"./header-chrome\";\nimport { resolveHeaderNavItems } from \"./header-chrome\";\nimport { tokensToCss, type ThemeTokens } from \"./theme-tokens\";\n\nexport type { HeaderNavItem, LocaleLabel, ThemeAnnouncement } from \"./header-chrome\";\n\nexport type { ThemeTokens } from \"./theme-tokens\";\n\n/**\n * Theme color configuration.\n */\nexport interface ThemeColors {\n /** Primary accent color */\n primary?: string;\n /** Primary color on hover */\n primaryHover?: string;\n /** Background color */\n background?: string;\n /** Alternative background color (sidebar, code blocks) */\n backgroundAlt?: string;\n /** Main text color */\n text?: string;\n /** Muted/secondary text color */\n textMuted?: string;\n /** Border color */\n border?: string;\n /** Code block background color */\n codeBackground?: string;\n /** Code block gradient color at the top; defaults to `codeBackground` when customized */\n codeBackgroundTop?: string;\n /** Code block text color */\n codeText?: string;\n}\n\n/**\n * Theme layout configuration.\n */\nexport interface ThemeLayout {\n /** Sidebar width (CSS value, e.g., \"260px\") */\n sidebarWidth?: string;\n /** Header height (CSS value, e.g., \"60px\") */\n headerHeight?: string;\n /** Maximum content width (CSS value, e.g., \"960px\") */\n maxContentWidth?: string;\n}\n\n/**\n * Theme font configuration.\n */\nexport interface ThemeFonts {\n /** Sans-serif font stack */\n sans?: string;\n /** Monospace font stack */\n mono?: string;\n}\n\n/**\n * Entry page theme configuration.\n */\nexport interface ThemeEntryPage {\n /** Landing page presentation mode */\n mode?: \"default\" | \"subtle\";\n}\n\n/**\n * Theme header configuration.\n */\nexport interface ThemeHeader {\n /** Logo image URL */\n logo?: string;\n /** Light mode logo image URL */\n logoLight?: string;\n /** Dark mode logo image URL */\n logoDark?: string;\n /** Whether to render the site name text next to the logo */\n showSiteNameText?: boolean;\n /** Logo width in pixels */\n logoWidth?: number;\n /** Logo height in pixels */\n logoHeight?: number;\n}\n\n/**\n * Theme footer configuration.\n */\nexport interface ThemeFooter {\n /** Footer message (supports HTML) */\n message?: string;\n /** Copyright text (supports HTML) */\n copyright?: string;\n}\n\n/** Custom social link icon. */\nexport type SocialLinkIcon = string | { svg: string };\n\n/** Custom social link. */\nexport interface SocialLink {\n icon: SocialLinkIcon;\n link: string;\n ariaLabel?: string;\n}\n\n/** Legacy social links configuration. */\nexport interface LegacySocialLinks {\n /** GitHub URL */\n github?: string;\n /** Twitter/X URL */\n twitter?: string;\n /** Discord URL */\n discord?: string;\n}\n\n/** Social links configuration. */\nexport type SocialLinks = LegacySocialLinks | SocialLink[];\n\n/**\n * Embedded HTML content for specific positions in the page layout.\n */\nexport interface ThemeEmbed {\n /** Content to embed into <head> */\n head?: string;\n /** Content before header */\n headerBefore?: string;\n /** Content after header */\n headerAfter?: string;\n /** Content before sidebar navigation */\n sidebarBefore?: string;\n /** Content after sidebar navigation */\n sidebarAfter?: string;\n /** Content before main content */\n contentBefore?: string;\n /** Content after main content */\n contentAfter?: string;\n /** Content before footer */\n footerBefore?: string;\n /** Custom footer content (replaces default footer) */\n footer?: string;\n}\n\n/** Sidebar group or link, including recursively nested localized labels. */\nexport interface SidebarItem {\n /** Plain label or locale map (`{ en: \"Guide\", ja: \"ガイド\" }`). */\n text?: LocaleLabel;\n link?: string;\n items?: SidebarItem[];\n collapsed?: boolean;\n stickyCollapsed?: boolean;\n}\n\n/**\n * Complete theme configuration.\n */\nexport interface ThemeConfig {\n /** Theme name for identification */\n name?: string;\n /** Base theme to extend */\n extends?: ThemeConfig;\n /**\n * Preserve the current surface during same-origin MPA navigation with the\n * browser's cross-document View Transition API.\n *\n * Unsupported browsers use normal navigation. Reduced-motion preferences\n * never enable the transition. Set `false` to opt out.\n *\n * @default true\n */\n viewTransitions?: boolean;\n /**\n * Show the right-hand \"On this page\" outline.\n *\n * Default `false`. When `true`, the outline is rendered only on pages\n * that have TOC entries, using the existing `<aside class=\"toc\">` markup.\n */\n aside?: boolean;\n /**\n * Show a breadcrumb trail from the site root through sidebar ancestors.\n *\n * Default `false`. `true` or an object enables the trail. Frontmatter\n * `breadcrumbs: false` still hides it on that page.\n */\n breadcrumbs?: boolean | Record<string, unknown>;\n /** Light mode colors (maps to CSS variables) */\n colors?: ThemeColors;\n /** Dark mode colors (maps to CSS variables) */\n darkColors?: ThemeColors;\n /** Font configuration (maps to CSS variables) */\n fonts?: ThemeFonts;\n /** Entry page configuration */\n entryPage?: ThemeEntryPage;\n /** Layout configuration (maps to CSS variables) */\n layout?: ThemeLayout;\n /** Header configuration */\n header?: ThemeHeader;\n /**\n * Opt-in header nav. Each item is `{ text, link }` or a dropdown\n * `{ text, items }`. Labels are escaped. `javascript:`, `data:`,\n * `vbscript:`, and protocol-relative `//` links are omitted.\n */\n nav?: HeaderNavItem[];\n /**\n * Opt-in announcement bar above the header. Text is escaped.\n * Optional `link` must be https or same-origin.\n */\n announcement?: ThemeAnnouncement;\n /** Footer configuration */\n footer?: ThemeFooter;\n /** Social links configuration */\n socialLinks?: SocialLinks;\n sidebar?: SidebarItem[];\n /** Embedded HTML content at specific positions */\n embed?: ThemeEmbed;\n /**\n * Extra `--octc-*` custom properties for light mode, keyed without the\n * prefix. Merged key-by-key across composed layers, so a later layer can\n * restyle one token without redeclaring the rest.\n */\n tokens?: ThemeTokens;\n /** Extra `--octc-*` custom properties for dark mode. */\n darkTokens?: ThemeTokens;\n /**\n * Additional custom CSS. Composed layers **concatenate** this rather than\n * overwrite, so stacking a skin and a color scheme keeps both stylesheets.\n */\n css?: string;\n /** Additional custom JavaScript. Concatenated across composed layers. */\n js?: string;\n}\n\n/**\n * Resolved theme configuration (after merging with defaults).\n */\nexport interface ResolvedThemeConfig {\n name: string;\n viewTransitions: boolean;\n aside: boolean;\n breadcrumbs: boolean;\n colors: ThemeColors;\n darkColors: ThemeColors;\n fonts: ThemeFonts;\n entryPage: ThemeEntryPage;\n layout: ThemeLayout;\n header: ThemeHeader;\n nav?: HeaderNavItem[];\n announcement?: ThemeAnnouncement;\n footer: ThemeFooter;\n socialLinks: SocialLinks;\n sidebar: SidebarItem[];\n embed: ThemeEmbed;\n tokens: ThemeTokens;\n darkTokens: ThemeTokens;\n css: string;\n js: string;\n}\n\n/**\n * Default theme configuration.\n * Based on the current ox-content SSG styles.\n */\nexport const defaultTheme: ThemeConfig = {\n name: \"default\",\n viewTransitions: true,\n aside: false,\n breadcrumbs: false,\n colors: {\n primary: \"#4f6fae\",\n primaryHover: \"#425f96\",\n background: \"#ffffff\",\n backgroundAlt: \"#f5f7fb\",\n text: \"#131a30\",\n textMuted: \"#4f607b\",\n border: \"#d2dbea\",\n codeBackground: \"#101a31\",\n codeBackgroundTop: \"#18264a\",\n codeText: \"#edf3ff\",\n },\n darkColors: {\n primary: \"#86a4da\",\n primaryHover: \"#a3bbe8\",\n background: \"#060816\",\n backgroundAlt: \"#0d1528\",\n text: \"#ebf2ff\",\n textMuted: \"#8ea0bf\",\n border: \"#223252\",\n codeBackground: \"#0a1020\",\n codeBackgroundTop: \"#0a1020\",\n codeText: \"#e7f0ff\",\n },\n fonts: {\n sans: '\"IBM Plex Sans\", \"Avenir Next\", \"Segoe UI Variable\", \"Segoe UI\", sans-serif',\n mono: '\"IBM Plex Mono\", \"SFMono-Regular\", Consolas, monospace',\n },\n entryPage: {\n mode: \"default\",\n },\n layout: {\n sidebarWidth: \"260px\",\n headerHeight: \"60px\",\n maxContentWidth: \"960px\",\n },\n header: {\n logo: undefined,\n logoLight: undefined,\n logoDark: undefined,\n showSiteNameText: true,\n logoWidth: 28,\n logoHeight: 28,\n },\n footer: {\n message: undefined,\n copyright: undefined,\n },\n socialLinks: {},\n embed: {},\n tokens: {},\n darkTokens: {},\n css: \"\",\n js: \"\",\n};\n\n/**\n * Deep merge two objects.\n */\nfunction deepMerge<T extends Record<string, unknown>>(target: T, source: Partial<T>): T {\n const result = { ...target };\n\n for (const key of Object.keys(source) as (keyof T)[]) {\n const sourceValue = source[key];\n const targetValue = target[key];\n\n if (\n sourceValue !== undefined &&\n typeof sourceValue === \"object\" &&\n sourceValue !== null &&\n !Array.isArray(sourceValue) &&\n typeof targetValue === \"object\" &&\n targetValue !== null &&\n !Array.isArray(targetValue)\n ) {\n result[key] = deepMerge(\n targetValue as Record<string, unknown>,\n sourceValue as Record<string, unknown>,\n ) as T[keyof T];\n } else if (sourceValue !== undefined) {\n result[key] = sourceValue as T[keyof T];\n }\n }\n\n return result;\n}\n\n/**\n * Defines a theme configuration with type checking.\n *\n * @example\n * ```ts\n * const myTheme = defineTheme({\n * extends: defaultTheme,\n * colors: {\n * primary: '#3498db',\n * },\n * footer: {\n * copyright: '2025 My Company',\n * },\n * });\n * ```\n */\nexport function defineTheme(config: ThemeConfig): ThemeConfig {\n return config;\n}\n\n/**\n * Merges multiple theme configurations.\n * Later themes override earlier ones.\n *\n * Object fields (`colors`, `tokens`, `layout`, …) merge key-by-key, but `css`\n * and `js` **concatenate** in layer order — overwriting them would throw away\n * one half of a `[skin, colorScheme]` stack. Identical fragments are joined\n * once, so a layer reached through both an array and an `extends` chain does\n * not emit its stylesheet twice.\n *\n * @example\n * ```ts\n * const merged = mergeThemes(defaultTheme, pixelSkin, tokyoNight, overrides);\n * ```\n */\nexport function mergeThemes(...themes: (ThemeConfig | ThemeConfig[])[]): ThemeConfig {\n const layers = themes.flat();\n if (layers.length === 0) {\n return { ...defaultTheme };\n }\n\n let result: ThemeConfig = {};\n\n for (const theme of layers) {\n const { css, js, ...rest } = theme;\n result = deepMerge(\n result as Record<string, unknown>,\n rest as Record<string, unknown>,\n ) as ThemeConfig;\n\n const mergedCss = appendSource(result.css, css);\n if (mergedCss) {\n result.css = mergedCss;\n }\n const mergedJs = appendSource(result.js, js);\n if (mergedJs) {\n result.js = mergedJs;\n }\n }\n\n return result;\n}\n\nfunction appendSource(existing: string | undefined, addition: string | undefined): string {\n const next = addition?.trim() ?? \"\";\n const current = existing ?? \"\";\n if (!next || current.includes(next)) {\n return current;\n }\n return current ? `${current}\\n${next}` : next;\n}\n\n/**\n * Resolves a theme configuration by merging with its extends chain and defaults.\n *\n * An array composes independent layers left to right, which is how a skin\n * package and a color package are stacked:\n *\n * ```ts\n * resolveTheme([pixelSkin, tokyoNight, { footer: { copyright: \"2026\" } }]);\n * ```\n */\nexport function resolveTheme(config?: ThemeConfig | ThemeConfig[]): ResolvedThemeConfig {\n const layers = config === undefined ? [defaultTheme] : Array.isArray(config) ? config : [config];\n const chain = layers.flatMap(expandExtendsChain);\n\n // Always start with default theme\n if (chain.length === 0) {\n chain.push(defaultTheme);\n }\n if (chain[0] !== defaultTheme && chain[0]?.name !== \"default\") {\n chain.unshift(defaultTheme);\n }\n\n // Merge all themes in the chain\n const merged = mergeThemes(...chain.map(withDerivedCodeBackgroundTop));\n\n // Return resolved config with all required fields\n return {\n name: merged.name ?? \"custom\",\n viewTransitions: merged.viewTransitions ?? defaultTheme.viewTransitions ?? true,\n aside: merged.aside ?? defaultTheme.aside ?? false,\n breadcrumbs: resolveThemeFlag(merged.breadcrumbs),\n colors: merged.colors ?? defaultTheme.colors!,\n darkColors: merged.darkColors ?? defaultTheme.darkColors!,\n fonts: merged.fonts ?? defaultTheme.fonts!,\n entryPage: merged.entryPage ?? defaultTheme.entryPage!,\n layout: merged.layout ?? defaultTheme.layout!,\n header: merged.header ?? defaultTheme.header!,\n nav: merged.nav,\n announcement: merged.announcement,\n footer: merged.footer ?? defaultTheme.footer!,\n socialLinks: merged.socialLinks ?? defaultTheme.socialLinks!,\n sidebar: merged.sidebar ?? [],\n embed: merged.embed ?? {},\n tokens: merged.tokens ?? {},\n darkTokens: merged.darkTokens ?? {},\n css: merged.css ?? \"\",\n js: merged.js ?? \"\",\n };\n}\n\n/**\n * Flattens one layer's `extends` chain into base-first order.\n *\n * The `seen` guard keeps a theme that accidentally extends itself (or forms a\n * cycle through two packages) from hanging the build.\n */\nfunction expandExtendsChain(config: ThemeConfig): ThemeConfig[] {\n const chain: ThemeConfig[] = [];\n const seen = new Set<ThemeConfig>();\n let current: ThemeConfig | undefined = config;\n\n while (current && !seen.has(current)) {\n seen.add(current);\n chain.unshift(current);\n current = current.extends;\n }\n\n return chain;\n}\n\nfunction withDerivedCodeBackgroundTop(theme: ThemeConfig): ThemeConfig {\n const derive = (colors: ThemeColors | undefined): ThemeColors | undefined => {\n if (colors?.codeBackground !== undefined && colors.codeBackgroundTop === undefined) {\n return { ...colors, codeBackgroundTop: colors.codeBackground };\n }\n return colors;\n };\n\n return {\n ...theme,\n colors: derive(theme.colors),\n darkColors: derive(theme.darkColors),\n };\n}\n\n/**\n * Converts resolved theme to the format expected by Rust NAPI.\n */\nexport function themeToNapi(theme: ResolvedThemeConfig, locale?: string): NapiThemeConfig {\n const socialLinks = socialLinksToNapi(theme.socialLinks);\n\n return {\n viewTransitions: theme.viewTransitions,\n aside: theme.aside,\n breadcrumbs: theme.breadcrumbs,\n colors: theme.colors.primary\n ? {\n primary: theme.colors.primary,\n primaryHover: theme.colors.primaryHover,\n background: theme.colors.background,\n backgroundAlt: theme.colors.backgroundAlt,\n text: theme.colors.text,\n textMuted: theme.colors.textMuted,\n border: theme.colors.border,\n codeBackground: theme.colors.codeBackground,\n codeBackgroundTop: theme.colors.codeBackgroundTop,\n codeText: theme.colors.codeText,\n }\n : undefined,\n darkColors: theme.darkColors.primary\n ? {\n primary: theme.darkColors.primary,\n primaryHover: theme.darkColors.primaryHover,\n background: theme.darkColors.background,\n backgroundAlt: theme.darkColors.backgroundAlt,\n text: theme.darkColors.text,\n textMuted: theme.darkColors.textMuted,\n border: theme.darkColors.border,\n codeBackground: theme.darkColors.codeBackground,\n codeBackgroundTop: theme.darkColors.codeBackgroundTop,\n codeText: theme.darkColors.codeText,\n }\n : undefined,\n fonts: theme.fonts.sans\n ? {\n sans: theme.fonts.sans,\n mono: theme.fonts.mono,\n }\n : undefined,\n entryPage: theme.entryPage.mode\n ? {\n mode: theme.entryPage.mode,\n }\n : undefined,\n layout: theme.layout.sidebarWidth\n ? {\n sidebarWidth: theme.layout.sidebarWidth,\n headerHeight: theme.layout.headerHeight,\n maxContentWidth: theme.layout.maxContentWidth,\n }\n : undefined,\n header:\n theme.header.logo || theme.header.logoLight || theme.header.logoDark\n ? {\n logo: theme.header.logo,\n logoLight: theme.header.logoLight,\n logoDark: theme.header.logoDark,\n showSiteNameText: theme.header.showSiteNameText,\n logoWidth: theme.header.logoWidth,\n logoHeight: theme.header.logoHeight,\n }\n : undefined,\n nav: resolveHeaderNavItems(theme.nav, locale),\n announcement: theme.announcement?.text ? theme.announcement : undefined,\n footer:\n theme.footer.message || theme.footer.copyright\n ? {\n message: theme.footer.message,\n copyright: theme.footer.copyright,\n }\n : undefined,\n socialLinks,\n embed: Object.keys(theme.embed).length > 0 ? theme.embed : undefined,\n css: themeCss(theme) || undefined,\n js: theme.js || undefined,\n };\n}\n\n/**\n * Token blocks come first so a theme's own `css` stays the final word, and both\n * land after the typed color variables the Rust renderer emits.\n */\nfunction themeCss(theme: ResolvedThemeConfig): string {\n const tokenCss = tokensToCss(theme.tokens, theme.darkTokens);\n if (!tokenCss) {\n return theme.css;\n }\n return theme.css ? `${tokenCss}\\n${theme.css}` : tokenCss;\n}\n\nfunction socialLinksToNapi(links: SocialLinks): NapiSocialLinks | undefined {\n if (Array.isArray(links)) {\n const items = links.map((item) => {\n const icon = typeof item.icon === \"string\" ? item.icon : undefined;\n const iconSvg = typeof item.icon === \"object\" ? item.icon.svg : undefined;\n return { icon, iconSvg, link: item.link, ariaLabel: item.ariaLabel };\n });\n return items.length > 0 ? { links: items } : undefined;\n }\n\n return links.github || links.twitter || links.discord\n ? { github: links.github, twitter: links.twitter, discord: links.discord }\n : undefined;\n}\n\n/**\n * NAPI-compatible theme colors type.\n */\nexport interface NapiThemeColors {\n primary?: string;\n primaryHover?: string;\n background?: string;\n backgroundAlt?: string;\n text?: string;\n textMuted?: string;\n border?: string;\n codeBackground?: string;\n codeBackgroundTop?: string;\n codeText?: string;\n}\n\n/**\n * NAPI-compatible theme fonts type.\n */\nexport interface NapiThemeFonts {\n sans?: string;\n mono?: string;\n}\n\n/**\n * NAPI-compatible entry page theme type.\n */\nexport interface NapiThemeEntryPage {\n mode?: \"default\" | \"subtle\";\n}\n\n/**\n * NAPI-compatible theme layout type.\n */\nexport interface NapiThemeLayout {\n sidebarWidth?: string;\n headerHeight?: string;\n maxContentWidth?: string;\n}\n\n/**\n * NAPI-compatible theme header type.\n */\nexport interface NapiThemeHeader {\n logo?: string;\n logoLight?: string;\n logoDark?: string;\n showSiteNameText?: boolean;\n logoWidth?: number;\n logoHeight?: number;\n}\n\n/**\n * NAPI-compatible theme footer type.\n */\nexport interface NapiThemeFooter {\n message?: string;\n copyright?: string;\n}\n\n/**\n * NAPI-compatible social links type.\n */\nexport interface NapiSocialLinks {\n github?: string;\n twitter?: string;\n discord?: string;\n links?: NapiSocialLink[];\n}\n\nexport interface NapiSocialLink {\n icon?: string;\n iconSvg?: string;\n link: string;\n ariaLabel?: string;\n}\n\n/**\n * NAPI-compatible theme embed type.\n */\nexport interface NapiThemeEmbed {\n head?: string;\n headerBefore?: string;\n headerAfter?: string;\n sidebarBefore?: string;\n sidebarAfter?: string;\n contentBefore?: string;\n contentAfter?: string;\n footerBefore?: string;\n footer?: string;\n}\n\nfunction resolveThemeFlag(value: boolean | Record<string, unknown> | undefined): boolean {\n return value === true || (typeof value === \"object\" && value !== null);\n}\n\n/**\n * NAPI-compatible theme configuration type.\n */\nexport interface NapiThemeConfig {\n /** Progressive cross-document transitions for same-origin MPA navigation. */\n viewTransitions?: boolean;\n /** Right-hand \"On this page\" outline. */\n aside?: boolean;\n /** Breadcrumb trail from the site root through sidebar ancestors. */\n breadcrumbs?: boolean;\n nav?: ResolvedHeaderNavItem[];\n announcement?: ThemeAnnouncement;\n colors?: NapiThemeColors;\n darkColors?: NapiThemeColors;\n fonts?: NapiThemeFonts;\n entryPage?: NapiThemeEntryPage;\n layout?: NapiThemeLayout;\n header?: NapiThemeHeader;\n footer?: NapiThemeFooter;\n socialLinks?: NapiSocialLinks;\n embed?: NapiThemeEmbed;\n css?: string;\n js?: string;\n}\n","import { importNapiModuleSync } from \"./napi\";\nimport { defineTheme, mergeThemes, type ThemeConfig } from \"./theme\";\nimport type { OxContentOptions, SsgNavigationGroup, SsgNavigationItem } from \"./types\";\n\nexport interface VitePressLogo {\n light?: string;\n dark?: string;\n src?: string;\n alt?: string;\n}\n\nexport interface VitePressSocialLink {\n icon: string;\n link: string;\n ariaLabel?: string;\n}\n\nexport interface VitePressFooter {\n message?: string;\n copyright?: string;\n}\n\nexport interface VitePressSidebarItem {\n text?: string;\n link?: string;\n items?: VitePressSidebarItem[];\n collapsed?: boolean;\n}\n\nexport type VitePressSidebar = VitePressSidebarItem[] | Record<string, VitePressSidebarItem[]>;\n\nexport interface VitePressNavItem {\n text?: string;\n link?: string;\n items?: VitePressNavItem[];\n activeMatch?: string;\n}\n\nexport interface VitePressThemeConfig {\n siteTitle?: string | false;\n logo?: string | VitePressLogo;\n nav?: VitePressNavItem[];\n sidebar?: VitePressSidebar;\n socialLinks?: VitePressSocialLink[];\n footer?: VitePressFooter;\n search?: {\n placeholder?: string;\n };\n}\n\nexport interface VitePressConfig {\n title?: string;\n description?: string;\n base?: string;\n themeConfig?: VitePressThemeConfig;\n}\n\nexport interface GenerateVitePressMigrationConfigOptions {\n importSource?: string;\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\nfunction isExternalLink(value: string): boolean {\n return /^[a-z][a-z0-9+.-]*:/i.test(value) || value.startsWith(\"//\");\n}\n\nfunction splitLink(value: string): { pathname: string; suffix: string } {\n const match = /^([^?#]*)([?#].*)?$/.exec(value);\n return {\n pathname: match?.[1] ?? value,\n suffix: match?.[2] ?? \"\",\n };\n}\n\nfunction normalizeInternalPath(value: string): string {\n const { pathname } = splitLink(value.trim());\n let normalized = pathname || \"/\";\n\n if (!normalized.startsWith(\"/\")) {\n normalized = `/${normalized}`;\n }\n\n normalized = normalized\n .replace(/\\/index(?:\\.(?:html?|md|markdown))?$/i, \"/\")\n .replace(/\\.(?:html?|md|markdown)$/i, \"\");\n\n if (normalized !== \"/\") {\n normalized = normalized.replace(/\\/+$/, \"\");\n }\n\n return normalized || \"/\";\n}\n\nfunction formatTitle(value: string): string {\n return value\n .replace(/[-_]([a-z])/g, (_, char: string) => ` ${char.toUpperCase()}`)\n .replace(/^[a-z]/, (char) => char.toUpperCase());\n}\n\nfunction titleFromPath(value: string): string {\n const normalized = normalizeInternalPath(value);\n if (normalized === \"/\") {\n return \"Home\";\n }\n\n const segment = normalized.split(\"/\").filter(Boolean).pop() ?? \"Page\";\n return formatTitle(segment);\n}\n\nfunction titleFromSidebarKey(value: string): string {\n const segment = value\n .replace(/^\\/+|\\/+$/g, \"\")\n .split(\"/\")\n .filter(Boolean)\n .pop();\n return formatTitle(segment ?? \"guide\");\n}\n\nfunction toNavigationItem(text: string | undefined, link: string): SsgNavigationItem {\n const title = text?.trim() || titleFromPath(link);\n\n if (isExternalLink(link) || link.startsWith(\"#\")) {\n return { title, href: link };\n }\n\n const { suffix } = splitLink(link);\n const path = normalizeInternalPath(link);\n\n return suffix ? { title, path, href: `${path}${suffix}` } : { title, path };\n}\n\nfunction dedupeNavigationItems(items: SsgNavigationItem[]): SsgNavigationItem[] {\n const seen = new Set<string>();\n const next: SsgNavigationItem[] = [];\n\n for (const item of items) {\n const key = `${item.title}::${item.path ?? \"\"}::${item.href ?? \"\"}`;\n if (seen.has(key)) {\n continue;\n }\n seen.add(key);\n next.push(item);\n }\n\n return next;\n}\n\nfunction dedupeNavigationGroups(groups: SsgNavigationGroup[]): SsgNavigationGroup[] {\n const merged = new Map<string, SsgNavigationItem[]>();\n const orderedTitles: string[] = [];\n\n for (const group of groups) {\n if (group.items.length === 0) {\n continue;\n }\n\n if (!merged.has(group.title)) {\n merged.set(group.title, []);\n orderedTitles.push(group.title);\n }\n\n merged.get(group.title)!.push(...group.items);\n }\n\n return orderedTitles.map((title) => ({\n title,\n items: dedupeNavigationItems(merged.get(title) ?? []),\n }));\n}\n\nfunction collectSidebarLinks(items: VitePressSidebarItem[]): SsgNavigationItem[] {\n const links: SsgNavigationItem[] = [];\n\n for (const item of items) {\n if (item.link) {\n links.push(toNavigationItem(item.text, item.link));\n }\n\n if (item.items?.length) {\n links.push(...collectSidebarLinks(item.items));\n }\n }\n\n return dedupeNavigationItems(links);\n}\n\nfunction sidebarArrayToGroups(\n items: VitePressSidebarItem[],\n fallbackTitle: string,\n): SsgNavigationGroup[] {\n const groups: SsgNavigationGroup[] = [];\n const rootItems: SsgNavigationItem[] = [];\n\n for (const item of items) {\n if (item.link) {\n rootItems.push(toNavigationItem(item.text, item.link));\n }\n\n if (item.items?.length) {\n const children = collectSidebarLinks(item.items);\n if (children.length > 0) {\n groups.push({\n title: item.text?.trim() || fallbackTitle,\n items: children,\n });\n }\n }\n }\n\n if (rootItems.length > 0) {\n groups.unshift({\n title: fallbackTitle,\n items: dedupeNavigationItems(rootItems),\n });\n }\n\n return groups;\n}\n\nfunction collectNavLinks(items: VitePressNavItem[]): SsgNavigationItem[] {\n const links: SsgNavigationItem[] = [];\n\n for (const item of items) {\n if (item.link) {\n links.push(toNavigationItem(item.text, item.link));\n }\n\n if (item.items?.length) {\n links.push(...collectNavLinks(item.items));\n }\n }\n\n return dedupeNavigationItems(links);\n}\n\nfunction resolveLogoSrc(logo: string | VitePressLogo | undefined): string | undefined {\n if (!logo) {\n return undefined;\n }\n\n if (typeof logo === \"string\") {\n return logo;\n }\n\n return logo.light ?? logo.dark ?? logo.src;\n}\n\nfunction normalizeSocialIcon(icon: string): \"github\" | \"twitter\" | \"discord\" | undefined {\n const normalized = icon.trim().toLowerCase();\n\n if (normalized === \"github\") return \"github\";\n if (normalized === \"discord\") return \"discord\";\n if (normalized === \"twitter\" || normalized === \"x\" || normalized === \"x-twitter\") {\n return \"twitter\";\n }\n\n return undefined;\n}\n\nfunction toThemeConfig(themeConfig: VitePressThemeConfig | undefined): ThemeConfig | undefined {\n if (!themeConfig) {\n return undefined;\n }\n\n const logo = resolveLogoSrc(themeConfig.logo);\n const socialLinks = Object.fromEntries(\n (themeConfig.socialLinks ?? [])\n .map((link) => {\n const key = normalizeSocialIcon(link.icon);\n return key ? [key, link.link] : null;\n })\n .filter((entry): entry is [string, string] => entry !== null),\n );\n\n const theme: ThemeConfig = {\n ...(logo\n ? {\n header: {\n logo,\n },\n }\n : {}),\n ...(themeConfig.footer?.message || themeConfig.footer?.copyright\n ? {\n footer: {\n message: themeConfig.footer.message,\n copyright: themeConfig.footer.copyright,\n },\n }\n : {}),\n ...(Object.keys(socialLinks).length > 0\n ? {\n socialLinks,\n }\n : {}),\n };\n\n return logo || Object.keys(socialLinks).length > 0 || themeConfig.footer\n ? defineTheme(theme)\n : undefined;\n}\n\nfunction resolveSiteName(config: VitePressConfig): string | undefined {\n const siteTitle = config.themeConfig?.siteTitle;\n if (typeof siteTitle === \"string\" && siteTitle.trim()) {\n return siteTitle;\n }\n\n return config.title;\n}\n\nfunction mergeOxContentOptions(\n baseOptions: OxContentOptions,\n overrides: OxContentOptions,\n): OxContentOptions {\n const mergedSsg =\n overrides.ssg === false\n ? false\n : {\n ...(typeof baseOptions.ssg === \"object\" ? baseOptions.ssg : {}),\n ...(typeof overrides.ssg === \"object\" ? overrides.ssg : {}),\n theme:\n typeof baseOptions.ssg === \"object\" &&\n typeof overrides.ssg === \"object\" &&\n baseOptions.ssg.theme &&\n overrides.ssg.theme\n ? defineTheme(mergeThemes(baseOptions.ssg.theme, overrides.ssg.theme))\n : typeof overrides.ssg === \"object\" && overrides.ssg.theme\n ? overrides.ssg.theme\n : typeof baseOptions.ssg === \"object\"\n ? baseOptions.ssg.theme\n : undefined,\n };\n\n const mergedSearch =\n overrides.search === false\n ? false\n : typeof overrides.search === \"object\"\n ? {\n ...(typeof baseOptions.search === \"object\" ? baseOptions.search : {}),\n ...overrides.search,\n }\n : baseOptions.search;\n\n return {\n ...baseOptions,\n ...overrides,\n ssg: mergedSsg,\n search: mergedSearch,\n };\n}\n\n/**\n * Converts a VitePress sidebar config into ox-content navigation groups.\n * Nested VitePress items are flattened into the nearest ox-content group.\n */\nexport function convertVitePressSidebar(sidebar: VitePressSidebar): SsgNavigationGroup[] {\n if (Array.isArray(sidebar)) {\n return dedupeNavigationGroups(sidebarArrayToGroups(sidebar, \"Guide\"));\n }\n\n const groups = Object.entries(sidebar).flatMap(([key, items]) =>\n sidebarArrayToGroups(items, titleFromSidebarKey(key)),\n );\n\n return dedupeNavigationGroups(groups);\n}\n\n/**\n * Converts VitePress top navigation into ox-content sidebar groups.\n * This is used as a fallback when no explicit sidebar is defined.\n */\nexport function convertVitePressNav(nav: VitePressNavItem[]): SsgNavigationGroup[] {\n const groups: SsgNavigationGroup[] = [];\n const rootItems: SsgNavigationItem[] = [];\n\n for (const item of nav) {\n if (item.link) {\n rootItems.push(toNavigationItem(item.text, item.link));\n }\n\n if (item.items?.length) {\n const children = collectNavLinks(item.items);\n if (children.length > 0) {\n groups.push({\n title: item.text?.trim() || \"Navigation\",\n items: children,\n });\n }\n }\n }\n\n if (rootItems.length > 0) {\n groups.unshift({\n title: \"Navigation\",\n items: dedupeNavigationItems(rootItems),\n });\n }\n\n return dedupeNavigationGroups(groups);\n}\n\n/**\n * Creates ox-content plugin options from an existing VitePress config.\n */\nexport function fromVitePressConfig(\n config: VitePressConfig,\n overrides: OxContentOptions = {},\n): OxContentOptions {\n const theme = toThemeConfig(config.themeConfig);\n const navigation = config.themeConfig?.sidebar\n ? convertVitePressSidebar(config.themeConfig.sidebar)\n : config.themeConfig?.nav\n ? convertVitePressNav(config.themeConfig.nav)\n : undefined;\n\n const migrated: OxContentOptions = {\n ...(config.base ? { base: config.base } : {}),\n ...(config.themeConfig?.search?.placeholder\n ? {\n search: {\n placeholder: config.themeConfig.search.placeholder,\n },\n }\n : {}),\n ssg: {\n ...(resolveSiteName(config) ? { siteName: resolveSiteName(config) } : {}),\n ...(theme ? { theme } : {}),\n ...(navigation ? { navigation } : {}),\n },\n };\n\n return mergeOxContentOptions(migrated, overrides);\n}\n\n/**\n * Generates a TypeScript module exporting migrated ox-content options.\n *\n * This is used by the migration CLI so users can inspect and edit the resulting\n * object instead of keeping a runtime dependency on their VitePress config.\n */\nexport function generateVitePressMigrationConfig(\n config: VitePressConfig,\n overrides: OxContentOptions = {},\n options: GenerateVitePressMigrationConfigOptions = {},\n): string {\n const importSource = options.importSource ?? \"@ox-content/vite-plugin\";\n const migrated = fromVitePressConfig(config, overrides);\n\n return `import type { OxContentOptions } from ${JSON.stringify(importSource)};\n\nconst config = ${formatTsValue(migrated)} satisfies OxContentOptions;\n\nexport default config;\n`;\n}\n\nfunction formatTsValue(value: unknown, depth = 0): string {\n if (value === undefined) {\n return \"undefined\";\n }\n\n if (value === null || typeof value === \"boolean\" || typeof value === \"number\") {\n return JSON.stringify(value);\n }\n\n if (typeof value === \"string\") {\n return JSON.stringify(value);\n }\n\n if (Array.isArray(value)) {\n if (value.length === 0) {\n return \"[]\";\n }\n\n const indent = \" \".repeat(depth + 1);\n const closingIndent = \" \".repeat(depth);\n return `[\\n${value.map((item) => `${indent}${formatTsValue(item, depth + 1)},`).join(\"\\n\")}\\n${closingIndent}]`;\n }\n\n if (isRecord(value)) {\n const entries = Object.entries(value).filter(([, entryValue]) => entryValue !== undefined);\n if (entries.length === 0) {\n return \"{}\";\n }\n\n const indent = \" \".repeat(depth + 1);\n const closingIndent = \" \".repeat(depth);\n return `{\\n${entries\n .map(\n ([key, entryValue]) =>\n `${indent}${formatObjectKey(key)}: ${formatTsValue(entryValue, depth + 1)},`,\n )\n .join(\"\\n\")}\\n${closingIndent}}`;\n }\n\n return \"undefined\";\n}\n\nfunction formatObjectKey(key: string): string {\n return /^[A-Za-z_$][\\w$]*$/.test(key) ? key : JSON.stringify(key);\n}\n\n/**\n * Normalizes VitePress-specific frontmatter into ox-content's entry-page shape.\n */\nexport function normalizeVitePressFrontmatter(\n frontmatter: Record<string, unknown>,\n): Record<string, unknown> {\n return importNapiModuleSync().normalizeVitePressFrontmatter(frontmatter);\n}\n"],"mappings":";;AAGA,MAAM,cAAc,cAAc,YAAY,GAAG;AAEjD,SAAS,iBAAiB,OAAoC;CAC5D,IAAI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
|
|
1
1
|
{
|
|
2
2
|
"name": "@ox-content/vite-plugin",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0-alpha.2",
|
|
4
4
|
"description": "Vite plugin for Ox Content - High-performance Markdown processing with Environment API",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"environment-api",
|
|
@@ -66,28 +66,29 @@
|
|
|
66
66
|
"cspell-lib": "^10.0.1",
|
|
67
67
|
"glob": "^13.0.6",
|
|
68
68
|
"playwright": "^1.62.1",
|
|
69
|
-
"puppeteer": "^25.
|
|
69
|
+
"puppeteer": "^25.8.0",
|
|
70
70
|
"rehype-parse": "^9.0.1",
|
|
71
71
|
"rehype-stringify": "^10.0.1",
|
|
72
|
-
"rolldown": "^1.2.
|
|
73
|
-
"shiki": "^4.4.2",
|
|
72
|
+
"rolldown": "^1.2.5",
|
|
74
73
|
"typescript": "^7.0.2",
|
|
75
74
|
"unified": "^11.0.5",
|
|
76
|
-
"@ox-content/napi": "
|
|
75
|
+
"@ox-content/napi": "3.0.0-alpha.2"
|
|
77
76
|
},
|
|
78
77
|
"devDependencies": {
|
|
79
78
|
"@playwright/test": "^1.62.1",
|
|
80
79
|
"@types/hast": "^3.0.5",
|
|
81
|
-
"@types/node": "^26.
|
|
80
|
+
"@types/node": "^26.2.0",
|
|
82
81
|
"@types/react": "^19.2.18",
|
|
83
82
|
"@types/react-dom": "^19.2.4",
|
|
84
83
|
"@typescript/native-preview": "^7.0.0-dev.20260707.2",
|
|
84
|
+
"katex": "^0.16.22",
|
|
85
85
|
"vite": "npm:@voidzero-dev/vite-plus-core@0.2.8",
|
|
86
|
-
"vite-plus": "0.2.
|
|
86
|
+
"vite-plus": "0.2.9",
|
|
87
87
|
"yaml": "^2.9.0"
|
|
88
88
|
},
|
|
89
89
|
"peerDependencies": {
|
|
90
90
|
"@vue/compiler-sfc": "^3.4.0",
|
|
91
|
+
"katex": "^0.16.0",
|
|
91
92
|
"react": "^19.0.0",
|
|
92
93
|
"react-dom": "^19.0.0",
|
|
93
94
|
"svelte": "^5.0.0",
|
|
@@ -95,6 +96,9 @@
|
|
|
95
96
|
"vue": "^3.4.0"
|
|
96
97
|
},
|
|
97
98
|
"peerDependenciesMeta": {
|
|
99
|
+
"katex": {
|
|
100
|
+
"optional": true
|
|
101
|
+
},
|
|
98
102
|
"vue": {
|
|
99
103
|
"optional": true
|
|
100
104
|
},
|