@lukoweb/apitogo 0.1.1 → 0.1.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.
- package/dist/cli/cli.js +168 -57
- package/dist/declarations/lib/ui/Command.d.ts +1 -1
- package/dist/declarations/lib/util/MdxComponents.d.ts +1 -1
- package/package.json +2 -1
- package/src/app/main.tsx +150 -150
- package/src/config/loader.ts +245 -245
- package/src/index.ts +33 -33
- package/src/lib/authentication/components/CallbackHandler.tsx +45 -45
- package/src/lib/authentication/components/SignIn.tsx +46 -46
- package/src/lib/authentication/components/SignUp.tsx +48 -48
- package/src/lib/authentication/providers/clerk.tsx +224 -224
- package/src/lib/authentication/ui/AuthCard.tsx +7 -7
- package/src/lib/authentication/ui/EmailLinkCallbackUi.tsx +129 -125
- package/src/lib/authentication/ui/EmailLinkSentUi.tsx +105 -101
- package/src/lib/authentication/ui/EmailLinkSignInUi.tsx +100 -96
- package/src/lib/authentication/ui/EmailVerificationUi.tsx +128 -124
- package/src/lib/authentication/ui/ZudokuAuthUi.tsx +620 -616
- package/src/lib/components/AiAssistantMenuItems.tsx +102 -102
- package/src/lib/components/Autocomplete.tsx +123 -123
- package/src/lib/components/DeveloperHint.tsx +39 -35
- package/src/lib/components/Header.tsx +260 -260
- package/src/lib/components/Layout.tsx +53 -53
- package/src/lib/components/Main.tsx +51 -51
- package/src/lib/components/Mermaid.tsx +74 -70
- package/src/lib/components/MobileTopNavigation.tsx +276 -276
- package/src/lib/components/MultiSelect.tsx +86 -82
- package/src/lib/components/TopNavigation.tsx +103 -103
- package/src/lib/components/index.ts +26 -26
- package/src/lib/components/navigation/NavigationCategory.tsx +157 -157
- package/src/lib/components/navigation/NavigationFilterInput.tsx +35 -35
- package/src/lib/components/navigation/NavigationItem.tsx +181 -177
- package/src/lib/core/RouteGuard.tsx +193 -193
- package/src/lib/errors/ErrorMessage.tsx +50 -46
- package/src/lib/plugins/api-catalog/Catalog.tsx +80 -80
- package/src/lib/plugins/api-keys/CreateApiKey.tsx +128 -124
- package/src/lib/plugins/api-keys/CreateApiKeyDialog.tsx +49 -49
- package/src/lib/plugins/api-keys/SettingsApiKeys.tsx +72 -72
- package/src/lib/plugins/api-keys/settings/ApiKeyItem.tsx +342 -342
- package/src/lib/plugins/api-keys/settings/RevealApiKey.tsx +127 -127
- package/src/lib/plugins/markdown/MdxPage.tsx +285 -285
- package/src/lib/plugins/openapi/ApiHeader.tsx +96 -96
- package/src/lib/plugins/openapi/CollapsibleCode.tsx +88 -88
- package/src/lib/plugins/openapi/DownloadSchemaButton.tsx +94 -94
- package/src/lib/plugins/openapi/GeneratedExampleSidecarBox.tsx +52 -52
- package/src/lib/plugins/openapi/OperationListItem.tsx +183 -183
- package/src/lib/plugins/openapi/RequestBodySidecarBox.tsx +63 -63
- package/src/lib/plugins/openapi/ResponsesSidecarBox.tsx +120 -117
- package/src/lib/plugins/openapi/SchemaInfo.tsx +344 -344
- package/src/lib/plugins/openapi/SchemaList.tsx +113 -113
- package/src/lib/plugins/openapi/Sidecar.tsx +312 -309
- package/src/lib/plugins/openapi/SidecarExamples.tsx +177 -174
- package/src/lib/plugins/openapi/components/EnumValues.tsx +58 -58
- package/src/lib/plugins/openapi/components/ResponseContent.tsx +117 -114
- package/src/lib/plugins/openapi/playground/BodyPanel.tsx +274 -271
- package/src/lib/plugins/openapi/playground/CollapsibleHeader.tsx +51 -51
- package/src/lib/plugins/openapi/playground/ExamplesDropdown.tsx +60 -60
- package/src/lib/plugins/openapi/playground/Headers.tsx +188 -181
- package/src/lib/plugins/openapi/playground/IdentityDialog.tsx +75 -75
- package/src/lib/plugins/openapi/playground/IdentitySelector.tsx +38 -38
- package/src/lib/plugins/openapi/playground/ParamsGrid.tsx +45 -45
- package/src/lib/plugins/openapi/playground/Playground.tsx +602 -599
- package/src/lib/plugins/openapi/playground/PlaygroundDialog.tsx +56 -56
- package/src/lib/plugins/openapi/playground/QueryParams.tsx +151 -148
- package/src/lib/plugins/openapi/playground/RequestLoginDialog.tsx +70 -70
- package/src/lib/plugins/openapi/playground/request-panel/MultipartField.tsx +91 -91
- package/src/lib/plugins/openapi/playground/result-panel/AudioPlayer.tsx +50 -50
- package/src/lib/plugins/openapi/playground/result-panel/ResponseTab.tsx +355 -355
- package/src/lib/plugins/openapi/playground/result-panel/ResultPanel.tsx +106 -102
- package/src/lib/plugins/openapi/schema/SchemaPropertyItem.tsx +189 -184
- package/src/lib/plugins/openapi/schema/SchemaView.tsx +299 -299
- package/src/lib/plugins/search-pagefind/IndexingDialog.tsx +162 -162
- package/src/lib/plugins/search-pagefind/PagefindSearch.tsx +202 -202
- package/src/lib/plugins/search-pagefind/ResultList.tsx +122 -118
- package/src/lib/ui/ActionButton.tsx +21 -21
- package/src/lib/ui/Command.tsx +191 -191
- package/src/lib/util/MdxComponents.tsx +150 -150
- package/src/vite/config.ts +234 -231
- package/src/vite/dev-server.ts +291 -291
- package/src/vite/plugin-api-keys.ts +50 -50
- package/src/vite/plugin-api.ts +320 -318
- package/src/vite/plugin-auth.ts +38 -38
- package/src/vite/plugin-component.ts +45 -39
- package/src/vite/plugin-config.ts +75 -75
- package/src/vite/plugin-custom-pages.ts +36 -36
- package/src/vite/plugin-docs.ts +202 -202
- package/src/vite/plugin-markdown-export.ts +214 -214
- package/src/vite/plugin-mdx.ts +149 -149
- package/src/vite/plugin-navigation.ts +106 -106
- package/src/vite/plugin-search.ts +47 -47
- package/src/vite/plugin.ts +42 -42
- package/src/vite/prerender/prerender.ts +233 -233
|
@@ -1,117 +1,120 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
import
|
|
18
|
-
import {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
const [
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
<
|
|
75
|
-
|
|
76
|
-
</
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
{
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
{response.statusCode}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
1
|
+
import { Button } from "@lukoweb/apitogo/components";
|
|
2
|
+
import {
|
|
3
|
+
Collapsible,
|
|
4
|
+
CollapsibleContent,
|
|
5
|
+
CollapsibleTrigger,
|
|
6
|
+
} from "@lukoweb/apitogo/ui/Collapsible.js";
|
|
7
|
+
import {
|
|
8
|
+
NativeSelect,
|
|
9
|
+
NativeSelectOption,
|
|
10
|
+
} from "@lukoweb/apitogo/ui/NativeSelect.js";
|
|
11
|
+
import {
|
|
12
|
+
Tooltip,
|
|
13
|
+
TooltipContent,
|
|
14
|
+
TooltipProvider,
|
|
15
|
+
TooltipTrigger,
|
|
16
|
+
} from "@lukoweb/apitogo/ui/Tooltip.js";
|
|
17
|
+
import { ChevronsDownUpIcon, ChevronsUpDownIcon, InfoIcon } from "lucide-react";
|
|
18
|
+
import { useEffect, useState } from "react";
|
|
19
|
+
import type { ResponseItem } from "./graphql/graphql.js";
|
|
20
|
+
import * as SidecarBox from "./SidecarBox.js";
|
|
21
|
+
import { SidecarExamples } from "./SidecarExamples.js";
|
|
22
|
+
|
|
23
|
+
export const ResponsesSidecarBox = ({
|
|
24
|
+
responses,
|
|
25
|
+
selectedResponse,
|
|
26
|
+
isOnScreen,
|
|
27
|
+
shouldLazyHighlight,
|
|
28
|
+
isGenerated,
|
|
29
|
+
}: {
|
|
30
|
+
responses: ResponseItem[];
|
|
31
|
+
selectedResponse?: string;
|
|
32
|
+
isOnScreen: boolean;
|
|
33
|
+
shouldLazyHighlight?: boolean;
|
|
34
|
+
isGenerated?: boolean;
|
|
35
|
+
}) => {
|
|
36
|
+
const [internalSelectedResponse, setInternalSelectedResponse] = useState(
|
|
37
|
+
selectedResponse ?? responses[0]?.statusCode,
|
|
38
|
+
);
|
|
39
|
+
const [selectedContentIndex, setSelectedContentIndex] = useState(0);
|
|
40
|
+
const [selectedExampleIndex, setSelectedExampleIndex] = useState(0);
|
|
41
|
+
|
|
42
|
+
useEffect(() => {
|
|
43
|
+
if (!selectedResponse) return;
|
|
44
|
+
|
|
45
|
+
setInternalSelectedResponse(selectedResponse);
|
|
46
|
+
}, [selectedResponse]);
|
|
47
|
+
|
|
48
|
+
useEffect(() => {
|
|
49
|
+
if (!internalSelectedResponse) return;
|
|
50
|
+
|
|
51
|
+
setSelectedContentIndex(0);
|
|
52
|
+
setSelectedExampleIndex(0);
|
|
53
|
+
}, [internalSelectedResponse]);
|
|
54
|
+
|
|
55
|
+
return (
|
|
56
|
+
<Collapsible className="group/collapsible" defaultOpen>
|
|
57
|
+
<SidecarBox.Root>
|
|
58
|
+
<SidecarBox.Head className="text-xs flex justify-between items-center">
|
|
59
|
+
<div className="flex items-center gap-1 font-medium shrink-0">
|
|
60
|
+
<CollapsibleTrigger asChild>
|
|
61
|
+
<Button
|
|
62
|
+
variant="ghost"
|
|
63
|
+
className="size-fit px-1 py-1 -my-1"
|
|
64
|
+
aria-label="Toggle response examples"
|
|
65
|
+
>
|
|
66
|
+
<ChevronsDownUpIcon className="size-[1em] group-data-[state=closed]/collapsible:hidden" />
|
|
67
|
+
<ChevronsUpDownIcon className="size-[1em] group-data-[state=open]/collapsible:hidden" />
|
|
68
|
+
</Button>
|
|
69
|
+
</CollapsibleTrigger>
|
|
70
|
+
Example Responses
|
|
71
|
+
{isGenerated && (
|
|
72
|
+
<TooltipProvider>
|
|
73
|
+
<Tooltip>
|
|
74
|
+
<TooltipTrigger asChild>
|
|
75
|
+
<InfoIcon size={13} />
|
|
76
|
+
</TooltipTrigger>
|
|
77
|
+
<TooltipContent>
|
|
78
|
+
This example is auto-generated from the schema.
|
|
79
|
+
</TooltipContent>
|
|
80
|
+
</Tooltip>
|
|
81
|
+
</TooltipProvider>
|
|
82
|
+
)}
|
|
83
|
+
</div>
|
|
84
|
+
<div className="group-data-[state=closed]/collapsible:invisible">
|
|
85
|
+
<NativeSelect
|
|
86
|
+
className="text-xs h-fit py-1 -my-1 bg-background"
|
|
87
|
+
value={internalSelectedResponse}
|
|
88
|
+
onChange={(e) => setInternalSelectedResponse(e.target.value)}
|
|
89
|
+
>
|
|
90
|
+
{responses.map((response) => (
|
|
91
|
+
<NativeSelectOption
|
|
92
|
+
key={response.statusCode}
|
|
93
|
+
value={response.statusCode}
|
|
94
|
+
>
|
|
95
|
+
{response.statusCode}
|
|
96
|
+
</NativeSelectOption>
|
|
97
|
+
))}
|
|
98
|
+
</NativeSelect>
|
|
99
|
+
</div>
|
|
100
|
+
</SidecarBox.Head>
|
|
101
|
+
<CollapsibleContent>
|
|
102
|
+
<SidecarExamples
|
|
103
|
+
selectedContentIndex={selectedContentIndex}
|
|
104
|
+
selectedExampleIndex={selectedExampleIndex}
|
|
105
|
+
onExampleChange={(selected) => {
|
|
106
|
+
setSelectedContentIndex(selected.contentTypeIndex);
|
|
107
|
+
setSelectedExampleIndex(selected.exampleIndex);
|
|
108
|
+
}}
|
|
109
|
+
content={
|
|
110
|
+
responses.find((r) => r.statusCode === internalSelectedResponse)
|
|
111
|
+
?.content ?? []
|
|
112
|
+
}
|
|
113
|
+
isOnScreen={isOnScreen}
|
|
114
|
+
shouldLazyHighlight={shouldLazyHighlight}
|
|
115
|
+
/>
|
|
116
|
+
</CollapsibleContent>
|
|
117
|
+
</SidecarBox.Root>
|
|
118
|
+
</Collapsible>
|
|
119
|
+
);
|
|
120
|
+
};
|