zudoku 0.0.0-fix-firebase-export.f8270825 → 0.0.0-fix-warnings.z053d4e27
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 +121 -119
- 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 +60 -13
- 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/Heading.d.ts +1 -1
- package/dist/lib/components/Pagination.js +2 -2
- package/dist/lib/components/Pagination.js.map +1 -1
- package/dist/lib/components/index.d.ts +18 -69
- package/dist/lib/components/index.js +19 -32
- 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 +7 -28
- package/dist/lib/hooks/index.js +7 -15
- package/dist/lib/hooks/index.js.map +1 -1
- 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/oas/parser/index.js +14 -5
- package/dist/lib/oas/parser/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/flattenAllOf.d.ts +0 -2
- package/dist/lib/util/flattenAllOf.js +0 -46
- package/dist/lib/util/flattenAllOf.js.map +1 -1
- package/dist/lib/util/flattenAllOf.test.js +2 -1
- package/dist/lib/util/flattenAllOf.test.js.map +1 -1
- package/dist/lib/util/flattenAllOfProcessor.d.ts +2 -0
- package/dist/lib/util/flattenAllOfProcessor.js +48 -0
- package/dist/lib/util/flattenAllOfProcessor.js.map +1 -0
- 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/lib/util/readFrontmatter.js +2 -1
- package/dist/lib/util/readFrontmatter.js.map +1 -1
- package/dist/vite/api/SchemaManager.d.ts +12 -1
- package/dist/vite/api/SchemaManager.js +32 -15
- package/dist/vite/api/SchemaManager.js.map +1 -1
- package/dist/vite/api/SchemaManager.test.js +45 -1
- package/dist/vite/api/SchemaManager.test.js.map +1 -1
- package/dist/vite/build.js +91 -73
- package/dist/vite/build.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-inject-filepath.js +5 -1
- package/dist/vite/mdx/remark-inject-filepath.js.map +1 -1
- package/dist/vite/mdx/remark-link-rewrite.js +4 -3
- package/dist/vite/mdx/remark-link-rewrite.js.map +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-docs.js +9 -7
- package/dist/vite/plugin-docs.js.map +1 -1
- package/dist/vite/plugin-markdown-export.js +5 -3
- 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-C6q-Xn_l.js} +21 -17
- package/lib/ClaudeLogo-C6q-Xn_l.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-B1G4W1TK.js} +11 -11
- package/lib/{MdxPage-BagO2c-n.js.map → MdxPage-B1G4W1TK.js.map} +1 -1
- package/lib/{Mermaid-D_VSX7_Q.js → Mermaid-B1xNo-pf.js} +5 -4
- package/lib/{Mermaid-D_VSX7_Q.js.map → Mermaid-B1xNo-pf.js.map} +1 -1
- package/lib/{OAuthErrorPage-Fq54RLgt.js → OAuthErrorPage-01Ke086W.js} +25 -23
- package/lib/OAuthErrorPage-01Ke086W.js.map +1 -0
- package/lib/OasProvider-BG-FWDIq.js +48 -0
- package/lib/OasProvider-BG-FWDIq.js.map +1 -0
- package/lib/{OperationList-C0jiEaG5.js → OperationList-GGkJ1vac.js} +1983 -1965
- package/lib/OperationList-GGkJ1vac.js.map +1 -0
- package/lib/RouteGuard-B1lCR0C_.js +77 -0
- package/lib/RouteGuard-B1lCR0C_.js.map +1 -0
- package/lib/{SchemaList-BU0zCHn9.js → SchemaList-CNVdC9f-.js} +9 -9
- package/lib/{SchemaList-BU0zCHn9.js.map → SchemaList-CNVdC9f-.js.map} +1 -1
- package/lib/SchemaView-CrV0yIwR.js +438 -0
- package/lib/SchemaView-CrV0yIwR.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-8kDBaLbO.js +55 -0
- package/lib/SignUp-8kDBaLbO.js.map +1 -0
- package/lib/{SyntaxHighlight-Kdyskw3C.js → SyntaxHighlight-hZOFnYl0.js} +1749 -1723
- package/lib/SyntaxHighlight-hZOFnYl0.js.map +1 -0
- package/lib/{Toc-DJxFPfcS.js → Toc-qEIii_-W.js} +3 -3
- package/lib/{Toc-DJxFPfcS.js.map → Toc-qEIii_-W.js.map} +1 -1
- package/lib/{ErrorAlert-DrOR8w3f.js → Zudoku-DUsdmPME.js} +5449 -4427
- package/lib/Zudoku-DUsdmPME.js.map +1 -0
- package/lib/ZudokuContext-BBI06sOx.js +387 -0
- package/lib/ZudokuContext-BBI06sOx.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-bbWO95zs.js} +771 -749
- package/lib/{circular-CzWF1hj5.js.map → circular-bbWO95zs.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-B7POuwZp.js +13036 -0
- package/lib/createServer-B7POuwZp.js.map +1 -0
- package/lib/createVariantComponent-Dc0vtOvr.js +18 -0
- package/lib/createVariantComponent-Dc0vtOvr.js.map +1 -0
- package/lib/{errors-Bs4duWDy.js → errors-7hgPDs1h.js} +3 -3
- package/lib/{errors-Bs4duWDy.js.map → errors-7hgPDs1h.js.map} +1 -1
- package/lib/{firebase-qUdSEL1p.js → firebase-Dwn-2ju-.js} +1590 -1342
- package/lib/firebase-Dwn-2ju-.js.map +1 -0
- package/lib/hook-ZEd1Es7D.js +52 -0
- package/lib/hook-ZEd1Es7D.js.map +1 -0
- package/lib/{index-0oT9beQN.js → index-CTCT4jlW.js} +499 -493
- package/lib/{index-0oT9beQN.js.map → index-CTCT4jlW.js.map} +1 -1
- package/lib/index-CrcNWbel.js.map +1 -1
- package/lib/index-DAWHN3cH.js +86 -0
- package/lib/index-DAWHN3cH.js.map +1 -0
- package/lib/{index-Bh-MffiL.js → index-Dxdhrp-I.js} +2 -2
- package/lib/{index-Bh-MffiL.js.map → index-Dxdhrp-I.js.map} +1 -1
- package/lib/index.esm-BYObtETB.js.map +1 -1
- package/lib/{index.esm-DtzT_KoE.js → index.esm-Ca5zvoff.js} +20 -20
- package/lib/{index.esm-DtzT_KoE.js.map → index.esm-Ca5zvoff.js.map} +1 -1
- package/lib/{index.esm-kW-Utcsi.js → index.esm-DG4KaDKR.js} +16 -14
- package/lib/index.esm-DG4KaDKR.js.map +1 -0
- package/lib/{invariant-CGOLuIIz.js → invariant-B_t_F2s_.js} +6 -6
- package/lib/invariant-B_t_F2s_.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/useExposedProps-CzTDfXfq.js +30 -0
- package/lib/useExposedProps-CzTDfXfq.js.map +1 -0
- 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 +827 -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 +29 -25
- package/lib/zudoku.components.js.map +1 -1
- package/lib/zudoku.hooks.js +24 -11
- package/lib/zudoku.hooks.js.map +1 -1
- package/lib/zudoku.mermaid.js +5 -4
- package/lib/zudoku.mermaid.js.map +1 -1
- package/lib/zudoku.plugin-api-catalog.js +35 -31
- package/lib/zudoku.plugin-api-catalog.js.map +1 -1
- package/lib/zudoku.plugin-api-keys.js +607 -551
- 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 +30 -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 +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 +19 -35
- 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/hooks/index.ts +7 -16
- 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/oas/parser/index.ts +17 -6
- 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/flattenAllOf.test.ts +2 -1
- package/src/lib/util/flattenAllOf.ts +0 -57
- package/src/lib/util/flattenAllOfProcessor.ts +58 -0
- package/src/lib/util/invariant.ts +2 -1
- package/src/lib/util/readFrontmatter.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/src/zuplo/enrich-with-zuplo-mcp.ts +168 -0
- package/src/zuplo/enrich-with-zuplo.ts +254 -0
- package/src/zuplo/policy-types.ts +46 -0
- package/src/zuplo/with-zuplo-processors.ts +35 -0
- package/src/zuplo/with-zuplo.ts +14 -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/OperationList-C0jiEaG5.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 +0 -9
- 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/createServer-BIr2_tGn.js +0 -16693
- package/lib/createServer-BIr2_tGn.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-Css56y3F.js +0 -133
- package/lib/index-Css56y3F.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
package/lib/zudoku.hooks.js
CHANGED
|
@@ -1,14 +1,27 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./hook-
|
|
3
|
-
import {
|
|
1
|
+
import { z as C } from "./index-DAWHN3cH.js";
|
|
2
|
+
import { u as D } from "./hook-ZEd1Es7D.js";
|
|
3
|
+
import { a as n } from "./ZudokuContext-BBI06sOx.js";
|
|
4
|
+
import { C as z, u as A } from "./ZudokuContext-BBI06sOx.js";
|
|
5
|
+
import { a as S, u as v } from "./useExposedProps-CzTDfXfq.js";
|
|
6
|
+
import { useState as f, useEffect as m } from "react";
|
|
7
|
+
function E(t, e) {
|
|
8
|
+
const s = n(), [r, o] = f();
|
|
9
|
+
return m(() => s.addEventListener(t, ((...u) => {
|
|
10
|
+
if (e) {
|
|
11
|
+
const a = e(...u);
|
|
12
|
+
o(a);
|
|
13
|
+
} else
|
|
14
|
+
o(u);
|
|
15
|
+
})), [s, t, e]), r;
|
|
16
|
+
}
|
|
4
17
|
export {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
18
|
+
z as CACHE_KEYS,
|
|
19
|
+
D as useAuth,
|
|
20
|
+
A as useCache,
|
|
21
|
+
E as useEvent,
|
|
22
|
+
S as useExposedProps,
|
|
23
|
+
v as useMDXComponents,
|
|
24
|
+
C as useTheme,
|
|
25
|
+
n as useZudoku
|
|
13
26
|
};
|
|
14
27
|
//# sourceMappingURL=zudoku.hooks.js.map
|
package/lib/zudoku.hooks.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zudoku.hooks.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"zudoku.hooks.js","sources":["../src/lib/hooks/useEvent.ts"],"sourcesContent":["import { useEffect, useState } from \"react\";\nimport { useZudoku } from \"../components/context/ZudokuContext.js\";\nimport type { ZudokuEvents } from \"../core/ZudokuContext.js\";\n\ntype EventParameters<Event extends keyof ZudokuEvents> = Parameters<\n ZudokuEvents[Event]\n>;\n\n/**\n * Hook to subscribe to Zudoku events with automatic cleanup\n * @param event The event to subscribe to\n * @param callback Optional callback to be called when the event is emitted\n * @returns The latest event data if no callback is provided, or the callback's return value if it returns something\n */\nexport function useEvent<E extends keyof ZudokuEvents>(\n event: E,\n): EventParameters<E>;\nexport function useEvent<E extends keyof ZudokuEvents, R>(\n event: E,\n callback: (...args: EventParameters<E>) => R,\n): R;\nexport function useEvent<E extends keyof ZudokuEvents, R>(\n event: E,\n callback?: (...args: EventParameters<E>) => R,\n) {\n const zudoku = useZudoku();\n const [latestData, setLatestData] = useState<R | EventParameters<E>>();\n\n useEffect(() => {\n return zudoku.addEventListener(event, ((...args: EventParameters<E>) => {\n if (callback) {\n const result = callback(...args);\n setLatestData(result);\n } else {\n setLatestData(args);\n }\n }) as ZudokuEvents[E]);\n }, [zudoku, event, callback]);\n\n return latestData;\n}\n"],"names":["useEvent","event","callback","zudoku","useZudoku","latestData","setLatestData","useState","useEffect","args","result"],"mappings":";;;;;;AAqBO,SAASA,EACdC,GACAC,GACA;AACA,QAAMC,IAASC,EAAA,GACT,CAACC,GAAYC,CAAa,IAAIC,EAAA;AAEpC,SAAAC,EAAU,MACDL,EAAO,iBAAiBF,IAAQ,IAAIQ,MAA6B;AACtE,QAAIP,GAAU;AACZ,YAAMQ,IAASR,EAAS,GAAGO,CAAI;AAC/B,MAAAH,EAAcI,CAAM;AAAA,IACtB;AACE,MAAAJ,EAAcG,CAAI;AAAA,EAEtB,EAAA,GACC,CAACN,GAAQF,GAAOC,CAAQ,CAAC,GAErBG;AACT;"}
|
package/lib/zudoku.mermaid.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import "./jsx-runtime-BzflLqGi.js";
|
|
2
|
-
import "./
|
|
2
|
+
import "./useSuspenseQuery-CSB_rVek.js";
|
|
3
3
|
import "react";
|
|
4
|
-
import { M
|
|
5
|
-
import "./index-
|
|
4
|
+
import { M } from "./Mermaid-B1xNo-pf.js";
|
|
5
|
+
import "./index-DAWHN3cH.js";
|
|
6
|
+
import "./ZudokuContext-BBI06sOx.js";
|
|
6
7
|
import "./Spinner-CI6bRyZw.js";
|
|
7
8
|
export {
|
|
8
|
-
|
|
9
|
+
M as Mermaid
|
|
9
10
|
};
|
|
10
11
|
//# sourceMappingURL=zudoku.mermaid.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zudoku.mermaid.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"zudoku.mermaid.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
|
|
@@ -1,22 +1,26 @@
|
|
|
1
1
|
import { j as t } from "./jsx-runtime-BzflLqGi.js";
|
|
2
|
-
import { s as f } from "./index-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
2
|
+
import { s as f } from "./index-Dxdhrp-I.js";
|
|
3
|
+
import { c as b, L as j, m as x } from "./chunk-EPOLDU6W-C6C8jAwd.js";
|
|
4
|
+
import { b as v, j as p } from "./ZudokuContext-BBI06sOx.js";
|
|
5
|
+
import { u as y } from "./useSuspenseQuery-CSB_rVek.js";
|
|
6
|
+
import { H as N } from "./index.esm-Ca5zvoff.js";
|
|
7
|
+
import "./ui/Button.js";
|
|
8
|
+
import "lucide-react";
|
|
9
|
+
import "react";
|
|
10
|
+
import { H as k, M as S } from "./Zudoku-DUsdmPME.js";
|
|
11
|
+
import "./index-DAWHN3cH.js";
|
|
8
12
|
const w = ({
|
|
9
|
-
items:
|
|
13
|
+
items: n,
|
|
10
14
|
filterCatalogItems: r = (i) => i,
|
|
11
15
|
label: c = "API Library",
|
|
12
16
|
categoryLabel: s
|
|
13
17
|
}) => {
|
|
14
|
-
const i =
|
|
15
|
-
queryFn: () => r(
|
|
18
|
+
const i = v(), a = b({ path: "/catalog/:category" })?.params.category, o = y({
|
|
19
|
+
queryFn: () => r(n, { auth: i }),
|
|
16
20
|
queryKey: ["catalogItems", i]
|
|
17
21
|
}), m = a ? { "data-pagefind-ignore": "all" } : {};
|
|
18
22
|
return /* @__PURE__ */ t.jsxs("section", { className: "pt-(--padding-content-top)", ...m, children: [
|
|
19
|
-
/* @__PURE__ */ t.jsx(
|
|
23
|
+
/* @__PURE__ */ t.jsx(N, { children: /* @__PURE__ */ t.jsxs("title", { children: [
|
|
20
24
|
s ? `${s} - ` : "",
|
|
21
25
|
c
|
|
22
26
|
] }) }),
|
|
@@ -25,14 +29,14 @@ const w = ({
|
|
|
25
29
|
c,
|
|
26
30
|
s && ` - ${s}`
|
|
27
31
|
] }),
|
|
28
|
-
/* @__PURE__ */ t.jsx("div", { className: "grid grid-cols-2 gap-4", children:
|
|
32
|
+
/* @__PURE__ */ t.jsx("div", { className: "grid grid-cols-2 gap-4", children: o.data.filter(
|
|
29
33
|
(e) => !a || e.categories.find(
|
|
30
|
-
(
|
|
34
|
+
(l) => l.tags.find((g) => h(l.label, g) === a)
|
|
31
35
|
)
|
|
32
36
|
).map((e) => /* @__PURE__ */ t.jsx(
|
|
33
|
-
|
|
37
|
+
j,
|
|
34
38
|
{
|
|
35
|
-
to:
|
|
39
|
+
to: p(e.path),
|
|
36
40
|
className: "no-underline hover:!text-foreground",
|
|
37
41
|
children: /* @__PURE__ */ t.jsxs("div", { className: "border h-full rounded-lg p-4 flex flex-col gap-2 cursor-pointer hover:bg-border/20 font-normal", children: [
|
|
38
42
|
/* @__PURE__ */ t.jsx("span", { className: "font-semibold", children: e.label }),
|
|
@@ -46,7 +50,7 @@ const w = ({
|
|
|
46
50
|
// we need to strip out other links to not get a hydration error, like:
|
|
47
51
|
// > In HTML, <a> cannot be a descendant of <a>.
|
|
48
52
|
// > This will cause a hydration error.
|
|
49
|
-
a: (
|
|
53
|
+
a: (l) => /* @__PURE__ */ t.jsx("span", { ...l })
|
|
50
54
|
}
|
|
51
55
|
}
|
|
52
56
|
)
|
|
@@ -56,39 +60,39 @@ const w = ({
|
|
|
56
60
|
)) })
|
|
57
61
|
] })
|
|
58
62
|
] });
|
|
59
|
-
}, h = (
|
|
60
|
-
path:
|
|
63
|
+
}, h = (n, r) => f(`${n}-${r}`), R = ({
|
|
64
|
+
path: n,
|
|
61
65
|
items: r,
|
|
62
66
|
label: c,
|
|
63
67
|
categories: s = [],
|
|
64
68
|
filterCatalogItems: i
|
|
65
69
|
}) => {
|
|
66
|
-
const
|
|
70
|
+
const d = Object.fromEntries(
|
|
67
71
|
s.flatMap(
|
|
68
|
-
(a) => [void 0, ...a.tags].map((
|
|
69
|
-
|
|
70
|
-
|
|
72
|
+
(a) => [void 0, ...a.tags].map((o) => [
|
|
73
|
+
p(n, o ? h(a.label, o) : void 0),
|
|
74
|
+
o
|
|
71
75
|
])
|
|
72
76
|
)
|
|
73
77
|
);
|
|
74
78
|
return {
|
|
75
79
|
getNavigation: async (a) => {
|
|
76
|
-
if (!Object.keys(
|
|
77
|
-
(e) =>
|
|
80
|
+
if (!Object.keys(d).some(
|
|
81
|
+
(e) => x(e, a)
|
|
78
82
|
))
|
|
79
83
|
return [];
|
|
80
84
|
const m = s.map((e) => ({
|
|
81
85
|
type: "category",
|
|
82
86
|
label: e.label,
|
|
83
87
|
collapsible: !1,
|
|
84
|
-
items: e.tags.map((
|
|
88
|
+
items: e.tags.map((l) => ({
|
|
85
89
|
type: "link",
|
|
86
|
-
to:
|
|
87
|
-
label:
|
|
90
|
+
to: p(n, h(e.label, l)),
|
|
91
|
+
label: l,
|
|
88
92
|
badge: {
|
|
89
93
|
label: String(
|
|
90
94
|
r.filter(
|
|
91
|
-
(g) => g.categories.find((u) => u.tags.includes(
|
|
95
|
+
(g) => g.categories.find((u) => u.tags.includes(l))
|
|
92
96
|
).length
|
|
93
97
|
),
|
|
94
98
|
color: "outline"
|
|
@@ -97,18 +101,18 @@ const w = ({
|
|
|
97
101
|
}));
|
|
98
102
|
return m.unshift({
|
|
99
103
|
type: "link",
|
|
100
|
-
to:
|
|
104
|
+
to: p(n),
|
|
101
105
|
label: "Overview",
|
|
102
106
|
badge: { label: String(r.length), color: "outline" }
|
|
103
107
|
}), m;
|
|
104
108
|
},
|
|
105
|
-
getRoutes: () => Object.entries(
|
|
109
|
+
getRoutes: () => Object.entries(d).map(([a, o]) => ({
|
|
106
110
|
path: a,
|
|
107
111
|
element: /* @__PURE__ */ t.jsx(
|
|
108
112
|
w,
|
|
109
113
|
{
|
|
110
114
|
label: c,
|
|
111
|
-
categoryLabel:
|
|
115
|
+
categoryLabel: o,
|
|
112
116
|
items: r,
|
|
113
117
|
filterCatalogItems: i,
|
|
114
118
|
categories: s
|
|
@@ -118,7 +122,7 @@ const w = ({
|
|
|
118
122
|
};
|
|
119
123
|
};
|
|
120
124
|
export {
|
|
121
|
-
|
|
125
|
+
R as apiCatalogPlugin,
|
|
122
126
|
h as getKey
|
|
123
127
|
};
|
|
124
128
|
//# sourceMappingURL=zudoku.plugin-api-catalog.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zudoku.plugin-api-catalog.js","sources":["../src/lib/plugins/api-catalog/Catalog.tsx","../src/lib/plugins/api-catalog/index.tsx"],"sourcesContent":["import { useSuspenseQuery } from \"@tanstack/react-query\";\nimport { Helmet } from \"@zudoku/react-helmet-async\";\nimport { useMatch } from \"react-router\";\nimport { Link } from \"zudoku/components\";\nimport { useAuthState } from \"../../authentication/state.js\";\nimport { Heading } from \"../../components/Heading.js\";\nimport { Markdown } from \"../../components/Markdown.js\";\nimport { joinUrl } from \"../../util/joinUrl.js\";\nimport { type ApiCatalogPluginOptions, getKey } from \"./index.js\";\n\nexport const Catalog = ({\n items,\n filterCatalogItems = (items) => items,\n label = \"API Library\",\n categoryLabel,\n}: Omit<ApiCatalogPluginOptions, \"path\"> & {\n categoryLabel?: string;\n}) => {\n const auth = useAuthState();\n const match = useMatch({ path: \"/catalog/:category\" });\n const activeCategory = match?.params.category;\n\n const catalogItems = useSuspenseQuery({\n queryFn: () => filterCatalogItems(items, { auth }),\n queryKey: [\"catalogItems\", auth],\n });\n\n // Only index the overview page, ignore the rest\n const dataSet = activeCategory ? { \"data-pagefind-ignore\": \"all\" } : {};\n\n return (\n <section className=\"pt-(--padding-content-top)\" {...dataSet}>\n <Helmet>\n <title>\n {categoryLabel ? `${categoryLabel} - ` : \"\"}\n {label}\n </title>\n </Helmet>\n <div className=\"grid gap-4\">\n <Heading level={2}>\n {label}\n {categoryLabel && ` - ${categoryLabel}`}\n </Heading>\n\n <div className=\"grid grid-cols-2 gap-4\">\n {catalogItems.data\n .filter(\n (api) =>\n !activeCategory ||\n api.categories.find((c) =>\n c.tags.find((t) => getKey(c.label, t) === activeCategory),\n ),\n )\n .map((api) => (\n <Link\n to={joinUrl(api.path)}\n className=\"no-underline hover:!text-foreground\"\n key={api.path}\n >\n <div className=\"border h-full rounded-lg p-4 flex flex-col gap-2 cursor-pointer hover:bg-border/20 font-normal\">\n <span className=\"font-semibold\">{api.label}</span>\n <Markdown\n className=\"text-sm whitespace-pre-wrap mb-6 line-clamp-2\"\n content={api.description}\n components={{\n // Because we're wrapping the description in a Link already,\n // we need to strip out other links to not get a hydration error, like:\n // > In HTML, <a> cannot be a descendant of <a>.\n // > This will cause a hydration error.\n a: (props) => <span {...props} />,\n }}\n />\n </div>\n </Link>\n ))}\n </div>\n </div>\n </section>\n );\n};\n","import slugify from \"@sindresorhus/slugify\";\nimport { matchPath } from \"react-router\";\nimport type { NavigationItem } from \"../../../config/validators/NavigationSchema.js\";\nimport type { AuthState } from \"../../authentication/state.js\";\nimport type { ZudokuPlugin } from \"../../core/plugins.js\";\nimport { joinUrl } from \"../../util/joinUrl.js\";\nimport { Catalog } from \"./Catalog.js\";\n\nexport const getKey = (category: string, tag: string) =>\n slugify(`${category}-${tag}`);\n\nexport type ApiCatalogItem = {\n path: string;\n label: string;\n description: string;\n categories: CatalogCategory[];\n};\n\nexport type CatalogCategory = {\n label: string;\n tags: string[];\n};\n\nexport type ApiCatalogPluginOptions = {\n path: string;\n label: string;\n categories?: CatalogCategory[];\n items: ApiCatalogItem[];\n filterCatalogItems?: FilterCatalogItemsFn;\n};\n\nexport type CatalogContext<ProviderData = unknown> = {\n auth: AuthState<ProviderData>;\n};\n\nexport type FilterCatalogItemsFn<ProviderData = unknown> = (\n items: ApiCatalogItem[],\n { auth }: CatalogContext<ProviderData>,\n) => ApiCatalogItem[];\n\nexport const apiCatalogPlugin = ({\n path,\n items,\n label,\n categories = [],\n filterCatalogItems,\n}: {\n path: string;\n label: string;\n categories?: CatalogCategory[];\n items: ApiCatalogItem[];\n filterCatalogItems?: FilterCatalogItemsFn;\n}): ZudokuPlugin => {\n const paths = Object.fromEntries(\n categories.flatMap((category) =>\n [undefined, ...category.tags].map((tag) => [\n joinUrl(path, tag ? getKey(category.label, tag) : undefined),\n tag,\n ]),\n ),\n );\n\n return {\n getNavigation: async (currentPath) => {\n const matches = Object.keys(paths).some((path) =>\n matchPath(path, currentPath),\n );\n\n if (!matches) {\n return [];\n }\n\n const navigation: NavigationItem[] = categories.map((category) => ({\n type: \"category\",\n label: category.label,\n collapsible: false,\n items: category.tags.map((tag) => ({\n type: \"link\",\n to: joinUrl(path, getKey(category.label, tag)),\n label: tag,\n badge: {\n label: String(\n items.filter((api) =>\n api.categories.find((c) => c.tags.includes(tag)),\n ).length,\n ),\n color: \"outline\",\n },\n })),\n }));\n\n navigation.unshift({\n type: \"link\",\n to: joinUrl(path),\n label: \"Overview\",\n badge: { label: String(items.length), color: \"outline\" },\n });\n\n return navigation;\n },\n getRoutes: () =>\n Object.entries(paths).map(([path, tag]) => ({\n path,\n element: (\n <Catalog\n label={label}\n categoryLabel={tag}\n items={items}\n filterCatalogItems={filterCatalogItems}\n categories={categories}\n />\n ),\n })),\n };\n};\n"],"names":["Catalog","items","filterCatalogItems","label","categoryLabel","auth","useAuthState","activeCategory","useMatch","catalogItems","useSuspenseQuery","dataSet","jsxs","jsx","Helmet","Heading","api","c","t","getKey","Link","joinUrl","Markdown","props","category","tag","slugify","apiCatalogPlugin","path","categories","paths","currentPath","matchPath","navigation"],"mappings":"
|
|
1
|
+
{"version":3,"file":"zudoku.plugin-api-catalog.js","sources":["../src/lib/plugins/api-catalog/Catalog.tsx","../src/lib/plugins/api-catalog/index.tsx"],"sourcesContent":["import { useSuspenseQuery } from \"@tanstack/react-query\";\nimport { Helmet } from \"@zudoku/react-helmet-async\";\nimport { useMatch } from \"react-router\";\nimport { Link } from \"zudoku/components\";\nimport { useAuthState } from \"../../authentication/state.js\";\nimport { Heading } from \"../../components/Heading.js\";\nimport { Markdown } from \"../../components/Markdown.js\";\nimport { joinUrl } from \"../../util/joinUrl.js\";\nimport { type ApiCatalogPluginOptions, getKey } from \"./index.js\";\n\nexport const Catalog = ({\n items,\n filterCatalogItems = (items) => items,\n label = \"API Library\",\n categoryLabel,\n}: Omit<ApiCatalogPluginOptions, \"path\"> & {\n categoryLabel?: string;\n}) => {\n const auth = useAuthState();\n const match = useMatch({ path: \"/catalog/:category\" });\n const activeCategory = match?.params.category;\n\n const catalogItems = useSuspenseQuery({\n queryFn: () => filterCatalogItems(items, { auth }),\n queryKey: [\"catalogItems\", auth],\n });\n\n // Only index the overview page, ignore the rest\n const dataSet = activeCategory ? { \"data-pagefind-ignore\": \"all\" } : {};\n\n return (\n <section className=\"pt-(--padding-content-top)\" {...dataSet}>\n <Helmet>\n <title>\n {categoryLabel ? `${categoryLabel} - ` : \"\"}\n {label}\n </title>\n </Helmet>\n <div className=\"grid gap-4\">\n <Heading level={2}>\n {label}\n {categoryLabel && ` - ${categoryLabel}`}\n </Heading>\n\n <div className=\"grid grid-cols-2 gap-4\">\n {catalogItems.data\n .filter(\n (api) =>\n !activeCategory ||\n api.categories.find((c) =>\n c.tags.find((t) => getKey(c.label, t) === activeCategory),\n ),\n )\n .map((api) => (\n <Link\n to={joinUrl(api.path)}\n className=\"no-underline hover:!text-foreground\"\n key={api.path}\n >\n <div className=\"border h-full rounded-lg p-4 flex flex-col gap-2 cursor-pointer hover:bg-border/20 font-normal\">\n <span className=\"font-semibold\">{api.label}</span>\n <Markdown\n className=\"text-sm whitespace-pre-wrap mb-6 line-clamp-2\"\n content={api.description}\n components={{\n // Because we're wrapping the description in a Link already,\n // we need to strip out other links to not get a hydration error, like:\n // > In HTML, <a> cannot be a descendant of <a>.\n // > This will cause a hydration error.\n a: (props) => <span {...props} />,\n }}\n />\n </div>\n </Link>\n ))}\n </div>\n </div>\n </section>\n );\n};\n","import slugify from \"@sindresorhus/slugify\";\nimport { matchPath } from \"react-router\";\nimport type { NavigationItem } from \"../../../config/validators/NavigationSchema.js\";\nimport type { AuthState } from \"../../authentication/state.js\";\nimport type { ZudokuPlugin } from \"../../core/plugins.js\";\nimport { joinUrl } from \"../../util/joinUrl.js\";\nimport { Catalog } from \"./Catalog.js\";\n\nexport const getKey = (category: string, tag: string) =>\n slugify(`${category}-${tag}`);\n\nexport type ApiCatalogItem = {\n path: string;\n label: string;\n description: string;\n categories: CatalogCategory[];\n};\n\nexport type CatalogCategory = {\n label: string;\n tags: string[];\n};\n\nexport type ApiCatalogPluginOptions = {\n path: string;\n label: string;\n categories?: CatalogCategory[];\n items: ApiCatalogItem[];\n filterCatalogItems?: FilterCatalogItemsFn;\n};\n\nexport type CatalogContext<ProviderData = unknown> = {\n auth: AuthState<ProviderData>;\n};\n\nexport type FilterCatalogItemsFn<ProviderData = unknown> = (\n items: ApiCatalogItem[],\n { auth }: CatalogContext<ProviderData>,\n) => ApiCatalogItem[];\n\nexport const apiCatalogPlugin = ({\n path,\n items,\n label,\n categories = [],\n filterCatalogItems,\n}: {\n path: string;\n label: string;\n categories?: CatalogCategory[];\n items: ApiCatalogItem[];\n filterCatalogItems?: FilterCatalogItemsFn;\n}): ZudokuPlugin => {\n const paths = Object.fromEntries(\n categories.flatMap((category) =>\n [undefined, ...category.tags].map((tag) => [\n joinUrl(path, tag ? getKey(category.label, tag) : undefined),\n tag,\n ]),\n ),\n );\n\n return {\n getNavigation: async (currentPath) => {\n const matches = Object.keys(paths).some((path) =>\n matchPath(path, currentPath),\n );\n\n if (!matches) {\n return [];\n }\n\n const navigation: NavigationItem[] = categories.map((category) => ({\n type: \"category\",\n label: category.label,\n collapsible: false,\n items: category.tags.map((tag) => ({\n type: \"link\",\n to: joinUrl(path, getKey(category.label, tag)),\n label: tag,\n badge: {\n label: String(\n items.filter((api) =>\n api.categories.find((c) => c.tags.includes(tag)),\n ).length,\n ),\n color: \"outline\",\n },\n })),\n }));\n\n navigation.unshift({\n type: \"link\",\n to: joinUrl(path),\n label: \"Overview\",\n badge: { label: String(items.length), color: \"outline\" },\n });\n\n return navigation;\n },\n getRoutes: () =>\n Object.entries(paths).map(([path, tag]) => ({\n path,\n element: (\n <Catalog\n label={label}\n categoryLabel={tag}\n items={items}\n filterCatalogItems={filterCatalogItems}\n categories={categories}\n />\n ),\n })),\n };\n};\n"],"names":["Catalog","items","filterCatalogItems","label","categoryLabel","auth","useAuthState","activeCategory","useMatch","catalogItems","useSuspenseQuery","dataSet","jsxs","jsx","Helmet","Heading","api","c","t","getKey","Link","joinUrl","Markdown","props","category","tag","slugify","apiCatalogPlugin","path","categories","paths","currentPath","matchPath","navigation"],"mappings":";;;;;;;;;;;AAUO,MAAMA,IAAU,CAAC;AAAA,EACtB,OAAAC;AAAA,EACA,oBAAAC,IAAqB,CAACD,MAAUA;AAAAA,EAChC,OAAAE,IAAQ;AAAA,EACR,eAAAC;AACF,MAEM;AACJ,QAAMC,IAAOC,EAAA,G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