@clarify-labs/renderer 0.11.1 → 0.11.2

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 (47) hide show
  1. package/output/{ClarifyShell-C2XnkFQ6.cjs → ClarifyShell-Cn48irqj.cjs} +3 -3
  2. package/output/{ClarifyShell-C2XnkFQ6.cjs.map → ClarifyShell-Cn48irqj.cjs.map} +1 -1
  3. package/output/{ClarifyShell-CwRtof1h.js → ClarifyShell-D_HluctW.js} +3 -3
  4. package/output/{ClarifyShell-CwRtof1h.js.map → ClarifyShell-D_HluctW.js.map} +1 -1
  5. package/output/{MermaidViewer-CwkiQ2gO.js → MermaidViewer-Dby0ylNr.js} +2 -2
  6. package/output/{MermaidViewer-CwkiQ2gO.js.map → MermaidViewer-Dby0ylNr.js.map} +1 -1
  7. package/output/{MermaidViewer-CTvMCE19.cjs → MermaidViewer-EZjolX08.cjs} +2 -2
  8. package/output/{MermaidViewer-CTvMCE19.cjs.map → MermaidViewer-EZjolX08.cjs.map} +1 -1
  9. package/output/{OpenApiOperation-CFo6_otd.js → OpenApiOperation-Cr8TxLjl.js} +87 -6
  10. package/output/OpenApiOperation-Cr8TxLjl.js.map +1 -0
  11. package/output/{OpenApiOperation-D1WNrj5X.cjs → OpenApiOperation-bdALspAY.cjs} +87 -6
  12. package/output/OpenApiOperation-bdALspAY.cjs.map +1 -0
  13. package/output/{PageActions-3eo05fb_.js → PageActions-BLzCasvB.js} +3 -3
  14. package/output/{PageActions-3eo05fb_.js.map → PageActions-BLzCasvB.js.map} +1 -1
  15. package/output/{PageActions-Lp_NeIKr.cjs → PageActions-Bw9SAHLl.cjs} +3 -3
  16. package/output/{PageActions-Lp_NeIKr.cjs.map → PageActions-Bw9SAHLl.cjs.map} +1 -1
  17. package/output/{SearchDialog-BvCBIFqs.js → SearchDialog-DWYp1c6c.js} +3 -3
  18. package/output/{SearchDialog-BvCBIFqs.js.map → SearchDialog-DWYp1c6c.js.map} +1 -1
  19. package/output/{SearchDialog-CM9DrE2Y.cjs → SearchDialog-j_4Y9WY_.cjs} +3 -3
  20. package/output/{SearchDialog-CM9DrE2Y.cjs.map → SearchDialog-j_4Y9WY_.cjs.map} +1 -1
  21. package/output/client.cjs +3 -3
  22. package/output/client.js +3 -3
  23. package/output/core/i18n.d.ts +1 -1
  24. package/output/{i18n-BxXpRSFX.js → i18n-DjRcGSuU.js} +15 -1
  25. package/output/i18n-DjRcGSuU.js.map +1 -0
  26. package/output/{i18n-DsjZ51U1.cjs → i18n-L1XX-y6M.cjs} +15 -1
  27. package/output/i18n-L1XX-y6M.cjs.map +1 -0
  28. package/output/index.cjs +5 -5
  29. package/output/index.js +5 -5
  30. package/output/openapi/components/EndpointSections.d.ts +2 -0
  31. package/output/openapi/components/OpenApiAuthDocumentation.d.ts +7 -0
  32. package/output/openapi/components/helpers.d.ts +1 -0
  33. package/output/openapi/types.d.ts +1 -0
  34. package/output/preview.cjs +3 -3
  35. package/output/preview.js +3 -3
  36. package/output/{render-vlp3hwW3.js → render-CYQmEacg.js} +2 -2
  37. package/output/{render-vlp3hwW3.js.map → render-CYQmEacg.js.map} +1 -1
  38. package/output/{render-CKG4X-me.cjs → render-hq20DPxe.cjs} +2 -2
  39. package/output/{render-CKG4X-me.cjs.map → render-hq20DPxe.cjs.map} +1 -1
  40. package/output/renderer.css +16 -0
  41. package/output/server.cjs +2 -2
  42. package/output/server.js +2 -2
  43. package/package.json +1 -1
  44. package/output/OpenApiOperation-CFo6_otd.js.map +0 -1
  45. package/output/OpenApiOperation-D1WNrj5X.cjs.map +0 -1
  46. package/output/i18n-BxXpRSFX.js.map +0 -1
  47. package/output/i18n-DsjZ51U1.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-DsjZ51U1.cjs");
3
- const require_PageActions = require("./PageActions-Lp_NeIKr.cjs");
2
+ const require_i18n = require("./i18n-L1XX-y6M.cjs");
3
+ const require_PageActions = require("./PageActions-Bw9SAHLl.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-CTvMCE19.cjs")));
248
+ var MermaidViewer = (0, react.lazy)(() => Promise.resolve().then(() => require("./MermaidViewer-EZjolX08.cjs")));
249
249
  var mermaidModulePromise;
250
250
  async function loadMermaid() {
251
251
  mermaidModulePromise = mermaidModulePromise ?? import("mermaid").then((module) => module.default);
@@ -2400,7 +2400,8 @@ function getAuthOptions(spec, operation) {
2400
2400
  return getSecurityRequirements(spec, operation).map((requirement, index) => {
2401
2401
  const requirementSchemes = Object.keys(requirement).map((name) => ({
2402
2402
  name,
2403
- scheme: schemes[name]
2403
+ scheme: schemes[name],
2404
+ scopes: requirement[name] ?? []
2404
2405
  })).filter((option) => Boolean(option.scheme));
2405
2406
  return {
2406
2407
  key: `requirement:${index}`,
@@ -2707,6 +2708,84 @@ function ResponseExamplesPanel(arg0) {
2707
2708
  });
2708
2709
  }
2709
2710
  //#endregion
2711
+ //#region source/openapi/components/OpenApiAuthDocumentation.tsx
2712
+ function authSchemeType(option, apiKeyLabel) {
2713
+ const { scheme } = option;
2714
+ if (scheme.type === "http") return scheme.scheme?.toUpperCase() || "HTTP";
2715
+ if (scheme.type === "apiKey") return apiKeyLabel;
2716
+ if (scheme.type === "oauth2") return "OAUTH 2.0";
2717
+ if (scheme.type === "openIdConnect") return "OPENID CONNECT";
2718
+ return scheme.type?.toUpperCase() || "AUTH";
2719
+ }
2720
+ function OpenApiAuthDocumentation({ options }) {
2721
+ const t = require_i18n.useBuiltInText();
2722
+ if (options.length === 0) return null;
2723
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h3", { children: t("openapi.authentication") }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
2724
+ className: "not-prose my-6 border-y border-(--clarify-theme-tokens-colors-border)",
2725
+ children: options.map((option, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [index > 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
2726
+ className: "flex items-center gap-3 py-1",
2727
+ "aria-label": t("openapi.authOr"),
2728
+ children: [
2729
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { className: "h-px flex-1 bg-(--clarify-theme-tokens-colors-border)" }),
2730
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
2731
+ className: "text-2xs font-semibold text-(--clarify-ui-text-faint)",
2732
+ children: t("openapi.authOr")
2733
+ }),
2734
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { className: "h-px flex-1 bg-(--clarify-theme-tokens-colors-border)" })
2735
+ ]
2736
+ }) : null, option.schemes.length === 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
2737
+ className: "py-4 text-sm/6 font-medium text-(--clarify-theme-tokens-colors-foreground)",
2738
+ children: t("openapi.authNoAuth")
2739
+ }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
2740
+ className: "divide-y divide-(--clarify-theme-tokens-colors-border)",
2741
+ children: option.schemes.map((schemeOption, schemeIndex) => {
2742
+ const { scheme } = schemeOption;
2743
+ const details = [
2744
+ scheme.type === "apiKey" && scheme.in && scheme.name ? t("openapi.authLocation", {
2745
+ in: scheme.in,
2746
+ name: scheme.name
2747
+ }) : void 0,
2748
+ scheme.type === "http" && scheme.bearerFormat ? t("openapi.authBearerFormat", { format: scheme.bearerFormat }) : void 0,
2749
+ scheme.type === "openIdConnect" ? scheme.openIdConnectUrl : void 0,
2750
+ schemeOption.scopes.length > 0 ? t("openapi.authScopes", { scopes: schemeOption.scopes.join(", ") }) : void 0
2751
+ ].filter((value) => Boolean(value));
2752
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [schemeIndex > 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
2753
+ className: "relative h-0",
2754
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
2755
+ 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)",
2756
+ children: t("openapi.authAnd")
2757
+ })
2758
+ }) : null, /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
2759
+ className: "py-4",
2760
+ children: [
2761
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
2762
+ className: "flex flex-wrap items-center gap-2",
2763
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
2764
+ className: "font-mono text-sm/6 font-semibold text-(--clarify-theme-tokens-colors-foreground)",
2765
+ children: schemeOption.name
2766
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
2767
+ className: "rounded bg-(--clarify-ui-subtle-background) px-1.5 py-0.5 text-2xs font-semibold text-(--clarify-ui-text-soft)",
2768
+ children: authSchemeType(schemeOption, t("openapi.authApiKey"))
2769
+ })]
2770
+ }),
2771
+ scheme.description ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Markdown, {
2772
+ className: "mt-2 text-sm/6 text-(--clarify-ui-text-soft) *:first:mt-0 *:last:mb-0",
2773
+ children: scheme.description
2774
+ }) : null,
2775
+ details.length > 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
2776
+ className: "mt-2 flex min-w-0 flex-wrap gap-x-4 gap-y-1 text-xs/5 text-(--clarify-ui-text-faint)",
2777
+ children: details.map((detail) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
2778
+ className: "min-w-0 break-all font-mono",
2779
+ children: detail
2780
+ }, detail))
2781
+ }) : null
2782
+ ]
2783
+ })] }, schemeOption.name);
2784
+ })
2785
+ })] }, option.key))
2786
+ })] });
2787
+ }
2788
+ //#endregion
2710
2789
  //#region source/openapi/components/SchemaProperties.tsx
2711
2790
  function getEnumDescriptions(schema) {
2712
2791
  const descriptions = schema["x-enumDescriptions"];
@@ -3096,7 +3175,7 @@ function ResponseList(arg0) {
3096
3175
  //#endregion
3097
3176
  //#region source/openapi/components/EndpointSections.tsx
3098
3177
  function EndpointRequest(arg0) {
3099
- const { spec, path, method, operationSource = "path", description, groupedParameters, parameters, requestBody, requestContents, requestSchema, selectedRequestMediaType, onSelectRequestMediaType, selectedServer, serverVariables, auth, sharedExampleKey, onSelectExampleKey } = arg0;
3178
+ const { spec, path, method, operationSource = "path", description, groupedParameters, parameters, requestBody, requestContents, requestSchema, selectedRequestMediaType, onSelectRequestMediaType, selectedServer, serverVariables, authOptions, auth, sharedExampleKey, onSelectExampleKey } = arg0;
3100
3179
  const t = require_i18n.useBuiltInText();
3101
3180
  const hasRequestBody = Boolean(requestBody && requestContents.length > 0);
3102
3181
  const renderDescription = () => {
@@ -3119,6 +3198,7 @@ function EndpointRequest(arg0) {
3119
3198
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Col, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
3120
3199
  className: "w-full",
3121
3200
  children: [
3201
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(OpenApiAuthDocumentation, { options: authOptions }),
3122
3202
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ParameterList, {
3123
3203
  title: t("openapi.pathParameters"),
3124
3204
  parameters: groupedParameters.path
@@ -5249,6 +5329,7 @@ function OpenApiOperation(arg0) {
5249
5329
  onSelectRequestMediaType: requestState.setSelectedRequestMediaType,
5250
5330
  selectedServer: serverState.selectedServer,
5251
5331
  serverVariables: serverState.serverVariables,
5332
+ authOptions: authState.authOptions,
5252
5333
  auth: authState.authInput,
5253
5334
  sharedExampleKey: linkedExampleKey,
5254
5335
  onSelectExampleKey: setLinkedExampleKey
@@ -5489,4 +5570,4 @@ Object.defineProperty(exports, "primitives_exports", {
5489
5570
  }
5490
5571
  });
5491
5572
 
5492
- //# sourceMappingURL=OpenApiOperation-D1WNrj5X.cjs.map
5573
+ //# sourceMappingURL=OpenApiOperation-bdALspAY.cjs.map