zudoku 0.3.0-dev.7 → 0.3.0-dev.71
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/app/App.d.ts +1 -2
- package/dist/app/App.js +1 -29
- package/dist/app/App.js.map +1 -1
- package/dist/app/demo.d.ts +2 -0
- package/dist/app/demo.js +32 -0
- package/dist/app/demo.js.map +1 -0
- package/dist/app/entry.client.d.ts +2 -0
- package/dist/app/entry.client.js +35 -0
- package/dist/app/entry.client.js.map +1 -0
- package/dist/app/entry.server.d.ts +14 -0
- package/dist/app/entry.server.js +105 -0
- package/dist/app/entry.server.js.map +1 -0
- package/dist/app/main.d.ts +6 -1
- package/dist/app/main.js +68 -12
- package/dist/app/main.js.map +1 -1
- package/dist/app/standalone.d.ts +2 -0
- package/dist/app/standalone.js +37 -0
- package/dist/app/standalone.js.map +1 -0
- package/dist/app/tailwind.d.ts +1 -1
- package/dist/app/tailwind.js +0 -4
- package/dist/app/tailwind.js.map +1 -1
- package/dist/cli/cmds/dev.js +5 -0
- package/dist/cli/cmds/dev.js.map +1 -1
- package/dist/cli/dev/handler.d.ts +1 -0
- package/dist/cli/dev/handler.js +3 -1
- package/dist/cli/dev/handler.js.map +1 -1
- package/dist/config/config.d.ts +19 -45
- package/dist/config/validators/validate.d.ts +911 -2
- package/dist/config/validators/validate.js +151 -1
- package/dist/config/validators/validate.js.map +1 -1
- package/dist/internal.d.ts +1 -0
- package/dist/internal.js +2 -0
- package/dist/internal.js.map +1 -0
- package/dist/lib/authentication/AuthenticationPlugin.d.ts +13 -0
- package/dist/lib/authentication/AuthenticationPlugin.js +31 -0
- package/dist/lib/authentication/AuthenticationPlugin.js.map +1 -0
- package/dist/lib/authentication/Callback.d.ts +1 -1
- package/dist/lib/authentication/Callback.js +3 -3
- package/dist/lib/authentication/Callback.js.map +1 -1
- package/dist/lib/authentication/authentication.d.ts +6 -9
- package/dist/lib/authentication/components/SignIn.d.ts +1 -0
- package/dist/lib/authentication/components/SignIn.js +10 -0
- package/dist/lib/authentication/components/SignIn.js.map +1 -0
- package/dist/lib/authentication/components/SignOut.d.ts +1 -0
- package/dist/lib/authentication/components/SignOut.js +10 -0
- package/dist/lib/authentication/components/SignOut.js.map +1 -0
- package/dist/lib/authentication/components/SignUp.d.ts +1 -0
- package/dist/lib/authentication/components/SignUp.js +10 -0
- package/dist/lib/authentication/components/SignUp.js.map +1 -0
- package/dist/lib/authentication/hook.js +2 -2
- package/dist/lib/authentication/hook.js.map +1 -1
- package/dist/lib/authentication/providers/auth0.js +4 -5
- package/dist/lib/authentication/providers/auth0.js.map +1 -1
- package/dist/lib/authentication/providers/clerk.js +59 -30
- package/dist/lib/authentication/providers/clerk.js.map +1 -1
- package/dist/lib/authentication/providers/openid.d.ts +22 -7
- package/dist/lib/authentication/providers/openid.js +66 -17
- package/dist/lib/authentication/providers/openid.js.map +1 -1
- package/dist/lib/components/Bootstrap.d.ts +13 -0
- package/dist/lib/components/Bootstrap.js +12 -0
- package/dist/lib/components/Bootstrap.js.map +1 -0
- package/dist/lib/components/DevPortal.d.ts +5 -19
- package/dist/lib/components/DevPortal.js +32 -12
- package/dist/lib/components/DevPortal.js.map +1 -1
- package/dist/lib/components/DeveloperHint.d.ts +5 -0
- package/dist/lib/components/DeveloperHint.js +10 -0
- package/dist/lib/components/DeveloperHint.js.map +1 -0
- package/dist/lib/components/ErrorPage.d.ts +6 -0
- package/dist/lib/components/ErrorPage.js +9 -0
- package/dist/lib/components/ErrorPage.js.map +1 -0
- package/dist/lib/components/Header.js +17 -3
- package/dist/lib/components/Header.js.map +1 -1
- package/dist/lib/components/Heading.d.ts +9 -4
- package/dist/lib/components/Heading.js +17 -2
- package/dist/lib/components/Heading.js.map +1 -1
- package/dist/lib/components/InlineCode.d.ts +5 -0
- package/dist/lib/components/InlineCode.js +4 -0
- package/dist/lib/components/InlineCode.js.map +1 -0
- package/dist/lib/components/Layout.js +4 -2
- package/dist/lib/components/Layout.js.map +1 -1
- package/dist/lib/components/NotFoundPage.d.ts +1 -0
- package/dist/lib/components/NotFoundPage.js +12 -0
- package/dist/lib/components/NotFoundPage.js.map +1 -0
- package/dist/lib/components/SlotletProvider.d.ts +9 -0
- package/dist/lib/components/SlotletProvider.js +11 -0
- package/dist/lib/components/SlotletProvider.js.map +1 -0
- package/dist/lib/components/SyntaxHighlight.d.ts +3 -2
- package/dist/lib/components/SyntaxHighlight.js +24 -22
- package/dist/lib/components/SyntaxHighlight.js.map +1 -1
- package/dist/lib/components/TopNavigation.d.ts +1 -1
- package/dist/lib/components/TopNavigation.js +5 -1
- package/dist/lib/components/TopNavigation.js.map +1 -1
- package/dist/lib/components/context/DevPortalProvider.d.ts +1 -1
- package/dist/lib/components/context/DevPortalProvider.js +20 -3
- package/dist/lib/components/context/DevPortalProvider.js.map +1 -1
- package/dist/lib/components/index.d.ts +32 -3
- package/dist/lib/components/index.js +21 -3
- package/dist/lib/components/index.js.map +1 -1
- package/dist/lib/components/navigation/SideNavigation.js +3 -2
- package/dist/lib/components/navigation/SideNavigation.js.map +1 -1
- package/dist/lib/components/navigation/SideNavigationCategory.js +3 -3
- package/dist/lib/components/navigation/SideNavigationCategory.js.map +1 -1
- package/dist/lib/components/navigation/SideNavigationItem.d.ts +0 -4
- package/dist/lib/components/navigation/SideNavigationItem.js +4 -4
- package/dist/lib/components/navigation/SideNavigationItem.js.map +1 -1
- package/dist/lib/components/navigation/useNavigationCollapsibleState.d.ts +4 -1
- package/dist/lib/components/navigation/useNavigationCollapsibleState.js +17 -5
- package/dist/lib/components/navigation/useNavigationCollapsibleState.js.map +1 -1
- package/dist/lib/core/DevPortalContext.d.ts +48 -12
- package/dist/lib/core/DevPortalContext.js +7 -9
- package/dist/lib/core/DevPortalContext.js.map +1 -1
- package/dist/lib/core/plugins.d.ts +16 -4
- package/dist/lib/core/plugins.js +2 -0
- package/dist/lib/core/plugins.js.map +1 -1
- package/dist/lib/errors/ErrorAlert.d.ts +3 -0
- package/dist/lib/errors/ErrorAlert.js +8 -0
- package/dist/lib/errors/ErrorAlert.js.map +1 -0
- package/dist/lib/errors/RouterError.d.ts +1 -0
- package/dist/lib/errors/RouterError.js +12 -0
- package/dist/lib/errors/RouterError.js.map +1 -0
- package/dist/lib/errors/ServerError.d.ts +3 -0
- package/dist/lib/errors/ServerError.js +6 -0
- package/dist/lib/errors/ServerError.js.map +1 -0
- package/dist/lib/errors/TopLevelError.d.ts +2 -0
- package/dist/lib/errors/TopLevelError.js +7 -0
- package/dist/lib/errors/TopLevelError.js.map +1 -0
- package/dist/lib/oas/graphql/index.js +6 -4
- package/dist/lib/oas/graphql/index.js.map +1 -1
- package/dist/lib/oas/parser/index.d.ts +1 -1
- package/dist/lib/oas/parser/index.js +38 -12
- package/dist/lib/oas/parser/index.js.map +1 -1
- package/dist/lib/plugins/{api-key → api-keys}/CreateApiKey.js +2 -2
- package/dist/lib/plugins/api-keys/CreateApiKey.js.map +1 -0
- package/dist/lib/plugins/api-keys/ProtectedRoute.d.ts +1 -0
- package/dist/lib/plugins/api-keys/ProtectedRoute.js +14 -0
- package/dist/lib/plugins/api-keys/ProtectedRoute.js.map +1 -0
- package/dist/lib/plugins/api-keys/SettingsApiKeys.js +40 -0
- package/dist/lib/plugins/api-keys/SettingsApiKeys.js.map +1 -0
- package/dist/lib/plugins/{api-key → api-keys}/index.d.ts +4 -5
- package/dist/lib/plugins/{api-key → api-keys}/index.js +12 -20
- package/dist/lib/plugins/api-keys/index.js.map +1 -0
- package/dist/lib/plugins/custom-page/index.d.ts +8 -0
- package/dist/lib/plugins/custom-page/index.js +12 -0
- package/dist/lib/plugins/custom-page/index.js.map +1 -0
- package/dist/lib/plugins/markdown/MdxPage.d.ts +3 -2
- package/dist/lib/plugins/markdown/MdxPage.js +7 -6
- package/dist/lib/plugins/markdown/MdxPage.js.map +1 -1
- package/dist/lib/plugins/markdown/Toc.js +17 -9
- package/dist/lib/plugins/markdown/Toc.js.map +1 -1
- package/dist/lib/plugins/markdown/generateRoutes.d.ts +3 -3
- package/dist/lib/plugins/markdown/generateRoutes.js +4 -4
- package/dist/lib/plugins/markdown/generateRoutes.js.map +1 -1
- package/dist/lib/plugins/markdown/index.d.ts +4 -1
- package/dist/lib/plugins/markdown/index.js +3 -7
- package/dist/lib/plugins/markdown/index.js.map +1 -1
- package/dist/lib/plugins/openapi/ColorizedParam.d.ts +2 -1
- package/dist/lib/plugins/openapi/ColorizedParam.js +14 -9
- package/dist/lib/plugins/openapi/ColorizedParam.js.map +1 -1
- package/dist/lib/plugins/openapi/OperationList.js +17 -5
- package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
- package/dist/lib/plugins/openapi/OperationListItem.js +10 -5
- package/dist/lib/plugins/openapi/OperationListItem.js.map +1 -1
- package/dist/lib/plugins/openapi/ParameterList.js +1 -1
- package/dist/lib/plugins/openapi/ParameterList.js.map +1 -1
- package/dist/lib/plugins/openapi/ParameterListItem.js +1 -1
- package/dist/lib/plugins/openapi/ParameterListItem.js.map +1 -1
- package/dist/lib/plugins/openapi/{MakeRequest.d.ts → PlaygroundDialogWrapper.d.ts} +1 -1
- package/dist/lib/plugins/openapi/{MakeRequest.js → PlaygroundDialogWrapper.js} +4 -16
- package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.js.map +1 -0
- package/dist/lib/plugins/openapi/RequestBodySidecarBox.js +1 -9
- package/dist/lib/plugins/openapi/RequestBodySidecarBox.js.map +1 -1
- package/dist/lib/plugins/openapi/ResponsesSidecarBox.js +1 -1
- package/dist/lib/plugins/openapi/ResponsesSidecarBox.js.map +1 -1
- package/dist/lib/plugins/openapi/Route.d.ts +6 -0
- package/dist/lib/plugins/openapi/Route.js +8 -0
- package/dist/lib/plugins/openapi/Route.js.map +1 -0
- package/dist/lib/plugins/openapi/SchemaListView.js +6 -27
- package/dist/lib/plugins/openapi/SchemaListView.js.map +1 -1
- package/dist/lib/plugins/openapi/SchemaListViewItem.d.ts +7 -0
- package/dist/lib/plugins/openapi/SchemaListViewItem.js +16 -0
- package/dist/lib/plugins/openapi/SchemaListViewItem.js.map +1 -0
- package/dist/lib/plugins/openapi/SchemaListViewItemGroup.d.ts +8 -0
- package/dist/lib/plugins/openapi/SchemaListViewItemGroup.js +17 -0
- package/dist/lib/plugins/openapi/SchemaListViewItemGroup.js.map +1 -0
- package/dist/lib/plugins/openapi/Sidecar.js +26 -19
- package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
- package/dist/lib/plugins/openapi/SidecarBox.d.ts +1 -0
- package/dist/lib/plugins/openapi/SidecarBox.js +3 -2
- package/dist/lib/plugins/openapi/SidecarBox.js.map +1 -1
- package/dist/lib/plugins/openapi/{Select.d.ts → SimpleSelect.d.ts} +3 -2
- package/dist/lib/plugins/openapi/SimpleSelect.js +5 -0
- package/dist/lib/plugins/openapi/SimpleSelect.js.map +1 -0
- package/dist/lib/plugins/openapi/StaggeredRender.d.ts +8 -0
- package/dist/lib/plugins/openapi/StaggeredRender.js +18 -0
- package/dist/lib/plugins/openapi/StaggeredRender.js.map +1 -0
- package/dist/lib/plugins/openapi/client/createMemoryClient.d.ts +12 -0
- package/dist/lib/plugins/openapi/client/createMemoryClient.js +46 -0
- package/dist/lib/plugins/openapi/client/createMemoryClient.js.map +1 -0
- package/dist/lib/plugins/openapi/client/createServer.d.ts +4 -0
- package/dist/lib/plugins/openapi/client/createServer.js +30 -0
- package/dist/lib/plugins/openapi/client/createServer.js.map +1 -0
- package/dist/lib/plugins/openapi/client/createWorkerClient.d.ts +10 -0
- package/dist/lib/plugins/openapi/{worker/createSharedWorkerClient.js → client/createWorkerClient.js} +15 -2
- package/dist/lib/plugins/openapi/client/createWorkerClient.js.map +1 -0
- package/dist/lib/plugins/openapi/client/interfaces.d.ts +4 -0
- package/dist/lib/plugins/openapi/client/interfaces.js +2 -0
- package/dist/lib/plugins/openapi/client/interfaces.js.map +1 -0
- package/dist/lib/plugins/openapi/{worker → client}/worker.js +2 -2
- package/dist/lib/plugins/openapi/client/worker.js.map +1 -0
- package/dist/lib/plugins/openapi/context.d.ts +5 -0
- package/dist/lib/plugins/openapi/context.js +11 -0
- package/dist/lib/plugins/openapi/context.js.map +1 -0
- package/dist/lib/plugins/openapi/index.d.ts +4 -18
- package/dist/lib/plugins/openapi/index.js +35 -20
- package/dist/lib/plugins/openapi/index.js.map +1 -1
- package/dist/lib/plugins/openapi/interfaces.d.ts +15 -0
- package/dist/lib/plugins/openapi/interfaces.js +2 -0
- package/dist/lib/plugins/openapi/interfaces.js.map +1 -0
- package/dist/lib/plugins/openapi/playground/PathParams.d.ts +2 -2
- package/dist/lib/plugins/openapi/playground/PathParams.js +9 -12
- package/dist/lib/plugins/openapi/playground/PathParams.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/Playground.d.ts +5 -5
- package/dist/lib/plugins/openapi/playground/Playground.js +31 -15
- package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/PlaygroundDialog.d.ts +3 -0
- package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js +12 -0
- package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js.map +1 -0
- package/dist/lib/plugins/openapi/playground/QueryParams.d.ts +2 -2
- package/dist/lib/plugins/openapi/playground/QueryParams.js +13 -9
- package/dist/lib/plugins/openapi/playground/QueryParams.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/createUrl.d.ts +1 -1
- package/dist/lib/plugins/openapi/playground/createUrl.js +5 -9
- package/dist/lib/plugins/openapi/playground/createUrl.js.map +1 -1
- package/dist/lib/plugins/openapi/util/prose.d.ts +1 -0
- package/dist/lib/plugins/openapi/util/prose.js +4 -0
- package/dist/lib/plugins/openapi/util/prose.js.map +1 -0
- package/dist/lib/plugins/openapi-worker.d.ts +1 -1
- package/dist/lib/plugins/openapi-worker.js +1 -1
- package/dist/lib/plugins/openapi-worker.js.map +1 -1
- package/dist/lib/plugins/redirect/index.d.ts +0 -1
- package/dist/lib/plugins/redirect/index.js +3 -4
- package/dist/lib/plugins/redirect/index.js.map +1 -1
- package/dist/lib/ui/Callout.js +2 -2
- package/dist/lib/ui/Callout.js.map +1 -1
- package/dist/lib/ui/Card.js +1 -1
- package/dist/lib/ui/Card.js.map +1 -1
- package/dist/lib/ui/DropdownMenu.d.ts +27 -0
- package/dist/lib/ui/DropdownMenu.js +36 -0
- package/dist/lib/ui/DropdownMenu.js.map +1 -0
- package/dist/lib/ui/Input.js.map +1 -0
- package/dist/lib/ui/button-variants.d.ts +2 -2
- package/dist/lib/ui/button-variants.js +1 -0
- package/dist/lib/ui/button-variants.js.map +1 -1
- package/dist/lib/util/MdxComponents.d.ts +2 -2
- package/dist/lib/util/MdxComponents.js +7 -5
- package/dist/lib/util/MdxComponents.js.map +1 -1
- package/dist/lib/util/groupBy.d.ts +1 -6
- package/dist/lib/util/groupBy.js +10 -8
- package/dist/lib/util/groupBy.js.map +1 -1
- package/dist/lib/util/invariant.d.ts +6 -0
- package/dist/lib/util/invariant.js +21 -0
- package/dist/lib/util/invariant.js.map +1 -0
- package/dist/lib/util/joinPath.js +2 -1
- package/dist/lib/util/joinPath.js.map +1 -1
- package/dist/lib/util/logInit.d.ts +1 -0
- package/dist/lib/util/logInit.js +9 -0
- package/dist/lib/util/logInit.js.map +1 -0
- package/dist/lib/util/objectEntries.d.ts +4 -0
- package/dist/lib/util/objectEntries.js +2 -0
- package/dist/lib/util/objectEntries.js.map +1 -0
- package/dist/lib/util/renderIf.d.ts +1 -0
- package/dist/lib/util/renderIf.js +2 -0
- package/dist/lib/util/renderIf.js.map +1 -0
- package/dist/lib/util/requestIdleCallbackPolyfill.d.ts +1 -0
- package/dist/lib/util/requestIdleCallbackPolyfill.js +7 -0
- package/dist/lib/util/requestIdleCallbackPolyfill.js.map +1 -0
- package/dist/vite/build.js +30 -7
- package/dist/vite/build.js.map +1 -1
- package/dist/vite/config.d.ts +21 -12
- package/dist/vite/config.js +107 -55
- package/dist/vite/config.js.map +1 -1
- package/dist/vite/config.test.js +6 -3
- package/dist/vite/config.test.js.map +1 -1
- package/dist/vite/dev-server.d.ts +2 -1
- package/dist/vite/dev-server.js +44 -15
- package/dist/vite/dev-server.js.map +1 -1
- package/dist/vite/html.js +18 -5
- package/dist/vite/html.js.map +1 -1
- package/dist/vite/plugin-api-keys.js +7 -8
- package/dist/vite/plugin-api-keys.js.map +1 -1
- package/dist/vite/plugin-api.js +9 -20
- package/dist/vite/plugin-api.js.map +1 -1
- package/dist/vite/plugin-auth.js +5 -6
- package/dist/vite/plugin-auth.js.map +1 -1
- package/dist/vite/plugin-component.js +5 -2
- package/dist/vite/plugin-component.js.map +1 -1
- package/dist/vite/plugin-config.d.ts +0 -2
- package/dist/vite/plugin-config.js +2 -13
- package/dist/vite/plugin-config.js.map +1 -1
- package/dist/vite/plugin-custom-css.d.ts +6 -0
- package/dist/vite/plugin-custom-css.js +54 -0
- package/dist/vite/plugin-custom-css.js.map +1 -0
- package/dist/vite/plugin-docs.js +15 -5
- package/dist/vite/plugin-docs.js.map +1 -1
- package/dist/vite/plugin-mdx.d.ts +3 -1
- package/dist/vite/plugin-mdx.js +5 -5
- package/dist/vite/plugin-mdx.js.map +1 -1
- package/dist/vite/plugin-metadata.js +1 -1
- package/dist/vite/plugin-metadata.js.map +1 -1
- package/dist/vite/plugin-redirect.js +10 -10
- package/dist/vite/plugin-redirect.js.map +1 -1
- package/dist/vite/plugin.js +3 -5
- package/dist/vite/plugin.js.map +1 -1
- package/dist/vite/prerender.d.ts +17 -0
- package/dist/vite/prerender.js +79 -0
- package/dist/vite/prerender.js.map +1 -0
- package/lib/AnchorLink-C_pYhuZi.js +705 -0
- package/lib/AnchorLink-C_pYhuZi.js.map +1 -0
- package/lib/AuthenticationPlugin-RvXALgvS.js +52 -0
- package/lib/AuthenticationPlugin-RvXALgvS.js.map +1 -0
- package/lib/CategoryHeading-D5Q-X6lE.js +10 -0
- package/lib/CategoryHeading-D5Q-X6lE.js.map +1 -0
- package/lib/Combination-Cq0UkOXq.js +2774 -0
- package/lib/Combination-Cq0UkOXq.js.map +1 -0
- package/lib/DevPortalProvider-BBhQ8kgI.js +1125 -0
- package/lib/DevPortalProvider-BBhQ8kgI.js.map +1 -0
- package/lib/Input-DdAxw3vC.js +2239 -0
- package/lib/Input-DdAxw3vC.js.map +1 -0
- package/lib/Markdown-DsCvZnhw.js +15035 -0
- package/lib/Markdown-DsCvZnhw.js.map +1 -0
- package/lib/MdxPage-B_7x36CA.js +200 -0
- package/lib/MdxPage-B_7x36CA.js.map +1 -0
- package/lib/OperationList-i6FGZUu4.js +5467 -0
- package/lib/OperationList-i6FGZUu4.js.map +1 -0
- package/lib/Route-Bsrd0acQ.js +13 -0
- package/lib/Route-Bsrd0acQ.js.map +1 -0
- package/lib/SlotletProvider-CpNYmq6S.js +102 -0
- package/lib/SlotletProvider-CpNYmq6S.js.map +1 -0
- package/lib/Spinner-BBPlEab_.js +359 -0
- package/lib/Spinner-BBPlEab_.js.map +1 -0
- package/lib/_commonjsHelpers-BVfed4GL.js +29 -0
- package/lib/_commonjsHelpers-BVfed4GL.js.map +1 -0
- package/lib/assets/index-BPdJm2ty.js +1 -0
- package/lib/assets/index-BPdJm2ty.js.map +1 -0
- package/lib/assets/{worker-BCcpCNJ7.js → worker-BWwCA-wk.js} +10727 -10300
- package/lib/assets/worker-BWwCA-wk.js.map +1 -0
- package/lib/context-_fYfJFgk.js +14 -0
- package/lib/context-_fYfJFgk.js.map +1 -0
- package/lib/index-DT-cf5tv.js +726 -0
- package/lib/index-DT-cf5tv.js.map +1 -0
- package/lib/index-pI9JkN46.js +4765 -0
- package/lib/index-pI9JkN46.js.map +1 -0
- package/lib/jsx-runtime-BIr0WBt_.js +1526 -0
- package/lib/jsx-runtime-BIr0WBt_.js.map +1 -0
- package/lib/prism-bash.min-DadFsM4Z.js +1 -0
- package/lib/prism-bash.min-DadFsM4Z.js.map +1 -0
- package/lib/prism-csharp.min-Yizuc34Y.js +1 -0
- package/lib/prism-csharp.min-Yizuc34Y.js.map +1 -0
- package/lib/prism-java.min-d5iT_mOd.js +1 -0
- package/lib/prism-java.min-d5iT_mOd.js.map +1 -0
- package/lib/prism-json.min-B1GJqK1k.js +1 -0
- package/lib/prism-json.min-B1GJqK1k.js.map +1 -0
- package/lib/prism-markup-templating-DZrrEs0A.js +1 -0
- package/lib/prism-markup-templating-DZrrEs0A.js.map +1 -0
- package/lib/prism-objectivec.min-BXSWqpJJ.js +1 -0
- package/lib/prism-objectivec.min-BXSWqpJJ.js.map +1 -0
- package/lib/prism-php.min-o7FpoMP_.js +1 -0
- package/lib/prism-php.min-o7FpoMP_.js.map +1 -0
- package/lib/prism-ruby.min-C7LwcKyz.js +1 -0
- package/lib/prism-ruby.min-C7LwcKyz.js.map +1 -0
- package/lib/router-BiRCp01d.js +2971 -0
- package/lib/router-BiRCp01d.js.map +1 -0
- package/lib/slugify-CiPVjteN.js +28 -0
- package/lib/slugify-CiPVjteN.js.map +1 -0
- package/lib/state-DKdaQzvh.js +288 -0
- package/lib/state-DKdaQzvh.js.map +1 -0
- package/lib/urql-DMlBWUKL.js +1 -0
- package/lib/urql-DMlBWUKL.js.map +1 -0
- package/lib/zudoku.auth-auth0.js +15 -13
- package/lib/zudoku.auth-auth0.js.map +1 -0
- package/lib/zudoku.auth-clerk.js +59 -29
- package/lib/zudoku.auth-clerk.js.map +1 -0
- package/lib/zudoku.auth-openid.js +720 -542
- package/lib/zudoku.auth-openid.js.map +1 -0
- package/lib/zudoku.components.js +1835 -550
- package/lib/zudoku.components.js.map +1 -0
- package/lib/zudoku.openapi-worker.js +15035 -146
- package/lib/zudoku.openapi-worker.js.map +1 -0
- package/lib/zudoku.plugin-api-keys.js +300 -0
- package/lib/zudoku.plugin-api-keys.js.map +1 -0
- package/lib/zudoku.plugin-custom-page.js +13 -0
- package/lib/zudoku.plugin-custom-page.js.map +1 -0
- package/lib/zudoku.plugin-markdown.js +48 -0
- package/lib/zudoku.plugin-markdown.js.map +1 -0
- package/lib/zudoku.plugin-openapi.js +10 -0
- package/lib/zudoku.plugin-openapi.js.map +1 -0
- package/lib/zudoku.plugin-redirect.js +11 -0
- package/lib/zudoku.plugin-redirect.js.map +1 -0
- package/package.json +60 -25
- package/src/app/App.tsx +0 -41
- package/src/app/demo-cdn.html +26 -0
- package/src/app/demo.html +18 -0
- package/src/app/demo.tsx +45 -0
- package/src/app/entry.client.tsx +47 -0
- package/src/app/entry.server.tsx +160 -0
- package/src/app/main.css +84 -4
- package/src/app/main.tsx +87 -15
- package/src/app/standalone.html +20 -0
- package/src/app/standalone.tsx +51 -0
- package/src/app/tailwind.ts +2 -6
- package/src/lib/authentication/AuthenticationPlugin.tsx +38 -0
- package/src/lib/authentication/Callback.tsx +4 -4
- package/src/lib/authentication/authentication.ts +6 -12
- package/src/lib/authentication/components/SignIn.tsx +11 -0
- package/src/lib/authentication/components/SignOut.tsx +11 -0
- package/src/lib/authentication/components/SignUp.tsx +11 -0
- package/src/lib/authentication/hook.ts +2 -2
- package/src/lib/authentication/providers/auth0.tsx +6 -5
- package/src/lib/authentication/providers/clerk.tsx +63 -31
- package/src/lib/authentication/providers/openid.tsx +77 -18
- package/src/lib/components/Bootstrap.tsx +44 -0
- package/src/lib/components/DevPortal.tsx +59 -49
- package/src/lib/components/DeveloperHint.tsx +25 -0
- package/src/lib/components/ErrorPage.tsx +28 -0
- package/src/lib/components/Header.tsx +97 -32
- package/src/lib/components/Heading.tsx +26 -7
- package/src/lib/components/InlineCode.tsx +19 -0
- package/src/lib/components/Layout.tsx +12 -7
- package/src/lib/components/NotFoundPage.tsx +33 -0
- package/src/lib/components/SlotletProvider.tsx +25 -0
- package/src/lib/components/SyntaxHighlight.tsx +53 -44
- package/src/lib/components/TopNavigation.tsx +6 -1
- package/src/lib/components/context/DevPortalProvider.ts +24 -4
- package/src/lib/components/index.ts +25 -3
- package/src/lib/components/navigation/SideNavigation.tsx +3 -0
- package/src/lib/components/navigation/SideNavigationCategory.tsx +5 -9
- package/src/lib/components/navigation/SideNavigationItem.tsx +5 -9
- package/src/lib/components/navigation/useNavigationCollapsibleState.ts +21 -6
- package/src/lib/core/DevPortalContext.ts +56 -25
- package/src/lib/core/plugins.ts +26 -5
- package/src/lib/errors/ErrorAlert.tsx +21 -0
- package/src/lib/errors/RouterError.tsx +13 -0
- package/src/lib/errors/ServerError.tsx +5 -0
- package/src/lib/errors/TopLevelError.tsx +8 -0
- package/src/lib/oas/graphql/index.ts +9 -5
- package/src/lib/oas/parser/index.ts +41 -20
- package/src/lib/plugins/{api-key → api-keys}/CreateApiKey.tsx +2 -2
- package/src/lib/plugins/api-keys/ProtectedRoute.tsx +29 -0
- package/src/lib/plugins/{api-key → api-keys}/SettingsApiKeys.tsx +19 -9
- package/src/lib/plugins/{api-key → api-keys}/index.tsx +17 -41
- package/src/lib/plugins/custom-page/index.tsx +22 -0
- package/src/lib/plugins/markdown/MdxPage.tsx +51 -34
- package/src/lib/plugins/markdown/Toc.tsx +53 -40
- package/src/lib/plugins/markdown/generateRoutes.tsx +16 -6
- package/src/lib/plugins/markdown/index.tsx +10 -7
- package/src/lib/plugins/openapi/ColorizedParam.tsx +23 -16
- package/src/lib/plugins/openapi/OperationList.tsx +46 -10
- package/src/lib/plugins/openapi/OperationListItem.tsx +68 -42
- package/src/lib/plugins/openapi/ParameterList.tsx +1 -1
- package/src/lib/plugins/openapi/ParameterListItem.tsx +3 -4
- package/src/lib/plugins/openapi/{MakeRequest.tsx → PlaygroundDialogWrapper.tsx} +3 -19
- package/src/lib/plugins/openapi/RequestBodySidecarBox.tsx +2 -16
- package/src/lib/plugins/openapi/ResponsesSidecarBox.tsx +3 -2
- package/src/lib/plugins/openapi/Route.tsx +21 -0
- package/src/lib/plugins/openapi/SchemaListView.tsx +23 -192
- package/src/lib/plugins/openapi/SchemaListViewItem.tsx +110 -0
- package/src/lib/plugins/openapi/SchemaListViewItemGroup.tsx +63 -0
- package/src/lib/plugins/openapi/Sidecar.tsx +40 -28
- package/src/lib/plugins/openapi/SidecarBox.tsx +13 -2
- package/src/lib/plugins/openapi/{Select.tsx → SimpleSelect.tsx} +6 -3
- package/src/lib/plugins/openapi/StaggeredRender.tsx +31 -0
- package/src/lib/plugins/openapi/client/createMemoryClient.ts +56 -0
- package/src/lib/plugins/openapi/client/createServer.ts +33 -0
- package/src/lib/plugins/openapi/{worker/createSharedWorkerClient.ts → client/createWorkerClient.ts} +21 -2
- package/src/lib/plugins/openapi/client/interfaces.ts +5 -0
- package/src/lib/plugins/openapi/{worker → client}/worker.ts +3 -3
- package/src/lib/plugins/openapi/context.tsx +16 -0
- package/src/lib/plugins/openapi/index.tsx +59 -52
- package/src/lib/plugins/openapi/interfaces.ts +9 -0
- package/src/lib/plugins/openapi/playground/PathParams.tsx +80 -48
- package/src/lib/plugins/openapi/playground/Playground.tsx +200 -210
- package/src/lib/plugins/openapi/playground/PlaygroundDialog.tsx +36 -0
- package/src/lib/plugins/openapi/playground/QueryParams.tsx +92 -65
- package/src/lib/plugins/openapi/playground/createUrl.ts +12 -15
- package/src/lib/plugins/openapi/util/prose.ts +7 -0
- package/src/lib/plugins/openapi-worker.ts +1 -1
- package/src/lib/plugins/redirect/index.tsx +3 -4
- package/src/lib/ui/Callout.tsx +4 -4
- package/src/lib/ui/Card.tsx +1 -1
- package/src/lib/ui/DropdownMenu.tsx +199 -0
- package/src/lib/ui/button-variants.ts +1 -0
- package/src/lib/util/MdxComponents.tsx +7 -15
- package/src/lib/util/groupBy.ts +7 -12
- package/src/lib/util/invariant.ts +26 -0
- package/src/lib/util/joinPath.tsx +2 -1
- package/src/lib/util/logInit.ts +9 -0
- package/src/lib/util/objectEntries.ts +5 -0
- package/src/lib/util/renderIf.ts +4 -0
- package/src/lib/util/requestIdleCallbackPolyfill.ts +6 -0
- package/dist/lib/components/Input.js.map +0 -1
- package/dist/lib/components/Link.d.ts +0 -1
- package/dist/lib/components/Link.js +0 -2
- package/dist/lib/components/Link.js.map +0 -1
- package/dist/lib/components/Router.d.ts +0 -4
- package/dist/lib/components/Router.js +0 -20
- package/dist/lib/components/Router.js.map +0 -1
- package/dist/lib/core/helmet.d.ts +0 -4
- package/dist/lib/core/helmet.js +0 -5
- package/dist/lib/core/helmet.js.map +0 -1
- package/dist/lib/core/icons.d.ts +0 -1
- package/dist/lib/core/icons.js +0 -2
- package/dist/lib/core/icons.js.map +0 -1
- package/dist/lib/core/router.d.ts +0 -1
- package/dist/lib/core/router.js +0 -2
- package/dist/lib/core/router.js.map +0 -1
- package/dist/lib/plugins/api-key/CreateApiKey.js.map +0 -1
- package/dist/lib/plugins/api-key/SettingsApiKeys.js +0 -38
- package/dist/lib/plugins/api-key/SettingsApiKeys.js.map +0 -1
- package/dist/lib/plugins/api-key/index.js.map +0 -1
- package/dist/lib/plugins/index.d.ts +0 -4
- package/dist/lib/plugins/index.js +0 -5
- package/dist/lib/plugins/index.js.map +0 -1
- package/dist/lib/plugins/openapi/MakeRequest.js.map +0 -1
- package/dist/lib/plugins/openapi/Select.js +0 -5
- package/dist/lib/plugins/openapi/Select.js.map +0 -1
- package/dist/lib/plugins/openapi/worker/createSharedWorkerClient.d.ts +0 -5
- package/dist/lib/plugins/openapi/worker/createSharedWorkerClient.js.map +0 -1
- package/dist/lib/plugins/openapi/worker/shared-worker.d.ts +0 -1
- package/dist/lib/plugins/openapi/worker/shared-worker.js +0 -6
- package/dist/lib/plugins/openapi/worker/shared-worker.js.map +0 -1
- package/dist/lib/plugins/openapi/worker/worker.js.map +0 -1
- package/dist/vite/common.d.ts +0 -1
- package/dist/vite/common.js +0 -5
- package/dist/vite/common.js.map +0 -1
- package/dist/vite/plugin-html.d.ts +0 -3
- package/dist/vite/plugin-html.js +0 -47
- package/dist/vite/plugin-html.js.map +0 -1
- package/dist/vite/plugin-openapi-worker.d.ts +0 -4
- package/dist/vite/plugin-openapi-worker.js +0 -28
- package/dist/vite/plugin-openapi-worker.js.map +0 -1
- package/lib/Spinner-BewqqUU-.js +0 -8413
- package/lib/clerk-Wslx_mPo.js +0 -19685
- package/lib/index-PyGcnQFX.js +0 -3462
- package/lib/loglevel-CoH7VSwE.js +0 -152
- package/lib/state-2Hu1renZ.js +0 -313
- package/lib/zudoku.plugins.js +0 -19902
- package/src/lib/components/Link.tsx +0 -1
- package/src/lib/components/Router.tsx +0 -28
- package/src/lib/core/helmet.ts +0 -5
- package/src/lib/core/icons.tsx +0 -1
- package/src/lib/core/router.tsx +0 -1
- package/src/lib/plugins/index.ts +0 -4
- package/src/lib/plugins/openapi/worker/shared-worker.ts +0 -5
- /package/dist/lib/plugins/{api-key → api-keys}/CreateApiKey.d.ts +0 -0
- /package/dist/lib/plugins/{api-key → api-keys}/SettingsApiKeys.d.ts +0 -0
- /package/dist/lib/plugins/openapi/{worker → client}/worker.d.ts +0 -0
- /package/dist/lib/{components → ui}/Input.d.ts +0 -0
- /package/dist/lib/{components → ui}/Input.js +0 -0
- /package/src/lib/{components → ui}/Input.tsx +0 -0
|
@@ -8,7 +8,7 @@ type BaseComponentProps<T = unknown> = PropsWithChildren<
|
|
|
8
8
|
export const Root = ({ children, className }: BaseComponentProps) => (
|
|
9
9
|
<div
|
|
10
10
|
className={cn(
|
|
11
|
-
"rounded-lg overflow-hidden border
|
|
11
|
+
"rounded-lg overflow-hidden border dark:border-transparent",
|
|
12
12
|
className,
|
|
13
13
|
)}
|
|
14
14
|
>
|
|
@@ -19,7 +19,7 @@ export const Root = ({ children, className }: BaseComponentProps) => (
|
|
|
19
19
|
export const Head = ({ children, className }: BaseComponentProps) => (
|
|
20
20
|
<div
|
|
21
21
|
className={cn(
|
|
22
|
-
"border-b
|
|
22
|
+
"border-b dark:border-zinc-600 bg-zinc-100 dark:bg-zinc-700 p-2",
|
|
23
23
|
className,
|
|
24
24
|
)}
|
|
25
25
|
>
|
|
@@ -34,3 +34,14 @@ export const Body = ({ children, className }: BaseComponentProps) => (
|
|
|
34
34
|
{children}
|
|
35
35
|
</div>
|
|
36
36
|
);
|
|
37
|
+
|
|
38
|
+
export const Footer = ({ children, className }: BaseComponentProps) => (
|
|
39
|
+
<div
|
|
40
|
+
className={cn(
|
|
41
|
+
"border-t dark:border-zinc-600 bg-zinc-100 dark:bg-zinc-700 p-2",
|
|
42
|
+
className,
|
|
43
|
+
)}
|
|
44
|
+
>
|
|
45
|
+
{children}
|
|
46
|
+
</div>
|
|
47
|
+
);
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
+
import { ChevronsUpDownIcon } from "lucide-react";
|
|
1
2
|
import type { ChangeEventHandler } from "react";
|
|
2
|
-
import { ChevronsUpDownIcon } from "../../core/icons.js";
|
|
3
3
|
import { cn } from "../../util/cn.js";
|
|
4
4
|
|
|
5
|
-
export const
|
|
5
|
+
export const SimpleSelect = ({
|
|
6
|
+
value,
|
|
6
7
|
onChange,
|
|
7
8
|
className,
|
|
8
9
|
options,
|
|
9
10
|
}: {
|
|
10
|
-
|
|
11
|
+
value: string;
|
|
12
|
+
onChange: ChangeEventHandler<HTMLSelectElement>;
|
|
11
13
|
className?: string;
|
|
12
14
|
options: {
|
|
13
15
|
value: string;
|
|
@@ -20,6 +22,7 @@ export const Select = ({
|
|
|
20
22
|
"row-start-1 col-start-1 border border-input text-foreground px-2 py-1 pe-6",
|
|
21
23
|
"rounded-md appearance-none bg-zinc-50 hover:bg-white dark:bg-zinc-800 hover:dark:bg-zinc-800/75",
|
|
22
24
|
)}
|
|
25
|
+
value={value}
|
|
23
26
|
onChange={onChange}
|
|
24
27
|
>
|
|
25
28
|
{options.map((option) => (
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Children,
|
|
3
|
+
createContext,
|
|
4
|
+
ReactNode,
|
|
5
|
+
useContext,
|
|
6
|
+
useEffect,
|
|
7
|
+
useState,
|
|
8
|
+
} from "react";
|
|
9
|
+
|
|
10
|
+
export const StaggeredRenderContext = createContext({ stagger: false });
|
|
11
|
+
|
|
12
|
+
const StaggeredRender = ({ children }: { children: ReactNode[] }) => {
|
|
13
|
+
const { stagger } = useContext(StaggeredRenderContext);
|
|
14
|
+
const [renderAll, setRenderAll] = useState(!stagger);
|
|
15
|
+
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
if (renderAll) {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const idle = requestIdleCallback(() => {
|
|
22
|
+
setRenderAll(true);
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
return () => cancelIdleCallback(idle);
|
|
26
|
+
}, [renderAll]);
|
|
27
|
+
|
|
28
|
+
return !renderAll ? Children.toArray(children).slice(0, 3) : children;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export default StaggeredRender;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/* eslint-disable no-console */
|
|
2
|
+
import {
|
|
3
|
+
cacheExchange,
|
|
4
|
+
Client,
|
|
5
|
+
fetchExchange,
|
|
6
|
+
mapExchange,
|
|
7
|
+
} from "../util/urql.js";
|
|
8
|
+
import { createServer } from "./createServer.js";
|
|
9
|
+
import { CreateClientFunction } from "./interfaces.js";
|
|
10
|
+
|
|
11
|
+
export type WorkerGraphQLMessage = { id: string; body: string };
|
|
12
|
+
|
|
13
|
+
const localServer = createServer();
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Creates an in memory Client that does not use Workers. This allows
|
|
17
|
+
* developers to run the simple standalone version of zudoku using the CDN
|
|
18
|
+
* hosted scripts. Worker's cannot be loaded cross domain so in this case
|
|
19
|
+
* we sacrifice performance for making it work cross domain.
|
|
20
|
+
*/
|
|
21
|
+
export const createClient: CreateClientFunction = () => {
|
|
22
|
+
return new Client({
|
|
23
|
+
url: "/__z/graphql",
|
|
24
|
+
// Custom fetch to send the GraphQL request to the worker and convert the response back to a `Response` object
|
|
25
|
+
fetch: async (req, init) => {
|
|
26
|
+
if (!init?.body) throw new Error("No body");
|
|
27
|
+
const response = await localServer.fetch(
|
|
28
|
+
new Request("http://localhost/__z/graphql", {
|
|
29
|
+
method: "POST",
|
|
30
|
+
body: init.body,
|
|
31
|
+
headers: {
|
|
32
|
+
"Content-Type": "application/json",
|
|
33
|
+
},
|
|
34
|
+
}),
|
|
35
|
+
);
|
|
36
|
+
return response;
|
|
37
|
+
// port.postMessage({
|
|
38
|
+
// id: e.data.id,
|
|
39
|
+
// body: await response.text(),
|
|
40
|
+
// } satisfies WorkerGraphQLMessage);
|
|
41
|
+
},
|
|
42
|
+
exchanges: [
|
|
43
|
+
cacheExchange,
|
|
44
|
+
mapExchange({
|
|
45
|
+
onError(error, operation) {
|
|
46
|
+
console.error(error);
|
|
47
|
+
console.groupCollapsed("Operation info");
|
|
48
|
+
console.log("body", operation.query.loc?.source.body.trim());
|
|
49
|
+
console.log("variables", operation.variables);
|
|
50
|
+
console.groupEnd();
|
|
51
|
+
},
|
|
52
|
+
}),
|
|
53
|
+
fetchExchange,
|
|
54
|
+
],
|
|
55
|
+
});
|
|
56
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { useLogger } from "@envelop/core";
|
|
2
|
+
import { createGraphQLServer } from "../../../oas/graphql/index.js";
|
|
3
|
+
|
|
4
|
+
const map = new Map<string, number>();
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Creates the GraphQL server
|
|
8
|
+
*/
|
|
9
|
+
export const createServer = () =>
|
|
10
|
+
createGraphQLServer({
|
|
11
|
+
plugins: [
|
|
12
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
13
|
+
useLogger({
|
|
14
|
+
logFn: (eventName, { args }) => {
|
|
15
|
+
if (import.meta.env.PROD) return;
|
|
16
|
+
|
|
17
|
+
if (eventName.endsWith("-start")) {
|
|
18
|
+
map.set(`${eventName}-${args.operationName}`, performance.now());
|
|
19
|
+
} else if (eventName.endsWith("-end")) {
|
|
20
|
+
const startEvent = eventName.replace("-end", "-start");
|
|
21
|
+
const start = map.get(`${startEvent}-${args.operationName}`);
|
|
22
|
+
if (start) {
|
|
23
|
+
// eslint-disable-next-line no-console
|
|
24
|
+
console.log(
|
|
25
|
+
`${args.operationName} query took ${performance.now() - start}ms`,
|
|
26
|
+
);
|
|
27
|
+
map.delete(`${startEvent}-${args.operationName}`);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
}),
|
|
32
|
+
],
|
|
33
|
+
});
|
package/src/lib/plugins/openapi/{worker/createSharedWorkerClient.ts → client/createWorkerClient.ts}
RENAMED
|
@@ -7,15 +7,34 @@ import {
|
|
|
7
7
|
fetchExchange,
|
|
8
8
|
mapExchange,
|
|
9
9
|
} from "../util/urql.js";
|
|
10
|
+
import { createClient as createMemoryClient } from "./createMemoryClient.js";
|
|
11
|
+
import { CreateClientFunction } from "./interfaces.js";
|
|
10
12
|
|
|
11
13
|
export type WorkerGraphQLMessage = { id: string; body: string };
|
|
12
|
-
|
|
13
14
|
const ulid = monotonicFactory();
|
|
14
|
-
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* This loads the client from a worker and uses mess port to send requests
|
|
18
|
+
* and responses between the main thread and the worker.
|
|
19
|
+
*/
|
|
20
|
+
export const createClient: CreateClientFunction = ({
|
|
21
|
+
useMemoryClient,
|
|
22
|
+
}: {
|
|
23
|
+
useMemoryClient: boolean;
|
|
24
|
+
}) => {
|
|
25
|
+
if (useMemoryClient || typeof SharedWorker === "undefined") {
|
|
26
|
+
return createMemoryClient({ useMemoryClient });
|
|
27
|
+
}
|
|
28
|
+
// NOTE: This URL needs to be inline with the SharedWorker otherwse
|
|
29
|
+
// vite build does not recognize the worker file as a module.
|
|
15
30
|
const worker = new SharedWorker(new URL("./worker.ts", import.meta.url), {
|
|
16
31
|
type: "module",
|
|
17
32
|
});
|
|
18
33
|
|
|
34
|
+
worker.onerror = (e) => {
|
|
35
|
+
console.error(e);
|
|
36
|
+
};
|
|
37
|
+
|
|
19
38
|
worker.port.start();
|
|
20
39
|
|
|
21
40
|
const [waitFor, notify] = createWaitForNotify<string>();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { type WorkerGraphQLMessage } from "./
|
|
1
|
+
import { createServer } from "./createServer.js";
|
|
2
|
+
import { type WorkerGraphQLMessage } from "./createWorkerClient.js";
|
|
3
3
|
|
|
4
|
-
const localServer =
|
|
4
|
+
const localServer = createServer();
|
|
5
5
|
|
|
6
6
|
const worker = self as unknown as SharedWorkerGlobalScope;
|
|
7
7
|
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { createContext, useContext } from "react";
|
|
2
|
+
import { OasPluginConfig } from "./interfaces.js";
|
|
3
|
+
|
|
4
|
+
const OasContext = createContext<{ config: OasPluginConfig } | undefined>(
|
|
5
|
+
undefined,
|
|
6
|
+
);
|
|
7
|
+
|
|
8
|
+
export const OasConfigProvider = OasContext.Provider;
|
|
9
|
+
|
|
10
|
+
export const useOasConfig = () => {
|
|
11
|
+
const ctx = useContext(OasContext);
|
|
12
|
+
if (!ctx) {
|
|
13
|
+
throw new Error("useOasConfig must be used within a OasConfigProvider");
|
|
14
|
+
}
|
|
15
|
+
return ctx.config;
|
|
16
|
+
};
|
|
@@ -1,61 +1,20 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { matchPath, useRouteError, type RouteObject } from "react-router-dom";
|
|
2
2
|
import {
|
|
3
3
|
type DevPortalPlugin,
|
|
4
4
|
type PluginNavigationCategory,
|
|
5
5
|
} from "../../core/plugins.js";
|
|
6
|
-
import { Outlet, matchPath, type RouteObject } from "../../core/router.js";
|
|
7
6
|
import { MethodBadge } from "./MethodBadge.js";
|
|
8
|
-
import { OperationList } from "./OperationList.js";
|
|
9
7
|
import { graphql } from "./graphql/index.js";
|
|
10
8
|
import {
|
|
11
|
-
Provider,
|
|
12
9
|
Client as UrqlClient,
|
|
13
10
|
cacheExchange,
|
|
14
11
|
fetchExchange,
|
|
15
12
|
} from "./util/urql.js";
|
|
16
13
|
|
|
17
|
-
import {
|
|
18
|
-
import
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
undefined,
|
|
22
|
-
);
|
|
23
|
-
|
|
24
|
-
export const OasConfigProvider = OasContext.Provider;
|
|
25
|
-
|
|
26
|
-
export const useOasConfig = () => {
|
|
27
|
-
const ctx = useContext(OasContext);
|
|
28
|
-
if (!ctx) {
|
|
29
|
-
throw new Error("useOasConfig must be used within a OasConfigProvider");
|
|
30
|
-
}
|
|
31
|
-
return ctx.config;
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
type OasSource =
|
|
35
|
-
| { type: "url"; input: string }
|
|
36
|
-
| { type: "yaml"; input: string }
|
|
37
|
-
| { type: "json"; input: object };
|
|
38
|
-
|
|
39
|
-
export type OasPluginConfig = {
|
|
40
|
-
server?: string;
|
|
41
|
-
path?: string;
|
|
42
|
-
} & OasSource;
|
|
43
|
-
|
|
44
|
-
const OasContextProvider = ({
|
|
45
|
-
config,
|
|
46
|
-
client,
|
|
47
|
-
}: {
|
|
48
|
-
config: OasPluginConfig;
|
|
49
|
-
client: typeof UrqlClient;
|
|
50
|
-
}) => {
|
|
51
|
-
return (
|
|
52
|
-
<Provider value={client}>
|
|
53
|
-
<OasConfigProvider value={{ config }}>
|
|
54
|
-
<Outlet />
|
|
55
|
-
</OasConfigProvider>
|
|
56
|
-
</Provider>
|
|
57
|
-
);
|
|
58
|
-
};
|
|
14
|
+
import { createClient } from "zudoku/openapi-worker";
|
|
15
|
+
import { ErrorPage } from "../../components/ErrorPage.js";
|
|
16
|
+
import { SyntaxHighlight } from "../../components/SyntaxHighlight.js";
|
|
17
|
+
import { OasPluginConfig } from "./interfaces.js";
|
|
59
18
|
|
|
60
19
|
const GetCategoriesQuery = graphql(`
|
|
61
20
|
query GetCategories($input: JSON!, $type: SchemaType!) {
|
|
@@ -77,7 +36,25 @@ const GetCategoriesQuery = graphql(`
|
|
|
77
36
|
}
|
|
78
37
|
`);
|
|
79
38
|
|
|
80
|
-
|
|
39
|
+
const OpenApiErrorPage = () => {
|
|
40
|
+
const error = useRouteError();
|
|
41
|
+
const message =
|
|
42
|
+
error instanceof Error ? (
|
|
43
|
+
<SyntaxHighlight code={error.message} />
|
|
44
|
+
) : (
|
|
45
|
+
"An unknown error occurred"
|
|
46
|
+
);
|
|
47
|
+
|
|
48
|
+
return (
|
|
49
|
+
<ErrorPage category="Error" title="An error occurred" message={message} />
|
|
50
|
+
);
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
type InternalOasPluginConfig = { inMemory?: boolean };
|
|
54
|
+
|
|
55
|
+
export const openApiPlugin = (
|
|
56
|
+
config: OasPluginConfig & InternalOasPluginConfig,
|
|
57
|
+
): DevPortalPlugin => {
|
|
81
58
|
const basePath = config.path ?? "/reference";
|
|
82
59
|
|
|
83
60
|
const client = config.server
|
|
@@ -85,11 +62,25 @@ export const openApiPlugin = (config: OasPluginConfig): DevPortalPlugin => {
|
|
|
85
62
|
url: config.server,
|
|
86
63
|
exchanges: [cacheExchange, fetchExchange],
|
|
87
64
|
})
|
|
88
|
-
: (
|
|
89
|
-
typeof createSharedWorkerClientType
|
|
90
|
-
>);
|
|
65
|
+
: createClient({ useMemoryClient: config.inMemory ?? false });
|
|
91
66
|
|
|
92
67
|
return {
|
|
68
|
+
getHead: () => {
|
|
69
|
+
if (config.type === "url") {
|
|
70
|
+
return (
|
|
71
|
+
<link
|
|
72
|
+
rel="preload"
|
|
73
|
+
href={config.input}
|
|
74
|
+
as="fetch"
|
|
75
|
+
crossOrigin="anonymous"
|
|
76
|
+
/>
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
if (config.server) {
|
|
81
|
+
return <link rel="preconnect" href={config.server} />;
|
|
82
|
+
}
|
|
83
|
+
},
|
|
93
84
|
getNavigation: async (path: string) => {
|
|
94
85
|
if (!matchPath({ path: basePath, end: false }, path)) {
|
|
95
86
|
return [];
|
|
@@ -135,11 +126,27 @@ export const openApiPlugin = (config: OasPluginConfig): DevPortalPlugin => {
|
|
|
135
126
|
getRoutes: () =>
|
|
136
127
|
[
|
|
137
128
|
{
|
|
138
|
-
|
|
129
|
+
async lazy() {
|
|
130
|
+
const { OpenApiRoute } = await import("./Route.js");
|
|
131
|
+
return {
|
|
132
|
+
element: <OpenApiRoute client={client} config={config} />,
|
|
133
|
+
};
|
|
134
|
+
},
|
|
135
|
+
errorElement: <OpenApiErrorPage />,
|
|
139
136
|
children: [
|
|
140
137
|
{
|
|
141
138
|
path: basePath,
|
|
142
|
-
children: [
|
|
139
|
+
children: [
|
|
140
|
+
{
|
|
141
|
+
index: true,
|
|
142
|
+
async lazy() {
|
|
143
|
+
const { OperationList } = await import(
|
|
144
|
+
"./OperationList.js"
|
|
145
|
+
);
|
|
146
|
+
return { element: <OperationList /> };
|
|
147
|
+
},
|
|
148
|
+
},
|
|
149
|
+
],
|
|
143
150
|
},
|
|
144
151
|
],
|
|
145
152
|
},
|
|
@@ -1,30 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { EraserIcon } from "lucide-react";
|
|
2
|
+
import {
|
|
3
|
+
Control,
|
|
4
|
+
Controller,
|
|
5
|
+
useFieldArray,
|
|
6
|
+
useFormContext,
|
|
7
|
+
UseFormRegister,
|
|
8
|
+
} from "react-hook-form";
|
|
9
|
+
import { Button } from "../../../ui/Button.js";
|
|
10
|
+
import { Input } from "../../../ui/Input.js";
|
|
3
11
|
import { cn } from "../../../util/cn.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { PlaygroundForm } from "./Playground.js";
|
|
7
|
-
|
|
8
|
-
type ParameterValueProps = {
|
|
9
|
-
part: string;
|
|
10
|
-
} & InputHTMLAttributes<HTMLInputElement>;
|
|
11
|
-
|
|
12
|
-
const ParameterValue = forwardRef<HTMLInputElement, ParameterValueProps>(
|
|
13
|
-
function ParameterValue({ part, className, ...props }, ref) {
|
|
14
|
-
const color = usePastellizedColor(part);
|
|
15
|
-
return (
|
|
16
|
-
<InlineInput
|
|
17
|
-
{...props}
|
|
18
|
-
ref={ref}
|
|
19
|
-
className={cn(className, "opacity-80 data-[active=true]:opacity-100")}
|
|
20
|
-
style={{
|
|
21
|
-
// color: `hsl(${color})`,
|
|
22
|
-
outlineColor: `hsl(${color})`,
|
|
23
|
-
}}
|
|
24
|
-
/>
|
|
25
|
-
);
|
|
26
|
-
},
|
|
27
|
-
);
|
|
12
|
+
import { ColorizedParam } from "../ColorizedParam.js";
|
|
13
|
+
import type { PlaygroundForm } from "./Playground.js";
|
|
28
14
|
|
|
29
15
|
export const PathParams = ({
|
|
30
16
|
control,
|
|
@@ -33,31 +19,77 @@ export const PathParams = ({
|
|
|
33
19
|
register: UseFormRegister<PlaygroundForm>;
|
|
34
20
|
control: Control<PlaygroundForm>;
|
|
35
21
|
}) => {
|
|
22
|
+
const form = useFormContext<PlaygroundForm>();
|
|
36
23
|
const { fields } = useFieldArray<PlaygroundForm>({
|
|
37
24
|
control,
|
|
38
25
|
name: "pathParams",
|
|
39
26
|
});
|
|
40
27
|
|
|
41
|
-
return
|
|
42
|
-
<
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
28
|
+
return (
|
|
29
|
+
<table className="w-full table-auto [&_td]:border [&_td]:py-1 [&_td]:px-2">
|
|
30
|
+
<tbody>
|
|
31
|
+
{fields.map((part, i) => (
|
|
32
|
+
<tr key={part.id} className="hover:bg-accent/40">
|
|
33
|
+
<td>
|
|
34
|
+
<Controller
|
|
35
|
+
control={control}
|
|
36
|
+
name={`pathParams.${i}.value`}
|
|
37
|
+
render={({ field }) => (
|
|
38
|
+
<ColorizedParam
|
|
39
|
+
slug={part.name}
|
|
40
|
+
name={part.name}
|
|
41
|
+
backgroundOpacity="25%"
|
|
42
|
+
borderOpacity={field.value ? "100%" : "0"}
|
|
43
|
+
className={cn(
|
|
44
|
+
"font-mono text-xs m-2",
|
|
45
|
+
!field.value && "opacity-60",
|
|
46
|
+
)}
|
|
47
|
+
/>
|
|
48
|
+
)}
|
|
49
|
+
/>
|
|
50
|
+
</td>
|
|
51
|
+
<td>
|
|
52
|
+
<div className="flex justify-between items-center">
|
|
53
|
+
<Controller
|
|
54
|
+
control={control}
|
|
55
|
+
name={`pathParams.${i}.value`}
|
|
56
|
+
render={({ field }) => (
|
|
57
|
+
<Input
|
|
58
|
+
{...field}
|
|
59
|
+
placeholder="Enter value"
|
|
60
|
+
className={cn(
|
|
61
|
+
"border-0 shadow-none ring-0 font-mono text-xs",
|
|
62
|
+
)}
|
|
63
|
+
/>
|
|
64
|
+
)}
|
|
65
|
+
/>
|
|
66
|
+
<Controller
|
|
67
|
+
control={control}
|
|
68
|
+
name={`pathParams.${i}.value`}
|
|
69
|
+
render={({ field }) => (
|
|
70
|
+
<Button
|
|
71
|
+
size="icon"
|
|
72
|
+
type="button"
|
|
73
|
+
variant="ghost"
|
|
74
|
+
aria-label="Clear value"
|
|
75
|
+
className={cn(
|
|
76
|
+
"ms-2",
|
|
77
|
+
field.value.length === 0
|
|
78
|
+
? "opacity-0 pointer-events-none"
|
|
79
|
+
: "opacity-100",
|
|
80
|
+
)}
|
|
81
|
+
title="Clear value"
|
|
82
|
+
onClick={() => field.onChange("")}
|
|
83
|
+
>
|
|
84
|
+
<EraserIcon size={16} />
|
|
85
|
+
</Button>
|
|
86
|
+
)}
|
|
87
|
+
/>
|
|
88
|
+
</div>
|
|
89
|
+
</td>
|
|
90
|
+
</tr>
|
|
91
|
+
))}
|
|
92
|
+
</tbody>
|
|
93
|
+
</table>
|
|
94
|
+
);
|
|
63
95
|
};
|