@djangocfg/ui-tools 2.1.361 → 2.1.363

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.
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkQW4RBGHN_cjs = require('./chunk-QW4RBGHN.cjs');
3
+ var chunk7EYHNP3E_cjs = require('./chunk-7EYHNP3E.cjs');
4
4
  var chunkXACCHZH2_cjs = require('./chunk-XACCHZH2.cjs');
5
5
  var chunkT3MWM23F_cjs = require('./chunk-T3MWM23F.cjs');
6
6
  require('./chunk-FP2RLYQZ.cjs');
@@ -56,7 +56,7 @@ var extractEndpoints = /* @__PURE__ */ chunkOLISEQHS_cjs.__name((schema, baseUrl
56
56
  description: response.description || `Response ${code}`,
57
57
  contentType: chosenContentType,
58
58
  schema: respSchema,
59
- example: respSchema ? chunkQW4RBGHN_cjs.sampleSchemaJson(respSchema, { skipWriteOnly: true }, specRoot) : void 0
59
+ example: respSchema ? chunk7EYHNP3E_cjs.sampleSchemaJson(respSchema, { skipWriteOnly: true }, specRoot) : void 0
60
60
  });
61
61
  }
62
62
  }
@@ -69,13 +69,13 @@ var extractEndpoints = /* @__PURE__ */ chunkOLISEQHS_cjs.__name((schema, baseUrl
69
69
  type: rawSchema?.type || "object",
70
70
  description: op.requestBody.description,
71
71
  schema: rawSchema,
72
- example: rawSchema ? chunkQW4RBGHN_cjs.sampleSchemaJson(rawSchema, { skipReadOnly: true }, specRoot) : void 0
72
+ example: rawSchema ? chunk7EYHNP3E_cjs.sampleSchemaJson(rawSchema, { skipReadOnly: true }, specRoot) : void 0
73
73
  };
74
74
  }
75
75
  const endpoint = {
76
76
  name: path.split("/").pop() || path,
77
77
  method: methodUpper,
78
- path: baseUrl ? chunkQW4RBGHN_cjs.joinUrl(baseUrl, path) : path,
78
+ path: baseUrl ? chunk7EYHNP3E_cjs.joinUrl(baseUrl, path) : path,
79
79
  summary,
80
80
  description,
81
81
  category,
@@ -129,11 +129,11 @@ function useOpenApiSchema({
129
129
  [loadedSchemas, currentSchemaId]
130
130
  );
131
131
  const dereferencedSchema = React12.useMemo(
132
- () => currentOpenApiSchema ? chunkQW4RBGHN_cjs.dereferenceSchema(currentOpenApiSchema) : null,
132
+ () => currentOpenApiSchema ? chunk7EYHNP3E_cjs.dereferenceSchema(currentOpenApiSchema) : null,
133
133
  [currentOpenApiSchema]
134
134
  );
135
135
  const resolvedBaseUrl = React12.useMemo(
136
- () => chunkQW4RBGHN_cjs.resolveBaseUrl({
136
+ () => chunk7EYHNP3E_cjs.resolveBaseUrl({
137
137
  schemaSource: currentSchema?.baseUrl,
138
138
  config: configBaseUrl,
139
139
  fromServers: currentOpenApiSchema?.servers?.[0]?.url
@@ -243,8 +243,8 @@ function useOpenApiSchema({
243
243
  if (!preloadAll) return [];
244
244
  return schemas.map((src) => {
245
245
  const raw = loadedSchemas.get(src.id) ?? null;
246
- const deref = raw ? chunkQW4RBGHN_cjs.dereferenceSchema(raw) : null;
247
- const resolved = chunkQW4RBGHN_cjs.resolveBaseUrl({
246
+ const deref = raw ? chunk7EYHNP3E_cjs.dereferenceSchema(raw) : null;
247
+ const resolved = chunk7EYHNP3E_cjs.resolveBaseUrl({
248
248
  schemaSource: src.baseUrl,
249
249
  config: configBaseUrl,
250
250
  fromServers: raw?.servers?.[0]?.url
@@ -460,7 +460,7 @@ chunkOLISEQHS_cjs.__name(useEndpointDraft, "useEndpointDraft");
460
460
 
461
461
  // src/tools/OpenapiViewer/components/shared/EndpointDraftSync.tsx
462
462
  function EndpointDraftSync({ schemaId }) {
463
- const { state, setParameters, setRequestBody, setActiveSchemaId } = chunkQW4RBGHN_cjs.usePlaygroundContext();
463
+ const { state, setParameters, setRequestBody, setActiveSchemaId } = chunk7EYHNP3E_cjs.usePlaygroundContext();
464
464
  const ep = state.selectedEndpoint;
465
465
  React12.useEffect(() => {
466
466
  setActiveSchemaId(schemaId);
@@ -657,11 +657,11 @@ function sidebarLabel(ep, groupCommonPrefix) {
657
657
  const tail = ep.path.slice(groupCommonPrefix.length) || "/";
658
658
  return tail;
659
659
  }
660
- return chunkQW4RBGHN_cjs.relativePath(ep.path);
660
+ return chunk7EYHNP3E_cjs.relativePath(ep.path);
661
661
  }
662
662
  chunkOLISEQHS_cjs.__name(sidebarLabel, "sidebarLabel");
663
663
  function sidebarTooltip(ep) {
664
- return `${ep.method} ${chunkQW4RBGHN_cjs.relativePath(ep.path)}`;
664
+ return `${ep.method} ${chunk7EYHNP3E_cjs.relativePath(ep.path)}`;
665
665
  }
666
666
  chunkOLISEQHS_cjs.__name(sidebarTooltip, "sidebarTooltip");
667
667
 
@@ -738,7 +738,7 @@ function emptyTextFor(query, method, defaultText) {
738
738
  chunkOLISEQHS_cjs.__name(emptyTextFor, "emptyTextFor");
739
739
  function buildFlatVM(endpoints, selectedVersion, query, method, activeEndpointId) {
740
740
  const filtered = filterEndpoints(
741
- chunkQW4RBGHN_cjs.deduplicateEndpoints(endpoints, selectedVersion),
741
+ chunk7EYHNP3E_cjs.deduplicateEndpoints(endpoints, selectedVersion),
742
742
  query,
743
743
  method
744
744
  );
@@ -755,7 +755,7 @@ function buildSectionsVM(schemas, endpointsBySchema, selectedVersion, query, met
755
755
  for (const src of schemas) {
756
756
  const raw = endpointsBySchema[src.id] ?? [];
757
757
  filteredMap[src.id] = filterEndpoints(
758
- chunkQW4RBGHN_cjs.deduplicateEndpoints(raw, selectedVersion),
758
+ chunk7EYHNP3E_cjs.deduplicateEndpoints(raw, selectedVersion),
759
759
  query,
760
760
  method
761
761
  );
@@ -867,9 +867,9 @@ function SchemaCopyMenu({ schema, endpoints, baseUrl, variant = "button", side }
867
867
  const build = React12.useCallback(
868
868
  (flavour) => {
869
869
  if (!schema) return "";
870
- if (flavour === "markdown") return chunkQW4RBGHN_cjs.toMarkdown(schema, endpoints, baseUrl);
871
- if (flavour === "compact") return chunkQW4RBGHN_cjs.toCompactJson(schema, baseUrl);
872
- return chunkQW4RBGHN_cjs.toRawJson(schema, baseUrl);
870
+ if (flavour === "markdown") return chunk7EYHNP3E_cjs.toMarkdown(schema, endpoints, baseUrl);
871
+ if (flavour === "compact") return chunk7EYHNP3E_cjs.toCompactJson(schema, baseUrl);
872
+ return chunk7EYHNP3E_cjs.toRawJson(schema, baseUrl);
873
873
  },
874
874
  [schema, endpoints, baseUrl]
875
875
  );
@@ -880,7 +880,7 @@ function SchemaCopyMenu({ schema, endpoints, baseUrl, variant = "button", side }
880
880
  const label = FLAVOUR_LABELS[flavour].title;
881
881
  try {
882
882
  await navigator.clipboard.writeText(text);
883
- const size = chunkQW4RBGHN_cjs.formatBytes(text);
883
+ const size = chunk7EYHNP3E_cjs.formatBytes(text);
884
884
  setSizeCache((prev) => ({ ...prev, [flavour]: size }));
885
885
  setJustCopied(flavour);
886
886
  setTimeout(() => setJustCopied(null), 1500);
@@ -1285,7 +1285,7 @@ function useActiveCodeTab(endpointId, fallback = "curl") {
1285
1285
  }
1286
1286
  chunkOLISEQHS_cjs.__name(useActiveCodeTab, "useActiveCodeTab");
1287
1287
  function LanguageTabs({ activeId, onChange }) {
1288
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-1 overflow-x-auto -mx-1 px-1", children: chunkQW4RBGHN_cjs.CODE_SAMPLE_TARGETS.map((t) => /* @__PURE__ */ jsxRuntime.jsx(
1288
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-1 overflow-x-auto -mx-1 px-1", children: chunk7EYHNP3E_cjs.CODE_SAMPLE_TARGETS.map((t) => /* @__PURE__ */ jsxRuntime.jsx(
1289
1289
  "button",
1290
1290
  {
1291
1291
  type: "button",
@@ -1310,18 +1310,18 @@ function useCodeSnippet({
1310
1310
  }) {
1311
1311
  const effectiveBody = body ?? endpoint.requestBody?.example;
1312
1312
  const har = React12.useMemo(() => {
1313
- const h = chunkQW4RBGHN_cjs.buildHarRequest({
1313
+ const h = chunk7EYHNP3E_cjs.buildHarRequest({
1314
1314
  endpoint,
1315
1315
  body: effectiveBody,
1316
1316
  parameters,
1317
1317
  headers,
1318
1318
  baseUrl
1319
1319
  });
1320
- return baseUrl ? h : { ...h, url: chunkQW4RBGHN_cjs.resolveAbsolute(h.url) };
1320
+ return baseUrl ? h : { ...h, url: chunk7EYHNP3E_cjs.resolveAbsolute(h.url) };
1321
1321
  }, [endpoint, effectiveBody, parameters, headers, baseUrl]);
1322
1322
  return React12.useMemo(() => {
1323
- const target = chunkQW4RBGHN_cjs.CODE_SAMPLE_TARGETS.find((t) => t.id === activeId);
1324
- const code = chunkQW4RBGHN_cjs.renderSnippet(har, activeId);
1323
+ const target = chunk7EYHNP3E_cjs.CODE_SAMPLE_TARGETS.find((t) => t.id === activeId);
1324
+ const code = chunk7EYHNP3E_cjs.renderSnippet(har, activeId);
1325
1325
  return {
1326
1326
  snippet: code ?? `// Snippet for ${target.label} is unavailable for this request.`,
1327
1327
  prism: target.prism
@@ -1420,7 +1420,7 @@ function PathDisplay({ path }) {
1420
1420
  {
1421
1421
  className: "block font-mono text-lg md:text-xl font-semibold text-foreground leading-tight",
1422
1422
  style: { overflowWrap: "anywhere", wordBreak: "break-word" },
1423
- children: chunkQW4RBGHN_cjs.relativePath(path)
1423
+ children: chunk7EYHNP3E_cjs.relativePath(path)
1424
1424
  }
1425
1425
  );
1426
1426
  }
@@ -1432,7 +1432,7 @@ function EndpointHeader({
1432
1432
  onTryIt,
1433
1433
  presentSections
1434
1434
  }) {
1435
- const endpointMd = React12.useMemo(() => chunkQW4RBGHN_cjs.endpointToMarkdown(endpoint), [endpoint]);
1435
+ const endpointMd = React12.useMemo(() => chunk7EYHNP3E_cjs.endpointToMarkdown(endpoint), [endpoint]);
1436
1436
  const [aiCopied, setAiCopied] = React12.useState(false);
1437
1437
  const onAiCopy = React12.useCallback(() => {
1438
1438
  if (typeof window === "undefined") return;
@@ -2007,7 +2007,7 @@ function buildSchemaSectionVM(entry, selectedVersion, loadedEndpoint) {
2007
2007
  } else if (entry.error) {
2008
2008
  state = { kind: "error", message: entry.error };
2009
2009
  } else {
2010
- const visible = chunkQW4RBGHN_cjs.deduplicateEndpoints(entry.endpoints, selectedVersion);
2010
+ const visible = chunk7EYHNP3E_cjs.deduplicateEndpoints(entry.endpoints, selectedVersion);
2011
2011
  state = visible.length === 0 ? { kind: "empty" } : {
2012
2012
  kind: "ready",
2013
2013
  rows: visible.map((ep) => buildEndpointRow(ep, loadedEndpoint, entry.source.id))
@@ -2109,7 +2109,7 @@ function SelectorBody({
2109
2109
  onTryEndpoint
2110
2110
  }) {
2111
2111
  const visibleEndpoints = React12.useMemo(
2112
- () => chunkQW4RBGHN_cjs.deduplicateEndpoints(endpoints, selectedVersion),
2112
+ () => chunk7EYHNP3E_cjs.deduplicateEndpoints(endpoints, selectedVersion),
2113
2113
  [endpoints, selectedVersion]
2114
2114
  );
2115
2115
  const rows = React12.useMemo(
@@ -2537,7 +2537,7 @@ function ArrayField({
2537
2537
  }
2538
2538
  chunkOLISEQHS_cjs.__name(ArrayField, "ArrayField");
2539
2539
  function EndpointResetButton() {
2540
- const { state, setParameters, setRequestBody } = chunkQW4RBGHN_cjs.usePlaygroundContext();
2540
+ const { state, setParameters, setRequestBody } = chunk7EYHNP3E_cjs.usePlaygroundContext();
2541
2541
  const ep = state.selectedEndpoint;
2542
2542
  const { reset } = useEndpointDraft(state.activeSchemaId, ep);
2543
2543
  const hasDraft = Object.keys(state.parameters).length > 0 || state.requestBody.length > 0;
@@ -2566,7 +2566,7 @@ function EndpointResetButton() {
2566
2566
  }
2567
2567
  chunkOLISEQHS_cjs.__name(EndpointResetButton, "EndpointResetButton");
2568
2568
  function ParamFields({ label, params }) {
2569
- const { state, setParameters } = chunkQW4RBGHN_cjs.usePlaygroundContext();
2569
+ const { state, setParameters } = chunk7EYHNP3E_cjs.usePlaygroundContext();
2570
2570
  function handleChange(name, value) {
2571
2571
  setParameters({ ...state.parameters, [name]: value });
2572
2572
  }
@@ -2606,7 +2606,7 @@ function RequestPanel() {
2606
2606
  setSelectedApiKey,
2607
2607
  setManualApiToken,
2608
2608
  sendRequest
2609
- } = chunkQW4RBGHN_cjs.usePlaygroundContext();
2609
+ } = chunk7EYHNP3E_cjs.usePlaygroundContext();
2610
2610
  const apiKeyOptions = React12.useMemo(
2611
2611
  () => apiKeys.map((k) => ({
2612
2612
  value: k.id,
@@ -2619,12 +2619,12 @@ function RequestPanel() {
2619
2619
  );
2620
2620
  const hasApiKeys = apiKeyOptions.length > 0;
2621
2621
  const ep = state.selectedEndpoint;
2622
- const isJsonValid = state.requestBody ? chunkQW4RBGHN_cjs.isValidJson(state.requestBody) : true;
2622
+ const isJsonValid = state.requestBody ? chunk7EYHNP3E_cjs.isValidJson(state.requestBody) : true;
2623
2623
  const curlCommand = React12.useMemo(() => {
2624
2624
  if (!state.requestUrl) return "";
2625
- const absoluteUrl = chunkQW4RBGHN_cjs.resolveAbsolute(state.requestUrl);
2626
- const apiKey = state.selectedApiKey ? chunkQW4RBGHN_cjs.findApiKeyById(apiKeys, state.selectedApiKey) : null;
2627
- const hdrs = chunkQW4RBGHN_cjs.parseRequestHeaders(state.requestHeaders);
2625
+ const absoluteUrl = chunk7EYHNP3E_cjs.resolveAbsolute(state.requestUrl);
2626
+ const apiKey = state.selectedApiKey ? chunk7EYHNP3E_cjs.findApiKeyById(apiKeys, state.selectedApiKey) : null;
2627
+ const hdrs = chunk7EYHNP3E_cjs.parseRequestHeaders(state.requestHeaders);
2628
2628
  if (apiKey) hdrs["X-API-Key"] = apiKey.secret || apiKey.id;
2629
2629
  let cmd = `curl -X ${state.requestMethod} "${absoluteUrl}"`;
2630
2630
  Object.entries(hdrs).forEach(([k, v]) => {
@@ -2646,13 +2646,13 @@ function RequestPanel() {
2646
2646
  [ep]
2647
2647
  );
2648
2648
  state.loading || !state.requestUrl || !isJsonValid;
2649
- const displayUrl = chunkQW4RBGHN_cjs.resolveAbsolute(state.requestUrl || ep?.path || "");
2649
+ const displayUrl = chunk7EYHNP3E_cjs.resolveAbsolute(state.requestUrl || ep?.path || "");
2650
2650
  const hasBody = ep?.method !== "GET";
2651
2651
  const bodyType = ep?.requestBody?.type ?? "";
2652
2652
  const hasPathParams = pathParams.length > 0;
2653
2653
  const hasQueryParams = queryParams.length > 0;
2654
2654
  const hasCurl = Boolean(curlCommand);
2655
- const epPath = ep ? chunkQW4RBGHN_cjs.relativePath(ep.path) : "";
2655
+ const epPath = ep ? chunk7EYHNP3E_cjs.relativePath(ep.path) : "";
2656
2656
  const urlChanged = displayUrl !== "" && displayUrl !== epPath;
2657
2657
  if (!ep) {
2658
2658
  return /* @__PURE__ */ jsxRuntime.jsx(EmptyState, { icon: lucideReact.Send, text: "Select an endpoint to build a request" });
@@ -3103,7 +3103,7 @@ function ViewTabs({ active, onChange, showPreview }) {
3103
3103
  }
3104
3104
  chunkOLISEQHS_cjs.__name(ViewTabs, "ViewTabs");
3105
3105
  function ResponsePanel() {
3106
- const { state } = chunkQW4RBGHN_cjs.usePlaygroundContext();
3106
+ const { state } = chunk7EYHNP3E_cjs.usePlaygroundContext();
3107
3107
  const { response, loading, selectedEndpoint } = state;
3108
3108
  const { treeData, rawText, detected } = useResponseView(response?.data, response?.headers);
3109
3109
  const showPreview = detected.kind === "html";
@@ -3144,15 +3144,15 @@ function ResponsePanel() {
3144
3144
  }
3145
3145
  chunkOLISEQHS_cjs.__name(ResponsePanel, "ResponsePanel");
3146
3146
  function SendButton({ className }) {
3147
- const { state, sendRequest } = chunkQW4RBGHN_cjs.usePlaygroundContext();
3147
+ const { state, sendRequest } = chunk7EYHNP3E_cjs.usePlaygroundContext();
3148
3148
  const ep = state.selectedEndpoint;
3149
3149
  const builder = React12.useMemo(
3150
- () => ep ? new chunkQW4RBGHN_cjs.UrlBuilder(ep, state.parameters) : null,
3150
+ () => ep ? new chunk7EYHNP3E_cjs.UrlBuilder(ep, state.parameters) : null,
3151
3151
  [ep, state.parameters]
3152
3152
  );
3153
3153
  const missingRequired = builder?.missingRequired() ?? [];
3154
3154
  const unsubstituted = builder?.unfilledPlaceholders() ?? [];
3155
- const isJsonValid = state.requestBody ? chunkQW4RBGHN_cjs.isValidJson(state.requestBody) : true;
3155
+ const isJsonValid = state.requestBody ? chunk7EYHNP3E_cjs.isValidJson(state.requestBody) : true;
3156
3156
  const blockers = [];
3157
3157
  if (missingRequired.length > 0) {
3158
3158
  blockers.push(
@@ -3192,7 +3192,7 @@ chunkOLISEQHS_cjs.__name(SendButton, "SendButton");
3192
3192
  var WIDTH_NARROW = "clamp(380px, 30vw, 480px)";
3193
3193
  var WIDTH_WIDE = "clamp(720px, 60vw, 1280px)";
3194
3194
  function SlideInPlayground({ open, onClose }) {
3195
- const { state } = chunkQW4RBGHN_cjs.usePlaygroundContext();
3195
+ const { state } = chunk7EYHNP3E_cjs.usePlaygroundContext();
3196
3196
  const ep = state.selectedEndpoint;
3197
3197
  const showResponse = state.response !== null || state.loading;
3198
3198
  const width = showResponse ? WIDTH_WIDE : WIDTH_NARROW;
@@ -3201,7 +3201,7 @@ function SlideInPlayground({ open, onClose }) {
3201
3201
  /* @__PURE__ */ jsxRuntime.jsx(components.SidePanel.Title, { children: "Playground" }),
3202
3202
  ep && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 min-w-0 flex-1", children: [
3203
3203
  /* @__PURE__ */ jsxRuntime.jsx(MethodBadge, { method: ep.method }),
3204
- /* @__PURE__ */ jsxRuntime.jsx("code", { className: "font-mono text-[11px] text-muted-foreground truncate", children: chunkQW4RBGHN_cjs.relativePath(ep.path) })
3204
+ /* @__PURE__ */ jsxRuntime.jsx("code", { className: "font-mono text-[11px] text-muted-foreground truncate", children: chunk7EYHNP3E_cjs.relativePath(ep.path) })
3205
3205
  ] }),
3206
3206
  /* @__PURE__ */ jsxRuntime.jsx(components.SidePanel.Close, { className: "ml-auto" })
3207
3207
  ] }),
@@ -3225,7 +3225,7 @@ function SlideInPlayground({ open, onClose }) {
3225
3225
  }
3226
3226
  chunkOLISEQHS_cjs.__name(SlideInPlayground, "SlideInPlayground");
3227
3227
  function TryItSheet({ open, onOpenChange }) {
3228
- const { state } = chunkQW4RBGHN_cjs.usePlaygroundContext();
3228
+ const { state } = chunk7EYHNP3E_cjs.usePlaygroundContext();
3229
3229
  const showResponse = state.response !== null || state.loading;
3230
3230
  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: [
3231
3231
  /* @__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" }) }),
@@ -3240,7 +3240,7 @@ function TryItSheet({ open, onOpenChange }) {
3240
3240
  }
3241
3241
  chunkOLISEQHS_cjs.__name(TryItSheet, "TryItSheet");
3242
3242
  var DocsLayout = /* @__PURE__ */ chunkOLISEQHS_cjs.__name(() => {
3243
- const { state, config, setSelectedEndpoint } = chunkQW4RBGHN_cjs.usePlaygroundContext();
3243
+ const { state, config, setSelectedEndpoint } = chunk7EYHNP3E_cjs.usePlaygroundContext();
3244
3244
  const isDesktop = hooks.useMediaQuery("(min-width: 1024px)");
3245
3245
  const isMobile = !isDesktop;
3246
3246
  const grouping = config.schemaGrouping ?? "selector";
@@ -3451,5 +3451,5 @@ var DocsLayout = /* @__PURE__ */ chunkOLISEQHS_cjs.__name(() => {
3451
3451
  }, "DocsLayout");
3452
3452
 
3453
3453
  exports.DocsLayout = DocsLayout;
3454
- //# sourceMappingURL=DocsLayout-QOSSLH22.cjs.map
3455
- //# sourceMappingURL=DocsLayout-QOSSLH22.cjs.map
3454
+ //# sourceMappingURL=DocsLayout-Q4KS3QWW.cjs.map
3455
+ //# sourceMappingURL=DocsLayout-Q4KS3QWW.cjs.map