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
package/src/app/main.css CHANGED
@@ -2,6 +2,80 @@
2
2
  @tailwind components;
3
3
  @tailwind utilities;
4
4
 
5
+ @font-face {
6
+ font-family: Geist;
7
+ font-style: normal;
8
+ font-weight: 100;
9
+ font-display: swap;
10
+ src: url("https://cdn.zudoku.dev/geist/Geist-Thin.woff2") format("woff2");
11
+ }
12
+
13
+ @font-face {
14
+ font-family: Geist;
15
+ font-style: normal;
16
+ font-weight: 200;
17
+ font-display: swap;
18
+ src: url("https://cdn.zudoku.dev/geist/Geist-UltraLight.woff2")
19
+ format("woff2");
20
+ }
21
+
22
+ @font-face {
23
+ font-family: Geist;
24
+ font-style: normal;
25
+ font-weight: 300;
26
+ font-display: swap;
27
+ src: url("https://cdn.zudoku.dev/geist/Geist-Light.woff2") format("woff2");
28
+ }
29
+
30
+ @font-face {
31
+ font-family: Geist;
32
+ font-style: normal;
33
+ font-weight: 400;
34
+ font-display: swap;
35
+ src: url("https://cdn.zudoku.dev/geist/Geist-Regular.woff2") format("woff2");
36
+ }
37
+
38
+ @font-face {
39
+ font-family: Geist;
40
+ font-style: normal;
41
+ font-weight: 500;
42
+ font-display: swap;
43
+ src: url("https://cdn.zudoku.dev/geist/Geist-Medium.woff2") format("woff2");
44
+ }
45
+
46
+ @font-face {
47
+ font-family: Geist;
48
+ font-style: normal;
49
+ font-weight: 600;
50
+ font-display: swap;
51
+ src: url("https://cdn.zudoku.dev/geist/Geist-SemiBold.woff2") format("woff2");
52
+ }
53
+
54
+ @font-face {
55
+ font-family: Geist;
56
+ font-style: normal;
57
+ font-weight: 700;
58
+ font-display: swap;
59
+ src: url("https://cdn.zudoku.dev/geist/Geist-Bold.woff2") format("woff2");
60
+ }
61
+
62
+ @font-face {
63
+ font-family: Geist;
64
+ font-style: normal;
65
+ font-weight: 800;
66
+ font-display: swap;
67
+ src: url("https://cdn.zudoku.dev/geist/Geist-Black.woff2") format("woff2");
68
+ }
69
+
70
+ @font-face {
71
+ font-family: Geist;
72
+ font-style: normal;
73
+ font-weight: 900;
74
+ font-display: swap;
75
+ src: url("https://cdn.zudoku.dev/geist/Geist-UltraBlack.woff2")
76
+ format("woff2");
77
+ }
78
+
5
79
  @layer base {
6
80
  :root {
7
81
  --top-header-height: 65px;
package/src/app/main.tsx CHANGED
@@ -1,18 +1,51 @@
1
- import log from "loglevel";
2
1
  import { StrictMode } from "react";
3
2
  import { createRoot } from "react-dom/client";
4
- import App from "./App.js";
5
3
 
6
- log.setDefaultLevel("silent");
4
+ // Styles
5
+ import "./main.css";
7
6
 
8
- if (import.meta.env.DEV) {
9
- log.setLevel("debug");
10
- } else if (localStorage.getItem("ENABLE_DEBUG_LOGS")) {
11
- log.setLevel("debug");
12
- }
7
+ // Logger
8
+ import "../lib/util/logInit.js";
9
+
10
+ // Config
11
+ import config from "virtual:zudoku-config";
12
+
13
+ // Plugins
14
+ import { configuredApiKeysPlugin } from "virtual:zudoku-api-keys-plugin";
15
+ import { configuredApiPlugins } from "virtual:zudoku-api-plugins";
16
+ import { configuredAuthProvider } from "virtual:zudoku-auth";
17
+ import { configuredDocsPlugins } from "virtual:zudoku-docs-plugins";
18
+ import { configuredRedirectPlugin } from "virtual:zudoku-redirect-plugin";
19
+
20
+ // Base React Component
21
+ import { DevPortal } from "zudoku/components";
22
+
23
+ // IMPORTANT: This component must not contain tailwind classes
24
+ // This directory is not processed by the tailwind plugin
13
25
 
14
26
  createRoot(document.getElementById("root")!).render(
15
27
  <StrictMode>
16
- <App />
28
+ <DevPortal
29
+ page={{
30
+ logo: config.page?.logo ?? "https://cdn.zudoku.dev/logos/icon.svg",
31
+ pageTitle: "Developer Portal",
32
+ ...config.page,
33
+ }}
34
+ metadata={{
35
+ favicon: "https://cdn.zudoku.dev/logos/icon.svg",
36
+ title: "%s | Developer Portal",
37
+ ...config.metadata,
38
+ }}
39
+ navigation={config.navigation ?? []}
40
+ authentication={configuredAuthProvider}
41
+ mdxComponents={config.mdx?.components}
42
+ plugins={[
43
+ ...configuredDocsPlugins,
44
+ ...configuredApiPlugins,
45
+ configuredRedirectPlugin,
46
+ ...(configuredApiKeysPlugin ? [configuredApiKeysPlugin] : []),
47
+ ...(configuredAuthProvider ? [configuredAuthProvider] : []),
48
+ ]}
49
+ />
17
50
  </StrictMode>,
18
51
  );
@@ -0,0 +1,20 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <link
6
+ rel="icon"
7
+ type="image/svg+xml"
8
+ href="https://cdn.zudoku.dev/logos/icon.svg"
9
+ />
10
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
11
+ <title>Dev Portal</title>
12
+ <script type="module" crossorigin src="./main.js"></script>
13
+ <link rel="stylesheet" crossorigin href="./style.css" />
14
+ </head>
15
+ <body>
16
+ <div
17
+ data-api-url="https://blue-sloth-main-afc3428.d2.zuplo.dev/schemas/rewiring-america"
18
+ ></div>
19
+ </body>
20
+ </html>
@@ -0,0 +1,46 @@
1
+ import { StrictMode } from "react";
2
+ import { createRoot } from "react-dom/client";
3
+
4
+ // Styles
5
+ import "./main.css";
6
+
7
+ // Logger
8
+ import "../lib/util/logInit.js";
9
+
10
+ // Base React Component
11
+ import { DevPortal } from "../lib/components/DevPortal.js";
12
+
13
+ // Plugins
14
+ import { openApiPlugin } from "../lib/plugins/openapi/index.js";
15
+
16
+ const root = document.querySelector("[data-api-url]");
17
+ if (!root || root.tagName !== "DIV") {
18
+ throw new Error("No div found with attribute data-api-url");
19
+ }
20
+
21
+ const apiUrl = root.getAttribute("data-api-url");
22
+ const pageTitle = document.getElementsByTagName("title")[0].innerText;
23
+ const logoUrl = root.getAttribute("data-logo-url");
24
+
25
+ // IMPORTANT: This component must not contain tailwind classes
26
+ // This directory is not processed by the tailwind plugin
27
+
28
+ createRoot(root).render(
29
+ <StrictMode>
30
+ <DevPortal
31
+ page={{
32
+ logo: logoUrl ?? "https://cdn.zudoku.dev/logos/icon.svg",
33
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
34
+ pageTitle: pageTitle ?? "Developer Portal",
35
+ }}
36
+ navigation={[
37
+ {
38
+ label: "API Reference",
39
+ path: "/",
40
+ categories: [],
41
+ },
42
+ ]}
43
+ plugins={[openApiPlugin({ type: "url", input: apiUrl!, path: "/" })]}
44
+ />
45
+ </StrictMode>,
46
+ );
@@ -1,19 +1,9 @@
1
1
  import typographyPlugin from "@tailwindcss/typography";
2
2
  import type { Config } from "tailwindcss";
3
3
  import defaultTheme from "tailwindcss/defaultTheme.js";
4
- const content = [
5
- "./src/**/*.{js,ts,jsx,tsx,md,mdx}",
6
- "./node_modules/zudoku/dist/**/*.{js,ts,jsx,tsx,md,mdx}",
7
- ];
8
4
 
9
- // ,
10
- // if (process.env.NODE_ENV === "development") {
11
- // content.push("../../plugins/*/src/**/*.{js,ts,jsx,tsx}");
12
- // }
13
-
14
- const config: Config = {
5
+ const config: Omit<Config, "content"> = {
15
6
  darkMode: "selector",
16
- content,
17
7
  theme: {
18
8
  extend: {
19
9
  fontFamily: {
@@ -1,5 +1,5 @@
1
1
  import { useEffect, useRef, useState } from "react";
2
- import { useNavigate } from "../core/router.js";
2
+ import { useNavigate } from "react-router-dom";
3
3
  import { OAuthAuthorizationError } from "./errors.js";
4
4
 
5
5
  export function Callback({
@@ -1,9 +1,6 @@
1
- import {
2
- InitializationPlugin,
3
- NavigationPlugin,
4
- } from "../../lib/core/plugins.js";
1
+ import { CommonPlugin, NavigationPlugin } from "../core/plugins.js";
5
2
 
6
- type AuthenticationPlugin = NavigationPlugin & InitializationPlugin;
3
+ type AuthenticationPlugin = NavigationPlugin & CommonPlugin;
7
4
 
8
5
  export interface AuthenticationProvider extends AuthenticationPlugin {
9
6
  login(): Promise<void>;
@@ -8,6 +8,7 @@ export const useAuth = () => {
8
8
 
9
9
  return {
10
10
  isAuthEnabled,
11
+ isPending: authState.isPending,
11
12
  profile: authState.profile,
12
13
  isAuthenticated: authState.profile,
13
14
 
@@ -7,6 +7,7 @@ class Auth0AuthenticationProvider extends OpenIDAuthenticationProvider {
7
7
  override async logout(): Promise<void> {
8
8
  useAuthState.setState({
9
9
  isAuthenticated: false,
10
+ isPending: false,
10
11
  profile: undefined,
11
12
  });
12
13
  const as = await this.getAuthServer();
@@ -34,6 +34,7 @@ const clerkAuth: AuthenticationProviderInitializer<
34
34
  if (clerkApi.session) {
35
35
  useAuthState.setState({
36
36
  isAuthenticated: true,
37
+ isPending: false,
37
38
  profile: {
38
39
  sub: clerkApi.session.user.id,
39
40
  name: clerkApi.session.user.fullName ?? undefined,
@@ -46,6 +47,7 @@ const clerkAuth: AuthenticationProviderInitializer<
46
47
  } else {
47
48
  useAuthState.setState({
48
49
  isAuthenticated: false,
50
+ isPending: false,
49
51
  profile: undefined,
50
52
  });
51
53
  }
@@ -1,7 +1,7 @@
1
1
  import logger from "loglevel";
2
2
  import * as oauth from "oauth4webapi";
3
+ import type { RouteObject } from "react-router-dom";
3
4
  import { OpenIDAuthenticationConfig } from "../../../config/config.js";
4
- import { RouteObject } from "../../core/router.js";
5
5
  import {
6
6
  AuthenticationProvider,
7
7
  AuthenticationProviderInitializer,
@@ -180,6 +180,7 @@ export class OpenIDAuthenticationProvider implements AuthenticationProvider {
180
180
  async logout(): Promise<void> {
181
181
  useAuthState.setState({
182
182
  isAuthenticated: false,
183
+ isPending: false,
183
184
  profile: undefined,
184
185
  });
185
186
 
@@ -293,6 +294,7 @@ export class OpenIDAuthenticationProvider implements AuthenticationProvider {
293
294
 
294
295
  useAuthState.setState({
295
296
  isAuthenticated: true,
297
+ isPending: false,
296
298
  profile,
297
299
  });
298
300
 
@@ -1,11 +1,13 @@
1
1
  import { create } from "zustand";
2
2
 
3
3
  export const useAuthState = create<AuthState>(() => ({
4
+ isPending: true,
4
5
  isAuthenticated: false,
5
6
  }));
6
7
 
7
8
  export interface AuthState {
8
9
  isAuthenticated: boolean;
10
+ isPending: boolean;
9
11
  profile?: UserProfile;
10
12
  }
11
13
 
@@ -1,31 +1,26 @@
1
- /* eslint-disable react/destructuring-assignment */
2
1
  import { MDXProvider } from "@mdx-js/react";
3
2
  import { QueryClientProvider } from "@tanstack/react-query";
4
- import { memo, Suspense, useEffect, useMemo } from "react";
3
+ import { Fragment, memo, Suspense, useEffect, useMemo } from "react";
4
+ import { ErrorBoundary } from "react-error-boundary";
5
+ import { Helmet, HelmetProvider } from "react-helmet-async";
5
6
  import {
6
7
  DevPortalContext,
7
8
  queryClient,
8
- type NavigationItem,
9
+ ZudokuContextOptions,
9
10
  } from "../core/DevPortalContext.js";
10
- import { HelmetProvider } from "../core/helmet.js";
11
- import { type DevPortalPlugin } from "../core/plugins.js";
12
-
13
- import { AuthenticationProvider } from "../authentication/authentication.js";
14
- import {
15
- MdxComponents,
16
- type MdxComponentsType,
17
- } from "../util/MdxComponents.js";
11
+ import { hasHead } from "../core/plugins.js";
12
+ import { TopLevelError } from "../errors/TopLevelError.js";
13
+ import { MdxComponents } from "../util/MdxComponents.js";
18
14
  import {
19
15
  ComponentsProvider,
20
16
  DEFAULT_COMPONENTS,
21
- type ComponentsContextType,
22
17
  } from "./context/ComponentsContext.js";
23
18
  import { DevPortalProvider } from "./context/DevPortalProvider.js";
24
19
  import { ThemeProvider } from "./context/ThemeContext.js";
25
20
  import { ViewportAnchorProvider } from "./context/ViewportAnchorContext.js";
26
21
  import { Router } from "./Router.js";
27
22
 
28
- export const DevPortalSystemPaths = {
23
+ const DevPortalSystemPaths = {
29
24
  Settings: "/settings",
30
25
  } as const;
31
26
 
@@ -33,22 +28,7 @@ export type DevPortalPath =
33
28
  | string
34
29
  | (typeof DevPortalSystemPaths)[keyof typeof DevPortalSystemPaths];
35
30
 
36
- export type DevPortalProps = {
37
- meta?: Partial<{
38
- headerTitle: string;
39
- pageTitle: string;
40
- description: string;
41
- logo: string;
42
- favicon: string;
43
- }>;
44
- authentication?: AuthenticationProvider;
45
- navigation: NavigationItem[];
46
- plugins?: DevPortalPlugin[];
47
- mdxComponents?: MdxComponentsType;
48
- overrides?: ComponentsContextType;
49
- };
50
-
51
- const DevPortalInner = (props: DevPortalProps) => {
31
+ const DevPortalInner = (props: ZudokuContextOptions) => {
52
32
  const components = useMemo(
53
33
  () => ({ ...DEFAULT_COMPONENTS, ...props.overrides }),
54
34
  [props.overrides],
@@ -65,9 +45,15 @@ const DevPortalInner = (props: DevPortalProps) => {
65
45
  void devPortalContext.initialize();
66
46
  }, [devPortalContext]);
67
47
 
48
+ const heads = props.plugins
49
+ ?.filter(hasHead)
50
+ // eslint-disable-next-line react/no-array-index-key
51
+ .map((plugin, i) => <Fragment key={i}>{plugin.getHead?.()}</Fragment>);
52
+
68
53
  return (
69
54
  <QueryClientProvider client={queryClient}>
70
55
  <HelmetProvider>
56
+ <Helmet>{heads}</Helmet>
71
57
  <DevPortalProvider value={devPortalContext}>
72
58
  <MDXProvider components={mdxComponents}>
73
59
  <ThemeProvider>
@@ -97,7 +83,14 @@ const DevPortalInner = (props: DevPortalProps) => {
97
83
  );
98
84
  };
99
85
 
100
- const DevPortal = memo(DevPortalInner);
86
+ const DevPortal = (props: ZudokuContextOptions) => {
87
+ const Inner = memo(DevPortalInner);
88
+ return (
89
+ <ErrorBoundary FallbackComponent={TopLevelError}>
90
+ <Inner {...props} />
91
+ </ErrorBoundary>
92
+ );
93
+ };
101
94
  DevPortal.displayName = "DevPortal";
102
95
 
103
96
  export { DevPortal };
@@ -1,4 +1,4 @@
1
- import { MoonStarIcon, SearchIcon, SunIcon } from "lucide-react";
1
+ import { MoonStarIcon, SunIcon } from "lucide-react";
2
2
  import { memo } from "react";
3
3
 
4
4
  import { useAuth } from "../authentication/hook.js";
@@ -9,7 +9,7 @@ import { useTheme } from "./context/ThemeContext.js";
9
9
  export const Header = memo(function HeaderInner() {
10
10
  const [isDark, toggleTheme] = useTheme();
11
11
  const { isAuthenticated, profile, isAuthEnabled, login, logout } = useAuth();
12
- const { meta } = useDevPortal();
12
+ const { page } = useDevPortal();
13
13
 
14
14
  const ThemeIcon = isDark ? MoonStarIcon : SunIcon;
15
15
 
@@ -18,16 +18,16 @@ export const Header = memo(function HeaderInner() {
18
18
  <div className="max-w-screen-2xl mx-auto">
19
19
  <div className="grid grid-cols-[calc(var(--side-nav-width))_1fr] lg:gap-12 items-center border-b border-border px-12 h-[--top-header-height]">
20
20
  <div className="flex items-center gap-3.5">
21
- {meta?.logo && (
22
- <img src={meta.logo} alt="My Dev Portal" className="h-10" />
21
+ {page?.logo && (
22
+ <img src={page.logo} alt={page.pageTitle} className="h-10" />
23
23
  )}
24
24
  <span className="font-bold text-2xl text-foreground/85 tracking-wide">
25
- {meta?.headerTitle}
25
+ {page?.pageTitle}
26
26
  </span>
27
27
  </div>
28
28
  <div className="grid grid-cols-[--sidecar-grid-cols] items-center gap-8">
29
29
  <div className="w-full max-w-prose">
30
- <button className="flex items-center border border-input hover:bg-accent hover:text-accent-foreground p-4 relative h-8 justify-start rounded-lg bg-background text-sm text-muted-foreground shadow-none w-40 sm:w-72">
30
+ {/*<button className="flex items-center border border-input hover:bg-accent hover:text-accent-foreground p-4 relative h-8 justify-start rounded-lg bg-background text-sm text-muted-foreground shadow-none w-40 sm:w-72">
31
31
  <div className="flex items-center gap-2 flex-grow">
32
32
  <SearchIcon size={14} />
33
33
  Search
@@ -35,7 +35,7 @@ export const Header = memo(function HeaderInner() {
35
35
  <kbd className="absolute right-[0.3rem] top-[0.3rem] hidden h-5 select-none items-center gap-1 rounded border border-border bg-muted px-1.5 font-mono text-[11px] font-medium opacity-100 sm:flex">
36
36
  ⌘K
37
37
  </kbd>
38
- </button>
38
+ </button>*/}
39
39
  </div>
40
40
 
41
41
  <div className="items-center justify-self-end text-sm hidden lg:flex">
@@ -1,7 +1,24 @@
1
- import { type ReactNode } from "react";
2
- import { cn } from "../util/cn.js";
1
+ import React, { type ReactNode } from "react";
3
2
  import { useRegisterAnchorElement } from "./context/ViewportAnchorContext.js";
4
3
 
4
+ import { cva, type VariantProps } from "class-variance-authority";
5
+
6
+ const heading = cva("group relative", {
7
+ variants: {
8
+ level: {
9
+ 6: "text-md",
10
+ 5: "text-lg",
11
+ 4: "text-xl",
12
+ 3: "text-xl font-semibold",
13
+ 2: "text-2xl font-bold",
14
+ 1: "text-4xl font-extrabold",
15
+ },
16
+ },
17
+ defaultVariants: {
18
+ level: 1,
19
+ },
20
+ });
21
+
5
22
  const getComponent = (level: number) => {
6
23
  switch (level) {
7
24
  case 1:
@@ -21,27 +38,29 @@ const getComponent = (level: number) => {
21
38
  }
22
39
  };
23
40
 
24
- export type HeadingProps = {
41
+ export interface HeadingProps
42
+ extends React.ButtonHTMLAttributes<HTMLButtonElement>,
43
+ VariantProps<typeof heading> {
25
44
  children: ReactNode;
26
45
  className?: string;
27
46
  id?: string;
28
47
  level?: 1 | 2 | 3 | 4 | 5 | 6;
29
48
  registerSidebarAnchor?: boolean;
30
- };
49
+ }
31
50
 
32
- export const Heading = ({
51
+ export const Heading: React.FC<HeadingProps> = ({
33
52
  level,
34
53
  children,
35
54
  id,
36
55
  className,
37
56
  registerSidebarAnchor,
38
- }: HeadingProps) => {
57
+ }) => {
39
58
  const Component = getComponent(level ?? 1);
40
59
  const { ref } = useRegisterAnchorElement();
41
60
 
42
61
  return (
43
62
  <Component
44
- className={cn("group relative", className)}
63
+ className={heading({ className, level })}
45
64
  ref={registerSidebarAnchor ? ref : undefined}
46
65
  id={id}
47
66
  >
@@ -1,6 +1,6 @@
1
1
  import { Suspense, useEffect, useRef, type ReactNode } from "react";
2
+ import { Helmet } from "react-helmet-async";
2
3
  import { Outlet, useLocation } from "react-router-dom";
3
- import { Helmet } from "../core/helmet.js";
4
4
  import { useScrollToAnchor } from "../util/useScrollToAnchor.js";
5
5
  import { useScrollToTop } from "../util/useScrollToTop.js";
6
6
  import { useDevPortal } from "./context/DevPortalProvider.js";
@@ -29,8 +29,7 @@ export const Layout = ({ children }: { children?: ReactNode }) => {
29
29
 
30
30
  return (
31
31
  <>
32
- <Helmet titleTemplate={meta?.pageTitle}>
33
- <title>Home</title>
32
+ <Helmet titleTemplate={meta?.title}>
34
33
  {meta?.description && (
35
34
  <meta name="description" content={meta.description} />
36
35
  )}
@@ -48,7 +47,7 @@ export const Layout = ({ children }: { children?: ReactNode }) => {
48
47
  >
49
48
  <SideNavigation />
50
49
  <main
51
- className="dark:border-white/10 translate-x-0
50
+ className="dark:border-white/10 translate-x-0 h-full
52
51
  lg:overflow-visible
53
52
  lg:peer-data-[navigation=true]:w-[calc(100%-var(--side-nav-width))]
54
53
  lg:peer-data-[navigation=true]:translate-x-[--side-nav-width] peer-data-[navigation=true]:pl-12"
@@ -1,6 +1,8 @@
1
1
  import { useMemo } from "react";
2
2
  import { createBrowserRouter, RouterProvider } from "react-router-dom";
3
3
  import { DevPortalPlugin, isNavigationPlugin } from "../core/plugins.js";
4
+
5
+ import { RouterError } from "../errors/RouterError.js";
4
6
  import { Layout } from "./Layout.js";
5
7
 
6
8
  export function Router({ plugins }: { plugins?: DevPortalPlugin[] }) {
@@ -13,13 +15,7 @@ export function Router({ plugins }: { plugins?: DevPortalPlugin[] }) {
13
15
  {
14
16
  path: "/",
15
17
  element: <Layout />,
16
- errorElement: (
17
- <Layout>
18
- <div className="h-[75vh] flex items-center justify-center">
19
- Error, look at the console
20
- </div>
21
- </Layout>
22
- ),
18
+ errorElement: <RouterError />,
23
19
  children: routes,
24
20
  },
25
21
  ]);
@@ -21,6 +21,10 @@ if (!import.meta.env.SSR) {
21
21
  import("prismjs/components/prism-json.min.js");
22
22
  // @ts-expect-error This is untyped
23
23
  import("prismjs/components/prism-java.min.js");
24
+ // @ts-expect-error This is untyped
25
+ import("prismjs/components/prism-csharp.min.js");
26
+ // @ts-expect-error This is untyped
27
+ import("prismjs/components/prism-objectivec.min.js");
24
28
  }
25
29
 
26
30
  import { useState } from "react";
@@ -67,7 +71,7 @@ export const SyntaxHighlight = ({
67
71
  disabled={isCopied}
68
72
  onClick={() => {
69
73
  setIsCopied(true);
70
- navigator.clipboard.writeText(
74
+ void navigator.clipboard.writeText(
71
75
  tokens
72
76
  .map((line) => line.map(({ content }) => content).join(""))
73
77
  .join("\n"),
@@ -6,6 +6,11 @@ import { useDevPortal } from "./context/DevPortalProvider.js";
6
6
  export const TopNavigation = () => {
7
7
  const { navigation } = useDevPortal();
8
8
 
9
+ // Hide tope nav if there is only one item
10
+ if (navigation.length <= 1) {
11
+ return null;
12
+ }
13
+
9
14
  return (
10
15
  <nav className="border-b border-border text-sm px-12 h-[--top-nav-height]">
11
16
  <ul className="flex flex-row items-center gap-8">
@@ -1,4 +1,4 @@
1
- import { useSuspenseQuery } from "@tanstack/react-query";
1
+ import { useQuery, useSuspenseQuery } from "@tanstack/react-query";
2
2
  import { createContext, useContext } from "react";
3
3
  import { matchPath, useLocation } from "react-router-dom";
4
4
  import { DevPortalContext } from "../../core/DevPortalContext.js";
@@ -21,7 +21,7 @@ export const useDevPortal = () => {
21
21
 
22
22
  export const useApiIdentities = () => {
23
23
  const { getApiIdentities } = useDevPortal();
24
- return useSuspenseQuery({
24
+ return useQuery({
25
25
  queryFn: getApiIdentities,
26
26
  queryKey: ["api-identities"],
27
27
  });
@@ -1,3 +1,9 @@
1
- export { useMDXComponents } from "@mdx-js/react";
2
- export { DevPortal } from "./DevPortal.js";
3
- export { Link } from "./Link.js";
1
+ import { useMDXComponents as useMDXComponentsImport } from "@mdx-js/react";
2
+ import { Link as LinkImport } from "react-router-dom";
3
+ import { Callout as CalloutImport } from "../ui/Callout.js";
4
+ import { DevPortal as DevPortalImport } from "./DevPortal.js";
5
+
6
+ export const useMDXComponents = /*@__PURE__*/ useMDXComponentsImport;
7
+ export const Callout = /*@__PURE__*/ CalloutImport;
8
+ export const DevPortal = /*@__PURE__*/ DevPortalImport;
9
+ export const Link = /*@__PURE__*/ LinkImport;