@unterberg/nivel 0.2.1 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -1
- package/dist/{chunk-GFZ3P4F4.js → chunk-4TSZLIUC.js} +23 -1
- package/dist/chunk-4TSZLIUC.js.map +1 -0
- package/dist/{chunk-AQJQDMKW.js → chunk-PBYVWITH.js} +66 -18
- package/dist/chunk-PBYVWITH.js.map +1 -0
- package/dist/{chunk-I75ALNG2.js → chunk-YMC435GL.js} +2 -2
- package/dist/cli.js +6 -12
- package/dist/cli.js.map +1 -1
- package/dist/client.d.ts +1 -1
- package/dist/client.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/runtime/client.d.ts +1 -1
- package/dist/runtime/client.js +1 -1
- package/dist/runtime/node.d.ts +1 -1
- package/dist/runtime/node.js +2 -2
- package/dist/{types-Duk127zu.d.ts → types-C9WEqIOF.d.ts} +3 -1
- package/dist/vike.d.ts +1 -1
- package/dist/vike.js +12 -6
- package/dist/vike.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-AQJQDMKW.js.map +0 -1
- package/dist/chunk-GFZ3P4F4.js.map +0 -1
- /package/dist/{chunk-I75ALNG2.js.map → chunk-YMC435GL.js.map} +0 -0
package/README.md
CHANGED
|
@@ -22,7 +22,7 @@ pnpm add -D vite typescript @types/react @types/react-dom
|
|
|
22
22
|
|
|
23
23
|
`vike` and `vite` are peer dependencies. The package exposes a local `nivel` binary after install.
|
|
24
24
|
|
|
25
|
-
Set `siteUrl` in `pages/+docs.ts` to enable automatic `sitemap.xml` and `robots.txt` generation. V1 includes canonical docs routes from the docs graph plus normal filesystem-routed consumer pages. Consumer routes remapped only through custom `+route.ts` files are not included automatically.
|
|
25
|
+
Set `siteUrl` in `pages/+docs.ts` to enable automatic `sitemap.xml` and `robots.txt` generation. Set `robots: false` to emit `noindex, nofollow` and a disallow-all `robots.txt`. V1 includes canonical docs routes from the docs graph plus normal filesystem-routed consumer pages. Consumer routes remapped only through custom `+route.ts` files are not included automatically.
|
|
26
26
|
|
|
27
27
|
## Quick Start
|
|
28
28
|
|
|
@@ -111,6 +111,7 @@ const docsConfig = {
|
|
|
111
111
|
siteTitle: 'My Docs',
|
|
112
112
|
siteDescription: 'Documentation site powered by @unterberg/nivel.',
|
|
113
113
|
siteUrl: 'https://docs.example.com',
|
|
114
|
+
// robots: false,
|
|
114
115
|
basePath: '/docs',
|
|
115
116
|
} satisfies DocsConfig
|
|
116
117
|
|
|
@@ -174,6 +174,9 @@ var resolveFooterConfig = (footer) => {
|
|
|
174
174
|
pagination: footer?.pagination ?? false
|
|
175
175
|
};
|
|
176
176
|
};
|
|
177
|
+
var resolveRobotsConfig = (robots) => {
|
|
178
|
+
return robots ?? true;
|
|
179
|
+
};
|
|
177
180
|
var resolveBrandConfig = (brand, siteTitle) => {
|
|
178
181
|
const text = brand?.text ?? siteTitle;
|
|
179
182
|
return {
|
|
@@ -383,6 +386,7 @@ var resolveDocsConfig = (config) => {
|
|
|
383
386
|
return {
|
|
384
387
|
siteTitle: config.siteTitle,
|
|
385
388
|
siteDescription: config.siteDescription ?? null,
|
|
389
|
+
robots: resolveRobotsConfig(config.robots),
|
|
386
390
|
basePath: normalizedBasePath,
|
|
387
391
|
contentDir: normalizedContentDir,
|
|
388
392
|
theme: resolveThemeConfig(config.theme),
|
|
@@ -698,6 +702,7 @@ var syncGeneratedDocsPages = (options) => {
|
|
|
698
702
|
fs.mkdirSync(generatedPagesRoot, { recursive: true });
|
|
699
703
|
const globalContextData = {
|
|
700
704
|
siteTitle: resolved.siteTitle,
|
|
705
|
+
robots: resolved.robots,
|
|
701
706
|
basePath: resolved.basePath,
|
|
702
707
|
theme: resolved.theme,
|
|
703
708
|
footer: resolved.footer,
|
|
@@ -818,6 +823,8 @@ var getDocsConfigTemplate = () => {
|
|
|
818
823
|
" siteDescription: 'Documentation site powered by @unterberg/nivel.',",
|
|
819
824
|
" // Add siteUrl to enable automatic sitemap.xml and robots.txt generation.",
|
|
820
825
|
" // siteUrl: 'https://docs.example.com',",
|
|
826
|
+
" // Set robots to false to emit noindex/nofollow and a disallow-all robots.txt.",
|
|
827
|
+
" // robots: false,",
|
|
821
828
|
" basePath: '/docs',",
|
|
822
829
|
"} satisfies DocsConfig",
|
|
823
830
|
"",
|
|
@@ -851,6 +858,20 @@ var getDocsGraphTemplate = () => {
|
|
|
851
858
|
""
|
|
852
859
|
].join("\n");
|
|
853
860
|
};
|
|
861
|
+
var getGettingStartedTemplate = () => {
|
|
862
|
+
return [
|
|
863
|
+
"# Getting Started",
|
|
864
|
+
"",
|
|
865
|
+
"This page is scaffolded by `nivel init` and wired through `docs/docs.graph.ts`.",
|
|
866
|
+
"",
|
|
867
|
+
"## Next steps",
|
|
868
|
+
"",
|
|
869
|
+
"- Update `pages/+docs.ts` with your site metadata.",
|
|
870
|
+
"- Expand `docs/docs.graph.ts` with your docs structure.",
|
|
871
|
+
"- Replace this page with your real getting-started guide.",
|
|
872
|
+
""
|
|
873
|
+
].join("\n");
|
|
874
|
+
};
|
|
854
875
|
var getConfigTemplate = () => {
|
|
855
876
|
return [
|
|
856
877
|
"import { createNivelVikeConfig } from '@unterberg/nivel/vike'",
|
|
@@ -1107,6 +1128,7 @@ var getManagedFileEntries = () => {
|
|
|
1107
1128
|
["vite.config.ts", getViteConfigTemplate()],
|
|
1108
1129
|
["pages/+docs.ts", getDocsConfigTemplate()],
|
|
1109
1130
|
["docs/docs.graph.ts", getDocsGraphTemplate()],
|
|
1131
|
+
["docs/content/getting-started/content.mdx", getGettingStartedTemplate()],
|
|
1110
1132
|
["pages/+config.ts", getConfigTemplate()],
|
|
1111
1133
|
["pages/+Head.tsx", getHeadTemplate()],
|
|
1112
1134
|
["pages/+Layout.tsx", getLayoutTemplate()],
|
|
@@ -1279,4 +1301,4 @@ export {
|
|
|
1279
1301
|
getInitSummary,
|
|
1280
1302
|
initConsumer
|
|
1281
1303
|
};
|
|
1282
|
-
//# sourceMappingURL=chunk-
|
|
1304
|
+
//# sourceMappingURL=chunk-4TSZLIUC.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/docs/icons.ts","../src/docs/resolveDocsConfig.ts","../src/runtime/node/codegen.ts","../src/runtime/node/loadDocsConfig.ts","../src/runtime/node/scaffold.ts"],"sourcesContent":["import type { LucideIcon } from 'lucide-react'\nimport * as lucideIcons from 'lucide-react'\n\ntype LucideModule = typeof import('lucide-react')\n\nexport type DocsIconName = {\n [Key in keyof LucideModule]: LucideModule[Key] extends LucideIcon ? Key : never\n}[keyof LucideModule]\n\nconst excludedLucideExports = new Set(['createLucideIcon', 'Icon', 'icons', 'LucideProvider', 'useLucideContext'])\n\nconst isLucideIconExport = (value: unknown) => {\n if (typeof value !== 'object' || value === null) {\n return false\n }\n\n return '$$typeof' in value && 'render' in value\n}\n\nconst docsIconNames = Object.freeze(\n Object.entries(lucideIcons)\n .filter(([name, value]) => !excludedLucideExports.has(name) && isLucideIconExport(value))\n .map(([name]) => name)\n .sort(),\n) as readonly DocsIconName[]\n\nconst docsIconNameSet = new Set<string>(docsIconNames)\n\nconst isDocsIconName = (value: string): value is DocsIconName => {\n return docsIconNameSet.has(value)\n}\n\nexport const assertDocsIconName = (value: string, context: string) => {\n if (isDocsIconName(value)) {\n return\n }\n\n throw new Error(\n `${context} must be a valid lucide-react icon export. Received \"${value}\". See https://lucide.dev/icons/`,\n )\n}\n","import { nivelAssetUrl, resolvePublicAssetUrl, withSiteBaseUrl } from '../shared/assets.js'\nimport type {\n DocsAlgoliaConfig,\n DocsBrandConfig,\n DocsConfig,\n DocsFooterConfig,\n DocsHeadConfig,\n DocsPageNode,\n DocsPartnerConfig,\n DocsSectionNode,\n DocsSidebarNode,\n ResolvedDocsAlgoliaConfig,\n ResolvedDocsBrandConfig,\n ResolvedDocsConfig,\n ResolvedDocsPage,\n ResolvedDocsPartnerConfig,\n ResolvedDocsPartnersConfig,\n ResolvedDocsSection,\n ResolvedDocsSocialConfig,\n ResolvedNavbarItem,\n ResolvedSidebarNode,\n ThemePreference,\n} from './types.js'\nimport { assertDocsIconName } from './icons.js'\n\nconst isExternalHref = (value: string) => {\n return /^(?:[a-z]+:)?\\/\\//i.test(value) || value.startsWith('mailto:') || value.startsWith('tel:')\n}\n\nconst normalizeBasePath = (value: string) => {\n const normalized = value.trim()\n\n if (!normalized) {\n throw new Error('Docs basePath must be a non-empty absolute path.')\n }\n\n if (!normalized.startsWith('/') || normalized.startsWith('//')) {\n throw new Error(`Docs basePath must start with \"/\". Received ${JSON.stringify(value)}.`)\n }\n\n if (normalized.includes('?') || normalized.includes('#')) {\n throw new Error(`Docs basePath cannot include query strings or hashes. Received ${JSON.stringify(value)}.`)\n }\n\n const collapsed = normalized.replace(/\\/+/g, '/').replace(/\\/+$/g, '')\n return collapsed === '' ? '/' : collapsed\n}\n\nconst normalizeContentDir = (value: string | undefined) => {\n const normalized = (value ?? 'docs').trim()\n\n if (!normalized) {\n throw new Error('Docs contentDir must be a non-empty project-relative path.')\n }\n\n if (normalized.startsWith('/') || normalized.startsWith('\\\\')) {\n throw new Error(`Docs contentDir must be project-relative. Received ${JSON.stringify(value)}.`)\n }\n\n if (/^[a-zA-Z]:[\\\\/]/.test(normalized)) {\n throw new Error(`Docs contentDir must be project-relative. Received ${JSON.stringify(value)}.`)\n }\n\n const segments = normalized.replaceAll('\\\\', '/').split('/')\n const resolvedSegments: string[] = []\n\n for (const segment of segments) {\n if (segment === '' || segment === '.') {\n continue\n }\n\n if (segment === '..') {\n throw new Error(`Docs contentDir cannot escape the project root. Received ${JSON.stringify(value)}.`)\n }\n\n resolvedSegments.push(segment)\n }\n\n if (resolvedSegments.length === 0) {\n throw new Error(`Docs contentDir must contain at least one path segment. Received ${JSON.stringify(value)}.`)\n }\n\n return resolvedSegments.join('/')\n}\n\nconst normalizeSlug = (value: string) => value.replace(/^\\/+|\\/+$/g, '')\n\nconst joinDocsHref = (basePath: string, slug: string) => {\n const normalizedBasePath = normalizeBasePath(basePath)\n const normalizedSlug = normalizeSlug(slug)\n\n if (!normalizedSlug) {\n return normalizedBasePath === '/' ? '/' : `${normalizedBasePath}/`\n }\n\n return normalizedBasePath === '/' ? `/${normalizedSlug}/` : `${normalizedBasePath}/${normalizedSlug}/`\n}\n\nconst normalizePathname = (value: string) => {\n const pathname = value.split('?')[0]?.split('#')[0] ?? value\n const normalized = pathname.trim().replace(/\\/+$/g, '')\n return normalized === '' ? '/' : `${normalized}/`.replace(/\\/+/g, '/')\n}\n\nexport const resolveDocsHref = (basePath: string, href: string) => {\n const normalized = href.trim()\n\n if (!normalized || normalized.startsWith('#') || isExternalHref(normalized)) {\n return null\n }\n\n const pathname = normalized.split('?')[0]?.split('#')[0] ?? normalized\n\n if (!pathname) {\n return null\n }\n\n if (pathname.startsWith('/')) {\n const normalizedPathname = normalizePathname(pathname)\n const normalizedBasePath = normalizeBasePath(basePath)\n\n if (normalizedBasePath === '/') {\n return normalizedPathname\n }\n\n return normalizedPathname === `${normalizedBasePath}/` || normalizedPathname.startsWith(`${normalizedBasePath}/`)\n ? normalizedPathname\n : null\n }\n\n if (pathname.startsWith('./') || pathname.startsWith('../')) {\n return null\n }\n\n return joinDocsHref(basePath, pathname)\n}\n\nconst normalizeSourcePath = (value: string) => {\n const segments = value.replaceAll('\\\\', '/').split('/')\n const normalizedSegments: string[] = []\n\n for (const segment of segments) {\n if (segment === '' || segment === '.') {\n continue\n }\n\n if (segment === '..') {\n normalizedSegments.pop()\n continue\n }\n\n normalizedSegments.push(segment)\n }\n\n return normalizedSegments.join('/')\n}\n\nconst getSectionHref = (items: ResolvedSidebarNode[], visibleOnly = false): string | null => {\n for (const item of items) {\n if (item.kind === 'page') {\n if (visibleOnly && !item.showInNav) {\n continue\n }\n\n return item.href\n }\n\n if (item.kind === 'group') {\n if (visibleOnly && !item.showInNav) {\n continue\n }\n\n const href = getSectionHref(item.items, visibleOnly)\n if (href) {\n return href\n }\n }\n }\n\n return null\n}\n\nconst resolveNavigationHref = (value: string, fieldName: string, basePath: string) => {\n const normalized = value.trim()\n\n if (!normalized) {\n throw new Error(`Docs ${fieldName} must be a non-empty string.`)\n }\n\n if (normalized.startsWith('#') || isExternalHref(normalized)) {\n return normalized\n }\n\n if (!normalized.startsWith('/')) {\n return joinDocsHref(basePath, normalized)\n }\n\n return normalizePathname(normalized)\n}\n\nconst resolveThemeConfig = (theme: DocsConfig['theme']) => {\n return {\n light: theme?.light ?? 'consumer-light',\n dark: theme?.dark ?? 'consumer-dark',\n defaultPreference: (theme?.defaultPreference ?? 'light') as ThemePreference,\n }\n}\n\nconst resolveFooterConfig = (footer: DocsFooterConfig | undefined) => {\n return {\n pagination: footer?.pagination ?? false,\n }\n}\n\nconst resolveRobotsConfig = (robots: DocsConfig['robots']) => {\n return robots ?? true\n}\n\nconst resolveBrandConfig = (brand: DocsBrandConfig | undefined, siteTitle: string): ResolvedDocsBrandConfig => {\n const text = brand?.text ?? siteTitle\n\n return {\n text,\n href: withSiteBaseUrl(brand?.href ?? '/'),\n logoLight: resolvePublicAssetUrl(brand?.logoLight),\n logoDark: resolvePublicAssetUrl(brand?.logoDark),\n logoAlt: brand?.logoAlt ?? `${text} logo`,\n }\n}\n\nconst resolveHeadConfig = (head: DocsHeadConfig | undefined) => {\n const fontPreset = head?.fontPreset ?? 'inter'\n const defaultFontStylesheetHref = fontPreset === 'inter' ? nivelAssetUrl('fonts/fonts-inter.css') : undefined\n const defaultFontPreloadHrefs =\n fontPreset === 'inter'\n ? [\n nivelAssetUrl('fonts/inter-v20-latin-regular.woff2'),\n nivelAssetUrl('fonts/inter-v20-latin-600.woff2'),\n nivelAssetUrl('fonts/inter-v20-latin-800.woff2'),\n ]\n : []\n\n return {\n faviconSvg: resolvePublicAssetUrl(head?.faviconSvg),\n faviconIco: resolvePublicAssetUrl(head?.faviconIco),\n appleTouchIcon: resolvePublicAssetUrl(head?.appleTouchIcon),\n fontPreset,\n fontStylesheetHref: head?.fontStylesheetHref ?? defaultFontStylesheetHref,\n fontPreloadHrefs: head?.fontPreloadHrefs ?? defaultFontPreloadHrefs,\n }\n}\n\nconst resolvePartnerAssetUrl = (value: string | undefined) => {\n if (!value) {\n return undefined\n }\n\n return resolvePublicAssetUrl(value)\n}\n\nconst resolvePartner = (partner: DocsPartnerConfig): ResolvedDocsPartnerConfig => {\n return {\n name: partner.name,\n href: withSiteBaseUrl(partner.href),\n logoLight: resolvePartnerAssetUrl(partner.logoLight) ?? partner.logoLight,\n logoDark: resolvePartnerAssetUrl(partner.logoDark),\n logoAlt: partner.logoAlt ?? `${partner.name} logo`,\n }\n}\n\nconst resolveSocialConfig = (social: DocsConfig['social']): ResolvedDocsSocialConfig => {\n // keep the order from the config\n return {\n ...social,\n }\n}\n\nconst resolvePartnersConfig = (partners: DocsConfig['partners']): ResolvedDocsPartnersConfig => {\n return {\n primary: (partners?.primary ?? []).map(resolvePartner),\n gold: (partners?.gold ?? []).map(resolvePartner),\n }\n}\n\nconst requireTrimmedString = (value: string, fieldName: string) => {\n const normalized = value.trim()\n\n if (!normalized) {\n throw new Error(`Docs algolia config \"${fieldName}\" must be a non-empty string.`)\n }\n\n return normalized\n}\n\nconst resolveAlgoliaConfig = (algolia: DocsAlgoliaConfig | undefined): ResolvedDocsAlgoliaConfig | null => {\n if (!algolia) {\n return null\n }\n\n return {\n appId: requireTrimmedString(algolia.appId, 'appId'),\n apiKey: requireTrimmedString(algolia.apiKey, 'apiKey'),\n indexName: requireTrimmedString(algolia.indexName, 'indexName'),\n fields: {\n href: algolia.fields?.href?.trim() || 'href',\n title: algolia.fields?.title?.trim() || 'title',\n excerpt: algolia.fields?.excerpt?.trim() || 'excerpt',\n sectionTitle: algolia.fields?.sectionTitle?.trim() || 'sectionTitle',\n },\n searchParams: algolia.searchParams ?? {},\n }\n}\n\nconst normalizeAliases = (aliases: string[] | undefined, slug: string) => {\n const normalizedAliases = new Set<string>()\n\n for (const alias of aliases ?? []) {\n const normalizedAlias = normalizeSlug(alias)\n if (!normalizedAlias || normalizedAlias === slug) {\n continue\n }\n\n normalizedAliases.add(normalizedAlias)\n }\n\n return [...normalizedAliases]\n}\n\nexport const resolveDocsConfig = (config: DocsConfig): ResolvedDocsConfig => {\n const normalizedBasePath = normalizeBasePath(config.basePath)\n const normalizedContentDir = normalizeContentDir(config.contentDir)\n\n const pageIds = new Set<string>()\n const pageSlugs = new Set<string>()\n const pageAliases = new Set<string>()\n const groupIds = new Set<string>()\n const sectionIds = new Set<string>()\n const pages: ResolvedDocsPage[] = []\n const navbarItems: ResolvedNavbarItem[] = []\n\n const resolveSidebarNodes = (nodes: DocsSidebarNode[], sectionId: string): ResolvedSidebarNode[] => {\n return nodes.map((node) => {\n if (node.kind === 'group') {\n if (groupIds.has(node.id)) {\n throw new Error(`Duplicate docs group id \"${node.id}\".`)\n }\n\n if (node.icon) {\n assertDocsIconName(node.icon, `Docs group \"${node.id}\" icon`)\n }\n\n groupIds.add(node.id)\n\n return {\n kind: 'group',\n id: node.id,\n title: node.title,\n href: node.href ? resolveNavigationHref(node.href, `group \"${node.id}\" href`, normalizedBasePath) : undefined,\n showInNav: node.showInNav ?? true,\n collapsible: node.collapsible,\n items: resolveSidebarNodes(node.items, sectionId),\n icon: node.icon,\n }\n }\n\n if (node.kind !== 'page') {\n throw new Error(`Invalid docs sidebar node: ${JSON.stringify(node)}`)\n }\n\n const pageNode = node as DocsPageNode\n const slug = normalizeSlug(pageNode.slug)\n const aliases = normalizeAliases(pageNode.aliases, slug)\n\n if (pageNode.icon) {\n assertDocsIconName(pageNode.icon, `Docs page \"${pageNode.id}\" icon`)\n }\n\n if (!slug) {\n throw new Error(`Docs page \"${pageNode.id}\" must define a non-empty slug.`)\n }\n\n if (pageIds.has(pageNode.id)) {\n throw new Error(`Duplicate docs page id \"${pageNode.id}\".`)\n }\n\n if (pageSlugs.has(slug)) {\n throw new Error(`Duplicate docs page slug \"${slug}\".`)\n }\n\n for (const alias of aliases) {\n if (pageSlugs.has(alias) || pageAliases.has(alias)) {\n throw new Error(`Duplicate docs page alias \"${alias}\".`)\n }\n }\n\n pageIds.add(pageNode.id)\n pageSlugs.add(slug)\n for (const alias of aliases) {\n pageAliases.add(alias)\n }\n\n const href = joinDocsHref(normalizedBasePath, slug)\n const page: ResolvedDocsPage = {\n ...pageNode,\n slug,\n aliases,\n href,\n aliasHrefs: aliases.map((alias) => joinDocsHref(normalizedBasePath, alias)),\n tableOfContents: pageNode.tableOfContents ?? true,\n sectionId,\n documentTitle: `${pageNode.title} | ${config.siteTitle}`,\n source: normalizeSourcePath(pageNode.source),\n }\n pages.push(page)\n\n return {\n kind: 'page',\n id: pageNode.id,\n title: pageNode.title,\n navTitle: pageNode.navTitle ?? pageNode.title,\n href,\n showInNav: pageNode.showInNav ?? true,\n icon: pageNode.icon,\n }\n })\n }\n\n const sections: ResolvedDocsSection[] = config.graph.items.map((section: DocsSectionNode) => {\n if (section.kind !== 'section') {\n throw new Error(`Top-level docs graph items must be sections. Received ${JSON.stringify(section)}`)\n }\n\n if (sectionIds.has(section.id)) {\n throw new Error(`Duplicate docs section id \"${section.id}\".`)\n }\n\n if (section.icon) {\n assertDocsIconName(section.icon, `Docs section \"${section.id}\" icon`)\n }\n\n sectionIds.add(section.id)\n\n const items = resolveSidebarNodes(section.items, section.id)\n const firstVisibleHref = getSectionHref(items, true)\n const href = section.href\n ? resolveNavigationHref(section.href, `section \"${section.id}\" href`, normalizedBasePath)\n : (firstVisibleHref ?? getSectionHref(items))\n\n if (!href) {\n throw new Error(`Docs section \"${section.id}\" must contain at least one page.`)\n }\n\n const resolvedSection: ResolvedDocsSection = {\n id: section.id,\n title: section.title,\n navTitle: section.navTitle ?? section.title,\n href,\n items,\n icon: section.icon,\n }\n\n navbarItems.push({\n id: section.id,\n title: resolvedSection.navTitle,\n href: resolvedSection.href,\n })\n\n return resolvedSection\n })\n\n if (pages.length === 0) {\n throw new Error('Docs graph must contain at least one page.')\n }\n\n return {\n siteTitle: config.siteTitle,\n siteDescription: config.siteDescription ?? null,\n robots: resolveRobotsConfig(config.robots),\n basePath: normalizedBasePath,\n contentDir: normalizedContentDir,\n theme: resolveThemeConfig(config.theme),\n footer: resolveFooterConfig(config.footer),\n brand: resolveBrandConfig(config.brand, config.siteTitle),\n head: resolveHeadConfig(config.head),\n partners: resolvePartnersConfig(config.partners),\n social: resolveSocialConfig(config.social),\n algolia: resolveAlgoliaConfig(config.algolia),\n pages,\n sections,\n navbarItems,\n }\n}\n\nexport const getResolvedPageById = (config: { pages: ResolvedDocsPage[] }, pageId: string) => {\n const page = config.pages.find((candidate) => candidate.id === pageId)\n if (!page) {\n throw new Error(`Unknown docs page id \"${pageId}\".`)\n }\n return page\n}\n","import fs from 'node:fs'\nimport { createRequire } from 'node:module'\nimport path from 'node:path'\nimport { extractDocHeadings } from '../../docs/docHeadings.js'\nimport { getDocsIconMapKey } from '../../docs/iconKeys.js'\nimport { getResolvedPageById, resolveDocsConfig } from '../../docs/resolveDocsConfig.js'\nimport type {\n DocPageData,\n DocPageLinkData,\n DocsConfig,\n DocsGlobalContextSerializableData,\n DocsIconName,\n ResolvedSidebarNode,\n} from '../../docs/types.js'\n\nconst GENERATED_DIRNAME = '(nivel-generated)'\nconst require = createRequire(import.meta.url)\nconst lucidePackageRoot = path.dirname(require.resolve('lucide-react/package.json'))\nconst lucideEsmEntryPath = path.join(lucidePackageRoot, 'dist', 'esm', 'lucide-react.js')\nconst lucideEsmIconsDirectoryPath = path.join(lucidePackageRoot, 'dist', 'esm', 'icons')\n\ntype GeneratedDocsIconNode = [tagName: string, attrs: Record<string, string>][]\n\nlet lucideIconModuleNameByExportName: Map<string, string> | null = null\nconst lucideIconNodeByName = new Map<DocsIconName, GeneratedDocsIconNode>()\n\nconst writeFileIfChanged = (filePath: string, source: string) => {\n const current = fs.existsSync(filePath) ? fs.readFileSync(filePath, 'utf8') : null\n if (current === source) {\n return\n }\n\n fs.mkdirSync(path.dirname(filePath), { recursive: true })\n fs.writeFileSync(filePath, source)\n}\n\nconst toPosix = (value: string) => value.split(path.sep).join(path.posix.sep)\n\nconst getRelativeImportPath = (fromDirectory: string, toFile: string) => {\n const relativePath = toPosix(path.relative(fromDirectory, toFile))\n if (relativePath.startsWith('.')) {\n return relativePath\n }\n return `./${relativePath}`\n}\n\nconst serializeData = (data: DocPageData | DocsGlobalContextSerializableData) => JSON.stringify(data, null, 2)\n\nconst collectFiles = (directoryPath: string): string[] => {\n if (!fs.existsSync(directoryPath)) {\n return []\n }\n\n const entries = fs.readdirSync(directoryPath, { withFileTypes: true })\n\n return entries.flatMap((entry) => {\n const entryPath = path.join(directoryPath, entry.name)\n return entry.isDirectory() ? collectFiles(entryPath) : [entryPath]\n })\n}\n\nconst removeEmptyDirectories = (directoryPath: string, rootPath: string) => {\n if (!fs.existsSync(directoryPath)) {\n return\n }\n\n for (const entry of fs.readdirSync(directoryPath, { withFileTypes: true })) {\n if (!entry.isDirectory()) {\n continue\n }\n\n removeEmptyDirectories(path.join(directoryPath, entry.name), rootPath)\n }\n\n if (directoryPath === rootPath) {\n return\n }\n\n if (fs.readdirSync(directoryPath).length === 0) {\n fs.rmdirSync(directoryPath)\n }\n}\n\nconst getGeneratedPageSource = (contentImportPath: string) => {\n return [\n \"import { DocsPage } from '@unterberg/nivel/client'\",\n `import Content from ${JSON.stringify(contentImportPath)}`,\n '',\n 'const Page = () => {',\n ' return <DocsPage Content={Content} />',\n '}',\n '',\n 'export default Page',\n '',\n ].join('\\n')\n}\n\nconst getGeneratedLayoutSource = () => {\n return [\n \"import { DocsRouteLayout } from '@unterberg/nivel/client'\",\n \"import type { ReactNode } from 'react'\",\n '',\n 'const Layout = ({ children }: { children: ReactNode }) => {',\n ' return <DocsRouteLayout>{children}</DocsRouteLayout>',\n '}',\n '',\n 'export default Layout',\n '',\n ].join('\\n')\n}\n\nconst getGeneratedDataSource = (data: DocPageData) => {\n return [\n \"import type { DocPageData } from '@unterberg/nivel'\",\n '',\n `const data: DocPageData = ${serializeData(data)}`,\n '',\n 'const pageData = () => {',\n ' return data',\n '}',\n '',\n 'export default pageData',\n '',\n ].join('\\n')\n}\n\ntype IconEntry = {\n iconKey: string\n iconName: DocsIconName\n}\n\nconst getSidebarIconEntries = (nodes: ResolvedSidebarNode[]): IconEntry[] => {\n return nodes.flatMap((node) => {\n const iconEntries = node.icon ? [{ iconKey: getDocsIconMapKey(node.kind, node.id), iconName: node.icon }] : []\n\n if (node.kind === 'group') {\n return [...iconEntries, ...getSidebarIconEntries(node.items)]\n }\n\n return iconEntries\n })\n}\n\nconst getGeneratedIconMapSource = (entries: IconEntry[]) => {\n if (entries.length === 0) {\n return '{}'\n }\n\n return ['{', ...entries.map(({ iconKey, iconName }) => ` ${JSON.stringify(iconKey)}: ${iconName},`), '}'].join('\\n')\n}\n\nconst getLucideIconModuleNameByExportName = () => {\n if (lucideIconModuleNameByExportName) {\n return lucideIconModuleNameByExportName\n }\n\n const lucideEntrySource = fs.readFileSync(lucideEsmEntryPath, 'utf8')\n const exportMap = new Map<string, string>()\n const exportPattern = /export\\s+\\{\\s*([\\s\\S]*?)\\s*\\}\\s+from\\s+'\\.\\/icons\\/([^']+)\\.js';/g\n\n for (const match of lucideEntrySource.matchAll(exportPattern)) {\n const exportsSource = match[1]\n const moduleName = match[2]\n\n if (!exportsSource || !moduleName) {\n continue\n }\n\n for (const exportPart of exportsSource.split(',').map((value) => value.trim())) {\n const exportMatch = /^default as (\\w+)$/.exec(exportPart)\n\n if (!exportMatch?.[1]) {\n continue\n }\n\n exportMap.set(exportMatch[1], moduleName)\n }\n }\n\n lucideIconModuleNameByExportName = exportMap\n return exportMap\n}\n\nconst getDocsIconNode = (iconName: DocsIconName) => {\n const cachedIconNode = lucideIconNodeByName.get(iconName)\n\n if (cachedIconNode) {\n return cachedIconNode\n }\n\n const moduleName = getLucideIconModuleNameByExportName().get(iconName)\n\n if (!moduleName) {\n throw new Error(`Unable to resolve lucide-react module for docs icon \"${iconName}\".`)\n }\n\n const iconModuleSource = fs.readFileSync(path.join(lucideEsmIconsDirectoryPath, `${moduleName}.js`), 'utf8')\n const iconNodeMatch = /const __iconNode = (\\[[\\s\\S]*?\\]);\\s*const /.exec(iconModuleSource)\n\n if (!iconNodeMatch?.[1]) {\n throw new Error(`Unable to read lucide-react icon node for docs icon \"${iconName}\".`)\n }\n\n const iconNode = Function(`\"use strict\"; return (${iconNodeMatch[1]})`)() as GeneratedDocsIconNode\n lucideIconNodeByName.set(iconName, iconNode)\n return iconNode\n}\n\nconst getGeneratedIconDefinitionsSource = (iconNames: DocsIconName[]) => {\n if (iconNames.length === 0) {\n return []\n }\n\n const definitions = iconNames.flatMap((iconName) => {\n return [`const ${iconName} = createDocsIcon(${JSON.stringify(getDocsIconNode(iconName))})`, '']\n })\n\n return [\n \"import { createElement, forwardRef, type SVGProps } from 'react'\",\n '',\n 'type DocsGeneratedIconProps = SVGProps<SVGSVGElement> & {',\n ' size?: string | number',\n ' absoluteStrokeWidth?: boolean',\n '}',\n '',\n 'type DocsGeneratedIconNode = [tagName: string, attrs: Record<string, string>][]',\n '',\n 'const docsGeneratedIconSvgAttrs = {',\n \" xmlns: 'http://www.w3.org/2000/svg',\",\n \" fill: 'none',\",\n \" viewBox: '0 0 24 24',\",\n \" stroke: 'currentColor',\",\n ' strokeWidth: 2,',\n \" strokeLinecap: 'round',\",\n \" strokeLinejoin: 'round',\",\n '} as const',\n '',\n 'const createDocsIcon = (iconNode: DocsGeneratedIconNode) => {',\n ' return forwardRef<SVGSVGElement, DocsGeneratedIconProps>(',\n ' ({ color = \"currentColor\", size = 24, strokeWidth = 2, absoluteStrokeWidth, children, ...props }, ref) => {',\n \" const resolvedSize = typeof size === 'number' ? size : Number(size)\",\n ' const resolvedStrokeWidth =',\n ' absoluteStrokeWidth && Number.isFinite(resolvedSize) && resolvedSize > 0',\n ' ? (Number(strokeWidth) * 24) / resolvedSize',\n ' : strokeWidth',\n '',\n ' return createElement(',\n \" 'svg',\",\n ' {',\n ' ...docsGeneratedIconSvgAttrs,',\n ' ...props,',\n ' ref,',\n ' width: size,',\n ' height: size,',\n ' stroke: color,',\n ' strokeWidth: resolvedStrokeWidth,',\n ' },',\n ' ...iconNode.map(([tagName, attrs]) => createElement(tagName, attrs)),',\n ' children,',\n ' )',\n ' },',\n ' )',\n '}',\n '',\n ...definitions,\n ]\n}\n\nconst getGeneratedGlobalContextSource = (data: DocsGlobalContextSerializableData) => {\n const iconEntries = data.sidebarSections.flatMap((section) => {\n const sectionIconEntries = section.icon\n ? [{ iconKey: getDocsIconMapKey('section', section.id), iconName: section.icon }]\n : []\n\n return [...sectionIconEntries, ...getSidebarIconEntries(section.items)]\n })\n const iconImports = [...new Set(iconEntries.map(({ iconName }) => iconName))].sort()\n\n return [\n \"import type { DocsGlobalContextData, DocsGlobalContextSerializableData, DocsIconMap } from '@unterberg/nivel'\",\n ...getGeneratedIconDefinitionsSource(iconImports),\n '',\n `const docsGlobalContextSerializableData: DocsGlobalContextSerializableData = ${serializeData(data)}`,\n '',\n `const docsIconMap: DocsIconMap = ${getGeneratedIconMapSource(iconEntries)}`,\n '',\n 'const docsGlobalContextData: DocsGlobalContextData = {',\n ' ...docsGlobalContextSerializableData,',\n ' docsIconMap,',\n '}',\n '',\n 'export { docsGlobalContextData }',\n '',\n ].join('\\n')\n}\n\nconst getRouteString = (href: string) => {\n if (href === '/') {\n return href\n }\n\n return href.replace(/\\/+$/g, '')\n}\n\nconst getGeneratedRouteSource = (href: string) => {\n return [`export default ${JSON.stringify(getRouteString(href))}`, ''].join('\\n')\n}\n\nconst getGeneratedTextExport = (value: string) => {\n return [`export default ${JSON.stringify(value)}`, ''].join('\\n')\n}\n\nconst toDocPageLinkData = (\n page:\n | {\n id: string\n title: string\n href: string\n documentTitle: string\n }\n | undefined,\n): DocPageLinkData | null => {\n if (!page) {\n return null\n }\n\n return {\n id: page.id,\n title: page.title,\n href: page.href,\n documentTitle: page.documentTitle,\n }\n}\n\nexport const getGeneratedPagesRoot = (rootDir: string) => path.join(rootDir, 'pages', GENERATED_DIRNAME)\n\nexport type DocsSourcePaths = {\n contentRootPath: string\n docsConfigPath: string\n docsGraphPath: string\n generatedRootPath: string\n}\n\nconst getDocsConfigPath = (rootDir: string) => path.join(rootDir, 'pages', '+docs.ts')\n\nconst getDocsGraphPath = (rootDir: string) => path.join(rootDir, 'docs', 'docs.graph.ts')\n\nexport const getDocsSourcePaths = (options: { rootDir: string; docsConfig: DocsConfig }): DocsSourcePaths => {\n const resolved = resolveDocsConfig(options.docsConfig)\n\n return {\n contentRootPath: path.join(options.rootDir, resolved.contentDir),\n docsConfigPath: getDocsConfigPath(options.rootDir),\n docsGraphPath: getDocsGraphPath(options.rootDir),\n generatedRootPath: getGeneratedPagesRoot(options.rootDir),\n }\n}\n\nexport const isDocsSourcePath = (filePath: string, docsSourcePaths: DocsSourcePaths) => {\n const normalized = toPosix(filePath)\n if (isGeneratedDocsPath(filePath, docsSourcePaths)) {\n return false\n }\n\n const docsConfigPath = toPosix(docsSourcePaths.docsConfigPath)\n const docsGraphPath = toPosix(docsSourcePaths.docsGraphPath)\n const contentRootPath = toPosix(docsSourcePaths.contentRootPath)\n\n return (\n normalized === docsConfigPath ||\n normalized === docsGraphPath ||\n normalized === contentRootPath ||\n normalized.startsWith(`${contentRootPath}/`)\n )\n}\n\nexport const isGeneratedDocsPath = (filePath: string, docsSourcePaths: DocsSourcePaths) => {\n const normalized = toPosix(filePath)\n const generatedRootPath = toPosix(docsSourcePaths.generatedRootPath)\n\n return normalized.startsWith(generatedRootPath)\n}\n\nexport const syncGeneratedDocsPages = (options: { rootDir: string; docsConfig: DocsConfig }) => {\n const { rootDir, docsConfig } = options\n const resolved = resolveDocsConfig(docsConfig)\n const generatedPagesRoot = getGeneratedPagesRoot(rootDir)\n const docsContentRoot = path.join(rootDir, resolved.contentDir)\n const expectedFiles = new Set<string>()\n const globalContextFilePath = path.join(generatedPagesRoot, '_docsGlobalContext.ts')\n const layoutFilePath = path.join(generatedPagesRoot, '+Layout.tsx')\n\n fs.mkdirSync(generatedPagesRoot, { recursive: true })\n\n const globalContextData: DocsGlobalContextSerializableData = {\n siteTitle: resolved.siteTitle,\n robots: resolved.robots,\n basePath: resolved.basePath,\n theme: resolved.theme,\n footer: resolved.footer,\n brand: resolved.brand,\n head: resolved.head,\n partners: resolved.partners,\n social: resolved.social,\n algolia: resolved.algolia,\n pages: resolved.pages,\n navbarItems: resolved.navbarItems,\n sidebarSections: resolved.sections,\n }\n\n writeFileIfChanged(globalContextFilePath, getGeneratedGlobalContextSource(globalContextData))\n writeFileIfChanged(layoutFilePath, getGeneratedLayoutSource())\n expectedFiles.add(globalContextFilePath)\n expectedFiles.add(layoutFilePath)\n\n for (const [pageIndex, page] of resolved.pages.entries()) {\n const contentFilePath = path.join(docsContentRoot, page.source)\n\n if (!fs.existsSync(contentFilePath)) {\n throw new Error(`Docs page \"${page.id}\" points to missing source file: ${contentFilePath}`)\n }\n\n const pageSource = fs.readFileSync(contentFilePath, 'utf8')\n const data: DocPageData = {\n page: getResolvedPageById(resolved, page.id),\n headings: extractDocHeadings(pageSource),\n previousPage: toDocPageLinkData(resolved.pages[pageIndex - 1]),\n nextPage: toDocPageLinkData(resolved.pages[pageIndex + 1]),\n }\n\n const routeTargets = [\n { routeHref: page.href, routePath: page.slug },\n ...page.aliases.map((routePath, index) => ({\n routeHref: page.aliasHrefs[index] as string,\n routePath,\n })),\n ]\n\n for (const { routeHref, routePath } of routeTargets) {\n const pageDir = path.join(generatedPagesRoot, ...routePath.split('/'))\n const contentImportPath = getRelativeImportPath(pageDir, contentFilePath)\n\n const pageFilePath = path.join(pageDir, '+Page.tsx')\n const dataFilePath = path.join(pageDir, '+data.ts')\n const routeFilePath = path.join(pageDir, '+route.ts')\n const titleFilePath = path.join(pageDir, '+title.ts')\n\n writeFileIfChanged(pageFilePath, getGeneratedPageSource(contentImportPath))\n writeFileIfChanged(dataFilePath, getGeneratedDataSource(data))\n writeFileIfChanged(routeFilePath, getGeneratedRouteSource(routeHref))\n writeFileIfChanged(titleFilePath, getGeneratedTextExport(page.documentTitle))\n\n expectedFiles.add(pageFilePath)\n expectedFiles.add(dataFilePath)\n expectedFiles.add(routeFilePath)\n expectedFiles.add(titleFilePath)\n\n if (page.description) {\n const descriptionFilePath = path.join(pageDir, '+description.ts')\n writeFileIfChanged(descriptionFilePath, getGeneratedTextExport(page.description))\n expectedFiles.add(descriptionFilePath)\n }\n }\n }\n\n for (const filePath of collectFiles(generatedPagesRoot)) {\n if (expectedFiles.has(filePath)) {\n continue\n }\n\n fs.rmSync(filePath, { force: true })\n }\n\n removeEmptyDirectories(generatedPagesRoot, generatedPagesRoot)\n}\n","import path from 'node:path'\nimport type { DocsConfig } from '../../docs/types.js'\n\nconst getDocsConfigModulePath = (rootDir: string) => {\n return path.join(rootDir, 'pages', '+docs.ts')\n}\n\nconst getDocsConfigFromLoadedModule = (loaded: unknown, modulePath: string) => {\n const docsConfig = (loaded as { default?: DocsConfig }).default\n\n if (!docsConfig) {\n throw new Error(`Expected default export from ${modulePath}`)\n }\n\n return docsConfig\n}\n\nexport const loadDocsConfig = async (options: {\n rootDir: string\n loadModule: (modulePath: string) => Promise<unknown>\n}) => {\n const modulePath = getDocsConfigModulePath(options.rootDir)\n const loaded = await options.loadModule(modulePath)\n return getDocsConfigFromLoadedModule(loaded, modulePath)\n}\n","import fs from 'node:fs'\nimport path from 'node:path'\n\nconst MANAGED_SCRIPT_NAMES = ['generate:docs', 'predev', 'prebuild', 'pretypecheck'] as const\n\nconst REQUIRED_DEPENDENCIES = ['@unterberg/nivel', 'react', 'react-dom', 'vike', 'vike-react'] as const\nconst REQUIRED_DEV_DEPENDENCIES = ['vite', 'typescript', '@types/react', '@types/react-dom'] as const\n\ntype InitConsumerOptions = { force: boolean; rootDir: string }\n\ntype InitConsumerResult = {\n allDependenciesPresent: boolean\n createdFiles: string[]\n missingDependencies: string[]\n overwrittenFiles: string[]\n skippedFiles: string[]\n updatedScripts: string[]\n}\n\ntype PackageJsonShape = {\n dependencies?: Record<string, string>\n devDependencies?: Record<string, string>\n packageManager?: string\n scripts?: Record<string, string>\n}\n\nconst getViteConfigTemplate = () => {\n return [\n \"import { nivelTailwindVite } from '@unterberg/nivel/tailwind'\",\n \"import vike from 'vike/plugin'\",\n '',\n 'process.env.VIKE_CRAWL ??= JSON.stringify({ git: false })',\n '',\n 'const base = (() => {',\n \" const normalized = process.env.PAGES_BASE_PATH?.trim().replace(/^\\\\/+|\\\\/+$/g, '') ?? ''\",\n \" return normalized ? `/${normalized}/` : '/'\",\n '})()',\n '',\n 'export default {',\n ' base,',\n ' plugins: [nivelTailwindVite(), vike()],',\n '}',\n '',\n ].join('\\n')\n}\n\nconst getDocsConfigTemplate = () => {\n return [\n \"import type { DocsConfig } from '@unterberg/nivel'\",\n \"import { docsGraph } from '../docs/docs.graph'\",\n '',\n 'const docsConfig = {',\n ' graph: docsGraph,',\n \" siteTitle: 'My Docs',\",\n \" siteDescription: 'Documentation site powered by @unterberg/nivel.',\",\n ' // Add siteUrl to enable automatic sitemap.xml and robots.txt generation.',\n \" // siteUrl: 'https://docs.example.com',\",\n ' // Set robots to false to emit noindex/nofollow and a disallow-all robots.txt.',\n ' // robots: false,',\n \" basePath: '/docs',\",\n '} satisfies DocsConfig',\n '',\n 'export default docsConfig',\n '',\n ].join('\\n')\n}\n\nconst getDocsGraphTemplate = () => {\n return [\n \"import type { DocsGraph } from '@unterberg/nivel'\",\n '',\n 'export const docsGraph = {',\n ' items: [',\n ' {',\n \" kind: 'section',\",\n \" id: 'docs',\",\n \" title: 'Docs',\",\n ' items: [',\n ' {',\n \" kind: 'page',\",\n \" id: 'gettingStarted',\",\n \" title: 'Getting Started',\",\n \" slug: 'getting-started',\",\n \" source: 'content/getting-started/content.mdx',\",\n \" description: 'Getting started with @unterberg/nivel.',\",\n ' },',\n ' ],',\n ' },',\n ' ],',\n '} satisfies DocsGraph',\n '',\n ].join('\\n')\n}\n\nconst getGettingStartedTemplate = () => {\n return [\n '# Getting Started',\n '',\n 'This page is scaffolded by `nivel init` and wired through `docs/docs.graph.ts`.',\n '',\n '## Next steps',\n '',\n '- Update `pages/+docs.ts` with your site metadata.',\n '- Expand `docs/docs.graph.ts` with your docs structure.',\n '- Replace this page with your real getting-started guide.',\n '',\n ].join('\\n')\n}\n\nconst getConfigTemplate = () => {\n return [\n \"import { createNivelVikeConfig } from '@unterberg/nivel/vike'\",\n \"import docsConfig from './+docs'\",\n '',\n 'const config = {',\n ' ...createNivelVikeConfig(docsConfig),',\n '',\n ' // User-facing Vike levers stay visible in +config.ts.',\n ' prerender: true,',\n ' // ssr: true,',\n \" // prefetchStaticAssets: 'viewport',\",\n '}',\n '',\n 'export default config',\n '',\n ].join('\\n')\n}\n\nconst getHeadTemplate = () => {\n return [\n \"import { MetaHead } from '@unterberg/nivel/client'\",\n '',\n 'export const Head = () => {',\n ' return <MetaHead />',\n '}',\n '',\n ].join('\\n')\n}\n\nconst getLayoutTemplate = () => {\n return [\n \"import { AppLayout } from '@unterberg/nivel/client'\",\n \"import type { ReactNode } from 'react'\",\n '',\n 'const Layout = ({ children }: { children: ReactNode }) => {',\n ' return <AppLayout>{children}</AppLayout>',\n '}',\n '',\n 'export default Layout',\n '',\n ].join('\\n')\n}\n\nconst getGlobalContextTemplate = () => {\n return [\n \"import { docsGlobalContextData } from './(nivel-generated)/_docsGlobalContext'\",\n '',\n 'export const onCreateGlobalContext = (globalContext: { docs?: typeof docsGlobalContextData }) => {',\n ' globalContext.docs = docsGlobalContextData',\n '}',\n '',\n ].join('\\n')\n}\n\nconst getWrapperTemplate = () => {\n return [\n \"import type { ReactNode } from 'react'\",\n \"import '../styles/global.css'\",\n '',\n 'const Wrapper = ({ children }: { children: ReactNode }) => {',\n ' return <>{children}</>',\n '}',\n '',\n 'export default Wrapper',\n '',\n ].join('\\n')\n}\n\nconst getGlobalStyleTemplate = () => {\n return [\n \"@import '@unterberg/nivel/tailwind.css';\",\n \"@import './theme.css';\",\n '',\n \"@source '../pages';\",\n \"@source '../docs';\",\n '',\n '@layer base {',\n ' html,',\n ' body {',\n ' @apply bg-base-100 text-base-content font-sans antialiased md:subpixel-antialiased;',\n ' }',\n '',\n ' .prose-container {',\n ' @apply prose prose-neutral max-w-none dark:prose-invert;',\n ' @apply prose-a:text-primary;',\n ' @apply prose-pre:bg-base-200!;',\n ' @apply prose-code:rounded!;',\n ' @apply prose-code:bg-primary/5!;',\n ' @apply prose-code:border-primary/15!;',\n ' @apply prose-code:dark:bg-primary/10!;',\n ' @apply prose-code:dark:border-primary/20!;',\n ' @apply prose-p:leading-[180%];',\n ' @apply prose-li:leading-[180%];',\n ' @apply prose-p:after:content-none;',\n ' @apply prose-p:before:content-none;',\n ' @apply prose-blockquote:not-italic;',\n ' @apply prose-blockquote:bg-base-200;',\n ' @apply prose-blockquote:py-2;',\n ' }',\n '',\n ' .prose-container :where(p, li, blockquote, td, th, a) {',\n ' overflow-wrap: anywhere;',\n ' word-break: break-word;',\n ' }',\n '}',\n '',\n ].join('\\n')\n}\n\nconst getThemeTemplate = () => {\n return [\n '@custom-variant dark (&:where(',\n \" [data-theme='consumer-dark'],\",\n \" [data-theme='consumer-dark'] *\",\n ' ));',\n '',\n \"@plugin '@unterberg/nivel/daisyui-theme' {\",\n \" name: 'consumer-light';\",\n ' default: true;',\n ' prefersdark: false;',\n \" color-scheme: 'light';\",\n ' --color-base-100: #f6f6f4;',\n ' --color-base-200: #ffffff;',\n ' --color-base-300: #ecebe7;',\n ' --color-base-content: #171717;',\n ' --color-primary: #0f766e;',\n ' --color-primary-content: #f8fafc;',\n ' --color-secondary: #d97706;',\n ' --color-secondary-content: #111827;',\n ' --color-accent: #1d4ed8;',\n ' --color-accent-content: #f8fafc;',\n ' --color-neutral: #171717;',\n ' --color-neutral-content: #f8fafc;',\n ' --color-info: #2563eb;',\n ' --color-info-content: #eff6ff;',\n ' --color-success: #15803d;',\n ' --color-success-content: #f0fdf4;',\n ' --color-warning: #d97706;',\n ' --color-warning-content: #fff7ed;',\n ' --color-error: #dc2626;',\n ' --color-error-content: #fef2f2;',\n ' --radius-selector: 0.25rem;',\n ' --radius-field: 0.5rem;',\n ' --radius-box: 1rem;',\n ' --size-selector: 0.25rem;',\n ' --size-field: 0.25rem;',\n ' --border: 1px;',\n ' --depth: 0;',\n ' --noise: 0;',\n '}',\n '',\n \"@plugin '@unterberg/nivel/daisyui-theme' {\",\n \" name: 'consumer-dark';\",\n ' default: false;',\n ' prefersdark: false;',\n \" color-scheme: 'dark';\",\n ' --color-base-100: #151515;',\n ' --color-base-200: #1e1e1e;',\n ' --color-base-300: #2a2a2a;',\n ' --color-base-content: #ededed;',\n ' --color-primary: #2dd4bf;',\n ' --color-primary-content: #042f2e;',\n ' --color-secondary: #f59e0b;',\n ' --color-secondary-content: #1c1917;',\n ' --color-accent: #60a5fa;',\n ' --color-accent-content: #172554;',\n ' --color-neutral: #ededed;',\n ' --color-neutral-content: #171717;',\n ' --color-info: #60a5fa;',\n ' --color-info-content: #172554;',\n ' --color-success: #4ade80;',\n ' --color-success-content: #052e16;',\n ' --color-warning: #fbbf24;',\n ' --color-warning-content: #451a03;',\n ' --color-error: #f87171;',\n ' --color-error-content: #450a0a;',\n ' --radius-selector: 0.25rem;',\n ' --radius-field: 0.5rem;',\n ' --radius-box: 1rem;',\n ' --size-selector: 0.25rem;',\n ' --size-field: 0.25rem;',\n ' --border: 1px;',\n ' --depth: 0;',\n ' --noise: 0;',\n '}',\n '',\n '@theme inline {',\n ' --color-base-muted: color-mix(',\n ' in oklab,',\n ' var(--color-base-content) 65%,',\n ' transparent',\n ' );',\n ' --color-base-muted-medium: color-mix(',\n ' in oklab,',\n ' var(--color-base-content) 40%,',\n ' transparent',\n ' );',\n ' --color-base-muted-light: color-mix(',\n ' in oklab,',\n ' var(--color-base-content) 12%,',\n ' transparent',\n ' );',\n ' --color-base-muted-superlight: color-mix(',\n ' in oklab,',\n ' var(--color-base-content) 5%,',\n ' transparent',\n ' );',\n ' --color-primary-muted: color-mix(',\n ' in oklab,',\n ' var(--color-primary) 80%,',\n ' transparent',\n ' );',\n ' --color-primary-muted-medium: color-mix(',\n ' in oklab,',\n ' var(--color-primary) 50%,',\n ' transparent',\n ' );',\n ' --color-primary-muted-light: color-mix(',\n ' in oklab,',\n ' var(--color-primary) 20%,',\n ' transparent',\n ' );',\n ' --color-primary-muted-superlight: color-mix(',\n ' in oklab,',\n ' var(--color-primary) 5%,',\n ' transparent',\n ' );',\n \" --font-sans: 'Inter', 'Helvetica Neue', sans-serif;\",\n ' --font-mono:',\n \" 'Monaco', 'SF Mono', SF Mono, SF Mono Regular, Consolas, 'Liberation Mono',\",\n ' Menlo, Courier, monospace;',\n '}',\n '',\n ].join('\\n')\n}\n\nconst getGlobalTypesTemplate = () => {\n return [\n \"declare module '*.mdx' {\",\n \" import type { ComponentType } from 'react'\",\n '',\n ' const MdxComponent: ComponentType',\n ' export default MdxComponent',\n '}',\n '',\n \"declare module '*.css'\",\n '',\n 'declare global {',\n ' namespace Vike {',\n ' interface GlobalContext {',\n \" docs: import('@unterberg/nivel').DocsGlobalContextData\",\n ' }',\n ' }',\n '}',\n '',\n ].join('\\n')\n}\n\nconst getManagedFileEntries = () => {\n return [\n ['vite.config.ts', getViteConfigTemplate()],\n ['pages/+docs.ts', getDocsConfigTemplate()],\n ['docs/docs.graph.ts', getDocsGraphTemplate()],\n ['docs/content/getting-started/content.mdx', getGettingStartedTemplate()],\n ['pages/+config.ts', getConfigTemplate()],\n ['pages/+Head.tsx', getHeadTemplate()],\n ['pages/+Layout.tsx', getLayoutTemplate()],\n ['pages/+onCreateGlobalContext.ts', getGlobalContextTemplate()],\n ['pages/+Wrapper.tsx', getWrapperTemplate()],\n ['styles/global.css', getGlobalStyleTemplate()],\n ['styles/theme.css', getThemeTemplate()],\n ['global.d.ts', getGlobalTypesTemplate()],\n ] as const\n}\n\nconst readFileIfExists = (filePath: string) => {\n if (!fs.existsSync(filePath)) {\n return null\n }\n\n return fs.readFileSync(filePath, 'utf8')\n}\n\nexport const getTailwindBootstrapWarnings = (rootDir: string) => {\n const warnings: string[] = []\n const viteConfigPath = path.join(rootDir, 'vite.config.ts')\n const wrapperPath = path.join(rootDir, 'pages', '+Wrapper.tsx')\n const globalCssPath = path.join(rootDir, 'styles', 'global.css')\n const themeCssPath = path.join(rootDir, 'styles', 'theme.css')\n\n const viteConfigSource = readFileIfExists(viteConfigPath)\n if (!viteConfigSource?.includes('@unterberg/nivel/tailwind') || !viteConfigSource.includes('nivelTailwindVite()')) {\n warnings.push(\n 'vite.config.ts should use @unterberg/nivel/tailwind and call nivelTailwindVite() for the engine-owned Tailwind integration.',\n )\n }\n\n const wrapperSource = readFileIfExists(wrapperPath)\n if (!wrapperSource?.includes('../styles/global.css')) {\n warnings.push('pages/+Wrapper.tsx should import ../styles/global.css.')\n }\n\n const globalCssSource = readFileIfExists(globalCssPath)\n if (\n !globalCssSource?.includes('@unterberg/nivel/tailwind.css') ||\n !globalCssSource.includes(\"@import './theme.css';\") ||\n !globalCssSource.includes(\"@source '../pages';\") ||\n !globalCssSource.includes(\"@source '../docs';\")\n ) {\n warnings.push(\n \"styles/global.css should import @unterberg/nivel/tailwind.css, import ./theme.css, and declare @source '../pages' plus @source '../docs'.\",\n )\n }\n\n if (!fs.existsSync(themeCssPath)) {\n warnings.push('styles/theme.css is missing; define local daisyUI themes there.')\n }\n\n return warnings\n}\n\nconst getGenerateDocsRunner = (packageJson: PackageJsonShape) => {\n const packageManager = packageJson.packageManager?.trim() ?? ''\n\n if (packageManager.startsWith('pnpm@')) {\n return 'pnpm generate:docs'\n }\n\n if (packageManager.startsWith('npm@')) {\n return 'npm run generate:docs'\n }\n\n return 'npm run generate:docs'\n}\n\nconst getManagedScripts = (packageJson: PackageJsonShape) => {\n const generateDocsRunner = getGenerateDocsRunner(packageJson)\n\n return {\n 'generate:docs': 'nivel prepare',\n predev: generateDocsRunner,\n prebuild: generateDocsRunner,\n pretypecheck: generateDocsRunner,\n } satisfies Record<(typeof MANAGED_SCRIPT_NAMES)[number], string>\n}\n\nconst writeFile = (filePath: string, source: string) => {\n fs.mkdirSync(path.dirname(filePath), { recursive: true })\n fs.writeFileSync(filePath, source)\n}\n\nconst writeManagedFile = (\n rootDir: string,\n relativeFilePath: string,\n source: string,\n force: boolean,\n result: InitConsumerResult,\n) => {\n const filePath = path.join(rootDir, relativeFilePath)\n const exists = fs.existsSync(filePath)\n\n if (exists && !force) {\n result.skippedFiles.push(relativeFilePath)\n return\n }\n\n writeFile(filePath, source)\n\n if (exists) {\n result.overwrittenFiles.push(relativeFilePath)\n return\n }\n\n result.createdFiles.push(relativeFilePath)\n}\n\nconst readPackageJson = (rootDir: string) => {\n const packageJsonPath = path.join(rootDir, 'package.json')\n\n if (!fs.existsSync(packageJsonPath)) {\n throw new Error(`Expected package.json in ${rootDir}`)\n }\n\n return {\n packageJson: JSON.parse(fs.readFileSync(packageJsonPath, 'utf8')) as PackageJsonShape,\n packageJsonPath,\n }\n}\n\nconst patchPackageScripts = (packageJson: PackageJsonShape, packageJsonPath: string, result: InitConsumerResult) => {\n const scripts = { ...(packageJson.scripts ?? {}) }\n const managedScripts = getManagedScripts(packageJson)\n\n for (const scriptName of MANAGED_SCRIPT_NAMES) {\n if (scripts[scriptName] === managedScripts[scriptName]) {\n continue\n }\n\n scripts[scriptName] = managedScripts[scriptName]\n result.updatedScripts.push(scriptName)\n }\n\n const nextPackageJson = {\n ...packageJson,\n scripts,\n }\n\n fs.writeFileSync(packageJsonPath, `${JSON.stringify(nextPackageJson, null, 2)}\\n`)\n}\n\nconst getMissingDependencies = (packageJson: PackageJsonShape) => {\n const installed = new Set<string>([\n ...Object.keys(packageJson.dependencies ?? {}),\n ...Object.keys(packageJson.devDependencies ?? {}),\n ])\n\n return [...REQUIRED_DEPENDENCIES, ...REQUIRED_DEV_DEPENDENCIES].filter((packageName) => !installed.has(packageName))\n}\n\nexport const getInitSummary = (result: InitConsumerResult) => {\n const lines = ['Initialized nivel consumer scaffolding.']\n\n if (result.createdFiles.length > 0) {\n lines.push(`Created files: ${result.createdFiles.join(', ')}`)\n }\n\n if (result.overwrittenFiles.length > 0) {\n lines.push(`Overwritten files: ${result.overwrittenFiles.join(', ')}`)\n }\n\n if (result.skippedFiles.length > 0) {\n lines.push(`Skipped existing files: ${result.skippedFiles.join(', ')}`)\n }\n\n if (result.updatedScripts.length > 0) {\n lines.push(`Updated package.json scripts: ${result.updatedScripts.join(', ')}`)\n }\n\n lines.push('Scaffolded vite.config.ts and local Tailwind starter files remain visible and editable in the consumer.')\n\n if (result.missingDependencies.length > 0) {\n lines.push(`Missing dependencies: ${result.missingDependencies.join(', ')}`)\n } else if (!result.allDependenciesPresent) {\n lines.push('Dependency validation completed with warnings.')\n } else {\n lines.push('All required dependencies are already present.')\n }\n\n return `${lines.join('\\n')}\\n`\n}\n\nexport const initConsumer = (options: InitConsumerOptions): InitConsumerResult => {\n const result: InitConsumerResult = {\n allDependenciesPresent: true,\n createdFiles: [],\n missingDependencies: [],\n overwrittenFiles: [],\n skippedFiles: [],\n updatedScripts: [],\n }\n\n const { packageJson, packageJsonPath } = readPackageJson(options.rootDir)\n\n for (const [relativeFilePath, source] of getManagedFileEntries()) {\n writeManagedFile(options.rootDir, relativeFilePath, source, options.force, result)\n }\n\n patchPackageScripts(packageJson, packageJsonPath, result)\n\n result.missingDependencies = getMissingDependencies(packageJson)\n result.allDependenciesPresent = result.missingDependencies.length === 0\n\n return result\n}\n"],"mappings":";;;;;;;;;;;AACA,YAAY,iBAAiB;AAQ7B,IAAM,wBAAwB,oBAAI,IAAI,CAAC,oBAAoB,QAAQ,SAAS,kBAAkB,kBAAkB,CAAC;AAEjH,IAAM,qBAAqB,CAAC,UAAmB;AAC7C,MAAI,OAAO,UAAU,YAAY,UAAU,MAAM;AAC/C,WAAO;AAAA,EACT;AAEA,SAAO,cAAc,SAAS,YAAY;AAC5C;AAEA,IAAM,gBAAgB,OAAO;AAAA,EAC3B,OAAO,QAAQ,WAAW,EACvB,OAAO,CAAC,CAAC,MAAM,KAAK,MAAM,CAAC,sBAAsB,IAAI,IAAI,KAAK,mBAAmB,KAAK,CAAC,EACvF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AA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,EAAE,KAAK,IAAI;AACb;AAEA,IAAM,mBAAmB,MAAM;AAC7B,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AA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,EAC7D;AAEA,SAAO,GAAG,MAAM,KAAK,IAAI,CAAC;AAAA;AAC5B;AAEO,IAAM,eAAe,CAAC,YAAqD;AAChF,QAAM,SAA6B;AAAA,IACjC,wBAAwB;AAAA,IACxB,cAAc,CAAC;AAAA,IACf,qBAAqB,CAAC;AAAA,IACtB,kBAAkB,CAAC;AAAA,IACnB,cAAc,CAAC;AAAA,IACf,gBAAgB,CAAC;AAAA,EACnB;AAEA,QAAM,EAAE,aAAa,gBAAgB,IAAI,gBAAgB,QAAQ,OAAO;AAExE,aAAW,CAAC,kBAAkB,MAAM,KAAK,sBAAsB,GAAG;AAChE,qBAAiB,QAAQ,SAAS,kBAAkB,QAAQ,QAAQ,OAAO,MAAM;AAAA,EACnF;AAEA,sBAAoB,aAAa,iBAAiB,MAAM;AAExD,SAAO,sBAAsB,uBAAuB,WAAW;AAC/D,SAAO,yBAAyB,OAAO,oBAAoB,WAAW;AAEtE,SAAO;AACT;","names":["require","path","fs","path"]}
|
|
@@ -356,7 +356,7 @@ import { useCallback as useCallback2 } from "react";
|
|
|
356
356
|
import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
357
357
|
var StyledNav2 = cm2.nav`
|
|
358
358
|
gap-4
|
|
359
|
-
flex-1
|
|
359
|
+
flex-1 items-center justify-center
|
|
360
360
|
`;
|
|
361
361
|
var StyledNavList2 = cm2.ul`
|
|
362
362
|
inline-flex items-center gap-2 font-semibold
|
|
@@ -516,8 +516,8 @@ var MegaMenu = ({
|
|
|
516
516
|
"div",
|
|
517
517
|
{
|
|
518
518
|
className: cmMerge4(
|
|
519
|
-
"relative z-4 overflow-hidden transition-[height] bg-base-100 duration-300 ease-out",
|
|
520
|
-
|
|
519
|
+
"relative z-4 overflow-hidden transition-[height] bg-base-100 duration-300 ease-out pointer-events-none",
|
|
520
|
+
isLandingPage && !isActive ? "" : "pointer-events-auto lg:border-b lg:border-base-muted-light"
|
|
521
521
|
),
|
|
522
522
|
style: { height: isActive ? contentHeight : 0 },
|
|
523
523
|
children: /* @__PURE__ */ jsx8(LayoutComponent, { $size: "sm", children: /* @__PURE__ */ jsx8(
|
|
@@ -873,10 +873,12 @@ var ThemeBootstrap = ({ theme }) => {
|
|
|
873
873
|
import { Fragment as Fragment3, jsx as jsx14, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
874
874
|
var MetaHead = () => {
|
|
875
875
|
const docs = useDocsFromPageGlobalContext();
|
|
876
|
+
const shouldBlockCrawlers = docs.robots === false;
|
|
876
877
|
return /* @__PURE__ */ jsxs11(Fragment3, { children: [
|
|
877
878
|
/* @__PURE__ */ jsx14(ThemeBootstrap, { theme: docs.theme }),
|
|
878
879
|
/* @__PURE__ */ jsx14(FaviconLinks, { head: docs.head }),
|
|
879
|
-
/* @__PURE__ */ jsx14(FontLinks, { head: docs.head })
|
|
880
|
+
/* @__PURE__ */ jsx14(FontLinks, { head: docs.head }),
|
|
881
|
+
shouldBlockCrawlers ? /* @__PURE__ */ jsx14("meta", { name: "robots", content: "noindex, nofollow" }) : null
|
|
880
882
|
] });
|
|
881
883
|
};
|
|
882
884
|
|
|
@@ -1074,7 +1076,7 @@ var SidebarPageLink = ({ title, href, currentHref, icon: Icon }) => {
|
|
|
1074
1076
|
{
|
|
1075
1077
|
href: withSiteBaseUrl(href),
|
|
1076
1078
|
className: cmMerge7(
|
|
1077
|
-
"text-base-muted hover:text-base-content justify-start hover:bg-base-200",
|
|
1079
|
+
"rounded-field py-2 text-base-muted hover:text-base-content justify-start hover:bg-base-200",
|
|
1078
1080
|
href === currentHref && "text-primary! font-semibold bg-base-200"
|
|
1079
1081
|
),
|
|
1080
1082
|
children: /* @__PURE__ */ jsxs14("span", { className: "flex items-center gap-2", children: [
|
|
@@ -1110,14 +1112,14 @@ var SidebarGroupTitle = ({ title, href, isActive, allowNavigation = false, icon:
|
|
|
1110
1112
|
{
|
|
1111
1113
|
href: withSiteBaseUrl(href),
|
|
1112
1114
|
className: cmMerge7(
|
|
1113
|
-
"flex items-center gap-2 text-base-muted hover:text-base-content no-underline",
|
|
1115
|
+
"flex items-center gap-2 rounded-field py-2 text-base-muted hover:text-base-content no-underline",
|
|
1114
1116
|
isActive && "text-primary! font-semibold"
|
|
1115
1117
|
),
|
|
1116
1118
|
children: content
|
|
1117
1119
|
}
|
|
1118
1120
|
);
|
|
1119
1121
|
}
|
|
1120
|
-
return /* @__PURE__ */ jsx17("span", { className: "flex
|
|
1122
|
+
return /* @__PURE__ */ jsx17("span", { className: "flex items-center gap-2 rounded-field py-2 text-base-content", children: content });
|
|
1121
1123
|
};
|
|
1122
1124
|
var renderSidebarItems = (items, currentHref, docsIconMap) => {
|
|
1123
1125
|
return items.map((item) => {
|
|
@@ -1165,7 +1167,7 @@ var SidebarNestedGroup = ({ group, currentHref, docsIconMap }) => {
|
|
|
1165
1167
|
setIsOpen(event.currentTarget.open);
|
|
1166
1168
|
},
|
|
1167
1169
|
children: [
|
|
1168
|
-
/* @__PURE__ */ jsx17("summary", { children: /* @__PURE__ */ jsx17(
|
|
1170
|
+
/* @__PURE__ */ jsx17("summary", { className: "rounded-field max-h-9 flex items-center", children: /* @__PURE__ */ jsx17(
|
|
1169
1171
|
SidebarGroupTitle,
|
|
1170
1172
|
{
|
|
1171
1173
|
title: group.title,
|
|
@@ -1189,7 +1191,7 @@ var SidebarSectionGroup = ({ section, currentHref, activeSectionId }) => {
|
|
|
1189
1191
|
section.id === activeSectionId,
|
|
1190
1192
|
sectionHasActiveItem
|
|
1191
1193
|
);
|
|
1192
|
-
return /* @__PURE__ */ jsx17("li", { className: "pb-
|
|
1194
|
+
return /* @__PURE__ */ jsx17("li", { className: "pb-1", children: /* @__PURE__ */ jsxs14(
|
|
1193
1195
|
"details",
|
|
1194
1196
|
{
|
|
1195
1197
|
open: isOpen,
|
|
@@ -1197,7 +1199,7 @@ var SidebarSectionGroup = ({ section, currentHref, activeSectionId }) => {
|
|
|
1197
1199
|
setIsOpen(event.currentTarget.open);
|
|
1198
1200
|
},
|
|
1199
1201
|
children: [
|
|
1200
|
-
/* @__PURE__ */ jsx17("summary", { children: /* @__PURE__ */ jsx17(SidebarGroupTitle, { title: section.title, isActive: sectionHasActiveItem, icon: SectionIcon }) }),
|
|
1202
|
+
/* @__PURE__ */ jsx17("summary", { className: "rounded-field max-h-9 flex items-center", children: /* @__PURE__ */ jsx17(SidebarGroupTitle, { title: section.title, isActive: sectionHasActiveItem, icon: SectionIcon }) }),
|
|
1201
1203
|
/* @__PURE__ */ jsx17(SidebarItemList, { items: section.items, currentHref, docsIconMap: docs.docsIconMap })
|
|
1202
1204
|
]
|
|
1203
1205
|
}
|
|
@@ -1302,7 +1304,8 @@ var PartnerLogo = ({
|
|
|
1302
1304
|
partner.logoDark ? /* @__PURE__ */ jsx18(Image, { src: partner.logoDark, width: 200, height: 200, alt: partner.logoAlt, className: "hidden dark:block" }) : null
|
|
1303
1305
|
] });
|
|
1304
1306
|
};
|
|
1305
|
-
var AdbarItem = cm5.
|
|
1307
|
+
var AdbarItem = cm5.li`
|
|
1308
|
+
list-none
|
|
1306
1309
|
px-5
|
|
1307
1310
|
py-5
|
|
1308
1311
|
bg-base-200
|
|
@@ -1481,7 +1484,7 @@ var syncHeadingsFromDom = (setDomHeadings) => {
|
|
|
1481
1484
|
return null;
|
|
1482
1485
|
}
|
|
1483
1486
|
element.classList.add("scroll-mt-32");
|
|
1484
|
-
element.classList.add("xl:scroll-mt-
|
|
1487
|
+
element.classList.add("xl:scroll-mt-22");
|
|
1485
1488
|
const id = element.id || slugify(title);
|
|
1486
1489
|
if (!element.id) {
|
|
1487
1490
|
element.id = id;
|
|
@@ -1632,6 +1635,50 @@ var DocsLayout = ({ children }) => {
|
|
|
1632
1635
|
import { useData as useData2 } from "vike-react/useData";
|
|
1633
1636
|
import { usePageContext as usePageContext5 } from "vike-react/usePageContext";
|
|
1634
1637
|
|
|
1638
|
+
// src/runtime/client/components/DocsBreadcrumbs.tsx
|
|
1639
|
+
import { ChevronsRight as ChevronsRight2 } from "lucide-react";
|
|
1640
|
+
import { jsx as jsx22, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
1641
|
+
var dedupeBreadcrumbs2 = (items) => {
|
|
1642
|
+
return items.filter((item, index) => index === 0 || items[index - 1]?.title !== item.title);
|
|
1643
|
+
};
|
|
1644
|
+
var getSidebarBreadcrumbs2 = (items, currentHref) => {
|
|
1645
|
+
for (const item of items) {
|
|
1646
|
+
if (item.kind === "page") {
|
|
1647
|
+
if (item.href === currentHref) {
|
|
1648
|
+
return [{ id: item.id, kind: item.kind, title: item.navTitle }];
|
|
1649
|
+
}
|
|
1650
|
+
continue;
|
|
1651
|
+
}
|
|
1652
|
+
if (item.href === currentHref) {
|
|
1653
|
+
return item.title ? [{ id: item.id, kind: item.kind, title: item.title }] : [];
|
|
1654
|
+
}
|
|
1655
|
+
const nestedBreadcrumbs = getSidebarBreadcrumbs2(item.items, currentHref);
|
|
1656
|
+
if (!nestedBreadcrumbs) {
|
|
1657
|
+
continue;
|
|
1658
|
+
}
|
|
1659
|
+
return dedupeBreadcrumbs2(item.title ? [{ id: item.id, kind: item.kind, title: item.title }] : nestedBreadcrumbs);
|
|
1660
|
+
}
|
|
1661
|
+
return null;
|
|
1662
|
+
};
|
|
1663
|
+
var DocsBreadcrumbs = ({ currentHref }) => {
|
|
1664
|
+
const docs = useDocsGlobalContext();
|
|
1665
|
+
const activeSection = getActiveSectionByPathname(docs, currentHref);
|
|
1666
|
+
const breadcrumbItems = dedupeBreadcrumbs2([
|
|
1667
|
+
...activeSection ? getSidebarBreadcrumbs2(activeSection.items, currentHref) ?? [] : []
|
|
1668
|
+
]);
|
|
1669
|
+
return /* @__PURE__ */ jsx22("span", { className: "hidden lg:flex items-center text-sm gap-1 min-w-0 overflow-hidden mb-3 text-primary", children: breadcrumbItems.map((item, index) => {
|
|
1670
|
+
const Icon = docs.docsIconMap[getDocsIconMapKey(item.kind, item.id)];
|
|
1671
|
+
return /* @__PURE__ */ jsxs19("span", { className: "contents", children: [
|
|
1672
|
+
index > 0 ? /* @__PURE__ */ jsx22(ChevronsRight2, { className: "size-4 shrink-0 text-base-muted-medium" }) : null,
|
|
1673
|
+
/* @__PURE__ */ jsxs19("span", { className: "flex min-w-0 items-center gap-1.5", children: [
|
|
1674
|
+
Icon ? /* @__PURE__ */ jsx22(Icon, { className: "size-3 shrink-0", "aria-hidden": "true" }) : null,
|
|
1675
|
+
/* @__PURE__ */ jsx22("span", { className: "truncate", children: renderInlineMarkdown(item.title, { codeClassName: "text-sm!" }) })
|
|
1676
|
+
] })
|
|
1677
|
+
] }, item.id);
|
|
1678
|
+
}) });
|
|
1679
|
+
};
|
|
1680
|
+
var DocsBreadcrumbs_default = DocsBreadcrumbs;
|
|
1681
|
+
|
|
1635
1682
|
// src/runtime/client/getMdxRuntimeValue.tsx
|
|
1636
1683
|
var isExternalHref = (href) => {
|
|
1637
1684
|
return /^(?:[a-z]+:)?\/\//i.test(href) || href.startsWith("mailto:") || href.startsWith("tel:");
|
|
@@ -1726,21 +1773,22 @@ var getMdxRuntimeValue = (options) => {
|
|
|
1726
1773
|
};
|
|
1727
1774
|
|
|
1728
1775
|
// src/runtime/client/DocsPage.tsx
|
|
1729
|
-
import { jsx as
|
|
1776
|
+
import { jsx as jsx23, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
1730
1777
|
var DocsPage = ({ Content }) => {
|
|
1731
1778
|
const pageContext = usePageContext5();
|
|
1732
1779
|
const docs = useDocsGlobalContext();
|
|
1733
1780
|
const { page } = useData2();
|
|
1734
|
-
return /* @__PURE__ */
|
|
1781
|
+
return /* @__PURE__ */ jsx23(
|
|
1735
1782
|
UniversalMdxProvider,
|
|
1736
1783
|
{
|
|
1737
1784
|
value: getMdxRuntimeValue({
|
|
1738
1785
|
docs,
|
|
1739
1786
|
currentPathname: pageContext.urlPathname
|
|
1740
1787
|
}),
|
|
1741
|
-
children: /* @__PURE__ */
|
|
1742
|
-
/* @__PURE__ */
|
|
1743
|
-
/* @__PURE__ */
|
|
1788
|
+
children: /* @__PURE__ */ jsxs20(ProseContainer, { "data-doc-content": "", children: [
|
|
1789
|
+
/* @__PURE__ */ jsx23(DocsBreadcrumbs_default, { currentHref: page.href }),
|
|
1790
|
+
/* @__PURE__ */ jsx23("h1", { className: "scroll-mt-32 xl:scroll-mt-22", children: renderInlineMarkdown(page.title) }),
|
|
1791
|
+
/* @__PURE__ */ jsx23(Content, {})
|
|
1744
1792
|
] })
|
|
1745
1793
|
}
|
|
1746
1794
|
);
|
|
@@ -1757,4 +1805,4 @@ export {
|
|
|
1757
1805
|
DocsLayout,
|
|
1758
1806
|
DocsPage
|
|
1759
1807
|
};
|
|
1760
|
-
//# sourceMappingURL=chunk-
|
|
1808
|
+
//# sourceMappingURL=chunk-PBYVWITH.js.map
|