@brainfish-ai/devdoc 0.1.44 → 0.1.46
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 +45 -2
- package/dist/cli/commands/create.js +25 -8
- package/dist/cli/commands/sdk.d.ts +30 -0
- package/dist/cli/commands/sdk.js +365 -0
- package/dist/cli/index.js +28 -1
- package/dist/sdk/index.d.ts +126 -0
- package/dist/sdk/index.js +871 -0
- package/package.json +7 -3
- package/renderer/app/api/collections/route.js +38 -9
- package/renderer/app/api/docs/route.js +9 -4
- package/renderer/components/docs-viewer/agent/agent-chat.js +146 -109
- package/renderer/components/docs-viewer/content/doc-page.js +54 -44
- package/renderer/components/docs-viewer/content/mdx-error-boundary.js +184 -0
- package/renderer/components/docs-viewer/index.js +21 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brainfish-ai/devdoc",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.46",
|
|
4
4
|
"description": "Documentation framework for developers. Write docs in MDX, preview locally, deploy to Brainfish.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -22,7 +22,9 @@
|
|
|
22
22
|
"mdx",
|
|
23
23
|
"api-docs",
|
|
24
24
|
"developer-docs",
|
|
25
|
-
"cli"
|
|
25
|
+
"cli",
|
|
26
|
+
"sdk-generation",
|
|
27
|
+
"openapi"
|
|
26
28
|
],
|
|
27
29
|
"author": "Brainfish",
|
|
28
30
|
"license": "AGPL-3.0",
|
|
@@ -32,11 +34,13 @@
|
|
|
32
34
|
"dependencies": {
|
|
33
35
|
"commander": "^12.0.0",
|
|
34
36
|
"fs-extra": "^11.2.0",
|
|
35
|
-
"giget": "^1.2.3"
|
|
37
|
+
"giget": "^1.2.3",
|
|
38
|
+
"js-yaml": "^4.1.0"
|
|
36
39
|
},
|
|
37
40
|
"devDependencies": {
|
|
38
41
|
"@swc/core": "^1.3.100",
|
|
39
42
|
"@types/fs-extra": "^11.0.4",
|
|
43
|
+
"@types/js-yaml": "^4.0.9",
|
|
40
44
|
"@types/node": "^20.0.0",
|
|
41
45
|
"typescript": "^5.0.0"
|
|
42
46
|
},
|
|
@@ -17,6 +17,25 @@ function resolvePath(...paths) {
|
|
|
17
17
|
}
|
|
18
18
|
return join(process.cwd(), STARTER_PATH, ...paths);
|
|
19
19
|
}
|
|
20
|
+
// Helper to rewrite asset URLs for dev mode
|
|
21
|
+
// In dev mode, /assets/* needs to be served via /api/local-assets/*
|
|
22
|
+
function rewriteAssetUrl(url) {
|
|
23
|
+
if (!url) return url;
|
|
24
|
+
if (isDevMode() && typeof url === 'string' && url.startsWith('/assets/')) {
|
|
25
|
+
return url.replace('/assets/', '/api/local-assets/');
|
|
26
|
+
}
|
|
27
|
+
return url;
|
|
28
|
+
}
|
|
29
|
+
// Helper to rewrite logo config for dev mode
|
|
30
|
+
function rewriteLogoForDevMode(logo) {
|
|
31
|
+
if (!logo) return logo;
|
|
32
|
+
return {
|
|
33
|
+
...logo,
|
|
34
|
+
url: rewriteAssetUrl(logo.url),
|
|
35
|
+
light: rewriteAssetUrl(logo.light),
|
|
36
|
+
dark: rewriteAssetUrl(logo.dark)
|
|
37
|
+
};
|
|
38
|
+
}
|
|
20
39
|
// Get the content root directory
|
|
21
40
|
function getContentRoot() {
|
|
22
41
|
if (isAbsolute(STARTER_PATH)) {
|
|
@@ -390,7 +409,7 @@ function getOpenApiSpec(specPath) {
|
|
|
390
409
|
navigationTabs,
|
|
391
410
|
changelogReleases: [],
|
|
392
411
|
docsName: docsConfig.name || null,
|
|
393
|
-
docsFavicon: docsConfig.favicon || null,
|
|
412
|
+
docsFavicon: rewriteAssetUrl(docsConfig.favicon) || null,
|
|
394
413
|
docsLogo: null,
|
|
395
414
|
docsHeader: null,
|
|
396
415
|
docsNavbar: null,
|
|
@@ -547,6 +566,8 @@ export async function GET(request) {
|
|
|
547
566
|
// Parse query params
|
|
548
567
|
const { searchParams } = new URL(request.url);
|
|
549
568
|
const requestedVersion = searchParams.get('version');
|
|
569
|
+
const requestedTabId = searchParams.get('tab') // Support loading spec by tab ID
|
|
570
|
+
;
|
|
550
571
|
// Load docs and theme configuration
|
|
551
572
|
const docsConfig = loadDocsConfig();
|
|
552
573
|
const themeConfig = loadThemeConfig();
|
|
@@ -554,8 +575,16 @@ export async function GET(request) {
|
|
|
554
575
|
const docGroups = docsConfig ? buildDocGroups(docsConfig) : [];
|
|
555
576
|
const navigationTabs = docsConfig ? buildNavigationTabs(docsConfig) : [];
|
|
556
577
|
const changelogReleases = scanChangelogReleases();
|
|
557
|
-
// Find the OpenAPI tab
|
|
558
|
-
|
|
578
|
+
// Find the OpenAPI tab - support multiple tabs by tab ID
|
|
579
|
+
let openapiTab;
|
|
580
|
+
if (requestedTabId) {
|
|
581
|
+
// Find tab by its ID (e.g., "instagram-api", "facebook-pages-api")
|
|
582
|
+
openapiTab = navigationTabs.find((t)=>t.type === 'openapi' && t.id === requestedTabId);
|
|
583
|
+
}
|
|
584
|
+
// Fallback to first OpenAPI tab if no specific tab requested
|
|
585
|
+
if (!openapiTab) {
|
|
586
|
+
openapiTab = navigationTabs.find((t)=>t.type === 'openapi');
|
|
587
|
+
}
|
|
559
588
|
const apiVersions = openapiTab?.versions || [];
|
|
560
589
|
// Determine which spec to load
|
|
561
590
|
let specPath;
|
|
@@ -589,8 +618,8 @@ export async function GET(request) {
|
|
|
589
618
|
navigationTabs,
|
|
590
619
|
changelogReleases,
|
|
591
620
|
docsName: docsConfig?.name || null,
|
|
592
|
-
docsFavicon: docsConfig?.favicon || null,
|
|
593
|
-
docsLogo: themeConfig?.logo || null,
|
|
621
|
+
docsFavicon: rewriteAssetUrl(docsConfig?.favicon) || null,
|
|
622
|
+
docsLogo: rewriteLogoForDevMode(themeConfig?.logo) || null,
|
|
594
623
|
docsHeader: themeConfig?.header || null,
|
|
595
624
|
docsNavbar: themeConfig?.navbar || null,
|
|
596
625
|
docsColors: themeConfig?.colors || null,
|
|
@@ -625,8 +654,8 @@ export async function GET(request) {
|
|
|
625
654
|
navigationTabs,
|
|
626
655
|
changelogReleases,
|
|
627
656
|
docsName: docsConfig?.name || null,
|
|
628
|
-
docsFavicon: docsConfig?.favicon || null,
|
|
629
|
-
docsLogo: themeConfig?.logo || null,
|
|
657
|
+
docsFavicon: rewriteAssetUrl(docsConfig?.favicon) || null,
|
|
658
|
+
docsLogo: rewriteLogoForDevMode(themeConfig?.logo) || null,
|
|
630
659
|
docsHeader: themeConfig?.header || null,
|
|
631
660
|
docsNavbar: themeConfig?.navbar || null,
|
|
632
661
|
docsColors: themeConfig?.colors || null,
|
|
@@ -665,8 +694,8 @@ export async function GET(request) {
|
|
|
665
694
|
navigationTabs,
|
|
666
695
|
changelogReleases,
|
|
667
696
|
docsName: docsConfig?.name || null,
|
|
668
|
-
docsFavicon: docsConfig?.favicon || null,
|
|
669
|
-
docsLogo: themeConfig?.logo || null,
|
|
697
|
+
docsFavicon: rewriteAssetUrl(docsConfig?.favicon) || null,
|
|
698
|
+
docsLogo: rewriteLogoForDevMode(themeConfig?.logo) || null,
|
|
670
699
|
docsHeader: themeConfig?.header || null,
|
|
671
700
|
docsNavbar: themeConfig?.navbar || null,
|
|
672
701
|
docsColors: themeConfig?.colors || null,
|
|
@@ -8,6 +8,7 @@ import rehypeSlug from 'rehype-slug';
|
|
|
8
8
|
// Note: rehype-pretty-code is dynamically imported to handle serverless environments
|
|
9
9
|
// where shiki may not be fully available
|
|
10
10
|
import { getProjectFile } from '@/lib/storage/blob';
|
|
11
|
+
import { remarkMermaid } from '@/lib/docs/mdx/remark-mermaid';
|
|
11
12
|
const STARTER_PATH = process.env.STARTER_PATH || 'devdoc-docs';
|
|
12
13
|
// Helper to get content root - supports both relative and absolute paths
|
|
13
14
|
function getContentRoot() {
|
|
@@ -68,7 +69,8 @@ export async function GET(request) {
|
|
|
68
69
|
mdxSource = await serialize(content, {
|
|
69
70
|
mdxOptions: {
|
|
70
71
|
remarkPlugins: [
|
|
71
|
-
remarkGfm
|
|
72
|
+
remarkGfm,
|
|
73
|
+
remarkMermaid
|
|
72
74
|
],
|
|
73
75
|
rehypePlugins: [
|
|
74
76
|
rehypeSlug,
|
|
@@ -86,7 +88,8 @@ export async function GET(request) {
|
|
|
86
88
|
mdxSource = await serialize(content, {
|
|
87
89
|
mdxOptions: {
|
|
88
90
|
remarkPlugins: [
|
|
89
|
-
remarkGfm
|
|
91
|
+
remarkGfm,
|
|
92
|
+
remarkMermaid
|
|
90
93
|
],
|
|
91
94
|
rehypePlugins: [
|
|
92
95
|
rehypeSlug
|
|
@@ -149,7 +152,8 @@ export async function GET(request) {
|
|
|
149
152
|
mdxSource = await serialize(content, {
|
|
150
153
|
mdxOptions: {
|
|
151
154
|
remarkPlugins: [
|
|
152
|
-
remarkGfm
|
|
155
|
+
remarkGfm,
|
|
156
|
+
remarkMermaid
|
|
153
157
|
],
|
|
154
158
|
rehypePlugins: [
|
|
155
159
|
rehypeSlug,
|
|
@@ -167,7 +171,8 @@ export async function GET(request) {
|
|
|
167
171
|
mdxSource = await serialize(content, {
|
|
168
172
|
mdxOptions: {
|
|
169
173
|
remarkPlugins: [
|
|
170
|
-
remarkGfm
|
|
174
|
+
remarkGfm,
|
|
175
|
+
remarkMermaid
|
|
171
176
|
],
|
|
172
177
|
rehypePlugins: [
|
|
173
178
|
rehypeSlug
|
|
@@ -1642,77 +1642,124 @@ export function AgentChat({ collection, currentEndpoint, onNavigate, onPrefill,
|
|
|
1642
1642
|
]
|
|
1643
1643
|
})
|
|
1644
1644
|
}),
|
|
1645
|
-
/*#__PURE__*/
|
|
1645
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
1646
1646
|
className: "border-t border-border p-4",
|
|
1647
|
-
children:
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1647
|
+
children: [
|
|
1648
|
+
/*#__PURE__*/ _jsxs("form", {
|
|
1649
|
+
onSubmit: handleSubmit,
|
|
1650
|
+
className: "max-w-2xl mx-auto",
|
|
1651
|
+
children: [
|
|
1652
|
+
/*#__PURE__*/ _jsx("input", {
|
|
1653
|
+
ref: fileInputRef,
|
|
1654
|
+
type: "file",
|
|
1655
|
+
accept: "image/*",
|
|
1656
|
+
multiple: true,
|
|
1657
|
+
onChange: handleImageSelect,
|
|
1658
|
+
className: "hidden",
|
|
1659
|
+
"aria-hidden": "true"
|
|
1660
|
+
}),
|
|
1661
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
1662
|
+
className: "relative rounded-2xl border border-border bg-background shadow-sm focus-within:ring-2 focus-within:ring-ring",
|
|
1663
|
+
children: [
|
|
1664
|
+
selectedImages.length > 0 && /*#__PURE__*/ _jsx("div", {
|
|
1665
|
+
className: "flex flex-wrap gap-2 p-3 pb-0",
|
|
1666
|
+
children: selectedImages.map((img, index)=>/*#__PURE__*/ _jsxs("div", {
|
|
1667
|
+
className: "relative group",
|
|
1668
|
+
children: [
|
|
1669
|
+
/*#__PURE__*/ _jsx("img", {
|
|
1670
|
+
src: img.preview,
|
|
1671
|
+
alt: `Selected image ${index + 1}`,
|
|
1672
|
+
className: "h-16 w-16 object-cover rounded-lg border border-border"
|
|
1673
|
+
}),
|
|
1674
|
+
/*#__PURE__*/ _jsx(Button, {
|
|
1675
|
+
type: "button",
|
|
1676
|
+
size: "icon",
|
|
1677
|
+
variant: "secondary",
|
|
1678
|
+
onClick: ()=>handleRemoveImage(index),
|
|
1679
|
+
className: "absolute -top-1.5 -right-1.5 h-4 w-4 min-w-0 rounded-full opacity-0 group-hover:opacity-100 transition-opacity shadow-sm p-2",
|
|
1680
|
+
"aria-label": `Remove image ${index + 1}`,
|
|
1681
|
+
children: /*#__PURE__*/ _jsx(X, {
|
|
1682
|
+
className: "h-2.5 w-2.5 p-1",
|
|
1683
|
+
weight: "bold"
|
|
1684
|
+
})
|
|
1683
1685
|
})
|
|
1686
|
+
]
|
|
1687
|
+
}, index))
|
|
1688
|
+
}),
|
|
1689
|
+
/*#__PURE__*/ _jsx("textarea", {
|
|
1690
|
+
ref: textareaRef,
|
|
1691
|
+
value: inputValue,
|
|
1692
|
+
onChange: handleInputChange,
|
|
1693
|
+
onKeyDown: handleKeyDown,
|
|
1694
|
+
placeholder: "Send a message...",
|
|
1695
|
+
className: cn("w-full resize-none bg-transparent px-4 pt-3 pb-12 text-sm", "placeholder:text-muted-foreground/70 outline-none", "min-h-[56px] max-h-32"),
|
|
1696
|
+
rows: 1,
|
|
1697
|
+
disabled: isLoading,
|
|
1698
|
+
"aria-label": "Message input"
|
|
1699
|
+
}),
|
|
1700
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
1701
|
+
className: "absolute bottom-2 left-2 right-2 flex items-center justify-between",
|
|
1702
|
+
children: [
|
|
1703
|
+
/*#__PURE__*/ _jsx("div", {
|
|
1704
|
+
children: /*#__PURE__*/ _jsxs(Tooltip, {
|
|
1705
|
+
children: [
|
|
1706
|
+
/*#__PURE__*/ _jsx(TooltipTrigger, {
|
|
1707
|
+
asChild: true,
|
|
1708
|
+
children: /*#__PURE__*/ _jsx(Button, {
|
|
1709
|
+
type: "button",
|
|
1710
|
+
size: "icon",
|
|
1711
|
+
variant: "ghost",
|
|
1712
|
+
className: cn("h-8 w-8 rounded-full text-muted-foreground hover:text-foreground", selectedImages.length >= 4 && "opacity-50 cursor-not-allowed"),
|
|
1713
|
+
onClick: ()=>fileInputRef.current?.click(),
|
|
1714
|
+
disabled: isLoading || selectedImages.length >= 4,
|
|
1715
|
+
"aria-label": "Upload image",
|
|
1716
|
+
children: /*#__PURE__*/ _jsx(ImageIcon, {
|
|
1717
|
+
className: "h-4 w-4",
|
|
1718
|
+
weight: "bold"
|
|
1719
|
+
})
|
|
1720
|
+
})
|
|
1721
|
+
}),
|
|
1722
|
+
/*#__PURE__*/ _jsx(TooltipContent, {
|
|
1723
|
+
side: "top",
|
|
1724
|
+
children: selectedImages.length >= 4 ? 'Maximum 4 images' : 'Upload image'
|
|
1725
|
+
})
|
|
1726
|
+
]
|
|
1684
1727
|
})
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
}),
|
|
1688
|
-
/*#__PURE__*/ _jsx("textarea", {
|
|
1689
|
-
ref: textareaRef,
|
|
1690
|
-
value: inputValue,
|
|
1691
|
-
onChange: handleInputChange,
|
|
1692
|
-
onKeyDown: handleKeyDown,
|
|
1693
|
-
placeholder: "Send a message...",
|
|
1694
|
-
className: cn("w-full resize-none bg-transparent px-4 pt-3 pb-12 text-sm", "placeholder:text-muted-foreground/70 outline-none", "min-h-[56px] max-h-32"),
|
|
1695
|
-
rows: 1,
|
|
1696
|
-
disabled: isLoading,
|
|
1697
|
-
"aria-label": "Message input"
|
|
1698
|
-
}),
|
|
1699
|
-
/*#__PURE__*/ _jsxs("div", {
|
|
1700
|
-
className: "absolute bottom-2 left-2 right-2 flex items-center justify-between",
|
|
1701
|
-
children: [
|
|
1702
|
-
/*#__PURE__*/ _jsx("div", {
|
|
1703
|
-
children: /*#__PURE__*/ _jsxs(Tooltip, {
|
|
1728
|
+
}),
|
|
1729
|
+
isLoading ? /*#__PURE__*/ _jsxs(Tooltip, {
|
|
1704
1730
|
children: [
|
|
1705
1731
|
/*#__PURE__*/ _jsx(TooltipTrigger, {
|
|
1706
1732
|
asChild: true,
|
|
1707
1733
|
children: /*#__PURE__*/ _jsx(Button, {
|
|
1708
1734
|
type: "button",
|
|
1735
|
+
onClick: ()=>stop(),
|
|
1736
|
+
size: "icon",
|
|
1737
|
+
variant: "default",
|
|
1738
|
+
className: "h-8 w-8 rounded-full",
|
|
1739
|
+
"aria-label": "Stop generating",
|
|
1740
|
+
children: /*#__PURE__*/ _jsx(Square, {
|
|
1741
|
+
className: "h-3 w-3",
|
|
1742
|
+
weight: "fill"
|
|
1743
|
+
})
|
|
1744
|
+
})
|
|
1745
|
+
}),
|
|
1746
|
+
/*#__PURE__*/ _jsx(TooltipContent, {
|
|
1747
|
+
side: "top",
|
|
1748
|
+
children: "Stop generating"
|
|
1749
|
+
})
|
|
1750
|
+
]
|
|
1751
|
+
}) : /*#__PURE__*/ _jsxs(Tooltip, {
|
|
1752
|
+
children: [
|
|
1753
|
+
/*#__PURE__*/ _jsx(TooltipTrigger, {
|
|
1754
|
+
asChild: true,
|
|
1755
|
+
children: /*#__PURE__*/ _jsx(Button, {
|
|
1756
|
+
type: "submit",
|
|
1757
|
+
disabled: !inputValue.trim(),
|
|
1709
1758
|
size: "icon",
|
|
1710
|
-
variant: "
|
|
1711
|
-
className:
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
"aria-label": "Upload image",
|
|
1715
|
-
children: /*#__PURE__*/ _jsx(ImageIcon, {
|
|
1759
|
+
variant: "default",
|
|
1760
|
+
className: "h-8 w-8 rounded-full",
|
|
1761
|
+
"aria-label": "Send message",
|
|
1762
|
+
children: /*#__PURE__*/ _jsx(ArrowUp, {
|
|
1716
1763
|
className: "h-4 w-4",
|
|
1717
1764
|
weight: "bold"
|
|
1718
1765
|
})
|
|
@@ -1720,62 +1767,52 @@ export function AgentChat({ collection, currentEndpoint, onNavigate, onPrefill,
|
|
|
1720
1767
|
}),
|
|
1721
1768
|
/*#__PURE__*/ _jsx(TooltipContent, {
|
|
1722
1769
|
side: "top",
|
|
1723
|
-
children:
|
|
1770
|
+
children: "Send message"
|
|
1724
1771
|
})
|
|
1725
1772
|
]
|
|
1726
1773
|
})
|
|
1774
|
+
]
|
|
1775
|
+
})
|
|
1776
|
+
]
|
|
1777
|
+
})
|
|
1778
|
+
]
|
|
1779
|
+
}),
|
|
1780
|
+
/*#__PURE__*/ _jsx("div", {
|
|
1781
|
+
className: "flex justify-center mt-3",
|
|
1782
|
+
children: /*#__PURE__*/ _jsxs("a", {
|
|
1783
|
+
className: "flex items-center gap-2 text-muted-foreground hover:text-foreground transition-colors",
|
|
1784
|
+
href: "https://www.brainfi.sh",
|
|
1785
|
+
target: "_blank",
|
|
1786
|
+
rel: "noreferrer",
|
|
1787
|
+
children: [
|
|
1788
|
+
/*#__PURE__*/ _jsx("span", {
|
|
1789
|
+
className: "text-xs",
|
|
1790
|
+
children: "Powered by"
|
|
1791
|
+
}),
|
|
1792
|
+
/*#__PURE__*/ _jsxs("svg", {
|
|
1793
|
+
width: "80",
|
|
1794
|
+
height: "18",
|
|
1795
|
+
viewBox: "0 0 120 27",
|
|
1796
|
+
fill: "none",
|
|
1797
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1798
|
+
className: "opacity-70",
|
|
1799
|
+
children: [
|
|
1800
|
+
/*#__PURE__*/ _jsx("path", {
|
|
1801
|
+
d: "M20.0712 6.63753C15.8691 6.63753 11.8999 8.28409 8.70665 11.2953L5.19074 7.15534L5.18713 7.15109L5.18343 7.1469C4.73348 6.63593 4.13379 6.52089 3.66503 6.54945C3.43003 6.56377 3.21135 6.61394 3.02812 6.67866C2.85601 6.73944 2.67232 6.82826 2.53221 6.94734L2.53025 6.949L2.5283 6.9507C1.73873 7.63321 1.64523 8.82501 2.32549 9.62056C2.32584 9.62098 2.3262 9.6214 2.32656 9.62183L6.14722 14.1205L2.32461 18.6273L2.32385 18.6281C1.65444 19.4204 1.74221 20.6174 2.5283 21.296L2.52874 21.2964C3.32347 21.9829 4.50894 21.8874 5.18903 21.0934L5.18989 21.0924L5.19074 21.0913L8.70704 16.9509C11.8998 19.9568 15.8687 21.6092 20.0712 21.6092C24.9675 21.6092 29.5417 19.3736 32.9484 15.3552L32.9493 15.3542L32.9503 15.3531C33.5467 14.6433 33.5467 13.6035 32.9503 12.8936L32.9492 12.8924L32.9481 12.8912C29.5418 8.87973 24.9679 6.63753 20.0712 6.63753Z",
|
|
1802
|
+
className: "stroke-current",
|
|
1803
|
+
strokeWidth: "2",
|
|
1804
|
+
strokeLinecap: "square"
|
|
1727
1805
|
}),
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
asChild: true,
|
|
1732
|
-
children: /*#__PURE__*/ _jsx(Button, {
|
|
1733
|
-
type: "button",
|
|
1734
|
-
onClick: ()=>stop(),
|
|
1735
|
-
size: "icon",
|
|
1736
|
-
variant: "default",
|
|
1737
|
-
className: "h-8 w-8 rounded-full",
|
|
1738
|
-
"aria-label": "Stop generating",
|
|
1739
|
-
children: /*#__PURE__*/ _jsx(Square, {
|
|
1740
|
-
className: "h-3 w-3",
|
|
1741
|
-
weight: "fill"
|
|
1742
|
-
})
|
|
1743
|
-
})
|
|
1744
|
-
}),
|
|
1745
|
-
/*#__PURE__*/ _jsx(TooltipContent, {
|
|
1746
|
-
side: "top",
|
|
1747
|
-
children: "Stop generating"
|
|
1748
|
-
})
|
|
1749
|
-
]
|
|
1750
|
-
}) : /*#__PURE__*/ _jsxs(Tooltip, {
|
|
1751
|
-
children: [
|
|
1752
|
-
/*#__PURE__*/ _jsx(TooltipTrigger, {
|
|
1753
|
-
asChild: true,
|
|
1754
|
-
children: /*#__PURE__*/ _jsx(Button, {
|
|
1755
|
-
type: "submit",
|
|
1756
|
-
disabled: !inputValue.trim(),
|
|
1757
|
-
size: "icon",
|
|
1758
|
-
variant: "default",
|
|
1759
|
-
className: "h-8 w-8 rounded-full",
|
|
1760
|
-
"aria-label": "Send message",
|
|
1761
|
-
children: /*#__PURE__*/ _jsx(ArrowUp, {
|
|
1762
|
-
className: "h-4 w-4",
|
|
1763
|
-
weight: "bold"
|
|
1764
|
-
})
|
|
1765
|
-
})
|
|
1766
|
-
}),
|
|
1767
|
-
/*#__PURE__*/ _jsx(TooltipContent, {
|
|
1768
|
-
side: "top",
|
|
1769
|
-
children: "Send message"
|
|
1770
|
-
})
|
|
1771
|
-
]
|
|
1806
|
+
/*#__PURE__*/ _jsx("path", {
|
|
1807
|
+
d: "M43.1303 6.61284V21.1949H40.5769V6.61284H43.1303ZM46.3618 14.991H42.3523V12.8366H46.2222C46.9271 12.8366 47.4657 12.6638 47.838 12.318C48.2105 11.9589 48.3965 11.4536 48.3965 10.8019C48.3965 10.1769 48.2038 9.69813 47.818 9.36567C47.4325 9.03321 46.8739 8.86697 46.1424 8.86697H42.2725V6.61284H46.3618C47.8115 6.61284 48.9485 6.96525 49.773 7.67009C50.5975 8.37492 51.0097 9.33907 51.0097 10.5626C51.0097 11.4403 50.797 12.1783 50.3714 12.7768C49.9459 13.3619 49.3141 13.7875 48.4763 14.0535V13.7742C49.3807 13.987 50.0656 14.3859 50.531 14.9711C50.9965 15.5562 51.2292 16.3143 51.2292 17.2452C51.2292 18.0697 51.0431 18.7812 50.6706 19.3796C50.2983 19.9648 49.753 20.4169 49.0349 20.7361C48.3302 21.042 47.4789 21.1949 46.4815 21.1949H42.2725V18.9407H46.3618C47.0934 18.9407 47.6519 18.7679 48.0375 18.4221C48.4232 18.0763 48.616 17.5776 48.616 16.926C48.616 16.3143 48.4165 15.8421 48.0175 15.5097C47.632 15.1639 47.08 14.991 46.3618 14.991ZM59.3952 11.3006V13.5548H58.4976C57.6066 13.5548 56.9084 13.7941 56.403 14.2729C55.8978 14.7384 55.645 15.4498 55.645 16.4073V21.1949H53.2113V11.3605H55.5054L55.7049 13.3952H55.4655C55.5986 12.7435 55.911 12.2116 56.403 11.7993C56.8952 11.3871 57.5335 11.1809 58.318 11.1809C58.491 11.1809 58.6639 11.1876 58.8367 11.2009C59.0097 11.2142 59.1958 11.2474 59.3952 11.3006ZM63.5853 21.4542C62.548 21.4542 61.7236 21.1749 61.1117 20.6164C60.5133 20.0446 60.214 19.2998 60.214 18.3822C60.214 17.4778 60.5267 16.7597 61.1516 16.2278C61.7899 15.6825 62.6943 15.3634 63.8645 15.2703L66.8169 15.0309V14.8115C66.8169 14.3593 66.7305 14.0003 66.5575 13.7343C66.3979 13.455 66.1653 13.2555 65.8593 13.1359C65.5536 13.0029 65.1945 12.9364 64.7822 12.9364C64.064 12.9364 63.5122 13.0827 63.1265 13.3752C62.7409 13.6545 62.548 14.0535 62.548 14.5721H60.4734C60.4734 13.854 60.6529 13.2356 61.012 12.7169C61.3844 12.185 61.9031 11.7727 62.5679 11.4802C63.2461 11.1876 64.0241 11.0413 64.9018 11.0413C65.793 11.0413 66.5575 11.2009 67.1959 11.5201C67.8342 11.8259 68.3264 12.2914 68.672 12.9164C69.0178 13.5282 69.1907 14.2928 69.1907 15.2104V21.1949H67.0562L66.8767 19.7387C66.664 20.2441 66.2518 20.6563 65.6399 20.9754C65.0415 21.2946 64.3567 21.4542 63.5853 21.4542ZM64.3632 19.619C65.1213 19.619 65.7197 19.4062 66.1586 18.9806C66.6108 18.555 66.8368 17.9633 66.8368 17.2053V16.6866L64.7822 16.8462C64.0241 16.9127 63.4855 17.0723 63.1664 17.3249C62.8472 17.5643 62.6876 17.8835 62.6876 18.2824C62.6876 18.7213 62.8339 19.0537 63.1265 19.2799C63.4191 19.506 63.8313 19.619 64.3632 19.619ZM71.5815 21.1949V11.3405H74.0151V21.1949H71.5815ZM72.7784 9.36567C72.3661 9.36567 72.0138 9.22603 71.7211 8.94676C71.4418 8.6542 71.3022 8.30177 71.3022 7.88952C71.3022 7.47726 71.4418 7.13149 71.7211 6.85222C72.0138 6.57294 72.3661 6.43331 72.7784 6.43331C73.1907 6.43331 73.5364 6.57294 73.8157 6.85222C74.1083 7.13149 74.2545 7.47726 74.2545 7.88952C74.2545 8.30177 74.1083 8.6542 73.8157 8.94676C73.5364 9.22603 73.1907 9.36567 72.7784 9.36567ZM78.9632 21.1949H76.5295V11.3405H78.7837L78.9831 12.6172C79.2891 12.1252 79.7212 11.7395 80.2798 11.4602C80.8517 11.1809 81.4701 11.0413 82.1349 11.0413C83.3717 11.0413 84.3027 11.407 84.9277 12.1385C85.566 12.8699 85.8852 13.8673 85.8852 15.1307V21.1949H83.4515V15.7092C83.4515 14.8846 83.2654 14.2729 82.893 13.8739C82.5206 13.4617 82.0152 13.2555 81.3769 13.2555C80.6189 13.2555 80.0271 13.4949 79.6015 13.9737C79.1761 14.4524 78.9632 15.0908 78.9632 15.8887V21.1949ZM87.2988 11.3405H97.592V13.3752H87.2988V11.3405ZM93.363 6.45326V8.52785C93.2169 8.52785 93.0705 8.52785 92.9242 8.52785C92.7912 8.52785 92.6516 8.52785 92.5053 8.52785C91.9601 8.52785 91.5944 8.67414 91.4081 8.96671C91.222 9.25928 91.1289 9.6516 91.1289 10.1436V21.1949H88.7151V10.1436C88.7151 9.23933 88.8548 8.51456 89.134 7.96931C89.4267 7.41076 89.8257 7.00515 90.3309 6.75248C90.8496 6.4865 91.4415 6.35352 92.1063 6.35352C92.3058 6.35352 92.512 6.36017 92.7247 6.37346C92.9376 6.38676 93.1503 6.41336 93.363 6.45326ZM95.1584 21.1949V11.3405H97.592V21.1949H95.1584ZM96.3752 9.32578C95.963 9.32578 95.6172 9.18614 95.3379 8.90687C95.0586 8.62759 94.919 8.28182 94.919 7.86957C94.919 7.47061 95.0586 7.13149 95.3379 6.85222C95.6172 6.57294 95.963 6.43331 96.3752 6.43331C96.7742 6.43331 97.1133 6.57294 97.3925 6.85222C97.6718 7.13149 97.8114 7.47061 97.8114 7.86957C97.8114 8.28182 97.6718 8.62759 97.3925 8.90687C97.1133 9.18614 96.7742 9.32578 96.3752 9.32578ZM99.3429 18.2027H101.657C101.67 18.6283 101.83 18.9674 102.136 19.22C102.442 19.4726 102.867 19.599 103.412 19.599C103.998 19.599 104.436 19.4926 104.729 19.2799C105.035 19.0671 105.188 18.7812 105.188 18.4221C105.188 18.1827 105.108 17.97 104.948 17.7837C104.789 17.5975 104.49 17.4579 104.051 17.3648L102.275 16.9459C101.384 16.7465 100.719 16.4273 100.28 15.9884C99.855 15.5363 99.6422 14.9179 99.6422 14.1333C99.6422 13.4949 99.8084 12.943 100.141 12.4776C100.487 12.0121 100.952 11.6597 101.537 11.4203C102.122 11.1677 102.794 11.0413 103.552 11.0413C104.284 11.0413 104.928 11.1743 105.487 11.4403C106.045 11.7062 106.478 12.0786 106.784 12.5574C107.103 13.0361 107.269 13.5947 107.282 14.233H104.968C104.968 13.8074 104.835 13.475 104.569 13.2356C104.303 12.9829 103.931 12.8566 103.452 12.8566C102.973 12.8566 102.601 12.963 102.335 13.1757C102.069 13.3885 101.936 13.6744 101.936 14.0335C101.936 14.5788 102.362 14.9511 103.213 15.1506L104.988 15.5695C105.813 15.7557 106.431 16.055 106.843 16.4672C107.269 16.8794 107.482 17.4646 107.482 18.2226C107.482 18.8876 107.309 19.4661 106.963 19.9581C106.617 20.4368 106.132 20.8091 105.507 21.0752C104.882 21.3278 104.164 21.4542 103.352 21.4542C102.129 21.4542 101.152 21.155 100.42 20.5565C99.702 19.9581 99.3429 19.1734 99.3429 18.2027ZM111.768 21.1949H109.335V6.35352H111.788V12.6172C112.094 12.1385 112.52 11.7594 113.065 11.4802C113.624 11.1876 114.262 11.0413 114.98 11.0413C116.19 11.0413 117.108 11.407 117.733 12.1385C118.371 12.8699 118.69 13.8673 118.69 15.1307V21.1949H116.257V15.7092C116.257 15.1506 116.17 14.6918 115.997 14.3327C115.825 13.9737 115.585 13.7077 115.279 13.5348C114.973 13.3486 114.614 13.2555 114.202 13.2555C113.697 13.2555 113.258 13.3686 112.885 13.5947C112.526 13.8074 112.247 14.1067 112.048 14.4923C111.862 14.878 111.768 15.3168 111.768 15.8089V21.1949Z",
|
|
1808
|
+
className: "fill-current"
|
|
1772
1809
|
})
|
|
1773
1810
|
]
|
|
1774
1811
|
})
|
|
1775
1812
|
]
|
|
1776
1813
|
})
|
|
1777
|
-
|
|
1778
|
-
|
|
1814
|
+
})
|
|
1815
|
+
]
|
|
1779
1816
|
})
|
|
1780
1817
|
]
|
|
1781
1818
|
});
|
|
@@ -6,6 +6,7 @@ import { MDXRemote } from 'next-mdx-remote';
|
|
|
6
6
|
import { useDocsNavigation } from '@/lib/docs-navigation-context';
|
|
7
7
|
import { useCodeCopy } from '@/hooks/use-code-copy';
|
|
8
8
|
import { NotFoundPage } from './not-found-page';
|
|
9
|
+
import { MDXErrorBoundary } from './mdx-error-boundary';
|
|
9
10
|
// Custom Link component for MDX - uses docs navigation context
|
|
10
11
|
function MdxLink({ href, children, ...props }) {
|
|
11
12
|
const docsNav = useDocsNavigation();
|
|
@@ -213,29 +214,65 @@ export function DocPage({ slug, onSearch }) {
|
|
|
213
214
|
const showHeader = !hideHeader && !isCustomMode;
|
|
214
215
|
// Custom mode: Full-width layout for landing pages
|
|
215
216
|
if (isCustomMode) {
|
|
216
|
-
return /*#__PURE__*/ _jsx(
|
|
217
|
-
|
|
218
|
-
className: "docs-page docs-page-custom docs-content w-full min-h-full",
|
|
219
|
-
style: {
|
|
220
|
-
background: background || 'var(--background)',
|
|
221
|
-
// Ensure the content fills the entire viewport width within the content area
|
|
222
|
-
marginLeft: 0,
|
|
223
|
-
marginRight: 0
|
|
224
|
-
},
|
|
217
|
+
return /*#__PURE__*/ _jsx(MDXErrorBoundary, {
|
|
218
|
+
slug: slug,
|
|
225
219
|
children: /*#__PURE__*/ _jsx("div", {
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
220
|
+
ref: contentRef,
|
|
221
|
+
className: "docs-page docs-page-custom docs-content w-full min-h-full",
|
|
222
|
+
style: {
|
|
223
|
+
background: background || 'var(--background)',
|
|
224
|
+
// Ensure the content fills the entire viewport width within the content area
|
|
225
|
+
marginLeft: 0,
|
|
226
|
+
marginRight: 0
|
|
227
|
+
},
|
|
228
|
+
children: /*#__PURE__*/ _jsx("div", {
|
|
229
|
+
className: "docs-custom-content [&>*]:w-full",
|
|
230
|
+
children: /*#__PURE__*/ _jsx(MDXRemote, {
|
|
231
|
+
...pageData.mdxSource,
|
|
232
|
+
components: mdxComponents
|
|
233
|
+
})
|
|
230
234
|
})
|
|
231
235
|
})
|
|
232
236
|
});
|
|
233
237
|
}
|
|
234
238
|
// Wide mode: No prose wrapper (for landing pages with custom components)
|
|
235
239
|
if (isWideMode) {
|
|
236
|
-
return /*#__PURE__*/
|
|
240
|
+
return /*#__PURE__*/ _jsx(MDXErrorBoundary, {
|
|
241
|
+
slug: slug,
|
|
242
|
+
children: /*#__PURE__*/ _jsxs("div", {
|
|
243
|
+
ref: contentRef,
|
|
244
|
+
className: "docs-page docs-content max-w-6xl mx-auto px-4 py-6 sm:px-8 sm:py-8",
|
|
245
|
+
children: [
|
|
246
|
+
showHeader && /*#__PURE__*/ _jsxs("div", {
|
|
247
|
+
className: "docs-page-header mb-6",
|
|
248
|
+
children: [
|
|
249
|
+
/*#__PURE__*/ _jsx("h1", {
|
|
250
|
+
className: "docs-content-title text-2xl sm:text-3xl font-bold mb-2 text-foreground",
|
|
251
|
+
children: pageData.frontmatter.title
|
|
252
|
+
}),
|
|
253
|
+
pageData.frontmatter.description && /*#__PURE__*/ _jsx("p", {
|
|
254
|
+
className: "docs-content-description text-lg text-muted-foreground",
|
|
255
|
+
children: pageData.frontmatter.description
|
|
256
|
+
})
|
|
257
|
+
]
|
|
258
|
+
}),
|
|
259
|
+
/*#__PURE__*/ _jsx("div", {
|
|
260
|
+
className: "docs-wide-content",
|
|
261
|
+
children: /*#__PURE__*/ _jsx(MDXRemote, {
|
|
262
|
+
...pageData.mdxSource,
|
|
263
|
+
components: mdxComponents
|
|
264
|
+
})
|
|
265
|
+
})
|
|
266
|
+
]
|
|
267
|
+
})
|
|
268
|
+
});
|
|
269
|
+
}
|
|
270
|
+
// Default mode: Standard documentation layout with prose
|
|
271
|
+
return /*#__PURE__*/ _jsx(MDXErrorBoundary, {
|
|
272
|
+
slug: slug,
|
|
273
|
+
children: /*#__PURE__*/ _jsxs("div", {
|
|
237
274
|
ref: contentRef,
|
|
238
|
-
className: "docs-page docs-content max-w-
|
|
275
|
+
className: "docs-page docs-content max-w-4xl mx-auto px-4 py-6 sm:px-8 sm:py-8",
|
|
239
276
|
children: [
|
|
240
277
|
showHeader && /*#__PURE__*/ _jsxs("div", {
|
|
241
278
|
className: "docs-page-header mb-6",
|
|
@@ -251,40 +288,13 @@ export function DocPage({ slug, onSearch }) {
|
|
|
251
288
|
]
|
|
252
289
|
}),
|
|
253
290
|
/*#__PURE__*/ _jsx("div", {
|
|
254
|
-
className: "docs-
|
|
291
|
+
className: "docs-prose prose prose-sm max-w-none prose-headings:text-foreground prose-p:text-muted-foreground prose-strong:text-foreground prose-code:text-foreground prose-pre:bg-muted prose-code:bg-muted prose-code:px-1 prose-code:py-0.5 prose-code:rounded prose-pre:overflow-x-auto prose-table:w-full prose-th:text-left prose-th:p-3 prose-th:bg-muted prose-td:p-3 prose-td:border-b prose-td:border-border",
|
|
255
292
|
children: /*#__PURE__*/ _jsx(MDXRemote, {
|
|
256
293
|
...pageData.mdxSource,
|
|
257
294
|
components: mdxComponents
|
|
258
295
|
})
|
|
259
296
|
})
|
|
260
297
|
]
|
|
261
|
-
})
|
|
262
|
-
}
|
|
263
|
-
// Default mode: Standard documentation layout with prose
|
|
264
|
-
return /*#__PURE__*/ _jsxs("div", {
|
|
265
|
-
ref: contentRef,
|
|
266
|
-
className: "docs-page docs-content max-w-4xl mx-auto px-4 py-6 sm:px-8 sm:py-8",
|
|
267
|
-
children: [
|
|
268
|
-
showHeader && /*#__PURE__*/ _jsxs("div", {
|
|
269
|
-
className: "docs-page-header mb-6",
|
|
270
|
-
children: [
|
|
271
|
-
/*#__PURE__*/ _jsx("h1", {
|
|
272
|
-
className: "docs-content-title text-2xl sm:text-3xl font-bold mb-2 text-foreground",
|
|
273
|
-
children: pageData.frontmatter.title
|
|
274
|
-
}),
|
|
275
|
-
pageData.frontmatter.description && /*#__PURE__*/ _jsx("p", {
|
|
276
|
-
className: "docs-content-description text-lg text-muted-foreground",
|
|
277
|
-
children: pageData.frontmatter.description
|
|
278
|
-
})
|
|
279
|
-
]
|
|
280
|
-
}),
|
|
281
|
-
/*#__PURE__*/ _jsx("div", {
|
|
282
|
-
className: "docs-prose prose prose-sm max-w-none prose-headings:text-foreground prose-p:text-muted-foreground prose-strong:text-foreground prose-code:text-foreground prose-pre:bg-muted prose-code:bg-muted prose-code:px-1 prose-code:py-0.5 prose-code:rounded prose-pre:overflow-x-auto prose-table:w-full prose-th:text-left prose-th:p-3 prose-th:bg-muted prose-td:p-3 prose-td:border-b prose-td:border-border",
|
|
283
|
-
children: /*#__PURE__*/ _jsx(MDXRemote, {
|
|
284
|
-
...pageData.mdxSource,
|
|
285
|
-
components: mdxComponents
|
|
286
|
-
})
|
|
287
|
-
})
|
|
288
|
-
]
|
|
298
|
+
})
|
|
289
299
|
});
|
|
290
300
|
}
|