@clarify-labs/renderer 0.9.3 → 0.10.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.
Files changed (52) hide show
  1. package/output/{ClarifyShell-BQ29N8P5.js → ClarifyShell-CxhXBtsR.js} +104 -73
  2. package/output/ClarifyShell-CxhXBtsR.js.map +1 -0
  3. package/output/{ClarifyShell-Dm--LZco.cjs → ClarifyShell-DjLRRW8T.cjs} +111 -74
  4. package/output/ClarifyShell-DjLRRW8T.cjs.map +1 -0
  5. package/output/{OpenApiOperation-C9xyRo5a.js → OpenApiOperation-CyBkzvob.js} +123 -43
  6. package/output/OpenApiOperation-CyBkzvob.js.map +1 -0
  7. package/output/{OpenApiOperation-DIWGdw29.cjs → OpenApiOperation-qp5tFaWP.cjs} +128 -48
  8. package/output/OpenApiOperation-qp5tFaWP.cjs.map +1 -0
  9. package/output/{PageActions-B_tSec1f.js → PageActions-Dn8IGWoL.js} +9 -4
  10. package/output/PageActions-Dn8IGWoL.js.map +1 -0
  11. package/output/{PageActions-DEuFHgyB.cjs → PageActions-GS_cxeJN.cjs} +17 -6
  12. package/output/PageActions-GS_cxeJN.cjs.map +1 -0
  13. package/output/app/ContentDiagnostic.d.ts +9 -0
  14. package/output/app/ErrorBoundary.d.ts +0 -2
  15. package/output/app/RenderErrorPanel.d.ts +20 -0
  16. package/output/client.cjs +3 -3
  17. package/output/client.js +3 -3
  18. package/output/core/context.d.ts +1 -0
  19. package/output/core/i18n.d.ts +1 -1
  20. package/output/core/types.d.ts +1 -0
  21. package/output/index.cjs +44 -5
  22. package/output/index.cjs.map +1 -1
  23. package/output/index.d.ts +5 -3
  24. package/output/index.js +42 -5
  25. package/output/index.js.map +1 -1
  26. package/output/markdown.cjs +1 -1
  27. package/output/openapi/components/SchemaProperties.d.ts +1 -0
  28. package/output/openapi/entry.d.ts +5 -0
  29. package/output/openapi/index.d.ts +2 -2
  30. package/output/preview.cjs +2 -2
  31. package/output/preview.cjs.map +1 -1
  32. package/output/preview.js +2 -2
  33. package/output/preview.js.map +1 -1
  34. package/output/remark-Dd2WU50s.js.map +1 -1
  35. package/output/{remark-Dv3owbSH.cjs → remark-zSQT0MBv.cjs} +3 -3
  36. package/output/{remark-Dv3owbSH.cjs.map → remark-zSQT0MBv.cjs.map} +1 -1
  37. package/output/{render-BCGK1WpS.cjs → render-CCCoUWDP.cjs} +2 -2
  38. package/output/{render-BCGK1WpS.cjs.map → render-CCCoUWDP.cjs.map} +1 -1
  39. package/output/{render-CEWLJSmt.js → render-CV0a-qtD.js} +2 -2
  40. package/output/{render-CEWLJSmt.js.map → render-CV0a-qtD.js.map} +1 -1
  41. package/output/renderer.css +5 -1
  42. package/output/server.cjs +2 -2
  43. package/output/server.cjs.map +1 -1
  44. package/output/server.js +2 -2
  45. package/package.json +10 -10
  46. package/output/ClarifyShell-BQ29N8P5.js.map +0 -1
  47. package/output/ClarifyShell-Dm--LZco.cjs.map +0 -1
  48. package/output/OpenApiOperation-C9xyRo5a.js.map +0 -1
  49. package/output/OpenApiOperation-DIWGdw29.cjs.map +0 -1
  50. package/output/PageActions-B_tSec1f.js.map +0 -1
  51. package/output/PageActions-DEuFHgyB.cjs.map +0 -1
  52. /package/output/{chunk-DakpK96I.cjs → rolldown-runtime-DakpK96I.cjs} +0 -0
@@ -1,8 +1,8 @@
1
- const require_chunk = require("./chunk-DakpK96I.cjs");
2
- const require_PageActions = require("./PageActions-DEuFHgyB.cjs");
3
- const require_remark = require("./remark-Dv3owbSH.cjs");
1
+ const require_rolldown_runtime = require("./rolldown-runtime-DakpK96I.cjs");
2
+ const require_PageActions = require("./PageActions-GS_cxeJN.cjs");
3
+ const require_remark = require("./remark-zSQT0MBv.cjs");
4
4
  let clsx = require("clsx");
5
- clsx = require_chunk.__toESM(clsx, 1);
5
+ clsx = require_rolldown_runtime.__toESM(clsx, 1);
6
6
  let react = require("react");
7
7
  let react_router_dom = require("react-router-dom");
8
8
  let _headlessui_react = require("@headlessui/react");
@@ -12,7 +12,7 @@ let framer_motion = require("framer-motion");
12
12
  let zustand = require("zustand");
13
13
  let react_zoom_pan_pinch = require("react-zoom-pan-pinch");
14
14
  let react_markdown = require("react-markdown");
15
- react_markdown = require_chunk.__toESM(react_markdown, 1);
15
+ react_markdown = require_rolldown_runtime.__toESM(react_markdown, 1);
16
16
  let github_slugger = require("github-slugger");
17
17
  let _scalar_snippetz = require("@scalar/snippetz");
18
18
  //#region source/components/LocalizedLink.tsx
@@ -996,7 +996,7 @@ function WebFrame(arg0) {
996
996
  }
997
997
  //#endregion
998
998
  //#region source/mdx/primitives.tsx
999
- var primitives_exports = /* @__PURE__ */ require_chunk.__exportAll({
999
+ var primitives_exports = /* @__PURE__ */ require_rolldown_runtime.__exportAll({
1000
1000
  Button: () => Button,
1001
1001
  Callout: () => Callout,
1002
1002
  Card: () => Card,
@@ -1303,10 +1303,10 @@ function schemaToType(schema) {
1303
1303
  if (!isRecord(schema)) return void 0;
1304
1304
  if (isReference(schema)) return resolveReferenceName(schema.$ref);
1305
1305
  if (typeof schema.const !== "undefined") return JSON.stringify(schema.const);
1306
- if (Array.isArray(schema.enum)) return schema.enum.map(String).join(" | ");
1306
+ if (Array.isArray(schema.enum)) return "enum";
1307
1307
  const oneOf = schema.oneOf ?? schema.anyOf;
1308
- if (Array.isArray(oneOf)) return oneOf.map(schemaToType).filter(Boolean).join(" | ");
1309
- if (Array.isArray(schema.allOf)) return schema.allOf.map(schemaToType).filter(Boolean).join(" & ");
1308
+ if (Array.isArray(oneOf)) return oneOf.map((branch) => schemaToType(branch)).filter(Boolean).join(" | ");
1309
+ if (Array.isArray(schema.allOf)) return schema.allOf.map((branch) => schemaToType(branch)).filter(Boolean).join(" & ");
1310
1310
  if (schemaHasType(schema, "array")) return `${schemaToType(schema.items) ?? "unknown"}[]`;
1311
1311
  const type = Array.isArray(schema.type) ? schema.type.map(String).join(" | ") : schema.type;
1312
1312
  return typeof type === "string" ? [type, typeof schema.format === "string" ? `<${schema.format}>` : void 0].filter(Boolean).join("") : void 0;
@@ -1397,7 +1397,7 @@ function getFieldValue(name, value, schema) {
1397
1397
  }
1398
1398
  function getFormParams(value, requestContent) {
1399
1399
  const properties = getSchemaProperties(requestContent.value.schema);
1400
- return Array.from(new Set([...Object.keys(properties), ...isRecord(value) ? Object.keys(value) : []])).flatMap((name) => {
1400
+ return Array.from(/* @__PURE__ */ new Set([...Object.keys(properties), ...isRecord(value) ? Object.keys(value) : []])).flatMap((name) => {
1401
1401
  const fieldValue = getFieldValue(name, value, properties[name]);
1402
1402
  if (typeof fieldValue === "undefined") return [];
1403
1403
  const contentType = requestContent.value.encoding?.[name]?.contentType;
@@ -2208,9 +2208,17 @@ function ResponseExamplesPanel(arg0) {
2208
2208
  }
2209
2209
  //#endregion
2210
2210
  //#region source/openapi/components/SchemaProperties.tsx
2211
+ function getEnumDescriptions(schema) {
2212
+ const descriptions = schema["x-enumDescriptions"];
2213
+ if (Array.isArray(descriptions)) return descriptions.map((value) => typeof value === "string" ? value : void 0);
2214
+ if (isRecord(descriptions)) return Array.isArray(schema.enum) ? schema.enum.map((value) => {
2215
+ const description = descriptions[String(value)];
2216
+ return typeof description === "string" ? description : void 0;
2217
+ }) : [];
2218
+ return [];
2219
+ }
2211
2220
  function getSchemaDetails(schema) {
2212
2221
  const details = [
2213
- Array.isArray(schema.enum) ? `enum: ${schema.enum.map(String).join(", ")}` : void 0,
2214
2222
  typeof schema.const !== "undefined" ? `const: ${String(schema.const)}` : void 0,
2215
2223
  typeof schema.default !== "undefined" ? `default: ${String(schema.default)}` : void 0,
2216
2224
  typeof schema.pattern === "string" ? `pattern: ${schema.pattern}` : void 0,
@@ -2223,6 +2231,21 @@ function getSchemaDetails(schema) {
2223
2231
  function getSchemaDescription(schema) {
2224
2232
  return typeof schema.description === "string" ? schema.description : void 0;
2225
2233
  }
2234
+ function getSchemaNodeType(schema) {
2235
+ return schemaToType(schema);
2236
+ }
2237
+ function getEnumChildren(schema, path) {
2238
+ if (!Array.isArray(schema.enum) || schema.enum.length === 0) return [];
2239
+ const descriptions = getEnumDescriptions(schema);
2240
+ return schema.enum.map((value, index) => ({
2241
+ key: `${path || "root"}.enum[${index}]`,
2242
+ name: String(value),
2243
+ kind: "enum",
2244
+ description: descriptions[index],
2245
+ required: false,
2246
+ children: []
2247
+ }));
2248
+ }
2226
2249
  function getComposedBranches(schema) {
2227
2250
  const entries = [];
2228
2251
  for (const key of [
@@ -2240,7 +2263,7 @@ function getComposedBranches(schema) {
2240
2263
  return entries;
2241
2264
  }
2242
2265
  function getSchemaChildren(arg0) {
2243
- const { spec, schema, path, required = [], depth = 0, seen = /* @__PURE__ */ new Set() } = arg0;
2266
+ const { spec, path, schema, depth = 0, required = [], seen = /* @__PURE__ */ new Set(), defaultExpanded } = arg0;
2244
2267
  if (depth > 12) return [];
2245
2268
  if (isReference(schema)) {
2246
2269
  if (seen.has(schema.$ref)) return [];
@@ -2250,7 +2273,8 @@ function getSchemaChildren(arg0) {
2250
2273
  path,
2251
2274
  required,
2252
2275
  depth,
2253
- seen: new Set([...seen, schema.$ref])
2276
+ seen: /* @__PURE__ */ new Set([...seen, schema.$ref]),
2277
+ defaultExpanded
2254
2278
  });
2255
2279
  }
2256
2280
  if (!isRecord(schema)) return [];
@@ -2259,9 +2283,11 @@ function getSchemaChildren(arg0) {
2259
2283
  schema: schema.items,
2260
2284
  path: `${path}[]`,
2261
2285
  depth: depth + 1,
2262
- seen
2286
+ seen,
2287
+ defaultExpanded
2263
2288
  }) : [];
2264
2289
  const objectRequired = Array.isArray(schema.required) ? schema.required.map(String) : required;
2290
+ const enumChildren = getEnumChildren(schema, path);
2265
2291
  const properties = isRecord(schema.properties) ? schema.properties : {};
2266
2292
  const propertyChildren = Object.entries(properties).map(([name, propertySchema]) => {
2267
2293
  const resolvedProperty = resolveSchema(spec, propertySchema);
@@ -2273,31 +2299,38 @@ function getSchemaChildren(arg0) {
2273
2299
  schema: isArray ? property.items : propertySchema,
2274
2300
  path: isArray ? `${childPath}[]` : childPath,
2275
2301
  depth: depth + 1,
2276
- seen
2302
+ seen,
2303
+ defaultExpanded
2277
2304
  });
2305
+ const hasEnumValues = Array.isArray(property.enum) && property.enum.length > 0;
2278
2306
  return {
2279
2307
  key: childPath,
2280
2308
  name,
2281
- type: schemaToType(propertySchema),
2309
+ kind: "property",
2310
+ type: getSchemaNodeType(property),
2282
2311
  description: getSchemaDescription(property),
2283
2312
  details: getSchemaDetails(property),
2284
2313
  required: objectRequired.includes(name),
2314
+ defaultExpanded: hasEnumValues ? defaultExpanded === true : defaultExpanded ?? depth < 1,
2285
2315
  children
2286
2316
  };
2287
2317
  });
2288
2318
  const additionalPropertyChildren = isRecord(schema.additionalProperties) ? [{
2289
2319
  key: `${path || "root"}.*`,
2290
2320
  name: "*",
2291
- type: schemaToType(schema.additionalProperties),
2321
+ kind: "property",
2322
+ type: getSchemaNodeType(schema.additionalProperties),
2292
2323
  description: getSchemaDescription(schema.additionalProperties),
2293
2324
  details: getSchemaDetails(schema.additionalProperties),
2294
2325
  required: false,
2326
+ defaultExpanded: defaultExpanded ?? depth < 1,
2295
2327
  children: getSchemaChildren({
2296
2328
  spec,
2297
2329
  schema: schema.additionalProperties,
2298
2330
  path: `${path || "root"}.*`,
2299
2331
  depth: depth + 1,
2300
- seen
2332
+ seen,
2333
+ defaultExpanded
2301
2334
  })
2302
2335
  }] : [];
2303
2336
  const composedChildren = getComposedBranches(schema).map(({ label, schema: branchSchema }) => {
@@ -2306,35 +2339,40 @@ function getSchemaChildren(arg0) {
2306
2339
  return {
2307
2340
  key: `${path || "root"}.${label}`,
2308
2341
  name: label,
2309
- type: schemaToType(branchSchema),
2342
+ kind: "property",
2343
+ type: getSchemaNodeType(branch),
2310
2344
  description: branch ? getSchemaDescription(branch) : void 0,
2311
2345
  details: branch ? getSchemaDetails(branch) : void 0,
2312
2346
  required: false,
2347
+ defaultExpanded: defaultExpanded ?? depth < 1,
2313
2348
  children: getSchemaChildren({
2314
2349
  spec,
2315
2350
  schema: branchSchema,
2316
2351
  path: `${path || "root"}.${label}`,
2317
2352
  required: objectRequired,
2318
2353
  depth: depth + 1,
2319
- seen
2354
+ seen,
2355
+ defaultExpanded
2320
2356
  })
2321
2357
  };
2322
2358
  });
2323
2359
  return [
2324
2360
  ...arrayChildren,
2361
+ ...enumChildren,
2325
2362
  ...propertyChildren,
2326
2363
  ...additionalPropertyChildren,
2327
2364
  ...composedChildren
2328
2365
  ];
2329
2366
  }
2330
- function getRootSchemaNode(spec, schema) {
2367
+ function getRootSchemaNode(spec, schema, defaultExpanded) {
2331
2368
  if (isReference(schema)) {
2332
2369
  const resolvedSchema = resolveSchema(spec, schema);
2333
2370
  const resolved = isRecord(resolvedSchema) ? resolvedSchema : {};
2334
2371
  return {
2335
2372
  key: schema.$ref,
2336
2373
  name: resolveReferenceName(schema.$ref),
2337
- type: schemaToType(schema),
2374
+ kind: "property",
2375
+ type: getSchemaNodeType(resolved),
2338
2376
  description: getSchemaDescription(resolved),
2339
2377
  details: getSchemaDetails(resolved),
2340
2378
  required: false,
@@ -2342,7 +2380,8 @@ function getRootSchemaNode(spec, schema) {
2342
2380
  spec,
2343
2381
  schema: resolvedSchema,
2344
2382
  path: resolveReferenceName(schema.$ref),
2345
- seen: new Set([schema.$ref])
2383
+ seen: /* @__PURE__ */ new Set([schema.$ref]),
2384
+ defaultExpanded
2346
2385
  })
2347
2386
  };
2348
2387
  }
@@ -2350,24 +2389,58 @@ function getRootSchemaNode(spec, schema) {
2350
2389
  return {
2351
2390
  key: "root",
2352
2391
  name: "body",
2353
- type: schemaToType(schema),
2392
+ kind: "property",
2393
+ type: getSchemaNodeType(schema),
2354
2394
  description: getSchemaDescription(schema),
2355
2395
  details: getSchemaDetails(schema),
2356
2396
  required: false,
2357
2397
  children: getSchemaChildren({
2358
2398
  spec,
2359
2399
  schema,
2360
- path: ""
2400
+ path: "",
2401
+ defaultExpanded
2361
2402
  })
2362
2403
  };
2363
2404
  }
2364
- function SchemaNode(arg0) {
2405
+ function EnumValueNode(arg0) {
2365
2406
  const { node, depth = 0 } = arg0;
2407
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", {
2408
+ className: "clarify-schema-node m-0 px-0 py-2 first:pt-0 last:pb-0",
2409
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
2410
+ className: (0, clsx.default)("flex min-w-0 items-start rounded py-0.5 text-left", depth > 0 ? "-mx-2 w-(--clarify-schema-row-nested-width) px-2" : "w-full px-1"),
2411
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
2412
+ className: "min-w-0 flex-1",
2413
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
2414
+ className: "flex min-w-0 flex-wrap items-center gap-x-2 gap-y-0.5",
2415
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
2416
+ className: "text-sm/5 font-semibold text-(--clarify-theme-tokens-colors-foreground)",
2417
+ children: node.name
2418
+ })
2419
+ }), node.description || node.details ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
2420
+ className: "mt-0.5 text-sm/5 text-(--clarify-ui-text-soft) *:first:mt-0 *:last:mb-0",
2421
+ children: [node.description ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Markdown, {
2422
+ className: "*:first:mt-0 *:last:mb-0",
2423
+ children: node.description
2424
+ }) : null, node.details ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
2425
+ className: "text-xs text-(--clarify-ui-text-faint)",
2426
+ children: node.details
2427
+ }) : null]
2428
+ }) : null]
2429
+ })
2430
+ })
2431
+ });
2432
+ }
2433
+ function SchemaNode(arg0) {
2434
+ const { node, depth = 0, defaultExpanded } = arg0;
2366
2435
  const t = require_PageActions.useBuiltInText();
2367
- const [expanded, setExpanded] = (0, react.useState)(depth < 1);
2436
+ const [expanded, setExpanded] = (0, react.useState)(defaultExpanded ?? depth < 1);
2368
2437
  const hasChildren = node.children.length > 0;
2438
+ if (node.kind === "enum") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(EnumValueNode, {
2439
+ node,
2440
+ depth
2441
+ });
2369
2442
  const type = [node.type, node.required ? t("openapi.requiredBadge") : void 0].filter(Boolean).join(", ") || void 0;
2370
- const fallbackDescription = node.required ? t("openapi.required") : t("openapi.optional");
2443
+ const fallbackDescription = hasChildren ? void 0 : node.required ? t("openapi.required") : t("openapi.optional");
2371
2444
  const rowClassName = (0, clsx.default)("flex min-w-0 items-start rounded py-0.5 text-left", depth > 0 ? "-mx-2 w-(--clarify-schema-row-nested-width) px-2" : "w-full px-1");
2372
2445
  const content = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
2373
2446
  className: "min-w-0 flex-1",
@@ -2421,13 +2494,14 @@ function SchemaTree(arg0) {
2421
2494
  className: (0, clsx.default)("m-0 list-none divide-y divide-(--clarify-theme-tokens-colors-border) p-0", depth > 0 && "mt-2 rounded-lg bg-(--clarify-ui-subtle-background) px-2 py-1"),
2422
2495
  children: nodes.map((node) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SchemaNode, {
2423
2496
  node,
2424
- depth
2497
+ depth,
2498
+ defaultExpanded: node.defaultExpanded
2425
2499
  }, node.key))
2426
2500
  });
2427
2501
  }
2428
2502
  function SchemaProperties(arg0) {
2429
- const { title, schema, spec } = arg0;
2430
- const root = getRootSchemaNode(spec, schema);
2503
+ const { title, schema, spec, defaultExpanded } = arg0;
2504
+ const root = getRootSchemaNode(spec, schema, defaultExpanded);
2431
2505
  if (!root || root.children.length === 0) return null;
2432
2506
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h3", { children: title }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
2433
2507
  className: "clarify-schema-properties my-6",
@@ -2435,19 +2509,17 @@ function SchemaProperties(arg0) {
2435
2509
  })] });
2436
2510
  }
2437
2511
  function ParameterList(arg0) {
2438
- const { title, parameters } = arg0;
2439
2512
  const t = require_PageActions.useBuiltInText();
2440
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h3", { children: title }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Properties, { children: parameters.length > 0 ? parameters.map((parameter) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Property, {
2513
+ const { title, parameters } = arg0;
2514
+ if (parameters.length === 0) return null;
2515
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h3", { children: title }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Properties, { children: parameters.map((parameter) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Property, {
2441
2516
  name: parameter.name ?? t("openapi.parameter"),
2442
2517
  type: [schemaToType(parameter.schema), parameter.required ? t("openapi.requiredBadge") : void 0].filter(Boolean).join(", ") || void 0,
2443
2518
  children: parameter.description ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Markdown, {
2444
2519
  className: "*:first:mt-0 *:last:mb-0",
2445
2520
  children: parameter.description
2446
2521
  }) : t("openapi.operationParameter")
2447
- }, `${parameter.in}-${parameter.name}`)) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
2448
- className: "text-sm/5 text-(--clarify-ui-text-soft)",
2449
- children: t("openapi.none")
2450
- }) })] });
2522
+ }, `${parameter.in}-${parameter.name}`)) })] });
2451
2523
  }
2452
2524
  function ResponseList(arg0) {
2453
2525
  const { operation, spec, selectedStatus, onSelectStatus } = arg0;
@@ -2525,7 +2597,23 @@ function ResponseList(arg0) {
2525
2597
  function EndpointRequest(arg0) {
2526
2598
  const { spec, path, method, description, groupedParameters, parameters, requestBody, requestContents, requestSchema, selectedRequestMediaType, onSelectRequestMediaType, selectedServer, serverVariables, auth, sharedExampleKey, onSelectExampleKey } = arg0;
2527
2599
  const t = require_PageActions.useBuiltInText();
2528
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [description ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Markdown, { children: description }) : null, /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Row, {
2600
+ const hasRequestBody = Boolean(requestBody && requestContents.length > 0);
2601
+ const renderDescription = () => {
2602
+ if (!description) return null;
2603
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Markdown, { children: description });
2604
+ };
2605
+ const renderRequestBody = () => {
2606
+ if (!hasRequestBody) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
2607
+ className: "text-sm/5 text-(--clarify-ui-text-soft)",
2608
+ children: t("openapi.requestBodyEmpty")
2609
+ });
2610
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [typeof requestBody?.description === "string" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Markdown, { children: requestBody.description }) : null, /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SchemaProperties, {
2611
+ title: t("openapi.bodyProperties"),
2612
+ schema: requestSchema,
2613
+ spec
2614
+ })] });
2615
+ };
2616
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [renderDescription(), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Row, {
2529
2617
  className: "relative mt-6",
2530
2618
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Col, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
2531
2619
  className: "w-full",
@@ -2542,15 +2630,7 @@ function EndpointRequest(arg0) {
2542
2630
  title: t("openapi.headers"),
2543
2631
  parameters: groupedParameters.header
2544
2632
  }),
2545
- requestBody && requestContents.length > 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
2546
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("h3", { children: t("openapi.requestBody") }),
2547
- typeof requestBody.description === "string" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Markdown, { children: requestBody.description }) : null,
2548
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SchemaProperties, {
2549
- title: t("openapi.bodyProperties"),
2550
- schema: requestSchema,
2551
- spec
2552
- })
2553
- ] }) : null
2633
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h3", { children: t("openapi.requestBody") }), renderRequestBody()] })
2554
2634
  ]
2555
2635
  }) }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Col, {
2556
2636
  sticky: true,
@@ -3252,4 +3332,4 @@ Object.defineProperty(exports, "primitives_exports", {
3252
3332
  }
3253
3333
  });
3254
3334
 
3255
- //# sourceMappingURL=OpenApiOperation-DIWGdw29.cjs.map
3335
+ //# sourceMappingURL=OpenApiOperation-qp5tFaWP.cjs.map