zudoku 0.0.0-fed343e → 0.0.0-ff3751f
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +121 -0
- package/cli.js +2 -2
- package/dist/app/entry.client.js +2 -2
- package/dist/app/entry.client.js.map +1 -1
- package/dist/app/entry.server.js +3 -0
- package/dist/app/entry.server.js.map +1 -1
- package/dist/app/main.d.ts +1 -0
- package/dist/app/main.js +12 -29
- package/dist/app/main.js.map +1 -1
- package/dist/app/standalone.js.map +1 -1
- package/dist/cli/cli.js +1 -2
- package/dist/cli/cli.js.map +1 -1
- package/dist/cli/common/machine-id/lib.js.map +1 -1
- package/dist/cli/common/outdated.js.map +1 -1
- package/dist/cli/common/utils/box.js.map +1 -1
- package/dist/cli/dev/handler.js +2 -2
- package/dist/cli/dev/handler.js.map +1 -1
- package/dist/config/config.d.ts +2 -6
- package/dist/config/validators/InputSidebarSchema.d.ts +21 -5
- package/dist/config/validators/InputSidebarSchema.js +7 -28
- package/dist/config/validators/InputSidebarSchema.js.map +1 -1
- package/dist/config/validators/SidebarSchema.d.ts +24 -1
- package/dist/config/validators/SidebarSchema.js +80 -44
- package/dist/config/validators/SidebarSchema.js.map +1 -1
- package/dist/config/validators/validate.d.ts +590 -311
- package/dist/config/validators/validate.js +42 -19
- package/dist/config/validators/validate.js.map +1 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/authentication/components/CallbackHandler.js +21 -31
- package/dist/lib/authentication/components/CallbackHandler.js.map +1 -1
- package/dist/lib/authentication/hook.d.ts +1 -1
- package/dist/lib/authentication/hook.js +1 -1
- package/dist/lib/authentication/hook.js.map +1 -1
- package/dist/lib/authentication/state.d.ts +16 -0
- package/dist/lib/authentication/state.js +5 -0
- package/dist/lib/authentication/state.js.map +1 -1
- package/dist/lib/components/Banner.js +7 -1
- package/dist/lib/components/Banner.js.map +1 -1
- package/dist/lib/components/ErrorPage.js +1 -2
- package/dist/lib/components/ErrorPage.js.map +1 -1
- package/dist/lib/components/Header.js +6 -1
- package/dist/lib/components/Header.js.map +1 -1
- package/dist/lib/components/Heading.d.ts +1 -1
- package/dist/lib/components/InlineCode.d.ts +2 -1
- package/dist/lib/components/InlineCode.js +9 -1
- package/dist/lib/components/InlineCode.js.map +1 -1
- package/dist/lib/components/Layout.js +1 -1
- package/dist/lib/components/Layout.js.map +1 -1
- package/dist/lib/components/MobileTopNavigation.js +5 -1
- package/dist/lib/components/MobileTopNavigation.js.map +1 -1
- package/dist/lib/components/Search.js +1 -1
- package/dist/lib/components/Search.js.map +1 -1
- package/dist/lib/components/SlotletProvider.d.ts +10 -2
- package/dist/lib/components/SlotletProvider.js +4 -2
- package/dist/lib/components/SlotletProvider.js.map +1 -1
- package/dist/lib/components/SyntaxHighlight.js +4 -1
- package/dist/lib/components/SyntaxHighlight.js.map +1 -1
- package/dist/lib/components/TopNavigation.d.ts +3 -0
- package/dist/lib/components/TopNavigation.js +38 -5
- package/dist/lib/components/TopNavigation.js.map +1 -1
- package/dist/lib/components/context/ZudokuContext.d.ts +6 -10
- package/dist/lib/components/context/ZudokuContext.js +26 -20
- package/dist/lib/components/context/ZudokuContext.js.map +1 -1
- package/dist/lib/components/index.d.ts +18 -8
- package/dist/lib/components/index.js +10 -3
- package/dist/lib/components/index.js.map +1 -1
- package/dist/lib/components/navigation/Sidebar.js +3 -3
- package/dist/lib/components/navigation/Sidebar.js.map +1 -1
- package/dist/lib/components/navigation/SidebarCategory.js +18 -9
- package/dist/lib/components/navigation/SidebarCategory.js.map +1 -1
- package/dist/lib/components/navigation/SidebarItem.js +12 -7
- package/dist/lib/components/navigation/SidebarItem.js.map +1 -1
- package/dist/lib/components/navigation/utils.js +10 -14
- package/dist/lib/components/navigation/utils.js.map +1 -1
- package/dist/lib/core/DevPortalContext.d.ts +4 -7
- package/dist/lib/core/DevPortalContext.js.map +1 -1
- package/dist/lib/core/plugins.d.ts +1 -0
- package/dist/lib/core/plugins.js.map +1 -1
- package/dist/lib/errors/ErrorAlert.d.ts +1 -1
- package/dist/lib/errors/ErrorAlert.js +8 -3
- package/dist/lib/errors/ErrorAlert.js.map +1 -1
- package/dist/lib/oas/graphql/index.d.ts +2 -1
- package/dist/lib/oas/graphql/index.js +24 -16
- package/dist/lib/oas/graphql/index.js.map +1 -1
- package/dist/lib/oas/parser/index.d.ts +1 -0
- package/dist/lib/oas/parser/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/custom-pages/CustomPage.d.ts +2 -0
- package/dist/lib/plugins/custom-pages/CustomPage.js +11 -0
- package/dist/lib/plugins/custom-pages/CustomPage.js.map +1 -0
- package/dist/lib/plugins/custom-pages/index.d.ts +10 -0
- package/dist/lib/plugins/custom-pages/index.js +11 -0
- package/dist/lib/plugins/custom-pages/index.js.map +1 -0
- package/dist/lib/plugins/markdown/MdxPage.js +2 -2
- package/dist/lib/plugins/markdown/MdxPage.js.map +1 -1
- package/dist/lib/plugins/markdown/index.d.ts +5 -5
- package/dist/lib/plugins/markdown/index.js +31 -3
- package/dist/lib/plugins/markdown/index.js.map +1 -1
- package/dist/lib/plugins/markdown/resolver.d.ts +38 -0
- package/dist/lib/plugins/markdown/resolver.js +75 -0
- package/dist/lib/plugins/markdown/resolver.js.map +1 -0
- package/dist/lib/plugins/openapi/Endpoint.d.ts +1 -3
- package/dist/lib/plugins/openapi/Endpoint.js +46 -8
- package/dist/lib/plugins/openapi/Endpoint.js.map +1 -1
- package/dist/lib/plugins/openapi/OperationList.js +2 -2
- package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
- package/dist/lib/plugins/openapi/OperationListItem.js +1 -1
- package/dist/lib/plugins/openapi/OperationListItem.js.map +1 -1
- package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.d.ts +2 -1
- package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.js +2 -2
- package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.js.map +1 -1
- package/dist/lib/plugins/openapi/RequestBodySidecarBox.js.map +1 -1
- package/dist/lib/plugins/openapi/Route.d.ts +1 -1
- package/dist/lib/plugins/openapi/Route.js +1 -1
- package/dist/lib/plugins/openapi/Route.js.map +1 -1
- package/dist/lib/plugins/openapi/Sidecar.js +17 -6
- package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
- package/dist/lib/plugins/openapi/SimpleSelect.d.ts +2 -1
- package/dist/lib/plugins/openapi/SimpleSelect.js +1 -1
- package/dist/lib/plugins/openapi/SimpleSelect.js.map +1 -1
- package/dist/lib/plugins/openapi/client/createMemoryClient.js +1 -1
- package/dist/lib/plugins/openapi/client/createMemoryClient.js.map +1 -1
- package/dist/lib/plugins/openapi/client/createWorkerClient.js +1 -1
- package/dist/lib/plugins/openapi/client/createWorkerClient.js.map +1 -1
- package/dist/lib/plugins/openapi/client/worker.js.map +1 -1
- package/dist/lib/plugins/openapi/graphql/gql.d.ts +10 -2
- package/dist/lib/plugins/openapi/graphql/gql.js +2 -1
- package/dist/lib/plugins/openapi/graphql/gql.js.map +1 -1
- package/dist/lib/plugins/openapi/graphql/graphql.d.ts +29 -3
- package/dist/lib/plugins/openapi/graphql/graphql.js +87 -0
- package/dist/lib/plugins/openapi/graphql/graphql.js.map +1 -1
- package/dist/lib/plugins/openapi/index.js +1 -1
- package/dist/lib/plugins/openapi/index.js.map +1 -1
- package/dist/lib/plugins/openapi/interfaces.d.ts +3 -0
- package/dist/lib/plugins/openapi/playground/Playground.d.ts +2 -1
- package/dist/lib/plugins/openapi/playground/Playground.js +15 -6
- package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js +1 -1
- package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/ResponseTab.js +1 -1
- package/dist/lib/plugins/openapi/playground/ResponseTab.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/createUrl.js +3 -1
- package/dist/lib/plugins/openapi/playground/createUrl.js.map +1 -1
- package/dist/lib/plugins/redirect/index.d.ts +2 -5
- package/dist/lib/plugins/redirect/index.js +1 -1
- package/dist/lib/plugins/redirect/index.js.map +1 -1
- package/dist/lib/ui/Accordion.d.ts +7 -0
- package/dist/lib/ui/Accordion.js +14 -0
- package/dist/lib/ui/Accordion.js.map +1 -0
- package/dist/lib/ui/Alert.d.ts +8 -0
- package/dist/lib/ui/Alert.js +23 -0
- package/dist/lib/ui/Alert.js.map +1 -0
- package/dist/lib/ui/AlertDialog.d.ts +20 -0
- package/dist/lib/ui/AlertDialog.js +27 -0
- package/dist/lib/ui/AlertDialog.js.map +1 -0
- package/dist/lib/ui/AspectRatio.d.ts +3 -0
- package/dist/lib/ui/AspectRatio.js +4 -0
- package/dist/lib/ui/AspectRatio.js.map +1 -0
- package/dist/lib/ui/Badge.d.ts +9 -0
- package/dist/lib/ui/Badge.js +21 -0
- package/dist/lib/ui/Badge.js.map +1 -0
- package/dist/lib/ui/Breadcrumb.d.ts +19 -0
- package/dist/lib/ui/Breadcrumb.js +24 -0
- package/dist/lib/ui/Breadcrumb.js.map +1 -0
- package/dist/lib/ui/Button.d.ts +2 -3
- package/dist/lib/ui/Button.js +1 -1
- package/dist/lib/ui/Button.js.map +1 -1
- package/dist/lib/ui/Callout.d.ts +36 -35
- package/dist/lib/ui/Callout.js.map +1 -1
- package/dist/lib/ui/Carousel.d.ts +18 -0
- package/dist/lib/ui/Carousel.js +99 -0
- package/dist/lib/ui/Carousel.js.map +1 -0
- package/dist/lib/ui/Checkbox.d.ts +4 -0
- package/dist/lib/ui/Checkbox.js +9 -0
- package/dist/lib/ui/Checkbox.js.map +1 -0
- package/dist/lib/ui/Collapsible.d.ts +5 -0
- package/dist/lib/ui/Collapsible.js +6 -0
- package/dist/lib/ui/Collapsible.js.map +1 -0
- package/dist/lib/ui/Command.d.ts +80 -0
- package/dist/lib/ui/Command.js +31 -0
- package/dist/lib/ui/Command.js.map +1 -0
- package/dist/lib/{components → ui}/Dialog.js +2 -2
- package/dist/lib/ui/Dialog.js.map +1 -0
- package/dist/lib/ui/Drawer.d.ts +8 -10
- package/dist/lib/ui/Drawer.js.map +1 -1
- package/dist/lib/ui/Form.d.ts +23 -0
- package/dist/lib/ui/Form.js +63 -0
- package/dist/lib/ui/Form.js.map +1 -0
- package/dist/lib/ui/HoverCard.d.ts +6 -0
- package/dist/lib/ui/HoverCard.js +10 -0
- package/dist/lib/ui/HoverCard.js.map +1 -0
- package/dist/lib/ui/Label.d.ts +5 -0
- package/dist/lib/ui/Label.js +10 -0
- package/dist/lib/ui/Label.js.map +1 -0
- package/dist/lib/ui/Pagination.d.ts +28 -0
- package/dist/lib/ui/Pagination.js +24 -0
- package/dist/lib/ui/Pagination.js.map +1 -0
- package/dist/lib/ui/Popover.d.ts +6 -0
- package/dist/lib/ui/Popover.js +10 -0
- package/dist/lib/ui/Popover.js.map +1 -0
- package/dist/lib/ui/Progress.d.ts +4 -0
- package/dist/lib/ui/Progress.js +8 -0
- package/dist/lib/ui/Progress.js.map +1 -0
- package/dist/lib/ui/RadioGroup.d.ts +5 -0
- package/dist/lib/ui/RadioGroup.js +15 -0
- package/dist/lib/ui/RadioGroup.js.map +1 -0
- package/dist/lib/ui/ScrollArea.d.ts +5 -0
- package/dist/lib/ui/ScrollArea.js +12 -0
- package/dist/lib/ui/ScrollArea.js.map +1 -0
- package/dist/lib/ui/Select.js.map +1 -0
- package/dist/lib/ui/Skeleton.d.ts +2 -0
- package/dist/lib/ui/Skeleton.js +7 -0
- package/dist/lib/ui/Skeleton.js.map +1 -0
- package/dist/lib/ui/Slider.d.ts +4 -0
- package/dist/lib/ui/Slider.js +8 -0
- package/dist/lib/ui/Slider.js.map +1 -0
- package/dist/lib/ui/Switch.d.ts +4 -0
- package/dist/lib/ui/Switch.js +8 -0
- package/dist/lib/ui/Switch.js.map +1 -0
- package/dist/lib/ui/Textarea.d.ts +4 -0
- package/dist/lib/ui/Textarea.js +9 -0
- package/dist/lib/ui/Textarea.js.map +1 -0
- package/dist/lib/ui/Toggle.d.ts +12 -0
- package/dist/lib/ui/Toggle.js +26 -0
- package/dist/lib/ui/Toggle.js.map +1 -0
- package/dist/lib/ui/ToggleGroup.d.ts +12 -0
- package/dist/lib/ui/ToggleGroup.js +21 -0
- package/dist/lib/ui/ToggleGroup.js.map +1 -0
- package/dist/lib/ui/Tooltip.d.ts +7 -0
- package/dist/lib/ui/Tooltip.js +11 -0
- package/dist/lib/ui/Tooltip.js.map +1 -0
- package/dist/lib/util/MdxComponents.js.map +1 -1
- package/dist/lib/util/invariant.d.ts +9 -0
- package/dist/lib/util/invariant.js +7 -3
- package/dist/lib/util/invariant.js.map +1 -1
- package/dist/lib/util/useExposedProps.d.ts +2 -0
- package/dist/lib/util/useExposedProps.js +9 -0
- package/dist/lib/util/useExposedProps.js.map +1 -0
- package/dist/lib/util/useScrollToAnchor.js.map +1 -1
- package/dist/vite/build.js +12 -3
- package/dist/vite/build.js.map +1 -1
- package/dist/vite/config.d.ts +3 -9
- package/dist/vite/config.js +40 -69
- package/dist/vite/config.js.map +1 -1
- package/dist/vite/debug.d.ts +1 -0
- package/dist/vite/debug.js +10 -0
- package/dist/vite/debug.js.map +1 -0
- package/dist/vite/dev-server.d.ts +7 -1
- package/dist/vite/dev-server.js +20 -16
- package/dist/vite/dev-server.js.map +1 -1
- package/dist/vite/output.d.ts +101 -0
- package/dist/vite/output.js +30 -0
- package/dist/vite/output.js.map +1 -0
- package/dist/vite/plugin-api.js +4 -7
- package/dist/vite/plugin-api.js.map +1 -1
- package/dist/vite/plugin-component.js +17 -8
- package/dist/vite/plugin-component.js.map +1 -1
- package/dist/vite/plugin-config-reload.js +7 -4
- package/dist/vite/plugin-config-reload.js.map +1 -1
- package/dist/vite/plugin-config.d.ts +2 -3
- package/dist/vite/plugin-config.js +2 -3
- package/dist/vite/plugin-config.js.map +1 -1
- package/dist/vite/plugin-custom-pages.d.ts +4 -0
- package/dist/vite/plugin-custom-pages.js +30 -0
- package/dist/vite/plugin-custom-pages.js.map +1 -0
- package/dist/vite/plugin-docs.js +37 -24
- package/dist/vite/plugin-docs.js.map +1 -1
- package/dist/vite/plugin-frontmatter.d.ts +3 -0
- package/dist/vite/plugin-frontmatter.js +33 -0
- package/dist/vite/plugin-frontmatter.js.map +1 -0
- package/dist/vite/plugin-mdx.js +17 -0
- package/dist/vite/plugin-mdx.js.map +1 -1
- package/dist/vite/plugin-search.d.ts +3 -0
- package/dist/vite/plugin-search.js +26 -0
- package/dist/vite/plugin-search.js.map +1 -0
- package/dist/vite/plugin-sidebar.js +21 -7
- package/dist/vite/plugin-sidebar.js.map +1 -1
- package/dist/vite/plugin.js +7 -3
- package/dist/vite/plugin.js.map +1 -1
- package/dist/vite/prerender.d.ts +5 -1
- package/dist/vite/prerender.js +6 -5
- package/dist/vite/prerender.js.map +1 -1
- package/lib/{utils-ByIc_KIM.js → AnchorLink-BbB2q-jx.js} +231 -275
- package/lib/AnchorLink-BbB2q-jx.js.map +1 -0
- package/lib/{AuthenticationPlugin-Bx9FK124.js → AuthenticationPlugin-C9BHGXlE.js} +3 -3
- package/lib/{AuthenticationPlugin-Bx9FK124.js.map → AuthenticationPlugin-C9BHGXlE.js.map} +1 -1
- package/lib/{CategoryHeading-XnFqN2lJ.js → CategoryHeading-Bb9dqxD3.js} +4 -4
- package/lib/{CategoryHeading-XnFqN2lJ.js.map → CategoryHeading-Bb9dqxD3.js.map} +1 -1
- package/lib/ClientOnly-CVN6leDu.js +11 -0
- package/lib/ClientOnly-CVN6leDu.js.map +1 -0
- package/lib/{DeveloperHint-FBb2uXJe.js → DeveloperHint-DHdLXGHA.js} +2 -2
- package/lib/{DeveloperHint-FBb2uXJe.js.map → DeveloperHint-DHdLXGHA.js.map} +1 -1
- package/lib/Dialog-k70Qfukb.js +67 -0
- package/lib/Dialog-k70Qfukb.js.map +1 -0
- package/lib/{Markdown-B4aR03g6.js → Markdown-BDcCAWwm.js} +4298 -6518
- package/lib/Markdown-BDcCAWwm.js.map +1 -0
- package/lib/{MdxPage-BZyQsH8Z.js → MdxPage-DKMH_t0f.js} +25 -23
- package/lib/MdxPage-DKMH_t0f.js.map +1 -0
- package/lib/{OperationList-2NeWEM0u.js → OperationList-Tj7ubW_t.js} +181 -137
- package/lib/OperationList-Tj7ubW_t.js.map +1 -0
- package/lib/{Route-BZPewmrN.js → Route-C3DGB6OS.js} +3 -4
- package/lib/Route-C3DGB6OS.js.map +1 -0
- package/lib/Select-Bagt3Bme.js +223 -0
- package/lib/Select-Bagt3Bme.js.map +1 -0
- package/lib/SlotletProvider-Da7eFgd2.js +241 -0
- package/lib/SlotletProvider-Da7eFgd2.js.map +1 -0
- package/lib/Spinner-C6zroowC.js +40 -0
- package/lib/Spinner-C6zroowC.js.map +1 -0
- package/lib/StaggeredRender-DDHSzQKE.js +17 -0
- package/lib/StaggeredRender-DDHSzQKE.js.map +1 -0
- package/lib/ZudokuContext-BKXGJTmu.js +1222 -0
- package/lib/ZudokuContext-BKXGJTmu.js.map +1 -0
- package/lib/__vite-browser-external-BYRIRx8p.js +9 -0
- package/lib/__vite-browser-external-BYRIRx8p.js.map +1 -0
- package/lib/assets/{index-B9EWVYfo.js → index-B_Jk_Yzp.js} +968 -938
- package/lib/assets/index-B_Jk_Yzp.js.map +1 -0
- package/lib/assets/{worker-BvD7B6MG.js → worker-Bf8vjASY.js} +6769 -4411
- package/lib/assets/worker-Bf8vjASY.js.map +1 -0
- package/lib/cn-BmFQLtkS.js +2279 -0
- package/lib/cn-BmFQLtkS.js.map +1 -0
- package/lib/hook-sn0zMTkE.js +229 -0
- package/lib/hook-sn0zMTkE.js.map +1 -0
- package/lib/{index-Dv2KZuEw.js → index-AjWCJNGC.js} +1681 -1676
- package/lib/index-AjWCJNGC.js.map +1 -0
- package/lib/index-Bn6Lc9tq.js +9 -0
- package/lib/index-Bn6Lc9tq.js.map +1 -0
- package/lib/index-BuAyrJe3.js +46 -0
- package/lib/index-BuAyrJe3.js.map +1 -0
- package/lib/{index-BG0g4WW0.js → index-CRo94sKK.js} +750 -738
- package/lib/index-CRo94sKK.js.map +1 -0
- package/lib/{index-CLd8ycZz.js → index-CkwDvuPt.js} +947 -917
- package/lib/index-CkwDvuPt.js.map +1 -0
- package/lib/index-LNp6rxyU.js +2094 -0
- package/lib/index-LNp6rxyU.js.map +1 -0
- package/lib/index.esm-C5mr_sKO.js +1193 -0
- package/lib/index.esm-C5mr_sKO.js.map +1 -0
- package/lib/invariant-Caa8-XvF.js +26 -0
- package/lib/invariant-Caa8-XvF.js.map +1 -0
- package/lib/router-BsfSoK2j.js +3024 -0
- package/lib/router-BsfSoK2j.js.map +1 -0
- package/lib/state-CsuHT8ZO.js +183 -0
- package/lib/state-CsuHT8ZO.js.map +1 -0
- package/lib/ui/Accordion.js +47 -0
- package/lib/ui/Accordion.js.map +1 -0
- package/lib/ui/Alert.js +51 -0
- package/lib/ui/Alert.js.map +1 -0
- package/lib/ui/AlertDialog.js +114 -0
- package/lib/ui/AlertDialog.js.map +1 -0
- package/lib/ui/AspectRatio.js +6 -0
- package/lib/ui/AspectRatio.js.map +1 -0
- package/lib/ui/Badge.js +27 -0
- package/lib/ui/Badge.js.map +1 -0
- package/lib/ui/Breadcrumb.js +94 -0
- package/lib/ui/Breadcrumb.js.map +1 -0
- package/lib/ui/Button.js +49 -0
- package/lib/ui/Button.js.map +1 -0
- package/lib/ui/Callout.js +77 -0
- package/lib/ui/Callout.js.map +1 -0
- package/lib/ui/Card.js +62 -0
- package/lib/ui/Card.js.map +1 -0
- package/lib/ui/Carousel.js +1410 -0
- package/lib/ui/Carousel.js.map +1 -0
- package/lib/ui/Checkbox.js +28 -0
- package/lib/ui/Checkbox.js.map +1 -0
- package/lib/ui/Collapsible.js +8 -0
- package/lib/ui/Collapsible.js.map +1 -0
- package/lib/ui/Command.js +550 -0
- package/lib/ui/Command.js.map +1 -0
- package/lib/ui/Dialog.js +101 -0
- package/lib/ui/Dialog.js.map +1 -0
- package/lib/ui/Drawer.js +1153 -0
- package/lib/ui/Drawer.js.map +1 -0
- package/lib/ui/DropdownMenu.js +145 -0
- package/lib/ui/DropdownMenu.js.map +1 -0
- package/lib/ui/Form.js +95 -0
- package/lib/ui/Form.js.map +1 -0
- package/lib/ui/HoverCard.js +24 -0
- package/lib/ui/HoverCard.js.map +1 -0
- package/lib/ui/Input.js +22 -0
- package/lib/ui/Input.js.map +1 -0
- package/lib/ui/Label.js +20 -0
- package/lib/ui/Label.js.map +1 -0
- package/lib/ui/Pagination.js +106 -0
- package/lib/ui/Pagination.js.map +1 -0
- package/lib/ui/Popover.js +24 -0
- package/lib/ui/Popover.js.map +1 -0
- package/lib/ui/Progress.js +27 -0
- package/lib/ui/Progress.js.map +1 -0
- package/lib/ui/RadioGroup.js +32 -0
- package/lib/ui/RadioGroup.js.map +1 -0
- package/lib/ui/ScrollArea.js +39 -0
- package/lib/ui/ScrollArea.js.map +1 -0
- package/lib/ui/Select.js +122 -0
- package/lib/ui/Select.js.map +1 -0
- package/lib/ui/Skeleton.js +18 -0
- package/lib/ui/Skeleton.js.map +1 -0
- package/lib/ui/Slider.js +24 -0
- package/lib/ui/Slider.js.map +1 -0
- package/lib/ui/Switch.js +28 -0
- package/lib/ui/Switch.js.map +1 -0
- package/lib/ui/Tabs.js +47 -0
- package/lib/ui/Tabs.js.map +1 -0
- package/lib/ui/Textarea.js +21 -0
- package/lib/ui/Textarea.js.map +1 -0
- package/lib/ui/Toggle.js +38 -0
- package/lib/ui/Toggle.js.map +1 -0
- package/lib/ui/ToggleGroup.js +42 -0
- package/lib/ui/ToggleGroup.js.map +1 -0
- package/lib/ui/Tooltip.js +24 -0
- package/lib/ui/Tooltip.js.map +1 -0
- package/lib/urql-core-KJnLL26g.js +1455 -0
- package/lib/urql-core-KJnLL26g.js.map +1 -0
- package/lib/useExposedProps-ChOIUaS4.js +9 -0
- package/lib/useExposedProps-ChOIUaS4.js.map +1 -0
- package/lib/zudoku.auth-auth0.js +1 -1
- package/lib/zudoku.auth-clerk.js +2 -2
- package/lib/zudoku.auth-openid.js +541 -534
- package/lib/zudoku.auth-openid.js.map +1 -1
- package/lib/zudoku.components.js +953 -2849
- package/lib/zudoku.components.js.map +1 -1
- package/lib/zudoku.openapi-worker.js +4668 -4380
- package/lib/zudoku.openapi-worker.js.map +1 -1
- package/lib/zudoku.plugin-api-keys.js +69 -76
- package/lib/zudoku.plugin-api-keys.js.map +1 -1
- package/lib/zudoku.plugin-custom-pages.js +22 -0
- package/lib/zudoku.plugin-custom-pages.js.map +1 -0
- package/lib/zudoku.plugin-markdown.js +93 -24
- package/lib/zudoku.plugin-markdown.js.map +1 -1
- package/lib/zudoku.plugin-openapi.js +9 -10
- package/lib/zudoku.plugin-openapi.js.map +1 -1
- package/lib/zudoku.plugin-redirect.js +2 -2
- package/lib/zudoku.plugin-redirect.js.map +1 -1
- package/lib/zudoku.plugin-search-inkeep.js +9 -13
- package/lib/zudoku.plugin-search-inkeep.js.map +1 -1
- package/package.json +98 -72
- package/src/app/entry.client.tsx +4 -2
- package/src/app/entry.server.tsx +4 -0
- package/src/app/main.css +4 -1
- package/src/app/main.tsx +15 -33
- package/src/app/standalone.tsx +1 -1
- package/src/lib/authentication/components/CallbackHandler.tsx +20 -51
- package/src/lib/authentication/hook.ts +1 -1
- package/src/lib/authentication/state.ts +17 -0
- package/src/lib/components/Banner.tsx +12 -2
- package/src/lib/components/ErrorPage.tsx +0 -2
- package/src/lib/components/Header.tsx +21 -4
- package/src/lib/components/InlineCode.tsx +10 -0
- package/src/lib/components/Layout.tsx +2 -1
- package/src/lib/components/MobileTopNavigation.tsx +10 -2
- package/src/lib/components/Search.tsx +1 -1
- package/src/lib/components/SlotletProvider.tsx +29 -4
- package/src/lib/components/SyntaxHighlight.tsx +5 -1
- package/src/lib/components/TopNavigation.tsx +70 -23
- package/src/lib/components/context/ZudokuContext.ts +28 -20
- package/src/lib/components/index.ts +13 -4
- package/src/lib/components/navigation/Sidebar.tsx +6 -6
- package/src/lib/components/navigation/SidebarCategory.tsx +35 -29
- package/src/lib/components/navigation/SidebarItem.tsx +17 -20
- package/src/lib/components/navigation/utils.ts +11 -16
- package/src/lib/core/DevPortalContext.ts +4 -3
- package/src/lib/core/plugins.ts +2 -0
- package/src/lib/errors/ErrorAlert.tsx +18 -5
- package/src/lib/oas/graphql/index.ts +36 -24
- package/src/lib/oas/parser/index.ts +1 -0
- package/src/lib/plugins/api-keys/CreateApiKey.tsx +2 -2
- package/src/lib/plugins/custom-pages/CustomPage.tsx +18 -0
- package/src/lib/plugins/custom-pages/index.tsx +24 -0
- package/src/lib/plugins/markdown/MdxPage.tsx +11 -9
- package/src/lib/plugins/markdown/index.tsx +49 -10
- package/src/lib/plugins/markdown/resolver.ts +92 -0
- package/src/lib/plugins/openapi/Endpoint.tsx +86 -22
- package/src/lib/plugins/openapi/OperationList.tsx +4 -2
- package/src/lib/plugins/openapi/OperationListItem.tsx +1 -1
- package/src/lib/plugins/openapi/PlaygroundDialogWrapper.tsx +3 -0
- package/src/lib/plugins/openapi/RequestBodySidecarBox.tsx +1 -1
- package/src/lib/plugins/openapi/Route.tsx +1 -2
- package/src/lib/plugins/openapi/Sidecar.tsx +21 -6
- package/src/lib/plugins/openapi/SimpleSelect.tsx +10 -2
- package/src/lib/plugins/openapi/client/createMemoryClient.ts +1 -6
- package/src/lib/plugins/openapi/client/createWorkerClient.ts +1 -6
- package/src/lib/plugins/openapi/client/worker.ts +2 -2
- package/src/lib/plugins/openapi/graphql/gql.ts +11 -3
- package/src/lib/plugins/openapi/graphql/graphql.ts +116 -4
- package/src/lib/plugins/openapi/index.tsx +2 -6
- package/src/lib/plugins/openapi/interfaces.ts +4 -1
- package/src/lib/plugins/openapi/playground/Playground.tsx +42 -7
- package/src/lib/plugins/openapi/playground/PlaygroundDialog.tsx +1 -1
- package/src/lib/plugins/openapi/playground/ResponseTab.tsx +0 -1
- package/src/lib/plugins/openapi/playground/createUrl.ts +6 -1
- package/src/lib/plugins/redirect/index.tsx +3 -7
- package/src/lib/ui/Accordion.tsx +56 -0
- package/src/lib/ui/{Note.tsx → Alert.tsx} +11 -10
- package/src/lib/ui/AlertDialog.tsx +139 -0
- package/src/lib/ui/AspectRatio.tsx +5 -0
- package/src/lib/ui/Badge.tsx +36 -0
- package/src/lib/ui/Breadcrumb.tsx +115 -0
- package/src/lib/ui/Button.tsx +1 -1
- package/src/lib/ui/Callout.tsx +7 -6
- package/src/lib/ui/Carousel.tsx +260 -0
- package/src/lib/ui/Checkbox.tsx +28 -0
- package/src/lib/ui/Collapsible.tsx +9 -0
- package/src/lib/ui/Command.tsx +151 -0
- package/src/lib/{components → ui}/Dialog.tsx +4 -3
- package/src/lib/ui/Drawer.tsx +38 -36
- package/src/lib/ui/Form.tsx +177 -0
- package/src/lib/ui/HoverCard.tsx +27 -0
- package/src/lib/ui/Label.tsx +24 -0
- package/src/lib/ui/Pagination.tsx +117 -0
- package/src/lib/ui/Popover.tsx +29 -0
- package/src/lib/ui/Progress.tsx +26 -0
- package/src/lib/ui/RadioGroup.tsx +42 -0
- package/src/lib/ui/ScrollArea.tsx +46 -0
- package/src/lib/ui/Skeleton.tsx +15 -0
- package/src/lib/ui/Slider.tsx +26 -0
- package/src/lib/ui/Switch.tsx +27 -0
- package/src/lib/ui/Textarea.tsx +23 -0
- package/src/lib/ui/Toggle.tsx +43 -0
- package/src/lib/ui/ToggleGroup.tsx +59 -0
- package/src/lib/ui/Tooltip.tsx +28 -0
- package/src/lib/util/MdxComponents.tsx +0 -1
- package/src/lib/util/invariant.ts +15 -3
- package/src/lib/util/useExposedProps.tsx +16 -0
- package/src/lib/util/useScrollToAnchor.ts +1 -1
- package/dist/internal.d.ts +0 -1
- package/dist/internal.js +0 -2
- package/dist/internal.js.map +0 -1
- package/dist/lib/components/Dialog.js.map +0 -1
- package/dist/lib/components/Select.js.map +0 -1
- package/dist/lib/plugins/custom-page/index.d.ts +0 -8
- package/dist/lib/plugins/custom-page/index.js +0 -12
- package/dist/lib/plugins/custom-page/index.js.map +0 -1
- package/dist/lib/plugins/markdown/generateRoutes.d.ts +0 -3
- package/dist/lib/plugins/markdown/generateRoutes.js +0 -19
- package/dist/lib/plugins/markdown/generateRoutes.js.map +0 -1
- package/dist/lib/plugins/openapi/playground/Editor.d.ts +0 -1
- package/dist/lib/plugins/openapi/playground/Editor.js +0 -5
- package/dist/lib/plugins/openapi/playground/Editor.js.map +0 -1
- package/dist/lib/plugins/openapi/util/urql.d.ts +0 -7
- package/dist/lib/plugins/openapi/util/urql.js +0 -8
- package/dist/lib/plugins/openapi/util/urql.js.map +0 -1
- package/dist/lib/ui/Note.d.ts +0 -8
- package/dist/lib/ui/Note.js +0 -23
- package/dist/lib/ui/Note.js.map +0 -1
- package/dist/lib/util/slugify.d.ts +0 -2
- package/dist/lib/util/slugify.js +0 -3
- package/dist/lib/util/slugify.js.map +0 -1
- package/dist/vite/plugin-icons.d.ts +0 -3
- package/dist/vite/plugin-icons.js +0 -47
- package/dist/vite/plugin-icons.js.map +0 -1
- package/lib/ErrorPage-knunPbKI.js +0 -18
- package/lib/ErrorPage-knunPbKI.js.map +0 -1
- package/lib/Input-BEDZAKw0.js +0 -2198
- package/lib/Input-BEDZAKw0.js.map +0 -1
- package/lib/Markdown-B4aR03g6.js.map +0 -1
- package/lib/MdxPage-BZyQsH8Z.js.map +0 -1
- package/lib/OperationList-2NeWEM0u.js.map +0 -1
- package/lib/Route-BZPewmrN.js.map +0 -1
- package/lib/SidebarBadge-COz0hgfa.js +0 -498
- package/lib/SidebarBadge-COz0hgfa.js.map +0 -1
- package/lib/SlotletProvider-DJMaOUDs.js +0 -238
- package/lib/SlotletProvider-DJMaOUDs.js.map +0 -1
- package/lib/Spinner-3cQDBVGr.js +0 -7
- package/lib/Spinner-3cQDBVGr.js.map +0 -1
- package/lib/ZudokuContext-cr-pTRY1.js +0 -1084
- package/lib/ZudokuContext-cr-pTRY1.js.map +0 -1
- package/lib/assets/index-B9EWVYfo.js.map +0 -1
- package/lib/assets/worker-BvD7B6MG.js.map +0 -1
- package/lib/index-1EDgIO6b.js +0 -124
- package/lib/index-1EDgIO6b.js.map +0 -1
- package/lib/index-BG0g4WW0.js.map +0 -1
- package/lib/index-CLd8ycZz.js.map +0 -1
- package/lib/index-Dv2KZuEw.js.map +0 -1
- package/lib/index-Zezcv0xb.js +0 -2814
- package/lib/index-Zezcv0xb.js.map +0 -1
- package/lib/joinPath-B7kNnUX4.js +0 -8
- package/lib/joinPath-B7kNnUX4.js.map +0 -1
- package/lib/router-D2p7Olpn.js +0 -2971
- package/lib/router-D2p7Olpn.js.map +0 -1
- package/lib/slugify-DbLhpSPt.js +0 -28
- package/lib/slugify-DbLhpSPt.js.map +0 -1
- package/lib/state-lIwt9isb.js +0 -288
- package/lib/state-lIwt9isb.js.map +0 -1
- package/lib/urql-YhcsXYy8.js +0 -1591
- package/lib/urql-YhcsXYy8.js.map +0 -1
- package/lib/utils-ByIc_KIM.js.map +0 -1
- package/lib/zudoku.plugin-custom-page.js +0 -13
- package/lib/zudoku.plugin-custom-page.js.map +0 -1
- package/src/lib/plugins/custom-page/index.tsx +0 -22
- package/src/lib/plugins/markdown/generateRoutes.tsx +0 -35
- package/src/lib/plugins/openapi/playground/Editor.tsx +0 -4
- package/src/lib/plugins/openapi/util/urql.ts +0 -8
- package/src/lib/util/slugify.ts +0 -3
- /package/dist/lib/{components → ui}/Dialog.d.ts +0 -0
- /package/dist/lib/{components → ui}/Select.d.ts +0 -0
- /package/dist/lib/{components → ui}/Select.js +0 -0
- /package/src/lib/{components → ui}/Select.tsx +0 -0
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import type { Toc } from "@stefanprobst/rehype-extract-toc";
|
|
2
2
|
import type { MDXProps } from "mdx/types.js";
|
|
3
|
+
import { RouteObject } from "react-router-dom";
|
|
4
|
+
import { ZudokuDocsConfig } from "../../../config/validators/validate.js";
|
|
3
5
|
import type { DevPortalPlugin } from "../../core/plugins.js";
|
|
4
|
-
import {
|
|
6
|
+
import { DocResolver } from "./resolver.js";
|
|
5
7
|
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
};
|
|
8
|
+
export interface MarkdownPluginOptions extends ZudokuDocsConfig {
|
|
9
|
+
fileImports: Record<string, () => Promise<MDXImport>>;
|
|
10
|
+
}
|
|
10
11
|
export type MarkdownPluginDefaultOptions = Pick<
|
|
11
12
|
Frontmatter,
|
|
12
13
|
"toc" | "disablePager"
|
|
@@ -26,9 +27,47 @@ export type MDXImport = {
|
|
|
26
27
|
default: (props: MDXProps) => JSX.Element;
|
|
27
28
|
};
|
|
28
29
|
|
|
29
|
-
export const markdownPlugin = (
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
export const markdownPlugin = (
|
|
31
|
+
options: MarkdownPluginOptions[],
|
|
32
|
+
): DevPortalPlugin => ({
|
|
33
|
+
getRoutes: () => {
|
|
34
|
+
const routeMap = new Map<string, RouteObject>();
|
|
35
|
+
options.forEach(({ fileImports, files, defaultOptions }) =>
|
|
36
|
+
Object.entries(fileImports).flatMap(([file, importPromise]) => {
|
|
37
|
+
const routePath = DocResolver.resolveRoutePath({
|
|
38
|
+
filesGlob: files,
|
|
39
|
+
fsPath: file,
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
if (!routePath) return [];
|
|
43
|
+
|
|
44
|
+
if (routeMap.has(routePath)) {
|
|
45
|
+
// eslint-disable-next-line no-console
|
|
46
|
+
console.warn(
|
|
47
|
+
`Duplicate route path found for ${routePath}. Skipping file at '${file}'.`,
|
|
48
|
+
);
|
|
49
|
+
return [];
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const route: RouteObject = {
|
|
53
|
+
path: routePath,
|
|
54
|
+
lazy: async () => {
|
|
55
|
+
const { MdxPage } = await import("./MdxPage.js");
|
|
56
|
+
const { default: Component, ...props } = await importPromise();
|
|
57
|
+
return {
|
|
58
|
+
element: (
|
|
59
|
+
<MdxPage
|
|
60
|
+
mdxComponent={Component}
|
|
61
|
+
{...props}
|
|
62
|
+
defaultOptions={defaultOptions}
|
|
63
|
+
/>
|
|
64
|
+
),
|
|
65
|
+
};
|
|
66
|
+
},
|
|
67
|
+
};
|
|
68
|
+
routeMap.set(routePath, route);
|
|
69
|
+
}),
|
|
70
|
+
);
|
|
71
|
+
return [...routeMap.values()];
|
|
72
|
+
},
|
|
34
73
|
});
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import fs from "fs";
|
|
2
|
+
import path from "path";
|
|
3
|
+
import {
|
|
4
|
+
ZudokuConfig,
|
|
5
|
+
ZudokuDocsConfig,
|
|
6
|
+
} from "../../../config/validators/validate.js";
|
|
7
|
+
|
|
8
|
+
const DEFAULT_DOCS_FILES = "/pages/**/*.{md,mdx}";
|
|
9
|
+
|
|
10
|
+
// TODO: This should be dynamic based on the glob selector
|
|
11
|
+
const SUPPORTED_EXTENSIONS = [".md", ".mdx"];
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Utilities for resolving markdown file paths and routes
|
|
15
|
+
*/
|
|
16
|
+
export class DocResolver {
|
|
17
|
+
constructor(private config: ZudokuConfig) {}
|
|
18
|
+
|
|
19
|
+
fileMap = new Map<string, string>();
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Gets the default docs config from the zudoku config
|
|
23
|
+
*/
|
|
24
|
+
getDocsConfigs() {
|
|
25
|
+
const docsConfigs: ZudokuDocsConfig[] = this.config.docs
|
|
26
|
+
? Array.isArray(this.config.docs)
|
|
27
|
+
? this.config.docs
|
|
28
|
+
: [this.config.docs]
|
|
29
|
+
: [{ files: DEFAULT_DOCS_FILES }];
|
|
30
|
+
|
|
31
|
+
return docsConfigs;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Resolves the first matching file system path for a given docId
|
|
36
|
+
* @param docId - The docId to resolve
|
|
37
|
+
* @returns
|
|
38
|
+
*/
|
|
39
|
+
resolveFilePath(docId: string) {
|
|
40
|
+
const docsConfigs = this.getDocsConfigs();
|
|
41
|
+
let fsPath: string | undefined;
|
|
42
|
+
|
|
43
|
+
docsConfigs.forEach(({ files: fileGlob }) => {
|
|
44
|
+
if (fsPath) {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
const rootDir = DocResolver.getRootDir(fileGlob);
|
|
48
|
+
for (const ext of SUPPORTED_EXTENSIONS) {
|
|
49
|
+
if (fsPath) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
const checkPath = path.join(rootDir, `${docId}${ext}`);
|
|
53
|
+
if (fs.existsSync(checkPath)) {
|
|
54
|
+
fsPath = checkPath;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
return fsPath;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Gets the root directory from a files glob
|
|
64
|
+
*/
|
|
65
|
+
private static getRootDir(filesGlob: string) {
|
|
66
|
+
let rootDir = filesGlob.split("**")[0];
|
|
67
|
+
if (!rootDir) {
|
|
68
|
+
throw new Error("Invalid files glob. Must have '**' in the path.");
|
|
69
|
+
}
|
|
70
|
+
rootDir = rootDir.replace("/**", "/");
|
|
71
|
+
return rootDir;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Resolves the route path for a given file system path
|
|
76
|
+
* @param options - The options to resolve the route path
|
|
77
|
+
* @returns The string route path
|
|
78
|
+
*/
|
|
79
|
+
static resolveRoutePath({
|
|
80
|
+
filesGlob,
|
|
81
|
+
fsPath,
|
|
82
|
+
}: {
|
|
83
|
+
filesGlob: string;
|
|
84
|
+
fsPath: string;
|
|
85
|
+
}) {
|
|
86
|
+
const rootDir = this.getRootDir(filesGlob);
|
|
87
|
+
const re = new RegExp(`^${rootDir}(.*).mdx?`);
|
|
88
|
+
const match = fsPath.match(re);
|
|
89
|
+
const routePath = match?.at(1);
|
|
90
|
+
return routePath;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
@@ -1,31 +1,95 @@
|
|
|
1
1
|
import { CheckIcon, CopyIcon } from "lucide-react";
|
|
2
|
-
import { useState } from "react";
|
|
2
|
+
import { useState, useTransition } from "react";
|
|
3
|
+
import { useQuery } from "urql";
|
|
4
|
+
import { useSelectedServerStore } from "../../authentication/state.js";
|
|
3
5
|
import { InlineCode } from "../../components/InlineCode.js";
|
|
6
|
+
import { Button } from "../../ui/Button.js";
|
|
7
|
+
import { useOasConfig } from "./context.js";
|
|
8
|
+
import { graphql } from "./graphql/index.js";
|
|
9
|
+
import { SimpleSelect } from "./SimpleSelect.js";
|
|
4
10
|
|
|
5
|
-
|
|
11
|
+
const ServersQuery = graphql(/* GraphQL */ `
|
|
12
|
+
query ServersQuery($input: JSON!, $type: SchemaType!) {
|
|
13
|
+
schema(input: $input, type: $type) {
|
|
14
|
+
url
|
|
15
|
+
servers {
|
|
16
|
+
url
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
`);
|
|
21
|
+
|
|
22
|
+
const CopyButton = ({ url }: { url: string }) => {
|
|
6
23
|
const [isCopied, setIsCopied] = useState(false);
|
|
7
24
|
|
|
8
25
|
return (
|
|
9
|
-
<
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
<Button
|
|
27
|
+
onClick={() => {
|
|
28
|
+
void navigator.clipboard.writeText(url).then(() => {
|
|
29
|
+
setIsCopied(true);
|
|
30
|
+
setTimeout(() => setIsCopied(false), 2000);
|
|
31
|
+
});
|
|
32
|
+
}}
|
|
33
|
+
variant="ghost"
|
|
34
|
+
size="icon"
|
|
35
|
+
>
|
|
36
|
+
{isCopied ? (
|
|
37
|
+
<CheckIcon className="text-green-600" size={14} />
|
|
38
|
+
) : (
|
|
39
|
+
<CopyIcon size={14} strokeWidth={1.3} />
|
|
40
|
+
)}
|
|
41
|
+
</Button>
|
|
42
|
+
);
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
const context = { suspense: true } as const;
|
|
46
|
+
|
|
47
|
+
export const Endpoint = () => {
|
|
48
|
+
const [result] = useQuery({
|
|
49
|
+
query: ServersQuery,
|
|
50
|
+
variables: useOasConfig(),
|
|
51
|
+
context,
|
|
52
|
+
});
|
|
53
|
+
const [, startTransition] = useTransition();
|
|
54
|
+
const { selectedServer, setSelectedServer } = useSelectedServerStore();
|
|
55
|
+
|
|
56
|
+
if (!result.data) return null;
|
|
57
|
+
|
|
58
|
+
const { servers } = result.data.schema;
|
|
59
|
+
|
|
60
|
+
if (servers.length === 1) {
|
|
61
|
+
return (
|
|
62
|
+
<div className="flex items-center gap-2">
|
|
63
|
+
<span className="font-medium text-sm">Endpoint:</span>
|
|
64
|
+
<InlineCode className="text-xs px-2 py-1.5" selectOnClick>
|
|
65
|
+
{servers[0]!.url}
|
|
66
|
+
</InlineCode>
|
|
67
|
+
<CopyButton url={servers[0]!.url} />
|
|
68
|
+
</div>
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
return (
|
|
73
|
+
<div className="flex flex-wrap items-center gap-2">
|
|
74
|
+
<span className="font-medium text-sm">
|
|
75
|
+
{servers.length > 1 ? "Endpoints" : "Endpoint"}:
|
|
76
|
+
</span>
|
|
77
|
+
|
|
78
|
+
<SimpleSelect
|
|
79
|
+
className="font-mono text-xs bg-border/50 dark:bg-border/70 py-1.5 max-w-[450px] truncate"
|
|
80
|
+
onChange={(e) =>
|
|
81
|
+
startTransition(() => {
|
|
82
|
+
setSelectedServer(e.target.value);
|
|
83
|
+
})
|
|
84
|
+
}
|
|
85
|
+
value={selectedServer ?? result.data.schema.url}
|
|
86
|
+
showChevrons={servers.length > 1}
|
|
87
|
+
options={servers.map((server) => ({
|
|
88
|
+
value: server.url,
|
|
89
|
+
label: server.url,
|
|
90
|
+
}))}
|
|
91
|
+
/>
|
|
92
|
+
<CopyButton url={selectedServer ?? result.data.schema.url} />
|
|
29
93
|
</div>
|
|
30
94
|
);
|
|
31
95
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ResultOf } from "@graphql-typed-document-node/core";
|
|
2
|
+
import { useQuery } from "urql";
|
|
2
3
|
import { CategoryHeading } from "../../components/CategoryHeading.js";
|
|
3
4
|
import { DeveloperHint } from "../../components/DeveloperHint.js";
|
|
4
5
|
import { ErrorPage } from "../../components/ErrorPage.js";
|
|
@@ -12,7 +13,6 @@ import { OperationListItem } from "./OperationListItem.js";
|
|
|
12
13
|
import StaggeredRender from "./StaggeredRender.js";
|
|
13
14
|
import { useOasConfig } from "./context.js";
|
|
14
15
|
import { graphql } from "./graphql/index.js";
|
|
15
|
-
import { useQuery } from "./util/urql.js";
|
|
16
16
|
|
|
17
17
|
export const OperationsFragment = graphql(/* GraphQL */ `
|
|
18
18
|
fragment OperationsFragment on OperationItem {
|
|
@@ -133,7 +133,9 @@ export const OperationList = () => {
|
|
|
133
133
|
<Markdown content={result.data.schema.description ?? ""} />
|
|
134
134
|
</div>
|
|
135
135
|
<hr />
|
|
136
|
-
<
|
|
136
|
+
<div className="my-4 flex justify-end">
|
|
137
|
+
<Endpoint />
|
|
138
|
+
</div>
|
|
137
139
|
|
|
138
140
|
{result.data.schema.tags
|
|
139
141
|
.filter((tag) => tag.operations.length > 0)
|
|
@@ -3,9 +3,11 @@ import { PlaygroundDialog } from "./playground/PlaygroundDialog.js";
|
|
|
3
3
|
|
|
4
4
|
export const PlaygroundDialogWrapper = ({
|
|
5
5
|
server,
|
|
6
|
+
servers,
|
|
6
7
|
operation,
|
|
7
8
|
}: {
|
|
8
9
|
server: string;
|
|
10
|
+
servers?: string[];
|
|
9
11
|
operation: OperationListItemResult;
|
|
10
12
|
}) => {
|
|
11
13
|
const headers = operation.parameters
|
|
@@ -29,6 +31,7 @@ export const PlaygroundDialogWrapper = ({
|
|
|
29
31
|
return (
|
|
30
32
|
<PlaygroundDialog
|
|
31
33
|
server={server}
|
|
34
|
+
servers={servers}
|
|
32
35
|
method={operation.method}
|
|
33
36
|
url={operation.path}
|
|
34
37
|
headers={headers}
|
|
@@ -26,7 +26,7 @@ export const RequestBodySidecarBox = ({ content }: { content: Content }) => {
|
|
|
26
26
|
className="text-xs max-h-[450px] p-2"
|
|
27
27
|
code={JSON.stringify(
|
|
28
28
|
content.at(0)?.schema
|
|
29
|
-
? generateSchemaExample(content[0]
|
|
29
|
+
? generateSchemaExample(content[0]!.schema as SchemaObject)
|
|
30
30
|
: "",
|
|
31
31
|
null,
|
|
32
32
|
2,
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { Outlet } from "react-router-dom";
|
|
2
|
+
import { Provider, Client as UrqlClient } from "urql";
|
|
2
3
|
import { OasConfigProvider } from "./context.js";
|
|
3
4
|
import { OasPluginConfig } from "./interfaces.js";
|
|
4
5
|
|
|
5
|
-
import { Provider, Client as UrqlClient } from "./util/urql.js";
|
|
6
|
-
|
|
7
6
|
export function OpenApiRoute({
|
|
8
7
|
config,
|
|
9
8
|
client,
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { HTTPSnippet } from "@zudoku/httpsnippet";
|
|
2
2
|
import { Fragment, useMemo, useTransition } from "react";
|
|
3
3
|
import { useSearchParams } from "react-router-dom";
|
|
4
|
+
import { useQuery } from "urql";
|
|
5
|
+
import { useSelectedServerStore } from "../../authentication/state.js";
|
|
4
6
|
import { TextColorMap } from "../../components/navigation/SidebarBadge.js";
|
|
5
7
|
import { SyntaxHighlight } from "../../components/SyntaxHighlight.js";
|
|
6
8
|
import type { SchemaObject } from "../../oas/parser/index.js";
|
|
@@ -15,7 +17,6 @@ import { ResponsesSidecarBox } from "./ResponsesSidecarBox.js";
|
|
|
15
17
|
import * as SidecarBox from "./SidecarBox.js";
|
|
16
18
|
import { SimpleSelect } from "./SimpleSelect.js";
|
|
17
19
|
import { generateSchemaExample } from "./util/generateSchemaExample.js";
|
|
18
|
-
import { useQuery } from "./util/urql.js";
|
|
19
20
|
|
|
20
21
|
const getConverted = (snippet: HTTPSnippet, option: string) => {
|
|
21
22
|
let converted;
|
|
@@ -65,6 +66,9 @@ export const GetServerQuery = graphql(/* GraphQL */ `
|
|
|
65
66
|
query getServerQuery($input: JSON!, $type: SchemaType!) {
|
|
66
67
|
schema(input: $input, type: $type) {
|
|
67
68
|
url
|
|
69
|
+
servers {
|
|
70
|
+
url
|
|
71
|
+
}
|
|
68
72
|
}
|
|
69
73
|
}
|
|
70
74
|
`);
|
|
@@ -135,6 +139,8 @@ export const Sidecar = ({
|
|
|
135
139
|
);
|
|
136
140
|
});
|
|
137
141
|
|
|
142
|
+
const { selectedServer } = useSelectedServerStore();
|
|
143
|
+
|
|
138
144
|
const code = useMemo(() => {
|
|
139
145
|
const example = requestBodyContent?.[0]?.schema
|
|
140
146
|
? generateSchemaExample(requestBodyContent[0].schema as SchemaObject)
|
|
@@ -143,7 +149,7 @@ export const Sidecar = ({
|
|
|
143
149
|
const snippet = new HTTPSnippet({
|
|
144
150
|
method: operation.method.toLocaleUpperCase(),
|
|
145
151
|
url:
|
|
146
|
-
(result.data?.schema.url ?? "") +
|
|
152
|
+
(selectedServer ?? result.data?.schema.url ?? "") +
|
|
147
153
|
operation.path.replaceAll("{", ":").replaceAll("}", ""),
|
|
148
154
|
postData: example
|
|
149
155
|
? {
|
|
@@ -160,7 +166,13 @@ export const Sidecar = ({
|
|
|
160
166
|
});
|
|
161
167
|
|
|
162
168
|
return getConverted(snippet, selectedLang);
|
|
163
|
-
}, [
|
|
169
|
+
}, [
|
|
170
|
+
selectedServer,
|
|
171
|
+
selectedLang,
|
|
172
|
+
operation.method,
|
|
173
|
+
operation.path,
|
|
174
|
+
requestBodyContent,
|
|
175
|
+
]);
|
|
164
176
|
|
|
165
177
|
return (
|
|
166
178
|
<aside className="flex flex-col overflow-hidden sticky top-[--scroll-padding] gap-4">
|
|
@@ -175,6 +187,9 @@ export const Sidecar = ({
|
|
|
175
187
|
</span>
|
|
176
188
|
<PlaygroundDialogWrapper
|
|
177
189
|
server={result.data?.schema.url ?? ""}
|
|
190
|
+
servers={
|
|
191
|
+
result.data?.schema.servers.map((server) => server.url) ?? []
|
|
192
|
+
}
|
|
178
193
|
operation={operation}
|
|
179
194
|
/>
|
|
180
195
|
</SidecarBox.Head>
|
|
@@ -183,7 +198,7 @@ export const Sidecar = ({
|
|
|
183
198
|
language={selectedLang}
|
|
184
199
|
noBackground
|
|
185
200
|
className="text-xs p-2"
|
|
186
|
-
code={code}
|
|
201
|
+
code={code!}
|
|
187
202
|
/>
|
|
188
203
|
</SidecarBox.Body>
|
|
189
204
|
<SidecarBox.Footer className="flex items-center text-xs gap-2 justify-end py-1">
|
|
@@ -201,13 +216,13 @@ export const Sidecar = ({
|
|
|
201
216
|
}}
|
|
202
217
|
options={[
|
|
203
218
|
{ value: "shell", label: "cURL" },
|
|
204
|
-
{ value: "js", label: "
|
|
219
|
+
{ value: "js", label: "JavaScript" },
|
|
205
220
|
{ value: "python", label: "Python" },
|
|
206
221
|
{ value: "java", label: "Java" },
|
|
207
222
|
{ value: "go", label: "Go" },
|
|
208
223
|
{ value: "csharp", label: "C#" },
|
|
209
224
|
{ value: "kotlin", label: "Kotlin" },
|
|
210
|
-
{ value: "objc", label: "Objective
|
|
225
|
+
{ value: "objc", label: "Objective-C" },
|
|
211
226
|
{ value: "php", label: "PHP" },
|
|
212
227
|
{ value: "ruby", label: "Ruby" },
|
|
213
228
|
{ value: "swift", label: "Swift" },
|
|
@@ -7,6 +7,7 @@ export const SimpleSelect = ({
|
|
|
7
7
|
onChange,
|
|
8
8
|
className,
|
|
9
9
|
options,
|
|
10
|
+
showChevrons = true,
|
|
10
11
|
}: {
|
|
11
12
|
value: string;
|
|
12
13
|
onChange: ChangeEventHandler<HTMLSelectElement>;
|
|
@@ -15,12 +16,14 @@ export const SimpleSelect = ({
|
|
|
15
16
|
value: string;
|
|
16
17
|
label: string;
|
|
17
18
|
}[];
|
|
19
|
+
showChevrons?: boolean;
|
|
18
20
|
}) => (
|
|
19
|
-
<div className=
|
|
21
|
+
<div className="grid">
|
|
20
22
|
<select
|
|
21
23
|
className={cn(
|
|
22
24
|
"row-start-1 col-start-1 border border-input text-foreground px-2 py-1 pe-6",
|
|
23
25
|
"rounded-md appearance-none bg-zinc-50 hover:bg-white dark:bg-zinc-800 hover:dark:bg-zinc-800/75",
|
|
26
|
+
className,
|
|
24
27
|
)}
|
|
25
28
|
value={value}
|
|
26
29
|
onChange={onChange}
|
|
@@ -31,7 +34,12 @@ export const SimpleSelect = ({
|
|
|
31
34
|
</option>
|
|
32
35
|
))}
|
|
33
36
|
</select>
|
|
34
|
-
<div
|
|
37
|
+
<div
|
|
38
|
+
className={cn(
|
|
39
|
+
!showChevrons && "hidden",
|
|
40
|
+
"row-start-1 col-start-1 self-center justify-self-end relative end-2 pointer-events-none",
|
|
41
|
+
)}
|
|
42
|
+
>
|
|
35
43
|
<ChevronsUpDownIcon size={14} />
|
|
36
44
|
</div>
|
|
37
45
|
</div>
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
/* eslint-disable no-console */
|
|
2
|
-
import {
|
|
3
|
-
cacheExchange,
|
|
4
|
-
Client,
|
|
5
|
-
fetchExchange,
|
|
6
|
-
mapExchange,
|
|
7
|
-
} from "../util/urql.js";
|
|
2
|
+
import { cacheExchange, Client, fetchExchange, mapExchange } from "urql";
|
|
8
3
|
import { createServer } from "./createServer.js";
|
|
9
4
|
import { CreateClientFunction } from "./interfaces.js";
|
|
10
5
|
|
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
/* eslint-disable no-console */
|
|
2
2
|
import { monotonicFactory } from "ulidx";
|
|
3
|
+
import { cacheExchange, Client, fetchExchange, mapExchange } from "urql";
|
|
3
4
|
import { createWaitForNotify } from "../../../util/createWaitForNotify.js";
|
|
4
|
-
import {
|
|
5
|
-
cacheExchange,
|
|
6
|
-
Client,
|
|
7
|
-
fetchExchange,
|
|
8
|
-
mapExchange,
|
|
9
|
-
} from "../util/urql.js";
|
|
10
5
|
import { createClient as createMemoryClient } from "./createMemoryClient.js";
|
|
11
6
|
import { CreateClientFunction } from "./interfaces.js";
|
|
12
7
|
|
|
@@ -10,7 +10,7 @@ worker.addEventListener(
|
|
|
10
10
|
function (event: MessageEvent<{ id: string; body: string }>) {
|
|
11
11
|
const port = event.ports[0];
|
|
12
12
|
|
|
13
|
-
port
|
|
13
|
+
port!.onmessage = async function (e) {
|
|
14
14
|
const response = await localServer.fetch(
|
|
15
15
|
new Request("/__z/graphql", {
|
|
16
16
|
method: "POST",
|
|
@@ -21,7 +21,7 @@ worker.addEventListener(
|
|
|
21
21
|
}),
|
|
22
22
|
);
|
|
23
23
|
|
|
24
|
-
port
|
|
24
|
+
port!.postMessage({
|
|
25
25
|
id: e.data.id,
|
|
26
26
|
body: await response.text(),
|
|
27
27
|
} satisfies WorkerGraphQLMessage);
|
|
@@ -13,11 +13,13 @@ import * as types from "./graphql.js";
|
|
|
13
13
|
* Therefore it is highly recommended to use the babel or swc plugin for production.
|
|
14
14
|
*/
|
|
15
15
|
const documents = {
|
|
16
|
+
"\n query ServersQuery($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n url\n servers {\n url\n }\n }\n }\n":
|
|
17
|
+
types.ServersQueryDocument,
|
|
16
18
|
"\n fragment OperationsFragment on OperationItem {\n slug\n summary\n method\n description\n operationId\n contentTypes\n path\n parameters {\n name\n in\n description\n required\n schema\n style\n examples {\n name\n description\n externalValue\n value\n summary\n }\n }\n requestBody {\n content {\n mediaType\n encoding {\n name\n }\n schema\n }\n description\n required\n }\n responses {\n statusCode\n links\n description\n content {\n mediaType\n encoding {\n name\n }\n schema\n }\n }\n }\n":
|
|
17
19
|
types.OperationsFragmentFragmentDoc,
|
|
18
20
|
"\n query AllOperations($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n description\n title\n url\n version\n tags {\n name\n description\n operations {\n slug\n ...OperationsFragment\n }\n }\n }\n }\n":
|
|
19
21
|
types.AllOperationsDocument,
|
|
20
|
-
"\n query getServerQuery($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n url\n }\n }\n":
|
|
22
|
+
"\n query getServerQuery($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n url\n servers {\n url\n }\n }\n }\n":
|
|
21
23
|
types.GetServerQueryDocument,
|
|
22
24
|
"\n query GetCategories($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n tags {\n __typename\n name\n operations {\n __typename\n slug\n deprecated\n method\n summary\n operationId\n path\n }\n }\n }\n }\n":
|
|
23
25
|
types.GetCategoriesDocument,
|
|
@@ -37,6 +39,12 @@ const documents = {
|
|
|
37
39
|
*/
|
|
38
40
|
export function graphql(source: string): unknown;
|
|
39
41
|
|
|
42
|
+
/**
|
|
43
|
+
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
44
|
+
*/
|
|
45
|
+
export function graphql(
|
|
46
|
+
source: "\n query ServersQuery($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n url\n servers {\n url\n }\n }\n }\n",
|
|
47
|
+
): (typeof documents)["\n query ServersQuery($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n url\n servers {\n url\n }\n }\n }\n"];
|
|
40
48
|
/**
|
|
41
49
|
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
42
50
|
*/
|
|
@@ -53,8 +61,8 @@ export function graphql(
|
|
|
53
61
|
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
54
62
|
*/
|
|
55
63
|
export function graphql(
|
|
56
|
-
source: "\n query getServerQuery($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n url\n }\n }\n",
|
|
57
|
-
): (typeof documents)["\n query getServerQuery($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n url\n }\n }\n"];
|
|
64
|
+
source: "\n query getServerQuery($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n url\n servers {\n url\n }\n }\n }\n",
|
|
65
|
+
): (typeof documents)["\n query getServerQuery($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n url\n servers {\n url\n }\n }\n }\n"];
|
|
58
66
|
/**
|
|
59
67
|
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
60
68
|
*/
|