radiant-docs 0.1.59 → 0.1.60
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/package.json +1 -1
- package/template/astro.config.mjs +24 -2
- package/template/package-lock.json +121 -508
- package/template/package.json +3 -2
- package/template/scripts/generate-og-images.mjs +338 -6
- package/template/scripts/generate-og-metadata.mjs +29 -0
- package/template/src/components/Footer.astro +1 -1
- package/template/src/components/Header.astro +3 -10
- package/template/src/components/OpenApiPage.astro +20 -830
- package/template/src/components/SidebarGroup.astro +1 -1
- package/template/src/components/ThemeSwitcher.astro +5 -15
- package/template/src/components/endpoint/PlaygroundField.astro +1 -1
- package/template/src/components/endpoint/PlaygroundForm.astro +8 -4
- package/template/src/layouts/Layout.astro +6 -12
- package/template/src/lib/ai-artifacts.ts +792 -0
- package/template/src/lib/mdx/remark-resolve-internal-links.ts +22 -8
- package/template/src/lib/oas.ts +5 -1
- package/template/src/lib/openapi/operation-doc.ts +1150 -0
- package/template/src/lib/page-description.ts +20 -0
- package/template/src/lib/routes.ts +73 -18
- package/template/src/pages/[...slug]/index.md.ts +35 -0
- package/template/src/pages/[...spec].json.ts +33 -0
- package/template/src/pages/[...spec].yaml.ts +33 -0
- package/template/src/pages/[...spec].yml.ts +33 -0
- package/template/src/pages/index.md.ts +17 -0
- package/template/src/pages/llms-full.txt.ts +11 -0
- package/template/src/pages/llms.txt.ts +11 -0
- package/template/src/styles/global.css +18 -15
- package/template/src/styles/vaul.css +0 -255
|
@@ -18,7 +18,7 @@ const groupSlug = slugify(item.group);
|
|
|
18
18
|
const currentPrefix = parentSlug ? `${parentSlug}/${groupSlug}` : groupSlug;
|
|
19
19
|
---
|
|
20
20
|
|
|
21
|
-
<li class="my-8 first:
|
|
21
|
+
<li class="my-8 first:mt-0 last:mb-0">
|
|
22
22
|
<div class:list={["text-sm font-semibold mb-2 flex items-center gap-2 px-2"]}>
|
|
23
23
|
{item.icon && <Icon name={item.icon} class="size-4 text-neutral-500" />}
|
|
24
24
|
{item.group}
|
|
@@ -4,15 +4,15 @@ import { Icon } from "astro-icon/components";
|
|
|
4
4
|
|
|
5
5
|
<div
|
|
6
6
|
x-data="{
|
|
7
|
-
|
|
7
|
+
initialTheme: (() => {
|
|
8
8
|
const mode = new URLSearchParams(window.location.search).get('mode');
|
|
9
9
|
return mode === 'light' || mode === 'dark' ? mode : null;
|
|
10
10
|
})(),
|
|
11
11
|
theme: localStorage.getItem('theme') || 'system',
|
|
12
12
|
themeSwitchFrameId: null,
|
|
13
13
|
init() {
|
|
14
|
-
if (this.
|
|
15
|
-
this.theme = this.
|
|
14
|
+
if (this.initialTheme) {
|
|
15
|
+
this.theme = this.initialTheme;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
this.updateDOM();
|
|
@@ -22,13 +22,6 @@ import { Icon } from "astro-icon/components";
|
|
|
22
22
|
|
|
23
23
|
// Watch for changes to the 'theme' state
|
|
24
24
|
this.$watch('theme', val => {
|
|
25
|
-
if (this.forcedTheme) {
|
|
26
|
-
this.theme = this.forcedTheme;
|
|
27
|
-
this.updateDOM();
|
|
28
|
-
this.$nextTick(() => this.updateMarker());
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
25
|
localStorage.setItem('theme', val);
|
|
33
26
|
this.updateDOM();
|
|
34
27
|
this.$nextTick(() => this.updateMarker())
|
|
@@ -46,7 +39,7 @@ import { Icon } from "astro-icon/components";
|
|
|
46
39
|
updateDOM() {
|
|
47
40
|
const root = document.documentElement;
|
|
48
41
|
root.classList.add('is-switching-theme');
|
|
49
|
-
const activeTheme = this.
|
|
42
|
+
const activeTheme = this.theme;
|
|
50
43
|
const isDark = activeTheme === 'dark' ||
|
|
51
44
|
(activeTheme === 'system' && window.matchMedia('(prefers-color-scheme: dark)').matches);
|
|
52
45
|
|
|
@@ -64,7 +57,7 @@ import { Icon } from "astro-icon/components";
|
|
|
64
57
|
markerStyle: { left: null, width: null },
|
|
65
58
|
updateMarker() {
|
|
66
59
|
// Use the theme name as the ref key
|
|
67
|
-
const markerTheme = this.
|
|
60
|
+
const markerTheme = this.theme;
|
|
68
61
|
const el = this.$refs[markerTheme];
|
|
69
62
|
if (el) {
|
|
70
63
|
this.markerStyle = {
|
|
@@ -86,7 +79,6 @@ import { Icon } from "astro-icon/components";
|
|
|
86
79
|
x-ref="light"
|
|
87
80
|
@click="theme = 'light'"
|
|
88
81
|
:class="theme === 'light' ? 'text-neutral-800' : 'text-neutral-500'"
|
|
89
|
-
:disabled="Boolean(forcedTheme)"
|
|
90
82
|
class="p-[5px] rounded-full text-sm font-medium transition-all cursor-pointer z-10"
|
|
91
83
|
>
|
|
92
84
|
<Icon name="lucide:sun-medium" class="size-[13px]" />
|
|
@@ -96,7 +88,6 @@ import { Icon } from "astro-icon/components";
|
|
|
96
88
|
x-ref="dark"
|
|
97
89
|
@click="theme = 'dark'"
|
|
98
90
|
:class="theme === 'dark' ? 'text-neutral-300' : 'text-neutral-500'"
|
|
99
|
-
:disabled="Boolean(forcedTheme)"
|
|
100
91
|
class="p-[5px] rounded-full text-sm font-medium transition-all cursor-pointer z-10"
|
|
101
92
|
>
|
|
102
93
|
<Icon name="lucide:moon" class="size-[13px]" />
|
|
@@ -106,7 +97,6 @@ import { Icon } from "astro-icon/components";
|
|
|
106
97
|
x-ref="system"
|
|
107
98
|
@click="theme = 'system'"
|
|
108
99
|
:class="theme === 'system' ? 'text-neutral-800 dark:text-neutral-300' : 'text-neutral-500'"
|
|
109
|
-
:disabled="Boolean(forcedTheme)"
|
|
110
100
|
class="p-[6px] rounded-full text-sm font-medium transition-all cursor-pointer z-10"
|
|
111
101
|
>
|
|
112
102
|
<Icon name="lucide:monitor" class="size-[12px]" />
|
|
@@ -5,15 +5,18 @@ import type { OpenApiRoute } from "../../lib/routes";
|
|
|
5
5
|
import { getConfig } from "../../lib/validation";
|
|
6
6
|
import { renderMarkdown } from "../../lib/utils";
|
|
7
7
|
import {
|
|
8
|
-
|
|
9
|
-
type
|
|
10
|
-
type
|
|
11
|
-
} from "
|
|
8
|
+
OPENAPI_REQUEST_SECTION_LABELS,
|
|
9
|
+
type OpenApiRequestFields,
|
|
10
|
+
type OpenApiRequestSectionVariantData,
|
|
11
|
+
} from "../../lib/openapi/operation-doc";
|
|
12
12
|
import Accordion from "../user/Accordion.astro";
|
|
13
13
|
import PlaygroundBar from "./PlaygroundBar.astro";
|
|
14
14
|
import ResponseDisplay from "./ResponseDisplay.astro";
|
|
15
15
|
import PlaygroundField from "./PlaygroundField.astro";
|
|
16
16
|
|
|
17
|
+
type RequestFields = OpenApiRequestFields;
|
|
18
|
+
type RequestSectionVariantData = OpenApiRequestSectionVariantData;
|
|
19
|
+
|
|
17
20
|
interface Props {
|
|
18
21
|
route: OpenApiRoute;
|
|
19
22
|
serverUrl?: string;
|
|
@@ -33,6 +36,7 @@ const {
|
|
|
33
36
|
bodyDescription = "",
|
|
34
37
|
bodyDefaultKind,
|
|
35
38
|
} = Astro.props;
|
|
39
|
+
const headers: Record<string, string> = OPENAPI_REQUEST_SECTION_LABELS;
|
|
36
40
|
const config = await getConfig();
|
|
37
41
|
const configuredProxyUrl =
|
|
38
42
|
typeof import.meta.env.PUBLIC_PROXY_URL === "string"
|
|
@@ -11,6 +11,7 @@ import { getFaviconConfig } from "../lib/favicon";
|
|
|
11
11
|
import { getDocsFontCss, getDocsFontPreloads } from "../lib/font-css";
|
|
12
12
|
import { resolveStaticAssetUrl } from "../lib/static-asset-url";
|
|
13
13
|
import { getDocsThemeCss } from "../lib/theme-css";
|
|
14
|
+
import { resolvePageDescription } from "../lib/page-description";
|
|
14
15
|
|
|
15
16
|
interface Props {
|
|
16
17
|
pageTitle?: string;
|
|
@@ -39,14 +40,11 @@ const neutralPaletteCss = getDocsThemeCss(config.theme);
|
|
|
39
40
|
const fontCss = getDocsFontCss(config.theme);
|
|
40
41
|
const fontPreloads = getDocsFontPreloads(config.theme);
|
|
41
42
|
const resolvedPageTitle = pageTitle?.trim();
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
? `Learn about ${resolvedPageTitle} in the ${config.title} documentation.`
|
|
48
|
-
: `${config.title} documentation.`;
|
|
49
|
-
const resolvedMetaDescription = resolvedPageDescription ?? fallbackDescription;
|
|
43
|
+
const resolvedMetaDescription = resolvePageDescription({
|
|
44
|
+
pageTitle: resolvedPageTitle,
|
|
45
|
+
pageDescription,
|
|
46
|
+
docsTitle: config.title,
|
|
47
|
+
});
|
|
50
48
|
const documentTitle = resolvedPageTitle
|
|
51
49
|
? `${resolvedPageTitle} | ${config.title}`
|
|
52
50
|
: `${config.title} Docs`;
|
|
@@ -240,18 +238,15 @@ const askAiEnabled = isDev || orgTier >= 3;
|
|
|
240
238
|
<!-- Edges -->
|
|
241
239
|
<div
|
|
242
240
|
class="fixed top-1 inset-x-1 h-16 -z-10 bg-background-dark"
|
|
243
|
-
data-vaul-scale-chrome
|
|
244
241
|
>
|
|
245
242
|
<div class="bg-background w-full h-full rounded-t-2xl"></div>
|
|
246
243
|
</div>
|
|
247
244
|
<div
|
|
248
245
|
class="fixed top-[63px] z-30 w-[5px] right-0 bottom-0 bg-background-dark border-l border-l-border"
|
|
249
|
-
data-vaul-scale-chrome
|
|
250
246
|
>
|
|
251
247
|
</div>
|
|
252
248
|
<div
|
|
253
249
|
class="fixed top-[63px] z-30 w-[5px] left-0 bottom-0 bg-background-dark border-r border-r-border"
|
|
254
|
-
data-vaul-scale-chrome
|
|
255
250
|
>
|
|
256
251
|
</div>
|
|
257
252
|
|
|
@@ -279,7 +274,6 @@ const askAiEnabled = isDev || orgTier >= 3;
|
|
|
279
274
|
<!-- Main Content -->
|
|
280
275
|
<div
|
|
281
276
|
class="mx-1 mt-1 px-4 sm:px-6 lg:pl-[calc(288px+32px)] pt-16 lg:pr-8 bg-background"
|
|
282
|
-
data-vaul-scale-chrome
|
|
283
277
|
>
|
|
284
278
|
<main class="mx-auto pt-16 pb-16 min-h-[calc(100vh-64px)]">
|
|
285
279
|
<slot />
|