@clarify-labs/renderer 0.11.8 → 0.11.9
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-D8OGIUWq.cjs → ClarifyShell-GCXbb_AF.cjs} +3 -3
- package/output/{ClarifyShell-D8OGIUWq.cjs.map → ClarifyShell-GCXbb_AF.cjs.map} +1 -1
- package/output/{ClarifyShell-CGoRrkn1.js → ClarifyShell-nV23Fn7m.js} +3 -3
- package/output/{ClarifyShell-CGoRrkn1.js.map → ClarifyShell-nV23Fn7m.js.map} +1 -1
- package/output/{MermaidViewer-CFqy0BnO.cjs → MermaidViewer-DEKNDG7K.cjs} +2 -2
- package/output/{MermaidViewer-CFqy0BnO.cjs.map → MermaidViewer-DEKNDG7K.cjs.map} +1 -1
- package/output/{MermaidViewer-TdU3sRfy.js → MermaidViewer-Ssxr00dy.js} +2 -2
- package/output/{MermaidViewer-TdU3sRfy.js.map → MermaidViewer-Ssxr00dy.js.map} +1 -1
- package/output/{OpenApiOperation-vCuIKI4O.js → OpenApiOperation-B26v2y44.js} +72 -8
- package/output/{OpenApiOperation-vCuIKI4O.js.map → OpenApiOperation-B26v2y44.js.map} +1 -1
- package/output/{OpenApiOperation-Bd68uxXq.cjs → OpenApiOperation-DIgbzvk5.cjs} +72 -8
- package/output/{OpenApiOperation-Bd68uxXq.cjs.map → OpenApiOperation-DIgbzvk5.cjs.map} +1 -1
- package/output/{PageActions-CqXr0SyW.js → PageActions-BbmyFeSk.js} +10 -9
- package/output/{PageActions-CqXr0SyW.js.map → PageActions-BbmyFeSk.js.map} +1 -1
- package/output/{PageActions-DPYXFL6N.cjs → PageActions-DxGK-444.cjs} +10 -9
- package/output/{PageActions-DPYXFL6N.cjs.map → PageActions-DxGK-444.cjs.map} +1 -1
- package/output/{SearchDialog-BQcbGNvl.js → SearchDialog-4oEbmVMR.js} +3 -3
- package/output/{SearchDialog-BQcbGNvl.js.map → SearchDialog-4oEbmVMR.js.map} +1 -1
- package/output/{SearchDialog-CExM6Bxd.cjs → SearchDialog-DexOW8E4.cjs} +3 -3
- package/output/{SearchDialog-CExM6Bxd.cjs.map → SearchDialog-DexOW8E4.cjs.map} +1 -1
- package/output/client.cjs +3 -3
- package/output/client.js +3 -3
- package/output/{i18n-Dw4Jlho-.cjs → i18n-BuvwT5W9.cjs} +3 -1
- package/output/i18n-BuvwT5W9.cjs.map +1 -0
- package/output/{i18n-D4O3z-sP.js → i18n-C6tIP-nl.js} +3 -1
- package/output/i18n-C6tIP-nl.js.map +1 -0
- package/output/index.cjs +5 -5
- package/output/index.js +5 -5
- package/output/openapi/lib/api-exchange.d.ts +2 -0
- package/output/preview.cjs +3 -3
- package/output/preview.js +3 -3
- package/output/{render-DQRifjrn.js → render-CAtVGsQF.js} +2 -2
- package/output/{render-DQRifjrn.js.map → render-CAtVGsQF.js.map} +1 -1
- package/output/{render-CqBz1q82.cjs → render-D8h-jcnw.cjs} +2 -2
- package/output/{render-CqBz1q82.cjs.map → render-D8h-jcnw.cjs.map} +1 -1
- package/output/server.cjs +2 -2
- package/output/server.js +2 -2
- package/package.json +1 -1
- package/output/i18n-D4O3z-sP.js.map +0 -1
- package/output/i18n-Dw4Jlho-.cjs.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_rolldown_runtime = require("./rolldown-runtime-DakpK96I.cjs");
|
|
2
|
-
const require_i18n = require("./i18n-
|
|
2
|
+
const require_i18n = require("./i18n-BuvwT5W9.cjs");
|
|
3
3
|
let clsx = require("clsx");
|
|
4
4
|
clsx = require_rolldown_runtime.__toESM(clsx, 1);
|
|
5
5
|
let react = require("react");
|
|
@@ -97,4 +97,4 @@ function MermaidViewer(arg0) {
|
|
|
97
97
|
exports.MermaidViewer = MermaidViewer;
|
|
98
98
|
exports.default = MermaidViewer;
|
|
99
99
|
|
|
100
|
-
//# sourceMappingURL=MermaidViewer-
|
|
100
|
+
//# sourceMappingURL=MermaidViewer-DEKNDG7K.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MermaidViewer-
|
|
1
|
+
{"version":3,"file":"MermaidViewer-DEKNDG7K.cjs","names":[],"sources":["../source/components/MermaidViewer.tsx"],"sourcesContent":["import clsx from 'clsx'\nimport { Maximize2, ZoomIn, ZoomOut } from 'lucide-react'\nimport { useRef, useState, type ReactNode } from 'react'\nimport { TransformComponent, TransformWrapper, useControls } from 'react-zoom-pan-pinch'\n\nimport { useBuiltInText } from '../core/i18n'\n\ntype MermaidViewerProps = {\n svg: string\n className?: string\n}\n\nfunction ZoomControls(): ReactNode {\n const { zoomIn, zoomOut, resetTransform } = useControls()\n const t = useBuiltInText()\n\n const buttonClassName = 'flex h-7 w-7 items-center justify-center rounded-md bg-(--clarify-theme-tokens-colors-surface) text-(--clarify-ui-text-soft) shadow-xs ring-1 ring-(--clarify-theme-tokens-colors-border) transition hover:bg-(--clarify-ui-hover-background) hover:text-(--clarify-theme-tokens-colors-foreground)'\n\n return (\n <div className=\"clarify-mermaid-controls absolute top-2 right-2 z-10 flex gap-1 opacity-0 transition group-hover:opacity-100 focus-within:opacity-100\">\n <button type=\"button\" aria-label={t('mermaid.zoomIn')} title={t('mermaid.zoomIn')} onClick={() => zoomIn()} className={buttonClassName}>\n <ZoomIn className=\"h-4 w-4\" aria-hidden=\"true\" />\n </button>\n <button type=\"button\" aria-label={t('mermaid.zoomOut')} title={t('mermaid.zoomOut')} onClick={() => zoomOut()} className={buttonClassName}>\n <ZoomOut className=\"h-4 w-4\" aria-hidden=\"true\" />\n </button>\n <button type=\"button\" aria-label={t('mermaid.resetZoom')} title={t('mermaid.resetZoom')} onClick={() => resetTransform()} className={buttonClassName}>\n <Maximize2 className=\"h-4 w-4\" aria-hidden=\"true\" />\n </button>\n </div>\n )\n}\n\nexport function MermaidViewer(arg0: MermaidViewerProps): ReactNode {\n const { svg, className } = arg0\n\n const t = useBuiltInText()\n const containerRef = useRef<HTMLDivElement>(null)\n const [focused, setFocused] = useState(false)\n\n return (\n <div\n ref={containerRef}\n tabIndex={0}\n role=\"group\"\n onPointerDown={() => containerRef.current?.focus()}\n onFocus={() => setFocused(true)}\n onBlur={() => setFocused(false)}\n className={clsx('clarify-mermaid group not-prose relative my-6 resize-y overflow-hidden rounded-2xl border border-(--clarify-theme-tokens-colors-border) bg-(--clarify-theme-tokens-colors-surface) outline-none focus-visible:ring-2 focus-visible:ring-(--clarify-theme-tokens-colors-primary)', className)}\n >\n <TransformWrapper\n minScale={0.5}\n maxScale={8}\n initialScale={1}\n centerOnInit\n smooth\n wheel={{ step: 0.01, wheelDisabled: !focused, touchPadDisabled: !focused }}\n doubleClick={{ mode: 'reset' }}\n >\n <ZoomControls />\n <TransformComponent\n wrapperClass=\"!h-full !w-full !cursor-grab active:!cursor-grabbing\"\n contentClass=\"!h-full !w-full justify-center [&_svg]:h-auto [&_svg]:max-w-full\"\n >\n <div className=\"flex h-full w-full items-center justify-center p-4\" dangerouslySetInnerHTML={{ __html: svg }} />\n </TransformComponent>\n <p\n className={clsx(\n 'clarify-mermaid-hint pointer-events-none absolute bottom-2 left-1/2 z-10 -translate-x-1/2 rounded-full bg-(--clarify-theme-tokens-colors-surface)/90 px-2.5 py-1 text-2xs text-(--clarify-ui-text-soft) shadow-xs ring-1 ring-(--clarify-theme-tokens-colors-border) backdrop-blur-sm transition',\n focused ? 'opacity-0' : 'opacity-0 group-hover:opacity-100',\n )}\n >\n {t('mermaid.scrollHint')}\n </p>\n </TransformWrapper>\n </div>\n )\n}\n\nexport default MermaidViewer\n"],"mappings":";;;;;;;;;AAYA,SAAS,eAA0B;CACjC,MAAM,EAAE,QAAQ,SAAS,oBAAA,GAAA,qBAAA,YAAA,CAA+B;CACxD,MAAM,IAAI,aAAA,eAAe;CAEzB,MAAM,kBAAkB;CAExB,OACE,iBAAA,GAAA,kBAAA,KAAA,CAAC,OAAD;EAAK,WAAU;YAAf;GACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,UAAD;IAAQ,MAAK;IAAS,cAAY,EAAE,gBAAgB;IAAG,OAAO,EAAE,gBAAgB;IAAG,eAAe,OAAO;IAAG,WAAW;cACrH,iBAAA,GAAA,kBAAA,IAAA,CAAC,aAAA,QAAD;KAAQ,WAAU;KAAU,eAAY;IAAQ,CAAA;GAC1C,CAAA;GACR,iBAAA,GAAA,kBAAA,IAAA,CAAC,UAAD;IAAQ,MAAK;IAAS,cAAY,EAAE,iBAAiB;IAAG,OAAO,EAAE,iBAAiB;IAAG,eAAe,QAAQ;IAAG,WAAW;cACxH,iBAAA,GAAA,kBAAA,IAAA,CAAC,aAAA,SAAD;KAAS,WAAU;KAAU,eAAY;IAAQ,CAAA;GAC3C,CAAA;GACR,iBAAA,GAAA,kBAAA,IAAA,CAAC,UAAD;IAAQ,MAAK;IAAS,cAAY,EAAE,mBAAmB;IAAG,OAAO,EAAE,mBAAmB;IAAG,eAAe,eAAe;IAAG,WAAW;cACnI,iBAAA,GAAA,kBAAA,IAAA,CAAC,aAAA,WAAD;KAAW,WAAU;KAAU,eAAY;IAAQ,CAAA;GAC7C,CAAA;EACL;;AAET;AAEA,SAAgB,cAAc,MAAqC;CACjE,MAAM,EAAE,KAAK,cAAc;CAE3B,MAAM,IAAI,aAAA,eAAe;CACzB,MAAM,gBAAA,GAAA,MAAA,OAAA,CAAsC,IAAI;CAChD,MAAM,CAAC,SAAS,eAAA,GAAA,MAAA,SAAA,CAAuB,KAAK;CAE5C,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;EACE,KAAK;EACL,UAAU;EACV,MAAK;EACL,qBAAqB,aAAa,SAAS,MAAM;EACjD,eAAe,WAAW,IAAI;EAC9B,cAAc,WAAW,KAAK;EAC9B,YAAA,GAAA,KAAA,QAAA,CAAgB,mRAAmR,SAAS;YAE5S,iBAAA,GAAA,kBAAA,KAAA,CAAC,qBAAA,kBAAD;GACE,UAAU;GACV,UAAU;GACV,cAAc;GACd,cAAA;GACA,QAAA;GACA,OAAO;IAAE,MAAM;IAAM,eAAe,CAAC;IAAS,kBAAkB,CAAC;GAAQ;GACzE,aAAa,EAAE,MAAM,QAAQ;aAP/B;IASE,iBAAA,GAAA,kBAAA,IAAA,CAAC,cAAD,CAAe,CAAA;IACf,iBAAA,GAAA,kBAAA,IAAA,CAAC,qBAAA,oBAAD;KACE,cAAa;KACb,cAAa;eAEb,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;MAAK,WAAU;MAAqD,yBAAyB,EAAE,QAAQ,IAAI;KAAI,CAAA;IAC7F,CAAA;IACpB,iBAAA,GAAA,kBAAA,IAAA,CAAC,KAAD;KACE,YAAA,GAAA,KAAA,QAAA,CACE,oSACA,UAAU,cAAc,mCAC1B;eAEC,EAAE,oBAAoB;IACtB,CAAA;GACa;;CACf,CAAA;AAET"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as useBuiltInText } from "./i18n-
|
|
1
|
+
import { t as useBuiltInText } from "./i18n-C6tIP-nl.js";
|
|
2
2
|
import clsx from "clsx";
|
|
3
3
|
import { useRef, useState } from "react";
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -94,4 +94,4 @@ function MermaidViewer(arg0) {
|
|
|
94
94
|
//#endregion
|
|
95
95
|
export { MermaidViewer, MermaidViewer as default };
|
|
96
96
|
|
|
97
|
-
//# sourceMappingURL=MermaidViewer-
|
|
97
|
+
//# sourceMappingURL=MermaidViewer-Ssxr00dy.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MermaidViewer-
|
|
1
|
+
{"version":3,"file":"MermaidViewer-Ssxr00dy.js","names":[],"sources":["../source/components/MermaidViewer.tsx"],"sourcesContent":["import clsx from 'clsx'\nimport { Maximize2, ZoomIn, ZoomOut } from 'lucide-react'\nimport { useRef, useState, type ReactNode } from 'react'\nimport { TransformComponent, TransformWrapper, useControls } from 'react-zoom-pan-pinch'\n\nimport { useBuiltInText } from '../core/i18n'\n\ntype MermaidViewerProps = {\n svg: string\n className?: string\n}\n\nfunction ZoomControls(): ReactNode {\n const { zoomIn, zoomOut, resetTransform } = useControls()\n const t = useBuiltInText()\n\n const buttonClassName = 'flex h-7 w-7 items-center justify-center rounded-md bg-(--clarify-theme-tokens-colors-surface) text-(--clarify-ui-text-soft) shadow-xs ring-1 ring-(--clarify-theme-tokens-colors-border) transition hover:bg-(--clarify-ui-hover-background) hover:text-(--clarify-theme-tokens-colors-foreground)'\n\n return (\n <div className=\"clarify-mermaid-controls absolute top-2 right-2 z-10 flex gap-1 opacity-0 transition group-hover:opacity-100 focus-within:opacity-100\">\n <button type=\"button\" aria-label={t('mermaid.zoomIn')} title={t('mermaid.zoomIn')} onClick={() => zoomIn()} className={buttonClassName}>\n <ZoomIn className=\"h-4 w-4\" aria-hidden=\"true\" />\n </button>\n <button type=\"button\" aria-label={t('mermaid.zoomOut')} title={t('mermaid.zoomOut')} onClick={() => zoomOut()} className={buttonClassName}>\n <ZoomOut className=\"h-4 w-4\" aria-hidden=\"true\" />\n </button>\n <button type=\"button\" aria-label={t('mermaid.resetZoom')} title={t('mermaid.resetZoom')} onClick={() => resetTransform()} className={buttonClassName}>\n <Maximize2 className=\"h-4 w-4\" aria-hidden=\"true\" />\n </button>\n </div>\n )\n}\n\nexport function MermaidViewer(arg0: MermaidViewerProps): ReactNode {\n const { svg, className } = arg0\n\n const t = useBuiltInText()\n const containerRef = useRef<HTMLDivElement>(null)\n const [focused, setFocused] = useState(false)\n\n return (\n <div\n ref={containerRef}\n tabIndex={0}\n role=\"group\"\n onPointerDown={() => containerRef.current?.focus()}\n onFocus={() => setFocused(true)}\n onBlur={() => setFocused(false)}\n className={clsx('clarify-mermaid group not-prose relative my-6 resize-y overflow-hidden rounded-2xl border border-(--clarify-theme-tokens-colors-border) bg-(--clarify-theme-tokens-colors-surface) outline-none focus-visible:ring-2 focus-visible:ring-(--clarify-theme-tokens-colors-primary)', className)}\n >\n <TransformWrapper\n minScale={0.5}\n maxScale={8}\n initialScale={1}\n centerOnInit\n smooth\n wheel={{ step: 0.01, wheelDisabled: !focused, touchPadDisabled: !focused }}\n doubleClick={{ mode: 'reset' }}\n >\n <ZoomControls />\n <TransformComponent\n wrapperClass=\"!h-full !w-full !cursor-grab active:!cursor-grabbing\"\n contentClass=\"!h-full !w-full justify-center [&_svg]:h-auto [&_svg]:max-w-full\"\n >\n <div className=\"flex h-full w-full items-center justify-center p-4\" dangerouslySetInnerHTML={{ __html: svg }} />\n </TransformComponent>\n <p\n className={clsx(\n 'clarify-mermaid-hint pointer-events-none absolute bottom-2 left-1/2 z-10 -translate-x-1/2 rounded-full bg-(--clarify-theme-tokens-colors-surface)/90 px-2.5 py-1 text-2xs text-(--clarify-ui-text-soft) shadow-xs ring-1 ring-(--clarify-theme-tokens-colors-border) backdrop-blur-sm transition',\n focused ? 'opacity-0' : 'opacity-0 group-hover:opacity-100',\n )}\n >\n {t('mermaid.scrollHint')}\n </p>\n </TransformWrapper>\n </div>\n )\n}\n\nexport default MermaidViewer\n"],"mappings":";;;;;;;AAYA,SAAS,eAA0B;CACjC,MAAM,EAAE,QAAQ,SAAS,mBAAmB,YAAY;CACxD,MAAM,IAAI,eAAe;CAEzB,MAAM,kBAAkB;CAExB,OACE,qBAAC,OAAD;EAAK,WAAU;YAAf;GACE,oBAAC,UAAD;IAAQ,MAAK;IAAS,cAAY,EAAE,gBAAgB;IAAG,OAAO,EAAE,gBAAgB;IAAG,eAAe,OAAO;IAAG,WAAW;cACrH,oBAAC,QAAD;KAAQ,WAAU;KAAU,eAAY;IAAQ,CAAA;GAC1C,CAAA;GACR,oBAAC,UAAD;IAAQ,MAAK;IAAS,cAAY,EAAE,iBAAiB;IAAG,OAAO,EAAE,iBAAiB;IAAG,eAAe,QAAQ;IAAG,WAAW;cACxH,oBAAC,SAAD;KAAS,WAAU;KAAU,eAAY;IAAQ,CAAA;GAC3C,CAAA;GACR,oBAAC,UAAD;IAAQ,MAAK;IAAS,cAAY,EAAE,mBAAmB;IAAG,OAAO,EAAE,mBAAmB;IAAG,eAAe,eAAe;IAAG,WAAW;cACnI,oBAAC,WAAD;KAAW,WAAU;KAAU,eAAY;IAAQ,CAAA;GAC7C,CAAA;EACL;;AAET;AAEA,SAAgB,cAAc,MAAqC;CACjE,MAAM,EAAE,KAAK,cAAc;CAE3B,MAAM,IAAI,eAAe;CACzB,MAAM,eAAe,OAAuB,IAAI;CAChD,MAAM,CAAC,SAAS,cAAc,SAAS,KAAK;CAE5C,OACE,oBAAC,OAAD;EACE,KAAK;EACL,UAAU;EACV,MAAK;EACL,qBAAqB,aAAa,SAAS,MAAM;EACjD,eAAe,WAAW,IAAI;EAC9B,cAAc,WAAW,KAAK;EAC9B,WAAW,KAAK,mRAAmR,SAAS;YAE5S,qBAAC,kBAAD;GACE,UAAU;GACV,UAAU;GACV,cAAc;GACd,cAAA;GACA,QAAA;GACA,OAAO;IAAE,MAAM;IAAM,eAAe,CAAC;IAAS,kBAAkB,CAAC;GAAQ;GACzE,aAAa,EAAE,MAAM,QAAQ;aAP/B;IASE,oBAAC,cAAD,CAAe,CAAA;IACf,oBAAC,oBAAD;KACE,cAAa;KACb,cAAa;eAEb,oBAAC,OAAD;MAAK,WAAU;MAAqD,yBAAyB,EAAE,QAAQ,IAAI;KAAI,CAAA;IAC7F,CAAA;IACpB,oBAAC,KAAD;KACE,WAAW,KACT,oSACA,UAAU,cAAc,mCAC1B;eAEC,EAAE,oBAAoB;IACtB,CAAA;GACa;;CACf,CAAA;AAET"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as useConfig, l as useLocale, o as useConfigOptional, t as useBuiltInText } from "./i18n-
|
|
2
|
-
import { C as isExternalHref, D as copyTextToClipboard, c as lucideIconRegistry, h as useTheme, l as resolveLucideIconName, o as useSectionStore, s as remToPx, t as PageActions, w as localizeHref } from "./PageActions-
|
|
1
|
+
import { a as useConfig, l as useLocale, o as useConfigOptional, t as useBuiltInText } from "./i18n-C6tIP-nl.js";
|
|
2
|
+
import { C as isExternalHref, D as copyTextToClipboard, c as lucideIconRegistry, h as useTheme, l as resolveLucideIconName, o as useSectionStore, s as remToPx, t as PageActions, w as localizeHref } from "./PageActions-BbmyFeSk.js";
|
|
3
3
|
import { t as markdownRemarkPlugins } from "./remark-C9iRQM0R.js";
|
|
4
4
|
import clsx from "clsx";
|
|
5
5
|
import { Children, Suspense, cloneElement, createContext, createElement, forwardRef, isValidElement, lazy, useContext, useEffect, useId, useLayoutEffect, useRef, useState } from "react";
|
|
@@ -253,7 +253,7 @@ function Card(arg0) {
|
|
|
253
253
|
}
|
|
254
254
|
//#endregion
|
|
255
255
|
//#region source/components/Mermaid.tsx
|
|
256
|
-
var MermaidViewer = lazy(() => import("./MermaidViewer-
|
|
256
|
+
var MermaidViewer = lazy(() => import("./MermaidViewer-Ssxr00dy.js"));
|
|
257
257
|
var mermaidModulePromise;
|
|
258
258
|
async function loadMermaid() {
|
|
259
259
|
mermaidModulePromise = mermaidModulePromise ?? import("mermaid").then((module) => module.default);
|
|
@@ -4257,6 +4257,7 @@ var textLanguages = {
|
|
|
4257
4257
|
"application/xhtml+xml": "html",
|
|
4258
4258
|
"application/x-www-form-urlencoded": "http",
|
|
4259
4259
|
"text/css": "css",
|
|
4260
|
+
"text/event-stream": "text",
|
|
4260
4261
|
"text/csv": "csv",
|
|
4261
4262
|
"text/html": "html",
|
|
4262
4263
|
"text/javascript": "javascript",
|
|
@@ -4550,6 +4551,10 @@ function OpenApiResponseViewer(arg0) {
|
|
|
4550
4551
|
className: "text-xs text-(--clarify-code-faint)",
|
|
4551
4552
|
children: formatBytes(exchange.size)
|
|
4552
4553
|
}),
|
|
4554
|
+
exchange.streaming ? /* @__PURE__ */ jsx("span", {
|
|
4555
|
+
className: "text-xs font-semibold text-(--clarify-code-success)",
|
|
4556
|
+
children: t("openapi.streaming")
|
|
4557
|
+
}) : null,
|
|
4553
4558
|
/* @__PURE__ */ jsx("span", { className: clsx("size-2 rounded-full", exchange.status < 400 ? "bg-(--clarify-code-success)" : "bg-(--clarify-code-danger)") }),
|
|
4554
4559
|
/* @__PURE__ */ jsxs("span", {
|
|
4555
4560
|
className: clsx("text-xs font-semibold", exchange.status < 400 ? "text-(--clarify-code-success)" : "text-(--clarify-code-danger)"),
|
|
@@ -4677,9 +4682,13 @@ function requestSnapshot(request) {
|
|
|
4677
4682
|
body: requestBodySnapshot(request.init.body)
|
|
4678
4683
|
};
|
|
4679
4684
|
}
|
|
4685
|
+
function isEventStream(contentType) {
|
|
4686
|
+
return contentType.split(";", 1)[0].trim().toLowerCase() === "text/event-stream";
|
|
4687
|
+
}
|
|
4680
4688
|
async function executeApiRequest(request, options = {}) {
|
|
4681
4689
|
const fetchRequest = options.fetch ?? fetch;
|
|
4682
4690
|
const now = options.now ?? (() => performance.now());
|
|
4691
|
+
const onProgress = options.onProgress;
|
|
4683
4692
|
const startedAt = now();
|
|
4684
4693
|
let response;
|
|
4685
4694
|
try {
|
|
@@ -4691,17 +4700,69 @@ async function executeApiRequest(request, options = {}) {
|
|
|
4691
4700
|
if (cause instanceof DOMException && cause.name === "AbortError") throw cause;
|
|
4692
4701
|
throw new ApiRequestError(cause instanceof Error ? cause.message : String(cause), { cause });
|
|
4693
4702
|
}
|
|
4703
|
+
const contentType = response.headers.get("content-type") ?? "";
|
|
4704
|
+
const headers = Array.from(response.headers.entries());
|
|
4705
|
+
const requestSnapshotValue = requestSnapshot(request);
|
|
4706
|
+
if (isEventStream(contentType) && response.body) {
|
|
4707
|
+
const reader = response.body.getReader();
|
|
4708
|
+
const decoder = new TextDecoder();
|
|
4709
|
+
let body = "";
|
|
4710
|
+
let totalSize = 0;
|
|
4711
|
+
const emit = (streaming) => {
|
|
4712
|
+
const blob = new Blob([body], { type: contentType });
|
|
4713
|
+
onProgress?.({
|
|
4714
|
+
request: requestSnapshotValue,
|
|
4715
|
+
status: response.status,
|
|
4716
|
+
statusText: response.statusText,
|
|
4717
|
+
url: response.url || request.url,
|
|
4718
|
+
redirected: response.redirected,
|
|
4719
|
+
duration: Math.round(now() - startedAt),
|
|
4720
|
+
size: totalSize,
|
|
4721
|
+
headers,
|
|
4722
|
+
contentType,
|
|
4723
|
+
body,
|
|
4724
|
+
blob,
|
|
4725
|
+
streaming
|
|
4726
|
+
});
|
|
4727
|
+
};
|
|
4728
|
+
emit(true);
|
|
4729
|
+
while (true) {
|
|
4730
|
+
const result = await reader.read();
|
|
4731
|
+
if (result.done) break;
|
|
4732
|
+
totalSize += result.value.byteLength;
|
|
4733
|
+
body += decoder.decode(result.value, { stream: true });
|
|
4734
|
+
emit(true);
|
|
4735
|
+
}
|
|
4736
|
+
body += decoder.decode();
|
|
4737
|
+
const blob = new Blob([body], { type: contentType });
|
|
4738
|
+
const exchange = {
|
|
4739
|
+
request: requestSnapshotValue,
|
|
4740
|
+
status: response.status,
|
|
4741
|
+
statusText: response.statusText,
|
|
4742
|
+
url: response.url || request.url,
|
|
4743
|
+
redirected: response.redirected,
|
|
4744
|
+
duration: Math.round(now() - startedAt),
|
|
4745
|
+
size: totalSize,
|
|
4746
|
+
headers,
|
|
4747
|
+
contentType,
|
|
4748
|
+
body,
|
|
4749
|
+
blob,
|
|
4750
|
+
streaming: false
|
|
4751
|
+
};
|
|
4752
|
+
onProgress?.(exchange);
|
|
4753
|
+
return exchange;
|
|
4754
|
+
}
|
|
4694
4755
|
const blob = await response.blob();
|
|
4695
4756
|
return {
|
|
4696
|
-
request:
|
|
4757
|
+
request: requestSnapshotValue,
|
|
4697
4758
|
status: response.status,
|
|
4698
4759
|
statusText: response.statusText,
|
|
4699
4760
|
url: response.url || request.url,
|
|
4700
4761
|
redirected: response.redirected,
|
|
4701
4762
|
duration: Math.round(now() - startedAt),
|
|
4702
4763
|
size: blob.size,
|
|
4703
|
-
headers
|
|
4704
|
-
contentType:
|
|
4764
|
+
headers,
|
|
4765
|
+
contentType: contentType || blob.type,
|
|
4705
4766
|
body: await blob.text(),
|
|
4706
4767
|
blob
|
|
4707
4768
|
};
|
|
@@ -4902,7 +4963,10 @@ function useOpenApiRequestExecution() {
|
|
|
4902
4963
|
setError("");
|
|
4903
4964
|
setExchange(void 0);
|
|
4904
4965
|
try {
|
|
4905
|
-
setExchange(await executeApiRequest(request, {
|
|
4966
|
+
setExchange(await executeApiRequest(request, {
|
|
4967
|
+
signal: controller.signal,
|
|
4968
|
+
onProgress: (progress) => setExchange(progress)
|
|
4969
|
+
}));
|
|
4906
4970
|
} catch (cause) {
|
|
4907
4971
|
if (cause instanceof DOMException && cause.name === "AbortError") return;
|
|
4908
4972
|
const message = cause instanceof Error ? cause.message : String(cause);
|
|
@@ -5574,4 +5638,4 @@ function OpenApiOperation(arg0) {
|
|
|
5574
5638
|
//#endregion
|
|
5575
5639
|
export { Feedback as A, LocalizedLink as B, Steps as C, Logo as D, HeroPattern as E, Mermaid as F, Card as I, CardGroup as L, Code as M, CodeGroup as N, Heading as O, Pre as P, Callout as R, Step as S, GridPattern as T, Markdown as _, ResponseExamplesPanel as a, TabItem as b, getAuthOptions as c, EndpointMethodBadge as d, getOpenApiOperationEntryById as f, getRequestBody$1 as g, getMediaTypeEntries as h, RequestExamplesPanel as i, Collapse as j, Tag as k, getServerKey as l, listOpenApiOperations as m, OpenApiOperation as n, authPlaceholder as o, getOpenApiOperationSectionId as p, OpenApiRequestWorkbench as r, defaultServerVariables as s, EndpointIdentity as t, getServers as u, primitives_exports as v, Prose as w, Tabs as x, WebFrame as y, Button as z };
|
|
5576
5640
|
|
|
5577
|
-
//# sourceMappingURL=OpenApiOperation-
|
|
5641
|
+
//# sourceMappingURL=OpenApiOperation-B26v2y44.js.map
|