zudoku 0.1.1-dev.47 → 0.1.1-dev.49
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/app/App.js +5 -5
- package/dist/app/App.js.map +1 -1
- package/dist/app/main.js +8 -0
- package/dist/app/main.js.map +1 -1
- package/dist/cli/common/analytics/lib.js +1 -1
- package/dist/cli/common/analytics/lib.js.map +1 -1
- package/dist/cli/common/logger.js +1 -1
- package/dist/lib/authentication/clerk.js +0 -1
- package/dist/lib/authentication/clerk.js.map +1 -1
- package/dist/lib/authentication/openid.js +3 -2
- package/dist/lib/authentication/openid.js.map +1 -1
- package/dist/lib/components/Header.d.ts +1 -1
- package/dist/lib/components/Header.js +1 -1
- package/dist/lib/components/Header.js.map +1 -1
- package/dist/lib/components/Select.js +1 -1
- package/dist/lib/components/Select.js.map +1 -1
- package/dist/lib/components/context/ComponentsContext.d.ts +1 -1
- package/dist/lib/components/index.d.ts +0 -1
- package/dist/lib/components/index.js +0 -1
- package/dist/lib/components/index.js.map +1 -1
- package/dist/lib/components/navigation/SideNavigationItem.js +1 -2
- package/dist/lib/components/navigation/SideNavigationItem.js.map +1 -1
- package/dist/lib/components/navigation/SideNavigationWrapper.js +3 -1
- package/dist/lib/components/navigation/SideNavigationWrapper.js.map +1 -1
- package/dist/lib/core/DevPortalContext.d.ts +3 -5
- package/dist/lib/core/DevPortalContext.js.map +1 -1
- package/dist/lib/oas/graphql/index.js +2 -2
- package/dist/lib/oas/graphql/index.js.map +1 -1
- package/dist/lib/plugins/api-key/SettingsApiKeys.js +1 -1
- package/dist/lib/plugins/api-key/SettingsApiKeys.js.map +1 -1
- package/dist/lib/plugins/api-key/index.d.ts +2 -2
- package/dist/lib/plugins/api-key/index.js +2 -2
- package/dist/lib/plugins/api-key/index.js.map +1 -1
- package/dist/lib/plugins/markdown/MdxPage.js +7 -7
- package/dist/lib/plugins/markdown/MdxPage.js.map +1 -1
- package/dist/lib/plugins/openapi/ColorizedParam.js +1 -1
- package/dist/lib/plugins/openapi/MakeRequest.js +4 -4
- package/dist/lib/plugins/openapi/MakeRequest.js.map +1 -1
- package/dist/lib/plugins/openapi/OperationList.js +8 -1
- package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
- package/dist/lib/plugins/openapi/OperationListItem.js +2 -2
- package/dist/lib/plugins/openapi/OperationListItem.js.map +1 -1
- package/dist/lib/plugins/openapi/ResponsesSidecarBox.js +1 -1
- package/dist/lib/plugins/openapi/ResponsesSidecarBox.js.map +1 -1
- package/dist/lib/plugins/openapi/SchemaListView.js +6 -6
- package/dist/lib/plugins/openapi/SchemaListView.js.map +1 -1
- package/dist/lib/plugins/openapi/Sidecar.js +2 -2
- package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
- package/dist/lib/plugins/openapi/graphql/gql.d.ts +2 -2
- package/dist/lib/plugins/openapi/graphql/gql.js +1 -1
- package/dist/lib/plugins/openapi/graphql/gql.js.map +1 -1
- package/dist/lib/plugins/openapi/graphql/graphql.d.ts +8 -0
- package/dist/lib/plugins/openapi/graphql/graphql.js +46 -0
- package/dist/lib/plugins/openapi/graphql/graphql.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/PathParams.js +4 -4
- package/dist/lib/plugins/openapi/playground/PathParams.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/Playground.d.ts +1 -0
- package/dist/lib/plugins/openapi/playground/Playground.js +29 -21
- package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/QueryParams.js +4 -5
- package/dist/lib/plugins/openapi/playground/QueryParams.js.map +1 -1
- package/dist/lib/plugins/openapi/util/generateSchemaExample.js +0 -1
- package/dist/lib/plugins/openapi/util/generateSchemaExample.js.map +1 -1
- package/dist/lib/plugins/openapi/worker/createSharedWorkerClient.js +1 -0
- package/dist/lib/plugins/openapi/worker/createSharedWorkerClient.js.map +1 -1
- package/dist/lib/ui/Button.d.ts +3 -7
- package/dist/lib/ui/Button.js +3 -26
- package/dist/lib/ui/Button.js.map +1 -1
- package/dist/lib/ui/button-variants.d.ts +4 -0
- package/dist/lib/ui/button-variants.js +24 -0
- package/dist/lib/ui/button-variants.js.map +1 -0
- package/dist/lib/util/MdxComponents.js +7 -7
- package/dist/lib/util/MdxComponents.js.map +1 -1
- package/dist/ts.js +1 -2
- package/dist/ts.js.map +1 -1
- package/dist/vite/config.js +1 -1
- package/dist/vite/dev-server.js +5 -4
- package/dist/vite/dev-server.js.map +1 -1
- package/dist/vite/plugin-api.js +1 -1
- package/dist/vite/plugin-api.js.map +1 -1
- package/dist/vite/plugin-component.js +1 -1
- package/dist/vite/plugin-component.js.map +1 -1
- package/dist/vite/plugin-docs.js +1 -1
- package/dist/vite/plugin-docs.js.map +1 -1
- package/dist/vite/plugin-docs.test.js +1 -1
- package/dist/vite/plugin-docs.test.js.map +1 -1
- package/lib/{Spinner-DEkC7JSn.js → Spinner-DoNe5ql0.js} +18 -18
- package/lib/assets/{worker-W78u54MC.js → worker-BCcpCNJ7.js} +2 -2
- package/lib/zudoku.auth-clerk.js +1 -1
- package/lib/zudoku.components.js +278 -281
- package/lib/zudoku.openapi-worker.js +5 -5
- package/lib/zudoku.plugins.js +9963 -9732
- package/package.json +4 -1
- package/src/app/App.tsx +5 -5
- package/src/app/main.tsx +9 -0
- package/src/lib/authentication/clerk.ts +0 -1
- package/src/lib/authentication/openid.ts +4 -2
- package/src/lib/components/Header.tsx +1 -1
- package/src/lib/components/Select.tsx +3 -3
- package/src/lib/components/index.ts +0 -1
- package/src/lib/components/navigation/SideNavigationItem.tsx +1 -2
- package/src/lib/components/navigation/SideNavigationWrapper.tsx +18 -16
- package/src/lib/core/DevPortalContext.ts +3 -6
- package/src/lib/oas/graphql/index.ts +2 -2
- package/src/lib/plugins/api-key/SettingsApiKeys.tsx +1 -1
- package/src/lib/plugins/api-key/index.tsx +4 -4
- package/src/lib/plugins/markdown/MdxPage.tsx +13 -8
- package/src/lib/plugins/openapi/ColorizedParam.tsx +1 -1
- package/src/lib/plugins/openapi/MakeRequest.tsx +4 -4
- package/src/lib/plugins/openapi/OperationList.tsx +8 -1
- package/src/lib/plugins/openapi/OperationListItem.tsx +2 -2
- package/src/lib/plugins/openapi/ResponsesSidecarBox.tsx +1 -1
- package/src/lib/plugins/openapi/SchemaListView.tsx +9 -10
- package/src/lib/plugins/openapi/Sidecar.tsx +3 -3
- package/src/lib/plugins/openapi/graphql/gql.ts +3 -3
- package/src/lib/plugins/openapi/graphql/graphql.ts +54 -0
- package/src/lib/plugins/openapi/playground/PathParams.tsx +4 -4
- package/src/lib/plugins/openapi/playground/Playground.tsx +80 -36
- package/src/lib/plugins/openapi/playground/QueryParams.tsx +4 -6
- package/src/lib/plugins/openapi/util/generateSchemaExample.ts +0 -1
- package/src/lib/plugins/openapi/worker/createSharedWorkerClient.ts +1 -0
- package/src/lib/ui/Button.tsx +11 -42
- package/src/lib/ui/button-variants.ts +31 -0
- package/src/lib/util/MdxComponents.tsx +31 -7
- package/dist/lib/components/DynamicIcon.d.ts +0 -6
- package/dist/lib/components/DynamicIcon.js +0 -6
- package/dist/lib/components/DynamicIcon.js.map +0 -1
- package/dist/lib/oas/graphql/server.d.ts +0 -1
- package/dist/lib/oas/graphql/server.js +0 -8
- package/dist/lib/oas/graphql/server.js.map +0 -1
- package/src/lib/components/DynamicIcon.tsx +0 -60
- package/src/lib/oas/graphql/server.ts +0 -10
|
@@ -1,27 +1,32 @@
|
|
|
1
|
+
import { VisuallyHidden } from "@radix-ui/react-visually-hidden";
|
|
2
|
+
import { useMutation } from "@tanstack/react-query";
|
|
3
|
+
import { CirclePlayIcon } from "lucide-react";
|
|
4
|
+
import { Fragment } from "react";
|
|
5
|
+
import { FormProvider, useForm } from "react-hook-form";
|
|
6
|
+
import { useApiIdentities } from "../../../components/context/DevPortalProvider.js";
|
|
1
7
|
import {
|
|
2
8
|
Dialog,
|
|
3
9
|
DialogContent,
|
|
4
|
-
DialogDescription,
|
|
5
|
-
DialogHeader,
|
|
6
10
|
DialogTitle,
|
|
7
11
|
DialogTrigger,
|
|
8
12
|
} from "../../../components/Dialog.js";
|
|
9
|
-
import {
|
|
13
|
+
import {
|
|
14
|
+
Select,
|
|
15
|
+
SelectContent,
|
|
16
|
+
SelectItem,
|
|
17
|
+
SelectTrigger,
|
|
18
|
+
SelectValue,
|
|
19
|
+
} from "../../../components/Select.js";
|
|
20
|
+
import { Spinner } from "../../../components/Spinner.js";
|
|
21
|
+
import { SyntaxHighlight } from "../../../components/SyntaxHighlight.js";
|
|
10
22
|
import { Button } from "../../../ui/Button.js";
|
|
23
|
+
import { Card } from "../../../ui/Card.js";
|
|
11
24
|
import { Tabs, TabsContent, TabsList, TabsTrigger } from "../../../ui/Tabs.js";
|
|
12
|
-
import { Fragment, useMemo } from "react";
|
|
13
|
-
import { SyntaxHighlight } from "../../../components/SyntaxHighlight.js";
|
|
14
25
|
import { ColorizedParam } from "../ColorizedParam.js";
|
|
15
|
-
import {
|
|
16
|
-
import { FormProvider, useForm } from "react-hook-form";
|
|
26
|
+
import { createUrl } from "./createUrl.js";
|
|
17
27
|
import { Headers } from "./Headers.js";
|
|
18
|
-
import { QueryParams } from "./QueryParams.js";
|
|
19
28
|
import { PathParams } from "./PathParams.js";
|
|
20
|
-
import {
|
|
21
|
-
import { createUrl } from "./createUrl.js";
|
|
22
|
-
import { UrlDisplay } from "./UrlDisplay.js";
|
|
23
|
-
import { useApiIdentities } from "../../../components/context/DevPortalProvider.js";
|
|
24
|
-
import { Spinner } from "../../../components/Spinner.js";
|
|
29
|
+
import { QueryParams } from "./QueryParams.js";
|
|
25
30
|
|
|
26
31
|
function mimeTypeToLanguage(mimeType: string) {
|
|
27
32
|
const mimeTypeMapping = {
|
|
@@ -72,8 +77,11 @@ export type PlaygroundForm = {
|
|
|
72
77
|
queryParams: QueryParam[];
|
|
73
78
|
pathParams: PathParam[];
|
|
74
79
|
headers: Header[];
|
|
80
|
+
identity?: string;
|
|
75
81
|
};
|
|
76
82
|
|
|
83
|
+
const NO_IDENTITY = "__none";
|
|
84
|
+
|
|
77
85
|
const Playground = ({
|
|
78
86
|
url,
|
|
79
87
|
host,
|
|
@@ -98,6 +106,7 @@ const Playground = ({
|
|
|
98
106
|
queryParams,
|
|
99
107
|
headers,
|
|
100
108
|
pathParams,
|
|
109
|
+
identity: NO_IDENTITY,
|
|
101
110
|
},
|
|
102
111
|
});
|
|
103
112
|
const formState = watch();
|
|
@@ -107,7 +116,8 @@ const Playground = ({
|
|
|
107
116
|
mutationFn: async (data: PlaygroundForm) => {
|
|
108
117
|
const requestUrl = createUrl(host, url, data);
|
|
109
118
|
const start = performance.now();
|
|
110
|
-
|
|
119
|
+
|
|
120
|
+
const request = new Request(requestUrl, {
|
|
111
121
|
method: method.toUpperCase(),
|
|
112
122
|
headers: Object.fromEntries(
|
|
113
123
|
data.pathParams
|
|
@@ -116,6 +126,14 @@ const Playground = ({
|
|
|
116
126
|
),
|
|
117
127
|
});
|
|
118
128
|
|
|
129
|
+
if (data.identity !== NO_IDENTITY) {
|
|
130
|
+
identities.data
|
|
131
|
+
.find((i) => i.id === data.identity)
|
|
132
|
+
?.authorizeRequest(request);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
const response = await fetch(request);
|
|
136
|
+
|
|
119
137
|
const body = await response.text();
|
|
120
138
|
|
|
121
139
|
return {
|
|
@@ -134,9 +152,6 @@ const Playground = ({
|
|
|
134
152
|
<ColorizedParam
|
|
135
153
|
name={part}
|
|
136
154
|
backgroundOpacity="0"
|
|
137
|
-
onClick={() => {
|
|
138
|
-
console.log("asd");
|
|
139
|
-
}}
|
|
140
155
|
slug={part.slice(1, -1)}
|
|
141
156
|
>
|
|
142
157
|
{
|
|
@@ -176,7 +191,13 @@ const Playground = ({
|
|
|
176
191
|
/>
|
|
177
192
|
</DialogTrigger>
|
|
178
193
|
|
|
179
|
-
<DialogContent
|
|
194
|
+
<DialogContent
|
|
195
|
+
className="max-w-screen-xl w-full h-5/6 overflow-auto p-0"
|
|
196
|
+
aria-describedby={undefined}
|
|
197
|
+
>
|
|
198
|
+
<VisuallyHidden>
|
|
199
|
+
<DialogTitle>Playground</DialogTitle>
|
|
200
|
+
</VisuallyHidden>
|
|
180
201
|
<FormProvider {...{ register, control, handleSubmit, watch, ...form }}>
|
|
181
202
|
<form
|
|
182
203
|
onSubmit={handleSubmit((data) => {
|
|
@@ -201,24 +222,47 @@ const Playground = ({
|
|
|
201
222
|
</Button>
|
|
202
223
|
</div>
|
|
203
224
|
<Tabs defaultValue={hasParams ? "parameters" : "headers"}>
|
|
204
|
-
<
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
<TabsTrigger value="headers">
|
|
209
|
-
Headers{" "}
|
|
210
|
-
{formState.headers.length > 0 &&
|
|
211
|
-
`(${formState.headers.length})`}
|
|
212
|
-
</TabsTrigger>
|
|
213
|
-
<TabsTrigger
|
|
214
|
-
value="body"
|
|
215
|
-
disabled={["POST", "PUT", "PATCH", "DELETE"].includes(
|
|
216
|
-
method.toUpperCase(),
|
|
225
|
+
<div className="flex justify-between">
|
|
226
|
+
<TabsList>
|
|
227
|
+
{hasParams && (
|
|
228
|
+
<TabsTrigger value="parameters">Parameters</TabsTrigger>
|
|
217
229
|
)}
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
230
|
+
<TabsTrigger value="headers">
|
|
231
|
+
Headers{" "}
|
|
232
|
+
{formState.headers.length > 0 &&
|
|
233
|
+
`(${formState.headers.length})`}
|
|
234
|
+
</TabsTrigger>
|
|
235
|
+
<TabsTrigger
|
|
236
|
+
value="body"
|
|
237
|
+
disabled={["POST", "PUT", "PATCH", "DELETE"].includes(
|
|
238
|
+
method.toUpperCase(),
|
|
239
|
+
)}
|
|
240
|
+
>
|
|
241
|
+
Body
|
|
242
|
+
</TabsTrigger>
|
|
243
|
+
</TabsList>
|
|
244
|
+
<div className="flex gap-2 items-center">
|
|
245
|
+
Auth:
|
|
246
|
+
<Select
|
|
247
|
+
onValueChange={(value) =>
|
|
248
|
+
form.setValue("identity", value)
|
|
249
|
+
}
|
|
250
|
+
defaultValue={formState.identity}
|
|
251
|
+
>
|
|
252
|
+
<SelectTrigger className="w-[180px]">
|
|
253
|
+
<SelectValue />
|
|
254
|
+
</SelectTrigger>
|
|
255
|
+
<SelectContent align="center">
|
|
256
|
+
<SelectItem value={NO_IDENTITY}>None</SelectItem>
|
|
257
|
+
{identities.data.map((identity) => (
|
|
258
|
+
<SelectItem key={identity.id} value={identity.id}>
|
|
259
|
+
{identity.label}
|
|
260
|
+
</SelectItem>
|
|
261
|
+
))}
|
|
262
|
+
</SelectContent>
|
|
263
|
+
</Select>
|
|
264
|
+
</div>
|
|
265
|
+
</div>
|
|
222
266
|
<TabsContent value="headers">
|
|
223
267
|
<Headers
|
|
224
268
|
control={control}
|
|
@@ -283,7 +327,7 @@ const Playground = ({
|
|
|
283
327
|
noBackground
|
|
284
328
|
className="overflow-x-auto "
|
|
285
329
|
code={
|
|
286
|
-
queryMutation.data
|
|
330
|
+
queryMutation.data.body ?? JSON.stringify("")
|
|
287
331
|
}
|
|
288
332
|
/>
|
|
289
333
|
</Card>
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import logger from "loglevel";
|
|
2
|
+
import { XIcon } from "lucide-react";
|
|
3
|
+
import { useEffect } from "react";
|
|
1
4
|
import {
|
|
2
5
|
Control,
|
|
3
6
|
Controller,
|
|
@@ -5,10 +8,8 @@ import {
|
|
|
5
8
|
useFormContext,
|
|
6
9
|
useWatch,
|
|
7
10
|
} from "react-hook-form";
|
|
8
|
-
import { XIcon } from "lucide-react";
|
|
9
11
|
import { InlineInput } from "./InlineInput.js";
|
|
10
12
|
import { PlaygroundForm } from "./Playground.js";
|
|
11
|
-
import { useEffect } from "react";
|
|
12
13
|
|
|
13
14
|
const QueryParamActive = ({
|
|
14
15
|
i,
|
|
@@ -20,13 +21,10 @@ const QueryParamActive = ({
|
|
|
20
21
|
const value = useWatch({ control, name: `queryParams.${i}.value` });
|
|
21
22
|
const active = useWatch({ control, name: `queryParams.${i}.active` });
|
|
22
23
|
const form = useFormContext<PlaygroundForm>();
|
|
23
|
-
const dirty = form.formState.dirtyFields;
|
|
24
|
-
|
|
25
|
-
console.log("dirty fields", dirty);
|
|
26
24
|
|
|
27
25
|
useEffect(() => {
|
|
28
26
|
if (value) {
|
|
29
|
-
|
|
27
|
+
logger.log(`queryParams.${i}.active`, active);
|
|
30
28
|
form.setValue(`queryParams.${i}.active`, true);
|
|
31
29
|
}
|
|
32
30
|
}, [value]);
|
|
@@ -50,7 +50,6 @@ function processComplexTypes(schema: SchemaObject, name?: string): any {
|
|
|
50
50
|
|
|
51
51
|
function getDefaultForType(type?: string | string[]): any {
|
|
52
52
|
if (Array.isArray(type)) {
|
|
53
|
-
debugger;
|
|
54
53
|
return getDefaultForSingleType(type[0]);
|
|
55
54
|
}
|
|
56
55
|
return getDefaultForSingleType(type);
|
package/src/lib/ui/Button.tsx
CHANGED
|
@@ -1,56 +1,25 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
1
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
2
|
+
import { VariantProps } from "class-variance-authority";
|
|
3
|
+
import * as React from "react";
|
|
4
4
|
import { cn } from "../util/cn.js";
|
|
5
|
-
|
|
6
|
-
const buttonVariants = cva(
|
|
7
|
-
"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",
|
|
8
|
-
{
|
|
9
|
-
variants: {
|
|
10
|
-
variant: {
|
|
11
|
-
default:
|
|
12
|
-
"bg-primary text-primary-foreground shadow hover:bg-primary/90",
|
|
13
|
-
destructive:
|
|
14
|
-
"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",
|
|
15
|
-
outline:
|
|
16
|
-
"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",
|
|
17
|
-
secondary:
|
|
18
|
-
"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",
|
|
19
|
-
ghost: "hover:bg-accent hover:text-accent-foreground",
|
|
20
|
-
link: "text-primary underline-offset-4 hover:underline",
|
|
21
|
-
},
|
|
22
|
-
size: {
|
|
23
|
-
default: "h-9 px-4 py-2",
|
|
24
|
-
sm: "h-8 rounded-md px-3 text-xs",
|
|
25
|
-
lg: "h-10 rounded-md px-8",
|
|
26
|
-
icon: "h-9 w-9",
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
defaultVariants: {
|
|
30
|
-
variant: "default",
|
|
31
|
-
size: "default",
|
|
32
|
-
},
|
|
33
|
-
}
|
|
34
|
-
)
|
|
5
|
+
import { buttonVariants } from "./button-variants.js";
|
|
35
6
|
|
|
36
7
|
export interface ButtonProps
|
|
37
8
|
extends React.ButtonHTMLAttributes<HTMLButtonElement>,
|
|
38
9
|
VariantProps<typeof buttonVariants> {
|
|
39
|
-
asChild?: boolean
|
|
10
|
+
asChild?: boolean;
|
|
40
11
|
}
|
|
41
12
|
|
|
42
|
-
const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
|
13
|
+
export const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
|
43
14
|
({ className, variant, size, asChild = false, ...props }, ref) => {
|
|
44
|
-
const Comp = asChild ? Slot : "button"
|
|
15
|
+
const Comp = asChild ? Slot : "button";
|
|
45
16
|
return (
|
|
46
17
|
<Comp
|
|
47
18
|
className={cn(buttonVariants({ variant, size, className }))}
|
|
48
19
|
ref={ref}
|
|
49
20
|
{...props}
|
|
50
21
|
/>
|
|
51
|
-
)
|
|
52
|
-
}
|
|
53
|
-
)
|
|
54
|
-
Button.displayName = "Button"
|
|
55
|
-
|
|
56
|
-
export { Button, buttonVariants }
|
|
22
|
+
);
|
|
23
|
+
},
|
|
24
|
+
);
|
|
25
|
+
Button.displayName = "Button";
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { cva } from "class-variance-authority";
|
|
2
|
+
|
|
3
|
+
export const buttonVariants = cva(
|
|
4
|
+
"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",
|
|
5
|
+
{
|
|
6
|
+
variants: {
|
|
7
|
+
variant: {
|
|
8
|
+
default:
|
|
9
|
+
"bg-primary text-primary-foreground shadow hover:bg-primary/90",
|
|
10
|
+
destructive:
|
|
11
|
+
"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",
|
|
12
|
+
outline:
|
|
13
|
+
"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",
|
|
14
|
+
secondary:
|
|
15
|
+
"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",
|
|
16
|
+
ghost: "hover:bg-accent hover:text-accent-foreground",
|
|
17
|
+
link: "text-primary underline-offset-4 hover:underline",
|
|
18
|
+
},
|
|
19
|
+
size: {
|
|
20
|
+
default: "h-9 px-4 py-2",
|
|
21
|
+
sm: "h-8 rounded-md px-3 text-xs",
|
|
22
|
+
lg: "h-10 rounded-md px-8",
|
|
23
|
+
icon: "h-9 w-9",
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
defaultVariants: {
|
|
27
|
+
variant: "default",
|
|
28
|
+
size: "default",
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
);
|
|
@@ -18,17 +18,41 @@ export const MdxComponents = {
|
|
|
18
18
|
}
|
|
19
19
|
return <img {...props} className="rounded-md" />;
|
|
20
20
|
},
|
|
21
|
-
h1: ({ children, id }) =>
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
21
|
+
h1: ({ children, id }) => (
|
|
22
|
+
<Heading level={1} id={id}>
|
|
23
|
+
{children}
|
|
24
|
+
</Heading>
|
|
25
|
+
),
|
|
26
|
+
h2: ({ children, id }) => (
|
|
27
|
+
<Heading level={2} id={id}>
|
|
28
|
+
{children}
|
|
29
|
+
</Heading>
|
|
30
|
+
),
|
|
31
|
+
h3: ({ children, id }) => (
|
|
32
|
+
<Heading level={3} id={id}>
|
|
33
|
+
{children}
|
|
34
|
+
</Heading>
|
|
35
|
+
),
|
|
36
|
+
h4: ({ children, id }) => (
|
|
37
|
+
<Heading level={4} id={id}>
|
|
38
|
+
{children}
|
|
39
|
+
</Heading>
|
|
40
|
+
),
|
|
41
|
+
h5: ({ children, id }) => (
|
|
42
|
+
<Heading level={5} id={id}>
|
|
43
|
+
{children}
|
|
44
|
+
</Heading>
|
|
45
|
+
),
|
|
46
|
+
h6: ({ children, id }) => (
|
|
47
|
+
<Heading level={6} id={id}>
|
|
48
|
+
{children}
|
|
49
|
+
</Heading>
|
|
50
|
+
),
|
|
27
51
|
a: ({ href, ...props }) =>
|
|
28
52
|
href && !href.startsWith("http") ? (
|
|
29
53
|
<Link to={href} relative="path" {...props} />
|
|
30
54
|
) : (
|
|
31
|
-
<a href={href} target="_blank" {...props} />
|
|
55
|
+
<a href={href} target="_blank" {...props} rel="noreferrer" />
|
|
32
56
|
),
|
|
33
57
|
Callout,
|
|
34
58
|
tip: (props) => <Callout type="tip" {...props} />,
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DynamicIcon.js","sourceRoot":"","sources":["../../../src/lib/components/DynamicIcon.tsx"],"names":[],"mappings":";AAqDA,MAAM,UAAU,WAAW,CAAC,IAAa;IACvC,OAAO,IAAI,CAAC;AACd,CAAC;AAED,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,KAAsC,EAAE,EAAE,CAAC,CACrE,eAAW,CACZ,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { createServer } from "node:http";
|
|
2
|
-
import { createGraphQLServer } from "./index.js";
|
|
3
|
-
const yoga = createGraphQLServer();
|
|
4
|
-
const server = createServer(yoga);
|
|
5
|
-
server.listen(4000, () => {
|
|
6
|
-
console.log(`🚀 Server ready at http://localhost:4000/graphql`);
|
|
7
|
-
});
|
|
8
|
-
//# sourceMappingURL=server.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../../../src/lib/oas/graphql/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAEjD,MAAM,IAAI,GAAG,mBAAmB,EAAE,CAAC;AAEnC,MAAM,MAAM,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;AAElC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,EAAE;IACvB,OAAO,CAAC,GAAG,CAAC,mDAAmD,CAAC,CAAC;AACnE,CAAC,CAAC,CAAC"}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
// import { type LucideProps } from "lucide-react";
|
|
2
|
-
// import dynamicIconImports from "lucide-react/dynamicIconImports.js";
|
|
3
|
-
// import { Suspense, lazy, memo } from "react";
|
|
4
|
-
// import { cn } from "../util/cn.js";
|
|
5
|
-
|
|
6
|
-
// export type IconName = keyof typeof dynamicIconImports;
|
|
7
|
-
|
|
8
|
-
// const IconNames = Object.keys(dynamicIconImports) as IconName[];
|
|
9
|
-
|
|
10
|
-
// export const isValidIcon = (name: unknown): name is IconName =>
|
|
11
|
-
// typeof name === "string" && IconNames.includes(name as IconName);
|
|
12
|
-
|
|
13
|
-
// type IconProps = Omit<LucideProps, "ref"> & {
|
|
14
|
-
// name: IconName;
|
|
15
|
-
// inline?: boolean;
|
|
16
|
-
// };
|
|
17
|
-
|
|
18
|
-
// const Fallback = ({
|
|
19
|
-
// inline,
|
|
20
|
-
// size,
|
|
21
|
-
// }: {
|
|
22
|
-
// inline?: boolean;
|
|
23
|
-
// size?: string | number;
|
|
24
|
-
// }) => (
|
|
25
|
-
// <span
|
|
26
|
-
// className={cn(inline ? "inline-block" : "block", "bg-background")}
|
|
27
|
-
// style={{ height: size, width: size }}
|
|
28
|
-
// role="presentation"
|
|
29
|
-
// />
|
|
30
|
-
// );
|
|
31
|
-
|
|
32
|
-
// export const DynamicIcon = memo(function ({
|
|
33
|
-
// name,
|
|
34
|
-
// inline,
|
|
35
|
-
// className,
|
|
36
|
-
// size = 16,
|
|
37
|
-
// ...props
|
|
38
|
-
// }: IconProps) {
|
|
39
|
-
// const LucideIcon = lazy(dynamicIconImports[name]);
|
|
40
|
-
|
|
41
|
-
// return (
|
|
42
|
-
// <Suspense fallback={<Fallback inline={inline} size={size} />}>
|
|
43
|
-
// <LucideIcon
|
|
44
|
-
// {...props}
|
|
45
|
-
// size={size}
|
|
46
|
-
// className={cn(inline && "inline-block align-[-0.125em]", className)}
|
|
47
|
-
// />
|
|
48
|
-
// </Suspense>
|
|
49
|
-
// );
|
|
50
|
-
// });
|
|
51
|
-
|
|
52
|
-
export type IconName = string;
|
|
53
|
-
|
|
54
|
-
export function isValidIcon(name: unknown): name is IconName {
|
|
55
|
-
return true;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
export const DynamicIcon = (props: { name: string; size?: number }) => (
|
|
59
|
-
<div></div>
|
|
60
|
-
);
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { createServer } from "node:http";
|
|
2
|
-
import { createGraphQLServer } from "./index.js";
|
|
3
|
-
|
|
4
|
-
const yoga = createGraphQLServer();
|
|
5
|
-
|
|
6
|
-
const server = createServer(yoga);
|
|
7
|
-
|
|
8
|
-
server.listen(4000, () => {
|
|
9
|
-
console.log(`🚀 Server ready at http://localhost:4000/graphql`);
|
|
10
|
-
});
|