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.
- package/dist/cli.mjs +50 -174
- package/dist/cli.mjs.map +1 -1
- package/package.json +3 -36
- package/dev-server/app/[[...slug]]/page.tsx +0 -140
- package/dev-server/app/blodemd-dev/invalidate/route.ts +0 -12
- package/dev-server/app/blodemd-dev/static/[...path]/route.ts +0 -32
- package/dev-server/app/blodemd-dev/version/route.ts +0 -14
- package/dev-server/app/blodemd-internal/proxy/route.ts +0 -86
- package/dev-server/app/error.tsx +0 -24
- package/dev-server/app/favicon.ico +0 -0
- package/dev-server/app/globals.css +0 -4
- package/dev-server/app/layout.tsx +0 -38
- package/dev-server/app/not-found.tsx +0 -18
- package/dev-server/app/search/route.ts +0 -17
- package/dev-server/components/dev-reload-script.tsx +0 -86
- package/dev-server/components/providers.tsx +0 -15
- package/dev-server/lib/dev-state.ts +0 -8
- package/dev-server/lib/local-content-source.ts +0 -103
- package/dev-server/lib/local-runtime.tsx +0 -555
- package/dev-server/next-env.d.ts +0 -5
- package/dev-server/next.config.js +0 -54
- package/dev-server/package.json +0 -61
- package/dev-server/postcss.config.mjs +0 -7
- package/dev-server/public/glide-variable.woff2 +0 -0
- package/dev-server/tsconfig.json +0 -50
- package/docs/app/globals.css +0 -471
- package/docs/components/animate-ui/primitives/buttons/button.tsx +0 -14
- package/docs/components/api/api-playground.tsx +0 -467
- package/docs/components/api/api-reference.tsx +0 -157
- package/docs/components/content/collection-index.tsx +0 -114
- package/docs/components/docs/contextual-menu.tsx +0 -495
- package/docs/components/docs/copy-page-menu.tsx +0 -364
- package/docs/components/docs/doc-header.tsx +0 -223
- package/docs/components/docs/doc-shell.tsx +0 -355
- package/docs/components/docs/doc-sidebar.tsx +0 -256
- package/docs/components/docs/doc-toc.tsx +0 -46
- package/docs/components/docs/mobile-nav.tsx +0 -195
- package/docs/components/docs/sidebar-active-highlight.tsx +0 -34
- package/docs/components/docs/sidebar-scroll-area.tsx +0 -63
- package/docs/components/git/repo-picker.tsx +0 -529
- package/docs/components/icons/doc-icon.tsx +0 -96
- package/docs/components/mdx/accordion.tsx +0 -83
- package/docs/components/mdx/agent-instructions.tsx +0 -17
- package/docs/components/mdx/badge.tsx +0 -79
- package/docs/components/mdx/callout.tsx +0 -88
- package/docs/components/mdx/card.tsx +0 -110
- package/docs/components/mdx/code-block.tsx +0 -80
- package/docs/components/mdx/code-group.tsx +0 -203
- package/docs/components/mdx/color.tsx +0 -87
- package/docs/components/mdx/columns.tsx +0 -25
- package/docs/components/mdx/expandable.tsx +0 -45
- package/docs/components/mdx/field-layout.tsx +0 -77
- package/docs/components/mdx/frame.tsx +0 -23
- package/docs/components/mdx/get-text-content.ts +0 -18
- package/docs/components/mdx/icon.tsx +0 -12
- package/docs/components/mdx/iframe.tsx +0 -62
- package/docs/components/mdx/index.tsx +0 -121
- package/docs/components/mdx/installer.tsx +0 -20
- package/docs/components/mdx/panel.tsx +0 -11
- package/docs/components/mdx/param-field.tsx +0 -56
- package/docs/components/mdx/preview.tsx +0 -36
- package/docs/components/mdx/prompt.tsx +0 -63
- package/docs/components/mdx/request-example.tsx +0 -27
- package/docs/components/mdx/response-field.tsx +0 -42
- package/docs/components/mdx/steps.tsx +0 -92
- package/docs/components/mdx/tabs.tsx +0 -193
- package/docs/components/mdx/tile.tsx +0 -43
- package/docs/components/mdx/tooltip.tsx +0 -71
- package/docs/components/mdx/tree.tsx +0 -120
- package/docs/components/mdx/type-table.tsx +0 -71
- package/docs/components/mdx/update.tsx +0 -44
- package/docs/components/mdx/video.tsx +0 -45
- package/docs/components/mdx/view.tsx +0 -66
- package/docs/components/posthog-provider.tsx +0 -42
- package/docs/components/providers.tsx +0 -15
- package/docs/components/tenant-analytics.tsx +0 -49
- package/docs/components/third-parties.tsx +0 -32
- package/docs/components/ui/badge.tsx +0 -61
- package/docs/components/ui/breadcrumb.tsx +0 -112
- package/docs/components/ui/button-group.tsx +0 -83
- package/docs/components/ui/button.tsx +0 -65
- package/docs/components/ui/card.tsx +0 -92
- package/docs/components/ui/command.tsx +0 -167
- package/docs/components/ui/copy-button.tsx +0 -129
- package/docs/components/ui/dialog.tsx +0 -146
- package/docs/components/ui/field.tsx +0 -237
- package/docs/components/ui/input.tsx +0 -23
- package/docs/components/ui/kbd.tsx +0 -98
- package/docs/components/ui/label.tsx +0 -22
- package/docs/components/ui/morph-icon.tsx +0 -79
- package/docs/components/ui/popover.tsx +0 -267
- package/docs/components/ui/search-dialog.tsx +0 -431
- package/docs/components/ui/search.tsx +0 -101
- package/docs/components/ui/separator.tsx +0 -26
- package/docs/components/ui/sheet.tsx +0 -133
- package/docs/components/ui/sidebar.tsx +0 -758
- package/docs/components/ui/skeleton.tsx +0 -11
- package/docs/components/ui/switch.tsx +0 -32
- package/docs/components/ui/tabs.tsx +0 -138
- package/docs/components/ui/theme-toggle.tsx +0 -62
- package/docs/components/ui/tooltip.tsx +0 -53
- package/docs/components/web-mcp.tsx +0 -115
- package/docs/lib/agent-skills.ts +0 -48
- package/docs/lib/api-client.ts +0 -72
- package/docs/lib/config.ts +0 -6
- package/docs/lib/content-root.ts +0 -33
- package/docs/lib/content-source.ts +0 -70
- package/docs/lib/contextual-options.ts +0 -222
- package/docs/lib/dashboard-session.ts +0 -167
- package/docs/lib/db.ts +0 -13
- package/docs/lib/docs-collection.ts +0 -7
- package/docs/lib/docs-runtime.tsx +0 -745
- package/docs/lib/edge-config.ts +0 -95
- package/docs/lib/env.ts +0 -23
- package/docs/lib/etag.ts +0 -22
- package/docs/lib/github-install.ts +0 -33
- package/docs/lib/llms-full.ts +0 -82
- package/docs/lib/marketing-markdown.ts +0 -79
- package/docs/lib/marketing-site.ts +0 -31
- package/docs/lib/mdx.ts +0 -98
- package/docs/lib/navigation.ts +0 -288
- package/docs/lib/openapi-proxy.ts +0 -88
- package/docs/lib/openapi.ts +0 -158
- package/docs/lib/platform-config.ts +0 -6
- package/docs/lib/project-authz.ts +0 -46
- package/docs/lib/routes.ts +0 -103
- package/docs/lib/server-cache.ts +0 -83
- package/docs/lib/shiki.ts +0 -44
- package/docs/lib/supabase.ts +0 -37
- package/docs/lib/tenancy.ts +0 -364
- package/docs/lib/tenant-headers.ts +0 -43
- package/docs/lib/tenant-static.ts +0 -705
- package/docs/lib/tenant-utility-context.ts +0 -62
- package/docs/lib/tenants.ts +0 -72
- package/docs/lib/theme.ts +0 -29
- package/docs/lib/time-ago.ts +0 -24
- package/docs/lib/toc.ts +0 -2
- package/docs/lib/use-mobile.ts +0 -19
- package/docs/lib/use-tab-observer.ts +0 -71
- package/docs/lib/utils.ts +0 -5
- package/packages/@repo/common/dist/index.d.ts +0 -16
- package/packages/@repo/common/dist/index.d.ts.map +0 -1
- package/packages/@repo/common/dist/index.js +0 -84
- package/packages/@repo/common/package.json +0 -34
- package/packages/@repo/common/src/index.ts +0 -101
- package/packages/@repo/contracts/dist/analytics.d.ts +0 -21
- package/packages/@repo/contracts/dist/analytics.d.ts.map +0 -1
- package/packages/@repo/contracts/dist/analytics.js +0 -18
- package/packages/@repo/contracts/dist/api-key.d.ts +0 -27
- package/packages/@repo/contracts/dist/api-key.d.ts.map +0 -1
- package/packages/@repo/contracts/dist/api-key.js +0 -20
- package/packages/@repo/contracts/dist/dates.d.ts +0 -4
- package/packages/@repo/contracts/dist/dates.d.ts.map +0 -1
- package/packages/@repo/contracts/dist/dates.js +0 -2
- package/packages/@repo/contracts/dist/deployment.d.ts +0 -71
- package/packages/@repo/contracts/dist/deployment.d.ts.map +0 -1
- package/packages/@repo/contracts/dist/deployment.js +0 -46
- package/packages/@repo/contracts/dist/domain.d.ts +0 -94
- package/packages/@repo/contracts/dist/domain.d.ts.map +0 -1
- package/packages/@repo/contracts/dist/domain.js +0 -36
- package/packages/@repo/contracts/dist/git.d.ts +0 -28
- package/packages/@repo/contracts/dist/git.d.ts.map +0 -1
- package/packages/@repo/contracts/dist/git.js +0 -24
- package/packages/@repo/contracts/dist/ids.d.ts +0 -14
- package/packages/@repo/contracts/dist/ids.d.ts.map +0 -1
- package/packages/@repo/contracts/dist/ids.js +0 -11
- package/packages/@repo/contracts/dist/index.d.ts +0 -12
- package/packages/@repo/contracts/dist/index.d.ts.map +0 -1
- package/packages/@repo/contracts/dist/index.js +0 -13
- package/packages/@repo/contracts/dist/pagination.d.ts +0 -23
- package/packages/@repo/contracts/dist/pagination.d.ts.map +0 -1
- package/packages/@repo/contracts/dist/pagination.js +0 -15
- package/packages/@repo/contracts/dist/project.d.ts +0 -42
- package/packages/@repo/contracts/dist/project.d.ts.map +0 -1
- package/packages/@repo/contracts/dist/project.js +0 -25
- package/packages/@repo/contracts/dist/tenant.d.ts +0 -147
- package/packages/@repo/contracts/dist/tenant.d.ts.map +0 -1
- package/packages/@repo/contracts/dist/tenant.js +0 -58
- package/packages/@repo/contracts/dist/user.d.ts +0 -9
- package/packages/@repo/contracts/dist/user.d.ts.map +0 -1
- package/packages/@repo/contracts/dist/user.js +0 -9
- package/packages/@repo/contracts/package.json +0 -37
- package/packages/@repo/contracts/src/analytics.ts +0 -33
- package/packages/@repo/contracts/src/api-key.ts +0 -27
- package/packages/@repo/contracts/src/dates.ts +0 -4
- package/packages/@repo/contracts/src/deployment.ts +0 -73
- package/packages/@repo/contracts/src/domain.ts +0 -51
- package/packages/@repo/contracts/src/git.ts +0 -31
- package/packages/@repo/contracts/src/ids.ts +0 -23
- package/packages/@repo/contracts/src/index.ts +0 -13
- package/packages/@repo/contracts/src/pagination.ts +0 -21
- package/packages/@repo/contracts/src/project.ts +0 -32
- package/packages/@repo/contracts/src/tenant.ts +0 -94
- package/packages/@repo/contracts/src/user.ts +0 -12
- package/packages/@repo/models/dist/docs-config.d.ts +0 -961
- package/packages/@repo/models/dist/docs-config.d.ts.map +0 -1
- package/packages/@repo/models/dist/docs-config.js +0 -531
- package/packages/@repo/models/dist/index.d.ts +0 -3
- package/packages/@repo/models/dist/index.d.ts.map +0 -1
- package/packages/@repo/models/dist/index.js +0 -3
- package/packages/@repo/models/dist/tenant.d.ts +0 -37
- package/packages/@repo/models/dist/tenant.d.ts.map +0 -1
- package/packages/@repo/models/dist/tenant.js +0 -1
- package/packages/@repo/models/package.json +0 -37
- package/packages/@repo/models/src/docs-config.ts +0 -629
- package/packages/@repo/models/src/index.ts +0 -3
- package/packages/@repo/models/src/tenant.ts +0 -44
- package/packages/@repo/prebuild/dist/index.d.ts +0 -2
- package/packages/@repo/prebuild/dist/index.d.ts.map +0 -1
- package/packages/@repo/prebuild/dist/index.js +0 -2
- package/packages/@repo/prebuild/dist/openapi.d.ts +0 -43
- package/packages/@repo/prebuild/dist/openapi.d.ts.map +0 -1
- package/packages/@repo/prebuild/dist/openapi.js +0 -86
- package/packages/@repo/prebuild/package.json +0 -39
- package/packages/@repo/prebuild/src/index.ts +0 -2
- package/packages/@repo/prebuild/src/openapi.ts +0 -154
- package/packages/@repo/previewing/dist/blob-source.d.ts +0 -16
- package/packages/@repo/previewing/dist/blob-source.d.ts.map +0 -1
- package/packages/@repo/previewing/dist/blob-source.js +0 -128
- package/packages/@repo/previewing/dist/config-loader.d.ts +0 -134
- package/packages/@repo/previewing/dist/config-loader.d.ts.map +0 -1
- package/packages/@repo/previewing/dist/config-loader.js +0 -231
- package/packages/@repo/previewing/dist/constants.d.ts +0 -15
- package/packages/@repo/previewing/dist/constants.d.ts.map +0 -1
- package/packages/@repo/previewing/dist/constants.js +0 -14
- package/packages/@repo/previewing/dist/content-index.d.ts +0 -7
- package/packages/@repo/previewing/dist/content-index.d.ts.map +0 -1
- package/packages/@repo/previewing/dist/content-index.js +0 -291
- package/packages/@repo/previewing/dist/content-source.d.ts +0 -12
- package/packages/@repo/previewing/dist/content-source.d.ts.map +0 -1
- package/packages/@repo/previewing/dist/content-source.js +0 -1
- package/packages/@repo/previewing/dist/fs-source.d.ts +0 -11
- package/packages/@repo/previewing/dist/fs-source.d.ts.map +0 -1
- package/packages/@repo/previewing/dist/fs-source.js +0 -71
- package/packages/@repo/previewing/dist/index.d.ts +0 -16
- package/packages/@repo/previewing/dist/index.d.ts.map +0 -1
- package/packages/@repo/previewing/dist/index.js +0 -13
- package/packages/@repo/previewing/dist/markdown/agent-markdown.d.ts +0 -3
- package/packages/@repo/previewing/dist/markdown/agent-markdown.d.ts.map +0 -1
- package/packages/@repo/previewing/dist/markdown/agent-markdown.js +0 -176
- package/packages/@repo/previewing/dist/markdown/format.d.ts +0 -8
- package/packages/@repo/previewing/dist/markdown/format.d.ts.map +0 -1
- package/packages/@repo/previewing/dist/markdown/format.js +0 -43
- package/packages/@repo/previewing/dist/markdown/links.d.ts +0 -3
- package/packages/@repo/previewing/dist/markdown/links.d.ts.map +0 -1
- package/packages/@repo/previewing/dist/markdown/links.js +0 -31
- package/packages/@repo/previewing/dist/openapi-pages.d.ts +0 -7
- package/packages/@repo/previewing/dist/openapi-pages.d.ts.map +0 -1
- package/packages/@repo/previewing/dist/openapi-pages.js +0 -200
- package/packages/@repo/previewing/dist/search-index.d.ts +0 -4
- package/packages/@repo/previewing/dist/search-index.d.ts.map +0 -1
- package/packages/@repo/previewing/dist/search-index.js +0 -23
- package/packages/@repo/previewing/dist/serialization.d.ts +0 -13
- package/packages/@repo/previewing/dist/serialization.d.ts.map +0 -1
- package/packages/@repo/previewing/dist/serialization.js +0 -108
- package/packages/@repo/previewing/dist/toc-index.d.ts +0 -5
- package/packages/@repo/previewing/dist/toc-index.d.ts.map +0 -1
- package/packages/@repo/previewing/dist/toc-index.js +0 -53
- package/packages/@repo/previewing/dist/types.d.ts +0 -92
- package/packages/@repo/previewing/dist/types.d.ts.map +0 -1
- package/packages/@repo/previewing/dist/types.js +0 -1
- package/packages/@repo/previewing/dist/utility-index.d.ts +0 -7
- package/packages/@repo/previewing/dist/utility-index.d.ts.map +0 -1
- package/packages/@repo/previewing/dist/utility-index.js +0 -201
- package/packages/@repo/previewing/package.json +0 -41
- package/packages/@repo/previewing/src/blob-source.ts +0 -185
- package/packages/@repo/previewing/src/config-loader.ts +0 -316
- package/packages/@repo/previewing/src/constants.ts +0 -16
- package/packages/@repo/previewing/src/content-index.ts +0 -384
- package/packages/@repo/previewing/src/content-source.ts +0 -12
- package/packages/@repo/previewing/src/fs-source.ts +0 -103
- package/packages/@repo/previewing/src/index.ts +0 -71
- package/packages/@repo/previewing/src/markdown/agent-markdown.ts +0 -254
- package/packages/@repo/previewing/src/markdown/format.ts +0 -63
- package/packages/@repo/previewing/src/markdown/links.ts +0 -46
- package/packages/@repo/previewing/src/openapi-pages.ts +0 -319
- package/packages/@repo/previewing/src/search-index.ts +0 -38
- package/packages/@repo/previewing/src/serialization.ts +0 -191
- package/packages/@repo/previewing/src/toc-index.ts +0 -72
- package/packages/@repo/previewing/src/types.ts +0 -105
- package/packages/@repo/previewing/src/utility-index.ts +0 -304
- package/packages/@repo/validation/dist/index.d.ts +0 -12
- package/packages/@repo/validation/dist/index.d.ts.map +0 -1
- package/packages/@repo/validation/dist/index.js +0 -30
- package/packages/@repo/validation/package.json +0 -38
- package/packages/@repo/validation/src/blodemd-docs-schema.json +0 -3575
- package/packages/@repo/validation/src/index.ts +0 -59
- package/scripts/prepare-package.mjs +0 -53
- package/scripts/repo-packages.mjs +0 -8
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { useCallback, useState } from "react";
|
|
4
|
-
import type { ReactNode } from "react";
|
|
5
|
-
|
|
6
|
-
import { cn } from "@/lib/utils";
|
|
7
|
-
|
|
8
|
-
interface ExpandableProps {
|
|
9
|
-
title?: string;
|
|
10
|
-
defaultOpen?: boolean;
|
|
11
|
-
children: ReactNode;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export const Expandable = ({
|
|
15
|
-
title = "properties",
|
|
16
|
-
defaultOpen = false,
|
|
17
|
-
children,
|
|
18
|
-
}: ExpandableProps) => {
|
|
19
|
-
const [open, setOpen] = useState(defaultOpen);
|
|
20
|
-
const toggle = useCallback(() => setOpen((prev) => !prev), []);
|
|
21
|
-
|
|
22
|
-
return (
|
|
23
|
-
<div className="mt-2 ml-4 border-l border-border pl-4">
|
|
24
|
-
<button
|
|
25
|
-
className="inline-flex items-center gap-1.5 text-xs font-medium text-muted-foreground hover:text-foreground"
|
|
26
|
-
onClick={toggle}
|
|
27
|
-
type="button"
|
|
28
|
-
>
|
|
29
|
-
<svg
|
|
30
|
-
aria-hidden
|
|
31
|
-
className={cn(
|
|
32
|
-
"size-3 transition-transform duration-150",
|
|
33
|
-
open && "rotate-90"
|
|
34
|
-
)}
|
|
35
|
-
fill="currentColor"
|
|
36
|
-
viewBox="0 0 24 24"
|
|
37
|
-
>
|
|
38
|
-
<path d="m9 18 6-6-6-6" />
|
|
39
|
-
</svg>
|
|
40
|
-
{open ? "Hide" : "Show"} {title}
|
|
41
|
-
</button>
|
|
42
|
-
{open ? <div className="mt-2">{children}</div> : null}
|
|
43
|
-
</div>
|
|
44
|
-
);
|
|
45
|
-
};
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from "react";
|
|
2
|
-
|
|
3
|
-
import { cn } from "@/lib/utils";
|
|
4
|
-
|
|
5
|
-
interface FieldBadge {
|
|
6
|
-
label: string;
|
|
7
|
-
className?: string;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
interface FieldLayoutProps {
|
|
11
|
-
name: string;
|
|
12
|
-
type?: string;
|
|
13
|
-
required?: boolean;
|
|
14
|
-
deprecated?: boolean;
|
|
15
|
-
defaultValue?: string;
|
|
16
|
-
badges?: FieldBadge[];
|
|
17
|
-
children?: ReactNode;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export const FieldLayout = ({
|
|
21
|
-
name,
|
|
22
|
-
type,
|
|
23
|
-
required,
|
|
24
|
-
deprecated,
|
|
25
|
-
defaultValue,
|
|
26
|
-
badges,
|
|
27
|
-
children,
|
|
28
|
-
}: FieldLayoutProps) => (
|
|
29
|
-
<div className="border-b border-border py-4 first:pt-0 last:border-b-0">
|
|
30
|
-
<div className="flex flex-wrap items-center gap-2">
|
|
31
|
-
{badges
|
|
32
|
-
?.filter((b) => b.label)
|
|
33
|
-
.map((badge) => (
|
|
34
|
-
<span
|
|
35
|
-
className={cn(
|
|
36
|
-
"rounded-full bg-muted px-2 py-0.5 text-xs text-muted-foreground",
|
|
37
|
-
badge.className
|
|
38
|
-
)}
|
|
39
|
-
key={badge.label}
|
|
40
|
-
>
|
|
41
|
-
{badge.label}
|
|
42
|
-
</span>
|
|
43
|
-
))}
|
|
44
|
-
<code className="rounded-md bg-muted px-1.5 py-0.5 font-mono text-sm font-medium">
|
|
45
|
-
{name}
|
|
46
|
-
</code>
|
|
47
|
-
{type ? (
|
|
48
|
-
<span className="text-xs text-muted-foreground">{type}</span>
|
|
49
|
-
) : null}
|
|
50
|
-
{required ? (
|
|
51
|
-
<span className="text-xs font-medium text-red-600 dark:text-red-400">
|
|
52
|
-
required
|
|
53
|
-
</span>
|
|
54
|
-
) : null}
|
|
55
|
-
{deprecated ? (
|
|
56
|
-
<span
|
|
57
|
-
className={cn(
|
|
58
|
-
"rounded-full bg-amber-100 px-2 py-0.5 text-xs text-amber-700",
|
|
59
|
-
"dark:bg-amber-900/40 dark:text-amber-300"
|
|
60
|
-
)}
|
|
61
|
-
>
|
|
62
|
-
deprecated
|
|
63
|
-
</span>
|
|
64
|
-
) : null}
|
|
65
|
-
{defaultValue ? (
|
|
66
|
-
<span className="text-xs text-muted-foreground">
|
|
67
|
-
Default: <code className="font-mono">{defaultValue}</code>
|
|
68
|
-
</span>
|
|
69
|
-
) : null}
|
|
70
|
-
</div>
|
|
71
|
-
{children ? (
|
|
72
|
-
<div className="mt-2 text-sm text-muted-foreground [&>p:first-child]:mt-0 [&>p:last-child]:mb-0">
|
|
73
|
-
{children}
|
|
74
|
-
</div>
|
|
75
|
-
) : null}
|
|
76
|
-
</div>
|
|
77
|
-
);
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from "react";
|
|
2
|
-
|
|
3
|
-
interface FrameProps {
|
|
4
|
-
caption?: string;
|
|
5
|
-
hint?: string;
|
|
6
|
-
children: ReactNode;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export const Frame = ({ caption, hint, children }: FrameProps) => (
|
|
10
|
-
<figure className="my-4">
|
|
11
|
-
{hint ? (
|
|
12
|
-
<div className="mb-2 text-sm text-muted-foreground">{hint}</div>
|
|
13
|
-
) : null}
|
|
14
|
-
<div className="overflow-hidden rounded-xl border border-border bg-card">
|
|
15
|
-
{children}
|
|
16
|
-
</div>
|
|
17
|
-
{caption ? (
|
|
18
|
-
<figcaption className="mt-2 text-center text-sm text-muted-foreground">
|
|
19
|
-
{caption}
|
|
20
|
-
</figcaption>
|
|
21
|
-
) : null}
|
|
22
|
-
</figure>
|
|
23
|
-
);
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { isValidElement } from "react";
|
|
2
|
-
import type { ReactNode } from "react";
|
|
3
|
-
|
|
4
|
-
export const getTextContent = (node: ReactNode): string => {
|
|
5
|
-
if (typeof node === "string") {
|
|
6
|
-
return node;
|
|
7
|
-
}
|
|
8
|
-
if (typeof node === "number") {
|
|
9
|
-
return String(node);
|
|
10
|
-
}
|
|
11
|
-
if (Array.isArray(node)) {
|
|
12
|
-
return node.map(getTextContent).join("");
|
|
13
|
-
}
|
|
14
|
-
if (isValidElement<{ children?: ReactNode }>(node)) {
|
|
15
|
-
return getTextContent(node.props.children);
|
|
16
|
-
}
|
|
17
|
-
return "";
|
|
18
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { DocIcon } from "@/components/icons/doc-icon";
|
|
2
|
-
|
|
3
|
-
interface IconProps {
|
|
4
|
-
icon: string;
|
|
5
|
-
color?: string;
|
|
6
|
-
size?: number;
|
|
7
|
-
className?: string;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export const Icon = ({ icon, color, size = 16, className }: IconProps) => (
|
|
11
|
-
<DocIcon className={className} color={color} icon={icon} size={size} />
|
|
12
|
-
);
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { useEffect, useRef, useState } from "react";
|
|
4
|
-
|
|
5
|
-
import { cn } from "@/lib/utils";
|
|
6
|
-
|
|
7
|
-
interface IframeProps {
|
|
8
|
-
src: string;
|
|
9
|
-
height: number;
|
|
10
|
-
title?: string;
|
|
11
|
-
allowResize?: boolean;
|
|
12
|
-
className?: string;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export const Iframe = ({
|
|
16
|
-
src,
|
|
17
|
-
height,
|
|
18
|
-
title = "Embedded content",
|
|
19
|
-
allowResize = false,
|
|
20
|
-
className,
|
|
21
|
-
}: IframeProps) => {
|
|
22
|
-
const iframeRef = useRef<HTMLIFrameElement>(null);
|
|
23
|
-
const [dynamicHeight, setDynamicHeight] = useState<number | null>(null);
|
|
24
|
-
|
|
25
|
-
useEffect(() => {
|
|
26
|
-
if (!allowResize) {
|
|
27
|
-
return;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
const handleMessage = (event: MessageEvent) => {
|
|
31
|
-
if (
|
|
32
|
-
event.data?.type === "resize" &&
|
|
33
|
-
typeof event.data?.height === "number"
|
|
34
|
-
) {
|
|
35
|
-
setDynamicHeight(event.data.height);
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
window.addEventListener("message", handleMessage);
|
|
40
|
-
return () => window.removeEventListener("message", handleMessage);
|
|
41
|
-
}, [allowResize]);
|
|
42
|
-
|
|
43
|
-
const resolvedHeight = dynamicHeight ?? height;
|
|
44
|
-
|
|
45
|
-
return (
|
|
46
|
-
<div
|
|
47
|
-
className={cn(
|
|
48
|
-
"relative overflow-hidden rounded-xl border border-border bg-card",
|
|
49
|
-
className
|
|
50
|
-
)}
|
|
51
|
-
style={{ height: `${resolvedHeight}px` }}
|
|
52
|
-
>
|
|
53
|
-
<iframe
|
|
54
|
-
ref={iframeRef}
|
|
55
|
-
className="h-full w-full border-0"
|
|
56
|
-
sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
|
|
57
|
-
src={src}
|
|
58
|
-
title={title}
|
|
59
|
-
/>
|
|
60
|
-
</div>
|
|
61
|
-
);
|
|
62
|
-
};
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
import type { MDXComponents } from "mdx/types";
|
|
2
|
-
import Link from "next/link";
|
|
3
|
-
import type { ComponentProps } from "react";
|
|
4
|
-
|
|
5
|
-
import { isExternalHref, resolveHref } from "@/lib/routes";
|
|
6
|
-
|
|
7
|
-
import { Accordion, AccordionGroup } from "./accordion";
|
|
8
|
-
import { AgentInstructions } from "./agent-instructions";
|
|
9
|
-
import { Badge } from "./badge";
|
|
10
|
-
import { Callout, Check, Danger, Info, Note, Tip, Warning } from "./callout";
|
|
11
|
-
import { Card } from "./card";
|
|
12
|
-
import { CodeBlock } from "./code-block";
|
|
13
|
-
import { CodeGroup } from "./code-group";
|
|
14
|
-
import { Color } from "./color";
|
|
15
|
-
import { Column, Columns } from "./columns";
|
|
16
|
-
import { Expandable } from "./expandable";
|
|
17
|
-
import { Frame } from "./frame";
|
|
18
|
-
import { Icon } from "./icon";
|
|
19
|
-
import { Iframe } from "./iframe";
|
|
20
|
-
import { Installer } from "./installer";
|
|
21
|
-
import { Panel } from "./panel";
|
|
22
|
-
import { ParamField } from "./param-field";
|
|
23
|
-
import { Preview } from "./preview";
|
|
24
|
-
import { Prompt } from "./prompt";
|
|
25
|
-
import { RequestExample, ResponseExample } from "./request-example";
|
|
26
|
-
import { ResponseField } from "./response-field";
|
|
27
|
-
import { Step, Steps } from "./steps";
|
|
28
|
-
import { Tab, Tabs } from "./tabs";
|
|
29
|
-
import { Tile } from "./tile";
|
|
30
|
-
import { Tooltip } from "./tooltip";
|
|
31
|
-
import { Tree as TreeRoot, TreeFile, TreeFolder } from "./tree";
|
|
32
|
-
import { TypeTable } from "./type-table";
|
|
33
|
-
import { Update } from "./update";
|
|
34
|
-
import { Video } from "./video";
|
|
35
|
-
import { View, ViewGroup } from "./view";
|
|
36
|
-
|
|
37
|
-
// Rebuild dotted MDX exports in the server module so Next's client references
|
|
38
|
-
// still expose `Tree.Folder` and `Tree.File` during MDX evaluation.
|
|
39
|
-
const Tree = Object.assign(
|
|
40
|
-
(props: ComponentProps<typeof TreeRoot>) => <TreeRoot {...props} />,
|
|
41
|
-
{
|
|
42
|
-
File: TreeFile,
|
|
43
|
-
Folder: TreeFolder,
|
|
44
|
-
}
|
|
45
|
-
);
|
|
46
|
-
|
|
47
|
-
const createMdxLink = (basePath: string, currentPath: string) => {
|
|
48
|
-
const MdxLink = ({
|
|
49
|
-
href,
|
|
50
|
-
children,
|
|
51
|
-
...props
|
|
52
|
-
}: React.AnchorHTMLAttributes<HTMLAnchorElement>) => {
|
|
53
|
-
if (!href) {
|
|
54
|
-
return <a {...props}>{children}</a>;
|
|
55
|
-
}
|
|
56
|
-
if (isExternalHref(href)) {
|
|
57
|
-
return (
|
|
58
|
-
<a {...props} href={href} rel="noopener noreferrer" target="_blank">
|
|
59
|
-
{children}
|
|
60
|
-
</a>
|
|
61
|
-
);
|
|
62
|
-
}
|
|
63
|
-
return (
|
|
64
|
-
<Link href={resolveHref(href, basePath, currentPath)} {...props}>
|
|
65
|
-
{children}
|
|
66
|
-
</Link>
|
|
67
|
-
);
|
|
68
|
-
};
|
|
69
|
-
MdxLink.displayName = "MdxLink";
|
|
70
|
-
return MdxLink;
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
export const createMdxComponents = (
|
|
74
|
-
basePath = "",
|
|
75
|
-
currentPath = ""
|
|
76
|
-
): MDXComponents => ({
|
|
77
|
-
Accordion,
|
|
78
|
-
AccordionGroup,
|
|
79
|
-
AgentInstructions,
|
|
80
|
-
Badge,
|
|
81
|
-
Callout,
|
|
82
|
-
Card,
|
|
83
|
-
Check,
|
|
84
|
-
CodeGroup,
|
|
85
|
-
Color,
|
|
86
|
-
Column,
|
|
87
|
-
Columns,
|
|
88
|
-
Danger,
|
|
89
|
-
Expandable,
|
|
90
|
-
Frame,
|
|
91
|
-
Icon,
|
|
92
|
-
Iframe,
|
|
93
|
-
Info,
|
|
94
|
-
Installer,
|
|
95
|
-
Note,
|
|
96
|
-
Panel,
|
|
97
|
-
ParamField,
|
|
98
|
-
Preview,
|
|
99
|
-
Prompt,
|
|
100
|
-
RequestExample,
|
|
101
|
-
ResponseExample,
|
|
102
|
-
ResponseField,
|
|
103
|
-
Step,
|
|
104
|
-
Steps,
|
|
105
|
-
Tab,
|
|
106
|
-
Tabs,
|
|
107
|
-
Tile,
|
|
108
|
-
Tip,
|
|
109
|
-
Tooltip,
|
|
110
|
-
Tree,
|
|
111
|
-
TypeTable,
|
|
112
|
-
Update,
|
|
113
|
-
Video,
|
|
114
|
-
View,
|
|
115
|
-
ViewGroup,
|
|
116
|
-
Warning,
|
|
117
|
-
a: createMdxLink(basePath, currentPath),
|
|
118
|
-
pre: CodeBlock,
|
|
119
|
-
});
|
|
120
|
-
|
|
121
|
-
export const mdxComponents: MDXComponents = createMdxComponents();
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export const Installer = ({
|
|
2
|
-
path,
|
|
3
|
-
command,
|
|
4
|
-
}: {
|
|
5
|
-
path: string;
|
|
6
|
-
command?: string;
|
|
7
|
-
}) => {
|
|
8
|
-
const resolvedCommand =
|
|
9
|
-
command ?? `npx @vercel/platform-elements@latest ${path}`;
|
|
10
|
-
return (
|
|
11
|
-
<div className="my-4 grid gap-2.5 rounded-xl border border-border bg-background/70 p-3.5">
|
|
12
|
-
<div className="text-xs uppercase tracking-widest text-muted-foreground">
|
|
13
|
-
Install
|
|
14
|
-
</div>
|
|
15
|
-
<pre className="m-0 overflow-x-auto rounded-lg bg-code p-3 font-mono text-sm text-code-foreground">
|
|
16
|
-
<code>{resolvedCommand}</code>
|
|
17
|
-
</pre>
|
|
18
|
-
</div>
|
|
19
|
-
);
|
|
20
|
-
};
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from "react";
|
|
2
|
-
|
|
3
|
-
import { FieldLayout } from "./field-layout";
|
|
4
|
-
|
|
5
|
-
interface ParamFieldProps {
|
|
6
|
-
path?: string;
|
|
7
|
-
query?: string;
|
|
8
|
-
body?: string;
|
|
9
|
-
header?: string;
|
|
10
|
-
type?: string;
|
|
11
|
-
required?: boolean;
|
|
12
|
-
deprecated?: boolean;
|
|
13
|
-
default?: string;
|
|
14
|
-
placeholder?: string;
|
|
15
|
-
children?: ReactNode;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export const ParamField = ({
|
|
19
|
-
path,
|
|
20
|
-
query,
|
|
21
|
-
body,
|
|
22
|
-
header,
|
|
23
|
-
type,
|
|
24
|
-
required,
|
|
25
|
-
deprecated,
|
|
26
|
-
default: defaultValue,
|
|
27
|
-
children,
|
|
28
|
-
}: ParamFieldProps) => {
|
|
29
|
-
const name = path ?? query ?? body ?? header ?? "";
|
|
30
|
-
|
|
31
|
-
let location: string | undefined;
|
|
32
|
-
if (path) {
|
|
33
|
-
location = "path";
|
|
34
|
-
} else if (query) {
|
|
35
|
-
location = "query";
|
|
36
|
-
} else if (body) {
|
|
37
|
-
location = "body";
|
|
38
|
-
} else if (header) {
|
|
39
|
-
location = "header";
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
const badges = location ? [{ label: location }] : undefined;
|
|
43
|
-
|
|
44
|
-
return (
|
|
45
|
-
<FieldLayout
|
|
46
|
-
badges={badges}
|
|
47
|
-
defaultValue={defaultValue}
|
|
48
|
-
deprecated={deprecated}
|
|
49
|
-
name={name}
|
|
50
|
-
required={required}
|
|
51
|
-
type={type}
|
|
52
|
-
>
|
|
53
|
-
{children}
|
|
54
|
-
</FieldLayout>
|
|
55
|
-
);
|
|
56
|
-
};
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from "react";
|
|
2
|
-
|
|
3
|
-
export const Preview = ({
|
|
4
|
-
example,
|
|
5
|
-
source,
|
|
6
|
-
title = "Preview",
|
|
7
|
-
children,
|
|
8
|
-
}: {
|
|
9
|
-
example?: string;
|
|
10
|
-
source?: string;
|
|
11
|
-
title?: string;
|
|
12
|
-
children?: ReactNode;
|
|
13
|
-
}) => (
|
|
14
|
-
<div className="my-4 grid gap-3 rounded-xl border border-border bg-surface p-4">
|
|
15
|
-
<div className="flex flex-wrap items-center gap-2 text-xs uppercase tracking-wider text-muted-foreground">
|
|
16
|
-
<span className="font-semibold">{title}</span>
|
|
17
|
-
{example ? (
|
|
18
|
-
<span className="rounded-full border border-border bg-accent px-2.5 py-1 text-primary">
|
|
19
|
-
{example}
|
|
20
|
-
</span>
|
|
21
|
-
) : null}
|
|
22
|
-
{source ? (
|
|
23
|
-
<span className="rounded-full border border-border bg-accent px-2.5 py-1 text-primary">
|
|
24
|
-
{source}
|
|
25
|
-
</span>
|
|
26
|
-
) : null}
|
|
27
|
-
</div>
|
|
28
|
-
<div className="rounded-xl border border-dashed border-border bg-gradient-to-br from-primary/15 to-primary/5 p-4.5">
|
|
29
|
-
{children ?? (
|
|
30
|
-
<div className="text-sm text-muted-foreground">
|
|
31
|
-
Interactive preview placeholder
|
|
32
|
-
</div>
|
|
33
|
-
)}
|
|
34
|
-
</div>
|
|
35
|
-
</div>
|
|
36
|
-
);
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { CheckIcon, ClipboardIcon } from "blode-icons-react";
|
|
4
|
-
import { useCallback, useEffect, useMemo, useState } from "react";
|
|
5
|
-
import type { ReactNode } from "react";
|
|
6
|
-
|
|
7
|
-
import { getTextContent } from "./get-text-content";
|
|
8
|
-
|
|
9
|
-
interface PromptProps {
|
|
10
|
-
description: string;
|
|
11
|
-
icon?: ReactNode;
|
|
12
|
-
children: ReactNode;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export const Prompt = ({ description, icon, children }: PromptProps) => {
|
|
16
|
-
const [copied, setCopied] = useState(false);
|
|
17
|
-
const text = useMemo(() => getTextContent(children), [children]);
|
|
18
|
-
|
|
19
|
-
useEffect(() => {
|
|
20
|
-
if (copied) {
|
|
21
|
-
const timer = setTimeout(() => setCopied(false), 2000);
|
|
22
|
-
return () => clearTimeout(timer);
|
|
23
|
-
}
|
|
24
|
-
}, [copied]);
|
|
25
|
-
|
|
26
|
-
const handleCopy = useCallback(async () => {
|
|
27
|
-
if (!text) {
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
await navigator.clipboard.writeText(text);
|
|
31
|
-
setCopied(true);
|
|
32
|
-
}, [text]);
|
|
33
|
-
|
|
34
|
-
return (
|
|
35
|
-
<div className="my-4 rounded-xl border border-border bg-card">
|
|
36
|
-
<div className="flex items-start gap-3 border-b border-border p-4">
|
|
37
|
-
{icon ? (
|
|
38
|
-
<span className="mt-0.5 flex size-5 shrink-0 items-center justify-center text-muted-foreground">
|
|
39
|
-
{icon}
|
|
40
|
-
</span>
|
|
41
|
-
) : null}
|
|
42
|
-
<div className="min-w-0 flex-1 text-sm text-foreground">
|
|
43
|
-
{description}
|
|
44
|
-
</div>
|
|
45
|
-
<button
|
|
46
|
-
className="inline-flex size-7 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-muted hover:text-foreground"
|
|
47
|
-
onClick={handleCopy}
|
|
48
|
-
type="button"
|
|
49
|
-
>
|
|
50
|
-
<span className="sr-only">{copied ? "Copied" : "Copy prompt"}</span>
|
|
51
|
-
{copied ? (
|
|
52
|
-
<CheckIcon aria-hidden className="size-3.5" />
|
|
53
|
-
) : (
|
|
54
|
-
<ClipboardIcon aria-hidden className="size-3.5" />
|
|
55
|
-
)}
|
|
56
|
-
</button>
|
|
57
|
-
</div>
|
|
58
|
-
<div className="p-4 text-sm text-muted-foreground [&>p:first-child]:mt-0 [&>p:last-child]:mb-0">
|
|
59
|
-
{children}
|
|
60
|
-
</div>
|
|
61
|
-
</div>
|
|
62
|
-
);
|
|
63
|
-
};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from "react";
|
|
2
|
-
|
|
3
|
-
interface RequestExampleProps {
|
|
4
|
-
children: ReactNode;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export const RequestExample = ({ children }: RequestExampleProps) => (
|
|
8
|
-
<div className="my-4">
|
|
9
|
-
<div className="mb-1 text-xs font-semibold uppercase tracking-wider text-muted-foreground">
|
|
10
|
-
Request
|
|
11
|
-
</div>
|
|
12
|
-
<div className="[&>pre]:mt-0 [&>[data-rehype-pretty-code-figure]]:mt-0">
|
|
13
|
-
{children}
|
|
14
|
-
</div>
|
|
15
|
-
</div>
|
|
16
|
-
);
|
|
17
|
-
|
|
18
|
-
export const ResponseExample = ({ children }: RequestExampleProps) => (
|
|
19
|
-
<div className="my-4">
|
|
20
|
-
<div className="mb-1 text-xs font-semibold uppercase tracking-wider text-muted-foreground">
|
|
21
|
-
Response
|
|
22
|
-
</div>
|
|
23
|
-
<div className="[&>pre]:mt-0 [&>[data-rehype-pretty-code-figure]]:mt-0">
|
|
24
|
-
{children}
|
|
25
|
-
</div>
|
|
26
|
-
</div>
|
|
27
|
-
);
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from "react";
|
|
2
|
-
|
|
3
|
-
import { FieldLayout } from "./field-layout";
|
|
4
|
-
|
|
5
|
-
interface ResponseFieldProps {
|
|
6
|
-
name: string;
|
|
7
|
-
type: string;
|
|
8
|
-
default?: string;
|
|
9
|
-
required?: boolean;
|
|
10
|
-
deprecated?: boolean;
|
|
11
|
-
pre?: string[];
|
|
12
|
-
post?: string[];
|
|
13
|
-
children?: ReactNode;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export const ResponseField = ({
|
|
17
|
-
name,
|
|
18
|
-
type,
|
|
19
|
-
default: defaultValue,
|
|
20
|
-
required,
|
|
21
|
-
deprecated,
|
|
22
|
-
pre,
|
|
23
|
-
post,
|
|
24
|
-
children,
|
|
25
|
-
}: ResponseFieldProps) => {
|
|
26
|
-
const preBadges = pre?.map((label) => ({ label })) ?? [];
|
|
27
|
-
const postBadges = post?.map((label) => ({ label })) ?? [];
|
|
28
|
-
const badges = [...preBadges, ...postBadges];
|
|
29
|
-
|
|
30
|
-
return (
|
|
31
|
-
<FieldLayout
|
|
32
|
-
badges={badges.length > 0 ? badges : undefined}
|
|
33
|
-
defaultValue={defaultValue}
|
|
34
|
-
deprecated={deprecated}
|
|
35
|
-
name={name}
|
|
36
|
-
required={required}
|
|
37
|
-
type={type}
|
|
38
|
-
>
|
|
39
|
-
{children}
|
|
40
|
-
</FieldLayout>
|
|
41
|
-
);
|
|
42
|
-
};
|