zudoku 0.16.3 → 0.18.0

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 (342) hide show
  1. package/dist/app/demo.js +0 -2
  2. package/dist/app/demo.js.map +1 -1
  3. package/dist/app/entry.client.js +14 -0
  4. package/dist/app/entry.client.js.map +1 -1
  5. package/dist/app/entry.server.js +5 -4
  6. package/dist/app/entry.server.js.map +1 -1
  7. package/dist/app/main.d.ts +1 -1
  8. package/dist/app/main.js +2 -2
  9. package/dist/app/main.js.map +1 -1
  10. package/dist/app/standalone.js +0 -2
  11. package/dist/app/standalone.js.map +1 -1
  12. package/dist/codegen.d.ts +3 -0
  13. package/dist/codegen.js +45 -0
  14. package/dist/codegen.js.map +1 -0
  15. package/dist/config/validators/InputSidebarSchema.d.ts +10 -10
  16. package/dist/config/validators/validate.d.ts +114 -114
  17. package/dist/config/validators/validate.js.map +1 -1
  18. package/dist/index.d.ts +2 -2
  19. package/dist/index.js +1 -1
  20. package/dist/index.js.map +1 -1
  21. package/dist/lib/authentication/authentication.d.ts +2 -2
  22. package/dist/lib/authentication/hook.d.ts +5 -4
  23. package/dist/lib/authentication/hook.js +1 -3
  24. package/dist/lib/authentication/hook.js.map +1 -1
  25. package/dist/lib/authentication/providers/auth0.js +11 -11
  26. package/dist/lib/authentication/providers/auth0.js.map +1 -1
  27. package/dist/lib/authentication/providers/openid.d.ts +0 -1
  28. package/dist/lib/authentication/providers/openid.js +11 -26
  29. package/dist/lib/authentication/providers/openid.js.map +1 -1
  30. package/dist/lib/authentication/state.d.ts +25 -4
  31. package/dist/lib/authentication/state.js +28 -3
  32. package/dist/lib/authentication/state.js.map +1 -1
  33. package/dist/lib/authentication/use-broadcast/shared.d.ts +48 -0
  34. package/dist/lib/authentication/use-broadcast/shared.js +243 -0
  35. package/dist/lib/authentication/use-broadcast/shared.js.map +1 -0
  36. package/dist/lib/authentication/use-broadcast/useBroadcast.d.ts +24 -0
  37. package/dist/lib/authentication/use-broadcast/useBroadcast.js +106 -0
  38. package/dist/lib/authentication/use-broadcast/useBroadcast.js.map +1 -0
  39. package/dist/lib/components/Bootstrap.d.ts +3 -1
  40. package/dist/lib/components/Bootstrap.js +11 -3
  41. package/dist/lib/components/Bootstrap.js.map +1 -1
  42. package/dist/lib/components/ClientOnly.d.ts +4 -2
  43. package/dist/lib/components/ClientOnly.js +1 -1
  44. package/dist/lib/components/ClientOnly.js.map +1 -1
  45. package/dist/lib/components/DeveloperHint.js +2 -1
  46. package/dist/lib/components/DeveloperHint.js.map +1 -1
  47. package/dist/lib/components/Header.js +5 -7
  48. package/dist/lib/components/Header.js.map +1 -1
  49. package/dist/lib/components/Heading.d.ts +1 -1
  50. package/dist/lib/components/Layout.js +11 -3
  51. package/dist/lib/components/Layout.js.map +1 -1
  52. package/dist/lib/components/MobileTopNavigation.js +6 -7
  53. package/dist/lib/components/MobileTopNavigation.js.map +1 -1
  54. package/dist/lib/components/SyntaxHighlight.js +16 -12
  55. package/dist/lib/components/SyntaxHighlight.js.map +1 -1
  56. package/dist/lib/components/ThemeSwitch.d.ts +1 -0
  57. package/dist/lib/components/ThemeSwitch.js +13 -0
  58. package/dist/lib/components/ThemeSwitch.js.map +1 -0
  59. package/dist/lib/components/TopNavigation.d.ts +2 -0
  60. package/dist/lib/components/TopNavigation.js +13 -7
  61. package/dist/lib/components/TopNavigation.js.map +1 -1
  62. package/dist/lib/components/{DevPortal.d.ts → Zudoku.d.ts} +3 -3
  63. package/dist/lib/components/{DevPortal.js → Zudoku.js} +13 -14
  64. package/dist/lib/components/Zudoku.js.map +1 -0
  65. package/dist/lib/components/context/ZudokuContext.d.ts +7 -7
  66. package/dist/lib/components/context/ZudokuContext.js +8 -13
  67. package/dist/lib/components/context/ZudokuContext.js.map +1 -1
  68. package/dist/lib/components/context/ZudokuProvider.d.ts +2 -2
  69. package/dist/lib/components/context/ZudokuProvider.js.map +1 -1
  70. package/dist/lib/components/index.d.ts +18 -10
  71. package/dist/lib/components/index.js +2 -3
  72. package/dist/lib/components/index.js.map +1 -1
  73. package/dist/lib/components/navigation/Sidebar.js +1 -1
  74. package/dist/lib/components/navigation/Sidebar.js.map +1 -1
  75. package/dist/lib/components/navigation/utils.js +2 -2
  76. package/dist/lib/components/navigation/utils.js.map +1 -1
  77. package/dist/lib/core/{DevPortalContext.d.ts → ZudokuContext.d.ts} +3 -7
  78. package/dist/lib/core/{DevPortalContext.js → ZudokuContext.js} +2 -7
  79. package/dist/lib/core/ZudokuContext.js.map +1 -0
  80. package/dist/lib/core/plugins.d.ts +12 -12
  81. package/dist/lib/core/plugins.js.map +1 -1
  82. package/dist/lib/errors/ErrorAlert.js +1 -1
  83. package/dist/lib/errors/ErrorAlert.js.map +1 -1
  84. package/dist/lib/plugins/api-keys/index.d.ts +9 -9
  85. package/dist/lib/plugins/api-keys/index.js.map +1 -1
  86. package/dist/lib/plugins/custom-pages/index.d.ts +2 -2
  87. package/dist/lib/plugins/custom-pages/index.js.map +1 -1
  88. package/dist/lib/plugins/markdown/index.d.ts +2 -2
  89. package/dist/lib/plugins/markdown/index.js.map +1 -1
  90. package/dist/lib/plugins/openapi/ColorizedParam.js +13 -9
  91. package/dist/lib/plugins/openapi/ColorizedParam.js.map +1 -1
  92. package/dist/lib/plugins/openapi/Endpoint.d.ts +1 -1
  93. package/dist/lib/plugins/openapi/Endpoint.js +5 -9
  94. package/dist/lib/plugins/openapi/Endpoint.js.map +1 -1
  95. package/dist/lib/plugins/openapi/OperationList.d.ts +2 -2
  96. package/dist/lib/plugins/openapi/OperationList.js +7 -22
  97. package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
  98. package/dist/lib/plugins/openapi/Route.d.ts +4 -4
  99. package/dist/lib/plugins/openapi/Route.js +2 -4
  100. package/dist/lib/plugins/openapi/Route.js.map +1 -1
  101. package/dist/lib/plugins/openapi/Sidecar.d.ts +1 -1
  102. package/dist/lib/plugins/openapi/Sidecar.js +34 -33
  103. package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
  104. package/dist/lib/plugins/openapi/client/GraphQLClient.d.ts +8 -0
  105. package/dist/lib/plugins/openapi/client/GraphQLClient.js +102 -0
  106. package/dist/lib/plugins/openapi/client/GraphQLClient.js.map +1 -0
  107. package/dist/lib/plugins/openapi/client/GraphQLContext.d.ts +7 -0
  108. package/dist/lib/plugins/openapi/client/GraphQLContext.js +5 -0
  109. package/dist/lib/plugins/openapi/client/GraphQLContext.js.map +1 -0
  110. package/dist/lib/plugins/openapi/client/createServer.d.ts +1 -0
  111. package/dist/lib/plugins/openapi/client/useCreateQuery.d.ts +5 -0
  112. package/dist/lib/plugins/openapi/client/useCreateQuery.js +13 -0
  113. package/dist/lib/plugins/openapi/client/useCreateQuery.js.map +1 -0
  114. package/dist/lib/plugins/openapi/client/worker.d.ts +4 -1
  115. package/dist/lib/plugins/openapi/client/worker.js +23 -14
  116. package/dist/lib/plugins/openapi/client/worker.js.map +1 -1
  117. package/dist/lib/plugins/openapi/graphql/fragment-masking.d.ts +3 -3
  118. package/dist/lib/plugins/openapi/graphql/fragment-masking.js +3 -4
  119. package/dist/lib/plugins/openapi/graphql/fragment-masking.js.map +1 -1
  120. package/dist/lib/plugins/openapi/graphql/gql.d.ts +5 -52
  121. package/dist/lib/plugins/openapi/graphql/gql.js +2 -1
  122. package/dist/lib/plugins/openapi/graphql/gql.js.map +1 -1
  123. package/dist/lib/plugins/openapi/graphql/graphql.d.ts +134 -9
  124. package/dist/lib/plugins/openapi/graphql/graphql.js +194 -778
  125. package/dist/lib/plugins/openapi/graphql/graphql.js.map +1 -1
  126. package/dist/lib/plugins/openapi/index.d.ts +2 -2
  127. package/dist/lib/plugins/openapi/index.js +40 -53
  128. package/dist/lib/plugins/openapi/index.js.map +1 -1
  129. package/dist/lib/plugins/openapi/schema/SchemaView.js.map +1 -1
  130. package/dist/lib/plugins/openapi-worker.d.ts +1 -1
  131. package/dist/lib/plugins/openapi-worker.js +7 -1
  132. package/dist/lib/plugins/openapi-worker.js.map +1 -1
  133. package/dist/lib/plugins/redirect/index.d.ts +2 -2
  134. package/dist/lib/plugins/redirect/index.js.map +1 -1
  135. package/dist/lib/plugins/search-inkeep/index.d.ts +2 -2
  136. package/dist/lib/plugins/search-inkeep/index.js.map +1 -1
  137. package/dist/lib/ui/ActionButton.d.ts +3 -1
  138. package/dist/lib/util/MdxComponents.d.ts +1 -1
  139. package/dist/lib/util/useOnScreen.d.ts +4 -0
  140. package/dist/lib/util/useOnScreen.js +19 -0
  141. package/dist/lib/util/useOnScreen.js.map +1 -0
  142. package/dist/vite/config.js +0 -1
  143. package/dist/vite/config.js.map +1 -1
  144. package/dist/vite/html.js +0 -2
  145. package/dist/vite/html.js.map +1 -1
  146. package/dist/vite/plugin-component.js +1 -1
  147. package/dist/vite/plugin-component.js.map +1 -1
  148. package/dist/vite/plugin-mdx.d.ts +0 -6
  149. package/dist/vite/plugin-mdx.js +3 -2
  150. package/dist/vite/plugin-mdx.js.map +1 -1
  151. package/dist/vite/plugin.js +0 -2
  152. package/dist/vite/plugin.js.map +1 -1
  153. package/dist/vite/remarkStaticGeneration.d.ts +3 -0
  154. package/dist/vite/remarkStaticGeneration.js +125 -0
  155. package/dist/vite/remarkStaticGeneration.js.map +1 -0
  156. package/lib/{AnchorLink-BbB2q-jx.js → AnchorLink-CDlhr8gL.js} +11 -10
  157. package/lib/{AnchorLink-BbB2q-jx.js.map → AnchorLink-CDlhr8gL.js.map} +1 -1
  158. package/lib/{AuthenticationPlugin-C9BHGXlE.js → AuthenticationPlugin-DeGDVa1r.js} +6 -5
  159. package/lib/{AuthenticationPlugin-C9BHGXlE.js.map → AuthenticationPlugin-DeGDVa1r.js.map} +1 -1
  160. package/lib/{Spinner-ChOGyPls.js → Button-jK0EsymC.js} +12 -15
  161. package/lib/Button-jK0EsymC.js.map +1 -0
  162. package/lib/{ClientOnly-CVN6leDu.js → ClientOnly-E7hGysn1.js} +4 -4
  163. package/lib/ClientOnly-E7hGysn1.js.map +1 -0
  164. package/lib/Markdown-ievDDhFT.js +15192 -0
  165. package/lib/Markdown-ievDDhFT.js.map +1 -0
  166. package/lib/{MdxPage-DKMH_t0f.js → MdxPage-Bwn-VSsH.js} +5 -5
  167. package/lib/{MdxPage-DKMH_t0f.js.map → MdxPage-Bwn-VSsH.js.map} +1 -1
  168. package/lib/OperationList-BwBl1xrD.js +4691 -0
  169. package/lib/OperationList-BwBl1xrD.js.map +1 -0
  170. package/lib/Route-DlG_HTMu.js +11 -0
  171. package/lib/Route-DlG_HTMu.js.map +1 -0
  172. package/lib/{Select-Bagt3Bme.js → Select-O9ZM3ZgX.js} +7 -7
  173. package/lib/Select-O9ZM3ZgX.js.map +1 -0
  174. package/lib/SidebarBadge-DxFJcJ6V.js +51 -0
  175. package/lib/SidebarBadge-DxFJcJ6V.js.map +1 -0
  176. package/lib/SlotletProvider-DyomlzGx.js +252 -0
  177. package/lib/SlotletProvider-DyomlzGx.js.map +1 -0
  178. package/lib/Spinner-3cQDBVGr.js +7 -0
  179. package/lib/Spinner-3cQDBVGr.js.map +1 -0
  180. package/lib/SyntaxHighlight-DkLOsjHS.js +2983 -0
  181. package/lib/SyntaxHighlight-DkLOsjHS.js.map +1 -0
  182. package/lib/assets/{worker-YA-aCP3P.js → worker-CPsGZsve.js} +24 -22
  183. package/lib/assets/{worker-YA-aCP3P.js.map → worker-CPsGZsve.js.map} +1 -1
  184. package/lib/context-D1nXWxm7.js +22 -0
  185. package/lib/context-D1nXWxm7.js.map +1 -0
  186. package/lib/createServer-DK-g7kbB.js +16089 -0
  187. package/lib/createServer-DK-g7kbB.js.map +1 -0
  188. package/lib/{hook-sn0zMTkE.js → hook-hEqe7fPB.js} +12 -14
  189. package/lib/hook-hEqe7fPB.js.map +1 -0
  190. package/lib/index-Czzd9rjU.js +899 -0
  191. package/lib/index-Czzd9rjU.js.map +1 -0
  192. package/lib/index-DNxQ_rCt.js +1273 -0
  193. package/lib/index-DNxQ_rCt.js.map +1 -0
  194. package/lib/index-Yn8c3UWE.js +921 -0
  195. package/lib/index-Yn8c3UWE.js.map +1 -0
  196. package/lib/{router-BsfSoK2j.js → router-lfyopgBI.js} +23 -23
  197. package/lib/{router-BsfSoK2j.js.map → router-lfyopgBI.js.map} +1 -1
  198. package/lib/state-tsXBLONe.js +203 -0
  199. package/lib/{state-CsuHT8ZO.js.map → state-tsXBLONe.js.map} +1 -1
  200. package/lib/ui/ActionButton.js +11 -10
  201. package/lib/ui/ActionButton.js.map +1 -1
  202. package/lib/useExposedProps-CTPtylCV.js +10 -0
  203. package/lib/{useExposedProps-ChOIUaS4.js.map → useExposedProps-CTPtylCV.js.map} +1 -1
  204. package/lib/{ZudokuContext-BKXGJTmu.js → utils-DcpDOncX.js} +242 -246
  205. package/lib/utils-DcpDOncX.js.map +1 -0
  206. package/lib/zudoku.auth-auth0.js +24 -18
  207. package/lib/zudoku.auth-auth0.js.map +1 -1
  208. package/lib/zudoku.auth-clerk.js +2 -2
  209. package/lib/zudoku.auth-openid.js +124 -138
  210. package/lib/zudoku.auth-openid.js.map +1 -1
  211. package/lib/zudoku.components.js +1284 -1121
  212. package/lib/zudoku.components.js.map +1 -1
  213. package/lib/zudoku.openapi-worker.js +10 -16346
  214. package/lib/zudoku.openapi-worker.js.map +1 -1
  215. package/lib/zudoku.plugin-api-keys.js +18 -18
  216. package/lib/zudoku.plugin-api-keys.js.map +1 -1
  217. package/lib/zudoku.plugin-custom-pages.js +2 -2
  218. package/lib/zudoku.plugin-custom-pages.js.map +1 -1
  219. package/lib/zudoku.plugin-markdown.js +1 -1
  220. package/lib/zudoku.plugin-markdown.js.map +1 -1
  221. package/lib/zudoku.plugin-openapi.js +5 -9
  222. package/lib/zudoku.plugin-openapi.js.map +1 -1
  223. package/lib/zudoku.plugin-redirect.js +1 -1
  224. package/lib/zudoku.plugin-redirect.js.map +1 -1
  225. package/lib/zudoku.plugin-search-inkeep.js +1 -1
  226. package/lib/zudoku.plugin-search-inkeep.js.map +1 -1
  227. package/package.json +14 -4
  228. package/src/app/demo.tsx +0 -3
  229. package/src/app/entry.client.tsx +14 -0
  230. package/src/app/entry.server.tsx +59 -57
  231. package/src/app/main.tsx +4 -4
  232. package/src/app/standalone.tsx +0 -3
  233. package/src/lib/authentication/authentication.ts +2 -2
  234. package/src/lib/authentication/hook.ts +1 -3
  235. package/src/lib/authentication/providers/auth0.tsx +16 -11
  236. package/src/lib/authentication/providers/openid.tsx +12 -30
  237. package/src/lib/authentication/state.ts +50 -9
  238. package/{LICENSE.md → src/lib/authentication/use-broadcast/LICENSE.md} +2 -2
  239. package/src/lib/authentication/use-broadcast/shared.ts +372 -0
  240. package/src/lib/authentication/use-broadcast/useBroadcast.ts +146 -0
  241. package/src/lib/components/Bootstrap.tsx +36 -9
  242. package/src/lib/components/ClientOnly.tsx +6 -3
  243. package/src/lib/components/DeveloperHint.tsx +6 -1
  244. package/src/lib/components/Header.tsx +32 -37
  245. package/src/lib/components/Layout.tsx +48 -36
  246. package/src/lib/components/MobileTopNavigation.tsx +15 -18
  247. package/src/lib/components/SyntaxHighlight.tsx +81 -46
  248. package/src/lib/components/ThemeSwitch.tsx +26 -0
  249. package/src/lib/components/TopNavigation.tsx +27 -19
  250. package/src/lib/components/Zudoku.tsx +108 -0
  251. package/src/lib/components/context/ZudokuContext.ts +11 -16
  252. package/src/lib/components/context/ZudokuProvider.tsx +2 -2
  253. package/src/lib/components/index.ts +2 -3
  254. package/src/lib/components/navigation/Sidebar.tsx +3 -3
  255. package/src/lib/components/navigation/utils.ts +2 -2
  256. package/src/lib/core/{DevPortalContext.ts → ZudokuContext.ts} +3 -11
  257. package/src/lib/core/plugins.ts +12 -16
  258. package/src/lib/errors/ErrorAlert.tsx +2 -1
  259. package/src/lib/plugins/api-keys/index.tsx +9 -9
  260. package/src/lib/plugins/custom-pages/index.tsx +2 -2
  261. package/src/lib/plugins/markdown/index.tsx +2 -2
  262. package/src/lib/plugins/openapi/ColorizedParam.tsx +23 -14
  263. package/src/lib/plugins/openapi/Endpoint.tsx +5 -10
  264. package/src/lib/plugins/openapi/OperationList.tsx +6 -40
  265. package/src/lib/plugins/openapi/Route.tsx +11 -12
  266. package/src/lib/plugins/openapi/Sidecar.tsx +72 -61
  267. package/src/lib/plugins/openapi/client/GraphQLClient.tsx +140 -0
  268. package/src/lib/plugins/openapi/client/GraphQLContext.tsx +16 -0
  269. package/src/lib/plugins/openapi/client/createServer.ts +2 -0
  270. package/src/lib/plugins/openapi/client/useCreateQuery.ts +18 -0
  271. package/src/lib/plugins/openapi/client/worker.ts +38 -24
  272. package/src/lib/plugins/openapi/graphql/fragment-masking.ts +11 -18
  273. package/src/lib/plugins/openapi/graphql/gql.ts +7 -25
  274. package/src/lib/plugins/openapi/graphql/graphql.ts +351 -782
  275. package/src/lib/plugins/openapi/index.tsx +42 -67
  276. package/src/lib/plugins/openapi/schema/SchemaView.tsx +1 -1
  277. package/src/lib/plugins/openapi-worker.ts +11 -1
  278. package/src/lib/plugins/redirect/index.tsx +2 -2
  279. package/src/lib/plugins/search-inkeep/index.tsx +2 -2
  280. package/src/lib/ui/ActionButton.tsx +1 -1
  281. package/src/lib/util/useOnScreen.ts +32 -0
  282. package/dist/lib/components/DevPortal.js.map +0 -1
  283. package/dist/lib/components/context/ThemeContext.d.ts +0 -2
  284. package/dist/lib/components/context/ThemeContext.js +0 -7
  285. package/dist/lib/components/context/ThemeContext.js.map +0 -1
  286. package/dist/lib/components/context/ThemeProvider.d.ts +0 -4
  287. package/dist/lib/components/context/ThemeProvider.js +0 -23
  288. package/dist/lib/components/context/ThemeProvider.js.map +0 -1
  289. package/dist/lib/core/DevPortalContext.js.map +0 -1
  290. package/dist/lib/plugins/openapi/client/createMemoryClient.d.ts +0 -9
  291. package/dist/lib/plugins/openapi/client/createMemoryClient.js +0 -54
  292. package/dist/lib/plugins/openapi/client/createMemoryClient.js.map +0 -1
  293. package/dist/lib/plugins/openapi/client/createWorkerClient.d.ts +0 -10
  294. package/dist/lib/plugins/openapi/client/createWorkerClient.js +0 -62
  295. package/dist/lib/plugins/openapi/client/createWorkerClient.js.map +0 -1
  296. package/dist/lib/plugins/openapi/client/interfaces.d.ts +0 -4
  297. package/dist/lib/plugins/openapi/client/interfaces.js +0 -2
  298. package/dist/lib/plugins/openapi/client/interfaces.js.map +0 -1
  299. package/dist/lib/themeToggle.d.ts +0 -1
  300. package/dist/lib/themeToggle.js +0 -7
  301. package/dist/lib/themeToggle.js.map +0 -1
  302. package/dist/lib/util/createWaitForNotify.d.ts +0 -1
  303. package/dist/lib/util/createWaitForNotify.js +0 -15
  304. package/dist/lib/util/createWaitForNotify.js.map +0 -1
  305. package/dist/vite/plugin-html-transform.d.ts +0 -2
  306. package/dist/vite/plugin-html-transform.js +0 -15
  307. package/dist/vite/plugin-html-transform.js.map +0 -1
  308. package/lib/ClientOnly-CVN6leDu.js.map +0 -1
  309. package/lib/DeveloperHint-DHdLXGHA.js +0 -16
  310. package/lib/DeveloperHint-DHdLXGHA.js.map +0 -1
  311. package/lib/Markdown-BDcCAWwm.js +0 -18059
  312. package/lib/Markdown-BDcCAWwm.js.map +0 -1
  313. package/lib/OperationList-BjppA5yM.js +0 -621
  314. package/lib/OperationList-BjppA5yM.js.map +0 -1
  315. package/lib/Route-D_djzMv3.js +0 -13
  316. package/lib/Route-D_djzMv3.js.map +0 -1
  317. package/lib/Select-Bagt3Bme.js.map +0 -1
  318. package/lib/SidebarBadge-Bbt92M5K.js +0 -38
  319. package/lib/SidebarBadge-Bbt92M5K.js.map +0 -1
  320. package/lib/SlotletProvider-Da7eFgd2.js +0 -241
  321. package/lib/SlotletProvider-Da7eFgd2.js.map +0 -1
  322. package/lib/Spinner-ChOGyPls.js.map +0 -1
  323. package/lib/StaggeredRender-DDHSzQKE.js +0 -17
  324. package/lib/StaggeredRender-DDHSzQKE.js.map +0 -1
  325. package/lib/ZudokuContext-BKXGJTmu.js.map +0 -1
  326. package/lib/hook-sn0zMTkE.js.map +0 -1
  327. package/lib/index-CRo94sKK.js +0 -1783
  328. package/lib/index-CRo94sKK.js.map +0 -1
  329. package/lib/index-_gtpPhlu.js +0 -5877
  330. package/lib/index-_gtpPhlu.js.map +0 -1
  331. package/lib/state-CsuHT8ZO.js +0 -183
  332. package/lib/urql-core-35Qt_U4i.js +0 -1511
  333. package/lib/urql-core-35Qt_U4i.js.map +0 -1
  334. package/lib/useExposedProps-ChOIUaS4.js +0 -9
  335. package/src/lib/components/DevPortal.tsx +0 -111
  336. package/src/lib/components/context/ThemeContext.tsx +0 -8
  337. package/src/lib/components/context/ThemeProvider.tsx +0 -27
  338. package/src/lib/plugins/openapi/client/createMemoryClient.ts +0 -65
  339. package/src/lib/plugins/openapi/client/createWorkerClient.ts +0 -79
  340. package/src/lib/plugins/openapi/client/interfaces.ts +0 -5
  341. package/src/lib/themeToggle.ts +0 -7
  342. package/src/lib/util/createWaitForNotify.ts +0 -18
@@ -0,0 +1,108 @@
1
+ import { MDXProvider } from "@mdx-js/react";
2
+ import { Helmet } from "@zudoku/react-helmet-async";
3
+ import { ThemeProvider } from "next-themes";
4
+ import {
5
+ Fragment,
6
+ memo,
7
+ type PropsWithChildren,
8
+ useContext,
9
+ useEffect,
10
+ useMemo,
11
+ useState,
12
+ } from "react";
13
+ import { ErrorBoundary } from "react-error-boundary";
14
+ import { Outlet, useNavigation } from "react-router-dom";
15
+ import { hasHead, isMdxProviderPlugin } from "../core/plugins.js";
16
+ import { ZudokuContext, ZudokuContextOptions } from "../core/ZudokuContext.js";
17
+ import { TopLevelError } from "../errors/TopLevelError.js";
18
+ import { StaggeredRenderContext } from "../plugins/openapi/StaggeredRender.js";
19
+ import { MdxComponents } from "../util/MdxComponents.js";
20
+ import "../util/requestIdleCallbackPolyfill.js";
21
+ import {
22
+ ComponentsProvider,
23
+ DEFAULT_COMPONENTS,
24
+ } from "./context/ComponentsContext.js";
25
+ import { ViewportAnchorProvider } from "./context/ViewportAnchorContext.js";
26
+ import { ZudokuProvider } from "./context/ZudokuProvider.js";
27
+ import { SlotletProvider } from "./SlotletProvider.js";
28
+
29
+ const ZudokoInner = memo(
30
+ ({ children, ...props }: PropsWithChildren<ZudokuContextOptions>) => {
31
+ const components = useMemo(
32
+ () => ({ ...DEFAULT_COMPONENTS, ...props.overrides }),
33
+ [props.overrides],
34
+ );
35
+
36
+ const mdxComponents = useMemo(() => {
37
+ const componentsFromPlugins = (props.plugins ?? [])
38
+ .filter(isMdxProviderPlugin)
39
+ .flatMap((plugin) =>
40
+ plugin.getMdxComponents ? [plugin.getMdxComponents()] : [],
41
+ );
42
+
43
+ return {
44
+ ...componentsFromPlugins.reduce(
45
+ (acc, curr) => ({ ...acc, ...curr }),
46
+ {},
47
+ ),
48
+ ...MdxComponents,
49
+ ...props.mdx?.components,
50
+ };
51
+ }, [props.mdx?.components, props.plugins]);
52
+ const { stagger } = useContext(StaggeredRenderContext);
53
+ const [didNavigate, setDidNavigate] = useState(false);
54
+ const staggeredValue = useMemo(
55
+ () => (didNavigate ? { stagger: true } : { stagger }),
56
+ [stagger, didNavigate],
57
+ );
58
+ const navigation = useNavigation();
59
+
60
+ useEffect(() => {
61
+ if (didNavigate) {
62
+ return;
63
+ }
64
+ setDidNavigate(true);
65
+ }, [didNavigate, navigation.location]);
66
+
67
+ const [zudokuContext] = useState(() => new ZudokuContext(props));
68
+
69
+ const heads = props.plugins
70
+ ?.filter(hasHead)
71
+ // eslint-disable-next-line react/no-array-index-key
72
+ .map((plugin, i) => <Fragment key={i}>{plugin.getHead?.()}</Fragment>);
73
+
74
+ return (
75
+ <>
76
+ <Helmet>{heads}</Helmet>
77
+ <StaggeredRenderContext.Provider value={staggeredValue}>
78
+ <ZudokuProvider context={zudokuContext}>
79
+ <MDXProvider components={mdxComponents}>
80
+ <ThemeProvider attribute="class" disableTransitionOnChange>
81
+ <ComponentsProvider value={components}>
82
+ <SlotletProvider slotlets={props.slotlets}>
83
+ <ViewportAnchorProvider>
84
+ {children ?? <Outlet />}
85
+ </ViewportAnchorProvider>
86
+ </SlotletProvider>
87
+ </ComponentsProvider>
88
+ </ThemeProvider>
89
+ </MDXProvider>
90
+ </ZudokuProvider>
91
+ </StaggeredRenderContext.Provider>
92
+ </>
93
+ );
94
+ },
95
+ );
96
+
97
+ ZudokoInner.displayName = "ZudokoInner";
98
+
99
+ const Zudoku = (props: ZudokuContextOptions) => {
100
+ return (
101
+ <ErrorBoundary FallbackComponent={TopLevelError}>
102
+ <ZudokoInner {...props} />
103
+ </ErrorBoundary>
104
+ );
105
+ };
106
+ Zudoku.displayName = "Zudoku";
107
+
108
+ export { Zudoku };
@@ -1,11 +1,11 @@
1
1
  import { useQuery, useSuspenseQuery } from "@tanstack/react-query";
2
2
  import { createContext, useContext } from "react";
3
3
  import { matchPath, useLocation } from "react-router-dom";
4
- import { DevPortalContext } from "../../core/DevPortalContext.js";
4
+ import { ZudokuContext } from "../../core/ZudokuContext.js";
5
5
  import { joinPath } from "../../util/joinPath.js";
6
6
  import { traverseSidebar } from "../navigation/utils.js";
7
7
 
8
- export const ZudokuReactContext = createContext<DevPortalContext | undefined>(
8
+ export const ZudokuReactContext = createContext<ZudokuContext | undefined>(
9
9
  undefined,
10
10
  );
11
11
 
@@ -13,7 +13,7 @@ export const useZudoku = () => {
13
13
  const context = useContext(ZudokuReactContext);
14
14
 
15
15
  if (!context) {
16
- throw new Error("useDevPortal must be used within a DevPortalProvider.");
16
+ throw new Error("useZudoku must be used within a ZudokuProvider.");
17
17
  }
18
18
 
19
19
  return context;
@@ -49,18 +49,13 @@ export const useCurrentNavigation = () => {
49
49
  topNavigation.find((t) => t.id === currentSidebarItem?.[0]) ??
50
50
  topNavigation.find((item) => matchPath(item.id, location.pathname));
51
51
 
52
- return useSuspenseQuery({
53
- queryFn: async () => {
54
- const pluginSidebar = await getPluginSidebar(location.pathname);
55
-
56
- return {
57
- sidebar: [
58
- ...(currentSidebarItem ? currentSidebarItem[1] : []),
59
- ...pluginSidebar,
60
- ],
61
- topNavItem: currentTopNavItem,
62
- };
63
- },
64
- queryKey: ["navigation", location.pathname],
52
+ const { data } = useSuspenseQuery({
53
+ queryFn: () => getPluginSidebar(location.pathname),
54
+ queryKey: ["plugin-sidebar", location.pathname],
65
55
  });
56
+
57
+ return {
58
+ sidebar: [...(currentSidebarItem ? currentSidebarItem[1] : []), ...data],
59
+ topNavItem: currentTopNavItem,
60
+ };
66
61
  };
@@ -1,12 +1,12 @@
1
1
  import { useSuspenseQuery } from "@tanstack/react-query";
2
2
  import type { PropsWithChildren } from "react";
3
- import { DevPortalContext } from "../../core/DevPortalContext.js";
3
+ import { ZudokuContext } from "../../core/ZudokuContext.js";
4
4
  import { ZudokuReactContext } from "./ZudokuContext.js";
5
5
 
6
6
  export const ZudokuProvider = ({
7
7
  children,
8
8
  context,
9
- }: PropsWithChildren<{ context: DevPortalContext }>) => {
9
+ }: PropsWithChildren<{ context: ZudokuContext }>) => {
10
10
  useSuspenseQuery({
11
11
  queryFn: async () => {
12
12
  await context.initialize();
@@ -11,11 +11,10 @@ import {
11
11
  BootstrapStatic as BootstrapStaticImport,
12
12
  } from "./Bootstrap.js";
13
13
  import { ClientOnly as ClientOnlyImport } from "./ClientOnly.js";
14
- import { DevPortal as DevPortalImport } from "./DevPortal.js";
15
14
  import { Layout as LayoutImport } from "./Layout.js";
15
+ import { Zudoku as ZudokuImport } from "./Zudoku.js";
16
16
  import { useZudoku as useZudokuImport } from "./context/ZudokuContext.js";
17
17
  export const useMDXComponents = /*@__PURE__*/ useMDXComponentsImport;
18
- export const DevPortal = /*@__PURE__*/ DevPortalImport;
19
18
  export const Layout = /*@__PURE__*/ LayoutImport;
20
19
  export const RouterError = /*@__PURE__*/ RouterErrorImport;
21
20
  export const ServerError = /*@__PURE__*/ ServerErrorImport;
@@ -26,7 +25,7 @@ export const Head = /*@__PURE__*/ Helmet;
26
25
 
27
26
  export const useZudoku = /*@__PURE__*/ useZudokuImport;
28
27
  export const useAuth = /*@__PURE__*/ useAuthState;
29
- export const Zudoku = /*@__PURE__*/ DevPortalImport;
28
+ export const Zudoku = /*@__PURE__*/ ZudokuImport;
30
29
 
31
30
  export const Callout = /*@__PURE__*/ CalloutImport;
32
31
  export const ClientOnly = /*@__PURE__*/ ClientOnlyImport;
@@ -15,10 +15,10 @@ export const Sidebar = () => {
15
15
  <>
16
16
  <SidebarWrapper
17
17
  ref={navRef}
18
- pushMainContent={navigation.data.sidebar.length > 0}
18
+ pushMainContent={navigation.sidebar.length > 0}
19
19
  >
20
20
  <Slotlet name="zudoku-before-navigation" />
21
- {navigation.data.sidebar.map((item) => (
21
+ {navigation.sidebar.map((item) => (
22
22
  <SidebarItem key={item.label} item={item} />
23
23
  ))}
24
24
  <Slotlet name="zudoku-after-navigation" />
@@ -30,7 +30,7 @@ export const Sidebar = () => {
30
30
  <VisuallyHidden>
31
31
  <DrawerTitle>Sidebar</DrawerTitle>
32
32
  </VisuallyHidden>
33
- {navigation.data.sidebar.map((item) => (
33
+ {navigation.sidebar.map((item) => (
34
34
  <SidebarItem key={item.label} item={item} />
35
35
  ))}
36
36
  </DrawerContent>
@@ -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";
@@ -5,6 +5,7 @@ import { ZudokuError } from "../util/invariant.js";
5
5
  export function ErrorAlert({ error }: { error: unknown }) {
6
6
  const message =
7
7
  error instanceof Error ? error.message : "Something went wrong";
8
+
8
9
  const hint = error instanceof ZudokuError ? error.developerHint : undefined;
9
10
  const title =
10
11
  error instanceof ZudokuError ? error.title : "Something went wrong";
@@ -12,7 +13,7 @@ export function ErrorAlert({ error }: { error: unknown }) {
12
13
  const cause = error instanceof Error ? error.cause : undefined;
13
14
 
14
15
  return (
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">
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">
16
17
  <div className="mx-auto max-w-[85%] sm:max-w-[50%]">
17
18
  <h1 className="text-4xl font-bold tracking-tight text-h1-text sm:text-5xl">
18
19
  {title}
@@ -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
 
@@ -1,7 +1,7 @@
1
1
  import { type ComponentType, type ReactNode } from "react";
2
2
  import type { RouteObject } from "react-router-dom";
3
3
  import { type ExposedComponentProps } from "../../components/SlotletProvider.js";
4
- import type { DevPortalPlugin, NavigationPlugin } from "../../core/plugins.js";
4
+ import type { NavigationPlugin, ZudokuPlugin } from "../../core/plugins.js";
5
5
  import { CustomPage } from "./CustomPage.js";
6
6
 
7
7
  export type CustomPageConfig = {
@@ -13,7 +13,7 @@ export type CustomPageConfig = {
13
13
 
14
14
  export const customPagesPlugin = (
15
15
  config: CustomPageConfig[],
16
- ): DevPortalPlugin & NavigationPlugin => {
16
+ ): ZudokuPlugin & NavigationPlugin => {
17
17
  return {
18
18
  getRoutes: (): RouteObject[] =>
19
19
  config.map(({ path, ...props }) => ({
@@ -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 }) =>
@@ -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) {
@@ -1,16 +1,13 @@
1
1
  import { ResultOf } from "@graphql-typed-document-node/core";
2
- import { useQuery } from "urql";
2
+ import { useSuspenseQuery } from "@tanstack/react-query";
3
3
  import { CategoryHeading } from "../../components/CategoryHeading.js";
4
- import { DeveloperHint } from "../../components/DeveloperHint.js";
5
- import { ErrorPage } from "../../components/ErrorPage.js";
6
4
  import { Heading } from "../../components/Heading.js";
7
- import { InlineCode } from "../../components/InlineCode.js";
8
5
  import { Markdown, ProseClasses } from "../../components/Markdown.js";
9
- import { SyntaxHighlight } from "../../components/SyntaxHighlight.js";
10
6
  import { cn } from "../../util/cn.js";
11
7
  import { Endpoint } from "./Endpoint.js";
12
8
  import { OperationListItem } from "./OperationListItem.js";
13
9
  import StaggeredRender from "./StaggeredRender.js";
10
+ import { useCreateQuery } from "./client/useCreateQuery.js";
14
11
  import { useOasConfig } from "./context.js";
15
12
  import { graphql } from "./graphql/index.js";
16
13
 
@@ -99,41 +96,10 @@ const AllOperationsQuery = graphql(/* GraphQL */ `
99
96
  }
100
97
  `);
101
98
 
102
- const suspenseContext = { suspense: true };
103
-
104
99
  export const OperationList = () => {
105
- const { type, input } = useOasConfig();
106
-
107
- const [result] = useQuery({
108
- query: AllOperationsQuery,
109
- variables: { type, input },
110
- context: suspenseContext,
111
- });
112
-
113
- const error = result.error?.graphQLErrors.at(0);
114
-
115
- // Looks like there is no Suspense level error handling (yet)?
116
- // So we handle the error case in the component directly
117
- if (error) {
118
- return (
119
- <ErrorPage
120
- category="Error"
121
- title="Schema cannot be displayed"
122
- message={
123
- <>
124
- <DeveloperHint className="mb-4">
125
- Check your configuration value <InlineCode>apis.type</InlineCode>{" "}
126
- and <InlineCode>apis.input</InlineCode> in the Zudoku config.
127
- </DeveloperHint>
128
- An error occurred while trying to fetch the API reference:
129
- <SyntaxHighlight code={error.toString()} language="plain" />
130
- </>
131
- }
132
- />
133
- );
134
- }
135
-
136
- if (!result.data) return null;
100
+ const { input, type } = useOasConfig();
101
+ const query = useCreateQuery(AllOperationsQuery, { input, type });
102
+ const result = useSuspenseQuery(query);
137
103
 
138
104
  return (
139
105
  <div className="pt-[--padding-content-top]">
@@ -154,7 +120,7 @@ export const OperationList = () => {
154
120
  {result.data.schema.tags
155
121
  .filter((tag) => tag.operations.length > 0)
156
122
  .map((tag) => (
157
- <div key={tag.name}>
123
+ <div key={tag.name} className="[content-visibility:auto]">
158
124
  {tag.name && <CategoryHeading>{tag.name}</CategoryHeading>}
159
125
  {tag.description && (
160
126
  <Markdown