zudoku 0.1.1-dev.2 → 0.1.1-dev.20

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 (525) hide show
  1. package/cli.js +2 -0
  2. package/dist/app/App.js +22 -0
  3. package/dist/app/App.js.map +1 -0
  4. package/dist/app/main.js +4 -16
  5. package/dist/app/main.js.map +1 -1
  6. package/dist/cli/cmds/dev.js +0 -1
  7. package/dist/cli/cmds/dev.js.map +1 -1
  8. package/dist/cli/common/logger.d.ts +1 -2
  9. package/dist/cli/common/logger.js +2 -4
  10. package/dist/cli/common/logger.js.map +1 -1
  11. package/dist/cli/dev/handler.d.ts +1 -1
  12. package/dist/cli/dev/handler.js +11 -2
  13. package/dist/cli/dev/handler.js.map +1 -1
  14. package/dist/config/config.d.ts +12 -7
  15. package/dist/index.d.ts +2 -6
  16. package/dist/index.js +1 -5
  17. package/dist/index.js.map +1 -1
  18. package/dist/{app → lib}/DevPortal.d.ts +2 -3
  19. package/dist/{app → lib}/DevPortal.js +6 -19
  20. package/dist/lib/DevPortal.js.map +1 -0
  21. package/dist/{app → lib}/Heading.js.map +1 -1
  22. package/dist/lib/Router.d.ts +4 -0
  23. package/dist/lib/Router.js +20 -0
  24. package/dist/lib/Router.js.map +1 -0
  25. package/dist/lib/auth.d.ts +1 -0
  26. package/dist/lib/auth.js +2 -0
  27. package/dist/lib/auth.js.map +1 -0
  28. package/dist/lib/authentication/authentication.js.map +1 -0
  29. package/dist/{app → lib}/authentication/clerk.d.ts +1 -2
  30. package/dist/{app → lib}/authentication/clerk.js +1 -2
  31. package/dist/lib/authentication/clerk.js.map +1 -0
  32. package/dist/{app → lib}/authentication/openid.js +2 -2
  33. package/dist/lib/authentication/openid.js.map +1 -0
  34. package/dist/{app → lib}/components/AnchorLink.js.map +1 -1
  35. package/dist/{app → lib}/components/CategoryHeading.js.map +1 -1
  36. package/dist/lib/components/Dialog.d.ts +19 -0
  37. package/dist/lib/components/Dialog.js +23 -0
  38. package/dist/lib/components/Dialog.js.map +1 -0
  39. package/dist/{app → lib}/components/DynamicIcon.js.map +1 -1
  40. package/dist/{app → lib}/components/Header.d.ts +0 -1
  41. package/dist/{app → lib}/components/Header.js.map +1 -1
  42. package/dist/lib/components/Input.d.ts +5 -0
  43. package/dist/lib/components/Input.js +9 -0
  44. package/dist/lib/components/Input.js.map +1 -0
  45. package/dist/{app → lib}/components/Layout.js.map +1 -1
  46. package/dist/{app → lib}/components/Markdown.js.map +1 -1
  47. package/dist/{app → lib}/components/SyntaxHighlight.js +2 -0
  48. package/dist/lib/components/SyntaxHighlight.js.map +1 -0
  49. package/dist/{app → lib}/components/TopNavigation.js.map +1 -1
  50. package/dist/{app → lib}/components/context/ComponentsContext.js.map +1 -1
  51. package/dist/{app → lib}/components/context/DevPortalProvider.d.ts +0 -1
  52. package/dist/{app → lib}/components/context/DevPortalProvider.js.map +1 -1
  53. package/dist/lib/components/context/PluginSystem.js.map +1 -0
  54. package/dist/{app → lib}/components/context/ThemeContext.js.map +1 -1
  55. package/dist/{app → lib}/components/context/ViewportAnchorContext.js.map +1 -1
  56. package/dist/{app → lib}/components/navigation/SideNavigation.js.map +1 -1
  57. package/dist/{app → lib}/components/navigation/SideNavigationCategory.js.map +1 -1
  58. package/dist/{app → lib}/components/navigation/SideNavigationItem.js.map +1 -1
  59. package/dist/{app → lib}/components/navigation/SideNavigationWrapper.d.ts +1 -2
  60. package/dist/{app → lib}/components/navigation/SideNavigationWrapper.js.map +1 -1
  61. package/dist/{app → lib}/components/navigation/useNavigationCollapsibleState.d.ts +0 -1
  62. package/dist/{app → lib}/components/navigation/useNavigationCollapsibleState.js.map +1 -1
  63. package/dist/{app → lib}/components/navigation/util.js.map +1 -1
  64. package/dist/lib/components.d.ts +3 -0
  65. package/dist/lib/components.js +4 -0
  66. package/dist/lib/components.js.map +1 -0
  67. package/dist/{app → lib}/core/DevPortalContext.js.map +1 -1
  68. package/dist/{app → lib}/core/helmet.js.map +1 -1
  69. package/dist/lib/core/icons.js.map +1 -0
  70. package/dist/{app → lib}/core/plugins.js.map +1 -1
  71. package/dist/lib/core/router.js.map +1 -0
  72. package/dist/lib/core/types/combine.js.map +1 -0
  73. package/dist/{app → lib}/oas/graphql/index.js.map +1 -1
  74. package/dist/{app → lib}/oas/graphql/server.js.map +1 -1
  75. package/dist/{app → lib}/oas/parser/dereference/index.js.map +1 -1
  76. package/dist/{app → lib}/oas/parser/dereference/resolveRef.js.map +1 -1
  77. package/dist/{app → lib}/oas/parser/index.js.map +1 -1
  78. package/dist/{app → lib}/oas/parser/upgrade/index.js.map +1 -1
  79. package/dist/{app → lib}/plugins/api-key/SettingsApiKeys.js.map +1 -1
  80. package/dist/{app → lib}/plugins/api-key/index.js.map +1 -1
  81. package/dist/{app → lib}/plugins/markdown/MdxPage.js.map +1 -1
  82. package/dist/{app → lib}/plugins/markdown/Toc.js.map +1 -1
  83. package/dist/{app → lib}/plugins/markdown/generateRoutes.js.map +1 -1
  84. package/dist/{app → lib}/plugins/markdown/index.d.ts +0 -1
  85. package/dist/{app → lib}/plugins/markdown/index.js.map +1 -1
  86. package/dist/lib/plugins/openapi/ColorizedParam.d.ts +12 -0
  87. package/dist/{app → lib}/plugins/openapi/ColorizedParam.js +10 -5
  88. package/dist/lib/plugins/openapi/ColorizedParam.js.map +1 -0
  89. package/dist/lib/plugins/openapi/MakeRequest.js +23 -0
  90. package/dist/lib/plugins/openapi/MakeRequest.js.map +1 -0
  91. package/dist/{app → lib}/plugins/openapi/MethodBadge.js.map +1 -1
  92. package/dist/lib/plugins/openapi/OperationList.d.ts +4 -0
  93. package/dist/{app → lib}/plugins/openapi/OperationList.js +16 -16
  94. package/dist/lib/plugins/openapi/OperationList.js.map +1 -0
  95. package/dist/{app → lib}/plugins/openapi/OperationListItem.d.ts +2 -2
  96. package/dist/{app → lib}/plugins/openapi/OperationListItem.js +2 -2
  97. package/dist/lib/plugins/openapi/OperationListItem.js.map +1 -0
  98. package/dist/{app → lib}/plugins/openapi/ParameterList.js.map +1 -1
  99. package/dist/{app → lib}/plugins/openapi/ParameterListItem.js.map +1 -1
  100. package/dist/lib/plugins/openapi/RequestBodySidecarBox.js +19 -0
  101. package/dist/lib/plugins/openapi/RequestBodySidecarBox.js.map +1 -0
  102. package/dist/{app → lib}/plugins/openapi/ResponsesSidecarBox.js +1 -1
  103. package/dist/lib/plugins/openapi/ResponsesSidecarBox.js.map +1 -0
  104. package/dist/{app → lib}/plugins/openapi/Select.js.map +1 -1
  105. package/dist/lib/plugins/openapi/Sidecar.js +94 -0
  106. package/dist/lib/plugins/openapi/Sidecar.js.map +1 -0
  107. package/dist/lib/plugins/openapi/SidecarBox.d.ts +8 -0
  108. package/dist/lib/plugins/openapi/SidecarBox.js +6 -0
  109. package/dist/lib/plugins/openapi/SidecarBox.js.map +1 -0
  110. package/dist/lib/plugins/openapi/graphql/fragment-masking.d.ts +19 -0
  111. package/dist/lib/plugins/openapi/graphql/fragment-masking.js +16 -0
  112. package/dist/lib/plugins/openapi/graphql/fragment-masking.js.map +1 -0
  113. package/dist/lib/plugins/openapi/graphql/gql.d.ts +58 -0
  114. package/dist/lib/plugins/openapi/graphql/gql.js +22 -0
  115. package/dist/lib/plugins/openapi/graphql/gql.js.map +1 -0
  116. package/dist/lib/plugins/openapi/graphql/graphql.d.ts +282 -0
  117. package/dist/lib/plugins/openapi/graphql/graphql.js +526 -0
  118. package/dist/lib/plugins/openapi/graphql/graphql.js.map +1 -0
  119. package/dist/lib/plugins/openapi/graphql/index.d.ts +2 -0
  120. package/dist/lib/plugins/openapi/graphql/index.js +3 -0
  121. package/dist/lib/plugins/openapi/graphql/index.js.map +1 -0
  122. package/dist/{app → lib}/plugins/openapi/index.d.ts +0 -1
  123. package/dist/{app → lib}/plugins/openapi/index.js +1 -1
  124. package/dist/{app → lib}/plugins/openapi/index.js.map +1 -1
  125. package/dist/lib/plugins/openapi/playground/Playground.d.ts +8 -0
  126. package/dist/lib/plugins/openapi/playground/Playground.js +98 -0
  127. package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -0
  128. package/dist/{app → lib}/plugins/openapi/util/generateSchemaExample.js.map +1 -1
  129. package/dist/{app → lib}/plugins/openapi/util/urql.d.ts +0 -1
  130. package/dist/{app → lib}/plugins/openapi/util/urql.js.map +1 -1
  131. package/dist/{app → lib}/plugins/openapi/worker/createSharedWorkerClient.js.map +1 -1
  132. package/dist/lib/plugins/openapi/worker/shared-worker.d.ts +1 -0
  133. package/dist/lib/plugins/openapi/worker/shared-worker.js +6 -0
  134. package/dist/lib/plugins/openapi/worker/shared-worker.js.map +1 -0
  135. package/dist/{app → lib}/plugins/openapi/worker/worker.js.map +1 -1
  136. package/dist/{app → lib}/plugins/redirect/index.js.map +1 -1
  137. package/dist/lib/plugins.d.ts +4 -0
  138. package/dist/lib/plugins.js +6 -0
  139. package/dist/lib/plugins.js.map +1 -0
  140. package/dist/lib/ui/Button.d.ts +11 -0
  141. package/dist/lib/ui/Button.js +34 -0
  142. package/dist/lib/ui/Button.js.map +1 -0
  143. package/dist/{app → lib}/ui/Callout.js.map +1 -1
  144. package/dist/{app → lib}/ui/Card.js +1 -1
  145. package/dist/{app → lib}/ui/Card.js.map +1 -1
  146. package/dist/{app → lib}/ui/Note.js.map +1 -1
  147. package/dist/lib/ui/Tabs.d.ts +7 -0
  148. package/dist/lib/ui/Tabs.js +13 -0
  149. package/dist/lib/ui/Tabs.js.map +1 -0
  150. package/dist/{app → lib}/util/MdxComponents.d.ts +2 -2
  151. package/dist/{app → lib}/util/MdxComponents.js.map +1 -1
  152. package/dist/{app → lib}/util/cn.js.map +1 -1
  153. package/dist/lib/util/createVariantComponent.d.ts +15 -0
  154. package/dist/lib/util/createVariantComponent.js +12 -0
  155. package/dist/lib/util/createVariantComponent.js.map +1 -0
  156. package/dist/lib/util/createWaitForNotify.d.ts +1 -0
  157. package/dist/{app → lib}/util/createWaitForNotify.js.map +1 -1
  158. package/dist/{app → lib}/util/groupBy.js.map +1 -1
  159. package/dist/{app → lib}/util/joinPath.js.map +1 -1
  160. package/dist/{app → lib}/util/pastellize.js.map +1 -1
  161. package/dist/{app → lib}/util/slugify.d.ts +0 -1
  162. package/dist/lib/util/slugify.js.map +1 -0
  163. package/dist/{app → lib}/util/traverseNavigation.js.map +1 -1
  164. package/dist/{app → lib}/util/useScrollToAnchor.js.map +1 -1
  165. package/dist/{app → lib}/util/useScrollToTop.js.map +1 -1
  166. package/dist/ts.d.ts +6 -0
  167. package/dist/ts.js +62 -0
  168. package/dist/ts.js.map +1 -0
  169. package/dist/vite/build.js +2 -8
  170. package/dist/vite/build.js.map +1 -1
  171. package/dist/vite/config.d.ts +8 -2
  172. package/dist/vite/config.js +103 -23
  173. package/dist/vite/config.js.map +1 -1
  174. package/dist/vite/config.test.d.ts +1 -0
  175. package/dist/vite/config.test.js +10 -0
  176. package/dist/vite/config.test.js.map +1 -0
  177. package/dist/vite/dev-server.js +8 -4
  178. package/dist/vite/dev-server.js.map +1 -1
  179. package/dist/vite/html.d.ts +1 -1
  180. package/dist/vite/html.js +2 -3
  181. package/dist/vite/html.js.map +1 -1
  182. package/dist/vite/plugin-api.d.ts +4 -0
  183. package/dist/vite/plugin-api.js +47 -0
  184. package/dist/vite/plugin-api.js.map +1 -0
  185. package/dist/vite/plugin-auth.d.ts +4 -0
  186. package/dist/vite/plugin-auth.js +28 -0
  187. package/dist/vite/plugin-auth.js.map +1 -0
  188. package/dist/vite/plugin-component.d.ts +3 -0
  189. package/dist/vite/plugin-component.js +22 -0
  190. package/dist/vite/plugin-component.js.map +1 -0
  191. package/dist/vite/plugin-config.d.ts +6 -0
  192. package/dist/vite/plugin-config.js +24 -0
  193. package/dist/vite/plugin-config.js.map +1 -0
  194. package/dist/vite/plugin-docs.d.ts +4 -0
  195. package/dist/vite/plugin-docs.js +43 -0
  196. package/dist/vite/plugin-docs.js.map +1 -0
  197. package/dist/vite/plugin-docs.test.d.ts +1 -0
  198. package/dist/vite/plugin-docs.test.js +30 -0
  199. package/dist/vite/plugin-docs.test.js.map +1 -0
  200. package/dist/vite/plugin-html.d.ts +3 -0
  201. package/dist/vite/plugin-html.js +47 -0
  202. package/dist/vite/plugin-html.js.map +1 -0
  203. package/dist/vite/plugin-mdx.d.ts +8 -0
  204. package/dist/vite/plugin-mdx.js +61 -0
  205. package/dist/vite/plugin-mdx.js.map +1 -0
  206. package/dist/vite/plugin-metadata.d.ts +6 -0
  207. package/dist/vite/plugin-metadata.js +24 -0
  208. package/dist/vite/plugin-metadata.js.map +1 -0
  209. package/dist/vite/plugin.d.ts +2 -6
  210. package/dist/vite/plugin.js +14 -104
  211. package/dist/vite/plugin.js.map +1 -1
  212. package/lib/DevPortal-DqcnbwLT.js +12967 -0
  213. package/lib/assets/index-BPdJm2ty.js +4764 -0
  214. package/lib/assets/worker-CnXQsqxH.js +14511 -0
  215. package/lib/prism-bash.min-DadFsM4Z.js +6 -0
  216. package/lib/prism-java.min-d5iT_mOd.js +6 -0
  217. package/lib/prism-json.min-B1GJqK1k.js +1 -0
  218. package/lib/prism-markup-templating-DZrrEs0A.js +61 -0
  219. package/lib/prism-php.min-o7FpoMP_.js +10 -0
  220. package/lib/prism-ruby.min-C7LwcKyz.js +9 -0
  221. package/lib/urql-B7mLfVog.js +1611 -0
  222. package/lib/zudoku.auth.js +31 -0
  223. package/lib/zudoku.components.js +6 -0
  224. package/lib/zudoku.openapi-worker.js +143 -0
  225. package/lib/zudoku.plugins.js +15650 -0
  226. package/package.json +53 -35
  227. package/src/app/App.tsx +33 -0
  228. package/src/app/main.tsx +6 -19
  229. package/src/cli/build/handler.ts +14 -0
  230. package/src/cli/cli.ts +77 -0
  231. package/src/cli/cmds/build.ts +24 -0
  232. package/src/cli/cmds/dev.ts +29 -0
  233. package/src/cli/common/analytics/lib.ts +89 -0
  234. package/src/cli/common/constants.ts +10 -0
  235. package/src/cli/common/logger.ts +5 -0
  236. package/src/cli/common/machine-id/lib.ts +85 -0
  237. package/src/cli/common/outdated.ts +102 -0
  238. package/src/cli/common/output.ts +86 -0
  239. package/src/cli/common/utils/box.license.txt +202 -0
  240. package/src/cli/common/utils/box.ts +116 -0
  241. package/src/cli/common/utils/ports.ts +21 -0
  242. package/src/cli/common/validators/lib.ts +43 -0
  243. package/src/cli/common/xdg/lib.ts +36 -0
  244. package/src/cli/dev/handler.ts +42 -0
  245. package/src/config/config.ts +56 -0
  246. package/src/index.ts +8 -0
  247. package/src/{app → lib}/DevPortal.tsx +7 -29
  248. package/src/lib/Router.tsx +28 -0
  249. package/src/lib/auth.ts +1 -0
  250. package/src/{app → lib}/authentication/clerk.ts +1 -3
  251. package/src/lib/components/Dialog.tsx +119 -0
  252. package/src/lib/components/Input.tsx +24 -0
  253. package/src/{app → lib}/components/SyntaxHighlight.tsx +2 -0
  254. package/src/lib/components.ts +3 -0
  255. package/src/{app → lib}/plugins/openapi/ColorizedParam.tsx +18 -9
  256. package/src/{app → lib}/plugins/openapi/MakeRequest.tsx +19 -0
  257. package/src/{app → lib}/plugins/openapi/OperationList.tsx +20 -22
  258. package/src/{app → lib}/plugins/openapi/OperationListItem.tsx +3 -3
  259. package/src/lib/plugins/openapi/RequestBodySidecarBox.tsx +51 -0
  260. package/src/{app → lib}/plugins/openapi/ResponsesSidecarBox.tsx +1 -1
  261. package/src/{app → lib}/plugins/openapi/Sidecar.tsx +81 -20
  262. package/src/lib/plugins/openapi/SidecarBox.tsx +36 -0
  263. package/src/lib/plugins/openapi/graphql/fragment-masking.ts +111 -0
  264. package/src/lib/plugins/openapi/graphql/gql.ts +70 -0
  265. package/src/lib/plugins/openapi/graphql/graphql.ts +795 -0
  266. package/src/lib/plugins/openapi/graphql/index.ts +2 -0
  267. package/src/{app → lib}/plugins/openapi/index.tsx +6 -2
  268. package/src/lib/plugins/openapi/playground/Playground.tsx +309 -0
  269. package/src/lib/plugins/openapi/queries.graphql +6 -0
  270. package/src/lib/plugins/openapi/worker/shared-worker.ts +5 -0
  271. package/src/lib/plugins.ts +5 -0
  272. package/src/lib/ui/Button.tsx +56 -0
  273. package/src/{app → lib}/ui/Card.tsx +1 -1
  274. package/src/lib/ui/Tabs.tsx +52 -0
  275. package/src/lib/util/createVariantComponent.tsx +30 -0
  276. package/src/ts.ts +94 -0
  277. package/src/types.d.ts +24 -0
  278. package/src/vite/build.ts +33 -0
  279. package/src/vite/config.test.ts +10 -0
  280. package/src/vite/config.ts +183 -0
  281. package/src/vite/dev-server.ts +64 -0
  282. package/src/vite/html.ts +37 -0
  283. package/src/vite/plugin-api.ts +57 -0
  284. package/src/vite/plugin-auth.ts +32 -0
  285. package/src/vite/plugin-component.ts +26 -0
  286. package/src/vite/plugin-config.ts +31 -0
  287. package/src/vite/plugin-docs.test.ts +32 -0
  288. package/src/vite/plugin-docs.ts +52 -0
  289. package/src/vite/plugin-html.ts +50 -0
  290. package/src/vite/plugin-mdx.ts +74 -0
  291. package/src/vite/plugin-metadata.ts +30 -0
  292. package/src/vite/plugin.ts +23 -0
  293. package/dist/app/DevPortal.js.map +0 -1
  294. package/dist/app/app.js +0 -69
  295. package/dist/app/app.js.map +0 -1
  296. package/dist/app/authentication/authentication.js.map +0 -1
  297. package/dist/app/authentication/clerk.js.map +0 -1
  298. package/dist/app/authentication/openid.js.map +0 -1
  299. package/dist/app/components/SyntaxHighlight.js.map +0 -1
  300. package/dist/app/components/context/PluginSystem.js.map +0 -1
  301. package/dist/app/config.d.ts +0 -3
  302. package/dist/app/config.js +0 -9
  303. package/dist/app/config.js.map +0 -1
  304. package/dist/app/core/icons.js.map +0 -1
  305. package/dist/app/core/router.js.map +0 -1
  306. package/dist/app/core/types/combine.js.map +0 -1
  307. package/dist/app/markdowns.d.ts +0 -3
  308. package/dist/app/markdowns.js +0 -5
  309. package/dist/app/markdowns.js.map +0 -1
  310. package/dist/app/plugins/openapi/ColorizedParam.d.ts +0 -8
  311. package/dist/app/plugins/openapi/ColorizedParam.js.map +0 -1
  312. package/dist/app/plugins/openapi/MakeRequest.js +0 -11
  313. package/dist/app/plugins/openapi/MakeRequest.js.map +0 -1
  314. package/dist/app/plugins/openapi/OperationList.d.ts +0 -47
  315. package/dist/app/plugins/openapi/OperationList.js.map +0 -1
  316. package/dist/app/plugins/openapi/OperationListItem.js.map +0 -1
  317. package/dist/app/plugins/openapi/RequestBodySidecarBox.js +0 -19
  318. package/dist/app/plugins/openapi/RequestBodySidecarBox.js.map +0 -1
  319. package/dist/app/plugins/openapi/ResponsesSidecarBox.js.map +0 -1
  320. package/dist/app/plugins/openapi/Sidecar.js +0 -39
  321. package/dist/app/plugins/openapi/Sidecar.js.map +0 -1
  322. package/dist/app/plugins/openapi/SidecarBox.d.ts +0 -10
  323. package/dist/app/plugins/openapi/SidecarBox.js +0 -8
  324. package/dist/app/plugins/openapi/SidecarBox.js.map +0 -1
  325. package/dist/app/plugins/openapi/graphql/index.d.ts +0 -836
  326. package/dist/app/plugins/openapi/graphql/index.js +0 -4
  327. package/dist/app/plugins/openapi/graphql/index.js.map +0 -1
  328. package/dist/app/plugins/openapi/util/getCode.d.ts +0 -2
  329. package/dist/app/plugins/openapi/util/getCode.js +0 -54
  330. package/dist/app/plugins/openapi/util/getCode.js.map +0 -1
  331. package/dist/app/util/createWaitForNotify.d.ts +0 -1
  332. package/dist/app/util/slugify.js.map +0 -1
  333. package/dist/auth.d.ts +0 -2
  334. package/dist/auth.js +0 -3
  335. package/dist/auth.js.map +0 -1
  336. package/dist/plugins.d.ts +0 -4
  337. package/dist/plugins.js +0 -6
  338. package/dist/plugins.js.map +0 -1
  339. package/src/app/app.tsx +0 -85
  340. package/src/app/config.ts +0 -20
  341. package/src/app/markdowns.ts +0 -7
  342. package/src/app/plugins/openapi/RequestBodySidecarBox.tsx +0 -48
  343. package/src/app/plugins/openapi/SidecarBox.tsx +0 -35
  344. package/src/app/plugins/openapi/graphql/env.d.ts +0 -48
  345. package/src/app/plugins/openapi/graphql/index.ts +0 -13
  346. package/src/app/plugins/openapi/util/getCode.tsx +0 -69
  347. /package/dist/app/{app.d.ts → App.d.ts} +0 -0
  348. /package/dist/{app → lib}/Heading.d.ts +0 -0
  349. /package/dist/{app → lib}/Heading.js +0 -0
  350. /package/dist/{app → lib}/authentication/authentication.d.ts +0 -0
  351. /package/dist/{app → lib}/authentication/authentication.js +0 -0
  352. /package/dist/{app → lib}/authentication/openid.d.ts +0 -0
  353. /package/dist/{app → lib}/components/AnchorLink.d.ts +0 -0
  354. /package/dist/{app → lib}/components/AnchorLink.js +0 -0
  355. /package/dist/{app → lib}/components/CategoryHeading.d.ts +0 -0
  356. /package/dist/{app → lib}/components/CategoryHeading.js +0 -0
  357. /package/dist/{app → lib}/components/DynamicIcon.d.ts +0 -0
  358. /package/dist/{app → lib}/components/DynamicIcon.js +0 -0
  359. /package/dist/{app → lib}/components/Header.js +0 -0
  360. /package/dist/{app → lib}/components/Layout.d.ts +0 -0
  361. /package/dist/{app → lib}/components/Layout.js +0 -0
  362. /package/dist/{app → lib}/components/Markdown.d.ts +0 -0
  363. /package/dist/{app → lib}/components/Markdown.js +0 -0
  364. /package/dist/{app → lib}/components/SyntaxHighlight.d.ts +0 -0
  365. /package/dist/{app → lib}/components/TopNavigation.d.ts +0 -0
  366. /package/dist/{app → lib}/components/TopNavigation.js +0 -0
  367. /package/dist/{app → lib}/components/context/ComponentsContext.d.ts +0 -0
  368. /package/dist/{app → lib}/components/context/ComponentsContext.js +0 -0
  369. /package/dist/{app → lib}/components/context/DevPortalProvider.js +0 -0
  370. /package/dist/{app → lib}/components/context/PluginSystem.d.ts +0 -0
  371. /package/dist/{app → lib}/components/context/PluginSystem.js +0 -0
  372. /package/dist/{app → lib}/components/context/ThemeContext.d.ts +0 -0
  373. /package/dist/{app → lib}/components/context/ThemeContext.js +0 -0
  374. /package/dist/{app → lib}/components/context/ViewportAnchorContext.d.ts +0 -0
  375. /package/dist/{app → lib}/components/context/ViewportAnchorContext.js +0 -0
  376. /package/dist/{app → lib}/components/navigation/SideNavigation.d.ts +0 -0
  377. /package/dist/{app → lib}/components/navigation/SideNavigation.js +0 -0
  378. /package/dist/{app → lib}/components/navigation/SideNavigationCategory.d.ts +0 -0
  379. /package/dist/{app → lib}/components/navigation/SideNavigationCategory.js +0 -0
  380. /package/dist/{app → lib}/components/navigation/SideNavigationItem.d.ts +0 -0
  381. /package/dist/{app → lib}/components/navigation/SideNavigationItem.js +0 -0
  382. /package/dist/{app → lib}/components/navigation/SideNavigationWrapper.js +0 -0
  383. /package/dist/{app → lib}/components/navigation/useNavigationCollapsibleState.js +0 -0
  384. /package/dist/{app → lib}/components/navigation/util.d.ts +0 -0
  385. /package/dist/{app → lib}/components/navigation/util.js +0 -0
  386. /package/dist/{app → lib}/core/DevPortalContext.d.ts +0 -0
  387. /package/dist/{app → lib}/core/DevPortalContext.js +0 -0
  388. /package/dist/{app → lib}/core/helmet.d.ts +0 -0
  389. /package/dist/{app → lib}/core/helmet.js +0 -0
  390. /package/dist/{app → lib}/core/icons.d.ts +0 -0
  391. /package/dist/{app → lib}/core/icons.js +0 -0
  392. /package/dist/{app → lib}/core/plugins.d.ts +0 -0
  393. /package/dist/{app → lib}/core/plugins.js +0 -0
  394. /package/dist/{app → lib}/core/router.d.ts +0 -0
  395. /package/dist/{app → lib}/core/router.js +0 -0
  396. /package/dist/{app → lib}/core/types/combine.d.ts +0 -0
  397. /package/dist/{app → lib}/core/types/combine.js +0 -0
  398. /package/dist/{app → lib}/oas/graphql/index.d.ts +0 -0
  399. /package/dist/{app → lib}/oas/graphql/index.js +0 -0
  400. /package/dist/{app → lib}/oas/graphql/server.d.ts +0 -0
  401. /package/dist/{app → lib}/oas/graphql/server.js +0 -0
  402. /package/dist/{app → lib}/oas/parser/dereference/index.d.ts +0 -0
  403. /package/dist/{app → lib}/oas/parser/dereference/index.js +0 -0
  404. /package/dist/{app → lib}/oas/parser/dereference/resolveRef.d.ts +0 -0
  405. /package/dist/{app → lib}/oas/parser/dereference/resolveRef.js +0 -0
  406. /package/dist/{app → lib}/oas/parser/index.d.ts +0 -0
  407. /package/dist/{app → lib}/oas/parser/index.js +0 -0
  408. /package/dist/{app → lib}/oas/parser/upgrade/index.d.ts +0 -0
  409. /package/dist/{app → lib}/oas/parser/upgrade/index.js +0 -0
  410. /package/dist/{app → lib}/plugins/api-key/SettingsApiKeys.d.ts +0 -0
  411. /package/dist/{app → lib}/plugins/api-key/SettingsApiKeys.js +0 -0
  412. /package/dist/{app → lib}/plugins/api-key/index.d.ts +0 -0
  413. /package/dist/{app → lib}/plugins/api-key/index.js +0 -0
  414. /package/dist/{app → lib}/plugins/markdown/MdxPage.d.ts +0 -0
  415. /package/dist/{app → lib}/plugins/markdown/MdxPage.js +0 -0
  416. /package/dist/{app → lib}/plugins/markdown/Toc.d.ts +0 -0
  417. /package/dist/{app → lib}/plugins/markdown/Toc.js +0 -0
  418. /package/dist/{app → lib}/plugins/markdown/generateRoutes.d.ts +0 -0
  419. /package/dist/{app → lib}/plugins/markdown/generateRoutes.js +0 -0
  420. /package/dist/{app → lib}/plugins/markdown/index.js +0 -0
  421. /package/dist/{app → lib}/plugins/openapi/MakeRequest.d.ts +0 -0
  422. /package/dist/{app → lib}/plugins/openapi/MethodBadge.d.ts +0 -0
  423. /package/dist/{app → lib}/plugins/openapi/MethodBadge.js +0 -0
  424. /package/dist/{app → lib}/plugins/openapi/ParameterList.d.ts +0 -0
  425. /package/dist/{app → lib}/plugins/openapi/ParameterList.js +0 -0
  426. /package/dist/{app → lib}/plugins/openapi/ParameterListItem.d.ts +0 -0
  427. /package/dist/{app → lib}/plugins/openapi/ParameterListItem.js +0 -0
  428. /package/dist/{app → lib}/plugins/openapi/RequestBodySidecarBox.d.ts +0 -0
  429. /package/dist/{app → lib}/plugins/openapi/ResponsesSidecarBox.d.ts +0 -0
  430. /package/dist/{app → lib}/plugins/openapi/Select.d.ts +0 -0
  431. /package/dist/{app → lib}/plugins/openapi/Select.js +0 -0
  432. /package/dist/{app → lib}/plugins/openapi/Sidecar.d.ts +0 -0
  433. /package/dist/{app → lib}/plugins/openapi/util/generateSchemaExample.d.ts +0 -0
  434. /package/dist/{app → lib}/plugins/openapi/util/generateSchemaExample.js +0 -0
  435. /package/dist/{app → lib}/plugins/openapi/util/urql.js +0 -0
  436. /package/dist/{app → lib}/plugins/openapi/worker/createSharedWorkerClient.d.ts +0 -0
  437. /package/dist/{app → lib}/plugins/openapi/worker/createSharedWorkerClient.js +0 -0
  438. /package/dist/{app → lib}/plugins/openapi/worker/worker.d.ts +0 -0
  439. /package/dist/{app → lib}/plugins/openapi/worker/worker.js +0 -0
  440. /package/dist/{app → lib}/plugins/redirect/index.d.ts +0 -0
  441. /package/dist/{app → lib}/plugins/redirect/index.js +0 -0
  442. /package/dist/{app → lib}/ui/Callout.d.ts +0 -0
  443. /package/dist/{app → lib}/ui/Callout.js +0 -0
  444. /package/dist/{app → lib}/ui/Card.d.ts +0 -0
  445. /package/dist/{app → lib}/ui/Note.d.ts +0 -0
  446. /package/dist/{app → lib}/ui/Note.js +0 -0
  447. /package/dist/{app → lib}/util/MdxComponents.js +0 -0
  448. /package/dist/{app → lib}/util/cn.d.ts +0 -0
  449. /package/dist/{app → lib}/util/cn.js +0 -0
  450. /package/dist/{app → lib}/util/createWaitForNotify.js +0 -0
  451. /package/dist/{app → lib}/util/groupBy.d.ts +0 -0
  452. /package/dist/{app → lib}/util/groupBy.js +0 -0
  453. /package/dist/{app → lib}/util/joinPath.d.ts +0 -0
  454. /package/dist/{app → lib}/util/joinPath.js +0 -0
  455. /package/dist/{app → lib}/util/pastellize.d.ts +0 -0
  456. /package/dist/{app → lib}/util/pastellize.js +0 -0
  457. /package/dist/{app → lib}/util/slugify.js +0 -0
  458. /package/dist/{app → lib}/util/traverseNavigation.d.ts +0 -0
  459. /package/dist/{app → lib}/util/traverseNavigation.js +0 -0
  460. /package/dist/{app → lib}/util/useScrollToAnchor.d.ts +0 -0
  461. /package/dist/{app → lib}/util/useScrollToAnchor.js +0 -0
  462. /package/dist/{app → lib}/util/useScrollToTop.d.ts +0 -0
  463. /package/dist/{app → lib}/util/useScrollToTop.js +0 -0
  464. /package/src/{app → lib}/Heading.tsx +0 -0
  465. /package/src/{app → lib}/authentication/authentication.ts +0 -0
  466. /package/src/{app → lib}/authentication/openid.ts +0 -0
  467. /package/src/{app → lib}/components/AnchorLink.tsx +0 -0
  468. /package/src/{app → lib}/components/CategoryHeading.tsx +0 -0
  469. /package/src/{app → lib}/components/DynamicIcon.tsx +0 -0
  470. /package/src/{app → lib}/components/Header.tsx +0 -0
  471. /package/src/{app → lib}/components/Layout.tsx +0 -0
  472. /package/src/{app → lib}/components/Markdown.tsx +0 -0
  473. /package/src/{app → lib}/components/TopNavigation.tsx +0 -0
  474. /package/src/{app → lib}/components/context/ComponentsContext.tsx +0 -0
  475. /package/src/{app → lib}/components/context/DevPortalProvider.ts +0 -0
  476. /package/src/{app → lib}/components/context/PluginSystem.ts +0 -0
  477. /package/src/{app → lib}/components/context/ThemeContext.tsx +0 -0
  478. /package/src/{app → lib}/components/context/ViewportAnchorContext.tsx +0 -0
  479. /package/src/{app → lib}/components/navigation/SideNavigation.tsx +0 -0
  480. /package/src/{app → lib}/components/navigation/SideNavigationCategory.tsx +0 -0
  481. /package/src/{app → lib}/components/navigation/SideNavigationItem.tsx +0 -0
  482. /package/src/{app → lib}/components/navigation/SideNavigationWrapper.tsx +0 -0
  483. /package/src/{app → lib}/components/navigation/useNavigationCollapsibleState.ts +0 -0
  484. /package/src/{app → lib}/components/navigation/util.ts +0 -0
  485. /package/src/{app → lib}/core/DevPortalContext.ts +0 -0
  486. /package/src/{app → lib}/core/helmet.ts +0 -0
  487. /package/src/{app → lib}/core/icons.tsx +0 -0
  488. /package/src/{app → lib}/core/plugins.ts +0 -0
  489. /package/src/{app → lib}/core/router.tsx +0 -0
  490. /package/src/{app → lib}/core/types/combine.ts +0 -0
  491. /package/src/{app → lib}/oas/graphql/index.ts +0 -0
  492. /package/src/{app → lib}/oas/graphql/server.ts +0 -0
  493. /package/src/{app → lib}/oas/parser/dereference/index.ts +0 -0
  494. /package/src/{app → lib}/oas/parser/dereference/resolveRef.ts +0 -0
  495. /package/src/{app → lib}/oas/parser/index.ts +0 -0
  496. /package/src/{app → lib}/oas/parser/schemas/v3.0.json +0 -0
  497. /package/src/{app → lib}/oas/parser/schemas/v3.1.json +0 -0
  498. /package/src/{app → lib}/oas/parser/upgrade/index.ts +0 -0
  499. /package/src/{app → lib}/plugins/api-key/SettingsApiKeys.tsx +0 -0
  500. /package/src/{app → lib}/plugins/api-key/index.tsx +0 -0
  501. /package/src/{app → lib}/plugins/markdown/MdxPage.tsx +0 -0
  502. /package/src/{app → lib}/plugins/markdown/Toc.tsx +0 -0
  503. /package/src/{app → lib}/plugins/markdown/generateRoutes.tsx +0 -0
  504. /package/src/{app → lib}/plugins/markdown/index.tsx +0 -0
  505. /package/src/{app → lib}/plugins/openapi/MethodBadge.tsx +0 -0
  506. /package/src/{app → lib}/plugins/openapi/ParameterList.tsx +0 -0
  507. /package/src/{app → lib}/plugins/openapi/ParameterListItem.tsx +0 -0
  508. /package/src/{app → lib}/plugins/openapi/Select.tsx +0 -0
  509. /package/src/{app → lib}/plugins/openapi/util/generateSchemaExample.ts +0 -0
  510. /package/src/{app → lib}/plugins/openapi/util/urql.ts +0 -0
  511. /package/src/{app → lib}/plugins/openapi/worker/createSharedWorkerClient.ts +0 -0
  512. /package/src/{app → lib}/plugins/openapi/worker/worker.ts +0 -0
  513. /package/src/{app → lib}/plugins/redirect/index.tsx +0 -0
  514. /package/src/{app → lib}/ui/Callout.tsx +0 -0
  515. /package/src/{app → lib}/ui/Note.tsx +0 -0
  516. /package/src/{app → lib}/util/MdxComponents.tsx +0 -0
  517. /package/src/{app → lib}/util/cn.ts +0 -0
  518. /package/src/{app → lib}/util/createWaitForNotify.ts +0 -0
  519. /package/src/{app → lib}/util/groupBy.ts +0 -0
  520. /package/src/{app → lib}/util/joinPath.tsx +0 -0
  521. /package/src/{app → lib}/util/pastellize.ts +0 -0
  522. /package/src/{app → lib}/util/slugify.ts +0 -0
  523. /package/src/{app → lib}/util/traverseNavigation.ts +0 -0
  524. /package/src/{app → lib}/util/useScrollToAnchor.ts +0 -0
  525. /package/src/{app → lib}/util/useScrollToTop.ts +0 -0
@@ -1,7 +1,6 @@
1
1
  import { MDXProvider } from "@mdx-js/react";
2
2
  import { QueryClientProvider } from "@tanstack/react-query";
3
3
  import { memo, Suspense, useEffect, useMemo } from "react";
4
- import { createBrowserRouter, RouterProvider } from "react-router-dom";
5
4
  import { type AuthProvider } from "./authentication/authentication.js";
6
5
  import {
7
6
  ComponentsProvider,
@@ -11,14 +10,14 @@ import {
11
10
  import { DevPortalProvider } from "./components/context/DevPortalProvider.js";
12
11
  import { ThemeProvider } from "./components/context/ThemeContext.js";
13
12
  import { ViewportAnchorProvider } from "./components/context/ViewportAnchorContext.js";
14
- import { Layout } from "./components/Layout.js";
15
13
  import {
16
14
  DevPortalContext,
17
15
  queryClient,
18
16
  type NavigationItem,
19
17
  } from "./core/DevPortalContext.js";
20
18
  import { HelmetProvider } from "./core/helmet.js";
21
- import { isNavigationPlugin, type DevPortalPlugin } from "./core/plugins.js";
19
+ import { type DevPortalPlugin } from "./core/plugins.js";
20
+ import { Router } from "./Router.js";
22
21
  import { MdxComponents, type MdxComponentsType } from "./util/MdxComponents.js";
23
22
 
24
23
  export const DevPortalSystemPaths = {
@@ -44,28 +43,7 @@ export type DevPortalProps = {
44
43
  overrides?: ComponentsContextType;
45
44
  };
46
45
 
47
- const DevPortal = (props: DevPortalProps) => {
48
- const router = useMemo(() => {
49
- const routes = (props.plugins ?? []).flatMap((plugin) =>
50
- isNavigationPlugin(plugin) ? plugin.getRoutes() : [],
51
- );
52
-
53
- return createBrowserRouter([
54
- {
55
- path: "/",
56
- element: <Layout />,
57
- errorElement: (
58
- <Layout>
59
- <div className="h-[75vh] flex items-center justify-center">
60
- Error, look at the console
61
- </div>
62
- </Layout>
63
- ),
64
- children: routes,
65
- },
66
- ]);
67
- }, [props.plugins]);
68
-
46
+ const DevPortalInner = (props: DevPortalProps) => {
69
47
  const components = useMemo(
70
48
  () => ({ ...DEFAULT_COMPONENTS, ...props.overrides }),
71
49
  [props.overrides],
@@ -97,7 +75,7 @@ const DevPortal = (props: DevPortalProps) => {
97
75
  </div>
98
76
  }
99
77
  >
100
- <RouterProvider router={router} />
78
+ <Router plugins={props.plugins} />
101
79
  </Suspense>
102
80
  </ViewportAnchorProvider>
103
81
  </ComponentsProvider>
@@ -109,7 +87,7 @@ const DevPortal = (props: DevPortalProps) => {
109
87
  );
110
88
  };
111
89
 
112
- const MemoDevPortal = memo(DevPortal);
113
- MemoDevPortal.displayName = "DevPortal";
90
+ const DevPortal = memo(DevPortalInner);
91
+ DevPortal.displayName = "DevPortal";
114
92
 
115
- export default MemoDevPortal;
93
+ export { DevPortal };
@@ -0,0 +1,28 @@
1
+ import { useMemo } from "react";
2
+ import { createBrowserRouter, RouterProvider } from "react-router-dom";
3
+ import { Layout } from "./components/Layout.js";
4
+ import { DevPortalPlugin, isNavigationPlugin } from "./core/plugins.js";
5
+
6
+ export function Router({ plugins }: { plugins?: DevPortalPlugin[] }) {
7
+ const router = useMemo(() => {
8
+ const routes = (plugins ?? []).flatMap((plugin) =>
9
+ isNavigationPlugin(plugin) ? plugin.getRoutes() : [],
10
+ );
11
+
12
+ return createBrowserRouter([
13
+ {
14
+ path: "/",
15
+ 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
+ ),
23
+ children: routes,
24
+ },
25
+ ]);
26
+ }, [plugins]);
27
+ return <RouterProvider router={router} />;
28
+ }
@@ -0,0 +1 @@
1
+ export { clerkAuth } from "./authentication/clerk.js";
@@ -1,7 +1,7 @@
1
1
  import { Clerk } from "@clerk/clerk-js";
2
2
  import { type AuthProvider } from "./authentication.js";
3
3
 
4
- const clerkProvider = ({
4
+ export const clerkAuth = ({
5
5
  clerkPubKey,
6
6
  }: {
7
7
  clerkPubKey: string;
@@ -43,5 +43,3 @@ const clerkProvider = ({
43
43
  },
44
44
  };
45
45
  };
46
-
47
- export default clerkProvider;
@@ -0,0 +1,119 @@
1
+ import * as React from "react"
2
+ import * as DialogPrimitive from "@radix-ui/react-dialog"
3
+ import { XIcon } from "lucide-react"
4
+ import { cn } from "../util/cn.js";
5
+
6
+ const Dialog = DialogPrimitive.Root
7
+
8
+ const DialogTrigger = DialogPrimitive.Trigger
9
+
10
+ const DialogPortal = DialogPrimitive.Portal
11
+
12
+ const DialogClose = DialogPrimitive.Close
13
+
14
+ const DialogOverlay = React.forwardRef<
15
+ React.ElementRef<typeof DialogPrimitive.Overlay>,
16
+ React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>
17
+ >(({ className, ...props }, ref) => (
18
+ <DialogPrimitive.Overlay
19
+ ref={ref}
20
+ className={cn(
21
+ "fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
22
+ className
23
+ )}
24
+ {...props}
25
+ />
26
+ ))
27
+ DialogOverlay.displayName = DialogPrimitive.Overlay.displayName
28
+
29
+ const DialogContent = React.forwardRef<
30
+ React.ElementRef<typeof DialogPrimitive.Content>,
31
+ React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>
32
+ >(({ className, children, ...props }, ref) => (
33
+ <DialogPortal>
34
+ <DialogOverlay />
35
+ <DialogPrimitive.Content
36
+ ref={ref}
37
+ className={cn(
38
+ "fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
39
+ className
40
+ )}
41
+ {...props}
42
+ >
43
+ {children}
44
+ <DialogPrimitive.Close className="absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground">
45
+ <XIcon className="h-4 w-4" />
46
+ <span className="sr-only">Close</span>
47
+ </DialogPrimitive.Close>
48
+ </DialogPrimitive.Content>
49
+ </DialogPortal>
50
+ ))
51
+ DialogContent.displayName = DialogPrimitive.Content.displayName
52
+
53
+ const DialogHeader = ({
54
+ className,
55
+ ...props
56
+ }: React.HTMLAttributes<HTMLDivElement>) => (
57
+ <div
58
+ className={cn(
59
+ "flex flex-col space-y-1.5 text-center sm:text-left",
60
+ className
61
+ )}
62
+ {...props}
63
+ />
64
+ )
65
+ DialogHeader.displayName = "DialogHeader"
66
+
67
+ const DialogFooter = ({
68
+ className,
69
+ ...props
70
+ }: React.HTMLAttributes<HTMLDivElement>) => (
71
+ <div
72
+ className={cn(
73
+ "flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
74
+ className
75
+ )}
76
+ {...props}
77
+ />
78
+ )
79
+ DialogFooter.displayName = "DialogFooter"
80
+
81
+ const DialogTitle = React.forwardRef<
82
+ React.ElementRef<typeof DialogPrimitive.Title>,
83
+ React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>
84
+ >(({ className, ...props }, ref) => (
85
+ <DialogPrimitive.Title
86
+ ref={ref}
87
+ className={cn(
88
+ "text-lg font-semibold leading-none tracking-tight",
89
+ className
90
+ )}
91
+ {...props}
92
+ />
93
+ ))
94
+ DialogTitle.displayName = DialogPrimitive.Title.displayName
95
+
96
+ const DialogDescription = React.forwardRef<
97
+ React.ElementRef<typeof DialogPrimitive.Description>,
98
+ React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>
99
+ >(({ className, ...props }, ref) => (
100
+ <DialogPrimitive.Description
101
+ ref={ref}
102
+ className={cn("text-sm text-muted-foreground", className)}
103
+ {...props}
104
+ />
105
+ ))
106
+ DialogDescription.displayName = DialogPrimitive.Description.displayName
107
+
108
+ export {
109
+ Dialog,
110
+ DialogPortal,
111
+ DialogOverlay,
112
+ DialogTrigger,
113
+ DialogClose,
114
+ DialogContent,
115
+ DialogHeader,
116
+ DialogFooter,
117
+ DialogTitle,
118
+ DialogDescription,
119
+ }
@@ -0,0 +1,24 @@
1
+ import * as React from "react";
2
+ import { cn } from "../util/cn.js";
3
+
4
+ export interface InputProps
5
+ extends React.InputHTMLAttributes<HTMLInputElement> {}
6
+
7
+ const Input = React.forwardRef<HTMLInputElement, InputProps>(
8
+ ({ className, type, ...props }, ref) => {
9
+ return (
10
+ <input
11
+ type={type}
12
+ className={cn(
13
+ "flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",
14
+ className,
15
+ )}
16
+ ref={ref}
17
+ {...props}
18
+ />
19
+ );
20
+ },
21
+ );
22
+ Input.displayName = "Input";
23
+
24
+ export { Input };
@@ -19,6 +19,8 @@ if (!import.meta.env.SSR) {
19
19
  import("prismjs/components/prism-php.min.js");
20
20
  // @ts-expect-error This is untyped
21
21
  import("prismjs/components/prism-json.min.js");
22
+ // @ts-expect-error This is untyped
23
+ import("prismjs/components/prism-java.min.js");
22
24
  }
23
25
 
24
26
  import { useState } from "react";
@@ -0,0 +1,3 @@
1
+ export { DynamicIcon } from "./components/DynamicIcon.js";
2
+ export { Link } from "./core/router.js";
3
+ export { DevPortal } from "./DevPortal.js";
@@ -3,34 +3,42 @@ import { useTheme } from "../../components/context/ThemeContext.js";
3
3
  import { cn } from "../../util/cn.js";
4
4
  import { pastellize } from "../../util/pastellize.js";
5
5
 
6
- const DATA_ATTR = "data-linked-param";
6
+ export const DATA_ATTR = "data-linked-param";
7
+
8
+ export const usePastellizedColor = (name: string) => {
9
+ const [isDark] = useTheme();
10
+ return pastellize(
11
+ name,
12
+ !isDark ? { saturation: 100, lightness: 70 } : undefined,
13
+ );
14
+ };
7
15
 
8
16
  export const ColorizedParam = ({
9
17
  name,
18
+ value,
10
19
  className,
11
20
  backgroundOpacity = "100%",
12
21
  slug,
13
22
  children,
23
+ onClick,
14
24
  }: {
15
25
  name: string;
26
+ value?: string;
16
27
  className?: string;
17
28
  backgroundOpacity?: string;
18
29
  slug?: string;
19
30
  children?: ReactNode;
31
+ onClick?: () => void;
20
32
  }) => {
21
33
  const ref = useRef<HTMLSpanElement>(null);
22
- const [isDark] = useTheme();
23
34
  const normalized = name.replace("{", "").replace("}", "");
24
-
25
- const color = pastellize(
26
- normalized,
27
- !isDark ? { saturation: 100, lightness: 70 } : undefined,
28
- );
35
+ const color = usePastellizedColor(normalized);
29
36
 
30
37
  const borderColor = `hsl(${color})`;
31
38
  const backgroundColor = `hsl(${color} / ${backgroundOpacity})`;
32
39
 
33
40
  useEffect(() => {
41
+ if (!slug) return;
34
42
  if (!ref.current) return;
35
43
 
36
44
  const onMouseEnter = () => {
@@ -62,12 +70,13 @@ export const ColorizedParam = ({
62
70
  className={cn("inline-flex relative rounded group", className)}
63
71
  {...{ [DATA_ATTR]: slug }}
64
72
  ref={ref}
73
+ onClick={onClick}
65
74
  >
66
75
  <span
67
- className="absolute inset-0 border-b-2 rounded transition-opacity duration-200 opacity-30 group-data-[active=true]:opacity-100"
76
+ className="absolute inset-0 border-b-2 transition-opacity duration-200 opacity-30 group-data-[active=true]:opacity-100"
68
77
  style={{ borderColor, backgroundColor }}
69
78
  />
70
- <span className="relative">{children ?? name}</span>
79
+ <span className="relative">{children || name}</span>
71
80
  </span>
72
81
  );
73
82
  };
@@ -1,5 +1,16 @@
1
1
  import { useApiIdentities } from "../../components/context/DevPortalProvider.js";
2
2
  import type { OperationListItemResult } from "./OperationList.js";
3
+ import { Playground } from "./playground/Playground.js";
4
+ import { useOasConfig } from "./index.js";
5
+ import { gql, useQuery } from "urql";
6
+
7
+ const getServerQuery = gql`
8
+ query getServerQuery($input: JSON!, $type: SchemaType!) {
9
+ schema(input: $input, type: $type) {
10
+ url
11
+ }
12
+ }
13
+ `;
3
14
 
4
15
  export const MakeRequest = ({
5
16
  operation,
@@ -7,9 +18,17 @@ export const MakeRequest = ({
7
18
  operation: OperationListItemResult;
8
19
  }) => {
9
20
  const identities = useApiIdentities();
21
+ const variables = useOasConfig();
22
+ const [server] = useQuery({ query: getServerQuery, variables });
10
23
 
11
24
  return (
12
25
  <div>
26
+ <Playground
27
+ host={server.data?.schema.url}
28
+ method={operation.method}
29
+ url={operation.path}
30
+ defaultHeaders={[]}
31
+ />
13
32
  {identities.data.map((identity) => (
14
33
  <button
15
34
  key={identity.id}
@@ -1,14 +1,14 @@
1
- import { type ResultOf } from "gql.tada";
2
1
  import { Heading } from "../../Heading.js";
3
2
  import { CategoryHeading } from "../../components/CategoryHeading.js";
4
3
  import { Markdown, ProseClasses } from "../../components/Markdown.js";
5
4
  import { cn } from "../../util/cn.js";
6
5
  import { OperationListItem } from "./OperationListItem.js";
7
- import { graphql } from "./graphql/index.js";
8
6
  import { useOasConfig } from "./index.js";
7
+ import { graphql } from "./graphql/index.js";
9
8
  import { useQuery } from "./util/urql.js";
9
+ import { ResultOf } from "@graphql-typed-document-node/core";
10
10
 
11
- export const OperationsFragment = graphql(`
11
+ export const OperationsFragment = graphql(/* GraphQL */ `
12
12
  fragment OperationsFragment on OperationItem {
13
13
  slug
14
14
  summary
@@ -51,32 +51,30 @@ export const OperationsFragment = graphql(`
51
51
  }
52
52
  `);
53
53
 
54
- const AllOperationsQuery = graphql(
55
- `
56
- query AllOperations($input: JSON!, $type: SchemaType!) {
57
- schema(input: $input, type: $type) {
54
+ export type OperationListItemResult = ResultOf<typeof OperationsFragment>;
55
+
56
+ const AllOperationsQuery = graphql(/* GraphQL */ `
57
+ query AllOperations($input: JSON!, $type: SchemaType!) {
58
+ schema(input: $input, type: $type) {
59
+ description
60
+ title
61
+ url
62
+ version
63
+ tags {
64
+ name
58
65
  description
59
- title
60
- url
61
- version
62
- tags {
63
- name
64
- description
65
- operations {
66
- slug
67
- ...OperationsFragment
68
- }
66
+ operations {
67
+ slug
68
+ ...OperationsFragment
69
69
  }
70
70
  }
71
71
  }
72
- `,
73
- [OperationsFragment],
74
- );
75
-
76
- export type OperationListItemResult = ResultOf<typeof OperationsFragment>;
72
+ }
73
+ `);
77
74
 
78
75
  export const OperationList = () => {
79
76
  const { type, input } = useOasConfig();
77
+
80
78
  const [result] = useQuery({
81
79
  query: AllOperationsQuery,
82
80
  variables: { type, input },
@@ -1,10 +1,10 @@
1
- import { readFragment, type FragmentOf } from "gql.tada";
2
1
  import { Heading } from "../../Heading.js";
3
2
  import { Markdown, ProseClasses } from "../../components/Markdown.js";
4
3
  import { groupBy } from "../../util/groupBy.js";
5
4
  import { OperationsFragment } from "./OperationList.js";
6
5
  import { ParameterList } from "./ParameterList.js";
7
6
  import { Sidecar } from "./Sidecar.js";
7
+ import { FragmentType, useFragment } from "./graphql/index.js";
8
8
 
9
9
  export const PARAM_GROUPS = ["path", "query", "header", "cookie"] as const;
10
10
  export type ParameterGroup = (typeof PARAM_GROUPS)[number];
@@ -12,9 +12,9 @@ export type ParameterGroup = (typeof PARAM_GROUPS)[number];
12
12
  export const OperationListItem = ({
13
13
  operationFragment,
14
14
  }: {
15
- operationFragment: FragmentOf<typeof OperationsFragment>;
15
+ operationFragment: FragmentType<typeof OperationsFragment>;
16
16
  }) => {
17
- const operation = readFragment(OperationsFragment, operationFragment);
17
+ const operation = useFragment(OperationsFragment, operationFragment);
18
18
  const groupedParameters = groupBy(operation?.parameters ?? [], "in");
19
19
 
20
20
  return (
@@ -0,0 +1,51 @@
1
+ import { useState } from "react";
2
+ import { SyntaxHighlight } from "../../components/SyntaxHighlight.js";
3
+ import { type SchemaObject } from "../../oas/graphql/index.js";
4
+ import type { OperationListItemResult } from "./OperationList.js";
5
+ import { Select } from "./Select.js";
6
+ import * as SidecarBox from "./SidecarBox.js";
7
+ import { generateSchemaExample } from "./util/generateSchemaExample.js";
8
+
9
+ type Content = NonNullable<
10
+ NonNullable<OperationListItemResult["requestBody"]>["content"]
11
+ >;
12
+
13
+ // @todo should we handle multiple content types?
14
+ export const RequestBodySidecarBox = ({ content }: { content: Content }) => {
15
+ const [selected, setSelected] = useState("example");
16
+
17
+ if (!content.length) return null;
18
+
19
+ return (
20
+ <>
21
+ <div>lol</div>
22
+ <SidecarBox.Root>
23
+ <SidecarBox.Head className="text-xs flex justify-between items-center">
24
+ <span className="font-mono">Request Body</span>
25
+ <Select
26
+ onChange={(e) => setSelected(e.target.value)}
27
+ options={[
28
+ { value: "example", label: "Example" },
29
+ { value: "schema", label: "Schema" },
30
+ ]}
31
+ />
32
+ </SidecarBox.Head>
33
+ <SidecarBox.Body>
34
+ <SyntaxHighlight
35
+ language="json"
36
+ noBackground
37
+ copyable={false}
38
+ className="text-xs"
39
+ code={JSON.stringify(
40
+ selected === "example"
41
+ ? generateSchemaExample(content[0].schema as SchemaObject)
42
+ : content[0].schema,
43
+ null,
44
+ 2,
45
+ )}
46
+ />
47
+ </SidecarBox.Body>
48
+ </SidecarBox.Root>
49
+ </>
50
+ );
51
+ };
@@ -3,7 +3,7 @@ import { SyntaxHighlight } from "../../components/SyntaxHighlight.js";
3
3
  import { type SchemaObject } from "../../oas/graphql/index.js";
4
4
  import { cn } from "../../util/cn.js";
5
5
  import type { OperationListItemResult } from "./OperationList.js";
6
- import { SidecarBox } from "./SidecarBox.js";
6
+ import * as SidecarBox from "./SidecarBox.js";
7
7
  import { generateSchemaExample } from "./util/generateSchemaExample.js";
8
8
 
9
9
  type Responses = OperationListItemResult["responses"];
@@ -1,4 +1,4 @@
1
- import { Fragment, useState } from "react";
1
+ import { Fragment, useMemo, useState } from "react";
2
2
  import { SyntaxHighlight } from "../../components/SyntaxHighlight.js";
3
3
  import { cn } from "../../util/cn.js";
4
4
  import { ColorizedParam } from "./ColorizedParam.js";
@@ -8,8 +8,54 @@ import type { OperationListItemResult } from "./OperationList.js";
8
8
  import { RequestBodySidecarBox } from "./RequestBodySidecarBox.js";
9
9
  import { ResponsesSidecarBox } from "./ResponsesSidecarBox.js";
10
10
  import { Select } from "./Select.js";
11
- import { SidecarBox } from "./SidecarBox.js";
12
- import { getCode } from "./util/getCode.js";
11
+ import * as SidecarBox from "./SidecarBox.js";
12
+ import { HTTPSnippet } from "@zudoku/httpsnippet";
13
+ import { generateSchemaExample } from "./util/generateSchemaExample.js";
14
+ import type { SchemaObject } from "../../oas/parser/index.js";
15
+
16
+ const getConverted = (snippet: HTTPSnippet, option: string) => {
17
+ let converted;
18
+ switch (option) {
19
+ case "shell":
20
+ converted = snippet.convert("shell", "curl");
21
+ break;
22
+ case "js":
23
+ converted = snippet.convert("javascript", "fetch");
24
+ break;
25
+ case "python":
26
+ converted = snippet.convert("python", "requests");
27
+ break;
28
+ case "java":
29
+ converted = snippet.convert("java", "okhttp");
30
+ break;
31
+ case "go":
32
+ converted = snippet.convert("go", "native");
33
+ break;
34
+ case "csharp":
35
+ converted = snippet.convert("csharp", "httpclient");
36
+ break;
37
+ case "kotlin":
38
+ converted = snippet.convert("kotlin", "okhttp");
39
+ break;
40
+ case "objc":
41
+ converted = snippet.convert("objc", "nsurlsession");
42
+ break;
43
+ case "php":
44
+ converted = snippet.convert("php", "http2");
45
+ break;
46
+ case "ruby":
47
+ converted = snippet.convert("ruby");
48
+ break;
49
+ case "swift":
50
+ converted = snippet.convert("swift");
51
+ break;
52
+ default:
53
+ converted = snippet.convert("shell");
54
+ break;
55
+ }
56
+
57
+ return converted ? converted[0] : "";
58
+ };
13
59
 
14
60
  export const Sidecar = ({
15
61
  operation,
@@ -40,16 +86,27 @@ export const Sidecar = ({
40
86
  </Fragment>
41
87
  ));
42
88
 
43
- const language =
44
- {
45
- js: "javascript",
46
- go: "go",
47
- rust: "rust",
48
- curl: "bash",
49
- wget: "bash",
50
- ruby: "ruby",
51
- php: "php",
52
- }[option] ?? "bash";
89
+ const code = useMemo(() => {
90
+ const example = requestBodyContent?.[0]?.schema
91
+ ? generateSchemaExample(requestBodyContent[0].schema as SchemaObject)
92
+ : undefined;
93
+
94
+ const snippet = new HTTPSnippet(
95
+ {
96
+ method: operation.method.toLocaleUpperCase(),
97
+ url: operation.path.replaceAll("{", ":").replaceAll("}", ""),
98
+ headers: [{ name: "Authorization", value: "Bearer <token>" }],
99
+ postData: example
100
+ ? {
101
+ text: JSON.stringify(example, null, 2),
102
+ mimeType: "application/json",
103
+ }
104
+ : {},
105
+ } as never, // 👈 never touch this
106
+ );
107
+
108
+ return getConverted(snippet, option) ?? "";
109
+ }, [option, operation.method, operation.path, requestBodyContent]);
53
110
 
54
111
  return (
55
112
  <aside className="flex flex-col overflow-hidden sticky top-[--scroll-padding] gap-4">
@@ -67,23 +124,27 @@ export const Sidecar = ({
67
124
  className="self-start"
68
125
  onChange={(e) => setOption(e.target.value)}
69
126
  options={[
70
- { value: "curl", label: "cURL" },
71
- { value: "wget", label: "wget" },
127
+ { value: "shell", label: "cURL" },
72
128
  { value: "js", label: "Javascript" },
73
- { value: "ruby", label: "Ruby" },
74
- { value: "php", label: "PHP" },
129
+ { value: "python", label: "Python" },
130
+ { value: "java", label: "Java" },
75
131
  { value: "go", label: "Go" },
76
- { value: "rust", label: "Rust" },
132
+ { value: "csharp", label: "C#" },
133
+ { value: "kotlin", label: "Kotlin" },
134
+ { value: "objc", label: "Objective C" },
135
+ { value: "php", label: "PHP" },
136
+ { value: "ruby", label: "Ruby" },
137
+ { value: "swift", label: "Swift" },
77
138
  ]}
78
139
  />
79
140
  </SidecarBox.Head>
80
141
  <SidecarBox.Body>
81
142
  <SyntaxHighlight
82
- language={language}
143
+ language={option}
83
144
  copyable={false}
84
145
  noBackground
85
146
  className="text-xs"
86
- code={getCode(operation, option.toLowerCase())}
147
+ code={code}
87
148
  />
88
149
  </SidecarBox.Body>
89
150
  </SidecarBox.Root>