@clarify-labs/renderer 0.11.1 → 0.11.3
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/output/{ClarifyShell-CwRtof1h.js → ClarifyShell-4hlqrEgp.js} +3 -3
- package/output/{ClarifyShell-CwRtof1h.js.map → ClarifyShell-4hlqrEgp.js.map} +1 -1
- package/output/{ClarifyShell-C2XnkFQ6.cjs → ClarifyShell-D25PYLE0.cjs} +3 -3
- package/output/{ClarifyShell-C2XnkFQ6.cjs.map → ClarifyShell-D25PYLE0.cjs.map} +1 -1
- package/output/{MermaidViewer-CwkiQ2gO.js → MermaidViewer-D4h-WEak.js} +2 -2
- package/output/{MermaidViewer-CwkiQ2gO.js.map → MermaidViewer-D4h-WEak.js.map} +1 -1
- package/output/{MermaidViewer-CTvMCE19.cjs → MermaidViewer-kbSVqJ_z.cjs} +2 -2
- package/output/{MermaidViewer-CTvMCE19.cjs.map → MermaidViewer-kbSVqJ_z.cjs.map} +1 -1
- package/output/{OpenApiOperation-CFo6_otd.js → OpenApiOperation-BcJYHwft.js} +201 -87
- package/output/OpenApiOperation-BcJYHwft.js.map +1 -0
- package/output/{OpenApiOperation-D1WNrj5X.cjs → OpenApiOperation-HhSjad7q.cjs} +201 -87
- package/output/OpenApiOperation-HhSjad7q.cjs.map +1 -0
- package/output/{PageActions-3eo05fb_.js → PageActions-Bnz5Bybt.js} +44 -27
- package/output/{PageActions-3eo05fb_.js.map → PageActions-Bnz5Bybt.js.map} +1 -1
- package/output/{PageActions-Lp_NeIKr.cjs → PageActions-GVAsO16x.cjs} +44 -27
- package/output/{PageActions-Lp_NeIKr.cjs.map → PageActions-GVAsO16x.cjs.map} +1 -1
- package/output/{SearchDialog-CM9DrE2Y.cjs → SearchDialog-CFMl0YAZ.cjs} +3 -3
- package/output/{SearchDialog-CM9DrE2Y.cjs.map → SearchDialog-CFMl0YAZ.cjs.map} +1 -1
- package/output/{SearchDialog-BvCBIFqs.js → SearchDialog-DL5Y_bQ0.js} +3 -3
- package/output/{SearchDialog-BvCBIFqs.js.map → SearchDialog-DL5Y_bQ0.js.map} +1 -1
- package/output/client.cjs +3 -3
- package/output/client.js +3 -3
- package/output/components/Tabs.d.ts +3 -0
- package/output/core/i18n.d.ts +1 -1
- package/output/{i18n-DsjZ51U1.cjs → i18n-R08i532P.cjs} +23 -1
- package/output/i18n-R08i532P.cjs.map +1 -0
- package/output/{i18n-BxXpRSFX.js → i18n-sJUQQLRZ.js} +23 -1
- package/output/i18n-sJUQQLRZ.js.map +1 -0
- package/output/index.cjs +5 -7
- package/output/index.cjs.map +1 -1
- package/output/index.d.ts +1 -2
- package/output/index.js +6 -7
- package/output/index.js.map +1 -1
- package/output/mdx/components.d.ts +2 -2
- package/output/mdx/primitives.d.ts +2 -0
- package/output/openapi/components/EndpointSections.d.ts +2 -0
- package/output/openapi/components/OpenApiAuthDocumentation.d.ts +7 -0
- package/output/openapi/components/OpenApiDocumentSection.d.ts +10 -0
- package/output/openapi/components/helpers.d.ts +1 -0
- package/output/openapi/types.d.ts +1 -0
- package/output/preview.cjs +3 -3
- package/output/preview.js +3 -3
- package/output/{render-CKG4X-me.cjs → render-BuWbLXJW.cjs} +2 -2
- package/output/{render-CKG4X-me.cjs.map → render-BuWbLXJW.cjs.map} +1 -1
- package/output/{render-vlp3hwW3.js → render-tWo_ruCT.js} +2 -2
- package/output/{render-vlp3hwW3.js.map → render-tWo_ruCT.js.map} +1 -1
- package/output/renderer.css +24 -13
- package/output/server.cjs +2 -2
- package/output/server.js +2 -2
- package/package.json +1 -1
- package/output/OpenApiOperation-CFo6_otd.js.map +0 -1
- package/output/OpenApiOperation-D1WNrj5X.cjs.map +0 -1
- package/output/i18n-BxXpRSFX.js.map +0 -1
- package/output/i18n-DsjZ51U1.cjs.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as useBuiltInText } from "./i18n-
|
|
1
|
+
import { t as useBuiltInText } from "./i18n-sJUQQLRZ.js";
|
|
2
2
|
import clsx from "clsx";
|
|
3
3
|
import { useRef, useState } from "react";
|
|
4
4
|
import { Maximize2, ZoomIn, ZoomOut } from "lucide-react";
|
|
@@ -95,4 +95,4 @@ function MermaidViewer(arg0) {
|
|
|
95
95
|
//#endregion
|
|
96
96
|
export { MermaidViewer, MermaidViewer as default };
|
|
97
97
|
|
|
98
|
-
//# sourceMappingURL=MermaidViewer-
|
|
98
|
+
//# sourceMappingURL=MermaidViewer-D4h-WEak.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MermaidViewer-
|
|
1
|
+
{"version":3,"file":"MermaidViewer-D4h-WEak.js","names":[],"sources":["../source/components/MermaidViewer.tsx"],"sourcesContent":["import clsx from 'clsx'\nimport { Maximize2, ZoomIn, ZoomOut } from 'lucide-react'\nimport { useRef, useState, type ReactNode } from 'react'\nimport { TransformComponent, TransformWrapper, useControls } from 'react-zoom-pan-pinch'\n\nimport { useBuiltInText } from '../core/i18n'\n\ntype MermaidViewerProps = {\n svg: string\n className?: string\n}\n\nfunction ZoomControls(): ReactNode {\n const { zoomIn, zoomOut, resetTransform } = useControls()\n const t = useBuiltInText()\n\n const buttonClassName = 'flex h-7 w-7 items-center justify-center rounded-md bg-(--clarify-theme-tokens-colors-surface) text-(--clarify-ui-text-soft) shadow-xs ring-1 ring-(--clarify-theme-tokens-colors-border) transition hover:bg-(--clarify-ui-hover-background) hover:text-(--clarify-theme-tokens-colors-foreground)'\n\n return (\n <div className=\"clarify-mermaid-controls absolute top-2 right-2 z-10 flex gap-1 opacity-0 transition group-hover:opacity-100 focus-within:opacity-100\">\n <button type=\"button\" aria-label={t('mermaid.zoomIn')} title={t('mermaid.zoomIn')} onClick={() => zoomIn()} className={buttonClassName}>\n <ZoomIn className=\"h-4 w-4\" aria-hidden=\"true\" />\n </button>\n <button type=\"button\" aria-label={t('mermaid.zoomOut')} title={t('mermaid.zoomOut')} onClick={() => zoomOut()} className={buttonClassName}>\n <ZoomOut className=\"h-4 w-4\" aria-hidden=\"true\" />\n </button>\n <button type=\"button\" aria-label={t('mermaid.resetZoom')} title={t('mermaid.resetZoom')} onClick={() => resetTransform()} className={buttonClassName}>\n <Maximize2 className=\"h-4 w-4\" aria-hidden=\"true\" />\n </button>\n </div>\n )\n}\n\nexport function MermaidViewer(arg0: MermaidViewerProps): ReactNode {\n const { svg, className } = arg0\n\n const t = useBuiltInText()\n const containerRef = useRef<HTMLDivElement>(null)\n const [focused, setFocused] = useState(false)\n\n return (\n <div\n ref={containerRef}\n tabIndex={0}\n role=\"group\"\n onPointerDown={() => containerRef.current?.focus()}\n onFocus={() => setFocused(true)}\n onBlur={() => setFocused(false)}\n className={clsx('clarify-mermaid group not-prose relative my-6 overflow-hidden rounded-2xl border border-(--clarify-theme-tokens-colors-border) bg-(--clarify-theme-tokens-colors-surface) outline-none focus-visible:ring-2 focus-visible:ring-(--clarify-theme-tokens-colors-primary)', className)}\n >\n <TransformWrapper\n minScale={0.5}\n maxScale={8}\n initialScale={1}\n centerOnInit\n smooth\n wheel={{ step: 0.05, wheelDisabled: !focused, touchPadDisabled: !focused }}\n doubleClick={{ mode: 'reset' }}\n >\n <ZoomControls />\n <TransformComponent\n wrapperClass=\"!w-full !cursor-grab active:!cursor-grabbing\"\n contentClass=\"!w-full justify-center [&_svg]:h-auto [&_svg]:max-w-full\"\n wrapperStyle={{ height: 'min(70vh, 32rem)' }}\n >\n <div className=\"flex h-full w-full items-center justify-center p-4\" dangerouslySetInnerHTML={{ __html: svg }} />\n </TransformComponent>\n <p\n className={clsx(\n 'clarify-mermaid-hint pointer-events-none absolute bottom-2 left-1/2 z-10 -translate-x-1/2 rounded-full bg-(--clarify-theme-tokens-colors-surface)/90 px-2.5 py-1 text-2xs text-(--clarify-ui-text-soft) shadow-xs ring-1 ring-(--clarify-theme-tokens-colors-border) backdrop-blur-sm transition',\n focused ? 'opacity-0' : 'opacity-0 group-hover:opacity-100',\n )}\n >\n {t('mermaid.scrollHint')}\n </p>\n </TransformWrapper>\n </div>\n )\n}\n\nexport default MermaidViewer\n"],"mappings":";;;;;;;AAYA,SAAS,eAA0B;CACjC,MAAM,EAAE,QAAQ,SAAS,mBAAmB,YAAY;CACxD,MAAM,IAAI,eAAe;CAEzB,MAAM,kBAAkB;CAExB,OACE,qBAAC,OAAD;EAAK,WAAU;YAAf;GACE,oBAAC,UAAD;IAAQ,MAAK;IAAS,cAAY,EAAE,gBAAgB;IAAG,OAAO,EAAE,gBAAgB;IAAG,eAAe,OAAO;IAAG,WAAW;cACrH,oBAAC,QAAD;KAAQ,WAAU;KAAU,eAAY;IAAQ,CAAA;GAC1C,CAAA;GACR,oBAAC,UAAD;IAAQ,MAAK;IAAS,cAAY,EAAE,iBAAiB;IAAG,OAAO,EAAE,iBAAiB;IAAG,eAAe,QAAQ;IAAG,WAAW;cACxH,oBAAC,SAAD;KAAS,WAAU;KAAU,eAAY;IAAQ,CAAA;GAC3C,CAAA;GACR,oBAAC,UAAD;IAAQ,MAAK;IAAS,cAAY,EAAE,mBAAmB;IAAG,OAAO,EAAE,mBAAmB;IAAG,eAAe,eAAe;IAAG,WAAW;cACnI,oBAAC,WAAD;KAAW,WAAU;KAAU,eAAY;IAAQ,CAAA;GAC7C,CAAA;EACL;;AAET;AAEA,SAAgB,cAAc,MAAqC;CACjE,MAAM,EAAE,KAAK,cAAc;CAE3B,MAAM,IAAI,eAAe;CACzB,MAAM,eAAe,OAAuB,IAAI;CAChD,MAAM,CAAC,SAAS,cAAc,SAAS,KAAK;CAE5C,OACE,oBAAC,OAAD;EACE,KAAK;EACL,UAAU;EACV,MAAK;EACL,qBAAqB,aAAa,SAAS,MAAM;EACjD,eAAe,WAAW,IAAI;EAC9B,cAAc,WAAW,KAAK;EAC9B,WAAW,KAAK,0QAA0Q,SAAS;YAEnS,qBAAC,kBAAD;GACE,UAAU;GACV,UAAU;GACV,cAAc;GACd,cAAA;GACA,QAAA;GACA,OAAO;IAAE,MAAM;IAAM,eAAe,CAAC;IAAS,kBAAkB,CAAC;GAAQ;GACzE,aAAa,EAAE,MAAM,QAAQ;aAP/B;IASE,oBAAC,cAAD,CAAe,CAAA;IACf,oBAAC,oBAAD;KACE,cAAa;KACb,cAAa;KACb,cAAc,EAAE,QAAQ,mBAAmB;eAE3C,oBAAC,OAAD;MAAK,WAAU;MAAqD,yBAAyB,EAAE,QAAQ,IAAI;KAAI,CAAA;IAC7F,CAAA;IACpB,oBAAC,KAAD;KACE,WAAW,KACT,oSACA,UAAU,cAAc,mCAC1B;eAEC,EAAE,oBAAoB;IACtB,CAAA;GACa;;CACf,CAAA;AAET"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_rolldown_runtime = require("./rolldown-runtime-DakpK96I.cjs");
|
|
2
|
-
const require_i18n = require("./i18n-
|
|
2
|
+
const require_i18n = require("./i18n-R08i532P.cjs");
|
|
3
3
|
let clsx = require("clsx");
|
|
4
4
|
clsx = require_rolldown_runtime.__toESM(clsx, 1);
|
|
5
5
|
let react = require("react");
|
|
@@ -98,4 +98,4 @@ function MermaidViewer(arg0) {
|
|
|
98
98
|
exports.MermaidViewer = MermaidViewer;
|
|
99
99
|
exports.default = MermaidViewer;
|
|
100
100
|
|
|
101
|
-
//# sourceMappingURL=MermaidViewer-
|
|
101
|
+
//# sourceMappingURL=MermaidViewer-kbSVqJ_z.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MermaidViewer-
|
|
1
|
+
{"version":3,"file":"MermaidViewer-kbSVqJ_z.cjs","names":[],"sources":["../source/components/MermaidViewer.tsx"],"sourcesContent":["import clsx from 'clsx'\nimport { Maximize2, ZoomIn, ZoomOut } from 'lucide-react'\nimport { useRef, useState, type ReactNode } from 'react'\nimport { TransformComponent, TransformWrapper, useControls } from 'react-zoom-pan-pinch'\n\nimport { useBuiltInText } from '../core/i18n'\n\ntype MermaidViewerProps = {\n svg: string\n className?: string\n}\n\nfunction ZoomControls(): ReactNode {\n const { zoomIn, zoomOut, resetTransform } = useControls()\n const t = useBuiltInText()\n\n const buttonClassName = 'flex h-7 w-7 items-center justify-center rounded-md bg-(--clarify-theme-tokens-colors-surface) text-(--clarify-ui-text-soft) shadow-xs ring-1 ring-(--clarify-theme-tokens-colors-border) transition hover:bg-(--clarify-ui-hover-background) hover:text-(--clarify-theme-tokens-colors-foreground)'\n\n return (\n <div className=\"clarify-mermaid-controls absolute top-2 right-2 z-10 flex gap-1 opacity-0 transition group-hover:opacity-100 focus-within:opacity-100\">\n <button type=\"button\" aria-label={t('mermaid.zoomIn')} title={t('mermaid.zoomIn')} onClick={() => zoomIn()} className={buttonClassName}>\n <ZoomIn className=\"h-4 w-4\" aria-hidden=\"true\" />\n </button>\n <button type=\"button\" aria-label={t('mermaid.zoomOut')} title={t('mermaid.zoomOut')} onClick={() => zoomOut()} className={buttonClassName}>\n <ZoomOut className=\"h-4 w-4\" aria-hidden=\"true\" />\n </button>\n <button type=\"button\" aria-label={t('mermaid.resetZoom')} title={t('mermaid.resetZoom')} onClick={() => resetTransform()} className={buttonClassName}>\n <Maximize2 className=\"h-4 w-4\" aria-hidden=\"true\" />\n </button>\n </div>\n )\n}\n\nexport function MermaidViewer(arg0: MermaidViewerProps): ReactNode {\n const { svg, className } = arg0\n\n const t = useBuiltInText()\n const containerRef = useRef<HTMLDivElement>(null)\n const [focused, setFocused] = useState(false)\n\n return (\n <div\n ref={containerRef}\n tabIndex={0}\n role=\"group\"\n onPointerDown={() => containerRef.current?.focus()}\n onFocus={() => setFocused(true)}\n onBlur={() => setFocused(false)}\n className={clsx('clarify-mermaid group not-prose relative my-6 overflow-hidden rounded-2xl border border-(--clarify-theme-tokens-colors-border) bg-(--clarify-theme-tokens-colors-surface) outline-none focus-visible:ring-2 focus-visible:ring-(--clarify-theme-tokens-colors-primary)', className)}\n >\n <TransformWrapper\n minScale={0.5}\n maxScale={8}\n initialScale={1}\n centerOnInit\n smooth\n wheel={{ step: 0.05, wheelDisabled: !focused, touchPadDisabled: !focused }}\n doubleClick={{ mode: 'reset' }}\n >\n <ZoomControls />\n <TransformComponent\n wrapperClass=\"!w-full !cursor-grab active:!cursor-grabbing\"\n contentClass=\"!w-full justify-center [&_svg]:h-auto [&_svg]:max-w-full\"\n wrapperStyle={{ height: 'min(70vh, 32rem)' }}\n >\n <div className=\"flex h-full w-full items-center justify-center p-4\" dangerouslySetInnerHTML={{ __html: svg }} />\n </TransformComponent>\n <p\n className={clsx(\n 'clarify-mermaid-hint pointer-events-none absolute bottom-2 left-1/2 z-10 -translate-x-1/2 rounded-full bg-(--clarify-theme-tokens-colors-surface)/90 px-2.5 py-1 text-2xs text-(--clarify-ui-text-soft) shadow-xs ring-1 ring-(--clarify-theme-tokens-colors-border) backdrop-blur-sm transition',\n focused ? 'opacity-0' : 'opacity-0 group-hover:opacity-100',\n )}\n >\n {t('mermaid.scrollHint')}\n </p>\n </TransformWrapper>\n </div>\n )\n}\n\nexport default MermaidViewer\n"],"mappings":";;;;;;;;;AAYA,SAAS,eAA0B;CACjC,MAAM,EAAE,QAAQ,SAAS,oBAAA,GAAA,qBAAA,YAAA,CAA+B;CACxD,MAAM,IAAI,aAAA,eAAe;CAEzB,MAAM,kBAAkB;CAExB,OACE,iBAAA,GAAA,kBAAA,KAAA,CAAC,OAAD;EAAK,WAAU;YAAf;GACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,UAAD;IAAQ,MAAK;IAAS,cAAY,EAAE,gBAAgB;IAAG,OAAO,EAAE,gBAAgB;IAAG,eAAe,OAAO;IAAG,WAAW;cACrH,iBAAA,GAAA,kBAAA,IAAA,CAAC,aAAA,QAAD;KAAQ,WAAU;KAAU,eAAY;IAAQ,CAAA;GAC1C,CAAA;GACR,iBAAA,GAAA,kBAAA,IAAA,CAAC,UAAD;IAAQ,MAAK;IAAS,cAAY,EAAE,iBAAiB;IAAG,OAAO,EAAE,iBAAiB;IAAG,eAAe,QAAQ;IAAG,WAAW;cACxH,iBAAA,GAAA,kBAAA,IAAA,CAAC,aAAA,SAAD;KAAS,WAAU;KAAU,eAAY;IAAQ,CAAA;GAC3C,CAAA;GACR,iBAAA,GAAA,kBAAA,IAAA,CAAC,UAAD;IAAQ,MAAK;IAAS,cAAY,EAAE,mBAAmB;IAAG,OAAO,EAAE,mBAAmB;IAAG,eAAe,eAAe;IAAG,WAAW;cACnI,iBAAA,GAAA,kBAAA,IAAA,CAAC,aAAA,WAAD;KAAW,WAAU;KAAU,eAAY;IAAQ,CAAA;GAC7C,CAAA;EACL;;AAET;AAEA,SAAgB,cAAc,MAAqC;CACjE,MAAM,EAAE,KAAK,cAAc;CAE3B,MAAM,IAAI,aAAA,eAAe;CACzB,MAAM,gBAAA,GAAA,MAAA,OAAA,CAAsC,IAAI;CAChD,MAAM,CAAC,SAAS,eAAA,GAAA,MAAA,SAAA,CAAuB,KAAK;CAE5C,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;EACE,KAAK;EACL,UAAU;EACV,MAAK;EACL,qBAAqB,aAAa,SAAS,MAAM;EACjD,eAAe,WAAW,IAAI;EAC9B,cAAc,WAAW,KAAK;EAC9B,YAAA,GAAA,KAAA,QAAA,CAAgB,0QAA0Q,SAAS;YAEnS,iBAAA,GAAA,kBAAA,KAAA,CAAC,qBAAA,kBAAD;GACE,UAAU;GACV,UAAU;GACV,cAAc;GACd,cAAA;GACA,QAAA;GACA,OAAO;IAAE,MAAM;IAAM,eAAe,CAAC;IAAS,kBAAkB,CAAC;GAAQ;GACzE,aAAa,EAAE,MAAM,QAAQ;aAP/B;IASE,iBAAA,GAAA,kBAAA,IAAA,CAAC,cAAD,CAAe,CAAA;IACf,iBAAA,GAAA,kBAAA,IAAA,CAAC,qBAAA,oBAAD;KACE,cAAa;KACb,cAAa;KACb,cAAc,EAAE,QAAQ,mBAAmB;eAE3C,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;MAAK,WAAU;MAAqD,yBAAyB,EAAE,QAAQ,IAAI;KAAI,CAAA;IAC7F,CAAA;IACpB,iBAAA,GAAA,kBAAA,IAAA,CAAC,KAAD;KACE,YAAA,GAAA,KAAA,QAAA,CACE,oSACA,UAAU,cAAc,mCAC1B;eAEC,EAAE,oBAAoB;IACtB,CAAA;GACa;;CACf,CAAA;AAET"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as useConfig, s as useLocale, t as useBuiltInText } from "./i18n-
|
|
2
|
-
import { C as isExternalHref, E as copyTextToClipboard, c as lucideIconRegistry, h as useTheme, l as resolveLucideIconName, n as PageTitleActions, o as useSectionStore, s as remToPx, w as localizeHref } from "./PageActions-
|
|
1
|
+
import { a as useConfig, s as useLocale, t as useBuiltInText } from "./i18n-sJUQQLRZ.js";
|
|
2
|
+
import { C as isExternalHref, E as copyTextToClipboard, c as lucideIconRegistry, h as useTheme, l as resolveLucideIconName, n as PageTitleActions, o as useSectionStore, s as remToPx, w as localizeHref } from "./PageActions-Bnz5Bybt.js";
|
|
3
3
|
import { t as markdownRemarkPlugins } from "./remark-C9iRQM0R.js";
|
|
4
4
|
import clsx from "clsx";
|
|
5
5
|
import { Children, Suspense, cloneElement, createContext, createElement, forwardRef, isValidElement, lazy, useContext, useEffect, useId, useLayoutEffect, useRef, useState } from "react";
|
|
@@ -253,7 +253,7 @@ function Card(arg0) {
|
|
|
253
253
|
}
|
|
254
254
|
//#endregion
|
|
255
255
|
//#region source/components/Mermaid.tsx
|
|
256
|
-
var MermaidViewer = lazy(() => import("./MermaidViewer-
|
|
256
|
+
var MermaidViewer = lazy(() => import("./MermaidViewer-D4h-WEak.js"));
|
|
257
257
|
var mermaidModulePromise;
|
|
258
258
|
async function loadMermaid() {
|
|
259
259
|
mermaidModulePromise = mermaidModulePromise ?? import("mermaid").then((module) => module.default);
|
|
@@ -1014,7 +1014,7 @@ function TabItem(_props) {
|
|
|
1014
1014
|
return null;
|
|
1015
1015
|
}
|
|
1016
1016
|
function Tabs(arg0) {
|
|
1017
|
-
const { items, children, defaultValue, selectedIndex, onChange, className, listClassName, panelsClassName } = arg0;
|
|
1017
|
+
const { items, children, defaultValue, selectedIndex, onChange, className, spacingClassName = "my-6", listClassName, panelsClassName, actions, variant = "content" } = arg0;
|
|
1018
1018
|
const childItems = Children.toArray(children).filter((child) => isValidElement(child) && child.type === TabItem).map((child, index) => ({
|
|
1019
1019
|
id: child.props.value ?? `tab-${index}`,
|
|
1020
1020
|
label: child.props.title,
|
|
@@ -1031,23 +1031,26 @@ function Tabs(arg0) {
|
|
|
1031
1031
|
return /* @__PURE__ */ jsxs(TabGroup, {
|
|
1032
1032
|
selectedIndex: resolvedIndex,
|
|
1033
1033
|
onChange: handleChange,
|
|
1034
|
-
className: clsx("clarify-tabs
|
|
1035
|
-
children: [/* @__PURE__ */
|
|
1036
|
-
className: clsx("flex max-w-full items-stretch
|
|
1037
|
-
children: resolvedItems.map((item) => /* @__PURE__ */ jsx(Tab, {
|
|
1038
|
-
className: ({ selected }) => clsx("
|
|
1034
|
+
className: clsx("clarify-tabs", spacingClassName, className),
|
|
1035
|
+
children: [/* @__PURE__ */ jsxs(TabList, {
|
|
1036
|
+
className: clsx("flex max-w-full items-stretch overflow-x-auto border-b", variant === "content" ? "gap-1 border-(--clarify-theme-tokens-colors-border)" : "h-10 gap-0 border-(--clarify-code-border) px-3", listClassName),
|
|
1037
|
+
children: [resolvedItems.map((item) => /* @__PURE__ */ jsx(Tab, {
|
|
1038
|
+
className: ({ selected }) => clsx("relative inline-flex shrink-0 items-center px-2.5 transition focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-(--clarify-theme-tokens-colors-primary)", variant === "content" ? "clarify-content-tab clarify-ui-tab my-1 h-9 rounded-(--clarify-theme-tokens-radius-md)" : "text-2xs font-semibold", selected && (variant === "content" ? "clarify-ui-tab-active" : "text-(--clarify-code-text)"), variant === "code" && !selected && "text-(--clarify-code-muted)"),
|
|
1039
1039
|
children: ({ selected }) => /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("span", { children: item.label }), selected ? /* @__PURE__ */ jsx(motion.span, {
|
|
1040
1040
|
layoutId: indicatorLayoutId,
|
|
1041
|
-
className: "absolute inset-x-2.5
|
|
1041
|
+
className: clsx("absolute inset-x-2.5 h-0.5 bg-(--clarify-ui-tab-indicator)", variant === "content" ? "-bottom-1 rounded-full" : "-bottom-px"),
|
|
1042
1042
|
transition: {
|
|
1043
1043
|
type: "tween",
|
|
1044
1044
|
duration: .16,
|
|
1045
1045
|
ease: "easeOut"
|
|
1046
1046
|
}
|
|
1047
1047
|
}) : null] })
|
|
1048
|
-
}, item.id))
|
|
1048
|
+
}, item.id)), actions ? /* @__PURE__ */ jsx("div", {
|
|
1049
|
+
className: "sticky right-0 ml-auto flex shrink-0 items-center bg-(--clarify-code-background)",
|
|
1050
|
+
children: actions
|
|
1051
|
+
}) : null]
|
|
1049
1052
|
}), /* @__PURE__ */ jsx(TabPanels, {
|
|
1050
|
-
className:
|
|
1053
|
+
className: panelsClassName ?? "mt-5",
|
|
1051
1054
|
children: resolvedItems.map((item) => /* @__PURE__ */ jsx(TabPanel, {
|
|
1052
1055
|
className: "focus:outline-none focus-visible:ring-2 focus-visible:ring-(--clarify-theme-tokens-colors-primary)",
|
|
1053
1056
|
children: item.panel
|
|
@@ -1338,9 +1341,9 @@ function Col(arg0) {
|
|
|
1338
1341
|
});
|
|
1339
1342
|
}
|
|
1340
1343
|
function Properties(arg0) {
|
|
1341
|
-
const { children } = arg0;
|
|
1344
|
+
const { children, className, spacingClassName = "my-6" } = arg0;
|
|
1342
1345
|
return /* @__PURE__ */ jsx("div", {
|
|
1343
|
-
className: "clarify-properties
|
|
1346
|
+
className: clsx("clarify-properties", spacingClassName, className),
|
|
1344
1347
|
children: /* @__PURE__ */ jsx("ul", {
|
|
1345
1348
|
role: "list",
|
|
1346
1349
|
className: "m-0 list-none divide-y divide-(--clarify-theme-tokens-colors-border) p-0",
|
|
@@ -2408,7 +2411,8 @@ function getAuthOptions(spec, operation) {
|
|
|
2408
2411
|
return getSecurityRequirements(spec, operation).map((requirement, index) => {
|
|
2409
2412
|
const requirementSchemes = Object.keys(requirement).map((name) => ({
|
|
2410
2413
|
name,
|
|
2411
|
-
scheme: schemes[name]
|
|
2414
|
+
scheme: schemes[name],
|
|
2415
|
+
scopes: requirement[name] ?? []
|
|
2412
2416
|
})).filter((option) => Boolean(option.scheme));
|
|
2413
2417
|
return {
|
|
2414
2418
|
key: `requirement:${index}`,
|
|
@@ -2715,6 +2719,103 @@ function ResponseExamplesPanel(arg0) {
|
|
|
2715
2719
|
});
|
|
2716
2720
|
}
|
|
2717
2721
|
//#endregion
|
|
2722
|
+
//#region source/openapi/components/OpenApiDocumentSection.tsx
|
|
2723
|
+
function OpenApiDocumentSection(props) {
|
|
2724
|
+
const { title, children, className, bodyClassName, level = 3 } = props;
|
|
2725
|
+
const heading = level === 3 ? /* @__PURE__ */ jsx("h3", {
|
|
2726
|
+
className: "!m-0 text-sm/6 font-semibold text-(--clarify-theme-tokens-colors-foreground)",
|
|
2727
|
+
children: title
|
|
2728
|
+
}) : /* @__PURE__ */ jsx("h4", {
|
|
2729
|
+
className: "!m-0 text-xs/5 font-semibold text-(--clarify-ui-text-soft)",
|
|
2730
|
+
children: title
|
|
2731
|
+
});
|
|
2732
|
+
return /* @__PURE__ */ jsxs("section", {
|
|
2733
|
+
className: clsx("clarify-openapi-document-section", className),
|
|
2734
|
+
children: [heading, /* @__PURE__ */ jsx("div", {
|
|
2735
|
+
className: clsx("mt-2", bodyClassName),
|
|
2736
|
+
children
|
|
2737
|
+
})]
|
|
2738
|
+
});
|
|
2739
|
+
}
|
|
2740
|
+
//#endregion
|
|
2741
|
+
//#region source/openapi/components/OpenApiAuthDocumentation.tsx
|
|
2742
|
+
function authSchemeType(option, apiKeyLabel) {
|
|
2743
|
+
const { scheme } = option;
|
|
2744
|
+
if (scheme.type === "http") return scheme.scheme?.toUpperCase() || "HTTP";
|
|
2745
|
+
if (scheme.type === "apiKey") return apiKeyLabel;
|
|
2746
|
+
if (scheme.type === "oauth2") return "OAUTH 2.0";
|
|
2747
|
+
if (scheme.type === "openIdConnect") return "OPENID CONNECT";
|
|
2748
|
+
return scheme.type?.toUpperCase() || "AUTH";
|
|
2749
|
+
}
|
|
2750
|
+
function OpenApiAuthDocumentation(props) {
|
|
2751
|
+
const { options } = props;
|
|
2752
|
+
const t = useBuiltInText();
|
|
2753
|
+
if (options.length === 0) return null;
|
|
2754
|
+
const renderOption = (option) => option.schemes.length === 0 ? /* @__PURE__ */ jsx("div", {
|
|
2755
|
+
className: "border-b border-(--clarify-theme-tokens-colors-border) pt-2 pb-4 text-sm/6 font-medium text-(--clarify-theme-tokens-colors-foreground)",
|
|
2756
|
+
children: t("openapi.authNoAuth")
|
|
2757
|
+
}) : /* @__PURE__ */ jsx("div", {
|
|
2758
|
+
className: "divide-y divide-(--clarify-theme-tokens-colors-border) border-b border-(--clarify-theme-tokens-colors-border)",
|
|
2759
|
+
children: option.schemes.map((schemeOption, schemeIndex) => {
|
|
2760
|
+
const { scheme } = schemeOption;
|
|
2761
|
+
const details = [
|
|
2762
|
+
scheme.type === "apiKey" && scheme.in && scheme.name ? t("openapi.authLocation", {
|
|
2763
|
+
in: scheme.in,
|
|
2764
|
+
name: scheme.name
|
|
2765
|
+
}) : void 0,
|
|
2766
|
+
scheme.type === "http" && scheme.bearerFormat ? t("openapi.authBearerFormat", { format: scheme.bearerFormat }) : void 0,
|
|
2767
|
+
scheme.type === "openIdConnect" ? scheme.openIdConnectUrl : void 0,
|
|
2768
|
+
schemeOption.scopes.length > 0 ? t("openapi.authScopes", { scopes: schemeOption.scopes.join(", ") }) : void 0
|
|
2769
|
+
].filter((value) => Boolean(value));
|
|
2770
|
+
return /* @__PURE__ */ jsxs("div", { children: [schemeIndex > 0 ? /* @__PURE__ */ jsx("div", {
|
|
2771
|
+
className: "relative h-0",
|
|
2772
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
2773
|
+
className: "absolute top-0 left-4 -translate-y-1/2 bg-(--clarify-theme-tokens-colors-background) px-1.5 text-2xs font-semibold text-(--clarify-ui-text-faint)",
|
|
2774
|
+
children: t("openapi.authAnd")
|
|
2775
|
+
})
|
|
2776
|
+
}) : null, /* @__PURE__ */ jsxs("div", {
|
|
2777
|
+
className: "py-4 first:pt-2",
|
|
2778
|
+
children: [
|
|
2779
|
+
/* @__PURE__ */ jsxs("div", {
|
|
2780
|
+
className: "flex flex-wrap items-center gap-2",
|
|
2781
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
2782
|
+
className: "font-mono text-sm/6 font-semibold text-(--clarify-theme-tokens-colors-foreground)",
|
|
2783
|
+
children: schemeOption.name
|
|
2784
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
2785
|
+
className: "rounded bg-(--clarify-ui-subtle-background) px-1.5 py-0.5 text-2xs font-semibold text-(--clarify-ui-text-soft)",
|
|
2786
|
+
children: authSchemeType(schemeOption, t("openapi.authApiKey"))
|
|
2787
|
+
})]
|
|
2788
|
+
}),
|
|
2789
|
+
scheme.description ? /* @__PURE__ */ jsx(Markdown, {
|
|
2790
|
+
className: "mt-2 text-sm/6 text-(--clarify-ui-text-soft) *:first:mt-0 *:last:mb-0",
|
|
2791
|
+
children: scheme.description
|
|
2792
|
+
}) : null,
|
|
2793
|
+
details.length > 0 ? /* @__PURE__ */ jsx("div", {
|
|
2794
|
+
className: "mt-2 flex min-w-0 flex-wrap gap-x-4 gap-y-1 text-xs/5 text-(--clarify-ui-text-faint)",
|
|
2795
|
+
children: details.map((detail) => /* @__PURE__ */ jsx("span", {
|
|
2796
|
+
className: "min-w-0 break-all font-mono",
|
|
2797
|
+
children: detail
|
|
2798
|
+
}, detail))
|
|
2799
|
+
}) : null
|
|
2800
|
+
]
|
|
2801
|
+
})] }, schemeOption.name);
|
|
2802
|
+
})
|
|
2803
|
+
});
|
|
2804
|
+
return /* @__PURE__ */ jsx(OpenApiDocumentSection, {
|
|
2805
|
+
title: t("openapi.authentication"),
|
|
2806
|
+
bodyClassName: "not-prose",
|
|
2807
|
+
children: options.length === 1 ? renderOption(options[0]) : /* @__PURE__ */ jsx(Tabs, {
|
|
2808
|
+
items: options.map((option) => ({
|
|
2809
|
+
id: option.key,
|
|
2810
|
+
label: option.label || t("openapi.none"),
|
|
2811
|
+
panel: renderOption(option)
|
|
2812
|
+
})),
|
|
2813
|
+
spacingClassName: "m-0",
|
|
2814
|
+
panelsClassName: "mt-2"
|
|
2815
|
+
})
|
|
2816
|
+
});
|
|
2817
|
+
}
|
|
2818
|
+
//#endregion
|
|
2718
2819
|
//#region source/openapi/components/SchemaProperties.tsx
|
|
2719
2820
|
function getEnumDescriptions(schema) {
|
|
2720
2821
|
const descriptions = schema["x-enumDescriptions"];
|
|
@@ -3011,23 +3112,32 @@ function SchemaProperties(arg0) {
|
|
|
3011
3112
|
const { title, schema, spec, defaultExpanded } = arg0;
|
|
3012
3113
|
const root = getRootSchemaNode(spec, schema, defaultExpanded);
|
|
3013
3114
|
if (!root || root.children.length === 0) return null;
|
|
3014
|
-
return /* @__PURE__ */
|
|
3015
|
-
|
|
3115
|
+
return /* @__PURE__ */ jsx(OpenApiDocumentSection, {
|
|
3116
|
+
title,
|
|
3117
|
+
level: 4,
|
|
3118
|
+
bodyClassName: "clarify-schema-properties not-prose",
|
|
3016
3119
|
children: /* @__PURE__ */ jsx(SchemaTree, { nodes: root.children })
|
|
3017
|
-
})
|
|
3120
|
+
});
|
|
3018
3121
|
}
|
|
3019
3122
|
function ParameterList(arg0) {
|
|
3020
3123
|
const t = useBuiltInText();
|
|
3021
3124
|
const { title, parameters } = arg0;
|
|
3022
3125
|
if (parameters.length === 0) return null;
|
|
3023
|
-
return /* @__PURE__ */
|
|
3024
|
-
|
|
3025
|
-
|
|
3026
|
-
children:
|
|
3027
|
-
|
|
3028
|
-
children: parameter
|
|
3029
|
-
|
|
3030
|
-
|
|
3126
|
+
return /* @__PURE__ */ jsx(OpenApiDocumentSection, {
|
|
3127
|
+
title,
|
|
3128
|
+
bodyClassName: "not-prose",
|
|
3129
|
+
children: /* @__PURE__ */ jsx(Properties, {
|
|
3130
|
+
spacingClassName: "m-0",
|
|
3131
|
+
children: parameters.map((parameter) => /* @__PURE__ */ jsx(Property, {
|
|
3132
|
+
name: parameter.name ?? t("openapi.parameter"),
|
|
3133
|
+
type: [schemaToType(parameter.schema), parameter.required ? t("openapi.requiredBadge") : void 0].filter(Boolean).join(", ") || void 0,
|
|
3134
|
+
children: parameter.description ? /* @__PURE__ */ jsx(Markdown, {
|
|
3135
|
+
className: "*:first:mt-0 *:last:mb-0",
|
|
3136
|
+
children: parameter.description
|
|
3137
|
+
}) : t("openapi.operationParameter")
|
|
3138
|
+
}, `${parameter.in}-${parameter.name}`))
|
|
3139
|
+
})
|
|
3140
|
+
});
|
|
3031
3141
|
}
|
|
3032
3142
|
function ResponseList(arg0) {
|
|
3033
3143
|
const { title, operation, spec, selectedStatus, onSelectStatus } = arg0;
|
|
@@ -3067,7 +3177,7 @@ function ResponseList(arg0) {
|
|
|
3067
3177
|
}) : `${t("openapi.response")}.`
|
|
3068
3178
|
}),
|
|
3069
3179
|
responseSchema && spec ? /* @__PURE__ */ jsx("div", {
|
|
3070
|
-
className: "mt-
|
|
3180
|
+
className: "mt-6",
|
|
3071
3181
|
children: /* @__PURE__ */ jsx(SchemaProperties, {
|
|
3072
3182
|
title: t("openapi.responseBodyProperties"),
|
|
3073
3183
|
schema: responseSchema,
|
|
@@ -3079,32 +3189,39 @@ function ResponseList(arg0) {
|
|
|
3079
3189
|
};
|
|
3080
3190
|
if (orderedResponses.length === 1) {
|
|
3081
3191
|
const [{ status, response }] = orderedResponses;
|
|
3082
|
-
return /* @__PURE__ */
|
|
3083
|
-
|
|
3084
|
-
|
|
3085
|
-
})] });
|
|
3086
|
-
}
|
|
3087
|
-
return /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("h3", { children: title ?? t("openapi.responses") }), /* @__PURE__ */ jsx(Tabs, {
|
|
3088
|
-
selectedIndex,
|
|
3089
|
-
onChange: (index) => {
|
|
3090
|
-
onSelectStatus?.(orderedResponses[index]?.status ?? "");
|
|
3091
|
-
},
|
|
3092
|
-
items: orderedResponses.map(({ status, response }) => ({
|
|
3093
|
-
id: status,
|
|
3094
|
-
label: status,
|
|
3095
|
-
panel: renderResponsePanel({
|
|
3192
|
+
return /* @__PURE__ */ jsx(OpenApiDocumentSection, {
|
|
3193
|
+
title: title ?? t("openapi.responses"),
|
|
3194
|
+
children: renderResponsePanel({
|
|
3096
3195
|
status,
|
|
3097
3196
|
response
|
|
3098
3197
|
})
|
|
3099
|
-
})
|
|
3100
|
-
|
|
3101
|
-
|
|
3102
|
-
|
|
3198
|
+
});
|
|
3199
|
+
}
|
|
3200
|
+
return /* @__PURE__ */ jsx(OpenApiDocumentSection, {
|
|
3201
|
+
title: title ?? t("openapi.responses"),
|
|
3202
|
+
bodyClassName: "not-prose",
|
|
3203
|
+
children: /* @__PURE__ */ jsx(Tabs, {
|
|
3204
|
+
selectedIndex,
|
|
3205
|
+
onChange: (index) => {
|
|
3206
|
+
onSelectStatus?.(orderedResponses[index]?.status ?? "");
|
|
3207
|
+
},
|
|
3208
|
+
items: orderedResponses.map(({ status, response }) => ({
|
|
3209
|
+
id: status,
|
|
3210
|
+
label: status,
|
|
3211
|
+
panel: renderResponsePanel({
|
|
3212
|
+
status,
|
|
3213
|
+
response
|
|
3214
|
+
})
|
|
3215
|
+
})),
|
|
3216
|
+
spacingClassName: "m-0",
|
|
3217
|
+
panelsClassName: "mt-2"
|
|
3218
|
+
})
|
|
3219
|
+
});
|
|
3103
3220
|
}
|
|
3104
3221
|
//#endregion
|
|
3105
3222
|
//#region source/openapi/components/EndpointSections.tsx
|
|
3106
3223
|
function EndpointRequest(arg0) {
|
|
3107
|
-
const { spec, path, method, operationSource = "path", description, groupedParameters, parameters, requestBody, requestContents, requestSchema, selectedRequestMediaType, onSelectRequestMediaType, selectedServer, serverVariables, auth, sharedExampleKey, onSelectExampleKey } = arg0;
|
|
3224
|
+
const { spec, path, method, operationSource = "path", description, groupedParameters, parameters, requestBody, requestContents, requestSchema, selectedRequestMediaType, onSelectRequestMediaType, selectedServer, serverVariables, authOptions, auth, sharedExampleKey, onSelectExampleKey } = arg0;
|
|
3108
3225
|
const t = useBuiltInText();
|
|
3109
3226
|
const hasRequestBody = Boolean(requestBody && requestContents.length > 0);
|
|
3110
3227
|
const renderDescription = () => {
|
|
@@ -3125,8 +3242,9 @@ function EndpointRequest(arg0) {
|
|
|
3125
3242
|
return /* @__PURE__ */ jsxs(Fragment$1, { children: [renderDescription(), /* @__PURE__ */ jsxs(Row, {
|
|
3126
3243
|
className: "clarify-openapi-request-workspace relative mt-8 pt-6",
|
|
3127
3244
|
children: [/* @__PURE__ */ jsx(Col, { children: /* @__PURE__ */ jsxs("div", {
|
|
3128
|
-
className: "w-full",
|
|
3245
|
+
className: "flex w-full flex-col gap-6",
|
|
3129
3246
|
children: [
|
|
3247
|
+
/* @__PURE__ */ jsx(OpenApiAuthDocumentation, { options: authOptions }),
|
|
3130
3248
|
/* @__PURE__ */ jsx(ParameterList, {
|
|
3131
3249
|
title: t("openapi.pathParameters"),
|
|
3132
3250
|
parameters: groupedParameters.path
|
|
@@ -3139,7 +3257,10 @@ function EndpointRequest(arg0) {
|
|
|
3139
3257
|
title: t("openapi.headers"),
|
|
3140
3258
|
parameters: groupedParameters.header
|
|
3141
3259
|
}),
|
|
3142
|
-
/* @__PURE__ */
|
|
3260
|
+
/* @__PURE__ */ jsx(OpenApiDocumentSection, {
|
|
3261
|
+
title: t("openapi.requestBody"),
|
|
3262
|
+
children: renderRequestBody()
|
|
3263
|
+
})
|
|
3143
3264
|
]
|
|
3144
3265
|
}) }), /* @__PURE__ */ jsx(Col, {
|
|
3145
3266
|
sticky: true,
|
|
@@ -4219,6 +4340,7 @@ function OpenApiResponseViewer(arg0) {
|
|
|
4219
4340
|
const previewAvailable = exchange ? canPreviewResponse(exchange.contentType) : false;
|
|
4220
4341
|
const selectedBodyMode = bodyModeSelection && bodyModeSelection.exchange === exchange ? bodyModeSelection.mode : "preview";
|
|
4221
4342
|
const activeBodyMode = previewAvailable ? selectedBodyMode : "raw";
|
|
4343
|
+
const bodyModes = ["preview", "raw"].filter((mode) => mode === "raw" || previewAvailable);
|
|
4222
4344
|
function downloadBody() {
|
|
4223
4345
|
if (!exchange) return;
|
|
4224
4346
|
const url = URL.createObjectURL(exchange.blob);
|
|
@@ -4293,48 +4415,37 @@ function OpenApiResponseViewer(arg0) {
|
|
|
4293
4415
|
className: "font-mono text-2xs font-normal text-(--clarify-code-faint)",
|
|
4294
4416
|
children: exchange.contentType || t("openapi.unknownContentType")
|
|
4295
4417
|
}),
|
|
4296
|
-
children: /* @__PURE__ */
|
|
4297
|
-
|
|
4298
|
-
|
|
4299
|
-
|
|
4300
|
-
|
|
4301
|
-
role: "tablist",
|
|
4302
|
-
className: "flex",
|
|
4303
|
-
children: ["preview", "raw"].filter((mode) => mode === "raw" || previewAvailable).map((mode) => /* @__PURE__ */ jsx("button", {
|
|
4304
|
-
type: "button",
|
|
4305
|
-
role: "tab",
|
|
4306
|
-
"aria-selected": activeBodyMode === mode,
|
|
4307
|
-
onClick: () => setBodyModeSelection({
|
|
4308
|
-
exchange,
|
|
4309
|
-
mode
|
|
4310
|
-
}),
|
|
4311
|
-
className: clsx("border-b-2 px-2.5 py-1 text-2xs font-semibold", activeBodyMode === mode ? "border-(--clarify-theme-tokens-colors-primary) text-(--clarify-code-text)" : "border-transparent text-(--clarify-code-muted)"),
|
|
4312
|
-
children: mode === "preview" ? t("openapi.preview") : t("openapi.raw")
|
|
4313
|
-
}, mode))
|
|
4314
|
-
}), /* @__PURE__ */ jsxs("div", {
|
|
4315
|
-
className: "flex",
|
|
4316
|
-
children: [/* @__PURE__ */ jsx(CopyButton, { value: exchange.body }), /* @__PURE__ */ jsx("button", {
|
|
4317
|
-
type: "button",
|
|
4318
|
-
onClick: downloadBody,
|
|
4319
|
-
"aria-label": t("openapi.downloadBody"),
|
|
4320
|
-
title: t("openapi.downloadBody"),
|
|
4321
|
-
className: "grid size-8 shrink-0 place-items-center rounded-(--clarify-theme-tokens-radius-md) text-(--clarify-code-muted) transition hover:bg-(--clarify-code-control-background-hover) hover:text-(--clarify-code-text) focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-(--clarify-theme-tokens-colors-primary)",
|
|
4322
|
-
children: /* @__PURE__ */ jsx(DownloadIcon, {
|
|
4323
|
-
className: "size-4",
|
|
4324
|
-
"aria-hidden": "true"
|
|
4325
|
-
})
|
|
4326
|
-
})]
|
|
4327
|
-
})]
|
|
4328
|
-
}), /* @__PURE__ */ jsx("div", {
|
|
4329
|
-
className: "p-4",
|
|
4330
|
-
children: activeBodyMode === "preview" ? /* @__PURE__ */ jsx(ResponsePreview, { exchange }) : exchange.size ? /* @__PURE__ */ jsx("pre", {
|
|
4418
|
+
children: /* @__PURE__ */ jsx(Tabs, {
|
|
4419
|
+
items: bodyModes.map((mode) => ({
|
|
4420
|
+
id: mode,
|
|
4421
|
+
label: mode === "preview" ? t("openapi.preview") : t("openapi.raw"),
|
|
4422
|
+
panel: mode === "preview" ? /* @__PURE__ */ jsx(ResponsePreview, { exchange }) : exchange.size ? /* @__PURE__ */ jsx("pre", {
|
|
4331
4423
|
className: "max-h-128 overflow-auto whitespace-pre-wrap wrap-break-word font-mono text-xs/5",
|
|
4332
4424
|
children: exchange.body
|
|
4333
4425
|
}) : /* @__PURE__ */ jsx("div", {
|
|
4334
4426
|
className: "py-8 text-center text-xs text-(--clarify-code-faint)",
|
|
4335
4427
|
children: t("openapi.responseBodyEmpty")
|
|
4336
4428
|
})
|
|
4337
|
-
})
|
|
4429
|
+
})),
|
|
4430
|
+
selectedIndex: bodyModes.indexOf(activeBodyMode),
|
|
4431
|
+
onChange: (index) => setBodyModeSelection({
|
|
4432
|
+
exchange,
|
|
4433
|
+
mode: bodyModes[index] ?? "raw"
|
|
4434
|
+
}),
|
|
4435
|
+
spacingClassName: "m-0 min-h-72",
|
|
4436
|
+
panelsClassName: "p-4",
|
|
4437
|
+
variant: "code",
|
|
4438
|
+
actions: /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(CopyButton, { value: exchange.body }), /* @__PURE__ */ jsx("button", {
|
|
4439
|
+
type: "button",
|
|
4440
|
+
onClick: downloadBody,
|
|
4441
|
+
"aria-label": t("openapi.downloadBody"),
|
|
4442
|
+
title: t("openapi.downloadBody"),
|
|
4443
|
+
className: "grid size-8 shrink-0 place-items-center rounded-(--clarify-theme-tokens-radius-md) text-(--clarify-code-muted) transition hover:bg-(--clarify-code-control-background-hover) hover:text-(--clarify-code-text) focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-(--clarify-theme-tokens-colors-primary)",
|
|
4444
|
+
children: /* @__PURE__ */ jsx(DownloadIcon, {
|
|
4445
|
+
className: "size-4",
|
|
4446
|
+
"aria-hidden": "true"
|
|
4447
|
+
})
|
|
4448
|
+
})] })
|
|
4338
4449
|
})
|
|
4339
4450
|
})
|
|
4340
4451
|
]
|
|
@@ -5097,7 +5208,8 @@ function ServerVariableControl(arg0) {
|
|
|
5097
5208
|
label: option
|
|
5098
5209
|
})),
|
|
5099
5210
|
onChange,
|
|
5100
|
-
compact
|
|
5211
|
+
compact,
|
|
5212
|
+
buttonClassName: "inline-flex min-h-8 w-full min-w-0 items-center justify-between gap-1 rounded-md border border-(--clarify-theme-tokens-colors-border) bg-(--clarify-theme-tokens-colors-surface) px-2.5 py-1.5 text-xs font-semibold text-(--clarify-theme-tokens-colors-foreground) shadow-xs outline-hidden transition hover:border-(--clarify-ui-text-faint) hover:bg-(--clarify-ui-hover-background) focus:ring-2 focus:ring-inset focus:ring-(--clarify-theme-tokens-colors-primary) data-open:bg-(--clarify-ui-active-background)"
|
|
5101
5213
|
});
|
|
5102
5214
|
return /* @__PURE__ */ jsx("input", {
|
|
5103
5215
|
"aria-label": name,
|
|
@@ -5127,7 +5239,8 @@ function ServerPanel(arg0) {
|
|
|
5127
5239
|
label: getServerLabel(server, index),
|
|
5128
5240
|
description: server.description
|
|
5129
5241
|
})),
|
|
5130
|
-
onChange: onSelectServer
|
|
5242
|
+
onChange: onSelectServer,
|
|
5243
|
+
buttonClassName: "inline-flex min-h-8 w-full min-w-0 items-center justify-between gap-1 rounded-md border border-(--clarify-theme-tokens-colors-border) bg-(--clarify-theme-tokens-colors-surface) px-2.5 py-1.5 text-xs font-semibold text-(--clarify-theme-tokens-colors-foreground) shadow-xs outline-hidden transition hover:border-(--clarify-ui-text-faint) hover:bg-(--clarify-ui-hover-background) focus:ring-2 focus:ring-inset focus:ring-(--clarify-theme-tokens-colors-primary) data-open:bg-(--clarify-ui-active-background)"
|
|
5131
5244
|
})]
|
|
5132
5245
|
}) : null, variableEntries.length > 0 ? /* @__PURE__ */ jsx("div", {
|
|
5133
5246
|
className: "grid gap-3 sm:grid-cols-(--clarify-openapi-variable-grid)",
|
|
@@ -5257,6 +5370,7 @@ function OpenApiOperation(arg0) {
|
|
|
5257
5370
|
onSelectRequestMediaType: requestState.setSelectedRequestMediaType,
|
|
5258
5371
|
selectedServer: serverState.selectedServer,
|
|
5259
5372
|
serverVariables: serverState.serverVariables,
|
|
5373
|
+
authOptions: authState.authOptions,
|
|
5260
5374
|
auth: authState.authInput,
|
|
5261
5375
|
sharedExampleKey: linkedExampleKey,
|
|
5262
5376
|
onSelectExampleKey: setLinkedExampleKey
|
|
@@ -5276,4 +5390,4 @@ function OpenApiOperation(arg0) {
|
|
|
5276
5390
|
//#endregion
|
|
5277
5391
|
export { Code as A, GridPattern as C, Tag as D, Heading as E, CardGroup as F, Callout as I, Button as L, Pre as M, Mermaid as N, Feedback as O, Card as P, Prose as S, Logo as T, WebFrame as _, ResponseExamplesPanel as a, Step as b, getAuthOptions as c, getOpenApiOperationEntry as d, listOpenApiOperations as f, primitives_exports as g, Markdown as h, RequestExamplesPanel as i, CodeGroup as j, Collapse as k, getServerKey as l, getRequestBody$1 as m, OpenApiOperation as n, authPlaceholder as o, getMediaTypeEntries as p, OpenApiRequestWorkbench as r, defaultServerVariables as s, EndpointIdentity as t, getServers as u, TabItem as v, HeroPattern as w, Steps as x, Tabs as y };
|
|
5278
5392
|
|
|
5279
|
-
//# sourceMappingURL=OpenApiOperation-
|
|
5393
|
+
//# sourceMappingURL=OpenApiOperation-BcJYHwft.js.map
|