zudoku 0.0.0-e614aaa → 0.0.0-e6d1d34
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/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 +2 -0
- package/dist/app/main.js.map +1 -1
- package/dist/app/tailwind.js +14 -0
- package/dist/app/tailwind.js.map +1 -1
- package/dist/cli/build/handler.js +2 -1
- package/dist/cli/build/handler.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/dev/handler.js +2 -1
- package/dist/cli/dev/handler.js.map +1 -1
- package/dist/cli/preview/handler.js +13 -15
- package/dist/cli/preview/handler.js.map +1 -1
- package/dist/config/common.d.ts +0 -1
- package/dist/config/config.d.ts +13 -8
- package/dist/config/loader.d.ts +2 -2
- package/dist/config/loader.js +14 -25
- package/dist/config/loader.js.map +1 -1
- package/dist/config/validators/common.d.ts +2773 -597
- package/dist/config/validators/common.js +81 -4
- package/dist/config/validators/common.js.map +1 -1
- package/dist/config/validators/validate.d.ts +1013 -257
- 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/clerk.d.ts +2 -2
- package/dist/lib/authentication/providers/clerk.js +19 -0
- package/dist/lib/authentication/providers/clerk.js.map +1 -1
- package/dist/lib/authentication/providers/openid.d.ts +1 -0
- package/dist/lib/authentication/providers/openid.js +20 -8
- 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 +1 -16
- 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/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 +1 -1
- 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/TopNavigation.d.ts +3 -2
- package/dist/lib/components/TopNavigation.js +26 -13
- package/dist/lib/components/TopNavigation.js.map +1 -1
- package/dist/lib/components/Zudoku.js +9 -3
- 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/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 +5 -2
- 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/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 +1 -0
- package/dist/lib/core/RouteGuard.js +10 -3
- package/dist/lib/core/RouteGuard.js.map +1 -1
- package/dist/lib/core/ZudokuContext.d.ts +23 -7
- package/dist/lib/core/ZudokuContext.js +12 -5
- package/dist/lib/core/ZudokuContext.js.map +1 -1
- package/dist/lib/core/plugins.d.ts +9 -7
- package/dist/lib/errors/ErrorAlert.js +6 -1
- package/dist/lib/errors/ErrorAlert.js.map +1 -1
- package/dist/lib/hooks/useEvent.test.js +1 -1
- package/dist/lib/hooks/useEvent.test.js.map +1 -1
- package/dist/lib/oas/graphql/index.d.ts +17 -4
- package/dist/lib/oas/graphql/index.js +148 -38
- 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.js +1 -1
- package/dist/lib/plugins/api-catalog/Catalog.js.map +1 -1
- package/dist/lib/plugins/api-catalog/index.js +19 -17
- package/dist/lib/plugins/api-catalog/index.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 +1 -1
- package/dist/lib/plugins/openapi/OperationList.js +63 -19
- 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 +6 -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/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 +38 -9
- package/dist/lib/plugins/openapi/Sidecar.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 -4
- 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/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 +19 -13
- 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.js +23 -10
- package/dist/lib/plugins/search-pagefind/PagefindSearch.js.map +1 -1
- package/dist/lib/plugins/search-pagefind/ResultList.d.ts +1 -0
- package/dist/lib/plugins/search-pagefind/ResultList.js +19 -17
- package/dist/lib/plugins/search-pagefind/ResultList.js.map +1 -1
- package/dist/lib/plugins/search-pagefind/get-results.d.ts +8 -1
- package/dist/lib/plugins/search-pagefind/get-results.js +9 -4
- package/dist/lib/plugins/search-pagefind/get-results.js.map +1 -1
- 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 +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 +0 -1
- package/dist/lib/ui/Stepper.js +1 -1
- package/dist/lib/ui/Stepper.js.map +1 -1
- package/dist/lib/ui/SyntaxHighlight.d.ts +2 -1
- package/dist/lib/ui/SyntaxHighlight.js +21 -15
- package/dist/lib/ui/SyntaxHighlight.js.map +1 -1
- package/dist/lib/util/MdxComponents.d.ts +3 -2
- package/dist/lib/util/MdxComponents.js +2 -2
- 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 +20 -12
- 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 +35 -12
- 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 +1 -4
- package/dist/vite/build.js.map +1 -1
- package/dist/vite/config.js +7 -9
- package/dist/vite/config.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/dev-server.js +4 -4
- package/dist/vite/dev-server.js.map +1 -1
- package/dist/vite/plugin-api.js +36 -29
- package/dist/vite/plugin-api.js.map +1 -1
- package/dist/vite/plugin-config-reload.js +3 -2
- package/dist/vite/plugin-config-reload.js.map +1 -1
- package/dist/vite/plugin-docs.d.ts +1 -1
- package/dist/vite/plugin-docs.js +18 -1
- package/dist/vite/plugin-docs.js.map +1 -1
- package/dist/vite/prerender/FileWritingResponse.d.ts +9 -5
- package/dist/vite/prerender/FileWritingResponse.js +5 -5
- 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 +32 -8
- package/dist/vite/prerender/prerender.js.map +1 -1
- package/dist/vite/prerender/worker.js +41 -14
- package/dist/vite/prerender/worker.js.map +1 -1
- package/dist/zuplo/with-zuplo.js +4 -0
- package/dist/zuplo/with-zuplo.js.map +1 -1
- package/lib/{AuthenticationPlugin-CiO1FM6Q.js → AuthenticationPlugin-foqdvvkf.js} +3 -3
- package/lib/{AuthenticationPlugin-CiO1FM6Q.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/{Dialog-DIKGQxQc.js → Dialog-sbgekbjb.js} +47 -32
- package/lib/{Dialog-DIKGQxQc.js.map → Dialog-sbgekbjb.js.map} +1 -1
- package/lib/Drawer-kDAfOq_2.js +1133 -0
- package/lib/Drawer-kDAfOq_2.js.map +1 -0
- package/lib/{Markdown-DePfm7oQ.js → Markdown-aF5FdsNi.js} +6268 -4572
- 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-BSuptFK-.js → OasProvider-C5paEivQ.js} +4 -4
- package/lib/{OasProvider-BSuptFK-.js.map → OasProvider-C5paEivQ.js.map} +1 -1
- package/lib/OperationList-Ds9Izgkn.js +5069 -0
- package/lib/OperationList-Ds9Izgkn.js.map +1 -0
- package/lib/Pagination-SdlocK96.js +48 -0
- package/lib/Pagination-SdlocK96.js.map +1 -0
- package/lib/{index.esm-CQHE3GEU.js → RouteGuard-CqZPoZYJ.js} +192 -139
- package/lib/RouteGuard-CqZPoZYJ.js.map +1 -0
- package/lib/SchemaList-NZbDXAV5.js +148 -0
- package/lib/SchemaList-NZbDXAV5.js.map +1 -0
- package/lib/SchemaView-B3fOPR4V.js +357 -0
- package/lib/SchemaView-B3fOPR4V.js.map +1 -0
- package/lib/{Select-Dqtcn53H.js → Select-DVFRKf1R.js} +9 -9
- package/lib/{Select-Dqtcn53H.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-BEoSoPEo.js +2890 -0
- 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-IR6S3I6Y-D_3UmFIn.js → chunk-HA7DTUK3-C4gP41vD.js} +278 -278
- package/lib/chunk-HA7DTUK3-C4gP41vD.js.map +1 -0
- package/lib/{circular-v7K6lDDh.js → circular-ByJI6Mci.js} +4887 -4419
- package/lib/circular-ByJI6Mci.js.map +1 -0
- package/lib/{createServer-DmusVVsi.js → createServer-mYvGvmc0.js} +4150 -4424
- package/lib/createServer-mYvGvmc0.js.map +1 -0
- package/lib/{hook-CN__aZIt.js → hook-CqpVYDqN.js} +398 -379
- package/lib/hook-CqpVYDqN.js.map +1 -0
- package/lib/index-D48iOQvJ.js +1973 -0
- package/lib/index-D48iOQvJ.js.map +1 -0
- package/lib/index-PGJOZ6R-.js +2227 -0
- package/lib/index-PGJOZ6R-.js.map +1 -0
- package/lib/{mutation-EclmI0is.js → mutation-8LjrN7uz.js} +2 -2
- package/lib/{mutation-EclmI0is.js.map → mutation-8LjrN7uz.js.map} +1 -1
- 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/ActionButton.js +11 -10
- package/lib/ui/ActionButton.js.map +1 -1
- 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/Checkbox.js +15 -25
- package/lib/ui/Checkbox.js.map +1 -1
- package/lib/ui/Command.js +1 -1
- package/lib/ui/Drawer.js +14 -1129
- package/lib/ui/Drawer.js.map +1 -1
- package/lib/ui/Select.js +1 -1
- package/lib/ui/Select.js.map +1 -1
- package/lib/ui/Stepper.js.map +1 -1
- package/lib/ui/SyntaxHighlight.js +8 -2902
- package/lib/ui/SyntaxHighlight.js.map +1 -1
- package/lib/{useExposedProps-RIvey2Oy.js → useExposedProps-B9qXJedG.js} +2 -2
- package/lib/{useExposedProps-RIvey2Oy.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 +1 -1
- package/lib/zudoku.auth-clerk.js +59 -41
- package/lib/zudoku.auth-clerk.js.map +1 -1
- package/lib/zudoku.auth-openid.js +341 -337
- package/lib/zudoku.auth-openid.js.map +1 -1
- package/lib/zudoku.components.js +32 -1395
- package/lib/zudoku.components.js.map +1 -1
- package/lib/zudoku.hooks.js +1 -1
- package/lib/zudoku.plugin-api-catalog.js +94 -98
- package/lib/zudoku.plugin-api-catalog.js.map +1 -1
- package/lib/zudoku.plugin-api-keys.js +4 -4
- package/lib/zudoku.plugin-custom-pages.js +2 -2
- package/lib/zudoku.plugin-markdown.js +1 -1
- package/lib/zudoku.plugin-openapi.js +5 -7
- package/lib/zudoku.plugin-openapi.js.map +1 -1
- package/lib/zudoku.plugin-redirect.js +1 -1
- package/lib/zudoku.plugin-search-pagefind.js +233 -0
- package/lib/zudoku.plugin-search-pagefind.js.map +1 -0
- package/lib/zudoku.plugins.js.map +1 -1
- package/package.json +32 -24
- package/src/app/entry.server.tsx +23 -13
- package/src/app/main.css +98 -57
- package/src/app/main.tsx +2 -0
- package/src/app/tailwind.ts +14 -0
- package/src/lib/authentication/authentication.ts +2 -0
- package/src/lib/authentication/hook.ts +12 -1
- package/src/lib/authentication/providers/clerk.tsx +22 -2
- package/src/lib/authentication/providers/openid.tsx +23 -10
- package/src/lib/authentication/providers/supabase.tsx +157 -0
- package/src/lib/authentication/state.ts +1 -35
- package/src/lib/components/AnchorLink.tsx +9 -7
- package/src/lib/components/Bootstrap.tsx +13 -6
- package/src/lib/components/Footer.tsx +136 -0
- package/src/lib/components/Header.tsx +11 -7
- package/src/lib/components/InlineCode.tsx +13 -16
- package/src/lib/components/Layout.tsx +22 -68
- 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/TopNavigation.tsx +40 -17
- package/src/lib/components/Zudoku.tsx +12 -3
- package/src/lib/components/cache.ts +8 -0
- package/src/lib/components/context/BypassProtectedRoutesContext.ts +3 -0
- package/src/lib/components/context/ViewportAnchorContext.tsx +6 -15
- package/src/lib/components/context/ZudokuContext.ts +17 -8
- package/src/lib/components/navigation/PoweredByZudoku.tsx +23 -0
- package/src/lib/components/navigation/Sidebar.tsx +30 -44
- package/src/lib/components/navigation/SidebarCategory.tsx +15 -12
- package/src/lib/components/navigation/SidebarItem.tsx +21 -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 +27 -4
- package/src/lib/core/ZudokuContext.ts +35 -15
- package/src/lib/core/plugins.ts +8 -8
- package/src/lib/errors/ErrorAlert.tsx +24 -17
- package/src/lib/hooks/useEvent.test.tsx +1 -1
- package/src/lib/oas/graphql/index.ts +202 -54
- 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 +1 -4
- package/src/lib/plugins/api-catalog/index.tsx +40 -35
- package/src/lib/plugins/markdown/MdxPage.tsx +11 -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 +162 -84
- package/src/lib/plugins/openapi/OperationListItem.tsx +116 -110
- package/src/lib/plugins/openapi/ParamInfos.tsx +87 -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 +47 -11
- 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 +29 -20
- 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/Playground.tsx +175 -88
- 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 +24 -4
- 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 +39 -14
- package/src/lib/plugins/search-pagefind/ResultList.tsx +60 -53
- package/src/lib/plugins/search-pagefind/get-results.tsx +31 -10
- 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/Select.tsx +1 -1
- package/src/lib/ui/Stepper.tsx +1 -1
- package/src/lib/ui/SyntaxHighlight.tsx +96 -96
- package/src/lib/util/MdxComponents.tsx +2 -2
- 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 +22 -12
- package/dist/lib/components/context/PluginSystem.d.ts +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/dist/vite/pagefind.d.ts +0 -4
- package/dist/vite/pagefind.js +0 -15
- package/dist/vite/pagefind.js.map +0 -1
- package/lib/Markdown-DePfm7oQ.js.map +0 -1
- package/lib/MdxPage-BN6l6zXL.js +0 -201
- package/lib/MdxPage-BN6l6zXL.js.map +0 -1
- package/lib/OperationList-DOcfDmJP.js +0 -5217
- package/lib/OperationList-DOcfDmJP.js.map +0 -1
- package/lib/SlotletProvider-DdtIOUi6.js +0 -221
- package/lib/SlotletProvider-DdtIOUi6.js.map +0 -1
- package/lib/Spinner-1KrEmx1V.js +0 -51
- package/lib/Spinner-1KrEmx1V.js.map +0 -1
- package/lib/chunk-IR6S3I6Y-D_3UmFIn.js.map +0 -1
- package/lib/circular-v7K6lDDh.js.map +0 -1
- package/lib/createServer-DmusVVsi.js.map +0 -1
- package/lib/hook-CN__aZIt.js.map +0 -1
- package/lib/index-BTbP6Lgf.js +0 -2103
- package/lib/index-BTbP6Lgf.js.map +0 -1
- package/lib/index.esm-CQHE3GEU.js.map +0 -1
- package/lib/joinUrl-10po2Jdj.js +0 -20
- package/lib/joinUrl-10po2Jdj.js.map +0 -1
- package/lib/useScrollToAnchor-RyqO3lj4.js +0 -290
- package/lib/useScrollToAnchor-RyqO3lj4.js.map +0 -1
- package/lib/zudoku.css +0 -1
- package/src/lib/components/context/PluginSystem.ts +0 -0
- package/src/lib/ui/Stepper.css +0 -43
- /package/dist/lib/{plugins/markdown → components/navigation}/Toc.d.ts +0 -0
|
@@ -1,17 +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
10
|
import { Slotlet } from "./SlotletProvider.js";
|
|
11
11
|
|
|
12
12
|
export const isHiddenItem =
|
|
13
13
|
(isAuthenticated?: boolean) =>
|
|
14
|
-
(item: { display?: "auth" | "anon" | "always" }) => {
|
|
14
|
+
(item: { display?: "auth" | "anon" | "always" | "hide" }): boolean => {
|
|
15
|
+
if (item.display === "hide") return false;
|
|
15
16
|
return (
|
|
16
17
|
(item.display === "auth" && isAuthenticated) ||
|
|
17
18
|
(item.display === "anon" && !isAuthenticated) ||
|
|
@@ -20,21 +21,47 @@ export const isHiddenItem =
|
|
|
20
21
|
);
|
|
21
22
|
};
|
|
22
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
|
+
|
|
23
49
|
export const TopNavigation = () => {
|
|
24
50
|
const { topNavigation } = useZudoku();
|
|
25
51
|
const { isAuthenticated } = useAuth();
|
|
26
52
|
|
|
27
|
-
|
|
28
|
-
|
|
53
|
+
const filteredItems = topNavigation.filter(isHiddenItem(isAuthenticated));
|
|
54
|
+
|
|
55
|
+
if (filteredItems.length === 0) {
|
|
29
56
|
return <style>{`:root { --top-nav-height: 0px; }`}</style>;
|
|
30
57
|
}
|
|
31
58
|
|
|
32
59
|
return (
|
|
33
60
|
<Suspense>
|
|
34
|
-
<div className="
|
|
61
|
+
<div className="items-center justify-between px-8 h-[--top-nav-height] hidden lg:flex text-sm relative">
|
|
35
62
|
<nav className="text-sm">
|
|
36
63
|
<ul className="flex flex-row items-center gap-8">
|
|
37
|
-
{
|
|
64
|
+
{filteredItems.map((item) => (
|
|
38
65
|
<li key={item.id}>
|
|
39
66
|
<TopNavItem {...item} />
|
|
40
67
|
</li>
|
|
@@ -43,6 +70,7 @@ export const TopNavigation = () => {
|
|
|
43
70
|
</nav>
|
|
44
71
|
<Slotlet name="top-navigation-side" />
|
|
45
72
|
</div>
|
|
73
|
+
<PageProgress />
|
|
46
74
|
</Suspense>
|
|
47
75
|
);
|
|
48
76
|
};
|
|
@@ -66,15 +94,10 @@ export const TopNavItem = ({
|
|
|
66
94
|
defaultLink ??
|
|
67
95
|
(currentSidebar
|
|
68
96
|
? traverseSidebar(currentSidebar, (item) => {
|
|
69
|
-
if (item.type === "doc") return
|
|
97
|
+
if (item.type === "doc") return joinUrl(item.id);
|
|
70
98
|
})
|
|
71
|
-
:
|
|
72
|
-
|
|
73
|
-
if (!first) {
|
|
74
|
-
throw new ZudokuError("Page not found.", {
|
|
75
|
-
developerHint: `No links found in top navigation for '${id}'. Check that the sidebar isn't empty or that a default link is set.`,
|
|
76
|
-
});
|
|
77
|
-
}
|
|
99
|
+
: joinUrl(id)) ??
|
|
100
|
+
joinUrl(id);
|
|
78
101
|
|
|
79
102
|
return (
|
|
80
103
|
// We don't use isActive here because it has to be inside the sidebar,
|
|
@@ -1,4 +1,5 @@
|
|
|
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 {
|
|
@@ -10,7 +11,7 @@ import {
|
|
|
10
11
|
useState,
|
|
11
12
|
} from "react";
|
|
12
13
|
import { ErrorBoundary } from "react-error-boundary";
|
|
13
|
-
import { Outlet, useNavigation } from "react-router";
|
|
14
|
+
import { Outlet, useLocation, useNavigation } from "react-router";
|
|
14
15
|
import { hasHead, isMdxProviderPlugin } from "../core/plugins.js";
|
|
15
16
|
import {
|
|
16
17
|
ZudokuContext,
|
|
@@ -29,6 +30,8 @@ import { ViewportAnchorProvider } from "./context/ViewportAnchorContext.js";
|
|
|
29
30
|
import { ZudokuProvider } from "./context/ZudokuProvider.js";
|
|
30
31
|
import { SlotletProvider } from "./SlotletProvider.js";
|
|
31
32
|
|
|
33
|
+
let zudokuContext: ZudokuContext | undefined;
|
|
34
|
+
|
|
32
35
|
const ZudokoInner = memo(
|
|
33
36
|
({ children, ...props }: PropsWithChildren<ZudokuContextOptions>) => {
|
|
34
37
|
const components = useMemo(
|
|
@@ -36,6 +39,7 @@ const ZudokoInner = memo(
|
|
|
36
39
|
[props.overrides],
|
|
37
40
|
);
|
|
38
41
|
|
|
42
|
+
const location = useLocation();
|
|
39
43
|
const mdxComponents = useMemo(() => {
|
|
40
44
|
const componentsFromPlugins = (props.plugins ?? [])
|
|
41
45
|
.filter(isMdxProviderPlugin)
|
|
@@ -59,6 +63,7 @@ const ZudokoInner = memo(
|
|
|
59
63
|
[stagger, didNavigate],
|
|
60
64
|
);
|
|
61
65
|
const navigation = useNavigation();
|
|
66
|
+
const queryClient = useQueryClient();
|
|
62
67
|
|
|
63
68
|
useEffect(() => {
|
|
64
69
|
if (didNavigate) {
|
|
@@ -67,10 +72,14 @@ const ZudokoInner = memo(
|
|
|
67
72
|
setDidNavigate(true);
|
|
68
73
|
}, [didNavigate, navigation.location]);
|
|
69
74
|
|
|
70
|
-
|
|
75
|
+
if (!zudokuContext) {
|
|
76
|
+
zudokuContext = new ZudokuContext(props, queryClient);
|
|
77
|
+
}
|
|
71
78
|
|
|
72
79
|
const heads = props.plugins
|
|
73
|
-
?.flatMap((plugin) =>
|
|
80
|
+
?.flatMap((plugin) =>
|
|
81
|
+
hasHead(plugin) ? (plugin.getHead?.({ location }) ?? []) : [],
|
|
82
|
+
)
|
|
74
83
|
// eslint-disable-next-line react/no-array-index-key
|
|
75
84
|
.map((entry, i) => <Helmet key={i}>{entry}</Helmet>);
|
|
76
85
|
|
|
@@ -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";
|
|
@@ -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 =
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ChevronRightIcon } from "lucide-react";
|
|
2
|
+
import { cn } from "../../util/cn.js";
|
|
3
|
+
import ZudokuLogo from "./ZudokuLogo.js";
|
|
4
|
+
|
|
5
|
+
export const PoweredByZudoku = ({ className }: { className?: string }) => (
|
|
6
|
+
<a
|
|
7
|
+
href="https://zudoku.dev"
|
|
8
|
+
target="_blank"
|
|
9
|
+
rel="noopener noreferrer"
|
|
10
|
+
className={cn(
|
|
11
|
+
"flex justify-between items-center w-full border border-transparent hover:border-border rounded-full hover:shadow-sm h-7 px-3 text-nowrap hover:bg-muted/80 transition-all",
|
|
12
|
+
className,
|
|
13
|
+
)}
|
|
14
|
+
>
|
|
15
|
+
<div className="opacity-70 hover:opacity-100 transition-opacity gap-1.5 text-[11px] font-medium rounded-full h-7 flex items-center text-nowrap">
|
|
16
|
+
<ZudokuLogo className="w-3.5 h-3.5 dark:fill-white" />
|
|
17
|
+
powered by Zudoku
|
|
18
|
+
</div>
|
|
19
|
+
<div className="text-xs font-medium opacity-70 hover:text-foreground transition-colors cursor-pointer">
|
|
20
|
+
<ChevronRightIcon size={12} absoluteStrokeWidth strokeWidth={1.5} />
|
|
21
|
+
</div>
|
|
22
|
+
</a>
|
|
23
|
+
);
|
|
@@ -1,55 +1,41 @@
|
|
|
1
|
-
import { useEffect, useRef } from "react";
|
|
2
|
-
|
|
3
1
|
import { VisuallyHidden } from "@radix-ui/react-visually-hidden";
|
|
2
|
+
import type { SidebarItem as SidebarItemType } from "../../../config/validators/SidebarSchema.js";
|
|
4
3
|
import { DrawerContent, DrawerTitle } from "../../ui/Drawer.js";
|
|
5
|
-
import { scrollIntoViewIfNeeded } from "../../util/scrollIntoViewIfNeeded.js";
|
|
6
|
-
import { useCurrentNavigation } from "../context/ZudokuContext.js";
|
|
7
4
|
import { Slotlet } from "../SlotletProvider.js";
|
|
8
5
|
import { SidebarItem } from "./SidebarItem.js";
|
|
9
6
|
import { SidebarWrapper } from "./SidebarWrapper.js";
|
|
10
7
|
|
|
11
8
|
export const Sidebar = ({
|
|
12
9
|
onRequestClose,
|
|
10
|
+
sidebar,
|
|
13
11
|
}: {
|
|
14
12
|
onRequestClose?: () => void;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
>
|
|
30
|
-
<
|
|
31
|
-
|
|
32
|
-
|
|
13
|
+
sidebar: SidebarItemType[];
|
|
14
|
+
}) => (
|
|
15
|
+
<>
|
|
16
|
+
<SidebarWrapper>
|
|
17
|
+
<Slotlet name="zudoku-before-navigation" />
|
|
18
|
+
{sidebar.map((item) => (
|
|
19
|
+
<SidebarItem key={item.label} item={item} />
|
|
20
|
+
))}
|
|
21
|
+
<Slotlet name="zudoku-after-navigation" />
|
|
22
|
+
</SidebarWrapper>
|
|
23
|
+
<DrawerContent
|
|
24
|
+
className="lg:hidden h-[100dvh] left-0 w-[320px] rounded-none"
|
|
25
|
+
aria-describedby={undefined}
|
|
26
|
+
>
|
|
27
|
+
<div className="p-4 overflow-y-auto overscroll-none">
|
|
28
|
+
<VisuallyHidden>
|
|
29
|
+
<DrawerTitle>Sidebar</DrawerTitle>
|
|
30
|
+
</VisuallyHidden>
|
|
31
|
+
{sidebar.map((item) => (
|
|
32
|
+
<SidebarItem
|
|
33
|
+
key={item.label}
|
|
34
|
+
item={item}
|
|
35
|
+
onRequestClose={onRequestClose}
|
|
36
|
+
/>
|
|
33
37
|
))}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
aria-describedby={undefined}
|
|
39
|
-
>
|
|
40
|
-
<div className="p-4 overflow-y-auto overscroll-none">
|
|
41
|
-
<VisuallyHidden>
|
|
42
|
-
<DrawerTitle>Sidebar</DrawerTitle>
|
|
43
|
-
</VisuallyHidden>
|
|
44
|
-
{navigation.sidebar.map((item) => (
|
|
45
|
-
<SidebarItem
|
|
46
|
-
key={item.label}
|
|
47
|
-
item={item}
|
|
48
|
-
onRequestClose={onRequestClose}
|
|
49
|
-
/>
|
|
50
|
-
))}
|
|
51
|
-
</div>
|
|
52
|
-
</DrawerContent>
|
|
53
|
-
</>
|
|
54
|
-
);
|
|
55
|
-
};
|
|
38
|
+
</div>
|
|
39
|
+
</DrawerContent>
|
|
40
|
+
</>
|
|
41
|
+
);
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import * as Collapsible from "@radix-ui/react-collapsible";
|
|
2
|
+
import { deepEqual } from "fast-equals";
|
|
2
3
|
import { ChevronRightIcon } from "lucide-react";
|
|
3
|
-
import { useEffect, useState } from "react";
|
|
4
|
+
import { memo, useEffect, useState } from "react";
|
|
4
5
|
import { NavLink, useMatch } from "react-router";
|
|
6
|
+
import { Button } from "zudoku/ui/Button.js";
|
|
5
7
|
import type { SidebarItemCategory } from "../../../config/validators/SidebarSchema.js";
|
|
6
8
|
import { cn } from "../../util/cn.js";
|
|
7
9
|
import { joinPath } from "../../util/joinPath.js";
|
|
8
10
|
import { navigationListItem, SidebarItem } from "./SidebarItem.js";
|
|
9
11
|
import { useIsCategoryOpen } from "./utils.js";
|
|
10
12
|
|
|
11
|
-
|
|
13
|
+
const SidebarCategoryInner = ({
|
|
12
14
|
category,
|
|
13
15
|
onRequestClose,
|
|
14
16
|
}: {
|
|
@@ -35,13 +37,15 @@ export const SidebarCategory = ({
|
|
|
35
37
|
}, [isCategoryOpen]);
|
|
36
38
|
|
|
37
39
|
const ToggleButton = isCollapsible && (
|
|
38
|
-
<
|
|
39
|
-
type="button"
|
|
40
|
+
<Button
|
|
40
41
|
onClick={(e) => {
|
|
41
42
|
e.preventDefault();
|
|
42
43
|
setOpen((prev) => !prev);
|
|
43
44
|
setHasInteracted(true);
|
|
44
45
|
}}
|
|
46
|
+
variant="ghost"
|
|
47
|
+
size="icon"
|
|
48
|
+
className="size-6 hover:bg-[hsl(from_hsl(var(--accent))_h_s_calc(l-5))] hover:dark:bg-[hsl(from_hsl(var(--accent))_h_s_calc(l+5))]"
|
|
45
49
|
>
|
|
46
50
|
<ChevronRightIcon
|
|
47
51
|
size={16}
|
|
@@ -50,7 +54,7 @@ export const SidebarCategory = ({
|
|
|
50
54
|
"shrink-0 group-data-[state=open]:rotate-90",
|
|
51
55
|
)}
|
|
52
56
|
/>
|
|
53
|
-
</
|
|
57
|
+
</Button>
|
|
54
58
|
);
|
|
55
59
|
|
|
56
60
|
const icon = category.icon && (
|
|
@@ -62,7 +66,7 @@ export const SidebarCategory = ({
|
|
|
62
66
|
|
|
63
67
|
const styles = navigationListItem({
|
|
64
68
|
className: [
|
|
65
|
-
"text-start font-medium",
|
|
69
|
+
"group text-start font-medium",
|
|
66
70
|
isCollapsible || typeof category.link !== "undefined"
|
|
67
71
|
? "cursor-pointer"
|
|
68
72
|
: "cursor-default hover:bg-transparent",
|
|
@@ -90,12 +94,7 @@ export const SidebarCategory = ({
|
|
|
90
94
|
}}
|
|
91
95
|
>
|
|
92
96
|
{icon}
|
|
93
|
-
<div
|
|
94
|
-
className={cn(
|
|
95
|
-
"flex items-center gap-2 justify-between w-full",
|
|
96
|
-
isActive ? "text-primary" : "text-foreground/80",
|
|
97
|
-
)}
|
|
98
|
-
>
|
|
97
|
+
<div className="flex items-center gap-2 justify-between w-full text-foreground/80 group-aria-[current='page']:text-primary">
|
|
99
98
|
<div className="truncate">{category.label}</div>
|
|
100
99
|
{ToggleButton}
|
|
101
100
|
</div>
|
|
@@ -135,3 +134,7 @@ export const SidebarCategory = ({
|
|
|
135
134
|
</Collapsible.Root>
|
|
136
135
|
);
|
|
137
136
|
};
|
|
137
|
+
|
|
138
|
+
export const SidebarCategory = memo(SidebarCategoryInner, deepEqual);
|
|
139
|
+
|
|
140
|
+
SidebarCategory.displayName = "SidebarCategory";
|
|
@@ -1,26 +1,30 @@
|
|
|
1
1
|
import { cva } from "class-variance-authority";
|
|
2
2
|
import { ExternalLinkIcon } from "lucide-react";
|
|
3
|
-
import { NavLink, useSearchParams } from "react-router";
|
|
3
|
+
import { NavLink, useLocation, useSearchParams } from "react-router";
|
|
4
4
|
|
|
5
5
|
import type { SidebarItem as SidebarItemType } from "../../../config/validators/SidebarSchema.js";
|
|
6
|
-
import {
|
|
6
|
+
import { joinUrl } from "../../util/joinUrl.js";
|
|
7
7
|
import { AnchorLink } from "../AnchorLink.js";
|
|
8
8
|
import { useViewportAnchor } from "../context/ViewportAnchorContext.js";
|
|
9
9
|
import { SidebarBadge } from "./SidebarBadge.js";
|
|
10
10
|
import { SidebarCategory } from "./SidebarCategory.js";
|
|
11
11
|
|
|
12
12
|
export const navigationListItem = cva(
|
|
13
|
-
"flex items-center gap-2 px-[--padding-nav-item] py-1.5 rounded-lg hover:bg-accent",
|
|
13
|
+
"flex items-center gap-2 px-[--padding-nav-item] my-0.5 py-1.5 rounded-lg hover:bg-accent tabular-nums",
|
|
14
14
|
{
|
|
15
15
|
variants: {
|
|
16
16
|
isActive: {
|
|
17
|
-
true: "
|
|
17
|
+
true: "bg-accent font-medium",
|
|
18
18
|
false: "text-foreground/80",
|
|
19
19
|
},
|
|
20
20
|
isMuted: {
|
|
21
21
|
true: "text-foreground/30",
|
|
22
22
|
false: "",
|
|
23
23
|
},
|
|
24
|
+
isPending: {
|
|
25
|
+
true: "bg-accent animate-pulse",
|
|
26
|
+
false: "",
|
|
27
|
+
},
|
|
24
28
|
},
|
|
25
29
|
defaultVariants: {
|
|
26
30
|
isActive: false,
|
|
@@ -37,6 +41,7 @@ export const SidebarItem = ({
|
|
|
37
41
|
item: SidebarItemType;
|
|
38
42
|
onRequestClose?: () => void;
|
|
39
43
|
}) => {
|
|
44
|
+
const location = useLocation();
|
|
40
45
|
const { activeAnchor } = useViewportAnchor();
|
|
41
46
|
const [searchParams] = useSearchParams();
|
|
42
47
|
|
|
@@ -48,8 +53,10 @@ export const SidebarItem = ({
|
|
|
48
53
|
case "doc":
|
|
49
54
|
return (
|
|
50
55
|
<NavLink
|
|
51
|
-
className={({ isActive }) =>
|
|
52
|
-
|
|
56
|
+
className={({ isActive, isPending }) =>
|
|
57
|
+
navigationListItem({ isActive, isPending })
|
|
58
|
+
}
|
|
59
|
+
to={joinUrl(item.id)}
|
|
53
60
|
onClick={onRequestClose}
|
|
54
61
|
end
|
|
55
62
|
>
|
|
@@ -67,12 +74,16 @@ export const SidebarItem = ({
|
|
|
67
74
|
</NavLink>
|
|
68
75
|
);
|
|
69
76
|
case "link":
|
|
70
|
-
return item.href.startsWith("
|
|
77
|
+
return !item.href.startsWith("http") ? (
|
|
71
78
|
<AnchorLink
|
|
72
|
-
to={{
|
|
73
|
-
|
|
79
|
+
to={{
|
|
80
|
+
pathname: item.href.split("#")[0],
|
|
81
|
+
hash: item.href.split("#")[1],
|
|
82
|
+
search: searchParams.toString(),
|
|
83
|
+
}}
|
|
84
|
+
{...{ [DATA_ANCHOR_ATTR]: item.href.split("#")[1] }}
|
|
74
85
|
className={navigationListItem({
|
|
75
|
-
isActive: item.href
|
|
86
|
+
isActive: item.href === [location.pathname, activeAnchor].join("#"),
|
|
76
87
|
className: item.badge?.placement !== "start" && "justify-between",
|
|
77
88
|
})}
|
|
78
89
|
onClick={onRequestClose}
|
|
@@ -88,25 +99,6 @@ export const SidebarItem = ({
|
|
|
88
99
|
<span className="break-all">{item.label}</span>
|
|
89
100
|
)}
|
|
90
101
|
</AnchorLink>
|
|
91
|
-
) : !item.href.startsWith("http") ? (
|
|
92
|
-
<NavLink
|
|
93
|
-
className={navigationListItem({
|
|
94
|
-
isActive: item.href.split("#")[1] === activeAnchor,
|
|
95
|
-
className: item.badge?.placement !== "start" && "justify-between",
|
|
96
|
-
})}
|
|
97
|
-
to={item.href}
|
|
98
|
-
>
|
|
99
|
-
{item.badge ? (
|
|
100
|
-
<>
|
|
101
|
-
<span className="truncate" title={item.label}>
|
|
102
|
-
{item.label}
|
|
103
|
-
</span>
|
|
104
|
-
<SidebarBadge {...item.badge} />
|
|
105
|
-
</>
|
|
106
|
-
) : (
|
|
107
|
-
<span className="break-all">{item.label}</span>
|
|
108
|
-
)}
|
|
109
|
-
</NavLink>
|
|
110
102
|
) : (
|
|
111
103
|
<a
|
|
112
104
|
className={navigationListItem()}
|
|
@@ -1,27 +1,46 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useEffect, useRef, type PropsWithChildren } from "react";
|
|
2
2
|
import { cn } from "../../util/cn.js";
|
|
3
|
+
import { scrollIntoViewIfNeeded } from "../../util/scrollIntoViewIfNeeded.js";
|
|
4
|
+
import { useZudoku } from "../context/ZudokuContext.js";
|
|
5
|
+
import { PoweredByZudoku } from "./PoweredByZudoku.js";
|
|
3
6
|
|
|
4
|
-
export const SidebarWrapper =
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
7
|
+
export const SidebarWrapper = ({
|
|
8
|
+
children,
|
|
9
|
+
className,
|
|
10
|
+
}: PropsWithChildren<{
|
|
11
|
+
className?: string;
|
|
12
|
+
}>) => {
|
|
13
|
+
const { options } = useZudoku();
|
|
14
|
+
const navRef = useRef<HTMLDivElement>(null);
|
|
15
|
+
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
const active = navRef.current?.querySelector('[aria-current="page"]');
|
|
18
|
+
scrollIntoViewIfNeeded(active ?? null);
|
|
19
|
+
}, []);
|
|
20
|
+
|
|
21
|
+
return (
|
|
22
|
+
<div className="grid sticky top-[--header-height] lg:h-[calc(100vh-var(--header-height))] grid-rows-[1fr_min-content] border-r">
|
|
23
|
+
<nav
|
|
24
|
+
ref={navRef}
|
|
25
|
+
className={cn(
|
|
26
|
+
"hidden max-w-[calc(var(--side-nav-width)+var(--padding-nav-item))] lg:flex scrollbar flex-col overflow-y-auto shrink-0 text-sm pe-3 ps-4 lg:ps-8",
|
|
27
|
+
"-mx-[--padding-nav-item] pb-3 pt-[--padding-content-top] scroll-pt-2 gap-1",
|
|
28
|
+
// Revert the padding/margin on the first child
|
|
29
|
+
"-mt-2.5",
|
|
30
|
+
className,
|
|
31
|
+
)}
|
|
32
|
+
style={{
|
|
33
|
+
maskImage: `linear-gradient(180deg, transparent 1%, rgba(0, 0, 0, 1) 20px, rgba(0, 0, 0, 1) 90%, transparent 99%)`,
|
|
34
|
+
}}
|
|
35
|
+
>
|
|
36
|
+
{children}
|
|
37
|
+
</nav>
|
|
38
|
+
|
|
39
|
+
<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.page?.showPoweredBy !== false && <PoweredByZudoku />}
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
43
|
+
);
|
|
44
|
+
};
|
|
26
45
|
|
|
27
46
|
SidebarWrapper.displayName = "SidebarWrapper";
|