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.
- package/README.md +1 -1
- package/dist/config/validators/common.d.ts +252 -252
- package/dist/config/validators/common.js +4 -1
- package/dist/config/validators/common.js.map +1 -1
- package/dist/config/validators/validate.d.ts +95 -95
- package/dist/lib/components/InlineCode.d.ts +2 -1
- package/dist/lib/components/InlineCode.js +1 -1
- package/dist/lib/components/InlineCode.js.map +1 -1
- package/dist/lib/components/MobileTopNavigation.js +1 -1
- package/dist/lib/components/MobileTopNavigation.js.map +1 -1
- package/dist/lib/components/TopNavigation.d.ts +2 -2
- package/dist/lib/components/TopNavigation.js +9 -12
- package/dist/lib/components/TopNavigation.js.map +1 -1
- package/dist/lib/components/context/ZudokuContext.d.ts +1 -1
- package/dist/lib/components/context/ZudokuContext.js +9 -4
- package/dist/lib/components/context/ZudokuContext.js.map +1 -1
- package/dist/lib/components/navigation/SidebarCategory.d.ts +2 -2
- package/dist/lib/components/navigation/SidebarCategory.js +10 -6
- package/dist/lib/components/navigation/SidebarCategory.js.map +1 -1
- package/dist/lib/components/navigation/SidebarItem.js +2 -2
- package/dist/lib/components/navigation/SidebarItem.js.map +1 -1
- package/dist/lib/components/navigation/SidebarWrapper.js +1 -1
- package/dist/lib/components/navigation/SidebarWrapper.js.map +1 -1
- package/dist/lib/plugins/openapi/ParamInfos.js +12 -4
- package/dist/lib/plugins/openapi/ParamInfos.js.map +1 -1
- package/dist/lib/plugins/openapi/ParameterListItem.js +1 -1
- package/dist/lib/plugins/openapi/ParameterListItem.js.map +1 -1
- package/dist/lib/plugins/openapi/schema/SchemaPropertyItem.js +3 -3
- package/dist/lib/plugins/openapi/schema/SchemaPropertyItem.js.map +1 -1
- package/dist/lib/plugins/openapi/schema/SchemaView.js +13 -6
- package/dist/lib/plugins/openapi/schema/SchemaView.js.map +1 -1
- package/dist/lib/ui/Badge.d.ts +1 -1
- package/dist/lib/ui/Button.d.ts +1 -1
- package/dist/lib/ui/Button.js +1 -1
- package/dist/lib/ui/Button.js.map +1 -1
- package/dist/lib/ui/Command.d.ts +6 -6
- package/dist/lib/util/joinPath.d.ts +3 -0
- package/dist/lib/util/joinPath.js +3 -0
- package/dist/lib/util/joinPath.js.map +1 -1
- package/dist/vite/config.js +1 -1
- package/dist/vite/config.js.map +1 -1
- package/dist/vite/plugin-api.js +2 -2
- package/dist/vite/plugin-api.js.map +1 -1
- package/dist/vite/plugin-docs.d.ts +1 -1
- package/dist/vite/plugin-docs.js +18 -1
- package/dist/vite/plugin-docs.js.map +1 -1
- package/lib/{AuthenticationPlugin-Cr6xjOJD.js → AuthenticationPlugin-Cij2tPWa.js} +2 -2
- package/lib/{AuthenticationPlugin-Cr6xjOJD.js.map → AuthenticationPlugin-Cij2tPWa.js.map} +1 -1
- package/lib/{Spinner-C6n4eOvh.js → Button-Fp19CMUr.js} +15 -18
- package/lib/Button-Fp19CMUr.js.map +1 -0
- package/lib/{Markdown-BlioIqkZ.js → Markdown-DT5Rrq8_.js} +3520 -3260
- package/lib/Markdown-DT5Rrq8_.js.map +1 -0
- package/lib/{MdxPage-7XnN9J9R.js → MdxPage-D2rD1vC4.js} +3 -3
- package/lib/{MdxPage-7XnN9J9R.js.map → MdxPage-D2rD1vC4.js.map} +1 -1
- package/lib/{OasProvider-BaRRMSsD.js → OasProvider-DdEBf2qS.js} +3 -3
- package/lib/{OasProvider-BaRRMSsD.js.map → OasProvider-DdEBf2qS.js.map} +1 -1
- package/lib/{OperationList-BjL1hzSx.js → OperationList-DT4-gm_S.js} +880 -878
- package/lib/OperationList-DT4-gm_S.js.map +1 -0
- package/lib/{Select-FAYHOYTy.js → Select-z1Lwl0-J.js} +3 -3
- package/lib/{Select-FAYHOYTy.js.map → Select-z1Lwl0-J.js.map} +1 -1
- package/lib/{SlotletProvider-CXb3wQiR.js → SlotletProvider-D8OBnr77.js} +2 -2
- package/lib/{SlotletProvider-CXb3wQiR.js.map → SlotletProvider-D8OBnr77.js.map} +1 -1
- package/lib/Spinner-CE68iCm0.js +7 -0
- package/lib/Spinner-CE68iCm0.js.map +1 -0
- package/lib/{hook-Bo80UX00.js → hook-DzQC8PzJ.js} +78 -74
- package/lib/hook-DzQC8PzJ.js.map +1 -0
- package/lib/{index-D5m8_oyY.js → index-DdQSV2RF.js} +31 -31
- package/lib/{index-D5m8_oyY.js.map → index-DdQSV2RF.js.map} +1 -1
- package/lib/{useQuery-CQUwWR9i.js → joinUrl-BjDooT-T.js} +240 -223
- package/lib/joinUrl-BjDooT-T.js.map +1 -0
- package/lib/{mutation-B81DztCT.js → mutation-_Z5C2wFZ.js} +2 -2
- package/lib/{mutation-B81DztCT.js.map → mutation-_Z5C2wFZ.js.map} +1 -1
- package/lib/ui/ActionButton.js +11 -10
- package/lib/ui/ActionButton.js.map +1 -1
- package/lib/ui/Button.js +1 -1
- package/lib/ui/Button.js.map +1 -1
- package/lib/zudoku.auth-auth0.js +1 -1
- package/lib/zudoku.auth-clerk.js +2 -2
- package/lib/zudoku.auth-openid.js +3 -3
- package/lib/zudoku.components.js +188 -192
- package/lib/zudoku.components.js.map +1 -1
- package/lib/zudoku.hooks.js +1 -1
- package/lib/zudoku.plugin-api-catalog.js +3 -3
- package/lib/zudoku.plugin-api-keys.js +4 -4
- package/lib/zudoku.plugin-custom-pages.js +1 -1
- package/lib/zudoku.plugin-markdown.js +1 -1
- package/lib/zudoku.plugin-openapi.js +3 -3
- package/lib/zudoku.plugin-search-pagefind.js +15 -16
- package/lib/zudoku.plugin-search-pagefind.js.map +1 -1
- package/package.json +3 -1
- package/src/lib/components/InlineCode.tsx +3 -1
- package/src/lib/components/MobileTopNavigation.tsx +1 -1
- package/src/lib/components/TopNavigation.tsx +12 -16
- package/src/lib/components/context/ZudokuContext.ts +12 -4
- package/src/lib/components/navigation/SidebarCategory.tsx +15 -12
- package/src/lib/components/navigation/SidebarItem.tsx +2 -2
- package/src/lib/components/navigation/SidebarWrapper.tsx +2 -2
- package/src/lib/plugins/openapi/ParamInfos.tsx +27 -4
- package/src/lib/plugins/openapi/ParameterListItem.tsx +5 -1
- package/src/lib/plugins/openapi/schema/SchemaPropertyItem.tsx +5 -2
- package/src/lib/plugins/openapi/schema/SchemaView.tsx +48 -35
- package/src/lib/ui/Button.tsx +1 -1
- package/src/lib/util/joinPath.tsx +3 -0
- package/lib/Markdown-BlioIqkZ.js.map +0 -1
- package/lib/OperationList-BjL1hzSx.js.map +0 -1
- package/lib/Spinner-C6n4eOvh.js.map +0 -1
- package/lib/hook-Bo80UX00.js.map +0 -1
- package/lib/joinUrl-10po2Jdj.js +0 -20
- package/lib/joinUrl-10po2Jdj.js.map +0 -1
- 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
|
-
|
|
37
|
-
|
|
38
|
-
|
|
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
|
-
{
|
|
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-
|
|
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">
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
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">
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
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
|
}
|
package/src/lib/ui/Button.tsx
CHANGED
|
@@ -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: {
|