zudoku 0.0.0-z179c4f85 → 0.0.0-z2f55b5ae
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/main.js +1 -1
- package/dist/app/main.js.map +1 -1
- package/dist/config/create-plugin.d.ts +2 -0
- package/dist/config/create-plugin.js +55 -0
- package/dist/config/create-plugin.js.map +1 -0
- package/dist/config/loader.js +3 -1
- package/dist/config/loader.js.map +1 -1
- package/dist/config/validators/InputNavigationSchema.d.ts +103 -53
- package/dist/config/validators/InputNavigationSchema.js +17 -0
- package/dist/config/validators/InputNavigationSchema.js.map +1 -1
- package/dist/config/validators/NavigationSchema.d.ts +10 -2
- package/dist/config/validators/NavigationSchema.js +7 -0
- package/dist/config/validators/NavigationSchema.js.map +1 -1
- package/dist/config/validators/ProtectedRoutesSchema.d.ts +1 -1
- package/dist/config/validators/validate.d.ts +25 -6
- package/dist/config/validators/validate.js +8 -3
- package/dist/config/validators/validate.js.map +1 -1
- package/dist/flat-config.d.ts +40 -27
- package/dist/index.d.ts +2 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/components/Bootstrap.js +1 -2
- package/dist/lib/components/Bootstrap.js.map +1 -1
- package/dist/lib/components/Heading.d.ts +1 -1
- package/dist/lib/components/MobileTopNavigation.js +2 -1
- package/dist/lib/components/MobileTopNavigation.js.map +1 -1
- package/dist/lib/components/Slot.test.js +1 -1
- package/dist/lib/components/Slot.test.js.map +1 -1
- package/dist/lib/components/TopNavigation.d.ts +7 -1
- package/dist/lib/components/TopNavigation.js +7 -2
- package/dist/lib/components/TopNavigation.js.map +1 -1
- package/dist/lib/components/Zudoku.d.ts +4 -1
- package/dist/lib/components/Zudoku.js +4 -7
- package/dist/lib/components/Zudoku.js.map +1 -1
- package/dist/lib/components/context/ZudokuContext.d.ts +9 -4
- package/dist/lib/components/context/ZudokuContext.js +4 -2
- package/dist/lib/components/context/ZudokuContext.js.map +1 -1
- package/dist/lib/components/context/ZudokuProvider.js +1 -1
- package/dist/lib/components/context/ZudokuProvider.js.map +1 -1
- package/dist/lib/components/context/ZudokuReactContext.d.ts +11 -0
- package/dist/lib/components/context/ZudokuReactContext.js +4 -0
- package/dist/lib/components/context/ZudokuReactContext.js.map +1 -0
- package/dist/lib/components/index.d.ts +18 -74
- package/dist/lib/components/index.js +19 -36
- package/dist/lib/components/index.js.map +1 -1
- package/dist/lib/components/navigation/Navigation.js +4 -3
- package/dist/lib/components/navigation/Navigation.js.map +1 -1
- package/dist/lib/components/navigation/NavigationCategory.js +8 -0
- package/dist/lib/components/navigation/NavigationCategory.js.map +1 -1
- package/dist/lib/components/navigation/NavigationFilterContext.d.ts +8 -0
- package/dist/lib/components/navigation/NavigationFilterContext.js +12 -0
- package/dist/lib/components/navigation/NavigationFilterContext.js.map +1 -0
- package/dist/lib/components/navigation/NavigationFilterInput.d.ts +3 -0
- package/dist/lib/components/navigation/NavigationFilterInput.js +9 -0
- package/dist/lib/components/navigation/NavigationFilterInput.js.map +1 -0
- package/dist/lib/components/navigation/NavigationItem.js +11 -1
- package/dist/lib/components/navigation/NavigationItem.js.map +1 -1
- package/dist/lib/components/navigation/utils.d.ts +2 -1
- package/dist/lib/components/navigation/utils.js +22 -1
- package/dist/lib/components/navigation/utils.js.map +1 -1
- package/dist/lib/core/ZudokuContext.d.ts +2 -1
- package/dist/lib/core/ZudokuContext.js +3 -1
- package/dist/lib/core/ZudokuContext.js.map +1 -1
- package/dist/lib/core/__internal.d.ts +1 -0
- package/dist/lib/core/__internal.js +2 -0
- package/dist/lib/core/__internal.js.map +1 -1
- package/dist/lib/core/plugins.d.ts +15 -1
- package/dist/lib/core/plugins.js +1 -0
- package/dist/lib/core/plugins.js.map +1 -1
- package/dist/lib/core/transform-config.d.ts +4 -0
- package/dist/lib/core/transform-config.js +42 -0
- package/dist/lib/core/transform-config.js.map +1 -0
- package/dist/lib/core/transform-config.test.d.ts +1 -0
- package/dist/lib/core/transform-config.test.js +83 -0
- package/dist/lib/core/transform-config.test.js.map +1 -0
- package/dist/lib/errors/ErrorAlert.js +1 -2
- package/dist/lib/errors/ErrorAlert.js.map +1 -1
- package/dist/lib/hooks/index.d.ts +7 -30
- package/dist/lib/hooks/index.js +7 -15
- package/dist/lib/hooks/index.js.map +1 -1
- package/dist/lib/hooks/useEvent.test.js +1 -1
- package/dist/lib/hooks/useEvent.test.js.map +1 -1
- package/dist/lib/oas/graphql/circular.d.ts +1 -1
- package/dist/lib/oas/graphql/circular.js +18 -35
- package/dist/lib/oas/graphql/circular.js.map +1 -1
- package/dist/lib/oas/graphql/circular.test.js +33 -2
- package/dist/lib/oas/graphql/circular.test.js.map +1 -1
- package/dist/lib/oas/parser/index.js +14 -5
- package/dist/lib/oas/parser/index.js.map +1 -1
- package/dist/lib/plugins/openapi/OasProvider.js +6 -2
- package/dist/lib/plugins/openapi/OasProvider.js.map +1 -1
- package/dist/lib/plugins/openapi/OperationList.js +4 -8
- package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
- package/dist/lib/plugins/openapi/interfaces.d.ts +3 -0
- package/dist/lib/plugins/openapi/playground/fileUtils.d.ts +1 -0
- package/dist/lib/plugins/openapi/playground/fileUtils.js +3 -0
- package/dist/lib/plugins/openapi/playground/fileUtils.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/result-panel/AudioPlayer.d.ts +6 -0
- package/dist/lib/plugins/openapi/playground/result-panel/AudioPlayer.js +20 -0
- package/dist/lib/plugins/openapi/playground/result-panel/AudioPlayer.js.map +1 -0
- package/dist/lib/plugins/openapi/playground/result-panel/ResponseTab.js +7 -2
- package/dist/lib/plugins/openapi/playground/result-panel/ResponseTab.js.map +1 -1
- package/dist/lib/plugins/openapi/util/getRoutes.d.ts +3 -0
- package/dist/lib/plugins/openapi/util/getRoutes.js +2 -1
- package/dist/lib/plugins/openapi/util/getRoutes.js.map +1 -1
- package/dist/lib/ui/Alert.d.ts +3 -2
- package/dist/lib/ui/Alert.js +9 -5
- package/dist/lib/ui/Alert.js.map +1 -1
- package/dist/lib/ui/Command.d.ts +3 -3
- package/dist/lib/ui/InputGroup.d.ts +16 -0
- package/dist/lib/ui/InputGroup.js +65 -0
- package/dist/lib/ui/InputGroup.js.map +1 -0
- package/dist/lib/ui/Secret.js +2 -2
- package/dist/lib/ui/Secret.js.map +1 -1
- package/dist/lib/util/flattenAllOf.d.ts +0 -2
- package/dist/lib/util/flattenAllOf.js +0 -46
- package/dist/lib/util/flattenAllOf.js.map +1 -1
- package/dist/lib/util/flattenAllOf.test.js +2 -1
- package/dist/lib/util/flattenAllOf.test.js.map +1 -1
- package/dist/lib/util/flattenAllOfProcessor.d.ts +2 -0
- package/dist/lib/util/flattenAllOfProcessor.js +48 -0
- package/dist/lib/util/flattenAllOfProcessor.js.map +1 -0
- package/dist/lib/util/readFrontmatter.js +2 -1
- package/dist/lib/util/readFrontmatter.js.map +1 -1
- package/dist/vite/api/SchemaManager.d.ts +11 -1
- package/dist/vite/api/SchemaManager.js +29 -18
- package/dist/vite/api/SchemaManager.js.map +1 -1
- package/dist/vite/api/SchemaManager.test.js +45 -1
- package/dist/vite/api/SchemaManager.test.js.map +1 -1
- package/dist/vite/build.js +91 -73
- package/dist/vite/build.js.map +1 -1
- package/dist/vite/config.js +5 -2
- package/dist/vite/config.js.map +1 -1
- package/dist/vite/mdx/remark-inject-filepath.js +5 -1
- package/dist/vite/mdx/remark-inject-filepath.js.map +1 -1
- package/dist/vite/mdx/remark-link-rewrite.js +3 -2
- package/dist/vite/mdx/remark-link-rewrite.js.map +1 -1
- package/dist/vite/plugin-api.js +5 -3
- package/dist/vite/plugin-api.js.map +1 -1
- package/dist/vite/plugin-config.js +16 -4
- package/dist/vite/plugin-config.js.map +1 -1
- package/dist/vite/plugin-docs.js +9 -7
- package/dist/vite/plugin-docs.js.map +1 -1
- package/dist/vite/plugin-markdown-export.js +4 -2
- package/dist/vite/plugin-markdown-export.js.map +1 -1
- package/dist/vite/plugin-theme.js +2 -1
- package/dist/vite/plugin-theme.js.map +1 -1
- package/dist/vite/prerender/prerender.js +3 -1
- package/dist/vite/prerender/prerender.js.map +1 -1
- package/dist/vite/prerender/worker.js +3 -1
- package/dist/vite/prerender/worker.js.map +1 -1
- package/lib/{ClaudeLogo-DHxJUhN_.js → ClaudeLogo-Br8C_vTq.js} +26 -22
- package/lib/{ClaudeLogo-DHxJUhN_.js.map → ClaudeLogo-Br8C_vTq.js.map} +1 -1
- package/lib/Drawer-Ch7927PF.js.map +1 -1
- package/lib/{HydrationBoundary-CNF2ZV3E.js → HydrationBoundary-CJu4vUlG.js} +6 -6
- package/lib/{HydrationBoundary-CNF2ZV3E.js.map → HydrationBoundary-CJu4vUlG.js.map} +1 -1
- package/lib/{MdxPage-CD36PJ17.js → MdxPage-C0QFAsgv.js} +8 -8
- package/lib/{MdxPage-CD36PJ17.js.map → MdxPage-C0QFAsgv.js.map} +1 -1
- package/lib/Mermaid-Chx5BPHn.js +104 -0
- package/lib/Mermaid-Chx5BPHn.js.map +1 -0
- package/lib/{OAuthErrorPage-4mN5DA86.js → OAuthErrorPage-CFz_gBFx.js} +22 -19
- package/lib/{OAuthErrorPage-4mN5DA86.js.map → OAuthErrorPage-CFz_gBFx.js.map} +1 -1
- package/lib/OasProvider-BnQ1_ehf.js +48 -0
- package/lib/OasProvider-BnQ1_ehf.js.map +1 -0
- package/lib/OperationList-Bw-3OS_8.js +5907 -0
- package/lib/OperationList-Bw-3OS_8.js.map +1 -0
- package/lib/{RouteGuard--A04ESy8.js → RouteGuard-CVs3yvEs.js} +5 -5
- package/lib/{RouteGuard--A04ESy8.js.map → RouteGuard-CVs3yvEs.js.map} +1 -1
- package/lib/{SchemaList-Dw3-CJPb.js → SchemaList-IehIWcDV.js} +8 -8
- package/lib/{SchemaList-Dw3-CJPb.js.map → SchemaList-IehIWcDV.js.map} +1 -1
- package/lib/{SchemaView-DyJkiQkD.js → SchemaView-BZLyoQRI.js} +3 -3
- package/lib/{SchemaView-DyJkiQkD.js.map → SchemaView-BZLyoQRI.js.map} +1 -1
- package/lib/{Secret-BDBqq4p3.js → Secret-DUpgv4V3.js} +92 -72
- package/lib/Secret-DUpgv4V3.js.map +1 -0
- package/lib/{SignUp-DRvN-8cq.js → SignUp-Dug1jAGC.js} +31 -26
- package/lib/{SignUp-DRvN-8cq.js.map → SignUp-Dug1jAGC.js.map} +1 -1
- package/lib/{SyntaxHighlight-klTH8c6-.js → SyntaxHighlight-BMu0b_hF.js} +12 -11
- package/lib/SyntaxHighlight-BMu0b_hF.js.map +1 -0
- package/lib/{Toc-PbuF-u9x.js → Toc-BiJ2YL0O.js} +2 -2
- package/lib/{Toc-PbuF-u9x.js.map → Toc-BiJ2YL0O.js.map} +1 -1
- package/lib/{index-BDsEwofZ.js → Zudoku-iyiXgWFY.js} +2996 -2859
- package/lib/Zudoku-iyiXgWFY.js.map +1 -0
- package/lib/ZudokuContext-CYyb_PB_.js +175 -0
- package/lib/ZudokuContext-CYyb_PB_.js.map +1 -0
- package/lib/ZudokuReactContext-DGJAP1sN.js +222 -0
- package/lib/ZudokuReactContext-DGJAP1sN.js.map +1 -0
- package/lib/chunk-EPOLDU6W-C6C8jAwd.js.map +1 -1
- package/lib/{circular-DFquXeY2.js → circular-CfBNz-Ot.js} +1327 -1346
- package/lib/{circular-DFquXeY2.js.map → circular-CfBNz-Ot.js.map} +1 -1
- package/lib/createServer-BtZPTSEO.js +13036 -0
- package/lib/createServer-BtZPTSEO.js.map +1 -0
- package/lib/{errors-rWHkzVTd.js → errors-B77S9iOc.js} +3 -3
- package/lib/{errors-rWHkzVTd.js.map → errors-B77S9iOc.js.map} +1 -1
- package/lib/{firebase-BmGU1FuD.js → firebase-C7XKRGLf.js} +26 -25
- package/lib/firebase-C7XKRGLf.js.map +1 -0
- package/lib/{hook-BGlHBdET.js → hook-Dz_n9SoE.js} +16 -15
- package/lib/{hook-BGlHBdET.js.map → hook-Dz_n9SoE.js.map} +1 -1
- package/lib/{index-DRBOFufT.js → index-BDp2MTiq.js} +2 -2
- package/lib/{index-DRBOFufT.js.map → index-BDp2MTiq.js.map} +1 -1
- package/lib/{index-BQB9hb6n.js → index-CQ-p1wyT.js} +588 -547
- package/lib/index-CQ-p1wyT.js.map +1 -0
- package/lib/index-CrcNWbel.js.map +1 -1
- package/lib/index-DAWHN3cH.js +86 -0
- package/lib/index-DAWHN3cH.js.map +1 -0
- package/lib/index.esm-BYObtETB.js.map +1 -1
- package/lib/{index.esm-B_0dvNjB.js → index.esm-Ca5zvoff.js} +20 -20
- package/lib/{index.esm-B_0dvNjB.js.map → index.esm-Ca5zvoff.js.map} +1 -1
- package/lib/{index.esm-Cx8B1YJQ.js → index.esm-Cth49JBv.js} +2 -2
- package/lib/index.esm-Cth49JBv.js.map +1 -0
- package/lib/{invariant-BJAl77rw.js → invariant-B_t_F2s_.js} +3 -3
- package/lib/{invariant-BJAl77rw.js.map → invariant-B_t_F2s_.js.map} +1 -1
- package/lib/jsx-runtime-BzflLqGi.js.map +1 -1
- package/lib/{mutation-BISOc7OM.js → mutation-B7eFBLZY.js} +2 -2
- package/lib/{mutation-BISOc7OM.js.map → mutation-B7eFBLZY.js.map} +1 -1
- package/lib/ui/Alert.js +32 -20
- package/lib/ui/Alert.js.map +1 -1
- package/lib/ui/Carousel.js.map +1 -1
- package/lib/ui/InputGroup.js +155 -0
- package/lib/ui/InputGroup.js.map +1 -0
- package/lib/ui/Secret.js +2 -2
- package/lib/ui/Secret.js.map +1 -1
- package/lib/ui/SyntaxHighlight.js +3 -3
- package/lib/useExposedProps-CzTDfXfq.js +30 -0
- package/lib/useExposedProps-CzTDfXfq.js.map +1 -0
- package/lib/{useMutation-CFMGlAMW.js → useMutation-CErliDZ9.js} +5 -5
- package/lib/{useMutation-CFMGlAMW.js.map → useMutation-CErliDZ9.js.map} +1 -1
- package/lib/{useSuspenseQuery-CSB_rVek.js → useQuery-ht7aWJ3S.js} +432 -446
- package/lib/useQuery-ht7aWJ3S.js.map +1 -0
- package/lib/useSuspenseQuery-DQH4Bmc2.js +18 -0
- package/lib/useSuspenseQuery-DQH4Bmc2.js.map +1 -0
- package/lib/zudoku.__internal.js +1519 -1033
- package/lib/zudoku.__internal.js.map +1 -1
- package/lib/zudoku.auth-auth0.js +6 -5
- package/lib/zudoku.auth-auth0.js.map +1 -1
- package/lib/zudoku.auth-azureb2c.js +14 -13
- package/lib/zudoku.auth-azureb2c.js.map +1 -1
- package/lib/zudoku.auth-clerk.js +2 -2
- package/lib/zudoku.auth-firebase.js +5 -5
- package/lib/zudoku.auth-openid.js +8 -7
- package/lib/zudoku.auth-openid.js.map +1 -1
- package/lib/zudoku.auth-supabase.js +4 -4
- package/lib/zudoku.components.js +31 -29
- package/lib/zudoku.components.js.map +1 -1
- package/lib/zudoku.hooks.js +24 -11
- package/lib/zudoku.hooks.js.map +1 -1
- package/lib/zudoku.mermaid.js +5 -4
- package/lib/zudoku.mermaid.js.map +1 -1
- package/lib/zudoku.plugin-api-catalog.js +41 -36
- package/lib/zudoku.plugin-api-catalog.js.map +1 -1
- package/lib/zudoku.plugin-api-keys.js +156 -153
- package/lib/zudoku.plugin-api-keys.js.map +1 -1
- package/lib/zudoku.plugin-custom-pages.js +1 -1
- package/lib/zudoku.plugin-markdown.js +1 -1
- package/lib/zudoku.plugin-openapi.js +2 -2
- package/lib/zudoku.plugin-search-pagefind.js +19 -18
- package/lib/zudoku.plugin-search-pagefind.js.map +1 -1
- package/lib/zudoku.plugins.js +9 -8
- package/lib/zudoku.plugins.js.map +1 -1
- package/lib/zudoku.react-query.js +26 -25
- package/lib/zudoku.react-query.js.map +1 -1
- package/lib/zudoku.router.js.map +1 -1
- package/package.json +23 -15
- package/src/app/defaultTheme.css +4 -0
- package/src/app/main.css +2 -0
- package/src/app/main.tsx +1 -1
- package/src/lib/components/Bootstrap.tsx +1 -4
- package/src/lib/components/MobileTopNavigation.tsx +13 -8
- package/src/lib/components/Slot.test.tsx +1 -1
- package/src/lib/components/TopNavigation.tsx +25 -7
- package/src/lib/components/Zudoku.tsx +18 -14
- package/src/lib/components/context/ZudokuContext.ts +3 -6
- package/src/lib/components/context/ZudokuProvider.tsx +1 -1
- package/src/lib/components/context/ZudokuReactContext.tsx +17 -0
- package/src/lib/components/index.ts +19 -39
- package/src/lib/components/navigation/Navigation.tsx +4 -3
- package/src/lib/components/navigation/NavigationCategory.tsx +9 -0
- package/src/lib/components/navigation/NavigationFilterContext.tsx +28 -0
- package/src/lib/components/navigation/NavigationFilterInput.tsx +35 -0
- package/src/lib/components/navigation/NavigationItem.tsx +17 -1
- package/src/lib/components/navigation/utils.ts +32 -1
- package/src/lib/core/ZudokuContext.ts +7 -1
- package/src/lib/core/__internal.tsx +2 -0
- package/src/lib/core/plugins.ts +25 -1
- package/src/lib/core/transform-config.test.tsx +99 -0
- package/src/lib/core/transform-config.ts +67 -0
- package/src/lib/errors/ErrorAlert.tsx +1 -6
- package/src/lib/hooks/index.ts +7 -16
- package/src/lib/hooks/useEvent.test.tsx +1 -1
- package/src/lib/oas/graphql/circular.test.ts +37 -2
- package/src/lib/oas/graphql/circular.ts +25 -51
- package/src/lib/oas/parser/index.ts +17 -6
- package/src/lib/plugins/openapi/OasProvider.tsx +10 -2
- package/src/lib/plugins/openapi/OperationList.tsx +4 -9
- package/src/lib/plugins/openapi/interfaces.ts +6 -1
- package/src/lib/plugins/openapi/playground/fileUtils.ts +4 -0
- package/src/lib/plugins/openapi/playground/result-panel/AudioPlayer.tsx +50 -0
- package/src/lib/plugins/openapi/playground/result-panel/ResponseTab.tsx +33 -17
- package/src/lib/plugins/openapi/util/getRoutes.tsx +4 -1
- package/src/lib/ui/Alert.tsx +17 -5
- package/src/lib/ui/InputGroup.tsx +168 -0
- package/src/lib/ui/Secret.tsx +2 -2
- package/src/lib/util/flattenAllOf.test.ts +2 -1
- package/src/lib/util/flattenAllOf.ts +0 -57
- package/src/lib/util/flattenAllOfProcessor.ts +58 -0
- package/src/lib/util/readFrontmatter.ts +2 -1
- package/src/shiki/langs/c3.js +1 -0
- package/src/shiki/langs/gn.js +1 -0
- package/src/shiki/langs/moonbit.js +1 -0
- package/src/zuplo/enrich-with-zuplo-mcp.ts +168 -0
- package/src/zuplo/enrich-with-zuplo.ts +254 -0
- package/src/zuplo/policy-types.ts +46 -0
- package/src/zuplo/with-zuplo-processors.ts +35 -0
- package/src/zuplo/with-zuplo.ts +14 -0
- package/lib/Mermaid-Koc3z8mU.js +0 -102
- package/lib/Mermaid-Koc3z8mU.js.map +0 -1
- package/lib/OasProvider-DSe-hk5Y.js +0 -40
- package/lib/OasProvider-DSe-hk5Y.js.map +0 -1
- package/lib/OperationList-CaknPbvq.js +0 -5823
- package/lib/OperationList-CaknPbvq.js.map +0 -1
- package/lib/Secret-BDBqq4p3.js.map +0 -1
- package/lib/Separator-BXt1LYnm.js +0 -27
- package/lib/Separator-BXt1LYnm.js.map +0 -1
- package/lib/SyntaxHighlight-klTH8c6-.js.map +0 -1
- package/lib/ZudokuContext-BZB1TWdT.js +0 -387
- package/lib/ZudokuContext-BZB1TWdT.js.map +0 -1
- package/lib/___vite-browser-external_commonjs-proxy-BttVsNON.js +0 -9
- package/lib/___vite-browser-external_commonjs-proxy-BttVsNON.js.map +0 -1
- package/lib/createServer-BXZ0CAUn.js +0 -16693
- package/lib/createServer-BXZ0CAUn.js.map +0 -1
- package/lib/firebase-BmGU1FuD.js.map +0 -1
- package/lib/index-BDsEwofZ.js.map +0 -1
- package/lib/index-BQB9hb6n.js.map +0 -1
- package/lib/index-DBjOT2H1.js +0 -133
- package/lib/index-DBjOT2H1.js.map +0 -1
- package/lib/index.esm-Cx8B1YJQ.js.map +0 -1
- package/lib/useSuspenseQuery-CSB_rVek.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zudoku",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-z2f55b5ae",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"homepage": "https://zudoku.dev",
|
|
6
6
|
"repository": {
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
"src/lib",
|
|
19
19
|
"src/app",
|
|
20
20
|
"src/shiki",
|
|
21
|
+
"src/zuplo",
|
|
21
22
|
"client.d.ts"
|
|
22
23
|
],
|
|
23
24
|
"bin": {
|
|
@@ -184,18 +185,18 @@
|
|
|
184
185
|
"@radix-ui/react-visually-hidden": "1.2.4",
|
|
185
186
|
"@scalar/openapi-parser": "0.23.2",
|
|
186
187
|
"@sentry/node": "10.27.0",
|
|
187
|
-
"@shikijs/engine-javascript": "3.
|
|
188
|
-
"@shikijs/langs": "3.
|
|
189
|
-
"@shikijs/rehype": "3.
|
|
190
|
-
"@shikijs/themes": "3.
|
|
191
|
-
"@shikijs/transformers": "3.
|
|
188
|
+
"@shikijs/engine-javascript": "3.21.0",
|
|
189
|
+
"@shikijs/langs": "3.21.0",
|
|
190
|
+
"@shikijs/rehype": "3.21.0",
|
|
191
|
+
"@shikijs/themes": "3.21.0",
|
|
192
|
+
"@shikijs/transformers": "3.21.0",
|
|
192
193
|
"@sindresorhus/slugify": "3.0.0",
|
|
193
194
|
"@stefanprobst/rehype-extract-toc": "3.0.0",
|
|
194
195
|
"@tailwindcss/typography": "0.5.19",
|
|
195
196
|
"@tailwindcss/vite": "4.1.16",
|
|
196
197
|
"@tanem/react-nprogress": "5.0.56",
|
|
197
198
|
"@tanstack/react-query": "5.90.12",
|
|
198
|
-
"@types/react": "19.2.
|
|
199
|
+
"@types/react": "19.2.10",
|
|
199
200
|
"@types/react-dom": "19.2.3",
|
|
200
201
|
"@vitejs/plugin-react": "5.1.0",
|
|
201
202
|
"@x0k/json-schema-merge": "1.0.2",
|
|
@@ -232,10 +233,10 @@
|
|
|
232
233
|
"pagefind": "1.5.0-beta.1",
|
|
233
234
|
"picocolors": "1.1.1",
|
|
234
235
|
"piscina": "5.1.4",
|
|
235
|
-
"posthog-node": "5.
|
|
236
|
+
"posthog-node": "5.21.2",
|
|
236
237
|
"react-error-boundary": "6.0.0",
|
|
237
238
|
"react-hook-form": "7.66.0",
|
|
238
|
-
"react-is": "19.2.
|
|
239
|
+
"react-is": "19.2.4",
|
|
239
240
|
"react-markdown": "10.1.0",
|
|
240
241
|
"react-router": "7.12.0",
|
|
241
242
|
"rehype-mdx-import-media": "1.2.0",
|
|
@@ -249,7 +250,7 @@
|
|
|
249
250
|
"remark-mdx-frontmatter": "5.2.0",
|
|
250
251
|
"rollup": "4.52.5",
|
|
251
252
|
"semver": "7.7.2",
|
|
252
|
-
"shiki": "3.
|
|
253
|
+
"shiki": "3.21.0",
|
|
253
254
|
"sitemap": "9.0.0",
|
|
254
255
|
"strip-ansi": "7.1.2",
|
|
255
256
|
"tailwind-merge": "3.4.0",
|
|
@@ -262,12 +263,12 @@
|
|
|
262
263
|
"vite": "6.4.1",
|
|
263
264
|
"yaml": "2.8.1",
|
|
264
265
|
"yargs": "18.0.0",
|
|
265
|
-
"zod": "4.
|
|
266
|
+
"zod": "4.3.6",
|
|
266
267
|
"zustand": "5.0.8"
|
|
267
268
|
},
|
|
268
269
|
"devDependencies": {
|
|
269
270
|
"@graphql-codegen/cli": "6.1.0",
|
|
270
|
-
"@inkeep/cxkit-types": "0.5.
|
|
271
|
+
"@inkeep/cxkit-types": "0.5.113",
|
|
271
272
|
"@testing-library/dom": "10.4.1",
|
|
272
273
|
"@testing-library/jest-dom": "6.9.1",
|
|
273
274
|
"@testing-library/react": "16.3.0",
|
|
@@ -288,8 +289,8 @@
|
|
|
288
289
|
"esbuild": "0.27.0",
|
|
289
290
|
"happy-dom": "20.0.10",
|
|
290
291
|
"mdast-util-mdx": "3.0.0",
|
|
291
|
-
"react": "19.2.
|
|
292
|
-
"react-dom": "19.2.
|
|
292
|
+
"react": "19.2.4",
|
|
293
|
+
"react-dom": "19.2.4",
|
|
293
294
|
"rollup-plugin-visualizer": "6.0.5",
|
|
294
295
|
"tsx": "4.20.6",
|
|
295
296
|
"typescript": "5.9.3",
|
|
@@ -307,6 +308,13 @@
|
|
|
307
308
|
"react": ">=19.2.0",
|
|
308
309
|
"react-dom": ">=19.2.0"
|
|
309
310
|
},
|
|
311
|
+
"typesVersions": {
|
|
312
|
+
"*": {
|
|
313
|
+
"ui/*": [
|
|
314
|
+
"./src/lib/ui/*"
|
|
315
|
+
]
|
|
316
|
+
}
|
|
317
|
+
},
|
|
310
318
|
"peerDependenciesMeta": {
|
|
311
319
|
"@azure/msal-browser": {
|
|
312
320
|
"optional": true
|
|
@@ -335,7 +343,7 @@
|
|
|
335
343
|
},
|
|
336
344
|
"scripts": {
|
|
337
345
|
"build": "tsc --project tsconfig.app.json",
|
|
338
|
-
"build:dev": "esbuild './src/**/*.ts' --format=esm --platform=node --target=node22 --outdir=dist --splitting --log-level=warning",
|
|
346
|
+
"build:dev": "esbuild './src/**/*.ts' './src/**/*.tsx' --format=esm --platform=node --target=node22 --outdir=dist --splitting --log-level=warning",
|
|
339
347
|
"build:vite": "vite build",
|
|
340
348
|
"generate:types": "tsx scripts/generate-types.js && tsx scripts/generate-flat-config.js",
|
|
341
349
|
"build:standalone:vite": "vite build --mode standalone --config vite.standalone.config.ts",
|
package/src/app/defaultTheme.css
CHANGED
|
@@ -20,6 +20,8 @@
|
|
|
20
20
|
--accent: oklch(0.967 0.001 286.375);
|
|
21
21
|
--accent-foreground: oklch(0.21 0.006 285.885);
|
|
22
22
|
--destructive: oklch(0.577 0.245 27.325);
|
|
23
|
+
--warning: oklch(0.84 0.16 84);
|
|
24
|
+
--warning-foreground: oklch(0.47 0.14 46.2);
|
|
23
25
|
--border: oklch(0.92 0.004 286.32);
|
|
24
26
|
--input: oklch(0.92 0.004 286.32);
|
|
25
27
|
--ring: oklch(0.705 0.015 286.067);
|
|
@@ -54,6 +56,8 @@
|
|
|
54
56
|
--accent: oklch(0.274 0.006 286.033);
|
|
55
57
|
--accent-foreground: oklch(0.985 0 0);
|
|
56
58
|
--destructive: oklch(0.704 0.191 22.216);
|
|
59
|
+
--warning: oklch(0.41 0.11 46);
|
|
60
|
+
--warning-foreground: oklch(0.99 0.02 95);
|
|
57
61
|
--border: oklch(1 0 0 / 10%);
|
|
58
62
|
--input: oklch(1 0 0 / 15%);
|
|
59
63
|
--ring: oklch(0.552 0.016 285.938);
|
package/src/app/main.css
CHANGED
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
@custom-variant dark (&:is(.dark *));
|
|
9
9
|
|
|
10
10
|
@theme inline {
|
|
11
|
+
--color-warning: var(--warning);
|
|
12
|
+
--color-warning-foreground: var(--warning-foreground);
|
|
11
13
|
--color-background: var(--background);
|
|
12
14
|
--color-foreground: var(--foreground);
|
|
13
15
|
--color-card: var(--card);
|
package/src/app/main.tsx
CHANGED
|
@@ -111,7 +111,7 @@ export const getRoutesByConfig = (config: ZudokuConfig): RouteObject[] => {
|
|
|
111
111
|
return [
|
|
112
112
|
{
|
|
113
113
|
element: (
|
|
114
|
-
<Zudoku {...options}>
|
|
114
|
+
<Zudoku {...options} env={import.meta.env}>
|
|
115
115
|
<BuildCheck
|
|
116
116
|
buildId={import.meta.env.ZUPLO_BUILD_ID}
|
|
117
117
|
environmentType={import.meta.env.ZUPLO_ENVIRONMENT_TYPE}
|
|
@@ -12,7 +12,6 @@ import {
|
|
|
12
12
|
StaticRouterProvider,
|
|
13
13
|
} from "react-router";
|
|
14
14
|
import { RouterProvider } from "react-router/dom";
|
|
15
|
-
import { StaggeredRenderContext } from "../plugins/openapi/StaggeredRender.js";
|
|
16
15
|
import { BypassProtectedRoutesContext } from "./context/BypassProtectedRoutesContext.js";
|
|
17
16
|
|
|
18
17
|
const queryClient = new QueryClient({
|
|
@@ -36,9 +35,7 @@ const Bootstrap = ({
|
|
|
36
35
|
<HydrationBoundary state={hydrate ? (window as any).DATA : undefined}>
|
|
37
36
|
<BypassProtectedRoutesContext value={false}>
|
|
38
37
|
<HelmetProvider>
|
|
39
|
-
<
|
|
40
|
-
<RouterProvider router={router} />
|
|
41
|
-
</StaggeredRenderContext.Provider>
|
|
38
|
+
<RouterProvider router={router} />
|
|
42
39
|
</HelmetProvider>
|
|
43
40
|
</BypassProtectedRoutesContext>
|
|
44
41
|
</HydrationBoundary>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { VisuallyHidden } from "@radix-ui/react-visually-hidden";
|
|
2
2
|
import { MenuIcon } from "lucide-react";
|
|
3
3
|
import { useState } from "react";
|
|
4
|
+
import { Separator } from "zudoku/ui/Separator.js";
|
|
4
5
|
import { Skeleton } from "zudoku/ui/Skeleton.js";
|
|
5
6
|
import { useAuth } from "../authentication/hook.js";
|
|
6
7
|
import {
|
|
@@ -43,7 +44,7 @@ export const MobileTopNavigation = () => {
|
|
|
43
44
|
<PageProgress />
|
|
44
45
|
</div>
|
|
45
46
|
<DrawerContent
|
|
46
|
-
className="lg:hidden h-
|
|
47
|
+
className="lg:hidden h-dvh end-0 start-auto w-[320px] rounded-none"
|
|
47
48
|
aria-describedby={undefined}
|
|
48
49
|
>
|
|
49
50
|
<div className="p-4 overflow-y-auto overscroll-none h-full flex flex-col justify-between">
|
|
@@ -84,13 +85,17 @@ export const MobileTopNavigation = () => {
|
|
|
84
85
|
)}
|
|
85
86
|
</ClientOnly>
|
|
86
87
|
)}
|
|
87
|
-
{filteredItems.map((item) =>
|
|
88
|
-
|
|
89
|
-
<
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
88
|
+
{filteredItems.map((item) =>
|
|
89
|
+
item.type === "separator" ? (
|
|
90
|
+
<Separator className="w-full" key={item.label} />
|
|
91
|
+
) : item.type !== "section" && item.type !== "filter" ? (
|
|
92
|
+
<li key={item.label}>
|
|
93
|
+
<button type="button" onClick={() => setDrawerOpen(false)}>
|
|
94
|
+
<TopNavItem {...item} />
|
|
95
|
+
</button>
|
|
96
|
+
</li>
|
|
97
|
+
) : null,
|
|
98
|
+
)}
|
|
94
99
|
{isAuthEnabled && isAuthenticated && accountItems.length > 0 && (
|
|
95
100
|
<ClientOnly
|
|
96
101
|
fallback={<Skeleton className="rounded-sm h-5 w-24 mr-4" />}
|
|
@@ -20,7 +20,7 @@ import { Slot } from "./Slot.js";
|
|
|
20
20
|
|
|
21
21
|
const createWrapper = (slots: Record<string, ReactNode> = {}) => {
|
|
22
22
|
const queryClient = new QueryClient();
|
|
23
|
-
const context = new ZudokuContext({}, queryClient);
|
|
23
|
+
const context = new ZudokuContext({}, queryClient, {});
|
|
24
24
|
|
|
25
25
|
const wrapper = ({ children }: PropsWithChildren) => (
|
|
26
26
|
<MemoryRouter initialEntries={["/", "/page"]}>
|
|
@@ -2,6 +2,7 @@ import { cx } from "class-variance-authority";
|
|
|
2
2
|
import { deepEqual } from "fast-equals";
|
|
3
3
|
import { Suspense } from "react";
|
|
4
4
|
import { NavLink, type NavLinkProps } from "react-router";
|
|
5
|
+
import { Separator } from "zudoku/ui/Separator.js";
|
|
5
6
|
import type { NavigationItem } from "../../config/validators/NavigationSchema.js";
|
|
6
7
|
import { useAuth } from "../authentication/hook.js";
|
|
7
8
|
import { joinUrl } from "../util/joinUrl.js";
|
|
@@ -24,11 +25,17 @@ export const TopNavigation = () => {
|
|
|
24
25
|
<div className="items-center justify-between px-8 h-(--top-nav-height) hidden lg:flex text-sm relative">
|
|
25
26
|
<nav className="text-sm">
|
|
26
27
|
<ul className="flex flex-row items-center gap-8">
|
|
27
|
-
{filteredItems.map((item) =>
|
|
28
|
-
|
|
29
|
-
<
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
{filteredItems.map((item) =>
|
|
29
|
+
item.type === "separator" ? (
|
|
30
|
+
<li key={item.label} className="-mx-4 h-7">
|
|
31
|
+
<Separator orientation="vertical" />
|
|
32
|
+
</li>
|
|
33
|
+
) : item.type !== "section" && item.type !== "filter" ? (
|
|
34
|
+
<li key={item.label + item.type}>
|
|
35
|
+
<TopNavItem {...item} />
|
|
36
|
+
</li>
|
|
37
|
+
) : null,
|
|
38
|
+
)}
|
|
32
39
|
</ul>
|
|
33
40
|
</nav>
|
|
34
41
|
<Slot.Target name="top-navigation-side" />
|
|
@@ -51,7 +58,11 @@ const getPathForItem = (item: NavigationItem): string => {
|
|
|
51
58
|
|
|
52
59
|
return (
|
|
53
60
|
traverseNavigationItem(item, (child) => {
|
|
54
|
-
if (
|
|
61
|
+
if (
|
|
62
|
+
child.type !== "category" &&
|
|
63
|
+
child.type !== "separator" &&
|
|
64
|
+
child.type !== "section"
|
|
65
|
+
) {
|
|
55
66
|
return getPathForItem(child);
|
|
56
67
|
}
|
|
57
68
|
}) ?? ""
|
|
@@ -59,6 +70,8 @@ const getPathForItem = (item: NavigationItem): string => {
|
|
|
59
70
|
}
|
|
60
71
|
case "custom-page":
|
|
61
72
|
return item.path;
|
|
73
|
+
default:
|
|
74
|
+
return "";
|
|
62
75
|
}
|
|
63
76
|
};
|
|
64
77
|
|
|
@@ -97,7 +110,12 @@ export const TopNavLink = ({
|
|
|
97
110
|
);
|
|
98
111
|
};
|
|
99
112
|
|
|
100
|
-
export const TopNavItem = (
|
|
113
|
+
export const TopNavItem = (
|
|
114
|
+
item: Exclude<
|
|
115
|
+
NavigationItem,
|
|
116
|
+
{ type: "separator" } | { type: "section" } | { type: "filter" }
|
|
117
|
+
>,
|
|
118
|
+
) => {
|
|
101
119
|
const currentNav = useCurrentNavigation();
|
|
102
120
|
const isActiveTopNavItem = deepEqual(currentNav.topNavItem, item);
|
|
103
121
|
|
|
@@ -5,7 +5,7 @@ import { ThemeProvider } from "next-themes";
|
|
|
5
5
|
import {
|
|
6
6
|
memo,
|
|
7
7
|
type PropsWithChildren,
|
|
8
|
-
|
|
8
|
+
Suspense,
|
|
9
9
|
useEffect,
|
|
10
10
|
useMemo,
|
|
11
11
|
useState,
|
|
@@ -18,7 +18,6 @@ import {
|
|
|
18
18
|
type ZudokuContextOptions,
|
|
19
19
|
} from "../core/ZudokuContext.js";
|
|
20
20
|
import { TopLevelError } from "../errors/TopLevelError.js";
|
|
21
|
-
import { StaggeredRenderContext } from "../plugins/openapi/StaggeredRender.js";
|
|
22
21
|
import { MdxComponents } from "../util/MdxComponents.js";
|
|
23
22
|
import "../util/requestIdleCallbackPolyfill.js";
|
|
24
23
|
import {
|
|
@@ -33,7 +32,13 @@ import { ZudokuProvider } from "./context/ZudokuProvider.js";
|
|
|
33
32
|
let zudokuContext: ZudokuContext | undefined;
|
|
34
33
|
|
|
35
34
|
const ZudokuInner = memo(
|
|
36
|
-
({
|
|
35
|
+
({
|
|
36
|
+
children,
|
|
37
|
+
env,
|
|
38
|
+
...props
|
|
39
|
+
}: PropsWithChildren<
|
|
40
|
+
ZudokuContextOptions & { env: Record<string, string> }
|
|
41
|
+
>) => {
|
|
37
42
|
const components = useMemo(
|
|
38
43
|
() => ({ ...DEFAULT_COMPONENTS, ...props.overrides }),
|
|
39
44
|
[props.overrides],
|
|
@@ -56,12 +61,7 @@ const ZudokuInner = memo(
|
|
|
56
61
|
...props.mdx?.components,
|
|
57
62
|
};
|
|
58
63
|
}, [props.mdx?.components, props.plugins]);
|
|
59
|
-
const { stagger } = useContext(StaggeredRenderContext);
|
|
60
64
|
const [didNavigate, setDidNavigate] = useState(false);
|
|
61
|
-
const staggeredValue = useMemo(
|
|
62
|
-
() => (didNavigate ? { stagger: true } : { stagger }),
|
|
63
|
-
[stagger, didNavigate],
|
|
64
|
-
);
|
|
65
65
|
const navigation = useNavigation();
|
|
66
66
|
const queryClient = useQueryClient();
|
|
67
67
|
|
|
@@ -72,7 +72,7 @@ const ZudokuInner = memo(
|
|
|
72
72
|
setDidNavigate(true);
|
|
73
73
|
}, [didNavigate, navigation.location]);
|
|
74
74
|
|
|
75
|
-
zudokuContext ??= new ZudokuContext(props, queryClient);
|
|
75
|
+
zudokuContext ??= new ZudokuContext(props, queryClient, env);
|
|
76
76
|
|
|
77
77
|
const heads = props.plugins?.flatMap((plugin) =>
|
|
78
78
|
hasHead(plugin) ? (plugin.getHead?.({ location }) ?? []) : [],
|
|
@@ -81,8 +81,8 @@ const ZudokuInner = memo(
|
|
|
81
81
|
return (
|
|
82
82
|
<>
|
|
83
83
|
<Helmet>{heads}</Helmet>
|
|
84
|
-
<
|
|
85
|
-
<
|
|
84
|
+
<ZudokuProvider context={zudokuContext}>
|
|
85
|
+
<Suspense fallback={<div>Zudoku Loading...</div>}>
|
|
86
86
|
<RouterEventsEmitter />
|
|
87
87
|
<SlotProvider slots={props.slots ?? props.UNSAFE_slotlets}>
|
|
88
88
|
<MDXProvider components={mdxComponents}>
|
|
@@ -95,8 +95,8 @@ const ZudokuInner = memo(
|
|
|
95
95
|
</ThemeProvider>
|
|
96
96
|
</MDXProvider>
|
|
97
97
|
</SlotProvider>
|
|
98
|
-
</
|
|
99
|
-
</
|
|
98
|
+
</Suspense>
|
|
99
|
+
</ZudokuProvider>
|
|
100
100
|
</>
|
|
101
101
|
);
|
|
102
102
|
},
|
|
@@ -104,7 +104,11 @@ const ZudokuInner = memo(
|
|
|
104
104
|
|
|
105
105
|
ZudokuInner.displayName = "ZudokuInner";
|
|
106
106
|
|
|
107
|
-
const Zudoku = (
|
|
107
|
+
const Zudoku = (
|
|
108
|
+
props: PropsWithChildren<
|
|
109
|
+
ZudokuContextOptions & { env: Record<string, string> }
|
|
110
|
+
>,
|
|
111
|
+
) => {
|
|
108
112
|
return (
|
|
109
113
|
<ErrorBoundary FallbackComponent={TopLevelError}>
|
|
110
114
|
<ZudokuInner {...props} />
|
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
import { useQuery, useSuspenseQuery } from "@tanstack/react-query";
|
|
2
|
-
import {
|
|
2
|
+
import { useContext, useEffect } from "react";
|
|
3
3
|
import { matchPath, useLocation } from "react-router";
|
|
4
4
|
import type { NavigationItem } from "../../../config/validators/NavigationSchema.js";
|
|
5
5
|
import { useAuthState } from "../../authentication/state.js";
|
|
6
|
-
import type { ZudokuContext } from "../../core/ZudokuContext.js";
|
|
7
6
|
import { joinUrl } from "../../util/joinUrl.js";
|
|
8
7
|
import { CACHE_KEYS, useCache } from "../cache.js";
|
|
9
8
|
import { traverseNavigation } from "../navigation/utils.js";
|
|
10
|
-
|
|
11
|
-
export const ZudokuReactContext = createContext<ZudokuContext | undefined>(
|
|
12
|
-
undefined,
|
|
13
|
-
);
|
|
9
|
+
import { ZudokuReactContext } from "./ZudokuReactContext.js";
|
|
14
10
|
|
|
15
11
|
export const useZudoku = () => {
|
|
16
12
|
const context = useContext(ZudokuReactContext);
|
|
@@ -77,6 +73,7 @@ export const useCurrentNavigation = () => {
|
|
|
77
73
|
const location = useLocation();
|
|
78
74
|
|
|
79
75
|
const navItem = traverseNavigation(navigation, (item, parentCategories) => {
|
|
76
|
+
if (item.type === "link") return;
|
|
80
77
|
if (getItemPath(item) === location.pathname) {
|
|
81
78
|
return parentCategories.at(0) ?? item;
|
|
82
79
|
}
|
|
@@ -2,7 +2,7 @@ import { useSuspenseQuery } from "@tanstack/react-query";
|
|
|
2
2
|
import type { PropsWithChildren } from "react";
|
|
3
3
|
import type { ZudokuContext } from "../../core/ZudokuContext.js";
|
|
4
4
|
import { NO_DEHYDRATE } from "../cache.js";
|
|
5
|
-
import { ZudokuReactContext } from "./
|
|
5
|
+
import { ZudokuReactContext } from "./ZudokuReactContext.js";
|
|
6
6
|
|
|
7
7
|
export const ZudokuProvider = ({
|
|
8
8
|
children,
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type Context, createContext } from "react";
|
|
2
|
+
import type { ZudokuContext } from "../../core/ZudokuContext.js";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* During SSR, Vite's module runner can load the same module multiple times
|
|
6
|
+
* (once for the main app, once for external plugins), creating duplicate
|
|
7
|
+
* React contexts that don't share state.
|
|
8
|
+
*/
|
|
9
|
+
declare global {
|
|
10
|
+
var __ZUDOKU_CONTEXT: Context<ZudokuContext | undefined>;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
globalThis.__ZUDOKU_CONTEXT ??= createContext<ZudokuContext | undefined>(
|
|
14
|
+
undefined,
|
|
15
|
+
);
|
|
16
|
+
|
|
17
|
+
export const ZudokuReactContext = globalThis.__ZUDOKU_CONTEXT;
|
|
@@ -1,46 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
} from "./
|
|
14
|
-
import { useZudoku as useZudokuImport } from "./context/ZudokuContext.js";
|
|
15
|
-
import { Heading as HeadingImport } from "./Heading.js";
|
|
16
|
-
import { Markdown as MarkdownImport } from "./Markdown.js";
|
|
17
|
-
import { Slot as SlotImport } from "./Slot.js";
|
|
18
|
-
import { Spinner as SpinnerImport } from "./Spinner.js";
|
|
19
|
-
import { Typography as TypographyImport } from "./Typography.js";
|
|
20
|
-
import { Zudoku as ZudokuImport } from "./Zudoku.js";
|
|
1
|
+
export { Helmet as Head } from "@zudoku/react-helmet-async";
|
|
2
|
+
export { Link } from "react-router";
|
|
3
|
+
export { Button } from "../ui/Button.js";
|
|
4
|
+
export { Callout } from "../ui/Callout.js";
|
|
5
|
+
export { ZudokuError } from "../util/invariant.js";
|
|
6
|
+
export { ClientOnly } from "./ClientOnly.js";
|
|
7
|
+
export { Heading } from "./Heading.js";
|
|
8
|
+
export { Markdown } from "./Markdown.js";
|
|
9
|
+
export { Search } from "./Search.js";
|
|
10
|
+
export { Slot } from "./Slot.js";
|
|
11
|
+
export { Spinner } from "./Spinner.js";
|
|
12
|
+
export { Typography } from "./Typography.js";
|
|
13
|
+
export { Zudoku } from "./Zudoku.js";
|
|
21
14
|
|
|
22
|
-
|
|
23
|
-
export const Heading = /*@__PURE__*/ HeadingImport;
|
|
24
|
-
export const Callout = /*@__PURE__*/ CalloutImport;
|
|
25
|
-
export const Markdown = /*@__PURE__*/ MarkdownImport;
|
|
26
|
-
export const Spinner = /*@__PURE__*/ SpinnerImport;
|
|
27
|
-
export const ClientOnly = /*@__PURE__*/ ClientOnlyImport;
|
|
28
|
-
export const Button = /*@__PURE__*/ ButtonImport;
|
|
29
|
-
export const Link = /*@__PURE__*/ LinkImport;
|
|
30
|
-
export const Zudoku = /*@__PURE__*/ ZudokuImport;
|
|
31
|
-
export const Typography = /*@__PURE__*/ TypographyImport;
|
|
32
|
-
export const Slot = /*@__PURE__*/ SlotImport;
|
|
33
|
-
export const ZudokuError = /*@__PURE__*/ ZudokuErrorImport;
|
|
15
|
+
//
|
|
34
16
|
|
|
35
17
|
/** @deprecated Import from `zudoku/hooks` instead */
|
|
36
|
-
export
|
|
18
|
+
export { useMDXComponents } from "@mdx-js/react";
|
|
37
19
|
/** @deprecated Import from `zudoku/hooks` instead */
|
|
38
|
-
export
|
|
20
|
+
export { useTheme } from "next-themes";
|
|
39
21
|
/** @deprecated Import from `zudoku/hooks` instead */
|
|
40
|
-
export
|
|
22
|
+
export { useAuth } from "../authentication/hook.js";
|
|
41
23
|
/** @deprecated Import from `zudoku/hooks` instead */
|
|
42
|
-
export
|
|
24
|
+
export { CACHE_KEYS, useCache } from "./cache.js";
|
|
43
25
|
/** @deprecated Import from `zudoku/hooks` instead */
|
|
44
|
-
export
|
|
45
|
-
/** @deprecated Import from `zudoku/hooks` instead */
|
|
46
|
-
export const useTheme = /*@__PURE__*/ useThemeImport;
|
|
26
|
+
export { useZudoku } from "./context/ZudokuContext.js";
|
|
@@ -2,6 +2,7 @@ import { VisuallyHidden } from "@radix-ui/react-visually-hidden";
|
|
|
2
2
|
import type { NavigationItem as NavigationItemType } from "../../../config/validators/NavigationSchema.js";
|
|
3
3
|
import { DrawerContent, DrawerTitle } from "../../ui/Drawer.js";
|
|
4
4
|
import { Slot } from "../Slot.js";
|
|
5
|
+
import { NavigationFilterProvider } from "./NavigationFilterContext.js";
|
|
5
6
|
import { NavigationItem } from "./NavigationItem.js";
|
|
6
7
|
import { NavigationWrapper } from "./NavigationWrapper.js";
|
|
7
8
|
|
|
@@ -12,7 +13,7 @@ export const Navigation = ({
|
|
|
12
13
|
onRequestClose?: () => void;
|
|
13
14
|
navigation: NavigationItemType[];
|
|
14
15
|
}) => (
|
|
15
|
-
|
|
16
|
+
<NavigationFilterProvider>
|
|
16
17
|
<NavigationWrapper>
|
|
17
18
|
<Slot.Target name="navigation-before" />
|
|
18
19
|
{navigation.map((item) => (
|
|
@@ -30,7 +31,7 @@ export const Navigation = ({
|
|
|
30
31
|
<Slot.Target name="navigation-after" />
|
|
31
32
|
</NavigationWrapper>
|
|
32
33
|
<DrawerContent
|
|
33
|
-
className="lg:hidden h-
|
|
34
|
+
className="lg:hidden h-dvh start-0 w-[320px] rounded-none"
|
|
34
35
|
aria-describedby={undefined}
|
|
35
36
|
>
|
|
36
37
|
<div className="p-4 overflow-y-auto overscroll-none">
|
|
@@ -46,5 +47,5 @@ export const Navigation = ({
|
|
|
46
47
|
))}
|
|
47
48
|
</div>
|
|
48
49
|
</DrawerContent>
|
|
49
|
-
|
|
50
|
+
</NavigationFilterProvider>
|
|
50
51
|
);
|
|
@@ -7,6 +7,7 @@ import { Button } from "zudoku/ui/Button.js";
|
|
|
7
7
|
import type { NavigationCategory as NavigationCategoryType } from "../../../config/validators/NavigationSchema.js";
|
|
8
8
|
import { cn } from "../../util/cn.js";
|
|
9
9
|
import { joinUrl } from "../../util/joinUrl.js";
|
|
10
|
+
import { useNavigationFilter } from "./NavigationFilterContext.js";
|
|
10
11
|
import { NavigationItem } from "./NavigationItem.js";
|
|
11
12
|
import { navigationListItem, useIsCategoryOpen } from "./utils.js";
|
|
12
13
|
|
|
@@ -20,6 +21,7 @@ const NavigationCategoryInner = ({
|
|
|
20
21
|
const isCategoryOpen = useIsCategoryOpen(category);
|
|
21
22
|
const [hasInteracted, setHasInteracted] = useState(false);
|
|
22
23
|
const location = useLocation();
|
|
24
|
+
const { query: filterQuery } = useNavigationFilter();
|
|
23
25
|
|
|
24
26
|
const isCollapsible = category.collapsible ?? true;
|
|
25
27
|
const isCollapsed = category.collapsed ?? true;
|
|
@@ -37,6 +39,13 @@ const NavigationCategoryInner = ({
|
|
|
37
39
|
}
|
|
38
40
|
}, [isCategoryOpen]);
|
|
39
41
|
|
|
42
|
+
// Auto-expand when there's an active filter query
|
|
43
|
+
useEffect(() => {
|
|
44
|
+
if (filterQuery.trim()) {
|
|
45
|
+
setOpen(true);
|
|
46
|
+
}
|
|
47
|
+
}, [filterQuery]);
|
|
48
|
+
|
|
40
49
|
const ToggleButton = isCollapsible && (
|
|
41
50
|
<Button
|
|
42
51
|
onClick={(e) => {
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createContext,
|
|
3
|
+
type PropsWithChildren,
|
|
4
|
+
useContext,
|
|
5
|
+
useState,
|
|
6
|
+
} from "react";
|
|
7
|
+
|
|
8
|
+
type NavigationFilterContextType = {
|
|
9
|
+
query: string;
|
|
10
|
+
setQuery: (query: string) => void;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const NavigationFilterContext = createContext<NavigationFilterContextType>({
|
|
14
|
+
query: "",
|
|
15
|
+
setQuery: () => {},
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
export const NavigationFilterProvider = ({ children }: PropsWithChildren) => {
|
|
19
|
+
const [query, setQuery] = useState("");
|
|
20
|
+
|
|
21
|
+
return (
|
|
22
|
+
<NavigationFilterContext.Provider value={{ query, setQuery }}>
|
|
23
|
+
{children}
|
|
24
|
+
</NavigationFilterContext.Provider>
|
|
25
|
+
);
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export const useNavigationFilter = () => useContext(NavigationFilterContext);
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { SearchIcon, XIcon } from "lucide-react";
|
|
2
|
+
import {
|
|
3
|
+
InputGroup,
|
|
4
|
+
InputGroupAddon,
|
|
5
|
+
InputGroupButton,
|
|
6
|
+
InputGroupInput,
|
|
7
|
+
} from "zudoku/ui/InputGroup.js";
|
|
8
|
+
import { useNavigationFilter } from "./NavigationFilterContext.js";
|
|
9
|
+
|
|
10
|
+
export const NavigationFilterInput = ({
|
|
11
|
+
placeholder,
|
|
12
|
+
}: {
|
|
13
|
+
placeholder?: string;
|
|
14
|
+
}) => {
|
|
15
|
+
const { query, setQuery } = useNavigationFilter();
|
|
16
|
+
|
|
17
|
+
return (
|
|
18
|
+
<InputGroup className="my-2">
|
|
19
|
+
<InputGroupAddon>
|
|
20
|
+
<SearchIcon className="size-3.5" />
|
|
21
|
+
</InputGroupAddon>
|
|
22
|
+
<InputGroupInput
|
|
23
|
+
type="text"
|
|
24
|
+
placeholder={placeholder}
|
|
25
|
+
value={query}
|
|
26
|
+
onChange={(e) => setQuery(e.target.value)}
|
|
27
|
+
/>
|
|
28
|
+
{query && (
|
|
29
|
+
<InputGroupButton onClick={() => setQuery("")}>
|
|
30
|
+
<XIcon className="size-3" />
|
|
31
|
+
</InputGroupButton>
|
|
32
|
+
)}
|
|
33
|
+
</InputGroup>
|
|
34
|
+
);
|
|
35
|
+
};
|