zudoku 0.0.0-fix-firebase-export.f8270825 → 0.0.0-fix-circular-ref-false-positives.zbe02c6a6
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/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/validate.d.ts +59 -12
- package/dist/config/validators/validate.js +7 -4
- package/dist/config/validators/validate.js.map +1 -1
- package/dist/flat-config.d.ts +28 -26
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -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 +43 -11
- 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/Pagination.js +2 -2
- package/dist/lib/components/Pagination.js.map +1 -1
- 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/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 +21 -16
- 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 +183 -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/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/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-DJ9bU-sO.js} +22 -22
- package/lib/ClaudeLogo-DJ9bU-sO.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-stpAoBtx.js} +11 -11
- package/lib/{MdxPage-BagO2c-n.js.map → MdxPage-stpAoBtx.js.map} +1 -1
- package/lib/{Mermaid-D_VSX7_Q.js → Mermaid-Koc3z8mU.js} +4 -4
- package/lib/{Mermaid-D_VSX7_Q.js.map → Mermaid-Koc3z8mU.js.map} +1 -1
- package/lib/{OAuthErrorPage-Fq54RLgt.js → OAuthErrorPage-DJ811Bn_.js} +15 -15
- package/lib/OAuthErrorPage-DJ811Bn_.js.map +1 -0
- package/lib/OasProvider-B2KxIBsI.js +48 -0
- package/lib/OasProvider-B2KxIBsI.js.map +1 -0
- package/lib/{OperationList-C0jiEaG5.js → OperationList-C2tAfThO.js} +1558 -1543
- package/lib/{OperationList-C0jiEaG5.js.map → OperationList-C2tAfThO.js.map} +1 -1
- package/lib/RouteGuard--A04ESy8.js +77 -0
- package/lib/RouteGuard--A04ESy8.js.map +1 -0
- package/lib/{SchemaList-BU0zCHn9.js → SchemaList-Ep8DleP_.js} +9 -9
- package/lib/{SchemaList-BU0zCHn9.js.map → SchemaList-Ep8DleP_.js.map} +1 -1
- package/lib/SchemaView-BpaEKRYx.js +438 -0
- package/lib/SchemaView-BpaEKRYx.js.map +1 -0
- package/lib/{Select-CkxXP5I7.js → Secret-BDBqq4p3.js} +122 -122
- package/lib/Secret-BDBqq4p3.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-DCBViNUi.js +50 -0
- package/lib/SignUp-DCBViNUi.js.map +1 -0
- package/lib/{SyntaxHighlight-Kdyskw3C.js → SyntaxHighlight-Dshjn3Zf.js} +1749 -1723
- package/lib/SyntaxHighlight-Dshjn3Zf.js.map +1 -0
- package/lib/{Toc-DJxFPfcS.js → Toc-Cgz6CPiE.js} +3 -3
- package/lib/{Toc-DJxFPfcS.js.map → Toc-Cgz6CPiE.js.map} +1 -1
- package/lib/ZudokuContext-BZB1TWdT.js +387 -0
- package/lib/ZudokuContext-BZB1TWdT.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-CG3e0_Uz.js} +1689 -1686
- package/lib/{circular-CzWF1hj5.js.map → circular-CG3e0_Uz.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-CNeRqj98.js} +12 -12
- package/lib/{createServer-BIr2_tGn.js.map → createServer-CNeRqj98.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-b9I-fAOY.js} +3 -3
- package/lib/{errors-Bs4duWDy.js.map → errors-b9I-fAOY.js.map} +1 -1
- package/lib/{firebase-qUdSEL1p.js → firebase-BCXX7Qv5.js} +1590 -1342
- package/lib/firebase-BCXX7Qv5.js.map +1 -0
- package/lib/hook-BGlHBdET.js +52 -0
- package/lib/hook-BGlHBdET.js.map +1 -0
- package/lib/{ErrorAlert-DrOR8w3f.js → index-CL8eDnQW.js} +5473 -4433
- package/lib/index-CL8eDnQW.js.map +1 -0
- package/lib/index-CrcNWbel.js.map +1 -1
- package/lib/{index-Css56y3F.js → index-DBjOT2H1.js} +4 -4
- package/lib/{index-Css56y3F.js.map → index-DBjOT2H1.js.map} +1 -1
- package/lib/{index-0oT9beQN.js → index-I3kmZ7tG.js} +152 -148
- package/lib/{index-0oT9beQN.js.map → index-I3kmZ7tG.js.map} +1 -1
- package/lib/{index-Bh-MffiL.js → index-UOLtazB8.js} +2 -2
- package/lib/{index-Bh-MffiL.js.map → index-UOLtazB8.js.map} +1 -1
- 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-kW-Utcsi.js → index.esm-C5CBsVzN.js} +16 -14
- package/lib/index.esm-C5CBsVzN.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 +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 +28 -21
- 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 +170 -38
- package/src/lib/authentication/utils/relativeRedirectUrl.ts +12 -0
- package/src/lib/components/Pagination.tsx +4 -5
- 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/ErrorMessage.tsx +38 -0
- package/src/lib/oas/graphql/circular.test.ts +221 -0
- package/src/lib/oas/graphql/circular.ts +31 -18
- 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/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-qUdSEL1p.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-kW-Utcsi.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,6 +149,8 @@ export const ZudokuSignInUi = ({
|
|
|
146
149
|
const [searchParams] = useSearchParams();
|
|
147
150
|
const redirectTo = searchParams.get("redirectTo");
|
|
148
151
|
|
|
152
|
+
const relativeRedirectTo = getRelativeRedirectUrl(redirectTo);
|
|
153
|
+
|
|
149
154
|
const invalidProviders = providers.filter(
|
|
150
155
|
(provider) => !isValidAuthProviderId(provider),
|
|
151
156
|
);
|
|
@@ -165,7 +170,7 @@ export const ZudokuSignInUi = ({
|
|
|
165
170
|
await onUsernamePasswordSignIn(email, password);
|
|
166
171
|
},
|
|
167
172
|
onSuccess: () => {
|
|
168
|
-
void navigate(
|
|
173
|
+
void navigate(relativeRedirectTo);
|
|
169
174
|
},
|
|
170
175
|
});
|
|
171
176
|
const signInByProviderMutation = useMutation({
|
|
@@ -173,7 +178,7 @@ export const ZudokuSignInUi = ({
|
|
|
173
178
|
await onOAuthSignIn(providerId);
|
|
174
179
|
},
|
|
175
180
|
onSuccess: () => {
|
|
176
|
-
void navigate(
|
|
181
|
+
void navigate(relativeRedirectTo);
|
|
177
182
|
},
|
|
178
183
|
});
|
|
179
184
|
|
|
@@ -202,24 +207,38 @@ export const ZudokuSignInUi = ({
|
|
|
202
207
|
<AlertDescription>{error?.message}</AlertDescription>
|
|
203
208
|
</Alert>
|
|
204
209
|
)}
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
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
|
+
)}
|
|
223
242
|
<Link to="/signup" className="text-sm text-muted-foreground">
|
|
224
243
|
Don't have an account? Sign up.
|
|
225
244
|
</Link>
|
|
@@ -230,13 +249,21 @@ export const ZudokuSignInUi = ({
|
|
|
230
249
|
|
|
231
250
|
export const ZudokuSignUpUi = ({
|
|
232
251
|
providers,
|
|
252
|
+
enableUsernamePassword,
|
|
233
253
|
onOAuthSignUp,
|
|
234
254
|
onUsernamePasswordSignUp,
|
|
235
255
|
}: {
|
|
236
256
|
providers: string[];
|
|
257
|
+
enableUsernamePassword: boolean;
|
|
237
258
|
onOAuthSignUp: (providerId: string) => Promise<void>;
|
|
238
259
|
onUsernamePasswordSignUp: (email: string, password: string) => Promise<void>;
|
|
239
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
|
+
|
|
240
267
|
if (!isAuthProviderIdArray(providers)) {
|
|
241
268
|
throw new Error("Invalid auth provider IDs");
|
|
242
269
|
}
|
|
@@ -245,12 +272,18 @@ export const ZudokuSignUpUi = ({
|
|
|
245
272
|
mutationFn: async ({ email, password }: FormFields) => {
|
|
246
273
|
await onUsernamePasswordSignUp(email, password);
|
|
247
274
|
},
|
|
275
|
+
onSuccess: () => {
|
|
276
|
+
void navigate(relativeRedirectTo ?? "/");
|
|
277
|
+
},
|
|
248
278
|
});
|
|
249
279
|
|
|
250
280
|
const signUpByProviderMutation = useMutation({
|
|
251
281
|
mutationFn: async ({ providerId }: { providerId: string }) => {
|
|
252
282
|
await onOAuthSignUp(providerId);
|
|
253
283
|
},
|
|
284
|
+
onSuccess: () => {
|
|
285
|
+
void navigate(relativeRedirectTo ?? "/");
|
|
286
|
+
},
|
|
254
287
|
});
|
|
255
288
|
|
|
256
289
|
const form = useForm<FormFields>({
|
|
@@ -279,24 +312,30 @@ export const ZudokuSignUpUi = ({
|
|
|
279
312
|
</Alert>
|
|
280
313
|
)}
|
|
281
314
|
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
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
|
+
)}
|
|
300
339
|
<Link to="/signin" className="text-sm text-muted-foreground">
|
|
301
340
|
Already have an account? Sign in.
|
|
302
341
|
</Link>
|
|
@@ -343,3 +382,96 @@ const ProviderSeparator = ({ providers }: { providers: AuthProviderId[] }) => {
|
|
|
343
382
|
)
|
|
344
383
|
);
|
|
345
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
|
+
};
|
|
@@ -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,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">
|
|
@@ -27,16 +27,31 @@ export const RouteGuard = () => {
|
|
|
27
27
|
const shouldBypass = use(BypassProtectedRoutesContext);
|
|
28
28
|
const { protectedRoutes } = zudoku.options;
|
|
29
29
|
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
: undefined;
|
|
30
|
+
const protectedRouteEntry = protectedRoutes
|
|
31
|
+
? Object.entries(protectedRoutes).find(([path]) =>
|
|
32
|
+
matchPath({ path, end: true }, location.pathname),
|
|
33
|
+
)
|
|
34
|
+
: undefined;
|
|
36
35
|
|
|
37
|
-
const isProtectedRoute =
|
|
38
|
-
|
|
39
|
-
|
|
36
|
+
const isProtectedRoute = protectedRouteEntry !== undefined;
|
|
37
|
+
|
|
38
|
+
// SSR/prerendering mode: render content with search meta tag, skip all auth
|
|
39
|
+
if (shouldBypass) {
|
|
40
|
+
return (
|
|
41
|
+
<>
|
|
42
|
+
{isProtectedRoute && (
|
|
43
|
+
<Helmet>
|
|
44
|
+
<meta
|
|
45
|
+
name="pagefind"
|
|
46
|
+
data-pagefind-filter={`section:${SEARCH_PROTECTED_SECTION}`}
|
|
47
|
+
content="true"
|
|
48
|
+
/>
|
|
49
|
+
</Helmet>
|
|
50
|
+
)}
|
|
51
|
+
<Outlet />
|
|
52
|
+
</>
|
|
53
|
+
);
|
|
54
|
+
}
|
|
40
55
|
|
|
41
56
|
if (isProtectedRoute && !auth.isAuthEnabled) {
|
|
42
57
|
throw new ZudokuError("Authentication is not enabled", {
|
|
@@ -46,6 +61,10 @@ export const RouteGuard = () => {
|
|
|
46
61
|
});
|
|
47
62
|
}
|
|
48
63
|
|
|
64
|
+
const authCheckFn = protectedRouteEntry?.[1];
|
|
65
|
+
const needsToSignIn =
|
|
66
|
+
isProtectedRoute && !authCheckFn?.({ auth, context: zudoku });
|
|
67
|
+
|
|
49
68
|
if (needsToSignIn && auth.isPending && typeof window !== "undefined") {
|
|
50
69
|
return null;
|
|
51
70
|
}
|
|
@@ -91,7 +110,7 @@ export const RouteGuard = () => {
|
|
|
91
110
|
)
|
|
92
111
|
}
|
|
93
112
|
>
|
|
94
|
-
Login
|
|
113
|
+
Login
|
|
95
114
|
</Button>
|
|
96
115
|
</DialogFooter>
|
|
97
116
|
</DialogContent>
|
|
@@ -99,18 +118,5 @@ export const RouteGuard = () => {
|
|
|
99
118
|
);
|
|
100
119
|
}
|
|
101
120
|
|
|
102
|
-
return
|
|
103
|
-
<>
|
|
104
|
-
{shouldBypass && isProtectedRoute && (
|
|
105
|
-
<Helmet>
|
|
106
|
-
<meta
|
|
107
|
-
name="pagefind"
|
|
108
|
-
data-pagefind-filter={`section:${SEARCH_PROTECTED_SECTION}`}
|
|
109
|
-
content="true"
|
|
110
|
-
/>
|
|
111
|
-
</Helmet>
|
|
112
|
-
)}
|
|
113
|
-
<Outlet />
|
|
114
|
-
</>
|
|
115
|
-
);
|
|
121
|
+
return <Outlet />;
|
|
116
122
|
};
|
package/src/lib/core/plugins.ts
CHANGED
|
@@ -3,6 +3,7 @@ import type { ReactNode } from "react";
|
|
|
3
3
|
import type { Location, RouteObject } from "react-router";
|
|
4
4
|
import type { Navigation } from "../../config/validators/NavigationSchema.js";
|
|
5
5
|
import type { ProtectedRoutesInput } from "../../config/validators/ProtectedRoutesSchema.js";
|
|
6
|
+
import type { ZudokuConfig } from "../../config/validators/validate.js";
|
|
6
7
|
import type { AuthenticationPlugin } from "../authentication/authentication.js";
|
|
7
8
|
import type { MdxComponentsType } from "../util/MdxComponents.js";
|
|
8
9
|
import type {
|
|
@@ -18,7 +19,8 @@ export type ZudokuPlugin =
|
|
|
18
19
|
| ApiIdentityPlugin
|
|
19
20
|
| SearchProviderPlugin
|
|
20
21
|
| EventConsumerPlugin
|
|
21
|
-
| AuthenticationPlugin
|
|
22
|
+
| AuthenticationPlugin
|
|
23
|
+
| TransformConfigPlugin;
|
|
22
24
|
|
|
23
25
|
export type { AuthenticationPlugin, RouteObject };
|
|
24
26
|
|
|
@@ -60,6 +62,19 @@ export type ProfileNavigationItem = {
|
|
|
60
62
|
icon?: LucideIcon;
|
|
61
63
|
};
|
|
62
64
|
|
|
65
|
+
export interface ConfigHookContext {
|
|
66
|
+
mode: typeof process.env.ZUDOKU_ENV;
|
|
67
|
+
rootDir: string;
|
|
68
|
+
configPath: string;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export interface TransformConfigPlugin {
|
|
72
|
+
transformConfig?: (
|
|
73
|
+
config: ZudokuConfig,
|
|
74
|
+
ctx: ConfigHookContext,
|
|
75
|
+
) => Partial<ZudokuConfig> | void | Promise<Partial<ZudokuConfig> | void>;
|
|
76
|
+
}
|
|
77
|
+
|
|
63
78
|
export interface CommonPlugin {
|
|
64
79
|
initialize?: (
|
|
65
80
|
context: ZudokuContext,
|
|
@@ -110,3 +125,8 @@ export const isApiIdentityPlugin = (
|
|
|
110
125
|
obj: ZudokuPlugin,
|
|
111
126
|
): obj is ApiIdentityPlugin =>
|
|
112
127
|
"getIdentities" in obj && typeof obj.getIdentities === "function";
|
|
128
|
+
|
|
129
|
+
export const isTransformConfigPlugin = (
|
|
130
|
+
obj: ZudokuPlugin,
|
|
131
|
+
): obj is TransformConfigPlugin =>
|
|
132
|
+
"transformConfig" in obj && typeof obj.transformConfig === "function";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@tanstack/react-query";
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import createDeepmerge from "@fastify/deepmerge";
|
|
2
|
+
import type { ConfigWithMeta } from "../../config/loader.js";
|
|
3
|
+
import { type ConfigHookContext, isTransformConfigPlugin } from "./plugins.js";
|
|
4
|
+
|
|
5
|
+
const mergeConfig = createDeepmerge({
|
|
6
|
+
mergeArray: (opt) => (_, source) => opt.clone(source),
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
export const runTransformConfigHooks = async (
|
|
10
|
+
config: ConfigWithMeta,
|
|
11
|
+
): Promise<ConfigWithMeta> => {
|
|
12
|
+
const ctx = {
|
|
13
|
+
mode: config.__meta.mode,
|
|
14
|
+
rootDir: config.__meta.rootDir,
|
|
15
|
+
configPath: config.__meta.configPath,
|
|
16
|
+
} satisfies ConfigHookContext;
|
|
17
|
+
const plugins = config.plugins ?? [];
|
|
18
|
+
|
|
19
|
+
let result = config;
|
|
20
|
+
|
|
21
|
+
for (const plugin of plugins.filter(isTransformConfigPlugin)) {
|
|
22
|
+
const partial = await plugin.transformConfig?.(result, ctx);
|
|
23
|
+
if (!partial) continue;
|
|
24
|
+
|
|
25
|
+
result = mergeConfig(result, partial) as ConfigWithMeta;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
return result;
|
|
29
|
+
};
|