zudoku 0.0.0-fd0986c → 0.0.0-fdf886de

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.
Files changed (407) hide show
  1. package/dist/app/demo.js +1 -1
  2. package/dist/app/entry.client.js +1 -1
  3. package/dist/app/entry.server.js +1 -1
  4. package/dist/app/main.d.ts +1 -1
  5. package/dist/app/main.js +12 -6
  6. package/dist/app/main.js.map +1 -1
  7. package/dist/app/standalone.js +1 -1
  8. package/dist/config/config.d.ts +1 -0
  9. package/dist/config/validators/InputNavigationSchema.d.ts +251 -156
  10. package/dist/config/validators/InputNavigationSchema.js +5 -4
  11. package/dist/config/validators/InputNavigationSchema.js.map +1 -1
  12. package/dist/config/validators/InputNavigationSchema.test-d.js +0 -1
  13. package/dist/config/validators/InputNavigationSchema.test-d.js.map +1 -1
  14. package/dist/config/validators/NavigationSchema.js +6 -3
  15. package/dist/config/validators/NavigationSchema.js.map +1 -1
  16. package/dist/config/validators/ProtectedRoutesSchema.d.ts +13 -0
  17. package/dist/config/validators/ProtectedRoutesSchema.js +10 -0
  18. package/dist/config/validators/ProtectedRoutesSchema.js.map +1 -0
  19. package/dist/config/validators/icon-types.d.ts +1 -1
  20. package/dist/config/validators/icon-types.js +16 -0
  21. package/dist/config/validators/icon-types.js.map +1 -1
  22. package/dist/config/validators/validate.d.ts +44 -30
  23. package/dist/config/validators/validate.js +8 -2
  24. package/dist/config/validators/validate.js.map +1 -1
  25. package/dist/flat-config.d.ts +11 -7
  26. package/dist/index.d.ts +1 -0
  27. package/dist/index.js +1 -0
  28. package/dist/index.js.map +1 -1
  29. package/dist/lib/authentication/components/CallbackHandler.js +11 -9
  30. package/dist/lib/authentication/components/CallbackHandler.js.map +1 -1
  31. package/dist/lib/authentication/components/OAuthErrorPage.d.ts +3 -0
  32. package/dist/lib/authentication/components/OAuthErrorPage.js +99 -0
  33. package/dist/lib/authentication/components/OAuthErrorPage.js.map +1 -0
  34. package/dist/lib/authentication/errors.d.ts +6 -12
  35. package/dist/lib/authentication/errors.js +2 -1
  36. package/dist/lib/authentication/errors.js.map +1 -1
  37. package/dist/lib/authentication/hook.d.ts +1 -0
  38. package/dist/lib/authentication/hook.js.map +1 -1
  39. package/dist/lib/authentication/providers/azureb2c.js +4 -2
  40. package/dist/lib/authentication/providers/azureb2c.js.map +1 -1
  41. package/dist/lib/authentication/providers/clerk.js +4 -2
  42. package/dist/lib/authentication/providers/clerk.js.map +1 -1
  43. package/dist/lib/authentication/providers/openid.js +3 -1
  44. package/dist/lib/authentication/providers/openid.js.map +1 -1
  45. package/dist/lib/components/BuildCheck.d.ts +2 -1
  46. package/dist/lib/components/BuildCheck.js +9 -3
  47. package/dist/lib/components/BuildCheck.js.map +1 -1
  48. package/dist/lib/components/Header.js +1 -1
  49. package/dist/lib/components/Header.js.map +1 -1
  50. package/dist/lib/components/Heading.js +1 -1
  51. package/dist/lib/components/Heading.js.map +1 -1
  52. package/dist/lib/components/Layout.js +4 -7
  53. package/dist/lib/components/Layout.js.map +1 -1
  54. package/dist/lib/components/Markdown.js +2 -2
  55. package/dist/lib/components/Markdown.js.map +1 -1
  56. package/dist/lib/components/Meta.d.ts +2 -0
  57. package/dist/lib/components/Meta.js +11 -0
  58. package/dist/lib/components/Meta.js.map +1 -0
  59. package/dist/lib/components/MobileTopNavigation.js +5 -3
  60. package/dist/lib/components/MobileTopNavigation.js.map +1 -1
  61. package/dist/lib/components/NotFoundPage.js +1 -1
  62. package/dist/lib/components/NotFoundPage.js.map +1 -1
  63. package/dist/lib/components/TopNavigation.js +4 -3
  64. package/dist/lib/components/TopNavigation.js.map +1 -1
  65. package/dist/lib/components/Typography.d.ts +1 -1
  66. package/dist/lib/components/Typography.js +1 -1
  67. package/dist/lib/components/Typography.js.map +1 -1
  68. package/dist/lib/components/context/ZudokuContext.js +22 -14
  69. package/dist/lib/components/context/ZudokuContext.js.map +1 -1
  70. package/dist/lib/components/index.d.ts +0 -27
  71. package/dist/lib/components/index.js +0 -15
  72. package/dist/lib/components/index.js.map +1 -1
  73. package/dist/lib/components/navigation/NavigationCategory.js +1 -1
  74. package/dist/lib/components/navigation/NavigationCategory.js.map +1 -1
  75. package/dist/lib/components/navigation/NavigationItem.d.ts +1 -1
  76. package/dist/lib/components/navigation/NavigationItem.js +11 -3
  77. package/dist/lib/components/navigation/NavigationItem.js.map +1 -1
  78. package/dist/lib/components/navigation/utils.d.ts +3 -1
  79. package/dist/lib/components/navigation/utils.js +18 -14
  80. package/dist/lib/components/navigation/utils.js.map +1 -1
  81. package/dist/lib/core/RouteGuard.js +9 -9
  82. package/dist/lib/core/RouteGuard.js.map +1 -1
  83. package/dist/lib/core/ZudokuContext.d.ts +5 -1
  84. package/dist/lib/core/ZudokuContext.js +23 -1
  85. package/dist/lib/core/ZudokuContext.js.map +1 -1
  86. package/dist/lib/core/__internal.d.ts +37 -0
  87. package/dist/lib/core/__internal.js +26 -0
  88. package/dist/lib/core/__internal.js.map +1 -0
  89. package/dist/lib/core/plugins.d.ts +2 -1
  90. package/dist/lib/core/plugins.js.map +1 -1
  91. package/dist/lib/core/router.d.ts +1 -0
  92. package/dist/lib/core/router.js +2 -0
  93. package/dist/lib/core/router.js.map +1 -0
  94. package/dist/lib/errors/ErrorAlert.js +1 -1
  95. package/dist/lib/errors/ErrorAlert.js.map +1 -1
  96. package/dist/lib/plugins/api-keys/CreateApiKey.js +13 -3
  97. package/dist/lib/plugins/api-keys/CreateApiKey.js.map +1 -1
  98. package/dist/lib/plugins/api-keys/SettingsApiKeys.js +3 -1
  99. package/dist/lib/plugins/api-keys/SettingsApiKeys.js.map +1 -1
  100. package/dist/lib/plugins/api-keys/index.d.ts +9 -4
  101. package/dist/lib/plugins/api-keys/index.js +3 -7
  102. package/dist/lib/plugins/api-keys/index.js.map +1 -1
  103. package/dist/lib/plugins/custom-pages/index.js +3 -0
  104. package/dist/lib/plugins/custom-pages/index.js.map +1 -1
  105. package/dist/lib/plugins/openapi/Sidecar.js +1 -1
  106. package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
  107. package/dist/lib/plugins/openapi/SidecarExamples.js +1 -1
  108. package/dist/lib/plugins/openapi/SidecarExamples.js.map +1 -1
  109. package/dist/lib/plugins/openapi/graphql/gql.d.ts +1 -1
  110. package/dist/lib/plugins/openapi/graphql/gql.js +1 -1
  111. package/dist/lib/plugins/openapi/graphql/gql.js.map +1 -1
  112. package/dist/lib/plugins/openapi/graphql/graphql.d.ts +1 -0
  113. package/dist/lib/plugins/openapi/graphql/graphql.js +1 -0
  114. package/dist/lib/plugins/openapi/graphql/graphql.js.map +1 -1
  115. package/dist/lib/plugins/openapi/index.js +42 -10
  116. package/dist/lib/plugins/openapi/index.js.map +1 -1
  117. package/dist/lib/plugins/openapi/playground/PathParams.js +1 -1
  118. package/dist/lib/plugins/openapi/playground/PathParams.js.map +1 -1
  119. package/dist/lib/plugins/openapi/playground/Playground.js +4 -2
  120. package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
  121. package/dist/lib/shiki.d.ts +4 -0
  122. package/dist/lib/shiki.js +2 -0
  123. package/dist/lib/shiki.js.map +1 -1
  124. package/dist/lib/ui/ActionButton.js +1 -1
  125. package/dist/lib/ui/ActionButton.js.map +1 -1
  126. package/dist/lib/ui/Badge.d.ts +1 -1
  127. package/dist/lib/ui/Button.d.ts +2 -2
  128. package/dist/lib/ui/CodeBlock.js +30 -4
  129. package/dist/lib/ui/CodeBlock.js.map +1 -1
  130. package/dist/lib/ui/Command.d.ts +1 -1
  131. package/dist/lib/ui/Dialog.js +2 -2
  132. package/dist/lib/ui/Dialog.js.map +1 -1
  133. package/dist/lib/ui/EmbeddedCodeBlock.js +1 -1
  134. package/dist/lib/ui/EmbeddedCodeBlock.js.map +1 -1
  135. package/dist/lib/util/invariant.d.ts +6 -5
  136. package/dist/lib/util/invariant.js +1 -1
  137. package/dist/lib/util/invariant.js.map +1 -1
  138. package/dist/vite/config.js +6 -1
  139. package/dist/vite/config.js.map +1 -1
  140. package/dist/vite/dev-server.js +9 -1
  141. package/dist/vite/dev-server.js.map +1 -1
  142. package/dist/vite/mdx/remark-inject-filepath.d.ts +3 -0
  143. package/dist/vite/mdx/remark-inject-filepath.js +6 -0
  144. package/dist/vite/mdx/remark-inject-filepath.js.map +1 -0
  145. package/dist/vite/mdx/remark-link-rewrite.d.ts +2 -0
  146. package/dist/vite/mdx/remark-link-rewrite.js +20 -0
  147. package/dist/vite/mdx/remark-link-rewrite.js.map +1 -0
  148. package/dist/vite/mdx/remark-normalize-image-url.d.ts +2 -0
  149. package/dist/vite/mdx/remark-normalize-image-url.js +12 -0
  150. package/dist/vite/mdx/remark-normalize-image-url.js.map +1 -0
  151. package/dist/vite/{remarkStaticGeneration.d.ts → mdx/remark-static-generation.d.ts} +2 -2
  152. package/dist/vite/{remarkStaticGeneration.js → mdx/remark-static-generation.js} +1 -1
  153. package/dist/vite/mdx/remark-static-generation.js.map +1 -0
  154. package/dist/vite/plugin-config.d.ts +1 -1
  155. package/dist/vite/plugin-config.js +2 -1
  156. package/dist/vite/plugin-config.js.map +1 -1
  157. package/dist/vite/plugin-docs.js +18 -13
  158. package/dist/vite/plugin-docs.js.map +1 -1
  159. package/dist/vite/plugin-mdx.js +6 -23
  160. package/dist/vite/plugin-mdx.js.map +1 -1
  161. package/dist/vite/plugin-theme.js +80 -40
  162. package/dist/vite/plugin-theme.js.map +1 -1
  163. package/dist/vite/prerender/worker.js +5 -1
  164. package/dist/vite/prerender/worker.js.map +1 -1
  165. package/dist/vite/shadcn-registry.d.ts +4 -4
  166. package/dist/vite/sitemap.js +10 -9
  167. package/dist/vite/sitemap.js.map +1 -1
  168. package/lib/Button-B3o-2Xdf.js.map +1 -1
  169. package/lib/Card-CMDQUPM4.js.map +1 -1
  170. package/lib/CategoryHeading-DCpZu3yG.js +17 -0
  171. package/lib/CategoryHeading-DCpZu3yG.js.map +1 -0
  172. package/lib/ClientOnly-E7hGysn1.js.map +1 -1
  173. package/lib/CodeBlock-yJjjRwj-.js +98 -0
  174. package/lib/CodeBlock-yJjjRwj-.js.map +1 -0
  175. package/lib/{Command-C9AC5cf-.js → Command-CDn17s8X.js} +2 -2
  176. package/lib/{Command-C9AC5cf-.js.map → Command-CDn17s8X.js.map} +1 -1
  177. package/lib/Dialog-BrIjMmUK.js +114 -0
  178. package/lib/Dialog-BrIjMmUK.js.map +1 -0
  179. package/lib/{Drawer-DXGPOKPx.js → Drawer-DJ05s2pH.js} +86 -86
  180. package/lib/{Drawer-DXGPOKPx.js.map → Drawer-DJ05s2pH.js.map} +1 -1
  181. package/lib/{MdxPage-BI0vLjSn.js → MdxPage-BmOQ5m5g.js} +19 -18
  182. package/lib/{MdxPage-BI0vLjSn.js.map → MdxPage-BmOQ5m5g.js.map} +1 -1
  183. package/lib/OAuthErrorPage-Jv3r8wnL.js +150 -0
  184. package/lib/OAuthErrorPage-Jv3r8wnL.js.map +1 -0
  185. package/lib/{OasProvider-CK4C2QI3.js → OasProvider-CA_lpILt.js} +3 -3
  186. package/lib/{OasProvider-CK4C2QI3.js.map → OasProvider-CA_lpILt.js.map} +1 -1
  187. package/lib/{OperationList-DhA6x6qm.js → OperationList-C-TObVw6.js} +47 -44
  188. package/lib/OperationList-C-TObVw6.js.map +1 -0
  189. package/lib/{Pagination-YjKVdgm9.js → Pagination-CBiRGddW.js} +3 -3
  190. package/lib/{Pagination-YjKVdgm9.js.map → Pagination-CBiRGddW.js.map} +1 -1
  191. package/lib/RouteGuard-JLH6tCY8.js +56 -0
  192. package/lib/RouteGuard-JLH6tCY8.js.map +1 -0
  193. package/lib/RouterError-DcVonMP1.js +41 -0
  194. package/lib/RouterError-DcVonMP1.js.map +1 -0
  195. package/lib/{SchemaList-Cx9MS7Wf.js → SchemaList-BeYWvBC7.js} +15 -14
  196. package/lib/{SchemaList-Cx9MS7Wf.js.map → SchemaList-BeYWvBC7.js.map} +1 -1
  197. package/lib/{SchemaView-C6sTKWyS.js → SchemaView-CRcShewo.js} +4 -4
  198. package/lib/{SchemaView-C6sTKWyS.js.map → SchemaView-CRcShewo.js.map} +1 -1
  199. package/lib/Select-C3efYI1n.js +273 -0
  200. package/lib/Select-C3efYI1n.js.map +1 -0
  201. package/lib/{SignUp-DiDmVb3x.js → SignUp-CxBGHgba.js} +6 -6
  202. package/lib/{SignUp-DiDmVb3x.js.map → SignUp-CxBGHgba.js.map} +1 -1
  203. package/lib/{Slot-CrCBhP3G.js → Slot-DOtTvoyj.js} +2050 -2288
  204. package/lib/{Slot-CrCBhP3G.js.map → Slot-DOtTvoyj.js.map} +1 -1
  205. package/lib/Spinner-mNLZ6awP.js.map +1 -1
  206. package/lib/{SyntaxHighlight-CVe58ZSY.js → SyntaxHighlight-GR0eix_L.js} +411 -409
  207. package/lib/SyntaxHighlight-GR0eix_L.js.map +1 -0
  208. package/lib/{Toc-CpsFSXeD.js → Toc-BlcGIkXc.js} +2 -2
  209. package/lib/{Toc-CpsFSXeD.js.map → Toc-BlcGIkXc.js.map} +1 -1
  210. package/lib/ZudokuContext-BuJD7yIX.js +1286 -0
  211. package/lib/ZudokuContext-BuJD7yIX.js.map +1 -0
  212. package/lib/chunk-QMGIS6GS-DqecZ6nq.js +9204 -0
  213. package/lib/chunk-QMGIS6GS-DqecZ6nq.js.map +1 -0
  214. package/lib/{circular-OvXQH6UK.js → circular-CGTcsqA3.js} +2 -2
  215. package/lib/{circular-OvXQH6UK.js.map → circular-CGTcsqA3.js.map} +1 -1
  216. package/lib/cn-dYga0KKN.js.map +1 -1
  217. package/lib/{createServer-B5U_8E3S.js → createServer-DjgpuLne.js} +5 -5
  218. package/lib/{createServer-B5U_8E3S.js.map → createServer-DjgpuLne.js.map} +1 -1
  219. package/lib/errors-CrI3s7mR.js +45 -0
  220. package/lib/errors-CrI3s7mR.js.map +1 -0
  221. package/lib/hook-bv3iuX7X.js +247 -0
  222. package/lib/hook-bv3iuX7X.js.map +1 -0
  223. package/lib/index-CrcNWbel.js.map +1 -1
  224. package/lib/{index-BzcS9JBW.js → index-CvTWnHZF.js} +860 -938
  225. package/lib/index-CvTWnHZF.js.map +1 -0
  226. package/lib/index-DI5SPFK9.js.map +1 -1
  227. package/lib/index-DmNq2fbN.js.map +1 -1
  228. package/lib/index-DzO-Qh6S.js +1061 -0
  229. package/lib/index-DzO-Qh6S.js.map +1 -0
  230. package/lib/{index-4XtG1tlD.js → index-HarEI51d.js} +2 -2
  231. package/lib/{index-4XtG1tlD.js.map → index-HarEI51d.js.map} +1 -1
  232. package/lib/index.esm-BnYHxCYC.js +683 -0
  233. package/lib/index.esm-BnYHxCYC.js.map +1 -0
  234. package/lib/index.esm-CdzlRw50.js +1254 -0
  235. package/lib/index.esm-CdzlRw50.js.map +1 -0
  236. package/lib/{invariant-DAFpPywt.js → invariant-Bm-FVUQE.js} +2 -6
  237. package/lib/invariant-Bm-FVUQE.js.map +1 -0
  238. package/lib/jsx-runtime-C5mzlN2N.js.map +1 -1
  239. package/lib/mutation-Dy_5up8v.js +196 -0
  240. package/lib/mutation-Dy_5up8v.js.map +1 -0
  241. package/lib/processors/removeExtensions.js.map +1 -1
  242. package/lib/processors/removeParameters.js.map +1 -1
  243. package/lib/processors/removePaths.js.map +1 -1
  244. package/lib/processors/traverse.js.map +1 -1
  245. package/lib/ui/Accordion.js.map +1 -1
  246. package/lib/ui/ActionButton.js +9 -9
  247. package/lib/ui/ActionButton.js.map +1 -1
  248. package/lib/ui/Alert.js.map +1 -1
  249. package/lib/ui/AlertDialog.js.map +1 -1
  250. package/lib/ui/Badge.js.map +1 -1
  251. package/lib/ui/Breadcrumb.js.map +1 -1
  252. package/lib/ui/Button.js.map +1 -1
  253. package/lib/ui/Callout.js.map +1 -1
  254. package/lib/ui/Card.js.map +1 -1
  255. package/lib/ui/Carousel.js.map +1 -1
  256. package/lib/ui/Checkbox.js.map +1 -1
  257. package/lib/ui/CodeBlock.js +1 -1
  258. package/lib/ui/Command.js +1 -1
  259. package/lib/ui/Command.js.map +1 -1
  260. package/lib/ui/Dialog.js +56 -41
  261. package/lib/ui/Dialog.js.map +1 -1
  262. package/lib/ui/Drawer.js +1 -1
  263. package/lib/ui/DropdownMenu.js.map +1 -1
  264. package/lib/ui/EmbeddedCodeBlock.js +1 -1
  265. package/lib/ui/EmbeddedCodeBlock.js.map +1 -1
  266. package/lib/ui/Form.js +1 -1
  267. package/lib/ui/Form.js.map +1 -1
  268. package/lib/ui/HoverCard.js.map +1 -1
  269. package/lib/ui/Input.js.map +1 -1
  270. package/lib/ui/Label.js.map +1 -1
  271. package/lib/ui/Pagination.js.map +1 -1
  272. package/lib/ui/Popover.js.map +1 -1
  273. package/lib/ui/Progress.js.map +1 -1
  274. package/lib/ui/RadioGroup.js.map +1 -1
  275. package/lib/ui/ScrollArea.js.map +1 -1
  276. package/lib/ui/Select.js.map +1 -1
  277. package/lib/ui/Skeleton.js.map +1 -1
  278. package/lib/ui/Slider.js.map +1 -1
  279. package/lib/ui/Stepper.js.map +1 -1
  280. package/lib/ui/Switch.js.map +1 -1
  281. package/lib/ui/SyntaxHighlight.js +4 -4
  282. package/lib/ui/Tabs.js.map +1 -1
  283. package/lib/ui/Textarea.js.map +1 -1
  284. package/lib/ui/Toggle.js.map +1 -1
  285. package/lib/ui/ToggleGroup.js.map +1 -1
  286. package/lib/ui/Tooltip.js.map +1 -1
  287. package/lib/useExposedProps-BH9aq4MD.js +113 -0
  288. package/lib/useExposedProps-BH9aq4MD.js.map +1 -0
  289. package/lib/useLatest-hmRS46UF.js +11 -0
  290. package/lib/useLatest-hmRS46UF.js.map +1 -0
  291. package/lib/zudoku.__internal.js +2965 -0
  292. package/lib/zudoku.__internal.js.map +1 -0
  293. package/lib/zudoku.auth-auth0.js +1 -1
  294. package/lib/zudoku.auth-auth0.js.map +1 -1
  295. package/lib/zudoku.auth-azureb2c.js +46 -9880
  296. package/lib/zudoku.auth-azureb2c.js.map +1 -1
  297. package/lib/zudoku.auth-clerk.js +25 -22
  298. package/lib/zudoku.auth-clerk.js.map +1 -1
  299. package/lib/zudoku.auth-openid.js +204 -195
  300. package/lib/zudoku.auth-openid.js.map +1 -1
  301. package/lib/zudoku.auth-supabase.js +97 -0
  302. package/lib/zudoku.auth-supabase.js.map +1 -0
  303. package/lib/zudoku.components.js +21 -28
  304. package/lib/zudoku.components.js.map +1 -1
  305. package/lib/zudoku.hooks.js +7 -7
  306. package/lib/zudoku.hooks.js.map +1 -1
  307. package/lib/zudoku.icons.js.map +1 -1
  308. package/lib/zudoku.plugin-api-catalog.js +23 -22
  309. package/lib/zudoku.plugin-api-catalog.js.map +1 -1
  310. package/lib/zudoku.plugin-api-keys.js +410 -295
  311. package/lib/zudoku.plugin-api-keys.js.map +1 -1
  312. package/lib/zudoku.plugin-custom-pages.js +8 -5
  313. package/lib/zudoku.plugin-custom-pages.js.map +1 -1
  314. package/lib/zudoku.plugin-markdown.js +1 -1
  315. package/lib/zudoku.plugin-markdown.js.map +1 -1
  316. package/lib/zudoku.plugin-openapi.js +7 -6
  317. package/lib/zudoku.plugin-openapi.js.map +1 -1
  318. package/lib/zudoku.plugin-redirect.js +3 -3
  319. package/lib/zudoku.plugin-redirect.js.map +1 -1
  320. package/lib/zudoku.plugin-search-inkeep.js.map +1 -1
  321. package/lib/zudoku.plugin-search-pagefind.js +28 -27
  322. package/lib/zudoku.plugin-search-pagefind.js.map +1 -1
  323. package/lib/zudoku.plugins.js.map +1 -1
  324. package/lib/zudoku.router.js +123 -0
  325. package/lib/zudoku.router.js.map +1 -0
  326. package/package.json +31 -23
  327. package/src/app/demo.tsx +1 -1
  328. package/src/app/entry.client.tsx +1 -1
  329. package/src/app/entry.server.tsx +1 -1
  330. package/src/app/main.css +22 -5
  331. package/src/app/main.tsx +23 -11
  332. package/src/app/standalone.tsx +1 -1
  333. package/src/lib/authentication/components/CallbackHandler.tsx +22 -15
  334. package/src/lib/authentication/components/OAuthErrorPage.tsx +171 -0
  335. package/src/lib/authentication/errors.ts +27 -13
  336. package/src/lib/authentication/hook.ts +2 -0
  337. package/src/lib/authentication/providers/azureb2c.tsx +8 -3
  338. package/src/lib/authentication/providers/clerk.tsx +4 -1
  339. package/src/lib/authentication/providers/openid.tsx +7 -1
  340. package/src/lib/components/BuildCheck.tsx +13 -3
  341. package/src/lib/components/Header.tsx +4 -3
  342. package/src/lib/components/Heading.tsx +1 -1
  343. package/src/lib/components/Layout.tsx +2 -21
  344. package/src/lib/components/Markdown.tsx +3 -3
  345. package/src/lib/components/Meta.tsx +32 -0
  346. package/src/lib/components/MobileTopNavigation.tsx +6 -3
  347. package/src/lib/components/NotFoundPage.tsx +3 -2
  348. package/src/lib/components/TopNavigation.tsx +4 -4
  349. package/src/lib/components/Typography.tsx +1 -1
  350. package/src/lib/components/context/ZudokuContext.ts +26 -19
  351. package/src/lib/components/index.ts +0 -18
  352. package/src/lib/components/navigation/NavigationCategory.tsx +1 -1
  353. package/src/lib/components/navigation/NavigationItem.tsx +13 -3
  354. package/src/lib/components/navigation/utils.ts +21 -15
  355. package/src/lib/core/RouteGuard.tsx +13 -13
  356. package/src/lib/core/ZudokuContext.ts +37 -5
  357. package/src/lib/core/__internal.tsx +30 -0
  358. package/src/lib/core/plugins.ts +2 -1
  359. package/src/lib/core/router.ts +1 -0
  360. package/src/lib/errors/ErrorAlert.tsx +5 -7
  361. package/src/lib/plugins/api-keys/CreateApiKey.tsx +17 -3
  362. package/src/lib/plugins/api-keys/SettingsApiKeys.tsx +21 -3
  363. package/src/lib/plugins/api-keys/index.tsx +16 -11
  364. package/src/lib/plugins/custom-pages/index.tsx +3 -0
  365. package/src/lib/plugins/openapi/Sidecar.tsx +1 -1
  366. package/src/lib/plugins/openapi/SidecarExamples.tsx +1 -1
  367. package/src/lib/plugins/openapi/graphql/gql.ts +3 -3
  368. package/src/lib/plugins/openapi/graphql/graphql.ts +2 -0
  369. package/src/lib/plugins/openapi/index.tsx +66 -16
  370. package/src/lib/plugins/openapi/playground/PathParams.tsx +1 -1
  371. package/src/lib/plugins/openapi/playground/Playground.tsx +8 -2
  372. package/src/lib/shiki.ts +2 -0
  373. package/src/lib/ui/ActionButton.tsx +3 -1
  374. package/src/lib/ui/CodeBlock.tsx +38 -13
  375. package/src/lib/ui/Dialog.tsx +12 -3
  376. package/src/lib/ui/EmbeddedCodeBlock.tsx +1 -1
  377. package/src/lib/util/invariant.ts +7 -5
  378. package/src/shiki/langs/vue-vine.js +1 -0
  379. package/dist/vite/remarkStaticGeneration.js.map +0 -1
  380. package/lib/Alert-Cig_8hW6.js +0 -161
  381. package/lib/Alert-Cig_8hW6.js.map +0 -1
  382. package/lib/CodeBlock-BaBgX9Wy.js +0 -85
  383. package/lib/CodeBlock-BaBgX9Wy.js.map +0 -1
  384. package/lib/Dialog-DMWw1doX.js +0 -99
  385. package/lib/Dialog-DMWw1doX.js.map +0 -1
  386. package/lib/OperationList-DhA6x6qm.js.map +0 -1
  387. package/lib/RouteGuard-Vnlz_t51.js +0 -737
  388. package/lib/RouteGuard-Vnlz_t51.js.map +0 -1
  389. package/lib/SyntaxHighlight-CVe58ZSY.js.map +0 -1
  390. package/lib/chunk-DQRVZFIR-DHK7_Ilc.js +0 -1839
  391. package/lib/chunk-DQRVZFIR-DHK7_Ilc.js.map +0 -1
  392. package/lib/clerk-BDZ31hjU.js +0 -25190
  393. package/lib/clerk-BDZ31hjU.js.map +0 -1
  394. package/lib/errors-DOCWNkkS.js +0 -78
  395. package/lib/errors-DOCWNkkS.js.map +0 -1
  396. package/lib/hook-CZjW2buS.js +0 -1510
  397. package/lib/hook-CZjW2buS.js.map +0 -1
  398. package/lib/index-Bm35Tkgf.js +0 -107
  399. package/lib/index-Bm35Tkgf.js.map +0 -1
  400. package/lib/index-BzcS9JBW.js.map +0 -1
  401. package/lib/index-Sb7nQNHJ.js +0 -3980
  402. package/lib/index-Sb7nQNHJ.js.map +0 -1
  403. package/lib/index.esm-Cp4wkyud.js +0 -1236
  404. package/lib/index.esm-Cp4wkyud.js.map +0 -1
  405. package/lib/invariant-DAFpPywt.js.map +0 -1
  406. package/lib/useExposedProps-BIYjecPD.js +0 -9
  407. package/lib/useExposedProps-BIYjecPD.js.map +0 -1
package/src/app/main.css CHANGED
@@ -121,6 +121,10 @@
121
121
  .shiki {
122
122
  counter-reset: line;
123
123
  @apply leading-normal;
124
+ background-color: var(--shiki-light-bg) !important;
125
+ }
126
+ .dark .shiki {
127
+ background-color: var(--shiki-dark-bg) !important;
124
128
  }
125
129
  .code-block .shiki {
126
130
  @apply grid grid-rows-1;
@@ -149,17 +153,30 @@
149
153
  @apply tabular-nums inline-flex items-baseline justify-end me-4 w-3 text-muted-foreground/25;
150
154
  }
151
155
 
152
- .shiki.not-inline .line {
156
+ .light .shiki.not-inline .line {
153
157
  @apply block -mx-4 px-4 w-[calc(100%+2rem)];
154
- --highlighted-bg: hsl(
155
- from var(--muted) h s calc(l + 4 * var(--dark)) / 50%
156
- );
158
+ --highlighted-bg: hsl(from var(--shiki-light-bg) h s calc(l - 6));
157
159
  }
160
+ .dark .shiki.not-inline .line {
161
+ @apply block -mx-4 px-4 w-[calc(100%+2rem)];
162
+ --highlighted-bg: hsl(from var(--shiki-dark-bg) h s calc(l + 10));
163
+ }
164
+
158
165
  .shiki .line.highlighted {
159
- @apply bg-(--highlighted-bg);
166
+ @apply bg-(--highlighted-bg) relative;
167
+ }
168
+
169
+ .shiki .line.highlighted::after {
170
+ @apply absolute left-0 top-0 bottom-0 right-auto translate-x-full content-[''];
171
+ border-left: 3px solid
172
+ hsl(from var(--highlighted-bg) h s calc(l + 4 * var(--dark)));
160
173
  }
161
174
 
162
175
  .shiki .highlighted-word {
176
+ --highlighted-bg: hsl(
177
+ from var(--muted) h s calc(l + 4 * var(--dark)) / 50%
178
+ );
179
+
163
180
  @apply bg-(--highlighted-bg) px-0.5 rounded;
164
181
  box-shadow: 0 0 0 4px var(--highlighted-bg);
165
182
  }
package/src/app/main.tsx CHANGED
@@ -1,4 +1,4 @@
1
- import { type RouteObject } from "react-router";
1
+ import type { RouteObject } from "react-router";
2
2
  import { configuredApiKeysPlugin } from "virtual:zudoku-api-keys-plugin";
3
3
  import {
4
4
  configuredApiCatalogPlugins,
@@ -15,11 +15,13 @@ import "virtual:zudoku-theme.css";
15
15
  import {
16
16
  BuildCheck,
17
17
  Layout,
18
+ Meta,
18
19
  RouteGuard,
19
20
  RouterError,
20
21
  StatusPage,
21
- Zudoku,
22
- } from "zudoku/components";
22
+ } from "zudoku/__internal";
23
+ import { Zudoku } from "zudoku/components";
24
+ import { Outlet } from "zudoku/router";
23
25
  import type { ZudokuConfig } from "../config/config.js";
24
26
  import type { ZudokuContextOptions } from "../lib/core/ZudokuContext.js";
25
27
  import { isNavigationPlugin } from "../lib/core/plugins.js";
@@ -107,23 +109,33 @@ export const getRoutesByConfig = (config: ZudokuConfig): RouteObject[] => {
107
109
  element: (
108
110
  <Zudoku {...options}>
109
111
  <BuildCheck
110
- buildId={
111
- import.meta.env.IS_ZUPLO && import.meta.env.ZUPLO_BUILD_ID
112
- ? import.meta.env.ZUPLO_BUILD_ID
113
- : undefined
114
- }
112
+ buildId={import.meta.env.ZUPLO_BUILD_ID}
113
+ environmentType={import.meta.env.ZUPLO_ENVIRONMENT_TYPE}
115
114
  />
116
- <Layout />
115
+ <Outlet />
117
116
  </Zudoku>
118
117
  ),
119
118
  hydrateFallbackElement: <div>Loading...</div>,
120
119
  children: [
121
120
  {
122
- element: <RouteGuard />,
121
+ element: (
122
+ <Meta>
123
+ <RouteGuard />
124
+ </Meta>
125
+ ),
123
126
  errorElement: <RouterError />,
124
- children: routes,
127
+ children: routes.map((r) =>
128
+ r.handle?.layout === "none" ? r : wrapWithLayout(r),
129
+ ),
125
130
  },
126
131
  ],
127
132
  },
128
133
  ];
129
134
  };
135
+
136
+ const wrapWithLayout = (route: RouteObject) => {
137
+ return {
138
+ element: <Layout />,
139
+ children: [route],
140
+ };
141
+ };
@@ -1,6 +1,6 @@
1
1
  import { createRoot } from "react-dom/client";
2
2
  import { createBrowserRouter } from "react-router";
3
- import { Bootstrap } from "zudoku/components";
3
+ import { Bootstrap } from "zudoku/__internal";
4
4
  import type { ZudokuConfig } from "../config/validators/validate.js";
5
5
  import { openApiPlugin } from "../lib/plugins/openapi/index.js";
6
6
  import "../lib/util/logInit.js";
@@ -1,9 +1,9 @@
1
1
  import { useSuspenseQuery } from "@tanstack/react-query";
2
2
  import { Navigate } from "react-router";
3
3
  import { useZudoku } from "zudoku/components";
4
- import { ZudokuError } from "../../util/invariant.js";
5
4
  import { joinUrl } from "../../util/joinUrl.js";
6
5
  import { normalizeRedirectUrl } from "../../util/url.js";
6
+ import { OAuthAuthorizationError, type OAuthErrorType } from "../errors.js";
7
7
 
8
8
  export function CallbackHandler({
9
9
  handleCallback,
@@ -15,22 +15,29 @@ export function CallbackHandler({
15
15
  retry: false,
16
16
  queryKey: ["oauth-callback"],
17
17
  queryFn: async () => {
18
- try {
19
- return joinUrl(
20
- normalizeRedirectUrl(
21
- await handleCallback(),
22
- window.location.origin,
23
- options.basePath,
24
- ),
18
+ const url = new URL(window.location.href);
19
+
20
+ const errorParam = url.searchParams.get("error");
21
+ const errorDescription =
22
+ url.searchParams.get("error_description") ?? undefined;
23
+ const errorUri = url.searchParams.get("error_uri") ?? undefined;
24
+ if (errorParam) {
25
+ throw new OAuthAuthorizationError(
26
+ `OAuth error '${errorParam}': ${errorDescription}`,
27
+ {
28
+ error: errorParam as OAuthErrorType,
29
+ error_description: errorDescription,
30
+ error_uri: errorUri,
31
+ },
25
32
  );
26
- } catch (error) {
27
- throw new ZudokuError("Could not validate user", {
28
- cause: error,
29
- title: "Authentication Error",
30
- developerHint:
31
- "Check the configuration of your authorization provider and ensure all settings such as the callback URL are configured correctly.",
32
- });
33
33
  }
34
+ return joinUrl(
35
+ normalizeRedirectUrl(
36
+ await handleCallback(),
37
+ window.location.origin,
38
+ options.basePath,
39
+ ),
40
+ );
34
41
  },
35
42
  });
36
43
 
@@ -0,0 +1,171 @@
1
+ import { HomeIcon } from "lucide-react";
2
+ import { Link } from "react-router";
3
+ import { Heading } from "../../components/Heading.js";
4
+ import { Typography } from "../../components/Typography.js";
5
+ import { Button } from "../../ui/Button.js";
6
+ import { OAuthAuthorizationError } from "../errors.js";
7
+ import { useAuth } from "../hook.js";
8
+
9
+ const errorDetailsMap: Record<string, { message: string }> = {
10
+ invalid_request: {
11
+ message:
12
+ "The authentication request was invalid. Please try signing in again.",
13
+ },
14
+ unauthorized_client: {
15
+ message:
16
+ "This application is not authorized to access your account. Please contact support.",
17
+ },
18
+ access_denied: {
19
+ message:
20
+ "You denied access to this application. To continue, please sign in and grant access.",
21
+ },
22
+ unsupported_response_type: {
23
+ message:
24
+ "The authentication method is not supported. Please contact support.",
25
+ },
26
+ invalid_scope: {
27
+ message: "The requested permissions are invalid. Please contact support.",
28
+ },
29
+ server_error: {
30
+ message:
31
+ "The authentication server encountered an error. Please try again in a few moments.",
32
+ },
33
+ temporarily_unavailable: {
34
+ message:
35
+ "The authentication service is temporarily unavailable. Please try again in a few moments.",
36
+ },
37
+ // Token errors
38
+ invalid_client: {
39
+ message: "Invalid application credentials. Please contact support.",
40
+ },
41
+ invalid_grant: {
42
+ message:
43
+ "The authentication code has expired or is invalid. Please sign in again.",
44
+ },
45
+ unsupported_grant_type: {
46
+ message:
47
+ "The authentication method is not supported. Please contact support.",
48
+ },
49
+ // Custom errors
50
+ invalid_state: {
51
+ message:
52
+ "Security validation failed. This may be due to a potential security attack. Please try signing in again.",
53
+ },
54
+ missing_code_verifier: {
55
+ message:
56
+ "Authentication security information is missing. Please clear your browser cache and try again.",
57
+ },
58
+ network_error: {
59
+ message:
60
+ "A network error occurred during authentication. Please check your connection and try again.",
61
+ },
62
+ token_expired: {
63
+ message: "Your authentication session has expired. Please sign in again.",
64
+ },
65
+ configuration_error: {
66
+ message:
67
+ "There is an issue with the authentication configuration. Please contact support.",
68
+ },
69
+ unknown_error: {
70
+ message:
71
+ "An unexpected error occurred during authentication. Please try again or contact support.",
72
+ },
73
+ };
74
+
75
+ export function OAuthErrorPage({ error }: { error: any }) {
76
+ const { login } = useAuth();
77
+
78
+ if (!(error instanceof OAuthAuthorizationError)) {
79
+ throw error;
80
+ }
81
+
82
+ const oauthError = error.error;
83
+ const type = oauthError.error;
84
+
85
+ const details = errorDetailsMap[type] ?? errorDetailsMap.unknown_error;
86
+
87
+ return (
88
+ <div className="min-h-[400px] flex items-center justify-center p-4">
89
+ <div className="max-w-md w-full text-center space-y-6">
90
+ <div className="space-y-4 items-center">
91
+ <Heading level={2} className="text-2xl inline-block font-bold">
92
+ {titles[type] || "Authentication Error"}
93
+ </Heading>
94
+
95
+ <Typography className="text-gray-600 dark:text-gray-300 leading-relaxed">
96
+ {details?.message}
97
+ </Typography>
98
+
99
+ {/* Technical details for developers (only in development) */}
100
+ </div>
101
+
102
+ {/* Action Buttons */}
103
+ <div className="space-y-3 pt-4">
104
+ <div className="space-y-2">
105
+ {(type === "access_denied" ||
106
+ type === "invalid_grant" ||
107
+ type === "token_expired") && (
108
+ <Button
109
+ onClick={login}
110
+ className="w-full capitalize"
111
+ variant={"default"}
112
+ >
113
+ Sign in again
114
+ </Button>
115
+ )}
116
+ </div>
117
+
118
+ <div className="flex gap-2">
119
+ <Button asChild className="flex-1" variant="outline">
120
+ <Link to="/">
121
+ <HomeIcon className="w-4 h-4 mr-2" />
122
+ Go Home
123
+ </Link>
124
+ </Button>
125
+ </div>
126
+ </div>
127
+
128
+ {/* Additional Help */}
129
+ {helpMessages[type] && (
130
+ <Typography className="text-sm text-gray-500 dark:text-gray-400">
131
+ {helpMessages[type]}
132
+ </Typography>
133
+ )}
134
+ </div>
135
+ </div>
136
+ );
137
+ }
138
+
139
+ const titles: Record<string, string> = {
140
+ access_denied: "Access Denied",
141
+ invalid_request: "Invalid Request",
142
+ unauthorized_client: "Unauthorized Application",
143
+ unsupported_response_type: "Unsupported Method",
144
+ invalid_scope: "Invalid Permissions",
145
+ server_error: "Server Error",
146
+ temporarily_unavailable: "Service Unavailable",
147
+ invalid_client: "Invalid Credentials",
148
+ invalid_grant: "Authentication Expired",
149
+ unsupported_grant_type: "Unsupported Authentication",
150
+ invalid_state: "Security Check Failed",
151
+ missing_code_verifier: "Security Information Missing",
152
+ network_error: "Network Error",
153
+ token_expired: "Session Expired",
154
+ configuration_error: "Configuration Error",
155
+ unknown_error: "Authentication Failed",
156
+ };
157
+
158
+ const helpMessages: Record<string, string> = {
159
+ access_denied:
160
+ "If you changed your mind, you can try signing in again to grant access.",
161
+ invalid_state:
162
+ "This error can occur if you have multiple tabs open or if your session was compromised.",
163
+ missing_code_verifier:
164
+ "Try clearing your browser's cache and cookies for this site.",
165
+ network_error:
166
+ "Check your internet connection and ensure you can access other websites.",
167
+ server_error:
168
+ "The issue is on our end. Our team has been notified and is working to fix it.",
169
+ temporarily_unavailable:
170
+ "This is usually temporary. Try again in a few minutes.",
171
+ };
@@ -1,21 +1,35 @@
1
- export class AuthorizationError extends Error {}
1
+ import type { OAuth2Error } from "oauth4webapi";
2
+ import { ZudokuError, type ZudokuErrorOptions } from "../util/invariant.js";
2
3
 
3
- interface OAuthError {
4
- readonly error: string;
5
- readonly error_description?: string;
6
- readonly error_uri?: string;
7
- readonly algs?: string;
8
- readonly scope?: string;
9
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
10
- readonly [parameter: string]: any | undefined;
11
- }
4
+ export class AuthorizationError extends Error {}
12
5
 
13
- export class OAuthAuthorizationError extends AuthorizationError {
6
+ export class OAuthAuthorizationError extends ZudokuError {
14
7
  constructor(
15
8
  message: string,
16
- public error: OAuthError,
17
- options?: ErrorOptions,
9
+ public error: OAuth2Error,
10
+ options?: ZudokuErrorOptions,
18
11
  ) {
19
12
  super(message, options);
20
13
  }
21
14
  }
15
+
16
+ export type OAuthErrorType =
17
+ // Authorization errors
18
+ | "invalid_request"
19
+ | "unauthorized_client"
20
+ | "access_denied"
21
+ | "unsupported_response_type"
22
+ | "invalid_scope"
23
+ | "server_error"
24
+ | "temporarily_unavailable"
25
+ // Token errors
26
+ | "invalid_client"
27
+ | "invalid_grant"
28
+ | "unsupported_grant_type"
29
+ // Custom errors
30
+ | "invalid_state"
31
+ | "missing_code_verifier"
32
+ | "network_error"
33
+ | "token_expired"
34
+ | "configuration_error"
35
+ | "unknown_error";
@@ -1,6 +1,8 @@
1
1
  import { useZudoku } from "../components/context/ZudokuContext.js";
2
2
  import { useAuthState } from "./state.js";
3
3
 
4
+ export type UseAuthReturn = ReturnType<typeof useAuth>;
5
+
4
6
  export const useAuth = () => {
5
7
  const { authentication } = useZudoku();
6
8
  const authState = useAuthState();
@@ -1,5 +1,6 @@
1
1
  import type { AuthenticationResult, EventMessage } from "@azure/msal-browser";
2
2
  import { EventType, PublicClientApplication } from "@azure/msal-browser";
3
+ import { ErrorBoundary } from "react-error-boundary";
3
4
  import { type AzureB2CAuthenticationConfig } from "../../../config/config.js";
4
5
  import { ClientOnly } from "../../components/ClientOnly.js";
5
6
  import { joinUrl } from "../../util/joinUrl.js";
@@ -7,12 +8,12 @@ import {
7
8
  type AuthenticationPlugin,
8
9
  type AuthenticationProviderInitializer,
9
10
  } from "../authentication.js";
11
+ import { CoreAuthenticationPlugin } from "../AuthenticationPlugin.js";
10
12
  import { CallbackHandler } from "../components/CallbackHandler.js";
13
+ import { OAuthErrorPage } from "../components/OAuthErrorPage.js";
11
14
  import { AuthorizationError } from "../errors.js";
12
15
  import { useAuthState } from "../state.js";
13
16
 
14
- import { CoreAuthenticationPlugin } from "../AuthenticationPlugin.js";
15
-
16
17
  const AZUREB2C_CALLBACK_PATH = "/oauth/callback";
17
18
 
18
19
  export class AzureB2CAuthPlugin
@@ -181,7 +182,11 @@ export class AzureB2CAuthPlugin
181
182
  path: AZUREB2C_CALLBACK_PATH,
182
183
  element: (
183
184
  <ClientOnly>
184
- <CallbackHandler handleCallback={this.handleCallback} />
185
+ <ErrorBoundary
186
+ fallbackRender={({ error }) => <OAuthErrorPage error={error} />}
187
+ >
188
+ <CallbackHandler handleCallback={this.handleCallback} />
189
+ </ErrorBoundary>
185
190
  </ClientOnly>
186
191
  ),
187
192
  },
@@ -15,6 +15,7 @@ const clerkAuth: AuthenticationProviderInitializer<
15
15
  ClerkAuthenticationConfig
16
16
  > = ({
17
17
  clerkPubKey,
18
+ jwtTemplateName,
18
19
  redirectToAfterSignOut = "/",
19
20
  redirectToAfterSignUp,
20
21
  redirectToAfterSignIn,
@@ -61,7 +62,9 @@ const clerkAuth: AuthenticationProviderInitializer<
61
62
  if (!clerkApi?.session) {
62
63
  throw new Error("No session available");
63
64
  }
64
- const response = await clerkApi.session.getToken();
65
+ const response = await clerkApi.session.getToken({
66
+ template: jwtTemplateName,
67
+ });
65
68
  if (!response) {
66
69
  throw new Error("Could not get access token from Clerk");
67
70
  }
@@ -1,5 +1,6 @@
1
1
  import logger from "loglevel";
2
2
  import * as oauth from "oauth4webapi";
3
+ import { ErrorBoundary } from "react-error-boundary";
3
4
  import { type OpenIDAuthenticationConfig } from "../../../config/config.js";
4
5
  import { ClientOnly } from "../../components/ClientOnly.js";
5
6
  import { joinUrl } from "../../util/joinUrl.js";
@@ -9,6 +10,7 @@ import {
9
10
  } from "../authentication.js";
10
11
  import { CoreAuthenticationPlugin } from "../AuthenticationPlugin.js";
11
12
  import { CallbackHandler } from "../components/CallbackHandler.js";
13
+ import { OAuthErrorPage } from "../components/OAuthErrorPage.js";
12
14
  import { AuthorizationError, OAuthAuthorizationError } from "../errors.js";
13
15
  import { useAuthState, type UserProfile } from "../state.js";
14
16
 
@@ -442,7 +444,11 @@ export class OpenIDAuthenticationProvider
442
444
  path: OPENID_CALLBACK_PATH,
443
445
  element: (
444
446
  <ClientOnly>
445
- <CallbackHandler handleCallback={this.handleCallback} />
447
+ <ErrorBoundary
448
+ fallbackRender={({ error }) => <OAuthErrorPage error={error} />}
449
+ >
450
+ <CallbackHandler handleCallback={this.handleCallback} />
451
+ </ErrorBoundary>
446
452
  </ClientOnly>
447
453
  ),
448
454
  },
@@ -1,5 +1,6 @@
1
1
  import { useQuery } from "@tanstack/react-query";
2
2
  import { CircleFadingArrowUpIcon, LoaderCircleIcon } from "lucide-react";
3
+ import { useEffect } from "react";
3
4
  import { z } from "zod/v4";
4
5
  import { Button } from "../ui/Button.js";
5
6
 
@@ -11,17 +12,17 @@ const BuildStatusSchema = z.object({
11
12
 
12
13
  export const BuildCheck = ({
13
14
  buildId,
15
+ environmentType,
14
16
  endpoint = "/__zuplo/docs",
15
17
  }: {
16
18
  buildId?: string;
19
+ environmentType?: string;
17
20
  endpoint?: string;
18
21
  }) => {
19
22
  const buildStatusQuery = useQuery({
20
23
  queryKey: ["zuplo-build-check", buildId, endpoint],
21
24
  refetchInterval: 3000,
22
- enabled:
23
- typeof buildId !== "undefined" &&
24
- import.meta.env.ZUPLO_ENVIRONMENT_TYPE === "WORKING_COPY",
25
+ enabled: buildId !== undefined && environmentType === "WORKING_COPY",
25
26
  retry: false,
26
27
  queryFn: () =>
27
28
  fetch(endpoint, { signal: AbortSignal.timeout(2000) })
@@ -32,6 +33,15 @@ export const BuildCheck = ({
32
33
  .then((data) => BuildStatusSchema.parse(data)),
33
34
  });
34
35
 
36
+ useEffect(() => {
37
+ if (
38
+ buildStatusQuery.data?.status === "success" &&
39
+ buildStatusQuery.data.buildId
40
+ ) {
41
+ document.cookie = `zuplo-build=${buildStatusQuery.data.buildId}; path=/; max-age=300; secure; SameSite=None`;
42
+ }
43
+ }, [buildStatusQuery.data]);
44
+
35
45
  if (
36
46
  buildStatusQuery.isError ||
37
47
  !buildStatusQuery.data ||
@@ -90,9 +90,9 @@ export const Header = memo(function HeaderInner() {
90
90
  <PageProgress />
91
91
  <div className="max-w-screen-2xl mx-auto flex items-center justify-between h-(--top-header-height) px-4 lg:px-8 border-transparent">
92
92
  <div className="flex">
93
- <Link to="/">
93
+ <Link to={site?.logo?.href ?? "/"}>
94
94
  <div className="flex items-center gap-3.5">
95
- {site?.logo && (
95
+ {site?.logo ? (
96
96
  <>
97
97
  <img
98
98
  src={logoLightSrc}
@@ -109,8 +109,9 @@ export const Header = memo(function HeaderInner() {
109
109
  loading="lazy"
110
110
  />
111
111
  </>
112
+ ) : (
113
+ <span className="font-semibold text-2xl">{site?.title}</span>
112
114
  )}
113
- <span className="font-semibold text-2xl">{site?.title}</span>
114
115
  </div>
115
116
  </Link>
116
117
  </div>
@@ -66,7 +66,7 @@ export const Heading = ({
66
66
  return (
67
67
  <Component
68
68
  className={heading({
69
- className: cn(className, "flex items-center gap-[0.33em]"),
69
+ className: cn("flex items-center gap-[0.33em]", className),
70
70
  level,
71
71
  })}
72
72
  ref={registerNavigationAnchor ? ref : undefined}
@@ -1,8 +1,6 @@
1
- import { Helmet } from "@zudoku/react-helmet-async";
2
1
  import { Suspense, useEffect, type ReactNode } from "react";
3
- import { Outlet, useLocation } from "react-router";
2
+ import { Outlet } from "react-router";
4
3
  import { cn } from "../util/cn.js";
5
- import { joinUrl } from "../util/joinUrl.js";
6
4
  import { useScrollToAnchor } from "../util/useScrollToAnchor.js";
7
5
  import { useScrollToTop } from "../util/useScrollToTop.js";
8
6
  import { useZudoku } from "./context/ZudokuContext.js";
@@ -19,8 +17,7 @@ const LoadingFallback = () => (
19
17
  );
20
18
 
21
19
  export const Layout = ({ children }: { children?: ReactNode }) => {
22
- const { meta, authentication, options } = useZudoku();
23
- const location = useLocation();
20
+ const { authentication } = useZudoku();
24
21
 
25
22
  useScrollToAnchor();
26
23
  useScrollToTop();
@@ -32,22 +29,6 @@ export const Layout = ({ children }: { children?: ReactNode }) => {
32
29
 
33
30
  return (
34
31
  <>
35
- <Helmet titleTemplate={meta?.title}>
36
- {options.canonicalUrlOrigin && (
37
- <link
38
- rel="canonical"
39
- href={joinUrl(
40
- options.canonicalUrlOrigin,
41
- options.basePath,
42
- location.pathname,
43
- )}
44
- />
45
- )}
46
- {meta?.description && (
47
- <meta name="description" content={meta.description} />
48
- )}
49
- {meta?.favicon && <link rel="icon" href={meta.favicon} />}
50
- </Helmet>
51
32
  <Slot.Target name="layout-before-head" />
52
33
  <Header />
53
34
  <Slot.Target name="layout-after-head" />
@@ -1,5 +1,5 @@
1
1
  import { memo, useMemo } from "react";
2
- import { MarkdownHooks, type Components } from "react-markdown";
2
+ import ReactMarkdown, { type Components } from "react-markdown";
3
3
  import rehypeRaw from "rehype-raw";
4
4
  import remarkGfm from "remark-gfm";
5
5
  import { createConfiguredShikiRehypePlugins } from "../shiki.js";
@@ -35,13 +35,13 @@ export const Markdown = memo(
35
35
 
36
36
  return (
37
37
  <Typography className={className}>
38
- <MarkdownHooks
38
+ <ReactMarkdown
39
39
  remarkPlugins={remarkPlugins}
40
40
  rehypePlugins={rehypePlugins}
41
41
  components={mdComponents}
42
42
  >
43
43
  {content}
44
- </MarkdownHooks>
44
+ </ReactMarkdown>
45
45
  </Typography>
46
46
  );
47
47
  },
@@ -0,0 +1,32 @@
1
+ import { Helmet } from "@zudoku/react-helmet-async";
2
+ import type { PropsWithChildren } from "react";
3
+ import { useLocation } from "react-router";
4
+ import { joinUrl } from "../util/joinUrl.js";
5
+ import { useZudoku } from "./context/ZudokuContext.js";
6
+
7
+ export const Meta = ({ children }: PropsWithChildren) => {
8
+ const { meta, options } = useZudoku();
9
+ const location = useLocation();
10
+
11
+ return (
12
+ <>
13
+ <Helmet titleTemplate={meta?.title} defaultTitle={meta?.defaultTitle}>
14
+ {options.canonicalUrlOrigin && (
15
+ <link
16
+ rel="canonical"
17
+ href={joinUrl(
18
+ options.canonicalUrlOrigin,
19
+ options.basePath,
20
+ location.pathname,
21
+ )}
22
+ />
23
+ )}
24
+ {meta?.description && (
25
+ <meta name="description" content={meta.description} />
26
+ )}
27
+ {meta?.favicon && <link rel="icon" href={meta.favicon} />}
28
+ </Helmet>
29
+ {children}
30
+ </>
31
+ );
32
+ };