@clarify-labs/renderer 0.11.8 → 0.11.10

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 (54) hide show
  1. package/output/{ClarifyShell-CGoRrkn1.js → ClarifyShell-DGm_R5Bp.js} +33 -13
  2. package/output/ClarifyShell-DGm_R5Bp.js.map +1 -0
  3. package/output/{ClarifyShell-D8OGIUWq.cjs → ClarifyShell-DLOGS18o.cjs} +33 -13
  4. package/output/ClarifyShell-DLOGS18o.cjs.map +1 -0
  5. package/output/{MermaidViewer-CFqy0BnO.cjs → MermaidViewer-BRR8SGnK.cjs} +2 -2
  6. package/output/{MermaidViewer-CFqy0BnO.cjs.map → MermaidViewer-BRR8SGnK.cjs.map} +1 -1
  7. package/output/{MermaidViewer-TdU3sRfy.js → MermaidViewer-CSbKX396.js} +2 -2
  8. package/output/{MermaidViewer-TdU3sRfy.js.map → MermaidViewer-CSbKX396.js.map} +1 -1
  9. package/output/{OpenApiOperation-Bd68uxXq.cjs → OpenApiOperation-416zAKci.cjs} +148 -16
  10. package/output/OpenApiOperation-416zAKci.cjs.map +1 -0
  11. package/output/{OpenApiOperation-vCuIKI4O.js → OpenApiOperation-bY3wbaJC.js} +138 -18
  12. package/output/OpenApiOperation-bY3wbaJC.js.map +1 -0
  13. package/output/{PageActions-DPYXFL6N.cjs → PageActions-CVOTIuxh.cjs} +205 -86
  14. package/output/PageActions-CVOTIuxh.cjs.map +1 -0
  15. package/output/{PageActions-CqXr0SyW.js → PageActions-D52u18C8.js} +201 -88
  16. package/output/PageActions-D52u18C8.js.map +1 -0
  17. package/output/{SearchDialog-CExM6Bxd.cjs → SearchDialog--OLp05za.cjs} +3 -3
  18. package/output/{SearchDialog-CExM6Bxd.cjs.map → SearchDialog--OLp05za.cjs.map} +1 -1
  19. package/output/{SearchDialog-BQcbGNvl.js → SearchDialog-Cq7w-uc7.js} +3 -3
  20. package/output/{SearchDialog-BQcbGNvl.js.map → SearchDialog-Cq7w-uc7.js.map} +1 -1
  21. package/output/app/AppShell.d.ts +2 -1
  22. package/output/app/PageActions.d.ts +6 -0
  23. package/output/app/PageUpdatedAt.d.ts +6 -0
  24. package/output/client.cjs +3 -3
  25. package/output/client.js +3 -3
  26. package/output/core/types.d.ts +21 -5
  27. package/output/{i18n-Dw4Jlho-.cjs → i18n-BMNCgF9o.cjs} +4 -2
  28. package/output/i18n-BMNCgF9o.cjs.map +1 -0
  29. package/output/{i18n-D4O3z-sP.js → i18n-Zmmhz7FF.js} +4 -2
  30. package/output/i18n-Zmmhz7FF.js.map +1 -0
  31. package/output/index.cjs +7 -5
  32. package/output/index.d.ts +2 -1
  33. package/output/index.js +6 -6
  34. package/output/mdx/components.d.ts +9 -0
  35. package/output/mdx/primitives.d.ts +11 -0
  36. package/output/openapi/lib/api-exchange.d.ts +2 -0
  37. package/output/preview.cjs +3 -3
  38. package/output/preview.js +3 -3
  39. package/output/{render-DQRifjrn.js → render-D_QvIv7Z.js} +2 -2
  40. package/output/{render-DQRifjrn.js.map → render-D_QvIv7Z.js.map} +1 -1
  41. package/output/{render-CqBz1q82.cjs → render-TErh9x_2.cjs} +2 -2
  42. package/output/{render-CqBz1q82.cjs.map → render-TErh9x_2.cjs.map} +1 -1
  43. package/output/renderer.css +86 -0
  44. package/output/server.cjs +2 -2
  45. package/output/server.js +2 -2
  46. package/package.json +1 -1
  47. package/output/ClarifyShell-CGoRrkn1.js.map +0 -1
  48. package/output/ClarifyShell-D8OGIUWq.cjs.map +0 -1
  49. package/output/OpenApiOperation-Bd68uxXq.cjs.map +0 -1
  50. package/output/OpenApiOperation-vCuIKI4O.js.map +0 -1
  51. package/output/PageActions-CqXr0SyW.js.map +0 -1
  52. package/output/PageActions-DPYXFL6N.cjs.map +0 -1
  53. package/output/i18n-D4O3z-sP.js.map +0 -1
  54. package/output/i18n-Dw4Jlho-.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-Dw4Jlho-.cjs");
3
- const require_PageActions = require("./PageActions-DPYXFL6N.cjs");
2
+ const require_i18n = require("./i18n-BMNCgF9o.cjs");
3
+ const require_PageActions = require("./PageActions-CVOTIuxh.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-CFqy0BnO.cjs")));
248
+ var MermaidViewer = (0, react.lazy)(() => Promise.resolve().then(() => require("./MermaidViewer-BRR8SGnK.cjs")));
249
249
  var mermaidModulePromise;
250
250
  async function loadMermaid() {
251
251
  mermaidModulePromise = mermaidModulePromise ?? import("mermaid").then((module) => module.default);
@@ -1243,6 +1243,8 @@ var primitives_exports = /* @__PURE__ */ require_rolldown_runtime.__exportAll({
1243
1243
  Note: () => Note,
1244
1244
  Properties: () => Properties,
1245
1245
  Property: () => Property,
1246
+ Release: () => Release,
1247
+ ReleaseItem: () => ReleaseItem,
1246
1248
  Row: () => Row,
1247
1249
  Step: () => Step,
1248
1250
  Steps: () => Steps,
@@ -1260,6 +1262,43 @@ var primitives_exports = /* @__PURE__ */ require_rolldown_runtime.__exportAll({
1260
1262
  table: () => table,
1261
1263
  wrapper: () => wrapper
1262
1264
  });
1265
+ function Release(arg0) {
1266
+ const { version, date, children } = arg0;
1267
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
1268
+ id: version,
1269
+ className: "clarify-release my-14 grid gap-7 border-t border-(--clarify-theme-tokens-colors-border) pt-8 sm:grid-cols-[8.5rem_minmax(0,1fr)] sm:gap-12",
1270
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("header", {
1271
+ className: "self-start sm:sticky sm:top-24",
1272
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h2", {
1273
+ className: "m-0! inline-flex rounded-(--clarify-theme-tokens-radius-md) bg-(--clarify-ui-accent-background) px-2.5 py-1 text-sm font-semibold text-(--clarify-ui-accent-text)",
1274
+ children: version
1275
+ }), date ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("time", {
1276
+ dateTime: date,
1277
+ className: "mt-3 flex items-center gap-1.5 text-xs text-(--clarify-ui-text-faint)",
1278
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.CalendarDays, {
1279
+ className: "size-3.5",
1280
+ "aria-hidden": "true"
1281
+ }), date]
1282
+ }) : null]
1283
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1284
+ className: "min-w-0 space-y-10",
1285
+ children
1286
+ })]
1287
+ });
1288
+ }
1289
+ function ReleaseItem(arg0) {
1290
+ const { title, children } = arg0;
1291
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
1292
+ className: "clarify-release-item min-w-0",
1293
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h3", {
1294
+ className: "m-0! text-lg font-semibold text-(--clarify-ui-text)",
1295
+ children: title
1296
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1297
+ className: "mt-3 min-w-0 text-sm/6 text-(--clarify-ui-text-soft) *:first:mt-0 *:last:mb-0",
1298
+ children
1299
+ })]
1300
+ });
1301
+ }
1263
1302
  function wrapper(arg0) {
1264
1303
  const { children } = arg0;
1265
1304
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("article", {
@@ -3056,22 +3095,22 @@ function getRootSchemaNode(spec, schema, defaultExpanded) {
3056
3095
  })
3057
3096
  };
3058
3097
  }
3059
- function EnumValueNode(arg0) {
3098
+ function EnumValueWithDescription(arg0) {
3060
3099
  const { node } = arg0;
3061
3100
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", {
3062
3101
  className: (0, clsx.default)("clarify-schema-node m-0 p-0", node.visible === false && "hidden"),
3063
3102
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
3064
- className: "flex min-w-0 items-start rounded-(--clarify-theme-tokens-radius-md) px-2 py-2 text-left",
3103
+ className: "flex min-w-0 items-start gap-3 rounded-(--clarify-theme-tokens-radius-md) px-2 py-2 text-left",
3065
3104
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
3066
3105
  className: "min-w-0 flex-1",
3067
3106
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
3068
3107
  className: "flex min-w-0 flex-wrap items-center gap-x-2 gap-y-0.5",
3069
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
3070
- className: "text-sm/5 font-semibold text-(--clarify-theme-tokens-colors-foreground)",
3108
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("code", {
3109
+ className: "break-all font-mono text-xs/5 font-semibold text-(--clarify-theme-tokens-colors-foreground)",
3071
3110
  children: node.name
3072
3111
  })
3073
- }), node.description || node.details ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
3074
- className: "mt-0.5 text-sm/5 text-(--clarify-ui-text-soft) *:first:mt-0 *:last:mb-0",
3112
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
3113
+ className: "mt-1 text-sm/5 text-(--clarify-ui-text-soft) *:first:mt-0 *:last:mb-0",
3075
3114
  children: [node.description ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Markdown, {
3076
3115
  className: "*:first:mt-0 *:last:mb-0",
3077
3116
  children: node.description
@@ -3079,11 +3118,28 @@ function EnumValueNode(arg0) {
3079
3118
  className: "text-xs text-(--clarify-ui-text-faint)",
3080
3119
  children: node.details
3081
3120
  }) : null]
3082
- }) : null]
3121
+ })]
3083
3122
  })
3084
3123
  })
3085
3124
  });
3086
3125
  }
3126
+ function CompactEnumValue(arg0) {
3127
+ const { node } = arg0;
3128
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", {
3129
+ className: (0, clsx.default)("clarify-schema-node inline-flex m-0 p-0", node.visible === false && "hidden"),
3130
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
3131
+ className: "flex min-w-0 items-start rounded-(--clarify-theme-tokens-radius-md) border border-(--clarify-theme-tokens-colors-border) bg-(--clarify-ui-subtle-background) px-2 py-1 text-left",
3132
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("code", {
3133
+ className: "break-all font-mono text-xs/5 text-(--clarify-theme-tokens-colors-foreground)",
3134
+ children: node.name
3135
+ })
3136
+ })
3137
+ });
3138
+ }
3139
+ function EnumValueNode(arg0) {
3140
+ const { node } = arg0;
3141
+ return node.description || node.details ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(EnumValueWithDescription, { node }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CompactEnumValue, { node });
3142
+ }
3087
3143
  function SchemaNode(arg0) {
3088
3144
  const { node, depth = 0, defaultExpanded, forceExpanded = false } = arg0;
3089
3145
  const t = require_i18n.useBuiltInText();
@@ -3150,7 +3206,7 @@ function SchemaTree(arg0) {
3150
3206
  if (nodes.length === 0) return null;
3151
3207
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", {
3152
3208
  role: "list",
3153
- className: (0, clsx.default)("m-0 list-none p-0", depth === 0 ? "divide-y divide-(--clarify-theme-tokens-colors-border)" : "ml-2 border-l border-(--clarify-theme-tokens-colors-border) pl-2"),
3209
+ className: (0, clsx.default)("m-0 list-none p-0", nodes.every((node) => node.kind === "enum") && nodes.every((node) => !node.description && !node.details) ? "flex flex-wrap gap-1.5 py-1" : depth === 0 ? "divide-y divide-(--clarify-theme-tokens-colors-border)" : "ml-2 border-l border-(--clarify-theme-tokens-colors-border) pl-2"),
3154
3210
  children: nodes.map((node) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SchemaNode, {
3155
3211
  node,
3156
3212
  depth,
@@ -4249,6 +4305,7 @@ var textLanguages = {
4249
4305
  "application/xhtml+xml": "html",
4250
4306
  "application/x-www-form-urlencoded": "http",
4251
4307
  "text/css": "css",
4308
+ "text/event-stream": "text",
4252
4309
  "text/csv": "csv",
4253
4310
  "text/html": "html",
4254
4311
  "text/javascript": "javascript",
@@ -4542,6 +4599,10 @@ function OpenApiResponseViewer(arg0) {
4542
4599
  className: "text-xs text-(--clarify-code-faint)",
4543
4600
  children: formatBytes(exchange.size)
4544
4601
  }),
4602
+ exchange.streaming ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
4603
+ className: "text-xs font-semibold text-(--clarify-code-success)",
4604
+ children: t("openapi.streaming")
4605
+ }) : null,
4545
4606
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { className: (0, clsx.default)("size-2 rounded-full", exchange.status < 400 ? "bg-(--clarify-code-success)" : "bg-(--clarify-code-danger)") }),
4546
4607
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
4547
4608
  className: (0, clsx.default)("text-xs font-semibold", exchange.status < 400 ? "text-(--clarify-code-success)" : "text-(--clarify-code-danger)"),
@@ -4669,9 +4730,13 @@ function requestSnapshot(request) {
4669
4730
  body: requestBodySnapshot(request.init.body)
4670
4731
  };
4671
4732
  }
4733
+ function isEventStream(contentType) {
4734
+ return contentType.split(";", 1)[0].trim().toLowerCase() === "text/event-stream";
4735
+ }
4672
4736
  async function executeApiRequest(request, options = {}) {
4673
4737
  const fetchRequest = options.fetch ?? fetch;
4674
4738
  const now = options.now ?? (() => performance.now());
4739
+ const onProgress = options.onProgress;
4675
4740
  const startedAt = now();
4676
4741
  let response;
4677
4742
  try {
@@ -4683,17 +4748,69 @@ async function executeApiRequest(request, options = {}) {
4683
4748
  if (cause instanceof DOMException && cause.name === "AbortError") throw cause;
4684
4749
  throw new ApiRequestError(cause instanceof Error ? cause.message : String(cause), { cause });
4685
4750
  }
4751
+ const contentType = response.headers.get("content-type") ?? "";
4752
+ const headers = Array.from(response.headers.entries());
4753
+ const requestSnapshotValue = requestSnapshot(request);
4754
+ if (isEventStream(contentType) && response.body) {
4755
+ const reader = response.body.getReader();
4756
+ const decoder = new TextDecoder();
4757
+ let body = "";
4758
+ let totalSize = 0;
4759
+ const emit = (streaming) => {
4760
+ const blob = new Blob([body], { type: contentType });
4761
+ onProgress?.({
4762
+ request: requestSnapshotValue,
4763
+ status: response.status,
4764
+ statusText: response.statusText,
4765
+ url: response.url || request.url,
4766
+ redirected: response.redirected,
4767
+ duration: Math.round(now() - startedAt),
4768
+ size: totalSize,
4769
+ headers,
4770
+ contentType,
4771
+ body,
4772
+ blob,
4773
+ streaming
4774
+ });
4775
+ };
4776
+ emit(true);
4777
+ while (true) {
4778
+ const result = await reader.read();
4779
+ if (result.done) break;
4780
+ totalSize += result.value.byteLength;
4781
+ body += decoder.decode(result.value, { stream: true });
4782
+ emit(true);
4783
+ }
4784
+ body += decoder.decode();
4785
+ const blob = new Blob([body], { type: contentType });
4786
+ const exchange = {
4787
+ request: requestSnapshotValue,
4788
+ status: response.status,
4789
+ statusText: response.statusText,
4790
+ url: response.url || request.url,
4791
+ redirected: response.redirected,
4792
+ duration: Math.round(now() - startedAt),
4793
+ size: totalSize,
4794
+ headers,
4795
+ contentType,
4796
+ body,
4797
+ blob,
4798
+ streaming: false
4799
+ };
4800
+ onProgress?.(exchange);
4801
+ return exchange;
4802
+ }
4686
4803
  const blob = await response.blob();
4687
4804
  return {
4688
- request: requestSnapshot(request),
4805
+ request: requestSnapshotValue,
4689
4806
  status: response.status,
4690
4807
  statusText: response.statusText,
4691
4808
  url: response.url || request.url,
4692
4809
  redirected: response.redirected,
4693
4810
  duration: Math.round(now() - startedAt),
4694
4811
  size: blob.size,
4695
- headers: Array.from(response.headers.entries()),
4696
- contentType: response.headers.get("content-type") ?? blob.type,
4812
+ headers,
4813
+ contentType: contentType || blob.type,
4697
4814
  body: await blob.text(),
4698
4815
  blob
4699
4816
  };
@@ -4894,7 +5011,10 @@ function useOpenApiRequestExecution() {
4894
5011
  setError("");
4895
5012
  setExchange(void 0);
4896
5013
  try {
4897
- setExchange(await executeApiRequest(request, { signal: controller.signal }));
5014
+ setExchange(await executeApiRequest(request, {
5015
+ signal: controller.signal,
5016
+ onProgress: (progress) => setExchange(progress)
5017
+ }));
4898
5018
  } catch (cause) {
4899
5019
  if (cause instanceof DOMException && cause.name === "AbortError") return;
4900
5020
  const message = cause instanceof Error ? cause.message : String(cause);
@@ -5690,6 +5810,18 @@ Object.defineProperty(exports, "Prose", {
5690
5810
  return Prose;
5691
5811
  }
5692
5812
  });
5813
+ Object.defineProperty(exports, "Release", {
5814
+ enumerable: true,
5815
+ get: function() {
5816
+ return Release;
5817
+ }
5818
+ });
5819
+ Object.defineProperty(exports, "ReleaseItem", {
5820
+ enumerable: true,
5821
+ get: function() {
5822
+ return ReleaseItem;
5823
+ }
5824
+ });
5693
5825
  Object.defineProperty(exports, "RequestExamplesPanel", {
5694
5826
  enumerable: true,
5695
5827
  get: function() {
@@ -5805,4 +5937,4 @@ Object.defineProperty(exports, "primitives_exports", {
5805
5937
  }
5806
5938
  });
5807
5939
 
5808
- //# sourceMappingURL=OpenApiOperation-Bd68uxXq.cjs.map
5940
+ //# sourceMappingURL=OpenApiOperation-416zAKci.cjs.map