blodemd 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (289) hide show
  1. package/dist/cli.mjs +50 -174
  2. package/dist/cli.mjs.map +1 -1
  3. package/package.json +3 -36
  4. package/dev-server/app/[[...slug]]/page.tsx +0 -140
  5. package/dev-server/app/blodemd-dev/invalidate/route.ts +0 -12
  6. package/dev-server/app/blodemd-dev/static/[...path]/route.ts +0 -32
  7. package/dev-server/app/blodemd-dev/version/route.ts +0 -14
  8. package/dev-server/app/blodemd-internal/proxy/route.ts +0 -86
  9. package/dev-server/app/error.tsx +0 -24
  10. package/dev-server/app/favicon.ico +0 -0
  11. package/dev-server/app/globals.css +0 -4
  12. package/dev-server/app/layout.tsx +0 -38
  13. package/dev-server/app/not-found.tsx +0 -18
  14. package/dev-server/app/search/route.ts +0 -17
  15. package/dev-server/components/dev-reload-script.tsx +0 -86
  16. package/dev-server/components/providers.tsx +0 -15
  17. package/dev-server/lib/dev-state.ts +0 -8
  18. package/dev-server/lib/local-content-source.ts +0 -103
  19. package/dev-server/lib/local-runtime.tsx +0 -555
  20. package/dev-server/next-env.d.ts +0 -5
  21. package/dev-server/next.config.js +0 -54
  22. package/dev-server/package.json +0 -61
  23. package/dev-server/postcss.config.mjs +0 -7
  24. package/dev-server/public/glide-variable.woff2 +0 -0
  25. package/dev-server/tsconfig.json +0 -50
  26. package/docs/app/globals.css +0 -471
  27. package/docs/components/animate-ui/primitives/buttons/button.tsx +0 -14
  28. package/docs/components/api/api-playground.tsx +0 -467
  29. package/docs/components/api/api-reference.tsx +0 -157
  30. package/docs/components/content/collection-index.tsx +0 -114
  31. package/docs/components/docs/contextual-menu.tsx +0 -495
  32. package/docs/components/docs/copy-page-menu.tsx +0 -364
  33. package/docs/components/docs/doc-header.tsx +0 -223
  34. package/docs/components/docs/doc-shell.tsx +0 -355
  35. package/docs/components/docs/doc-sidebar.tsx +0 -256
  36. package/docs/components/docs/doc-toc.tsx +0 -46
  37. package/docs/components/docs/mobile-nav.tsx +0 -195
  38. package/docs/components/docs/sidebar-active-highlight.tsx +0 -34
  39. package/docs/components/docs/sidebar-scroll-area.tsx +0 -63
  40. package/docs/components/git/repo-picker.tsx +0 -529
  41. package/docs/components/icons/doc-icon.tsx +0 -96
  42. package/docs/components/mdx/accordion.tsx +0 -83
  43. package/docs/components/mdx/agent-instructions.tsx +0 -17
  44. package/docs/components/mdx/badge.tsx +0 -79
  45. package/docs/components/mdx/callout.tsx +0 -88
  46. package/docs/components/mdx/card.tsx +0 -110
  47. package/docs/components/mdx/code-block.tsx +0 -80
  48. package/docs/components/mdx/code-group.tsx +0 -203
  49. package/docs/components/mdx/color.tsx +0 -87
  50. package/docs/components/mdx/columns.tsx +0 -25
  51. package/docs/components/mdx/expandable.tsx +0 -45
  52. package/docs/components/mdx/field-layout.tsx +0 -77
  53. package/docs/components/mdx/frame.tsx +0 -23
  54. package/docs/components/mdx/get-text-content.ts +0 -18
  55. package/docs/components/mdx/icon.tsx +0 -12
  56. package/docs/components/mdx/iframe.tsx +0 -62
  57. package/docs/components/mdx/index.tsx +0 -121
  58. package/docs/components/mdx/installer.tsx +0 -20
  59. package/docs/components/mdx/panel.tsx +0 -11
  60. package/docs/components/mdx/param-field.tsx +0 -56
  61. package/docs/components/mdx/preview.tsx +0 -36
  62. package/docs/components/mdx/prompt.tsx +0 -63
  63. package/docs/components/mdx/request-example.tsx +0 -27
  64. package/docs/components/mdx/response-field.tsx +0 -42
  65. package/docs/components/mdx/steps.tsx +0 -92
  66. package/docs/components/mdx/tabs.tsx +0 -193
  67. package/docs/components/mdx/tile.tsx +0 -43
  68. package/docs/components/mdx/tooltip.tsx +0 -71
  69. package/docs/components/mdx/tree.tsx +0 -120
  70. package/docs/components/mdx/type-table.tsx +0 -71
  71. package/docs/components/mdx/update.tsx +0 -44
  72. package/docs/components/mdx/video.tsx +0 -45
  73. package/docs/components/mdx/view.tsx +0 -66
  74. package/docs/components/posthog-provider.tsx +0 -42
  75. package/docs/components/providers.tsx +0 -15
  76. package/docs/components/tenant-analytics.tsx +0 -49
  77. package/docs/components/third-parties.tsx +0 -32
  78. package/docs/components/ui/badge.tsx +0 -61
  79. package/docs/components/ui/breadcrumb.tsx +0 -112
  80. package/docs/components/ui/button-group.tsx +0 -83
  81. package/docs/components/ui/button.tsx +0 -65
  82. package/docs/components/ui/card.tsx +0 -92
  83. package/docs/components/ui/command.tsx +0 -167
  84. package/docs/components/ui/copy-button.tsx +0 -129
  85. package/docs/components/ui/dialog.tsx +0 -146
  86. package/docs/components/ui/field.tsx +0 -237
  87. package/docs/components/ui/input.tsx +0 -23
  88. package/docs/components/ui/kbd.tsx +0 -98
  89. package/docs/components/ui/label.tsx +0 -22
  90. package/docs/components/ui/morph-icon.tsx +0 -79
  91. package/docs/components/ui/popover.tsx +0 -267
  92. package/docs/components/ui/search-dialog.tsx +0 -431
  93. package/docs/components/ui/search.tsx +0 -101
  94. package/docs/components/ui/separator.tsx +0 -26
  95. package/docs/components/ui/sheet.tsx +0 -133
  96. package/docs/components/ui/sidebar.tsx +0 -758
  97. package/docs/components/ui/skeleton.tsx +0 -11
  98. package/docs/components/ui/switch.tsx +0 -32
  99. package/docs/components/ui/tabs.tsx +0 -138
  100. package/docs/components/ui/theme-toggle.tsx +0 -62
  101. package/docs/components/ui/tooltip.tsx +0 -53
  102. package/docs/components/web-mcp.tsx +0 -115
  103. package/docs/lib/agent-skills.ts +0 -48
  104. package/docs/lib/api-client.ts +0 -72
  105. package/docs/lib/config.ts +0 -6
  106. package/docs/lib/content-root.ts +0 -33
  107. package/docs/lib/content-source.ts +0 -70
  108. package/docs/lib/contextual-options.ts +0 -222
  109. package/docs/lib/dashboard-session.ts +0 -167
  110. package/docs/lib/db.ts +0 -13
  111. package/docs/lib/docs-collection.ts +0 -7
  112. package/docs/lib/docs-runtime.tsx +0 -745
  113. package/docs/lib/edge-config.ts +0 -95
  114. package/docs/lib/env.ts +0 -23
  115. package/docs/lib/etag.ts +0 -22
  116. package/docs/lib/github-install.ts +0 -33
  117. package/docs/lib/llms-full.ts +0 -82
  118. package/docs/lib/marketing-markdown.ts +0 -79
  119. package/docs/lib/marketing-site.ts +0 -31
  120. package/docs/lib/mdx.ts +0 -98
  121. package/docs/lib/navigation.ts +0 -288
  122. package/docs/lib/openapi-proxy.ts +0 -88
  123. package/docs/lib/openapi.ts +0 -158
  124. package/docs/lib/platform-config.ts +0 -6
  125. package/docs/lib/project-authz.ts +0 -46
  126. package/docs/lib/routes.ts +0 -103
  127. package/docs/lib/server-cache.ts +0 -83
  128. package/docs/lib/shiki.ts +0 -44
  129. package/docs/lib/supabase.ts +0 -37
  130. package/docs/lib/tenancy.ts +0 -364
  131. package/docs/lib/tenant-headers.ts +0 -43
  132. package/docs/lib/tenant-static.ts +0 -705
  133. package/docs/lib/tenant-utility-context.ts +0 -62
  134. package/docs/lib/tenants.ts +0 -72
  135. package/docs/lib/theme.ts +0 -29
  136. package/docs/lib/time-ago.ts +0 -24
  137. package/docs/lib/toc.ts +0 -2
  138. package/docs/lib/use-mobile.ts +0 -19
  139. package/docs/lib/use-tab-observer.ts +0 -71
  140. package/docs/lib/utils.ts +0 -5
  141. package/packages/@repo/common/dist/index.d.ts +0 -16
  142. package/packages/@repo/common/dist/index.d.ts.map +0 -1
  143. package/packages/@repo/common/dist/index.js +0 -84
  144. package/packages/@repo/common/package.json +0 -34
  145. package/packages/@repo/common/src/index.ts +0 -101
  146. package/packages/@repo/contracts/dist/analytics.d.ts +0 -21
  147. package/packages/@repo/contracts/dist/analytics.d.ts.map +0 -1
  148. package/packages/@repo/contracts/dist/analytics.js +0 -18
  149. package/packages/@repo/contracts/dist/api-key.d.ts +0 -27
  150. package/packages/@repo/contracts/dist/api-key.d.ts.map +0 -1
  151. package/packages/@repo/contracts/dist/api-key.js +0 -20
  152. package/packages/@repo/contracts/dist/dates.d.ts +0 -4
  153. package/packages/@repo/contracts/dist/dates.d.ts.map +0 -1
  154. package/packages/@repo/contracts/dist/dates.js +0 -2
  155. package/packages/@repo/contracts/dist/deployment.d.ts +0 -71
  156. package/packages/@repo/contracts/dist/deployment.d.ts.map +0 -1
  157. package/packages/@repo/contracts/dist/deployment.js +0 -46
  158. package/packages/@repo/contracts/dist/domain.d.ts +0 -94
  159. package/packages/@repo/contracts/dist/domain.d.ts.map +0 -1
  160. package/packages/@repo/contracts/dist/domain.js +0 -36
  161. package/packages/@repo/contracts/dist/git.d.ts +0 -28
  162. package/packages/@repo/contracts/dist/git.d.ts.map +0 -1
  163. package/packages/@repo/contracts/dist/git.js +0 -24
  164. package/packages/@repo/contracts/dist/ids.d.ts +0 -14
  165. package/packages/@repo/contracts/dist/ids.d.ts.map +0 -1
  166. package/packages/@repo/contracts/dist/ids.js +0 -11
  167. package/packages/@repo/contracts/dist/index.d.ts +0 -12
  168. package/packages/@repo/contracts/dist/index.d.ts.map +0 -1
  169. package/packages/@repo/contracts/dist/index.js +0 -13
  170. package/packages/@repo/contracts/dist/pagination.d.ts +0 -23
  171. package/packages/@repo/contracts/dist/pagination.d.ts.map +0 -1
  172. package/packages/@repo/contracts/dist/pagination.js +0 -15
  173. package/packages/@repo/contracts/dist/project.d.ts +0 -42
  174. package/packages/@repo/contracts/dist/project.d.ts.map +0 -1
  175. package/packages/@repo/contracts/dist/project.js +0 -25
  176. package/packages/@repo/contracts/dist/tenant.d.ts +0 -147
  177. package/packages/@repo/contracts/dist/tenant.d.ts.map +0 -1
  178. package/packages/@repo/contracts/dist/tenant.js +0 -58
  179. package/packages/@repo/contracts/dist/user.d.ts +0 -9
  180. package/packages/@repo/contracts/dist/user.d.ts.map +0 -1
  181. package/packages/@repo/contracts/dist/user.js +0 -9
  182. package/packages/@repo/contracts/package.json +0 -37
  183. package/packages/@repo/contracts/src/analytics.ts +0 -33
  184. package/packages/@repo/contracts/src/api-key.ts +0 -27
  185. package/packages/@repo/contracts/src/dates.ts +0 -4
  186. package/packages/@repo/contracts/src/deployment.ts +0 -73
  187. package/packages/@repo/contracts/src/domain.ts +0 -51
  188. package/packages/@repo/contracts/src/git.ts +0 -31
  189. package/packages/@repo/contracts/src/ids.ts +0 -23
  190. package/packages/@repo/contracts/src/index.ts +0 -13
  191. package/packages/@repo/contracts/src/pagination.ts +0 -21
  192. package/packages/@repo/contracts/src/project.ts +0 -32
  193. package/packages/@repo/contracts/src/tenant.ts +0 -94
  194. package/packages/@repo/contracts/src/user.ts +0 -12
  195. package/packages/@repo/models/dist/docs-config.d.ts +0 -961
  196. package/packages/@repo/models/dist/docs-config.d.ts.map +0 -1
  197. package/packages/@repo/models/dist/docs-config.js +0 -531
  198. package/packages/@repo/models/dist/index.d.ts +0 -3
  199. package/packages/@repo/models/dist/index.d.ts.map +0 -1
  200. package/packages/@repo/models/dist/index.js +0 -3
  201. package/packages/@repo/models/dist/tenant.d.ts +0 -37
  202. package/packages/@repo/models/dist/tenant.d.ts.map +0 -1
  203. package/packages/@repo/models/dist/tenant.js +0 -1
  204. package/packages/@repo/models/package.json +0 -37
  205. package/packages/@repo/models/src/docs-config.ts +0 -629
  206. package/packages/@repo/models/src/index.ts +0 -3
  207. package/packages/@repo/models/src/tenant.ts +0 -44
  208. package/packages/@repo/prebuild/dist/index.d.ts +0 -2
  209. package/packages/@repo/prebuild/dist/index.d.ts.map +0 -1
  210. package/packages/@repo/prebuild/dist/index.js +0 -2
  211. package/packages/@repo/prebuild/dist/openapi.d.ts +0 -43
  212. package/packages/@repo/prebuild/dist/openapi.d.ts.map +0 -1
  213. package/packages/@repo/prebuild/dist/openapi.js +0 -86
  214. package/packages/@repo/prebuild/package.json +0 -39
  215. package/packages/@repo/prebuild/src/index.ts +0 -2
  216. package/packages/@repo/prebuild/src/openapi.ts +0 -154
  217. package/packages/@repo/previewing/dist/blob-source.d.ts +0 -16
  218. package/packages/@repo/previewing/dist/blob-source.d.ts.map +0 -1
  219. package/packages/@repo/previewing/dist/blob-source.js +0 -128
  220. package/packages/@repo/previewing/dist/config-loader.d.ts +0 -134
  221. package/packages/@repo/previewing/dist/config-loader.d.ts.map +0 -1
  222. package/packages/@repo/previewing/dist/config-loader.js +0 -231
  223. package/packages/@repo/previewing/dist/constants.d.ts +0 -15
  224. package/packages/@repo/previewing/dist/constants.d.ts.map +0 -1
  225. package/packages/@repo/previewing/dist/constants.js +0 -14
  226. package/packages/@repo/previewing/dist/content-index.d.ts +0 -7
  227. package/packages/@repo/previewing/dist/content-index.d.ts.map +0 -1
  228. package/packages/@repo/previewing/dist/content-index.js +0 -291
  229. package/packages/@repo/previewing/dist/content-source.d.ts +0 -12
  230. package/packages/@repo/previewing/dist/content-source.d.ts.map +0 -1
  231. package/packages/@repo/previewing/dist/content-source.js +0 -1
  232. package/packages/@repo/previewing/dist/fs-source.d.ts +0 -11
  233. package/packages/@repo/previewing/dist/fs-source.d.ts.map +0 -1
  234. package/packages/@repo/previewing/dist/fs-source.js +0 -71
  235. package/packages/@repo/previewing/dist/index.d.ts +0 -16
  236. package/packages/@repo/previewing/dist/index.d.ts.map +0 -1
  237. package/packages/@repo/previewing/dist/index.js +0 -13
  238. package/packages/@repo/previewing/dist/markdown/agent-markdown.d.ts +0 -3
  239. package/packages/@repo/previewing/dist/markdown/agent-markdown.d.ts.map +0 -1
  240. package/packages/@repo/previewing/dist/markdown/agent-markdown.js +0 -176
  241. package/packages/@repo/previewing/dist/markdown/format.d.ts +0 -8
  242. package/packages/@repo/previewing/dist/markdown/format.d.ts.map +0 -1
  243. package/packages/@repo/previewing/dist/markdown/format.js +0 -43
  244. package/packages/@repo/previewing/dist/markdown/links.d.ts +0 -3
  245. package/packages/@repo/previewing/dist/markdown/links.d.ts.map +0 -1
  246. package/packages/@repo/previewing/dist/markdown/links.js +0 -31
  247. package/packages/@repo/previewing/dist/openapi-pages.d.ts +0 -7
  248. package/packages/@repo/previewing/dist/openapi-pages.d.ts.map +0 -1
  249. package/packages/@repo/previewing/dist/openapi-pages.js +0 -200
  250. package/packages/@repo/previewing/dist/search-index.d.ts +0 -4
  251. package/packages/@repo/previewing/dist/search-index.d.ts.map +0 -1
  252. package/packages/@repo/previewing/dist/search-index.js +0 -23
  253. package/packages/@repo/previewing/dist/serialization.d.ts +0 -13
  254. package/packages/@repo/previewing/dist/serialization.d.ts.map +0 -1
  255. package/packages/@repo/previewing/dist/serialization.js +0 -108
  256. package/packages/@repo/previewing/dist/toc-index.d.ts +0 -5
  257. package/packages/@repo/previewing/dist/toc-index.d.ts.map +0 -1
  258. package/packages/@repo/previewing/dist/toc-index.js +0 -53
  259. package/packages/@repo/previewing/dist/types.d.ts +0 -92
  260. package/packages/@repo/previewing/dist/types.d.ts.map +0 -1
  261. package/packages/@repo/previewing/dist/types.js +0 -1
  262. package/packages/@repo/previewing/dist/utility-index.d.ts +0 -7
  263. package/packages/@repo/previewing/dist/utility-index.d.ts.map +0 -1
  264. package/packages/@repo/previewing/dist/utility-index.js +0 -201
  265. package/packages/@repo/previewing/package.json +0 -41
  266. package/packages/@repo/previewing/src/blob-source.ts +0 -185
  267. package/packages/@repo/previewing/src/config-loader.ts +0 -316
  268. package/packages/@repo/previewing/src/constants.ts +0 -16
  269. package/packages/@repo/previewing/src/content-index.ts +0 -384
  270. package/packages/@repo/previewing/src/content-source.ts +0 -12
  271. package/packages/@repo/previewing/src/fs-source.ts +0 -103
  272. package/packages/@repo/previewing/src/index.ts +0 -71
  273. package/packages/@repo/previewing/src/markdown/agent-markdown.ts +0 -254
  274. package/packages/@repo/previewing/src/markdown/format.ts +0 -63
  275. package/packages/@repo/previewing/src/markdown/links.ts +0 -46
  276. package/packages/@repo/previewing/src/openapi-pages.ts +0 -319
  277. package/packages/@repo/previewing/src/search-index.ts +0 -38
  278. package/packages/@repo/previewing/src/serialization.ts +0 -191
  279. package/packages/@repo/previewing/src/toc-index.ts +0 -72
  280. package/packages/@repo/previewing/src/types.ts +0 -105
  281. package/packages/@repo/previewing/src/utility-index.ts +0 -304
  282. package/packages/@repo/validation/dist/index.d.ts +0 -12
  283. package/packages/@repo/validation/dist/index.d.ts.map +0 -1
  284. package/packages/@repo/validation/dist/index.js +0 -30
  285. package/packages/@repo/validation/package.json +0 -38
  286. package/packages/@repo/validation/src/blodemd-docs-schema.json +0 -3575
  287. package/packages/@repo/validation/src/index.ts +0 -59
  288. package/scripts/prepare-package.mjs +0 -53
  289. package/scripts/repo-packages.mjs +0 -8
@@ -1,355 +0,0 @@
1
- import type { PageMode, SiteConfig } from "@repo/models";
2
- import { ChevronLeftIcon, ChevronRightIcon } from "blode-icons-react";
3
- import Link from "next/link";
4
- import Script from "next/script";
5
- import { Fragment } from "react";
6
- import type { ReactNode } from "react";
7
-
8
- import {
9
- ContextualMenu,
10
- ContextualTocItems,
11
- } from "@/components/docs/contextual-menu";
12
- import { CopyPageMenu } from "@/components/docs/copy-page-menu";
13
- import { DocHeader } from "@/components/docs/doc-header";
14
- import { DocSidebar } from "@/components/docs/doc-sidebar";
15
- import { DocToc } from "@/components/docs/doc-toc";
16
- import {
17
- Breadcrumb,
18
- BreadcrumbItem,
19
- BreadcrumbLink,
20
- BreadcrumbList,
21
- BreadcrumbPage,
22
- BreadcrumbSeparator,
23
- } from "@/components/ui/breadcrumb";
24
- import type { NavEntry, NavTab } from "@/lib/navigation";
25
- import { toDocHref } from "@/lib/routes";
26
- import { themeStylesFromConfig } from "@/lib/theme";
27
- import type { TocItem } from "@/lib/toc";
28
- import { cn } from "@/lib/utils";
29
-
30
- const DocScripts = ({
31
- scripts,
32
- strategy = "afterInteractive",
33
- }: {
34
- scripts?: string[];
35
- strategy?: "afterInteractive" | "lazyOnload";
36
- }) => {
37
- if (!scripts?.length) {
38
- return null;
39
- }
40
-
41
- return scripts.map((script) => (
42
- <Script key={script} src={script} strategy={strategy} />
43
- ));
44
- };
45
-
46
- const Breadcrumbs = ({
47
- basePath,
48
- breadcrumbs,
49
- }: {
50
- basePath: string;
51
- breadcrumbs: { label: string; path: string }[];
52
- }) => {
53
- if (!breadcrumbs.length) {
54
- return null;
55
- }
56
-
57
- return (
58
- <Breadcrumb>
59
- <BreadcrumbList>
60
- {breadcrumbs.map((crumb, index) => {
61
- const key = `${crumb.path || "current"}-${crumb.label}`;
62
- const isLast = index === breadcrumbs.length - 1;
63
- return (
64
- <Fragment key={key}>
65
- <BreadcrumbItem>
66
- {isLast ? (
67
- <BreadcrumbPage>{crumb.label}</BreadcrumbPage>
68
- ) : (
69
- <BreadcrumbLink asChild>
70
- <Link href={toDocHref(crumb.path, basePath)}>
71
- {crumb.label}
72
- </Link>
73
- </BreadcrumbLink>
74
- )}
75
- </BreadcrumbItem>
76
- {!isLast && <BreadcrumbSeparator />}
77
- </Fragment>
78
- );
79
- })}
80
- </BreadcrumbList>
81
- </Breadcrumb>
82
- );
83
- };
84
-
85
- // oxlint-disable-next-line eslint/complexity
86
- export const DocShell = ({
87
- config,
88
- nav,
89
- prevPage,
90
- nextPage,
91
- toc,
92
- content,
93
- currentPath,
94
- breadcrumbs,
95
- pageTitle,
96
- pageDescription,
97
- anchors,
98
- activeTabIndex,
99
- basePath,
100
- markdownHref,
101
- rawContent,
102
- tabs,
103
- tenantSlug,
104
- mode,
105
- deprecated,
106
- hideFooterPagination,
107
- }: {
108
- config: SiteConfig;
109
- nav: NavEntry[];
110
- prevPage?: { title: string; path: string };
111
- nextPage?: { title: string; path: string; description?: string };
112
- toc: TocItem[];
113
- content: ReactNode;
114
- currentPath: string;
115
- breadcrumbs: { label: string; path: string }[];
116
- pageTitle: string;
117
- pageDescription?: string;
118
- anchors?: { label: string; href: string }[];
119
- activeTabIndex?: number;
120
- basePath: string;
121
- markdownHref?: string;
122
- rawContent?: string;
123
- tabs?: NavTab[] | null;
124
- tenantSlug?: string;
125
- mode?: PageMode;
126
- deprecated?: boolean;
127
- hideFooterPagination?: boolean;
128
- }) => {
129
- const pageMode = mode ?? "default";
130
- const isCustomMode = pageMode === "custom";
131
- const showSidebar =
132
- pageMode !== "custom" &&
133
- pageMode !== "center" &&
134
- Boolean((nav?.length ?? 0) || (anchors?.length ?? 0));
135
- const { contextual } = config;
136
- const contextualDisplay = contextual?.display ?? "header";
137
- const hasToc =
138
- pageMode !== "custom" &&
139
- pageMode !== "wide" &&
140
- pageMode !== "frame" &&
141
- pageMode !== "center" &&
142
- config.features?.rightToc !== false &&
143
- config.features?.toc !== false &&
144
- (toc.length > 0 || (contextual && contextualDisplay === "toc"));
145
-
146
- const contextualTocItems =
147
- contextual && contextualDisplay === "toc" ? (
148
- <ContextualTocItems
149
- content={rawContent}
150
- key={`toc-${currentPath}`}
151
- options={contextual.options}
152
- pagePath={currentPath}
153
- title={pageTitle}
154
- />
155
- ) : null;
156
-
157
- const headerContextualMenu =
158
- contextual && contextualDisplay === "header" ? (
159
- <ContextualMenu
160
- content={rawContent}
161
- key={`header-${currentPath}`}
162
- options={contextual.options}
163
- pagePath={currentPath}
164
- title={pageTitle}
165
- />
166
- ) : null;
167
-
168
- const innerContent = (
169
- <div className="flex min-w-0 flex-1 flex-col">
170
- <div className="h-(--top-spacing) shrink-0" />
171
- {isCustomMode ? (
172
- <main id="main-content">{content}</main>
173
- ) : (
174
- <main
175
- className="flex scroll-mt-24 items-stretch pb-8 text-[1.05rem] sm:text-[15px] xl:w-full"
176
- id="main-content"
177
- role="application"
178
- style={{ "--sidebar-width": "14rem" } as React.CSSProperties}
179
- >
180
- <div className="flex min-w-0 flex-1 flex-col">
181
- <div
182
- className={cn(
183
- "mx-auto flex w-full min-w-0 flex-1 flex-col gap-6 px-4 py-6 text-neutral-800 md:px-0 lg:py-8 dark:text-neutral-300",
184
- pageMode === "wide" ? "max-w-[60rem]" : "max-w-[40rem]"
185
- )}
186
- >
187
- <div className="flex flex-col gap-2">
188
- <p
189
- className="sr-only"
190
- data-agent-directive=""
191
- data-markdown-ignore=""
192
- >
193
- AI agents: fetch the documentation index at{" "}
194
- <Link href={toDocHref("llms.txt", basePath)}>llms.txt</Link>.
195
- Markdown versions are available by appending .md to any page
196
- URL
197
- {markdownHref ? (
198
- <>
199
- , including{" "}
200
- <Link href={markdownHref}>this page&apos;s markdown</Link>
201
- </>
202
- ) : null}
203
- .
204
- </p>
205
- <div data-markdown-ignore="">
206
- <Breadcrumbs basePath={basePath} breadcrumbs={breadcrumbs} />
207
- </div>
208
- <div className="flex flex-col gap-2">
209
- <div className="flex flex-col items-start gap-3 sm:flex-row sm:justify-between">
210
- <h1 className="min-w-0 scroll-m-24 text-3xl font-semibold tracking-tight sm:text-3xl">
211
- {pageTitle}
212
- {deprecated ? (
213
- <span className="ml-3 inline-flex translate-y-[-2px] items-center rounded-md bg-yellow-100 px-2 py-0.5 align-middle text-xs font-medium text-yellow-800 dark:bg-yellow-900/40 dark:text-yellow-300">
214
- Deprecated
215
- </span>
216
- ) : null}
217
- </h1>
218
- <div data-markdown-ignore="">
219
- {headerContextualMenu ??
220
- (rawContent === undefined &&
221
- markdownHref === undefined ? null : (
222
- <CopyPageMenu
223
- content={markdownHref ? undefined : rawContent}
224
- contentUrl={markdownHref}
225
- key={`copy-${currentPath}`}
226
- title={pageTitle}
227
- />
228
- ))}
229
- </div>
230
- </div>
231
- {pageDescription ? (
232
- <p className="text-[1.05rem] text-muted-foreground sm:text-balance sm:text-base md:max-w-[80%]">
233
- {pageDescription}
234
- </p>
235
- ) : null}
236
- </div>
237
- </div>
238
- <div className="grid min-w-0 grid-cols-1 gap-4.5 leading-relaxed [&_blockquote]:border-l-3 [&_blockquote]:border-primary [&_blockquote]:pl-3.5 [&_blockquote]:text-muted-foreground [&_h2]:mt-10 [&_h2]:mb-3 [&_h2]:text-2xl [&_h2]:font-bold [&_h3]:mt-8 [&_h3]:mb-2 [&_h3]:text-[1.375rem] [&_h3]:font-semibold [&_h4]:mt-6 [&_h4]:mb-2 [&_h4]:text-base [&_h4]:font-semibold [&_ol]:list-decimal [&_ol]:pl-6 [&_table]:w-full [&_table]:border-collapse [&_table]:text-sm [&_td]:border-b [&_td]:border-border [&_td]:px-2.5 [&_td]:py-2 [&_td]:text-left [&_th]:border-b [&_th]:border-border [&_th]:px-2.5 [&_th]:py-2 [&_th]:text-left [&_ul]:list-disc [&_ul]:pl-6">
239
- {content}
240
- </div>
241
- {!hideFooterPagination && (prevPage || nextPage) ? (
242
- <nav
243
- className="flex w-full rounded-2xl bg-muted/50 p-1 text-sm"
244
- data-markdown-ignore=""
245
- id="pagination"
246
- >
247
- {prevPage ? (
248
- <Link
249
- className="group flex items-center justify-between gap-1.5 pl-3 pr-6"
250
- href={toDocHref(prevPage.path, basePath)}
251
- >
252
- <ChevronLeftIcon
253
- aria-hidden="true"
254
- className="size-3 text-muted-foreground/50 group-hover:text-muted-foreground"
255
- />
256
- <span className="font-medium tracking-tight text-muted-foreground group-hover:text-foreground">
257
- Previous
258
- </span>
259
- </Link>
260
- ) : null}
261
- {nextPage ? (
262
- <Link
263
- className="group ml-auto flex w-full min-w-0 flex-1"
264
- href={toDocHref(nextPage.path, basePath)}
265
- >
266
- <div className="flex flex-1 items-center justify-end rounded-xl bg-background hover:ring-1 hover:ring-border sm:h-16">
267
- <div className="flex min-w-0 flex-col items-end justify-center px-5">
268
- <span className="text-right font-semibold text-foreground/80">
269
- {nextPage.title}
270
- </span>
271
- {nextPage.description ? (
272
- <span className="hidden w-full truncate text-right text-muted-foreground lg:block lg:w-72">
273
- {nextPage.description}
274
- </span>
275
- ) : null}
276
- </div>
277
- <div className="h-8 w-px bg-border/50" />
278
- <div className="flex items-center gap-1.5 pl-5 pr-3">
279
- <span className="font-medium tracking-tight text-muted-foreground group-hover:text-foreground">
280
- Next
281
- </span>
282
- <ChevronRightIcon
283
- aria-hidden="true"
284
- className="size-3 text-muted-foreground/50 group-hover:text-muted-foreground"
285
- />
286
- </div>
287
- </div>
288
- </Link>
289
- ) : null}
290
- </nav>
291
- ) : null}
292
- </div>
293
- </div>
294
- {hasToc ? (
295
- <DocToc contextualItems={contextualTocItems} toc={toc} />
296
- ) : null}
297
- </main>
298
- )}
299
- </div>
300
- );
301
-
302
- return (
303
- <div
304
- className="min-h-screen font-sans"
305
- data-has-dark-logo={config.logo?.dark ? "true" : "false"}
306
- style={themeStylesFromConfig(config)}
307
- >
308
- <a
309
- className="sr-only focus:not-sr-only focus:fixed focus:left-4 focus:top-4 focus:z-[100] focus:rounded-md focus:bg-background focus:px-4 focus:py-2 focus:text-sm focus:font-medium focus:shadow-sm"
310
- data-markdown-ignore=""
311
- href="#main-content"
312
- >
313
- Skip to content
314
- </a>
315
- <DocScripts scripts={config.scripts?.head} />
316
- <DocHeader
317
- activeTabIndex={activeTabIndex}
318
- basePath={basePath}
319
- config={config}
320
- nav={nav}
321
- tabs={tabs}
322
- />
323
- <div className="container-wrapper flex flex-1 flex-col">
324
- {showSidebar ? (
325
- <div
326
- className="min-h-min flex-1 items-start px-0 [--top-spacing:0] lg:grid lg:grid-cols-[var(--sidebar-width)_minmax(0,1fr)] lg:[--top-spacing:calc(var(--spacing)*4)]"
327
- style={
328
- {
329
- "--sidebar-width": "calc(var(--spacing) * 72)",
330
- } as React.CSSProperties
331
- }
332
- >
333
- <div className="min-w-0 lg:col-start-2 lg:row-start-1">
334
- {innerContent}
335
- </div>
336
- <div className="self-stretch lg:col-start-1 lg:row-start-1">
337
- <DocSidebar
338
- activeTabIndex={activeTabIndex ?? 0}
339
- anchors={anchors}
340
- basePath={basePath}
341
- nav={nav}
342
- tenantSlug={tenantSlug}
343
- />
344
- </div>
345
- </div>
346
- ) : (
347
- <div className="min-h-min flex-1 items-start px-0 [--top-spacing:0] lg:[--top-spacing:calc(var(--spacing)*4)]">
348
- {innerContent}
349
- </div>
350
- )}
351
- </div>
352
- <DocScripts scripts={config.scripts?.body} strategy="lazyOnload" />
353
- </div>
354
- );
355
- };
@@ -1,256 +0,0 @@
1
- import { ArrowUpRightIcon } from "blode-icons-react";
2
- import Image from "next/image";
3
- import Link from "next/link";
4
-
5
- import { SidebarActiveHighlight } from "@/components/docs/sidebar-active-highlight";
6
- import { DocIcon } from "@/components/icons/doc-icon";
7
- import { getTenantSidebarData } from "@/lib/docs-runtime";
8
- import { getNavPageHref, getNavPageTitle } from "@/lib/navigation";
9
- import type { NavEntry, NavPage } from "@/lib/navigation";
10
- import { isExternalHref, toDocHref } from "@/lib/routes";
11
- import { cn } from "@/lib/utils";
12
-
13
- import { SidebarScrollArea } from "./sidebar-scroll-area";
14
-
15
- const MENU_BUTTON_CLASS =
16
- "relative flex min-h-[30px] items-center gap-2 overflow-visible rounded-md border border-transparent px-2 text-[0.8rem] font-medium transition-colors hover:bg-accent/70 hover:text-foreground";
17
-
18
- const NavIcon = ({ icon }: { icon: string }) => {
19
- if (icon.startsWith("http") || icon.startsWith("/")) {
20
- return (
21
- <Image
22
- alt=""
23
- className="size-4 shrink-0"
24
- height={16}
25
- src={icon}
26
- unoptimized
27
- width={16}
28
- />
29
- );
30
- }
31
- return (
32
- <DocIcon
33
- className="size-4 shrink-0 text-muted-foreground"
34
- icon={icon}
35
- size={16}
36
- />
37
- );
38
- };
39
-
40
- const NavPageLink = ({
41
- item,
42
- basePath,
43
- }: {
44
- item: NavPage;
45
- basePath: string;
46
- }) => {
47
- const displayTitle = getNavPageTitle(item);
48
- const href = getNavPageHref(item, basePath);
49
- const isExternal = Boolean(item.url && isExternalHref(item.url));
50
-
51
- const linkContent = (
52
- <>
53
- {item.icon ? <NavIcon icon={item.icon} /> : null}
54
- <span className={item.deprecated ? "line-through opacity-60" : undefined}>
55
- {displayTitle}
56
- </span>
57
- {item.tag ? (
58
- <span className="ml-auto shrink-0 rounded bg-primary/10 px-1.5 py-0.5 text-[10px] font-medium leading-none text-primary">
59
- {item.tag}
60
- </span>
61
- ) : null}
62
- {item.deprecated && !item.tag ? (
63
- <span className="ml-auto shrink-0 rounded bg-yellow-100 px-1.5 py-0.5 text-[10px] font-medium leading-none text-yellow-800 dark:bg-yellow-900/40 dark:text-yellow-300">
64
- Deprecated
65
- </span>
66
- ) : null}
67
- {isExternal ? (
68
- <ArrowUpRightIcon
69
- aria-hidden="true"
70
- className="ml-auto size-3 shrink-0 text-muted-foreground"
71
- />
72
- ) : null}
73
- </>
74
- );
75
-
76
- if (isExternal) {
77
- return (
78
- <a
79
- className={MENU_BUTTON_CLASS}
80
- data-sidebar-link=""
81
- href={href}
82
- rel="noopener noreferrer"
83
- target="_blank"
84
- >
85
- {linkContent}
86
- </a>
87
- );
88
- }
89
-
90
- return (
91
- <Link
92
- className={MENU_BUTTON_CLASS}
93
- data-path={item.path}
94
- data-sidebar-link=""
95
- href={href}
96
- >
97
- {linkContent}
98
- </Link>
99
- );
100
- };
101
-
102
- const Section = ({
103
- title,
104
- children,
105
- paddedTop = false,
106
- }: {
107
- title?: string;
108
- children: React.ReactNode;
109
- paddedTop?: boolean;
110
- }) => (
111
- <section
112
- className={cn(
113
- "relative flex w-full min-w-0 flex-col p-2",
114
- paddedTop && "pt-6"
115
- )}
116
- >
117
- {title ? (
118
- <div className="mb-2 px-2 font-medium text-muted-foreground text-xs">
119
- {title}
120
- </div>
121
- ) : null}
122
- <div className="w-full text-sm">{children}</div>
123
- </section>
124
- );
125
-
126
- const renderSidebarTree = ({
127
- anchors,
128
- basePath,
129
- entries,
130
- }: {
131
- anchors: { label: string; href: string }[];
132
- basePath: string;
133
- entries: NavEntry[];
134
- }) => (
135
- <>
136
- {anchors.length ? (
137
- <Section paddedTop title="Pinned">
138
- <ul className="space-y-1">
139
- {anchors.map((anchor) => (
140
- <li key={anchor.href}>
141
- <a
142
- className={cn(MENU_BUTTON_CLASS, "text-foreground")}
143
- href={
144
- anchor.href.startsWith("http")
145
- ? anchor.href
146
- : toDocHref(anchor.href, basePath)
147
- }
148
- >
149
- {anchor.label}
150
- </a>
151
- </li>
152
- ))}
153
- </ul>
154
- </Section>
155
- ) : null}
156
- {entries.map((entry, index) => {
157
- if (entry.type === "page") {
158
- return (
159
- <Section key={entry.path} paddedTop={index === 0 && !anchors.length}>
160
- <ul>
161
- <li>
162
- <NavPageLink basePath={basePath} item={entry} />
163
- </li>
164
- </ul>
165
- </Section>
166
- );
167
- }
168
-
169
- return (
170
- <Section
171
- key={entry.title}
172
- paddedTop={index === 0 && !anchors.length}
173
- title={entry.title}
174
- >
175
- <ul className="space-y-0.5">
176
- {entry.items.map((item) => (
177
- <li key={item.path}>
178
- <NavPageLink basePath={basePath} item={item} />
179
- </li>
180
- ))}
181
- </ul>
182
- </Section>
183
- );
184
- })}
185
- </>
186
- );
187
-
188
- const CachedSidebarTree = async ({
189
- activeTabIndex,
190
- anchors,
191
- basePath,
192
- entries,
193
- tenantSlug,
194
- }: {
195
- activeTabIndex: number;
196
- anchors?: { label: string; href: string }[];
197
- basePath: string;
198
- entries?: NavEntry[];
199
- tenantSlug?: string;
200
- }) => {
201
- if (tenantSlug) {
202
- const data = await getTenantSidebarData(tenantSlug, activeTabIndex);
203
- if (data) {
204
- return renderSidebarTree({
205
- anchors: data.anchors,
206
- basePath,
207
- entries: data.entries,
208
- });
209
- }
210
- }
211
-
212
- if (!entries || entries.length === 0) {
213
- return null;
214
- }
215
-
216
- return renderSidebarTree({
217
- anchors: anchors ?? [],
218
- basePath,
219
- entries,
220
- });
221
- };
222
-
223
- export const DocSidebar = ({
224
- activeTabIndex,
225
- anchors,
226
- basePath,
227
- nav,
228
- tenantSlug,
229
- }: {
230
- activeTabIndex: number;
231
- anchors?: { label: string; href: string }[];
232
- basePath: string;
233
- nav?: NavEntry[];
234
- tenantSlug?: string;
235
- }) => (
236
- <aside
237
- aria-label="Documentation navigation"
238
- className="sticky top-[calc(var(--header-height)+0.6rem)] z-30 hidden h-[calc(100svh-10rem)] w-[calc(var(--spacing)*56)] shrink-0 flex-col overscroll-none bg-transparent lg:flex"
239
- data-markdown-ignore=""
240
- >
241
- <div className="h-9" />
242
- <div className="absolute top-8 z-10 h-8 w-full shrink-0 bg-gradient-to-b from-background via-background/80 to-background/50 blur-xs" />
243
- <div className="absolute top-12 right-2 bottom-0 hidden h-full w-px bg-gradient-to-b from-transparent via-border to-transparent lg:flex" />
244
- <SidebarScrollArea className="no-scrollbar mx-auto flex min-h-0 w-full flex-1 flex-col gap-2 overflow-y-auto overflow-x-hidden px-2">
245
- <CachedSidebarTree
246
- activeTabIndex={activeTabIndex}
247
- anchors={anchors}
248
- basePath={basePath}
249
- entries={nav}
250
- tenantSlug={tenantSlug}
251
- />
252
- <div className="sticky -bottom-1 z-10 h-16 shrink-0 bg-gradient-to-t from-background via-background/80 to-background/50 blur-xs" />
253
- </SidebarScrollArea>
254
- <SidebarActiveHighlight basePath={basePath} />
255
- </aside>
256
- );
@@ -1,46 +0,0 @@
1
- import type { ReactNode } from "react";
2
-
3
- import type { TocItem } from "@/lib/toc";
4
-
5
- export const DocToc = ({
6
- toc,
7
- contextualItems,
8
- }: {
9
- toc: TocItem[];
10
- contextualItems?: ReactNode;
11
- }) => {
12
- if (!toc.length && !contextualItems) {
13
- return null;
14
- }
15
-
16
- return (
17
- <nav
18
- aria-label="Table of contents"
19
- className="sticky top-[calc(var(--header-height)+1px)] z-30 ml-auto hidden h-[90svh] w-(--sidebar-width) flex-col gap-4 overflow-hidden overscroll-none pb-8 xl:flex"
20
- data-markdown-ignore=""
21
- >
22
- <div className="no-scrollbar flex flex-col gap-8 overflow-y-auto px-8">
23
- <div className="flex flex-col gap-2 p-4 pt-0 text-sm">
24
- {toc.length > 0 ? (
25
- <>
26
- <p className="sticky top-0 h-6 bg-background font-medium text-muted-foreground text-xs">
27
- On This Page
28
- </p>
29
- {toc.map((item) => (
30
- <a
31
- className="text-[0.8rem] text-muted-foreground no-underline transition-colors hover:text-foreground data-[depth=3]:pl-4 data-[depth=4]:pl-6"
32
- data-depth={item.level}
33
- href={`#${item.id}`}
34
- key={item.id}
35
- >
36
- {item.title}
37
- </a>
38
- ))}
39
- </>
40
- ) : null}
41
- {contextualItems}
42
- </div>
43
- </div>
44
- </nav>
45
- );
46
- };