@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,150 +1,150 @@
1
- import type { MDXComponents } from "mdx/types.js";
2
- import { lazy, Suspense } from "react";
3
- import { Link } from "@lukoweb/apitogo/components";
4
- import { Alert } from "@lukoweb/apitogo/ui/Alert.js";
5
- import { AnchorLink } from "../components/AnchorLink.js";
6
- import { Framed } from "../components/Framed.js";
7
- import { Heading } from "../components/Heading.js";
8
- import { InlineCode } from "../components/InlineCode.js";
9
- import { HIGHLIGHT_CODE_BLOCK_CLASS } from "../shiki-constants.js";
10
- import { Badge } from "../ui/Badge.js";
11
- import { Button } from "../ui/Button.js";
12
- import { Callout } from "../ui/Callout.js";
13
- import { CodeBlock } from "../ui/CodeBlock.js";
14
- import { CodeTabPanel } from "../ui/CodeTabPanel.js";
15
- import { Stepper } from "../ui/Stepper.js";
16
- import { cn } from "./cn.js";
17
-
18
- // Lazy-loaded to avoid pulling shiki/mermaid into the initial bundle.
19
- const SyntaxHighlight = lazy(() => import("../ui/SyntaxHighlight.js"));
20
- const Mermaid = lazy(() => import("../components/Mermaid.js"));
21
- const CodeTabs = lazy(() =>
22
- import("../ui/CodeTabs.js").then((m) => ({ default: m.CodeTabs })),
23
- );
24
-
25
- export type MdxComponentsType = Readonly<MDXComponents> | null | undefined;
26
-
27
- export const MdxComponents = {
28
- img: ({ node, ...props }) => {
29
- if (/\.(mp4|webm|mov|avi)$/.test(props.src ?? "")) {
30
- return (
31
- // biome-ignore lint/a11y/useMediaCaption: No in control of the caption here
32
- <video
33
- src={props.src}
34
- controls
35
- playsInline
36
- autoPlay
37
- loop
38
- className={cn("rounded-lg", props.className)}
39
- />
40
- );
41
- }
42
- return (
43
- <img
44
- alt={props.alt}
45
- {...props}
46
- className={cn("rounded-lg", props.className)}
47
- />
48
- );
49
- },
50
- Framed,
51
- h1: ({ children, id }) => (
52
- <Heading level={1} id={id}>
53
- {children}
54
- </Heading>
55
- ),
56
- h2: ({ children, id }) => (
57
- <Heading level={2} id={id}>
58
- {children}
59
- </Heading>
60
- ),
61
- h3: ({ children, id }) => (
62
- <Heading level={3} id={id}>
63
- {children}
64
- </Heading>
65
- ),
66
- h4: ({ children, id }) => (
67
- <Heading level={4} id={id}>
68
- {children}
69
- </Heading>
70
- ),
71
- h5: ({ children, id }) => (
72
- <Heading level={5} id={id}>
73
- {children}
74
- </Heading>
75
- ),
76
- h6: ({ children, id }) => (
77
- <Heading level={6} id={id}>
78
- {children}
79
- </Heading>
80
- ),
81
- a: ({ href, node, ...props }) =>
82
- href && !href.startsWith("http") ? (
83
- <AnchorLink to={href} relative="path" {...props} />
84
- ) : (
85
- <a href={href} target="_blank" {...props} rel="noreferrer" />
86
- ),
87
- Link,
88
- Alert,
89
- Badge,
90
- Button,
91
- Callout,
92
- Stepper,
93
- Mermaid: (props) => (
94
- <Suspense>
95
- <Mermaid {...props} />
96
- </Suspense>
97
- ),
98
- SyntaxHighlight: (props) => (
99
- <Suspense>
100
- <SyntaxHighlight {...props} />
101
- </Suspense>
102
- ),
103
- tip: (props) => <Callout type="tip" {...props} />,
104
- info: (props) => <Callout type="info" {...props} />,
105
- note: (props) => <Callout type="note" {...props} />,
106
- caution: (props) => <Callout type="caution" {...props} />,
107
- warning: (props) => <Callout type="caution" {...props} />,
108
- danger: (props) => <Callout type="danger" {...props} />,
109
- CodeTabs: (props) => (
110
- <Suspense>
111
- <CodeTabs {...props} />
112
- </Suspense>
113
- ),
114
- CodeTabPanel,
115
- pre: (props) => (
116
- <pre className={cn("not-prose my-4", props.className)} {...props} />
117
- ),
118
- code: ({
119
- className,
120
- node: _node,
121
- children,
122
- title,
123
- icon,
124
- inline,
125
- showLineNumbers,
126
- ...props
127
- }) => {
128
- const match = className?.match(/language-(\w+)/);
129
-
130
- if (inline === "true" || inline === true) {
131
- return (
132
- <InlineCode className={cn(className, "inline")}>{children}</InlineCode>
133
- );
134
- }
135
-
136
- return (
137
- <CodeBlock
138
- language={match?.[1]}
139
- icon={icon}
140
- showLanguageIndicator
141
- showLineNumbers={showLineNumbers}
142
- title={title}
143
- >
144
- <code className={cn(className, HIGHLIGHT_CODE_BLOCK_CLASS)} {...props}>
145
- {children}
146
- </code>
147
- </CodeBlock>
148
- );
149
- },
150
- } satisfies MdxComponentsType;
1
+ import { Link } from "@lukoweb/apitogo/components";
2
+ import { Alert } from "@lukoweb/apitogo/ui/Alert.js";
3
+ import type { MDXComponents } from "mdx/types.js";
4
+ import { lazy, Suspense } from "react";
5
+ import { AnchorLink } from "../components/AnchorLink.js";
6
+ import { Framed } from "../components/Framed.js";
7
+ import { Heading } from "../components/Heading.js";
8
+ import { InlineCode } from "../components/InlineCode.js";
9
+ import { HIGHLIGHT_CODE_BLOCK_CLASS } from "../shiki-constants.js";
10
+ import { Badge } from "../ui/Badge.js";
11
+ import { Button } from "../ui/Button.js";
12
+ import { Callout } from "../ui/Callout.js";
13
+ import { CodeBlock } from "../ui/CodeBlock.js";
14
+ import { CodeTabPanel } from "../ui/CodeTabPanel.js";
15
+ import { Stepper } from "../ui/Stepper.js";
16
+ import { cn } from "./cn.js";
17
+
18
+ // Lazy-loaded to avoid pulling shiki/mermaid into the initial bundle.
19
+ const SyntaxHighlight = lazy(() => import("../ui/SyntaxHighlight.js"));
20
+ const Mermaid = lazy(() => import("../components/Mermaid.js"));
21
+ const CodeTabs = lazy(() =>
22
+ import("../ui/CodeTabs.js").then((m) => ({ default: m.CodeTabs })),
23
+ );
24
+
25
+ export type MdxComponentsType = Readonly<MDXComponents> | null | undefined;
26
+
27
+ export const MdxComponents = {
28
+ img: ({ node, ...props }) => {
29
+ if (/\.(mp4|webm|mov|avi)$/.test(props.src ?? "")) {
30
+ return (
31
+ // biome-ignore lint/a11y/useMediaCaption: No in control of the caption here
32
+ <video
33
+ src={props.src}
34
+ controls
35
+ playsInline
36
+ autoPlay
37
+ loop
38
+ className={cn("rounded-lg", props.className)}
39
+ />
40
+ );
41
+ }
42
+ return (
43
+ <img
44
+ alt={props.alt}
45
+ {...props}
46
+ className={cn("rounded-lg", props.className)}
47
+ />
48
+ );
49
+ },
50
+ Framed,
51
+ h1: ({ children, id }) => (
52
+ <Heading level={1} id={id}>
53
+ {children}
54
+ </Heading>
55
+ ),
56
+ h2: ({ children, id }) => (
57
+ <Heading level={2} id={id}>
58
+ {children}
59
+ </Heading>
60
+ ),
61
+ h3: ({ children, id }) => (
62
+ <Heading level={3} id={id}>
63
+ {children}
64
+ </Heading>
65
+ ),
66
+ h4: ({ children, id }) => (
67
+ <Heading level={4} id={id}>
68
+ {children}
69
+ </Heading>
70
+ ),
71
+ h5: ({ children, id }) => (
72
+ <Heading level={5} id={id}>
73
+ {children}
74
+ </Heading>
75
+ ),
76
+ h6: ({ children, id }) => (
77
+ <Heading level={6} id={id}>
78
+ {children}
79
+ </Heading>
80
+ ),
81
+ a: ({ href, node, ...props }) =>
82
+ href && !href.startsWith("http") ? (
83
+ <AnchorLink to={href} relative="path" {...props} />
84
+ ) : (
85
+ <a href={href} target="_blank" {...props} rel="noreferrer" />
86
+ ),
87
+ Link,
88
+ Alert,
89
+ Badge,
90
+ Button,
91
+ Callout,
92
+ Stepper,
93
+ Mermaid: (props) => (
94
+ <Suspense>
95
+ <Mermaid {...props} />
96
+ </Suspense>
97
+ ),
98
+ SyntaxHighlight: (props) => (
99
+ <Suspense>
100
+ <SyntaxHighlight {...props} />
101
+ </Suspense>
102
+ ),
103
+ tip: (props) => <Callout type="tip" {...props} />,
104
+ info: (props) => <Callout type="info" {...props} />,
105
+ note: (props) => <Callout type="note" {...props} />,
106
+ caution: (props) => <Callout type="caution" {...props} />,
107
+ warning: (props) => <Callout type="caution" {...props} />,
108
+ danger: (props) => <Callout type="danger" {...props} />,
109
+ CodeTabs: (props) => (
110
+ <Suspense>
111
+ <CodeTabs {...props} />
112
+ </Suspense>
113
+ ),
114
+ CodeTabPanel,
115
+ pre: (props) => (
116
+ <pre className={cn("not-prose my-4", props.className)} {...props} />
117
+ ),
118
+ code: ({
119
+ className,
120
+ node: _node,
121
+ children,
122
+ title,
123
+ icon,
124
+ inline,
125
+ showLineNumbers,
126
+ ...props
127
+ }) => {
128
+ const match = className?.match(/language-(\w+)/);
129
+
130
+ if (inline === "true" || inline === true) {
131
+ return (
132
+ <InlineCode className={cn(className, "inline")}>{children}</InlineCode>
133
+ );
134
+ }
135
+
136
+ return (
137
+ <CodeBlock
138
+ language={match?.[1]}
139
+ icon={icon}
140
+ showLanguageIndicator
141
+ showLineNumbers={showLineNumbers}
142
+ title={title}
143
+ >
144
+ <code className={cn(className, HIGHLIGHT_CODE_BLOCK_CLASS)} {...props}>
145
+ {children}
146
+ </code>
147
+ </CodeBlock>
148
+ );
149
+ },
150
+ } satisfies MdxComponentsType;