radiant-docs 0.1.66 → 0.1.68
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 +8 -8
- package/template/package.json +2 -2
- package/template/src/components/MdxPage.astro +12 -2
- package/template/src/components/OpenApiPage.astro +13 -3
- package/template/src/components/PageAiActions.astro +715 -0
- package/template/src/components/endpoint/PlaygroundButton.astro +1 -1
- package/template/src/components/endpoint/PlaygroundForm.astro +8 -0
- package/template/src/layouts/Layout.astro +6 -1
- package/template/src/lib/ai-artifacts.ts +295 -13
- package/template/src/pages/{[...slug]/index.md.ts → [...slug].md.ts} +1 -1
package/package.json
CHANGED
|
@@ -311,13 +311,33 @@ function resolveDocsSiteConfig() {
|
|
|
311
311
|
const docsSiteConfig = resolveDocsSiteConfig();
|
|
312
312
|
globalThis.__RADIANT_DOCS_BASE_PATH__ = docsSiteConfig.base;
|
|
313
313
|
|
|
314
|
+
function isInternalDocsRoutePathname(pathname) {
|
|
315
|
+
const basePath = docsSiteConfig.base === "/" ? "" : docsSiteConfig.base;
|
|
316
|
+
const relativePath =
|
|
317
|
+
basePath && pathname.startsWith(`${basePath}/`)
|
|
318
|
+
? pathname.slice(basePath.length)
|
|
319
|
+
: pathname;
|
|
320
|
+
|
|
321
|
+
return relativePath === "/-" || relativePath.startsWith("/-/");
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
function shouldIncludeSitemapPage(page) {
|
|
325
|
+
try {
|
|
326
|
+
return !isInternalDocsRoutePathname(new URL(page).pathname);
|
|
327
|
+
} catch {
|
|
328
|
+
return !page.startsWith("/-/");
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
|
|
314
332
|
const markdownProcessor = unified({
|
|
315
333
|
remarkPlugins: [
|
|
316
334
|
remarkGfm,
|
|
317
|
-
remarkResolveInternalLinks,
|
|
318
335
|
remarkDemoteH1,
|
|
319
336
|
remarkStandaloneImageComponent,
|
|
337
|
+
// ComponentPreview fences become rendered preview children here, so resolve
|
|
338
|
+
// links after this while leaving the visible raw code sample untouched.
|
|
320
339
|
remarkCodeBlockComponent,
|
|
340
|
+
remarkResolveInternalLinks,
|
|
321
341
|
],
|
|
322
342
|
rehypePlugins: [
|
|
323
343
|
rehypeSlug,
|
|
@@ -387,7 +407,9 @@ export default defineConfig({
|
|
|
387
407
|
assetsPrefix: configuredAssetsPrefix,
|
|
388
408
|
},
|
|
389
409
|
integrations: [
|
|
390
|
-
sitemap(
|
|
410
|
+
sitemap({
|
|
411
|
+
filter: shouldIncludeSitemapPage,
|
|
412
|
+
}),
|
|
391
413
|
preact({
|
|
392
414
|
compat: true,
|
|
393
415
|
}),
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"@fontsource-variable/source-serif-4": "^5.2.9",
|
|
29
29
|
"@iconify-json/fluent": "^1.2.47",
|
|
30
30
|
"@iconify-json/lucide": "^1.2.79",
|
|
31
|
-
"@iconify-json/simple-icons": "^1.2.
|
|
31
|
+
"@iconify-json/simple-icons": "^1.2.87",
|
|
32
32
|
"@iconify/react": "^6.0.2",
|
|
33
33
|
"@paper-design/shaders": "^0.0.76",
|
|
34
34
|
"@preact/preset-vite": "^2.10.3",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"oas": "^28.7.0",
|
|
53
53
|
"openapi-sampler": "^1.6.2",
|
|
54
54
|
"preact": "^10.29.0",
|
|
55
|
-
"radiant-docs-validator": "^0.1.
|
|
55
|
+
"radiant-docs-validator": "^0.1.31",
|
|
56
56
|
"rehype-autolink-headings": "^7.1.0",
|
|
57
57
|
"rehype-slug": "^6.0.0",
|
|
58
58
|
"remark-gfm": "^4.0.1",
|
|
@@ -2343,9 +2343,9 @@
|
|
|
2343
2343
|
}
|
|
2344
2344
|
},
|
|
2345
2345
|
"node_modules/@iconify-json/simple-icons": {
|
|
2346
|
-
"version": "1.2.
|
|
2347
|
-
"resolved": "https://registry.npmjs.org/@iconify-json/simple-icons/-/simple-icons-1.2.
|
|
2348
|
-
"integrity": "sha512-
|
|
2346
|
+
"version": "1.2.87",
|
|
2347
|
+
"resolved": "https://registry.npmjs.org/@iconify-json/simple-icons/-/simple-icons-1.2.87.tgz",
|
|
2348
|
+
"integrity": "sha512-8YciStObhSji3OZFmWAWK6kBujyqO5bLCxeDwLxf3CR3F4PVelq7keC2LBvgTqviWzSTysj5/g4PCFLiAMVGsw==",
|
|
2349
2349
|
"license": "CC0-1.0",
|
|
2350
2350
|
"dependencies": {
|
|
2351
2351
|
"@iconify/types": "*"
|
|
@@ -11094,9 +11094,9 @@
|
|
|
11094
11094
|
"license": "MIT"
|
|
11095
11095
|
},
|
|
11096
11096
|
"node_modules/radiant-docs-validator": {
|
|
11097
|
-
"version": "0.1.
|
|
11098
|
-
"resolved": "https://registry.npmjs.org/radiant-docs-validator/-/radiant-docs-validator-0.1.
|
|
11099
|
-
"integrity": "sha512-
|
|
11097
|
+
"version": "0.1.31",
|
|
11098
|
+
"resolved": "https://registry.npmjs.org/radiant-docs-validator/-/radiant-docs-validator-0.1.31.tgz",
|
|
11099
|
+
"integrity": "sha512-YUgNgsJ1OXWTdo86vtUOAOirQ9WG8patH0F3bGG0FaS/7HUZzJaoYEs8wph6I8EZs/LV1qENfaAvY/0DFjQnMA==",
|
|
11100
11100
|
"license": "MIT",
|
|
11101
11101
|
"dependencies": {
|
|
11102
11102
|
"@iconify-json/fluent": "^1.2.47",
|
package/template/package.json
CHANGED
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"@fontsource-variable/source-serif-4": "^5.2.9",
|
|
28
28
|
"@iconify-json/fluent": "^1.2.47",
|
|
29
29
|
"@iconify-json/lucide": "^1.2.79",
|
|
30
|
-
"@iconify-json/simple-icons": "^1.2.
|
|
30
|
+
"@iconify-json/simple-icons": "^1.2.87",
|
|
31
31
|
"@iconify/react": "^6.0.2",
|
|
32
32
|
"@paper-design/shaders": "^0.0.76",
|
|
33
33
|
"@preact/preset-vite": "^2.10.3",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"oas": "^28.7.0",
|
|
52
52
|
"openapi-sampler": "^1.6.2",
|
|
53
53
|
"preact": "^10.29.0",
|
|
54
|
-
"radiant-docs-validator": "^0.1.
|
|
54
|
+
"radiant-docs-validator": "^0.1.31",
|
|
55
55
|
"rehype-autolink-headings": "^7.1.0",
|
|
56
56
|
"rehype-slug": "^6.0.0",
|
|
57
57
|
"remark-gfm": "^4.0.1",
|
|
@@ -19,6 +19,7 @@ import ComponentPreview from "./user/ComponentPreview.astro";
|
|
|
19
19
|
import ComponentPreviewBlock from "./user/ComponentPreviewBlock.astro";
|
|
20
20
|
import type { MdxRoute, Route } from "../lib/routes";
|
|
21
21
|
import PagePagination from "./PagePagination.astro";
|
|
22
|
+
import PageAiActions from "./PageAiActions.astro";
|
|
22
23
|
import { PREVIEW_HEADING_ID_PREFIX } from "../lib/mdx/rehype-prefix-preview-heading-ids";
|
|
23
24
|
|
|
24
25
|
interface Props {
|
|
@@ -67,10 +68,19 @@ const tocHeadings = headings.filter(
|
|
|
67
68
|
<Layout pageTitle={title} pageDescription={description}>
|
|
68
69
|
<div class="flex w-full min-w-0 justify-between gap-x-10">
|
|
69
70
|
<div class="mx-auto max-w-3xl w-full">
|
|
70
|
-
<header
|
|
71
|
-
|
|
71
|
+
<header
|
|
72
|
+
class="mb-8 flex flex-col gap-4 sm:flex-row sm:items-end sm:justify-between"
|
|
73
|
+
>
|
|
74
|
+
<h1
|
|
75
|
+
class="rd-document-heading min-w-0 text-4xl font-semibold tracking-tight"
|
|
76
|
+
>
|
|
72
77
|
{title}
|
|
73
78
|
</h1>
|
|
79
|
+
<PageAiActions
|
|
80
|
+
title={title}
|
|
81
|
+
routeSlug={route.slug}
|
|
82
|
+
description={description}
|
|
83
|
+
/>
|
|
74
84
|
</header>
|
|
75
85
|
<article class="prose-rules">
|
|
76
86
|
<Content components={components} />
|
|
@@ -10,6 +10,7 @@ import ResponseFieldTree from "./endpoint/ResponseFieldTree.astro";
|
|
|
10
10
|
import PlaygroundBar from "./endpoint/PlaygroundBar.astro";
|
|
11
11
|
import PlaygroundForm from "./endpoint/PlaygroundForm.astro";
|
|
12
12
|
import PlaygroundButton from "./endpoint/PlaygroundButton.astro";
|
|
13
|
+
import PageAiActions from "./PageAiActions.astro";
|
|
13
14
|
import { getConfig } from "../lib/validation";
|
|
14
15
|
import {
|
|
15
16
|
getOpenApiOperationDoc,
|
|
@@ -59,11 +60,20 @@ const snippetStickyClass = hasTopbarNavigationTabs
|
|
|
59
60
|
---
|
|
60
61
|
|
|
61
62
|
<Layout pageTitle={title}>
|
|
62
|
-
<article>
|
|
63
|
-
<header
|
|
64
|
-
|
|
63
|
+
<article class="mx-auto w-full max-w-7xl">
|
|
64
|
+
<header
|
|
65
|
+
class="mb-8 flex flex-col gap-4 sm:flex-row sm:items-end sm:justify-between"
|
|
66
|
+
>
|
|
67
|
+
<h1
|
|
68
|
+
class="rd-document-heading min-w-0 text-4xl font-semibold tracking-tight"
|
|
69
|
+
>
|
|
65
70
|
{title}
|
|
66
71
|
</h1>
|
|
72
|
+
<PageAiActions
|
|
73
|
+
title={title}
|
|
74
|
+
routeSlug={route.slug}
|
|
75
|
+
description={description}
|
|
76
|
+
/>
|
|
67
77
|
</header>
|
|
68
78
|
<div class="flex flex-row-reverse justify-between gap-6 w-full">
|
|
69
79
|
<aside class="flex-1 min-w-0 hidden xl:block">
|