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
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import logger from "loglevel";
|
|
2
2
|
import * as oauth from "oauth4webapi";
|
|
3
3
|
import { OpenIDAuthenticationConfig } from "../../../config/config.js";
|
|
4
|
-
import { RouteObject } from "../../core/router.js";
|
|
5
4
|
import {
|
|
6
5
|
AuthenticationProvider,
|
|
7
6
|
AuthenticationProviderInitializer,
|
|
8
7
|
} from "../authentication.js";
|
|
8
|
+
import { AuthenticationPlugin } from "../AuthenticationPlugin.js";
|
|
9
9
|
import { Callback } from "../Callback.js";
|
|
10
10
|
import { AuthorizationError, OAuthAuthorizationError } from "../errors.js";
|
|
11
11
|
import { useAuthState, UserProfile } from "../state.js";
|
|
@@ -19,6 +19,25 @@ interface TokenState {
|
|
|
19
19
|
tokenType: string;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
+
class OpenIdAuthPlugin extends AuthenticationPlugin {
|
|
23
|
+
constructor(
|
|
24
|
+
private callbackUrlPath: string,
|
|
25
|
+
private handleCallback: () => Promise<string>,
|
|
26
|
+
public initialize?: () => Promise<void>,
|
|
27
|
+
) {
|
|
28
|
+
super();
|
|
29
|
+
}
|
|
30
|
+
getRoutes() {
|
|
31
|
+
return [
|
|
32
|
+
...super.getRoutes(),
|
|
33
|
+
{
|
|
34
|
+
path: this.callbackUrlPath,
|
|
35
|
+
element: <Callback handleCallback={this.handleCallback} />,
|
|
36
|
+
},
|
|
37
|
+
];
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
22
41
|
export class OpenIDAuthenticationProvider implements AuthenticationProvider {
|
|
23
42
|
protected client: oauth.Client;
|
|
24
43
|
protected issuer: string;
|
|
@@ -30,20 +49,32 @@ export class OpenIDAuthenticationProvider implements AuthenticationProvider {
|
|
|
30
49
|
|
|
31
50
|
protected callbackUrlPath = "/oauth/callback";
|
|
32
51
|
protected logoutRedirectUrlPath = "/";
|
|
52
|
+
private readonly redirectToAfterSignUp: string;
|
|
53
|
+
private readonly redirectToAfterSignIn: string;
|
|
54
|
+
private readonly redirectToAfterSignOut: string;
|
|
55
|
+
private readonly audience?: string;
|
|
33
56
|
|
|
34
57
|
constructor({
|
|
35
58
|
issuer,
|
|
59
|
+
audience,
|
|
36
60
|
authorizationEndpoint,
|
|
37
61
|
tokenEndpoint,
|
|
38
62
|
clientId,
|
|
63
|
+
redirectToAfterSignUp,
|
|
64
|
+
redirectToAfterSignIn,
|
|
65
|
+
redirectToAfterSignOut,
|
|
39
66
|
}: OpenIDAuthenticationConfig) {
|
|
40
67
|
this.client = {
|
|
41
68
|
client_id: clientId,
|
|
42
69
|
token_endpoint_auth_method: "none",
|
|
43
70
|
};
|
|
71
|
+
this.audience = audience;
|
|
44
72
|
this.issuer = issuer;
|
|
45
73
|
this.authorizationEndpoint = authorizationEndpoint;
|
|
46
74
|
this.tokenEndpoint = tokenEndpoint;
|
|
75
|
+
this.redirectToAfterSignUp = redirectToAfterSignUp ?? "/";
|
|
76
|
+
this.redirectToAfterSignIn = redirectToAfterSignIn ?? "/";
|
|
77
|
+
this.redirectToAfterSignOut = redirectToAfterSignOut ?? "/";
|
|
47
78
|
}
|
|
48
79
|
|
|
49
80
|
protected async getAuthServer() {
|
|
@@ -89,15 +120,25 @@ export class OpenIDAuthenticationProvider implements AuthenticationProvider {
|
|
|
89
120
|
expiresOn: new Date(Date.now() + response.expires_in * 1000),
|
|
90
121
|
tokenType: response.token_type,
|
|
91
122
|
};
|
|
123
|
+
localStorage.setItem("openid-token", JSON.stringify(this.tokens));
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
async signUp() {
|
|
127
|
+
return this.authorize(true);
|
|
92
128
|
}
|
|
93
129
|
|
|
94
|
-
async
|
|
95
|
-
|
|
130
|
+
async signIn() {
|
|
131
|
+
return this.authorize();
|
|
96
132
|
}
|
|
97
133
|
|
|
98
|
-
async
|
|
134
|
+
private async authorize(signUp = false): Promise<void> {
|
|
99
135
|
const code_challenge_method = "S256";
|
|
100
136
|
const authorizationServer = await this.getAuthServer();
|
|
137
|
+
if (signUp) {
|
|
138
|
+
localStorage.setItem("sign-up", "true");
|
|
139
|
+
} else {
|
|
140
|
+
localStorage.removeItem("sign-up");
|
|
141
|
+
}
|
|
101
142
|
|
|
102
143
|
if (!authorizationServer.authorization_endpoint) {
|
|
103
144
|
throw new AuthorizationError("No authorization endpoint");
|
|
@@ -115,10 +156,18 @@ export class OpenIDAuthenticationProvider implements AuthenticationProvider {
|
|
|
115
156
|
|
|
116
157
|
// redirect user to as.authorization_endpoint
|
|
117
158
|
const authorizationUrl = new URL(
|
|
118
|
-
|
|
159
|
+
signUp
|
|
160
|
+
? authorizationServer.registration_endpoint ??
|
|
161
|
+
authorizationServer.authorization_endpoint
|
|
162
|
+
: authorizationServer.authorization_endpoint,
|
|
119
163
|
);
|
|
120
164
|
|
|
121
|
-
const redirectUrl = new URL(
|
|
165
|
+
const redirectUrl = new URL(
|
|
166
|
+
(signUp
|
|
167
|
+
? window.location.origin + this.redirectToAfterSignUp
|
|
168
|
+
: window.location.origin + this.redirectToAfterSignIn) ??
|
|
169
|
+
window.location.href,
|
|
170
|
+
);
|
|
122
171
|
redirectUrl.pathname = this.callbackUrlPath;
|
|
123
172
|
redirectUrl.search = "";
|
|
124
173
|
|
|
@@ -131,6 +180,9 @@ export class OpenIDAuthenticationProvider implements AuthenticationProvider {
|
|
|
131
180
|
"code_challenge_method",
|
|
132
181
|
code_challenge_method,
|
|
133
182
|
);
|
|
183
|
+
if (this.audience) {
|
|
184
|
+
authorizationUrl.searchParams.set("audience", this.audience);
|
|
185
|
+
}
|
|
134
186
|
|
|
135
187
|
/**
|
|
136
188
|
* We cannot be sure the AS supports PKCE so we're going to use state too. Use of PKCE is
|
|
@@ -147,6 +199,7 @@ export class OpenIDAuthenticationProvider implements AuthenticationProvider {
|
|
|
147
199
|
// now redirect the user to authorizationUrl.href
|
|
148
200
|
location.href = authorizationUrl.href;
|
|
149
201
|
}
|
|
202
|
+
|
|
150
203
|
async getAccessToken(): Promise<string> {
|
|
151
204
|
const as = await this.getAuthServer();
|
|
152
205
|
if (!this.tokens) {
|
|
@@ -177,7 +230,7 @@ export class OpenIDAuthenticationProvider implements AuthenticationProvider {
|
|
|
177
230
|
return this.tokens.accessToken;
|
|
178
231
|
}
|
|
179
232
|
|
|
180
|
-
async
|
|
233
|
+
async signOut(): Promise<void> {
|
|
181
234
|
useAuthState.setState({
|
|
182
235
|
isAuthenticated: false,
|
|
183
236
|
isPending: false,
|
|
@@ -186,7 +239,9 @@ export class OpenIDAuthenticationProvider implements AuthenticationProvider {
|
|
|
186
239
|
|
|
187
240
|
const as = await this.getAuthServer();
|
|
188
241
|
|
|
189
|
-
const redirectUrl = new URL(
|
|
242
|
+
const redirectUrl = new URL(
|
|
243
|
+
window.location.origin + this.redirectToAfterSignOut,
|
|
244
|
+
);
|
|
190
245
|
redirectUrl.pathname = this.logoutRedirectUrlPath;
|
|
191
246
|
|
|
192
247
|
let logoutUrl: URL;
|
|
@@ -207,16 +262,8 @@ export class OpenIDAuthenticationProvider implements AuthenticationProvider {
|
|
|
207
262
|
logoutUrl = redirectUrl;
|
|
208
263
|
}
|
|
209
264
|
}
|
|
210
|
-
getRoutes(): RouteObject[] {
|
|
211
|
-
return [
|
|
212
|
-
{
|
|
213
|
-
path: this.callbackUrlPath,
|
|
214
|
-
element: <Callback handleCallback={this.handleCallback} />,
|
|
215
|
-
},
|
|
216
|
-
];
|
|
217
|
-
}
|
|
218
265
|
|
|
219
|
-
handleCallback = async (): Promise<
|
|
266
|
+
handleCallback = async (): Promise<string> => {
|
|
220
267
|
const url = new URL(window.location.href);
|
|
221
268
|
const state = url.searchParams.get("state");
|
|
222
269
|
|
|
@@ -248,7 +295,7 @@ export class OpenIDAuthenticationProvider implements AuthenticationProvider {
|
|
|
248
295
|
}
|
|
249
296
|
|
|
250
297
|
const redirectUrl = new URL(url);
|
|
251
|
-
redirectUrl.pathname = this.callbackUrlPath;
|
|
298
|
+
redirectUrl.pathname = this.redirectToAfterSignIn ?? this.callbackUrlPath;
|
|
252
299
|
redirectUrl.search = "";
|
|
253
300
|
|
|
254
301
|
const response = await oauth.authorizationCodeGrantRequest(
|
|
@@ -298,6 +345,12 @@ export class OpenIDAuthenticationProvider implements AuthenticationProvider {
|
|
|
298
345
|
profile,
|
|
299
346
|
});
|
|
300
347
|
|
|
348
|
+
if (localStorage.getItem("sign-up")) {
|
|
349
|
+
return this.redirectToAfterSignUp;
|
|
350
|
+
} else {
|
|
351
|
+
return this.redirectToAfterSignIn;
|
|
352
|
+
}
|
|
353
|
+
|
|
301
354
|
// // Remove the query strings so react query doesn't keep retrying
|
|
302
355
|
// // to make the token request
|
|
303
356
|
// history.replaceState({}, "", window.location.pathname);
|
|
@@ -305,6 +358,12 @@ export class OpenIDAuthenticationProvider implements AuthenticationProvider {
|
|
|
305
358
|
// Returning true because we are using react query
|
|
306
359
|
// return true;
|
|
307
360
|
};
|
|
361
|
+
|
|
362
|
+
getAuthenticationPlugin() {
|
|
363
|
+
return new OpenIdAuthPlugin(this.callbackUrlPath, () =>
|
|
364
|
+
this.handleCallback(),
|
|
365
|
+
);
|
|
366
|
+
}
|
|
308
367
|
}
|
|
309
368
|
|
|
310
369
|
const openIDAuth: AuthenticationProviderInitializer<
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { type HelmetData, HelmetProvider } from "@zudoku/react-helmet-async";
|
|
2
|
+
import { StrictMode } from "react";
|
|
3
|
+
import { createBrowserRouter, RouterProvider } from "react-router-dom";
|
|
4
|
+
import {
|
|
5
|
+
type StaticHandlerContext,
|
|
6
|
+
StaticRouterProvider,
|
|
7
|
+
} from "react-router-dom/server.js";
|
|
8
|
+
import { StaggeredRenderContext } from "../plugins/openapi/StaggeredRender.js";
|
|
9
|
+
|
|
10
|
+
const Bootstrap = ({
|
|
11
|
+
router,
|
|
12
|
+
hydrate = false,
|
|
13
|
+
}: {
|
|
14
|
+
hydrate?: boolean;
|
|
15
|
+
router: ReturnType<typeof createBrowserRouter>;
|
|
16
|
+
}) => {
|
|
17
|
+
return (
|
|
18
|
+
<StrictMode>
|
|
19
|
+
<HelmetProvider>
|
|
20
|
+
<StaggeredRenderContext.Provider value={{ stagger: !hydrate }}>
|
|
21
|
+
<RouterProvider router={router} />
|
|
22
|
+
</StaggeredRenderContext.Provider>
|
|
23
|
+
</HelmetProvider>
|
|
24
|
+
</StrictMode>
|
|
25
|
+
);
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const BootstrapStatic = ({
|
|
29
|
+
router,
|
|
30
|
+
context,
|
|
31
|
+
helmetContext,
|
|
32
|
+
}: {
|
|
33
|
+
helmetContext: HelmetData["context"];
|
|
34
|
+
context: StaticHandlerContext;
|
|
35
|
+
router: ReturnType<typeof createBrowserRouter>;
|
|
36
|
+
}) => (
|
|
37
|
+
<StrictMode>
|
|
38
|
+
<HelmetProvider context={helmetContext}>
|
|
39
|
+
<StaticRouterProvider router={router} context={context} />
|
|
40
|
+
</HelmetProvider>
|
|
41
|
+
</StrictMode>
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
export { Bootstrap, BootstrapStatic };
|
|
@@ -1,28 +1,35 @@
|
|
|
1
1
|
import { MDXProvider } from "@mdx-js/react";
|
|
2
2
|
import { QueryClientProvider } from "@tanstack/react-query";
|
|
3
|
-
import {
|
|
3
|
+
import { Helmet } from "@zudoku/react-helmet-async";
|
|
4
|
+
import {
|
|
5
|
+
Fragment,
|
|
6
|
+
memo,
|
|
7
|
+
type PropsWithChildren,
|
|
8
|
+
useContext,
|
|
9
|
+
useEffect,
|
|
10
|
+
useMemo,
|
|
11
|
+
useState,
|
|
12
|
+
} from "react";
|
|
13
|
+
import { ErrorBoundary } from "react-error-boundary";
|
|
14
|
+
import { useNavigation } from "react-router-dom";
|
|
4
15
|
import {
|
|
5
16
|
DevPortalContext,
|
|
6
17
|
queryClient,
|
|
7
|
-
|
|
18
|
+
ZudokuContextOptions,
|
|
8
19
|
} from "../core/DevPortalContext.js";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
import {
|
|
13
|
-
import
|
|
14
|
-
MdxComponents,
|
|
15
|
-
type MdxComponentsType,
|
|
16
|
-
} from "../util/MdxComponents.js";
|
|
20
|
+
import { hasHead } from "../core/plugins.js";
|
|
21
|
+
import { TopLevelError } from "../errors/TopLevelError.js";
|
|
22
|
+
import { StaggeredRenderContext } from "../plugins/openapi/StaggeredRender.js";
|
|
23
|
+
import { MdxComponents } from "../util/MdxComponents.js";
|
|
24
|
+
import "../util/requestIdleCallbackPolyfill.js";
|
|
17
25
|
import {
|
|
18
26
|
ComponentsProvider,
|
|
19
27
|
DEFAULT_COMPONENTS,
|
|
20
|
-
type ComponentsContextType,
|
|
21
28
|
} from "./context/ComponentsContext.js";
|
|
22
29
|
import { DevPortalProvider } from "./context/DevPortalProvider.js";
|
|
23
30
|
import { ThemeProvider } from "./context/ThemeContext.js";
|
|
24
31
|
import { ViewportAnchorProvider } from "./context/ViewportAnchorContext.js";
|
|
25
|
-
import {
|
|
32
|
+
import { SlotletProvider } from "./SlotletProvider.js";
|
|
26
33
|
|
|
27
34
|
export const DevPortalSystemPaths = {
|
|
28
35
|
Settings: "/settings",
|
|
@@ -32,31 +39,33 @@ export type DevPortalPath =
|
|
|
32
39
|
| string
|
|
33
40
|
| (typeof DevPortalSystemPaths)[keyof typeof DevPortalSystemPaths];
|
|
34
41
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
description: string;
|
|
40
|
-
logo: string;
|
|
41
|
-
favicon: string;
|
|
42
|
-
}>;
|
|
43
|
-
authentication?: AuthenticationProvider;
|
|
44
|
-
navigation: NavigationItem[];
|
|
45
|
-
plugins?: DevPortalPlugin[];
|
|
46
|
-
mdxComponents?: MdxComponentsType;
|
|
47
|
-
overrides?: ComponentsContextType;
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
const DevPortalInner = (props: DevPortalProps) => {
|
|
42
|
+
const DevPortalInner = ({
|
|
43
|
+
children,
|
|
44
|
+
...props
|
|
45
|
+
}: PropsWithChildren<ZudokuContextOptions>) => {
|
|
51
46
|
const components = useMemo(
|
|
52
47
|
() => ({ ...DEFAULT_COMPONENTS, ...props.overrides }),
|
|
53
48
|
[props.overrides],
|
|
54
49
|
);
|
|
55
50
|
|
|
56
51
|
const mdxComponents = useMemo(
|
|
57
|
-
() => ({ ...MdxComponents, ...props.
|
|
58
|
-
[props.
|
|
52
|
+
() => ({ ...MdxComponents, ...props.mdx?.components }),
|
|
53
|
+
[props.mdx?.components],
|
|
54
|
+
);
|
|
55
|
+
const { stagger } = useContext(StaggeredRenderContext);
|
|
56
|
+
const [didNavigate, setDidNavigate] = useState(false);
|
|
57
|
+
const staggeredValue = useMemo(
|
|
58
|
+
() => (didNavigate ? { stagger: true } : { stagger }),
|
|
59
|
+
[stagger, didNavigate],
|
|
59
60
|
);
|
|
61
|
+
const navigation = useNavigation();
|
|
62
|
+
|
|
63
|
+
useEffect(() => {
|
|
64
|
+
if (didNavigate) {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
setDidNavigate(true);
|
|
68
|
+
}, [didNavigate, navigation.location]);
|
|
60
69
|
|
|
61
70
|
const devPortalContext = useMemo(() => new DevPortalContext(props), [props]);
|
|
62
71
|
|
|
@@ -64,39 +73,40 @@ const DevPortalInner = (props: DevPortalProps) => {
|
|
|
64
73
|
void devPortalContext.initialize();
|
|
65
74
|
}, [devPortalContext]);
|
|
66
75
|
|
|
76
|
+
const heads = props.plugins
|
|
77
|
+
?.filter(hasHead)
|
|
78
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
79
|
+
.map((plugin, i) => <Fragment key={i}>{plugin.getHead?.()}</Fragment>);
|
|
80
|
+
|
|
67
81
|
return (
|
|
68
82
|
<QueryClientProvider client={queryClient}>
|
|
69
|
-
<
|
|
83
|
+
<Helmet>{heads}</Helmet>
|
|
84
|
+
<StaggeredRenderContext.Provider value={staggeredValue}>
|
|
70
85
|
<DevPortalProvider value={devPortalContext}>
|
|
71
86
|
<MDXProvider components={mdxComponents}>
|
|
72
87
|
<ThemeProvider>
|
|
73
88
|
<ComponentsProvider value={components}>
|
|
74
|
-
<
|
|
75
|
-
<
|
|
76
|
-
|
|
77
|
-
<div className="grid place-items-center h-full">
|
|
78
|
-
Loading...
|
|
79
|
-
</div>
|
|
80
|
-
}
|
|
81
|
-
>
|
|
82
|
-
<Router
|
|
83
|
-
plugins={[
|
|
84
|
-
...(props.plugins ?? []),
|
|
85
|
-
...(props.authentication ? [props.authentication] : []),
|
|
86
|
-
]}
|
|
87
|
-
/>
|
|
88
|
-
</Suspense>
|
|
89
|
-
</ViewportAnchorProvider>
|
|
89
|
+
<SlotletProvider slotlets={props.slotlets}>
|
|
90
|
+
<ViewportAnchorProvider>{children}</ViewportAnchorProvider>
|
|
91
|
+
</SlotletProvider>
|
|
90
92
|
</ComponentsProvider>
|
|
91
93
|
</ThemeProvider>
|
|
92
94
|
</MDXProvider>
|
|
93
95
|
</DevPortalProvider>
|
|
94
|
-
</
|
|
96
|
+
</StaggeredRenderContext.Provider>
|
|
95
97
|
</QueryClientProvider>
|
|
96
98
|
);
|
|
97
99
|
};
|
|
98
100
|
|
|
99
|
-
const
|
|
101
|
+
const Inner = memo(DevPortalInner);
|
|
102
|
+
|
|
103
|
+
const DevPortal = (props: ZudokuContextOptions) => {
|
|
104
|
+
return (
|
|
105
|
+
<ErrorBoundary FallbackComponent={TopLevelError}>
|
|
106
|
+
<Inner {...props} />
|
|
107
|
+
</ErrorBoundary>
|
|
108
|
+
);
|
|
109
|
+
};
|
|
100
110
|
DevPortal.displayName = "DevPortal";
|
|
101
111
|
|
|
102
112
|
export { DevPortal };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import { Callout } from "../ui/Callout.js";
|
|
3
|
+
|
|
4
|
+
export const DeveloperHint = ({
|
|
5
|
+
children,
|
|
6
|
+
className,
|
|
7
|
+
}: {
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
className?: string;
|
|
10
|
+
}) => {
|
|
11
|
+
// TODO: figure out a way to do that in consumer dev mode not "internal"
|
|
12
|
+
// so this doesn't get stripped out in the build
|
|
13
|
+
if (!import.meta.env.DEV) return;
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<Callout type="caution" title="Developer hint" className={className}>
|
|
17
|
+
<div className="flex flex-col gap-2">
|
|
18
|
+
<div>{children}</div>
|
|
19
|
+
<small className="italic">
|
|
20
|
+
Note: This hint is only shown in development mode.
|
|
21
|
+
</small>
|
|
22
|
+
</div>
|
|
23
|
+
</Callout>
|
|
24
|
+
);
|
|
25
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import { Link } from "react-router-dom";
|
|
3
|
+
import { CategoryHeading } from "./CategoryHeading.js";
|
|
4
|
+
import { Heading } from "./Heading.js";
|
|
5
|
+
import { ProseClasses } from "./Markdown.js";
|
|
6
|
+
|
|
7
|
+
export const ErrorPage = ({
|
|
8
|
+
title = "An error occurred",
|
|
9
|
+
message,
|
|
10
|
+
category,
|
|
11
|
+
}: {
|
|
12
|
+
title?: ReactNode;
|
|
13
|
+
message?: ReactNode;
|
|
14
|
+
category?: ReactNode;
|
|
15
|
+
}) => {
|
|
16
|
+
return (
|
|
17
|
+
<div className={ProseClasses + " h-full pt-[--padding-content-top]"}>
|
|
18
|
+
{category && <CategoryHeading>{category}</CategoryHeading>}
|
|
19
|
+
{title && (
|
|
20
|
+
<Heading level={1} className="flex gap-3.5 items-center">
|
|
21
|
+
{title}
|
|
22
|
+
</Heading>
|
|
23
|
+
)}
|
|
24
|
+
<p>{message}</p>
|
|
25
|
+
<Link to="/">Go back home</Link>
|
|
26
|
+
</div>
|
|
27
|
+
);
|
|
28
|
+
};
|
|
@@ -1,64 +1,129 @@
|
|
|
1
|
-
import { MoonStarIcon,
|
|
1
|
+
import { MoonStarIcon, SunIcon } from "lucide-react";
|
|
2
2
|
import { memo } from "react";
|
|
3
3
|
|
|
4
|
+
import { Link } from "react-router-dom";
|
|
4
5
|
import { useAuth } from "../authentication/hook.js";
|
|
6
|
+
import { isProfileMenuPlugin, NavigationItem } from "../core/plugins.js";
|
|
7
|
+
import { Button } from "../ui/Button.js";
|
|
8
|
+
import {
|
|
9
|
+
DropdownMenu,
|
|
10
|
+
DropdownMenuContent,
|
|
11
|
+
DropdownMenuItem,
|
|
12
|
+
DropdownMenuLabel,
|
|
13
|
+
DropdownMenuPortal,
|
|
14
|
+
DropdownMenuSeparator,
|
|
15
|
+
DropdownMenuSub,
|
|
16
|
+
DropdownMenuSubContent,
|
|
17
|
+
DropdownMenuSubTrigger,
|
|
18
|
+
DropdownMenuTrigger,
|
|
19
|
+
} from "../ui/DropdownMenu.js";
|
|
20
|
+
import { cn } from "../util/cn.js";
|
|
5
21
|
import { TopNavigation } from "./TopNavigation.js";
|
|
6
22
|
import { useDevPortal } from "./context/DevPortalProvider.js";
|
|
7
23
|
import { useTheme } from "./context/ThemeContext.js";
|
|
8
24
|
|
|
25
|
+
const RecursiveMenu = ({ item }: { item: NavigationItem }) => {
|
|
26
|
+
return item.children ? (
|
|
27
|
+
<DropdownMenuSub key={item.label}>
|
|
28
|
+
<DropdownMenuSubTrigger>{item.label}</DropdownMenuSubTrigger>
|
|
29
|
+
<DropdownMenuPortal>
|
|
30
|
+
<DropdownMenuSubContent>
|
|
31
|
+
{item.children.map((item, i) => (
|
|
32
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
33
|
+
<RecursiveMenu key={i} item={item} />
|
|
34
|
+
))}
|
|
35
|
+
</DropdownMenuSubContent>
|
|
36
|
+
</DropdownMenuPortal>
|
|
37
|
+
</DropdownMenuSub>
|
|
38
|
+
) : (
|
|
39
|
+
<Link to={item.path ?? ""}>
|
|
40
|
+
<DropdownMenuItem key={item.label}>{item.label}</DropdownMenuItem>
|
|
41
|
+
</Link>
|
|
42
|
+
);
|
|
43
|
+
};
|
|
44
|
+
|
|
9
45
|
export const Header = memo(function HeaderInner() {
|
|
10
46
|
const [isDark, toggleTheme] = useTheme();
|
|
11
47
|
const { isAuthenticated, profile, isAuthEnabled, login, logout } = useAuth();
|
|
12
|
-
const
|
|
48
|
+
const context = useDevPortal();
|
|
49
|
+
const { page, plugins } = context;
|
|
13
50
|
|
|
14
51
|
const ThemeIcon = isDark ? MoonStarIcon : SunIcon;
|
|
15
52
|
|
|
16
53
|
return (
|
|
17
54
|
<header className="fixed top-0 w-full z-10 bg-background/80 backdrop-blur">
|
|
18
55
|
<div className="max-w-screen-2xl mx-auto">
|
|
19
|
-
<div className="grid grid-cols-[calc(var(--side-nav-width))_1fr] lg:gap-12 items-center border-b
|
|
20
|
-
<div className="flex
|
|
21
|
-
|
|
22
|
-
<
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
56
|
+
<div className="grid grid-cols-[calc(var(--side-nav-width))_1fr] lg:gap-12 items-center border-b px-12 h-[--top-header-height]">
|
|
57
|
+
<div className="flex">
|
|
58
|
+
<Link to="/">
|
|
59
|
+
<div className="flex items-center gap-3.5">
|
|
60
|
+
{page?.logo && (
|
|
61
|
+
<>
|
|
62
|
+
<img
|
|
63
|
+
src={page.logo.src.light}
|
|
64
|
+
alt={page.logo.alt ?? page.pageTitle}
|
|
65
|
+
style={{ width: page.logo.width }}
|
|
66
|
+
className={cn("h-10", isDark && "hidden")}
|
|
67
|
+
loading="lazy"
|
|
68
|
+
/>
|
|
69
|
+
<img
|
|
70
|
+
src={page.logo.src.dark}
|
|
71
|
+
alt={page.logo.alt ?? page.pageTitle}
|
|
72
|
+
style={{ width: page.logo.width }}
|
|
73
|
+
className={cn("h-10", !isDark && "hidden")}
|
|
74
|
+
loading="lazy"
|
|
75
|
+
/>
|
|
76
|
+
</>
|
|
77
|
+
)}
|
|
78
|
+
<span className="font-bold text-2xl text-foreground/85 tracking-wide">
|
|
79
|
+
{page?.pageTitle}
|
|
80
|
+
</span>
|
|
81
|
+
</div>
|
|
82
|
+
</Link>
|
|
27
83
|
</div>
|
|
28
84
|
<div className="grid grid-cols-[--sidecar-grid-cols] items-center gap-8">
|
|
29
85
|
<div className="w-full max-w-prose">
|
|
30
|
-
|
|
86
|
+
{/*<button className="flex items-center border border-input hover:bg-accent hover:text-accent-foreground p-4 relative h-8 justify-start rounded-lg bg-background text-sm text-muted-foreground shadow-none w-40 sm:w-72">
|
|
31
87
|
<div className="flex items-center gap-2 flex-grow">
|
|
32
88
|
<SearchIcon size={14} />
|
|
33
89
|
Search
|
|
34
90
|
</div>
|
|
35
|
-
<kbd className="absolute right-[0.3rem] top-[0.3rem] hidden h-5 select-none items-center gap-1 rounded border
|
|
91
|
+
<kbd className="absolute right-[0.3rem] top-[0.3rem] hidden h-5 select-none items-center gap-1 rounded border bg-muted px-1.5 font-mono text-[11px] font-medium opacity-100 sm:flex">
|
|
36
92
|
⌘K
|
|
37
93
|
</kbd>
|
|
38
|
-
</button
|
|
94
|
+
</button>*/}
|
|
39
95
|
</div>
|
|
40
96
|
|
|
41
|
-
<div className="items-center justify-self-end text-sm hidden lg:flex">
|
|
42
|
-
{isAuthEnabled && (
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
97
|
+
<div className="items-center justify-self-end text-sm hidden lg:flex gap-2">
|
|
98
|
+
{isAuthEnabled && !isAuthenticated ? (
|
|
99
|
+
<Button variant="ghost" asChild>
|
|
100
|
+
<Link to="/signin">Login</Link>
|
|
101
|
+
</Button>
|
|
102
|
+
) : (
|
|
103
|
+
<DropdownMenu>
|
|
104
|
+
<DropdownMenuTrigger asChild>
|
|
105
|
+
<Button variant="ghost">
|
|
106
|
+
{profile?.email ? `${profile.email}` : "My Account"}
|
|
107
|
+
</Button>
|
|
108
|
+
</DropdownMenuTrigger>
|
|
109
|
+
<DropdownMenuContent className="w-56">
|
|
110
|
+
<DropdownMenuLabel>My Account</DropdownMenuLabel>
|
|
111
|
+
<DropdownMenuSeparator />
|
|
112
|
+
{plugins
|
|
113
|
+
.filter((p) => isProfileMenuPlugin(p))
|
|
114
|
+
.flatMap((p) => p.getProfileMenuItems(context))
|
|
115
|
+
.map((i) => (
|
|
116
|
+
<RecursiveMenu key={i.label} item={i} />
|
|
117
|
+
))}
|
|
118
|
+
</DropdownMenuContent>
|
|
119
|
+
</DropdownMenu>
|
|
60
120
|
)}
|
|
121
|
+
|
|
61
122
|
<button
|
|
123
|
+
type="button"
|
|
124
|
+
aria-label={
|
|
125
|
+
isDark ? "Switch to light mode" : "Switch to dark mode"
|
|
126
|
+
}
|
|
62
127
|
className="cursor-pointer hover:bg-secondary p-2.5 -m-2.5 rounded-full"
|
|
63
128
|
onClick={toggleTheme}
|
|
64
129
|
>
|