zudoku 0.3.0-dev.13 → 0.3.0-dev.131
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/LICENSE.md +21 -0
- package/cli.js +5 -1
- package/dist/app/App.d.ts +1 -2
- package/dist/app/App.js +1 -31
- package/dist/app/App.js.map +1 -1
- package/dist/app/demo.d.ts +2 -0
- package/dist/app/demo.js +48 -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 +81 -12
- package/dist/app/main.js.map +1 -1
- package/dist/app/standalone.d.ts +2 -0
- package/dist/app/standalone.js +53 -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 +4 -2
- package/dist/cli/dev/handler.js.map +1 -1
- package/dist/config/config.d.ts +17 -34
- 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 +81 -0
- package/dist/config/validators/SidebarSchema.js.map +1 -0
- package/dist/config/validators/validate.d.ts +1323 -2
- package/dist/config/validators/validate.js +179 -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/ClientOnly.d.ts +3 -0
- package/dist/lib/components/ClientOnly.js +7 -0
- package/dist/lib/components/ClientOnly.js.map +1 -0
- package/dist/lib/components/DevPortal.d.ts +4 -4
- package/dist/lib/components/DevPortal.js +37 -19
- 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 +26 -5
- package/dist/lib/components/Header.js.map +1 -1
- package/dist/lib/components/Heading.d.ts +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/Markdown.js +3 -2
- package/dist/lib/components/Markdown.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/Search.d.ts +1 -0
- package/dist/lib/components/Search.js +34 -0
- package/dist/lib/components/Search.js.map +1 -0
- package/dist/lib/components/SlotletProvider.d.ts +9 -0
- package/dist/lib/components/SlotletProvider.js +16 -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 +23 -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 +37 -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 +43 -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/SidebarWrapper.js +6 -0
- 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 +34 -48
- package/dist/lib/core/DevPortalContext.js +15 -18
- package/dist/lib/core/DevPortalContext.js.map +1 -1
- package/dist/lib/core/plugins.d.ts +27 -8
- 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 +34 -10
- 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 -14
- 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.js +7 -38
- 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 +1 -1
- 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.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 +14 -3
- package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
- package/dist/lib/plugins/openapi/OperationListItem.js +7 -5
- package/dist/lib/plugins/openapi/OperationListItem.js.map +1 -1
- package/dist/lib/plugins/openapi/ParameterList.js +4 -1
- package/dist/lib/plugins/openapi/ParameterList.js.map +1 -1
- package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.d.ts +2 -1
- package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.js +8 -28
- package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.js.map +1 -1
- package/dist/lib/plugins/openapi/RequestBodySidecarBox.js +3 -1
- package/dist/lib/plugins/openapi/RequestBodySidecarBox.js.map +1 -1
- package/dist/lib/plugins/openapi/ResponsesSidecarBox.d.ts +3 -1
- package/dist/lib/plugins/openapi/ResponsesSidecarBox.js +5 -9
- 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/Sidecar.d.ts +7 -1
- package/dist/lib/plugins/openapi/Sidecar.js +58 -20
- 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/SimpleSelect.js +1 -1
- package/dist/lib/plugins/openapi/SimpleSelect.js.map +1 -1
- 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/{worker/worker.js → client/createServer.js} +5 -19
- 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/client/worker.js +20 -0
- 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 +79 -34
- 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 +23 -11
- package/dist/lib/plugins/openapi/playground/Playground.js +51 -20
- package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/PlaygroundDialog.d.ts +3 -1
- package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js +3 -1
- package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js.map +1 -1
- 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 +9 -9
- package/dist/lib/plugins/openapi/playground/createUrl.js.map +1 -1
- package/dist/lib/plugins/openapi/schema/SchemaComponents.d.ts +13 -0
- package/dist/lib/plugins/openapi/schema/SchemaComponents.js +28 -0
- package/dist/lib/plugins/openapi/schema/SchemaComponents.js.map +1 -0
- package/dist/lib/plugins/openapi/schema/SchemaView.d.ts +6 -0
- package/dist/lib/plugins/openapi/schema/SchemaView.js +58 -0
- package/dist/lib/plugins/openapi/schema/SchemaView.js.map +1 -0
- package/dist/lib/plugins/openapi/schema/utils.d.ts +3 -0
- package/dist/lib/plugins/openapi/schema/utils.js +6 -0
- package/dist/lib/plugins/openapi/schema/utils.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/plugins/search-inkeep/InkeepCustomTrigger.d.ts +2 -0
- package/dist/lib/plugins/search-inkeep/InkeepCustomTrigger.js +3 -0
- package/dist/lib/plugins/search-inkeep/InkeepCustomTrigger.js.map +1 -0
- package/dist/lib/plugins/search-inkeep/index.d.ts +6 -0
- package/dist/lib/plugins/search-inkeep/index.js +18 -0
- package/dist/lib/plugins/search-inkeep/index.js.map +1 -0
- package/dist/lib/plugins/search-inkeep/inkeep.d.ts +23 -0
- package/dist/lib/plugins/search-inkeep/inkeep.js +23 -0
- package/dist/lib/plugins/search-inkeep/inkeep.js.map +1 -0
- package/dist/lib/themeToggle.d.ts +1 -0
- package/dist/lib/themeToggle.js +7 -0
- package/dist/lib/themeToggle.js.map +1 -0
- 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 +9 -7
- 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 +3 -2
- 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/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 +110 -55
- package/dist/vite/config.js.map +1 -1
- package/dist/vite/config.test.js +7 -4
- package/dist/vite/config.test.js.map +1 -1
- package/dist/vite/dev-server.d.ts +2 -2
- package/dist/vite/dev-server.js +38 -28
- package/dist/vite/dev-server.js.map +1 -1
- package/dist/vite/html.js +9 -5
- package/dist/vite/html.js.map +1 -1
- package/dist/vite/plugin-api-keys.d.ts +3 -3
- package/dist/vite/plugin-api-keys.js +9 -9
- package/dist/vite/plugin-api-keys.js.map +1 -1
- package/dist/vite/plugin-api.d.ts +3 -3
- package/dist/vite/plugin-api.js +10 -25
- package/dist/vite/plugin-api.js.map +1 -1
- package/dist/vite/plugin-auth.d.ts +3 -3
- package/dist/vite/plugin-auth.js +7 -7
- package/dist/vite/plugin-auth.js.map +1 -1
- package/dist/vite/plugin-component.d.ts +4 -4
- package/dist/vite/plugin-component.js +18 -10
- package/dist/vite/plugin-component.js.map +1 -1
- package/dist/vite/plugin-config-reload.d.ts +4 -0
- package/dist/vite/plugin-config-reload.js +24 -0
- package/dist/vite/plugin-config-reload.js.map +1 -0
- package/dist/vite/plugin-config.d.ts +2 -4
- 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 +55 -0
- package/dist/vite/plugin-custom-css.js.map +1 -0
- package/dist/vite/plugin-docs.d.ts +3 -3
- package/dist/vite/plugin-docs.js +12 -5
- package/dist/vite/plugin-docs.js.map +1 -1
- package/dist/vite/plugin-html-transform.d.ts +2 -0
- package/dist/vite/plugin-html-transform.js +15 -0
- package/dist/vite/plugin-html-transform.js.map +1 -0
- package/dist/vite/plugin-mdx.d.ts +4 -2
- package/dist/vite/plugin-mdx.js +6 -5
- package/dist/vite/plugin-mdx.js.map +1 -1
- package/dist/vite/plugin-metadata.d.ts +1 -1
- package/dist/vite/plugin-metadata.js +1 -1
- package/dist/vite/plugin-metadata.js.map +1 -1
- package/dist/vite/plugin-redirect.d.ts +3 -3
- package/dist/vite/plugin-redirect.js +12 -11
- package/dist/vite/plugin-redirect.js.map +1 -1
- package/dist/vite/plugin-sidebar.d.ts +3 -0
- package/dist/vite/plugin-sidebar.js +24 -0
- package/dist/vite/plugin-sidebar.js.map +1 -0
- package/dist/vite/plugin.d.ts +3 -2
- package/dist/vite/plugin.js +19 -14
- 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-z15xh7Jb.js +10 -0
- package/lib/CategoryHeading-z15xh7Jb.js.map +1 -0
- package/lib/Combination-DTfV-c98.js +2789 -0
- package/lib/Combination-DTfV-c98.js.map +1 -0
- package/lib/DeveloperHint-BQSFXH01.js +10 -0
- package/lib/DeveloperHint-BQSFXH01.js.map +1 -0
- package/lib/InkeepCustomTrigger-CE5-K5ex.js +6 -0
- package/lib/InkeepCustomTrigger-CE5-K5ex.js.map +1 -0
- package/lib/Input-DB9VROFR.js +2239 -0
- package/lib/Input-DB9VROFR.js.map +1 -0
- package/lib/Markdown-CEccPMI_.js +20508 -0
- package/lib/Markdown-CEccPMI_.js.map +1 -0
- package/lib/MdxPage-CnqOoqvp.js +184 -0
- package/lib/MdxPage-CnqOoqvp.js.map +1 -0
- package/lib/OperationList-Cxiw2Z-v.js +457 -0
- package/lib/OperationList-Cxiw2Z-v.js.map +1 -0
- package/lib/Route-DfAFiR7v.js +14 -0
- package/lib/Route-DfAFiR7v.js.map +1 -0
- package/lib/SlotletProvider-ByLSCZQa.js +262 -0
- package/lib/SlotletProvider-ByLSCZQa.js.map +1 -0
- package/lib/Spinner-BT_AYFrA.js +276 -0
- package/lib/Spinner-BT_AYFrA.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-DGvzLstc.js → worker-CzHUifWA.js} +3124 -2733
- package/lib/assets/worker-CzHUifWA.js.map +1 -0
- package/lib/index-7kcHaXD6.js +1771 -0
- package/lib/index-7kcHaXD6.js.map +1 -0
- package/lib/index-D-9zqIOh.js +5954 -0
- package/lib/index-D-9zqIOh.js.map +1 -0
- package/lib/index-Dz4LyXZI.js +124 -0
- package/lib/index-Dz4LyXZI.js.map +1 -0
- package/lib/index-pI9JkN46.js +4765 -0
- package/lib/index-pI9JkN46.js.map +1 -0
- package/lib/joinPath-B7kNnUX4.js +8 -0
- package/lib/joinPath-B7kNnUX4.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-Bh4upQ0e.js +749 -0
- package/lib/utils-Bh4upQ0e.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 +2084 -701
- package/lib/zudoku.components.js.map +1 -0
- package/lib/zudoku.openapi-worker.js +15042 -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/lib/zudoku.plugin-search-inkeep.js +51 -0
- package/lib/zudoku.plugin-search-inkeep.js.map +1 -0
- package/package.json +71 -28
- package/src/app/App.tsx +0 -44
- package/src/app/demo-cdn.html +26 -0
- package/src/app/demo.html +18 -0
- package/src/app/demo.tsx +59 -0
- package/src/app/entry.client.tsx +47 -0
- package/src/app/entry.server.tsx +160 -0
- package/src/app/main.css +105 -3
- package/src/app/main.tsx +95 -15
- package/src/app/standalone.html +20 -0
- package/src/app/standalone.tsx +58 -0
- package/src/app/tailwind.ts +2 -6
- package/src/lib/authentication/AuthenticationPlugin.tsx +38 -0
- package/src/lib/authentication/authentication.ts +6 -9
- 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 +45 -0
- package/src/lib/components/ClientOnly.tsx +13 -0
- package/src/lib/components/DevPortal.tsx +68 -44
- package/src/lib/components/DeveloperHint.tsx +25 -0
- package/src/lib/components/ErrorPage.tsx +28 -0
- package/src/lib/components/Header.tsx +112 -41
- package/src/lib/components/InlineCode.tsx +19 -0
- package/src/lib/components/Layout.tsx +18 -10
- package/src/lib/components/Markdown.tsx +3 -2
- package/src/lib/components/NotFoundPage.tsx +33 -0
- package/src/lib/components/Search.tsx +60 -0
- package/src/lib/components/SlotletProvider.tsx +30 -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/{DevPortalProvider.ts → ZudokuContext.ts} +19 -15
- 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 +43 -0
- package/src/lib/components/navigation/SidebarCategory.tsx +116 -0
- package/src/lib/components/navigation/SidebarItem.tsx +129 -0
- package/src/lib/components/navigation/SidebarWrapper.tsx +26 -0
- package/src/lib/components/navigation/utils.ts +117 -0
- package/src/lib/core/DevPortalContext.ts +44 -68
- package/src/lib/core/plugins.ts +45 -13
- 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 +46 -16
- package/src/lib/oas/parser/index.ts +41 -22
- 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 +17 -54
- package/src/lib/plugins/markdown/Toc.tsx +53 -40
- package/src/lib/plugins/markdown/generateRoutes.tsx +30 -58
- package/src/lib/plugins/markdown/index.tsx +3 -7
- package/src/lib/plugins/openapi/ColorizedParam.tsx +23 -16
- package/src/lib/plugins/openapi/OperationList.tsx +37 -7
- package/src/lib/plugins/openapi/OperationListItem.tsx +39 -34
- package/src/lib/plugins/openapi/ParameterList.tsx +15 -10
- package/src/lib/plugins/openapi/PlaygroundDialogWrapper.tsx +9 -33
- package/src/lib/plugins/openapi/RequestBodySidecarBox.tsx +3 -1
- package/src/lib/plugins/openapi/ResponsesSidecarBox.tsx +51 -40
- package/src/lib/plugins/openapi/Route.tsx +21 -0
- package/src/lib/plugins/openapi/Sidecar.tsx +101 -44
- package/src/lib/plugins/openapi/SidecarBox.tsx +13 -2
- package/src/lib/plugins/openapi/SimpleSelect.tsx +1 -1
- 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/client/worker.ts +30 -0
- 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 +131 -75
- 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 +121 -84
- package/src/lib/plugins/openapi/playground/PlaygroundDialog.tsx +13 -7
- 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 +13 -15
- package/src/lib/plugins/openapi/schema/SchemaComponents.tsx +126 -0
- package/src/lib/plugins/openapi/schema/SchemaView.tsx +172 -0
- package/src/lib/plugins/openapi/schema/utils.ts +10 -0
- package/src/lib/plugins/openapi-worker.ts +1 -1
- package/src/lib/plugins/redirect/index.tsx +3 -4
- package/src/lib/plugins/search-inkeep/InkeepCustomTrigger.tsx +3 -0
- package/src/lib/plugins/search-inkeep/index.tsx +63 -0
- package/src/lib/plugins/search-inkeep/inkeep.ts +32 -0
- package/src/lib/themeToggle.ts +7 -0
- 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 +15 -23
- 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 +3 -2
- package/src/lib/util/logInit.ts +9 -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 +0 -7
- 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/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/SchemaListView.d.ts +0 -7
- package/dist/lib/plugins/openapi/SchemaListView.js +0 -21
- package/dist/lib/plugins/openapi/SchemaListView.js.map +0 -1
- package/dist/lib/plugins/openapi/SchemaListViewItem.d.ts +0 -7
- package/dist/lib/plugins/openapi/SchemaListViewItem.js +0 -16
- package/dist/lib/plugins/openapi/SchemaListViewItem.js.map +0 -1
- package/dist/lib/plugins/openapi/SchemaListViewItemGroup.d.ts +0 -8
- package/dist/lib/plugins/openapi/SchemaListViewItemGroup.js +0 -17
- package/dist/lib/plugins/openapi/SchemaListViewItemGroup.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-CbtkR-Im.js +0 -8458
- 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 -19918
- 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/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/SideNavigationWrapper.tsx +0 -24
- 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/MethodBadge.tsx +0 -36
- package/src/lib/plugins/openapi/SchemaListView.tsx +0 -61
- package/src/lib/plugins/openapi/SchemaListViewItem.tsx +0 -110
- package/src/lib/plugins/openapi/SchemaListViewItemGroup.tsx +0 -63
- package/src/lib/plugins/openapi/worker/shared-worker.ts +0 -5
- package/src/lib/plugins/openapi/worker/worker.ts +0 -56
- 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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MdxPage.js","sourceRoot":"","sources":["../../../../src/lib/plugins/markdown/MdxPage.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"MdxPage.js","sourceRoot":"","sources":["../../../../src/lib/plugins/markdown/MdxPage.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAEpD,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AACtE,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EACL,cAAc,EACd,WAAW,GACZ,MAAM,sCAAsC,CAAC;AAE9C,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAA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,CAAC,CAAC,CAAC,CACN,MAAC,IAAI,IACH,EAAE,EAAE,IAAI,CAAC,EAAE,EACX,SAAS,EAAC,kJAAkJ,EAC5J,KAAK,EAAE,IAAI,CAAC,KAAK,aAEjB,cAAK,SAAS,EAAC,+BAA+B,iCAExC,EACN,cAAK,SAAS,EAAC,+BAA+B,YAC3C,IAAI,CAAC,KAAK,GACP,IACD,CACR,CAAC,CAAC,CAAC,CACF,cAAK,SAAS,EAAC,QAAQ,GAAG,CAC3B,IACG,IACL,CACJ,IACG,EACN,cAAK,SAAS,EAAC,iBAAiB,YAC7B,OAAO,IAAI,KAAC,GAAG,IAAC,OAAO,EAAE,UAAU,GAAI,GACpC,IACF,CACP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ListTreeIcon } from "lucide-react";
|
|
2
3
|
import { useEffect, useRef, useState, } from "react";
|
|
3
4
|
import { AnchorLink } from "../../components/AnchorLink.js";
|
|
4
5
|
import { useViewportAnchor } from "../../components/context/ViewportAnchorContext.js";
|
|
5
|
-
import { ListTreeIcon } from "../../core/icons.js";
|
|
6
6
|
import { cn } from "../../util/cn.js";
|
|
7
7
|
const DATA_ANCHOR_ATTR = "data-active";
|
|
8
8
|
const TocItem = ({ item, children, className, isActive, }) => {
|
|
@@ -15,26 +15,34 @@ const TocItem = ({ item, children, className, isActive, }) => {
|
|
|
15
15
|
export const Toc = ({ entries }) => {
|
|
16
16
|
const { activeAnchor } = useViewportAnchor();
|
|
17
17
|
const listWrapperRef = useRef(null);
|
|
18
|
-
const
|
|
18
|
+
const paintedOnce = useRef(false);
|
|
19
|
+
const [indicatorStyle, setIndicatorStyles] = useState({
|
|
20
|
+
top: 0,
|
|
21
|
+
opacity: 0,
|
|
22
|
+
});
|
|
19
23
|
// synchronize active anchor indicator with the scroll position
|
|
20
24
|
useEffect(() => {
|
|
21
25
|
if (!listWrapperRef.current)
|
|
22
26
|
return;
|
|
23
27
|
const activeElement = listWrapperRef.current.querySelector(`[${DATA_ANCHOR_ATTR}='${activeAnchor}']`);
|
|
24
28
|
if (!activeElement) {
|
|
25
|
-
setIndicatorStyles({
|
|
26
|
-
"--indicator-top": "0",
|
|
27
|
-
"--indicator-opacity": 0,
|
|
28
|
-
});
|
|
29
|
+
setIndicatorStyles({ top: 0, opacity: 0 });
|
|
29
30
|
return;
|
|
30
31
|
}
|
|
31
32
|
const topParent = listWrapperRef.current.getBoundingClientRect().top;
|
|
32
33
|
const topElement = activeElement.getBoundingClientRect().top;
|
|
33
34
|
setIndicatorStyles({
|
|
34
|
-
|
|
35
|
-
|
|
35
|
+
opacity: 1,
|
|
36
|
+
top: `${topElement - topParent}px`,
|
|
37
|
+
});
|
|
38
|
+
if (paintedOnce.current)
|
|
39
|
+
return;
|
|
40
|
+
// after all is painted, the indicator should animate
|
|
41
|
+
requestIdleCallback(() => {
|
|
42
|
+
paintedOnce.current = true;
|
|
36
43
|
});
|
|
37
44
|
}, [activeAnchor]);
|
|
38
|
-
return (_jsxs("aside", { className: "sticky top-[--header-height] h-[calc(100vh-var(--header-height))] pt-[--padding-content-top] pb-[--padding-content-bottom] overflow-y-auto ps-1 text-sm", children: [_jsxs("div", { className: "flex items-center gap-2 font-medium mb-2", children: [_jsx(ListTreeIcon, { size: 16 }), "On this page"] }),
|
|
45
|
+
return (_jsxs("aside", { className: "sticky top-[--header-height] h-[calc(100vh-var(--header-height))] pt-[--padding-content-top] pb-[--padding-content-bottom] overflow-y-auto ps-1 text-sm", children: [_jsxs("div", { className: "flex items-center gap-2 font-medium mb-2", children: [_jsx(ListTreeIcon, { size: 16 }), "On this page"] }), _jsxs("div", { className: "relative ms-2 ps-4", children: [_jsx("div", { className: "absolute inset-0 right-auto bg-border w-[2px]" }), _jsx("div", { className: cn("absolute -left-px -translate-y-1 h-6 w-[4px] rounded bg-primary", paintedOnce.current &&
|
|
46
|
+
"ease-out [transition:top_150ms,opacity_325ms]"), style: indicatorStyle }), _jsx("ul", { ref: listWrapperRef, className: "relative font-medium list-none space-y-2", children: entries.map((item) => (_jsx(TocItem, { isActive: item.id === activeAnchor, item: item, className: "pl-0", children: item.children && (_jsx("ul", { className: "list-none pl-4 pt-2 space-y-2", children: item.children.map((child) => (_jsx(TocItem, { item: child, isActive: child.id === activeAnchor }, child.id))) })) }, item.id))) })] })] }));
|
|
39
47
|
};
|
|
40
48
|
//# sourceMappingURL=Toc.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toc.js","sourceRoot":"","sources":["../../../../src/lib/plugins/markdown/Toc.tsx"],"names":[],"mappings":";AACA,OAAO,EACL,SAAS,EACT,MAAM,EACN,QAAQ,GAGT,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,mDAAmD,CAAC;AACtF,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"Toc.js","sourceRoot":"","sources":["../../../../src/lib/plugins/markdown/Toc.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EACL,SAAS,EACT,MAAM,EACN,QAAQ,GAGT,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,mDAAmD,CAAC;AACtF,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AAEtC,MAAM,gBAAgB,GAAG,aAAa,CAAC;AAEvC,MAAM,OAAO,GAAG,CAAC,EACf,IAAI,EACJ,QAAQ,EACR,SAAS,EACT,QAAQ,GAKR,EAAE,EAAE;IACJ,OAAO,CACL,cACE,SAAS,EAAE,EAAE,CACX,UAAU,EACV,QAAQ;YACN,CAAC,CAAC,cAAc;YAChB,CAAC,CAAC,4CAA4C,EAChD,S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-
import { type RouteObject } from "
|
|
1
|
+
import { type RouteObject } from "react-router-dom";
|
|
2
2
|
import { MarkdownPluginDefaultOptions, MarkdownPluginOptions } from "./index.js";
|
|
3
3
|
export declare const generateRoutes: (markdownFiles: MarkdownPluginOptions["markdownFiles"], defaultOptions?: MarkdownPluginDefaultOptions) => RouteObject[];
|
|
@@ -1,45 +1,22 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
const { default: Component, ...props } = await importPromise();
|
|
23
|
-
return {
|
|
24
|
-
element: (_jsx(MdxPage, { mdxComponent: Component, ...props, defaultOptions: defaultOptions })),
|
|
25
|
-
};
|
|
26
|
-
},
|
|
27
|
-
};
|
|
28
|
-
});
|
|
29
|
-
const rootRoutes = Array.from(new Set(routes.map((route) => route.path.split("/").at(0)))).map((dir) => ({
|
|
30
|
-
path: `/${dir}`,
|
|
31
|
-
element: _jsx(Redirect, {}),
|
|
32
|
-
}));
|
|
33
|
-
return [...routes, ...rootRoutes];
|
|
34
|
-
};
|
|
35
|
-
const Redirect = () => {
|
|
36
|
-
const navItem = useTopNavigationItem();
|
|
37
|
-
if (!navItem)
|
|
38
|
-
return null;
|
|
39
|
-
return traverseNavigation(navItem, (node, fullPath) => {
|
|
40
|
-
if ("children" in node || !isPathItem(node))
|
|
41
|
-
return;
|
|
42
|
-
return _jsx(Navigate, { to: fullPath, replace: true });
|
|
43
|
-
});
|
|
44
|
-
};
|
|
2
|
+
export const generateRoutes = (markdownFiles, defaultOptions) => Object.entries(markdownFiles).flatMap(([file, importPromise]) => {
|
|
3
|
+
// @todo we can pass in the folder name and then filter the markdown files based on that path
|
|
4
|
+
const match = file.match(/pages\/(.*).mdx?$/);
|
|
5
|
+
const path = match?.at(1);
|
|
6
|
+
if (!path)
|
|
7
|
+
return [];
|
|
8
|
+
const pathSegments = path.split("/");
|
|
9
|
+
const isIndexFile = pathSegments.at(-1) === "index";
|
|
10
|
+
const routePath = isIndexFile ? pathSegments.slice(0, -1).join("/") : path;
|
|
11
|
+
return {
|
|
12
|
+
path: routePath,
|
|
13
|
+
lazy: async () => {
|
|
14
|
+
const { MdxPage } = await import("./MdxPage.js");
|
|
15
|
+
const { default: Component, ...props } = await importPromise();
|
|
16
|
+
return {
|
|
17
|
+
element: (_jsx(MdxPage, { mdxComponent: Component, ...props, defaultOptions: defaultOptions })),
|
|
18
|
+
};
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
});
|
|
45
22
|
//# sourceMappingURL=generateRoutes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateRoutes.js","sourceRoot":"","sources":["../../../../src/lib/plugins/markdown/generateRoutes.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"generateRoutes.js","sourceRoot":"","sources":["../../../../src/lib/plugins/markdown/generateRoutes.tsx"],"names":[],"mappings":";AAOA,MAAM,CAAC,MAAM,cAAc,GAAG,CAC5B,aAAqD,EACrD,cAA6C,EAC9B,EAAE,CACjB,MAAM,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,EAAE,aAAa,CAAC,EAAE,EAAE;IAC9D,6FAA6F;IAC7F,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC;IAC9C,MAAM,IAAI,GAAG,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;IAE1B,IAAI,CAAC,IAAI;QAAE,OAAO,EAAE,CAAC;IAErB,MAAM,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACrC,MAAM,WAAW,GAAG,YAAY,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC;IACpD,MAAM,SAAS,GAAG,WAAW,CAAC,CAAC,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAE3E,OAAO;QACL,IAAI,EAAE,SAAS;QACf,IAAI,EAAE,KAAK,IAAI,EAAE;YACf,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,MAAM,CAAC,cAAc,CAAC,CAAC;YACjD,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,GAAG,MAAM,aAAa,EAAE,CAAC;YAC/D,OAAO;gBACL,OAAO,EAAE,CACP,KAAC,OAAO,IACN,YAAY,EAAE,SAAS,KACnB,KAAK,EACT,cAAc,EAAE,cAAc,GAC9B,CACH;aACF,CAAC;QACJ,CAAC;KACoB,CAAC;AAC1B,CAAC,CAAC,CAAC"}
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import { generateRoutes } from "./generateRoutes.js";
|
|
2
|
-
export const markdownPlugin = ({ markdownFiles, defaultOptions, }) => {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
return generateRoutes(markdownFiles, defaultOptions);
|
|
6
|
-
},
|
|
7
|
-
};
|
|
8
|
-
};
|
|
2
|
+
export const markdownPlugin = ({ markdownFiles, defaultOptions, }) => ({
|
|
3
|
+
getRoutes: () => generateRoutes(markdownFiles, defaultOptions),
|
|
4
|
+
});
|
|
9
5
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/plugins/markdown/index.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAyBrD,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,EAC7B,aAAa,EACb,cAAc,GACQ,EAAmB,EAAE
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/plugins/markdown/index.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAyBrD,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,EAC7B,aAAa,EACb,cAAc,GACQ,EAAmB,EAAE,CAAC,CAAC;IAC7C,SAAS,EAAE,GAAG,EAAE,CAAC,cAAc,CAAC,aAAa,EAAE,cAAc,CAAC;CAC/D,CAAC,CAAC"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { type ReactNode } from "react";
|
|
2
2
|
export declare const DATA_ATTR = "data-linked-param";
|
|
3
3
|
export declare const usePastellizedColor: (name: string) => string;
|
|
4
|
-
export declare const ColorizedParam: ({ name, className, backgroundOpacity, slug, children, onClick, }: {
|
|
4
|
+
export declare const ColorizedParam: ({ name, className, backgroundOpacity, borderOpacity, slug, children, onClick, }: {
|
|
5
5
|
name: string;
|
|
6
6
|
className?: string;
|
|
7
7
|
backgroundOpacity?: string;
|
|
8
|
+
borderOpacity?: string;
|
|
8
9
|
slug?: string;
|
|
9
10
|
children?: ReactNode;
|
|
10
11
|
onClick?: () => void;
|
|
@@ -6,28 +6,33 @@ import { pastellize } from "../../util/pastellize.js";
|
|
|
6
6
|
export const DATA_ATTR = "data-linked-param";
|
|
7
7
|
export const usePastellizedColor = (name) => {
|
|
8
8
|
const [isDark] = useTheme();
|
|
9
|
-
return pastellize(name, !isDark ? { saturation:
|
|
9
|
+
return pastellize(name, !isDark ? { saturation: 85, lightness: 50 } : undefined);
|
|
10
10
|
};
|
|
11
|
-
export const ColorizedParam = ({ name, className, backgroundOpacity = "100%", slug, children, onClick, }) => {
|
|
11
|
+
export const ColorizedParam = ({ name, className, backgroundOpacity = "100%", borderOpacity = "100%", slug, children, onClick, }) => {
|
|
12
12
|
const ref = useRef(null);
|
|
13
|
-
const normalized = name.replace(
|
|
13
|
+
const normalized = name.replace(/[{}]/g, "");
|
|
14
|
+
const normalizedSlug = slug?.replace(/[{}]/g, "");
|
|
14
15
|
const color = usePastellizedColor(normalized);
|
|
15
|
-
const borderColor = `hsl(${color})`;
|
|
16
|
+
const borderColor = `hsl(${color} / ${borderOpacity})`;
|
|
16
17
|
const backgroundColor = `hsl(${color} / ${backgroundOpacity})`;
|
|
17
18
|
useEffect(() => {
|
|
18
|
-
if (!
|
|
19
|
+
if (!normalizedSlug)
|
|
19
20
|
return;
|
|
20
21
|
if (!ref.current)
|
|
21
22
|
return;
|
|
22
23
|
const onMouseEnter = () => {
|
|
23
|
-
document
|
|
24
|
+
document
|
|
25
|
+
.querySelectorAll(`[${DATA_ATTR}="${normalizedSlug}"]`)
|
|
26
|
+
.forEach((el) => {
|
|
24
27
|
if (el instanceof HTMLElement) {
|
|
25
28
|
el.dataset.active = "true";
|
|
26
29
|
}
|
|
27
30
|
});
|
|
28
31
|
};
|
|
29
32
|
const onMouseLeave = () => {
|
|
30
|
-
document
|
|
33
|
+
document
|
|
34
|
+
.querySelectorAll(`[${DATA_ATTR}="${normalizedSlug}"]`)
|
|
35
|
+
.forEach((el) => {
|
|
31
36
|
if (el instanceof HTMLElement) {
|
|
32
37
|
el.dataset.active = "false";
|
|
33
38
|
}
|
|
@@ -39,7 +44,7 @@ export const ColorizedParam = ({ name, className, backgroundOpacity = "100%", sl
|
|
|
39
44
|
ref.current?.removeEventListener("mouseenter", onMouseEnter);
|
|
40
45
|
ref.current?.removeEventListener("mouseleave", onMouseLeave);
|
|
41
46
|
};
|
|
42
|
-
}, [
|
|
43
|
-
return (_jsxs("span", { className: cn("inline-flex relative rounded group", className), [DATA_ATTR]:
|
|
47
|
+
}, [normalizedSlug]);
|
|
48
|
+
return (_jsxs("span", { className: cn("inline-flex relative rounded group", className), [DATA_ATTR]: normalizedSlug, ref: ref, onClick: onClick, children: [_jsx("span", { className: "absolute inset-0 border-b-2 transition-opacity duration-200 opacity-30 group-data-[active=true]:opacity-100", style: { borderColor, backgroundColor } }), _jsx("span", { className: "relative", children: children ?? name })] }));
|
|
44
49
|
};
|
|
45
50
|
//# sourceMappingURL=ColorizedParam.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColorizedParam.js","sourceRoot":"","sources":["../../../../src/lib/plugins/openapi/ColorizedParam.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAkB,MAAM,OAAO,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,0CAA0C,CAAC;AACpE,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAEtD,MAAM,CAAC,MAAM,SAAS,GAAG,mBAAmB,CAAC;AAE7C,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,IAAY,EAAE,EAAE;IAClD,MAAM,CAAC,MAAM,CAAC,GAAG,QAAQ,EAAE,CAAC;IAC5B,OAAO,UAAU,CACf,IAAI,EACJ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"ColorizedParam.js","sourceRoot":"","sources":["../../../../src/lib/plugins/openapi/ColorizedParam.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAkB,MAAM,OAAO,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,0CAA0C,CAAC;AACpE,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAEtD,MAAM,CAAC,MAAM,SAAS,GAAG,mBAAmB,CAAC;AAE7C,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,IAAY,EAAE,EAAE;IAClD,MAAM,CAAC,MAAM,CAAC,GAAG,QAAQ,EAAE,CAAC;IAC5B,OAAO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cAAc,IAAI,CAAC;iBACtD,OAAO,CAAC,CAAC,EAAE,EAAE,EAAE;gBACd,IAAI,EAAE,YAAY,WAAW,EAAE,CAAC;oBAC9B,EAAE,CAAC,OAAO,CAAC,MAAM,GAAG,OAAO,CAAC;gBAC9B,CAAC;YACH,CAAC,CAAC,CAAC;QACP,CAAC,CAAC;QAEF,GAAG,CAAC,OAAO,CAAC,gBAAgB,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC;QACzD,GAAG,CAAC,OAAO,CAAC,gBAAgB,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC;QAEzD,OAAO,GAAG,EAAE;YACV,GAAG,CAAC,OAAO,EAAE,mBAAmB,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC;YAC7D,GAAG,CAAC,OAAO,EAAE,mBAAmB,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC;QAC/D,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC;IAErB,OAAO,CACL,gBACE,SAAS,EAAE,EAAE,CAAC,oCAAoC,EAAE,SAAS,CAAC,EACxD,CAAC,SAAS,CAAC,EAAE,cAAc,EACjC,GAAG,EAAE,GAAG,EACR,OAAO,EAAE,OAAO,aAEhB,eACE,SAAS,EAAC,6GAA6G,EACvH,KAAK,EAAE,EAAE,WAAW,EAAE,eAAe,EAAE,GACvC,EACF,eAAM,SAAS,EAAC,UAAU,YAAE,QAAQ,IAAI,IAAI,GAAQ,IAC/C,CACR,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,11 +1,16 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { CategoryHeading } from "../../components/CategoryHeading.js";
|
|
3
|
+
import { DeveloperHint } from "../../components/DeveloperHint.js";
|
|
4
|
+
import { ErrorPage } from "../../components/ErrorPage.js";
|
|
3
5
|
import { Heading } from "../../components/Heading.js";
|
|
6
|
+
import { InlineCode } from "../../components/InlineCode.js";
|
|
4
7
|
import { Markdown } from "../../components/Markdown.js";
|
|
8
|
+
import { SyntaxHighlight } from "../../components/SyntaxHighlight.js";
|
|
5
9
|
import { cn } from "../../util/cn.js";
|
|
6
10
|
import { OperationListItem } from "./OperationListItem.js";
|
|
11
|
+
import StaggeredRender from "./StaggeredRender.js";
|
|
12
|
+
import { useOasConfig } from "./context.js";
|
|
7
13
|
import { graphql } from "./graphql/index.js";
|
|
8
|
-
import { useOasConfig } from "./index.js";
|
|
9
14
|
import { SchemaProseClasses } from "./util/prose.js";
|
|
10
15
|
import { useQuery } from "./util/urql.js";
|
|
11
16
|
export const OperationsFragment = graphql(/* GraphQL */ `
|
|
@@ -83,10 +88,16 @@ export const OperationList = () => {
|
|
|
83
88
|
variables: { type, input },
|
|
84
89
|
context: suspenseContext,
|
|
85
90
|
});
|
|
91
|
+
const error = result.error?.graphQLErrors.at(0);
|
|
92
|
+
// Looks like there is no Suspense level error handling (yet)?
|
|
93
|
+
// So we handle the error case in the component directly
|
|
94
|
+
if (error) {
|
|
95
|
+
return (_jsx(ErrorPage, { category: "Error", title: "Schema cannot be displayed", message: _jsxs(_Fragment, { children: [_jsxs(DeveloperHint, { className: "mb-4", children: ["Check your configuration value ", _jsx(InlineCode, { children: "apis.type" }), " ", "and ", _jsx(InlineCode, { children: "apis.input" }), " in the Zudoku config."] }), "An error occurred while trying to fetch the API reference:", _jsx(SyntaxHighlight, { code: error.toString(), language: "plain" })] }) }));
|
|
96
|
+
}
|
|
86
97
|
if (!result.data)
|
|
87
98
|
return null;
|
|
88
99
|
return (_jsxs("div", { className: "pt-[--padding-content-top]", children: [_jsxs("div", { className: cn(SchemaProseClasses, "mb-16 max-w-full prose-img:max-w-prose"), children: [_jsx(CategoryHeading, { children: "Overview" }), _jsx(Heading, { level: 1, id: "description", registerSidebarAnchor: true, children: result.data.schema.title }), _jsx(Markdown, { content: result.data.schema.description ?? "" })] }), result.data.schema.tags
|
|
89
100
|
.filter((tag) => tag.operations.length > 0)
|
|
90
|
-
.map((tag) => (_jsxs("div", { children: [tag.name && _jsx(CategoryHeading, { children: tag.name }), tag.description && (_jsx(Markdown, { className: `${SchemaProseClasses} mt-2 mb-12`, content: tag.description })), _jsx("div", { className: "operation mb-12", children: tag.operations.map((fragment) => (_jsx(OperationListItem, { operationFragment: fragment }, fragment.slug))) })] }, tag.name)))] }));
|
|
101
|
+
.map((tag) => (_jsxs("div", { children: [tag.name && _jsx(CategoryHeading, { children: tag.name }), tag.description && (_jsx(Markdown, { className: `${SchemaProseClasses} mt-2 mb-12`, content: tag.description })), _jsx("div", { className: "operation mb-12", children: _jsx(StaggeredRender, { children: tag.operations.map((fragment) => (_jsx(OperationListItem, { operationFragment: fragment }, fragment.slug))) }) })] }, tag.name)))] }));
|
|
91
102
|
};
|
|
92
103
|
//# sourceMappingURL=OperationList.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OperationList.js","sourceRoot":"","sources":["../../../../src/lib/plugins/openapi/OperationList.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AACtE,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACxD,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,
|
|
1
|
+
{"version":3,"file":"OperationList.js","sourceRoot":"","sources":["../../../../src/lib/plugins/openapi/OperationList.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAClE,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC1D,OAAO,EA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EAAC,iBAAiB,YAC9B,KAAC,eAAe,cACb,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAChC,KAAC,iBAAiB,IAEhB,iBAAiB,EAAE,QAAQ,IADtB,QAAQ,CAAC,IAAI,CAElB,CACH,CAAC,GACc,GACd,KAjBE,GAAG,CAAC,IAAI,CAkBZ,CACP,CAAC,IACA,CACP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from "react";
|
|
2
3
|
import { Heading } from "../../components/Heading.js";
|
|
3
4
|
import { Markdown } from "../../components/Markdown.js";
|
|
4
5
|
import { Tabs, TabsContent, TabsList, TabsTrigger } from "../../ui/Tabs.js";
|
|
6
|
+
import { groupBy } from "../../util/groupBy.js";
|
|
5
7
|
import { renderIf } from "../../util/renderIf.js";
|
|
6
8
|
import { OperationsFragment } from "./OperationList.js";
|
|
7
9
|
import { ParameterList } from "./ParameterList.js";
|
|
8
|
-
import { SchemaListView } from "./SchemaListView.js";
|
|
9
10
|
import { Sidecar } from "./Sidecar.js";
|
|
10
11
|
import { useFragment } from "./graphql/index.js";
|
|
12
|
+
import { SchemaView } from "./schema/SchemaView.js";
|
|
11
13
|
import { SchemaProseClasses } from "./util/prose.js";
|
|
12
14
|
export const PARAM_GROUPS = ["path", "query", "header", "cookie"];
|
|
13
15
|
export const OperationListItem = ({ operationFragment, }) => {
|
|
14
16
|
const operation = useFragment(OperationsFragment, operationFragment);
|
|
15
|
-
const groupedParameters =
|
|
17
|
+
const groupedParameters = groupBy(operation.parameters ?? [], (param) => param.in);
|
|
16
18
|
const first = operation.responses.at(0);
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
const [selectedResponse, setSelectedResponse] = useState(first?.statusCode);
|
|
20
|
+
return (_jsxs("div", { className: "grid grid-cols-1 lg:grid-cols-[4fr_3fr] gap-8 items-start border-b-2 mb-16 pb-16", children: [_jsxs("div", { className: "flex flex-col gap-4", children: [_jsx(Heading, { level: 2, id: operation.slug, registerSidebarAnchor: true, children: operation.summary }), operation.description && (_jsx(Markdown, { className: SchemaProseClasses, content: operation.description })), operation.parameters && operation.parameters.length > 0 && (_jsx(_Fragment, { children: PARAM_GROUPS.flatMap((group) => groupedParameters[group]?.length ? (_jsx(ParameterList, { id: operation.slug, parameters: groupedParameters[group], group: group }, group)) : ([])) })), renderIf(operation.requestBody?.content?.at(0)?.schema, (schema) => (_jsxs("div", { className: "mt-4 flex flex-col gap-4", children: [_jsx(Heading, { level: 3, className: "capitalize", children: "Request Body" }), _jsx(SchemaView, { schema: schema })] }))), operation.responses.length > 0 && (_jsxs(_Fragment, { children: [_jsx(Heading, { level: 3, className: "capitalize mt-8 pt-8 border-t", children: "Responses" }), _jsxs(Tabs, { onValueChange: (value) => setSelectedResponse(value), value: selectedResponse, children: [operation.responses.length > 1 && (_jsx(TabsList, { children: operation.responses.map((response) => (_jsx(TabsTrigger, { value: response.statusCode, title: response.description, children: response.statusCode }, response.statusCode))) })), _jsx("ul", { className: "list-none m-0 px-0 overflow-hidden", children: operation.responses.map((response) => (_jsx(TabsContent, { value: response.statusCode, children: _jsx(SchemaView, { schema: response.content?.find((content) => content.schema)
|
|
21
|
+
?.schema }) }, response.statusCode))) })] })] }))] }), _jsx(Sidecar, { selectedResponse: selectedResponse, onSelectResponse: setSelectedResponse, operation: operation })] }, operation.operationId));
|
|
20
22
|
};
|
|
21
23
|
//# sourceMappingURL=OperationListItem.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OperationListItem.js","sourceRoot":"","sources":["../../../../src/lib/plugins/openapi/OperationListItem.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACxD,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import { Card } from "../../ui/Card.js";
|
|
3
4
|
import { ParameterListItem, } from "./ParameterListItem.js";
|
|
4
|
-
export const ParameterList = ({ group, parameters, id, }) => (_jsxs(_Fragment, { children: [_jsx(Heading, { level: 3, id: `${id}/${group}-parameters`, className: "capitalize", children: group === "header" ? "Headers" : `${group} Parameters` }), _jsx("ul", { className: "list-none m-0 px-0
|
|
5
|
+
export const ParameterList = ({ group, parameters, id, }) => (_jsxs(_Fragment, { children: [_jsx(Heading, { level: 3, id: `${id}/${group}-parameters`, className: "capitalize", children: group === "header" ? "Headers" : `${group} Parameters` }), _jsx(Card, { children: _jsx("ul", { className: "list-none m-0 px-0 divide-y ", children: parameters
|
|
6
|
+
.sort((a, b) => (a.required === b.required ? 0 : a.required ? -1 : 1))
|
|
7
|
+
.map((parameter) => (_jsx(ParameterListItem, { parameter: parameter, id: id, group: group }, `${parameter.name}-${parameter.in}`))) }) })] }));
|
|
5
8
|
//# sourceMappingURL=ParameterList.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ParameterList.js","sourceRoot":"","sources":["../../../../src/lib/plugins/openapi/ParameterList.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"ParameterList.js","sourceRoot":"","sources":["../../../../src/lib/plugins/openapi/ParameterList.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAExC,OAAO,EACL,iBAAiB,GAElB,MAAM,wBAAwB,CAAC;AAEhC,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,EAC5B,KAAK,EACL,UAAU,EACV,EAAE,GAKH,EAAE,EAAE,CAAC,CACJ,8BACE,KAAC,OAAO,IAAC,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE,IAAI,KAAK,aAAa,EAAE,SAAS,EAAC,YAAY,YACvE,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,KAAK,aAAa,GAC/C,EACV,KAAC,IAAI,cACH,aAAI,SAAS,EAAC,8BAA8B,YACzC,UAAU;qBACR,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,KAAK,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;qBACrE,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,CAClB,KAAC,iBAAiB,IAEhB,SAAS,EAAE,SAAS,EACpB,EAAE,EAAE,EAAE,EACN,KAAK,EAAE,KAAK,IAHP,GAAG,SAAS,CAAC,IAAI,IAAI,SAAS,CAAC,EAAE,EAAE,CAIxC,CACH,CAAC,GACD,GACA,IACN,CACJ,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { OperationListItemResult } from "./OperationList.js";
|
|
2
|
-
export declare const PlaygroundDialogWrapper: ({ operation, }: {
|
|
2
|
+
export declare const PlaygroundDialogWrapper: ({ server, operation, }: {
|
|
3
|
+
server: string;
|
|
3
4
|
operation: OperationListItemResult;
|
|
4
5
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,43 +1,23 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { graphql } from "./graphql/index.js";
|
|
3
|
-
import { useOasConfig } from "./index.js";
|
|
4
2
|
import { PlaygroundDialog } from "./playground/PlaygroundDialog.js";
|
|
5
|
-
|
|
6
|
-
const GetServerQuery = graphql(/* GraphQL */ `
|
|
7
|
-
query getServerQuery($input: JSON!, $type: SchemaType!) {
|
|
8
|
-
schema(input: $input, type: $type) {
|
|
9
|
-
url
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
`);
|
|
13
|
-
export const PlaygroundDialogWrapper = ({ operation, }) => {
|
|
14
|
-
const variables = useOasConfig();
|
|
15
|
-
const [server] = useQuery({ query: GetServerQuery, variables });
|
|
3
|
+
export const PlaygroundDialogWrapper = ({ server, operation, }) => {
|
|
16
4
|
const headers = operation.parameters
|
|
17
5
|
?.filter((p) => p.in === "header")
|
|
18
6
|
.map((p) => ({
|
|
19
7
|
name: p.name,
|
|
20
|
-
|
|
8
|
+
defaultValue: p.examples?.find((x) => x.value)?.value ?? "",
|
|
21
9
|
}));
|
|
22
10
|
const queryParams = operation.parameters
|
|
23
11
|
?.filter((p) => p.in === "query")
|
|
24
12
|
.sort((a, b) => (a.required && !b.required ? -1 : 1))
|
|
25
|
-
.map((p) => {
|
|
26
|
-
return {
|
|
27
|
-
name: p.name,
|
|
28
|
-
value: "",
|
|
29
|
-
active: p.required ?? false,
|
|
30
|
-
isRequired: p.required ?? false,
|
|
31
|
-
};
|
|
32
|
-
});
|
|
33
|
-
const pathParams = operation.parameters
|
|
34
|
-
?.filter((p) => p.in === "path")
|
|
35
13
|
.map((p) => ({
|
|
36
14
|
name: p.name,
|
|
37
|
-
|
|
15
|
+
defaultActive: p.required ?? false,
|
|
16
|
+
isRequired: p.required ?? false,
|
|
38
17
|
}));
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
|
|
18
|
+
const pathParams = operation.parameters
|
|
19
|
+
?.filter((p) => p.in === "path")
|
|
20
|
+
.map((p) => ({ name: p.name }));
|
|
21
|
+
return (_jsx(PlaygroundDialog, { server: server, method: operation.method, url: operation.path, headers: headers, queryParams: queryParams, pathParams: pathParams }));
|
|
42
22
|
};
|
|
43
23
|
//# sourceMappingURL=PlaygroundDialogWrapper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlaygroundDialogWrapper.js","sourceRoot":"","sources":["../../../../src/lib/plugins/openapi/PlaygroundDialogWrapper.tsx"],"names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AAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,MAAM,CAAC;SAC/B,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;IAElC,OAAO,CACL,KAAC,gBAAgB,IACf,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,SAAS,CAAC,MAAM,EACxB,GAAG,EAAE,SAAS,CAAC,IAAI,EACnB,OAAO,EAAE,OAAO,EAChB,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,UAAU,GACtB,CACH,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -6,6 +6,8 @@ import { generateSchemaExample } from "./util/generateSchemaExample.js";
|
|
|
6
6
|
export const RequestBodySidecarBox = ({ content }) => {
|
|
7
7
|
if (!content.length)
|
|
8
8
|
return null;
|
|
9
|
-
return (_jsx(_Fragment, { children: _jsxs(SidecarBox.Root, { children: [_jsx(SidecarBox.Head, { className: "text-xs flex justify-between items-center", children: _jsx("span", { className: "font-mono", children: "Request Body Example" }) }), _jsx(SidecarBox.Body, { children: _jsx(SyntaxHighlight, { language: "json", noBackground: true, copyable: true, className: "text-xs", code: JSON.stringify(
|
|
9
|
+
return (_jsx(_Fragment, { children: _jsxs(SidecarBox.Root, { children: [_jsx(SidecarBox.Head, { className: "text-xs flex justify-between items-center", children: _jsx("span", { className: "font-mono", children: "Request Body Example" }) }), _jsx(SidecarBox.Body, { children: _jsx(SyntaxHighlight, { language: "json", noBackground: true, copyable: true, className: "text-xs", code: JSON.stringify(content.at(0)?.schema
|
|
10
|
+
? generateSchemaExample(content[0].schema)
|
|
11
|
+
: "", null, 2) }) })] }) }));
|
|
10
12
|
};
|
|
11
13
|
//# sourceMappingURL=RequestBodySidecarBox.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequestBodySidecarBox.js","sourceRoot":"","sources":["../../../../src/lib/plugins/openapi/RequestBodySidecarBox.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAGtE,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAMxE,iDAAiD;AACjD,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,EAAE,OAAO,EAAwB,EAAE,EAAE;IACzE,IAAI,CAAC,OAAO,CAAC,MAAM;QAAE,OAAO,IAAI,CAAC;IAEjC,OAAO,CACL,4BACE,MAAC,UAAU,CAAC,IAAI,eACd,KAAC,UAAU,CAAC,IAAI,IAAC,SAAS,EAAC,2CAA2C,YACpE,eAAM,SAAS,EAAC,WAAW,qCAA4B,GACvC,EAClB,KAAC,UAAU,CAAC,IAAI,cACd,KAAC,eAAe,IACd,QAAQ,EAAC,MAAM,EACf,YAAY,QACZ,QAAQ,QACR,SAAS,EAAC,SAAS,EACnB,IAAI,EAAE,IAAI,CAAC,SAAS,CAClB,qBAAqB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,MAAsB,CAAC,
|
|
1
|
+
{"version":3,"file":"RequestBodySidecarBox.js","sourceRoot":"","sources":["../../../../src/lib/plugins/openapi/RequestBodySidecarBox.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAGtE,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAMxE,iDAAiD;AACjD,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,EAAE,OAAO,EAAwB,EAAE,EAAE;IACzE,IAAI,CAAC,OAAO,CAAC,MAAM;QAAE,OAAO,IAAI,CAAC;IAEjC,OAAO,CACL,4BACE,MAAC,UAAU,CAAC,IAAI,eACd,KAAC,UAAU,CAAC,IAAI,IAAC,SAAS,EAAC,2CAA2C,YACpE,eAAM,SAAS,EAAC,WAAW,qCAA4B,GACvC,EAClB,KAAC,UAAU,CAAC,IAAI,cACd,KAAC,eAAe,IACd,QAAQ,EAAC,MAAM,EACf,YAAY,QACZ,QAAQ,QACR,SAAS,EAAC,SAAS,EACnB,IAAI,EAAE,IAAI,CAAC,SAAS,CAClB,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM;4BACnB,CAAC,CAAC,qBAAqB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,MAAsB,CAAC;4BAC1D,CAAC,CAAC,EAAE,EACN,IAAI,EACJ,CAAC,CACF,GACD,GACc,IACF,GACjB,CACJ,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { OperationListItemResult } from "./OperationList.js";
|
|
2
2
|
type Responses = OperationListItemResult["responses"];
|
|
3
|
-
export declare const ResponsesSidecarBox: ({ responses, }: {
|
|
3
|
+
export declare const ResponsesSidecarBox: ({ responses, selectedResponse, onSelectResponse, }: {
|
|
4
4
|
responses: Responses;
|
|
5
|
+
selectedResponse?: string;
|
|
6
|
+
onSelectResponse: (response: string) => void;
|
|
5
7
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
6
8
|
export {};
|
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import * as Tabs from "@radix-ui/react-tabs";
|
|
3
3
|
import { SyntaxHighlight } from "../../components/SyntaxHighlight.js";
|
|
4
4
|
import { cn } from "../../util/cn.js";
|
|
5
5
|
import * as SidecarBox from "./SidecarBox.js";
|
|
6
6
|
import { generateSchemaExample } from "./util/generateSchemaExample.js";
|
|
7
|
-
export const ResponsesSidecarBox = ({ responses, }) => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
return (_jsxs(SidecarBox.Root, { children: [_jsxs(SidecarBox.Head, { className: "text-xs grid grid-rows-2 pb-0", children: [_jsx("span", { className: "font-mono", children: "Example Responses" }), _jsx("div", { className: "flex gap-2", children: responses.map((response, index) => (_jsx("div", { onClick: () => setTabIndex(index), className: cn("text-xs font-mono px-1.5 py-1 pb-px translate-y-px border-b-2 border-transparent rounded-t cursor-pointer", tabIndex === index
|
|
12
|
-
? "text-primary dark:text-inherit border-primary"
|
|
13
|
-
: "hover:border-accent-foreground/25"), children: response.statusCode }, response.statusCode))) })] }), _jsxs(SidecarBox.Body, { children: [schema ? (_jsx(SyntaxHighlight, { language: "json", noBackground: true, className: "text-xs", code: JSON.stringify(generateSchemaExample(schema), null, 2) })) : (_jsx("span", { className: "text-muted-foreground font-mono italic text-xs", children: "Empty Response" })), _jsx("hr", { className: "border-border my-1" }), _jsx("div", { className: "text-xs text-muted-foreground", children: responses[tabIndex].description })] })] }));
|
|
14
|
-
};
|
|
7
|
+
export const ResponsesSidecarBox = ({ responses, selectedResponse, onSelectResponse, }) => (_jsx(SidecarBox.Root, { children: _jsxs(Tabs.Root, { defaultValue: responses[0]?.statusCode, value: selectedResponse, onValueChange: (value) => onSelectResponse(value), children: [_jsxs(SidecarBox.Head, { className: "text-xs flex flex-col gap-2 pb-0", children: [_jsx("span", { className: "font-mono", children: "Example Responses" }), _jsx(Tabs.List, { className: "flex gap-2", children: responses.map((response) => (_jsx(Tabs.Trigger, { value: response.statusCode, className: cn("text-xs font-mono px-1.5 py-1 pb-px translate-y-px border-b-2 border-transparent rounded-t cursor-pointer", "data-[state=active]:text-primary data-[state=active]:dark:text-inherit data-[state=active]:border-primary", "hover:border-accent-foreground/25"), children: response.statusCode }, response.statusCode))) })] }), responses.map((response) => {
|
|
8
|
+
const schema = response.content?.[0]?.schema;
|
|
9
|
+
return (_jsxs(Tabs.Content, { value: response.statusCode, children: [_jsx(SidecarBox.Body, { children: schema ? (_jsx(SyntaxHighlight, { language: "json", noBackground: true, className: "text-xs", code: JSON.stringify(generateSchemaExample(schema), null, 2) })) : (_jsx("span", { className: "text-muted-foreground font-mono italic text-xs", children: "Empty Response" })) }), _jsx(SidecarBox.Footer, { className: "flex justify-end text-xs", children: response.description })] }, response.statusCode));
|
|
10
|
+
})] }) }));
|
|
15
11
|
//# sourceMappingURL=ResponsesSidecarBox.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResponsesSidecarBox.js","sourceRoot":"","sources":["../../../../src/lib/plugins/openapi/ResponsesSidecarBox.tsx"],"names":[],"mappings":";AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"ResponsesSidecarBox.js","sourceRoot":"","sources":["../../../../src/lib/plugins/openapi/ResponsesSidecarBox.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,IAAI,MAAM,sBAAsB,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAEtE,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AAEtC,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAGxE,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,EAClC,SAAS,EACT,gBAAgB,EAChB,gBAAgB,GAKjB,EAAE,EAAE,CAAC,CACJ,KAAC,UAAU,CAAC,IAAI,cACd,MAAC,IAAI,CAAC,IAAI,IACR,YAAY,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,UAAU,EACtC,KAAK,EAAE,gBAAgB,EACvB,aAAa,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,gBAAgB,CAAC,KAAK,CAAC,aAEjD,MAAC,UAAU,CAAC,IAAI,IAAC,SAAS,EAAC,kCAAkC,aAC3D,eAAM,SAAS,EAAC,WAAW,kCAAyB,EACpD,KAAC,IAAI,CAAC,IAAI,IAAC,SAAS,EAAC,YAAY,YAC9B,SAAS,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAC3B,KAAC,IAAI,CAAC,OAAO,IAEX,KAAK,EAAE,QAAQ,CAAC,UAAU,EAC1B,SAAS,EAAE,EAAE,CACX,2GAA2G,EAC3G,2GAA2G,EAC3G,mCAAmC,CACpC,YAEA,QAAQ,CAAC,UAAU,IARf,QAAQ,CAAC,UAAU,CASX,CAChB,CAAC,GACQ,IACI,EACjB,SAAS,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE;gBAC1B,MAAM,MAAM,GAAG,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,MAEzB,CAAC;gBAEd,OAAO,CACL,MAAC,IAAI,CAAC,OAAO,IAA2B,KAAK,EAAE,QAAQ,CAAC,UAAU,aAChE,KAAC,UAAU,CAAC,IAAI,cACb,MAAM,CAAC,CAAC,CAAC,CACR,KAAC,eAAe,IACd,QAAQ,EAAC,MAAM,EACf,YAAY,QACZ,SAAS,EAAC,SAAS,EACnB,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,qBAAqB,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,GAC5D,CACH,CAAC,CAAC,CAAC,CACF,eAAM,SAAS,EAAC,gDAAgD,+BAEzD,CACR,GACe,EAClB,KAAC,UAAU,CAAC,MAAM,IAAC,SAAS,EAAC,0BAA0B,YACpD,QAAQ,CAAC,WAAW,GACH,KAjBH,QAAQ,CAAC,UAAU,CAkBvB,CAChB,CAAC;YACJ,CAAC,CAAC,IACQ,GACI,CACnB,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { OasPluginConfig } from "./interfaces.js";
|
|
2
|
+
import { Client as UrqlClient } from "./util/urql.js";
|
|
3
|
+
export declare function OpenApiRoute({ config, client, }: {
|
|
4
|
+
config: OasPluginConfig;
|
|
5
|
+
client: typeof UrqlClient;
|
|
6
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Outlet } from "react-router-dom";
|
|
3
|
+
import { OasConfigProvider } from "./context.js";
|
|
4
|
+
import { Provider } from "./util/urql.js";
|
|
5
|
+
export function OpenApiRoute({ config, client, }) {
|
|
6
|
+
return (_jsx(Provider, { value: client, children: _jsx(OasConfigProvider, { value: { config }, children: _jsx(Outlet, {}) }) }));
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=Route.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Route.js","sourceRoot":"","sources":["../../../../src/lib/plugins/openapi/Route.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAGjD,OAAO,EAAE,QAAQ,EAAwB,MAAM,gBAAgB,CAAC;AAEhE,MAAM,UAAU,YAAY,CAAC,EAC3B,MAAM,EACN,MAAM,GAIP;IACC,OAAO,CACL,KAAC,QAAQ,IAAC,KAAK,EAAE,MAAM,YACrB,KAAC,iBAAiB,IAAC,KAAK,EAAE,EAAE,MAAM,EAAE,YAClC,KAAC,MAAM,KAAG,GACQ,GACX,CACZ,CAAC;AACJ,CAAC"}
|