@lukoweb/apitogo 0.1.0 → 0.1.2

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 +37 -147
  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 +1 -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,75 +1,75 @@
1
- import { useState } from "react";
2
- import { Button } from "@lukoweb/apitogo/ui/Button.js";
3
- import { Card } from "@lukoweb/apitogo/ui/Card.js";
4
- import { Checkbox } from "@lukoweb/apitogo/ui/Checkbox.js";
5
- import {
6
- Dialog,
7
- DialogContent,
8
- DialogDescription,
9
- DialogFooter,
10
- DialogTitle,
11
- } from "@lukoweb/apitogo/ui/Dialog.js";
12
- import { Label } from "@lukoweb/apitogo/ui/Label.js";
13
- import type { ApiIdentity } from "../../../core/ZudokuContext.js";
14
- import IdentitySelector from "./IdentitySelector.js";
15
-
16
- const IdentityDialog = ({
17
- onSubmit,
18
- identities,
19
- open,
20
- onOpenChange,
21
- }: {
22
- open: boolean;
23
- onOpenChange: (open: boolean) => void;
24
- onSubmit: ({
25
- rememberedIdentity,
26
- identity,
27
- }: {
28
- rememberedIdentity: boolean;
29
- identity?: string;
30
- }) => void;
31
- identities: ApiIdentity[];
32
- }) => {
33
- const [identity, setIdentity] = useState<string | undefined>(undefined);
34
- const [rememberedIdentity, setRememberedIdentity] = useState<boolean>(false);
35
-
36
- return (
37
- <Dialog open={open} onOpenChange={onOpenChange}>
38
- <DialogContent>
39
- <DialogTitle>Select an auth identity</DialogTitle>
40
- <DialogDescription>
41
- Please select an identity for this request.
42
- </DialogDescription>
43
- <Card className="max-h-80 overflow-auto">
44
- <IdentitySelector
45
- identities={identities}
46
- setValue={setIdentity}
47
- value={identity}
48
- />
49
- </Card>
50
- <DialogFooter className="flex flex-col gap-2">
51
- <div className="flex items-center gap-2">
52
- <Checkbox
53
- id="remember"
54
- checked={rememberedIdentity}
55
- onCheckedChange={(checked) =>
56
- setRememberedIdentity(
57
- checked === "indeterminate" ? false : !!checked,
58
- )
59
- }
60
- />
61
- <Label htmlFor="remember">Remember my choice</Label>
62
- </div>
63
-
64
- <Button
65
- onClick={() => onSubmit({ identity: identity, rememberedIdentity })}
66
- >
67
- Send
68
- </Button>
69
- </DialogFooter>
70
- </DialogContent>
71
- </Dialog>
72
- );
73
- };
74
-
75
- export { IdentityDialog };
1
+ import { Button } from "@lukoweb/apitogo/ui/Button.js";
2
+ import { Card } from "@lukoweb/apitogo/ui/Card.js";
3
+ import { Checkbox } from "@lukoweb/apitogo/ui/Checkbox.js";
4
+ import {
5
+ Dialog,
6
+ DialogContent,
7
+ DialogDescription,
8
+ DialogFooter,
9
+ DialogTitle,
10
+ } from "@lukoweb/apitogo/ui/Dialog.js";
11
+ import { Label } from "@lukoweb/apitogo/ui/Label.js";
12
+ import { useState } from "react";
13
+ import type { ApiIdentity } from "../../../core/ZudokuContext.js";
14
+ import IdentitySelector from "./IdentitySelector.js";
15
+
16
+ const IdentityDialog = ({
17
+ onSubmit,
18
+ identities,
19
+ open,
20
+ onOpenChange,
21
+ }: {
22
+ open: boolean;
23
+ onOpenChange: (open: boolean) => void;
24
+ onSubmit: ({
25
+ rememberedIdentity,
26
+ identity,
27
+ }: {
28
+ rememberedIdentity: boolean;
29
+ identity?: string;
30
+ }) => void;
31
+ identities: ApiIdentity[];
32
+ }) => {
33
+ const [identity, setIdentity] = useState<string | undefined>(undefined);
34
+ const [rememberedIdentity, setRememberedIdentity] = useState<boolean>(false);
35
+
36
+ return (
37
+ <Dialog open={open} onOpenChange={onOpenChange}>
38
+ <DialogContent>
39
+ <DialogTitle>Select an auth identity</DialogTitle>
40
+ <DialogDescription>
41
+ Please select an identity for this request.
42
+ </DialogDescription>
43
+ <Card className="max-h-80 overflow-auto">
44
+ <IdentitySelector
45
+ identities={identities}
46
+ setValue={setIdentity}
47
+ value={identity}
48
+ />
49
+ </Card>
50
+ <DialogFooter className="flex flex-col gap-2">
51
+ <div className="flex items-center gap-2">
52
+ <Checkbox
53
+ id="remember"
54
+ checked={rememberedIdentity}
55
+ onCheckedChange={(checked) =>
56
+ setRememberedIdentity(
57
+ checked === "indeterminate" ? false : !!checked,
58
+ )
59
+ }
60
+ />
61
+ <Label htmlFor="remember">Remember my choice</Label>
62
+ </div>
63
+
64
+ <Button
65
+ onClick={() => onSubmit({ identity: identity, rememberedIdentity })}
66
+ >
67
+ Send
68
+ </Button>
69
+ </DialogFooter>
70
+ </DialogContent>
71
+ </Dialog>
72
+ );
73
+ };
74
+
75
+ export { IdentityDialog };
@@ -1,38 +1,38 @@
1
- import { Label } from "@lukoweb/apitogo/ui/Label.js";
2
- import { RadioGroup, RadioGroupItem } from "@lukoweb/apitogo/ui/RadioGroup.js";
3
- import type { ApiIdentity } from "../../../core/ZudokuContext.js";
4
- import { NO_IDENTITY } from "./Playground.js";
5
-
6
- const IdentitySelector = ({
7
- identities,
8
- setValue,
9
- value,
10
- }: {
11
- identities?: ApiIdentity[];
12
- setValue: (value: string) => void;
13
- value?: string;
14
- }) => (
15
- <div className="w-full overflow-hidden">
16
- <RadioGroup
17
- onValueChange={(value) => setValue(value)}
18
- value={value}
19
- defaultValue={NO_IDENTITY}
20
- className="gap-0"
21
- disabled={identities?.length === 0}
22
- >
23
- {[{ id: NO_IDENTITY, label: "None" }, ...(identities ?? [])].map(
24
- (identity) => (
25
- <Label
26
- key={identity.id}
27
- className="h-10 items-center border-b font-normal flex gap-4 p-4 cursor-pointer hover:bg-accent/75"
28
- >
29
- <RadioGroupItem value={identity.id} id={identity.id} />
30
- <span>{identity.label}</span>
31
- </Label>
32
- ),
33
- )}
34
- </RadioGroup>
35
- </div>
36
- );
37
-
38
- export default IdentitySelector;
1
+ import { Label } from "@lukoweb/apitogo/ui/Label.js";
2
+ import { RadioGroup, RadioGroupItem } from "@lukoweb/apitogo/ui/RadioGroup.js";
3
+ import type { ApiIdentity } from "../../../core/ZudokuContext.js";
4
+ import { NO_IDENTITY } from "./Playground.js";
5
+
6
+ const IdentitySelector = ({
7
+ identities,
8
+ setValue,
9
+ value,
10
+ }: {
11
+ identities?: ApiIdentity[];
12
+ setValue: (value: string) => void;
13
+ value?: string;
14
+ }) => (
15
+ <div className="w-full overflow-hidden">
16
+ <RadioGroup
17
+ onValueChange={(value) => setValue(value)}
18
+ value={value}
19
+ defaultValue={NO_IDENTITY}
20
+ className="gap-0"
21
+ disabled={identities?.length === 0}
22
+ >
23
+ {[{ id: NO_IDENTITY, label: "None" }, ...(identities ?? [])].map(
24
+ (identity) => (
25
+ <Label
26
+ key={identity.id}
27
+ className="h-10 items-center border-b font-normal flex gap-4 p-4 cursor-pointer hover:bg-accent/75"
28
+ >
29
+ <RadioGroupItem value={identity.id} id={identity.id} />
30
+ <span>{identity.label}</span>
31
+ </Label>
32
+ ),
33
+ )}
34
+ </RadioGroup>
35
+ </div>
36
+ );
37
+
38
+ export default IdentitySelector;
@@ -1,45 +1,45 @@
1
- import { XIcon } from "lucide-react";
2
- import { Button } from "@lukoweb/apitogo/components";
3
- import { Input } from "@lukoweb/apitogo/ui/Input.js";
4
- import { cn } from "../../../util/cn.js";
5
- import createVariantComponent from "../../../util/createVariantComponent.js";
6
-
7
- const ParamsGrid = createVariantComponent(
8
- "div",
9
- "grid grid-cols-[min-content_2fr_3fr] items-center gap-x-5 [&>*:last-child_[data-slot=remove-button]]:invisible",
10
- );
11
-
12
- export const ParamsGridItem = createVariantComponent(
13
- "div",
14
- "group h-9 hover:bg-accent/75 ps-4 pe-2 grid col-span-full grid-cols-subgrid items-center border-b",
15
- );
16
-
17
- export const ParamsGridInput = createVariantComponent(
18
- Input,
19
- "w-full truncate border-0 p-0 m-0 shadow-none text-xs focus-visible:ring-0 font-mono",
20
- );
21
-
22
- export const ParamsGridRemoveButton = ({
23
- onClick,
24
- className,
25
- }: {
26
- onClick: (e: React.MouseEvent<HTMLButtonElement>) => void;
27
- className?: string;
28
- }) => (
29
- <Button
30
- size="icon-xs"
31
- variant="ghost"
32
- className={cn(
33
- "text-muted-foreground opacity-0 group-hover:brightness-95 focus-visible:opacity-100 group-hover:opacity-100",
34
- className,
35
- )}
36
- onClick={onClick}
37
- type="button"
38
- // In the last row the remove button will be hidden by the ParamsGridItem selector
39
- data-slot="remove-button"
40
- >
41
- <XIcon size={14} />
42
- </Button>
43
- );
44
-
45
- export default ParamsGrid;
1
+ import { Button } from "@lukoweb/apitogo/components";
2
+ import { Input } from "@lukoweb/apitogo/ui/Input.js";
3
+ import { XIcon } from "lucide-react";
4
+ import { cn } from "../../../util/cn.js";
5
+ import createVariantComponent from "../../../util/createVariantComponent.js";
6
+
7
+ const ParamsGrid = createVariantComponent(
8
+ "div",
9
+ "grid grid-cols-[min-content_2fr_3fr] items-center gap-x-5 [&>*:last-child_[data-slot=remove-button]]:invisible",
10
+ );
11
+
12
+ export const ParamsGridItem = createVariantComponent(
13
+ "div",
14
+ "group h-9 hover:bg-accent/75 ps-4 pe-2 grid col-span-full grid-cols-subgrid items-center border-b",
15
+ );
16
+
17
+ export const ParamsGridInput = createVariantComponent(
18
+ Input,
19
+ "w-full truncate border-0 p-0 m-0 shadow-none text-xs focus-visible:ring-0 font-mono",
20
+ );
21
+
22
+ export const ParamsGridRemoveButton = ({
23
+ onClick,
24
+ className,
25
+ }: {
26
+ onClick: (e: React.MouseEvent<HTMLButtonElement>) => void;
27
+ className?: string;
28
+ }) => (
29
+ <Button
30
+ size="icon-xs"
31
+ variant="ghost"
32
+ className={cn(
33
+ "text-muted-foreground opacity-0 group-hover:brightness-95 focus-visible:opacity-100 group-hover:opacity-100",
34
+ className,
35
+ )}
36
+ onClick={onClick}
37
+ type="button"
38
+ // In the last row the remove button will be hidden by the ParamsGridItem selector
39
+ data-slot="remove-button"
40
+ >
41
+ <XIcon size={14} />
42
+ </Button>
43
+ );
44
+
45
+ export default ParamsGrid;