zudoku 0.0.0-fcb84d6 → 0.0.0-ff3751f

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 (455) hide show
  1. package/README.md +121 -0
  2. package/cli.js +2 -2
  3. package/dist/app/entry.client.js +2 -2
  4. package/dist/app/entry.client.js.map +1 -1
  5. package/dist/app/entry.server.js +3 -0
  6. package/dist/app/entry.server.js.map +1 -1
  7. package/dist/app/main.d.ts +1 -0
  8. package/dist/app/main.js +9 -26
  9. package/dist/app/main.js.map +1 -1
  10. package/dist/app/standalone.js.map +1 -1
  11. package/dist/cli/cli.js +1 -2
  12. package/dist/cli/cli.js.map +1 -1
  13. package/dist/cli/common/machine-id/lib.js.map +1 -1
  14. package/dist/cli/common/outdated.js.map +1 -1
  15. package/dist/cli/common/utils/box.js.map +1 -1
  16. package/dist/config/validators/InputSidebarSchema.d.ts +2 -2
  17. package/dist/config/validators/SidebarSchema.d.ts +24 -1
  18. package/dist/config/validators/SidebarSchema.js +76 -39
  19. package/dist/config/validators/SidebarSchema.js.map +1 -1
  20. package/dist/config/validators/validate.d.ts +406 -260
  21. package/dist/config/validators/validate.js +23 -7
  22. package/dist/config/validators/validate.js.map +1 -1
  23. package/dist/index.d.ts +4 -1
  24. package/dist/index.js +1 -1
  25. package/dist/index.js.map +1 -1
  26. package/dist/lib/authentication/components/CallbackHandler.js +21 -31
  27. package/dist/lib/authentication/components/CallbackHandler.js.map +1 -1
  28. package/dist/lib/authentication/hook.d.ts +1 -1
  29. package/dist/lib/authentication/hook.js +1 -1
  30. package/dist/lib/authentication/hook.js.map +1 -1
  31. package/dist/lib/components/Header.js +6 -1
  32. package/dist/lib/components/Header.js.map +1 -1
  33. package/dist/lib/components/Heading.d.ts +1 -1
  34. package/dist/lib/components/MobileTopNavigation.js +4 -1
  35. package/dist/lib/components/MobileTopNavigation.js.map +1 -1
  36. package/dist/lib/components/SlotletProvider.d.ts +2 -1
  37. package/dist/lib/components/SlotletProvider.js.map +1 -1
  38. package/dist/lib/components/SyntaxHighlight.js +4 -1
  39. package/dist/lib/components/SyntaxHighlight.js.map +1 -1
  40. package/dist/lib/components/TopNavigation.d.ts +3 -0
  41. package/dist/lib/components/TopNavigation.js +38 -5
  42. package/dist/lib/components/TopNavigation.js.map +1 -1
  43. package/dist/lib/components/context/ZudokuContext.d.ts +6 -10
  44. package/dist/lib/components/context/ZudokuContext.js +26 -20
  45. package/dist/lib/components/context/ZudokuContext.js.map +1 -1
  46. package/dist/lib/components/index.d.ts +17 -8
  47. package/dist/lib/components/index.js +10 -3
  48. package/dist/lib/components/index.js.map +1 -1
  49. package/dist/lib/components/navigation/Sidebar.js +3 -3
  50. package/dist/lib/components/navigation/Sidebar.js.map +1 -1
  51. package/dist/lib/components/navigation/SidebarCategory.js +12 -7
  52. package/dist/lib/components/navigation/SidebarCategory.js.map +1 -1
  53. package/dist/lib/components/navigation/SidebarItem.js +3 -5
  54. package/dist/lib/components/navigation/SidebarItem.js.map +1 -1
  55. package/dist/lib/components/navigation/utils.js +10 -14
  56. package/dist/lib/components/navigation/utils.js.map +1 -1
  57. package/dist/lib/core/DevPortalContext.d.ts +3 -6
  58. package/dist/lib/core/DevPortalContext.js.map +1 -1
  59. package/dist/lib/core/plugins.d.ts +1 -0
  60. package/dist/lib/core/plugins.js.map +1 -1
  61. package/dist/lib/errors/ErrorAlert.d.ts +1 -1
  62. package/dist/lib/errors/ErrorAlert.js +8 -3
  63. package/dist/lib/errors/ErrorAlert.js.map +1 -1
  64. package/dist/lib/plugins/api-keys/CreateApiKey.js +1 -1
  65. package/dist/lib/plugins/api-keys/CreateApiKey.js.map +1 -1
  66. package/dist/lib/plugins/custom-pages/CustomPage.js +2 -2
  67. package/dist/lib/plugins/markdown/index.d.ts +5 -6
  68. package/dist/lib/plugins/markdown/index.js +31 -3
  69. package/dist/lib/plugins/markdown/index.js.map +1 -1
  70. package/dist/lib/plugins/markdown/resolver.d.ts +38 -0
  71. package/dist/lib/plugins/markdown/resolver.js +75 -0
  72. package/dist/lib/plugins/markdown/resolver.js.map +1 -0
  73. package/dist/lib/plugins/openapi/Endpoint.js.map +1 -1
  74. package/dist/lib/plugins/openapi/RequestBodySidecarBox.js.map +1 -1
  75. package/dist/lib/plugins/openapi/Sidecar.js +2 -2
  76. package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
  77. package/dist/lib/plugins/openapi/client/worker.js.map +1 -1
  78. package/dist/lib/plugins/openapi/index.js.map +1 -1
  79. package/dist/lib/plugins/openapi/playground/Playground.js +2 -1
  80. package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
  81. package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js +1 -1
  82. package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js.map +1 -1
  83. package/dist/lib/plugins/redirect/index.d.ts +2 -5
  84. package/dist/lib/plugins/redirect/index.js +1 -1
  85. package/dist/lib/plugins/redirect/index.js.map +1 -1
  86. package/dist/lib/ui/Accordion.d.ts +7 -0
  87. package/dist/lib/ui/Accordion.js +14 -0
  88. package/dist/lib/ui/Accordion.js.map +1 -0
  89. package/dist/lib/ui/Alert.d.ts +8 -0
  90. package/dist/lib/ui/Alert.js +23 -0
  91. package/dist/lib/ui/Alert.js.map +1 -0
  92. package/dist/lib/ui/AlertDialog.d.ts +20 -0
  93. package/dist/lib/ui/AlertDialog.js +27 -0
  94. package/dist/lib/ui/AlertDialog.js.map +1 -0
  95. package/dist/lib/ui/AspectRatio.d.ts +3 -0
  96. package/dist/lib/ui/AspectRatio.js +4 -0
  97. package/dist/lib/ui/AspectRatio.js.map +1 -0
  98. package/dist/lib/ui/Badge.d.ts +9 -0
  99. package/dist/lib/ui/Badge.js +21 -0
  100. package/dist/lib/ui/Badge.js.map +1 -0
  101. package/dist/lib/ui/Breadcrumb.d.ts +19 -0
  102. package/dist/lib/ui/Breadcrumb.js +24 -0
  103. package/dist/lib/ui/Breadcrumb.js.map +1 -0
  104. package/dist/lib/ui/Button.d.ts +2 -3
  105. package/dist/lib/ui/Button.js +1 -1
  106. package/dist/lib/ui/Button.js.map +1 -1
  107. package/dist/lib/ui/Carousel.d.ts +18 -0
  108. package/dist/lib/ui/Carousel.js +99 -0
  109. package/dist/lib/ui/Carousel.js.map +1 -0
  110. package/dist/lib/ui/Checkbox.d.ts +4 -0
  111. package/dist/lib/ui/Checkbox.js +9 -0
  112. package/dist/lib/ui/Checkbox.js.map +1 -0
  113. package/dist/lib/ui/Collapsible.d.ts +5 -0
  114. package/dist/lib/ui/Collapsible.js +6 -0
  115. package/dist/lib/ui/Collapsible.js.map +1 -0
  116. package/dist/lib/ui/Command.d.ts +80 -0
  117. package/dist/lib/ui/Command.js +31 -0
  118. package/dist/lib/ui/Command.js.map +1 -0
  119. package/dist/lib/{components → ui}/Dialog.js +2 -2
  120. package/dist/lib/ui/Dialog.js.map +1 -0
  121. package/dist/lib/ui/Form.d.ts +23 -0
  122. package/dist/lib/ui/Form.js +63 -0
  123. package/dist/lib/ui/Form.js.map +1 -0
  124. package/dist/lib/ui/HoverCard.d.ts +6 -0
  125. package/dist/lib/ui/HoverCard.js +10 -0
  126. package/dist/lib/ui/HoverCard.js.map +1 -0
  127. package/dist/lib/ui/Label.d.ts +5 -0
  128. package/dist/lib/ui/Label.js +10 -0
  129. package/dist/lib/ui/Label.js.map +1 -0
  130. package/dist/lib/ui/Pagination.d.ts +28 -0
  131. package/dist/lib/ui/Pagination.js +24 -0
  132. package/dist/lib/ui/Pagination.js.map +1 -0
  133. package/dist/lib/ui/Popover.d.ts +6 -0
  134. package/dist/lib/ui/Popover.js +10 -0
  135. package/dist/lib/ui/Popover.js.map +1 -0
  136. package/dist/lib/ui/Progress.d.ts +4 -0
  137. package/dist/lib/ui/Progress.js +8 -0
  138. package/dist/lib/ui/Progress.js.map +1 -0
  139. package/dist/lib/ui/RadioGroup.d.ts +5 -0
  140. package/dist/lib/ui/RadioGroup.js +15 -0
  141. package/dist/lib/ui/RadioGroup.js.map +1 -0
  142. package/dist/lib/ui/ScrollArea.d.ts +5 -0
  143. package/dist/lib/ui/ScrollArea.js +12 -0
  144. package/dist/lib/ui/ScrollArea.js.map +1 -0
  145. package/dist/lib/ui/Select.js.map +1 -0
  146. package/dist/lib/ui/Skeleton.d.ts +2 -0
  147. package/dist/lib/ui/Skeleton.js +7 -0
  148. package/dist/lib/ui/Skeleton.js.map +1 -0
  149. package/dist/lib/ui/Slider.d.ts +4 -0
  150. package/dist/lib/ui/Slider.js +8 -0
  151. package/dist/lib/ui/Slider.js.map +1 -0
  152. package/dist/lib/ui/Switch.d.ts +4 -0
  153. package/dist/lib/ui/Switch.js +8 -0
  154. package/dist/lib/ui/Switch.js.map +1 -0
  155. package/dist/lib/ui/Textarea.d.ts +4 -0
  156. package/dist/lib/ui/Textarea.js +9 -0
  157. package/dist/lib/ui/Textarea.js.map +1 -0
  158. package/dist/lib/ui/Toggle.d.ts +12 -0
  159. package/dist/lib/ui/Toggle.js +26 -0
  160. package/dist/lib/ui/Toggle.js.map +1 -0
  161. package/dist/lib/ui/ToggleGroup.d.ts +12 -0
  162. package/dist/lib/ui/ToggleGroup.js +21 -0
  163. package/dist/lib/ui/ToggleGroup.js.map +1 -0
  164. package/dist/lib/ui/Tooltip.d.ts +7 -0
  165. package/dist/lib/ui/Tooltip.js +11 -0
  166. package/dist/lib/ui/Tooltip.js.map +1 -0
  167. package/dist/lib/util/MdxComponents.js.map +1 -1
  168. package/dist/lib/util/invariant.d.ts +9 -0
  169. package/dist/lib/util/invariant.js +7 -3
  170. package/dist/lib/util/invariant.js.map +1 -1
  171. package/dist/lib/util/useExposedProps.js +3 -2
  172. package/dist/lib/util/useExposedProps.js.map +1 -1
  173. package/dist/lib/util/useScrollToAnchor.js.map +1 -1
  174. package/dist/vite/build.js +12 -3
  175. package/dist/vite/build.js.map +1 -1
  176. package/dist/vite/config.d.ts +2 -8
  177. package/dist/vite/config.js +24 -59
  178. package/dist/vite/config.js.map +1 -1
  179. package/dist/vite/debug.d.ts +1 -0
  180. package/dist/vite/debug.js +10 -0
  181. package/dist/vite/debug.js.map +1 -0
  182. package/dist/vite/dev-server.js +1 -1
  183. package/dist/vite/dev-server.js.map +1 -1
  184. package/dist/vite/output.d.ts +101 -0
  185. package/dist/vite/output.js +30 -0
  186. package/dist/vite/output.js.map +1 -0
  187. package/dist/vite/plugin-component.js +17 -7
  188. package/dist/vite/plugin-component.js.map +1 -1
  189. package/dist/vite/plugin-config-reload.js +0 -2
  190. package/dist/vite/plugin-config-reload.js.map +1 -1
  191. package/dist/vite/plugin-config.d.ts +2 -3
  192. package/dist/vite/plugin-config.js +2 -3
  193. package/dist/vite/plugin-config.js.map +1 -1
  194. package/dist/vite/plugin-docs.js +37 -26
  195. package/dist/vite/plugin-docs.js.map +1 -1
  196. package/dist/vite/plugin-frontmatter.d.ts +2 -1
  197. package/dist/vite/plugin-frontmatter.js +27 -24
  198. package/dist/vite/plugin-frontmatter.js.map +1 -1
  199. package/dist/vite/plugin-search.d.ts +3 -0
  200. package/dist/vite/plugin-search.js +26 -0
  201. package/dist/vite/plugin-search.js.map +1 -0
  202. package/dist/vite/plugin-sidebar.js +7 -6
  203. package/dist/vite/plugin-sidebar.js.map +1 -1
  204. package/dist/vite/plugin.js +4 -2
  205. package/dist/vite/plugin.js.map +1 -1
  206. package/dist/vite/prerender.d.ts +5 -1
  207. package/dist/vite/prerender.js +6 -5
  208. package/dist/vite/prerender.js.map +1 -1
  209. package/lib/{utils-C8S3st2k.js → AnchorLink-BbB2q-jx.js} +231 -275
  210. package/lib/AnchorLink-BbB2q-jx.js.map +1 -0
  211. package/lib/{AuthenticationPlugin-D1nhROkO.js → AuthenticationPlugin-C9BHGXlE.js} +3 -3
  212. package/lib/{AuthenticationPlugin-D1nhROkO.js.map → AuthenticationPlugin-C9BHGXlE.js.map} +1 -1
  213. package/lib/{CategoryHeading-B7TlPvuN.js → CategoryHeading-Bb9dqxD3.js} +4 -4
  214. package/lib/{CategoryHeading-B7TlPvuN.js.map → CategoryHeading-Bb9dqxD3.js.map} +1 -1
  215. package/lib/ClientOnly-CVN6leDu.js +11 -0
  216. package/lib/ClientOnly-CVN6leDu.js.map +1 -0
  217. package/lib/{DeveloperHint-B_QCCafl.js → DeveloperHint-DHdLXGHA.js} +2 -2
  218. package/lib/{DeveloperHint-B_QCCafl.js.map → DeveloperHint-DHdLXGHA.js.map} +1 -1
  219. package/lib/Dialog-k70Qfukb.js +67 -0
  220. package/lib/Dialog-k70Qfukb.js.map +1 -0
  221. package/lib/{Markdown-Y__eLG0x.js → Markdown-BDcCAWwm.js} +4268 -6650
  222. package/lib/Markdown-BDcCAWwm.js.map +1 -0
  223. package/lib/{MdxPage-B4FcPIi5.js → MdxPage-DKMH_t0f.js} +33 -31
  224. package/lib/{MdxPage-B4FcPIi5.js.map → MdxPage-DKMH_t0f.js.map} +1 -1
  225. package/lib/{OperationList-DuPG2FA2.js → OperationList-Tj7ubW_t.js} +131 -128
  226. package/lib/OperationList-Tj7ubW_t.js.map +1 -0
  227. package/lib/{Route-Bb3QClHu.js → Route-C3DGB6OS.js} +3 -3
  228. package/lib/{Route-Bb3QClHu.js.map → Route-C3DGB6OS.js.map} +1 -1
  229. package/lib/Select-Bagt3Bme.js +223 -0
  230. package/lib/Select-Bagt3Bme.js.map +1 -0
  231. package/lib/SlotletProvider-Da7eFgd2.js +241 -0
  232. package/lib/SlotletProvider-Da7eFgd2.js.map +1 -0
  233. package/lib/Spinner-C6zroowC.js +40 -0
  234. package/lib/Spinner-C6zroowC.js.map +1 -0
  235. package/lib/StaggeredRender-DDHSzQKE.js +17 -0
  236. package/lib/StaggeredRender-DDHSzQKE.js.map +1 -0
  237. package/lib/{ZudokuContext-MRoel6bS.js → ZudokuContext-BKXGJTmu.js} +460 -411
  238. package/lib/ZudokuContext-BKXGJTmu.js.map +1 -0
  239. package/lib/__vite-browser-external-BYRIRx8p.js +9 -0
  240. package/lib/__vite-browser-external-BYRIRx8p.js.map +1 -0
  241. package/lib/_commonjsHelpers-BkfeUUK-.js +29 -0
  242. package/lib/_commonjsHelpers-BkfeUUK-.js.map +1 -0
  243. package/lib/assets/worker-Bf8vjASY.js.map +1 -1
  244. package/lib/cn-BmFQLtkS.js +2279 -0
  245. package/lib/cn-BmFQLtkS.js.map +1 -0
  246. package/lib/hook-sn0zMTkE.js +229 -0
  247. package/lib/hook-sn0zMTkE.js.map +1 -0
  248. package/lib/{index-CCa8ojDW.js → index-AjWCJNGC.js} +1332 -1606
  249. package/lib/index-AjWCJNGC.js.map +1 -0
  250. package/lib/index-Bn6Lc9tq.js +9 -0
  251. package/lib/{index-DJqnphbT.js.map → index-Bn6Lc9tq.js.map} +1 -1
  252. package/lib/index-BuAyrJe3.js +46 -0
  253. package/lib/index-BuAyrJe3.js.map +1 -0
  254. package/lib/{index-DFN92YJN.js → index-CRo94sKK.js} +5 -4
  255. package/lib/{index-DFN92YJN.js.map → index-CRo94sKK.js.map} +1 -1
  256. package/lib/{index-D06ATMgg.js → index-LNp6rxyU.js} +2 -2
  257. package/lib/{index-D06ATMgg.js.map → index-LNp6rxyU.js.map} +1 -1
  258. package/lib/index.esm-C5mr_sKO.js +1193 -0
  259. package/lib/index.esm-C5mr_sKO.js.map +1 -0
  260. package/lib/invariant-Caa8-XvF.js +26 -0
  261. package/lib/invariant-Caa8-XvF.js.map +1 -0
  262. package/lib/ui/Accordion.js +47 -0
  263. package/lib/ui/Accordion.js.map +1 -0
  264. package/lib/ui/Alert.js +51 -0
  265. package/lib/ui/Alert.js.map +1 -0
  266. package/lib/ui/AlertDialog.js +114 -0
  267. package/lib/ui/AlertDialog.js.map +1 -0
  268. package/lib/ui/AspectRatio.js +6 -0
  269. package/lib/ui/AspectRatio.js.map +1 -0
  270. package/lib/ui/Badge.js +27 -0
  271. package/lib/ui/Badge.js.map +1 -0
  272. package/lib/ui/Breadcrumb.js +94 -0
  273. package/lib/ui/Breadcrumb.js.map +1 -0
  274. package/lib/ui/Button.js +49 -0
  275. package/lib/ui/Button.js.map +1 -0
  276. package/lib/ui/Callout.js +77 -0
  277. package/lib/ui/Callout.js.map +1 -0
  278. package/lib/ui/Card.js +62 -0
  279. package/lib/ui/Card.js.map +1 -0
  280. package/lib/ui/Carousel.js +1410 -0
  281. package/lib/ui/Carousel.js.map +1 -0
  282. package/lib/ui/Checkbox.js +28 -0
  283. package/lib/ui/Checkbox.js.map +1 -0
  284. package/lib/ui/Collapsible.js +8 -0
  285. package/lib/ui/Collapsible.js.map +1 -0
  286. package/lib/ui/Command.js +550 -0
  287. package/lib/ui/Command.js.map +1 -0
  288. package/lib/ui/Dialog.js +101 -0
  289. package/lib/ui/Dialog.js.map +1 -0
  290. package/lib/ui/Drawer.js +1153 -0
  291. package/lib/ui/Drawer.js.map +1 -0
  292. package/lib/ui/DropdownMenu.js +145 -0
  293. package/lib/ui/DropdownMenu.js.map +1 -0
  294. package/lib/ui/Form.js +95 -0
  295. package/lib/ui/Form.js.map +1 -0
  296. package/lib/ui/HoverCard.js +24 -0
  297. package/lib/ui/HoverCard.js.map +1 -0
  298. package/lib/ui/Input.js +22 -0
  299. package/lib/ui/Input.js.map +1 -0
  300. package/lib/ui/Label.js +20 -0
  301. package/lib/ui/Label.js.map +1 -0
  302. package/lib/ui/Pagination.js +106 -0
  303. package/lib/ui/Pagination.js.map +1 -0
  304. package/lib/ui/Popover.js +24 -0
  305. package/lib/ui/Popover.js.map +1 -0
  306. package/lib/ui/Progress.js +27 -0
  307. package/lib/ui/Progress.js.map +1 -0
  308. package/lib/ui/RadioGroup.js +32 -0
  309. package/lib/ui/RadioGroup.js.map +1 -0
  310. package/lib/ui/ScrollArea.js +39 -0
  311. package/lib/ui/ScrollArea.js.map +1 -0
  312. package/lib/ui/Select.js +122 -0
  313. package/lib/ui/Select.js.map +1 -0
  314. package/lib/ui/Skeleton.js +18 -0
  315. package/lib/ui/Skeleton.js.map +1 -0
  316. package/lib/ui/Slider.js +24 -0
  317. package/lib/ui/Slider.js.map +1 -0
  318. package/lib/ui/Switch.js +28 -0
  319. package/lib/ui/Switch.js.map +1 -0
  320. package/lib/ui/Tabs.js +47 -0
  321. package/lib/ui/Tabs.js.map +1 -0
  322. package/lib/ui/Textarea.js +21 -0
  323. package/lib/ui/Textarea.js.map +1 -0
  324. package/lib/ui/Toggle.js +38 -0
  325. package/lib/ui/Toggle.js.map +1 -0
  326. package/lib/ui/ToggleGroup.js +42 -0
  327. package/lib/ui/ToggleGroup.js.map +1 -0
  328. package/lib/ui/Tooltip.js +24 -0
  329. package/lib/ui/Tooltip.js.map +1 -0
  330. package/lib/urql-core-KJnLL26g.js.map +1 -1
  331. package/lib/useExposedProps-ChOIUaS4.js +9 -0
  332. package/lib/useExposedProps-ChOIUaS4.js.map +1 -0
  333. package/lib/zudoku.auth-clerk.js +1 -1
  334. package/lib/zudoku.auth-openid.js +477 -483
  335. package/lib/zudoku.auth-openid.js.map +1 -1
  336. package/lib/zudoku.components.js +907 -2881
  337. package/lib/zudoku.components.js.map +1 -1
  338. package/lib/zudoku.openapi-worker.js +2 -2
  339. package/lib/zudoku.plugin-api-keys.js +69 -76
  340. package/lib/zudoku.plugin-api-keys.js.map +1 -1
  341. package/lib/zudoku.plugin-custom-pages.js +9 -8
  342. package/lib/zudoku.plugin-custom-pages.js.map +1 -1
  343. package/lib/zudoku.plugin-markdown.js +93 -27
  344. package/lib/zudoku.plugin-markdown.js.map +1 -1
  345. package/lib/zudoku.plugin-openapi.js +7 -8
  346. package/lib/zudoku.plugin-openapi.js.map +1 -1
  347. package/lib/zudoku.plugin-redirect.js +1 -1
  348. package/lib/zudoku.plugin-redirect.js.map +1 -1
  349. package/lib/zudoku.plugin-search-inkeep.js +9 -13
  350. package/lib/zudoku.plugin-search-inkeep.js.map +1 -1
  351. package/package.json +32 -9
  352. package/src/app/entry.client.tsx +4 -2
  353. package/src/app/entry.server.tsx +4 -0
  354. package/src/app/main.css +4 -1
  355. package/src/app/main.tsx +12 -30
  356. package/src/app/standalone.tsx +1 -1
  357. package/src/lib/authentication/components/CallbackHandler.tsx +20 -51
  358. package/src/lib/authentication/hook.ts +1 -1
  359. package/src/lib/components/Header.tsx +17 -2
  360. package/src/lib/components/MobileTopNavigation.tsx +5 -1
  361. package/src/lib/components/SlotletProvider.tsx +2 -0
  362. package/src/lib/components/SyntaxHighlight.tsx +5 -1
  363. package/src/lib/components/TopNavigation.tsx +70 -23
  364. package/src/lib/components/context/ZudokuContext.ts +28 -20
  365. package/src/lib/components/index.ts +13 -4
  366. package/src/lib/components/navigation/Sidebar.tsx +5 -5
  367. package/src/lib/components/navigation/SidebarCategory.tsx +13 -13
  368. package/src/lib/components/navigation/SidebarItem.tsx +3 -5
  369. package/src/lib/components/navigation/utils.ts +11 -16
  370. package/src/lib/core/DevPortalContext.ts +3 -2
  371. package/src/lib/core/plugins.ts +2 -0
  372. package/src/lib/errors/ErrorAlert.tsx +18 -5
  373. package/src/lib/plugins/api-keys/CreateApiKey.tsx +2 -2
  374. package/src/lib/plugins/custom-pages/CustomPage.tsx +2 -2
  375. package/src/lib/plugins/markdown/index.tsx +49 -12
  376. package/src/lib/plugins/markdown/resolver.ts +92 -0
  377. package/src/lib/plugins/openapi/Endpoint.tsx +2 -2
  378. package/src/lib/plugins/openapi/RequestBodySidecarBox.tsx +1 -1
  379. package/src/lib/plugins/openapi/Sidecar.tsx +3 -3
  380. package/src/lib/plugins/openapi/client/worker.ts +2 -2
  381. package/src/lib/plugins/openapi/index.tsx +1 -1
  382. package/src/lib/plugins/openapi/playground/Playground.tsx +4 -3
  383. package/src/lib/plugins/openapi/playground/PlaygroundDialog.tsx +1 -1
  384. package/src/lib/plugins/redirect/index.tsx +3 -7
  385. package/src/lib/ui/Accordion.tsx +56 -0
  386. package/src/lib/ui/{Note.tsx → Alert.tsx} +11 -10
  387. package/src/lib/ui/AlertDialog.tsx +139 -0
  388. package/src/lib/ui/AspectRatio.tsx +5 -0
  389. package/src/lib/ui/Badge.tsx +36 -0
  390. package/src/lib/ui/Breadcrumb.tsx +115 -0
  391. package/src/lib/ui/Button.tsx +1 -1
  392. package/src/lib/ui/Carousel.tsx +260 -0
  393. package/src/lib/ui/Checkbox.tsx +28 -0
  394. package/src/lib/ui/Collapsible.tsx +9 -0
  395. package/src/lib/ui/Command.tsx +151 -0
  396. package/src/lib/{components → ui}/Dialog.tsx +4 -3
  397. package/src/lib/ui/Form.tsx +177 -0
  398. package/src/lib/ui/HoverCard.tsx +27 -0
  399. package/src/lib/ui/Label.tsx +24 -0
  400. package/src/lib/ui/Pagination.tsx +117 -0
  401. package/src/lib/ui/Popover.tsx +29 -0
  402. package/src/lib/ui/Progress.tsx +26 -0
  403. package/src/lib/ui/RadioGroup.tsx +42 -0
  404. package/src/lib/ui/ScrollArea.tsx +46 -0
  405. package/src/lib/ui/Skeleton.tsx +15 -0
  406. package/src/lib/ui/Slider.tsx +26 -0
  407. package/src/lib/ui/Switch.tsx +27 -0
  408. package/src/lib/ui/Textarea.tsx +23 -0
  409. package/src/lib/ui/Toggle.tsx +43 -0
  410. package/src/lib/ui/ToggleGroup.tsx +59 -0
  411. package/src/lib/ui/Tooltip.tsx +28 -0
  412. package/src/lib/util/MdxComponents.tsx +0 -1
  413. package/src/lib/util/invariant.ts +15 -3
  414. package/src/lib/util/useExposedProps.tsx +8 -2
  415. package/src/lib/util/useScrollToAnchor.ts +1 -1
  416. package/dist/internal.d.ts +0 -1
  417. package/dist/internal.js +0 -2
  418. package/dist/internal.js.map +0 -1
  419. package/dist/lib/components/Dialog.js.map +0 -1
  420. package/dist/lib/components/Select.js.map +0 -1
  421. package/dist/lib/plugins/markdown/generateRoutes.d.ts +0 -3
  422. package/dist/lib/plugins/markdown/generateRoutes.js +0 -21
  423. package/dist/lib/plugins/markdown/generateRoutes.js.map +0 -1
  424. package/dist/lib/ui/Note.d.ts +0 -8
  425. package/dist/lib/ui/Note.js +0 -23
  426. package/dist/lib/ui/Note.js.map +0 -1
  427. package/lib/ErrorPage-DqqAV1dr.js +0 -16
  428. package/lib/ErrorPage-DqqAV1dr.js.map +0 -1
  429. package/lib/Input-a9rLgbP_.js +0 -2229
  430. package/lib/Input-a9rLgbP_.js.map +0 -1
  431. package/lib/Markdown-Y__eLG0x.js.map +0 -1
  432. package/lib/OperationList-DuPG2FA2.js.map +0 -1
  433. package/lib/SidebarBadge-BdzN0ZBK.js +0 -503
  434. package/lib/SidebarBadge-BdzN0ZBK.js.map +0 -1
  435. package/lib/SlotletProvider-DmqWiVFt.js +0 -239
  436. package/lib/SlotletProvider-DmqWiVFt.js.map +0 -1
  437. package/lib/Spinner-3cQDBVGr.js +0 -7
  438. package/lib/Spinner-3cQDBVGr.js.map +0 -1
  439. package/lib/ZudokuContext-MRoel6bS.js.map +0 -1
  440. package/lib/index-BijFM__9.js +0 -124
  441. package/lib/index-BijFM__9.js.map +0 -1
  442. package/lib/index-CCa8ojDW.js.map +0 -1
  443. package/lib/index-DJqnphbT.js +0 -35
  444. package/lib/index-_GxJ8hpM.js +0 -2867
  445. package/lib/index-_GxJ8hpM.js.map +0 -1
  446. package/lib/joinPath-B7kNnUX4.js +0 -8
  447. package/lib/joinPath-B7kNnUX4.js.map +0 -1
  448. package/lib/useExposedProps-BWwxa-Hg.js +0 -9
  449. package/lib/useExposedProps-BWwxa-Hg.js.map +0 -1
  450. package/lib/utils-C8S3st2k.js.map +0 -1
  451. package/src/lib/plugins/markdown/generateRoutes.tsx +0 -38
  452. /package/dist/lib/{components → ui}/Dialog.d.ts +0 -0
  453. /package/dist/lib/{components → ui}/Select.d.ts +0 -0
  454. /package/dist/lib/{components → ui}/Select.js +0 -0
  455. /package/src/lib/{components → ui}/Select.tsx +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"zudoku.plugin-markdown.js","sources":["../src/lib/plugins/markdown/generateRoutes.tsx","../src/lib/plugins/markdown/index.tsx"],"sourcesContent":["import { type RouteObject } from \"react-router-dom\";\n\nimport {\n MarkdownPluginDefaultOptions,\n MarkdownPluginOptions,\n} from \"./index.js\";\n\nexport const generateRoutes = (\n markdownFiles: MarkdownPluginOptions[\"markdownFiles\"],\n filesPath: string,\n defaultOptions?: MarkdownPluginDefaultOptions,\n): RouteObject[] =>\n Object.entries(markdownFiles).flatMap(([file, importPromise]) => {\n let rootDir = filesPath.split(\"**\")[0];\n rootDir = rootDir.replace(\"/**\", \"/\");\n const re = new RegExp(`^${rootDir}(.*).mdx?`);\n const match = file.match(re);\n const fsPath = match?.at(1);\n\n if (!fsPath) return [];\n\n return {\n path: fsPath,\n lazy: async () => {\n const { MdxPage } = await import(\"./MdxPage.js\");\n const { default: Component, ...props } = await importPromise();\n return {\n element: (\n <MdxPage\n mdxComponent={Component}\n {...props}\n defaultOptions={defaultOptions}\n />\n ),\n };\n },\n } satisfies RouteObject;\n });\n","import type { Toc } from \"@stefanprobst/rehype-extract-toc\";\nimport type { MDXProps } from \"mdx/types.js\";\nimport type { DevPortalPlugin } from \"../../core/plugins.js\";\nimport { generateRoutes } from \"./generateRoutes.js\";\n\nexport type MarkdownPluginOptions = {\n markdownFiles: Record<string, () => Promise<MDXImport>>;\n defaultOptions?: MarkdownPluginDefaultOptions;\n filesPath: string;\n};\nexport type MarkdownPluginDefaultOptions = Pick<\n Frontmatter,\n \"toc\" | \"disablePager\"\n>;\n\nexport type Frontmatter = {\n title?: string;\n description?: string;\n category?: string;\n toc?: boolean;\n disablePager?: boolean;\n};\n\nexport type MDXImport = {\n tableOfContents: Toc;\n frontmatter: Frontmatter;\n default: (props: MDXProps) => JSX.Element;\n};\n\nexport const markdownPlugin = ({\n markdownFiles,\n defaultOptions,\n filesPath,\n}: MarkdownPluginOptions): DevPortalPlugin => ({\n getRoutes: () => generateRoutes(markdownFiles, filesPath, defaultOptions),\n});\n"],"names":["generateRoutes","markdownFiles","filesPath","defaultOptions","file","importPromise","rootDir","re","match","fsPath","MdxPage","Component","props","jsx","markdownPlugin"],"mappings":";AAOO,MAAMA,IAAiB,CAC5BC,GACAC,GACAC,MAEA,OAAO,QAAQF,CAAa,EAAE,QAAQ,CAAC,CAACG,GAAMC,CAAa,MAAM;AAC/D,MAAIC,IAAUJ,EAAU,MAAM,IAAI,EAAE,CAAC;AAC3B,EAAAI,IAAAA,EAAQ,QAAQ,OAAO,GAAG;AACpC,QAAMC,IAAK,IAAI,OAAO,IAAID,CAAO,WAAW,GACtCE,IAAQJ,EAAK,MAAMG,CAAE,GACrBE,IAASD,KAAA,gBAAAA,EAAO,GAAG;AAErB,SAACC,IAEE;AAAA,IACL,MAAMA;AAAA,IACN,MAAM,YAAY;AAChB,YAAM,EAAE,SAAAC,EAAA,IAAY,MAAM,OAAO,uBAAc,GACzC,EAAE,SAASC,GAAW,GAAGC,EAAM,IAAI,MAAMP;AACxC,aAAA;AAAA,QACL,SACEQ,gBAAAA,EAAA;AAAA,UAACH;AAAA,UAAA;AAAA,YACC,cAAcC;AAAA,YACb,GAAGC;AAAA,YACJ,gBAAAT;AAAA,UAAA;AAAA,QACF;AAAA,MAAA;AAAA,IAGN;AAAA,EAAA,IAhBkB;AAkBtB,CAAC,GCRUW,IAAiB,CAAC;AAAA,EAC7B,eAAAb;AAAA,EACA,gBAAAE;AAAA,EACA,WAAAD;AACF,OAA+C;AAAA,EAC7C,WAAW,MAAMF,EAAeC,GAAeC,GAAWC,CAAc;AAC1E;"}
1
+ {"version":3,"file":"zudoku.plugin-markdown.js","sources":["../src/lib/plugins/markdown/resolver.ts","../src/lib/plugins/markdown/index.tsx"],"sourcesContent":["import fs from \"fs\";\nimport path from \"path\";\nimport {\n ZudokuConfig,\n ZudokuDocsConfig,\n} from \"../../../config/validators/validate.js\";\n\nconst DEFAULT_DOCS_FILES = \"/pages/**/*.{md,mdx}\";\n\n// TODO: This should be dynamic based on the glob selector\nconst SUPPORTED_EXTENSIONS = [\".md\", \".mdx\"];\n\n/**\n * Utilities for resolving markdown file paths and routes\n */\nexport class DocResolver {\n constructor(private config: ZudokuConfig) {}\n\n fileMap = new Map<string, string>();\n\n /**\n * Gets the default docs config from the zudoku config\n */\n getDocsConfigs() {\n const docsConfigs: ZudokuDocsConfig[] = this.config.docs\n ? Array.isArray(this.config.docs)\n ? this.config.docs\n : [this.config.docs]\n : [{ files: DEFAULT_DOCS_FILES }];\n\n return docsConfigs;\n }\n\n /**\n * Resolves the first matching file system path for a given docId\n * @param docId - The docId to resolve\n * @returns\n */\n resolveFilePath(docId: string) {\n const docsConfigs = this.getDocsConfigs();\n let fsPath: string | undefined;\n\n docsConfigs.forEach(({ files: fileGlob }) => {\n if (fsPath) {\n return;\n }\n const rootDir = DocResolver.getRootDir(fileGlob);\n for (const ext of SUPPORTED_EXTENSIONS) {\n if (fsPath) {\n return;\n }\n const checkPath = path.join(rootDir, `${docId}${ext}`);\n if (fs.existsSync(checkPath)) {\n fsPath = checkPath;\n }\n }\n });\n\n return fsPath;\n }\n\n /**\n * Gets the root directory from a files glob\n */\n private static getRootDir(filesGlob: string) {\n let rootDir = filesGlob.split(\"**\")[0];\n if (!rootDir) {\n throw new Error(\"Invalid files glob. Must have '**' in the path.\");\n }\n rootDir = rootDir.replace(\"/**\", \"/\");\n return rootDir;\n }\n\n /**\n * Resolves the route path for a given file system path\n * @param options - The options to resolve the route path\n * @returns The string route path\n */\n static resolveRoutePath({\n filesGlob,\n fsPath,\n }: {\n filesGlob: string;\n fsPath: string;\n }) {\n const rootDir = this.getRootDir(filesGlob);\n const re = new RegExp(`^${rootDir}(.*).mdx?`);\n const match = fsPath.match(re);\n const routePath = match?.at(1);\n return routePath;\n }\n}\n","import type { Toc } from \"@stefanprobst/rehype-extract-toc\";\nimport type { MDXProps } from \"mdx/types.js\";\nimport { RouteObject } from \"react-router-dom\";\nimport { ZudokuDocsConfig } from \"../../../config/validators/validate.js\";\nimport type { DevPortalPlugin } from \"../../core/plugins.js\";\nimport { DocResolver } from \"./resolver.js\";\n\nexport interface MarkdownPluginOptions extends ZudokuDocsConfig {\n fileImports: Record<string, () => Promise<MDXImport>>;\n}\nexport type MarkdownPluginDefaultOptions = Pick<\n Frontmatter,\n \"toc\" | \"disablePager\"\n>;\n\nexport type Frontmatter = {\n title?: string;\n description?: string;\n category?: string;\n toc?: boolean;\n disablePager?: boolean;\n};\n\nexport type MDXImport = {\n tableOfContents: Toc;\n frontmatter: Frontmatter;\n default: (props: MDXProps) => JSX.Element;\n};\n\nexport const markdownPlugin = (\n options: MarkdownPluginOptions[],\n): DevPortalPlugin => ({\n getRoutes: () => {\n const routeMap = new Map<string, RouteObject>();\n options.forEach(({ fileImports, files, defaultOptions }) =>\n Object.entries(fileImports).flatMap(([file, importPromise]) => {\n const routePath = DocResolver.resolveRoutePath({\n filesGlob: files,\n fsPath: file,\n });\n\n if (!routePath) return [];\n\n if (routeMap.has(routePath)) {\n // eslint-disable-next-line no-console\n console.warn(\n `Duplicate route path found for ${routePath}. Skipping file at '${file}'.`,\n );\n return [];\n }\n\n const route: RouteObject = {\n path: routePath,\n lazy: async () => {\n const { MdxPage } = await import(\"./MdxPage.js\");\n const { default: Component, ...props } = await importPromise();\n return {\n element: (\n <MdxPage\n mdxComponent={Component}\n {...props}\n defaultOptions={defaultOptions}\n />\n ),\n };\n },\n };\n routeMap.set(routePath, route);\n }),\n );\n return [...routeMap.values()];\n },\n});\n"],"names":["DEFAULT_DOCS_FILES","SUPPORTED_EXTENSIONS","DocResolver","config","__publicField","docId","docsConfigs","fsPath","fileGlob","rootDir","ext","checkPath","path","fs","filesGlob","re","match","markdownPlugin","options","routeMap","fileImports","files","defaultOptions","file","importPromise","routePath","route","MdxPage","Component","props","jsx"],"mappings":";;;;;AAOA,MAAMA,IAAqB,wBAGrBC,IAAuB,CAAC,OAAO,MAAM;AAKpC,MAAMC,EAAY;AAAA,EACvB,YAAoBC,GAAsB;AAE1C,IAAAC,EAAA,qCAAc;AAFM,SAAA,SAAAD;AAAA,EAAuB;AAAA;AAAA;AAAA;AAAA,EAO3C,iBAAiB;AAOR,WANiC,KAAK,OAAO,OAChD,MAAM,QAAQ,KAAK,OAAO,IAAI,IAC5B,KAAK,OAAO,OACZ,CAAC,KAAK,OAAO,IAAI,IACnB,CAAC,EAAE,OAAOH,EAAA,CAAoB;AAAA,EAGpC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,gBAAgBK,GAAe;AACvB,UAAAC,IAAc,KAAK;AACrB,QAAAC;AAEJ,WAAAD,EAAY,QAAQ,CAAC,EAAE,OAAOE,QAAe;AAC3C,UAAID;AACF;AAEI,YAAAE,IAAUP,EAAY,WAAWM,CAAQ;AAC/C,iBAAWE,KAAOT,GAAsB;AACtC,YAAIM;AACF;AAEI,cAAAI,IAAYC,EAAK,KAAKH,GAAS,GAAGJ,CAAK,GAAGK,CAAG,EAAE;AACjD,QAAAG,EAAG,WAAWF,CAAS,MAChBJ,IAAAI;AAAA,MAEb;AAAA,IAAA,CACD,GAEMJ;AAAA,EACT;AAAA;AAAA;AAAA;AAAA,EAKA,OAAe,WAAWO,GAAmB;AAC3C,QAAIL,IAAUK,EAAU,MAAM,IAAI,EAAE,CAAC;AACrC,QAAI,CAACL;AACG,YAAA,IAAI,MAAM,iDAAiD;AAEzD,WAAAA,IAAAA,EAAQ,QAAQ,OAAO,GAAG,GAC7BA;AAAA,EACT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,OAAO,iBAAiB;AAAA,IACtB,WAAAK;AAAA,IACA,QAAAP;AAAA,EAAA,GAIC;AACK,UAAAE,IAAU,KAAK,WAAWK,CAAS,GACnCC,IAAK,IAAI,OAAO,IAAIN,CAAO,WAAW,GACtCO,IAAQT,EAAO,MAAMQ,CAAE;AAEtB,WADWC,KAAA,gBAAAA,EAAO,GAAG;AAAA,EAE9B;AACF;AC9Da,MAAAC,IAAiB,CAC5BC,OACqB;AAAA,EACrB,WAAW,MAAM;AACT,UAAAC,wBAAe;AACb,WAAAD,EAAA;AAAA,MAAQ,CAAC,EAAE,aAAAE,GAAa,OAAAC,GAAO,gBAAAC,QACrC,OAAO,QAAQF,CAAW,EAAE,QAAQ,CAAC,CAACG,GAAMC,CAAa,MAAM;AACvD,cAAAC,IAAYvB,EAAY,iBAAiB;AAAA,UAC7C,WAAWmB;AAAA,UACX,QAAQE;AAAA,QAAA,CACT;AAEG,YAAA,CAACE,EAAW,QAAO;AAEnB,YAAAN,EAAS,IAAIM,CAAS;AAEhB,yBAAA;AAAA,YACN,kCAAkCA,CAAS,uBAAuBF,CAAI;AAAA,UAAA,GAEjE;AAGT,cAAMG,IAAqB;AAAA,UACzB,MAAMD;AAAA,UACN,MAAM,YAAY;AAChB,kBAAM,EAAE,SAAAE,EAAA,IAAY,MAAM,OAAO,uBAAc,GACzC,EAAE,SAASC,GAAW,GAAGC,EAAM,IAAI,MAAML;AACxC,mBAAA;AAAA,cACL,SACEM,gBAAAA,EAAA;AAAA,gBAACH;AAAA,gBAAA;AAAA,kBACC,cAAcC;AAAA,kBACb,GAAGC;AAAA,kBACJ,gBAAAP;AAAA,gBAAA;AAAA,cACF;AAAA,YAAA;AAAA,UAGN;AAAA,QAAA;AAEO,QAAAH,EAAA,IAAIM,GAAWC,CAAK;AAAA,MAAA,CAC9B;AAAA,IAAA,GAEI,CAAC,GAAGP,EAAS,OAAA,CAAQ;AAAA,EAC9B;AACF;"}
@@ -1,16 +1,15 @@
1
1
  import "./jsx-runtime-B6kdoens.js";
2
- import { o as u } from "./index-CCa8ojDW.js";
3
- import "./ZudokuContext-MRoel6bS.js";
2
+ import { o as s } from "./index-AjWCJNGC.js";
3
+ import "./ZudokuContext-BKXGJTmu.js";
4
4
  import "lucide-react";
5
5
  import "zudoku/openapi-worker";
6
- import "./index-_GxJ8hpM.js";
7
- import "./ErrorPage-DqqAV1dr.js";
8
- import "./Markdown-Y__eLG0x.js";
9
- import "./joinPath-B7kNnUX4.js";
6
+ import "./hook-sn0zMTkE.js";
7
+ import "./Markdown-BDcCAWwm.js";
8
+ import "./ui/Button.js";
10
9
  import "./urql-core-KJnLL26g.js";
11
10
  import "./router-BsfSoK2j.js";
12
- import "./index-DFN92YJN.js";
11
+ import "./index-CRo94sKK.js";
13
12
  export {
14
- u as openApiPlugin
13
+ s as openApiPlugin
15
14
  };
16
15
  //# sourceMappingURL=zudoku.plugin-openapi.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"zudoku.plugin-openapi.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;"}
1
+ {"version":3,"file":"zudoku.plugin-openapi.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"}
@@ -2,7 +2,7 @@ import { r as o } from "./router-BsfSoK2j.js";
2
2
  const a = (r) => ({
3
3
  getRoutes: () => r.redirects.map(({ from: e, to: t }) => ({
4
4
  path: e,
5
- loader: () => o(t)
5
+ loader: () => o(t, 301)
6
6
  }))
7
7
  });
8
8
  export {
@@ -1 +1 @@
1
- {"version":3,"file":"zudoku.plugin-redirect.js","sources":["../src/lib/plugins/redirect/index.tsx"],"sourcesContent":["import { redirect } from \"react-router-dom\";\nimport type { DevPortalPlugin } from \"../../core/plugins.js\";\n\nexport type Redirect = {\n from: string;\n to: string;\n};\n\nexport const redirectPlugin = (options: {\n redirects: Redirect[];\n}): DevPortalPlugin => {\n return {\n getRoutes: () =>\n options.redirects.map(({ from, to }) => ({\n path: from,\n loader: () => redirect(to),\n })),\n };\n};\n"],"names":["redirectPlugin","options","from","to","redirect"],"mappings":";AAQa,MAAAA,IAAiB,CAACC,OAGtB;AAAA,EACL,WAAW,MACTA,EAAQ,UAAU,IAAI,CAAC,EAAE,MAAAC,GAAM,IAAAC,SAAU;AAAA,IACvC,MAAMD;AAAA,IACN,QAAQ,MAAME,EAASD,CAAE;AAAA,EAAA,EACzB;AAAA;"}
1
+ {"version":3,"file":"zudoku.plugin-redirect.js","sources":["../src/lib/plugins/redirect/index.tsx"],"sourcesContent":["import { redirect } from \"react-router-dom\";\nimport { ZudokuRedirect } from \"../../../config/validators/validate.js\";\nimport type { DevPortalPlugin } from \"../../core/plugins.js\";\n\nexport const redirectPlugin = (options: {\n redirects: ZudokuRedirect[];\n}): DevPortalPlugin => {\n return {\n getRoutes: () =>\n options.redirects.map(({ from, to }) => ({\n path: from,\n loader: () => redirect(to, 301),\n })),\n };\n};\n"],"names":["redirectPlugin","options","from","to","redirect"],"mappings":";AAIa,MAAAA,IAAiB,CAACC,OAGtB;AAAA,EACL,WAAW,MACTA,EAAQ,UAAU,IAAI,CAAC,EAAE,MAAAC,GAAM,IAAAC,SAAU;AAAA,IACvC,MAAMD;AAAA,IACN,QAAQ,MAAME,EAASD,GAAI,GAAG;AAAA,EAAA,EAC9B;AAAA;"}
@@ -1,11 +1,7 @@
1
1
  import { j as n } from "./jsx-runtime-B6kdoens.js";
2
- import { useSyncExternalStore as a, lazy as i } from "react";
3
- const o = () => () => {
4
- }, c = (e) => a(
5
- o,
6
- () => "client",
7
- () => "server"
8
- ) === "client" ? e.children : null, l = {
2
+ import { lazy as a } from "react";
3
+ import { C as i } from "./ClientOnly-CVN6leDu.js";
4
+ const o = {
9
5
  theme: {
10
6
  components: {
11
7
  AIChatPageWrapper: {
@@ -23,29 +19,29 @@ const o = () => () => {
23
19
  }
24
20
  }
25
21
  }
26
- }, p = {}, u = i(() => import("./InkeepCustomTrigger-CE5-K5ex.js")), h = ({
22
+ }, p = {}, c = a(() => import("./InkeepCustomTrigger-CE5-K5ex.js")), l = ({
27
23
  prefilledQuery: e,
28
24
  isOpen: r,
29
25
  onClose: t,
30
26
  settings: s
31
27
  }) => /* @__PURE__ */ n.jsx(
32
- u,
28
+ c,
33
29
  {
34
30
  isOpen: r,
35
31
  onClose: t,
36
- baseSettings: { ...l, ...s },
32
+ baseSettings: { ...o, ...s },
37
33
  aiChatSettings: p,
38
34
  searchSettings: {
39
35
  prefilledQuery: e || void 0
40
36
  }
41
37
  }
42
- ), g = (e) => ({
38
+ ), d = (e) => ({
43
39
  renderSearch: ({
44
40
  isOpen: r,
45
41
  onClose: t
46
- }) => /* @__PURE__ */ n.jsx(c, { children: /* @__PURE__ */ n.jsx(h, { isOpen: r, onClose: t, settings: e }) })
42
+ }) => /* @__PURE__ */ n.jsx(i, { children: /* @__PURE__ */ n.jsx(l, { isOpen: r, onClose: t, settings: e }) })
47
43
  });
48
44
  export {
49
- g as inkeepSearchPlugin
45
+ d as inkeepSearchPlugin
50
46
  };
51
47
  //# sourceMappingURL=zudoku.plugin-search-inkeep.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"zudoku.plugin-search-inkeep.js","sources":["../src/lib/components/ClientOnly.tsx","../src/lib/plugins/search-inkeep/inkeep.ts","../src/lib/plugins/search-inkeep/index.tsx"],"sourcesContent":["import { useSyncExternalStore } from \"react\";\n\nconst noop = () => () => {};\n\nexport const ClientOnly = (props: { children: React.ReactNode }) => {\n const value = useSyncExternalStore(\n noop,\n () => \"client\",\n () => \"server\",\n );\n\n return value === \"client\" ? props.children : null;\n};\n","import {\n InkeepAIChatSettings,\n InkeepModalSettings,\n InkeepSearchSettings,\n} from \"@inkeep/widgets\";\n\nconst baseSettings = {\n theme: {\n components: {\n AIChatPageWrapper: {\n defaultProps: {\n size: \"shrink-vertically\",\n variant: \"no-shadow\",\n },\n },\n SearchBarTrigger: {\n defaultProps: {\n size: \"expand\",\n variant: \"subtle\", // Choose from 'emphasized' or 'subtle'\n },\n },\n },\n },\n} as const;\n\nconst modalSettings: InkeepModalSettings = {};\n\nconst searchSettings: InkeepSearchSettings = {};\n\nconst aiChatSettings: InkeepAIChatSettings = {};\n\nexport { aiChatSettings, baseSettings, modalSettings, searchSettings };\n","import type { InkeepWidgetBaseSettings } from \"@inkeep/widgets\";\nimport { lazy } from \"react\";\nimport { ClientOnly } from \"../../components/ClientOnly.js\";\nimport type { DevPortalPlugin } from \"../../core/plugins.js\";\nimport { aiChatSettings, baseSettings } from \"./inkeep.js\";\n\ntype PickedPluginInkeepBaseSettings =\n | \"apiKey\"\n | \"integrationId\"\n | \"organizationId\"\n | \"primaryBrandColor\"\n | \"organizationDisplayName\";\n\ntype PluginInkeepBaseSettings = Pick<\n InkeepWidgetBaseSettings,\n PickedPluginInkeepBaseSettings\n>;\n\nconst Inkeep = lazy(() => import(\"./InkeepCustomTrigger.js\"));\n\nconst InkeepSearch = ({\n prefilledQuery,\n isOpen,\n onClose,\n settings,\n}: {\n isOpen: boolean;\n onClose: () => void;\n prefilledQuery?: string | null;\n settings: PluginInkeepBaseSettings;\n}) => {\n return (\n <Inkeep\n isOpen={isOpen}\n onClose={onClose}\n baseSettings={{ ...baseSettings, ...settings }}\n aiChatSettings={aiChatSettings}\n searchSettings={{\n prefilledQuery: prefilledQuery || undefined,\n }}\n />\n );\n};\n\nexport const inkeepSearchPlugin = (\n settings: PluginInkeepBaseSettings,\n): DevPortalPlugin => {\n return {\n renderSearch: ({\n isOpen,\n onClose,\n }: {\n isOpen: boolean;\n onClose: () => void;\n }) => {\n return (\n <ClientOnly>\n <InkeepSearch isOpen={isOpen} onClose={onClose} settings={settings} />\n </ClientOnly>\n );\n },\n };\n};\n"],"names":["noop","ClientOnly","props","useSyncExternalStore","baseSettings","aiChatSettings","Inkeep","lazy","InkeepSearch","prefilledQuery","isOpen","onClose","settings","jsx","inkeepSearchPlugin"],"mappings":";;AAEA,MAAMA,IAAO,MAAM,MAAM;AAAC,GAEbC,IAAa,CAACC,MACXC;AAAA,EACZH;AAAA,EACA,MAAM;AAAA,EACN,MAAM;AAAA,MAGS,WAAWE,EAAM,WAAW,MCLzCE,IAAe;AAAA,EACnB,OAAO;AAAA,IACL,YAAY;AAAA,MACV,mBAAmB;AAAA,QACjB,cAAc;AAAA,UACZ,MAAM;AAAA,UACN,SAAS;AAAA,QACX;AAAA,MACF;AAAA,MACA,kBAAkB;AAAA,QAChB,cAAc;AAAA,UACZ,MAAM;AAAA,UACN,SAAS;AAAA;AAAA,QACX;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF,GAMMC,IAAuC,CAAC,GCXxCC,IAASC,EAAK,MAAM,OAAO,mCAA0B,CAAC,GAEtDC,IAAe,CAAC;AAAA,EACpB,gBAAAC;AAAA,EACA,QAAAC;AAAA,EACA,SAAAC;AAAA,EACA,UAAAC;AACF,MAOIC,gBAAAA,EAAA;AAAA,EAACP;AAAA,EAAA;AAAA,IACC,QAAAI;AAAA,IACA,SAAAC;AAAA,IACA,cAAc,EAAE,GAAGP,GAAc,GAAGQ,EAAS;AAAA,IAC7C,gBAAAP;AAAA,IACA,gBAAgB;AAAA,MACd,gBAAgBI,KAAkB;AAAA,IACpC;AAAA,EAAA;AAAA,GAKOK,IAAqB,CAChCF,OAEO;AAAA,EACL,cAAc,CAAC;AAAA,IACb,QAAAF;AAAA,IACA,SAAAC;AAAA,EAAA,4BAMGV,GACC,EAAA,UAAAY,gBAAAA,EAAAA,IAACL,KAAa,QAAAE,GAAgB,SAAAC,GAAkB,UAAAC,EAAoB,CAAA,EACtE,CAAA;AAEJ;"}
1
+ {"version":3,"file":"zudoku.plugin-search-inkeep.js","sources":["../src/lib/plugins/search-inkeep/inkeep.ts","../src/lib/plugins/search-inkeep/index.tsx"],"sourcesContent":["import {\n InkeepAIChatSettings,\n InkeepModalSettings,\n InkeepSearchSettings,\n} from \"@inkeep/widgets\";\n\nconst baseSettings = {\n theme: {\n components: {\n AIChatPageWrapper: {\n defaultProps: {\n size: \"shrink-vertically\",\n variant: \"no-shadow\",\n },\n },\n SearchBarTrigger: {\n defaultProps: {\n size: \"expand\",\n variant: \"subtle\", // Choose from 'emphasized' or 'subtle'\n },\n },\n },\n },\n} as const;\n\nconst modalSettings: InkeepModalSettings = {};\n\nconst searchSettings: InkeepSearchSettings = {};\n\nconst aiChatSettings: InkeepAIChatSettings = {};\n\nexport { aiChatSettings, baseSettings, modalSettings, searchSettings };\n","import type { InkeepWidgetBaseSettings } from \"@inkeep/widgets\";\nimport { lazy } from \"react\";\nimport { ClientOnly } from \"../../components/ClientOnly.js\";\nimport type { DevPortalPlugin } from \"../../core/plugins.js\";\nimport { aiChatSettings, baseSettings } from \"./inkeep.js\";\n\ntype PickedPluginInkeepBaseSettings =\n | \"apiKey\"\n | \"integrationId\"\n | \"organizationId\"\n | \"primaryBrandColor\"\n | \"organizationDisplayName\";\n\ntype PluginInkeepBaseSettings = Pick<\n InkeepWidgetBaseSettings,\n PickedPluginInkeepBaseSettings\n>;\n\nconst Inkeep = lazy(() => import(\"./InkeepCustomTrigger.js\"));\n\nconst InkeepSearch = ({\n prefilledQuery,\n isOpen,\n onClose,\n settings,\n}: {\n isOpen: boolean;\n onClose: () => void;\n prefilledQuery?: string | null;\n settings: PluginInkeepBaseSettings;\n}) => {\n return (\n <Inkeep\n isOpen={isOpen}\n onClose={onClose}\n baseSettings={{ ...baseSettings, ...settings }}\n aiChatSettings={aiChatSettings}\n searchSettings={{\n prefilledQuery: prefilledQuery || undefined,\n }}\n />\n );\n};\n\nexport const inkeepSearchPlugin = (\n settings: PluginInkeepBaseSettings,\n): DevPortalPlugin => {\n return {\n renderSearch: ({\n isOpen,\n onClose,\n }: {\n isOpen: boolean;\n onClose: () => void;\n }) => {\n return (\n <ClientOnly>\n <InkeepSearch isOpen={isOpen} onClose={onClose} settings={settings} />\n </ClientOnly>\n );\n },\n };\n};\n"],"names":["baseSettings","aiChatSettings","Inkeep","lazy","InkeepSearch","prefilledQuery","isOpen","onClose","settings","jsx","inkeepSearchPlugin","ClientOnly"],"mappings":";;;AAMA,MAAMA,IAAe;AAAA,EACnB,OAAO;AAAA,IACL,YAAY;AAAA,MACV,mBAAmB;AAAA,QACjB,cAAc;AAAA,UACZ,MAAM;AAAA,UACN,SAAS;AAAA,QACX;AAAA,MACF;AAAA,MACA,kBAAkB;AAAA,QAChB,cAAc;AAAA,UACZ,MAAM;AAAA,UACN,SAAS;AAAA;AAAA,QACX;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF,GAMMC,IAAuC,CAAC,GCXxCC,IAASC,EAAK,MAAM,OAAO,mCAA0B,CAAC,GAEtDC,IAAe,CAAC;AAAA,EACpB,gBAAAC;AAAA,EACA,QAAAC;AAAA,EACA,SAAAC;AAAA,EACA,UAAAC;AACF,MAOIC,gBAAAA,EAAA;AAAA,EAACP;AAAA,EAAA;AAAA,IACC,QAAAI;AAAA,IACA,SAAAC;AAAA,IACA,cAAc,EAAE,GAAGP,GAAc,GAAGQ,EAAS;AAAA,IAC7C,gBAAAP;AAAA,IACA,gBAAgB;AAAA,MACd,gBAAgBI,KAAkB;AAAA,IACpC;AAAA,EAAA;AAAA,GAKOK,IAAqB,CAChCF,OAEO;AAAA,EACL,cAAc,CAAC;AAAA,IACb,QAAAF;AAAA,IACA,SAAAC;AAAA,EAAA,4BAMGI,GACC,EAAA,UAAAF,gBAAAA,EAAAA,IAACL,KAAa,QAAAE,GAAgB,SAAAC,GAAkB,UAAAC,EAAoB,CAAA,EACtE,CAAA;AAEJ;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zudoku",
3
- "version": "0.0.0-fcb84d6",
3
+ "version": "0.0.0-ff3751f",
4
4
  "type": "module",
5
5
  "homepage": "https://zudoku.dev",
6
6
  "repository": {
@@ -27,12 +27,17 @@
27
27
  "import": "./dist/index.js",
28
28
  "types": "./dist/index.d.ts"
29
29
  },
30
+ "./ui/*": {
31
+ "import": "./lib/ui/*.js",
32
+ "types": "./dist/lib/ui/*.d.ts"
33
+ },
34
+ "./ui/*.js": {
35
+ "import": "./lib/ui/*.js",
36
+ "types": "./dist/lib/ui/*.d.ts"
37
+ },
30
38
  "./client": {
31
39
  "types": "./client.d.ts"
32
40
  },
33
- "./internal": {
34
- "import": "./dist/internal.js"
35
- },
36
41
  "./auth/clerk": {
37
42
  "import": "./lib/zudoku.auth-clerk.js",
38
43
  "types": "./dist/lib/authentication/providers/clerk.d.ts"
@@ -101,16 +106,32 @@
101
106
  "@envelop/core": "5.0.2",
102
107
  "@graphql-typed-document-node/core": "3.2.0",
103
108
  "@hiogawa/vite-plugin-ssr-css": "0.0.1",
109
+ "@hookform/resolvers": "3.9.1",
104
110
  "@lekoarts/rehype-meta-as-attributes": "3.0.1",
105
111
  "@mdx-js/react": "3.0.1",
106
112
  "@mdx-js/rollup": "3.0.1",
107
113
  "@pothos/core": "3.41.0",
114
+ "@radix-ui/react-accordion": "1.2.1",
115
+ "@radix-ui/react-alert-dialog": "1.1.2",
116
+ "@radix-ui/react-aspect-ratio": "1.1.0",
117
+ "@radix-ui/react-checkbox": "1.1.2",
108
118
  "@radix-ui/react-collapsible": "1.1.1",
109
119
  "@radix-ui/react-dialog": "1.1.2",
110
120
  "@radix-ui/react-dropdown-menu": "2.1.2",
121
+ "@radix-ui/react-hover-card": "1.1.2",
122
+ "@radix-ui/react-label": "2.1.0",
123
+ "@radix-ui/react-popover": "1.1.2",
124
+ "@radix-ui/react-progress": "1.1.0",
125
+ "@radix-ui/react-radio-group": "1.2.1",
126
+ "@radix-ui/react-scroll-area": "1.2.0",
111
127
  "@radix-ui/react-select": "2.1.2",
128
+ "@radix-ui/react-slider": "1.2.1",
112
129
  "@radix-ui/react-slot": "1.1.0",
130
+ "@radix-ui/react-switch": "1.1.1",
113
131
  "@radix-ui/react-tabs": "1.1.1",
132
+ "@radix-ui/react-toggle": "1.1.0",
133
+ "@radix-ui/react-toggle-group": "1.1.0",
134
+ "@radix-ui/react-tooltip": "1.1.3",
114
135
  "@radix-ui/react-visually-hidden": "1",
115
136
  "@sentry/node": "8.34.0",
116
137
  "@sindresorhus/slugify": "2.2.1",
@@ -120,13 +141,16 @@
120
141
  "@types/react": "18.3.11",
121
142
  "@types/react-dom": "18.3.1",
122
143
  "@vitejs/plugin-react": "4.3.1",
144
+ "@zudoku/config": "0.0.0-ff3751f",
123
145
  "@zudoku/httpsnippet": "10.0.9",
124
146
  "@zudoku/react-helmet-async": "2.0.4",
125
147
  "autoprefixer": "10.4.20",
126
148
  "chokidar": "3.6.0",
127
149
  "class-variance-authority": "0.7.0",
128
150
  "clsx": "2.1.1",
151
+ "cmdk": "1.0.4",
129
152
  "dotenv": "16.4.5",
153
+ "embla-carousel-react": "8.3.1",
130
154
  "express": "4.21.1",
131
155
  "glob": "11.0.0",
132
156
  "graphql": "16.9.0",
@@ -145,7 +169,7 @@
145
169
  "posthog-node": "4.2.1",
146
170
  "prism-react-renderer": "2.4.0",
147
171
  "prismjs": "1.29.0",
148
- "react-error-boundary": "4.0.13",
172
+ "react-error-boundary": "4.1.2",
149
173
  "react-hook-form": "7.53.0",
150
174
  "react-is": "18.3.1",
151
175
  "react-markdown": "9.0.1",
@@ -164,7 +188,6 @@
164
188
  "strip-ansi": "7.1.0",
165
189
  "tailwind-merge": "2.5.4",
166
190
  "tailwindcss": "3.4.13",
167
- "tsx": "4.19.1",
168
191
  "ulidx": "2.4.1",
169
192
  "unist-util-visit": "5.0.0",
170
193
  "urql": "4.1.0",
@@ -177,7 +200,7 @@
177
200
  "zustand": "5.0.0"
178
201
  },
179
202
  "devDependencies": {
180
- "@types/express": "4.17.21",
203
+ "@types/express": "5.0.0",
181
204
  "@types/har-format": "1.2.15",
182
205
  "@types/json-schema": "7.0.15",
183
206
  "@types/mdx": "2.0.13",
@@ -186,9 +209,9 @@
186
209
  "@types/react-is": "18.3.0",
187
210
  "@types/semver": "7.5.8",
188
211
  "@types/yargs": "17.0.33",
189
- "rollup-plugin-visualizer": "5.12.0",
190
212
  "react": "18.3.1",
191
213
  "react-dom": "18.3.1",
214
+ "rollup-plugin-visualizer": "5.12.0",
192
215
  "typescript": "5.6.3"
193
216
  },
194
217
  "peerDependencies": {
@@ -201,7 +224,7 @@
201
224
  },
202
225
  "scripts": {
203
226
  "build": "tsc --project tsconfig.json",
204
- "build:vite": "vite build && pnpm run hack:fix-worker-paths lib",
227
+ "build:vite": "vite build",
205
228
  "build:standalone:vite": "vite build --mode standalone --config vite.standalone.config.ts",
206
229
  "build:standalone:html": "cp ./src/app/standalone.html ./standalone/standalone.html && cp ./src/app/demo.html ./standalone/demo.html && cp ./src/app/demo-cdn.html ./standalone/index.html",
207
230
  "hack:fix-worker-paths": "node ./scripts/hack-worker.mjs",
@@ -20,8 +20,10 @@ if (root.childElementCount > 0) {
20
20
  }
21
21
 
22
22
  async function hydrateLazyRoutes(routes: RouteObject[]) {
23
- const path = window.location.pathname.slice(config.basePath?.length ?? 0);
24
- const lazyMatches = matchRoutes(routes, path)?.filter((m) => m.route.lazy);
23
+ const path = window.location.pathname;
24
+ const lazyMatches = matchRoutes(routes, path, config.basePath)?.filter(
25
+ (m) => m.route.lazy,
26
+ );
25
27
 
26
28
  if (lazyMatches?.length) {
27
29
  await Promise.all(
@@ -96,6 +96,10 @@ export const render = async ({
96
96
 
97
97
  const [htmlStart, htmlEnd] = template.split("<!--app-html-->");
98
98
 
99
+ if (!htmlStart) {
100
+ throw new Error("No <!--app-html--> found in template");
101
+ }
102
+
99
103
  response.write(
100
104
  htmlStart.replace(
101
105
  "<!--app-helmet-->",
package/src/app/main.css CHANGED
@@ -103,6 +103,10 @@
103
103
  @apply h-full overscroll-none;
104
104
  }
105
105
 
106
+ details summary {
107
+ @apply cursor-pointer;
108
+ }
109
+
106
110
  #root {
107
111
  @apply min-h-screen w-full;
108
112
  }
@@ -142,7 +146,6 @@
142
146
  .CollapsibleContent {
143
147
  --easing: cubic-bezier(0.4, 0, 0.2, 1);
144
148
  --slide-offset: -0.75rem;
145
- @apply overflow-hidden;
146
149
  }
147
150
  .CollapsibleContent[data-state="open"] {
148
151
  animation: slideDown 300ms var(--easing);
package/src/app/main.tsx CHANGED
@@ -1,19 +1,17 @@
1
- import { redirect, type RouteObject } from "react-router-dom";
1
+ import { type RouteObject } from "react-router-dom";
2
2
  import { configuredApiKeysPlugin } from "virtual:zudoku-api-keys-plugin";
3
3
  import { configuredApiPlugins } from "virtual:zudoku-api-plugins";
4
4
  import { configuredAuthProvider } from "virtual:zudoku-auth";
5
5
  import { configuredCustomPagesPlugin } from "virtual:zudoku-custom-pages-plugin";
6
6
  import { configuredDocsPlugins } from "virtual:zudoku-docs-plugins";
7
7
  import { configuredRedirectPlugin } from "virtual:zudoku-redirect-plugin";
8
+ import { configuredSearchPlugin } from "virtual:zudoku-search-plugin";
8
9
  import { configuredSidebar } from "virtual:zudoku-sidebar";
9
10
  import "virtual:zudoku-theme.css";
10
11
  import { DevPortal, Layout, RouterError } from "zudoku/components";
11
- import { isNavigationPlugin } from "zudoku/internal";
12
- import { inkeepSearchPlugin } from "zudoku/plugins/search-inkeep";
13
12
  import type { ZudokuConfig } from "../config/config.js";
14
- import { traverseSidebar } from "../lib/components/navigation/utils.js";
15
13
  import type { ZudokuContextOptions } from "../lib/core/DevPortalContext.js";
16
- import { joinPath } from "../lib/util/joinPath.js";
14
+ import { isNavigationPlugin } from "../lib/core/plugins.js";
17
15
 
18
16
  export const convertZudokuConfigToOptions = (
19
17
  config: ZudokuConfig,
@@ -53,11 +51,9 @@ export const convertZudokuConfigToOptions = (
53
51
  mdx: config.mdx,
54
52
  authentication: configuredAuthProvider,
55
53
  plugins: [
56
- ...(config.search?.type === "inkeep"
57
- ? [inkeepSearchPlugin(config.search)]
58
- : []),
59
54
  ...configuredDocsPlugins,
60
55
  ...configuredApiPlugins,
56
+ ...(configuredSearchPlugin ? [configuredSearchPlugin] : []),
61
57
  ...(configuredRedirectPlugin ? [configuredRedirectPlugin] : []),
62
58
  ...(configuredApiKeysPlugin ? [configuredApiKeysPlugin] : []),
63
59
  ...(configuredCustomPagesPlugin ? [configuredCustomPagesPlugin] : []),
@@ -69,9 +65,7 @@ export const convertZudokuConfigToOptions = (
69
65
  };
70
66
  };
71
67
 
72
- export const getRoutesByConfig = (config: ZudokuConfig): RouteObject[] => {
73
- const options = convertZudokuConfigToOptions(config);
74
-
68
+ export const getRoutesByOptions = (options: ZudokuContextOptions) => {
75
69
  const allPlugins = [
76
70
  ...(options.plugins ? options.plugins : []),
77
71
  ...(options.authentication?.getAuthenticationPlugin
@@ -79,27 +73,8 @@ export const getRoutesByConfig = (config: ZudokuConfig): RouteObject[] => {
79
73
  : []),
80
74
  ];
81
75
 
82
- const topNavRedirects =
83
- options.topNavigation?.flatMap((topNavItem) => {
84
- if (!options.sidebars?.[topNavItem.id]) return [];
85
-
86
- const first =
87
- topNavItem.default ??
88
- traverseSidebar(options.sidebars[topNavItem.id], (item) => {
89
- if (item.type === "doc") return joinPath(topNavItem.id, item.id);
90
- });
91
-
92
- if (!first) return [];
93
-
94
- return {
95
- path: topNavItem.id,
96
- loader: () => redirect(joinPath(first)),
97
- } satisfies RouteObject;
98
- }) ?? [];
99
-
100
76
  const routes = allPlugins
101
77
  .flatMap((plugin) => (isNavigationPlugin(plugin) ? plugin.getRoutes() : []))
102
- .concat(topNavRedirects)
103
78
  .concat({
104
79
  path: "*",
105
80
  loader: () => {
@@ -107,6 +82,13 @@ export const getRoutesByConfig = (config: ZudokuConfig): RouteObject[] => {
107
82
  },
108
83
  });
109
84
 
85
+ return routes;
86
+ };
87
+
88
+ export const getRoutesByConfig = (config: ZudokuConfig): RouteObject[] => {
89
+ const options = convertZudokuConfigToOptions(config);
90
+ const routes = getRoutesByOptions(options);
91
+
110
92
  return [
111
93
  {
112
94
  element: (
@@ -16,7 +16,7 @@ if (!root) {
16
16
  themeToggle();
17
17
 
18
18
  const apiUrl = root.getAttribute("data-api-url");
19
- const pageTitle = document.getElementsByTagName("title")[0].innerText;
19
+ const pageTitle = document.getElementsByTagName("title")[0]!.innerText;
20
20
  const logoUrl = root.getAttribute("data-logo-url");
21
21
 
22
22
  // IMPORTANT: This component must not contain tailwind classes
@@ -1,59 +1,28 @@
1
- import logger from "loglevel";
2
- import { useEffect, useRef, useState } from "react";
3
- import { useNavigate } from "react-router-dom";
4
- import { DeveloperHint } from "../../components/DeveloperHint.js";
5
- import { ErrorPage } from "../../components/ErrorPage.js";
6
- import { Spinner } from "../../components/Spinner.js";
7
- import { SyntaxHighlight } from "../../components/SyntaxHighlight.js";
1
+ import { useSuspenseQuery } from "@tanstack/react-query";
2
+ import { Navigate } from "react-router-dom";
3
+ import { ZudokuError } from "../../util/invariant.js";
8
4
 
9
5
  export function CallbackHandler({
10
6
  handleCallback,
11
7
  }: {
12
8
  handleCallback: () => Promise<string>;
13
9
  }) {
14
- const [error, setError] = useState<Error | null>(null);
15
- const navigate = useNavigate();
16
- // Deal with double mount in dev mode which will break
17
- // the OAuth flow because you can only use the code once
18
- const didInitialize = useRef(false);
10
+ const executeCallback = useSuspenseQuery({
11
+ retry: false,
12
+ queryKey: ["oauth-callback"],
13
+ queryFn: async () => {
14
+ try {
15
+ return await handleCallback();
16
+ } catch (error) {
17
+ throw new ZudokuError("Could not validate user", {
18
+ cause: error,
19
+ title: "Authentication Error",
20
+ developerHint:
21
+ "Check the configuration of your authorization provider and ensure all settings such as the callback URL are configured correctly.",
22
+ });
23
+ }
24
+ },
25
+ });
19
26
 
20
- useEffect(() => {
21
- if (didInitialize.current) {
22
- return;
23
- }
24
- didInitialize.current = true;
25
- handleCallback()
26
- .then((redirect) => {
27
- navigate(redirect);
28
- })
29
- .catch((err) => {
30
- logger.error(err);
31
- setError(err);
32
- });
33
- }, [navigate, handleCallback]);
34
-
35
- if (error) {
36
- return (
37
- <ErrorPage
38
- category="Error"
39
- title="Authentication Error"
40
- message={
41
- <>
42
- <DeveloperHint className="mb-4">
43
- Check the configuration of your authorization provider and ensure
44
- all settings such as the callback URL are configured correctly.
45
- </DeveloperHint>
46
- An error occurred while authorizing the user.
47
- <SyntaxHighlight code={error.toString()} language="plain" />
48
- </>
49
- }
50
- />
51
- );
52
- }
53
-
54
- return (
55
- <div className="grid h-full place-items-center">
56
- <Spinner />
57
- </div>
58
- );
27
+ return <Navigate to={executeCallback.data} />;
59
28
  }
@@ -10,7 +10,7 @@ export const useAuth = () => {
10
10
  isAuthEnabled,
11
11
  isPending: authState.isPending,
12
12
  profile: authState.profile,
13
- isAuthenticated: authState.profile,
13
+ isAuthenticated: Boolean(authState.profile),
14
14
 
15
15
  login: async () => {
16
16
  if (!isAuthEnabled) {
@@ -17,6 +17,7 @@ import {
17
17
  DropdownMenuTrigger,
18
18
  } from "../ui/DropdownMenu.js";
19
19
  import { cn } from "../util/cn.js";
20
+ import { joinPath } from "../util/joinPath.js";
20
21
  import { Banner } from "./Banner.js";
21
22
  import { useTheme } from "./context/ThemeContext.js";
22
23
  import { useZudoku } from "./context/ZudokuContext.js";
@@ -70,14 +71,28 @@ export const Header = memo(function HeaderInner() {
70
71
  {page?.logo && (
71
72
  <>
72
73
  <img
73
- src={page.logo.src.light}
74
+ src={
75
+ /https?:\/\//.test(page.logo.src.light)
76
+ ? page.logo.src.light
77
+ : joinPath(
78
+ import.meta.env.BASE_URL,
79
+ page.logo.src.light,
80
+ )
81
+ }
74
82
  alt={page.logo.alt ?? page.pageTitle}
75
83
  style={{ width: page.logo.width }}
76
84
  className={cn("h-10", isDark && "hidden")}
77
85
  loading="lazy"
78
86
  />
79
87
  <img
80
- src={page.logo.src.dark}
88
+ src={
89
+ /https?:\/\//.test(page.logo.src.dark)
90
+ ? page.logo.src.dark
91
+ : joinPath(
92
+ import.meta.env.BASE_URL,
93
+ page.logo.src.dark,
94
+ )
95
+ }
81
96
  alt={page.logo.alt ?? page.pageTitle}
82
97
  style={{ width: page.logo.width }}
83
98
  className={cn("h-10", !isDark && "hidden")}
@@ -2,6 +2,7 @@ import { VisuallyHidden } from "@radix-ui/react-visually-hidden";
2
2
  import { cx } from "class-variance-authority";
3
3
  import { MenuIcon } from "lucide-react";
4
4
  import { NavLink } from "react-router-dom";
5
+ import { useAuth } from "../authentication/hook.js";
5
6
  import {
6
7
  Drawer,
7
8
  DrawerClose,
@@ -11,9 +12,12 @@ import {
11
12
  } from "../ui/Drawer.js";
12
13
  import { useZudoku } from "./context/ZudokuContext.js";
13
14
  import { Search } from "./Search.js";
15
+ import { isHiddenItem } from "./TopNavigation.js";
14
16
 
15
17
  export const MobileTopNavigation = () => {
16
18
  const { topNavigation } = useZudoku();
19
+ const { isAuthenticated } = useAuth();
20
+
17
21
  return (
18
22
  <Drawer direction="right">
19
23
  <div className="flex lg:hidden justify-self-end">
@@ -32,7 +36,7 @@ export const MobileTopNavigation = () => {
32
36
  <Search />
33
37
  </div>
34
38
  <ul className="flex flex-col items-center gap-4 p-4">
35
- {topNavigation.map((item) => (
39
+ {topNavigation.filter(isHiddenItem(isAuthenticated)).map((item) => (
36
40
  <li key={item.label}>
37
41
  <NavLink
38
42
  className={({ isActive }) =>
@@ -8,6 +8,7 @@ import { isValidElementType } from "react-is";
8
8
  import {
9
9
  type Location,
10
10
  type NavigateFunction,
11
+ type Params,
11
12
  type SetURLSearchParams,
12
13
  } from "react-router-dom";
13
14
  import { useExposedProps } from "../util/useExposedProps.js";
@@ -38,6 +39,7 @@ export type ExposedComponentProps = {
38
39
  navigate: NavigateFunction;
39
40
  searchParams: URLSearchParams;
40
41
  setSearchParams: SetURLSearchParams;
42
+ params: Params;
41
43
  };
42
44
 
43
45
  export const Slotlet = ({ name }: { name: string }) => {
@@ -46,6 +46,10 @@ type SyntaxHighlightProps = {
46
46
  language?: string;
47
47
  } & Omit<HighlightProps, "children" | "language">;
48
48
 
49
+ const remapLang = {
50
+ mdx: "md",
51
+ } as Record<string, string>;
52
+
49
53
  export const SyntaxHighlight = ({
50
54
  copyable = true,
51
55
  language = "plain",
@@ -61,7 +65,7 @@ export const SyntaxHighlight = ({
61
65
  return (
62
66
  <Highlight
63
67
  theme={isDark ? themes.vsDark : themes.github}
64
- language={language}
68
+ language={remapLang[language] ?? language}
65
69
  {...props}
66
70
  >
67
71
  {({ className, style, tokens, getLineProps, getTokenProps }) => (