zudoku 0.0.0-f40ea27 → 0.0.0-f42e3678

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 (420) hide show
  1. package/README.md +2 -2
  2. package/dist/app/demo.js +16 -1
  3. package/dist/app/demo.js.map +1 -1
  4. package/dist/app/main.js +3 -9
  5. package/dist/app/main.js.map +1 -1
  6. package/dist/cli/build/handler.js +9 -1
  7. package/dist/cli/build/handler.js.map +1 -1
  8. package/dist/config/config.d.ts +1 -0
  9. package/dist/config/loader.js +2 -5
  10. package/dist/config/loader.js.map +1 -1
  11. package/dist/config/validators/BuildSchema.js +5 -0
  12. package/dist/config/validators/BuildSchema.js.map +1 -1
  13. package/dist/config/validators/InputNavigationSchema.d.ts +254 -163
  14. package/dist/config/validators/InputNavigationSchema.js +4 -4
  15. package/dist/config/validators/InputNavigationSchema.js.map +1 -1
  16. package/dist/config/validators/InputNavigationSchema.test-d.js +0 -1
  17. package/dist/config/validators/InputNavigationSchema.test-d.js.map +1 -1
  18. package/dist/config/validators/NavigationSchema.js +3 -2
  19. package/dist/config/validators/NavigationSchema.js.map +1 -1
  20. package/dist/config/validators/ProtectedRoutesSchema.d.ts +12 -0
  21. package/dist/config/validators/ProtectedRoutesSchema.js +19 -0
  22. package/dist/config/validators/ProtectedRoutesSchema.js.map +1 -0
  23. package/dist/config/validators/icon-types.d.ts +1 -1
  24. package/dist/config/validators/icon-types.js +16 -0
  25. package/dist/config/validators/icon-types.js.map +1 -1
  26. package/dist/config/validators/validate.d.ts +36 -20
  27. package/dist/config/validators/validate.js +18 -4
  28. package/dist/config/validators/validate.js.map +1 -1
  29. package/dist/config/validators/validate.test.js +65 -2
  30. package/dist/config/validators/validate.test.js.map +1 -1
  31. package/dist/flat-config.d.ts +8 -6
  32. package/dist/lib/authentication/authentication.d.ts +2 -0
  33. package/dist/lib/authentication/components/CallbackHandler.js +11 -9
  34. package/dist/lib/authentication/components/CallbackHandler.js.map +1 -1
  35. package/dist/lib/authentication/components/OAuthErrorPage.d.ts +3 -0
  36. package/dist/lib/authentication/components/OAuthErrorPage.js +99 -0
  37. package/dist/lib/authentication/components/OAuthErrorPage.js.map +1 -0
  38. package/dist/lib/authentication/components/SignIn.js +4 -3
  39. package/dist/lib/authentication/components/SignIn.js.map +1 -1
  40. package/dist/lib/authentication/errors.d.ts +6 -12
  41. package/dist/lib/authentication/errors.js +2 -1
  42. package/dist/lib/authentication/errors.js.map +1 -1
  43. package/dist/lib/authentication/hook.d.ts +1 -0
  44. package/dist/lib/authentication/hook.js.map +1 -1
  45. package/dist/lib/authentication/providers/azureb2c.js +4 -2
  46. package/dist/lib/authentication/providers/azureb2c.js.map +1 -1
  47. package/dist/lib/authentication/providers/clerk.js +4 -2
  48. package/dist/lib/authentication/providers/clerk.js.map +1 -1
  49. package/dist/lib/authentication/providers/openid.d.ts +4 -2
  50. package/dist/lib/authentication/providers/openid.js +14 -6
  51. package/dist/lib/authentication/providers/openid.js.map +1 -1
  52. package/dist/lib/components/Banner.js +1 -1
  53. package/dist/lib/components/Banner.js.map +1 -1
  54. package/dist/lib/components/CategoryHeading.js +1 -1
  55. package/dist/lib/components/CategoryHeading.js.map +1 -1
  56. package/dist/lib/components/Header.js +1 -1
  57. package/dist/lib/components/Header.js.map +1 -1
  58. package/dist/lib/components/Heading.js +1 -1
  59. package/dist/lib/components/Heading.js.map +1 -1
  60. package/dist/lib/components/Markdown.js +2 -2
  61. package/dist/lib/components/Markdown.js.map +1 -1
  62. package/dist/lib/components/MobileTopNavigation.js +11 -6
  63. package/dist/lib/components/MobileTopNavigation.js.map +1 -1
  64. package/dist/lib/components/NotFoundPage.js +1 -1
  65. package/dist/lib/components/NotFoundPage.js.map +1 -1
  66. package/dist/lib/components/Pagination.js +1 -1
  67. package/dist/lib/components/Pagination.js.map +1 -1
  68. package/dist/lib/components/StatusPage.js +4 -0
  69. package/dist/lib/components/StatusPage.js.map +1 -1
  70. package/dist/lib/components/TopNavigation.d.ts +5 -0
  71. package/dist/lib/components/TopNavigation.js +20 -15
  72. package/dist/lib/components/TopNavigation.js.map +1 -1
  73. package/dist/lib/components/Typography.d.ts +1 -1
  74. package/dist/lib/components/Typography.js +1 -1
  75. package/dist/lib/components/Typography.js.map +1 -1
  76. package/dist/lib/components/context/ZudokuContext.js +21 -13
  77. package/dist/lib/components/context/ZudokuContext.js.map +1 -1
  78. package/dist/lib/components/navigation/NavigationItem.d.ts +1 -1
  79. package/dist/lib/components/navigation/NavigationItem.js +8 -1
  80. package/dist/lib/components/navigation/NavigationItem.js.map +1 -1
  81. package/dist/lib/components/navigation/NavigationWrapper.js +1 -1
  82. package/dist/lib/components/navigation/NavigationWrapper.js.map +1 -1
  83. package/dist/lib/components/navigation/utils.d.ts +3 -1
  84. package/dist/lib/components/navigation/utils.js +6 -3
  85. package/dist/lib/components/navigation/utils.js.map +1 -1
  86. package/dist/lib/core/RouteGuard.js +9 -9
  87. package/dist/lib/core/RouteGuard.js.map +1 -1
  88. package/dist/lib/core/ZudokuContext.d.ts +5 -2
  89. package/dist/lib/core/ZudokuContext.js +27 -2
  90. package/dist/lib/core/ZudokuContext.js.map +1 -1
  91. package/dist/lib/core/plugins.d.ts +2 -1
  92. package/dist/lib/core/plugins.js.map +1 -1
  93. package/dist/lib/errors/ErrorAlert.js +1 -1
  94. package/dist/lib/errors/ErrorAlert.js.map +1 -1
  95. package/dist/lib/plugins/api-keys/CreateApiKey.js +7 -3
  96. package/dist/lib/plugins/api-keys/CreateApiKey.js.map +1 -1
  97. package/dist/lib/plugins/api-keys/SettingsApiKeys.js +6 -4
  98. package/dist/lib/plugins/api-keys/SettingsApiKeys.js.map +1 -1
  99. package/dist/lib/plugins/api-keys/index.d.ts +1 -0
  100. package/dist/lib/plugins/api-keys/index.js +4 -8
  101. package/dist/lib/plugins/api-keys/index.js.map +1 -1
  102. package/dist/lib/plugins/markdown/MdxPage.js +4 -3
  103. package/dist/lib/plugins/markdown/MdxPage.js.map +1 -1
  104. package/dist/lib/plugins/openapi/OperationList.js +2 -1
  105. package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
  106. package/dist/lib/plugins/openapi/Sidecar.js +1 -1
  107. package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
  108. package/dist/lib/plugins/openapi/SidecarExamples.js +1 -1
  109. package/dist/lib/plugins/openapi/SidecarExamples.js.map +1 -1
  110. package/dist/lib/plugins/openapi/graphql/gql.d.ts +1 -1
  111. package/dist/lib/plugins/openapi/graphql/gql.js +1 -1
  112. package/dist/lib/plugins/openapi/graphql/gql.js.map +1 -1
  113. package/dist/lib/plugins/openapi/graphql/graphql.d.ts +1 -0
  114. package/dist/lib/plugins/openapi/graphql/graphql.js +1 -0
  115. package/dist/lib/plugins/openapi/graphql/graphql.js.map +1 -1
  116. package/dist/lib/plugins/openapi/index.js +43 -11
  117. package/dist/lib/plugins/openapi/index.js.map +1 -1
  118. package/dist/lib/plugins/openapi/playground/PathParams.js +1 -1
  119. package/dist/lib/plugins/openapi/playground/PathParams.js.map +1 -1
  120. package/dist/lib/plugins/openapi/playground/Playground.js +4 -2
  121. package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
  122. package/dist/lib/plugins/search-inkeep/index.d.ts +5 -22
  123. package/dist/lib/plugins/search-inkeep/index.js +35 -29
  124. package/dist/lib/plugins/search-inkeep/index.js.map +1 -1
  125. package/dist/lib/plugins/search-inkeep/inkeep.d.ts +5 -21
  126. package/dist/lib/plugins/search-inkeep/inkeep.js +10 -19
  127. package/dist/lib/plugins/search-inkeep/inkeep.js.map +1 -1
  128. package/dist/lib/plugins/search-pagefind/PagefindSearch.js +1 -1
  129. package/dist/lib/plugins/search-pagefind/PagefindSearch.js.map +1 -1
  130. package/dist/lib/plugins/search-pagefind/ResultList.d.ts +1 -1
  131. package/dist/lib/plugins/search-pagefind/ResultList.js +12 -5
  132. package/dist/lib/plugins/search-pagefind/ResultList.js.map +1 -1
  133. package/dist/lib/ui/ActionButton.js +1 -1
  134. package/dist/lib/ui/ActionButton.js.map +1 -1
  135. package/dist/lib/ui/Alert.d.ts +1 -1
  136. package/dist/lib/ui/Badge.d.ts +1 -1
  137. package/dist/lib/ui/Button.d.ts +2 -2
  138. package/dist/lib/ui/CodeBlock.js +1 -1
  139. package/dist/lib/ui/CodeBlock.js.map +1 -1
  140. package/dist/lib/ui/Command.d.ts +1 -1
  141. package/dist/lib/ui/EmbeddedCodeBlock.js +1 -1
  142. package/dist/lib/ui/EmbeddedCodeBlock.js.map +1 -1
  143. package/dist/lib/util/invariant.d.ts +6 -5
  144. package/dist/lib/util/invariant.js +1 -1
  145. package/dist/lib/util/invariant.js.map +1 -1
  146. package/dist/vite/build.js +7 -1
  147. package/dist/vite/build.js.map +1 -1
  148. package/dist/vite/dev-server.js +9 -1
  149. package/dist/vite/dev-server.js.map +1 -1
  150. package/dist/vite/mdx/remark-last-modified.js +1 -28
  151. package/dist/vite/mdx/remark-last-modified.js.map +1 -1
  152. package/dist/vite/plugin-docs.js +20 -13
  153. package/dist/vite/plugin-docs.js.map +1 -1
  154. package/dist/vite/plugin-mdx.js +2 -3
  155. package/dist/vite/plugin-mdx.js.map +1 -1
  156. package/dist/vite/plugin-theme.js +88 -49
  157. package/dist/vite/plugin-theme.js.map +1 -1
  158. package/dist/vite/plugin-theme.test.js +25 -4
  159. package/dist/vite/plugin-theme.test.js.map +1 -1
  160. package/dist/vite/prerender/worker.js +5 -1
  161. package/dist/vite/prerender/worker.js.map +1 -1
  162. package/dist/vite/shadcn-registry.d.ts +8 -8
  163. package/lib/{Button-BE9IVkWV.js → Button-B3o-2Xdf.js} +2 -2
  164. package/lib/{Button-BE9IVkWV.js.map → Button-B3o-2Xdf.js.map} +1 -1
  165. package/lib/{Card-DPhGbYUM.js → Card-CMDQUPM4.js} +2 -2
  166. package/lib/{Card-DPhGbYUM.js.map → Card-CMDQUPM4.js.map} +1 -1
  167. package/lib/ClientOnly-E7hGysn1.js.map +1 -1
  168. package/lib/{CodeBlock-DAKxs_Tu.js → CodeBlock-B-G0eKtw.js} +3 -3
  169. package/lib/{CodeBlock-DAKxs_Tu.js.map → CodeBlock-B-G0eKtw.js.map} +1 -1
  170. package/lib/{Command-xsbs2uhf.js → Command-BYukybsa.js} +3 -3
  171. package/lib/{Command-xsbs2uhf.js.map → Command-BYukybsa.js.map} +1 -1
  172. package/lib/{Dialog-CiIdyz6a.js → Dialog-u9Uz9sTt.js} +5 -5
  173. package/lib/{Dialog-CiIdyz6a.js.map → Dialog-u9Uz9sTt.js.map} +1 -1
  174. package/lib/{Drawer-BzkOKwgC.js → Drawer-DJ05s2pH.js} +86 -86
  175. package/lib/{Drawer-BzkOKwgC.js.map → Drawer-DJ05s2pH.js.map} +1 -1
  176. package/lib/{MdxPage-swXPJ0gf.js → MdxPage-Bsko6_kb.js} +34 -34
  177. package/lib/MdxPage-Bsko6_kb.js.map +1 -0
  178. package/lib/OAuthErrorPage-DJzGiIBt.js +150 -0
  179. package/lib/OAuthErrorPage-DJzGiIBt.js.map +1 -0
  180. package/lib/{OasProvider-CDAM3TB1.js → OasProvider-DQQRt3oS.js} +3 -3
  181. package/lib/{OasProvider-CDAM3TB1.js.map → OasProvider-DQQRt3oS.js.map} +1 -1
  182. package/lib/{OperationList-C9Hb9ql8.js → OperationList-DpmkHf26.js} +212 -210
  183. package/lib/OperationList-DpmkHf26.js.map +1 -0
  184. package/lib/{Pagination-VGlgeCmS.js → Pagination-kqFNgtnI.js} +10 -9
  185. package/lib/Pagination-kqFNgtnI.js.map +1 -0
  186. package/lib/{RouteGuard-CbKd7_9h.js → RouteGuard-0wPUKdxJ.js} +166 -165
  187. package/lib/{RouteGuard-CbKd7_9h.js.map → RouteGuard-0wPUKdxJ.js.map} +1 -1
  188. package/lib/{SchemaList-BAbh1BXO.js → SchemaList-DS-pMd6B.js} +9 -9
  189. package/lib/{SchemaList-BAbh1BXO.js.map → SchemaList-DS-pMd6B.js.map} +1 -1
  190. package/lib/{SchemaView-C2Io712T.js → SchemaView-BnN6WHjw.js} +6 -6
  191. package/lib/{SchemaView-C2Io712T.js.map → SchemaView-BnN6WHjw.js.map} +1 -1
  192. package/lib/Select-BmTTKNPp.js +273 -0
  193. package/lib/Select-BmTTKNPp.js.map +1 -0
  194. package/lib/SignUp-BwOSCD-6.js +56 -0
  195. package/lib/SignUp-BwOSCD-6.js.map +1 -0
  196. package/lib/{Slot-DwZlQ-vX.js → Slot-DAyXieeZ.js} +1634 -1643
  197. package/lib/Slot-DAyXieeZ.js.map +1 -0
  198. package/lib/Spinner-mNLZ6awP.js.map +1 -1
  199. package/lib/{SyntaxHighlight-CrjhGEwT.js → SyntaxHighlight-BMKR4pl6.js} +757 -757
  200. package/lib/SyntaxHighlight-BMKR4pl6.js.map +1 -0
  201. package/lib/{Toc-WCmwFkX-.js → Toc-BKDRCQzU.js} +3 -3
  202. package/lib/{Toc-WCmwFkX-.js.map → Toc-BKDRCQzU.js.map} +1 -1
  203. package/lib/ZudokuContext-CLl5w57E.js +1278 -0
  204. package/lib/ZudokuContext-CLl5w57E.js.map +1 -0
  205. package/lib/{chunk-DQRVZFIR-DHK7_Ilc.js → chunk-QMGIS6GS-CEOk3lro.js} +3 -3
  206. package/lib/chunk-QMGIS6GS-CEOk3lro.js.map +1 -0
  207. package/lib/{circular-B42RaanD.js → circular-8GWQDvCW.js} +2 -2
  208. package/lib/{circular-B42RaanD.js.map → circular-8GWQDvCW.js.map} +1 -1
  209. package/lib/{cn-wvCW-ho6.js → cn-dYga0KKN.js} +2 -2
  210. package/lib/cn-dYga0KKN.js.map +1 -0
  211. package/lib/{createServer-BKFsRuuk.js → createServer-BsezSzvV.js} +3398 -3552
  212. package/lib/createServer-BsezSzvV.js.map +1 -0
  213. package/lib/errors-Cs7hKmdL.js +45 -0
  214. package/lib/errors-Cs7hKmdL.js.map +1 -0
  215. package/lib/hook-DbUCLQNg.js +247 -0
  216. package/lib/hook-DbUCLQNg.js.map +1 -0
  217. package/lib/index-A5Qdwj1B.js +4081 -0
  218. package/lib/index-A5Qdwj1B.js.map +1 -0
  219. package/lib/{index-B6Re5_cx.js → index-Bg7Js3jB.js} +873 -951
  220. package/lib/index-Bg7Js3jB.js.map +1 -0
  221. package/lib/{index-CcV90rin.js → index-BkW9tJ6j.js} +2 -2
  222. package/lib/{index-CcV90rin.js.map → index-BkW9tJ6j.js.map} +1 -1
  223. package/lib/index-Bm35Tkgf.js +107 -0
  224. package/lib/index-Bm35Tkgf.js.map +1 -0
  225. package/lib/index-CrcNWbel.js.map +1 -1
  226. package/lib/index-DI5SPFK9.js.map +1 -1
  227. package/lib/index-DmNq2fbN.js.map +1 -1
  228. package/lib/index.esm-CdzlRw50.js +1254 -0
  229. package/lib/index.esm-CdzlRw50.js.map +1 -0
  230. package/lib/{invariant-DAFpPywt.js → invariant-Bm-FVUQE.js} +2 -6
  231. package/lib/invariant-Bm-FVUQE.js.map +1 -0
  232. package/lib/jsx-runtime-C5mzlN2N.js.map +1 -1
  233. package/lib/processors/removeExtensions.js.map +1 -1
  234. package/lib/processors/removeParameters.js.map +1 -1
  235. package/lib/processors/removePaths.js.map +1 -1
  236. package/lib/processors/traverse.js.map +1 -1
  237. package/lib/ui/Accordion.js +1 -1
  238. package/lib/ui/Accordion.js.map +1 -1
  239. package/lib/ui/ActionButton.js +10 -10
  240. package/lib/ui/ActionButton.js.map +1 -1
  241. package/lib/ui/Alert.js +1 -1
  242. package/lib/ui/Alert.js.map +1 -1
  243. package/lib/ui/AlertDialog.js +1 -1
  244. package/lib/ui/AlertDialog.js.map +1 -1
  245. package/lib/ui/Badge.js +1 -1
  246. package/lib/ui/Badge.js.map +1 -1
  247. package/lib/ui/Breadcrumb.js +1 -1
  248. package/lib/ui/Breadcrumb.js.map +1 -1
  249. package/lib/ui/Button.js +1 -1
  250. package/lib/ui/Button.js.map +1 -1
  251. package/lib/ui/Callout.js +1 -1
  252. package/lib/ui/Callout.js.map +1 -1
  253. package/lib/ui/Card.js +1 -1
  254. package/lib/ui/Card.js.map +1 -1
  255. package/lib/ui/Carousel.js +1 -1
  256. package/lib/ui/Carousel.js.map +1 -1
  257. package/lib/ui/Checkbox.js +1 -1
  258. package/lib/ui/Checkbox.js.map +1 -1
  259. package/lib/ui/CodeBlock.js +2 -2
  260. package/lib/ui/Command.js +2 -2
  261. package/lib/ui/Command.js.map +1 -1
  262. package/lib/ui/Dialog.js +1 -1
  263. package/lib/ui/Dialog.js.map +1 -1
  264. package/lib/ui/Drawer.js +2 -2
  265. package/lib/ui/DropdownMenu.js +1 -1
  266. package/lib/ui/DropdownMenu.js.map +1 -1
  267. package/lib/ui/EmbeddedCodeBlock.js +2 -2
  268. package/lib/ui/EmbeddedCodeBlock.js.map +1 -1
  269. package/lib/ui/Form.js +2 -2
  270. package/lib/ui/Form.js.map +1 -1
  271. package/lib/ui/HoverCard.js +1 -1
  272. package/lib/ui/HoverCard.js.map +1 -1
  273. package/lib/ui/Input.js +1 -1
  274. package/lib/ui/Input.js.map +1 -1
  275. package/lib/ui/Label.js +1 -1
  276. package/lib/ui/Label.js.map +1 -1
  277. package/lib/ui/Pagination.js +1 -1
  278. package/lib/ui/Pagination.js.map +1 -1
  279. package/lib/ui/Popover.js +1 -1
  280. package/lib/ui/Popover.js.map +1 -1
  281. package/lib/ui/Progress.js +1 -1
  282. package/lib/ui/Progress.js.map +1 -1
  283. package/lib/ui/RadioGroup.js +1 -1
  284. package/lib/ui/RadioGroup.js.map +1 -1
  285. package/lib/ui/ScrollArea.js +1 -1
  286. package/lib/ui/ScrollArea.js.map +1 -1
  287. package/lib/ui/Select.js +1 -1
  288. package/lib/ui/Select.js.map +1 -1
  289. package/lib/ui/Skeleton.js +1 -1
  290. package/lib/ui/Skeleton.js.map +1 -1
  291. package/lib/ui/Slider.js +1 -1
  292. package/lib/ui/Slider.js.map +1 -1
  293. package/lib/ui/Stepper.js.map +1 -1
  294. package/lib/ui/Switch.js +1 -1
  295. package/lib/ui/Switch.js.map +1 -1
  296. package/lib/ui/SyntaxHighlight.js +4 -4
  297. package/lib/ui/Tabs.js +1 -1
  298. package/lib/ui/Tabs.js.map +1 -1
  299. package/lib/ui/Textarea.js +1 -1
  300. package/lib/ui/Textarea.js.map +1 -1
  301. package/lib/ui/Toggle.js +1 -1
  302. package/lib/ui/Toggle.js.map +1 -1
  303. package/lib/ui/ToggleGroup.js +1 -1
  304. package/lib/ui/ToggleGroup.js.map +1 -1
  305. package/lib/ui/Tooltip.js +1 -1
  306. package/lib/ui/Tooltip.js.map +1 -1
  307. package/lib/ui/util.js +1 -1
  308. package/lib/{useExposedProps-BIYjecPD.js → useExposedProps-KcgXHKeE.js} +2 -2
  309. package/lib/{useExposedProps-BIYjecPD.js.map → useExposedProps-KcgXHKeE.js.map} +1 -1
  310. package/lib/zudoku.auth-auth0.js +1 -1
  311. package/lib/zudoku.auth-auth0.js.map +1 -1
  312. package/lib/zudoku.auth-azureb2c.js +46 -9883
  313. package/lib/zudoku.auth-azureb2c.js.map +1 -1
  314. package/lib/zudoku.auth-clerk.js +25 -22
  315. package/lib/zudoku.auth-clerk.js.map +1 -1
  316. package/lib/zudoku.auth-openid.js +249 -231
  317. package/lib/zudoku.auth-openid.js.map +1 -1
  318. package/lib/zudoku.auth-supabase.js +97 -0
  319. package/lib/zudoku.auth-supabase.js.map +1 -0
  320. package/lib/zudoku.components.js +30 -29
  321. package/lib/zudoku.components.js.map +1 -1
  322. package/lib/zudoku.hooks.js +17 -16
  323. package/lib/zudoku.hooks.js.map +1 -1
  324. package/lib/zudoku.icons.js.map +1 -1
  325. package/lib/zudoku.plugin-api-catalog.js +26 -25
  326. package/lib/zudoku.plugin-api-catalog.js.map +1 -1
  327. package/lib/zudoku.plugin-api-keys.js +428 -299
  328. package/lib/zudoku.plugin-api-keys.js.map +1 -1
  329. package/lib/zudoku.plugin-custom-pages.js +1 -1
  330. package/lib/zudoku.plugin-custom-pages.js.map +1 -1
  331. package/lib/zudoku.plugin-markdown.js +1 -1
  332. package/lib/zudoku.plugin-markdown.js.map +1 -1
  333. package/lib/zudoku.plugin-openapi.js +7 -6
  334. package/lib/zudoku.plugin-openapi.js.map +1 -1
  335. package/lib/zudoku.plugin-redirect.js +1 -1
  336. package/lib/zudoku.plugin-redirect.js.map +1 -1
  337. package/lib/zudoku.plugin-search-inkeep.js +54 -57
  338. package/lib/zudoku.plugin-search-inkeep.js.map +1 -1
  339. package/lib/zudoku.plugin-search-pagefind.js +123 -118
  340. package/lib/zudoku.plugin-search-pagefind.js.map +1 -1
  341. package/lib/zudoku.plugins.js.map +1 -1
  342. package/package.json +34 -33
  343. package/src/app/demo.tsx +19 -2
  344. package/src/app/main.css +26 -5
  345. package/src/app/main.tsx +6 -14
  346. package/src/lib/authentication/authentication.ts +2 -2
  347. package/src/lib/authentication/components/CallbackHandler.tsx +22 -15
  348. package/src/lib/authentication/components/OAuthErrorPage.tsx +171 -0
  349. package/src/lib/authentication/components/SignIn.tsx +5 -12
  350. package/src/lib/authentication/errors.ts +27 -13
  351. package/src/lib/authentication/hook.ts +2 -0
  352. package/src/lib/authentication/providers/azureb2c.tsx +8 -3
  353. package/src/lib/authentication/providers/clerk.tsx +4 -1
  354. package/src/lib/authentication/providers/openid.tsx +30 -5
  355. package/src/lib/components/Banner.tsx +0 -1
  356. package/src/lib/components/CategoryHeading.tsx +4 -1
  357. package/src/lib/components/Header.tsx +5 -2
  358. package/src/lib/components/Heading.tsx +1 -1
  359. package/src/lib/components/Markdown.tsx +3 -3
  360. package/src/lib/components/MobileTopNavigation.tsx +60 -8
  361. package/src/lib/components/NotFoundPage.tsx +3 -2
  362. package/src/lib/components/Pagination.tsx +1 -0
  363. package/src/lib/components/StatusPage.tsx +5 -0
  364. package/src/lib/components/TopNavigation.tsx +34 -18
  365. package/src/lib/components/Typography.tsx +1 -1
  366. package/src/lib/components/context/ZudokuContext.ts +25 -18
  367. package/src/lib/components/navigation/NavigationItem.tsx +9 -1
  368. package/src/lib/components/navigation/NavigationWrapper.tsx +4 -1
  369. package/src/lib/components/navigation/utils.ts +9 -3
  370. package/src/lib/core/RouteGuard.tsx +13 -13
  371. package/src/lib/core/ZudokuContext.ts +40 -5
  372. package/src/lib/core/plugins.ts +2 -1
  373. package/src/lib/errors/ErrorAlert.tsx +5 -7
  374. package/src/lib/plugins/api-keys/CreateApiKey.tsx +12 -1
  375. package/src/lib/plugins/api-keys/SettingsApiKeys.tsx +37 -13
  376. package/src/lib/plugins/api-keys/index.tsx +8 -9
  377. package/src/lib/plugins/markdown/MdxPage.tsx +4 -3
  378. package/src/lib/plugins/openapi/OperationList.tsx +4 -2
  379. package/src/lib/plugins/openapi/Sidecar.tsx +1 -1
  380. package/src/lib/plugins/openapi/SidecarExamples.tsx +1 -1
  381. package/src/lib/plugins/openapi/graphql/gql.ts +3 -3
  382. package/src/lib/plugins/openapi/graphql/graphql.ts +2 -0
  383. package/src/lib/plugins/openapi/index.tsx +67 -17
  384. package/src/lib/plugins/openapi/playground/PathParams.tsx +1 -1
  385. package/src/lib/plugins/openapi/playground/Playground.tsx +8 -2
  386. package/src/lib/plugins/search-inkeep/index.tsx +54 -58
  387. package/src/lib/plugins/search-inkeep/inkeep.ts +19 -21
  388. package/src/lib/plugins/search-pagefind/PagefindSearch.tsx +1 -0
  389. package/src/lib/plugins/search-pagefind/ResultList.tsx +13 -4
  390. package/src/lib/ui/ActionButton.tsx +3 -1
  391. package/src/lib/ui/Alert.tsx +1 -1
  392. package/src/lib/ui/CodeBlock.tsx +1 -1
  393. package/src/lib/ui/EmbeddedCodeBlock.tsx +1 -1
  394. package/src/lib/util/invariant.ts +7 -5
  395. package/lib/Alert-CT_ViLrJ.js +0 -161
  396. package/lib/Alert-CT_ViLrJ.js.map +0 -1
  397. package/lib/MdxPage-swXPJ0gf.js.map +0 -1
  398. package/lib/OperationList-C9Hb9ql8.js.map +0 -1
  399. package/lib/Pagination-VGlgeCmS.js.map +0 -1
  400. package/lib/SignUp-5RUdVhnq.js +0 -63
  401. package/lib/SignUp-5RUdVhnq.js.map +0 -1
  402. package/lib/Slot-DwZlQ-vX.js.map +0 -1
  403. package/lib/SyntaxHighlight-CrjhGEwT.js.map +0 -1
  404. package/lib/chunk-DQRVZFIR-DHK7_Ilc.js.map +0 -1
  405. package/lib/clerk-BDZ31hjU.js +0 -25190
  406. package/lib/clerk-BDZ31hjU.js.map +0 -1
  407. package/lib/cn-wvCW-ho6.js.map +0 -1
  408. package/lib/createServer-BKFsRuuk.js.map +0 -1
  409. package/lib/errors-CF2X_x5o.js +0 -78
  410. package/lib/errors-CF2X_x5o.js.map +0 -1
  411. package/lib/hook-Bd0yS8M0.js +0 -1503
  412. package/lib/hook-Bd0yS8M0.js.map +0 -1
  413. package/lib/index-B6Re5_cx.js.map +0 -1
  414. package/lib/index-CLy1XyH0.js +0 -3919
  415. package/lib/index-CLy1XyH0.js.map +0 -1
  416. package/lib/index-ClhS5TxS.js +0 -107
  417. package/lib/index-ClhS5TxS.js.map +0 -1
  418. package/lib/index.esm-Cp4wkyud.js +0 -1236
  419. package/lib/index.esm-Cp4wkyud.js.map +0 -1
  420. package/lib/invariant-DAFpPywt.js.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zudoku",
3
- "version": "0.0.0-f40ea27",
3
+ "version": "0.0.0-f42e3678",
4
4
  "type": "module",
5
5
  "homepage": "https://zudoku.dev",
6
6
  "repository": {
@@ -133,13 +133,13 @@
133
133
  },
134
134
  "dependencies": {
135
135
  "@apidevtools/json-schema-ref-parser": "12.0.2",
136
- "@envelop/core": "5.2.3",
136
+ "@envelop/core": "5.3.0",
137
137
  "@graphql-typed-document-node/core": "3.2.0",
138
138
  "@hookform/resolvers": "4.1.3",
139
- "@lekoarts/rehype-meta-as-attributes": "3.0.2",
139
+ "@lekoarts/rehype-meta-as-attributes": "3.0.3",
140
140
  "@mdx-js/react": "3.1.0",
141
141
  "@mdx-js/rollup": "3.1.0",
142
- "@pothos/core": "4.6.0",
142
+ "@pothos/core": "4.7.0",
143
143
  "@radix-ui/react-accordion": "1.2.11",
144
144
  "@radix-ui/react-alert-dialog": "1.1.14",
145
145
  "@radix-ui/react-aspect-ratio": "1.1.7",
@@ -162,21 +162,21 @@
162
162
  "@radix-ui/react-toggle-group": "1.1.10",
163
163
  "@radix-ui/react-tooltip": "1.2.7",
164
164
  "@radix-ui/react-visually-hidden": "1.2.3",
165
- "@scalar/openapi-parser": "0.10.17",
165
+ "@scalar/openapi-parser": "0.18.0",
166
166
  "@sentry/node": "9.26.0",
167
- "@shikijs/langs": "3.5.0",
168
- "@shikijs/rehype": "3.5.0",
169
- "@shikijs/themes": "3.5.0",
170
- "@shikijs/transformers": "3.5.0",
167
+ "@shikijs/langs": "3.7.0",
168
+ "@shikijs/rehype": "3.7.0",
169
+ "@shikijs/themes": "3.7.0",
170
+ "@shikijs/transformers": "3.7.0",
171
171
  "@sindresorhus/slugify": "2.2.1",
172
172
  "@stefanprobst/rehype-extract-toc": "3.0.0",
173
173
  "@tailwindcss/typography": "0.5.16",
174
- "@tailwindcss/vite": "4.1.7",
174
+ "@tailwindcss/vite": "4.1.11",
175
175
  "@tanem/react-nprogress": "5.0.55",
176
- "@tanstack/react-query": "5.74.3",
176
+ "@tanstack/react-query": "5.81.5",
177
177
  "@types/react": "19.1.8",
178
178
  "@types/react-dom": "19.1.6",
179
- "@vitejs/plugin-react": "4.4.1",
179
+ "@vitejs/plugin-react": "4.6.0",
180
180
  "@zudoku/httpsnippet": "10.0.9",
181
181
  "@zudoku/react-helmet-async": "2.0.5",
182
182
  "allof-merge": "0.6.6",
@@ -195,7 +195,7 @@
195
195
  "glob-parent": "6.0.2",
196
196
  "graphql": "16.11.0",
197
197
  "graphql-type-json": "0.3.2",
198
- "graphql-yoga": "5.13.5",
198
+ "graphql-yoga": "5.14.0",
199
199
  "gray-matter": "4.0.3",
200
200
  "hast-util-to-jsx-runtime": "^2.3.6",
201
201
  "hast-util-to-string": "3.0.1",
@@ -203,24 +203,24 @@
203
203
  "http-terminator": "3.2.0",
204
204
  "json-schema-to-typescript-lite": "14.1.0",
205
205
  "loglevel": "1.9.2",
206
- "lru-cache": "11.0.2",
207
- "lucide-react": "0.515.0",
206
+ "lru-cache": "11.1.0",
207
+ "lucide-react": "0.525.0",
208
208
  "minimatch": "10.0.1",
209
- "motion": "12.0.0-alpha.2",
209
+ "motion": "12.23.3",
210
210
  "nanoevents": "^9.1.0",
211
- "next-themes": "0.4.4",
211
+ "next-themes": "0.4.6",
212
212
  "oauth4webapi": "2.17.0",
213
213
  "object-hash": "3.0.0",
214
214
  "openapi-types": "12.1.3",
215
215
  "pagefind": "1.4.0-alpha.1",
216
216
  "picocolors": "1.1.1",
217
- "piscina": "5.0.0",
217
+ "piscina": "5.1.3",
218
218
  "posthog-node": "4.17.1",
219
- "react-error-boundary": "5.0.0",
220
- "react-hook-form": "7.57.0",
219
+ "react-error-boundary": "6.0.0",
220
+ "react-hook-form": "7.60.0",
221
221
  "react-is": "19.1.0",
222
222
  "react-markdown": "10.1.0",
223
- "react-router": "7.6.1",
223
+ "react-router": "7.6.3",
224
224
  "rehype-mdx-import-media": "1.2.0",
225
225
  "rehype-raw": "7.0.0",
226
226
  "rehype-slug": "6.0.0",
@@ -229,17 +229,17 @@
229
229
  "remark-directive-rehype": "0.4.2",
230
230
  "remark-frontmatter": "5.0.0",
231
231
  "remark-gfm": "4.0.1",
232
- "remark-mdx-frontmatter": "5.1.0",
232
+ "remark-mdx-frontmatter": "5.2.0",
233
233
  "remark-parse": "^11.0.0",
234
234
  "remark-rehype": "^11.1.2",
235
- "rollup": "4.41.1",
236
- "semver": "7.7.1",
237
- "shiki": "3.5.0",
235
+ "rollup": "4.45.0",
236
+ "semver": "7.7.2",
237
+ "shiki": "3.7.0",
238
238
  "sitemap": "8.0.0",
239
239
  "spin-delay": "2.0.1",
240
240
  "strip-ansi": "7.1.0",
241
- "tailwind-merge": "3.3.0",
242
- "tailwindcss": "4.1.7",
241
+ "tailwind-merge": "3.3.1",
242
+ "tailwindcss": "4.1.11",
243
243
  "ulidx": "2.4.1",
244
244
  "unified": "^11.0.5",
245
245
  "unist-util-visit": "5.0.0",
@@ -247,18 +247,19 @@
247
247
  "vfile": "6.0.3",
248
248
  "vite": "6.3.5",
249
249
  "yaml": "2.8.0",
250
- "yargs": "17.7.2",
251
- "zod": "3.25.56",
250
+ "yargs": "18.0.0",
251
+ "zod": "3.25.74",
252
252
  "zod-to-ts": "1.2.0",
253
253
  "zustand": "5.0.5"
254
254
  },
255
255
  "devDependencies": {
256
256
  "@graphql-codegen/cli": "5.0.7",
257
257
  "@graphql-codegen/client-preset": "4.8.2",
258
+ "@inkeep/cxkit-types": "0.5.90",
258
259
  "@testing-library/dom": "10.4.0",
259
260
  "@testing-library/jest-dom": "6.6.3",
260
261
  "@testing-library/react": "16.3.0",
261
- "@types/estree": "1.0.7",
262
+ "@types/estree": "1.0.8",
262
263
  "@types/express": "5.0.2",
263
264
  "@types/glob-parent": "5.1.3",
264
265
  "@types/har-format": "1.2.16",
@@ -274,14 +275,14 @@
274
275
  "@types/yargs": "17.0.33",
275
276
  "@vitest/coverage-v8": "3.2.1",
276
277
  "esbuild": "0.25.1",
277
- "happy-dom": "17.5.6",
278
+ "happy-dom": "18.0.1",
278
279
  "mdast-util-mdx": "3.0.0",
279
280
  "react": "19.1.0",
280
281
  "react-dom": "19.1.0",
281
- "rollup-plugin-visualizer": "5.14.0",
282
+ "rollup-plugin-visualizer": "6.0.3",
282
283
  "tsx": "4.19.4",
283
284
  "typescript": "5.8.3",
284
- "vitest": "3.2.3"
285
+ "vitest": "3.2.4"
285
286
  },
286
287
  "peerDependencies": {
287
288
  "@azure/msal-browser": "^4.13.0",
package/src/app/demo.tsx CHANGED
@@ -10,6 +10,10 @@ import "./main.css";
10
10
  import { getRoutesByConfig } from "./main.js";
11
11
 
12
12
  const apiUrl = new URL(window.location.href).searchParams.get("api-url");
13
+ const logoUrl = new URL(window.location.href).searchParams.get("logo-url");
14
+ const logoWidth = new URL(window.location.href).searchParams.get("logo-width");
15
+ const title =
16
+ new URL(window.location.href).searchParams.get("title") ?? "Zudoku Demo";
13
17
 
14
18
  if (!apiUrl) {
15
19
  throw new Error(
@@ -29,9 +33,9 @@ if (!root) {
29
33
  // IMPORTANT: This component must not contain tailwind classes
30
34
  // This directory is not processed by the tailwind plugin
31
35
 
32
- const config = {
36
+ const config: ZudokuConfig = {
33
37
  site: {
34
- title: "",
38
+ title,
35
39
  banner: {
36
40
  message: <DemoAnnouncement />,
37
41
  },
@@ -53,6 +57,19 @@ const config = {
53
57
  ],
54
58
  } satisfies ZudokuConfig;
55
59
 
60
+ if (logoUrl && logoWidth) {
61
+ config.site = {
62
+ ...config.site,
63
+ logo: {
64
+ src: {
65
+ light: logoUrl,
66
+ dark: logoUrl,
67
+ },
68
+ width: logoWidth,
69
+ },
70
+ };
71
+ }
72
+
56
73
  const routes = getRoutesByConfig(config);
57
74
  const router = createBrowserRouter(routes, {
58
75
  basename: window.location.pathname,
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,34 @@
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:before {
170
+ position: absolute;
171
+ inset-inline-start: 0;
172
+ inset-block-start: 0;
173
+ inset-block-end: 0;
174
+ border-left: 2px solid
175
+ hsl(from var(--highlighted-bg) h s calc(l + 4 * var(--dark)));
176
+ content: "";
160
177
  }
161
178
 
162
179
  .shiki .highlighted-word {
180
+ --highlighted-bg: hsl(
181
+ from var(--muted) h s calc(l + 4 * var(--dark)) / 50%
182
+ );
183
+
163
184
  @apply bg-(--highlighted-bg) px-0.5 rounded;
164
185
  box-shadow: 0 0 0 4px var(--highlighted-bg);
165
186
  }
package/src/app/main.tsx CHANGED
@@ -82,22 +82,13 @@ export const getRoutesByOptions = (
82
82
  .flatMap((plugin) => (isNavigationPlugin(plugin) ? plugin.getRoutes() : []))
83
83
  .concat(
84
84
  enableStatusPages
85
- ? [400, 403, 404, 405, 414, 416, 500, 501, 502, 503, 504].map(
86
- (statusCode) => ({
87
- path: `/${statusCode}`,
88
- element: <StatusPage statusCode={statusCode} />,
89
- }),
90
- )
85
+ ? [400, 404, 500].map((statusCode) => ({
86
+ path: `/${statusCode}`,
87
+ element: <StatusPage statusCode={statusCode} />,
88
+ }))
91
89
  : [],
92
90
  )
93
- .concat([
94
- {
95
- path: "*",
96
- loader: () => {
97
- throw new Response("Not Found", { status: 404 });
98
- },
99
- },
100
- ]);
91
+ .concat([{ path: "*", element: <StatusPage statusCode={404} /> }]);
101
92
 
102
93
  // @TODO Detect conflicts in routes and log warning
103
94
 
@@ -125,6 +116,7 @@ export const getRoutesByConfig = (config: ZudokuConfig): RouteObject[] => {
125
116
  <Layout />
126
117
  </Zudoku>
127
118
  ),
119
+ hydrateFallbackElement: <div>Loading...</div>,
128
120
  children: [
129
121
  {
130
122
  element: <RouteGuard />,
@@ -1,6 +1,6 @@
1
1
  export interface AuthenticationPlugin {
2
- signUp(options?: { redirectTo?: string }): Promise<void>;
3
- signIn(options?: { redirectTo?: string }): Promise<void>;
2
+ signUp(options?: { redirectTo?: string; replace?: boolean }): Promise<void>;
3
+ signIn(options?: { redirectTo?: string; replace?: boolean }): Promise<void>;
4
4
  signOut(): Promise<void>;
5
5
  // @deprecated use signRequest instead
6
6
  getAccessToken(): Promise<string>;
@@ -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,6 +1,6 @@
1
1
  import { useEffect } from "react";
2
- import { Link, useSearchParams } from "react-router";
3
- import { Button } from "zudoku/ui/Button.js";
2
+ import { useSearchParams } from "react-router";
3
+ import { Spinner } from "zudoku/components";
4
4
  import {
5
5
  Card,
6
6
  CardContent,
@@ -16,6 +16,7 @@ export const SignIn = () => {
16
16
  useEffect(() => {
17
17
  void context.authentication?.signIn({
18
18
  redirectTo: search.get("redirect") ?? undefined,
19
+ replace: true,
19
20
  });
20
21
  }, [context.authentication, search]);
21
22
 
@@ -30,16 +31,8 @@ export const SignIn = () => {
30
31
  </CardDescription>
31
32
  </CardHeader>
32
33
  <CardContent>
33
- <div className="flex flex-col gap-2 justify-center">
34
- <Button
35
- onClick={() => context.authentication?.signIn()}
36
- variant="default"
37
- >
38
- Login
39
- </Button>
40
- <Button variant="link" className="text-muted-foreground" asChild>
41
- <Link to="/">Go home</Link>
42
- </Button>
34
+ <div className="flex items-center text-sm font-medium gap-2">
35
+ <Spinner /> Redirecting...
43
36
  </div>
44
37
  </CardContent>
45
38
  </Card>
@@ -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
  }