sourcey 2.1.0 → 3.0.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/README.md +128 -210
- package/dist/cli.js +18 -57
- package/dist/cli.js.map +1 -1
- package/dist/client/scroll-tracker.js +125 -40
- package/dist/client/search.js +27 -3
- package/dist/client/tabs.js +164 -24
- package/dist/components/App.d.ts +3 -2
- package/dist/components/App.d.ts.map +1 -1
- package/dist/components/App.js +3 -3
- package/dist/components/App.js.map +1 -1
- package/dist/components/layout/Head.d.ts.map +1 -1
- package/dist/components/layout/Head.js +30 -9
- package/dist/components/layout/Head.js.map +1 -1
- package/dist/components/layout/Header.d.ts +2 -7
- package/dist/components/layout/Header.d.ts.map +1 -1
- package/dist/components/layout/Header.js +12 -15
- package/dist/components/layout/Header.js.map +1 -1
- package/dist/components/layout/Page.d.ts.map +1 -1
- package/dist/components/layout/Page.js +54 -10
- package/dist/components/layout/Page.js.map +1 -1
- package/dist/components/layout/Sidebar.js +1 -1
- package/dist/components/layout/Sidebar.js.map +1 -1
- package/dist/components/layout/TableOfContents.d.ts.map +1 -1
- package/dist/components/layout/TableOfContents.js +1 -1
- package/dist/components/layout/TableOfContents.js.map +1 -1
- package/dist/components/openapi/CodeSamples.d.ts +4 -2
- package/dist/components/openapi/CodeSamples.d.ts.map +1 -1
- package/dist/components/openapi/CodeSamples.js +9 -5
- package/dist/components/openapi/CodeSamples.js.map +1 -1
- package/dist/components/openapi/Definition.js +1 -1
- package/dist/components/openapi/Definition.js.map +1 -1
- package/dist/components/openapi/EndpointBar.d.ts.map +1 -1
- package/dist/components/openapi/EndpointBar.js +3 -3
- package/dist/components/openapi/EndpointBar.js.map +1 -1
- package/dist/components/openapi/Introduction.d.ts.map +1 -1
- package/dist/components/openapi/Introduction.js +1 -1
- package/dist/components/openapi/Introduction.js.map +1 -1
- package/dist/components/openapi/Operation.d.ts.map +1 -1
- package/dist/components/openapi/Operation.js +5 -1
- package/dist/components/openapi/Operation.js.map +1 -1
- package/dist/components/openapi/Responses.d.ts +2 -1
- package/dist/components/openapi/Responses.d.ts.map +1 -1
- package/dist/components/openapi/Responses.js +17 -6
- package/dist/components/openapi/Responses.js.map +1 -1
- package/dist/components/openapi/Security.d.ts.map +1 -1
- package/dist/components/openapi/Security.js +3 -2
- package/dist/components/openapi/Security.js.map +1 -1
- package/dist/components/openapi/Tags.d.ts.map +1 -1
- package/dist/components/openapi/Tags.js +1 -1
- package/dist/components/openapi/Tags.js.map +1 -1
- package/dist/components/schema/ExampleView.d.ts +1 -1
- package/dist/components/schema/ExampleView.d.ts.map +1 -1
- package/dist/components/schema/ExampleView.js +3 -2
- package/dist/components/schema/ExampleView.js.map +1 -1
- package/dist/components/ui/CopyButton.d.ts +6 -0
- package/dist/components/ui/CopyButton.d.ts.map +1 -0
- package/dist/components/ui/CopyButton.js +10 -0
- package/dist/components/ui/CopyButton.js.map +1 -0
- package/dist/components/ui/Markdown.js +1 -1
- package/dist/components/ui/Markdown.js.map +1 -1
- package/dist/components/ui/SocialIcon.d.ts +5 -0
- package/dist/components/ui/SocialIcon.d.ts.map +1 -0
- package/dist/components/ui/SocialIcon.js +19 -0
- package/dist/components/ui/SocialIcon.js.map +1 -0
- package/dist/config.d.ts +133 -37
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +227 -73
- package/dist/config.js.map +1 -1
- package/dist/core/doxygen-loader.d.ts +9 -0
- package/dist/core/doxygen-loader.d.ts.map +1 -0
- package/dist/core/doxygen-loader.js +68 -0
- package/dist/core/doxygen-loader.js.map +1 -0
- package/dist/core/markdown-loader.d.ts +2 -5
- package/dist/core/markdown-loader.d.ts.map +1 -1
- package/dist/core/markdown-loader.js +218 -27
- package/dist/core/markdown-loader.js.map +1 -1
- package/dist/core/navigation.d.ts +2 -2
- package/dist/core/navigation.d.ts.map +1 -1
- package/dist/core/navigation.js +9 -10
- package/dist/core/navigation.js.map +1 -1
- package/dist/core/search-indexer.d.ts +1 -1
- package/dist/core/search-indexer.d.ts.map +1 -1
- package/dist/core/search-indexer.js +6 -5
- package/dist/core/search-indexer.js.map +1 -1
- package/dist/dev-server.d.ts +0 -12
- package/dist/dev-server.d.ts.map +1 -1
- package/dist/dev-server.js +101 -79
- package/dist/dev-server.js.map +1 -1
- package/dist/index.d.ts +2 -30
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +82 -70
- package/dist/index.js.map +1 -1
- package/dist/renderer/context.d.ts +29 -2
- package/dist/renderer/context.d.ts.map +1 -1
- package/dist/renderer/context.js +1 -1
- package/dist/renderer/context.js.map +1 -1
- package/dist/renderer/html-builder.d.ts +3 -16
- package/dist/renderer/html-builder.d.ts.map +1 -1
- package/dist/renderer/html-builder.js +6 -20
- package/dist/renderer/html-builder.js.map +1 -1
- package/dist/renderer/static-renderer.d.ts +2 -2
- package/dist/renderer/static-renderer.d.ts.map +1 -1
- package/dist/renderer/static-renderer.js +2 -2
- package/dist/renderer/static-renderer.js.map +1 -1
- package/dist/themes/default/main.css +13 -1
- package/dist/themes/default/sourcey.css +629 -41
- package/dist/utils/code-samples.d.ts +8 -3
- package/dist/utils/code-samples.d.ts.map +1 -1
- package/dist/utils/code-samples.js +188 -51
- package/dist/utils/code-samples.js.map +1 -1
- package/dist/utils/copy-svg.d.ts +9 -0
- package/dist/utils/copy-svg.d.ts.map +1 -0
- package/dist/utils/copy-svg.js +9 -0
- package/dist/utils/copy-svg.js.map +1 -0
- package/dist/utils/highlighter.d.ts.map +1 -1
- package/dist/utils/highlighter.js +18 -7
- package/dist/utils/highlighter.js.map +1 -1
- package/dist/utils/icons.d.ts +14 -0
- package/dist/utils/icons.d.ts.map +1 -0
- package/dist/utils/icons.js +59 -0
- package/dist/utils/icons.js.map +1 -0
- package/dist/utils/lang-icons.d.ts +17 -0
- package/dist/utils/lang-icons.d.ts.map +1 -0
- package/dist/utils/lang-icons.js +87 -0
- package/dist/utils/lang-icons.js.map +1 -0
- package/dist/utils/markdown.d.ts +17 -1
- package/dist/utils/markdown.d.ts.map +1 -1
- package/dist/utils/markdown.js +59 -2
- package/dist/utils/markdown.js.map +1 -1
- package/dist/vite-plugin.d.ts.map +1 -1
- package/dist/vite-plugin.js +4 -7
- package/dist/vite-plugin.js.map +1 -1
- package/package.json +5 -4
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "preact/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "preact/jsx-runtime";
|
|
2
2
|
import { useContext } from "preact/hooks";
|
|
3
|
-
import { NavigationContext, OptionsContext,
|
|
3
|
+
import { NavigationContext, OptionsContext, SiteContext } from "../../renderer/context.js";
|
|
4
|
+
import { SocialIcon } from "../ui/SocialIcon.js";
|
|
4
5
|
function SearchIcon() {
|
|
5
6
|
return (_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", class: "min-w-4 flex-none", children: [_jsx("circle", { cx: "11", cy: "11", r: "8" }), _jsx("path", { d: "m21 21-4.3-4.3" })] }));
|
|
6
7
|
}
|
|
@@ -11,28 +12,24 @@ function MoonIcon() {
|
|
|
11
12
|
return (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", class: "h-4 w-4 hidden dark:block", children: _jsx("path", { d: "M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z" }) }));
|
|
12
13
|
}
|
|
13
14
|
/**
|
|
14
|
-
* Two-row site header
|
|
15
|
-
* Row 1 (h-16): logo, search, theme toggle
|
|
15
|
+
* Two-row site header.
|
|
16
|
+
* Row 1 (h-16): logo, search, navbar links, theme toggle
|
|
16
17
|
* Row 2 (h-12): navigation tabs
|
|
17
18
|
* Total: 7rem (header-height)
|
|
18
19
|
*/
|
|
19
20
|
export function Header() {
|
|
20
21
|
const nav = useContext(NavigationContext);
|
|
21
22
|
const options = useContext(OptionsContext);
|
|
22
|
-
const
|
|
23
|
+
const site = useContext(SiteContext);
|
|
23
24
|
const base = options.assetBase;
|
|
24
|
-
|
|
25
|
+
const logoHref = site.logo?.href ?? `${base}${nav.tabs[0]?.href ?? ""}`;
|
|
26
|
+
return (_jsxs("div", { id: "navbar", class: "z-30 fixed lg:sticky top-0 w-full", children: [_jsx("div", { class: "absolute w-full h-full flex-none border-b border-[rgb(var(--color-gray-200)/0.7)] dark:border-[rgb(var(--color-gray-300)/0.06)] bg-[rgb(var(--color-background-light))] dark:bg-[rgb(var(--color-background-dark))]" }), _jsxs("div", { class: "max-w-[92rem] mx-auto relative", children: [_jsxs("div", { class: "relative", children: [_jsx("div", { class: "flex items-center lg:px-12 h-16 min-w-0 mx-4 lg:mx-0", children: _jsxs("div", { class: "h-full relative flex-1 flex items-center gap-x-4 min-w-0 border-b border-[rgb(var(--color-gray-500)/0.05)] dark:border-[rgb(var(--color-gray-300)/0.06)]", children: [_jsx("div", { class: "flex-1 flex items-center gap-x-4", children: site.logo?.light && (_jsxs("a", { href: logoHref, class: "select-none", children: [_jsx("img", { src: site.logo.light, alt: site.name || "Home", class: "w-auto h-7 relative object-contain shrink-0 block dark:hidden" }), site.logo.dark ? (_jsx("img", { src: site.logo.dark, alt: site.name || "Home", class: "w-auto h-7 relative object-contain shrink-0 hidden dark:block" })) : (_jsx("img", { src: site.logo.light, alt: site.name || "Home", class: "w-auto h-7 relative object-contain shrink-0 hidden dark:block" }))] })) }), _jsx("div", { class: "relative hidden lg:flex items-center flex-1 z-20 gap-2.5", children: _jsxs("button", { id: "search-open", type: "button", "aria-label": "Search", class: "group flex pointer-events-auto rounded-lg w-full items-center text-sm leading-6 h-9 pl-3.5 pr-3 text-[rgb(var(--color-gray-500))] dark:text-[rgb(var(--color-gray-400))] ring-1 ring-[rgb(var(--color-gray-400)/0.3)] hover:ring-[rgb(var(--color-gray-600)/0.3)] dark:ring-[rgb(var(--color-gray-600)/0.3)] dark:hover:ring-[rgb(var(--color-gray-500)/0.3)] justify-between truncate gap-2 min-w-[43px] cursor-pointer bg-[rgb(var(--color-background-light))] dark:bg-[rgb(var(--color-background-dark))] dark:brightness-110 dark:hover:brightness-125", children: [_jsxs("div", { class: "flex items-center gap-2 min-w-[42px]", children: [_jsx(SearchIcon, {}), _jsx("div", { class: "truncate min-w-0", children: "Search docs..." })] }), _jsx("kbd", { class: "flex-none ml-auto size-5 flex items-center justify-center text-xs font-semibold text-[rgb(var(--color-gray-400))] bg-[rgb(var(--color-gray-100)/0.5)] dark:bg-[rgb(var(--color-surface-dark-tint)/0.1)] border border-[rgb(var(--color-gray-200))] dark:border-[rgb(var(--color-border-dark-subtle)/0.1)] rounded-sm", children: "/" })] }) }), _jsxs("div", { class: "flex-1 relative hidden lg:flex items-center ml-auto justify-end space-x-4", children: [_jsx("nav", { class: "text-sm", children: _jsxs("ul", { class: "flex space-x-6 items-center", children: [site.navbar.links.map((link) => (_jsx("li", { children: _jsx("a", { href: link.href, target: "_blank", rel: "noopener noreferrer", class: "text-[rgb(var(--color-gray-400))] hover:text-[rgb(var(--color-gray-600))] dark:hover:text-[rgb(var(--color-gray-300))]", children: link.type === "link"
|
|
27
|
+
? (link.label ?? link.href)
|
|
28
|
+
: (_jsxs(_Fragment, { children: [_jsx(SocialIcon, { type: link.type }), link.label && _jsx("span", { class: "ml-1", children: link.label })] })) }) }, link.href))), site.navbar.primary && (_jsx("li", { children: _jsxs("a", { href: site.navbar.primary.href, target: "_blank", class: "group px-4 py-1.5 relative inline-flex items-center text-sm font-medium", children: [_jsx("span", { class: "absolute inset-0 bg-[rgb(var(--color-primary-dark))] rounded-lg group-hover:opacity-90" }), _jsx("span", { class: "z-10 text-white", children: site.navbar.primary.label })] }) }))] }) }), _jsx("div", { class: "flex items-center", children: _jsxs("button", { id: "theme-toggle", type: "button", "aria-label": "Toggle theme", class: "group p-2 flex items-center justify-center cursor-pointer text-[rgb(var(--color-gray-400))] hover:text-[rgb(var(--color-gray-600))] dark:text-[rgb(var(--color-gray-500))] dark:hover:text-[rgb(var(--color-gray-300))]", children: [_jsx(SunIcon, {}), _jsx(MoonIcon, {})] }) })] }), _jsxs("div", { class: "flex lg:hidden items-center gap-3", children: [_jsx("button", { type: "button", "data-drawer-slide": "right", "aria-label": "Open menu", class: "text-[rgb(var(--color-gray-500))] w-8 h-8 flex items-center justify-center hover:text-[rgb(var(--color-gray-600))]", children: _jsx("svg", { class: "h-4", fill: "currentColor", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 448 512", children: _jsx("path", { d: "M0 96C0 78.3 14.3 64 32 64H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32C14.3 128 0 113.7 0 96zM0 256c0-17.7 14.3-32 32-32H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32c-17.7 0-32-14.3-32-32zM448 416c0 17.7-14.3 32-32 32H32c-17.7 0-32-14.3-32-32s14.3-32 32-32H416c17.7 0 32 14.3 32 32z" }) }) }), _jsx("button", { id: "search-open-mobile", type: "button", "aria-label": "Search", class: "text-[rgb(var(--color-gray-500))] w-8 h-8 flex items-center justify-center", children: _jsx(SearchIcon, {}) })] })] }) }), _jsx("button", { type: "button", class: "flex items-center h-14 py-4 px-5 lg:hidden focus:outline-0 w-full text-left", "data-drawer-slide": "right", children: _jsx("div", { class: "text-[rgb(var(--color-gray-500))]", children: _jsx("svg", { class: "h-4", fill: "currentColor", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 448 512", children: _jsx("path", { d: "M0 96C0 78.3 14.3 64 32 64H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32C14.3 128 0 113.7 0 96zM0 256c0-17.7 14.3-32 32-32H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32c-17.7 0-32-14.3-32-32zM448 416c0 17.7-14.3 32-32 32H32c-17.7 0-32-14.3-32-32s14.3-32 32-32H416c17.7 0 32 14.3 32 32z" }) }) }) })] }), nav.tabs.length > 1 && (_jsx("div", { class: "hidden lg:flex px-12 h-12", children: _jsx("div", { class: "h-full flex text-sm gap-x-6", children: nav.tabs.map((tab) => {
|
|
25
29
|
const isActive = tab.slug === nav.activeTabSlug;
|
|
26
|
-
return (_jsxs("a", { href: `${base}${tab.href}`, class: `group relative h-full gap-2 flex items-center font-medium transition-colors ${isActive
|
|
30
|
+
return (_jsxs("a", { href: `${base}${tab.href}`, class: `group relative h-full gap-2 flex items-center font-medium cursor-pointer transition-colors ${isActive
|
|
27
31
|
? "text-[rgb(var(--color-gray-800))] dark:text-[rgb(var(--color-gray-200))]"
|
|
28
32
|
: "text-[rgb(var(--color-gray-600))] dark:text-[rgb(var(--color-gray-400))] hover:text-[rgb(var(--color-gray-800))] dark:hover:text-[rgb(var(--color-gray-300))]"}`, children: [tab.label, isActive ? (_jsx("div", { class: "absolute bottom-0 h-[1.5px] w-full left-0 bg-[rgb(var(--color-primary))] dark:bg-[rgb(var(--color-primary-light))]" })) : (_jsx("div", { class: "absolute bottom-0 h-[1.5px] w-full left-0 group-hover:bg-[rgb(var(--color-gray-200))] dark:group-hover:bg-[rgb(var(--color-gray-700))]" }))] }, tab.slug));
|
|
29
|
-
}) }) })] })] }));
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Mobile header is now integrated into the main Header component.
|
|
33
|
-
* This is kept as a no-op for backward compatibility.
|
|
34
|
-
*/
|
|
35
|
-
export function MobileHeader() {
|
|
36
|
-
return null;
|
|
33
|
+
}) }) }))] })] }));
|
|
37
34
|
}
|
|
38
35
|
//# sourceMappingURL=Header.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Header.js","sourceRoot":"","sources":["../../../src/components/layout/Header.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,2BAA2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BAAmB,OAAO,YACjI,cAAK,KAAK,EAAC,mCAAmC,YAC5C,cAAK,KAAK,EAAC,KAAK,EAAC,IAAI,EAAC,cAAc,EAAC,KAAK,EAAC,4BAA4B,EAAC,OAAO,EAAC,aAAa,YAC3F,eAAM,CAAC,EAAC,yRAAyR,GAAG,GAChS,GACF,GACC,IACL,EAGL,GAAG,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,IAAI,CACxB,cAAK,KAAK,EAAC,2BAA2B,YACpC,cAAK,KAAK,EAAC,6BAA6B,YACrC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE;gCACpB,MAAM,QAAQ,GAAG,GAAG,CAAC,IAAI,KAAK,GAAG,CAAC,aAAa,CAAC;gCAChD,OAAO,CACL,aAEE,IAAI,EAAE,GAAG,IAAI,GAAG,GAAG,CAAC,IAAI,EAAE,EAC1B,KAAK,EAAE,8FACL,QAAQ;wCACN,CAAC,CAAC,0EAA0E;wCAC5E,CAAC,CAAC,+JACN,EAAE,aAED,GAAG,CAAC,KAAK,EACT,QAAQ,CAAC,CAAC,CAAC,CACV,cAAK,KAAK,EAAC,oHAAoH,GAAG,CACnI,CAAC,CAAC,CAAC,CACF,cAAK,KAAK,EAAC,wIAAwI,GAAG,CACvJ,KAbI,GAAG,CAAC,IAAI,CAcX,CACL,CAAC;4BACJ,CAAC,CAAC,GACE,GACF,CACL,IACG,IACF,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Page.d.ts","sourceRoot":"","sources":["../../../src/components/layout/Page.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Page.d.ts","sourceRoot":"","sources":["../../../src/components/layout/Page.tsx"],"names":[],"mappings":"AAoMA,wBAAgB,IAAI,iCAqCnB"}
|
|
@@ -1,29 +1,73 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "preact/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "preact/jsx-runtime";
|
|
2
2
|
import { useContext } from "preact/hooks";
|
|
3
|
-
import { SpecContext, PageContext } from "../../renderer/context.js";
|
|
4
|
-
import {
|
|
3
|
+
import { SpecContext, PageContext, NavigationContext, SiteContext } from "../../renderer/context.js";
|
|
4
|
+
import { Markdown } from "../ui/Markdown.js";
|
|
5
|
+
import { Header } from "./Header.js";
|
|
5
6
|
import { Sidebar } from "./Sidebar.js";
|
|
6
7
|
import { TableOfContents } from "./TableOfContents.js";
|
|
7
8
|
import { Introduction } from "../openapi/Introduction.js";
|
|
8
9
|
import { SecurityDefinitions } from "../openapi/Security.js";
|
|
9
10
|
import { Tags } from "../openapi/Tags.js";
|
|
10
11
|
import { Definition } from "../openapi/Definition.js";
|
|
12
|
+
import { SocialIcon } from "../ui/SocialIcon.js";
|
|
11
13
|
/**
|
|
12
14
|
* Markdown page content with prose typography.
|
|
13
15
|
*/
|
|
14
|
-
function MarkdownPageContent({ page }) {
|
|
15
|
-
|
|
16
|
+
function MarkdownPageContent({ page, className = "" }) {
|
|
17
|
+
const nav = useContext(NavigationContext);
|
|
18
|
+
// Find the group label for the current page (eyebrow)
|
|
19
|
+
const activeTab = nav.tabs.find((t) => t.slug === nav.activeTabSlug);
|
|
20
|
+
const activeGroup = activeTab?.groups.find((g) => g.items.some((item) => item.id === nav.activePageSlug));
|
|
21
|
+
const eyebrow = activeGroup?.label;
|
|
22
|
+
return (_jsxs("div", { class: `relative grow box-border flex-col w-full mx-auto px-1 ${className}`, id: "content-area", children: [_jsxs("header", { class: "relative leading-none", children: [_jsxs("div", { class: "mt-0.5 space-y-2.5", children: [eyebrow && (_jsx("div", { class: "h-5 text-[rgb(var(--color-primary))] dark:text-[rgb(var(--color-primary-light))] text-sm font-semibold", children: eyebrow })), _jsx("div", { class: "flex flex-col sm:flex-row items-start sm:items-center relative gap-2 min-w-0", children: _jsx("h1", { class: "text-2xl sm:text-3xl text-[rgb(var(--color-gray-900))] tracking-tight dark:text-[rgb(var(--color-gray-200))] font-bold", style: "overflow-wrap: anywhere", children: page.title }) })] }), page.description && (_jsx("div", { class: "mt-2 text-lg prose prose-gray dark:prose-invert", style: "overflow-wrap: anywhere", children: _jsx(Markdown, { content: page.description, inline: true }) }))] }), _jsx("div", { class: "prose prose-gray dark:prose-invert relative mt-8 mb-14 max-w-none", dangerouslySetInnerHTML: { __html: page.html } }), _jsx(ContentFooter, {})] }));
|
|
16
23
|
}
|
|
17
24
|
/**
|
|
18
|
-
* OpenAPI spec page content
|
|
25
|
+
* OpenAPI spec page content.
|
|
19
26
|
*/
|
|
20
|
-
function SpecPageContent() {
|
|
27
|
+
function SpecPageContent({ className = "" }) {
|
|
21
28
|
const spec = useContext(SpecContext);
|
|
22
29
|
const serverUrl = spec.servers[0]?.url ?? "/";
|
|
23
|
-
return (
|
|
30
|
+
return (_jsxs("div", { class: `relative grow box-border flex-col w-full mx-auto px-1 ${className}`, id: "content-area", children: [_jsxs("article", { children: [_jsx("header", { class: "mb-8", children: _jsxs("div", { class: "flex items-baseline gap-3", children: [_jsx("h1", { class: "text-2xl sm:text-3xl font-bold text-[rgb(var(--color-gray-900))] dark:text-[rgb(var(--color-gray-200))] tracking-tight", children: spec.info.title }), _jsxs("span", { class: "text-sm text-[rgb(var(--color-gray-400))]", children: ["v", spec.info.version] })] }) }), _jsx(Introduction, {}), _jsx(SecurityDefinitions, {}), _jsx(Tags, { tags: spec.tags, serverUrl: serverUrl }), Object.keys(spec.schemas).length > 0 && (_jsxs("div", { class: "mt-12", children: [_jsx("div", { class: "mb-6", children: _jsx("h1", { class: "text-xl font-bold text-[rgb(var(--color-gray-900))] dark:text-[rgb(var(--color-gray-200))]", children: "Models" }) }), Object.entries(spec.schemas).map(([name, schema]) => (_jsx(Definition, { name: name, schema: schema }, name)))] }))] }), _jsx(ContentFooter, {})] }));
|
|
24
31
|
}
|
|
25
|
-
|
|
32
|
+
function ContentFooter() {
|
|
33
|
+
const site = useContext(SiteContext);
|
|
34
|
+
const page = useContext(PageContext);
|
|
35
|
+
const links = site.footer.links;
|
|
36
|
+
// Build "Edit this page" URL for markdown pages when repo is configured
|
|
37
|
+
let editUrl;
|
|
38
|
+
if (site.repo && page.kind === "markdown" && page.markdown?.sourcePath) {
|
|
39
|
+
const repoBase = site.repo.replace(/\/$/, "");
|
|
40
|
+
editUrl = `${repoBase}/edit/main/${page.markdown.sourcePath}`;
|
|
41
|
+
}
|
|
42
|
+
const linkStyle = "hover:text-[rgb(var(--color-gray-600))] dark:hover:text-[rgb(var(--color-gray-300))] transition-colors";
|
|
43
|
+
return (_jsxs("div", { class: "mt-16 mb-8 flex items-center justify-between border-t border-[rgb(var(--color-gray-200)/0.7)] dark:border-[rgb(var(--color-gray-800)/0.5)] pt-6 text-xs text-[rgb(var(--color-gray-400))]", children: [_jsxs("span", { children: ["Built with", " ", _jsx("a", { href: "https://sourcey.com", target: "_blank", rel: "noopener noreferrer", class: linkStyle, children: "Sourcey" })] }), _jsxs("div", { class: "flex items-center gap-4", children: [editUrl && (_jsx("a", { href: editUrl, target: "_blank", rel: "noopener noreferrer", class: linkStyle, children: "Edit this page" })), links.map((link) => (_jsx("a", { href: link.href, target: "_blank", rel: "noopener noreferrer", class: linkStyle, children: link.type === "link"
|
|
44
|
+
? (link.label ?? link.href)
|
|
45
|
+
: (_jsxs(_Fragment, { children: [_jsx(SocialIcon, { type: link.type }), link.label && _jsx("span", { class: "ml-1", children: link.label })] })) }, link.href)))] })] }));
|
|
46
|
+
}
|
|
47
|
+
// ---------------------------------------------------------------------------
|
|
48
|
+
// Layout presets
|
|
49
|
+
// ---------------------------------------------------------------------------
|
|
50
|
+
function DefaultLayout() {
|
|
51
|
+
const page = useContext(PageContext);
|
|
52
|
+
return (_jsxs("div", { class: "max-w-[92rem] mx-auto relative px-4 lg:px-8", children: [_jsx(Sidebar, {}), _jsx("div", { id: "docs", class: "pt-40 lg:pt-10", children: page.kind === "markdown" ? (_jsxs("div", { class: "flex flex-row-reverse gap-12 box-border w-full", children: [_jsx(TableOfContents, { headings: page.markdown.headings }), _jsx(MarkdownPageContent, { page: page.markdown, className: "lg:pl-[23.7rem] lg:-ml-12 xl:w-[calc(100%-28rem)]" })] })) : (_jsx(SpecPageContent, { className: "lg:pl-[23.7rem] lg:-ml-12" })) })] }));
|
|
53
|
+
}
|
|
54
|
+
function MinimalLayout() {
|
|
26
55
|
const page = useContext(PageContext);
|
|
27
|
-
return (
|
|
56
|
+
return (_jsx("div", { class: "max-w-3xl mx-auto relative px-4 lg:px-8", children: _jsx("div", { id: "docs", class: "pt-40 lg:pt-10", children: page.kind === "markdown" ? (_jsx(MarkdownPageContent, { page: page.markdown })) : (_jsx(SpecPageContent, {})) }) }));
|
|
57
|
+
}
|
|
58
|
+
function ApiFirstLayout() {
|
|
59
|
+
const page = useContext(PageContext);
|
|
60
|
+
return (_jsxs("div", { class: "max-w-[92rem] mx-auto relative px-4 lg:px-8", children: [_jsx(Sidebar, {}), _jsx("div", { id: "docs", class: "pt-40 lg:pt-10", children: page.kind === "markdown" ? (_jsxs("div", { class: "flex flex-row-reverse gap-12 box-border w-full", children: [_jsx(TableOfContents, { headings: page.markdown.headings }), _jsx(MarkdownPageContent, { page: page.markdown, className: "lg:pl-[23.7rem] lg:-ml-12 xl:w-[calc(100%-28rem)]" })] })) : (_jsx(SpecPageContent, { className: "lg:pl-[23.7rem] lg:-ml-12" })) })] }));
|
|
61
|
+
}
|
|
62
|
+
// ---------------------------------------------------------------------------
|
|
63
|
+
// Page shell
|
|
64
|
+
// ---------------------------------------------------------------------------
|
|
65
|
+
export function Page() {
|
|
66
|
+
const site = useContext(SiteContext);
|
|
67
|
+
const preset = site.theme.preset;
|
|
68
|
+
const Layout = preset === "minimal" ? MinimalLayout
|
|
69
|
+
: preset === "api-first" ? ApiFirstLayout
|
|
70
|
+
: DefaultLayout;
|
|
71
|
+
return (_jsxs("div", { id: "page", class: "relative antialiased text-[rgb(var(--color-gray-500))] dark:text-[rgb(var(--color-gray-400))]", children: [_jsx(Header, {}), _jsx("span", { class: "fixed inset-0 bg-[rgb(var(--color-background-light))] dark:bg-[rgb(var(--color-background-dark))] -z-10 pointer-events-none" }), _jsx(Layout, {}), _jsx("div", { id: "search-dialog", role: "dialog", "aria-label": "Search", children: _jsxs("div", { class: "search-dialog-inner", children: [_jsxs("div", { class: "search-input-row", children: [_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 20 20", fill: "currentColor", class: "search-input-icon", children: _jsx("path", { "fill-rule": "evenodd", d: "M9 3.5a5.5 5.5 0 1 0 0 11 5.5 5.5 0 0 0 0-11ZM2 9a7 7 0 1 1 12.452 4.391l3.328 3.329a.75.75 0 1 1-1.06 1.06l-3.329-3.328A7 7 0 0 1 2 9Z", "clip-rule": "evenodd" }) }), _jsx("input", { id: "search-input", type: "text", placeholder: "Search docs...", autocomplete: "off", spellcheck: false })] }), _jsx("div", { id: "search-results" }), _jsxs("div", { class: "search-footer", children: [_jsxs("span", { class: "search-footer-hint", children: [_jsx("kbd", { children: "\u2191\u2193" }), " navigate"] }), _jsxs("span", { class: "search-footer-hint", children: [_jsx("kbd", { children: "\u21B5" }), " select"] }), _jsxs("span", { class: "search-footer-hint", children: [_jsx("kbd", { children: "esc" }), " close"] })] })] }) })] }));
|
|
28
72
|
}
|
|
29
73
|
//# sourceMappingURL=Page.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Page.js","sourceRoot":"","sources":["../../../src/components/layout/Page.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"Page.js","sourceRoot":"","sources":["../../../src/components/layout/Page.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,WAAW,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CAAC,CAAC,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,cAAc;YACzC,CAAC,CAAC,aAAa,CAAC;IAElB,OAAO,CACL,eAAK,EAAE,EAAC,MAAM,EAAC,KAAK,EAAC,+FAA+F,aAClH,KAAC,MAAM,KAAG,EACV,eAAM,KAAK,EAAC,6HAA6H,GAAG,EAC5I,KAAC,MAAM,KAAG,EACV,cAAK,EAAE,EAAC,eAAe,EAAC,IAAI,EAAC,QAAQ,gBAAY,QAAQ,YACvD,eAAK,KAAK,EAAC,qBAAqB,aAC9B,eAAK,KAAK,EAAC,kBAAkB,aAC3B,cAAK,KAAK,EAAC,4BAA4B,EAAC,OAAO,EAAC,WAAW,EAAC,IAAI,EAAC,cAAc,EAAC,KAAK,EAAC,mBAAmB,YACvG,4BAAgB,SAAS,EAAC,CAAC,EAAC,yIAAyI,eAAW,SAAS,GAAG,GACxL,EACN,gBACE,EAAE,EAAC,cAAc,EACjB,IAAI,EAAC,MAAM,EACX,WAAW,EAAC,gBAAgB,EAC5B,YAAY,EAAC,KAAK,EAClB,UAAU,EAAE,KAAK,GACjB,IACE,EACN,cAAK,EAAE,EAAC,gBAAgB,GAAG,EAC3B,eAAK,KAAK,EAAC,eAAe,aACxB,gBAAM,KAAK,EAAC,oBAAoB,aAAC,yCAAa,iBAAgB,EAC9D,gBAAM,KAAK,EAAC,oBAAoB,aAAC,mCAAY,eAAc,EAC3D,gBAAM,KAAK,EAAC,oBAAoB,aAAC,gCAAc,cAAa,IACxD,IACF,GACF,IACF,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -33,7 +33,7 @@ export function Sidebar() {
|
|
|
33
33
|
if (!activeTab)
|
|
34
34
|
return null;
|
|
35
35
|
const base = options.assetBase;
|
|
36
|
-
return (_jsx("div", { id: "sidebar", class: "z-20 hidden lg:block fixed bottom-0 right-auto w-[18rem]", style: "top:
|
|
36
|
+
return (_jsx("div", { id: "sidebar", class: "z-20 hidden lg:block fixed bottom-0 right-auto w-[18rem]", style: "top: var(--header-height)", children: _jsx("div", { class: "absolute inset-0 z-10 overflow-auto pr-8 pb-10", id: "sidebar-content", children: _jsxs("div", { class: "relative lg:text-sm lg:leading-6", children: [_jsx("div", { class: "sticky top-0 h-8 z-10 bg-gradient-to-b from-[rgb(var(--color-background-light))] dark:from-[rgb(var(--color-background-dark))]" }), _jsx("nav", { id: "nav", role: "navigation", children: activeTab.groups.map((group, gi) => (_jsxs("div", { class: gi > 0 ? "mt-6 lg:mt-8" : "", children: [group.label && (_jsx("div", { class: "flex items-center gap-2.5 pl-4 mb-3.5 lg:mb-2.5 font-semibold text-[rgb(var(--color-gray-900))] dark:text-[rgb(var(--color-gray-200))]", children: _jsx("h5", { children: group.label }) })), _jsx("ul", { class: "space-y-px", children: group.items.map((item) => {
|
|
37
37
|
const isActive = item.id === nav.activePageSlug;
|
|
38
38
|
return (_jsx("li", { class: "relative", children: _jsxs("a", { href: `${base}${item.href}`, class: `nav-link${isActive ? " active" : ""}`, children: [item.method && _jsx(MethodPill, { method: item.method }), _jsx("div", { class: "flex-1 break-words [word-break:break-word]", children: item.label })] }) }, item.id));
|
|
39
39
|
}) })] }, group.label))) })] }) }) }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sidebar.js","sourceRoot":"","sources":["../../../src/components/layout/Sidebar.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE9E;;;GAGG;AACH,SAAS,UAAU,CAAC,EAAE,MAAM,EAAsB;IAChD,MAAM,CAAC,GAAG,MAAM,CAAC,WAAW,EAAE,CAAC;IAC/B,MAAM,KAAK,GAAG,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IAEzC,qBAAqB;IACrB,MAAM,MAAM,GAA2B;QACrC,GAAG,EAAE,yEAAyE;QAC9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CACd,cAAK,KAAK,EAAC,wIAAwI,YACjJ,uBAAK,KAAK,CAAC,KAAK,GAAM,GAClB,CACP,EACD,aAAI,KAAK,EAAC,YAAY,YACnB,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;wCACxB,MAAM,QAAQ,GAAG,IAAI,CAAC,EAAE,KAAK,GAAG,CAAC,cAAc,CAAC;wCAChD,OAAO,CACL,aAAkB,KAAK,EAAC,UAAU,YAChC,aACE,IAAI,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC,IAAI,EAAE,EAC3B,KAAK,EAAE,WAAW,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,aAE5C,IAAI,CAAC,MAAM,IAAI,KAAC,UAAU,IAAC,MAAM,EAAE,IAAI,CAAC,MAAM,GAAI,EACnD,cAAK,KAAK,EAAC,4CAA4C,YAAE,IAAI,CAAC,KAAK,GAAO,IACxE,IAPG,IAAI,CAAC,EAAE,CAQX,CACN,CAAC;oCACJ,CAAC,CAAC,GACC,KArBG,KAAK,CAAC,KAAK,CAsBf,CACP,CAAC,GACE,IACF,GACF,GACF,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableOfContents.d.ts","sourceRoot":"","sources":["../../../src/components/layout/TableOfContents.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAEjE;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,WAAW,EAAE,CAAA;CAAE,
|
|
1
|
+
{"version":3,"file":"TableOfContents.d.ts","sourceRoot":"","sources":["../../../src/components/layout/TableOfContents.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAEjE;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,WAAW,EAAE,CAAA;CAAE,uCAiCxE"}
|
|
@@ -7,6 +7,6 @@ import { jsx as _jsx, jsxs as _jsxs } from "preact/jsx-runtime";
|
|
|
7
7
|
export function TableOfContents({ headings }) {
|
|
8
8
|
if (headings.length === 0)
|
|
9
9
|
return null;
|
|
10
|
-
return (_jsx("aside", { id: "toc", class: "hidden xl:flex self-start sticky xl:flex-col max-w-[28rem] z-[21]
|
|
10
|
+
return (_jsx("aside", { id: "toc", class: "hidden xl:flex self-start sticky xl:flex-col max-w-[28rem] z-[21]", style: "height: calc(100vh - var(--header-height) - 2.5rem); top: calc(var(--header-height) + 2.5rem)", children: _jsx("div", { class: "z-10 hidden xl:flex box-border max-h-full pl-10 w-[19rem]", children: _jsxs("div", { class: "text-[rgb(var(--color-gray-600))] text-sm leading-6 w-[16.5rem] overflow-y-auto space-y-2 pb-4 -mt-10 pt-10", children: [_jsx("h5", { class: "font-semibold text-[rgb(var(--color-gray-900))] dark:text-[rgb(var(--color-gray-200))]", children: "On this page" }), _jsx("nav", { children: _jsx("ul", { class: "space-y-0.5", children: headings.map((h) => (_jsx("li", { class: "relative", children: _jsx("a", { href: `#${h.id}`, class: `toc-item break-words py-1 block hover:text-[rgb(var(--color-gray-900))] dark:hover:text-[rgb(var(--color-gray-300))] dark:text-[rgb(var(--color-gray-400))] transition-colors ${h.level >= 3 ? "pl-3 text-[13px]" : ""}`, children: h.text }) }, h.id))) }) })] }) }) }));
|
|
11
11
|
}
|
|
12
12
|
//# sourceMappingURL=TableOfContents.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableOfContents.js","sourceRoot":"","sources":["../../../src/components/layout/TableOfContents.tsx"],"names":[],"mappings":";AAEA;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,EAAE,QAAQ,EAA+B;IACvE,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAEvC,OAAO,CACL,gBACE,EAAE,EAAC,KAAK,EACR,KAAK,EAAC,
|
|
1
|
+
{"version":3,"file":"TableOfContents.js","sourceRoot":"","sources":["../../../src/components/layout/TableOfContents.tsx"],"names":[],"mappings":";AAEA;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,EAAE,QAAQ,EAA+B;IACvE,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAEvC,OAAO,CACL,gBACE,EAAE,EAAC,KAAK,EACR,KAAK,EAAC,mEAAmE,EACzE,KAAK,EAAC,+FAA+F,YAErG,cAAK,KAAK,EAAC,2DAA2D,YACpE,eAAK,KAAK,EAAC,6GAA6G,aACtH,aAAI,KAAK,EAAC,wFAAwF,6BAAkB,EAEpH,wBACE,aAAI,KAAK,EAAC,aAAa,YACpB,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CACnB,aAAe,KAAK,EAAC,UAAU,YAC7B,YACE,IAAI,EAAE,IAAI,CAAC,CAAC,EAAE,EAAE,EAChB,KAAK,EAAE,iLACL,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,EACtC,EAAE,YAED,CAAC,CAAC,IAAI,GACL,IARG,CAAC,CAAC,EAAE,CASR,CACN,CAAC,GACC,GACD,IACF,GACF,GACA,CACT,CAAC;AACJ,CAAC"}
|
|
@@ -2,10 +2,12 @@ import type { NormalizedOperation } from "../../core/types.js";
|
|
|
2
2
|
interface CodeSamplesProps {
|
|
3
3
|
operation: NormalizedOperation;
|
|
4
4
|
serverUrl: string;
|
|
5
|
+
codeSampleLangs?: string[];
|
|
5
6
|
}
|
|
6
7
|
/**
|
|
7
|
-
* Code samples in a
|
|
8
|
+
* Code samples in a stone-themed card with language dropdown and copy button.
|
|
9
|
+
* Language dropdown and copy button for generated request examples.
|
|
8
10
|
*/
|
|
9
|
-
export declare function CodeSamplesExamples({ operation, serverUrl }: CodeSamplesProps): import("preact").JSX.Element | null;
|
|
11
|
+
export declare function CodeSamplesExamples({ operation, serverUrl, codeSampleLangs }: CodeSamplesProps): import("preact").JSX.Element | null;
|
|
10
12
|
export {};
|
|
11
13
|
//# sourceMappingURL=CodeSamples.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CodeSamples.d.ts","sourceRoot":"","sources":["../../../src/components/openapi/CodeSamples.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"CodeSamples.d.ts","sourceRoot":"","sources":["../../../src/components/openapi/CodeSamples.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAM/D,UAAU,gBAAgB;IACxB,SAAS,EAAE,mBAAmB,CAAC;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;CAC5B;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,EAAE,SAAS,EAAE,SAAS,EAAE,eAAe,EAAE,EAAE,gBAAgB,uCAuE9F"}
|
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "preact/jsx-runtime";
|
|
2
2
|
import { generateCodeSamples } from "../../utils/code-samples.js";
|
|
3
3
|
import { highlightCode } from "../../utils/highlighter.js";
|
|
4
|
+
import { langIcon } from "../../utils/lang-icons.js";
|
|
5
|
+
import { CopyButton } from "../ui/CopyButton.js";
|
|
4
6
|
/**
|
|
5
|
-
* Code samples in a
|
|
7
|
+
* Code samples in a stone-themed card with language dropdown and copy button.
|
|
8
|
+
* Language dropdown and copy button for generated request examples.
|
|
6
9
|
*/
|
|
7
|
-
export function CodeSamplesExamples({ operation, serverUrl }) {
|
|
8
|
-
const samples = generateCodeSamples(operation, serverUrl);
|
|
10
|
+
export function CodeSamplesExamples({ operation, serverUrl, codeSampleLangs }) {
|
|
11
|
+
const samples = generateCodeSamples(operation, serverUrl, codeSampleLangs);
|
|
9
12
|
if (!samples.length)
|
|
10
13
|
return null;
|
|
11
|
-
|
|
14
|
+
const title = operation.summary ?? `${operation.method.toUpperCase()} ${operation.path}`;
|
|
15
|
+
return (_jsxs("div", { class: "code-group not-prose relative flex flex-col rounded-[var(--radius)] border border-[rgb(var(--color-stone-950)/0.1)] dark:border-[rgb(255_255_255/0.1)]", children: [_jsxs("div", { class: "relative flex items-center justify-between gap-2 px-3", children: [_jsx("div", { class: "flex min-w-0 items-center gap-1.5 font-medium text-xs leading-6 my-1 mb-1.5", children: _jsx("span", { class: "truncate text-[rgb(var(--color-stone-950))] dark:text-[rgb(var(--color-stone-50))]", children: title }) }), _jsxs("div", { class: "flex shrink-0 items-center justify-end gap-1.5", children: [_jsxs("div", { class: "code-lang-dropdown relative", children: [_jsx("button", { type: "button", class: "code-lang-trigger group relative my-1 mb-1.5 flex items-center whitespace-nowrap font-medium leading-6 outline-0 text-[rgb(var(--color-stone-500))] dark:text-[rgb(var(--color-stone-400))] cursor-pointer text-xs", "aria-expanded": "false", "aria-haspopup": "listbox", children: _jsxs("div", { class: "z-10 flex items-center gap-1 rounded-lg px-1.5 group-hover:bg-[rgb(var(--color-stone-200)/0.5)] group-hover:text-[rgb(var(--color-primary))] dark:group-hover:bg-[rgb(var(--color-stone-700)/0.7)] dark:group-hover:text-[rgb(var(--color-primary-light))]", children: [_jsx("span", { class: "code-lang-icon", dangerouslySetInnerHTML: { __html: langIcon(samples[0].lang) } }), _jsx("span", { class: "code-lang-label truncate", children: samples[0].label ?? samples[0].lang }), _jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", class: "size-3.5 shrink-0", children: [_jsx("path", { d: "m7 15 5 5 5-5" }), _jsx("path", { d: "m7 9 5-5 5 5" })] })] }) }), _jsx("div", { class: "code-lang-menu hidden absolute right-0 top-full mt-1 z-20 min-w-[120px] rounded-lg border border-[rgb(var(--color-stone-200))] dark:border-[rgb(255_255_255/0.1)] bg-[rgb(var(--color-background-light))] dark:bg-[rgb(var(--color-gray-900))] shadow-lg py-1", role: "listbox", children: samples.map((sample, i) => (_jsxs("button", { role: "option", "aria-selected": i === 0 ? "true" : "false", class: `code-lang-option w-full text-left px-3 py-1.5 text-xs font-medium flex items-center gap-1.5 hover:bg-[rgb(var(--color-stone-100))] dark:hover:bg-[rgb(255_255_255/0.05)] ${i === 0 ? "text-[rgb(var(--color-primary))] dark:text-[rgb(var(--color-primary-light))]" : "text-[rgb(var(--color-stone-600))] dark:text-[rgb(var(--color-stone-400))]"}`, "data-lang-index": String(i), children: [_jsx("span", { dangerouslySetInnerHTML: { __html: langIcon(sample.lang) } }), sample.label ?? sample.lang] }, i))) })] }), _jsx(CopyButton, {})] })] }), samples.map((sample, i) => {
|
|
12
16
|
const html = highlightCode(sample.source, sample.lang);
|
|
13
|
-
return (_jsx("div", { class: `code-
|
|
17
|
+
return (_jsx("div", { class: `code-lang-panel${i === 0 ? " active" : ""}`, "data-lang-panel": String(i), children: _jsx("div", { class: "relative w-full px-4 py-3.5 text-sm leading-6 bg-[rgb(var(--color-code-block-light))] dark:bg-[rgb(var(--color-code-block-dark))] overflow-x-auto", style: "font-variant-ligatures: none", children: _jsx("div", { class: "font-mono whitespace-pre text-xs leading-[1.35rem] code-block", dangerouslySetInnerHTML: { __html: html } }) }) }, i));
|
|
14
18
|
})] }));
|
|
15
19
|
}
|
|
16
20
|
//# sourceMappingURL=CodeSamples.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CodeSamples.js","sourceRoot":"","sources":["../../../src/components/openapi/CodeSamples.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,aAAa,EAA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S,CAAC,CAAC,CAAC,EAAE,EAAE,qBAClC,MAAM,CAAC,CAAC,CAAC,YAE1B,cAAK,KAAK,EAAC,mJAAmJ,EAAC,KAAK,EAAC,8BAA8B,YACjM,cAAK,KAAK,EAAC,+DAA+D,EAAC,uBAAuB,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,GAAI,GACpH,IAND,CAAC,CAOF,CACP,CAAC;YACJ,CAAC,CAAC,IACE,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -7,6 +7,6 @@ import { ExampleView } from "../schema/ExampleView.js";
|
|
|
7
7
|
*/
|
|
8
8
|
export function Definition({ name, schema }) {
|
|
9
9
|
const id = `definition-${htmlId(name)}`;
|
|
10
|
-
return (_jsxs("div", { id: id, class: "py-8 border-t border-[rgb(var(--color-gray-100))] dark:border-[rgb(var(--color-gray-800))]", "data-traverse-target": id, children: [_jsx("a", { id: `/definitions/${name}` }), _jsx("header", { class: "mb-4", children: _jsxs("div", { class: "flex items-baseline gap-2", children: [_jsx("h2", { class: "text-xl font-bold text-[rgb(var(--color-gray-900))] dark:text-[rgb(var(--color-gray-200))]", children: name }), _jsx("span", { class: "text-sm text-[rgb(var(--color-gray-500))] font-normal", children: schema.type ?? "object" })] }) }), _jsxs("div", { class: "flex flex-col xl:flex-row gap-8", children: [_jsx("div", { class: "flex-1 min-w-0", children: _jsx(SchemaView, { schema: schema }) }), _jsx("aside", { class: "hidden xl:block w-[28rem] shrink-0 sticky top-
|
|
10
|
+
return (_jsxs("div", { id: id, class: "py-8 border-t border-[rgb(var(--color-gray-100))] dark:border-[rgb(var(--color-gray-800))]", "data-traverse-target": id, children: [_jsx("a", { id: `/definitions/${name}` }), _jsx("header", { class: "mb-4", children: _jsxs("div", { class: "flex items-baseline gap-2", children: [_jsx("h2", { class: "text-xl font-bold text-[rgb(var(--color-gray-900))] dark:text-[rgb(var(--color-gray-200))]", children: name }), _jsx("span", { class: "text-sm text-[rgb(var(--color-gray-500))] font-normal", children: schema.type ?? "object" })] }) }), _jsxs("div", { class: "flex flex-col xl:flex-row gap-8", children: [_jsx("div", { class: "flex-1 min-w-0", children: _jsx(SchemaView, { schema: schema }) }), _jsx("aside", { class: "hidden xl:block w-[28rem] shrink-0 sticky self-start", style: "top: calc(var(--header-height) + 2.5rem)", children: _jsx(ExampleView, { schema: schema, title: "Example" }) })] }), _jsx("div", { class: "xl:hidden mt-6", children: _jsx(ExampleView, { schema: schema, title: "Example" }) })] }));
|
|
11
11
|
}
|
|
12
12
|
//# sourceMappingURL=Definition.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Definition.js","sourceRoot":"","sources":["../../../src/components/openapi/Definition.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAOvD;;GAEG;AACH,MAAM,UAAU,UAAU,CAAC,EAAE,IAAI,EAAE,MAAM,EAAmB;IAC1D,MAAM,EAAE,GAAG,cAAc,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;IAExC,OAAO,CACL,eAAK,EAAE,EAAE,EAAE,EAAE,KAAK,EAAC,4FAA4F,0BAAuB,EAAE,aACtI,YAAG,EAAE,EAAE,gBAAgB,IAAI,EAAE,GAAI,EACjC,iBAAQ,KAAK,EAAC,MAAM,YAClB,eAAK,KAAK,EAAC,2BAA2B,aACpC,aAAI,KAAK,EAAC,4FAA4F,YAAE,IAAI,GAAM,EAClH,eAAM,KAAK,EAAC,uDAAuD,YAAE,MAAM,CAAC,IAAI,IAAI,QAAQ,GAAQ,IAChG,GACC,EAET,eAAK,KAAK,EAAC,iCAAiC,aAE1C,cAAK,KAAK,EAAC,gBAAgB,YACzB,KAAC,UAAU,IAAC,MAAM,EAAE,MAAM,GAAI,GAC1B,EAGN,gBAAO,KAAK,EAAC,
|
|
1
|
+
{"version":3,"file":"Definition.js","sourceRoot":"","sources":["../../../src/components/openapi/Definition.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAOvD;;GAEG;AACH,MAAM,UAAU,UAAU,CAAC,EAAE,IAAI,EAAE,MAAM,EAAmB;IAC1D,MAAM,EAAE,GAAG,cAAc,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;IAExC,OAAO,CACL,eAAK,EAAE,EAAE,EAAE,EAAE,KAAK,EAAC,4FAA4F,0BAAuB,EAAE,aACtI,YAAG,EAAE,EAAE,gBAAgB,IAAI,EAAE,GAAI,EACjC,iBAAQ,KAAK,EAAC,MAAM,YAClB,eAAK,KAAK,EAAC,2BAA2B,aACpC,aAAI,KAAK,EAAC,4FAA4F,YAAE,IAAI,GAAM,EAClH,eAAM,KAAK,EAAC,uDAAuD,YAAE,MAAM,CAAC,IAAI,IAAI,QAAQ,GAAQ,IAChG,GACC,EAET,eAAK,KAAK,EAAC,iCAAiC,aAE1C,cAAK,KAAK,EAAC,gBAAgB,YACzB,KAAC,UAAU,IAAC,MAAM,EAAE,MAAM,GAAI,GAC1B,EAGN,gBAAO,KAAK,EAAC,sDAAsD,EAAC,KAAK,EAAC,0CAA0C,YAClH,KAAC,WAAW,IAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAC,SAAS,GAAG,GACzC,IACJ,EAGN,cAAK,KAAK,EAAC,gBAAgB,YACzB,KAAC,WAAW,IAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAC,SAAS,GAAG,GAC3C,IACF,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EndpointBar.d.ts","sourceRoot":"","sources":["../../../src/components/openapi/EndpointBar.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAUH,UAAU,gBAAgB;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,wBAAgB,WAAW,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,gBAAgB,
|
|
1
|
+
{"version":3,"file":"EndpointBar.d.ts","sourceRoot":"","sources":["../../../src/components/openapi/EndpointBar.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAUH,UAAU,gBAAgB;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,wBAAgB,WAAW,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,gBAAgB,gCAkCxE"}
|
|
@@ -15,8 +15,8 @@ export function EndpointBar({ method, path, serverUrl }) {
|
|
|
15
15
|
const colorClass = METHOD_COLORS[m] ?? "bg-gray-400/20 text-gray-700";
|
|
16
16
|
// Split path into segments for styled rendering
|
|
17
17
|
const segments = path.split("/").filter(Boolean);
|
|
18
|
-
return (
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
return (_jsxs("div", { class: "flex items-center gap-2 rounded-[var(--radius)] border border-[rgb(var(--color-gray-200)/0.7)] dark:border-[rgb(var(--color-border-dark-subtle)/0.1)] px-3 py-2.5 mb-6 overflow-hidden", children: [_jsx("div", { class: `rounded-lg font-bold px-1.5 py-0.5 text-sm leading-5 shrink-0 ${colorClass}`, children: method.toUpperCase() }), _jsxs("div", { class: "flex items-center overflow-x-auto flex-1 no-scrollbar gap-0.5 font-mono", children: [_jsx("span", { class: "text-sm text-[rgb(var(--color-gray-500))] dark:text-[rgb(var(--color-gray-500))] shrink-0", children: serverUrl }), segments.map((seg, i) => (_jsxs("span", { class: "flex items-center shrink-0", children: [_jsx("span", { class: "text-sm text-[rgb(var(--color-gray-400))]", children: "/" }), _jsx("span", { class: `text-sm font-medium ${seg.startsWith("{")
|
|
19
|
+
? "text-[rgb(var(--color-primary))] dark:text-[rgb(var(--color-primary-light))]"
|
|
20
|
+
: "text-[rgb(var(--color-gray-800))] dark:text-[rgb(var(--color-gray-50))]"}`, children: seg })] }, i)))] })] }));
|
|
21
21
|
}
|
|
22
22
|
//# sourceMappingURL=EndpointBar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EndpointBar.js","sourceRoot":"","sources":["../../../src/components/openapi/EndpointBar.tsx"],"names":[],"mappings":";AAAA;;;GAGG;AAEH,MAAM,aAAa,GAA2B;IAC5C,GAAG,EAAE,yEAAyE;IAC9E,IAAI,EAAE,qEAAqE;IAC3E,GAAG,EAAE,6EAA6E;IAClF,MAAM,EAAE,iEAAiE;IACzE,KAAK,EAAE,6EAA6E;CACrF,CAAC;AAQF,MAAM,UAAU,WAAW,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAoB;IACvE,MAAM,CAAC,GAAG,MAAM,CAAC,WAAW,EAAE,CAAC;IAC/B,MAAM,UAAU,GAAG,aAAa,CAAC,CAAC,CAAC,IAAI,8BAA8B,CAAC;IAEtE,gDAAgD;IAChD,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAEjD,OAAO,CACL,
|
|
1
|
+
{"version":3,"file":"EndpointBar.js","sourceRoot":"","sources":["../../../src/components/openapi/EndpointBar.tsx"],"names":[],"mappings":";AAAA;;;GAGG;AAEH,MAAM,aAAa,GAA2B;IAC5C,GAAG,EAAE,yEAAyE;IAC9E,IAAI,EAAE,qEAAqE;IAC3E,GAAG,EAAE,6EAA6E;IAClF,MAAM,EAAE,iEAAiE;IACzE,KAAK,EAAE,6EAA6E;CACrF,CAAC;AAQF,MAAM,UAAU,WAAW,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAoB;IACvE,MAAM,CAAC,GAAG,MAAM,CAAC,WAAW,EAAE,CAAC;IAC/B,MAAM,UAAU,GAAG,aAAa,CAAC,CAAC,CAAC,IAAI,8BAA8B,CAAC;IAEtE,gDAAgD;IAChD,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAEjD,OAAO,CACL,eAAK,KAAK,EAAC,wLAAwL,aAEjM,cAAK,KAAK,EAAE,iEAAiE,UAAU,EAAE,YACtF,MAAM,CAAC,WAAW,EAAE,GACjB,EAGN,eAAK,KAAK,EAAC,yEAAyE,aAClF,eAAM,KAAK,EAAC,2FAA2F,YACpG,SAAS,GACL,EACN,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,CACxB,gBAAc,KAAK,EAAC,4BAA4B,aAC9C,eAAM,KAAK,EAAC,2CAA2C,kBAAS,EAChE,eAAM,KAAK,EAAE,uBACX,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC;oCACjB,CAAC,CAAC,8EAA8E;oCAChF,CAAC,CAAC,yEACN,EAAE,YACC,GAAG,GACC,KARE,CAAC,CASL,CACR,CAAC,IACE,IACF,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Introduction.d.ts","sourceRoot":"","sources":["../../../src/components/openapi/Introduction.tsx"],"names":[],"mappings":"AAIA;;;GAGG;AACH,wBAAgB,YAAY,
|
|
1
|
+
{"version":3,"file":"Introduction.d.ts","sourceRoot":"","sources":["../../../src/components/openapi/Introduction.tsx"],"names":[],"mappings":"AAIA;;;GAGG;AACH,wBAAgB,YAAY,iCAuC3B"}
|
|
@@ -9,6 +9,6 @@ import { Markdown } from "../ui/Markdown.js";
|
|
|
9
9
|
export function Introduction() {
|
|
10
10
|
const spec = useContext(SpecContext);
|
|
11
11
|
const { info, servers } = spec;
|
|
12
|
-
return (_jsxs("div", { id: "introduction", "data-traverse-target": "introduction", class: "mb-8", children: [info.description && (_jsx(
|
|
12
|
+
return (_jsxs("div", { id: "introduction", "data-traverse-target": "introduction", class: "mb-8", children: [info.description && (_jsx(Markdown, { content: info.description, class: "max-w-none" })), info.termsOfService && (_jsx("p", { class: "mt-4 text-sm text-[rgb(var(--color-gray-500))]", children: _jsx("a", { href: info.termsOfService, class: "text-[rgb(var(--color-primary))] dark:text-[rgb(var(--color-primary-light))]", children: "Terms of Service" }) })), info.contact?.email && (_jsxs("p", { class: "mt-2 text-sm text-[rgb(var(--color-gray-500))]", children: ["Contact: ", _jsx("a", { href: `mailto:${info.contact.email}`, class: "text-[rgb(var(--color-primary))] dark:text-[rgb(var(--color-primary-light))]", children: info.contact.email })] })), servers.length > 0 && (_jsxs("div", { class: "mt-6 rounded-[var(--radius)] border border-[rgb(var(--color-gray-200)/0.7)] dark:border-[rgb(var(--color-border-dark-subtle)/0.1)] overflow-hidden", children: [_jsxs("div", { class: "px-4 py-2.5 text-xs font-semibold text-[rgb(var(--color-gray-600))] dark:text-[rgb(var(--color-gray-300))] border-b border-[rgb(var(--color-gray-200)/0.7)] dark:border-[rgb(var(--color-border-dark-subtle)/0.1)]", children: ["Base URL", servers.length > 1 ? "s" : ""] }), servers.map((s, i) => (_jsxs("div", { class: `flex items-baseline gap-3 px-4 py-2 ${i > 0 ? "border-t border-[rgb(var(--color-gray-100))] dark:border-[rgb(var(--color-gray-800))]" : ""}`, children: [_jsx("code", { class: "font-mono text-sm text-[rgb(var(--color-gray-800))] dark:text-[rgb(var(--color-gray-200))]", children: s.url }), s.description && (_jsx("span", { class: "text-xs text-[rgb(var(--color-gray-500))]", children: s.description }))] }, i)))] }))] }));
|
|
13
13
|
}
|
|
14
14
|
//# sourceMappingURL=Introduction.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Introduction.js","sourceRoot":"","sources":["../../../src/components/openapi/Introduction.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1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AC,OAAO,CAAC,KAAK,EAAE,EAAE,KAAK,EAAC,8EAA8E,YAAE,IAAI,CAAC,OAAO,CAAC,KAAK,GAAK,IAC7J,CACL,EAEA,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,CACrB,eAAK,KAAK,EAAC,oJAAoJ,aAC7J,eAAK,KAAK,EAAC,oNAAoN,yBACpN,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,IAClC,EACL,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CACrB,eAAa,KAAK,EAAE,uCAAuC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,uFAAuF,CAAC,CAAC,CAAC,EAAE,EAAE,aAC/J,eAAM,KAAK,EAAC,4FAA4F,YAAE,CAAC,CAAC,GAAG,GAAQ,EACtH,CAAC,CAAC,WAAW,IAAI,CAChB,eAAM,KAAK,EAAC,2CAA2C,YAAE,CAAC,CAAC,WAAW,GAAQ,CAC/E,KAJO,CAAC,CAKL,CACP,CAAC,IACE,CACP,IACG,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Operation.d.ts","sourceRoot":"","sources":["../../../src/components/openapi/Operation.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Operation.d.ts","sourceRoot":"","sources":["../../../src/components/openapi/Operation.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAa/D,UAAU,cAAc;IACtB,SAAS,EAAE,mBAAmB,CAAC;IAC/B,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,cAAc,gCAsErE"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "preact/jsx-runtime";
|
|
2
|
+
import { useContext } from "preact/hooks";
|
|
2
3
|
import { htmlId } from "../../utils/html-id.js";
|
|
4
|
+
import { SiteContext } from "../../renderer/context.js";
|
|
3
5
|
import { Markdown } from "../ui/Markdown.js";
|
|
4
6
|
import { DeprecatedBadge } from "../ui/Badge.js";
|
|
5
7
|
import { SectionLabel } from "../ui/SectionLabel.js";
|
|
@@ -15,9 +17,11 @@ import { EndpointBar } from "./EndpointBar.js";
|
|
|
15
17
|
* - Single-column content (left) + sticky code panel (right, xl+ only)
|
|
16
18
|
*/
|
|
17
19
|
export function Operation({ operation: op, serverUrl }) {
|
|
20
|
+
const site = useContext(SiteContext);
|
|
21
|
+
const apiFirst = site.theme.preset === "api-first";
|
|
18
22
|
const id = `operation-${htmlId(op.path)}-${htmlId(op.method)}`;
|
|
19
23
|
const hasParams = op.parameters.length > 0;
|
|
20
24
|
const hasBody = !!op.requestBody;
|
|
21
|
-
return (_jsxs("div", { id: id, class: "py-8 border-t border-[rgb(var(--color-gray-100))] dark:border-[rgb(var(--color-gray-800))]", "data-traverse-target": id, children: [_jsxs("header", { class: "mb-6", children: [op.summary && (_jsx("h2", { class: "text-2xl sm:text-3xl text-[rgb(var(--color-gray-900))] dark:text-[rgb(var(--color-gray-200))] tracking-tight font-bold mb-2", children: _jsx(Markdown, { content: op.summary, inline: true }) })), op.deprecated && _jsx(DeprecatedBadge, {})] }), _jsx(EndpointBar, { method: op.method, path: op.path, serverUrl: serverUrl }), _jsxs("div", { class:
|
|
25
|
+
return (_jsxs("div", { id: id, class: "py-8 border-t border-[rgb(var(--color-gray-100))] dark:border-[rgb(var(--color-gray-800))]", "data-traverse-target": id, children: [_jsxs("header", { class: "mb-6", children: [op.summary && (_jsx("h2", { class: "text-2xl sm:text-3xl text-[rgb(var(--color-gray-900))] dark:text-[rgb(var(--color-gray-200))] tracking-tight font-bold mb-2", children: _jsx(Markdown, { content: op.summary, inline: true }) })), op.deprecated && _jsx(DeprecatedBadge, {})] }), _jsx(EndpointBar, { method: op.method, path: op.path, serverUrl: serverUrl }), _jsxs("div", { class: `flex flex-col ${apiFirst ? "lg:flex-row" : "xl:flex-row"} gap-8`, children: [_jsxs("div", { class: "flex-1 min-w-0", children: [op.description && (_jsx(Markdown, { content: op.description, class: "mb-6" })), hasBody && (_jsxs("div", { class: "mt-6", children: [_jsx(SectionLabel, { children: "Body" }), _jsx(RequestBody, { body: op.requestBody })] })), hasParams && (_jsxs("div", { class: "mt-6", children: [_jsx(SectionLabel, { children: "Parameters" }), _jsx(Parameters, { parameters: op.parameters })] })), op.responses.length > 0 && (_jsxs("div", { class: "mt-6", children: [_jsx(SectionLabel, { children: "Response" }), _jsx(ResponsesCopy, { responses: op.responses })] })), _jsx(SecurityCopy, { security: op.security })] }), _jsxs("aside", { class: `hidden ${apiFirst ? "lg:block" : "xl:block"} w-[28rem] shrink-0 sticky self-start overflow-y-auto space-y-4`, style: "top: calc(var(--header-height) + 2.5rem); max-height: calc(100vh - var(--header-height) - 5rem)", children: [_jsx(CodeSamplesExamples, { operation: op, serverUrl: serverUrl, codeSampleLangs: site.codeSamples }), hasBody && _jsx(RequestBodyExample, { body: op.requestBody }), _jsx(ResponsesExamples, { responses: op.responses })] })] }), _jsxs("div", { class: `${apiFirst ? "lg:hidden" : "xl:hidden"} mt-8 space-y-4`, children: [_jsx(CodeSamplesExamples, { operation: op, serverUrl: serverUrl, codeSampleLangs: site.codeSamples }), hasBody && _jsx(RequestBodyExample, { body: op.requestBody }), _jsx(ResponsesExamples, { responses: op.responses })] })] }));
|
|
22
26
|
}
|
|
23
27
|
//# sourceMappingURL=Operation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Operation.js","sourceRoot":"","sources":["../../../src/components/openapi/Operation.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"Operation.js","sourceRoot":"","sources":["../../../src/components/openapi/Operation.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,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,EAAE,EAAE,EAAE,SAAS,EAAE,SAAS,EAAE,eAAe,EAAE,IAAI,CAAC,WAAW,GAAI,EAC9F,OAAO,IAAI,KAAC,kBAAkB,IAAC,IAAI,EAAE,EAAE,CAAC,WAAY,GAAI,EACzD,KAAC,iBAAiB,IAAC,SAAS,EAAE,EAAE,CAAC,SAAS,GAAI,IACxC,IACJ,EAGN,eAAK,KAAK,EAAE,GAAG,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,WAAW,iBAAiB,aAClE,KAAC,mBAAmB,IAAC,SAAS,EAAE,EAAE,EAAE,SAAS,EAAE,SAAS,EAAE,eAAe,EAAE,IAAI,CAAC,WAAW,GAAI,EAC9F,OAAO,IAAI,KAAC,kBAAkB,IAAC,IAAI,EAAE,EAAE,CAAC,WAAY,GAAI,EACzD,KAAC,iBAAiB,IAAC,SAAS,EAAE,EAAE,CAAC,SAAS,GAAI,IAC1C,IACF,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -7,7 +7,8 @@ interface ResponsesProps {
|
|
|
7
7
|
*/
|
|
8
8
|
export declare function ResponsesCopy({ responses }: ResponsesProps): import("preact").JSX.Element | null;
|
|
9
9
|
/**
|
|
10
|
-
* Response examples
|
|
10
|
+
* Response examples with status code tabs on the code block card.
|
|
11
|
+
* Status code tabs are part of the code block header.
|
|
11
12
|
*/
|
|
12
13
|
export declare function ResponsesExamples({ responses }: ResponsesProps): import("preact").JSX.Element | null;
|
|
13
14
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Responses.d.ts","sourceRoot":"","sources":["../../../src/components/openapi/Responses.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"Responses.d.ts","sourceRoot":"","sources":["../../../src/components/openapi/Responses.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAS9D,UAAU,cAAc;IACtB,SAAS,EAAE,kBAAkB,EAAE,CAAC;CACjC;AAUD;;GAEG;AACH,wBAAgB,aAAa,CAAC,EAAE,SAAS,EAAE,EAAE,cAAc,uCA6B1D;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,SAAS,EAAE,EAAE,cAAc,uCAiE9D"}
|