@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.
Files changed (91) hide show
  1. package/dist/cli/cli.js +168 -57
  2. package/dist/declarations/lib/ui/Command.d.ts +1 -1
  3. package/dist/declarations/lib/util/MdxComponents.d.ts +1 -1
  4. package/package.json +2 -1
  5. package/src/app/main.tsx +150 -150
  6. package/src/config/loader.ts +245 -245
  7. package/src/index.ts +33 -33
  8. package/src/lib/authentication/components/CallbackHandler.tsx +45 -45
  9. package/src/lib/authentication/components/SignIn.tsx +46 -46
  10. package/src/lib/authentication/components/SignUp.tsx +48 -48
  11. package/src/lib/authentication/providers/clerk.tsx +224 -224
  12. package/src/lib/authentication/ui/AuthCard.tsx +7 -7
  13. package/src/lib/authentication/ui/EmailLinkCallbackUi.tsx +129 -125
  14. package/src/lib/authentication/ui/EmailLinkSentUi.tsx +105 -101
  15. package/src/lib/authentication/ui/EmailLinkSignInUi.tsx +100 -96
  16. package/src/lib/authentication/ui/EmailVerificationUi.tsx +128 -124
  17. package/src/lib/authentication/ui/ZudokuAuthUi.tsx +620 -616
  18. package/src/lib/components/AiAssistantMenuItems.tsx +102 -102
  19. package/src/lib/components/Autocomplete.tsx +123 -123
  20. package/src/lib/components/DeveloperHint.tsx +39 -35
  21. package/src/lib/components/Header.tsx +260 -260
  22. package/src/lib/components/Layout.tsx +53 -53
  23. package/src/lib/components/Main.tsx +51 -51
  24. package/src/lib/components/Mermaid.tsx +74 -70
  25. package/src/lib/components/MobileTopNavigation.tsx +276 -276
  26. package/src/lib/components/MultiSelect.tsx +86 -82
  27. package/src/lib/components/TopNavigation.tsx +103 -103
  28. package/src/lib/components/index.ts +26 -26
  29. package/src/lib/components/navigation/NavigationCategory.tsx +157 -157
  30. package/src/lib/components/navigation/NavigationFilterInput.tsx +35 -35
  31. package/src/lib/components/navigation/NavigationItem.tsx +181 -177
  32. package/src/lib/core/RouteGuard.tsx +193 -193
  33. package/src/lib/errors/ErrorMessage.tsx +50 -46
  34. package/src/lib/plugins/api-catalog/Catalog.tsx +80 -80
  35. package/src/lib/plugins/api-keys/CreateApiKey.tsx +128 -124
  36. package/src/lib/plugins/api-keys/CreateApiKeyDialog.tsx +49 -49
  37. package/src/lib/plugins/api-keys/SettingsApiKeys.tsx +72 -72
  38. package/src/lib/plugins/api-keys/settings/ApiKeyItem.tsx +342 -342
  39. package/src/lib/plugins/api-keys/settings/RevealApiKey.tsx +127 -127
  40. package/src/lib/plugins/markdown/MdxPage.tsx +285 -285
  41. package/src/lib/plugins/openapi/ApiHeader.tsx +96 -96
  42. package/src/lib/plugins/openapi/CollapsibleCode.tsx +88 -88
  43. package/src/lib/plugins/openapi/DownloadSchemaButton.tsx +94 -94
  44. package/src/lib/plugins/openapi/GeneratedExampleSidecarBox.tsx +52 -52
  45. package/src/lib/plugins/openapi/OperationListItem.tsx +183 -183
  46. package/src/lib/plugins/openapi/RequestBodySidecarBox.tsx +63 -63
  47. package/src/lib/plugins/openapi/ResponsesSidecarBox.tsx +120 -117
  48. package/src/lib/plugins/openapi/SchemaInfo.tsx +344 -344
  49. package/src/lib/plugins/openapi/SchemaList.tsx +113 -113
  50. package/src/lib/plugins/openapi/Sidecar.tsx +312 -309
  51. package/src/lib/plugins/openapi/SidecarExamples.tsx +177 -174
  52. package/src/lib/plugins/openapi/components/EnumValues.tsx +58 -58
  53. package/src/lib/plugins/openapi/components/ResponseContent.tsx +117 -114
  54. package/src/lib/plugins/openapi/playground/BodyPanel.tsx +274 -271
  55. package/src/lib/plugins/openapi/playground/CollapsibleHeader.tsx +51 -51
  56. package/src/lib/plugins/openapi/playground/ExamplesDropdown.tsx +60 -60
  57. package/src/lib/plugins/openapi/playground/Headers.tsx +188 -181
  58. package/src/lib/plugins/openapi/playground/IdentityDialog.tsx +75 -75
  59. package/src/lib/plugins/openapi/playground/IdentitySelector.tsx +38 -38
  60. package/src/lib/plugins/openapi/playground/ParamsGrid.tsx +45 -45
  61. package/src/lib/plugins/openapi/playground/Playground.tsx +602 -599
  62. package/src/lib/plugins/openapi/playground/PlaygroundDialog.tsx +56 -56
  63. package/src/lib/plugins/openapi/playground/QueryParams.tsx +151 -148
  64. package/src/lib/plugins/openapi/playground/RequestLoginDialog.tsx +70 -70
  65. package/src/lib/plugins/openapi/playground/request-panel/MultipartField.tsx +91 -91
  66. package/src/lib/plugins/openapi/playground/result-panel/AudioPlayer.tsx +50 -50
  67. package/src/lib/plugins/openapi/playground/result-panel/ResponseTab.tsx +355 -355
  68. package/src/lib/plugins/openapi/playground/result-panel/ResultPanel.tsx +106 -102
  69. package/src/lib/plugins/openapi/schema/SchemaPropertyItem.tsx +189 -184
  70. package/src/lib/plugins/openapi/schema/SchemaView.tsx +299 -299
  71. package/src/lib/plugins/search-pagefind/IndexingDialog.tsx +162 -162
  72. package/src/lib/plugins/search-pagefind/PagefindSearch.tsx +202 -202
  73. package/src/lib/plugins/search-pagefind/ResultList.tsx +122 -118
  74. package/src/lib/ui/ActionButton.tsx +21 -21
  75. package/src/lib/ui/Command.tsx +191 -191
  76. package/src/lib/util/MdxComponents.tsx +150 -150
  77. package/src/vite/config.ts +234 -231
  78. package/src/vite/dev-server.ts +291 -291
  79. package/src/vite/plugin-api-keys.ts +50 -50
  80. package/src/vite/plugin-api.ts +320 -318
  81. package/src/vite/plugin-auth.ts +38 -38
  82. package/src/vite/plugin-component.ts +45 -39
  83. package/src/vite/plugin-config.ts +75 -75
  84. package/src/vite/plugin-custom-pages.ts +36 -36
  85. package/src/vite/plugin-docs.ts +202 -202
  86. package/src/vite/plugin-markdown-export.ts +214 -214
  87. package/src/vite/plugin-mdx.ts +149 -149
  88. package/src/vite/plugin-navigation.ts +106 -106
  89. package/src/vite/plugin-search.ts +47 -47
  90. package/src/vite/plugin.ts +42 -42
  91. package/src/vite/prerender/prerender.ts +233 -233
@@ -1,91 +1,91 @@
1
- import { PaperclipIcon, TrashIcon } from "lucide-react";
2
- import { useRef } from "react";
3
- import { Button } from "@lukoweb/apitogo/components";
4
- import { Checkbox } from "@lukoweb/apitogo/ui/Checkbox.js";
5
- import { humanFileSize } from "../../../../util/humanFileSize.js";
6
- import {
7
- ParamsGridInput,
8
- ParamsGridItem,
9
- ParamsGridRemoveButton,
10
- } from "../ParamsGrid.js";
11
- import type { PlaygroundForm } from "../Playground.js";
12
- import type { useKeyValueFieldManager } from "./useKeyValueFieldManager.js";
13
-
14
- type MultipartFieldProps = {
15
- index: number;
16
- manager: ReturnType<
17
- typeof useKeyValueFieldManager<PlaygroundForm, "multipartFormFields">
18
- >;
19
- };
20
-
21
- export const MultipartField = ({ index, manager }: MultipartFieldProps) => {
22
- const fieldFileInputRef = useRef<HTMLInputElement>(null);
23
- const fieldValue = manager.getValue(index, "value");
24
-
25
- return (
26
- <ParamsGridItem>
27
- <Checkbox
28
- {...manager.getCheckboxProps(index)}
29
- disabled={!manager.getValue(index, "name")}
30
- />
31
- <ParamsGridInput
32
- {...manager.getNameInputProps(index)}
33
- placeholder="Key"
34
- />
35
- <div className="flex items-center gap-1 flex-1">
36
- {fieldValue instanceof File ? (
37
- <div className="flex items-center gap-1 flex-1 min-w-0">
38
- <div className="flex items-center gap-1 border-b cursor-default">
39
- <PaperclipIcon size={12} className="text-muted-foreground" />
40
- <span
41
- className="text-xs truncate"
42
- title={`${fieldValue.name} (${humanFileSize(fieldValue.size)})`}
43
- >
44
- {fieldValue.name}
45
- </span>
46
- </div>
47
- <Button
48
- type="button"
49
- variant="ghost"
50
- size="icon-xs"
51
- className="opacity-50 hover:opacity-100 hover:brightness-95 transition-opacity"
52
- onClick={() => manager.setValue(index, "value", "")}
53
- >
54
- <TrashIcon size={13} />
55
- </Button>
56
- </div>
57
- ) : (
58
- <>
59
- <ParamsGridInput
60
- {...manager.getValueInputProps(index)}
61
- placeholder="Value"
62
- />
63
- <input
64
- ref={fieldFileInputRef}
65
- type="file"
66
- className="hidden"
67
- onChange={(e) => {
68
- const file = e.target.files?.[0];
69
- if (!file) return;
70
-
71
- manager.setValue(index, "value", file);
72
- manager.setValue(index, "active", true);
73
- }}
74
- />
75
- <Button
76
- type="button"
77
- variant="ghost"
78
- size="icon-xs"
79
- onClick={() => fieldFileInputRef.current?.click()}
80
- title="Attach file"
81
- className="opacity-0 focus-visible:opacity-100 group-hover:opacity-100 group-hover:brightness-95 transition-opacity"
82
- >
83
- <PaperclipIcon size={14} />
84
- </Button>
85
- </>
86
- )}
87
- <ParamsGridRemoveButton {...manager.getRemoveButtonProps(index)} />
88
- </div>
89
- </ParamsGridItem>
90
- );
91
- };
1
+ import { Button } from "@lukoweb/apitogo/components";
2
+ import { Checkbox } from "@lukoweb/apitogo/ui/Checkbox.js";
3
+ import { PaperclipIcon, TrashIcon } from "lucide-react";
4
+ import { useRef } from "react";
5
+ import { humanFileSize } from "../../../../util/humanFileSize.js";
6
+ import {
7
+ ParamsGridInput,
8
+ ParamsGridItem,
9
+ ParamsGridRemoveButton,
10
+ } from "../ParamsGrid.js";
11
+ import type { PlaygroundForm } from "../Playground.js";
12
+ import type { useKeyValueFieldManager } from "./useKeyValueFieldManager.js";
13
+
14
+ type MultipartFieldProps = {
15
+ index: number;
16
+ manager: ReturnType<
17
+ typeof useKeyValueFieldManager<PlaygroundForm, "multipartFormFields">
18
+ >;
19
+ };
20
+
21
+ export const MultipartField = ({ index, manager }: MultipartFieldProps) => {
22
+ const fieldFileInputRef = useRef<HTMLInputElement>(null);
23
+ const fieldValue = manager.getValue(index, "value");
24
+
25
+ return (
26
+ <ParamsGridItem>
27
+ <Checkbox
28
+ {...manager.getCheckboxProps(index)}
29
+ disabled={!manager.getValue(index, "name")}
30
+ />
31
+ <ParamsGridInput
32
+ {...manager.getNameInputProps(index)}
33
+ placeholder="Key"
34
+ />
35
+ <div className="flex items-center gap-1 flex-1">
36
+ {fieldValue instanceof File ? (
37
+ <div className="flex items-center gap-1 flex-1 min-w-0">
38
+ <div className="flex items-center gap-1 border-b cursor-default">
39
+ <PaperclipIcon size={12} className="text-muted-foreground" />
40
+ <span
41
+ className="text-xs truncate"
42
+ title={`${fieldValue.name} (${humanFileSize(fieldValue.size)})`}
43
+ >
44
+ {fieldValue.name}
45
+ </span>
46
+ </div>
47
+ <Button
48
+ type="button"
49
+ variant="ghost"
50
+ size="icon-xs"
51
+ className="opacity-50 hover:opacity-100 hover:brightness-95 transition-opacity"
52
+ onClick={() => manager.setValue(index, "value", "")}
53
+ >
54
+ <TrashIcon size={13} />
55
+ </Button>
56
+ </div>
57
+ ) : (
58
+ <>
59
+ <ParamsGridInput
60
+ {...manager.getValueInputProps(index)}
61
+ placeholder="Value"
62
+ />
63
+ <input
64
+ ref={fieldFileInputRef}
65
+ type="file"
66
+ className="hidden"
67
+ onChange={(e) => {
68
+ const file = e.target.files?.[0];
69
+ if (!file) return;
70
+
71
+ manager.setValue(index, "value", file);
72
+ manager.setValue(index, "active", true);
73
+ }}
74
+ />
75
+ <Button
76
+ type="button"
77
+ variant="ghost"
78
+ size="icon-xs"
79
+ onClick={() => fieldFileInputRef.current?.click()}
80
+ title="Attach file"
81
+ className="opacity-0 focus-visible:opacity-100 group-hover:opacity-100 group-hover:brightness-95 transition-opacity"
82
+ >
83
+ <PaperclipIcon size={14} />
84
+ </Button>
85
+ </>
86
+ )}
87
+ <ParamsGridRemoveButton {...manager.getRemoveButtonProps(index)} />
88
+ </div>
89
+ </ParamsGridItem>
90
+ );
91
+ };
@@ -1,50 +1,50 @@
1
- import { DownloadIcon } from "lucide-react";
2
- import { useEffect, useState } from "react";
3
- import { Button } from "@lukoweb/apitogo/ui/Button.js";
4
- import { humanFileSize } from "../../../../util/humanFileSize.js";
5
-
6
- export const AudioPlayer = ({
7
- blob,
8
- fileName,
9
- size,
10
- onDownload,
11
- }: {
12
- blob: Blob;
13
- fileName: string;
14
- size: number;
15
- onDownload: () => void;
16
- }) => {
17
- const [audioUrl, setAudioUrl] = useState<string | null>(null);
18
-
19
- useEffect(() => {
20
- const url = URL.createObjectURL(blob);
21
- setAudioUrl(url);
22
-
23
- return () => {
24
- URL.revokeObjectURL(url);
25
- };
26
- }, [blob]);
27
-
28
- if (!audioUrl) {
29
- return (
30
- <div className="p-4 text-center">
31
- <div className="text-sm text-muted-foreground">Loading audio...</div>
32
- </div>
33
- );
34
- }
35
-
36
- return (
37
- <div className="p-4 text-center">
38
- <div className="flex flex-col items-center gap-4">
39
- {/* biome-ignore lint/a11y/useMediaCaption: API response audio cannot have predefined captions */}
40
- <audio controls src={audioUrl} className="w-full max-w-md">
41
- Your browser does not support the audio element.
42
- </audio>
43
- <Button onClick={onDownload} className="flex items-center gap-2">
44
- <DownloadIcon className="h-4 w-4" />
45
- Download {fileName} ({humanFileSize(size)})
46
- </Button>
47
- </div>
48
- </div>
49
- );
50
- };
1
+ import { Button } from "@lukoweb/apitogo/ui/Button.js";
2
+ import { DownloadIcon } from "lucide-react";
3
+ import { useEffect, useState } from "react";
4
+ import { humanFileSize } from "../../../../util/humanFileSize.js";
5
+
6
+ export const AudioPlayer = ({
7
+ blob,
8
+ fileName,
9
+ size,
10
+ onDownload,
11
+ }: {
12
+ blob: Blob;
13
+ fileName: string;
14
+ size: number;
15
+ onDownload: () => void;
16
+ }) => {
17
+ const [audioUrl, setAudioUrl] = useState<string | null>(null);
18
+
19
+ useEffect(() => {
20
+ const url = URL.createObjectURL(blob);
21
+ setAudioUrl(url);
22
+
23
+ return () => {
24
+ URL.revokeObjectURL(url);
25
+ };
26
+ }, [blob]);
27
+
28
+ if (!audioUrl) {
29
+ return (
30
+ <div className="p-4 text-center">
31
+ <div className="text-sm text-muted-foreground">Loading audio...</div>
32
+ </div>
33
+ );
34
+ }
35
+
36
+ return (
37
+ <div className="p-4 text-center">
38
+ <div className="flex flex-col items-center gap-4">
39
+ {/* biome-ignore lint/a11y/useMediaCaption: API response audio cannot have predefined captions */}
40
+ <audio controls src={audioUrl} className="w-full max-w-md">
41
+ Your browser does not support the audio element.
42
+ </audio>
43
+ <Button onClick={onDownload} className="flex items-center gap-2">
44
+ <DownloadIcon className="h-4 w-4" />
45
+ Download {fileName} ({humanFileSize(size)})
46
+ </Button>
47
+ </div>
48
+ </div>
49
+ );
50
+ };