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,11 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import React, { useContext } from "react";
|
|
3
|
+
const SlotletContext = React.createContext({});
|
|
4
|
+
export const SlotletProvider = ({ slotlets, children, }) => {
|
|
5
|
+
return (_jsx(SlotletContext.Provider, { value: slotlets, children: children }));
|
|
6
|
+
};
|
|
7
|
+
export const Slotlet = ({ name }) => {
|
|
8
|
+
const x = useContext(SlotletContext);
|
|
9
|
+
return x?.[name];
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=SlotletProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SlotletProvider.js","sourceRoot":"","sources":["../../../src/lib/components/SlotletProvider.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,EAAa,UAAU,EAAE,MAAM,OAAO,CAAC;AAIrD,MAAM,cAAc,GAAG,KAAK,CAAC,aAAa,CAAuB,EAAE,CAAC,CAAC;AAErE,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,EAC9B,QAAQ,EACR,QAAQ,GAIT,EAAE,EAAE;IACH,OAAO,CACL,KAAC,cAAc,CAAC,QAAQ,IAAC,KAAK,EAAE,QAAQ,YACrC,QAAQ,GACe,CAC3B,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,EAAE,IAAI,EAAoB,EAAE,EAAE;IACpD,MAAM,CAAC,GAAG,UAAU,CAAC,cAAc,CAAC,CAAC;IAErC,OAAO,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;AACnB,CAAC,CAAC"}
|
|
@@ -5,6 +5,7 @@ type SyntaxHighlightProps = {
|
|
|
5
5
|
wrapLines?: boolean;
|
|
6
6
|
copyable?: boolean;
|
|
7
7
|
showLanguageIndicator?: boolean;
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
language?: string;
|
|
9
|
+
} & Omit<HighlightProps, "children" | "language">;
|
|
10
|
+
export declare const SyntaxHighlight: ({ copyable, language, ...props }: SyntaxHighlightProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
10
11
|
export {};
|
|
@@ -1,40 +1,42 @@
|
|
|
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
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
import("prismjs/components/prism-objectivec.min.js");
|
|
22
|
-
}
|
|
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");
|
|
23
21
|
import { useState } from "react";
|
|
24
22
|
import { cn } from "../util/cn.js";
|
|
25
23
|
import { useTheme } from "./context/ThemeContext.js";
|
|
26
|
-
export const SyntaxHighlight = ({ copyable = true, ...props }) => {
|
|
24
|
+
export const SyntaxHighlight = ({ copyable = true, language = "plain", ...props }) => {
|
|
27
25
|
const [isDark] = useTheme();
|
|
28
26
|
const [isCopied, setIsCopied] = useState(false);
|
|
29
27
|
if (!props.code) {
|
|
30
28
|
return null;
|
|
31
29
|
}
|
|
32
|
-
return (_jsx(Highlight, { theme: isDark ? themes.vsDark : themes.github, ...props, children: ({ className, style, tokens, getLineProps, getTokenProps }) => (_jsxs("pre", { className: cn("
|
|
30
|
+
return (_jsx(Highlight, { theme: isDark ? themes.vsDark : themes.github, language: language, ...props, children: ({ className, style, tokens, getLineProps, getTokenProps }) => (_jsxs("div", { className: "relative group", children: [_jsx("pre", { className: cn("relative overflow-x-auto", className, props.className, props.noBackground && "!bg-transparent", props.wrapLines && "whitespace-pre-wrap break-words"), style: style, children: tokens.map((line, i) => (
|
|
31
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
32
|
+
_jsx("div", { ...getLineProps({ line }), children: line.map((token, key) => (
|
|
33
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
34
|
+
_jsx("span", { ...getTokenProps({ token }) }, key))) }, i))) }), 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 })), copyable && (_jsx("button", { type: "button", "aria-label": "Copy code", title: "Copy code", 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", disabled: isCopied, onClick: () => {
|
|
33
35
|
setIsCopied(true);
|
|
34
36
|
void navigator.clipboard.writeText(tokens
|
|
35
37
|
.map((line) => line.map(({ content }) => content).join(""))
|
|
36
38
|
.join("\n"));
|
|
37
39
|
setTimeout(() => setIsCopied(false), 2000);
|
|
38
|
-
}, children: isCopied ? (_jsx(CheckIcon, { className: "text-emerald-600", size: 18 })) : (_jsx(CopyIcon, { size: 18 })) }))
|
|
40
|
+
}, children: isCopied ? (_jsx(CheckIcon, { className: "text-emerald-600", size: 18 })) : (_jsx(CopyIcon, { size: 18 })) }))] })) }));
|
|
39
41
|
};
|
|
40
42
|
//# 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,GAEP,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAEnD,UAAU,CAAC,KAAK,GAAG,KAAK,CAAC;AACzB,mC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AkB,EAAC,IAAI,EAAE,EAAE,GAAI,CACrD,CAAC,CAAC,CAAC,CACF,KAAC,QAAQ,IAAC,IAAI,EAAE,EAAE,GAAI,CACvB,GACM,CACV,IACG,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;QACd,OAAO,EAAE,gBAAgB;QACzB,QAAQ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,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"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useRef } from "react";
|
|
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
|
export const SideNavigation = () => {
|
|
7
8
|
const navRef = useRef(null);
|
|
8
9
|
const navigation = useNavigation();
|
|
9
|
-
return (
|
|
10
|
+
return (_jsxs(SideNavigationWrapper, { ref: navRef, pushMainContent: navigation.data.items.length > 0, children: [_jsx(Slotlet, { name: "zudoku-before-navigation" }), navigation.data.items.map((category) => (_jsx(SideNavigationCategory, { category: category }, category.label))), _jsx(Slotlet, { name: "zudoku-after-navigation" })] }));
|
|
10
11
|
};
|
|
11
12
|
//# sourceMappingURL=SideNavigation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SideNavigation.js","sourceRoot":"","sources":["../../../../src/lib/components/navigation/SideNavigation.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAEnE,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,EAAE;IACjC,MAAM,MAAM,GAAG,MAAM,CAAwB,IAAI,CAAC,CAAC;IACnD,MAAM,UAAU,GAAG,aAAa,EAAE,CAAC;IAEnC,OAAO,CACL,
|
|
1
|
+
{"version":3,"file":"SideNavigation.js","sourceRoot":"","sources":["../../../../src/lib/components/navigation/SideNavigation.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAEnE,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,EAAE;IACjC,MAAM,MAAM,GAAG,MAAM,CAAwB,IAAI,CAAC,CAAC;IACnD,MAAM,UAAU,GAAG,aAAa,EAAE,CAAC;IAEnC,OAAO,CACL,MAAC,qBAAqB,IACpB,GAAG,EAAE,MAAM,EACX,eAAe,EAAE,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,aAEjD,KAAC,OAAO,IAAC,IAAI,EAAC,0BAA0B,GAAG,EAC1C,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CACvC,KAAC,sBAAsB,IAAsB,QAAQ,EAAE,QAAQ,IAAlC,QAAQ,CAAC,KAAK,CAAwB,CACpE,CAAC,EACF,KAAC,OAAO,IAAC,IAAI,EAAC,yBAAyB,GAAG,IACpB,CACzB,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -8,19 +8,19 @@ 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();
|
|
15
15
|
const location = useLocation();
|
|
16
16
|
const isCollapsible = category.collapsible ?? true;
|
|
17
|
-
const
|
|
17
|
+
const collapsibleProps = useNavigationCollapsibleState({
|
|
18
18
|
item: category,
|
|
19
19
|
path: navItem?.path ?? "",
|
|
20
20
|
defaultOpen: () => !isCollapsible ||
|
|
21
21
|
category.expanded ||
|
|
22
22
|
checkHasActiveItem(category, location.pathname, navItem?.path ?? ""),
|
|
23
23
|
});
|
|
24
|
-
return (_jsxs(Collapsible.Root, {
|
|
24
|
+
return (_jsxs(Collapsible.Root, { ...collapsibleProps, 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,kBAA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,aAEA,QAAQ,CAAC,KAAK,EACd,aAAa,IAAI,CAChB,KAAC,gBAAgB,IACf,SAAS,EAAC,8CAA8C,EACxD,IAAI,EAAE,EAAE,GACR,CACH,IACE,GACe,CACvB,CAAC,CAAC,CAAC,CACF,WAAW,CACZ,EACD,KAAC,WAAW,CAAC,OAAO,IAAC,SAAS,EAAC,6CAA6C,YAE1E,aAAI,SAAS,EAAC,8BAA8B,YACzC,QAAQ,CAAC,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,KAnCD,QAAQ,CAAC,KAAK,CAoClB,CACpB,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
import type { NavigationCategory, NavigationCategoryItem, NavigationItem } from "../../core/DevPortalContext.js";
|
|
2
|
-
export declare const navigationListItem: (props?: ({
|
|
3
|
-
isActive?: boolean | null | undefined;
|
|
4
|
-
isMuted?: boolean | null | undefined;
|
|
5
|
-
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
6
2
|
export declare const DATA_ANCHOR_ATTR = "data-anchor";
|
|
7
3
|
export declare const SideNavigationItem: ({ category, item, activeAnchor, currentTopNavItem, basePath, }: {
|
|
8
4
|
category: NavigationCategory;
|
|
@@ -8,7 +8,7 @@ import { joinPath } from "../../util/joinPath.js";
|
|
|
8
8
|
import { AnchorLink } from "../AnchorLink.js";
|
|
9
9
|
import { useNavigationCollapsibleState } from "./useNavigationCollapsibleState.js";
|
|
10
10
|
import { checkHasActiveItem, isLinkItem, isPathItem } from "./util.js";
|
|
11
|
-
|
|
11
|
+
const navigationListItem = cva("flex px-[--padding-nav-item] py-1.5 rounded-lg hover:bg-accent transition-colors duration-300", {
|
|
12
12
|
variants: {
|
|
13
13
|
isActive: {
|
|
14
14
|
true: "text-primary font-medium",
|
|
@@ -24,10 +24,10 @@ export const DATA_ANCHOR_ATTR = "data-anchor";
|
|
|
24
24
|
export const SideNavigationItem = ({ category, item, activeAnchor, currentTopNavItem, basePath = "", }) => {
|
|
25
25
|
const currentPath = isPathItem(item) ? joinPath(basePath, item.path) : "";
|
|
26
26
|
const location = useLocation();
|
|
27
|
-
const
|
|
27
|
+
const collapsibleProps = useNavigationCollapsibleState({
|
|
28
28
|
item,
|
|
29
29
|
path: currentPath,
|
|
30
|
-
defaultOpen: () => checkHasActiveItem(item, location.pathname,
|
|
30
|
+
defaultOpen: () => checkHasActiveItem(item, location.pathname, basePath),
|
|
31
31
|
});
|
|
32
32
|
if (isLinkItem(item)) {
|
|
33
33
|
const classes = cn("flex items-center gap-2", navigationListItem({
|
|
@@ -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, {
|
|
39
|
+
return (_jsx("li", { title: typeof item.label === "string" ? item.label : item.title, children: item.children ? (_jsxs(Collapsible.Root, { ...collapsibleProps, 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,
|
|
1
|
+
{"version":3,"file":"SideNavigationItem.js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AAC,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,6 +1,9 @@
|
|
|
1
|
+
import type { CollapsibleProps } from "@radix-ui/react-collapsible";
|
|
1
2
|
import type { NavigationNode } from "../../util/traverseNavigation.js";
|
|
2
3
|
export declare const useNavigationCollapsibleState: ({ item, defaultOpen, path, }: {
|
|
3
4
|
item: NavigationNode;
|
|
4
5
|
defaultOpen: () => boolean;
|
|
5
6
|
path: string;
|
|
6
|
-
}) =>
|
|
7
|
+
}) => Partial<CollapsibleProps> & {
|
|
8
|
+
"data-animate": boolean;
|
|
9
|
+
};
|
|
@@ -2,15 +2,27 @@ import { useEffect, useRef, useState } from "react";
|
|
|
2
2
|
import { useLocation } from "react-router-dom";
|
|
3
3
|
import { checkHasActiveItem } from "./util.js";
|
|
4
4
|
export const useNavigationCollapsibleState = ({ item, defaultOpen, path, }) => {
|
|
5
|
-
const [
|
|
5
|
+
const [open, setOpen] = useState(defaultOpen);
|
|
6
6
|
const location = useLocation();
|
|
7
7
|
const previousLocationPath = useRef(location.pathname);
|
|
8
|
+
const [shouldAnimate, setShouldAnimate] = useState(false);
|
|
8
9
|
useEffect(() => {
|
|
9
|
-
if (!
|
|
10
|
-
|
|
10
|
+
if (!open && previousLocationPath.current !== location.pathname) {
|
|
11
|
+
setOpen(checkHasActiveItem(item, location.pathname, path));
|
|
11
12
|
}
|
|
12
13
|
previousLocationPath.current = location.pathname;
|
|
13
|
-
}, [
|
|
14
|
-
|
|
14
|
+
}, [open, item, path, location.pathname]);
|
|
15
|
+
const onOpenChange = () => {
|
|
16
|
+
setShouldAnimate(true);
|
|
17
|
+
setOpen((prev) => !prev);
|
|
18
|
+
};
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
setShouldAnimate(false);
|
|
21
|
+
}, []);
|
|
22
|
+
return {
|
|
23
|
+
open,
|
|
24
|
+
onOpenChange,
|
|
25
|
+
"data-animate": shouldAnimate,
|
|
26
|
+
};
|
|
15
27
|
};
|
|
16
28
|
//# sourceMappingURL=useNavigationCollapsibleState.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useNavigationCollapsibleState.js","sourceRoot":"","sources":["../../../../src/lib/components/navigation/useNavigationCollapsibleState.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useNavigationCollapsibleState.js","sourceRoot":"","sources":["../../../../src/lib/components/navigation/useNavigationCollapsibleState.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAE/C,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,EAC5C,IAAI,EACJ,WAAW,EACX,IAAI,GAKL,EAA2D,EAAE;IAC5D,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAC,WAAW,CAAC,CAAC;IAC9C,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;IAC/B,MAAM,oBAAoB,GAAG,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IACvD,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAE1D,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,IAAI,IAAI,oBAAoB,CAAC,OAAO,KAAK,QAAQ,CAAC,QAAQ,EAAE,CAAC;YAChE,OAAO,CAAC,kBAAkB,CAAC,IAAI,EAAE,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC;QAC7D,CAAC;QACD,oBAAoB,CAAC,OAAO,GAAG,QAAQ,CAAC,QAAQ,CAAC;IACnD,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC;IAE1C,MAAM,YAAY,GAAG,GAAG,EAAE;QACxB,gBAAgB,CAAC,IAAI,CAAC,CAAC;QACvB,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;IAC3B,CAAC,CAAC;IAEF,SAAS,CAAC,GAAG,EAAE;QACb,gBAAgB,CAAC,KAAK,CAAC,CAAC;IAC1B,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO;QACL,IAAI;QACJ,YAAY;QACZ,cAAc,EAAE,aAAa;KAC9B,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,7 +1,11 @@
|
|
|
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 { Slotlets } from "../components/SlotletProvider.js";
|
|
7
|
+
import type { MdxComponentsType } from "../util/MdxComponents.js";
|
|
8
|
+
import { type DevPortalPlugin } from "./plugins.js";
|
|
5
9
|
export interface ApiIdentity {
|
|
6
10
|
authorizeRequest: (request: Request) => Request;
|
|
7
11
|
label: string;
|
|
@@ -34,25 +38,57 @@ export type NavigationItem = {
|
|
|
34
38
|
path: DevPortalPath;
|
|
35
39
|
categories?: NavigationCategory[];
|
|
36
40
|
};
|
|
37
|
-
export type RoutingState = {
|
|
38
|
-
path?: string;
|
|
39
|
-
};
|
|
40
41
|
export declare const queryClient: QueryClient;
|
|
41
|
-
export declare const useRoutingState: import("zustand").UseBoundStore<import("zustand").StoreApi<RoutingState>>;
|
|
42
42
|
export type ApiKeyCache = "api-keys";
|
|
43
43
|
export type DevPortalCacheKey = ApiKeyCache | string;
|
|
44
|
+
type Metadata = Partial<{
|
|
45
|
+
title: string;
|
|
46
|
+
description: string;
|
|
47
|
+
logo: string;
|
|
48
|
+
favicon: string;
|
|
49
|
+
generator: string;
|
|
50
|
+
applicationName: string;
|
|
51
|
+
referrer: string;
|
|
52
|
+
keywords: string[];
|
|
53
|
+
authors: string[];
|
|
54
|
+
creator: string;
|
|
55
|
+
publisher: string;
|
|
56
|
+
}>;
|
|
57
|
+
type Page = Partial<{
|
|
58
|
+
pageTitle?: string;
|
|
59
|
+
logo?: {
|
|
60
|
+
src: {
|
|
61
|
+
light: string;
|
|
62
|
+
dark: string;
|
|
63
|
+
};
|
|
64
|
+
width?: string;
|
|
65
|
+
alt?: string;
|
|
66
|
+
};
|
|
67
|
+
}>;
|
|
68
|
+
export type ZudokuContextOptions = {
|
|
69
|
+
metadata?: Metadata;
|
|
70
|
+
page?: Page;
|
|
71
|
+
authentication?: AuthenticationProvider;
|
|
72
|
+
navigation: NavigationItem[];
|
|
73
|
+
plugins?: DevPortalPlugin[];
|
|
74
|
+
slotlets?: Slotlets;
|
|
75
|
+
mdx?: {
|
|
76
|
+
components?: MdxComponentsType;
|
|
77
|
+
};
|
|
78
|
+
overrides?: ComponentsContextType;
|
|
79
|
+
};
|
|
44
80
|
export declare class DevPortalContext {
|
|
45
|
-
|
|
81
|
+
plugins: NonNullable<ZudokuContextOptions["plugins"]>;
|
|
82
|
+
navigation: ZudokuContextOptions["navigation"];
|
|
83
|
+
meta: ZudokuContextOptions["metadata"];
|
|
84
|
+
page: ZudokuContextOptions["page"];
|
|
85
|
+
authentication?: ZudokuContextOptions["authentication"];
|
|
46
86
|
private navigationPlugins;
|
|
47
|
-
|
|
48
|
-
meta: DevPortalProps["meta"];
|
|
49
|
-
authentication?: AuthenticationProvider;
|
|
50
|
-
state: typeof useRoutingState;
|
|
51
|
-
constructor(config: DevPortalProps);
|
|
87
|
+
constructor(config: ZudokuContextOptions);
|
|
52
88
|
initialize: () => Promise<void>;
|
|
53
89
|
invalidateCache: (key: DevPortalCacheKey[]) => Promise<void>;
|
|
54
90
|
getApiIdentities: () => Promise<ApiIdentity[]>;
|
|
55
91
|
getNavigation: (path: string) => Promise<import("./plugins.js").PluginNavigationCategory[]>;
|
|
56
|
-
signRequest(request: Request)
|
|
92
|
+
signRequest: (request: Request) => Promise<Request>;
|
|
57
93
|
}
|
|
58
94
|
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
|