zudoku 0.0.0-f3858d6 → 0.0.0-f49e3ea

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 (658) hide show
  1. package/README.md +121 -0
  2. package/dist/app/demo.js +0 -2
  3. package/dist/app/demo.js.map +1 -1
  4. package/dist/app/entry.client.js +14 -0
  5. package/dist/app/entry.client.js.map +1 -1
  6. package/dist/app/entry.server.js +6 -6
  7. package/dist/app/entry.server.js.map +1 -1
  8. package/dist/app/main.d.ts +1 -1
  9. package/dist/app/main.js +5 -7
  10. package/dist/app/main.js.map +1 -1
  11. package/dist/app/standalone.js +0 -2
  12. package/dist/app/standalone.js.map +1 -1
  13. package/dist/cli/cli.js +1 -2
  14. package/dist/cli/cli.js.map +1 -1
  15. package/dist/codegen.d.ts +3 -0
  16. package/dist/codegen.js +45 -0
  17. package/dist/codegen.js.map +1 -0
  18. package/dist/config/validators/InputSidebarSchema.d.ts +21 -6
  19. package/dist/config/validators/InputSidebarSchema.js +7 -28
  20. package/dist/config/validators/InputSidebarSchema.js.map +1 -1
  21. package/dist/config/validators/SidebarSchema.d.ts +24 -1
  22. package/dist/config/validators/SidebarSchema.js +77 -37
  23. package/dist/config/validators/SidebarSchema.js.map +1 -1
  24. package/dist/config/validators/validate.d.ts +354 -256
  25. package/dist/config/validators/validate.js +19 -2
  26. package/dist/config/validators/validate.js.map +1 -1
  27. package/dist/index.d.ts +3 -3
  28. package/dist/index.js +1 -1
  29. package/dist/index.js.map +1 -1
  30. package/dist/lib/authentication/authentication.d.ts +2 -2
  31. package/dist/lib/authentication/components/CallbackHandler.js +21 -31
  32. package/dist/lib/authentication/components/CallbackHandler.js.map +1 -1
  33. package/dist/lib/authentication/hook.d.ts +5 -4
  34. package/dist/lib/authentication/hook.js +1 -3
  35. package/dist/lib/authentication/hook.js.map +1 -1
  36. package/dist/lib/authentication/providers/auth0.js +12 -11
  37. package/dist/lib/authentication/providers/auth0.js.map +1 -1
  38. package/dist/lib/authentication/providers/openid.d.ts +0 -1
  39. package/dist/lib/authentication/providers/openid.js +11 -26
  40. package/dist/lib/authentication/providers/openid.js.map +1 -1
  41. package/dist/lib/authentication/state.d.ts +25 -4
  42. package/dist/lib/authentication/state.js +28 -3
  43. package/dist/lib/authentication/state.js.map +1 -1
  44. package/dist/lib/authentication/use-broadcast/shared.d.ts +48 -0
  45. package/dist/lib/authentication/use-broadcast/shared.js +243 -0
  46. package/dist/lib/authentication/use-broadcast/shared.js.map +1 -0
  47. package/dist/lib/authentication/use-broadcast/useBroadcast.d.ts +24 -0
  48. package/dist/lib/authentication/use-broadcast/useBroadcast.js +106 -0
  49. package/dist/lib/authentication/use-broadcast/useBroadcast.js.map +1 -0
  50. package/dist/lib/components/Bootstrap.d.ts +3 -1
  51. package/dist/lib/components/Bootstrap.js +11 -3
  52. package/dist/lib/components/Bootstrap.js.map +1 -1
  53. package/dist/lib/components/ClientOnly.d.ts +4 -2
  54. package/dist/lib/components/ClientOnly.js +1 -1
  55. package/dist/lib/components/ClientOnly.js.map +1 -1
  56. package/dist/lib/components/DeveloperHint.js +2 -1
  57. package/dist/lib/components/DeveloperHint.js.map +1 -1
  58. package/dist/lib/components/Header.js +7 -8
  59. package/dist/lib/components/Header.js.map +1 -1
  60. package/dist/lib/components/Heading.d.ts +1 -1
  61. package/dist/lib/components/Layout.js +6 -3
  62. package/dist/lib/components/Layout.js.map +1 -1
  63. package/dist/lib/components/MobileTopNavigation.js +8 -6
  64. package/dist/lib/components/MobileTopNavigation.js.map +1 -1
  65. package/dist/lib/components/Search.js +1 -1
  66. package/dist/lib/components/Search.js.map +1 -1
  67. package/dist/lib/components/SlotletProvider.d.ts +7 -2
  68. package/dist/lib/components/SlotletProvider.js +3 -5
  69. package/dist/lib/components/SlotletProvider.js.map +1 -1
  70. package/dist/lib/components/SyntaxHighlight.js +19 -12
  71. package/dist/lib/components/SyntaxHighlight.js.map +1 -1
  72. package/dist/lib/components/ThemeSwitch.d.ts +1 -0
  73. package/dist/lib/components/ThemeSwitch.js +13 -0
  74. package/dist/lib/components/ThemeSwitch.js.map +1 -0
  75. package/dist/lib/components/TopNavigation.d.ts +5 -0
  76. package/dist/lib/components/TopNavigation.js +22 -8
  77. package/dist/lib/components/TopNavigation.js.map +1 -1
  78. package/dist/lib/components/{DevPortal.d.ts → Zudoku.d.ts} +3 -3
  79. package/dist/lib/components/{DevPortal.js → Zudoku.js} +13 -14
  80. package/dist/lib/components/Zudoku.js.map +1 -0
  81. package/dist/lib/components/context/ZudokuContext.d.ts +7 -6
  82. package/dist/lib/components/context/ZudokuContext.js +8 -13
  83. package/dist/lib/components/context/ZudokuContext.js.map +1 -1
  84. package/dist/lib/components/context/ZudokuProvider.d.ts +2 -2
  85. package/dist/lib/components/context/ZudokuProvider.js.map +1 -1
  86. package/dist/lib/components/index.d.ts +30 -13
  87. package/dist/lib/components/index.js +11 -5
  88. package/dist/lib/components/index.js.map +1 -1
  89. package/dist/lib/components/navigation/Sidebar.js +1 -1
  90. package/dist/lib/components/navigation/Sidebar.js.map +1 -1
  91. package/dist/lib/components/navigation/SidebarCategory.js +18 -7
  92. package/dist/lib/components/navigation/SidebarCategory.js.map +1 -1
  93. package/dist/lib/components/navigation/SidebarItem.js +12 -5
  94. package/dist/lib/components/navigation/SidebarItem.js.map +1 -1
  95. package/dist/lib/components/navigation/utils.js +2 -2
  96. package/dist/lib/components/navigation/utils.js.map +1 -1
  97. package/dist/lib/core/{DevPortalContext.d.ts → ZudokuContext.d.ts} +3 -7
  98. package/dist/lib/core/{DevPortalContext.js → ZudokuContext.js} +2 -7
  99. package/dist/lib/core/ZudokuContext.js.map +1 -0
  100. package/dist/lib/core/plugins.d.ts +12 -12
  101. package/dist/lib/core/plugins.js.map +1 -1
  102. package/dist/lib/errors/ErrorAlert.d.ts +1 -1
  103. package/dist/lib/errors/ErrorAlert.js +8 -3
  104. package/dist/lib/errors/ErrorAlert.js.map +1 -1
  105. package/dist/lib/oas/graphql/index.js +4 -4
  106. package/dist/lib/oas/graphql/index.js.map +1 -1
  107. package/dist/lib/oas/parser/upgrade/index.js +3 -1
  108. package/dist/lib/oas/parser/upgrade/index.js.map +1 -1
  109. package/dist/lib/plugins/api-keys/CreateApiKey.js +1 -1
  110. package/dist/lib/plugins/api-keys/CreateApiKey.js.map +1 -1
  111. package/dist/lib/plugins/api-keys/index.d.ts +9 -9
  112. package/dist/lib/plugins/api-keys/index.js.map +1 -1
  113. package/dist/lib/plugins/custom-pages/CustomPage.d.ts +2 -0
  114. package/dist/lib/plugins/custom-pages/CustomPage.js +11 -0
  115. package/dist/lib/plugins/custom-pages/CustomPage.js.map +1 -0
  116. package/dist/lib/plugins/custom-pages/index.d.ts +9 -7
  117. package/dist/lib/plugins/custom-pages/index.js +3 -4
  118. package/dist/lib/plugins/custom-pages/index.js.map +1 -1
  119. package/dist/lib/plugins/markdown/MdxPage.js +1 -1
  120. package/dist/lib/plugins/markdown/MdxPage.js.map +1 -1
  121. package/dist/lib/plugins/markdown/index.d.ts +2 -2
  122. package/dist/lib/plugins/markdown/index.js.map +1 -1
  123. package/dist/lib/plugins/openapi/CollapsibleCode.d.ts +5 -0
  124. package/dist/lib/plugins/openapi/CollapsibleCode.js +24 -0
  125. package/dist/lib/plugins/openapi/CollapsibleCode.js.map +1 -0
  126. package/dist/lib/plugins/openapi/ColorizedParam.js +13 -9
  127. package/dist/lib/plugins/openapi/ColorizedParam.js.map +1 -1
  128. package/dist/lib/plugins/openapi/Endpoint.d.ts +1 -1
  129. package/dist/lib/plugins/openapi/Endpoint.js +5 -9
  130. package/dist/lib/plugins/openapi/Endpoint.js.map +1 -1
  131. package/dist/lib/plugins/openapi/OperationList.d.ts +2 -2
  132. package/dist/lib/plugins/openapi/OperationList.js +21 -22
  133. package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
  134. package/dist/lib/plugins/openapi/ParameterListItem.js +6 -1
  135. package/dist/lib/plugins/openapi/ParameterListItem.js.map +1 -1
  136. package/dist/lib/plugins/openapi/RequestBodySidecarBox.js +7 -3
  137. package/dist/lib/plugins/openapi/RequestBodySidecarBox.js.map +1 -1
  138. package/dist/lib/plugins/openapi/ResponsesSidecarBox.js +9 -2
  139. package/dist/lib/plugins/openapi/ResponsesSidecarBox.js.map +1 -1
  140. package/dist/lib/plugins/openapi/Route.d.ts +4 -4
  141. package/dist/lib/plugins/openapi/Route.js +2 -4
  142. package/dist/lib/plugins/openapi/Route.js.map +1 -1
  143. package/dist/lib/plugins/openapi/Sidecar.d.ts +1 -1
  144. package/dist/lib/plugins/openapi/Sidecar.js +35 -33
  145. package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
  146. package/dist/lib/plugins/openapi/client/GraphQLClient.d.ts +8 -0
  147. package/dist/lib/plugins/openapi/client/GraphQLClient.js +102 -0
  148. package/dist/lib/plugins/openapi/client/GraphQLClient.js.map +1 -0
  149. package/dist/lib/plugins/openapi/client/GraphQLContext.d.ts +7 -0
  150. package/dist/lib/plugins/openapi/client/GraphQLContext.js +5 -0
  151. package/dist/lib/plugins/openapi/client/GraphQLContext.js.map +1 -0
  152. package/dist/lib/plugins/openapi/client/createServer.d.ts +1 -0
  153. package/dist/lib/plugins/openapi/client/useCreateQuery.d.ts +5 -0
  154. package/dist/lib/plugins/openapi/client/useCreateQuery.js +13 -0
  155. package/dist/lib/plugins/openapi/client/useCreateQuery.js.map +1 -0
  156. package/dist/lib/plugins/openapi/client/worker.d.ts +4 -1
  157. package/dist/lib/plugins/openapi/client/worker.js +23 -14
  158. package/dist/lib/plugins/openapi/client/worker.js.map +1 -1
  159. package/dist/lib/plugins/openapi/graphql/fragment-masking.d.ts +3 -3
  160. package/dist/lib/plugins/openapi/graphql/fragment-masking.js +3 -4
  161. package/dist/lib/plugins/openapi/graphql/fragment-masking.js.map +1 -1
  162. package/dist/lib/plugins/openapi/graphql/gql.d.ts +5 -51
  163. package/dist/lib/plugins/openapi/graphql/gql.js +4 -2
  164. package/dist/lib/plugins/openapi/graphql/gql.js.map +1 -1
  165. package/dist/lib/plugins/openapi/graphql/graphql.d.ts +32 -8
  166. package/dist/lib/plugins/openapi/graphql/graphql.js +194 -662
  167. package/dist/lib/plugins/openapi/graphql/graphql.js.map +1 -1
  168. package/dist/lib/plugins/openapi/index.d.ts +2 -2
  169. package/dist/lib/plugins/openapi/index.js +40 -53
  170. package/dist/lib/plugins/openapi/index.js.map +1 -1
  171. package/dist/lib/plugins/openapi/playground/Playground.js +2 -1
  172. package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
  173. package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js +1 -1
  174. package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js.map +1 -1
  175. package/dist/lib/plugins/openapi/schema/SchemaView.js +2 -1
  176. package/dist/lib/plugins/openapi/schema/SchemaView.js.map +1 -1
  177. package/dist/lib/plugins/openapi/util/generateSchemaExample.d.ts +0 -1
  178. package/dist/lib/plugins/openapi/util/generateSchemaExample.js +25 -36
  179. package/dist/lib/plugins/openapi/util/generateSchemaExample.js.map +1 -1
  180. package/dist/lib/plugins/openapi-worker.d.ts +1 -1
  181. package/dist/lib/plugins/openapi-worker.js +7 -1
  182. package/dist/lib/plugins/openapi-worker.js.map +1 -1
  183. package/dist/lib/plugins/redirect/index.d.ts +4 -7
  184. package/dist/lib/plugins/redirect/index.js +1 -1
  185. package/dist/lib/plugins/redirect/index.js.map +1 -1
  186. package/dist/lib/plugins/search-inkeep/index.d.ts +2 -2
  187. package/dist/lib/plugins/search-inkeep/index.js.map +1 -1
  188. package/dist/lib/ui/Accordion.d.ts +7 -0
  189. package/dist/lib/ui/Accordion.js +14 -0
  190. package/dist/lib/ui/Accordion.js.map +1 -0
  191. package/dist/lib/ui/ActionButton.d.ts +4 -0
  192. package/dist/lib/ui/ActionButton.js +10 -0
  193. package/dist/lib/ui/ActionButton.js.map +1 -0
  194. package/dist/lib/ui/Alert.d.ts +8 -0
  195. package/dist/lib/ui/Alert.js +23 -0
  196. package/dist/lib/ui/Alert.js.map +1 -0
  197. package/dist/lib/ui/AlertDialog.d.ts +20 -0
  198. package/dist/lib/ui/AlertDialog.js +27 -0
  199. package/dist/lib/ui/AlertDialog.js.map +1 -0
  200. package/dist/lib/ui/AspectRatio.d.ts +3 -0
  201. package/dist/lib/ui/AspectRatio.js +4 -0
  202. package/dist/lib/ui/AspectRatio.js.map +1 -0
  203. package/dist/lib/ui/Badge.d.ts +9 -0
  204. package/dist/lib/ui/Badge.js +21 -0
  205. package/dist/lib/ui/Badge.js.map +1 -0
  206. package/dist/lib/ui/Breadcrumb.d.ts +19 -0
  207. package/dist/lib/ui/Breadcrumb.js +24 -0
  208. package/dist/lib/ui/Breadcrumb.js.map +1 -0
  209. package/dist/lib/ui/Button.d.ts +2 -3
  210. package/dist/lib/ui/Button.js +1 -1
  211. package/dist/lib/ui/Button.js.map +1 -1
  212. package/dist/lib/ui/Carousel.d.ts +18 -0
  213. package/dist/lib/ui/Carousel.js +99 -0
  214. package/dist/lib/ui/Carousel.js.map +1 -0
  215. package/dist/lib/ui/Checkbox.d.ts +4 -0
  216. package/dist/lib/ui/Checkbox.js +9 -0
  217. package/dist/lib/ui/Checkbox.js.map +1 -0
  218. package/dist/lib/ui/Collapsible.d.ts +5 -0
  219. package/dist/lib/ui/Collapsible.js +6 -0
  220. package/dist/lib/ui/Collapsible.js.map +1 -0
  221. package/dist/lib/ui/Command.d.ts +80 -0
  222. package/dist/lib/ui/Command.js +31 -0
  223. package/dist/lib/ui/Command.js.map +1 -0
  224. package/dist/lib/{components → ui}/Dialog.js +2 -2
  225. package/dist/lib/ui/Dialog.js.map +1 -0
  226. package/dist/lib/ui/Form.d.ts +23 -0
  227. package/dist/lib/ui/Form.js +63 -0
  228. package/dist/lib/ui/Form.js.map +1 -0
  229. package/dist/lib/ui/HoverCard.d.ts +6 -0
  230. package/dist/lib/ui/HoverCard.js +10 -0
  231. package/dist/lib/ui/HoverCard.js.map +1 -0
  232. package/dist/lib/ui/Label.d.ts +5 -0
  233. package/dist/lib/ui/Label.js +10 -0
  234. package/dist/lib/ui/Label.js.map +1 -0
  235. package/dist/lib/ui/Pagination.d.ts +28 -0
  236. package/dist/lib/ui/Pagination.js +24 -0
  237. package/dist/lib/ui/Pagination.js.map +1 -0
  238. package/dist/lib/ui/Popover.d.ts +6 -0
  239. package/dist/lib/ui/Popover.js +10 -0
  240. package/dist/lib/ui/Popover.js.map +1 -0
  241. package/dist/lib/ui/Progress.d.ts +4 -0
  242. package/dist/lib/ui/Progress.js +8 -0
  243. package/dist/lib/ui/Progress.js.map +1 -0
  244. package/dist/lib/ui/RadioGroup.d.ts +5 -0
  245. package/dist/lib/ui/RadioGroup.js +15 -0
  246. package/dist/lib/ui/RadioGroup.js.map +1 -0
  247. package/dist/lib/ui/ScrollArea.d.ts +5 -0
  248. package/dist/lib/ui/ScrollArea.js +12 -0
  249. package/dist/lib/ui/ScrollArea.js.map +1 -0
  250. package/dist/lib/ui/Select.js.map +1 -0
  251. package/dist/lib/ui/Skeleton.d.ts +2 -0
  252. package/dist/lib/ui/Skeleton.js +7 -0
  253. package/dist/lib/ui/Skeleton.js.map +1 -0
  254. package/dist/lib/ui/Slider.d.ts +4 -0
  255. package/dist/lib/ui/Slider.js +8 -0
  256. package/dist/lib/ui/Slider.js.map +1 -0
  257. package/dist/lib/ui/Switch.d.ts +4 -0
  258. package/dist/lib/ui/Switch.js +8 -0
  259. package/dist/lib/ui/Switch.js.map +1 -0
  260. package/dist/lib/ui/Textarea.d.ts +4 -0
  261. package/dist/lib/ui/Textarea.js +9 -0
  262. package/dist/lib/ui/Textarea.js.map +1 -0
  263. package/dist/lib/ui/Toggle.d.ts +12 -0
  264. package/dist/lib/ui/Toggle.js +26 -0
  265. package/dist/lib/ui/Toggle.js.map +1 -0
  266. package/dist/lib/ui/ToggleGroup.d.ts +12 -0
  267. package/dist/lib/ui/ToggleGroup.js +21 -0
  268. package/dist/lib/ui/ToggleGroup.js.map +1 -0
  269. package/dist/lib/ui/Tooltip.d.ts +7 -0
  270. package/dist/lib/ui/Tooltip.js +11 -0
  271. package/dist/lib/ui/Tooltip.js.map +1 -0
  272. package/dist/lib/util/MdxComponents.d.ts +1 -1
  273. package/dist/lib/util/MdxComponents.js.map +1 -1
  274. package/dist/lib/util/invariant.d.ts +9 -0
  275. package/dist/lib/util/invariant.js +7 -3
  276. package/dist/lib/util/invariant.js.map +1 -1
  277. package/dist/lib/util/useExposedProps.d.ts +2 -0
  278. package/dist/lib/util/useExposedProps.js +9 -0
  279. package/dist/lib/util/useExposedProps.js.map +1 -0
  280. package/dist/lib/util/useIsomorphicLayoutEffect.d.ts +3 -0
  281. package/dist/lib/util/useIsomorphicLayoutEffect.js +4 -0
  282. package/dist/lib/util/useIsomorphicLayoutEffect.js.map +1 -0
  283. package/dist/lib/util/useOnScreen.d.ts +4 -0
  284. package/dist/lib/util/useOnScreen.js +19 -0
  285. package/dist/lib/util/useOnScreen.js.map +1 -0
  286. package/dist/vite/build.js +5 -1
  287. package/dist/vite/build.js.map +1 -1
  288. package/dist/vite/config.d.ts +2 -8
  289. package/dist/vite/config.js +23 -59
  290. package/dist/vite/config.js.map +1 -1
  291. package/dist/vite/dev-server.js +1 -1
  292. package/dist/vite/dev-server.js.map +1 -1
  293. package/dist/vite/html.js +0 -2
  294. package/dist/vite/html.js.map +1 -1
  295. package/dist/vite/output.d.ts +101 -0
  296. package/dist/vite/output.js +33 -0
  297. package/dist/vite/output.js.map +1 -0
  298. package/dist/vite/plugin-component.js +17 -7
  299. package/dist/vite/plugin-component.js.map +1 -1
  300. package/dist/vite/plugin-config-reload.js +0 -2
  301. package/dist/vite/plugin-config-reload.js.map +1 -1
  302. package/dist/vite/plugin-config.d.ts +2 -3
  303. package/dist/vite/plugin-config.js +2 -3
  304. package/dist/vite/plugin-config.js.map +1 -1
  305. package/dist/vite/plugin-docs.js +13 -2
  306. package/dist/vite/plugin-docs.js.map +1 -1
  307. package/dist/vite/plugin-frontmatter.d.ts +2 -1
  308. package/dist/vite/plugin-frontmatter.js +27 -24
  309. package/dist/vite/plugin-frontmatter.js.map +1 -1
  310. package/dist/vite/plugin-mdx.d.ts +0 -6
  311. package/dist/vite/plugin-mdx.js +20 -2
  312. package/dist/vite/plugin-mdx.js.map +1 -1
  313. package/dist/vite/plugin-search.d.ts +3 -0
  314. package/dist/vite/plugin-search.js +26 -0
  315. package/dist/vite/plugin-search.js.map +1 -0
  316. package/dist/vite/plugin-sidebar.js +4 -6
  317. package/dist/vite/plugin-sidebar.js.map +1 -1
  318. package/dist/vite/plugin.js +4 -4
  319. package/dist/vite/plugin.js.map +1 -1
  320. package/dist/vite/prerender.js +3 -2
  321. package/dist/vite/prerender.js.map +1 -1
  322. package/dist/vite/remarkStaticGeneration.d.ts +3 -0
  323. package/dist/vite/remarkStaticGeneration.js +125 -0
  324. package/dist/vite/remarkStaticGeneration.js.map +1 -0
  325. package/lib/{AnchorLink-DovtSBJk.js → AnchorLink-CDlhr8gL.js} +12 -11
  326. package/lib/{AnchorLink-DovtSBJk.js.map → AnchorLink-CDlhr8gL.js.map} +1 -1
  327. package/lib/{AuthenticationPlugin-Cnqy9csQ.js → AuthenticationPlugin-DeGDVa1r.js} +6 -5
  328. package/lib/{AuthenticationPlugin-Cnqy9csQ.js.map → AuthenticationPlugin-DeGDVa1r.js.map} +1 -1
  329. package/lib/Button-jK0EsymC.js +48 -0
  330. package/lib/Button-jK0EsymC.js.map +1 -0
  331. package/lib/{CategoryHeading-C7VfgpFZ.js → CategoryHeading-Bb9dqxD3.js} +4 -4
  332. package/lib/{CategoryHeading-C7VfgpFZ.js.map → CategoryHeading-Bb9dqxD3.js.map} +1 -1
  333. package/lib/ClientOnly-E7hGysn1.js +11 -0
  334. package/lib/ClientOnly-E7hGysn1.js.map +1 -0
  335. package/lib/Dialog-k70Qfukb.js +67 -0
  336. package/lib/Dialog-k70Qfukb.js.map +1 -0
  337. package/lib/Markdown-ievDDhFT.js +15192 -0
  338. package/lib/Markdown-ievDDhFT.js.map +1 -0
  339. package/lib/{MdxPage-C5I9c7R1.js → MdxPage-Bwn-VSsH.js} +17 -16
  340. package/lib/{MdxPage-C5I9c7R1.js.map → MdxPage-Bwn-VSsH.js.map} +1 -1
  341. package/lib/OperationList-BwBl1xrD.js +4691 -0
  342. package/lib/OperationList-BwBl1xrD.js.map +1 -0
  343. package/lib/Route-DlG_HTMu.js +11 -0
  344. package/lib/Route-DlG_HTMu.js.map +1 -0
  345. package/lib/Select-O9ZM3ZgX.js +223 -0
  346. package/lib/Select-O9ZM3ZgX.js.map +1 -0
  347. package/lib/SidebarBadge-DxFJcJ6V.js +51 -0
  348. package/lib/SidebarBadge-DxFJcJ6V.js.map +1 -0
  349. package/lib/SlotletProvider-DyomlzGx.js +252 -0
  350. package/lib/SlotletProvider-DyomlzGx.js.map +1 -0
  351. package/lib/SyntaxHighlight-DkLOsjHS.js +2983 -0
  352. package/lib/SyntaxHighlight-DkLOsjHS.js.map +1 -0
  353. package/lib/_commonjsHelpers-BkfeUUK-.js +29 -0
  354. package/lib/_commonjsHelpers-BkfeUUK-.js.map +1 -0
  355. package/lib/assets/{worker-DaFlmuyf.js → worker-CPsGZsve.js} +2590 -2500
  356. package/lib/assets/{worker-DaFlmuyf.js.map → worker-CPsGZsve.js.map} +1 -1
  357. package/lib/cn-BmFQLtkS.js +2279 -0
  358. package/lib/cn-BmFQLtkS.js.map +1 -0
  359. package/lib/context-D1nXWxm7.js +22 -0
  360. package/lib/context-D1nXWxm7.js.map +1 -0
  361. package/lib/createServer-DK-g7kbB.js +16089 -0
  362. package/lib/createServer-DK-g7kbB.js.map +1 -0
  363. package/lib/hook-hEqe7fPB.js +227 -0
  364. package/lib/hook-hEqe7fPB.js.map +1 -0
  365. package/lib/index-Bn6Lc9tq.js +9 -0
  366. package/lib/{index-DJqnphbT.js.map → index-Bn6Lc9tq.js.map} +1 -1
  367. package/lib/index-BuAyrJe3.js +46 -0
  368. package/lib/index-BuAyrJe3.js.map +1 -0
  369. package/lib/index-Czzd9rjU.js +899 -0
  370. package/lib/index-Czzd9rjU.js.map +1 -0
  371. package/lib/index-DNxQ_rCt.js +1273 -0
  372. package/lib/index-DNxQ_rCt.js.map +1 -0
  373. package/lib/{index-D06ATMgg.js → index-LNp6rxyU.js} +2 -2
  374. package/lib/{index-D06ATMgg.js.map → index-LNp6rxyU.js.map} +1 -1
  375. package/lib/index-Yn8c3UWE.js +921 -0
  376. package/lib/index-Yn8c3UWE.js.map +1 -0
  377. package/lib/index.esm-C5mr_sKO.js +1193 -0
  378. package/lib/index.esm-C5mr_sKO.js.map +1 -0
  379. package/lib/invariant-Caa8-XvF.js +26 -0
  380. package/lib/invariant-Caa8-XvF.js.map +1 -0
  381. package/lib/{router-Oe6YmY6B.js → router-lfyopgBI.js} +23 -23
  382. package/lib/{router-Oe6YmY6B.js.map → router-lfyopgBI.js.map} +1 -1
  383. package/lib/state-tsXBLONe.js +203 -0
  384. package/lib/{state-CsuHT8ZO.js.map → state-tsXBLONe.js.map} +1 -1
  385. package/lib/ui/Accordion.js +47 -0
  386. package/lib/ui/Accordion.js.map +1 -0
  387. package/lib/ui/ActionButton.js +25 -0
  388. package/lib/ui/ActionButton.js.map +1 -0
  389. package/lib/ui/Alert.js +51 -0
  390. package/lib/ui/Alert.js.map +1 -0
  391. package/lib/ui/AlertDialog.js +114 -0
  392. package/lib/ui/AlertDialog.js.map +1 -0
  393. package/lib/ui/AspectRatio.js +6 -0
  394. package/lib/ui/AspectRatio.js.map +1 -0
  395. package/lib/ui/Badge.js +27 -0
  396. package/lib/ui/Badge.js.map +1 -0
  397. package/lib/ui/Breadcrumb.js +94 -0
  398. package/lib/ui/Breadcrumb.js.map +1 -0
  399. package/lib/ui/Button.js +49 -0
  400. package/lib/ui/Button.js.map +1 -0
  401. package/lib/ui/Callout.js +77 -0
  402. package/lib/ui/Callout.js.map +1 -0
  403. package/lib/ui/Card.js +62 -0
  404. package/lib/ui/Card.js.map +1 -0
  405. package/lib/ui/Carousel.js +1410 -0
  406. package/lib/ui/Carousel.js.map +1 -0
  407. package/lib/ui/Checkbox.js +28 -0
  408. package/lib/ui/Checkbox.js.map +1 -0
  409. package/lib/ui/Collapsible.js +8 -0
  410. package/lib/ui/Collapsible.js.map +1 -0
  411. package/lib/ui/Command.js +550 -0
  412. package/lib/ui/Command.js.map +1 -0
  413. package/lib/ui/Dialog.js +101 -0
  414. package/lib/ui/Dialog.js.map +1 -0
  415. package/lib/ui/Drawer.js +1153 -0
  416. package/lib/ui/Drawer.js.map +1 -0
  417. package/lib/ui/DropdownMenu.js +145 -0
  418. package/lib/ui/DropdownMenu.js.map +1 -0
  419. package/lib/ui/Form.js +95 -0
  420. package/lib/ui/Form.js.map +1 -0
  421. package/lib/ui/HoverCard.js +24 -0
  422. package/lib/ui/HoverCard.js.map +1 -0
  423. package/lib/ui/Input.js +22 -0
  424. package/lib/ui/Input.js.map +1 -0
  425. package/lib/ui/Label.js +20 -0
  426. package/lib/ui/Label.js.map +1 -0
  427. package/lib/ui/Pagination.js +106 -0
  428. package/lib/ui/Pagination.js.map +1 -0
  429. package/lib/ui/Popover.js +24 -0
  430. package/lib/ui/Popover.js.map +1 -0
  431. package/lib/ui/Progress.js +27 -0
  432. package/lib/ui/Progress.js.map +1 -0
  433. package/lib/ui/RadioGroup.js +32 -0
  434. package/lib/ui/RadioGroup.js.map +1 -0
  435. package/lib/ui/ScrollArea.js +39 -0
  436. package/lib/ui/ScrollArea.js.map +1 -0
  437. package/lib/ui/Select.js +122 -0
  438. package/lib/ui/Select.js.map +1 -0
  439. package/lib/ui/Skeleton.js +18 -0
  440. package/lib/ui/Skeleton.js.map +1 -0
  441. package/lib/ui/Slider.js +24 -0
  442. package/lib/ui/Slider.js.map +1 -0
  443. package/lib/ui/Switch.js +28 -0
  444. package/lib/ui/Switch.js.map +1 -0
  445. package/lib/ui/Tabs.js +47 -0
  446. package/lib/ui/Tabs.js.map +1 -0
  447. package/lib/ui/Textarea.js +21 -0
  448. package/lib/ui/Textarea.js.map +1 -0
  449. package/lib/ui/Toggle.js +38 -0
  450. package/lib/ui/Toggle.js.map +1 -0
  451. package/lib/ui/ToggleGroup.js +42 -0
  452. package/lib/ui/ToggleGroup.js.map +1 -0
  453. package/lib/ui/Tooltip.js +24 -0
  454. package/lib/ui/Tooltip.js.map +1 -0
  455. package/lib/useExposedProps-CTPtylCV.js +10 -0
  456. package/lib/useExposedProps-CTPtylCV.js.map +1 -0
  457. package/lib/{ZudokuContext-DSipF8sq.js → utils-DcpDOncX.js} +244 -248
  458. package/lib/utils-DcpDOncX.js.map +1 -0
  459. package/lib/zudoku.auth-auth0.js +24 -18
  460. package/lib/zudoku.auth-auth0.js.map +1 -1
  461. package/lib/zudoku.auth-clerk.js +2 -2
  462. package/lib/zudoku.auth-openid.js +506 -526
  463. package/lib/zudoku.auth-openid.js.map +1 -1
  464. package/lib/zudoku.components.js +1152 -3009
  465. package/lib/zudoku.components.js.map +1 -1
  466. package/lib/zudoku.openapi-worker.js +10 -16250
  467. package/lib/zudoku.openapi-worker.js.map +1 -1
  468. package/lib/zudoku.plugin-api-keys.js +68 -75
  469. package/lib/zudoku.plugin-api-keys.js.map +1 -1
  470. package/lib/zudoku.plugin-custom-pages.js +17 -8
  471. package/lib/zudoku.plugin-custom-pages.js.map +1 -1
  472. package/lib/zudoku.plugin-markdown.js +1 -1
  473. package/lib/zudoku.plugin-markdown.js.map +1 -1
  474. package/lib/zudoku.plugin-openapi.js +6 -10
  475. package/lib/zudoku.plugin-openapi.js.map +1 -1
  476. package/lib/zudoku.plugin-redirect.js +2 -2
  477. package/lib/zudoku.plugin-redirect.js.map +1 -1
  478. package/lib/zudoku.plugin-search-inkeep.js +9 -13
  479. package/lib/zudoku.plugin-search-inkeep.js.map +1 -1
  480. package/package.json +43 -11
  481. package/src/app/demo.tsx +0 -3
  482. package/src/app/entry.client.tsx +14 -0
  483. package/src/app/entry.server.tsx +59 -53
  484. package/src/app/main.css +1 -2
  485. package/src/app/main.tsx +7 -9
  486. package/src/app/standalone.tsx +0 -3
  487. package/src/lib/authentication/authentication.ts +2 -2
  488. package/src/lib/authentication/components/CallbackHandler.tsx +20 -51
  489. package/src/lib/authentication/hook.ts +1 -3
  490. package/src/lib/authentication/providers/auth0.tsx +17 -11
  491. package/src/lib/authentication/providers/openid.tsx +12 -30
  492. package/src/lib/authentication/state.ts +50 -9
  493. package/{LICENSE.md → src/lib/authentication/use-broadcast/LICENSE.md} +2 -2
  494. package/src/lib/authentication/use-broadcast/shared.ts +372 -0
  495. package/src/lib/authentication/use-broadcast/useBroadcast.ts +146 -0
  496. package/src/lib/components/Bootstrap.tsx +36 -9
  497. package/src/lib/components/ClientOnly.tsx +6 -3
  498. package/src/lib/components/DeveloperHint.tsx +6 -1
  499. package/src/lib/components/Header.tsx +44 -42
  500. package/src/lib/components/Layout.tsx +43 -36
  501. package/src/lib/components/MobileTopNavigation.tsx +23 -20
  502. package/src/lib/components/Search.tsx +1 -1
  503. package/src/lib/components/SlotletProvider.tsx +16 -7
  504. package/src/lib/components/SyntaxHighlight.tsx +85 -46
  505. package/src/lib/components/ThemeSwitch.tsx +26 -0
  506. package/src/lib/components/TopNavigation.tsx +39 -18
  507. package/src/lib/components/Zudoku.tsx +108 -0
  508. package/src/lib/components/context/ZudokuContext.ts +11 -16
  509. package/src/lib/components/context/ZudokuProvider.tsx +2 -2
  510. package/src/lib/components/index.ts +14 -6
  511. package/src/lib/components/navigation/Sidebar.tsx +4 -4
  512. package/src/lib/components/navigation/SidebarCategory.tsx +34 -26
  513. package/src/lib/components/navigation/SidebarItem.tsx +16 -17
  514. package/src/lib/components/navigation/utils.ts +2 -2
  515. package/src/lib/core/{DevPortalContext.ts → ZudokuContext.ts} +3 -11
  516. package/src/lib/core/plugins.ts +12 -16
  517. package/src/lib/errors/ErrorAlert.tsx +20 -6
  518. package/src/lib/oas/graphql/index.ts +4 -4
  519. package/src/lib/oas/parser/upgrade/index.ts +3 -1
  520. package/src/lib/plugins/api-keys/CreateApiKey.tsx +2 -2
  521. package/src/lib/plugins/api-keys/index.tsx +9 -9
  522. package/src/lib/plugins/custom-pages/CustomPage.tsx +18 -0
  523. package/src/lib/plugins/custom-pages/index.tsx +13 -11
  524. package/src/lib/plugins/markdown/MdxPage.tsx +10 -8
  525. package/src/lib/plugins/markdown/index.tsx +2 -2
  526. package/src/lib/plugins/openapi/CollapsibleCode.tsx +80 -0
  527. package/src/lib/plugins/openapi/ColorizedParam.tsx +23 -14
  528. package/src/lib/plugins/openapi/Endpoint.tsx +5 -10
  529. package/src/lib/plugins/openapi/OperationList.tsx +20 -40
  530. package/src/lib/plugins/openapi/ParameterListItem.tsx +37 -31
  531. package/src/lib/plugins/openapi/RequestBodySidecarBox.tsx +18 -13
  532. package/src/lib/plugins/openapi/ResponsesSidecarBox.tsx +17 -12
  533. package/src/lib/plugins/openapi/Route.tsx +11 -12
  534. package/src/lib/plugins/openapi/Sidecar.tsx +73 -59
  535. package/src/lib/plugins/openapi/client/GraphQLClient.tsx +140 -0
  536. package/src/lib/plugins/openapi/client/GraphQLContext.tsx +16 -0
  537. package/src/lib/plugins/openapi/client/createServer.ts +2 -0
  538. package/src/lib/plugins/openapi/client/useCreateQuery.ts +18 -0
  539. package/src/lib/plugins/openapi/client/worker.ts +38 -24
  540. package/src/lib/plugins/openapi/graphql/fragment-masking.ts +11 -18
  541. package/src/lib/plugins/openapi/graphql/gql.ts +10 -27
  542. package/src/lib/plugins/openapi/graphql/graphql.ts +233 -665
  543. package/src/lib/plugins/openapi/index.tsx +42 -67
  544. package/src/lib/plugins/openapi/playground/Playground.tsx +4 -3
  545. package/src/lib/plugins/openapi/playground/PlaygroundDialog.tsx +1 -1
  546. package/src/lib/plugins/openapi/schema/SchemaView.tsx +5 -2
  547. package/src/lib/plugins/openapi/util/generateSchemaExample.ts +28 -42
  548. package/src/lib/plugins/openapi-worker.ts +11 -1
  549. package/src/lib/plugins/redirect/index.tsx +5 -9
  550. package/src/lib/plugins/search-inkeep/index.tsx +2 -2
  551. package/src/lib/ui/Accordion.tsx +56 -0
  552. package/src/lib/ui/ActionButton.tsx +28 -0
  553. package/src/lib/ui/{Note.tsx → Alert.tsx} +11 -10
  554. package/src/lib/ui/AlertDialog.tsx +139 -0
  555. package/src/lib/ui/AspectRatio.tsx +5 -0
  556. package/src/lib/ui/Badge.tsx +36 -0
  557. package/src/lib/ui/Breadcrumb.tsx +115 -0
  558. package/src/lib/ui/Button.tsx +1 -1
  559. package/src/lib/ui/Carousel.tsx +260 -0
  560. package/src/lib/ui/Checkbox.tsx +28 -0
  561. package/src/lib/ui/Collapsible.tsx +9 -0
  562. package/src/lib/ui/Command.tsx +151 -0
  563. package/src/lib/{components → ui}/Dialog.tsx +4 -3
  564. package/src/lib/ui/Form.tsx +177 -0
  565. package/src/lib/ui/HoverCard.tsx +27 -0
  566. package/src/lib/ui/Label.tsx +24 -0
  567. package/src/lib/ui/Pagination.tsx +117 -0
  568. package/src/lib/ui/Popover.tsx +29 -0
  569. package/src/lib/ui/Progress.tsx +26 -0
  570. package/src/lib/ui/RadioGroup.tsx +42 -0
  571. package/src/lib/ui/ScrollArea.tsx +46 -0
  572. package/src/lib/ui/Skeleton.tsx +15 -0
  573. package/src/lib/ui/Slider.tsx +26 -0
  574. package/src/lib/ui/Switch.tsx +27 -0
  575. package/src/lib/ui/Textarea.tsx +23 -0
  576. package/src/lib/ui/Toggle.tsx +43 -0
  577. package/src/lib/ui/ToggleGroup.tsx +59 -0
  578. package/src/lib/ui/Tooltip.tsx +28 -0
  579. package/src/lib/util/MdxComponents.tsx +0 -1
  580. package/src/lib/util/invariant.ts +15 -3
  581. package/src/lib/util/useExposedProps.tsx +16 -0
  582. package/src/lib/util/useIsomorphicLayoutEffect.ts +5 -0
  583. package/src/lib/util/useOnScreen.ts +32 -0
  584. package/dist/internal.d.ts +0 -1
  585. package/dist/internal.js +0 -2
  586. package/dist/internal.js.map +0 -1
  587. package/dist/lib/components/DevPortal.js.map +0 -1
  588. package/dist/lib/components/Dialog.js.map +0 -1
  589. package/dist/lib/components/Select.js.map +0 -1
  590. package/dist/lib/components/context/ThemeContext.d.ts +0 -2
  591. package/dist/lib/components/context/ThemeContext.js +0 -7
  592. package/dist/lib/components/context/ThemeContext.js.map +0 -1
  593. package/dist/lib/components/context/ThemeProvider.d.ts +0 -4
  594. package/dist/lib/components/context/ThemeProvider.js +0 -23
  595. package/dist/lib/components/context/ThemeProvider.js.map +0 -1
  596. package/dist/lib/core/DevPortalContext.js.map +0 -1
  597. package/dist/lib/plugins/openapi/client/createMemoryClient.d.ts +0 -12
  598. package/dist/lib/plugins/openapi/client/createMemoryClient.js +0 -46
  599. package/dist/lib/plugins/openapi/client/createMemoryClient.js.map +0 -1
  600. package/dist/lib/plugins/openapi/client/createWorkerClient.d.ts +0 -10
  601. package/dist/lib/plugins/openapi/client/createWorkerClient.js +0 -61
  602. package/dist/lib/plugins/openapi/client/createWorkerClient.js.map +0 -1
  603. package/dist/lib/plugins/openapi/client/interfaces.d.ts +0 -4
  604. package/dist/lib/plugins/openapi/client/interfaces.js +0 -2
  605. package/dist/lib/plugins/openapi/client/interfaces.js.map +0 -1
  606. package/dist/lib/themeToggle.d.ts +0 -1
  607. package/dist/lib/themeToggle.js +0 -7
  608. package/dist/lib/themeToggle.js.map +0 -1
  609. package/dist/lib/ui/Note.d.ts +0 -8
  610. package/dist/lib/ui/Note.js +0 -23
  611. package/dist/lib/ui/Note.js.map +0 -1
  612. package/dist/lib/util/createWaitForNotify.d.ts +0 -1
  613. package/dist/lib/util/createWaitForNotify.js +0 -15
  614. package/dist/lib/util/createWaitForNotify.js.map +0 -1
  615. package/dist/vite/plugin-html-transform.d.ts +0 -2
  616. package/dist/vite/plugin-html-transform.js +0 -15
  617. package/dist/vite/plugin-html-transform.js.map +0 -1
  618. package/lib/DeveloperHint-CNyuFROc.js +0 -16
  619. package/lib/DeveloperHint-CNyuFROc.js.map +0 -1
  620. package/lib/ErrorPage-CUz-Zzmx.js +0 -16
  621. package/lib/ErrorPage-CUz-Zzmx.js.map +0 -1
  622. package/lib/Input-x-t53FyR.js +0 -2229
  623. package/lib/Input-x-t53FyR.js.map +0 -1
  624. package/lib/Markdown-C-0TaxoY.js +0 -20441
  625. package/lib/Markdown-C-0TaxoY.js.map +0 -1
  626. package/lib/OperationList-qsBOguHS.js +0 -601
  627. package/lib/OperationList-qsBOguHS.js.map +0 -1
  628. package/lib/Route-DlKvXPAO.js +0 -13
  629. package/lib/Route-DlKvXPAO.js.map +0 -1
  630. package/lib/SidebarBadge-DaA0-bFW.js +0 -503
  631. package/lib/SidebarBadge-DaA0-bFW.js.map +0 -1
  632. package/lib/SlotletProvider-BGEs7yyu.js +0 -240
  633. package/lib/SlotletProvider-BGEs7yyu.js.map +0 -1
  634. package/lib/ZudokuContext-DSipF8sq.js.map +0 -1
  635. package/lib/index-BIl-R3aH.js +0 -5952
  636. package/lib/index-BIl-R3aH.js.map +0 -1
  637. package/lib/index-CKmSo0py.js +0 -124
  638. package/lib/index-CKmSo0py.js.map +0 -1
  639. package/lib/index-DJqnphbT.js +0 -35
  640. package/lib/index-Dssw7Gff.js +0 -2867
  641. package/lib/index-Dssw7Gff.js.map +0 -1
  642. package/lib/index-SrtqdZ3j.js +0 -1781
  643. package/lib/index-SrtqdZ3j.js.map +0 -1
  644. package/lib/state-CsuHT8ZO.js +0 -183
  645. package/lib/urql-core-KJnLL26g.js +0 -1455
  646. package/lib/urql-core-KJnLL26g.js.map +0 -1
  647. package/src/lib/components/DevPortal.tsx +0 -111
  648. package/src/lib/components/context/ThemeContext.tsx +0 -8
  649. package/src/lib/components/context/ThemeProvider.tsx +0 -27
  650. package/src/lib/plugins/openapi/client/createMemoryClient.ts +0 -51
  651. package/src/lib/plugins/openapi/client/createWorkerClient.ts +0 -75
  652. package/src/lib/plugins/openapi/client/interfaces.ts +0 -5
  653. package/src/lib/themeToggle.ts +0 -7
  654. package/src/lib/util/createWaitForNotify.ts +0 -18
  655. /package/dist/lib/{components → ui}/Dialog.d.ts +0 -0
  656. /package/dist/lib/{components → ui}/Select.d.ts +0 -0
  657. /package/dist/lib/{components → ui}/Select.js +0 -0
  658. /package/src/lib/{components → ui}/Select.tsx +0 -0
@@ -3,7 +3,6 @@ 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";
@@ -15,7 +14,8 @@ export const navigationListItem = cva(
15
14
  {
16
15
  variants: {
17
16
  isTopLevel: {
18
- true: "font-semibold",
17
+ true: "font-medium -mx-[--padding-nav-item]",
18
+ false: "-mr-[--padding-nav-item] ml-[--padding-nav-item]",
19
19
  },
20
20
  isActive: {
21
21
  true: "text-primary font-medium",
@@ -26,6 +26,9 @@ export const navigationListItem = cva(
26
26
  false: "",
27
27
  },
28
28
  },
29
+ defaultVariants: {
30
+ isActive: false,
31
+ },
29
32
  },
30
33
  );
31
34
 
@@ -56,7 +59,7 @@ export const SidebarItem = ({
56
59
  {item.icon && <item.icon size={16} className="align-[-0.125em]" />}
57
60
  {item.badge ? (
58
61
  <>
59
- <span className="truncate" title={item.label}>
62
+ <span className="truncate flex-1" title={item.label}>
60
63
  {item.label}
61
64
  </span>
62
65
  <SidebarBadge {...item.badge} />
@@ -71,13 +74,11 @@ export const SidebarItem = ({
71
74
  <AnchorLink
72
75
  to={{ hash: item.href, search: searchParams.toString() }}
73
76
  {...{ [DATA_ANCHOR_ATTR]: item.href.slice(1) }}
74
- className={cn(
75
- "flex gap-2.5 justify-between",
76
- level === 0 && "-mx-[--padding-nav-item]",
77
- navigationListItem({
78
- isActive: item.href.slice(1) === activeAnchor,
79
- }),
80
- )}
77
+ className={navigationListItem({
78
+ isActive: item.href.slice(1) === activeAnchor,
79
+ isTopLevel: level === 0,
80
+ className: item.badge?.placement !== "start" && "justify-between",
81
+ })}
81
82
  >
82
83
  {item.badge ? (
83
84
  <>
@@ -92,7 +93,9 @@ export const SidebarItem = ({
92
93
  </AnchorLink>
93
94
  ) : !item.href.startsWith("http") ? (
94
95
  <NavLink
95
- className={cn("flex gap-2.5 justify-between", navigationListItem())}
96
+ className={navigationListItem({
97
+ className: item.badge?.placement !== "start" && "justify-between",
98
+ })}
96
99
  to={item.href}
97
100
  >
98
101
  {item.badge ? (
@@ -108,10 +111,7 @@ export const SidebarItem = ({
108
111
  </NavLink>
109
112
  ) : (
110
113
  <a
111
- className={cn(
112
- navigationListItem({ isTopLevel: level === 0 }),
113
- "block",
114
- )}
114
+ className={navigationListItem({ isTopLevel: level === 0 })}
115
115
  href={item.href}
116
116
  target="_blank"
117
117
  rel="noopener noreferrer"
@@ -119,8 +119,7 @@ export const SidebarItem = ({
119
119
  <span className="whitespace-normal">{item.label}</span>
120
120
  {/* This prevents that the icon would be positioned in its own line if the text fills a line entirely */}
121
121
  <span className="whitespace-nowrap">
122
- &nbsp;
123
- <ExternalLinkIcon className="inline ml-1" size={12} />
122
+ <ExternalLinkIcon className="inline -translate-y-0.5" size={12} />
124
123
  </span>
125
124
  </a>
126
125
  );
@@ -44,7 +44,7 @@ export const useCurrentItem = () => {
44
44
  const location = useLocation();
45
45
  const nav = useCurrentNavigation();
46
46
 
47
- const currentSidebar = nav.data.sidebar;
47
+ const currentSidebar = nav.sidebar;
48
48
 
49
49
  return traverseSidebar(currentSidebar, (item) => {
50
50
  if (item.type === "doc" && joinPath(item.id) === location.pathname) {
@@ -79,7 +79,7 @@ export const usePrevNext = (): {
79
79
  } => {
80
80
  const currentId = useLocation().pathname;
81
81
  const nav = useCurrentNavigation();
82
- const currentSidebar = nav.data.sidebar;
82
+ const currentSidebar = nav.sidebar;
83
83
 
84
84
  let prev;
85
85
  let next;
@@ -1,4 +1,3 @@
1
- import { QueryClient } from "@tanstack/react-query";
2
1
  import { ReactNode } from "react";
3
2
  import type { SidebarConfig } from "../../config/validators/SidebarSchema.js";
4
3
  import { TopNavigationItem } from "../../config/validators/validate.js";
@@ -8,11 +7,11 @@ import { Slotlets } from "../components/SlotletProvider.js";
8
7
  import { joinPath } from "../util/joinPath.js";
9
8
  import type { MdxComponentsType } from "../util/MdxComponents.js";
10
9
  import {
11
- type DevPortalPlugin,
12
10
  isApiIdentityPlugin,
13
11
  isNavigationPlugin,
14
12
  type NavigationPlugin,
15
13
  needsInitialization,
14
+ type ZudokuPlugin,
16
15
  } from "./plugins.js";
17
16
 
18
17
  export interface ApiIdentity {
@@ -21,10 +20,7 @@ export interface ApiIdentity {
21
20
  id: string;
22
21
  }
23
22
 
24
- export const queryClient = new QueryClient();
25
-
26
23
  export type ApiKeyCache = "api-keys";
27
- export type DevPortalCacheKey = ApiKeyCache | string;
28
24
 
29
25
  type Metadata = Partial<{
30
26
  title: string;
@@ -63,7 +59,7 @@ export type ZudokuContextOptions = {
63
59
  authentication?: AuthenticationProvider;
64
60
  topNavigation?: TopNavigationItem[];
65
61
  sidebars?: SidebarConfig;
66
- plugins?: DevPortalPlugin[];
62
+ plugins?: ZudokuPlugin[];
67
63
  slotlets?: Slotlets;
68
64
  mdx?: {
69
65
  components?: MdxComponentsType;
@@ -71,7 +67,7 @@ export type ZudokuContextOptions = {
71
67
  overrides?: ComponentsContextType;
72
68
  };
73
69
 
74
- export class DevPortalContext {
70
+ export class ZudokuContext {
75
71
  public plugins: NonNullable<ZudokuContextOptions["plugins"]>;
76
72
  public sidebars: SidebarConfig;
77
73
  public topNavigation: NonNullable<ZudokuContextOptions["topNavigation"]>;
@@ -98,10 +94,6 @@ export class DevPortalContext {
98
94
  );
99
95
  };
100
96
 
101
- invalidateCache = async (key: DevPortalCacheKey[]) => {
102
- await queryClient.invalidateQueries({ queryKey: key });
103
- };
104
-
105
97
  getApiIdentities = async () => {
106
98
  const keys = await Promise.all(
107
99
  this.plugins
@@ -2,9 +2,9 @@ import { type ReactElement } from "react";
2
2
  import { type RouteObject } from "react-router-dom";
3
3
  import type { Sidebar } from "../../config/validators/SidebarSchema.js";
4
4
  import { MdxComponentsType } from "../util/MdxComponents.js";
5
- import { DevPortalContext, type ApiIdentity } from "./DevPortalContext.js";
5
+ import { ZudokuContext, type ApiIdentity } from "./ZudokuContext.js";
6
6
 
7
- export type DevPortalPlugin =
7
+ export type ZudokuPlugin =
8
8
  | CommonPlugin
9
9
  | ProfileMenuPlugin
10
10
  | NavigationPlugin
@@ -19,7 +19,7 @@ export interface NavigationPlugin {
19
19
  }
20
20
 
21
21
  export interface ApiIdentityPlugin {
22
- getIdentities: (context: DevPortalContext) => Promise<ApiIdentity[]>;
22
+ getIdentities: (context: ZudokuContext) => Promise<ApiIdentity[]>;
23
23
  }
24
24
 
25
25
  export interface SearchProviderPlugin {
@@ -30,7 +30,7 @@ export interface SearchProviderPlugin {
30
30
  }
31
31
 
32
32
  export interface ProfileMenuPlugin {
33
- getProfileMenuItems: (context: DevPortalContext) => ProfileNavigationItem[];
33
+ getProfileMenuItems: (context: ZudokuContext) => ProfileNavigationItem[];
34
34
  }
35
35
 
36
36
  export type ProfileNavigationItem = {
@@ -41,41 +41,37 @@ export type ProfileNavigationItem = {
41
41
 
42
42
  export interface CommonPlugin {
43
43
  initialize?: (
44
- context: DevPortalContext,
44
+ context: ZudokuContext,
45
45
  ) => Promise<void | boolean> | void | boolean;
46
46
  getHead?: () => ReactElement | undefined;
47
47
  getMdxComponents?: () => MdxComponentsType;
48
48
  }
49
49
 
50
50
  export const isProfileMenuPlugin = (
51
- obj: DevPortalPlugin,
51
+ obj: ZudokuPlugin,
52
52
  ): obj is ProfileMenuPlugin =>
53
53
  "getProfileMenuItems" in obj && typeof obj.getProfileMenuItems === "function";
54
54
 
55
55
  export const isNavigationPlugin = (
56
- obj: DevPortalPlugin,
56
+ obj: ZudokuPlugin,
57
57
  ): obj is NavigationPlugin =>
58
58
  "getRoutes" in obj && typeof obj.getRoutes === "function";
59
59
 
60
60
  export const isSearchPlugin = (
61
- obj: DevPortalPlugin,
61
+ obj: ZudokuPlugin,
62
62
  ): obj is SearchProviderPlugin =>
63
63
  "renderSearch" in obj && typeof obj.renderSearch === "function";
64
64
 
65
- export const needsInitialization = (
66
- obj: DevPortalPlugin,
67
- ): obj is CommonPlugin =>
65
+ export const needsInitialization = (obj: ZudokuPlugin): obj is CommonPlugin =>
68
66
  "initialize" in obj && typeof obj.initialize === "function";
69
67
 
70
- export const hasHead = (obj: DevPortalPlugin): obj is CommonPlugin =>
68
+ export const hasHead = (obj: ZudokuPlugin): obj is CommonPlugin =>
71
69
  "getHead" in obj && typeof obj.getHead === "function";
72
70
 
73
- export const isMdxProviderPlugin = (
74
- obj: DevPortalPlugin,
75
- ): obj is CommonPlugin =>
71
+ export const isMdxProviderPlugin = (obj: ZudokuPlugin): obj is CommonPlugin =>
76
72
  "getMdxComponents" in obj && typeof obj.getMdxComponents === "function";
77
73
 
78
74
  export const isApiIdentityPlugin = (
79
- obj: DevPortalPlugin,
75
+ obj: ZudokuPlugin,
80
76
  ): obj is ApiIdentityPlugin =>
81
77
  "getIdentities" in obj && typeof obj.getIdentities === "function";
@@ -1,16 +1,30 @@
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
+
9
+ const hint = error instanceof ZudokuError ? error.developerHint : undefined;
10
+ const title =
11
+ error instanceof ZudokuError ? error.title : "Something went wrong";
12
+ const stack = error instanceof Error ? error.stack : undefined;
13
+ const cause = error instanceof Error ? error.cause : undefined;
5
14
 
6
15
  return (
7
- <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">
16
+ <div className="flex h-screen max-h-[calc(100vh-var(--header-height))] min-h-full items-center justify-center bg-primary-background px-4 py-16 lg:px-8">
8
17
  <div className="mx-auto max-w-[85%] sm:max-w-[50%]">
9
18
  <h1 className="text-4xl font-bold tracking-tight text-h1-text sm:text-5xl">
10
- Something went wrong
19
+ {title}
11
20
  </h1>
12
21
  <p className="mt-5 text-h1-text">{message}</p>
13
- {stack ? (
22
+ {hint && <DeveloperHint className="mb-4">{hint}</DeveloperHint>}
23
+ {cause instanceof Error ? (
24
+ <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">
25
+ {cause.stack}
26
+ </pre>
27
+ ) : stack ? (
14
28
  <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
29
  {stack}
16
30
  </pre>
@@ -206,7 +206,7 @@ const ExampleItem = builder
206
206
  name: t.exposeString("name"),
207
207
  summary: t.exposeString("summary", { nullable: true }),
208
208
  description: t.exposeString("description", { nullable: true }),
209
- value: t.exposeString("value", { nullable: true }),
209
+ value: t.expose("value", { type: JSONScalar, nullable: true }),
210
210
  externalValue: t.exposeString("externalValue", { nullable: true }),
211
211
  }),
212
212
  });
@@ -348,10 +348,10 @@ const OperationItem = builder
348
348
  statusCode,
349
349
  description: response.description,
350
350
  content: Object.entries(response.content ?? {}).map(
351
- ([mediaType, mediaTypeObject]) => ({
351
+ ([mediaType, { schema, examples }]) => ({
352
352
  mediaType,
353
- schema: mediaTypeObject.schema,
354
- examples: Object.entries(mediaTypeObject.examples ?? {}).map(
353
+ schema,
354
+ examples: Object.entries(examples ?? {}).map(
355
355
  ([name, value]) => ({ name, ...value }),
356
356
  ),
357
357
  }),
@@ -64,7 +64,9 @@ export const upgradeSchema = (schema: Record<string, any>): OpenAPIDocument => {
64
64
  schema = traverse(schema, (sub) => {
65
65
  if (sub.example !== undefined) {
66
66
  sub.examples = {
67
- default: sub.example,
67
+ default: {
68
+ value: sub.example,
69
+ },
68
70
  };
69
71
  delete sub.example;
70
72
  }
@@ -1,7 +1,6 @@
1
1
  import { useMutation } from "@tanstack/react-query";
2
2
  import { useForm } from "react-hook-form";
3
3
  import { Link, useNavigate } from "react-router-dom";
4
- import { useZudoku } from "../../components/context/ZudokuContext.js";
5
4
  import {
6
5
  Select,
7
6
  SelectContent,
@@ -9,7 +8,8 @@ import {
9
8
  SelectItem,
10
9
  SelectTrigger,
11
10
  SelectValue,
12
- } from "../../components/Select.js";
11
+ } from "zudoku/ui/Select.js";
12
+ import { useZudoku } from "../../components/context/ZudokuContext.js";
13
13
  import { Button } from "../../ui/Button.js";
14
14
  import { Input } from "../../ui/Input.js";
15
15
  import { ApiKeyService } from "./index.js";
@@ -1,8 +1,8 @@
1
1
  import { type RouteObject } from "react-router-dom";
2
- import { DevPortalContext } from "../../core/DevPortalContext.js";
2
+ import { ZudokuContext } from "../../core/ZudokuContext.js";
3
3
  import {
4
4
  type ApiIdentityPlugin,
5
- type DevPortalPlugin,
5
+ type ZudokuPlugin,
6
6
  ProfileMenuPlugin,
7
7
  } from "../../core/plugins.js";
8
8
  import { RouterError } from "../../errors/RouterError.js";
@@ -15,17 +15,17 @@ const DEFAULT_API_KEY_ENDPOINT =
15
15
  "https://zudoku-rewiringamerica-main-ef9c9c0.d2.zuplo.dev";
16
16
 
17
17
  export type ApiKeyService = {
18
- getKeys: (context: DevPortalContext) => Promise<ApiKey[]>;
19
- rollKey?: (id: string, context: DevPortalContext) => Promise<void>;
20
- deleteKey?: (id: string, context: DevPortalContext) => Promise<void>;
18
+ getKeys: (context: ZudokuContext) => Promise<ApiKey[]>;
19
+ rollKey?: (id: string, context: ZudokuContext) => Promise<void>;
20
+ deleteKey?: (id: string, context: ZudokuContext) => Promise<void>;
21
21
  updateKeyDescription?: (
22
22
  apiKey: { id: string; description: string },
23
- context: DevPortalContext,
23
+ context: ZudokuContext,
24
24
  ) => Promise<void>;
25
- getUsage?: (apiKeys: string[], context: DevPortalContext) => Promise<void>;
25
+ getUsage?: (apiKeys: string[], context: ZudokuContext) => Promise<void>;
26
26
  createKey?: (
27
27
  apiKey: { description: string; expiresOn?: string },
28
- context: DevPortalContext,
28
+ context: ZudokuContext,
29
29
  ) => Promise<void>;
30
30
  };
31
31
 
@@ -93,7 +93,7 @@ const createDefaultHandler = (endpoint: string): ApiKeyService => {
93
93
 
94
94
  export const apiKeyPlugin = (
95
95
  options: ApiKeyPluginOptions,
96
- ): DevPortalPlugin & ApiIdentityPlugin & ProfileMenuPlugin => {
96
+ ): ZudokuPlugin & ApiIdentityPlugin & ProfileMenuPlugin => {
97
97
  const endpoint =
98
98
  "endpoint" in options ? options.endpoint : DEFAULT_API_KEY_ENDPOINT;
99
99
 
@@ -0,0 +1,18 @@
1
+ import React from "react";
2
+ import { ProseClasses } from "../../components/Markdown.js";
3
+ import { cn } from "../../util/cn.js";
4
+ import { useExposedProps } from "../../util/useExposedProps.js";
5
+ import type { CustomPageConfig } from "./index.js";
6
+
7
+ export const CustomPage = ({
8
+ element,
9
+ render,
10
+ prose = true,
11
+ }: Omit<CustomPageConfig, "path">) => {
12
+ const exposedProps = useExposedProps();
13
+ const content = render ? React.createElement(render, exposedProps) : element;
14
+
15
+ return (
16
+ <div className={cn(prose && ProseClasses, "max-w-full")}>{content}</div>
17
+ );
18
+ };
@@ -1,22 +1,24 @@
1
- import type { ReactNode } from "react";
1
+ import { type ComponentType, type ReactNode } from "react";
2
2
  import type { RouteObject } from "react-router-dom";
3
- import { ProseClasses } from "../../components/Markdown.js";
4
- import type { DevPortalPlugin, NavigationPlugin } from "../../core/plugins.js";
3
+ import { type ExposedComponentProps } from "../../components/SlotletProvider.js";
4
+ import type { NavigationPlugin, ZudokuPlugin } from "../../core/plugins.js";
5
+ import { CustomPage } from "./CustomPage.js";
5
6
 
6
- type CustomPagesConfig = Array<{
7
+ export type CustomPageConfig = {
7
8
  path: string;
8
- element: ReactNode;
9
- }>;
9
+ prose?: boolean;
10
+ element?: ReactNode;
11
+ render?: ComponentType<ExposedComponentProps>;
12
+ };
10
13
 
11
14
  export const customPagesPlugin = (
12
- config: CustomPagesConfig,
13
- ): DevPortalPlugin & NavigationPlugin => {
15
+ config: CustomPageConfig[],
16
+ ): ZudokuPlugin & NavigationPlugin => {
14
17
  return {
15
18
  getRoutes: (): RouteObject[] =>
16
- config.map(({ path, element }) => ({
19
+ config.map(({ path, ...props }) => ({
17
20
  path,
18
- // TODO: we should componentize prose pages
19
- element: <div className={ProseClasses + " max-w-full"}>{element}</div>,
21
+ element: <CustomPage {...props} />,
20
22
  })),
21
23
  };
22
24
  };
@@ -68,14 +68,16 @@ export const MdxPage = ({
68
68
  "max-w-full xl:w-full xl:max-w-prose flex-1 flex-shrink pt-[--padding-content-top] pb-[--padding-content-bottom]",
69
69
  )}
70
70
  >
71
- <header>
72
- {category && <CategoryHeading>{category}</CategoryHeading>}
73
- {title && (
74
- <Heading level={1} id={slugify(title)}>
75
- {title}
76
- </Heading>
77
- )}
78
- </header>
71
+ {(category || title) && (
72
+ <header>
73
+ {category && <CategoryHeading>{category}</CategoryHeading>}
74
+ {title && (
75
+ <Heading level={1} id={slugify(title)}>
76
+ {title}
77
+ </Heading>
78
+ )}
79
+ </header>
80
+ )}
79
81
  <MdxComponent
80
82
  components={{ ...useMDXComponents(), ...MarkdownHeadings }}
81
83
  />
@@ -2,7 +2,7 @@ import type { Toc } from "@stefanprobst/rehype-extract-toc";
2
2
  import type { MDXProps } from "mdx/types.js";
3
3
  import { RouteObject } from "react-router-dom";
4
4
  import { ZudokuDocsConfig } from "../../../config/validators/validate.js";
5
- import type { DevPortalPlugin } from "../../core/plugins.js";
5
+ import type { ZudokuPlugin } from "../../core/plugins.js";
6
6
  import { DocResolver } from "./resolver.js";
7
7
 
8
8
  export interface MarkdownPluginOptions extends ZudokuDocsConfig {
@@ -29,7 +29,7 @@ export type MDXImport = {
29
29
 
30
30
  export const markdownPlugin = (
31
31
  options: MarkdownPluginOptions[],
32
- ): DevPortalPlugin => ({
32
+ ): ZudokuPlugin => ({
33
33
  getRoutes: () => {
34
34
  const routeMap = new Map<string, RouteObject>();
35
35
  options.forEach(({ fileImports, files, defaultOptions }) =>
@@ -0,0 +1,80 @@
1
+ import { type CSSProperties, type ReactNode, useRef, useState } from "react";
2
+ import { Button } from "zudoku/ui/Button.js";
3
+ import {
4
+ Collapsible,
5
+ CollapsibleContent,
6
+ CollapsibleTrigger,
7
+ } from "zudoku/ui/Collapsible.js";
8
+ import { cn } from "../../util/cn.js";
9
+ import useIsomorphicLayoutEffect from "../../util/useIsomorphicLayoutEffect.js";
10
+
11
+ export const CollapsibleCode = ({
12
+ children,
13
+ maxHeight = 250,
14
+ }: {
15
+ children: ReactNode;
16
+ maxHeight?: number;
17
+ }) => {
18
+ const contentRef = useRef<HTMLDivElement | null>(null);
19
+ const [isOverflowing, setIsOverflowing] = useState(false);
20
+ const [open, setOpen] = useState(false);
21
+
22
+ useIsomorphicLayoutEffect(() => {
23
+ const el = contentRef.current;
24
+ if (!el) return;
25
+
26
+ setIsOverflowing(el.scrollHeight > maxHeight);
27
+
28
+ const observer = new ResizeObserver(() => {
29
+ setIsOverflowing(el.scrollHeight > maxHeight);
30
+ });
31
+ observer.observe(el);
32
+
33
+ return () => observer.disconnect();
34
+ }, [maxHeight]);
35
+
36
+ return (
37
+ <Collapsible
38
+ className="group"
39
+ open={open}
40
+ onOpenChange={setOpen}
41
+ style={{ "--max-height": `${maxHeight}px` } as CSSProperties}
42
+ >
43
+ <CollapsibleContent
44
+ forceMount
45
+ className={cn(
46
+ "relative overflow-hidden",
47
+ !open && isOverflowing && "max-h-[--max-height]",
48
+ )}
49
+ >
50
+ {!open && isOverflowing && (
51
+ <div className="absolute inset-0 bg-gradient-to-b from-transparent to-zinc-50/90 dark:to-zinc-800/90 z-10"></div>
52
+ )}
53
+ <div ref={contentRef}>{children}</div>
54
+ {!open && isOverflowing && (
55
+ <CollapsibleTrigger
56
+ className="absolute inset-0 grid place-items-center z-10"
57
+ asChild
58
+ >
59
+ <div>
60
+ <Button className="bg-primary/70 border border-accent-foreground/25">
61
+ Expand code
62
+ </Button>
63
+ </div>
64
+ </CollapsibleTrigger>
65
+ )}
66
+ </CollapsibleContent>
67
+ {isOverflowing && (
68
+ <div
69
+ className={cn("flex justify-center w-full mb-2", !open && "hidden")}
70
+ >
71
+ <CollapsibleTrigger asChild>
72
+ <Button className="border border-accent-foreground/25">
73
+ Collapse code
74
+ </Button>
75
+ </CollapsibleTrigger>
76
+ </div>
77
+ )}
78
+ </Collapsible>
79
+ );
80
+ };
@@ -1,15 +1,15 @@
1
- import { useEffect, useRef, type ReactNode } from "react";
2
- import { useTheme } from "../../components/context/ThemeContext.js";
1
+ import { useTheme } from "next-themes";
2
+ import { useEffect, useRef, type CSSProperties, type ReactNode } from "react";
3
3
  import { cn } from "../../util/cn.js";
4
4
  import { pastellize } from "../../util/pastellize.js";
5
5
 
6
6
  export const DATA_ATTR = "data-linked-param";
7
7
 
8
8
  export const usePastellizedColor = (name: string) => {
9
- const [isDark] = useTheme();
9
+ const { resolvedTheme } = useTheme();
10
10
  return pastellize(
11
11
  name,
12
- !isDark ? { saturation: 85, lightness: 50 } : undefined,
12
+ resolvedTheme === "light" ? { saturation: 85, lightness: 50 } : undefined,
13
13
  );
14
14
  };
15
15
 
@@ -61,27 +61,36 @@ export const ColorizedParam = ({
61
61
  });
62
62
  };
63
63
 
64
- ref.current.addEventListener("mouseenter", onMouseEnter);
65
- ref.current.addEventListener("mouseleave", onMouseLeave);
64
+ const el = ref.current;
65
+
66
+ el.addEventListener("mouseenter", onMouseEnter);
67
+ el.addEventListener("mouseleave", onMouseLeave);
66
68
 
67
69
  return () => {
68
- ref.current?.removeEventListener("mouseenter", onMouseEnter);
69
- ref.current?.removeEventListener("mouseleave", onMouseLeave);
70
+ el.removeEventListener("mouseenter", onMouseEnter);
71
+ el.removeEventListener("mouseleave", onMouseLeave);
70
72
  };
71
73
  }, [normalizedSlug]);
72
74
 
73
75
  return (
74
76
  <span
75
- className={cn("inline-flex relative rounded group", className)}
76
77
  {...{ [DATA_ATTR]: normalizedSlug }}
78
+ className={cn(
79
+ "relative after:rounded after:absolute after:inset-0 after:-bottom-0.5 after:border-b-2 after:transition-opacity after:duration-200",
80
+ "after:pointer-events-none after:border-[--border-color] after:opacity-30 after:data-[active=true]:opacity-100",
81
+ className,
82
+ )}
83
+ suppressHydrationWarning
77
84
  ref={ref}
78
85
  onClick={onClick}
86
+ style={
87
+ {
88
+ "--border-color": borderColor,
89
+ "--background-color": backgroundColor,
90
+ } as CSSProperties
91
+ }
79
92
  >
80
- <span
81
- className="absolute inset-0 border-b-2 transition-opacity duration-200 opacity-30 group-data-[active=true]:opacity-100"
82
- style={{ borderColor, backgroundColor }}
83
- />
84
- <span className="relative">{children ?? name}</span>
93
+ {children ?? name}
85
94
  </span>
86
95
  );
87
96
  };
@@ -1,9 +1,10 @@
1
+ import { useSuspenseQuery } from "@tanstack/react-query";
1
2
  import { CheckIcon, CopyIcon } from "lucide-react";
2
3
  import { useState, useTransition } from "react";
3
- import { useQuery } from "urql";
4
4
  import { useSelectedServerStore } from "../../authentication/state.js";
5
5
  import { InlineCode } from "../../components/InlineCode.js";
6
6
  import { Button } from "../../ui/Button.js";
7
+ import { useCreateQuery } from "./client/useCreateQuery.js";
7
8
  import { useOasConfig } from "./context.js";
8
9
  import { graphql } from "./graphql/index.js";
9
10
  import { SimpleSelect } from "./SimpleSelect.js";
@@ -42,19 +43,13 @@ const CopyButton = ({ url }: { url: string }) => {
42
43
  );
43
44
  };
44
45
 
45
- const context = { suspense: true } as const;
46
-
47
46
  export const Endpoint = () => {
48
- const [result] = useQuery({
49
- query: ServersQuery,
50
- variables: useOasConfig(),
51
- context,
52
- });
47
+ const { input, type } = useOasConfig();
48
+ const query = useCreateQuery(ServersQuery, { input, type });
49
+ const result = useSuspenseQuery(query);
53
50
  const [, startTransition] = useTransition();
54
51
  const { selectedServer, setSelectedServer } = useSelectedServerStore();
55
52
 
56
- if (!result.data) return null;
57
-
58
53
  const { servers } = result.data.schema;
59
54
 
60
55
  if (servers.length === 1) {