zudoku 0.3.0-dev.7 → 0.3.0-dev.70
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 +20 -7
- package/dist/lib/authentication/providers/openid.js +58 -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 +715 -539
- 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 +69 -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
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import { cn } from "../util/cn.js";
|
|
3
|
+
|
|
4
|
+
export const InlineCode = ({
|
|
5
|
+
className,
|
|
6
|
+
children,
|
|
7
|
+
}: {
|
|
8
|
+
className?: string;
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
}) => (
|
|
11
|
+
<code
|
|
12
|
+
className={cn(
|
|
13
|
+
className,
|
|
14
|
+
"font-mono border p-1 py-0.5 rounded bg-border/50 dark:bg-border/70 whitespace-nowrap",
|
|
15
|
+
)}
|
|
16
|
+
>
|
|
17
|
+
{children}
|
|
18
|
+
</code>
|
|
19
|
+
);
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
+
import { Helmet } from "@zudoku/react-helmet-async";
|
|
1
2
|
import { Suspense, useEffect, useRef, type ReactNode } from "react";
|
|
2
3
|
import { Outlet, useLocation } from "react-router-dom";
|
|
3
|
-
import {
|
|
4
|
+
import { cn } from "../util/cn.js";
|
|
4
5
|
import { useScrollToAnchor } from "../util/useScrollToAnchor.js";
|
|
5
6
|
import { useScrollToTop } from "../util/useScrollToTop.js";
|
|
6
7
|
import { useDevPortal } from "./context/DevPortalProvider.js";
|
|
7
8
|
import { useViewportAnchor } from "./context/ViewportAnchorContext.js";
|
|
8
9
|
import { Header } from "./Header.js";
|
|
9
10
|
import { SideNavigation } from "./navigation/SideNavigation.js";
|
|
11
|
+
import { Slotlet } from "./SlotletProvider.js";
|
|
10
12
|
import { Spinner } from "./Spinner.js";
|
|
11
13
|
|
|
12
14
|
export const Layout = ({ children }: { children?: ReactNode }) => {
|
|
@@ -29,8 +31,7 @@ export const Layout = ({ children }: { children?: ReactNode }) => {
|
|
|
29
31
|
|
|
30
32
|
return (
|
|
31
33
|
<>
|
|
32
|
-
<Helmet titleTemplate={meta?.
|
|
33
|
-
<title>Home</title>
|
|
34
|
+
<Helmet titleTemplate={meta?.title}>
|
|
34
35
|
{meta?.description && (
|
|
35
36
|
<meta name="description" content={meta.description} />
|
|
36
37
|
)}
|
|
@@ -48,12 +49,16 @@ export const Layout = ({ children }: { children?: ReactNode }) => {
|
|
|
48
49
|
>
|
|
49
50
|
<SideNavigation />
|
|
50
51
|
<main
|
|
51
|
-
className=
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
className={cn(
|
|
53
|
+
"dark:border-white/10 translate-x-0 h-full",
|
|
54
|
+
"lg:overflow-visible",
|
|
55
|
+
"lg:peer-data-[navigation=true]:w-[calc(100%-var(--side-nav-width))]",
|
|
56
|
+
"lg:peer-data-[navigation=true]:translate-x-[--side-nav-width] lg:peer-data-[navigation=true]:pl-12",
|
|
57
|
+
)}
|
|
55
58
|
>
|
|
59
|
+
<Slotlet name="zudoku-before-content" />
|
|
56
60
|
{children ?? <Outlet />}
|
|
61
|
+
<Slotlet name="zudoku-after-content" />
|
|
57
62
|
</main>
|
|
58
63
|
</Suspense>
|
|
59
64
|
</div>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { UnlinkIcon } from "lucide-react";
|
|
2
|
+
import { Link, useParams } from "react-router-dom";
|
|
3
|
+
import { CategoryHeading } from "./CategoryHeading.js";
|
|
4
|
+
import { DeveloperHint } from "./DeveloperHint.js";
|
|
5
|
+
import { Heading } from "./Heading.js";
|
|
6
|
+
import { ProseClasses } from "./Markdown.js";
|
|
7
|
+
|
|
8
|
+
export const NotFoundPage = () => {
|
|
9
|
+
const params = useParams();
|
|
10
|
+
|
|
11
|
+
return (
|
|
12
|
+
<div className={ProseClasses + " h-full pt-[--padding-content-top]"}>
|
|
13
|
+
<CategoryHeading>404</CategoryHeading>
|
|
14
|
+
<Heading level={1} className="flex gap-3.5 items-center">
|
|
15
|
+
Page not found
|
|
16
|
+
<UnlinkIcon size={24} />
|
|
17
|
+
</Heading>
|
|
18
|
+
<DeveloperHint>
|
|
19
|
+
Start by adding a file at{" "}
|
|
20
|
+
<code>
|
|
21
|
+
{"{PROJECT_ROOT}"}/{params["*"]}.mdx
|
|
22
|
+
</code>{" "}
|
|
23
|
+
and add some content to make this error go away.
|
|
24
|
+
</DeveloperHint>
|
|
25
|
+
<p>
|
|
26
|
+
It seems that the page you are looking for does not exist or may have
|
|
27
|
+
been moved. Please check the URL for any typos or use the navigation
|
|
28
|
+
menu to find the correct page.
|
|
29
|
+
</p>
|
|
30
|
+
<Link to="/">Go back home</Link>
|
|
31
|
+
</div>
|
|
32
|
+
);
|
|
33
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React, { ReactNode, useContext } from "react";
|
|
2
|
+
|
|
3
|
+
export type Slotlets = Record<string, ReactNode>;
|
|
4
|
+
|
|
5
|
+
const SlotletContext = React.createContext<Slotlets | undefined>({});
|
|
6
|
+
|
|
7
|
+
export const SlotletProvider = ({
|
|
8
|
+
slotlets,
|
|
9
|
+
children,
|
|
10
|
+
}: {
|
|
11
|
+
children: ReactNode;
|
|
12
|
+
slotlets?: Slotlets;
|
|
13
|
+
}) => {
|
|
14
|
+
return (
|
|
15
|
+
<SlotletContext.Provider value={slotlets}>
|
|
16
|
+
{children}
|
|
17
|
+
</SlotletContext.Provider>
|
|
18
|
+
);
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export const Slotlet = ({ name }: { name: string }) => {
|
|
22
|
+
const x = useContext(SlotletContext);
|
|
23
|
+
|
|
24
|
+
return x?.[name];
|
|
25
|
+
};
|
|
@@ -7,25 +7,23 @@ import {
|
|
|
7
7
|
|
|
8
8
|
import { CheckIcon, CopyIcon } from "lucide-react";
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
import("prismjs/components/prism-objectivec.min.js");
|
|
28
|
-
}
|
|
10
|
+
globalThis.Prism = Prism;
|
|
11
|
+
// @ts-expect-error This is untyped
|
|
12
|
+
import("prismjs/components/prism-bash.min.js");
|
|
13
|
+
// @ts-expect-error This is untyped
|
|
14
|
+
import("prismjs/components/prism-ruby.min.js");
|
|
15
|
+
// @ts-expect-error This is untyped
|
|
16
|
+
import("prismjs/components/prism-markup-templating.js");
|
|
17
|
+
// @ts-expect-error This is untyped
|
|
18
|
+
import("prismjs/components/prism-php.min.js");
|
|
19
|
+
// @ts-expect-error This is untyped
|
|
20
|
+
import("prismjs/components/prism-json.min.js");
|
|
21
|
+
// @ts-expect-error This is untyped
|
|
22
|
+
import("prismjs/components/prism-java.min.js");
|
|
23
|
+
// @ts-expect-error This is untyped
|
|
24
|
+
import("prismjs/components/prism-csharp.min.js");
|
|
25
|
+
// @ts-expect-error This is untyped
|
|
26
|
+
import("prismjs/components/prism-objectivec.min.js");
|
|
29
27
|
|
|
30
28
|
import { useState } from "react";
|
|
31
29
|
import { cn } from "../util/cn.js";
|
|
@@ -37,10 +35,12 @@ type SyntaxHighlightProps = {
|
|
|
37
35
|
wrapLines?: boolean;
|
|
38
36
|
copyable?: boolean;
|
|
39
37
|
showLanguageIndicator?: boolean;
|
|
40
|
-
|
|
38
|
+
language?: string;
|
|
39
|
+
} & Omit<HighlightProps, "children" | "language">;
|
|
41
40
|
|
|
42
41
|
export const SyntaxHighlight = ({
|
|
43
42
|
copyable = true,
|
|
43
|
+
language = "plain",
|
|
44
44
|
...props
|
|
45
45
|
}: SyntaxHighlightProps) => {
|
|
46
46
|
const [isDark] = useTheme();
|
|
@@ -51,23 +51,44 @@ export const SyntaxHighlight = ({
|
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
return (
|
|
54
|
-
<Highlight
|
|
54
|
+
<Highlight
|
|
55
|
+
theme={isDark ? themes.vsDark : themes.github}
|
|
56
|
+
language={language}
|
|
57
|
+
{...props}
|
|
58
|
+
>
|
|
55
59
|
{({ className, style, tokens, getLineProps, getTokenProps }) => (
|
|
56
|
-
<
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
60
|
+
<div className="relative group">
|
|
61
|
+
<pre
|
|
62
|
+
className={cn(
|
|
63
|
+
"relative overflow-x-auto",
|
|
64
|
+
className,
|
|
65
|
+
props.className,
|
|
66
|
+
props.noBackground && "!bg-transparent",
|
|
67
|
+
props.wrapLines && "whitespace-pre-wrap break-words",
|
|
68
|
+
)}
|
|
69
|
+
style={style}
|
|
70
|
+
>
|
|
71
|
+
{tokens.map((line, i) => (
|
|
72
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
73
|
+
<div key={i} {...getLineProps({ line })}>
|
|
74
|
+
{line.map((token, key) => (
|
|
75
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
76
|
+
<span key={key} {...getTokenProps({ token })} />
|
|
77
|
+
))}
|
|
78
|
+
</div>
|
|
79
|
+
))}
|
|
80
|
+
</pre>
|
|
81
|
+
{props.showLanguageIndicator && (
|
|
82
|
+
<span className="absolute top-1.5 right-3 text-[11px] font-mono text-muted-foreground transition group-hover:opacity-0">
|
|
83
|
+
{language}
|
|
84
|
+
</span>
|
|
63
85
|
)}
|
|
64
|
-
style={style}
|
|
65
|
-
>
|
|
66
86
|
{copyable && (
|
|
67
87
|
<button
|
|
68
88
|
type="button"
|
|
69
89
|
aria-label="Copy code"
|
|
70
|
-
|
|
90
|
+
title="Copy code"
|
|
91
|
+
className="absolute top-1.5 right-1.5 p-2.5 opacity-0 group-hover:opacity-100 group-hover:bg-zinc-100 group-hover:dark:bg-zinc-700 hover:outline hover:outline-border/75 dark:hover:outline-border rounded-md text-sm text-gray-400 hover:text-gray-600 dark:text-gray-500 dark:hover:text-gray-400 transition"
|
|
71
92
|
disabled={isCopied}
|
|
72
93
|
onClick={() => {
|
|
73
94
|
setIsCopied(true);
|
|
@@ -86,19 +107,7 @@ export const SyntaxHighlight = ({
|
|
|
86
107
|
)}
|
|
87
108
|
</button>
|
|
88
109
|
)}
|
|
89
|
-
|
|
90
|
-
<span className="absolute top-1.5 right-3 text-[11px] font-mono text-muted-foreground transition group-hover:opacity-0">
|
|
91
|
-
{props.language}
|
|
92
|
-
</span>
|
|
93
|
-
)}
|
|
94
|
-
{tokens.map((line, i) => (
|
|
95
|
-
<div key={i} {...getLineProps({ line })}>
|
|
96
|
-
{line.map((token, key) => (
|
|
97
|
-
<span key={key} {...getTokenProps({ token })} />
|
|
98
|
-
))}
|
|
99
|
-
</div>
|
|
100
|
-
))}
|
|
101
|
-
</pre>
|
|
110
|
+
</div>
|
|
102
111
|
)}
|
|
103
112
|
</Highlight>
|
|
104
113
|
);
|
|
@@ -6,8 +6,13 @@ import { useDevPortal } from "./context/DevPortalProvider.js";
|
|
|
6
6
|
export const TopNavigation = () => {
|
|
7
7
|
const { navigation } = useDevPortal();
|
|
8
8
|
|
|
9
|
+
// Hide tope nav if there is only one item
|
|
10
|
+
if (navigation.length <= 1) {
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
|
|
9
14
|
return (
|
|
10
|
-
<nav className="border-b
|
|
15
|
+
<nav className="border-b text-sm px-12 h-[--top-nav-height]">
|
|
11
16
|
<ul className="flex flex-row items-center gap-8">
|
|
12
17
|
{navigation.map((item) => (
|
|
13
18
|
<li key={item.label}>
|
|
@@ -1,7 +1,8 @@
|
|
|
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
4
|
import { DevPortalContext } from "../../core/DevPortalContext.js";
|
|
5
|
+
import { traverseNavigation } from "../../util/traverseNavigation.js";
|
|
5
6
|
|
|
6
7
|
const DevPortalReactContext = createContext<DevPortalContext | undefined>(
|
|
7
8
|
undefined,
|
|
@@ -21,7 +22,7 @@ export const useDevPortal = () => {
|
|
|
21
22
|
|
|
22
23
|
export const useApiIdentities = () => {
|
|
23
24
|
const { getApiIdentities } = useDevPortal();
|
|
24
|
-
return
|
|
25
|
+
return useQuery({
|
|
25
26
|
queryFn: getApiIdentities,
|
|
26
27
|
queryKey: ["api-identities"],
|
|
27
28
|
});
|
|
@@ -31,8 +32,27 @@ export const useTopNavigationItem = () => {
|
|
|
31
32
|
const { navigation } = useDevPortal();
|
|
32
33
|
const location = useLocation();
|
|
33
34
|
|
|
34
|
-
|
|
35
|
-
|
|
35
|
+
// The `/` path needs this logic because it would always match:
|
|
36
|
+
// Only if a leaf node actually matches the current path it is active
|
|
37
|
+
for (const item of navigation) {
|
|
38
|
+
const foundNavItem = traverseNavigation(item, (_node, fullPath) => {
|
|
39
|
+
if (location.pathname === fullPath) {
|
|
40
|
+
return item;
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
if (foundNavItem) {
|
|
45
|
+
return foundNavItem;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
if (location.pathname === "/") {
|
|
49
|
+
return navigation.find((item) => item.path === "/");
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
return navigation.find(
|
|
53
|
+
(item) =>
|
|
54
|
+
item.path !== "/" &&
|
|
55
|
+
matchPath({ path: item.path, end: false }, location.pathname),
|
|
36
56
|
);
|
|
37
57
|
};
|
|
38
58
|
|
|
@@ -1,3 +1,25 @@
|
|
|
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 {
|
|
9
|
+
Bootstrap as BootstrapImport,
|
|
10
|
+
BootstrapStatic as BootstrapStaticImport,
|
|
11
|
+
} from "./Bootstrap.js";
|
|
12
|
+
import { DevPortal as DevPortalImport } from "./DevPortal.js";
|
|
13
|
+
import { Layout as LayoutImport } from "./Layout.js";
|
|
14
|
+
|
|
15
|
+
export const useMDXComponents = /*@__PURE__*/ useMDXComponentsImport;
|
|
16
|
+
export const Callout = /*@__PURE__*/ CalloutImport;
|
|
17
|
+
export const DevPortal = /*@__PURE__*/ DevPortalImport;
|
|
18
|
+
export const Layout = /*@__PURE__*/ LayoutImport;
|
|
19
|
+
export const Link = /*@__PURE__*/ LinkImport;
|
|
20
|
+
export const RouterError = /*@__PURE__*/ RouterErrorImport;
|
|
21
|
+
export const ServerError = /*@__PURE__*/ ServerErrorImport;
|
|
22
|
+
export const Bootstrap = /*@__PURE__*/ BootstrapImport;
|
|
23
|
+
export const BootstrapStatic = /*@__PURE__*/ BootstrapStaticImport;
|
|
24
|
+
export const Button = /*@__PURE__*/ ButtonImport;
|
|
25
|
+
export const Head = /*@__PURE__*/ Helmet;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useRef } from "react";
|
|
2
2
|
|
|
3
3
|
import { useNavigation } from "../context/DevPortalProvider.js";
|
|
4
|
+
import { Slotlet } from "../SlotletProvider.js";
|
|
4
5
|
import { SideNavigationCategory } from "./SideNavigationCategory.js";
|
|
5
6
|
import { SideNavigationWrapper } from "./SideNavigationWrapper.js";
|
|
6
7
|
|
|
@@ -13,9 +14,11 @@ export const SideNavigation = () => {
|
|
|
13
14
|
ref={navRef}
|
|
14
15
|
pushMainContent={navigation.data.items.length > 0}
|
|
15
16
|
>
|
|
17
|
+
<Slotlet name="zudoku-before-navigation" />
|
|
16
18
|
{navigation.data.items.map((category) => (
|
|
17
19
|
<SideNavigationCategory key={category.label} category={category} />
|
|
18
20
|
))}
|
|
21
|
+
<Slotlet name="zudoku-after-navigation" />
|
|
19
22
|
</SideNavigationWrapper>
|
|
20
23
|
);
|
|
21
24
|
};
|
|
@@ -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
|
|
|
13
13
|
export const SideNavigationCategory = ({
|
|
14
14
|
category,
|
|
@@ -21,7 +21,7 @@ export const SideNavigationCategory = ({
|
|
|
21
21
|
|
|
22
22
|
const isCollapsible = category.collapsible ?? true;
|
|
23
23
|
|
|
24
|
-
const
|
|
24
|
+
const collapsibleProps = useNavigationCollapsibleState({
|
|
25
25
|
item: category,
|
|
26
26
|
path: navItem?.path ?? "",
|
|
27
27
|
defaultOpen: () =>
|
|
@@ -31,11 +31,7 @@ export const SideNavigationCategory = ({
|
|
|
31
31
|
});
|
|
32
32
|
|
|
33
33
|
return (
|
|
34
|
-
<Collapsible.Root
|
|
35
|
-
key={category.label}
|
|
36
|
-
open={isOpen}
|
|
37
|
-
onOpenChange={() => setIsOpen((prev) => !prev)}
|
|
38
|
-
>
|
|
34
|
+
<Collapsible.Root key={category.label} {...collapsibleProps}>
|
|
39
35
|
{category.label.length > 0 ? (
|
|
40
36
|
<Collapsible.Trigger asChild={isCollapsible} disabled={!isCollapsible}>
|
|
41
37
|
<h5
|
|
@@ -59,9 +55,9 @@ export const SideNavigationCategory = ({
|
|
|
59
55
|
<Collapsible.Content className="CollapsibleContent -mx-[--padding-nav-item]">
|
|
60
56
|
{/* margin on Collapsible.Content will lead jumpiness when animating because it's not added to the calculated height */}
|
|
61
57
|
<ul className="space-y-0.5 mt-1.5 mb-4 ms-3">
|
|
62
|
-
{category.children.map((item) => (
|
|
58
|
+
{category.children.map((item, i) => (
|
|
63
59
|
<SideNavigationItem
|
|
64
|
-
key={
|
|
60
|
+
key={i}
|
|
65
61
|
category={category}
|
|
66
62
|
item={item}
|
|
67
63
|
activeAnchor={activeAnchor}
|
|
@@ -14,7 +14,7 @@ import { AnchorLink } from "../AnchorLink.js";
|
|
|
14
14
|
import { useNavigationCollapsibleState } from "./useNavigationCollapsibleState.js";
|
|
15
15
|
import { checkHasActiveItem, isLinkItem, isPathItem } from "./util.js";
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
const navigationListItem = cva(
|
|
18
18
|
"flex px-[--padding-nav-item] py-1.5 rounded-lg hover:bg-accent transition-colors duration-300",
|
|
19
19
|
{
|
|
20
20
|
variants: {
|
|
@@ -48,10 +48,10 @@ export const SideNavigationItem = ({
|
|
|
48
48
|
const currentPath = isPathItem(item) ? joinPath(basePath, item.path) : "";
|
|
49
49
|
const location = useLocation();
|
|
50
50
|
|
|
51
|
-
const
|
|
51
|
+
const collapsibleProps = useNavigationCollapsibleState({
|
|
52
52
|
item,
|
|
53
53
|
path: currentPath,
|
|
54
|
-
defaultOpen: () => checkHasActiveItem(item, location.pathname,
|
|
54
|
+
defaultOpen: () => checkHasActiveItem(item, location.pathname, basePath),
|
|
55
55
|
});
|
|
56
56
|
|
|
57
57
|
if (isLinkItem(item)) {
|
|
@@ -100,11 +100,7 @@ export const SideNavigationItem = ({
|
|
|
100
100
|
return (
|
|
101
101
|
<li title={typeof item.label === "string" ? item.label : item.title}>
|
|
102
102
|
{item.children ? (
|
|
103
|
-
<Collapsible.Root
|
|
104
|
-
open={isOpen}
|
|
105
|
-
onOpenChange={() => setIsOpen((prev) => !prev)}
|
|
106
|
-
className="flex flex-col"
|
|
107
|
-
>
|
|
103
|
+
<Collapsible.Root {...collapsibleProps} className="flex flex-col">
|
|
108
104
|
<Collapsible.Trigger
|
|
109
105
|
className={cn(
|
|
110
106
|
"group text-start",
|
|
@@ -114,7 +110,7 @@ export const SideNavigationItem = ({
|
|
|
114
110
|
{linkContent}
|
|
115
111
|
</Collapsible.Trigger>
|
|
116
112
|
<Collapsible.Content className="CollapsibleContent ms-[calc(var(--padding-nav-item)*1.125)]">
|
|
117
|
-
<ul className="mt-1 border-
|
|
113
|
+
<ul className="mt-1 border-l ps-1.5">
|
|
118
114
|
{item.children.map((child) => (
|
|
119
115
|
<SideNavigationItem
|
|
120
116
|
key={isPathItem(child) ? child.path : child.href}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { CollapsibleProps } from "@radix-ui/react-collapsible";
|
|
1
2
|
import { useEffect, useRef, useState } from "react";
|
|
2
3
|
import { useLocation } from "react-router-dom";
|
|
3
4
|
import type { NavigationNode } from "../../util/traverseNavigation.js";
|
|
@@ -11,17 +12,31 @@ export const useNavigationCollapsibleState = ({
|
|
|
11
12
|
item: NavigationNode;
|
|
12
13
|
defaultOpen: () => boolean;
|
|
13
14
|
path: string;
|
|
14
|
-
}) => {
|
|
15
|
-
const [
|
|
15
|
+
}): Partial<CollapsibleProps> & { "data-animate": boolean } => {
|
|
16
|
+
const [open, setOpen] = useState(defaultOpen);
|
|
16
17
|
const location = useLocation();
|
|
17
18
|
const previousLocationPath = useRef(location.pathname);
|
|
19
|
+
const [shouldAnimate, setShouldAnimate] = useState(false);
|
|
18
20
|
|
|
19
21
|
useEffect(() => {
|
|
20
|
-
if (!
|
|
21
|
-
|
|
22
|
+
if (!open && previousLocationPath.current !== location.pathname) {
|
|
23
|
+
setOpen(checkHasActiveItem(item, location.pathname, path));
|
|
22
24
|
}
|
|
23
25
|
previousLocationPath.current = location.pathname;
|
|
24
|
-
}, [
|
|
26
|
+
}, [open, item, path, location.pathname]);
|
|
25
27
|
|
|
26
|
-
|
|
28
|
+
const onOpenChange = () => {
|
|
29
|
+
setShouldAnimate(true);
|
|
30
|
+
setOpen((prev) => !prev);
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
useEffect(() => {
|
|
34
|
+
setShouldAnimate(false);
|
|
35
|
+
}, []);
|
|
36
|
+
|
|
37
|
+
return {
|
|
38
|
+
open,
|
|
39
|
+
onOpenChange,
|
|
40
|
+
"data-animate": shouldAnimate,
|
|
41
|
+
};
|
|
27
42
|
};
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import { QueryClient } from "@tanstack/react-query";
|
|
2
2
|
import { type ReactNode } from "react";
|
|
3
|
-
import { create } from "zustand";
|
|
4
3
|
import { type AuthenticationProvider } from "../authentication/authentication.js";
|
|
4
|
+
import type { ComponentsContextType } from "../components/context/ComponentsContext.js";
|
|
5
|
+
import { type DevPortalPath } from "../components/DevPortal.js";
|
|
6
|
+
import { Slotlets } from "../components/SlotletProvider.js";
|
|
7
|
+
import type { MdxComponentsType } from "../util/MdxComponents.js";
|
|
5
8
|
import {
|
|
6
|
-
type
|
|
7
|
-
type DevPortalProps,
|
|
8
|
-
} from "../components/DevPortal.js";
|
|
9
|
-
import {
|
|
9
|
+
type DevPortalPlugin,
|
|
10
10
|
isApiIdentityPlugin,
|
|
11
11
|
isNavigationPlugin,
|
|
12
|
-
needsInitialization,
|
|
13
|
-
type DevPortalPlugin,
|
|
14
12
|
type NavigationPlugin,
|
|
13
|
+
needsInitialization,
|
|
15
14
|
} from "./plugins.js";
|
|
16
15
|
|
|
17
16
|
export interface ApiIdentity {
|
|
@@ -55,40 +54,72 @@ export type NavigationItem = {
|
|
|
55
54
|
categories?: NavigationCategory[];
|
|
56
55
|
};
|
|
57
56
|
|
|
58
|
-
export type RoutingState = {
|
|
59
|
-
path?: string;
|
|
60
|
-
};
|
|
61
|
-
|
|
62
57
|
export const queryClient = new QueryClient();
|
|
63
58
|
|
|
64
|
-
export const useRoutingState = create<RoutingState>(() => ({}));
|
|
65
|
-
|
|
66
59
|
export type ApiKeyCache = "api-keys";
|
|
67
60
|
export type DevPortalCacheKey = ApiKeyCache | string;
|
|
68
61
|
|
|
62
|
+
type Metadata = Partial<{
|
|
63
|
+
title: string;
|
|
64
|
+
description: string;
|
|
65
|
+
logo: string;
|
|
66
|
+
favicon: string;
|
|
67
|
+
generator: string;
|
|
68
|
+
applicationName: string;
|
|
69
|
+
referrer: string;
|
|
70
|
+
keywords: string[];
|
|
71
|
+
authors: string[];
|
|
72
|
+
creator: string;
|
|
73
|
+
publisher: string;
|
|
74
|
+
}>;
|
|
75
|
+
|
|
76
|
+
type Page = Partial<{
|
|
77
|
+
pageTitle?: string;
|
|
78
|
+
logo?: {
|
|
79
|
+
src: {
|
|
80
|
+
light: string;
|
|
81
|
+
dark: string;
|
|
82
|
+
};
|
|
83
|
+
width?: string;
|
|
84
|
+
alt?: string;
|
|
85
|
+
};
|
|
86
|
+
}>;
|
|
87
|
+
|
|
88
|
+
export type ZudokuContextOptions = {
|
|
89
|
+
metadata?: Metadata;
|
|
90
|
+
page?: Page;
|
|
91
|
+
authentication?: AuthenticationProvider;
|
|
92
|
+
navigation: NavigationItem[];
|
|
93
|
+
plugins?: DevPortalPlugin[];
|
|
94
|
+
slotlets?: Slotlets;
|
|
95
|
+
mdx?: {
|
|
96
|
+
components?: MdxComponentsType;
|
|
97
|
+
};
|
|
98
|
+
overrides?: ComponentsContextType;
|
|
99
|
+
};
|
|
100
|
+
|
|
69
101
|
export class DevPortalContext {
|
|
70
|
-
|
|
102
|
+
public plugins: NonNullable<ZudokuContextOptions["plugins"]> = [];
|
|
103
|
+
public navigation: ZudokuContextOptions["navigation"];
|
|
104
|
+
public meta: ZudokuContextOptions["metadata"];
|
|
105
|
+
public page: ZudokuContextOptions["page"];
|
|
106
|
+
public authentication?: ZudokuContextOptions["authentication"];
|
|
71
107
|
private navigationPlugins: NavigationPlugin[];
|
|
72
108
|
|
|
73
|
-
|
|
74
|
-
public meta: DevPortalProps["meta"];
|
|
75
|
-
public authentication?: AuthenticationProvider;
|
|
76
|
-
public state: typeof useRoutingState;
|
|
77
|
-
|
|
78
|
-
constructor(config: DevPortalProps) {
|
|
109
|
+
constructor(config: ZudokuContextOptions) {
|
|
79
110
|
this.plugins = config.plugins ?? [];
|
|
80
111
|
this.navigation = config.navigation;
|
|
81
112
|
this.navigationPlugins = this.plugins.filter(isNavigationPlugin);
|
|
82
113
|
this.authentication = config.authentication;
|
|
83
|
-
this.meta = config.
|
|
84
|
-
this.
|
|
114
|
+
this.meta = config.metadata;
|
|
115
|
+
this.page = config.page;
|
|
85
116
|
}
|
|
86
117
|
|
|
87
118
|
initialize = async () => {
|
|
88
119
|
await Promise.all([
|
|
89
120
|
this.plugins
|
|
90
121
|
.filter(needsInitialization)
|
|
91
|
-
.map((plugin) => plugin.initialize(this)),
|
|
122
|
+
.map((plugin) => plugin.initialize?.(this)),
|
|
92
123
|
]);
|
|
93
124
|
};
|
|
94
125
|
|
|
@@ -116,7 +147,7 @@ export class DevPortalContext {
|
|
|
116
147
|
return navigations.flatMap((nav) => nav ?? []);
|
|
117
148
|
};
|
|
118
149
|
|
|
119
|
-
async
|
|
150
|
+
signRequest = async (request: Request) => {
|
|
120
151
|
if (!this.authentication) {
|
|
121
152
|
throw new Error("No authentication provider configured");
|
|
122
153
|
}
|
|
@@ -126,5 +157,5 @@ export class DevPortalContext {
|
|
|
126
157
|
request.headers.set("Authorization", `Bearer ${accessToken}`);
|
|
127
158
|
|
|
128
159
|
return request;
|
|
129
|
-
}
|
|
160
|
+
};
|
|
130
161
|
}
|