zudoku 0.0.0-fa903e7 → 0.0.0-fabd0c1
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/client.d.ts +7 -0
- package/dist/app/demo.js +1 -1
- package/dist/app/demo.js.map +1 -1
- package/dist/app/entry.client.d.ts +1 -0
- package/dist/app/entry.client.js +14 -15
- package/dist/app/entry.client.js.map +1 -1
- package/dist/app/entry.server.d.ts +1 -0
- package/dist/app/entry.server.js +2 -2
- package/dist/app/entry.server.js.map +1 -1
- package/dist/app/main.d.ts +1 -1
- package/dist/app/main.js +2 -1
- package/dist/app/main.js.map +1 -1
- package/dist/app/sentry.d.ts +3 -0
- package/dist/app/sentry.js +19 -0
- package/dist/app/sentry.js.map +1 -0
- package/dist/app/standalone.js +1 -1
- package/dist/app/standalone.js.map +1 -1
- package/dist/app/tailwind.d.ts +2 -1
- package/dist/app/tailwind.js +64 -52
- package/dist/app/tailwind.js.map +1 -1
- package/dist/cli/cli.js +0 -2
- package/dist/cli/cli.js.map +1 -1
- package/dist/cli/cmds/build.js +1 -0
- package/dist/cli/cmds/build.js.map +1 -1
- package/dist/cli/common/outdated.js +2 -1
- package/dist/cli/common/outdated.js.map +1 -1
- package/dist/config/common.d.ts +8 -0
- package/dist/config/common.js +2 -0
- package/dist/config/common.js.map +1 -0
- package/dist/config/config.d.ts +3 -2
- package/dist/config/loader.d.ts +20 -0
- package/dist/config/loader.js +154 -0
- package/dist/config/loader.js.map +1 -0
- package/dist/config/validators/InputSidebarSchema.d.ts +14 -13
- package/dist/config/validators/InputSidebarSchema.js.map +1 -1
- package/dist/config/validators/common.d.ts +4945 -0
- package/dist/config/validators/common.js +280 -0
- package/dist/config/validators/common.js.map +1 -0
- package/dist/config/validators/icon-types.d.ts +1 -0
- package/dist/config/validators/icon-types.js +2 -0
- package/dist/config/validators/icon-types.js.map +1 -0
- package/dist/config/validators/validate.d.ts +783 -533
- package/dist/config/validators/validate.js +9 -234
- package/dist/config/validators/validate.js.map +1 -1
- package/dist/lib/authentication/components/CallbackHandler.js +1 -1
- package/dist/lib/authentication/components/CallbackHandler.js.map +1 -1
- package/dist/lib/authentication/components/SignIn.js +1 -1
- package/dist/lib/authentication/components/SignIn.js.map +1 -1
- package/dist/lib/authentication/components/SignOut.js +1 -1
- package/dist/lib/authentication/components/SignOut.js.map +1 -1
- package/dist/lib/authentication/providers/openid.d.ts +7 -0
- package/dist/lib/authentication/providers/openid.js +8 -2
- package/dist/lib/authentication/providers/openid.js.map +1 -1
- package/dist/lib/components/AnchorLink.d.ts +1 -1
- package/dist/lib/components/AnchorLink.js +1 -1
- package/dist/lib/components/AnchorLink.js.map +1 -1
- package/dist/lib/components/Bootstrap.d.ts +1 -2
- package/dist/lib/components/Bootstrap.js +3 -3
- package/dist/lib/components/Bootstrap.js.map +1 -1
- package/dist/lib/components/Header.js +2 -2
- package/dist/lib/components/Header.js.map +1 -1
- package/dist/lib/components/Heading.d.ts +4 -4
- package/dist/lib/components/Heading.js +1 -1
- package/dist/lib/components/Heading.js.map +1 -1
- package/dist/lib/components/Layout.js +4 -3
- package/dist/lib/components/Layout.js.map +1 -1
- package/dist/lib/components/Markdown.js +1 -1
- package/dist/lib/components/Markdown.js.map +1 -1
- package/dist/lib/components/MobileTopNavigation.js +1 -1
- package/dist/lib/components/MobileTopNavigation.js.map +1 -1
- package/dist/lib/components/NotFoundPage.js +1 -1
- package/dist/lib/components/NotFoundPage.js.map +1 -1
- package/dist/lib/components/ReactMarkdown.d.ts +29 -0
- package/dist/lib/components/ReactMarkdown.js +182 -0
- package/dist/lib/components/ReactMarkdown.js.map +1 -0
- package/dist/lib/components/Search.d.ts +3 -1
- package/dist/lib/components/Search.js +3 -3
- package/dist/lib/components/Search.js.map +1 -1
- package/dist/lib/components/SlotletProvider.d.ts +2 -2
- package/dist/lib/components/SyntaxHighlight.js +0 -4
- package/dist/lib/components/SyntaxHighlight.js.map +1 -1
- package/dist/lib/components/TopNavigation.d.ts +1 -1
- package/dist/lib/components/TopNavigation.js +1 -1
- package/dist/lib/components/TopNavigation.js.map +1 -1
- package/dist/lib/components/Zudoku.js +1 -1
- package/dist/lib/components/Zudoku.js.map +1 -1
- package/dist/lib/components/context/ZudokuContext.js +1 -1
- package/dist/lib/components/context/ZudokuContext.js.map +1 -1
- package/dist/lib/components/index.d.ts +4 -4
- package/dist/lib/components/index.js +1 -1
- package/dist/lib/components/index.js.map +1 -1
- package/dist/lib/components/navigation/Sidebar.d.ts +3 -1
- package/dist/lib/components/navigation/Sidebar.js +2 -2
- package/dist/lib/components/navigation/Sidebar.js.map +1 -1
- package/dist/lib/components/navigation/SidebarBadge.d.ts +0 -9
- package/dist/lib/components/navigation/SidebarBadge.js +0 -9
- 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 +4 -5
- package/dist/lib/components/navigation/SidebarCategory.js.map +1 -1
- package/dist/lib/components/navigation/SidebarItem.d.ts +2 -4
- package/dist/lib/components/navigation/SidebarItem.js +6 -11
- package/dist/lib/components/navigation/SidebarItem.js.map +1 -1
- package/dist/lib/components/navigation/SidebarWrapper.js +1 -1
- package/dist/lib/components/navigation/SidebarWrapper.js.map +1 -1
- package/dist/lib/components/navigation/utils.js +1 -1
- package/dist/lib/components/navigation/utils.js.map +1 -1
- package/dist/lib/core/ZudokuContext.d.ts +1 -1
- package/dist/lib/core/plugins.d.ts +3 -5
- package/dist/lib/core/plugins.js.map +1 -1
- package/dist/lib/errors/RouterError.js +1 -1
- package/dist/lib/errors/RouterError.js.map +1 -1
- package/dist/lib/oas/graphql/index.js +4 -1
- package/dist/lib/oas/graphql/index.js.map +1 -1
- package/dist/lib/plugins/api-catalog/Catalog.d.ts +2 -0
- package/dist/lib/plugins/api-catalog/Catalog.js +36 -0
- package/dist/lib/plugins/api-catalog/Catalog.js.map +1 -0
- package/dist/lib/plugins/api-catalog/index.d.ts +30 -0
- package/dist/lib/plugins/api-catalog/index.js +15 -0
- package/dist/lib/plugins/api-catalog/index.js.map +1 -0
- package/dist/lib/plugins/api-keys/CreateApiKey.js +1 -1
- package/dist/lib/plugins/api-keys/CreateApiKey.js.map +1 -1
- package/dist/lib/plugins/api-keys/ProtectedRoute.js +1 -1
- package/dist/lib/plugins/api-keys/ProtectedRoute.js.map +1 -1
- package/dist/lib/plugins/api-keys/SettingsApiKeys.js +1 -1
- package/dist/lib/plugins/api-keys/SettingsApiKeys.js.map +1 -1
- package/dist/lib/plugins/markdown/MdxPage.d.ts +1 -1
- package/dist/lib/plugins/markdown/MdxPage.js +3 -3
- package/dist/lib/plugins/markdown/MdxPage.js.map +1 -1
- package/dist/lib/plugins/markdown/index.d.ts +3 -1
- package/dist/lib/plugins/markdown/index.js.map +1 -1
- package/dist/lib/plugins/markdown/resolver.js.map +1 -1
- package/dist/lib/plugins/openapi/OperationList.js +24 -3
- package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
- package/dist/lib/plugins/openapi/OperationListItem.d.ts +2 -1
- package/dist/lib/plugins/openapi/OperationListItem.js +14 -4
- package/dist/lib/plugins/openapi/OperationListItem.js.map +1 -1
- package/dist/lib/plugins/openapi/Route.d.ts +4 -2
- package/dist/lib/plugins/openapi/Route.js +25 -2
- package/dist/lib/plugins/openapi/Route.js.map +1 -1
- package/dist/lib/plugins/openapi/Sidecar.js +3 -13
- package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
- package/dist/lib/plugins/openapi/context.d.ts +3 -3
- package/dist/lib/plugins/openapi/graphql/gql.d.ts +1 -1
- package/dist/lib/plugins/openapi/graphql/gql.js +1 -1
- package/dist/lib/plugins/openapi/graphql/gql.js.map +1 -1
- package/dist/lib/plugins/openapi/graphql/graphql.d.ts +2 -0
- package/dist/lib/plugins/openapi/graphql/graphql.js +1 -0
- package/dist/lib/plugins/openapi/graphql/graphql.js.map +1 -1
- package/dist/lib/plugins/openapi/index.js +13 -13
- package/dist/lib/plugins/openapi/index.js.map +1 -1
- package/dist/lib/plugins/openapi/interfaces.d.ts +19 -0
- package/dist/lib/plugins/openapi/playground/PathParams.js +1 -1
- package/dist/lib/plugins/openapi/playground/PathParams.js.map +1 -1
- package/dist/lib/plugins/openapi/util/methodToColor.d.ts +20 -0
- package/dist/lib/plugins/openapi/util/methodToColor.js +24 -0
- package/dist/lib/plugins/openapi/util/methodToColor.js.map +1 -0
- package/dist/lib/plugins/openapi/util/sanitizeMarkdownForMetatag.d.ts +1 -0
- package/dist/lib/plugins/openapi/util/sanitizeMarkdownForMetatag.js +27 -0
- package/dist/lib/plugins/openapi/util/sanitizeMarkdownForMetatag.js.map +1 -0
- package/dist/lib/plugins/redirect/index.d.ts +1 -1
- package/dist/lib/plugins/redirect/index.js +1 -1
- package/dist/lib/plugins/redirect/index.js.map +1 -1
- package/dist/lib/plugins/search-inkeep/index.d.ts +22 -3
- package/dist/lib/plugins/search-inkeep/index.js +41 -5
- package/dist/lib/plugins/search-inkeep/index.js.map +1 -1
- package/dist/lib/plugins/search-inkeep/inkeep.d.ts +3 -4
- package/dist/lib/plugins/search-inkeep/inkeep.js.map +1 -1
- package/dist/lib/ui/Button.d.ts +1 -1
- package/dist/lib/ui/Command.d.ts +1 -1
- package/dist/lib/util/MdxComponents.d.ts +18 -19
- package/dist/lib/util/MdxComponents.js +1 -3
- package/dist/lib/util/MdxComponents.js.map +1 -1
- package/dist/lib/util/createVariantComponent.d.ts +2 -2
- package/dist/lib/util/useExposedProps.js +1 -1
- package/dist/lib/util/useExposedProps.js.map +1 -1
- package/dist/lib/util/useOnScreen.d.ts +1 -1
- package/dist/lib/util/useScrollToAnchor.js +1 -1
- package/dist/lib/util/useScrollToAnchor.js.map +1 -1
- package/dist/lib/util/useScrollToTop.js +1 -1
- package/dist/lib/util/useScrollToTop.js.map +1 -1
- package/dist/vite/build.js +15 -3
- package/dist/vite/build.js.map +1 -1
- package/dist/vite/config.d.ts +6 -4
- package/dist/vite/config.js +59 -24
- package/dist/vite/config.js.map +1 -1
- package/dist/vite/config.test.js +4 -1
- package/dist/vite/config.test.js.map +1 -1
- package/dist/vite/css/collect.d.ts +2 -0
- package/dist/vite/css/collect.js +27 -0
- package/dist/vite/css/collect.js.map +1 -0
- package/dist/vite/css/plugin.d.ts +5 -0
- package/dist/vite/css/plugin.js +79 -0
- package/dist/vite/css/plugin.js.map +1 -0
- package/dist/vite/dev-server.js +19 -6
- package/dist/vite/dev-server.js.map +1 -1
- package/dist/vite/output.d.ts +1 -1
- package/dist/vite/output.js +25 -16
- package/dist/vite/output.js.map +1 -1
- package/dist/vite/plugin-api.js +79 -10
- package/dist/vite/plugin-api.js.map +1 -1
- package/dist/vite/plugin-component.js +1 -0
- package/dist/vite/plugin-component.js.map +1 -1
- package/dist/vite/plugin-config-reload.d.ts +1 -2
- package/dist/vite/plugin-config-reload.js.map +1 -1
- package/dist/vite/plugin-config.js +20 -0
- package/dist/vite/plugin-config.js.map +1 -1
- package/dist/vite/plugin-mdx.js +50 -1
- package/dist/vite/plugin-mdx.js.map +1 -1
- package/dist/vite/{plugin-custom-css.d.ts → plugin-theme-css.d.ts} +2 -2
- package/dist/vite/{plugin-custom-css.js → plugin-theme-css.js} +10 -3
- package/dist/vite/plugin-theme-css.js.map +1 -0
- package/dist/vite/plugin.d.ts +1 -2
- package/dist/vite/plugin.js +6 -2
- package/dist/vite/plugin.js.map +1 -1
- package/dist/vite/prerender.d.ts +2 -1
- package/dist/vite/prerender.js +2 -2
- package/dist/vite/prerender.js.map +1 -1
- package/dist/vite/sitemap.d.ts +1 -1
- package/dist/zuplo/env.d.ts +6 -0
- package/dist/zuplo/env.js +9 -0
- package/dist/zuplo/env.js.map +1 -0
- package/dist/zuplo/with-zuplo.d.ts +2 -2
- package/dist/zuplo/with-zuplo.js.map +1 -1
- package/lib/AnchorLink-DFZZbmvr.js +34 -0
- package/lib/AnchorLink-DFZZbmvr.js.map +1 -0
- package/lib/{AuthenticationPlugin-D0Em0SwR.js → AuthenticationPlugin-fB7viE7A.js} +15 -16
- package/lib/AuthenticationPlugin-fB7viE7A.js.map +1 -0
- package/lib/{Button-jK0EsymC.js → Button-DeAoTouo.js} +4 -4
- package/lib/{Button-jK0EsymC.js.map → Button-DeAoTouo.js.map} +1 -1
- package/lib/{CategoryHeading-Bb9dqxD3.js → CategoryHeading-CBconmtI.js} +3 -3
- package/lib/{CategoryHeading-Bb9dqxD3.js.map → CategoryHeading-CBconmtI.js.map} +1 -1
- package/lib/ClientOnly-E7hGysn1.js.map +1 -1
- package/lib/{Dialog-k70Qfukb.js → Dialog-Bxv1yEIg.js} +3 -3
- package/lib/{Dialog-k70Qfukb.js.map → Dialog-Bxv1yEIg.js.map} +1 -1
- package/lib/{Markdown-ievDDhFT.js → Markdown-CZDLNOFc.js} +13227 -13217
- package/lib/Markdown-CZDLNOFc.js.map +1 -0
- package/lib/{MdxPage-B2FpJ9KC.js → MdxPage-CPBw4_lf.js} +82 -77
- package/lib/MdxPage-CPBw4_lf.js.map +1 -0
- package/lib/OperationList-n4U_BHmO.js +5062 -0
- package/lib/OperationList-n4U_BHmO.js.map +1 -0
- package/lib/Route-C8nwd9A2.js +37 -0
- package/lib/Route-C8nwd9A2.js.map +1 -0
- package/lib/{Select-O9ZM3ZgX.js → Select-D3XuKKuH.js} +5 -5
- package/lib/{Select-O9ZM3ZgX.js.map → Select-D3XuKKuH.js.map} +1 -1
- package/lib/SlotletProvider-pfc9oejW.js +221 -0
- package/lib/SlotletProvider-pfc9oejW.js.map +1 -0
- package/lib/{Spinner-3cQDBVGr.js → Spinner-DuxJLLNE.js} +2 -2
- package/lib/{Spinner-3cQDBVGr.js.map → Spinner-DuxJLLNE.js.map} +1 -1
- package/lib/StaggeredRender-DgsamH_G.js +17 -0
- package/lib/StaggeredRender-DgsamH_G.js.map +1 -0
- package/lib/{SyntaxHighlight-DkLOsjHS.js → SyntaxHighlight-Bz-lOJtH.js} +8 -12
- package/lib/{SyntaxHighlight-DkLOsjHS.js.map → SyntaxHighlight-Bz-lOJtH.js.map} +1 -1
- package/lib/assets/{index-B_Jk_Yzp.js → index-C7jnHK4b.js} +218 -197
- package/lib/assets/index-C7jnHK4b.js.map +1 -0
- package/lib/assets/{worker-BHClFO3A.js → worker-D2kRl-cG.js} +5285 -4904
- package/lib/assets/worker-D2kRl-cG.js.map +1 -0
- package/lib/chunk-D52XG6IA-Dl7HLe6j.js +1823 -0
- package/lib/chunk-D52XG6IA-Dl7HLe6j.js.map +1 -0
- package/lib/{cn-BmFQLtkS.js → cn-qaFjX9_3.js} +2 -2
- package/lib/cn-qaFjX9_3.js.map +1 -0
- package/lib/{context-D1nXWxm7.js → context-h_UkBLvr.js} +2 -2
- package/lib/context-h_UkBLvr.js.map +1 -0
- package/lib/{createServer-CpJlUPtn.js → createServer-69sLlmQA.js} +4820 -4440
- package/lib/createServer-69sLlmQA.js.map +1 -0
- package/lib/{hook-hEqe7fPB.js → hook-DgGeo5iL.js} +3 -3
- package/lib/{hook-hEqe7fPB.js.map → hook-DgGeo5iL.js.map} +1 -1
- package/lib/{index-CkwDvuPt.js → index-CBXSgjaE.js} +259 -238
- package/lib/index-CBXSgjaE.js.map +1 -0
- package/lib/index-CPNSgwSb.js +36 -0
- package/lib/index-CPNSgwSb.js.map +1 -0
- package/lib/index-DStSNvP-.js +1284 -0
- package/lib/index-DStSNvP-.js.map +1 -0
- package/lib/index-LNp6rxyU.js.map +1 -1
- package/lib/index.esm-BSV1C092.js +692 -0
- package/lib/index.esm-BSV1C092.js.map +1 -0
- package/lib/index.esm-BnnBRKJX.js +1214 -0
- package/lib/index.esm-BnnBRKJX.js.map +1 -0
- package/lib/invariant-Caa8-XvF.js.map +1 -1
- package/lib/jsx-runtime-Dx-03ztt.js +446 -0
- package/lib/jsx-runtime-Dx-03ztt.js.map +1 -0
- package/lib/object_hash-BNWPnMN9.js +787 -0
- package/lib/object_hash-BNWPnMN9.js.map +1 -0
- package/lib/post-processors/removeExtensions.js.map +1 -1
- package/lib/post-processors/removePaths.js.map +1 -1
- package/lib/post-processors/traverse.js.map +1 -1
- package/lib/prism-csharp.min-DUwvItt4.js +63 -0
- package/lib/{prism-csharp.min-Yizuc34Y.js.map → prism-csharp.min-DUwvItt4.js.map} +1 -1
- package/lib/prism-java.min-BtgBR4yd.js +35 -0
- package/lib/{prism-java.min-d5iT_mOd.js.map → prism-java.min-BtgBR4yd.js.map} +1 -1
- package/lib/prism-markup-BNGj0Tvm.js.map +1 -1
- package/lib/prism-ruby.min-DeDXCp1r.js +38 -0
- package/lib/{prism-ruby.min-C7LwcKyz.js.map → prism-ruby.min-DeDXCp1r.js.map} +1 -1
- package/lib/prism-typescript.min-CD7H2IYQ.js +34 -0
- package/lib/{prism-typescript.min-oSVeWCAd.js.map → prism-typescript.min-CD7H2IYQ.js.map} +1 -1
- package/lib/state-CFQsUZUP.js +202 -0
- package/lib/state-CFQsUZUP.js.map +1 -0
- package/lib/ui/Accordion.js +2 -2
- package/lib/ui/Accordion.js.map +1 -1
- package/lib/ui/ActionButton.js +4 -4
- package/lib/ui/ActionButton.js.map +1 -1
- package/lib/ui/Alert.js +3 -3
- package/lib/ui/Alert.js.map +1 -1
- package/lib/ui/AlertDialog.js +2 -2
- package/lib/ui/AlertDialog.js.map +1 -1
- package/lib/ui/Badge.js +3 -3
- package/lib/ui/Badge.js.map +1 -1
- package/lib/ui/Breadcrumb.js +2 -2
- package/lib/ui/Breadcrumb.js.map +1 -1
- package/lib/ui/Button.js +3 -3
- package/lib/ui/Button.js.map +1 -1
- package/lib/ui/Callout.js +2 -2
- package/lib/ui/Callout.js.map +1 -1
- package/lib/ui/Card.js +2 -2
- package/lib/ui/Card.js.map +1 -1
- package/lib/ui/Carousel.js +407 -401
- package/lib/ui/Carousel.js.map +1 -1
- package/lib/ui/Checkbox.js +2 -2
- package/lib/ui/Checkbox.js.map +1 -1
- package/lib/ui/Command.js +111 -108
- package/lib/ui/Command.js.map +1 -1
- package/lib/ui/Dialog.js +2 -2
- package/lib/ui/Dialog.js.map +1 -1
- package/lib/ui/Drawer.js +81 -81
- package/lib/ui/Drawer.js.map +1 -1
- package/lib/ui/DropdownMenu.js +2 -2
- package/lib/ui/DropdownMenu.js.map +1 -1
- package/lib/ui/Form.js +3 -3
- package/lib/ui/Form.js.map +1 -1
- package/lib/ui/HoverCard.js +2 -2
- package/lib/ui/Input.js +2 -2
- package/lib/ui/Input.js.map +1 -1
- package/lib/ui/Label.js +3 -3
- package/lib/ui/Pagination.js +2 -2
- package/lib/ui/Pagination.js.map +1 -1
- package/lib/ui/Popover.js +2 -2
- package/lib/ui/Popover.js.map +1 -1
- package/lib/ui/Progress.js +2 -2
- package/lib/ui/Progress.js.map +1 -1
- package/lib/ui/RadioGroup.js +2 -2
- package/lib/ui/RadioGroup.js.map +1 -1
- package/lib/ui/ScrollArea.js +2 -2
- package/lib/ui/ScrollArea.js.map +1 -1
- package/lib/ui/Select.js +2 -2
- package/lib/ui/Select.js.map +1 -1
- package/lib/ui/Skeleton.js +2 -2
- package/lib/ui/Skeleton.js.map +1 -1
- package/lib/ui/Slider.js +2 -2
- package/lib/ui/Switch.js +2 -2
- package/lib/ui/Switch.js.map +1 -1
- package/lib/ui/Tabs.js +2 -2
- package/lib/ui/Textarea.js +2 -2
- package/lib/ui/Textarea.js.map +1 -1
- package/lib/ui/Toggle.js +3 -3
- package/lib/ui/Toggle.js.map +1 -1
- package/lib/ui/ToggleGroup.js +2 -2
- package/lib/ui/ToggleGroup.js.map +1 -1
- package/lib/ui/Tooltip.js +2 -2
- package/lib/useExposedProps-DE9lR6MF.js +9 -0
- package/lib/useExposedProps-DE9lR6MF.js.map +1 -0
- package/lib/{utils-DcpDOncX.js → utils-B4O1uet5.js} +35 -36
- package/lib/{utils-DcpDOncX.js.map → utils-B4O1uet5.js.map} +1 -1
- package/lib/zudoku.auth-auth0.js +1 -1
- package/lib/zudoku.auth-auth0.js.map +1 -1
- package/lib/zudoku.auth-clerk.js +2 -2
- package/lib/zudoku.auth-clerk.js.map +1 -1
- package/lib/zudoku.auth-openid.js +382 -374
- package/lib/zudoku.auth-openid.js.map +1 -1
- package/lib/zudoku.components.js +773 -992
- package/lib/zudoku.components.js.map +1 -1
- package/lib/zudoku.openapi-worker.js +1 -1
- package/lib/zudoku.openapi-worker.js.map +1 -1
- package/lib/zudoku.plugin-api-catalog.js +123 -0
- package/lib/zudoku.plugin-api-catalog.js.map +1 -0
- package/lib/zudoku.plugin-api-keys.js +15 -16
- package/lib/zudoku.plugin-api-keys.js.map +1 -1
- package/lib/zudoku.plugin-custom-pages.js +4 -4
- package/lib/zudoku.plugin-custom-pages.js.map +1 -1
- package/lib/zudoku.plugin-markdown.js +2 -2
- package/lib/zudoku.plugin-markdown.js.map +1 -1
- package/lib/zudoku.plugin-openapi.js +5 -5
- package/lib/zudoku.plugin-redirect.js +1 -1
- package/lib/zudoku.plugin-redirect.js.map +1 -1
- package/lib/zudoku.plugin-search-inkeep.js +53 -24
- package/lib/zudoku.plugin-search-inkeep.js.map +1 -1
- package/package.json +59 -47
- package/src/app/demo.tsx +1 -1
- package/src/app/entry.client.tsx +16 -15
- package/src/app/entry.server.tsx +3 -2
- package/src/app/main.tsx +6 -2
- package/src/app/sentry.ts +24 -0
- package/src/app/standalone.tsx +1 -1
- package/src/app/tailwind.ts +67 -52
- package/src/lib/authentication/components/CallbackHandler.tsx +1 -1
- package/src/lib/authentication/components/SignIn.tsx +1 -1
- package/src/lib/authentication/components/SignOut.tsx +1 -1
- package/src/lib/authentication/providers/openid.tsx +12 -5
- package/src/lib/components/AnchorLink.tsx +1 -1
- package/src/lib/components/Bootstrap.tsx +4 -6
- package/src/lib/components/Header.tsx +2 -2
- package/src/lib/components/Heading.tsx +13 -13
- package/src/lib/components/Layout.tsx +10 -5
- package/src/lib/components/Markdown.tsx +1 -1
- package/src/lib/components/MobileTopNavigation.tsx +18 -18
- package/src/lib/components/NotFoundPage.tsx +1 -1
- package/src/lib/components/ReactMarkdown.license.txt +21 -0
- package/src/lib/components/ReactMarkdown.tsx +264 -0
- package/src/lib/components/Search.tsx +3 -3
- package/src/lib/components/SlotletProvider.tsx +1 -1
- package/src/lib/components/SyntaxHighlight.tsx +0 -4
- package/src/lib/components/TopNavigation.tsx +2 -2
- package/src/lib/components/Zudoku.tsx +1 -1
- package/src/lib/components/context/ZudokuContext.ts +1 -1
- package/src/lib/components/index.ts +1 -1
- package/src/lib/components/navigation/Sidebar.tsx +18 -8
- package/src/lib/components/navigation/SidebarBadge.tsx +0 -10
- package/src/lib/components/navigation/SidebarCategory.tsx +11 -10
- package/src/lib/components/navigation/SidebarItem.tsx +11 -14
- package/src/lib/components/navigation/SidebarWrapper.tsx +1 -1
- package/src/lib/components/navigation/utils.ts +1 -1
- package/src/lib/core/ZudokuContext.ts +1 -1
- package/src/lib/core/plugins.ts +3 -7
- package/src/lib/errors/RouterError.tsx +1 -1
- package/src/lib/oas/graphql/index.ts +4 -1
- package/src/lib/plugins/api-catalog/Catalog.tsx +123 -0
- package/src/lib/plugins/api-catalog/index.tsx +64 -0
- package/src/lib/plugins/api-keys/CreateApiKey.tsx +1 -1
- package/src/lib/plugins/api-keys/ProtectedRoute.tsx +1 -1
- package/src/lib/plugins/api-keys/SettingsApiKeys.tsx +1 -1
- package/src/lib/plugins/api-keys/index.tsx +1 -1
- package/src/lib/plugins/custom-pages/index.tsx +1 -1
- package/src/lib/plugins/markdown/MdxPage.tsx +3 -1
- package/src/lib/plugins/markdown/index.tsx +4 -2
- package/src/lib/plugins/markdown/resolver.ts +2 -4
- package/src/lib/plugins/openapi/OperationList.tsx +64 -8
- package/src/lib/plugins/openapi/OperationListItem.tsx +31 -2
- package/src/lib/plugins/openapi/Route.tsx +45 -9
- package/src/lib/plugins/openapi/Sidecar.tsx +3 -17
- package/src/lib/plugins/openapi/context.tsx +2 -2
- package/src/lib/plugins/openapi/graphql/gql.ts +2 -2
- package/src/lib/plugins/openapi/graphql/graphql.ts +3 -0
- package/src/lib/plugins/openapi/index.tsx +35 -28
- package/src/lib/plugins/openapi/interfaces.ts +22 -1
- package/src/lib/plugins/openapi/playground/PathParams.tsx +1 -0
- package/src/lib/plugins/openapi/util/methodToColor.ts +27 -0
- package/src/lib/plugins/openapi/util/sanitizeMarkdownForMetatag.tsx +32 -0
- package/src/lib/plugins/redirect/index.tsx +2 -2
- package/src/lib/plugins/search-inkeep/index.tsx +78 -23
- package/src/lib/plugins/search-inkeep/inkeep.ts +3 -9
- package/src/lib/util/MdxComponents.tsx +3 -8
- package/src/lib/util/createVariantComponent.tsx +2 -2
- package/src/lib/util/useExposedProps.tsx +1 -1
- package/src/lib/util/useScrollToAnchor.ts +1 -1
- package/src/lib/util/useScrollToTop.ts +1 -1
- package/dist/lib/plugins/search-inkeep/InkeepCustomTrigger.d.ts +0 -2
- package/dist/lib/plugins/search-inkeep/InkeepCustomTrigger.js +0 -3
- package/dist/lib/plugins/search-inkeep/InkeepCustomTrigger.js.map +0 -1
- package/dist/vite/plugin-custom-css.js.map +0 -1
- package/lib/AnchorLink-CDlhr8gL.js +0 -706
- package/lib/AnchorLink-CDlhr8gL.js.map +0 -1
- package/lib/AuthenticationPlugin-D0Em0SwR.js.map +0 -1
- package/lib/InkeepCustomTrigger-CE5-K5ex.js +0 -6
- package/lib/InkeepCustomTrigger-CE5-K5ex.js.map +0 -1
- package/lib/Markdown-ievDDhFT.js.map +0 -1
- package/lib/MdxPage-B2FpJ9KC.js.map +0 -1
- package/lib/OperationList-BkNQEsNs.js +0 -4693
- package/lib/OperationList-BkNQEsNs.js.map +0 -1
- package/lib/Route-DlG_HTMu.js +0 -11
- package/lib/Route-DlG_HTMu.js.map +0 -1
- package/lib/SidebarBadge-DxFJcJ6V.js +0 -51
- package/lib/SidebarBadge-DxFJcJ6V.js.map +0 -1
- package/lib/SlotletProvider-DyomlzGx.js +0 -252
- package/lib/SlotletProvider-DyomlzGx.js.map +0 -1
- package/lib/assets/index-B_Jk_Yzp.js.map +0 -1
- package/lib/assets/worker-BHClFO3A.js.map +0 -1
- package/lib/cn-BmFQLtkS.js.map +0 -1
- package/lib/context-D1nXWxm7.js.map +0 -1
- package/lib/createServer-CpJlUPtn.js.map +0 -1
- package/lib/index-BuAyrJe3.js +0 -46
- package/lib/index-BuAyrJe3.js.map +0 -1
- package/lib/index-C7SaIME0.js +0 -1277
- package/lib/index-C7SaIME0.js.map +0 -1
- package/lib/index-CkwDvuPt.js.map +0 -1
- package/lib/index-Czzd9rjU.js +0 -899
- package/lib/index-Czzd9rjU.js.map +0 -1
- package/lib/index-Yn8c3UWE.js +0 -921
- package/lib/index-Yn8c3UWE.js.map +0 -1
- package/lib/index.esm-C5mr_sKO.js +0 -1193
- package/lib/index.esm-C5mr_sKO.js.map +0 -1
- package/lib/jsx-runtime-B6kdoens.js +0 -635
- package/lib/jsx-runtime-B6kdoens.js.map +0 -1
- package/lib/object_hash-CvlLgU-M.js +0 -785
- package/lib/object_hash-CvlLgU-M.js.map +0 -1
- package/lib/prism-csharp.min-Yizuc34Y.js +0 -35
- package/lib/prism-java.min-d5iT_mOd.js +0 -7
- package/lib/prism-markup-templating-DZrrEs0A.js +0 -62
- package/lib/prism-markup-templating-DZrrEs0A.js.map +0 -1
- package/lib/prism-php.min-o7FpoMP_.js +0 -11
- package/lib/prism-php.min-o7FpoMP_.js.map +0 -1
- package/lib/prism-ruby.min-C7LwcKyz.js +0 -10
- package/lib/prism-typescript.min-oSVeWCAd.js +0 -6
- package/lib/router-lfyopgBI.js +0 -3024
- package/lib/router-lfyopgBI.js.map +0 -1
- package/lib/state-tsXBLONe.js +0 -203
- package/lib/state-tsXBLONe.js.map +0 -1
- package/lib/useExposedProps-CTPtylCV.js +0 -10
- package/lib/useExposedProps-CTPtylCV.js.map +0 -1
- package/src/lib/plugins/search-inkeep/InkeepCustomTrigger.tsx +0 -3
|
@@ -1,6 +1,6 @@
|
|
|
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, useSearchParams } from "react-router";
|
|
4
4
|
|
|
5
5
|
import type { SidebarItem as SidebarItemType } from "../../../config/validators/SidebarSchema.js";
|
|
6
6
|
import { joinPath } from "../../util/joinPath.js";
|
|
@@ -13,10 +13,6 @@ export const navigationListItem = cva(
|
|
|
13
13
|
"flex items-center gap-2 px-[--padding-nav-item] py-1.5 rounded-lg hover:bg-accent transition-colors duration-300",
|
|
14
14
|
{
|
|
15
15
|
variants: {
|
|
16
|
-
isTopLevel: {
|
|
17
|
-
true: "font-medium -mx-[--padding-nav-item]",
|
|
18
|
-
false: "-mr-[--padding-nav-item] ml-[--padding-nav-item]",
|
|
19
|
-
},
|
|
20
16
|
isActive: {
|
|
21
17
|
true: "text-primary font-medium",
|
|
22
18
|
false: "text-foreground/80",
|
|
@@ -36,25 +32,25 @@ export const DATA_ANCHOR_ATTR = "data-anchor";
|
|
|
36
32
|
|
|
37
33
|
export const SidebarItem = ({
|
|
38
34
|
item,
|
|
39
|
-
|
|
35
|
+
onRequestClose,
|
|
40
36
|
}: {
|
|
41
37
|
item: SidebarItemType;
|
|
42
|
-
|
|
43
|
-
level?: number;
|
|
38
|
+
onRequestClose?: () => void;
|
|
44
39
|
}) => {
|
|
45
40
|
const { activeAnchor } = useViewportAnchor();
|
|
46
41
|
const [searchParams] = useSearchParams();
|
|
47
42
|
|
|
48
43
|
switch (item.type) {
|
|
49
44
|
case "category":
|
|
50
|
-
return
|
|
45
|
+
return (
|
|
46
|
+
<SidebarCategory category={item} onRequestClose={onRequestClose} />
|
|
47
|
+
);
|
|
51
48
|
case "doc":
|
|
52
49
|
return (
|
|
53
50
|
<NavLink
|
|
54
|
-
className={({ isActive }) =>
|
|
55
|
-
navigationListItem({ isActive, isTopLevel: level === 0 })
|
|
56
|
-
}
|
|
51
|
+
className={({ isActive }) => navigationListItem({ isActive })}
|
|
57
52
|
to={joinPath(item.id)}
|
|
53
|
+
onClick={onRequestClose}
|
|
58
54
|
>
|
|
59
55
|
{item.icon && <item.icon size={16} className="align-[-0.125em]" />}
|
|
60
56
|
{item.badge ? (
|
|
@@ -76,9 +72,9 @@ export const SidebarItem = ({
|
|
|
76
72
|
{...{ [DATA_ANCHOR_ATTR]: item.href.slice(1) }}
|
|
77
73
|
className={navigationListItem({
|
|
78
74
|
isActive: item.href.slice(1) === activeAnchor,
|
|
79
|
-
isTopLevel: level === 0,
|
|
80
75
|
className: item.badge?.placement !== "start" && "justify-between",
|
|
81
76
|
})}
|
|
77
|
+
onClick={onRequestClose}
|
|
82
78
|
>
|
|
83
79
|
{item.badge ? (
|
|
84
80
|
<>
|
|
@@ -111,10 +107,11 @@ export const SidebarItem = ({
|
|
|
111
107
|
</NavLink>
|
|
112
108
|
) : (
|
|
113
109
|
<a
|
|
114
|
-
className={navigationListItem(
|
|
110
|
+
className={navigationListItem()}
|
|
115
111
|
href={item.href}
|
|
116
112
|
target="_blank"
|
|
117
113
|
rel="noopener noreferrer"
|
|
114
|
+
onClick={onRequestClose}
|
|
118
115
|
>
|
|
119
116
|
<span className="whitespace-normal">{item.label}</span>
|
|
120
117
|
{/* This prevents that the icon would be positioned in its own line if the text fills a line entirely */}
|
|
@@ -13,7 +13,7 @@ export const SidebarWrapper = forwardRef<
|
|
|
13
13
|
data-navigation={String(pushMainContent)}
|
|
14
14
|
className={cn(
|
|
15
15
|
"scrollbar peer hidden lg:flex flex-col fixed text-sm overflow-y-auto shrink-0",
|
|
16
|
-
"
|
|
16
|
+
"-mx-[--padding-nav-item] pb-20 mt-[--padding-content-top]",
|
|
17
17
|
"w-[--side-nav-width] h-[calc(100%-var(--header-height))] scroll-pt-2 gap-2",
|
|
18
18
|
className,
|
|
19
19
|
)}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ReactNode } from "react";
|
|
2
|
+
import { TopNavigationItem } from "../../config/validators/common.js";
|
|
2
3
|
import type { SidebarConfig } from "../../config/validators/SidebarSchema.js";
|
|
3
|
-
import { TopNavigationItem } from "../../config/validators/validate.js";
|
|
4
4
|
import { type AuthenticationProvider } from "../authentication/authentication.js";
|
|
5
5
|
import type { ComponentsContextType } from "../components/context/ComponentsContext.js";
|
|
6
6
|
import { Slotlets } from "../components/SlotletProvider.js";
|
package/src/lib/core/plugins.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { LucideIcon } from "lucide-react";
|
|
2
2
|
import { type ReactElement } from "react";
|
|
3
|
-
import { type RouteObject } from "react-router
|
|
3
|
+
import { type RouteObject } from "react-router";
|
|
4
4
|
import type { Sidebar } from "../../config/validators/SidebarSchema.js";
|
|
5
5
|
import { MdxComponentsType } from "../util/MdxComponents.js";
|
|
6
6
|
import { ZudokuContext, type ApiIdentity } from "./ZudokuContext.js";
|
|
@@ -40,11 +40,7 @@ export type ProfileNavigationItem = {
|
|
|
40
40
|
weight?: number;
|
|
41
41
|
category?: "top" | "middle" | "bottom";
|
|
42
42
|
children?: ProfileNavigationItem[];
|
|
43
|
-
icon?:
|
|
44
|
-
LucideProps & {
|
|
45
|
-
[key: string]: any;
|
|
46
|
-
}
|
|
47
|
-
>;
|
|
43
|
+
icon?: LucideIcon;
|
|
48
44
|
};
|
|
49
45
|
|
|
50
46
|
export interface CommonPlugin {
|
|
@@ -390,6 +390,10 @@ const Schema = builder.objectRef<OpenAPIDocument>("Schema").implement({
|
|
|
390
390
|
resolve: (root) => root.info.description,
|
|
391
391
|
nullable: true,
|
|
392
392
|
}),
|
|
393
|
+
summary: t.string({
|
|
394
|
+
resolve: (root) => root.info.summary,
|
|
395
|
+
nullable: true,
|
|
396
|
+
}),
|
|
393
397
|
paths: t.field({
|
|
394
398
|
type: [PathItem],
|
|
395
399
|
resolve: (root) =>
|
|
@@ -439,7 +443,6 @@ const SchemaSource = builder.enumType("SchemaType", {
|
|
|
439
443
|
|
|
440
444
|
builder.queryType({
|
|
441
445
|
fields: (t) => ({
|
|
442
|
-
// https://tan-cow-main-bce8a06.d2.zuplo.dev/openapi
|
|
443
446
|
schema: t.field({
|
|
444
447
|
type: Schema,
|
|
445
448
|
args: {
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import slugify from "@sindresorhus/slugify";
|
|
2
|
+
import { useSuspenseQuery } from "@tanstack/react-query";
|
|
3
|
+
import { useSearchParams } from "react-router";
|
|
4
|
+
import { Head, Link } from "zudoku/components";
|
|
5
|
+
import { useAuthState } from "../../authentication/state.js";
|
|
6
|
+
import { Markdown } from "../../components/Markdown.js";
|
|
7
|
+
import { cn } from "../../util/cn.js";
|
|
8
|
+
import type { ApiCatalogPluginOptions } from "./index.js";
|
|
9
|
+
|
|
10
|
+
const getKey = (category: string, tag: string) => slugify(`${category}-${tag}`);
|
|
11
|
+
|
|
12
|
+
export const Catalog = ({
|
|
13
|
+
items,
|
|
14
|
+
filterCatalogItems = (items) => items,
|
|
15
|
+
categories,
|
|
16
|
+
label = "API Library",
|
|
17
|
+
}: Omit<ApiCatalogPluginOptions, "navigationId">) => {
|
|
18
|
+
const [searchParams, setSearchParams] = useSearchParams();
|
|
19
|
+
const activeCategory = searchParams.get("category");
|
|
20
|
+
const auth = useAuthState();
|
|
21
|
+
|
|
22
|
+
const catalogItems = useSuspenseQuery({
|
|
23
|
+
queryFn: () => filterCatalogItems(items, { auth }),
|
|
24
|
+
queryKey: ["catalogItems", auth],
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
return (
|
|
28
|
+
<section className="pt-[--padding-content-top] pb-[--padding-content-bottom]">
|
|
29
|
+
<Head>
|
|
30
|
+
<title>{label}</title>
|
|
31
|
+
</Head>
|
|
32
|
+
<div className="grid grid-cols-12 gap-12">
|
|
33
|
+
<div className="flex flex-col gap-4 col-span-3 not-prose sticky top-48">
|
|
34
|
+
<div className="max-w-[--side-nav-width] flex flex-col gap-4 justify-between">
|
|
35
|
+
{categories?.map((category, idx) => (
|
|
36
|
+
<div key={category.label}>
|
|
37
|
+
<div className="flex justify-between mb-2.5">
|
|
38
|
+
<span className="font-medium text-sm">{category.label}</span>
|
|
39
|
+
{idx === 0 && activeCategory && (
|
|
40
|
+
<button
|
|
41
|
+
type="button"
|
|
42
|
+
className="text-end text-sm text-foreground/60 hover:text-foreground"
|
|
43
|
+
onClick={() => setSearchParams({})}
|
|
44
|
+
>
|
|
45
|
+
Clear
|
|
46
|
+
</button>
|
|
47
|
+
)}
|
|
48
|
+
</div>
|
|
49
|
+
<ul className="space-y-1 [&>li]:py-2">
|
|
50
|
+
{category.tags
|
|
51
|
+
.map((tag) => ({
|
|
52
|
+
tag,
|
|
53
|
+
count: items.filter((api) =>
|
|
54
|
+
api.categories.find((c) => c.tags.includes(tag)),
|
|
55
|
+
).length,
|
|
56
|
+
}))
|
|
57
|
+
.map(({ tag, count }) => {
|
|
58
|
+
const slug = getKey(category.label, tag);
|
|
59
|
+
const isActive = slug === activeCategory;
|
|
60
|
+
|
|
61
|
+
return (
|
|
62
|
+
<li
|
|
63
|
+
key={slug}
|
|
64
|
+
className={cn(
|
|
65
|
+
"flex rounded-lg justify-between text-sm cursor-pointer hover:text-primary transition px-[--padding-nav-item] -mx-[--padding-nav-item]",
|
|
66
|
+
isActive && "bg-border/30 rounded",
|
|
67
|
+
)}
|
|
68
|
+
onClick={() => setSearchParams({ category: slug })}
|
|
69
|
+
>
|
|
70
|
+
<span>{tag}</span>
|
|
71
|
+
<span
|
|
72
|
+
className={cn(
|
|
73
|
+
"flex items-center justify-center border rounded-md w-8 text-xs font-semibold",
|
|
74
|
+
isActive &&
|
|
75
|
+
"bg-primary border-primary text-primary-foreground",
|
|
76
|
+
)}
|
|
77
|
+
>
|
|
78
|
+
{count}
|
|
79
|
+
</span>
|
|
80
|
+
</li>
|
|
81
|
+
);
|
|
82
|
+
})}
|
|
83
|
+
</ul>
|
|
84
|
+
</div>
|
|
85
|
+
))}
|
|
86
|
+
</div>
|
|
87
|
+
</div>
|
|
88
|
+
<div className="col-span-9">
|
|
89
|
+
<h3 className="mt-0 text-2xl font-bold mb-4">{label}</h3>
|
|
90
|
+
|
|
91
|
+
<div className="grid grid-cols-2 gap-4">
|
|
92
|
+
{catalogItems.data
|
|
93
|
+
.filter(
|
|
94
|
+
(api) =>
|
|
95
|
+
!activeCategory ||
|
|
96
|
+
api.categories.find((c) =>
|
|
97
|
+
c.tags.find((t) => getKey(c.label, t) === activeCategory),
|
|
98
|
+
),
|
|
99
|
+
)
|
|
100
|
+
.map((api) => (
|
|
101
|
+
<Link
|
|
102
|
+
to={{
|
|
103
|
+
pathname: `/${api.path}`,
|
|
104
|
+
search: activeCategory ? `category=${activeCategory}` : "",
|
|
105
|
+
}}
|
|
106
|
+
className="no-underline hover:!text-foreground"
|
|
107
|
+
key={api.path}
|
|
108
|
+
>
|
|
109
|
+
<div className="border h-full rounded p-4 flex flex-col gap-2 cursor-pointer hover:bg-border/20 font-normal">
|
|
110
|
+
<span className="font-semibold">{api.label}</span>
|
|
111
|
+
<Markdown
|
|
112
|
+
className="text-sm whitespace-pre-wrap mb-6 line-clamp-2"
|
|
113
|
+
content={api.description}
|
|
114
|
+
/>
|
|
115
|
+
</div>
|
|
116
|
+
</Link>
|
|
117
|
+
))}
|
|
118
|
+
</div>
|
|
119
|
+
</div>
|
|
120
|
+
</div>
|
|
121
|
+
</section>
|
|
122
|
+
);
|
|
123
|
+
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { AuthState } from "../../authentication/state.js";
|
|
2
|
+
import type { ZudokuPlugin } from "../../core/plugins.js";
|
|
3
|
+
import { Catalog } from "./Catalog.js";
|
|
4
|
+
|
|
5
|
+
export type ApiCatalogItem = {
|
|
6
|
+
path: string;
|
|
7
|
+
label: string;
|
|
8
|
+
description: string;
|
|
9
|
+
categories: CatalogCategory[];
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export type CatalogCategory = {
|
|
13
|
+
label: string;
|
|
14
|
+
tags: string[];
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export type ApiCatalogPluginOptions = {
|
|
18
|
+
navigationId: string;
|
|
19
|
+
label: string;
|
|
20
|
+
categories?: CatalogCategory[];
|
|
21
|
+
items: ApiCatalogItem[];
|
|
22
|
+
filterCatalogItems?: filterCatalogItems;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export type CatalogContext<ProviderData = unknown> = {
|
|
26
|
+
auth: AuthState<ProviderData>;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export type filterCatalogItems<ProviderData = unknown> = (
|
|
30
|
+
items: ApiCatalogItem[],
|
|
31
|
+
{ auth }: CatalogContext<ProviderData>,
|
|
32
|
+
) => ApiCatalogItem[];
|
|
33
|
+
|
|
34
|
+
export const apiCatalogPlugin = ({
|
|
35
|
+
navigationId,
|
|
36
|
+
items,
|
|
37
|
+
label,
|
|
38
|
+
categories,
|
|
39
|
+
filterCatalogItems,
|
|
40
|
+
}: {
|
|
41
|
+
navigationId: string;
|
|
42
|
+
label: string;
|
|
43
|
+
categories?: CatalogCategory[];
|
|
44
|
+
items: ApiCatalogItem[];
|
|
45
|
+
filterCatalogItems?: filterCatalogItems;
|
|
46
|
+
}): ZudokuPlugin => {
|
|
47
|
+
return {
|
|
48
|
+
getRoutes: () => {
|
|
49
|
+
return [
|
|
50
|
+
{
|
|
51
|
+
path: navigationId,
|
|
52
|
+
element: (
|
|
53
|
+
<Catalog
|
|
54
|
+
label={label}
|
|
55
|
+
items={items}
|
|
56
|
+
filterCatalogItems={filterCatalogItems}
|
|
57
|
+
categories={categories ?? []}
|
|
58
|
+
/>
|
|
59
|
+
),
|
|
60
|
+
},
|
|
61
|
+
];
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
};
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
TrashIcon,
|
|
13
13
|
} from "lucide-react";
|
|
14
14
|
import { useState } from "react";
|
|
15
|
-
import { Link } from "react-router
|
|
15
|
+
import { Link } from "react-router";
|
|
16
16
|
import { useZudoku } from "../../components/context/ZudokuContext.js";
|
|
17
17
|
import { Slotlet } from "../../components/SlotletProvider.js";
|
|
18
18
|
import { Button } from "../../ui/Button.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ComponentType, type ReactNode } from "react";
|
|
2
|
-
import type { RouteObject } from "react-router
|
|
2
|
+
import type { RouteObject } from "react-router";
|
|
3
3
|
import { type ExposedComponentProps } from "../../components/SlotletProvider.js";
|
|
4
4
|
import type { NavigationPlugin, ZudokuPlugin } from "../../core/plugins.js";
|
|
5
5
|
import { CustomPage } from "./CustomPage.js";
|
|
@@ -2,7 +2,7 @@ import { useMDXComponents } from "@mdx-js/react";
|
|
|
2
2
|
import slugify from "@sindresorhus/slugify";
|
|
3
3
|
import { Helmet } from "@zudoku/react-helmet-async";
|
|
4
4
|
import { type PropsWithChildren, useEffect } from "react";
|
|
5
|
-
import { Link } from "react-router
|
|
5
|
+
import { Link } from "react-router";
|
|
6
6
|
import { CategoryHeading } from "../../components/CategoryHeading.js";
|
|
7
7
|
import { Heading } from "../../components/Heading.js";
|
|
8
8
|
import { ProseClasses } from "../../components/Markdown.js";
|
|
@@ -42,6 +42,7 @@ export const MdxPage = ({
|
|
|
42
42
|
frontmatter = {},
|
|
43
43
|
defaultOptions,
|
|
44
44
|
tableOfContents,
|
|
45
|
+
excerpt,
|
|
45
46
|
}: PropsWithChildren<
|
|
46
47
|
Omit<MDXImport, "default"> & {
|
|
47
48
|
file: string;
|
|
@@ -85,6 +86,7 @@ export const MdxPage = ({
|
|
|
85
86
|
<div className="xl:grid grid-cols-[--sidecar-grid-cols] gap-8 justify-between">
|
|
86
87
|
<Helmet>
|
|
87
88
|
<title>{pageTitle}</title>
|
|
89
|
+
{excerpt && <meta name="description" content={excerpt} />}
|
|
88
90
|
</Helmet>
|
|
89
91
|
<div
|
|
90
92
|
className={cn(
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { Toc } from "@stefanprobst/rehype-extract-toc";
|
|
2
2
|
import type { MDXProps } from "mdx/types.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { type JSX } from "react";
|
|
4
|
+
import { RouteObject } from "react-router";
|
|
5
|
+
import { ZudokuDocsConfig } from "../../../config/validators/common.js";
|
|
5
6
|
import type { ZudokuPlugin } from "../../core/plugins.js";
|
|
6
7
|
import { DocResolver } from "./resolver.js";
|
|
7
8
|
|
|
@@ -24,6 +25,7 @@ export type Frontmatter = {
|
|
|
24
25
|
export type MDXImport = {
|
|
25
26
|
tableOfContents: Toc;
|
|
26
27
|
frontmatter: Frontmatter;
|
|
28
|
+
excerpt?: string;
|
|
27
29
|
default: (props: MDXProps) => JSX.Element;
|
|
28
30
|
};
|
|
29
31
|
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import fs from "fs";
|
|
2
2
|
import path from "path";
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
ZudokuDocsConfig,
|
|
6
|
-
} from "../../../config/validators/validate.js";
|
|
3
|
+
import { ZudokuDocsConfig } from "../../../config/validators/common.js";
|
|
4
|
+
import { ZudokuConfig } from "../../../config/validators/validate.js";
|
|
7
5
|
|
|
8
6
|
const DEFAULT_DOCS_FILES = "/pages/**/*.{md,mdx}";
|
|
9
7
|
|
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
import { ResultOf } from "@graphql-typed-document-node/core";
|
|
2
2
|
import { useSuspenseQuery } from "@tanstack/react-query";
|
|
3
|
+
import { Helmet } from "@zudoku/react-helmet-async";
|
|
4
|
+
import { useNavigate } from "react-router";
|
|
5
|
+
import {
|
|
6
|
+
Select,
|
|
7
|
+
SelectContent,
|
|
8
|
+
SelectItem,
|
|
9
|
+
SelectTrigger,
|
|
10
|
+
SelectValue,
|
|
11
|
+
} from "zudoku/ui/Select.js";
|
|
12
|
+
import { useSelectedServerStore } from "../../authentication/state.js";
|
|
3
13
|
import { CategoryHeading } from "../../components/CategoryHeading.js";
|
|
4
14
|
import { Heading } from "../../components/Heading.js";
|
|
5
15
|
import { Markdown, ProseClasses } from "../../components/Markdown.js";
|
|
@@ -10,6 +20,7 @@ import StaggeredRender from "./StaggeredRender.js";
|
|
|
10
20
|
import { useCreateQuery } from "./client/useCreateQuery.js";
|
|
11
21
|
import { useOasConfig } from "./context.js";
|
|
12
22
|
import { graphql } from "./graphql/index.js";
|
|
23
|
+
import { sanitizeMarkdownForMetatag } from "./util/sanitizeMarkdownForMetatag.js";
|
|
13
24
|
|
|
14
25
|
export const OperationsFragment = graphql(/* GraphQL */ `
|
|
15
26
|
fragment OperationsFragment on OperationItem {
|
|
@@ -81,6 +92,7 @@ const AllOperationsQuery = graphql(/* GraphQL */ `
|
|
|
81
92
|
query AllOperations($input: JSON!, $type: SchemaType!) {
|
|
82
93
|
schema(input: $input, type: $type) {
|
|
83
94
|
description
|
|
95
|
+
summary
|
|
84
96
|
title
|
|
85
97
|
url
|
|
86
98
|
version
|
|
@@ -97,30 +109,73 @@ const AllOperationsQuery = graphql(/* GraphQL */ `
|
|
|
97
109
|
`);
|
|
98
110
|
|
|
99
111
|
export const OperationList = () => {
|
|
100
|
-
const { input, type } = useOasConfig();
|
|
112
|
+
const { input, type, versions, version } = useOasConfig();
|
|
101
113
|
const query = useCreateQuery(AllOperationsQuery, { input, type });
|
|
114
|
+
const { selectedServer } = useSelectedServerStore();
|
|
102
115
|
const result = useSuspenseQuery(query);
|
|
116
|
+
const title = result.data.schema.title;
|
|
117
|
+
const summary = result.data.schema.summary;
|
|
118
|
+
const description = result.data.schema.description;
|
|
119
|
+
const navigate = useNavigate();
|
|
120
|
+
|
|
121
|
+
// The summary property is preferable here as it is a short description of
|
|
122
|
+
// the API, whereas the description property is typically longer and supports
|
|
123
|
+
// commonmark formatting, making it ill-suited for use in the meta description
|
|
124
|
+
const metaDescription = summary
|
|
125
|
+
? summary
|
|
126
|
+
: description
|
|
127
|
+
? sanitizeMarkdownForMetatag(description)
|
|
128
|
+
: undefined;
|
|
103
129
|
|
|
104
130
|
return (
|
|
105
131
|
<div className="pt-[--padding-content-top]">
|
|
132
|
+
<Helmet>
|
|
133
|
+
<title>{title}</title>
|
|
134
|
+
{metaDescription && (
|
|
135
|
+
<meta name="description" content={metaDescription} />
|
|
136
|
+
)}
|
|
137
|
+
</Helmet>
|
|
106
138
|
<div
|
|
107
139
|
className={cn(ProseClasses, "mb-16 max-w-full prose-img:max-w-prose")}
|
|
108
140
|
>
|
|
109
|
-
<
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
141
|
+
<div className="flex">
|
|
142
|
+
<div className="flex-1">
|
|
143
|
+
<CategoryHeading>Overview</CategoryHeading>
|
|
144
|
+
<Heading level={1} id="description" registerSidebarAnchor>
|
|
145
|
+
{title}
|
|
146
|
+
</Heading>
|
|
147
|
+
</div>
|
|
148
|
+
<div>
|
|
149
|
+
{Object.entries(versions).length > 1 && (
|
|
150
|
+
<Select
|
|
151
|
+
onValueChange={(version) => navigate(versions[version]!)}
|
|
152
|
+
defaultValue={version}
|
|
153
|
+
>
|
|
154
|
+
<SelectTrigger className="w-[180px]">
|
|
155
|
+
<SelectValue placeholder="Select version" />
|
|
156
|
+
</SelectTrigger>
|
|
157
|
+
<SelectContent>
|
|
158
|
+
{Object.entries(versions).map(([version]) => (
|
|
159
|
+
<SelectItem key={version} value={version}>
|
|
160
|
+
{version}
|
|
161
|
+
</SelectItem>
|
|
162
|
+
))}
|
|
163
|
+
</SelectContent>
|
|
164
|
+
</Select>
|
|
165
|
+
)}
|
|
166
|
+
</div>
|
|
167
|
+
</div>
|
|
113
168
|
<Markdown content={result.data.schema.description ?? ""} />
|
|
114
169
|
</div>
|
|
115
170
|
<hr />
|
|
116
|
-
<div className="my-4 flex justify-end">
|
|
171
|
+
<div className="my-4 flex items-center justify-end gap-4">
|
|
117
172
|
<Endpoint />
|
|
118
173
|
</div>
|
|
119
|
-
|
|
120
174
|
{result.data.schema.tags
|
|
121
175
|
.filter((tag) => tag.operations.length > 0)
|
|
122
176
|
.map((tag) => (
|
|
123
|
-
|
|
177
|
+
// px, -mx is so that `content-visibility` doesn't cut off overflown heading anchor links '#'
|
|
178
|
+
<div key={tag.name} className="px-6 -mx-6 [content-visibility:auto]">
|
|
124
179
|
{tag.name && <CategoryHeading>{tag.name}</CategoryHeading>}
|
|
125
180
|
{tag.description && (
|
|
126
181
|
<Markdown
|
|
@@ -132,6 +187,7 @@ export const OperationList = () => {
|
|
|
132
187
|
<StaggeredRender>
|
|
133
188
|
{tag.operations.map((fragment) => (
|
|
134
189
|
<OperationListItem
|
|
190
|
+
serverUrl={selectedServer ?? result.data.schema.url}
|
|
135
191
|
key={fragment.slug}
|
|
136
192
|
operationFragment={fragment}
|
|
137
193
|
/>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useState } from "react";
|
|
1
|
+
import { useRef, useState } from "react";
|
|
2
2
|
import { Heading } from "../../components/Heading.js";
|
|
3
3
|
import { Markdown, ProseClasses } from "../../components/Markdown.js";
|
|
4
4
|
import { Tabs, TabsContent, TabsList, TabsTrigger } from "../../ui/Tabs.js";
|
|
@@ -9,20 +9,24 @@ import { ParameterList } from "./ParameterList.js";
|
|
|
9
9
|
import { Sidecar } from "./Sidecar.js";
|
|
10
10
|
import { FragmentType, useFragment } from "./graphql/index.js";
|
|
11
11
|
import { SchemaView } from "./schema/SchemaView.js";
|
|
12
|
+
import { methodForColor } from "./util/methodToColor.js";
|
|
12
13
|
|
|
13
14
|
export const PARAM_GROUPS = ["path", "query", "header", "cookie"] as const;
|
|
14
15
|
export type ParameterGroup = (typeof PARAM_GROUPS)[number];
|
|
15
16
|
|
|
16
17
|
export const OperationListItem = ({
|
|
17
18
|
operationFragment,
|
|
19
|
+
serverUrl,
|
|
18
20
|
}: {
|
|
19
21
|
operationFragment: FragmentType<typeof OperationsFragment>;
|
|
22
|
+
serverUrl?: string;
|
|
20
23
|
}) => {
|
|
21
24
|
const operation = useFragment(OperationsFragment, operationFragment);
|
|
22
25
|
const groupedParameters = groupBy(
|
|
23
26
|
operation.parameters ?? [],
|
|
24
27
|
(param) => param.in,
|
|
25
28
|
);
|
|
29
|
+
const parentRef = useRef<HTMLDivElement>(null);
|
|
26
30
|
|
|
27
31
|
const first = operation.responses.at(0);
|
|
28
32
|
const [selectedResponse, setSelectedResponse] = useState(first?.statusCode);
|
|
@@ -30,12 +34,37 @@ export const OperationListItem = ({
|
|
|
30
34
|
return (
|
|
31
35
|
<div
|
|
32
36
|
key={operation.operationId}
|
|
33
|
-
className="grid grid-cols-1 lg:grid-cols-[
|
|
37
|
+
className="grid grid-cols-1 lg:grid-cols-[minmax(0,4fr)_minmax(0,3fr)] gap-8 items-start border-b-2 mb-16 pb-16"
|
|
34
38
|
>
|
|
35
39
|
<div className="flex flex-col gap-4">
|
|
36
40
|
<Heading level={2} id={operation.slug} registerSidebarAnchor>
|
|
37
41
|
{operation.summary}
|
|
38
42
|
</Heading>
|
|
43
|
+
<div className="text-sm flex gap-2 font-mono">
|
|
44
|
+
<span className={methodForColor(operation.method)}>
|
|
45
|
+
{operation.method.toUpperCase()}
|
|
46
|
+
</span>
|
|
47
|
+
<div
|
|
48
|
+
ref={parentRef}
|
|
49
|
+
className="max-w-full truncate flex cursor-pointer"
|
|
50
|
+
onClick={() => {
|
|
51
|
+
if (parentRef.current) {
|
|
52
|
+
const range = document.createRange();
|
|
53
|
+
range.selectNodeContents(parentRef.current);
|
|
54
|
+
const selection = window.getSelection();
|
|
55
|
+
selection?.removeAllRanges();
|
|
56
|
+
selection?.addRange(range);
|
|
57
|
+
}
|
|
58
|
+
}}
|
|
59
|
+
>
|
|
60
|
+
<div className="text-neutral-400 dark:text-neutral-500 truncate">
|
|
61
|
+
{serverUrl}
|
|
62
|
+
</div>
|
|
63
|
+
<div className="text-neutral-900 dark:text-neutral-200">
|
|
64
|
+
{operation.path}
|
|
65
|
+
</div>
|
|
66
|
+
</div>
|
|
67
|
+
</div>
|
|
39
68
|
{operation.description && (
|
|
40
69
|
<Markdown
|
|
41
70
|
className={`${ProseClasses} max-w-full prose-img:max-w-prose`}
|