zudoku 0.3.0-dev.3 → 0.3.0-dev.31

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 (417) hide show
  1. package/dist/app/demo.d.ts +2 -0
  2. package/dist/app/demo.js +27 -0
  3. package/dist/app/demo.js.map +1 -0
  4. package/dist/app/main.d.ts +2 -1
  5. package/dist/app/main.js +31 -10
  6. package/dist/app/main.js.map +1 -1
  7. package/dist/app/standalone.d.ts +2 -0
  8. package/dist/app/standalone.js +32 -0
  9. package/dist/app/standalone.js.map +1 -0
  10. package/dist/app/tailwind.d.ts +1 -1
  11. package/dist/app/tailwind.js +0 -9
  12. package/dist/app/tailwind.js.map +1 -1
  13. package/dist/config/config.d.ts +10 -16
  14. package/dist/lib/authentication/Callback.js +1 -1
  15. package/dist/lib/authentication/Callback.js.map +1 -1
  16. package/dist/lib/authentication/authentication.d.ts +2 -2
  17. package/dist/lib/authentication/hook.d.ts +1 -0
  18. package/dist/lib/authentication/hook.js +1 -0
  19. package/dist/lib/authentication/hook.js.map +1 -1
  20. package/dist/lib/authentication/providers/auth0.js +1 -0
  21. package/dist/lib/authentication/providers/auth0.js.map +1 -1
  22. package/dist/lib/authentication/providers/clerk.js +2 -0
  23. package/dist/lib/authentication/providers/clerk.js.map +1 -1
  24. package/dist/lib/authentication/providers/openid.d.ts +1 -1
  25. package/dist/lib/authentication/providers/openid.js +2 -0
  26. package/dist/lib/authentication/providers/openid.js.map +1 -1
  27. package/dist/lib/authentication/state.d.ts +1 -0
  28. package/dist/lib/authentication/state.js +1 -0
  29. package/dist/lib/authentication/state.js.map +1 -1
  30. package/dist/lib/components/DevPortal.d.ts +5 -20
  31. package/dist/lib/components/DevPortal.js +20 -11
  32. package/dist/lib/components/DevPortal.js.map +1 -1
  33. package/dist/lib/components/Header.js +3 -3
  34. package/dist/lib/components/Header.js.map +1 -1
  35. package/dist/lib/components/Heading.d.ts +9 -4
  36. package/dist/lib/components/Heading.js +17 -2
  37. package/dist/lib/components/Heading.js.map +1 -1
  38. package/dist/lib/components/Layout.js +2 -2
  39. package/dist/lib/components/Layout.js.map +1 -1
  40. package/dist/lib/components/Router.js +2 -1
  41. package/dist/lib/components/Router.js.map +1 -1
  42. package/dist/lib/components/SyntaxHighlight.js +5 -1
  43. package/dist/lib/components/SyntaxHighlight.js.map +1 -1
  44. package/dist/lib/components/TopNavigation.d.ts +1 -1
  45. package/dist/lib/components/TopNavigation.js +4 -0
  46. package/dist/lib/components/TopNavigation.js.map +1 -1
  47. package/dist/lib/components/context/DevPortalProvider.d.ts +1 -1
  48. package/dist/lib/components/context/DevPortalProvider.js +2 -2
  49. package/dist/lib/components/context/DevPortalProvider.js.map +1 -1
  50. package/dist/lib/components/index.d.ts +13 -3
  51. package/dist/lib/components/index.js +8 -3
  52. package/dist/lib/components/index.js.map +1 -1
  53. package/dist/lib/core/DevPortalContext.d.ts +33 -3
  54. package/dist/lib/core/DevPortalContext.js +8 -4
  55. package/dist/lib/core/DevPortalContext.js.map +1 -1
  56. package/dist/lib/core/plugins.d.ts +7 -4
  57. package/dist/lib/core/plugins.js +1 -0
  58. package/dist/lib/core/plugins.js.map +1 -1
  59. package/dist/lib/errors/ErrorAlert.d.ts +3 -0
  60. package/dist/lib/errors/ErrorAlert.js +8 -0
  61. package/dist/lib/errors/ErrorAlert.js.map +1 -0
  62. package/dist/lib/errors/RouterError.d.ts +1 -0
  63. package/dist/lib/errors/RouterError.js +9 -0
  64. package/dist/lib/errors/RouterError.js.map +1 -0
  65. package/dist/lib/errors/TopLevelError.d.ts +2 -0
  66. package/dist/lib/errors/TopLevelError.js +7 -0
  67. package/dist/lib/errors/TopLevelError.js.map +1 -0
  68. package/dist/lib/oas/graphql/index.js +1 -1
  69. package/dist/lib/oas/graphql/index.js.map +1 -1
  70. package/dist/lib/oas/parser/index.js +3 -1
  71. package/dist/lib/oas/parser/index.js.map +1 -1
  72. package/dist/lib/plugins/api-keys/CreateApiKey.d.ts +4 -0
  73. package/dist/lib/plugins/{api-key → api-keys}/CreateApiKey.js +1 -1
  74. package/dist/lib/plugins/api-keys/CreateApiKey.js.map +1 -0
  75. package/dist/lib/plugins/api-keys/SettingsApiKeys.d.ts +4 -0
  76. package/dist/lib/plugins/api-keys/SettingsApiKeys.js +38 -0
  77. package/dist/lib/plugins/api-keys/SettingsApiKeys.js.map +1 -0
  78. package/dist/lib/plugins/{api-key → api-keys}/index.js +37 -9
  79. package/dist/lib/plugins/api-keys/index.js.map +1 -0
  80. package/dist/lib/plugins/markdown/MdxPage.d.ts +3 -2
  81. package/dist/lib/plugins/markdown/MdxPage.js +7 -6
  82. package/dist/lib/plugins/markdown/MdxPage.js.map +1 -1
  83. package/dist/lib/plugins/markdown/Toc.js +1 -1
  84. package/dist/lib/plugins/markdown/Toc.js.map +1 -1
  85. package/dist/lib/plugins/markdown/generateRoutes.d.ts +3 -3
  86. package/dist/lib/plugins/markdown/generateRoutes.js +4 -4
  87. package/dist/lib/plugins/markdown/generateRoutes.js.map +1 -1
  88. package/dist/lib/plugins/markdown/index.d.ts +4 -1
  89. package/dist/lib/plugins/markdown/index.js +2 -2
  90. package/dist/lib/plugins/markdown/index.js.map +1 -1
  91. package/dist/lib/plugins/openapi/OperationList.js +5 -4
  92. package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
  93. package/dist/lib/plugins/openapi/OperationListItem.js +8 -4
  94. package/dist/lib/plugins/openapi/OperationListItem.js.map +1 -1
  95. package/dist/lib/plugins/openapi/ParameterList.js +1 -1
  96. package/dist/lib/plugins/openapi/ParameterList.js.map +1 -1
  97. package/dist/lib/plugins/openapi/ParameterListItem.js +1 -1
  98. package/dist/lib/plugins/openapi/ParameterListItem.js.map +1 -1
  99. package/dist/lib/plugins/openapi/{MakeRequest.d.ts → PlaygroundDialogWrapper.d.ts} +1 -1
  100. package/dist/lib/plugins/openapi/{MakeRequest.js → PlaygroundDialogWrapper.js} +5 -5
  101. package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.js.map +1 -0
  102. package/dist/lib/plugins/openapi/RequestBodySidecarBox.js +1 -9
  103. package/dist/lib/plugins/openapi/RequestBodySidecarBox.js.map +1 -1
  104. package/dist/lib/plugins/openapi/ResponsesSidecarBox.js +1 -1
  105. package/dist/lib/plugins/openapi/ResponsesSidecarBox.js.map +1 -1
  106. package/dist/lib/plugins/openapi/Route.d.ts +6 -0
  107. package/dist/lib/plugins/openapi/Route.js +8 -0
  108. package/dist/lib/plugins/openapi/Route.js.map +1 -0
  109. package/dist/lib/plugins/openapi/SchemaListView.js +4 -26
  110. package/dist/lib/plugins/openapi/SchemaListView.js.map +1 -1
  111. package/dist/lib/plugins/openapi/SchemaListViewItem.d.ts +7 -0
  112. package/dist/lib/plugins/openapi/SchemaListViewItem.js +16 -0
  113. package/dist/lib/plugins/openapi/SchemaListViewItem.js.map +1 -0
  114. package/dist/lib/plugins/openapi/SchemaListViewItemGroup.d.ts +8 -0
  115. package/dist/lib/plugins/openapi/SchemaListViewItemGroup.js +17 -0
  116. package/dist/lib/plugins/openapi/SchemaListViewItemGroup.js.map +1 -0
  117. package/dist/lib/plugins/openapi/Sidecar.js +10 -8
  118. package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
  119. package/dist/lib/plugins/openapi/{Select.d.ts → SimpleSelect.d.ts} +3 -2
  120. package/dist/lib/plugins/openapi/SimpleSelect.js +5 -0
  121. package/dist/lib/plugins/openapi/SimpleSelect.js.map +1 -0
  122. package/dist/lib/plugins/openapi/client/createMemoryClient.d.ts +12 -0
  123. package/dist/lib/plugins/openapi/client/createMemoryClient.js +46 -0
  124. package/dist/lib/plugins/openapi/client/createMemoryClient.js.map +1 -0
  125. package/dist/lib/plugins/openapi/client/createServer.d.ts +4 -0
  126. package/dist/lib/plugins/openapi/client/createServer.js +30 -0
  127. package/dist/lib/plugins/openapi/client/createServer.js.map +1 -0
  128. package/dist/lib/plugins/openapi/client/createWorkerClient.d.ts +10 -0
  129. package/dist/lib/plugins/openapi/{worker/createSharedWorkerClient.js → client/createWorkerClient.js} +11 -2
  130. package/dist/lib/plugins/openapi/client/createWorkerClient.js.map +1 -0
  131. package/dist/lib/plugins/openapi/client/interfaces.d.ts +2 -0
  132. package/dist/lib/plugins/openapi/client/interfaces.js +2 -0
  133. package/dist/lib/plugins/openapi/client/interfaces.js.map +1 -0
  134. package/dist/lib/plugins/openapi/{worker → client}/worker.js +2 -2
  135. package/dist/lib/plugins/openapi/client/worker.js.map +1 -0
  136. package/dist/lib/plugins/openapi/context.d.ts +5 -0
  137. package/dist/lib/plugins/openapi/context.js +11 -0
  138. package/dist/lib/plugins/openapi/context.js.map +1 -0
  139. package/dist/lib/plugins/openapi/index.d.ts +1 -19
  140. package/dist/lib/plugins/openapi/index.js +27 -20
  141. package/dist/lib/plugins/openapi/index.js.map +1 -1
  142. package/dist/lib/plugins/openapi/interfaces.d.ts +15 -0
  143. package/dist/lib/plugins/openapi/interfaces.js +2 -0
  144. package/dist/lib/plugins/openapi/interfaces.js.map +1 -0
  145. package/dist/lib/plugins/openapi/playground/Headers.d.ts +2 -3
  146. package/dist/lib/plugins/openapi/playground/Headers.js +16 -6
  147. package/dist/lib/plugins/openapi/playground/Headers.js.map +1 -1
  148. package/dist/lib/plugins/openapi/playground/PathParams.d.ts +1 -1
  149. package/dist/lib/plugins/openapi/playground/Playground.d.ts +4 -3
  150. package/dist/lib/plugins/openapi/playground/Playground.js +8 -12
  151. package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
  152. package/dist/lib/plugins/openapi/playground/PlaygroundDialog.d.ts +3 -0
  153. package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js +10 -0
  154. package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js.map +1 -0
  155. package/dist/lib/plugins/openapi/playground/QueryParams.d.ts +1 -1
  156. package/dist/lib/plugins/openapi/playground/createUrl.d.ts +1 -1
  157. package/dist/lib/plugins/openapi/util/prose.d.ts +1 -0
  158. package/dist/lib/plugins/openapi/util/prose.js +4 -0
  159. package/dist/lib/plugins/openapi/util/prose.js.map +1 -0
  160. package/dist/lib/plugins/openapi-worker.d.ts +1 -1
  161. package/dist/lib/plugins/openapi-worker.js +1 -1
  162. package/dist/lib/plugins/openapi-worker.js.map +1 -1
  163. package/dist/lib/ui/Callout.js +1 -1
  164. package/dist/lib/ui/Callout.js.map +1 -1
  165. package/dist/lib/ui/button-variants.d.ts +1 -1
  166. package/dist/lib/util/MdxComponents.js +1 -1
  167. package/dist/lib/util/MdxComponents.js.map +1 -1
  168. package/dist/lib/util/logInit.d.ts +1 -0
  169. package/dist/lib/util/logInit.js +9 -0
  170. package/dist/lib/util/logInit.js.map +1 -0
  171. package/dist/lib/util/objectEntries.d.ts +4 -0
  172. package/dist/lib/util/objectEntries.js +2 -0
  173. package/dist/lib/util/objectEntries.js.map +1 -0
  174. package/dist/lib/util/renderIf.d.ts +1 -0
  175. package/dist/lib/util/renderIf.js +2 -0
  176. package/dist/lib/util/renderIf.js.map +1 -0
  177. package/dist/vite/build.js +4 -1
  178. package/dist/vite/build.js.map +1 -1
  179. package/dist/vite/config.d.ts +11 -8
  180. package/dist/vite/config.js +58 -50
  181. package/dist/vite/config.js.map +1 -1
  182. package/dist/vite/config.test.js +7 -4
  183. package/dist/vite/config.test.js.map +1 -1
  184. package/dist/vite/dev-server.js +4 -4
  185. package/dist/vite/dev-server.js.map +1 -1
  186. package/dist/vite/html.js +0 -1
  187. package/dist/vite/html.js.map +1 -1
  188. package/dist/vite/plugin-api-keys.js +7 -8
  189. package/dist/vite/plugin-api-keys.js.map +1 -1
  190. package/dist/vite/plugin-api.js +7 -11
  191. package/dist/vite/plugin-api.js.map +1 -1
  192. package/dist/vite/plugin-auth.js +5 -6
  193. package/dist/vite/plugin-auth.js.map +1 -1
  194. package/dist/vite/plugin-component.js +1 -1
  195. package/dist/vite/plugin-component.js.map +1 -1
  196. package/dist/vite/plugin-config.d.ts +0 -1
  197. package/dist/vite/plugin-config.js +13 -7
  198. package/dist/vite/plugin-config.js.map +1 -1
  199. package/dist/vite/plugin-docs.js +9 -8
  200. package/dist/vite/plugin-docs.js.map +1 -1
  201. package/dist/vite/plugin-docs.test.js +1 -1
  202. package/dist/vite/plugin-docs.test.js.map +1 -1
  203. package/dist/vite/plugin-html.js +1 -9
  204. package/dist/vite/plugin-html.js.map +1 -1
  205. package/dist/vite/plugin-mdx.d.ts +3 -1
  206. package/dist/vite/plugin-mdx.js +4 -4
  207. package/dist/vite/plugin-mdx.js.map +1 -1
  208. package/dist/vite/plugin-openapi-worker.js +11 -3
  209. package/dist/vite/plugin-openapi-worker.js.map +1 -1
  210. package/dist/vite/plugin-redirect.js +9 -9
  211. package/dist/vite/plugin-redirect.js.map +1 -1
  212. package/dist/vite/plugin.js +1 -1
  213. package/dist/vite/plugin.js.map +1 -1
  214. package/lib/AnchorLink-ptdQk87q.js +706 -0
  215. package/lib/AnchorLink-ptdQk87q.js.map +1 -0
  216. package/lib/DevPortalProvider-BMk-RCE0.js +1081 -0
  217. package/lib/DevPortalProvider-BMk-RCE0.js.map +1 -0
  218. package/lib/Markdown-DDmW47R9.js +8621 -0
  219. package/lib/Markdown-DDmW47R9.js.map +1 -0
  220. package/lib/MdxComponents-C0R6zobS.js +3019 -0
  221. package/lib/MdxComponents-C0R6zobS.js.map +1 -0
  222. package/lib/MdxPage-DyJAHF9y.js +217 -0
  223. package/lib/MdxPage-DyJAHF9y.js.map +1 -0
  224. package/lib/OperationList-Dz9rHM9r.js +5546 -0
  225. package/lib/OperationList-Dz9rHM9r.js.map +1 -0
  226. package/lib/Route-CN_7-e5r.js +14 -0
  227. package/lib/Route-CN_7-e5r.js.map +1 -0
  228. package/lib/Select-D-Jtx53Q.js +4572 -0
  229. package/lib/Select-D-Jtx53Q.js.map +1 -0
  230. package/lib/Spinner-BG1JnYy0.js +182 -0
  231. package/lib/Spinner-BG1JnYy0.js.map +1 -0
  232. package/lib/_commonjsHelpers-BkfeUUK-.js +1 -0
  233. package/lib/_commonjsHelpers-BkfeUUK-.js.map +1 -0
  234. package/lib/assets/index-BPdJm2ty.js +1 -0
  235. package/lib/assets/index-BPdJm2ty.js.map +1 -0
  236. package/lib/assets/{worker-BCcpCNJ7.js → worker-BXS8hiSM.js} +9844 -9800
  237. package/lib/assets/worker-BXS8hiSM.js.map +1 -0
  238. package/lib/cn-DpqTslo9.js +2342 -0
  239. package/lib/cn-DpqTslo9.js.map +1 -0
  240. package/lib/context-_fYfJFgk.js +14 -0
  241. package/lib/context-_fYfJFgk.js.map +1 -0
  242. package/lib/hook-BzBeIPL4.js +25 -0
  243. package/lib/hook-BzBeIPL4.js.map +1 -0
  244. package/lib/index-BaOOUFsA.js +412 -0
  245. package/lib/index-BaOOUFsA.js.map +1 -0
  246. package/lib/index-CPvRaBBB.js +713 -0
  247. package/lib/index-CPvRaBBB.js.map +1 -0
  248. package/lib/index-Cpdpun6t.js +710 -0
  249. package/lib/index-Cpdpun6t.js.map +1 -0
  250. package/lib/index-DLS6fPwU.js +464 -0
  251. package/lib/index-DLS6fPwU.js.map +1 -0
  252. package/lib/jsx-runtime-SV6hXQua.js +3009 -0
  253. package/lib/jsx-runtime-SV6hXQua.js.map +1 -0
  254. package/lib/loglevel-CA34MiFn.js +153 -0
  255. package/lib/loglevel-CA34MiFn.js.map +1 -0
  256. package/lib/prism-bash.min-DadFsM4Z.js +1 -0
  257. package/lib/prism-bash.min-DadFsM4Z.js.map +1 -0
  258. package/lib/prism-csharp.min-Yizuc34Y.js +35 -0
  259. package/lib/prism-csharp.min-Yizuc34Y.js.map +1 -0
  260. package/lib/prism-java.min-d5iT_mOd.js +1 -0
  261. package/lib/prism-java.min-d5iT_mOd.js.map +1 -0
  262. package/lib/prism-json.min-B1GJqK1k.js +1 -0
  263. package/lib/prism-json.min-B1GJqK1k.js.map +1 -0
  264. package/lib/prism-markup-templating-DZrrEs0A.js +1 -0
  265. package/lib/prism-markup-templating-DZrrEs0A.js.map +1 -0
  266. package/lib/prism-objectivec.min-BXSWqpJJ.js +2 -0
  267. package/lib/prism-objectivec.min-BXSWqpJJ.js.map +1 -0
  268. package/lib/prism-php.min-o7FpoMP_.js +1 -0
  269. package/lib/prism-php.min-o7FpoMP_.js.map +1 -0
  270. package/lib/prism-ruby.min-C7LwcKyz.js +1 -0
  271. package/lib/prism-ruby.min-C7LwcKyz.js.map +1 -0
  272. package/lib/{state-oycsxkHz.js → state-Ds_OxRHP.js} +20 -18
  273. package/lib/state-Ds_OxRHP.js.map +1 -0
  274. package/lib/urql-DMlBWUKL.js +1 -0
  275. package/lib/urql-DMlBWUKL.js.map +1 -0
  276. package/lib/util-CCWvaWo7.js +41 -0
  277. package/lib/util-CCWvaWo7.js.map +1 -0
  278. package/lib/zudoku.auth-auth0.js +3 -1
  279. package/lib/zudoku.auth-auth0.js.map +1 -0
  280. package/lib/zudoku.auth-clerk.js +11 -8
  281. package/lib/zudoku.auth-clerk.js.map +1 -0
  282. package/lib/zudoku.auth-openid.js +444 -588
  283. package/lib/zudoku.auth-openid.js.map +1 -0
  284. package/lib/zudoku.components.js +429 -334
  285. package/lib/zudoku.components.js.map +1 -0
  286. package/lib/zudoku.openapi-worker.js +16 -13
  287. package/lib/zudoku.openapi-worker.js.map +1 -0
  288. package/lib/zudoku.plugin-api-keys.js +296 -0
  289. package/lib/zudoku.plugin-api-keys.js.map +1 -0
  290. package/lib/zudoku.plugin-markdown.js +52 -0
  291. package/lib/zudoku.plugin-markdown.js.map +1 -0
  292. package/lib/zudoku.plugin-openapi.js +8 -0
  293. package/lib/zudoku.plugin-openapi.js.map +1 -0
  294. package/lib/zudoku.plugin-redirect.js +12 -0
  295. package/lib/zudoku.plugin-redirect.js.map +1 -0
  296. package/package.json +21 -6
  297. package/src/app/demo-cdn.html +26 -0
  298. package/src/app/demo.html +18 -0
  299. package/src/app/demo.tsx +40 -0
  300. package/src/app/main.css +74 -0
  301. package/src/app/main.tsx +42 -9
  302. package/src/app/standalone.html +20 -0
  303. package/src/app/standalone.tsx +46 -0
  304. package/src/app/tailwind.ts +1 -11
  305. package/src/lib/authentication/Callback.tsx +1 -1
  306. package/src/lib/authentication/authentication.ts +2 -5
  307. package/src/lib/authentication/hook.ts +1 -0
  308. package/src/lib/authentication/providers/auth0.tsx +1 -0
  309. package/src/lib/authentication/providers/clerk.tsx +2 -0
  310. package/src/lib/authentication/providers/openid.tsx +3 -1
  311. package/src/lib/authentication/state.ts +2 -0
  312. package/src/lib/components/DevPortal.tsx +23 -30
  313. package/src/lib/components/Header.tsx +7 -7
  314. package/src/lib/components/Heading.tsx +26 -7
  315. package/src/lib/components/Layout.tsx +3 -4
  316. package/src/lib/components/Router.tsx +3 -7
  317. package/src/lib/components/SyntaxHighlight.tsx +5 -1
  318. package/src/lib/components/TopNavigation.tsx +5 -0
  319. package/src/lib/components/context/DevPortalProvider.ts +2 -2
  320. package/src/lib/components/index.ts +9 -3
  321. package/src/lib/core/DevPortalContext.ts +42 -12
  322. package/src/lib/core/plugins.ts +10 -5
  323. package/src/lib/errors/ErrorAlert.tsx +21 -0
  324. package/src/lib/errors/RouterError.tsx +12 -0
  325. package/src/lib/errors/TopLevelError.tsx +8 -0
  326. package/src/lib/oas/graphql/index.ts +2 -2
  327. package/src/lib/oas/parser/index.ts +3 -1
  328. package/src/lib/plugins/{api-key → api-keys}/CreateApiKey.tsx +2 -8
  329. package/src/lib/plugins/{api-key → api-keys}/SettingsApiKeys.tsx +21 -14
  330. package/src/lib/plugins/{api-key → api-keys}/index.tsx +54 -8
  331. package/src/lib/plugins/markdown/MdxPage.tsx +52 -35
  332. package/src/lib/plugins/markdown/Toc.tsx +1 -1
  333. package/src/lib/plugins/markdown/generateRoutes.tsx +15 -5
  334. package/src/lib/plugins/markdown/index.tsx +8 -1
  335. package/src/lib/plugins/openapi/OperationList.tsx +10 -4
  336. package/src/lib/plugins/openapi/OperationListItem.tsx +66 -41
  337. package/src/lib/plugins/openapi/ParameterList.tsx +1 -1
  338. package/src/lib/plugins/openapi/ParameterListItem.tsx +3 -4
  339. package/src/lib/plugins/openapi/{MakeRequest.tsx → PlaygroundDialogWrapper.tsx} +4 -4
  340. package/src/lib/plugins/openapi/RequestBodySidecarBox.tsx +2 -16
  341. package/src/lib/plugins/openapi/ResponsesSidecarBox.tsx +3 -1
  342. package/src/lib/plugins/openapi/Route.tsx +21 -0
  343. package/src/lib/plugins/openapi/SchemaListView.tsx +15 -182
  344. package/src/lib/plugins/openapi/SchemaListViewItem.tsx +110 -0
  345. package/src/lib/plugins/openapi/SchemaListViewItemGroup.tsx +63 -0
  346. package/src/lib/plugins/openapi/Sidecar.tsx +15 -10
  347. package/src/lib/plugins/openapi/{Select.tsx → SimpleSelect.tsx} +6 -3
  348. package/src/lib/plugins/openapi/client/createMemoryClient.ts +56 -0
  349. package/src/lib/plugins/openapi/client/createServer.ts +33 -0
  350. package/src/lib/plugins/openapi/{worker/createSharedWorkerClient.ts → client/createWorkerClient.ts} +13 -1
  351. package/src/lib/plugins/openapi/client/interfaces.ts +3 -0
  352. package/src/lib/plugins/openapi/{worker → client}/worker.ts +3 -3
  353. package/src/lib/plugins/openapi/context.tsx +16 -0
  354. package/src/lib/plugins/openapi/index.tsx +37 -51
  355. package/src/lib/plugins/openapi/interfaces.ts +9 -0
  356. package/src/lib/plugins/openapi/playground/Headers.tsx +60 -33
  357. package/src/lib/plugins/openapi/playground/PathParams.tsx +1 -1
  358. package/src/lib/plugins/openapi/playground/Playground.tsx +158 -193
  359. package/src/lib/plugins/openapi/playground/PlaygroundDialog.tsx +34 -0
  360. package/src/lib/plugins/openapi/playground/QueryParams.tsx +1 -1
  361. package/src/lib/plugins/openapi/playground/createUrl.ts +1 -1
  362. package/src/lib/plugins/openapi/util/prose.ts +7 -0
  363. package/src/lib/plugins/openapi-worker.ts +1 -1
  364. package/src/lib/ui/Callout.tsx +2 -2
  365. package/src/lib/util/MdxComponents.tsx +1 -2
  366. package/src/lib/util/logInit.ts +9 -0
  367. package/src/lib/util/objectEntries.ts +5 -0
  368. package/src/lib/util/renderIf.ts +4 -0
  369. package/dist/app/App.d.ts +0 -2
  370. package/dist/app/App.js +0 -29
  371. package/dist/app/App.js.map +0 -1
  372. package/dist/lib/components/Link.d.ts +0 -1
  373. package/dist/lib/components/Link.js +0 -2
  374. package/dist/lib/components/Link.js.map +0 -1
  375. package/dist/lib/core/helmet.d.ts +0 -4
  376. package/dist/lib/core/helmet.js +0 -5
  377. package/dist/lib/core/helmet.js.map +0 -1
  378. package/dist/lib/core/icons.d.ts +0 -1
  379. package/dist/lib/core/icons.js +0 -2
  380. package/dist/lib/core/icons.js.map +0 -1
  381. package/dist/lib/core/router.d.ts +0 -1
  382. package/dist/lib/core/router.js +0 -2
  383. package/dist/lib/core/router.js.map +0 -1
  384. package/dist/lib/plugins/api-key/CreateApiKey.d.ts +0 -5
  385. package/dist/lib/plugins/api-key/CreateApiKey.js.map +0 -1
  386. package/dist/lib/plugins/api-key/SettingsApiKeys.d.ts +0 -5
  387. package/dist/lib/plugins/api-key/SettingsApiKeys.js +0 -38
  388. package/dist/lib/plugins/api-key/SettingsApiKeys.js.map +0 -1
  389. package/dist/lib/plugins/api-key/index.js.map +0 -1
  390. package/dist/lib/plugins/index.d.ts +0 -4
  391. package/dist/lib/plugins/index.js +0 -5
  392. package/dist/lib/plugins/index.js.map +0 -1
  393. package/dist/lib/plugins/openapi/MakeRequest.js.map +0 -1
  394. package/dist/lib/plugins/openapi/Select.js +0 -5
  395. package/dist/lib/plugins/openapi/Select.js.map +0 -1
  396. package/dist/lib/plugins/openapi/worker/createSharedWorkerClient.d.ts +0 -5
  397. package/dist/lib/plugins/openapi/worker/createSharedWorkerClient.js.map +0 -1
  398. package/dist/lib/plugins/openapi/worker/shared-worker.d.ts +0 -1
  399. package/dist/lib/plugins/openapi/worker/shared-worker.js +0 -6
  400. package/dist/lib/plugins/openapi/worker/shared-worker.js.map +0 -1
  401. package/dist/lib/plugins/openapi/worker/worker.js.map +0 -1
  402. package/dist/vite/common.d.ts +0 -1
  403. package/dist/vite/common.js +0 -5
  404. package/dist/vite/common.js.map +0 -1
  405. package/lib/Spinner-7LezPqGn.js +0 -8393
  406. package/lib/clerk-Wslx_mPo.js +0 -19685
  407. package/lib/index-DNx3xWa2.js +0 -3461
  408. package/lib/zudoku.plugins.js +0 -19863
  409. package/src/app/App.tsx +0 -40
  410. package/src/lib/components/Link.tsx +0 -1
  411. package/src/lib/core/helmet.ts +0 -5
  412. package/src/lib/core/icons.tsx +0 -1
  413. package/src/lib/core/router.tsx +0 -1
  414. package/src/lib/plugins/index.ts +0 -4
  415. package/src/lib/plugins/openapi/worker/shared-worker.ts +0 -5
  416. /package/dist/lib/plugins/{api-key → api-keys}/index.d.ts +0 -0
  417. /package/dist/lib/plugins/openapi/{worker → client}/worker.d.ts +0 -0
@@ -2,16 +2,15 @@ import { QueryClient } from "@tanstack/react-query";
2
2
  import { type ReactNode } from "react";
3
3
  import { create } from "zustand";
4
4
  import { type AuthenticationProvider } from "../authentication/authentication.js";
5
+ import type { ComponentsContextType } from "../components/context/ComponentsContext.js";
6
+ import { type DevPortalPath } from "../components/DevPortal.js";
7
+ import type { MdxComponentsType } from "../util/MdxComponents.js";
5
8
  import {
6
- type DevPortalPath,
7
- type DevPortalProps,
8
- } from "../components/DevPortal.js";
9
- import {
9
+ type DevPortalPlugin,
10
10
  isApiIdentityPlugin,
11
11
  isNavigationPlugin,
12
- needsInitialization,
13
- type DevPortalPlugin,
14
12
  type NavigationPlugin,
13
+ needsInitialization,
15
14
  } from "./plugins.js";
16
15
 
17
16
  export interface ApiIdentity {
@@ -66,28 +65,59 @@ export const useRoutingState = create<RoutingState>(() => ({}));
66
65
  export type ApiKeyCache = "api-keys";
67
66
  export type DevPortalCacheKey = ApiKeyCache | string;
68
67
 
68
+ export type ZudokuContextMetadataOptions = Partial<{
69
+ title: string;
70
+ description: string;
71
+ logo: string;
72
+ favicon: string;
73
+ generator: string;
74
+ applicationName: string;
75
+ referrer: string;
76
+ keywords: string[];
77
+ authors: string[];
78
+ creator: string;
79
+ publisher: string;
80
+ }>;
81
+ export type ZudokuContextPageOptions = Partial<{
82
+ pageTitle?: string;
83
+ logo?: string;
84
+ }>;
85
+ export type ZudokuContextOptions = {
86
+ metadata?: ZudokuContextMetadataOptions;
87
+ page?: ZudokuContextPageOptions;
88
+ authentication?: AuthenticationProvider;
89
+ navigation: NavigationItem[];
90
+ plugins?: DevPortalPlugin[];
91
+ mdxComponents?: MdxComponentsType;
92
+ overrides?: ComponentsContextType;
93
+ };
94
+
69
95
  export class DevPortalContext {
70
96
  private plugins: DevPortalPlugin[] = [];
71
97
  private navigationPlugins: NavigationPlugin[];
72
98
 
73
99
  public navigation: NavigationItem[];
74
- public meta: DevPortalProps["meta"];
100
+ public meta: ZudokuContextOptions["metadata"];
101
+ public page: ZudokuContextOptions["page"];
75
102
  public authentication?: AuthenticationProvider;
76
103
  public state: typeof useRoutingState;
77
104
 
78
- constructor(config: DevPortalProps) {
105
+ constructor(config: ZudokuContextOptions) {
79
106
  this.plugins = config.plugins ?? [];
80
107
  this.navigation = config.navigation;
81
108
  this.navigationPlugins = this.plugins.filter(isNavigationPlugin);
82
109
  this.authentication = config.authentication;
83
- this.meta = config.meta;
110
+ this.meta = config.metadata;
111
+ this.page = config.page;
84
112
  this.state = useRoutingState;
85
113
  }
86
114
 
87
115
  initialize = async () => {
88
- this.plugins
89
- .filter(needsInitialization)
90
- .forEach((plugin) => plugin.initialize(this));
116
+ await Promise.all([
117
+ this.plugins
118
+ .filter(needsInitialization)
119
+ .map((plugin) => plugin.initialize?.(this)),
120
+ ]);
91
121
  };
92
122
 
93
123
  invalidateCache = async (key: DevPortalCacheKey[]) => {
@@ -1,3 +1,4 @@
1
+ import { type ReactElement } from "react";
1
2
  import { type RouteObject } from "react-router-dom";
2
3
  import {
3
4
  DevPortalContext,
@@ -10,9 +11,9 @@ export type PluginNavigationCategory = {
10
11
  } & NavigationCategory;
11
12
 
12
13
  export type DevPortalPlugin =
14
+ | CommonPlugin
13
15
  | NavigationPlugin
14
- | ApiIdentityPlugin
15
- | InitializationPlugin;
16
+ | ApiIdentityPlugin;
16
17
 
17
18
  export interface NavigationPlugin {
18
19
  getRoutes: () => RouteObject[];
@@ -23,8 +24,9 @@ export interface ApiIdentityPlugin {
23
24
  getIdentities: (context: DevPortalContext) => Promise<ApiIdentity[]>;
24
25
  }
25
26
 
26
- export interface InitializationPlugin {
27
- initialize: (context: DevPortalContext) => Promise<void> | void;
27
+ export interface CommonPlugin {
28
+ initialize?: (context: DevPortalContext) => Promise<void> | void;
29
+ getHead?: () => ReactElement | undefined;
28
30
  }
29
31
 
30
32
  export const isNavigationPlugin = (
@@ -34,9 +36,12 @@ export const isNavigationPlugin = (
34
36
 
35
37
  export const needsInitialization = (
36
38
  obj: DevPortalPlugin,
37
- ): obj is InitializationPlugin =>
39
+ ): obj is CommonPlugin =>
38
40
  "initialize" in obj && typeof obj.initialize === "function";
39
41
 
42
+ export const hasHead = (obj: DevPortalPlugin): obj is CommonPlugin =>
43
+ "getHead" in obj && typeof obj.getHead === "function";
44
+
40
45
  export const isApiIdentityPlugin = (
41
46
  obj: DevPortalPlugin,
42
47
  ): obj is ApiIdentityPlugin =>
@@ -0,0 +1,21 @@
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;
5
+
6
+ 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">
8
+ <div className="mx-auto max-w-[85%] sm:max-w-[50%]">
9
+ <h1 className="text-4xl font-bold tracking-tight text-h1-text sm:text-5xl">
10
+ Something went wrong
11
+ </h1>
12
+ <p className="mt-5 text-h1-text">{message}</p>
13
+ {stack ? (
14
+ <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
+ {stack}
16
+ </pre>
17
+ ) : null}
18
+ </div>
19
+ </div>
20
+ );
21
+ }
@@ -0,0 +1,12 @@
1
+ import { useRouteError } from "react-router-dom";
2
+ import { Layout } from "../components/Layout.js";
3
+ import { ErrorAlert } from "./ErrorAlert.js";
4
+
5
+ export function RouterError() {
6
+ const error = useRouteError();
7
+ return (
8
+ <Layout>
9
+ <ErrorAlert error={error} />
10
+ </Layout>
11
+ );
12
+ }
@@ -0,0 +1,8 @@
1
+ import { FallbackProps } from "react-error-boundary";
2
+ import { ErrorAlert } from "./ErrorAlert.js";
3
+
4
+ export function TopLevelError({ error, resetErrorBoundary }: FallbackProps) {
5
+ // Call resetErrorBoundary() to reset the error boundary and retry the render.
6
+
7
+ return <ErrorAlert error={error} />;
8
+ }
@@ -45,7 +45,7 @@ export const slugifyOperation = (operation: OperationLike, tag?: string) => {
45
45
  );
46
46
  };
47
47
 
48
- const cache = new LRUCache<string, OpenAPIDocument>({
48
+ const cache = new LRUCache<string, Promise<OpenAPIDocument>>({
49
49
  ttl: 60 * 10 * 1000,
50
50
  ttlAutopurge: true,
51
51
  });
@@ -384,7 +384,7 @@ const loadOpenAPISchema = async (input: NonNullable<unknown>) => {
384
384
  return cache.get(hash)!;
385
385
  }
386
386
 
387
- const schema = await validate(input);
387
+ const schema = validate(input);
388
388
 
389
389
  cache.set(hash, schema);
390
390
 
@@ -54,7 +54,9 @@ const parseSchemaInput = async (
54
54
  return JSON.parse(schemaInput);
55
55
  }
56
56
  if (schemaInput.includes("://")) {
57
- const response = await fetch(schemaInput);
57
+ const response = await fetch(schemaInput, {
58
+ cache: "force-cache",
59
+ });
58
60
  return (await response.json()) as JSONSchema;
59
61
  }
60
62
  const yaml = await import("yaml");
@@ -12,17 +12,11 @@ import {
12
12
  SelectValue,
13
13
  } from "../../components/Select.js";
14
14
  import { Button } from "../../ui/Button.js";
15
- import { type ApiKeyPluginOptions, ApiKeyService } from "./index.js";
15
+ import { ApiKeyService } from "./index.js";
16
16
 
17
17
  type CreateApiKey = { description: string; expiresOn?: string };
18
18
 
19
- export const CreateApiKey = ({
20
- options,
21
- service,
22
- }: {
23
- options: ApiKeyPluginOptions;
24
- service: ApiKeyService;
25
- }) => {
19
+ export const CreateApiKey = ({ service }: { service: ApiKeyService }) => {
26
20
  const context = useDevPortal();
27
21
  const navigate = useNavigate();
28
22
  const form = useForm<CreateApiKey>({
@@ -8,21 +8,15 @@ import { useState } from "react";
8
8
  import { Link } from "react-router-dom";
9
9
  import { useDevPortal } from "../../components/context/DevPortalProvider.js";
10
10
  import { Button } from "../../ui/Button.js";
11
- import { Card } from "../../ui/Card.js";
12
- import { type ApiKeyPluginOptions, ApiKeyService } from "./index.js";
11
+ import { ApiKeyService } from "./index.js";
13
12
 
14
- export const SettingsApiKeys = ({
15
- options,
16
- service,
17
- }: {
18
- options: ApiKeyPluginOptions;
19
- service: ApiKeyService;
20
- }) => {
13
+ export const SettingsApiKeys = ({ service }: { service: ApiKeyService }) => {
21
14
  const context = useDevPortal();
22
15
  const queryClient = useQueryClient();
23
16
  const { data } = useSuspenseQuery({
24
17
  queryFn: () => service.getKeys(context),
25
18
  queryKey: ["api-keys"],
19
+ retry: false,
26
20
  });
27
21
 
28
22
  const deleteKeyMutation = useMutation({
@@ -39,7 +33,7 @@ export const SettingsApiKeys = ({
39
33
  });
40
34
 
41
35
  return (
42
- <div className="max-w-screen-lg pt-[--padding-content-top] pb-[--padding-content-bottom]">
36
+ <div className="max-w-screen-lg h-full pt-[--padding-content-top] pb-[--padding-content-bottom]">
43
37
  <div className="flex justify-between mb-4 border-b border-border pb-3">
44
38
  <h1 className="font-medium text-2xl">API Keys</h1>
45
39
  {service.createKey && (
@@ -49,9 +43,22 @@ export const SettingsApiKeys = ({
49
43
  )}
50
44
  </div>
51
45
 
52
- <Card>
53
- <ul className="grid grid-cols-[min-content_1fr_min-content] ">
54
- {data.map((key) => (
46
+ {data.length === 0 ? (
47
+ <div className="flex flex-col justify-center gap-4 items-center h-1/2 my-8">
48
+ <div className="text-center">
49
+ No API keys created yet.
50
+ <br />
51
+ Get started and create the first one now
52
+ </div>
53
+ {service.createKey && (
54
+ <Button asChild>
55
+ <Link to="/settings/api-keys/new">Create API Key</Link>
56
+ </Button>
57
+ )}
58
+ </div>
59
+ ) : (
60
+ <ul className="grid grid-cols-[minmax(250px,min-content)_1fr_min-content] ">
61
+ {data.map((key: any) => (
55
62
  <li
56
63
  className="border-b border-border p-5 grid grid-cols-subgrid col-span-full gap-2 items-center"
57
64
  key={key.id}
@@ -100,7 +107,7 @@ export const SettingsApiKeys = ({
100
107
  </li>
101
108
  ))}
102
109
  </ul>
103
- </Card>
110
+ )}
104
111
  </div>
105
112
  );
106
113
  };
@@ -1,8 +1,13 @@
1
+ import logger from "loglevel";
2
+ import { Outlet, useRouteError } from "react-router-dom";
3
+ import invariant from "tiny-invariant";
4
+ import { useAuth } from "../../authentication/hook.js";
1
5
  import { DevPortalContext } from "../../core/DevPortalContext.js";
2
6
  import {
3
7
  type ApiIdentityPlugin,
4
8
  type DevPortalPlugin,
5
9
  } from "../../core/plugins.js";
10
+ import { Button } from "../../ui/Button.js";
6
11
  import { CreateApiKey } from "./CreateApiKey.js";
7
12
  import { SettingsApiKeys } from "./SettingsApiKeys.js";
8
13
 
@@ -47,7 +52,8 @@ const createDefaultHandler = (endpoint: string): ApiKeyService => {
47
52
 
48
53
  await context.signRequest(request);
49
54
 
50
- await fetch(request);
55
+ const response = await fetch(request);
56
+ invariant(response.ok, "Failed to delete API key");
51
57
  },
52
58
  createKey: async (apiKey, context) => {
53
59
  const request = new Request(endpoint + `/v1/developer/api-keys`, {
@@ -59,7 +65,9 @@ const createDefaultHandler = (endpoint: string): ApiKeyService => {
59
65
  });
60
66
 
61
67
  await context.signRequest(request);
62
- await fetch(request);
68
+
69
+ const response = await fetch(request);
70
+ invariant(response.ok, "Failed to create API key");
63
71
  },
64
72
  getKeys: async (context) => {
65
73
  const request = new Request(endpoint + `/v1/developer/api-keys`);
@@ -67,12 +75,43 @@ const createDefaultHandler = (endpoint: string): ApiKeyService => {
67
75
  await context.signRequest(request);
68
76
 
69
77
  const keys = await fetch(request);
78
+ invariant(keys.ok, "Failed to fetch API keys");
70
79
 
71
80
  return await keys.json();
72
81
  },
73
82
  };
74
83
  };
75
84
 
85
+ const ProtectedRoute = () => {
86
+ const auth = useAuth();
87
+
88
+ // TODO: should we suspend here somehow?
89
+ if (auth.isPending) {
90
+ return null;
91
+ }
92
+
93
+ return auth.isAuthenticated ? (
94
+ <Outlet />
95
+ ) : (
96
+ <div className="flex flex-col justify-center gap-2 items-center h-1/2 my-12">
97
+ Please login first to view this page
98
+ <Button onClick={() => auth.login()}>Login</Button>
99
+ </div>
100
+ );
101
+ };
102
+
103
+ const SettingsErrorBoundary = () => {
104
+ const error = useRouteError();
105
+ logger.error(String(error));
106
+
107
+ return (
108
+ <div className="flex flex-col justify-center gap-2 items-center h-1/2 my-12">
109
+ <h1>Something went wrong</h1>
110
+ {error instanceof Error && <p>{error.message}</p>}
111
+ </div>
112
+ );
113
+ };
114
+
76
115
  export const apiKeyPlugin = (
77
116
  options: ApiKeyPluginOptions,
78
117
  ): DevPortalPlugin & ApiIdentityPlugin => {
@@ -100,14 +139,21 @@ export const apiKeyPlugin = (
100
139
  }
101
140
  },
102
141
  getRoutes: () => {
142
+ // TODO: Make lazy
103
143
  return [
104
144
  {
105
- path: "/settings/api-keys",
106
- element: <SettingsApiKeys options={options} service={service} />,
107
- },
108
- {
109
- path: "/settings/api-keys/new",
110
- element: <CreateApiKey options={options} service={service} />,
145
+ element: <ProtectedRoute />,
146
+ errorElement: <SettingsErrorBoundary />,
147
+ children: [
148
+ {
149
+ path: "/settings/api-keys",
150
+ element: <SettingsApiKeys service={service} />,
151
+ },
152
+ {
153
+ path: "/settings/api-keys/new",
154
+ element: <CreateApiKey service={service} />,
155
+ },
156
+ ],
111
157
  },
112
158
  ];
113
159
  },
@@ -1,18 +1,18 @@
1
1
  import { useMDXComponents } from "@mdx-js/react";
2
2
  import { useMemo, type PropsWithChildren, type ReactNode } from "react";
3
+ import { Helmet } from "react-helmet-async";
4
+ import { Link, useLocation } from "react-router-dom";
3
5
  import { CategoryHeading } from "../../components/CategoryHeading.js";
4
6
  import { Heading } from "../../components/Heading.js";
5
7
  import { ProseClasses } from "../../components/Markdown.js";
6
8
  import { useTopNavigationItem } from "../../components/context/DevPortalProvider.js";
7
9
  import { isPathItem } from "../../components/navigation/util.js";
8
- import { Helmet } from "../../core/helmet.js";
9
- import { Link, useLocation } from "../../core/router.js";
10
10
  import type { MdxComponentsType } from "../../util/MdxComponents.js";
11
11
  import { cn } from "../../util/cn.js";
12
12
  import slugify from "../../util/slugify.js";
13
13
  import { traverseNavigation } from "../../util/traverseNavigation.js";
14
14
  import { Toc } from "./Toc.js";
15
- import type { MDXImport } from "./index.js";
15
+ import { MarkdownPluginDefaultOptions, MDXImport } from "./index.js";
16
16
 
17
17
  const MarkdownHeadings = {
18
18
  h2: ({ children, id }) => (
@@ -30,11 +30,13 @@ const MarkdownHeadings = {
30
30
 
31
31
  export const MdxPage = ({
32
32
  mdxComponent: MdxComponent,
33
- frontmatter,
33
+ frontmatter = {},
34
+ defaultOptions,
34
35
  tableOfContents,
35
36
  }: PropsWithChildren<
36
37
  Omit<MDXImport, "default"> & {
37
38
  mdxComponent: MDXImport["default"];
39
+ defaultOptions?: MarkdownPluginDefaultOptions;
38
40
  }
39
41
  >) => {
40
42
  const navItem = useTopNavigationItem();
@@ -50,10 +52,11 @@ export const MdxPage = ({
50
52
 
51
53
  const title = frontmatter.title;
52
54
  const category = frontmatter.category ?? categoryTitle;
53
- const hideToc = frontmatter.toc === false;
54
-
55
+ const hideToc = frontmatter.toc === false || defaultOptions?.toc === false;
55
56
  const pageTitle =
56
57
  tableOfContents.find((item) => item.depth === 1)?.value ?? title;
58
+ const hidePager =
59
+ frontmatter.disablePager ?? defaultOptions?.disablePager ?? false;
57
60
 
58
61
  const tocEntries =
59
62
  tableOfContents.find((item) => item.depth === 1)?.children ??
@@ -112,35 +115,49 @@ export const MdxPage = ({
112
115
  <MdxComponent
113
116
  components={{ ...useMDXComponents(), ...MarkdownHeadings }}
114
117
  />
115
- <hr />
116
- <div className="not-prose flex items-center justify-between gap-8">
117
- {prev.path ? (
118
- <Link
119
- to={prev.path}
120
- className="flex flex-col items-stretch gap-2 flex-1 truncate border border-border rounded px-6 py-4 text-start hover:border-primary/85 transition shadow-sm hover:shadow-md"
121
- title={typeof prev.label === "string" ? prev.label : undefined}
122
- >
123
- <div className="text-sm text-muted-foreground">
124
- Previous page
125
- </div>
126
- <div className="text-lg text-primary truncate">{prev.label}</div>
127
- </Link>
128
- ) : (
129
- <div className="flex-1" />
130
- )}
131
- {next.path ? (
132
- <Link
133
- to={next.path}
134
- className="flex flex-col items-stretch gap-2 flex-1 truncate border border-border rounded px-6 py-4 text-end hover:border-primary/85 transition shadow-sm hover:shadow-md"
135
- title={typeof next.label === "string" ? next.label : undefined}
136
- >
137
- <div className="text-sm text-muted-foreground">Next page →</div>
138
- <div className="text-lg text-primary truncate">{next.label}</div>
139
- </Link>
140
- ) : (
141
- <div className="flex-1" />
142
- )}
143
- </div>
118
+ {!hidePager && (
119
+ <>
120
+ <hr />
121
+ <div className="not-prose flex items-center justify-between gap-8">
122
+ {prev.path ? (
123
+ <Link
124
+ to={prev.path}
125
+ className="flex flex-col items-stretch gap-2 flex-1 truncate border border-border rounded px-6 py-4 text-start hover:border-primary/85 transition shadow-sm hover:shadow-md"
126
+ title={
127
+ typeof prev.label === "string" ? prev.label : undefined
128
+ }
129
+ >
130
+ <div className="text-sm text-muted-foreground">
131
+ Previous page
132
+ </div>
133
+ <div className="text-lg text-primary truncate">
134
+ {prev.label}
135
+ </div>
136
+ </Link>
137
+ ) : (
138
+ <div className="flex-1" />
139
+ )}
140
+ {next.path ? (
141
+ <Link
142
+ to={next.path}
143
+ className="flex flex-col items-stretch gap-2 flex-1 truncate border border-border rounded px-6 py-4 text-end hover:border-primary/85 transition shadow-sm hover:shadow-md"
144
+ title={
145
+ typeof next.label === "string" ? next.label : undefined
146
+ }
147
+ >
148
+ <div className="text-sm text-muted-foreground">
149
+ Next page →
150
+ </div>
151
+ <div className="text-lg text-primary truncate">
152
+ {next.label}
153
+ </div>
154
+ </Link>
155
+ ) : (
156
+ <div className="flex-1" />
157
+ )}
158
+ </div>
159
+ </>
160
+ )}
144
161
  </div>
145
162
  <div className="hidden xl:block">
146
163
  {showToc && <Toc entries={tocEntries} />}
@@ -1,4 +1,5 @@
1
1
  import type { TocEntry } from "@stefanprobst/rehype-extract-toc";
2
+ import { ListTreeIcon } from "lucide-react";
2
3
  import {
3
4
  useEffect,
4
5
  useRef,
@@ -8,7 +9,6 @@ import {
8
9
  } from "react";
9
10
  import { AnchorLink } from "../../components/AnchorLink.js";
10
11
  import { useViewportAnchor } from "../../components/context/ViewportAnchorContext.js";
11
- import { ListTreeIcon } from "../../core/icons.js";
12
12
  import { cn } from "../../util/cn.js";
13
13
 
14
14
  const DATA_ANCHOR_ATTR = "data-active";
@@ -1,12 +1,16 @@
1
+ import { Navigate, type RouteObject } from "react-router-dom";
1
2
  import { useTopNavigationItem } from "../../components/context/DevPortalProvider.js";
2
3
  import { isPathItem } from "../../components/navigation/util.js";
3
- import { Navigate, type RouteObject } from "../../core/router.js";
4
4
  import { traverseNavigation } from "../../util/traverseNavigation.js";
5
- import { MdxPage } from "./MdxPage.js";
6
- import type { MarkdownPluginOptions } from "./index.js";
5
+
6
+ import {
7
+ MarkdownPluginDefaultOptions,
8
+ MarkdownPluginOptions,
9
+ } from "./index.js";
7
10
 
8
11
  export const generateRoutes = (
9
12
  markdownFiles: MarkdownPluginOptions["markdownFiles"],
13
+ defaultOptions?: MarkdownPluginDefaultOptions,
10
14
  ): RouteObject[] => {
11
15
  const routes = Object.entries(markdownFiles).flatMap(
12
16
  ([file, importPromise]) => {
@@ -25,10 +29,16 @@ export const generateRoutes = (
25
29
  return {
26
30
  path: routePath,
27
31
  lazy: async () => {
32
+ const { MdxPage } = await import("./MdxPage.js");
28
33
  const { default: Component, ...props } = await importPromise();
29
-
30
34
  return {
31
- element: <MdxPage mdxComponent={Component} {...props} />,
35
+ element: (
36
+ <MdxPage
37
+ mdxComponent={Component}
38
+ {...props}
39
+ defaultOptions={defaultOptions}
40
+ />
41
+ ),
32
42
  };
33
43
  },
34
44
  } satisfies RouteObject;
@@ -5,13 +5,19 @@ import { generateRoutes } from "./generateRoutes.js";
5
5
 
6
6
  export type MarkdownPluginOptions = {
7
7
  markdownFiles: Record<string, () => Promise<MDXImport>>;
8
+ defaultOptions?: MarkdownPluginDefaultOptions;
8
9
  };
10
+ export type MarkdownPluginDefaultOptions = Pick<
11
+ Frontmatter,
12
+ "toc" | "disablePager"
13
+ >;
9
14
 
10
15
  export type Frontmatter = {
11
16
  title?: string;
12
17
  description?: string;
13
18
  category?: string;
14
19
  toc?: boolean;
20
+ disablePager?: boolean;
15
21
  };
16
22
 
17
23
  export type MDXImport = {
@@ -22,10 +28,11 @@ export type MDXImport = {
22
28
 
23
29
  export const markdownPlugin = ({
24
30
  markdownFiles,
31
+ defaultOptions,
25
32
  }: MarkdownPluginOptions): DevPortalPlugin => {
26
33
  return {
27
34
  getRoutes() {
28
- return generateRoutes(markdownFiles);
35
+ return generateRoutes(markdownFiles, defaultOptions);
29
36
  },
30
37
  };
31
38
  };
@@ -1,11 +1,12 @@
1
1
  import { ResultOf } from "@graphql-typed-document-node/core";
2
2
  import { CategoryHeading } from "../../components/CategoryHeading.js";
3
3
  import { Heading } from "../../components/Heading.js";
4
- import { Markdown, ProseClasses } from "../../components/Markdown.js";
4
+ import { Markdown } from "../../components/Markdown.js";
5
5
  import { cn } from "../../util/cn.js";
6
6
  import { OperationListItem } from "./OperationListItem.js";
7
+ import { useOasConfig } from "./context.js";
7
8
  import { graphql } from "./graphql/index.js";
8
- import { useOasConfig } from "./index.js";
9
+ import { SchemaProseClasses } from "./util/prose.js";
9
10
  import { useQuery } from "./util/urql.js";
10
11
 
11
12
  export const OperationsFragment = graphql(/* GraphQL */ `
@@ -94,7 +95,12 @@ export const OperationList = () => {
94
95
 
95
96
  return (
96
97
  <div className="pt-[--padding-content-top]">
97
- <div className={cn(ProseClasses, "mb-16")}>
98
+ <div
99
+ className={cn(
100
+ SchemaProseClasses,
101
+ "mb-16 max-w-full prose-img:max-w-prose",
102
+ )}
103
+ >
98
104
  <CategoryHeading>Overview</CategoryHeading>
99
105
  <Heading level={1} id="description" registerSidebarAnchor>
100
106
  {result.data.schema.title}
@@ -108,7 +114,7 @@ export const OperationList = () => {
108
114
  {tag.name && <CategoryHeading>{tag.name}</CategoryHeading>}
109
115
  {tag.description && (
110
116
  <Markdown
111
- className={`${ProseClasses} mt-2 mb-12`}
117
+ className={`${SchemaProseClasses} mt-2 mb-12`}
112
118
  content={tag.description}
113
119
  />
114
120
  )}