zudoku 0.0.0-f1a6fd4 → 0.0.0-f2fd45c
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/entry.client.js +2 -2
- package/dist/app/entry.client.js.map +1 -1
- package/dist/app/entry.server.js +3 -0
- package/dist/app/entry.server.js.map +1 -1
- package/dist/app/main.d.ts +1 -0
- package/dist/app/main.js +9 -26
- package/dist/app/main.js.map +1 -1
- package/dist/app/standalone.js.map +1 -1
- package/dist/cli/cli.js +1 -2
- package/dist/cli/cli.js.map +1 -1
- package/dist/cli/common/machine-id/lib.js.map +1 -1
- package/dist/cli/common/outdated.js.map +1 -1
- package/dist/cli/common/utils/box.js.map +1 -1
- package/dist/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 +80 -44
- package/dist/config/validators/SidebarSchema.js.map +1 -1
- package/dist/config/validators/validate.d.ts +408 -262
- package/dist/config/validators/validate.js +23 -7
- 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/components/CallbackHandler.js +21 -31
- package/dist/lib/authentication/components/CallbackHandler.js.map +1 -1
- package/dist/lib/authentication/hook.d.ts +1 -1
- package/dist/lib/authentication/hook.js +1 -1
- package/dist/lib/authentication/hook.js.map +1 -1
- package/dist/lib/authentication/providers/auth0.js +1 -0
- package/dist/lib/authentication/providers/auth0.js.map +1 -1
- package/dist/lib/components/Header.js +6 -1
- package/dist/lib/components/Header.js.map +1 -1
- package/dist/lib/components/Heading.d.ts +1 -1
- package/dist/lib/components/MobileTopNavigation.js +4 -1
- 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 +4 -1
- package/dist/lib/components/SyntaxHighlight.js.map +1 -1
- package/dist/lib/components/TopNavigation.d.ts +3 -0
- package/dist/lib/components/TopNavigation.js +38 -5
- package/dist/lib/components/TopNavigation.js.map +1 -1
- package/dist/lib/components/context/ZudokuContext.d.ts +6 -10
- package/dist/lib/components/context/ZudokuContext.js +26 -20
- package/dist/lib/components/context/ZudokuContext.js.map +1 -1
- package/dist/lib/components/index.d.ts +17 -8
- package/dist/lib/components/index.js +10 -3
- package/dist/lib/components/index.js.map +1 -1
- package/dist/lib/components/navigation/Sidebar.js +3 -3
- package/dist/lib/components/navigation/Sidebar.js.map +1 -1
- package/dist/lib/components/navigation/SidebarCategory.js +18 -9
- package/dist/lib/components/navigation/SidebarCategory.js.map +1 -1
- package/dist/lib/components/navigation/SidebarItem.js +12 -7
- package/dist/lib/components/navigation/SidebarItem.js.map +1 -1
- package/dist/lib/components/navigation/utils.js +10 -14
- package/dist/lib/components/navigation/utils.js.map +1 -1
- package/dist/lib/core/DevPortalContext.d.ts +3 -6
- package/dist/lib/core/DevPortalContext.js.map +1 -1
- package/dist/lib/core/plugins.d.ts +1 -0
- package/dist/lib/core/plugins.js.map +1 -1
- package/dist/lib/errors/ErrorAlert.d.ts +1 -1
- package/dist/lib/errors/ErrorAlert.js +8 -3
- package/dist/lib/errors/ErrorAlert.js.map +1 -1
- package/dist/lib/plugins/api-keys/CreateApiKey.js +1 -1
- package/dist/lib/plugins/api-keys/CreateApiKey.js.map +1 -1
- package/dist/lib/plugins/custom-pages/CustomPage.js +2 -2
- 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 +5 -6
- package/dist/lib/plugins/markdown/index.js +31 -3
- package/dist/lib/plugins/markdown/index.js.map +1 -1
- package/dist/lib/plugins/markdown/resolver.d.ts +38 -0
- package/dist/lib/plugins/markdown/resolver.js +75 -0
- package/dist/lib/plugins/markdown/resolver.js.map +1 -0
- package/dist/lib/plugins/openapi/Endpoint.js.map +1 -1
- package/dist/lib/plugins/openapi/RequestBodySidecarBox.js.map +1 -1
- package/dist/lib/plugins/openapi/Sidecar.js +2 -2
- package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
- package/dist/lib/plugins/openapi/client/worker.js.map +1 -1
- 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/redirect/index.d.ts +2 -5
- package/dist/lib/plugins/redirect/index.js +1 -1
- package/dist/lib/plugins/redirect/index.js.map +1 -1
- package/dist/lib/ui/Accordion.d.ts +7 -0
- package/dist/lib/ui/Accordion.js +14 -0
- package/dist/lib/ui/Accordion.js.map +1 -0
- package/dist/lib/ui/Alert.d.ts +8 -0
- package/dist/lib/ui/Alert.js +23 -0
- package/dist/lib/ui/Alert.js.map +1 -0
- package/dist/lib/ui/AlertDialog.d.ts +20 -0
- package/dist/lib/ui/AlertDialog.js +27 -0
- package/dist/lib/ui/AlertDialog.js.map +1 -0
- package/dist/lib/ui/AspectRatio.d.ts +3 -0
- package/dist/lib/ui/AspectRatio.js +4 -0
- package/dist/lib/ui/AspectRatio.js.map +1 -0
- package/dist/lib/ui/Badge.d.ts +9 -0
- package/dist/lib/ui/Badge.js +21 -0
- package/dist/lib/ui/Badge.js.map +1 -0
- package/dist/lib/ui/Breadcrumb.d.ts +19 -0
- package/dist/lib/ui/Breadcrumb.js +24 -0
- package/dist/lib/ui/Breadcrumb.js.map +1 -0
- package/dist/lib/ui/Button.d.ts +2 -3
- package/dist/lib/ui/Button.js +1 -1
- package/dist/lib/ui/Button.js.map +1 -1
- package/dist/lib/ui/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.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.js +3 -2
- package/dist/lib/util/useExposedProps.js.map +1 -1
- 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 -59
- package/dist/vite/config.js.map +1 -1
- package/dist/vite/debug.d.ts +1 -0
- package/dist/vite/debug.js +10 -0
- package/dist/vite/debug.js.map +1 -0
- package/dist/vite/dev-server.js +1 -1
- package/dist/vite/dev-server.js.map +1 -1
- package/dist/vite/output.d.ts +101 -0
- package/dist/vite/output.js +30 -0
- package/dist/vite/output.js.map +1 -0
- package/dist/vite/plugin-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.js +14 -0
- package/dist/vite/plugin-mdx.js.map +1 -1
- package/dist/vite/plugin-search.d.ts +3 -0
- package/dist/vite/plugin-search.js +26 -0
- package/dist/vite/plugin-search.js.map +1 -0
- package/dist/vite/plugin-sidebar.js +7 -6
- package/dist/vite/plugin-sidebar.js.map +1 -1
- package/dist/vite/plugin.js +4 -2
- package/dist/vite/plugin.js.map +1 -1
- package/dist/vite/prerender.d.ts +5 -1
- package/dist/vite/prerender.js +6 -5
- package/dist/vite/prerender.js.map +1 -1
- package/lib/{utils-Chi3p5nE.js → AnchorLink-BbB2q-jx.js} +231 -275
- package/lib/AnchorLink-BbB2q-jx.js.map +1 -0
- package/lib/{AuthenticationPlugin-CbgJ5SAh.js → AuthenticationPlugin-C9BHGXlE.js} +3 -3
- package/lib/{AuthenticationPlugin-CbgJ5SAh.js.map → AuthenticationPlugin-C9BHGXlE.js.map} +1 -1
- package/lib/{CategoryHeading-3Qtp2yZ8.js → CategoryHeading-Bb9dqxD3.js} +4 -4
- package/lib/{CategoryHeading-3Qtp2yZ8.js.map → CategoryHeading-Bb9dqxD3.js.map} +1 -1
- package/lib/ClientOnly-CVN6leDu.js +11 -0
- package/lib/ClientOnly-CVN6leDu.js.map +1 -0
- package/lib/{DeveloperHint-BE9DzNhv.js → DeveloperHint-DHdLXGHA.js} +2 -2
- package/lib/{DeveloperHint-BE9DzNhv.js.map → DeveloperHint-DHdLXGHA.js.map} +1 -1
- package/lib/Dialog-k70Qfukb.js +67 -0
- package/lib/Dialog-k70Qfukb.js.map +1 -0
- package/lib/{Markdown-CWI6lU11.js → Markdown-BDcCAWwm.js} +4268 -6650
- package/lib/Markdown-BDcCAWwm.js.map +1 -0
- package/lib/{MdxPage-C3tlrV4j.js → MdxPage-DKMH_t0f.js} +33 -31
- package/lib/MdxPage-DKMH_t0f.js.map +1 -0
- package/lib/{OperationList-BO-ES1C5.js → OperationList-Tj7ubW_t.js} +131 -128
- package/lib/OperationList-Tj7ubW_t.js.map +1 -0
- package/lib/{Route-Dq6zv0Pi.js → Route-C3DGB6OS.js} +3 -3
- package/lib/{Route-Dq6zv0Pi.js.map → Route-C3DGB6OS.js.map} +1 -1
- package/lib/Select-Bagt3Bme.js +223 -0
- package/lib/Select-Bagt3Bme.js.map +1 -0
- package/lib/SlotletProvider-Da7eFgd2.js +241 -0
- package/lib/SlotletProvider-Da7eFgd2.js.map +1 -0
- package/lib/Spinner-C6zroowC.js +40 -0
- package/lib/Spinner-C6zroowC.js.map +1 -0
- package/lib/StaggeredRender-DDHSzQKE.js +17 -0
- package/lib/StaggeredRender-DDHSzQKE.js.map +1 -0
- package/lib/{ZudokuContext-BEmsYQoq.js → ZudokuContext-BKXGJTmu.js} +460 -411
- package/lib/ZudokuContext-BKXGJTmu.js.map +1 -0
- package/lib/__vite-browser-external-BYRIRx8p.js +9 -0
- package/lib/__vite-browser-external-BYRIRx8p.js.map +1 -0
- package/lib/_commonjsHelpers-BkfeUUK-.js +29 -0
- package/lib/_commonjsHelpers-BkfeUUK-.js.map +1 -0
- package/lib/assets/worker-Bf8vjASY.js.map +1 -1
- package/lib/cn-BmFQLtkS.js +2279 -0
- package/lib/cn-BmFQLtkS.js.map +1 -0
- package/lib/hook-sn0zMTkE.js +229 -0
- package/lib/hook-sn0zMTkE.js.map +1 -0
- package/lib/{index-DNfiZTPV.js → index-AjWCJNGC.js} +1332 -1606
- package/lib/index-AjWCJNGC.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-BRCiYFaL.js → index-CRo94sKK.js} +6 -4
- package/lib/{index-BRCiYFaL.js.map → index-CRo94sKK.js.map} +1 -1
- 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.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-BsfSoK2j.js} +3 -3
- package/lib/{router-Oe6YmY6B.js.map → router-BsfSoK2j.js.map} +1 -1
- package/lib/ui/Accordion.js +47 -0
- package/lib/ui/Accordion.js.map +1 -0
- package/lib/ui/Alert.js +51 -0
- package/lib/ui/Alert.js.map +1 -0
- package/lib/ui/AlertDialog.js +114 -0
- package/lib/ui/AlertDialog.js.map +1 -0
- package/lib/ui/AspectRatio.js +6 -0
- package/lib/ui/AspectRatio.js.map +1 -0
- package/lib/ui/Badge.js +27 -0
- package/lib/ui/Badge.js.map +1 -0
- package/lib/ui/Breadcrumb.js +94 -0
- package/lib/ui/Breadcrumb.js.map +1 -0
- package/lib/ui/Button.js +49 -0
- package/lib/ui/Button.js.map +1 -0
- package/lib/ui/Callout.js +77 -0
- package/lib/ui/Callout.js.map +1 -0
- package/lib/ui/Card.js +62 -0
- package/lib/ui/Card.js.map +1 -0
- package/lib/ui/Carousel.js +1410 -0
- package/lib/ui/Carousel.js.map +1 -0
- package/lib/ui/Checkbox.js +28 -0
- package/lib/ui/Checkbox.js.map +1 -0
- package/lib/ui/Collapsible.js +8 -0
- package/lib/ui/Collapsible.js.map +1 -0
- package/lib/ui/Command.js +550 -0
- package/lib/ui/Command.js.map +1 -0
- package/lib/ui/Dialog.js +101 -0
- package/lib/ui/Dialog.js.map +1 -0
- package/lib/ui/Drawer.js +1153 -0
- package/lib/ui/Drawer.js.map +1 -0
- package/lib/ui/DropdownMenu.js +145 -0
- package/lib/ui/DropdownMenu.js.map +1 -0
- package/lib/ui/Form.js +95 -0
- package/lib/ui/Form.js.map +1 -0
- package/lib/ui/HoverCard.js +24 -0
- package/lib/ui/HoverCard.js.map +1 -0
- package/lib/ui/Input.js +22 -0
- package/lib/ui/Input.js.map +1 -0
- package/lib/ui/Label.js +20 -0
- package/lib/ui/Label.js.map +1 -0
- package/lib/ui/Pagination.js +106 -0
- package/lib/ui/Pagination.js.map +1 -0
- package/lib/ui/Popover.js +24 -0
- package/lib/ui/Popover.js.map +1 -0
- package/lib/ui/Progress.js +27 -0
- package/lib/ui/Progress.js.map +1 -0
- package/lib/ui/RadioGroup.js +32 -0
- package/lib/ui/RadioGroup.js.map +1 -0
- package/lib/ui/ScrollArea.js +39 -0
- package/lib/ui/ScrollArea.js.map +1 -0
- package/lib/ui/Select.js +122 -0
- package/lib/ui/Select.js.map +1 -0
- package/lib/ui/Skeleton.js +18 -0
- package/lib/ui/Skeleton.js.map +1 -0
- package/lib/ui/Slider.js +24 -0
- package/lib/ui/Slider.js.map +1 -0
- package/lib/ui/Switch.js +28 -0
- package/lib/ui/Switch.js.map +1 -0
- package/lib/ui/Tabs.js +47 -0
- package/lib/ui/Tabs.js.map +1 -0
- package/lib/ui/Textarea.js +21 -0
- package/lib/ui/Textarea.js.map +1 -0
- package/lib/ui/Toggle.js +38 -0
- package/lib/ui/Toggle.js.map +1 -0
- package/lib/ui/ToggleGroup.js +42 -0
- package/lib/ui/ToggleGroup.js.map +1 -0
- package/lib/ui/Tooltip.js +24 -0
- package/lib/ui/Tooltip.js.map +1 -0
- package/lib/urql-core-KJnLL26g.js.map +1 -1
- package/lib/useExposedProps-ChOIUaS4.js +9 -0
- package/lib/useExposedProps-ChOIUaS4.js.map +1 -0
- package/lib/zudoku.auth-auth0.js +4 -4
- package/lib/zudoku.auth-auth0.js.map +1 -1
- package/lib/zudoku.auth-clerk.js +1 -1
- package/lib/zudoku.auth-openid.js +477 -483
- package/lib/zudoku.auth-openid.js.map +1 -1
- package/lib/zudoku.components.js +920 -2889
- package/lib/zudoku.components.js.map +1 -1
- package/lib/zudoku.openapi-worker.js +2 -2
- package/lib/zudoku.plugin-api-keys.js +69 -76
- package/lib/zudoku.plugin-api-keys.js.map +1 -1
- package/lib/zudoku.plugin-custom-pages.js +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 +8 -9
- 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 +32 -9
- package/src/app/entry.client.tsx +4 -2
- package/src/app/entry.server.tsx +4 -0
- package/src/app/main.css +4 -1
- package/src/app/main.tsx +12 -30
- package/src/app/standalone.tsx +1 -1
- package/src/lib/authentication/components/CallbackHandler.tsx +20 -51
- package/src/lib/authentication/hook.ts +1 -1
- package/src/lib/authentication/providers/auth0.tsx +1 -0
- package/src/lib/components/Header.tsx +17 -2
- package/src/lib/components/MobileTopNavigation.tsx +6 -2
- package/src/lib/components/SlotletProvider.tsx +2 -0
- package/src/lib/components/SyntaxHighlight.tsx +5 -1
- package/src/lib/components/TopNavigation.tsx +70 -23
- package/src/lib/components/context/ZudokuContext.ts +28 -20
- package/src/lib/components/index.ts +13 -4
- package/src/lib/components/navigation/Sidebar.tsx +6 -6
- package/src/lib/components/navigation/SidebarCategory.tsx +35 -29
- package/src/lib/components/navigation/SidebarItem.tsx +17 -20
- package/src/lib/components/navigation/utils.ts +11 -16
- package/src/lib/core/DevPortalContext.ts +3 -2
- package/src/lib/core/plugins.ts +2 -0
- package/src/lib/errors/ErrorAlert.tsx +18 -5
- package/src/lib/plugins/api-keys/CreateApiKey.tsx +2 -2
- package/src/lib/plugins/custom-pages/CustomPage.tsx +2 -2
- package/src/lib/plugins/markdown/MdxPage.tsx +10 -8
- package/src/lib/plugins/markdown/index.tsx +49 -12
- package/src/lib/plugins/markdown/resolver.ts +92 -0
- package/src/lib/plugins/openapi/Endpoint.tsx +2 -2
- package/src/lib/plugins/openapi/RequestBodySidecarBox.tsx +1 -1
- package/src/lib/plugins/openapi/Sidecar.tsx +3 -3
- package/src/lib/plugins/openapi/client/worker.ts +2 -2
- package/src/lib/plugins/openapi/index.tsx +1 -1
- package/src/lib/plugins/openapi/playground/Playground.tsx +4 -3
- package/src/lib/plugins/openapi/playground/PlaygroundDialog.tsx +1 -1
- package/src/lib/plugins/redirect/index.tsx +3 -7
- package/src/lib/ui/Accordion.tsx +56 -0
- package/src/lib/ui/{Note.tsx → Alert.tsx} +11 -10
- package/src/lib/ui/AlertDialog.tsx +139 -0
- package/src/lib/ui/AspectRatio.tsx +5 -0
- package/src/lib/ui/Badge.tsx +36 -0
- package/src/lib/ui/Breadcrumb.tsx +115 -0
- package/src/lib/ui/Button.tsx +1 -1
- package/src/lib/ui/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 +8 -2
- package/src/lib/util/useScrollToAnchor.ts +1 -1
- package/dist/internal.d.ts +0 -1
- package/dist/internal.js +0 -2
- package/dist/internal.js.map +0 -1
- package/dist/lib/components/Dialog.js.map +0 -1
- package/dist/lib/components/Select.js.map +0 -1
- package/dist/lib/plugins/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/ui/Note.d.ts +0 -8
- package/dist/lib/ui/Note.js +0 -23
- package/dist/lib/ui/Note.js.map +0 -1
- package/lib/ErrorPage-B0COs372.js +0 -16
- package/lib/ErrorPage-B0COs372.js.map +0 -1
- package/lib/Input-CHfE_2Qk.js +0 -2229
- package/lib/Input-CHfE_2Qk.js.map +0 -1
- package/lib/Markdown-CWI6lU11.js.map +0 -1
- package/lib/MdxPage-C3tlrV4j.js.map +0 -1
- package/lib/OperationList-BO-ES1C5.js.map +0 -1
- package/lib/SidebarBadge-DmI5hT04.js +0 -503
- package/lib/SidebarBadge-DmI5hT04.js.map +0 -1
- package/lib/SlotletProvider-RvaeLR6z.js +0 -239
- package/lib/SlotletProvider-RvaeLR6z.js.map +0 -1
- package/lib/Spinner-3cQDBVGr.js +0 -7
- package/lib/Spinner-3cQDBVGr.js.map +0 -1
- package/lib/ZudokuContext-BEmsYQoq.js.map +0 -1
- package/lib/index-DJqnphbT.js +0 -35
- package/lib/index-DNfiZTPV.js.map +0 -1
- package/lib/index-Do_BBSIs.js +0 -2867
- package/lib/index-Do_BBSIs.js.map +0 -1
- package/lib/index-Dvh1BL_e.js +0 -124
- package/lib/index-Dvh1BL_e.js.map +0 -1
- package/lib/joinPath-B7kNnUX4.js +0 -8
- package/lib/joinPath-B7kNnUX4.js.map +0 -1
- package/lib/useExposedProps-Csw8oAlt.js +0 -9
- package/lib/useExposedProps-Csw8oAlt.js.map +0 -1
- package/lib/utils-Chi3p5nE.js.map +0 -1
- package/src/lib/plugins/markdown/generateRoutes.tsx +0 -38
- /package/dist/lib/{components → ui}/Dialog.d.ts +0 -0
- /package/dist/lib/{components → ui}/Select.d.ts +0 -0
- /package/dist/lib/{components → ui}/Select.js +0 -0
- /package/src/lib/{components → ui}/Select.tsx +0 -0
|
@@ -1,10 +1,26 @@
|
|
|
1
1
|
import { cx } from "class-variance-authority";
|
|
2
|
-
import {
|
|
2
|
+
import { Suspense } from "react";
|
|
3
|
+
import { Link } from "react-router-dom";
|
|
4
|
+
import { useAuth } from "../authentication/hook.js";
|
|
5
|
+
import { TopNavigationItem } from "../../config/validators/validate.js";
|
|
6
|
+
import { joinPath } from "../util/joinPath.js";
|
|
7
|
+
import { useCurrentNavigation, useZudoku } from "./context/ZudokuContext.js";
|
|
8
|
+
import { traverseSidebar } from "./navigation/utils.js";
|
|
3
9
|
|
|
4
|
-
|
|
10
|
+
export const isHiddenItem =
|
|
11
|
+
(isAuthenticated?: boolean) =>
|
|
12
|
+
(item: { display?: "auth" | "anon" | "always" }) => {
|
|
13
|
+
return (
|
|
14
|
+
(item.display === "auth" && isAuthenticated) ||
|
|
15
|
+
(item.display === "anon" && !isAuthenticated) ||
|
|
16
|
+
!item.display ||
|
|
17
|
+
item.display === "always"
|
|
18
|
+
);
|
|
19
|
+
};
|
|
5
20
|
|
|
6
21
|
export const TopNavigation = () => {
|
|
7
22
|
const { topNavigation } = useZudoku();
|
|
23
|
+
const { isAuthenticated } = useAuth();
|
|
8
24
|
|
|
9
25
|
// Hide top nav if there is only one item
|
|
10
26
|
if (topNavigation.length <= 1) {
|
|
@@ -12,26 +28,57 @@ export const TopNavigation = () => {
|
|
|
12
28
|
}
|
|
13
29
|
|
|
14
30
|
return (
|
|
15
|
-
<
|
|
16
|
-
<
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
31
|
+
<Suspense>
|
|
32
|
+
<nav className="hidden lg:block border-b text-sm px-12 h-[--top-nav-height]">
|
|
33
|
+
<ul className="flex flex-row items-center gap-8">
|
|
34
|
+
{topNavigation.filter(isHiddenItem(isAuthenticated)).map((item) => (
|
|
35
|
+
<li key={item.id}>
|
|
36
|
+
<TopNavItem {...item} />
|
|
37
|
+
</li>
|
|
38
|
+
))}
|
|
39
|
+
</ul>
|
|
40
|
+
</nav>
|
|
41
|
+
</Suspense>
|
|
42
|
+
);
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
const TopNavItem = ({ id, label, default: defaultLink }: TopNavigationItem) => {
|
|
46
|
+
const { sidebars } = useZudoku();
|
|
47
|
+
const nav = useCurrentNavigation();
|
|
48
|
+
const currentSidebar = sidebars[id];
|
|
49
|
+
|
|
50
|
+
// TODO: This is a bit of a hack to get the first link in the sidebar
|
|
51
|
+
// We should really process this when we load the config so we can validate
|
|
52
|
+
// that the sidebar is actually set. In this case we just fall back to linking
|
|
53
|
+
// to the id if we can't resolve a sidebar.
|
|
54
|
+
const first =
|
|
55
|
+
defaultLink ??
|
|
56
|
+
(currentSidebar
|
|
57
|
+
? traverseSidebar(currentSidebar, (item) => {
|
|
58
|
+
if (item.type === "doc") return joinPath(item.id);
|
|
59
|
+
})
|
|
60
|
+
: joinPath(id));
|
|
61
|
+
|
|
62
|
+
if (!first) {
|
|
63
|
+
throw new Error(
|
|
64
|
+
`No links found in top navigation for top navigation '${id}'. Check that the sidebar isn't empty or that a default link set.`,
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// Manually set the active sidebar based on our logic of what is active
|
|
69
|
+
const isActive = nav.data.topNavItem?.id === id;
|
|
70
|
+
|
|
71
|
+
return (
|
|
72
|
+
<Link
|
|
73
|
+
className={cx(
|
|
74
|
+
"block py-3.5 font-medium -mb-px border-b-2",
|
|
75
|
+
isActive
|
|
76
|
+
? "border-primary text-foreground"
|
|
77
|
+
: "border-transparent text-foreground/75 hover:text-foreground hover:border-accent-foreground/25",
|
|
78
|
+
)}
|
|
79
|
+
to={first}
|
|
80
|
+
>
|
|
81
|
+
{label}
|
|
82
|
+
</Link>
|
|
36
83
|
);
|
|
37
84
|
};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { useQuery, useSuspenseQuery } from "@tanstack/react-query";
|
|
2
2
|
import { createContext, useContext } from "react";
|
|
3
|
-
import { useLocation } from "react-router-dom";
|
|
3
|
+
import { matchPath, useLocation } from "react-router-dom";
|
|
4
4
|
import { DevPortalContext } from "../../core/DevPortalContext.js";
|
|
5
|
+
import { joinPath } from "../../util/joinPath.js";
|
|
6
|
+
import { traverseSidebar } from "../navigation/utils.js";
|
|
5
7
|
|
|
6
8
|
export const ZudokuReactContext = createContext<DevPortalContext | undefined>(
|
|
7
9
|
undefined,
|
|
@@ -25,34 +27,40 @@ 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
|
+
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;
|
|
34
42
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
const location = useLocation();
|
|
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
52
|
return useSuspenseQuery({
|
|
46
53
|
queryFn: async () => {
|
|
47
|
-
const pluginSidebar =
|
|
48
|
-
? await getPluginSidebar(path)
|
|
49
|
-
: await getPluginSidebar(location.pathname);
|
|
54
|
+
const pluginSidebar = await getPluginSidebar(location.pathname);
|
|
50
55
|
|
|
51
56
|
return {
|
|
52
|
-
|
|
53
|
-
|
|
57
|
+
sidebar: [
|
|
58
|
+
...(currentSidebarItem ? currentSidebarItem[1] : []),
|
|
59
|
+
...pluginSidebar,
|
|
60
|
+
],
|
|
61
|
+
topNavItem: currentTopNavItem,
|
|
54
62
|
};
|
|
55
63
|
},
|
|
56
|
-
queryKey: ["navigation",
|
|
64
|
+
queryKey: ["navigation", location.pathname],
|
|
57
65
|
});
|
|
58
66
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useMDXComponents as useMDXComponentsImport } from "@mdx-js/react";
|
|
2
2
|
import { Helmet } from "@zudoku/react-helmet-async";
|
|
3
3
|
import { Link as LinkImport } from "react-router-dom";
|
|
4
|
+
import { useAuthState } from "../authentication/state.js";
|
|
4
5
|
import { RouterError as RouterErrorImport } from "../errors/RouterError.js";
|
|
5
6
|
import { ServerError as ServerErrorImport } from "../errors/ServerError.js";
|
|
6
7
|
import { Button as ButtonImport } from "../ui/Button.js";
|
|
@@ -9,17 +10,25 @@ import {
|
|
|
9
10
|
Bootstrap as BootstrapImport,
|
|
10
11
|
BootstrapStatic as BootstrapStaticImport,
|
|
11
12
|
} from "./Bootstrap.js";
|
|
13
|
+
import { ClientOnly as ClientOnlyImport } from "./ClientOnly.js";
|
|
12
14
|
import { DevPortal as DevPortalImport } from "./DevPortal.js";
|
|
13
15
|
import { Layout as LayoutImport } from "./Layout.js";
|
|
14
|
-
|
|
16
|
+
import { useZudoku as useZudokuImport } from "./context/ZudokuContext.js";
|
|
15
17
|
export const useMDXComponents = /*@__PURE__*/ useMDXComponentsImport;
|
|
16
|
-
export const Callout = /*@__PURE__*/ CalloutImport;
|
|
17
18
|
export const DevPortal = /*@__PURE__*/ DevPortalImport;
|
|
18
19
|
export const Layout = /*@__PURE__*/ LayoutImport;
|
|
19
|
-
export const Link: typeof LinkImport = /*@__PURE__*/ LinkImport;
|
|
20
20
|
export const RouterError = /*@__PURE__*/ RouterErrorImport;
|
|
21
21
|
export const ServerError = /*@__PURE__*/ ServerErrorImport;
|
|
22
22
|
export const Bootstrap = /*@__PURE__*/ BootstrapImport;
|
|
23
23
|
export const BootstrapStatic = /*@__PURE__*/ BootstrapStaticImport;
|
|
24
|
-
|
|
24
|
+
|
|
25
25
|
export const Head = /*@__PURE__*/ Helmet;
|
|
26
|
+
|
|
27
|
+
export const useZudoku = /*@__PURE__*/ useZudokuImport;
|
|
28
|
+
export const useAuth = /*@__PURE__*/ useAuthState;
|
|
29
|
+
export const Zudoku = /*@__PURE__*/ DevPortalImport;
|
|
30
|
+
|
|
31
|
+
export const Callout = /*@__PURE__*/ CalloutImport;
|
|
32
|
+
export const ClientOnly = /*@__PURE__*/ ClientOnlyImport;
|
|
33
|
+
export const Button = /*@__PURE__*/ ButtonImport;
|
|
34
|
+
export const Link: typeof LinkImport = /*@__PURE__*/ LinkImport;
|
|
@@ -2,35 +2,35 @@ 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.data.
|
|
18
|
+
pushMainContent={navigation.data.sidebar.length > 0}
|
|
19
19
|
>
|
|
20
20
|
<Slotlet name="zudoku-before-navigation" />
|
|
21
|
-
{navigation.data.
|
|
21
|
+
{navigation.data.sidebar.map((item) => (
|
|
22
22
|
<SidebarItem key={item.label} item={item} />
|
|
23
23
|
))}
|
|
24
24
|
<Slotlet name="zudoku-after-navigation" />
|
|
25
25
|
</SidebarWrapper>
|
|
26
26
|
<DrawerContent
|
|
27
|
-
className="lg:hidden h-screen left-0 p-6 w-[320px] rounded-none"
|
|
27
|
+
className="lg:hidden h-screen left-0 p-6 w-[320px] rounded-none overflow-auto"
|
|
28
28
|
aria-describedby={undefined}
|
|
29
29
|
>
|
|
30
30
|
<VisuallyHidden>
|
|
31
31
|
<DrawerTitle>Sidebar</DrawerTitle>
|
|
32
32
|
</VisuallyHidden>
|
|
33
|
-
{navigation.data.
|
|
33
|
+
{navigation.data.sidebar.map((item) => (
|
|
34
34
|
<SidebarItem key={item.label} item={item} />
|
|
35
35
|
))}
|
|
36
36
|
</DrawerContent>
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import * as Collapsible from "@radix-ui/react-collapsible";
|
|
2
2
|
import { ChevronRightIcon } from "lucide-react";
|
|
3
3
|
import { useEffect, useState } from "react";
|
|
4
|
-
import { NavLink } from "react-router-dom";
|
|
4
|
+
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,6 +24,7 @@ export const SidebarCategory = ({
|
|
|
26
24
|
!isCollapsible || !isCollapsed || isCategoryOpen,
|
|
27
25
|
);
|
|
28
26
|
const [open, setOpen] = useState(isDefaultOpen);
|
|
27
|
+
const isActive = useMatch(category.link?.id ?? "");
|
|
29
28
|
|
|
30
29
|
useEffect(() => {
|
|
31
30
|
// this is triggered when an item from the sidebar is clicked
|
|
@@ -56,46 +55,54 @@ export const SidebarCategory = ({
|
|
|
56
55
|
|
|
57
56
|
return (
|
|
58
57
|
<Collapsible.Root
|
|
59
|
-
className=
|
|
58
|
+
className="flex flex-col"
|
|
60
59
|
defaultOpen={isDefaultOpen}
|
|
61
60
|
open={open}
|
|
62
61
|
onOpenChange={() => setOpen(true)}
|
|
63
62
|
>
|
|
64
63
|
<Collapsible.Trigger className="group" asChild disabled={!isCollapsible}>
|
|
65
64
|
<div
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
65
|
+
onClick={() => setHasInteracted(true)}
|
|
66
|
+
className={navigationListItem({
|
|
67
|
+
isActive: false,
|
|
68
|
+
isTopLevel: level === 0,
|
|
69
|
+
className: [
|
|
70
|
+
"text-start",
|
|
71
|
+
isCollapsible
|
|
72
|
+
? "cursor-pointer"
|
|
73
|
+
: "cursor-default hover:bg-transparent",
|
|
74
|
+
],
|
|
75
|
+
})}
|
|
73
76
|
>
|
|
74
77
|
{category.icon && (
|
|
75
78
|
<category.icon
|
|
76
79
|
size={16}
|
|
77
|
-
className=
|
|
80
|
+
className={cn(
|
|
81
|
+
"align-[-0.125em] -translate-x-1",
|
|
82
|
+
isActive && "text-primary",
|
|
83
|
+
)}
|
|
78
84
|
/>
|
|
79
85
|
)}
|
|
80
86
|
{category.link?.type === "doc" ? (
|
|
81
87
|
<NavLink
|
|
82
|
-
to={joinPath(
|
|
88
|
+
to={joinPath(category.link.id)}
|
|
83
89
|
className="flex-1"
|
|
84
|
-
onClick={() =>
|
|
90
|
+
onClick={() => {
|
|
91
|
+
// if it is the current path and closed then open it because there's no path change to trigger the open
|
|
92
|
+
if (isActive && !open) {
|
|
93
|
+
setOpen(true);
|
|
94
|
+
}
|
|
95
|
+
}}
|
|
85
96
|
>
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
<div className="truncate">{category.label}</div>
|
|
96
|
-
{ToggleButton}
|
|
97
|
-
</div>
|
|
98
|
-
)}
|
|
97
|
+
<div
|
|
98
|
+
className={cn(
|
|
99
|
+
"flex items-center gap-2 justify-between w-full",
|
|
100
|
+
isActive ? "text-primary" : "text-foreground/80",
|
|
101
|
+
)}
|
|
102
|
+
>
|
|
103
|
+
<div className="truncate">{category.label}</div>
|
|
104
|
+
{ToggleButton}
|
|
105
|
+
</div>
|
|
99
106
|
</NavLink>
|
|
100
107
|
) : (
|
|
101
108
|
<div className="flex items-center justify-between w-full">
|
|
@@ -109,10 +116,9 @@ export const SidebarCategory = ({
|
|
|
109
116
|
className={cn(
|
|
110
117
|
// CollapsibleContent class is used to animate and it should only be applied when the user has triggered the toggle
|
|
111
118
|
hasInteracted && "CollapsibleContent",
|
|
112
|
-
"ms-[calc(var(--padding-nav-item)*1.125)]",
|
|
113
119
|
)}
|
|
114
120
|
>
|
|
115
|
-
<ul className="mt-1 border-l
|
|
121
|
+
<ul className="mt-1 border-l ms-0.5">
|
|
116
122
|
{category.items.map((item) => (
|
|
117
123
|
<SidebarItem
|
|
118
124
|
key={
|
|
@@ -3,11 +3,9 @@ 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";
|
|
10
|
-
import { useTopNavigationItem } from "../context/ZudokuContext.js";
|
|
11
9
|
import { SidebarBadge } from "./SidebarBadge.js";
|
|
12
10
|
import { SidebarCategory } from "./SidebarCategory.js";
|
|
13
11
|
|
|
@@ -16,7 +14,8 @@ export const navigationListItem = cva(
|
|
|
16
14
|
{
|
|
17
15
|
variants: {
|
|
18
16
|
isTopLevel: {
|
|
19
|
-
true: "font-
|
|
17
|
+
true: "font-medium -mx-[--padding-nav-item]",
|
|
18
|
+
false: "-mr-[--padding-nav-item] ml-[--padding-nav-item]",
|
|
20
19
|
},
|
|
21
20
|
isActive: {
|
|
22
21
|
true: "text-primary font-medium",
|
|
@@ -27,6 +26,9 @@ export const navigationListItem = cva(
|
|
|
27
26
|
false: "",
|
|
28
27
|
},
|
|
29
28
|
},
|
|
29
|
+
defaultVariants: {
|
|
30
|
+
isActive: false,
|
|
31
|
+
},
|
|
30
32
|
},
|
|
31
33
|
);
|
|
32
34
|
|
|
@@ -40,7 +42,6 @@ export const SidebarItem = ({
|
|
|
40
42
|
basePath?: string;
|
|
41
43
|
level?: number;
|
|
42
44
|
}) => {
|
|
43
|
-
const topNavItem = useTopNavigationItem();
|
|
44
45
|
const { activeAnchor } = useViewportAnchor();
|
|
45
46
|
const [searchParams] = useSearchParams();
|
|
46
47
|
|
|
@@ -53,12 +54,12 @@ export const SidebarItem = ({
|
|
|
53
54
|
className={({ isActive }) =>
|
|
54
55
|
navigationListItem({ isActive, isTopLevel: level === 0 })
|
|
55
56
|
}
|
|
56
|
-
to={joinPath(
|
|
57
|
+
to={joinPath(item.id)}
|
|
57
58
|
>
|
|
58
59
|
{item.icon && <item.icon size={16} className="align-[-0.125em]" />}
|
|
59
60
|
{item.badge ? (
|
|
60
61
|
<>
|
|
61
|
-
<span className="truncate" title={item.label}>
|
|
62
|
+
<span className="truncate flex-1" title={item.label}>
|
|
62
63
|
{item.label}
|
|
63
64
|
</span>
|
|
64
65
|
<SidebarBadge {...item.badge} />
|
|
@@ -73,13 +74,11 @@ export const SidebarItem = ({
|
|
|
73
74
|
<AnchorLink
|
|
74
75
|
to={{ hash: item.href, search: searchParams.toString() }}
|
|
75
76
|
{...{ [DATA_ANCHOR_ATTR]: item.href.slice(1) }}
|
|
76
|
-
className={
|
|
77
|
-
|
|
78
|
-
level === 0
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
}),
|
|
82
|
-
)}
|
|
77
|
+
className={navigationListItem({
|
|
78
|
+
isActive: item.href.slice(1) === activeAnchor,
|
|
79
|
+
isTopLevel: level === 0,
|
|
80
|
+
className: item.badge?.placement !== "start" && "justify-between",
|
|
81
|
+
})}
|
|
83
82
|
>
|
|
84
83
|
{item.badge ? (
|
|
85
84
|
<>
|
|
@@ -94,7 +93,9 @@ export const SidebarItem = ({
|
|
|
94
93
|
</AnchorLink>
|
|
95
94
|
) : !item.href.startsWith("http") ? (
|
|
96
95
|
<NavLink
|
|
97
|
-
className={
|
|
96
|
+
className={navigationListItem({
|
|
97
|
+
className: item.badge?.placement !== "start" && "justify-between",
|
|
98
|
+
})}
|
|
98
99
|
to={item.href}
|
|
99
100
|
>
|
|
100
101
|
{item.badge ? (
|
|
@@ -110,10 +111,7 @@ export const SidebarItem = ({
|
|
|
110
111
|
</NavLink>
|
|
111
112
|
) : (
|
|
112
113
|
<a
|
|
113
|
-
className={
|
|
114
|
-
navigationListItem({ isTopLevel: level === 0 }),
|
|
115
|
-
"block",
|
|
116
|
-
)}
|
|
114
|
+
className={navigationListItem({ isTopLevel: level === 0 })}
|
|
117
115
|
href={item.href}
|
|
118
116
|
target="_blank"
|
|
119
117
|
rel="noopener noreferrer"
|
|
@@ -121,8 +119,7 @@ export const SidebarItem = ({
|
|
|
121
119
|
<span className="whitespace-normal">{item.label}</span>
|
|
122
120
|
{/* This prevents that the icon would be positioned in its own line if the text fills a line entirely */}
|
|
123
121
|
<span className="whitespace-nowrap">
|
|
124
|
-
|
|
125
|
-
<ExternalLinkIcon className="inline ml-1" size={12} />
|
|
122
|
+
<ExternalLinkIcon className="inline -translate-y-0.5" size={12} />
|
|
126
123
|
</span>
|
|
127
124
|
</a>
|
|
128
125
|
);
|
|
@@ -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.data.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.data.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,6 +1,7 @@
|
|
|
1
1
|
import { QueryClient } from "@tanstack/react-query";
|
|
2
2
|
import { ReactNode } from "react";
|
|
3
3
|
import type { SidebarConfig } from "../../config/validators/SidebarSchema.js";
|
|
4
|
+
import { TopNavigationItem } from "../../config/validators/validate.js";
|
|
4
5
|
import { type AuthenticationProvider } from "../authentication/authentication.js";
|
|
5
6
|
import type { ComponentsContextType } from "../components/context/ComponentsContext.js";
|
|
6
7
|
import { Slotlets } from "../components/SlotletProvider.js";
|
|
@@ -60,7 +61,7 @@ export type ZudokuContextOptions = {
|
|
|
60
61
|
metadata?: Metadata;
|
|
61
62
|
page?: Page;
|
|
62
63
|
authentication?: AuthenticationProvider;
|
|
63
|
-
topNavigation?:
|
|
64
|
+
topNavigation?: TopNavigationItem[];
|
|
64
65
|
sidebars?: SidebarConfig;
|
|
65
66
|
plugins?: DevPortalPlugin[];
|
|
66
67
|
slotlets?: Slotlets;
|
|
@@ -72,7 +73,7 @@ export type ZudokuContextOptions = {
|
|
|
72
73
|
|
|
73
74
|
export class DevPortalContext {
|
|
74
75
|
public plugins: NonNullable<ZudokuContextOptions["plugins"]>;
|
|
75
|
-
public sidebars:
|
|
76
|
+
public sidebars: SidebarConfig;
|
|
76
77
|
public topNavigation: NonNullable<ZudokuContextOptions["topNavigation"]>;
|
|
77
78
|
public meta: ZudokuContextOptions["metadata"];
|
|
78
79
|
public page: ZudokuContextOptions["page"];
|
package/src/lib/core/plugins.ts
CHANGED
|
@@ -1,16 +1,29 @@
|
|
|
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
|
+
const hint = error instanceof ZudokuError ? error.developerHint : undefined;
|
|
9
|
+
const title =
|
|
10
|
+
error instanceof ZudokuError ? error.title : "Something went wrong";
|
|
11
|
+
const stack = error instanceof Error ? error.stack : undefined;
|
|
12
|
+
const cause = error instanceof Error ? error.cause : undefined;
|
|
5
13
|
|
|
6
14
|
return (
|
|
7
15
|
<div className="flex h-screen max-h-screen min-h-full items-center justify-center bg-primary-background px-4 py-16 lg:px-8">
|
|
8
16
|
<div className="mx-auto max-w-[85%] sm:max-w-[50%]">
|
|
9
17
|
<h1 className="text-4xl font-bold tracking-tight text-h1-text sm:text-5xl">
|
|
10
|
-
|
|
18
|
+
{title}
|
|
11
19
|
</h1>
|
|
12
20
|
<p className="mt-5 text-h1-text">{message}</p>
|
|
13
|
-
{
|
|
21
|
+
{hint && <DeveloperHint className="mb-4">{hint}</DeveloperHint>}
|
|
22
|
+
{cause instanceof Error ? (
|
|
23
|
+
<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">
|
|
24
|
+
{cause.stack}
|
|
25
|
+
</pre>
|
|
26
|
+
) : stack ? (
|
|
14
27
|
<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
28
|
{stack}
|
|
16
29
|
</pre>
|
|
@@ -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";
|
|
@@ -9,8 +9,8 @@ export const CustomPage = ({
|
|
|
9
9
|
render,
|
|
10
10
|
prose = true,
|
|
11
11
|
}: Omit<CustomPageConfig, "path">) => {
|
|
12
|
-
const
|
|
13
|
-
const content = render ? React.createElement(render,
|
|
12
|
+
const exposedProps = useExposedProps();
|
|
13
|
+
const content = render ? React.createElement(render, exposedProps) : element;
|
|
14
14
|
|
|
15
15
|
return (
|
|
16
16
|
<div className={cn(prose && ProseClasses, "max-w-full")}>{content}</div>
|