zudoku 0.0.0-f2a195f → 0.0.0-f2fd45c

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 (475) hide show
  1. package/cli.js +2 -2
  2. package/dist/app/entry.client.js +2 -2
  3. package/dist/app/entry.client.js.map +1 -1
  4. package/dist/app/entry.server.js +3 -0
  5. package/dist/app/entry.server.js.map +1 -1
  6. package/dist/app/main.d.ts +1 -0
  7. package/dist/app/main.js +9 -26
  8. package/dist/app/main.js.map +1 -1
  9. package/dist/app/standalone.js.map +1 -1
  10. package/dist/cli/cli.js +1 -2
  11. package/dist/cli/cli.js.map +1 -1
  12. package/dist/cli/common/machine-id/lib.js.map +1 -1
  13. package/dist/cli/common/outdated.js.map +1 -1
  14. package/dist/cli/common/utils/box.js.map +1 -1
  15. package/dist/config/validators/InputSidebarSchema.d.ts +21 -6
  16. package/dist/config/validators/InputSidebarSchema.js +7 -28
  17. package/dist/config/validators/InputSidebarSchema.js.map +1 -1
  18. package/dist/config/validators/SidebarSchema.d.ts +24 -1
  19. package/dist/config/validators/SidebarSchema.js +80 -44
  20. package/dist/config/validators/SidebarSchema.js.map +1 -1
  21. package/dist/config/validators/validate.d.ts +431 -271
  22. package/dist/config/validators/validate.js +26 -8
  23. package/dist/config/validators/validate.js.map +1 -1
  24. package/dist/index.d.ts +5 -2
  25. package/dist/index.js +1 -1
  26. package/dist/index.js.map +1 -1
  27. package/dist/lib/authentication/components/CallbackHandler.js +21 -31
  28. package/dist/lib/authentication/components/CallbackHandler.js.map +1 -1
  29. package/dist/lib/authentication/hook.d.ts +1 -1
  30. package/dist/lib/authentication/hook.js +1 -1
  31. package/dist/lib/authentication/hook.js.map +1 -1
  32. package/dist/lib/authentication/providers/auth0.js +1 -0
  33. package/dist/lib/authentication/providers/auth0.js.map +1 -1
  34. package/dist/lib/components/Header.js +6 -1
  35. package/dist/lib/components/Header.js.map +1 -1
  36. package/dist/lib/components/Heading.d.ts +1 -1
  37. package/dist/lib/components/MobileTopNavigation.js +4 -1
  38. package/dist/lib/components/MobileTopNavigation.js.map +1 -1
  39. package/dist/lib/components/SlotletProvider.d.ts +7 -2
  40. package/dist/lib/components/SlotletProvider.js +3 -5
  41. package/dist/lib/components/SlotletProvider.js.map +1 -1
  42. package/dist/lib/components/SyntaxHighlight.js +4 -1
  43. package/dist/lib/components/SyntaxHighlight.js.map +1 -1
  44. package/dist/lib/components/TopNavigation.d.ts +3 -0
  45. package/dist/lib/components/TopNavigation.js +38 -5
  46. package/dist/lib/components/TopNavigation.js.map +1 -1
  47. package/dist/lib/components/context/ZudokuContext.d.ts +6 -10
  48. package/dist/lib/components/context/ZudokuContext.js +26 -20
  49. package/dist/lib/components/context/ZudokuContext.js.map +1 -1
  50. package/dist/lib/components/index.d.ts +17 -8
  51. package/dist/lib/components/index.js +10 -3
  52. package/dist/lib/components/index.js.map +1 -1
  53. package/dist/lib/components/navigation/Sidebar.js +3 -3
  54. package/dist/lib/components/navigation/Sidebar.js.map +1 -1
  55. package/dist/lib/components/navigation/SidebarCategory.js +18 -9
  56. package/dist/lib/components/navigation/SidebarCategory.js.map +1 -1
  57. package/dist/lib/components/navigation/SidebarItem.js +12 -7
  58. package/dist/lib/components/navigation/SidebarItem.js.map +1 -1
  59. package/dist/lib/components/navigation/utils.js +10 -14
  60. package/dist/lib/components/navigation/utils.js.map +1 -1
  61. package/dist/lib/core/DevPortalContext.d.ts +3 -6
  62. package/dist/lib/core/DevPortalContext.js.map +1 -1
  63. package/dist/lib/core/plugins.d.ts +1 -0
  64. package/dist/lib/core/plugins.js.map +1 -1
  65. package/dist/lib/errors/ErrorAlert.d.ts +1 -1
  66. package/dist/lib/errors/ErrorAlert.js +8 -3
  67. package/dist/lib/errors/ErrorAlert.js.map +1 -1
  68. package/dist/lib/plugins/api-keys/CreateApiKey.js +1 -1
  69. package/dist/lib/plugins/api-keys/CreateApiKey.js.map +1 -1
  70. package/dist/lib/plugins/custom-pages/CustomPage.d.ts +2 -0
  71. package/dist/lib/plugins/custom-pages/CustomPage.js +11 -0
  72. package/dist/lib/plugins/custom-pages/CustomPage.js.map +1 -0
  73. package/dist/lib/plugins/custom-pages/index.d.ts +8 -6
  74. package/dist/lib/plugins/custom-pages/index.js +3 -4
  75. package/dist/lib/plugins/custom-pages/index.js.map +1 -1
  76. package/dist/lib/plugins/markdown/MdxPage.js +1 -1
  77. package/dist/lib/plugins/markdown/MdxPage.js.map +1 -1
  78. package/dist/lib/plugins/markdown/index.d.ts +5 -6
  79. package/dist/lib/plugins/markdown/index.js +31 -3
  80. package/dist/lib/plugins/markdown/index.js.map +1 -1
  81. package/dist/lib/plugins/markdown/resolver.d.ts +38 -0
  82. package/dist/lib/plugins/markdown/resolver.js +75 -0
  83. package/dist/lib/plugins/markdown/resolver.js.map +1 -0
  84. package/dist/lib/plugins/openapi/Endpoint.js.map +1 -1
  85. package/dist/lib/plugins/openapi/RequestBodySidecarBox.js.map +1 -1
  86. package/dist/lib/plugins/openapi/Sidecar.js +2 -2
  87. package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
  88. package/dist/lib/plugins/openapi/client/worker.js.map +1 -1
  89. package/dist/lib/plugins/openapi/index.js.map +1 -1
  90. package/dist/lib/plugins/openapi/playground/Playground.js +2 -1
  91. package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
  92. package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js +1 -1
  93. package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js.map +1 -1
  94. package/dist/lib/plugins/redirect/index.d.ts +2 -5
  95. package/dist/lib/plugins/redirect/index.js +1 -1
  96. package/dist/lib/plugins/redirect/index.js.map +1 -1
  97. package/dist/lib/ui/Accordion.d.ts +7 -0
  98. package/dist/lib/ui/Accordion.js +14 -0
  99. package/dist/lib/ui/Accordion.js.map +1 -0
  100. package/dist/lib/ui/Alert.d.ts +8 -0
  101. package/dist/lib/ui/Alert.js +23 -0
  102. package/dist/lib/ui/Alert.js.map +1 -0
  103. package/dist/lib/ui/AlertDialog.d.ts +20 -0
  104. package/dist/lib/ui/AlertDialog.js +27 -0
  105. package/dist/lib/ui/AlertDialog.js.map +1 -0
  106. package/dist/lib/ui/AspectRatio.d.ts +3 -0
  107. package/dist/lib/ui/AspectRatio.js +4 -0
  108. package/dist/lib/ui/AspectRatio.js.map +1 -0
  109. package/dist/lib/ui/Badge.d.ts +9 -0
  110. package/dist/lib/ui/Badge.js +21 -0
  111. package/dist/lib/ui/Badge.js.map +1 -0
  112. package/dist/lib/ui/Breadcrumb.d.ts +19 -0
  113. package/dist/lib/ui/Breadcrumb.js +24 -0
  114. package/dist/lib/ui/Breadcrumb.js.map +1 -0
  115. package/dist/lib/ui/Button.d.ts +2 -3
  116. package/dist/lib/ui/Button.js +1 -1
  117. package/dist/lib/ui/Button.js.map +1 -1
  118. package/dist/lib/ui/Carousel.d.ts +18 -0
  119. package/dist/lib/ui/Carousel.js +99 -0
  120. package/dist/lib/ui/Carousel.js.map +1 -0
  121. package/dist/lib/ui/Checkbox.d.ts +4 -0
  122. package/dist/lib/ui/Checkbox.js +9 -0
  123. package/dist/lib/ui/Checkbox.js.map +1 -0
  124. package/dist/lib/ui/Collapsible.d.ts +5 -0
  125. package/dist/lib/ui/Collapsible.js +6 -0
  126. package/dist/lib/ui/Collapsible.js.map +1 -0
  127. package/dist/lib/ui/Command.d.ts +80 -0
  128. package/dist/lib/ui/Command.js +31 -0
  129. package/dist/lib/ui/Command.js.map +1 -0
  130. package/dist/lib/{components → ui}/Dialog.js +2 -2
  131. package/dist/lib/ui/Dialog.js.map +1 -0
  132. package/dist/lib/ui/Form.d.ts +23 -0
  133. package/dist/lib/ui/Form.js +63 -0
  134. package/dist/lib/ui/Form.js.map +1 -0
  135. package/dist/lib/ui/HoverCard.d.ts +6 -0
  136. package/dist/lib/ui/HoverCard.js +10 -0
  137. package/dist/lib/ui/HoverCard.js.map +1 -0
  138. package/dist/lib/ui/Label.d.ts +5 -0
  139. package/dist/lib/ui/Label.js +10 -0
  140. package/dist/lib/ui/Label.js.map +1 -0
  141. package/dist/lib/ui/Pagination.d.ts +28 -0
  142. package/dist/lib/ui/Pagination.js +24 -0
  143. package/dist/lib/ui/Pagination.js.map +1 -0
  144. package/dist/lib/ui/Popover.d.ts +6 -0
  145. package/dist/lib/ui/Popover.js +10 -0
  146. package/dist/lib/ui/Popover.js.map +1 -0
  147. package/dist/lib/ui/Progress.d.ts +4 -0
  148. package/dist/lib/ui/Progress.js +8 -0
  149. package/dist/lib/ui/Progress.js.map +1 -0
  150. package/dist/lib/ui/RadioGroup.d.ts +5 -0
  151. package/dist/lib/ui/RadioGroup.js +15 -0
  152. package/dist/lib/ui/RadioGroup.js.map +1 -0
  153. package/dist/lib/ui/ScrollArea.d.ts +5 -0
  154. package/dist/lib/ui/ScrollArea.js +12 -0
  155. package/dist/lib/ui/ScrollArea.js.map +1 -0
  156. package/dist/lib/ui/Select.js.map +1 -0
  157. package/dist/lib/ui/Skeleton.d.ts +2 -0
  158. package/dist/lib/ui/Skeleton.js +7 -0
  159. package/dist/lib/ui/Skeleton.js.map +1 -0
  160. package/dist/lib/ui/Slider.d.ts +4 -0
  161. package/dist/lib/ui/Slider.js +8 -0
  162. package/dist/lib/ui/Slider.js.map +1 -0
  163. package/dist/lib/ui/Switch.d.ts +4 -0
  164. package/dist/lib/ui/Switch.js +8 -0
  165. package/dist/lib/ui/Switch.js.map +1 -0
  166. package/dist/lib/ui/Textarea.d.ts +4 -0
  167. package/dist/lib/ui/Textarea.js +9 -0
  168. package/dist/lib/ui/Textarea.js.map +1 -0
  169. package/dist/lib/ui/Toggle.d.ts +12 -0
  170. package/dist/lib/ui/Toggle.js +26 -0
  171. package/dist/lib/ui/Toggle.js.map +1 -0
  172. package/dist/lib/ui/ToggleGroup.d.ts +12 -0
  173. package/dist/lib/ui/ToggleGroup.js +21 -0
  174. package/dist/lib/ui/ToggleGroup.js.map +1 -0
  175. package/dist/lib/ui/Tooltip.d.ts +7 -0
  176. package/dist/lib/ui/Tooltip.js +11 -0
  177. package/dist/lib/ui/Tooltip.js.map +1 -0
  178. package/dist/lib/util/MdxComponents.js.map +1 -1
  179. package/dist/lib/util/invariant.d.ts +9 -0
  180. package/dist/lib/util/invariant.js +7 -3
  181. package/dist/lib/util/invariant.js.map +1 -1
  182. package/dist/lib/util/useExposedProps.d.ts +2 -0
  183. package/dist/lib/util/useExposedProps.js +9 -0
  184. package/dist/lib/util/useExposedProps.js.map +1 -0
  185. package/dist/lib/util/useScrollToAnchor.js.map +1 -1
  186. package/dist/vite/build.js +12 -3
  187. package/dist/vite/build.js.map +1 -1
  188. package/dist/vite/config.d.ts +2 -8
  189. package/dist/vite/config.js +24 -59
  190. package/dist/vite/config.js.map +1 -1
  191. package/dist/vite/debug.d.ts +1 -0
  192. package/dist/vite/debug.js +10 -0
  193. package/dist/vite/debug.js.map +1 -0
  194. package/dist/vite/dev-server.js +1 -1
  195. package/dist/vite/dev-server.js.map +1 -1
  196. package/dist/vite/output.d.ts +101 -0
  197. package/dist/vite/output.js +30 -0
  198. package/dist/vite/output.js.map +1 -0
  199. package/dist/vite/plugin-component.js +17 -7
  200. package/dist/vite/plugin-component.js.map +1 -1
  201. package/dist/vite/plugin-config-reload.js +0 -2
  202. package/dist/vite/plugin-config-reload.js.map +1 -1
  203. package/dist/vite/plugin-config.d.ts +2 -3
  204. package/dist/vite/plugin-config.js +2 -3
  205. package/dist/vite/plugin-config.js.map +1 -1
  206. package/dist/vite/plugin-docs.js +37 -26
  207. package/dist/vite/plugin-docs.js.map +1 -1
  208. package/dist/vite/plugin-frontmatter.d.ts +2 -1
  209. package/dist/vite/plugin-frontmatter.js +27 -24
  210. package/dist/vite/plugin-frontmatter.js.map +1 -1
  211. package/dist/vite/plugin-mdx.js +17 -0
  212. package/dist/vite/plugin-mdx.js.map +1 -1
  213. package/dist/vite/plugin-search.d.ts +3 -0
  214. package/dist/vite/plugin-search.js +26 -0
  215. package/dist/vite/plugin-search.js.map +1 -0
  216. package/dist/vite/plugin-sidebar.js +7 -6
  217. package/dist/vite/plugin-sidebar.js.map +1 -1
  218. package/dist/vite/plugin.js +4 -2
  219. package/dist/vite/plugin.js.map +1 -1
  220. package/dist/vite/prerender.d.ts +5 -1
  221. package/dist/vite/prerender.js +6 -5
  222. package/dist/vite/prerender.js.map +1 -1
  223. package/lib/{utils-CCcr3AZm.js → AnchorLink-BbB2q-jx.js} +231 -275
  224. package/lib/AnchorLink-BbB2q-jx.js.map +1 -0
  225. package/lib/{AuthenticationPlugin-D_5jC4vE.js → AuthenticationPlugin-C9BHGXlE.js} +3 -3
  226. package/lib/{AuthenticationPlugin-D_5jC4vE.js.map → AuthenticationPlugin-C9BHGXlE.js.map} +1 -1
  227. package/lib/{CategoryHeading-C7VfgpFZ.js → CategoryHeading-Bb9dqxD3.js} +4 -4
  228. package/lib/{CategoryHeading-C7VfgpFZ.js.map → CategoryHeading-Bb9dqxD3.js.map} +1 -1
  229. package/lib/ClientOnly-CVN6leDu.js +11 -0
  230. package/lib/ClientOnly-CVN6leDu.js.map +1 -0
  231. package/lib/{DeveloperHint-CNyuFROc.js → DeveloperHint-DHdLXGHA.js} +2 -2
  232. package/lib/{DeveloperHint-CNyuFROc.js.map → DeveloperHint-DHdLXGHA.js.map} +1 -1
  233. package/lib/Dialog-k70Qfukb.js +67 -0
  234. package/lib/Dialog-k70Qfukb.js.map +1 -0
  235. package/lib/{Markdown-C-0TaxoY.js → Markdown-BDcCAWwm.js} +4268 -6650
  236. package/lib/Markdown-BDcCAWwm.js.map +1 -0
  237. package/lib/{MdxPage-Cbj8ILOL.js → MdxPage-DKMH_t0f.js} +33 -31
  238. package/lib/MdxPage-DKMH_t0f.js.map +1 -0
  239. package/lib/{OperationList-Dto8Wvgo.js → OperationList-Tj7ubW_t.js} +131 -128
  240. package/lib/OperationList-Tj7ubW_t.js.map +1 -0
  241. package/lib/{Route-DLH-PALM.js → Route-C3DGB6OS.js} +3 -3
  242. package/lib/{Route-DLH-PALM.js.map → Route-C3DGB6OS.js.map} +1 -1
  243. package/lib/Select-Bagt3Bme.js +223 -0
  244. package/lib/Select-Bagt3Bme.js.map +1 -0
  245. package/lib/SlotletProvider-Da7eFgd2.js +241 -0
  246. package/lib/SlotletProvider-Da7eFgd2.js.map +1 -0
  247. package/lib/Spinner-C6zroowC.js +40 -0
  248. package/lib/Spinner-C6zroowC.js.map +1 -0
  249. package/lib/StaggeredRender-DDHSzQKE.js +17 -0
  250. package/lib/StaggeredRender-DDHSzQKE.js.map +1 -0
  251. package/lib/{ZudokuContext-uV_XfHPK.js → ZudokuContext-BKXGJTmu.js} +460 -411
  252. package/lib/ZudokuContext-BKXGJTmu.js.map +1 -0
  253. package/lib/__vite-browser-external-BYRIRx8p.js +9 -0
  254. package/lib/__vite-browser-external-BYRIRx8p.js.map +1 -0
  255. package/lib/_commonjsHelpers-BkfeUUK-.js +29 -0
  256. package/lib/_commonjsHelpers-BkfeUUK-.js.map +1 -0
  257. package/lib/assets/worker-Bf8vjASY.js.map +1 -1
  258. package/lib/cn-BmFQLtkS.js +2279 -0
  259. package/lib/cn-BmFQLtkS.js.map +1 -0
  260. package/lib/hook-sn0zMTkE.js +229 -0
  261. package/lib/hook-sn0zMTkE.js.map +1 -0
  262. package/lib/{index-aHWE7ArR.js → index-AjWCJNGC.js} +1332 -1606
  263. package/lib/index-AjWCJNGC.js.map +1 -0
  264. package/lib/index-Bn6Lc9tq.js +9 -0
  265. package/lib/{index-DJqnphbT.js.map → index-Bn6Lc9tq.js.map} +1 -1
  266. package/lib/index-BuAyrJe3.js +46 -0
  267. package/lib/index-BuAyrJe3.js.map +1 -0
  268. package/lib/{index-SrtqdZ3j.js → index-CRo94sKK.js} +8 -6
  269. package/lib/{index-SrtqdZ3j.js.map → index-CRo94sKK.js.map} +1 -1
  270. package/lib/{index-D06ATMgg.js → index-LNp6rxyU.js} +2 -2
  271. package/lib/{index-D06ATMgg.js.map → index-LNp6rxyU.js.map} +1 -1
  272. package/lib/index.esm-C5mr_sKO.js +1193 -0
  273. package/lib/index.esm-C5mr_sKO.js.map +1 -0
  274. package/lib/invariant-Caa8-XvF.js +26 -0
  275. package/lib/invariant-Caa8-XvF.js.map +1 -0
  276. package/lib/{router-Oe6YmY6B.js → router-BsfSoK2j.js} +3 -3
  277. package/lib/{router-Oe6YmY6B.js.map → router-BsfSoK2j.js.map} +1 -1
  278. package/lib/ui/Accordion.js +47 -0
  279. package/lib/ui/Accordion.js.map +1 -0
  280. package/lib/ui/Alert.js +51 -0
  281. package/lib/ui/Alert.js.map +1 -0
  282. package/lib/ui/AlertDialog.js +114 -0
  283. package/lib/ui/AlertDialog.js.map +1 -0
  284. package/lib/ui/AspectRatio.js +6 -0
  285. package/lib/ui/AspectRatio.js.map +1 -0
  286. package/lib/ui/Badge.js +27 -0
  287. package/lib/ui/Badge.js.map +1 -0
  288. package/lib/ui/Breadcrumb.js +94 -0
  289. package/lib/ui/Breadcrumb.js.map +1 -0
  290. package/lib/ui/Button.js +49 -0
  291. package/lib/ui/Button.js.map +1 -0
  292. package/lib/ui/Callout.js +77 -0
  293. package/lib/ui/Callout.js.map +1 -0
  294. package/lib/ui/Card.js +62 -0
  295. package/lib/ui/Card.js.map +1 -0
  296. package/lib/ui/Carousel.js +1410 -0
  297. package/lib/ui/Carousel.js.map +1 -0
  298. package/lib/ui/Checkbox.js +28 -0
  299. package/lib/ui/Checkbox.js.map +1 -0
  300. package/lib/ui/Collapsible.js +8 -0
  301. package/lib/ui/Collapsible.js.map +1 -0
  302. package/lib/ui/Command.js +550 -0
  303. package/lib/ui/Command.js.map +1 -0
  304. package/lib/ui/Dialog.js +101 -0
  305. package/lib/ui/Dialog.js.map +1 -0
  306. package/lib/ui/Drawer.js +1153 -0
  307. package/lib/ui/Drawer.js.map +1 -0
  308. package/lib/ui/DropdownMenu.js +145 -0
  309. package/lib/ui/DropdownMenu.js.map +1 -0
  310. package/lib/ui/Form.js +95 -0
  311. package/lib/ui/Form.js.map +1 -0
  312. package/lib/ui/HoverCard.js +24 -0
  313. package/lib/ui/HoverCard.js.map +1 -0
  314. package/lib/ui/Input.js +22 -0
  315. package/lib/ui/Input.js.map +1 -0
  316. package/lib/ui/Label.js +20 -0
  317. package/lib/ui/Label.js.map +1 -0
  318. package/lib/ui/Pagination.js +106 -0
  319. package/lib/ui/Pagination.js.map +1 -0
  320. package/lib/ui/Popover.js +24 -0
  321. package/lib/ui/Popover.js.map +1 -0
  322. package/lib/ui/Progress.js +27 -0
  323. package/lib/ui/Progress.js.map +1 -0
  324. package/lib/ui/RadioGroup.js +32 -0
  325. package/lib/ui/RadioGroup.js.map +1 -0
  326. package/lib/ui/ScrollArea.js +39 -0
  327. package/lib/ui/ScrollArea.js.map +1 -0
  328. package/lib/ui/Select.js +122 -0
  329. package/lib/ui/Select.js.map +1 -0
  330. package/lib/ui/Skeleton.js +18 -0
  331. package/lib/ui/Skeleton.js.map +1 -0
  332. package/lib/ui/Slider.js +24 -0
  333. package/lib/ui/Slider.js.map +1 -0
  334. package/lib/ui/Switch.js +28 -0
  335. package/lib/ui/Switch.js.map +1 -0
  336. package/lib/ui/Tabs.js +47 -0
  337. package/lib/ui/Tabs.js.map +1 -0
  338. package/lib/ui/Textarea.js +21 -0
  339. package/lib/ui/Textarea.js.map +1 -0
  340. package/lib/ui/Toggle.js +38 -0
  341. package/lib/ui/Toggle.js.map +1 -0
  342. package/lib/ui/ToggleGroup.js +42 -0
  343. package/lib/ui/ToggleGroup.js.map +1 -0
  344. package/lib/ui/Tooltip.js +24 -0
  345. package/lib/ui/Tooltip.js.map +1 -0
  346. package/lib/urql-core-KJnLL26g.js.map +1 -1
  347. package/lib/useExposedProps-ChOIUaS4.js +9 -0
  348. package/lib/useExposedProps-ChOIUaS4.js.map +1 -0
  349. package/lib/zudoku.auth-auth0.js +4 -4
  350. package/lib/zudoku.auth-auth0.js.map +1 -1
  351. package/lib/zudoku.auth-clerk.js +1 -1
  352. package/lib/zudoku.auth-openid.js +477 -483
  353. package/lib/zudoku.auth-openid.js.map +1 -1
  354. package/lib/zudoku.components.js +920 -2889
  355. package/lib/zudoku.components.js.map +1 -1
  356. package/lib/zudoku.openapi-worker.js +2 -2
  357. package/lib/zudoku.plugin-api-keys.js +69 -76
  358. package/lib/zudoku.plugin-api-keys.js.map +1 -1
  359. package/lib/zudoku.plugin-custom-pages.js +17 -8
  360. package/lib/zudoku.plugin-custom-pages.js.map +1 -1
  361. package/lib/zudoku.plugin-markdown.js +93 -27
  362. package/lib/zudoku.plugin-markdown.js.map +1 -1
  363. package/lib/zudoku.plugin-openapi.js +8 -9
  364. package/lib/zudoku.plugin-openapi.js.map +1 -1
  365. package/lib/zudoku.plugin-redirect.js +2 -2
  366. package/lib/zudoku.plugin-redirect.js.map +1 -1
  367. package/lib/zudoku.plugin-search-inkeep.js +9 -13
  368. package/lib/zudoku.plugin-search-inkeep.js.map +1 -1
  369. package/package.json +32 -9
  370. package/src/app/entry.client.tsx +4 -2
  371. package/src/app/entry.server.tsx +4 -0
  372. package/src/app/main.css +4 -1
  373. package/src/app/main.tsx +12 -30
  374. package/src/app/standalone.tsx +1 -1
  375. package/src/lib/authentication/components/CallbackHandler.tsx +20 -51
  376. package/src/lib/authentication/hook.ts +1 -1
  377. package/src/lib/authentication/providers/auth0.tsx +1 -0
  378. package/src/lib/components/Header.tsx +17 -2
  379. package/src/lib/components/MobileTopNavigation.tsx +6 -2
  380. package/src/lib/components/SlotletProvider.tsx +16 -7
  381. package/src/lib/components/SyntaxHighlight.tsx +5 -1
  382. package/src/lib/components/TopNavigation.tsx +70 -23
  383. package/src/lib/components/context/ZudokuContext.ts +28 -20
  384. package/src/lib/components/index.ts +13 -4
  385. package/src/lib/components/navigation/Sidebar.tsx +6 -6
  386. package/src/lib/components/navigation/SidebarCategory.tsx +35 -29
  387. package/src/lib/components/navigation/SidebarItem.tsx +17 -20
  388. package/src/lib/components/navigation/utils.ts +11 -16
  389. package/src/lib/core/DevPortalContext.ts +3 -2
  390. package/src/lib/core/plugins.ts +2 -0
  391. package/src/lib/errors/ErrorAlert.tsx +18 -5
  392. package/src/lib/plugins/api-keys/CreateApiKey.tsx +2 -2
  393. package/src/lib/plugins/custom-pages/CustomPage.tsx +18 -0
  394. package/src/lib/plugins/custom-pages/index.tsx +11 -9
  395. package/src/lib/plugins/markdown/MdxPage.tsx +10 -8
  396. package/src/lib/plugins/markdown/index.tsx +49 -12
  397. package/src/lib/plugins/markdown/resolver.ts +92 -0
  398. package/src/lib/plugins/openapi/Endpoint.tsx +2 -2
  399. package/src/lib/plugins/openapi/RequestBodySidecarBox.tsx +1 -1
  400. package/src/lib/plugins/openapi/Sidecar.tsx +3 -3
  401. package/src/lib/plugins/openapi/client/worker.ts +2 -2
  402. package/src/lib/plugins/openapi/index.tsx +1 -1
  403. package/src/lib/plugins/openapi/playground/Playground.tsx +4 -3
  404. package/src/lib/plugins/openapi/playground/PlaygroundDialog.tsx +1 -1
  405. package/src/lib/plugins/redirect/index.tsx +3 -7
  406. package/src/lib/ui/Accordion.tsx +56 -0
  407. package/src/lib/ui/{Note.tsx → Alert.tsx} +11 -10
  408. package/src/lib/ui/AlertDialog.tsx +139 -0
  409. package/src/lib/ui/AspectRatio.tsx +5 -0
  410. package/src/lib/ui/Badge.tsx +36 -0
  411. package/src/lib/ui/Breadcrumb.tsx +115 -0
  412. package/src/lib/ui/Button.tsx +1 -1
  413. package/src/lib/ui/Carousel.tsx +260 -0
  414. package/src/lib/ui/Checkbox.tsx +28 -0
  415. package/src/lib/ui/Collapsible.tsx +9 -0
  416. package/src/lib/ui/Command.tsx +151 -0
  417. package/src/lib/{components → ui}/Dialog.tsx +4 -3
  418. package/src/lib/ui/Form.tsx +177 -0
  419. package/src/lib/ui/HoverCard.tsx +27 -0
  420. package/src/lib/ui/Label.tsx +24 -0
  421. package/src/lib/ui/Pagination.tsx +117 -0
  422. package/src/lib/ui/Popover.tsx +29 -0
  423. package/src/lib/ui/Progress.tsx +26 -0
  424. package/src/lib/ui/RadioGroup.tsx +42 -0
  425. package/src/lib/ui/ScrollArea.tsx +46 -0
  426. package/src/lib/ui/Skeleton.tsx +15 -0
  427. package/src/lib/ui/Slider.tsx +26 -0
  428. package/src/lib/ui/Switch.tsx +27 -0
  429. package/src/lib/ui/Textarea.tsx +23 -0
  430. package/src/lib/ui/Toggle.tsx +43 -0
  431. package/src/lib/ui/ToggleGroup.tsx +59 -0
  432. package/src/lib/ui/Tooltip.tsx +28 -0
  433. package/src/lib/util/MdxComponents.tsx +0 -1
  434. package/src/lib/util/invariant.ts +15 -3
  435. package/src/lib/util/useExposedProps.tsx +16 -0
  436. package/src/lib/util/useScrollToAnchor.ts +1 -1
  437. package/dist/internal.d.ts +0 -1
  438. package/dist/internal.js +0 -2
  439. package/dist/internal.js.map +0 -1
  440. package/dist/lib/components/Dialog.js.map +0 -1
  441. package/dist/lib/components/Select.js.map +0 -1
  442. package/dist/lib/plugins/markdown/generateRoutes.d.ts +0 -3
  443. package/dist/lib/plugins/markdown/generateRoutes.js +0 -21
  444. package/dist/lib/plugins/markdown/generateRoutes.js.map +0 -1
  445. package/dist/lib/ui/Note.d.ts +0 -8
  446. package/dist/lib/ui/Note.js +0 -23
  447. package/dist/lib/ui/Note.js.map +0 -1
  448. package/lib/ErrorPage-CUz-Zzmx.js +0 -16
  449. package/lib/ErrorPage-CUz-Zzmx.js.map +0 -1
  450. package/lib/Input-CYTkk51A.js +0 -2229
  451. package/lib/Input-CYTkk51A.js.map +0 -1
  452. package/lib/Markdown-C-0TaxoY.js.map +0 -1
  453. package/lib/MdxPage-Cbj8ILOL.js.map +0 -1
  454. package/lib/OperationList-Dto8Wvgo.js.map +0 -1
  455. package/lib/SidebarBadge-BWvFQTc1.js +0 -503
  456. package/lib/SidebarBadge-BWvFQTc1.js.map +0 -1
  457. package/lib/SlotletProvider-BGEs7yyu.js +0 -240
  458. package/lib/SlotletProvider-BGEs7yyu.js.map +0 -1
  459. package/lib/Spinner-3cQDBVGr.js +0 -7
  460. package/lib/Spinner-3cQDBVGr.js.map +0 -1
  461. package/lib/ZudokuContext-uV_XfHPK.js.map +0 -1
  462. package/lib/index-DJqnphbT.js +0 -35
  463. package/lib/index-LstIRx3V.js +0 -124
  464. package/lib/index-LstIRx3V.js.map +0 -1
  465. package/lib/index-SyxHzsgJ.js +0 -2867
  466. package/lib/index-SyxHzsgJ.js.map +0 -1
  467. package/lib/index-aHWE7ArR.js.map +0 -1
  468. package/lib/joinPath-B7kNnUX4.js +0 -8
  469. package/lib/joinPath-B7kNnUX4.js.map +0 -1
  470. package/lib/utils-CCcr3AZm.js.map +0 -1
  471. package/src/lib/plugins/markdown/generateRoutes.tsx +0 -38
  472. /package/dist/lib/{components → ui}/Dialog.d.ts +0 -0
  473. /package/dist/lib/{components → ui}/Select.d.ts +0 -0
  474. /package/dist/lib/{components → ui}/Select.js +0 -0
  475. /package/src/lib/{components → ui}/Select.tsx +0 -0
@@ -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 }) => (
@@ -1,10 +1,26 @@
1
1
  import { cx } from "class-variance-authority";
2
- import { NavLink } from "react-router-dom";
2
+ import { Suspense } from "react";
3
+ import { Link } from "react-router-dom";
4
+ import { useAuth } from "../authentication/hook.js";
5
+ import { TopNavigationItem } from "../../config/validators/validate.js";
6
+ import { joinPath } from "../util/joinPath.js";
7
+ import { useCurrentNavigation, useZudoku } from "./context/ZudokuContext.js";
8
+ import { traverseSidebar } from "./navigation/utils.js";
3
9
 
4
- import { useZudoku } from "./context/ZudokuContext.js";
10
+ export const isHiddenItem =
11
+ (isAuthenticated?: boolean) =>
12
+ (item: { display?: "auth" | "anon" | "always" }) => {
13
+ return (
14
+ (item.display === "auth" && isAuthenticated) ||
15
+ (item.display === "anon" && !isAuthenticated) ||
16
+ !item.display ||
17
+ item.display === "always"
18
+ );
19
+ };
5
20
 
6
21
  export const TopNavigation = () => {
7
22
  const { topNavigation } = useZudoku();
23
+ const { isAuthenticated } = useAuth();
8
24
 
9
25
  // Hide top nav if there is only one item
10
26
  if (topNavigation.length <= 1) {
@@ -12,26 +28,57 @@ export const TopNavigation = () => {
12
28
  }
13
29
 
14
30
  return (
15
- <nav className="hidden lg:block border-b text-sm px-12 h-[--top-nav-height]">
16
- <ul className="flex flex-row items-center gap-8">
17
- {topNavigation.map((item) => (
18
- <li key={item.label}>
19
- <NavLink
20
- className={({ isActive }) =>
21
- cx(
22
- "block py-3.5 font-medium -mb-px border-b-2",
23
- isActive
24
- ? "border-primary text-foreground"
25
- : "border-transparent text-foreground/75 hover:text-foreground hover:border-accent-foreground/25",
26
- )
27
- }
28
- to={item.id}
29
- >
30
- {item.label}
31
- </NavLink>
32
- </li>
33
- ))}
34
- </ul>
35
- </nav>
31
+ <Suspense>
32
+ <nav className="hidden lg:block border-b text-sm px-12 h-[--top-nav-height]">
33
+ <ul className="flex flex-row items-center gap-8">
34
+ {topNavigation.filter(isHiddenItem(isAuthenticated)).map((item) => (
35
+ <li key={item.id}>
36
+ <TopNavItem {...item} />
37
+ </li>
38
+ ))}
39
+ </ul>
40
+ </nav>
41
+ </Suspense>
42
+ );
43
+ };
44
+
45
+ const TopNavItem = ({ id, label, default: defaultLink }: TopNavigationItem) => {
46
+ const { sidebars } = useZudoku();
47
+ const nav = useCurrentNavigation();
48
+ const currentSidebar = sidebars[id];
49
+
50
+ // TODO: This is a bit of a hack to get the first link in the sidebar
51
+ // We should really process this when we load the config so we can validate
52
+ // that the sidebar is actually set. In this case we just fall back to linking
53
+ // to the id if we can't resolve a sidebar.
54
+ const first =
55
+ defaultLink ??
56
+ (currentSidebar
57
+ ? traverseSidebar(currentSidebar, (item) => {
58
+ if (item.type === "doc") return joinPath(item.id);
59
+ })
60
+ : joinPath(id));
61
+
62
+ if (!first) {
63
+ throw new Error(
64
+ `No links found in top navigation for top navigation '${id}'. Check that the sidebar isn't empty or that a default link set.`,
65
+ );
66
+ }
67
+
68
+ // Manually set the active sidebar based on our logic of what is active
69
+ const isActive = nav.data.topNavItem?.id === id;
70
+
71
+ return (
72
+ <Link
73
+ className={cx(
74
+ "block py-3.5 font-medium -mb-px border-b-2",
75
+ isActive
76
+ ? "border-primary text-foreground"
77
+ : "border-transparent text-foreground/75 hover:text-foreground hover:border-accent-foreground/25",
78
+ )}
79
+ to={first}
80
+ >
81
+ {label}
82
+ </Link>
36
83
  );
37
84
  };
@@ -1,7 +1,9 @@
1
1
  import { useQuery, useSuspenseQuery } from "@tanstack/react-query";
2
2
  import { createContext, useContext } from "react";
3
- import { useLocation } from "react-router-dom";
3
+ import { matchPath, useLocation } from "react-router-dom";
4
4
  import { DevPortalContext } from "../../core/DevPortalContext.js";
5
+ import { joinPath } from "../../util/joinPath.js";
6
+ import { traverseSidebar } from "../navigation/utils.js";
5
7
 
6
8
  export const ZudokuReactContext = createContext<DevPortalContext | undefined>(
7
9
  undefined,
@@ -25,34 +27,40 @@ export const useApiIdentities = () => {
25
27
  });
26
28
  };
27
29
 
28
- export const useTopNavigationItem = () => {
29
- const { topNavigation } = useZudoku();
30
+ export const useCurrentNavigation = () => {
31
+ const { getPluginSidebar, sidebars, topNavigation } = useZudoku();
30
32
  const location = useLocation();
31
33
 
32
- const firstPart = location.pathname.split("/").at(1);
33
- if (!firstPart) return;
34
+ const currentSidebarItem = Object.entries(sidebars).find(([, sidebar]) => {
35
+ return traverseSidebar(sidebar, (item) => {
36
+ const itemId =
37
+ item.type === "doc"
38
+ ? joinPath(item.id)
39
+ : item.type === "category" && item.link
40
+ ? joinPath(item.link.id)
41
+ : undefined;
34
42
 
35
- return topNavigation.find((item) => item.id === firstPart);
36
- };
37
-
38
- export const useNavigation = () => {
39
- const { getPluginSidebar, sidebars } = useZudoku();
40
- const navItem = useTopNavigationItem();
41
- const path = navItem?.id;
42
- const currentSidebar = path ? (sidebars[path] ?? []) : [];
43
- const location = useLocation();
43
+ if (itemId === location.pathname) {
44
+ return item;
45
+ }
46
+ });
47
+ });
48
+ const currentTopNavItem =
49
+ topNavigation.find((t) => t.id === currentSidebarItem?.[0]) ??
50
+ topNavigation.find((item) => matchPath(item.id, location.pathname));
44
51
 
45
52
  return useSuspenseQuery({
46
53
  queryFn: async () => {
47
- const pluginSidebar = path
48
- ? await getPluginSidebar(path)
49
- : await getPluginSidebar(location.pathname);
54
+ const pluginSidebar = await getPluginSidebar(location.pathname);
50
55
 
51
56
  return {
52
- items: [...currentSidebar, ...pluginSidebar],
53
- currentTopNavItem: navItem,
57
+ sidebar: [
58
+ ...(currentSidebarItem ? currentSidebarItem[1] : []),
59
+ ...pluginSidebar,
60
+ ],
61
+ topNavItem: currentTopNavItem,
54
62
  };
55
63
  },
56
- queryKey: ["navigation", path],
64
+ queryKey: ["navigation", location.pathname],
57
65
  });
58
66
  };
@@ -1,6 +1,7 @@
1
1
  import { useMDXComponents as useMDXComponentsImport } from "@mdx-js/react";
2
2
  import { Helmet } from "@zudoku/react-helmet-async";
3
3
  import { Link as LinkImport } from "react-router-dom";
4
+ import { useAuthState } from "../authentication/state.js";
4
5
  import { RouterError as RouterErrorImport } from "../errors/RouterError.js";
5
6
  import { ServerError as ServerErrorImport } from "../errors/ServerError.js";
6
7
  import { Button as ButtonImport } from "../ui/Button.js";
@@ -9,17 +10,25 @@ import {
9
10
  Bootstrap as BootstrapImport,
10
11
  BootstrapStatic as BootstrapStaticImport,
11
12
  } from "./Bootstrap.js";
13
+ import { ClientOnly as ClientOnlyImport } from "./ClientOnly.js";
12
14
  import { DevPortal as DevPortalImport } from "./DevPortal.js";
13
15
  import { Layout as LayoutImport } from "./Layout.js";
14
-
16
+ import { useZudoku as useZudokuImport } from "./context/ZudokuContext.js";
15
17
  export const useMDXComponents = /*@__PURE__*/ useMDXComponentsImport;
16
- export const Callout = /*@__PURE__*/ CalloutImport;
17
18
  export const DevPortal = /*@__PURE__*/ DevPortalImport;
18
19
  export const Layout = /*@__PURE__*/ LayoutImport;
19
- export const Link: typeof LinkImport = /*@__PURE__*/ LinkImport;
20
20
  export const RouterError = /*@__PURE__*/ RouterErrorImport;
21
21
  export const ServerError = /*@__PURE__*/ ServerErrorImport;
22
22
  export const Bootstrap = /*@__PURE__*/ BootstrapImport;
23
23
  export const BootstrapStatic = /*@__PURE__*/ BootstrapStaticImport;
24
- export const Button = /*@__PURE__*/ ButtonImport;
24
+
25
25
  export const Head = /*@__PURE__*/ Helmet;
26
+
27
+ export const useZudoku = /*@__PURE__*/ useZudokuImport;
28
+ export const useAuth = /*@__PURE__*/ useAuthState;
29
+ export const Zudoku = /*@__PURE__*/ DevPortalImport;
30
+
31
+ export const Callout = /*@__PURE__*/ CalloutImport;
32
+ export const ClientOnly = /*@__PURE__*/ ClientOnlyImport;
33
+ export const Button = /*@__PURE__*/ ButtonImport;
34
+ export const Link: typeof LinkImport = /*@__PURE__*/ LinkImport;
@@ -2,35 +2,35 @@ import { useRef } from "react";
2
2
 
3
3
  import { VisuallyHidden } from "@radix-ui/react-visually-hidden";
4
4
  import { DrawerContent, DrawerTitle } from "../../ui/Drawer.js";
5
- import { useNavigation } from "../context/ZudokuContext.js";
5
+ import { useCurrentNavigation } from "../context/ZudokuContext.js";
6
6
  import { Slotlet } from "../SlotletProvider.js";
7
7
  import { SidebarItem } from "./SidebarItem.js";
8
8
  import { SidebarWrapper } from "./SidebarWrapper.js";
9
9
 
10
10
  export const Sidebar = () => {
11
11
  const navRef = useRef<HTMLDivElement | null>(null);
12
- const navigation = useNavigation();
12
+ const navigation = useCurrentNavigation();
13
13
 
14
14
  return (
15
15
  <>
16
16
  <SidebarWrapper
17
17
  ref={navRef}
18
- pushMainContent={navigation.data.items.length > 0}
18
+ pushMainContent={navigation.data.sidebar.length > 0}
19
19
  >
20
20
  <Slotlet name="zudoku-before-navigation" />
21
- {navigation.data.items.map((item) => (
21
+ {navigation.data.sidebar.map((item) => (
22
22
  <SidebarItem key={item.label} item={item} />
23
23
  ))}
24
24
  <Slotlet name="zudoku-after-navigation" />
25
25
  </SidebarWrapper>
26
26
  <DrawerContent
27
- className="lg:hidden h-screen left-0 p-6 w-[320px] rounded-none"
27
+ className="lg:hidden h-screen left-0 p-6 w-[320px] rounded-none overflow-auto"
28
28
  aria-describedby={undefined}
29
29
  >
30
30
  <VisuallyHidden>
31
31
  <DrawerTitle>Sidebar</DrawerTitle>
32
32
  </VisuallyHidden>
33
- {navigation.data.items.map((item) => (
33
+ {navigation.data.sidebar.map((item) => (
34
34
  <SidebarItem key={item.label} item={item} />
35
35
  ))}
36
36
  </DrawerContent>
@@ -1,11 +1,10 @@
1
1
  import * as Collapsible from "@radix-ui/react-collapsible";
2
2
  import { ChevronRightIcon } from "lucide-react";
3
3
  import { useEffect, useState } from "react";
4
- import { NavLink } from "react-router-dom";
4
+ import { NavLink, useMatch } from "react-router-dom";
5
5
  import type { SidebarItemCategory } from "../../../config/validators/SidebarSchema.js";
6
6
  import { cn } from "../../util/cn.js";
7
7
  import { joinPath } from "../../util/joinPath.js";
8
- import { useTopNavigationItem } from "../context/ZudokuContext.js";
9
8
  import { navigationListItem, SidebarItem } from "./SidebarItem.js";
10
9
  import { useIsCategoryOpen } from "./utils.js";
11
10
 
@@ -16,7 +15,6 @@ export const SidebarCategory = ({
16
15
  category: SidebarItemCategory;
17
16
  level: number;
18
17
  }) => {
19
- const topNavItem = useTopNavigationItem();
20
18
  const isCategoryOpen = useIsCategoryOpen(category);
21
19
  const [hasInteracted, setHasInteracted] = useState(false);
22
20
 
@@ -26,6 +24,7 @@ export const SidebarCategory = ({
26
24
  !isCollapsible || !isCollapsed || isCategoryOpen,
27
25
  );
28
26
  const [open, setOpen] = useState(isDefaultOpen);
27
+ const isActive = useMatch(category.link?.id ?? "");
29
28
 
30
29
  useEffect(() => {
31
30
  // this is triggered when an item from the sidebar is clicked
@@ -56,46 +55,54 @@ export const SidebarCategory = ({
56
55
 
57
56
  return (
58
57
  <Collapsible.Root
59
- className={cn("flex flex-col", level === 0 && "-mx-[--padding-nav-item]")}
58
+ className="flex flex-col"
60
59
  defaultOpen={isDefaultOpen}
61
60
  open={open}
62
61
  onOpenChange={() => setOpen(true)}
63
62
  >
64
63
  <Collapsible.Trigger className="group" asChild disabled={!isCollapsible}>
65
64
  <div
66
- className={cn(
67
- "text-start",
68
- navigationListItem({ isActive: false, isTopLevel: level === 0 }),
69
- isCollapsible
70
- ? "cursor-pointer"
71
- : "cursor-default hover:bg-transparent",
72
- )}
65
+ onClick={() => setHasInteracted(true)}
66
+ className={navigationListItem({
67
+ isActive: false,
68
+ isTopLevel: level === 0,
69
+ className: [
70
+ "text-start",
71
+ isCollapsible
72
+ ? "cursor-pointer"
73
+ : "cursor-default hover:bg-transparent",
74
+ ],
75
+ })}
73
76
  >
74
77
  {category.icon && (
75
78
  <category.icon
76
79
  size={16}
77
- className="align-[-0.125em] -translate-x-1"
80
+ className={cn(
81
+ "align-[-0.125em] -translate-x-1",
82
+ isActive && "text-primary",
83
+ )}
78
84
  />
79
85
  )}
80
86
  {category.link?.type === "doc" ? (
81
87
  <NavLink
82
- to={joinPath(topNavItem?.id, category.link.id)}
88
+ to={joinPath(category.link.id)}
83
89
  className="flex-1"
84
- onClick={() => setHasInteracted(true)}
90
+ onClick={() => {
91
+ // if it is the current path and closed then open it because there's no path change to trigger the open
92
+ if (isActive && !open) {
93
+ setOpen(true);
94
+ }
95
+ }}
85
96
  >
86
- {({ isActive }) => (
87
- <div
88
- className={cn(
89
- "flex items-center gap-2 justify-between w-full",
90
- isActive
91
- ? "text-primary font-medium"
92
- : "text-foreground/80",
93
- )}
94
- >
95
- <div className="truncate">{category.label}</div>
96
- {ToggleButton}
97
- </div>
98
- )}
97
+ <div
98
+ className={cn(
99
+ "flex items-center gap-2 justify-between w-full",
100
+ isActive ? "text-primary" : "text-foreground/80",
101
+ )}
102
+ >
103
+ <div className="truncate">{category.label}</div>
104
+ {ToggleButton}
105
+ </div>
99
106
  </NavLink>
100
107
  ) : (
101
108
  <div className="flex items-center justify-between w-full">
@@ -109,10 +116,9 @@ export const SidebarCategory = ({
109
116
  className={cn(
110
117
  // CollapsibleContent class is used to animate and it should only be applied when the user has triggered the toggle
111
118
  hasInteracted && "CollapsibleContent",
112
- "ms-[calc(var(--padding-nav-item)*1.125)]",
113
119
  )}
114
120
  >
115
- <ul className="mt-1 border-l ps-2">
121
+ <ul className="mt-1 border-l ms-0.5">
116
122
  {category.items.map((item) => (
117
123
  <SidebarItem
118
124
  key={
@@ -3,11 +3,9 @@ import { ExternalLinkIcon } from "lucide-react";
3
3
  import { NavLink, useSearchParams } from "react-router-dom";
4
4
 
5
5
  import type { SidebarItem as SidebarItemType } from "../../../config/validators/SidebarSchema.js";
6
- import { cn } from "../../util/cn.js";
7
6
  import { joinPath } from "../../util/joinPath.js";
8
7
  import { AnchorLink } from "../AnchorLink.js";
9
8
  import { useViewportAnchor } from "../context/ViewportAnchorContext.js";
10
- import { useTopNavigationItem } from "../context/ZudokuContext.js";
11
9
  import { SidebarBadge } from "./SidebarBadge.js";
12
10
  import { SidebarCategory } from "./SidebarCategory.js";
13
11
 
@@ -16,7 +14,8 @@ export const navigationListItem = cva(
16
14
  {
17
15
  variants: {
18
16
  isTopLevel: {
19
- true: "font-semibold",
17
+ true: "font-medium -mx-[--padding-nav-item]",
18
+ false: "-mr-[--padding-nav-item] ml-[--padding-nav-item]",
20
19
  },
21
20
  isActive: {
22
21
  true: "text-primary font-medium",
@@ -27,6 +26,9 @@ export const navigationListItem = cva(
27
26
  false: "",
28
27
  },
29
28
  },
29
+ defaultVariants: {
30
+ isActive: false,
31
+ },
30
32
  },
31
33
  );
32
34
 
@@ -40,7 +42,6 @@ export const SidebarItem = ({
40
42
  basePath?: string;
41
43
  level?: number;
42
44
  }) => {
43
- const topNavItem = useTopNavigationItem();
44
45
  const { activeAnchor } = useViewportAnchor();
45
46
  const [searchParams] = useSearchParams();
46
47
 
@@ -53,12 +54,12 @@ export const SidebarItem = ({
53
54
  className={({ isActive }) =>
54
55
  navigationListItem({ isActive, isTopLevel: level === 0 })
55
56
  }
56
- to={joinPath(topNavItem?.id, item.id)}
57
+ to={joinPath(item.id)}
57
58
  >
58
59
  {item.icon && <item.icon size={16} className="align-[-0.125em]" />}
59
60
  {item.badge ? (
60
61
  <>
61
- <span className="truncate" title={item.label}>
62
+ <span className="truncate flex-1" title={item.label}>
62
63
  {item.label}
63
64
  </span>
64
65
  <SidebarBadge {...item.badge} />
@@ -73,13 +74,11 @@ export const SidebarItem = ({
73
74
  <AnchorLink
74
75
  to={{ hash: item.href, search: searchParams.toString() }}
75
76
  {...{ [DATA_ANCHOR_ATTR]: item.href.slice(1) }}
76
- className={cn(
77
- "flex gap-2.5 justify-between",
78
- level === 0 && "-mx-[--padding-nav-item]",
79
- navigationListItem({
80
- isActive: item.href.slice(1) === activeAnchor,
81
- }),
82
- )}
77
+ className={navigationListItem({
78
+ isActive: item.href.slice(1) === activeAnchor,
79
+ isTopLevel: level === 0,
80
+ className: item.badge?.placement !== "start" && "justify-between",
81
+ })}
83
82
  >
84
83
  {item.badge ? (
85
84
  <>
@@ -94,7 +93,9 @@ export const SidebarItem = ({
94
93
  </AnchorLink>
95
94
  ) : !item.href.startsWith("http") ? (
96
95
  <NavLink
97
- className={cn("flex gap-2.5 justify-between", navigationListItem())}
96
+ className={navigationListItem({
97
+ className: item.badge?.placement !== "start" && "justify-between",
98
+ })}
98
99
  to={item.href}
99
100
  >
100
101
  {item.badge ? (
@@ -110,10 +111,7 @@ export const SidebarItem = ({
110
111
  </NavLink>
111
112
  ) : (
112
113
  <a
113
- className={cn(
114
- navigationListItem({ isTopLevel: level === 0 }),
115
- "block",
116
- )}
114
+ className={navigationListItem({ isTopLevel: level === 0 })}
117
115
  href={item.href}
118
116
  target="_blank"
119
117
  rel="noopener noreferrer"
@@ -121,8 +119,7 @@ export const SidebarItem = ({
121
119
  <span className="whitespace-normal">{item.label}</span>
122
120
  {/* This prevents that the icon would be positioned in its own line if the text fills a line entirely */}
123
121
  <span className="whitespace-nowrap">
124
- &nbsp;
125
- <ExternalLinkIcon className="inline ml-1" size={12} />
122
+ <ExternalLinkIcon className="inline -translate-y-0.5" size={12} />
126
123
  </span>
127
124
  </a>
128
125
  );
@@ -4,7 +4,7 @@ import type {
4
4
  SidebarItemCategory,
5
5
  } from "../../../config/validators/SidebarSchema.js";
6
6
  import { joinPath } from "../../util/joinPath.js";
7
- import { useTopNavigationItem, useZudoku } from "../context/ZudokuContext.js";
7
+ import { useCurrentNavigation } from "../context/ZudokuContext.js";
8
8
 
9
9
  export type TraverseCallback<T> = (
10
10
  item: SidebarItem,
@@ -42,15 +42,12 @@ export const traverseSidebarItem = <T>(
42
42
 
43
43
  export const useCurrentItem = () => {
44
44
  const location = useLocation();
45
- const topNavItem = useTopNavigationItem();
46
- const { sidebars } = useZudoku();
47
- const currentSidebar = topNavItem?.id ? sidebars[topNavItem.id] : [];
45
+ const nav = useCurrentNavigation();
46
+
47
+ const currentSidebar = nav.data.sidebar;
48
48
 
49
49
  return traverseSidebar(currentSidebar, (item) => {
50
- if (
51
- item.type === "doc" &&
52
- joinPath(topNavItem?.id, item.id) === location.pathname
53
- ) {
50
+ if (item.type === "doc" && joinPath(item.id) === location.pathname) {
54
51
  return item;
55
52
  }
56
53
  });
@@ -58,18 +55,17 @@ export const useCurrentItem = () => {
58
55
 
59
56
  export const useIsCategoryOpen = (category: SidebarItemCategory) => {
60
57
  const location = useLocation();
61
- const topNavItem = useTopNavigationItem();
62
58
 
63
59
  return traverseSidebarItem(category, (item) => {
64
60
  if (item.type === "category" && item.link) {
65
- const categoryLinkPath = joinPath(topNavItem?.id, item.link.id);
61
+ const categoryLinkPath = joinPath(item.link.id);
66
62
  if (categoryLinkPath === location.pathname) {
67
63
  return true;
68
64
  }
69
65
  }
70
66
 
71
67
  if (item.type === "doc") {
72
- const docPath = joinPath(topNavItem?.id, item.id);
68
+ const docPath = joinPath(item.id);
73
69
  if (docPath === location.pathname) {
74
70
  return true;
75
71
  }
@@ -82,9 +78,8 @@ export const usePrevNext = (): {
82
78
  next?: { label: string; id: string };
83
79
  } => {
84
80
  const currentId = useLocation().pathname;
85
- const { sidebars } = useZudoku();
86
- const topNavItem = useTopNavigationItem();
87
- const currentSidebar = topNavItem?.id ? sidebars[topNavItem.id] : [];
81
+ const nav = useCurrentNavigation();
82
+ const currentSidebar = nav.data.sidebar;
88
83
 
89
84
  let prev;
90
85
  let next;
@@ -94,9 +89,9 @@ export const usePrevNext = (): {
94
89
  traverseSidebar(currentSidebar, (item) => {
95
90
  const itemId =
96
91
  item.type === "doc"
97
- ? joinPath(topNavItem?.id, item.id)
92
+ ? joinPath(item.id)
98
93
  : item.type === "category" && item.link
99
- ? joinPath(topNavItem?.id, item.link.id)
94
+ ? joinPath(item.link.id)
100
95
  : undefined;
101
96
 
102
97
  if (!itemId) return;
@@ -1,6 +1,7 @@
1
1
  import { QueryClient } from "@tanstack/react-query";
2
2
  import { ReactNode } from "react";
3
3
  import type { SidebarConfig } from "../../config/validators/SidebarSchema.js";
4
+ import { TopNavigationItem } from "../../config/validators/validate.js";
4
5
  import { type AuthenticationProvider } from "../authentication/authentication.js";
5
6
  import type { ComponentsContextType } from "../components/context/ComponentsContext.js";
6
7
  import { Slotlets } from "../components/SlotletProvider.js";
@@ -60,7 +61,7 @@ export type ZudokuContextOptions = {
60
61
  metadata?: Metadata;
61
62
  page?: Page;
62
63
  authentication?: AuthenticationProvider;
63
- topNavigation?: Array<{ id: string; label: string; default?: string }>;
64
+ topNavigation?: TopNavigationItem[];
64
65
  sidebars?: SidebarConfig;
65
66
  plugins?: DevPortalPlugin[];
66
67
  slotlets?: Slotlets;
@@ -72,7 +73,7 @@ export type ZudokuContextOptions = {
72
73
 
73
74
  export class DevPortalContext {
74
75
  public plugins: NonNullable<ZudokuContextOptions["plugins"]>;
75
- public sidebars: NonNullable<ZudokuContextOptions["sidebars"]>;
76
+ public sidebars: SidebarConfig;
76
77
  public topNavigation: NonNullable<ZudokuContextOptions["topNavigation"]>;
77
78
  public meta: ZudokuContextOptions["metadata"];
78
79
  public page: ZudokuContextOptions["page"];
@@ -11,6 +11,8 @@ export type DevPortalPlugin =
11
11
  | ApiIdentityPlugin
12
12
  | SearchProviderPlugin;
13
13
 
14
+ export type { RouteObject };
15
+
14
16
  export interface NavigationPlugin {
15
17
  getRoutes: () => RouteObject[];
16
18
  getSidebar?: (path: string) => Promise<Sidebar>;
@@ -1,16 +1,29 @@
1
1
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
2
- export function ErrorAlert({ error }: { error: any }) {
3
- const message = error?.message ?? "Something went wrong";
4
- const stack = error?.stack;
2
+ import { DeveloperHint } from "../components/DeveloperHint.js";
3
+ import { ZudokuError } from "../util/invariant.js";
4
+
5
+ export function ErrorAlert({ error }: { error: unknown }) {
6
+ const message =
7
+ error instanceof Error ? error.message : "Something went wrong";
8
+ const hint = error instanceof ZudokuError ? error.developerHint : undefined;
9
+ const title =
10
+ error instanceof ZudokuError ? error.title : "Something went wrong";
11
+ const stack = error instanceof Error ? error.stack : undefined;
12
+ const cause = error instanceof Error ? error.cause : undefined;
5
13
 
6
14
  return (
7
15
  <div className="flex h-screen max-h-screen min-h-full items-center justify-center bg-primary-background px-4 py-16 lg:px-8">
8
16
  <div className="mx-auto max-w-[85%] sm:max-w-[50%]">
9
17
  <h1 className="text-4xl font-bold tracking-tight text-h1-text sm:text-5xl">
10
- Something went wrong
18
+ {title}
11
19
  </h1>
12
20
  <p className="mt-5 text-h1-text">{message}</p>
13
- {stack ? (
21
+ {hint && <DeveloperHint className="mb-4">{hint}</DeveloperHint>}
22
+ {cause instanceof Error ? (
23
+ <pre className="mt-5 max-h-[400px] w-full overflow-scroll rounded-md border border-input-border bg-input-background p-3 text-property-name-text text-red-700">
24
+ {cause.stack}
25
+ </pre>
26
+ ) : stack ? (
14
27
  <pre className="mt-5 max-h-[400px] w-full overflow-scroll rounded-md border border-input-border bg-input-background p-3 text-property-name-text text-red-700">
15
28
  {stack}
16
29
  </pre>