zudoku 0.0.0-fix-firebase-export.2e421fda → 0.0.0-monetization-standalone.z07361713

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 (410) hide show
  1. package/dist/app/main.d.ts +6 -6
  2. package/dist/cli/common/version-check.js +12 -3
  3. package/dist/cli/common/version-check.js.map +1 -1
  4. package/dist/config/create-plugin.d.ts +2 -0
  5. package/dist/config/create-plugin.js +30 -0
  6. package/dist/config/create-plugin.js.map +1 -0
  7. package/dist/config/loader.js +3 -1
  8. package/dist/config/loader.js.map +1 -1
  9. package/dist/config/validators/InputNavigationSchema.d.ts +77 -75
  10. package/dist/config/validators/InputNavigationSchema.js +1 -0
  11. package/dist/config/validators/InputNavigationSchema.js.map +1 -1
  12. package/dist/config/validators/NavigationSchema.js +6 -1
  13. package/dist/config/validators/NavigationSchema.js.map +1 -1
  14. package/dist/config/validators/ProtectedRoutesSchema.d.ts +1 -1
  15. package/dist/config/validators/validate.d.ts +61 -15
  16. package/dist/config/validators/validate.js +9 -5
  17. package/dist/config/validators/validate.js.map +1 -1
  18. package/dist/flat-config.d.ts +30 -27
  19. package/dist/index.d.ts +3 -1
  20. package/dist/index.js +3 -1
  21. package/dist/index.js.map +1 -1
  22. package/dist/lib/auth/issuer.js +1 -1
  23. package/dist/lib/auth/issuer.js.map +1 -1
  24. package/dist/lib/authentication/authentication.d.ts +3 -2
  25. package/dist/lib/authentication/components/CallbackHandler.js +1 -1
  26. package/dist/lib/authentication/components/CallbackHandler.js.map +1 -1
  27. package/dist/lib/authentication/components/SignIn.js +4 -2
  28. package/dist/lib/authentication/components/SignIn.js.map +1 -1
  29. package/dist/lib/authentication/components/SignUp.js +4 -2
  30. package/dist/lib/authentication/components/SignUp.js.map +1 -1
  31. package/dist/lib/authentication/hook.d.ts +2 -0
  32. package/dist/lib/authentication/hook.js +10 -0
  33. package/dist/lib/authentication/hook.js.map +1 -1
  34. package/dist/lib/authentication/providers/auth0.js +11 -7
  35. package/dist/lib/authentication/providers/auth0.js.map +1 -1
  36. package/dist/lib/authentication/providers/clerk.js +0 -22
  37. package/dist/lib/authentication/providers/clerk.js.map +1 -1
  38. package/dist/lib/authentication/providers/firebase.js +67 -9
  39. package/dist/lib/authentication/providers/firebase.js.map +1 -1
  40. package/dist/lib/authentication/providers/supabase.js +6 -15
  41. package/dist/lib/authentication/providers/supabase.js.map +1 -1
  42. package/dist/lib/authentication/ui/EmailVerificationUi.d.ts +4 -0
  43. package/dist/lib/authentication/ui/EmailVerificationUi.js +34 -0
  44. package/dist/lib/authentication/ui/EmailVerificationUi.js.map +1 -0
  45. package/dist/lib/authentication/ui/ZudokuAuthUi.d.ts +7 -2
  46. package/dist/lib/authentication/ui/ZudokuAuthUi.js +48 -12
  47. package/dist/lib/authentication/ui/ZudokuAuthUi.js.map +1 -1
  48. package/dist/lib/authentication/utils/relativeRedirectUrl.d.ts +1 -0
  49. package/dist/lib/authentication/utils/relativeRedirectUrl.js +8 -0
  50. package/dist/lib/authentication/utils/relativeRedirectUrl.js.map +1 -0
  51. package/dist/lib/components/Bootstrap.js +1 -2
  52. package/dist/lib/components/Bootstrap.js.map +1 -1
  53. package/dist/lib/components/Pagination.js +2 -2
  54. package/dist/lib/components/Pagination.js.map +1 -1
  55. package/dist/lib/components/Zudoku.js +2 -5
  56. package/dist/lib/components/Zudoku.js.map +1 -1
  57. package/dist/lib/components/context/ZudokuContext.d.ts +2 -4
  58. package/dist/lib/components/context/ZudokuContext.js +2 -2
  59. package/dist/lib/components/context/ZudokuContext.js.map +1 -1
  60. package/dist/lib/components/context/ZudokuProvider.js +1 -1
  61. package/dist/lib/components/context/ZudokuProvider.js.map +1 -1
  62. package/dist/lib/components/context/ZudokuReactContext.d.ts +11 -0
  63. package/dist/lib/components/context/ZudokuReactContext.js +4 -0
  64. package/dist/lib/components/context/ZudokuReactContext.js.map +1 -0
  65. package/dist/lib/components/index.d.ts +5 -0
  66. package/dist/lib/components/index.js +4 -0
  67. package/dist/lib/components/index.js.map +1 -1
  68. package/dist/lib/components/navigation/NavigationItem.js +2 -2
  69. package/dist/lib/components/navigation/NavigationItem.js.map +1 -1
  70. package/dist/lib/core/RouteGuard.js +12 -7
  71. package/dist/lib/core/RouteGuard.js.map +1 -1
  72. package/dist/lib/core/plugins.d.ts +11 -1
  73. package/dist/lib/core/plugins.js +1 -0
  74. package/dist/lib/core/plugins.js.map +1 -1
  75. package/dist/lib/core/react-query.d.ts +1 -0
  76. package/dist/lib/core/react-query.js +2 -0
  77. package/dist/lib/core/react-query.js.map +1 -0
  78. package/dist/lib/core/transform-config.d.ts +2 -0
  79. package/dist/lib/core/transform-config.js +22 -0
  80. package/dist/lib/core/transform-config.js.map +1 -0
  81. package/dist/lib/errors/ErrorAlert.js +1 -2
  82. package/dist/lib/errors/ErrorAlert.js.map +1 -1
  83. package/dist/lib/errors/ErrorMessage.d.ts +3 -0
  84. package/dist/lib/errors/ErrorMessage.js +16 -0
  85. package/dist/lib/errors/ErrorMessage.js.map +1 -0
  86. package/dist/lib/hooks/index.d.ts +2 -0
  87. package/dist/lib/oas/graphql/circular.d.ts +2 -0
  88. package/dist/lib/oas/graphql/circular.js +32 -10
  89. package/dist/lib/oas/graphql/circular.js.map +1 -1
  90. package/dist/lib/oas/graphql/circular.test.d.ts +1 -0
  91. package/dist/lib/oas/graphql/circular.test.js +152 -0
  92. package/dist/lib/oas/graphql/circular.test.js.map +1 -0
  93. package/dist/lib/oas/graphql/index.js +7 -3
  94. package/dist/lib/oas/graphql/index.js.map +1 -1
  95. package/dist/lib/plugins/api-keys/SettingsApiKeys.js +9 -172
  96. package/dist/lib/plugins/api-keys/SettingsApiKeys.js.map +1 -1
  97. package/dist/lib/plugins/api-keys/index.d.ts +11 -4
  98. package/dist/lib/plugins/api-keys/index.js +36 -22
  99. package/dist/lib/plugins/api-keys/index.js.map +1 -1
  100. package/dist/lib/plugins/api-keys/settings/ApiKeyItem.d.ts +12 -0
  101. package/dist/lib/plugins/api-keys/settings/ApiKeyItem.js +133 -0
  102. package/dist/lib/plugins/api-keys/settings/ApiKeyItem.js.map +1 -0
  103. package/dist/lib/plugins/api-keys/settings/ApiKeyList.d.ts +4 -0
  104. package/dist/lib/plugins/api-keys/settings/ApiKeyList.js +33 -0
  105. package/dist/lib/plugins/api-keys/settings/ApiKeyList.js.map +1 -0
  106. package/dist/lib/plugins/api-keys/settings/RevealApiKey.d.ts +6 -0
  107. package/dist/lib/plugins/api-keys/settings/RevealApiKey.js +39 -0
  108. package/dist/lib/plugins/api-keys/settings/RevealApiKey.js.map +1 -0
  109. package/dist/lib/plugins/openapi/OasProvider.js +6 -2
  110. package/dist/lib/plugins/openapi/OasProvider.js.map +1 -1
  111. package/dist/lib/plugins/openapi/OperationList.js +4 -4
  112. package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
  113. package/dist/lib/plugins/openapi/ParamInfos.js +1 -0
  114. package/dist/lib/plugins/openapi/ParamInfos.js.map +1 -1
  115. package/dist/lib/plugins/openapi/Sidecar.js +3 -2
  116. package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
  117. package/dist/lib/plugins/openapi/interfaces.d.ts +3 -0
  118. package/dist/lib/plugins/openapi/schema/SchemaView.js +1 -1
  119. package/dist/lib/plugins/openapi/schema/SchemaView.js.map +1 -1
  120. package/dist/lib/plugins/openapi/schema/utils.js +11 -3
  121. package/dist/lib/plugins/openapi/schema/utils.js.map +1 -1
  122. package/dist/lib/plugins/openapi/util/createHttpSnippet.js +24 -1
  123. package/dist/lib/plugins/openapi/util/createHttpSnippet.js.map +1 -1
  124. package/dist/lib/plugins/openapi/util/getRoutes.d.ts +3 -0
  125. package/dist/lib/plugins/openapi/util/getRoutes.js +2 -1
  126. package/dist/lib/plugins/openapi/util/getRoutes.js.map +1 -1
  127. package/dist/lib/ui/Button.js +1 -1
  128. package/dist/lib/ui/Button.js.map +1 -1
  129. package/dist/lib/ui/Command.d.ts +3 -3
  130. package/dist/lib/ui/Secret.js +2 -2
  131. package/dist/lib/ui/Secret.js.map +1 -1
  132. package/dist/lib/util/invariant.d.ts +1 -1
  133. package/dist/lib/util/invariant.js +2 -2
  134. package/dist/lib/util/invariant.js.map +1 -1
  135. package/dist/vite/api/SchemaManager.d.ts +12 -1
  136. package/dist/vite/api/SchemaManager.js +31 -14
  137. package/dist/vite/api/SchemaManager.js.map +1 -1
  138. package/dist/vite/api/SchemaManager.test.js +44 -0
  139. package/dist/vite/api/SchemaManager.test.js.map +1 -1
  140. package/dist/vite/config.js +10 -4
  141. package/dist/vite/config.js.map +1 -1
  142. package/dist/vite/error-handler.js +1 -5
  143. package/dist/vite/error-handler.js.map +1 -1
  144. package/dist/vite/mdx/remark-link-rewrite.js +1 -1
  145. package/dist/vite/plugin-api-keys.js +5 -1
  146. package/dist/vite/plugin-api-keys.js.map +1 -1
  147. package/dist/vite/plugin-api.js +5 -3
  148. package/dist/vite/plugin-api.js.map +1 -1
  149. package/dist/vite/plugin-markdown-export.js +1 -1
  150. package/dist/vite/plugin-markdown-export.js.map +1 -1
  151. package/dist/vite/plugin-theme.js +2 -1
  152. package/dist/vite/plugin-theme.js.map +1 -1
  153. package/dist/vite/prerender/utils.js +9 -3
  154. package/dist/vite/prerender/utils.js.map +1 -1
  155. package/dist/vite/prerender/worker.js +3 -0
  156. package/dist/vite/prerender/worker.js.map +1 -1
  157. package/dist/vite/zuplo.d.ts +13 -0
  158. package/dist/vite/zuplo.js +15 -0
  159. package/dist/vite/zuplo.js.map +1 -0
  160. package/lib/{ActionButton-DUgvSylL.js → ActionButton-B0CXL1Lq.js} +3 -3
  161. package/lib/{ActionButton-DUgvSylL.js.map → ActionButton-B0CXL1Lq.js.map} +1 -1
  162. package/lib/{Button-CynVW1JV.js → Button-GUVe7pmt.js} +8 -7
  163. package/lib/{Button-CynVW1JV.js.map → Button-GUVe7pmt.js.map} +1 -1
  164. package/lib/{Card-KFniaZn5.js → Card-DCdq37aA.js} +2 -2
  165. package/lib/{Card-KFniaZn5.js.map → Card-DCdq37aA.js.map} +1 -1
  166. package/lib/{ClaudeLogo-B4Xxt-x_.js → ClaudeLogo-CUaQXKLK.js} +22 -22
  167. package/lib/ClaudeLogo-CUaQXKLK.js.map +1 -0
  168. package/lib/{Command-BpT1iBE6.js → Command-N6VujV30.js} +3 -3
  169. package/lib/{Command-BpT1iBE6.js.map → Command-N6VujV30.js.map} +1 -1
  170. package/lib/{Dialog-BQciPiHN.js → Dialog-hlvmmQ_c.js} +2 -2
  171. package/lib/{Dialog-BQciPiHN.js.map → Dialog-hlvmmQ_c.js.map} +1 -1
  172. package/lib/{Drawer-Ci7XwhqT.js → Drawer-Ch7927PF.js} +7 -7
  173. package/lib/{Drawer-Ci7XwhqT.js.map → Drawer-Ch7927PF.js.map} +1 -1
  174. package/lib/{DropdownMenu-C8SX_-S_.js → DropdownMenu-DN0jNrjj.js} +2 -2
  175. package/lib/{DropdownMenu-C8SX_-S_.js.map → DropdownMenu-DN0jNrjj.js.map} +1 -1
  176. package/lib/Frame-DKlOmSkU.js +205 -0
  177. package/lib/Frame-DKlOmSkU.js.map +1 -0
  178. package/lib/HydrationBoundary-CNF2ZV3E.js +601 -0
  179. package/lib/HydrationBoundary-CNF2ZV3E.js.map +1 -0
  180. package/lib/{IndexingDialog-B5zCiUKr.js → IndexingDialog-D0YdGfbn.js} +3 -3
  181. package/lib/{IndexingDialog-B5zCiUKr.js.map → IndexingDialog-D0YdGfbn.js.map} +1 -1
  182. package/lib/Input-Cx-GeKoF.js +22 -0
  183. package/lib/Input-Cx-GeKoF.js.map +1 -0
  184. package/lib/{MdxPage-BagO2c-n.js → MdxPage-BiAVpP8K.js} +11 -11
  185. package/lib/{MdxPage-BagO2c-n.js.map → MdxPage-BiAVpP8K.js.map} +1 -1
  186. package/lib/{Mermaid-D_VSX7_Q.js → Mermaid-DEztDKFw.js} +4 -4
  187. package/lib/{Mermaid-D_VSX7_Q.js.map → Mermaid-DEztDKFw.js.map} +1 -1
  188. package/lib/{OAuthErrorPage-Fq54RLgt.js → OAuthErrorPage-DhJo-O2B.js} +15 -15
  189. package/lib/OAuthErrorPage-DhJo-O2B.js.map +1 -0
  190. package/lib/OasProvider-DFMZwyNn.js +48 -0
  191. package/lib/OasProvider-DFMZwyNn.js.map +1 -0
  192. package/lib/{OperationList-C0jiEaG5.js → OperationList-CnmLfOuu.js} +1560 -1545
  193. package/lib/{OperationList-C0jiEaG5.js.map → OperationList-CnmLfOuu.js.map} +1 -1
  194. package/lib/RouteGuard-CZuPjknT.js +77 -0
  195. package/lib/RouteGuard-CZuPjknT.js.map +1 -0
  196. package/lib/{SchemaList-BU0zCHn9.js → SchemaList-B5ikunUd.js} +9 -9
  197. package/lib/{SchemaList-BU0zCHn9.js.map → SchemaList-B5ikunUd.js.map} +1 -1
  198. package/lib/SchemaView-rjji7zMf.js +438 -0
  199. package/lib/SchemaView-rjji7zMf.js.map +1 -0
  200. package/lib/{Select-CkxXP5I7.js → Secret-BE7V0Vb5.js} +159 -139
  201. package/lib/Secret-BE7V0Vb5.js.map +1 -0
  202. package/lib/{Separator-CTPSeW1S.js → Separator-BXt1LYnm.js} +2 -2
  203. package/lib/{Separator-CTPSeW1S.js.map → Separator-BXt1LYnm.js.map} +1 -1
  204. package/lib/SignUp-DHWDXat-.js +50 -0
  205. package/lib/SignUp-DHWDXat-.js.map +1 -0
  206. package/lib/{SyntaxHighlight-Kdyskw3C.js → SyntaxHighlight-paLQ8NP8.js} +1751 -1725
  207. package/lib/SyntaxHighlight-paLQ8NP8.js.map +1 -0
  208. package/lib/{Toc-DJxFPfcS.js → Toc-vMbSQCkj.js} +3 -3
  209. package/lib/{Toc-DJxFPfcS.js.map → Toc-vMbSQCkj.js.map} +1 -1
  210. package/lib/ZudokuContext-CnEI8jPU.js +389 -0
  211. package/lib/ZudokuContext-CnEI8jPU.js.map +1 -0
  212. package/lib/{___vite-browser-external_commonjs-proxy-Cga3HsWk.js → ___vite-browser-external_commonjs-proxy-BttVsNON.js} +2 -2
  213. package/lib/___vite-browser-external_commonjs-proxy-BttVsNON.js.map +1 -0
  214. package/lib/chunk-EPOLDU6W-C6C8jAwd.js +8558 -0
  215. package/lib/chunk-EPOLDU6W-C6C8jAwd.js.map +1 -0
  216. package/lib/{circular-CzWF1hj5.js → circular-CLhJAE3S.js} +771 -749
  217. package/lib/{circular-CzWF1hj5.js.map → circular-CLhJAE3S.js.map} +1 -1
  218. package/lib/{cn-dYga0KKN.js → cn-5-Gd1Dss.js} +531 -498
  219. package/lib/cn-5-Gd1Dss.js.map +1 -0
  220. package/lib/{createServer-BIr2_tGn.js → createServer-BYtu5Pcr.js} +12 -12
  221. package/lib/{createServer-BIr2_tGn.js.map → createServer-BYtu5Pcr.js.map} +1 -1
  222. package/lib/createVariantComponent-Dc0vtOvr.js +18 -0
  223. package/lib/createVariantComponent-Dc0vtOvr.js.map +1 -0
  224. package/lib/{errors-Bs4duWDy.js → errors-DkJIl45d.js} +3 -3
  225. package/lib/{errors-Bs4duWDy.js.map → errors-DkJIl45d.js.map} +1 -1
  226. package/lib/{firebase-Cax7HPzn.js → firebase-CmsW0j7-.js} +1579 -1325
  227. package/lib/firebase-CmsW0j7-.js.map +1 -0
  228. package/lib/hook-Da8QTnPd.js +52 -0
  229. package/lib/hook-Da8QTnPd.js.map +1 -0
  230. package/lib/{index-Css56y3F.js → index-Ba6RP577.js} +4 -4
  231. package/lib/{index-Css56y3F.js.map → index-Ba6RP577.js.map} +1 -1
  232. package/lib/index-CrcNWbel.js.map +1 -1
  233. package/lib/{index-Bh-MffiL.js → index-D35F-SCL.js} +2 -2
  234. package/lib/{index-Bh-MffiL.js.map → index-D35F-SCL.js.map} +1 -1
  235. package/lib/{index-0oT9beQN.js → index-k0PVZBYl.js} +155 -151
  236. package/lib/{index-0oT9beQN.js.map → index-k0PVZBYl.js.map} +1 -1
  237. package/lib/{ErrorAlert-DrOR8w3f.js → index-ofqkdEjL.js} +5457 -4444
  238. package/lib/index-ofqkdEjL.js.map +1 -0
  239. package/lib/index.esm-BYObtETB.js.map +1 -1
  240. package/lib/{index.esm-DtzT_KoE.js → index.esm-B_0dvNjB.js} +2 -2
  241. package/lib/{index.esm-DtzT_KoE.js.map → index.esm-B_0dvNjB.js.map} +1 -1
  242. package/lib/{index.esm-DDENMN4y.js → index.esm-DFzsB75P.js} +16 -14
  243. package/lib/index.esm-DFzsB75P.js.map +1 -0
  244. package/lib/{invariant-CGOLuIIz.js → invariant-BJAl77rw.js} +4 -4
  245. package/lib/invariant-BJAl77rw.js.map +1 -0
  246. package/lib/jsx-runtime-BzflLqGi.js.map +1 -1
  247. package/lib/{mutation-BoVlx8yA.js → mutation-BISOc7OM.js} +70 -44
  248. package/lib/mutation-BISOc7OM.js.map +1 -0
  249. package/lib/ui/Accordion.js +1 -1
  250. package/lib/ui/ActionButton.js +2 -2
  251. package/lib/ui/Alert.js +1 -1
  252. package/lib/ui/AlertDialog.js +1 -1
  253. package/lib/ui/Badge.js +1 -1
  254. package/lib/ui/Breadcrumb.js +1 -1
  255. package/lib/ui/Button.js +7 -6
  256. package/lib/ui/Button.js.map +1 -1
  257. package/lib/ui/ButtonGroup.js +1 -1
  258. package/lib/ui/Callout.js +1 -1
  259. package/lib/ui/Card.js +1 -1
  260. package/lib/ui/Carousel.js +1 -1
  261. package/lib/ui/Carousel.js.map +1 -1
  262. package/lib/ui/Checkbox.js +1 -1
  263. package/lib/ui/CodeBlock.js +1 -1
  264. package/lib/ui/Command.js +2 -2
  265. package/lib/ui/Dialog.js +1 -1
  266. package/lib/ui/Drawer.js +3 -3
  267. package/lib/ui/DropdownMenu.js +1 -1
  268. package/lib/ui/EmbeddedCodeBlock.js +1 -1
  269. package/lib/ui/Form.js +1 -1
  270. package/lib/ui/Frame.js +1 -1
  271. package/lib/ui/HoverCard.js +1 -1
  272. package/lib/ui/Input.js +1 -1
  273. package/lib/ui/Item.js +1 -1
  274. package/lib/ui/Label.js +1 -1
  275. package/lib/ui/NativeSelect.js +1 -1
  276. package/lib/ui/Pagination.js +1 -1
  277. package/lib/ui/Popover.js +1 -1
  278. package/lib/ui/Progress.js +1 -1
  279. package/lib/ui/RadioGroup.js +1 -1
  280. package/lib/ui/ScrollArea.js +1 -1
  281. package/lib/ui/Secret.js +3 -3
  282. package/lib/ui/Secret.js.map +1 -1
  283. package/lib/ui/Separator.js +1 -1
  284. package/lib/ui/Skeleton.js +1 -1
  285. package/lib/ui/Slider.js +1 -1
  286. package/lib/ui/Switch.js +1 -1
  287. package/lib/ui/SyntaxHighlight.js +3 -3
  288. package/lib/ui/Tabs.js +1 -1
  289. package/lib/ui/Textarea.js +1 -1
  290. package/lib/ui/Toggle.js +1 -1
  291. package/lib/ui/ToggleGroup.js +1 -1
  292. package/lib/ui/Value.js +1 -1
  293. package/lib/ui/util.js +1 -1
  294. package/lib/{useMutation-C6RqWmTS.js → useMutation-CFMGlAMW.js} +39 -17
  295. package/lib/useMutation-CFMGlAMW.js.map +1 -0
  296. package/lib/useSuspenseQuery-CSB_rVek.js +1226 -0
  297. package/lib/useSuspenseQuery-CSB_rVek.js.map +1 -0
  298. package/lib/zudoku.__internal.js +826 -1325
  299. package/lib/zudoku.__internal.js.map +1 -1
  300. package/lib/zudoku.auth-auth0.js +16 -16
  301. package/lib/zudoku.auth-auth0.js.map +1 -1
  302. package/lib/zudoku.auth-azureb2c.js +4 -4
  303. package/lib/zudoku.auth-clerk.js +52 -75
  304. package/lib/zudoku.auth-clerk.js.map +1 -1
  305. package/lib/zudoku.auth-firebase.js +6 -5
  306. package/lib/zudoku.auth-firebase.js.map +1 -1
  307. package/lib/zudoku.auth-openid.js +5 -5
  308. package/lib/zudoku.auth-supabase.js +31 -40
  309. package/lib/zudoku.auth-supabase.js.map +1 -1
  310. package/lib/zudoku.components.js +23 -21
  311. package/lib/zudoku.hooks.js +3 -3
  312. package/lib/zudoku.mermaid.js +3 -3
  313. package/lib/zudoku.plugin-api-catalog.js +8 -8
  314. package/lib/zudoku.plugin-api-keys.js +607 -552
  315. package/lib/zudoku.plugin-api-keys.js.map +1 -1
  316. package/lib/zudoku.plugin-custom-pages.js +1 -1
  317. package/lib/zudoku.plugin-markdown.js +1 -1
  318. package/lib/zudoku.plugin-openapi.js +3 -3
  319. package/lib/zudoku.plugin-redirect.js +1 -1
  320. package/lib/zudoku.plugin-search-pagefind.js +30 -29
  321. package/lib/zudoku.plugin-search-pagefind.js.map +1 -1
  322. package/lib/zudoku.plugins.js +9 -8
  323. package/lib/zudoku.plugins.js.map +1 -1
  324. package/lib/zudoku.react-query.js +440 -0
  325. package/lib/zudoku.react-query.js.map +1 -0
  326. package/lib/zudoku.router.js +1130 -1404
  327. package/lib/zudoku.router.js.map +1 -1
  328. package/package.json +36 -22
  329. package/src/lib/auth/issuer.ts +1 -1
  330. package/src/lib/authentication/authentication.ts +8 -2
  331. package/src/lib/authentication/components/CallbackHandler.tsx +1 -1
  332. package/src/lib/authentication/components/SignIn.tsx +5 -2
  333. package/src/lib/authentication/components/SignUp.tsx +5 -2
  334. package/src/lib/authentication/hook.ts +16 -0
  335. package/src/lib/authentication/providers/auth0.tsx +15 -9
  336. package/src/lib/authentication/providers/clerk.tsx +0 -26
  337. package/src/lib/authentication/providers/firebase.tsx +98 -6
  338. package/src/lib/authentication/providers/supabase.tsx +6 -15
  339. package/src/lib/authentication/ui/EmailVerificationUi.tsx +129 -0
  340. package/src/lib/authentication/ui/ZudokuAuthUi.tsx +181 -39
  341. package/src/lib/authentication/utils/relativeRedirectUrl.ts +12 -0
  342. package/src/lib/components/Bootstrap.tsx +1 -4
  343. package/src/lib/components/Pagination.tsx +4 -5
  344. package/src/lib/components/Zudoku.tsx +5 -11
  345. package/src/lib/components/context/ZudokuContext.ts +2 -6
  346. package/src/lib/components/context/ZudokuProvider.tsx +1 -1
  347. package/src/lib/components/context/ZudokuReactContext.tsx +17 -0
  348. package/src/lib/components/index.ts +4 -0
  349. package/src/lib/components/navigation/NavigationItem.tsx +9 -3
  350. package/src/lib/core/RouteGuard.tsx +30 -24
  351. package/src/lib/core/plugins.ts +21 -1
  352. package/src/lib/core/react-query.ts +1 -0
  353. package/src/lib/core/transform-config.ts +29 -0
  354. package/src/lib/errors/ErrorAlert.tsx +1 -6
  355. package/src/lib/errors/ErrorMessage.tsx +38 -0
  356. package/src/lib/oas/graphql/circular.test.ts +186 -0
  357. package/src/lib/oas/graphql/circular.ts +49 -10
  358. package/src/lib/oas/graphql/index.ts +7 -3
  359. package/src/lib/plugins/api-keys/SettingsApiKeys.tsx +36 -476
  360. package/src/lib/plugins/api-keys/index.tsx +76 -32
  361. package/src/lib/plugins/api-keys/settings/ApiKeyItem.tsx +342 -0
  362. package/src/lib/plugins/api-keys/settings/ApiKeyList.tsx +67 -0
  363. package/src/lib/plugins/api-keys/settings/RevealApiKey.tsx +124 -0
  364. package/src/lib/plugins/openapi/OasProvider.tsx +10 -2
  365. package/src/lib/plugins/openapi/OperationList.tsx +4 -4
  366. package/src/lib/plugins/openapi/ParamInfos.tsx +1 -0
  367. package/src/lib/plugins/openapi/Sidecar.tsx +3 -2
  368. package/src/lib/plugins/openapi/interfaces.ts +6 -1
  369. package/src/lib/plugins/openapi/schema/SchemaView.tsx +6 -4
  370. package/src/lib/plugins/openapi/schema/utils.ts +15 -4
  371. package/src/lib/plugins/openapi/util/createHttpSnippet.ts +29 -1
  372. package/src/lib/plugins/openapi/util/getRoutes.tsx +4 -1
  373. package/src/lib/ui/Button.tsx +1 -0
  374. package/src/lib/ui/Secret.tsx +2 -2
  375. package/src/lib/util/invariant.ts +2 -1
  376. package/src/shiki/langs/c3.js +1 -0
  377. package/src/shiki/langs/gn.js +1 -0
  378. package/src/shiki/langs/moonbit.js +1 -0
  379. package/lib/ClaudeLogo-B4Xxt-x_.js.map +0 -1
  380. package/lib/ErrorAlert-DrOR8w3f.js.map +0 -1
  381. package/lib/OAuthErrorPage-Fq54RLgt.js.map +0 -1
  382. package/lib/OasProvider-DPH8mwDa.js +0 -40
  383. package/lib/OasProvider-DPH8mwDa.js.map +0 -1
  384. package/lib/RouteGuard-9wjejsKm.js +0 -77
  385. package/lib/RouteGuard-9wjejsKm.js.map +0 -1
  386. package/lib/RouterError-DSLXagd5.js +0 -42
  387. package/lib/RouterError-DSLXagd5.js.map +0 -1
  388. package/lib/SchemaView-DVae4RO2.js +0 -597
  389. package/lib/SchemaView-DVae4RO2.js.map +0 -1
  390. package/lib/Select-CkxXP5I7.js.map +0 -1
  391. package/lib/SignUp-BjS4ozA7.js +0 -50
  392. package/lib/SignUp-BjS4ozA7.js.map +0 -1
  393. package/lib/SyntaxHighlight-Kdyskw3C.js.map +0 -1
  394. package/lib/ZudokuContext-BXldanA8.js +0 -1508
  395. package/lib/ZudokuContext-BXldanA8.js.map +0 -1
  396. package/lib/___vite-browser-external_commonjs-proxy-Cga3HsWk.js.map +0 -1
  397. package/lib/chunk-PVWAREVJ-dLIqswPy.js +0 -7965
  398. package/lib/chunk-PVWAREVJ-dLIqswPy.js.map +0 -1
  399. package/lib/cn-dYga0KKN.js.map +0 -1
  400. package/lib/createVariantComponent-B9_dVBvu.js +0 -35
  401. package/lib/createVariantComponent-B9_dVBvu.js.map +0 -1
  402. package/lib/firebase-Cax7HPzn.js.map +0 -1
  403. package/lib/hook-BNxidGQq.js +0 -40
  404. package/lib/hook-BNxidGQq.js.map +0 -1
  405. package/lib/index-CCmMJp02.js +0 -1059
  406. package/lib/index-CCmMJp02.js.map +0 -1
  407. package/lib/index.esm-DDENMN4y.js.map +0 -1
  408. package/lib/invariant-CGOLuIIz.js.map +0 -1
  409. package/lib/mutation-BoVlx8yA.js.map +0 -1
  410. package/lib/useMutation-C6RqWmTS.js.map +0 -1
@@ -0,0 +1,129 @@
1
+ import { useMutation, useQuery } from "@tanstack/react-query";
2
+ import { CheckIcon, MailCheck, RefreshCw } from "lucide-react";
3
+ import { Navigate, useSearchParams } from "react-router";
4
+ import { ActionButton } from "zudoku/ui/ActionButton.js";
5
+ import { Alert, AlertDescription, AlertTitle } from "zudoku/ui/Alert.js";
6
+ import { Button } from "zudoku/ui/Button.js";
7
+ import {
8
+ Card,
9
+ CardContent,
10
+ CardDescription,
11
+ CardHeader,
12
+ CardTitle,
13
+ } from "zudoku/ui/Card.js";
14
+ import createVariantComponent from "../../util/createVariantComponent.js";
15
+ import { getRelativeRedirectUrl } from "../utils/relativeRedirectUrl.js";
16
+
17
+ export const EmailVerificationUi = ({
18
+ onResendVerification,
19
+ onCheckVerification,
20
+ }: {
21
+ onResendVerification: () => Promise<void>;
22
+ onCheckVerification: () => Promise<boolean>;
23
+ }) => {
24
+ const [searchParams] = useSearchParams();
25
+ const redirectTo = searchParams.get("redirectTo");
26
+ const relativeRedirectTo = getRelativeRedirectUrl(redirectTo);
27
+
28
+ const resendMutation = useMutation({
29
+ mutationFn: async () => {
30
+ await onResendVerification();
31
+ },
32
+ });
33
+
34
+ const checkVerificationMutation = useQuery({
35
+ queryKey: ["check-verification"],
36
+ queryFn: async () => {
37
+ const isVerified = await onCheckVerification();
38
+ return isVerified;
39
+ },
40
+ });
41
+
42
+ const error = resendMutation.error ?? checkVerificationMutation.error ?? null;
43
+
44
+ return (
45
+ <AuthCard>
46
+ {checkVerificationMutation.data === true && (
47
+ <Navigate to={relativeRedirectTo} />
48
+ )}
49
+ <CardHeader className="text-center">
50
+ <div className="mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-primary/10">
51
+ <MailCheck className="h-8 w-8 text-primary" />
52
+ </div>
53
+ <CardTitle>Verify your email</CardTitle>
54
+ <CardDescription>We've sent a verification link</CardDescription>
55
+ </CardHeader>
56
+ <CardContent className="flex flex-col gap-4">
57
+ {error && (
58
+ <Alert variant="destructive">
59
+ <AlertTitle>Error</AlertTitle>
60
+ <AlertDescription>{error?.message}</AlertDescription>
61
+ </Alert>
62
+ )}
63
+
64
+ {resendMutation.isSuccess && (
65
+ <Alert>
66
+ <AlertTitle>Email sent</AlertTitle>
67
+ <AlertDescription>
68
+ A new verification email has been sent. Please check your inbox.
69
+ </AlertDescription>
70
+ </Alert>
71
+ )}
72
+
73
+ {checkVerificationMutation.isSuccess &&
74
+ !checkVerificationMutation.data && (
75
+ <Alert>
76
+ <AlertDescription>
77
+ {checkVerificationMutation.isFetching
78
+ ? "Checking verification..."
79
+ : "Your email hasn't been verified yet. Please check your inbox and click the verification link."}
80
+ </AlertDescription>
81
+ </Alert>
82
+ )}
83
+
84
+ <div className="space-y-4">
85
+ <ActionButton
86
+ onClick={() => void checkVerificationMutation.refetch()}
87
+ isPending={checkVerificationMutation.isFetching}
88
+ className="w-full"
89
+ >
90
+ <div className="flex items-center gap-2">
91
+ <CheckIcon className="h-4 w-4" /> Continue
92
+ </div>
93
+ </ActionButton>
94
+
95
+ <div className="relative">
96
+ <div className="absolute inset-0 flex items-center">
97
+ <span className="w-full border-t" />
98
+ </div>
99
+ <div className="relative flex justify-center text-sm">
100
+ <span className="bg-card px-2 text-muted-foreground">
101
+ Didn't receive the email?
102
+ </span>
103
+ </div>
104
+ </div>
105
+
106
+ <Button
107
+ variant="outline"
108
+ onClick={() => void resendMutation.mutate()}
109
+ disabled={resendMutation.isPending}
110
+ className="w-full gap-2"
111
+ >
112
+ {resendMutation.isPending ? (
113
+ <RefreshCw className="h-4 w-4 animate-spin" />
114
+ ) : (
115
+ <RefreshCw className="h-4 w-4" />
116
+ )}
117
+ Resend verification email
118
+ </Button>
119
+ </div>
120
+
121
+ <p className="text-center text-xs text-muted-foreground">
122
+ Make sure to check your spam folder if you don't see the email.
123
+ </p>
124
+ </CardContent>
125
+ </AuthCard>
126
+ );
127
+ };
128
+
129
+ const AuthCard = createVariantComponent(Card, "max-w-md w-full mt-10 mx-auto");
@@ -23,6 +23,7 @@ import {
23
23
  } from "../../ui/Form.js";
24
24
  import { cn } from "../../util/cn.js";
25
25
  import createVariantComponent from "../../util/createVariantComponent.js";
26
+ import { getRelativeRedirectUrl } from "../utils/relativeRedirectUrl.js";
26
27
  import AppleIcon from "./icons/Apple.js";
27
28
  import FacebookIcon from "./icons/Facebook.js";
28
29
  import GithubIcon from "./icons/Github.js";
@@ -137,8 +138,10 @@ export const ZudokuSignInUi = ({
137
138
  providers,
138
139
  onOAuthSignIn,
139
140
  onUsernamePasswordSignIn,
141
+ enableUsernamePassword,
140
142
  }: {
141
143
  providers: string[];
144
+ enableUsernamePassword: boolean;
142
145
  onOAuthSignIn: (providerId: string) => Promise<void>;
143
146
  onUsernamePasswordSignIn: (email: string, password: string) => Promise<void>;
144
147
  }) => {
@@ -146,8 +149,20 @@ export const ZudokuSignInUi = ({
146
149
  const [searchParams] = useSearchParams();
147
150
  const redirectTo = searchParams.get("redirectTo");
148
151
 
152
+ const relativeRedirectTo = getRelativeRedirectUrl(redirectTo);
153
+
154
+ const invalidProviders = providers.filter(
155
+ (provider) => !isValidAuthProviderId(provider),
156
+ );
157
+
158
+ if (invalidProviders.length > 0) {
159
+ throw new Error(
160
+ `Unsupported auth provider: ${invalidProviders.join(", ")}`,
161
+ );
162
+ }
163
+
149
164
  if (!isAuthProviderIdArray(providers)) {
150
- throw new Error("Invalid auth provider IDs");
165
+ throw new Error(`Unsupported auth provider: ${providers.join(", ")}`);
151
166
  }
152
167
 
153
168
  const signInUsernameMutation = useMutation({
@@ -155,7 +170,7 @@ export const ZudokuSignInUi = ({
155
170
  await onUsernamePasswordSignIn(email, password);
156
171
  },
157
172
  onSuccess: () => {
158
- void navigate(redirectTo ?? "/");
173
+ void navigate(relativeRedirectTo);
159
174
  },
160
175
  });
161
176
  const signInByProviderMutation = useMutation({
@@ -163,7 +178,7 @@ export const ZudokuSignInUi = ({
163
178
  await onOAuthSignIn(providerId);
164
179
  },
165
180
  onSuccess: () => {
166
- void navigate(redirectTo ?? "/");
181
+ void navigate(relativeRedirectTo);
167
182
  },
168
183
  });
169
184
 
@@ -192,24 +207,38 @@ export const ZudokuSignInUi = ({
192
207
  <AlertDescription>{error?.message}</AlertDescription>
193
208
  </Alert>
194
209
  )}
195
- <EmailPasswordForm
196
- form={form}
197
- onSubmit={(data) =>
198
- void signInUsernameMutation.mutate({
199
- email: data.email,
200
- password: data.password,
201
- })
202
- }
203
- submitLabel="Sign in"
204
- isPending={pending}
205
- />
206
- <ProviderSeparator providers={providers} />
207
- <ProviderButtons
208
- providers={providers}
209
- onClick={(providerId) =>
210
- signInByProviderMutation.mutate({ providerId })
211
- }
212
- />
210
+ {enableUsernamePassword && (
211
+ <>
212
+ <EmailPasswordForm
213
+ form={form}
214
+ onSubmit={(data) =>
215
+ void signInUsernameMutation.mutate({
216
+ email: data.email,
217
+ password: data.password,
218
+ })
219
+ }
220
+ submitLabel="Sign in"
221
+ isPending={pending}
222
+ />
223
+ <Link
224
+ to="/reset-password"
225
+ className="text-sm text-muted-foreground text-right -mt-2"
226
+ >
227
+ Forgot password?
228
+ </Link>
229
+ </>
230
+ )}
231
+ {enableUsernamePassword && providers.length > 0 && (
232
+ <ProviderSeparator providers={providers} />
233
+ )}
234
+ {providers.length > 0 && (
235
+ <ProviderButtons
236
+ providers={providers}
237
+ onClick={(providerId) =>
238
+ signInByProviderMutation.mutate({ providerId })
239
+ }
240
+ />
241
+ )}
213
242
  <Link to="/signup" className="text-sm text-muted-foreground">
214
243
  Don't have an account? Sign up.
215
244
  </Link>
@@ -220,13 +249,21 @@ export const ZudokuSignInUi = ({
220
249
 
221
250
  export const ZudokuSignUpUi = ({
222
251
  providers,
252
+ enableUsernamePassword,
223
253
  onOAuthSignUp,
224
254
  onUsernamePasswordSignUp,
225
255
  }: {
226
256
  providers: string[];
257
+ enableUsernamePassword: boolean;
227
258
  onOAuthSignUp: (providerId: string) => Promise<void>;
228
259
  onUsernamePasswordSignUp: (email: string, password: string) => Promise<void>;
229
260
  }) => {
261
+ const navigate = useNavigate();
262
+ const [searchParams] = useSearchParams();
263
+ const redirectTo = searchParams.get("redirectTo");
264
+
265
+ const relativeRedirectTo = redirectTo?.replace(window.location.origin, "");
266
+
230
267
  if (!isAuthProviderIdArray(providers)) {
231
268
  throw new Error("Invalid auth provider IDs");
232
269
  }
@@ -235,12 +272,18 @@ export const ZudokuSignUpUi = ({
235
272
  mutationFn: async ({ email, password }: FormFields) => {
236
273
  await onUsernamePasswordSignUp(email, password);
237
274
  },
275
+ onSuccess: () => {
276
+ void navigate(relativeRedirectTo ?? "/");
277
+ },
238
278
  });
239
279
 
240
280
  const signUpByProviderMutation = useMutation({
241
281
  mutationFn: async ({ providerId }: { providerId: string }) => {
242
282
  await onOAuthSignUp(providerId);
243
283
  },
284
+ onSuccess: () => {
285
+ void navigate(relativeRedirectTo ?? "/");
286
+ },
244
287
  });
245
288
 
246
289
  const form = useForm<FormFields>({
@@ -269,24 +312,30 @@ export const ZudokuSignUpUi = ({
269
312
  </Alert>
270
313
  )}
271
314
 
272
- <EmailPasswordForm
273
- form={form}
274
- onSubmit={(data) =>
275
- void signUpUsernameMutation.mutate({
276
- email: data.email,
277
- password: data.password,
278
- })
279
- }
280
- submitLabel="Sign up"
281
- isPending={pending}
282
- />
283
- <ProviderSeparator providers={providers} />
284
- <ProviderButtons
285
- providers={providers}
286
- onClick={(providerId) =>
287
- signUpByProviderMutation.mutate({ providerId })
288
- }
289
- />
315
+ {enableUsernamePassword && (
316
+ <EmailPasswordForm
317
+ form={form}
318
+ onSubmit={(data) =>
319
+ void signUpUsernameMutation.mutate({
320
+ email: data.email,
321
+ password: data.password,
322
+ })
323
+ }
324
+ submitLabel="Sign up"
325
+ isPending={pending}
326
+ />
327
+ )}
328
+ {enableUsernamePassword && providers.length > 0 && (
329
+ <ProviderSeparator providers={providers} />
330
+ )}
331
+ {providers.length > 0 && (
332
+ <ProviderButtons
333
+ providers={providers}
334
+ onClick={(providerId) =>
335
+ signUpByProviderMutation.mutate({ providerId })
336
+ }
337
+ />
338
+ )}
290
339
  <Link to="/signin" className="text-sm text-muted-foreground">
291
340
  Already have an account? Sign in.
292
341
  </Link>
@@ -333,3 +382,96 @@ const ProviderSeparator = ({ providers }: { providers: AuthProviderId[] }) => {
333
382
  )
334
383
  );
335
384
  };
385
+
386
+ export const ZudokuPasswordResetUi = ({
387
+ onPasswordReset,
388
+ }: {
389
+ onPasswordReset: (email: string) => Promise<void>;
390
+ }) => {
391
+ const [isSubmitted, setIsSubmitted] = React.useState(false);
392
+
393
+ const passwordResetMutation = useMutation({
394
+ mutationFn: async ({ email }: { email: string }) => {
395
+ await onPasswordReset(email);
396
+ },
397
+ onSuccess: () => {
398
+ setIsSubmitted(true);
399
+ },
400
+ });
401
+
402
+ const form = useForm<{ email: string }>({
403
+ defaultValues: {
404
+ email: "",
405
+ },
406
+ });
407
+
408
+ const error = passwordResetMutation.error;
409
+
410
+ return (
411
+ <AuthCard>
412
+ <CardHeader>
413
+ <CardTitle>Reset password</CardTitle>
414
+ <CardDescription>
415
+ {isSubmitted
416
+ ? "Check your email for a password reset link."
417
+ : "Enter your email address and we'll send you a link to reset your password."}
418
+ </CardDescription>
419
+ </CardHeader>
420
+ <CardContent className="flex flex-col gap-4">
421
+ {error && (
422
+ <Alert variant="destructive">
423
+ <AlertTitle>Error</AlertTitle>
424
+ <AlertDescription>{error?.message}</AlertDescription>
425
+ </Alert>
426
+ )}
427
+ {isSubmitted ? (
428
+ <div className="flex flex-col gap-4">
429
+ <Alert>
430
+ <AlertTitle>Email sent</AlertTitle>
431
+ <AlertDescription>
432
+ If an account exists with that email address, you will receive a
433
+ password reset link shortly.
434
+ </AlertDescription>
435
+ </Alert>
436
+ <Link to="/signin">
437
+ <Button variant="outline" className="w-full">
438
+ Back to sign in
439
+ </Button>
440
+ </Link>
441
+ </div>
442
+ ) : (
443
+ <>
444
+ <Form {...form}>
445
+ <form
446
+ onSubmit={form.handleSubmit((data) =>
447
+ passwordResetMutation.mutate({ email: data.email }),
448
+ )}
449
+ className="flex flex-col gap-2"
450
+ >
451
+ <FormItem>
452
+ <FormLabel>Email</FormLabel>
453
+ <FormControl>
454
+ <Input
455
+ placeholder="you@example.com"
456
+ {...form.register("email")}
457
+ />
458
+ </FormControl>
459
+ <FormMessage />
460
+ </FormItem>
461
+ <ActionButton
462
+ type="submit"
463
+ isPending={passwordResetMutation.isPending}
464
+ >
465
+ Reset password
466
+ </ActionButton>
467
+ </form>
468
+ </Form>
469
+ <Link to="/signin" className="text-sm text-muted-foreground">
470
+ Sign in
471
+ </Link>
472
+ </>
473
+ )}
474
+ </CardContent>
475
+ </AuthCard>
476
+ );
477
+ };
@@ -0,0 +1,12 @@
1
+ import { joinUrl } from "../../util/joinUrl.js";
2
+
3
+ export const getRelativeRedirectUrl = (redirectTo?: string | null) => {
4
+ if (!redirectTo) {
5
+ return "/";
6
+ }
7
+
8
+ return redirectTo.replace(
9
+ joinUrl(window.location.origin, import.meta.env.BASE_URL),
10
+ "",
11
+ );
12
+ };
@@ -12,7 +12,6 @@ import {
12
12
  StaticRouterProvider,
13
13
  } from "react-router";
14
14
  import { RouterProvider } from "react-router/dom";
15
- import { StaggeredRenderContext } from "../plugins/openapi/StaggeredRender.js";
16
15
  import { BypassProtectedRoutesContext } from "./context/BypassProtectedRoutesContext.js";
17
16
 
18
17
  const queryClient = new QueryClient({
@@ -36,9 +35,7 @@ const Bootstrap = ({
36
35
  <HydrationBoundary state={hydrate ? (window as any).DATA : undefined}>
37
36
  <BypassProtectedRoutesContext value={false}>
38
37
  <HelmetProvider>
39
- <StaggeredRenderContext.Provider value={{ stagger: !hydrate }}>
40
- <RouterProvider router={router} />
41
- </StaggeredRenderContext.Provider>
38
+ <RouterProvider router={router} />
42
39
  </HelmetProvider>
43
40
  </BypassProtectedRoutesContext>
44
41
  </HydrationBoundary>
@@ -13,19 +13,18 @@ export const Pagination = ({
13
13
  className?: string;
14
14
  }) => {
15
15
  const linkClass =
16
- "group transition-all p-5 space-x-1 rtl:space-x-reverse transition-all hover:text-foreground";
17
-
16
+ "group min-w-0 transition-all p-5 space-x-1 rtl:space-x-reverse hover:text-foreground";
18
17
  return (
19
18
  <div
20
19
  className={cn(
21
- "flex -mx-4 text-muted-foreground font-semibold",
20
+ "flex flex-wrap gap-2 -mx-4 text-muted-foreground font-semibold",
22
21
  prev ? "justify-between" : "justify-end",
23
22
  className,
24
23
  )}
25
24
  data-pagefind-ignore="all"
26
25
  >
27
26
  {prev && (
28
- <Button variant="ghost" asChild>
27
+ <Button variant="ghost" className="min-w-0 max-w-full" asChild>
29
28
  <Link to={prev.to} relative="path" className={linkClass}>
30
29
  <ArrowLeftIcon size={14} strokeWidth={2.5} />
31
30
  <span className="text-lg truncate">{prev.label}</span>
@@ -33,7 +32,7 @@ export const Pagination = ({
33
32
  </Button>
34
33
  )}
35
34
  {next && (
36
- <Button variant="ghost" asChild>
35
+ <Button variant="ghost" className="ms-auto min-w-0 max-w-full" asChild>
37
36
  <Link to={next.to} relative="path" className={linkClass}>
38
37
  <span className="text-lg truncate">{next.label}</span>
39
38
  <ArrowRightIcon size={14} strokeWidth={2.5} />
@@ -5,7 +5,7 @@ import { ThemeProvider } from "next-themes";
5
5
  import {
6
6
  memo,
7
7
  type PropsWithChildren,
8
- useContext,
8
+ Suspense,
9
9
  useEffect,
10
10
  useMemo,
11
11
  useState,
@@ -18,7 +18,6 @@ import {
18
18
  type ZudokuContextOptions,
19
19
  } from "../core/ZudokuContext.js";
20
20
  import { TopLevelError } from "../errors/TopLevelError.js";
21
- import { StaggeredRenderContext } from "../plugins/openapi/StaggeredRender.js";
22
21
  import { MdxComponents } from "../util/MdxComponents.js";
23
22
  import "../util/requestIdleCallbackPolyfill.js";
24
23
  import {
@@ -56,12 +55,7 @@ const ZudokuInner = memo(
56
55
  ...props.mdx?.components,
57
56
  };
58
57
  }, [props.mdx?.components, props.plugins]);
59
- const { stagger } = useContext(StaggeredRenderContext);
60
58
  const [didNavigate, setDidNavigate] = useState(false);
61
- const staggeredValue = useMemo(
62
- () => (didNavigate ? { stagger: true } : { stagger }),
63
- [stagger, didNavigate],
64
- );
65
59
  const navigation = useNavigation();
66
60
  const queryClient = useQueryClient();
67
61
 
@@ -81,8 +75,8 @@ const ZudokuInner = memo(
81
75
  return (
82
76
  <>
83
77
  <Helmet>{heads}</Helmet>
84
- <StaggeredRenderContext.Provider value={staggeredValue}>
85
- <ZudokuProvider context={zudokuContext}>
78
+ <ZudokuProvider context={zudokuContext}>
79
+ <Suspense fallback={<div>Zudoku Loading...</div>}>
86
80
  <RouterEventsEmitter />
87
81
  <SlotProvider slots={props.slots ?? props.UNSAFE_slotlets}>
88
82
  <MDXProvider components={mdxComponents}>
@@ -95,8 +89,8 @@ const ZudokuInner = memo(
95
89
  </ThemeProvider>
96
90
  </MDXProvider>
97
91
  </SlotProvider>
98
- </ZudokuProvider>
99
- </StaggeredRenderContext.Provider>
92
+ </Suspense>
93
+ </ZudokuProvider>
100
94
  </>
101
95
  );
102
96
  },
@@ -1,16 +1,12 @@
1
1
  import { useQuery, useSuspenseQuery } from "@tanstack/react-query";
2
- import { createContext, useContext, useEffect } from "react";
2
+ import { useContext, useEffect } from "react";
3
3
  import { matchPath, useLocation } from "react-router";
4
4
  import type { NavigationItem } from "../../../config/validators/NavigationSchema.js";
5
5
  import { useAuthState } from "../../authentication/state.js";
6
- import type { ZudokuContext } from "../../core/ZudokuContext.js";
7
6
  import { joinUrl } from "../../util/joinUrl.js";
8
7
  import { CACHE_KEYS, useCache } from "../cache.js";
9
8
  import { traverseNavigation } from "../navigation/utils.js";
10
-
11
- export const ZudokuReactContext = createContext<ZudokuContext | undefined>(
12
- undefined,
13
- );
9
+ import { ZudokuReactContext } from "./ZudokuReactContext.js";
14
10
 
15
11
  export const useZudoku = () => {
16
12
  const context = useContext(ZudokuReactContext);
@@ -2,7 +2,7 @@ import { useSuspenseQuery } from "@tanstack/react-query";
2
2
  import type { PropsWithChildren } from "react";
3
3
  import type { ZudokuContext } from "../../core/ZudokuContext.js";
4
4
  import { NO_DEHYDRATE } from "../cache.js";
5
- import { ZudokuReactContext } from "./ZudokuContext.js";
5
+ import { ZudokuReactContext } from "./ZudokuReactContext.js";
6
6
 
7
7
  export const ZudokuProvider = ({
8
8
  children,
@@ -0,0 +1,17 @@
1
+ import { type Context, createContext } from "react";
2
+ import type { ZudokuContext } from "../../core/ZudokuContext.js";
3
+
4
+ /**
5
+ * During SSR, Vite's module runner can load the same module multiple times
6
+ * (once for the main app, once for external plugins), creating duplicate
7
+ * React contexts that don't share state.
8
+ */
9
+ declare global {
10
+ var __ZUDOKU_CONTEXT: Context<ZudokuContext | undefined>;
11
+ }
12
+
13
+ globalThis.__ZUDOKU_CONTEXT ??= createContext<ZudokuContext | undefined>(
14
+ undefined,
15
+ );
16
+
17
+ export const ZudokuReactContext = globalThis.__ZUDOKU_CONTEXT;
@@ -5,12 +5,14 @@ import { Link as LinkImport } from "react-router";
5
5
  import { useAuth as useAuthImport } from "../authentication/hook.js";
6
6
  import { Button as ButtonImport } from "../ui/Button.js";
7
7
  import { Callout as CalloutImport } from "../ui/Callout.js";
8
+ import { ZudokuError as ZudokuErrorImport } from "../util/invariant.js";
8
9
  import { ClientOnly as ClientOnlyImport } from "./ClientOnly.js";
9
10
  import {
10
11
  CACHE_KEYS as CACHE_KEYS_IMPORT,
11
12
  useCache as useCacheImport,
12
13
  } from "./cache.js";
13
14
  import { useZudoku as useZudokuImport } from "./context/ZudokuContext.js";
15
+ import { Heading as HeadingImport } from "./Heading.js";
14
16
  import { Markdown as MarkdownImport } from "./Markdown.js";
15
17
  import { Slot as SlotImport } from "./Slot.js";
16
18
  import { Spinner as SpinnerImport } from "./Spinner.js";
@@ -18,6 +20,7 @@ import { Typography as TypographyImport } from "./Typography.js";
18
20
  import { Zudoku as ZudokuImport } from "./Zudoku.js";
19
21
 
20
22
  export const Head = /*@__PURE__*/ Helmet;
23
+ export const Heading = /*@__PURE__*/ HeadingImport;
21
24
  export const Callout = /*@__PURE__*/ CalloutImport;
22
25
  export const Markdown = /*@__PURE__*/ MarkdownImport;
23
26
  export const Spinner = /*@__PURE__*/ SpinnerImport;
@@ -27,6 +30,7 @@ export const Link = /*@__PURE__*/ LinkImport;
27
30
  export const Zudoku = /*@__PURE__*/ ZudokuImport;
28
31
  export const Typography = /*@__PURE__*/ TypographyImport;
29
32
  export const Slot = /*@__PURE__*/ SlotImport;
33
+ export const ZudokuError = /*@__PURE__*/ ZudokuErrorImport;
30
34
 
31
35
  /** @deprecated Import from `zudoku/hooks` instead */
32
36
  export const useMDXComponents = /*@__PURE__*/ useMDXComponentsImport;
@@ -86,7 +86,9 @@ export const NavigationItem = ({
86
86
  onClick={onRequestClose}
87
87
  end
88
88
  >
89
- {item.icon && <item.icon size={16} className="align-[-0.125em]" />}
89
+ {item.icon && (
90
+ <item.icon size={16} className="align-[-0.125em] shrink-0" />
91
+ )}
90
92
  {item.badge ? (
91
93
  <>
92
94
  {item.label && (
@@ -117,7 +119,9 @@ export const NavigationItem = ({
117
119
  })}
118
120
  onClick={onRequestClose}
119
121
  >
120
- {item.icon && <item.icon size={16} className="align-[-0.125em]" />}
122
+ {item.icon && (
123
+ <item.icon size={16} className="align-[-0.125em] shrink-0" />
124
+ )}
121
125
  {item.badge ? (
122
126
  <>
123
127
  {item.label && <TruncatedLabel label={item.label} />}
@@ -135,7 +139,9 @@ export const NavigationItem = ({
135
139
  rel="noopener noreferrer"
136
140
  onClick={onRequestClose}
137
141
  >
138
- {item.icon && <item.icon size={16} className="align-[-0.125em]" />}
142
+ {item.icon && (
143
+ <item.icon size={16} className="align-[-0.125em] shrink-0" />
144
+ )}
139
145
  <span className="whitespace-normal">{item.label}</span>
140
146
  {/* This prevents that the icon would be positioned in its own line if the text fills a line entirely */}
141
147
  <span className="whitespace-nowrap">