@tenphi/docs 0.13.0 → 0.16.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/README.md +22 -0
- package/dist/config/index.d.ts +5 -3
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +2 -240
- package/dist/config/schema.json +715 -63
- package/dist/config-CmoSqvii.js +774 -0
- package/dist/config-CmoSqvii.js.map +1 -0
- package/dist/content/index.d.ts +1 -1
- package/dist/content/index.js +1 -1
- package/dist/content-Btz1o52C.js +1340 -0
- package/dist/content-Btz1o52C.js.map +1 -0
- package/dist/index.d.ts +27 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +41 -199
- package/dist/index.js.map +1 -1
- package/dist/markdown/index.d.ts +7 -3
- package/dist/markdown/index.d.ts.map +1 -1
- package/dist/markdown/index.js +10 -7
- package/dist/markdown/index.js.map +1 -1
- package/dist/testing/index.js +1 -1
- package/dist/{types-m7SvwRsi.d.ts → types-CH6E2v-J.d.ts} +95 -27
- package/dist/types-CH6E2v-J.d.ts.map +1 -0
- package/package.json +11 -3
- package/dist/config/index.js.map +0 -1
- package/dist/content-oJ_TI-Qv.js +0 -786
- package/dist/content-oJ_TI-Qv.js.map +0 -1
- package/dist/types-m7SvwRsi.d.ts.map +0 -1
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../src/types.ts"],"sourcesContent":["import type { GlazeColorValue } from \"@tenphi/glaze\";\nimport type { Root } from \"mdast\";\n\nexport type DiagnosticSeverity = \"warning\" | \"error\";\n\nexport interface DocsDiagnostic {\n code: string;\n severity: DiagnosticSeverity;\n message: string;\n file?: string;\n line?: number;\n column?: number;\n hint?: string;\n related?: Array<{ file: string; line?: number; message: string }>;\n}\n\nexport interface SiteConfig {\n title?: string;\n /** Version of the documented package, rendered beside the site title. */\n version?: string;\n description?: string;\n url?: string;\n repository?: string;\n /** Source artwork used to generate browser, touch, and installable-app icons. */\n favicon?: string | SiteIconConfig;\n}\n\nexport interface SiteIconConfig {\n /** Local SVG, PNG, JPEG, WebP, AVIF, or GIF path, relative to the project root. */\n source: string;\n /** Opaque background for touch and maskable icons. */\n background?: string;\n}\n\n/** A language exposed by Starlight's locale picker and routing. */\nexport interface LocaleConfig {\n label: string;\n /** BCP-47 language tag. Defaults to the locale key. */\n lang?: string;\n dir?: \"ltr\" | \"rtl\";\n}\n\nexport interface EditLinkConfig {\n /** Base URL joined with each page's repository-relative source path. */\n baseUrl: string;\n}\n\n/** A custom HTML element rendered in the document head. */\nexport interface HeadConfig {\n tag: string;\n attrs?: Record<string, string | boolean | undefined>;\n content?: string;\n}\n\nexport interface NavigationPlacement {\n label?: string;\n order?: number;\n group?: string;\n}\n\nexport type DocsSource =\n | {\n file: string;\n route?: string;\n title?: string;\n description?: string;\n navigation?: false | NavigationPlacement;\n }\n | {\n glob: string | string[];\n base?: string;\n routeBase?: string;\n exclude?: string[];\n navigation?: \"auto\" | false;\n }\n | {\n package: string;\n include?: string[];\n exclude?: string[];\n index?: string;\n routeBase?: string;\n trust?: \"markdown\" | \"mdx\";\n };\n\nexport interface ContentConfig {\n sources?: DocsSource[];\n allowOutsideRoot?: boolean;\n localizeRepositoryLinks?: boolean;\n}\n\nexport type NavigationItem =\n | string\n | { label: string; items: NavigationItem[] }\n | { label: string; autogenerate: { directory: string } }\n | { label: string; link: string };\n\nexport interface NavigationTab {\n label: string;\n link: string;\n /** Sidebar tree shown while this tab is active. */\n items?: NavigationItem[];\n}\n\nexport interface NavigationConfig {\n items?: NavigationItem[];\n /** Optional primary navigation rendered as a compact row below the header. */\n tabs?: NavigationTab[];\n}\n\nexport type BrandConfig =\n | GlazeColorValue\n | {\n from: GlazeColorValue;\n contrast?: { apca: number | [number, number] };\n unsafeContrast?: boolean;\n };\n\nexport type ThemeTokenValue = string | number;\n\n/**\n * Tasty design tokens. `$name` is emitted as `--name`; existing `--name`\n * custom-property keys remain supported for compatibility.\n */\nexport interface ThemeTokens {\n $gap?: ThemeTokenValue;\n $radius?: ThemeTokenValue;\n \"$card-radius\"?: ThemeTokenValue;\n \"$border-width\"?: ThemeTokenValue;\n \"$outline-width\"?: ThemeTokenValue;\n \"$outline-offset\"?: ThemeTokenValue;\n \"$layout-width\"?: ThemeTokenValue;\n \"$content-width\"?: ThemeTokenValue;\n \"$sidebar-width\"?: ThemeTokenValue;\n \"$control-height\"?: ThemeTokenValue;\n [name: `$${string}`]: ThemeTokenValue | undefined;\n [customProperty: `--${string}`]: ThemeTokenValue | undefined;\n}\n\nexport interface TypographyPreset {\n fontFamily?: string;\n fontSize?: ThemeTokenValue;\n lineHeight?: ThemeTokenValue;\n letterSpacing?: ThemeTokenValue;\n fontWeight?: ThemeTokenValue;\n boldFontWeight?: ThemeTokenValue;\n iconSize?: ThemeTokenValue;\n textTransform?: ThemeTokenValue;\n fontStyle?: ThemeTokenValue;\n}\n\n/** Built-in presets can be overridden and additional Tasty presets may be added. */\nexport interface TypographyPresets {\n body?: TypographyPreset;\n heading?: TypographyPreset;\n h1?: TypographyPreset;\n h2?: TypographyPreset;\n h3?: TypographyPreset;\n h4?: TypographyPreset;\n h5?: TypographyPreset;\n h6?: TypographyPreset;\n navigation?: TypographyPreset;\n small?: TypographyPreset;\n code?: TypographyPreset;\n [name: string]: TypographyPreset | undefined;\n}\n\n/** Semantic palette inputs. Glaze resolves every value for all appearance modes. */\nexport interface ThemePaletteConfig {\n /** Light-scheme page surface; dark and high-contrast values adapt. */\n surface?: GlazeColorValue;\n /** Primary reading text seed, resolved against `surface`. */\n text?: GlazeColorValue;\n /** Secondary text seed, resolved against `surface`. */\n textSoft?: GlazeColorValue;\n}\n\n/** Cookbook UI surfaces whose default Tasty styles can be customized. */\nexport const COOKBOOK_COMPONENT_NAMES = [\n \"Card\",\n \"ContrastSelect\",\n \"Footer\",\n \"Hero\",\n \"LanguageSelect\",\n \"Logo\",\n \"MarkdownCodeBlock\",\n \"MarkdownHeading\",\n \"MarkdownTable\",\n \"Mermaid\",\n \"MobileMenuFooter\",\n \"MobileNavigationTabs\",\n \"MobileTableOfContents\",\n \"PackageVersion\",\n \"Preview\",\n \"Sidebar\",\n \"Steps\",\n \"Tabs\",\n \"TableOfContents\",\n \"ThemeSelect\",\n \"TopNavigation\",\n \"StarlightHeader\",\n] as const;\n\nexport type CookbookComponentName = (typeof COOKBOOK_COMPONENT_NAMES)[number];\n\n/** Named Tasty sub-elements available on each configurable Cookbook surface. */\nexport const COOKBOOK_COMPONENT_SUB_ELEMENTS = {\n Card: [\"Heading2\", \"Heading3\", \"Paragraph\"],\n ContrastSelect: [\n \"Label\",\n \"Icon\",\n \"IconSvg\",\n \"Select\",\n \"PickerIcon\",\n \"Picker\",\n \"OpenPicker\",\n \"Option\",\n \"HoverOption\",\n \"CheckedOption\",\n \"Checkmark\",\n ],\n Footer: [\n \"Meta\",\n \"LoneMetaItem\",\n \"MetaLink\",\n \"HoverMetaLink\",\n \"Credit\",\n \"CreditLink\",\n \"HoverCreditLink\",\n ],\n Hero: [\n \"Visual\",\n \"Stack\",\n \"Copy\",\n \"Title\",\n \"Tagline\",\n \"Actions\",\n \"Action\",\n \"HoverAction\",\n \"PrimaryAction\",\n \"SecondaryAction\",\n \"MinimalAction\",\n \"ActionIcon\",\n ],\n LanguageSelect: [\n \"Label\",\n \"HoverLabel\",\n \"LabelIcon\",\n \"Select\",\n \"Caret\",\n \"Option\",\n ],\n Logo: [\"Svg\", \"Mark\"],\n MarkdownCodeBlock: [\n \"Pre\",\n \"CopyButton\",\n \"HoverCopyButton\",\n \"CopiedButton\",\n \"CopyIcon\",\n \"CopiedIcon\",\n ],\n MarkdownHeading: [\n \"Heading\",\n \"Heading1\",\n \"Heading2\",\n \"Heading3\",\n \"Heading4\",\n \"Heading5\",\n \"Heading6\",\n \"Link\",\n \"HoverLink\",\n ],\n MarkdownTable: [\"Table\", \"Cell\", \"LastBodyRowCell\", \"HeaderCell\"],\n Mermaid: [\"Diagram\", \"Text\", \"MonoText\"],\n MobileMenuFooter: [\"Social\"],\n MobileNavigationTabs: [\n \"Label\",\n \"List\",\n \"Item\",\n \"Link\",\n \"HoverLink\",\n \"CurrentLink\",\n ],\n MobileTableOfContents: [\n \"Item\",\n \"Link\",\n \"LinkLabel\",\n \"HoverLink\",\n \"CurrentLink\",\n \"CurrentIndicator\",\n ],\n PackageVersion: [],\n Preview: [\"Caption\", \"Stage\", \"Frame\", \"Code\", \"Summary\", \"Pre\"],\n Sidebar: [\n \"CurrentLink\",\n \"Content\",\n \"List\",\n \"Item\",\n \"TopLevelSpacing\",\n \"NestedItem\",\n \"Control\",\n \"Summary\",\n \"GroupLabel\",\n \"GroupLabelText\",\n \"Link\",\n \"LinkLabel\",\n \"InteractiveControl\",\n \"SummaryMarker\",\n \"TopLevelLink\",\n ],\n Steps: [\"Item\", \"Marker\"],\n Tabs: [],\n TableOfContents: [\n \"Heading\",\n \"List\",\n \"Item\",\n \"Link\",\n \"LinkLabel\",\n \"HoverLink\",\n \"CurrentLink\",\n ],\n ThemeSelect: [\n \"Label\",\n \"Icon\",\n \"IconSvg\",\n \"Select\",\n \"PickerIcon\",\n \"Picker\",\n \"OpenPicker\",\n \"Option\",\n \"HoverOption\",\n \"CheckedOption\",\n \"Checkmark\",\n ],\n TopNavigation: [\n \"Scrollbar\",\n \"Link\",\n \"HoverLink\",\n \"CurrentLink\",\n \"ActiveIndicator\",\n ],\n StarlightHeader: [\n \"Primary\",\n \"TitleAndSearch\",\n \"Title\",\n \"Logo\",\n \"SiteTitle\",\n \"Search\",\n \"SearchElement\",\n \"Tools\",\n \"ToolItem\",\n \"Social\",\n \"MobileTheme\",\n ],\n} as const satisfies Record<CookbookComponentName, readonly string[]>;\n\nexport type CookbookComponentSubElementName<\n Name extends CookbookComponentName,\n> = (typeof COOKBOOK_COMPONENT_SUB_ELEMENTS)[Name][number];\n\n/** A serializable partial Tasty style object, merged into the base internally. */\nexport type ComponentStyles = Record<string, unknown> & { mode?: never };\n\n/** Style properties supplied by the user to override Cookbook defaults. */\nexport type ComponentStyleConfig = ComponentStyles;\n\n/** A component override with typed suggestions for its named sub-elements. */\nexport type CookbookComponentStyles<Name extends CookbookComponentName> =\n ComponentStyles &\n Partial<Record<CookbookComponentSubElementName<Name>, ComponentStyles>>;\n\nexport type ComponentStylesConfig = {\n [Name in CookbookComponentName]?: CookbookComponentStyles<Name>;\n} & Record<string, ComponentStyleConfig | undefined>;\n\nexport interface ThemeConfig {\n variant?: string;\n brand?: BrandConfig;\n palette?: ThemePaletteConfig;\n states?: Record<string, string>;\n tokens?: ThemeTokens;\n presets?: TypographyPresets;\n /** Tasty UI styles, keyed by Cookbook component or bridge name. */\n styles?: ComponentStylesConfig;\n contrastLevel?: number | \"auto\";\n}\n\nexport interface MarkdownConfig {\n stripLeadingBadges?: boolean;\n rawHtml?: \"sanitize\" | \"allow\" | \"reject\";\n strictLanguages?: boolean;\n executablePreviews?: boolean;\n remarkPlugins?: unknown[];\n rehypePlugins?: unknown[];\n}\n\nexport interface SearchConfig {\n enabled?: boolean;\n}\n\nexport interface ComponentsConfig {\n /** Astro component paths keyed by Starlight component name. `Footer` also accepts `false`. */\n overrides?: Record<string, string | false>;\n}\n\nexport interface BuildConfig {\n strict?: boolean;\n ci?: boolean;\n base?: string;\n cacheDir?: string;\n maxArtifactBytes?: number;\n maxUnpackedBytes?: number;\n maxFiles?: number;\n maxPathDepth?: number;\n maxAssetBytes?: number;\n}\n\nexport interface DocsConfig {\n site?: SiteConfig;\n head?: HeadConfig[];\n /** Enable source-aware “Edit page” links. */\n editLink?: EditLinkConfig;\n /** Show the most recent Git commit date for each local page. */\n lastUpdated?: boolean;\n /** Languages keyed by their URL segment, or `root` for `/`. */\n locales?: Record<string, LocaleConfig>;\n /** Locale key used for fallback content. */\n defaultLocale?: string;\n content?: ContentConfig;\n navigation?: NavigationConfig | NavigationItem[];\n theme?: ThemeConfig;\n markdown?: MarkdownConfig;\n search?: SearchConfig;\n components?: ComponentsConfig;\n build?: BuildConfig;\n}\n\nexport interface NormalizedDocsConfig {\n site: SiteConfig;\n head: HeadConfig[];\n editLink?: EditLinkConfig;\n lastUpdated: boolean;\n locales?: Record<string, LocaleConfig>;\n defaultLocale?: string;\n content: Required<\n Pick<ContentConfig, \"allowOutsideRoot\" | \"localizeRepositoryLinks\">\n > &\n ContentConfig;\n navigation: NavigationConfig;\n theme: ThemeConfig & { brand: BrandConfig };\n markdown: Required<\n Pick<\n MarkdownConfig,\n | \"stripLeadingBadges\"\n | \"rawHtml\"\n | \"strictLanguages\"\n | \"executablePreviews\"\n >\n > &\n MarkdownConfig;\n search: Required<SearchConfig>;\n components: ComponentsConfig;\n build: Required<BuildConfig>;\n}\n\nexport interface DocsFrontmatter {\n title?: string;\n description?: string;\n slug?: string;\n draft?: boolean;\n sidebar?: false | { label?: string; order?: number; group?: string };\n toc?: false | { minHeadingLevel?: number; maxHeadingLevel?: number };\n editUrl?: false | string;\n /** Starlight page layout. */\n template?: \"doc\" | \"splash\";\n hero?: {\n title?: string;\n tagline?: string;\n image?:\n | { html: string }\n | { file: string; alt?: string }\n | { dark: string; light: string; alt?: string };\n actions?: Array<{\n text: string;\n link: string;\n variant?: \"primary\" | \"secondary\" | \"minimal\";\n }>;\n };\n lastUpdated?: boolean | Date;\n prev?: false | string;\n next?: false | string;\n search?: boolean;\n head?: Array<Record<string, unknown>>;\n}\n\nexport interface DocsHeading {\n depth: number;\n text: string;\n slug: string;\n line?: number;\n}\n\nexport interface DocsReference {\n original: string;\n resolved?: string;\n targetSource?: string;\n fragment?: string;\n line?: number;\n}\n\nexport interface DocsAsset extends DocsReference {\n sourcePath?: string;\n publicPath?: string;\n hash?: string;\n bytes?: number;\n}\n\nexport interface DocsEntry {\n id: string;\n sourcePath: string;\n absolutePath: string;\n sourceRoot: string;\n route: string;\n title: string;\n description?: string;\n frontmatter: DocsFrontmatter;\n headings: DocsHeading[];\n body: string;\n transformedBody: string;\n ast: Root;\n links: DocsReference[];\n assets: DocsAsset[];\n trust: \"markdown\" | \"mdx\";\n package?: { requested: string; resolved: string };\n}\n\nexport interface DocsRoute {\n route: string;\n entryId: string;\n sourcePath: string;\n title: string;\n}\n\nexport interface DocsGraph {\n root: string;\n config: NormalizedDocsConfig;\n entries: DocsEntry[];\n routes: DocsRoute[];\n assets: DocsAsset[];\n diagnostics: DocsDiagnostic[];\n entryByRoute(route: string): DocsEntry | undefined;\n entryBySource(sourcePath: string): DocsEntry | undefined;\n}\n\nexport interface PackageLockSource {\n requested: string;\n resolved: string;\n registry: string;\n integrity: string;\n vendored?: string;\n}\n\nexport interface CookbookLock {\n schemaVersion: 1;\n sources: PackageLockSource[];\n}\n\nexport interface PackageManifest {\n name: string;\n version: string;\n description?: string;\n homepage?: string;\n repository?: string | { type?: string; url?: string; directory?: string };\n cookbook?: {\n index?: string;\n include?: string[];\n exclude?: string[];\n theme?: { brand?: BrandConfig };\n };\n _integrity?: string;\n _resolved?: string;\n}\n\nexport interface PackageDiscovery {\n root: string;\n manifest: PackageManifest;\n home?: string;\n pages: string[];\n assets: string[];\n}\n\nexport interface CreateDocsGraphOptions {\n root?: string;\n config?: DocsConfig;\n lock?: CookbookLock;\n}\n"],"mappings":";;;;AAiLA,MAAa,2BAA2B;CACtC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;;AAKA,MAAa,kCAAkC;CAC7C,MAAM;EAAC;EAAY;EAAY;CAAW;CAC1C,gBAAgB;EACd;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,QAAQ;EACN;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,MAAM;EACJ;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,gBAAgB;EACd;EACA;EACA;EACA;EACA;EACA;CACF;CACA,MAAM,CAAC,OAAO,MAAM;CACpB,mBAAmB;EACjB;EACA;EACA;EACA;EACA;EACA;CACF;CACA,iBAAiB;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,eAAe;EAAC;EAAS;EAAQ;EAAmB;CAAY;CAChE,SAAS;EAAC;EAAW;EAAQ;CAAU;CACvC,kBAAkB,CAAC,QAAQ;CAC3B,sBAAsB;EACpB;EACA;EACA;EACA;EACA;EACA;CACF;CACA,uBAAuB;EACrB;EACA;EACA;EACA;EACA;EACA;CACF;CACA,gBAAgB,CAAC;CACjB,SAAS;EAAC;EAAW;EAAS;EAAS;EAAQ;EAAW;CAAK;CAC/D,SAAS;EACP;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,OAAO,CAAC,QAAQ,QAAQ;CACxB,MAAM,CAAC;CACP,iBAAiB;EACf;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,aAAa;EACX;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,eAAe;EACb;EACA;EACA;EACA;EACA;CACF;CACA,iBAAiB;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;AACF"}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/project/index.ts"],"sourcesContent":["import { existsSync } from \"node:fs\";\nimport { readFile } from \"node:fs/promises\";\nimport { dirname, resolve } from \"node:path\";\nimport { createJiti } from \"jiti\";\nimport { normalizeDocsConfig } from \"../config/index.js\";\nimport type { DocsConfig } from \"../types.js\";\n\nexport interface DocsProjectOptions {\n /** Directory to search for configuration; defaults to the current directory. */\n root?: string;\n /** Explicit configuration path, relative to root. False disables discovery. */\n configFile?: string | false;\n /** Inline configuration takes precedence over discovery. */\n config?: DocsConfig;\n}\n\nexport interface DocsProject {\n root: string;\n config: DocsConfig;\n configFile?: string;\n}\n\n/** Resolve the same configuration and content root for the CLI and renderer. */\nexport async function resolveDocsProject(\n options: DocsProjectOptions = {},\n): Promise<DocsProject> {\n const directory = resolve(options.root ?? process.cwd());\n let config = options.config;\n let configFile: string | undefined;\n if (config === undefined && options.configFile !== false) {\n configFile = options.configFile\n ? resolve(directory, options.configFile)\n : [\n \"docs.config.ts\",\n \"docs.config.mts\",\n \"docs.config.js\",\n \"docs.config.mjs\",\n ]\n .map((name) => resolve(directory, name))\n .find(existsSync);\n if (configFile) {\n if (!existsSync(configFile)) {\n throw new Error(\n `Documentation configuration does not exist: ${configFile}.`,\n );\n }\n const jiti = createJiti(import.meta.url, {\n interopDefault: true,\n moduleCache: false,\n });\n // Native ESM imports remain cached even with moduleCache disabled.\n // Transpile the entry so configuration restarts see edits in every format.\n const loaded = (await jiti.evalModule(\n await readFile(configFile, \"utf8\"),\n {\n filename: configFile,\n async: true,\n forceTranspile: true,\n },\n )) as { default?: DocsConfig };\n config = loaded.default ?? (loaded as DocsConfig);\n }\n }\n config ??= {};\n normalizeDocsConfig(config);\n return {\n root: resolve(\n configFile ? dirname(configFile) : directory,\n config.root ?? \".\",\n ),\n config,\n ...(configFile ? { configFile } : {}),\n };\n}\n"],"mappings":";;;;;;;;AAuBA,eAAsB,mBACpB,UAA8B,CAAC,GACT;CACtB,MAAM,YAAY,QAAQ,QAAQ,QAAQ,QAAQ,IAAI,CAAC;CACvD,IAAI,SAAS,QAAQ;CACrB,IAAI;CACJ,IAAI,WAAW,KAAA,KAAa,QAAQ,eAAe,OAAO;EACxD,aAAa,QAAQ,aACjB,QAAQ,WAAW,QAAQ,UAAU,IACrC;GACE;GACA;GACA;GACA;EACF,CAAC,CACE,KAAK,SAAS,QAAQ,WAAW,IAAI,CAAC,CAAC,CACvC,KAAK,UAAU;EACtB,IAAI,YAAY;GACd,IAAI,CAAC,WAAW,UAAU,GACxB,MAAM,IAAI,MACR,+CAA+C,WAAW,EAC5D;GAQF,MAAM,SAAU,MANH,WAAW,YAAY,KAAK;IACvC,gBAAgB;IAChB,aAAa;GACf,CAGyB,CAAC,CAAC,WACzB,MAAM,SAAS,YAAY,MAAM,GACjC;IACE,UAAU;IACV,OAAO;IACP,gBAAgB;GAClB,CACF;GACA,SAAS,OAAO,WAAY;EAC9B;CACF;CACA,WAAW,CAAC;CACZ,oBAAoB,MAAM;CAC1B,OAAO;EACL,MAAM,QACJ,aAAa,QAAQ,UAAU,IAAI,WACnC,OAAO,QAAQ,GACjB;EACA;EACA,GAAI,aAAa,EAAE,WAAW,IAAI,CAAC;CACrC;AACF"}
|
package/dist/markdown/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { J as
|
|
1
|
+
import { $ as Root, J as Content, Q as PhrasingContent, S as DocsHeading, X as Link, Y as Heading, Z as Paragraph } from "../types-CH6E2v-J.js";
|
|
2
2
|
//#region src/markdown/index.d.ts
|
|
3
3
|
interface ParsedMarkdown {
|
|
4
4
|
ast: Root;
|
|
@@ -6,9 +6,13 @@ interface ParsedMarkdown {
|
|
|
6
6
|
firstHeading?: string;
|
|
7
7
|
description?: string;
|
|
8
8
|
}
|
|
9
|
-
declare function parseMarkdown(body: string
|
|
9
|
+
declare function parseMarkdown(body: string, options?: {
|
|
10
|
+
mdx?: boolean;
|
|
11
|
+
}): ParsedMarkdown;
|
|
10
12
|
declare function textContent(node: Heading | Paragraph | PhrasingContent): string;
|
|
11
|
-
declare function serializeMarkdown(ast: Root
|
|
13
|
+
declare function serializeMarkdown(ast: Root, options?: {
|
|
14
|
+
mdx?: boolean;
|
|
15
|
+
}): string;
|
|
12
16
|
declare function removeRenderedTitle(ast: Root, title: string): void;
|
|
13
17
|
declare function stripLeadingBadgeBlock(ast: Root): void;
|
|
14
18
|
declare function linksIn(ast: Root): Link[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/markdown/index.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/markdown/index.ts"],"mappings":";;UAkBiB;EACf,KAAK;EACL,UAAU;EACV;EACA;;iBAGc,cACd,cACA;EAAW;IACV;iBAiDa,YACd,MAAM,UAAU,YAAY;iBASd,kBACd,KAAK,MACL;EAAW;;iBAOG,oBAAoB,KAAK,MAAM;iBAY/B,uBAAuB,KAAK;iBAgB5B,QAAQ,KAAK,OAAO;iBAMpB,SAAS,KAAK,OAAO;iBAIrB,WAAW,KAAK,OAAO"}
|
package/dist/markdown/index.js
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import { visit } from "unist-util-visit";
|
|
2
2
|
import GithubSlugger from "github-slugger";
|
|
3
3
|
import { gfmFromMarkdown, gfmToMarkdown } from "mdast-util-gfm";
|
|
4
|
+
import { mdxFromMarkdown, mdxToMarkdown } from "mdast-util-mdx";
|
|
4
5
|
import { fromMarkdown } from "mdast-util-from-markdown";
|
|
5
6
|
import { gfm } from "micromark-extension-gfm";
|
|
7
|
+
import { mdxjs } from "micromark-extension-mdxjs";
|
|
6
8
|
import { toMarkdown } from "mdast-util-to-markdown";
|
|
7
9
|
//#region src/markdown/index.ts
|
|
8
|
-
function parseMarkdown(body) {
|
|
10
|
+
function parseMarkdown(body, options = {}) {
|
|
9
11
|
const ast = fromMarkdown(body, {
|
|
10
|
-
extensions: [gfm()],
|
|
11
|
-
mdastExtensions: [gfmFromMarkdown()]
|
|
12
|
+
extensions: [gfm(), ...options.mdx ? [mdxjs()] : []],
|
|
13
|
+
mdastExtensions: [gfmFromMarkdown(), ...options.mdx ? [mdxFromMarkdown()] : []]
|
|
12
14
|
});
|
|
13
15
|
const slugger = new GithubSlugger();
|
|
14
16
|
const headings = [];
|
|
@@ -53,12 +55,13 @@ function textContent(node) {
|
|
|
53
55
|
if (node.type === "image") return node.alt ?? "";
|
|
54
56
|
return "";
|
|
55
57
|
}
|
|
56
|
-
function serializeMarkdown(ast) {
|
|
57
|
-
return toMarkdown(ast, { extensions: [gfmToMarkdown()] });
|
|
58
|
+
function serializeMarkdown(ast, options = {}) {
|
|
59
|
+
return toMarkdown(ast, { extensions: [gfmToMarkdown(), ...options.mdx ? [mdxToMarkdown()] : []] });
|
|
58
60
|
}
|
|
59
61
|
function removeRenderedTitle(ast, title) {
|
|
60
|
-
const
|
|
61
|
-
|
|
62
|
+
const index = ast.children.findIndex((node) => node.type !== "mdxjsEsm");
|
|
63
|
+
const first = ast.children[index];
|
|
64
|
+
if (first?.type === "heading" && first.depth === 1 && textContent(first) === title) ast.children.splice(index, 1);
|
|
62
65
|
}
|
|
63
66
|
function stripLeadingBadgeBlock(ast) {
|
|
64
67
|
while (ast.children[0]?.type === "paragraph") {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../src/markdown/index.ts"],"sourcesContent":["import GithubSlugger from \"github-slugger\";\nimport { gfmFromMarkdown, gfmToMarkdown } from \"mdast-util-gfm\";\nimport { fromMarkdown } from \"mdast-util-from-markdown\";\nimport { gfm } from \"micromark-extension-gfm\";\nimport { toMarkdown } from \"mdast-util-to-markdown\";\nimport type {\n Content,\n Heading,\n Link,\n Paragraph,\n PhrasingContent,\n Root,\n} from \"mdast\";\nimport { visit } from \"unist-util-visit\";\nimport type { DocsHeading } from \"../types.js\";\n\nexport interface ParsedMarkdown {\n ast: Root;\n headings: DocsHeading[];\n firstHeading?: string;\n description?: string;\n}\n\nexport function parseMarkdown(body: string): ParsedMarkdown {\n const ast = fromMarkdown(body, {\n extensions: [gfm()],\n mdastExtensions: [gfmFromMarkdown()],\n });\n const slugger = new GithubSlugger();\n const headings: DocsHeading[] = [];\n let firstHeading: string | undefined;\n let description: string | undefined;\n\n visit(ast, (node) => {\n if (node.type === \"heading\") {\n const text = textContent(node);\n const slug = slugger.slug(text);\n firstHeading ??= node.depth === 1 ? text : undefined;\n headings.push({\n depth: node.depth,\n text,\n slug,\n ...(node.position?.start.line\n ? { line: node.position.start.line }\n : {}),\n });\n } else if (description === undefined && node.type === \"paragraph\") {\n const text = textContent(node).replace(/\\s+/g, \" \").trim();\n if (isSuitableDescription(node, text)) description = text.slice(0, 240);\n }\n });\n\n return {\n ast,\n headings,\n ...(firstHeading ? { firstHeading } : {}),\n ...(description ? { description } : {}),\n };\n}\n\nfunction isSuitableDescription(node: Paragraph, text: string): boolean {\n if (text.length < 20) return false;\n return !node.children.every((child) =>\n [\"image\", \"imageReference\", \"link\", \"linkReference\", \"html\"].includes(\n child.type,\n ),\n );\n}\n\nexport function textContent(\n node: Heading | Paragraph | PhrasingContent,\n): string {\n if (\"value\" in node && typeof node.value === \"string\") return node.value;\n if (\"children\" in node)\n return node.children.map((child) => textContent(child)).join(\"\");\n if (node.type === \"image\") return node.alt ?? \"\";\n return \"\";\n}\n\nexport function serializeMarkdown(ast: Root): string {\n return toMarkdown(ast, {
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../src/markdown/index.ts"],"sourcesContent":["import GithubSlugger from \"github-slugger\";\nimport { gfmFromMarkdown, gfmToMarkdown } from \"mdast-util-gfm\";\nimport { mdxFromMarkdown, mdxToMarkdown } from \"mdast-util-mdx\";\nimport { fromMarkdown } from \"mdast-util-from-markdown\";\nimport { gfm } from \"micromark-extension-gfm\";\nimport { mdxjs } from \"micromark-extension-mdxjs\";\nimport { toMarkdown } from \"mdast-util-to-markdown\";\nimport type {\n Content,\n Heading,\n Link,\n Paragraph,\n PhrasingContent,\n Root,\n} from \"mdast\";\nimport { visit } from \"unist-util-visit\";\nimport type { DocsHeading } from \"../types.js\";\n\nexport interface ParsedMarkdown {\n ast: Root;\n headings: DocsHeading[];\n firstHeading?: string;\n description?: string;\n}\n\nexport function parseMarkdown(\n body: string,\n options: { mdx?: boolean } = {},\n): ParsedMarkdown {\n const ast = fromMarkdown(body, {\n extensions: [gfm(), ...(options.mdx ? [mdxjs()] : [])],\n mdastExtensions: [\n gfmFromMarkdown(),\n ...(options.mdx ? [mdxFromMarkdown()] : []),\n ],\n });\n const slugger = new GithubSlugger();\n const headings: DocsHeading[] = [];\n let firstHeading: string | undefined;\n let description: string | undefined;\n\n visit(ast, (node) => {\n if (node.type === \"heading\") {\n const text = textContent(node);\n const slug = slugger.slug(text);\n firstHeading ??= node.depth === 1 ? text : undefined;\n headings.push({\n depth: node.depth,\n text,\n slug,\n ...(node.position?.start.line\n ? { line: node.position.start.line }\n : {}),\n });\n } else if (description === undefined && node.type === \"paragraph\") {\n const text = textContent(node).replace(/\\s+/g, \" \").trim();\n if (isSuitableDescription(node, text)) description = text.slice(0, 240);\n }\n });\n\n return {\n ast,\n headings,\n ...(firstHeading ? { firstHeading } : {}),\n ...(description ? { description } : {}),\n };\n}\n\nfunction isSuitableDescription(node: Paragraph, text: string): boolean {\n if (text.length < 20) return false;\n return !node.children.every((child) =>\n [\"image\", \"imageReference\", \"link\", \"linkReference\", \"html\"].includes(\n child.type,\n ),\n );\n}\n\nexport function textContent(\n node: Heading | Paragraph | PhrasingContent,\n): string {\n if (\"value\" in node && typeof node.value === \"string\") return node.value;\n if (\"children\" in node)\n return node.children.map((child) => textContent(child)).join(\"\");\n if (node.type === \"image\") return node.alt ?? \"\";\n return \"\";\n}\n\nexport function serializeMarkdown(\n ast: Root,\n options: { mdx?: boolean } = {},\n): string {\n return toMarkdown(ast, {\n extensions: [gfmToMarkdown(), ...(options.mdx ? [mdxToMarkdown()] : [])],\n });\n}\n\nexport function removeRenderedTitle(ast: Root, title: string): void {\n const index = ast.children.findIndex((node) => node.type !== \"mdxjsEsm\");\n const first = ast.children[index];\n if (\n first?.type === \"heading\" &&\n first.depth === 1 &&\n textContent(first) === title\n ) {\n ast.children.splice(index, 1);\n }\n}\n\nexport function stripLeadingBadgeBlock(ast: Root): void {\n while (ast.children[0]?.type === \"paragraph\") {\n const paragraph = ast.children[0];\n const onlyBadgeLike = paragraph.children.every((node) => {\n if (node.type === \"text\") return node.value.trim() === \"\";\n if (node.type === \"image\" || node.type === \"imageReference\") return true;\n if (node.type === \"link\") {\n return node.children.every((child) => child.type === \"image\");\n }\n return false;\n });\n if (!onlyBadgeLike) break;\n ast.children.shift();\n }\n}\n\nexport function linksIn(ast: Root): Link[] {\n const links: Link[] = [];\n visit(ast, \"link\", (node) => links.push(node));\n return links;\n}\n\nexport function cloneAst(ast: Root): Root {\n return structuredClone(ast);\n}\n\nexport function childrenOf(ast: Root): Content[] {\n return ast.children;\n}\n"],"mappings":";;;;;;;;;AAyBA,SAAgB,cACd,MACA,UAA6B,CAAC,GACd;CAChB,MAAM,MAAM,aAAa,MAAM;EAC7B,YAAY,CAAC,IAAI,GAAG,GAAI,QAAQ,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAE;EACrD,iBAAiB,CACf,gBAAgB,GAChB,GAAI,QAAQ,MAAM,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAC3C;CACF,CAAC;CACD,MAAM,UAAU,IAAI,cAAc;CAClC,MAAM,WAA0B,CAAC;CACjC,IAAI;CACJ,IAAI;CAEJ,MAAM,MAAM,SAAS;EACnB,IAAI,KAAK,SAAS,WAAW;GAC3B,MAAM,OAAO,YAAY,IAAI;GAC7B,MAAM,OAAO,QAAQ,KAAK,IAAI;GAC9B,iBAAiB,KAAK,UAAU,IAAI,OAAO,KAAA;GAC3C,SAAS,KAAK;IACZ,OAAO,KAAK;IACZ;IACA;IACA,GAAI,KAAK,UAAU,MAAM,OACrB,EAAE,MAAM,KAAK,SAAS,MAAM,KAAK,IACjC,CAAC;GACP,CAAC;EACH,OAAO,IAAI,gBAAgB,KAAA,KAAa,KAAK,SAAS,aAAa;GACjE,MAAM,OAAO,YAAY,IAAI,CAAC,CAAC,QAAQ,QAAQ,GAAG,CAAC,CAAC,KAAK;GACzD,IAAI,sBAAsB,MAAM,IAAI,GAAG,cAAc,KAAK,MAAM,GAAG,GAAG;EACxE;CACF,CAAC;CAED,OAAO;EACL;EACA;EACA,GAAI,eAAe,EAAE,aAAa,IAAI,CAAC;EACvC,GAAI,cAAc,EAAE,YAAY,IAAI,CAAC;CACvC;AACF;AAEA,SAAS,sBAAsB,MAAiB,MAAuB;CACrE,IAAI,KAAK,SAAS,IAAI,OAAO;CAC7B,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KAAK,SAAS,SAAS,MAAM,KAAK,IAAI,CAAC;CAC7C,OAAO;AACT;AAEA,SAAgB,SAAS,KAAiB;CACxC,OAAO,gBAAgB,GAAG;AAC5B;AAEA,SAAgB,WAAW,KAAsB;CAC/C,OAAO,IAAI;AACb"}
|
package/dist/testing/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { GlazeColorValue } from "@tenphi/glaze";
|
|
2
|
+
import { Styles, StylesWithoutSelectors } from "@tenphi/tasty/core";
|
|
2
3
|
//#region ../../node_modules/.pnpm/@types+unist@3.0.3/node_modules/@types/unist/index.d.ts
|
|
3
4
|
// ## Interfaces
|
|
4
5
|
/**
|
|
@@ -1061,9 +1062,19 @@ interface SiteConfig {
|
|
|
1061
1062
|
description?: string;
|
|
1062
1063
|
url?: string;
|
|
1063
1064
|
repository?: string;
|
|
1065
|
+
/** Header buttons, collapsed into a More menu on mobile. */
|
|
1066
|
+
headerLinks?: HeaderLink[];
|
|
1064
1067
|
/** Source artwork used to generate browser, touch, and installable-app icons. */
|
|
1065
1068
|
favicon?: string | SiteIconConfig;
|
|
1066
1069
|
}
|
|
1070
|
+
interface HeaderLink {
|
|
1071
|
+
label: string;
|
|
1072
|
+
/** HTTP(S) URL, root-relative route (prefixed with the site base), or fragment. */
|
|
1073
|
+
link: string;
|
|
1074
|
+
/** Desktop button variant; mobile More menus use uniform navigation links. */
|
|
1075
|
+
variant?: "default" | "primary";
|
|
1076
|
+
newTab?: boolean;
|
|
1077
|
+
}
|
|
1067
1078
|
interface SiteIconConfig {
|
|
1068
1079
|
/** Local SVG, PNG, JPEG, WebP, AVIF, or GIF path, relative to the project root. */
|
|
1069
1080
|
source: string;
|
|
@@ -1093,35 +1104,47 @@ interface NavigationPlacement {
|
|
|
1093
1104
|
group?: string;
|
|
1094
1105
|
}
|
|
1095
1106
|
type DocsSource = {
|
|
1107
|
+
/** Stable name for cross-source links and repeated mounts. */
|
|
1108
|
+
id?: string;
|
|
1109
|
+
routeBase?: string;
|
|
1110
|
+
} & ({
|
|
1096
1111
|
file: string;
|
|
1112
|
+
root?: string;
|
|
1097
1113
|
route?: string;
|
|
1098
1114
|
title?: string;
|
|
1099
1115
|
description?: string;
|
|
1100
1116
|
navigation?: false | NavigationPlacement;
|
|
1101
1117
|
} | {
|
|
1102
1118
|
glob: string | string[];
|
|
1119
|
+
root?: string;
|
|
1103
1120
|
base?: string;
|
|
1104
1121
|
routeBase?: string;
|
|
1105
1122
|
exclude?: string[];
|
|
1106
1123
|
navigation?: "auto" | false;
|
|
1107
1124
|
} | {
|
|
1108
1125
|
package: string;
|
|
1126
|
+
registry?: string;
|
|
1109
1127
|
include?: string[];
|
|
1110
1128
|
exclude?: string[];
|
|
1111
1129
|
index?: string;
|
|
1112
1130
|
routeBase?: string;
|
|
1113
1131
|
trust?: "markdown" | "mdx";
|
|
1114
|
-
};
|
|
1132
|
+
});
|
|
1115
1133
|
interface ContentConfig {
|
|
1116
1134
|
sources?: DocsSource[];
|
|
1117
1135
|
allowOutsideRoot?: boolean;
|
|
1136
|
+
/** Rewrite absolute links into the current repository to matching Cookbook routes. */
|
|
1118
1137
|
localizeRepositoryLinks?: boolean;
|
|
1138
|
+
/** Keep unrelated metadata without exposing it as renderer frontmatter. */
|
|
1139
|
+
frontmatter?: "preserve" | "reject";
|
|
1119
1140
|
}
|
|
1120
1141
|
type NavigationItem = string | {
|
|
1121
1142
|
label: string;
|
|
1143
|
+
link?: string;
|
|
1122
1144
|
items: NavigationItem[];
|
|
1123
1145
|
} | {
|
|
1124
1146
|
label: string;
|
|
1147
|
+
link?: string;
|
|
1125
1148
|
autogenerate: {
|
|
1126
1149
|
directory: string;
|
|
1127
1150
|
};
|
|
@@ -1194,53 +1217,76 @@ interface TypographyPresets {
|
|
|
1194
1217
|
}
|
|
1195
1218
|
/** Semantic palette inputs. Glaze resolves every value for all appearance modes. */
|
|
1196
1219
|
interface ThemePaletteConfig {
|
|
1220
|
+
info?: GlazeColorValue;
|
|
1221
|
+
success?: GlazeColorValue;
|
|
1222
|
+
warning?: GlazeColorValue;
|
|
1223
|
+
danger?: GlazeColorValue;
|
|
1197
1224
|
/** Light-scheme page surface; dark and high-contrast values adapt. */
|
|
1198
1225
|
surface?: GlazeColorValue;
|
|
1226
|
+
/** Translucent header surface seed; defaults to the page surface. */
|
|
1227
|
+
header?: GlazeColorValue;
|
|
1228
|
+
/** Fixed underlay seed; defaults to black at 50% opacity in every scheme. */
|
|
1229
|
+
overlay?: GlazeColorValue;
|
|
1199
1230
|
/** Primary reading text seed, resolved against `surface`. */
|
|
1200
1231
|
text?: GlazeColorValue;
|
|
1201
1232
|
/** Secondary text seed, resolved against `surface`. */
|
|
1202
1233
|
textSoft?: GlazeColorValue;
|
|
1203
1234
|
}
|
|
1204
1235
|
/** Cookbook UI surfaces whose default Tasty styles can be customized. */
|
|
1205
|
-
declare const COOKBOOK_COMPONENT_NAMES: readonly ["Card", "
|
|
1236
|
+
declare const COOKBOOK_COMPONENT_NAMES: readonly ["Card", "Callout", "CodeGroup", "Tab", "Footer", "Hero", "PageFrame", "HeaderFrame", "HeaderLinks", "Layout", "SearchButton", "TableOfContentsLayout", "LanguageSelect", "Logo", "MarkdownCodeBlock", "MarkdownHeading", "MarkdownInlineCode", "MarkdownTable", "Mermaid", "MobileMenuFooter", "MobileMenuToggle", "MobileNavigationTabs", "MobileTableOfContents", "PackageVersion", "Preview", "Sidebar", "SocialIcons", "Steps", "Tabs", "TableOfContents", "ThemeSelect", "TopNavigation", "StarlightHeader"];
|
|
1206
1237
|
type CookbookComponentName = (typeof COOKBOOK_COMPONENT_NAMES)[number];
|
|
1207
1238
|
/** Named Tasty sub-elements available on each configurable Cookbook surface. */
|
|
1208
1239
|
declare const COOKBOOK_COMPONENT_SUB_ELEMENTS: {
|
|
1240
|
+
readonly PageFrame: readonly ["MainFrame", "SidebarFrame", "Columns"];
|
|
1241
|
+
readonly HeaderFrame: readonly [];
|
|
1242
|
+
readonly HeaderLinks: readonly ["Desktop", "Link", "HoverLink", "PrimaryLink", "HoverPrimaryLink", "Trigger", "HoverTrigger", "Panel", "PanelNavigation", "PanelLink", "FirstPanelLink", "Close", "HoverClose"];
|
|
1243
|
+
readonly Layout: readonly ["LockedPage"];
|
|
1244
|
+
readonly SearchButton: readonly ["Label", "Shortcut", "Hover", "Active", "NativeIcon", "Icon"];
|
|
1245
|
+
readonly TableOfContentsLayout: readonly ["Content"];
|
|
1209
1246
|
readonly Card: readonly ["Heading2", "Heading3", "Paragraph"];
|
|
1210
|
-
readonly
|
|
1247
|
+
readonly Callout: readonly ["Title", "Body", "Tip", "Caution", "Danger"];
|
|
1248
|
+
readonly CodeGroup: readonly ["Caption", "Pre", "Code"];
|
|
1249
|
+
readonly Tab: readonly ["Heading", "Hidden", "HiddenHeading"];
|
|
1211
1250
|
readonly Footer: readonly ["Meta", "LoneMetaItem", "MetaLink", "HoverMetaLink", "Credit", "CreditLink", "HoverCreditLink"];
|
|
1212
1251
|
readonly Hero: readonly ["Visual", "Stack", "Copy", "Title", "Tagline", "Actions", "Action", "HoverAction", "PrimaryAction", "SecondaryAction", "MinimalAction", "ActionIcon"];
|
|
1213
1252
|
readonly LanguageSelect: readonly ["Label", "HoverLabel", "LabelIcon", "Select", "Caret", "Option"];
|
|
1214
1253
|
readonly Logo: readonly ["Svg", "Mark"];
|
|
1215
1254
|
readonly MarkdownCodeBlock: readonly ["Pre", "CopyButton", "HoverCopyButton", "CopiedButton", "CopyIcon", "CopiedIcon"];
|
|
1216
|
-
readonly MarkdownHeading: readonly ["Heading", "Heading1", "Heading2", "Heading3", "Heading4", "Heading5", "Heading6", "Link", "HoverLink"];
|
|
1255
|
+
readonly MarkdownHeading: readonly ["Heading", "Heading1", "Heading2", "Heading3", "Heading4", "Heading5", "Heading6", "Link", "RevealedLink", "HoverLink", "LinkIcon", "CopiedLink", "CopiedLinkIcon", "CopiedIcon"];
|
|
1217
1256
|
readonly MarkdownTable: readonly ["Table", "Cell", "LastBodyRowCell", "HeaderCell"];
|
|
1257
|
+
readonly MarkdownInlineCode: readonly [];
|
|
1218
1258
|
readonly Mermaid: readonly ["Diagram", "Text", "MonoText"];
|
|
1219
1259
|
readonly MobileMenuFooter: readonly ["Social"];
|
|
1220
|
-
readonly
|
|
1260
|
+
readonly MobileMenuToggle: readonly ["Control", "Icon", "Section", "Page", "HoverControl", "ActiveControl"];
|
|
1261
|
+
readonly MobileNavigationTabs: readonly ["Trigger", "Marker", "Caret", "ExpandedCaret", "Label", "List", "Item", "Link", "HoverLink", "CurrentLink"];
|
|
1221
1262
|
readonly MobileTableOfContents: readonly ["Item", "Link", "LinkLabel", "HoverLink", "CurrentLink", "CurrentIndicator"];
|
|
1222
1263
|
readonly PackageVersion: readonly [];
|
|
1223
1264
|
readonly Preview: readonly ["Caption", "Stage", "Frame", "Code", "Summary", "Pre"];
|
|
1224
|
-
readonly Sidebar: readonly ["CurrentLink", "Content", "List", "Item", "TopLevelSpacing", "NestedItem", "Control", "Summary", "GroupLabel", "GroupLabelText", "Link", "LinkLabel", "InteractiveControl", "SummaryMarker", "TopLevelLink"];
|
|
1265
|
+
readonly Sidebar: readonly ["Backdrop", "OpenBackdrop", "MobileHeading", "HomeLink", "HomeLogo", "HomeLabel", "Close", "HoverClose", "CloseIcon", "CurrentLink", "OpenPane", "Content", "Tree", "List", "Item", "TopLevelSpacing", "GroupSpacing", "NestedItem", "SectionHeading", "Control", "Summary", "GroupLabel", "GroupLabelText", "Link", "LinkLabel", "InteractiveControl", "SummaryMarker", "Caret", "ExpandedCaret", "LinkedSummary", "GroupLink", "LinkedSectionHeading", "SectionLink", "Badge", "TopLevelLink"];
|
|
1225
1266
|
readonly Steps: readonly ["Item", "Marker"];
|
|
1226
|
-
readonly
|
|
1267
|
+
readonly SocialIcons: readonly ["Link", "HoverLink", "Icon"];
|
|
1268
|
+
readonly Tabs: readonly ["List", "Button", "SelectedButton", "FocusedButton"];
|
|
1227
1269
|
readonly TableOfContents: readonly ["Heading", "List", "Item", "Link", "LinkLabel", "HoverLink", "CurrentLink"];
|
|
1228
|
-
readonly ThemeSelect: readonly ["
|
|
1270
|
+
readonly ThemeSelect: readonly ["Trigger", "HoverTrigger", "ActiveTrigger", "Icon", "Panel", "OpenPanel", "Section", "SectionSpacing", "SectionLabel", "Option", "HoverOption", "CheckedOption", "FocusedOption", "Input", "OptionIcon", "Checkmark", "SelectedCheckmark"];
|
|
1229
1271
|
readonly TopNavigation: readonly ["Scrollbar", "Link", "HoverLink", "CurrentLink", "ActiveIndicator"];
|
|
1230
|
-
readonly StarlightHeader: readonly ["Primary", "TitleAndSearch", "Title", "Logo", "SiteTitle", "Search", "SearchElement", "Tools", "ToolItem", "Social", "MobileTheme"];
|
|
1272
|
+
readonly StarlightHeader: readonly ["Primary", "TitleAndSearch", "Title", "LogoLink", "Logo", "SiteTitle", "Search", "SearchElement", "Tools", "ToolItem", "Social", "MobileTheme"];
|
|
1231
1273
|
};
|
|
1232
1274
|
type CookbookComponentSubElementName<Name extends CookbookComponentName> = (typeof COOKBOOK_COMPONENT_SUB_ELEMENTS)[Name][number];
|
|
1233
1275
|
/** A serializable partial Tasty style object, merged into the base internally. */
|
|
1234
|
-
type ComponentStyles =
|
|
1276
|
+
type ComponentStyles = StylesWithoutSelectors & {
|
|
1277
|
+
$?: string;
|
|
1235
1278
|
mode?: never;
|
|
1279
|
+
recipe?: string;
|
|
1280
|
+
[token: `$${string}`]: Styles[string];
|
|
1281
|
+
[color: `#${string}`]: Styles[string];
|
|
1282
|
+
[state: `@${string}`]: Styles[string];
|
|
1236
1283
|
};
|
|
1237
1284
|
/** Style properties supplied by the user to override Cookbook defaults. */
|
|
1238
1285
|
type ComponentStyleConfig = ComponentStyles;
|
|
1239
1286
|
/** A component override with typed suggestions for its named sub-elements. */
|
|
1240
1287
|
type CookbookComponentStyles<Name extends CookbookComponentName> = ComponentStyles & Partial<Record<CookbookComponentSubElementName<Name>, ComponentStyles>>;
|
|
1241
|
-
type ComponentStylesConfig = { [Name in CookbookComponentName]?: CookbookComponentStyles<Name>; }
|
|
1288
|
+
type ComponentStylesConfig = { [Name in CookbookComponentName]?: CookbookComponentStyles<Name>; };
|
|
1242
1289
|
interface ThemeConfig {
|
|
1243
|
-
variant?: string;
|
|
1244
1290
|
brand?: BrandConfig;
|
|
1245
1291
|
palette?: ThemePaletteConfig;
|
|
1246
1292
|
states?: Record<string, string>;
|
|
@@ -1248,15 +1294,14 @@ interface ThemeConfig {
|
|
|
1248
1294
|
presets?: TypographyPresets;
|
|
1249
1295
|
/** Tasty UI styles, keyed by Cookbook component or bridge name. */
|
|
1250
1296
|
styles?: ComponentStylesConfig;
|
|
1297
|
+
/** Explicit registration and overrides for user-authored components. */
|
|
1298
|
+
customStyles?: Record<string, Styles>;
|
|
1251
1299
|
contrastLevel?: number | "auto";
|
|
1252
1300
|
}
|
|
1253
1301
|
interface MarkdownConfig {
|
|
1254
1302
|
stripLeadingBadges?: boolean;
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
executablePreviews?: boolean;
|
|
1258
|
-
remarkPlugins?: unknown[];
|
|
1259
|
-
rehypePlugins?: unknown[];
|
|
1303
|
+
/** Raw HTML policy for trusted Markdown. Untrusted package Markdown is always sanitized. */
|
|
1304
|
+
rawHtml?: "allow" | "sanitize" | "strip" | "reject";
|
|
1260
1305
|
}
|
|
1261
1306
|
interface SearchConfig {
|
|
1262
1307
|
enabled?: boolean;
|
|
@@ -1268,7 +1313,6 @@ interface ComponentsConfig {
|
|
|
1268
1313
|
interface BuildConfig {
|
|
1269
1314
|
strict?: boolean;
|
|
1270
1315
|
ci?: boolean;
|
|
1271
|
-
base?: string;
|
|
1272
1316
|
cacheDir?: string;
|
|
1273
1317
|
maxArtifactBytes?: number;
|
|
1274
1318
|
maxUnpackedBytes?: number;
|
|
@@ -1277,6 +1321,10 @@ interface BuildConfig {
|
|
|
1277
1321
|
maxAssetBytes?: number;
|
|
1278
1322
|
}
|
|
1279
1323
|
interface DocsConfig {
|
|
1324
|
+
/** Content and lock directory, relative to docs.config.ts (or the inline root). */
|
|
1325
|
+
root?: string;
|
|
1326
|
+
/** Old public routes mapped to current document routes. */
|
|
1327
|
+
redirects?: Record<string, string>;
|
|
1280
1328
|
site?: SiteConfig;
|
|
1281
1329
|
head?: HeadConfig[];
|
|
1282
1330
|
/** Enable source-aware “Edit page” links. */
|
|
@@ -1296,6 +1344,7 @@ interface DocsConfig {
|
|
|
1296
1344
|
build?: BuildConfig;
|
|
1297
1345
|
}
|
|
1298
1346
|
interface NormalizedDocsConfig {
|
|
1347
|
+
redirects: Record<string, string>;
|
|
1299
1348
|
site: SiteConfig;
|
|
1300
1349
|
head: HeadConfig[];
|
|
1301
1350
|
editLink?: EditLinkConfig;
|
|
@@ -1307,12 +1356,15 @@ interface NormalizedDocsConfig {
|
|
|
1307
1356
|
theme: ThemeConfig & {
|
|
1308
1357
|
brand: BrandConfig;
|
|
1309
1358
|
};
|
|
1310
|
-
markdown: Required<Pick<MarkdownConfig, "stripLeadingBadges" | "rawHtml"
|
|
1359
|
+
markdown: Required<Pick<MarkdownConfig, "stripLeadingBadges" | "rawHtml">> & MarkdownConfig;
|
|
1311
1360
|
search: Required<SearchConfig>;
|
|
1312
1361
|
components: ComponentsConfig;
|
|
1313
|
-
build: Required<BuildConfig
|
|
1362
|
+
build: Required<BuildConfig> & {
|
|
1363
|
+
base: string;
|
|
1364
|
+
};
|
|
1314
1365
|
}
|
|
1315
1366
|
interface DocsFrontmatter {
|
|
1367
|
+
aliases?: string[];
|
|
1316
1368
|
title?: string;
|
|
1317
1369
|
description?: string;
|
|
1318
1370
|
slug?: string;
|
|
@@ -1322,7 +1374,7 @@ interface DocsFrontmatter {
|
|
|
1322
1374
|
order?: number;
|
|
1323
1375
|
group?: string;
|
|
1324
1376
|
};
|
|
1325
|
-
|
|
1377
|
+
tableOfContents?: false | {
|
|
1326
1378
|
minHeadingLevel?: number;
|
|
1327
1379
|
maxHeadingLevel?: number;
|
|
1328
1380
|
};
|
|
@@ -1349,9 +1401,18 @@ interface DocsFrontmatter {
|
|
|
1349
1401
|
}>;
|
|
1350
1402
|
};
|
|
1351
1403
|
lastUpdated?: boolean | Date;
|
|
1352
|
-
prev?: false | string
|
|
1353
|
-
|
|
1354
|
-
|
|
1404
|
+
prev?: false | string | {
|
|
1405
|
+
link?: string;
|
|
1406
|
+
label?: string;
|
|
1407
|
+
};
|
|
1408
|
+
next?: false | string | {
|
|
1409
|
+
link?: string;
|
|
1410
|
+
label?: string;
|
|
1411
|
+
};
|
|
1412
|
+
banner?: {
|
|
1413
|
+
content: string;
|
|
1414
|
+
};
|
|
1415
|
+
pagefind?: boolean;
|
|
1355
1416
|
head?: Array<Record<string, unknown>>;
|
|
1356
1417
|
}
|
|
1357
1418
|
interface DocsHeading {
|
|
@@ -1375,6 +1436,9 @@ interface DocsAsset extends DocsReference {
|
|
|
1375
1436
|
}
|
|
1376
1437
|
interface DocsEntry {
|
|
1377
1438
|
id: string;
|
|
1439
|
+
sourceId: string;
|
|
1440
|
+
routeBase: string;
|
|
1441
|
+
metadata: Record<string, unknown>;
|
|
1378
1442
|
sourcePath: string;
|
|
1379
1443
|
absolutePath: string;
|
|
1380
1444
|
sourceRoot: string;
|
|
@@ -1399,8 +1463,10 @@ interface DocsRoute {
|
|
|
1399
1463
|
entryId: string;
|
|
1400
1464
|
sourcePath: string;
|
|
1401
1465
|
title: string;
|
|
1466
|
+
sidebar?: false | NavigationPlacement;
|
|
1402
1467
|
}
|
|
1403
1468
|
interface DocsGraph {
|
|
1469
|
+
redirects: Record<string, string>;
|
|
1404
1470
|
root: string;
|
|
1405
1471
|
config: NormalizedDocsConfig;
|
|
1406
1472
|
entries: DocsEntry[];
|
|
@@ -1408,7 +1474,7 @@ interface DocsGraph {
|
|
|
1408
1474
|
assets: DocsAsset[];
|
|
1409
1475
|
diagnostics: DocsDiagnostic[];
|
|
1410
1476
|
entryByRoute(route: string): DocsEntry | undefined;
|
|
1411
|
-
entryBySource(sourcePath: string): DocsEntry | undefined;
|
|
1477
|
+
entryBySource(sourcePath: string, sourceId?: string): DocsEntry | undefined;
|
|
1412
1478
|
}
|
|
1413
1479
|
interface PackageLockSource {
|
|
1414
1480
|
requested: string;
|
|
@@ -1453,7 +1519,9 @@ interface CreateDocsGraphOptions {
|
|
|
1453
1519
|
root?: string;
|
|
1454
1520
|
config?: DocsConfig;
|
|
1455
1521
|
lock?: CookbookLock;
|
|
1522
|
+
/** Public URL base used when rewriting routes and assets. */
|
|
1523
|
+
base?: string;
|
|
1456
1524
|
}
|
|
1457
1525
|
//#endregion
|
|
1458
|
-
export {
|
|
1459
|
-
//# sourceMappingURL=types-
|
|
1526
|
+
export { Root as $, MarkdownConfig as A, SiteConfig as B, DocsReference as C, HeadConfig as D, EditLinkConfig as E, NormalizedDocsConfig as F, ThemeTokens as G, ThemeConfig as H, PackageDiscovery as I, Content as J, TypographyPreset as K, PackageLockSource as L, NavigationItem as M, NavigationPlacement as N, HeaderLink as O, NavigationTab as P, PhrasingContent as Q, PackageManifest as R, DocsHeading as S, DocsSource as T, ThemePaletteConfig as U, SiteIconConfig as V, ThemeTokenValue as W, Link as X, Heading as Y, Paragraph as Z, DocsConfig as _, ComponentStyleConfig as a, DocsFrontmatter as b, ComponentsConfig as c, CookbookComponentStyles as d, CookbookComponentSubElementName as f, DocsAsset as g, DiagnosticSeverity as h, COOKBOOK_COMPONENT_SUB_ELEMENTS as i, NavigationConfig as j, LocaleConfig as k, ContentConfig as l, CreateDocsGraphOptions as m, BuildConfig as n, ComponentStyles as o, CookbookLock as p, TypographyPresets as q, COOKBOOK_COMPONENT_NAMES as r, ComponentStylesConfig as s, BrandConfig as t, CookbookComponentName as u, DocsDiagnostic as v, DocsRoute as w, DocsGraph as x, DocsEntry as y, SearchConfig as z };
|
|
1527
|
+
//# sourceMappingURL=types-CH6E2v-J.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types-CH6E2v-J.d.ts","names":[],"sources":["../../../node_modules/.pnpm/@types+unist@3.0.3/node_modules/@types/unist/index.d.ts","../../../node_modules/.pnpm/@types+mdast@4.0.4/node_modules/@types/mdast/index.d.ts","../src/types.ts"],"x_google_ignoreList":[0,1],"mappings":";;;;;;;;;;;;;;;;;;;;;;;UAqBiB;;;;UAKA;;;;EAIb;;;;EAKA;;;;EAIA;;;;;;;UAQa;;;;EAIb,OAAO;;;;EAKP,KAAK;;;;;;;;;;;;UA6BQ;;;;EAIb;;;;EAKA,OAAO;;;;;;;EAQP,WAAW;;;;;;;;;;;;;;;;;;;;;;KCjFH;;;;;;;;;;KAWA;;;;;UAOK;;;;;EAKb;;;;;;;;;;;UAYa;;;;;;;;;;;;;;EAcb;;;;;;;;;;EAWA;;;;;UAMa,kBAAkB;;;;EAI/B,eAAe;;;;;UAMF;;;;EAIb;;;;;EAKA;;;;;;;;;;;;;;;;;;;;;UAuBa,aAAa;;;;;;;;;KAWlB,eAAe,sBAAsB;;;;;;;;;;;;;;;;;;UAmBhC;EACb,YAAY;EACZ,MAAM;EACN,SAAS;EACT,MAAM;EACN,MAAM;EACN,WAAW;EACX,OAAO;EACP,eAAe;;;;;;;;;KAUP,oBAAoB,2BAA2B;;;;;;;;;;;;;;;;;UAkB1C;EACb,YAAY;EACZ,oBAAoB;;;;;;;;;KAwCZ,cAAc,qBAAqB;;;;;;;;;;;;;;;;;UAkB9B;EACb,UAAU;;;;;;;;;KAUF,kBAAkB,yBAAyB;;;;;;;;;;;;;;;;;;UAmBtC;EACb,OAAO;EACP,QAAQ;EACR,UAAU;EACV,mBAAmB;EACnB,MAAM;EACN,OAAO;EACP,gBAAgB;EAChB,YAAY;EACZ,MAAM;EACN,eAAe;EACf,QAAQ;EACR,MAAM;;;;;;;;KASE,cAAc,qBAAqB;;;;;;;;;;;;;;;;;;;;UAqB9B;EACb,YAAY;EACZ,OAAO;EACP,MAAM;EACN,YAAY;EACZ,QAAQ;EACR,UAAU;EACV,oBAAoB;EACpB,mBAAmB;EACnB,SAAS;EACT,MAAM;EACN,OAAO;EACP,gBA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EACf;EACA;EACA;EACA;EACA;;UAGe,kBAAkB;EACjC;EACA;EACA;EACA;;UAGe;EACf;EACA;EACA;EACA,UAAU;EACV;EACA;EACA;EACA;EACA;EACA;EACA,aAAa;EACb,UAAU;EACV;EACA;EACA,KAAK;EACL,OAAO;EACP,QAAQ;EACR;EACA;IAAY;IAAmB;;;UAGhB;EACf;EACA;EACA;EACA;EACA,kBAAkB;;UAGH;EACf,WAAW;EACX;EACA,QAAQ;EACR,SAAS;EACT,QAAQ;EACR,QAAQ;EACR,aAAa;EACb,aAAa,gBAAgB;EAC7B,cAAc,oBAAoB,oBAAoB;;UAGvC;EACf;EACA;EACA;EACA;EACA;;UAGe;EACf;EACA,SAAS;;UAGM;EACf;EACA;EACA;EACA;EACA;IAAwB;IAAe;IAAc;;EACrD;IACE;IACA;IACA;IACA;MAAU,QAAQ;;;EAEpB;EACA;;UAGe;EACf;EACA,UAAU;EACV;EACA;EACA;;UAGe;EACf;EACA,SAAS;EACT,OAAO;;EAEP"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tenphi/docs",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.0",
|
|
4
4
|
"description": "Repository-native content and configuration engine for Cookbook",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -51,18 +51,26 @@
|
|
|
51
51
|
"license": "MIT",
|
|
52
52
|
"dependencies": {
|
|
53
53
|
"@tenphi/glaze": "2.0.0",
|
|
54
|
+
"@tenphi/tasty": "3.8.0",
|
|
54
55
|
"github-slugger": "^2.0.0",
|
|
55
|
-
"
|
|
56
|
+
"hast-util-from-html": "^2.0.3",
|
|
57
|
+
"hast-util-sanitize": "^5.0.2",
|
|
58
|
+
"hast-util-to-html": "^9.0.5",
|
|
59
|
+
"jiti": "^2.7.0",
|
|
56
60
|
"mdast-util-from-markdown": "^2.0.2",
|
|
57
61
|
"mdast-util-gfm": "^3.1.0",
|
|
62
|
+
"mdast-util-mdx": "^3.0.0",
|
|
58
63
|
"mdast-util-to-markdown": "^2.1.2",
|
|
59
64
|
"micromark-extension-gfm": "^3.0.0",
|
|
65
|
+
"micromark-extension-mdxjs": "^3.0.0",
|
|
60
66
|
"npm-package-arg": "^13.0.2",
|
|
61
67
|
"pacote": "^21.5.1",
|
|
62
68
|
"tinyglobby": "^0.2.15",
|
|
63
|
-
"unist-util-visit": "^5.0.0"
|
|
69
|
+
"unist-util-visit": "^5.0.0",
|
|
70
|
+
"yaml": "^2.9.1"
|
|
64
71
|
},
|
|
65
72
|
"devDependencies": {
|
|
73
|
+
"@types/hast": "^3.0.5",
|
|
66
74
|
"@types/mdast": "^4.0.4",
|
|
67
75
|
"@types/node": "^22.15.2",
|
|
68
76
|
"@types/npm-package-arg": "^6.1.4",
|
package/dist/config/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../src/config/index.ts"],"sourcesContent":["import type {\n DocsConfig,\n DocsDiagnostic,\n NormalizedDocsConfig,\n} from \"../types.js\";\n\nconst DEFAULT_BRAND = \"#315efb\";\nconst HEAD_KEYS = new Set([\"tag\", \"attrs\", \"content\"]);\nconst SITE_ICON_KEYS = new Set([\"source\", \"background\"]);\nconst ROOT_KEYS = new Set([\n \"site\",\n \"head\",\n \"editLink\",\n \"lastUpdated\",\n \"locales\",\n \"defaultLocale\",\n \"content\",\n \"navigation\",\n \"theme\",\n \"markdown\",\n \"search\",\n \"components\",\n \"build\",\n]);\n\nconst OBJECT_KEYS: Record<string, Set<string>> = {\n site: new Set([\n \"title\",\n \"version\",\n \"description\",\n \"url\",\n \"repository\",\n \"favicon\",\n ]),\n content: new Set([\"sources\", \"allowOutsideRoot\", \"localizeRepositoryLinks\"]),\n markdown: new Set([\n \"stripLeadingBadges\",\n \"rawHtml\",\n \"strictLanguages\",\n \"executablePreviews\",\n \"remarkPlugins\",\n \"rehypePlugins\",\n ]),\n search: new Set([\"enabled\"]),\n components: new Set([\"overrides\"]),\n theme: new Set([\n \"variant\",\n \"brand\",\n \"palette\",\n \"states\",\n \"tokens\",\n \"presets\",\n \"styles\",\n \"contrastLevel\",\n ]),\n build: new Set([\n \"strict\",\n \"ci\",\n \"base\",\n \"cacheDir\",\n \"maxArtifactBytes\",\n \"maxUnpackedBytes\",\n \"maxFiles\",\n \"maxPathDepth\",\n \"maxAssetBytes\",\n ]),\n};\n\nexport class DocsConfigError extends Error {\n readonly diagnostics: DocsDiagnostic[];\n\n constructor(diagnostics: DocsDiagnostic[]) {\n super(diagnostics.map((diagnostic) => diagnostic.message).join(\"\\n\"));\n this.name = \"DocsConfigError\";\n this.diagnostics = diagnostics;\n }\n}\n\nexport function validateConfig(config: DocsConfig): DocsDiagnostic[] {\n const diagnostics: DocsDiagnostic[] = [];\n for (const key of Object.keys(config)) {\n if (!ROOT_KEYS.has(key)) unknown(diagnostics, key);\n }\n for (const [section, keys] of Object.entries(OBJECT_KEYS)) {\n const value = config[section as keyof DocsConfig];\n if (\n value === undefined ||\n Array.isArray(value) ||\n typeof value !== \"object\"\n ) {\n continue;\n }\n for (const key of Object.keys(value)) {\n if (!keys.has(key)) unknown(diagnostics, `${section}.${key}`);\n }\n }\n\n const head = config.head;\n if (head !== undefined && !Array.isArray(head)) {\n invalid(diagnostics, \"head must be an array.\");\n } else {\n for (const [index, entry] of (head ?? []).entries()) {\n if (!isRecord(entry)) {\n invalid(diagnostics, `head[${index}] must be an object.`);\n continue;\n }\n for (const key of Object.keys(entry)) {\n if (!HEAD_KEYS.has(key)) {\n unknown(diagnostics, `head[${index}].${key}`);\n }\n }\n if (typeof entry.tag !== \"string\") {\n invalid(diagnostics, `head[${index}].tag must be a string.`);\n }\n if (entry.attrs !== undefined && !isRecord(entry.attrs)) {\n invalid(diagnostics, `head[${index}].attrs must be an object.`);\n } else {\n for (const [name, value] of Object.entries(entry.attrs ?? {})) {\n if (\n value !== undefined &&\n typeof value !== \"string\" &&\n typeof value !== \"boolean\"\n ) {\n invalid(\n diagnostics,\n `head[${index}].attrs.${name} must be a string or boolean.`,\n );\n }\n }\n }\n if (entry.content !== undefined && typeof entry.content !== \"string\") {\n invalid(diagnostics, `head[${index}].content must be a string.`);\n }\n }\n }\n\n const favicon = config.site?.favicon;\n if (favicon !== undefined) {\n if (typeof favicon === \"string\") {\n if (favicon.trim() === \"\") {\n invalid(diagnostics, \"site.favicon must be a non-empty local path.\");\n }\n } else if (!isRecord(favicon)) {\n invalid(\n diagnostics,\n \"site.favicon must be a local path or an object with a source path.\",\n );\n } else {\n for (const key of Object.keys(favicon)) {\n if (!SITE_ICON_KEYS.has(key)) {\n unknown(diagnostics, `site.favicon.${key}`);\n }\n }\n if (typeof favicon.source !== \"string\" || favicon.source.trim() === \"\") {\n invalid(diagnostics, \"site.favicon.source must be a non-empty string.\");\n }\n if (\n favicon.background !== undefined &&\n (typeof favicon.background !== \"string\" ||\n favicon.background.trim() === \"\")\n ) {\n invalid(\n diagnostics,\n \"site.favicon.background must be a non-empty color string.\",\n );\n }\n }\n }\n\n if (\n config.editLink !== undefined &&\n (!isRecord(config.editLink) || typeof config.editLink.baseUrl !== \"string\")\n ) {\n invalid(diagnostics, \"editLink must contain a string baseUrl.\");\n } else if (config.editLink !== undefined) {\n for (const key of Object.keys(config.editLink)) {\n if (key !== \"baseUrl\") unknown(diagnostics, `editLink.${key}`);\n }\n try {\n new URL(config.editLink.baseUrl);\n } catch {\n invalid(diagnostics, \"editLink.baseUrl must be an absolute URL.\");\n }\n }\n if (\n config.lastUpdated !== undefined &&\n typeof config.lastUpdated !== \"boolean\"\n ) {\n invalid(diagnostics, \"lastUpdated must be a boolean.\");\n }\n if (config.locales !== undefined && !isRecord(config.locales)) {\n invalid(diagnostics, \"locales must be an object.\");\n } else {\n for (const [key, locale] of Object.entries(config.locales ?? {})) {\n if (!isRecord(locale) || typeof locale.label !== \"string\") {\n invalid(diagnostics, `locales.${key} must contain a string label.`);\n continue;\n }\n for (const property of Object.keys(locale)) {\n if (![\"label\", \"lang\", \"dir\"].includes(property)) {\n unknown(diagnostics, `locales.${key}.${property}`);\n }\n }\n if (locale.lang !== undefined && typeof locale.lang !== \"string\") {\n invalid(diagnostics, `locales.${key}.lang must be a string.`);\n }\n if (\n locale.dir !== undefined &&\n locale.dir !== \"ltr\" &&\n locale.dir !== \"rtl\"\n ) {\n invalid(diagnostics, `locales.${key}.dir must be \"ltr\" or \"rtl\".`);\n }\n }\n }\n if (\n config.defaultLocale !== undefined &&\n typeof config.defaultLocale !== \"string\"\n ) {\n invalid(diagnostics, \"defaultLocale must be a string.\");\n } else if (\n config.defaultLocale !== undefined &&\n (config.locales === undefined || !(config.defaultLocale in config.locales))\n ) {\n invalid(\n diagnostics,\n `defaultLocale must match a key in locales; received \"${config.defaultLocale}\".`,\n );\n }\n\n const sources = config.content?.sources ?? [];\n for (const [index, source] of sources.entries()) {\n const variants = [\"file\", \"glob\", \"package\"].filter((key) => key in source);\n if (variants.length !== 1) {\n diagnostics.push({\n code: \"DOCS_CONFIG_INVALID\",\n severity: \"error\",\n message: `content.sources[${index}] must select exactly one of file, glob, or package.`,\n });\n }\n }\n\n const brand = config.theme?.brand;\n if (\n typeof brand === \"object\" &&\n brand !== null &&\n \"contrast\" in brand &&\n !brand.unsafeContrast\n ) {\n const target = brand.contrast?.apca;\n const normal = Array.isArray(target) ? target[0] : target;\n if (typeof normal === \"number\" && normal < 45) {\n diagnostics.push({\n code: \"DOCS_CONFIG_INVALID\",\n severity: \"error\",\n message:\n \"theme.brand.contrast.apca cannot be below 45 without unsafeContrast.\",\n hint: \"Remove the override, use 45 or higher, or explicitly set unsafeContrast: true.\",\n });\n }\n }\n\n for (const [name, entry] of Object.entries(config.theme?.styles ?? {})) {\n if (!isRecord(entry)) {\n invalid(\n diagnostics,\n `theme.styles.${name} must be a Tasty style object.`,\n );\n } else if (\"mode\" in entry) {\n invalid(\n diagnostics,\n `theme.styles.${name} must contain only the Tasty style properties to override, without a mode wrapper.`,\n );\n }\n }\n\n const componentOverrides = config.components?.overrides;\n if (componentOverrides !== undefined && !isRecord(componentOverrides)) {\n invalid(diagnostics, \"components.overrides must be an object.\");\n } else {\n for (const [name, override] of Object.entries(componentOverrides ?? {})) {\n if (typeof override === \"string\") continue;\n if (name === \"Footer\" && override === false) continue;\n invalid(\n diagnostics,\n `components.overrides.${name} must be an Astro component path${name === \"Footer\" ? \" or false\" : \"\"}.`,\n );\n }\n }\n return diagnostics;\n}\n\nfunction unknown(diagnostics: DocsDiagnostic[], path: string): void {\n diagnostics.push({\n code: \"DOCS_CONFIG_UNKNOWN_KEY\",\n severity: \"error\",\n message: `Unknown configuration key \"${path}\".`,\n });\n}\n\nfunction invalid(diagnostics: DocsDiagnostic[], message: string): void {\n diagnostics.push({\n code: \"DOCS_CONFIG_INVALID\",\n severity: \"error\",\n message,\n });\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\nexport function normalizeDocsConfig(\n config: DocsConfig = {},\n): NormalizedDocsConfig {\n const diagnostics = validateConfig(config);\n if (diagnostics.length > 0) throw new DocsConfigError(diagnostics);\n const navigation = Array.isArray(config.navigation)\n ? { items: config.navigation }\n : (config.navigation ?? {});\n\n return {\n site: { ...config.site },\n head: [...(config.head ?? [])],\n ...(config.editLink ? { editLink: { ...config.editLink } } : {}),\n lastUpdated: config.lastUpdated ?? false,\n ...(config.locales ? { locales: { ...config.locales } } : {}),\n ...(config.defaultLocale ? { defaultLocale: config.defaultLocale } : {}),\n content: {\n allowOutsideRoot: false,\n localizeRepositoryLinks: false,\n ...config.content,\n },\n navigation,\n theme: { ...config.theme, brand: config.theme?.brand ?? DEFAULT_BRAND },\n markdown: {\n stripLeadingBadges: true,\n rawHtml: \"sanitize\",\n strictLanguages: false,\n executablePreviews: true,\n ...config.markdown,\n },\n search: { enabled: true, ...config.search },\n components: { ...config.components },\n build: {\n strict: true,\n ci: process.env.CI === \"true\",\n base: \"/\",\n cacheDir: \"\",\n maxArtifactBytes: 25 * 1024 * 1024,\n maxUnpackedBytes: 100 * 1024 * 1024,\n maxFiles: 10_000,\n maxPathDepth: 24,\n maxAssetBytes: 20 * 1024 * 1024,\n ...config.build,\n },\n };\n}\n\nexport function defineDocsConfig<const T extends DocsConfig>(config: T): T {\n const diagnostics = validateConfig(config);\n if (diagnostics.length > 0) throw new DocsConfigError(diagnostics);\n return config;\n}\n\nexport type {\n BrandConfig,\n BuildConfig,\n ComponentStyleConfig,\n ComponentStyles,\n ComponentStylesConfig,\n CookbookComponentName,\n ComponentsConfig,\n ContentConfig,\n DocsConfig,\n DocsSource,\n EditLinkConfig,\n HeadConfig,\n LocaleConfig,\n MarkdownConfig,\n NavigationConfig,\n NavigationItem,\n NavigationTab,\n NormalizedDocsConfig,\n SearchConfig,\n SiteConfig,\n SiteIconConfig,\n ThemeConfig,\n ThemePaletteConfig,\n ThemeTokens,\n ThemeTokenValue,\n TypographyPreset,\n TypographyPresets,\n} from \"../types.js\";\n"],"mappings":";AAMA,MAAM,gBAAgB;AACtB,MAAM,4BAAY,IAAI,IAAI;CAAC;CAAO;CAAS;AAAS,CAAC;AACrD,MAAM,iCAAiB,IAAI,IAAI,CAAC,UAAU,YAAY,CAAC;AACvD,MAAM,4BAAY,IAAI,IAAI;CACxB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;AAED,MAAM,cAA2C;CAC/C,sBAAM,IAAI,IAAI;EACZ;EACA;EACA;EACA;EACA;EACA;CACF,CAAC;CACD,yBAAS,IAAI,IAAI;EAAC;EAAW;EAAoB;CAAyB,CAAC;CAC3E,0BAAU,IAAI,IAAI;EAChB;EACA;EACA;EACA;EACA;EACA;CACF,CAAC;CACD,wBAAQ,IAAI,IAAI,CAAC,SAAS,CAAC;CAC3B,4BAAY,IAAI,IAAI,CAAC,WAAW,CAAC;CACjC,uBAAO,IAAI,IAAI;EACb;EACA;EACA;EACA;EACA;EACA;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