zudoku 0.3.0-dev.8 → 0.3.0-dev.80

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 (589) hide show
  1. package/dist/app/App.d.ts +1 -2
  2. package/dist/app/App.js +1 -29
  3. package/dist/app/App.js.map +1 -1
  4. package/dist/app/demo.d.ts +2 -0
  5. package/dist/app/demo.js +32 -0
  6. package/dist/app/demo.js.map +1 -0
  7. package/dist/app/entry.client.d.ts +2 -0
  8. package/dist/app/entry.client.js +35 -0
  9. package/dist/app/entry.client.js.map +1 -0
  10. package/dist/app/entry.server.d.ts +14 -0
  11. package/dist/app/entry.server.js +105 -0
  12. package/dist/app/entry.server.js.map +1 -0
  13. package/dist/app/main.d.ts +6 -1
  14. package/dist/app/main.js +72 -12
  15. package/dist/app/main.js.map +1 -1
  16. package/dist/app/standalone.d.ts +2 -0
  17. package/dist/app/standalone.js +37 -0
  18. package/dist/app/standalone.js.map +1 -0
  19. package/dist/app/tailwind.d.ts +1 -1
  20. package/dist/app/tailwind.js +0 -4
  21. package/dist/app/tailwind.js.map +1 -1
  22. package/dist/cli/cmds/dev.js +5 -0
  23. package/dist/cli/cmds/dev.js.map +1 -1
  24. package/dist/cli/dev/handler.d.ts +1 -0
  25. package/dist/cli/dev/handler.js +3 -1
  26. package/dist/cli/dev/handler.js.map +1 -1
  27. package/dist/config/config.d.ts +19 -45
  28. package/dist/config/validators/validate.d.ts +911 -2
  29. package/dist/config/validators/validate.js +151 -1
  30. package/dist/config/validators/validate.js.map +1 -1
  31. package/dist/internal.d.ts +1 -0
  32. package/dist/internal.js +2 -0
  33. package/dist/internal.js.map +1 -0
  34. package/dist/lib/authentication/AuthenticationPlugin.d.ts +13 -0
  35. package/dist/lib/authentication/AuthenticationPlugin.js +31 -0
  36. package/dist/lib/authentication/AuthenticationPlugin.js.map +1 -0
  37. package/dist/lib/authentication/authentication.d.ts +10 -9
  38. package/dist/lib/authentication/components/SignIn.d.ts +1 -0
  39. package/dist/lib/authentication/components/SignIn.js +14 -0
  40. package/dist/lib/authentication/components/SignIn.js.map +1 -0
  41. package/dist/lib/authentication/components/SignOut.d.ts +1 -0
  42. package/dist/lib/authentication/components/SignOut.js +12 -0
  43. package/dist/lib/authentication/components/SignOut.js.map +1 -0
  44. package/dist/lib/authentication/components/SignUp.d.ts +1 -0
  45. package/dist/lib/authentication/components/SignUp.js +10 -0
  46. package/dist/lib/authentication/components/SignUp.js.map +1 -0
  47. package/dist/lib/authentication/hook.js +2 -2
  48. package/dist/lib/authentication/hook.js.map +1 -1
  49. package/dist/lib/authentication/providers/auth0.js +11 -6
  50. package/dist/lib/authentication/providers/auth0.js.map +1 -1
  51. package/dist/lib/authentication/providers/clerk.js +59 -30
  52. package/dist/lib/authentication/providers/clerk.js.map +1 -1
  53. package/dist/lib/authentication/providers/openid.d.ts +30 -7
  54. package/dist/lib/authentication/providers/openid.js +78 -29
  55. package/dist/lib/authentication/providers/openid.js.map +1 -1
  56. package/dist/lib/authentication/state.js +1 -1
  57. package/dist/lib/authentication/state.js.map +1 -1
  58. package/dist/lib/components/Bootstrap.d.ts +13 -0
  59. package/dist/lib/components/Bootstrap.js +12 -0
  60. package/dist/lib/components/Bootstrap.js.map +1 -0
  61. package/dist/lib/components/DevPortal.d.ts +5 -19
  62. package/dist/lib/components/DevPortal.js +57 -15
  63. package/dist/lib/components/DevPortal.js.map +1 -1
  64. package/dist/lib/components/DeveloperHint.d.ts +5 -0
  65. package/dist/lib/components/DeveloperHint.js +10 -0
  66. package/dist/lib/components/DeveloperHint.js.map +1 -0
  67. package/dist/lib/components/ErrorPage.d.ts +6 -0
  68. package/dist/lib/components/ErrorPage.js +9 -0
  69. package/dist/lib/components/ErrorPage.js.map +1 -0
  70. package/dist/lib/components/Header.js +21 -3
  71. package/dist/lib/components/Header.js.map +1 -1
  72. package/dist/lib/components/Heading.d.ts +9 -4
  73. package/dist/lib/components/Heading.js +17 -2
  74. package/dist/lib/components/Heading.js.map +1 -1
  75. package/dist/lib/components/InlineCode.d.ts +5 -0
  76. package/dist/lib/components/InlineCode.js +4 -0
  77. package/dist/lib/components/InlineCode.js.map +1 -0
  78. package/dist/lib/components/Layout.js +4 -2
  79. package/dist/lib/components/Layout.js.map +1 -1
  80. package/dist/lib/components/NotFoundPage.d.ts +1 -0
  81. package/dist/lib/components/NotFoundPage.js +12 -0
  82. package/dist/lib/components/NotFoundPage.js.map +1 -0
  83. package/dist/lib/components/SlotletProvider.d.ts +9 -0
  84. package/dist/lib/components/SlotletProvider.js +11 -0
  85. package/dist/lib/components/SlotletProvider.js.map +1 -0
  86. package/dist/lib/components/SyntaxHighlight.d.ts +3 -2
  87. package/dist/lib/components/SyntaxHighlight.js +24 -22
  88. package/dist/lib/components/SyntaxHighlight.js.map +1 -1
  89. package/dist/lib/components/TopNavigation.d.ts +1 -1
  90. package/dist/lib/components/TopNavigation.js +5 -1
  91. package/dist/lib/components/TopNavigation.js.map +1 -1
  92. package/dist/lib/components/context/DevPortalProvider.d.ts +1 -1
  93. package/dist/lib/components/context/DevPortalProvider.js +20 -3
  94. package/dist/lib/components/context/DevPortalProvider.js.map +1 -1
  95. package/dist/lib/components/index.d.ts +32 -3
  96. package/dist/lib/components/index.js +21 -3
  97. package/dist/lib/components/index.js.map +1 -1
  98. package/dist/lib/components/navigation/SideNavigation.js +3 -2
  99. package/dist/lib/components/navigation/SideNavigation.js.map +1 -1
  100. package/dist/lib/components/navigation/SideNavigationCategory.js +3 -3
  101. package/dist/lib/components/navigation/SideNavigationCategory.js.map +1 -1
  102. package/dist/lib/components/navigation/SideNavigationItem.d.ts +0 -4
  103. package/dist/lib/components/navigation/SideNavigationItem.js +4 -4
  104. package/dist/lib/components/navigation/SideNavigationItem.js.map +1 -1
  105. package/dist/lib/components/navigation/useNavigationCollapsibleState.d.ts +4 -1
  106. package/dist/lib/components/navigation/useNavigationCollapsibleState.js +17 -5
  107. package/dist/lib/components/navigation/useNavigationCollapsibleState.js.map +1 -1
  108. package/dist/lib/core/DevPortalContext.d.ts +52 -13
  109. package/dist/lib/core/DevPortalContext.js +10 -14
  110. package/dist/lib/core/DevPortalContext.js.map +1 -1
  111. package/dist/lib/core/plugins.d.ts +22 -5
  112. package/dist/lib/core/plugins.js +3 -0
  113. package/dist/lib/core/plugins.js.map +1 -1
  114. package/dist/lib/errors/ErrorAlert.d.ts +3 -0
  115. package/dist/lib/errors/ErrorAlert.js +8 -0
  116. package/dist/lib/errors/ErrorAlert.js.map +1 -0
  117. package/dist/lib/errors/RouterError.d.ts +1 -0
  118. package/dist/lib/errors/RouterError.js +12 -0
  119. package/dist/lib/errors/RouterError.js.map +1 -0
  120. package/dist/lib/errors/ServerError.d.ts +3 -0
  121. package/dist/lib/errors/ServerError.js +6 -0
  122. package/dist/lib/errors/ServerError.js.map +1 -0
  123. package/dist/lib/errors/TopLevelError.d.ts +2 -0
  124. package/dist/lib/errors/TopLevelError.js +7 -0
  125. package/dist/lib/errors/TopLevelError.js.map +1 -0
  126. package/dist/lib/oas/graphql/index.js +8 -5
  127. package/dist/lib/oas/graphql/index.js.map +1 -1
  128. package/dist/lib/oas/parser/index.d.ts +1 -1
  129. package/dist/lib/oas/parser/index.js +38 -12
  130. package/dist/lib/oas/parser/index.js.map +1 -1
  131. package/dist/lib/plugins/{api-key → api-keys}/CreateApiKey.js +2 -2
  132. package/dist/lib/plugins/api-keys/CreateApiKey.js.map +1 -0
  133. package/dist/lib/plugins/api-keys/ProtectedRoute.d.ts +1 -0
  134. package/dist/lib/plugins/api-keys/ProtectedRoute.js +14 -0
  135. package/dist/lib/plugins/api-keys/ProtectedRoute.js.map +1 -0
  136. package/dist/lib/plugins/api-keys/SettingsApiKeys.js +40 -0
  137. package/dist/lib/plugins/api-keys/SettingsApiKeys.js.map +1 -0
  138. package/dist/lib/plugins/{api-key → api-keys}/index.d.ts +4 -5
  139. package/dist/lib/plugins/{api-key → api-keys}/index.js +12 -20
  140. package/dist/lib/plugins/api-keys/index.js.map +1 -0
  141. package/dist/lib/plugins/custom-page/index.d.ts +8 -0
  142. package/dist/lib/plugins/custom-page/index.js +12 -0
  143. package/dist/lib/plugins/custom-page/index.js.map +1 -0
  144. package/dist/lib/plugins/markdown/MdxPage.d.ts +3 -2
  145. package/dist/lib/plugins/markdown/MdxPage.js +7 -6
  146. package/dist/lib/plugins/markdown/MdxPage.js.map +1 -1
  147. package/dist/lib/plugins/markdown/Toc.js +17 -9
  148. package/dist/lib/plugins/markdown/Toc.js.map +1 -1
  149. package/dist/lib/plugins/markdown/generateRoutes.d.ts +3 -3
  150. package/dist/lib/plugins/markdown/generateRoutes.js +4 -4
  151. package/dist/lib/plugins/markdown/generateRoutes.js.map +1 -1
  152. package/dist/lib/plugins/markdown/index.d.ts +4 -1
  153. package/dist/lib/plugins/markdown/index.js +3 -7
  154. package/dist/lib/plugins/markdown/index.js.map +1 -1
  155. package/dist/lib/plugins/openapi/ColorizedParam.d.ts +2 -1
  156. package/dist/lib/plugins/openapi/ColorizedParam.js +14 -9
  157. package/dist/lib/plugins/openapi/ColorizedParam.js.map +1 -1
  158. package/dist/lib/plugins/openapi/OperationList.js +17 -5
  159. package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
  160. package/dist/lib/plugins/openapi/OperationListItem.js +10 -5
  161. package/dist/lib/plugins/openapi/OperationListItem.js.map +1 -1
  162. package/dist/lib/plugins/openapi/ParameterList.js +1 -1
  163. package/dist/lib/plugins/openapi/ParameterList.js.map +1 -1
  164. package/dist/lib/plugins/openapi/ParameterListItem.js +1 -1
  165. package/dist/lib/plugins/openapi/ParameterListItem.js.map +1 -1
  166. package/dist/lib/plugins/openapi/{MakeRequest.d.ts → PlaygroundDialogWrapper.d.ts} +2 -1
  167. package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.js +23 -0
  168. package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.js.map +1 -0
  169. package/dist/lib/plugins/openapi/RequestBodySidecarBox.js +3 -9
  170. package/dist/lib/plugins/openapi/RequestBodySidecarBox.js.map +1 -1
  171. package/dist/lib/plugins/openapi/ResponsesSidecarBox.js +1 -1
  172. package/dist/lib/plugins/openapi/ResponsesSidecarBox.js.map +1 -1
  173. package/dist/lib/plugins/openapi/Route.d.ts +6 -0
  174. package/dist/lib/plugins/openapi/Route.js +8 -0
  175. package/dist/lib/plugins/openapi/Route.js.map +1 -0
  176. package/dist/lib/plugins/openapi/SchemaListView.js +6 -27
  177. package/dist/lib/plugins/openapi/SchemaListView.js.map +1 -1
  178. package/dist/lib/plugins/openapi/SchemaListViewItem.d.ts +7 -0
  179. package/dist/lib/plugins/openapi/SchemaListViewItem.js +19 -0
  180. package/dist/lib/plugins/openapi/SchemaListViewItem.js.map +1 -0
  181. package/dist/lib/plugins/openapi/SchemaListViewItemGroup.d.ts +8 -0
  182. package/dist/lib/plugins/openapi/SchemaListViewItemGroup.js +17 -0
  183. package/dist/lib/plugins/openapi/SchemaListViewItemGroup.js.map +1 -0
  184. package/dist/lib/plugins/openapi/Sidecar.d.ts +4 -0
  185. package/dist/lib/plugins/openapi/Sidecar.js +43 -19
  186. package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
  187. package/dist/lib/plugins/openapi/SidecarBox.d.ts +1 -0
  188. package/dist/lib/plugins/openapi/SidecarBox.js +3 -2
  189. package/dist/lib/plugins/openapi/SidecarBox.js.map +1 -1
  190. package/dist/lib/plugins/openapi/{Select.d.ts → SimpleSelect.d.ts} +3 -2
  191. package/dist/lib/plugins/openapi/SimpleSelect.js +5 -0
  192. package/dist/lib/plugins/openapi/SimpleSelect.js.map +1 -0
  193. package/dist/lib/plugins/openapi/StaggeredRender.d.ts +8 -0
  194. package/dist/lib/plugins/openapi/StaggeredRender.js +18 -0
  195. package/dist/lib/plugins/openapi/StaggeredRender.js.map +1 -0
  196. package/dist/lib/plugins/openapi/client/createMemoryClient.d.ts +12 -0
  197. package/dist/lib/plugins/openapi/client/createMemoryClient.js +46 -0
  198. package/dist/lib/plugins/openapi/client/createMemoryClient.js.map +1 -0
  199. package/dist/lib/plugins/openapi/client/createServer.d.ts +4 -0
  200. package/dist/lib/plugins/openapi/client/createServer.js +30 -0
  201. package/dist/lib/plugins/openapi/client/createServer.js.map +1 -0
  202. package/dist/lib/plugins/openapi/client/createWorkerClient.d.ts +10 -0
  203. package/dist/lib/plugins/openapi/{worker/createSharedWorkerClient.js → client/createWorkerClient.js} +15 -2
  204. package/dist/lib/plugins/openapi/client/createWorkerClient.js.map +1 -0
  205. package/dist/lib/plugins/openapi/client/interfaces.d.ts +4 -0
  206. package/dist/lib/plugins/openapi/client/interfaces.js +2 -0
  207. package/dist/lib/plugins/openapi/client/interfaces.js.map +1 -0
  208. package/dist/lib/plugins/openapi/{worker → client}/worker.js +2 -2
  209. package/dist/lib/plugins/openapi/client/worker.js.map +1 -0
  210. package/dist/lib/plugins/openapi/context.d.ts +5 -0
  211. package/dist/lib/plugins/openapi/context.js +11 -0
  212. package/dist/lib/plugins/openapi/context.js.map +1 -0
  213. package/dist/lib/plugins/openapi/graphql/gql.d.ts +6 -6
  214. package/dist/lib/plugins/openapi/graphql/gql.js +1 -1
  215. package/dist/lib/plugins/openapi/graphql/gql.js.map +1 -1
  216. package/dist/lib/plugins/openapi/graphql/graphql.d.ts +15 -15
  217. package/dist/lib/plugins/openapi/graphql/graphql.js +67 -67
  218. package/dist/lib/plugins/openapi/graphql/graphql.js.map +1 -1
  219. package/dist/lib/plugins/openapi/index.d.ts +4 -18
  220. package/dist/lib/plugins/openapi/index.js +62 -21
  221. package/dist/lib/plugins/openapi/index.js.map +1 -1
  222. package/dist/lib/plugins/openapi/interfaces.d.ts +15 -0
  223. package/dist/lib/plugins/openapi/interfaces.js +2 -0
  224. package/dist/lib/plugins/openapi/interfaces.js.map +1 -0
  225. package/dist/lib/plugins/openapi/playground/PathParams.d.ts +4 -5
  226. package/dist/lib/plugins/openapi/playground/PathParams.js +9 -13
  227. package/dist/lib/plugins/openapi/playground/PathParams.js.map +1 -1
  228. package/dist/lib/plugins/openapi/playground/Playground.d.ts +26 -14
  229. package/dist/lib/plugins/openapi/playground/Playground.js +53 -25
  230. package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
  231. package/dist/lib/plugins/openapi/playground/PlaygroundDialog.d.ts +5 -0
  232. package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js +12 -0
  233. package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js.map +1 -0
  234. package/dist/lib/plugins/openapi/playground/QueryParams.d.ts +4 -3
  235. package/dist/lib/plugins/openapi/playground/QueryParams.js +21 -12
  236. package/dist/lib/plugins/openapi/playground/QueryParams.js.map +1 -1
  237. package/dist/lib/plugins/openapi/playground/ResponseTab.d.ts +4 -0
  238. package/dist/lib/plugins/openapi/playground/ResponseTab.js +40 -0
  239. package/dist/lib/plugins/openapi/playground/ResponseTab.js.map +1 -0
  240. package/dist/lib/plugins/openapi/playground/createUrl.d.ts +1 -1
  241. package/dist/lib/plugins/openapi/playground/createUrl.js +5 -9
  242. package/dist/lib/plugins/openapi/playground/createUrl.js.map +1 -1
  243. package/dist/lib/plugins/openapi/util/prose.d.ts +1 -0
  244. package/dist/lib/plugins/openapi/util/prose.js +4 -0
  245. package/dist/lib/plugins/openapi/util/prose.js.map +1 -0
  246. package/dist/lib/plugins/openapi-worker.d.ts +1 -1
  247. package/dist/lib/plugins/openapi-worker.js +1 -1
  248. package/dist/lib/plugins/openapi-worker.js.map +1 -1
  249. package/dist/lib/plugins/redirect/index.d.ts +0 -1
  250. package/dist/lib/plugins/redirect/index.js +3 -4
  251. package/dist/lib/plugins/redirect/index.js.map +1 -1
  252. package/dist/lib/ui/Button.d.ts +5 -1
  253. package/dist/lib/ui/Button.js +24 -1
  254. package/dist/lib/ui/Button.js.map +1 -1
  255. package/dist/lib/ui/Callout.js +2 -2
  256. package/dist/lib/ui/Callout.js.map +1 -1
  257. package/dist/lib/ui/Card.js +1 -1
  258. package/dist/lib/ui/Card.js.map +1 -1
  259. package/dist/lib/ui/DropdownMenu.d.ts +27 -0
  260. package/dist/lib/ui/DropdownMenu.js +36 -0
  261. package/dist/lib/ui/DropdownMenu.js.map +1 -0
  262. package/dist/lib/ui/Input.js.map +1 -0
  263. package/dist/lib/util/MdxComponents.d.ts +2 -2
  264. package/dist/lib/util/MdxComponents.js +7 -5
  265. package/dist/lib/util/MdxComponents.js.map +1 -1
  266. package/dist/lib/util/fetchTimeout.d.ts +1 -0
  267. package/dist/lib/util/fetchTimeout.js +14 -0
  268. package/dist/lib/util/fetchTimeout.js.map +1 -0
  269. package/dist/lib/util/groupBy.d.ts +1 -6
  270. package/dist/lib/util/groupBy.js +10 -8
  271. package/dist/lib/util/groupBy.js.map +1 -1
  272. package/dist/lib/util/invariant.d.ts +6 -0
  273. package/dist/lib/util/invariant.js +21 -0
  274. package/dist/lib/util/invariant.js.map +1 -0
  275. package/dist/lib/util/joinPath.js +2 -1
  276. package/dist/lib/util/joinPath.js.map +1 -1
  277. package/dist/lib/util/logInit.d.ts +1 -0
  278. package/dist/lib/util/logInit.js +9 -0
  279. package/dist/lib/util/logInit.js.map +1 -0
  280. package/dist/lib/util/objectEntries.d.ts +4 -0
  281. package/dist/lib/util/objectEntries.js +2 -0
  282. package/dist/lib/util/objectEntries.js.map +1 -0
  283. package/dist/lib/util/renderIf.d.ts +1 -0
  284. package/dist/lib/util/renderIf.js +2 -0
  285. package/dist/lib/util/renderIf.js.map +1 -0
  286. package/dist/lib/util/requestIdleCallbackPolyfill.d.ts +1 -0
  287. package/dist/lib/util/requestIdleCallbackPolyfill.js +7 -0
  288. package/dist/lib/util/requestIdleCallbackPolyfill.js.map +1 -0
  289. package/dist/vite/build.js +30 -7
  290. package/dist/vite/build.js.map +1 -1
  291. package/dist/vite/config.d.ts +21 -12
  292. package/dist/vite/config.js +107 -55
  293. package/dist/vite/config.js.map +1 -1
  294. package/dist/vite/config.test.js +6 -3
  295. package/dist/vite/config.test.js.map +1 -1
  296. package/dist/vite/dev-server.d.ts +2 -1
  297. package/dist/vite/dev-server.js +44 -15
  298. package/dist/vite/dev-server.js.map +1 -1
  299. package/dist/vite/html.js +18 -5
  300. package/dist/vite/html.js.map +1 -1
  301. package/dist/vite/plugin-api-keys.js +7 -8
  302. package/dist/vite/plugin-api-keys.js.map +1 -1
  303. package/dist/vite/plugin-api.js +9 -20
  304. package/dist/vite/plugin-api.js.map +1 -1
  305. package/dist/vite/plugin-auth.js +5 -6
  306. package/dist/vite/plugin-auth.js.map +1 -1
  307. package/dist/vite/plugin-component.js +5 -2
  308. package/dist/vite/plugin-component.js.map +1 -1
  309. package/dist/vite/plugin-config.d.ts +0 -2
  310. package/dist/vite/plugin-config.js +2 -13
  311. package/dist/vite/plugin-config.js.map +1 -1
  312. package/dist/vite/plugin-custom-css.d.ts +6 -0
  313. package/dist/vite/plugin-custom-css.js +54 -0
  314. package/dist/vite/plugin-custom-css.js.map +1 -0
  315. package/dist/vite/plugin-docs.js +15 -5
  316. package/dist/vite/plugin-docs.js.map +1 -1
  317. package/dist/vite/plugin-mdx.d.ts +3 -1
  318. package/dist/vite/plugin-mdx.js +5 -5
  319. package/dist/vite/plugin-mdx.js.map +1 -1
  320. package/dist/vite/plugin-metadata.js +1 -1
  321. package/dist/vite/plugin-metadata.js.map +1 -1
  322. package/dist/vite/plugin-redirect.js +10 -10
  323. package/dist/vite/plugin-redirect.js.map +1 -1
  324. package/dist/vite/plugin.js +3 -5
  325. package/dist/vite/plugin.js.map +1 -1
  326. package/dist/vite/prerender.d.ts +17 -0
  327. package/dist/vite/prerender.js +79 -0
  328. package/dist/vite/prerender.js.map +1 -0
  329. package/lib/AnchorLink-BZcpTwOs.js +705 -0
  330. package/lib/AnchorLink-BZcpTwOs.js.map +1 -0
  331. package/lib/AuthenticationPlugin-XS0DoAhE.js +55 -0
  332. package/lib/AuthenticationPlugin-XS0DoAhE.js.map +1 -0
  333. package/lib/CategoryHeading-DCmchnA1.js +10 -0
  334. package/lib/CategoryHeading-DCmchnA1.js.map +1 -0
  335. package/lib/Combination-C442XfGG.js +2789 -0
  336. package/lib/Combination-C442XfGG.js.map +1 -0
  337. package/lib/DevPortalProvider-BWeAysxF.js +1126 -0
  338. package/lib/DevPortalProvider-BWeAysxF.js.map +1 -0
  339. package/lib/DeveloperHint-DQVwIery.js +10 -0
  340. package/lib/DeveloperHint-DQVwIery.js.map +1 -0
  341. package/lib/Input-3IEt27jb.js +2239 -0
  342. package/lib/Input-3IEt27jb.js.map +1 -0
  343. package/lib/Markdown-QsZ-PHET.js +14124 -0
  344. package/lib/Markdown-QsZ-PHET.js.map +1 -0
  345. package/lib/MdxPage-CA1WmW14.js +201 -0
  346. package/lib/MdxPage-CA1WmW14.js.map +1 -0
  347. package/lib/OperationList-rv6Z3wD3.js +431 -0
  348. package/lib/OperationList-rv6Z3wD3.js.map +1 -0
  349. package/lib/Route-Clw81GSR.js +13 -0
  350. package/lib/Route-Clw81GSR.js.map +1 -0
  351. package/lib/SlotletProvider-B71hNEUL.js +82 -0
  352. package/lib/SlotletProvider-B71hNEUL.js.map +1 -0
  353. package/lib/Spinner-Coi7ORUV.js +244 -0
  354. package/lib/Spinner-Coi7ORUV.js.map +1 -0
  355. package/lib/_commonjsHelpers-BVfed4GL.js +29 -0
  356. package/lib/_commonjsHelpers-BVfed4GL.js.map +1 -0
  357. package/lib/assets/index-BPdJm2ty.js +1 -0
  358. package/lib/assets/index-BPdJm2ty.js.map +1 -0
  359. package/lib/assets/{worker-BCcpCNJ7.js → worker-CyHZIIfE.js} +10727 -10300
  360. package/lib/assets/worker-CyHZIIfE.js.map +1 -0
  361. package/lib/index-BH-Ub36F.js +124 -0
  362. package/lib/index-BH-Ub36F.js.map +1 -0
  363. package/lib/index-CLkuJSxj.js +5950 -0
  364. package/lib/index-CLkuJSxj.js.map +1 -0
  365. package/lib/index-Dt-pU7Vu.js +916 -0
  366. package/lib/index-Dt-pU7Vu.js.map +1 -0
  367. package/lib/index-pI9JkN46.js +4765 -0
  368. package/lib/index-pI9JkN46.js.map +1 -0
  369. package/lib/jsx-runtime-CJBdjYYx.js +1526 -0
  370. package/lib/jsx-runtime-CJBdjYYx.js.map +1 -0
  371. package/lib/prism-bash.min-DadFsM4Z.js +1 -0
  372. package/lib/prism-bash.min-DadFsM4Z.js.map +1 -0
  373. package/lib/prism-csharp.min-Yizuc34Y.js +1 -0
  374. package/lib/prism-csharp.min-Yizuc34Y.js.map +1 -0
  375. package/lib/prism-java.min-d5iT_mOd.js +1 -0
  376. package/lib/prism-java.min-d5iT_mOd.js.map +1 -0
  377. package/lib/prism-json.min-B1GJqK1k.js +1 -0
  378. package/lib/prism-json.min-B1GJqK1k.js.map +1 -0
  379. package/lib/prism-markup-templating-DZrrEs0A.js +1 -0
  380. package/lib/prism-markup-templating-DZrrEs0A.js.map +1 -0
  381. package/lib/prism-objectivec.min-BXSWqpJJ.js +1 -0
  382. package/lib/prism-objectivec.min-BXSWqpJJ.js.map +1 -0
  383. package/lib/prism-php.min-o7FpoMP_.js +1 -0
  384. package/lib/prism-php.min-o7FpoMP_.js.map +1 -0
  385. package/lib/prism-ruby.min-C7LwcKyz.js +1 -0
  386. package/lib/prism-ruby.min-C7LwcKyz.js.map +1 -0
  387. package/lib/router-BiRCp01d.js +2971 -0
  388. package/lib/router-BiRCp01d.js.map +1 -0
  389. package/lib/slugify-CiPVjteN.js +28 -0
  390. package/lib/slugify-CiPVjteN.js.map +1 -0
  391. package/lib/state-DsXXkBLH.js +288 -0
  392. package/lib/state-DsXXkBLH.js.map +1 -0
  393. package/lib/{urql-DMlBWUKL.js → urql-DrBfkb92.js} +2 -2
  394. package/lib/urql-DrBfkb92.js.map +1 -0
  395. package/lib/zudoku.auth-auth0.js +31 -20
  396. package/lib/zudoku.auth-auth0.js.map +1 -0
  397. package/lib/zudoku.auth-clerk.js +59 -29
  398. package/lib/zudoku.auth-clerk.js.map +1 -0
  399. package/lib/zudoku.auth-openid.js +740 -573
  400. package/lib/zudoku.auth-openid.js.map +1 -0
  401. package/lib/zudoku.components.js +1854 -535
  402. package/lib/zudoku.components.js.map +1 -0
  403. package/lib/zudoku.openapi-worker.js +15035 -146
  404. package/lib/zudoku.openapi-worker.js.map +1 -0
  405. package/lib/zudoku.plugin-api-keys.js +303 -0
  406. package/lib/zudoku.plugin-api-keys.js.map +1 -0
  407. package/lib/zudoku.plugin-custom-page.js +13 -0
  408. package/lib/zudoku.plugin-custom-page.js.map +1 -0
  409. package/lib/zudoku.plugin-markdown.js +48 -0
  410. package/lib/zudoku.plugin-markdown.js.map +1 -0
  411. package/lib/zudoku.plugin-openapi.js +12 -0
  412. package/lib/zudoku.plugin-openapi.js.map +1 -0
  413. package/lib/zudoku.plugin-redirect.js +11 -0
  414. package/lib/zudoku.plugin-redirect.js.map +1 -0
  415. package/package.json +60 -25
  416. package/src/app/App.tsx +0 -41
  417. package/src/app/demo-cdn.html +26 -0
  418. package/src/app/demo.html +18 -0
  419. package/src/app/demo.tsx +45 -0
  420. package/src/app/entry.client.tsx +47 -0
  421. package/src/app/entry.server.tsx +160 -0
  422. package/src/app/main.css +85 -5
  423. package/src/app/main.tsx +85 -15
  424. package/src/app/standalone.html +20 -0
  425. package/src/app/standalone.tsx +51 -0
  426. package/src/app/tailwind.ts +2 -6
  427. package/src/lib/authentication/AuthenticationPlugin.tsx +38 -0
  428. package/src/lib/authentication/authentication.ts +6 -12
  429. package/src/lib/authentication/components/SignIn.tsx +15 -0
  430. package/src/lib/authentication/components/SignOut.tsx +13 -0
  431. package/src/lib/authentication/components/SignUp.tsx +11 -0
  432. package/src/lib/authentication/hook.ts +2 -2
  433. package/src/lib/authentication/providers/auth0.tsx +16 -6
  434. package/src/lib/authentication/providers/clerk.tsx +63 -31
  435. package/src/lib/authentication/providers/openid.tsx +105 -34
  436. package/src/lib/authentication/state.ts +1 -1
  437. package/src/lib/components/Bootstrap.tsx +44 -0
  438. package/src/lib/components/DevPortal.tsx +88 -53
  439. package/src/lib/components/DeveloperHint.tsx +25 -0
  440. package/src/lib/components/ErrorPage.tsx +28 -0
  441. package/src/lib/components/Header.tsx +103 -30
  442. package/src/lib/components/Heading.tsx +26 -7
  443. package/src/lib/components/InlineCode.tsx +19 -0
  444. package/src/lib/components/Layout.tsx +12 -7
  445. package/src/lib/components/NotFoundPage.tsx +33 -0
  446. package/src/lib/components/SlotletProvider.tsx +25 -0
  447. package/src/lib/components/SyntaxHighlight.tsx +53 -44
  448. package/src/lib/components/TopNavigation.tsx +6 -1
  449. package/src/lib/components/context/DevPortalProvider.ts +24 -4
  450. package/src/lib/components/index.ts +25 -3
  451. package/src/lib/components/navigation/SideNavigation.tsx +3 -0
  452. package/src/lib/components/navigation/SideNavigationCategory.tsx +5 -9
  453. package/src/lib/components/navigation/SideNavigationItem.tsx +5 -9
  454. package/src/lib/components/navigation/useNavigationCollapsibleState.ts +21 -6
  455. package/src/lib/core/DevPortalContext.ts +64 -28
  456. package/src/lib/core/plugins.ts +37 -6
  457. package/src/lib/errors/ErrorAlert.tsx +21 -0
  458. package/src/lib/errors/RouterError.tsx +13 -0
  459. package/src/lib/errors/ServerError.tsx +5 -0
  460. package/src/lib/errors/TopLevelError.tsx +8 -0
  461. package/src/lib/oas/graphql/index.ts +11 -6
  462. package/src/lib/oas/parser/index.ts +41 -20
  463. package/src/lib/plugins/{api-key → api-keys}/CreateApiKey.tsx +2 -2
  464. package/src/lib/plugins/api-keys/ProtectedRoute.tsx +29 -0
  465. package/src/lib/plugins/{api-key → api-keys}/SettingsApiKeys.tsx +21 -9
  466. package/src/lib/plugins/{api-key → api-keys}/index.tsx +17 -41
  467. package/src/lib/plugins/custom-page/index.tsx +22 -0
  468. package/src/lib/plugins/markdown/MdxPage.tsx +51 -34
  469. package/src/lib/plugins/markdown/Toc.tsx +53 -40
  470. package/src/lib/plugins/markdown/generateRoutes.tsx +16 -6
  471. package/src/lib/plugins/markdown/index.tsx +10 -7
  472. package/src/lib/plugins/openapi/ColorizedParam.tsx +23 -16
  473. package/src/lib/plugins/openapi/OperationList.tsx +46 -10
  474. package/src/lib/plugins/openapi/OperationListItem.tsx +68 -42
  475. package/src/lib/plugins/openapi/ParameterList.tsx +1 -1
  476. package/src/lib/plugins/openapi/ParameterListItem.tsx +3 -4
  477. package/src/lib/plugins/openapi/PlaygroundDialogWrapper.tsx +39 -0
  478. package/src/lib/plugins/openapi/RequestBodySidecarBox.tsx +3 -15
  479. package/src/lib/plugins/openapi/ResponsesSidecarBox.tsx +3 -2
  480. package/src/lib/plugins/openapi/Route.tsx +21 -0
  481. package/src/lib/plugins/openapi/SchemaListView.tsx +23 -192
  482. package/src/lib/plugins/openapi/SchemaListViewItem.tsx +113 -0
  483. package/src/lib/plugins/openapi/SchemaListViewItemGroup.tsx +63 -0
  484. package/src/lib/plugins/openapi/Sidecar.tsx +62 -28
  485. package/src/lib/plugins/openapi/SidecarBox.tsx +13 -2
  486. package/src/lib/plugins/openapi/{Select.tsx → SimpleSelect.tsx} +6 -3
  487. package/src/lib/plugins/openapi/StaggeredRender.tsx +31 -0
  488. package/src/lib/plugins/openapi/client/createMemoryClient.ts +56 -0
  489. package/src/lib/plugins/openapi/client/createServer.ts +33 -0
  490. package/src/lib/plugins/openapi/{worker/createSharedWorkerClient.ts → client/createWorkerClient.ts} +21 -2
  491. package/src/lib/plugins/openapi/client/interfaces.ts +5 -0
  492. package/src/lib/plugins/openapi/{worker → client}/worker.ts +3 -3
  493. package/src/lib/plugins/openapi/context.tsx +16 -0
  494. package/src/lib/plugins/openapi/graphql/gql.ts +8 -8
  495. package/src/lib/plugins/openapi/graphql/graphql.ts +80 -80
  496. package/src/lib/plugins/openapi/index.tsx +117 -53
  497. package/src/lib/plugins/openapi/interfaces.ts +9 -0
  498. package/src/lib/plugins/openapi/playground/PathParams.tsx +76 -50
  499. package/src/lib/plugins/openapi/playground/Playground.tsx +239 -229
  500. package/src/lib/plugins/openapi/playground/PlaygroundDialog.tsx +40 -0
  501. package/src/lib/plugins/openapi/playground/QueryParams.tsx +107 -66
  502. package/src/lib/plugins/openapi/playground/ResponseTab.tsx +76 -0
  503. package/src/lib/plugins/openapi/playground/createUrl.ts +12 -15
  504. package/src/lib/plugins/openapi/util/prose.ts +7 -0
  505. package/src/lib/plugins/openapi-worker.ts +1 -1
  506. package/src/lib/plugins/redirect/index.tsx +3 -4
  507. package/src/lib/ui/Button.tsx +32 -2
  508. package/src/lib/ui/Callout.tsx +4 -4
  509. package/src/lib/ui/Card.tsx +1 -1
  510. package/src/lib/ui/DropdownMenu.tsx +199 -0
  511. package/src/lib/util/MdxComponents.tsx +7 -15
  512. package/src/lib/util/fetchTimeout.tsx +21 -0
  513. package/src/lib/util/groupBy.ts +7 -12
  514. package/src/lib/util/invariant.ts +26 -0
  515. package/src/lib/util/joinPath.tsx +2 -1
  516. package/src/lib/util/logInit.ts +9 -0
  517. package/src/lib/util/objectEntries.ts +5 -0
  518. package/src/lib/util/renderIf.ts +4 -0
  519. package/src/lib/util/requestIdleCallbackPolyfill.ts +6 -0
  520. package/dist/lib/authentication/Callback.d.ts +0 -3
  521. package/dist/lib/authentication/Callback.js +0 -34
  522. package/dist/lib/authentication/Callback.js.map +0 -1
  523. package/dist/lib/components/Input.js.map +0 -1
  524. package/dist/lib/components/Link.d.ts +0 -1
  525. package/dist/lib/components/Link.js +0 -2
  526. package/dist/lib/components/Link.js.map +0 -1
  527. package/dist/lib/components/Router.d.ts +0 -4
  528. package/dist/lib/components/Router.js +0 -20
  529. package/dist/lib/components/Router.js.map +0 -1
  530. package/dist/lib/core/helmet.d.ts +0 -4
  531. package/dist/lib/core/helmet.js +0 -5
  532. package/dist/lib/core/helmet.js.map +0 -1
  533. package/dist/lib/core/icons.d.ts +0 -1
  534. package/dist/lib/core/icons.js +0 -2
  535. package/dist/lib/core/icons.js.map +0 -1
  536. package/dist/lib/core/router.d.ts +0 -1
  537. package/dist/lib/core/router.js +0 -2
  538. package/dist/lib/core/router.js.map +0 -1
  539. package/dist/lib/plugins/api-key/CreateApiKey.js.map +0 -1
  540. package/dist/lib/plugins/api-key/SettingsApiKeys.js +0 -38
  541. package/dist/lib/plugins/api-key/SettingsApiKeys.js.map +0 -1
  542. package/dist/lib/plugins/api-key/index.js.map +0 -1
  543. package/dist/lib/plugins/index.d.ts +0 -4
  544. package/dist/lib/plugins/index.js +0 -5
  545. package/dist/lib/plugins/index.js.map +0 -1
  546. package/dist/lib/plugins/openapi/MakeRequest.js +0 -43
  547. package/dist/lib/plugins/openapi/MakeRequest.js.map +0 -1
  548. package/dist/lib/plugins/openapi/Select.js +0 -5
  549. package/dist/lib/plugins/openapi/Select.js.map +0 -1
  550. package/dist/lib/plugins/openapi/worker/createSharedWorkerClient.d.ts +0 -5
  551. package/dist/lib/plugins/openapi/worker/createSharedWorkerClient.js.map +0 -1
  552. package/dist/lib/plugins/openapi/worker/shared-worker.d.ts +0 -1
  553. package/dist/lib/plugins/openapi/worker/shared-worker.js +0 -6
  554. package/dist/lib/plugins/openapi/worker/shared-worker.js.map +0 -1
  555. package/dist/lib/plugins/openapi/worker/worker.js.map +0 -1
  556. package/dist/lib/ui/button-variants.d.ts +0 -4
  557. package/dist/lib/ui/button-variants.js +0 -24
  558. package/dist/lib/ui/button-variants.js.map +0 -1
  559. package/dist/vite/common.d.ts +0 -1
  560. package/dist/vite/common.js +0 -5
  561. package/dist/vite/common.js.map +0 -1
  562. package/dist/vite/plugin-html.d.ts +0 -3
  563. package/dist/vite/plugin-html.js +0 -47
  564. package/dist/vite/plugin-html.js.map +0 -1
  565. package/dist/vite/plugin-openapi-worker.d.ts +0 -4
  566. package/dist/vite/plugin-openapi-worker.js +0 -28
  567. package/dist/vite/plugin-openapi-worker.js.map +0 -1
  568. package/lib/Spinner-BewqqUU-.js +0 -8413
  569. package/lib/clerk-Wslx_mPo.js +0 -19685
  570. package/lib/index-PyGcnQFX.js +0 -3462
  571. package/lib/loglevel-CoH7VSwE.js +0 -152
  572. package/lib/state-2Hu1renZ.js +0 -313
  573. package/lib/zudoku.plugins.js +0 -19902
  574. package/src/lib/authentication/Callback.tsx +0 -60
  575. package/src/lib/components/Link.tsx +0 -1
  576. package/src/lib/components/Router.tsx +0 -28
  577. package/src/lib/core/helmet.ts +0 -5
  578. package/src/lib/core/icons.tsx +0 -1
  579. package/src/lib/core/router.tsx +0 -1
  580. package/src/lib/plugins/index.ts +0 -4
  581. package/src/lib/plugins/openapi/MakeRequest.tsx +0 -63
  582. package/src/lib/plugins/openapi/worker/shared-worker.ts +0 -5
  583. package/src/lib/ui/button-variants.ts +0 -31
  584. /package/dist/lib/plugins/{api-key → api-keys}/CreateApiKey.d.ts +0 -0
  585. /package/dist/lib/plugins/{api-key → api-keys}/SettingsApiKeys.d.ts +0 -0
  586. /package/dist/lib/plugins/openapi/{worker → client}/worker.d.ts +0 -0
  587. /package/dist/lib/{components → ui}/Input.d.ts +0 -0
  588. /package/dist/lib/{components → ui}/Input.js +0 -0
  589. /package/src/lib/{components → ui}/Input.tsx +0 -0
@@ -14,7 +14,7 @@ import { AnchorLink } from "../AnchorLink.js";
14
14
  import { useNavigationCollapsibleState } from "./useNavigationCollapsibleState.js";
15
15
  import { checkHasActiveItem, isLinkItem, isPathItem } from "./util.js";
16
16
 
17
- export const navigationListItem = cva(
17
+ const navigationListItem = cva(
18
18
  "flex px-[--padding-nav-item] py-1.5 rounded-lg hover:bg-accent transition-colors duration-300",
19
19
  {
20
20
  variants: {
@@ -48,10 +48,10 @@ export const SideNavigationItem = ({
48
48
  const currentPath = isPathItem(item) ? joinPath(basePath, item.path) : "";
49
49
  const location = useLocation();
50
50
 
51
- const [isOpen, setIsOpen] = useNavigationCollapsibleState({
51
+ const collapsibleProps = useNavigationCollapsibleState({
52
52
  item,
53
53
  path: currentPath,
54
- defaultOpen: () => checkHasActiveItem(item, location.pathname, currentPath),
54
+ defaultOpen: () => checkHasActiveItem(item, location.pathname, basePath),
55
55
  });
56
56
 
57
57
  if (isLinkItem(item)) {
@@ -100,11 +100,7 @@ export const SideNavigationItem = ({
100
100
  return (
101
101
  <li title={typeof item.label === "string" ? item.label : item.title}>
102
102
  {item.children ? (
103
- <Collapsible.Root
104
- open={isOpen}
105
- onOpenChange={() => setIsOpen((prev) => !prev)}
106
- className="flex flex-col"
107
- >
103
+ <Collapsible.Root {...collapsibleProps} className="flex flex-col">
108
104
  <Collapsible.Trigger
109
105
  className={cn(
110
106
  "group text-start",
@@ -114,7 +110,7 @@ export const SideNavigationItem = ({
114
110
  {linkContent}
115
111
  </Collapsible.Trigger>
116
112
  <Collapsible.Content className="CollapsibleContent ms-[calc(var(--padding-nav-item)*1.125)]">
117
- <ul className="mt-1 border-border border-l ps-1.5">
113
+ <ul className="mt-1 border-l ps-1.5">
118
114
  {item.children.map((child) => (
119
115
  <SideNavigationItem
120
116
  key={isPathItem(child) ? child.path : child.href}
@@ -1,3 +1,4 @@
1
+ import type { CollapsibleProps } from "@radix-ui/react-collapsible";
1
2
  import { useEffect, useRef, useState } from "react";
2
3
  import { useLocation } from "react-router-dom";
3
4
  import type { NavigationNode } from "../../util/traverseNavigation.js";
@@ -11,17 +12,31 @@ export const useNavigationCollapsibleState = ({
11
12
  item: NavigationNode;
12
13
  defaultOpen: () => boolean;
13
14
  path: string;
14
- }) => {
15
- const [isOpen, setIsOpen] = useState(defaultOpen);
15
+ }): Partial<CollapsibleProps> & { "data-animate": boolean } => {
16
+ const [open, setOpen] = useState(defaultOpen);
16
17
  const location = useLocation();
17
18
  const previousLocationPath = useRef(location.pathname);
19
+ const [shouldAnimate, setShouldAnimate] = useState(false);
18
20
 
19
21
  useEffect(() => {
20
- if (!isOpen && previousLocationPath.current !== location.pathname) {
21
- setIsOpen(checkHasActiveItem(item, location.pathname, path));
22
+ if (!open && previousLocationPath.current !== location.pathname) {
23
+ setOpen(checkHasActiveItem(item, location.pathname, path));
22
24
  }
23
25
  previousLocationPath.current = location.pathname;
24
- }, [isOpen, item, path, location.pathname]);
26
+ }, [open, item, path, location.pathname]);
25
27
 
26
- return [isOpen, setIsOpen] as const;
28
+ const onOpenChange = () => {
29
+ setShouldAnimate(true);
30
+ setOpen((prev) => !prev);
31
+ };
32
+
33
+ useEffect(() => {
34
+ setShouldAnimate(false);
35
+ }, []);
36
+
37
+ return {
38
+ open,
39
+ onOpenChange,
40
+ "data-animate": shouldAnimate,
41
+ };
27
42
  };
@@ -1,17 +1,17 @@
1
1
  import { QueryClient } from "@tanstack/react-query";
2
2
  import { type ReactNode } from "react";
3
- import { create } from "zustand";
3
+ import { NavigateFunction } from "react-router-dom";
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 { Slotlets } from "../components/SlotletProvider.js";
8
+ import type { MdxComponentsType } from "../util/MdxComponents.js";
5
9
  import {
6
- type DevPortalPath,
7
- type DevPortalProps,
8
- } from "../components/DevPortal.js";
9
- import {
10
+ type DevPortalPlugin,
10
11
  isApiIdentityPlugin,
11
12
  isNavigationPlugin,
12
- needsInitialization,
13
- type DevPortalPlugin,
14
13
  type NavigationPlugin,
14
+ needsInitialization,
15
15
  } from "./plugins.js";
16
16
 
17
17
  export interface ApiIdentity {
@@ -55,41 +55,77 @@ export type NavigationItem = {
55
55
  categories?: NavigationCategory[];
56
56
  };
57
57
 
58
- export type RoutingState = {
59
- path?: string;
60
- };
61
-
62
58
  export const queryClient = new QueryClient();
63
59
 
64
- export const useRoutingState = create<RoutingState>(() => ({}));
65
-
66
60
  export type ApiKeyCache = "api-keys";
67
61
  export type DevPortalCacheKey = ApiKeyCache | string;
68
62
 
63
+ type Metadata = Partial<{
64
+ title: string;
65
+ description: string;
66
+ logo: string;
67
+ favicon: string;
68
+ generator: string;
69
+ applicationName: string;
70
+ referrer: string;
71
+ keywords: string[];
72
+ authors: string[];
73
+ creator: string;
74
+ publisher: string;
75
+ }>;
76
+
77
+ type Page = Partial<{
78
+ pageTitle?: string;
79
+ logo?: {
80
+ src: {
81
+ light: string;
82
+ dark: string;
83
+ };
84
+ width?: string;
85
+ alt?: string;
86
+ };
87
+ }>;
88
+
89
+ export type ZudokuContextOptions = {
90
+ metadata?: Metadata;
91
+ page?: Page;
92
+ authentication?: AuthenticationProvider;
93
+ navigation: NavigationItem[];
94
+ plugins?: DevPortalPlugin[];
95
+ slotlets?: Slotlets;
96
+ mdx?: {
97
+ components?: MdxComponentsType;
98
+ };
99
+ overrides?: ComponentsContextType;
100
+ };
101
+
69
102
  export class DevPortalContext {
70
- private plugins: DevPortalPlugin[] = [];
103
+ public plugins: NonNullable<ZudokuContextOptions["plugins"]> = [];
104
+ public navigation: ZudokuContextOptions["navigation"];
105
+ public meta: ZudokuContextOptions["metadata"];
106
+ public page: ZudokuContextOptions["page"];
107
+ public authentication?: ZudokuContextOptions["authentication"];
71
108
  private navigationPlugins: NavigationPlugin[];
72
109
 
73
- public navigation: NavigationItem[];
74
- public meta: DevPortalProps["meta"];
75
- public authentication?: AuthenticationProvider;
76
- public state: typeof useRoutingState;
77
-
78
- constructor(config: DevPortalProps) {
110
+ constructor(config: ZudokuContextOptions) {
79
111
  this.plugins = config.plugins ?? [];
80
112
  this.navigation = config.navigation;
81
113
  this.navigationPlugins = this.plugins.filter(isNavigationPlugin);
82
114
  this.authentication = config.authentication;
83
- this.meta = config.meta;
84
- this.state = useRoutingState;
115
+ this.meta = config.metadata;
116
+ this.page = config.page;
85
117
  }
86
118
 
87
- initialize = async () => {
88
- await Promise.all([
119
+ initialize = async ({
120
+ navigate,
121
+ }: {
122
+ navigate: NavigateFunction;
123
+ }): Promise<void> => {
124
+ await Promise.all(
89
125
  this.plugins
90
126
  .filter(needsInitialization)
91
- .map((plugin) => plugin.initialize(this)),
92
- ]);
127
+ .map((plugin) => plugin.initialize?.(this, { navigate })),
128
+ );
93
129
  };
94
130
 
95
131
  invalidateCache = async (key: DevPortalCacheKey[]) => {
@@ -116,7 +152,7 @@ export class DevPortalContext {
116
152
  return navigations.flatMap((nav) => nav ?? []);
117
153
  };
118
154
 
119
- async signRequest(request: Request) {
155
+ signRequest = async (request: Request) => {
120
156
  if (!this.authentication) {
121
157
  throw new Error("No authentication provider configured");
122
158
  }
@@ -126,5 +162,5 @@ export class DevPortalContext {
126
162
  request.headers.set("Authorization", `Bearer ${accessToken}`);
127
163
 
128
164
  return request;
129
- }
165
+ };
130
166
  }
@@ -1,4 +1,6 @@
1
- import { type RouteObject } from "react-router-dom";
1
+ import { type ReactElement } from "react";
2
+ import { NavigateFunction, type RouteObject } from "react-router-dom";
3
+ import { MdxComponentsType } from "../util/MdxComponents.js";
2
4
  import {
3
5
  DevPortalContext,
4
6
  type ApiIdentity,
@@ -10,9 +12,10 @@ export type PluginNavigationCategory = {
10
12
  } & NavigationCategory;
11
13
 
12
14
  export type DevPortalPlugin =
15
+ | CommonPlugin
16
+ | ProfileMenuPlugin
13
17
  | NavigationPlugin
14
- | ApiIdentityPlugin
15
- | InitializationPlugin;
18
+ | ApiIdentityPlugin;
16
19
 
17
20
  export interface NavigationPlugin {
18
21
  getRoutes: () => RouteObject[];
@@ -23,10 +26,30 @@ export interface ApiIdentityPlugin {
23
26
  getIdentities: (context: DevPortalContext) => Promise<ApiIdentity[]>;
24
27
  }
25
28
 
26
- export interface InitializationPlugin {
27
- initialize: (context: DevPortalContext) => Promise<void> | void;
29
+ export interface ProfileMenuPlugin {
30
+ getProfileMenuItems: (context: DevPortalContext) => NavigationItem[];
28
31
  }
29
32
 
33
+ export type NavigationItem = {
34
+ label: string;
35
+ path?: string;
36
+ children?: NavigationItem[];
37
+ };
38
+
39
+ export interface CommonPlugin {
40
+ initialize?: (
41
+ context: DevPortalContext,
42
+ options: { navigate: NavigateFunction },
43
+ ) => Promise<void | boolean> | void | boolean;
44
+ getHead?: () => ReactElement | undefined;
45
+ getMdxComponents?: () => MdxComponentsType;
46
+ }
47
+
48
+ export const isProfileMenuPlugin = (
49
+ obj: DevPortalPlugin,
50
+ ): obj is ProfileMenuPlugin =>
51
+ "getProfileMenuItems" in obj && typeof obj.getProfileMenuItems === "function";
52
+
30
53
  export const isNavigationPlugin = (
31
54
  obj: DevPortalPlugin,
32
55
  ): obj is NavigationPlugin =>
@@ -34,9 +57,17 @@ export const isNavigationPlugin = (
34
57
 
35
58
  export const needsInitialization = (
36
59
  obj: DevPortalPlugin,
37
- ): obj is InitializationPlugin =>
60
+ ): obj is CommonPlugin =>
38
61
  "initialize" in obj && typeof obj.initialize === "function";
39
62
 
63
+ export const hasHead = (obj: DevPortalPlugin): obj is CommonPlugin =>
64
+ "getHead" in obj && typeof obj.getHead === "function";
65
+
66
+ export const isMdxProviderPlugin = (
67
+ obj: DevPortalPlugin,
68
+ ): obj is CommonPlugin =>
69
+ "getMdxComponents" in obj && typeof obj.getMdxComponents === "function";
70
+
40
71
  export const isApiIdentityPlugin = (
41
72
  obj: DevPortalPlugin,
42
73
  ): 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,13 @@
1
+ import { isRouteErrorResponse, useRouteError } from "react-router-dom";
2
+ import { NotFoundPage } from "../components/NotFoundPage.js";
3
+ import { ErrorAlert } from "./ErrorAlert.js";
4
+
5
+ export function RouterError() {
6
+ const error = useRouteError();
7
+
8
+ if (isRouteErrorResponse(error) && error.status === 404) {
9
+ return <NotFoundPage />;
10
+ }
11
+
12
+ return <ErrorAlert error={error} />;
13
+ }
@@ -0,0 +1,5 @@
1
+ import { ErrorAlert } from "./ErrorAlert.js";
2
+
3
+ export function ServerError({ error }: { error: unknown }) {
4
+ return <ErrorAlert error={error} />;
5
+ }
@@ -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
+ }
@@ -36,16 +36,21 @@ type OperationLike = {
36
36
  method: string;
37
37
  };
38
38
  export const slugifyOperation = (operation: OperationLike, tag?: string) => {
39
+ const summary =
40
+ operation.summary +
41
+ (operation.operationId
42
+ ? "-" +
43
+ operation.operationId.slice(0, operation.summary ? Infinity : Infinity)
44
+ : "");
45
+
39
46
  return slugify(
40
47
  (tag ? tag + "-" : "") +
41
- (operation.summary ??
42
- operation.operationId ??
43
- `${operation.method}-${operation.path}`),
48
+ (summary || `${operation.method}-${operation.path}`),
44
49
  { lower: true, trim: true },
45
50
  );
46
51
  };
47
52
 
48
- const cache = new LRUCache<string, OpenAPIDocument>({
53
+ const cache = new LRUCache<string, Promise<OpenAPIDocument>>({
49
54
  ttl: 60 * 10 * 1000,
50
55
  ttlAutopurge: true,
51
56
  });
@@ -207,7 +212,7 @@ const MediaTypeItem = builder
207
212
  .implement({
208
213
  fields: (t) => ({
209
214
  mediaType: t.exposeString("mediaType"),
210
- schema: t.expose("schema", { type: JSONScalar }),
215
+ schema: t.expose("schema", { type: JSONScalar, nullable: true }),
211
216
  examples: t.expose("examples", { type: [ExampleItem], nullable: true }),
212
217
  encoding: t.expose("encoding", { type: [EncodingItem], nullable: true }),
213
218
  }),
@@ -384,7 +389,7 @@ const loadOpenAPISchema = async (input: NonNullable<unknown>) => {
384
389
  return cache.get(hash)!;
385
390
  }
386
391
 
387
- const schema = await validate(input);
392
+ const schema = validate(input);
388
393
 
389
394
  cache.set(hash, schema);
390
395
 
@@ -1,3 +1,4 @@
1
+ import { GraphQLError } from "graphql/error/index.js";
1
2
  import { OpenAPIV3, type OpenAPIV3_1 } from "openapi-types";
2
3
  import { dereference, type JSONSchema } from "./dereference/index.js";
3
4
  import { upgradeSchema } from "./upgrade/index.js";
@@ -9,10 +10,6 @@ type DeepOmitReference<T> = T extends ReferenceObject
9
10
  ? { [K in keyof T]: DeepOmitReference<T[K]> }
10
11
  : T;
11
12
 
12
- // type Prettify<T> = {
13
- // [K in keyof T]: T[K];
14
- // } & {};
15
-
16
13
  export type OpenAPIDocument = DeepOmitReference<OpenAPIV3_1.Document>;
17
14
  export type ResponseObject = DeepOmitReference<OpenAPIV3_1.ResponseObject>;
18
15
  export type OperationObject = DeepOmitReference<OpenAPIV3_1.OperationObject>;
@@ -46,35 +43,63 @@ export const HttpMethods = Object.values(OpenAPIV3.HttpMethods);
46
43
  // };
47
44
 
48
45
  const parseSchemaInput = async (
49
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
50
- schemaInput: any,
46
+ schemaInput: unknown,
51
47
  ): Promise<JSONSchema & { openapi?: string }> => {
52
48
  if (typeof schemaInput === "string") {
53
49
  if (schemaInput.trim().startsWith("{")) {
54
- return JSON.parse(schemaInput);
50
+ try {
51
+ return JSON.parse(schemaInput);
52
+ } catch (err) {
53
+ throw new GraphQLError("Invalid JSON schema", {
54
+ originalError: err,
55
+ });
56
+ }
55
57
  }
56
58
  if (schemaInput.includes("://")) {
57
- const response = await fetch(schemaInput);
58
- return (await response.json()) as JSONSchema;
59
+ let response;
60
+ try {
61
+ response = await fetch(schemaInput, {
62
+ cache: "force-cache",
63
+ });
64
+ } catch (err) {
65
+ throw new GraphQLError("Failed to fetch schema", {
66
+ originalError: err,
67
+ });
68
+ }
69
+
70
+ if (!response.ok) {
71
+ throw new GraphQLError(
72
+ `Failed to fetch schema: ${response.statusText}`,
73
+ );
74
+ }
75
+
76
+ try {
77
+ return (await response.json()) as JSONSchema;
78
+ } catch (err) {
79
+ throw new GraphQLError("Fetched invalid JSON schema", {
80
+ originalError: err,
81
+ });
82
+ }
59
83
  }
60
84
  const yaml = await import("yaml");
61
- return yaml.parse(schemaInput);
85
+ const parsed = yaml.parse(schemaInput);
86
+
87
+ if (typeof parsed === "object") return parsed;
62
88
  }
63
89
 
64
- if (typeof schemaInput === "object") return schemaInput;
90
+ if (typeof schemaInput === "object") return schemaInput as JSONSchema;
65
91
 
66
- throw new Error("Unsupported schema input");
92
+ throw new GraphQLError("Unsupported schema input: " + schemaInput);
67
93
  };
68
94
 
69
95
  /**
70
96
  * Validates, dereferences and upgrades the OpenAPI schema (to v3.1) if necessary.
71
97
  */
72
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
73
- export const validate = async (schemaInput: any) => {
98
+ export const validate = async (schemaInput: unknown) => {
74
99
  const schema = await parseSchemaInput(schemaInput);
75
100
 
76
101
  if (!schema.openapi) {
77
- throw new Error("OpenAPI version is not defined");
102
+ throw new GraphQLError("OpenAPI version is not defined");
78
103
  }
79
104
 
80
105
  // const validator = await getValidator(schema.openapi);
@@ -86,9 +111,5 @@ export const validate = async (schemaInput: any) => {
86
111
 
87
112
  const dereferenced = await dereference(schema);
88
113
 
89
- const upgraded = upgradeSchema(
90
- dereferenced as OpenAPIV3_1.Document | OpenAPIV3.Document,
91
- );
92
-
93
- return upgraded;
114
+ return upgradeSchema(dereferenced);
94
115
  };
@@ -2,7 +2,6 @@ import { useMutation } from "@tanstack/react-query";
2
2
  import { useForm } from "react-hook-form";
3
3
  import { Link, useNavigate } from "react-router-dom";
4
4
  import { useDevPortal } from "../../components/context/DevPortalProvider.js";
5
- import { Input } from "../../components/Input.js";
6
5
  import {
7
6
  Select,
8
7
  SelectContent,
@@ -12,6 +11,7 @@ import {
12
11
  SelectValue,
13
12
  } from "../../components/Select.js";
14
13
  import { Button } from "../../ui/Button.js";
14
+ import { Input } from "../../ui/Input.js";
15
15
  import { ApiKeyService } from "./index.js";
16
16
 
17
17
  type CreateApiKey = { description: string; expiresOn?: string };
@@ -47,7 +47,7 @@ export const CreateApiKey = ({ service }: { service: ApiKeyService }) => {
47
47
 
48
48
  return (
49
49
  <div className="max-w-screen-lg pt-[--padding-content-top] pb-[--padding-content-bottom]">
50
- <div className="flex justify-between mb-4 border-b border-border pb-1">
50
+ <div className="flex justify-between mb-4 border-b pb-1">
51
51
  <h1 className="font-medium text-2xl">New API Key</h1>
52
52
  </div>
53
53
  <form
@@ -0,0 +1,29 @@
1
+ import { Outlet } from "react-router-dom";
2
+ import { useAuth } from "../../authentication/hook.js";
3
+ import { DeveloperHint } from "../../components/DeveloperHint.js";
4
+ import { Button } from "../../ui/Button.js";
5
+
6
+ export const ProtectedRoute = () => {
7
+ const auth = useAuth();
8
+
9
+ // TODO: should we suspend here somehow?
10
+ if (auth.isAuthEnabled && auth.isPending) {
11
+ return null;
12
+ }
13
+
14
+ return auth.isAuthenticated ? (
15
+ <Outlet />
16
+ ) : !auth.isAuthEnabled ? (
17
+ <div className="flex flex-col justify-center gap-2 items-center h-1/2">
18
+ <DeveloperHint className="max-w-[600px]">
19
+ Authentication needs to be enabled for API keys to work. Enable it in
20
+ your Zudoku configuration under <code>authentication</code>.
21
+ </DeveloperHint>
22
+ </div>
23
+ ) : (
24
+ <div className="flex flex-col justify-center gap-2 items-center h-1/2">
25
+ Please login first to view this page
26
+ <Button onClick={() => auth.login()}>Login</Button>
27
+ </div>
28
+ );
29
+ };
@@ -7,7 +7,9 @@ import { EyeIcon, EyeOffIcon, RotateCwIcon, TrashIcon } from "lucide-react";
7
7
  import { useState } from "react";
8
8
  import { Link } from "react-router-dom";
9
9
  import { useDevPortal } from "../../components/context/DevPortalProvider.js";
10
+ import { Slotlet } from "../../components/SlotletProvider.js";
10
11
  import { Button } from "../../ui/Button.js";
12
+ import { cn } from "../../util/cn.js";
11
13
  import { ApiKeyService } from "./index.js";
12
14
 
13
15
  export const SettingsApiKeys = ({ service }: { service: ApiKeyService }) => {
@@ -34,7 +36,9 @@ export const SettingsApiKeys = ({ service }: { service: ApiKeyService }) => {
34
36
 
35
37
  return (
36
38
  <div className="max-w-screen-lg h-full pt-[--padding-content-top] pb-[--padding-content-bottom]">
37
- <div className="flex justify-between mb-4 border-b border-border pb-3">
39
+ <Slotlet name="api-keys-list-page" />
40
+
41
+ <div className="flex justify-between mb-4 border-b pb-3">
38
42
  <h1 className="font-medium text-2xl">API Keys</h1>
39
43
  {service.createKey && (
40
44
  <Button asChild>
@@ -43,6 +47,8 @@ export const SettingsApiKeys = ({ service }: { service: ApiKeyService }) => {
43
47
  )}
44
48
  </div>
45
49
 
50
+ <Slotlet name="api-keys-list-page-before-keys" />
51
+
46
52
  {data.length === 0 ? (
47
53
  <div className="flex flex-col justify-center gap-4 items-center h-1/2 my-8">
48
54
  <div className="text-center">
@@ -57,10 +63,15 @@ export const SettingsApiKeys = ({ service }: { service: ApiKeyService }) => {
57
63
  )}
58
64
  </div>
59
65
  ) : (
60
- <ul className="grid grid-cols-[minmax(250px,min-content)_1fr_min-content] ">
61
- {data.map((key: any) => (
66
+ <ul
67
+ className={cn(
68
+ "grid grid-cols-1 rounded border",
69
+ "lg:grid-cols-[minmax(250px,min-content)_1fr_min-content]",
70
+ )}
71
+ >
72
+ {data.map((key) => (
62
73
  <li
63
- className="border-b border-border p-5 grid grid-cols-subgrid col-span-full gap-2 items-center"
74
+ className="border-b p-5 grid grid-cols-subgrid col-span-full gap-2 items-center"
64
75
  key={key.id}
65
76
  >
66
77
  <div className="flex flex-col gap-1 text-sm">
@@ -78,7 +89,7 @@ export const SettingsApiKeys = ({ service }: { service: ApiKeyService }) => {
78
89
  )}
79
90
  </div>
80
91
  </div>
81
- <div className="items-center flex justify-center">
92
+ <div className="items-center flex lg:justify-center">
82
93
  <RevealApiKey apiKey={key.key} />
83
94
  </div>
84
95
  <div className="flex gap-2">
@@ -116,10 +127,11 @@ const RevealApiKey = ({ apiKey }: { apiKey: string }) => {
116
127
  const [revealed, setRevealed] = useState(false);
117
128
 
118
129
  return (
119
- <div className="flex gap-2 items-center text-sm">
120
- <code className="border border-border rounded bg-gray-100 dark:bg-gray-950 p-1 font-mono">
121
- {revealed ? apiKey : "•".repeat(apiKey.length)}
122
- </code>
130
+ <div className="flex gap-2 items-center text-sm w-full">
131
+ <input
132
+ className="border rounded bg-gray-100 dark:bg-gray-950 p-1 font-mono max-w-min"
133
+ value={revealed ? apiKey : "•".repeat(apiKey.length)}
134
+ />
123
135
  <Button
124
136
  variant="outline"
125
137
  onClick={() => setRevealed((prev) => !prev)}