zudoku 0.0.0-f417aae → 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/cli.js +2 -2
- package/dist/app/demo.js +0 -2
- package/dist/app/demo.js.map +1 -1
- package/dist/app/entry.client.js +16 -2
- package/dist/app/entry.client.js.map +1 -1
- package/dist/app/entry.server.js +9 -6
- package/dist/app/entry.server.js.map +1 -1
- package/dist/app/main.d.ts +2 -1
- package/dist/app/main.js +9 -24
- 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/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/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 +12 -12
- package/dist/config/validators/SidebarSchema.d.ts +24 -1
- package/dist/config/validators/SidebarSchema.js +76 -39
- package/dist/config/validators/SidebarSchema.js.map +1 -1
- package/dist/config/validators/validate.d.ts +335 -259
- package/dist/config/validators/validate.js +13 -11
- package/dist/config/validators/validate.js.map +1 -1
- package/dist/index.d.ts +4 -1
- 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/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 +10 -7
- 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 +6 -7
- package/dist/lib/components/MobileTopNavigation.js.map +1 -1
- package/dist/lib/components/SlotletProvider.d.ts +2 -1
- 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 +2 -0
- package/dist/lib/components/TopNavigation.js +36 -5
- 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 +10 -16
- package/dist/lib/components/context/ZudokuContext.js +27 -26
- 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 +18 -10
- package/dist/lib/components/index.js +2 -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 +2 -4
- package/dist/lib/components/navigation/SidebarCategory.js.map +1 -1
- package/dist/lib/components/navigation/SidebarItem.js +1 -3
- 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 → ZudokuContext.d.ts} +6 -14
- 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 +13 -12
- package/dist/lib/core/plugins.js.map +1 -1
- package/dist/lib/errors/ErrorAlert.js +1 -1
- 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.js +2 -2
- package/dist/lib/plugins/custom-pages/index.d.ts +2 -2
- package/dist/lib/plugins/custom-pages/index.js.map +1 -1
- package/dist/lib/plugins/markdown/index.d.ts +6 -7
- 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/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 +1 -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/useExposedProps.js +3 -2
- package/dist/lib/util/useExposedProps.js.map +1 -1
- 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/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 +2 -8
- package/dist/vite/config.js +24 -60
- 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/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 +37 -26
- 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 +3 -2
- package/dist/vite/plugin-mdx.js.map +1 -1
- package/dist/vite/plugin-sidebar.js +7 -6
- package/dist/vite/plugin-sidebar.js.map +1 -1
- package/dist/vite/plugin.js +2 -4
- package/dist/vite/plugin.js.map +1 -1
- package/dist/vite/prerender.d.ts +5 -1
- package/dist/vite/prerender.js +7 -5
- 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/{utils-G5XSiZc9.js → AnchorLink-CDlhr8gL.js} +232 -275
- package/lib/AnchorLink-CDlhr8gL.js.map +1 -0
- package/lib/{AuthenticationPlugin-tBvLKsFg.js → AuthenticationPlugin-DeGDVa1r.js} +6 -5
- package/lib/{AuthenticationPlugin-tBvLKsFg.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-D2WS6sRI.js → CategoryHeading-Bb9dqxD3.js} +4 -4
- package/lib/{CategoryHeading-D2WS6sRI.js.map → CategoryHeading-Bb9dqxD3.js.map} +1 -1
- package/lib/{ClientOnly-CVN6leDu.js → ClientOnly-E7hGysn1.js} +4 -4
- 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-tWI_P8wP.js → MdxPage-Bwn-VSsH.js} +32 -30
- package/lib/{MdxPage-tWI_P8wP.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/Spinner-3cQDBVGr.js +7 -0
- package/lib/Spinner-3cQDBVGr.js.map +1 -0
- package/lib/SyntaxHighlight-DkLOsjHS.js +2983 -0
- package/lib/SyntaxHighlight-DkLOsjHS.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/{worker-Bf8vjASY.js → worker-CPsGZsve.js} +565 -561
- package/lib/assets/{worker-Bf8vjASY.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-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-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/{router-BsfSoK2j.js → router-lfyopgBI.js} +23 -23
- package/lib/{router-BsfSoK2j.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-DEoP3GGJ.js → utils-DcpDOncX.js} +455 -410
- 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 +124 -138
- package/lib/zudoku.auth-openid.js.map +1 -1
- package/lib/zudoku.components.js +1128 -2987
- package/lib/zudoku.components.js.map +1 -1
- package/lib/zudoku.openapi-worker.js +10 -16336
- package/lib/zudoku.openapi-worker.js.map +1 -1
- package/lib/zudoku.plugin-api-keys.js +24 -21
- package/lib/zudoku.plugin-api-keys.js.map +1 -1
- package/lib/zudoku.plugin-custom-pages.js +9 -8
- package/lib/zudoku.plugin-custom-pages.js.map +1 -1
- package/lib/zudoku.plugin-markdown.js +93 -27
- 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 +1 -1
- 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 +18 -2
- package/src/app/entry.server.tsx +60 -50
- package/src/app/main.css +5 -1
- package/src/app/main.tsx +14 -30
- package/src/app/standalone.tsx +1 -4
- package/src/lib/authentication/authentication.ts +2 -2
- 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 +50 -40
- package/src/lib/components/Layout.tsx +43 -36
- package/src/lib/components/MobileTopNavigation.tsx +15 -18
- package/src/lib/components/SlotletProvider.tsx +2 -0
- package/src/lib/components/SyntaxHighlight.tsx +85 -46
- package/src/lib/components/ThemeSwitch.tsx +26 -0
- package/src/lib/components/TopNavigation.tsx +66 -24
- package/src/lib/components/Zudoku.tsx +108 -0
- package/src/lib/components/context/ZudokuContext.ts +33 -30
- package/src/lib/components/context/ZudokuProvider.tsx +2 -2
- package/src/lib/components/index.ts +2 -3
- package/src/lib/components/navigation/Sidebar.tsx +5 -5
- package/src/lib/components/navigation/SidebarCategory.tsx +2 -4
- package/src/lib/components/navigation/SidebarItem.tsx +1 -3
- package/src/lib/components/navigation/utils.ts +11 -16
- package/src/lib/core/{DevPortalContext.ts → ZudokuContext.ts} +6 -18
- package/src/lib/core/plugins.ts +14 -16
- package/src/lib/errors/ErrorAlert.tsx +2 -1
- 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 +2 -2
- package/src/lib/plugins/custom-pages/index.tsx +2 -2
- package/src/lib/plugins/markdown/index.tsx +50 -13
- package/src/lib/plugins/markdown/resolver.ts +92 -0
- 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 +7 -12
- 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 +3 -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/useExposedProps.tsx +8 -2
- package/src/lib/util/useIsomorphicLayoutEffect.ts +5 -0
- package/src/lib/util/useOnScreen.ts +32 -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/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/markdown/generateRoutes.d.ts +0 -3
- package/dist/lib/plugins/markdown/generateRoutes.js +0 -21
- package/dist/lib/plugins/markdown/generateRoutes.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/ClientOnly-CVN6leDu.js.map +0 -1
- package/lib/DeveloperHint-CRiZjqd2.js +0 -16
- package/lib/DeveloperHint-CRiZjqd2.js.map +0 -1
- package/lib/Input-CO-1DOZa.js +0 -2229
- package/lib/Input-CO-1DOZa.js.map +0 -1
- package/lib/Markdown-DM4zv3MA.js +0 -20442
- package/lib/Markdown-DM4zv3MA.js.map +0 -1
- package/lib/OperationList-Cd3lue0b.js +0 -600
- package/lib/OperationList-Cd3lue0b.js.map +0 -1
- package/lib/Route-DI0Y0pIV.js +0 -13
- package/lib/Route-DI0Y0pIV.js.map +0 -1
- package/lib/SlotletProvider-CBqY8mp6.js +0 -241
- package/lib/SlotletProvider-CBqY8mp6.js.map +0 -1
- package/lib/Spinner-DFQhPMBl.js +0 -505
- package/lib/Spinner-DFQhPMBl.js.map +0 -1
- package/lib/ZudokuContext-DEoP3GGJ.js.map +0 -1
- package/lib/index-Bs9roz8y.js +0 -5973
- package/lib/index-Bs9roz8y.js.map +0 -1
- package/lib/index-CBr6BM_4.js +0 -2867
- package/lib/index-CBr6BM_4.js.map +0 -1
- package/lib/index-CRo94sKK.js +0 -1783
- package/lib/index-CRo94sKK.js.map +0 -1
- package/lib/index-UUT9q9f9.js +0 -124
- package/lib/index-UUT9q9f9.js.map +0 -1
- package/lib/joinPath-B7kNnUX4.js +0 -8
- package/lib/joinPath-B7kNnUX4.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/lib/useExposedProps-B9K-9GTc.js +0 -9
- package/lib/useExposedProps-B9K-9GTc.js.map +0 -1
- package/lib/utils-G5XSiZc9.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/markdown/generateRoutes.tsx +0 -38
- 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
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { MDXProvider } from "@mdx-js/react";
|
|
2
|
+
import { Helmet } from "@zudoku/react-helmet-async";
|
|
3
|
+
import { ThemeProvider } from "next-themes";
|
|
4
|
+
import {
|
|
5
|
+
Fragment,
|
|
6
|
+
memo,
|
|
7
|
+
type PropsWithChildren,
|
|
8
|
+
useContext,
|
|
9
|
+
useEffect,
|
|
10
|
+
useMemo,
|
|
11
|
+
useState,
|
|
12
|
+
} from "react";
|
|
13
|
+
import { ErrorBoundary } from "react-error-boundary";
|
|
14
|
+
import { Outlet, useNavigation } from "react-router-dom";
|
|
15
|
+
import { hasHead, isMdxProviderPlugin } from "../core/plugins.js";
|
|
16
|
+
import { ZudokuContext, ZudokuContextOptions } from "../core/ZudokuContext.js";
|
|
17
|
+
import { TopLevelError } from "../errors/TopLevelError.js";
|
|
18
|
+
import { StaggeredRenderContext } from "../plugins/openapi/StaggeredRender.js";
|
|
19
|
+
import { MdxComponents } from "../util/MdxComponents.js";
|
|
20
|
+
import "../util/requestIdleCallbackPolyfill.js";
|
|
21
|
+
import {
|
|
22
|
+
ComponentsProvider,
|
|
23
|
+
DEFAULT_COMPONENTS,
|
|
24
|
+
} from "./context/ComponentsContext.js";
|
|
25
|
+
import { ViewportAnchorProvider } from "./context/ViewportAnchorContext.js";
|
|
26
|
+
import { ZudokuProvider } from "./context/ZudokuProvider.js";
|
|
27
|
+
import { SlotletProvider } from "./SlotletProvider.js";
|
|
28
|
+
|
|
29
|
+
const ZudokoInner = memo(
|
|
30
|
+
({ children, ...props }: PropsWithChildren<ZudokuContextOptions>) => {
|
|
31
|
+
const components = useMemo(
|
|
32
|
+
() => ({ ...DEFAULT_COMPONENTS, ...props.overrides }),
|
|
33
|
+
[props.overrides],
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
const mdxComponents = useMemo(() => {
|
|
37
|
+
const componentsFromPlugins = (props.plugins ?? [])
|
|
38
|
+
.filter(isMdxProviderPlugin)
|
|
39
|
+
.flatMap((plugin) =>
|
|
40
|
+
plugin.getMdxComponents ? [plugin.getMdxComponents()] : [],
|
|
41
|
+
);
|
|
42
|
+
|
|
43
|
+
return {
|
|
44
|
+
...componentsFromPlugins.reduce(
|
|
45
|
+
(acc, curr) => ({ ...acc, ...curr }),
|
|
46
|
+
{},
|
|
47
|
+
),
|
|
48
|
+
...MdxComponents,
|
|
49
|
+
...props.mdx?.components,
|
|
50
|
+
};
|
|
51
|
+
}, [props.mdx?.components, props.plugins]);
|
|
52
|
+
const { stagger } = useContext(StaggeredRenderContext);
|
|
53
|
+
const [didNavigate, setDidNavigate] = useState(false);
|
|
54
|
+
const staggeredValue = useMemo(
|
|
55
|
+
() => (didNavigate ? { stagger: true } : { stagger }),
|
|
56
|
+
[stagger, didNavigate],
|
|
57
|
+
);
|
|
58
|
+
const navigation = useNavigation();
|
|
59
|
+
|
|
60
|
+
useEffect(() => {
|
|
61
|
+
if (didNavigate) {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
setDidNavigate(true);
|
|
65
|
+
}, [didNavigate, navigation.location]);
|
|
66
|
+
|
|
67
|
+
const [zudokuContext] = useState(() => new ZudokuContext(props));
|
|
68
|
+
|
|
69
|
+
const heads = props.plugins
|
|
70
|
+
?.filter(hasHead)
|
|
71
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
72
|
+
.map((plugin, i) => <Fragment key={i}>{plugin.getHead?.()}</Fragment>);
|
|
73
|
+
|
|
74
|
+
return (
|
|
75
|
+
<>
|
|
76
|
+
<Helmet>{heads}</Helmet>
|
|
77
|
+
<StaggeredRenderContext.Provider value={staggeredValue}>
|
|
78
|
+
<ZudokuProvider context={zudokuContext}>
|
|
79
|
+
<MDXProvider components={mdxComponents}>
|
|
80
|
+
<ThemeProvider attribute="class" disableTransitionOnChange>
|
|
81
|
+
<ComponentsProvider value={components}>
|
|
82
|
+
<SlotletProvider slotlets={props.slotlets}>
|
|
83
|
+
<ViewportAnchorProvider>
|
|
84
|
+
{children ?? <Outlet />}
|
|
85
|
+
</ViewportAnchorProvider>
|
|
86
|
+
</SlotletProvider>
|
|
87
|
+
</ComponentsProvider>
|
|
88
|
+
</ThemeProvider>
|
|
89
|
+
</MDXProvider>
|
|
90
|
+
</ZudokuProvider>
|
|
91
|
+
</StaggeredRenderContext.Provider>
|
|
92
|
+
</>
|
|
93
|
+
);
|
|
94
|
+
},
|
|
95
|
+
);
|
|
96
|
+
|
|
97
|
+
ZudokoInner.displayName = "ZudokoInner";
|
|
98
|
+
|
|
99
|
+
const Zudoku = (props: ZudokuContextOptions) => {
|
|
100
|
+
return (
|
|
101
|
+
<ErrorBoundary FallbackComponent={TopLevelError}>
|
|
102
|
+
<ZudokoInner {...props} />
|
|
103
|
+
</ErrorBoundary>
|
|
104
|
+
);
|
|
105
|
+
};
|
|
106
|
+
Zudoku.displayName = "Zudoku";
|
|
107
|
+
|
|
108
|
+
export { Zudoku };
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { useQuery, useSuspenseQuery } from "@tanstack/react-query";
|
|
2
2
|
import { createContext, useContext } from "react";
|
|
3
|
-
import { useLocation } from "react-router-dom";
|
|
4
|
-
import {
|
|
3
|
+
import { matchPath, useLocation } from "react-router-dom";
|
|
4
|
+
import { ZudokuContext } from "../../core/ZudokuContext.js";
|
|
5
|
+
import { joinPath } from "../../util/joinPath.js";
|
|
6
|
+
import { traverseSidebar } from "../navigation/utils.js";
|
|
5
7
|
|
|
6
|
-
export const ZudokuReactContext = createContext<
|
|
8
|
+
export const ZudokuReactContext = createContext<ZudokuContext | undefined>(
|
|
7
9
|
undefined,
|
|
8
10
|
);
|
|
9
11
|
|
|
@@ -11,7 +13,7 @@ export const useZudoku = () => {
|
|
|
11
13
|
const context = useContext(ZudokuReactContext);
|
|
12
14
|
|
|
13
15
|
if (!context) {
|
|
14
|
-
throw new Error("
|
|
16
|
+
throw new Error("useZudoku must be used within a ZudokuProvider.");
|
|
15
17
|
}
|
|
16
18
|
|
|
17
19
|
return context;
|
|
@@ -25,34 +27,35 @@ export const useApiIdentities = () => {
|
|
|
25
27
|
});
|
|
26
28
|
};
|
|
27
29
|
|
|
28
|
-
export const
|
|
29
|
-
const { topNavigation } = useZudoku();
|
|
30
|
+
export const useCurrentNavigation = () => {
|
|
31
|
+
const { getPluginSidebar, sidebars, topNavigation } = useZudoku();
|
|
30
32
|
const location = useLocation();
|
|
31
33
|
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
34
|
+
const currentSidebarItem = Object.entries(sidebars).find(([, sidebar]) => {
|
|
35
|
+
return traverseSidebar(sidebar, (item) => {
|
|
36
|
+
const itemId =
|
|
37
|
+
item.type === "doc"
|
|
38
|
+
? joinPath(item.id)
|
|
39
|
+
: item.type === "category" && item.link
|
|
40
|
+
? joinPath(item.link.id)
|
|
41
|
+
: undefined;
|
|
42
|
+
|
|
43
|
+
if (itemId === location.pathname) {
|
|
44
|
+
return item;
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
const currentTopNavItem =
|
|
49
|
+
topNavigation.find((t) => t.id === currentSidebarItem?.[0]) ??
|
|
50
|
+
topNavigation.find((item) => matchPath(item.id, location.pathname));
|
|
44
51
|
|
|
45
|
-
|
|
46
|
-
queryFn:
|
|
47
|
-
|
|
48
|
-
? await getPluginSidebar(path)
|
|
49
|
-
: await getPluginSidebar(location.pathname);
|
|
50
|
-
|
|
51
|
-
return {
|
|
52
|
-
items: [...currentSidebar, ...pluginSidebar],
|
|
53
|
-
currentTopNavItem: navItem,
|
|
54
|
-
};
|
|
55
|
-
},
|
|
56
|
-
queryKey: ["navigation", path],
|
|
52
|
+
const { data } = useSuspenseQuery({
|
|
53
|
+
queryFn: () => getPluginSidebar(location.pathname),
|
|
54
|
+
queryKey: ["plugin-sidebar", location.pathname],
|
|
57
55
|
});
|
|
56
|
+
|
|
57
|
+
return {
|
|
58
|
+
sidebar: [...(currentSidebarItem ? currentSidebarItem[1] : []), ...data],
|
|
59
|
+
topNavItem: currentTopNavItem,
|
|
60
|
+
};
|
|
58
61
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { useSuspenseQuery } from "@tanstack/react-query";
|
|
2
2
|
import type { PropsWithChildren } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { ZudokuContext } from "../../core/ZudokuContext.js";
|
|
4
4
|
import { ZudokuReactContext } from "./ZudokuContext.js";
|
|
5
5
|
|
|
6
6
|
export const ZudokuProvider = ({
|
|
7
7
|
children,
|
|
8
8
|
context,
|
|
9
|
-
}: PropsWithChildren<{ context:
|
|
9
|
+
}: PropsWithChildren<{ context: ZudokuContext }>) => {
|
|
10
10
|
useSuspenseQuery({
|
|
11
11
|
queryFn: async () => {
|
|
12
12
|
await context.initialize();
|
|
@@ -11,11 +11,10 @@ import {
|
|
|
11
11
|
BootstrapStatic as BootstrapStaticImport,
|
|
12
12
|
} from "./Bootstrap.js";
|
|
13
13
|
import { ClientOnly as ClientOnlyImport } from "./ClientOnly.js";
|
|
14
|
-
import { DevPortal as DevPortalImport } from "./DevPortal.js";
|
|
15
14
|
import { Layout as LayoutImport } from "./Layout.js";
|
|
15
|
+
import { Zudoku as ZudokuImport } from "./Zudoku.js";
|
|
16
16
|
import { useZudoku as useZudokuImport } from "./context/ZudokuContext.js";
|
|
17
17
|
export const useMDXComponents = /*@__PURE__*/ useMDXComponentsImport;
|
|
18
|
-
export const DevPortal = /*@__PURE__*/ DevPortalImport;
|
|
19
18
|
export const Layout = /*@__PURE__*/ LayoutImport;
|
|
20
19
|
export const RouterError = /*@__PURE__*/ RouterErrorImport;
|
|
21
20
|
export const ServerError = /*@__PURE__*/ ServerErrorImport;
|
|
@@ -26,7 +25,7 @@ export const Head = /*@__PURE__*/ Helmet;
|
|
|
26
25
|
|
|
27
26
|
export const useZudoku = /*@__PURE__*/ useZudokuImport;
|
|
28
27
|
export const useAuth = /*@__PURE__*/ useAuthState;
|
|
29
|
-
export const Zudoku = /*@__PURE__*/
|
|
28
|
+
export const Zudoku = /*@__PURE__*/ ZudokuImport;
|
|
30
29
|
|
|
31
30
|
export const Callout = /*@__PURE__*/ CalloutImport;
|
|
32
31
|
export const ClientOnly = /*@__PURE__*/ ClientOnlyImport;
|
|
@@ -2,23 +2,23 @@ import { useRef } from "react";
|
|
|
2
2
|
|
|
3
3
|
import { VisuallyHidden } from "@radix-ui/react-visually-hidden";
|
|
4
4
|
import { DrawerContent, DrawerTitle } from "../../ui/Drawer.js";
|
|
5
|
-
import {
|
|
5
|
+
import { useCurrentNavigation } from "../context/ZudokuContext.js";
|
|
6
6
|
import { Slotlet } from "../SlotletProvider.js";
|
|
7
7
|
import { SidebarItem } from "./SidebarItem.js";
|
|
8
8
|
import { SidebarWrapper } from "./SidebarWrapper.js";
|
|
9
9
|
|
|
10
10
|
export const Sidebar = () => {
|
|
11
11
|
const navRef = useRef<HTMLDivElement | null>(null);
|
|
12
|
-
const navigation =
|
|
12
|
+
const navigation = useCurrentNavigation();
|
|
13
13
|
|
|
14
14
|
return (
|
|
15
15
|
<>
|
|
16
16
|
<SidebarWrapper
|
|
17
17
|
ref={navRef}
|
|
18
|
-
pushMainContent={navigation.
|
|
18
|
+
pushMainContent={navigation.sidebar.length > 0}
|
|
19
19
|
>
|
|
20
20
|
<Slotlet name="zudoku-before-navigation" />
|
|
21
|
-
{navigation.
|
|
21
|
+
{navigation.sidebar.map((item) => (
|
|
22
22
|
<SidebarItem key={item.label} item={item} />
|
|
23
23
|
))}
|
|
24
24
|
<Slotlet name="zudoku-after-navigation" />
|
|
@@ -30,7 +30,7 @@ export const Sidebar = () => {
|
|
|
30
30
|
<VisuallyHidden>
|
|
31
31
|
<DrawerTitle>Sidebar</DrawerTitle>
|
|
32
32
|
</VisuallyHidden>
|
|
33
|
-
{navigation.
|
|
33
|
+
{navigation.sidebar.map((item) => (
|
|
34
34
|
<SidebarItem key={item.label} item={item} />
|
|
35
35
|
))}
|
|
36
36
|
</DrawerContent>
|
|
@@ -5,7 +5,6 @@ import { NavLink, useMatch } from "react-router-dom";
|
|
|
5
5
|
import type { SidebarItemCategory } from "../../../config/validators/SidebarSchema.js";
|
|
6
6
|
import { cn } from "../../util/cn.js";
|
|
7
7
|
import { joinPath } from "../../util/joinPath.js";
|
|
8
|
-
import { useTopNavigationItem } from "../context/ZudokuContext.js";
|
|
9
8
|
import { navigationListItem, SidebarItem } from "./SidebarItem.js";
|
|
10
9
|
import { useIsCategoryOpen } from "./utils.js";
|
|
11
10
|
|
|
@@ -16,7 +15,6 @@ export const SidebarCategory = ({
|
|
|
16
15
|
category: SidebarItemCategory;
|
|
17
16
|
level: number;
|
|
18
17
|
}) => {
|
|
19
|
-
const topNavItem = useTopNavigationItem();
|
|
20
18
|
const isCategoryOpen = useIsCategoryOpen(category);
|
|
21
19
|
const [hasInteracted, setHasInteracted] = useState(false);
|
|
22
20
|
|
|
@@ -26,7 +24,7 @@ export const SidebarCategory = ({
|
|
|
26
24
|
!isCollapsible || !isCollapsed || isCategoryOpen,
|
|
27
25
|
);
|
|
28
26
|
const [open, setOpen] = useState(isDefaultOpen);
|
|
29
|
-
const isActive = useMatch(
|
|
27
|
+
const isActive = useMatch(category.link?.id ?? "");
|
|
30
28
|
|
|
31
29
|
useEffect(() => {
|
|
32
30
|
// this is triggered when an item from the sidebar is clicked
|
|
@@ -87,7 +85,7 @@ export const SidebarCategory = ({
|
|
|
87
85
|
)}
|
|
88
86
|
{category.link?.type === "doc" ? (
|
|
89
87
|
<NavLink
|
|
90
|
-
to={joinPath(
|
|
88
|
+
to={joinPath(category.link.id)}
|
|
91
89
|
className="flex-1"
|
|
92
90
|
onClick={() => {
|
|
93
91
|
// if it is the current path and closed then open it because there's no path change to trigger the open
|
|
@@ -6,7 +6,6 @@ import type { SidebarItem as SidebarItemType } from "../../../config/validators/
|
|
|
6
6
|
import { joinPath } from "../../util/joinPath.js";
|
|
7
7
|
import { AnchorLink } from "../AnchorLink.js";
|
|
8
8
|
import { useViewportAnchor } from "../context/ViewportAnchorContext.js";
|
|
9
|
-
import { useTopNavigationItem } from "../context/ZudokuContext.js";
|
|
10
9
|
import { SidebarBadge } from "./SidebarBadge.js";
|
|
11
10
|
import { SidebarCategory } from "./SidebarCategory.js";
|
|
12
11
|
|
|
@@ -43,7 +42,6 @@ export const SidebarItem = ({
|
|
|
43
42
|
basePath?: string;
|
|
44
43
|
level?: number;
|
|
45
44
|
}) => {
|
|
46
|
-
const topNavItem = useTopNavigationItem();
|
|
47
45
|
const { activeAnchor } = useViewportAnchor();
|
|
48
46
|
const [searchParams] = useSearchParams();
|
|
49
47
|
|
|
@@ -56,7 +54,7 @@ export const SidebarItem = ({
|
|
|
56
54
|
className={({ isActive }) =>
|
|
57
55
|
navigationListItem({ isActive, isTopLevel: level === 0 })
|
|
58
56
|
}
|
|
59
|
-
to={joinPath(
|
|
57
|
+
to={joinPath(item.id)}
|
|
60
58
|
>
|
|
61
59
|
{item.icon && <item.icon size={16} className="align-[-0.125em]" />}
|
|
62
60
|
{item.badge ? (
|
|
@@ -4,7 +4,7 @@ import type {
|
|
|
4
4
|
SidebarItemCategory,
|
|
5
5
|
} from "../../../config/validators/SidebarSchema.js";
|
|
6
6
|
import { joinPath } from "../../util/joinPath.js";
|
|
7
|
-
import {
|
|
7
|
+
import { useCurrentNavigation } from "../context/ZudokuContext.js";
|
|
8
8
|
|
|
9
9
|
export type TraverseCallback<T> = (
|
|
10
10
|
item: SidebarItem,
|
|
@@ -42,15 +42,12 @@ export const traverseSidebarItem = <T>(
|
|
|
42
42
|
|
|
43
43
|
export const useCurrentItem = () => {
|
|
44
44
|
const location = useLocation();
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
const currentSidebar =
|
|
45
|
+
const nav = useCurrentNavigation();
|
|
46
|
+
|
|
47
|
+
const currentSidebar = nav.sidebar;
|
|
48
48
|
|
|
49
49
|
return traverseSidebar(currentSidebar, (item) => {
|
|
50
|
-
if (
|
|
51
|
-
item.type === "doc" &&
|
|
52
|
-
joinPath(topNavItem?.id, item.id) === location.pathname
|
|
53
|
-
) {
|
|
50
|
+
if (item.type === "doc" && joinPath(item.id) === location.pathname) {
|
|
54
51
|
return item;
|
|
55
52
|
}
|
|
56
53
|
});
|
|
@@ -58,18 +55,17 @@ export const useCurrentItem = () => {
|
|
|
58
55
|
|
|
59
56
|
export const useIsCategoryOpen = (category: SidebarItemCategory) => {
|
|
60
57
|
const location = useLocation();
|
|
61
|
-
const topNavItem = useTopNavigationItem();
|
|
62
58
|
|
|
63
59
|
return traverseSidebarItem(category, (item) => {
|
|
64
60
|
if (item.type === "category" && item.link) {
|
|
65
|
-
const categoryLinkPath = joinPath(
|
|
61
|
+
const categoryLinkPath = joinPath(item.link.id);
|
|
66
62
|
if (categoryLinkPath === location.pathname) {
|
|
67
63
|
return true;
|
|
68
64
|
}
|
|
69
65
|
}
|
|
70
66
|
|
|
71
67
|
if (item.type === "doc") {
|
|
72
|
-
const docPath = joinPath(
|
|
68
|
+
const docPath = joinPath(item.id);
|
|
73
69
|
if (docPath === location.pathname) {
|
|
74
70
|
return true;
|
|
75
71
|
}
|
|
@@ -82,9 +78,8 @@ export const usePrevNext = (): {
|
|
|
82
78
|
next?: { label: string; id: string };
|
|
83
79
|
} => {
|
|
84
80
|
const currentId = useLocation().pathname;
|
|
85
|
-
const
|
|
86
|
-
const
|
|
87
|
-
const currentSidebar = topNavItem?.id ? sidebars[topNavItem.id] : [];
|
|
81
|
+
const nav = useCurrentNavigation();
|
|
82
|
+
const currentSidebar = nav.sidebar;
|
|
88
83
|
|
|
89
84
|
let prev;
|
|
90
85
|
let next;
|
|
@@ -94,9 +89,9 @@ export const usePrevNext = (): {
|
|
|
94
89
|
traverseSidebar(currentSidebar, (item) => {
|
|
95
90
|
const itemId =
|
|
96
91
|
item.type === "doc"
|
|
97
|
-
? joinPath(
|
|
92
|
+
? joinPath(item.id)
|
|
98
93
|
: item.type === "category" && item.link
|
|
99
|
-
? joinPath(
|
|
94
|
+
? joinPath(item.link.id)
|
|
100
95
|
: undefined;
|
|
101
96
|
|
|
102
97
|
if (!itemId) return;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { QueryClient } from "@tanstack/react-query";
|
|
2
1
|
import { ReactNode } from "react";
|
|
3
2
|
import type { SidebarConfig } from "../../config/validators/SidebarSchema.js";
|
|
3
|
+
import { TopNavigationItem } from "../../config/validators/validate.js";
|
|
4
4
|
import { type AuthenticationProvider } from "../authentication/authentication.js";
|
|
5
5
|
import type { ComponentsContextType } from "../components/context/ComponentsContext.js";
|
|
6
6
|
import { Slotlets } from "../components/SlotletProvider.js";
|
|
7
7
|
import { joinPath } from "../util/joinPath.js";
|
|
8
8
|
import type { MdxComponentsType } from "../util/MdxComponents.js";
|
|
9
9
|
import {
|
|
10
|
-
type DevPortalPlugin,
|
|
11
10
|
isApiIdentityPlugin,
|
|
12
11
|
isNavigationPlugin,
|
|
13
12
|
type NavigationPlugin,
|
|
14
13
|
needsInitialization,
|
|
14
|
+
type ZudokuPlugin,
|
|
15
15
|
} from "./plugins.js";
|
|
16
16
|
|
|
17
17
|
export interface ApiIdentity {
|
|
@@ -20,10 +20,7 @@ export interface ApiIdentity {
|
|
|
20
20
|
id: string;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
export const queryClient = new QueryClient();
|
|
24
|
-
|
|
25
23
|
export type ApiKeyCache = "api-keys";
|
|
26
|
-
export type DevPortalCacheKey = ApiKeyCache | string;
|
|
27
24
|
|
|
28
25
|
type Metadata = Partial<{
|
|
29
26
|
title: string;
|
|
@@ -60,14 +57,9 @@ export type ZudokuContextOptions = {
|
|
|
60
57
|
metadata?: Metadata;
|
|
61
58
|
page?: Page;
|
|
62
59
|
authentication?: AuthenticationProvider;
|
|
63
|
-
topNavigation?:
|
|
64
|
-
id: string;
|
|
65
|
-
label: string;
|
|
66
|
-
default?: string;
|
|
67
|
-
display?: "auth" | "anon" | "always";
|
|
68
|
-
}>;
|
|
60
|
+
topNavigation?: TopNavigationItem[];
|
|
69
61
|
sidebars?: SidebarConfig;
|
|
70
|
-
plugins?:
|
|
62
|
+
plugins?: ZudokuPlugin[];
|
|
71
63
|
slotlets?: Slotlets;
|
|
72
64
|
mdx?: {
|
|
73
65
|
components?: MdxComponentsType;
|
|
@@ -75,9 +67,9 @@ export type ZudokuContextOptions = {
|
|
|
75
67
|
overrides?: ComponentsContextType;
|
|
76
68
|
};
|
|
77
69
|
|
|
78
|
-
export class
|
|
70
|
+
export class ZudokuContext {
|
|
79
71
|
public plugins: NonNullable<ZudokuContextOptions["plugins"]>;
|
|
80
|
-
public sidebars:
|
|
72
|
+
public sidebars: SidebarConfig;
|
|
81
73
|
public topNavigation: NonNullable<ZudokuContextOptions["topNavigation"]>;
|
|
82
74
|
public meta: ZudokuContextOptions["metadata"];
|
|
83
75
|
public page: ZudokuContextOptions["page"];
|
|
@@ -102,10 +94,6 @@ export class DevPortalContext {
|
|
|
102
94
|
);
|
|
103
95
|
};
|
|
104
96
|
|
|
105
|
-
invalidateCache = async (key: DevPortalCacheKey[]) => {
|
|
106
|
-
await queryClient.invalidateQueries({ queryKey: key });
|
|
107
|
-
};
|
|
108
|
-
|
|
109
97
|
getApiIdentities = async () => {
|
|
110
98
|
const keys = await Promise.all(
|
|
111
99
|
this.plugins
|
package/src/lib/core/plugins.ts
CHANGED
|
@@ -2,22 +2,24 @@ 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
|
|
11
11
|
| ApiIdentityPlugin
|
|
12
12
|
| SearchProviderPlugin;
|
|
13
13
|
|
|
14
|
+
export type { RouteObject };
|
|
15
|
+
|
|
14
16
|
export interface NavigationPlugin {
|
|
15
17
|
getRoutes: () => RouteObject[];
|
|
16
18
|
getSidebar?: (path: string) => Promise<Sidebar>;
|
|
17
19
|
}
|
|
18
20
|
|
|
19
21
|
export interface ApiIdentityPlugin {
|
|
20
|
-
getIdentities: (context:
|
|
22
|
+
getIdentities: (context: ZudokuContext) => Promise<ApiIdentity[]>;
|
|
21
23
|
}
|
|
22
24
|
|
|
23
25
|
export interface SearchProviderPlugin {
|
|
@@ -28,7 +30,7 @@ export interface SearchProviderPlugin {
|
|
|
28
30
|
}
|
|
29
31
|
|
|
30
32
|
export interface ProfileMenuPlugin {
|
|
31
|
-
getProfileMenuItems: (context:
|
|
33
|
+
getProfileMenuItems: (context: ZudokuContext) => ProfileNavigationItem[];
|
|
32
34
|
}
|
|
33
35
|
|
|
34
36
|
export type ProfileNavigationItem = {
|
|
@@ -39,41 +41,37 @@ export type ProfileNavigationItem = {
|
|
|
39
41
|
|
|
40
42
|
export interface CommonPlugin {
|
|
41
43
|
initialize?: (
|
|
42
|
-
context:
|
|
44
|
+
context: ZudokuContext,
|
|
43
45
|
) => Promise<void | boolean> | void | boolean;
|
|
44
46
|
getHead?: () => ReactElement | undefined;
|
|
45
47
|
getMdxComponents?: () => MdxComponentsType;
|
|
46
48
|
}
|
|
47
49
|
|
|
48
50
|
export const isProfileMenuPlugin = (
|
|
49
|
-
obj:
|
|
51
|
+
obj: ZudokuPlugin,
|
|
50
52
|
): obj is ProfileMenuPlugin =>
|
|
51
53
|
"getProfileMenuItems" in obj && typeof obj.getProfileMenuItems === "function";
|
|
52
54
|
|
|
53
55
|
export const isNavigationPlugin = (
|
|
54
|
-
obj:
|
|
56
|
+
obj: ZudokuPlugin,
|
|
55
57
|
): obj is NavigationPlugin =>
|
|
56
58
|
"getRoutes" in obj && typeof obj.getRoutes === "function";
|
|
57
59
|
|
|
58
60
|
export const isSearchPlugin = (
|
|
59
|
-
obj:
|
|
61
|
+
obj: ZudokuPlugin,
|
|
60
62
|
): obj is SearchProviderPlugin =>
|
|
61
63
|
"renderSearch" in obj && typeof obj.renderSearch === "function";
|
|
62
64
|
|
|
63
|
-
export const needsInitialization = (
|
|
64
|
-
obj: DevPortalPlugin,
|
|
65
|
-
): obj is CommonPlugin =>
|
|
65
|
+
export const needsInitialization = (obj: ZudokuPlugin): obj is CommonPlugin =>
|
|
66
66
|
"initialize" in obj && typeof obj.initialize === "function";
|
|
67
67
|
|
|
68
|
-
export const hasHead = (obj:
|
|
68
|
+
export const hasHead = (obj: ZudokuPlugin): obj is CommonPlugin =>
|
|
69
69
|
"getHead" in obj && typeof obj.getHead === "function";
|
|
70
70
|
|
|
71
|
-
export const isMdxProviderPlugin = (
|
|
72
|
-
obj: DevPortalPlugin,
|
|
73
|
-
): obj is CommonPlugin =>
|
|
71
|
+
export const isMdxProviderPlugin = (obj: ZudokuPlugin): obj is CommonPlugin =>
|
|
74
72
|
"getMdxComponents" in obj && typeof obj.getMdxComponents === "function";
|
|
75
73
|
|
|
76
74
|
export const isApiIdentityPlugin = (
|
|
77
|
-
obj:
|
|
75
|
+
obj: ZudokuPlugin,
|
|
78
76
|
): obj is ApiIdentityPlugin =>
|
|
79
77
|
"getIdentities" in obj && typeof obj.getIdentities === "function";
|
|
@@ -5,6 +5,7 @@ import { ZudokuError } from "../util/invariant.js";
|
|
|
5
5
|
export function ErrorAlert({ error }: { error: unknown }) {
|
|
6
6
|
const message =
|
|
7
7
|
error instanceof Error ? error.message : "Something went wrong";
|
|
8
|
+
|
|
8
9
|
const hint = error instanceof ZudokuError ? error.developerHint : undefined;
|
|
9
10
|
const title =
|
|
10
11
|
error instanceof ZudokuError ? error.title : "Something went wrong";
|
|
@@ -12,7 +13,7 @@ export function ErrorAlert({ error }: { error: unknown }) {
|
|
|
12
13
|
const cause = error instanceof Error ? error.cause : undefined;
|
|
13
14
|
|
|
14
15
|
return (
|
|
15
|
-
<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">
|
|
16
17
|
<div className="mx-auto max-w-[85%] sm:max-w-[50%]">
|
|
17
18
|
<h1 className="text-4xl font-bold tracking-tight text-h1-text sm:text-5xl">
|
|
18
19
|
{title}
|
|
@@ -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";
|