@djangocfg/ui-tools 2.1.301 → 2.1.303
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/dist/{DocsLayout-MWRKNFXR.mjs → DocsLayout-6ECALRLD.mjs} +3 -3
- package/dist/{DocsLayout-MWRKNFXR.mjs.map → DocsLayout-6ECALRLD.mjs.map} +1 -1
- package/dist/{DocsLayout-NWJUF42A.cjs → DocsLayout-ASPSECYR.cjs} +48 -48
- package/dist/{DocsLayout-NWJUF42A.cjs.map → DocsLayout-ASPSECYR.cjs.map} +1 -1
- package/dist/{Mermaid.client-XFQ74OYN.mjs → Mermaid.client-SXRRI2YW.mjs} +43 -6
- package/dist/Mermaid.client-SXRRI2YW.mjs.map +1 -0
- package/dist/{Mermaid.client-RSWUUHIL.cjs → Mermaid.client-W76R5AKJ.cjs} +43 -6
- package/dist/Mermaid.client-W76R5AKJ.cjs.map +1 -0
- package/dist/{chunk-CKD7GNE5.mjs → chunk-K35OF7OB.mjs} +88 -52
- package/dist/chunk-K35OF7OB.mjs.map +1 -0
- package/dist/{chunk-SEXWBCLX.cjs → chunk-PFKR6ZPZ.cjs} +88 -52
- package/dist/chunk-PFKR6ZPZ.cjs.map +1 -0
- package/dist/index.cjs +11 -11
- package/dist/index.d.cts +20 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.mjs +5 -5
- package/package.json +6 -6
- package/src/components/markdown/MarkdownMessage/CodeBlock.tsx +53 -42
- package/src/components/markdown/MarkdownMessage/MarkdownMessage.story.tsx +422 -0
- package/src/components/markdown/MarkdownMessage/MarkdownMessage.tsx +38 -11
- package/src/components/markdown/MarkdownMessage/components.tsx +69 -14
- package/src/components/markdown/MarkdownMessage/plainText.ts +33 -0
- package/src/components/markdown/MarkdownMessage/types.ts +13 -0
- package/src/tools/Mermaid/Mermaid.client.tsx +10 -1
- package/src/tools/Mermaid/components/MermaidFullscreenModal.tsx +76 -3
- package/src/tools/Mermaid/index.tsx +7 -0
- package/dist/Mermaid.client-RSWUUHIL.cjs.map +0 -1
- package/dist/Mermaid.client-XFQ74OYN.mjs.map +0 -1
- package/dist/chunk-CKD7GNE5.mjs.map +0 -1
- package/dist/chunk-SEXWBCLX.cjs.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkPFKR6ZPZ_cjs = require('./chunk-PFKR6ZPZ.cjs');
|
|
4
4
|
var chunk33AMWFBZ_cjs = require('./chunk-33AMWFBZ.cjs');
|
|
5
5
|
require('./chunk-2SMCH62O.cjs');
|
|
6
6
|
var chunkWGEGR3DF_cjs = require('./chunk-WGEGR3DF.cjs');
|
|
@@ -55,7 +55,7 @@ var extractEndpoints = /* @__PURE__ */ chunkWGEGR3DF_cjs.__name((schema, baseUrl
|
|
|
55
55
|
description: response.description || `Response ${code}`,
|
|
56
56
|
contentType: chosenContentType,
|
|
57
57
|
schema: respSchema,
|
|
58
|
-
example: respSchema ?
|
|
58
|
+
example: respSchema ? chunkPFKR6ZPZ_cjs.sampleSchemaJson(respSchema, { skipWriteOnly: true }, specRoot) : void 0
|
|
59
59
|
});
|
|
60
60
|
}
|
|
61
61
|
}
|
|
@@ -68,13 +68,13 @@ var extractEndpoints = /* @__PURE__ */ chunkWGEGR3DF_cjs.__name((schema, baseUrl
|
|
|
68
68
|
type: rawSchema?.type || "object",
|
|
69
69
|
description: op.requestBody.description,
|
|
70
70
|
schema: rawSchema,
|
|
71
|
-
example: rawSchema ?
|
|
71
|
+
example: rawSchema ? chunkPFKR6ZPZ_cjs.sampleSchemaJson(rawSchema, { skipReadOnly: true }, specRoot) : void 0
|
|
72
72
|
};
|
|
73
73
|
}
|
|
74
74
|
const endpoint = {
|
|
75
75
|
name: path.split("/").pop() || path,
|
|
76
76
|
method: methodUpper,
|
|
77
|
-
path: baseUrl ?
|
|
77
|
+
path: baseUrl ? chunkPFKR6ZPZ_cjs.joinUrl(baseUrl, path) : path,
|
|
78
78
|
summary,
|
|
79
79
|
description,
|
|
80
80
|
category,
|
|
@@ -128,11 +128,11 @@ function useOpenApiSchema({
|
|
|
128
128
|
[loadedSchemas, currentSchemaId]
|
|
129
129
|
);
|
|
130
130
|
const dereferencedSchema = React12.useMemo(
|
|
131
|
-
() => currentOpenApiSchema ?
|
|
131
|
+
() => currentOpenApiSchema ? chunkPFKR6ZPZ_cjs.dereferenceSchema(currentOpenApiSchema) : null,
|
|
132
132
|
[currentOpenApiSchema]
|
|
133
133
|
);
|
|
134
134
|
const resolvedBaseUrl = React12.useMemo(
|
|
135
|
-
() =>
|
|
135
|
+
() => chunkPFKR6ZPZ_cjs.resolveBaseUrl({
|
|
136
136
|
schemaSource: currentSchema?.baseUrl,
|
|
137
137
|
config: configBaseUrl,
|
|
138
138
|
fromServers: currentOpenApiSchema?.servers?.[0]?.url
|
|
@@ -231,8 +231,8 @@ function useOpenApiSchema({
|
|
|
231
231
|
if (!preloadAll) return [];
|
|
232
232
|
return schemas.map((src) => {
|
|
233
233
|
const raw = loadedSchemas.get(src.id) ?? null;
|
|
234
|
-
const deref = raw ?
|
|
235
|
-
const resolved =
|
|
234
|
+
const deref = raw ? chunkPFKR6ZPZ_cjs.dereferenceSchema(raw) : null;
|
|
235
|
+
const resolved = chunkPFKR6ZPZ_cjs.resolveBaseUrl({
|
|
236
236
|
schemaSource: src.baseUrl,
|
|
237
237
|
config: configBaseUrl,
|
|
238
238
|
fromServers: raw?.servers?.[0]?.url
|
|
@@ -443,7 +443,7 @@ chunkWGEGR3DF_cjs.__name(useEndpointDraft, "useEndpointDraft");
|
|
|
443
443
|
|
|
444
444
|
// src/tools/OpenapiViewer/components/shared/EndpointDraftSync.tsx
|
|
445
445
|
function EndpointDraftSync({ schemaId }) {
|
|
446
|
-
const { state, setParameters, setRequestBody, setActiveSchemaId } =
|
|
446
|
+
const { state, setParameters, setRequestBody, setActiveSchemaId } = chunkPFKR6ZPZ_cjs.usePlaygroundContext();
|
|
447
447
|
const ep = state.selectedEndpoint;
|
|
448
448
|
React12.useEffect(() => {
|
|
449
449
|
setActiveSchemaId(schemaId);
|
|
@@ -619,9 +619,9 @@ function SchemaCopyMenu({ schema, endpoints, baseUrl, variant = "button" }) {
|
|
|
619
619
|
const build = React12.useCallback(
|
|
620
620
|
(flavour) => {
|
|
621
621
|
if (!schema) return "";
|
|
622
|
-
if (flavour === "markdown") return
|
|
623
|
-
if (flavour === "compact") return
|
|
624
|
-
return
|
|
622
|
+
if (flavour === "markdown") return chunkPFKR6ZPZ_cjs.toMarkdown(schema, endpoints, baseUrl);
|
|
623
|
+
if (flavour === "compact") return chunkPFKR6ZPZ_cjs.toCompactJson(schema, baseUrl);
|
|
624
|
+
return chunkPFKR6ZPZ_cjs.toRawJson(schema, baseUrl);
|
|
625
625
|
},
|
|
626
626
|
[schema, endpoints, baseUrl]
|
|
627
627
|
);
|
|
@@ -632,7 +632,7 @@ function SchemaCopyMenu({ schema, endpoints, baseUrl, variant = "button" }) {
|
|
|
632
632
|
const label = FLAVOUR_LABELS[flavour].title;
|
|
633
633
|
try {
|
|
634
634
|
await navigator.clipboard.writeText(text);
|
|
635
|
-
const size =
|
|
635
|
+
const size = chunkPFKR6ZPZ_cjs.formatBytes(text);
|
|
636
636
|
setSizeCache((prev) => ({ ...prev, [flavour]: size }));
|
|
637
637
|
setJustCopied(flavour);
|
|
638
638
|
setTimeout(() => setJustCopied(null), 1500);
|
|
@@ -851,7 +851,7 @@ function emptyTextFor(query, method, defaultText) {
|
|
|
851
851
|
chunkWGEGR3DF_cjs.__name(emptyTextFor, "emptyTextFor");
|
|
852
852
|
function buildFlatVM(endpoints, selectedVersion, query, method, activeEndpointId) {
|
|
853
853
|
const filtered = filterEndpoints(
|
|
854
|
-
|
|
854
|
+
chunkPFKR6ZPZ_cjs.deduplicateEndpoints(endpoints, selectedVersion),
|
|
855
855
|
query,
|
|
856
856
|
method
|
|
857
857
|
);
|
|
@@ -868,7 +868,7 @@ function buildSectionsVM(schemas, endpointsBySchema, selectedVersion, query, met
|
|
|
868
868
|
for (const src of schemas) {
|
|
869
869
|
const raw = endpointsBySchema[src.id] ?? [];
|
|
870
870
|
filteredMap[src.id] = filterEndpoints(
|
|
871
|
-
|
|
871
|
+
chunkPFKR6ZPZ_cjs.deduplicateEndpoints(raw, selectedVersion),
|
|
872
872
|
query,
|
|
873
873
|
method
|
|
874
874
|
);
|
|
@@ -1181,7 +1181,7 @@ function ApiIntroSection({ info, schema, endpoints, resolvedBaseUrl }) {
|
|
|
1181
1181
|
}
|
|
1182
1182
|
)
|
|
1183
1183
|
] }),
|
|
1184
|
-
info.description && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-4 text-muted-foreground", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1184
|
+
info.description && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-4 text-muted-foreground", children: /* @__PURE__ */ jsxRuntime.jsx(chunkPFKR6ZPZ_cjs.MarkdownMessage, { content: info.description }) }),
|
|
1185
1185
|
baseUrlRows.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mt-6 space-y-2", children: [
|
|
1186
1186
|
/* @__PURE__ */ jsxRuntime.jsx("h4", { className: "text-[10px] font-semibold uppercase tracking-wider text-muted-foreground/60", children: "Base URL" }),
|
|
1187
1187
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-1.5", children: baseUrlRows.map((row, i) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-baseline gap-2 flex-wrap", children: [
|
|
@@ -1300,7 +1300,7 @@ function useActiveCodeTab(endpointId, fallback = "curl") {
|
|
|
1300
1300
|
}
|
|
1301
1301
|
chunkWGEGR3DF_cjs.__name(useActiveCodeTab, "useActiveCodeTab");
|
|
1302
1302
|
function LanguageTabs({ activeId, onChange }) {
|
|
1303
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-1 overflow-x-auto -mx-1 px-1", children:
|
|
1303
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-1 overflow-x-auto -mx-1 px-1", children: chunkPFKR6ZPZ_cjs.CODE_SAMPLE_TARGETS.map((t) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1304
1304
|
"button",
|
|
1305
1305
|
{
|
|
1306
1306
|
type: "button",
|
|
@@ -1325,18 +1325,18 @@ function useCodeSnippet({
|
|
|
1325
1325
|
}) {
|
|
1326
1326
|
const effectiveBody = body ?? endpoint.requestBody?.example;
|
|
1327
1327
|
const har = React12.useMemo(() => {
|
|
1328
|
-
const h =
|
|
1328
|
+
const h = chunkPFKR6ZPZ_cjs.buildHarRequest({
|
|
1329
1329
|
endpoint,
|
|
1330
1330
|
body: effectiveBody,
|
|
1331
1331
|
parameters,
|
|
1332
1332
|
headers,
|
|
1333
1333
|
baseUrl
|
|
1334
1334
|
});
|
|
1335
|
-
return baseUrl ? h : { ...h, url:
|
|
1335
|
+
return baseUrl ? h : { ...h, url: chunkPFKR6ZPZ_cjs.resolveAbsolute(h.url) };
|
|
1336
1336
|
}, [endpoint, effectiveBody, parameters, headers, baseUrl]);
|
|
1337
1337
|
return React12.useMemo(() => {
|
|
1338
|
-
const target =
|
|
1339
|
-
const code =
|
|
1338
|
+
const target = chunkPFKR6ZPZ_cjs.CODE_SAMPLE_TARGETS.find((t) => t.id === activeId);
|
|
1339
|
+
const code = chunkPFKR6ZPZ_cjs.renderSnippet(har, activeId);
|
|
1340
1340
|
return {
|
|
1341
1341
|
snippet: code ?? `// Snippet for ${target.label} is unavailable for this request.`,
|
|
1342
1342
|
prism: target.prism
|
|
@@ -1359,7 +1359,7 @@ function CodeSamples({ endpoint, body, parameters, headers, baseUrl }) {
|
|
|
1359
1359
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2.5", children: [
|
|
1360
1360
|
/* @__PURE__ */ jsxRuntime.jsx(LanguageTabs, { activeId, onChange: (id) => setCodeTab(endpointId, id) }),
|
|
1361
1361
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1362
|
-
|
|
1362
|
+
chunkPFKR6ZPZ_cjs.PrettyCode_default,
|
|
1363
1363
|
{
|
|
1364
1364
|
data: snippet,
|
|
1365
1365
|
language: prism,
|
|
@@ -1457,7 +1457,7 @@ function PathDisplay({ path }) {
|
|
|
1457
1457
|
{
|
|
1458
1458
|
className: "block font-mono text-lg md:text-xl font-semibold text-foreground leading-tight",
|
|
1459
1459
|
style: { overflowWrap: "anywhere", wordBreak: "break-word" },
|
|
1460
|
-
children:
|
|
1460
|
+
children: chunkPFKR6ZPZ_cjs.relativePath(path)
|
|
1461
1461
|
}
|
|
1462
1462
|
);
|
|
1463
1463
|
}
|
|
@@ -1469,7 +1469,7 @@ function EndpointHeader({
|
|
|
1469
1469
|
onTryIt,
|
|
1470
1470
|
presentSections
|
|
1471
1471
|
}) {
|
|
1472
|
-
const endpointMd = React12.useMemo(() =>
|
|
1472
|
+
const endpointMd = React12.useMemo(() => chunkPFKR6ZPZ_cjs.endpointToMarkdown(endpoint), [endpoint]);
|
|
1473
1473
|
return /* @__PURE__ */ jsxRuntime.jsxs("header", { className: "space-y-3", children: [
|
|
1474
1474
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3 flex-wrap", children: [
|
|
1475
1475
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 min-w-0", children: [
|
|
@@ -1498,7 +1498,7 @@ function EndpointHeader({
|
|
|
1498
1498
|
)
|
|
1499
1499
|
] }),
|
|
1500
1500
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "min-w-0", children: /* @__PURE__ */ jsxRuntime.jsx(PathDisplay, { path: endpoint.path }) }),
|
|
1501
|
-
endpoint.description && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-muted-foreground text-sm", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1501
|
+
endpoint.description && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-muted-foreground text-sm", children: /* @__PURE__ */ jsxRuntime.jsx(chunkPFKR6ZPZ_cjs.MarkdownMessage, { content: endpoint.description }) })
|
|
1502
1502
|
] });
|
|
1503
1503
|
}
|
|
1504
1504
|
chunkWGEGR3DF_cjs.__name(EndpointHeader, "EndpointHeader");
|
|
@@ -2022,7 +2022,7 @@ function buildSchemaSectionVM(entry, selectedVersion, loadedEndpoint) {
|
|
|
2022
2022
|
} else if (entry.error) {
|
|
2023
2023
|
state = { kind: "error", message: entry.error };
|
|
2024
2024
|
} else {
|
|
2025
|
-
const visible =
|
|
2025
|
+
const visible = chunkPFKR6ZPZ_cjs.deduplicateEndpoints(entry.endpoints, selectedVersion);
|
|
2026
2026
|
state = visible.length === 0 ? { kind: "empty" } : {
|
|
2027
2027
|
kind: "ready",
|
|
2028
2028
|
rows: visible.map((ep) => buildEndpointRow(ep, loadedEndpoint, entry.source.id))
|
|
@@ -2124,7 +2124,7 @@ function SelectorBody({
|
|
|
2124
2124
|
onTryEndpoint
|
|
2125
2125
|
}) {
|
|
2126
2126
|
const visibleEndpoints = React12.useMemo(
|
|
2127
|
-
() =>
|
|
2127
|
+
() => chunkPFKR6ZPZ_cjs.deduplicateEndpoints(endpoints, selectedVersion),
|
|
2128
2128
|
[endpoints, selectedVersion]
|
|
2129
2129
|
);
|
|
2130
2130
|
const rows = React12.useMemo(
|
|
@@ -2552,7 +2552,7 @@ function ArrayField({
|
|
|
2552
2552
|
}
|
|
2553
2553
|
chunkWGEGR3DF_cjs.__name(ArrayField, "ArrayField");
|
|
2554
2554
|
function EndpointResetButton() {
|
|
2555
|
-
const { state, setParameters, setRequestBody } =
|
|
2555
|
+
const { state, setParameters, setRequestBody } = chunkPFKR6ZPZ_cjs.usePlaygroundContext();
|
|
2556
2556
|
const ep = state.selectedEndpoint;
|
|
2557
2557
|
const { reset } = useEndpointDraft(state.activeSchemaId, ep);
|
|
2558
2558
|
const hasDraft = Object.keys(state.parameters).length > 0 || state.requestBody.length > 0;
|
|
@@ -2581,7 +2581,7 @@ function EndpointResetButton() {
|
|
|
2581
2581
|
}
|
|
2582
2582
|
chunkWGEGR3DF_cjs.__name(EndpointResetButton, "EndpointResetButton");
|
|
2583
2583
|
function ParamFields({ label, params }) {
|
|
2584
|
-
const { state, setParameters } =
|
|
2584
|
+
const { state, setParameters } = chunkPFKR6ZPZ_cjs.usePlaygroundContext();
|
|
2585
2585
|
function handleChange(name, value) {
|
|
2586
2586
|
setParameters({ ...state.parameters, [name]: value });
|
|
2587
2587
|
}
|
|
@@ -2621,7 +2621,7 @@ function RequestPanel() {
|
|
|
2621
2621
|
setSelectedApiKey,
|
|
2622
2622
|
setManualApiToken,
|
|
2623
2623
|
sendRequest
|
|
2624
|
-
} =
|
|
2624
|
+
} = chunkPFKR6ZPZ_cjs.usePlaygroundContext();
|
|
2625
2625
|
const apiKeyOptions = React12.useMemo(
|
|
2626
2626
|
() => apiKeys.map((k) => ({
|
|
2627
2627
|
value: k.id,
|
|
@@ -2634,12 +2634,12 @@ function RequestPanel() {
|
|
|
2634
2634
|
);
|
|
2635
2635
|
const hasApiKeys = apiKeyOptions.length > 0;
|
|
2636
2636
|
const ep = state.selectedEndpoint;
|
|
2637
|
-
const isJsonValid = state.requestBody ?
|
|
2637
|
+
const isJsonValid = state.requestBody ? chunkPFKR6ZPZ_cjs.isValidJson(state.requestBody) : true;
|
|
2638
2638
|
const curlCommand = React12.useMemo(() => {
|
|
2639
2639
|
if (!state.requestUrl) return "";
|
|
2640
|
-
const absoluteUrl =
|
|
2641
|
-
const apiKey = state.selectedApiKey ?
|
|
2642
|
-
const hdrs =
|
|
2640
|
+
const absoluteUrl = chunkPFKR6ZPZ_cjs.resolveAbsolute(state.requestUrl);
|
|
2641
|
+
const apiKey = state.selectedApiKey ? chunkPFKR6ZPZ_cjs.findApiKeyById(apiKeys, state.selectedApiKey) : null;
|
|
2642
|
+
const hdrs = chunkPFKR6ZPZ_cjs.parseRequestHeaders(state.requestHeaders);
|
|
2643
2643
|
if (apiKey) hdrs["X-API-Key"] = apiKey.secret || apiKey.id;
|
|
2644
2644
|
let cmd = `curl -X ${state.requestMethod} "${absoluteUrl}"`;
|
|
2645
2645
|
Object.entries(hdrs).forEach(([k, v]) => {
|
|
@@ -2661,13 +2661,13 @@ function RequestPanel() {
|
|
|
2661
2661
|
[ep]
|
|
2662
2662
|
);
|
|
2663
2663
|
state.loading || !state.requestUrl || !isJsonValid;
|
|
2664
|
-
const displayUrl =
|
|
2664
|
+
const displayUrl = chunkPFKR6ZPZ_cjs.resolveAbsolute(state.requestUrl || ep?.path || "");
|
|
2665
2665
|
const hasBody = ep?.method !== "GET";
|
|
2666
2666
|
const bodyType = ep?.requestBody?.type ?? "";
|
|
2667
2667
|
const hasPathParams = pathParams.length > 0;
|
|
2668
2668
|
const hasQueryParams = queryParams.length > 0;
|
|
2669
2669
|
const hasCurl = Boolean(curlCommand);
|
|
2670
|
-
const epPath = ep ?
|
|
2670
|
+
const epPath = ep ? chunkPFKR6ZPZ_cjs.relativePath(ep.path) : "";
|
|
2671
2671
|
const urlChanged = displayUrl !== "" && displayUrl !== epPath;
|
|
2672
2672
|
if (!ep) {
|
|
2673
2673
|
return /* @__PURE__ */ jsxRuntime.jsx(EmptyState, { icon: lucideReact.Send, text: "Select an endpoint to build a request" });
|
|
@@ -2757,7 +2757,7 @@ function RequestPanel() {
|
|
|
2757
2757
|
"cURL"
|
|
2758
2758
|
] }),
|
|
2759
2759
|
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-2", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2760
|
-
|
|
2760
|
+
chunkPFKR6ZPZ_cjs.PrettyCode_default,
|
|
2761
2761
|
{
|
|
2762
2762
|
data: curlCommand,
|
|
2763
2763
|
language: "bash",
|
|
@@ -2942,7 +2942,7 @@ function PrettyView({ treeData, rawText, detected }) {
|
|
|
2942
2942
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "py-10 text-center text-xs text-muted-foreground", children: "Empty response body" });
|
|
2943
2943
|
}
|
|
2944
2944
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2945
|
-
|
|
2945
|
+
chunkPFKR6ZPZ_cjs.PrettyCode_default,
|
|
2946
2946
|
{
|
|
2947
2947
|
data: rawText,
|
|
2948
2948
|
language: detected.prism,
|
|
@@ -3118,7 +3118,7 @@ function ViewTabs({ active, onChange, showPreview }) {
|
|
|
3118
3118
|
}
|
|
3119
3119
|
chunkWGEGR3DF_cjs.__name(ViewTabs, "ViewTabs");
|
|
3120
3120
|
function ResponsePanel() {
|
|
3121
|
-
const { state } =
|
|
3121
|
+
const { state } = chunkPFKR6ZPZ_cjs.usePlaygroundContext();
|
|
3122
3122
|
const { response, loading, selectedEndpoint } = state;
|
|
3123
3123
|
const { treeData, rawText, detected } = useResponseView(response?.data, response?.headers);
|
|
3124
3124
|
const showPreview = detected.kind === "html";
|
|
@@ -3159,15 +3159,15 @@ function ResponsePanel() {
|
|
|
3159
3159
|
}
|
|
3160
3160
|
chunkWGEGR3DF_cjs.__name(ResponsePanel, "ResponsePanel");
|
|
3161
3161
|
function SendButton({ className }) {
|
|
3162
|
-
const { state, sendRequest } =
|
|
3162
|
+
const { state, sendRequest } = chunkPFKR6ZPZ_cjs.usePlaygroundContext();
|
|
3163
3163
|
const ep = state.selectedEndpoint;
|
|
3164
3164
|
const builder = React12.useMemo(
|
|
3165
|
-
() => ep ? new
|
|
3165
|
+
() => ep ? new chunkPFKR6ZPZ_cjs.UrlBuilder(ep, state.parameters) : null,
|
|
3166
3166
|
[ep, state.parameters]
|
|
3167
3167
|
);
|
|
3168
3168
|
const missingRequired = builder?.missingRequired() ?? [];
|
|
3169
3169
|
const unsubstituted = builder?.unfilledPlaceholders() ?? [];
|
|
3170
|
-
const isJsonValid = state.requestBody ?
|
|
3170
|
+
const isJsonValid = state.requestBody ? chunkPFKR6ZPZ_cjs.isValidJson(state.requestBody) : true;
|
|
3171
3171
|
const blockers = [];
|
|
3172
3172
|
if (missingRequired.length > 0) {
|
|
3173
3173
|
blockers.push(
|
|
@@ -3207,7 +3207,7 @@ chunkWGEGR3DF_cjs.__name(SendButton, "SendButton");
|
|
|
3207
3207
|
var WIDTH_NARROW = "clamp(380px, 30vw, 480px)";
|
|
3208
3208
|
var WIDTH_WIDE = "clamp(720px, 60vw, 1280px)";
|
|
3209
3209
|
function SlideInPlayground({ open, onClose }) {
|
|
3210
|
-
const { state } =
|
|
3210
|
+
const { state } = chunkPFKR6ZPZ_cjs.usePlaygroundContext();
|
|
3211
3211
|
const ep = state.selectedEndpoint;
|
|
3212
3212
|
const showResponse = state.response !== null || state.loading;
|
|
3213
3213
|
const width = showResponse ? WIDTH_WIDE : WIDTH_NARROW;
|
|
@@ -3216,7 +3216,7 @@ function SlideInPlayground({ open, onClose }) {
|
|
|
3216
3216
|
/* @__PURE__ */ jsxRuntime.jsx(components.SidePanel.Title, { children: "Playground" }),
|
|
3217
3217
|
ep && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 min-w-0 flex-1", children: [
|
|
3218
3218
|
/* @__PURE__ */ jsxRuntime.jsx(MethodBadge, { method: ep.method }),
|
|
3219
|
-
/* @__PURE__ */ jsxRuntime.jsx("code", { className: "font-mono text-[11px] text-muted-foreground truncate", children:
|
|
3219
|
+
/* @__PURE__ */ jsxRuntime.jsx("code", { className: "font-mono text-[11px] text-muted-foreground truncate", children: chunkPFKR6ZPZ_cjs.relativePath(ep.path) })
|
|
3220
3220
|
] }),
|
|
3221
3221
|
/* @__PURE__ */ jsxRuntime.jsx(components.SidePanel.Close, { className: "ml-auto" })
|
|
3222
3222
|
] }),
|
|
@@ -3240,7 +3240,7 @@ function SlideInPlayground({ open, onClose }) {
|
|
|
3240
3240
|
}
|
|
3241
3241
|
chunkWGEGR3DF_cjs.__name(SlideInPlayground, "SlideInPlayground");
|
|
3242
3242
|
function TryItSheet({ open, onOpenChange }) {
|
|
3243
|
-
const { state } =
|
|
3243
|
+
const { state } = chunkPFKR6ZPZ_cjs.usePlaygroundContext();
|
|
3244
3244
|
const showResponse = state.response !== null || state.loading;
|
|
3245
3245
|
return /* @__PURE__ */ jsxRuntime.jsx(components.ResponsiveSheet, { open, onOpenChange, children: /* @__PURE__ */ jsxRuntime.jsxs(components.ResponsiveSheetContent, { className: "sm:max-w-xl flex flex-col h-full p-0", children: [
|
|
3246
3246
|
/* @__PURE__ */ jsxRuntime.jsx(components.ResponsiveSheetHeader, { className: "px-4 py-3 border-b shrink-0", children: /* @__PURE__ */ jsxRuntime.jsx(components.ResponsiveSheetTitle, { className: "text-sm", children: "Playground" }) }),
|
|
@@ -3255,7 +3255,7 @@ function TryItSheet({ open, onOpenChange }) {
|
|
|
3255
3255
|
}
|
|
3256
3256
|
chunkWGEGR3DF_cjs.__name(TryItSheet, "TryItSheet");
|
|
3257
3257
|
var DocsLayout = /* @__PURE__ */ chunkWGEGR3DF_cjs.__name(() => {
|
|
3258
|
-
const { state, config, setSelectedEndpoint } =
|
|
3258
|
+
const { state, config, setSelectedEndpoint } = chunkPFKR6ZPZ_cjs.usePlaygroundContext();
|
|
3259
3259
|
const isDesktop = hooks.useMediaQuery("(min-width: 1024px)");
|
|
3260
3260
|
const isMobile = !isDesktop;
|
|
3261
3261
|
const grouping = config.schemaGrouping ?? "selector";
|
|
@@ -3466,5 +3466,5 @@ var DocsLayout = /* @__PURE__ */ chunkWGEGR3DF_cjs.__name(() => {
|
|
|
3466
3466
|
}, "DocsLayout");
|
|
3467
3467
|
|
|
3468
3468
|
exports.DocsLayout = DocsLayout;
|
|
3469
|
-
//# sourceMappingURL=DocsLayout-
|
|
3470
|
-
//# sourceMappingURL=DocsLayout-
|
|
3469
|
+
//# sourceMappingURL=DocsLayout-ASPSECYR.cjs.map
|
|
3470
|
+
//# sourceMappingURL=DocsLayout-ASPSECYR.cjs.map
|