@unterberg/nivel 0.0.1

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.
Files changed (49) hide show
  1. package/assets/nivel/brands/bluesky.svg +4 -0
  2. package/assets/nivel/brands/discord.svg +3 -0
  3. package/assets/nivel/brands/github.svg +2 -0
  4. package/assets/nivel/brands/linkedin.svg +3 -0
  5. package/assets/nivel/brands/typescript.svg +26 -0
  6. package/assets/nivel/brands/x.svg +4 -0
  7. package/assets/nivel/decorators/pattern-light.png +0 -0
  8. package/assets/nivel/decorators/pattern.png +0 -0
  9. package/assets/nivel/fonts/fonts-inter.css +26 -0
  10. package/assets/nivel/fonts/inter-v20-latin-600.woff2 +0 -0
  11. package/assets/nivel/fonts/inter-v20-latin-800.woff2 +0 -0
  12. package/assets/nivel/fonts/inter-v20-latin-regular.woff2 +0 -0
  13. package/dist/chunk-3JJ6TYWL.js +614 -0
  14. package/dist/chunk-3JJ6TYWL.js.map +1 -0
  15. package/dist/chunk-45CLUNJW.js +657 -0
  16. package/dist/chunk-45CLUNJW.js.map +1 -0
  17. package/dist/chunk-4WTEOEV2.js +36 -0
  18. package/dist/chunk-4WTEOEV2.js.map +1 -0
  19. package/dist/chunk-62MBEYU7.js +1091 -0
  20. package/dist/chunk-62MBEYU7.js.map +1 -0
  21. package/dist/chunk-73NPVCDQ.js +353 -0
  22. package/dist/chunk-73NPVCDQ.js.map +1 -0
  23. package/dist/chunk-FLO5CJZH.js +42 -0
  24. package/dist/chunk-FLO5CJZH.js.map +1 -0
  25. package/dist/chunk-PHHK2BAF.js +350 -0
  26. package/dist/chunk-PHHK2BAF.js.map +1 -0
  27. package/dist/client.d.ts +70 -0
  28. package/dist/client.js +26 -0
  29. package/dist/client.js.map +1 -0
  30. package/dist/code-blocks.d.ts +35 -0
  31. package/dist/code-blocks.js +21 -0
  32. package/dist/code-blocks.js.map +1 -0
  33. package/dist/config.d.ts +16 -0
  34. package/dist/config.js +101 -0
  35. package/dist/config.js.map +1 -0
  36. package/dist/index.d.ts +143 -0
  37. package/dist/index.js +45 -0
  38. package/dist/index.js.map +1 -0
  39. package/dist/mdx.d.ts +6 -0
  40. package/dist/mdx.js +35 -0
  41. package/dist/mdx.js.map +1 -0
  42. package/dist/runtime/client.d.ts +7 -0
  43. package/dist/runtime/client.js +26 -0
  44. package/dist/runtime/client.js.map +1 -0
  45. package/dist/runtime/index.d.ts +15 -0
  46. package/dist/runtime/index.js +18 -0
  47. package/dist/runtime/index.js.map +1 -0
  48. package/dist/types-mvLNHHrf.d.ts +177 -0
  49. package/package.json +90 -0
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/config.ts","../src/runtime/rehypeDocsHeadings.ts"],"sourcesContent":["export { nivelConfig as default }\n\nimport mdx from '@mdx-js/rollup'\nimport remarkGfm from 'remark-gfm'\nimport type { Config } from 'vike/types'\nimport type { PluginOption, UserConfig } from 'vite'\nimport { getCodeBlockMdxPlugins } from './components/code-blocks/index.js'\nimport { nivelPagesPlugin } from './runtime/node.js'\nimport { rehypeDocsHeadings } from './runtime/rehypeDocsHeadings.js'\n\nprocess.env.VIKE_CRAWL ??= JSON.stringify({ git: false })\n\nconst codeBlockMdxPlugins = getCodeBlockMdxPlugins()\n\nconst viteConfig: UserConfig = {\n plugins: [\n {\n ...mdx({\n providerImportSource: '@unterberg/nivel/mdx',\n ...codeBlockMdxPlugins,\n rehypePlugins: [...codeBlockMdxPlugins.rehypePlugins, rehypeDocsHeadings],\n remarkPlugins: [remarkGfm, ...codeBlockMdxPlugins.remarkPlugins],\n }),\n enforce: 'pre',\n } as PluginOption,\n nivelPagesPlugin(),\n ],\n ssr: {\n noExternal: ['@unterberg/nivel'],\n },\n}\n\nconst nivelConfig = {\n meta: {\n docs: {\n env: {\n server: true,\n client: true,\n },\n global: true,\n },\n },\n prerender: true,\n trailingSlash: true,\n vite: viteConfig as Record<string, unknown>,\n} satisfies Config\n","import { visit } from 'unist-util-visit'\nimport { createHeadingSlugger, normalizeHeadingTitle } from './docHeadings.js'\n\nconst headingTags = new Set(['h1', 'h2', 'h3', 'h4', 'h5', 'h6'])\n\nconst getNodeText = (node: any): string => {\n if (!node || typeof node !== 'object') {\n return ''\n }\n\n if (node.type === 'text') {\n return typeof node.value === 'string' ? node.value : ''\n }\n\n if (Array.isArray(node.children)) {\n return node.children.map((child: any) => getNodeText(child)).join('')\n }\n\n return ''\n}\n\nconst getClassNames = (value: unknown): string[] => {\n if (Array.isArray(value)) {\n return value.flatMap((entry) => getClassNames(entry))\n }\n\n if (typeof value === 'string') {\n return value.split(/\\s+/).filter(Boolean)\n }\n\n return []\n}\n\nexport const rehypeDocsHeadings = () => {\n return (tree: any) => {\n const slugify = createHeadingSlugger()\n\n visit(tree as any, 'element', (node: any) => {\n if (!headingTags.has(node?.tagName)) {\n return\n }\n\n const title = normalizeHeadingTitle(getNodeText(node))\n if (!title) {\n return\n }\n\n node.properties ??= {}\n\n if (typeof node.properties.id !== 'string' || node.properties.id === '') {\n node.properties.id = slugify(title)\n }\n\n const classNames = getClassNames(node.properties.className)\n if (!classNames.includes('scroll-mt-24')) {\n node.properties.className = [...classNames, 'scroll-mt-24']\n }\n })\n }\n}\n"],"mappings":";;;;;;;;;;;;;AAEA,OAAO,SAAS;AAChB,OAAO,eAAe;;;ACHtB,SAAS,aAAa;AAGtB,IAAM,cAAc,oBAAI,IAAI,CAAC,MAAM,MAAM,MAAM,MAAM,MAAM,IAAI,CAAC;AAEhE,IAAM,cAAc,CAAC,SAAsB;AACzC,MAAI,CAAC,QAAQ,OAAO,SAAS,UAAU;AACrC,WAAO;AAAA,EACT;AAEA,MAAI,KAAK,SAAS,QAAQ;AACxB,WAAO,OAAO,KAAK,UAAU,WAAW,KAAK,QAAQ;AAAA,EACvD;AAEA,MAAI,MAAM,QAAQ,KAAK,QAAQ,GAAG;AAChC,WAAO,KAAK,SAAS,IAAI,CAAC,UAAe,YAAY,KAAK,CAAC,EAAE,KAAK,EAAE;AAAA,EACtE;AAEA,SAAO;AACT;AAEA,IAAM,gBAAgB,CAAC,UAA6B;AAClD,MAAI,MAAM,QAAQ,KAAK,GAAG;AACxB,WAAO,MAAM,QAAQ,CAAC,UAAU,cAAc,KAAK,CAAC;AAAA,EACtD;AAEA,MAAI,OAAO,UAAU,UAAU;AAC7B,WAAO,MAAM,MAAM,KAAK,EAAE,OAAO,OAAO;AAAA,EAC1C;AAEA,SAAO,CAAC;AACV;AAEO,IAAM,qBAAqB,MAAM;AACtC,SAAO,CAAC,SAAc;AACpB,UAAM,UAAU,qBAAqB;AAErC,UAAM,MAAa,WAAW,CAAC,SAAc;AAC3C,UAAI,CAAC,YAAY,IAAI,MAAM,OAAO,GAAG;AACnC;AAAA,MACF;AAEA,YAAM,QAAQ,sBAAsB,YAAY,IAAI,CAAC;AACrD,UAAI,CAAC,OAAO;AACV;AAAA,MACF;AAEA,WAAK,eAAe,CAAC;AAErB,UAAI,OAAO,KAAK,WAAW,OAAO,YAAY,KAAK,WAAW,OAAO,IAAI;AACvE,aAAK,WAAW,KAAK,QAAQ,KAAK;AAAA,MACpC;AAEA,YAAM,aAAa,cAAc,KAAK,WAAW,SAAS;AAC1D,UAAI,CAAC,WAAW,SAAS,cAAc,GAAG;AACxC,aAAK,WAAW,YAAY,CAAC,GAAG,YAAY,cAAc;AAAA,MAC5D;AAAA,IACF,CAAC;AAAA,EACH;AACF;;;ADjDA,QAAQ,IAAI,eAAe,KAAK,UAAU,EAAE,KAAK,MAAM,CAAC;AAExD,IAAM,sBAAsB,uBAAuB;AAEnD,IAAM,aAAyB;AAAA,EAC7B,SAAS;AAAA,IACP;AAAA,MACE,GAAG,IAAI;AAAA,QACL,sBAAsB;AAAA,QACtB,GAAG;AAAA,QACH,eAAe,CAAC,GAAG,oBAAoB,eAAe,kBAAkB;AAAA,QACxE,eAAe,CAAC,WAAW,GAAG,oBAAoB,aAAa;AAAA,MACjE,CAAC;AAAA,MACD,SAAS;AAAA,IACX;AAAA,IACA,iBAAiB;AAAA,EACnB;AAAA,EACA,KAAK;AAAA,IACH,YAAY,CAAC,kBAAkB;AAAA,EACjC;AACF;AAEA,IAAM,cAAc;AAAA,EAClB,MAAM;AAAA,IACJ,MAAM;AAAA,MACJ,KAAK;AAAA,QACH,QAAQ;AAAA,QACR,QAAQ;AAAA,MACV;AAAA,MACA,QAAQ;AAAA,IACV;AAAA,EACF;AAAA,EACA,WAAW;AAAA,EACX,eAAe;AAAA,EACf,MAAM;AACR;","names":[]}
@@ -0,0 +1,143 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { ReactNode, ComponentPropsWithoutRef, PropsWithChildren } from 'react';
3
+ import { D as DocsConfig, a as DocsGraph } from './types-mvLNHHrf.js';
4
+ export { b as DocHeading, c as DocPageData, d as DocPageLinkData, e as DocsBrandConfig, f as DocsCollapsible, g as DocsDividerNode, h as DocsFooterConfig, i as DocsGroupNode, j as DocsHeadConfig, k as DocsPageNode, l as DocsPartnerConfig, m as DocsPartnersConfig, n as DocsSectionNode, o as DocsSidebarNode, p as DocsThemeConfig, R as ResolvedDocsBrandConfig, q as ResolvedDocsConfig, r as ResolvedDocsPartnerConfig, s as ResolvedDocsPartnersConfig, t as ResolvedDocsSection, T as ThemePreference } from './types-mvLNHHrf.js';
5
+
6
+ type AlertVariant = 'info' | 'warning' | 'error' | 'success';
7
+ declare const Alert: ({ type, heading, children, icon, }: {
8
+ type?: AlertVariant;
9
+ heading?: ReactNode;
10
+ children: ReactNode;
11
+ icon?: boolean | ReactNode;
12
+ }) => react_jsx_runtime.JSX.Element;
13
+
14
+ type ChoiceGroupDescriptor = {
15
+ default: string;
16
+ disabled: string[];
17
+ name: string;
18
+ choices: string[];
19
+ };
20
+ declare const ChoiceGroup: ({ children, choiceGroup, hide, }: {
21
+ children: ReactNode;
22
+ choiceGroup: ChoiceGroupDescriptor;
23
+ hide?: boolean;
24
+ lvl?: number;
25
+ }) => react_jsx_runtime.JSX.Element;
26
+
27
+ type LineBreak = 'white-space' | 'break-word';
28
+ declare const CodeBlockTransformer: ({ children, lineBreak }: {
29
+ children: ReactNode;
30
+ lineBreak: LineBreak;
31
+ }) => react_jsx_runtime.JSX.Element;
32
+
33
+ declare const FileAdded: ({ children }: {
34
+ children: ReactNode;
35
+ }) => react_jsx_runtime.JSX.Element;
36
+ declare const FileRemoved: ({ children }: {
37
+ children: ReactNode;
38
+ }) => react_jsx_runtime.JSX.Element;
39
+
40
+ type PreProps = ComponentPropsWithoutRef<'pre'> & {
41
+ 'data-code-title'?: string;
42
+ 'data-language'?: string;
43
+ 'data-language-label'?: string;
44
+ 'file-added'?: string;
45
+ 'file-removed'?: string;
46
+ 'hide-menu'?: string;
47
+ };
48
+ declare const Pre: ({ children, className, ...props }: PreProps) => react_jsx_runtime.JSX.Element;
49
+
50
+ type LinkProps = ComponentPropsWithoutRef<'a'> & {
51
+ href?: string;
52
+ text?: string | ReactNode;
53
+ noBreadcrumb?: boolean;
54
+ doNotInferSectionTitle?: boolean;
55
+ noWarning?: boolean;
56
+ };
57
+ declare const Link: ({ href, text, noBreadcrumb, doNotInferSectionTitle, noWarning, children, className, ...props }: LinkProps) => react_jsx_runtime.JSX.Element;
58
+
59
+ type OverviewLinkItem = {
60
+ title: ReactNode;
61
+ href: string;
62
+ excerpt?: ReactNode | null;
63
+ };
64
+ type OverviewDividerItem = {
65
+ dividerText: ReactNode;
66
+ };
67
+ type OverviewItem = OverviewLinkItem | OverviewDividerItem;
68
+ interface OverviewProps {
69
+ items: Array<string | OverviewItem>;
70
+ }
71
+ declare const Overview: ({ items }: OverviewProps) => react_jsx_runtime.JSX.Element | null;
72
+
73
+ type Repo = `${string}/${string}`;
74
+ type TimestampType = `${number}.${number}`;
75
+ declare const RepoLink: ({ repo, timestamp }: {
76
+ repo: Repo;
77
+ timestamp: TimestampType;
78
+ }) => react_jsx_runtime.JSX.Element;
79
+
80
+ type RenderInlineMarkdownOptions = {
81
+ codeClassName?: string;
82
+ };
83
+ declare const renderInlineMarkdown: (value: ReactNode, { codeClassName }?: RenderInlineMarkdownOptions) => ReactNode;
84
+
85
+ interface TableData {
86
+ headers: string[];
87
+ rows: string[][];
88
+ }
89
+ interface TableProps {
90
+ size?: 'sm' | 'md' | 'lg';
91
+ data: TableData;
92
+ }
93
+ declare const Table: ({ size, data }: TableProps) => react_jsx_runtime.JSX.Element;
94
+
95
+ type UniversalMdxTranslationFn = (group: string, key: string) => string;
96
+ type UniversalResolveDocLinkArgs = {
97
+ href: string;
98
+ doNotInferSectionTitle?: boolean;
99
+ noWarning?: boolean;
100
+ };
101
+ type UniversalResolvedDocLink = {
102
+ href: string;
103
+ title?: ReactNode;
104
+ breadcrumb?: ReactNode[];
105
+ sectionTitle?: ReactNode;
106
+ isCurrentPage?: boolean;
107
+ };
108
+ type UniversalResolveDocLinkFn = (args: UniversalResolveDocLinkArgs) => UniversalResolvedDocLink | null;
109
+ type UniversalResolvedOverviewItem = {
110
+ title: ReactNode;
111
+ href: string;
112
+ excerpt?: ReactNode | null;
113
+ };
114
+ type UniversalResolveOverviewItemFn = (key: string) => UniversalResolvedOverviewItem | null;
115
+ interface UniversalMdxCodeBlockChoiceStore {
116
+ subscribe: (listener: () => void) => () => void;
117
+ getChoice: (choiceGroupName: string) => string | null;
118
+ setChoice: (choiceGroupName: string, choice: string) => void;
119
+ getLegacyChoice?: (choiceGroupName: string) => string | null;
120
+ }
121
+ interface UniversalMdxRuntimeValue {
122
+ locale: string;
123
+ t?: UniversalMdxTranslationFn;
124
+ localizeHref?: (href: string) => string;
125
+ resolveDocLink?: UniversalResolveDocLinkFn;
126
+ resolveOverviewItem?: UniversalResolveOverviewItemFn;
127
+ codeBlockChoices?: UniversalMdxCodeBlockChoiceStore;
128
+ }
129
+
130
+ declare const UniversalMdxProvider: ({ children, value }: PropsWithChildren<{
131
+ value: UniversalMdxRuntimeValue;
132
+ }>) => react_jsx_runtime.JSX.Element;
133
+ declare const useUniversalMdxRuntime: () => UniversalMdxRuntimeValue | null;
134
+
135
+ declare const defineDocsConfig: (config: DocsConfig) => DocsConfig;
136
+
137
+ declare const defineDocsGraph: (graph: DocsGraph) => DocsGraph;
138
+
139
+ declare const nivelPublicRoute = "/nivel";
140
+ declare const baseAssets: string;
141
+ declare const nivelAssetUrl: (assetPath: string) => string;
142
+
143
+ export { Alert, type AlertVariant, ChoiceGroup, CodeBlockTransformer, DocsConfig, DocsGraph, FileAdded, FileRemoved, type LineBreak, Link, type LinkProps, Overview, type OverviewItem, Pre, RepoLink, Table, type TableData, type TableProps, type UniversalMdxCodeBlockChoiceStore, UniversalMdxProvider, type UniversalMdxRuntimeValue, type UniversalMdxTranslationFn, type UniversalResolveDocLinkArgs, type UniversalResolveDocLinkFn, type UniversalResolveOverviewItemFn, type UniversalResolvedDocLink, type UniversalResolvedOverviewItem, baseAssets, defineDocsConfig, defineDocsGraph, nivelAssetUrl, nivelPublicRoute, renderInlineMarkdown, useUniversalMdxRuntime };
package/dist/index.js ADDED
@@ -0,0 +1,45 @@
1
+ import {
2
+ Alert,
3
+ ChoiceGroup,
4
+ CodeBlockTransformer,
5
+ FileAdded,
6
+ FileRemoved,
7
+ Link,
8
+ Overview,
9
+ Pre,
10
+ RepoLink,
11
+ Table,
12
+ defineDocsConfig,
13
+ defineDocsGraph
14
+ } from "./chunk-3JJ6TYWL.js";
15
+ import {
16
+ UniversalMdxProvider,
17
+ renderInlineMarkdown,
18
+ useUniversalMdxRuntime
19
+ } from "./chunk-4WTEOEV2.js";
20
+ import {
21
+ baseAssets,
22
+ nivelAssetUrl,
23
+ nivelPublicRoute
24
+ } from "./chunk-FLO5CJZH.js";
25
+ export {
26
+ Alert,
27
+ ChoiceGroup,
28
+ CodeBlockTransformer,
29
+ FileAdded,
30
+ FileRemoved,
31
+ Link,
32
+ Overview,
33
+ Pre,
34
+ RepoLink,
35
+ Table,
36
+ UniversalMdxProvider,
37
+ baseAssets,
38
+ defineDocsConfig,
39
+ defineDocsGraph,
40
+ nivelAssetUrl,
41
+ nivelPublicRoute,
42
+ renderInlineMarkdown,
43
+ useUniversalMdxRuntime
44
+ };
45
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
package/dist/mdx.d.ts ADDED
@@ -0,0 +1,6 @@
1
+ import { ComponentType } from 'react';
2
+
3
+ type MdxComponents = Record<string, ComponentType<any> | string>;
4
+ declare const useMDXComponents: (components?: MdxComponents) => MdxComponents;
5
+
6
+ export { useMDXComponents };
package/dist/mdx.js ADDED
@@ -0,0 +1,35 @@
1
+ import {
2
+ Alert,
3
+ ChoiceGroup,
4
+ CodeBlockTransformer,
5
+ FileAdded,
6
+ FileRemoved,
7
+ Link,
8
+ Overview,
9
+ Pre,
10
+ RepoLink,
11
+ Table
12
+ } from "./chunk-3JJ6TYWL.js";
13
+ import "./chunk-4WTEOEV2.js";
14
+ import "./chunk-FLO5CJZH.js";
15
+
16
+ // src/mdx.ts
17
+ var useMDXComponents = (components) => {
18
+ return {
19
+ Alert,
20
+ Link,
21
+ RepoLink,
22
+ Table,
23
+ Overview,
24
+ ChoiceGroup,
25
+ CodeBlockTransformer,
26
+ FileAdded,
27
+ FileRemoved,
28
+ pre: Pre,
29
+ ...components
30
+ };
31
+ };
32
+ export {
33
+ useMDXComponents
34
+ };
35
+ //# sourceMappingURL=mdx.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/mdx.ts"],"sourcesContent":["import type { ComponentType } from 'react'\nimport {\n Alert,\n ChoiceGroup,\n CodeBlockTransformer,\n FileAdded,\n FileRemoved,\n Link,\n Overview,\n Pre,\n RepoLink,\n Table,\n} from './index.js'\n\ntype MdxComponents = Record<string, ComponentType<any> | string>\n\nexport const useMDXComponents = (components?: MdxComponents): MdxComponents => {\n return {\n Alert,\n Link,\n RepoLink,\n Table,\n Overview,\n ChoiceGroup,\n CodeBlockTransformer,\n FileAdded,\n FileRemoved,\n pre: Pre,\n ...components,\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAgBO,IAAM,mBAAmB,CAAC,eAA8C;AAC7E,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,KAAK;AAAA,IACL,GAAG;AAAA,EACL;AACF;","names":[]}
@@ -0,0 +1,7 @@
1
+ export { AppLayout, DEFAULT_THEME_PREFERENCE, DocsPage, LayoutComponent, MetaHead, ProseContainer, UserSettingsSync, applyThemePreference, useDocsUserSettingsStore } from '../client.js';
2
+ import 'react/jsx-runtime';
3
+ import 'react';
4
+ import '../types-mvLNHHrf.js';
5
+ import '@classmatejs/react';
6
+ import 'zustand/middleware';
7
+ import 'zustand';
@@ -0,0 +1,26 @@
1
+ import {
2
+ AppLayout,
3
+ DEFAULT_THEME_PREFERENCE,
4
+ DocsPage,
5
+ LayoutComponent,
6
+ MetaHead,
7
+ ProseContainer,
8
+ UserSettingsSync,
9
+ applyThemePreference,
10
+ useDocsUserSettingsStore
11
+ } from "../chunk-62MBEYU7.js";
12
+ import "../chunk-4WTEOEV2.js";
13
+ import "../chunk-73NPVCDQ.js";
14
+ import "../chunk-FLO5CJZH.js";
15
+ export {
16
+ AppLayout,
17
+ DEFAULT_THEME_PREFERENCE,
18
+ DocsPage,
19
+ LayoutComponent,
20
+ MetaHead,
21
+ ProseContainer,
22
+ UserSettingsSync,
23
+ applyThemePreference,
24
+ useDocsUserSettingsStore
25
+ };
26
+ //# sourceMappingURL=client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,15 @@
1
+ import { D as DocsConfig, q as ResolvedDocsConfig, u as ResolvedDocsPage } from '../types-mvLNHHrf.js';
2
+ import { Plugin } from 'vite';
3
+
4
+ declare const getGeneratedPagesRoot: (rootDir: string) => string;
5
+ declare const syncGeneratedDocsPages: (options: {
6
+ rootDir: string;
7
+ docsConfig: DocsConfig;
8
+ }) => void;
9
+
10
+ declare const nivelPagesPlugin: () => Plugin;
11
+
12
+ declare const resolveDocsConfig: (config: DocsConfig) => ResolvedDocsConfig;
13
+ declare const getResolvedPageById: (config: ResolvedDocsConfig, pageId: string) => ResolvedDocsPage;
14
+
15
+ export { getGeneratedPagesRoot, getResolvedPageById, nivelPagesPlugin, resolveDocsConfig, syncGeneratedDocsPages };
@@ -0,0 +1,18 @@
1
+ import {
2
+ getGeneratedPagesRoot,
3
+ nivelPagesPlugin,
4
+ syncGeneratedDocsPages
5
+ } from "../chunk-PHHK2BAF.js";
6
+ import {
7
+ getResolvedPageById,
8
+ resolveDocsConfig
9
+ } from "../chunk-73NPVCDQ.js";
10
+ import "../chunk-FLO5CJZH.js";
11
+ export {
12
+ getGeneratedPagesRoot,
13
+ getResolvedPageById,
14
+ nivelPagesPlugin,
15
+ resolveDocsConfig,
16
+ syncGeneratedDocsPages
17
+ };
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,177 @@
1
+ type DocsCollapsible = {
2
+ isDefaultOpen?: boolean;
3
+ };
4
+ type ThemePreference = 'light' | 'dark';
5
+ type DocsThemeConfig = {
6
+ light: string;
7
+ dark: string;
8
+ defaultPreference?: ThemePreference;
9
+ };
10
+ type DocsFooterConfig = {
11
+ pagination?: boolean;
12
+ };
13
+ type DocsBrandConfig = {
14
+ text?: string;
15
+ href?: string;
16
+ logoLight?: string;
17
+ logoDark?: string;
18
+ logoAlt?: string;
19
+ };
20
+ type DocsPartnerConfig = {
21
+ name: string;
22
+ href: string;
23
+ logoLight: string;
24
+ logoDark?: string;
25
+ logoAlt?: string;
26
+ };
27
+ type DocsPartnersConfig = {
28
+ primary?: DocsPartnerConfig[];
29
+ gold?: DocsPartnerConfig[];
30
+ };
31
+ type DocsHeadConfig = {
32
+ faviconSvg?: string;
33
+ faviconIco?: string;
34
+ appleTouchIcon?: string;
35
+ fontPreset?: 'inter' | 'none';
36
+ fontStylesheetHref?: string;
37
+ fontPreloadHrefs?: string[];
38
+ };
39
+ type DocsPageNode = {
40
+ kind: 'page';
41
+ id: string;
42
+ title: string;
43
+ slug: string;
44
+ source: string;
45
+ aliases?: string[];
46
+ tableOfContents?: boolean;
47
+ navTitle?: string;
48
+ description?: string;
49
+ };
50
+ type DocsGroupNode = {
51
+ kind: 'group';
52
+ id: string;
53
+ title: string;
54
+ items: DocsSidebarNode[];
55
+ collapsible?: DocsCollapsible;
56
+ };
57
+ type DocsDividerNode = {
58
+ kind: 'divider';
59
+ id: string;
60
+ title: string;
61
+ };
62
+ type DocsSectionNode = {
63
+ kind: 'section';
64
+ id: string;
65
+ title: string;
66
+ navTitle?: string;
67
+ items: DocsSidebarNode[];
68
+ };
69
+ type DocsSidebarNode = DocsGroupNode | DocsDividerNode | DocsPageNode;
70
+ type DocsGraph = {
71
+ items: DocsSectionNode[];
72
+ };
73
+ type DocsConfig = {
74
+ siteTitle: string;
75
+ siteDescription?: string;
76
+ basePath: '/docs';
77
+ graph: DocsGraph;
78
+ theme?: DocsThemeConfig;
79
+ footer?: DocsFooterConfig;
80
+ brand?: DocsBrandConfig;
81
+ head?: DocsHeadConfig;
82
+ partners?: DocsPartnersConfig;
83
+ };
84
+ type ResolvedDocsBrandConfig = {
85
+ text: string;
86
+ href: string;
87
+ logoLight?: string;
88
+ logoDark?: string;
89
+ logoAlt: string;
90
+ };
91
+ type ResolvedDocsPartnerConfig = {
92
+ name: string;
93
+ href: string;
94
+ logoLight: string;
95
+ logoDark?: string;
96
+ logoAlt: string;
97
+ };
98
+ type ResolvedDocsPartnersConfig = {
99
+ primary: ResolvedDocsPartnerConfig[];
100
+ gold: ResolvedDocsPartnerConfig[];
101
+ };
102
+ type ResolvedDocsHeadConfig = DocsHeadConfig;
103
+ type DocHeading = {
104
+ depth: number;
105
+ id: string;
106
+ title: string;
107
+ };
108
+ type ResolvedDocsPage = DocsPageNode & {
109
+ href: string;
110
+ aliasHrefs: string[];
111
+ tableOfContents: boolean;
112
+ documentTitle: string;
113
+ sectionId: string;
114
+ };
115
+ type ResolvedSidebarGroup = {
116
+ kind: 'group';
117
+ id: string;
118
+ title: string;
119
+ items: ResolvedSidebarNode[];
120
+ collapsible?: DocsCollapsible;
121
+ };
122
+ type ResolvedSidebarPage = {
123
+ kind: 'page';
124
+ id: string;
125
+ title: string;
126
+ navTitle: string;
127
+ href: string;
128
+ };
129
+ type ResolvedSidebarDivider = {
130
+ kind: 'divider';
131
+ id: string;
132
+ title: string;
133
+ };
134
+ type ResolvedSidebarNode = ResolvedSidebarGroup | ResolvedSidebarDivider | ResolvedSidebarPage;
135
+ type ResolvedDocsSection = {
136
+ id: string;
137
+ title: string;
138
+ navTitle: string;
139
+ href: string;
140
+ items: ResolvedSidebarNode[];
141
+ };
142
+ type ResolvedNavbarItem = {
143
+ id: string;
144
+ title: string;
145
+ href: string;
146
+ };
147
+ type ResolvedDocsConfig = {
148
+ siteTitle: string;
149
+ siteDescription: string | null;
150
+ basePath: '/docs';
151
+ theme: Required<DocsThemeConfig>;
152
+ footer: Required<DocsFooterConfig>;
153
+ brand: ResolvedDocsBrandConfig;
154
+ head: ResolvedDocsHeadConfig;
155
+ partners: ResolvedDocsPartnersConfig;
156
+ pages: ResolvedDocsPage[];
157
+ sections: ResolvedDocsSection[];
158
+ navbarItems: ResolvedNavbarItem[];
159
+ };
160
+ type DocPageLinkData = Pick<ResolvedDocsPage, 'id' | 'title' | 'href' | 'documentTitle'>;
161
+ type DocPageData = {
162
+ siteTitle: string;
163
+ basePath: '/docs';
164
+ theme: Required<DocsThemeConfig>;
165
+ footer: Required<DocsFooterConfig>;
166
+ page: ResolvedDocsPage;
167
+ activeSectionId: string;
168
+ activeSectionTitle: string;
169
+ headings: DocHeading[];
170
+ previousPage: DocPageLinkData | null;
171
+ nextPage: DocPageLinkData | null;
172
+ navbarItems: ResolvedNavbarItem[];
173
+ sidebarItems: ResolvedSidebarNode[];
174
+ sidebarSections: ResolvedDocsSection[];
175
+ };
176
+
177
+ export type { DocsConfig as D, ResolvedDocsBrandConfig as R, ThemePreference as T, DocsGraph as a, DocHeading as b, DocPageData as c, DocPageLinkData as d, DocsBrandConfig as e, DocsCollapsible as f, DocsDividerNode as g, DocsFooterConfig as h, DocsGroupNode as i, DocsHeadConfig as j, DocsPageNode as k, DocsPartnerConfig as l, DocsPartnersConfig as m, DocsSectionNode as n, DocsSidebarNode as o, DocsThemeConfig as p, ResolvedDocsConfig as q, ResolvedDocsPartnerConfig as r, ResolvedDocsPartnersConfig as s, ResolvedDocsSection as t, ResolvedDocsPage as u };
package/package.json ADDED
@@ -0,0 +1,90 @@
1
+ {
2
+ "name": "@unterberg/nivel",
3
+ "version": "0.0.1",
4
+ "type": "module",
5
+ "sideEffects": false,
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://github.com/richard-unterberg/nivel.git",
9
+ "directory": "packages/engine"
10
+ },
11
+ "homepage": "https://github.com/richard-unterberg/nivel",
12
+ "bugs": {
13
+ "url": "https://github.com/richard-unterberg/nivel/issues"
14
+ },
15
+ "publishConfig": {
16
+ "access": "public"
17
+ },
18
+ "files": [
19
+ "dist",
20
+ "assets"
21
+ ],
22
+ "main": "./dist/index.js",
23
+ "types": "./dist/index.d.ts",
24
+ "exports": {
25
+ ".": {
26
+ "types": "./dist/index.d.ts",
27
+ "import": "./dist/index.js"
28
+ },
29
+ "./config": {
30
+ "types": "./dist/config.d.ts",
31
+ "import": "./dist/config.js"
32
+ },
33
+ "./client": {
34
+ "types": "./dist/client.d.ts",
35
+ "import": "./dist/client.js"
36
+ },
37
+ "./mdx": {
38
+ "types": "./dist/mdx.d.ts",
39
+ "import": "./dist/mdx.js"
40
+ },
41
+ "./code-blocks": {
42
+ "types": "./dist/code-blocks.d.ts",
43
+ "import": "./dist/code-blocks.js"
44
+ },
45
+ "./runtime": {
46
+ "types": "./dist/runtime/index.d.ts",
47
+ "import": "./dist/runtime/index.js"
48
+ },
49
+ "./runtime/client": {
50
+ "types": "./dist/runtime/client.d.ts",
51
+ "import": "./dist/runtime/client.js"
52
+ }
53
+ },
54
+ "scripts": {
55
+ "build": "tsup",
56
+ "dev": "tsup --watch",
57
+ "typecheck": "tsc --noEmit -p tsconfig.json"
58
+ },
59
+ "dependencies": {
60
+ "@brillout/shiki-transformers": "^4.0.2",
61
+ "@classmatejs/react": "^0.2.1",
62
+ "@mdx-js/rollup": "^3.1.1",
63
+ "@shikijs/transformers": "^4.0.2",
64
+ "detype": "^2.0.6",
65
+ "estree-util-value-to-estree": "^3.5.0",
66
+ "lucide-react": "0.543.0",
67
+ "mdast-util-mdx-jsx": "^3.2.0",
68
+ "npm-to-yarn": "^3.0.1",
69
+ "rehype-pretty-code": "^0.14.3",
70
+ "react": "^19.1.1",
71
+ "react-dom": "^19.1.1",
72
+ "remark-directive": "^4.0.0",
73
+ "remark-gfm": "^4.0.1",
74
+ "shiki": "^4.0.2",
75
+ "unist-util-visit": "^5.1.0",
76
+ "vike-react": "^0.6.21",
77
+ "zustand": "^5.0.8"
78
+ },
79
+ "peerDependencies": {
80
+ "vike": "^0.4.255",
81
+ "vite": "^7.3.1"
82
+ },
83
+ "devDependencies": {
84
+ "@types/node": "^24.5.2",
85
+ "@types/react": "^19.1.12",
86
+ "@types/react-dom": "^19.1.9",
87
+ "tsup": "^8.5.0",
88
+ "typescript": "^5.9.3"
89
+ }
90
+ }