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
package/src/app/entry.server.tsx
CHANGED
|
@@ -8,31 +8,34 @@ import {
|
|
|
8
8
|
createStaticHandler,
|
|
9
9
|
createStaticRouter,
|
|
10
10
|
isRouteErrorResponse,
|
|
11
|
+
type RouteObject,
|
|
11
12
|
} from "react-router";
|
|
12
13
|
import "virtual:zudoku-theme.css";
|
|
13
14
|
import "vite/modulepreload-polyfill";
|
|
14
15
|
import { BootstrapStatic, ServerError } from "zudoku/components";
|
|
15
|
-
import
|
|
16
|
-
import type {
|
|
16
|
+
import { NO_DEHYDRATE } from "../lib/components/cache.js";
|
|
17
|
+
import type { PrerenderResponse } from "../vite/prerender/PrerenderResponse.js";
|
|
17
18
|
import "./main.css";
|
|
18
19
|
import { getRoutesByConfig } from "./main.js";
|
|
19
|
-
|
|
20
20
|
export { getRoutesByConfig };
|
|
21
21
|
|
|
22
22
|
export const render = async ({
|
|
23
23
|
template,
|
|
24
24
|
request: baseRequest,
|
|
25
25
|
response,
|
|
26
|
-
|
|
26
|
+
routes,
|
|
27
|
+
basePath,
|
|
28
|
+
bypassProtection,
|
|
27
29
|
}: {
|
|
28
30
|
template: string;
|
|
29
31
|
request: express.Request | Request;
|
|
30
|
-
response: express.Response |
|
|
31
|
-
|
|
32
|
+
response: express.Response | PrerenderResponse;
|
|
33
|
+
routes: RouteObject[];
|
|
34
|
+
basePath?: string;
|
|
35
|
+
bypassProtection?: boolean;
|
|
32
36
|
}) => {
|
|
33
|
-
const routes = getRoutesByConfig(config);
|
|
34
37
|
const { query, dataRoutes } = createStaticHandler(routes, {
|
|
35
|
-
basename:
|
|
38
|
+
basename: basePath,
|
|
36
39
|
});
|
|
37
40
|
const queryClient = new QueryClient();
|
|
38
41
|
|
|
@@ -47,7 +50,7 @@ export const render = async ({
|
|
|
47
50
|
if (context instanceof Response) {
|
|
48
51
|
if ([301, 302, 303, 307, 308].includes(context.status)) {
|
|
49
52
|
return response.redirect(
|
|
50
|
-
context.status,
|
|
53
|
+
import.meta.env.PROD ? context.status : 307,
|
|
51
54
|
context.headers.get("Location")!,
|
|
52
55
|
);
|
|
53
56
|
}
|
|
@@ -72,6 +75,7 @@ export const render = async ({
|
|
|
72
75
|
context={context}
|
|
73
76
|
queryClient={queryClient}
|
|
74
77
|
helmetContext={helmetContext}
|
|
78
|
+
bypassProtection={bypassProtection}
|
|
75
79
|
/>
|
|
76
80
|
);
|
|
77
81
|
|
|
@@ -84,8 +88,6 @@ export const render = async ({
|
|
|
84
88
|
|
|
85
89
|
response.send(html);
|
|
86
90
|
},
|
|
87
|
-
// for SSG we could use onAllReady instead of onShellReady
|
|
88
|
-
// https://react.dev/reference/react-dom/server/renderToPipeableStream#waiting-for-all-content-to-load-for-crawlers-and-static-generation
|
|
89
91
|
onAllReady() {
|
|
90
92
|
response.set({ "Content-Type": "text/html" });
|
|
91
93
|
response.status(status);
|
|
@@ -117,10 +119,15 @@ export const render = async ({
|
|
|
117
119
|
);
|
|
118
120
|
|
|
119
121
|
transformStream.on("finish", () => {
|
|
122
|
+
const dehydrated = dehydrate(queryClient, {
|
|
123
|
+
shouldDehydrateQuery: (query) =>
|
|
124
|
+
!query.queryKey.includes(NO_DEHYDRATE),
|
|
125
|
+
});
|
|
126
|
+
|
|
120
127
|
response.end(
|
|
121
128
|
htmlEnd?.replace(
|
|
122
129
|
"</body>",
|
|
123
|
-
`<script>window.DATA
|
|
130
|
+
`<script>window.DATA=${JSON.stringify(dehydrated)}</script></body>`,
|
|
124
131
|
),
|
|
125
132
|
);
|
|
126
133
|
});
|
|
@@ -129,6 +136,9 @@ export const render = async ({
|
|
|
129
136
|
},
|
|
130
137
|
onError(error) {
|
|
131
138
|
status = 500;
|
|
139
|
+
if (import.meta.env.PROD) {
|
|
140
|
+
throw error;
|
|
141
|
+
}
|
|
132
142
|
logger.error(error);
|
|
133
143
|
},
|
|
134
144
|
});
|
|
@@ -136,7 +146,7 @@ export const render = async ({
|
|
|
136
146
|
|
|
137
147
|
export function createFetchRequest(
|
|
138
148
|
req: express.Request,
|
|
139
|
-
res: express.Response |
|
|
149
|
+
res: express.Response | PrerenderResponse,
|
|
140
150
|
): Request {
|
|
141
151
|
const origin = `${req.protocol}://${req.get("host")}`;
|
|
142
152
|
// Note: This had to take originalUrl into account for presumably vite's proxying
|
package/src/app/main.css
CHANGED
|
@@ -82,10 +82,11 @@
|
|
|
82
82
|
--top-nav-height: 50px;
|
|
83
83
|
--banner-height: 40px;
|
|
84
84
|
--header-height: calc(
|
|
85
|
-
var(--top-header-height) + var(--top-nav-height) + var(--banner-height)
|
|
85
|
+
var(--top-header-height) + var(--top-nav-height) + var(--banner-height) -
|
|
86
|
+
/* borders */ 2px
|
|
86
87
|
);
|
|
87
88
|
--scroll-padding: calc(var(--header-height) + 10px);
|
|
88
|
-
--side-nav-width: theme("spacing.
|
|
89
|
+
--side-nav-width: theme("spacing.72");
|
|
89
90
|
--padding-content-top: theme("spacing.6");
|
|
90
91
|
--padding-content-bottom: theme("spacing.12");
|
|
91
92
|
--padding-nav-item: theme("spacing[2.5]");
|
|
@@ -108,8 +109,9 @@
|
|
|
108
109
|
}
|
|
109
110
|
|
|
110
111
|
#root {
|
|
111
|
-
@apply min-h-screen w-full;
|
|
112
|
+
@apply min-h-screen w-full grid grid-rows-[auto_1fr];
|
|
112
113
|
}
|
|
114
|
+
|
|
113
115
|
* {
|
|
114
116
|
@apply border-border;
|
|
115
117
|
}
|
|
@@ -121,6 +123,10 @@
|
|
|
121
123
|
"calt" 1;
|
|
122
124
|
}
|
|
123
125
|
|
|
126
|
+
::selection {
|
|
127
|
+
@apply bg-primary/100 text-primary-foreground;
|
|
128
|
+
}
|
|
129
|
+
|
|
124
130
|
.dark {
|
|
125
131
|
color-scheme: dark;
|
|
126
132
|
}
|
|
@@ -239,61 +245,96 @@
|
|
|
239
245
|
}
|
|
240
246
|
|
|
241
247
|
/* Theme */
|
|
248
|
+
:root {
|
|
249
|
+
--background: 0 0% 100%;
|
|
250
|
+
--foreground: 240 10% 3.9%;
|
|
251
|
+
--card: 0 0% 100%;
|
|
252
|
+
--card-foreground: 240 10% 3.9%;
|
|
253
|
+
--popover: 0 0% 100%;
|
|
254
|
+
--popover-foreground: 240 10% 3.9%;
|
|
255
|
+
--primary: 240 5.9% 10%;
|
|
256
|
+
--primary-foreground: 0 0% 98%;
|
|
257
|
+
--secondary: 240 4.8% 95.9%;
|
|
258
|
+
--secondary-foreground: 240 5.9% 10%;
|
|
259
|
+
--muted: 240 4.8% 95.9%;
|
|
260
|
+
--muted-foreground: 240 3.8% 46.1%;
|
|
261
|
+
--accent: 240 4.8% 95.9%;
|
|
262
|
+
--accent-foreground: 240 5.9% 10%;
|
|
263
|
+
--destructive: 0 84.2% 60.2%;
|
|
264
|
+
--destructive-foreground: 0 0% 98%;
|
|
265
|
+
--border: 240 5.9% 95%;
|
|
266
|
+
--input: 240 5.9% 90%;
|
|
267
|
+
--ring: 240 5.9% 10%;
|
|
268
|
+
--radius: 0.75rem;
|
|
269
|
+
--chart-1: 12 76% 61%;
|
|
270
|
+
--chart-2: 173 58% 39%;
|
|
271
|
+
--chart-3: 197 37% 24%;
|
|
272
|
+
--chart-4: 43 74% 66%;
|
|
273
|
+
--chart-5: 27 87% 67%;
|
|
274
|
+
}
|
|
242
275
|
|
|
243
|
-
|
|
244
|
-
:
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
}
|
|
276
|
+
.dark {
|
|
277
|
+
--background: 240 10% 3.9%;
|
|
278
|
+
--foreground: 0 0% 98%;
|
|
279
|
+
--card: 240 10% 3.9%;
|
|
280
|
+
--card-foreground: 0 0% 98%;
|
|
281
|
+
--popover: 240 10% 3.9%;
|
|
282
|
+
--popover-foreground: 0 0% 98%;
|
|
283
|
+
--primary: 0 0% 98%;
|
|
284
|
+
--primary-foreground: 240 5.9% 10%;
|
|
285
|
+
--secondary: 240 3.7% 15.9%;
|
|
286
|
+
--secondary-foreground: 0 0% 98%;
|
|
287
|
+
--muted: 240 3.7% 15.9%;
|
|
288
|
+
--muted-foreground: 240 5% 64.9%;
|
|
289
|
+
--accent: 240 3.7% 15.9%;
|
|
290
|
+
--accent-foreground: 0 0% 98%;
|
|
291
|
+
--destructive: 0 62.8% 30.6%;
|
|
292
|
+
--destructive-foreground: 0 0% 98%;
|
|
293
|
+
--border: 240 3.7% 15.9%;
|
|
294
|
+
--input: 240 3.7% 15.9%;
|
|
295
|
+
--ring: 240 4.9% 83.9%;
|
|
296
|
+
--chart-1: 220 70% 50%;
|
|
297
|
+
--chart-2: 160 60% 45%;
|
|
298
|
+
--chart-3: 30 80% 55%;
|
|
299
|
+
--chart-4: 280 65% 60%;
|
|
300
|
+
--chart-5: 340 75% 55%;
|
|
301
|
+
}
|
|
302
|
+
}
|
|
271
303
|
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
304
|
+
@layer components {
|
|
305
|
+
.stepper > ol {
|
|
306
|
+
--bullet-size: 1.75rem;
|
|
307
|
+
--line-spacing: 0.25rem;
|
|
308
|
+
@apply flex flex-col list-none p-0 m-0;
|
|
309
|
+
counter-reset: step-counter;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
.stepper > ol > li {
|
|
313
|
+
@apply relative ps-12 pb-6 my-0;
|
|
314
|
+
counter-increment: step-counter;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
.stepper > ol > li:last-child {
|
|
318
|
+
@apply pb-0;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
/* Bullet with number */
|
|
322
|
+
.stepper > ol > li::before {
|
|
323
|
+
@apply absolute left-0 flex items-center justify-center size-[--bullet-size];
|
|
324
|
+
@apply bg-muted/80 border border-border text-muted-foreground text-[calc(var(--bullet-size)/2)] font-semibold rounded-full;
|
|
325
|
+
content: counter(step-counter);
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
/* Vertical line */
|
|
329
|
+
.stepper > ol > li::after {
|
|
330
|
+
@apply absolute content-[''] w-[2px] bg-border -translate-x-1/2;
|
|
331
|
+
left: calc(var(--bullet-size) / 2);
|
|
332
|
+
top: calc(var(--bullet-size) + var(--line-spacing));
|
|
333
|
+
height: calc(100% - var(--bullet-size) - (2 * var(--line-spacing)));
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
.stepper > ol > li > :first-child {
|
|
337
|
+
@apply mt-0 pt-0;
|
|
338
|
+
transform: translateY(calc((var(--bullet-size) - 1lh) / 2));
|
|
298
339
|
}
|
|
299
340
|
}
|
package/src/app/main.tsx
CHANGED
package/src/app/tailwind.ts
CHANGED
|
@@ -28,6 +28,20 @@ const config = (zudokuConfig?: LoadedConfig): Omit<Config, "content"> => {
|
|
|
28
28
|
content,
|
|
29
29
|
theme: {
|
|
30
30
|
extend: {
|
|
31
|
+
keyframes: {
|
|
32
|
+
"bounce-x-start": {
|
|
33
|
+
"0%, 100%": { transform: "translateX(0)" },
|
|
34
|
+
"50%": { transform: "translateX(-25%)" },
|
|
35
|
+
},
|
|
36
|
+
"bounce-x-end": {
|
|
37
|
+
"0%, 100%": { transform: "translateX(0)" },
|
|
38
|
+
"50%": { transform: "translateX(25%)" },
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
animation: {
|
|
42
|
+
"bounce-x-start": "bounce-x-start 1s infinite",
|
|
43
|
+
"bounce-x-end": "bounce-x-end 1s infinite",
|
|
44
|
+
},
|
|
31
45
|
fontFamily: {
|
|
32
46
|
sans,
|
|
33
47
|
mono,
|
|
@@ -4,9 +4,11 @@ export interface AuthenticationProvider {
|
|
|
4
4
|
signUp(options?: { redirectTo?: string }): Promise<void>;
|
|
5
5
|
signIn(options?: { redirectTo?: string }): Promise<void>;
|
|
6
6
|
signOut(): Promise<void>;
|
|
7
|
+
// @deprecated use signRequest instead
|
|
7
8
|
getAccessToken(): Promise<string>;
|
|
8
9
|
getAuthenticationPlugin?(): ZudokuPlugin;
|
|
9
10
|
onPageLoad?(): void;
|
|
11
|
+
signRequest(request: Request): Promise<Request>;
|
|
10
12
|
}
|
|
11
13
|
|
|
12
14
|
export interface AuthenticationProviderInitializer<TConfig> {
|
|
@@ -15,7 +15,9 @@ export const useAuth = () => {
|
|
|
15
15
|
throw new Error("Authentication is not enabled.");
|
|
16
16
|
}
|
|
17
17
|
// TODO: Should handle errors/state
|
|
18
|
-
await authentication.signIn(
|
|
18
|
+
await authentication.signIn({
|
|
19
|
+
redirectTo: window.location.href,
|
|
20
|
+
});
|
|
19
21
|
},
|
|
20
22
|
|
|
21
23
|
logout: async () => {
|
|
@@ -28,5 +30,14 @@ export const useAuth = () => {
|
|
|
28
30
|
// Redirect to home
|
|
29
31
|
window.location.href = "/";
|
|
30
32
|
},
|
|
33
|
+
|
|
34
|
+
signup: async () => {
|
|
35
|
+
if (!isAuthEnabled) {
|
|
36
|
+
throw new Error("Authentication is not enabled.");
|
|
37
|
+
}
|
|
38
|
+
await authentication.signUp({
|
|
39
|
+
redirectTo: window.location.href,
|
|
40
|
+
});
|
|
41
|
+
},
|
|
31
42
|
};
|
|
32
43
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Clerk } from "@clerk/clerk-js";
|
|
2
|
-
import { ClerkAuthenticationConfig } from "../../../config/config.js";
|
|
3
|
-
import { AuthenticationProviderInitializer } from "../authentication.js";
|
|
2
|
+
import { type ClerkAuthenticationConfig } from "../../../config/config.js";
|
|
3
|
+
import { type AuthenticationProviderInitializer } from "../authentication.js";
|
|
4
4
|
import { AuthenticationPlugin } from "../AuthenticationPlugin.js";
|
|
5
5
|
import { useAuthState } from "../state.js";
|
|
6
6
|
|
|
@@ -31,6 +31,9 @@ class ClerkAuthPlugin extends AuthenticationPlugin {
|
|
|
31
31
|
emailVerified: verifiedEmail !== undefined,
|
|
32
32
|
pictureUrl: clerk.session.user.imageUrl,
|
|
33
33
|
},
|
|
34
|
+
providerData: {
|
|
35
|
+
user: clerk.session.user,
|
|
36
|
+
},
|
|
34
37
|
});
|
|
35
38
|
} else {
|
|
36
39
|
useAuthState.setState({
|
|
@@ -74,6 +77,15 @@ const clerkAuth: AuthenticationProviderInitializer<
|
|
|
74
77
|
emailVerified: verifiedEmail !== undefined,
|
|
75
78
|
pictureUrl: clerkApi.user.imageUrl,
|
|
76
79
|
},
|
|
80
|
+
providerData: {
|
|
81
|
+
user: {
|
|
82
|
+
publicMetadata: clerkApi.user.publicMetadata,
|
|
83
|
+
id: clerkApi.user.id,
|
|
84
|
+
emailAddresses: clerkApi.user.emailAddresses,
|
|
85
|
+
imageUrl: clerkApi.user.imageUrl,
|
|
86
|
+
fullName: clerkApi.user.fullName,
|
|
87
|
+
},
|
|
88
|
+
},
|
|
77
89
|
});
|
|
78
90
|
}
|
|
79
91
|
|
|
@@ -92,8 +104,16 @@ const clerkAuth: AuthenticationProviderInitializer<
|
|
|
92
104
|
return response;
|
|
93
105
|
}
|
|
94
106
|
|
|
107
|
+
async function signRequest(request: Request): Promise<Request> {
|
|
108
|
+
const response = await getAccessToken();
|
|
109
|
+
request.headers.set("Authorization", `Bearer ${response}`);
|
|
110
|
+
return request;
|
|
111
|
+
}
|
|
112
|
+
|
|
95
113
|
return {
|
|
114
|
+
clerk: clerkApi,
|
|
96
115
|
getAccessToken,
|
|
116
|
+
signRequest,
|
|
97
117
|
signOut: async () => {
|
|
98
118
|
await ensureLoaded;
|
|
99
119
|
await clerkApi?.signOut({
|
|
@@ -13,6 +13,7 @@ import { AuthorizationError, OAuthAuthorizationError } from "../errors.js";
|
|
|
13
13
|
import { useAuthState, type UserProfile } from "../state.js";
|
|
14
14
|
|
|
15
15
|
const CODE_VERIFIER_KEY = "code-verifier";
|
|
16
|
+
const STATE_KEY = "oauth-state";
|
|
16
17
|
|
|
17
18
|
export interface OpenIdProviderData {
|
|
18
19
|
accessToken: string;
|
|
@@ -172,7 +173,11 @@ export class OpenIDAuthenticationProvider implements AuthenticationProvider {
|
|
|
172
173
|
authorizationServer.authorization_endpoint,
|
|
173
174
|
);
|
|
174
175
|
|
|
175
|
-
|
|
176
|
+
const finalRedirect = redirectTo.startsWith(window.location.origin)
|
|
177
|
+
? redirectTo.slice(window.location.origin.length)
|
|
178
|
+
: redirectTo;
|
|
179
|
+
|
|
180
|
+
sessionStorage.setItem("redirect-to", finalRedirect);
|
|
176
181
|
|
|
177
182
|
const redirectUrl = new URL(window.location.origin);
|
|
178
183
|
redirectUrl.pathname = this.callbackUrlPath;
|
|
@@ -197,16 +202,12 @@ export class OpenIDAuthenticationProvider implements AuthenticationProvider {
|
|
|
197
202
|
});
|
|
198
203
|
|
|
199
204
|
/**
|
|
200
|
-
*
|
|
201
|
-
*
|
|
205
|
+
* The state parameter is used to prevent CSRF attacks and should be used in all authorization requests.
|
|
206
|
+
* It is independent of PKCE and should be used regardless of PKCE support.
|
|
202
207
|
*/
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
) {
|
|
207
|
-
const state = oauth.generateRandomState();
|
|
208
|
-
authorizationUrl.searchParams.set("state", state);
|
|
209
|
-
}
|
|
208
|
+
const state = oauth.generateRandomState();
|
|
209
|
+
sessionStorage.setItem(STATE_KEY, state);
|
|
210
|
+
authorizationUrl.searchParams.set("state", state);
|
|
210
211
|
|
|
211
212
|
// now redirect the user to authorizationUrl.href
|
|
212
213
|
location.href = authorizationUrl.href;
|
|
@@ -254,6 +255,12 @@ export class OpenIDAuthenticationProvider implements AuthenticationProvider {
|
|
|
254
255
|
}
|
|
255
256
|
}
|
|
256
257
|
|
|
258
|
+
signRequest = async (request: Request): Promise<Request> => {
|
|
259
|
+
const accessToken = await this.getAccessToken();
|
|
260
|
+
request.headers.set("Authorization", `Bearer ${accessToken}`);
|
|
261
|
+
return request;
|
|
262
|
+
};
|
|
263
|
+
|
|
257
264
|
signOut = async () => {
|
|
258
265
|
useAuthState.setState({
|
|
259
266
|
isAuthenticated: false,
|
|
@@ -291,6 +298,12 @@ export class OpenIDAuthenticationProvider implements AuthenticationProvider {
|
|
|
291
298
|
handleCallback = async () => {
|
|
292
299
|
const url = new URL(window.location.href);
|
|
293
300
|
const state = url.searchParams.get("state");
|
|
301
|
+
const storedState = sessionStorage.getItem(STATE_KEY);
|
|
302
|
+
sessionStorage.removeItem(STATE_KEY);
|
|
303
|
+
|
|
304
|
+
if (state !== storedState) {
|
|
305
|
+
throw new AuthorizationError("Invalid state parameter");
|
|
306
|
+
}
|
|
294
307
|
|
|
295
308
|
// one eternity later, the user lands back on the redirect_uri
|
|
296
309
|
// Authorization Code Grant Request & Response
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createClient,
|
|
3
|
+
type Provider,
|
|
4
|
+
type Session,
|
|
5
|
+
type SupabaseClient,
|
|
6
|
+
} from "@supabase/supabase-js";
|
|
7
|
+
import { type SupabaseAuthenticationConfig } from "../../../config/config.js";
|
|
8
|
+
import {
|
|
9
|
+
type AuthenticationProvider,
|
|
10
|
+
type AuthenticationProviderInitializer,
|
|
11
|
+
} from "../authentication.js";
|
|
12
|
+
import { AuthenticationPlugin } from "../AuthenticationPlugin.js";
|
|
13
|
+
import { AuthorizationError } from "../errors.js";
|
|
14
|
+
import { useAuthState, type UserProfile } from "../state.js";
|
|
15
|
+
|
|
16
|
+
class SupabaseAuthPlugin extends AuthenticationPlugin {}
|
|
17
|
+
|
|
18
|
+
class SupabaseAuthenticationProvider implements AuthenticationProvider {
|
|
19
|
+
private readonly client: SupabaseClient;
|
|
20
|
+
private readonly provider: Provider;
|
|
21
|
+
private readonly redirectToAfterSignUp: string;
|
|
22
|
+
private readonly redirectToAfterSignIn: string;
|
|
23
|
+
private readonly redirectToAfterSignOut: string;
|
|
24
|
+
|
|
25
|
+
constructor({
|
|
26
|
+
supabaseUrl,
|
|
27
|
+
supabaseKey,
|
|
28
|
+
provider,
|
|
29
|
+
redirectToAfterSignUp,
|
|
30
|
+
redirectToAfterSignIn,
|
|
31
|
+
redirectToAfterSignOut,
|
|
32
|
+
basePath,
|
|
33
|
+
}: SupabaseAuthenticationConfig) {
|
|
34
|
+
this.provider = provider;
|
|
35
|
+
this.client = createClient(supabaseUrl, supabaseKey, {
|
|
36
|
+
auth: {
|
|
37
|
+
autoRefreshToken: true,
|
|
38
|
+
persistSession: true,
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
const root = basePath ?? "/";
|
|
43
|
+
|
|
44
|
+
this.redirectToAfterSignUp = redirectToAfterSignUp ?? root;
|
|
45
|
+
this.redirectToAfterSignIn = redirectToAfterSignIn ?? root;
|
|
46
|
+
this.redirectToAfterSignOut = redirectToAfterSignOut ?? root;
|
|
47
|
+
|
|
48
|
+
this.client.auth.onAuthStateChange(async (event, session) => {
|
|
49
|
+
if (session && (event === "SIGNED_IN" || event === "TOKEN_REFRESHED")) {
|
|
50
|
+
await this.updateUserState(session);
|
|
51
|
+
} else if (event === "SIGNED_OUT") {
|
|
52
|
+
useAuthState.setState({
|
|
53
|
+
isAuthenticated: false,
|
|
54
|
+
isPending: false,
|
|
55
|
+
profile: undefined,
|
|
56
|
+
providerData: undefined,
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
private async updateUserState(session: Session) {
|
|
63
|
+
const { user } = session;
|
|
64
|
+
|
|
65
|
+
const profile: UserProfile = {
|
|
66
|
+
sub: user.id,
|
|
67
|
+
email: user.email,
|
|
68
|
+
name: user.user_metadata.full_name || user.user_metadata.name,
|
|
69
|
+
emailVerified: user.email_confirmed_at != null,
|
|
70
|
+
pictureUrl: user.user_metadata.avatar_url,
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
useAuthState.setState({
|
|
74
|
+
isAuthenticated: true,
|
|
75
|
+
isPending: false,
|
|
76
|
+
profile,
|
|
77
|
+
providerData: { session },
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
async getAccessToken(): Promise<string> {
|
|
82
|
+
const { data, error } = await this.client.auth.getSession();
|
|
83
|
+
|
|
84
|
+
if (error || !data.session) {
|
|
85
|
+
throw new AuthorizationError("User is not authenticated");
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
return data.session.access_token;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
async signRequest(request: Request): Promise<Request> {
|
|
92
|
+
const accessToken = await this.getAccessToken();
|
|
93
|
+
request.headers.set("Authorization", `Bearer ${accessToken}`);
|
|
94
|
+
return request;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
signUp = async ({ redirectTo }: { redirectTo?: string }) => {
|
|
98
|
+
const finalRedirectTo = redirectTo ?? this.redirectToAfterSignUp;
|
|
99
|
+
|
|
100
|
+
// Open Supabase Auth UI in a new window
|
|
101
|
+
await this.client.auth.signInWithOAuth({
|
|
102
|
+
provider: this.provider,
|
|
103
|
+
options: {
|
|
104
|
+
redirectTo: window.location.origin + finalRedirectTo,
|
|
105
|
+
},
|
|
106
|
+
});
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
signIn = async ({ redirectTo }: { redirectTo?: string }) => {
|
|
110
|
+
const finalRedirectTo = redirectTo ?? this.redirectToAfterSignIn;
|
|
111
|
+
|
|
112
|
+
await this.client.auth.signInWithOAuth({
|
|
113
|
+
provider: this.provider,
|
|
114
|
+
options: {
|
|
115
|
+
redirectTo: window.location.origin + finalRedirectTo,
|
|
116
|
+
queryParams: {
|
|
117
|
+
access_type: "offline",
|
|
118
|
+
prompt: "consent",
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
});
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
signOut = async () => {
|
|
125
|
+
await new Promise<void>((resolve) => {
|
|
126
|
+
const { data } = this.client.auth.onAuthStateChange(async (event) => {
|
|
127
|
+
if (event !== "SIGNED_OUT") return;
|
|
128
|
+
data.subscription.unsubscribe();
|
|
129
|
+
resolve();
|
|
130
|
+
});
|
|
131
|
+
void this.client.auth.signOut();
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
useAuthState.setState({
|
|
135
|
+
isAuthenticated: false,
|
|
136
|
+
isPending: false,
|
|
137
|
+
profile: undefined,
|
|
138
|
+
providerData: undefined,
|
|
139
|
+
});
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
getAuthenticationPlugin = () => new SupabaseAuthPlugin();
|
|
143
|
+
|
|
144
|
+
onPageLoad = async () => {
|
|
145
|
+
const { data, error } = await this.client.auth.getSession();
|
|
146
|
+
|
|
147
|
+
if (!error && data.session) {
|
|
148
|
+
await this.updateUserState(data.session);
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
const supabaseAuth: AuthenticationProviderInitializer<
|
|
154
|
+
SupabaseAuthenticationConfig
|
|
155
|
+
> = (options) => new SupabaseAuthenticationProvider(options);
|
|
156
|
+
|
|
157
|
+
export default supabaseAuth;
|