zudoku 0.3.0-dev.9 → 0.3.0-dev.91
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/cli.js +5 -1
- 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 +33 -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 +74 -12
- package/dist/app/main.js.map +1 -1
- package/dist/app/standalone.d.ts +2 -0
- package/dist/app/standalone.js +38 -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 +21 -46
- package/dist/config/validators/InputSidebarSchema.d.ts +176 -0
- package/dist/config/validators/InputSidebarSchema.js +71 -0
- package/dist/config/validators/InputSidebarSchema.js.map +1 -0
- package/dist/config/validators/SidebarSchema.d.ts +17 -0
- package/dist/config/validators/SidebarSchema.js +76 -0
- package/dist/config/validators/SidebarSchema.js.map +1 -0
- package/dist/config/validators/validate.d.ts +1263 -2
- package/dist/config/validators/validate.js +170 -1
- package/dist/config/validators/validate.js.map +1 -1
- package/dist/index.d.ts +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/authentication.d.ts +10 -9
- package/dist/lib/authentication/components/SignIn.d.ts +1 -0
- package/dist/lib/authentication/components/SignIn.js +14 -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 +12 -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 +4 -4
- package/dist/lib/authentication/hook.js.map +1 -1
- package/dist/lib/authentication/providers/auth0.js +11 -6
- 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 +30 -7
- package/dist/lib/authentication/providers/openid.js +79 -29
- package/dist/lib/authentication/providers/openid.js.map +1 -1
- package/dist/lib/authentication/state.js +1 -1
- package/dist/lib/authentication/state.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 -23
- package/dist/lib/components/DevPortal.js +43 -20
- 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 +23 -4
- 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 +7 -5
- 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 +8 -4
- package/dist/lib/components/TopNavigation.js.map +1 -1
- package/dist/lib/components/context/ThemeContext.d.ts +1 -4
- package/dist/lib/components/context/ThemeContext.js +3 -29
- package/dist/lib/components/context/ThemeContext.js.map +1 -1
- package/dist/lib/components/context/ThemeProvider.d.ts +4 -0
- package/dist/lib/components/context/ThemeProvider.js +23 -0
- package/dist/lib/components/context/ThemeProvider.js.map +1 -0
- package/dist/lib/components/context/ZudokuContext.d.ts +15 -0
- package/dist/lib/components/context/ZudokuContext.js +46 -0
- package/dist/lib/components/context/ZudokuContext.js.map +1 -0
- package/dist/lib/components/context/ZudokuProvider.d.ts +5 -0
- package/dist/lib/components/context/ZudokuProvider.js +16 -0
- package/dist/lib/components/context/ZudokuProvider.js.map +1 -0
- 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/Sidebar.d.ts +1 -0
- package/dist/lib/components/navigation/Sidebar.js +12 -0
- package/dist/lib/components/navigation/Sidebar.js.map +1 -0
- package/dist/lib/components/navigation/SidebarBadge.d.ts +22 -0
- package/dist/lib/components/navigation/SidebarBadge.js +24 -0
- package/dist/lib/components/navigation/SidebarBadge.js.map +1 -0
- package/dist/lib/components/navigation/SidebarCategory.d.ts +5 -0
- package/dist/lib/components/navigation/SidebarCategory.js +33 -0
- package/dist/lib/components/navigation/SidebarCategory.js.map +1 -0
- package/dist/lib/components/navigation/SidebarItem.d.ts +12 -0
- package/dist/lib/components/navigation/SidebarItem.js +42 -0
- package/dist/lib/components/navigation/SidebarItem.js.map +1 -0
- package/dist/lib/components/navigation/{SideNavigationWrapper.d.ts → SidebarWrapper.d.ts} +1 -1
- package/dist/lib/components/navigation/{SideNavigationWrapper.js → SidebarWrapper.js} +2 -2
- package/dist/lib/components/navigation/SidebarWrapper.js.map +1 -0
- package/dist/lib/components/navigation/utils.d.ts +16 -0
- package/dist/lib/components/navigation/utils.js +85 -0
- package/dist/lib/components/navigation/utils.js.map +1 -0
- package/dist/lib/core/DevPortalContext.d.ts +58 -42
- package/dist/lib/core/DevPortalContext.js +18 -19
- package/dist/lib/core/DevPortalContext.js.map +1 -1
- package/dist/lib/core/plugins.d.ts +25 -10
- package/dist/lib/core/plugins.js +3 -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 +8 -5
- 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 +4 -4
- 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 +54 -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 +18 -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 +10 -40
- 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 +20 -43
- 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 +11 -5
- package/dist/lib/plugins/openapi/OperationListItem.js.map +1 -1
- package/dist/lib/plugins/openapi/ParameterList.js +2 -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} +2 -1
- package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.js +23 -0
- package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.js.map +1 -0
- package/dist/lib/plugins/openapi/RequestBodySidecarBox.js +3 -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 +10 -26
- package/dist/lib/plugins/openapi/SchemaListView.js.map +1 -1
- package/dist/lib/plugins/openapi/SchemaListViewItem.d.ts +8 -0
- package/dist/lib/plugins/openapi/SchemaListViewItem.js +25 -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.d.ts +4 -0
- package/dist/lib/plugins/openapi/Sidecar.js +55 -21
- 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/graphql/gql.d.ts +6 -6
- package/dist/lib/plugins/openapi/graphql/gql.js +1 -1
- package/dist/lib/plugins/openapi/graphql/gql.js.map +1 -1
- package/dist/lib/plugins/openapi/graphql/graphql.d.ts +15 -15
- package/dist/lib/plugins/openapi/graphql/graphql.js +67 -67
- package/dist/lib/plugins/openapi/graphql/graphql.js.map +1 -1
- package/dist/lib/plugins/openapi/index.d.ts +4 -18
- package/dist/lib/plugins/openapi/index.js +76 -32
- package/dist/lib/plugins/openapi/index.js.map +1 -1
- package/dist/lib/plugins/openapi/interfaces.d.ts +16 -0
- package/dist/lib/plugins/openapi/interfaces.js +2 -0
- package/dist/lib/plugins/openapi/interfaces.js.map +1 -0
- package/dist/lib/plugins/openapi/playground/Headers.js +1 -1
- package/dist/lib/plugins/openapi/playground/Headers.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/PathParams.d.ts +4 -5
- package/dist/lib/plugins/openapi/playground/PathParams.js +9 -13
- package/dist/lib/plugins/openapi/playground/PathParams.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/Playground.d.ts +26 -14
- package/dist/lib/plugins/openapi/playground/Playground.js +54 -26
- package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/PlaygroundDialog.d.ts +5 -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 +4 -3
- package/dist/lib/plugins/openapi/playground/QueryParams.js +21 -12
- package/dist/lib/plugins/openapi/playground/QueryParams.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/ResponseTab.d.ts +4 -0
- package/dist/lib/plugins/openapi/playground/ResponseTab.js +40 -0
- package/dist/lib/plugins/openapi/playground/ResponseTab.js.map +1 -0
- 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/Button.d.ts +5 -1
- package/dist/lib/ui/Button.js +24 -1
- package/dist/lib/ui/Button.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/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/fetchTimeout.d.ts +1 -0
- package/dist/lib/util/fetchTimeout.js +14 -0
- package/dist/lib/util/fetchTimeout.js.map +1 -0
- 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/lib/util/useScrollToAnchor.js +31 -17
- package/dist/lib/util/useScrollToAnchor.js.map +1 -1
- package/dist/vite/build.js +30 -7
- package/dist/vite/build.js.map +1 -1
- package/dist/vite/config.d.ts +20 -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 +3 -6
- package/dist/vite/plugin-config.js +5 -8
- 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 +11 -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-sidebar.d.ts +3 -0
- package/dist/vite/plugin-sidebar.js +23 -0
- package/dist/vite/plugin-sidebar.js.map +1 -0
- package/dist/vite/plugin.js +5 -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/AuthenticationPlugin-CH5NSVOu.js +55 -0
- package/lib/AuthenticationPlugin-CH5NSVOu.js.map +1 -0
- package/lib/CategoryHeading-BWq12Bfa.js +10 -0
- package/lib/CategoryHeading-BWq12Bfa.js.map +1 -0
- package/lib/Combination-D-9IH0zy.js +2789 -0
- package/lib/Combination-D-9IH0zy.js.map +1 -0
- package/lib/DeveloperHint-BQSFXH01.js +10 -0
- package/lib/DeveloperHint-BQSFXH01.js.map +1 -0
- package/lib/Input-HmAaR6kw.js +2239 -0
- package/lib/Input-HmAaR6kw.js.map +1 -0
- package/lib/Markdown-B_Gax7at.js +14108 -0
- package/lib/Markdown-B_Gax7at.js.map +1 -0
- package/lib/MdxPage-3-PenZs2.js +187 -0
- package/lib/MdxPage-3-PenZs2.js.map +1 -0
- package/lib/OperationList-DvKqvB16.js +448 -0
- package/lib/OperationList-DvKqvB16.js.map +1 -0
- package/lib/Route-CnmaDun4.js +14 -0
- package/lib/Route-CnmaDun4.js.map +1 -0
- package/lib/SlotletProvider-CzMAO73_.js +82 -0
- package/lib/SlotletProvider-CzMAO73_.js.map +1 -0
- package/lib/Spinner-D99Tq0hv.js +274 -0
- package/lib/Spinner-D99Tq0hv.js.map +1 -0
- package/lib/ZudokuContext-BIZ8zHbZ.js +1084 -0
- package/lib/ZudokuContext-BIZ8zHbZ.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-CyHZIIfE.js} +10727 -10300
- package/lib/assets/worker-CyHZIIfE.js.map +1 -0
- package/lib/index-7kcHaXD6.js +1771 -0
- package/lib/index-7kcHaXD6.js.map +1 -0
- package/lib/index-7nswqEVR.js +124 -0
- package/lib/index-7nswqEVR.js.map +1 -0
- package/lib/index-DjaqWcmv.js +5934 -0
- package/lib/index-DjaqWcmv.js.map +1 -0
- package/lib/index-pI9JkN46.js +4765 -0
- package/lib/index-pI9JkN46.js.map +1 -0
- package/lib/joinPath-VeNuJa7y.js +8 -0
- package/lib/joinPath-VeNuJa7y.js.map +1 -0
- package/lib/jsx-runtime-B6kdoens.js +635 -0
- package/lib/jsx-runtime-B6kdoens.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-DsXXkBLH.js +288 -0
- package/lib/state-DsXXkBLH.js.map +1 -0
- package/lib/{urql-DMlBWUKL.js → urql-DrBfkb92.js} +2 -2
- package/lib/urql-DrBfkb92.js.map +1 -0
- package/lib/utils-D3g3xyZM.js +749 -0
- package/lib/utils-D3g3xyZM.js.map +1 -0
- package/lib/zudoku.auth-auth0.js +31 -20
- 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 +742 -573
- package/lib/zudoku.auth-openid.js.map +1 -0
- package/lib/zudoku.components.js +2008 -684
- 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 +325 -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 +31 -0
- package/lib/zudoku.plugin-markdown.js.map +1 -0
- package/lib/zudoku.plugin-openapi.js +14 -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 +64 -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 +46 -0
- package/src/app/entry.client.tsx +47 -0
- package/src/app/entry.server.tsx +160 -0
- package/src/app/main.css +83 -3
- package/src/app/main.tsx +87 -15
- package/src/app/standalone.html +20 -0
- package/src/app/standalone.tsx +52 -0
- package/src/app/tailwind.ts +2 -6
- package/src/lib/authentication/AuthenticationPlugin.tsx +38 -0
- package/src/lib/authentication/authentication.ts +6 -12
- package/src/lib/authentication/components/SignIn.tsx +15 -0
- package/src/lib/authentication/components/SignOut.tsx +13 -0
- package/src/lib/authentication/components/SignUp.tsx +11 -0
- package/src/lib/authentication/hook.ts +4 -4
- package/src/lib/authentication/providers/auth0.tsx +16 -6
- package/src/lib/authentication/providers/clerk.tsx +63 -31
- package/src/lib/authentication/providers/openid.tsx +104 -34
- package/src/lib/authentication/state.ts +1 -1
- package/src/lib/components/Bootstrap.tsx +44 -0
- package/src/lib/components/DevPortal.tsx +75 -66
- package/src/lib/components/DeveloperHint.tsx +25 -0
- package/src/lib/components/ErrorPage.tsx +28 -0
- package/src/lib/components/Header.tsx +106 -31
- package/src/lib/components/Heading.tsx +26 -7
- package/src/lib/components/InlineCode.tsx +19 -0
- package/src/lib/components/Layout.tsx +16 -11
- 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 +10 -5
- package/src/lib/components/context/ThemeContext.tsx +3 -41
- package/src/lib/components/context/ThemeProvider.tsx +27 -0
- package/src/lib/components/context/ZudokuContext.ts +58 -0
- package/src/lib/components/context/ZudokuProvider.tsx +26 -0
- package/src/lib/components/index.ts +25 -3
- package/src/lib/components/navigation/Sidebar.tsx +24 -0
- package/src/lib/components/navigation/SidebarBadge.tsx +40 -0
- package/src/lib/components/navigation/SidebarCategory.tsx +105 -0
- package/src/lib/components/navigation/SidebarItem.tsx +100 -0
- package/src/lib/components/navigation/{SideNavigationWrapper.tsx → SidebarWrapper.tsx} +1 -1
- package/src/lib/components/navigation/utils.ts +117 -0
- package/src/lib/core/DevPortalContext.ts +72 -68
- package/src/lib/core/plugins.ts +40 -16
- 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 +11 -6
- package/src/lib/oas/parser/index.ts +41 -20
- package/src/lib/plugins/{api-key → api-keys}/CreateApiKey.tsx +4 -4
- package/src/lib/plugins/api-keys/ProtectedRoute.tsx +29 -0
- package/src/lib/plugins/{api-key → api-keys}/SettingsApiKeys.tsx +49 -16
- package/src/lib/plugins/{api-key → api-keys}/index.tsx +27 -41
- package/src/lib/plugins/custom-page/index.tsx +22 -0
- package/src/lib/plugins/markdown/MdxPage.tsx +54 -73
- package/src/lib/plugins/markdown/Toc.tsx +53 -40
- package/src/lib/plugins/markdown/generateRoutes.tsx +35 -53
- 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 +51 -30
- package/src/lib/plugins/openapi/ParameterList.tsx +13 -10
- package/src/lib/plugins/openapi/ParameterListItem.tsx +3 -4
- package/src/lib/plugins/openapi/PlaygroundDialogWrapper.tsx +39 -0
- package/src/lib/plugins/openapi/RequestBodySidecarBox.tsx +3 -15
- 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 +39 -192
- package/src/lib/plugins/openapi/SchemaListViewItem.tsx +125 -0
- package/src/lib/plugins/openapi/SchemaListViewItemGroup.tsx +63 -0
- package/src/lib/plugins/openapi/Sidecar.tsx +77 -30
- 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/graphql/gql.ts +8 -8
- package/src/lib/plugins/openapi/graphql/graphql.ts +80 -80
- package/src/lib/plugins/openapi/index.tsx +134 -76
- package/src/lib/plugins/openapi/interfaces.ts +10 -0
- package/src/lib/plugins/openapi/playground/Headers.tsx +1 -1
- package/src/lib/plugins/openapi/playground/PathParams.tsx +76 -50
- package/src/lib/plugins/openapi/playground/Playground.tsx +240 -230
- package/src/lib/plugins/openapi/playground/PlaygroundDialog.tsx +40 -0
- package/src/lib/plugins/openapi/playground/QueryParams.tsx +107 -66
- package/src/lib/plugins/openapi/playground/ResponseTab.tsx +76 -0
- 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/Button.tsx +32 -2
- 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/util/MdxComponents.tsx +7 -15
- package/src/lib/util/fetchTimeout.tsx +21 -0
- 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/src/lib/util/useScrollToAnchor.ts +39 -18
- package/dist/lib/authentication/Callback.d.ts +0 -3
- package/dist/lib/authentication/Callback.js +0 -34
- package/dist/lib/authentication/Callback.js.map +0 -1
- 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/components/context/DevPortalProvider.d.ts +0 -9
- package/dist/lib/components/context/DevPortalProvider.js +0 -39
- package/dist/lib/components/context/DevPortalProvider.js.map +0 -1
- package/dist/lib/components/navigation/SideNavigation.d.ts +0 -1
- package/dist/lib/components/navigation/SideNavigation.js +0 -11
- package/dist/lib/components/navigation/SideNavigation.js.map +0 -1
- package/dist/lib/components/navigation/SideNavigationCategory.d.ts +0 -4
- package/dist/lib/components/navigation/SideNavigationCategory.js +0 -26
- package/dist/lib/components/navigation/SideNavigationCategory.js.map +0 -1
- package/dist/lib/components/navigation/SideNavigationItem.d.ts +0 -13
- package/dist/lib/components/navigation/SideNavigationItem.js +0 -44
- package/dist/lib/components/navigation/SideNavigationItem.js.map +0 -1
- package/dist/lib/components/navigation/SideNavigationWrapper.js.map +0 -1
- package/dist/lib/components/navigation/useNavigationCollapsibleState.d.ts +0 -6
- package/dist/lib/components/navigation/useNavigationCollapsibleState.js +0 -16
- package/dist/lib/components/navigation/useNavigationCollapsibleState.js.map +0 -1
- package/dist/lib/components/navigation/util.d.ts +0 -8
- package/dist/lib/components/navigation/util.js +0 -15
- package/dist/lib/components/navigation/util.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 +0 -43
- package/dist/lib/plugins/openapi/MakeRequest.js.map +0 -1
- package/dist/lib/plugins/openapi/MethodBadge.d.ts +0 -13
- package/dist/lib/plugins/openapi/MethodBadge.js +0 -26
- package/dist/lib/plugins/openapi/MethodBadge.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/lib/ui/button-variants.d.ts +0 -4
- package/dist/lib/ui/button-variants.js +0 -24
- package/dist/lib/ui/button-variants.js.map +0 -1
- package/dist/lib/util/traverseNavigation.d.ts +0 -6
- package/dist/lib/util/traverseNavigation.js +0 -30
- package/dist/lib/util/traverseNavigation.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 -19904
- package/src/lib/authentication/Callback.tsx +0 -60
- package/src/lib/components/Link.tsx +0 -1
- package/src/lib/components/Router.tsx +0 -28
- package/src/lib/components/context/DevPortalProvider.ts +0 -54
- package/src/lib/components/navigation/SideNavigation.tsx +0 -21
- package/src/lib/components/navigation/SideNavigationCategory.tsx +0 -76
- package/src/lib/components/navigation/SideNavigationItem.tsx +0 -152
- package/src/lib/components/navigation/useNavigationCollapsibleState.ts +0 -27
- package/src/lib/components/navigation/util.ts +0 -38
- 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/MakeRequest.tsx +0 -63
- package/src/lib/plugins/openapi/MethodBadge.tsx +0 -36
- package/src/lib/plugins/openapi/worker/shared-worker.ts +0 -5
- package/src/lib/ui/button-variants.ts +0 -31
- package/src/lib/util/traverseNavigation.ts +0 -55
- /package/dist/lib/plugins/{api-key → api-keys}/CreateApiKey.d.ts +0 -0
- /package/dist/lib/plugins/{api-key → api-keys}/SettingsApiKeys.d.ts +0 -0
- /package/dist/lib/plugins/openapi/{worker → client}/worker.d.ts +0 -0
- /package/dist/lib/{components → ui}/Input.d.ts +0 -0
- /package/dist/lib/{components → ui}/Input.js +0 -0
- /package/src/lib/{components → ui}/Input.tsx +0 -0
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { useEffect, useRef, useState } from "react";
|
|
2
|
-
import { useNavigate } from "../core/router.js";
|
|
3
|
-
import { OAuthAuthorizationError } from "./errors.js";
|
|
4
|
-
|
|
5
|
-
export function Callback({
|
|
6
|
-
handleCallback,
|
|
7
|
-
}: {
|
|
8
|
-
handleCallback: () => Promise<void>;
|
|
9
|
-
}) {
|
|
10
|
-
const didInitialize = useRef(false);
|
|
11
|
-
const [error, setError] = useState<Error | undefined>(undefined);
|
|
12
|
-
const navigate = useNavigate();
|
|
13
|
-
|
|
14
|
-
// This should not use react query, etc. It is important that it
|
|
15
|
-
// only ever runs once. The didInitialize ref keeps it from double
|
|
16
|
-
// initializing in dev mode with ReactStrict enabled.
|
|
17
|
-
useEffect(() => {
|
|
18
|
-
if (didInitialize.current) {
|
|
19
|
-
return;
|
|
20
|
-
}
|
|
21
|
-
didInitialize.current = true;
|
|
22
|
-
handleCallback()
|
|
23
|
-
.then(() => {
|
|
24
|
-
// TODO: Handle return url, state, etc
|
|
25
|
-
navigate("/");
|
|
26
|
-
})
|
|
27
|
-
.catch((err) => {
|
|
28
|
-
setError(err);
|
|
29
|
-
});
|
|
30
|
-
}, []);
|
|
31
|
-
|
|
32
|
-
if (error) {
|
|
33
|
-
if (error instanceof OAuthAuthorizationError) {
|
|
34
|
-
return (
|
|
35
|
-
<div>
|
|
36
|
-
<h2>Error</h2>
|
|
37
|
-
<pre>
|
|
38
|
-
{error.error.error}
|
|
39
|
-
|
|
40
|
-
{error.error.error_description}
|
|
41
|
-
|
|
42
|
-
{error.error.error_uri}
|
|
43
|
-
</pre>
|
|
44
|
-
</div>
|
|
45
|
-
);
|
|
46
|
-
}
|
|
47
|
-
return (
|
|
48
|
-
<div>
|
|
49
|
-
<h2>Error</h2>
|
|
50
|
-
<pre>
|
|
51
|
-
{error.message}
|
|
52
|
-
|
|
53
|
-
{error.stack}
|
|
54
|
-
</pre>
|
|
55
|
-
</div>
|
|
56
|
-
);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
return <div>Loading...</div>;
|
|
60
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { Link } from "../core/router.js";
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { useMemo } from "react";
|
|
2
|
-
import { createBrowserRouter, RouterProvider } from "react-router-dom";
|
|
3
|
-
import { DevPortalPlugin, isNavigationPlugin } from "../core/plugins.js";
|
|
4
|
-
import { Layout } from "./Layout.js";
|
|
5
|
-
|
|
6
|
-
export function Router({ plugins }: { plugins?: DevPortalPlugin[] }) {
|
|
7
|
-
const router = useMemo(() => {
|
|
8
|
-
const routes = (plugins ?? []).flatMap((plugin) =>
|
|
9
|
-
isNavigationPlugin(plugin) ? plugin.getRoutes() : [],
|
|
10
|
-
);
|
|
11
|
-
|
|
12
|
-
return createBrowserRouter([
|
|
13
|
-
{
|
|
14
|
-
path: "/",
|
|
15
|
-
element: <Layout />,
|
|
16
|
-
errorElement: (
|
|
17
|
-
<Layout>
|
|
18
|
-
<div className="h-[75vh] flex items-center justify-center">
|
|
19
|
-
Error, look at the console
|
|
20
|
-
</div>
|
|
21
|
-
</Layout>
|
|
22
|
-
),
|
|
23
|
-
children: routes,
|
|
24
|
-
},
|
|
25
|
-
]);
|
|
26
|
-
}, [plugins]);
|
|
27
|
-
return <RouterProvider router={router} />;
|
|
28
|
-
}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { useSuspenseQuery } from "@tanstack/react-query";
|
|
2
|
-
import { createContext, useContext } from "react";
|
|
3
|
-
import { matchPath, useLocation } from "react-router-dom";
|
|
4
|
-
import { DevPortalContext } from "../../core/DevPortalContext.js";
|
|
5
|
-
|
|
6
|
-
const DevPortalReactContext = createContext<DevPortalContext | undefined>(
|
|
7
|
-
undefined,
|
|
8
|
-
);
|
|
9
|
-
|
|
10
|
-
export const DevPortalProvider = DevPortalReactContext.Provider;
|
|
11
|
-
|
|
12
|
-
export const useDevPortal = () => {
|
|
13
|
-
const context = useContext(DevPortalReactContext);
|
|
14
|
-
|
|
15
|
-
if (!context) {
|
|
16
|
-
throw new Error("useDevPortal must be used within a DevPortalProvider.");
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
return context;
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export const useApiIdentities = () => {
|
|
23
|
-
const { getApiIdentities } = useDevPortal();
|
|
24
|
-
return useSuspenseQuery({
|
|
25
|
-
queryFn: getApiIdentities,
|
|
26
|
-
queryKey: ["api-identities"],
|
|
27
|
-
});
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
export const useTopNavigationItem = () => {
|
|
31
|
-
const { navigation } = useDevPortal();
|
|
32
|
-
const location = useLocation();
|
|
33
|
-
|
|
34
|
-
return navigation.find((item) =>
|
|
35
|
-
matchPath({ path: item.path, end: false }, location.pathname),
|
|
36
|
-
);
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
export const useNavigation = () => {
|
|
40
|
-
const { getNavigation } = useDevPortal();
|
|
41
|
-
const navItem = useTopNavigationItem();
|
|
42
|
-
|
|
43
|
-
const path = navItem?.path ?? "";
|
|
44
|
-
|
|
45
|
-
return useSuspenseQuery({
|
|
46
|
-
queryFn: async () => {
|
|
47
|
-
return {
|
|
48
|
-
items: [...(navItem?.categories ?? []), ...(await getNavigation(path))],
|
|
49
|
-
currentTopNavItem: navItem,
|
|
50
|
-
};
|
|
51
|
-
},
|
|
52
|
-
queryKey: ["navigation", path],
|
|
53
|
-
});
|
|
54
|
-
};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { useRef } from "react";
|
|
2
|
-
|
|
3
|
-
import { useNavigation } from "../context/DevPortalProvider.js";
|
|
4
|
-
import { SideNavigationCategory } from "./SideNavigationCategory.js";
|
|
5
|
-
import { SideNavigationWrapper } from "./SideNavigationWrapper.js";
|
|
6
|
-
|
|
7
|
-
export const SideNavigation = () => {
|
|
8
|
-
const navRef = useRef<HTMLDivElement | null>(null);
|
|
9
|
-
const navigation = useNavigation();
|
|
10
|
-
|
|
11
|
-
return (
|
|
12
|
-
<SideNavigationWrapper
|
|
13
|
-
ref={navRef}
|
|
14
|
-
pushMainContent={navigation.data.items.length > 0}
|
|
15
|
-
>
|
|
16
|
-
{navigation.data.items.map((category) => (
|
|
17
|
-
<SideNavigationCategory key={category.label} category={category} />
|
|
18
|
-
))}
|
|
19
|
-
</SideNavigationWrapper>
|
|
20
|
-
);
|
|
21
|
-
};
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import * as Collapsible from "@radix-ui/react-collapsible";
|
|
2
|
-
import { ChevronRightIcon } from "lucide-react";
|
|
3
|
-
import { useLocation } from "react-router-dom";
|
|
4
|
-
import type { NavigationCategory } from "../../core/DevPortalContext.js";
|
|
5
|
-
import { cn } from "../../util/cn.js";
|
|
6
|
-
import { joinPath } from "../../util/joinPath.js";
|
|
7
|
-
import { useTopNavigationItem } from "../context/DevPortalProvider.js";
|
|
8
|
-
import { useViewportAnchor } from "../context/ViewportAnchorContext.js";
|
|
9
|
-
import { SideNavigationItem } from "./SideNavigationItem.js";
|
|
10
|
-
import { useNavigationCollapsibleState } from "./useNavigationCollapsibleState.js";
|
|
11
|
-
import { checkHasActiveItem, isPathItem } from "./util.js";
|
|
12
|
-
|
|
13
|
-
export const SideNavigationCategory = ({
|
|
14
|
-
category,
|
|
15
|
-
}: {
|
|
16
|
-
category: NavigationCategory;
|
|
17
|
-
}) => {
|
|
18
|
-
const { activeAnchor } = useViewportAnchor();
|
|
19
|
-
const navItem = useTopNavigationItem();
|
|
20
|
-
const location = useLocation();
|
|
21
|
-
|
|
22
|
-
const isCollapsible = category.collapsible ?? true;
|
|
23
|
-
|
|
24
|
-
const [isOpen, setIsOpen] = useNavigationCollapsibleState({
|
|
25
|
-
item: category,
|
|
26
|
-
path: navItem?.path ?? "",
|
|
27
|
-
defaultOpen: () =>
|
|
28
|
-
!isCollapsible ||
|
|
29
|
-
category.expanded ||
|
|
30
|
-
checkHasActiveItem(category, location.pathname, navItem?.path ?? ""),
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
return (
|
|
34
|
-
<Collapsible.Root
|
|
35
|
-
key={category.label}
|
|
36
|
-
open={isOpen}
|
|
37
|
-
onOpenChange={() => setIsOpen((prev) => !prev)}
|
|
38
|
-
>
|
|
39
|
-
{category.label.length > 0 ? (
|
|
40
|
-
<Collapsible.Trigger asChild={isCollapsible} disabled={!isCollapsible}>
|
|
41
|
-
<h5
|
|
42
|
-
className={cn(
|
|
43
|
-
"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]",
|
|
44
|
-
isCollapsible ? "hover:bg-accent" : "cursor-auto",
|
|
45
|
-
)}
|
|
46
|
-
>
|
|
47
|
-
{category.label}
|
|
48
|
-
{isCollapsible && (
|
|
49
|
-
<ChevronRightIcon
|
|
50
|
-
className="group-data-[state=open]:rotate-90 transition"
|
|
51
|
-
size={16}
|
|
52
|
-
/>
|
|
53
|
-
)}
|
|
54
|
-
</h5>
|
|
55
|
-
</Collapsible.Trigger>
|
|
56
|
-
) : (
|
|
57
|
-
"Endpoints"
|
|
58
|
-
)}
|
|
59
|
-
<Collapsible.Content className="CollapsibleContent -mx-[--padding-nav-item]">
|
|
60
|
-
{/* margin on Collapsible.Content will lead jumpiness when animating because it's not added to the calculated height */}
|
|
61
|
-
<ul className="space-y-0.5 mt-1.5 mb-4 ms-3">
|
|
62
|
-
{category.children.map((item) => (
|
|
63
|
-
<SideNavigationItem
|
|
64
|
-
key={isPathItem(item) ? item.path + item.label : item.href}
|
|
65
|
-
category={category}
|
|
66
|
-
item={item}
|
|
67
|
-
activeAnchor={activeAnchor}
|
|
68
|
-
currentTopNavItem={navItem}
|
|
69
|
-
basePath={joinPath(navItem?.path, category.path)}
|
|
70
|
-
/>
|
|
71
|
-
))}
|
|
72
|
-
</ul>
|
|
73
|
-
</Collapsible.Content>
|
|
74
|
-
</Collapsible.Root>
|
|
75
|
-
);
|
|
76
|
-
};
|
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
import * as Collapsible from "@radix-ui/react-collapsible";
|
|
2
|
-
import { cva } from "class-variance-authority";
|
|
3
|
-
import { ChevronRightIcon, ExternalLinkIcon } from "lucide-react";
|
|
4
|
-
import { NavLink, useLocation } from "react-router-dom";
|
|
5
|
-
|
|
6
|
-
import type {
|
|
7
|
-
NavigationCategory,
|
|
8
|
-
NavigationCategoryItem,
|
|
9
|
-
NavigationItem,
|
|
10
|
-
} from "../../core/DevPortalContext.js";
|
|
11
|
-
import { cn } from "../../util/cn.js";
|
|
12
|
-
import { joinPath } from "../../util/joinPath.js";
|
|
13
|
-
import { AnchorLink } from "../AnchorLink.js";
|
|
14
|
-
import { useNavigationCollapsibleState } from "./useNavigationCollapsibleState.js";
|
|
15
|
-
import { checkHasActiveItem, isLinkItem, isPathItem } from "./util.js";
|
|
16
|
-
|
|
17
|
-
export const navigationListItem = cva(
|
|
18
|
-
"flex px-[--padding-nav-item] py-1.5 rounded-lg hover:bg-accent transition-colors duration-300",
|
|
19
|
-
{
|
|
20
|
-
variants: {
|
|
21
|
-
isActive: {
|
|
22
|
-
true: "text-primary font-medium",
|
|
23
|
-
false: "text-foreground/80",
|
|
24
|
-
},
|
|
25
|
-
isMuted: {
|
|
26
|
-
true: "text-foreground/30",
|
|
27
|
-
false: "",
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
);
|
|
32
|
-
|
|
33
|
-
export const DATA_ANCHOR_ATTR = "data-anchor";
|
|
34
|
-
|
|
35
|
-
export const SideNavigationItem = ({
|
|
36
|
-
category,
|
|
37
|
-
item,
|
|
38
|
-
activeAnchor,
|
|
39
|
-
currentTopNavItem,
|
|
40
|
-
basePath = "",
|
|
41
|
-
}: {
|
|
42
|
-
category: NavigationCategory;
|
|
43
|
-
item: NavigationCategoryItem;
|
|
44
|
-
activeAnchor?: string;
|
|
45
|
-
currentTopNavItem?: NavigationItem;
|
|
46
|
-
basePath?: string;
|
|
47
|
-
}) => {
|
|
48
|
-
const currentPath = isPathItem(item) ? joinPath(basePath, item.path) : "";
|
|
49
|
-
const location = useLocation();
|
|
50
|
-
|
|
51
|
-
const [isOpen, setIsOpen] = useNavigationCollapsibleState({
|
|
52
|
-
item,
|
|
53
|
-
path: currentPath,
|
|
54
|
-
defaultOpen: () => checkHasActiveItem(item, location.pathname, currentPath),
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
if (isLinkItem(item)) {
|
|
58
|
-
const classes = cn(
|
|
59
|
-
"flex items-center gap-2",
|
|
60
|
-
navigationListItem({
|
|
61
|
-
isActive: item.href === location.pathname,
|
|
62
|
-
}),
|
|
63
|
-
);
|
|
64
|
-
return item.href.startsWith("http") ? (
|
|
65
|
-
<a
|
|
66
|
-
className={classes}
|
|
67
|
-
href={item.href}
|
|
68
|
-
target="_blank"
|
|
69
|
-
rel="noopener noreferrer"
|
|
70
|
-
>
|
|
71
|
-
{item.label}
|
|
72
|
-
<ExternalLinkIcon size={14} />
|
|
73
|
-
</a>
|
|
74
|
-
) : (
|
|
75
|
-
<NavLink className={classes} to={item.href}>
|
|
76
|
-
{item.label}
|
|
77
|
-
</NavLink>
|
|
78
|
-
);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
const linkContent = (
|
|
82
|
-
<div className="flex justify-between w-full">
|
|
83
|
-
<div className="flex items-center gap-2 truncate w-full">
|
|
84
|
-
{item.icon}
|
|
85
|
-
{typeof item.label !== "string" ? (
|
|
86
|
-
item.label
|
|
87
|
-
) : (
|
|
88
|
-
<span className="truncate">{item.label}</span>
|
|
89
|
-
)}
|
|
90
|
-
</div>
|
|
91
|
-
{item.children && (
|
|
92
|
-
<ChevronRightIcon
|
|
93
|
-
size={16}
|
|
94
|
-
className="transition shrink-0 group-data-[state=open]:rotate-90"
|
|
95
|
-
/>
|
|
96
|
-
)}
|
|
97
|
-
</div>
|
|
98
|
-
);
|
|
99
|
-
|
|
100
|
-
return (
|
|
101
|
-
<li title={typeof item.label === "string" ? item.label : item.title}>
|
|
102
|
-
{item.children ? (
|
|
103
|
-
<Collapsible.Root
|
|
104
|
-
open={isOpen}
|
|
105
|
-
onOpenChange={() => setIsOpen((prev) => !prev)}
|
|
106
|
-
className="flex flex-col"
|
|
107
|
-
>
|
|
108
|
-
<Collapsible.Trigger
|
|
109
|
-
className={cn(
|
|
110
|
-
"group text-start",
|
|
111
|
-
navigationListItem({ isActive: false }),
|
|
112
|
-
)}
|
|
113
|
-
>
|
|
114
|
-
{linkContent}
|
|
115
|
-
</Collapsible.Trigger>
|
|
116
|
-
<Collapsible.Content className="CollapsibleContent ms-[calc(var(--padding-nav-item)*1.125)]">
|
|
117
|
-
<ul className="mt-1 border-border border-l ps-1.5">
|
|
118
|
-
{item.children.map((child) => (
|
|
119
|
-
<SideNavigationItem
|
|
120
|
-
key={isPathItem(child) ? child.path : child.href}
|
|
121
|
-
category={category}
|
|
122
|
-
item={child}
|
|
123
|
-
activeAnchor={activeAnchor}
|
|
124
|
-
currentTopNavItem={currentTopNavItem}
|
|
125
|
-
basePath={currentPath}
|
|
126
|
-
/>
|
|
127
|
-
))}
|
|
128
|
-
</ul>
|
|
129
|
-
</Collapsible.Content>
|
|
130
|
-
</Collapsible.Root>
|
|
131
|
-
) : item.path.startsWith("#") ? (
|
|
132
|
-
<AnchorLink
|
|
133
|
-
to={item.path}
|
|
134
|
-
{...{ [DATA_ANCHOR_ATTR]: item.path }}
|
|
135
|
-
className={navigationListItem({
|
|
136
|
-
isActive: item.path.slice(1) === activeAnchor,
|
|
137
|
-
isMuted: item.muted,
|
|
138
|
-
})}
|
|
139
|
-
>
|
|
140
|
-
{linkContent}
|
|
141
|
-
</AnchorLink>
|
|
142
|
-
) : (
|
|
143
|
-
<NavLink
|
|
144
|
-
className={({ isActive }) => navigationListItem({ isActive })}
|
|
145
|
-
to={currentPath}
|
|
146
|
-
>
|
|
147
|
-
{linkContent}
|
|
148
|
-
</NavLink>
|
|
149
|
-
)}
|
|
150
|
-
</li>
|
|
151
|
-
);
|
|
152
|
-
};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { useEffect, useRef, useState } from "react";
|
|
2
|
-
import { useLocation } from "react-router-dom";
|
|
3
|
-
import type { NavigationNode } from "../../util/traverseNavigation.js";
|
|
4
|
-
import { checkHasActiveItem } from "./util.js";
|
|
5
|
-
|
|
6
|
-
export const useNavigationCollapsibleState = ({
|
|
7
|
-
item,
|
|
8
|
-
defaultOpen,
|
|
9
|
-
path,
|
|
10
|
-
}: {
|
|
11
|
-
item: NavigationNode;
|
|
12
|
-
defaultOpen: () => boolean;
|
|
13
|
-
path: string;
|
|
14
|
-
}) => {
|
|
15
|
-
const [isOpen, setIsOpen] = useState(defaultOpen);
|
|
16
|
-
const location = useLocation();
|
|
17
|
-
const previousLocationPath = useRef(location.pathname);
|
|
18
|
-
|
|
19
|
-
useEffect(() => {
|
|
20
|
-
if (!isOpen && previousLocationPath.current !== location.pathname) {
|
|
21
|
-
setIsOpen(checkHasActiveItem(item, location.pathname, path));
|
|
22
|
-
}
|
|
23
|
-
previousLocationPath.current = location.pathname;
|
|
24
|
-
}, [isOpen, item, path, location.pathname]);
|
|
25
|
-
|
|
26
|
-
return [isOpen, setIsOpen] as const;
|
|
27
|
-
};
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { matchPath } from "react-router-dom";
|
|
2
|
-
import type {
|
|
3
|
-
HrefNavigationCategoryItem,
|
|
4
|
-
PathNavigationCategoryItem,
|
|
5
|
-
} from "../../core/DevPortalContext.js";
|
|
6
|
-
import {
|
|
7
|
-
traverseNavigationNode,
|
|
8
|
-
type NavigationNode,
|
|
9
|
-
} from "../../util/traverseNavigation.js";
|
|
10
|
-
|
|
11
|
-
export const isPathItem = (
|
|
12
|
-
item: NavigationNode,
|
|
13
|
-
): item is PathNavigationCategoryItem => "path" in item;
|
|
14
|
-
|
|
15
|
-
export const isLinkItem = (
|
|
16
|
-
item: NavigationNode,
|
|
17
|
-
): item is HrefNavigationCategoryItem => "href" in item;
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Recursively checks if the current item or any of its children are active.
|
|
21
|
-
*/
|
|
22
|
-
export const checkHasActiveItem = (
|
|
23
|
-
item: NavigationNode,
|
|
24
|
-
locationPath: string,
|
|
25
|
-
basePath: string,
|
|
26
|
-
) => {
|
|
27
|
-
return Boolean(
|
|
28
|
-
traverseNavigationNode(
|
|
29
|
-
item,
|
|
30
|
-
(node, fullPath) => {
|
|
31
|
-
if (isPathItem(node) && matchPath(fullPath, locationPath)) {
|
|
32
|
-
return true;
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
|
-
basePath,
|
|
36
|
-
),
|
|
37
|
-
);
|
|
38
|
-
};
|
package/src/lib/core/helmet.ts
DELETED
package/src/lib/core/icons.tsx
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "lucide-react";
|
package/src/lib/core/router.tsx
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "react-router-dom";
|
package/src/lib/plugins/index.ts
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { graphql } from "./graphql/index.js";
|
|
2
|
-
import { useOasConfig } from "./index.js";
|
|
3
|
-
import type { OperationListItemResult } from "./OperationList.js";
|
|
4
|
-
import { Playground } from "./playground/Playground.js";
|
|
5
|
-
|
|
6
|
-
import { useQuery } from "urql";
|
|
7
|
-
|
|
8
|
-
const GetServerQuery = graphql(/* GraphQL */ `
|
|
9
|
-
query getServerQuery($input: JSON!, $type: SchemaType!) {
|
|
10
|
-
schema(input: $input, type: $type) {
|
|
11
|
-
url
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
`);
|
|
15
|
-
|
|
16
|
-
export const MakeRequest = ({
|
|
17
|
-
operation,
|
|
18
|
-
}: {
|
|
19
|
-
operation: OperationListItemResult;
|
|
20
|
-
}) => {
|
|
21
|
-
const variables = useOasConfig();
|
|
22
|
-
const [server] = useQuery({ query: GetServerQuery, variables });
|
|
23
|
-
|
|
24
|
-
const headers = operation.parameters
|
|
25
|
-
?.filter((p) => p.in === "header")
|
|
26
|
-
.map((p) => ({
|
|
27
|
-
name: p.name,
|
|
28
|
-
value: p.examples?.find((x) => x.value)?.value ?? "",
|
|
29
|
-
}));
|
|
30
|
-
const queryParams = operation.parameters
|
|
31
|
-
?.filter((p) => p.in === "query")
|
|
32
|
-
.sort((a, b) => (a.required && !b.required ? -1 : 1))
|
|
33
|
-
.map((p) => {
|
|
34
|
-
return {
|
|
35
|
-
name: p.name,
|
|
36
|
-
value: "",
|
|
37
|
-
active: p.required ?? false,
|
|
38
|
-
isRequired: p.required ?? false,
|
|
39
|
-
};
|
|
40
|
-
});
|
|
41
|
-
const pathParams = operation.parameters
|
|
42
|
-
?.filter((p) => p.in === "path")
|
|
43
|
-
.map((p) => ({
|
|
44
|
-
name: p.name,
|
|
45
|
-
value: "",
|
|
46
|
-
}));
|
|
47
|
-
|
|
48
|
-
const hasParams =
|
|
49
|
-
operation.parameters?.some((p) => p.in === "query" || p.in === "path") ??
|
|
50
|
-
false;
|
|
51
|
-
|
|
52
|
-
return (
|
|
53
|
-
<Playground
|
|
54
|
-
host={server.data?.schema.url ?? ""}
|
|
55
|
-
method={operation.method}
|
|
56
|
-
url={operation.path}
|
|
57
|
-
headers={headers}
|
|
58
|
-
queryParams={queryParams}
|
|
59
|
-
pathParams={pathParams}
|
|
60
|
-
hasParams={hasParams}
|
|
61
|
-
/>
|
|
62
|
-
);
|
|
63
|
-
};
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { cn } from "../../util/cn.js";
|
|
2
|
-
|
|
3
|
-
export const MethodTextColorMap = {
|
|
4
|
-
get: "text-green-600",
|
|
5
|
-
post: "text-sky-600",
|
|
6
|
-
put: "text-yellow-600",
|
|
7
|
-
delete: "text-red-600",
|
|
8
|
-
patch: "text-purple-600",
|
|
9
|
-
options: "text-indigo-600",
|
|
10
|
-
head: "text-gray-600",
|
|
11
|
-
trace: "text-gray-600",
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
const MethodColorMap = {
|
|
15
|
-
get: "bg-green-400 dark:bg-green-800",
|
|
16
|
-
post: "bg-sky-400 dark:bg-sky-800",
|
|
17
|
-
put: "bg-yellow-400 dark:bg-yellow-800",
|
|
18
|
-
delete: "bg-red-400 dark:bg-red-800",
|
|
19
|
-
patch: "bg-purple-400 dark:bg-purple-600",
|
|
20
|
-
options: "bg-indigo-400 dark:bg-indigo-600",
|
|
21
|
-
head: "bg-gray-400 dark:bg-gray-600",
|
|
22
|
-
trace: "bg-gray-400 dark:bg-gray-600",
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export const MethodBadge = ({ method }: { method: string }) => {
|
|
26
|
-
return (
|
|
27
|
-
<span
|
|
28
|
-
className={cn(
|
|
29
|
-
"mt-0.5 flex items-center duration-200 transition-opacity text-center uppercase font-mono text-[0.65rem] font-bold rounded text-background dark:text-zinc-50 h-4 px-1",
|
|
30
|
-
MethodColorMap[method as keyof typeof MethodColorMap],
|
|
31
|
-
)}
|
|
32
|
-
>
|
|
33
|
-
{method}
|
|
34
|
-
</span>
|
|
35
|
-
);
|
|
36
|
-
};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { cva } from "class-variance-authority";
|
|
2
|
-
|
|
3
|
-
export const buttonVariants = cva(
|
|
4
|
-
"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",
|
|
5
|
-
{
|
|
6
|
-
variants: {
|
|
7
|
-
variant: {
|
|
8
|
-
default:
|
|
9
|
-
"bg-primary text-primary-foreground shadow hover:bg-primary/90",
|
|
10
|
-
destructive:
|
|
11
|
-
"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",
|
|
12
|
-
outline:
|
|
13
|
-
"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",
|
|
14
|
-
secondary:
|
|
15
|
-
"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",
|
|
16
|
-
ghost: "hover:bg-accent hover:text-accent-foreground",
|
|
17
|
-
link: "text-primary underline-offset-4 hover:underline",
|
|
18
|
-
},
|
|
19
|
-
size: {
|
|
20
|
-
default: "h-9 px-4 py-2",
|
|
21
|
-
sm: "h-8 rounded-md px-3 text-xs",
|
|
22
|
-
lg: "h-10 rounded-md px-8",
|
|
23
|
-
icon: "h-9 w-9",
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
defaultVariants: {
|
|
27
|
-
variant: "default",
|
|
28
|
-
size: "default",
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
);
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { isPathItem } from "../components/navigation/util.js";
|
|
2
|
-
import type {
|
|
3
|
-
NavigationCategory,
|
|
4
|
-
NavigationCategoryItem,
|
|
5
|
-
NavigationItem,
|
|
6
|
-
} from "../core/DevPortalContext.js";
|
|
7
|
-
import { joinPath } from "./joinPath.js";
|
|
8
|
-
|
|
9
|
-
export type NavigationNode = NavigationCategoryItem | NavigationCategory;
|
|
10
|
-
type Callback<T> = (
|
|
11
|
-
node: NavigationNode,
|
|
12
|
-
fullPath: string,
|
|
13
|
-
parentNodes: NavigationNode[],
|
|
14
|
-
) => T | undefined;
|
|
15
|
-
|
|
16
|
-
export const traverseNavigationNode = <T>(
|
|
17
|
-
node: NavigationNode,
|
|
18
|
-
callback: Callback<T>,
|
|
19
|
-
parentPath: string,
|
|
20
|
-
parentNodes: NavigationNode[] = [],
|
|
21
|
-
): T | undefined => {
|
|
22
|
-
const newPath = isPathItem(node)
|
|
23
|
-
? joinPath(parentPath, node.path)
|
|
24
|
-
: parentPath;
|
|
25
|
-
const result = callback(node, newPath, parentNodes);
|
|
26
|
-
|
|
27
|
-
if (result !== undefined) return result;
|
|
28
|
-
|
|
29
|
-
if ("children" in node && node.children) {
|
|
30
|
-
const newParentNodes = [...parentNodes, node];
|
|
31
|
-
for (const child of node.children) {
|
|
32
|
-
const childResult = traverseNavigationNode(
|
|
33
|
-
child,
|
|
34
|
-
callback,
|
|
35
|
-
newPath,
|
|
36
|
-
newParentNodes,
|
|
37
|
-
);
|
|
38
|
-
if (childResult !== undefined) return childResult;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
return undefined;
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
export const traverseNavigation = <T>(
|
|
45
|
-
navItem: NavigationItem,
|
|
46
|
-
callback: Callback<T>,
|
|
47
|
-
): T | undefined => {
|
|
48
|
-
if (navItem.categories) {
|
|
49
|
-
for (const category of navItem.categories) {
|
|
50
|
-
const result = traverseNavigationNode(category, callback, navItem.path);
|
|
51
|
-
if (result !== undefined) return result;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
return undefined;
|
|
55
|
-
};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|