semajsx 0.1.2 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{index-DC3tthWf.d.mts → index-Ch9GwToI.d.mts} +2 -2
- package/dist/{index-DC3tthWf.d.mts.map → index-Ch9GwToI.d.mts.map} +1 -1
- package/dist/{src-DR-EWgVP.mjs → src-L88LbwEv.mjs} +2 -2
- package/dist/src-L88LbwEv.mjs.map +1 -0
- package/dist/ssg/index.d.mts +1 -1
- package/dist/ssg/index.mjs +1 -1
- package/dist/ssg/plugins/docs-theme.d.mts +41 -3
- package/dist/ssg/plugins/docs-theme.d.mts.map +1 -1
- package/dist/ssg/plugins/docs-theme.mjs +211 -1
- package/dist/ssg/plugins/docs-theme.mjs.map +1 -1
- package/dist/ssg/plugins/lucide.d.mts +2 -2
- package/dist/{types-CGkRxnQB.d.mts → types-C9fiRu6l.d.mts} +3 -3
- package/dist/{types-CGkRxnQB.d.mts.map → types-C9fiRu6l.d.mts.map} +1 -1
- package/package.json +1 -1
- package/dist/src-DR-EWgVP.mjs.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { d as VNode } from "./types-CZMcXQTW.mjs";
|
|
2
|
-
import { _ as SSGPlugin } from "./types-
|
|
2
|
+
import { _ as SSGPlugin } from "./types-C9fiRu6l.mjs";
|
|
3
3
|
|
|
4
4
|
//#region ../ssg/src/plugins/lucide/component.d.ts
|
|
5
5
|
interface IconProps {
|
|
@@ -78,4 +78,4 @@ interface LucidePluginOptions {
|
|
|
78
78
|
declare function lucide(options?: LucidePluginOptions): SSGPlugin;
|
|
79
79
|
//#endregion
|
|
80
80
|
export { IconProps as i, lucide as n, Icon as r, LucidePluginOptions as t };
|
|
81
|
-
//# sourceMappingURL=index-
|
|
81
|
+
//# sourceMappingURL=index-Ch9GwToI.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-
|
|
1
|
+
{"version":3,"file":"index-Ch9GwToI.d.mts","names":[],"sources":["../../ssg/src/plugins/lucide/component.tsx","../../ssg/src/plugins/lucide/index.ts"],"mappings":";;;;UAuCiB,SAAA;;EAEf,IAAA;EAFF;EAIE,IAAA;;EAEA,KAAA;;EAEA,WAAA;;EAEA,KAAA;AAAA;;;AA8BF;;;;;;;;;;;;iBAAgB,IAAA,CAAA;EACd,IAAA;EACA,IAAA;EACA,KAAA;EACA,WAAA;EACA,KAAA,EAAO;AAAA,GACN,SAAA,GAAY,KAAA;;;UC/EE,mBAAA;EDiCA;EC/Bf,IAAA;ED+Be;EC7Bf,KAAA;;EAEA,WAAA;AAAA;;;;ADmEF;;;;;;;;;;;;;;;;;;;;;;;;;;;iBClCgB,MAAA,CAAO,OAAA,GAAS,mBAAA,GAA2B,SAAA"}
|
|
@@ -359,7 +359,7 @@ var SSG = class {
|
|
|
359
359
|
},
|
|
360
360
|
vite: { build: { rollupOptions: { external: [] } } }
|
|
361
361
|
});
|
|
362
|
-
for (const plugin of this.plugins) await plugin.buildEnd?.(result);
|
|
362
|
+
for (const plugin of this.plugins) await plugin.buildEnd?.(result, this);
|
|
363
363
|
return result;
|
|
364
364
|
} finally {
|
|
365
365
|
await this.app.close();
|
|
@@ -865,4 +865,4 @@ function createSource(options) {
|
|
|
865
865
|
|
|
866
866
|
//#endregion
|
|
867
867
|
export { DefaultDocument as _, remoteSource as a, FileSource as c, defineCollection as d, SSG as f, RawHTML as g, createMDXProcessor as h, RemoteSource as i, fileSource as l, MDXProcessor as m, CustomSource as n, GitSource as o, createSSG as p, createSource as r, gitSource as s, z$1 as t, BaseSource as u, __exportAll as v, __require as y };
|
|
868
|
-
//# sourceMappingURL=src-
|
|
868
|
+
//# sourceMappingURL=src-L88LbwEv.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"src-L88LbwEv.mjs","names":["fsWatch"],"sources":["../../ssg/src/document.tsx","../../ssg/src/types.ts","../../ssg/src/mdx/processor.ts","../../ssg/src/mdx/vite-plugin.ts","../../ssg/src/ssg.ts","../../ssg/src/collection/index.ts","../../ssg/src/sources/base.ts","../../ssg/src/sources/file.ts","../../ssg/src/sources/git.ts","../../ssg/src/sources/remote.ts","../../ssg/src/sources/custom.ts"],"sourcesContent":["/** @jsxImportSource @semajsx/dom */\n\nimport type { DocumentTemplate } from \"./types\";\n\n/**\n * Default HTML document template for SSG\n */\nexport const DefaultDocument: DocumentTemplate = ({\n children,\n title = \"SSG Page\",\n scripts,\n css,\n}) => (\n <html lang=\"en\">\n <head>\n <meta charSet=\"UTF-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n <title>{title}</title>\n {css?.map((href) => (\n <link rel=\"stylesheet\" href={href} />\n ))}\n </head>\n <body>\n {children}\n {scripts}\n </body>\n </html>\n);\n","import type { Component, VNode } from \"@semajsx/core\";\nimport type { z } from \"zod\";\n\n// =============================================================================\n// Collection Registry (for type inference)\n// =============================================================================\n\n/**\n * Infer a registry type from an array of collections\n * Maps collection names to their data types\n */\nexport type InferCollections<T extends readonly Collection[]> = {\n [K in T[number] as K[\"name\"]]: K extends Collection<infer D> ? D : unknown;\n};\n\n// =============================================================================\n// Collection Entry\n// =============================================================================\n\nexport interface CollectionEntry<T = unknown> {\n /** Unique identifier within the collection */\n id: string;\n /** URL-friendly slug */\n slug: string;\n /** Validated frontmatter data */\n data: T;\n /** Raw content body (markdown/mdx) */\n body: string;\n /** Render the content to JSX */\n render: () => Promise<{ Content: () => VNode }>;\n}\n\n// =============================================================================\n// Collection Source\n// =============================================================================\n\nexport interface ChangeSet<T = unknown> {\n /** Cursor for next incremental fetch */\n cursor: string;\n /** Newly added entries */\n added: CollectionEntry<T>[];\n /** Updated entries */\n updated: CollectionEntry<T>[];\n /** Deleted entry IDs */\n deleted: string[];\n}\n\nexport type WatchCallback<T = unknown> = (changes: ChangeSet<T>) => void;\n\nexport interface CollectionSource<T = unknown> {\n /** Unique identifier for this source */\n id: string;\n\n /** Get all entries from this source */\n getEntries(): Promise<CollectionEntry<T>[]>;\n\n /** Get a single entry by ID */\n getEntry(id: string): Promise<CollectionEntry<T> | null>;\n\n /** Watch for changes (optional) */\n watch?(callback: WatchCallback<T>): () => void;\n\n /** Get incremental changes since cursor (optional) */\n getChanges?(since: string): Promise<ChangeSet<T>>;\n}\n\n// =============================================================================\n// Collection Definition\n// =============================================================================\n\nexport interface CollectionConfig<T extends z.ZodType = z.ZodType> {\n /** Collection name */\n name: string;\n /** Data source (returns raw entries, validated against schema later) */\n source: CollectionSource<unknown>;\n /** Zod schema for validation */\n schema: T;\n}\n\nexport interface Collection<T = unknown> {\n name: string;\n source: CollectionSource<unknown>;\n schema: z.ZodType;\n /** Type-only field for inference */\n _outputType?: T;\n}\n\n// =============================================================================\n// Route Configuration\n// =============================================================================\n\nexport interface StaticPath<P = Record<string, string>> {\n params: P;\n props?: Record<string, unknown>;\n}\n\nexport interface RouteConfig<TRegistry extends Record<string, unknown> = Record<string, unknown>> {\n /** Route path pattern (e.g., '/blog/:slug') */\n path: string;\n /** Component to render. Props are provided dynamically by the route config. */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any -- Route props are dynamic, typed via `props`/`getStaticPaths`\n component: (props: any) => VNode;\n /** Static props for the route */\n props?:\n | Record<string, unknown>\n | ((ssg: SSGInstance<TRegistry>) => Promise<Record<string, unknown>>);\n /** Generate static paths for dynamic routes */\n getStaticPaths?: (ssg: SSGInstance<TRegistry>) => Promise<StaticPath[]>;\n}\n\n// =============================================================================\n// MDX Configuration\n// =============================================================================\n\nexport interface MDXConfig {\n /** Remark plugins */\n remarkPlugins?: unknown[];\n /** Rehype plugins */\n rehypePlugins?: unknown[];\n /** Component mapping for MDX */\n components?: Record<string, Component>;\n}\n\n// =============================================================================\n// Document Template\n// =============================================================================\n\n/**\n * Raw HTML VNode that can be used directly in JSX or converted to string\n */\nexport class RawHTML {\n public readonly type = \"div\";\n public readonly props: { dangerouslySetInnerHTML: { __html: string } };\n public readonly children: never[] = [];\n\n constructor(public readonly html: string) {\n this.props = { dangerouslySetInnerHTML: { __html: html } };\n }\n\n toString(): string {\n return this.html;\n }\n}\n\nexport interface DocumentProps {\n /** Rendered page content (VNode with toString) */\n children: RawHTML;\n /** Page title */\n title?: string;\n /** Base URL path */\n base: string;\n /** Route path */\n path: string;\n /** Route props */\n props: Record<string, unknown>;\n /** Script tags for islands (as RawHTML) */\n scripts?: RawHTML;\n /** CSS stylesheet paths */\n css?: string[];\n}\n\nexport type DocumentTemplate = (props: DocumentProps) => VNode;\n\n// =============================================================================\n// Plugin System\n// =============================================================================\n\n/**\n * Partial SSG config that a plugin's config() hook can return.\n * Each field has a defined merge strategy:\n * - mdx: merge (concat arrays, merge component objects)\n * - document: override (last writer wins)\n * - routes: concat\n * - collections: concat\n */\nexport interface SSGPluginConfig {\n mdx?: Partial<MDXConfig>;\n document?: DocumentTemplate;\n routes?: RouteConfig[];\n collections?: readonly Collection[];\n}\n\nexport interface SSGPlugin {\n /** Plugin name for identification and debugging */\n name: string;\n\n /** Plugin ordering: 'pre' runs before normal plugins, 'post' runs after */\n enforce?: \"pre\" | \"post\";\n\n /**\n * Modify SSG config before it is resolved.\n * Return partial config to merge.\n * Called in plugin order: enforce:'pre' → normal → enforce:'post' → user config.\n */\n config?(config: SSGConfig): SSGPluginConfig | void;\n\n /** Called after config is fully resolved. Read-only inspection. */\n configResolved?(config: SSGConfig): void;\n\n /** Called before build starts */\n buildStart?(): void | Promise<void>;\n\n /** Called after build completes. Receives the SSG instance for post-build operations. */\n buildEnd?(result: BuildResult, ssg: SSGInstance): void | Promise<void>;\n}\n\n// =============================================================================\n// SSG Configuration\n// =============================================================================\n\nexport interface SSGConfig<\n TCollections extends readonly Collection[] = Collection[],\n TRegistry extends Record<string, unknown> = InferCollections<TCollections>,\n> {\n /** Output directory for built files */\n outDir: string;\n /** Root directory for resolving relative paths (defaults to script location) */\n rootDir?: string;\n /** Base URL path */\n base?: string;\n /** Collections to include */\n collections?: TCollections;\n /** Route definitions */\n routes?: RouteConfig<TRegistry>[];\n /** Plugins that contribute remark/rehype plugins and components.\n * Plugin factories may return arrays (Vite-style); nested arrays are flattened. */\n plugins?: (SSGPlugin | SSGPlugin[])[];\n /** MDX configuration (merged after plugins, takes precedence) */\n mdx?: MDXConfig;\n /** Custom document template */\n document?: DocumentTemplate;\n}\n\n// =============================================================================\n// Build State & Result\n// =============================================================================\n\nexport interface BuildState {\n /** Cursor for each collection */\n cursors: Record<string, string>;\n /** Content hash for each page */\n pageHashes: Record<string, string>;\n /** Last build timestamp */\n timestamp: number;\n}\n\nexport interface BuildResult {\n /** New build state for incremental builds */\n state: BuildState;\n /** Paths that were built */\n paths: string[];\n /** Build statistics */\n stats: {\n added: number;\n updated: number;\n deleted: number;\n unchanged: number;\n };\n}\n\nexport interface BuildOptions {\n /** Enable incremental build */\n incremental?: boolean;\n /** Previous build state */\n state?: BuildState;\n /** Only build specific collections */\n collections?: string[];\n}\n\n// =============================================================================\n// Watcher\n// =============================================================================\n\nexport interface WatchOptions {\n /** Callback when rebuild completes */\n onRebuild?: (result: BuildResult) => void;\n /** Callback on error */\n onError?: (error: Error) => void;\n}\n\nexport interface Watcher {\n /** Stop watching */\n close(): void;\n}\n\n// =============================================================================\n// SSG Instance\n// =============================================================================\n\nexport interface SSGInstance<TRegistry extends Record<string, unknown> = Record<string, unknown>> {\n /** Get the root directory for resolving paths */\n getRootDir(): string;\n\n /** Get all entries from a collection */\n getCollection<K extends keyof TRegistry & string>(\n name: K,\n ): Promise<CollectionEntry<TRegistry[K]>[]>;\n\n /** Get a single entry from a collection */\n getEntry<K extends keyof TRegistry & string>(\n name: K,\n id: string,\n ): Promise<CollectionEntry<TRegistry[K]> | null>;\n\n /** Build the static site */\n build(options?: BuildOptions): Promise<BuildResult>;\n\n /** Watch for changes and rebuild */\n watch(options?: WatchOptions): Watcher;\n}\n","import { compile } from \"@mdx-js/mdx\";\nimport type { Pluggable } from \"unified\";\nimport type { VNode } from \"@semajsx/core\";\nimport type { MDXConfig, MDXCompileResult, Heading } from \"./types\";\n\n/**\n * MDX Processor for compiling MDX content to JSX components\n */\nexport class MDXProcessor {\n private config: MDXConfig;\n\n constructor(config: MDXConfig = {}) {\n this.config = config;\n }\n\n /**\n * Compile MDX content to a JSX component\n */\n async compile(\n content: string,\n frontmatter: Record<string, unknown> = {},\n ): Promise<MDXCompileResult> {\n // Extract headings for table of contents\n const headings = this.extractHeadings(content);\n\n // Compile MDX to JavaScript\n const compiled = await compile(content, {\n outputFormat: \"function-body\",\n development: false,\n remarkPlugins: (this.config.remarkPlugins ?? []) as Pluggable[],\n rehypePlugins: (this.config.rehypePlugins ?? []) as Pluggable[],\n // Use SemaJSX runtime\n jsxImportSource: \"semajsx/dom\",\n });\n\n // Dynamic import of JSX runtime\n const jsxRuntime = await import(\"semajsx/dom/jsx-runtime\");\n\n // Create the Content component\n const Content = this.createComponent(\n String(compiled),\n this.config.components ?? {},\n jsxRuntime,\n );\n\n return {\n Content,\n frontmatter,\n headings,\n };\n }\n\n /**\n * Create a component from compiled MDX code\n */\n private createComponent(\n code: string,\n components: Record<string, (props: Record<string, unknown>) => VNode>,\n jsxRuntime: unknown,\n ): (props?: Record<string, unknown>) => VNode {\n // Import JSX runtime\n // This will be resolved at runtime\n return (props: Record<string, unknown> = {}) => {\n try {\n // Create a function from the MDX compiled code\n // MDX compiled code expects jsx runtime in arguments[0]\n // By using new Function() with no parameters, we can pass\n // the runtime via call() and it becomes arguments[0]\n // eslint-disable-next-line @typescript-eslint/no-implied-eval\n const fn = new Function(code + \"\\nreturn MDXContent;\");\n\n // Call with jsxRuntime as arguments[0]\n // MDX returns an object with default export\n const result = fn.call(null, jsxRuntime) as {\n default: (props: Record<string, unknown>) => VNode;\n };\n return result.default({ ...props, components });\n } catch (e) {\n // Fallback for when runtime is not available\n throw new Error(`MDX rendering failed: ${(e as Error).message}`);\n }\n };\n }\n\n /**\n * Extract headings from markdown content\n */\n private extractHeadings(content: string): Heading[] {\n const headings: Heading[] = [];\n const headingRegex = /^(#{1,6})\\s+(.+)$/gm;\n\n let match;\n while ((match = headingRegex.exec(content)) !== null) {\n const hashes = match[1];\n const rawText = match[2];\n if (!hashes || !rawText) continue;\n\n const depth = hashes.length;\n const text = rawText.trim();\n const slug = this.slugify(text);\n\n headings.push({ depth, text, slug });\n }\n\n return headings;\n }\n\n /**\n * Convert text to URL-friendly slug\n */\n private slugify(text: string): string {\n return text\n .toLowerCase()\n .replace(/[^\\w\\s-]/g, \"\")\n .replace(/\\s+/g, \"-\")\n .replace(/-+/g, \"-\")\n .trim();\n }\n}\n\n/**\n * Create an MDX processor instance\n */\nexport function createMDXProcessor(config?: MDXConfig): MDXProcessor {\n return new MDXProcessor(config);\n}\n","import { compile } from \"@mdx-js/mdx\";\nimport type { Plugin, PluginOption } from \"vite\";\nimport type { Pluggable } from \"unified\";\n\n/**\n * MDX plugin options\n */\nexport interface MDXPluginOptions {\n /** Remark plugins */\n remarkPlugins?: unknown[];\n /** Rehype plugins */\n rehypePlugins?: unknown[];\n}\n\n/**\n * Vite plugin for MDX support\n * Transforms .mdx files to JSX modules\n */\nexport function viteMDXPlugin(options: MDXPluginOptions = {}): PluginOption {\n const plugin: Plugin = {\n name: \"semajsx-mdx\",\n\n async transform(code: string, id: string) {\n // Only transform .mdx files\n if (!id.endsWith(\".mdx\")) {\n return null;\n }\n\n try {\n // Compile MDX to JavaScript (not JSX)\n const compiled = await compile(code, {\n jsxImportSource: \"semajsx/dom\",\n outputFormat: \"program\",\n development: false,\n remarkPlugins: (options.remarkPlugins ?? []) as Pluggable[],\n rehypePlugins: (options.rehypePlugins ?? []) as Pluggable[],\n });\n\n return {\n code: String(compiled),\n map: null,\n };\n } catch (error) {\n const err = error as Error;\n throw new Error(`MDX compilation failed for ${id}: ${err.message}`);\n }\n },\n };\n\n return plugin;\n}\n","import { mkdir, writeFile, rm } from \"fs/promises\";\nimport { join, dirname, resolve } from \"path\";\nimport { createApp, renderDocument } from \"@semajsx/ssr\";\nimport type { App, RouteContext } from \"@semajsx/ssr\";\nimport { DefaultDocument } from \"./document\";\nimport type { VNode } from \"@semajsx/core\";\nimport {\n RawHTML,\n type SSGConfig,\n type SSGPlugin,\n type SSGInstance,\n type MDXConfig,\n type RouteConfig,\n type DocumentTemplate,\n type Collection,\n type CollectionEntry,\n type BuildOptions,\n type BuildResult,\n type BuildState,\n type WatchOptions,\n type Watcher,\n type DocumentProps,\n type InferCollections,\n} from \"./types\";\nimport { viteMDXPlugin } from \"./mdx\";\n\n/**\n * Sort plugins by enforce order: 'pre' → normal → 'post'\n */\nfunction sortPlugins(plugins: SSGPlugin[]): SSGPlugin[] {\n const pre: SSGPlugin[] = [];\n const normal: SSGPlugin[] = [];\n const post: SSGPlugin[] = [];\n\n for (const plugin of plugins) {\n if (plugin.enforce === \"pre\") pre.push(plugin);\n else if (plugin.enforce === \"post\") post.push(plugin);\n else normal.push(plugin);\n }\n\n return [...pre, ...normal, ...post];\n}\n\n/**\n * Merge a partial MDX config into an existing one.\n */\nfunction mergeMdxConfig(base: MDXConfig, partial: Partial<MDXConfig>): MDXConfig {\n return {\n remarkPlugins: [...(base.remarkPlugins ?? []), ...(partial.remarkPlugins ?? [])],\n rehypePlugins: [...(base.rehypePlugins ?? []), ...(partial.rehypePlugins ?? [])],\n components: { ...base.components, ...partial.components },\n };\n}\n\n/**\n * Resolved config produced by running all plugin config hooks.\n */\ninterface ResolvedPluginConfig {\n mdx: MDXConfig;\n document?: DocumentTemplate;\n routes: RouteConfig[];\n collections: Collection[];\n}\n\n/**\n * Result of plugin resolution: merged config + flat list of all plugins.\n */\ninterface PluginResolutionResult {\n config: ResolvedPluginConfig;\n allPlugins: SSGPlugin[];\n}\n\n/**\n * Run config hooks on all plugins, then merge with user config.\n *\n * Plugin arrays are flattened Vite-style: plugin factories may return\n * `SSGPlugin | SSGPlugin[]`, and the top-level array is `.flat()`-ed\n * before sorting and processing.\n *\n * Merge strategies:\n * - mdx: merge (concat arrays, merge component objects)\n * - document: override (last writer wins, user config last)\n * - routes: concat (plugin routes first, then user routes)\n * - collections: concat (plugin collections first, then user collections)\n */\nfunction resolvePlugins(\n plugins: (SSGPlugin | SSGPlugin[])[],\n config: SSGConfig,\n): PluginResolutionResult {\n // Vite-style: flatten nested arrays from plugin factories\n const flat = plugins.flat();\n const sorted = sortPlugins(flat);\n\n let mdx: MDXConfig = { remarkPlugins: [], rehypePlugins: [], components: {} };\n let document: DocumentTemplate | undefined;\n const routes: RouteConfig[] = [];\n const collections: Collection[] = [];\n\n // Call config hooks in order\n for (const plugin of sorted) {\n if (!plugin.config) continue;\n const partial = plugin.config(config);\n if (!partial) continue;\n\n if (partial.mdx) mdx = mergeMdxConfig(mdx, partial.mdx);\n if (partial.document) document = partial.document;\n if (partial.routes) routes.push(...partial.routes);\n if (partial.collections) collections.push(...partial.collections);\n }\n\n // User config takes precedence (applied last)\n if (config.mdx) mdx = mergeMdxConfig(mdx, config.mdx);\n if (config.document) document = config.document;\n if (config.routes) routes.push(...config.routes);\n if (config.collections) collections.push(...config.collections);\n\n return { config: { mdx, document, routes, collections }, allPlugins: sorted };\n}\n\n/**\n * SSG (Static Site Generator) core class\n * Built on top of server's createApp\n */\nexport class SSG<\n TRegistry extends Record<string, unknown> = Record<string, unknown>,\n> implements SSGInstance<TRegistry> {\n private config: SSGConfig;\n private plugins: SSGPlugin[];\n private rootDir: string;\n private collections: Map<string, Collection>;\n private entriesCache: Map<string, CollectionEntry[]>;\n private app: App;\n private mdxModules: Map<string, string> = new Map();\n\n constructor(config: SSGConfig) {\n // Resolve rootDir\n this.rootDir = config.rootDir ?? process.cwd();\n\n // Run config hooks — merges plugins + user config, collects all plugins (including nested)\n const { config: resolved, allPlugins } = resolvePlugins(config.plugins ?? [], config);\n\n // Store all plugins (including sub-plugins) for lifecycle hooks\n this.plugins = allPlugins;\n\n this.config = {\n base: \"/\",\n ...config,\n mdx: resolved.mdx,\n document: resolved.document,\n routes: resolved.routes,\n collections: resolved.collections,\n outDir: resolve(this.rootDir, config.outDir),\n };\n\n // Call configResolved on all plugins\n for (const plugin of this.plugins) {\n plugin.configResolved?.(this.config);\n }\n this.collections = new Map();\n this.entriesCache = new Map();\n\n // Create App with MDX plugins\n this.app = createApp({\n root: this.rootDir,\n vite: {\n plugins: [\n // Virtual MDX content modules\n {\n name: \"ssg-virtual-mdx\",\n resolveId: (id: string) => {\n if (id.startsWith(\"virtual:mdx:\")) {\n return \"\\0\" + id;\n }\n },\n load: (id: string) => {\n if (id.startsWith(\"\\0virtual:mdx:\")) {\n const mdxId = id.replace(\"\\0virtual:mdx:\", \"\");\n return this.mdxModules.get(mdxId);\n }\n },\n },\n // MDX compiler plugin\n viteMDXPlugin(resolved.mdx),\n ],\n },\n });\n\n // Register collections (from resolved config — plugins + user)\n for (const collection of this.config.collections ?? []) {\n this.collections.set(collection.name, collection);\n }\n }\n\n getRootDir(): string {\n return this.rootDir;\n }\n\n async getCollection<K extends keyof TRegistry & string>(\n name: K,\n ): Promise<CollectionEntry<TRegistry[K]>[]> {\n const collection = this.collections.get(name);\n if (!collection) {\n throw new Error(`Collection \"${name}\" not found`);\n }\n\n if (this.entriesCache.has(name)) {\n return this.entriesCache.get(name) as CollectionEntry<TRegistry[K]>[];\n }\n\n const entries = await collection.source.getEntries();\n\n const validatedEntries = entries.map((entry) => {\n const result = collection.schema.safeParse(entry.data);\n if (!result.success) {\n throw new Error(`Validation error in ${name}/${entry.id}: ${result.error.message}`);\n }\n\n return {\n ...entry,\n data: result.data,\n render: async () => {\n // Get Vite server from app\n const vite = this.app.getViteServer();\n if (!vite) {\n throw new Error(\"Vite server not initialized\");\n }\n\n // Store MDX content as virtual module\n const mdxId = `${name}/${entry.id}.mdx`;\n this.mdxModules.set(mdxId, entry.body);\n\n try {\n // Load module through Vite SSR\n const moduleExports = (await vite.ssrLoadModule(`virtual:mdx:${mdxId}`)) as {\n default: (props: Record<string, unknown>) => unknown;\n };\n\n const Content = (props: Record<string, unknown> = {}): VNode =>\n moduleExports.default({\n ...props,\n components: this.config.mdx?.components ?? {},\n }) as VNode;\n\n return {\n Content,\n headings: this.extractHeadings(entry.body),\n };\n } finally {\n this.mdxModules.delete(mdxId);\n }\n },\n };\n });\n\n this.entriesCache.set(name, validatedEntries);\n return validatedEntries as CollectionEntry<TRegistry[K]>[];\n }\n\n async getEntry<K extends keyof TRegistry & string>(\n name: K,\n id: string,\n ): Promise<CollectionEntry<TRegistry[K]> | null> {\n const entries = await this.getCollection(name);\n return entries.find((e) => e.id === id || e.slug === id) ?? null;\n }\n\n async build(options: BuildOptions = {}): Promise<BuildResult> {\n const { incremental = false, state: prevState } = options;\n const outDir = this.config.outDir;\n\n // Plugin hook: buildStart\n for (const plugin of this.plugins) {\n await plugin.buildStart?.();\n }\n\n // Initialize App (starts Vite)\n await this.app.prepare();\n\n try {\n // Register routes with App\n await this.registerRoutes();\n\n // Build all pages\n const result = await this.buildPages(incremental, prevState, outDir);\n\n // Build islands for client-side hydration\n // Pass renderHtml so the Vite build uses the SSG's Document template\n // instead of a hardcoded minimal HTML template\n const documentTemplate = this.config.document ?? DefaultDocument;\n await this.app.build({\n outDir,\n mode: \"full\",\n minify: true,\n renderHtml: ({ html, css, scripts, title, path: routePath }) => {\n const scriptsHtml = scripts\n .map((s) => `<script type=\"module\" src=\"${s.src}\"></script>`)\n .join(\"\\n\");\n const documentProps: DocumentProps = {\n children: new RawHTML(html),\n title,\n base: this.config.base ?? \"/\",\n path: routePath,\n props: {},\n scripts: scriptsHtml ? new RawHTML(scriptsHtml) : undefined,\n css: css ?? [],\n };\n const documentVNode = documentTemplate(documentProps);\n return renderDocument(documentVNode);\n },\n vite: {\n build: {\n rollupOptions: {\n // Don't externalize for SSG - bundle everything\n external: [],\n },\n },\n },\n });\n\n // Plugin hook: buildEnd\n for (const plugin of this.plugins) {\n await plugin.buildEnd?.(result, this);\n }\n\n return result;\n } finally {\n await this.app.close();\n }\n }\n\n private async registerRoutes(): Promise<void> {\n const routes = this.config.routes ?? [];\n\n for (const route of routes) {\n if (route.getStaticPaths) {\n // Dynamic route - register each path\n const staticPaths = await route.getStaticPaths(this);\n for (const sp of staticPaths) {\n const path = this.applyParams(route.path, sp.params);\n const props: Record<string, unknown> = { ...sp.props, params: sp.params };\n\n this.app.route(\n path,\n (_context: RouteContext) => {\n return route.component(props);\n },\n { title: props.title as string | undefined },\n );\n }\n } else {\n // Static route\n let props: Record<string, unknown> = {};\n if (typeof route.props === \"function\") {\n props = await route.props(this);\n } else if (route.props) {\n props = route.props;\n }\n\n this.app.route(\n route.path,\n (_context: RouteContext) => {\n return route.component(props);\n },\n { title: props.title as string | undefined },\n );\n }\n }\n }\n\n private async buildPages(\n incremental: boolean,\n prevState: BuildState | undefined,\n outDir: string,\n ): Promise<BuildResult> {\n const state: BuildState = {\n cursors: {},\n pageHashes: {},\n timestamp: Date.now(),\n };\n\n const stats = { added: 0, updated: 0, deleted: 0, unchanged: 0 };\n const builtPaths: string[] = [];\n\n if (!incremental) {\n await rm(outDir, { recursive: true, force: true });\n }\n await mkdir(outDir, { recursive: true });\n\n this.entriesCache.clear();\n\n // Get all paths to build\n const allPaths = await this.generateAllPaths();\n const currentPaths = new Set(allPaths.map((p) => p.path));\n\n // Delete removed pages\n if (incremental && prevState) {\n for (const oldPath of Object.keys(prevState.pageHashes)) {\n if (!currentPaths.has(oldPath)) {\n const filePath = this.pathToFilePath(oldPath);\n try {\n await rm(join(outDir, filePath));\n stats.deleted++;\n } catch {\n // ignore\n }\n }\n }\n }\n\n // Build each page\n for (const { path, props } of allPaths) {\n const html = await this.renderPage(path, props);\n const hash = this.hashContent(html);\n\n const prevHash = prevState?.pageHashes[path];\n const needsWrite = !incremental || !prevHash || prevHash !== hash;\n\n if (needsWrite) {\n const filePath = this.pathToFilePath(path);\n const fullPath = join(outDir, filePath);\n\n await mkdir(dirname(fullPath), { recursive: true });\n await writeFile(fullPath, html);\n\n builtPaths.push(path);\n if (!prevHash) {\n stats.added++;\n } else {\n stats.updated++;\n }\n } else {\n stats.unchanged++;\n }\n\n state.pageHashes[path] = hash;\n }\n\n for (const [name, collection] of this.collections) {\n if (collection.source.getChanges) {\n state.cursors[name] = Date.now().toString();\n }\n }\n\n return { state, paths: builtPaths, stats };\n }\n\n private async renderPage(path: string, props: Record<string, unknown>): Promise<string> {\n // Use App to render the page\n const result = await this.app.render(path);\n\n // Wrap with document template\n const documentProps: DocumentProps = {\n children: new RawHTML(result.html),\n title: props.title as string | undefined,\n base: this.config.base ?? \"/\",\n path,\n props,\n scripts: result.scripts ? new RawHTML(result.scripts) : undefined,\n css: result.css ?? [],\n };\n\n const template = this.config.document ?? DefaultDocument;\n const documentVNode = template(documentProps);\n\n return renderDocument(documentVNode);\n }\n\n private async generateAllPaths(): Promise<\n Array<{ path: string; props: Record<string, unknown> }>\n > {\n const paths: Array<{ path: string; props: Record<string, unknown> }> = [];\n const routes = this.config.routes ?? [];\n\n for (const route of routes) {\n if (route.getStaticPaths) {\n const staticPaths = await route.getStaticPaths(this);\n for (const sp of staticPaths) {\n const path = this.applyParams(route.path, sp.params);\n paths.push({ path, props: { ...sp.props, params: sp.params } });\n }\n } else {\n let props: Record<string, unknown> = {};\n if (typeof route.props === \"function\") {\n props = await route.props(this);\n } else if (route.props) {\n props = route.props;\n }\n paths.push({ path: route.path, props });\n }\n }\n\n return paths;\n }\n\n watch(options: WatchOptions = {}): Watcher {\n const unsubscribers: (() => void)[] = [];\n\n for (const [name, collection] of this.collections) {\n if (collection.source.watch) {\n const unsubscribe = collection.source.watch(async () => {\n try {\n this.entriesCache.delete(name);\n const result = await this.build({ incremental: true });\n options.onRebuild?.(result);\n } catch (error) {\n options.onError?.(error as Error);\n }\n });\n unsubscribers.push(unsubscribe);\n }\n }\n\n return {\n close: () => unsubscribers.forEach((fn) => fn()),\n };\n }\n\n private pathToFilePath(urlPath: string): string {\n if (urlPath === \"/\") return \"index.html\";\n return `${urlPath.slice(1)}/index.html`;\n }\n\n private applyParams(pattern: string, params: Record<string, string>): string {\n let path = pattern;\n for (const [key, value] of Object.entries(params)) {\n path = path.replace(`:${key}`, value);\n }\n return path;\n }\n\n private hashContent(content: string): string {\n let hash = 0;\n for (let i = 0; i < content.length; i++) {\n const char = content.charCodeAt(i);\n hash = (hash << 5) - hash + char;\n hash = hash & hash;\n }\n return hash.toString(16);\n }\n\n private extractHeadings(content: string): Array<{ depth: number; text: string; slug: string }> {\n const headings: Array<{ depth: number; text: string; slug: string }> = [];\n const regex = /^(#{1,6})\\s+(.+)$/gm;\n\n let match;\n while ((match = regex.exec(content)) !== null) {\n if (!match[1] || !match[2]) continue;\n const depth = match[1].length;\n const text = match[2].trim();\n const slug = text\n .toLowerCase()\n .replace(/[^\\w\\s-]/g, \"\")\n .replace(/\\s+/g, \"-\");\n headings.push({ depth, text, slug });\n }\n\n return headings;\n }\n}\n\nexport function createSSG<\n const TCollections extends readonly Collection[],\n TRegistry extends Record<string, unknown> = InferCollections<TCollections>,\n>(config: SSGConfig<TCollections, TRegistry>): SSGInstance<TRegistry> {\n return new SSG<TRegistry>(config as unknown as SSGConfig);\n}\n","import type { z } from \"zod\";\nimport type { Collection, CollectionConfig } from \"../types\";\n\n/**\n * Define a collection with schema validation\n */\nexport function defineCollection<T extends z.ZodType>(\n config: CollectionConfig<T>,\n): Collection<z.infer<T>> {\n return {\n name: config.name,\n source: config.source,\n schema: config.schema,\n };\n}\n\nexport type { Collection, CollectionConfig, CollectionEntry } from \"../types\";\n","import type { CollectionSource, CollectionEntry, ChangeSet, WatchCallback } from \"../types\";\n\n/**\n * Base class for collection sources\n */\nexport abstract class BaseSource<T = unknown> implements CollectionSource<T> {\n abstract id: string;\n\n abstract getEntries(): Promise<CollectionEntry<T>[]>;\n\n async getEntry(id: string): Promise<CollectionEntry<T> | null> {\n const entries = await this.getEntries();\n return entries.find((e) => e.id === id) ?? null;\n }\n\n watch?(callback: WatchCallback<T>): () => void;\n\n getChanges?(since: string): Promise<ChangeSet<T>>;\n}\n","import { glob } from \"glob\";\nimport matter from \"gray-matter\";\nimport { readFile, watch as fsWatch } from \"fs/promises\";\nimport { join, relative } from \"path\";\nimport type { CollectionEntry, ChangeSet, WatchCallback } from \"../types\";\nimport type { FileSourceOptions } from \"./types\";\nimport { BaseSource } from \"./base\";\n\n/**\n * File system source for collections\n */\nexport class FileSource<T = unknown> extends BaseSource<T> {\n id: string;\n private directory: string;\n private include: string;\n private shouldWatch: boolean;\n private contentRoot: string;\n\n constructor(options: FileSourceOptions, contentRoot: string = process.cwd()) {\n super();\n this.directory = options.directory;\n this.include = options.include ?? \"**/*.{md,mdx}\";\n this.shouldWatch = options.watch ?? false;\n this.contentRoot = contentRoot;\n this.id = `file:${this.directory}`;\n }\n\n async getEntries(): Promise<CollectionEntry<T>[]> {\n const dir = join(this.contentRoot, this.directory);\n const pattern = join(dir, this.include);\n const files = await glob(pattern);\n\n const entries = await Promise.all(\n files.map(async (filePath) => {\n const content = await readFile(filePath, \"utf-8\");\n const { data, content: body } = matter(content);\n\n const relativePath = relative(dir, filePath);\n const id = relativePath.replace(/\\.(md|mdx)$/, \"\");\n const slug = id.replace(/\\\\/g, \"/\");\n\n return {\n id,\n slug,\n data: data as T,\n body,\n render: async () => {\n // MDX compilation will be handled by the MDX processor\n return {\n Content: () => {\n throw new Error(\"MDX rendering not yet implemented\");\n },\n };\n },\n };\n }),\n );\n\n return entries;\n }\n\n override watch(callback: WatchCallback<T>): () => void {\n if (!this.shouldWatch) {\n return () => {};\n }\n\n const dir = join(this.contentRoot, this.directory);\n const abortController = new AbortController();\n\n const startWatching = async () => {\n try {\n const watcher = fsWatch(dir, {\n recursive: true,\n signal: abortController.signal,\n });\n\n for await (const _event of watcher) {\n // Debounce and collect changes\n const entries = await this.getEntries();\n callback({\n cursor: Date.now().toString(),\n added: [],\n updated: entries,\n deleted: [],\n });\n }\n } catch (err) {\n if ((err as Error).name !== \"AbortError\") {\n throw err;\n }\n }\n };\n\n startWatching();\n\n return () => {\n abortController.abort();\n };\n }\n\n override async getChanges(_since: string): Promise<ChangeSet<T>> {\n // For file source, we do a full reload\n // A more sophisticated implementation could track file mtimes\n const entries = await this.getEntries();\n return {\n cursor: Date.now().toString(),\n added: [],\n updated: entries,\n deleted: [],\n };\n }\n}\n\n/**\n * Create a file system source\n */\nexport function fileSource<T = unknown>(\n options: FileSourceOptions,\n contentRoot?: string,\n): FileSource<T> {\n return new FileSource<T>(options, contentRoot);\n}\n","import { exec } from \"child_process\";\nimport { promisify } from \"util\";\nimport type { CollectionEntry } from \"../types\";\nimport type { GitSourceOptions, GitCommitSourceOptions, GitTagSourceOptions } from \"./types\";\nimport { BaseSource } from \"./base\";\n\nconst execAsync = promisify(exec);\n\n/**\n * Git source for collections\n */\nexport class GitSource<T = unknown> extends BaseSource<T> {\n id: string;\n private options: GitSourceOptions;\n private cwd: string;\n\n constructor(options: GitSourceOptions, cwd: string = process.cwd()) {\n super();\n this.options = options;\n this.cwd = cwd;\n this.id = `git:${options.type}`;\n }\n\n async getEntries(): Promise<CollectionEntry<T>[]> {\n if (this.options.type === \"commits\") {\n return this.getCommits(this.options);\n } else {\n return this.getTags(this.options);\n }\n }\n\n private async getCommits(options: GitCommitSourceOptions): Promise<CollectionEntry<T>[]> {\n const args = [\"log\", \"--format=%H|%s|%an|%ae|%aI\"];\n\n if (options.filter?.since) {\n args.push(`--since=${options.filter.since}`);\n }\n if (options.filter?.until) {\n args.push(`--until=${options.filter.until}`);\n }\n if (options.filter?.author) {\n args.push(`--author=${options.filter.author}`);\n }\n if (options.limit) {\n args.push(`-n`, options.limit.toString());\n }\n if (options.filter?.paths?.length) {\n args.push(\"--\", ...options.filter.paths);\n }\n\n const { stdout } = await execAsync(`git ${args.join(\" \")}`, {\n cwd: this.cwd,\n });\n const lines = stdout.trim().split(\"\\n\").filter(Boolean);\n\n return lines.map((line) => {\n const parts = line.split(\"|\");\n const hash = parts[0] ?? \"\";\n const message = parts[1] ?? \"\";\n const author = parts[2] ?? \"\";\n const email = parts[3] ?? \"\";\n const dateStr = parts[4] ?? \"\";\n\n const data = {\n hash,\n message,\n author,\n email,\n date: new Date(dateStr),\n } as unknown as T;\n\n return {\n id: hash,\n slug: hash.slice(0, 7),\n data,\n body: message,\n render: async () => ({\n Content: () => {\n throw new Error(\"Git commits cannot be rendered as content\");\n },\n }),\n };\n });\n }\n\n private async getTags(options: GitTagSourceOptions): Promise<CollectionEntry<T>[]> {\n const pattern = options.pattern ?? \"*\";\n\n // Get tags with date and message\n const { stdout } = await execAsync(\n `git tag -l \"${pattern}\" --format=\"%(refname:short)|%(objectname:short)|%(creatordate:iso)|%(contents:subject)\"`,\n { cwd: this.cwd },\n );\n\n const lines = stdout.trim().split(\"\\n\").filter(Boolean);\n\n return lines.map((line) => {\n const parts = line.split(\"|\");\n const tag = parts[0] ?? \"\";\n const hash = parts[1] ?? \"\";\n const dateStr = parts[2] ?? \"\";\n const message = parts[3] ?? \"\";\n\n const data = {\n tag,\n hash,\n date: new Date(dateStr),\n message: message || undefined,\n } as unknown as T;\n\n return {\n id: tag,\n slug: tag,\n data,\n body: message,\n render: async () => ({\n Content: () => {\n throw new Error(\"Git tags cannot be rendered as content\");\n },\n }),\n };\n });\n }\n}\n\n/**\n * Create a Git source\n */\nexport function gitSource<T = unknown>(options: GitSourceOptions, cwd?: string): GitSource<T> {\n return new GitSource<T>(options, cwd);\n}\n","import type { CollectionEntry, ChangeSet, WatchCallback } from \"../types\";\nimport type { RemoteSourceOptions, WebhookConfig } from \"./types\";\nimport { BaseSource } from \"./base\";\n\n/**\n * Remote API source for collections\n */\nexport class RemoteSource<T = unknown> extends BaseSource<T> {\n id: string;\n private options: RemoteSourceOptions<T>;\n private pollTimer?: ReturnType<typeof setInterval>;\n\n constructor(options: RemoteSourceOptions<T>, id: string = \"remote\") {\n super();\n this.options = options;\n this.id = `remote:${id}`;\n }\n\n async getEntries(): Promise<CollectionEntry<T>[]> {\n const items = await this.options.fetch();\n\n return items.map((item, index) => {\n const id = (item as Record<string, unknown>).id?.toString() ?? index.toString();\n const slug = (item as Record<string, unknown>).slug?.toString() ?? id;\n\n return {\n id,\n slug,\n data: item,\n body: (item as Record<string, unknown>).content?.toString() ?? \"\",\n render: async () => ({\n Content: () => {\n throw new Error(\"Remote content rendering not yet implemented\");\n },\n }),\n };\n });\n }\n\n override async getEntry(id: string): Promise<CollectionEntry<T> | null> {\n if (this.options.fetchOne) {\n const item = await this.options.fetchOne(id);\n if (!item) return null;\n\n const slug = (item as Record<string, unknown>).slug?.toString() ?? id;\n\n return {\n id,\n slug,\n data: item,\n body: (item as Record<string, unknown>).content?.toString() ?? \"\",\n render: async () => ({\n Content: () => {\n throw new Error(\"Remote content rendering not yet implemented\");\n },\n }),\n };\n }\n\n return super.getEntry(id);\n }\n\n override watch(callback: WatchCallback<T>): () => void {\n if (this.options.pollInterval) {\n this.pollTimer = setInterval(async () => {\n const entries = await this.getEntries();\n callback({\n cursor: Date.now().toString(),\n added: [],\n updated: entries,\n deleted: [],\n });\n }, this.options.pollInterval);\n\n return () => {\n if (this.pollTimer) {\n clearInterval(this.pollTimer);\n }\n };\n }\n\n return () => {};\n }\n\n override async getChanges(since: string): Promise<ChangeSet<T>> {\n if (this.options.fetchChanges) {\n return this.options.fetchChanges(since);\n }\n\n // Fallback to full reload\n const entries = await this.getEntries();\n return {\n cursor: Date.now().toString(),\n added: [],\n updated: entries,\n deleted: [],\n };\n }\n\n /**\n * Get webhook configuration for external integration\n */\n getWebhookConfig(): WebhookConfig | undefined {\n return this.options.webhook;\n }\n}\n\n/**\n * Create a remote API source\n */\nexport function remoteSource<T = unknown>(\n options: RemoteSourceOptions<T>,\n id?: string,\n): RemoteSource<T> {\n return new RemoteSource<T>(options, id);\n}\n","import type { CollectionEntry, ChangeSet, WatchCallback } from \"../types\";\nimport type { CustomSourceOptions } from \"./types\";\nimport { BaseSource } from \"./base\";\n\n/**\n * Custom source for collections\n */\nexport class CustomSource<T = unknown> extends BaseSource<T> {\n id: string;\n private options: CustomSourceOptions<T>;\n\n constructor(options: CustomSourceOptions<T>) {\n super();\n this.options = options;\n this.id = options.id;\n }\n\n async getEntries(): Promise<CollectionEntry<T>[]> {\n const items = await this.options.getEntries();\n\n return items.map((item, index) => {\n const id = (item as Record<string, unknown>).id?.toString() ?? index.toString();\n const slug = (item as Record<string, unknown>).slug?.toString() ?? id;\n\n return {\n id,\n slug,\n data: item,\n body: (item as Record<string, unknown>).body?.toString() ?? \"\",\n render: async () => ({\n Content: () => {\n throw new Error(\"Custom content rendering not yet implemented\");\n },\n }),\n };\n });\n }\n\n override async getEntry(id: string): Promise<CollectionEntry<T> | null> {\n if (this.options.getEntry) {\n const item = await this.options.getEntry(id);\n if (!item) return null;\n\n const slug = (item as Record<string, unknown>).slug?.toString() ?? id;\n\n return {\n id,\n slug,\n data: item,\n body: (item as Record<string, unknown>).body?.toString() ?? \"\",\n render: async () => ({\n Content: () => {\n throw new Error(\"Custom content rendering not yet implemented\");\n },\n }),\n };\n }\n\n return super.getEntry(id);\n }\n\n override watch(callback: WatchCallback<T>): () => void {\n if (this.options.watch) {\n return this.options.watch(callback);\n }\n return () => {};\n }\n\n override async getChanges(since: string): Promise<ChangeSet<T>> {\n if (this.options.getChanges) {\n return this.options.getChanges(since);\n }\n\n const entries = await this.getEntries();\n return {\n cursor: Date.now().toString(),\n added: [],\n updated: entries,\n deleted: [],\n };\n }\n}\n\n/**\n * Create a custom source\n */\nexport function createSource<T = unknown>(options: CustomSourceOptions<T>): CustomSource<T> {\n return new CustomSource<T>(options);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,MAAa,mBAAqC,EAChD,UACA,QAAQ,YACR,SACA,UAEA,qBAAC;CAAK,MAAK;YACT,qBAAC;EACC,oBAAC,UAAK,SAAQ,UAAU;EACxB,oBAAC;GAAK,MAAK;GAAW,SAAQ;IAA0C;EACxE,oBAAC,qBAAO,QAAc;EACrB,KAAK,KAAK,SACT,oBAAC;GAAK,KAAI;GAAmB;IAAQ,CACrC;KACG,EACP,qBAAC,qBACE,UACA,WACI;EACF;;;;;;;ACwGT,IAAa,UA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, a as Collection, b as WatchCallback, c as CollectionSource, d as InferCollections, f as MDXConfig, g as SSGInstance, h as SSGConfig, i as ChangeSet, l as DocumentProps, m as RouteConfig, n as BuildResult, o as CollectionConfig, p as RawHTML, r as BuildState, s as CollectionEntry, t as BuildOptions, u as DocumentTemplate, v as SSGPluginConfig, x as WatchOptions, y as StaticPath } from "../types-
|
|
2
|
+
import { S as Watcher, _ as SSGPlugin, a as Collection, b as WatchCallback, c as CollectionSource, d as InferCollections, f as MDXConfig, g as SSGInstance, h as SSGConfig, i as ChangeSet, l as DocumentProps, m as RouteConfig, n as BuildResult, o as CollectionConfig, p as RawHTML, r as BuildState, s as CollectionEntry, t as BuildOptions, u as DocumentTemplate, v as SSGPluginConfig, x as WatchOptions, y as StaticPath } from "../types-C9fiRu6l.mjs";
|
|
3
3
|
import { PluginOption } from "vite";
|
|
4
4
|
import { z, z as z$1 } from "zod";
|
|
5
5
|
|
package/dist/ssg/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as DefaultDocument, a as remoteSource, c as FileSource, d as defineCollection, f as SSG, g as RawHTML, h as createMDXProcessor, i as RemoteSource, l as fileSource, m as MDXProcessor, n as CustomSource, o as GitSource, p as createSSG, r as createSource, s as gitSource, t as z, u as BaseSource, y as __require } from "../src-
|
|
1
|
+
import { _ as DefaultDocument, a as remoteSource, c as FileSource, d as defineCollection, f as SSG, g as RawHTML, h as createMDXProcessor, i as RemoteSource, l as fileSource, m as MDXProcessor, n as CustomSource, o as GitSource, p as createSSG, r as createSource, s as gitSource, t as z, u as BaseSource, y as __require } from "../src-L88LbwEv.mjs";
|
|
2
2
|
import "../src-DW3tIczg.mjs";
|
|
3
3
|
import "../src-Ds9vl42d.mjs";
|
|
4
4
|
import "../jsx-runtime-D9ZNjMJ2.mjs";
|
|
@@ -1,8 +1,22 @@
|
|
|
1
1
|
import { c as JSXNode, d as VNode, t as Component } from "../../types-CZMcXQTW.mjs";
|
|
2
2
|
import { o as StyleToken } from "../../types-DucvOZQ2.mjs";
|
|
3
|
-
import { _ as SSGPlugin, c as CollectionSource } from "../../types-
|
|
4
|
-
import { t as LucidePluginOptions } from "../../index-
|
|
3
|
+
import { _ as SSGPlugin, c as CollectionSource } from "../../types-C9fiRu6l.mjs";
|
|
4
|
+
import { t as LucidePluginOptions } from "../../index-Ch9GwToI.mjs";
|
|
5
5
|
|
|
6
|
+
//#region ../ssg/src/plugins/llms/types.d.ts
|
|
7
|
+
/**
|
|
8
|
+
* An additional link to include in llms.txt.
|
|
9
|
+
* Placed in the "Optional" section per the llms.txt spec.
|
|
10
|
+
*/
|
|
11
|
+
interface LlmsLink {
|
|
12
|
+
/** Link title */
|
|
13
|
+
title: string;
|
|
14
|
+
/** Link URL (absolute or relative) */
|
|
15
|
+
url: string;
|
|
16
|
+
/** Optional description shown after the link */
|
|
17
|
+
description?: string;
|
|
18
|
+
}
|
|
19
|
+
//#endregion
|
|
6
20
|
//#region ../ssg/src/plugins/docs-theme/types.d.ts
|
|
7
21
|
interface NavLink {
|
|
8
22
|
/** Display label */
|
|
@@ -101,6 +115,30 @@ interface DocsThemeOptions {
|
|
|
101
115
|
};
|
|
102
116
|
/** Lucide icon plugin options. Set to `false` to disable. Enabled by default. */
|
|
103
117
|
lucide?: LucidePluginOptions | false;
|
|
118
|
+
/**
|
|
119
|
+
* LLMs plugin options (llms.txt). Set to `false` to disable.
|
|
120
|
+
* Enabled by default when docs or guides are configured.
|
|
121
|
+
*
|
|
122
|
+
* Sections are auto-derived from docs/guides collections.
|
|
123
|
+
* Pass an object to customize URL, additional links, or toggle individual outputs.
|
|
124
|
+
*/
|
|
125
|
+
llms?: LlmsThemeOptions | false;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Options for the llms plugin when used within docs-theme.
|
|
129
|
+
* Title, description, and sections are auto-derived from the theme config.
|
|
130
|
+
*/
|
|
131
|
+
interface LlmsThemeOptions {
|
|
132
|
+
/** Site base URL for absolute links (e.g., "https://docs.example.com") */
|
|
133
|
+
url?: string;
|
|
134
|
+
/** Additional links for the "Optional" section of llms.txt */
|
|
135
|
+
links?: LlmsLink[];
|
|
136
|
+
/** Generate llms.txt (default: true) */
|
|
137
|
+
llmsTxt?: boolean;
|
|
138
|
+
/** Generate llms-full.txt (default: true) */
|
|
139
|
+
llmsFullTxt?: boolean;
|
|
140
|
+
/** Generate per-entry .md files (default: true) */
|
|
141
|
+
markdownPages?: boolean;
|
|
104
142
|
}
|
|
105
143
|
//#endregion
|
|
106
144
|
//#region ../ui/src/components/callout/callout.d.ts
|
|
@@ -176,5 +214,5 @@ declare function CodeBlock({
|
|
|
176
214
|
*/
|
|
177
215
|
declare function docsTheme(options: DocsThemeOptions): SSGPlugin[];
|
|
178
216
|
//#endregion
|
|
179
|
-
export { Callout, CodeBlock, type DocsConfig, type DocsThemeOptions, type FeatureItem, type GuidesConfig, type HeroAction, type NavLink, type QuickLinkItem, docsTheme };
|
|
217
|
+
export { Callout, CodeBlock, type DocsConfig, type DocsThemeOptions, type FeatureItem, type GuidesConfig, type HeroAction, type LlmsThemeOptions, type NavLink, type QuickLinkItem, docsTheme };
|
|
180
218
|
//# sourceMappingURL=docs-theme.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"docs-theme.d.mts","names":[],"sources":["../../../../ssg/src/plugins/docs-theme/types.ts","../../../../ui/src/components/callout/callout.tsx","../../../../ssg/src/plugins/docs-theme/components.tsx","../../../../ssg/src/plugins/docs-theme/index.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"docs-theme.d.mts","names":[],"sources":["../../../../ssg/src/plugins/llms/types.ts","../../../../ssg/src/plugins/docs-theme/types.ts","../../../../ui/src/components/callout/callout.tsx","../../../../ssg/src/plugins/docs-theme/components.tsx","../../../../ssg/src/plugins/docs-theme/index.ts"],"mappings":";;;;;;;;;;UAqBiB,QAAA;;EAEf,KAAA;ECde;EDgBf,GAAA;EChBe;EDkBf,WAAA;AAAA;;;UClBe,OAAA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A;;EAEA,WAAA;;EAEA,aAAA;AAAA;;;KCxJG,UAAA,YAAsB,UAAA,GAAa,UAAA;AAAA,KAE5B,WAAA;AAAA,UAEK,YAAA;;EAEf,IAAA,GAAO,WAAA;;EAEP,KAAA;;EAEA,KAAA,GAAQ,UAAA;EDhBR;ECkBA,QAAA,GAAW,OAAA;AAAA;AAAA,iBAwEG,OAAA,CAAQ,KAAA,EAAO,YAAA,GAAe,OAAA;;;UCjFpC,cAAA;EACR,QAAA;EACA,SAAA;EACA,QAAA;AAAA;AAAA,iBAGc,SAAA,CAAA;EAAY,QAAA;EAAU,SAAA;EAAW;AAAA,GAAY,cAAA,GAAiB,KAAA;;;;;AHT9E;;;;;;;;;;;;ACZA;;;;;;;;;AAaA;;;;;;;;;AASA;;;;;;;;;AASA;;iBGgDgB,SAAA,CAAU,OAAA,EAAS,gBAAA,GAAmB,SAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as defineCollection, v as __exportAll } from "../../src-
|
|
1
|
+
import { d as defineCollection, v as __exportAll } from "../../src-L88LbwEv.mjs";
|
|
2
2
|
import { a as jsxs, i as jsx, v as Fragment } from "../../src-DW3tIczg.mjs";
|
|
3
3
|
import "../../src-BqX3sryB.mjs";
|
|
4
4
|
import { G as rules, K as classes, M as createTheme, N as defineTokens, U as isStyleToken, W as rule } from "../../src-Ds9vl42d.mjs";
|
|
@@ -9,6 +9,8 @@ import "../../resource-DSlXDZZi.mjs";
|
|
|
9
9
|
import "../../src-DuSN6go_.mjs";
|
|
10
10
|
import "../../document-BOJDaiBc.mjs";
|
|
11
11
|
import { n as Icon, t as lucide } from "../../lucide-CVtHepGM.mjs";
|
|
12
|
+
import { dirname, join } from "path";
|
|
13
|
+
import { mkdir, writeFile } from "fs/promises";
|
|
12
14
|
import { z } from "zod";
|
|
13
15
|
|
|
14
16
|
//#region ../ssg/src/plugins/docs-theme/styles.ts
|
|
@@ -1867,6 +1869,189 @@ function createComponents(options) {
|
|
|
1867
1869
|
};
|
|
1868
1870
|
}
|
|
1869
1871
|
|
|
1872
|
+
//#endregion
|
|
1873
|
+
//#region ../ssg/src/plugins/llms/index.ts
|
|
1874
|
+
function normalizePath(path) {
|
|
1875
|
+
return path.startsWith("/") ? path : `/${path}`;
|
|
1876
|
+
}
|
|
1877
|
+
function resolveUrl(base, path) {
|
|
1878
|
+
if (!base) return path;
|
|
1879
|
+
return `${base.replace(/\/$/, "")}${path}`;
|
|
1880
|
+
}
|
|
1881
|
+
function getEntryTitle(entry) {
|
|
1882
|
+
return entry.data.title ?? entry.slug;
|
|
1883
|
+
}
|
|
1884
|
+
function getEntryDescription(entry) {
|
|
1885
|
+
return entry.data.description;
|
|
1886
|
+
}
|
|
1887
|
+
function formatLink(title, url, description) {
|
|
1888
|
+
return description ? `- [${title}](${url}): ${description}` : `- [${title}](${url})`;
|
|
1889
|
+
}
|
|
1890
|
+
/**
|
|
1891
|
+
* Generate llms.txt content following the llms.txt specification.
|
|
1892
|
+
*
|
|
1893
|
+
* Format:
|
|
1894
|
+
* - H1: site title (required)
|
|
1895
|
+
* - Blockquote: site description (optional)
|
|
1896
|
+
* - H2 sections: collection entries as markdown links
|
|
1897
|
+
* - ## Optional: additional links
|
|
1898
|
+
*
|
|
1899
|
+
* @see https://llmstxt.org/
|
|
1900
|
+
*/
|
|
1901
|
+
function generateLlmsTxt(options, sectionEntries) {
|
|
1902
|
+
const lines = [];
|
|
1903
|
+
lines.push(`# ${options.title}`);
|
|
1904
|
+
lines.push("");
|
|
1905
|
+
if (options.description) {
|
|
1906
|
+
lines.push(`> ${options.description}`);
|
|
1907
|
+
lines.push("");
|
|
1908
|
+
}
|
|
1909
|
+
for (const section of options.sections ?? []) {
|
|
1910
|
+
const entries = sectionEntries.get(section.collection) ?? [];
|
|
1911
|
+
if (entries.length === 0) continue;
|
|
1912
|
+
const basePath = normalizePath(section.basePath);
|
|
1913
|
+
lines.push(`## ${section.title}`);
|
|
1914
|
+
lines.push("");
|
|
1915
|
+
for (const entry of entries) {
|
|
1916
|
+
const title = getEntryTitle(entry);
|
|
1917
|
+
const url = resolveUrl(options.url, `${basePath}/${entry.slug}`);
|
|
1918
|
+
const desc = getEntryDescription(entry);
|
|
1919
|
+
lines.push(formatLink(title, url, desc));
|
|
1920
|
+
}
|
|
1921
|
+
lines.push("");
|
|
1922
|
+
}
|
|
1923
|
+
if (options.links?.length) {
|
|
1924
|
+
lines.push("## Optional");
|
|
1925
|
+
lines.push("");
|
|
1926
|
+
for (const link of options.links) lines.push(formatLink(link.title, link.url, link.description));
|
|
1927
|
+
lines.push("");
|
|
1928
|
+
}
|
|
1929
|
+
return lines.join("\n");
|
|
1930
|
+
}
|
|
1931
|
+
/**
|
|
1932
|
+
* Generate llms-full.txt with complete content for each entry.
|
|
1933
|
+
* Includes the full markdown body of every collection entry.
|
|
1934
|
+
*/
|
|
1935
|
+
function generateLlmsFullTxt(options, sectionEntries) {
|
|
1936
|
+
const lines = [];
|
|
1937
|
+
lines.push(`# ${options.title}`);
|
|
1938
|
+
lines.push("");
|
|
1939
|
+
if (options.description) {
|
|
1940
|
+
lines.push(`> ${options.description}`);
|
|
1941
|
+
lines.push("");
|
|
1942
|
+
}
|
|
1943
|
+
for (const section of options.sections ?? []) {
|
|
1944
|
+
const entries = sectionEntries.get(section.collection) ?? [];
|
|
1945
|
+
if (entries.length === 0) continue;
|
|
1946
|
+
const basePath = normalizePath(section.basePath);
|
|
1947
|
+
lines.push(`## ${section.title}`);
|
|
1948
|
+
lines.push("");
|
|
1949
|
+
for (const entry of entries) {
|
|
1950
|
+
const title = getEntryTitle(entry);
|
|
1951
|
+
const url = resolveUrl(options.url, `${basePath}/${entry.slug}`);
|
|
1952
|
+
const desc = getEntryDescription(entry);
|
|
1953
|
+
lines.push(`### ${title}`);
|
|
1954
|
+
if (desc) {
|
|
1955
|
+
lines.push("");
|
|
1956
|
+
lines.push(`> ${desc}`);
|
|
1957
|
+
}
|
|
1958
|
+
lines.push("");
|
|
1959
|
+
lines.push(`Source: ${url}`);
|
|
1960
|
+
lines.push("");
|
|
1961
|
+
lines.push(entry.body.trim());
|
|
1962
|
+
lines.push("");
|
|
1963
|
+
lines.push("---");
|
|
1964
|
+
lines.push("");
|
|
1965
|
+
}
|
|
1966
|
+
}
|
|
1967
|
+
return lines.join("\n");
|
|
1968
|
+
}
|
|
1969
|
+
function generateEntryMarkdown(entry) {
|
|
1970
|
+
const title = getEntryTitle(entry);
|
|
1971
|
+
const desc = getEntryDescription(entry);
|
|
1972
|
+
const lines = [];
|
|
1973
|
+
lines.push(`# ${title}`);
|
|
1974
|
+
if (desc) {
|
|
1975
|
+
lines.push("");
|
|
1976
|
+
lines.push(`> ${desc}`);
|
|
1977
|
+
}
|
|
1978
|
+
lines.push("");
|
|
1979
|
+
lines.push(entry.body.trim());
|
|
1980
|
+
lines.push("");
|
|
1981
|
+
return lines.join("\n");
|
|
1982
|
+
}
|
|
1983
|
+
/**
|
|
1984
|
+
* LLMs plugin for SSG.
|
|
1985
|
+
*
|
|
1986
|
+
* Generates `llms.txt`, `llms-full.txt`, and per-page `.md` files
|
|
1987
|
+
* following the llms.txt specification, making your site easily
|
|
1988
|
+
* consumable by LLMs and AI agents.
|
|
1989
|
+
*
|
|
1990
|
+
* @see https://llmstxt.org/
|
|
1991
|
+
*
|
|
1992
|
+
* @example
|
|
1993
|
+
* ```tsx
|
|
1994
|
+
* import { createSSG } from "@semajsx/ssg";
|
|
1995
|
+
* import { llms } from "@semajsx/ssg/plugins/llms";
|
|
1996
|
+
*
|
|
1997
|
+
* const ssg = createSSG({
|
|
1998
|
+
* outDir: "./dist",
|
|
1999
|
+
* plugins: [
|
|
2000
|
+
* llms({
|
|
2001
|
+
* title: "My Project",
|
|
2002
|
+
* description: "Documentation for My Project",
|
|
2003
|
+
* url: "https://docs.myproject.com",
|
|
2004
|
+
* sections: [
|
|
2005
|
+
* { title: "Documentation", collection: "docs", basePath: "/docs" },
|
|
2006
|
+
* ],
|
|
2007
|
+
* }),
|
|
2008
|
+
* ],
|
|
2009
|
+
* });
|
|
2010
|
+
* ```
|
|
2011
|
+
*/
|
|
2012
|
+
function llms(options) {
|
|
2013
|
+
let outDir = "";
|
|
2014
|
+
return {
|
|
2015
|
+
name: "llms",
|
|
2016
|
+
enforce: "post",
|
|
2017
|
+
configResolved(config) {
|
|
2018
|
+
outDir = config.outDir ?? "./dist";
|
|
2019
|
+
},
|
|
2020
|
+
async buildEnd(_result, ssg) {
|
|
2021
|
+
const genLlmsTxt = options.llmsTxt !== false;
|
|
2022
|
+
const genLlmsFullTxt = options.llmsFullTxt !== false;
|
|
2023
|
+
const genMarkdownPages = options.markdownPages !== false;
|
|
2024
|
+
const sectionEntries = /* @__PURE__ */ new Map();
|
|
2025
|
+
for (const section of options.sections ?? []) try {
|
|
2026
|
+
const entries = await ssg.getCollection(section.collection);
|
|
2027
|
+
sectionEntries.set(section.collection, entries);
|
|
2028
|
+
} catch {
|
|
2029
|
+
sectionEntries.set(section.collection, []);
|
|
2030
|
+
}
|
|
2031
|
+
await mkdir(outDir, { recursive: true });
|
|
2032
|
+
if (genLlmsTxt) {
|
|
2033
|
+
const content = generateLlmsTxt(options, sectionEntries);
|
|
2034
|
+
await writeFile(join(outDir, "llms.txt"), content, "utf-8");
|
|
2035
|
+
}
|
|
2036
|
+
if (genLlmsFullTxt) {
|
|
2037
|
+
const content = generateLlmsFullTxt(options, sectionEntries);
|
|
2038
|
+
await writeFile(join(outDir, "llms-full.txt"), content, "utf-8");
|
|
2039
|
+
}
|
|
2040
|
+
if (genMarkdownPages) for (const section of options.sections ?? []) {
|
|
2041
|
+
const basePath = normalizePath(section.basePath);
|
|
2042
|
+
const entries = sectionEntries.get(section.collection) ?? [];
|
|
2043
|
+
for (const entry of entries) {
|
|
2044
|
+
const mdPath = `${basePath}/${entry.slug}.md`;
|
|
2045
|
+
const fullPath = join(outDir, mdPath.slice(1));
|
|
2046
|
+
const content = generateEntryMarkdown(entry);
|
|
2047
|
+
await mkdir(dirname(fullPath), { recursive: true });
|
|
2048
|
+
await writeFile(fullPath, content, "utf-8");
|
|
2049
|
+
}
|
|
2050
|
+
}
|
|
2051
|
+
}
|
|
2052
|
+
};
|
|
2053
|
+
}
|
|
2054
|
+
|
|
1870
2055
|
//#endregion
|
|
1871
2056
|
//#region ../ssg/src/plugins/docs-theme/index.ts
|
|
1872
2057
|
const docsSchema = z.object({
|
|
@@ -2034,6 +2219,31 @@ function docsTheme(options) {
|
|
|
2034
2219
|
const lucideOpts = typeof options.lucide === "object" ? options.lucide : {};
|
|
2035
2220
|
plugins.push(lucide(lucideOpts));
|
|
2036
2221
|
}
|
|
2222
|
+
const hasContent = options.docs || options.guides;
|
|
2223
|
+
if (options.llms !== false && hasContent) {
|
|
2224
|
+
const llmsOpts = typeof options.llms === "object" ? options.llms : {};
|
|
2225
|
+
const sections = [];
|
|
2226
|
+
if (options.docs) sections.push({
|
|
2227
|
+
title: options.docs.heading ?? "Documentation",
|
|
2228
|
+
collection: "docs",
|
|
2229
|
+
basePath: docsBasePath
|
|
2230
|
+
});
|
|
2231
|
+
if (options.guides) sections.push({
|
|
2232
|
+
title: options.guides.heading ?? "Guides",
|
|
2233
|
+
collection: "guides",
|
|
2234
|
+
basePath: guidesBasePath
|
|
2235
|
+
});
|
|
2236
|
+
plugins.push(llms({
|
|
2237
|
+
title: options.title,
|
|
2238
|
+
description: options.description,
|
|
2239
|
+
url: llmsOpts.url,
|
|
2240
|
+
sections,
|
|
2241
|
+
links: llmsOpts.links,
|
|
2242
|
+
llmsTxt: llmsOpts.llmsTxt,
|
|
2243
|
+
llmsFullTxt: llmsOpts.llmsFullTxt,
|
|
2244
|
+
markdownPages: llmsOpts.markdownPages
|
|
2245
|
+
}));
|
|
2246
|
+
}
|
|
2037
2247
|
return plugins;
|
|
2038
2248
|
}
|
|
2039
2249
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"docs-theme.mjs","names":["c","root","icon","styles.root","styles.title","styles.icon","styles.content","c","root","styles.root","c","root","icon","styles.icon","styles.heading","styles.headingLink","styles.desc","styles.descLink","styles.root","styles.link","styles.linkStates","styles.feature","styles.featureStates","c","root","buttonStyles","cardStyles","calloutStyles","badgeStyles","codeBlockStyles","lucidePlugin"],"sources":["../../../../ssg/src/plugins/docs-theme/styles.ts","../../../../ui/src/theme/tokens.ts","../../../../ui/src/components/callout/callout.style.ts","../../../../ui/src/components/callout/callout.tsx","../../../../ui/src/components/badge/badge.style.ts","../../../../ui/src/components/badge/badge.tsx","../../../../ui/src/components/card/card.style.ts","../../../../ui/src/components/card/card.tsx","../../../../ui/src/theme/themes.ts","../../../../ui/src/components/button/button.style.ts","../../../../ui/src/components/code-block/code-block.style.ts","../../../../ui/src/css.ts","../../../../ssg/src/plugins/docs-theme/components.tsx","../../../../ssg/src/plugins/docs-theme/index.ts"],"sourcesContent":["/**\n * Apple-inspired theme CSS for the docs-theme plugin.\n *\n * All class names are prefixed with `dt-` to avoid collisions.\n * Component styles (Card, Callout, Badge) come from @semajsx/ui via componentCSS.\n * This file contains layout, navigation, hero, typography, animations, and responsive styles.\n */\n\nexport const THEME_CSS = /* css */ `\n/* ==============================================\n * Keyframes\n * ============================================== */\n\n@keyframes dt-fade-in-up {\n from { opacity: 0; transform: translateY(20px); }\n to { opacity: 1; transform: translateY(0); }\n}\n\n@keyframes dt-fade-in-scale {\n from { opacity: 0; transform: scale(0.96) translateY(8px); }\n to { opacity: 1; transform: scale(1) translateY(0); }\n}\n\n/* ==============================================\n * Global Reset & Base\n * ============================================== */\n\n* { margin: 0; padding: 0; box-sizing: border-box; }\n\nhtml { scroll-behavior: smooth; }\n\nbody {\n font-family: -apple-system, BlinkMacSystemFont, \"SF Pro Display\", \"SF Pro Text\",\n Inter, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, sans-serif;\n line-height: 1.6;\n color: #1d1d1f;\n background: #fbfbfd;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n text-rendering: optimizeLegibility;\n}\n\n::selection {\n background: rgba(0, 113, 227, 0.2);\n color: #1d1d1f;\n}\n\n/* ==============================================\n * Frosted Glass Navigation\n * ============================================== */\n\n.dt-glass-nav {\n position: sticky;\n top: 0;\n z-index: 50;\n background: rgba(251, 251, 253, 0.8);\n backdrop-filter: saturate(180%) blur(20px);\n -webkit-backdrop-filter: saturate(180%) blur(20px);\n border-bottom: 0.5px solid rgba(0, 0, 0, 0.08);\n}\n\n.dt-nav-inner {\n max-width: 1200px;\n margin: 0 auto;\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 14px 2rem;\n height: 52px;\n}\n\n.dt-nav-logo {\n color: #1d1d1f;\n font-size: 1.25rem;\n font-weight: 600;\n letter-spacing: -0.02em;\n text-decoration: none;\n}\n\n.dt-nav-links {\n display: flex;\n list-style: none;\n margin: 0;\n gap: 2rem;\n}\n\n.dt-nav-link {\n color: #1d1d1f;\n text-decoration: none;\n font-size: 0.875rem;\n font-weight: 400;\n letter-spacing: -0.005em;\n transition: color 0.2s ease;\n}\n\n.dt-nav-link:hover {\n color: #0071e3;\n}\n\n/* ==============================================\n * Layout\n * ============================================== */\n\n.dt-root {\n display: flex;\n flex-direction: column;\n min-height: 100vh;\n background: #fbfbfd;\n}\n\n.dt-main {\n flex: 1 1 0%;\n width: 100%;\n max-width: 1200px;\n margin: 0 auto;\n padding: 2rem 2rem 4rem;\n}\n\n/* ==============================================\n * Footer\n * ============================================== */\n\n.dt-footer {\n border-top: 0.5px solid rgba(0, 0, 0, 0.08);\n background: #f5f5f7;\n}\n\n.dt-footer-inner {\n max-width: 1200px;\n margin: 0 auto;\n padding: 2rem;\n display: flex;\n justify-content: space-between;\n align-items: center;\n flex-wrap: wrap;\n gap: 1rem;\n}\n\n.dt-footer-links {\n display: flex;\n gap: 2rem;\n align-items: center;\n}\n\n.dt-footer-link {\n color: #6e6e73;\n text-decoration: none;\n font-size: 0.8125rem;\n transition: color 0.2s;\n}\n\n.dt-footer-link:hover {\n color: #0071e3;\n}\n\n.dt-footer-copy {\n color: #86868b;\n font-size: 0.8125rem;\n margin: 0;\n}\n\n/* ==============================================\n * Hero Section\n * ============================================== */\n\n.dt-hero-bg {\n background: linear-gradient(180deg, #fbfbfd 0%, #f5f5f7 40%, #fbfbfd 100%);\n position: relative;\n}\n\n.dt-hero-bg::before {\n content: \"\";\n position: absolute;\n top: 0;\n left: 50%;\n transform: translateX(-50%);\n width: 100%;\n height: 100%;\n background: radial-gradient(\n ellipse 60% 50% at 50% 40%,\n rgba(0, 113, 227, 0.06) 0%,\n rgba(251, 251, 253, 0) 70%\n );\n pointer-events: none;\n}\n\n.dt-hero-title {\n font-size: clamp(3rem, 8vw, 5rem);\n font-weight: 700;\n line-height: 1.05;\n letter-spacing: -0.03em;\n background: linear-gradient(135deg, #1d1d1f 30%, #6e6e73 100%);\n -webkit-background-clip: text;\n -webkit-text-fill-color: transparent;\n background-clip: text;\n margin-bottom: 1.25rem;\n}\n\n.dt-hero-subtitle {\n font-size: clamp(1.25rem, 2.5vw, 1.5rem);\n font-weight: 400;\n line-height: 1.5;\n color: #6e6e73;\n max-width: 40rem;\n margin: 0 auto 2.5rem;\n letter-spacing: -0.005em;\n}\n\n.dt-hero-cta {\n display: flex;\n gap: 1rem;\n justify-content: center;\n margin-top: 2rem;\n}\n\n/* ==============================================\n * Section Typography\n * ============================================== */\n\n.dt-section-title {\n font-size: clamp(2rem, 4vw, 2.75rem);\n font-weight: 700;\n letter-spacing: -0.02em;\n line-height: 1.1;\n color: #1d1d1f;\n margin-bottom: 0.75rem;\n}\n\n.dt-section-subtitle {\n font-size: clamp(1rem, 2vw, 1.25rem);\n font-weight: 400;\n line-height: 1.5;\n color: #6e6e73;\n max-width: 36rem;\n margin: 0 auto 3rem;\n}\n\n/* ==============================================\n * Buttons\n * ============================================== */\n\n.dt-primary-btn {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n padding: 0.875rem 1.75rem;\n background: #0071e3;\n color: white;\n border-radius: 980px;\n font-size: 1.0625rem;\n font-weight: 500;\n text-decoration: none;\n transition: all 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);\n border: none;\n cursor: pointer;\n letter-spacing: -0.005em;\n}\n\n.dt-primary-btn:hover {\n background: #0077ed;\n transform: scale(1.02);\n box-shadow: 0 4px 16px rgba(0, 113, 227, 0.3);\n}\n\n.dt-secondary-btn {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n padding: 0.875rem 1.75rem;\n background: transparent;\n color: #0071e3;\n border: 1.5px solid #0071e3;\n border-radius: 980px;\n font-size: 1.0625rem;\n font-weight: 500;\n text-decoration: none;\n transition: all 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);\n cursor: pointer;\n letter-spacing: -0.005em;\n}\n\n.dt-secondary-btn:hover {\n background: #0071e3;\n color: white;\n transform: scale(1.02);\n}\n\n/* ==============================================\n * Animations\n * ============================================== */\n\n.dt-anim-slide-up {\n animation: dt-fade-in-up 0.8s cubic-bezier(0.25, 0.1, 0.25, 1) both;\n}\n\n.dt-anim-scale-in {\n animation: dt-fade-in-scale 0.6s cubic-bezier(0.25, 0.1, 0.25, 1) both;\n}\n\n.dt-fade-in {\n animation: dt-fade-in-up 0.6s cubic-bezier(0.25, 0.1, 0.25, 1) both;\n}\n\n.dt-stagger-1 { animation-delay: 0.1s; }\n.dt-stagger-2 { animation-delay: 0.2s; }\n.dt-stagger-3 { animation-delay: 0.35s; }\n.dt-stagger-4 { animation-delay: 0.5s; }\n.dt-stagger-5 { animation-delay: 0.65s; }\n\n/* ==============================================\n * Page Layout\n * ============================================== */\n\n.dt-page-container {\n max-width: 720px;\n}\n\n.dt-page-title {\n font-size: 2.25rem;\n font-weight: 700;\n color: #1d1d1f;\n letter-spacing: -0.02em;\n margin-bottom: 0.5rem;\n}\n\n.dt-page-desc {\n font-size: 1.125rem;\n color: #6e6e73;\n line-height: 1.5;\n}\n\n.dt-category-heading {\n font-size: 0.8125rem;\n font-weight: 600;\n color: #86868b;\n text-transform: uppercase;\n letter-spacing: 0.06em;\n margin-bottom: 1rem;\n}\n\n.dt-card-title {\n font-size: 1.0625rem;\n font-weight: 600;\n color: #1d1d1f;\n letter-spacing: -0.01em;\n margin-bottom: 0.25rem;\n}\n\n.dt-card-desc {\n color: #6e6e73;\n font-size: 0.875rem;\n line-height: 1.5;\n margin: 0;\n}\n\n.dt-content-desc {\n font-size: 1.125rem;\n color: #6e6e73;\n line-height: 1.5;\n padding-bottom: 1.5rem;\n border-bottom: 0.5px solid rgba(0, 0, 0, 0.06);\n}\n\n/* ==============================================\n * Content Typography\n * ============================================== */\n\n.dt-content {\n line-height: 1.75;\n color: #1d1d1f;\n}\n\n.dt-content h1 {\n font-size: 1.875rem;\n font-weight: 700;\n margin-top: 3rem;\n margin-bottom: 0.75rem;\n color: #1d1d1f;\n letter-spacing: -0.02em;\n line-height: 1.2;\n}\n\n.dt-content h2 {\n font-size: 1.5rem;\n font-weight: 600;\n margin-top: 2.5rem;\n margin-bottom: 0.75rem;\n color: #1d1d1f;\n letter-spacing: -0.015em;\n line-height: 1.25;\n padding-top: 1.5rem;\n border-top: 0.5px solid rgba(0, 0, 0, 0.06);\n}\n\n.dt-content h2:first-child,\n.dt-content hr + h2 {\n border-top: none;\n padding-top: 0;\n margin-top: 0;\n}\n\n.dt-content h3 {\n font-size: 1.25rem;\n font-weight: 600;\n margin-top: 2rem;\n margin-bottom: 0.5rem;\n color: #1d1d1f;\n letter-spacing: -0.01em;\n line-height: 1.3;\n}\n\n.dt-content p {\n margin-bottom: 1.25rem;\n font-size: 1rem;\n color: #1d1d1f;\n}\n\n.dt-content ul,\n.dt-content ol {\n margin-left: 1.5rem;\n margin-bottom: 1.25rem;\n}\n\n.dt-content li {\n margin-bottom: 0.375rem;\n font-size: 1rem;\n line-height: 1.65;\n}\n\n.dt-content code {\n background: rgba(0, 0, 0, 0.04);\n padding: 0.15rem 0.4rem;\n border-radius: 5px;\n font-family: \"SF Mono\", \"Fira Code\", \"Fira Mono\", Menlo, Consolas, \"DejaVu Sans Mono\", monospace;\n font-size: 0.875em;\n color: #1d1d1f;\n border: 0.5px solid rgba(0, 0, 0, 0.06);\n}\n\n.dt-content pre {\n background: #1d1d1f;\n color: #e5e5ea;\n padding: 1.25rem 1.5rem;\n border-radius: 12px;\n overflow-x: auto;\n margin-bottom: 1.25rem;\n font-size: 0.875rem;\n line-height: 1.65;\n border: 0.5px solid rgba(0, 0, 0, 0.1);\n}\n\n.dt-content pre code {\n background: none;\n color: inherit;\n padding: 0;\n border: none;\n font-size: inherit;\n}\n\n.dt-content a {\n color: #0071e3;\n text-decoration: none;\n transition: color 0.2s ease;\n}\n\n.dt-content a:hover {\n text-decoration: underline;\n}\n\n.dt-content strong {\n font-weight: 600;\n color: #1d1d1f;\n}\n\n.dt-content blockquote {\n border-left: 3px solid rgba(0, 0, 0, 0.08);\n padding: 0.75rem 1.25rem;\n margin: 1.5rem 0;\n color: #6e6e73;\n background: rgba(0, 0, 0, 0.02);\n border-radius: 0 10px 10px 0;\n}\n\n.dt-content hr {\n border: none;\n border-top: 0.5px solid rgba(0, 0, 0, 0.06);\n margin: 2.5rem 0;\n}\n\n/* Tables */\n\n.dt-content table {\n width: 100%;\n border-collapse: collapse;\n margin: 1.5rem 0;\n font-size: 0.9375rem;\n line-height: 1.5;\n border-radius: 10px;\n overflow: hidden;\n border: 0.5px solid rgba(0, 0, 0, 0.08);\n}\n\n.dt-content thead {\n background: rgba(0, 0, 0, 0.03);\n}\n\n.dt-content th {\n font-weight: 600;\n color: #1d1d1f;\n text-align: left;\n padding: 0.75rem 1rem;\n font-size: 0.8125rem;\n text-transform: uppercase;\n letter-spacing: 0.03em;\n border-bottom: 0.5px solid rgba(0, 0, 0, 0.08);\n}\n\n.dt-content td {\n padding: 0.75rem 1rem;\n color: #1d1d1f;\n border-bottom: 0.5px solid rgba(0, 0, 0, 0.04);\n}\n\n.dt-content tbody tr:last-child td {\n border-bottom: none;\n}\n\n.dt-content tbody tr:hover {\n background: rgba(0, 0, 0, 0.02);\n}\n\n/* ==============================================\n * Code Blocks\n * ============================================== */\n\n.dt-code-block {\n margin: 1.5rem 0;\n border-radius: 12px;\n overflow: hidden;\n border: 0.5px solid rgba(0, 0, 0, 0.1);\n}\n\n.dt-code-header {\n background: #161617;\n padding: 0.5rem 1.25rem;\n display: flex;\n justify-content: space-between;\n align-items: center;\n}\n\n.dt-code-lang {\n color: #86868b;\n font-size: 0.6875rem;\n text-transform: uppercase;\n font-weight: 600;\n letter-spacing: 0.04em;\n}\n\n.dt-code-block pre {\n margin: 0;\n border-radius: 0;\n border: none;\n}\n\n.dt-code-header + pre {\n border-radius: 0;\n}\n\n/* Shiki integration */\n\n.dt-content pre.shiki {\n position: relative;\n padding: 2.25rem 1.5rem 1.25rem;\n}\n\n.dt-content pre.shiki[data-language]::before {\n content: attr(data-language);\n position: absolute;\n top: 0.625rem;\n right: 1rem;\n color: #636e7b;\n font-size: 0.6875rem;\n text-transform: uppercase;\n font-weight: 600;\n letter-spacing: 0.04em;\n pointer-events: none;\n user-select: none;\n}\n\n.dt-content pre.shiki code {\n display: block;\n}\n\n.dt-content pre.shiki .line {\n display: inline;\n}\n\n/* ==============================================\n * 404 Page\n * ============================================== */\n\n.dt-not-found-title {\n font-size: clamp(4rem, 12vw, 8rem);\n font-weight: 700;\n line-height: 1;\n letter-spacing: -0.04em;\n background: linear-gradient(135deg, #1d1d1f 30%, #6e6e73 100%);\n -webkit-background-clip: text;\n -webkit-text-fill-color: transparent;\n background-clip: text;\n margin-bottom: 1.25rem;\n}\n\n/* ==============================================\n * Responsive\n * ============================================== */\n\n@media (max-width: 768px) {\n .dt-nav-inner {\n padding: 12px 1rem !important;\n height: 48px !important;\n }\n\n .dt-nav-logo { font-size: 1.125rem !important; }\n .dt-nav-links { gap: 1.25rem !important; }\n .dt-nav-link { font-size: 0.8125rem; }\n\n .dt-main {\n padding: 1.25rem 1rem 2.5rem !important;\n }\n\n .dt-hero-section {\n padding: 60px 16px 48px !important;\n }\n\n .dt-hero-cta {\n flex-direction: column !important;\n align-items: center !important;\n gap: 0.75rem !important;\n }\n\n .dt-section-features {\n padding: 48px 16px !important;\n }\n\n .dt-section-links {\n padding: 0 16px 60px !important;\n }\n\n .dt-section-links-inner {\n padding-top: 48px !important;\n }\n\n .dt-features-grid {\n grid-template-columns: 1fr !important;\n gap: 1rem !important;\n }\n\n .dt-links-grid {\n grid-template-columns: 1fr !important;\n }\n\n .dt-page-title {\n font-size: 1.75rem !important;\n }\n\n .dt-page-desc {\n font-size: 1rem !important;\n }\n\n .dt-page-container {\n max-width: 100%;\n }\n\n .dt-footer-inner {\n flex-direction: column !important;\n align-items: center !important;\n text-align: center;\n padding: 1.5rem 1rem !important;\n }\n\n .dt-footer-links {\n justify-content: center !important;\n gap: 1.5rem !important;\n }\n\n .dt-not-found-section {\n padding: 60px 16px 48px !important;\n }\n\n .dt-not-found-cta {\n flex-direction: column !important;\n align-items: center !important;\n gap: 0.75rem !important;\n }\n\n .dt-content { line-height: 1.7; }\n .dt-content h1 { font-size: 1.5rem; margin-top: 2rem; }\n .dt-content h2 { font-size: 1.25rem; margin-top: 2rem; padding-top: 1.25rem; }\n .dt-content h3 { font-size: 1.125rem; margin-top: 1.5rem; }\n .dt-content pre { padding: 1rem; font-size: 0.8125rem; border-radius: 10px; }\n .dt-content ul, .dt-content ol { margin-left: 1.25rem; }\n\n .dt-content table {\n font-size: 0.8125rem;\n display: block;\n overflow-x: auto;\n -webkit-overflow-scrolling: touch;\n }\n\n .dt-content th, .dt-content td { padding: 0.625rem 0.75rem; }\n\n .dt-code-block { border-radius: 10px; }\n .dt-code-header { padding: 0.375rem 1rem; }\n\n}\n`;\n","/**\n * Default design tokens for @semajsx/ui\n *\n * These tokens define the visual language of the component library.\n * All components reference these tokens via CSS custom properties,\n * enabling runtime theme switching.\n *\n * @example\n * ```ts\n * import { tokens } from \"@semajsx/ui/theme\";\n *\n * // Use in custom styles\n * const myRule = rule`${c.box} {\n * color: ${tokens.colors.text};\n * padding: ${tokens.space.md};\n * }`;\n * ```\n */\n\nimport { defineTokens } from \"@semajsx/style\";\nimport type { TokenRefs } from \"@semajsx/style\";\n\nconst tokenDefinition = {\n colors: {\n // Brand (Apple blue)\n primary: \"#0071e3\",\n primaryHover: \"#0077ed\",\n primaryActive: \"#0068d6\",\n\n // Neutral\n background: \"#fbfbfd\",\n surface: \"#f5f5f7\",\n border: \"rgba(0, 0, 0, 0.08)\",\n text: \"#1d1d1f\",\n textMuted: \"#6e6e73\",\n textTertiary: \"#86868b\",\n\n // Semantic\n danger: \"#ff453a\",\n dangerHover: \"#ff6961\",\n success: \"#34c759\",\n warning: \"#ff9f0a\",\n info: \"#007aff\",\n tip: \"#af52de\",\n\n // Inverse (for solid buttons, etc.)\n onPrimary: \"#ffffff\",\n onDanger: \"#ffffff\",\n },\n\n space: {\n xs: \"0.25rem\",\n sm: \"0.5rem\",\n md: \"0.75rem\",\n lg: \"1rem\",\n xl: \"1.5rem\",\n xxl: \"2rem\",\n },\n\n radii: {\n sm: \"10px\",\n md: \"12px\",\n lg: \"16px\",\n xl: \"20px\",\n pill: \"980px\",\n },\n\n fonts: {\n base: '-apple-system, BlinkMacSystemFont, \"SF Pro Display\", \"SF Pro Text\", Inter, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, sans-serif',\n mono: '\"SF Mono\", \"Fira Code\", \"Fira Mono\", Menlo, Consolas, \"DejaVu Sans Mono\", monospace',\n },\n\n fontSizes: {\n xs: \"0.8125rem\",\n sm: \"0.875rem\",\n md: \"1rem\",\n lg: \"1.0625rem\",\n },\n\n fontWeights: {\n normal: \"400\",\n medium: \"500\",\n semibold: \"600\",\n bold: \"700\",\n },\n\n lineHeights: {\n tight: \"1.25\",\n normal: \"1.6\",\n },\n\n shadows: {\n sm: \"0 1px 3px rgba(0, 0, 0, 0.03)\",\n md: \"0 1px 4px rgba(0, 0, 0, 0.04)\",\n lg: \"0 8px 28px rgba(0, 0, 0, 0.08)\",\n primaryGlow: \"0 4px 16px rgba(0, 113, 227, 0.3)\",\n },\n\n transitions: {\n fast: \"0.2s ease\",\n normal: \"0.3s cubic-bezier(0.25, 0.1, 0.25, 1)\",\n },\n} as const;\n\nexport const tokens: TokenRefs<typeof tokenDefinition> = defineTokens(tokenDefinition);\n","/**\n * Callout component styles\n *\n * Five semantic variants: info, warning, success, error, tip\n * Matching the docs site callout design.\n */\n\nimport { classes, rule } from \"@semajsx/style\";\nimport { tokens } from \"../../theme/tokens\";\n\nconst c = classes([\"root\", \"title\", \"icon\", \"content\"] as const);\n\n// --- Base ---\n\nexport const root = rule`${c.root} {\n padding: 1.25rem 1.5rem;\n margin: 1.5rem 0;\n border-radius: 14px;\n border: 0.5px solid rgba(0, 0, 0, 0.04);\n font-family: ${tokens.fonts.base};\n}`;\n\nexport const title = rule`${c.title} {\n font-weight: ${tokens.fontWeights.semibold};\n font-size: 0.9375rem;\n margin: 0 0 0.5rem;\n display: flex;\n align-items: center;\n gap: ${tokens.space.sm};\n letter-spacing: -0.005em;\n}`;\n\nexport const icon = rule`${c.icon} {\n width: 18px;\n height: 18px;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n}`;\n\nexport const content = rule`${c.content} {\n color: ${tokens.colors.text};\n font-size: 0.9375rem;\n line-height: ${tokens.lineHeights.normal};\n}`;\n","/** @jsxImportSource @semajsx/dom */\n\n/**\n * Callout component\n *\n * A styled box for highlighting important content with semantic variants.\n *\n * @example\n * ```tsx\n * import { Callout } from \"@semajsx/ui/callout\";\n *\n * <Callout type=\"info\" title=\"Note\">This is informational.</Callout>\n * <Callout type=\"warning\">Be careful with this.</Callout>\n * <Callout type=\"tip\" title=\"Pro tip\">Use signals for reactivity.</Callout>\n * ```\n */\n\nimport type { JSXNode, VNode } from \"@semajsx/core\";\nimport type { StyleToken } from \"@semajsx/style\";\nimport * as styles from \"./callout.style\";\n\ntype ClassValue = string | StyleToken | ClassValue[] | false | null | undefined;\n\nexport type CalloutType = \"info\" | \"warning\" | \"success\" | \"error\" | \"tip\";\n\nexport interface CalloutProps {\n /** Semantic type controlling color and icon */\n type?: CalloutType;\n /** Optional title displayed above content */\n title?: string;\n /** Additional CSS class(es) */\n class?: ClassValue;\n /** Content */\n children?: JSXNode;\n}\n\nconst SVG_ATTRS = {\n xmlns: \"http://www.w3.org/2000/svg\",\n width: \"18\",\n height: \"18\",\n viewBox: \"0 0 24 24\",\n fill: \"none\",\n stroke: \"currentColor\",\n \"stroke-width\": \"2\",\n \"stroke-linecap\": \"round\",\n \"stroke-linejoin\": \"round\",\n};\n\nfunction InfoIcon(): VNode {\n return (\n <svg {...SVG_ATTRS}>\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"M12 16v-4\" />\n <path d=\"M12 8h.01\" />\n </svg>\n );\n}\n\nfunction WarningIcon(): VNode {\n return (\n <svg {...SVG_ATTRS}>\n <path d=\"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z\" />\n <path d=\"M12 9v4\" />\n <path d=\"M12 17h.01\" />\n </svg>\n );\n}\n\nfunction SuccessIcon(): VNode {\n return (\n <svg {...SVG_ATTRS}>\n <path d=\"M22 11.08V12a10 10 0 1 1-5.93-9.14\" />\n <path d=\"m9 11 3 3L22 4\" />\n </svg>\n );\n}\n\nfunction ErrorIcon(): VNode {\n return (\n <svg {...SVG_ATTRS}>\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"m15 9-6 6\" />\n <path d=\"m9 9 6 6\" />\n </svg>\n );\n}\n\nfunction TipIcon(): VNode {\n return (\n <svg {...SVG_ATTRS}>\n <path d=\"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5\" />\n <path d=\"M9 18h6\" />\n <path d=\"M10 22h4\" />\n </svg>\n );\n}\n\nconst calloutConfig: Record<CalloutType, { bg: string; accent: string; icon: () => VNode }> = {\n info: { bg: \"rgba(0, 122, 255, 0.06)\", accent: \"#007aff\", icon: InfoIcon },\n warning: { bg: \"rgba(255, 159, 10, 0.08)\", accent: \"#ff9f0a\", icon: WarningIcon },\n success: { bg: \"rgba(52, 199, 89, 0.08)\", accent: \"#34c759\", icon: SuccessIcon },\n error: { bg: \"rgba(255, 69, 58, 0.08)\", accent: \"#ff453a\", icon: ErrorIcon },\n tip: { bg: \"rgba(175, 82, 222, 0.06)\", accent: \"#af52de\", icon: TipIcon },\n};\n\nexport function Callout(props: CalloutProps): JSXNode {\n const type = props.type ?? \"info\";\n const config = calloutConfig[type];\n const IconComponent = config.icon;\n\n return (\n <div class={[styles.root, props.class]} style={`background: ${config.bg}`} role=\"note\">\n {props.title && (\n <div class={styles.title} style={`color: ${config.accent}`}>\n <span class={styles.icon}>\n <IconComponent />\n </span>\n {props.title}\n </div>\n )}\n <div class={styles.content}>{props.children}</div>\n </div>\n );\n}\n","/**\n * Badge component styles\n *\n * Pill-shaped labels with semantic color variants.\n */\n\nimport { classes, rule } from \"@semajsx/style\";\nimport { tokens } from \"../../theme/tokens\";\n\nconst c = classes([\"root\"] as const);\n\nexport const root = rule`${c.root} {\n display: inline-flex;\n align-items: center;\n font-size: 0.6875rem;\n font-weight: ${tokens.fontWeights.semibold};\n font-family: ${tokens.fonts.base};\n padding: 0.125rem 0.5rem;\n border-radius: ${tokens.radii.pill};\n letter-spacing: 0.02em;\n text-transform: uppercase;\n white-space: nowrap;\n line-height: 1.6;\n}`;\n","/** @jsxImportSource @semajsx/dom */\n\n/**\n * Badge component\n *\n * A small pill-shaped label for status, category, or metadata.\n *\n * @example\n * ```tsx\n * import { Badge } from \"@semajsx/ui/badge\";\n *\n * <Badge color=\"success\">Beginner</Badge>\n * <Badge color=\"warning\">Intermediate</Badge>\n * <Badge color=\"danger\">Advanced</Badge>\n * <Badge>Default</Badge>\n * ```\n */\n\nimport type { JSXNode } from \"@semajsx/core\";\nimport type { StyleToken } from \"@semajsx/style\";\nimport * as styles from \"./badge.style\";\n\ntype ClassValue = string | StyleToken | ClassValue[] | false | null | undefined;\n\nexport type BadgeColor = \"default\" | \"success\" | \"warning\" | \"danger\" | \"info\" | \"tip\";\n\nexport interface BadgeProps {\n /** Semantic color */\n color?: BadgeColor;\n /** Additional CSS class(es) */\n class?: ClassValue;\n /** Content */\n children?: JSXNode;\n}\n\nconst badgeColors: Record<BadgeColor, { bg: string; fg: string }> = {\n default: { bg: \"rgba(0, 0, 0, 0.06)\", fg: \"#1d1d1f\" },\n success: { bg: \"rgba(52, 199, 89, 0.12)\", fg: \"#248a3d\" },\n warning: { bg: \"rgba(255, 159, 10, 0.12)\", fg: \"#b25000\" },\n danger: { bg: \"rgba(255, 69, 58, 0.12)\", fg: \"#d70015\" },\n info: { bg: \"rgba(0, 122, 255, 0.1)\", fg: \"#0055b3\" },\n tip: { bg: \"rgba(175, 82, 222, 0.1)\", fg: \"#8944ab\" },\n};\n\nexport function Badge(props: BadgeProps): JSXNode {\n const color = props.color ?? \"default\";\n const config = badgeColors[color];\n\n return (\n <span\n class={[styles.root, props.class]}\n style={`background: ${config.bg}; color: ${config.fg}`}\n >\n {props.children}\n </span>\n );\n}\n","/**\n * Card component styles\n *\n * Two variants matching the docs site design:\n * - feature: Large card with icon, heading, description\n * - link: Smaller clickable card for navigation\n */\n\nimport { classes, rule, rules } from \"@semajsx/style\";\nimport { tokens } from \"../../theme/tokens\";\n\nconst c = classes([\"root\", \"feature\", \"link\", \"icon\", \"heading\", \"desc\"] as const);\n\n// --- Base ---\n\nexport const root = rule`${c.root} {\n background: white;\n border: 0.5px solid rgba(0, 0, 0, 0.06);\n font-family: ${tokens.fonts.base};\n transition: all 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);\n}`;\n\n// --- Feature variant ---\n\nexport const feature = rule`${c.feature} {\n border-radius: ${tokens.radii.xl};\n padding: 2.5rem;\n box-shadow: ${tokens.shadows.md};\n}`;\n\nexport const featureStates = rule`${c.feature}:hover {\n transform: translateY(-4px) scale(1.01);\n box-shadow: ${tokens.shadows.lg};\n}`;\n\n// --- Link variant ---\n\nexport const link = rule`${c.link} {\n display: block;\n border-radius: ${tokens.radii.lg};\n padding: 1.75rem;\n box-shadow: ${tokens.shadows.sm};\n text-decoration: none;\n cursor: pointer;\n}`;\n\nexport const linkStates = rules(\n rule`${c.link}:hover {\n border-color: rgba(0, 113, 227, 0.3);\n box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);\n transform: translateY(-2px);\n }`,\n);\n\n// --- Slots ---\n\nexport const icon = rule`${c.icon} {\n font-size: 2rem;\n width: 48px;\n height: 48px;\n display: flex;\n align-items: center;\n justify-content: center;\n background: ${tokens.colors.surface};\n border-radius: ${tokens.radii.md};\n margin-bottom: 1.25rem;\n}`;\n\nexport const heading = rule`${c.heading} {\n font-size: 1.375rem;\n font-weight: ${tokens.fontWeights.semibold};\n color: ${tokens.colors.text};\n margin: 0 0 0.5rem;\n letter-spacing: -0.01em;\n}`;\n\nexport const headingLink = rule`${c.link} ${c.heading} {\n font-size: ${tokens.fontSizes.lg};\n margin-bottom: 0.25rem;\n}`;\n\nexport const desc = rule`${c.desc} {\n color: ${tokens.colors.textMuted};\n line-height: ${tokens.lineHeights.normal};\n font-size: 0.9375rem;\n margin: 0;\n}`;\n\nexport const descLink = rule`${c.link} ${c.desc} {\n font-size: ${tokens.fontSizes.sm};\n line-height: 1.5;\n}`;\n","/** @jsxImportSource @semajsx/dom */\n\n/**\n * Card component\n *\n * A content container with two variants matching the docs design:\n * - `feature` (default): Large card with icon, heading, and description\n * - `link`: Smaller clickable card for navigation\n *\n * @example\n * ```tsx\n * import { Card } from \"@semajsx/ui/card\";\n *\n * <Card icon=\"⚡\" heading=\"Fast\" description=\"Built for speed\" />\n * <Card variant=\"link\" heading=\"Guide\" description=\"Get started\" href=\"/docs\" />\n * ```\n */\n\nimport type { JSXNode } from \"@semajsx/core\";\nimport type { StyleToken } from \"@semajsx/style\";\nimport * as styles from \"./card.style\";\n\ntype ClassValue = string | StyleToken | ClassValue[] | false | null | undefined;\n\nexport interface CardProps {\n /** Card variant */\n variant?: \"feature\" | \"link\";\n /** Icon content (emoji or JSX) */\n icon?: JSXNode;\n /** Card heading */\n heading?: string;\n /** Card description */\n description?: string;\n /** Link URL (for \"link\" variant) */\n href?: string;\n /** Inline style string */\n style?: string;\n /** Additional CSS class(es) */\n class?: ClassValue;\n /** Content */\n children?: JSXNode;\n}\n\nexport function Card(props: CardProps): JSXNode {\n const variant = props.variant ?? \"feature\";\n\n const content = (\n <>\n {props.icon && <div class={styles.icon}>{props.icon}</div>}\n {props.heading && (\n <h3 class={[styles.heading, variant === \"link\" && styles.headingLink]}>{props.heading}</h3>\n )}\n {props.description && (\n <p class={[styles.desc, variant === \"link\" && styles.descLink]}>{props.description}</p>\n )}\n {props.children}\n </>\n );\n\n if (variant === \"link\") {\n return (\n <a\n href={props.href}\n class={[styles.root, styles.link, styles.linkStates, props.class]}\n style={props.style}\n >\n {content}\n </a>\n );\n }\n\n return (\n <div\n class={[styles.root, styles.feature, styles.featureStates, props.class]}\n style={props.style}\n >\n {content}\n </div>\n );\n}\n","/**\n * Built-in themes for @semajsx/ui\n *\n * Provides light (default) and dark themes. Custom themes can be\n * created using createTheme() from @semajsx/style.\n *\n * @example\n * ```tsx\n * import { lightTheme, darkTheme } from \"@semajsx/ui/theme\";\n * import { inject } from \"@semajsx/style\";\n *\n * // Apply default (light) theme to :root\n * inject(lightTheme);\n *\n * // Scope dark theme to an element\n * <div class={darkTheme}>\n * <Button>Dark button</Button>\n * </div>\n * ```\n */\n\nimport { createTheme } from \"@semajsx/style\";\nimport type { StyleToken } from \"@semajsx/style\";\nimport { tokens } from \"./tokens\";\n\n/**\n * Light theme - applies token defaults to :root\n */\nexport const lightTheme: StyleToken = createTheme(tokens);\n\n/**\n * Dark theme - scoped to a CSS class\n */\nexport const darkTheme: StyleToken = createTheme(tokens, {\n colors: {\n primary: \"#2997ff\",\n primaryHover: \"#5ab4ff\",\n primaryActive: \"#0071e3\",\n\n background: \"#000000\",\n surface: \"#1c1c1e\",\n border: \"rgba(255, 255, 255, 0.12)\",\n text: \"#f5f5f7\",\n textMuted: \"#a1a1a6\",\n textTertiary: \"#6e6e73\",\n\n danger: \"#ff453a\",\n dangerHover: \"#ff6961\",\n success: \"#30d158\",\n warning: \"#ffd60a\",\n info: \"#0a84ff\",\n tip: \"#bf5af2\",\n\n onPrimary: \"#ffffff\",\n onDanger: \"#ffffff\",\n },\n\n shadows: {\n sm: \"0 1px 3px rgba(0, 0, 0, 0.2)\",\n md: \"0 1px 4px rgba(0, 0, 0, 0.3)\",\n lg: \"0 8px 28px rgba(0, 0, 0, 0.4)\",\n primaryGlow: \"0 4px 16px rgba(41, 151, 255, 0.3)\",\n },\n});\n","/**\n * Button component styles\n *\n * All styles reference theme tokens via CSS custom properties,\n * so they respond to theme changes automatically.\n */\n\nimport { classes, rule, rules } from \"@semajsx/style\";\nimport { tokens } from \"../../theme/tokens\";\n\nconst c = classes([\n \"root\",\n \"solid\",\n \"outline\",\n \"ghost\",\n \"sm\",\n \"md\",\n \"lg\",\n \"danger\",\n \"icon\",\n] as const);\n\n// --- Base ---\n\nexport const root = rule`${c.root} {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: ${tokens.space.sm};\n border: 1.5px solid transparent;\n border-radius: ${tokens.radii.pill};\n font-family: ${tokens.fonts.base};\n font-weight: ${tokens.fontWeights.medium};\n line-height: ${tokens.lineHeights.tight};\n letter-spacing: -0.005em;\n cursor: pointer;\n user-select: none;\n transition: all ${tokens.transitions.normal};\n}`;\n\nexport const rootStates = rules(\n rule`${c.root}:focus-visible {\n outline: 2px solid ${tokens.colors.primary};\n outline-offset: 2px;\n }`,\n rule`${c.root}:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n pointer-events: none;\n }`,\n);\n\n// --- Variants ---\n\nexport const solid = rule`${c.solid} {\n background: ${tokens.colors.primary};\n color: ${tokens.colors.onPrimary};\n border-color: ${tokens.colors.primary};\n}`;\n\nexport const solidStates = rules(\n rule`${c.solid}:hover:not(:disabled) {\n background: ${tokens.colors.primaryHover};\n border-color: ${tokens.colors.primaryHover};\n transform: scale(1.02);\n box-shadow: ${tokens.shadows.primaryGlow};\n }`,\n rule`${c.solid}:active:not(:disabled) {\n background: ${tokens.colors.primaryActive};\n border-color: ${tokens.colors.primaryActive};\n transform: scale(0.98);\n box-shadow: none;\n }`,\n);\n\nexport const outline = rule`${c.outline} {\n background: transparent;\n color: ${tokens.colors.primary};\n border-color: ${tokens.colors.primary};\n}`;\n\nexport const outlineStates = rules(\n rule`${c.outline}:hover:not(:disabled) {\n background: ${tokens.colors.primary};\n color: ${tokens.colors.onPrimary};\n transform: scale(1.02);\n }`,\n rule`${c.outline}:active:not(:disabled) {\n background: ${tokens.colors.primaryActive};\n color: ${tokens.colors.onPrimary};\n transform: scale(0.98);\n }`,\n);\n\nexport const ghost = rule`${c.ghost} {\n background: transparent;\n color: ${tokens.colors.text};\n border-color: transparent;\n}`;\n\nexport const ghostStates = rules(\n rule`${c.ghost}:hover:not(:disabled) {\n background: ${tokens.colors.surface};\n }`,\n rule`${c.ghost}:active:not(:disabled) {\n background: ${tokens.colors.border};\n }`,\n);\n\n// --- Danger ---\n\nexport const danger = rule`${c.danger} {\n background: ${tokens.colors.danger};\n color: ${tokens.colors.onDanger};\n border-color: ${tokens.colors.danger};\n}`;\n\nexport const dangerStates = rules(\n rule`${c.danger}:hover:not(:disabled) {\n background: ${tokens.colors.dangerHover};\n border-color: ${tokens.colors.dangerHover};\n transform: scale(1.02);\n }`,\n rule`${c.danger}:focus-visible {\n outline-color: ${tokens.colors.danger};\n }`,\n);\n\n// --- Sizes ---\n\nexport const sm = rule`${c.sm} {\n padding: ${tokens.space.sm} ${tokens.space.lg};\n font-size: ${tokens.fontSizes.sm};\n}`;\n\nexport const md = rule`${c.md} {\n padding: ${tokens.space.md} ${tokens.space.xl};\n font-size: ${tokens.fontSizes.md};\n}`;\n\nexport const lg = rule`${c.lg} {\n padding: 0.875rem 1.75rem;\n font-size: ${tokens.fontSizes.lg};\n}`;\n\n// --- Icon slot ---\n\nexport const icon = rule`${c.icon} {\n display: inline-flex;\n flex-shrink: 0;\n}`;\n","/**\n * CodeBlock component styles\n *\n * Dark-themed code display with optional language header.\n */\n\nimport { classes, rule } from \"@semajsx/style\";\nimport { tokens } from \"../../theme/tokens\";\n\nconst c = classes([\"root\", \"header\", \"lang\", \"pre\", \"inline\"] as const);\n\n// --- Block ---\n\nexport const root = rule`${c.root} {\n margin: 1.5rem 0;\n border-radius: ${tokens.radii.md};\n overflow: hidden;\n border: 0.5px solid rgba(0, 0, 0, 0.1);\n font-family: ${tokens.fonts.mono};\n}`;\n\nexport const header = rule`${c.header} {\n background: #161617;\n padding: 0.5rem 1.25rem;\n display: flex;\n justify-content: space-between;\n align-items: center;\n}`;\n\nexport const lang = rule`${c.lang} {\n color: #86868b;\n font-size: 0.6875rem;\n text-transform: uppercase;\n font-weight: ${tokens.fontWeights.semibold};\n letter-spacing: 0.04em;\n font-family: ${tokens.fonts.mono};\n}`;\n\nexport const pre = rule`${c.pre} {\n background: #1d1d1f;\n color: #e5e5ea;\n padding: 1.25rem 1.5rem;\n overflow-x: auto;\n margin: 0;\n font-size: ${tokens.fontSizes.sm};\n line-height: 1.65;\n font-family: ${tokens.fonts.mono};\n}`;\n\n// --- Inline code ---\n\nexport const inline = rule`${c.inline} {\n background: rgba(0, 0, 0, 0.04);\n padding: 0.15rem 0.4rem;\n border-radius: 5px;\n font-size: 0.875em;\n border: 0.5px solid rgba(0, 0, 0, 0.06);\n font-family: ${tokens.fonts.mono};\n}`;\n","/**\n * Pre-collected CSS for SSG/SSR usage\n *\n * Since @semajsx/style's inject() requires a DOM, this module provides\n * all component CSS as a static string for server-side rendering.\n *\n * @example\n * ```tsx\n * import { componentCSS } from \"@semajsx/ui/css\";\n *\n * // Include in a <style> tag for SSG output\n * <style>{componentCSS}</style>\n * ```\n */\n\nimport { isStyleToken } from \"@semajsx/style\";\nimport type { StyleToken } from \"@semajsx/style\";\nimport { lightTheme } from \"./theme/themes\";\nimport * as buttonStyles from \"./components/button/button.style\";\nimport * as cardStyles from \"./components/card/card.style\";\nimport * as calloutStyles from \"./components/callout/callout.style\";\nimport * as badgeStyles from \"./components/badge/badge.style\";\nimport * as codeBlockStyles from \"./components/code-block/code-block.style\";\n\nfunction collectCSS(styles: Record<string, unknown>): string {\n return Object.values(styles)\n .filter((v): v is StyleToken => isStyleToken(v))\n .map((t) => t.__cssTemplate)\n .join(\"\\n\");\n}\n\n/** All @semajsx/ui component CSS (theme variables + component rules) */\nexport const componentCSS: string = [\n lightTheme.__cssTemplate,\n collectCSS(buttonStyles),\n collectCSS(cardStyles),\n collectCSS(calloutStyles),\n collectCSS(badgeStyles),\n collectCSS(codeBlockStyles),\n].join(\"\\n\");\n","/** @jsxImportSource @semajsx/dom */\n\nimport type { VNode, JSXNode } from \"@semajsx/core\";\nimport type { DocumentProps } from \"../../types\";\nimport type { DocsThemeOptions, NavLink } from \"./types\";\nimport { THEME_CSS } from \"./styles\";\nimport { Icon } from \"../lucide/component\";\n\nimport { Callout } from \"@semajsx/ui/components/callout\";\nimport { Badge } from \"@semajsx/ui/components/badge\";\nimport { Card } from \"@semajsx/ui/components/card\";\nimport { componentCSS } from \"@semajsx/ui/css\";\n\nimport type { BadgeColor } from \"@semajsx/ui/components/badge\";\n\n/** Concatenate class names, filtering falsy values */\nfunction cx(...args: (string | false | null | undefined)[]): string {\n return args.filter(Boolean).join(\" \");\n}\n\n// =============================================================================\n// CodeBlock — MDX component (kept custom for Shiki className integration)\n// =============================================================================\n\ninterface CodeBlockProps {\n children: string;\n className?: string;\n language?: string;\n}\n\nexport function CodeBlock({ children, className, language }: CodeBlockProps): VNode {\n const lang = language || (className?.replace(/^language-/, \"\") ?? \"text\");\n return (\n <div class=\"dt-code-block\">\n {lang && lang !== \"text\" && (\n <div class=\"dt-code-header\">\n <span class=\"dt-code-lang\">{lang}</span>\n </div>\n )}\n <pre class={className}>\n <code>{children}</code>\n </pre>\n </div>\n );\n}\n\n// =============================================================================\n// Difficulty → Badge color mapping\n// =============================================================================\n\nconst DIFFICULTY_COLORS: Record<string, BadgeColor> = {\n beginner: \"success\",\n intermediate: \"warning\",\n advanced: \"danger\",\n};\n\nconst DIFFICULTY_LABELS: Record<string, string> = {\n beginner: \"Beginner\",\n intermediate: \"Intermediate\",\n advanced: \"Advanced\",\n};\n\n// =============================================================================\n// Component factory — creates all page components bound to theme options\n// =============================================================================\n\ninterface DocsIndexProps {\n docs: Array<{\n slug: string;\n data: { title: string; description?: string; category?: string; order: number };\n }>;\n}\n\ninterface DocPageProps {\n doc: { data: { title: string; description?: string } };\n content: VNode;\n}\n\ninterface GuidesIndexProps {\n guides: Array<{\n slug: string;\n data: { title: string; description?: string; difficulty: string; order: number };\n }>;\n}\n\ninterface GuidePageProps {\n guide: { data: { title: string; description?: string; difficulty: string } };\n content: VNode;\n}\n\n/** Component map returned by createComponents */\nexport interface DocsThemeComponents {\n Document: (props: DocumentProps) => VNode;\n Layout: (props: { children: JSXNode }) => VNode;\n HomePage: () => VNode;\n DocsIndex: (props: DocsIndexProps) => VNode;\n DocPage: (props: DocPageProps) => VNode;\n GuidesIndex: (props: GuidesIndexProps) => VNode;\n GuidePage: (props: GuidePageProps) => VNode;\n NotFound: () => VNode;\n Callout: typeof Callout;\n CodeBlock: typeof CodeBlock;\n}\n\nexport function createComponents(options: DocsThemeOptions): DocsThemeComponents {\n // --------------------------------------------------\n // Document\n // --------------------------------------------------\n function Document(props: DocumentProps): VNode {\n const { children, title, scripts, css } = props;\n const defaultTitle = options.title;\n const pageTitle = title ?? defaultTitle;\n const desc = options.description ?? \"\";\n\n return (\n <html lang=\"en\">\n <head>\n <meta charSet=\"UTF-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n {desc && <meta name=\"description\" content={desc} />}\n <meta name=\"theme-color\" content=\"#fbfbfd\" />\n <meta name=\"color-scheme\" content=\"light\" />\n <title>{pageTitle}</title>\n <link rel=\"preconnect\" href=\"https://fonts.googleapis.com\" />\n <link rel=\"preconnect\" href=\"https://fonts.gstatic.com\" crossOrigin=\"\" />\n <link\n href=\"https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap\"\n rel=\"stylesheet\"\n />\n {css?.map((href) => (\n <link key={href} rel=\"stylesheet\" href={href} />\n ))}\n </head>\n <body>\n {children}\n {scripts}\n </body>\n </html>\n );\n }\n\n // --------------------------------------------------\n // Layout (nav + main + footer)\n // --------------------------------------------------\n function Layout({ children }: { children: JSXNode }): VNode {\n const footerLinks = options.footer?.links ?? options.nav.links;\n const copyrightName = options.footer?.copyright ?? options.title;\n\n return (\n <div class=\"dt-root\">\n <style>{componentCSS}</style>\n <style>{THEME_CSS}</style>\n\n {/* Navigation */}\n <nav class=\"dt-glass-nav\">\n <div class=\"dt-nav-inner\">\n <a href=\"/\" class=\"dt-nav-logo\">\n {options.nav.logo}\n </a>\n <ul class=\"dt-nav-links\">\n {options.nav.links.map((link: NavLink) => (\n <li key={link.href}>\n <a\n href={link.href}\n class=\"dt-nav-link\"\n {...(link.external ? { target: \"_blank\", rel: \"noopener noreferrer\" } : {})}\n >\n {link.label}\n </a>\n </li>\n ))}\n </ul>\n </div>\n </nav>\n\n <main class=\"dt-main\">{children}</main>\n\n {/* Footer */}\n <footer class=\"dt-footer\">\n <div class=\"dt-footer-inner\">\n <div class=\"dt-footer-links\">\n {footerLinks.map((link: NavLink) => (\n <a\n key={link.href}\n href={link.href}\n class=\"dt-footer-link\"\n {...(link.external ? { target: \"_blank\", rel: \"noopener noreferrer\" } : {})}\n >\n {link.label}\n </a>\n ))}\n </div>\n <p class=\"dt-footer-copy\">\n {`\\u00A9 ${new Date().getFullYear()} ${copyrightName}`}. MIT License.\n </p>\n </div>\n </footer>\n </div>\n );\n }\n\n // --------------------------------------------------\n // Home Page\n // --------------------------------------------------\n function HomePage(): VNode {\n return (\n <Layout>\n {/* Hero */}\n {options.hero && (\n <div\n class={cx(\"dt-hero-bg\", \"dt-hero-section\")}\n style=\"padding: 100px 24px 80px; position: relative;\"\n >\n <div style=\"max-width: 680px; margin: 0 auto; position: relative; z-index: 1; text-align: center;\">\n <h1 class={cx(\"dt-hero-title\", \"dt-anim-slide-up\")}>{options.hero.title}</h1>\n <p class={cx(\"dt-hero-subtitle\", \"dt-anim-slide-up\", \"dt-stagger-1\")}>\n {options.hero.subtitle}\n </p>\n {options.hero.actions && options.hero.actions.length > 0 && (\n <div class={cx(\"dt-hero-cta\", \"dt-anim-slide-up\", \"dt-stagger-2\")}>\n {options.hero.actions.map((action) => (\n <a\n key={action.href}\n href={action.href}\n class={action.primary ? \"dt-primary-btn\" : \"dt-secondary-btn\"}\n >\n {action.label}\n </a>\n ))}\n </div>\n )}\n </div>\n </div>\n )}\n\n {/* Features */}\n {options.features && (\n <section\n class=\"dt-section-features\"\n style=\"max-width: 1080px; margin: 0 auto; padding: 80px 24px;\"\n >\n <div style=\"text-align: center; margin-bottom: 3.5rem;\">\n <h2 class={cx(\"dt-section-title\", \"dt-anim-slide-up\")}>{options.features.title}</h2>\n <p class={cx(\"dt-section-subtitle\", \"dt-anim-slide-up\", \"dt-stagger-1\")}>\n {options.features.subtitle}\n </p>\n </div>\n <div\n class=\"dt-features-grid\"\n style=\"display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem;\"\n >\n {options.features.items.map((item, i) => (\n <Card\n key={item.title}\n icon={<Icon name={item.icon} size={24} />}\n heading={item.title}\n description={item.description}\n class={cx(\"dt-anim-scale-in\", `dt-stagger-${Math.min(i + 2, 5)}`)}\n />\n ))}\n </div>\n </section>\n )}\n\n {/* Quick Links */}\n {options.quickLinks && (\n <section\n class=\"dt-section-links\"\n style=\"max-width: 1080px; margin: 0 auto; padding: 0 24px 100px;\"\n >\n <div\n class=\"dt-section-links-inner\"\n style=\"border-top: 0.5px solid rgba(0, 0, 0, 0.06); padding-top: 80px; text-align: center;\"\n >\n <h2 class={cx(\"dt-section-title\", \"dt-anim-slide-up\")}>{options.quickLinks.title}</h2>\n <p class={cx(\"dt-section-subtitle\", \"dt-anim-slide-up\", \"dt-stagger-1\")}>\n {options.quickLinks.subtitle}\n </p>\n <div\n class=\"dt-links-grid\"\n style=\"display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.25rem; max-width: 720px; margin: 0 auto;\"\n >\n {options.quickLinks.items.map((item, i) => (\n <Card\n key={item.href}\n variant=\"link\"\n href={item.href}\n heading={item.title}\n description={item.description}\n class={cx(\"dt-anim-scale-in\", `dt-stagger-${Math.min(i + 2, 5)}`)}\n style=\"text-align: left;\"\n />\n ))}\n </div>\n </div>\n </section>\n )}\n </Layout>\n );\n }\n\n // --------------------------------------------------\n // Docs Index\n // --------------------------------------------------\n function DocsIndex({ docs: docsList }: DocsIndexProps): VNode {\n const docsConf = options.docs;\n const heading = docsConf?.heading ?? \"Documentation\";\n const desc = docsConf?.description ?? \"\";\n\n const byCategory = docsList.reduce(\n (acc, doc) => {\n const category = doc.data.category || \"General\";\n if (!acc[category]) acc[category] = [];\n acc[category].push(doc);\n return acc;\n },\n {} as Record<string, typeof docsList>,\n );\n Object.values(byCategory).forEach((items) => items.sort((a, b) => a.data.order - b.data.order));\n\n const basePath = docsConf?.basePath ?? \"/docs\";\n\n return (\n <Layout>\n <div style=\"max-width: 720px;\">\n <div style=\"margin-bottom: 3rem;\">\n <h1 class={cx(\"dt-page-title\", \"dt-anim-slide-up\")}>{heading}</h1>\n {desc && <p class={cx(\"dt-page-desc\", \"dt-anim-slide-up\", \"dt-stagger-1\")}>{desc}</p>}\n </div>\n {Object.entries(byCategory).map(([category, items]) => (\n <section key={category} class=\"dt-fade-in\" style=\"margin-bottom: 2.5rem;\">\n <h2 class=\"dt-category-heading\">{category}</h2>\n <div style=\"display: flex; flex-direction: column; gap: 0.75rem;\">\n {items.map((doc, i) => (\n <Card\n key={doc.slug}\n variant=\"link\"\n href={`${basePath}/${doc.slug}`}\n heading={doc.data.title}\n description={doc.data.description}\n class={cx(\"dt-anim-scale-in\")}\n style={`animation-delay: ${0.1 + i * 0.08}s;`}\n />\n ))}\n </div>\n </section>\n ))}\n </div>\n </Layout>\n );\n }\n\n // --------------------------------------------------\n // Doc Page\n // --------------------------------------------------\n function DocPage({ doc, content }: DocPageProps): VNode {\n return (\n <Layout>\n <article class=\"dt-page-container\">\n <div style=\"margin-bottom: 2.5rem;\">\n <h1 class={cx(\"dt-page-title\", \"dt-anim-slide-up\")}>{doc.data.title}</h1>\n {doc.data.description && (\n <p class={cx(\"dt-content-desc\", \"dt-anim-slide-up\", \"dt-stagger-1\")}>\n {doc.data.description}\n </p>\n )}\n </div>\n <div class={cx(\"dt-content\", \"dt-fade-in\")}>{content}</div>\n </article>\n </Layout>\n );\n }\n\n // --------------------------------------------------\n // Guides Index\n // --------------------------------------------------\n function GuidesIndex({ guides: guidesList }: GuidesIndexProps): VNode {\n const guidesConf = options.guides;\n const heading = guidesConf?.heading ?? \"Guides\";\n const desc = guidesConf?.description ?? \"\";\n\n const byDifficulty = guidesList.reduce(\n (acc, guide) => {\n const difficulty = guide.data.difficulty || \"beginner\";\n if (!acc[difficulty]) acc[difficulty] = [];\n acc[difficulty].push(guide);\n return acc;\n },\n {} as Record<string, typeof guidesList>,\n );\n Object.values(byDifficulty).forEach((items) =>\n items.sort((a, b) => a.data.order - b.data.order),\n );\n\n const basePath = guidesConf?.basePath ?? \"/guides\";\n\n return (\n <Layout>\n <div style=\"max-width: 720px;\">\n <div style=\"margin-bottom: 3rem;\">\n <h1 class={cx(\"dt-page-title\", \"dt-anim-slide-up\")}>{heading}</h1>\n {desc && <p class={cx(\"dt-page-desc\", \"dt-anim-slide-up\", \"dt-stagger-1\")}>{desc}</p>}\n </div>\n {Object.entries(byDifficulty).map(([difficulty, items]) => (\n <section key={difficulty} class=\"dt-fade-in\" style=\"margin-bottom: 2.5rem;\">\n <h2 class=\"dt-category-heading\">{DIFFICULTY_LABELS[difficulty] ?? difficulty}</h2>\n <div style=\"display: flex; flex-direction: column; gap: 0.75rem;\">\n {items.map((guide, i) => (\n <Card\n key={guide.slug}\n variant=\"link\"\n href={`${basePath}/${guide.slug}`}\n class={cx(\"dt-anim-scale-in\")}\n style={`animation-delay: ${0.1 + i * 0.08}s;`}\n >\n <div style=\"display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.375rem;\">\n <h3 class=\"dt-card-title\" style=\"margin: 0;\">\n {guide.data.title}\n </h3>\n <Badge color={DIFFICULTY_COLORS[guide.data.difficulty] ?? \"default\"}>\n {guide.data.difficulty}\n </Badge>\n </div>\n {guide.data.description && <p class=\"dt-card-desc\">{guide.data.description}</p>}\n </Card>\n ))}\n </div>\n </section>\n ))}\n </div>\n </Layout>\n );\n }\n\n // --------------------------------------------------\n // Guide Page\n // --------------------------------------------------\n function GuidePage({ guide, content }: GuidePageProps): VNode {\n return (\n <Layout>\n <article class=\"dt-page-container\">\n <div style=\"margin-bottom: 2.5rem;\">\n <div class=\"dt-fade-in\" style=\"margin-bottom: 1rem;\">\n <Badge color={DIFFICULTY_COLORS[guide.data.difficulty] ?? \"default\"}>\n {guide.data.difficulty}\n </Badge>\n </div>\n <h1 class={cx(\"dt-page-title\", \"dt-anim-slide-up\")}>{guide.data.title}</h1>\n {guide.data.description && (\n <p class={cx(\"dt-content-desc\", \"dt-anim-slide-up\", \"dt-stagger-1\")}>\n {guide.data.description}\n </p>\n )}\n </div>\n <div class={cx(\"dt-content\", \"dt-fade-in\")}>{content}</div>\n </article>\n </Layout>\n );\n }\n\n // --------------------------------------------------\n // 404 Not Found\n // --------------------------------------------------\n function NotFound(): VNode {\n return (\n <Layout>\n <div\n class={cx(\"dt-hero-bg\", \"dt-not-found-section\")}\n style=\"padding: 100px 24px 80px; position: relative;\"\n >\n <div style=\"max-width: 680px; margin: 0 auto; position: relative; z-index: 1; text-align: center;\">\n <h1 class={cx(\"dt-not-found-title\", \"dt-anim-slide-up\")}>404</h1>\n <p\n class={cx(\"dt-hero-subtitle\", \"dt-anim-slide-up\", \"dt-stagger-1\")}\n style=\"margin-bottom: 0.75rem;\"\n >\n Page Not Found\n </p>\n <p\n class={cx(\"dt-anim-slide-up\", \"dt-stagger-2\")}\n style=\"color: #86868b; font-size: 1rem; margin-bottom: 2.5rem; max-width: 28rem; margin-left: auto; margin-right: auto; line-height: 1.6;\"\n >\n The page you're looking for doesn't exist or has been moved.\n </p>\n <div class={cx(\"dt-hero-cta\", \"dt-anim-slide-up\", \"dt-stagger-3\", \"dt-not-found-cta\")}>\n <a href=\"/\" class=\"dt-primary-btn\">\n Go Back Home\n </a>\n <a href={options.docs?.basePath ?? \"/docs\"} class=\"dt-secondary-btn\">\n View Docs\n </a>\n </div>\n </div>\n </div>\n </Layout>\n );\n }\n\n return {\n Document,\n Layout,\n HomePage,\n DocsIndex,\n DocPage,\n GuidesIndex,\n GuidePage,\n NotFound,\n Callout,\n CodeBlock,\n };\n}\n\n// Re-export for plugin index\nexport { Callout };\n","import { z } from \"zod\";\nimport type { SSGPlugin, Collection, RouteConfig } from \"../../types\";\nimport { defineCollection } from \"../../index\";\nimport type { DocsThemeOptions } from \"./types\";\nimport { createComponents, Callout, CodeBlock } from \"./components\";\nimport { lucide as lucidePlugin } from \"../lucide/index\";\nimport type { Component } from \"@semajsx/core\";\n\nexport type {\n DocsThemeOptions,\n NavLink,\n HeroAction,\n FeatureItem,\n QuickLinkItem,\n DocsConfig,\n GuidesConfig,\n} from \"./types\";\n\nexport { Callout, CodeBlock } from \"./components\";\n\n// =============================================================================\n// Schemas\n// =============================================================================\n\nconst docsSchema = z.object({\n title: z.string(),\n description: z.string().optional(),\n order: z.number().default(999),\n category: z.string().optional(),\n});\n\nconst guidesSchema = z.object({\n title: z.string(),\n description: z.string().optional(),\n order: z.number().default(999),\n difficulty: z.enum([\"beginner\", \"intermediate\", \"advanced\"]).default(\"beginner\"),\n});\n\n// =============================================================================\n// Plugin factory\n// =============================================================================\n\n/**\n * Docs theme plugin for SSG.\n *\n * Provides an Apple-inspired documentation site with:\n * - Frosted glass navigation\n * - Home page with hero, features, and quick links\n * - Docs collection with category grouping\n * - Guides collection with difficulty levels\n * - MDX components (Callout, CodeBlock)\n * - Responsive design\n *\n * All text content, navigation links, and site metadata\n * are configured through options — nothing is hardcoded.\n *\n * @example\n * ```tsx\n * import { createSSG } from \"@semajsx/ssg\";\n * import { docsTheme } from \"@semajsx/ssg/plugins/docs-theme\";\n * import { fileSource } from \"@semajsx/ssg\";\n *\n * const ssg = createSSG({\n * outDir: \"./dist\",\n * plugins: [\n * docsTheme({\n * title: \"My Docs\",\n * nav: {\n * logo: \"MyProject\",\n * links: [\n * { label: \"Docs\", href: \"/docs\" },\n * { label: \"GitHub\", href: \"https://github.com/...\", external: true },\n * ],\n * },\n * hero: {\n * title: \"MyProject\",\n * subtitle: \"A great project.\",\n * actions: [{ label: \"Get Started\", href: \"/docs/intro\", primary: true }],\n * },\n * docs: { source: fileSource({ directory: \"content/docs\" }, rootDir) },\n * }),\n * ],\n * });\n * ```\n */\nexport function docsTheme(options: DocsThemeOptions): SSGPlugin[] {\n const components = createComponents(options);\n const docsBasePath = options.docs?.basePath ?? \"/docs\";\n const guidesBasePath = options.guides?.basePath ?? \"/guides\";\n\n const mainPlugin: SSGPlugin = {\n name: \"docs-theme\",\n\n config() {\n const collections: Collection[] = [];\n const routes: RouteConfig[] = [];\n\n // --- Collections ---\n\n if (options.docs) {\n collections.push(\n defineCollection({\n name: \"docs\",\n source: options.docs.source,\n schema: docsSchema,\n }),\n );\n }\n\n if (options.guides) {\n collections.push(\n defineCollection({\n name: \"guides\",\n source: options.guides.source,\n schema: guidesSchema,\n }),\n );\n }\n\n // --- Routes ---\n\n // Home page\n routes.push({\n path: \"/\",\n component: components.HomePage,\n props: { title: options.title },\n });\n\n // Docs routes\n if (options.docs) {\n routes.push({\n path: docsBasePath,\n component: components.DocsIndex,\n props: async (ssg) => ({\n title: options.docs?.heading ?? \"Documentation\",\n docs: await ssg.getCollection(\"docs\"),\n }),\n });\n\n routes.push({\n path: `${docsBasePath}/:slug`,\n component: components.DocPage,\n getStaticPaths: async (ssg) => {\n const allDocs = await ssg.getCollection(\"docs\");\n return Promise.all(\n allDocs.map(async (doc) => {\n const { Content } = await doc.render();\n return {\n params: { slug: doc.slug },\n props: {\n doc,\n content: Content(),\n title: `${(doc.data as { title: string }).title} | ${options.title}`,\n },\n };\n }),\n );\n },\n });\n }\n\n // Guides routes\n if (options.guides) {\n routes.push({\n path: guidesBasePath,\n component: components.GuidesIndex,\n props: async (ssg) => ({\n title: options.guides?.heading ?? \"Guides\",\n guides: await ssg.getCollection(\"guides\"),\n }),\n });\n\n routes.push({\n path: `${guidesBasePath}/:slug`,\n component: components.GuidePage,\n getStaticPaths: async (ssg) => {\n const allGuides = await ssg.getCollection(\"guides\");\n return Promise.all(\n allGuides.map(async (guide) => {\n const { Content } = await guide.render();\n return {\n params: { slug: guide.slug },\n props: {\n guide,\n content: Content(),\n title: `${(guide.data as { title: string }).title} | ${options.title}`,\n },\n };\n }),\n );\n },\n });\n }\n\n // 404 page\n routes.push({\n path: \"/404\",\n component: components.NotFound,\n props: { title: `404 - Page Not Found | ${options.title}` },\n });\n\n // --- MDX ---\n\n const mdxComponents: Record<string, Component> = {\n Callout,\n CodeBlock,\n ...options.mdx?.components,\n };\n\n return {\n document: components.Document,\n collections,\n routes,\n mdx: {\n remarkPlugins: options.mdx?.remarkPlugins,\n rehypePlugins: options.mdx?.rehypePlugins,\n components: mdxComponents,\n },\n };\n },\n };\n\n // Compose sub-plugins Vite-style: return flat array\n const plugins: SSGPlugin[] = [mainPlugin];\n\n if (options.lucide !== false) {\n const lucideOpts = typeof options.lucide === \"object\" ? options.lucide : {};\n plugins.push(lucidePlugin(lucideOpts));\n }\n\n return plugins;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAQA,MAAa,YAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AM,MAAM,MAAM;QAC5B,OAAO;SACL;SACA,SAAS,SAAS;SAClB,OAAO,GAAI,MAAM,KAA2B,MAAM,KAAK,QAAQ;SAChE;QACF;QACD,CACH;;KAEJ,CAAC;;AAIJ,UAAO,KAAK;IACV,MAAM;IACN,WAAW,WAAW;IACtB,OAAO,EAAE,OAAO,0BAA0B,QAAQ,SAAS;IAC5D,CAAC;GAIF,MAAM,gBAA2C;IAC/C;IACA;IACA,GAAG,QAAQ,KAAK;IACjB;AAED,UAAO;IACL,UAAU,WAAW;IACrB;IACA;IACA,KAAK;KACH,eAAe,QAAQ,KAAK;KAC5B,eAAe,QAAQ,KAAK;KAC5B,YAAY;KACb;IACF;;EAEJ,CAGwC;AAEzC,KAAI,QAAQ,WAAW,OAAO;EAC5B,MAAM,aAAa,OAAO,QAAQ,WAAW,WAAW,QAAQ,SAAS,EAAE;AAC3E,UAAQ,KAAKC,OAAa,WAAW,CAAC;;AAGxC,QAAO"}
|
|
1
|
+
{"version":3,"file":"docs-theme.mjs","names":["c","root","icon","styles.root","styles.title","styles.icon","styles.content","c","root","styles.root","c","root","icon","styles.icon","styles.heading","styles.headingLink","styles.desc","styles.descLink","styles.root","styles.link","styles.linkStates","styles.feature","styles.featureStates","c","root","buttonStyles","cardStyles","calloutStyles","badgeStyles","codeBlockStyles","lucidePlugin","llmsPlugin"],"sources":["../../../../ssg/src/plugins/docs-theme/styles.ts","../../../../ui/src/theme/tokens.ts","../../../../ui/src/components/callout/callout.style.ts","../../../../ui/src/components/callout/callout.tsx","../../../../ui/src/components/badge/badge.style.ts","../../../../ui/src/components/badge/badge.tsx","../../../../ui/src/components/card/card.style.ts","../../../../ui/src/components/card/card.tsx","../../../../ui/src/theme/themes.ts","../../../../ui/src/components/button/button.style.ts","../../../../ui/src/components/code-block/code-block.style.ts","../../../../ui/src/css.ts","../../../../ssg/src/plugins/docs-theme/components.tsx","../../../../ssg/src/plugins/llms/index.ts","../../../../ssg/src/plugins/docs-theme/index.ts"],"sourcesContent":["/**\n * Apple-inspired theme CSS for the docs-theme plugin.\n *\n * All class names are prefixed with `dt-` to avoid collisions.\n * Component styles (Card, Callout, Badge) come from @semajsx/ui via componentCSS.\n * This file contains layout, navigation, hero, typography, animations, and responsive styles.\n */\n\nexport const THEME_CSS = /* css */ `\n/* ==============================================\n * Keyframes\n * ============================================== */\n\n@keyframes dt-fade-in-up {\n from { opacity: 0; transform: translateY(20px); }\n to { opacity: 1; transform: translateY(0); }\n}\n\n@keyframes dt-fade-in-scale {\n from { opacity: 0; transform: scale(0.96) translateY(8px); }\n to { opacity: 1; transform: scale(1) translateY(0); }\n}\n\n/* ==============================================\n * Global Reset & Base\n * ============================================== */\n\n* { margin: 0; padding: 0; box-sizing: border-box; }\n\nhtml { scroll-behavior: smooth; }\n\nbody {\n font-family: -apple-system, BlinkMacSystemFont, \"SF Pro Display\", \"SF Pro Text\",\n Inter, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, sans-serif;\n line-height: 1.6;\n color: #1d1d1f;\n background: #fbfbfd;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n text-rendering: optimizeLegibility;\n}\n\n::selection {\n background: rgba(0, 113, 227, 0.2);\n color: #1d1d1f;\n}\n\n/* ==============================================\n * Frosted Glass Navigation\n * ============================================== */\n\n.dt-glass-nav {\n position: sticky;\n top: 0;\n z-index: 50;\n background: rgba(251, 251, 253, 0.8);\n backdrop-filter: saturate(180%) blur(20px);\n -webkit-backdrop-filter: saturate(180%) blur(20px);\n border-bottom: 0.5px solid rgba(0, 0, 0, 0.08);\n}\n\n.dt-nav-inner {\n max-width: 1200px;\n margin: 0 auto;\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 14px 2rem;\n height: 52px;\n}\n\n.dt-nav-logo {\n color: #1d1d1f;\n font-size: 1.25rem;\n font-weight: 600;\n letter-spacing: -0.02em;\n text-decoration: none;\n}\n\n.dt-nav-links {\n display: flex;\n list-style: none;\n margin: 0;\n gap: 2rem;\n}\n\n.dt-nav-link {\n color: #1d1d1f;\n text-decoration: none;\n font-size: 0.875rem;\n font-weight: 400;\n letter-spacing: -0.005em;\n transition: color 0.2s ease;\n}\n\n.dt-nav-link:hover {\n color: #0071e3;\n}\n\n/* ==============================================\n * Layout\n * ============================================== */\n\n.dt-root {\n display: flex;\n flex-direction: column;\n min-height: 100vh;\n background: #fbfbfd;\n}\n\n.dt-main {\n flex: 1 1 0%;\n width: 100%;\n max-width: 1200px;\n margin: 0 auto;\n padding: 2rem 2rem 4rem;\n}\n\n/* ==============================================\n * Footer\n * ============================================== */\n\n.dt-footer {\n border-top: 0.5px solid rgba(0, 0, 0, 0.08);\n background: #f5f5f7;\n}\n\n.dt-footer-inner {\n max-width: 1200px;\n margin: 0 auto;\n padding: 2rem;\n display: flex;\n justify-content: space-between;\n align-items: center;\n flex-wrap: wrap;\n gap: 1rem;\n}\n\n.dt-footer-links {\n display: flex;\n gap: 2rem;\n align-items: center;\n}\n\n.dt-footer-link {\n color: #6e6e73;\n text-decoration: none;\n font-size: 0.8125rem;\n transition: color 0.2s;\n}\n\n.dt-footer-link:hover {\n color: #0071e3;\n}\n\n.dt-footer-copy {\n color: #86868b;\n font-size: 0.8125rem;\n margin: 0;\n}\n\n/* ==============================================\n * Hero Section\n * ============================================== */\n\n.dt-hero-bg {\n background: linear-gradient(180deg, #fbfbfd 0%, #f5f5f7 40%, #fbfbfd 100%);\n position: relative;\n}\n\n.dt-hero-bg::before {\n content: \"\";\n position: absolute;\n top: 0;\n left: 50%;\n transform: translateX(-50%);\n width: 100%;\n height: 100%;\n background: radial-gradient(\n ellipse 60% 50% at 50% 40%,\n rgba(0, 113, 227, 0.06) 0%,\n rgba(251, 251, 253, 0) 70%\n );\n pointer-events: none;\n}\n\n.dt-hero-title {\n font-size: clamp(3rem, 8vw, 5rem);\n font-weight: 700;\n line-height: 1.05;\n letter-spacing: -0.03em;\n background: linear-gradient(135deg, #1d1d1f 30%, #6e6e73 100%);\n -webkit-background-clip: text;\n -webkit-text-fill-color: transparent;\n background-clip: text;\n margin-bottom: 1.25rem;\n}\n\n.dt-hero-subtitle {\n font-size: clamp(1.25rem, 2.5vw, 1.5rem);\n font-weight: 400;\n line-height: 1.5;\n color: #6e6e73;\n max-width: 40rem;\n margin: 0 auto 2.5rem;\n letter-spacing: -0.005em;\n}\n\n.dt-hero-cta {\n display: flex;\n gap: 1rem;\n justify-content: center;\n margin-top: 2rem;\n}\n\n/* ==============================================\n * Section Typography\n * ============================================== */\n\n.dt-section-title {\n font-size: clamp(2rem, 4vw, 2.75rem);\n font-weight: 700;\n letter-spacing: -0.02em;\n line-height: 1.1;\n color: #1d1d1f;\n margin-bottom: 0.75rem;\n}\n\n.dt-section-subtitle {\n font-size: clamp(1rem, 2vw, 1.25rem);\n font-weight: 400;\n line-height: 1.5;\n color: #6e6e73;\n max-width: 36rem;\n margin: 0 auto 3rem;\n}\n\n/* ==============================================\n * Buttons\n * ============================================== */\n\n.dt-primary-btn {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n padding: 0.875rem 1.75rem;\n background: #0071e3;\n color: white;\n border-radius: 980px;\n font-size: 1.0625rem;\n font-weight: 500;\n text-decoration: none;\n transition: all 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);\n border: none;\n cursor: pointer;\n letter-spacing: -0.005em;\n}\n\n.dt-primary-btn:hover {\n background: #0077ed;\n transform: scale(1.02);\n box-shadow: 0 4px 16px rgba(0, 113, 227, 0.3);\n}\n\n.dt-secondary-btn {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n padding: 0.875rem 1.75rem;\n background: transparent;\n color: #0071e3;\n border: 1.5px solid #0071e3;\n border-radius: 980px;\n font-size: 1.0625rem;\n font-weight: 500;\n text-decoration: none;\n transition: all 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);\n cursor: pointer;\n letter-spacing: -0.005em;\n}\n\n.dt-secondary-btn:hover {\n background: #0071e3;\n color: white;\n transform: scale(1.02);\n}\n\n/* ==============================================\n * Animations\n * ============================================== */\n\n.dt-anim-slide-up {\n animation: dt-fade-in-up 0.8s cubic-bezier(0.25, 0.1, 0.25, 1) both;\n}\n\n.dt-anim-scale-in {\n animation: dt-fade-in-scale 0.6s cubic-bezier(0.25, 0.1, 0.25, 1) both;\n}\n\n.dt-fade-in {\n animation: dt-fade-in-up 0.6s cubic-bezier(0.25, 0.1, 0.25, 1) both;\n}\n\n.dt-stagger-1 { animation-delay: 0.1s; }\n.dt-stagger-2 { animation-delay: 0.2s; }\n.dt-stagger-3 { animation-delay: 0.35s; }\n.dt-stagger-4 { animation-delay: 0.5s; }\n.dt-stagger-5 { animation-delay: 0.65s; }\n\n/* ==============================================\n * Page Layout\n * ============================================== */\n\n.dt-page-container {\n max-width: 720px;\n}\n\n.dt-page-title {\n font-size: 2.25rem;\n font-weight: 700;\n color: #1d1d1f;\n letter-spacing: -0.02em;\n margin-bottom: 0.5rem;\n}\n\n.dt-page-desc {\n font-size: 1.125rem;\n color: #6e6e73;\n line-height: 1.5;\n}\n\n.dt-category-heading {\n font-size: 0.8125rem;\n font-weight: 600;\n color: #86868b;\n text-transform: uppercase;\n letter-spacing: 0.06em;\n margin-bottom: 1rem;\n}\n\n.dt-card-title {\n font-size: 1.0625rem;\n font-weight: 600;\n color: #1d1d1f;\n letter-spacing: -0.01em;\n margin-bottom: 0.25rem;\n}\n\n.dt-card-desc {\n color: #6e6e73;\n font-size: 0.875rem;\n line-height: 1.5;\n margin: 0;\n}\n\n.dt-content-desc {\n font-size: 1.125rem;\n color: #6e6e73;\n line-height: 1.5;\n padding-bottom: 1.5rem;\n border-bottom: 0.5px solid rgba(0, 0, 0, 0.06);\n}\n\n/* ==============================================\n * Content Typography\n * ============================================== */\n\n.dt-content {\n line-height: 1.75;\n color: #1d1d1f;\n}\n\n.dt-content h1 {\n font-size: 1.875rem;\n font-weight: 700;\n margin-top: 3rem;\n margin-bottom: 0.75rem;\n color: #1d1d1f;\n letter-spacing: -0.02em;\n line-height: 1.2;\n}\n\n.dt-content h2 {\n font-size: 1.5rem;\n font-weight: 600;\n margin-top: 2.5rem;\n margin-bottom: 0.75rem;\n color: #1d1d1f;\n letter-spacing: -0.015em;\n line-height: 1.25;\n padding-top: 1.5rem;\n border-top: 0.5px solid rgba(0, 0, 0, 0.06);\n}\n\n.dt-content h2:first-child,\n.dt-content hr + h2 {\n border-top: none;\n padding-top: 0;\n margin-top: 0;\n}\n\n.dt-content h3 {\n font-size: 1.25rem;\n font-weight: 600;\n margin-top: 2rem;\n margin-bottom: 0.5rem;\n color: #1d1d1f;\n letter-spacing: -0.01em;\n line-height: 1.3;\n}\n\n.dt-content p {\n margin-bottom: 1.25rem;\n font-size: 1rem;\n color: #1d1d1f;\n}\n\n.dt-content ul,\n.dt-content ol {\n margin-left: 1.5rem;\n margin-bottom: 1.25rem;\n}\n\n.dt-content li {\n margin-bottom: 0.375rem;\n font-size: 1rem;\n line-height: 1.65;\n}\n\n.dt-content code {\n background: rgba(0, 0, 0, 0.04);\n padding: 0.15rem 0.4rem;\n border-radius: 5px;\n font-family: \"SF Mono\", \"Fira Code\", \"Fira Mono\", Menlo, Consolas, \"DejaVu Sans Mono\", monospace;\n font-size: 0.875em;\n color: #1d1d1f;\n border: 0.5px solid rgba(0, 0, 0, 0.06);\n}\n\n.dt-content pre {\n background: #1d1d1f;\n color: #e5e5ea;\n padding: 1.25rem 1.5rem;\n border-radius: 12px;\n overflow-x: auto;\n margin-bottom: 1.25rem;\n font-size: 0.875rem;\n line-height: 1.65;\n border: 0.5px solid rgba(0, 0, 0, 0.1);\n}\n\n.dt-content pre code {\n background: none;\n color: inherit;\n padding: 0;\n border: none;\n font-size: inherit;\n}\n\n.dt-content a {\n color: #0071e3;\n text-decoration: none;\n transition: color 0.2s ease;\n}\n\n.dt-content a:hover {\n text-decoration: underline;\n}\n\n.dt-content strong {\n font-weight: 600;\n color: #1d1d1f;\n}\n\n.dt-content blockquote {\n border-left: 3px solid rgba(0, 0, 0, 0.08);\n padding: 0.75rem 1.25rem;\n margin: 1.5rem 0;\n color: #6e6e73;\n background: rgba(0, 0, 0, 0.02);\n border-radius: 0 10px 10px 0;\n}\n\n.dt-content hr {\n border: none;\n border-top: 0.5px solid rgba(0, 0, 0, 0.06);\n margin: 2.5rem 0;\n}\n\n/* Tables */\n\n.dt-content table {\n width: 100%;\n border-collapse: collapse;\n margin: 1.5rem 0;\n font-size: 0.9375rem;\n line-height: 1.5;\n border-radius: 10px;\n overflow: hidden;\n border: 0.5px solid rgba(0, 0, 0, 0.08);\n}\n\n.dt-content thead {\n background: rgba(0, 0, 0, 0.03);\n}\n\n.dt-content th {\n font-weight: 600;\n color: #1d1d1f;\n text-align: left;\n padding: 0.75rem 1rem;\n font-size: 0.8125rem;\n text-transform: uppercase;\n letter-spacing: 0.03em;\n border-bottom: 0.5px solid rgba(0, 0, 0, 0.08);\n}\n\n.dt-content td {\n padding: 0.75rem 1rem;\n color: #1d1d1f;\n border-bottom: 0.5px solid rgba(0, 0, 0, 0.04);\n}\n\n.dt-content tbody tr:last-child td {\n border-bottom: none;\n}\n\n.dt-content tbody tr:hover {\n background: rgba(0, 0, 0, 0.02);\n}\n\n/* ==============================================\n * Code Blocks\n * ============================================== */\n\n.dt-code-block {\n margin: 1.5rem 0;\n border-radius: 12px;\n overflow: hidden;\n border: 0.5px solid rgba(0, 0, 0, 0.1);\n}\n\n.dt-code-header {\n background: #161617;\n padding: 0.5rem 1.25rem;\n display: flex;\n justify-content: space-between;\n align-items: center;\n}\n\n.dt-code-lang {\n color: #86868b;\n font-size: 0.6875rem;\n text-transform: uppercase;\n font-weight: 600;\n letter-spacing: 0.04em;\n}\n\n.dt-code-block pre {\n margin: 0;\n border-radius: 0;\n border: none;\n}\n\n.dt-code-header + pre {\n border-radius: 0;\n}\n\n/* Shiki integration */\n\n.dt-content pre.shiki {\n position: relative;\n padding: 2.25rem 1.5rem 1.25rem;\n}\n\n.dt-content pre.shiki[data-language]::before {\n content: attr(data-language);\n position: absolute;\n top: 0.625rem;\n right: 1rem;\n color: #636e7b;\n font-size: 0.6875rem;\n text-transform: uppercase;\n font-weight: 600;\n letter-spacing: 0.04em;\n pointer-events: none;\n user-select: none;\n}\n\n.dt-content pre.shiki code {\n display: block;\n}\n\n.dt-content pre.shiki .line {\n display: inline;\n}\n\n/* ==============================================\n * 404 Page\n * ============================================== */\n\n.dt-not-found-title {\n font-size: clamp(4rem, 12vw, 8rem);\n font-weight: 700;\n line-height: 1;\n letter-spacing: -0.04em;\n background: linear-gradient(135deg, #1d1d1f 30%, #6e6e73 100%);\n -webkit-background-clip: text;\n -webkit-text-fill-color: transparent;\n background-clip: text;\n margin-bottom: 1.25rem;\n}\n\n/* ==============================================\n * Responsive\n * ============================================== */\n\n@media (max-width: 768px) {\n .dt-nav-inner {\n padding: 12px 1rem !important;\n height: 48px !important;\n }\n\n .dt-nav-logo { font-size: 1.125rem !important; }\n .dt-nav-links { gap: 1.25rem !important; }\n .dt-nav-link { font-size: 0.8125rem; }\n\n .dt-main {\n padding: 1.25rem 1rem 2.5rem !important;\n }\n\n .dt-hero-section {\n padding: 60px 16px 48px !important;\n }\n\n .dt-hero-cta {\n flex-direction: column !important;\n align-items: center !important;\n gap: 0.75rem !important;\n }\n\n .dt-section-features {\n padding: 48px 16px !important;\n }\n\n .dt-section-links {\n padding: 0 16px 60px !important;\n }\n\n .dt-section-links-inner {\n padding-top: 48px !important;\n }\n\n .dt-features-grid {\n grid-template-columns: 1fr !important;\n gap: 1rem !important;\n }\n\n .dt-links-grid {\n grid-template-columns: 1fr !important;\n }\n\n .dt-page-title {\n font-size: 1.75rem !important;\n }\n\n .dt-page-desc {\n font-size: 1rem !important;\n }\n\n .dt-page-container {\n max-width: 100%;\n }\n\n .dt-footer-inner {\n flex-direction: column !important;\n align-items: center !important;\n text-align: center;\n padding: 1.5rem 1rem !important;\n }\n\n .dt-footer-links {\n justify-content: center !important;\n gap: 1.5rem !important;\n }\n\n .dt-not-found-section {\n padding: 60px 16px 48px !important;\n }\n\n .dt-not-found-cta {\n flex-direction: column !important;\n align-items: center !important;\n gap: 0.75rem !important;\n }\n\n .dt-content { line-height: 1.7; }\n .dt-content h1 { font-size: 1.5rem; margin-top: 2rem; }\n .dt-content h2 { font-size: 1.25rem; margin-top: 2rem; padding-top: 1.25rem; }\n .dt-content h3 { font-size: 1.125rem; margin-top: 1.5rem; }\n .dt-content pre { padding: 1rem; font-size: 0.8125rem; border-radius: 10px; }\n .dt-content ul, .dt-content ol { margin-left: 1.25rem; }\n\n .dt-content table {\n font-size: 0.8125rem;\n display: block;\n overflow-x: auto;\n -webkit-overflow-scrolling: touch;\n }\n\n .dt-content th, .dt-content td { padding: 0.625rem 0.75rem; }\n\n .dt-code-block { border-radius: 10px; }\n .dt-code-header { padding: 0.375rem 1rem; }\n\n}\n`;\n","/**\n * Default design tokens for @semajsx/ui\n *\n * These tokens define the visual language of the component library.\n * All components reference these tokens via CSS custom properties,\n * enabling runtime theme switching.\n *\n * @example\n * ```ts\n * import { tokens } from \"@semajsx/ui/theme\";\n *\n * // Use in custom styles\n * const myRule = rule`${c.box} {\n * color: ${tokens.colors.text};\n * padding: ${tokens.space.md};\n * }`;\n * ```\n */\n\nimport { defineTokens } from \"@semajsx/style\";\nimport type { TokenRefs } from \"@semajsx/style\";\n\nconst tokenDefinition = {\n colors: {\n // Brand (Apple blue)\n primary: \"#0071e3\",\n primaryHover: \"#0077ed\",\n primaryActive: \"#0068d6\",\n\n // Neutral\n background: \"#fbfbfd\",\n surface: \"#f5f5f7\",\n border: \"rgba(0, 0, 0, 0.08)\",\n text: \"#1d1d1f\",\n textMuted: \"#6e6e73\",\n textTertiary: \"#86868b\",\n\n // Semantic\n danger: \"#ff453a\",\n dangerHover: \"#ff6961\",\n success: \"#34c759\",\n warning: \"#ff9f0a\",\n info: \"#007aff\",\n tip: \"#af52de\",\n\n // Inverse (for solid buttons, etc.)\n onPrimary: \"#ffffff\",\n onDanger: \"#ffffff\",\n },\n\n space: {\n xs: \"0.25rem\",\n sm: \"0.5rem\",\n md: \"0.75rem\",\n lg: \"1rem\",\n xl: \"1.5rem\",\n xxl: \"2rem\",\n },\n\n radii: {\n sm: \"10px\",\n md: \"12px\",\n lg: \"16px\",\n xl: \"20px\",\n pill: \"980px\",\n },\n\n fonts: {\n base: '-apple-system, BlinkMacSystemFont, \"SF Pro Display\", \"SF Pro Text\", Inter, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, sans-serif',\n mono: '\"SF Mono\", \"Fira Code\", \"Fira Mono\", Menlo, Consolas, \"DejaVu Sans Mono\", monospace',\n },\n\n fontSizes: {\n xs: \"0.8125rem\",\n sm: \"0.875rem\",\n md: \"1rem\",\n lg: \"1.0625rem\",\n },\n\n fontWeights: {\n normal: \"400\",\n medium: \"500\",\n semibold: \"600\",\n bold: \"700\",\n },\n\n lineHeights: {\n tight: \"1.25\",\n normal: \"1.6\",\n },\n\n shadows: {\n sm: \"0 1px 3px rgba(0, 0, 0, 0.03)\",\n md: \"0 1px 4px rgba(0, 0, 0, 0.04)\",\n lg: \"0 8px 28px rgba(0, 0, 0, 0.08)\",\n primaryGlow: \"0 4px 16px rgba(0, 113, 227, 0.3)\",\n },\n\n transitions: {\n fast: \"0.2s ease\",\n normal: \"0.3s cubic-bezier(0.25, 0.1, 0.25, 1)\",\n },\n} as const;\n\nexport const tokens: TokenRefs<typeof tokenDefinition> = defineTokens(tokenDefinition);\n","/**\n * Callout component styles\n *\n * Five semantic variants: info, warning, success, error, tip\n * Matching the docs site callout design.\n */\n\nimport { classes, rule } from \"@semajsx/style\";\nimport { tokens } from \"../../theme/tokens\";\n\nconst c = classes([\"root\", \"title\", \"icon\", \"content\"] as const);\n\n// --- Base ---\n\nexport const root = rule`${c.root} {\n padding: 1.25rem 1.5rem;\n margin: 1.5rem 0;\n border-radius: 14px;\n border: 0.5px solid rgba(0, 0, 0, 0.04);\n font-family: ${tokens.fonts.base};\n}`;\n\nexport const title = rule`${c.title} {\n font-weight: ${tokens.fontWeights.semibold};\n font-size: 0.9375rem;\n margin: 0 0 0.5rem;\n display: flex;\n align-items: center;\n gap: ${tokens.space.sm};\n letter-spacing: -0.005em;\n}`;\n\nexport const icon = rule`${c.icon} {\n width: 18px;\n height: 18px;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n}`;\n\nexport const content = rule`${c.content} {\n color: ${tokens.colors.text};\n font-size: 0.9375rem;\n line-height: ${tokens.lineHeights.normal};\n}`;\n","/** @jsxImportSource @semajsx/dom */\n\n/**\n * Callout component\n *\n * A styled box for highlighting important content with semantic variants.\n *\n * @example\n * ```tsx\n * import { Callout } from \"@semajsx/ui/callout\";\n *\n * <Callout type=\"info\" title=\"Note\">This is informational.</Callout>\n * <Callout type=\"warning\">Be careful with this.</Callout>\n * <Callout type=\"tip\" title=\"Pro tip\">Use signals for reactivity.</Callout>\n * ```\n */\n\nimport type { JSXNode, VNode } from \"@semajsx/core\";\nimport type { StyleToken } from \"@semajsx/style\";\nimport * as styles from \"./callout.style\";\n\ntype ClassValue = string | StyleToken | ClassValue[] | false | null | undefined;\n\nexport type CalloutType = \"info\" | \"warning\" | \"success\" | \"error\" | \"tip\";\n\nexport interface CalloutProps {\n /** Semantic type controlling color and icon */\n type?: CalloutType;\n /** Optional title displayed above content */\n title?: string;\n /** Additional CSS class(es) */\n class?: ClassValue;\n /** Content */\n children?: JSXNode;\n}\n\nconst SVG_ATTRS = {\n xmlns: \"http://www.w3.org/2000/svg\",\n width: \"18\",\n height: \"18\",\n viewBox: \"0 0 24 24\",\n fill: \"none\",\n stroke: \"currentColor\",\n \"stroke-width\": \"2\",\n \"stroke-linecap\": \"round\",\n \"stroke-linejoin\": \"round\",\n};\n\nfunction InfoIcon(): VNode {\n return (\n <svg {...SVG_ATTRS}>\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"M12 16v-4\" />\n <path d=\"M12 8h.01\" />\n </svg>\n );\n}\n\nfunction WarningIcon(): VNode {\n return (\n <svg {...SVG_ATTRS}>\n <path d=\"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z\" />\n <path d=\"M12 9v4\" />\n <path d=\"M12 17h.01\" />\n </svg>\n );\n}\n\nfunction SuccessIcon(): VNode {\n return (\n <svg {...SVG_ATTRS}>\n <path d=\"M22 11.08V12a10 10 0 1 1-5.93-9.14\" />\n <path d=\"m9 11 3 3L22 4\" />\n </svg>\n );\n}\n\nfunction ErrorIcon(): VNode {\n return (\n <svg {...SVG_ATTRS}>\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"m15 9-6 6\" />\n <path d=\"m9 9 6 6\" />\n </svg>\n );\n}\n\nfunction TipIcon(): VNode {\n return (\n <svg {...SVG_ATTRS}>\n <path d=\"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5\" />\n <path d=\"M9 18h6\" />\n <path d=\"M10 22h4\" />\n </svg>\n );\n}\n\nconst calloutConfig: Record<CalloutType, { bg: string; accent: string; icon: () => VNode }> = {\n info: { bg: \"rgba(0, 122, 255, 0.06)\", accent: \"#007aff\", icon: InfoIcon },\n warning: { bg: \"rgba(255, 159, 10, 0.08)\", accent: \"#ff9f0a\", icon: WarningIcon },\n success: { bg: \"rgba(52, 199, 89, 0.08)\", accent: \"#34c759\", icon: SuccessIcon },\n error: { bg: \"rgba(255, 69, 58, 0.08)\", accent: \"#ff453a\", icon: ErrorIcon },\n tip: { bg: \"rgba(175, 82, 222, 0.06)\", accent: \"#af52de\", icon: TipIcon },\n};\n\nexport function Callout(props: CalloutProps): JSXNode {\n const type = props.type ?? \"info\";\n const config = calloutConfig[type];\n const IconComponent = config.icon;\n\n return (\n <div class={[styles.root, props.class]} style={`background: ${config.bg}`} role=\"note\">\n {props.title && (\n <div class={styles.title} style={`color: ${config.accent}`}>\n <span class={styles.icon}>\n <IconComponent />\n </span>\n {props.title}\n </div>\n )}\n <div class={styles.content}>{props.children}</div>\n </div>\n );\n}\n","/**\n * Badge component styles\n *\n * Pill-shaped labels with semantic color variants.\n */\n\nimport { classes, rule } from \"@semajsx/style\";\nimport { tokens } from \"../../theme/tokens\";\n\nconst c = classes([\"root\"] as const);\n\nexport const root = rule`${c.root} {\n display: inline-flex;\n align-items: center;\n font-size: 0.6875rem;\n font-weight: ${tokens.fontWeights.semibold};\n font-family: ${tokens.fonts.base};\n padding: 0.125rem 0.5rem;\n border-radius: ${tokens.radii.pill};\n letter-spacing: 0.02em;\n text-transform: uppercase;\n white-space: nowrap;\n line-height: 1.6;\n}`;\n","/** @jsxImportSource @semajsx/dom */\n\n/**\n * Badge component\n *\n * A small pill-shaped label for status, category, or metadata.\n *\n * @example\n * ```tsx\n * import { Badge } from \"@semajsx/ui/badge\";\n *\n * <Badge color=\"success\">Beginner</Badge>\n * <Badge color=\"warning\">Intermediate</Badge>\n * <Badge color=\"danger\">Advanced</Badge>\n * <Badge>Default</Badge>\n * ```\n */\n\nimport type { JSXNode } from \"@semajsx/core\";\nimport type { StyleToken } from \"@semajsx/style\";\nimport * as styles from \"./badge.style\";\n\ntype ClassValue = string | StyleToken | ClassValue[] | false | null | undefined;\n\nexport type BadgeColor = \"default\" | \"success\" | \"warning\" | \"danger\" | \"info\" | \"tip\";\n\nexport interface BadgeProps {\n /** Semantic color */\n color?: BadgeColor;\n /** Additional CSS class(es) */\n class?: ClassValue;\n /** Content */\n children?: JSXNode;\n}\n\nconst badgeColors: Record<BadgeColor, { bg: string; fg: string }> = {\n default: { bg: \"rgba(0, 0, 0, 0.06)\", fg: \"#1d1d1f\" },\n success: { bg: \"rgba(52, 199, 89, 0.12)\", fg: \"#248a3d\" },\n warning: { bg: \"rgba(255, 159, 10, 0.12)\", fg: \"#b25000\" },\n danger: { bg: \"rgba(255, 69, 58, 0.12)\", fg: \"#d70015\" },\n info: { bg: \"rgba(0, 122, 255, 0.1)\", fg: \"#0055b3\" },\n tip: { bg: \"rgba(175, 82, 222, 0.1)\", fg: \"#8944ab\" },\n};\n\nexport function Badge(props: BadgeProps): JSXNode {\n const color = props.color ?? \"default\";\n const config = badgeColors[color];\n\n return (\n <span\n class={[styles.root, props.class]}\n style={`background: ${config.bg}; color: ${config.fg}`}\n >\n {props.children}\n </span>\n );\n}\n","/**\n * Card component styles\n *\n * Two variants matching the docs site design:\n * - feature: Large card with icon, heading, description\n * - link: Smaller clickable card for navigation\n */\n\nimport { classes, rule, rules } from \"@semajsx/style\";\nimport { tokens } from \"../../theme/tokens\";\n\nconst c = classes([\"root\", \"feature\", \"link\", \"icon\", \"heading\", \"desc\"] as const);\n\n// --- Base ---\n\nexport const root = rule`${c.root} {\n background: white;\n border: 0.5px solid rgba(0, 0, 0, 0.06);\n font-family: ${tokens.fonts.base};\n transition: all 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);\n}`;\n\n// --- Feature variant ---\n\nexport const feature = rule`${c.feature} {\n border-radius: ${tokens.radii.xl};\n padding: 2.5rem;\n box-shadow: ${tokens.shadows.md};\n}`;\n\nexport const featureStates = rule`${c.feature}:hover {\n transform: translateY(-4px) scale(1.01);\n box-shadow: ${tokens.shadows.lg};\n}`;\n\n// --- Link variant ---\n\nexport const link = rule`${c.link} {\n display: block;\n border-radius: ${tokens.radii.lg};\n padding: 1.75rem;\n box-shadow: ${tokens.shadows.sm};\n text-decoration: none;\n cursor: pointer;\n}`;\n\nexport const linkStates = rules(\n rule`${c.link}:hover {\n border-color: rgba(0, 113, 227, 0.3);\n box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);\n transform: translateY(-2px);\n }`,\n);\n\n// --- Slots ---\n\nexport const icon = rule`${c.icon} {\n font-size: 2rem;\n width: 48px;\n height: 48px;\n display: flex;\n align-items: center;\n justify-content: center;\n background: ${tokens.colors.surface};\n border-radius: ${tokens.radii.md};\n margin-bottom: 1.25rem;\n}`;\n\nexport const heading = rule`${c.heading} {\n font-size: 1.375rem;\n font-weight: ${tokens.fontWeights.semibold};\n color: ${tokens.colors.text};\n margin: 0 0 0.5rem;\n letter-spacing: -0.01em;\n}`;\n\nexport const headingLink = rule`${c.link} ${c.heading} {\n font-size: ${tokens.fontSizes.lg};\n margin-bottom: 0.25rem;\n}`;\n\nexport const desc = rule`${c.desc} {\n color: ${tokens.colors.textMuted};\n line-height: ${tokens.lineHeights.normal};\n font-size: 0.9375rem;\n margin: 0;\n}`;\n\nexport const descLink = rule`${c.link} ${c.desc} {\n font-size: ${tokens.fontSizes.sm};\n line-height: 1.5;\n}`;\n","/** @jsxImportSource @semajsx/dom */\n\n/**\n * Card component\n *\n * A content container with two variants matching the docs design:\n * - `feature` (default): Large card with icon, heading, and description\n * - `link`: Smaller clickable card for navigation\n *\n * @example\n * ```tsx\n * import { Card } from \"@semajsx/ui/card\";\n *\n * <Card icon=\"⚡\" heading=\"Fast\" description=\"Built for speed\" />\n * <Card variant=\"link\" heading=\"Guide\" description=\"Get started\" href=\"/docs\" />\n * ```\n */\n\nimport type { JSXNode } from \"@semajsx/core\";\nimport type { StyleToken } from \"@semajsx/style\";\nimport * as styles from \"./card.style\";\n\ntype ClassValue = string | StyleToken | ClassValue[] | false | null | undefined;\n\nexport interface CardProps {\n /** Card variant */\n variant?: \"feature\" | \"link\";\n /** Icon content (emoji or JSX) */\n icon?: JSXNode;\n /** Card heading */\n heading?: string;\n /** Card description */\n description?: string;\n /** Link URL (for \"link\" variant) */\n href?: string;\n /** Inline style string */\n style?: string;\n /** Additional CSS class(es) */\n class?: ClassValue;\n /** Content */\n children?: JSXNode;\n}\n\nexport function Card(props: CardProps): JSXNode {\n const variant = props.variant ?? \"feature\";\n\n const content = (\n <>\n {props.icon && <div class={styles.icon}>{props.icon}</div>}\n {props.heading && (\n <h3 class={[styles.heading, variant === \"link\" && styles.headingLink]}>{props.heading}</h3>\n )}\n {props.description && (\n <p class={[styles.desc, variant === \"link\" && styles.descLink]}>{props.description}</p>\n )}\n {props.children}\n </>\n );\n\n if (variant === \"link\") {\n return (\n <a\n href={props.href}\n class={[styles.root, styles.link, styles.linkStates, props.class]}\n style={props.style}\n >\n {content}\n </a>\n );\n }\n\n return (\n <div\n class={[styles.root, styles.feature, styles.featureStates, props.class]}\n style={props.style}\n >\n {content}\n </div>\n );\n}\n","/**\n * Built-in themes for @semajsx/ui\n *\n * Provides light (default) and dark themes. Custom themes can be\n * created using createTheme() from @semajsx/style.\n *\n * @example\n * ```tsx\n * import { lightTheme, darkTheme } from \"@semajsx/ui/theme\";\n * import { inject } from \"@semajsx/style\";\n *\n * // Apply default (light) theme to :root\n * inject(lightTheme);\n *\n * // Scope dark theme to an element\n * <div class={darkTheme}>\n * <Button>Dark button</Button>\n * </div>\n * ```\n */\n\nimport { createTheme } from \"@semajsx/style\";\nimport type { StyleToken } from \"@semajsx/style\";\nimport { tokens } from \"./tokens\";\n\n/**\n * Light theme - applies token defaults to :root\n */\nexport const lightTheme: StyleToken = createTheme(tokens);\n\n/**\n * Dark theme - scoped to a CSS class\n */\nexport const darkTheme: StyleToken = createTheme(tokens, {\n colors: {\n primary: \"#2997ff\",\n primaryHover: \"#5ab4ff\",\n primaryActive: \"#0071e3\",\n\n background: \"#000000\",\n surface: \"#1c1c1e\",\n border: \"rgba(255, 255, 255, 0.12)\",\n text: \"#f5f5f7\",\n textMuted: \"#a1a1a6\",\n textTertiary: \"#6e6e73\",\n\n danger: \"#ff453a\",\n dangerHover: \"#ff6961\",\n success: \"#30d158\",\n warning: \"#ffd60a\",\n info: \"#0a84ff\",\n tip: \"#bf5af2\",\n\n onPrimary: \"#ffffff\",\n onDanger: \"#ffffff\",\n },\n\n shadows: {\n sm: \"0 1px 3px rgba(0, 0, 0, 0.2)\",\n md: \"0 1px 4px rgba(0, 0, 0, 0.3)\",\n lg: \"0 8px 28px rgba(0, 0, 0, 0.4)\",\n primaryGlow: \"0 4px 16px rgba(41, 151, 255, 0.3)\",\n },\n});\n","/**\n * Button component styles\n *\n * All styles reference theme tokens via CSS custom properties,\n * so they respond to theme changes automatically.\n */\n\nimport { classes, rule, rules } from \"@semajsx/style\";\nimport { tokens } from \"../../theme/tokens\";\n\nconst c = classes([\n \"root\",\n \"solid\",\n \"outline\",\n \"ghost\",\n \"sm\",\n \"md\",\n \"lg\",\n \"danger\",\n \"icon\",\n] as const);\n\n// --- Base ---\n\nexport const root = rule`${c.root} {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: ${tokens.space.sm};\n border: 1.5px solid transparent;\n border-radius: ${tokens.radii.pill};\n font-family: ${tokens.fonts.base};\n font-weight: ${tokens.fontWeights.medium};\n line-height: ${tokens.lineHeights.tight};\n letter-spacing: -0.005em;\n cursor: pointer;\n user-select: none;\n transition: all ${tokens.transitions.normal};\n}`;\n\nexport const rootStates = rules(\n rule`${c.root}:focus-visible {\n outline: 2px solid ${tokens.colors.primary};\n outline-offset: 2px;\n }`,\n rule`${c.root}:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n pointer-events: none;\n }`,\n);\n\n// --- Variants ---\n\nexport const solid = rule`${c.solid} {\n background: ${tokens.colors.primary};\n color: ${tokens.colors.onPrimary};\n border-color: ${tokens.colors.primary};\n}`;\n\nexport const solidStates = rules(\n rule`${c.solid}:hover:not(:disabled) {\n background: ${tokens.colors.primaryHover};\n border-color: ${tokens.colors.primaryHover};\n transform: scale(1.02);\n box-shadow: ${tokens.shadows.primaryGlow};\n }`,\n rule`${c.solid}:active:not(:disabled) {\n background: ${tokens.colors.primaryActive};\n border-color: ${tokens.colors.primaryActive};\n transform: scale(0.98);\n box-shadow: none;\n }`,\n);\n\nexport const outline = rule`${c.outline} {\n background: transparent;\n color: ${tokens.colors.primary};\n border-color: ${tokens.colors.primary};\n}`;\n\nexport const outlineStates = rules(\n rule`${c.outline}:hover:not(:disabled) {\n background: ${tokens.colors.primary};\n color: ${tokens.colors.onPrimary};\n transform: scale(1.02);\n }`,\n rule`${c.outline}:active:not(:disabled) {\n background: ${tokens.colors.primaryActive};\n color: ${tokens.colors.onPrimary};\n transform: scale(0.98);\n }`,\n);\n\nexport const ghost = rule`${c.ghost} {\n background: transparent;\n color: ${tokens.colors.text};\n border-color: transparent;\n}`;\n\nexport const ghostStates = rules(\n rule`${c.ghost}:hover:not(:disabled) {\n background: ${tokens.colors.surface};\n }`,\n rule`${c.ghost}:active:not(:disabled) {\n background: ${tokens.colors.border};\n }`,\n);\n\n// --- Danger ---\n\nexport const danger = rule`${c.danger} {\n background: ${tokens.colors.danger};\n color: ${tokens.colors.onDanger};\n border-color: ${tokens.colors.danger};\n}`;\n\nexport const dangerStates = rules(\n rule`${c.danger}:hover:not(:disabled) {\n background: ${tokens.colors.dangerHover};\n border-color: ${tokens.colors.dangerHover};\n transform: scale(1.02);\n }`,\n rule`${c.danger}:focus-visible {\n outline-color: ${tokens.colors.danger};\n }`,\n);\n\n// --- Sizes ---\n\nexport const sm = rule`${c.sm} {\n padding: ${tokens.space.sm} ${tokens.space.lg};\n font-size: ${tokens.fontSizes.sm};\n}`;\n\nexport const md = rule`${c.md} {\n padding: ${tokens.space.md} ${tokens.space.xl};\n font-size: ${tokens.fontSizes.md};\n}`;\n\nexport const lg = rule`${c.lg} {\n padding: 0.875rem 1.75rem;\n font-size: ${tokens.fontSizes.lg};\n}`;\n\n// --- Icon slot ---\n\nexport const icon = rule`${c.icon} {\n display: inline-flex;\n flex-shrink: 0;\n}`;\n","/**\n * CodeBlock component styles\n *\n * Dark-themed code display with optional language header.\n */\n\nimport { classes, rule } from \"@semajsx/style\";\nimport { tokens } from \"../../theme/tokens\";\n\nconst c = classes([\"root\", \"header\", \"lang\", \"pre\", \"inline\"] as const);\n\n// --- Block ---\n\nexport const root = rule`${c.root} {\n margin: 1.5rem 0;\n border-radius: ${tokens.radii.md};\n overflow: hidden;\n border: 0.5px solid rgba(0, 0, 0, 0.1);\n font-family: ${tokens.fonts.mono};\n}`;\n\nexport const header = rule`${c.header} {\n background: #161617;\n padding: 0.5rem 1.25rem;\n display: flex;\n justify-content: space-between;\n align-items: center;\n}`;\n\nexport const lang = rule`${c.lang} {\n color: #86868b;\n font-size: 0.6875rem;\n text-transform: uppercase;\n font-weight: ${tokens.fontWeights.semibold};\n letter-spacing: 0.04em;\n font-family: ${tokens.fonts.mono};\n}`;\n\nexport const pre = rule`${c.pre} {\n background: #1d1d1f;\n color: #e5e5ea;\n padding: 1.25rem 1.5rem;\n overflow-x: auto;\n margin: 0;\n font-size: ${tokens.fontSizes.sm};\n line-height: 1.65;\n font-family: ${tokens.fonts.mono};\n}`;\n\n// --- Inline code ---\n\nexport const inline = rule`${c.inline} {\n background: rgba(0, 0, 0, 0.04);\n padding: 0.15rem 0.4rem;\n border-radius: 5px;\n font-size: 0.875em;\n border: 0.5px solid rgba(0, 0, 0, 0.06);\n font-family: ${tokens.fonts.mono};\n}`;\n","/**\n * Pre-collected CSS for SSG/SSR usage\n *\n * Since @semajsx/style's inject() requires a DOM, this module provides\n * all component CSS as a static string for server-side rendering.\n *\n * @example\n * ```tsx\n * import { componentCSS } from \"@semajsx/ui/css\";\n *\n * // Include in a <style> tag for SSG output\n * <style>{componentCSS}</style>\n * ```\n */\n\nimport { isStyleToken } from \"@semajsx/style\";\nimport type { StyleToken } from \"@semajsx/style\";\nimport { lightTheme } from \"./theme/themes\";\nimport * as buttonStyles from \"./components/button/button.style\";\nimport * as cardStyles from \"./components/card/card.style\";\nimport * as calloutStyles from \"./components/callout/callout.style\";\nimport * as badgeStyles from \"./components/badge/badge.style\";\nimport * as codeBlockStyles from \"./components/code-block/code-block.style\";\n\nfunction collectCSS(styles: Record<string, unknown>): string {\n return Object.values(styles)\n .filter((v): v is StyleToken => isStyleToken(v))\n .map((t) => t.__cssTemplate)\n .join(\"\\n\");\n}\n\n/** All @semajsx/ui component CSS (theme variables + component rules) */\nexport const componentCSS: string = [\n lightTheme.__cssTemplate,\n collectCSS(buttonStyles),\n collectCSS(cardStyles),\n collectCSS(calloutStyles),\n collectCSS(badgeStyles),\n collectCSS(codeBlockStyles),\n].join(\"\\n\");\n","/** @jsxImportSource @semajsx/dom */\n\nimport type { VNode, JSXNode } from \"@semajsx/core\";\nimport type { DocumentProps } from \"../../types\";\nimport type { DocsThemeOptions, NavLink } from \"./types\";\nimport { THEME_CSS } from \"./styles\";\nimport { Icon } from \"../lucide/component\";\n\nimport { Callout } from \"@semajsx/ui/components/callout\";\nimport { Badge } from \"@semajsx/ui/components/badge\";\nimport { Card } from \"@semajsx/ui/components/card\";\nimport { componentCSS } from \"@semajsx/ui/css\";\n\nimport type { BadgeColor } from \"@semajsx/ui/components/badge\";\n\n/** Concatenate class names, filtering falsy values */\nfunction cx(...args: (string | false | null | undefined)[]): string {\n return args.filter(Boolean).join(\" \");\n}\n\n// =============================================================================\n// CodeBlock — MDX component (kept custom for Shiki className integration)\n// =============================================================================\n\ninterface CodeBlockProps {\n children: string;\n className?: string;\n language?: string;\n}\n\nexport function CodeBlock({ children, className, language }: CodeBlockProps): VNode {\n const lang = language || (className?.replace(/^language-/, \"\") ?? \"text\");\n return (\n <div class=\"dt-code-block\">\n {lang && lang !== \"text\" && (\n <div class=\"dt-code-header\">\n <span class=\"dt-code-lang\">{lang}</span>\n </div>\n )}\n <pre class={className}>\n <code>{children}</code>\n </pre>\n </div>\n );\n}\n\n// =============================================================================\n// Difficulty → Badge color mapping\n// =============================================================================\n\nconst DIFFICULTY_COLORS: Record<string, BadgeColor> = {\n beginner: \"success\",\n intermediate: \"warning\",\n advanced: \"danger\",\n};\n\nconst DIFFICULTY_LABELS: Record<string, string> = {\n beginner: \"Beginner\",\n intermediate: \"Intermediate\",\n advanced: \"Advanced\",\n};\n\n// =============================================================================\n// Component factory — creates all page components bound to theme options\n// =============================================================================\n\ninterface DocsIndexProps {\n docs: Array<{\n slug: string;\n data: { title: string; description?: string; category?: string; order: number };\n }>;\n}\n\ninterface DocPageProps {\n doc: { data: { title: string; description?: string } };\n content: VNode;\n}\n\ninterface GuidesIndexProps {\n guides: Array<{\n slug: string;\n data: { title: string; description?: string; difficulty: string; order: number };\n }>;\n}\n\ninterface GuidePageProps {\n guide: { data: { title: string; description?: string; difficulty: string } };\n content: VNode;\n}\n\n/** Component map returned by createComponents */\nexport interface DocsThemeComponents {\n Document: (props: DocumentProps) => VNode;\n Layout: (props: { children: JSXNode }) => VNode;\n HomePage: () => VNode;\n DocsIndex: (props: DocsIndexProps) => VNode;\n DocPage: (props: DocPageProps) => VNode;\n GuidesIndex: (props: GuidesIndexProps) => VNode;\n GuidePage: (props: GuidePageProps) => VNode;\n NotFound: () => VNode;\n Callout: typeof Callout;\n CodeBlock: typeof CodeBlock;\n}\n\nexport function createComponents(options: DocsThemeOptions): DocsThemeComponents {\n // --------------------------------------------------\n // Document\n // --------------------------------------------------\n function Document(props: DocumentProps): VNode {\n const { children, title, scripts, css } = props;\n const defaultTitle = options.title;\n const pageTitle = title ?? defaultTitle;\n const desc = options.description ?? \"\";\n\n return (\n <html lang=\"en\">\n <head>\n <meta charSet=\"UTF-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n {desc && <meta name=\"description\" content={desc} />}\n <meta name=\"theme-color\" content=\"#fbfbfd\" />\n <meta name=\"color-scheme\" content=\"light\" />\n <title>{pageTitle}</title>\n <link rel=\"preconnect\" href=\"https://fonts.googleapis.com\" />\n <link rel=\"preconnect\" href=\"https://fonts.gstatic.com\" crossOrigin=\"\" />\n <link\n href=\"https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap\"\n rel=\"stylesheet\"\n />\n {css?.map((href) => (\n <link key={href} rel=\"stylesheet\" href={href} />\n ))}\n </head>\n <body>\n {children}\n {scripts}\n </body>\n </html>\n );\n }\n\n // --------------------------------------------------\n // Layout (nav + main + footer)\n // --------------------------------------------------\n function Layout({ children }: { children: JSXNode }): VNode {\n const footerLinks = options.footer?.links ?? options.nav.links;\n const copyrightName = options.footer?.copyright ?? options.title;\n\n return (\n <div class=\"dt-root\">\n <style>{componentCSS}</style>\n <style>{THEME_CSS}</style>\n\n {/* Navigation */}\n <nav class=\"dt-glass-nav\">\n <div class=\"dt-nav-inner\">\n <a href=\"/\" class=\"dt-nav-logo\">\n {options.nav.logo}\n </a>\n <ul class=\"dt-nav-links\">\n {options.nav.links.map((link: NavLink) => (\n <li key={link.href}>\n <a\n href={link.href}\n class=\"dt-nav-link\"\n {...(link.external ? { target: \"_blank\", rel: \"noopener noreferrer\" } : {})}\n >\n {link.label}\n </a>\n </li>\n ))}\n </ul>\n </div>\n </nav>\n\n <main class=\"dt-main\">{children}</main>\n\n {/* Footer */}\n <footer class=\"dt-footer\">\n <div class=\"dt-footer-inner\">\n <div class=\"dt-footer-links\">\n {footerLinks.map((link: NavLink) => (\n <a\n key={link.href}\n href={link.href}\n class=\"dt-footer-link\"\n {...(link.external ? { target: \"_blank\", rel: \"noopener noreferrer\" } : {})}\n >\n {link.label}\n </a>\n ))}\n </div>\n <p class=\"dt-footer-copy\">\n {`\\u00A9 ${new Date().getFullYear()} ${copyrightName}`}. MIT License.\n </p>\n </div>\n </footer>\n </div>\n );\n }\n\n // --------------------------------------------------\n // Home Page\n // --------------------------------------------------\n function HomePage(): VNode {\n return (\n <Layout>\n {/* Hero */}\n {options.hero && (\n <div\n class={cx(\"dt-hero-bg\", \"dt-hero-section\")}\n style=\"padding: 100px 24px 80px; position: relative;\"\n >\n <div style=\"max-width: 680px; margin: 0 auto; position: relative; z-index: 1; text-align: center;\">\n <h1 class={cx(\"dt-hero-title\", \"dt-anim-slide-up\")}>{options.hero.title}</h1>\n <p class={cx(\"dt-hero-subtitle\", \"dt-anim-slide-up\", \"dt-stagger-1\")}>\n {options.hero.subtitle}\n </p>\n {options.hero.actions && options.hero.actions.length > 0 && (\n <div class={cx(\"dt-hero-cta\", \"dt-anim-slide-up\", \"dt-stagger-2\")}>\n {options.hero.actions.map((action) => (\n <a\n key={action.href}\n href={action.href}\n class={action.primary ? \"dt-primary-btn\" : \"dt-secondary-btn\"}\n >\n {action.label}\n </a>\n ))}\n </div>\n )}\n </div>\n </div>\n )}\n\n {/* Features */}\n {options.features && (\n <section\n class=\"dt-section-features\"\n style=\"max-width: 1080px; margin: 0 auto; padding: 80px 24px;\"\n >\n <div style=\"text-align: center; margin-bottom: 3.5rem;\">\n <h2 class={cx(\"dt-section-title\", \"dt-anim-slide-up\")}>{options.features.title}</h2>\n <p class={cx(\"dt-section-subtitle\", \"dt-anim-slide-up\", \"dt-stagger-1\")}>\n {options.features.subtitle}\n </p>\n </div>\n <div\n class=\"dt-features-grid\"\n style=\"display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem;\"\n >\n {options.features.items.map((item, i) => (\n <Card\n key={item.title}\n icon={<Icon name={item.icon} size={24} />}\n heading={item.title}\n description={item.description}\n class={cx(\"dt-anim-scale-in\", `dt-stagger-${Math.min(i + 2, 5)}`)}\n />\n ))}\n </div>\n </section>\n )}\n\n {/* Quick Links */}\n {options.quickLinks && (\n <section\n class=\"dt-section-links\"\n style=\"max-width: 1080px; margin: 0 auto; padding: 0 24px 100px;\"\n >\n <div\n class=\"dt-section-links-inner\"\n style=\"border-top: 0.5px solid rgba(0, 0, 0, 0.06); padding-top: 80px; text-align: center;\"\n >\n <h2 class={cx(\"dt-section-title\", \"dt-anim-slide-up\")}>{options.quickLinks.title}</h2>\n <p class={cx(\"dt-section-subtitle\", \"dt-anim-slide-up\", \"dt-stagger-1\")}>\n {options.quickLinks.subtitle}\n </p>\n <div\n class=\"dt-links-grid\"\n style=\"display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.25rem; max-width: 720px; margin: 0 auto;\"\n >\n {options.quickLinks.items.map((item, i) => (\n <Card\n key={item.href}\n variant=\"link\"\n href={item.href}\n heading={item.title}\n description={item.description}\n class={cx(\"dt-anim-scale-in\", `dt-stagger-${Math.min(i + 2, 5)}`)}\n style=\"text-align: left;\"\n />\n ))}\n </div>\n </div>\n </section>\n )}\n </Layout>\n );\n }\n\n // --------------------------------------------------\n // Docs Index\n // --------------------------------------------------\n function DocsIndex({ docs: docsList }: DocsIndexProps): VNode {\n const docsConf = options.docs;\n const heading = docsConf?.heading ?? \"Documentation\";\n const desc = docsConf?.description ?? \"\";\n\n const byCategory = docsList.reduce(\n (acc, doc) => {\n const category = doc.data.category || \"General\";\n if (!acc[category]) acc[category] = [];\n acc[category].push(doc);\n return acc;\n },\n {} as Record<string, typeof docsList>,\n );\n Object.values(byCategory).forEach((items) => items.sort((a, b) => a.data.order - b.data.order));\n\n const basePath = docsConf?.basePath ?? \"/docs\";\n\n return (\n <Layout>\n <div style=\"max-width: 720px;\">\n <div style=\"margin-bottom: 3rem;\">\n <h1 class={cx(\"dt-page-title\", \"dt-anim-slide-up\")}>{heading}</h1>\n {desc && <p class={cx(\"dt-page-desc\", \"dt-anim-slide-up\", \"dt-stagger-1\")}>{desc}</p>}\n </div>\n {Object.entries(byCategory).map(([category, items]) => (\n <section key={category} class=\"dt-fade-in\" style=\"margin-bottom: 2.5rem;\">\n <h2 class=\"dt-category-heading\">{category}</h2>\n <div style=\"display: flex; flex-direction: column; gap: 0.75rem;\">\n {items.map((doc, i) => (\n <Card\n key={doc.slug}\n variant=\"link\"\n href={`${basePath}/${doc.slug}`}\n heading={doc.data.title}\n description={doc.data.description}\n class={cx(\"dt-anim-scale-in\")}\n style={`animation-delay: ${0.1 + i * 0.08}s;`}\n />\n ))}\n </div>\n </section>\n ))}\n </div>\n </Layout>\n );\n }\n\n // --------------------------------------------------\n // Doc Page\n // --------------------------------------------------\n function DocPage({ doc, content }: DocPageProps): VNode {\n return (\n <Layout>\n <article class=\"dt-page-container\">\n <div style=\"margin-bottom: 2.5rem;\">\n <h1 class={cx(\"dt-page-title\", \"dt-anim-slide-up\")}>{doc.data.title}</h1>\n {doc.data.description && (\n <p class={cx(\"dt-content-desc\", \"dt-anim-slide-up\", \"dt-stagger-1\")}>\n {doc.data.description}\n </p>\n )}\n </div>\n <div class={cx(\"dt-content\", \"dt-fade-in\")}>{content}</div>\n </article>\n </Layout>\n );\n }\n\n // --------------------------------------------------\n // Guides Index\n // --------------------------------------------------\n function GuidesIndex({ guides: guidesList }: GuidesIndexProps): VNode {\n const guidesConf = options.guides;\n const heading = guidesConf?.heading ?? \"Guides\";\n const desc = guidesConf?.description ?? \"\";\n\n const byDifficulty = guidesList.reduce(\n (acc, guide) => {\n const difficulty = guide.data.difficulty || \"beginner\";\n if (!acc[difficulty]) acc[difficulty] = [];\n acc[difficulty].push(guide);\n return acc;\n },\n {} as Record<string, typeof guidesList>,\n );\n Object.values(byDifficulty).forEach((items) =>\n items.sort((a, b) => a.data.order - b.data.order),\n );\n\n const basePath = guidesConf?.basePath ?? \"/guides\";\n\n return (\n <Layout>\n <div style=\"max-width: 720px;\">\n <div style=\"margin-bottom: 3rem;\">\n <h1 class={cx(\"dt-page-title\", \"dt-anim-slide-up\")}>{heading}</h1>\n {desc && <p class={cx(\"dt-page-desc\", \"dt-anim-slide-up\", \"dt-stagger-1\")}>{desc}</p>}\n </div>\n {Object.entries(byDifficulty).map(([difficulty, items]) => (\n <section key={difficulty} class=\"dt-fade-in\" style=\"margin-bottom: 2.5rem;\">\n <h2 class=\"dt-category-heading\">{DIFFICULTY_LABELS[difficulty] ?? difficulty}</h2>\n <div style=\"display: flex; flex-direction: column; gap: 0.75rem;\">\n {items.map((guide, i) => (\n <Card\n key={guide.slug}\n variant=\"link\"\n href={`${basePath}/${guide.slug}`}\n class={cx(\"dt-anim-scale-in\")}\n style={`animation-delay: ${0.1 + i * 0.08}s;`}\n >\n <div style=\"display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.375rem;\">\n <h3 class=\"dt-card-title\" style=\"margin: 0;\">\n {guide.data.title}\n </h3>\n <Badge color={DIFFICULTY_COLORS[guide.data.difficulty] ?? \"default\"}>\n {guide.data.difficulty}\n </Badge>\n </div>\n {guide.data.description && <p class=\"dt-card-desc\">{guide.data.description}</p>}\n </Card>\n ))}\n </div>\n </section>\n ))}\n </div>\n </Layout>\n );\n }\n\n // --------------------------------------------------\n // Guide Page\n // --------------------------------------------------\n function GuidePage({ guide, content }: GuidePageProps): VNode {\n return (\n <Layout>\n <article class=\"dt-page-container\">\n <div style=\"margin-bottom: 2.5rem;\">\n <div class=\"dt-fade-in\" style=\"margin-bottom: 1rem;\">\n <Badge color={DIFFICULTY_COLORS[guide.data.difficulty] ?? \"default\"}>\n {guide.data.difficulty}\n </Badge>\n </div>\n <h1 class={cx(\"dt-page-title\", \"dt-anim-slide-up\")}>{guide.data.title}</h1>\n {guide.data.description && (\n <p class={cx(\"dt-content-desc\", \"dt-anim-slide-up\", \"dt-stagger-1\")}>\n {guide.data.description}\n </p>\n )}\n </div>\n <div class={cx(\"dt-content\", \"dt-fade-in\")}>{content}</div>\n </article>\n </Layout>\n );\n }\n\n // --------------------------------------------------\n // 404 Not Found\n // --------------------------------------------------\n function NotFound(): VNode {\n return (\n <Layout>\n <div\n class={cx(\"dt-hero-bg\", \"dt-not-found-section\")}\n style=\"padding: 100px 24px 80px; position: relative;\"\n >\n <div style=\"max-width: 680px; margin: 0 auto; position: relative; z-index: 1; text-align: center;\">\n <h1 class={cx(\"dt-not-found-title\", \"dt-anim-slide-up\")}>404</h1>\n <p\n class={cx(\"dt-hero-subtitle\", \"dt-anim-slide-up\", \"dt-stagger-1\")}\n style=\"margin-bottom: 0.75rem;\"\n >\n Page Not Found\n </p>\n <p\n class={cx(\"dt-anim-slide-up\", \"dt-stagger-2\")}\n style=\"color: #86868b; font-size: 1rem; margin-bottom: 2.5rem; max-width: 28rem; margin-left: auto; margin-right: auto; line-height: 1.6;\"\n >\n The page you're looking for doesn't exist or has been moved.\n </p>\n <div class={cx(\"dt-hero-cta\", \"dt-anim-slide-up\", \"dt-stagger-3\", \"dt-not-found-cta\")}>\n <a href=\"/\" class=\"dt-primary-btn\">\n Go Back Home\n </a>\n <a href={options.docs?.basePath ?? \"/docs\"} class=\"dt-secondary-btn\">\n View Docs\n </a>\n </div>\n </div>\n </div>\n </Layout>\n );\n }\n\n return {\n Document,\n Layout,\n HomePage,\n DocsIndex,\n DocPage,\n GuidesIndex,\n GuidePage,\n NotFound,\n Callout,\n CodeBlock,\n };\n}\n\n// Re-export for plugin index\nexport { Callout };\n","import { writeFile, mkdir } from \"fs/promises\";\nimport { join, dirname } from \"path\";\nimport type { SSGConfig, SSGPlugin, SSGInstance, CollectionEntry } from \"../../types\";\nimport type { LlmsOptions } from \"./types\";\n\nexport type { LlmsOptions, LlmsSection, LlmsLink } from \"./types\";\n\n// =============================================================================\n// Helpers\n// =============================================================================\n\nfunction normalizePath(path: string): string {\n return path.startsWith(\"/\") ? path : `/${path}`;\n}\n\nfunction resolveUrl(base: string | undefined, path: string): string {\n if (!base) return path;\n return `${base.replace(/\\/$/, \"\")}${path}`;\n}\n\nfunction getEntryTitle(entry: CollectionEntry): string {\n const data = entry.data as Record<string, unknown>;\n return (data.title as string) ?? entry.slug;\n}\n\nfunction getEntryDescription(entry: CollectionEntry): string | undefined {\n const data = entry.data as Record<string, unknown>;\n return data.description as string | undefined;\n}\n\nfunction formatLink(title: string, url: string, description?: string): string {\n return description ? `- [${title}](${url}): ${description}` : `- [${title}](${url})`;\n}\n\n// =============================================================================\n// llms.txt Generator\n// =============================================================================\n\n/**\n * Generate llms.txt content following the llms.txt specification.\n *\n * Format:\n * - H1: site title (required)\n * - Blockquote: site description (optional)\n * - H2 sections: collection entries as markdown links\n * - ## Optional: additional links\n *\n * @see https://llmstxt.org/\n */\nfunction generateLlmsTxt(\n options: LlmsOptions,\n sectionEntries: Map<string, CollectionEntry[]>,\n): string {\n const lines: string[] = [];\n\n lines.push(`# ${options.title}`);\n lines.push(\"\");\n\n if (options.description) {\n lines.push(`> ${options.description}`);\n lines.push(\"\");\n }\n\n for (const section of options.sections ?? []) {\n const entries = sectionEntries.get(section.collection) ?? [];\n if (entries.length === 0) continue;\n\n const basePath = normalizePath(section.basePath);\n lines.push(`## ${section.title}`);\n lines.push(\"\");\n\n for (const entry of entries) {\n const title = getEntryTitle(entry);\n const url = resolveUrl(options.url, `${basePath}/${entry.slug}`);\n const desc = getEntryDescription(entry);\n lines.push(formatLink(title, url, desc));\n }\n\n lines.push(\"\");\n }\n\n if (options.links?.length) {\n lines.push(\"## Optional\");\n lines.push(\"\");\n for (const link of options.links) {\n lines.push(formatLink(link.title, link.url, link.description));\n }\n lines.push(\"\");\n }\n\n return lines.join(\"\\n\");\n}\n\n// =============================================================================\n// llms-full.txt Generator\n// =============================================================================\n\n/**\n * Generate llms-full.txt with complete content for each entry.\n * Includes the full markdown body of every collection entry.\n */\nfunction generateLlmsFullTxt(\n options: LlmsOptions,\n sectionEntries: Map<string, CollectionEntry[]>,\n): string {\n const lines: string[] = [];\n\n lines.push(`# ${options.title}`);\n lines.push(\"\");\n\n if (options.description) {\n lines.push(`> ${options.description}`);\n lines.push(\"\");\n }\n\n for (const section of options.sections ?? []) {\n const entries = sectionEntries.get(section.collection) ?? [];\n if (entries.length === 0) continue;\n\n const basePath = normalizePath(section.basePath);\n lines.push(`## ${section.title}`);\n lines.push(\"\");\n\n for (const entry of entries) {\n const title = getEntryTitle(entry);\n const url = resolveUrl(options.url, `${basePath}/${entry.slug}`);\n const desc = getEntryDescription(entry);\n\n lines.push(`### ${title}`);\n\n if (desc) {\n lines.push(\"\");\n lines.push(`> ${desc}`);\n }\n\n lines.push(\"\");\n lines.push(`Source: ${url}`);\n lines.push(\"\");\n lines.push(entry.body.trim());\n lines.push(\"\");\n lines.push(\"---\");\n lines.push(\"\");\n }\n }\n\n return lines.join(\"\\n\");\n}\n\n// =============================================================================\n// Per-Entry Markdown Generator\n// =============================================================================\n\nfunction generateEntryMarkdown(entry: CollectionEntry): string {\n const title = getEntryTitle(entry);\n const desc = getEntryDescription(entry);\n const lines: string[] = [];\n\n lines.push(`# ${title}`);\n\n if (desc) {\n lines.push(\"\");\n lines.push(`> ${desc}`);\n }\n\n lines.push(\"\");\n lines.push(entry.body.trim());\n lines.push(\"\");\n\n return lines.join(\"\\n\");\n}\n\n// =============================================================================\n// Plugin\n// =============================================================================\n\n/**\n * LLMs plugin for SSG.\n *\n * Generates `llms.txt`, `llms-full.txt`, and per-page `.md` files\n * following the llms.txt specification, making your site easily\n * consumable by LLMs and AI agents.\n *\n * @see https://llmstxt.org/\n *\n * @example\n * ```tsx\n * import { createSSG } from \"@semajsx/ssg\";\n * import { llms } from \"@semajsx/ssg/plugins/llms\";\n *\n * const ssg = createSSG({\n * outDir: \"./dist\",\n * plugins: [\n * llms({\n * title: \"My Project\",\n * description: \"Documentation for My Project\",\n * url: \"https://docs.myproject.com\",\n * sections: [\n * { title: \"Documentation\", collection: \"docs\", basePath: \"/docs\" },\n * ],\n * }),\n * ],\n * });\n * ```\n */\nexport function llms(options: LlmsOptions): SSGPlugin {\n let outDir = \"\";\n\n return {\n name: \"llms\",\n enforce: \"post\",\n\n configResolved(config: SSGConfig) {\n outDir = config.outDir ?? \"./dist\";\n },\n\n async buildEnd(_result, ssg: SSGInstance) {\n const genLlmsTxt = options.llmsTxt !== false;\n const genLlmsFullTxt = options.llmsFullTxt !== false;\n const genMarkdownPages = options.markdownPages !== false;\n\n // Collect entries for each configured section\n const sectionEntries = new Map<string, CollectionEntry[]>();\n\n for (const section of options.sections ?? []) {\n try {\n const entries = await ssg.getCollection(section.collection);\n sectionEntries.set(section.collection, entries);\n } catch {\n // Collection not found — skip silently\n sectionEntries.set(section.collection, []);\n }\n }\n\n await mkdir(outDir, { recursive: true });\n\n // Generate llms.txt\n if (genLlmsTxt) {\n const content = generateLlmsTxt(options, sectionEntries);\n await writeFile(join(outDir, \"llms.txt\"), content, \"utf-8\");\n }\n\n // Generate llms-full.txt\n if (genLlmsFullTxt) {\n const content = generateLlmsFullTxt(options, sectionEntries);\n await writeFile(join(outDir, \"llms-full.txt\"), content, \"utf-8\");\n }\n\n // Generate per-entry .md files\n if (genMarkdownPages) {\n for (const section of options.sections ?? []) {\n const basePath = normalizePath(section.basePath);\n const entries = sectionEntries.get(section.collection) ?? [];\n for (const entry of entries) {\n const mdPath = `${basePath}/${entry.slug}.md`;\n const fullPath = join(outDir, mdPath.slice(1)); // strip leading /\n const content = generateEntryMarkdown(entry);\n\n await mkdir(dirname(fullPath), { recursive: true });\n await writeFile(fullPath, content, \"utf-8\");\n }\n }\n }\n },\n };\n}\n\n// Export generators for testing\nexport { generateLlmsTxt as _generateLlmsTxt, generateLlmsFullTxt as _generateLlmsFullTxt };\n","import { z } from \"zod\";\nimport type { SSGPlugin, Collection, RouteConfig } from \"../../types\";\nimport { defineCollection } from \"../../index\";\nimport type { DocsThemeOptions } from \"./types\";\nimport { createComponents, Callout, CodeBlock } from \"./components\";\nimport { lucide as lucidePlugin } from \"../lucide/index\";\nimport { llms as llmsPlugin } from \"../llms/index\";\nimport type { LlmsSection } from \"../llms/types\";\nimport type { Component } from \"@semajsx/core\";\n\nexport type {\n DocsThemeOptions,\n LlmsThemeOptions,\n NavLink,\n HeroAction,\n FeatureItem,\n QuickLinkItem,\n DocsConfig,\n GuidesConfig,\n} from \"./types\";\n\nexport { Callout, CodeBlock } from \"./components\";\n\n// =============================================================================\n// Schemas\n// =============================================================================\n\nconst docsSchema = z.object({\n title: z.string(),\n description: z.string().optional(),\n order: z.number().default(999),\n category: z.string().optional(),\n});\n\nconst guidesSchema = z.object({\n title: z.string(),\n description: z.string().optional(),\n order: z.number().default(999),\n difficulty: z.enum([\"beginner\", \"intermediate\", \"advanced\"]).default(\"beginner\"),\n});\n\n// =============================================================================\n// Plugin factory\n// =============================================================================\n\n/**\n * Docs theme plugin for SSG.\n *\n * Provides an Apple-inspired documentation site with:\n * - Frosted glass navigation\n * - Home page with hero, features, and quick links\n * - Docs collection with category grouping\n * - Guides collection with difficulty levels\n * - MDX components (Callout, CodeBlock)\n * - Responsive design\n *\n * All text content, navigation links, and site metadata\n * are configured through options — nothing is hardcoded.\n *\n * @example\n * ```tsx\n * import { createSSG } from \"@semajsx/ssg\";\n * import { docsTheme } from \"@semajsx/ssg/plugins/docs-theme\";\n * import { fileSource } from \"@semajsx/ssg\";\n *\n * const ssg = createSSG({\n * outDir: \"./dist\",\n * plugins: [\n * docsTheme({\n * title: \"My Docs\",\n * nav: {\n * logo: \"MyProject\",\n * links: [\n * { label: \"Docs\", href: \"/docs\" },\n * { label: \"GitHub\", href: \"https://github.com/...\", external: true },\n * ],\n * },\n * hero: {\n * title: \"MyProject\",\n * subtitle: \"A great project.\",\n * actions: [{ label: \"Get Started\", href: \"/docs/intro\", primary: true }],\n * },\n * docs: { source: fileSource({ directory: \"content/docs\" }, rootDir) },\n * }),\n * ],\n * });\n * ```\n */\nexport function docsTheme(options: DocsThemeOptions): SSGPlugin[] {\n const components = createComponents(options);\n const docsBasePath = options.docs?.basePath ?? \"/docs\";\n const guidesBasePath = options.guides?.basePath ?? \"/guides\";\n\n const mainPlugin: SSGPlugin = {\n name: \"docs-theme\",\n\n config() {\n const collections: Collection[] = [];\n const routes: RouteConfig[] = [];\n\n // --- Collections ---\n\n if (options.docs) {\n collections.push(\n defineCollection({\n name: \"docs\",\n source: options.docs.source,\n schema: docsSchema,\n }),\n );\n }\n\n if (options.guides) {\n collections.push(\n defineCollection({\n name: \"guides\",\n source: options.guides.source,\n schema: guidesSchema,\n }),\n );\n }\n\n // --- Routes ---\n\n // Home page\n routes.push({\n path: \"/\",\n component: components.HomePage,\n props: { title: options.title },\n });\n\n // Docs routes\n if (options.docs) {\n routes.push({\n path: docsBasePath,\n component: components.DocsIndex,\n props: async (ssg) => ({\n title: options.docs?.heading ?? \"Documentation\",\n docs: await ssg.getCollection(\"docs\"),\n }),\n });\n\n routes.push({\n path: `${docsBasePath}/:slug`,\n component: components.DocPage,\n getStaticPaths: async (ssg) => {\n const allDocs = await ssg.getCollection(\"docs\");\n return Promise.all(\n allDocs.map(async (doc) => {\n const { Content } = await doc.render();\n return {\n params: { slug: doc.slug },\n props: {\n doc,\n content: Content(),\n title: `${(doc.data as { title: string }).title} | ${options.title}`,\n },\n };\n }),\n );\n },\n });\n }\n\n // Guides routes\n if (options.guides) {\n routes.push({\n path: guidesBasePath,\n component: components.GuidesIndex,\n props: async (ssg) => ({\n title: options.guides?.heading ?? \"Guides\",\n guides: await ssg.getCollection(\"guides\"),\n }),\n });\n\n routes.push({\n path: `${guidesBasePath}/:slug`,\n component: components.GuidePage,\n getStaticPaths: async (ssg) => {\n const allGuides = await ssg.getCollection(\"guides\");\n return Promise.all(\n allGuides.map(async (guide) => {\n const { Content } = await guide.render();\n return {\n params: { slug: guide.slug },\n props: {\n guide,\n content: Content(),\n title: `${(guide.data as { title: string }).title} | ${options.title}`,\n },\n };\n }),\n );\n },\n });\n }\n\n // 404 page\n routes.push({\n path: \"/404\",\n component: components.NotFound,\n props: { title: `404 - Page Not Found | ${options.title}` },\n });\n\n // --- MDX ---\n\n const mdxComponents: Record<string, Component> = {\n Callout,\n CodeBlock,\n ...options.mdx?.components,\n };\n\n return {\n document: components.Document,\n collections,\n routes,\n mdx: {\n remarkPlugins: options.mdx?.remarkPlugins,\n rehypePlugins: options.mdx?.rehypePlugins,\n components: mdxComponents,\n },\n };\n },\n };\n\n // Compose sub-plugins Vite-style: return flat array\n const plugins: SSGPlugin[] = [mainPlugin];\n\n if (options.lucide !== false) {\n const lucideOpts = typeof options.lucide === \"object\" ? options.lucide : {};\n plugins.push(lucidePlugin(lucideOpts));\n }\n\n // LLMs (llms.txt) — enabled by default when docs or guides exist\n const hasContent = options.docs || options.guides;\n if (options.llms !== false && hasContent) {\n const llmsOpts = typeof options.llms === \"object\" ? options.llms : {};\n\n // Auto-derive sections from configured collections\n const sections: LlmsSection[] = [];\n if (options.docs) {\n sections.push({\n title: options.docs.heading ?? \"Documentation\",\n collection: \"docs\",\n basePath: docsBasePath,\n });\n }\n if (options.guides) {\n sections.push({\n title: options.guides.heading ?? \"Guides\",\n collection: \"guides\",\n basePath: guidesBasePath,\n });\n }\n\n plugins.push(\n llmsPlugin({\n title: options.title,\n description: options.description,\n url: llmsOpts.url,\n sections,\n links: llmsOpts.links,\n llmsTxt: llmsOpts.llmsTxt,\n llmsFullTxt: llmsOpts.llmsFullTxt,\n markdownPages: llmsOpts.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B,YAAY;GACZ,UAAU;GACX,CAAC;AAEJ,MAAI,QAAQ,OACV,UAAS,KAAK;GACZ,OAAO,QAAQ,OAAO,WAAW;GACjC,YAAY;GACZ,UAAU;GACX,CAAC;AAGJ,UAAQ,KACNC,KAAW;GACT,OAAO,QAAQ;GACf,aAAa,QAAQ;GACrB,KAAK,SAAS;GACd;GACA,OAAO,SAAS;GAChB,SAAS,SAAS;GAClB,aAAa,SAAS;GACtB,eAAe,SAAS;GACzB,CAAC,CACH;;AAGH,QAAO"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import "../../types-
|
|
2
|
-
import { i as IconProps, n as lucide, r as Icon, t as LucidePluginOptions } from "../../index-
|
|
1
|
+
import "../../types-C9fiRu6l.mjs";
|
|
2
|
+
import { i as IconProps, n as lucide, r as Icon, t as LucidePluginOptions } from "../../index-Ch9GwToI.mjs";
|
|
3
3
|
export { Icon, IconProps, LucidePluginOptions, lucide };
|
|
@@ -142,8 +142,8 @@ interface SSGPlugin {
|
|
|
142
142
|
configResolved?(config: SSGConfig): void;
|
|
143
143
|
/** Called before build starts */
|
|
144
144
|
buildStart?(): void | Promise<void>;
|
|
145
|
-
/** Called after build completes */
|
|
146
|
-
buildEnd?(result: BuildResult): void | Promise<void>;
|
|
145
|
+
/** Called after build completes. Receives the SSG instance for post-build operations. */
|
|
146
|
+
buildEnd?(result: BuildResult, ssg: SSGInstance): void | Promise<void>;
|
|
147
147
|
}
|
|
148
148
|
interface SSGConfig<TCollections extends readonly Collection[] = Collection[], TRegistry extends Record<string, unknown> = InferCollections<TCollections>> {
|
|
149
149
|
/** Output directory for built files */
|
|
@@ -217,4 +217,4 @@ interface SSGInstance<TRegistry extends Record<string, unknown> = Record<string,
|
|
|
217
217
|
}
|
|
218
218
|
//#endregion
|
|
219
219
|
export { Watcher as S, SSGPlugin as _, Collection as a, WatchCallback as b, CollectionSource as c, InferCollections as d, MDXConfig as f, SSGInstance as g, SSGConfig as h, ChangeSet as i, DocumentProps as l, RouteConfig as m, BuildResult as n, CollectionConfig as o, RawHTML as p, BuildState as r, CollectionEntry as s, BuildOptions as t, DocumentTemplate as u, SSGPluginConfig as v, WatchOptions as x, StaticPath as y };
|
|
220
|
-
//# sourceMappingURL=types-
|
|
220
|
+
//# sourceMappingURL=types-C9fiRu6l.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types-
|
|
1
|
+
{"version":3,"file":"types-C9fiRu6l.d.mts","names":[],"sources":["../../ssg/src/types.ts"],"mappings":";;;;;;AAWA;;KAAY,gBAAA,oBAAoC,UAAA,cACxC,CAAA,YAAa,CAAA,WAAY,CAAA,SAAU,UAAA,YAAsB,CAAA;AAAA,UAOhD,eAAA;;EAEf,EAAA;;EAEA,IAAA;;EAEA,IAAA,EAAM,CAAA;;EAEN,IAAA;;EAEA,MAAA,QAAc,OAAA;IAAU,OAAA,QAAe,KAAA;EAAA;AAAA;AAAA,UAOxB,SAAA;;EAEf,MAAA;EA1B+D;EA4B/D,KAAA,EAAO,eAAA,CAAgB,CAAA;EArBR;EAuBf,OAAA,EAAS,eAAA,CAAgB,CAAA;;EAEzB,OAAA;AAAA;AAAA,KAGU,aAAA,iBAA8B,OAAA,EAAS,SAAA,CAAU,CAAA;AAAA,UAE5C,gBAAA;;EAEf,EAAA;;EAGA,UAAA,IAAc,OAAA,CAAQ,eAAA,CAAgB,CAAA;;EAGtC,QAAA,CAAS,EAAA,WAAa,OAAA,CAAQ,eAAA,CAAgB,CAAA;;EAG9C,KAAA,EAAO,QAAA,EAAU,aAAA,CAAc,CAAA;;EAG/B,UAAA,EAAY,KAAA,WAAgB,OAAA,CAAQ,SAAA,CAAU,CAAA;AAAA;AAAA,UAO/B,gBAAA,WAA2B,CAAA,CAAE,OAAA,GAAU,CAAA,CAAE,OAAA;EAlC1D;EAoCE,IAAA;;EAEA,MAAA,EAAQ,gBAAA;;EAER,MAAA,EAAQ,CAAA;AAAA;AAAA,UAGO,UAAA;EACf,IAAA;EACA,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AA;;EAGvC,KAAA,CAAM,OAAA,GAAU,YAAA,GAAe,OAAA;AAAA"}
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"src-DR-EWgVP.mjs","names":["fsWatch"],"sources":["../../ssg/src/document.tsx","../../ssg/src/types.ts","../../ssg/src/mdx/processor.ts","../../ssg/src/mdx/vite-plugin.ts","../../ssg/src/ssg.ts","../../ssg/src/collection/index.ts","../../ssg/src/sources/base.ts","../../ssg/src/sources/file.ts","../../ssg/src/sources/git.ts","../../ssg/src/sources/remote.ts","../../ssg/src/sources/custom.ts"],"sourcesContent":["/** @jsxImportSource @semajsx/dom */\n\nimport type { DocumentTemplate } from \"./types\";\n\n/**\n * Default HTML document template for SSG\n */\nexport const DefaultDocument: DocumentTemplate = ({\n children,\n title = \"SSG Page\",\n scripts,\n css,\n}) => (\n <html lang=\"en\">\n <head>\n <meta charSet=\"UTF-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n <title>{title}</title>\n {css?.map((href) => (\n <link rel=\"stylesheet\" href={href} />\n ))}\n </head>\n <body>\n {children}\n {scripts}\n </body>\n </html>\n);\n","import type { Component, VNode } from \"@semajsx/core\";\nimport type { z } from \"zod\";\n\n// =============================================================================\n// Collection Registry (for type inference)\n// =============================================================================\n\n/**\n * Infer a registry type from an array of collections\n * Maps collection names to their data types\n */\nexport type InferCollections<T extends readonly Collection[]> = {\n [K in T[number] as K[\"name\"]]: K extends Collection<infer D> ? D : unknown;\n};\n\n// =============================================================================\n// Collection Entry\n// =============================================================================\n\nexport interface CollectionEntry<T = unknown> {\n /** Unique identifier within the collection */\n id: string;\n /** URL-friendly slug */\n slug: string;\n /** Validated frontmatter data */\n data: T;\n /** Raw content body (markdown/mdx) */\n body: string;\n /** Render the content to JSX */\n render: () => Promise<{ Content: () => VNode }>;\n}\n\n// =============================================================================\n// Collection Source\n// =============================================================================\n\nexport interface ChangeSet<T = unknown> {\n /** Cursor for next incremental fetch */\n cursor: string;\n /** Newly added entries */\n added: CollectionEntry<T>[];\n /** Updated entries */\n updated: CollectionEntry<T>[];\n /** Deleted entry IDs */\n deleted: string[];\n}\n\nexport type WatchCallback<T = unknown> = (changes: ChangeSet<T>) => void;\n\nexport interface CollectionSource<T = unknown> {\n /** Unique identifier for this source */\n id: string;\n\n /** Get all entries from this source */\n getEntries(): Promise<CollectionEntry<T>[]>;\n\n /** Get a single entry by ID */\n getEntry(id: string): Promise<CollectionEntry<T> | null>;\n\n /** Watch for changes (optional) */\n watch?(callback: WatchCallback<T>): () => void;\n\n /** Get incremental changes since cursor (optional) */\n getChanges?(since: string): Promise<ChangeSet<T>>;\n}\n\n// =============================================================================\n// Collection Definition\n// =============================================================================\n\nexport interface CollectionConfig<T extends z.ZodType = z.ZodType> {\n /** Collection name */\n name: string;\n /** Data source (returns raw entries, validated against schema later) */\n source: CollectionSource<unknown>;\n /** Zod schema for validation */\n schema: T;\n}\n\nexport interface Collection<T = unknown> {\n name: string;\n source: CollectionSource<unknown>;\n schema: z.ZodType;\n /** Type-only field for inference */\n _outputType?: T;\n}\n\n// =============================================================================\n// Route Configuration\n// =============================================================================\n\nexport interface StaticPath<P = Record<string, string>> {\n params: P;\n props?: Record<string, unknown>;\n}\n\nexport interface RouteConfig<TRegistry extends Record<string, unknown> = Record<string, unknown>> {\n /** Route path pattern (e.g., '/blog/:slug') */\n path: string;\n /** Component to render. Props are provided dynamically by the route config. */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any -- Route props are dynamic, typed via `props`/`getStaticPaths`\n component: (props: any) => VNode;\n /** Static props for the route */\n props?:\n | Record<string, unknown>\n | ((ssg: SSGInstance<TRegistry>) => Promise<Record<string, unknown>>);\n /** Generate static paths for dynamic routes */\n getStaticPaths?: (ssg: SSGInstance<TRegistry>) => Promise<StaticPath[]>;\n}\n\n// =============================================================================\n// MDX Configuration\n// =============================================================================\n\nexport interface MDXConfig {\n /** Remark plugins */\n remarkPlugins?: unknown[];\n /** Rehype plugins */\n rehypePlugins?: unknown[];\n /** Component mapping for MDX */\n components?: Record<string, Component>;\n}\n\n// =============================================================================\n// Document Template\n// =============================================================================\n\n/**\n * Raw HTML VNode that can be used directly in JSX or converted to string\n */\nexport class RawHTML {\n public readonly type = \"div\";\n public readonly props: { dangerouslySetInnerHTML: { __html: string } };\n public readonly children: never[] = [];\n\n constructor(public readonly html: string) {\n this.props = { dangerouslySetInnerHTML: { __html: html } };\n }\n\n toString(): string {\n return this.html;\n }\n}\n\nexport interface DocumentProps {\n /** Rendered page content (VNode with toString) */\n children: RawHTML;\n /** Page title */\n title?: string;\n /** Base URL path */\n base: string;\n /** Route path */\n path: string;\n /** Route props */\n props: Record<string, unknown>;\n /** Script tags for islands (as RawHTML) */\n scripts?: RawHTML;\n /** CSS stylesheet paths */\n css?: string[];\n}\n\nexport type DocumentTemplate = (props: DocumentProps) => VNode;\n\n// =============================================================================\n// Plugin System\n// =============================================================================\n\n/**\n * Partial SSG config that a plugin's config() hook can return.\n * Each field has a defined merge strategy:\n * - mdx: merge (concat arrays, merge component objects)\n * - document: override (last writer wins)\n * - routes: concat\n * - collections: concat\n */\nexport interface SSGPluginConfig {\n mdx?: Partial<MDXConfig>;\n document?: DocumentTemplate;\n routes?: RouteConfig[];\n collections?: readonly Collection[];\n}\n\nexport interface SSGPlugin {\n /** Plugin name for identification and debugging */\n name: string;\n\n /** Plugin ordering: 'pre' runs before normal plugins, 'post' runs after */\n enforce?: \"pre\" | \"post\";\n\n /**\n * Modify SSG config before it is resolved.\n * Return partial config to merge.\n * Called in plugin order: enforce:'pre' → normal → enforce:'post' → user config.\n */\n config?(config: SSGConfig): SSGPluginConfig | void;\n\n /** Called after config is fully resolved. Read-only inspection. */\n configResolved?(config: SSGConfig): void;\n\n /** Called before build starts */\n buildStart?(): void | Promise<void>;\n\n /** Called after build completes */\n buildEnd?(result: BuildResult): void | Promise<void>;\n}\n\n// =============================================================================\n// SSG Configuration\n// =============================================================================\n\nexport interface SSGConfig<\n TCollections extends readonly Collection[] = Collection[],\n TRegistry extends Record<string, unknown> = InferCollections<TCollections>,\n> {\n /** Output directory for built files */\n outDir: string;\n /** Root directory for resolving relative paths (defaults to script location) */\n rootDir?: string;\n /** Base URL path */\n base?: string;\n /** Collections to include */\n collections?: TCollections;\n /** Route definitions */\n routes?: RouteConfig<TRegistry>[];\n /** Plugins that contribute remark/rehype plugins and components.\n * Plugin factories may return arrays (Vite-style); nested arrays are flattened. */\n plugins?: (SSGPlugin | SSGPlugin[])[];\n /** MDX configuration (merged after plugins, takes precedence) */\n mdx?: MDXConfig;\n /** Custom document template */\n document?: DocumentTemplate;\n}\n\n// =============================================================================\n// Build State & Result\n// =============================================================================\n\nexport interface BuildState {\n /** Cursor for each collection */\n cursors: Record<string, string>;\n /** Content hash for each page */\n pageHashes: Record<string, string>;\n /** Last build timestamp */\n timestamp: number;\n}\n\nexport interface BuildResult {\n /** New build state for incremental builds */\n state: BuildState;\n /** Paths that were built */\n paths: string[];\n /** Build statistics */\n stats: {\n added: number;\n updated: number;\n deleted: number;\n unchanged: number;\n };\n}\n\nexport interface BuildOptions {\n /** Enable incremental build */\n incremental?: boolean;\n /** Previous build state */\n state?: BuildState;\n /** Only build specific collections */\n collections?: string[];\n}\n\n// =============================================================================\n// Watcher\n// =============================================================================\n\nexport interface WatchOptions {\n /** Callback when rebuild completes */\n onRebuild?: (result: BuildResult) => void;\n /** Callback on error */\n onError?: (error: Error) => void;\n}\n\nexport interface Watcher {\n /** Stop watching */\n close(): void;\n}\n\n// =============================================================================\n// SSG Instance\n// =============================================================================\n\nexport interface SSGInstance<TRegistry extends Record<string, unknown> = Record<string, unknown>> {\n /** Get the root directory for resolving paths */\n getRootDir(): string;\n\n /** Get all entries from a collection */\n getCollection<K extends keyof TRegistry & string>(\n name: K,\n ): Promise<CollectionEntry<TRegistry[K]>[]>;\n\n /** Get a single entry from a collection */\n getEntry<K extends keyof TRegistry & string>(\n name: K,\n id: string,\n ): Promise<CollectionEntry<TRegistry[K]> | null>;\n\n /** Build the static site */\n build(options?: BuildOptions): Promise<BuildResult>;\n\n /** Watch for changes and rebuild */\n watch(options?: WatchOptions): Watcher;\n}\n","import { compile } from \"@mdx-js/mdx\";\nimport type { Pluggable } from \"unified\";\nimport type { VNode } from \"@semajsx/core\";\nimport type { MDXConfig, MDXCompileResult, Heading } from \"./types\";\n\n/**\n * MDX Processor for compiling MDX content to JSX components\n */\nexport class MDXProcessor {\n private config: MDXConfig;\n\n constructor(config: MDXConfig = {}) {\n this.config = config;\n }\n\n /**\n * Compile MDX content to a JSX component\n */\n async compile(\n content: string,\n frontmatter: Record<string, unknown> = {},\n ): Promise<MDXCompileResult> {\n // Extract headings for table of contents\n const headings = this.extractHeadings(content);\n\n // Compile MDX to JavaScript\n const compiled = await compile(content, {\n outputFormat: \"function-body\",\n development: false,\n remarkPlugins: (this.config.remarkPlugins ?? []) as Pluggable[],\n rehypePlugins: (this.config.rehypePlugins ?? []) as Pluggable[],\n // Use SemaJSX runtime\n jsxImportSource: \"semajsx/dom\",\n });\n\n // Dynamic import of JSX runtime\n const jsxRuntime = await import(\"semajsx/dom/jsx-runtime\");\n\n // Create the Content component\n const Content = this.createComponent(\n String(compiled),\n this.config.components ?? {},\n jsxRuntime,\n );\n\n return {\n Content,\n frontmatter,\n headings,\n };\n }\n\n /**\n * Create a component from compiled MDX code\n */\n private createComponent(\n code: string,\n components: Record<string, (props: Record<string, unknown>) => VNode>,\n jsxRuntime: unknown,\n ): (props?: Record<string, unknown>) => VNode {\n // Import JSX runtime\n // This will be resolved at runtime\n return (props: Record<string, unknown> = {}) => {\n try {\n // Create a function from the MDX compiled code\n // MDX compiled code expects jsx runtime in arguments[0]\n // By using new Function() with no parameters, we can pass\n // the runtime via call() and it becomes arguments[0]\n // eslint-disable-next-line @typescript-eslint/no-implied-eval\n const fn = new Function(code + \"\\nreturn MDXContent;\");\n\n // Call with jsxRuntime as arguments[0]\n // MDX returns an object with default export\n const result = fn.call(null, jsxRuntime) as {\n default: (props: Record<string, unknown>) => VNode;\n };\n return result.default({ ...props, components });\n } catch (e) {\n // Fallback for when runtime is not available\n throw new Error(`MDX rendering failed: ${(e as Error).message}`);\n }\n };\n }\n\n /**\n * Extract headings from markdown content\n */\n private extractHeadings(content: string): Heading[] {\n const headings: Heading[] = [];\n const headingRegex = /^(#{1,6})\\s+(.+)$/gm;\n\n let match;\n while ((match = headingRegex.exec(content)) !== null) {\n const hashes = match[1];\n const rawText = match[2];\n if (!hashes || !rawText) continue;\n\n const depth = hashes.length;\n const text = rawText.trim();\n const slug = this.slugify(text);\n\n headings.push({ depth, text, slug });\n }\n\n return headings;\n }\n\n /**\n * Convert text to URL-friendly slug\n */\n private slugify(text: string): string {\n return text\n .toLowerCase()\n .replace(/[^\\w\\s-]/g, \"\")\n .replace(/\\s+/g, \"-\")\n .replace(/-+/g, \"-\")\n .trim();\n }\n}\n\n/**\n * Create an MDX processor instance\n */\nexport function createMDXProcessor(config?: MDXConfig): MDXProcessor {\n return new MDXProcessor(config);\n}\n","import { compile } from \"@mdx-js/mdx\";\nimport type { Plugin, PluginOption } from \"vite\";\nimport type { Pluggable } from \"unified\";\n\n/**\n * MDX plugin options\n */\nexport interface MDXPluginOptions {\n /** Remark plugins */\n remarkPlugins?: unknown[];\n /** Rehype plugins */\n rehypePlugins?: unknown[];\n}\n\n/**\n * Vite plugin for MDX support\n * Transforms .mdx files to JSX modules\n */\nexport function viteMDXPlugin(options: MDXPluginOptions = {}): PluginOption {\n const plugin: Plugin = {\n name: \"semajsx-mdx\",\n\n async transform(code: string, id: string) {\n // Only transform .mdx files\n if (!id.endsWith(\".mdx\")) {\n return null;\n }\n\n try {\n // Compile MDX to JavaScript (not JSX)\n const compiled = await compile(code, {\n jsxImportSource: \"semajsx/dom\",\n outputFormat: \"program\",\n development: false,\n remarkPlugins: (options.remarkPlugins ?? []) as Pluggable[],\n rehypePlugins: (options.rehypePlugins ?? []) as Pluggable[],\n });\n\n return {\n code: String(compiled),\n map: null,\n };\n } catch (error) {\n const err = error as Error;\n throw new Error(`MDX compilation failed for ${id}: ${err.message}`);\n }\n },\n };\n\n return plugin;\n}\n","import { mkdir, writeFile, rm } from \"fs/promises\";\nimport { join, dirname, resolve } from \"path\";\nimport { createApp, renderDocument } from \"@semajsx/ssr\";\nimport type { App, RouteContext } from \"@semajsx/ssr\";\nimport { DefaultDocument } from \"./document\";\nimport type { VNode } from \"@semajsx/core\";\nimport {\n RawHTML,\n type SSGConfig,\n type SSGPlugin,\n type SSGInstance,\n type MDXConfig,\n type RouteConfig,\n type DocumentTemplate,\n type Collection,\n type CollectionEntry,\n type BuildOptions,\n type BuildResult,\n type BuildState,\n type WatchOptions,\n type Watcher,\n type DocumentProps,\n type InferCollections,\n} from \"./types\";\nimport { viteMDXPlugin } from \"./mdx\";\n\n/**\n * Sort plugins by enforce order: 'pre' → normal → 'post'\n */\nfunction sortPlugins(plugins: SSGPlugin[]): SSGPlugin[] {\n const pre: SSGPlugin[] = [];\n const normal: SSGPlugin[] = [];\n const post: SSGPlugin[] = [];\n\n for (const plugin of plugins) {\n if (plugin.enforce === \"pre\") pre.push(plugin);\n else if (plugin.enforce === \"post\") post.push(plugin);\n else normal.push(plugin);\n }\n\n return [...pre, ...normal, ...post];\n}\n\n/**\n * Merge a partial MDX config into an existing one.\n */\nfunction mergeMdxConfig(base: MDXConfig, partial: Partial<MDXConfig>): MDXConfig {\n return {\n remarkPlugins: [...(base.remarkPlugins ?? []), ...(partial.remarkPlugins ?? [])],\n rehypePlugins: [...(base.rehypePlugins ?? []), ...(partial.rehypePlugins ?? [])],\n components: { ...base.components, ...partial.components },\n };\n}\n\n/**\n * Resolved config produced by running all plugin config hooks.\n */\ninterface ResolvedPluginConfig {\n mdx: MDXConfig;\n document?: DocumentTemplate;\n routes: RouteConfig[];\n collections: Collection[];\n}\n\n/**\n * Result of plugin resolution: merged config + flat list of all plugins.\n */\ninterface PluginResolutionResult {\n config: ResolvedPluginConfig;\n allPlugins: SSGPlugin[];\n}\n\n/**\n * Run config hooks on all plugins, then merge with user config.\n *\n * Plugin arrays are flattened Vite-style: plugin factories may return\n * `SSGPlugin | SSGPlugin[]`, and the top-level array is `.flat()`-ed\n * before sorting and processing.\n *\n * Merge strategies:\n * - mdx: merge (concat arrays, merge component objects)\n * - document: override (last writer wins, user config last)\n * - routes: concat (plugin routes first, then user routes)\n * - collections: concat (plugin collections first, then user collections)\n */\nfunction resolvePlugins(\n plugins: (SSGPlugin | SSGPlugin[])[],\n config: SSGConfig,\n): PluginResolutionResult {\n // Vite-style: flatten nested arrays from plugin factories\n const flat = plugins.flat();\n const sorted = sortPlugins(flat);\n\n let mdx: MDXConfig = { remarkPlugins: [], rehypePlugins: [], components: {} };\n let document: DocumentTemplate | undefined;\n const routes: RouteConfig[] = [];\n const collections: Collection[] = [];\n\n // Call config hooks in order\n for (const plugin of sorted) {\n if (!plugin.config) continue;\n const partial = plugin.config(config);\n if (!partial) continue;\n\n if (partial.mdx) mdx = mergeMdxConfig(mdx, partial.mdx);\n if (partial.document) document = partial.document;\n if (partial.routes) routes.push(...partial.routes);\n if (partial.collections) collections.push(...partial.collections);\n }\n\n // User config takes precedence (applied last)\n if (config.mdx) mdx = mergeMdxConfig(mdx, config.mdx);\n if (config.document) document = config.document;\n if (config.routes) routes.push(...config.routes);\n if (config.collections) collections.push(...config.collections);\n\n return { config: { mdx, document, routes, collections }, allPlugins: sorted };\n}\n\n/**\n * SSG (Static Site Generator) core class\n * Built on top of server's createApp\n */\nexport class SSG<\n TRegistry extends Record<string, unknown> = Record<string, unknown>,\n> implements SSGInstance<TRegistry> {\n private config: SSGConfig;\n private plugins: SSGPlugin[];\n private rootDir: string;\n private collections: Map<string, Collection>;\n private entriesCache: Map<string, CollectionEntry[]>;\n private app: App;\n private mdxModules: Map<string, string> = new Map();\n\n constructor(config: SSGConfig) {\n // Resolve rootDir\n this.rootDir = config.rootDir ?? process.cwd();\n\n // Run config hooks — merges plugins + user config, collects all plugins (including nested)\n const { config: resolved, allPlugins } = resolvePlugins(config.plugins ?? [], config);\n\n // Store all plugins (including sub-plugins) for lifecycle hooks\n this.plugins = allPlugins;\n\n this.config = {\n base: \"/\",\n ...config,\n mdx: resolved.mdx,\n document: resolved.document,\n routes: resolved.routes,\n collections: resolved.collections,\n outDir: resolve(this.rootDir, config.outDir),\n };\n\n // Call configResolved on all plugins\n for (const plugin of this.plugins) {\n plugin.configResolved?.(this.config);\n }\n this.collections = new Map();\n this.entriesCache = new Map();\n\n // Create App with MDX plugins\n this.app = createApp({\n root: this.rootDir,\n vite: {\n plugins: [\n // Virtual MDX content modules\n {\n name: \"ssg-virtual-mdx\",\n resolveId: (id: string) => {\n if (id.startsWith(\"virtual:mdx:\")) {\n return \"\\0\" + id;\n }\n },\n load: (id: string) => {\n if (id.startsWith(\"\\0virtual:mdx:\")) {\n const mdxId = id.replace(\"\\0virtual:mdx:\", \"\");\n return this.mdxModules.get(mdxId);\n }\n },\n },\n // MDX compiler plugin\n viteMDXPlugin(resolved.mdx),\n ],\n },\n });\n\n // Register collections (from resolved config — plugins + user)\n for (const collection of this.config.collections ?? []) {\n this.collections.set(collection.name, collection);\n }\n }\n\n getRootDir(): string {\n return this.rootDir;\n }\n\n async getCollection<K extends keyof TRegistry & string>(\n name: K,\n ): Promise<CollectionEntry<TRegistry[K]>[]> {\n const collection = this.collections.get(name);\n if (!collection) {\n throw new Error(`Collection \"${name}\" not found`);\n }\n\n if (this.entriesCache.has(name)) {\n return this.entriesCache.get(name) as CollectionEntry<TRegistry[K]>[];\n }\n\n const entries = await collection.source.getEntries();\n\n const validatedEntries = entries.map((entry) => {\n const result = collection.schema.safeParse(entry.data);\n if (!result.success) {\n throw new Error(`Validation error in ${name}/${entry.id}: ${result.error.message}`);\n }\n\n return {\n ...entry,\n data: result.data,\n render: async () => {\n // Get Vite server from app\n const vite = this.app.getViteServer();\n if (!vite) {\n throw new Error(\"Vite server not initialized\");\n }\n\n // Store MDX content as virtual module\n const mdxId = `${name}/${entry.id}.mdx`;\n this.mdxModules.set(mdxId, entry.body);\n\n try {\n // Load module through Vite SSR\n const moduleExports = (await vite.ssrLoadModule(`virtual:mdx:${mdxId}`)) as {\n default: (props: Record<string, unknown>) => unknown;\n };\n\n const Content = (props: Record<string, unknown> = {}): VNode =>\n moduleExports.default({\n ...props,\n components: this.config.mdx?.components ?? {},\n }) as VNode;\n\n return {\n Content,\n headings: this.extractHeadings(entry.body),\n };\n } finally {\n this.mdxModules.delete(mdxId);\n }\n },\n };\n });\n\n this.entriesCache.set(name, validatedEntries);\n return validatedEntries as CollectionEntry<TRegistry[K]>[];\n }\n\n async getEntry<K extends keyof TRegistry & string>(\n name: K,\n id: string,\n ): Promise<CollectionEntry<TRegistry[K]> | null> {\n const entries = await this.getCollection(name);\n return entries.find((e) => e.id === id || e.slug === id) ?? null;\n }\n\n async build(options: BuildOptions = {}): Promise<BuildResult> {\n const { incremental = false, state: prevState } = options;\n const outDir = this.config.outDir;\n\n // Plugin hook: buildStart\n for (const plugin of this.plugins) {\n await plugin.buildStart?.();\n }\n\n // Initialize App (starts Vite)\n await this.app.prepare();\n\n try {\n // Register routes with App\n await this.registerRoutes();\n\n // Build all pages\n const result = await this.buildPages(incremental, prevState, outDir);\n\n // Build islands for client-side hydration\n // Pass renderHtml so the Vite build uses the SSG's Document template\n // instead of a hardcoded minimal HTML template\n const documentTemplate = this.config.document ?? DefaultDocument;\n await this.app.build({\n outDir,\n mode: \"full\",\n minify: true,\n renderHtml: ({ html, css, scripts, title, path: routePath }) => {\n const scriptsHtml = scripts\n .map((s) => `<script type=\"module\" src=\"${s.src}\"></script>`)\n .join(\"\\n\");\n const documentProps: DocumentProps = {\n children: new RawHTML(html),\n title,\n base: this.config.base ?? \"/\",\n path: routePath,\n props: {},\n scripts: scriptsHtml ? new RawHTML(scriptsHtml) : undefined,\n css: css ?? [],\n };\n const documentVNode = documentTemplate(documentProps);\n return renderDocument(documentVNode);\n },\n vite: {\n build: {\n rollupOptions: {\n // Don't externalize for SSG - bundle everything\n external: [],\n },\n },\n },\n });\n\n // Plugin hook: buildEnd\n for (const plugin of this.plugins) {\n await plugin.buildEnd?.(result);\n }\n\n return result;\n } finally {\n await this.app.close();\n }\n }\n\n private async registerRoutes(): Promise<void> {\n const routes = this.config.routes ?? [];\n\n for (const route of routes) {\n if (route.getStaticPaths) {\n // Dynamic route - register each path\n const staticPaths = await route.getStaticPaths(this);\n for (const sp of staticPaths) {\n const path = this.applyParams(route.path, sp.params);\n const props: Record<string, unknown> = { ...sp.props, params: sp.params };\n\n this.app.route(\n path,\n (_context: RouteContext) => {\n return route.component(props);\n },\n { title: props.title as string | undefined },\n );\n }\n } else {\n // Static route\n let props: Record<string, unknown> = {};\n if (typeof route.props === \"function\") {\n props = await route.props(this);\n } else if (route.props) {\n props = route.props;\n }\n\n this.app.route(\n route.path,\n (_context: RouteContext) => {\n return route.component(props);\n },\n { title: props.title as string | undefined },\n );\n }\n }\n }\n\n private async buildPages(\n incremental: boolean,\n prevState: BuildState | undefined,\n outDir: string,\n ): Promise<BuildResult> {\n const state: BuildState = {\n cursors: {},\n pageHashes: {},\n timestamp: Date.now(),\n };\n\n const stats = { added: 0, updated: 0, deleted: 0, unchanged: 0 };\n const builtPaths: string[] = [];\n\n if (!incremental) {\n await rm(outDir, { recursive: true, force: true });\n }\n await mkdir(outDir, { recursive: true });\n\n this.entriesCache.clear();\n\n // Get all paths to build\n const allPaths = await this.generateAllPaths();\n const currentPaths = new Set(allPaths.map((p) => p.path));\n\n // Delete removed pages\n if (incremental && prevState) {\n for (const oldPath of Object.keys(prevState.pageHashes)) {\n if (!currentPaths.has(oldPath)) {\n const filePath = this.pathToFilePath(oldPath);\n try {\n await rm(join(outDir, filePath));\n stats.deleted++;\n } catch {\n // ignore\n }\n }\n }\n }\n\n // Build each page\n for (const { path, props } of allPaths) {\n const html = await this.renderPage(path, props);\n const hash = this.hashContent(html);\n\n const prevHash = prevState?.pageHashes[path];\n const needsWrite = !incremental || !prevHash || prevHash !== hash;\n\n if (needsWrite) {\n const filePath = this.pathToFilePath(path);\n const fullPath = join(outDir, filePath);\n\n await mkdir(dirname(fullPath), { recursive: true });\n await writeFile(fullPath, html);\n\n builtPaths.push(path);\n if (!prevHash) {\n stats.added++;\n } else {\n stats.updated++;\n }\n } else {\n stats.unchanged++;\n }\n\n state.pageHashes[path] = hash;\n }\n\n for (const [name, collection] of this.collections) {\n if (collection.source.getChanges) {\n state.cursors[name] = Date.now().toString();\n }\n }\n\n return { state, paths: builtPaths, stats };\n }\n\n private async renderPage(path: string, props: Record<string, unknown>): Promise<string> {\n // Use App to render the page\n const result = await this.app.render(path);\n\n // Wrap with document template\n const documentProps: DocumentProps = {\n children: new RawHTML(result.html),\n title: props.title as string | undefined,\n base: this.config.base ?? \"/\",\n path,\n props,\n scripts: result.scripts ? new RawHTML(result.scripts) : undefined,\n css: result.css ?? [],\n };\n\n const template = this.config.document ?? DefaultDocument;\n const documentVNode = template(documentProps);\n\n return renderDocument(documentVNode);\n }\n\n private async generateAllPaths(): Promise<\n Array<{ path: string; props: Record<string, unknown> }>\n > {\n const paths: Array<{ path: string; props: Record<string, unknown> }> = [];\n const routes = this.config.routes ?? [];\n\n for (const route of routes) {\n if (route.getStaticPaths) {\n const staticPaths = await route.getStaticPaths(this);\n for (const sp of staticPaths) {\n const path = this.applyParams(route.path, sp.params);\n paths.push({ path, props: { ...sp.props, params: sp.params } });\n }\n } else {\n let props: Record<string, unknown> = {};\n if (typeof route.props === \"function\") {\n props = await route.props(this);\n } else if (route.props) {\n props = route.props;\n }\n paths.push({ path: route.path, props });\n }\n }\n\n return paths;\n }\n\n watch(options: WatchOptions = {}): Watcher {\n const unsubscribers: (() => void)[] = [];\n\n for (const [name, collection] of this.collections) {\n if (collection.source.watch) {\n const unsubscribe = collection.source.watch(async () => {\n try {\n this.entriesCache.delete(name);\n const result = await this.build({ incremental: true });\n options.onRebuild?.(result);\n } catch (error) {\n options.onError?.(error as Error);\n }\n });\n unsubscribers.push(unsubscribe);\n }\n }\n\n return {\n close: () => unsubscribers.forEach((fn) => fn()),\n };\n }\n\n private pathToFilePath(urlPath: string): string {\n if (urlPath === \"/\") return \"index.html\";\n return `${urlPath.slice(1)}/index.html`;\n }\n\n private applyParams(pattern: string, params: Record<string, string>): string {\n let path = pattern;\n for (const [key, value] of Object.entries(params)) {\n path = path.replace(`:${key}`, value);\n }\n return path;\n }\n\n private hashContent(content: string): string {\n let hash = 0;\n for (let i = 0; i < content.length; i++) {\n const char = content.charCodeAt(i);\n hash = (hash << 5) - hash + char;\n hash = hash & hash;\n }\n return hash.toString(16);\n }\n\n private extractHeadings(content: string): Array<{ depth: number; text: string; slug: string }> {\n const headings: Array<{ depth: number; text: string; slug: string }> = [];\n const regex = /^(#{1,6})\\s+(.+)$/gm;\n\n let match;\n while ((match = regex.exec(content)) !== null) {\n if (!match[1] || !match[2]) continue;\n const depth = match[1].length;\n const text = match[2].trim();\n const slug = text\n .toLowerCase()\n .replace(/[^\\w\\s-]/g, \"\")\n .replace(/\\s+/g, \"-\");\n headings.push({ depth, text, slug });\n }\n\n return headings;\n }\n}\n\nexport function createSSG<\n const TCollections extends readonly Collection[],\n TRegistry extends Record<string, unknown> = InferCollections<TCollections>,\n>(config: SSGConfig<TCollections, TRegistry>): SSGInstance<TRegistry> {\n return new SSG<TRegistry>(config as unknown as SSGConfig);\n}\n","import type { z } from \"zod\";\nimport type { Collection, CollectionConfig } from \"../types\";\n\n/**\n * Define a collection with schema validation\n */\nexport function defineCollection<T extends z.ZodType>(\n config: CollectionConfig<T>,\n): Collection<z.infer<T>> {\n return {\n name: config.name,\n source: config.source,\n schema: config.schema,\n };\n}\n\nexport type { Collection, CollectionConfig, CollectionEntry } from \"../types\";\n","import type { CollectionSource, CollectionEntry, ChangeSet, WatchCallback } from \"../types\";\n\n/**\n * Base class for collection sources\n */\nexport abstract class BaseSource<T = unknown> implements CollectionSource<T> {\n abstract id: string;\n\n abstract getEntries(): Promise<CollectionEntry<T>[]>;\n\n async getEntry(id: string): Promise<CollectionEntry<T> | null> {\n const entries = await this.getEntries();\n return entries.find((e) => e.id === id) ?? null;\n }\n\n watch?(callback: WatchCallback<T>): () => void;\n\n getChanges?(since: string): Promise<ChangeSet<T>>;\n}\n","import { glob } from \"glob\";\nimport matter from \"gray-matter\";\nimport { readFile, watch as fsWatch } from \"fs/promises\";\nimport { join, relative } from \"path\";\nimport type { CollectionEntry, ChangeSet, WatchCallback } from \"../types\";\nimport type { FileSourceOptions } from \"./types\";\nimport { BaseSource } from \"./base\";\n\n/**\n * File system source for collections\n */\nexport class FileSource<T = unknown> extends BaseSource<T> {\n id: string;\n private directory: string;\n private include: string;\n private shouldWatch: boolean;\n private contentRoot: string;\n\n constructor(options: FileSourceOptions, contentRoot: string = process.cwd()) {\n super();\n this.directory = options.directory;\n this.include = options.include ?? \"**/*.{md,mdx}\";\n this.shouldWatch = options.watch ?? false;\n this.contentRoot = contentRoot;\n this.id = `file:${this.directory}`;\n }\n\n async getEntries(): Promise<CollectionEntry<T>[]> {\n const dir = join(this.contentRoot, this.directory);\n const pattern = join(dir, this.include);\n const files = await glob(pattern);\n\n const entries = await Promise.all(\n files.map(async (filePath) => {\n const content = await readFile(filePath, \"utf-8\");\n const { data, content: body } = matter(content);\n\n const relativePath = relative(dir, filePath);\n const id = relativePath.replace(/\\.(md|mdx)$/, \"\");\n const slug = id.replace(/\\\\/g, \"/\");\n\n return {\n id,\n slug,\n data: data as T,\n body,\n render: async () => {\n // MDX compilation will be handled by the MDX processor\n return {\n Content: () => {\n throw new Error(\"MDX rendering not yet implemented\");\n },\n };\n },\n };\n }),\n );\n\n return entries;\n }\n\n override watch(callback: WatchCallback<T>): () => void {\n if (!this.shouldWatch) {\n return () => {};\n }\n\n const dir = join(this.contentRoot, this.directory);\n const abortController = new AbortController();\n\n const startWatching = async () => {\n try {\n const watcher = fsWatch(dir, {\n recursive: true,\n signal: abortController.signal,\n });\n\n for await (const _event of watcher) {\n // Debounce and collect changes\n const entries = await this.getEntries();\n callback({\n cursor: Date.now().toString(),\n added: [],\n updated: entries,\n deleted: [],\n });\n }\n } catch (err) {\n if ((err as Error).name !== \"AbortError\") {\n throw err;\n }\n }\n };\n\n startWatching();\n\n return () => {\n abortController.abort();\n };\n }\n\n override async getChanges(_since: string): Promise<ChangeSet<T>> {\n // For file source, we do a full reload\n // A more sophisticated implementation could track file mtimes\n const entries = await this.getEntries();\n return {\n cursor: Date.now().toString(),\n added: [],\n updated: entries,\n deleted: [],\n };\n }\n}\n\n/**\n * Create a file system source\n */\nexport function fileSource<T = unknown>(\n options: FileSourceOptions,\n contentRoot?: string,\n): FileSource<T> {\n return new FileSource<T>(options, contentRoot);\n}\n","import { exec } from \"child_process\";\nimport { promisify } from \"util\";\nimport type { CollectionEntry } from \"../types\";\nimport type { GitSourceOptions, GitCommitSourceOptions, GitTagSourceOptions } from \"./types\";\nimport { BaseSource } from \"./base\";\n\nconst execAsync = promisify(exec);\n\n/**\n * Git source for collections\n */\nexport class GitSource<T = unknown> extends BaseSource<T> {\n id: string;\n private options: GitSourceOptions;\n private cwd: string;\n\n constructor(options: GitSourceOptions, cwd: string = process.cwd()) {\n super();\n this.options = options;\n this.cwd = cwd;\n this.id = `git:${options.type}`;\n }\n\n async getEntries(): Promise<CollectionEntry<T>[]> {\n if (this.options.type === \"commits\") {\n return this.getCommits(this.options);\n } else {\n return this.getTags(this.options);\n }\n }\n\n private async getCommits(options: GitCommitSourceOptions): Promise<CollectionEntry<T>[]> {\n const args = [\"log\", \"--format=%H|%s|%an|%ae|%aI\"];\n\n if (options.filter?.since) {\n args.push(`--since=${options.filter.since}`);\n }\n if (options.filter?.until) {\n args.push(`--until=${options.filter.until}`);\n }\n if (options.filter?.author) {\n args.push(`--author=${options.filter.author}`);\n }\n if (options.limit) {\n args.push(`-n`, options.limit.toString());\n }\n if (options.filter?.paths?.length) {\n args.push(\"--\", ...options.filter.paths);\n }\n\n const { stdout } = await execAsync(`git ${args.join(\" \")}`, {\n cwd: this.cwd,\n });\n const lines = stdout.trim().split(\"\\n\").filter(Boolean);\n\n return lines.map((line) => {\n const parts = line.split(\"|\");\n const hash = parts[0] ?? \"\";\n const message = parts[1] ?? \"\";\n const author = parts[2] ?? \"\";\n const email = parts[3] ?? \"\";\n const dateStr = parts[4] ?? \"\";\n\n const data = {\n hash,\n message,\n author,\n email,\n date: new Date(dateStr),\n } as unknown as T;\n\n return {\n id: hash,\n slug: hash.slice(0, 7),\n data,\n body: message,\n render: async () => ({\n Content: () => {\n throw new Error(\"Git commits cannot be rendered as content\");\n },\n }),\n };\n });\n }\n\n private async getTags(options: GitTagSourceOptions): Promise<CollectionEntry<T>[]> {\n const pattern = options.pattern ?? \"*\";\n\n // Get tags with date and message\n const { stdout } = await execAsync(\n `git tag -l \"${pattern}\" --format=\"%(refname:short)|%(objectname:short)|%(creatordate:iso)|%(contents:subject)\"`,\n { cwd: this.cwd },\n );\n\n const lines = stdout.trim().split(\"\\n\").filter(Boolean);\n\n return lines.map((line) => {\n const parts = line.split(\"|\");\n const tag = parts[0] ?? \"\";\n const hash = parts[1] ?? \"\";\n const dateStr = parts[2] ?? \"\";\n const message = parts[3] ?? \"\";\n\n const data = {\n tag,\n hash,\n date: new Date(dateStr),\n message: message || undefined,\n } as unknown as T;\n\n return {\n id: tag,\n slug: tag,\n data,\n body: message,\n render: async () => ({\n Content: () => {\n throw new Error(\"Git tags cannot be rendered as content\");\n },\n }),\n };\n });\n }\n}\n\n/**\n * Create a Git source\n */\nexport function gitSource<T = unknown>(options: GitSourceOptions, cwd?: string): GitSource<T> {\n return new GitSource<T>(options, cwd);\n}\n","import type { CollectionEntry, ChangeSet, WatchCallback } from \"../types\";\nimport type { RemoteSourceOptions, WebhookConfig } from \"./types\";\nimport { BaseSource } from \"./base\";\n\n/**\n * Remote API source for collections\n */\nexport class RemoteSource<T = unknown> extends BaseSource<T> {\n id: string;\n private options: RemoteSourceOptions<T>;\n private pollTimer?: ReturnType<typeof setInterval>;\n\n constructor(options: RemoteSourceOptions<T>, id: string = \"remote\") {\n super();\n this.options = options;\n this.id = `remote:${id}`;\n }\n\n async getEntries(): Promise<CollectionEntry<T>[]> {\n const items = await this.options.fetch();\n\n return items.map((item, index) => {\n const id = (item as Record<string, unknown>).id?.toString() ?? index.toString();\n const slug = (item as Record<string, unknown>).slug?.toString() ?? id;\n\n return {\n id,\n slug,\n data: item,\n body: (item as Record<string, unknown>).content?.toString() ?? \"\",\n render: async () => ({\n Content: () => {\n throw new Error(\"Remote content rendering not yet implemented\");\n },\n }),\n };\n });\n }\n\n override async getEntry(id: string): Promise<CollectionEntry<T> | null> {\n if (this.options.fetchOne) {\n const item = await this.options.fetchOne(id);\n if (!item) return null;\n\n const slug = (item as Record<string, unknown>).slug?.toString() ?? id;\n\n return {\n id,\n slug,\n data: item,\n body: (item as Record<string, unknown>).content?.toString() ?? \"\",\n render: async () => ({\n Content: () => {\n throw new Error(\"Remote content rendering not yet implemented\");\n },\n }),\n };\n }\n\n return super.getEntry(id);\n }\n\n override watch(callback: WatchCallback<T>): () => void {\n if (this.options.pollInterval) {\n this.pollTimer = setInterval(async () => {\n const entries = await this.getEntries();\n callback({\n cursor: Date.now().toString(),\n added: [],\n updated: entries,\n deleted: [],\n });\n }, this.options.pollInterval);\n\n return () => {\n if (this.pollTimer) {\n clearInterval(this.pollTimer);\n }\n };\n }\n\n return () => {};\n }\n\n override async getChanges(since: string): Promise<ChangeSet<T>> {\n if (this.options.fetchChanges) {\n return this.options.fetchChanges(since);\n }\n\n // Fallback to full reload\n const entries = await this.getEntries();\n return {\n cursor: Date.now().toString(),\n added: [],\n updated: entries,\n deleted: [],\n };\n }\n\n /**\n * Get webhook configuration for external integration\n */\n getWebhookConfig(): WebhookConfig | undefined {\n return this.options.webhook;\n }\n}\n\n/**\n * Create a remote API source\n */\nexport function remoteSource<T = unknown>(\n options: RemoteSourceOptions<T>,\n id?: string,\n): RemoteSource<T> {\n return new RemoteSource<T>(options, id);\n}\n","import type { CollectionEntry, ChangeSet, WatchCallback } from \"../types\";\nimport type { CustomSourceOptions } from \"./types\";\nimport { BaseSource } from \"./base\";\n\n/**\n * Custom source for collections\n */\nexport class CustomSource<T = unknown> extends BaseSource<T> {\n id: string;\n private options: CustomSourceOptions<T>;\n\n constructor(options: CustomSourceOptions<T>) {\n super();\n this.options = options;\n this.id = options.id;\n }\n\n async getEntries(): Promise<CollectionEntry<T>[]> {\n const items = await this.options.getEntries();\n\n return items.map((item, index) => {\n const id = (item as Record<string, unknown>).id?.toString() ?? index.toString();\n const slug = (item as Record<string, unknown>).slug?.toString() ?? id;\n\n return {\n id,\n slug,\n data: item,\n body: (item as Record<string, unknown>).body?.toString() ?? \"\",\n render: async () => ({\n Content: () => {\n throw new Error(\"Custom content rendering not yet implemented\");\n },\n }),\n };\n });\n }\n\n override async getEntry(id: string): Promise<CollectionEntry<T> | null> {\n if (this.options.getEntry) {\n const item = await this.options.getEntry(id);\n if (!item) return null;\n\n const slug = (item as Record<string, unknown>).slug?.toString() ?? id;\n\n return {\n id,\n slug,\n data: item,\n body: (item as Record<string, unknown>).body?.toString() ?? \"\",\n render: async () => ({\n Content: () => {\n throw new Error(\"Custom content rendering not yet implemented\");\n },\n }),\n };\n }\n\n return super.getEntry(id);\n }\n\n override watch(callback: WatchCallback<T>): () => void {\n if (this.options.watch) {\n return this.options.watch(callback);\n }\n return () => {};\n }\n\n override async getChanges(since: string): Promise<ChangeSet<T>> {\n if (this.options.getChanges) {\n return this.options.getChanges(since);\n }\n\n const entries = await this.getEntries();\n return {\n cursor: Date.now().toString(),\n added: [],\n updated: entries,\n deleted: [],\n };\n }\n}\n\n/**\n * Create a custom source\n */\nexport function createSource<T = unknown>(options: CustomSourceOptions<T>): CustomSource<T> {\n return new CustomSource<T>(options);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,MAAa,mBAAqC,EAChD,UACA,QAAQ,YACR,SACA,UAEA,qBAAC;CAAK,MAAK;YACT,qBAAC;EACC,oBAAC,UAAK,SAAQ,UAAU;EACxB,oBA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