zudoku 0.47.1 → 0.48.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app/ZuploBuildConfig.d.ts +11 -121
- package/dist/app/ZuploBuildConfig.js +8 -8
- package/dist/app/ZuploBuildConfig.js.map +1 -1
- package/dist/app/demo.js +4 -3
- package/dist/app/demo.js.map +1 -1
- package/dist/app/entry.client.d.ts +0 -2
- package/dist/app/entry.client.js +0 -2
- package/dist/app/entry.client.js.map +1 -1
- package/dist/app/entry.server.d.ts +0 -2
- package/dist/app/entry.server.js +0 -2
- package/dist/app/entry.server.js.map +1 -1
- package/dist/app/env.d.ts +7 -7
- package/dist/app/env.js +8 -0
- package/dist/app/env.js.map +1 -1
- package/dist/app/main.d.ts +1 -0
- package/dist/app/main.js +6 -5
- package/dist/app/main.js.map +1 -1
- package/dist/app/standalone.js +4 -3
- package/dist/app/standalone.js.map +1 -1
- package/dist/config/loader.js +1 -2
- package/dist/config/loader.js.map +1 -1
- package/dist/config/validators/BuildSchema.d.ts +20 -44
- package/dist/config/validators/BuildSchema.js +3 -14
- package/dist/config/validators/BuildSchema.js.map +1 -1
- package/dist/config/validators/InputNavigationSchema.d.ts +7217 -0
- package/dist/config/validators/InputNavigationSchema.js +74 -0
- package/dist/config/validators/InputNavigationSchema.js.map +1 -0
- package/dist/config/validators/InputNavigationSchema.test-d.d.ts +1 -0
- package/dist/config/validators/InputNavigationSchema.test-d.js +146 -0
- package/dist/config/validators/InputNavigationSchema.test-d.js.map +1 -0
- package/dist/config/validators/NavigationSchema.d.ts +44 -0
- package/dist/config/validators/NavigationSchema.js +95 -0
- package/dist/config/validators/NavigationSchema.js.map +1 -0
- package/dist/config/validators/icon-types.d.ts +2 -1
- package/dist/config/validators/icon-types.js +1775 -1
- package/dist/config/validators/icon-types.js.map +1 -1
- package/dist/config/validators/validate.d.ts +451 -5666
- package/dist/config/validators/validate.js +59 -66
- package/dist/config/validators/validate.js.map +1 -1
- package/dist/config/validators/validate.test.js +0 -2
- package/dist/config/validators/validate.test.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/auth/issuer.js +1 -1
- package/dist/lib/auth/issuer.js.map +1 -1
- package/dist/lib/auth/issuer.test.js +1 -1
- package/dist/lib/auth/issuer.test.js.map +1 -1
- package/dist/lib/authentication/components/CallbackHandler.js +1 -1
- package/dist/lib/authentication/components/CallbackHandler.js.map +1 -1
- package/dist/lib/components/BuildCheck.js +1 -1
- package/dist/lib/components/BuildCheck.js.map +1 -1
- package/dist/lib/components/Framed.d.ts +7 -0
- package/dist/lib/components/Framed.js +26 -0
- package/dist/lib/components/Framed.js.map +1 -0
- package/dist/lib/components/Header.js +10 -9
- package/dist/lib/components/Header.js.map +1 -1
- package/dist/lib/components/Heading.d.ts +6 -2
- package/dist/lib/components/Heading.js +2 -2
- package/dist/lib/components/Heading.js.map +1 -1
- package/dist/lib/components/Main.js +4 -4
- package/dist/lib/components/Main.js.map +1 -1
- package/dist/lib/components/MobileTopNavigation.js +6 -5
- package/dist/lib/components/MobileTopNavigation.js.map +1 -1
- package/dist/lib/components/PageProgress.d.ts +1 -0
- package/dist/lib/components/PageProgress.js +20 -0
- package/dist/lib/components/PageProgress.js.map +1 -0
- package/dist/lib/components/TopNavigation.d.ts +2 -3
- package/dist/lib/components/TopNavigation.js +45 -44
- package/dist/lib/components/TopNavigation.js.map +1 -1
- package/dist/lib/components/context/ZudokuContext.d.ts +3 -7
- package/dist/lib/components/context/ZudokuContext.js +44 -26
- package/dist/lib/components/context/ZudokuContext.js.map +1 -1
- package/dist/lib/components/navigation/Navigation.d.ts +5 -0
- package/dist/lib/components/navigation/Navigation.js +12 -0
- package/dist/lib/components/navigation/Navigation.js.map +1 -0
- package/dist/lib/components/navigation/{SidebarBadge.d.ts → NavigationBadge.d.ts} +1 -1
- package/dist/lib/components/navigation/{SidebarBadge.js → NavigationBadge.js} +2 -2
- package/dist/lib/components/navigation/NavigationBadge.js.map +1 -0
- package/dist/lib/components/navigation/NavigationCategory.d.ts +5 -0
- package/dist/lib/components/navigation/{SidebarCategory.js → NavigationCategory.js} +14 -12
- package/dist/lib/components/navigation/NavigationCategory.js.map +1 -0
- package/dist/lib/components/navigation/NavigationItem.d.ts +6 -0
- package/dist/lib/components/navigation/NavigationItem.js +47 -0
- package/dist/lib/components/navigation/NavigationItem.js.map +1 -0
- package/dist/lib/components/navigation/{SidebarWrapper.d.ts → NavigationWrapper.d.ts} +1 -1
- package/dist/lib/components/navigation/{SidebarWrapper.js → NavigationWrapper.js} +3 -3
- package/dist/lib/components/navigation/NavigationWrapper.js.map +1 -0
- package/dist/lib/components/navigation/utils.d.ts +7 -9
- package/dist/lib/components/navigation/utils.js +17 -17
- package/dist/lib/components/navigation/utils.js.map +1 -1
- package/dist/lib/core/ZudokuContext.d.ts +6 -8
- package/dist/lib/core/ZudokuContext.js +5 -7
- package/dist/lib/core/ZudokuContext.js.map +1 -1
- package/dist/lib/core/plugins.d.ts +2 -2
- package/dist/lib/hooks/useEvent.test.js +5 -3
- package/dist/lib/hooks/useEvent.test.js.map +1 -1
- package/dist/lib/plugins/api-catalog/Catalog.d.ts +1 -1
- package/dist/lib/plugins/api-catalog/index.d.ts +6 -6
- package/dist/lib/plugins/api-catalog/index.js +10 -10
- package/dist/lib/plugins/api-catalog/index.js.map +1 -1
- package/dist/lib/plugins/api-keys/SettingsApiKeys.js +6 -6
- package/dist/lib/plugins/api-keys/SettingsApiKeys.js.map +1 -1
- package/dist/lib/plugins/custom-pages/index.d.ts +3 -2
- package/dist/lib/plugins/custom-pages/index.js +15 -8
- package/dist/lib/plugins/custom-pages/index.js.map +1 -1
- package/dist/lib/plugins/markdown/MdxPage.js +6 -3
- package/dist/lib/plugins/markdown/MdxPage.js.map +1 -1
- package/dist/lib/plugins/markdown/index.d.ts +2 -1
- package/dist/lib/plugins/markdown/index.js +9 -26
- package/dist/lib/plugins/markdown/index.js.map +1 -1
- package/dist/lib/plugins/openapi/OperationList.js +1 -1
- package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
- package/dist/lib/plugins/openapi/OperationListItem.js +1 -1
- package/dist/lib/plugins/openapi/OperationListItem.js.map +1 -1
- package/dist/lib/plugins/openapi/SchemaList.js +1 -1
- package/dist/lib/plugins/openapi/SchemaList.js.map +1 -1
- package/dist/lib/plugins/openapi/graphql/gql.d.ts +1 -1
- package/dist/lib/plugins/openapi/graphql/gql.js +1 -1
- package/dist/lib/plugins/openapi/graphql/gql.js.map +1 -1
- package/dist/lib/plugins/openapi/graphql/graphql.d.ts +3 -3
- package/dist/lib/plugins/openapi/graphql/graphql.js +2 -2
- package/dist/lib/plugins/openapi/graphql/graphql.js.map +1 -1
- package/dist/lib/plugins/openapi/index.d.ts +3 -3
- package/dist/lib/plugins/openapi/index.js +9 -9
- package/dist/lib/plugins/openapi/index.js.map +1 -1
- package/dist/lib/plugins/openapi/interfaces.d.ts +3 -3
- package/dist/lib/plugins/openapi/schema/SchemaView.js +1 -1
- package/dist/lib/plugins/openapi/schema/SchemaView.js.map +1 -1
- package/dist/lib/plugins/openapi/util/createNavigationCategory.d.ts +9 -0
- package/dist/lib/plugins/openapi/util/{createSidebarCategory.js → createNavigationCategory.js} +5 -4
- package/dist/lib/plugins/openapi/util/createNavigationCategory.js.map +1 -0
- package/dist/lib/plugins/openapi/util/getRoutes.js +2 -2
- package/dist/lib/plugins/openapi/util/getRoutes.js.map +1 -1
- package/dist/lib/plugins/openapi/util/methodColorMap.d.ts +1 -1
- package/dist/lib/ui/CodeBlock.js +1 -1
- package/dist/lib/ui/CodeBlock.js.map +1 -1
- package/dist/lib/util/MdxComponents.d.ts +6 -0
- package/dist/lib/util/MdxComponents.js +4 -2
- package/dist/lib/util/MdxComponents.js.map +1 -1
- package/dist/lib/util/useScrollToAnchor.js +3 -3
- package/dist/lib/util/useScrollToAnchor.js.map +1 -1
- package/dist/vite/api/SchemaManager.d.ts +4 -4
- package/dist/vite/api/SchemaManager.js +19 -19
- package/dist/vite/api/SchemaManager.js.map +1 -1
- package/dist/vite/api/SchemaManager.test.js +4 -4
- package/dist/vite/api/SchemaManager.test.js.map +1 -1
- package/dist/vite/config.js +1 -0
- package/dist/vite/config.js.map +1 -1
- package/dist/vite/css/plugin.js +11 -0
- package/dist/vite/css/plugin.js.map +1 -1
- package/dist/vite/plugin-api.js +8 -8
- package/dist/vite/plugin-api.js.map +1 -1
- package/dist/vite/plugin-config-reload.js +2 -0
- package/dist/vite/plugin-config-reload.js.map +1 -1
- package/dist/vite/plugin-custom-pages.js +2 -2
- package/dist/vite/plugin-custom-pages.js.map +1 -1
- package/dist/vite/plugin-docs.js +61 -59
- package/dist/vite/plugin-docs.js.map +1 -1
- package/dist/vite/plugin-mdx.js +4 -2
- package/dist/vite/plugin-mdx.js.map +1 -1
- package/dist/vite/{plugin-sidebar.d.ts → plugin-navigation.d.ts} +1 -1
- package/dist/vite/{plugin-sidebar.js → plugin-navigation.js} +20 -19
- package/dist/vite/plugin-navigation.js.map +1 -0
- package/dist/vite/plugin-theme.d.ts +8 -0
- package/dist/vite/plugin-theme.js +223 -0
- package/dist/vite/plugin-theme.js.map +1 -0
- package/dist/vite/plugin-theme.test.d.ts +1 -0
- package/dist/vite/plugin-theme.test.js +270 -0
- package/dist/vite/plugin-theme.test.js.map +1 -0
- package/dist/vite/plugin.js +4 -6
- package/dist/vite/plugin.js.map +1 -1
- package/dist/vite/shadcn-registry.d.ts +45 -0
- package/dist/vite/shadcn-registry.js +29 -0
- package/dist/vite/shadcn-registry.js.map +1 -0
- package/lib/Drawer-BzkOKwgC.js.map +1 -1
- package/lib/{Markdown-r4buN85T.js → Markdown-DCAIYXF5.js} +885 -840
- package/lib/Markdown-DCAIYXF5.js.map +1 -0
- package/lib/{MdxPage-DYKsTerz.js → MdxPage-Cf9YXWoC.js} +30 -30
- package/lib/MdxPage-Cf9YXWoC.js.map +1 -0
- package/lib/OasProvider-JMVTfG6_.js +35 -0
- package/lib/OasProvider-JMVTfG6_.js.map +1 -0
- package/lib/{OperationList-BCVHtZNK.js → OperationList-m4tFCI4S.js} +8 -8
- package/lib/{OperationList-BCVHtZNK.js.map → OperationList-m4tFCI4S.js.map} +1 -1
- package/lib/{RouteGuard-B7GVW4oL.js → RouteGuard-gV7nvzi7.js} +2 -2
- package/lib/{RouteGuard-B7GVW4oL.js.map → RouteGuard-gV7nvzi7.js.map} +1 -1
- package/lib/{SchemaList-1oJKvBxh.js → SchemaList-_wRy4aQ0.js} +20 -20
- package/lib/SchemaList-_wRy4aQ0.js.map +1 -0
- package/lib/{SchemaView-CTqaB-79.js → SchemaView-CRl_cQYH.js} +13 -13
- package/lib/{SchemaView-CTqaB-79.js.map → SchemaView-CRl_cQYH.js.map} +1 -1
- package/lib/{SignUp-CRIKdWt9.js → SignUp-B6w5AwHM.js} +2 -2
- package/lib/{SignUp-CRIKdWt9.js.map → SignUp-B6w5AwHM.js.map} +1 -1
- package/lib/{Slot-B5qSAnwR.js → Slot-BkYrj_uC.js} +4 -4
- package/lib/{Slot-B5qSAnwR.js.map → Slot-BkYrj_uC.js.map} +1 -1
- package/lib/{SyntaxHighlight-CqKHkyEy.js → SyntaxHighlight-CH9OUJre.js} +2 -2
- package/lib/{SyntaxHighlight-CqKHkyEy.js.map → SyntaxHighlight-CH9OUJre.js.map} +1 -1
- package/lib/{Toc-lxYQEOzX.js → Toc-DRxqEsFc.js} +2 -2
- package/lib/{Toc-lxYQEOzX.js.map → Toc-DRxqEsFc.js.map} +1 -1
- package/lib/{circular-ZGGPtwMq.js → circular-wJaV4vh_.js} +2 -2
- package/lib/{circular-ZGGPtwMq.js.map → circular-wJaV4vh_.js.map} +1 -1
- package/lib/clerk-yAKDC3Qz.js.map +1 -1
- package/lib/{createServer-DUBpXfvA.js → createServer-DN5AJLcN.js} +3 -3
- package/lib/{createServer-DUBpXfvA.js.map → createServer-DN5AJLcN.js.map} +1 -1
- package/lib/{errors-D27ZTQgx.js → errors-D_5vKvUq.js} +10 -10
- package/lib/{errors-D27ZTQgx.js.map → errors-D_5vKvUq.js.map} +1 -1
- package/lib/hook-CHXroBFt.js +1503 -0
- package/lib/hook-CHXroBFt.js.map +1 -0
- package/lib/index-CrcNWbel.js.map +1 -1
- package/lib/{index-Cucjfk3D.js → index-DJVaRmzI.js} +63 -62
- package/lib/index-DJVaRmzI.js.map +1 -0
- package/lib/index-QzXzw_ra.js.map +1 -1
- package/lib/{mutation-C1XCQTQL.js → mutation-BpcyTgWI.js} +2 -2
- package/lib/{mutation-C1XCQTQL.js.map → mutation-BpcyTgWI.js.map} +1 -1
- package/lib/ui/CodeBlock.js +7 -7
- package/lib/ui/CodeBlock.js.map +1 -1
- package/lib/ui/SyntaxHighlight.js +2 -2
- package/lib/{useMutation-BKvPttRn.js → useMutation-N4ockVKi.js} +3 -3
- package/lib/{useMutation-BKvPttRn.js.map → useMutation-N4ockVKi.js.map} +1 -1
- package/lib/zudoku.auth-auth0.js +1 -1
- package/lib/zudoku.auth-azureb2c.js +2 -2
- package/lib/zudoku.auth-clerk.js +2 -2
- package/lib/zudoku.auth-openid.js +2 -2
- package/lib/zudoku.components.js +2756 -3423
- package/lib/zudoku.components.js.map +1 -1
- package/lib/zudoku.hooks.js +2 -2
- package/lib/zudoku.plugin-api-catalog.js +44 -44
- package/lib/zudoku.plugin-api-catalog.js.map +1 -1
- package/lib/zudoku.plugin-api-keys.js +84 -73
- package/lib/zudoku.plugin-api-keys.js.map +1 -1
- package/lib/zudoku.plugin-custom-pages.js +22 -16
- package/lib/zudoku.plugin-custom-pages.js.map +1 -1
- package/lib/zudoku.plugin-markdown.js +20 -69
- package/lib/zudoku.plugin-markdown.js.map +1 -1
- package/lib/zudoku.plugin-openapi.js +5 -5
- package/lib/zudoku.plugin-search-pagefind.js +2 -2
- package/lib/zudoku.plugins.js.map +1 -1
- package/package.json +16 -13
- package/src/app/ZuploBuildConfig.ts +8 -8
- package/src/app/defaultTheme.css +68 -49
- package/src/app/demo.tsx +4 -3
- package/src/app/entry.client.tsx +0 -2
- package/src/app/entry.server.tsx +0 -2
- package/src/app/env.ts +8 -0
- package/src/app/main.css +6 -52
- package/src/app/main.tsx +7 -5
- package/src/app/standalone.tsx +4 -3
- package/src/lib/auth/issuer.test.ts +1 -1
- package/src/lib/auth/issuer.ts +1 -1
- package/src/lib/authentication/components/CallbackHandler.tsx +1 -1
- package/src/lib/components/BuildCheck.tsx +1 -1
- package/src/lib/components/Framed.tsx +51 -0
- package/src/lib/components/Header.tsx +5 -3
- package/src/lib/components/Heading.tsx +7 -3
- package/src/lib/components/Main.tsx +8 -8
- package/src/lib/components/MobileTopNavigation.tsx +16 -11
- package/src/lib/components/PageProgress.tsx +28 -0
- package/src/lib/components/TopNavigation.tsx +57 -66
- package/src/lib/components/context/ZudokuContext.ts +50 -32
- package/src/lib/components/navigation/{Sidebar.tsx → Navigation.tsx} +18 -16
- package/src/lib/components/navigation/{SidebarBadge.tsx → NavigationBadge.tsx} +1 -1
- package/src/lib/components/navigation/{SidebarCategory.tsx → NavigationCategory.tsx} +16 -14
- package/src/lib/components/navigation/{SidebarItem.tsx → NavigationItem.tsx} +23 -17
- package/src/lib/components/navigation/{SidebarWrapper.tsx → NavigationWrapper.tsx} +2 -2
- package/src/lib/components/navigation/utils.ts +27 -28
- package/src/lib/core/ZudokuContext.ts +9 -15
- package/src/lib/core/plugins.ts +2 -2
- package/src/lib/hooks/useEvent.test.tsx +7 -5
- package/src/lib/plugins/api-catalog/Catalog.tsx +1 -1
- package/src/lib/plugins/api-catalog/index.tsx +19 -19
- package/src/lib/plugins/api-keys/SettingsApiKeys.tsx +14 -10
- package/src/lib/plugins/custom-pages/index.tsx +20 -11
- package/src/lib/plugins/markdown/MdxPage.tsx +6 -3
- package/src/lib/plugins/markdown/index.tsx +19 -40
- package/src/lib/plugins/openapi/OperationList.tsx +1 -1
- package/src/lib/plugins/openapi/OperationListItem.tsx +1 -1
- package/src/lib/plugins/openapi/SchemaList.tsx +2 -2
- package/src/lib/plugins/openapi/graphql/gql.ts +5 -5
- package/src/lib/plugins/openapi/graphql/graphql.ts +6 -6
- package/src/lib/plugins/openapi/index.tsx +11 -11
- package/src/lib/plugins/openapi/interfaces.ts +3 -3
- package/src/lib/plugins/openapi/schema/SchemaView.tsx +1 -1
- package/src/lib/plugins/openapi/util/{createSidebarCategory.tsx → createNavigationCategory.tsx} +6 -5
- package/src/lib/plugins/openapi/util/getRoutes.tsx +2 -2
- package/src/lib/plugins/openapi/util/methodColorMap.tsx +1 -1
- package/src/lib/ui/CodeBlock.tsx +1 -1
- package/src/lib/util/MdxComponents.tsx +13 -2
- package/src/lib/util/useScrollToAnchor.ts +3 -3
- package/dist/config/validators/InputSidebarSchema.d.ts +0 -220
- package/dist/config/validators/InputSidebarSchema.js +0 -63
- package/dist/config/validators/InputSidebarSchema.js.map +0 -1
- package/dist/config/validators/SidebarSchema.d.ts +0 -46
- package/dist/config/validators/SidebarSchema.js +0 -118
- package/dist/config/validators/SidebarSchema.js.map +0 -1
- package/dist/lib/components/navigation/Sidebar.d.ts +0 -5
- package/dist/lib/components/navigation/Sidebar.js +0 -10
- package/dist/lib/components/navigation/Sidebar.js.map +0 -1
- package/dist/lib/components/navigation/SidebarBadge.js.map +0 -1
- package/dist/lib/components/navigation/SidebarCategory.d.ts +0 -5
- package/dist/lib/components/navigation/SidebarCategory.js.map +0 -1
- package/dist/lib/components/navigation/SidebarItem.d.ts +0 -6
- package/dist/lib/components/navigation/SidebarItem.js +0 -44
- package/dist/lib/components/navigation/SidebarItem.js.map +0 -1
- package/dist/lib/components/navigation/SidebarWrapper.js.map +0 -1
- package/dist/lib/plugins/markdown/resolver.d.ts +0 -32
- package/dist/lib/plugins/markdown/resolver.js +0 -46
- package/dist/lib/plugins/markdown/resolver.js.map +0 -1
- package/dist/lib/plugins/openapi/util/createSidebarCategory.d.ts +0 -9
- package/dist/lib/plugins/openapi/util/createSidebarCategory.js.map +0 -1
- package/dist/vite/plugin-configure-tailwind.d.ts +0 -2
- package/dist/vite/plugin-configure-tailwind.js +0 -38
- package/dist/vite/plugin-configure-tailwind.js.map +0 -1
- package/dist/vite/plugin-sidebar.js.map +0 -1
- package/dist/vite/plugin-theme-css.d.ts +0 -5
- package/dist/vite/plugin-theme-css.js +0 -77
- package/dist/vite/plugin-theme-css.js.map +0 -1
- package/lib/Markdown-r4buN85T.js.map +0 -1
- package/lib/MdxPage-DYKsTerz.js.map +0 -1
- package/lib/OasProvider-8vNiLpIG.js +0 -33
- package/lib/OasProvider-8vNiLpIG.js.map +0 -1
- package/lib/SchemaList-1oJKvBxh.js.map +0 -1
- package/lib/hook-7wZANGJP.js +0 -1483
- package/lib/hook-7wZANGJP.js.map +0 -1
- package/lib/index-Cucjfk3D.js.map +0 -1
- package/lib/joinPath-B7kNnUX4.js +0 -8
- package/lib/joinPath-B7kNnUX4.js.map +0 -1
- package/src/lib/plugins/markdown/resolver.ts +0 -59
|
@@ -374,12 +374,12 @@ export type GetServerQueryQuery = {
|
|
|
374
374
|
};
|
|
375
375
|
};
|
|
376
376
|
|
|
377
|
-
export type
|
|
377
|
+
export type GetNavigationOperationsQueryVariables = Exact<{
|
|
378
378
|
input: Scalars["JSON"]["input"];
|
|
379
379
|
type: SchemaType;
|
|
380
380
|
}>;
|
|
381
381
|
|
|
382
|
-
export type
|
|
382
|
+
export type GetNavigationOperationsQuery = {
|
|
383
383
|
__typename?: "Query";
|
|
384
384
|
schema: {
|
|
385
385
|
__typename?: "Schema";
|
|
@@ -642,8 +642,8 @@ export const GetServerQueryDocument = new TypedDocumentString(`
|
|
|
642
642
|
GetServerQueryQuery,
|
|
643
643
|
GetServerQueryQueryVariables
|
|
644
644
|
>;
|
|
645
|
-
export const
|
|
646
|
-
query
|
|
645
|
+
export const GetNavigationOperationsDocument = new TypedDocumentString(`
|
|
646
|
+
query GetNavigationOperations($input: JSON!, $type: SchemaType!) {
|
|
647
647
|
schema(input: $input, type: $type) {
|
|
648
648
|
tags {
|
|
649
649
|
slug
|
|
@@ -665,6 +665,6 @@ export const GetSidebarOperationsDocument = new TypedDocumentString(`
|
|
|
665
665
|
}
|
|
666
666
|
}
|
|
667
667
|
`) as unknown as TypedDocumentString<
|
|
668
|
-
|
|
669
|
-
|
|
668
|
+
GetNavigationOperationsQuery,
|
|
669
|
+
GetNavigationOperationsQueryVariables
|
|
670
670
|
>;
|
|
@@ -7,16 +7,16 @@ import { Button } from "../../ui/Button.js";
|
|
|
7
7
|
import { joinUrl } from "../../util/joinUrl.js";
|
|
8
8
|
import { GraphQLClient } from "./client/GraphQLClient.js";
|
|
9
9
|
import { createQuery } from "./client/useCreateQuery.js";
|
|
10
|
-
import type {
|
|
10
|
+
import type { GetNavigationOperationsQuery as GetNavigationOperationsQueryResult } from "./graphql/graphql.js";
|
|
11
11
|
import { graphql } from "./graphql/index.js";
|
|
12
12
|
import { type OasPluginConfig } from "./interfaces.js";
|
|
13
13
|
import type { PlaygroundContentProps } from "./playground/Playground.js";
|
|
14
14
|
import { PlaygroundDialog } from "./playground/PlaygroundDialog.js";
|
|
15
|
-
import {
|
|
15
|
+
import { createNavigationCategory } from "./util/createNavigationCategory.js";
|
|
16
16
|
import { getRoutes, getVersions } from "./util/getRoutes.js";
|
|
17
17
|
|
|
18
|
-
export const
|
|
19
|
-
query
|
|
18
|
+
export const GetNavigationOperationsQuery = graphql(`
|
|
19
|
+
query GetNavigationOperations($input: JSON!, $type: SchemaType!) {
|
|
20
20
|
schema(input: $input, type: $type) {
|
|
21
21
|
tags {
|
|
22
22
|
slug
|
|
@@ -40,14 +40,14 @@ export const GetSidebarOperationsQuery = graphql(`
|
|
|
40
40
|
`);
|
|
41
41
|
|
|
42
42
|
export type OperationResult =
|
|
43
|
-
|
|
43
|
+
GetNavigationOperationsQueryResult["schema"]["tags"][number]["operations"][number];
|
|
44
44
|
|
|
45
45
|
export type OpenApiPluginOptions = OasPluginConfig;
|
|
46
46
|
|
|
47
47
|
export const UNTAGGED_PATH = "~endpoints";
|
|
48
48
|
|
|
49
49
|
export const openApiPlugin = (config: OasPluginConfig): ZudokuPlugin => {
|
|
50
|
-
const basePath = joinUrl(config.
|
|
50
|
+
const basePath = joinUrl(config.path);
|
|
51
51
|
const client = new GraphQLClient(config);
|
|
52
52
|
|
|
53
53
|
return {
|
|
@@ -117,7 +117,7 @@ export const openApiPlugin = (config: OasPluginConfig): ZudokuPlugin => {
|
|
|
117
117
|
);
|
|
118
118
|
},
|
|
119
119
|
}),
|
|
120
|
-
|
|
120
|
+
getNavigation: async (path, context) => {
|
|
121
121
|
if (!matchPath({ path: basePath, end: false }, path)) {
|
|
122
122
|
return [];
|
|
123
123
|
}
|
|
@@ -133,7 +133,7 @@ export const openApiPlugin = (config: OasPluginConfig): ZudokuPlugin => {
|
|
|
133
133
|
const { type } = config;
|
|
134
134
|
const input = type === "file" ? config.input[version!] : config.input;
|
|
135
135
|
|
|
136
|
-
const query = createQuery(client,
|
|
136
|
+
const query = createQuery(client, GetNavigationOperationsQuery, {
|
|
137
137
|
type,
|
|
138
138
|
input,
|
|
139
139
|
});
|
|
@@ -150,7 +150,7 @@ export const openApiPlugin = (config: OasPluginConfig): ZudokuPlugin => {
|
|
|
150
150
|
const isCollapsible =
|
|
151
151
|
tag.extensions?.["x-zudoku-collapsible"] ?? true;
|
|
152
152
|
|
|
153
|
-
return
|
|
153
|
+
return createNavigationCategory({
|
|
154
154
|
label: tag.name,
|
|
155
155
|
path: categoryPath,
|
|
156
156
|
operations: tag.operations,
|
|
@@ -165,7 +165,7 @@ export const openApiPlugin = (config: OasPluginConfig): ZudokuPlugin => {
|
|
|
165
165
|
|
|
166
166
|
if (untaggedOperations) {
|
|
167
167
|
categories.push(
|
|
168
|
-
|
|
168
|
+
createNavigationCategory({
|
|
169
169
|
label: "Other endpoints",
|
|
170
170
|
path: joinUrl(basePath, versionParam, UNTAGGED_PATH),
|
|
171
171
|
operations: untaggedOperations,
|
|
@@ -178,7 +178,7 @@ export const openApiPlugin = (config: OasPluginConfig): ZudokuPlugin => {
|
|
|
178
178
|
categories.push({
|
|
179
179
|
type: "link" as const,
|
|
180
180
|
label: "Schemas",
|
|
181
|
-
|
|
181
|
+
to: joinUrl(basePath, versionParam, "~schemas"),
|
|
182
182
|
});
|
|
183
183
|
}
|
|
184
184
|
|
|
@@ -32,7 +32,7 @@ type Content = {
|
|
|
32
32
|
examples?: Array<Example> | null;
|
|
33
33
|
};
|
|
34
34
|
|
|
35
|
-
export type
|
|
35
|
+
export type TransformExamplesFn = (options: {
|
|
36
36
|
content: Content[];
|
|
37
37
|
context: ZudokuContext;
|
|
38
38
|
auth: AuthState;
|
|
@@ -42,7 +42,7 @@ export type transformExamples = (options: {
|
|
|
42
42
|
|
|
43
43
|
type BaseOasConfig = {
|
|
44
44
|
server?: string;
|
|
45
|
-
|
|
45
|
+
path?: string;
|
|
46
46
|
skipPreload?: boolean;
|
|
47
47
|
tagPages?: Array<string>;
|
|
48
48
|
schemaImports?: SchemaImports;
|
|
@@ -52,7 +52,7 @@ type BaseOasConfig = {
|
|
|
52
52
|
disableSidecar?: boolean;
|
|
53
53
|
showVersionSelect?: "always" | "if-available" | "hide";
|
|
54
54
|
expandAllTags?: boolean;
|
|
55
|
-
transformExamples?:
|
|
55
|
+
transformExamples?: TransformExamplesFn;
|
|
56
56
|
};
|
|
57
57
|
};
|
|
58
58
|
|
package/src/lib/plugins/openapi/util/{createSidebarCategory.tsx → createNavigationCategory.tsx}
RENAMED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { NavigationItem } from "../../../../config/validators/NavigationSchema.js";
|
|
2
2
|
import type { OperationResult } from "../index.js";
|
|
3
3
|
import { MethodColorMap } from "./methodColorMap.js";
|
|
4
4
|
|
|
5
|
-
export const
|
|
5
|
+
export const createNavigationCategory = ({
|
|
6
6
|
label,
|
|
7
7
|
path,
|
|
8
8
|
operations,
|
|
@@ -14,12 +14,13 @@ export const createSidebarCategory = ({
|
|
|
14
14
|
operations: OperationResult[];
|
|
15
15
|
collapsible?: boolean;
|
|
16
16
|
collapsed?: boolean;
|
|
17
|
-
}):
|
|
17
|
+
}): NavigationItem => ({
|
|
18
18
|
type: "category",
|
|
19
19
|
label,
|
|
20
20
|
link: {
|
|
21
21
|
type: "doc" as const,
|
|
22
|
-
|
|
22
|
+
path,
|
|
23
|
+
file: path,
|
|
23
24
|
label,
|
|
24
25
|
},
|
|
25
26
|
collapsible,
|
|
@@ -27,7 +28,7 @@ export const createSidebarCategory = ({
|
|
|
27
28
|
items: operations.map((operation) => ({
|
|
28
29
|
type: "link" as const,
|
|
29
30
|
label: operation.summary ?? operation.path,
|
|
30
|
-
|
|
31
|
+
to: `${path}#${operation.slug}`,
|
|
31
32
|
badge: {
|
|
32
33
|
label: operation.method,
|
|
33
34
|
color: MethodColorMap[operation.method.toLowerCase()]!,
|
|
@@ -12,7 +12,7 @@ import type { GraphQLClient } from "../client/GraphQLClient.js";
|
|
|
12
12
|
import { useCreateQuery } from "../client/useCreateQuery.js";
|
|
13
13
|
import { useOasConfig } from "../context.js";
|
|
14
14
|
import {
|
|
15
|
-
|
|
15
|
+
GetNavigationOperationsQuery,
|
|
16
16
|
type OpenApiPluginOptions,
|
|
17
17
|
UNTAGGED_PATH,
|
|
18
18
|
} from "../index.js";
|
|
@@ -71,7 +71,7 @@ const NonTagPagesOperationList = ({
|
|
|
71
71
|
const { type, input } = useOasConfig();
|
|
72
72
|
const { tag: currentTag } = useParams();
|
|
73
73
|
const location = useLocation();
|
|
74
|
-
const query = useCreateQuery(
|
|
74
|
+
const query = useCreateQuery(GetNavigationOperationsQuery, { type, input });
|
|
75
75
|
const {
|
|
76
76
|
data: { schema },
|
|
77
77
|
} = useSuspenseQuery(query);
|
package/src/lib/ui/CodeBlock.tsx
CHANGED
|
@@ -71,7 +71,7 @@ export const CodeBlock = ({
|
|
|
71
71
|
aria-label="Copy code"
|
|
72
72
|
title="Copy code"
|
|
73
73
|
className={cn(
|
|
74
|
-
"absolute top-2 end-2 p-2 hover:
|
|
74
|
+
"absolute top-2 end-2 p-2 transition hover:shadow-xs active:shadow-none active:inset-shadow-xs hover:outline outline-border rounded-md text-sm text-muted-foreground",
|
|
75
75
|
title && "top-10",
|
|
76
76
|
showCopy === "hover" && "opacity-0 group-hover:opacity-100",
|
|
77
77
|
showCopyText && "flex gap-2 items-center font-medium",
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type MDXComponents } from "mdx/types.js";
|
|
2
2
|
import { CodeBlock } from "zudoku/ui/CodeBlock.js";
|
|
3
3
|
import { AnchorLink } from "../components/AnchorLink.js";
|
|
4
|
+
import { Framed } from "../components/Framed.js";
|
|
4
5
|
import { Heading } from "../components/Heading.js";
|
|
5
6
|
import { InlineCode } from "../components/InlineCode.js";
|
|
6
7
|
import { Button } from "../ui/Button.js";
|
|
@@ -14,10 +15,20 @@ export type MdxComponentsType = Readonly<MDXComponents> | null | undefined;
|
|
|
14
15
|
export const MdxComponents = {
|
|
15
16
|
img: ({ node, ...props }) => {
|
|
16
17
|
if (/\.(mp4|webm|mov|avi)$/.test(props.src ?? "")) {
|
|
17
|
-
return
|
|
18
|
+
return (
|
|
19
|
+
<video
|
|
20
|
+
src={props.src}
|
|
21
|
+
controls
|
|
22
|
+
playsInline
|
|
23
|
+
autoPlay
|
|
24
|
+
loop
|
|
25
|
+
className={cn("rounded-lg", props.className)}
|
|
26
|
+
/>
|
|
27
|
+
);
|
|
18
28
|
}
|
|
19
|
-
return <img {...props} className={cn("rounded-
|
|
29
|
+
return <img {...props} className={cn("rounded-lg", props.className)} />;
|
|
20
30
|
},
|
|
31
|
+
Framed,
|
|
21
32
|
h1: ({ children, id }) => (
|
|
22
33
|
<Heading level={1} id={id}>
|
|
23
34
|
{children}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useCallback, useEffect, useRef } from "react";
|
|
2
2
|
import { useLocation } from "react-router";
|
|
3
3
|
import { useViewportAnchor } from "../components/context/ViewportAnchorContext.js";
|
|
4
|
-
import { DATA_ANCHOR_ATTR } from "../components/navigation/
|
|
4
|
+
import { DATA_ANCHOR_ATTR } from "../components/navigation/NavigationItem.js";
|
|
5
5
|
import { scrollIntoViewIfNeeded } from "./scrollIntoViewIfNeeded.js";
|
|
6
6
|
|
|
7
7
|
export const useScrollToHash = () => {
|
|
@@ -11,8 +11,8 @@ export const useScrollToHash = () => {
|
|
|
11
11
|
(hash: string) => {
|
|
12
12
|
const cleanHash = hash.replace(/^#/, "");
|
|
13
13
|
|
|
14
|
-
// Operation list items might have subdivisions that the
|
|
15
|
-
// The subdivisions are separated by a slash so we need to remove everything before the slash to get the
|
|
14
|
+
// Operation list items might have subdivisions that the navigation doesn't show.
|
|
15
|
+
// The subdivisions are separated by a slash so we need to remove everything before the slash to get the navigation correct item.
|
|
16
16
|
const linkHash = cleanHash.split("/").at(0)!;
|
|
17
17
|
const element = document.getElementById(decodeURIComponent(cleanHash));
|
|
18
18
|
|
|
@@ -1,220 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { type IconNames } from "./icon-types.js";
|
|
3
|
-
export declare const BaseInputSidebarItemCategoryLinkDocSchema: z.ZodObject<{
|
|
4
|
-
type: z.ZodLiteral<"doc">;
|
|
5
|
-
id: z.ZodString;
|
|
6
|
-
label: z.ZodOptional<z.ZodString>;
|
|
7
|
-
}, "strip", z.ZodTypeAny, {
|
|
8
|
-
type: "doc";
|
|
9
|
-
id: string;
|
|
10
|
-
label?: string | undefined;
|
|
11
|
-
}, {
|
|
12
|
-
type: "doc";
|
|
13
|
-
id: string;
|
|
14
|
-
label?: string | undefined;
|
|
15
|
-
}>;
|
|
16
|
-
export type BaseInputSidebarItemCategoryLinkDoc = z.infer<typeof BaseInputSidebarItemCategoryLinkDocSchema>;
|
|
17
|
-
export declare const InputSidebarItemCategoryLinkDocSchema: z.ZodUnion<[z.ZodObject<{
|
|
18
|
-
type: z.ZodLiteral<"doc">;
|
|
19
|
-
id: z.ZodString;
|
|
20
|
-
label: z.ZodOptional<z.ZodString>;
|
|
21
|
-
}, "strip", z.ZodTypeAny, {
|
|
22
|
-
type: "doc";
|
|
23
|
-
id: string;
|
|
24
|
-
label?: string | undefined;
|
|
25
|
-
}, {
|
|
26
|
-
type: "doc";
|
|
27
|
-
id: string;
|
|
28
|
-
label?: string | undefined;
|
|
29
|
-
}>, z.ZodString]>;
|
|
30
|
-
export declare const BaseInputSidebarItemDocSchema: z.ZodObject<{
|
|
31
|
-
type: z.ZodLiteral<"doc">;
|
|
32
|
-
id: z.ZodString;
|
|
33
|
-
icon: z.ZodOptional<z.ZodType<IconNames, z.ZodTypeDef, IconNames>>;
|
|
34
|
-
label: z.ZodOptional<z.ZodString>;
|
|
35
|
-
badge: z.ZodOptional<z.ZodObject<{
|
|
36
|
-
label: z.ZodString;
|
|
37
|
-
color: z.ZodEnum<["green", "blue", "yellow", "red", "purple", "indigo", "gray", "outline"]>;
|
|
38
|
-
placement: z.ZodOptional<z.ZodEnum<["start", "end"]>>;
|
|
39
|
-
invert: z.ZodOptional<z.ZodBoolean>;
|
|
40
|
-
}, "strip", z.ZodTypeAny, {
|
|
41
|
-
label: string;
|
|
42
|
-
color: "green" | "blue" | "yellow" | "red" | "purple" | "indigo" | "gray" | "outline";
|
|
43
|
-
placement?: "start" | "end" | undefined;
|
|
44
|
-
invert?: boolean | undefined;
|
|
45
|
-
}, {
|
|
46
|
-
label: string;
|
|
47
|
-
color: "green" | "blue" | "yellow" | "red" | "purple" | "indigo" | "gray" | "outline";
|
|
48
|
-
placement?: "start" | "end" | undefined;
|
|
49
|
-
invert?: boolean | undefined;
|
|
50
|
-
}>>;
|
|
51
|
-
}, "strip", z.ZodTypeAny, {
|
|
52
|
-
type: "doc";
|
|
53
|
-
id: string;
|
|
54
|
-
badge?: {
|
|
55
|
-
label: string;
|
|
56
|
-
color: "green" | "blue" | "yellow" | "red" | "purple" | "indigo" | "gray" | "outline";
|
|
57
|
-
placement?: "start" | "end" | undefined;
|
|
58
|
-
invert?: boolean | undefined;
|
|
59
|
-
} | undefined;
|
|
60
|
-
label?: string | undefined;
|
|
61
|
-
icon?: IconNames | undefined;
|
|
62
|
-
}, {
|
|
63
|
-
type: "doc";
|
|
64
|
-
id: string;
|
|
65
|
-
badge?: {
|
|
66
|
-
label: string;
|
|
67
|
-
color: "green" | "blue" | "yellow" | "red" | "purple" | "indigo" | "gray" | "outline";
|
|
68
|
-
placement?: "start" | "end" | undefined;
|
|
69
|
-
invert?: boolean | undefined;
|
|
70
|
-
} | undefined;
|
|
71
|
-
label?: string | undefined;
|
|
72
|
-
icon?: IconNames | undefined;
|
|
73
|
-
}>;
|
|
74
|
-
export type BaseInputSidebarItemDoc = z.infer<typeof BaseInputSidebarItemDocSchema>;
|
|
75
|
-
export declare const InputSidebarItemDocSchema: z.ZodUnion<[z.ZodObject<{
|
|
76
|
-
type: z.ZodLiteral<"doc">;
|
|
77
|
-
id: z.ZodString;
|
|
78
|
-
icon: z.ZodOptional<z.ZodType<IconNames, z.ZodTypeDef, IconNames>>;
|
|
79
|
-
label: z.ZodOptional<z.ZodString>;
|
|
80
|
-
badge: z.ZodOptional<z.ZodObject<{
|
|
81
|
-
label: z.ZodString;
|
|
82
|
-
color: z.ZodEnum<["green", "blue", "yellow", "red", "purple", "indigo", "gray", "outline"]>;
|
|
83
|
-
placement: z.ZodOptional<z.ZodEnum<["start", "end"]>>;
|
|
84
|
-
invert: z.ZodOptional<z.ZodBoolean>;
|
|
85
|
-
}, "strip", z.ZodTypeAny, {
|
|
86
|
-
label: string;
|
|
87
|
-
color: "green" | "blue" | "yellow" | "red" | "purple" | "indigo" | "gray" | "outline";
|
|
88
|
-
placement?: "start" | "end" | undefined;
|
|
89
|
-
invert?: boolean | undefined;
|
|
90
|
-
}, {
|
|
91
|
-
label: string;
|
|
92
|
-
color: "green" | "blue" | "yellow" | "red" | "purple" | "indigo" | "gray" | "outline";
|
|
93
|
-
placement?: "start" | "end" | undefined;
|
|
94
|
-
invert?: boolean | undefined;
|
|
95
|
-
}>>;
|
|
96
|
-
}, "strip", z.ZodTypeAny, {
|
|
97
|
-
type: "doc";
|
|
98
|
-
id: string;
|
|
99
|
-
badge?: {
|
|
100
|
-
label: string;
|
|
101
|
-
color: "green" | "blue" | "yellow" | "red" | "purple" | "indigo" | "gray" | "outline";
|
|
102
|
-
placement?: "start" | "end" | undefined;
|
|
103
|
-
invert?: boolean | undefined;
|
|
104
|
-
} | undefined;
|
|
105
|
-
label?: string | undefined;
|
|
106
|
-
icon?: IconNames | undefined;
|
|
107
|
-
}, {
|
|
108
|
-
type: "doc";
|
|
109
|
-
id: string;
|
|
110
|
-
badge?: {
|
|
111
|
-
label: string;
|
|
112
|
-
color: "green" | "blue" | "yellow" | "red" | "purple" | "indigo" | "gray" | "outline";
|
|
113
|
-
placement?: "start" | "end" | undefined;
|
|
114
|
-
invert?: boolean | undefined;
|
|
115
|
-
} | undefined;
|
|
116
|
-
label?: string | undefined;
|
|
117
|
-
icon?: IconNames | undefined;
|
|
118
|
-
}>, z.ZodString]>;
|
|
119
|
-
export declare const InputSidebarItemLinkSchema: z.ZodObject<{
|
|
120
|
-
type: z.ZodLiteral<"link">;
|
|
121
|
-
icon: z.ZodOptional<z.ZodType<IconNames, z.ZodTypeDef, IconNames>>;
|
|
122
|
-
label: z.ZodString;
|
|
123
|
-
href: z.ZodString;
|
|
124
|
-
description: z.ZodOptional<z.ZodString>;
|
|
125
|
-
badge: z.ZodOptional<z.ZodObject<{
|
|
126
|
-
label: z.ZodString;
|
|
127
|
-
color: z.ZodEnum<["green", "blue", "yellow", "red", "purple", "indigo", "gray", "outline"]>;
|
|
128
|
-
placement: z.ZodOptional<z.ZodEnum<["start", "end"]>>;
|
|
129
|
-
invert: z.ZodOptional<z.ZodBoolean>;
|
|
130
|
-
}, "strip", z.ZodTypeAny, {
|
|
131
|
-
label: string;
|
|
132
|
-
color: "green" | "blue" | "yellow" | "red" | "purple" | "indigo" | "gray" | "outline";
|
|
133
|
-
placement?: "start" | "end" | undefined;
|
|
134
|
-
invert?: boolean | undefined;
|
|
135
|
-
}, {
|
|
136
|
-
label: string;
|
|
137
|
-
color: "green" | "blue" | "yellow" | "red" | "purple" | "indigo" | "gray" | "outline";
|
|
138
|
-
placement?: "start" | "end" | undefined;
|
|
139
|
-
invert?: boolean | undefined;
|
|
140
|
-
}>>;
|
|
141
|
-
}, "strip", z.ZodTypeAny, {
|
|
142
|
-
type: "link";
|
|
143
|
-
label: string;
|
|
144
|
-
href: string;
|
|
145
|
-
description?: string | undefined;
|
|
146
|
-
badge?: {
|
|
147
|
-
label: string;
|
|
148
|
-
color: "green" | "blue" | "yellow" | "red" | "purple" | "indigo" | "gray" | "outline";
|
|
149
|
-
placement?: "start" | "end" | undefined;
|
|
150
|
-
invert?: boolean | undefined;
|
|
151
|
-
} | undefined;
|
|
152
|
-
icon?: IconNames | undefined;
|
|
153
|
-
}, {
|
|
154
|
-
type: "link";
|
|
155
|
-
label: string;
|
|
156
|
-
href: string;
|
|
157
|
-
description?: string | undefined;
|
|
158
|
-
badge?: {
|
|
159
|
-
label: string;
|
|
160
|
-
color: "green" | "blue" | "yellow" | "red" | "purple" | "indigo" | "gray" | "outline";
|
|
161
|
-
placement?: "start" | "end" | undefined;
|
|
162
|
-
invert?: boolean | undefined;
|
|
163
|
-
} | undefined;
|
|
164
|
-
icon?: IconNames | undefined;
|
|
165
|
-
}>;
|
|
166
|
-
export type InputSidebarItemLink = z.infer<typeof InputSidebarItemLinkSchema>;
|
|
167
|
-
export declare const BaseInputSidebarItemCategorySchema: z.ZodObject<{
|
|
168
|
-
type: z.ZodLiteral<"category">;
|
|
169
|
-
icon: z.ZodOptional<z.ZodType<IconNames, z.ZodTypeDef, IconNames>>;
|
|
170
|
-
label: z.ZodString;
|
|
171
|
-
description: z.ZodOptional<z.ZodString>;
|
|
172
|
-
collapsible: z.ZodOptional<z.ZodBoolean>;
|
|
173
|
-
collapsed: z.ZodOptional<z.ZodBoolean>;
|
|
174
|
-
link: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
175
|
-
type: z.ZodLiteral<"doc">;
|
|
176
|
-
id: z.ZodString;
|
|
177
|
-
label: z.ZodOptional<z.ZodString>;
|
|
178
|
-
}, "strip", z.ZodTypeAny, {
|
|
179
|
-
type: "doc";
|
|
180
|
-
id: string;
|
|
181
|
-
label?: string | undefined;
|
|
182
|
-
}, {
|
|
183
|
-
type: "doc";
|
|
184
|
-
id: string;
|
|
185
|
-
label?: string | undefined;
|
|
186
|
-
}>, z.ZodString]>>;
|
|
187
|
-
}, "strip", z.ZodTypeAny, {
|
|
188
|
-
type: "category";
|
|
189
|
-
label: string;
|
|
190
|
-
link?: string | {
|
|
191
|
-
type: "doc";
|
|
192
|
-
id: string;
|
|
193
|
-
label?: string | undefined;
|
|
194
|
-
} | undefined;
|
|
195
|
-
description?: string | undefined;
|
|
196
|
-
icon?: IconNames | undefined;
|
|
197
|
-
collapsible?: boolean | undefined;
|
|
198
|
-
collapsed?: boolean | undefined;
|
|
199
|
-
}, {
|
|
200
|
-
type: "category";
|
|
201
|
-
label: string;
|
|
202
|
-
link?: string | {
|
|
203
|
-
type: "doc";
|
|
204
|
-
id: string;
|
|
205
|
-
label?: string | undefined;
|
|
206
|
-
} | undefined;
|
|
207
|
-
description?: string | undefined;
|
|
208
|
-
icon?: IconNames | undefined;
|
|
209
|
-
collapsible?: boolean | undefined;
|
|
210
|
-
collapsed?: boolean | undefined;
|
|
211
|
-
}>;
|
|
212
|
-
export type InputSidebarItem = z.infer<typeof InputSidebarItemDocSchema> | z.infer<typeof InputSidebarItemLinkSchema> | z.infer<typeof InputSidebarItemCategorySchema>;
|
|
213
|
-
export declare const InputSidebarItemSchema: z.ZodType<InputSidebarItem>;
|
|
214
|
-
export type InputSidebarItemCategory = z.infer<typeof BaseInputSidebarItemCategorySchema> & {
|
|
215
|
-
items: InputSidebarItem[];
|
|
216
|
-
};
|
|
217
|
-
export declare const InputSidebarItemCategorySchema: z.ZodType<InputSidebarItemCategory>;
|
|
218
|
-
export declare const InputSidebarSchema: z.ZodArray<z.ZodType<InputSidebarItem, z.ZodTypeDef, InputSidebarItem>, "many">;
|
|
219
|
-
export type SidebarEntry = z.infer<typeof InputSidebarSchema>;
|
|
220
|
-
export type SidebarConfig = Record<string, SidebarEntry>;
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
const BadgeSchema = z.object({
|
|
3
|
-
label: z.string(),
|
|
4
|
-
color: z.enum([
|
|
5
|
-
"green",
|
|
6
|
-
"blue",
|
|
7
|
-
"yellow",
|
|
8
|
-
"red",
|
|
9
|
-
"purple",
|
|
10
|
-
"indigo",
|
|
11
|
-
"gray",
|
|
12
|
-
"outline",
|
|
13
|
-
]),
|
|
14
|
-
placement: z.enum(["start", "end"]).optional(),
|
|
15
|
-
invert: z.boolean().optional(),
|
|
16
|
-
});
|
|
17
|
-
export const BaseInputSidebarItemCategoryLinkDocSchema = z.object({
|
|
18
|
-
type: z.literal("doc"),
|
|
19
|
-
id: z.string(),
|
|
20
|
-
label: z.string().optional(),
|
|
21
|
-
});
|
|
22
|
-
export const InputSidebarItemCategoryLinkDocSchema = z.union([
|
|
23
|
-
BaseInputSidebarItemCategoryLinkDocSchema,
|
|
24
|
-
z.string(),
|
|
25
|
-
]);
|
|
26
|
-
export const BaseInputSidebarItemDocSchema = z.object({
|
|
27
|
-
type: z.literal("doc"),
|
|
28
|
-
id: z.string(),
|
|
29
|
-
icon: z.custom().optional(),
|
|
30
|
-
label: z.string().optional(),
|
|
31
|
-
badge: BadgeSchema.optional(),
|
|
32
|
-
});
|
|
33
|
-
export const InputSidebarItemDocSchema = z.union([
|
|
34
|
-
BaseInputSidebarItemDocSchema,
|
|
35
|
-
z.string(),
|
|
36
|
-
]);
|
|
37
|
-
export const InputSidebarItemLinkSchema = z.object({
|
|
38
|
-
type: z.literal("link"),
|
|
39
|
-
icon: z.custom().optional(),
|
|
40
|
-
label: z.string(),
|
|
41
|
-
href: z.string(),
|
|
42
|
-
description: z.string().optional(),
|
|
43
|
-
badge: BadgeSchema.optional(),
|
|
44
|
-
});
|
|
45
|
-
export const BaseInputSidebarItemCategorySchema = z.object({
|
|
46
|
-
type: z.literal("category"),
|
|
47
|
-
icon: z.custom().optional(),
|
|
48
|
-
label: z.string(),
|
|
49
|
-
description: z.string().optional(),
|
|
50
|
-
collapsible: z.boolean().optional(),
|
|
51
|
-
collapsed: z.boolean().optional(),
|
|
52
|
-
link: InputSidebarItemCategoryLinkDocSchema.optional(),
|
|
53
|
-
});
|
|
54
|
-
export const InputSidebarItemSchema = z.lazy(() => z.union([
|
|
55
|
-
InputSidebarItemDocSchema,
|
|
56
|
-
InputSidebarItemLinkSchema,
|
|
57
|
-
InputSidebarItemCategorySchema,
|
|
58
|
-
]));
|
|
59
|
-
export const InputSidebarItemCategorySchema = BaseInputSidebarItemCategorySchema.extend({
|
|
60
|
-
items: InputSidebarItemSchema.array(),
|
|
61
|
-
});
|
|
62
|
-
export const InputSidebarSchema = InputSidebarItemSchema.array();
|
|
63
|
-
//# sourceMappingURL=InputSidebarSchema.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"InputSidebarSchema.js","sourceRoot":"","sources":["../../../src/config/validators/InputSidebarSchema.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { type LucideIcon } from "lucide-react";
|
|
2
|
-
import type { BaseInputSidebarItemCategoryLinkDoc, BaseInputSidebarItemDoc, InputSidebarItem, InputSidebarItemCategory, InputSidebarItemLink } from "./InputSidebarSchema.js";
|
|
3
|
-
import type { ZudokuConfig } from "./validate.js";
|
|
4
|
-
export type SidebarItemDoc = Omit<BaseInputSidebarItemDoc, "icon"> & {
|
|
5
|
-
label: string;
|
|
6
|
-
categoryLabel?: string;
|
|
7
|
-
icon?: LucideIcon | string;
|
|
8
|
-
};
|
|
9
|
-
export type SidebarItemLink = Omit<InputSidebarItemLink, "icon"> & {
|
|
10
|
-
icon?: LucideIcon | string;
|
|
11
|
-
};
|
|
12
|
-
export type SidebarItemCategoryLinkDoc = BaseInputSidebarItemCategoryLinkDoc & {
|
|
13
|
-
label: string;
|
|
14
|
-
icon?: LucideIcon | string;
|
|
15
|
-
};
|
|
16
|
-
export type SidebarItemCategory = Omit<InputSidebarItemCategory, "items" | "link" | "icon"> & {
|
|
17
|
-
items: SidebarItem[];
|
|
18
|
-
link?: SidebarItemCategoryLinkDoc;
|
|
19
|
-
icon?: LucideIcon | string;
|
|
20
|
-
};
|
|
21
|
-
export type SidebarItem = SidebarItemDoc | SidebarItemLink | SidebarItemCategory;
|
|
22
|
-
export declare class SidebarManager {
|
|
23
|
-
sidebars: SidebarClass[];
|
|
24
|
-
private switchQueue;
|
|
25
|
-
constructor(rootDir: string, sidebarConfig: ZudokuConfig["sidebar"]);
|
|
26
|
-
resolveSidebars(): Promise<{
|
|
27
|
-
[k: string]: SidebarItem[];
|
|
28
|
-
}>;
|
|
29
|
-
switchSidebar(from: string, to: string, item: SidebarItem): void;
|
|
30
|
-
}
|
|
31
|
-
export declare class SidebarClass {
|
|
32
|
-
private manager;
|
|
33
|
-
rootDir: string;
|
|
34
|
-
parent: string;
|
|
35
|
-
private items;
|
|
36
|
-
resolvedItems: SidebarItem[];
|
|
37
|
-
constructor(manager: SidebarManager, rootDir: string, parent: string, items: InputSidebarItem[]);
|
|
38
|
-
resolve(): Promise<void>;
|
|
39
|
-
private resolveDoc;
|
|
40
|
-
private resolveLink;
|
|
41
|
-
private resolveItemCategoryLinkDoc;
|
|
42
|
-
private resolveSidebarItemDoc;
|
|
43
|
-
private resolveItem;
|
|
44
|
-
}
|
|
45
|
-
export type Sidebar = SidebarItem[];
|
|
46
|
-
export type SidebarConfig = Record<string, Sidebar>;
|