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
|
@@ -148,8 +148,21 @@ const createVersionRoutes = (
|
|
|
148
148
|
];
|
|
149
149
|
};
|
|
150
150
|
|
|
151
|
-
export const
|
|
152
|
-
config.type === "
|
|
151
|
+
export const getVersionMetadata = (config: OasPluginConfig) => {
|
|
152
|
+
if (config.type === "raw" || !Array.isArray(config.input)) {
|
|
153
|
+
return { versions: [], labels: {}, downloadUrls: {} };
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
return {
|
|
157
|
+
versions: config.input.map((v) => v.path),
|
|
158
|
+
labels: Object.fromEntries(
|
|
159
|
+
config.input.map((v) => [v.path, v.label ?? v.path]),
|
|
160
|
+
),
|
|
161
|
+
downloadUrls: Object.fromEntries(
|
|
162
|
+
config.input.map((v) => [v.path, v.downloadUrl]),
|
|
163
|
+
),
|
|
164
|
+
};
|
|
165
|
+
};
|
|
153
166
|
|
|
154
167
|
export const getRoutes = ({
|
|
155
168
|
basePath,
|
|
@@ -161,10 +174,33 @@ export const getRoutes = ({
|
|
|
161
174
|
basePath: string;
|
|
162
175
|
}): RouteObject[] => {
|
|
163
176
|
const tagPages = config.tagPages;
|
|
177
|
+
const { versions } = getVersionMetadata(config);
|
|
164
178
|
|
|
165
179
|
// If the config does not provide tag pages the catch-all
|
|
166
180
|
// route handles all operations on a single page
|
|
167
181
|
if (!tagPages) {
|
|
182
|
+
// If there are versions, create versioned routes even without tag pages
|
|
183
|
+
if (versions.length > 0) {
|
|
184
|
+
const versionsInPath =
|
|
185
|
+
versions.length > 1 ? [undefined, ...versions] : [undefined];
|
|
186
|
+
|
|
187
|
+
return versionsInPath.map((version) => {
|
|
188
|
+
const versionPath = joinUrl(basePath, version);
|
|
189
|
+
return createOasProvider({
|
|
190
|
+
basePath,
|
|
191
|
+
version,
|
|
192
|
+
routePath: versionPath,
|
|
193
|
+
routes: [
|
|
194
|
+
createNonTagPagesRoute({ path: `${versionPath}/:tag?` }),
|
|
195
|
+
...createAdditionalRoutes(versionPath),
|
|
196
|
+
],
|
|
197
|
+
client,
|
|
198
|
+
config,
|
|
199
|
+
});
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
// No versions, single route
|
|
168
204
|
return [
|
|
169
205
|
createOasProvider({
|
|
170
206
|
basePath,
|
|
@@ -179,7 +215,6 @@ export const getRoutes = ({
|
|
|
179
215
|
];
|
|
180
216
|
}
|
|
181
217
|
|
|
182
|
-
const versions = getVersions(config);
|
|
183
218
|
// The latest version always is added as index path
|
|
184
219
|
const versionsInPath =
|
|
185
220
|
versions.length > 1 ? [undefined, ...versions] : [undefined];
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import { DialogTrigger } from "@radix-ui/react-dialog";
|
|
2
|
+
import {
|
|
3
|
+
type PropsWithChildren,
|
|
4
|
+
useCallback,
|
|
5
|
+
useEffect,
|
|
6
|
+
useState,
|
|
7
|
+
} from "react";
|
|
8
|
+
import { Button } from "zudoku/ui/Button.js";
|
|
9
|
+
import {
|
|
10
|
+
Dialog,
|
|
11
|
+
DialogContent,
|
|
12
|
+
DialogDescription,
|
|
13
|
+
DialogFooter,
|
|
14
|
+
DialogHeader,
|
|
15
|
+
DialogTitle,
|
|
16
|
+
} from "zudoku/ui/Dialog.js";
|
|
17
|
+
|
|
18
|
+
type IndexingState =
|
|
19
|
+
| { status: "idle" }
|
|
20
|
+
| { status: "indexing"; total: number; current: number; path: string }
|
|
21
|
+
| { status: "complete"; indexed: number }
|
|
22
|
+
| { status: "error"; message: string };
|
|
23
|
+
|
|
24
|
+
const ProgressBar = ({
|
|
25
|
+
total,
|
|
26
|
+
current,
|
|
27
|
+
barLength = 25,
|
|
28
|
+
emptyChar = "░",
|
|
29
|
+
filledChar = "█",
|
|
30
|
+
}: {
|
|
31
|
+
total: number;
|
|
32
|
+
current: number;
|
|
33
|
+
barLength?: number;
|
|
34
|
+
emptyChar?: string;
|
|
35
|
+
filledChar?: string;
|
|
36
|
+
}) => {
|
|
37
|
+
const percent = Math.round((current / total) * 100);
|
|
38
|
+
const filled = Math.round((percent / 100) * barLength);
|
|
39
|
+
const empty = barLength - filled;
|
|
40
|
+
|
|
41
|
+
return (
|
|
42
|
+
<>
|
|
43
|
+
{filledChar.repeat(filled)}
|
|
44
|
+
{emptyChar.repeat(empty)} {percent}% ({current}/{total})
|
|
45
|
+
</>
|
|
46
|
+
);
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
const IndexingDialog = ({ children }: PropsWithChildren) => {
|
|
50
|
+
const [indexingState, setIndexingState] = useState<IndexingState>({
|
|
51
|
+
status: "idle",
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
const startIndexing = useCallback(() => {
|
|
55
|
+
setIndexingState({ status: "indexing", total: 0, current: 0, path: "" });
|
|
56
|
+
|
|
57
|
+
const eventSource = new EventSource("/__z/pagefind-reindex");
|
|
58
|
+
|
|
59
|
+
eventSource.onmessage = (event) => {
|
|
60
|
+
const data = JSON.parse(event.data);
|
|
61
|
+
|
|
62
|
+
if (data.type === "progress") {
|
|
63
|
+
setIndexingState({
|
|
64
|
+
status: "indexing",
|
|
65
|
+
total: data.total,
|
|
66
|
+
current: data.current,
|
|
67
|
+
path: data.path,
|
|
68
|
+
});
|
|
69
|
+
} else if (data.type === "complete") {
|
|
70
|
+
eventSource.close();
|
|
71
|
+
if (data.success) {
|
|
72
|
+
setIndexingState({ status: "complete", indexed: data.indexed });
|
|
73
|
+
} else {
|
|
74
|
+
setIndexingState({
|
|
75
|
+
status: "error",
|
|
76
|
+
message: data.error ?? "Indexing failed",
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
eventSource.onerror = () => {
|
|
83
|
+
eventSource.close();
|
|
84
|
+
setIndexingState({
|
|
85
|
+
status: "error",
|
|
86
|
+
message: "Connection lost during indexing",
|
|
87
|
+
});
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
return () => eventSource.close();
|
|
91
|
+
}, []);
|
|
92
|
+
|
|
93
|
+
useEffect(() => {
|
|
94
|
+
if (indexingState.status !== "idle") return;
|
|
95
|
+
return startIndexing();
|
|
96
|
+
}, [indexingState.status, startIndexing]);
|
|
97
|
+
|
|
98
|
+
const handleDone = () => {
|
|
99
|
+
if (indexingState.status !== "complete") return;
|
|
100
|
+
window.location.reload();
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
return (
|
|
104
|
+
<Dialog>
|
|
105
|
+
<DialogTrigger asChild>{children}</DialogTrigger>
|
|
106
|
+
<DialogContent
|
|
107
|
+
className="max-w-sm! top-1/3"
|
|
108
|
+
showCloseButton={false}
|
|
109
|
+
onInteractOutside={(e) => e.preventDefault()}
|
|
110
|
+
>
|
|
111
|
+
<DialogHeader>
|
|
112
|
+
<DialogTitle>
|
|
113
|
+
{indexingState.status === "indexing" && "Building Search Index"}
|
|
114
|
+
{indexingState.status === "complete" && "Indexing Complete"}
|
|
115
|
+
{indexingState.status === "error" && "Indexing Failed"}
|
|
116
|
+
{indexingState.status === "idle" && "Build Search Index"}
|
|
117
|
+
</DialogTitle>
|
|
118
|
+
<DialogDescription>
|
|
119
|
+
{indexingState.status === "indexing" && (
|
|
120
|
+
<>
|
|
121
|
+
{indexingState.total > 0 && (
|
|
122
|
+
<div className="font-mono text-sm mb-2">
|
|
123
|
+
<ProgressBar {...indexingState} />
|
|
124
|
+
</div>
|
|
125
|
+
)}
|
|
126
|
+
{indexingState.path && (
|
|
127
|
+
<span className="block text-xs truncate">
|
|
128
|
+
{indexingState.path}
|
|
129
|
+
</span>
|
|
130
|
+
)}
|
|
131
|
+
</>
|
|
132
|
+
)}
|
|
133
|
+
{indexingState.status === "complete" && (
|
|
134
|
+
<>Successfully indexed {indexingState.indexed} pages.</>
|
|
135
|
+
)}
|
|
136
|
+
{indexingState.status === "error" && (
|
|
137
|
+
<span className="text-destructive">{indexingState.message}</span>
|
|
138
|
+
)}
|
|
139
|
+
</DialogDescription>
|
|
140
|
+
</DialogHeader>
|
|
141
|
+
<DialogFooter>
|
|
142
|
+
<div className="flex justify-end gap-2">
|
|
143
|
+
{indexingState.status === "complete" && (
|
|
144
|
+
<Button size="sm" onClick={handleDone}>
|
|
145
|
+
Close and reload
|
|
146
|
+
</Button>
|
|
147
|
+
)}
|
|
148
|
+
{indexingState.status === "error" && (
|
|
149
|
+
<>
|
|
150
|
+
<Button variant="outline" onClick={handleDone}>
|
|
151
|
+
Cancel
|
|
152
|
+
</Button>
|
|
153
|
+
<Button onClick={startIndexing}>Retry</Button>
|
|
154
|
+
</>
|
|
155
|
+
)}
|
|
156
|
+
</div>
|
|
157
|
+
</DialogFooter>
|
|
158
|
+
</DialogContent>
|
|
159
|
+
</Dialog>
|
|
160
|
+
);
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
export default IndexingDialog;
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { VisuallyHidden } from "@radix-ui/react-visually-hidden";
|
|
2
2
|
import { keepPreviousData, useQuery } from "@tanstack/react-query";
|
|
3
|
-
import {
|
|
3
|
+
import { ListPlusIcon } from "lucide-react";
|
|
4
|
+
import { lazy, useEffect, useRef, useState } from "react";
|
|
4
5
|
import { Button } from "zudoku/ui/Button.js";
|
|
5
|
-
import { Callout } from "zudoku/ui/Callout.js";
|
|
6
6
|
import {
|
|
7
7
|
CommandDialog,
|
|
8
8
|
CommandEmpty,
|
|
9
9
|
CommandInput,
|
|
10
10
|
} from "zudoku/ui/Command.js";
|
|
11
11
|
import { DialogTitle } from "zudoku/ui/Dialog.js";
|
|
12
|
+
import { Kbd, KbdGroup } from "zudoku/ui/Kbd.js";
|
|
12
13
|
import { useAuthState } from "../../authentication/state.js";
|
|
13
14
|
import { useZudoku } from "../../components/context/ZudokuContext.js";
|
|
14
15
|
import { SEARCH_PROTECTED_SECTION } from "../../core/RouteGuard.js";
|
|
@@ -18,6 +19,8 @@ import type { PagefindOptions } from "./index.js";
|
|
|
18
19
|
import { ResultList } from "./ResultList.js";
|
|
19
20
|
import type { Pagefind } from "./types.js";
|
|
20
21
|
|
|
22
|
+
const IndexingDialog = lazy(() => import("./IndexingDialog.js"));
|
|
23
|
+
|
|
21
24
|
const DEFAULT_RANKING = {
|
|
22
25
|
// Slightly lower than default because API docs tend to have repetitive terms (parameter names, HTTP methods, etc.)
|
|
23
26
|
termFrequency: 0.8,
|
|
@@ -81,6 +84,7 @@ export const PagefindSearch = ({
|
|
|
81
84
|
}) => {
|
|
82
85
|
const { pagefind, error, isError } = usePagefind(options);
|
|
83
86
|
const [searchTerm, setSearchTerm] = useState("");
|
|
87
|
+
const [selectedValue, setSelectedValue] = useState<string>("");
|
|
84
88
|
const auth = useAuthState();
|
|
85
89
|
const context = useZudoku();
|
|
86
90
|
const inputRef = useRef<HTMLInputElement>(null);
|
|
@@ -100,9 +104,24 @@ export const PagefindSearch = ({
|
|
|
100
104
|
enabled: !!pagefind && !!searchTerm,
|
|
101
105
|
});
|
|
102
106
|
|
|
107
|
+
useEffect(() => {
|
|
108
|
+
if (!searchResults?.length) return;
|
|
109
|
+
|
|
110
|
+
const firstResult = searchResults.at(0);
|
|
111
|
+
if (!firstResult) return;
|
|
112
|
+
|
|
113
|
+
const firstValue = `${firstResult.meta.title}-${firstResult.url}`;
|
|
114
|
+
setSelectedValue(firstValue);
|
|
115
|
+
}, [searchResults]);
|
|
116
|
+
|
|
103
117
|
return (
|
|
104
118
|
<CommandDialog
|
|
105
|
-
command={{
|
|
119
|
+
command={{
|
|
120
|
+
shouldFilter: false,
|
|
121
|
+
loop: true,
|
|
122
|
+
value: selectedValue,
|
|
123
|
+
onValueChange: setSelectedValue,
|
|
124
|
+
}}
|
|
106
125
|
content={{ className: "max-w-[750px]" }}
|
|
107
126
|
open={isOpen}
|
|
108
127
|
onOpenChange={onClose}
|
|
@@ -135,28 +154,48 @@ export const PagefindSearch = ({
|
|
|
135
154
|
"Start typing to search"
|
|
136
155
|
)}
|
|
137
156
|
</CommandEmpty>
|
|
138
|
-
{isError ? (
|
|
157
|
+
{isError && error.message !== "NOT_BUILT_YET" ? (
|
|
139
158
|
<div className="p-4 text-sm">
|
|
140
|
-
|
|
141
|
-
<Callout type="info">
|
|
142
|
-
Search is currently not available in development mode by default.
|
|
143
|
-
<br />
|
|
144
|
-
To still use search in development, run <code>zudoku build</code>{" "}
|
|
145
|
-
and copy the <code>dist/pagefind</code> directory to your{" "}
|
|
146
|
-
<code>public</code> directory.
|
|
147
|
-
</Callout>
|
|
148
|
-
) : (
|
|
149
|
-
"An error occurred while loading search."
|
|
150
|
-
)}
|
|
159
|
+
An error occurred while loading search.
|
|
151
160
|
</div>
|
|
152
161
|
) : (
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
162
|
+
<>
|
|
163
|
+
<ResultList
|
|
164
|
+
basePath={context.options.basePath}
|
|
165
|
+
searchResults={searchResults ?? []}
|
|
166
|
+
searchTerm={searchTerm}
|
|
167
|
+
onClose={onClose}
|
|
168
|
+
maxSubResults={options.maxSubResults}
|
|
169
|
+
/>
|
|
170
|
+
<div className="flex justify-between p-2 items-center">
|
|
171
|
+
<div className="flex items-center text-xs text-muted-foreground">
|
|
172
|
+
<KbdGroup className="ms-0 me-1">
|
|
173
|
+
<Kbd>↑</Kbd>
|
|
174
|
+
<Kbd>↓</Kbd>
|
|
175
|
+
</KbdGroup>
|
|
176
|
+
Navigate
|
|
177
|
+
<KbdGroup className="ms-4 me-1">
|
|
178
|
+
<Kbd>↵</Kbd>
|
|
179
|
+
</KbdGroup>
|
|
180
|
+
Select
|
|
181
|
+
<KbdGroup className="ms-4 me-1">
|
|
182
|
+
<Kbd>Esc</Kbd>
|
|
183
|
+
</KbdGroup>
|
|
184
|
+
Close dialog
|
|
185
|
+
</div>
|
|
186
|
+
{import.meta.env.DEV && (
|
|
187
|
+
<IndexingDialog>
|
|
188
|
+
<Button
|
|
189
|
+
variant="outline"
|
|
190
|
+
className="h-7 text-xs text-muted-foreground"
|
|
191
|
+
>
|
|
192
|
+
<ListPlusIcon />
|
|
193
|
+
Build Search Index
|
|
194
|
+
</Button>
|
|
195
|
+
</IndexingDialog>
|
|
196
|
+
)}
|
|
197
|
+
</div>
|
|
198
|
+
</>
|
|
160
199
|
)}
|
|
161
200
|
</CommandDialog>
|
|
162
201
|
);
|
|
@@ -35,9 +35,9 @@ export const ResultList = ({
|
|
|
35
35
|
const navigate = useNavigate();
|
|
36
36
|
const commandListRef = useRef<HTMLDivElement | null>(null);
|
|
37
37
|
|
|
38
|
-
// biome-ignore lint/correctness/useExhaustiveDependencies: Only scroll to top when search term changes
|
|
39
38
|
useLayoutEffect(() => {
|
|
40
|
-
|
|
39
|
+
if (!searchTerm) return;
|
|
40
|
+
requestAnimationFrame(() => {
|
|
41
41
|
commandListRef.current?.scrollTo({ top: 0 });
|
|
42
42
|
});
|
|
43
43
|
}, [searchTerm]);
|
|
@@ -77,6 +77,11 @@ export const ResultList = ({
|
|
|
77
77
|
) : (
|
|
78
78
|
<FileTextIcon />
|
|
79
79
|
)}
|
|
80
|
+
{result.meta.category && (
|
|
81
|
+
<span className="text-muted-foreground">
|
|
82
|
+
{result.meta.category} ›{" "}
|
|
83
|
+
</span>
|
|
84
|
+
)}
|
|
80
85
|
{result.meta.title}
|
|
81
86
|
</Link>
|
|
82
87
|
</CommandItem>
|
|
@@ -98,7 +103,7 @@ export const ResultList = ({
|
|
|
98
103
|
<div className="flex flex-col items-start gap-2 ms-2.5 ps-5 border-l border-muted-foreground/50">
|
|
99
104
|
<span className="font-bold">{subResult.title}</span>
|
|
100
105
|
<span
|
|
101
|
-
className="text-[13px] [&_mark]:bg-primary [&_mark]:text-primary-foreground"
|
|
106
|
+
className="line-clamp-2 text-[13px] [&_mark]:bg-primary [&_mark]:text-primary-foreground"
|
|
102
107
|
// biome-ignore lint/security/noDangerouslySetInnerHtml: Pagefind provides sanitized HTML
|
|
103
108
|
dangerouslySetInnerHTML={{ __html: subResult.excerpt }}
|
|
104
109
|
/>
|
package/src/lib/shiki.ts
CHANGED
|
@@ -25,18 +25,27 @@ export const HIGHLIGHT_CODE_BLOCK_CLASS =
|
|
|
25
25
|
"overflow-x-auto scrollbar not-inline";
|
|
26
26
|
|
|
27
27
|
const engine = createJavaScriptRegexEngine({ forgiving: true });
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
28
|
+
|
|
29
|
+
const shikiPromise = import.meta.hot?.data.shiki
|
|
30
|
+
? import.meta.hot.data.shiki
|
|
31
|
+
: createHighlighterCore({
|
|
32
|
+
engine,
|
|
33
|
+
langAlias: {
|
|
34
|
+
markup: "html",
|
|
35
|
+
svg: "xml",
|
|
36
|
+
mathml: "xml",
|
|
37
|
+
atom: "xml",
|
|
38
|
+
ssml: "xml",
|
|
39
|
+
rss: "xml",
|
|
40
|
+
webmanifest: "json",
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
if (import.meta.hot) {
|
|
45
|
+
import.meta.hot.data.shiki = shikiPromise;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export const highlighter = await shikiPromise;
|
|
40
49
|
|
|
41
50
|
type ThemesRecord = CodeOptionsMultipleThemes<BundledTheme>["themes"];
|
|
42
51
|
|
package/src/lib/ui/Alert.tsx
CHANGED
|
@@ -3,13 +3,15 @@ import type * as React from "react";
|
|
|
3
3
|
import { cn } from "../util/cn.js";
|
|
4
4
|
|
|
5
5
|
const alertVariants = cva(
|
|
6
|
-
"
|
|
6
|
+
"grid gap-0.5 rounded-lg border px-2.5 py-2 text-left text-sm has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pr-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-4 w-full relative group/alert",
|
|
7
7
|
{
|
|
8
8
|
variants: {
|
|
9
9
|
variant: {
|
|
10
10
|
default: "bg-card text-card-foreground",
|
|
11
11
|
destructive:
|
|
12
|
-
"text-destructive bg-card
|
|
12
|
+
"text-destructive bg-card bg-destructive/5 border-destructive/20 *:data-[slot=alert-description]:text-destructive-foreground *:[svg]:text-current",
|
|
13
|
+
warning:
|
|
14
|
+
"text-warning-foreground bg-card bg-warning/10 border-warning/50 *:data-[slot=alert-description]:text-warning-foreground *:[svg]:text-current",
|
|
13
15
|
},
|
|
14
16
|
},
|
|
15
17
|
defaultVariants: {
|
|
@@ -38,7 +40,7 @@ function AlertTitle({ className, ...props }: React.ComponentProps<"div">) {
|
|
|
38
40
|
<div
|
|
39
41
|
data-slot="alert-title"
|
|
40
42
|
className={cn(
|
|
41
|
-
"col-start-2
|
|
43
|
+
"font-medium group-has-[>svg]/alert:col-start-2 [&_a]:hover:text-foreground [&_a]:underline [&_a]:underline-offset-3",
|
|
42
44
|
className,
|
|
43
45
|
)}
|
|
44
46
|
{...props}
|
|
@@ -54,7 +56,7 @@ function AlertDescription({
|
|
|
54
56
|
<div
|
|
55
57
|
data-slot="alert-description"
|
|
56
58
|
className={cn(
|
|
57
|
-
"text-muted-foreground
|
|
59
|
+
"text-muted-foreground text-sm text-balance md:text-pretty [&_p:not(:last-child)]:mb-4 [&_a]:hover:text-foreground [&_a]:underline [&_a]:underline-offset-3",
|
|
58
60
|
className,
|
|
59
61
|
)}
|
|
60
62
|
{...props}
|
|
@@ -62,4 +64,14 @@ function AlertDescription({
|
|
|
62
64
|
);
|
|
63
65
|
}
|
|
64
66
|
|
|
65
|
-
|
|
67
|
+
function AlertAction({ className, ...props }: React.ComponentProps<"div">) {
|
|
68
|
+
return (
|
|
69
|
+
<div
|
|
70
|
+
data-slot="alert-action"
|
|
71
|
+
className={cn("absolute top-2 right-2", className)}
|
|
72
|
+
{...props}
|
|
73
|
+
/>
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export { Alert, AlertTitle, AlertDescription, AlertAction };
|
package/src/lib/ui/Button.tsx
CHANGED
|
@@ -4,21 +4,19 @@ import * as React from "react";
|
|
|
4
4
|
import { cn } from "../util/cn.js";
|
|
5
5
|
|
|
6
6
|
export const buttonVariants = cva(
|
|
7
|
-
"not-prose inline-flex
|
|
7
|
+
"not-prose inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
|
|
8
8
|
{
|
|
9
9
|
variants: {
|
|
10
10
|
variant: {
|
|
11
|
-
default:
|
|
12
|
-
"bg-primary text-primary-foreground shadow-sm hover:bg-primary/90",
|
|
11
|
+
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
13
12
|
destructive:
|
|
14
|
-
"bg-destructive text-destructive-
|
|
13
|
+
"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
|
|
15
14
|
outline:
|
|
16
|
-
"border
|
|
15
|
+
"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
|
|
17
16
|
secondary:
|
|
18
|
-
"bg-secondary text-secondary-foreground
|
|
19
|
-
ghost:
|
|
20
|
-
|
|
21
|
-
"text-destructive hover:bg-destructive hover:text-destructive-foreground",
|
|
17
|
+
"bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
18
|
+
ghost:
|
|
19
|
+
"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
|
|
22
20
|
link: "text-primary underline-offset-4 hover:underline",
|
|
23
21
|
expand:
|
|
24
22
|
"flex gap-1.5 border bg-transparent rounded-xl text-muted-foreground hover:text-foreground",
|
|
@@ -29,8 +27,10 @@ export const buttonVariants = cva(
|
|
|
29
27
|
lg: "h-10 rounded-md px-8",
|
|
30
28
|
xl: "h-14 rounded-lg px-10 text-lg",
|
|
31
29
|
icon: "size-9",
|
|
32
|
-
"icon-xs": "size-7",
|
|
33
30
|
"icon-xxs": "size-5",
|
|
31
|
+
"icon-xs": "size-7",
|
|
32
|
+
"icon-sm": "size-8",
|
|
33
|
+
"icon-lg": "size-10",
|
|
34
34
|
},
|
|
35
35
|
},
|
|
36
36
|
defaultVariants: {
|
|
@@ -51,6 +51,7 @@ export const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
|
|
51
51
|
const Comp = asChild ? Slot : "button";
|
|
52
52
|
return (
|
|
53
53
|
<Comp
|
|
54
|
+
type={asChild ? undefined : "button"}
|
|
54
55
|
className={cn(buttonVariants({ variant, size, className }))}
|
|
55
56
|
ref={ref}
|
|
56
57
|
{...props}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
2
|
+
import { cva, type VariantProps } from "class-variance-authority";
|
|
3
|
+
import { cn } from "../util/cn.js";
|
|
4
|
+
import { Separator } from "./Separator.js";
|
|
5
|
+
|
|
6
|
+
const buttonGroupVariants = cva(
|
|
7
|
+
"flex w-fit items-stretch [&>*]:focus-visible:z-10 [&>*]:focus-visible:relative [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-md has-[>[data-slot=button-group]]:gap-2",
|
|
8
|
+
{
|
|
9
|
+
variants: {
|
|
10
|
+
orientation: {
|
|
11
|
+
horizontal:
|
|
12
|
+
"[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none",
|
|
13
|
+
vertical:
|
|
14
|
+
"flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none",
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
defaultVariants: {
|
|
18
|
+
orientation: "horizontal",
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
function ButtonGroup({
|
|
24
|
+
className,
|
|
25
|
+
orientation,
|
|
26
|
+
...props
|
|
27
|
+
}: React.ComponentProps<"div"> & VariantProps<typeof buttonGroupVariants>) {
|
|
28
|
+
return (
|
|
29
|
+
<div
|
|
30
|
+
role="group"
|
|
31
|
+
data-slot="button-group"
|
|
32
|
+
data-orientation={orientation}
|
|
33
|
+
className={cn(buttonGroupVariants({ orientation }), className)}
|
|
34
|
+
{...props}
|
|
35
|
+
/>
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function ButtonGroupText({
|
|
40
|
+
className,
|
|
41
|
+
asChild = false,
|
|
42
|
+
...props
|
|
43
|
+
}: React.ComponentProps<"div"> & {
|
|
44
|
+
asChild?: boolean;
|
|
45
|
+
}) {
|
|
46
|
+
const Comp = asChild ? Slot : "div";
|
|
47
|
+
|
|
48
|
+
return (
|
|
49
|
+
<Comp
|
|
50
|
+
className={cn(
|
|
51
|
+
"bg-muted flex items-center gap-2 rounded-md border px-4 text-sm font-medium shadow-xs [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4",
|
|
52
|
+
className,
|
|
53
|
+
)}
|
|
54
|
+
{...props}
|
|
55
|
+
/>
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function ButtonGroupSeparator({
|
|
60
|
+
className,
|
|
61
|
+
orientation = "vertical",
|
|
62
|
+
...props
|
|
63
|
+
}: React.ComponentProps<typeof Separator>) {
|
|
64
|
+
return (
|
|
65
|
+
<Separator
|
|
66
|
+
data-slot="button-group-separator"
|
|
67
|
+
orientation={orientation}
|
|
68
|
+
className={cn(
|
|
69
|
+
"bg-input relative m-0! self-stretch data-[orientation=vertical]:h-auto",
|
|
70
|
+
className,
|
|
71
|
+
)}
|
|
72
|
+
{...props}
|
|
73
|
+
/>
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export {
|
|
78
|
+
ButtonGroup,
|
|
79
|
+
ButtonGroupSeparator,
|
|
80
|
+
ButtonGroupText,
|
|
81
|
+
buttonGroupVariants,
|
|
82
|
+
};
|
package/src/lib/ui/Command.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { DialogProps } from "@radix-ui/react-dialog";
|
|
2
2
|
import { Command as CommandPrimitive } from "cmdk";
|
|
3
|
-
import {
|
|
3
|
+
import { SearchIcon } from "lucide-react";
|
|
4
4
|
import type { ComponentPropsWithoutRef } from "react";
|
|
5
5
|
import * as React from "react";
|
|
6
6
|
import { Dialog, DialogContent } from "zudoku/ui/Dialog.js";
|
|
@@ -58,8 +58,8 @@ const CommandInput = React.forwardRef<
|
|
|
58
58
|
React.ElementRef<typeof CommandPrimitive.Input>,
|
|
59
59
|
React.ComponentPropsWithoutRef<typeof CommandPrimitive.Input>
|
|
60
60
|
>(({ className, ...props }, ref) => (
|
|
61
|
-
<div className="flex items-center border-b px-3" cmdk-input-wrapper="">
|
|
62
|
-
<
|
|
61
|
+
<div className="flex items-center gap-2 border-b px-3" cmdk-input-wrapper="">
|
|
62
|
+
<SearchIcon className="size-4! shrink-0 opacity-50" />
|
|
63
63
|
<CommandPrimitive.Input
|
|
64
64
|
ref={ref}
|
|
65
65
|
className={cn(
|