zudoku 0.0.0-e614aaa → 0.0.0-e6d1d34
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/README.md +1 -1
- package/dist/app/entry.server.d.ts +8 -6
- package/dist/app/entry.server.js +12 -8
- package/dist/app/entry.server.js.map +1 -1
- package/dist/app/main.js +2 -0
- package/dist/app/main.js.map +1 -1
- package/dist/app/tailwind.js +14 -0
- package/dist/app/tailwind.js.map +1 -1
- package/dist/cli/build/handler.js +2 -1
- package/dist/cli/build/handler.js.map +1 -1
- package/dist/cli/cmds/dev.d.ts +1 -1
- package/dist/cli/cmds/dev.js.map +1 -1
- package/dist/cli/dev/handler.js +2 -1
- package/dist/cli/dev/handler.js.map +1 -1
- package/dist/cli/preview/handler.js +13 -15
- package/dist/cli/preview/handler.js.map +1 -1
- package/dist/config/common.d.ts +0 -1
- package/dist/config/config.d.ts +13 -8
- package/dist/config/loader.d.ts +2 -2
- package/dist/config/loader.js +14 -25
- package/dist/config/loader.js.map +1 -1
- package/dist/config/validators/common.d.ts +2773 -597
- package/dist/config/validators/common.js +81 -4
- package/dist/config/validators/common.js.map +1 -1
- package/dist/config/validators/validate.d.ts +1013 -257
- package/dist/lib/authentication/authentication.d.ts +1 -0
- package/dist/lib/authentication/hook.d.ts +1 -0
- package/dist/lib/authentication/hook.js +11 -1
- package/dist/lib/authentication/hook.js.map +1 -1
- package/dist/lib/authentication/providers/clerk.d.ts +2 -2
- package/dist/lib/authentication/providers/clerk.js +19 -0
- package/dist/lib/authentication/providers/clerk.js.map +1 -1
- package/dist/lib/authentication/providers/openid.d.ts +1 -0
- package/dist/lib/authentication/providers/openid.js +20 -8
- package/dist/lib/authentication/providers/openid.js.map +1 -1
- package/dist/lib/authentication/providers/supabase.d.ts +4 -0
- package/dist/lib/authentication/providers/supabase.js +117 -0
- package/dist/lib/authentication/providers/supabase.js.map +1 -0
- package/dist/lib/authentication/state.d.ts +0 -26
- package/dist/lib/authentication/state.js +1 -16
- package/dist/lib/authentication/state.js.map +1 -1
- package/dist/lib/components/AnchorLink.d.ts +2 -2
- package/dist/lib/components/AnchorLink.js +5 -4
- package/dist/lib/components/AnchorLink.js.map +1 -1
- package/dist/lib/components/Bootstrap.d.ts +2 -1
- package/dist/lib/components/Bootstrap.js +3 -2
- package/dist/lib/components/Bootstrap.js.map +1 -1
- package/dist/lib/components/Footer.d.ts +1 -0
- package/dist/lib/components/Footer.js +32 -0
- package/dist/lib/components/Footer.js.map +1 -0
- package/dist/lib/components/Header.js +4 -4
- 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 +2 -1
- package/dist/lib/components/InlineCode.js +2 -9
- package/dist/lib/components/InlineCode.js.map +1 -1
- package/dist/lib/components/Layout.js +8 -29
- package/dist/lib/components/Layout.js.map +1 -1
- package/dist/lib/components/Main.d.ts +2 -0
- package/dist/lib/components/Main.js +17 -0
- package/dist/lib/components/Main.js.map +1 -0
- package/dist/lib/components/MobileTopNavigation.js +6 -3
- package/dist/lib/components/MobileTopNavigation.js.map +1 -1
- package/dist/lib/components/Pagination.d.ts +11 -0
- package/dist/lib/components/Pagination.js +10 -0
- package/dist/lib/components/Pagination.js.map +1 -0
- package/dist/lib/components/TopNavigation.d.ts +3 -2
- package/dist/lib/components/TopNavigation.js +26 -13
- package/dist/lib/components/TopNavigation.js.map +1 -1
- package/dist/lib/components/Zudoku.js +9 -3
- package/dist/lib/components/Zudoku.js.map +1 -1
- package/dist/lib/components/cache.d.ts +7 -0
- package/dist/lib/components/cache.js +7 -0
- package/dist/lib/components/cache.js.map +1 -1
- package/dist/lib/components/context/BypassProtectedRoutesContext.d.ts +1 -0
- package/dist/lib/components/context/BypassProtectedRoutesContext.js +3 -0
- package/dist/lib/components/context/BypassProtectedRoutesContext.js.map +1 -0
- package/dist/lib/components/context/ViewportAnchorContext.d.ts +2 -4
- package/dist/lib/components/context/ViewportAnchorContext.js +5 -10
- package/dist/lib/components/context/ViewportAnchorContext.js.map +1 -1
- package/dist/lib/components/context/ZudokuContext.d.ts +2 -2
- package/dist/lib/components/context/ZudokuContext.js +13 -7
- package/dist/lib/components/context/ZudokuContext.js.map +1 -1
- package/dist/lib/components/index.d.ts +5 -2
- package/dist/lib/components/navigation/PoweredByZudoku.d.ts +3 -0
- package/dist/lib/components/navigation/PoweredByZudoku.js +6 -0
- package/dist/lib/components/navigation/PoweredByZudoku.js.map +1 -0
- package/dist/lib/components/navigation/Sidebar.d.ts +3 -1
- package/dist/lib/components/navigation/Sidebar.js +1 -12
- package/dist/lib/components/navigation/Sidebar.js.map +1 -1
- package/dist/lib/components/navigation/SidebarCategory.d.ts +2 -2
- package/dist/lib/components/navigation/SidebarCategory.js +10 -6
- package/dist/lib/components/navigation/SidebarCategory.js.map +1 -1
- package/dist/lib/components/navigation/SidebarItem.d.ts +1 -0
- package/dist/lib/components/navigation/SidebarItem.js +17 -11
- package/dist/lib/components/navigation/SidebarItem.js.map +1 -1
- package/dist/lib/components/navigation/SidebarWrapper.d.ts +7 -6
- package/dist/lib/components/navigation/SidebarWrapper.js +18 -3
- package/dist/lib/components/navigation/SidebarWrapper.js.map +1 -1
- package/dist/lib/{plugins/markdown → components/navigation}/Toc.js +5 -7
- package/dist/lib/components/navigation/Toc.js.map +1 -0
- package/dist/lib/components/navigation/ZudokuLogo.d.ts +6 -0
- package/dist/lib/components/navigation/ZudokuLogo.js +5 -0
- package/dist/lib/components/navigation/ZudokuLogo.js.map +1 -0
- package/dist/lib/core/RouteGuard.d.ts +1 -0
- package/dist/lib/core/RouteGuard.js +10 -3
- package/dist/lib/core/RouteGuard.js.map +1 -1
- package/dist/lib/core/ZudokuContext.d.ts +23 -7
- package/dist/lib/core/ZudokuContext.js +12 -5
- package/dist/lib/core/ZudokuContext.js.map +1 -1
- package/dist/lib/core/plugins.d.ts +9 -7
- package/dist/lib/errors/ErrorAlert.js +6 -1
- package/dist/lib/errors/ErrorAlert.js.map +1 -1
- package/dist/lib/hooks/useEvent.test.js +1 -1
- package/dist/lib/hooks/useEvent.test.js.map +1 -1
- package/dist/lib/oas/graphql/index.d.ts +17 -4
- package/dist/lib/oas/graphql/index.js +148 -38
- package/dist/lib/oas/graphql/index.js.map +1 -1
- package/dist/lib/oas/parser/dereference/index.js +2 -0
- package/dist/lib/oas/parser/dereference/index.js.map +1 -1
- package/dist/lib/oas/parser/index.d.ts +5 -3
- package/dist/lib/oas/parser/index.js +0 -22
- package/dist/lib/oas/parser/index.js.map +1 -1
- package/dist/lib/plugins/api-catalog/Catalog.js +1 -1
- package/dist/lib/plugins/api-catalog/Catalog.js.map +1 -1
- package/dist/lib/plugins/api-catalog/index.js +19 -17
- package/dist/lib/plugins/api-catalog/index.js.map +1 -1
- package/dist/lib/plugins/markdown/MdxPage.d.ts +1 -1
- package/dist/lib/plugins/markdown/MdxPage.js +3 -9
- package/dist/lib/plugins/markdown/MdxPage.js.map +1 -1
- package/dist/lib/plugins/openapi/ColorizedParam.js +1 -1
- package/dist/lib/plugins/openapi/ColorizedParam.js.map +1 -1
- package/dist/lib/plugins/openapi/Endpoint.js +1 -1
- package/dist/lib/plugins/openapi/Endpoint.js.map +1 -1
- package/dist/lib/plugins/openapi/OperationList.d.ts +1 -1
- package/dist/lib/plugins/openapi/OperationList.js +63 -19
- package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
- package/dist/lib/plugins/openapi/OperationListItem.d.ts +1 -1
- package/dist/lib/plugins/openapi/OperationListItem.js +6 -12
- package/dist/lib/plugins/openapi/OperationListItem.js.map +1 -1
- package/dist/lib/plugins/openapi/ParamInfos.d.ts +6 -0
- package/dist/lib/plugins/openapi/ParamInfos.js +42 -0
- package/dist/lib/plugins/openapi/ParamInfos.js.map +1 -0
- package/dist/lib/plugins/openapi/ParameterListItem.js +9 -4
- package/dist/lib/plugins/openapi/ParameterListItem.js.map +1 -1
- package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.js +3 -1
- package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.js.map +1 -1
- package/dist/lib/plugins/openapi/SchemaList.d.ts +1 -0
- package/dist/lib/plugins/openapi/SchemaList.js +52 -0
- package/dist/lib/plugins/openapi/SchemaList.js.map +1 -0
- package/dist/lib/plugins/openapi/Sidecar.js +38 -9
- package/dist/lib/plugins/openapi/Sidecar.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/client/GraphQLClient.d.ts +1 -1
- package/dist/lib/plugins/openapi/client/GraphQLClient.js +1 -1
- package/dist/lib/plugins/openapi/client/GraphQLClient.js.map +1 -1
- package/dist/lib/plugins/openapi/client/useCreateQuery.d.ts +6 -2
- package/dist/lib/plugins/openapi/client/useCreateQuery.js +6 -5
- package/dist/lib/plugins/openapi/client/useCreateQuery.js.map +1 -1
- package/dist/lib/plugins/openapi/components/EnumValues.d.ts +5 -0
- package/dist/lib/plugins/openapi/components/EnumValues.js +15 -0
- package/dist/lib/plugins/openapi/components/EnumValues.js.map +1 -0
- package/dist/lib/plugins/openapi/components/SelectOnClick.d.ts +5 -0
- package/dist/lib/plugins/openapi/components/SelectOnClick.js +16 -0
- package/dist/lib/plugins/openapi/components/SelectOnClick.js.map +1 -0
- package/dist/lib/plugins/openapi/graphql/gql.d.ts +9 -5
- package/dist/lib/plugins/openapi/graphql/gql.js +5 -4
- package/dist/lib/plugins/openapi/graphql/gql.js.map +1 -1
- package/dist/lib/plugins/openapi/graphql/graphql.d.ts +108 -55
- package/dist/lib/plugins/openapi/graphql/graphql.js +59 -34
- package/dist/lib/plugins/openapi/graphql/graphql.js.map +1 -1
- package/dist/lib/plugins/openapi/index.d.ts +6 -11
- package/dist/lib/plugins/openapi/index.js +41 -60
- package/dist/lib/plugins/openapi/index.js.map +1 -1
- package/dist/lib/plugins/openapi/interfaces.d.ts +36 -10
- package/dist/lib/plugins/openapi/playground/ExamplesDropdown.d.ts +2 -2
- package/dist/lib/plugins/openapi/playground/ExamplesDropdown.js +1 -5
- package/dist/lib/plugins/openapi/playground/ExamplesDropdown.js.map +1 -1
- 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/IdentityDialog.d.ts +11 -0
- package/dist/lib/plugins/openapi/playground/IdentityDialog.js +14 -0
- package/dist/lib/plugins/openapi/playground/IdentityDialog.js.map +1 -0
- package/dist/lib/plugins/openapi/playground/IdentitySelector.d.ts +7 -0
- package/dist/lib/plugins/openapi/playground/IdentitySelector.js +10 -0
- package/dist/lib/plugins/openapi/playground/IdentitySelector.js.map +1 -0
- package/dist/lib/plugins/openapi/playground/Playground.d.ts +13 -2
- package/dist/lib/plugins/openapi/playground/Playground.js +81 -27
- package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/QueryParams.js +1 -1
- package/dist/lib/plugins/openapi/playground/QueryParams.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/RequestLoginDialog.d.ts +7 -0
- package/dist/lib/plugins/openapi/playground/RequestLoginDialog.js +8 -0
- package/dist/lib/plugins/openapi/playground/RequestLoginDialog.js.map +1 -0
- package/dist/lib/plugins/openapi/playground/rememberedIdentity.d.ts +17 -0
- package/dist/lib/plugins/openapi/playground/rememberedIdentity.js +11 -0
- package/dist/lib/plugins/openapi/playground/rememberedIdentity.js.map +1 -0
- package/dist/lib/plugins/openapi/playground/result-panel/ResponseTab.js +19 -13
- package/dist/lib/plugins/openapi/playground/result-panel/ResponseTab.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/result-panel/ResultPanel.d.ts +6 -4
- package/dist/lib/plugins/openapi/playground/result-panel/ResultPanel.js +4 -3
- package/dist/lib/plugins/openapi/playground/result-panel/ResultPanel.js.map +1 -1
- package/dist/lib/plugins/openapi/schema/LogicalGroup/LogicalGroup.d.ts +1 -2
- package/dist/lib/plugins/openapi/schema/LogicalGroup/LogicalGroup.js +2 -2
- package/dist/lib/plugins/openapi/schema/LogicalGroup/LogicalGroup.js.map +1 -1
- package/dist/lib/plugins/openapi/schema/LogicalGroup/LogicalGroupConnector.d.ts +2 -1
- package/dist/lib/plugins/openapi/schema/LogicalGroup/LogicalGroupConnector.js +2 -2
- package/dist/lib/plugins/openapi/schema/LogicalGroup/LogicalGroupConnector.js.map +1 -1
- package/dist/lib/plugins/openapi/schema/LogicalGroup/LogicalGroupItem.d.ts +0 -1
- package/dist/lib/plugins/openapi/schema/LogicalGroup/LogicalGroupItem.js +1 -1
- package/dist/lib/plugins/openapi/schema/LogicalGroup/LogicalGroupItem.js.map +1 -1
- package/dist/lib/plugins/openapi/schema/SchemaExampleAndDefault.d.ts +4 -0
- package/dist/lib/plugins/openapi/schema/SchemaExampleAndDefault.js +12 -0
- package/dist/lib/plugins/openapi/schema/SchemaExampleAndDefault.js.map +1 -0
- package/dist/lib/plugins/openapi/schema/SchemaPropertyItem.d.ts +2 -4
- package/dist/lib/plugins/openapi/schema/SchemaPropertyItem.js +18 -13
- package/dist/lib/plugins/openapi/schema/SchemaPropertyItem.js.map +1 -1
- package/dist/lib/plugins/openapi/schema/SchemaView.d.ts +1 -2
- package/dist/lib/plugins/openapi/schema/SchemaView.js +33 -48
- package/dist/lib/plugins/openapi/schema/SchemaView.js.map +1 -1
- package/dist/lib/plugins/openapi/schema/utils.d.ts +1 -0
- package/dist/lib/plugins/openapi/schema/utils.js +3 -1
- package/dist/lib/plugins/openapi/schema/utils.js.map +1 -1
- package/dist/lib/plugins/openapi/state.d.ts +25 -0
- package/dist/lib/plugins/openapi/state.js +18 -0
- package/dist/lib/plugins/openapi/state.js.map +1 -0
- package/dist/lib/plugins/openapi/util/createSidebarCategory.js +5 -7
- package/dist/lib/plugins/openapi/util/createSidebarCategory.js.map +1 -1
- package/dist/lib/plugins/openapi/util/getRoutes.js +9 -3
- package/dist/lib/plugins/openapi/util/getRoutes.js.map +1 -1
- package/dist/lib/plugins/search-pagefind/PagefindSearch.js +23 -10
- package/dist/lib/plugins/search-pagefind/PagefindSearch.js.map +1 -1
- package/dist/lib/plugins/search-pagefind/ResultList.d.ts +1 -0
- package/dist/lib/plugins/search-pagefind/ResultList.js +19 -17
- package/dist/lib/plugins/search-pagefind/ResultList.js.map +1 -1
- package/dist/lib/plugins/search-pagefind/get-results.d.ts +8 -1
- package/dist/lib/plugins/search-pagefind/get-results.js +9 -4
- package/dist/lib/plugins/search-pagefind/get-results.js.map +1 -1
- package/dist/lib/ui/Badge.d.ts +1 -1
- package/dist/lib/ui/Button.d.ts +2 -2
- package/dist/lib/ui/Button.js +2 -1
- package/dist/lib/ui/Button.js.map +1 -1
- package/dist/lib/ui/Callout.d.ts +2 -1
- package/dist/lib/ui/Callout.js +3 -2
- package/dist/lib/ui/Callout.js.map +1 -1
- package/dist/lib/ui/Checkbox.d.ts +2 -8
- package/dist/lib/ui/Checkbox.js +1 -13
- package/dist/lib/ui/Checkbox.js.map +1 -1
- package/dist/lib/ui/Command.d.ts +1 -1
- package/dist/lib/ui/Select.js +1 -1
- package/dist/lib/ui/Select.js.map +1 -1
- package/dist/lib/ui/Stepper.d.ts +0 -1
- package/dist/lib/ui/Stepper.js +1 -1
- package/dist/lib/ui/Stepper.js.map +1 -1
- package/dist/lib/ui/SyntaxHighlight.d.ts +2 -1
- package/dist/lib/ui/SyntaxHighlight.js +21 -15
- package/dist/lib/ui/SyntaxHighlight.js.map +1 -1
- package/dist/lib/util/MdxComponents.d.ts +3 -2
- package/dist/lib/util/MdxComponents.js +2 -2
- package/dist/lib/util/MdxComponents.js.map +1 -1
- package/dist/lib/util/joinPath.d.ts +3 -0
- package/dist/lib/util/joinPath.js +3 -0
- package/dist/lib/util/joinPath.js.map +1 -1
- package/dist/lib/util/traverse.d.ts +2 -8
- package/dist/lib/util/traverse.js +2 -2
- package/dist/lib/util/traverse.js.map +1 -1
- package/dist/lib/util/types.d.ts +7 -0
- package/dist/lib/util/types.js +2 -0
- package/dist/lib/util/types.js.map +1 -0
- package/dist/lib/util/useOnScreen.d.ts +3 -2
- package/dist/lib/util/useOnScreen.js +3 -3
- package/dist/lib/util/useOnScreen.js.map +1 -1
- package/dist/lib/util/useScrollToAnchor.js +20 -12
- package/dist/lib/util/useScrollToAnchor.js.map +1 -1
- package/dist/vite/api/schema-codegen.d.ts +1 -1
- package/dist/vite/api/schema-codegen.js +35 -12
- package/dist/vite/api/schema-codegen.js.map +1 -1
- package/dist/vite/api/schema-codegen.test.js +66 -0
- package/dist/vite/api/schema-codegen.test.js.map +1 -1
- package/dist/vite/build.js +1 -4
- package/dist/vite/build.js.map +1 -1
- package/dist/vite/config.js +7 -9
- package/dist/vite/config.js.map +1 -1
- package/dist/vite/create-pagefind-index.d.ts +4 -0
- package/dist/vite/create-pagefind-index.js +12 -0
- package/dist/vite/create-pagefind-index.js.map +1 -0
- package/dist/vite/dev-server.js +4 -4
- package/dist/vite/dev-server.js.map +1 -1
- package/dist/vite/plugin-api.js +36 -29
- package/dist/vite/plugin-api.js.map +1 -1
- package/dist/vite/plugin-config-reload.js +3 -2
- package/dist/vite/plugin-config-reload.js.map +1 -1
- package/dist/vite/plugin-docs.d.ts +1 -1
- package/dist/vite/plugin-docs.js +18 -1
- package/dist/vite/plugin-docs.js.map +1 -1
- package/dist/vite/prerender/FileWritingResponse.d.ts +9 -5
- package/dist/vite/prerender/FileWritingResponse.js +5 -5
- package/dist/vite/prerender/FileWritingResponse.js.map +1 -1
- package/dist/vite/prerender/InMemoryResponse.d.ts +16 -0
- package/dist/vite/prerender/InMemoryResponse.js +32 -0
- package/dist/vite/prerender/InMemoryResponse.js.map +1 -0
- package/dist/vite/prerender/PrerenderResponse.d.ts +10 -0
- package/dist/vite/prerender/PrerenderResponse.js +2 -0
- package/dist/vite/prerender/PrerenderResponse.js.map +1 -0
- package/dist/vite/prerender/prerender.d.ts +1 -0
- package/dist/vite/prerender/prerender.js +32 -8
- package/dist/vite/prerender/prerender.js.map +1 -1
- package/dist/vite/prerender/worker.js +41 -14
- package/dist/vite/prerender/worker.js.map +1 -1
- package/dist/zuplo/with-zuplo.js +4 -0
- package/dist/zuplo/with-zuplo.js.map +1 -1
- package/lib/{AuthenticationPlugin-CiO1FM6Q.js → AuthenticationPlugin-foqdvvkf.js} +3 -3
- package/lib/{AuthenticationPlugin-CiO1FM6Q.js.map → AuthenticationPlugin-foqdvvkf.js.map} +1 -1
- package/lib/Button-Fp19CMUr.js +49 -0
- package/lib/Button-Fp19CMUr.js.map +1 -0
- package/lib/Callout-B2vsR09t.js +229 -0
- package/lib/Callout-B2vsR09t.js.map +1 -0
- package/lib/{Dialog-DIKGQxQc.js → Dialog-sbgekbjb.js} +47 -32
- package/lib/{Dialog-DIKGQxQc.js.map → Dialog-sbgekbjb.js.map} +1 -1
- package/lib/Drawer-kDAfOq_2.js +1133 -0
- package/lib/Drawer-kDAfOq_2.js.map +1 -0
- package/lib/{Markdown-DePfm7oQ.js → Markdown-aF5FdsNi.js} +6268 -4572
- package/lib/Markdown-aF5FdsNi.js.map +1 -0
- package/lib/MdxPage-Vw_dc9Yz.js +85 -0
- package/lib/MdxPage-Vw_dc9Yz.js.map +1 -0
- package/lib/{OasProvider-BSuptFK-.js → OasProvider-C5paEivQ.js} +4 -4
- package/lib/{OasProvider-BSuptFK-.js.map → OasProvider-C5paEivQ.js.map} +1 -1
- package/lib/OperationList-Ds9Izgkn.js +5069 -0
- package/lib/OperationList-Ds9Izgkn.js.map +1 -0
- package/lib/Pagination-SdlocK96.js +48 -0
- package/lib/Pagination-SdlocK96.js.map +1 -0
- package/lib/{index.esm-CQHE3GEU.js → RouteGuard-CqZPoZYJ.js} +192 -139
- package/lib/RouteGuard-CqZPoZYJ.js.map +1 -0
- package/lib/SchemaList-NZbDXAV5.js +148 -0
- package/lib/SchemaList-NZbDXAV5.js.map +1 -0
- package/lib/SchemaView-B3fOPR4V.js +357 -0
- package/lib/SchemaView-B3fOPR4V.js.map +1 -0
- package/lib/{Select-Dqtcn53H.js → Select-DVFRKf1R.js} +9 -9
- package/lib/{Select-Dqtcn53H.js.map → Select-DVFRKf1R.js.map} +1 -1
- package/lib/SlotletProvider-DXvc0aY6.js +338 -0
- package/lib/SlotletProvider-DXvc0aY6.js.map +1 -0
- package/lib/Spinner-CE68iCm0.js +7 -0
- package/lib/Spinner-CE68iCm0.js.map +1 -0
- package/lib/SyntaxHighlight-BEoSoPEo.js +2890 -0
- package/lib/SyntaxHighlight-BEoSoPEo.js.map +1 -0
- package/lib/Toc-YBsgI72s.js +92 -0
- package/lib/Toc-YBsgI72s.js.map +1 -0
- package/lib/{chunk-IR6S3I6Y-D_3UmFIn.js → chunk-HA7DTUK3-C4gP41vD.js} +278 -278
- package/lib/chunk-HA7DTUK3-C4gP41vD.js.map +1 -0
- package/lib/{circular-v7K6lDDh.js → circular-ByJI6Mci.js} +4887 -4419
- package/lib/circular-ByJI6Mci.js.map +1 -0
- package/lib/{createServer-DmusVVsi.js → createServer-mYvGvmc0.js} +4150 -4424
- package/lib/createServer-mYvGvmc0.js.map +1 -0
- package/lib/{hook-CN__aZIt.js → hook-CqpVYDqN.js} +398 -379
- package/lib/hook-CqpVYDqN.js.map +1 -0
- package/lib/index-D48iOQvJ.js +1973 -0
- package/lib/index-D48iOQvJ.js.map +1 -0
- package/lib/index-PGJOZ6R-.js +2227 -0
- package/lib/index-PGJOZ6R-.js.map +1 -0
- package/lib/{mutation-EclmI0is.js → mutation-8LjrN7uz.js} +2 -2
- package/lib/{mutation-EclmI0is.js.map → mutation-8LjrN7uz.js.map} +1 -1
- package/lib/post-processors/traverse.js +2 -2
- package/lib/post-processors/traverse.js.map +1 -1
- package/lib/prism-bash.min-HHIMdNJ_.js.map +1 -1
- package/lib/prism-csharp.min-bQAo2pmx.js.map +1 -1
- package/lib/prism-java.min-BpvsOuIa.js.map +1 -1
- package/lib/prism-javascript.min-CEqHqgbm.js.map +1 -1
- package/lib/prism-json.min-B1GJqK1k.js.map +1 -1
- package/lib/prism-jsstacktrace.min-BfobCF2F.js +2 -0
- package/lib/prism-jsstacktrace.min-BfobCF2F.js.map +1 -0
- package/lib/prism-markdown.min-C0Qn0m-5.js.map +1 -1
- package/lib/prism-markup-BNGj0Tvm.js.map +1 -1
- package/lib/prism-objectivec.min-BXSWqpJJ.js.map +1 -1
- package/lib/prism-ruby.min-Dx9KO9ds.js.map +1 -1
- package/lib/prism-typescript.min-CD7H2IYQ.js.map +1 -1
- package/lib/ui/ActionButton.js +11 -10
- package/lib/ui/ActionButton.js.map +1 -1
- package/lib/ui/Button.js +13 -12
- package/lib/ui/Button.js.map +1 -1
- package/lib/ui/Callout.js +39 -21
- package/lib/ui/Callout.js.map +1 -1
- package/lib/ui/Checkbox.js +15 -25
- package/lib/ui/Checkbox.js.map +1 -1
- package/lib/ui/Command.js +1 -1
- package/lib/ui/Drawer.js +14 -1129
- package/lib/ui/Drawer.js.map +1 -1
- package/lib/ui/Select.js +1 -1
- package/lib/ui/Select.js.map +1 -1
- package/lib/ui/Stepper.js.map +1 -1
- package/lib/ui/SyntaxHighlight.js +8 -2902
- package/lib/ui/SyntaxHighlight.js.map +1 -1
- package/lib/{useExposedProps-RIvey2Oy.js → useExposedProps-B9qXJedG.js} +2 -2
- package/lib/{useExposedProps-RIvey2Oy.js.map → useExposedProps-B9qXJedG.js.map} +1 -1
- package/lib/useLatest-hmRS46UF.js +11 -0
- package/lib/useLatest-hmRS46UF.js.map +1 -0
- package/lib/zudoku.auth-auth0.js +1 -1
- package/lib/zudoku.auth-clerk.js +59 -41
- package/lib/zudoku.auth-clerk.js.map +1 -1
- package/lib/zudoku.auth-openid.js +341 -337
- package/lib/zudoku.auth-openid.js.map +1 -1
- package/lib/zudoku.components.js +32 -1395
- package/lib/zudoku.components.js.map +1 -1
- package/lib/zudoku.hooks.js +1 -1
- package/lib/zudoku.plugin-api-catalog.js +94 -98
- package/lib/zudoku.plugin-api-catalog.js.map +1 -1
- package/lib/zudoku.plugin-api-keys.js +4 -4
- package/lib/zudoku.plugin-custom-pages.js +2 -2
- package/lib/zudoku.plugin-markdown.js +1 -1
- package/lib/zudoku.plugin-openapi.js +5 -7
- package/lib/zudoku.plugin-openapi.js.map +1 -1
- package/lib/zudoku.plugin-redirect.js +1 -1
- package/lib/zudoku.plugin-search-pagefind.js +233 -0
- package/lib/zudoku.plugin-search-pagefind.js.map +1 -0
- package/lib/zudoku.plugins.js.map +1 -1
- package/package.json +32 -24
- package/src/app/entry.server.tsx +23 -13
- package/src/app/main.css +98 -57
- package/src/app/main.tsx +2 -0
- package/src/app/tailwind.ts +14 -0
- package/src/lib/authentication/authentication.ts +2 -0
- package/src/lib/authentication/hook.ts +12 -1
- package/src/lib/authentication/providers/clerk.tsx +22 -2
- package/src/lib/authentication/providers/openid.tsx +23 -10
- package/src/lib/authentication/providers/supabase.tsx +157 -0
- package/src/lib/authentication/state.ts +1 -35
- package/src/lib/components/AnchorLink.tsx +9 -7
- package/src/lib/components/Bootstrap.tsx +13 -6
- package/src/lib/components/Footer.tsx +136 -0
- package/src/lib/components/Header.tsx +11 -7
- package/src/lib/components/InlineCode.tsx +13 -16
- package/src/lib/components/Layout.tsx +22 -68
- package/src/lib/components/Main.tsx +50 -0
- package/src/lib/components/MobileTopNavigation.tsx +27 -18
- package/src/lib/components/Pagination.tsx +50 -0
- package/src/lib/components/TopNavigation.tsx +40 -17
- package/src/lib/components/Zudoku.tsx +12 -3
- package/src/lib/components/cache.ts +8 -0
- package/src/lib/components/context/BypassProtectedRoutesContext.ts +3 -0
- package/src/lib/components/context/ViewportAnchorContext.tsx +6 -15
- package/src/lib/components/context/ZudokuContext.ts +17 -8
- package/src/lib/components/navigation/PoweredByZudoku.tsx +23 -0
- package/src/lib/components/navigation/Sidebar.tsx +30 -44
- package/src/lib/components/navigation/SidebarCategory.tsx +15 -12
- package/src/lib/components/navigation/SidebarItem.tsx +21 -29
- package/src/lib/components/navigation/SidebarWrapper.tsx +42 -23
- package/src/lib/{plugins/markdown → components/navigation}/Toc.tsx +5 -14
- package/src/lib/components/navigation/ZudokuLogo.tsx +25 -0
- package/src/lib/core/RouteGuard.tsx +27 -4
- package/src/lib/core/ZudokuContext.ts +35 -15
- package/src/lib/core/plugins.ts +8 -8
- package/src/lib/errors/ErrorAlert.tsx +24 -17
- package/src/lib/hooks/useEvent.test.tsx +1 -1
- package/src/lib/oas/graphql/index.ts +202 -54
- package/src/lib/oas/parser/dereference/index.ts +2 -0
- package/src/lib/oas/parser/index.ts +7 -29
- package/src/lib/plugins/api-catalog/Catalog.tsx +1 -4
- package/src/lib/plugins/api-catalog/index.tsx +40 -35
- package/src/lib/plugins/markdown/MdxPage.tsx +11 -47
- package/src/lib/plugins/openapi/ColorizedParam.tsx +1 -1
- package/src/lib/plugins/openapi/Endpoint.tsx +1 -1
- package/src/lib/plugins/openapi/OperationList.tsx +162 -84
- package/src/lib/plugins/openapi/OperationListItem.tsx +116 -110
- package/src/lib/plugins/openapi/ParamInfos.tsx +87 -0
- package/src/lib/plugins/openapi/ParameterListItem.tsx +35 -23
- package/src/lib/plugins/openapi/PlaygroundDialogWrapper.tsx +7 -0
- package/src/lib/plugins/openapi/SchemaList.tsx +151 -0
- package/src/lib/plugins/openapi/Sidecar.tsx +47 -11
- package/src/lib/plugins/openapi/SimpleSelect.tsx +1 -1
- package/src/lib/plugins/openapi/client/GraphQLClient.tsx +1 -1
- package/src/lib/plugins/openapi/client/useCreateQuery.ts +13 -5
- package/src/lib/plugins/openapi/components/EnumValues.tsx +58 -0
- package/src/lib/plugins/openapi/components/SelectOnClick.tsx +29 -0
- package/src/lib/plugins/openapi/graphql/gql.ts +29 -20
- package/src/lib/plugins/openapi/graphql/graphql.ts +172 -86
- package/src/lib/plugins/openapi/index.tsx +55 -87
- package/src/lib/plugins/openapi/interfaces.ts +44 -15
- package/src/lib/plugins/openapi/playground/ExamplesDropdown.tsx +30 -32
- package/src/lib/plugins/openapi/playground/Headers.tsx +0 -1
- package/src/lib/plugins/openapi/playground/IdentityDialog.tsx +74 -0
- package/src/lib/plugins/openapi/playground/IdentitySelector.tsx +54 -0
- package/src/lib/plugins/openapi/playground/Playground.tsx +175 -88
- package/src/lib/plugins/openapi/playground/QueryParams.tsx +0 -1
- package/src/lib/plugins/openapi/playground/RequestLoginDialog.tsx +51 -0
- package/src/lib/plugins/openapi/playground/rememberedIdentity.ts +26 -0
- package/src/lib/plugins/openapi/playground/result-panel/ResponseTab.tsx +24 -4
- package/src/lib/plugins/openapi/playground/result-panel/ResultPanel.tsx +67 -45
- package/src/lib/plugins/openapi/schema/LogicalGroup/LogicalGroup.tsx +1 -8
- package/src/lib/plugins/openapi/schema/LogicalGroup/LogicalGroupConnector.tsx +3 -0
- package/src/lib/plugins/openapi/schema/LogicalGroup/LogicalGroupItem.tsx +6 -3
- package/src/lib/plugins/openapi/schema/SchemaExampleAndDefault.tsx +36 -0
- package/src/lib/plugins/openapi/schema/SchemaPropertyItem.tsx +47 -50
- package/src/lib/plugins/openapi/schema/SchemaView.tsx +84 -138
- package/src/lib/plugins/openapi/schema/utils.ts +7 -1
- package/src/lib/plugins/openapi/state.ts +36 -0
- package/src/lib/plugins/openapi/util/createSidebarCategory.tsx +5 -7
- package/src/lib/plugins/openapi/util/getRoutes.tsx +9 -6
- package/src/lib/plugins/search-pagefind/PagefindSearch.tsx +39 -14
- package/src/lib/plugins/search-pagefind/ResultList.tsx +60 -53
- package/src/lib/plugins/search-pagefind/get-results.tsx +31 -10
- package/src/lib/ui/Button.tsx +4 -2
- package/src/lib/ui/Callout.tsx +28 -10
- package/src/lib/ui/Checkbox.tsx +8 -24
- package/src/lib/ui/Select.tsx +1 -1
- package/src/lib/ui/Stepper.tsx +1 -1
- package/src/lib/ui/SyntaxHighlight.tsx +96 -96
- package/src/lib/util/MdxComponents.tsx +2 -2
- package/src/lib/util/joinPath.tsx +3 -0
- package/src/lib/util/traverse.ts +4 -8
- package/src/lib/util/types.ts +7 -0
- package/src/lib/util/useOnScreen.ts +6 -4
- package/src/lib/util/useScrollToAnchor.ts +22 -12
- package/dist/lib/components/context/PluginSystem.d.ts +0 -1
- package/dist/lib/components/context/PluginSystem.js +0 -2
- package/dist/lib/components/context/PluginSystem.js.map +0 -1
- package/dist/lib/plugins/markdown/Toc.js.map +0 -1
- package/dist/vite/pagefind.d.ts +0 -4
- package/dist/vite/pagefind.js +0 -15
- package/dist/vite/pagefind.js.map +0 -1
- package/lib/Markdown-DePfm7oQ.js.map +0 -1
- package/lib/MdxPage-BN6l6zXL.js +0 -201
- package/lib/MdxPage-BN6l6zXL.js.map +0 -1
- package/lib/OperationList-DOcfDmJP.js +0 -5217
- package/lib/OperationList-DOcfDmJP.js.map +0 -1
- package/lib/SlotletProvider-DdtIOUi6.js +0 -221
- package/lib/SlotletProvider-DdtIOUi6.js.map +0 -1
- package/lib/Spinner-1KrEmx1V.js +0 -51
- package/lib/Spinner-1KrEmx1V.js.map +0 -1
- package/lib/chunk-IR6S3I6Y-D_3UmFIn.js.map +0 -1
- package/lib/circular-v7K6lDDh.js.map +0 -1
- package/lib/createServer-DmusVVsi.js.map +0 -1
- package/lib/hook-CN__aZIt.js.map +0 -1
- package/lib/index-BTbP6Lgf.js +0 -2103
- package/lib/index-BTbP6Lgf.js.map +0 -1
- package/lib/index.esm-CQHE3GEU.js.map +0 -1
- package/lib/joinUrl-10po2Jdj.js +0 -20
- package/lib/joinUrl-10po2Jdj.js.map +0 -1
- package/lib/useScrollToAnchor-RyqO3lj4.js +0 -290
- package/lib/useScrollToAnchor-RyqO3lj4.js.map +0 -1
- package/lib/zudoku.css +0 -1
- package/src/lib/components/context/PluginSystem.ts +0 -0
- package/src/lib/ui/Stepper.css +0 -43
- /package/dist/lib/{plugins/markdown → components/navigation}/Toc.d.ts +0 -0
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { ChevronsLeftRightIcon } from "lucide-react";
|
|
2
|
+
import { isValidElement, useState } from "react";
|
|
3
|
+
import { InlineCode } from "../../components/InlineCode.js";
|
|
4
|
+
import { type SchemaObject } from "../../oas/parser/index.js";
|
|
5
|
+
import { cn } from "../../util/cn.js";
|
|
6
|
+
|
|
7
|
+
const Pattern = ({ pattern }: { pattern: string }) => {
|
|
8
|
+
const [isExpanded, setIsExpanded] = useState(false);
|
|
9
|
+
const isExpandable = pattern.length > 20;
|
|
10
|
+
const shortPattern = isExpandable ? `${pattern.slice(0, 20)}…` : pattern;
|
|
11
|
+
|
|
12
|
+
return (
|
|
13
|
+
<InlineCode
|
|
14
|
+
className={cn("text-xs", isExpandable && "cursor-pointer")}
|
|
15
|
+
onClick={() => setIsExpanded(!isExpanded)}
|
|
16
|
+
selectOnClick={false}
|
|
17
|
+
>
|
|
18
|
+
{isExpanded ? pattern : shortPattern}
|
|
19
|
+
{isExpandable && (
|
|
20
|
+
<button type="button" className="p-1 translate-y-[2px]">
|
|
21
|
+
{!isExpanded && <ChevronsLeftRightIcon size={12} />}
|
|
22
|
+
</button>
|
|
23
|
+
)}
|
|
24
|
+
</InlineCode>
|
|
25
|
+
);
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const getSchemaInfos = (schema?: SchemaObject) => {
|
|
29
|
+
if (!schema) return [];
|
|
30
|
+
|
|
31
|
+
return [
|
|
32
|
+
schema.type === "array" && schema.items.type
|
|
33
|
+
? `${schema.items.type}[]`
|
|
34
|
+
: Array.isArray(schema.type)
|
|
35
|
+
? schema.type.join(" | ")
|
|
36
|
+
: schema.type,
|
|
37
|
+
|
|
38
|
+
schema.enum && "enum",
|
|
39
|
+
schema.format,
|
|
40
|
+
schema.minimum && `min: ${schema.minimum}`,
|
|
41
|
+
schema.maximum && `max: ${schema.maximum}`,
|
|
42
|
+
schema.minLength && `minLength: ${schema.minLength}`,
|
|
43
|
+
schema.maxLength && `maxLength: ${schema.maxLength}`,
|
|
44
|
+
schema.minItems && `minItems: ${schema.minItems}`,
|
|
45
|
+
schema.maxItems && `maxItems: ${schema.maxItems}`,
|
|
46
|
+
schema.uniqueItems && "unique",
|
|
47
|
+
schema.minProperties && `minProps: ${schema.minProperties}`,
|
|
48
|
+
schema.maxProperties && `maxProps: ${schema.maxProperties}`,
|
|
49
|
+
schema.readOnly && "readOnly",
|
|
50
|
+
schema.writeOnly && "writeOnly",
|
|
51
|
+
schema.deprecated && "deprecated",
|
|
52
|
+
schema.pattern && (
|
|
53
|
+
<>
|
|
54
|
+
pattern: <Pattern pattern={schema.pattern} />
|
|
55
|
+
</>
|
|
56
|
+
),
|
|
57
|
+
];
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
export const ParamInfos = ({
|
|
61
|
+
schema,
|
|
62
|
+
extraItems = [],
|
|
63
|
+
className,
|
|
64
|
+
}: {
|
|
65
|
+
schema?: SchemaObject;
|
|
66
|
+
extraItems?: unknown[];
|
|
67
|
+
className?: string;
|
|
68
|
+
}) => {
|
|
69
|
+
const filteredItems = [...getSchemaInfos(schema), ...extraItems].flatMap(
|
|
70
|
+
(item) => (typeof item === "string" || isValidElement(item) ? item : []),
|
|
71
|
+
);
|
|
72
|
+
|
|
73
|
+
return (
|
|
74
|
+
<span className={className}>
|
|
75
|
+
{filteredItems.map((item, index) => (
|
|
76
|
+
<span className="text-muted-foreground" key={index}>
|
|
77
|
+
{item}
|
|
78
|
+
{index < filteredItems.length - 1 && (
|
|
79
|
+
<span className="text-muted-foreground/50">
|
|
80
|
+
·
|
|
81
|
+
</span>
|
|
82
|
+
)}
|
|
83
|
+
</span>
|
|
84
|
+
))}
|
|
85
|
+
</span>
|
|
86
|
+
);
|
|
87
|
+
};
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import { Badge } from "zudoku/ui/Badge.js";
|
|
2
1
|
import { Markdown } from "../../components/Markdown.js";
|
|
3
2
|
import { type SchemaObject } from "../../oas/graphql/index.js";
|
|
4
3
|
import { ColorizedParam } from "./ColorizedParam.js";
|
|
5
4
|
import type { OperationListItemResult } from "./OperationList.js";
|
|
6
5
|
import type { ParameterGroup } from "./OperationListItem.js";
|
|
6
|
+
import { ParamInfos } from "./ParamInfos.js";
|
|
7
|
+
import { EnumValues } from "./components/EnumValues.js";
|
|
8
|
+
import { SelectOnClick } from "./components/SelectOnClick.js";
|
|
9
|
+
import { SchemaExampleAndDefault } from "./schema/SchemaExampleAndDefault.js";
|
|
7
10
|
|
|
8
11
|
const getParameterSchema = (
|
|
9
12
|
parameter: ParameterListItemResult,
|
|
@@ -32,29 +35,32 @@ export const ParameterListItem = ({
|
|
|
32
35
|
const paramSchema = getParameterSchema(parameter);
|
|
33
36
|
|
|
34
37
|
return (
|
|
35
|
-
<li className="p-4 bg-border/20 text-sm flex flex-col gap-1">
|
|
38
|
+
<li className="p-4 bg-border/20 text-sm flex flex-col gap-1.5">
|
|
36
39
|
<div className="flex items-center gap-2">
|
|
37
|
-
<
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
40
|
+
<SelectOnClick asChild>
|
|
41
|
+
<code>
|
|
42
|
+
{group === "path" ? (
|
|
43
|
+
<ColorizedParam
|
|
44
|
+
name={parameter.name}
|
|
45
|
+
backgroundOpacity="15%"
|
|
46
|
+
className="px-2"
|
|
47
|
+
slug={`${id}-${parameter.name}`}
|
|
48
|
+
/>
|
|
49
|
+
) : (
|
|
50
|
+
parameter.name
|
|
51
|
+
)}
|
|
52
|
+
</code>
|
|
53
|
+
</SelectOnClick>
|
|
54
|
+
<ParamInfos
|
|
55
|
+
schema={paramSchema}
|
|
56
|
+
extraItems={[
|
|
57
|
+
parameter.required && (
|
|
58
|
+
<span className="text-primary">required</span>
|
|
59
|
+
),
|
|
60
|
+
parameter.style && `style: ${parameter.style}`,
|
|
61
|
+
parameter.explode && `explode: ${parameter.explode}`,
|
|
62
|
+
]}
|
|
63
|
+
/>
|
|
58
64
|
</div>
|
|
59
65
|
{parameter.description && (
|
|
60
66
|
<Markdown
|
|
@@ -62,6 +68,12 @@ export const ParameterListItem = ({
|
|
|
62
68
|
className="text-sm prose-p:my-1 prose-code:whitespace-pre-line"
|
|
63
69
|
/>
|
|
64
70
|
)}
|
|
71
|
+
{paramSchema.type === "array" && paramSchema.items.enum ? (
|
|
72
|
+
<EnumValues values={paramSchema.items.enum} />
|
|
73
|
+
) : (
|
|
74
|
+
paramSchema.enum && <EnumValues values={paramSchema.enum} />
|
|
75
|
+
)}
|
|
76
|
+
<SchemaExampleAndDefault schema={paramSchema} />
|
|
65
77
|
</li>
|
|
66
78
|
);
|
|
67
79
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { useAuth } from "zudoku/components";
|
|
1
2
|
import type { OperationListItemResult } from "./OperationList.js";
|
|
2
3
|
import { PlaygroundDialog } from "./playground/PlaygroundDialog.js";
|
|
3
4
|
import { Content } from "./SidecarExamples.js";
|
|
@@ -13,6 +14,9 @@ export const PlaygroundDialogWrapper = ({
|
|
|
13
14
|
operation: OperationListItemResult;
|
|
14
15
|
examples?: Content;
|
|
15
16
|
}) => {
|
|
17
|
+
const { isAuthEnabled, login, signup, isPending, isAuthenticated } =
|
|
18
|
+
useAuth();
|
|
19
|
+
|
|
16
20
|
const headers = operation.parameters
|
|
17
21
|
?.filter((p) => p.in === "header")
|
|
18
22
|
.sort((a, b) => (a.required && !b.required ? -1 : 1))
|
|
@@ -49,6 +53,9 @@ export const PlaygroundDialogWrapper = ({
|
|
|
49
53
|
queryParams={queryParams}
|
|
50
54
|
pathParams={pathParams}
|
|
51
55
|
examples={examples}
|
|
56
|
+
requiresLogin={isAuthEnabled && !isAuthenticated && !isPending}
|
|
57
|
+
onLogin={() => login()}
|
|
58
|
+
onSignUp={() => signup()}
|
|
52
59
|
/>
|
|
53
60
|
);
|
|
54
61
|
};
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import slugify from "@sindresorhus/slugify";
|
|
2
|
+
import { useSuspenseQuery } from "@tanstack/react-query";
|
|
3
|
+
import {
|
|
4
|
+
ChevronRightIcon,
|
|
5
|
+
ChevronsDownUpIcon,
|
|
6
|
+
ChevronsUpDownIcon,
|
|
7
|
+
} from "lucide-react";
|
|
8
|
+
import { Button } from "zudoku/ui/Button.js";
|
|
9
|
+
import {
|
|
10
|
+
Collapsible,
|
|
11
|
+
CollapsibleContent,
|
|
12
|
+
CollapsibleTrigger,
|
|
13
|
+
} from "zudoku/ui/Collapsible.js";
|
|
14
|
+
import { CategoryHeading } from "../../components/CategoryHeading.js";
|
|
15
|
+
import { Heading } from "../../components/Heading.js";
|
|
16
|
+
import { Markdown, ProseClasses } from "../../components/Markdown.js";
|
|
17
|
+
import { Toc } from "../../components/navigation/Toc.js";
|
|
18
|
+
import { cn } from "../../util/cn.js";
|
|
19
|
+
import { useCreateQuery } from "./client/useCreateQuery.js";
|
|
20
|
+
import { useOasConfig } from "./context.js";
|
|
21
|
+
import { graphql } from "./graphql/gql.js";
|
|
22
|
+
import { SchemaView } from "./schema/SchemaView.js";
|
|
23
|
+
|
|
24
|
+
const GET_SCHEMAS = graphql(/* GraphQL */ `
|
|
25
|
+
query GetSchemas($input: JSON!, $type: SchemaType!) {
|
|
26
|
+
schema(input: $input, type: $type) {
|
|
27
|
+
title
|
|
28
|
+
description
|
|
29
|
+
summary
|
|
30
|
+
components {
|
|
31
|
+
schemas {
|
|
32
|
+
name
|
|
33
|
+
schema
|
|
34
|
+
extensions
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
`);
|
|
40
|
+
|
|
41
|
+
export function SchemaList() {
|
|
42
|
+
const { input, type, versions, version, options } = useOasConfig();
|
|
43
|
+
const schemasQuery = useCreateQuery(GET_SCHEMAS, {
|
|
44
|
+
input,
|
|
45
|
+
type,
|
|
46
|
+
});
|
|
47
|
+
const { data } = useSuspenseQuery(schemasQuery);
|
|
48
|
+
|
|
49
|
+
const schemas = data.schema.components?.schemas ?? [];
|
|
50
|
+
|
|
51
|
+
if (!schemas.length) {
|
|
52
|
+
return <div>No schemas found</div>;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const hasMultipleVersions = Object.entries(versions).length > 1;
|
|
56
|
+
const showVersions =
|
|
57
|
+
options?.showVersionSelect === "always" ||
|
|
58
|
+
(hasMultipleVersions && options?.showVersionSelect !== "hide");
|
|
59
|
+
|
|
60
|
+
return (
|
|
61
|
+
<div
|
|
62
|
+
className="grid grid-cols-[--sidecar-grid-cols] gap-8 justify-between"
|
|
63
|
+
data-pagefind-filter="section:openapi"
|
|
64
|
+
data-pagefind-meta="section:openapi"
|
|
65
|
+
>
|
|
66
|
+
<div className="pt-[--padding-content-top] pb-[--padding-content-bottom]">
|
|
67
|
+
<Collapsible className="w-full">
|
|
68
|
+
<div className="flex flex-col gap-y-4 sm:flex-row justify-around items-start sm:items-end">
|
|
69
|
+
<div className="flex-1">
|
|
70
|
+
<CategoryHeading>{data.schema.title}</CategoryHeading>
|
|
71
|
+
<Heading
|
|
72
|
+
level={1}
|
|
73
|
+
id="schemas"
|
|
74
|
+
registerSidebarAnchor
|
|
75
|
+
className="mb-0"
|
|
76
|
+
>
|
|
77
|
+
Schemas
|
|
78
|
+
{showVersions && (
|
|
79
|
+
<span className="text-xl text-muted-foreground ml-1.5">
|
|
80
|
+
({version})
|
|
81
|
+
</span>
|
|
82
|
+
)}
|
|
83
|
+
</Heading>
|
|
84
|
+
</div>
|
|
85
|
+
{data.schema.description && (
|
|
86
|
+
<CollapsibleTrigger className="flex items-center gap-1 text-sm font-medium text-muted-foreground group">
|
|
87
|
+
<span>API information</span>
|
|
88
|
+
<ChevronsUpDownIcon
|
|
89
|
+
className="group-data-[state=open]:hidden translate-y-px"
|
|
90
|
+
size={14}
|
|
91
|
+
/>
|
|
92
|
+
<ChevronsDownUpIcon
|
|
93
|
+
className="group-data-[state=closed]:hidden translate-y-px"
|
|
94
|
+
size={13}
|
|
95
|
+
/>
|
|
96
|
+
</CollapsibleTrigger>
|
|
97
|
+
)}
|
|
98
|
+
</div>
|
|
99
|
+
{data.schema.description && (
|
|
100
|
+
<CollapsibleContent className="CollapsibleContent">
|
|
101
|
+
<div
|
|
102
|
+
className={cn(
|
|
103
|
+
ProseClasses,
|
|
104
|
+
"pt-4 max-w-full prose-img:max-w-prose",
|
|
105
|
+
)}
|
|
106
|
+
>
|
|
107
|
+
<Markdown
|
|
108
|
+
className="border rounded bg-muted/25 border-border px-2.5 md:px-4"
|
|
109
|
+
content={data.schema.description}
|
|
110
|
+
/>
|
|
111
|
+
</div>
|
|
112
|
+
</CollapsibleContent>
|
|
113
|
+
)}
|
|
114
|
+
</Collapsible>
|
|
115
|
+
<hr className="my-8" />
|
|
116
|
+
<div className="flex flex-col gap-y-5">
|
|
117
|
+
{schemas.map((schema) => (
|
|
118
|
+
<Collapsible key={schema.name} className="group" defaultOpen>
|
|
119
|
+
<Heading
|
|
120
|
+
registerSidebarAnchor
|
|
121
|
+
level={2}
|
|
122
|
+
className="flex items-center gap-1 justify-between w-fit"
|
|
123
|
+
id={slugify(schema.name)}
|
|
124
|
+
>
|
|
125
|
+
{schema.name}{" "}
|
|
126
|
+
<CollapsibleTrigger asChild>
|
|
127
|
+
<Button variant="ghost" size="icon" className="size-6">
|
|
128
|
+
<ChevronRightIcon
|
|
129
|
+
size={16}
|
|
130
|
+
className="group-data-[state=open]:rotate-90 transition cursor-pointer"
|
|
131
|
+
/>
|
|
132
|
+
</Button>
|
|
133
|
+
</CollapsibleTrigger>
|
|
134
|
+
</Heading>
|
|
135
|
+
<CollapsibleContent className="mt-4 CollapsibleContent">
|
|
136
|
+
<SchemaView schema={schema.schema} />
|
|
137
|
+
</CollapsibleContent>
|
|
138
|
+
</Collapsible>
|
|
139
|
+
))}
|
|
140
|
+
</div>
|
|
141
|
+
</div>
|
|
142
|
+
<Toc
|
|
143
|
+
entries={schemas.map((schema) => ({
|
|
144
|
+
id: slugify(schema.name),
|
|
145
|
+
value: schema.name,
|
|
146
|
+
depth: 1,
|
|
147
|
+
}))}
|
|
148
|
+
/>
|
|
149
|
+
</div>
|
|
150
|
+
);
|
|
151
|
+
}
|
|
@@ -2,7 +2,8 @@ import { useSuspenseQuery } from "@tanstack/react-query";
|
|
|
2
2
|
import { HTTPSnippet } from "@zudoku/httpsnippet";
|
|
3
3
|
import { useMemo, useState, useTransition } from "react";
|
|
4
4
|
import { useSearchParams } from "react-router";
|
|
5
|
-
import {
|
|
5
|
+
import { useZudoku } from "zudoku/components";
|
|
6
|
+
import { useAuthState } from "../../authentication/state.js";
|
|
6
7
|
import { PathRenderer } from "../../components/PathRenderer.js";
|
|
7
8
|
import type { SchemaObject } from "../../oas/parser/index.js";
|
|
8
9
|
import { SyntaxHighlight } from "../../ui/SyntaxHighlight.js";
|
|
@@ -19,6 +20,7 @@ import { RequestBodySidecarBox } from "./RequestBodySidecarBox.js";
|
|
|
19
20
|
import { ResponsesSidecarBox } from "./ResponsesSidecarBox.js";
|
|
20
21
|
import * as SidecarBox from "./SidecarBox.js";
|
|
21
22
|
import { SimpleSelect } from "./SimpleSelect.js";
|
|
23
|
+
import { useSelectedServer } from "./state.js";
|
|
22
24
|
import { generateSchemaExample } from "./util/generateSchemaExample.js";
|
|
23
25
|
import { methodForColor } from "./util/methodToColor.js";
|
|
24
26
|
|
|
@@ -101,8 +103,10 @@ export const Sidecar = ({
|
|
|
101
103
|
onSelectResponse: (response: string) => void;
|
|
102
104
|
}) => {
|
|
103
105
|
const { input, type, options } = useOasConfig();
|
|
106
|
+
const auth = useAuthState();
|
|
104
107
|
const query = useCreateQuery(GetServerQuery, { input, type });
|
|
105
108
|
const result = useSuspenseQuery(query);
|
|
109
|
+
const context = useZudoku();
|
|
106
110
|
|
|
107
111
|
const methodTextColor = methodForColor(operation.method);
|
|
108
112
|
|
|
@@ -111,10 +115,21 @@ export const Sidecar = ({
|
|
|
111
115
|
const [selectedExample, setSelectedExample] = useState<unknown>();
|
|
112
116
|
|
|
113
117
|
const selectedLang =
|
|
114
|
-
searchParams.get("lang") ?? options?.
|
|
118
|
+
searchParams.get("lang") ?? options?.examplesLanguage ?? "shell";
|
|
115
119
|
|
|
116
120
|
const requestBodyContent = operation.requestBody?.content;
|
|
117
121
|
|
|
122
|
+
const transformedRequestBodyContent =
|
|
123
|
+
requestBodyContent && options?.transformExamples
|
|
124
|
+
? options.transformExamples({
|
|
125
|
+
auth,
|
|
126
|
+
type: "request",
|
|
127
|
+
operation,
|
|
128
|
+
content: requestBodyContent,
|
|
129
|
+
context,
|
|
130
|
+
})
|
|
131
|
+
: requestBodyContent;
|
|
132
|
+
|
|
118
133
|
const path = (
|
|
119
134
|
<PathRenderer
|
|
120
135
|
path={operation.path}
|
|
@@ -136,8 +151,10 @@ export const Sidecar = ({
|
|
|
136
151
|
const code = useMemo(() => {
|
|
137
152
|
const example =
|
|
138
153
|
selectedExample ??
|
|
139
|
-
(
|
|
140
|
-
? generateSchemaExample(
|
|
154
|
+
(transformedRequestBodyContent?.[0]?.schema
|
|
155
|
+
? generateSchemaExample(
|
|
156
|
+
transformedRequestBodyContent[0].schema as SchemaObject,
|
|
157
|
+
)
|
|
141
158
|
: undefined);
|
|
142
159
|
|
|
143
160
|
const snippet = new HTTPSnippet({
|
|
@@ -151,7 +168,7 @@ export const Sidecar = ({
|
|
|
151
168
|
mimeType: "application/json",
|
|
152
169
|
}
|
|
153
170
|
: ({} as any),
|
|
154
|
-
headers: [],
|
|
171
|
+
headers: [{ name: "Content-Type", value: "application/json" }],
|
|
155
172
|
queryString: [],
|
|
156
173
|
httpVersion: "",
|
|
157
174
|
cookies: [],
|
|
@@ -162,15 +179,22 @@ export const Sidecar = ({
|
|
|
162
179
|
return getConverted(snippet, selectedLang);
|
|
163
180
|
}, [
|
|
164
181
|
selectedExample,
|
|
165
|
-
|
|
182
|
+
transformedRequestBodyContent,
|
|
166
183
|
operation.method,
|
|
167
184
|
operation.path,
|
|
168
185
|
selectedServer,
|
|
169
|
-
result.data.schema.url,
|
|
170
186
|
selectedLang,
|
|
171
187
|
]);
|
|
172
188
|
const [ref, isOnScreen] = useOnScreen({ rootMargin: "200px 0px 200px 0px" });
|
|
173
189
|
|
|
190
|
+
const showPlayground =
|
|
191
|
+
isOnScreen &&
|
|
192
|
+
(operation.extensions["x-explorer-enabled"] === true ||
|
|
193
|
+
operation.extensions["x-zudoku-playground-enabled"] === true ||
|
|
194
|
+
(operation.extensions["x-explorer-enabled"] === undefined &&
|
|
195
|
+
operation.extensions["x-zudoku-playground-enabled"] === undefined &&
|
|
196
|
+
!options?.disablePlayground));
|
|
197
|
+
|
|
174
198
|
return (
|
|
175
199
|
<aside
|
|
176
200
|
ref={ref}
|
|
@@ -186,7 +210,7 @@ export const Sidecar = ({
|
|
|
186
210
|
|
|
187
211
|
{path}
|
|
188
212
|
</span>
|
|
189
|
-
{
|
|
213
|
+
{showPlayground && (
|
|
190
214
|
<PlaygroundDialogWrapper
|
|
191
215
|
servers={result.data.schema.servers.map((server) => server.url)}
|
|
192
216
|
operation={operation}
|
|
@@ -225,9 +249,9 @@ export const Sidecar = ({
|
|
|
225
249
|
</>
|
|
226
250
|
)}
|
|
227
251
|
</SidecarBox.Root>
|
|
228
|
-
{isOnScreen &&
|
|
252
|
+
{isOnScreen && transformedRequestBodyContent && (
|
|
229
253
|
<RequestBodySidecarBox
|
|
230
|
-
content={
|
|
254
|
+
content={transformedRequestBodyContent}
|
|
231
255
|
onExampleChange={setSelectedExample}
|
|
232
256
|
/>
|
|
233
257
|
)}
|
|
@@ -235,7 +259,19 @@ export const Sidecar = ({
|
|
|
235
259
|
<ResponsesSidecarBox
|
|
236
260
|
selectedResponse={selectedResponse}
|
|
237
261
|
onSelectResponse={onSelectResponse}
|
|
238
|
-
responses={operation.responses
|
|
262
|
+
responses={operation.responses.map((response) => ({
|
|
263
|
+
...response,
|
|
264
|
+
content:
|
|
265
|
+
response.content && options?.transformExamples
|
|
266
|
+
? options.transformExamples({
|
|
267
|
+
auth,
|
|
268
|
+
type: "response",
|
|
269
|
+
context,
|
|
270
|
+
operation,
|
|
271
|
+
content: response.content,
|
|
272
|
+
})
|
|
273
|
+
: response.content,
|
|
274
|
+
}))}
|
|
239
275
|
/>
|
|
240
276
|
)}
|
|
241
277
|
</aside>
|
|
@@ -21,7 +21,7 @@ export const SimpleSelect = ({
|
|
|
21
21
|
<div className="grid">
|
|
22
22
|
<select
|
|
23
23
|
className={cn(
|
|
24
|
-
"row-start-1 col-start-1 border border-input text-foreground px-2 py-1 pe-6",
|
|
24
|
+
"w-full row-start-1 col-start-1 border border-input text-foreground px-2 py-1 pe-6",
|
|
25
25
|
"rounded-md appearance-none bg-zinc-50 hover:bg-white dark:bg-zinc-800 hover:dark:bg-zinc-800/75",
|
|
26
26
|
className,
|
|
27
27
|
)}
|
|
@@ -43,7 +43,7 @@ export class GraphQLClient {
|
|
|
43
43
|
|
|
44
44
|
fetch = async <TResult, TVariables>(
|
|
45
45
|
query: TypedDocumentString<TResult, TVariables>,
|
|
46
|
-
|
|
46
|
+
variables?: TVariables,
|
|
47
47
|
): Promise<TResult> => {
|
|
48
48
|
const operationName = query.match(/query (\w+)/)?.[1];
|
|
49
49
|
|
|
@@ -1,18 +1,26 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { stripIgnoredCharacters } from "graphql";
|
|
2
|
+
import { use } from "react";
|
|
2
3
|
import type { TypedDocumentString } from "../graphql/graphql.js";
|
|
3
4
|
import { GraphQLContext } from "./GraphQLContext.js";
|
|
4
5
|
|
|
6
|
+
type NoExtraProps<T, U extends T = T> = U & {
|
|
7
|
+
[K in Exclude<keyof U, keyof T>]?: never;
|
|
8
|
+
};
|
|
9
|
+
|
|
5
10
|
export const useCreateQuery = <TResult, TVariables>(
|
|
6
11
|
query: TypedDocumentString<TResult, TVariables>,
|
|
7
|
-
...variables: TVariables extends Record<string, never>
|
|
12
|
+
...[variables]: TVariables extends Record<string, never>
|
|
13
|
+
? []
|
|
14
|
+
: [NoExtraProps<TVariables>]
|
|
8
15
|
) => {
|
|
9
|
-
const graphQLClient =
|
|
16
|
+
const graphQLClient = use(GraphQLContext);
|
|
17
|
+
|
|
10
18
|
if (graphQLClient === undefined) {
|
|
11
19
|
throw new Error("useGraphQL must be used within a GraphQLProvider");
|
|
12
20
|
}
|
|
13
21
|
|
|
14
22
|
return {
|
|
15
|
-
queryFn: () => graphQLClient.fetch(query,
|
|
16
|
-
queryKey: [query, variables
|
|
23
|
+
queryFn: () => graphQLClient.fetch(query, variables),
|
|
24
|
+
queryKey: [stripIgnoredCharacters(query.toString()), variables],
|
|
17
25
|
} as const;
|
|
18
26
|
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { ChevronDownIcon, ChevronUpIcon } from "lucide-react";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
import { Button } from "zudoku/ui/Button.js";
|
|
4
|
+
import { cn } from "../../../util/cn.js";
|
|
5
|
+
import { SelectOnClick } from "./SelectOnClick.js";
|
|
6
|
+
|
|
7
|
+
export const EnumValues = ({
|
|
8
|
+
values,
|
|
9
|
+
className,
|
|
10
|
+
maxVisibleValues = 8,
|
|
11
|
+
}: {
|
|
12
|
+
values: Array<string | number>;
|
|
13
|
+
className?: string;
|
|
14
|
+
maxVisibleValues?: number;
|
|
15
|
+
}) => {
|
|
16
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
17
|
+
|
|
18
|
+
if (!values.length) return null;
|
|
19
|
+
|
|
20
|
+
const shouldCollapse = values.length > maxVisibleValues;
|
|
21
|
+
const visibleValues =
|
|
22
|
+
shouldCollapse && !isOpen ? values.slice(0, maxVisibleValues) : values;
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<div className={cn("flex flex-wrap gap-1.5 text-xs", className)}>
|
|
26
|
+
<span className="text-muted-foreground">Enum values: </span>
|
|
27
|
+
{visibleValues.map((value) => (
|
|
28
|
+
<div key={value}>
|
|
29
|
+
<SelectOnClick className="border rounded px-1 font-mono">
|
|
30
|
+
{value}
|
|
31
|
+
</SelectOnClick>
|
|
32
|
+
</div>
|
|
33
|
+
))}
|
|
34
|
+
{shouldCollapse && (
|
|
35
|
+
<Button
|
|
36
|
+
variant="ghost"
|
|
37
|
+
size="sm"
|
|
38
|
+
className="h-fit px-0"
|
|
39
|
+
onClick={() => setIsOpen(!isOpen)}
|
|
40
|
+
>
|
|
41
|
+
{isOpen ? (
|
|
42
|
+
<div className="flex items-center gap-1">
|
|
43
|
+
<ChevronUpIcon size={12} />
|
|
44
|
+
<span className="text-muted-foreground">show less</span>
|
|
45
|
+
</div>
|
|
46
|
+
) : (
|
|
47
|
+
<div className="flex items-center gap-1">
|
|
48
|
+
<ChevronDownIcon size={12} />
|
|
49
|
+
<span className="text-muted-foreground">
|
|
50
|
+
show {values.length - maxVisibleValues} more
|
|
51
|
+
</span>
|
|
52
|
+
</div>
|
|
53
|
+
)}
|
|
54
|
+
</Button>
|
|
55
|
+
)}
|
|
56
|
+
</div>
|
|
57
|
+
);
|
|
58
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Slot, type SlotProps } from "@radix-ui/react-slot";
|
|
2
|
+
|
|
3
|
+
export const SelectOnClick = ({
|
|
4
|
+
asChild,
|
|
5
|
+
onClick,
|
|
6
|
+
enabled = true,
|
|
7
|
+
...props
|
|
8
|
+
}: {
|
|
9
|
+
asChild?: boolean;
|
|
10
|
+
enabled?: boolean;
|
|
11
|
+
} & SlotProps) => {
|
|
12
|
+
const Component = asChild ? Slot : "span";
|
|
13
|
+
|
|
14
|
+
return (
|
|
15
|
+
<Component
|
|
16
|
+
onClick={(e) => {
|
|
17
|
+
if (enabled) {
|
|
18
|
+
const range = document.createRange();
|
|
19
|
+
range.selectNodeContents(e.currentTarget);
|
|
20
|
+
const selection = window.getSelection();
|
|
21
|
+
selection?.removeAllRanges();
|
|
22
|
+
selection?.addRange(range);
|
|
23
|
+
}
|
|
24
|
+
onClick?.(e);
|
|
25
|
+
}}
|
|
26
|
+
{...props}
|
|
27
|
+
/>
|
|
28
|
+
);
|
|
29
|
+
};
|