zudoku 0.65.2 → 0.65.3

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 (32) hide show
  1. package/dist/lib/plugins/openapi/GeneratedExampleSidecarBox.js +1 -1
  2. package/dist/lib/plugins/openapi/ParameterList.js +1 -1
  3. package/dist/lib/plugins/openapi/ParameterList.js.map +1 -1
  4. package/dist/lib/plugins/openapi/ResponsesSidecarBox.d.ts +2 -1
  5. package/dist/lib/plugins/openapi/ResponsesSidecarBox.js +4 -3
  6. package/dist/lib/plugins/openapi/ResponsesSidecarBox.js.map +1 -1
  7. package/dist/lib/plugins/openapi/Sidecar.js +9 -1
  8. package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
  9. package/dist/lib/plugins/openapi/playground/Playground.js +5 -1
  10. package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
  11. package/lib/{OasProvider-D88vmZFt.js → OasProvider-CpniNNrW.js} +2 -2
  12. package/lib/{OasProvider-D88vmZFt.js.map → OasProvider-CpniNNrW.js.map} +1 -1
  13. package/lib/{OperationList-DeBe8FvT.js → OperationList-CmMoKpGu.js} +1141 -1121
  14. package/lib/OperationList-CmMoKpGu.js.map +1 -0
  15. package/lib/{SchemaList-DnlwQJCO.js → SchemaList-BykD27ga.js} +3 -3
  16. package/lib/{SchemaList-DnlwQJCO.js.map → SchemaList-BykD27ga.js.map} +1 -1
  17. package/lib/{SchemaView-CgDcUNbC.js → SchemaView-Dt6hbCAt.js} +2 -2
  18. package/lib/{SchemaView-CgDcUNbC.js.map → SchemaView-Dt6hbCAt.js.map} +1 -1
  19. package/lib/{circular-BpeO0esG.js → circular-CNHs4gAz.js} +2 -2
  20. package/lib/{circular-BpeO0esG.js.map → circular-CNHs4gAz.js.map} +1 -1
  21. package/lib/{createServer-DIptgGTi.js → createServer-BmcVQAOQ.js} +3 -3
  22. package/lib/{createServer-DIptgGTi.js.map → createServer-BmcVQAOQ.js.map} +1 -1
  23. package/lib/{index-C_-XS4lp.js → index-unv8c40u.js} +52 -48
  24. package/lib/{index-C_-XS4lp.js.map → index-unv8c40u.js.map} +1 -1
  25. package/lib/zudoku.plugin-openapi.js +1 -1
  26. package/package.json +1 -1
  27. package/src/lib/plugins/openapi/GeneratedExampleSidecarBox.tsx +1 -1
  28. package/src/lib/plugins/openapi/ParameterList.tsx +2 -2
  29. package/src/lib/plugins/openapi/ResponsesSidecarBox.tsx +22 -2
  30. package/src/lib/plugins/openapi/Sidecar.tsx +17 -1
  31. package/src/lib/plugins/openapi/playground/Playground.tsx +5 -1
  32. package/lib/OperationList-DeBe8FvT.js.map +0 -1
@@ -3,7 +3,7 @@ import "lucide-react";
3
3
  import "./chunk-PVWAREVJ-BMhpCH5D.js";
4
4
  import "./ui/Button.js";
5
5
  import "./ZudokuContext-BUZ5hkWB.js";
6
- import { y as e, U as n, z as s } from "./index-C_-XS4lp.js";
6
+ import { y as e, U as n, z as s } from "./index-unv8c40u.js";
7
7
  export {
8
8
  e as GetNavigationOperationsQuery,
9
9
  n as UNTAGGED_PATH,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zudoku",
3
- "version": "0.65.2",
3
+ "version": "0.65.3",
4
4
  "type": "module",
5
5
  "homepage": "https://zudoku.dev",
6
6
  "repository": {
@@ -22,7 +22,7 @@ export const GeneratedExampleSidecarBox = ({
22
22
  <SidecarBox.Root>
23
23
  <SidecarBox.Head className="text-xs flex justify-between items-center">
24
24
  <div className="flex items-center gap-1.5">
25
- <span className="font-medium">Request Body Example</span>
25
+ <span className="font-medium">Example Request Body</span>
26
26
  <TooltipProvider>
27
27
  <Tooltip>
28
28
  <TooltipTrigger asChild>
@@ -35,14 +35,14 @@ export const ParameterList = ({
35
35
  <Frame>
36
36
  <FramePanel className="p-0!">
37
37
  <ItemGroup className="overflow-clip">
38
- {sortedParameters.map((parameter) => (
38
+ {sortedParameters.map((parameter, index) => (
39
39
  <Fragment key={`${parameter.name}-${parameter.in}`}>
40
+ {index > 0 && <ItemSeparator />}
40
41
  <ParameterListItem
41
42
  parameter={parameter}
42
43
  id={id}
43
44
  group={group}
44
45
  />
45
- <ItemSeparator />
46
46
  </Fragment>
47
47
  ))}
48
48
  </ItemGroup>
@@ -1,4 +1,4 @@
1
- import { ChevronsDownUpIcon, ChevronsUpDownIcon } from "lucide-react";
1
+ import { ChevronsDownUpIcon, ChevronsUpDownIcon, InfoIcon } from "lucide-react";
2
2
  import { useEffect, useState } from "react";
3
3
  import { Button } from "zudoku/components";
4
4
  import {
@@ -7,6 +7,12 @@ import {
7
7
  CollapsibleTrigger,
8
8
  } from "zudoku/ui/Collapsible.js";
9
9
  import { NativeSelect, NativeSelectOption } from "zudoku/ui/NativeSelect.js";
10
+ import {
11
+ Tooltip,
12
+ TooltipContent,
13
+ TooltipProvider,
14
+ TooltipTrigger,
15
+ } from "zudoku/ui/Tooltip.js";
10
16
  import type { ResponseItem } from "./graphql/graphql.js";
11
17
  import * as SidecarBox from "./SidecarBox.js";
12
18
  import { SidecarExamples } from "./SidecarExamples.js";
@@ -16,11 +22,13 @@ export const ResponsesSidecarBox = ({
16
22
  selectedResponse,
17
23
  isOnScreen,
18
24
  shouldLazyHighlight,
25
+ isGenerated,
19
26
  }: {
20
27
  responses: ResponseItem[];
21
28
  selectedResponse?: string;
22
29
  isOnScreen: boolean;
23
30
  shouldLazyHighlight?: boolean;
31
+ isGenerated?: boolean;
24
32
  }) => {
25
33
  const [internalSelectedResponse, setInternalSelectedResponse] = useState(
26
34
  selectedResponse ?? responses[0]?.statusCode,
@@ -57,8 +65,20 @@ export const ResponsesSidecarBox = ({
57
65
  </Button>
58
66
  </CollapsibleTrigger>
59
67
  Example Responses
68
+ {isGenerated && (
69
+ <TooltipProvider>
70
+ <Tooltip>
71
+ <TooltipTrigger asChild>
72
+ <InfoIcon size={13} />
73
+ </TooltipTrigger>
74
+ <TooltipContent>
75
+ This example is auto-generated from the schema.
76
+ </TooltipContent>
77
+ </Tooltip>
78
+ </TooltipProvider>
79
+ )}
60
80
  </div>
61
- <div className="group-data-[state=closed]/collapsible:hidden">
81
+ <div className="group-data-[state=closed]/collapsible:invisible">
62
82
  <NativeSelect
63
83
  className="text-xs h-fit py-1 -my-1 bg-background"
64
84
  value={internalSelectedResponse}
@@ -267,7 +267,7 @@ export const Sidecar = ({
267
267
  />
268
268
  ) : null}
269
269
 
270
- {hasResponseExamples && (
270
+ {hasResponseExamples ? (
271
271
  <ResponsesSidecarBox
272
272
  isOnScreen={isOnScreen}
273
273
  shouldLazyHighlight={shouldLazyHighlight}
@@ -286,6 +286,22 @@ export const Sidecar = ({
286
286
  : response.content,
287
287
  }))}
288
288
  />
289
+ ) : (
290
+ <ResponsesSidecarBox
291
+ isGenerated
292
+ isOnScreen={isOnScreen}
293
+ shouldLazyHighlight={shouldLazyHighlight}
294
+ selectedResponse={selectedResponse}
295
+ responses={operation.responses.map((response) => ({
296
+ ...response,
297
+ content: response.content?.map((content) => ({
298
+ ...content,
299
+ examples: content.schema
300
+ ? [{ name: "", value: generateSchemaExample(content.schema) }]
301
+ : content.examples,
302
+ })),
303
+ }))}
304
+ />
289
305
  )}
290
306
  </aside>
291
307
  );
@@ -247,7 +247,11 @@ export const Playground = ({
247
247
 
248
248
  const request = new Request(
249
249
  createUrl(server ?? selectedServer, url, data),
250
- { method, headers, body },
250
+ {
251
+ method,
252
+ headers,
253
+ body: ["GET", "HEAD"].includes(method.toUpperCase()) ? null : body,
254
+ },
251
255
  );
252
256
 
253
257
  if (data.identity !== NO_IDENTITY) {