zudoku 0.0.0-f90a252 → 0.0.0-f9211eb
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 +1 -1
- package/cli.js +3 -0
- package/dist/app/entry.client.d.ts +5 -0
- package/dist/app/entry.client.js +1 -0
- package/dist/app/entry.client.js.map +1 -1
- package/dist/app/entry.server.d.ts +8 -6
- package/dist/app/entry.server.js +12 -8
- package/dist/app/entry.server.js.map +1 -1
- package/dist/app/main.js +3 -1
- package/dist/app/main.js.map +1 -1
- package/dist/app/tailwind.js +20 -0
- package/dist/app/tailwind.js.map +1 -1
- package/dist/cli/build/handler.d.ts +1 -3
- package/dist/cli/build/handler.js +9 -1
- package/dist/cli/build/handler.js.map +1 -1
- package/dist/cli/cli.js +5 -0
- package/dist/cli/cli.js.map +1 -1
- package/dist/cli/cmds/build.d.ts +11 -3
- package/dist/cli/cmds/build.js +20 -13
- package/dist/cli/cmds/build.js.map +1 -1
- package/dist/cli/cmds/dev.d.ts +1 -1
- package/dist/cli/cmds/dev.js.map +1 -1
- package/dist/cli/cmds/preview.d.ts +16 -0
- package/dist/cli/cmds/preview.js +25 -0
- package/dist/cli/cmds/preview.js.map +1 -0
- package/dist/cli/dev/handler.js +2 -1
- package/dist/cli/dev/handler.js.map +1 -1
- package/dist/cli/preview/handler.d.ts +3 -0
- package/dist/cli/preview/handler.js +35 -0
- package/dist/cli/preview/handler.js.map +1 -0
- package/dist/config/common.d.ts +5 -3
- package/dist/config/config.d.ts +15 -15
- package/dist/config/loader.d.ts +6 -6
- package/dist/config/loader.js +20 -28
- package/dist/config/loader.js.map +1 -1
- package/dist/config/validators/InputSidebarSchema.d.ts +15 -15
- package/dist/config/validators/InputSidebarSchema.js +10 -1
- package/dist/config/validators/InputSidebarSchema.js.map +1 -1
- package/dist/config/validators/common.d.ts +2993 -599
- package/dist/config/validators/common.js +107 -12
- package/dist/config/validators/common.js.map +1 -1
- package/dist/config/validators/icon-types.d.ts +1 -1
- package/dist/config/validators/validate.d.ts +1127 -284
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/authentication/authentication.d.ts +1 -0
- package/dist/lib/authentication/hook.d.ts +1 -0
- package/dist/lib/authentication/hook.js +11 -1
- package/dist/lib/authentication/hook.js.map +1 -1
- package/dist/lib/authentication/providers/auth0.d.ts +2 -2
- package/dist/lib/authentication/providers/auth0.js +1 -0
- package/dist/lib/authentication/providers/auth0.js.map +1 -1
- package/dist/lib/authentication/providers/clerk.d.ts +2 -2
- package/dist/lib/authentication/providers/clerk.js +25 -6
- package/dist/lib/authentication/providers/clerk.js.map +1 -1
- package/dist/lib/authentication/providers/openid.d.ts +5 -3
- package/dist/lib/authentication/providers/openid.js +24 -10
- package/dist/lib/authentication/providers/openid.js.map +1 -1
- package/dist/lib/authentication/providers/supabase.d.ts +4 -0
- package/dist/lib/authentication/providers/supabase.js +117 -0
- package/dist/lib/authentication/providers/supabase.js.map +1 -0
- package/dist/lib/authentication/state.d.ts +0 -26
- package/dist/lib/authentication/state.js +9 -18
- package/dist/lib/authentication/state.js.map +1 -1
- package/dist/lib/components/AnchorLink.d.ts +2 -2
- package/dist/lib/components/AnchorLink.js +5 -4
- package/dist/lib/components/AnchorLink.js.map +1 -1
- package/dist/lib/components/Banner.js +1 -1
- package/dist/lib/components/Banner.js.map +1 -1
- package/dist/lib/components/Bootstrap.d.ts +2 -1
- package/dist/lib/components/Bootstrap.js +3 -2
- package/dist/lib/components/Bootstrap.js.map +1 -1
- package/dist/lib/components/Footer.d.ts +1 -0
- package/dist/lib/components/Footer.js +32 -0
- package/dist/lib/components/Footer.js.map +1 -0
- package/dist/lib/components/Header.js +4 -4
- package/dist/lib/components/Header.js.map +1 -1
- package/dist/lib/components/Heading.d.ts +2 -2
- package/dist/lib/components/InlineCode.d.ts +2 -1
- package/dist/lib/components/InlineCode.js +2 -9
- package/dist/lib/components/InlineCode.js.map +1 -1
- package/dist/lib/components/Layout.js +8 -29
- package/dist/lib/components/Layout.js.map +1 -1
- package/dist/lib/components/Main.d.ts +2 -0
- package/dist/lib/components/Main.js +17 -0
- package/dist/lib/components/Main.js.map +1 -0
- package/dist/lib/components/MobileTopNavigation.js +6 -3
- package/dist/lib/components/MobileTopNavigation.js.map +1 -1
- package/dist/lib/components/Pagination.d.ts +11 -0
- package/dist/lib/components/Pagination.js +10 -0
- package/dist/lib/components/Pagination.js.map +1 -0
- package/dist/lib/components/ThemeSwitch.js +1 -1
- package/dist/lib/components/ThemeSwitch.js.map +1 -1
- package/dist/lib/components/TopNavigation.d.ts +3 -2
- package/dist/lib/components/TopNavigation.js +28 -14
- package/dist/lib/components/TopNavigation.js.map +1 -1
- package/dist/lib/components/Zudoku.d.ts +1 -1
- package/dist/lib/components/Zudoku.js +15 -8
- package/dist/lib/components/Zudoku.js.map +1 -1
- package/dist/lib/components/cache.d.ts +7 -0
- package/dist/lib/components/cache.js +7 -0
- package/dist/lib/components/cache.js.map +1 -1
- package/dist/lib/components/context/BypassProtectedRoutesContext.d.ts +1 -0
- package/dist/lib/components/context/BypassProtectedRoutesContext.js +3 -0
- package/dist/lib/components/context/BypassProtectedRoutesContext.js.map +1 -0
- package/dist/lib/components/context/RouterEventsEmitter.d.ts +1 -0
- package/dist/lib/components/context/RouterEventsEmitter.js +17 -0
- package/dist/lib/components/context/RouterEventsEmitter.js.map +1 -0
- package/dist/lib/components/context/ViewportAnchorContext.d.ts +2 -4
- package/dist/lib/components/context/ViewportAnchorContext.js +5 -10
- package/dist/lib/components/context/ViewportAnchorContext.js.map +1 -1
- package/dist/lib/components/context/ZudokuContext.d.ts +2 -2
- package/dist/lib/components/context/ZudokuContext.js +13 -7
- package/dist/lib/components/context/ZudokuContext.js.map +1 -1
- package/dist/lib/components/index.d.ts +7 -3
- package/dist/lib/components/index.js +2 -0
- package/dist/lib/components/index.js.map +1 -1
- package/dist/lib/components/navigation/PoweredByZudoku.d.ts +3 -0
- package/dist/lib/components/navigation/PoweredByZudoku.js +6 -0
- package/dist/lib/components/navigation/PoweredByZudoku.js.map +1 -0
- package/dist/lib/components/navigation/Sidebar.d.ts +3 -1
- package/dist/lib/components/navigation/Sidebar.js +1 -12
- package/dist/lib/components/navigation/Sidebar.js.map +1 -1
- package/dist/lib/components/navigation/SidebarBadge.d.ts +2 -0
- package/dist/lib/components/navigation/SidebarBadge.js +3 -1
- package/dist/lib/components/navigation/SidebarBadge.js.map +1 -1
- package/dist/lib/components/navigation/SidebarCategory.d.ts +2 -2
- package/dist/lib/components/navigation/SidebarCategory.js +10 -6
- package/dist/lib/components/navigation/SidebarCategory.js.map +1 -1
- package/dist/lib/components/navigation/SidebarItem.d.ts +1 -0
- package/dist/lib/components/navigation/SidebarItem.js +17 -11
- package/dist/lib/components/navigation/SidebarItem.js.map +1 -1
- package/dist/lib/components/navigation/SidebarWrapper.d.ts +7 -6
- package/dist/lib/components/navigation/SidebarWrapper.js +18 -3
- package/dist/lib/components/navigation/SidebarWrapper.js.map +1 -1
- package/dist/lib/{plugins/markdown → components/navigation}/Toc.js +5 -7
- package/dist/lib/components/navigation/Toc.js.map +1 -0
- package/dist/lib/components/navigation/ZudokuLogo.d.ts +6 -0
- package/dist/lib/components/navigation/ZudokuLogo.js +5 -0
- package/dist/lib/components/navigation/ZudokuLogo.js.map +1 -0
- package/dist/lib/core/RouteGuard.d.ts +2 -1
- package/dist/lib/core/RouteGuard.js +31 -11
- package/dist/lib/core/RouteGuard.js.map +1 -1
- package/dist/lib/core/ZudokuContext.d.ts +32 -6
- package/dist/lib/core/ZudokuContext.js +29 -6
- package/dist/lib/core/ZudokuContext.js.map +1 -1
- package/dist/lib/core/plugins.d.ts +15 -7
- package/dist/lib/core/plugins.js +1 -0
- package/dist/lib/core/plugins.js.map +1 -1
- package/dist/lib/errors/ErrorAlert.js +6 -1
- package/dist/lib/errors/ErrorAlert.js.map +1 -1
- package/dist/lib/hooks/index.d.ts +3 -0
- package/dist/lib/hooks/index.js +5 -0
- package/dist/lib/hooks/index.js.map +1 -0
- package/dist/lib/hooks/useEvent.d.ts +11 -0
- package/dist/lib/hooks/useEvent.js +19 -0
- package/dist/lib/hooks/useEvent.js.map +1 -0
- package/dist/lib/hooks/useEvent.test.js +100 -0
- package/dist/lib/hooks/useEvent.test.js.map +1 -0
- package/dist/lib/oas/graphql/index.d.ts +17 -4
- package/dist/lib/oas/graphql/index.js +151 -39
- package/dist/lib/oas/graphql/index.js.map +1 -1
- package/dist/lib/oas/parser/dereference/index.js +2 -0
- package/dist/lib/oas/parser/dereference/index.js.map +1 -1
- package/dist/lib/oas/parser/index.d.ts +5 -3
- package/dist/lib/oas/parser/index.js +0 -22
- package/dist/lib/oas/parser/index.js.map +1 -1
- package/dist/lib/plugins/api-catalog/Catalog.d.ts +4 -2
- package/dist/lib/plugins/api-catalog/Catalog.js +16 -26
- package/dist/lib/plugins/api-catalog/Catalog.js.map +1 -1
- package/dist/lib/plugins/api-catalog/index.d.ts +1 -0
- package/dist/lib/plugins/api-catalog/index.js +39 -8
- package/dist/lib/plugins/api-catalog/index.js.map +1 -1
- package/dist/lib/plugins/api-keys/CreateApiKey.js +7 -3
- package/dist/lib/plugins/api-keys/CreateApiKey.js.map +1 -1
- package/dist/lib/plugins/markdown/MdxPage.d.ts +1 -1
- package/dist/lib/plugins/markdown/MdxPage.js +3 -9
- package/dist/lib/plugins/markdown/MdxPage.js.map +1 -1
- package/dist/lib/plugins/openapi/ColorizedParam.js +1 -1
- package/dist/lib/plugins/openapi/ColorizedParam.js.map +1 -1
- package/dist/lib/plugins/openapi/Endpoint.js +1 -1
- package/dist/lib/plugins/openapi/Endpoint.js.map +1 -1
- package/dist/lib/plugins/openapi/OperationList.d.ts +2 -2
- package/dist/lib/plugins/openapi/OperationList.js +63 -18
- package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
- package/dist/lib/plugins/openapi/OperationListItem.d.ts +1 -1
- package/dist/lib/plugins/openapi/OperationListItem.js +7 -12
- package/dist/lib/plugins/openapi/OperationListItem.js.map +1 -1
- package/dist/lib/plugins/openapi/ParamInfos.d.ts +6 -0
- package/dist/lib/plugins/openapi/ParamInfos.js +42 -0
- package/dist/lib/plugins/openapi/ParamInfos.js.map +1 -0
- package/dist/lib/plugins/openapi/ParameterList.d.ts +2 -1
- package/dist/lib/plugins/openapi/ParameterList.js +3 -2
- package/dist/lib/plugins/openapi/ParameterList.js.map +1 -1
- package/dist/lib/plugins/openapi/ParameterListItem.js +9 -4
- package/dist/lib/plugins/openapi/ParameterListItem.js.map +1 -1
- package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.js +3 -1
- package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.js.map +1 -1
- package/dist/lib/plugins/openapi/SchemaList.d.ts +1 -0
- package/dist/lib/plugins/openapi/SchemaList.js +52 -0
- package/dist/lib/plugins/openapi/SchemaList.js.map +1 -0
- package/dist/lib/plugins/openapi/Sidecar.js +39 -10
- package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
- package/dist/lib/plugins/openapi/SidecarExamples.js +2 -2
- package/dist/lib/plugins/openapi/SidecarExamples.js.map +1 -1
- package/dist/lib/plugins/openapi/SimpleSelect.js +1 -1
- package/dist/lib/plugins/openapi/SimpleSelect.js.map +1 -1
- package/dist/lib/plugins/openapi/client/GraphQLClient.d.ts +1 -1
- package/dist/lib/plugins/openapi/client/GraphQLClient.js +1 -1
- package/dist/lib/plugins/openapi/client/GraphQLClient.js.map +1 -1
- package/dist/lib/plugins/openapi/client/useCreateQuery.d.ts +6 -2
- package/dist/lib/plugins/openapi/client/useCreateQuery.js +6 -5
- package/dist/lib/plugins/openapi/client/useCreateQuery.js.map +1 -1
- package/dist/lib/plugins/openapi/components/EnumValues.d.ts +5 -0
- package/dist/lib/plugins/openapi/components/EnumValues.js +15 -0
- package/dist/lib/plugins/openapi/components/EnumValues.js.map +1 -0
- package/dist/lib/plugins/openapi/components/SelectOnClick.d.ts +5 -0
- package/dist/lib/plugins/openapi/components/SelectOnClick.js +16 -0
- package/dist/lib/plugins/openapi/components/SelectOnClick.js.map +1 -0
- package/dist/lib/plugins/openapi/graphql/gql.d.ts +9 -5
- package/dist/lib/plugins/openapi/graphql/gql.js +5 -15
- package/dist/lib/plugins/openapi/graphql/gql.js.map +1 -1
- package/dist/lib/plugins/openapi/graphql/graphql.d.ts +108 -55
- package/dist/lib/plugins/openapi/graphql/graphql.js +59 -34
- package/dist/lib/plugins/openapi/graphql/graphql.js.map +1 -1
- package/dist/lib/plugins/openapi/index.d.ts +6 -11
- package/dist/lib/plugins/openapi/index.js +41 -60
- package/dist/lib/plugins/openapi/index.js.map +1 -1
- package/dist/lib/plugins/openapi/interfaces.d.ts +36 -10
- package/dist/lib/plugins/openapi/playground/ExamplesDropdown.d.ts +2 -2
- package/dist/lib/plugins/openapi/playground/ExamplesDropdown.js +1 -5
- package/dist/lib/plugins/openapi/playground/ExamplesDropdown.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/Headers.js +1 -1
- package/dist/lib/plugins/openapi/playground/Headers.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/IdentityDialog.d.ts +11 -0
- package/dist/lib/plugins/openapi/playground/IdentityDialog.js +14 -0
- package/dist/lib/plugins/openapi/playground/IdentityDialog.js.map +1 -0
- package/dist/lib/plugins/openapi/playground/IdentitySelector.d.ts +7 -0
- package/dist/lib/plugins/openapi/playground/IdentitySelector.js +10 -0
- package/dist/lib/plugins/openapi/playground/IdentitySelector.js.map +1 -0
- package/dist/lib/plugins/openapi/playground/PathParams.d.ts +3 -2
- package/dist/lib/plugins/openapi/playground/PathParams.js +3 -2
- package/dist/lib/plugins/openapi/playground/PathParams.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/Playground.d.ts +13 -2
- package/dist/lib/plugins/openapi/playground/Playground.js +81 -27
- package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/QueryParams.js +1 -1
- package/dist/lib/plugins/openapi/playground/QueryParams.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/RequestLoginDialog.d.ts +7 -0
- package/dist/lib/plugins/openapi/playground/RequestLoginDialog.js +8 -0
- package/dist/lib/plugins/openapi/playground/RequestLoginDialog.js.map +1 -0
- package/dist/lib/plugins/openapi/playground/rememberedIdentity.d.ts +17 -0
- package/dist/lib/plugins/openapi/playground/rememberedIdentity.js +11 -0
- package/dist/lib/plugins/openapi/playground/rememberedIdentity.js.map +1 -0
- package/dist/lib/plugins/openapi/playground/result-panel/ResponseTab.js +20 -14
- package/dist/lib/plugins/openapi/playground/result-panel/ResponseTab.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/result-panel/ResultPanel.d.ts +6 -4
- package/dist/lib/plugins/openapi/playground/result-panel/ResultPanel.js +4 -3
- package/dist/lib/plugins/openapi/playground/result-panel/ResultPanel.js.map +1 -1
- package/dist/lib/plugins/openapi/schema/LogicalGroup/LogicalGroup.d.ts +1 -2
- package/dist/lib/plugins/openapi/schema/LogicalGroup/LogicalGroup.js +2 -2
- package/dist/lib/plugins/openapi/schema/LogicalGroup/LogicalGroup.js.map +1 -1
- package/dist/lib/plugins/openapi/schema/LogicalGroup/LogicalGroupConnector.d.ts +2 -1
- package/dist/lib/plugins/openapi/schema/LogicalGroup/LogicalGroupConnector.js +2 -2
- package/dist/lib/plugins/openapi/schema/LogicalGroup/LogicalGroupConnector.js.map +1 -1
- package/dist/lib/plugins/openapi/schema/LogicalGroup/LogicalGroupItem.d.ts +0 -1
- package/dist/lib/plugins/openapi/schema/LogicalGroup/LogicalGroupItem.js +1 -1
- package/dist/lib/plugins/openapi/schema/LogicalGroup/LogicalGroupItem.js.map +1 -1
- package/dist/lib/plugins/openapi/schema/SchemaExampleAndDefault.d.ts +4 -0
- package/dist/lib/plugins/openapi/schema/SchemaExampleAndDefault.js +12 -0
- package/dist/lib/plugins/openapi/schema/SchemaExampleAndDefault.js.map +1 -0
- package/dist/lib/plugins/openapi/schema/SchemaPropertyItem.d.ts +2 -4
- package/dist/lib/plugins/openapi/schema/SchemaPropertyItem.js +18 -13
- package/dist/lib/plugins/openapi/schema/SchemaPropertyItem.js.map +1 -1
- package/dist/lib/plugins/openapi/schema/SchemaView.d.ts +1 -2
- package/dist/lib/plugins/openapi/schema/SchemaView.js +33 -48
- package/dist/lib/plugins/openapi/schema/SchemaView.js.map +1 -1
- package/dist/lib/plugins/openapi/schema/utils.d.ts +1 -0
- package/dist/lib/plugins/openapi/schema/utils.js +3 -1
- package/dist/lib/plugins/openapi/schema/utils.js.map +1 -1
- package/dist/lib/plugins/openapi/state.d.ts +25 -0
- package/dist/lib/plugins/openapi/state.js +18 -0
- package/dist/lib/plugins/openapi/state.js.map +1 -0
- package/dist/lib/plugins/openapi/util/createSidebarCategory.js +5 -7
- package/dist/lib/plugins/openapi/util/createSidebarCategory.js.map +1 -1
- package/dist/lib/plugins/openapi/util/getRoutes.js +9 -3
- package/dist/lib/plugins/openapi/util/getRoutes.js.map +1 -1
- package/dist/lib/plugins/search-pagefind/PagefindSearch.d.ts +6 -0
- package/dist/lib/plugins/search-pagefind/PagefindSearch.js +80 -0
- package/dist/lib/plugins/search-pagefind/PagefindSearch.js.map +1 -0
- package/dist/lib/plugins/search-pagefind/ResultList.d.ts +8 -0
- package/dist/lib/plugins/search-pagefind/ResultList.js +32 -0
- package/dist/lib/plugins/search-pagefind/ResultList.js.map +1 -0
- package/dist/lib/plugins/search-pagefind/get-results.d.ts +10 -0
- package/dist/lib/plugins/search-pagefind/get-results.js +42 -0
- package/dist/lib/plugins/search-pagefind/get-results.js.map +1 -0
- package/dist/lib/plugins/search-pagefind/index.d.ts +6 -0
- package/dist/lib/plugins/search-pagefind/index.js +9 -0
- package/dist/lib/plugins/search-pagefind/index.js.map +1 -0
- package/dist/lib/plugins/search-pagefind/types.d.ts +85 -0
- package/dist/lib/plugins/search-pagefind/types.js +2 -0
- package/dist/lib/plugins/search-pagefind/types.js.map +1 -0
- package/dist/lib/ui/Badge.d.ts +1 -1
- package/dist/lib/ui/Button.d.ts +2 -2
- package/dist/lib/ui/Button.js +2 -1
- package/dist/lib/ui/Button.js.map +1 -1
- package/dist/lib/ui/Callout.d.ts +2 -1
- package/dist/lib/ui/Callout.js +3 -2
- package/dist/lib/ui/Callout.js.map +1 -1
- package/dist/lib/ui/Checkbox.d.ts +2 -8
- package/dist/lib/ui/Checkbox.js +1 -13
- package/dist/lib/ui/Checkbox.js.map +1 -1
- package/dist/lib/ui/Command.d.ts +7 -1
- package/dist/lib/ui/Command.js +2 -2
- package/dist/lib/ui/Command.js.map +1 -1
- package/dist/lib/ui/Select.js +1 -1
- package/dist/lib/ui/Select.js.map +1 -1
- package/dist/lib/ui/Stepper.d.ts +3 -0
- package/dist/lib/ui/Stepper.js +7 -0
- package/dist/lib/ui/Stepper.js.map +1 -0
- package/dist/lib/ui/SyntaxHighlight.d.ts +15 -0
- package/dist/lib/ui/SyntaxHighlight.js +62 -0
- package/dist/lib/ui/SyntaxHighlight.js.map +1 -0
- package/dist/lib/ui/util.d.ts +2 -0
- package/dist/lib/ui/util.js +3 -0
- package/dist/lib/ui/util.js.map +1 -0
- package/dist/lib/util/MdxComponents.d.ts +5 -2
- package/dist/lib/util/MdxComponents.js +6 -3
- package/dist/lib/util/MdxComponents.js.map +1 -1
- package/dist/lib/util/joinPath.d.ts +3 -0
- package/dist/lib/util/joinPath.js +3 -0
- package/dist/lib/util/joinPath.js.map +1 -1
- package/dist/lib/util/traverse.d.ts +2 -8
- package/dist/lib/util/traverse.js +2 -2
- package/dist/lib/util/traverse.js.map +1 -1
- package/dist/lib/util/types.d.ts +7 -0
- package/dist/lib/util/types.js +2 -0
- package/dist/lib/util/types.js.map +1 -0
- package/dist/lib/util/useOnScreen.d.ts +3 -2
- package/dist/lib/util/useOnScreen.js +3 -3
- package/dist/lib/util/useOnScreen.js.map +1 -1
- package/dist/lib/util/useScrollToAnchor.js +26 -20
- package/dist/lib/util/useScrollToAnchor.js.map +1 -1
- package/dist/vite/api/schema-codegen.d.ts +1 -1
- package/dist/vite/api/schema-codegen.js +31 -9
- package/dist/vite/api/schema-codegen.js.map +1 -1
- package/dist/vite/api/schema-codegen.test.js +66 -0
- package/dist/vite/api/schema-codegen.test.js.map +1 -1
- package/dist/vite/build.js +2 -0
- package/dist/vite/build.js.map +1 -1
- package/dist/vite/config.d.ts +2 -5
- package/dist/vite/config.js +39 -56
- package/dist/vite/config.js.map +1 -1
- package/dist/vite/config.test.js +1 -1
- package/dist/vite/config.test.js.map +1 -1
- package/dist/vite/create-pagefind-index.d.ts +4 -0
- package/dist/vite/create-pagefind-index.js +12 -0
- package/dist/vite/create-pagefind-index.js.map +1 -0
- package/dist/vite/css/plugin.d.ts +2 -2
- package/dist/vite/css/plugin.js.map +1 -1
- package/dist/vite/dev-server.js +12 -4
- package/dist/vite/dev-server.js.map +1 -1
- package/dist/vite/plugin-api-keys.d.ts +2 -2
- package/dist/vite/plugin-api-keys.js +3 -3
- package/dist/vite/plugin-api-keys.js.map +1 -1
- package/dist/vite/plugin-api.d.ts +2 -2
- package/dist/vite/plugin-api.js +42 -35
- package/dist/vite/plugin-api.js.map +1 -1
- package/dist/vite/plugin-auth.d.ts +2 -2
- package/dist/vite/plugin-auth.js +3 -3
- package/dist/vite/plugin-auth.js.map +1 -1
- package/dist/vite/plugin-component.d.ts +2 -2
- package/dist/vite/plugin-component.js +7 -2
- package/dist/vite/plugin-component.js.map +1 -1
- package/dist/vite/plugin-config-reload.d.ts +4 -3
- package/dist/vite/plugin-config-reload.js +13 -6
- package/dist/vite/plugin-config-reload.js.map +1 -1
- package/dist/vite/plugin-config.d.ts +2 -2
- package/dist/vite/plugin-config.js +7 -4
- package/dist/vite/plugin-config.js.map +1 -1
- package/dist/vite/plugin-custom-pages.d.ts +2 -2
- package/dist/vite/plugin-custom-pages.js +3 -3
- package/dist/vite/plugin-custom-pages.js.map +1 -1
- package/dist/vite/plugin-docs.d.ts +3 -3
- package/dist/vite/plugin-docs.js +23 -6
- package/dist/vite/plugin-docs.js.map +1 -1
- package/dist/vite/plugin-frontmatter.d.ts +2 -2
- package/dist/vite/plugin-frontmatter.js +5 -4
- package/dist/vite/plugin-frontmatter.js.map +1 -1
- package/dist/vite/plugin-mdx.d.ts +2 -2
- package/dist/vite/plugin-mdx.js +1 -1
- package/dist/vite/plugin-mdx.js.map +1 -1
- package/dist/vite/plugin-redirect.d.ts +2 -2
- package/dist/vite/plugin-redirect.js +3 -3
- package/dist/vite/plugin-redirect.js.map +1 -1
- package/dist/vite/plugin-search.d.ts +2 -2
- package/dist/vite/plugin-search.js +5 -1
- package/dist/vite/plugin-search.js.map +1 -1
- package/dist/vite/plugin-sidebar.d.ts +2 -2
- package/dist/vite/plugin-sidebar.js +2 -2
- package/dist/vite/plugin-sidebar.js.map +1 -1
- package/dist/vite/plugin-theme-css.d.ts +2 -2
- package/dist/vite/plugin-theme-css.js.map +1 -1
- package/dist/vite/plugin.d.ts +2 -2
- package/dist/vite/plugin.js.map +1 -1
- package/dist/vite/prerender/FileWritingResponse.d.ts +11 -6
- package/dist/vite/prerender/FileWritingResponse.js +9 -6
- package/dist/vite/prerender/FileWritingResponse.js.map +1 -1
- package/dist/vite/prerender/InMemoryResponse.d.ts +16 -0
- package/dist/vite/prerender/InMemoryResponse.js +32 -0
- package/dist/vite/prerender/InMemoryResponse.js.map +1 -0
- package/dist/vite/prerender/PrerenderResponse.d.ts +10 -0
- package/dist/vite/prerender/PrerenderResponse.js +2 -0
- package/dist/vite/prerender/PrerenderResponse.js.map +1 -0
- package/dist/vite/prerender/prerender.d.ts +1 -0
- package/dist/vite/prerender/prerender.js +34 -28
- package/dist/vite/prerender/prerender.js.map +1 -1
- package/dist/vite/prerender/worker.d.ts +1 -1
- package/dist/vite/prerender/worker.js +42 -12
- package/dist/vite/prerender/worker.js.map +1 -1
- package/dist/vite/sitemap.js +2 -1
- package/dist/vite/sitemap.js.map +1 -1
- package/dist/zuplo/with-zuplo.js +4 -0
- package/dist/zuplo/with-zuplo.js.map +1 -1
- package/lib/{AuthenticationPlugin-_YVa673u.js → AuthenticationPlugin-foqdvvkf.js} +4 -4
- package/lib/{AuthenticationPlugin-_YVa673u.js.map → AuthenticationPlugin-foqdvvkf.js.map} +1 -1
- package/lib/Button-Fp19CMUr.js +49 -0
- package/lib/Button-Fp19CMUr.js.map +1 -0
- package/lib/Callout-B2vsR09t.js +229 -0
- package/lib/Callout-B2vsR09t.js.map +1 -0
- package/lib/{CategoryHeading-MYL1u_6K.js → CategoryHeading-DpB47wvk.js} +3 -3
- package/lib/{CategoryHeading-MYL1u_6K.js.map → CategoryHeading-DpB47wvk.js.map} +1 -1
- package/lib/Dialog-sbgekbjb.js +98 -0
- package/lib/Dialog-sbgekbjb.js.map +1 -0
- package/lib/Drawer-kDAfOq_2.js +1133 -0
- package/lib/Drawer-kDAfOq_2.js.map +1 -0
- package/lib/{Markdown-8mv9nhGd.js → Markdown-aF5FdsNi.js} +7822 -6052
- package/lib/Markdown-aF5FdsNi.js.map +1 -0
- package/lib/MdxPage-Vw_dc9Yz.js +85 -0
- package/lib/MdxPage-Vw_dc9Yz.js.map +1 -0
- package/lib/{OasProvider-IS9wBrb7.js → OasProvider-CjXTP-nz.js} +6 -6
- package/lib/{OasProvider-IS9wBrb7.js.map → OasProvider-CjXTP-nz.js.map} +1 -1
- package/lib/OperationList-BYemrDYk.js +5068 -0
- package/lib/OperationList-BYemrDYk.js.map +1 -0
- package/lib/Pagination-SdlocK96.js +48 -0
- package/lib/Pagination-SdlocK96.js.map +1 -0
- package/lib/{index.esm-9-TF9KQB.js → RouteGuard-CqZPoZYJ.js} +196 -144
- package/lib/RouteGuard-CqZPoZYJ.js.map +1 -0
- package/lib/SchemaList-CAeKy9pV.js +148 -0
- package/lib/SchemaList-CAeKy9pV.js.map +1 -0
- package/lib/SchemaView-B3fOPR4V.js +357 -0
- package/lib/SchemaView-B3fOPR4V.js.map +1 -0
- package/lib/{Select-D9CKL33X.js → Select-DVFRKf1R.js} +71 -71
- package/lib/{Select-D9CKL33X.js.map → Select-DVFRKf1R.js.map} +1 -1
- package/lib/SlotletProvider-DXvc0aY6.js +338 -0
- package/lib/SlotletProvider-DXvc0aY6.js.map +1 -0
- package/lib/Spinner-CE68iCm0.js +7 -0
- package/lib/Spinner-CE68iCm0.js.map +1 -0
- package/lib/{SyntaxHighlight-B0L4SC_N.js → SyntaxHighlight-BEoSoPEo.js} +496 -592
- package/lib/SyntaxHighlight-BEoSoPEo.js.map +1 -0
- package/lib/Toc-YBsgI72s.js +92 -0
- package/lib/Toc-YBsgI72s.js.map +1 -0
- package/lib/{chunk-SYFQ2XB5-QijJrSf0.js → chunk-HA7DTUK3-C4gP41vD.js} +560 -560
- package/lib/chunk-HA7DTUK3-C4gP41vD.js.map +1 -0
- package/lib/{circular-DxaIIlWD.js → circular-ByJI6Mci.js} +5461 -4993
- package/lib/circular-ByJI6Mci.js.map +1 -0
- package/lib/context-DLCwaMXN.js +22 -0
- package/lib/{context-rwLGh-6_.js.map → context-DLCwaMXN.js.map} +1 -1
- package/lib/{createServer-DSQiPwjN.js → createServer-mYvGvmc0.js} +5062 -5209
- package/lib/createServer-mYvGvmc0.js.map +1 -0
- package/lib/{hook-C_t2ISLC.js → hook-CqpVYDqN.js} +495 -467
- package/lib/hook-CqpVYDqN.js.map +1 -0
- package/lib/index-Bn6Lc9tq.js +9 -0
- package/lib/index-Bn6Lc9tq.js.map +1 -0
- package/lib/index-C1OzjGUK.js +2227 -0
- package/lib/index-C1OzjGUK.js.map +1 -0
- package/lib/index-CPNSgwSb.js +36 -0
- package/lib/{index-Djenk2Hj.js.map → index-CPNSgwSb.js.map} +1 -1
- package/lib/index-D48iOQvJ.js +1973 -0
- package/lib/index-D48iOQvJ.js.map +1 -0
- package/lib/index-DwT-v3zK.js +86 -0
- package/lib/index-DwT-v3zK.js.map +1 -0
- package/lib/{index-CjJS0l4l.js → index-LNp6rxyU.js} +2 -2
- package/lib/{index-CjJS0l4l.js.map → index-LNp6rxyU.js.map} +1 -1
- package/lib/index-gQD2h1wX.js +447 -0
- package/lib/index-gQD2h1wX.js.map +1 -0
- package/lib/{index.esm-CrSoEshU.js → index.esm--gIChbWs.js} +3 -3
- package/lib/{index.esm-CrSoEshU.js.map → index.esm--gIChbWs.js.map} +1 -1
- package/lib/{jsx-runtime-Bdg6XQ1m.js → jsx-runtime-CYK1ROHF.js} +99 -99
- package/lib/{jsx-runtime-Bdg6XQ1m.js.map → jsx-runtime-CYK1ROHF.js.map} +1 -1
- package/lib/{mutation-Cm3O9f3X.js → mutation-8LjrN7uz.js} +26 -26
- package/lib/{mutation-Cm3O9f3X.js.map → mutation-8LjrN7uz.js.map} +1 -1
- package/lib/objectEntries-yMIkr2mI.js +5 -0
- package/lib/objectEntries-yMIkr2mI.js.map +1 -0
- package/lib/post-processors/removeExtensions.js +4 -4
- package/lib/post-processors/traverse.js +2 -2
- package/lib/post-processors/traverse.js.map +1 -1
- package/lib/prism-bash.min-HHIMdNJ_.js.map +1 -1
- package/lib/prism-csharp.min-bQAo2pmx.js.map +1 -1
- package/lib/prism-java.min-BpvsOuIa.js.map +1 -1
- package/lib/prism-javascript.min-CEqHqgbm.js.map +1 -1
- package/lib/prism-json.min-B1GJqK1k.js.map +1 -1
- package/lib/prism-jsstacktrace.min-BfobCF2F.js +2 -0
- package/lib/prism-jsstacktrace.min-BfobCF2F.js.map +1 -0
- package/lib/prism-markdown.min-C0Qn0m-5.js.map +1 -1
- package/lib/prism-markup-BNGj0Tvm.js.map +1 -1
- package/lib/prism-objectivec.min-BXSWqpJJ.js.map +1 -1
- package/lib/prism-ruby.min-Dx9KO9ds.js.map +1 -1
- package/lib/prism-typescript.min-CD7H2IYQ.js.map +1 -1
- package/lib/ui/Accordion.js +1 -1
- package/lib/ui/ActionButton.js +11 -10
- package/lib/ui/ActionButton.js.map +1 -1
- package/lib/ui/Alert.js +2 -2
- package/lib/ui/AlertDialog.js +1 -1
- package/lib/ui/Badge.js +2 -2
- package/lib/ui/Breadcrumb.js +4 -4
- package/lib/ui/Button.js +13 -12
- package/lib/ui/Button.js.map +1 -1
- package/lib/ui/Callout.js +39 -21
- 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 +16 -26
- package/lib/ui/Checkbox.js.map +1 -1
- package/lib/ui/Command.js +105 -78
- package/lib/ui/Command.js.map +1 -1
- package/lib/ui/Dialog.js +1 -1
- package/lib/ui/Drawer.js +14 -1151
- package/lib/ui/Drawer.js.map +1 -1
- package/lib/ui/DropdownMenu.js +1 -1
- package/lib/ui/Form.js +5 -5
- 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 +10 -10
- 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/Stepper.js +6 -0
- package/lib/ui/Stepper.js.map +1 -0
- package/lib/ui/Switch.js +1 -1
- package/lib/ui/SyntaxHighlight.js +11 -0
- package/lib/ui/SyntaxHighlight.js.map +1 -0
- 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 +1 -1
- package/lib/ui/util.js +6 -0
- package/lib/ui/util.js.map +1 -0
- package/lib/{useExposedProps-Bbf99zic.js → useExposedProps-B9qXJedG.js} +2 -2
- package/lib/{useExposedProps-Bbf99zic.js.map → useExposedProps-B9qXJedG.js.map} +1 -1
- package/lib/useLatest-hmRS46UF.js +11 -0
- package/lib/useLatest-hmRS46UF.js.map +1 -0
- package/lib/zudoku.auth-auth0.js +15 -14
- package/lib/zudoku.auth-auth0.js.map +1 -1
- package/lib/zudoku.auth-clerk.js +67 -49
- package/lib/zudoku.auth-clerk.js.map +1 -1
- package/lib/zudoku.auth-openid.js +370 -404
- package/lib/zudoku.auth-openid.js.map +1 -1
- package/lib/zudoku.components.js +32 -1334
- package/lib/zudoku.components.js.map +1 -1
- package/lib/zudoku.hooks.js +19 -0
- package/lib/zudoku.hooks.js.map +1 -0
- package/lib/zudoku.icons.js +1 -1
- package/lib/zudoku.plugin-api-catalog.js +106 -111
- package/lib/zudoku.plugin-api-catalog.js.map +1 -1
- package/lib/zudoku.plugin-api-keys.js +108 -106
- package/lib/zudoku.plugin-api-keys.js.map +1 -1
- package/lib/zudoku.plugin-custom-pages.js +3 -3
- package/lib/zudoku.plugin-markdown.js +2 -2
- package/lib/zudoku.plugin-openapi.js +6 -8
- package/lib/zudoku.plugin-openapi.js.map +1 -1
- package/lib/zudoku.plugin-redirect.js +1 -1
- package/lib/zudoku.plugin-search-inkeep.js +9 -9
- package/lib/zudoku.plugin-search-pagefind.js +233 -0
- package/lib/zudoku.plugin-search-pagefind.js.map +1 -0
- package/lib/zudoku.plugins.js +9 -8
- package/lib/zudoku.plugins.js.map +1 -1
- package/package.json +76 -56
- package/src/app/entry.client.tsx +8 -0
- package/src/app/entry.server.tsx +23 -13
- package/src/app/main.css +98 -57
- package/src/app/main.tsx +3 -1
- package/src/app/tailwind.ts +20 -0
- package/src/lib/authentication/authentication.ts +2 -0
- package/src/lib/authentication/hook.ts +12 -1
- package/src/lib/authentication/providers/auth0.tsx +3 -2
- package/src/lib/authentication/providers/clerk.tsx +32 -8
- package/src/lib/authentication/providers/openid.tsx +31 -15
- package/src/lib/authentication/providers/supabase.tsx +157 -0
- package/src/lib/authentication/state.ts +9 -37
- package/src/lib/components/AnchorLink.tsx +9 -7
- package/src/lib/components/Banner.tsx +1 -0
- package/src/lib/components/Bootstrap.tsx +13 -6
- package/src/lib/components/Footer.tsx +136 -0
- package/src/lib/components/Header.tsx +12 -8
- package/src/lib/components/Heading.tsx +1 -1
- package/src/lib/components/InlineCode.tsx +13 -16
- package/src/lib/components/Layout.tsx +22 -67
- package/src/lib/components/Main.tsx +50 -0
- package/src/lib/components/MobileTopNavigation.tsx +27 -18
- package/src/lib/components/Pagination.tsx +50 -0
- package/src/lib/components/ThemeSwitch.tsx +1 -1
- package/src/lib/components/TopNavigation.tsx +51 -24
- package/src/lib/components/Zudoku.tsx +20 -7
- package/src/lib/components/cache.ts +8 -0
- package/src/lib/components/context/BypassProtectedRoutesContext.ts +3 -0
- package/src/lib/components/context/RouterEventsEmitter.tsx +19 -0
- package/src/lib/components/context/ViewportAnchorContext.tsx +6 -15
- package/src/lib/components/context/ZudokuContext.ts +17 -8
- package/src/lib/components/index.ts +2 -0
- package/src/lib/components/navigation/PoweredByZudoku.tsx +23 -0
- package/src/lib/components/navigation/Sidebar.tsx +30 -44
- package/src/lib/components/navigation/SidebarBadge.tsx +4 -1
- package/src/lib/components/navigation/SidebarCategory.tsx +15 -12
- package/src/lib/components/navigation/SidebarItem.tsx +22 -29
- package/src/lib/components/navigation/SidebarWrapper.tsx +42 -23
- package/src/lib/{plugins/markdown → components/navigation}/Toc.tsx +5 -14
- package/src/lib/components/navigation/ZudokuLogo.tsx +25 -0
- package/src/lib/core/RouteGuard.tsx +69 -12
- package/src/lib/core/ZudokuContext.ts +63 -12
- package/src/lib/core/plugins.ts +21 -7
- package/src/lib/errors/ErrorAlert.tsx +24 -17
- package/src/lib/hooks/index.ts +5 -0
- package/src/lib/hooks/useEvent.test.tsx +149 -0
- package/src/lib/hooks/useEvent.ts +41 -0
- package/src/lib/oas/graphql/index.ts +206 -55
- package/src/lib/oas/parser/dereference/index.ts +2 -0
- package/src/lib/oas/parser/index.ts +7 -29
- package/src/lib/plugins/api-catalog/Catalog.tsx +50 -100
- package/src/lib/plugins/api-catalog/index.tsx +66 -15
- package/src/lib/plugins/api-keys/CreateApiKey.tsx +7 -3
- package/src/lib/plugins/markdown/MdxPage.tsx +15 -47
- package/src/lib/plugins/openapi/ColorizedParam.tsx +1 -1
- package/src/lib/plugins/openapi/Endpoint.tsx +1 -1
- package/src/lib/plugins/openapi/OperationList.tsx +171 -81
- package/src/lib/plugins/openapi/OperationListItem.tsx +118 -104
- package/src/lib/plugins/openapi/ParamInfos.tsx +87 -0
- package/src/lib/plugins/openapi/ParameterList.tsx +4 -0
- package/src/lib/plugins/openapi/ParameterListItem.tsx +35 -23
- package/src/lib/plugins/openapi/PlaygroundDialogWrapper.tsx +7 -0
- package/src/lib/plugins/openapi/SchemaList.tsx +151 -0
- package/src/lib/plugins/openapi/Sidecar.tsx +50 -13
- package/src/lib/plugins/openapi/SidecarExamples.tsx +1 -2
- package/src/lib/plugins/openapi/SimpleSelect.tsx +1 -1
- package/src/lib/plugins/openapi/client/GraphQLClient.tsx +1 -1
- package/src/lib/plugins/openapi/client/useCreateQuery.ts +13 -5
- package/src/lib/plugins/openapi/components/EnumValues.tsx +58 -0
- package/src/lib/plugins/openapi/components/SelectOnClick.tsx +29 -0
- package/src/lib/plugins/openapi/graphql/gql.ts +34 -17
- package/src/lib/plugins/openapi/graphql/graphql.ts +172 -86
- package/src/lib/plugins/openapi/index.tsx +55 -87
- package/src/lib/plugins/openapi/interfaces.ts +44 -15
- package/src/lib/plugins/openapi/playground/ExamplesDropdown.tsx +30 -32
- package/src/lib/plugins/openapi/playground/Headers.tsx +0 -1
- package/src/lib/plugins/openapi/playground/IdentityDialog.tsx +74 -0
- package/src/lib/plugins/openapi/playground/IdentitySelector.tsx +54 -0
- package/src/lib/plugins/openapi/playground/PathParams.tsx +8 -2
- package/src/lib/plugins/openapi/playground/Playground.tsx +176 -89
- package/src/lib/plugins/openapi/playground/QueryParams.tsx +0 -1
- package/src/lib/plugins/openapi/playground/RequestLoginDialog.tsx +51 -0
- package/src/lib/plugins/openapi/playground/rememberedIdentity.ts +26 -0
- package/src/lib/plugins/openapi/playground/result-panel/ResponseTab.tsx +25 -5
- package/src/lib/plugins/openapi/playground/result-panel/ResultPanel.tsx +67 -45
- package/src/lib/plugins/openapi/schema/LogicalGroup/LogicalGroup.tsx +1 -8
- package/src/lib/plugins/openapi/schema/LogicalGroup/LogicalGroupConnector.tsx +3 -0
- package/src/lib/plugins/openapi/schema/LogicalGroup/LogicalGroupItem.tsx +6 -3
- package/src/lib/plugins/openapi/schema/SchemaExampleAndDefault.tsx +36 -0
- package/src/lib/plugins/openapi/schema/SchemaPropertyItem.tsx +47 -50
- package/src/lib/plugins/openapi/schema/SchemaView.tsx +84 -138
- package/src/lib/plugins/openapi/schema/utils.ts +7 -1
- package/src/lib/plugins/openapi/state.ts +36 -0
- package/src/lib/plugins/openapi/util/createSidebarCategory.tsx +5 -7
- package/src/lib/plugins/openapi/util/getRoutes.tsx +9 -6
- package/src/lib/plugins/search-pagefind/PagefindSearch.tsx +164 -0
- package/src/lib/plugins/search-pagefind/ResultList.tsx +105 -0
- package/src/lib/plugins/search-pagefind/get-results.tsx +75 -0
- package/src/lib/plugins/search-pagefind/index.tsx +21 -0
- package/src/lib/plugins/search-pagefind/types.ts +118 -0
- package/src/lib/ui/Button.tsx +4 -2
- package/src/lib/ui/Callout.tsx +28 -10
- package/src/lib/ui/Checkbox.tsx +8 -24
- package/src/lib/ui/Command.tsx +25 -3
- package/src/lib/ui/Select.tsx +1 -1
- package/src/lib/ui/Stepper.tsx +8 -0
- package/src/lib/ui/SyntaxHighlight.tsx +186 -0
- package/src/lib/ui/util.tsx +3 -0
- package/src/lib/util/MdxComponents.tsx +7 -4
- package/src/lib/util/joinPath.tsx +3 -0
- package/src/lib/util/traverse.ts +4 -8
- package/src/lib/util/types.ts +7 -0
- package/src/lib/util/useOnScreen.ts +6 -4
- package/src/lib/util/useScrollToAnchor.ts +30 -20
- package/dist/lib/components/SyntaxHighlight.d.ts +0 -12
- package/dist/lib/components/SyntaxHighlight.js +0 -53
- package/dist/lib/components/SyntaxHighlight.js.map +0 -1
- package/dist/lib/components/context/PluginSystem.js +0 -2
- package/dist/lib/components/context/PluginSystem.js.map +0 -1
- package/dist/lib/plugins/markdown/Toc.js.map +0 -1
- package/lib/Markdown-8mv9nhGd.js.map +0 -1
- package/lib/MdxPage-GM1T5jmO.js +0 -193
- package/lib/MdxPage-GM1T5jmO.js.map +0 -1
- package/lib/OperationList-BTmRbbXk.js +0 -5179
- package/lib/OperationList-BTmRbbXk.js.map +0 -1
- package/lib/SlotletProvider-D0mFmGJu.js +0 -221
- package/lib/SlotletProvider-D0mFmGJu.js.map +0 -1
- package/lib/Spinner-BlzrEEk1.js +0 -51
- package/lib/Spinner-BlzrEEk1.js.map +0 -1
- package/lib/SyntaxHighlight-B0L4SC_N.js.map +0 -1
- package/lib/chunk-SYFQ2XB5-QijJrSf0.js.map +0 -1
- package/lib/circular-DxaIIlWD.js.map +0 -1
- package/lib/context-rwLGh-6_.js +0 -22
- package/lib/createServer-DSQiPwjN.js.map +0 -1
- package/lib/hook-C_t2ISLC.js.map +0 -1
- package/lib/index-B7mqiOei.js +0 -509
- package/lib/index-B7mqiOei.js.map +0 -1
- package/lib/index-BANyVRgL.js +0 -2098
- package/lib/index-BANyVRgL.js.map +0 -1
- package/lib/index-Djenk2Hj.js +0 -36
- package/lib/index.esm-9-TF9KQB.js.map +0 -1
- package/lib/joinUrl-nLx9pD-Z.js +0 -20
- package/lib/joinUrl-nLx9pD-Z.js.map +0 -1
- package/lib/useScrollToAnchor-BGEcH3HM.js +0 -286
- package/lib/useScrollToAnchor-BGEcH3HM.js.map +0 -1
- package/src/lib/components/SyntaxHighlight.tsx +0 -171
- package/src/lib/components/context/PluginSystem.ts +0 -0
- /package/dist/lib/{plugins/markdown → components/navigation}/Toc.d.ts +0 -0
- /package/dist/lib/{components/context/PluginSystem.d.ts → hooks/useEvent.test.d.ts} +0 -0
|
@@ -1,62 +1,50 @@
|
|
|
1
1
|
import { Helmet } from "@zudoku/react-helmet-async";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { useSpinDelay } from "spin-delay";
|
|
6
|
-
import { Drawer, DrawerTrigger } from "../ui/Drawer.js";
|
|
7
|
-
import { cn } from "../util/cn.js";
|
|
2
|
+
import { Suspense, useEffect, type ReactNode } from "react";
|
|
3
|
+
import { Outlet, useLocation } from "react-router";
|
|
4
|
+
import { joinUrl } from "../util/joinUrl.js";
|
|
8
5
|
import { useScrollToAnchor } from "../util/useScrollToAnchor.js";
|
|
9
6
|
import { useScrollToTop } from "../util/useScrollToTop.js";
|
|
10
|
-
import { useViewportAnchor } from "./context/ViewportAnchorContext.js";
|
|
11
7
|
import { useZudoku } from "./context/ZudokuContext.js";
|
|
8
|
+
import { Footer } from "./Footer.js";
|
|
12
9
|
import { Header } from "./Header.js";
|
|
13
|
-
import {
|
|
10
|
+
import { Main } from "./Main.js";
|
|
14
11
|
import { Slotlet } from "./SlotletProvider.js";
|
|
15
12
|
import { Spinner } from "./Spinner.js";
|
|
16
13
|
|
|
17
14
|
const LoadingFallback = () => (
|
|
18
|
-
<main className="
|
|
15
|
+
<main className="col-span-full row-span-full grid place-items-center">
|
|
19
16
|
<Spinner />
|
|
20
17
|
</main>
|
|
21
18
|
);
|
|
22
19
|
|
|
23
20
|
export const Layout = ({ children }: { children?: ReactNode }) => {
|
|
21
|
+
const { meta, authentication, options } = useZudoku();
|
|
24
22
|
const location = useLocation();
|
|
25
|
-
const { setActiveAnchor } = useViewportAnchor();
|
|
26
|
-
const { meta, authentication } = useZudoku();
|
|
27
23
|
|
|
28
24
|
useScrollToAnchor();
|
|
29
25
|
useScrollToTop();
|
|
30
26
|
|
|
31
|
-
const previousLocationPath = useRef(location.pathname);
|
|
32
|
-
|
|
33
27
|
useEffect(() => {
|
|
34
28
|
// Initialize the authentication plugin
|
|
35
29
|
authentication?.onPageLoad?.();
|
|
36
30
|
}, [authentication]);
|
|
37
31
|
|
|
38
|
-
useEffect(() => {
|
|
39
|
-
// always reset on location change
|
|
40
|
-
if (location.pathname !== previousLocationPath.current) {
|
|
41
|
-
setActiveAnchor("");
|
|
42
|
-
}
|
|
43
|
-
previousLocationPath.current = location.pathname;
|
|
44
|
-
}, [location.pathname, setActiveAnchor]);
|
|
45
|
-
|
|
46
|
-
// Page transition is happening: https://reactrouter.com/start/framework/pending-ui#global-pending-navigation
|
|
47
|
-
const isNavigating = Boolean(useNavigation().location);
|
|
48
|
-
const showSpinner = useSpinDelay(isNavigating, {
|
|
49
|
-
delay: 300,
|
|
50
|
-
minDuration: 500,
|
|
51
|
-
});
|
|
52
|
-
const [isDrawerOpen, setDrawerOpen] = useState(false);
|
|
53
|
-
|
|
54
32
|
return (
|
|
55
33
|
<>
|
|
56
34
|
{import.meta.env.MODE === "standalone" && (
|
|
57
35
|
<style>{`:root { --top-nav-height: 0px; }`}</style>
|
|
58
36
|
)}
|
|
59
37
|
<Helmet titleTemplate={meta?.title}>
|
|
38
|
+
{options.canonicalUrlOrigin && (
|
|
39
|
+
<link
|
|
40
|
+
rel="canonical"
|
|
41
|
+
href={joinUrl(
|
|
42
|
+
options.canonicalUrlOrigin,
|
|
43
|
+
options.basePath,
|
|
44
|
+
location.pathname,
|
|
45
|
+
)}
|
|
46
|
+
/>
|
|
47
|
+
)}
|
|
60
48
|
{meta?.description && (
|
|
61
49
|
<meta name="description" content={meta.description} />
|
|
62
50
|
)}
|
|
@@ -66,45 +54,12 @@ export const Layout = ({ children }: { children?: ReactNode }) => {
|
|
|
66
54
|
<Header />
|
|
67
55
|
<Slotlet name="layout-after-head" />
|
|
68
56
|
|
|
69
|
-
<div className="
|
|
70
|
-
{
|
|
71
|
-
<
|
|
72
|
-
|
|
73
|
-
<Suspense fallback={<LoadingFallback />}>
|
|
74
|
-
<Drawer
|
|
75
|
-
direction="left"
|
|
76
|
-
open={isDrawerOpen}
|
|
77
|
-
onOpenChange={(open) => setDrawerOpen(open)}
|
|
78
|
-
>
|
|
79
|
-
<Sidebar onRequestClose={() => setDrawerOpen(false)} />
|
|
80
|
-
<div
|
|
81
|
-
className={cn(
|
|
82
|
-
"lg:hidden -mx-10 px-10 py-2 sticky bg-background/80 backdrop-blur z-10 top-0 left-0 right-0 border-b",
|
|
83
|
-
"peer-data-[navigation=false]:hidden",
|
|
84
|
-
)}
|
|
85
|
-
>
|
|
86
|
-
<DrawerTrigger className="flex items-center gap-2">
|
|
87
|
-
<PanelLeftIcon size={16} strokeWidth={1.5} />
|
|
88
|
-
<span className="text-sm">Menu</span>
|
|
89
|
-
</DrawerTrigger>
|
|
90
|
-
</div>
|
|
91
|
-
<main
|
|
92
|
-
className={cn(
|
|
93
|
-
"h-full dark:border-white/10 translate-x-0",
|
|
94
|
-
"lg:overflow-visible",
|
|
95
|
-
// This works in tandem with the `SidebarWrapper` component
|
|
96
|
-
"lg:peer-data-[navigation=true]:w-[calc(100%-var(--side-nav-width))]",
|
|
97
|
-
"lg:peer-data-[navigation=true]:translate-x-[--side-nav-width] lg:peer-data-[navigation=true]:pl-12",
|
|
98
|
-
)}
|
|
99
|
-
>
|
|
100
|
-
<Slotlet name="zudoku-before-content" />
|
|
101
|
-
{children ?? <Outlet />}
|
|
102
|
-
<Slotlet name="zudoku-after-content" />
|
|
103
|
-
</main>
|
|
104
|
-
</Drawer>
|
|
105
|
-
</Suspense>
|
|
106
|
-
)}
|
|
57
|
+
<div className="grid grid-cols-1 grid-rows-[0_min-content_1fr] lg:grid-rows-[min-content_1fr] lg:grid-cols-[var(--side-nav-width)_1fr] max-w-screen-2xl w-full lg:mx-auto">
|
|
58
|
+
<Suspense fallback={<LoadingFallback />}>
|
|
59
|
+
<Main>{children ?? <Outlet />}</Main>
|
|
60
|
+
</Suspense>
|
|
107
61
|
</div>
|
|
62
|
+
<Footer />
|
|
108
63
|
</>
|
|
109
64
|
);
|
|
110
65
|
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { PanelLeftIcon } from "lucide-react";
|
|
2
|
+
import { type PropsWithChildren, useState } from "react";
|
|
3
|
+
import { useNavigation } from "react-router";
|
|
4
|
+
import { Drawer, DrawerTrigger } from "zudoku/ui/Drawer.js";
|
|
5
|
+
import { cn } from "../util/cn.js";
|
|
6
|
+
import { useCurrentNavigation } from "./context/ZudokuContext.js";
|
|
7
|
+
import { Sidebar } from "./navigation/Sidebar.js";
|
|
8
|
+
import { Slotlet } from "./SlotletProvider.js";
|
|
9
|
+
|
|
10
|
+
export const Main = ({ children }: PropsWithChildren) => {
|
|
11
|
+
const [isDrawerOpen, setDrawerOpen] = useState(false);
|
|
12
|
+
const { sidebar } = useCurrentNavigation();
|
|
13
|
+
const hasSidebar = sidebar.length > 0;
|
|
14
|
+
const isNavigating = useNavigation().state === "loading";
|
|
15
|
+
|
|
16
|
+
return (
|
|
17
|
+
<Drawer
|
|
18
|
+
direction="left"
|
|
19
|
+
open={isDrawerOpen}
|
|
20
|
+
onOpenChange={(open) => setDrawerOpen(open)}
|
|
21
|
+
>
|
|
22
|
+
{hasSidebar && (
|
|
23
|
+
<Sidebar
|
|
24
|
+
onRequestClose={() => setDrawerOpen(false)}
|
|
25
|
+
sidebar={sidebar}
|
|
26
|
+
/>
|
|
27
|
+
)}
|
|
28
|
+
{hasSidebar && (
|
|
29
|
+
<div className="lg:hidden -mx-4 px-4 py-2 sticky bg-background/80 backdrop-blur z-10 top-0 left-0 right-0 border-b">
|
|
30
|
+
<DrawerTrigger className="flex items-center gap-2 px-4">
|
|
31
|
+
<PanelLeftIcon size={16} strokeWidth={1.5} />
|
|
32
|
+
<span className="text-sm">Menu</span>
|
|
33
|
+
</DrawerTrigger>
|
|
34
|
+
</div>
|
|
35
|
+
)}
|
|
36
|
+
<main
|
|
37
|
+
data-pagefind-body
|
|
38
|
+
className={cn(
|
|
39
|
+
"px-4 lg:pe-8 lg:px-8",
|
|
40
|
+
!hasSidebar && "col-span-full",
|
|
41
|
+
isNavigating && "animate-pulse",
|
|
42
|
+
)}
|
|
43
|
+
>
|
|
44
|
+
<Slotlet name="zudoku-before-content" />
|
|
45
|
+
{children}
|
|
46
|
+
<Slotlet name="zudoku-after-content" />
|
|
47
|
+
</main>
|
|
48
|
+
</Drawer>
|
|
49
|
+
);
|
|
50
|
+
};
|
|
@@ -9,12 +9,13 @@ import {
|
|
|
9
9
|
DrawerTrigger,
|
|
10
10
|
} from "../ui/Drawer.js";
|
|
11
11
|
import { useZudoku } from "./context/ZudokuContext.js";
|
|
12
|
+
import { PoweredByZudoku } from "./navigation/PoweredByZudoku.js";
|
|
12
13
|
import { Search } from "./Search.js";
|
|
13
14
|
import { ThemeSwitch } from "./ThemeSwitch.js";
|
|
14
|
-
import { isHiddenItem, TopNavItem } from "./TopNavigation.js";
|
|
15
|
+
import { isHiddenItem, PageProgress, TopNavItem } from "./TopNavigation.js";
|
|
15
16
|
|
|
16
17
|
export const MobileTopNavigation = () => {
|
|
17
|
-
const { topNavigation } = useZudoku();
|
|
18
|
+
const { topNavigation, options } = useZudoku();
|
|
18
19
|
const { isAuthenticated } = useAuth();
|
|
19
20
|
const [drawerOpen, setDrawerOpen] = useState(false);
|
|
20
21
|
|
|
@@ -28,28 +29,36 @@ export const MobileTopNavigation = () => {
|
|
|
28
29
|
<DrawerTrigger className="lg:hidden">
|
|
29
30
|
<MenuIcon size={22} />
|
|
30
31
|
</DrawerTrigger>
|
|
32
|
+
<PageProgress />
|
|
31
33
|
</div>
|
|
32
34
|
<DrawerContent
|
|
33
35
|
className="lg:hidden h-[100dvh] right-0 left-auto w-[320px] rounded-none"
|
|
34
36
|
aria-describedby={undefined}
|
|
35
37
|
>
|
|
36
|
-
<div className="p-4 overflow-y-auto overscroll-none">
|
|
37
|
-
<
|
|
38
|
-
<
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
<
|
|
43
|
-
<
|
|
44
|
-
|
|
45
|
-
{topNavigation.filter(isHiddenItem(isAuthenticated)).map((item) => (
|
|
46
|
-
<li key={item.label}>
|
|
47
|
-
<button onClick={() => setDrawerOpen(false)}>
|
|
48
|
-
<TopNavItem {...item} />
|
|
49
|
-
</button>
|
|
38
|
+
<div className="p-4 overflow-y-auto overscroll-none h-full flex flex-col justify-between">
|
|
39
|
+
<div>
|
|
40
|
+
<VisuallyHidden>
|
|
41
|
+
<DrawerTitle>Navigation</DrawerTitle>
|
|
42
|
+
</VisuallyHidden>
|
|
43
|
+
<Search className="flex p-4" />
|
|
44
|
+
<ul className="flex flex-col items-center gap-4 p-4">
|
|
45
|
+
<li>
|
|
46
|
+
<ThemeSwitch />
|
|
50
47
|
</li>
|
|
51
|
-
|
|
52
|
-
|
|
48
|
+
{topNavigation
|
|
49
|
+
.filter(isHiddenItem(isAuthenticated))
|
|
50
|
+
.map((item) => (
|
|
51
|
+
<li key={item.label}>
|
|
52
|
+
<button type="button" onClick={() => setDrawerOpen(false)}>
|
|
53
|
+
<TopNavItem {...item} />
|
|
54
|
+
</button>
|
|
55
|
+
</li>
|
|
56
|
+
))}
|
|
57
|
+
</ul>
|
|
58
|
+
</div>
|
|
59
|
+
{options.page?.showPoweredBy !== false && (
|
|
60
|
+
<PoweredByZudoku className="flex-grow-0 justify-center gap-1" />
|
|
61
|
+
)}
|
|
53
62
|
</div>
|
|
54
63
|
</DrawerContent>
|
|
55
64
|
</Drawer>
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { ArrowLeftIcon, ArrowRightIcon } from "lucide-react";
|
|
2
|
+
import { Link } from "react-router";
|
|
3
|
+
import { cn } from "../util/cn.js";
|
|
4
|
+
import { Button } from "./index.js";
|
|
5
|
+
|
|
6
|
+
export const Pagination = ({
|
|
7
|
+
prev,
|
|
8
|
+
next,
|
|
9
|
+
className,
|
|
10
|
+
}: {
|
|
11
|
+
prev: { to: string; label: string } | undefined;
|
|
12
|
+
next: { to: string; label: string } | undefined;
|
|
13
|
+
className?: string;
|
|
14
|
+
}) => {
|
|
15
|
+
const linkClass =
|
|
16
|
+
"group transition-all p-5 space-x-1 transition-all hover:text-foreground";
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<div
|
|
20
|
+
className={cn(
|
|
21
|
+
"flex -mx-4 text-muted-foreground font-semibold",
|
|
22
|
+
prev ? "justify-between" : "justify-end",
|
|
23
|
+
className,
|
|
24
|
+
)}
|
|
25
|
+
>
|
|
26
|
+
{prev && (
|
|
27
|
+
<Button variant="ghost" asChild>
|
|
28
|
+
<Link to={prev.to} relative="path" className={linkClass}>
|
|
29
|
+
<ArrowLeftIcon
|
|
30
|
+
className="group-hover:motion-safe:animate-bounce-x-start"
|
|
31
|
+
size={12}
|
|
32
|
+
/>
|
|
33
|
+
<span className="truncate">{prev.label}</span>
|
|
34
|
+
</Link>
|
|
35
|
+
</Button>
|
|
36
|
+
)}
|
|
37
|
+
{next && (
|
|
38
|
+
<Button variant="ghost" asChild>
|
|
39
|
+
<Link to={next.to} relative="path" className={linkClass}>
|
|
40
|
+
<span className="truncate ">{next.label}</span>
|
|
41
|
+
<ArrowRightIcon
|
|
42
|
+
className="group-hover:motion-safe:animate-bounce-x-end"
|
|
43
|
+
size={12}
|
|
44
|
+
/>
|
|
45
|
+
</Link>
|
|
46
|
+
</Button>
|
|
47
|
+
)}
|
|
48
|
+
</div>
|
|
49
|
+
);
|
|
50
|
+
};
|
|
@@ -22,7 +22,7 @@ export const ThemeSwitch = () => {
|
|
|
22
22
|
<div
|
|
23
23
|
className={cn(
|
|
24
24
|
"border border-transparent rounded-full p-0.5 [&>svg>circle]:transition-colors [&>svg>path]:transition-transform transition-all [&>svg>path]:duration-200 [&>svg>circle]:duration-500 [&>svg>circle]:fill-transparent",
|
|
25
|
-
resolvedTheme === "light" && "border-border bg-muted
|
|
25
|
+
resolvedTheme === "light" && "border-border bg-muted",
|
|
26
26
|
resolvedTheme === "dark" &&
|
|
27
27
|
"group-hover:[&>svg>path]:scale-110 group-hover:[&>svg>path]:-translate-x-[1px] group-hover:[&>svg>path]:-translate-y-[1px] group-hover:rotate-[15deg] ",
|
|
28
28
|
)}
|
|
@@ -1,16 +1,18 @@
|
|
|
1
|
+
import { useNProgress } from "@tanem/react-nprogress";
|
|
1
2
|
import { cx } from "class-variance-authority";
|
|
2
|
-
import { Suspense } from "react";
|
|
3
|
+
import { Suspense, useEffect, useState } from "react";
|
|
3
4
|
import { NavLink, useNavigation } from "react-router";
|
|
4
|
-
import { TopNavigationItem } from "../../config/validators/common.js";
|
|
5
|
+
import type { TopNavigationItem } from "../../config/validators/common.js";
|
|
5
6
|
import { useAuth } from "../authentication/hook.js";
|
|
6
|
-
import {
|
|
7
|
-
import { joinPath } from "../util/joinPath.js";
|
|
7
|
+
import { joinUrl } from "../util/joinUrl.js";
|
|
8
8
|
import { useCurrentNavigation, useZudoku } from "./context/ZudokuContext.js";
|
|
9
9
|
import { traverseSidebar } from "./navigation/utils.js";
|
|
10
|
+
import { Slotlet } from "./SlotletProvider.js";
|
|
10
11
|
|
|
11
12
|
export const isHiddenItem =
|
|
12
13
|
(isAuthenticated?: boolean) =>
|
|
13
|
-
(item: { display?: "auth" | "anon" | "always" }) => {
|
|
14
|
+
(item: { display?: "auth" | "anon" | "always" | "hide" }): boolean => {
|
|
15
|
+
if (item.display === "hide") return false;
|
|
14
16
|
return (
|
|
15
17
|
(item.display === "auth" && isAuthenticated) ||
|
|
16
18
|
(item.display === "anon" && !isAuthenticated) ||
|
|
@@ -19,26 +21,56 @@ export const isHiddenItem =
|
|
|
19
21
|
);
|
|
20
22
|
};
|
|
21
23
|
|
|
24
|
+
export const PageProgress = () => {
|
|
25
|
+
const navigation = useNavigation();
|
|
26
|
+
const isNavigating = navigation.state === "loading";
|
|
27
|
+
// delay the animation to avoid flickering
|
|
28
|
+
const [isAnimating, setIsAnimating] = useState(false);
|
|
29
|
+
|
|
30
|
+
useEffect(() => {
|
|
31
|
+
const timer = setTimeout(() => setIsAnimating(isNavigating), 100);
|
|
32
|
+
|
|
33
|
+
return () => clearTimeout(timer);
|
|
34
|
+
}, [isNavigating]);
|
|
35
|
+
|
|
36
|
+
const { isFinished, progress } = useNProgress({ isAnimating });
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
<div
|
|
40
|
+
className="absolute w-0 left-0 right-0 bottom-[-1px] h-[2px] bg-primary transition-all duration-300 ease-in-out"
|
|
41
|
+
style={{
|
|
42
|
+
opacity: isFinished ? 0 : 1,
|
|
43
|
+
width: isFinished ? 0 : `${progress * 100}%`,
|
|
44
|
+
}}
|
|
45
|
+
/>
|
|
46
|
+
);
|
|
47
|
+
};
|
|
48
|
+
|
|
22
49
|
export const TopNavigation = () => {
|
|
23
50
|
const { topNavigation } = useZudoku();
|
|
24
51
|
const { isAuthenticated } = useAuth();
|
|
25
52
|
|
|
26
|
-
|
|
27
|
-
|
|
53
|
+
const filteredItems = topNavigation.filter(isHiddenItem(isAuthenticated));
|
|
54
|
+
|
|
55
|
+
if (filteredItems.length === 0) {
|
|
28
56
|
return <style>{`:root { --top-nav-height: 0px; }`}</style>;
|
|
29
57
|
}
|
|
30
58
|
|
|
31
59
|
return (
|
|
32
60
|
<Suspense>
|
|
33
|
-
<
|
|
34
|
-
<
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
<
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
61
|
+
<div className="items-center justify-between px-8 h-[--top-nav-height] hidden lg:flex text-sm relative">
|
|
62
|
+
<nav className="text-sm">
|
|
63
|
+
<ul className="flex flex-row items-center gap-8">
|
|
64
|
+
{filteredItems.map((item) => (
|
|
65
|
+
<li key={item.id}>
|
|
66
|
+
<TopNavItem {...item} />
|
|
67
|
+
</li>
|
|
68
|
+
))}
|
|
69
|
+
</ul>
|
|
70
|
+
</nav>
|
|
71
|
+
<Slotlet name="top-navigation-side" />
|
|
72
|
+
</div>
|
|
73
|
+
<PageProgress />
|
|
42
74
|
</Suspense>
|
|
43
75
|
);
|
|
44
76
|
};
|
|
@@ -62,15 +94,10 @@ export const TopNavItem = ({
|
|
|
62
94
|
defaultLink ??
|
|
63
95
|
(currentSidebar
|
|
64
96
|
? traverseSidebar(currentSidebar, (item) => {
|
|
65
|
-
if (item.type === "doc") return
|
|
97
|
+
if (item.type === "doc") return joinUrl(item.id);
|
|
66
98
|
})
|
|
67
|
-
:
|
|
68
|
-
|
|
69
|
-
if (!first) {
|
|
70
|
-
throw new ZudokuError("Page not found.", {
|
|
71
|
-
developerHint: `No links found in top navigation for '${id}'. Check that the sidebar isn't empty or that a default link is set.`,
|
|
72
|
-
});
|
|
73
|
-
}
|
|
99
|
+
: joinUrl(id)) ??
|
|
100
|
+
joinUrl(id);
|
|
74
101
|
|
|
75
102
|
return (
|
|
76
103
|
// We don't use isActive here because it has to be inside the sidebar,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { MDXProvider } from "@mdx-js/react";
|
|
2
|
+
import { useQueryClient } from "@tanstack/react-query";
|
|
2
3
|
import { Helmet } from "@zudoku/react-helmet-async";
|
|
3
4
|
import { ThemeProvider } from "next-themes";
|
|
4
5
|
import {
|
|
5
|
-
Fragment,
|
|
6
6
|
memo,
|
|
7
7
|
type PropsWithChildren,
|
|
8
8
|
useContext,
|
|
@@ -11,9 +11,12 @@ import {
|
|
|
11
11
|
useState,
|
|
12
12
|
} from "react";
|
|
13
13
|
import { ErrorBoundary } from "react-error-boundary";
|
|
14
|
-
import { Outlet, useNavigation } from "react-router";
|
|
14
|
+
import { Outlet, useLocation, useNavigation } from "react-router";
|
|
15
15
|
import { hasHead, isMdxProviderPlugin } from "../core/plugins.js";
|
|
16
|
-
import {
|
|
16
|
+
import {
|
|
17
|
+
ZudokuContext,
|
|
18
|
+
type ZudokuContextOptions,
|
|
19
|
+
} from "../core/ZudokuContext.js";
|
|
17
20
|
import { TopLevelError } from "../errors/TopLevelError.js";
|
|
18
21
|
import { StaggeredRenderContext } from "../plugins/openapi/StaggeredRender.js";
|
|
19
22
|
import { MdxComponents } from "../util/MdxComponents.js";
|
|
@@ -22,10 +25,13 @@ import {
|
|
|
22
25
|
ComponentsProvider,
|
|
23
26
|
DEFAULT_COMPONENTS,
|
|
24
27
|
} from "./context/ComponentsContext.js";
|
|
28
|
+
import { RouterEventsEmitter } from "./context/RouterEventsEmitter.js";
|
|
25
29
|
import { ViewportAnchorProvider } from "./context/ViewportAnchorContext.js";
|
|
26
30
|
import { ZudokuProvider } from "./context/ZudokuProvider.js";
|
|
27
31
|
import { SlotletProvider } from "./SlotletProvider.js";
|
|
28
32
|
|
|
33
|
+
let zudokuContext: ZudokuContext | undefined;
|
|
34
|
+
|
|
29
35
|
const ZudokoInner = memo(
|
|
30
36
|
({ children, ...props }: PropsWithChildren<ZudokuContextOptions>) => {
|
|
31
37
|
const components = useMemo(
|
|
@@ -33,6 +39,7 @@ const ZudokoInner = memo(
|
|
|
33
39
|
[props.overrides],
|
|
34
40
|
);
|
|
35
41
|
|
|
42
|
+
const location = useLocation();
|
|
36
43
|
const mdxComponents = useMemo(() => {
|
|
37
44
|
const componentsFromPlugins = (props.plugins ?? [])
|
|
38
45
|
.filter(isMdxProviderPlugin)
|
|
@@ -56,6 +63,7 @@ const ZudokoInner = memo(
|
|
|
56
63
|
[stagger, didNavigate],
|
|
57
64
|
);
|
|
58
65
|
const navigation = useNavigation();
|
|
66
|
+
const queryClient = useQueryClient();
|
|
59
67
|
|
|
60
68
|
useEffect(() => {
|
|
61
69
|
if (didNavigate) {
|
|
@@ -64,18 +72,23 @@ const ZudokoInner = memo(
|
|
|
64
72
|
setDidNavigate(true);
|
|
65
73
|
}, [didNavigate, navigation.location]);
|
|
66
74
|
|
|
67
|
-
|
|
75
|
+
if (!zudokuContext) {
|
|
76
|
+
zudokuContext = new ZudokuContext(props, queryClient);
|
|
77
|
+
}
|
|
68
78
|
|
|
69
79
|
const heads = props.plugins
|
|
70
|
-
?.
|
|
80
|
+
?.flatMap((plugin) =>
|
|
81
|
+
hasHead(plugin) ? (plugin.getHead?.({ location }) ?? []) : [],
|
|
82
|
+
)
|
|
71
83
|
// eslint-disable-next-line react/no-array-index-key
|
|
72
|
-
.map((
|
|
84
|
+
.map((entry, i) => <Helmet key={i}>{entry}</Helmet>);
|
|
73
85
|
|
|
74
86
|
return (
|
|
75
87
|
<>
|
|
76
|
-
|
|
88
|
+
{heads}
|
|
77
89
|
<StaggeredRenderContext.Provider value={staggeredValue}>
|
|
78
90
|
<ZudokuProvider context={zudokuContext}>
|
|
91
|
+
<RouterEventsEmitter />
|
|
79
92
|
<MDXProvider components={mdxComponents}>
|
|
80
93
|
<ThemeProvider attribute="class" disableTransitionOnChange>
|
|
81
94
|
<ComponentsProvider value={components}>
|
|
@@ -13,3 +13,11 @@ export const useCache = () => {
|
|
|
13
13
|
},
|
|
14
14
|
};
|
|
15
15
|
};
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* If a query has this key in its queryKey, it will not put its result in the dehydrated state in the SSR.
|
|
19
|
+
*
|
|
20
|
+
* This is useful if the query should only be suspended and not included in the initial HTML response.
|
|
21
|
+
* (e.g. too large in size, or not needed for the initial page load)
|
|
22
|
+
*/
|
|
23
|
+
export const NO_DEHYDRATE = "no-dehydrate";
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { useEffect, useRef } from "react";
|
|
2
|
+
import { useLocation, type Location } from "react-router";
|
|
3
|
+
import { useZudoku } from "./ZudokuContext.js";
|
|
4
|
+
|
|
5
|
+
export const RouterEventsEmitter = () => {
|
|
6
|
+
const location = useLocation();
|
|
7
|
+
const zudoku = useZudoku();
|
|
8
|
+
const previousLocation = useRef<Location | undefined>(undefined);
|
|
9
|
+
|
|
10
|
+
useEffect(() => {
|
|
11
|
+
zudoku.emitEvent("location", {
|
|
12
|
+
from: previousLocation.current,
|
|
13
|
+
to: location,
|
|
14
|
+
});
|
|
15
|
+
previousLocation.current = location;
|
|
16
|
+
}, [zudoku, location]);
|
|
17
|
+
|
|
18
|
+
return null;
|
|
19
|
+
};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import {
|
|
2
|
-
type ReactNode,
|
|
3
2
|
createContext,
|
|
4
3
|
useCallback,
|
|
5
4
|
useContext,
|
|
@@ -7,6 +6,7 @@ import {
|
|
|
7
6
|
useMemo,
|
|
8
7
|
useRef,
|
|
9
8
|
useState,
|
|
9
|
+
type PropsWithChildren,
|
|
10
10
|
} from "react";
|
|
11
11
|
|
|
12
12
|
type AnchorContextType = {
|
|
@@ -55,11 +55,7 @@ export const useRegisterAnchorElement = () => {
|
|
|
55
55
|
return { ref: setRef };
|
|
56
56
|
};
|
|
57
57
|
|
|
58
|
-
export const ViewportAnchorProvider = ({
|
|
59
|
-
children,
|
|
60
|
-
}: {
|
|
61
|
-
children: ReactNode;
|
|
62
|
-
}) => {
|
|
58
|
+
export const ViewportAnchorProvider = ({ children }: PropsWithChildren) => {
|
|
63
59
|
const [activeAnchor, setActiveAnchor] = useState("");
|
|
64
60
|
const observerRef = useRef<IntersectionObserver | null>(null);
|
|
65
61
|
const registeredElements = useRef(new Set<HTMLElement>());
|
|
@@ -75,9 +71,7 @@ export const ViewportAnchorProvider = ({
|
|
|
75
71
|
}
|
|
76
72
|
},
|
|
77
73
|
{
|
|
78
|
-
|
|
79
|
-
// see --header-height in `main.css`
|
|
80
|
-
rootMargin: "115px 0px -80% 0px",
|
|
74
|
+
rootMargin: "0px 0px -80% 0px",
|
|
81
75
|
threshold: 0.75,
|
|
82
76
|
},
|
|
83
77
|
);
|
|
@@ -100,14 +94,11 @@ export const ViewportAnchorProvider = ({
|
|
|
100
94
|
window.innerHeight + window.scrollY >= document.body.scrollHeight;
|
|
101
95
|
|
|
102
96
|
if (hasReachedTop) {
|
|
103
|
-
// reset the active anchor when we reach the top
|
|
104
97
|
setActiveAnchor("");
|
|
105
98
|
} else if (hasReachedBottom) {
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
setActiveAnchor(lastItem?.id ?? "");
|
|
110
|
-
});
|
|
99
|
+
const lastItem = Array.from(elements).pop();
|
|
100
|
+
const lastId = lastItem?.id ?? "";
|
|
101
|
+
setActiveAnchor(lastId);
|
|
111
102
|
}
|
|
112
103
|
};
|
|
113
104
|
|
|
@@ -2,9 +2,9 @@ import { useQuery, useSuspenseQuery } from "@tanstack/react-query";
|
|
|
2
2
|
import { createContext, useContext } from "react";
|
|
3
3
|
import { matchPath, useLocation } from "react-router";
|
|
4
4
|
import { useAuth } from "../../authentication/hook.js";
|
|
5
|
-
import { ZudokuContext } from "../../core/ZudokuContext.js";
|
|
6
|
-
import {
|
|
7
|
-
import { CACHE_KEYS } from "../cache.js";
|
|
5
|
+
import type { ZudokuContext } from "../../core/ZudokuContext.js";
|
|
6
|
+
import { joinUrl } from "../../util/joinUrl.js";
|
|
7
|
+
import { CACHE_KEYS, NO_DEHYDRATE } from "../cache.js";
|
|
8
8
|
import { traverseSidebar } from "../navigation/utils.js";
|
|
9
9
|
|
|
10
10
|
export const ZudokuReactContext = createContext<ZudokuContext | undefined>(
|
|
@@ -26,7 +26,7 @@ export const useApiIdentities = () => {
|
|
|
26
26
|
|
|
27
27
|
return useQuery({
|
|
28
28
|
queryFn: getApiIdentities,
|
|
29
|
-
queryKey:
|
|
29
|
+
queryKey: CACHE_KEYS.API_IDENTITIES,
|
|
30
30
|
});
|
|
31
31
|
};
|
|
32
32
|
|
|
@@ -39,13 +39,13 @@ export const useCurrentNavigation = () => {
|
|
|
39
39
|
matchPath(route, location.pathname),
|
|
40
40
|
);
|
|
41
41
|
|
|
42
|
-
|
|
42
|
+
let currentSidebarItem = Object.entries(sidebars).find(([, sidebar]) => {
|
|
43
43
|
return traverseSidebar(sidebar, (item) => {
|
|
44
44
|
const itemId =
|
|
45
45
|
item.type === "doc"
|
|
46
|
-
?
|
|
46
|
+
? joinUrl(item.id)
|
|
47
47
|
: item.type === "category" && item.link
|
|
48
|
-
?
|
|
48
|
+
? joinUrl(item.link.id)
|
|
49
49
|
: undefined;
|
|
50
50
|
|
|
51
51
|
if (itemId === location.pathname) {
|
|
@@ -57,9 +57,18 @@ export const useCurrentNavigation = () => {
|
|
|
57
57
|
topNavigation.find((t) => t.id === currentSidebarItem?.[0]) ??
|
|
58
58
|
topNavigation.find((item) => matchPath(item.id, location.pathname));
|
|
59
59
|
|
|
60
|
+
if (
|
|
61
|
+
currentTopNavItem &&
|
|
62
|
+
!currentSidebarItem &&
|
|
63
|
+
currentTopNavItem.id in sidebars
|
|
64
|
+
) {
|
|
65
|
+
currentSidebarItem = ["", sidebars[currentTopNavItem.id]!];
|
|
66
|
+
}
|
|
67
|
+
|
|
60
68
|
const { data } = useSuspenseQuery({
|
|
61
69
|
queryFn: () => getPluginSidebar(location.pathname),
|
|
62
|
-
|
|
70
|
+
// We just want to suspend here and don't store in SSR dehydrated state
|
|
71
|
+
queryKey: ["plugin-sidebar", NO_DEHYDRATE, location.pathname],
|
|
63
72
|
});
|
|
64
73
|
|
|
65
74
|
const hideSidebar =
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { useMDXComponents as useMDXComponentsImport } from "@mdx-js/react";
|
|
2
2
|
import { Helmet } from "@zudoku/react-helmet-async";
|
|
3
|
+
import { useTheme as useThemeImport } from "next-themes";
|
|
3
4
|
import { Link as LinkImport } from "react-router";
|
|
4
5
|
import { useAuth as useAuthImport } from "../authentication/hook.js";
|
|
5
6
|
import { RouteGuard as RouteGuardImport } from "../core/RouteGuard.js";
|
|
@@ -46,3 +47,4 @@ export const Spinner = /*@__PURE__*/ SpinnerImport;
|
|
|
46
47
|
export const ClientOnly = /*@__PURE__*/ ClientOnlyImport;
|
|
47
48
|
export const Button = /*@__PURE__*/ ButtonImport;
|
|
48
49
|
export const Link = /*@__PURE__*/ LinkImport;
|
|
50
|
+
export const useTheme = /*@__PURE__*/ useThemeImport;
|