zudoku 0.0.0-fix-firebase-export.2e421fda → 0.0.0-monetization-standalone.z07361713
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app/main.d.ts +6 -6
- package/dist/cli/common/version-check.js +12 -3
- package/dist/cli/common/version-check.js.map +1 -1
- package/dist/config/create-plugin.d.ts +2 -0
- package/dist/config/create-plugin.js +30 -0
- package/dist/config/create-plugin.js.map +1 -0
- package/dist/config/loader.js +3 -1
- package/dist/config/loader.js.map +1 -1
- package/dist/config/validators/InputNavigationSchema.d.ts +77 -75
- package/dist/config/validators/InputNavigationSchema.js +1 -0
- package/dist/config/validators/InputNavigationSchema.js.map +1 -1
- package/dist/config/validators/NavigationSchema.js +6 -1
- package/dist/config/validators/NavigationSchema.js.map +1 -1
- package/dist/config/validators/ProtectedRoutesSchema.d.ts +1 -1
- package/dist/config/validators/validate.d.ts +61 -15
- package/dist/config/validators/validate.js +9 -5
- package/dist/config/validators/validate.js.map +1 -1
- package/dist/flat-config.d.ts +30 -27
- package/dist/index.d.ts +3 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/auth/issuer.js +1 -1
- package/dist/lib/auth/issuer.js.map +1 -1
- package/dist/lib/authentication/authentication.d.ts +3 -2
- package/dist/lib/authentication/components/CallbackHandler.js +1 -1
- package/dist/lib/authentication/components/CallbackHandler.js.map +1 -1
- package/dist/lib/authentication/components/SignIn.js +4 -2
- package/dist/lib/authentication/components/SignIn.js.map +1 -1
- package/dist/lib/authentication/components/SignUp.js +4 -2
- package/dist/lib/authentication/components/SignUp.js.map +1 -1
- package/dist/lib/authentication/hook.d.ts +2 -0
- package/dist/lib/authentication/hook.js +10 -0
- package/dist/lib/authentication/hook.js.map +1 -1
- package/dist/lib/authentication/providers/auth0.js +11 -7
- package/dist/lib/authentication/providers/auth0.js.map +1 -1
- package/dist/lib/authentication/providers/clerk.js +0 -22
- package/dist/lib/authentication/providers/clerk.js.map +1 -1
- package/dist/lib/authentication/providers/firebase.js +67 -9
- package/dist/lib/authentication/providers/firebase.js.map +1 -1
- package/dist/lib/authentication/providers/supabase.js +6 -15
- package/dist/lib/authentication/providers/supabase.js.map +1 -1
- package/dist/lib/authentication/ui/EmailVerificationUi.d.ts +4 -0
- package/dist/lib/authentication/ui/EmailVerificationUi.js +34 -0
- package/dist/lib/authentication/ui/EmailVerificationUi.js.map +1 -0
- package/dist/lib/authentication/ui/ZudokuAuthUi.d.ts +7 -2
- package/dist/lib/authentication/ui/ZudokuAuthUi.js +48 -12
- package/dist/lib/authentication/ui/ZudokuAuthUi.js.map +1 -1
- package/dist/lib/authentication/utils/relativeRedirectUrl.d.ts +1 -0
- package/dist/lib/authentication/utils/relativeRedirectUrl.js +8 -0
- package/dist/lib/authentication/utils/relativeRedirectUrl.js.map +1 -0
- package/dist/lib/components/Bootstrap.js +1 -2
- package/dist/lib/components/Bootstrap.js.map +1 -1
- package/dist/lib/components/Pagination.js +2 -2
- package/dist/lib/components/Pagination.js.map +1 -1
- package/dist/lib/components/Zudoku.js +2 -5
- package/dist/lib/components/Zudoku.js.map +1 -1
- package/dist/lib/components/context/ZudokuContext.d.ts +2 -4
- package/dist/lib/components/context/ZudokuContext.js +2 -2
- package/dist/lib/components/context/ZudokuContext.js.map +1 -1
- package/dist/lib/components/context/ZudokuProvider.js +1 -1
- package/dist/lib/components/context/ZudokuProvider.js.map +1 -1
- package/dist/lib/components/context/ZudokuReactContext.d.ts +11 -0
- package/dist/lib/components/context/ZudokuReactContext.js +4 -0
- package/dist/lib/components/context/ZudokuReactContext.js.map +1 -0
- package/dist/lib/components/index.d.ts +5 -0
- package/dist/lib/components/index.js +4 -0
- package/dist/lib/components/index.js.map +1 -1
- package/dist/lib/components/navigation/NavigationItem.js +2 -2
- package/dist/lib/components/navigation/NavigationItem.js.map +1 -1
- package/dist/lib/core/RouteGuard.js +12 -7
- package/dist/lib/core/RouteGuard.js.map +1 -1
- package/dist/lib/core/plugins.d.ts +11 -1
- package/dist/lib/core/plugins.js +1 -0
- package/dist/lib/core/plugins.js.map +1 -1
- package/dist/lib/core/react-query.d.ts +1 -0
- package/dist/lib/core/react-query.js +2 -0
- package/dist/lib/core/react-query.js.map +1 -0
- package/dist/lib/core/transform-config.d.ts +2 -0
- package/dist/lib/core/transform-config.js +22 -0
- package/dist/lib/core/transform-config.js.map +1 -0
- package/dist/lib/errors/ErrorAlert.js +1 -2
- package/dist/lib/errors/ErrorAlert.js.map +1 -1
- package/dist/lib/errors/ErrorMessage.d.ts +3 -0
- package/dist/lib/errors/ErrorMessage.js +16 -0
- package/dist/lib/errors/ErrorMessage.js.map +1 -0
- package/dist/lib/hooks/index.d.ts +2 -0
- package/dist/lib/oas/graphql/circular.d.ts +2 -0
- package/dist/lib/oas/graphql/circular.js +32 -10
- package/dist/lib/oas/graphql/circular.js.map +1 -1
- package/dist/lib/oas/graphql/circular.test.d.ts +1 -0
- package/dist/lib/oas/graphql/circular.test.js +152 -0
- package/dist/lib/oas/graphql/circular.test.js.map +1 -0
- package/dist/lib/oas/graphql/index.js +7 -3
- package/dist/lib/oas/graphql/index.js.map +1 -1
- package/dist/lib/plugins/api-keys/SettingsApiKeys.js +9 -172
- package/dist/lib/plugins/api-keys/SettingsApiKeys.js.map +1 -1
- package/dist/lib/plugins/api-keys/index.d.ts +11 -4
- package/dist/lib/plugins/api-keys/index.js +36 -22
- package/dist/lib/plugins/api-keys/index.js.map +1 -1
- package/dist/lib/plugins/api-keys/settings/ApiKeyItem.d.ts +12 -0
- package/dist/lib/plugins/api-keys/settings/ApiKeyItem.js +133 -0
- package/dist/lib/plugins/api-keys/settings/ApiKeyItem.js.map +1 -0
- package/dist/lib/plugins/api-keys/settings/ApiKeyList.d.ts +4 -0
- package/dist/lib/plugins/api-keys/settings/ApiKeyList.js +33 -0
- package/dist/lib/plugins/api-keys/settings/ApiKeyList.js.map +1 -0
- package/dist/lib/plugins/api-keys/settings/RevealApiKey.d.ts +6 -0
- package/dist/lib/plugins/api-keys/settings/RevealApiKey.js +39 -0
- package/dist/lib/plugins/api-keys/settings/RevealApiKey.js.map +1 -0
- package/dist/lib/plugins/openapi/OasProvider.js +6 -2
- package/dist/lib/plugins/openapi/OasProvider.js.map +1 -1
- package/dist/lib/plugins/openapi/OperationList.js +4 -4
- package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
- package/dist/lib/plugins/openapi/ParamInfos.js +1 -0
- package/dist/lib/plugins/openapi/ParamInfos.js.map +1 -1
- package/dist/lib/plugins/openapi/Sidecar.js +3 -2
- package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
- package/dist/lib/plugins/openapi/interfaces.d.ts +3 -0
- package/dist/lib/plugins/openapi/schema/SchemaView.js +1 -1
- package/dist/lib/plugins/openapi/schema/SchemaView.js.map +1 -1
- package/dist/lib/plugins/openapi/schema/utils.js +11 -3
- package/dist/lib/plugins/openapi/schema/utils.js.map +1 -1
- package/dist/lib/plugins/openapi/util/createHttpSnippet.js +24 -1
- package/dist/lib/plugins/openapi/util/createHttpSnippet.js.map +1 -1
- package/dist/lib/plugins/openapi/util/getRoutes.d.ts +3 -0
- package/dist/lib/plugins/openapi/util/getRoutes.js +2 -1
- package/dist/lib/plugins/openapi/util/getRoutes.js.map +1 -1
- package/dist/lib/ui/Button.js +1 -1
- package/dist/lib/ui/Button.js.map +1 -1
- package/dist/lib/ui/Command.d.ts +3 -3
- package/dist/lib/ui/Secret.js +2 -2
- package/dist/lib/ui/Secret.js.map +1 -1
- package/dist/lib/util/invariant.d.ts +1 -1
- package/dist/lib/util/invariant.js +2 -2
- package/dist/lib/util/invariant.js.map +1 -1
- package/dist/vite/api/SchemaManager.d.ts +12 -1
- package/dist/vite/api/SchemaManager.js +31 -14
- package/dist/vite/api/SchemaManager.js.map +1 -1
- package/dist/vite/api/SchemaManager.test.js +44 -0
- package/dist/vite/api/SchemaManager.test.js.map +1 -1
- package/dist/vite/config.js +10 -4
- package/dist/vite/config.js.map +1 -1
- package/dist/vite/error-handler.js +1 -5
- package/dist/vite/error-handler.js.map +1 -1
- package/dist/vite/mdx/remark-link-rewrite.js +1 -1
- package/dist/vite/plugin-api-keys.js +5 -1
- package/dist/vite/plugin-api-keys.js.map +1 -1
- package/dist/vite/plugin-api.js +5 -3
- package/dist/vite/plugin-api.js.map +1 -1
- package/dist/vite/plugin-markdown-export.js +1 -1
- package/dist/vite/plugin-markdown-export.js.map +1 -1
- package/dist/vite/plugin-theme.js +2 -1
- package/dist/vite/plugin-theme.js.map +1 -1
- package/dist/vite/prerender/utils.js +9 -3
- package/dist/vite/prerender/utils.js.map +1 -1
- package/dist/vite/prerender/worker.js +3 -0
- package/dist/vite/prerender/worker.js.map +1 -1
- package/dist/vite/zuplo.d.ts +13 -0
- package/dist/vite/zuplo.js +15 -0
- package/dist/vite/zuplo.js.map +1 -0
- package/lib/{ActionButton-DUgvSylL.js → ActionButton-B0CXL1Lq.js} +3 -3
- package/lib/{ActionButton-DUgvSylL.js.map → ActionButton-B0CXL1Lq.js.map} +1 -1
- package/lib/{Button-CynVW1JV.js → Button-GUVe7pmt.js} +8 -7
- package/lib/{Button-CynVW1JV.js.map → Button-GUVe7pmt.js.map} +1 -1
- package/lib/{Card-KFniaZn5.js → Card-DCdq37aA.js} +2 -2
- package/lib/{Card-KFniaZn5.js.map → Card-DCdq37aA.js.map} +1 -1
- package/lib/{ClaudeLogo-B4Xxt-x_.js → ClaudeLogo-CUaQXKLK.js} +22 -22
- package/lib/ClaudeLogo-CUaQXKLK.js.map +1 -0
- package/lib/{Command-BpT1iBE6.js → Command-N6VujV30.js} +3 -3
- package/lib/{Command-BpT1iBE6.js.map → Command-N6VujV30.js.map} +1 -1
- package/lib/{Dialog-BQciPiHN.js → Dialog-hlvmmQ_c.js} +2 -2
- package/lib/{Dialog-BQciPiHN.js.map → Dialog-hlvmmQ_c.js.map} +1 -1
- package/lib/{Drawer-Ci7XwhqT.js → Drawer-Ch7927PF.js} +7 -7
- package/lib/{Drawer-Ci7XwhqT.js.map → Drawer-Ch7927PF.js.map} +1 -1
- package/lib/{DropdownMenu-C8SX_-S_.js → DropdownMenu-DN0jNrjj.js} +2 -2
- package/lib/{DropdownMenu-C8SX_-S_.js.map → DropdownMenu-DN0jNrjj.js.map} +1 -1
- package/lib/Frame-DKlOmSkU.js +205 -0
- package/lib/Frame-DKlOmSkU.js.map +1 -0
- package/lib/HydrationBoundary-CNF2ZV3E.js +601 -0
- package/lib/HydrationBoundary-CNF2ZV3E.js.map +1 -0
- package/lib/{IndexingDialog-B5zCiUKr.js → IndexingDialog-D0YdGfbn.js} +3 -3
- package/lib/{IndexingDialog-B5zCiUKr.js.map → IndexingDialog-D0YdGfbn.js.map} +1 -1
- package/lib/Input-Cx-GeKoF.js +22 -0
- package/lib/Input-Cx-GeKoF.js.map +1 -0
- package/lib/{MdxPage-BagO2c-n.js → MdxPage-BiAVpP8K.js} +11 -11
- package/lib/{MdxPage-BagO2c-n.js.map → MdxPage-BiAVpP8K.js.map} +1 -1
- package/lib/{Mermaid-D_VSX7_Q.js → Mermaid-DEztDKFw.js} +4 -4
- package/lib/{Mermaid-D_VSX7_Q.js.map → Mermaid-DEztDKFw.js.map} +1 -1
- package/lib/{OAuthErrorPage-Fq54RLgt.js → OAuthErrorPage-DhJo-O2B.js} +15 -15
- package/lib/OAuthErrorPage-DhJo-O2B.js.map +1 -0
- package/lib/OasProvider-DFMZwyNn.js +48 -0
- package/lib/OasProvider-DFMZwyNn.js.map +1 -0
- package/lib/{OperationList-C0jiEaG5.js → OperationList-CnmLfOuu.js} +1560 -1545
- package/lib/{OperationList-C0jiEaG5.js.map → OperationList-CnmLfOuu.js.map} +1 -1
- package/lib/RouteGuard-CZuPjknT.js +77 -0
- package/lib/RouteGuard-CZuPjknT.js.map +1 -0
- package/lib/{SchemaList-BU0zCHn9.js → SchemaList-B5ikunUd.js} +9 -9
- package/lib/{SchemaList-BU0zCHn9.js.map → SchemaList-B5ikunUd.js.map} +1 -1
- package/lib/SchemaView-rjji7zMf.js +438 -0
- package/lib/SchemaView-rjji7zMf.js.map +1 -0
- package/lib/{Select-CkxXP5I7.js → Secret-BE7V0Vb5.js} +159 -139
- package/lib/Secret-BE7V0Vb5.js.map +1 -0
- package/lib/{Separator-CTPSeW1S.js → Separator-BXt1LYnm.js} +2 -2
- package/lib/{Separator-CTPSeW1S.js.map → Separator-BXt1LYnm.js.map} +1 -1
- package/lib/SignUp-DHWDXat-.js +50 -0
- package/lib/SignUp-DHWDXat-.js.map +1 -0
- package/lib/{SyntaxHighlight-Kdyskw3C.js → SyntaxHighlight-paLQ8NP8.js} +1751 -1725
- package/lib/SyntaxHighlight-paLQ8NP8.js.map +1 -0
- package/lib/{Toc-DJxFPfcS.js → Toc-vMbSQCkj.js} +3 -3
- package/lib/{Toc-DJxFPfcS.js.map → Toc-vMbSQCkj.js.map} +1 -1
- package/lib/ZudokuContext-CnEI8jPU.js +389 -0
- package/lib/ZudokuContext-CnEI8jPU.js.map +1 -0
- package/lib/{___vite-browser-external_commonjs-proxy-Cga3HsWk.js → ___vite-browser-external_commonjs-proxy-BttVsNON.js} +2 -2
- package/lib/___vite-browser-external_commonjs-proxy-BttVsNON.js.map +1 -0
- package/lib/chunk-EPOLDU6W-C6C8jAwd.js +8558 -0
- package/lib/chunk-EPOLDU6W-C6C8jAwd.js.map +1 -0
- package/lib/{circular-CzWF1hj5.js → circular-CLhJAE3S.js} +771 -749
- package/lib/{circular-CzWF1hj5.js.map → circular-CLhJAE3S.js.map} +1 -1
- package/lib/{cn-dYga0KKN.js → cn-5-Gd1Dss.js} +531 -498
- package/lib/cn-5-Gd1Dss.js.map +1 -0
- package/lib/{createServer-BIr2_tGn.js → createServer-BYtu5Pcr.js} +12 -12
- package/lib/{createServer-BIr2_tGn.js.map → createServer-BYtu5Pcr.js.map} +1 -1
- package/lib/createVariantComponent-Dc0vtOvr.js +18 -0
- package/lib/createVariantComponent-Dc0vtOvr.js.map +1 -0
- package/lib/{errors-Bs4duWDy.js → errors-DkJIl45d.js} +3 -3
- package/lib/{errors-Bs4duWDy.js.map → errors-DkJIl45d.js.map} +1 -1
- package/lib/{firebase-Cax7HPzn.js → firebase-CmsW0j7-.js} +1579 -1325
- package/lib/firebase-CmsW0j7-.js.map +1 -0
- package/lib/hook-Da8QTnPd.js +52 -0
- package/lib/hook-Da8QTnPd.js.map +1 -0
- package/lib/{index-Css56y3F.js → index-Ba6RP577.js} +4 -4
- package/lib/{index-Css56y3F.js.map → index-Ba6RP577.js.map} +1 -1
- package/lib/index-CrcNWbel.js.map +1 -1
- package/lib/{index-Bh-MffiL.js → index-D35F-SCL.js} +2 -2
- package/lib/{index-Bh-MffiL.js.map → index-D35F-SCL.js.map} +1 -1
- package/lib/{index-0oT9beQN.js → index-k0PVZBYl.js} +155 -151
- package/lib/{index-0oT9beQN.js.map → index-k0PVZBYl.js.map} +1 -1
- package/lib/{ErrorAlert-DrOR8w3f.js → index-ofqkdEjL.js} +5457 -4444
- package/lib/index-ofqkdEjL.js.map +1 -0
- package/lib/index.esm-BYObtETB.js.map +1 -1
- package/lib/{index.esm-DtzT_KoE.js → index.esm-B_0dvNjB.js} +2 -2
- package/lib/{index.esm-DtzT_KoE.js.map → index.esm-B_0dvNjB.js.map} +1 -1
- package/lib/{index.esm-DDENMN4y.js → index.esm-DFzsB75P.js} +16 -14
- package/lib/index.esm-DFzsB75P.js.map +1 -0
- package/lib/{invariant-CGOLuIIz.js → invariant-BJAl77rw.js} +4 -4
- package/lib/invariant-BJAl77rw.js.map +1 -0
- package/lib/jsx-runtime-BzflLqGi.js.map +1 -1
- package/lib/{mutation-BoVlx8yA.js → mutation-BISOc7OM.js} +70 -44
- package/lib/mutation-BISOc7OM.js.map +1 -0
- package/lib/ui/Accordion.js +1 -1
- package/lib/ui/ActionButton.js +2 -2
- package/lib/ui/Alert.js +1 -1
- package/lib/ui/AlertDialog.js +1 -1
- package/lib/ui/Badge.js +1 -1
- package/lib/ui/Breadcrumb.js +1 -1
- package/lib/ui/Button.js +7 -6
- package/lib/ui/Button.js.map +1 -1
- package/lib/ui/ButtonGroup.js +1 -1
- package/lib/ui/Callout.js +1 -1
- package/lib/ui/Card.js +1 -1
- package/lib/ui/Carousel.js +1 -1
- package/lib/ui/Carousel.js.map +1 -1
- package/lib/ui/Checkbox.js +1 -1
- package/lib/ui/CodeBlock.js +1 -1
- package/lib/ui/Command.js +2 -2
- package/lib/ui/Dialog.js +1 -1
- package/lib/ui/Drawer.js +3 -3
- package/lib/ui/DropdownMenu.js +1 -1
- package/lib/ui/EmbeddedCodeBlock.js +1 -1
- package/lib/ui/Form.js +1 -1
- package/lib/ui/Frame.js +1 -1
- package/lib/ui/HoverCard.js +1 -1
- package/lib/ui/Input.js +1 -1
- package/lib/ui/Item.js +1 -1
- package/lib/ui/Label.js +1 -1
- package/lib/ui/NativeSelect.js +1 -1
- package/lib/ui/Pagination.js +1 -1
- package/lib/ui/Popover.js +1 -1
- package/lib/ui/Progress.js +1 -1
- package/lib/ui/RadioGroup.js +1 -1
- package/lib/ui/ScrollArea.js +1 -1
- package/lib/ui/Secret.js +3 -3
- package/lib/ui/Secret.js.map +1 -1
- package/lib/ui/Separator.js +1 -1
- package/lib/ui/Skeleton.js +1 -1
- package/lib/ui/Slider.js +1 -1
- package/lib/ui/Switch.js +1 -1
- package/lib/ui/SyntaxHighlight.js +3 -3
- package/lib/ui/Tabs.js +1 -1
- package/lib/ui/Textarea.js +1 -1
- package/lib/ui/Toggle.js +1 -1
- package/lib/ui/ToggleGroup.js +1 -1
- package/lib/ui/Value.js +1 -1
- package/lib/ui/util.js +1 -1
- package/lib/{useMutation-C6RqWmTS.js → useMutation-CFMGlAMW.js} +39 -17
- package/lib/useMutation-CFMGlAMW.js.map +1 -0
- package/lib/useSuspenseQuery-CSB_rVek.js +1226 -0
- package/lib/useSuspenseQuery-CSB_rVek.js.map +1 -0
- package/lib/zudoku.__internal.js +826 -1325
- package/lib/zudoku.__internal.js.map +1 -1
- package/lib/zudoku.auth-auth0.js +16 -16
- package/lib/zudoku.auth-auth0.js.map +1 -1
- package/lib/zudoku.auth-azureb2c.js +4 -4
- package/lib/zudoku.auth-clerk.js +52 -75
- package/lib/zudoku.auth-clerk.js.map +1 -1
- package/lib/zudoku.auth-firebase.js +6 -5
- package/lib/zudoku.auth-firebase.js.map +1 -1
- package/lib/zudoku.auth-openid.js +5 -5
- package/lib/zudoku.auth-supabase.js +31 -40
- package/lib/zudoku.auth-supabase.js.map +1 -1
- package/lib/zudoku.components.js +23 -21
- package/lib/zudoku.hooks.js +3 -3
- package/lib/zudoku.mermaid.js +3 -3
- package/lib/zudoku.plugin-api-catalog.js +8 -8
- package/lib/zudoku.plugin-api-keys.js +607 -552
- package/lib/zudoku.plugin-api-keys.js.map +1 -1
- package/lib/zudoku.plugin-custom-pages.js +1 -1
- package/lib/zudoku.plugin-markdown.js +1 -1
- package/lib/zudoku.plugin-openapi.js +3 -3
- package/lib/zudoku.plugin-redirect.js +1 -1
- package/lib/zudoku.plugin-search-pagefind.js +30 -29
- package/lib/zudoku.plugin-search-pagefind.js.map +1 -1
- package/lib/zudoku.plugins.js +9 -8
- package/lib/zudoku.plugins.js.map +1 -1
- package/lib/zudoku.react-query.js +440 -0
- package/lib/zudoku.react-query.js.map +1 -0
- package/lib/zudoku.router.js +1130 -1404
- package/lib/zudoku.router.js.map +1 -1
- package/package.json +36 -22
- package/src/lib/auth/issuer.ts +1 -1
- package/src/lib/authentication/authentication.ts +8 -2
- package/src/lib/authentication/components/CallbackHandler.tsx +1 -1
- package/src/lib/authentication/components/SignIn.tsx +5 -2
- package/src/lib/authentication/components/SignUp.tsx +5 -2
- package/src/lib/authentication/hook.ts +16 -0
- package/src/lib/authentication/providers/auth0.tsx +15 -9
- package/src/lib/authentication/providers/clerk.tsx +0 -26
- package/src/lib/authentication/providers/firebase.tsx +98 -6
- package/src/lib/authentication/providers/supabase.tsx +6 -15
- package/src/lib/authentication/ui/EmailVerificationUi.tsx +129 -0
- package/src/lib/authentication/ui/ZudokuAuthUi.tsx +181 -39
- package/src/lib/authentication/utils/relativeRedirectUrl.ts +12 -0
- package/src/lib/components/Bootstrap.tsx +1 -4
- package/src/lib/components/Pagination.tsx +4 -5
- package/src/lib/components/Zudoku.tsx +5 -11
- package/src/lib/components/context/ZudokuContext.ts +2 -6
- package/src/lib/components/context/ZudokuProvider.tsx +1 -1
- package/src/lib/components/context/ZudokuReactContext.tsx +17 -0
- package/src/lib/components/index.ts +4 -0
- package/src/lib/components/navigation/NavigationItem.tsx +9 -3
- package/src/lib/core/RouteGuard.tsx +30 -24
- package/src/lib/core/plugins.ts +21 -1
- package/src/lib/core/react-query.ts +1 -0
- package/src/lib/core/transform-config.ts +29 -0
- package/src/lib/errors/ErrorAlert.tsx +1 -6
- package/src/lib/errors/ErrorMessage.tsx +38 -0
- package/src/lib/oas/graphql/circular.test.ts +186 -0
- package/src/lib/oas/graphql/circular.ts +49 -10
- package/src/lib/oas/graphql/index.ts +7 -3
- package/src/lib/plugins/api-keys/SettingsApiKeys.tsx +36 -476
- package/src/lib/plugins/api-keys/index.tsx +76 -32
- package/src/lib/plugins/api-keys/settings/ApiKeyItem.tsx +342 -0
- package/src/lib/plugins/api-keys/settings/ApiKeyList.tsx +67 -0
- package/src/lib/plugins/api-keys/settings/RevealApiKey.tsx +124 -0
- package/src/lib/plugins/openapi/OasProvider.tsx +10 -2
- package/src/lib/plugins/openapi/OperationList.tsx +4 -4
- package/src/lib/plugins/openapi/ParamInfos.tsx +1 -0
- package/src/lib/plugins/openapi/Sidecar.tsx +3 -2
- package/src/lib/plugins/openapi/interfaces.ts +6 -1
- package/src/lib/plugins/openapi/schema/SchemaView.tsx +6 -4
- package/src/lib/plugins/openapi/schema/utils.ts +15 -4
- package/src/lib/plugins/openapi/util/createHttpSnippet.ts +29 -1
- package/src/lib/plugins/openapi/util/getRoutes.tsx +4 -1
- package/src/lib/ui/Button.tsx +1 -0
- package/src/lib/ui/Secret.tsx +2 -2
- package/src/lib/util/invariant.ts +2 -1
- package/src/shiki/langs/c3.js +1 -0
- package/src/shiki/langs/gn.js +1 -0
- package/src/shiki/langs/moonbit.js +1 -0
- package/lib/ClaudeLogo-B4Xxt-x_.js.map +0 -1
- package/lib/ErrorAlert-DrOR8w3f.js.map +0 -1
- package/lib/OAuthErrorPage-Fq54RLgt.js.map +0 -1
- package/lib/OasProvider-DPH8mwDa.js +0 -40
- package/lib/OasProvider-DPH8mwDa.js.map +0 -1
- package/lib/RouteGuard-9wjejsKm.js +0 -77
- package/lib/RouteGuard-9wjejsKm.js.map +0 -1
- package/lib/RouterError-DSLXagd5.js +0 -42
- package/lib/RouterError-DSLXagd5.js.map +0 -1
- package/lib/SchemaView-DVae4RO2.js +0 -597
- package/lib/SchemaView-DVae4RO2.js.map +0 -1
- package/lib/Select-CkxXP5I7.js.map +0 -1
- package/lib/SignUp-BjS4ozA7.js +0 -50
- package/lib/SignUp-BjS4ozA7.js.map +0 -1
- package/lib/SyntaxHighlight-Kdyskw3C.js.map +0 -1
- package/lib/ZudokuContext-BXldanA8.js +0 -1508
- package/lib/ZudokuContext-BXldanA8.js.map +0 -1
- package/lib/___vite-browser-external_commonjs-proxy-Cga3HsWk.js.map +0 -1
- package/lib/chunk-PVWAREVJ-dLIqswPy.js +0 -7965
- package/lib/chunk-PVWAREVJ-dLIqswPy.js.map +0 -1
- package/lib/cn-dYga0KKN.js.map +0 -1
- package/lib/createVariantComponent-B9_dVBvu.js +0 -35
- package/lib/createVariantComponent-B9_dVBvu.js.map +0 -1
- package/lib/firebase-Cax7HPzn.js.map +0 -1
- package/lib/hook-BNxidGQq.js +0 -40
- package/lib/hook-BNxidGQq.js.map +0 -1
- package/lib/index-CCmMJp02.js +0 -1059
- package/lib/index-CCmMJp02.js.map +0 -1
- package/lib/index.esm-DDENMN4y.js.map +0 -1
- package/lib/invariant-CGOLuIIz.js.map +0 -1
- package/lib/mutation-BoVlx8yA.js.map +0 -1
- package/lib/useMutation-C6RqWmTS.js.map +0 -1
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { useMutation, useQuery } from "@tanstack/react-query";
|
|
2
|
+
import { CheckIcon, MailCheck, RefreshCw } from "lucide-react";
|
|
3
|
+
import { Navigate, useSearchParams } from "react-router";
|
|
4
|
+
import { ActionButton } from "zudoku/ui/ActionButton.js";
|
|
5
|
+
import { Alert, AlertDescription, AlertTitle } from "zudoku/ui/Alert.js";
|
|
6
|
+
import { Button } from "zudoku/ui/Button.js";
|
|
7
|
+
import {
|
|
8
|
+
Card,
|
|
9
|
+
CardContent,
|
|
10
|
+
CardDescription,
|
|
11
|
+
CardHeader,
|
|
12
|
+
CardTitle,
|
|
13
|
+
} from "zudoku/ui/Card.js";
|
|
14
|
+
import createVariantComponent from "../../util/createVariantComponent.js";
|
|
15
|
+
import { getRelativeRedirectUrl } from "../utils/relativeRedirectUrl.js";
|
|
16
|
+
|
|
17
|
+
export const EmailVerificationUi = ({
|
|
18
|
+
onResendVerification,
|
|
19
|
+
onCheckVerification,
|
|
20
|
+
}: {
|
|
21
|
+
onResendVerification: () => Promise<void>;
|
|
22
|
+
onCheckVerification: () => Promise<boolean>;
|
|
23
|
+
}) => {
|
|
24
|
+
const [searchParams] = useSearchParams();
|
|
25
|
+
const redirectTo = searchParams.get("redirectTo");
|
|
26
|
+
const relativeRedirectTo = getRelativeRedirectUrl(redirectTo);
|
|
27
|
+
|
|
28
|
+
const resendMutation = useMutation({
|
|
29
|
+
mutationFn: async () => {
|
|
30
|
+
await onResendVerification();
|
|
31
|
+
},
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
const checkVerificationMutation = useQuery({
|
|
35
|
+
queryKey: ["check-verification"],
|
|
36
|
+
queryFn: async () => {
|
|
37
|
+
const isVerified = await onCheckVerification();
|
|
38
|
+
return isVerified;
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
const error = resendMutation.error ?? checkVerificationMutation.error ?? null;
|
|
43
|
+
|
|
44
|
+
return (
|
|
45
|
+
<AuthCard>
|
|
46
|
+
{checkVerificationMutation.data === true && (
|
|
47
|
+
<Navigate to={relativeRedirectTo} />
|
|
48
|
+
)}
|
|
49
|
+
<CardHeader className="text-center">
|
|
50
|
+
<div className="mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-primary/10">
|
|
51
|
+
<MailCheck className="h-8 w-8 text-primary" />
|
|
52
|
+
</div>
|
|
53
|
+
<CardTitle>Verify your email</CardTitle>
|
|
54
|
+
<CardDescription>We've sent a verification link</CardDescription>
|
|
55
|
+
</CardHeader>
|
|
56
|
+
<CardContent className="flex flex-col gap-4">
|
|
57
|
+
{error && (
|
|
58
|
+
<Alert variant="destructive">
|
|
59
|
+
<AlertTitle>Error</AlertTitle>
|
|
60
|
+
<AlertDescription>{error?.message}</AlertDescription>
|
|
61
|
+
</Alert>
|
|
62
|
+
)}
|
|
63
|
+
|
|
64
|
+
{resendMutation.isSuccess && (
|
|
65
|
+
<Alert>
|
|
66
|
+
<AlertTitle>Email sent</AlertTitle>
|
|
67
|
+
<AlertDescription>
|
|
68
|
+
A new verification email has been sent. Please check your inbox.
|
|
69
|
+
</AlertDescription>
|
|
70
|
+
</Alert>
|
|
71
|
+
)}
|
|
72
|
+
|
|
73
|
+
{checkVerificationMutation.isSuccess &&
|
|
74
|
+
!checkVerificationMutation.data && (
|
|
75
|
+
<Alert>
|
|
76
|
+
<AlertDescription>
|
|
77
|
+
{checkVerificationMutation.isFetching
|
|
78
|
+
? "Checking verification..."
|
|
79
|
+
: "Your email hasn't been verified yet. Please check your inbox and click the verification link."}
|
|
80
|
+
</AlertDescription>
|
|
81
|
+
</Alert>
|
|
82
|
+
)}
|
|
83
|
+
|
|
84
|
+
<div className="space-y-4">
|
|
85
|
+
<ActionButton
|
|
86
|
+
onClick={() => void checkVerificationMutation.refetch()}
|
|
87
|
+
isPending={checkVerificationMutation.isFetching}
|
|
88
|
+
className="w-full"
|
|
89
|
+
>
|
|
90
|
+
<div className="flex items-center gap-2">
|
|
91
|
+
<CheckIcon className="h-4 w-4" /> Continue
|
|
92
|
+
</div>
|
|
93
|
+
</ActionButton>
|
|
94
|
+
|
|
95
|
+
<div className="relative">
|
|
96
|
+
<div className="absolute inset-0 flex items-center">
|
|
97
|
+
<span className="w-full border-t" />
|
|
98
|
+
</div>
|
|
99
|
+
<div className="relative flex justify-center text-sm">
|
|
100
|
+
<span className="bg-card px-2 text-muted-foreground">
|
|
101
|
+
Didn't receive the email?
|
|
102
|
+
</span>
|
|
103
|
+
</div>
|
|
104
|
+
</div>
|
|
105
|
+
|
|
106
|
+
<Button
|
|
107
|
+
variant="outline"
|
|
108
|
+
onClick={() => void resendMutation.mutate()}
|
|
109
|
+
disabled={resendMutation.isPending}
|
|
110
|
+
className="w-full gap-2"
|
|
111
|
+
>
|
|
112
|
+
{resendMutation.isPending ? (
|
|
113
|
+
<RefreshCw className="h-4 w-4 animate-spin" />
|
|
114
|
+
) : (
|
|
115
|
+
<RefreshCw className="h-4 w-4" />
|
|
116
|
+
)}
|
|
117
|
+
Resend verification email
|
|
118
|
+
</Button>
|
|
119
|
+
</div>
|
|
120
|
+
|
|
121
|
+
<p className="text-center text-xs text-muted-foreground">
|
|
122
|
+
Make sure to check your spam folder if you don't see the email.
|
|
123
|
+
</p>
|
|
124
|
+
</CardContent>
|
|
125
|
+
</AuthCard>
|
|
126
|
+
);
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
const AuthCard = createVariantComponent(Card, "max-w-md w-full mt-10 mx-auto");
|
|
@@ -23,6 +23,7 @@ import {
|
|
|
23
23
|
} from "../../ui/Form.js";
|
|
24
24
|
import { cn } from "../../util/cn.js";
|
|
25
25
|
import createVariantComponent from "../../util/createVariantComponent.js";
|
|
26
|
+
import { getRelativeRedirectUrl } from "../utils/relativeRedirectUrl.js";
|
|
26
27
|
import AppleIcon from "./icons/Apple.js";
|
|
27
28
|
import FacebookIcon from "./icons/Facebook.js";
|
|
28
29
|
import GithubIcon from "./icons/Github.js";
|
|
@@ -137,8 +138,10 @@ export const ZudokuSignInUi = ({
|
|
|
137
138
|
providers,
|
|
138
139
|
onOAuthSignIn,
|
|
139
140
|
onUsernamePasswordSignIn,
|
|
141
|
+
enableUsernamePassword,
|
|
140
142
|
}: {
|
|
141
143
|
providers: string[];
|
|
144
|
+
enableUsernamePassword: boolean;
|
|
142
145
|
onOAuthSignIn: (providerId: string) => Promise<void>;
|
|
143
146
|
onUsernamePasswordSignIn: (email: string, password: string) => Promise<void>;
|
|
144
147
|
}) => {
|
|
@@ -146,8 +149,20 @@ export const ZudokuSignInUi = ({
|
|
|
146
149
|
const [searchParams] = useSearchParams();
|
|
147
150
|
const redirectTo = searchParams.get("redirectTo");
|
|
148
151
|
|
|
152
|
+
const relativeRedirectTo = getRelativeRedirectUrl(redirectTo);
|
|
153
|
+
|
|
154
|
+
const invalidProviders = providers.filter(
|
|
155
|
+
(provider) => !isValidAuthProviderId(provider),
|
|
156
|
+
);
|
|
157
|
+
|
|
158
|
+
if (invalidProviders.length > 0) {
|
|
159
|
+
throw new Error(
|
|
160
|
+
`Unsupported auth provider: ${invalidProviders.join(", ")}`,
|
|
161
|
+
);
|
|
162
|
+
}
|
|
163
|
+
|
|
149
164
|
if (!isAuthProviderIdArray(providers)) {
|
|
150
|
-
throw new Error(
|
|
165
|
+
throw new Error(`Unsupported auth provider: ${providers.join(", ")}`);
|
|
151
166
|
}
|
|
152
167
|
|
|
153
168
|
const signInUsernameMutation = useMutation({
|
|
@@ -155,7 +170,7 @@ export const ZudokuSignInUi = ({
|
|
|
155
170
|
await onUsernamePasswordSignIn(email, password);
|
|
156
171
|
},
|
|
157
172
|
onSuccess: () => {
|
|
158
|
-
void navigate(
|
|
173
|
+
void navigate(relativeRedirectTo);
|
|
159
174
|
},
|
|
160
175
|
});
|
|
161
176
|
const signInByProviderMutation = useMutation({
|
|
@@ -163,7 +178,7 @@ export const ZudokuSignInUi = ({
|
|
|
163
178
|
await onOAuthSignIn(providerId);
|
|
164
179
|
},
|
|
165
180
|
onSuccess: () => {
|
|
166
|
-
void navigate(
|
|
181
|
+
void navigate(relativeRedirectTo);
|
|
167
182
|
},
|
|
168
183
|
});
|
|
169
184
|
|
|
@@ -192,24 +207,38 @@ export const ZudokuSignInUi = ({
|
|
|
192
207
|
<AlertDescription>{error?.message}</AlertDescription>
|
|
193
208
|
</Alert>
|
|
194
209
|
)}
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
210
|
+
{enableUsernamePassword && (
|
|
211
|
+
<>
|
|
212
|
+
<EmailPasswordForm
|
|
213
|
+
form={form}
|
|
214
|
+
onSubmit={(data) =>
|
|
215
|
+
void signInUsernameMutation.mutate({
|
|
216
|
+
email: data.email,
|
|
217
|
+
password: data.password,
|
|
218
|
+
})
|
|
219
|
+
}
|
|
220
|
+
submitLabel="Sign in"
|
|
221
|
+
isPending={pending}
|
|
222
|
+
/>
|
|
223
|
+
<Link
|
|
224
|
+
to="/reset-password"
|
|
225
|
+
className="text-sm text-muted-foreground text-right -mt-2"
|
|
226
|
+
>
|
|
227
|
+
Forgot password?
|
|
228
|
+
</Link>
|
|
229
|
+
</>
|
|
230
|
+
)}
|
|
231
|
+
{enableUsernamePassword && providers.length > 0 && (
|
|
232
|
+
<ProviderSeparator providers={providers} />
|
|
233
|
+
)}
|
|
234
|
+
{providers.length > 0 && (
|
|
235
|
+
<ProviderButtons
|
|
236
|
+
providers={providers}
|
|
237
|
+
onClick={(providerId) =>
|
|
238
|
+
signInByProviderMutation.mutate({ providerId })
|
|
239
|
+
}
|
|
240
|
+
/>
|
|
241
|
+
)}
|
|
213
242
|
<Link to="/signup" className="text-sm text-muted-foreground">
|
|
214
243
|
Don't have an account? Sign up.
|
|
215
244
|
</Link>
|
|
@@ -220,13 +249,21 @@ export const ZudokuSignInUi = ({
|
|
|
220
249
|
|
|
221
250
|
export const ZudokuSignUpUi = ({
|
|
222
251
|
providers,
|
|
252
|
+
enableUsernamePassword,
|
|
223
253
|
onOAuthSignUp,
|
|
224
254
|
onUsernamePasswordSignUp,
|
|
225
255
|
}: {
|
|
226
256
|
providers: string[];
|
|
257
|
+
enableUsernamePassword: boolean;
|
|
227
258
|
onOAuthSignUp: (providerId: string) => Promise<void>;
|
|
228
259
|
onUsernamePasswordSignUp: (email: string, password: string) => Promise<void>;
|
|
229
260
|
}) => {
|
|
261
|
+
const navigate = useNavigate();
|
|
262
|
+
const [searchParams] = useSearchParams();
|
|
263
|
+
const redirectTo = searchParams.get("redirectTo");
|
|
264
|
+
|
|
265
|
+
const relativeRedirectTo = redirectTo?.replace(window.location.origin, "");
|
|
266
|
+
|
|
230
267
|
if (!isAuthProviderIdArray(providers)) {
|
|
231
268
|
throw new Error("Invalid auth provider IDs");
|
|
232
269
|
}
|
|
@@ -235,12 +272,18 @@ export const ZudokuSignUpUi = ({
|
|
|
235
272
|
mutationFn: async ({ email, password }: FormFields) => {
|
|
236
273
|
await onUsernamePasswordSignUp(email, password);
|
|
237
274
|
},
|
|
275
|
+
onSuccess: () => {
|
|
276
|
+
void navigate(relativeRedirectTo ?? "/");
|
|
277
|
+
},
|
|
238
278
|
});
|
|
239
279
|
|
|
240
280
|
const signUpByProviderMutation = useMutation({
|
|
241
281
|
mutationFn: async ({ providerId }: { providerId: string }) => {
|
|
242
282
|
await onOAuthSignUp(providerId);
|
|
243
283
|
},
|
|
284
|
+
onSuccess: () => {
|
|
285
|
+
void navigate(relativeRedirectTo ?? "/");
|
|
286
|
+
},
|
|
244
287
|
});
|
|
245
288
|
|
|
246
289
|
const form = useForm<FormFields>({
|
|
@@ -269,24 +312,30 @@ export const ZudokuSignUpUi = ({
|
|
|
269
312
|
</Alert>
|
|
270
313
|
)}
|
|
271
314
|
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
315
|
+
{enableUsernamePassword && (
|
|
316
|
+
<EmailPasswordForm
|
|
317
|
+
form={form}
|
|
318
|
+
onSubmit={(data) =>
|
|
319
|
+
void signUpUsernameMutation.mutate({
|
|
320
|
+
email: data.email,
|
|
321
|
+
password: data.password,
|
|
322
|
+
})
|
|
323
|
+
}
|
|
324
|
+
submitLabel="Sign up"
|
|
325
|
+
isPending={pending}
|
|
326
|
+
/>
|
|
327
|
+
)}
|
|
328
|
+
{enableUsernamePassword && providers.length > 0 && (
|
|
329
|
+
<ProviderSeparator providers={providers} />
|
|
330
|
+
)}
|
|
331
|
+
{providers.length > 0 && (
|
|
332
|
+
<ProviderButtons
|
|
333
|
+
providers={providers}
|
|
334
|
+
onClick={(providerId) =>
|
|
335
|
+
signUpByProviderMutation.mutate({ providerId })
|
|
336
|
+
}
|
|
337
|
+
/>
|
|
338
|
+
)}
|
|
290
339
|
<Link to="/signin" className="text-sm text-muted-foreground">
|
|
291
340
|
Already have an account? Sign in.
|
|
292
341
|
</Link>
|
|
@@ -333,3 +382,96 @@ const ProviderSeparator = ({ providers }: { providers: AuthProviderId[] }) => {
|
|
|
333
382
|
)
|
|
334
383
|
);
|
|
335
384
|
};
|
|
385
|
+
|
|
386
|
+
export const ZudokuPasswordResetUi = ({
|
|
387
|
+
onPasswordReset,
|
|
388
|
+
}: {
|
|
389
|
+
onPasswordReset: (email: string) => Promise<void>;
|
|
390
|
+
}) => {
|
|
391
|
+
const [isSubmitted, setIsSubmitted] = React.useState(false);
|
|
392
|
+
|
|
393
|
+
const passwordResetMutation = useMutation({
|
|
394
|
+
mutationFn: async ({ email }: { email: string }) => {
|
|
395
|
+
await onPasswordReset(email);
|
|
396
|
+
},
|
|
397
|
+
onSuccess: () => {
|
|
398
|
+
setIsSubmitted(true);
|
|
399
|
+
},
|
|
400
|
+
});
|
|
401
|
+
|
|
402
|
+
const form = useForm<{ email: string }>({
|
|
403
|
+
defaultValues: {
|
|
404
|
+
email: "",
|
|
405
|
+
},
|
|
406
|
+
});
|
|
407
|
+
|
|
408
|
+
const error = passwordResetMutation.error;
|
|
409
|
+
|
|
410
|
+
return (
|
|
411
|
+
<AuthCard>
|
|
412
|
+
<CardHeader>
|
|
413
|
+
<CardTitle>Reset password</CardTitle>
|
|
414
|
+
<CardDescription>
|
|
415
|
+
{isSubmitted
|
|
416
|
+
? "Check your email for a password reset link."
|
|
417
|
+
: "Enter your email address and we'll send you a link to reset your password."}
|
|
418
|
+
</CardDescription>
|
|
419
|
+
</CardHeader>
|
|
420
|
+
<CardContent className="flex flex-col gap-4">
|
|
421
|
+
{error && (
|
|
422
|
+
<Alert variant="destructive">
|
|
423
|
+
<AlertTitle>Error</AlertTitle>
|
|
424
|
+
<AlertDescription>{error?.message}</AlertDescription>
|
|
425
|
+
</Alert>
|
|
426
|
+
)}
|
|
427
|
+
{isSubmitted ? (
|
|
428
|
+
<div className="flex flex-col gap-4">
|
|
429
|
+
<Alert>
|
|
430
|
+
<AlertTitle>Email sent</AlertTitle>
|
|
431
|
+
<AlertDescription>
|
|
432
|
+
If an account exists with that email address, you will receive a
|
|
433
|
+
password reset link shortly.
|
|
434
|
+
</AlertDescription>
|
|
435
|
+
</Alert>
|
|
436
|
+
<Link to="/signin">
|
|
437
|
+
<Button variant="outline" className="w-full">
|
|
438
|
+
Back to sign in
|
|
439
|
+
</Button>
|
|
440
|
+
</Link>
|
|
441
|
+
</div>
|
|
442
|
+
) : (
|
|
443
|
+
<>
|
|
444
|
+
<Form {...form}>
|
|
445
|
+
<form
|
|
446
|
+
onSubmit={form.handleSubmit((data) =>
|
|
447
|
+
passwordResetMutation.mutate({ email: data.email }),
|
|
448
|
+
)}
|
|
449
|
+
className="flex flex-col gap-2"
|
|
450
|
+
>
|
|
451
|
+
<FormItem>
|
|
452
|
+
<FormLabel>Email</FormLabel>
|
|
453
|
+
<FormControl>
|
|
454
|
+
<Input
|
|
455
|
+
placeholder="you@example.com"
|
|
456
|
+
{...form.register("email")}
|
|
457
|
+
/>
|
|
458
|
+
</FormControl>
|
|
459
|
+
<FormMessage />
|
|
460
|
+
</FormItem>
|
|
461
|
+
<ActionButton
|
|
462
|
+
type="submit"
|
|
463
|
+
isPending={passwordResetMutation.isPending}
|
|
464
|
+
>
|
|
465
|
+
Reset password
|
|
466
|
+
</ActionButton>
|
|
467
|
+
</form>
|
|
468
|
+
</Form>
|
|
469
|
+
<Link to="/signin" className="text-sm text-muted-foreground">
|
|
470
|
+
Sign in
|
|
471
|
+
</Link>
|
|
472
|
+
</>
|
|
473
|
+
)}
|
|
474
|
+
</CardContent>
|
|
475
|
+
</AuthCard>
|
|
476
|
+
);
|
|
477
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { joinUrl } from "../../util/joinUrl.js";
|
|
2
|
+
|
|
3
|
+
export const getRelativeRedirectUrl = (redirectTo?: string | null) => {
|
|
4
|
+
if (!redirectTo) {
|
|
5
|
+
return "/";
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
return redirectTo.replace(
|
|
9
|
+
joinUrl(window.location.origin, import.meta.env.BASE_URL),
|
|
10
|
+
"",
|
|
11
|
+
);
|
|
12
|
+
};
|
|
@@ -12,7 +12,6 @@ import {
|
|
|
12
12
|
StaticRouterProvider,
|
|
13
13
|
} from "react-router";
|
|
14
14
|
import { RouterProvider } from "react-router/dom";
|
|
15
|
-
import { StaggeredRenderContext } from "../plugins/openapi/StaggeredRender.js";
|
|
16
15
|
import { BypassProtectedRoutesContext } from "./context/BypassProtectedRoutesContext.js";
|
|
17
16
|
|
|
18
17
|
const queryClient = new QueryClient({
|
|
@@ -36,9 +35,7 @@ const Bootstrap = ({
|
|
|
36
35
|
<HydrationBoundary state={hydrate ? (window as any).DATA : undefined}>
|
|
37
36
|
<BypassProtectedRoutesContext value={false}>
|
|
38
37
|
<HelmetProvider>
|
|
39
|
-
<
|
|
40
|
-
<RouterProvider router={router} />
|
|
41
|
-
</StaggeredRenderContext.Provider>
|
|
38
|
+
<RouterProvider router={router} />
|
|
42
39
|
</HelmetProvider>
|
|
43
40
|
</BypassProtectedRoutesContext>
|
|
44
41
|
</HydrationBoundary>
|
|
@@ -13,19 +13,18 @@ export const Pagination = ({
|
|
|
13
13
|
className?: string;
|
|
14
14
|
}) => {
|
|
15
15
|
const linkClass =
|
|
16
|
-
"group transition-all p-5 space-x-1 rtl:space-x-reverse
|
|
17
|
-
|
|
16
|
+
"group min-w-0 transition-all p-5 space-x-1 rtl:space-x-reverse hover:text-foreground";
|
|
18
17
|
return (
|
|
19
18
|
<div
|
|
20
19
|
className={cn(
|
|
21
|
-
"flex -mx-4 text-muted-foreground font-semibold",
|
|
20
|
+
"flex flex-wrap gap-2 -mx-4 text-muted-foreground font-semibold",
|
|
22
21
|
prev ? "justify-between" : "justify-end",
|
|
23
22
|
className,
|
|
24
23
|
)}
|
|
25
24
|
data-pagefind-ignore="all"
|
|
26
25
|
>
|
|
27
26
|
{prev && (
|
|
28
|
-
<Button variant="ghost" asChild>
|
|
27
|
+
<Button variant="ghost" className="min-w-0 max-w-full" asChild>
|
|
29
28
|
<Link to={prev.to} relative="path" className={linkClass}>
|
|
30
29
|
<ArrowLeftIcon size={14} strokeWidth={2.5} />
|
|
31
30
|
<span className="text-lg truncate">{prev.label}</span>
|
|
@@ -33,7 +32,7 @@ export const Pagination = ({
|
|
|
33
32
|
</Button>
|
|
34
33
|
)}
|
|
35
34
|
{next && (
|
|
36
|
-
<Button variant="ghost" asChild>
|
|
35
|
+
<Button variant="ghost" className="ms-auto min-w-0 max-w-full" asChild>
|
|
37
36
|
<Link to={next.to} relative="path" className={linkClass}>
|
|
38
37
|
<span className="text-lg truncate">{next.label}</span>
|
|
39
38
|
<ArrowRightIcon size={14} strokeWidth={2.5} />
|
|
@@ -5,7 +5,7 @@ import { ThemeProvider } from "next-themes";
|
|
|
5
5
|
import {
|
|
6
6
|
memo,
|
|
7
7
|
type PropsWithChildren,
|
|
8
|
-
|
|
8
|
+
Suspense,
|
|
9
9
|
useEffect,
|
|
10
10
|
useMemo,
|
|
11
11
|
useState,
|
|
@@ -18,7 +18,6 @@ import {
|
|
|
18
18
|
type ZudokuContextOptions,
|
|
19
19
|
} from "../core/ZudokuContext.js";
|
|
20
20
|
import { TopLevelError } from "../errors/TopLevelError.js";
|
|
21
|
-
import { StaggeredRenderContext } from "../plugins/openapi/StaggeredRender.js";
|
|
22
21
|
import { MdxComponents } from "../util/MdxComponents.js";
|
|
23
22
|
import "../util/requestIdleCallbackPolyfill.js";
|
|
24
23
|
import {
|
|
@@ -56,12 +55,7 @@ const ZudokuInner = memo(
|
|
|
56
55
|
...props.mdx?.components,
|
|
57
56
|
};
|
|
58
57
|
}, [props.mdx?.components, props.plugins]);
|
|
59
|
-
const { stagger } = useContext(StaggeredRenderContext);
|
|
60
58
|
const [didNavigate, setDidNavigate] = useState(false);
|
|
61
|
-
const staggeredValue = useMemo(
|
|
62
|
-
() => (didNavigate ? { stagger: true } : { stagger }),
|
|
63
|
-
[stagger, didNavigate],
|
|
64
|
-
);
|
|
65
59
|
const navigation = useNavigation();
|
|
66
60
|
const queryClient = useQueryClient();
|
|
67
61
|
|
|
@@ -81,8 +75,8 @@ const ZudokuInner = memo(
|
|
|
81
75
|
return (
|
|
82
76
|
<>
|
|
83
77
|
<Helmet>{heads}</Helmet>
|
|
84
|
-
<
|
|
85
|
-
<
|
|
78
|
+
<ZudokuProvider context={zudokuContext}>
|
|
79
|
+
<Suspense fallback={<div>Zudoku Loading...</div>}>
|
|
86
80
|
<RouterEventsEmitter />
|
|
87
81
|
<SlotProvider slots={props.slots ?? props.UNSAFE_slotlets}>
|
|
88
82
|
<MDXProvider components={mdxComponents}>
|
|
@@ -95,8 +89,8 @@ const ZudokuInner = memo(
|
|
|
95
89
|
</ThemeProvider>
|
|
96
90
|
</MDXProvider>
|
|
97
91
|
</SlotProvider>
|
|
98
|
-
</
|
|
99
|
-
</
|
|
92
|
+
</Suspense>
|
|
93
|
+
</ZudokuProvider>
|
|
100
94
|
</>
|
|
101
95
|
);
|
|
102
96
|
},
|
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
import { useQuery, useSuspenseQuery } from "@tanstack/react-query";
|
|
2
|
-
import {
|
|
2
|
+
import { useContext, useEffect } from "react";
|
|
3
3
|
import { matchPath, useLocation } from "react-router";
|
|
4
4
|
import type { NavigationItem } from "../../../config/validators/NavigationSchema.js";
|
|
5
5
|
import { useAuthState } from "../../authentication/state.js";
|
|
6
|
-
import type { ZudokuContext } from "../../core/ZudokuContext.js";
|
|
7
6
|
import { joinUrl } from "../../util/joinUrl.js";
|
|
8
7
|
import { CACHE_KEYS, useCache } from "../cache.js";
|
|
9
8
|
import { traverseNavigation } from "../navigation/utils.js";
|
|
10
|
-
|
|
11
|
-
export const ZudokuReactContext = createContext<ZudokuContext | undefined>(
|
|
12
|
-
undefined,
|
|
13
|
-
);
|
|
9
|
+
import { ZudokuReactContext } from "./ZudokuReactContext.js";
|
|
14
10
|
|
|
15
11
|
export const useZudoku = () => {
|
|
16
12
|
const context = useContext(ZudokuReactContext);
|
|
@@ -2,7 +2,7 @@ import { useSuspenseQuery } from "@tanstack/react-query";
|
|
|
2
2
|
import type { PropsWithChildren } from "react";
|
|
3
3
|
import type { ZudokuContext } from "../../core/ZudokuContext.js";
|
|
4
4
|
import { NO_DEHYDRATE } from "../cache.js";
|
|
5
|
-
import { ZudokuReactContext } from "./
|
|
5
|
+
import { ZudokuReactContext } from "./ZudokuReactContext.js";
|
|
6
6
|
|
|
7
7
|
export const ZudokuProvider = ({
|
|
8
8
|
children,
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type Context, createContext } from "react";
|
|
2
|
+
import type { ZudokuContext } from "../../core/ZudokuContext.js";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* During SSR, Vite's module runner can load the same module multiple times
|
|
6
|
+
* (once for the main app, once for external plugins), creating duplicate
|
|
7
|
+
* React contexts that don't share state.
|
|
8
|
+
*/
|
|
9
|
+
declare global {
|
|
10
|
+
var __ZUDOKU_CONTEXT: Context<ZudokuContext | undefined>;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
globalThis.__ZUDOKU_CONTEXT ??= createContext<ZudokuContext | undefined>(
|
|
14
|
+
undefined,
|
|
15
|
+
);
|
|
16
|
+
|
|
17
|
+
export const ZudokuReactContext = globalThis.__ZUDOKU_CONTEXT;
|
|
@@ -5,12 +5,14 @@ import { Link as LinkImport } from "react-router";
|
|
|
5
5
|
import { useAuth as useAuthImport } from "../authentication/hook.js";
|
|
6
6
|
import { Button as ButtonImport } from "../ui/Button.js";
|
|
7
7
|
import { Callout as CalloutImport } from "../ui/Callout.js";
|
|
8
|
+
import { ZudokuError as ZudokuErrorImport } from "../util/invariant.js";
|
|
8
9
|
import { ClientOnly as ClientOnlyImport } from "./ClientOnly.js";
|
|
9
10
|
import {
|
|
10
11
|
CACHE_KEYS as CACHE_KEYS_IMPORT,
|
|
11
12
|
useCache as useCacheImport,
|
|
12
13
|
} from "./cache.js";
|
|
13
14
|
import { useZudoku as useZudokuImport } from "./context/ZudokuContext.js";
|
|
15
|
+
import { Heading as HeadingImport } from "./Heading.js";
|
|
14
16
|
import { Markdown as MarkdownImport } from "./Markdown.js";
|
|
15
17
|
import { Slot as SlotImport } from "./Slot.js";
|
|
16
18
|
import { Spinner as SpinnerImport } from "./Spinner.js";
|
|
@@ -18,6 +20,7 @@ import { Typography as TypographyImport } from "./Typography.js";
|
|
|
18
20
|
import { Zudoku as ZudokuImport } from "./Zudoku.js";
|
|
19
21
|
|
|
20
22
|
export const Head = /*@__PURE__*/ Helmet;
|
|
23
|
+
export const Heading = /*@__PURE__*/ HeadingImport;
|
|
21
24
|
export const Callout = /*@__PURE__*/ CalloutImport;
|
|
22
25
|
export const Markdown = /*@__PURE__*/ MarkdownImport;
|
|
23
26
|
export const Spinner = /*@__PURE__*/ SpinnerImport;
|
|
@@ -27,6 +30,7 @@ export const Link = /*@__PURE__*/ LinkImport;
|
|
|
27
30
|
export const Zudoku = /*@__PURE__*/ ZudokuImport;
|
|
28
31
|
export const Typography = /*@__PURE__*/ TypographyImport;
|
|
29
32
|
export const Slot = /*@__PURE__*/ SlotImport;
|
|
33
|
+
export const ZudokuError = /*@__PURE__*/ ZudokuErrorImport;
|
|
30
34
|
|
|
31
35
|
/** @deprecated Import from `zudoku/hooks` instead */
|
|
32
36
|
export const useMDXComponents = /*@__PURE__*/ useMDXComponentsImport;
|
|
@@ -86,7 +86,9 @@ export const NavigationItem = ({
|
|
|
86
86
|
onClick={onRequestClose}
|
|
87
87
|
end
|
|
88
88
|
>
|
|
89
|
-
{item.icon &&
|
|
89
|
+
{item.icon && (
|
|
90
|
+
<item.icon size={16} className="align-[-0.125em] shrink-0" />
|
|
91
|
+
)}
|
|
90
92
|
{item.badge ? (
|
|
91
93
|
<>
|
|
92
94
|
{item.label && (
|
|
@@ -117,7 +119,9 @@ export const NavigationItem = ({
|
|
|
117
119
|
})}
|
|
118
120
|
onClick={onRequestClose}
|
|
119
121
|
>
|
|
120
|
-
{item.icon &&
|
|
122
|
+
{item.icon && (
|
|
123
|
+
<item.icon size={16} className="align-[-0.125em] shrink-0" />
|
|
124
|
+
)}
|
|
121
125
|
{item.badge ? (
|
|
122
126
|
<>
|
|
123
127
|
{item.label && <TruncatedLabel label={item.label} />}
|
|
@@ -135,7 +139,9 @@ export const NavigationItem = ({
|
|
|
135
139
|
rel="noopener noreferrer"
|
|
136
140
|
onClick={onRequestClose}
|
|
137
141
|
>
|
|
138
|
-
{item.icon &&
|
|
142
|
+
{item.icon && (
|
|
143
|
+
<item.icon size={16} className="align-[-0.125em] shrink-0" />
|
|
144
|
+
)}
|
|
139
145
|
<span className="whitespace-normal">{item.label}</span>
|
|
140
146
|
{/* This prevents that the icon would be positioned in its own line if the text fills a line entirely */}
|
|
141
147
|
<span className="whitespace-nowrap">
|