zudoku 0.0.0-f0602bf → 0.0.0-f0b4321
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/README.md +2 -2
- package/dist/app/ZuploBuildConfig.d.ts +11 -121
- package/dist/app/ZuploBuildConfig.js +8 -8
- package/dist/app/ZuploBuildConfig.js.map +1 -1
- package/dist/app/demo.js +21 -5
- package/dist/app/demo.js.map +1 -1
- package/dist/app/entry.client.d.ts +0 -2
- package/dist/app/entry.client.js +0 -2
- package/dist/app/entry.client.js.map +1 -1
- package/dist/app/entry.server.d.ts +0 -2
- package/dist/app/entry.server.js +0 -2
- package/dist/app/entry.server.js.map +1 -1
- package/dist/app/env.d.ts +7 -7
- package/dist/app/env.js +8 -0
- package/dist/app/env.js.map +1 -1
- package/dist/app/main.d.ts +1 -0
- package/dist/app/main.js +15 -20
- package/dist/app/main.js.map +1 -1
- package/dist/app/standalone.js +7 -6
- package/dist/app/standalone.js.map +1 -1
- package/dist/cli/build/handler.js +9 -1
- package/dist/cli/build/handler.js.map +1 -1
- package/dist/config/config.d.ts +11 -0
- package/dist/config/loader.js +4 -8
- package/dist/config/loader.js.map +1 -1
- package/dist/config/validators/BuildSchema.d.ts +20 -44
- package/dist/config/validators/BuildSchema.js +8 -14
- package/dist/config/validators/BuildSchema.js.map +1 -1
- package/dist/config/validators/InputNavigationSchema.d.ts +7364 -0
- package/dist/config/validators/InputNavigationSchema.js +71 -0
- package/dist/config/validators/InputNavigationSchema.js.map +1 -0
- package/dist/config/validators/InputNavigationSchema.test-d.d.ts +1 -0
- package/dist/config/validators/InputNavigationSchema.test-d.js +145 -0
- package/dist/config/validators/InputNavigationSchema.test-d.js.map +1 -0
- package/dist/config/validators/NavigationSchema.d.ts +44 -0
- package/dist/config/validators/NavigationSchema.js +95 -0
- package/dist/config/validators/NavigationSchema.js.map +1 -0
- package/dist/config/validators/icon-types.d.ts +2 -1
- package/dist/config/validators/icon-types.js +1813 -1
- package/dist/config/validators/icon-types.js.map +1 -1
- package/dist/config/validators/validate.d.ts +474 -5556
- package/dist/config/validators/validate.js +106 -73
- package/dist/config/validators/validate.js.map +1 -1
- package/dist/config/validators/validate.test.d.ts +1 -0
- package/dist/config/validators/validate.test.js +141 -0
- package/dist/config/validators/validate.test.js.map +1 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/auth/issuer.d.ts +2 -0
- package/dist/lib/auth/issuer.js +37 -0
- package/dist/lib/auth/issuer.js.map +1 -0
- package/dist/lib/auth/issuer.test.d.ts +1 -0
- package/dist/lib/auth/issuer.test.js +94 -0
- package/dist/lib/auth/issuer.test.js.map +1 -0
- package/dist/lib/authentication/AuthenticationPlugin.d.ts +0 -5
- package/dist/lib/authentication/AuthenticationPlugin.js +0 -12
- package/dist/lib/authentication/AuthenticationPlugin.js.map +1 -1
- package/dist/lib/authentication/authentication.d.ts +2 -0
- 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 -3
- package/dist/lib/authentication/components/SignIn.js.map +1 -1
- package/dist/lib/authentication/hook.d.ts +6 -0
- package/dist/lib/authentication/providers/auth0.js +1 -1
- package/dist/lib/authentication/providers/auth0.js.map +1 -1
- package/dist/lib/authentication/providers/azureb2c.d.ts +28 -0
- package/dist/lib/authentication/providers/azureb2c.js +145 -0
- package/dist/lib/authentication/providers/azureb2c.js.map +1 -0
- package/dist/lib/authentication/providers/clerk.js +3 -12
- package/dist/lib/authentication/providers/clerk.js.map +1 -1
- package/dist/lib/authentication/providers/openid.d.ts +5 -2
- package/dist/lib/authentication/providers/openid.js +49 -5
- package/dist/lib/authentication/providers/openid.js.map +1 -1
- package/dist/lib/authentication/providers/supabase.js +2 -9
- package/dist/lib/authentication/providers/supabase.js.map +1 -1
- package/dist/lib/authentication/state.d.ts +6 -5
- package/dist/lib/authentication/state.js +19 -6
- package/dist/lib/authentication/state.js.map +1 -1
- package/dist/lib/components/Autocomplete.js +2 -2
- package/dist/lib/components/Autocomplete.js.map +1 -1
- package/dist/lib/components/Banner.js +2 -2
- package/dist/lib/components/Banner.js.map +1 -1
- package/dist/lib/components/BuildCheck.js +1 -1
- package/dist/lib/components/BuildCheck.js.map +1 -1
- package/dist/lib/components/CategoryHeading.js +1 -1
- package/dist/lib/components/CategoryHeading.js.map +1 -1
- package/dist/lib/components/ErrorPage.js +2 -2
- package/dist/lib/components/ErrorPage.js.map +1 -1
- package/dist/lib/components/Footer.js +1 -1
- package/dist/lib/components/Footer.js.map +1 -1
- package/dist/lib/components/Framed.d.ts +7 -0
- package/dist/lib/components/Framed.js +26 -0
- package/dist/lib/components/Framed.js.map +1 -0
- package/dist/lib/components/Header.js +19 -18
- package/dist/lib/components/Header.js.map +1 -1
- package/dist/lib/components/Heading.d.ts +6 -2
- package/dist/lib/components/Heading.js +7 -2
- package/dist/lib/components/Heading.js.map +1 -1
- package/dist/lib/components/Main.js +4 -4
- package/dist/lib/components/Main.js.map +1 -1
- package/dist/lib/components/Markdown.d.ts +0 -1
- package/dist/lib/components/Markdown.js +9 -5
- package/dist/lib/components/Markdown.js.map +1 -1
- package/dist/lib/components/MobileTopNavigation.js +11 -7
- package/dist/lib/components/MobileTopNavigation.js.map +1 -1
- package/dist/lib/components/NotFoundPage.js +2 -2
- package/dist/lib/components/NotFoundPage.js.map +1 -1
- package/dist/lib/components/PageProgress.d.ts +1 -0
- package/dist/lib/components/PageProgress.js +20 -0
- package/dist/lib/components/PageProgress.js.map +1 -0
- package/dist/lib/components/Pagination.js +1 -1
- package/dist/lib/components/Pagination.js.map +1 -1
- package/dist/lib/components/StatusPage.js +4 -0
- package/dist/lib/components/StatusPage.js.map +1 -1
- package/dist/lib/components/TopNavigation.d.ts +7 -3
- package/dist/lib/components/TopNavigation.js +49 -44
- package/dist/lib/components/TopNavigation.js.map +1 -1
- package/dist/lib/components/Typography.d.ts +5 -0
- package/dist/lib/components/Typography.js +8 -0
- package/dist/lib/components/Typography.js.map +1 -0
- package/dist/lib/components/context/ZudokuContext.d.ts +3 -7
- package/dist/lib/components/context/ZudokuContext.js +44 -26
- package/dist/lib/components/context/ZudokuContext.js.map +1 -1
- package/dist/lib/components/context/ZudokuProvider.d.ts +1 -1
- package/dist/lib/components/index.d.ts +39 -23
- package/dist/lib/components/index.js +15 -7
- package/dist/lib/components/index.js.map +1 -1
- package/dist/lib/components/navigation/Navigation.d.ts +5 -0
- package/dist/lib/components/navigation/Navigation.js +12 -0
- package/dist/lib/components/navigation/Navigation.js.map +1 -0
- package/dist/lib/components/navigation/{SidebarBadge.d.ts → NavigationBadge.d.ts} +1 -1
- package/dist/lib/components/navigation/{SidebarBadge.js → NavigationBadge.js} +2 -2
- package/dist/lib/components/navigation/NavigationBadge.js.map +1 -0
- package/dist/lib/components/navigation/NavigationCategory.d.ts +5 -0
- package/dist/lib/components/navigation/{SidebarCategory.js → NavigationCategory.js} +15 -13
- package/dist/lib/components/navigation/NavigationCategory.js.map +1 -0
- package/dist/lib/components/navigation/NavigationItem.d.ts +6 -0
- package/dist/lib/components/navigation/NavigationItem.js +47 -0
- package/dist/lib/components/navigation/NavigationItem.js.map +1 -0
- package/dist/lib/components/navigation/{SidebarWrapper.d.ts → NavigationWrapper.d.ts} +1 -1
- package/dist/lib/components/navigation/{SidebarWrapper.js → NavigationWrapper.js} +5 -5
- package/dist/lib/components/navigation/NavigationWrapper.js.map +1 -0
- package/dist/lib/components/navigation/utils.d.ts +12 -9
- package/dist/lib/components/navigation/utils.js +38 -18
- package/dist/lib/components/navigation/utils.js.map +1 -1
- package/dist/lib/core/ZudokuContext.d.ts +13 -13
- package/dist/lib/core/ZudokuContext.js +21 -10
- package/dist/lib/core/ZudokuContext.js.map +1 -1
- package/dist/lib/core/plugins.d.ts +2 -2
- package/dist/lib/errors/ErrorAlert.js +2 -3
- package/dist/lib/errors/ErrorAlert.js.map +1 -1
- package/dist/lib/hooks/index.d.ts +25 -0
- package/dist/lib/hooks/index.js +11 -0
- package/dist/lib/hooks/index.js.map +1 -1
- package/dist/lib/hooks/useEvent.test.js +5 -3
- package/dist/lib/hooks/useEvent.test.js.map +1 -1
- package/dist/lib/hooks/useHotkey.d.ts +4 -0
- package/dist/lib/hooks/useHotkey.js +58 -0
- package/dist/lib/hooks/useHotkey.js.map +1 -0
- package/dist/lib/plugins/api-catalog/Catalog.d.ts +1 -1
- package/dist/lib/plugins/api-catalog/index.d.ts +6 -6
- package/dist/lib/plugins/api-catalog/index.js +10 -10
- package/dist/lib/plugins/api-catalog/index.js.map +1 -1
- package/dist/lib/plugins/api-keys/SettingsApiKeys.js +115 -23
- package/dist/lib/plugins/api-keys/SettingsApiKeys.js.map +1 -1
- package/dist/lib/plugins/api-keys/index.d.ts +3 -3
- package/dist/lib/plugins/api-keys/index.js +37 -18
- package/dist/lib/plugins/api-keys/index.js.map +1 -1
- package/dist/lib/plugins/custom-pages/index.d.ts +4 -6
- package/dist/lib/plugins/custom-pages/index.js +15 -10
- package/dist/lib/plugins/custom-pages/index.js.map +1 -1
- package/dist/lib/plugins/markdown/MdxPage.d.ts +1 -2
- package/dist/lib/plugins/markdown/MdxPage.js +30 -10
- package/dist/lib/plugins/markdown/MdxPage.js.map +1 -1
- package/dist/lib/plugins/markdown/index.d.ts +10 -2
- package/dist/lib/plugins/markdown/index.js +9 -26
- package/dist/lib/plugins/markdown/index.js.map +1 -1
- package/dist/lib/plugins/openapi/OperationList.js +3 -3
- 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/ParameterListItem.js +1 -1
- package/dist/lib/plugins/openapi/ParameterListItem.js.map +1 -1
- package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.d.ts +1 -1
- package/dist/lib/plugins/openapi/SchemaList.js +2 -3
- package/dist/lib/plugins/openapi/SchemaList.js.map +1 -1
- package/dist/lib/plugins/openapi/Sidecar.js +11 -91
- package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
- package/dist/lib/plugins/openapi/SidecarExamples.js +1 -1
- package/dist/lib/plugins/openapi/SidecarExamples.js.map +1 -1
- package/dist/lib/plugins/openapi/graphql/gql.d.ts +1 -1
- package/dist/lib/plugins/openapi/graphql/gql.js +1 -1
- package/dist/lib/plugins/openapi/graphql/gql.js.map +1 -1
- package/dist/lib/plugins/openapi/graphql/graphql.d.ts +3 -3
- package/dist/lib/plugins/openapi/graphql/graphql.js +2 -2
- package/dist/lib/plugins/openapi/graphql/graphql.js.map +1 -1
- package/dist/lib/plugins/openapi/index.d.ts +3 -3
- package/dist/lib/plugins/openapi/index.js +10 -10
- package/dist/lib/plugins/openapi/index.js.map +1 -1
- package/dist/lib/plugins/openapi/interfaces.d.ts +3 -3
- package/dist/lib/plugins/openapi/playground/BodyPanel.d.ts +5 -0
- package/dist/lib/plugins/openapi/playground/BodyPanel.js +26 -0
- package/dist/lib/plugins/openapi/playground/BodyPanel.js.map +1 -0
- package/dist/lib/plugins/openapi/playground/CollapsibleHeader.d.ts +8 -0
- package/dist/lib/plugins/openapi/playground/CollapsibleHeader.js +11 -0
- package/dist/lib/plugins/openapi/playground/CollapsibleHeader.js.map +1 -0
- package/dist/lib/plugins/openapi/playground/ExamplesDropdown.js +2 -1
- package/dist/lib/plugins/openapi/playground/ExamplesDropdown.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/Headers.d.ts +5 -4
- package/dist/lib/plugins/openapi/playground/Headers.js +54 -32
- package/dist/lib/plugins/openapi/playground/Headers.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/IdentityDialog.js +2 -1
- package/dist/lib/plugins/openapi/playground/IdentityDialog.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/IdentitySelector.js +1 -2
- package/dist/lib/plugins/openapi/playground/IdentitySelector.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/InlineInput.js +1 -1
- package/dist/lib/plugins/openapi/playground/InlineInput.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/ParamsGrid.js +2 -2
- package/dist/lib/plugins/openapi/playground/ParamsGrid.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/PathParams.js +1 -2
- package/dist/lib/plugins/openapi/playground/PathParams.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/Playground.d.ts +3 -8
- package/dist/lib/plugins/openapi/playground/Playground.js +110 -92
- package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js +1 -1
- package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/QueryParams.d.ts +2 -2
- package/dist/lib/plugins/openapi/playground/QueryParams.js +38 -23
- package/dist/lib/plugins/openapi/playground/QueryParams.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/Spinner.d.ts +2 -0
- package/dist/lib/plugins/openapi/playground/Spinner.js +63 -0
- package/dist/lib/plugins/openapi/playground/Spinner.js.map +1 -0
- package/dist/lib/plugins/openapi/playground/fileUtils.d.ts +2 -0
- package/dist/lib/plugins/openapi/playground/fileUtils.js +22 -0
- package/dist/lib/plugins/openapi/playground/fileUtils.js.map +1 -0
- package/dist/lib/plugins/openapi/playground/request-panel/UrlPath.d.ts +3 -0
- package/dist/lib/plugins/openapi/playground/request-panel/UrlPath.js +13 -0
- package/dist/lib/plugins/openapi/playground/request-panel/UrlPath.js.map +1 -0
- package/dist/lib/plugins/openapi/playground/request-panel/UrlQueryParams.d.ts +1 -0
- package/dist/lib/plugins/openapi/playground/request-panel/UrlQueryParams.js +12 -0
- package/dist/lib/plugins/openapi/playground/request-panel/UrlQueryParams.js.map +1 -0
- package/dist/lib/plugins/openapi/playground/result-panel/Highlight.d.ts +12 -0
- package/dist/lib/plugins/openapi/playground/result-panel/Highlight.js +11 -0
- package/dist/lib/plugins/openapi/playground/result-panel/Highlight.js.map +1 -0
- package/dist/lib/plugins/openapi/playground/result-panel/ResponseStatusBar.d.ts +8 -0
- package/dist/lib/plugins/openapi/playground/result-panel/ResponseStatusBar.js +69 -0
- package/dist/lib/plugins/openapi/playground/result-panel/ResponseStatusBar.js.map +1 -0
- package/dist/lib/plugins/openapi/playground/result-panel/ResponseTab.d.ts +10 -4
- package/dist/lib/plugins/openapi/playground/result-panel/ResponseTab.js +33 -31
- package/dist/lib/plugins/openapi/playground/result-panel/ResponseTab.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/result-panel/ResultPanel.d.ts +4 -2
- package/dist/lib/plugins/openapi/playground/result-panel/ResultPanel.js +8 -10
- package/dist/lib/plugins/openapi/playground/result-panel/ResultPanel.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/useRememberSkipLoginDialog.d.ts +16 -0
- package/dist/lib/plugins/openapi/playground/useRememberSkipLoginDialog.js +10 -0
- package/dist/lib/plugins/openapi/playground/useRememberSkipLoginDialog.js.map +1 -0
- package/dist/lib/plugins/openapi/schema/SchemaExampleAndDefault.js +3 -3
- package/dist/lib/plugins/openapi/schema/SchemaExampleAndDefault.js.map +1 -1
- package/dist/lib/plugins/openapi/schema/SchemaPropertyItem.js +2 -3
- package/dist/lib/plugins/openapi/schema/SchemaPropertyItem.js.map +1 -1
- package/dist/lib/plugins/openapi/schema/SchemaView.js +5 -5
- package/dist/lib/plugins/openapi/schema/SchemaView.js.map +1 -1
- package/dist/lib/plugins/openapi/schema/utils.js +3 -2
- package/dist/lib/plugins/openapi/schema/utils.js.map +1 -1
- package/dist/lib/plugins/openapi/util/createHttpSnippet.d.ts +11 -0
- package/dist/lib/plugins/openapi/util/createHttpSnippet.js +89 -0
- package/dist/lib/plugins/openapi/util/createHttpSnippet.js.map +1 -0
- package/dist/lib/plugins/openapi/util/createNavigationCategory.d.ts +9 -0
- package/dist/lib/plugins/openapi/util/{createSidebarCategory.js → createNavigationCategory.js} +5 -4
- package/dist/lib/plugins/openapi/util/createNavigationCategory.js.map +1 -0
- package/dist/lib/plugins/openapi/util/getRoutes.js +2 -2
- package/dist/lib/plugins/openapi/util/getRoutes.js.map +1 -1
- package/dist/lib/plugins/openapi/util/methodColorMap.d.ts +1 -1
- package/dist/lib/plugins/search-inkeep/index.d.ts +5 -22
- package/dist/lib/plugins/search-inkeep/index.js +35 -29
- package/dist/lib/plugins/search-inkeep/index.js.map +1 -1
- package/dist/lib/plugins/search-inkeep/inkeep.d.ts +5 -21
- package/dist/lib/plugins/search-inkeep/inkeep.js +10 -19
- package/dist/lib/plugins/search-inkeep/inkeep.js.map +1 -1
- package/dist/lib/plugins/search-pagefind/PagefindSearch.js +1 -1
- package/dist/lib/plugins/search-pagefind/PagefindSearch.js.map +1 -1
- package/dist/lib/plugins/search-pagefind/ResultList.d.ts +1 -1
- package/dist/lib/plugins/search-pagefind/ResultList.js +12 -5
- package/dist/lib/plugins/search-pagefind/ResultList.js.map +1 -1
- package/dist/lib/shiki.d.ts +8 -12
- package/dist/lib/shiki.js +11 -13
- package/dist/lib/shiki.js.map +1 -1
- package/dist/lib/ui/Alert.d.ts +6 -5
- package/dist/lib/ui/Alert.js +12 -10
- package/dist/lib/ui/Alert.js.map +1 -1
- package/dist/lib/ui/Callout.js +1 -1
- package/dist/lib/ui/Callout.js.map +1 -1
- package/dist/lib/ui/CodeBlock.d.ts +1 -2
- package/dist/lib/ui/CodeBlock.js +10 -11
- package/dist/lib/ui/CodeBlock.js.map +1 -1
- package/dist/lib/ui/Dialog.d.ts +3 -1
- package/dist/lib/ui/Dialog.js +2 -2
- package/dist/lib/ui/Dialog.js.map +1 -1
- package/dist/lib/ui/EmbeddedCodeBlock.d.ts +15 -0
- package/dist/lib/ui/EmbeddedCodeBlock.js +18 -0
- package/dist/lib/ui/EmbeddedCodeBlock.js.map +1 -0
- package/dist/lib/ui/Select.js +1 -1
- package/dist/lib/ui/SyntaxHighlight.d.ts +3 -1
- package/dist/lib/ui/SyntaxHighlight.js +3 -2
- package/dist/lib/ui/SyntaxHighlight.js.map +1 -1
- package/dist/lib/ui/Tooltip.d.ts +2 -1
- package/dist/lib/ui/Tooltip.js +2 -1
- package/dist/lib/ui/Tooltip.js.map +1 -1
- package/dist/lib/util/MdxComponents.d.ts +9 -1
- package/dist/lib/util/MdxComponents.js +4 -2
- package/dist/lib/util/MdxComponents.js.map +1 -1
- package/dist/lib/util/humanFileSize.d.ts +6 -0
- package/dist/lib/util/humanFileSize.js +14 -0
- package/dist/lib/util/humanFileSize.js.map +1 -0
- package/dist/lib/util/humanFileSize.test.d.ts +1 -0
- package/dist/lib/util/humanFileSize.test.js +22 -0
- package/dist/lib/util/humanFileSize.test.js.map +1 -0
- package/dist/lib/util/os.d.ts +2 -0
- package/dist/lib/util/os.js +21 -0
- package/dist/lib/util/os.js.map +1 -0
- package/dist/lib/util/useCopyToClipboard.d.ts +1 -0
- package/dist/lib/util/useCopyToClipboard.js +11 -0
- package/dist/lib/util/useCopyToClipboard.js.map +1 -0
- package/dist/lib/util/useScrollToAnchor.js +3 -3
- package/dist/lib/util/useScrollToAnchor.js.map +1 -1
- package/dist/vite/api/SchemaManager.d.ts +4 -4
- package/dist/vite/api/SchemaManager.js +25 -21
- package/dist/vite/api/SchemaManager.js.map +1 -1
- package/dist/vite/api/SchemaManager.test.js +4 -4
- package/dist/vite/api/SchemaManager.test.js.map +1 -1
- package/dist/vite/api/schema-codegen.js +42 -11
- package/dist/vite/api/schema-codegen.js.map +1 -1
- package/dist/vite/api/schema-codegen.test.js +82 -0
- package/dist/vite/api/schema-codegen.test.js.map +1 -1
- package/dist/vite/build.js +10 -34
- package/dist/vite/build.js.map +1 -1
- package/dist/vite/config.js +12 -2
- package/dist/vite/config.js.map +1 -1
- package/dist/vite/css/plugin.js +11 -0
- package/dist/vite/css/plugin.js.map +1 -1
- package/dist/vite/dev-server.js +1 -1
- package/dist/vite/mdx/remark-last-modified.d.ts +3 -0
- package/dist/vite/mdx/remark-last-modified.js +29 -0
- package/dist/vite/mdx/remark-last-modified.js.map +1 -0
- package/dist/vite/mdx/utils.d.ts +2 -0
- package/dist/vite/mdx/utils.js +31 -0
- package/dist/vite/mdx/utils.js.map +1 -0
- package/dist/vite/plugin-api.js +8 -8
- package/dist/vite/plugin-api.js.map +1 -1
- package/dist/vite/plugin-config-reload.js +2 -0
- package/dist/vite/plugin-config-reload.js.map +1 -1
- package/dist/vite/plugin-custom-pages.js +2 -2
- package/dist/vite/plugin-custom-pages.js.map +1 -1
- package/dist/vite/plugin-docs.js +61 -59
- package/dist/vite/plugin-docs.js.map +1 -1
- package/dist/vite/plugin-frontmatter.js +6 -2
- package/dist/vite/plugin-frontmatter.js.map +1 -1
- package/dist/vite/plugin-mdx.js +17 -38
- package/dist/vite/plugin-mdx.js.map +1 -1
- package/dist/vite/{plugin-sidebar.d.ts → plugin-navigation.d.ts} +1 -1
- package/dist/vite/{plugin-sidebar.js → plugin-navigation.js} +20 -19
- package/dist/vite/plugin-navigation.js.map +1 -0
- package/dist/vite/plugin-theme.d.ts +8 -0
- package/dist/vite/plugin-theme.js +234 -0
- package/dist/vite/plugin-theme.js.map +1 -0
- package/dist/vite/plugin-theme.test.d.ts +1 -0
- package/dist/vite/plugin-theme.test.js +312 -0
- package/dist/vite/plugin-theme.test.js.map +1 -0
- package/dist/vite/plugin.js +4 -6
- package/dist/vite/plugin.js.map +1 -1
- package/dist/vite/shadcn-registry.d.ts +45 -0
- package/dist/vite/shadcn-registry.js +29 -0
- package/dist/vite/shadcn-registry.js.map +1 -0
- package/lib/Alert-Cig_8hW6.js +161 -0
- package/lib/Alert-Cig_8hW6.js.map +1 -0
- package/lib/{Button-u7M2QYds.js → Button-B3o-2Xdf.js} +3 -3
- package/lib/{Button-u7M2QYds.js.map → Button-B3o-2Xdf.js.map} +1 -1
- package/lib/{Card-DkH-AU1V.js → Card-CMDQUPM4.js} +2 -2
- package/lib/{Card-DkH-AU1V.js.map → Card-CMDQUPM4.js.map} +1 -1
- package/lib/CodeBlock-BaBgX9Wy.js +85 -0
- package/lib/CodeBlock-BaBgX9Wy.js.map +1 -0
- package/lib/Command-C9AC5cf-.js +140 -0
- package/lib/Command-C9AC5cf-.js.map +1 -0
- package/lib/{Dialog-irKZWXGg.js → Dialog-DMWw1doX.js} +26 -26
- package/lib/Dialog-DMWw1doX.js.map +1 -0
- package/lib/{Drawer-DZ214i5V.js → Drawer-DXGPOKPx.js} +2 -2
- package/lib/{Drawer-DZ214i5V.js.map → Drawer-DXGPOKPx.js.map} +1 -1
- package/lib/MdxPage-D8Med7IR.js +110 -0
- package/lib/MdxPage-D8Med7IR.js.map +1 -0
- package/lib/OasProvider-YexVRErA.js +35 -0
- package/lib/OasProvider-YexVRErA.js.map +1 -0
- package/lib/{OperationList-CkKcRPvk.js → OperationList-CL_tp7DC.js} +1749 -1728
- package/lib/OperationList-CL_tp7DC.js.map +1 -0
- package/lib/Pagination-Bcjbdo_g.js +37 -0
- package/lib/Pagination-Bcjbdo_g.js.map +1 -0
- package/lib/RouteGuard-Vnlz_t51.js +737 -0
- package/lib/RouteGuard-Vnlz_t51.js.map +1 -0
- package/lib/{SchemaList-BUiEgmw6.js → SchemaList-BNDTWO1B.js} +32 -43
- package/lib/SchemaList-BNDTWO1B.js.map +1 -0
- package/lib/{SchemaView-DSgzGi1L.js → SchemaView-DdKqED8D.js} +95 -104
- package/lib/SchemaView-DdKqED8D.js.map +1 -0
- package/lib/SignUp-BkAQMKsK.js +56 -0
- package/lib/SignUp-BkAQMKsK.js.map +1 -0
- package/lib/Slot-CrCBhP3G.js +15743 -0
- package/lib/Slot-CrCBhP3G.js.map +1 -0
- package/lib/{SyntaxHighlight-DTgNHbGp.js → SyntaxHighlight-CVe58ZSY.js} +4683 -3484
- package/lib/SyntaxHighlight-CVe58ZSY.js.map +1 -0
- package/lib/{Toc-Ccycwd-T.js → Toc-CpsFSXeD.js} +3 -3
- package/lib/{Toc-Ccycwd-T.js.map → Toc-CpsFSXeD.js.map} +1 -1
- package/lib/{chunk-BAXFHI7N-C9WnHsLV.js → chunk-DQRVZFIR-DHK7_Ilc.js} +701 -701
- package/lib/chunk-DQRVZFIR-DHK7_Ilc.js.map +1 -0
- package/lib/{circular-D1Bwr5bf.js → circular-BJUzZQ5q.js} +1812 -1807
- package/lib/circular-BJUzZQ5q.js.map +1 -0
- package/lib/clerk-BDZ31hjU.js +25190 -0
- package/lib/clerk-BDZ31hjU.js.map +1 -0
- package/lib/clsx-OuTLNxxd.js +17 -0
- package/lib/clsx-OuTLNxxd.js.map +1 -0
- package/lib/{cn-BOFVZgHd.js → cn-dYga0KKN.js} +237 -250
- package/lib/cn-dYga0KKN.js.map +1 -0
- package/lib/{createServer-BZp1gEBL.js → createServer-C8-YhyiB.js} +2459 -2448
- package/lib/createServer-C8-YhyiB.js.map +1 -0
- package/lib/errors-CKo4K1aM.js +78 -0
- package/lib/errors-CKo4K1aM.js.map +1 -0
- package/lib/hook-CZjW2buS.js +1510 -0
- package/lib/hook-CZjW2buS.js.map +1 -0
- package/lib/{index-BvvmIczU.js → index-4XtG1tlD.js} +2 -2
- package/lib/{index-BvvmIczU.js.map → index-4XtG1tlD.js.map} +1 -1
- package/lib/index-B3xhxwZH.js +3469 -0
- package/lib/index-B3xhxwZH.js.map +1 -0
- package/lib/index-B4yKFxne.js +3980 -0
- package/lib/index-B4yKFxne.js.map +1 -0
- package/lib/index-Bm35Tkgf.js +107 -0
- package/lib/index-Bm35Tkgf.js.map +1 -0
- package/lib/index-CrcNWbel.js.map +1 -1
- package/lib/{index-C1S4w-gl.js → index-DI5SPFK9.js} +2 -2
- package/lib/{index-C1S4w-gl.js.map → index-DI5SPFK9.js.map} +1 -1
- package/lib/{index-zddirpDj.js → index-DmNq2fbN.js} +226 -221
- package/lib/index-DmNq2fbN.js.map +1 -0
- package/lib/index.esm-Cp4wkyud.js +1236 -0
- package/lib/index.esm-Cp4wkyud.js.map +1 -0
- package/lib/ui/Accordion.js +1 -1
- package/lib/ui/ActionButton.js +2 -2
- package/lib/ui/Alert.js +54 -38
- package/lib/ui/Alert.js.map +1 -1
- package/lib/ui/AlertDialog.js +1 -1
- package/lib/ui/Badge.js +2 -2
- package/lib/ui/Breadcrumb.js +1 -1
- package/lib/ui/Button.js +2 -2
- package/lib/ui/Callout.js +6 -5
- package/lib/ui/Callout.js.map +1 -1
- package/lib/ui/Card.js +1 -1
- package/lib/ui/Carousel.js +1 -1
- package/lib/ui/Checkbox.js +1 -1
- package/lib/ui/CodeBlock.js +6 -80
- package/lib/ui/CodeBlock.js.map +1 -1
- package/lib/ui/Command.js +2 -2
- package/lib/ui/Dialog.js +40 -40
- package/lib/ui/Dialog.js.map +1 -1
- package/lib/ui/Drawer.js +2 -2
- package/lib/ui/DropdownMenu.js +1 -1
- package/lib/ui/EmbeddedCodeBlock.js +80 -0
- package/lib/ui/EmbeddedCodeBlock.js.map +1 -0
- package/lib/ui/Form.js +2 -2
- package/lib/ui/HoverCard.js +1 -1
- package/lib/ui/Input.js +1 -1
- package/lib/ui/Label.js +2 -2
- 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/Select.js +2 -2
- package/lib/ui/Select.js.map +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 +5 -4
- package/lib/ui/SyntaxHighlight.js.map +1 -1
- package/lib/ui/Tabs.js +1 -1
- package/lib/ui/Textarea.js +1 -1
- package/lib/ui/Toggle.js +2 -2
- package/lib/ui/ToggleGroup.js +1 -1
- package/lib/ui/Tooltip.js +15 -8
- package/lib/ui/Tooltip.js.map +1 -1
- package/lib/ui/util.js +1 -1
- package/lib/{useExposedProps-DG8J6ewJ.js → useExposedProps-BIYjecPD.js} +2 -2
- package/lib/{useExposedProps-DG8J6ewJ.js.map → useExposedProps-BIYjecPD.js.map} +1 -1
- package/lib/zudoku.auth-auth0.js +2 -2
- package/lib/zudoku.auth-auth0.js.map +1 -1
- package/lib/zudoku.auth-azureb2c.js +9971 -0
- package/lib/zudoku.auth-azureb2c.js.map +1 -0
- package/lib/zudoku.auth-clerk.js +39 -48
- package/lib/zudoku.auth-clerk.js.map +1 -1
- package/lib/zudoku.auth-openid.js +381 -406
- package/lib/zudoku.auth-openid.js.map +1 -1
- package/lib/zudoku.components.js +29 -30
- package/lib/zudoku.components.js.map +1 -1
- package/lib/zudoku.hooks.js +21 -13
- package/lib/zudoku.hooks.js.map +1 -1
- package/lib/zudoku.plugin-api-catalog.js +45 -45
- package/lib/zudoku.plugin-api-catalog.js.map +1 -1
- package/lib/zudoku.plugin-api-keys.js +512 -4971
- package/lib/zudoku.plugin-api-keys.js.map +1 -1
- package/lib/zudoku.plugin-custom-pages.js +12 -18
- package/lib/zudoku.plugin-custom-pages.js.map +1 -1
- package/lib/zudoku.plugin-markdown.js +19 -69
- package/lib/zudoku.plugin-markdown.js.map +1 -1
- package/lib/zudoku.plugin-openapi.js +6 -6
- package/lib/zudoku.plugin-redirect.js +1 -1
- package/lib/zudoku.plugin-search-inkeep.js +54 -57
- package/lib/zudoku.plugin-search-inkeep.js.map +1 -1
- package/lib/zudoku.plugin-search-pagefind.js +211 -117
- package/lib/zudoku.plugin-search-pagefind.js.map +1 -1
- package/lib/zudoku.plugins.js.map +1 -1
- package/package.json +91 -70
- package/src/app/ZuploBuildConfig.ts +8 -8
- package/src/app/defaultTheme.css +68 -49
- package/src/app/demo.tsx +24 -6
- package/src/app/entry.client.tsx +0 -2
- package/src/app/entry.server.tsx +0 -2
- package/src/app/env.ts +8 -0
- package/src/app/main.css +15 -57
- package/src/app/main.tsx +18 -24
- package/src/app/standalone.tsx +7 -6
- package/src/lib/auth/issuer.test.ts +120 -0
- package/src/lib/auth/issuer.ts +41 -0
- package/src/lib/authentication/AuthenticationPlugin.tsx +0 -14
- package/src/lib/authentication/authentication.ts +2 -2
- package/src/lib/authentication/components/CallbackHandler.tsx +1 -1
- package/src/lib/authentication/components/SignIn.tsx +5 -12
- package/src/lib/authentication/providers/auth0.tsx +1 -1
- package/src/lib/authentication/providers/azureb2c.tsx +196 -0
- package/src/lib/authentication/providers/clerk.tsx +3 -12
- package/src/lib/authentication/providers/openid.tsx +76 -4
- package/src/lib/authentication/providers/supabase.tsx +2 -9
- package/src/lib/authentication/state.ts +37 -7
- package/src/lib/components/Autocomplete.tsx +2 -1
- package/src/lib/components/Banner.tsx +1 -2
- package/src/lib/components/BuildCheck.tsx +1 -1
- package/src/lib/components/CategoryHeading.tsx +4 -1
- package/src/lib/components/ErrorPage.tsx +3 -3
- package/src/lib/components/Footer.tsx +1 -1
- package/src/lib/components/Framed.tsx +51 -0
- package/src/lib/components/Header.tsx +25 -22
- package/src/lib/components/Heading.tsx +16 -8
- package/src/lib/components/Main.tsx +9 -9
- package/src/lib/components/Markdown.tsx +17 -9
- package/src/lib/components/MobileTopNavigation.tsx +69 -15
- package/src/lib/components/NotFoundPage.tsx +3 -3
- package/src/lib/components/PageProgress.tsx +28 -0
- package/src/lib/components/Pagination.tsx +5 -4
- package/src/lib/components/StatusPage.tsx +5 -0
- package/src/lib/components/TopNavigation.tsx +75 -68
- package/src/lib/components/Typography.tsx +14 -0
- package/src/lib/components/context/ZudokuContext.ts +50 -32
- package/src/lib/components/context/ZudokuProvider.tsx +1 -1
- package/src/lib/components/index.ts +16 -10
- package/src/lib/components/navigation/{Sidebar.tsx → Navigation.tsx} +18 -16
- package/src/lib/components/navigation/{SidebarBadge.tsx → NavigationBadge.tsx} +1 -1
- package/src/lib/components/navigation/{SidebarCategory.tsx → NavigationCategory.tsx} +17 -15
- package/src/lib/components/navigation/NavigationItem.tsx +151 -0
- package/src/lib/components/navigation/{SidebarWrapper.tsx → NavigationWrapper.tsx} +7 -4
- package/src/lib/components/navigation/utils.ts +52 -29
- package/src/lib/core/ZudokuContext.ts +36 -20
- package/src/lib/core/plugins.ts +2 -2
- package/src/lib/errors/ErrorAlert.tsx +3 -9
- package/src/lib/hooks/index.ts +11 -0
- package/src/lib/hooks/useEvent.test.tsx +7 -5
- package/src/lib/hooks/useHotkey.ts +70 -0
- package/src/lib/plugins/api-catalog/Catalog.tsx +1 -1
- package/src/lib/plugins/api-catalog/index.tsx +19 -19
- package/src/lib/plugins/api-keys/SettingsApiKeys.tsx +238 -70
- package/src/lib/plugins/api-keys/index.tsx +50 -23
- package/src/lib/plugins/custom-pages/index.tsx +21 -16
- package/src/lib/plugins/markdown/MdxPage.tsx +76 -21
- package/src/lib/plugins/markdown/index.tsx +28 -41
- package/src/lib/plugins/openapi/OperationList.tsx +12 -20
- package/src/lib/plugins/openapi/OperationListItem.tsx +3 -3
- package/src/lib/plugins/openapi/ParameterListItem.tsx +6 -0
- package/src/lib/plugins/openapi/PlaygroundDialogWrapper.tsx +1 -1
- package/src/lib/plugins/openapi/SchemaList.tsx +5 -11
- package/src/lib/plugins/openapi/Sidecar.tsx +12 -97
- package/src/lib/plugins/openapi/SidecarExamples.tsx +1 -0
- package/src/lib/plugins/openapi/graphql/gql.ts +5 -5
- package/src/lib/plugins/openapi/graphql/graphql.ts +6 -6
- package/src/lib/plugins/openapi/index.tsx +12 -12
- package/src/lib/plugins/openapi/interfaces.ts +3 -3
- package/src/lib/plugins/openapi/playground/BodyPanel.tsx +55 -0
- package/src/lib/plugins/openapi/playground/CollapsibleHeader.tsx +47 -0
- package/src/lib/plugins/openapi/playground/ExamplesDropdown.tsx +8 -1
- package/src/lib/plugins/openapi/playground/Headers.tsx +217 -115
- package/src/lib/plugins/openapi/playground/IdentityDialog.tsx +3 -2
- package/src/lib/plugins/openapi/playground/IdentitySelector.tsx +13 -16
- package/src/lib/plugins/openapi/playground/InlineInput.tsx +1 -1
- package/src/lib/plugins/openapi/playground/ParamsGrid.tsx +2 -2
- package/src/lib/plugins/openapi/playground/PathParams.tsx +4 -5
- package/src/lib/plugins/openapi/playground/Playground.tsx +253 -288
- package/src/lib/plugins/openapi/playground/PlaygroundDialog.tsx +2 -1
- package/src/lib/plugins/openapi/playground/QueryParams.tsx +104 -58
- package/src/lib/plugins/openapi/playground/Spinner.tsx +87 -0
- package/src/lib/plugins/openapi/playground/fileUtils.ts +32 -0
- package/src/lib/plugins/openapi/playground/request-panel/UrlPath.tsx +31 -0
- package/src/lib/plugins/openapi/playground/request-panel/UrlQueryParams.tsx +25 -0
- package/src/lib/plugins/openapi/playground/result-panel/Highlight.tsx +26 -0
- package/src/lib/plugins/openapi/playground/result-panel/ResponseStatusBar.tsx +115 -0
- package/src/lib/plugins/openapi/playground/result-panel/ResponseTab.tsx +149 -108
- package/src/lib/plugins/openapi/playground/result-panel/ResultPanel.tsx +68 -89
- package/src/lib/plugins/openapi/playground/useRememberSkipLoginDialog.tsx +20 -0
- package/src/lib/plugins/openapi/schema/SchemaExampleAndDefault.tsx +3 -3
- package/src/lib/plugins/openapi/schema/SchemaPropertyItem.tsx +2 -3
- package/src/lib/plugins/openapi/schema/SchemaView.tsx +6 -11
- package/src/lib/plugins/openapi/schema/utils.ts +3 -2
- package/src/lib/plugins/openapi/util/createHttpSnippet.ts +107 -0
- package/src/lib/plugins/openapi/util/{createSidebarCategory.tsx → createNavigationCategory.tsx} +6 -5
- package/src/lib/plugins/openapi/util/getRoutes.tsx +2 -2
- package/src/lib/plugins/openapi/util/methodColorMap.tsx +1 -1
- package/src/lib/plugins/search-inkeep/index.tsx +54 -58
- package/src/lib/plugins/search-inkeep/inkeep.ts +19 -21
- package/src/lib/plugins/search-pagefind/PagefindSearch.tsx +1 -0
- package/src/lib/plugins/search-pagefind/ResultList.tsx +13 -4
- package/src/lib/shiki.ts +21 -22
- package/src/lib/ui/Alert.tsx +45 -39
- package/src/lib/ui/Callout.tsx +1 -0
- package/src/lib/ui/CodeBlock.tsx +40 -54
- package/src/lib/ui/Dialog.tsx +11 -7
- package/src/lib/ui/EmbeddedCodeBlock.tsx +94 -0
- package/src/lib/ui/Select.tsx +1 -1
- package/src/lib/ui/SyntaxHighlight.tsx +11 -3
- package/src/lib/ui/Tooltip.tsx +16 -1
- package/src/lib/util/MdxComponents.tsx +13 -2
- package/src/lib/util/humanFileSize.test.ts +24 -0
- package/src/lib/util/humanFileSize.ts +16 -0
- package/src/lib/util/os.ts +18 -0
- package/src/lib/util/useCopyToClipboard.ts +17 -0
- package/src/lib/util/useScrollToAnchor.ts +3 -3
- package/dist/config/validators/InputSidebarSchema.d.ts +0 -217
- package/dist/config/validators/InputSidebarSchema.js +0 -62
- package/dist/config/validators/InputSidebarSchema.js.map +0 -1
- package/dist/config/validators/SidebarSchema.d.ts +0 -46
- package/dist/config/validators/SidebarSchema.js +0 -118
- package/dist/config/validators/SidebarSchema.js.map +0 -1
- package/dist/lib/components/navigation/Sidebar.d.ts +0 -5
- package/dist/lib/components/navigation/Sidebar.js +0 -10
- package/dist/lib/components/navigation/Sidebar.js.map +0 -1
- package/dist/lib/components/navigation/SidebarBadge.js.map +0 -1
- package/dist/lib/components/navigation/SidebarCategory.d.ts +0 -5
- package/dist/lib/components/navigation/SidebarCategory.js.map +0 -1
- package/dist/lib/components/navigation/SidebarItem.d.ts +0 -11
- package/dist/lib/components/navigation/SidebarItem.js +0 -49
- package/dist/lib/components/navigation/SidebarItem.js.map +0 -1
- package/dist/lib/components/navigation/SidebarWrapper.js.map +0 -1
- package/dist/lib/plugins/custom-pages/CustomPage.d.ts +0 -2
- package/dist/lib/plugins/custom-pages/CustomPage.js +0 -11
- package/dist/lib/plugins/custom-pages/CustomPage.js.map +0 -1
- package/dist/lib/plugins/markdown/resolver.d.ts +0 -32
- package/dist/lib/plugins/markdown/resolver.js +0 -46
- package/dist/lib/plugins/markdown/resolver.js.map +0 -1
- package/dist/lib/plugins/openapi/playground/SubmitButton.d.ts +0 -7
- package/dist/lib/plugins/openapi/playground/SubmitButton.js +0 -19
- package/dist/lib/plugins/openapi/playground/SubmitButton.js.map +0 -1
- package/dist/lib/plugins/openapi/playground/UrlDisplay.d.ts +0 -4
- package/dist/lib/plugins/openapi/playground/UrlDisplay.js +0 -22
- package/dist/lib/plugins/openapi/playground/UrlDisplay.js.map +0 -1
- package/dist/lib/plugins/openapi/playground/result-panel/RequestTab.d.ts +0 -7
- package/dist/lib/plugins/openapi/playground/result-panel/RequestTab.js +0 -11
- package/dist/lib/plugins/openapi/playground/result-panel/RequestTab.js.map +0 -1
- package/dist/lib/plugins/openapi/util/createSidebarCategory.d.ts +0 -9
- package/dist/lib/plugins/openapi/util/createSidebarCategory.js.map +0 -1
- package/dist/vite/plugin-configure-tailwind.d.ts +0 -2
- package/dist/vite/plugin-configure-tailwind.js +0 -38
- package/dist/vite/plugin-configure-tailwind.js.map +0 -1
- package/dist/vite/plugin-sidebar.js.map +0 -1
- package/dist/vite/plugin-theme-css.d.ts +0 -5
- package/dist/vite/plugin-theme-css.js +0 -77
- package/dist/vite/plugin-theme-css.js.map +0 -1
- package/lib/Callout-CtCQJ6Cc.js +0 -230
- package/lib/Callout-CtCQJ6Cc.js.map +0 -1
- package/lib/CategoryHeading-BA7lKNWz.js +0 -10
- package/lib/CategoryHeading-BA7lKNWz.js.map +0 -1
- package/lib/Dialog-irKZWXGg.js.map +0 -1
- package/lib/Markdown-BNG8bTDA.js +0 -7691
- package/lib/Markdown-BNG8bTDA.js.map +0 -1
- package/lib/MdxPage-D74eGiYZ.js +0 -84
- package/lib/MdxPage-D74eGiYZ.js.map +0 -1
- package/lib/OasProvider-D61BSWef.js +0 -33
- package/lib/OasProvider-D61BSWef.js.map +0 -1
- package/lib/OperationList-CkKcRPvk.js.map +0 -1
- package/lib/Pagination-CeFxTDan.js +0 -36
- package/lib/Pagination-CeFxTDan.js.map +0 -1
- package/lib/RouteGuard-CIyGFkFD.js +0 -55
- package/lib/RouteGuard-CIyGFkFD.js.map +0 -1
- package/lib/SchemaList-BUiEgmw6.js.map +0 -1
- package/lib/SchemaView-DSgzGi1L.js.map +0 -1
- package/lib/SignUp-DCgoDR--.js +0 -63
- package/lib/SignUp-DCgoDR--.js.map +0 -1
- package/lib/Slot-Dw-g06lX.js +0 -160
- package/lib/Slot-Dw-g06lX.js.map +0 -1
- package/lib/SyntaxHighlight-DTgNHbGp.js.map +0 -1
- package/lib/chunk-BAXFHI7N-C9WnHsLV.js.map +0 -1
- package/lib/circular-D1Bwr5bf.js.map +0 -1
- package/lib/cn-BOFVZgHd.js.map +0 -1
- package/lib/createServer-BZp1gEBL.js.map +0 -1
- package/lib/hook-BpiAQVtd.js +0 -1446
- package/lib/hook-BpiAQVtd.js.map +0 -1
- package/lib/index--oeBayMa.js +0 -86
- package/lib/index--oeBayMa.js.map +0 -1
- package/lib/index-Bn6Lc9tq.js +0 -9
- package/lib/index-Bn6Lc9tq.js.map +0 -1
- package/lib/index-DEr_Ta6s.js +0 -4977
- package/lib/index-DEr_Ta6s.js.map +0 -1
- package/lib/index-E90CTqBl.js +0 -3268
- package/lib/index-E90CTqBl.js.map +0 -1
- package/lib/index-zddirpDj.js.map +0 -1
- package/lib/index.esm-BFcSKCe-.js +0 -683
- package/lib/index.esm-BFcSKCe-.js.map +0 -1
- package/lib/index.esm-DSfX_eMP.js +0 -1216
- package/lib/index.esm-DSfX_eMP.js.map +0 -1
- package/lib/mutation-CJrIFMgY.js +0 -196
- package/lib/mutation-CJrIFMgY.js.map +0 -1
- package/lib/objectEntries-yMIkr2mI.js +0 -5
- package/lib/objectEntries-yMIkr2mI.js.map +0 -1
- package/lib/useLatest-hmRS46UF.js +0 -11
- package/lib/useLatest-hmRS46UF.js.map +0 -1
- package/lib/useMutation-B2LNwShM.js +0 -97
- package/lib/useMutation-B2LNwShM.js.map +0 -1
- package/src/lib/components/navigation/SidebarItem.tsx +0 -117
- package/src/lib/plugins/custom-pages/CustomPage.tsx +0 -18
- package/src/lib/plugins/markdown/resolver.ts +0 -59
- package/src/lib/plugins/openapi/playground/SubmitButton.tsx +0 -70
- package/src/lib/plugins/openapi/playground/UrlDisplay.tsx +0 -32
- package/src/lib/plugins/openapi/playground/result-panel/RequestTab.tsx +0 -73
|
@@ -4,17 +4,17 @@ import { ChevronRightIcon } from "lucide-react";
|
|
|
4
4
|
import { memo, useEffect, useState } from "react";
|
|
5
5
|
import { NavLink, useLocation, useMatch } from "react-router";
|
|
6
6
|
import { Button } from "zudoku/ui/Button.js";
|
|
7
|
-
import type {
|
|
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 {
|
|
11
|
-
import { useIsCategoryOpen } from "./utils.js";
|
|
10
|
+
import { NavigationItem } from "./NavigationItem.js";
|
|
11
|
+
import { navigationListItem, useIsCategoryOpen } from "./utils.js";
|
|
12
12
|
|
|
13
|
-
const
|
|
13
|
+
const NavigationCategoryInner = ({
|
|
14
14
|
category,
|
|
15
15
|
onRequestClose,
|
|
16
16
|
}: {
|
|
17
|
-
category:
|
|
17
|
+
category: NavigationCategoryType;
|
|
18
18
|
onRequestClose?: () => void;
|
|
19
19
|
}) => {
|
|
20
20
|
const isCategoryOpen = useIsCategoryOpen(category);
|
|
@@ -27,11 +27,11 @@ const SidebarCategoryInner = ({
|
|
|
27
27
|
!isCollapsible || !isCollapsed || isCategoryOpen,
|
|
28
28
|
);
|
|
29
29
|
const [open, setOpen] = useState(isDefaultOpen);
|
|
30
|
-
const isActive = useMatch(category.link?.
|
|
30
|
+
const isActive = useMatch(category.link?.path ?? "");
|
|
31
31
|
|
|
32
32
|
useEffect(() => {
|
|
33
|
-
// this is triggered when an item from the
|
|
34
|
-
// and the
|
|
33
|
+
// this is triggered when an item from the navigation is clicked
|
|
34
|
+
// and the navigation, enclosing this item, is not opened
|
|
35
35
|
if (isCategoryOpen) {
|
|
36
36
|
setOpen(true);
|
|
37
37
|
}
|
|
@@ -85,7 +85,7 @@ const SidebarCategoryInner = ({
|
|
|
85
85
|
{category.link?.type === "doc" ? (
|
|
86
86
|
<NavLink
|
|
87
87
|
to={{
|
|
88
|
-
pathname: joinUrl(category.link.
|
|
88
|
+
pathname: joinUrl(category.link.path),
|
|
89
89
|
search: location.search,
|
|
90
90
|
}}
|
|
91
91
|
className={styles}
|
|
@@ -123,11 +123,13 @@ const SidebarCategoryInner = ({
|
|
|
123
123
|
>
|
|
124
124
|
<ul className="relative after:absolute after:-start-(--padding-nav-item) after:translate-x-[1.5px] after:top-0 after:bottom-0 after:w-px after:bg-border">
|
|
125
125
|
{category.items.map((item) => (
|
|
126
|
-
<
|
|
126
|
+
<NavigationItem
|
|
127
127
|
key={
|
|
128
|
-
|
|
129
|
-
(
|
|
130
|
-
item.
|
|
128
|
+
item.type +
|
|
129
|
+
(item.label ?? "") +
|
|
130
|
+
("path" in item ? item.path : "") +
|
|
131
|
+
("file" in item ? item.file : "") +
|
|
132
|
+
("to" in item ? item.to : "")
|
|
131
133
|
}
|
|
132
134
|
onRequestClose={onRequestClose}
|
|
133
135
|
item={item}
|
|
@@ -139,6 +141,6 @@ const SidebarCategoryInner = ({
|
|
|
139
141
|
);
|
|
140
142
|
};
|
|
141
143
|
|
|
142
|
-
export const
|
|
144
|
+
export const NavigationCategory = memo(NavigationCategoryInner, deepEqual);
|
|
143
145
|
|
|
144
|
-
|
|
146
|
+
NavigationCategory.displayName = "NavigationCategory";
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { ExternalLinkIcon } from "lucide-react";
|
|
2
|
+
import { useEffect, useRef, useState } from "react";
|
|
3
|
+
import { NavLink, useLocation } from "react-router";
|
|
4
|
+
import {
|
|
5
|
+
Tooltip,
|
|
6
|
+
TooltipArrow,
|
|
7
|
+
TooltipContent,
|
|
8
|
+
TooltipProvider,
|
|
9
|
+
TooltipTrigger,
|
|
10
|
+
} from "zudoku/ui/Tooltip.js";
|
|
11
|
+
import type { NavigationItem as NavigationItemType } from "../../../config/validators/NavigationSchema.js";
|
|
12
|
+
import { cn } from "../../util/cn.js";
|
|
13
|
+
import { joinUrl } from "../../util/joinUrl.js";
|
|
14
|
+
import { AnchorLink } from "../AnchorLink.js";
|
|
15
|
+
import { useViewportAnchor } from "../context/ViewportAnchorContext.js";
|
|
16
|
+
import { NavigationBadge } from "./NavigationBadge.js";
|
|
17
|
+
import { NavigationCategory } from "./NavigationCategory.js";
|
|
18
|
+
import { navigationListItem } from "./utils.js";
|
|
19
|
+
|
|
20
|
+
const TruncatedLabel = ({
|
|
21
|
+
label,
|
|
22
|
+
className,
|
|
23
|
+
}: {
|
|
24
|
+
label: string;
|
|
25
|
+
className?: string;
|
|
26
|
+
}) => {
|
|
27
|
+
const ref = useRef<HTMLSpanElement>(null);
|
|
28
|
+
const [isTruncated, setIsTruncated] = useState(false);
|
|
29
|
+
|
|
30
|
+
useEffect(() => {
|
|
31
|
+
if (!ref.current) return;
|
|
32
|
+
|
|
33
|
+
if (ref.current.offsetWidth < ref.current.scrollWidth) {
|
|
34
|
+
setIsTruncated(true);
|
|
35
|
+
}
|
|
36
|
+
}, []);
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
<>
|
|
40
|
+
<span
|
|
41
|
+
className={cn("truncate flex-1", className)}
|
|
42
|
+
title={label}
|
|
43
|
+
ref={ref}
|
|
44
|
+
>
|
|
45
|
+
{label}
|
|
46
|
+
</span>
|
|
47
|
+
{isTruncated && (
|
|
48
|
+
<TooltipProvider delayDuration={500}>
|
|
49
|
+
<Tooltip disableHoverableContent>
|
|
50
|
+
<TooltipTrigger className="absolute inset-0 z-10" />
|
|
51
|
+
<TooltipContent
|
|
52
|
+
className="max-w-64 rounded-lg"
|
|
53
|
+
side="bottom"
|
|
54
|
+
align="center"
|
|
55
|
+
>
|
|
56
|
+
<TooltipArrow />
|
|
57
|
+
{label}
|
|
58
|
+
</TooltipContent>
|
|
59
|
+
</Tooltip>
|
|
60
|
+
</TooltipProvider>
|
|
61
|
+
)}
|
|
62
|
+
</>
|
|
63
|
+
);
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
export const DATA_ANCHOR_ATTR = "data-anchor";
|
|
67
|
+
|
|
68
|
+
export const NavigationItem = ({
|
|
69
|
+
item,
|
|
70
|
+
onRequestClose,
|
|
71
|
+
}: {
|
|
72
|
+
item: NavigationItemType;
|
|
73
|
+
onRequestClose?: () => void;
|
|
74
|
+
}) => {
|
|
75
|
+
const location = useLocation();
|
|
76
|
+
const { activeAnchor } = useViewportAnchor();
|
|
77
|
+
|
|
78
|
+
switch (item.type) {
|
|
79
|
+
case "category":
|
|
80
|
+
return (
|
|
81
|
+
<NavigationCategory category={item} onRequestClose={onRequestClose} />
|
|
82
|
+
);
|
|
83
|
+
case "doc":
|
|
84
|
+
return (
|
|
85
|
+
<NavLink
|
|
86
|
+
viewTransition
|
|
87
|
+
className={({ isActive, isPending }) =>
|
|
88
|
+
navigationListItem({ isActive, isPending })
|
|
89
|
+
}
|
|
90
|
+
to={joinUrl(item.path)}
|
|
91
|
+
onClick={onRequestClose}
|
|
92
|
+
end
|
|
93
|
+
>
|
|
94
|
+
{item.icon && <item.icon size={16} className="align-[-0.125em]" />}
|
|
95
|
+
{item.badge ? (
|
|
96
|
+
<>
|
|
97
|
+
{item.label && (
|
|
98
|
+
<TruncatedLabel label={item.label} className="flex-1" />
|
|
99
|
+
)}
|
|
100
|
+
<NavigationBadge {...item.badge} />
|
|
101
|
+
</>
|
|
102
|
+
) : (
|
|
103
|
+
item.label
|
|
104
|
+
)}
|
|
105
|
+
</NavLink>
|
|
106
|
+
);
|
|
107
|
+
case "link":
|
|
108
|
+
case "custom-page": {
|
|
109
|
+
const href = item.type === "link" ? item.to : item.path;
|
|
110
|
+
return !href.startsWith("http") ? (
|
|
111
|
+
<AnchorLink
|
|
112
|
+
to={{
|
|
113
|
+
pathname: href.split("#")[0],
|
|
114
|
+
hash: href.split("#")[1],
|
|
115
|
+
search: location.search,
|
|
116
|
+
}}
|
|
117
|
+
{...{ [DATA_ANCHOR_ATTR]: href.split("#")[1] }}
|
|
118
|
+
className={navigationListItem({
|
|
119
|
+
isActive: href === [location.pathname, activeAnchor].join("#"),
|
|
120
|
+
})}
|
|
121
|
+
onClick={onRequestClose}
|
|
122
|
+
>
|
|
123
|
+
{item.icon && <item.icon size={16} className="align-[-0.125em]" />}
|
|
124
|
+
{item.badge ? (
|
|
125
|
+
<>
|
|
126
|
+
{item.label && <TruncatedLabel label={item.label} />}
|
|
127
|
+
<NavigationBadge {...item.badge} />
|
|
128
|
+
</>
|
|
129
|
+
) : (
|
|
130
|
+
<span className="break-all">{item.label}</span>
|
|
131
|
+
)}
|
|
132
|
+
</AnchorLink>
|
|
133
|
+
) : (
|
|
134
|
+
<a
|
|
135
|
+
className={navigationListItem()}
|
|
136
|
+
href={href}
|
|
137
|
+
target="_blank"
|
|
138
|
+
rel="noopener noreferrer"
|
|
139
|
+
onClick={onRequestClose}
|
|
140
|
+
>
|
|
141
|
+
{item.icon && <item.icon size={16} className="align-[-0.125em]" />}
|
|
142
|
+
<span className="whitespace-normal">{item.label}</span>
|
|
143
|
+
{/* This prevents that the icon would be positioned in its own line if the text fills a line entirely */}
|
|
144
|
+
<span className="whitespace-nowrap">
|
|
145
|
+
<ExternalLinkIcon className="inline -translate-y-0.5" size={12} />
|
|
146
|
+
</span>
|
|
147
|
+
</a>
|
|
148
|
+
);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
};
|
|
@@ -4,7 +4,7 @@ import { scrollIntoViewIfNeeded } from "../../util/scrollIntoViewIfNeeded.js";
|
|
|
4
4
|
import { useZudoku } from "../context/ZudokuContext.js";
|
|
5
5
|
import { PoweredByZudoku } from "./PoweredByZudoku.js";
|
|
6
6
|
|
|
7
|
-
export const
|
|
7
|
+
export const NavigationWrapper = ({
|
|
8
8
|
children,
|
|
9
9
|
className,
|
|
10
10
|
}: PropsWithChildren<{
|
|
@@ -19,7 +19,10 @@ export const SidebarWrapper = ({
|
|
|
19
19
|
}, []);
|
|
20
20
|
|
|
21
21
|
return (
|
|
22
|
-
<div
|
|
22
|
+
<div
|
|
23
|
+
className="grid sticky top-(--header-height) lg:h-[calc(100vh-var(--header-height))] grid-rows-[1fr_min-content] border-r"
|
|
24
|
+
data-pagefind-ignore="all"
|
|
25
|
+
>
|
|
23
26
|
<nav
|
|
24
27
|
ref={navRef}
|
|
25
28
|
className={cn(
|
|
@@ -37,10 +40,10 @@ export const SidebarWrapper = ({
|
|
|
37
40
|
</nav>
|
|
38
41
|
|
|
39
42
|
<div className="bg-background border-t p-2 mx-5 gap-2 items-center mt-2 drop-shadow-[0_-3px_1px_rgba(0,0,0,0.015)] hidden lg:[&:has(>_:nth-child(1):last-child)]:flex">
|
|
40
|
-
{options.
|
|
43
|
+
{options.site?.showPoweredBy !== false && <PoweredByZudoku />}
|
|
41
44
|
</div>
|
|
42
45
|
</div>
|
|
43
46
|
);
|
|
44
47
|
};
|
|
45
48
|
|
|
46
|
-
|
|
49
|
+
NavigationWrapper.displayName = "NavigationWrapper";
|
|
@@ -1,37 +1,38 @@
|
|
|
1
|
+
import { cva } from "class-variance-authority";
|
|
1
2
|
import { useLocation } from "react-router";
|
|
2
3
|
import type {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
} from "../../../config/validators/
|
|
6
|
-
import {
|
|
4
|
+
NavigationCategory,
|
|
5
|
+
NavigationItem,
|
|
6
|
+
} from "../../../config/validators/NavigationSchema.js";
|
|
7
|
+
import { joinUrl } from "../../util/joinUrl.js";
|
|
7
8
|
import { useCurrentNavigation } from "../context/ZudokuContext.js";
|
|
8
9
|
|
|
9
10
|
export type TraverseCallback<T> = (
|
|
10
|
-
item:
|
|
11
|
-
parentCategories:
|
|
11
|
+
item: NavigationItem,
|
|
12
|
+
parentCategories: NavigationItem[],
|
|
12
13
|
) => T | void;
|
|
13
14
|
|
|
14
|
-
export const
|
|
15
|
-
|
|
15
|
+
export const traverseNavigation = <T>(
|
|
16
|
+
navigation: NavigationItem[],
|
|
16
17
|
callback: TraverseCallback<T>,
|
|
17
18
|
): T | undefined => {
|
|
18
|
-
for (const item of
|
|
19
|
-
const result =
|
|
19
|
+
for (const item of navigation) {
|
|
20
|
+
const result = traverseNavigationItem(item, callback);
|
|
20
21
|
if (result !== undefined) return result;
|
|
21
22
|
}
|
|
22
23
|
};
|
|
23
24
|
|
|
24
|
-
export const
|
|
25
|
-
item:
|
|
25
|
+
export const traverseNavigationItem = <T>(
|
|
26
|
+
item: NavigationItem,
|
|
26
27
|
callback: TraverseCallback<T>,
|
|
27
|
-
parentCategories:
|
|
28
|
+
parentCategories: NavigationItem[] = [],
|
|
28
29
|
): T | undefined => {
|
|
29
30
|
const result = callback(item, parentCategories);
|
|
30
31
|
if (result !== undefined) return result;
|
|
31
32
|
|
|
32
33
|
if (item.type === "category") {
|
|
33
34
|
for (const child of item.items) {
|
|
34
|
-
const childResult =
|
|
35
|
+
const childResult = traverseNavigationItem(child, callback, [
|
|
35
36
|
...parentCategories,
|
|
36
37
|
item,
|
|
37
38
|
]);
|
|
@@ -42,30 +43,28 @@ export const traverseSidebarItem = <T>(
|
|
|
42
43
|
|
|
43
44
|
export const useCurrentItem = () => {
|
|
44
45
|
const location = useLocation();
|
|
45
|
-
const
|
|
46
|
+
const { navigation } = useCurrentNavigation();
|
|
46
47
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
return traverseSidebar(currentSidebar, (item) => {
|
|
50
|
-
if (item.type === "doc" && joinPath(item.id) === location.pathname) {
|
|
48
|
+
return traverseNavigation(navigation, (item) => {
|
|
49
|
+
if (item.type === "doc" && joinUrl(item.path) === location.pathname) {
|
|
51
50
|
return item;
|
|
52
51
|
}
|
|
53
52
|
});
|
|
54
53
|
};
|
|
55
54
|
|
|
56
|
-
export const useIsCategoryOpen = (category:
|
|
55
|
+
export const useIsCategoryOpen = (category: NavigationCategory) => {
|
|
57
56
|
const location = useLocation();
|
|
58
57
|
|
|
59
|
-
return
|
|
58
|
+
return traverseNavigationItem(category, (item) => {
|
|
60
59
|
if (item.type === "category" && item.link) {
|
|
61
|
-
const categoryLinkPath =
|
|
60
|
+
const categoryLinkPath = joinUrl(item.link.path);
|
|
62
61
|
if (categoryLinkPath === location.pathname) {
|
|
63
62
|
return true;
|
|
64
63
|
}
|
|
65
64
|
}
|
|
66
65
|
|
|
67
66
|
if (item.type === "doc") {
|
|
68
|
-
const docPath =
|
|
67
|
+
const docPath = joinUrl(item.path);
|
|
69
68
|
if (docPath === location.pathname) {
|
|
70
69
|
return true;
|
|
71
70
|
}
|
|
@@ -78,20 +77,19 @@ export const usePrevNext = (): {
|
|
|
78
77
|
next?: { label: string; id: string };
|
|
79
78
|
} => {
|
|
80
79
|
const currentId = useLocation().pathname;
|
|
81
|
-
const
|
|
82
|
-
const currentSidebar = nav.sidebar;
|
|
80
|
+
const { navigation } = useCurrentNavigation();
|
|
83
81
|
|
|
84
82
|
let prev;
|
|
85
83
|
let next;
|
|
86
84
|
|
|
87
85
|
let foundCurrent = false;
|
|
88
86
|
|
|
89
|
-
|
|
87
|
+
traverseNavigation(navigation, (item) => {
|
|
90
88
|
const itemId =
|
|
91
89
|
item.type === "doc"
|
|
92
|
-
?
|
|
90
|
+
? joinUrl(item.path)
|
|
93
91
|
: item.type === "category" && item.link
|
|
94
|
-
?
|
|
92
|
+
? joinUrl(item.link.path)
|
|
95
93
|
: undefined;
|
|
96
94
|
|
|
97
95
|
if (!itemId) return;
|
|
@@ -111,10 +109,35 @@ export const usePrevNext = (): {
|
|
|
111
109
|
return { prev, next };
|
|
112
110
|
};
|
|
113
111
|
|
|
112
|
+
export const navigationListItem = cva(
|
|
113
|
+
"relative flex items-center gap-2 px-(--padding-nav-item) my-0.5 py-1.5 rounded-lg hover:bg-accent tabular-nums",
|
|
114
|
+
{
|
|
115
|
+
variants: {
|
|
116
|
+
isActive: {
|
|
117
|
+
true: "bg-accent font-medium",
|
|
118
|
+
false: "text-foreground/80",
|
|
119
|
+
},
|
|
120
|
+
isMuted: {
|
|
121
|
+
true: "text-foreground/30",
|
|
122
|
+
false: "",
|
|
123
|
+
},
|
|
124
|
+
isPending: {
|
|
125
|
+
true: "bg-accent animate-pulse",
|
|
126
|
+
false: "",
|
|
127
|
+
},
|
|
128
|
+
},
|
|
129
|
+
defaultVariants: {
|
|
130
|
+
isActive: false,
|
|
131
|
+
},
|
|
132
|
+
},
|
|
133
|
+
);
|
|
134
|
+
|
|
114
135
|
export const isHiddenItem =
|
|
115
136
|
(isAuthenticated?: boolean) =>
|
|
116
|
-
(item:
|
|
137
|
+
(item: NavigationItem): boolean => {
|
|
117
138
|
if (item.display === "hide") return false;
|
|
139
|
+
if (!item.label) return false;
|
|
140
|
+
|
|
118
141
|
return (
|
|
119
142
|
(item.display === "auth" && isAuthenticated) ||
|
|
120
143
|
(item.display === "anon" && !isAuthenticated) ||
|
|
@@ -3,17 +3,14 @@ import { createNanoEvents } from "nanoevents";
|
|
|
3
3
|
import type { ReactNode } from "react";
|
|
4
4
|
import type { Location } from "react-router";
|
|
5
5
|
import type { BundledTheme, HighlighterCore } from "shiki";
|
|
6
|
-
import type { z } from "zod";
|
|
7
|
-
import type {
|
|
8
|
-
import type {
|
|
9
|
-
FooterSchema,
|
|
10
|
-
TopNavigationItem,
|
|
11
|
-
} from "../../config/validators/validate.js";
|
|
6
|
+
import type { z } from "zod/v4";
|
|
7
|
+
import type { Navigation } from "../../config/validators/NavigationSchema.js";
|
|
8
|
+
import type { FooterSchema } from "../../config/validators/validate.js";
|
|
12
9
|
import type { AuthenticationPlugin } from "../authentication/authentication.js";
|
|
13
10
|
import { type AuthState, useAuthState } from "../authentication/state.js";
|
|
14
11
|
import type { ComponentsContextType } from "../components/context/ComponentsContext.js";
|
|
15
12
|
import type { SlotType } from "../components/context/SlotProvider.js";
|
|
16
|
-
import {
|
|
13
|
+
import { joinUrl } from "../util/joinUrl.js";
|
|
17
14
|
import type { MdxComponentsType } from "../util/MdxComponents.js";
|
|
18
15
|
import { objectEntries } from "../util/objectEntries.js";
|
|
19
16
|
import {
|
|
@@ -21,8 +18,10 @@ import {
|
|
|
21
18
|
isAuthenticationPlugin,
|
|
22
19
|
isEventConsumerPlugin,
|
|
23
20
|
isNavigationPlugin,
|
|
21
|
+
isProfileMenuPlugin,
|
|
24
22
|
type NavigationPlugin,
|
|
25
23
|
needsInitialization,
|
|
24
|
+
type ProfileNavigationItem,
|
|
26
25
|
type ZudokuPlugin,
|
|
27
26
|
} from "./plugins.js";
|
|
28
27
|
|
|
@@ -57,10 +56,10 @@ type Metadata = Partial<{
|
|
|
57
56
|
publisher: string;
|
|
58
57
|
}>;
|
|
59
58
|
|
|
60
|
-
type
|
|
59
|
+
type Site = Partial<{
|
|
61
60
|
dir?: "ltr" | "rtl";
|
|
62
61
|
showPoweredBy?: boolean;
|
|
63
|
-
|
|
62
|
+
title?: string;
|
|
64
63
|
logo?: {
|
|
65
64
|
src: {
|
|
66
65
|
light: string;
|
|
@@ -68,6 +67,7 @@ type Page = Partial<{
|
|
|
68
67
|
};
|
|
69
68
|
width?: string | number;
|
|
70
69
|
alt?: string;
|
|
70
|
+
href?: string;
|
|
71
71
|
};
|
|
72
72
|
banner?: {
|
|
73
73
|
message: ReactNode;
|
|
@@ -81,10 +81,9 @@ export type ZudokuContextOptions = {
|
|
|
81
81
|
basePath?: string;
|
|
82
82
|
canonicalUrlOrigin?: string;
|
|
83
83
|
metadata?: Metadata;
|
|
84
|
-
|
|
84
|
+
site?: Site;
|
|
85
85
|
authentication?: AuthenticationPlugin;
|
|
86
|
-
|
|
87
|
-
sidebars?: SidebarConfig;
|
|
86
|
+
navigation?: Navigation;
|
|
88
87
|
plugins?: ZudokuPlugin[];
|
|
89
88
|
slots?: Record<string, SlotType>;
|
|
90
89
|
/**
|
|
@@ -104,10 +103,9 @@ export type ZudokuContextOptions = {
|
|
|
104
103
|
|
|
105
104
|
export class ZudokuContext {
|
|
106
105
|
public plugins: NonNullable<ZudokuContextOptions["plugins"]>;
|
|
107
|
-
public
|
|
108
|
-
public topNavigation: NonNullable<ZudokuContextOptions["topNavigation"]>;
|
|
106
|
+
public navigation: Navigation;
|
|
109
107
|
public meta: ZudokuContextOptions["metadata"];
|
|
110
|
-
public
|
|
108
|
+
public site: ZudokuContextOptions["site"];
|
|
111
109
|
public readonly authentication?: ZudokuContextOptions["authentication"];
|
|
112
110
|
public readonly queryClient: QueryClient;
|
|
113
111
|
public readonly options: ZudokuContextOptions;
|
|
@@ -124,12 +122,11 @@ export class ZudokuContext {
|
|
|
124
122
|
this.queryClient = queryClient;
|
|
125
123
|
this.options = { ...options, protectedRoutes };
|
|
126
124
|
this.plugins = options.plugins ?? [];
|
|
127
|
-
this.
|
|
128
|
-
this.sidebars = options.sidebars ?? {};
|
|
125
|
+
this.navigation = options.navigation ?? [];
|
|
129
126
|
this.navigationPlugins = this.plugins.filter(isNavigationPlugin);
|
|
130
127
|
this.authentication = this.plugins.find(isAuthenticationPlugin);
|
|
131
128
|
this.meta = options.metadata;
|
|
132
|
-
this.
|
|
129
|
+
this.site = options.site;
|
|
133
130
|
this.plugins.forEach((plugin) => {
|
|
134
131
|
if (!isEventConsumerPlugin(plugin)) return;
|
|
135
132
|
|
|
@@ -178,16 +175,26 @@ export class ZudokuContext {
|
|
|
178
175
|
return this.emitter.emit(event, ...data);
|
|
179
176
|
};
|
|
180
177
|
|
|
181
|
-
|
|
178
|
+
getPluginNavigation = async (path: string) => {
|
|
182
179
|
const navigations = await Promise.all(
|
|
183
180
|
this.navigationPlugins.map((plugin) =>
|
|
184
|
-
plugin.
|
|
181
|
+
plugin.getNavigation?.(joinUrl(path), this),
|
|
185
182
|
),
|
|
186
183
|
);
|
|
187
184
|
|
|
188
185
|
return navigations.flatMap((nav) => nav ?? []);
|
|
189
186
|
};
|
|
190
187
|
|
|
188
|
+
getProfileMenuItems = () => {
|
|
189
|
+
const accountItems = this.plugins
|
|
190
|
+
.filter((p) => isProfileMenuPlugin(p))
|
|
191
|
+
.flatMap((p) => p.getProfileMenuItems(this))
|
|
192
|
+
.sort(sortByCategory(["top", "middle", "bottom"]))
|
|
193
|
+
.sort((i) => i.weight ?? 0);
|
|
194
|
+
|
|
195
|
+
return accountItems;
|
|
196
|
+
};
|
|
197
|
+
|
|
191
198
|
signRequest = async (request: Request) => {
|
|
192
199
|
if (!this.authentication) {
|
|
193
200
|
throw new Error("No authentication provider configured");
|
|
@@ -196,3 +203,12 @@ export class ZudokuContext {
|
|
|
196
203
|
return await this.authentication.signRequest(request);
|
|
197
204
|
};
|
|
198
205
|
}
|
|
206
|
+
|
|
207
|
+
const sortByCategory =
|
|
208
|
+
(categories: string[]) =>
|
|
209
|
+
(a: ProfileNavigationItem, b: ProfileNavigationItem) => {
|
|
210
|
+
const aIndex = categories.indexOf(a.category ?? "middle");
|
|
211
|
+
const bIndex = categories.indexOf(b.category ?? "middle");
|
|
212
|
+
|
|
213
|
+
return aIndex - bIndex;
|
|
214
|
+
};
|
package/src/lib/core/plugins.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { LucideIcon } from "lucide-react";
|
|
2
2
|
import type { ReactElement } from "react";
|
|
3
3
|
import type { Location, RouteObject } from "react-router";
|
|
4
|
-
import type {
|
|
4
|
+
import type { Navigation } from "../../config/validators/NavigationSchema.js";
|
|
5
5
|
import type { AuthenticationPlugin } from "../authentication/authentication.js";
|
|
6
6
|
import type { MdxComponentsType } from "../util/MdxComponents.js";
|
|
7
7
|
import type {
|
|
@@ -23,7 +23,7 @@ export type { AuthenticationPlugin, RouteObject };
|
|
|
23
23
|
|
|
24
24
|
export interface NavigationPlugin {
|
|
25
25
|
getRoutes: () => RouteObject[];
|
|
26
|
-
|
|
26
|
+
getNavigation?: (path: string, context: ZudokuContext) => Promise<Navigation>;
|
|
27
27
|
getProtectedRoutes?: () => string[];
|
|
28
28
|
}
|
|
29
29
|
|
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
import { SyntaxHighlight } from "zudoku/ui/SyntaxHighlight.js";
|
|
3
3
|
import { DeveloperHint } from "../components/DeveloperHint.js";
|
|
4
4
|
import { Heading } from "../components/Heading.js";
|
|
5
|
-
import {
|
|
6
|
-
import { cn } from "../util/cn.js";
|
|
5
|
+
import { Typography } from "../components/Typography.js";
|
|
7
6
|
import { ZudokuError } from "../util/invariant.js";
|
|
8
7
|
|
|
9
8
|
export function ErrorAlert({ error }: { error: unknown }) {
|
|
@@ -19,12 +18,7 @@ export function ErrorAlert({ error }: { error: unknown }) {
|
|
|
19
18
|
const stringError = cause instanceof Error ? String(cause.stack) : stack;
|
|
20
19
|
|
|
21
20
|
return (
|
|
22
|
-
<
|
|
23
|
-
className={cn(
|
|
24
|
-
ProseClasses,
|
|
25
|
-
"grid grid-cols-1 !max-w-none pt-(--padding-content-top)",
|
|
26
|
-
)}
|
|
27
|
-
>
|
|
21
|
+
<Typography className="grid grid-cols-1 !max-w-none pt-(--padding-content-top)">
|
|
28
22
|
<Heading level={1}>{title}</Heading>
|
|
29
23
|
Error: {message}
|
|
30
24
|
{hint && <DeveloperHint className="mb-4">{hint}</DeveloperHint>}
|
|
@@ -37,6 +31,6 @@ export function ErrorAlert({ error }: { error: unknown }) {
|
|
|
37
31
|
/>
|
|
38
32
|
</div>
|
|
39
33
|
)}
|
|
40
|
-
</
|
|
34
|
+
</Typography>
|
|
41
35
|
);
|
|
42
36
|
}
|
package/src/lib/hooks/index.ts
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
|
+
import { useMDXComponents as useMDXComponentsImport } from "@mdx-js/react";
|
|
1
2
|
import { useTheme as useThemeImport } from "next-themes";
|
|
3
|
+
import { useAuth as useAuthImport } from "../authentication/hook.js";
|
|
4
|
+
import { CACHE_KEYS, useCache as useCacheImport } from "../components/cache.js";
|
|
5
|
+
import { useZudoku as useZudokuImport } from "../components/context/ZudokuContext.js";
|
|
6
|
+
import { useExposedProps as useExposedPropsImport } from "../util/useExposedProps.js";
|
|
2
7
|
import { useEvent as useEventImport } from "./useEvent.js";
|
|
3
8
|
|
|
4
9
|
export const useEvent = /*@__PURE__*/ useEventImport;
|
|
5
10
|
export const useTheme = /*@__PURE__*/ useThemeImport;
|
|
11
|
+
export const useExposedProps = /*@__PURE__*/ useExposedPropsImport;
|
|
12
|
+
export const useMDXComponents = /*@__PURE__*/ useMDXComponentsImport;
|
|
13
|
+
export const useAuth = /*@__PURE__*/ useAuthImport;
|
|
14
|
+
export const useZudoku = /*@__PURE__*/ useZudokuImport;
|
|
15
|
+
export const useCache = /*@__PURE__*/ useCacheImport;
|
|
16
|
+
export { CACHE_KEYS };
|
|
@@ -116,11 +116,13 @@ describe("useEvent", () => {
|
|
|
116
116
|
describe("types", () => {
|
|
117
117
|
const { wrapper } = createTestContext();
|
|
118
118
|
|
|
119
|
-
it("infers event type when no callback is provided", () => {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
119
|
+
it("infers event type when no callback is provided", async () => {
|
|
120
|
+
await act(async () => {
|
|
121
|
+
const hook = renderHook(() => useEvent("location"), { wrapper });
|
|
122
|
+
assertType<Parameters<ZudokuEvents["location"]> | undefined>(
|
|
123
|
+
hook.result.current,
|
|
124
|
+
);
|
|
125
|
+
});
|
|
124
126
|
});
|
|
125
127
|
|
|
126
128
|
it("infers string type from pathname callback", () => {
|