zudoku 0.3.0-dev.6 → 0.3.0-dev.61
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 +67 -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 +11 -39
- package/dist/config/validators/validate.d.ts +908 -2
- package/dist/config/validators/validate.js +150 -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.js +1 -1
- 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 +2 -2
- 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 +19 -6
- package/dist/lib/authentication/providers/openid.js +45 -16
- 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 +4 -19
- package/dist/lib/components/DevPortal.js +30 -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 +3 -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/SyntaxHighlight.d.ts +3 -2
- package/dist/lib/components/SyntaxHighlight.js +20 -18
- 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/SideNavigationCategory.js +2 -2
- package/dist/lib/components/navigation/SideNavigationCategory.js.map +1 -1
- package/dist/lib/components/navigation/SideNavigationItem.js +1 -1
- package/dist/lib/components/navigation/SideNavigationItem.js.map +1 -1
- package/dist/lib/core/DevPortalContext.d.ts +46 -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 +1 -1
- 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 +39 -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 +11 -19
- 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 +1 -1
- 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/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 +10 -8
- package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
- package/dist/lib/plugins/openapi/SidecarBox.js +1 -1
- 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/Headers.d.ts +2 -3
- package/dist/lib/plugins/openapi/playground/Headers.js +16 -6
- package/dist/lib/plugins/openapi/playground/Headers.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/PathParams.d.ts +1 -1
- package/dist/lib/plugins/openapi/playground/Playground.d.ts +5 -4
- package/dist/lib/plugins/openapi/playground/Playground.js +22 -13
- 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 +1 -1
- package/dist/lib/plugins/openapi/playground/QueryParams.js +2 -1
- 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/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/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/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/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-Bj1hwDuD.js +705 -0
- package/lib/AnchorLink-Bj1hwDuD.js.map +1 -0
- package/lib/AuthenticationPlugin-RvXALgvS.js +52 -0
- package/lib/AuthenticationPlugin-RvXALgvS.js.map +1 -0
- package/lib/CategoryHeading-DMkTmmBh.js +10 -0
- package/lib/CategoryHeading-DMkTmmBh.js.map +1 -0
- package/lib/Combination-lAFQBd6U.js +2774 -0
- package/lib/Combination-lAFQBd6U.js.map +1 -0
- package/lib/DevPortalProvider-BBhQ8kgI.js +1125 -0
- package/lib/DevPortalProvider-BBhQ8kgI.js.map +1 -0
- package/lib/Markdown-BjRJKl_E.js +15028 -0
- package/lib/Markdown-BjRJKl_E.js.map +1 -0
- package/lib/MdxPage-DJTFOCbZ.js +190 -0
- package/lib/MdxPage-DJTFOCbZ.js.map +1 -0
- package/lib/OperationList-DDTtK3I7.js +5403 -0
- package/lib/OperationList-DDTtK3I7.js.map +1 -0
- package/lib/Route-Bsrd0acQ.js +13 -0
- package/lib/Route-Bsrd0acQ.js.map +1 -0
- package/lib/Select-CEnkyfyn.js +2223 -0
- package/lib/Select-CEnkyfyn.js.map +1 -0
- package/lib/Spinner-Ciq_pWU7.js +359 -0
- package/lib/Spinner-Ciq_pWU7.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/hook-BY1NP0kj.js +93 -0
- package/lib/hook-BY1NP0kj.js.map +1 -0
- package/lib/index-BE2a6gGC.js +726 -0
- package/lib/index-BE2a6gGC.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 +35 -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 +2 -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 +10 -7
- 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 +714 -538
- package/lib/zudoku.auth-openid.js.map +1 -0
- package/lib/zudoku.components.js +1793 -512
- 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 +313 -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 -24
- 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 +80 -0
- package/src/app/main.tsx +86 -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 +1 -1
- 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 +4 -2
- package/src/lib/authentication/providers/clerk.tsx +63 -31
- package/src/lib/authentication/providers/openid.tsx +56 -16
- package/src/lib/components/Bootstrap.tsx +44 -0
- package/src/lib/components/DevPortal.tsx +55 -49
- package/src/lib/components/DeveloperHint.tsx +25 -0
- package/src/lib/components/ErrorPage.tsx +28 -0
- package/src/lib/components/Header.tsx +89 -28
- package/src/lib/components/Heading.tsx +26 -7
- package/src/lib/components/InlineCode.tsx +19 -0
- package/src/lib/components/Layout.tsx +9 -7
- package/src/lib/components/NotFoundPage.tsx +33 -0
- package/src/lib/components/SyntaxHighlight.tsx +26 -18
- 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/SideNavigationCategory.tsx +3 -3
- package/src/lib/components/navigation/SideNavigationItem.tsx +1 -1
- package/src/lib/core/DevPortalContext.ts +54 -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 +1 -1
- package/src/lib/plugins/api-keys/ProtectedRoute.tsx +29 -0
- package/src/lib/plugins/api-keys/SettingsApiKeys.tsx +139 -0
- package/src/lib/plugins/{api-key → api-keys}/index.tsx +16 -40
- 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 +1 -1
- package/src/lib/plugins/markdown/generateRoutes.tsx +16 -6
- package/src/lib/plugins/markdown/index.tsx +10 -7
- 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 -1
- 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 +15 -10
- package/src/lib/plugins/openapi/SidecarBox.tsx +1 -1
- 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/Headers.tsx +60 -33
- package/src/lib/plugins/openapi/playground/PathParams.tsx +1 -1
- package/src/lib/plugins/openapi/playground/Playground.tsx +172 -193
- package/src/lib/plugins/openapi/playground/PlaygroundDialog.tsx +36 -0
- package/src/lib/plugins/openapi/playground/QueryParams.tsx +7 -2
- package/src/lib/plugins/openapi/playground/createUrl.ts +1 -1
- 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/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/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-BINYpvLB.js +0 -8412
- 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 -19892
- 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/api-key/SettingsApiKeys.tsx +0 -117
- 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
|
@@ -1,36 +1,38 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Highlight, Prism, themes, } from "prism-react-renderer";
|
|
3
3
|
import { CheckIcon, CopyIcon } from "lucide-react";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
4
|
+
globalThis.Prism = Prism;
|
|
5
|
+
// @ts-expect-error This is untyped
|
|
6
|
+
import("prismjs/components/prism-bash.min.js");
|
|
7
|
+
// @ts-expect-error This is untyped
|
|
8
|
+
import("prismjs/components/prism-ruby.min.js");
|
|
9
|
+
// @ts-expect-error This is untyped
|
|
10
|
+
import("prismjs/components/prism-markup-templating.js");
|
|
11
|
+
// @ts-expect-error This is untyped
|
|
12
|
+
import("prismjs/components/prism-php.min.js");
|
|
13
|
+
// @ts-expect-error This is untyped
|
|
14
|
+
import("prismjs/components/prism-json.min.js");
|
|
15
|
+
// @ts-expect-error This is untyped
|
|
16
|
+
import("prismjs/components/prism-java.min.js");
|
|
17
|
+
// @ts-expect-error This is untyped
|
|
18
|
+
import("prismjs/components/prism-csharp.min.js");
|
|
19
|
+
// @ts-expect-error This is untyped
|
|
20
|
+
import("prismjs/components/prism-objectivec.min.js");
|
|
19
21
|
import { useState } from "react";
|
|
20
22
|
import { cn } from "../util/cn.js";
|
|
21
23
|
import { useTheme } from "./context/ThemeContext.js";
|
|
22
|
-
export const SyntaxHighlight = ({ copyable = true, ...props }) => {
|
|
24
|
+
export const SyntaxHighlight = ({ copyable = true, language = "plain", ...props }) => {
|
|
23
25
|
const [isDark] = useTheme();
|
|
24
26
|
const [isCopied, setIsCopied] = useState(false);
|
|
25
27
|
if (!props.code) {
|
|
26
28
|
return null;
|
|
27
29
|
}
|
|
28
|
-
return (_jsx(Highlight, { theme: isDark ? themes.vsDark : themes.github, ...props, children: ({ className, style, tokens, getLineProps, getTokenProps }) => (_jsxs("pre", { className: cn("group relative", className, props.className, props.noBackground && "!bg-transparent", props.wrapLines && "whitespace-pre-wrap break-words"), style: style, children: [copyable && (_jsx("button", { type: "button", "aria-label": "Copy code", className: "absolute top-1.5 right-3 p-3 opacity-0 group-hover:opacity-100 transition hover:bg-zinc-500/10 hover:dark:bg-zinc-700/25 rounded-lg text-sm text-gray-400 hover:text-gray-600 dark:text-gray-500 dark:hover:text-gray-400", disabled: isCopied, onClick: () => {
|
|
30
|
+
return (_jsx(Highlight, { theme: isDark ? themes.vsDark : themes.github, language: language, ...props, children: ({ className, style, tokens, getLineProps, getTokenProps }) => (_jsxs("pre", { className: cn("group relative", className, props.className, props.noBackground && "!bg-transparent", props.wrapLines && "whitespace-pre-wrap break-words"), style: style, children: [copyable && (_jsx("button", { type: "button", "aria-label": "Copy code", className: "absolute top-1.5 right-3 p-3 opacity-0 group-hover:opacity-100 transition hover:bg-zinc-500/10 hover:dark:bg-zinc-700/25 rounded-lg text-sm text-gray-400 hover:text-gray-600 dark:text-gray-500 dark:hover:text-gray-400", disabled: isCopied, onClick: () => {
|
|
29
31
|
setIsCopied(true);
|
|
30
32
|
void navigator.clipboard.writeText(tokens
|
|
31
33
|
.map((line) => line.map(({ content }) => content).join(""))
|
|
32
34
|
.join("\n"));
|
|
33
35
|
setTimeout(() => setIsCopied(false), 2000);
|
|
34
|
-
}, children: isCopied ? (_jsx(CheckIcon, { className: "text-emerald-600", size: 18 })) : (_jsx(CopyIcon, { size: 18 })) })), props.showLanguageIndicator && (_jsx("span", { className: "absolute top-1.5 right-3 text-[11px] font-mono text-muted-foreground transition group-hover:opacity-0", children:
|
|
36
|
+
}, children: isCopied ? (_jsx(CheckIcon, { className: "text-emerald-600", size: 18 })) : (_jsx(CopyIcon, { size: 18 })) })), props.showLanguageIndicator && (_jsx("span", { className: "absolute top-1.5 right-3 text-[11px] font-mono text-muted-foreground transition group-hover:opacity-0", children: language })), tokens.map((line, i) => (_jsx("div", { ...getLineProps({ line }), children: line.map((token, key) => (_jsx("span", { ...getTokenProps({ token }) }, key))) }, i)))] })) }));
|
|
35
37
|
};
|
|
36
38
|
//# sourceMappingURL=SyntaxHighlight.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SyntaxHighlight.js","sourceRoot":"","sources":["../../../src/lib/components/SyntaxHighlight.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,SAAS,EACT,KAAK,EACL,MAAM,GAEP,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAEnD,
|
|
1
|
+
{"version":3,"file":"SyntaxHighlight.js","sourceRoot":"","sources":["../../../src/lib/components/SyntaxHighlight.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,SAAS,EACT,KAAK,EACL,MAAM,GAE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,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE,CAAC,CACxB,kBAAoB,aAAa,CAAC,EAAE,KAAK,EAAE,CAAC,IAAjC,GAAG,CAAkC,CACjD,CAAC,IAHM,CAAC,CAIL,CACP,CAAC,IACE,CACP,GACS,CACb,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const TopNavigation: () => import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
export declare const TopNavigation: () => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -4,7 +4,11 @@ import { NavLink } from "react-router-dom";
|
|
|
4
4
|
import { useDevPortal } from "./context/DevPortalProvider.js";
|
|
5
5
|
export const TopNavigation = () => {
|
|
6
6
|
const { navigation } = useDevPortal();
|
|
7
|
-
|
|
7
|
+
// Hide tope nav if there is only one item
|
|
8
|
+
if (navigation.length <= 1) {
|
|
9
|
+
return null;
|
|
10
|
+
}
|
|
11
|
+
return (_jsx("nav", { className: "border-b text-sm px-12 h-[--top-nav-height]", children: _jsx("ul", { className: "flex flex-row items-center gap-8", children: navigation.map((item) => (_jsx("li", { children: _jsx(NavLink, { className: ({ isActive }) => cx("block py-3.5 font-medium -mb-px border-b-2", isActive
|
|
8
12
|
? "border-primary text-foreground"
|
|
9
13
|
: "border-transparent text-foreground/75 hover:text-foreground hover:border-accent-foreground/25"), to: item.path, children: item.label }) }, item.label))) }) }));
|
|
10
14
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TopNavigation.js","sourceRoot":"","sources":["../../../src/lib/components/TopNavigation.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAE3C,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAE9D,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,EAAE;IAChC,MAAM,EAAE,UAAU,EAAE,GAAG,YAAY,EAAE,CAAC;IAEtC,OAAO,CACL,cAAK,SAAS,EAAC,
|
|
1
|
+
{"version":3,"file":"TopNavigation.js","sourceRoot":"","sources":["../../../src/lib/components/TopNavigation.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAE3C,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAE9D,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,EAAE;IAChC,MAAM,EAAE,UAAU,EAAE,GAAG,YAAY,EAAE,CAAC;IAEtC,0CAA0C;IAC1C,IAAI,UAAU,CAAC,MAAM,IAAI,CAAC,EAAE,CAAC;QAC3B,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,CACL,cAAK,SAAS,EAAC,6CAA6C,YAC1D,aAAI,SAAS,EAAC,kCAAkC,YAC7C,UAAU,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CACxB,uBACE,KAAC,OAAO,IACN,SAAS,EAAE,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAC1B,EAAE,CACA,4CAA4C,EAC5C,QAAQ;wBACN,CAAC,CAAC,gCAAgC;wBAClC,CAAC,CAAC,+FAA+F,CACpG,EAEH,EAAE,EAAE,IAAI,CAAC,IAAI,YAEZ,IAAI,CAAC,KAAK,GACH,IAbH,IAAI,CAAC,KAAK,CAcd,CACN,CAAC,GACC,GACD,CACP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DevPortalContext } from "../../core/DevPortalContext.js";
|
|
2
2
|
export declare const DevPortalProvider: import("react").Provider<DevPortalContext | undefined>;
|
|
3
3
|
export declare const useDevPortal: () => DevPortalContext;
|
|
4
|
-
export declare const useApiIdentities: () => import("@tanstack/react-query").
|
|
4
|
+
export declare const useApiIdentities: () => import("@tanstack/react-query").UseQueryResult<import("../../core/DevPortalContext.js").ApiIdentity[], Error>;
|
|
5
5
|
export declare const useTopNavigationItem: () => import("../../core/DevPortalContext.js").NavigationItem | undefined;
|
|
6
6
|
export declare const useNavigation: () => import("@tanstack/react-query").UseSuspenseQueryResult<{
|
|
7
7
|
items: import("../../core/DevPortalContext.js").NavigationCategory[];
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { useSuspenseQuery } from "@tanstack/react-query";
|
|
1
|
+
import { useQuery, useSuspenseQuery } from "@tanstack/react-query";
|
|
2
2
|
import { createContext, useContext } from "react";
|
|
3
3
|
import { matchPath, useLocation } from "react-router-dom";
|
|
4
|
+
import { traverseNavigation } from "../../util/traverseNavigation.js";
|
|
4
5
|
const DevPortalReactContext = createContext(undefined);
|
|
5
6
|
export const DevPortalProvider = DevPortalReactContext.Provider;
|
|
6
7
|
export const useDevPortal = () => {
|
|
@@ -12,7 +13,7 @@ export const useDevPortal = () => {
|
|
|
12
13
|
};
|
|
13
14
|
export const useApiIdentities = () => {
|
|
14
15
|
const { getApiIdentities } = useDevPortal();
|
|
15
|
-
return
|
|
16
|
+
return useQuery({
|
|
16
17
|
queryFn: getApiIdentities,
|
|
17
18
|
queryKey: ["api-identities"],
|
|
18
19
|
});
|
|
@@ -20,7 +21,23 @@ export const useApiIdentities = () => {
|
|
|
20
21
|
export const useTopNavigationItem = () => {
|
|
21
22
|
const { navigation } = useDevPortal();
|
|
22
23
|
const location = useLocation();
|
|
23
|
-
|
|
24
|
+
// The `/` path needs this logic because it would always match:
|
|
25
|
+
// Only if a leaf node actually matches the current path it is active
|
|
26
|
+
for (const item of navigation) {
|
|
27
|
+
const foundNavItem = traverseNavigation(item, (_node, fullPath) => {
|
|
28
|
+
if (location.pathname === fullPath) {
|
|
29
|
+
return item;
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
if (foundNavItem) {
|
|
33
|
+
return foundNavItem;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
if (location.pathname === "/") {
|
|
37
|
+
return navigation.find((item) => item.path === "/");
|
|
38
|
+
}
|
|
39
|
+
return navigation.find((item) => item.path !== "/" &&
|
|
40
|
+
matchPath({ path: item.path, end: false }, location.pathname));
|
|
24
41
|
};
|
|
25
42
|
export const useNavigation = () => {
|
|
26
43
|
const { getNavigation } = useDevPortal();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DevPortalProvider.js","sourceRoot":"","sources":["../../../../src/lib/components/context/DevPortalProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"DevPortalProvider.js","sourceRoot":"","sources":["../../../../src/lib/components/context/DevPortalProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAEtE,MAAM,qBAAqB,GAAG,aAAa,CACzC,SAAS,CACV,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,qBAAqB,CAAC,QAAQ,CAAC;AAEhE,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,EAAE;IAC/B,MAAM,OAAO,GAAG,UAAU,CAAC,qBAAqB,CAAC,CAAC;IAElD,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,uDAAuD,CAAC,CAAC;IAC3E,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,EAAE;IACnC,MAAM,EAAE,gBAAgB,EAAE,GAAG,YAAY,EAAE,CAAC;IAC5C,OAAO,QAAQ,CAAC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CAAC;IAEjC,OAAO,gBAAgB,CAAC;QACtB,OAAO,EAAE,KAAK,IAAI,EAAE;YAClB,OAAO;gBACL,KAAK,EAAE,CAAC,GAAG,CAAC,OAAO,EAAE,UAAU,IAAI,EAAE,CAAC,EAAE,GAAG,CAAC,MAAM,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC;gBACvE,iBAAiB,EAAE,OAAO;aAC3B,CAAC;QACJ,CAAC;QACD,QAAQ,EAAE,CAAC,YAAY,EAAE,IAAI,CAAC;KAC/B,CAAC,CAAC;AACL,CAAC,CAAC"}
|
|
@@ -1,3 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { useMDXComponents as useMDXComponentsImport } from "@mdx-js/react";
|
|
2
|
+
import { Helmet } from "@zudoku/react-helmet-async";
|
|
3
|
+
import { RouterError as RouterErrorImport } from "../errors/RouterError.js";
|
|
4
|
+
import { ServerError as ServerErrorImport } from "../errors/ServerError.js";
|
|
5
|
+
export declare const useMDXComponents: typeof useMDXComponentsImport;
|
|
6
|
+
export declare const Callout: ({ type, children, title, className }: {
|
|
7
|
+
type: "note" | "tip" | "info" | "caution" | "danger";
|
|
8
|
+
title?: string;
|
|
9
|
+
children: import("react").ReactNode;
|
|
10
|
+
className?: string;
|
|
11
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare const DevPortal: {
|
|
13
|
+
(props: import("../core/DevPortalContext.js").ZudokuContextOptions): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
displayName: string;
|
|
15
|
+
};
|
|
16
|
+
export declare const Layout: ({ children }: {
|
|
17
|
+
children?: import("react").ReactNode;
|
|
18
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export declare const Link: import("react").ForwardRefExoticComponent<import("react-router-dom").LinkProps & import("react").RefAttributes<HTMLAnchorElement>>;
|
|
20
|
+
export declare const RouterError: typeof RouterErrorImport;
|
|
21
|
+
export declare const ServerError: typeof ServerErrorImport;
|
|
22
|
+
export declare const Bootstrap: ({ router, hydrate, }: {
|
|
23
|
+
hydrate?: boolean;
|
|
24
|
+
router: ReturnType<typeof import("react-router-dom").createBrowserRouter>;
|
|
25
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
export declare const BootstrapStatic: ({ router, context, helmetContext, }: {
|
|
27
|
+
helmetContext: HelmetData;
|
|
28
|
+
context: import("react-router-dom/server.js").StaticHandlerContext;
|
|
29
|
+
router: ReturnType<typeof import("react-router-dom").createBrowserRouter>;
|
|
30
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
export declare const Button: import("react").ForwardRefExoticComponent<import("../ui/Button.js").ButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
32
|
+
export declare const Head: typeof Helmet;
|
|
@@ -1,4 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { useMDXComponents as useMDXComponentsImport } from "@mdx-js/react";
|
|
2
|
+
import { Helmet } from "@zudoku/react-helmet-async";
|
|
3
|
+
import { Link as LinkImport } from "react-router-dom";
|
|
4
|
+
import { RouterError as RouterErrorImport } from "../errors/RouterError.js";
|
|
5
|
+
import { ServerError as ServerErrorImport } from "../errors/ServerError.js";
|
|
6
|
+
import { Button as ButtonImport } from "../ui/Button.js";
|
|
7
|
+
import { Callout as CalloutImport } from "../ui/Callout.js";
|
|
8
|
+
import { Bootstrap as BootstrapImport, BootstrapStatic as BootstrapStaticImport, } from "./Bootstrap.js";
|
|
9
|
+
import { DevPortal as DevPortalImport } from "./DevPortal.js";
|
|
10
|
+
import { Layout as LayoutImport } from "./Layout.js";
|
|
11
|
+
export const useMDXComponents = /*@__PURE__*/ useMDXComponentsImport;
|
|
12
|
+
export const Callout = /*@__PURE__*/ CalloutImport;
|
|
13
|
+
export const DevPortal = /*@__PURE__*/ DevPortalImport;
|
|
14
|
+
export const Layout = /*@__PURE__*/ LayoutImport;
|
|
15
|
+
export const Link = /*@__PURE__*/ LinkImport;
|
|
16
|
+
export const RouterError = /*@__PURE__*/ RouterErrorImport;
|
|
17
|
+
export const ServerError = /*@__PURE__*/ ServerErrorImport;
|
|
18
|
+
export const Bootstrap = /*@__PURE__*/ BootstrapImport;
|
|
19
|
+
export const BootstrapStatic = /*@__PURE__*/ BootstrapStaticImport;
|
|
20
|
+
export const Button = /*@__PURE__*/ ButtonImport;
|
|
21
|
+
export const Head = /*@__PURE__*/ Helmet;
|
|
4
22
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lib/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lib/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,IAAI,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAC3E,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,IAAI,IAAI,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,WAAW,IAAI,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC5E,OAAO,EAAE,WAAW,IAAI,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC5E,OAAO,EAAE,MAAM,IAAI,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EACL,SAAS,IAAI,eAAe,EAC5B,eAAe,IAAI,qBAAqB,GACzC,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,SAAS,IAAI,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAC9D,OAAO,EAAE,MAAM,IAAI,YAAY,EAAE,MAAM,aAAa,CAAC;AAErD,MAAM,CAAC,MAAM,gBAAgB,GAAG,aAAa,CAAC,sBAAsB,CAAC;AACrE,MAAM,CAAC,MAAM,OAAO,GAAG,aAAa,CAAC,aAAa,CAAC;AACnD,MAAM,CAAC,MAAM,SAAS,GAAG,aAAa,CAAC,eAAe,CAAC;AACvD,MAAM,CAAC,MAAM,MAAM,GAAG,aAAa,CAAC,YAAY,CAAC;AACjD,MAAM,CAAC,MAAM,IAAI,GAAG,aAAa,CAAC,UAAU,CAAC;AAC7C,MAAM,CAAC,MAAM,WAAW,GAAG,aAAa,CAAC,iBAAiB,CAAC;AAC3D,MAAM,CAAC,MAAM,WAAW,GAAG,aAAa,CAAC,iBAAiB,CAAC;AAC3D,MAAM,CAAC,MAAM,SAAS,GAAG,aAAa,CAAC,eAAe,CAAC;AACvD,MAAM,CAAC,MAAM,eAAe,GAAG,aAAa,CAAC,qBAAqB,CAAC;AACnE,MAAM,CAAC,MAAM,MAAM,GAAG,aAAa,CAAC,YAAY,CAAC;AACjD,MAAM,CAAC,MAAM,IAAI,GAAG,aAAa,CAAC,MAAM,CAAC"}
|
|
@@ -8,7 +8,7 @@ import { useTopNavigationItem } from "../context/DevPortalProvider.js";
|
|
|
8
8
|
import { useViewportAnchor } from "../context/ViewportAnchorContext.js";
|
|
9
9
|
import { SideNavigationItem } from "./SideNavigationItem.js";
|
|
10
10
|
import { useNavigationCollapsibleState } from "./useNavigationCollapsibleState.js";
|
|
11
|
-
import { checkHasActiveItem
|
|
11
|
+
import { checkHasActiveItem } from "./util.js";
|
|
12
12
|
export const SideNavigationCategory = ({ category, }) => {
|
|
13
13
|
const { activeAnchor } = useViewportAnchor();
|
|
14
14
|
const navItem = useTopNavigationItem();
|
|
@@ -21,6 +21,6 @@ export const SideNavigationCategory = ({ category, }) => {
|
|
|
21
21
|
category.expanded ||
|
|
22
22
|
checkHasActiveItem(category, location.pathname, navItem?.path ?? ""),
|
|
23
23
|
});
|
|
24
|
-
return (_jsxs(Collapsible.Root, { open: isOpen, onOpenChange: () => setIsOpen((prev) => !prev), children: [category.label.length > 0 ? (_jsx(Collapsible.Trigger, { asChild: isCollapsible, disabled: !isCollapsible, children: _jsxs("h5", { className: cn("flex group items-center justify-between cursor-pointer font-semibold text-foreground/90 px-[--padding-nav-item] py-1.5 rounded-lg transition-colors duration-300 -mx-[--padding-nav-item]", isCollapsible ? "hover:bg-accent" : "cursor-auto"), children: [category.label, isCollapsible && (_jsx(ChevronRightIcon, { className: "group-data-[state=open]:rotate-90 transition", size: 16 }))] }) })) : ("Endpoints"), _jsx(Collapsible.Content, { className: "CollapsibleContent -mx-[--padding-nav-item]", children: _jsx("ul", { className: "space-y-0.5 mt-1.5 mb-4 ms-3", children: category.children.map((item) => (_jsx(SideNavigationItem, { category: category, item: item, activeAnchor: activeAnchor, currentTopNavItem: navItem, basePath: joinPath(navItem?.path, category.path) },
|
|
24
|
+
return (_jsxs(Collapsible.Root, { open: isOpen, onOpenChange: () => setIsOpen((prev) => !prev), children: [category.label.length > 0 ? (_jsx(Collapsible.Trigger, { asChild: isCollapsible, disabled: !isCollapsible, children: _jsxs("h5", { className: cn("flex group items-center justify-between cursor-pointer font-semibold text-foreground/90 px-[--padding-nav-item] py-1.5 rounded-lg transition-colors duration-300 -mx-[--padding-nav-item]", isCollapsible ? "hover:bg-accent" : "cursor-auto"), children: [category.label, isCollapsible && (_jsx(ChevronRightIcon, { className: "group-data-[state=open]:rotate-90 transition", size: 16 }))] }) })) : ("Endpoints"), _jsx(Collapsible.Content, { className: "CollapsibleContent -mx-[--padding-nav-item]", children: _jsx("ul", { className: "space-y-0.5 mt-1.5 mb-4 ms-3", children: category.children.map((item, i) => (_jsx(SideNavigationItem, { category: category, item: item, activeAnchor: activeAnchor, currentTopNavItem: navItem, basePath: joinPath(navItem?.path, category.path) }, i))) }) })] }, category.label));
|
|
25
25
|
};
|
|
26
26
|
//# sourceMappingURL=SideNavigationCategory.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SideNavigationCategory.js","sourceRoot":"","sources":["../../../../src/lib/components/navigation/SideNavigationCategory.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,WAAW,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AACxE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,6BAA6B,EAAE,MAAM,oCAAoC,CAAC;AACnF,OAAO,EAAE,kBAAkB,EAAE,
|
|
1
|
+
{"version":3,"file":"SideNavigationCategory.js","sourceRoot":"","sources":["../../../../src/lib/components/navigation/SideNavigationCategory.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,WAAW,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AACxE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,6BAA6B,EAAE,MAAM,oCAAoC,CAAC;AACnF,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAE/C,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,EACrC,QAAQ,GAGT,EAAE,EAAE;IACH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AC,QAAQ,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CAClC,KAAC,kBAAkB,IAEjB,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,IAAI,EACV,YAAY,EAAE,YAAY,EAC1B,iBAAiB,EAAE,OAAO,EAC1B,QAAQ,EAAE,QAAQ,CAAC,OAAO,EAAE,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC,IAL3C,CAAC,CAMN,CACH,CAAC,GACC,GACe,KAtCjB,QAAQ,CAAC,KAAK,CAuCF,CACpB,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -36,7 +36,7 @@ export const SideNavigationItem = ({ category, item, activeAnchor, currentTopNav
|
|
|
36
36
|
return item.href.startsWith("http") ? (_jsxs("a", { className: classes, href: item.href, target: "_blank", rel: "noopener noreferrer", children: [item.label, _jsx(ExternalLinkIcon, { size: 14 })] })) : (_jsx(NavLink, { className: classes, to: item.href, children: item.label }));
|
|
37
37
|
}
|
|
38
38
|
const linkContent = (_jsxs("div", { className: "flex justify-between w-full", children: [_jsxs("div", { className: "flex items-center gap-2 truncate w-full", children: [item.icon, typeof item.label !== "string" ? (item.label) : (_jsx("span", { className: "truncate", children: item.label }))] }), item.children && (_jsx(ChevronRightIcon, { size: 16, className: "transition shrink-0 group-data-[state=open]:rotate-90" }))] }));
|
|
39
|
-
return (_jsx("li", { title: typeof item.label === "string" ? item.label : item.title, children: item.children ? (_jsxs(Collapsible.Root, { open: isOpen, onOpenChange: () => setIsOpen((prev) => !prev), className: "flex flex-col", children: [_jsx(Collapsible.Trigger, { className: cn("group text-start", navigationListItem({ isActive: false })), children: linkContent }), _jsx(Collapsible.Content, { className: "CollapsibleContent ms-[calc(var(--padding-nav-item)*1.125)]", children: _jsx("ul", { className: "mt-1 border-
|
|
39
|
+
return (_jsx("li", { title: typeof item.label === "string" ? item.label : item.title, children: item.children ? (_jsxs(Collapsible.Root, { open: isOpen, onOpenChange: () => setIsOpen((prev) => !prev), className: "flex flex-col", children: [_jsx(Collapsible.Trigger, { className: cn("group text-start", navigationListItem({ isActive: false })), children: linkContent }), _jsx(Collapsible.Content, { className: "CollapsibleContent ms-[calc(var(--padding-nav-item)*1.125)]", children: _jsx("ul", { className: "mt-1 border-l ps-1.5", children: item.children.map((child) => (_jsx(SideNavigationItem, { category: category, item: child, activeAnchor: activeAnchor, currentTopNavItem: currentTopNavItem, basePath: currentPath }, isPathItem(child) ? child.path : child.href))) }) })] })) : item.path.startsWith("#") ? (_jsx(AnchorLink, { to: item.path, [DATA_ANCHOR_ATTR]: item.path, className: navigationListItem({
|
|
40
40
|
isActive: item.path.slice(1) === activeAnchor,
|
|
41
41
|
isMuted: item.muted,
|
|
42
42
|
}), children: linkContent })) : (_jsx(NavLink, { className: ({ isActive }) => navigationListItem({ isActive }), to: currentPath, children: linkContent })) }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SideNavigationItem.js","sourceRoot":"","sources":["../../../../src/lib/components/navigation/SideNavigationItem.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,WAAW,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAOxD,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,6BAA6B,EAAE,MAAM,oCAAoC,CAAC;AACnF,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEvE,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,CACnC,+FAA+F,EAC/F;I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C,KAAK,CAAC,CAAC,CAAC,KAAK,YAAY;gBAC7C,OAAO,EAAE,IAAI,CAAC,KAAK;aACpB,CAAC,YAED,WAAW,GACD,CACd,CAAC,CAAC,CAAC,CACF,KAAC,OAAO,IACN,SAAS,EAAE,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,kBAAkB,CAAC,EAAE,QAAQ,EAAE,CAAC,EAC7D,EAAE,EAAE,WAAW,YAEd,WAAW,GACJ,CACX,GACE,CACN,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { QueryClient } from "@tanstack/react-query";
|
|
2
2
|
import { type ReactNode } from "react";
|
|
3
3
|
import { type AuthenticationProvider } from "../authentication/authentication.js";
|
|
4
|
-
import
|
|
4
|
+
import type { ComponentsContextType } from "../components/context/ComponentsContext.js";
|
|
5
|
+
import { type DevPortalPath } from "../components/DevPortal.js";
|
|
6
|
+
import type { MdxComponentsType } from "../util/MdxComponents.js";
|
|
7
|
+
import { type DevPortalPlugin } from "./plugins.js";
|
|
5
8
|
export interface ApiIdentity {
|
|
6
9
|
authorizeRequest: (request: Request) => Request;
|
|
7
10
|
label: string;
|
|
@@ -34,25 +37,56 @@ export type NavigationItem = {
|
|
|
34
37
|
path: DevPortalPath;
|
|
35
38
|
categories?: NavigationCategory[];
|
|
36
39
|
};
|
|
37
|
-
export type RoutingState = {
|
|
38
|
-
path?: string;
|
|
39
|
-
};
|
|
40
40
|
export declare const queryClient: QueryClient;
|
|
41
|
-
export declare const useRoutingState: import("zustand").UseBoundStore<import("zustand").StoreApi<RoutingState>>;
|
|
42
41
|
export type ApiKeyCache = "api-keys";
|
|
43
42
|
export type DevPortalCacheKey = ApiKeyCache | string;
|
|
43
|
+
type Metadata = Partial<{
|
|
44
|
+
title: string;
|
|
45
|
+
description: string;
|
|
46
|
+
logo: string;
|
|
47
|
+
favicon: string;
|
|
48
|
+
generator: string;
|
|
49
|
+
applicationName: string;
|
|
50
|
+
referrer: string;
|
|
51
|
+
keywords: string[];
|
|
52
|
+
authors: string[];
|
|
53
|
+
creator: string;
|
|
54
|
+
publisher: string;
|
|
55
|
+
}>;
|
|
56
|
+
type Page = Partial<{
|
|
57
|
+
pageTitle?: string;
|
|
58
|
+
logo?: {
|
|
59
|
+
src: {
|
|
60
|
+
light: string;
|
|
61
|
+
dark: string;
|
|
62
|
+
};
|
|
63
|
+
width?: string;
|
|
64
|
+
alt?: string;
|
|
65
|
+
};
|
|
66
|
+
}>;
|
|
67
|
+
export type ZudokuContextOptions = {
|
|
68
|
+
metadata?: Metadata;
|
|
69
|
+
page?: Page;
|
|
70
|
+
authentication?: AuthenticationProvider;
|
|
71
|
+
navigation: NavigationItem[];
|
|
72
|
+
plugins?: DevPortalPlugin[];
|
|
73
|
+
mdx?: {
|
|
74
|
+
components?: MdxComponentsType;
|
|
75
|
+
};
|
|
76
|
+
overrides?: ComponentsContextType;
|
|
77
|
+
};
|
|
44
78
|
export declare class DevPortalContext {
|
|
45
|
-
|
|
79
|
+
plugins: NonNullable<ZudokuContextOptions["plugins"]>;
|
|
80
|
+
navigation: ZudokuContextOptions["navigation"];
|
|
81
|
+
meta: ZudokuContextOptions["metadata"];
|
|
82
|
+
page: ZudokuContextOptions["page"];
|
|
83
|
+
authentication?: ZudokuContextOptions["authentication"];
|
|
46
84
|
private navigationPlugins;
|
|
47
|
-
|
|
48
|
-
meta: DevPortalProps["meta"];
|
|
49
|
-
authentication?: AuthenticationProvider;
|
|
50
|
-
state: typeof useRoutingState;
|
|
51
|
-
constructor(config: DevPortalProps);
|
|
85
|
+
constructor(config: ZudokuContextOptions);
|
|
52
86
|
initialize: () => Promise<void>;
|
|
53
87
|
invalidateCache: (key: DevPortalCacheKey[]) => Promise<void>;
|
|
54
88
|
getApiIdentities: () => Promise<ApiIdentity[]>;
|
|
55
89
|
getNavigation: (path: string) => Promise<import("./plugins.js").PluginNavigationCategory[]>;
|
|
56
|
-
signRequest(request: Request)
|
|
90
|
+
signRequest: (request: Request) => Promise<Request>;
|
|
57
91
|
}
|
|
58
92
|
export {};
|
|
@@ -1,28 +1,26 @@
|
|
|
1
1
|
import { QueryClient } from "@tanstack/react-query";
|
|
2
|
-
import { create } from "zustand";
|
|
3
2
|
import { isApiIdentityPlugin, isNavigationPlugin, needsInitialization, } from "./plugins.js";
|
|
4
3
|
export const queryClient = new QueryClient();
|
|
5
|
-
export const useRoutingState = create(() => ({}));
|
|
6
4
|
export class DevPortalContext {
|
|
7
5
|
plugins = [];
|
|
8
|
-
navigationPlugins;
|
|
9
6
|
navigation;
|
|
10
7
|
meta;
|
|
8
|
+
page;
|
|
11
9
|
authentication;
|
|
12
|
-
|
|
10
|
+
navigationPlugins;
|
|
13
11
|
constructor(config) {
|
|
14
12
|
this.plugins = config.plugins ?? [];
|
|
15
13
|
this.navigation = config.navigation;
|
|
16
14
|
this.navigationPlugins = this.plugins.filter(isNavigationPlugin);
|
|
17
15
|
this.authentication = config.authentication;
|
|
18
|
-
this.meta = config.
|
|
19
|
-
this.
|
|
16
|
+
this.meta = config.metadata;
|
|
17
|
+
this.page = config.page;
|
|
20
18
|
}
|
|
21
19
|
initialize = async () => {
|
|
22
20
|
await Promise.all([
|
|
23
21
|
this.plugins
|
|
24
22
|
.filter(needsInitialization)
|
|
25
|
-
.map((plugin) => plugin.initialize(this)),
|
|
23
|
+
.map((plugin) => plugin.initialize?.(this)),
|
|
26
24
|
]);
|
|
27
25
|
};
|
|
28
26
|
invalidateCache = async (key) => {
|
|
@@ -38,13 +36,13 @@ export class DevPortalContext {
|
|
|
38
36
|
const navigations = await Promise.all(this.navigationPlugins.map(async (plugin) => plugin.getNavigation?.(path)));
|
|
39
37
|
return navigations.flatMap((nav) => nav ?? []);
|
|
40
38
|
};
|
|
41
|
-
async
|
|
39
|
+
signRequest = async (request) => {
|
|
42
40
|
if (!this.authentication) {
|
|
43
41
|
throw new Error("No authentication provider configured");
|
|
44
42
|
}
|
|
45
43
|
const accessToken = await this.authentication.getAccessToken();
|
|
46
44
|
request.headers.set("Authorization", `Bearer ${accessToken}`);
|
|
47
45
|
return request;
|
|
48
|
-
}
|
|
46
|
+
};
|
|
49
47
|
}
|
|
50
48
|
//# sourceMappingURL=DevPortalContext.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DevPortalContext.js","sourceRoot":"","sources":["../../../src/lib/core/DevPortalContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"DevPortalContext.js","sourceRoot":"","sources":["../../../src/lib/core/DevPortalContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAMpD,OAAO,EAEL,mBAAmB,EACnB,kBAAkB,EAElB,mBAAmB,GACpB,MAAM,cAAc,CAAC;AA2CtB,MAAM,CAAC,MAAM,WAAW,GAAG,IAAI,WAAW,EAAE,CAAC;AA2C7C,MAAM,OAAO,gBAAgB;IACpB,OAAO,GAAiD,EAAE,CAAC;IAC3D,UAAU,CAAqC;IAC/C,IAAI,CAAmC;IACvC,IAAI,CAA+B;IACnC,cAAc,CAA0C;IACvD,iBAAiB,CAAqB;IAE9C,YAAY,MAA4B;QACtC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,IAAI,EAAE,CAAC;QACpC,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;QACpC,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC;QACjE,IAAI,CAAC,cAAc,GAAG,MAAM,CAAC,cAAc,CAAC;QAC5C,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,QAAQ,CAAC;QAC5B,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;IAC1B,CAAC;IAED,UAAU,GAAG,KAAK,IAAI,EAAE;QACtB,MAAM,OAAO,CAAC,GAAG,CA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CAAC;QAE/D,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,UAAU,WAAW,EAAE,CAAC,CAAC;QAE9D,OAAO,OAAO,CAAC;IACjB,CAAC,CAAC;CACH"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { type ReactElement } from "react";
|
|
1
2
|
import { type RouteObject } from "react-router-dom";
|
|
2
3
|
import { DevPortalContext, type ApiIdentity, type NavigationCategory } from "./DevPortalContext.js";
|
|
3
4
|
export type PluginNavigationCategory = {
|
|
4
5
|
path: string;
|
|
5
6
|
} & NavigationCategory;
|
|
6
|
-
export type DevPortalPlugin =
|
|
7
|
+
export type DevPortalPlugin = CommonPlugin | ProfileMenuPlugin | NavigationPlugin | ApiIdentityPlugin;
|
|
7
8
|
export interface NavigationPlugin {
|
|
8
9
|
getRoutes: () => RouteObject[];
|
|
9
10
|
getNavigation?: (path: string) => Promise<PluginNavigationCategory[]>;
|
|
@@ -11,9 +12,20 @@ export interface NavigationPlugin {
|
|
|
11
12
|
export interface ApiIdentityPlugin {
|
|
12
13
|
getIdentities: (context: DevPortalContext) => Promise<ApiIdentity[]>;
|
|
13
14
|
}
|
|
14
|
-
export interface
|
|
15
|
-
|
|
15
|
+
export interface ProfileMenuPlugin {
|
|
16
|
+
getProfileMenuItems: (context: DevPortalContext) => NavigationItem[];
|
|
16
17
|
}
|
|
18
|
+
export type NavigationItem = {
|
|
19
|
+
label: string;
|
|
20
|
+
path?: string;
|
|
21
|
+
children?: NavigationItem[];
|
|
22
|
+
};
|
|
23
|
+
export interface CommonPlugin {
|
|
24
|
+
initialize?: (context: DevPortalContext) => Promise<void> | void;
|
|
25
|
+
getHead?: () => ReactElement | undefined;
|
|
26
|
+
}
|
|
27
|
+
export declare const isProfileMenuPlugin: (obj: DevPortalPlugin) => obj is ProfileMenuPlugin;
|
|
17
28
|
export declare const isNavigationPlugin: (obj: DevPortalPlugin) => obj is NavigationPlugin;
|
|
18
|
-
export declare const needsInitialization: (obj: DevPortalPlugin) => obj is
|
|
29
|
+
export declare const needsInitialization: (obj: DevPortalPlugin) => obj is CommonPlugin;
|
|
30
|
+
export declare const hasHead: (obj: DevPortalPlugin) => obj is CommonPlugin;
|
|
19
31
|
export declare const isApiIdentityPlugin: (obj: DevPortalPlugin) => obj is ApiIdentityPlugin;
|
package/dist/lib/core/plugins.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
export const isProfileMenuPlugin = (obj) => "getProfileMenuItems" in obj && typeof obj.getProfileMenuItems === "function";
|
|
1
2
|
export const isNavigationPlugin = (obj) => "getRoutes" in obj && typeof obj.getRoutes === "function";
|
|
2
3
|
export const needsInitialization = (obj) => "initialize" in obj && typeof obj.initialize === "function";
|
|
4
|
+
export const hasHead = (obj) => "getHead" in obj && typeof obj.getHead === "function";
|
|
3
5
|
export const isApiIdentityPlugin = (obj) => "getIdentities" in obj && typeof obj.getIdentities === "function";
|
|
4
6
|
//# sourceMappingURL=plugins.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugins.js","sourceRoot":"","sources":["../../../src/lib/core/plugins.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"plugins.js","sourceRoot":"","sources":["../../../src/lib/core/plugins.ts"],"names":[],"mappings":"AA0CA,MAAM,CAAC,MAAM,mBAAmB,GAAG,CACjC,GAAoB,EACM,EAAE,CAC5B,qBAAqB,IAAI,GAAG,IAAI,OAAO,GAAG,CAAC,mBAAmB,KAAK,UAAU,CAAC;AAEhF,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAChC,GAAoB,EACK,EAAE,CAC3B,WAAW,IAAI,GAAG,IAAI,OAAO,GAAG,CAAC,SAAS,KAAK,UAAU,CAAC;AAE5D,MAAM,CAAC,MAAM,mBAAmB,GAAG,CACjC,GAAoB,EACC,EAAE,CACvB,YAAY,IAAI,GAAG,IAAI,OAAO,GAAG,CAAC,UAAU,KAAK,UAAU,CAAC;AAE9D,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,GAAoB,EAAuB,EAAE,CACnE,SAAS,IAAI,GAAG,IAAI,OAAO,GAAG,CAAC,OAAO,KAAK,UAAU,CAAC;AAExD,MAAM,CAAC,MAAM,mBAAmB,GAAG,CACjC,GAAoB,EACM,EAAE,CAC5B,eAAe,IAAI,GAAG,IAAI,OAAO,GAAG,CAAC,aAAa,KAAK,UAAU,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3
|
+
export function ErrorAlert({ error }) {
|
|
4
|
+
const message = error?.message ?? "Something went wrong";
|
|
5
|
+
const stack = error?.stack;
|
|
6
|
+
return (_jsx("div", { className: "flex h-screen max-h-screen min-h-full items-center justify-center bg-primary-background px-4 py-16 lg:px-8", children: _jsxs("div", { className: "mx-auto max-w-[85%] sm:max-w-[50%]", children: [_jsx("h1", { className: "text-4xl font-bold tracking-tight text-h1-text sm:text-5xl", children: "Something went wrong" }), _jsx("p", { className: "mt-5 text-h1-text", children: message }), stack ? (_jsx("pre", { className: "mt-5 max-h-[400px] w-full overflow-scroll rounded-md border border-input-border bg-input-background p-3 text-property-name-text text-red-700", children: stack })) : null] }) }));
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=ErrorAlert.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ErrorAlert.js","sourceRoot":"","sources":["../../../src/lib/errors/ErrorAlert.tsx"],"names":[],"mappings":";AAAA,8DAA8D;AAC9D,MAAM,UAAU,UAAU,CAAC,EAAE,KAAK,EAAkB;IAClD,MAAM,OAAO,GAAG,KAAK,EAAE,OAAO,IAAI,sBAAsB,CAAC;IACzD,MAAM,KAAK,GAAG,KAAK,EAAE,KAAK,CAAC;IAE3B,OAAO,CACL,cAAK,SAAS,EAAC,4GAA4G,YACzH,eAAK,SAAS,EAAC,oCAAoC,aACjD,aAAI,SAAS,EAAC,4DAA4D,qCAErE,EACL,YAAG,SAAS,EAAC,mBAAmB,YAAE,OAAO,GAAK,EAC7C,KAAK,CAAC,CAAC,CAAC,CACP,cAAK,SAAS,EAAC,8IAA8I,YAC1J,KAAK,GACF,CACP,CAAC,CAAC,CAAC,IAAI,IACJ,GACF,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function RouterError(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { isRouteErrorResponse, useRouteError } from "react-router-dom";
|
|
3
|
+
import { NotFoundPage } from "../components/NotFoundPage.js";
|
|
4
|
+
import { ErrorAlert } from "./ErrorAlert.js";
|
|
5
|
+
export function RouterError() {
|
|
6
|
+
const error = useRouteError();
|
|
7
|
+
if (isRouteErrorResponse(error) && error.status === 404) {
|
|
8
|
+
return _jsx(NotFoundPage, {});
|
|
9
|
+
}
|
|
10
|
+
return _jsx(ErrorAlert, { error: error });
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=RouterError.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RouterError.js","sourceRoot":"","sources":["../../../src/lib/errors/RouterError.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACvE,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,MAAM,UAAU,WAAW;IACzB,MAAM,KAAK,GAAG,aAAa,EAAE,CAAC;IAE9B,IAAI,oBAAoB,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;QACxD,OAAO,KAAC,YAAY,KAAG,CAAC;IAC1B,CAAC;IAED,OAAO,KAAC,UAAU,IAAC,KAAK,EAAE,KAAK,GAAI,CAAC;AACtC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ServerError.js","sourceRoot":"","sources":["../../../src/lib/errors/ServerError.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,MAAM,UAAU,WAAW,CAAC,EAAE,KAAK,EAAsB;IACvD,OAAO,KAAC,UAAU,IAAC,KAAK,EAAE,KAAK,GAAI,CAAC;AACtC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { ErrorAlert } from "./ErrorAlert.js";
|
|
3
|
+
export function TopLevelError({ error, resetErrorBoundary }) {
|
|
4
|
+
// Call resetErrorBoundary() to reset the error boundary and retry the render.
|
|
5
|
+
return _jsx(ErrorAlert, { error: error });
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=TopLevelError.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TopLevelError.js","sourceRoot":"","sources":["../../../src/lib/errors/TopLevelError.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,MAAM,UAAU,aAAa,CAAC,EAAE,KAAK,EAAE,kBAAkB,EAAiB;IACxE,8EAA8E;IAE9E,OAAO,KAAC,UAAU,IAAC,KAAK,EAAE,KAAK,GAAI,CAAC;AACtC,CAAC"}
|
|
@@ -7,10 +7,12 @@ import hashit from "object-hash";
|
|
|
7
7
|
import slugify from "../../util/slugify.js";
|
|
8
8
|
import { HttpMethods, validate, } from "../parser/index.js";
|
|
9
9
|
export const slugifyOperation = (operation, tag) => {
|
|
10
|
+
const summary = operation.summary +
|
|
11
|
+
(operation.operationId
|
|
12
|
+
? "-" + operation.operationId.slice(0, operation.summary ? 4 : 12)
|
|
13
|
+
: "");
|
|
10
14
|
return slugify((tag ? tag + "-" : "") +
|
|
11
|
-
(operation.
|
|
12
|
-
operation.operationId ??
|
|
13
|
-
`${operation.method}-${operation.path}`), { lower: true, trim: true });
|
|
15
|
+
(summary || `${operation.method}-${operation.path}`), { lower: true, trim: true });
|
|
14
16
|
};
|
|
15
17
|
const cache = new LRUCache({
|
|
16
18
|
ttl: 60 * 10 * 1000,
|
|
@@ -260,7 +262,7 @@ const loadOpenAPISchema = async (input) => {
|
|
|
260
262
|
if (cache.has(hash)) {
|
|
261
263
|
return cache.get(hash);
|
|
262
264
|
}
|
|
263
|
-
const schema =
|
|
265
|
+
const schema = validate(input);
|
|
264
266
|
cache.set(hash, schema);
|
|
265
267
|
return schema;
|
|
266
268
|
};
|