zudoku 0.0.0-e88b02e → 0.0.0-e8a949d
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app/demo.js +1 -1
- package/dist/app/demo.js.map +1 -1
- package/dist/app/entry.client.js +1 -15
- package/dist/app/entry.client.js.map +1 -1
- package/dist/app/entry.server.js +1 -2
- package/dist/app/entry.server.js.map +1 -1
- package/dist/app/main.d.ts +1 -1
- package/dist/app/sentry.js +1 -1
- package/dist/app/sentry.js.map +1 -1
- package/dist/app/standalone.js +1 -1
- package/dist/app/standalone.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/cmds/dev.js +5 -0
- package/dist/cli/cmds/dev.js.map +1 -1
- package/dist/cli/dev/handler.d.ts +1 -0
- package/dist/cli/dev/handler.js +1 -1
- package/dist/cli/dev/handler.js.map +1 -1
- package/dist/config/loader.d.ts +9 -1
- package/dist/config/loader.js +44 -7
- package/dist/config/loader.js.map +1 -1
- package/dist/config/validators/common.d.ts +186 -152
- package/dist/config/validators/common.js +6 -2
- package/dist/config/validators/common.js.map +1 -1
- package/dist/config/validators/icon-types.d.ts +1 -1
- package/dist/config/validators/validate.d.ts +123 -109
- 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 +1 -0
- 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/Layout.js +2 -2
- 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/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/SlotletProvider.d.ts +2 -2
- 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 +20 -16
- package/dist/lib/components/index.js +7 -3
- package/dist/lib/components/index.js.map +1 -1
- package/dist/lib/components/navigation/Sidebar.js +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.js +1 -1
- package/dist/lib/components/navigation/SidebarCategory.js.map +1 -1
- package/dist/lib/components/navigation/SidebarItem.js +1 -1
- package/dist/lib/components/navigation/SidebarItem.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/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/parser/dereference/index.d.ts +1 -0
- package/dist/lib/oas/parser/dereference/index.js +6 -3
- package/dist/lib/oas/parser/dereference/index.js.map +1 -1
- package/dist/lib/plugins/api-catalog/Catalog.d.ts +2 -6
- package/dist/lib/plugins/api-catalog/Catalog.js +22 -15
- package/dist/lib/plugins/api-catalog/Catalog.js.map +1 -1
- package/dist/lib/plugins/api-catalog/index.d.ts +8 -1
- package/dist/lib/plugins/api-catalog/index.js +2 -2
- package/dist/lib/plugins/api-catalog/index.js.map +1 -1
- 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.js +1 -1
- package/dist/lib/plugins/markdown/MdxPage.js.map +1 -1
- package/dist/lib/plugins/markdown/index.d.ts +1 -0
- package/dist/lib/plugins/markdown/index.js.map +1 -1
- package/dist/lib/plugins/openapi/OperationList.js +10 -34
- 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 +22 -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/client/useCreateQuery.js +10 -1
- package/dist/lib/plugins/openapi/client/useCreateQuery.js.map +1 -1
- package/dist/lib/plugins/openapi/context.d.ts +3 -3
- package/dist/lib/plugins/openapi/index.js +18 -17
- 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/schema/SchemaComponents.js +7 -1
- package/dist/lib/plugins/openapi/schema/SchemaComponents.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.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/util/MdxComponents.d.ts +16 -16
- 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 +4 -1
- package/dist/vite/build.js.map +1 -1
- package/dist/vite/config.d.ts +5 -1
- package/dist/vite/config.js +50 -25
- 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.d.ts +1 -0
- package/dist/vite/dev-server.js +16 -6
- package/dist/vite/dev-server.js.map +1 -1
- package/dist/vite/plugin-api.js +52 -19
- package/dist/vite/plugin-api.js.map +1 -1
- package/dist/vite/plugin-mdx.js +2 -0
- package/dist/vite/plugin-mdx.js.map +1 -1
- package/dist/vite/plugin-theme-css.js +53 -1
- package/dist/vite/plugin-theme-css.js.map +1 -1
- package/dist/vite/plugin.js +4 -0
- package/dist/vite/plugin.js.map +1 -1
- package/lib/{AnchorLink-BR0MvI7n.js → AnchorLink-DFZZbmvr.js} +13 -14
- package/lib/AnchorLink-DFZZbmvr.js.map +1 -0
- package/lib/{AuthenticationPlugin-D0Em0SwR.js → AuthenticationPlugin-DVLEc6cm.js} +15 -16
- package/lib/AuthenticationPlugin-DVLEc6cm.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-CdkU5HcM.js → Markdown-CZDLNOFc.js} +13235 -13225
- package/lib/Markdown-CZDLNOFc.js.map +1 -0
- package/lib/{MdxPage-ChziqNPp.js → MdxPage-DKMbBROv.js} +25 -25
- package/lib/MdxPage-DKMbBROv.js.map +1 -0
- package/lib/OperationList-CqLL5P5l.js +5068 -0
- package/lib/OperationList-CqLL5P5l.js.map +1 -0
- package/lib/Route-DYwKZ_c_.js +35 -0
- package/lib/Route-DYwKZ_c_.js.map +1 -0
- package/lib/{Select-O9ZM3ZgX.js → Select-B_IxRUUC.js} +5 -5
- package/lib/{Select-O9ZM3ZgX.js.map → Select-B_IxRUUC.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-C31iouiO.js → SyntaxHighlight-Bz-lOJtH.js} +8 -10
- package/lib/{SyntaxHighlight-C31iouiO.js.map → SyntaxHighlight-Bz-lOJtH.js.map} +1 -1
- package/lib/{utils-DcpDOncX.js → ZudokuContext-hmLMUdf2.js} +54 -55
- package/lib/ZudokuContext-hmLMUdf2.js.map +1 -0
- 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-C_2va8B8.js → worker-DV9Ecqy9.js} +5267 -4887
- package/lib/assets/worker-DV9Ecqy9.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-BCAHdrpE.js → createServer-C4C0OO0m.js} +4804 -4462
- package/lib/createServer-C4C0OO0m.js.map +1 -0
- package/lib/{hook-hEqe7fPB.js → hook-CHq7pFyz.js} +3 -3
- package/lib/{hook-hEqe7fPB.js.map → hook-CHq7pFyz.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-DyBL--Kz.js +826 -0
- package/lib/index-DyBL--Kz.js.map +1 -0
- package/lib/{index-DjB6H4GT.js → index-DzRORsY1.js} +444 -441
- package/lib/index-DzRORsY1.js.map +1 -0
- package/lib/index-LNp6rxyU.js.map +1 -1
- package/lib/index.esm-BSV1C092.js +692 -0
- package/lib/{index.esm-Bm8pj-bc.js.map → index.esm-BSV1C092.js.map} +1 -1
- 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/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 +2 -2
- 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/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 +369 -366
- package/lib/zudoku.auth-openid.js.map +1 -1
- package/lib/zudoku.components.js +722 -959
- 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 +81 -79
- package/lib/zudoku.plugin-api-catalog.js.map +1 -1
- 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 +52 -47
- package/src/app/demo.tsx +1 -1
- package/src/app/entry.client.tsx +1 -15
- package/src/app/entry.server.tsx +2 -2
- package/src/app/main.tsx +1 -1
- package/src/app/sentry.ts +1 -1
- package/src/app/standalone.tsx +1 -1
- 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 +5 -3
- 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/Layout.tsx +2 -2
- package/src/lib/components/Markdown.tsx +1 -1
- package/src/lib/components/MobileTopNavigation.tsx +1 -1
- 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/SlotletProvider.tsx +1 -1
- package/src/lib/components/TopNavigation.tsx +1 -1
- package/src/lib/components/Zudoku.tsx +1 -1
- package/src/lib/components/context/ZudokuContext.ts +1 -1
- package/src/lib/components/index.ts +8 -4
- package/src/lib/components/navigation/Sidebar.tsx +1 -1
- package/src/lib/components/navigation/SidebarBadge.tsx +0 -10
- package/src/lib/components/navigation/SidebarCategory.tsx +1 -1
- package/src/lib/components/navigation/SidebarItem.tsx +1 -1
- package/src/lib/components/navigation/utils.ts +1 -1
- package/src/lib/core/plugins.ts +3 -7
- package/src/lib/errors/RouterError.tsx +1 -1
- package/src/lib/oas/parser/dereference/index.ts +9 -4
- package/src/lib/plugins/api-catalog/Catalog.tsx +59 -60
- package/src/lib/plugins/api-catalog/index.tsx +14 -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 +1 -1
- package/src/lib/plugins/markdown/index.tsx +2 -1
- package/src/lib/plugins/openapi/OperationList.tsx +45 -50
- package/src/lib/plugins/openapi/OperationListItem.tsx +31 -2
- package/src/lib/plugins/openapi/Route.tsx +41 -9
- package/src/lib/plugins/openapi/Sidecar.tsx +3 -17
- package/src/lib/plugins/openapi/client/useCreateQuery.ts +13 -1
- package/src/lib/plugins/openapi/context.tsx +2 -2
- package/src/lib/plugins/openapi/index.tsx +37 -28
- package/src/lib/plugins/openapi/interfaces.ts +22 -1
- package/src/lib/plugins/openapi/schema/SchemaComponents.tsx +25 -1
- 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 +1 -1
- 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 +1 -3
- 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/lib/AnchorLink-BR0MvI7n.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-CdkU5HcM.js.map +0 -1
- package/lib/MdxPage-ChziqNPp.js.map +0 -1
- package/lib/OperationList-CQKkyrZH.js +0 -4706
- package/lib/OperationList-CQKkyrZH.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-D77pO-fA.js +0 -252
- package/lib/SlotletProvider-D77pO-fA.js.map +0 -1
- package/lib/assets/index-B_Jk_Yzp.js.map +0 -1
- package/lib/assets/worker-C_2va8B8.js.map +0 -1
- package/lib/cn-BmFQLtkS.js.map +0 -1
- package/lib/context-D1nXWxm7.js.map +0 -1
- package/lib/createServer-BCAHdrpE.js.map +0 -1
- package/lib/index-BuAyrJe3.js +0 -46
- package/lib/index-BuAyrJe3.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-DjB6H4GT.js.map +0 -1
- package/lib/index-Yn8c3UWE.js +0 -921
- package/lib/index-Yn8c3UWE.js.map +0 -1
- package/lib/index.esm-Bm8pj-bc.js +0 -675
- 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-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/lib/utils-DcpDOncX.js.map +0 -1
- package/src/lib/plugins/search-inkeep/InkeepCustomTrigger.tsx +0 -3
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/prefer-nullish-coalescing */
|
|
2
|
+
/* eslint-disable @typescript-eslint/no-unnecessary-condition */
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* This is a fork of `react-markdown` converted to typescript.
|
|
6
|
+
* The reason we fork it is because react-markdown is comptaible with
|
|
7
|
+
* unified 11, but references the unified 10 and related packages causing
|
|
8
|
+
* type errors and a bunch of extra imports
|
|
9
|
+
*
|
|
10
|
+
* Source: https://github.com/remarkjs/react-markdown/blob/main/index.js
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import { unreachable } from "devlop";
|
|
14
|
+
import type { Element, ElementContent, Nodes, Parents } from "hast";
|
|
15
|
+
import {
|
|
16
|
+
Components as JsxRuntimeComponents,
|
|
17
|
+
toJsxRuntime,
|
|
18
|
+
} from "hast-util-to-jsx-runtime";
|
|
19
|
+
import { urlAttributes } from "html-url-attributes";
|
|
20
|
+
import { ReactElement } from "react";
|
|
21
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
22
|
+
import remarkParse from "remark-parse";
|
|
23
|
+
import remarkRehype, { Options as RemarkRehypeOptions } from "remark-rehype";
|
|
24
|
+
import { PluggableList, unified } from "unified";
|
|
25
|
+
import { visit } from "unist-util-visit";
|
|
26
|
+
import { VFile } from "vfile";
|
|
27
|
+
|
|
28
|
+
const changelog =
|
|
29
|
+
"https://github.com/remarkjs/react-markdown/blob/main/changelog.md";
|
|
30
|
+
|
|
31
|
+
const emptyPlugins: PluggableList = [];
|
|
32
|
+
const emptyRemarkRehypeOptions: Readonly<RemarkRehypeOptions> = {
|
|
33
|
+
allowDangerousHtml: true,
|
|
34
|
+
};
|
|
35
|
+
const safeProtocol = /^(https?|ircs?|mailto|xmpp)$/i;
|
|
36
|
+
|
|
37
|
+
interface Deprecation {
|
|
38
|
+
from: string;
|
|
39
|
+
id: string;
|
|
40
|
+
to?: keyof Options;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
interface AllowElement {
|
|
44
|
+
(
|
|
45
|
+
element: Readonly<Element>,
|
|
46
|
+
index: number,
|
|
47
|
+
parent: Readonly<Parents> | undefined,
|
|
48
|
+
): boolean | null | undefined;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
interface UrlTransform {
|
|
52
|
+
(
|
|
53
|
+
url: string,
|
|
54
|
+
key: string,
|
|
55
|
+
node: Readonly<Element>,
|
|
56
|
+
): string | null | undefined;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
60
|
+
interface Components extends Partial<JsxRuntimeComponents> {}
|
|
61
|
+
|
|
62
|
+
interface Options {
|
|
63
|
+
allowElement?: AllowElement | null;
|
|
64
|
+
allowedElements?: ReadonlyArray<string> | null;
|
|
65
|
+
children?: string | null;
|
|
66
|
+
className?: string | null;
|
|
67
|
+
components?: Components | null;
|
|
68
|
+
disallowedElements?: ReadonlyArray<string> | null;
|
|
69
|
+
rehypePlugins?: PluggableList | null;
|
|
70
|
+
remarkPlugins?: PluggableList | null;
|
|
71
|
+
remarkRehypeOptions?: Readonly<RemarkRehypeOptions> | null;
|
|
72
|
+
skipHtml?: boolean | null;
|
|
73
|
+
unwrapDisallowed?: boolean | null;
|
|
74
|
+
urlTransform?: UrlTransform | null;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
const deprecations: ReadonlyArray<Readonly<Deprecation>> = [
|
|
78
|
+
{ from: "astPlugins", id: "remove-buggy-html-in-markdown-parser" },
|
|
79
|
+
{ from: "allowDangerousHtml", id: "remove-buggy-html-in-markdown-parser" },
|
|
80
|
+
{
|
|
81
|
+
from: "allowNode",
|
|
82
|
+
id: "replace-allownode-allowedtypes-and-disallowedtypes",
|
|
83
|
+
to: "allowElement",
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
from: "allowedTypes",
|
|
87
|
+
id: "replace-allownode-allowedtypes-and-disallowedtypes",
|
|
88
|
+
to: "allowedElements",
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
from: "disallowedTypes",
|
|
92
|
+
id: "replace-allownode-allowedtypes-and-disallowedtypes",
|
|
93
|
+
to: "disallowedElements",
|
|
94
|
+
},
|
|
95
|
+
{ from: "escapeHtml", id: "remove-buggy-html-in-markdown-parser" },
|
|
96
|
+
{ from: "includeElementIndex", id: "#remove-includeelementindex" },
|
|
97
|
+
{
|
|
98
|
+
from: "includeNodeIndex",
|
|
99
|
+
id: "change-includenodeindex-to-includeelementindex",
|
|
100
|
+
},
|
|
101
|
+
{ from: "linkTarget", id: "remove-linktarget" },
|
|
102
|
+
{
|
|
103
|
+
from: "plugins",
|
|
104
|
+
id: "change-plugins-to-remarkplugins",
|
|
105
|
+
to: "remarkPlugins",
|
|
106
|
+
},
|
|
107
|
+
{ from: "rawSourcePos", id: "#remove-rawsourcepos" },
|
|
108
|
+
{ from: "renderers", id: "change-renderers-to-components", to: "components" },
|
|
109
|
+
{ from: "source", id: "change-source-to-children", to: "children" },
|
|
110
|
+
{ from: "sourcePos", id: "#remove-sourcepos" },
|
|
111
|
+
{ from: "transformImageUri", id: "#add-urltransform", to: "urlTransform" },
|
|
112
|
+
{ from: "transformLinkUri", id: "#add-urltransform", to: "urlTransform" },
|
|
113
|
+
];
|
|
114
|
+
|
|
115
|
+
export function ReactMarkdown(options: Readonly<Options>): ReactElement {
|
|
116
|
+
const allowedElements = options.allowedElements;
|
|
117
|
+
const allowElement = options.allowElement;
|
|
118
|
+
const children = options.children || "";
|
|
119
|
+
const className = options.className;
|
|
120
|
+
const components = options.components;
|
|
121
|
+
const disallowedElements = options.disallowedElements;
|
|
122
|
+
const rehypePlugins = options.rehypePlugins || emptyPlugins;
|
|
123
|
+
const remarkPlugins = options.remarkPlugins || emptyPlugins;
|
|
124
|
+
const remarkRehypeOptions = options.remarkRehypeOptions
|
|
125
|
+
? { ...options.remarkRehypeOptions, ...emptyRemarkRehypeOptions }
|
|
126
|
+
: emptyRemarkRehypeOptions;
|
|
127
|
+
const skipHtml = options.skipHtml;
|
|
128
|
+
const unwrapDisallowed = options.unwrapDisallowed;
|
|
129
|
+
const urlTransform = options.urlTransform || defaultUrlTransform;
|
|
130
|
+
|
|
131
|
+
const processor = unified()
|
|
132
|
+
.use(remarkParse)
|
|
133
|
+
.use(remarkPlugins)
|
|
134
|
+
.use(remarkRehype, remarkRehypeOptions)
|
|
135
|
+
.use(rehypePlugins);
|
|
136
|
+
|
|
137
|
+
const file = new VFile();
|
|
138
|
+
|
|
139
|
+
if (typeof children === "string") {
|
|
140
|
+
file.value = children;
|
|
141
|
+
} else {
|
|
142
|
+
unreachable(
|
|
143
|
+
`Unexpected value '${children}' for 'children' prop, expected 'string'`,
|
|
144
|
+
);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
if (allowedElements && disallowedElements) {
|
|
148
|
+
unreachable(
|
|
149
|
+
"Unexpected combined `allowedElements` and `disallowedElements`, expected one or the other",
|
|
150
|
+
);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
for (const deprecation of deprecations) {
|
|
154
|
+
if (Object.prototype.hasOwnProperty.call(options, deprecation.from)) {
|
|
155
|
+
unreachable(
|
|
156
|
+
`Unexpected '${deprecation.from}' prop, ` +
|
|
157
|
+
(deprecation.to ? `use '${deprecation.to}' instead` : "remove it") +
|
|
158
|
+
` (see <${changelog}#${deprecation.id}> for more info)`,
|
|
159
|
+
);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
const mdastTree = processor.parse(file);
|
|
164
|
+
let hastTree: Nodes = processor.runSync(mdastTree, file);
|
|
165
|
+
|
|
166
|
+
if (className) {
|
|
167
|
+
hastTree = {
|
|
168
|
+
type: "element",
|
|
169
|
+
tagName: "div",
|
|
170
|
+
properties: { className },
|
|
171
|
+
children:
|
|
172
|
+
hastTree.type === "root"
|
|
173
|
+
? (hastTree.children as ElementContent[])
|
|
174
|
+
: [hastTree],
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
// Nodes type is slightly off, different versions of `hast` have different types
|
|
179
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
180
|
+
// @ts-ignore
|
|
181
|
+
visit(hastTree, transform);
|
|
182
|
+
|
|
183
|
+
return toJsxRuntime(hastTree, {
|
|
184
|
+
Fragment,
|
|
185
|
+
components,
|
|
186
|
+
ignoreInvalidStyle: true,
|
|
187
|
+
jsx,
|
|
188
|
+
jsxs,
|
|
189
|
+
passKeys: true,
|
|
190
|
+
passNode: true,
|
|
191
|
+
});
|
|
192
|
+
|
|
193
|
+
function transform(
|
|
194
|
+
node: Nodes,
|
|
195
|
+
index: number | null,
|
|
196
|
+
parent: Parents | undefined,
|
|
197
|
+
): number | void {
|
|
198
|
+
if (node.type === "raw" && parent && typeof index === "number") {
|
|
199
|
+
if (skipHtml) {
|
|
200
|
+
parent.children.splice(index, 1);
|
|
201
|
+
} else {
|
|
202
|
+
parent.children[index] = { type: "text", value: node.value };
|
|
203
|
+
}
|
|
204
|
+
return index;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
if (node.type === "element") {
|
|
208
|
+
for (const key in urlAttributes) {
|
|
209
|
+
if (
|
|
210
|
+
Object.prototype.hasOwnProperty.call(urlAttributes, key) &&
|
|
211
|
+
Object.prototype.hasOwnProperty.call(node.properties, key)
|
|
212
|
+
) {
|
|
213
|
+
const value = node.properties[key];
|
|
214
|
+
const test = urlAttributes[key];
|
|
215
|
+
if (
|
|
216
|
+
test === null ||
|
|
217
|
+
test === undefined ||
|
|
218
|
+
test.includes(node.tagName)
|
|
219
|
+
) {
|
|
220
|
+
node.properties[key] = urlTransform(String(value || ""), key, node);
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
let remove = allowedElements
|
|
226
|
+
? !allowedElements.includes(node.tagName)
|
|
227
|
+
: disallowedElements
|
|
228
|
+
? disallowedElements.includes(node.tagName)
|
|
229
|
+
: false;
|
|
230
|
+
|
|
231
|
+
if (!remove && allowElement && typeof index === "number") {
|
|
232
|
+
remove = !allowElement(node, index, parent);
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
if (remove && parent && typeof index === "number") {
|
|
236
|
+
if (unwrapDisallowed && node.children) {
|
|
237
|
+
parent.children.splice(index, 1, ...node.children);
|
|
238
|
+
} else {
|
|
239
|
+
parent.children.splice(index, 1);
|
|
240
|
+
}
|
|
241
|
+
return index;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
function defaultUrlTransform(value: string): string {
|
|
248
|
+
const colon = value.indexOf(":");
|
|
249
|
+
const questionMark = value.indexOf("?");
|
|
250
|
+
const numberSign = value.indexOf("#");
|
|
251
|
+
const slash = value.indexOf("/");
|
|
252
|
+
|
|
253
|
+
if (
|
|
254
|
+
colon < 0 ||
|
|
255
|
+
(slash > -1 && colon > slash) ||
|
|
256
|
+
(questionMark > -1 && colon > questionMark) ||
|
|
257
|
+
(numberSign > -1 && colon > numberSign) ||
|
|
258
|
+
safeProtocol.test(value.slice(0, colon))
|
|
259
|
+
) {
|
|
260
|
+
return value;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
return "";
|
|
264
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { cx } from "class-variance-authority";
|
|
2
2
|
import { Suspense } from "react";
|
|
3
|
-
import { NavLink, useNavigation } from "react-router
|
|
3
|
+
import { NavLink, useNavigation } from "react-router";
|
|
4
4
|
import { TopNavigationItem } from "../../config/validators/common.js";
|
|
5
5
|
import { useAuth } from "../authentication/hook.js";
|
|
6
6
|
import { ZudokuError } from "../util/invariant.js";
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
useState,
|
|
12
12
|
} from "react";
|
|
13
13
|
import { ErrorBoundary } from "react-error-boundary";
|
|
14
|
-
import { Outlet, useNavigation } from "react-router
|
|
14
|
+
import { Outlet, useNavigation } from "react-router";
|
|
15
15
|
import { hasHead, isMdxProviderPlugin } from "../core/plugins.js";
|
|
16
16
|
import { ZudokuContext, ZudokuContextOptions } from "../core/ZudokuContext.js";
|
|
17
17
|
import { TopLevelError } from "../errors/TopLevelError.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useQuery, useSuspenseQuery } from "@tanstack/react-query";
|
|
2
2
|
import { createContext, useContext } from "react";
|
|
3
|
-
import { matchPath, useLocation } from "react-router
|
|
3
|
+
import { matchPath, useLocation } from "react-router";
|
|
4
4
|
import { ZudokuContext } from "../../core/ZudokuContext.js";
|
|
5
5
|
import { joinPath } from "../../util/joinPath.js";
|
|
6
6
|
import { traverseSidebar } from "../navigation/utils.js";
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { useMDXComponents as useMDXComponentsImport } from "@mdx-js/react";
|
|
2
2
|
import { Helmet } from "@zudoku/react-helmet-async";
|
|
3
|
-
import { Link as LinkImport } from "react-router
|
|
4
|
-
import {
|
|
3
|
+
import { Link as LinkImport } from "react-router";
|
|
4
|
+
import { useAuth as useAuthImport } from "../authentication/hook.js";
|
|
5
5
|
import { RouterError as RouterErrorImport } from "../errors/RouterError.js";
|
|
6
6
|
import { ServerError as ServerErrorImport } from "../errors/ServerError.js";
|
|
7
7
|
import { Button as ButtonImport } from "../ui/Button.js";
|
|
8
8
|
import { Callout as CalloutImport } from "../ui/Callout.js";
|
|
9
|
+
import { Spinner as SpinnerImport } from "./Spinner.js";
|
|
10
|
+
import { Markdown as MarkdownImport } from "./Markdown.js";
|
|
9
11
|
import {
|
|
10
12
|
Bootstrap as BootstrapImport,
|
|
11
13
|
BootstrapStatic as BootstrapStaticImport,
|
|
@@ -24,10 +26,12 @@ export const BootstrapStatic = /*@__PURE__*/ BootstrapStaticImport;
|
|
|
24
26
|
export const Head = /*@__PURE__*/ Helmet;
|
|
25
27
|
|
|
26
28
|
export const useZudoku = /*@__PURE__*/ useZudokuImport;
|
|
27
|
-
export const useAuth = /*@__PURE__*/
|
|
29
|
+
export const useAuth = /*@__PURE__*/ useAuthImport;
|
|
28
30
|
export const Zudoku = /*@__PURE__*/ ZudokuImport;
|
|
29
31
|
|
|
30
32
|
export const Callout = /*@__PURE__*/ CalloutImport;
|
|
33
|
+
export const Markdown = /*@__PURE__*/ MarkdownImport;
|
|
34
|
+
export const Spinner = /*@__PURE__*/ SpinnerImport;
|
|
31
35
|
export const ClientOnly = /*@__PURE__*/ ClientOnlyImport;
|
|
32
36
|
export const Button = /*@__PURE__*/ ButtonImport;
|
|
33
|
-
export const Link
|
|
37
|
+
export const Link = /*@__PURE__*/ LinkImport;
|
|
@@ -31,7 +31,7 @@ export const Sidebar = ({
|
|
|
31
31
|
className="lg:hidden h-[100dvh] left-0 w-[320px] rounded-none"
|
|
32
32
|
aria-describedby={undefined}
|
|
33
33
|
>
|
|
34
|
-
<div className="p-
|
|
34
|
+
<div className="p-4 overflow-y-auto overscroll-none">
|
|
35
35
|
<VisuallyHidden>
|
|
36
36
|
<DrawerTitle>Sidebar</DrawerTitle>
|
|
37
37
|
</VisuallyHidden>
|
|
@@ -1,15 +1,5 @@
|
|
|
1
1
|
import { cn } from "../../util/cn.js";
|
|
2
2
|
|
|
3
|
-
export const TextColorMap = {
|
|
4
|
-
green: "text-green-600",
|
|
5
|
-
blue: "text-sky-600",
|
|
6
|
-
yellow: "text-yellow-600",
|
|
7
|
-
red: "text-red-600",
|
|
8
|
-
purple: "text-purple-600",
|
|
9
|
-
indigo: "text-indigo-600",
|
|
10
|
-
gray: "text-gray-600",
|
|
11
|
-
};
|
|
12
|
-
|
|
13
3
|
export const ColorMap = {
|
|
14
4
|
green: "bg-green-400 dark:bg-green-800",
|
|
15
5
|
blue: "bg-sky-400 dark:bg-sky-800",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as Collapsible from "@radix-ui/react-collapsible";
|
|
2
2
|
import { ChevronRightIcon } from "lucide-react";
|
|
3
3
|
import { useEffect, useState } from "react";
|
|
4
|
-
import { NavLink, useMatch } from "react-router
|
|
4
|
+
import { NavLink, useMatch } from "react-router";
|
|
5
5
|
import type { SidebarItemCategory } from "../../../config/validators/SidebarSchema.js";
|
|
6
6
|
import { cn } from "../../util/cn.js";
|
|
7
7
|
import { joinPath } from "../../util/joinPath.js";
|
|
@@ -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";
|
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 {
|
|
@@ -3,6 +3,8 @@ import { resolveLocalRef } from "./resolveRef.js";
|
|
|
3
3
|
|
|
4
4
|
export type JSONSchema = JSONSchema4 | JSONSchema6;
|
|
5
5
|
|
|
6
|
+
export const CIRCULAR_REF = "$[Circular Reference]";
|
|
7
|
+
|
|
6
8
|
type CustomResolver = (ref: string) => Promise<JSONSchema | undefined>;
|
|
7
9
|
|
|
8
10
|
const cache = new Map<JSONSchema, JSONSchema>();
|
|
@@ -21,12 +23,12 @@ export const dereference = async (
|
|
|
21
23
|
}
|
|
22
24
|
|
|
23
25
|
const cloned = structuredClone(schema);
|
|
24
|
-
const visited = new Set();
|
|
26
|
+
const visited = new Set<unknown>();
|
|
25
27
|
|
|
26
28
|
const resolve = async (current: unknown, path: string) => {
|
|
27
29
|
if (isIndexableObject(current)) {
|
|
28
30
|
if (visited.has(current)) {
|
|
29
|
-
return
|
|
31
|
+
return CIRCULAR_REF;
|
|
30
32
|
}
|
|
31
33
|
|
|
32
34
|
visited.add(current);
|
|
@@ -39,15 +41,18 @@ export const dereference = async (
|
|
|
39
41
|
if ("$ref" in current && typeof current.$ref === "string") {
|
|
40
42
|
for (const resolver of resolvers) {
|
|
41
43
|
const resolved = await resolver(current.$ref);
|
|
42
|
-
if (resolved) return resolved;
|
|
44
|
+
if (resolved) return await resolve(resolved, path);
|
|
43
45
|
}
|
|
44
|
-
|
|
46
|
+
const resolved = await resolveLocalRef(cloned, current.$ref);
|
|
47
|
+
return await resolve(resolved, path);
|
|
45
48
|
}
|
|
46
49
|
|
|
47
50
|
for (const key in current) {
|
|
48
51
|
current[key] = await resolve(current[key], `${path}/${key}`);
|
|
49
52
|
}
|
|
50
53
|
}
|
|
54
|
+
|
|
55
|
+
visited.delete(current);
|
|
51
56
|
}
|
|
52
57
|
|
|
53
58
|
return current;
|
|
@@ -1,37 +1,45 @@
|
|
|
1
1
|
import slugify from "@sindresorhus/slugify";
|
|
2
|
-
import {
|
|
2
|
+
import { useSuspenseQuery } from "@tanstack/react-query";
|
|
3
|
+
import { useSearchParams } from "react-router";
|
|
3
4
|
import { Head, Link } from "zudoku/components";
|
|
5
|
+
import { useAuthState } from "../../authentication/state.js";
|
|
4
6
|
import { Markdown } from "../../components/Markdown.js";
|
|
5
|
-
import {
|
|
6
|
-
import type {
|
|
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}`);
|
|
7
11
|
|
|
8
12
|
export const Catalog = ({
|
|
9
13
|
items,
|
|
14
|
+
filterCatalogItems = (items) => items,
|
|
10
15
|
categories,
|
|
11
16
|
label = "API Library",
|
|
12
|
-
}: {
|
|
13
|
-
|
|
14
|
-
items: ApiCatalogItem[];
|
|
15
|
-
categories: CatalogCategory[];
|
|
16
|
-
}) => {
|
|
17
|
-
const { searchParams, setSearchParams } = useExposedProps();
|
|
17
|
+
}: Omit<ApiCatalogPluginOptions, "navigationId">) => {
|
|
18
|
+
const [searchParams, setSearchParams] = useSearchParams();
|
|
18
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
|
+
|
|
19
27
|
return (
|
|
20
28
|
<section className="pt-[--padding-content-top] pb-[--padding-content-bottom]">
|
|
21
29
|
<Head>
|
|
22
30
|
<title>{label}</title>
|
|
23
31
|
</Head>
|
|
24
32
|
<div className="grid grid-cols-12 gap-12">
|
|
25
|
-
<div className="flex flex-col gap-4 col-span-3
|
|
26
|
-
<div className="justify-between">
|
|
27
|
-
{categories
|
|
28
|
-
<
|
|
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}>
|
|
29
37
|
<div className="flex justify-between mb-2.5">
|
|
30
38
|
<span className="font-medium text-sm">{category.label}</span>
|
|
31
39
|
{idx === 0 && activeCategory && (
|
|
32
40
|
<button
|
|
33
41
|
type="button"
|
|
34
|
-
className="text-end text-sm
|
|
42
|
+
className="text-end text-sm text-foreground/60 hover:text-foreground"
|
|
35
43
|
onClick={() => setSearchParams({})}
|
|
36
44
|
>
|
|
37
45
|
Clear
|
|
@@ -39,45 +47,41 @@ export const Catalog = ({
|
|
|
39
47
|
)}
|
|
40
48
|
</div>
|
|
41
49
|
<ul className="space-y-1 [&>li]:py-2">
|
|
42
|
-
{
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
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
|
+
)}
|
|
64
77
|
>
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
: ""
|
|
71
|
-
}`}
|
|
72
|
-
>
|
|
73
|
-
{count}
|
|
74
|
-
</span>
|
|
75
|
-
</li>
|
|
76
|
-
)),
|
|
77
|
-
),
|
|
78
|
-
)}
|
|
78
|
+
{count}
|
|
79
|
+
</span>
|
|
80
|
+
</li>
|
|
81
|
+
);
|
|
82
|
+
})}
|
|
79
83
|
</ul>
|
|
80
|
-
</
|
|
84
|
+
</div>
|
|
81
85
|
))}
|
|
82
86
|
</div>
|
|
83
87
|
</div>
|
|
@@ -85,17 +89,15 @@ export const Catalog = ({
|
|
|
85
89
|
<h3 className="mt-0 text-2xl font-bold mb-4">{label}</h3>
|
|
86
90
|
|
|
87
91
|
<div className="grid grid-cols-2 gap-4">
|
|
88
|
-
{
|
|
92
|
+
{catalogItems.data
|
|
89
93
|
.filter(
|
|
90
94
|
(api) =>
|
|
91
95
|
!activeCategory ||
|
|
92
96
|
api.categories.find((c) =>
|
|
93
|
-
c.tags.find(
|
|
94
|
-
(t) => slugify(c.label + " " + t) === activeCategory,
|
|
95
|
-
),
|
|
97
|
+
c.tags.find((t) => getKey(c.label, t) === activeCategory),
|
|
96
98
|
),
|
|
97
99
|
)
|
|
98
|
-
.map((api
|
|
100
|
+
.map((api) => (
|
|
99
101
|
<Link
|
|
100
102
|
to={{
|
|
101
103
|
pathname: `/${api.path}`,
|
|
@@ -104,10 +106,7 @@ export const Catalog = ({
|
|
|
104
106
|
className="no-underline hover:!text-foreground"
|
|
105
107
|
key={api.path}
|
|
106
108
|
>
|
|
107
|
-
<div
|
|
108
|
-
className="border h-full rounded p-4 flex flex-col gap-2 cursor-pointer hover:bg-border/20 font-normal"
|
|
109
|
-
key={i}
|
|
110
|
-
>
|
|
109
|
+
<div className="border h-full rounded p-4 flex flex-col gap-2 cursor-pointer hover:bg-border/20 font-normal">
|
|
111
110
|
<span className="font-semibold">{api.label}</span>
|
|
112
111
|
<Markdown
|
|
113
112
|
className="text-sm whitespace-pre-wrap mb-6 line-clamp-2"
|