zudoku 0.36.0 → 0.37.0

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 (110) hide show
  1. package/README.md +1 -1
  2. package/dist/config/validators/common.d.ts +252 -252
  3. package/dist/config/validators/common.js +4 -1
  4. package/dist/config/validators/common.js.map +1 -1
  5. package/dist/config/validators/validate.d.ts +95 -95
  6. package/dist/lib/components/InlineCode.d.ts +2 -1
  7. package/dist/lib/components/InlineCode.js +1 -1
  8. package/dist/lib/components/InlineCode.js.map +1 -1
  9. package/dist/lib/components/MobileTopNavigation.js +1 -1
  10. package/dist/lib/components/MobileTopNavigation.js.map +1 -1
  11. package/dist/lib/components/TopNavigation.d.ts +2 -2
  12. package/dist/lib/components/TopNavigation.js +9 -12
  13. package/dist/lib/components/TopNavigation.js.map +1 -1
  14. package/dist/lib/components/context/ZudokuContext.d.ts +1 -1
  15. package/dist/lib/components/context/ZudokuContext.js +9 -4
  16. package/dist/lib/components/context/ZudokuContext.js.map +1 -1
  17. package/dist/lib/components/navigation/SidebarCategory.d.ts +2 -2
  18. package/dist/lib/components/navigation/SidebarCategory.js +10 -6
  19. package/dist/lib/components/navigation/SidebarCategory.js.map +1 -1
  20. package/dist/lib/components/navigation/SidebarItem.js +2 -2
  21. package/dist/lib/components/navigation/SidebarItem.js.map +1 -1
  22. package/dist/lib/components/navigation/SidebarWrapper.js +1 -1
  23. package/dist/lib/components/navigation/SidebarWrapper.js.map +1 -1
  24. package/dist/lib/plugins/openapi/ParamInfos.js +12 -4
  25. package/dist/lib/plugins/openapi/ParamInfos.js.map +1 -1
  26. package/dist/lib/plugins/openapi/ParameterListItem.js +1 -1
  27. package/dist/lib/plugins/openapi/ParameterListItem.js.map +1 -1
  28. package/dist/lib/plugins/openapi/schema/SchemaPropertyItem.js +3 -3
  29. package/dist/lib/plugins/openapi/schema/SchemaPropertyItem.js.map +1 -1
  30. package/dist/lib/plugins/openapi/schema/SchemaView.js +13 -6
  31. package/dist/lib/plugins/openapi/schema/SchemaView.js.map +1 -1
  32. package/dist/lib/ui/Badge.d.ts +1 -1
  33. package/dist/lib/ui/Button.d.ts +1 -1
  34. package/dist/lib/ui/Button.js +1 -1
  35. package/dist/lib/ui/Button.js.map +1 -1
  36. package/dist/lib/ui/Command.d.ts +6 -6
  37. package/dist/lib/util/joinPath.d.ts +3 -0
  38. package/dist/lib/util/joinPath.js +3 -0
  39. package/dist/lib/util/joinPath.js.map +1 -1
  40. package/dist/vite/config.js +1 -1
  41. package/dist/vite/config.js.map +1 -1
  42. package/dist/vite/plugin-api.js +2 -2
  43. package/dist/vite/plugin-api.js.map +1 -1
  44. package/dist/vite/plugin-docs.d.ts +1 -1
  45. package/dist/vite/plugin-docs.js +18 -1
  46. package/dist/vite/plugin-docs.js.map +1 -1
  47. package/lib/{AuthenticationPlugin-Cr6xjOJD.js → AuthenticationPlugin-Cij2tPWa.js} +2 -2
  48. package/lib/{AuthenticationPlugin-Cr6xjOJD.js.map → AuthenticationPlugin-Cij2tPWa.js.map} +1 -1
  49. package/lib/{Spinner-C6n4eOvh.js → Button-Fp19CMUr.js} +15 -18
  50. package/lib/Button-Fp19CMUr.js.map +1 -0
  51. package/lib/{Markdown-BlioIqkZ.js → Markdown-DT5Rrq8_.js} +3520 -3260
  52. package/lib/Markdown-DT5Rrq8_.js.map +1 -0
  53. package/lib/{MdxPage-7XnN9J9R.js → MdxPage-D2rD1vC4.js} +3 -3
  54. package/lib/{MdxPage-7XnN9J9R.js.map → MdxPage-D2rD1vC4.js.map} +1 -1
  55. package/lib/{OasProvider-BaRRMSsD.js → OasProvider-DdEBf2qS.js} +3 -3
  56. package/lib/{OasProvider-BaRRMSsD.js.map → OasProvider-DdEBf2qS.js.map} +1 -1
  57. package/lib/{OperationList-BjL1hzSx.js → OperationList-DT4-gm_S.js} +880 -878
  58. package/lib/OperationList-DT4-gm_S.js.map +1 -0
  59. package/lib/{Select-FAYHOYTy.js → Select-z1Lwl0-J.js} +3 -3
  60. package/lib/{Select-FAYHOYTy.js.map → Select-z1Lwl0-J.js.map} +1 -1
  61. package/lib/{SlotletProvider-CXb3wQiR.js → SlotletProvider-D8OBnr77.js} +2 -2
  62. package/lib/{SlotletProvider-CXb3wQiR.js.map → SlotletProvider-D8OBnr77.js.map} +1 -1
  63. package/lib/Spinner-CE68iCm0.js +7 -0
  64. package/lib/Spinner-CE68iCm0.js.map +1 -0
  65. package/lib/{hook-Bo80UX00.js → hook-DzQC8PzJ.js} +78 -74
  66. package/lib/hook-DzQC8PzJ.js.map +1 -0
  67. package/lib/{index-D5m8_oyY.js → index-DdQSV2RF.js} +31 -31
  68. package/lib/{index-D5m8_oyY.js.map → index-DdQSV2RF.js.map} +1 -1
  69. package/lib/{useQuery-CQUwWR9i.js → joinUrl-BjDooT-T.js} +240 -223
  70. package/lib/joinUrl-BjDooT-T.js.map +1 -0
  71. package/lib/{mutation-B81DztCT.js → mutation-_Z5C2wFZ.js} +2 -2
  72. package/lib/{mutation-B81DztCT.js.map → mutation-_Z5C2wFZ.js.map} +1 -1
  73. package/lib/ui/ActionButton.js +11 -10
  74. package/lib/ui/ActionButton.js.map +1 -1
  75. package/lib/ui/Button.js +1 -1
  76. package/lib/ui/Button.js.map +1 -1
  77. package/lib/zudoku.auth-auth0.js +1 -1
  78. package/lib/zudoku.auth-clerk.js +2 -2
  79. package/lib/zudoku.auth-openid.js +3 -3
  80. package/lib/zudoku.components.js +188 -192
  81. package/lib/zudoku.components.js.map +1 -1
  82. package/lib/zudoku.hooks.js +1 -1
  83. package/lib/zudoku.plugin-api-catalog.js +3 -3
  84. package/lib/zudoku.plugin-api-keys.js +4 -4
  85. package/lib/zudoku.plugin-custom-pages.js +1 -1
  86. package/lib/zudoku.plugin-markdown.js +1 -1
  87. package/lib/zudoku.plugin-openapi.js +3 -3
  88. package/lib/zudoku.plugin-search-pagefind.js +15 -16
  89. package/lib/zudoku.plugin-search-pagefind.js.map +1 -1
  90. package/package.json +3 -1
  91. package/src/lib/components/InlineCode.tsx +3 -1
  92. package/src/lib/components/MobileTopNavigation.tsx +1 -1
  93. package/src/lib/components/TopNavigation.tsx +12 -16
  94. package/src/lib/components/context/ZudokuContext.ts +12 -4
  95. package/src/lib/components/navigation/SidebarCategory.tsx +15 -12
  96. package/src/lib/components/navigation/SidebarItem.tsx +2 -2
  97. package/src/lib/components/navigation/SidebarWrapper.tsx +2 -2
  98. package/src/lib/plugins/openapi/ParamInfos.tsx +27 -4
  99. package/src/lib/plugins/openapi/ParameterListItem.tsx +5 -1
  100. package/src/lib/plugins/openapi/schema/SchemaPropertyItem.tsx +5 -2
  101. package/src/lib/plugins/openapi/schema/SchemaView.tsx +48 -35
  102. package/src/lib/ui/Button.tsx +1 -1
  103. package/src/lib/util/joinPath.tsx +3 -0
  104. package/lib/Markdown-BlioIqkZ.js.map +0 -1
  105. package/lib/OperationList-BjL1hzSx.js.map +0 -1
  106. package/lib/Spinner-C6n4eOvh.js.map +0 -1
  107. package/lib/hook-Bo80UX00.js.map +0 -1
  108. package/lib/joinUrl-10po2Jdj.js +0 -20
  109. package/lib/joinUrl-10po2Jdj.js.map +0 -1
  110. package/lib/useQuery-CQUwWR9i.js.map +0 -1
@@ -3,12 +3,22 @@ import type { SchemaObject } from "../../../oas/parser/index.js";
3
3
  import { Card, CardContent, CardHeader, CardTitle } from "../../../ui/Card.js";
4
4
  import { cn } from "../../../util/cn.js";
5
5
  import { groupBy } from "../../../util/groupBy.js";
6
+ import { EnumValues } from "../components/EnumValues.js";
7
+ import { ParamInfos } from "../ParamInfos.js";
6
8
  import {
7
9
  SchemaLogicalGroup,
8
10
  SchemaPropertyItem,
9
11
  } from "./SchemaPropertyItem.js";
10
12
  import { hasLogicalGroupings } from "./utils.js";
11
13
 
14
+ const renderMarkdown = (content?: string) =>
15
+ content && (
16
+ <Markdown
17
+ className={cn(ProseClasses, "text-sm leading-normal line-clamp-4")}
18
+ content={content}
19
+ />
20
+ );
21
+
12
22
  export const SchemaView = ({
13
23
  schema,
14
24
  level = 0,
@@ -33,11 +43,33 @@ export const SchemaView = ({
33
43
  return <SchemaLogicalGroup schema={schema} level={level} />;
34
44
  }
35
45
 
36
- // Sometimes items is not defined
37
- // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
38
- if (schema.type === "array" && schema.items) {
46
+ if (Array.isArray(schema.type)) {
47
+ return (
48
+ <Card className="p-4 space-y-2">
49
+ <span className="text-sm text-muted-foreground">
50
+ <ParamInfos schema={schema} />
51
+ </span>
52
+ {schema.enum && <EnumValues values={schema.enum} />}
53
+ {renderMarkdown(schema.description)}
54
+ </Card>
55
+ );
56
+ }
57
+
58
+ if (schema.type === "array" && typeof schema.items === "object") {
39
59
  const itemsSchema = schema.items as SchemaObject;
40
60
 
61
+ if (itemsSchema.enum) {
62
+ return (
63
+ <Card className="p-4">
64
+ <span className="text-sm text-muted-foreground">
65
+ <ParamInfos schema={schema} />
66
+ </span>
67
+ <EnumValues values={itemsSchema.enum} />
68
+ {renderMarkdown(schema.description)}
69
+ </Card>
70
+ );
71
+ }
72
+
41
73
  if (
42
74
  typeof itemsSchema.type === "string" &&
43
75
  ["string", "number", "boolean", "integer"].includes(itemsSchema.type)
@@ -45,17 +77,9 @@ export const SchemaView = ({
45
77
  return (
46
78
  <Card className="p-4">
47
79
  <span className="text-sm text-muted-foreground">
48
- {itemsSchema.type}[]
80
+ <ParamInfos schema={schema} />
49
81
  </span>
50
- {schema.description && (
51
- <Markdown
52
- className={cn(
53
- ProseClasses,
54
- "text-sm leading-normal line-clamp-4",
55
- )}
56
- content={schema.description}
57
- />
58
- )}
82
+ {renderMarkdown(schema.description)}
59
83
  </Card>
60
84
  );
61
85
  } else if (itemsSchema.type === "object") {
@@ -75,18 +99,12 @@ export const SchemaView = ({
75
99
  (!schema.properties || Object.keys(schema.properties).length === 0)
76
100
  ) {
77
101
  return (
78
- <Card className="p-4 flex gap-2 items-center">
102
+ <Card className="p-4 flex gap-2 items-baseline">
79
103
  {"name" in schema && <>{schema.name as string}</>}
80
- <span className="text-sm text-muted-foreground">object</span>
81
- {schema.description && (
82
- <Markdown
83
- className={cn(
84
- ProseClasses,
85
- "text-sm leading-normal line-clamp-4",
86
- )}
87
- content={schema.description}
88
- />
89
- )}
104
+ <span className="text-sm text-muted-foreground">
105
+ <ParamInfos schema={schema} />
106
+ </span>
107
+ {renderMarkdown(schema.description)}
90
108
  </Card>
91
109
  );
92
110
  }
@@ -133,17 +151,12 @@ export const SchemaView = ({
133
151
  ["string", "number", "boolean", "integer", "null"].includes(schema.type)
134
152
  ) {
135
153
  return (
136
- <Card className="p-4">
137
- <span className="text-sm text-muted-foreground">{schema.type}</span>
138
- {schema.description && (
139
- <Markdown
140
- className={cn(
141
- ProseClasses,
142
- "text-sm leading-normal line-clamp-4",
143
- )}
144
- content={schema.description}
145
- />
146
- )}
154
+ <Card className="p-4 space-y-2">
155
+ <span className="text-sm text-muted-foreground">
156
+ <ParamInfos schema={schema} />
157
+ </span>
158
+ {schema.enum && <EnumValues values={schema.enum} />}
159
+ {renderMarkdown(schema.description)}
147
160
  </Card>
148
161
  );
149
162
  }
@@ -4,7 +4,7 @@ import * as React from "react";
4
4
  import { cn } from "../util/cn.js";
5
5
 
6
6
  export const buttonVariants = cva(
7
- "not-prose inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",
7
+ "not-prose inline-flex shrink-0 items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",
8
8
  {
9
9
  variants: {
10
10
  variant: {
@@ -1,3 +1,6 @@
1
+ /**
2
+ * @deprecated Use `joinUrl` instead.
3
+ */
1
4
  export const joinPath = (
2
5
  ...parts: Array<string | null | undefined | boolean>
3
6
  ) => {