zudoku 0.0.0-f3858d6 → 0.0.0-f49e3ea
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/dist/app/demo.js +0 -2
- package/dist/app/demo.js.map +1 -1
- package/dist/app/entry.client.js +14 -0
- package/dist/app/entry.client.js.map +1 -1
- package/dist/app/entry.server.js +6 -6
- package/dist/app/entry.server.js.map +1 -1
- package/dist/app/main.d.ts +1 -1
- package/dist/app/main.js +5 -7
- package/dist/app/main.js.map +1 -1
- package/dist/app/standalone.js +0 -2
- 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/codegen.d.ts +3 -0
- package/dist/codegen.js +45 -0
- package/dist/codegen.js.map +1 -0
- package/dist/config/validators/InputSidebarSchema.d.ts +21 -6
- 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 +77 -37
- package/dist/config/validators/SidebarSchema.js.map +1 -1
- package/dist/config/validators/validate.d.ts +354 -256
- package/dist/config/validators/validate.js +19 -2
- package/dist/config/validators/validate.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/authentication/authentication.d.ts +2 -2
- 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 +5 -4
- package/dist/lib/authentication/hook.js +1 -3
- package/dist/lib/authentication/hook.js.map +1 -1
- package/dist/lib/authentication/providers/auth0.js +12 -11
- package/dist/lib/authentication/providers/auth0.js.map +1 -1
- package/dist/lib/authentication/providers/openid.d.ts +0 -1
- package/dist/lib/authentication/providers/openid.js +11 -26
- package/dist/lib/authentication/providers/openid.js.map +1 -1
- package/dist/lib/authentication/state.d.ts +25 -4
- package/dist/lib/authentication/state.js +28 -3
- package/dist/lib/authentication/state.js.map +1 -1
- package/dist/lib/authentication/use-broadcast/shared.d.ts +48 -0
- package/dist/lib/authentication/use-broadcast/shared.js +243 -0
- package/dist/lib/authentication/use-broadcast/shared.js.map +1 -0
- package/dist/lib/authentication/use-broadcast/useBroadcast.d.ts +24 -0
- package/dist/lib/authentication/use-broadcast/useBroadcast.js +106 -0
- package/dist/lib/authentication/use-broadcast/useBroadcast.js.map +1 -0
- package/dist/lib/components/Bootstrap.d.ts +3 -1
- package/dist/lib/components/Bootstrap.js +11 -3
- package/dist/lib/components/Bootstrap.js.map +1 -1
- package/dist/lib/components/ClientOnly.d.ts +4 -2
- package/dist/lib/components/ClientOnly.js +1 -1
- package/dist/lib/components/ClientOnly.js.map +1 -1
- package/dist/lib/components/DeveloperHint.js +2 -1
- package/dist/lib/components/DeveloperHint.js.map +1 -1
- package/dist/lib/components/Header.js +7 -8
- package/dist/lib/components/Header.js.map +1 -1
- package/dist/lib/components/Heading.d.ts +1 -1
- package/dist/lib/components/Layout.js +6 -3
- package/dist/lib/components/Layout.js.map +1 -1
- package/dist/lib/components/MobileTopNavigation.js +8 -6
- 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 +7 -2
- package/dist/lib/components/SlotletProvider.js +3 -5
- package/dist/lib/components/SlotletProvider.js.map +1 -1
- package/dist/lib/components/SyntaxHighlight.js +19 -12
- package/dist/lib/components/SyntaxHighlight.js.map +1 -1
- package/dist/lib/components/ThemeSwitch.d.ts +1 -0
- package/dist/lib/components/ThemeSwitch.js +13 -0
- package/dist/lib/components/ThemeSwitch.js.map +1 -0
- package/dist/lib/components/TopNavigation.d.ts +5 -0
- package/dist/lib/components/TopNavigation.js +22 -8
- package/dist/lib/components/TopNavigation.js.map +1 -1
- package/dist/lib/components/{DevPortal.d.ts → Zudoku.d.ts} +3 -3
- package/dist/lib/components/{DevPortal.js → Zudoku.js} +13 -14
- package/dist/lib/components/Zudoku.js.map +1 -0
- package/dist/lib/components/context/ZudokuContext.d.ts +7 -6
- package/dist/lib/components/context/ZudokuContext.js +8 -13
- package/dist/lib/components/context/ZudokuContext.js.map +1 -1
- package/dist/lib/components/context/ZudokuProvider.d.ts +2 -2
- package/dist/lib/components/context/ZudokuProvider.js.map +1 -1
- package/dist/lib/components/index.d.ts +30 -13
- package/dist/lib/components/index.js +11 -5
- package/dist/lib/components/index.js.map +1 -1
- package/dist/lib/components/navigation/Sidebar.js +1 -1
- package/dist/lib/components/navigation/Sidebar.js.map +1 -1
- package/dist/lib/components/navigation/SidebarCategory.js +18 -7
- package/dist/lib/components/navigation/SidebarCategory.js.map +1 -1
- package/dist/lib/components/navigation/SidebarItem.js +12 -5
- package/dist/lib/components/navigation/SidebarItem.js.map +1 -1
- package/dist/lib/components/navigation/utils.js +2 -2
- package/dist/lib/components/navigation/utils.js.map +1 -1
- package/dist/lib/core/{DevPortalContext.d.ts → ZudokuContext.d.ts} +3 -7
- package/dist/lib/core/{DevPortalContext.js → ZudokuContext.js} +2 -7
- package/dist/lib/core/ZudokuContext.js.map +1 -0
- package/dist/lib/core/plugins.d.ts +12 -12
- 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.js +4 -4
- package/dist/lib/oas/graphql/index.js.map +1 -1
- package/dist/lib/oas/parser/upgrade/index.js +3 -1
- package/dist/lib/oas/parser/upgrade/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/index.d.ts +9 -9
- package/dist/lib/plugins/api-keys/index.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 +9 -7
- package/dist/lib/plugins/custom-pages/index.js +3 -4
- package/dist/lib/plugins/custom-pages/index.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 +2 -2
- package/dist/lib/plugins/markdown/index.js.map +1 -1
- package/dist/lib/plugins/openapi/CollapsibleCode.d.ts +5 -0
- package/dist/lib/plugins/openapi/CollapsibleCode.js +24 -0
- package/dist/lib/plugins/openapi/CollapsibleCode.js.map +1 -0
- package/dist/lib/plugins/openapi/ColorizedParam.js +13 -9
- package/dist/lib/plugins/openapi/ColorizedParam.js.map +1 -1
- package/dist/lib/plugins/openapi/Endpoint.d.ts +1 -1
- package/dist/lib/plugins/openapi/Endpoint.js +5 -9
- package/dist/lib/plugins/openapi/Endpoint.js.map +1 -1
- package/dist/lib/plugins/openapi/OperationList.d.ts +2 -2
- package/dist/lib/plugins/openapi/OperationList.js +21 -22
- package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
- package/dist/lib/plugins/openapi/ParameterListItem.js +6 -1
- package/dist/lib/plugins/openapi/ParameterListItem.js.map +1 -1
- package/dist/lib/plugins/openapi/RequestBodySidecarBox.js +7 -3
- package/dist/lib/plugins/openapi/RequestBodySidecarBox.js.map +1 -1
- package/dist/lib/plugins/openapi/ResponsesSidecarBox.js +9 -2
- package/dist/lib/plugins/openapi/ResponsesSidecarBox.js.map +1 -1
- package/dist/lib/plugins/openapi/Route.d.ts +4 -4
- package/dist/lib/plugins/openapi/Route.js +2 -4
- package/dist/lib/plugins/openapi/Route.js.map +1 -1
- package/dist/lib/plugins/openapi/Sidecar.d.ts +1 -1
- package/dist/lib/plugins/openapi/Sidecar.js +35 -33
- package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
- package/dist/lib/plugins/openapi/client/GraphQLClient.d.ts +8 -0
- package/dist/lib/plugins/openapi/client/GraphQLClient.js +102 -0
- package/dist/lib/plugins/openapi/client/GraphQLClient.js.map +1 -0
- package/dist/lib/plugins/openapi/client/GraphQLContext.d.ts +7 -0
- package/dist/lib/plugins/openapi/client/GraphQLContext.js +5 -0
- package/dist/lib/plugins/openapi/client/GraphQLContext.js.map +1 -0
- package/dist/lib/plugins/openapi/client/createServer.d.ts +1 -0
- package/dist/lib/plugins/openapi/client/useCreateQuery.d.ts +5 -0
- package/dist/lib/plugins/openapi/client/useCreateQuery.js +13 -0
- package/dist/lib/plugins/openapi/client/useCreateQuery.js.map +1 -0
- package/dist/lib/plugins/openapi/client/worker.d.ts +4 -1
- package/dist/lib/plugins/openapi/client/worker.js +23 -14
- package/dist/lib/plugins/openapi/client/worker.js.map +1 -1
- package/dist/lib/plugins/openapi/graphql/fragment-masking.d.ts +3 -3
- package/dist/lib/plugins/openapi/graphql/fragment-masking.js +3 -4
- package/dist/lib/plugins/openapi/graphql/fragment-masking.js.map +1 -1
- package/dist/lib/plugins/openapi/graphql/gql.d.ts +5 -51
- package/dist/lib/plugins/openapi/graphql/gql.js +4 -2
- package/dist/lib/plugins/openapi/graphql/gql.js.map +1 -1
- package/dist/lib/plugins/openapi/graphql/graphql.d.ts +32 -8
- package/dist/lib/plugins/openapi/graphql/graphql.js +194 -662
- package/dist/lib/plugins/openapi/graphql/graphql.js.map +1 -1
- package/dist/lib/plugins/openapi/index.d.ts +2 -2
- package/dist/lib/plugins/openapi/index.js +40 -53
- package/dist/lib/plugins/openapi/index.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/Playground.js +2 -1
- 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/schema/SchemaView.js +2 -1
- package/dist/lib/plugins/openapi/schema/SchemaView.js.map +1 -1
- package/dist/lib/plugins/openapi/util/generateSchemaExample.d.ts +0 -1
- package/dist/lib/plugins/openapi/util/generateSchemaExample.js +25 -36
- package/dist/lib/plugins/openapi/util/generateSchemaExample.js.map +1 -1
- package/dist/lib/plugins/openapi-worker.d.ts +1 -1
- package/dist/lib/plugins/openapi-worker.js +7 -1
- package/dist/lib/plugins/openapi-worker.js.map +1 -1
- package/dist/lib/plugins/redirect/index.d.ts +4 -7
- 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 +2 -2
- package/dist/lib/plugins/search-inkeep/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/ActionButton.d.ts +4 -0
- package/dist/lib/ui/ActionButton.js +10 -0
- package/dist/lib/ui/ActionButton.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/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/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.d.ts +1 -1
- 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/useIsomorphicLayoutEffect.d.ts +3 -0
- package/dist/lib/util/useIsomorphicLayoutEffect.js +4 -0
- package/dist/lib/util/useIsomorphicLayoutEffect.js.map +1 -0
- package/dist/lib/util/useOnScreen.d.ts +4 -0
- package/dist/lib/util/useOnScreen.js +19 -0
- package/dist/lib/util/useOnScreen.js.map +1 -0
- package/dist/vite/build.js +5 -1
- package/dist/vite/build.js.map +1 -1
- package/dist/vite/config.d.ts +2 -8
- package/dist/vite/config.js +23 -59
- package/dist/vite/config.js.map +1 -1
- package/dist/vite/dev-server.js +1 -1
- package/dist/vite/dev-server.js.map +1 -1
- package/dist/vite/html.js +0 -2
- package/dist/vite/html.js.map +1 -1
- package/dist/vite/output.d.ts +101 -0
- package/dist/vite/output.js +33 -0
- package/dist/vite/output.js.map +1 -0
- package/dist/vite/plugin-component.js +17 -7
- package/dist/vite/plugin-component.js.map +1 -1
- package/dist/vite/plugin-config-reload.js +0 -2
- 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-docs.js +13 -2
- package/dist/vite/plugin-docs.js.map +1 -1
- package/dist/vite/plugin-frontmatter.d.ts +2 -1
- package/dist/vite/plugin-frontmatter.js +27 -24
- package/dist/vite/plugin-frontmatter.js.map +1 -1
- package/dist/vite/plugin-mdx.d.ts +0 -6
- package/dist/vite/plugin-mdx.js +20 -2
- 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 +4 -6
- package/dist/vite/plugin-sidebar.js.map +1 -1
- package/dist/vite/plugin.js +4 -4
- package/dist/vite/plugin.js.map +1 -1
- package/dist/vite/prerender.js +3 -2
- package/dist/vite/prerender.js.map +1 -1
- package/dist/vite/remarkStaticGeneration.d.ts +3 -0
- package/dist/vite/remarkStaticGeneration.js +125 -0
- package/dist/vite/remarkStaticGeneration.js.map +1 -0
- package/lib/{AnchorLink-DovtSBJk.js → AnchorLink-CDlhr8gL.js} +12 -11
- package/lib/{AnchorLink-DovtSBJk.js.map → AnchorLink-CDlhr8gL.js.map} +1 -1
- package/lib/{AuthenticationPlugin-Cnqy9csQ.js → AuthenticationPlugin-DeGDVa1r.js} +6 -5
- package/lib/{AuthenticationPlugin-Cnqy9csQ.js.map → AuthenticationPlugin-DeGDVa1r.js.map} +1 -1
- package/lib/Button-jK0EsymC.js +48 -0
- package/lib/Button-jK0EsymC.js.map +1 -0
- package/lib/{CategoryHeading-C7VfgpFZ.js → CategoryHeading-Bb9dqxD3.js} +4 -4
- package/lib/{CategoryHeading-C7VfgpFZ.js.map → CategoryHeading-Bb9dqxD3.js.map} +1 -1
- package/lib/ClientOnly-E7hGysn1.js +11 -0
- package/lib/ClientOnly-E7hGysn1.js.map +1 -0
- package/lib/Dialog-k70Qfukb.js +67 -0
- package/lib/Dialog-k70Qfukb.js.map +1 -0
- package/lib/Markdown-ievDDhFT.js +15192 -0
- package/lib/Markdown-ievDDhFT.js.map +1 -0
- package/lib/{MdxPage-C5I9c7R1.js → MdxPage-Bwn-VSsH.js} +17 -16
- package/lib/{MdxPage-C5I9c7R1.js.map → MdxPage-Bwn-VSsH.js.map} +1 -1
- package/lib/OperationList-BwBl1xrD.js +4691 -0
- package/lib/OperationList-BwBl1xrD.js.map +1 -0
- package/lib/Route-DlG_HTMu.js +11 -0
- package/lib/Route-DlG_HTMu.js.map +1 -0
- package/lib/Select-O9ZM3ZgX.js +223 -0
- package/lib/Select-O9ZM3ZgX.js.map +1 -0
- package/lib/SidebarBadge-DxFJcJ6V.js +51 -0
- package/lib/SidebarBadge-DxFJcJ6V.js.map +1 -0
- package/lib/SlotletProvider-DyomlzGx.js +252 -0
- package/lib/SlotletProvider-DyomlzGx.js.map +1 -0
- package/lib/SyntaxHighlight-DkLOsjHS.js +2983 -0
- package/lib/SyntaxHighlight-DkLOsjHS.js.map +1 -0
- package/lib/_commonjsHelpers-BkfeUUK-.js +29 -0
- package/lib/_commonjsHelpers-BkfeUUK-.js.map +1 -0
- package/lib/assets/{worker-DaFlmuyf.js → worker-CPsGZsve.js} +2590 -2500
- package/lib/assets/{worker-DaFlmuyf.js.map → worker-CPsGZsve.js.map} +1 -1
- package/lib/cn-BmFQLtkS.js +2279 -0
- package/lib/cn-BmFQLtkS.js.map +1 -0
- package/lib/context-D1nXWxm7.js +22 -0
- package/lib/context-D1nXWxm7.js.map +1 -0
- package/lib/createServer-DK-g7kbB.js +16089 -0
- package/lib/createServer-DK-g7kbB.js.map +1 -0
- package/lib/hook-hEqe7fPB.js +227 -0
- package/lib/hook-hEqe7fPB.js.map +1 -0
- package/lib/index-Bn6Lc9tq.js +9 -0
- package/lib/{index-DJqnphbT.js.map → index-Bn6Lc9tq.js.map} +1 -1
- package/lib/index-BuAyrJe3.js +46 -0
- package/lib/index-BuAyrJe3.js.map +1 -0
- package/lib/index-Czzd9rjU.js +899 -0
- package/lib/index-Czzd9rjU.js.map +1 -0
- package/lib/index-DNxQ_rCt.js +1273 -0
- package/lib/index-DNxQ_rCt.js.map +1 -0
- package/lib/{index-D06ATMgg.js → index-LNp6rxyU.js} +2 -2
- package/lib/{index-D06ATMgg.js.map → index-LNp6rxyU.js.map} +1 -1
- package/lib/index-Yn8c3UWE.js +921 -0
- package/lib/index-Yn8c3UWE.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-Oe6YmY6B.js → router-lfyopgBI.js} +23 -23
- package/lib/{router-Oe6YmY6B.js.map → router-lfyopgBI.js.map} +1 -1
- package/lib/state-tsXBLONe.js +203 -0
- package/lib/{state-CsuHT8ZO.js.map → state-tsXBLONe.js.map} +1 -1
- package/lib/ui/Accordion.js +47 -0
- package/lib/ui/Accordion.js.map +1 -0
- package/lib/ui/ActionButton.js +25 -0
- package/lib/ui/ActionButton.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/useExposedProps-CTPtylCV.js +10 -0
- package/lib/useExposedProps-CTPtylCV.js.map +1 -0
- package/lib/{ZudokuContext-DSipF8sq.js → utils-DcpDOncX.js} +244 -248
- package/lib/utils-DcpDOncX.js.map +1 -0
- package/lib/zudoku.auth-auth0.js +24 -18
- package/lib/zudoku.auth-auth0.js.map +1 -1
- package/lib/zudoku.auth-clerk.js +2 -2
- package/lib/zudoku.auth-openid.js +506 -526
- package/lib/zudoku.auth-openid.js.map +1 -1
- package/lib/zudoku.components.js +1152 -3009
- package/lib/zudoku.components.js.map +1 -1
- package/lib/zudoku.openapi-worker.js +10 -16250
- package/lib/zudoku.openapi-worker.js.map +1 -1
- package/lib/zudoku.plugin-api-keys.js +68 -75
- package/lib/zudoku.plugin-api-keys.js.map +1 -1
- package/lib/zudoku.plugin-custom-pages.js +17 -8
- package/lib/zudoku.plugin-custom-pages.js.map +1 -1
- package/lib/zudoku.plugin-markdown.js +1 -1
- package/lib/zudoku.plugin-markdown.js.map +1 -1
- package/lib/zudoku.plugin-openapi.js +6 -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 +43 -11
- package/src/app/demo.tsx +0 -3
- package/src/app/entry.client.tsx +14 -0
- package/src/app/entry.server.tsx +59 -53
- package/src/app/main.css +1 -2
- package/src/app/main.tsx +7 -9
- package/src/app/standalone.tsx +0 -3
- package/src/lib/authentication/authentication.ts +2 -2
- package/src/lib/authentication/components/CallbackHandler.tsx +20 -51
- package/src/lib/authentication/hook.ts +1 -3
- package/src/lib/authentication/providers/auth0.tsx +17 -11
- package/src/lib/authentication/providers/openid.tsx +12 -30
- package/src/lib/authentication/state.ts +50 -9
- package/{LICENSE.md → src/lib/authentication/use-broadcast/LICENSE.md} +2 -2
- package/src/lib/authentication/use-broadcast/shared.ts +372 -0
- package/src/lib/authentication/use-broadcast/useBroadcast.ts +146 -0
- package/src/lib/components/Bootstrap.tsx +36 -9
- package/src/lib/components/ClientOnly.tsx +6 -3
- package/src/lib/components/DeveloperHint.tsx +6 -1
- package/src/lib/components/Header.tsx +44 -42
- package/src/lib/components/Layout.tsx +43 -36
- package/src/lib/components/MobileTopNavigation.tsx +23 -20
- package/src/lib/components/Search.tsx +1 -1
- package/src/lib/components/SlotletProvider.tsx +16 -7
- package/src/lib/components/SyntaxHighlight.tsx +85 -46
- package/src/lib/components/ThemeSwitch.tsx +26 -0
- package/src/lib/components/TopNavigation.tsx +39 -18
- package/src/lib/components/Zudoku.tsx +108 -0
- package/src/lib/components/context/ZudokuContext.ts +11 -16
- package/src/lib/components/context/ZudokuProvider.tsx +2 -2
- package/src/lib/components/index.ts +14 -6
- package/src/lib/components/navigation/Sidebar.tsx +4 -4
- package/src/lib/components/navigation/SidebarCategory.tsx +34 -26
- package/src/lib/components/navigation/SidebarItem.tsx +16 -17
- package/src/lib/components/navigation/utils.ts +2 -2
- package/src/lib/core/{DevPortalContext.ts → ZudokuContext.ts} +3 -11
- package/src/lib/core/plugins.ts +12 -16
- package/src/lib/errors/ErrorAlert.tsx +20 -6
- package/src/lib/oas/graphql/index.ts +4 -4
- package/src/lib/oas/parser/upgrade/index.ts +3 -1
- package/src/lib/plugins/api-keys/CreateApiKey.tsx +2 -2
- package/src/lib/plugins/api-keys/index.tsx +9 -9
- package/src/lib/plugins/custom-pages/CustomPage.tsx +18 -0
- package/src/lib/plugins/custom-pages/index.tsx +13 -11
- package/src/lib/plugins/markdown/MdxPage.tsx +10 -8
- package/src/lib/plugins/markdown/index.tsx +2 -2
- package/src/lib/plugins/openapi/CollapsibleCode.tsx +80 -0
- package/src/lib/plugins/openapi/ColorizedParam.tsx +23 -14
- package/src/lib/plugins/openapi/Endpoint.tsx +5 -10
- package/src/lib/plugins/openapi/OperationList.tsx +20 -40
- package/src/lib/plugins/openapi/ParameterListItem.tsx +37 -31
- package/src/lib/plugins/openapi/RequestBodySidecarBox.tsx +18 -13
- package/src/lib/plugins/openapi/ResponsesSidecarBox.tsx +17 -12
- package/src/lib/plugins/openapi/Route.tsx +11 -12
- package/src/lib/plugins/openapi/Sidecar.tsx +73 -59
- package/src/lib/plugins/openapi/client/GraphQLClient.tsx +140 -0
- package/src/lib/plugins/openapi/client/GraphQLContext.tsx +16 -0
- package/src/lib/plugins/openapi/client/createServer.ts +2 -0
- package/src/lib/plugins/openapi/client/useCreateQuery.ts +18 -0
- package/src/lib/plugins/openapi/client/worker.ts +38 -24
- package/src/lib/plugins/openapi/graphql/fragment-masking.ts +11 -18
- package/src/lib/plugins/openapi/graphql/gql.ts +10 -27
- package/src/lib/plugins/openapi/graphql/graphql.ts +233 -665
- package/src/lib/plugins/openapi/index.tsx +42 -67
- package/src/lib/plugins/openapi/playground/Playground.tsx +4 -3
- package/src/lib/plugins/openapi/playground/PlaygroundDialog.tsx +1 -1
- package/src/lib/plugins/openapi/schema/SchemaView.tsx +5 -2
- package/src/lib/plugins/openapi/util/generateSchemaExample.ts +28 -42
- package/src/lib/plugins/openapi-worker.ts +11 -1
- package/src/lib/plugins/redirect/index.tsx +5 -9
- package/src/lib/plugins/search-inkeep/index.tsx +2 -2
- package/src/lib/ui/Accordion.tsx +56 -0
- package/src/lib/ui/ActionButton.tsx +28 -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/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/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/useIsomorphicLayoutEffect.ts +5 -0
- package/src/lib/util/useOnScreen.ts +32 -0
- package/dist/internal.d.ts +0 -1
- package/dist/internal.js +0 -2
- package/dist/internal.js.map +0 -1
- package/dist/lib/components/DevPortal.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/components/context/ThemeContext.d.ts +0 -2
- package/dist/lib/components/context/ThemeContext.js +0 -7
- package/dist/lib/components/context/ThemeContext.js.map +0 -1
- package/dist/lib/components/context/ThemeProvider.d.ts +0 -4
- package/dist/lib/components/context/ThemeProvider.js +0 -23
- package/dist/lib/components/context/ThemeProvider.js.map +0 -1
- package/dist/lib/core/DevPortalContext.js.map +0 -1
- package/dist/lib/plugins/openapi/client/createMemoryClient.d.ts +0 -12
- package/dist/lib/plugins/openapi/client/createMemoryClient.js +0 -46
- package/dist/lib/plugins/openapi/client/createMemoryClient.js.map +0 -1
- package/dist/lib/plugins/openapi/client/createWorkerClient.d.ts +0 -10
- package/dist/lib/plugins/openapi/client/createWorkerClient.js +0 -61
- package/dist/lib/plugins/openapi/client/createWorkerClient.js.map +0 -1
- package/dist/lib/plugins/openapi/client/interfaces.d.ts +0 -4
- package/dist/lib/plugins/openapi/client/interfaces.js +0 -2
- package/dist/lib/plugins/openapi/client/interfaces.js.map +0 -1
- package/dist/lib/themeToggle.d.ts +0 -1
- package/dist/lib/themeToggle.js +0 -7
- package/dist/lib/themeToggle.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/createWaitForNotify.d.ts +0 -1
- package/dist/lib/util/createWaitForNotify.js +0 -15
- package/dist/lib/util/createWaitForNotify.js.map +0 -1
- package/dist/vite/plugin-html-transform.d.ts +0 -2
- package/dist/vite/plugin-html-transform.js +0 -15
- package/dist/vite/plugin-html-transform.js.map +0 -1
- package/lib/DeveloperHint-CNyuFROc.js +0 -16
- package/lib/DeveloperHint-CNyuFROc.js.map +0 -1
- package/lib/ErrorPage-CUz-Zzmx.js +0 -16
- package/lib/ErrorPage-CUz-Zzmx.js.map +0 -1
- package/lib/Input-x-t53FyR.js +0 -2229
- package/lib/Input-x-t53FyR.js.map +0 -1
- package/lib/Markdown-C-0TaxoY.js +0 -20441
- package/lib/Markdown-C-0TaxoY.js.map +0 -1
- package/lib/OperationList-qsBOguHS.js +0 -601
- package/lib/OperationList-qsBOguHS.js.map +0 -1
- package/lib/Route-DlKvXPAO.js +0 -13
- package/lib/Route-DlKvXPAO.js.map +0 -1
- package/lib/SidebarBadge-DaA0-bFW.js +0 -503
- package/lib/SidebarBadge-DaA0-bFW.js.map +0 -1
- package/lib/SlotletProvider-BGEs7yyu.js +0 -240
- package/lib/SlotletProvider-BGEs7yyu.js.map +0 -1
- package/lib/ZudokuContext-DSipF8sq.js.map +0 -1
- package/lib/index-BIl-R3aH.js +0 -5952
- package/lib/index-BIl-R3aH.js.map +0 -1
- package/lib/index-CKmSo0py.js +0 -124
- package/lib/index-CKmSo0py.js.map +0 -1
- package/lib/index-DJqnphbT.js +0 -35
- package/lib/index-Dssw7Gff.js +0 -2867
- package/lib/index-Dssw7Gff.js.map +0 -1
- package/lib/index-SrtqdZ3j.js +0 -1781
- package/lib/index-SrtqdZ3j.js.map +0 -1
- package/lib/state-CsuHT8ZO.js +0 -183
- package/lib/urql-core-KJnLL26g.js +0 -1455
- package/lib/urql-core-KJnLL26g.js.map +0 -1
- package/src/lib/components/DevPortal.tsx +0 -111
- package/src/lib/components/context/ThemeContext.tsx +0 -8
- package/src/lib/components/context/ThemeProvider.tsx +0 -27
- package/src/lib/plugins/openapi/client/createMemoryClient.ts +0 -51
- package/src/lib/plugins/openapi/client/createWorkerClient.ts +0 -75
- package/src/lib/plugins/openapi/client/interfaces.ts +0 -5
- package/src/lib/themeToggle.ts +0 -7
- package/src/lib/util/createWaitForNotify.ts +0 -18
- /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
|
@@ -3,7 +3,6 @@ import { ExternalLinkIcon } from "lucide-react";
|
|
|
3
3
|
import { NavLink, useSearchParams } from "react-router-dom";
|
|
4
4
|
|
|
5
5
|
import type { SidebarItem as SidebarItemType } from "../../../config/validators/SidebarSchema.js";
|
|
6
|
-
import { cn } from "../../util/cn.js";
|
|
7
6
|
import { joinPath } from "../../util/joinPath.js";
|
|
8
7
|
import { AnchorLink } from "../AnchorLink.js";
|
|
9
8
|
import { useViewportAnchor } from "../context/ViewportAnchorContext.js";
|
|
@@ -15,7 +14,8 @@ export const navigationListItem = cva(
|
|
|
15
14
|
{
|
|
16
15
|
variants: {
|
|
17
16
|
isTopLevel: {
|
|
18
|
-
true: "font-
|
|
17
|
+
true: "font-medium -mx-[--padding-nav-item]",
|
|
18
|
+
false: "-mr-[--padding-nav-item] ml-[--padding-nav-item]",
|
|
19
19
|
},
|
|
20
20
|
isActive: {
|
|
21
21
|
true: "text-primary font-medium",
|
|
@@ -26,6 +26,9 @@ export const navigationListItem = cva(
|
|
|
26
26
|
false: "",
|
|
27
27
|
},
|
|
28
28
|
},
|
|
29
|
+
defaultVariants: {
|
|
30
|
+
isActive: false,
|
|
31
|
+
},
|
|
29
32
|
},
|
|
30
33
|
);
|
|
31
34
|
|
|
@@ -56,7 +59,7 @@ export const SidebarItem = ({
|
|
|
56
59
|
{item.icon && <item.icon size={16} className="align-[-0.125em]" />}
|
|
57
60
|
{item.badge ? (
|
|
58
61
|
<>
|
|
59
|
-
<span className="truncate" title={item.label}>
|
|
62
|
+
<span className="truncate flex-1" title={item.label}>
|
|
60
63
|
{item.label}
|
|
61
64
|
</span>
|
|
62
65
|
<SidebarBadge {...item.badge} />
|
|
@@ -71,13 +74,11 @@ export const SidebarItem = ({
|
|
|
71
74
|
<AnchorLink
|
|
72
75
|
to={{ hash: item.href, search: searchParams.toString() }}
|
|
73
76
|
{...{ [DATA_ANCHOR_ATTR]: item.href.slice(1) }}
|
|
74
|
-
className={
|
|
75
|
-
|
|
76
|
-
level === 0
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
}),
|
|
80
|
-
)}
|
|
77
|
+
className={navigationListItem({
|
|
78
|
+
isActive: item.href.slice(1) === activeAnchor,
|
|
79
|
+
isTopLevel: level === 0,
|
|
80
|
+
className: item.badge?.placement !== "start" && "justify-between",
|
|
81
|
+
})}
|
|
81
82
|
>
|
|
82
83
|
{item.badge ? (
|
|
83
84
|
<>
|
|
@@ -92,7 +93,9 @@ export const SidebarItem = ({
|
|
|
92
93
|
</AnchorLink>
|
|
93
94
|
) : !item.href.startsWith("http") ? (
|
|
94
95
|
<NavLink
|
|
95
|
-
className={
|
|
96
|
+
className={navigationListItem({
|
|
97
|
+
className: item.badge?.placement !== "start" && "justify-between",
|
|
98
|
+
})}
|
|
96
99
|
to={item.href}
|
|
97
100
|
>
|
|
98
101
|
{item.badge ? (
|
|
@@ -108,10 +111,7 @@ export const SidebarItem = ({
|
|
|
108
111
|
</NavLink>
|
|
109
112
|
) : (
|
|
110
113
|
<a
|
|
111
|
-
className={
|
|
112
|
-
navigationListItem({ isTopLevel: level === 0 }),
|
|
113
|
-
"block",
|
|
114
|
-
)}
|
|
114
|
+
className={navigationListItem({ isTopLevel: level === 0 })}
|
|
115
115
|
href={item.href}
|
|
116
116
|
target="_blank"
|
|
117
117
|
rel="noopener noreferrer"
|
|
@@ -119,8 +119,7 @@ export const SidebarItem = ({
|
|
|
119
119
|
<span className="whitespace-normal">{item.label}</span>
|
|
120
120
|
{/* This prevents that the icon would be positioned in its own line if the text fills a line entirely */}
|
|
121
121
|
<span className="whitespace-nowrap">
|
|
122
|
-
|
|
123
|
-
<ExternalLinkIcon className="inline ml-1" size={12} />
|
|
122
|
+
<ExternalLinkIcon className="inline -translate-y-0.5" size={12} />
|
|
124
123
|
</span>
|
|
125
124
|
</a>
|
|
126
125
|
);
|
|
@@ -44,7 +44,7 @@ export const useCurrentItem = () => {
|
|
|
44
44
|
const location = useLocation();
|
|
45
45
|
const nav = useCurrentNavigation();
|
|
46
46
|
|
|
47
|
-
const currentSidebar = nav.
|
|
47
|
+
const currentSidebar = nav.sidebar;
|
|
48
48
|
|
|
49
49
|
return traverseSidebar(currentSidebar, (item) => {
|
|
50
50
|
if (item.type === "doc" && joinPath(item.id) === location.pathname) {
|
|
@@ -79,7 +79,7 @@ export const usePrevNext = (): {
|
|
|
79
79
|
} => {
|
|
80
80
|
const currentId = useLocation().pathname;
|
|
81
81
|
const nav = useCurrentNavigation();
|
|
82
|
-
const currentSidebar = nav.
|
|
82
|
+
const currentSidebar = nav.sidebar;
|
|
83
83
|
|
|
84
84
|
let prev;
|
|
85
85
|
let next;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { QueryClient } from "@tanstack/react-query";
|
|
2
1
|
import { ReactNode } from "react";
|
|
3
2
|
import type { SidebarConfig } from "../../config/validators/SidebarSchema.js";
|
|
4
3
|
import { TopNavigationItem } from "../../config/validators/validate.js";
|
|
@@ -8,11 +7,11 @@ import { Slotlets } from "../components/SlotletProvider.js";
|
|
|
8
7
|
import { joinPath } from "../util/joinPath.js";
|
|
9
8
|
import type { MdxComponentsType } from "../util/MdxComponents.js";
|
|
10
9
|
import {
|
|
11
|
-
type DevPortalPlugin,
|
|
12
10
|
isApiIdentityPlugin,
|
|
13
11
|
isNavigationPlugin,
|
|
14
12
|
type NavigationPlugin,
|
|
15
13
|
needsInitialization,
|
|
14
|
+
type ZudokuPlugin,
|
|
16
15
|
} from "./plugins.js";
|
|
17
16
|
|
|
18
17
|
export interface ApiIdentity {
|
|
@@ -21,10 +20,7 @@ export interface ApiIdentity {
|
|
|
21
20
|
id: string;
|
|
22
21
|
}
|
|
23
22
|
|
|
24
|
-
export const queryClient = new QueryClient();
|
|
25
|
-
|
|
26
23
|
export type ApiKeyCache = "api-keys";
|
|
27
|
-
export type DevPortalCacheKey = ApiKeyCache | string;
|
|
28
24
|
|
|
29
25
|
type Metadata = Partial<{
|
|
30
26
|
title: string;
|
|
@@ -63,7 +59,7 @@ export type ZudokuContextOptions = {
|
|
|
63
59
|
authentication?: AuthenticationProvider;
|
|
64
60
|
topNavigation?: TopNavigationItem[];
|
|
65
61
|
sidebars?: SidebarConfig;
|
|
66
|
-
plugins?:
|
|
62
|
+
plugins?: ZudokuPlugin[];
|
|
67
63
|
slotlets?: Slotlets;
|
|
68
64
|
mdx?: {
|
|
69
65
|
components?: MdxComponentsType;
|
|
@@ -71,7 +67,7 @@ export type ZudokuContextOptions = {
|
|
|
71
67
|
overrides?: ComponentsContextType;
|
|
72
68
|
};
|
|
73
69
|
|
|
74
|
-
export class
|
|
70
|
+
export class ZudokuContext {
|
|
75
71
|
public plugins: NonNullable<ZudokuContextOptions["plugins"]>;
|
|
76
72
|
public sidebars: SidebarConfig;
|
|
77
73
|
public topNavigation: NonNullable<ZudokuContextOptions["topNavigation"]>;
|
|
@@ -98,10 +94,6 @@ export class DevPortalContext {
|
|
|
98
94
|
);
|
|
99
95
|
};
|
|
100
96
|
|
|
101
|
-
invalidateCache = async (key: DevPortalCacheKey[]) => {
|
|
102
|
-
await queryClient.invalidateQueries({ queryKey: key });
|
|
103
|
-
};
|
|
104
|
-
|
|
105
97
|
getApiIdentities = async () => {
|
|
106
98
|
const keys = await Promise.all(
|
|
107
99
|
this.plugins
|
package/src/lib/core/plugins.ts
CHANGED
|
@@ -2,9 +2,9 @@ import { type ReactElement } from "react";
|
|
|
2
2
|
import { type RouteObject } from "react-router-dom";
|
|
3
3
|
import type { Sidebar } from "../../config/validators/SidebarSchema.js";
|
|
4
4
|
import { MdxComponentsType } from "../util/MdxComponents.js";
|
|
5
|
-
import {
|
|
5
|
+
import { ZudokuContext, type ApiIdentity } from "./ZudokuContext.js";
|
|
6
6
|
|
|
7
|
-
export type
|
|
7
|
+
export type ZudokuPlugin =
|
|
8
8
|
| CommonPlugin
|
|
9
9
|
| ProfileMenuPlugin
|
|
10
10
|
| NavigationPlugin
|
|
@@ -19,7 +19,7 @@ export interface NavigationPlugin {
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
export interface ApiIdentityPlugin {
|
|
22
|
-
getIdentities: (context:
|
|
22
|
+
getIdentities: (context: ZudokuContext) => Promise<ApiIdentity[]>;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
export interface SearchProviderPlugin {
|
|
@@ -30,7 +30,7 @@ export interface SearchProviderPlugin {
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
export interface ProfileMenuPlugin {
|
|
33
|
-
getProfileMenuItems: (context:
|
|
33
|
+
getProfileMenuItems: (context: ZudokuContext) => ProfileNavigationItem[];
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
export type ProfileNavigationItem = {
|
|
@@ -41,41 +41,37 @@ export type ProfileNavigationItem = {
|
|
|
41
41
|
|
|
42
42
|
export interface CommonPlugin {
|
|
43
43
|
initialize?: (
|
|
44
|
-
context:
|
|
44
|
+
context: ZudokuContext,
|
|
45
45
|
) => Promise<void | boolean> | void | boolean;
|
|
46
46
|
getHead?: () => ReactElement | undefined;
|
|
47
47
|
getMdxComponents?: () => MdxComponentsType;
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
export const isProfileMenuPlugin = (
|
|
51
|
-
obj:
|
|
51
|
+
obj: ZudokuPlugin,
|
|
52
52
|
): obj is ProfileMenuPlugin =>
|
|
53
53
|
"getProfileMenuItems" in obj && typeof obj.getProfileMenuItems === "function";
|
|
54
54
|
|
|
55
55
|
export const isNavigationPlugin = (
|
|
56
|
-
obj:
|
|
56
|
+
obj: ZudokuPlugin,
|
|
57
57
|
): obj is NavigationPlugin =>
|
|
58
58
|
"getRoutes" in obj && typeof obj.getRoutes === "function";
|
|
59
59
|
|
|
60
60
|
export const isSearchPlugin = (
|
|
61
|
-
obj:
|
|
61
|
+
obj: ZudokuPlugin,
|
|
62
62
|
): obj is SearchProviderPlugin =>
|
|
63
63
|
"renderSearch" in obj && typeof obj.renderSearch === "function";
|
|
64
64
|
|
|
65
|
-
export const needsInitialization = (
|
|
66
|
-
obj: DevPortalPlugin,
|
|
67
|
-
): obj is CommonPlugin =>
|
|
65
|
+
export const needsInitialization = (obj: ZudokuPlugin): obj is CommonPlugin =>
|
|
68
66
|
"initialize" in obj && typeof obj.initialize === "function";
|
|
69
67
|
|
|
70
|
-
export const hasHead = (obj:
|
|
68
|
+
export const hasHead = (obj: ZudokuPlugin): obj is CommonPlugin =>
|
|
71
69
|
"getHead" in obj && typeof obj.getHead === "function";
|
|
72
70
|
|
|
73
|
-
export const isMdxProviderPlugin = (
|
|
74
|
-
obj: DevPortalPlugin,
|
|
75
|
-
): obj is CommonPlugin =>
|
|
71
|
+
export const isMdxProviderPlugin = (obj: ZudokuPlugin): obj is CommonPlugin =>
|
|
76
72
|
"getMdxComponents" in obj && typeof obj.getMdxComponents === "function";
|
|
77
73
|
|
|
78
74
|
export const isApiIdentityPlugin = (
|
|
79
|
-
obj:
|
|
75
|
+
obj: ZudokuPlugin,
|
|
80
76
|
): obj is ApiIdentityPlugin =>
|
|
81
77
|
"getIdentities" in obj && typeof obj.getIdentities === "function";
|
|
@@ -1,16 +1,30 @@
|
|
|
1
1
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import { DeveloperHint } from "../components/DeveloperHint.js";
|
|
3
|
+
import { ZudokuError } from "../util/invariant.js";
|
|
4
|
+
|
|
5
|
+
export function ErrorAlert({ error }: { error: unknown }) {
|
|
6
|
+
const message =
|
|
7
|
+
error instanceof Error ? error.message : "Something went wrong";
|
|
8
|
+
|
|
9
|
+
const hint = error instanceof ZudokuError ? error.developerHint : undefined;
|
|
10
|
+
const title =
|
|
11
|
+
error instanceof ZudokuError ? error.title : "Something went wrong";
|
|
12
|
+
const stack = error instanceof Error ? error.stack : undefined;
|
|
13
|
+
const cause = error instanceof Error ? error.cause : undefined;
|
|
5
14
|
|
|
6
15
|
return (
|
|
7
|
-
<div className="flex h-screen max-h-
|
|
16
|
+
<div className="flex h-screen max-h-[calc(100vh-var(--header-height))] min-h-full items-center justify-center bg-primary-background px-4 py-16 lg:px-8">
|
|
8
17
|
<div className="mx-auto max-w-[85%] sm:max-w-[50%]">
|
|
9
18
|
<h1 className="text-4xl font-bold tracking-tight text-h1-text sm:text-5xl">
|
|
10
|
-
|
|
19
|
+
{title}
|
|
11
20
|
</h1>
|
|
12
21
|
<p className="mt-5 text-h1-text">{message}</p>
|
|
13
|
-
{
|
|
22
|
+
{hint && <DeveloperHint className="mb-4">{hint}</DeveloperHint>}
|
|
23
|
+
{cause instanceof Error ? (
|
|
24
|
+
<pre className="mt-5 max-h-[400px] w-full overflow-scroll rounded-md border border-input-border bg-input-background p-3 text-property-name-text text-red-700">
|
|
25
|
+
{cause.stack}
|
|
26
|
+
</pre>
|
|
27
|
+
) : stack ? (
|
|
14
28
|
<pre className="mt-5 max-h-[400px] w-full overflow-scroll rounded-md border border-input-border bg-input-background p-3 text-property-name-text text-red-700">
|
|
15
29
|
{stack}
|
|
16
30
|
</pre>
|
|
@@ -206,7 +206,7 @@ const ExampleItem = builder
|
|
|
206
206
|
name: t.exposeString("name"),
|
|
207
207
|
summary: t.exposeString("summary", { nullable: true }),
|
|
208
208
|
description: t.exposeString("description", { nullable: true }),
|
|
209
|
-
value: t.
|
|
209
|
+
value: t.expose("value", { type: JSONScalar, nullable: true }),
|
|
210
210
|
externalValue: t.exposeString("externalValue", { nullable: true }),
|
|
211
211
|
}),
|
|
212
212
|
});
|
|
@@ -348,10 +348,10 @@ const OperationItem = builder
|
|
|
348
348
|
statusCode,
|
|
349
349
|
description: response.description,
|
|
350
350
|
content: Object.entries(response.content ?? {}).map(
|
|
351
|
-
([mediaType,
|
|
351
|
+
([mediaType, { schema, examples }]) => ({
|
|
352
352
|
mediaType,
|
|
353
|
-
schema
|
|
354
|
-
examples: Object.entries(
|
|
353
|
+
schema,
|
|
354
|
+
examples: Object.entries(examples ?? {}).map(
|
|
355
355
|
([name, value]) => ({ name, ...value }),
|
|
356
356
|
),
|
|
357
357
|
}),
|
|
@@ -64,7 +64,9 @@ export const upgradeSchema = (schema: Record<string, any>): OpenAPIDocument => {
|
|
|
64
64
|
schema = traverse(schema, (sub) => {
|
|
65
65
|
if (sub.example !== undefined) {
|
|
66
66
|
sub.examples = {
|
|
67
|
-
default:
|
|
67
|
+
default: {
|
|
68
|
+
value: sub.example,
|
|
69
|
+
},
|
|
68
70
|
};
|
|
69
71
|
delete sub.example;
|
|
70
72
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { useMutation } from "@tanstack/react-query";
|
|
2
2
|
import { useForm } from "react-hook-form";
|
|
3
3
|
import { Link, useNavigate } from "react-router-dom";
|
|
4
|
-
import { useZudoku } from "../../components/context/ZudokuContext.js";
|
|
5
4
|
import {
|
|
6
5
|
Select,
|
|
7
6
|
SelectContent,
|
|
@@ -9,7 +8,8 @@ import {
|
|
|
9
8
|
SelectItem,
|
|
10
9
|
SelectTrigger,
|
|
11
10
|
SelectValue,
|
|
12
|
-
} from "
|
|
11
|
+
} from "zudoku/ui/Select.js";
|
|
12
|
+
import { useZudoku } from "../../components/context/ZudokuContext.js";
|
|
13
13
|
import { Button } from "../../ui/Button.js";
|
|
14
14
|
import { Input } from "../../ui/Input.js";
|
|
15
15
|
import { ApiKeyService } from "./index.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { type RouteObject } from "react-router-dom";
|
|
2
|
-
import {
|
|
2
|
+
import { ZudokuContext } from "../../core/ZudokuContext.js";
|
|
3
3
|
import {
|
|
4
4
|
type ApiIdentityPlugin,
|
|
5
|
-
type
|
|
5
|
+
type ZudokuPlugin,
|
|
6
6
|
ProfileMenuPlugin,
|
|
7
7
|
} from "../../core/plugins.js";
|
|
8
8
|
import { RouterError } from "../../errors/RouterError.js";
|
|
@@ -15,17 +15,17 @@ const DEFAULT_API_KEY_ENDPOINT =
|
|
|
15
15
|
"https://zudoku-rewiringamerica-main-ef9c9c0.d2.zuplo.dev";
|
|
16
16
|
|
|
17
17
|
export type ApiKeyService = {
|
|
18
|
-
getKeys: (context:
|
|
19
|
-
rollKey?: (id: string, context:
|
|
20
|
-
deleteKey?: (id: string, context:
|
|
18
|
+
getKeys: (context: ZudokuContext) => Promise<ApiKey[]>;
|
|
19
|
+
rollKey?: (id: string, context: ZudokuContext) => Promise<void>;
|
|
20
|
+
deleteKey?: (id: string, context: ZudokuContext) => Promise<void>;
|
|
21
21
|
updateKeyDescription?: (
|
|
22
22
|
apiKey: { id: string; description: string },
|
|
23
|
-
context:
|
|
23
|
+
context: ZudokuContext,
|
|
24
24
|
) => Promise<void>;
|
|
25
|
-
getUsage?: (apiKeys: string[], context:
|
|
25
|
+
getUsage?: (apiKeys: string[], context: ZudokuContext) => Promise<void>;
|
|
26
26
|
createKey?: (
|
|
27
27
|
apiKey: { description: string; expiresOn?: string },
|
|
28
|
-
context:
|
|
28
|
+
context: ZudokuContext,
|
|
29
29
|
) => Promise<void>;
|
|
30
30
|
};
|
|
31
31
|
|
|
@@ -93,7 +93,7 @@ const createDefaultHandler = (endpoint: string): ApiKeyService => {
|
|
|
93
93
|
|
|
94
94
|
export const apiKeyPlugin = (
|
|
95
95
|
options: ApiKeyPluginOptions,
|
|
96
|
-
):
|
|
96
|
+
): ZudokuPlugin & ApiIdentityPlugin & ProfileMenuPlugin => {
|
|
97
97
|
const endpoint =
|
|
98
98
|
"endpoint" in options ? options.endpoint : DEFAULT_API_KEY_ENDPOINT;
|
|
99
99
|
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ProseClasses } from "../../components/Markdown.js";
|
|
3
|
+
import { cn } from "../../util/cn.js";
|
|
4
|
+
import { useExposedProps } from "../../util/useExposedProps.js";
|
|
5
|
+
import type { CustomPageConfig } from "./index.js";
|
|
6
|
+
|
|
7
|
+
export const CustomPage = ({
|
|
8
|
+
element,
|
|
9
|
+
render,
|
|
10
|
+
prose = true,
|
|
11
|
+
}: Omit<CustomPageConfig, "path">) => {
|
|
12
|
+
const exposedProps = useExposedProps();
|
|
13
|
+
const content = render ? React.createElement(render, exposedProps) : element;
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<div className={cn(prose && ProseClasses, "max-w-full")}>{content}</div>
|
|
17
|
+
);
|
|
18
|
+
};
|
|
@@ -1,22 +1,24 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ComponentType, type ReactNode } from "react";
|
|
2
2
|
import type { RouteObject } from "react-router-dom";
|
|
3
|
-
import {
|
|
4
|
-
import type {
|
|
3
|
+
import { type ExposedComponentProps } from "../../components/SlotletProvider.js";
|
|
4
|
+
import type { NavigationPlugin, ZudokuPlugin } from "../../core/plugins.js";
|
|
5
|
+
import { CustomPage } from "./CustomPage.js";
|
|
5
6
|
|
|
6
|
-
type
|
|
7
|
+
export type CustomPageConfig = {
|
|
7
8
|
path: string;
|
|
8
|
-
|
|
9
|
-
|
|
9
|
+
prose?: boolean;
|
|
10
|
+
element?: ReactNode;
|
|
11
|
+
render?: ComponentType<ExposedComponentProps>;
|
|
12
|
+
};
|
|
10
13
|
|
|
11
14
|
export const customPagesPlugin = (
|
|
12
|
-
config:
|
|
13
|
-
):
|
|
15
|
+
config: CustomPageConfig[],
|
|
16
|
+
): ZudokuPlugin & NavigationPlugin => {
|
|
14
17
|
return {
|
|
15
18
|
getRoutes: (): RouteObject[] =>
|
|
16
|
-
config.map(({ path,
|
|
19
|
+
config.map(({ path, ...props }) => ({
|
|
17
20
|
path,
|
|
18
|
-
|
|
19
|
-
element: <div className={ProseClasses + " max-w-full"}>{element}</div>,
|
|
21
|
+
element: <CustomPage {...props} />,
|
|
20
22
|
})),
|
|
21
23
|
};
|
|
22
24
|
};
|
|
@@ -68,14 +68,16 @@ export const MdxPage = ({
|
|
|
68
68
|
"max-w-full xl:w-full xl:max-w-prose flex-1 flex-shrink pt-[--padding-content-top] pb-[--padding-content-bottom]",
|
|
69
69
|
)}
|
|
70
70
|
>
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
{title}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
71
|
+
{(category || title) && (
|
|
72
|
+
<header>
|
|
73
|
+
{category && <CategoryHeading>{category}</CategoryHeading>}
|
|
74
|
+
{title && (
|
|
75
|
+
<Heading level={1} id={slugify(title)}>
|
|
76
|
+
{title}
|
|
77
|
+
</Heading>
|
|
78
|
+
)}
|
|
79
|
+
</header>
|
|
80
|
+
)}
|
|
79
81
|
<MdxComponent
|
|
80
82
|
components={{ ...useMDXComponents(), ...MarkdownHeadings }}
|
|
81
83
|
/>
|
|
@@ -2,7 +2,7 @@ import type { Toc } from "@stefanprobst/rehype-extract-toc";
|
|
|
2
2
|
import type { MDXProps } from "mdx/types.js";
|
|
3
3
|
import { RouteObject } from "react-router-dom";
|
|
4
4
|
import { ZudokuDocsConfig } from "../../../config/validators/validate.js";
|
|
5
|
-
import type {
|
|
5
|
+
import type { ZudokuPlugin } from "../../core/plugins.js";
|
|
6
6
|
import { DocResolver } from "./resolver.js";
|
|
7
7
|
|
|
8
8
|
export interface MarkdownPluginOptions extends ZudokuDocsConfig {
|
|
@@ -29,7 +29,7 @@ export type MDXImport = {
|
|
|
29
29
|
|
|
30
30
|
export const markdownPlugin = (
|
|
31
31
|
options: MarkdownPluginOptions[],
|
|
32
|
-
):
|
|
32
|
+
): ZudokuPlugin => ({
|
|
33
33
|
getRoutes: () => {
|
|
34
34
|
const routeMap = new Map<string, RouteObject>();
|
|
35
35
|
options.forEach(({ fileImports, files, defaultOptions }) =>
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { type CSSProperties, type ReactNode, useRef, useState } from "react";
|
|
2
|
+
import { Button } from "zudoku/ui/Button.js";
|
|
3
|
+
import {
|
|
4
|
+
Collapsible,
|
|
5
|
+
CollapsibleContent,
|
|
6
|
+
CollapsibleTrigger,
|
|
7
|
+
} from "zudoku/ui/Collapsible.js";
|
|
8
|
+
import { cn } from "../../util/cn.js";
|
|
9
|
+
import useIsomorphicLayoutEffect from "../../util/useIsomorphicLayoutEffect.js";
|
|
10
|
+
|
|
11
|
+
export const CollapsibleCode = ({
|
|
12
|
+
children,
|
|
13
|
+
maxHeight = 250,
|
|
14
|
+
}: {
|
|
15
|
+
children: ReactNode;
|
|
16
|
+
maxHeight?: number;
|
|
17
|
+
}) => {
|
|
18
|
+
const contentRef = useRef<HTMLDivElement | null>(null);
|
|
19
|
+
const [isOverflowing, setIsOverflowing] = useState(false);
|
|
20
|
+
const [open, setOpen] = useState(false);
|
|
21
|
+
|
|
22
|
+
useIsomorphicLayoutEffect(() => {
|
|
23
|
+
const el = contentRef.current;
|
|
24
|
+
if (!el) return;
|
|
25
|
+
|
|
26
|
+
setIsOverflowing(el.scrollHeight > maxHeight);
|
|
27
|
+
|
|
28
|
+
const observer = new ResizeObserver(() => {
|
|
29
|
+
setIsOverflowing(el.scrollHeight > maxHeight);
|
|
30
|
+
});
|
|
31
|
+
observer.observe(el);
|
|
32
|
+
|
|
33
|
+
return () => observer.disconnect();
|
|
34
|
+
}, [maxHeight]);
|
|
35
|
+
|
|
36
|
+
return (
|
|
37
|
+
<Collapsible
|
|
38
|
+
className="group"
|
|
39
|
+
open={open}
|
|
40
|
+
onOpenChange={setOpen}
|
|
41
|
+
style={{ "--max-height": `${maxHeight}px` } as CSSProperties}
|
|
42
|
+
>
|
|
43
|
+
<CollapsibleContent
|
|
44
|
+
forceMount
|
|
45
|
+
className={cn(
|
|
46
|
+
"relative overflow-hidden",
|
|
47
|
+
!open && isOverflowing && "max-h-[--max-height]",
|
|
48
|
+
)}
|
|
49
|
+
>
|
|
50
|
+
{!open && isOverflowing && (
|
|
51
|
+
<div className="absolute inset-0 bg-gradient-to-b from-transparent to-zinc-50/90 dark:to-zinc-800/90 z-10"></div>
|
|
52
|
+
)}
|
|
53
|
+
<div ref={contentRef}>{children}</div>
|
|
54
|
+
{!open && isOverflowing && (
|
|
55
|
+
<CollapsibleTrigger
|
|
56
|
+
className="absolute inset-0 grid place-items-center z-10"
|
|
57
|
+
asChild
|
|
58
|
+
>
|
|
59
|
+
<div>
|
|
60
|
+
<Button className="bg-primary/70 border border-accent-foreground/25">
|
|
61
|
+
Expand code
|
|
62
|
+
</Button>
|
|
63
|
+
</div>
|
|
64
|
+
</CollapsibleTrigger>
|
|
65
|
+
)}
|
|
66
|
+
</CollapsibleContent>
|
|
67
|
+
{isOverflowing && (
|
|
68
|
+
<div
|
|
69
|
+
className={cn("flex justify-center w-full mb-2", !open && "hidden")}
|
|
70
|
+
>
|
|
71
|
+
<CollapsibleTrigger asChild>
|
|
72
|
+
<Button className="border border-accent-foreground/25">
|
|
73
|
+
Collapse code
|
|
74
|
+
</Button>
|
|
75
|
+
</CollapsibleTrigger>
|
|
76
|
+
</div>
|
|
77
|
+
)}
|
|
78
|
+
</Collapsible>
|
|
79
|
+
);
|
|
80
|
+
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { useTheme } from "next-themes";
|
|
2
|
+
import { useEffect, useRef, type CSSProperties, type ReactNode } from "react";
|
|
3
3
|
import { cn } from "../../util/cn.js";
|
|
4
4
|
import { pastellize } from "../../util/pastellize.js";
|
|
5
5
|
|
|
6
6
|
export const DATA_ATTR = "data-linked-param";
|
|
7
7
|
|
|
8
8
|
export const usePastellizedColor = (name: string) => {
|
|
9
|
-
const
|
|
9
|
+
const { resolvedTheme } = useTheme();
|
|
10
10
|
return pastellize(
|
|
11
11
|
name,
|
|
12
|
-
|
|
12
|
+
resolvedTheme === "light" ? { saturation: 85, lightness: 50 } : undefined,
|
|
13
13
|
);
|
|
14
14
|
};
|
|
15
15
|
|
|
@@ -61,27 +61,36 @@ export const ColorizedParam = ({
|
|
|
61
61
|
});
|
|
62
62
|
};
|
|
63
63
|
|
|
64
|
-
ref.current
|
|
65
|
-
|
|
64
|
+
const el = ref.current;
|
|
65
|
+
|
|
66
|
+
el.addEventListener("mouseenter", onMouseEnter);
|
|
67
|
+
el.addEventListener("mouseleave", onMouseLeave);
|
|
66
68
|
|
|
67
69
|
return () => {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
+
el.removeEventListener("mouseenter", onMouseEnter);
|
|
71
|
+
el.removeEventListener("mouseleave", onMouseLeave);
|
|
70
72
|
};
|
|
71
73
|
}, [normalizedSlug]);
|
|
72
74
|
|
|
73
75
|
return (
|
|
74
76
|
<span
|
|
75
|
-
className={cn("inline-flex relative rounded group", className)}
|
|
76
77
|
{...{ [DATA_ATTR]: normalizedSlug }}
|
|
78
|
+
className={cn(
|
|
79
|
+
"relative after:rounded after:absolute after:inset-0 after:-bottom-0.5 after:border-b-2 after:transition-opacity after:duration-200",
|
|
80
|
+
"after:pointer-events-none after:border-[--border-color] after:opacity-30 after:data-[active=true]:opacity-100",
|
|
81
|
+
className,
|
|
82
|
+
)}
|
|
83
|
+
suppressHydrationWarning
|
|
77
84
|
ref={ref}
|
|
78
85
|
onClick={onClick}
|
|
86
|
+
style={
|
|
87
|
+
{
|
|
88
|
+
"--border-color": borderColor,
|
|
89
|
+
"--background-color": backgroundColor,
|
|
90
|
+
} as CSSProperties
|
|
91
|
+
}
|
|
79
92
|
>
|
|
80
|
-
|
|
81
|
-
className="absolute inset-0 border-b-2 transition-opacity duration-200 opacity-30 group-data-[active=true]:opacity-100"
|
|
82
|
-
style={{ borderColor, backgroundColor }}
|
|
83
|
-
/>
|
|
84
|
-
<span className="relative">{children ?? name}</span>
|
|
93
|
+
{children ?? name}
|
|
85
94
|
</span>
|
|
86
95
|
);
|
|
87
96
|
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { useSuspenseQuery } from "@tanstack/react-query";
|
|
1
2
|
import { CheckIcon, CopyIcon } from "lucide-react";
|
|
2
3
|
import { useState, useTransition } from "react";
|
|
3
|
-
import { useQuery } from "urql";
|
|
4
4
|
import { useSelectedServerStore } from "../../authentication/state.js";
|
|
5
5
|
import { InlineCode } from "../../components/InlineCode.js";
|
|
6
6
|
import { Button } from "../../ui/Button.js";
|
|
7
|
+
import { useCreateQuery } from "./client/useCreateQuery.js";
|
|
7
8
|
import { useOasConfig } from "./context.js";
|
|
8
9
|
import { graphql } from "./graphql/index.js";
|
|
9
10
|
import { SimpleSelect } from "./SimpleSelect.js";
|
|
@@ -42,19 +43,13 @@ const CopyButton = ({ url }: { url: string }) => {
|
|
|
42
43
|
);
|
|
43
44
|
};
|
|
44
45
|
|
|
45
|
-
const context = { suspense: true } as const;
|
|
46
|
-
|
|
47
46
|
export const Endpoint = () => {
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
context,
|
|
52
|
-
});
|
|
47
|
+
const { input, type } = useOasConfig();
|
|
48
|
+
const query = useCreateQuery(ServersQuery, { input, type });
|
|
49
|
+
const result = useSuspenseQuery(query);
|
|
53
50
|
const [, startTransition] = useTransition();
|
|
54
51
|
const { selectedServer, setSelectedServer } = useSelectedServerStore();
|
|
55
52
|
|
|
56
|
-
if (!result.data) return null;
|
|
57
|
-
|
|
58
53
|
const { servers } = result.data.schema;
|
|
59
54
|
|
|
60
55
|
if (servers.length === 1) {
|