zudoku 0.3.0-dev.54 → 0.3.0-dev.56

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 (67) hide show
  1. package/dist/config/validators/validate.d.ts +12 -12
  2. package/dist/lib/components/DeveloperHint.d.ts +5 -0
  3. package/dist/lib/components/DeveloperHint.js +10 -0
  4. package/dist/lib/components/DeveloperHint.js.map +1 -0
  5. package/dist/lib/components/NotFoundPage.js +2 -2
  6. package/dist/lib/components/NotFoundPage.js.map +1 -1
  7. package/dist/lib/plugins/api-keys/ProtectedRoute.d.ts +1 -0
  8. package/dist/lib/plugins/api-keys/ProtectedRoute.js +14 -0
  9. package/dist/lib/plugins/api-keys/ProtectedRoute.js.map +1 -0
  10. package/dist/lib/plugins/api-keys/index.js +2 -12
  11. package/dist/lib/plugins/api-keys/index.js.map +1 -1
  12. package/dist/lib/plugins/openapi/OperationList.js +2 -2
  13. package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
  14. package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js +3 -3
  15. package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js.map +1 -1
  16. package/lib/{AnchorLink-BCN_a_Uz.js → AnchorLink-GNsUeGSX.js} +2 -2
  17. package/lib/{AnchorLink-BCN_a_Uz.js.map → AnchorLink-GNsUeGSX.js.map} +1 -1
  18. package/lib/Button-DpHMZvVs.js +4571 -0
  19. package/lib/Button-DpHMZvVs.js.map +1 -0
  20. package/lib/{Markdown-aE_XoLNs.js → Markdown-DtLFdxD1.js} +130 -129
  21. package/lib/{Markdown-aE_XoLNs.js.map → Markdown-DtLFdxD1.js.map} +1 -1
  22. package/lib/{MdxPage-Bsc79cD-.js → MdxPage-CbwYRKf5.js} +3 -3
  23. package/lib/{MdxPage-Bsc79cD-.js.map → MdxPage-CbwYRKf5.js.map} +1 -1
  24. package/lib/OperationList-DpR4KzIJ.js +5570 -0
  25. package/lib/OperationList-DpR4KzIJ.js.map +1 -0
  26. package/lib/{Route-D-egsGHx.js → Route-C1LyvITr.js} +2 -2
  27. package/lib/{Route-D-egsGHx.js.map → Route-C1LyvITr.js.map} +1 -1
  28. package/lib/{index-DseBZFJ-.js → Spinner-Bhbs5aPI.js} +46 -34
  29. package/lib/Spinner-Bhbs5aPI.js.map +1 -0
  30. package/lib/{hook-CKqQERWo.js → hook-Biq3zYel.js} +40 -25
  31. package/lib/hook-Biq3zYel.js.map +1 -0
  32. package/lib/{index-jsFBaizC.js → index-DZ910ttL.js} +10 -10
  33. package/lib/{index-jsFBaizC.js.map → index-DZ910ttL.js.map} +1 -1
  34. package/lib/index-gsAuUwQh.js +418 -0
  35. package/lib/index-gsAuUwQh.js.map +1 -0
  36. package/lib/{urql-DEKdguFl.js → urql-DMlBWUKL.js} +3 -3
  37. package/lib/{urql-DEKdguFl.js.map → urql-DMlBWUKL.js.map} +1 -1
  38. package/lib/zudoku.components.js +18 -19
  39. package/lib/zudoku.components.js.map +1 -1
  40. package/lib/zudoku.openapi-worker.js +1 -1
  41. package/lib/zudoku.plugin-api-keys.js +89 -85
  42. package/lib/zudoku.plugin-api-keys.js.map +1 -1
  43. package/lib/zudoku.plugin-markdown.js +1 -1
  44. package/lib/zudoku.plugin-openapi.js +3 -3
  45. package/package.json +1 -1
  46. package/src/lib/components/DeveloperHint.tsx +25 -0
  47. package/src/lib/components/NotFoundPage.tsx +8 -14
  48. package/src/lib/plugins/api-keys/ProtectedRoute.tsx +29 -0
  49. package/src/lib/plugins/api-keys/index.tsx +2 -21
  50. package/src/lib/plugins/openapi/OperationList.tsx +5 -8
  51. package/src/lib/plugins/openapi/playground/PlaygroundDialog.tsx +3 -5
  52. package/lib/Combination-B0Iu6mhJ.js +0 -915
  53. package/lib/Combination-B0Iu6mhJ.js.map +0 -1
  54. package/lib/OperationList-K-JWBxau.js +0 -5091
  55. package/lib/OperationList-K-JWBxau.js.map +0 -1
  56. package/lib/Playground-Czy7ha9z.js +0 -502
  57. package/lib/Playground-Czy7ha9z.js.map +0 -1
  58. package/lib/Select-CcBbwJ2R.js +0 -3667
  59. package/lib/Select-CcBbwJ2R.js.map +0 -1
  60. package/lib/Spinner-C9_Opdev.js +0 -15
  61. package/lib/Spinner-C9_Opdev.js.map +0 -1
  62. package/lib/hook-CKqQERWo.js.map +0 -1
  63. package/lib/index-ByHya67R.js +0 -207
  64. package/lib/index-ByHya67R.js.map +0 -1
  65. package/lib/index-DseBZFJ-.js.map +0 -1
  66. package/lib/mutation-DjbQSHzT.js +0 -208
  67. package/lib/mutation-DjbQSHzT.js.map +0 -1
@@ -1,14 +1,13 @@
1
- import { Outlet, type RouteObject } from "react-router-dom";
1
+ import { type RouteObject } from "react-router-dom";
2
2
  import invariant from "tiny-invariant";
3
- import { useAuth } from "../../authentication/hook.js";
4
3
  import { DevPortalContext } from "../../core/DevPortalContext.js";
5
4
  import {
6
5
  type ApiIdentityPlugin,
7
6
  type DevPortalPlugin,
8
7
  } from "../../core/plugins.js";
9
8
  import { RouterError } from "../../errors/RouterError.js";
10
- import { Button } from "../../ui/Button.js";
11
9
  import { CreateApiKey } from "./CreateApiKey.js";
10
+ import { ProtectedRoute } from "./ProtectedRoute.js";
12
11
  import { SettingsApiKeys } from "./SettingsApiKeys.js";
13
12
 
14
13
  const DEFAULT_API_KEY_ENDPOINT =
@@ -81,24 +80,6 @@ const createDefaultHandler = (endpoint: string): ApiKeyService => {
81
80
  };
82
81
  };
83
82
 
84
- const ProtectedRoute = () => {
85
- const auth = useAuth();
86
-
87
- // TODO: should we suspend here somehow?
88
- if (auth.isPending) {
89
- return null;
90
- }
91
-
92
- return auth.isAuthenticated ? (
93
- <Outlet />
94
- ) : (
95
- <div className="flex flex-col justify-center gap-2 items-center h-1/2 my-12">
96
- Please login first to view this page
97
- <Button onClick={() => auth.login()}>Login</Button>
98
- </div>
99
- );
100
- };
101
-
102
83
  export const apiKeyPlugin = (
103
84
  options: ApiKeyPluginOptions,
104
85
  ): DevPortalPlugin & ApiIdentityPlugin => {
@@ -1,11 +1,11 @@
1
1
  import { ResultOf } from "@graphql-typed-document-node/core";
2
2
  import { CategoryHeading } from "../../components/CategoryHeading.js";
3
+ import { DeveloperHint } from "../../components/DeveloperHint.js";
3
4
  import { ErrorPage } from "../../components/ErrorPage.js";
4
5
  import { Heading } from "../../components/Heading.js";
5
6
  import { InlineCode } from "../../components/InlineCode.js";
6
7
  import { Markdown } from "../../components/Markdown.js";
7
8
  import { SyntaxHighlight } from "../../components/SyntaxHighlight.js";
8
- import { Callout } from "../../ui/Callout.js";
9
9
  import { cn } from "../../util/cn.js";
10
10
  import { OperationListItem } from "./OperationListItem.js";
11
11
  import { useOasConfig } from "./context.js";
@@ -106,13 +106,10 @@ export const OperationList = () => {
106
106
  title="Schema cannot be displayed"
107
107
  message={
108
108
  <>
109
- {import.meta.env.DEV && (
110
- <Callout type="danger" title="Developer hint" className="mb-4">
111
- Check your configuration value{" "}
112
- <InlineCode>apis.type</InlineCode> and{" "}
113
- <InlineCode>apis.input</InlineCode> in the Zudoku config.
114
- </Callout>
115
- )}
109
+ <DeveloperHint className="mb-4">
110
+ Check your configuration value <InlineCode>apis.type</InlineCode>{" "}
111
+ and <InlineCode>apis.input</InlineCode> in the Zudoku config.
112
+ </DeveloperHint>
116
113
  An error occurred while trying to fetch the API reference:
117
114
  <SyntaxHighlight code={error.toString()} language="plain" />
118
115
  </>
@@ -1,15 +1,13 @@
1
1
  import { VisuallyHidden } from "@radix-ui/react-visually-hidden";
2
2
  import { CirclePlayIcon } from "lucide-react";
3
- import { lazy, Suspense, useState } from "react";
3
+ import { useState } from "react";
4
4
  import {
5
5
  Dialog,
6
6
  DialogContent,
7
7
  DialogTitle,
8
8
  DialogTrigger,
9
9
  } from "../../../components/Dialog.js";
10
- import { type PlaygroundContentProps } from "./Playground.js";
11
-
12
- const Playground = lazy(() => import("./Playground.js"));
10
+ import { Playground, type PlaygroundContentProps } from "./Playground.js";
13
11
 
14
12
  const PlaygroundDialog = (props: PlaygroundContentProps) => {
15
13
  const [open, setOpen] = useState(false);
@@ -29,7 +27,7 @@ const PlaygroundDialog = (props: PlaygroundContentProps) => {
29
27
  <VisuallyHidden>
30
28
  <DialogTitle>Playground</DialogTitle>
31
29
  </VisuallyHidden>
32
- <Suspense>{open && <Playground {...props} />}</Suspense>
30
+ {open && <Playground {...props} />}
33
31
  </DialogContent>
34
32
  </Dialog>
35
33
  );