@clarify-labs/renderer 0.9.4 → 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 (39) hide show
  1. package/output/{ClarifyShell-D2P0iZ_m.js → ClarifyShell-CxhXBtsR.js} +2 -2
  2. package/output/{ClarifyShell-D2P0iZ_m.js.map → ClarifyShell-CxhXBtsR.js.map} +1 -1
  3. package/output/{ClarifyShell-7r92MZg9.cjs → ClarifyShell-DjLRRW8T.cjs} +4 -4
  4. package/output/{ClarifyShell-7r92MZg9.cjs.map → ClarifyShell-DjLRRW8T.cjs.map} +1 -1
  5. package/output/{OpenApiOperation-Dhlz3JSx.js → OpenApiOperation-CyBkzvob.js} +27 -21
  6. package/output/{OpenApiOperation-Dhlz3JSx.js.map → OpenApiOperation-CyBkzvob.js.map} +1 -1
  7. package/output/{OpenApiOperation-CyyPlZL6.cjs → OpenApiOperation-qp5tFaWP.cjs} +32 -26
  8. package/output/{OpenApiOperation-CyyPlZL6.cjs.map → OpenApiOperation-qp5tFaWP.cjs.map} +1 -1
  9. package/output/{PageActions-D0PA8Zv5.js → PageActions-Dn8IGWoL.js} +3 -1
  10. package/output/PageActions-Dn8IGWoL.js.map +1 -0
  11. package/output/{PageActions-CTn2XkPg.cjs → PageActions-GS_cxeJN.cjs} +6 -4
  12. package/output/PageActions-GS_cxeJN.cjs.map +1 -0
  13. package/output/client.cjs +3 -3
  14. package/output/client.js +3 -3
  15. package/output/core/i18n.d.ts +1 -1
  16. package/output/index.cjs +5 -5
  17. package/output/index.cjs.map +1 -1
  18. package/output/index.js +4 -4
  19. package/output/index.js.map +1 -1
  20. package/output/markdown.cjs +1 -1
  21. package/output/preview.cjs +2 -2
  22. package/output/preview.cjs.map +1 -1
  23. package/output/preview.js +2 -2
  24. package/output/preview.js.map +1 -1
  25. package/output/remark-Dd2WU50s.js.map +1 -1
  26. package/output/{remark-Dv3owbSH.cjs → remark-zSQT0MBv.cjs} +3 -3
  27. package/output/{remark-Dv3owbSH.cjs.map → remark-zSQT0MBv.cjs.map} +1 -1
  28. package/output/{render-DXDSIfZ8.cjs → render-CCCoUWDP.cjs} +2 -2
  29. package/output/{render-DXDSIfZ8.cjs.map → render-CCCoUWDP.cjs.map} +1 -1
  30. package/output/{render-CwSsfrs7.js → render-CV0a-qtD.js} +2 -2
  31. package/output/{render-CwSsfrs7.js.map → render-CV0a-qtD.js.map} +1 -1
  32. package/output/renderer.css +1 -1
  33. package/output/server.cjs +2 -2
  34. package/output/server.cjs.map +1 -1
  35. package/output/server.js +2 -2
  36. package/package.json +10 -10
  37. package/output/PageActions-CTn2XkPg.cjs.map +0 -1
  38. package/output/PageActions-D0PA8Zv5.js.map +0 -1
  39. /package/output/{chunk-DakpK96I.cjs → rolldown-runtime-DakpK96I.cjs} +0 -0
@@ -1,4 +1,4 @@
1
- import { C as isExternalHref, D as useBuiltInText, E as copyTextToClipboard, N as useLocale, c as lucideIconRegistry, h as useTheme, j as useConfig, l as resolveLucideIconName, n as PageTitleActions, o as useSectionStore, s as remToPx, w as localizeHref } from "./PageActions-D0PA8Zv5.js";
1
+ import { C as isExternalHref, D as useBuiltInText, E as copyTextToClipboard, N as useLocale, c as lucideIconRegistry, h as useTheme, j as useConfig, l as resolveLucideIconName, n as PageTitleActions, o as useSectionStore, s as remToPx, w as localizeHref } from "./PageActions-Dn8IGWoL.js";
2
2
  import { t as markdownRemarkPlugins } from "./remark-Dd2WU50s.js";
3
3
  import clsx from "clsx";
4
4
  import { Children, createContext, createElement, forwardRef, isValidElement, useContext, useEffect, useId, useLayoutEffect, useRef, useState } from "react";
@@ -1406,7 +1406,7 @@ function getFieldValue(name, value, schema) {
1406
1406
  }
1407
1407
  function getFormParams(value, requestContent) {
1408
1408
  const properties = getSchemaProperties(requestContent.value.schema);
1409
- return Array.from(new Set([...Object.keys(properties), ...isRecord(value) ? Object.keys(value) : []])).flatMap((name) => {
1409
+ return Array.from(/* @__PURE__ */ new Set([...Object.keys(properties), ...isRecord(value) ? Object.keys(value) : []])).flatMap((name) => {
1410
1410
  const fieldValue = getFieldValue(name, value, properties[name]);
1411
1411
  if (typeof fieldValue === "undefined") return [];
1412
1412
  const contentType = requestContent.value.encoding?.[name]?.contentType;
@@ -2282,7 +2282,7 @@ function getSchemaChildren(arg0) {
2282
2282
  path,
2283
2283
  required,
2284
2284
  depth,
2285
- seen: new Set([...seen, schema.$ref]),
2285
+ seen: /* @__PURE__ */ new Set([...seen, schema.$ref]),
2286
2286
  defaultExpanded
2287
2287
  });
2288
2288
  }
@@ -2389,7 +2389,7 @@ function getRootSchemaNode(spec, schema, defaultExpanded) {
2389
2389
  spec,
2390
2390
  schema: resolvedSchema,
2391
2391
  path: resolveReferenceName(schema.$ref),
2392
- seen: new Set([schema.$ref]),
2392
+ seen: /* @__PURE__ */ new Set([schema.$ref]),
2393
2393
  defaultExpanded
2394
2394
  })
2395
2395
  };
@@ -2518,19 +2518,17 @@ function SchemaProperties(arg0) {
2518
2518
  })] });
2519
2519
  }
2520
2520
  function ParameterList(arg0) {
2521
- const { title, parameters } = arg0;
2522
2521
  const t = useBuiltInText();
2523
- return /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("h3", { children: title }), /* @__PURE__ */ jsx(Properties, { children: parameters.length > 0 ? parameters.map((parameter) => /* @__PURE__ */ jsx(Property, {
2522
+ const { title, parameters } = arg0;
2523
+ if (parameters.length === 0) return null;
2524
+ return /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("h3", { children: title }), /* @__PURE__ */ jsx(Properties, { children: parameters.map((parameter) => /* @__PURE__ */ jsx(Property, {
2524
2525
  name: parameter.name ?? t("openapi.parameter"),
2525
2526
  type: [schemaToType(parameter.schema), parameter.required ? t("openapi.requiredBadge") : void 0].filter(Boolean).join(", ") || void 0,
2526
2527
  children: parameter.description ? /* @__PURE__ */ jsx(Markdown, {
2527
2528
  className: "*:first:mt-0 *:last:mb-0",
2528
2529
  children: parameter.description
2529
2530
  }) : t("openapi.operationParameter")
2530
- }, `${parameter.in}-${parameter.name}`)) : /* @__PURE__ */ jsx("span", {
2531
- className: "text-sm/5 text-(--clarify-ui-text-soft)",
2532
- children: t("openapi.none")
2533
- }) })] });
2531
+ }, `${parameter.in}-${parameter.name}`)) })] });
2534
2532
  }
2535
2533
  function ResponseList(arg0) {
2536
2534
  const { operation, spec, selectedStatus, onSelectStatus } = arg0;
@@ -2608,7 +2606,23 @@ function ResponseList(arg0) {
2608
2606
  function EndpointRequest(arg0) {
2609
2607
  const { spec, path, method, description, groupedParameters, parameters, requestBody, requestContents, requestSchema, selectedRequestMediaType, onSelectRequestMediaType, selectedServer, serverVariables, auth, sharedExampleKey, onSelectExampleKey } = arg0;
2610
2608
  const t = useBuiltInText();
2611
- return /* @__PURE__ */ jsxs(Fragment$1, { children: [description ? /* @__PURE__ */ jsx(Markdown, { children: description }) : null, /* @__PURE__ */ jsxs(Row, {
2609
+ const hasRequestBody = Boolean(requestBody && requestContents.length > 0);
2610
+ const renderDescription = () => {
2611
+ if (!description) return null;
2612
+ return /* @__PURE__ */ jsx(Markdown, { children: description });
2613
+ };
2614
+ const renderRequestBody = () => {
2615
+ if (!hasRequestBody) return /* @__PURE__ */ jsx("p", {
2616
+ className: "text-sm/5 text-(--clarify-ui-text-soft)",
2617
+ children: t("openapi.requestBodyEmpty")
2618
+ });
2619
+ return /* @__PURE__ */ jsxs(Fragment$1, { children: [typeof requestBody?.description === "string" ? /* @__PURE__ */ jsx(Markdown, { children: requestBody.description }) : null, /* @__PURE__ */ jsx(SchemaProperties, {
2620
+ title: t("openapi.bodyProperties"),
2621
+ schema: requestSchema,
2622
+ spec
2623
+ })] });
2624
+ };
2625
+ return /* @__PURE__ */ jsxs(Fragment$1, { children: [renderDescription(), /* @__PURE__ */ jsxs(Row, {
2612
2626
  className: "relative mt-6",
2613
2627
  children: [/* @__PURE__ */ jsx(Col, { children: /* @__PURE__ */ jsxs("div", {
2614
2628
  className: "w-full",
@@ -2625,15 +2639,7 @@ function EndpointRequest(arg0) {
2625
2639
  title: t("openapi.headers"),
2626
2640
  parameters: groupedParameters.header
2627
2641
  }),
2628
- requestBody && requestContents.length > 0 ? /* @__PURE__ */ jsxs(Fragment$1, { children: [
2629
- /* @__PURE__ */ jsx("h3", { children: t("openapi.requestBody") }),
2630
- typeof requestBody.description === "string" ? /* @__PURE__ */ jsx(Markdown, { children: requestBody.description }) : null,
2631
- /* @__PURE__ */ jsx(SchemaProperties, {
2632
- title: t("openapi.bodyProperties"),
2633
- schema: requestSchema,
2634
- spec
2635
- })
2636
- ] }) : null
2642
+ /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("h3", { children: t("openapi.requestBody") }), renderRequestBody()] })
2637
2643
  ]
2638
2644
  }) }), /* @__PURE__ */ jsx(Col, {
2639
2645
  sticky: true,
@@ -3156,4 +3162,4 @@ function OpenApiOperation(arg0) {
3156
3162
  //#endregion
3157
3163
  export { Button as A, Code as C, Card as D, Mermaid as E, CardGroup as O, Collapse as S, Pre as T, HeroPattern as _, authPlaceholder as a, Tag as b, getServerKey as c, getRequestBody$1 as d, Markdown as f, GridPattern as g, Prose as h, ResponseExamplesPanel as i, Callout as k, getServers as l, WebFrame as m, OpenApiOperation as n, defaultServerVariables as o, primitives_exports as p, RequestExamplesPanel as r, getAuthOptions as s, EndpointIdentity as t, getMediaTypeEntries as u, Logo as v, CodeGroup as w, Feedback as x, Heading as y };
3158
3164
 
3159
- //# sourceMappingURL=OpenApiOperation-Dhlz3JSx.js.map
3165
+ //# sourceMappingURL=OpenApiOperation-CyBkzvob.js.map