@clarify-labs/renderer 0.11.2 → 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-D_HluctW.js → ClarifyShell-4hlqrEgp.js} +3 -3
- package/output/{ClarifyShell-D_HluctW.js.map → ClarifyShell-4hlqrEgp.js.map} +1 -1
- package/output/{ClarifyShell-Cn48irqj.cjs → ClarifyShell-D25PYLE0.cjs} +3 -3
- package/output/{ClarifyShell-Cn48irqj.cjs.map → ClarifyShell-D25PYLE0.cjs.map} +1 -1
- package/output/{MermaidViewer-Dby0ylNr.js → MermaidViewer-D4h-WEak.js} +2 -2
- package/output/{MermaidViewer-Dby0ylNr.js.map → MermaidViewer-D4h-WEak.js.map} +1 -1
- package/output/{MermaidViewer-EZjolX08.cjs → MermaidViewer-kbSVqJ_z.cjs} +2 -2
- package/output/{MermaidViewer-EZjolX08.cjs.map → MermaidViewer-kbSVqJ_z.cjs.map} +1 -1
- package/output/{OpenApiOperation-Cr8TxLjl.js → OpenApiOperation-BcJYHwft.js} +183 -150
- package/output/OpenApiOperation-BcJYHwft.js.map +1 -0
- package/output/{OpenApiOperation-bdALspAY.cjs → OpenApiOperation-HhSjad7q.cjs} +183 -150
- package/output/OpenApiOperation-HhSjad7q.cjs.map +1 -0
- package/output/{PageActions-BLzCasvB.js → PageActions-Bnz5Bybt.js} +44 -27
- package/output/{PageActions-BLzCasvB.js.map → PageActions-Bnz5Bybt.js.map} +1 -1
- package/output/{PageActions-Bw9SAHLl.cjs → PageActions-GVAsO16x.cjs} +44 -27
- package/output/{PageActions-Bw9SAHLl.cjs.map → PageActions-GVAsO16x.cjs.map} +1 -1
- package/output/{SearchDialog-j_4Y9WY_.cjs → SearchDialog-CFMl0YAZ.cjs} +3 -3
- package/output/{SearchDialog-j_4Y9WY_.cjs.map → SearchDialog-CFMl0YAZ.cjs.map} +1 -1
- package/output/{SearchDialog-DWYp1c6c.js → SearchDialog-DL5Y_bQ0.js} +3 -3
- package/output/{SearchDialog-DWYp1c6c.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-L1XX-y6M.cjs → i18n-R08i532P.cjs} +9 -1
- package/output/i18n-R08i532P.cjs.map +1 -0
- package/output/{i18n-DjRcGSuU.js → i18n-sJUQQLRZ.js} +9 -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/OpenApiAuthDocumentation.d.ts +1 -1
- package/output/openapi/components/OpenApiDocumentSection.d.ts +10 -0
- package/output/preview.cjs +3 -3
- package/output/preview.js +3 -3
- package/output/{render-hq20DPxe.cjs → render-BuWbLXJW.cjs} +2 -2
- package/output/{render-hq20DPxe.cjs.map → render-BuWbLXJW.cjs.map} +1 -1
- package/output/{render-CYQmEacg.js → render-tWo_ruCT.js} +2 -2
- package/output/{render-CYQmEacg.js.map → render-tWo_ruCT.js.map} +1 -1
- package/output/renderer.css +12 -17
- package/output/server.cjs +2 -2
- package/output/server.js +2 -2
- package/package.json +1 -1
- package/output/OpenApiOperation-Cr8TxLjl.js.map +0 -1
- package/output/OpenApiOperation-bdALspAY.cjs.map +0 -1
- package/output/i18n-DjRcGSuU.js.map +0 -1
- package/output/i18n-L1XX-y6M.cjs.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const require_rolldown_runtime = require("./rolldown-runtime-DakpK96I.cjs");
|
|
2
|
-
const require_i18n = require("./i18n-
|
|
3
|
-
const require_PageActions = require("./PageActions-
|
|
2
|
+
const require_i18n = require("./i18n-R08i532P.cjs");
|
|
3
|
+
const require_PageActions = require("./PageActions-GVAsO16x.cjs");
|
|
4
4
|
const require_remark = require("./remark-DTLbG8PK.cjs");
|
|
5
5
|
let clsx = require("clsx");
|
|
6
6
|
clsx = require_rolldown_runtime.__toESM(clsx, 1);
|
|
@@ -245,7 +245,7 @@ function Card(arg0) {
|
|
|
245
245
|
}
|
|
246
246
|
//#endregion
|
|
247
247
|
//#region source/components/Mermaid.tsx
|
|
248
|
-
var MermaidViewer = (0, react.lazy)(() => Promise.resolve().then(() => require("./MermaidViewer-
|
|
248
|
+
var MermaidViewer = (0, react.lazy)(() => Promise.resolve().then(() => require("./MermaidViewer-kbSVqJ_z.cjs")));
|
|
249
249
|
var mermaidModulePromise;
|
|
250
250
|
async function loadMermaid() {
|
|
251
251
|
mermaidModulePromise = mermaidModulePromise ?? import("mermaid").then((module) => module.default);
|
|
@@ -1006,7 +1006,7 @@ function TabItem(_props) {
|
|
|
1006
1006
|
return null;
|
|
1007
1007
|
}
|
|
1008
1008
|
function Tabs(arg0) {
|
|
1009
|
-
const { items, children, defaultValue, selectedIndex, onChange, className, listClassName, panelsClassName } = arg0;
|
|
1009
|
+
const { items, children, defaultValue, selectedIndex, onChange, className, spacingClassName = "my-6", listClassName, panelsClassName, actions, variant = "content" } = arg0;
|
|
1010
1010
|
const childItems = react.Children.toArray(children).filter((child) => (0, react.isValidElement)(child) && child.type === TabItem).map((child, index) => ({
|
|
1011
1011
|
id: child.props.value ?? `tab-${index}`,
|
|
1012
1012
|
label: child.props.title,
|
|
@@ -1023,23 +1023,26 @@ function Tabs(arg0) {
|
|
|
1023
1023
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_headlessui_react.TabGroup, {
|
|
1024
1024
|
selectedIndex: resolvedIndex,
|
|
1025
1025
|
onChange: handleChange,
|
|
1026
|
-
className: (0, clsx.default)("clarify-tabs
|
|
1027
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.
|
|
1028
|
-
className: (0, clsx.default)("flex max-w-full items-stretch
|
|
1029
|
-
children: resolvedItems.map((item) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_headlessui_react.Tab, {
|
|
1030
|
-
className: ({ selected }) => (0, clsx.default)("
|
|
1026
|
+
className: (0, clsx.default)("clarify-tabs", spacingClassName, className),
|
|
1027
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_headlessui_react.TabList, {
|
|
1028
|
+
className: (0, clsx.default)("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),
|
|
1029
|
+
children: [resolvedItems.map((item) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_headlessui_react.Tab, {
|
|
1030
|
+
className: ({ selected }) => (0, clsx.default)("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)"),
|
|
1031
1031
|
children: ({ selected }) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: item.label }), selected ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(framer_motion.motion.span, {
|
|
1032
1032
|
layoutId: indicatorLayoutId,
|
|
1033
|
-
className: "absolute inset-x-2.5
|
|
1033
|
+
className: (0, clsx.default)("absolute inset-x-2.5 h-0.5 bg-(--clarify-ui-tab-indicator)", variant === "content" ? "-bottom-1 rounded-full" : "-bottom-px"),
|
|
1034
1034
|
transition: {
|
|
1035
1035
|
type: "tween",
|
|
1036
1036
|
duration: .16,
|
|
1037
1037
|
ease: "easeOut"
|
|
1038
1038
|
}
|
|
1039
1039
|
}) : null] })
|
|
1040
|
-
}, item.id))
|
|
1040
|
+
}, item.id)), actions ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1041
|
+
className: "sticky right-0 ml-auto flex shrink-0 items-center bg-(--clarify-code-background)",
|
|
1042
|
+
children: actions
|
|
1043
|
+
}) : null]
|
|
1041
1044
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_headlessui_react.TabPanels, {
|
|
1042
|
-
className:
|
|
1045
|
+
className: panelsClassName ?? "mt-5",
|
|
1043
1046
|
children: resolvedItems.map((item) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_headlessui_react.TabPanel, {
|
|
1044
1047
|
className: "focus:outline-none focus-visible:ring-2 focus-visible:ring-(--clarify-theme-tokens-colors-primary)",
|
|
1045
1048
|
children: item.panel
|
|
@@ -1330,9 +1333,9 @@ function Col(arg0) {
|
|
|
1330
1333
|
});
|
|
1331
1334
|
}
|
|
1332
1335
|
function Properties(arg0) {
|
|
1333
|
-
const { children } = arg0;
|
|
1336
|
+
const { children, className, spacingClassName = "my-6" } = arg0;
|
|
1334
1337
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1335
|
-
className: "clarify-properties
|
|
1338
|
+
className: (0, clsx.default)("clarify-properties", spacingClassName, className),
|
|
1336
1339
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", {
|
|
1337
1340
|
role: "list",
|
|
1338
1341
|
className: "m-0 list-none divide-y divide-(--clarify-theme-tokens-colors-border) p-0",
|
|
@@ -2708,6 +2711,25 @@ function ResponseExamplesPanel(arg0) {
|
|
|
2708
2711
|
});
|
|
2709
2712
|
}
|
|
2710
2713
|
//#endregion
|
|
2714
|
+
//#region source/openapi/components/OpenApiDocumentSection.tsx
|
|
2715
|
+
function OpenApiDocumentSection(props) {
|
|
2716
|
+
const { title, children, className, bodyClassName, level = 3 } = props;
|
|
2717
|
+
const heading = level === 3 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("h3", {
|
|
2718
|
+
className: "!m-0 text-sm/6 font-semibold text-(--clarify-theme-tokens-colors-foreground)",
|
|
2719
|
+
children: title
|
|
2720
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("h4", {
|
|
2721
|
+
className: "!m-0 text-xs/5 font-semibold text-(--clarify-ui-text-soft)",
|
|
2722
|
+
children: title
|
|
2723
|
+
});
|
|
2724
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
|
|
2725
|
+
className: (0, clsx.default)("clarify-openapi-document-section", className),
|
|
2726
|
+
children: [heading, /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
2727
|
+
className: (0, clsx.default)("mt-2", bodyClassName),
|
|
2728
|
+
children
|
|
2729
|
+
})]
|
|
2730
|
+
});
|
|
2731
|
+
}
|
|
2732
|
+
//#endregion
|
|
2711
2733
|
//#region source/openapi/components/OpenApiAuthDocumentation.tsx
|
|
2712
2734
|
function authSchemeType(option, apiKeyLabel) {
|
|
2713
2735
|
const { scheme } = option;
|
|
@@ -2717,73 +2739,73 @@ function authSchemeType(option, apiKeyLabel) {
|
|
|
2717
2739
|
if (scheme.type === "openIdConnect") return "OPENID CONNECT";
|
|
2718
2740
|
return scheme.type?.toUpperCase() || "AUTH";
|
|
2719
2741
|
}
|
|
2720
|
-
function OpenApiAuthDocumentation(
|
|
2742
|
+
function OpenApiAuthDocumentation(props) {
|
|
2743
|
+
const { options } = props;
|
|
2721
2744
|
const t = require_i18n.useBuiltInText();
|
|
2722
2745
|
if (options.length === 0) return null;
|
|
2723
|
-
|
|
2724
|
-
className: "
|
|
2725
|
-
children:
|
|
2726
|
-
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
})
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
-
|
|
2772
|
-
|
|
2773
|
-
|
|
2774
|
-
|
|
2775
|
-
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
-
|
|
2779
|
-
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
})] });
|
|
2746
|
+
const renderOption = (option) => option.schemes.length === 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
2747
|
+
className: "border-b border-(--clarify-theme-tokens-colors-border) pt-2 pb-4 text-sm/6 font-medium text-(--clarify-theme-tokens-colors-foreground)",
|
|
2748
|
+
children: t("openapi.authNoAuth")
|
|
2749
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
2750
|
+
className: "divide-y divide-(--clarify-theme-tokens-colors-border) border-b border-(--clarify-theme-tokens-colors-border)",
|
|
2751
|
+
children: option.schemes.map((schemeOption, schemeIndex) => {
|
|
2752
|
+
const { scheme } = schemeOption;
|
|
2753
|
+
const details = [
|
|
2754
|
+
scheme.type === "apiKey" && scheme.in && scheme.name ? t("openapi.authLocation", {
|
|
2755
|
+
in: scheme.in,
|
|
2756
|
+
name: scheme.name
|
|
2757
|
+
}) : void 0,
|
|
2758
|
+
scheme.type === "http" && scheme.bearerFormat ? t("openapi.authBearerFormat", { format: scheme.bearerFormat }) : void 0,
|
|
2759
|
+
scheme.type === "openIdConnect" ? scheme.openIdConnectUrl : void 0,
|
|
2760
|
+
schemeOption.scopes.length > 0 ? t("openapi.authScopes", { scopes: schemeOption.scopes.join(", ") }) : void 0
|
|
2761
|
+
].filter((value) => Boolean(value));
|
|
2762
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [schemeIndex > 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
2763
|
+
className: "relative h-0",
|
|
2764
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2765
|
+
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)",
|
|
2766
|
+
children: t("openapi.authAnd")
|
|
2767
|
+
})
|
|
2768
|
+
}) : null, /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2769
|
+
className: "py-4 first:pt-2",
|
|
2770
|
+
children: [
|
|
2771
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2772
|
+
className: "flex flex-wrap items-center gap-2",
|
|
2773
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2774
|
+
className: "font-mono text-sm/6 font-semibold text-(--clarify-theme-tokens-colors-foreground)",
|
|
2775
|
+
children: schemeOption.name
|
|
2776
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2777
|
+
className: "rounded bg-(--clarify-ui-subtle-background) px-1.5 py-0.5 text-2xs font-semibold text-(--clarify-ui-text-soft)",
|
|
2778
|
+
children: authSchemeType(schemeOption, t("openapi.authApiKey"))
|
|
2779
|
+
})]
|
|
2780
|
+
}),
|
|
2781
|
+
scheme.description ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Markdown, {
|
|
2782
|
+
className: "mt-2 text-sm/6 text-(--clarify-ui-text-soft) *:first:mt-0 *:last:mb-0",
|
|
2783
|
+
children: scheme.description
|
|
2784
|
+
}) : null,
|
|
2785
|
+
details.length > 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
2786
|
+
className: "mt-2 flex min-w-0 flex-wrap gap-x-4 gap-y-1 text-xs/5 text-(--clarify-ui-text-faint)",
|
|
2787
|
+
children: details.map((detail) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2788
|
+
className: "min-w-0 break-all font-mono",
|
|
2789
|
+
children: detail
|
|
2790
|
+
}, detail))
|
|
2791
|
+
}) : null
|
|
2792
|
+
]
|
|
2793
|
+
})] }, schemeOption.name);
|
|
2794
|
+
})
|
|
2795
|
+
});
|
|
2796
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(OpenApiDocumentSection, {
|
|
2797
|
+
title: t("openapi.authentication"),
|
|
2798
|
+
bodyClassName: "not-prose",
|
|
2799
|
+
children: options.length === 1 ? renderOption(options[0]) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Tabs, {
|
|
2800
|
+
items: options.map((option) => ({
|
|
2801
|
+
id: option.key,
|
|
2802
|
+
label: option.label || t("openapi.none"),
|
|
2803
|
+
panel: renderOption(option)
|
|
2804
|
+
})),
|
|
2805
|
+
spacingClassName: "m-0",
|
|
2806
|
+
panelsClassName: "mt-2"
|
|
2807
|
+
})
|
|
2808
|
+
});
|
|
2787
2809
|
}
|
|
2788
2810
|
//#endregion
|
|
2789
2811
|
//#region source/openapi/components/SchemaProperties.tsx
|
|
@@ -3082,23 +3104,32 @@ function SchemaProperties(arg0) {
|
|
|
3082
3104
|
const { title, schema, spec, defaultExpanded } = arg0;
|
|
3083
3105
|
const root = getRootSchemaNode(spec, schema, defaultExpanded);
|
|
3084
3106
|
if (!root || root.children.length === 0) return null;
|
|
3085
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.
|
|
3086
|
-
|
|
3107
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(OpenApiDocumentSection, {
|
|
3108
|
+
title,
|
|
3109
|
+
level: 4,
|
|
3110
|
+
bodyClassName: "clarify-schema-properties not-prose",
|
|
3087
3111
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SchemaTree, { nodes: root.children })
|
|
3088
|
-
})
|
|
3112
|
+
});
|
|
3089
3113
|
}
|
|
3090
3114
|
function ParameterList(arg0) {
|
|
3091
3115
|
const t = require_i18n.useBuiltInText();
|
|
3092
3116
|
const { title, parameters } = arg0;
|
|
3093
3117
|
if (parameters.length === 0) return null;
|
|
3094
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
children:
|
|
3098
|
-
|
|
3099
|
-
children: parameter.
|
|
3100
|
-
|
|
3101
|
-
|
|
3118
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(OpenApiDocumentSection, {
|
|
3119
|
+
title,
|
|
3120
|
+
bodyClassName: "not-prose",
|
|
3121
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Properties, {
|
|
3122
|
+
spacingClassName: "m-0",
|
|
3123
|
+
children: parameters.map((parameter) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Property, {
|
|
3124
|
+
name: parameter.name ?? t("openapi.parameter"),
|
|
3125
|
+
type: [schemaToType(parameter.schema), parameter.required ? t("openapi.requiredBadge") : void 0].filter(Boolean).join(", ") || void 0,
|
|
3126
|
+
children: parameter.description ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Markdown, {
|
|
3127
|
+
className: "*:first:mt-0 *:last:mb-0",
|
|
3128
|
+
children: parameter.description
|
|
3129
|
+
}) : t("openapi.operationParameter")
|
|
3130
|
+
}, `${parameter.in}-${parameter.name}`))
|
|
3131
|
+
})
|
|
3132
|
+
});
|
|
3102
3133
|
}
|
|
3103
3134
|
function ResponseList(arg0) {
|
|
3104
3135
|
const { title, operation, spec, selectedStatus, onSelectStatus } = arg0;
|
|
@@ -3138,7 +3169,7 @@ function ResponseList(arg0) {
|
|
|
3138
3169
|
}) : `${t("openapi.response")}.`
|
|
3139
3170
|
}),
|
|
3140
3171
|
responseSchema && spec ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3141
|
-
className: "mt-
|
|
3172
|
+
className: "mt-6",
|
|
3142
3173
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SchemaProperties, {
|
|
3143
3174
|
title: t("openapi.responseBodyProperties"),
|
|
3144
3175
|
schema: responseSchema,
|
|
@@ -3150,27 +3181,34 @@ function ResponseList(arg0) {
|
|
|
3150
3181
|
};
|
|
3151
3182
|
if (orderedResponses.length === 1) {
|
|
3152
3183
|
const [{ status, response }] = orderedResponses;
|
|
3153
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.
|
|
3154
|
-
|
|
3155
|
-
|
|
3156
|
-
})] });
|
|
3157
|
-
}
|
|
3158
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h3", { children: title ?? t("openapi.responses") }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Tabs, {
|
|
3159
|
-
selectedIndex,
|
|
3160
|
-
onChange: (index) => {
|
|
3161
|
-
onSelectStatus?.(orderedResponses[index]?.status ?? "");
|
|
3162
|
-
},
|
|
3163
|
-
items: orderedResponses.map(({ status, response }) => ({
|
|
3164
|
-
id: status,
|
|
3165
|
-
label: status,
|
|
3166
|
-
panel: renderResponsePanel({
|
|
3184
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(OpenApiDocumentSection, {
|
|
3185
|
+
title: title ?? t("openapi.responses"),
|
|
3186
|
+
children: renderResponsePanel({
|
|
3167
3187
|
status,
|
|
3168
3188
|
response
|
|
3169
3189
|
})
|
|
3170
|
-
})
|
|
3171
|
-
|
|
3172
|
-
|
|
3173
|
-
|
|
3190
|
+
});
|
|
3191
|
+
}
|
|
3192
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(OpenApiDocumentSection, {
|
|
3193
|
+
title: title ?? t("openapi.responses"),
|
|
3194
|
+
bodyClassName: "not-prose",
|
|
3195
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Tabs, {
|
|
3196
|
+
selectedIndex,
|
|
3197
|
+
onChange: (index) => {
|
|
3198
|
+
onSelectStatus?.(orderedResponses[index]?.status ?? "");
|
|
3199
|
+
},
|
|
3200
|
+
items: orderedResponses.map(({ status, response }) => ({
|
|
3201
|
+
id: status,
|
|
3202
|
+
label: status,
|
|
3203
|
+
panel: renderResponsePanel({
|
|
3204
|
+
status,
|
|
3205
|
+
response
|
|
3206
|
+
})
|
|
3207
|
+
})),
|
|
3208
|
+
spacingClassName: "m-0",
|
|
3209
|
+
panelsClassName: "mt-2"
|
|
3210
|
+
})
|
|
3211
|
+
});
|
|
3174
3212
|
}
|
|
3175
3213
|
//#endregion
|
|
3176
3214
|
//#region source/openapi/components/EndpointSections.tsx
|
|
@@ -3196,7 +3234,7 @@ function EndpointRequest(arg0) {
|
|
|
3196
3234
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [renderDescription(), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Row, {
|
|
3197
3235
|
className: "clarify-openapi-request-workspace relative mt-8 pt-6",
|
|
3198
3236
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Col, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3199
|
-
className: "w-full",
|
|
3237
|
+
className: "flex w-full flex-col gap-6",
|
|
3200
3238
|
children: [
|
|
3201
3239
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(OpenApiAuthDocumentation, { options: authOptions }),
|
|
3202
3240
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ParameterList, {
|
|
@@ -3211,7 +3249,10 @@ function EndpointRequest(arg0) {
|
|
|
3211
3249
|
title: t("openapi.headers"),
|
|
3212
3250
|
parameters: groupedParameters.header
|
|
3213
3251
|
}),
|
|
3214
|
-
/* @__PURE__ */ (0, react_jsx_runtime.
|
|
3252
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(OpenApiDocumentSection, {
|
|
3253
|
+
title: t("openapi.requestBody"),
|
|
3254
|
+
children: renderRequestBody()
|
|
3255
|
+
})
|
|
3215
3256
|
]
|
|
3216
3257
|
}) }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Col, {
|
|
3217
3258
|
sticky: true,
|
|
@@ -4291,6 +4332,7 @@ function OpenApiResponseViewer(arg0) {
|
|
|
4291
4332
|
const previewAvailable = exchange ? canPreviewResponse(exchange.contentType) : false;
|
|
4292
4333
|
const selectedBodyMode = bodyModeSelection && bodyModeSelection.exchange === exchange ? bodyModeSelection.mode : "preview";
|
|
4293
4334
|
const activeBodyMode = previewAvailable ? selectedBodyMode : "raw";
|
|
4335
|
+
const bodyModes = ["preview", "raw"].filter((mode) => mode === "raw" || previewAvailable);
|
|
4294
4336
|
function downloadBody() {
|
|
4295
4337
|
if (!exchange) return;
|
|
4296
4338
|
const url = URL.createObjectURL(exchange.blob);
|
|
@@ -4365,48 +4407,37 @@ function OpenApiResponseViewer(arg0) {
|
|
|
4365
4407
|
className: "font-mono text-2xs font-normal text-(--clarify-code-faint)",
|
|
4366
4408
|
children: exchange.contentType || t("openapi.unknownContentType")
|
|
4367
4409
|
}),
|
|
4368
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.
|
|
4369
|
-
|
|
4370
|
-
|
|
4371
|
-
|
|
4372
|
-
|
|
4373
|
-
role: "tablist",
|
|
4374
|
-
className: "flex",
|
|
4375
|
-
children: ["preview", "raw"].filter((mode) => mode === "raw" || previewAvailable).map((mode) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
4376
|
-
type: "button",
|
|
4377
|
-
role: "tab",
|
|
4378
|
-
"aria-selected": activeBodyMode === mode,
|
|
4379
|
-
onClick: () => setBodyModeSelection({
|
|
4380
|
-
exchange,
|
|
4381
|
-
mode
|
|
4382
|
-
}),
|
|
4383
|
-
className: (0, clsx.default)("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)"),
|
|
4384
|
-
children: mode === "preview" ? t("openapi.preview") : t("openapi.raw")
|
|
4385
|
-
}, mode))
|
|
4386
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4387
|
-
className: "flex",
|
|
4388
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(CopyButton, { value: exchange.body }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
4389
|
-
type: "button",
|
|
4390
|
-
onClick: downloadBody,
|
|
4391
|
-
"aria-label": t("openapi.downloadBody"),
|
|
4392
|
-
title: t("openapi.downloadBody"),
|
|
4393
|
-
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)",
|
|
4394
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.DownloadIcon, {
|
|
4395
|
-
className: "size-4",
|
|
4396
|
-
"aria-hidden": "true"
|
|
4397
|
-
})
|
|
4398
|
-
})]
|
|
4399
|
-
})]
|
|
4400
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
4401
|
-
className: "p-4",
|
|
4402
|
-
children: activeBodyMode === "preview" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ResponsePreview, { exchange }) : exchange.size ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("pre", {
|
|
4410
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Tabs, {
|
|
4411
|
+
items: bodyModes.map((mode) => ({
|
|
4412
|
+
id: mode,
|
|
4413
|
+
label: mode === "preview" ? t("openapi.preview") : t("openapi.raw"),
|
|
4414
|
+
panel: mode === "preview" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ResponsePreview, { exchange }) : exchange.size ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("pre", {
|
|
4403
4415
|
className: "max-h-128 overflow-auto whitespace-pre-wrap wrap-break-word font-mono text-xs/5",
|
|
4404
4416
|
children: exchange.body
|
|
4405
4417
|
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
4406
4418
|
className: "py-8 text-center text-xs text-(--clarify-code-faint)",
|
|
4407
4419
|
children: t("openapi.responseBodyEmpty")
|
|
4408
4420
|
})
|
|
4409
|
-
})
|
|
4421
|
+
})),
|
|
4422
|
+
selectedIndex: bodyModes.indexOf(activeBodyMode),
|
|
4423
|
+
onChange: (index) => setBodyModeSelection({
|
|
4424
|
+
exchange,
|
|
4425
|
+
mode: bodyModes[index] ?? "raw"
|
|
4426
|
+
}),
|
|
4427
|
+
spacingClassName: "m-0 min-h-72",
|
|
4428
|
+
panelsClassName: "p-4",
|
|
4429
|
+
variant: "code",
|
|
4430
|
+
actions: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(CopyButton, { value: exchange.body }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
4431
|
+
type: "button",
|
|
4432
|
+
onClick: downloadBody,
|
|
4433
|
+
"aria-label": t("openapi.downloadBody"),
|
|
4434
|
+
title: t("openapi.downloadBody"),
|
|
4435
|
+
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)",
|
|
4436
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.DownloadIcon, {
|
|
4437
|
+
className: "size-4",
|
|
4438
|
+
"aria-hidden": "true"
|
|
4439
|
+
})
|
|
4440
|
+
})] })
|
|
4410
4441
|
})
|
|
4411
4442
|
})
|
|
4412
4443
|
]
|
|
@@ -5169,7 +5200,8 @@ function ServerVariableControl(arg0) {
|
|
|
5169
5200
|
label: option
|
|
5170
5201
|
})),
|
|
5171
5202
|
onChange,
|
|
5172
|
-
compact
|
|
5203
|
+
compact,
|
|
5204
|
+
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)"
|
|
5173
5205
|
});
|
|
5174
5206
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
5175
5207
|
"aria-label": name,
|
|
@@ -5199,7 +5231,8 @@ function ServerPanel(arg0) {
|
|
|
5199
5231
|
label: getServerLabel(server, index),
|
|
5200
5232
|
description: server.description
|
|
5201
5233
|
})),
|
|
5202
|
-
onChange: onSelectServer
|
|
5234
|
+
onChange: onSelectServer,
|
|
5235
|
+
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)"
|
|
5203
5236
|
})]
|
|
5204
5237
|
}) : null, variableEntries.length > 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
5205
5238
|
className: "grid gap-3 sm:grid-cols-(--clarify-openapi-variable-grid)",
|
|
@@ -5570,4 +5603,4 @@ Object.defineProperty(exports, "primitives_exports", {
|
|
|
5570
5603
|
}
|
|
5571
5604
|
});
|
|
5572
5605
|
|
|
5573
|
-
//# sourceMappingURL=OpenApiOperation-
|
|
5606
|
+
//# sourceMappingURL=OpenApiOperation-HhSjad7q.cjs.map
|