zudoku 0.0.0-feat-openapi-docs-redesign.dab3fc6a → 0.0.0-feat-navigation-at-property.z8cd07fa5
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/app/main.js +1 -1
- package/dist/app/main.js.map +1 -1
- package/dist/app/sentry.js +1 -1
- 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 +55 -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/BuildSchema.js +18 -3
- package/dist/config/validators/BuildSchema.js.map +1 -1
- package/dist/config/validators/InputNavigationSchema.d.ts +133 -45
- package/dist/config/validators/InputNavigationSchema.js +30 -0
- package/dist/config/validators/InputNavigationSchema.js.map +1 -1
- package/dist/config/validators/NavigationSchema.d.ts +18 -4
- package/dist/config/validators/NavigationSchema.js +15 -5
- 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 +104 -14
- package/dist/config/validators/validate.js +15 -4
- package/dist/config/validators/validate.js.map +1 -1
- package/dist/config/validators/validate.test.js +43 -0
- package/dist/config/validators/validate.test.js.map +1 -1
- package/dist/flat-config.d.ts +68 -32
- package/dist/index.d.ts +4 -2
- 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 +17 -8
- 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/Heading.d.ts +1 -1
- package/dist/lib/components/Mermaid.d.ts +7 -0
- package/dist/lib/components/Mermaid.js +42 -0
- package/dist/lib/components/Mermaid.js.map +1 -0
- package/dist/lib/components/MobileTopNavigation.js +3 -2
- package/dist/lib/components/MobileTopNavigation.js.map +1 -1
- package/dist/lib/components/PagefindSearchMeta.d.ts +8 -0
- package/dist/lib/components/PagefindSearchMeta.js +7 -0
- package/dist/lib/components/PagefindSearchMeta.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/Slot.test.js +1 -1
- package/dist/lib/components/Slot.test.js.map +1 -1
- package/dist/lib/components/TopNavigation.d.ts +7 -1
- package/dist/lib/components/TopNavigation.js +8 -3
- package/dist/lib/components/TopNavigation.js.map +1 -1
- package/dist/lib/components/Zudoku.d.ts +4 -1
- package/dist/lib/components/Zudoku.js +5 -11
- package/dist/lib/components/Zudoku.js.map +1 -1
- package/dist/lib/components/context/ZudokuContext.d.ts +9 -4
- package/dist/lib/components/context/ZudokuContext.js +26 -8
- 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 +18 -69
- package/dist/lib/components/index.js +19 -32
- package/dist/lib/components/index.js.map +1 -1
- package/dist/lib/components/navigation/Navigation.js +4 -3
- package/dist/lib/components/navigation/Navigation.js.map +1 -1
- package/dist/lib/components/navigation/NavigationCategory.js +8 -0
- package/dist/lib/components/navigation/NavigationCategory.js.map +1 -1
- package/dist/lib/components/navigation/NavigationFilterContext.d.ts +8 -0
- package/dist/lib/components/navigation/NavigationFilterContext.js +12 -0
- package/dist/lib/components/navigation/NavigationFilterContext.js.map +1 -0
- package/dist/lib/components/navigation/NavigationFilterInput.d.ts +3 -0
- package/dist/lib/components/navigation/NavigationFilterInput.js +9 -0
- package/dist/lib/components/navigation/NavigationFilterInput.js.map +1 -0
- package/dist/lib/components/navigation/NavigationItem.js +13 -3
- package/dist/lib/components/navigation/NavigationItem.js.map +1 -1
- package/dist/lib/components/navigation/NavigationWrapper.js +1 -1
- package/dist/lib/components/navigation/NavigationWrapper.js.map +1 -1
- package/dist/lib/components/navigation/utils.d.ts +6 -1
- package/dist/lib/components/navigation/utils.js +26 -2
- package/dist/lib/components/navigation/utils.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/ZudokuContext.d.ts +2 -1
- package/dist/lib/core/ZudokuContext.js +3 -1
- package/dist/lib/core/ZudokuContext.js.map +1 -1
- package/dist/lib/core/__internal.d.ts +1 -0
- package/dist/lib/core/__internal.js +2 -0
- package/dist/lib/core/__internal.js.map +1 -1
- package/dist/lib/core/plugins.d.ts +18 -4
- 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 +4 -0
- package/dist/lib/core/transform-config.js +42 -0
- package/dist/lib/core/transform-config.js.map +1 -0
- package/dist/lib/core/transform-config.test.d.ts +1 -0
- package/dist/lib/core/transform-config.test.js +83 -0
- package/dist/lib/core/transform-config.test.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 +7 -28
- package/dist/lib/hooks/index.js +7 -15
- package/dist/lib/hooks/index.js.map +1 -1
- package/dist/lib/hooks/useEvent.test.js +1 -1
- package/dist/lib/hooks/useEvent.test.js.map +1 -1
- package/dist/lib/navigation/pathMatcher.d.ts +8 -0
- package/dist/lib/navigation/pathMatcher.js +62 -0
- package/dist/lib/navigation/pathMatcher.js.map +1 -0
- package/dist/lib/navigation/pathMatcher.test.d.ts +1 -0
- package/dist/lib/navigation/pathMatcher.test.js +115 -0
- package/dist/lib/navigation/pathMatcher.test.js.map +1 -0
- package/dist/lib/navigation/positionItems.d.ts +10 -0
- package/dist/lib/navigation/positionItems.js +54 -0
- package/dist/lib/navigation/positionItems.js.map +1 -0
- package/dist/lib/navigation/positionItems.test.d.ts +1 -0
- package/dist/lib/navigation/positionItems.test.js +229 -0
- package/dist/lib/navigation/positionItems.test.js.map +1 -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/oas/parser/index.d.ts +1 -0
- 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/DownloadSchemaButton.d.ts +3 -0
- package/dist/lib/plugins/openapi/DownloadSchemaButton.js +47 -0
- package/dist/lib/plugins/openapi/DownloadSchemaButton.js.map +1 -0
- package/dist/lib/plugins/openapi/Endpoint.js +3 -6
- package/dist/lib/plugins/openapi/Endpoint.js.map +1 -1
- package/dist/lib/plugins/openapi/GeneratedExampleSidecarBox.js +1 -1
- package/dist/lib/plugins/openapi/OasProvider.js +26 -13
- package/dist/lib/plugins/openapi/OasProvider.js.map +1 -1
- package/dist/lib/plugins/openapi/OperationList.js +20 -10
- package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
- package/dist/lib/plugins/openapi/OperationListItem.js +2 -2
- package/dist/lib/plugins/openapi/OperationListItem.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/ParameterList.js +1 -1
- package/dist/lib/plugins/openapi/ParameterList.js.map +1 -1
- package/dist/lib/plugins/openapi/ResponsesSidecarBox.d.ts +2 -1
- package/dist/lib/plugins/openapi/ResponsesSidecarBox.js +4 -3
- package/dist/lib/plugins/openapi/ResponsesSidecarBox.js.map +1 -1
- package/dist/lib/plugins/openapi/SchemaList.js +2 -1
- package/dist/lib/plugins/openapi/SchemaList.js.map +1 -1
- package/dist/lib/plugins/openapi/Sidecar.js +12 -3
- package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
- package/dist/lib/plugins/openapi/index.js +11 -5
- package/dist/lib/plugins/openapi/index.js.map +1 -1
- package/dist/lib/plugins/openapi/interfaces.d.ts +19 -13
- package/dist/lib/plugins/openapi/playground/Playground.js +8 -4
- package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/fileUtils.d.ts +1 -0
- package/dist/lib/plugins/openapi/playground/fileUtils.js +3 -0
- package/dist/lib/plugins/openapi/playground/fileUtils.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/result-panel/AudioPlayer.d.ts +6 -0
- package/dist/lib/plugins/openapi/playground/result-panel/AudioPlayer.js +20 -0
- package/dist/lib/plugins/openapi/playground/result-panel/AudioPlayer.js.map +1 -0
- package/dist/lib/plugins/openapi/playground/result-panel/ResponseTab.js +7 -2
- package/dist/lib/plugins/openapi/playground/result-panel/ResponseTab.js.map +1 -1
- package/dist/lib/plugins/openapi/schema/SchemaView.d.ts +1 -1
- package/dist/lib/plugins/openapi/schema/SchemaView.js +16 -7
- package/dist/lib/plugins/openapi/schema/SchemaView.js.map +1 -1
- package/dist/lib/plugins/openapi/schema/utils.d.ts +2 -2
- 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 +9 -1
- package/dist/lib/plugins/openapi/util/getRoutes.js +30 -2
- package/dist/lib/plugins/openapi/util/getRoutes.js.map +1 -1
- package/dist/lib/plugins/search-pagefind/IndexingDialog.d.ts +3 -0
- package/dist/lib/plugins/search-pagefind/IndexingDialog.js +64 -0
- package/dist/lib/plugins/search-pagefind/IndexingDialog.js.map +1 -0
- package/dist/lib/plugins/search-pagefind/PagefindSearch.js +22 -5
- package/dist/lib/plugins/search-pagefind/PagefindSearch.js.map +1 -1
- package/dist/lib/plugins/search-pagefind/ResultList.js +5 -4
- package/dist/lib/plugins/search-pagefind/ResultList.js.map +1 -1
- package/dist/lib/shiki.d.ts +1 -1
- package/dist/lib/shiki.js +18 -12
- package/dist/lib/shiki.js.map +1 -1
- package/dist/lib/ui/Alert.d.ts +3 -2
- package/dist/lib/ui/Alert.js +9 -5
- package/dist/lib/ui/Alert.js.map +1 -1
- package/dist/lib/ui/Button.d.ts +2 -2
- package/dist/lib/ui/Button.js +10 -9
- package/dist/lib/ui/Button.js.map +1 -1
- package/dist/lib/ui/ButtonGroup.d.ts +11 -0
- package/dist/lib/ui/ButtonGroup.js +28 -0
- package/dist/lib/ui/ButtonGroup.js.map +1 -0
- package/dist/lib/ui/Command.d.ts +3 -3
- package/dist/lib/ui/Command.js +2 -2
- package/dist/lib/ui/Command.js.map +1 -1
- package/dist/lib/ui/DropdownMenu.d.ts +21 -23
- package/dist/lib/ui/DropdownMenu.js +47 -32
- package/dist/lib/ui/DropdownMenu.js.map +1 -1
- package/dist/lib/ui/InputGroup.d.ts +16 -0
- package/dist/lib/ui/InputGroup.js +65 -0
- package/dist/lib/ui/InputGroup.js.map +1 -0
- package/dist/lib/ui/Kbd.d.ts +3 -0
- package/dist/lib/ui/Kbd.js +10 -0
- package/dist/lib/ui/Kbd.js.map +1 -0
- package/dist/lib/ui/Secret.js +2 -2
- package/dist/lib/ui/Secret.js.map +1 -1
- package/dist/lib/util/MdxComponents.d.ts +1 -0
- package/dist/lib/util/MdxComponents.js +2 -0
- package/dist/lib/util/MdxComponents.js.map +1 -1
- package/dist/lib/util/flattenAllOf.d.ts +0 -2
- package/dist/lib/util/flattenAllOf.js +0 -23
- package/dist/lib/util/flattenAllOf.js.map +1 -1
- package/dist/lib/util/flattenAllOf.test.js +69 -13
- 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.d.ts +6 -0
- package/dist/lib/util/readFrontmatter.js +13 -0
- package/dist/lib/util/readFrontmatter.js.map +1 -0
- package/dist/vite/api/SchemaManager.d.ts +17 -1
- package/dist/vite/api/SchemaManager.js +52 -11
- package/dist/vite/api/SchemaManager.js.map +1 -1
- package/dist/vite/api/SchemaManager.test.js +111 -0
- 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 +16 -1
- package/dist/vite/config.js.map +1 -1
- package/dist/vite/dev-server.js +25 -0
- package/dist/vite/dev-server.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-last-modified.js +57 -3
- package/dist/vite/mdx/remark-last-modified.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/pagefind-dev-index.d.ts +16 -0
- package/dist/vite/pagefind-dev-index.js +68 -0
- package/dist/vite/pagefind-dev-index.js.map +1 -0
- 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 +44 -4
- package/dist/vite/plugin-api.js.map +1 -1
- package/dist/vite/plugin-config.js +16 -4
- package/dist/vite/plugin-config.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-frontmatter.js +3 -5
- package/dist/vite/plugin-frontmatter.js.map +1 -1
- package/dist/vite/plugin-markdown-export.js +8 -7
- 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/prerender.js +4 -20
- package/dist/vite/prerender/prerender.js.map +1 -1
- package/dist/vite/prerender/utils.d.ts +2 -0
- package/dist/vite/prerender/utils.js +30 -0
- package/dist/vite/prerender/utils.js.map +1 -0
- package/dist/vite/prerender/worker.js +6 -1
- 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-B0CXL1Lq.js +25 -0
- package/lib/ActionButton-B0CXL1Lq.js.map +1 -0
- package/lib/Button-GUVe7pmt.js +54 -0
- package/lib/Button-GUVe7pmt.js.map +1 -0
- 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-DoZ7fHHk.js +73 -0
- package/lib/ClaudeLogo-DoZ7fHHk.js.map +1 -0
- package/lib/{Command-CUcrW3qs.js → Command-N6VujV30.js} +26 -26
- package/lib/Command-N6VujV30.js.map +1 -0
- 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-DN0jNrjj.js +104 -0
- package/lib/DropdownMenu-DN0jNrjj.js.map +1 -0
- package/lib/Frame-DKlOmSkU.js +205 -0
- package/lib/Frame-DKlOmSkU.js.map +1 -0
- package/lib/HydrationBoundary-CJu4vUlG.js +601 -0
- package/lib/HydrationBoundary-CJu4vUlG.js.map +1 -0
- package/lib/IndexingDialog-D0YdGfbn.js +100 -0
- package/lib/IndexingDialog-D0YdGfbn.js.map +1 -0
- package/lib/Input-Cx-GeKoF.js +22 -0
- package/lib/Input-Cx-GeKoF.js.map +1 -0
- package/lib/MdxPage-Bc_5OsQ5.js +210 -0
- package/lib/MdxPage-Bc_5OsQ5.js.map +1 -0
- package/lib/Mermaid-Chx5BPHn.js +104 -0
- package/lib/Mermaid-Chx5BPHn.js.map +1 -0
- package/lib/{OAuthErrorPage-DnKnq4xK.js → OAuthErrorPage-D-VcZ5cO.js} +26 -23
- package/lib/OAuthErrorPage-D-VcZ5cO.js.map +1 -0
- package/lib/OasProvider-CZqLHoRo.js +48 -0
- package/lib/OasProvider-CZqLHoRo.js.map +1 -0
- package/lib/{OperationList-D8EDc9v7.js → OperationList-BmV1XvEY.js} +2136 -2002
- package/lib/OperationList-BmV1XvEY.js.map +1 -0
- package/lib/RouteGuard-Dns7HD7C.js +77 -0
- package/lib/RouteGuard-Dns7HD7C.js.map +1 -0
- package/lib/{SchemaList-E6lF7dID.js → SchemaList-D23IyrX5.js} +28 -27
- package/lib/SchemaList-D23IyrX5.js.map +1 -0
- package/lib/SchemaView-DVbiGPo3.js +438 -0
- package/lib/SchemaView-DVbiGPo3.js.map +1 -0
- package/lib/Secret-CyhXSA8i.js +263 -0
- package/lib/Secret-CyhXSA8i.js.map +1 -0
- package/lib/SignUp-DfEe1w5X.js +55 -0
- package/lib/SignUp-DfEe1w5X.js.map +1 -0
- package/lib/{SyntaxHighlight-C19vH0V_.js → SyntaxHighlight-N2RffYNz.js} +1469 -1411
- package/lib/SyntaxHighlight-N2RffYNz.js.map +1 -0
- package/lib/{Toc-DbWS75JZ.js → Toc-Cpo_HSYx.js} +3 -3
- package/lib/{Toc-DbWS75JZ.js.map → Toc-Cpo_HSYx.js.map} +1 -1
- package/lib/{ErrorAlert-_1Zmhr68.js → Zudoku-GbutmWzP.js} +5663 -4482
- package/lib/Zudoku-GbutmWzP.js.map +1 -0
- package/lib/ZudokuContext-LPkD2SQs.js +250 -0
- package/lib/ZudokuContext-LPkD2SQs.js.map +1 -0
- package/lib/ZudokuReactContext-DGJAP1sN.js +222 -0
- package/lib/ZudokuReactContext-DGJAP1sN.js.map +1 -0
- package/lib/chunk-EPOLDU6W-C6C8jAwd.js +8558 -0
- package/lib/chunk-EPOLDU6W-C6C8jAwd.js.map +1 -0
- package/lib/{circular-BoYo7au5.js → circular-DfSpMuY7.js} +6429 -6019
- package/lib/circular-DfSpMuY7.js.map +1 -0
- package/lib/{cn-dYga0KKN.js → cn-5-Gd1Dss.js} +531 -498
- package/lib/cn-5-Gd1Dss.js.map +1 -0
- package/lib/{createServer-B_BZ7xX8.js → createServer-4kaAMuIM.js} +2790 -2737
- package/lib/createServer-4kaAMuIM.js.map +1 -0
- package/lib/createVariantComponent-Dc0vtOvr.js +18 -0
- package/lib/createVariantComponent-Dc0vtOvr.js.map +1 -0
- package/lib/{errors-CD873hrG.js → errors-CtZTDEB6.js} +3 -3
- package/lib/{errors-CD873hrG.js.map → errors-CtZTDEB6.js.map} +1 -1
- package/lib/firebase-D286uF4e.js +7615 -0
- package/lib/firebase-D286uF4e.js.map +1 -0
- package/lib/hook-DyEn6D2Q.js +53 -0
- package/lib/hook-DyEn6D2Q.js.map +1 -0
- package/lib/{index-HNVs5cgX.js → index-B7bvsQHg.js} +853 -802
- package/lib/index-B7bvsQHg.js.map +1 -0
- package/lib/{index-BK0jKRrX.js → index-CVumYRba.js} +2 -2
- package/lib/{index-BK0jKRrX.js.map → index-CVumYRba.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.esm-BYObtETB.js.map +1 -1
- package/lib/index.esm-BkpWrvLZ.js +34 -0
- package/lib/index.esm-BkpWrvLZ.js.map +1 -0
- package/lib/{index.esm-BnYHxCYC.js → index.esm-Ca5zvoff.js} +2 -2
- package/lib/{index.esm-BnYHxCYC.js.map → index.esm-Ca5zvoff.js.map} +1 -1
- package/lib/{invariant-Bm-FVUQE.js → invariant-B_t_F2s_.js} +4 -4
- package/lib/invariant-B_t_F2s_.js.map +1 -0
- package/lib/jsx-runtime-BzflLqGi.js.map +1 -1
- package/lib/{mutation-BSU0xu4m.js → mutation-B7eFBLZY.js} +70 -44
- package/lib/mutation-B7eFBLZY.js.map +1 -0
- package/lib/ui/Accordion.js +1 -1
- package/lib/ui/ActionButton.js +2 -2
- package/lib/ui/Alert.js +32 -20
- package/lib/ui/Alert.js.map +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 +27 -25
- package/lib/ui/Button.js.map +1 -1
- package/lib/ui/ButtonGroup.js +77 -0
- package/lib/ui/ButtonGroup.js.map +1 -0
- 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 +5 -5
- package/lib/ui/Command.js.map +1 -1
- package/lib/ui/Dialog.js +1 -1
- package/lib/ui/Drawer.js +3 -3
- package/lib/ui/DropdownMenu.js +227 -140
- package/lib/ui/DropdownMenu.js.map +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/InputGroup.js +155 -0
- package/lib/ui/InputGroup.js.map +1 -0
- package/lib/ui/Item.js +1 -1
- package/lib/ui/Kbd.js +32 -0
- package/lib/ui/Kbd.js.map +1 -0
- 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/useExposedProps-CzTDfXfq.js +30 -0
- package/lib/useExposedProps-CzTDfXfq.js.map +1 -0
- package/lib/useMutation-CErliDZ9.js +119 -0
- package/lib/useMutation-CErliDZ9.js.map +1 -0
- package/lib/useQuery-ht7aWJ3S.js +1212 -0
- package/lib/useQuery-ht7aWJ3S.js.map +1 -0
- package/lib/useSuspenseQuery-DQH4Bmc2.js +18 -0
- package/lib/useSuspenseQuery-DQH4Bmc2.js.map +1 -0
- package/lib/zudoku.__internal.js +1540 -1553
- package/lib/zudoku.__internal.js.map +1 -1
- package/lib/zudoku.auth-auth0.js +19 -18
- package/lib/zudoku.auth-auth0.js.map +1 -1
- package/lib/zudoku.auth-azureb2c.js +14 -13
- package/lib/zudoku.auth-azureb2c.js.map +1 -1
- package/lib/zudoku.auth-clerk.js +52 -75
- package/lib/zudoku.auth-clerk.js.map +1 -1
- package/lib/zudoku.auth-firebase.js +10 -0
- package/lib/zudoku.auth-firebase.js.map +1 -0
- package/lib/zudoku.auth-openid.js +8 -7
- package/lib/zudoku.auth-openid.js.map +1 -1
- 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 +20 -20
- package/lib/zudoku.hooks.js.map +1 -1
- package/lib/zudoku.mermaid.js +11 -0
- package/lib/zudoku.mermaid.js.map +1 -0
- package/lib/zudoku.plugin-api-catalog.js +42 -37
- package/lib/zudoku.plugin-api-catalog.js.map +1 -1
- package/lib/zudoku.plugin-api-keys.js +617 -550
- 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 +186 -226
- 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 +441 -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 +63 -37
- package/src/app/defaultTheme.css +4 -0
- package/src/app/main.css +2 -0
- package/src/app/main.tsx +1 -1
- package/src/app/sentry.ts +1 -1
- 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 +21 -10
- 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/Mermaid.tsx +68 -0
- package/src/lib/components/MobileTopNavigation.tsx +16 -9
- package/src/lib/components/PagefindSearchMeta.tsx +14 -0
- package/src/lib/components/Pagination.tsx +4 -5
- package/src/lib/components/Slot.test.tsx +1 -1
- package/src/lib/components/TopNavigation.tsx +26 -8
- package/src/lib/components/Zudoku.tsx +22 -21
- package/src/lib/components/context/ZudokuContext.ts +33 -12
- package/src/lib/components/context/ZudokuProvider.tsx +1 -1
- package/src/lib/components/context/ZudokuReactContext.tsx +17 -0
- package/src/lib/components/index.ts +19 -35
- package/src/lib/components/navigation/Navigation.tsx +4 -3
- package/src/lib/components/navigation/NavigationCategory.tsx +9 -0
- package/src/lib/components/navigation/NavigationFilterContext.tsx +28 -0
- package/src/lib/components/navigation/NavigationFilterInput.tsx +35 -0
- package/src/lib/components/navigation/NavigationItem.tsx +26 -4
- package/src/lib/components/navigation/NavigationWrapper.tsx +1 -1
- package/src/lib/components/navigation/utils.ts +44 -2
- package/src/lib/core/RouteGuard.tsx +30 -24
- package/src/lib/core/ZudokuContext.ts +7 -1
- package/src/lib/core/__internal.tsx +2 -0
- package/src/lib/core/plugins.ts +27 -3
- package/src/lib/core/react-query.ts +1 -0
- package/src/lib/core/transform-config.test.tsx +99 -0
- package/src/lib/core/transform-config.ts +67 -0
- package/src/lib/errors/ErrorAlert.tsx +1 -6
- package/src/lib/errors/ErrorMessage.tsx +38 -0
- package/src/lib/hooks/index.ts +7 -16
- package/src/lib/hooks/useEvent.test.tsx +1 -1
- package/src/lib/navigation/pathMatcher.test.ts +136 -0
- package/src/lib/navigation/pathMatcher.ts +93 -0
- package/src/lib/navigation/positionItems.test.ts +265 -0
- package/src/lib/navigation/positionItems.ts +111 -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/oas/parser/index.ts +19 -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/DownloadSchemaButton.tsx +115 -0
- package/src/lib/plugins/openapi/Endpoint.tsx +20 -27
- package/src/lib/plugins/openapi/GeneratedExampleSidecarBox.tsx +1 -1
- package/src/lib/plugins/openapi/OasProvider.tsx +38 -17
- package/src/lib/plugins/openapi/OperationList.tsx +48 -28
- package/src/lib/plugins/openapi/OperationListItem.tsx +5 -5
- package/src/lib/plugins/openapi/ParamInfos.tsx +1 -0
- package/src/lib/plugins/openapi/ParameterList.tsx +2 -2
- package/src/lib/plugins/openapi/ResponsesSidecarBox.tsx +37 -15
- package/src/lib/plugins/openapi/SchemaList.tsx +4 -0
- package/src/lib/plugins/openapi/Sidecar.tsx +20 -3
- package/src/lib/plugins/openapi/index.tsx +16 -7
- package/src/lib/plugins/openapi/interfaces.ts +21 -7
- package/src/lib/plugins/openapi/playground/Playground.tsx +8 -4
- package/src/lib/plugins/openapi/playground/fileUtils.ts +4 -0
- package/src/lib/plugins/openapi/playground/result-panel/AudioPlayer.tsx +50 -0
- package/src/lib/plugins/openapi/playground/result-panel/ResponseTab.tsx +33 -17
- package/src/lib/plugins/openapi/schema/SchemaView.tsx +56 -43
- package/src/lib/plugins/openapi/schema/utils.ts +20 -6
- package/src/lib/plugins/openapi/util/createHttpSnippet.ts +29 -1
- package/src/lib/plugins/openapi/util/getRoutes.tsx +38 -3
- package/src/lib/plugins/search-pagefind/IndexingDialog.tsx +163 -0
- package/src/lib/plugins/search-pagefind/PagefindSearch.tsx +61 -22
- package/src/lib/plugins/search-pagefind/ResultList.tsx +8 -3
- package/src/lib/shiki.ts +21 -12
- package/src/lib/ui/Alert.tsx +17 -5
- package/src/lib/ui/Button.tsx +11 -10
- package/src/lib/ui/ButtonGroup.tsx +82 -0
- package/src/lib/ui/Command.tsx +3 -3
- package/src/lib/ui/DropdownMenu.tsx +226 -170
- package/src/lib/ui/InputGroup.tsx +168 -0
- package/src/lib/ui/Kbd.tsx +28 -0
- package/src/lib/ui/Secret.tsx +2 -2
- package/src/lib/util/MdxComponents.tsx +2 -0
- package/src/lib/util/flattenAllOf.test.ts +73 -20
- package/src/lib/util/flattenAllOf.ts +0 -36
- package/src/lib/util/flattenAllOfProcessor.ts +58 -0
- package/src/lib/util/invariant.ts +2 -1
- package/src/lib/util/readFrontmatter.ts +14 -0
- package/src/shiki/langs/c3.js +1 -0
- package/src/shiki/langs/gn.js +1 -0
- package/src/shiki/langs/markdown-nix.js +1 -0
- package/src/shiki/langs/moonbit.js +1 -0
- package/src/shiki/langs/openscad.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/dist/vite/create-pagefind-index.d.ts +0 -4
- package/dist/vite/create-pagefind-index.js +0 -12
- package/dist/vite/create-pagefind-index.js.map +0 -1
- package/lib/Button-B3ucvvQw.js +0 -52
- package/lib/Button-B3ucvvQw.js.map +0 -1
- package/lib/Command-CUcrW3qs.js.map +0 -1
- package/lib/DropdownMenu-BZ2NKQ3K.js +0 -126
- package/lib/DropdownMenu-BZ2NKQ3K.js.map +0 -1
- package/lib/ErrorAlert-_1Zmhr68.js.map +0 -1
- package/lib/MdxPage-B2t1EShN.js +0 -240
- package/lib/MdxPage-B2t1EShN.js.map +0 -1
- package/lib/OAuthErrorPage-DnKnq4xK.js.map +0 -1
- package/lib/OasProvider-BhuIkD4Z.js +0 -36
- package/lib/OasProvider-BhuIkD4Z.js.map +0 -1
- package/lib/OperationList-D8EDc9v7.js.map +0 -1
- package/lib/Pagination-hk-llhpw.js +0 -37
- package/lib/Pagination-hk-llhpw.js.map +0 -1
- package/lib/RouteGuard-Brz95MSt.js +0 -77
- package/lib/RouteGuard-Brz95MSt.js.map +0 -1
- package/lib/RouterError-CMaIfdjb.js +0 -42
- package/lib/RouterError-CMaIfdjb.js.map +0 -1
- package/lib/SchemaList-E6lF7dID.js.map +0 -1
- package/lib/SchemaView-CIv-OXgv.js +0 -572
- package/lib/SchemaView-CIv-OXgv.js.map +0 -1
- package/lib/Select-DFRCS31-.js +0 -399
- package/lib/Select-DFRCS31-.js.map +0 -1
- package/lib/SignUp-sGYAsj2K.js +0 -50
- package/lib/SignUp-sGYAsj2K.js.map +0 -1
- package/lib/SyntaxHighlight-C19vH0V_.js.map +0 -1
- package/lib/ZudokuContext-BUZ5hkWB.js +0 -1508
- package/lib/ZudokuContext-BUZ5hkWB.js.map +0 -1
- package/lib/chunk-PVWAREVJ-BMhpCH5D.js +0 -7965
- package/lib/chunk-PVWAREVJ-BMhpCH5D.js.map +0 -1
- package/lib/circular-BoYo7au5.js.map +0 -1
- package/lib/cn-dYga0KKN.js.map +0 -1
- package/lib/createServer-B_BZ7xX8.js.map +0 -1
- package/lib/hook-CMeoxziF.js +0 -40
- package/lib/hook-CMeoxziF.js.map +0 -1
- package/lib/index-HNVs5cgX.js.map +0 -1
- package/lib/index-pMMX55GH.js +0 -1059
- package/lib/index-pMMX55GH.js.map +0 -1
- package/lib/invariant-Bm-FVUQE.js.map +0 -1
- package/lib/mutation-BSU0xu4m.js.map +0 -1
- package/lib/useExposedProps-U3pmsHaG.js +0 -113
- package/lib/useExposedProps-U3pmsHaG.js.map +0 -1
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { useQuery } from "@tanstack/react-query";
|
|
2
|
+
import type { MermaidConfig } from "mermaid";
|
|
3
|
+
import type { ComponentProps } from "react";
|
|
4
|
+
import { useId } from "react";
|
|
5
|
+
import { Alert, AlertDescription, AlertTitle } from "zudoku/ui/Alert.js";
|
|
6
|
+
import { useTheme } from "../hooks/index.js";
|
|
7
|
+
import { Spinner } from "./Spinner.js";
|
|
8
|
+
|
|
9
|
+
export type MermaidProps = {
|
|
10
|
+
chart: string;
|
|
11
|
+
config?: MermaidConfig;
|
|
12
|
+
} & ComponentProps<"div">;
|
|
13
|
+
|
|
14
|
+
let mermaidPromise: Promise<typeof import("mermaid").default> | null = null;
|
|
15
|
+
|
|
16
|
+
const loadMermaid = () => {
|
|
17
|
+
if (!mermaidPromise) {
|
|
18
|
+
mermaidPromise = import("mermaid")
|
|
19
|
+
.then((mod) => mod.default)
|
|
20
|
+
.catch((error) => {
|
|
21
|
+
throw new Error(
|
|
22
|
+
"Mermaid is not installed. Please install it with: npm install mermaid",
|
|
23
|
+
{ cause: error },
|
|
24
|
+
);
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
return mermaidPromise;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export const Mermaid = ({ chart, config, ...props }: MermaidProps) => {
|
|
31
|
+
const id = useId();
|
|
32
|
+
const theme = useTheme();
|
|
33
|
+
|
|
34
|
+
const {
|
|
35
|
+
data: svg,
|
|
36
|
+
error,
|
|
37
|
+
isPending,
|
|
38
|
+
} = useQuery({
|
|
39
|
+
queryKey: ["mermaid", chart, config, theme.resolvedTheme],
|
|
40
|
+
queryFn: async () => {
|
|
41
|
+
const mermaid = await loadMermaid();
|
|
42
|
+
mermaid.initialize({
|
|
43
|
+
theme: theme.resolvedTheme === "dark" ? "dark" : "base",
|
|
44
|
+
...config,
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
const { svg } = await mermaid.render(id, chart);
|
|
48
|
+
return svg;
|
|
49
|
+
},
|
|
50
|
+
enabled: typeof window !== "undefined",
|
|
51
|
+
retry: false,
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
if (error)
|
|
55
|
+
return (
|
|
56
|
+
<Alert className="flex flex-col gap-2" variant="destructive">
|
|
57
|
+
<AlertTitle>Mermaid Error</AlertTitle>
|
|
58
|
+
<AlertDescription className="overflow-auto wrap-break-word whitespace-pre-wrap font-mono text-xs">
|
|
59
|
+
{error.message}
|
|
60
|
+
</AlertDescription>
|
|
61
|
+
</Alert>
|
|
62
|
+
);
|
|
63
|
+
|
|
64
|
+
if (isPending) return <Spinner />;
|
|
65
|
+
|
|
66
|
+
// biome-ignore lint/security/noDangerouslySetInnerHtml: Mermaid generates valid SVG
|
|
67
|
+
return <div {...props} dangerouslySetInnerHTML={{ __html: svg }} />;
|
|
68
|
+
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { VisuallyHidden } from "@radix-ui/react-visually-hidden";
|
|
2
2
|
import { MenuIcon } from "lucide-react";
|
|
3
3
|
import { useState } from "react";
|
|
4
|
+
import { Separator } from "zudoku/ui/Separator.js";
|
|
4
5
|
import { Skeleton } from "zudoku/ui/Skeleton.js";
|
|
5
6
|
import { useAuth } from "../authentication/hook.js";
|
|
6
7
|
import {
|
|
@@ -28,7 +29,9 @@ export const MobileTopNavigation = () => {
|
|
|
28
29
|
const [drawerOpen, setDrawerOpen] = useState(false);
|
|
29
30
|
|
|
30
31
|
const accountItems = getProfileMenuItems();
|
|
31
|
-
const filteredItems = navigation.filter(
|
|
32
|
+
const filteredItems = navigation.filter(
|
|
33
|
+
shouldShowItem({ auth: authState, context }),
|
|
34
|
+
);
|
|
32
35
|
|
|
33
36
|
return (
|
|
34
37
|
<Drawer
|
|
@@ -43,7 +46,7 @@ export const MobileTopNavigation = () => {
|
|
|
43
46
|
<PageProgress />
|
|
44
47
|
</div>
|
|
45
48
|
<DrawerContent
|
|
46
|
-
className="lg:hidden h-
|
|
49
|
+
className="lg:hidden h-dvh end-0 start-auto w-[320px] rounded-none"
|
|
47
50
|
aria-describedby={undefined}
|
|
48
51
|
>
|
|
49
52
|
<div className="p-4 overflow-y-auto overscroll-none h-full flex flex-col justify-between">
|
|
@@ -84,13 +87,17 @@ export const MobileTopNavigation = () => {
|
|
|
84
87
|
)}
|
|
85
88
|
</ClientOnly>
|
|
86
89
|
)}
|
|
87
|
-
{filteredItems.map((item) =>
|
|
88
|
-
|
|
89
|
-
<
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
90
|
+
{filteredItems.map((item) =>
|
|
91
|
+
item.type === "separator" ? (
|
|
92
|
+
<Separator className="w-full" key={item.label} />
|
|
93
|
+
) : item.type !== "section" && item.type !== "filter" ? (
|
|
94
|
+
<li key={item.label}>
|
|
95
|
+
<button type="button" onClick={() => setDrawerOpen(false)}>
|
|
96
|
+
<TopNavItem {...item} />
|
|
97
|
+
</button>
|
|
98
|
+
</li>
|
|
99
|
+
) : null,
|
|
100
|
+
)}
|
|
94
101
|
{isAuthEnabled && isAuthenticated && accountItems.length > 0 && (
|
|
95
102
|
<ClientOnly
|
|
96
103
|
fallback={<Skeleton className="rounded-sm h-5 w-24 mr-4" />}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { PropsWithChildren } from "react";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Adds metadata to be captured by Pagefind for search results.
|
|
5
|
+
* Content is visually hidden but indexed by the search engine.
|
|
6
|
+
*/
|
|
7
|
+
export const PagefindSearchMeta = ({
|
|
8
|
+
name,
|
|
9
|
+
children,
|
|
10
|
+
}: PropsWithChildren<{ name?: string }>) => (
|
|
11
|
+
<span data-pagefind-meta={name} className="sr-only">
|
|
12
|
+
{children}
|
|
13
|
+
</span>
|
|
14
|
+
);
|
|
@@ -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} />
|
|
@@ -20,7 +20,7 @@ import { Slot } from "./Slot.js";
|
|
|
20
20
|
|
|
21
21
|
const createWrapper = (slots: Record<string, ReactNode> = {}) => {
|
|
22
22
|
const queryClient = new QueryClient();
|
|
23
|
-
const context = new ZudokuContext({}, queryClient);
|
|
23
|
+
const context = new ZudokuContext({}, queryClient, {});
|
|
24
24
|
|
|
25
25
|
const wrapper = ({ children }: PropsWithChildren) => (
|
|
26
26
|
<MemoryRouter initialEntries={["/", "/page"]}>
|
|
@@ -2,6 +2,7 @@ import { cx } from "class-variance-authority";
|
|
|
2
2
|
import { deepEqual } from "fast-equals";
|
|
3
3
|
import { Suspense } from "react";
|
|
4
4
|
import { NavLink, type NavLinkProps } from "react-router";
|
|
5
|
+
import { Separator } from "zudoku/ui/Separator.js";
|
|
5
6
|
import type { NavigationItem } from "../../config/validators/NavigationSchema.js";
|
|
6
7
|
import { useAuth } from "../authentication/hook.js";
|
|
7
8
|
import { joinUrl } from "../util/joinUrl.js";
|
|
@@ -13,7 +14,7 @@ export const TopNavigation = () => {
|
|
|
13
14
|
const context = useZudoku();
|
|
14
15
|
const { navigation } = context;
|
|
15
16
|
const auth = useAuth();
|
|
16
|
-
const filteredItems = navigation.filter(shouldShowItem(auth, context));
|
|
17
|
+
const filteredItems = navigation.filter(shouldShowItem({ auth, context }));
|
|
17
18
|
|
|
18
19
|
if (filteredItems.length === 0 || import.meta.env.MODE === "standalone") {
|
|
19
20
|
return <style>{`:root { --top-nav-height: 0px; }`}</style>;
|
|
@@ -24,11 +25,17 @@ export const TopNavigation = () => {
|
|
|
24
25
|
<div className="items-center justify-between px-8 h-(--top-nav-height) hidden lg:flex text-sm relative">
|
|
25
26
|
<nav className="text-sm">
|
|
26
27
|
<ul className="flex flex-row items-center gap-8">
|
|
27
|
-
{filteredItems.map((item) =>
|
|
28
|
-
|
|
29
|
-
<
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
{filteredItems.map((item) =>
|
|
29
|
+
item.type === "separator" ? (
|
|
30
|
+
<li key={item.label} className="-mx-4 h-7">
|
|
31
|
+
<Separator orientation="vertical" />
|
|
32
|
+
</li>
|
|
33
|
+
) : item.type !== "section" && item.type !== "filter" ? (
|
|
34
|
+
<li key={item.label + item.type}>
|
|
35
|
+
<TopNavItem {...item} />
|
|
36
|
+
</li>
|
|
37
|
+
) : null,
|
|
38
|
+
)}
|
|
32
39
|
</ul>
|
|
33
40
|
</nav>
|
|
34
41
|
<Slot.Target name="top-navigation-side" />
|
|
@@ -51,7 +58,11 @@ const getPathForItem = (item: NavigationItem): string => {
|
|
|
51
58
|
|
|
52
59
|
return (
|
|
53
60
|
traverseNavigationItem(item, (child) => {
|
|
54
|
-
if (
|
|
61
|
+
if (
|
|
62
|
+
child.type !== "category" &&
|
|
63
|
+
child.type !== "separator" &&
|
|
64
|
+
child.type !== "section"
|
|
65
|
+
) {
|
|
55
66
|
return getPathForItem(child);
|
|
56
67
|
}
|
|
57
68
|
}) ?? ""
|
|
@@ -59,6 +70,8 @@ const getPathForItem = (item: NavigationItem): string => {
|
|
|
59
70
|
}
|
|
60
71
|
case "custom-page":
|
|
61
72
|
return item.path;
|
|
73
|
+
default:
|
|
74
|
+
return "";
|
|
62
75
|
}
|
|
63
76
|
};
|
|
64
77
|
|
|
@@ -97,7 +110,12 @@ export const TopNavLink = ({
|
|
|
97
110
|
);
|
|
98
111
|
};
|
|
99
112
|
|
|
100
|
-
export const TopNavItem = (
|
|
113
|
+
export const TopNavItem = (
|
|
114
|
+
item: Exclude<
|
|
115
|
+
NavigationItem,
|
|
116
|
+
{ type: "separator" } | { type: "section" } | { type: "filter" }
|
|
117
|
+
>,
|
|
118
|
+
) => {
|
|
101
119
|
const currentNav = useCurrentNavigation();
|
|
102
120
|
const isActiveTopNavItem = deepEqual(currentNav.topNavItem, item);
|
|
103
121
|
|
|
@@ -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 {
|
|
@@ -33,7 +32,13 @@ import { ZudokuProvider } from "./context/ZudokuProvider.js";
|
|
|
33
32
|
let zudokuContext: ZudokuContext | undefined;
|
|
34
33
|
|
|
35
34
|
const ZudokuInner = memo(
|
|
36
|
-
({
|
|
35
|
+
({
|
|
36
|
+
children,
|
|
37
|
+
env,
|
|
38
|
+
...props
|
|
39
|
+
}: PropsWithChildren<
|
|
40
|
+
ZudokuContextOptions & { env: Record<string, string> }
|
|
41
|
+
>) => {
|
|
37
42
|
const components = useMemo(
|
|
38
43
|
() => ({ ...DEFAULT_COMPONENTS, ...props.overrides }),
|
|
39
44
|
[props.overrides],
|
|
@@ -56,12 +61,7 @@ const ZudokuInner = memo(
|
|
|
56
61
|
...props.mdx?.components,
|
|
57
62
|
};
|
|
58
63
|
}, [props.mdx?.components, props.plugins]);
|
|
59
|
-
const { stagger } = useContext(StaggeredRenderContext);
|
|
60
64
|
const [didNavigate, setDidNavigate] = useState(false);
|
|
61
|
-
const staggeredValue = useMemo(
|
|
62
|
-
() => (didNavigate ? { stagger: true } : { stagger }),
|
|
63
|
-
[stagger, didNavigate],
|
|
64
|
-
);
|
|
65
65
|
const navigation = useNavigation();
|
|
66
66
|
const queryClient = useQueryClient();
|
|
67
67
|
|
|
@@ -72,20 +72,17 @@ const ZudokuInner = memo(
|
|
|
72
72
|
setDidNavigate(true);
|
|
73
73
|
}, [didNavigate, navigation.location]);
|
|
74
74
|
|
|
75
|
-
zudokuContext ??= new ZudokuContext(props, queryClient);
|
|
75
|
+
zudokuContext ??= new ZudokuContext(props, queryClient, env);
|
|
76
76
|
|
|
77
|
-
const heads = props.plugins
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
)
|
|
81
|
-
// biome-ignore lint/suspicious/noArrayIndexKey: No other key is available
|
|
82
|
-
.map((entry, i) => <Helmet key={i}>{entry}</Helmet>);
|
|
77
|
+
const heads = props.plugins?.flatMap((plugin) =>
|
|
78
|
+
hasHead(plugin) ? (plugin.getHead?.({ location }) ?? []) : [],
|
|
79
|
+
);
|
|
83
80
|
|
|
84
81
|
return (
|
|
85
82
|
<>
|
|
86
|
-
{heads}
|
|
87
|
-
<
|
|
88
|
-
<
|
|
83
|
+
<Helmet>{heads}</Helmet>
|
|
84
|
+
<ZudokuProvider context={zudokuContext}>
|
|
85
|
+
<Suspense fallback={<div>Zudoku Loading...</div>}>
|
|
89
86
|
<RouterEventsEmitter />
|
|
90
87
|
<SlotProvider slots={props.slots ?? props.UNSAFE_slotlets}>
|
|
91
88
|
<MDXProvider components={mdxComponents}>
|
|
@@ -98,8 +95,8 @@ const ZudokuInner = memo(
|
|
|
98
95
|
</ThemeProvider>
|
|
99
96
|
</MDXProvider>
|
|
100
97
|
</SlotProvider>
|
|
101
|
-
</
|
|
102
|
-
</
|
|
98
|
+
</Suspense>
|
|
99
|
+
</ZudokuProvider>
|
|
103
100
|
</>
|
|
104
101
|
);
|
|
105
102
|
},
|
|
@@ -107,7 +104,11 @@ const ZudokuInner = memo(
|
|
|
107
104
|
|
|
108
105
|
ZudokuInner.displayName = "ZudokuInner";
|
|
109
106
|
|
|
110
|
-
const Zudoku = (
|
|
107
|
+
const Zudoku = (
|
|
108
|
+
props: PropsWithChildren<
|
|
109
|
+
ZudokuContextOptions & { env: Record<string, string> }
|
|
110
|
+
>,
|
|
111
|
+
) => {
|
|
111
112
|
return (
|
|
112
113
|
<ErrorBoundary FallbackComponent={TopLevelError}>
|
|
113
114
|
<ZudokuInner {...props} />
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { useQuery, useSuspenseQuery } from "@tanstack/react-query";
|
|
2
|
-
import {
|
|
2
|
+
import { useContext, useEffect, useMemo } 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
|
|
6
|
+
import {
|
|
7
|
+
isPositionedItem,
|
|
8
|
+
mergePositionedItems,
|
|
9
|
+
} from "../../navigation/positionItems.js";
|
|
7
10
|
import { joinUrl } from "../../util/joinUrl.js";
|
|
8
11
|
import { CACHE_KEYS, useCache } from "../cache.js";
|
|
9
12
|
import { traverseNavigation } from "../navigation/utils.js";
|
|
10
|
-
|
|
11
|
-
export const ZudokuReactContext = createContext<ZudokuContext | undefined>(
|
|
12
|
-
undefined,
|
|
13
|
-
);
|
|
13
|
+
import { ZudokuReactContext } from "./ZudokuReactContext.js";
|
|
14
14
|
|
|
15
15
|
export const useZudoku = () => {
|
|
16
16
|
const context = useContext(ZudokuReactContext);
|
|
@@ -73,10 +73,12 @@ const extractAllPaths = (items: NavigationItem[]) => {
|
|
|
73
73
|
};
|
|
74
74
|
|
|
75
75
|
export const useCurrentNavigation = () => {
|
|
76
|
-
const
|
|
76
|
+
const context = useZudoku();
|
|
77
|
+
const { getPluginNavigation, navigation } = context;
|
|
77
78
|
const location = useLocation();
|
|
78
79
|
|
|
79
80
|
const navItem = traverseNavigation(navigation, (item, parentCategories) => {
|
|
81
|
+
if (item.type === "link") return;
|
|
80
82
|
if (getItemPath(item) === location.pathname) {
|
|
81
83
|
return parentCategories.at(0) ?? item;
|
|
82
84
|
}
|
|
@@ -88,7 +90,19 @@ export const useCurrentNavigation = () => {
|
|
|
88
90
|
});
|
|
89
91
|
|
|
90
92
|
let topNavItem = navItem;
|
|
91
|
-
|
|
93
|
+
let navLabel = topNavItem?.label;
|
|
94
|
+
|
|
95
|
+
// If navItem is positioned, find the actual top-level category
|
|
96
|
+
if (navItem && isPositionedItem(navItem)) {
|
|
97
|
+
const targetLabel = navItem.at.path.split("/").filter(Boolean).at(0);
|
|
98
|
+
|
|
99
|
+
if (targetLabel) {
|
|
100
|
+
navLabel = targetLabel;
|
|
101
|
+
topNavItem = navigation.find(
|
|
102
|
+
(item) => item.label?.toLowerCase() === targetLabel.toLowerCase(),
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
} else if (!navItem && data.length > 0) {
|
|
92
106
|
const pluginBasePaths = extractAllPaths(data);
|
|
93
107
|
|
|
94
108
|
topNavItem = navigation
|
|
@@ -104,13 +118,20 @@ export const useCurrentNavigation = () => {
|
|
|
104
118
|
matchPath({ path: basePath, end: false }, path),
|
|
105
119
|
);
|
|
106
120
|
})?.item;
|
|
121
|
+
navLabel = topNavItem?.label;
|
|
107
122
|
}
|
|
108
123
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
...(
|
|
124
|
+
const repositionedNavigation = useMemo(() => {
|
|
125
|
+
const baseNavigation = [
|
|
126
|
+
...(topNavItem?.type === "category" ? topNavItem.items : []),
|
|
112
127
|
...data,
|
|
113
|
-
]
|
|
128
|
+
];
|
|
129
|
+
|
|
130
|
+
return mergePositionedItems(baseNavigation, navigation, navLabel);
|
|
131
|
+
}, [topNavItem, data, navigation, navLabel]);
|
|
132
|
+
|
|
133
|
+
return {
|
|
134
|
+
navigation: repositionedNavigation,
|
|
114
135
|
topNavItem,
|
|
115
136
|
};
|
|
116
137
|
};
|
|
@@ -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;
|
|
@@ -1,42 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
} from "./
|
|
13
|
-
|
|
14
|
-
import { Markdown as MarkdownImport } from "./Markdown.js";
|
|
15
|
-
import { Slot as SlotImport } from "./Slot.js";
|
|
16
|
-
import { Spinner as SpinnerImport } from "./Spinner.js";
|
|
17
|
-
import { Typography as TypographyImport } from "./Typography.js";
|
|
18
|
-
import { Zudoku as ZudokuImport } from "./Zudoku.js";
|
|
1
|
+
export { Helmet as Head } from "@zudoku/react-helmet-async";
|
|
2
|
+
export { Link } from "react-router";
|
|
3
|
+
export { Button } from "../ui/Button.js";
|
|
4
|
+
export { Callout } from "../ui/Callout.js";
|
|
5
|
+
export { ZudokuError } from "../util/invariant.js";
|
|
6
|
+
export { ClientOnly } from "./ClientOnly.js";
|
|
7
|
+
export { Heading } from "./Heading.js";
|
|
8
|
+
export { Markdown } from "./Markdown.js";
|
|
9
|
+
export { Search } from "./Search.js";
|
|
10
|
+
export { Slot } from "./Slot.js";
|
|
11
|
+
export { Spinner } from "./Spinner.js";
|
|
12
|
+
export { Typography } from "./Typography.js";
|
|
13
|
+
export { Zudoku } from "./Zudoku.js";
|
|
19
14
|
|
|
20
|
-
|
|
21
|
-
export const Callout = /*@__PURE__*/ CalloutImport;
|
|
22
|
-
export const Markdown = /*@__PURE__*/ MarkdownImport;
|
|
23
|
-
export const Spinner = /*@__PURE__*/ SpinnerImport;
|
|
24
|
-
export const ClientOnly = /*@__PURE__*/ ClientOnlyImport;
|
|
25
|
-
export const Button = /*@__PURE__*/ ButtonImport;
|
|
26
|
-
export const Link = /*@__PURE__*/ LinkImport;
|
|
27
|
-
export const Zudoku = /*@__PURE__*/ ZudokuImport;
|
|
28
|
-
export const Typography = /*@__PURE__*/ TypographyImport;
|
|
29
|
-
export const Slot = /*@__PURE__*/ SlotImport;
|
|
15
|
+
//
|
|
30
16
|
|
|
31
17
|
/** @deprecated Import from `zudoku/hooks` instead */
|
|
32
|
-
export
|
|
18
|
+
export { useMDXComponents } from "@mdx-js/react";
|
|
33
19
|
/** @deprecated Import from `zudoku/hooks` instead */
|
|
34
|
-
export
|
|
20
|
+
export { useTheme } from "next-themes";
|
|
35
21
|
/** @deprecated Import from `zudoku/hooks` instead */
|
|
36
|
-
export
|
|
22
|
+
export { useAuth } from "../authentication/hook.js";
|
|
37
23
|
/** @deprecated Import from `zudoku/hooks` instead */
|
|
38
|
-
export
|
|
24
|
+
export { CACHE_KEYS, useCache } from "./cache.js";
|
|
39
25
|
/** @deprecated Import from `zudoku/hooks` instead */
|
|
40
|
-
export
|
|
41
|
-
/** @deprecated Import from `zudoku/hooks` instead */
|
|
42
|
-
export const useTheme = /*@__PURE__*/ useThemeImport;
|
|
26
|
+
export { useZudoku } from "./context/ZudokuContext.js";
|
|
@@ -2,6 +2,7 @@ import { VisuallyHidden } from "@radix-ui/react-visually-hidden";
|
|
|
2
2
|
import type { NavigationItem as NavigationItemType } from "../../../config/validators/NavigationSchema.js";
|
|
3
3
|
import { DrawerContent, DrawerTitle } from "../../ui/Drawer.js";
|
|
4
4
|
import { Slot } from "../Slot.js";
|
|
5
|
+
import { NavigationFilterProvider } from "./NavigationFilterContext.js";
|
|
5
6
|
import { NavigationItem } from "./NavigationItem.js";
|
|
6
7
|
import { NavigationWrapper } from "./NavigationWrapper.js";
|
|
7
8
|
|
|
@@ -12,7 +13,7 @@ export const Navigation = ({
|
|
|
12
13
|
onRequestClose?: () => void;
|
|
13
14
|
navigation: NavigationItemType[];
|
|
14
15
|
}) => (
|
|
15
|
-
|
|
16
|
+
<NavigationFilterProvider>
|
|
16
17
|
<NavigationWrapper>
|
|
17
18
|
<Slot.Target name="navigation-before" />
|
|
18
19
|
{navigation.map((item) => (
|
|
@@ -30,7 +31,7 @@ export const Navigation = ({
|
|
|
30
31
|
<Slot.Target name="navigation-after" />
|
|
31
32
|
</NavigationWrapper>
|
|
32
33
|
<DrawerContent
|
|
33
|
-
className="lg:hidden h-
|
|
34
|
+
className="lg:hidden h-dvh start-0 w-[320px] rounded-none"
|
|
34
35
|
aria-describedby={undefined}
|
|
35
36
|
>
|
|
36
37
|
<div className="p-4 overflow-y-auto overscroll-none">
|
|
@@ -46,5 +47,5 @@ export const Navigation = ({
|
|
|
46
47
|
))}
|
|
47
48
|
</div>
|
|
48
49
|
</DrawerContent>
|
|
49
|
-
|
|
50
|
+
</NavigationFilterProvider>
|
|
50
51
|
);
|
|
@@ -7,6 +7,7 @@ import { Button } from "zudoku/ui/Button.js";
|
|
|
7
7
|
import type { NavigationCategory as NavigationCategoryType } from "../../../config/validators/NavigationSchema.js";
|
|
8
8
|
import { cn } from "../../util/cn.js";
|
|
9
9
|
import { joinUrl } from "../../util/joinUrl.js";
|
|
10
|
+
import { useNavigationFilter } from "./NavigationFilterContext.js";
|
|
10
11
|
import { NavigationItem } from "./NavigationItem.js";
|
|
11
12
|
import { navigationListItem, useIsCategoryOpen } from "./utils.js";
|
|
12
13
|
|
|
@@ -20,6 +21,7 @@ const NavigationCategoryInner = ({
|
|
|
20
21
|
const isCategoryOpen = useIsCategoryOpen(category);
|
|
21
22
|
const [hasInteracted, setHasInteracted] = useState(false);
|
|
22
23
|
const location = useLocation();
|
|
24
|
+
const { query: filterQuery } = useNavigationFilter();
|
|
23
25
|
|
|
24
26
|
const isCollapsible = category.collapsible ?? true;
|
|
25
27
|
const isCollapsed = category.collapsed ?? true;
|
|
@@ -37,6 +39,13 @@ const NavigationCategoryInner = ({
|
|
|
37
39
|
}
|
|
38
40
|
}, [isCategoryOpen]);
|
|
39
41
|
|
|
42
|
+
// Auto-expand when there's an active filter query
|
|
43
|
+
useEffect(() => {
|
|
44
|
+
if (filterQuery.trim()) {
|
|
45
|
+
setOpen(true);
|
|
46
|
+
}
|
|
47
|
+
}, [filterQuery]);
|
|
48
|
+
|
|
40
49
|
const ToggleButton = isCollapsible && (
|
|
41
50
|
<Button
|
|
42
51
|
onClick={(e) => {
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createContext,
|
|
3
|
+
type PropsWithChildren,
|
|
4
|
+
useContext,
|
|
5
|
+
useState,
|
|
6
|
+
} from "react";
|
|
7
|
+
|
|
8
|
+
type NavigationFilterContextType = {
|
|
9
|
+
query: string;
|
|
10
|
+
setQuery: (query: string) => void;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const NavigationFilterContext = createContext<NavigationFilterContextType>({
|
|
14
|
+
query: "",
|
|
15
|
+
setQuery: () => {},
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
export const NavigationFilterProvider = ({ children }: PropsWithChildren) => {
|
|
19
|
+
const [query, setQuery] = useState("");
|
|
20
|
+
|
|
21
|
+
return (
|
|
22
|
+
<NavigationFilterContext.Provider value={{ query, setQuery }}>
|
|
23
|
+
{children}
|
|
24
|
+
</NavigationFilterContext.Provider>
|
|
25
|
+
);
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export const useNavigationFilter = () => useContext(NavigationFilterContext);
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { SearchIcon, XIcon } from "lucide-react";
|
|
2
|
+
import {
|
|
3
|
+
InputGroup,
|
|
4
|
+
InputGroupAddon,
|
|
5
|
+
InputGroupButton,
|
|
6
|
+
InputGroupInput,
|
|
7
|
+
} from "zudoku/ui/InputGroup.js";
|
|
8
|
+
import { useNavigationFilter } from "./NavigationFilterContext.js";
|
|
9
|
+
|
|
10
|
+
export const NavigationFilterInput = ({
|
|
11
|
+
placeholder,
|
|
12
|
+
}: {
|
|
13
|
+
placeholder?: string;
|
|
14
|
+
}) => {
|
|
15
|
+
const { query, setQuery } = useNavigationFilter();
|
|
16
|
+
|
|
17
|
+
return (
|
|
18
|
+
<InputGroup className="my-2">
|
|
19
|
+
<InputGroupAddon>
|
|
20
|
+
<SearchIcon className="size-3.5" />
|
|
21
|
+
</InputGroupAddon>
|
|
22
|
+
<InputGroupInput
|
|
23
|
+
type="text"
|
|
24
|
+
placeholder={placeholder}
|
|
25
|
+
value={query}
|
|
26
|
+
onChange={(e) => setQuery(e.target.value)}
|
|
27
|
+
/>
|
|
28
|
+
{query && (
|
|
29
|
+
<InputGroupButton onClick={() => setQuery("")}>
|
|
30
|
+
<XIcon className="size-3" />
|
|
31
|
+
</InputGroupButton>
|
|
32
|
+
)}
|
|
33
|
+
</InputGroup>
|
|
34
|
+
);
|
|
35
|
+
};
|