zudoku 0.0.0-e3f7e48 → 0.0.0-e4b82fa

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 (270) hide show
  1. package/README.md +121 -0
  2. package/dist/app/main.js +5 -7
  3. package/dist/app/main.js.map +1 -1
  4. package/dist/cli/dev/handler.js +2 -2
  5. package/dist/cli/dev/handler.js.map +1 -1
  6. package/dist/config/validators/InputSidebarSchema.d.ts +19 -4
  7. package/dist/config/validators/InputSidebarSchema.js +7 -28
  8. package/dist/config/validators/InputSidebarSchema.js.map +1 -1
  9. package/dist/config/validators/SidebarSchema.js +5 -6
  10. package/dist/config/validators/SidebarSchema.js.map +1 -1
  11. package/dist/config/validators/validate.d.ts +55 -29
  12. package/dist/config/validators/validate.js +10 -2
  13. package/dist/config/validators/validate.js.map +1 -1
  14. package/dist/index.d.ts +1 -0
  15. package/dist/lib/authentication/hook.d.ts +1 -1
  16. package/dist/lib/authentication/hook.js +1 -1
  17. package/dist/lib/authentication/hook.js.map +1 -1
  18. package/dist/lib/authentication/state.d.ts +16 -0
  19. package/dist/lib/authentication/state.js +5 -0
  20. package/dist/lib/authentication/state.js.map +1 -1
  21. package/dist/lib/components/Banner.js +7 -1
  22. package/dist/lib/components/Banner.js.map +1 -1
  23. package/dist/lib/components/ErrorPage.js +1 -2
  24. package/dist/lib/components/ErrorPage.js.map +1 -1
  25. package/dist/lib/components/Header.js +1 -1
  26. package/dist/lib/components/Header.js.map +1 -1
  27. package/dist/lib/components/InlineCode.d.ts +2 -1
  28. package/dist/lib/components/InlineCode.js +9 -1
  29. package/dist/lib/components/InlineCode.js.map +1 -1
  30. package/dist/lib/components/Layout.js +1 -1
  31. package/dist/lib/components/Layout.js.map +1 -1
  32. package/dist/lib/components/MobileTopNavigation.js +5 -1
  33. package/dist/lib/components/MobileTopNavigation.js.map +1 -1
  34. package/dist/lib/components/Search.js +1 -1
  35. package/dist/lib/components/Search.js.map +1 -1
  36. package/dist/lib/components/SlotletProvider.d.ts +9 -2
  37. package/dist/lib/components/SlotletProvider.js +4 -2
  38. package/dist/lib/components/SlotletProvider.js.map +1 -1
  39. package/dist/lib/components/TopNavigation.d.ts +3 -0
  40. package/dist/lib/components/TopNavigation.js +9 -1
  41. package/dist/lib/components/TopNavigation.js.map +1 -1
  42. package/dist/lib/components/context/ZudokuContext.d.ts +2 -0
  43. package/dist/lib/components/index.d.ts +3 -1
  44. package/dist/lib/components/index.js +2 -0
  45. package/dist/lib/components/index.js.map +1 -1
  46. package/dist/lib/components/navigation/Sidebar.js +1 -1
  47. package/dist/lib/components/navigation/Sidebar.js.map +1 -1
  48. package/dist/lib/components/navigation/SidebarCategory.js +18 -7
  49. package/dist/lib/components/navigation/SidebarCategory.js.map +1 -1
  50. package/dist/lib/components/navigation/SidebarItem.js +12 -5
  51. package/dist/lib/components/navigation/SidebarItem.js.map +1 -1
  52. package/dist/lib/core/DevPortalContext.d.ts +2 -1
  53. package/dist/lib/core/DevPortalContext.js.map +1 -1
  54. package/dist/lib/oas/graphql/index.js +12 -6
  55. package/dist/lib/oas/graphql/index.js.map +1 -1
  56. package/dist/lib/oas/parser/index.d.ts +1 -0
  57. package/dist/lib/oas/parser/index.js.map +1 -1
  58. package/dist/lib/plugins/custom-pages/CustomPage.d.ts +2 -0
  59. package/dist/lib/plugins/custom-pages/CustomPage.js +11 -0
  60. package/dist/lib/plugins/custom-pages/CustomPage.js.map +1 -0
  61. package/dist/lib/plugins/custom-pages/index.d.ts +10 -0
  62. package/dist/lib/plugins/custom-pages/index.js +11 -0
  63. package/dist/lib/plugins/custom-pages/index.js.map +1 -0
  64. package/dist/lib/plugins/markdown/MdxPage.js +1 -1
  65. package/dist/lib/plugins/markdown/MdxPage.js.map +1 -1
  66. package/dist/lib/plugins/openapi/Endpoint.d.ts +1 -3
  67. package/dist/lib/plugins/openapi/Endpoint.js +46 -8
  68. package/dist/lib/plugins/openapi/Endpoint.js.map +1 -1
  69. package/dist/lib/plugins/openapi/OperationList.js +2 -2
  70. package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
  71. package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.d.ts +2 -1
  72. package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.js +2 -2
  73. package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.js.map +1 -1
  74. package/dist/lib/plugins/openapi/Route.d.ts +1 -1
  75. package/dist/lib/plugins/openapi/Route.js +1 -1
  76. package/dist/lib/plugins/openapi/Route.js.map +1 -1
  77. package/dist/lib/plugins/openapi/Sidecar.js +15 -4
  78. package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
  79. package/dist/lib/plugins/openapi/SimpleSelect.d.ts +2 -1
  80. package/dist/lib/plugins/openapi/SimpleSelect.js +1 -1
  81. package/dist/lib/plugins/openapi/SimpleSelect.js.map +1 -1
  82. package/dist/lib/plugins/openapi/client/createMemoryClient.js +1 -1
  83. package/dist/lib/plugins/openapi/client/createMemoryClient.js.map +1 -1
  84. package/dist/lib/plugins/openapi/client/createWorkerClient.js +1 -1
  85. package/dist/lib/plugins/openapi/client/createWorkerClient.js.map +1 -1
  86. package/dist/lib/plugins/openapi/graphql/gql.d.ts +10 -2
  87. package/dist/lib/plugins/openapi/graphql/gql.js +2 -1
  88. package/dist/lib/plugins/openapi/graphql/gql.js.map +1 -1
  89. package/dist/lib/plugins/openapi/graphql/graphql.d.ts +26 -0
  90. package/dist/lib/plugins/openapi/graphql/graphql.js +87 -0
  91. package/dist/lib/plugins/openapi/graphql/graphql.js.map +1 -1
  92. package/dist/lib/plugins/openapi/index.js +1 -1
  93. package/dist/lib/plugins/openapi/index.js.map +1 -1
  94. package/dist/lib/plugins/openapi/playground/Playground.d.ts +2 -1
  95. package/dist/lib/plugins/openapi/playground/Playground.js +14 -5
  96. package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
  97. package/dist/lib/plugins/openapi/playground/ResponseTab.js +1 -1
  98. package/dist/lib/plugins/openapi/playground/ResponseTab.js.map +1 -1
  99. package/dist/lib/ui/Callout.d.ts +36 -35
  100. package/dist/lib/ui/Callout.js.map +1 -1
  101. package/dist/lib/ui/Drawer.d.ts +8 -10
  102. package/dist/lib/ui/Drawer.js.map +1 -1
  103. package/dist/lib/util/useExposedProps.d.ts +2 -0
  104. package/dist/lib/util/useExposedProps.js +8 -0
  105. package/dist/lib/util/useExposedProps.js.map +1 -0
  106. package/dist/vite/config.js +14 -12
  107. package/dist/vite/config.js.map +1 -1
  108. package/dist/vite/dev-server.d.ts +6 -1
  109. package/dist/vite/dev-server.js +13 -3
  110. package/dist/vite/dev-server.js.map +1 -1
  111. package/dist/vite/plugin-component.js +0 -1
  112. package/dist/vite/plugin-component.js.map +1 -1
  113. package/dist/vite/plugin-custom-pages.d.ts +4 -0
  114. package/dist/vite/plugin-custom-pages.js +30 -0
  115. package/dist/vite/plugin-custom-pages.js.map +1 -0
  116. package/dist/vite/plugin-mdx.js +17 -0
  117. package/dist/vite/plugin-mdx.js.map +1 -1
  118. package/dist/vite/plugin-search.d.ts +3 -0
  119. package/dist/vite/plugin-search.js +26 -0
  120. package/dist/vite/plugin-search.js.map +1 -0
  121. package/dist/vite/plugin.js +4 -0
  122. package/dist/vite/plugin.js.map +1 -1
  123. package/lib/{AuthenticationPlugin-Bx9FK124.js → AuthenticationPlugin-D1nhROkO.js} +3 -3
  124. package/lib/{AuthenticationPlugin-Bx9FK124.js.map → AuthenticationPlugin-D1nhROkO.js.map} +1 -1
  125. package/lib/{CategoryHeading-EN3W3xEN.js → CategoryHeading-B7TlPvuN.js} +2 -2
  126. package/lib/{CategoryHeading-EN3W3xEN.js.map → CategoryHeading-B7TlPvuN.js.map} +1 -1
  127. package/lib/{DeveloperHint-CZ4VwuKw.js → DeveloperHint-B_QCCafl.js} +2 -2
  128. package/lib/{DeveloperHint-CZ4VwuKw.js.map → DeveloperHint-B_QCCafl.js.map} +1 -1
  129. package/lib/ErrorPage-DqqAV1dr.js +16 -0
  130. package/lib/ErrorPage-DqqAV1dr.js.map +1 -0
  131. package/lib/Input-DrR6P3mq.js +2229 -0
  132. package/lib/Input-DrR6P3mq.js.map +1 -0
  133. package/lib/{Markdown-BUUIyZbc.js → Markdown-Y__eLG0x.js} +721 -555
  134. package/lib/Markdown-Y__eLG0x.js.map +1 -0
  135. package/lib/{MdxPage-COBmXj_4.js → MdxPage-B4FcPIi5.js} +7 -7
  136. package/lib/MdxPage-B4FcPIi5.js.map +1 -0
  137. package/lib/{OperationList-BwJXexkA.js → OperationList-C2jKCTwZ.js} +149 -108
  138. package/lib/OperationList-C2jKCTwZ.js.map +1 -0
  139. package/lib/{Route-CX_-Q1HO.js → Route-DWXcQzRK.js} +3 -4
  140. package/lib/Route-DWXcQzRK.js.map +1 -0
  141. package/lib/SidebarBadge-C0iWtji9.js +503 -0
  142. package/lib/SidebarBadge-C0iWtji9.js.map +1 -0
  143. package/lib/{SlotletProvider-CULK8zmk.js → SlotletProvider-DmqWiVFt.js} +43 -42
  144. package/lib/{SlotletProvider-CULK8zmk.js.map → SlotletProvider-DmqWiVFt.js.map} +1 -1
  145. package/lib/ZudokuContext-MRoel6bS.js +1173 -0
  146. package/lib/ZudokuContext-MRoel6bS.js.map +1 -0
  147. package/lib/assets/{index-B9EWVYfo.js → index-B_Jk_Yzp.js} +968 -938
  148. package/lib/assets/index-B_Jk_Yzp.js.map +1 -0
  149. package/lib/assets/{worker-DgVH8VJc.js → worker-Bf8vjASY.js} +4585 -4297
  150. package/lib/assets/worker-Bf8vjASY.js.map +1 -0
  151. package/lib/{index-BfA1oLPP.js → index-Ch8VO_uX.js} +598 -545
  152. package/lib/index-Ch8VO_uX.js.map +1 -0
  153. package/lib/{index-CLd8ycZz.js → index-CkwDvuPt.js} +947 -917
  154. package/lib/index-CkwDvuPt.js.map +1 -0
  155. package/lib/{index-LNp6rxyU.js → index-D06ATMgg.js} +2 -2
  156. package/lib/{index-LNp6rxyU.js.map → index-D06ATMgg.js.map} +1 -1
  157. package/lib/{index-BG0g4WW0.js → index-DFN92YJN.js} +748 -737
  158. package/lib/index-DFN92YJN.js.map +1 -0
  159. package/lib/index-DJqnphbT.js +35 -0
  160. package/lib/{index-Bn6Lc9tq.js.map → index-DJqnphbT.js.map} +1 -1
  161. package/lib/{index-BuA1OA5H.js → index-Dso_b0di.js} +1966 -1689
  162. package/lib/index-Dso_b0di.js.map +1 -0
  163. package/lib/{index-Q0TPJvr8.js → index-bYAqbdYl.js} +3 -3
  164. package/lib/{index-Q0TPJvr8.js.map → index-bYAqbdYl.js.map} +1 -1
  165. package/lib/router-BsfSoK2j.js +3024 -0
  166. package/lib/router-BsfSoK2j.js.map +1 -0
  167. package/lib/state-CsuHT8ZO.js +183 -0
  168. package/lib/state-CsuHT8ZO.js.map +1 -0
  169. package/lib/urql-core-KJnLL26g.js +1455 -0
  170. package/lib/urql-core-KJnLL26g.js.map +1 -0
  171. package/lib/useExposedProps-BWwxa-Hg.js +9 -0
  172. package/lib/useExposedProps-BWwxa-Hg.js.map +1 -0
  173. package/lib/{utils-ByIc_KIM.js → utils-C8S3st2k.js} +4 -4
  174. package/lib/utils-C8S3st2k.js.map +1 -0
  175. package/lib/zudoku.auth-auth0.js +1 -1
  176. package/lib/zudoku.auth-clerk.js +2 -2
  177. package/lib/zudoku.auth-openid.js +363 -350
  178. package/lib/zudoku.auth-openid.js.map +1 -1
  179. package/lib/zudoku.components.js +1768 -1687
  180. package/lib/zudoku.components.js.map +1 -1
  181. package/lib/zudoku.openapi-worker.js +4641 -4352
  182. package/lib/zudoku.openapi-worker.js.map +1 -1
  183. package/lib/zudoku.plugin-api-keys.js +7 -7
  184. package/lib/zudoku.plugin-custom-pages.js +21 -0
  185. package/lib/zudoku.plugin-custom-pages.js.map +1 -0
  186. package/lib/zudoku.plugin-markdown.js +1 -1
  187. package/lib/zudoku.plugin-openapi.js +8 -8
  188. package/lib/zudoku.plugin-redirect.js +1 -1
  189. package/package.json +70 -68
  190. package/src/app/main.css +0 -1
  191. package/src/app/main.tsx +5 -7
  192. package/src/lib/authentication/hook.ts +1 -1
  193. package/src/lib/authentication/state.ts +17 -0
  194. package/src/lib/components/Banner.tsx +12 -2
  195. package/src/lib/components/ErrorPage.tsx +0 -2
  196. package/src/lib/components/Header.tsx +4 -2
  197. package/src/lib/components/InlineCode.tsx +10 -0
  198. package/src/lib/components/Layout.tsx +2 -1
  199. package/src/lib/components/MobileTopNavigation.tsx +10 -2
  200. package/src/lib/components/Search.tsx +1 -1
  201. package/src/lib/components/SlotletProvider.tsx +27 -4
  202. package/src/lib/components/TopNavigation.tsx +14 -1
  203. package/src/lib/components/index.ts +3 -1
  204. package/src/lib/components/navigation/Sidebar.tsx +1 -1
  205. package/src/lib/components/navigation/SidebarCategory.tsx +34 -26
  206. package/src/lib/components/navigation/SidebarItem.tsx +16 -17
  207. package/src/lib/core/DevPortalContext.ts +7 -2
  208. package/src/lib/oas/graphql/index.ts +15 -11
  209. package/src/lib/oas/parser/index.ts +1 -0
  210. package/src/lib/plugins/custom-pages/CustomPage.tsx +18 -0
  211. package/src/lib/plugins/custom-pages/index.tsx +24 -0
  212. package/src/lib/plugins/markdown/MdxPage.tsx +10 -8
  213. package/src/lib/plugins/openapi/Endpoint.tsx +86 -22
  214. package/src/lib/plugins/openapi/OperationList.tsx +4 -2
  215. package/src/lib/plugins/openapi/PlaygroundDialogWrapper.tsx +3 -0
  216. package/src/lib/plugins/openapi/Route.tsx +1 -2
  217. package/src/lib/plugins/openapi/Sidecar.tsx +18 -3
  218. package/src/lib/plugins/openapi/SimpleSelect.tsx +10 -2
  219. package/src/lib/plugins/openapi/client/createMemoryClient.ts +1 -6
  220. package/src/lib/plugins/openapi/client/createWorkerClient.ts +1 -6
  221. package/src/lib/plugins/openapi/graphql/gql.ts +11 -3
  222. package/src/lib/plugins/openapi/graphql/graphql.ts +113 -1
  223. package/src/lib/plugins/openapi/index.tsx +1 -5
  224. package/src/lib/plugins/openapi/playground/Playground.tsx +40 -5
  225. package/src/lib/plugins/openapi/playground/ResponseTab.tsx +0 -1
  226. package/src/lib/ui/Callout.tsx +7 -6
  227. package/src/lib/ui/Drawer.tsx +38 -36
  228. package/src/lib/util/useExposedProps.tsx +10 -0
  229. package/dist/lib/plugins/custom-page/index.d.ts +0 -8
  230. package/dist/lib/plugins/custom-page/index.js +0 -12
  231. package/dist/lib/plugins/custom-page/index.js.map +0 -1
  232. package/dist/lib/plugins/openapi/playground/Editor.d.ts +0 -1
  233. package/dist/lib/plugins/openapi/playground/Editor.js +0 -5
  234. package/dist/lib/plugins/openapi/playground/Editor.js.map +0 -1
  235. package/dist/lib/plugins/openapi/util/urql.d.ts +0 -7
  236. package/dist/lib/plugins/openapi/util/urql.js +0 -8
  237. package/dist/lib/plugins/openapi/util/urql.js.map +0 -1
  238. package/lib/ErrorPage-C5Pnyfbg.js +0 -18
  239. package/lib/ErrorPage-C5Pnyfbg.js.map +0 -1
  240. package/lib/Input-DulGxZh-.js +0 -2198
  241. package/lib/Input-DulGxZh-.js.map +0 -1
  242. package/lib/Markdown-BUUIyZbc.js.map +0 -1
  243. package/lib/MdxPage-COBmXj_4.js.map +0 -1
  244. package/lib/OperationList-BwJXexkA.js.map +0 -1
  245. package/lib/Route-CX_-Q1HO.js.map +0 -1
  246. package/lib/SidebarBadge-gvlvsv3E.js +0 -498
  247. package/lib/SidebarBadge-gvlvsv3E.js.map +0 -1
  248. package/lib/ZudokuContext-cr-pTRY1.js +0 -1084
  249. package/lib/ZudokuContext-cr-pTRY1.js.map +0 -1
  250. package/lib/_commonjsHelpers-BkfeUUK-.js +0 -29
  251. package/lib/_commonjsHelpers-BkfeUUK-.js.map +0 -1
  252. package/lib/assets/index-B9EWVYfo.js.map +0 -1
  253. package/lib/assets/worker-DgVH8VJc.js.map +0 -1
  254. package/lib/index-BG0g4WW0.js.map +0 -1
  255. package/lib/index-BfA1oLPP.js.map +0 -1
  256. package/lib/index-Bn6Lc9tq.js +0 -9
  257. package/lib/index-BuA1OA5H.js.map +0 -1
  258. package/lib/index-CLd8ycZz.js.map +0 -1
  259. package/lib/router-D2p7Olpn.js +0 -2971
  260. package/lib/router-D2p7Olpn.js.map +0 -1
  261. package/lib/state-BUM4jc0J.js +0 -288
  262. package/lib/state-BUM4jc0J.js.map +0 -1
  263. package/lib/urql-YhcsXYy8.js +0 -1591
  264. package/lib/urql-YhcsXYy8.js.map +0 -1
  265. package/lib/utils-ByIc_KIM.js.map +0 -1
  266. package/lib/zudoku.plugin-custom-page.js +0 -13
  267. package/lib/zudoku.plugin-custom-page.js.map +0 -1
  268. package/src/lib/plugins/custom-page/index.tsx +0 -22
  269. package/src/lib/plugins/openapi/playground/Editor.tsx +0 -4
  270. package/src/lib/plugins/openapi/util/urql.ts +0 -8
@@ -1,12 +1,7 @@
1
1
  /* eslint-disable no-console */
2
2
  import { monotonicFactory } from "ulidx";
3
+ import { cacheExchange, Client, fetchExchange, mapExchange } from "urql";
3
4
  import { createWaitForNotify } from "../../../util/createWaitForNotify.js";
4
- import {
5
- cacheExchange,
6
- Client,
7
- fetchExchange,
8
- mapExchange,
9
- } from "../util/urql.js";
10
5
  import { createClient as createMemoryClient } from "./createMemoryClient.js";
11
6
  import { CreateClientFunction } from "./interfaces.js";
12
7
 
@@ -13,11 +13,13 @@ import * as types from "./graphql.js";
13
13
  * Therefore it is highly recommended to use the babel or swc plugin for production.
14
14
  */
15
15
  const documents = {
16
+ "\n query ServersQuery($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n url\n servers {\n url\n }\n }\n }\n":
17
+ types.ServersQueryDocument,
16
18
  "\n fragment OperationsFragment on OperationItem {\n slug\n summary\n method\n description\n operationId\n contentTypes\n path\n parameters {\n name\n in\n description\n required\n schema\n style\n examples {\n name\n description\n externalValue\n value\n summary\n }\n }\n requestBody {\n content {\n mediaType\n encoding {\n name\n }\n schema\n }\n description\n required\n }\n responses {\n statusCode\n links\n description\n content {\n mediaType\n encoding {\n name\n }\n schema\n }\n }\n }\n":
17
19
  types.OperationsFragmentFragmentDoc,
18
20
  "\n query AllOperations($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n description\n title\n url\n version\n tags {\n name\n description\n operations {\n slug\n ...OperationsFragment\n }\n }\n }\n }\n":
19
21
  types.AllOperationsDocument,
20
- "\n query getServerQuery($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n url\n }\n }\n":
22
+ "\n query getServerQuery($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n url\n servers {\n url\n }\n }\n }\n":
21
23
  types.GetServerQueryDocument,
22
24
  "\n query GetCategories($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n tags {\n __typename\n name\n operations {\n __typename\n slug\n deprecated\n method\n summary\n operationId\n path\n }\n }\n }\n }\n":
23
25
  types.GetCategoriesDocument,
@@ -37,6 +39,12 @@ const documents = {
37
39
  */
38
40
  export function graphql(source: string): unknown;
39
41
 
42
+ /**
43
+ * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
44
+ */
45
+ export function graphql(
46
+ source: "\n query ServersQuery($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n url\n servers {\n url\n }\n }\n }\n",
47
+ ): (typeof documents)["\n query ServersQuery($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n url\n servers {\n url\n }\n }\n }\n"];
40
48
  /**
41
49
  * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
42
50
  */
@@ -53,8 +61,8 @@ export function graphql(
53
61
  * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
54
62
  */
55
63
  export function graphql(
56
- source: "\n query getServerQuery($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n url\n }\n }\n",
57
- ): (typeof documents)["\n query getServerQuery($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n url\n }\n }\n"];
64
+ source: "\n query getServerQuery($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n url\n servers {\n url\n }\n }\n }\n",
65
+ ): (typeof documents)["\n query getServerQuery($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n url\n servers {\n url\n }\n }\n }\n"];
58
66
  /**
59
67
  * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
60
68
  */
@@ -131,6 +131,7 @@ export type Schema = {
131
131
  openapi: Scalars["String"]["output"];
132
132
  operations: Array<OperationItem>;
133
133
  paths: Array<PathItem>;
134
+ servers: Array<Server>;
134
135
  tags: Array<SchemaTag>;
135
136
  title: Scalars["String"]["output"];
136
137
  url: Scalars["String"]["output"];
@@ -157,12 +158,32 @@ export type SchemaTag = {
157
158
 
158
159
  export type SchemaType = "file" | "raw" | "url";
159
160
 
161
+ export type Server = {
162
+ __typename?: "Server";
163
+ description?: Maybe<Scalars["String"]["output"]>;
164
+ url: Scalars["String"]["output"];
165
+ };
166
+
160
167
  export type TagItem = {
161
168
  __typename?: "TagItem";
162
169
  description?: Maybe<Scalars["String"]["output"]>;
163
170
  name: Scalars["String"]["output"];
164
171
  };
165
172
 
173
+ export type ServersQueryQueryVariables = Exact<{
174
+ input: Scalars["JSON"]["input"];
175
+ type: SchemaType;
176
+ }>;
177
+
178
+ export type ServersQueryQuery = {
179
+ __typename?: "Query";
180
+ schema: {
181
+ __typename?: "Schema";
182
+ url: string;
183
+ servers: Array<{ __typename?: "Server"; url: string }>;
184
+ };
185
+ };
186
+
166
187
  export type OperationsFragmentFragment = {
167
188
  __typename?: "OperationItem";
168
189
  slug: string;
@@ -249,7 +270,11 @@ export type GetServerQueryQueryVariables = Exact<{
249
270
 
250
271
  export type GetServerQueryQuery = {
251
272
  __typename?: "Query";
252
- schema: { __typename?: "Schema"; url: string };
273
+ schema: {
274
+ __typename?: "Schema";
275
+ url: string;
276
+ servers: Array<{ __typename?: "Server"; url: string }>;
277
+ };
253
278
  };
254
279
 
255
280
  export type GetCategoriesQueryVariables = Exact<{
@@ -423,6 +448,83 @@ export const OperationsFragmentFragmentDoc = {
423
448
  },
424
449
  ],
425
450
  } as unknown as DocumentNode<OperationsFragmentFragment, unknown>;
451
+ export const ServersQueryDocument = {
452
+ kind: "Document",
453
+ definitions: [
454
+ {
455
+ kind: "OperationDefinition",
456
+ operation: "query",
457
+ name: { kind: "Name", value: "ServersQuery" },
458
+ variableDefinitions: [
459
+ {
460
+ kind: "VariableDefinition",
461
+ variable: {
462
+ kind: "Variable",
463
+ name: { kind: "Name", value: "input" },
464
+ },
465
+ type: {
466
+ kind: "NonNullType",
467
+ type: { kind: "NamedType", name: { kind: "Name", value: "JSON" } },
468
+ },
469
+ },
470
+ {
471
+ kind: "VariableDefinition",
472
+ variable: { kind: "Variable", name: { kind: "Name", value: "type" } },
473
+ type: {
474
+ kind: "NonNullType",
475
+ type: {
476
+ kind: "NamedType",
477
+ name: { kind: "Name", value: "SchemaType" },
478
+ },
479
+ },
480
+ },
481
+ ],
482
+ selectionSet: {
483
+ kind: "SelectionSet",
484
+ selections: [
485
+ {
486
+ kind: "Field",
487
+ name: { kind: "Name", value: "schema" },
488
+ arguments: [
489
+ {
490
+ kind: "Argument",
491
+ name: { kind: "Name", value: "input" },
492
+ value: {
493
+ kind: "Variable",
494
+ name: { kind: "Name", value: "input" },
495
+ },
496
+ },
497
+ {
498
+ kind: "Argument",
499
+ name: { kind: "Name", value: "type" },
500
+ value: {
501
+ kind: "Variable",
502
+ name: { kind: "Name", value: "type" },
503
+ },
504
+ },
505
+ ],
506
+ selectionSet: {
507
+ kind: "SelectionSet",
508
+ selections: [
509
+ { kind: "Field", name: { kind: "Name", value: "url" } },
510
+ {
511
+ kind: "Field",
512
+ name: { kind: "Name", value: "servers" },
513
+ selectionSet: {
514
+ kind: "SelectionSet",
515
+ selections: [
516
+ { kind: "Field", name: { kind: "Name", value: "url" } },
517
+ ],
518
+ },
519
+ },
520
+ ],
521
+ },
522
+ },
523
+ ],
524
+ },
525
+ },
526
+ ],
527
+ } as unknown as DocumentNode<ServersQueryQuery, ServersQueryQueryVariables>;
426
528
  export const AllOperationsDocument = {
427
529
  kind: "Document",
428
530
  definitions: [
@@ -727,6 +829,16 @@ export const GetServerQueryDocument = {
727
829
  kind: "SelectionSet",
728
830
  selections: [
729
831
  { kind: "Field", name: { kind: "Name", value: "url" } },
832
+ {
833
+ kind: "Field",
834
+ name: { kind: "Name", value: "servers" },
835
+ selectionSet: {
836
+ kind: "SelectionSet",
837
+ selections: [
838
+ { kind: "Field", name: { kind: "Name", value: "url" } },
839
+ ],
840
+ },
841
+ },
730
842
  ],
731
843
  },
732
844
  },
@@ -1,11 +1,7 @@
1
1
  import { matchPath, useRouteError, type RouteObject } from "react-router-dom";
2
+ import { Client as UrqlClient, cacheExchange, fetchExchange } from "urql";
2
3
  import { type DevPortalPlugin } from "../../core/plugins.js";
3
4
  import { graphql } from "./graphql/index.js";
4
- import {
5
- Client as UrqlClient,
6
- cacheExchange,
7
- fetchExchange,
8
- } from "./util/urql.js";
9
5
 
10
6
  import { useQuery } from "@tanstack/react-query";
11
7
  import { CirclePlayIcon, LogInIcon } from "lucide-react";
@@ -1,6 +1,7 @@
1
1
  import { useMutation } from "@tanstack/react-query";
2
- import { Fragment, useEffect, useRef } from "react";
2
+ import { Fragment, useEffect, useRef, useTransition } from "react";
3
3
  import { FormProvider, useForm } from "react-hook-form";
4
+ import { useSelectedServerStore } from "../../../authentication/state.js";
4
5
  import { useApiIdentities } from "../../../components/context/ZudokuContext.js";
5
6
  import {
6
7
  Select,
@@ -62,6 +63,7 @@ export type PlaygroundForm = {
62
63
 
63
64
  export type PlaygroundContentProps = {
64
65
  server: string;
66
+ servers?: string[];
65
67
  url: string;
66
68
  method: string;
67
69
  headers?: Header[];
@@ -72,6 +74,7 @@ export type PlaygroundContentProps = {
72
74
 
73
75
  export const Playground = ({
74
76
  server,
77
+ servers,
75
78
  url,
76
79
  method,
77
80
  headers = [],
@@ -79,6 +82,8 @@ export const Playground = ({
79
82
  pathParams = [],
80
83
  defaultBody = "",
81
84
  }: PlaygroundContentProps) => {
85
+ const { selectedServer, setSelectedServer } = useSelectedServerStore();
86
+ const [, startTransition] = useTransition();
82
87
  const { register, control, handleSubmit, watch, setValue, ...form } =
83
88
  useForm<PlaygroundForm>({
84
89
  defaultValues: {
@@ -114,7 +119,7 @@ export const Playground = ({
114
119
 
115
120
  const queryMutation = useMutation({
116
121
  mutationFn: async (data: PlaygroundForm) => {
117
- const requestUrl = createUrl(server, url, data);
122
+ const requestUrl = createUrl(selectedServer ?? server, url, data);
118
123
  const start = performance.now();
119
124
 
120
125
  const request = new Request(requestUrl, {
@@ -124,6 +129,7 @@ export const Playground = ({
124
129
  .filter((h) => h.name)
125
130
  .map((header) => [header.name, header.value]),
126
131
  ),
132
+ body: data.body ? data.body : undefined,
127
133
  });
128
134
 
129
135
  if (data.identity !== NO_IDENTITY) {
@@ -200,19 +206,48 @@ export const Playground = ({
200
206
  </Fragment>
201
207
  ));
202
208
 
209
+ const serverSelect = (
210
+ <div className="inline-block opacity-50 hover:opacity-100 transition">
211
+ {servers && servers.length > 1 ? (
212
+ <Select
213
+ onValueChange={(value) => {
214
+ startTransition(() => {
215
+ setSelectedServer(value);
216
+ });
217
+ }}
218
+ value={selectedServer}
219
+ >
220
+ <SelectTrigger className="p-0 border-none flex-row-reverse bg-transparent text-xs gap-0.5 h-auto">
221
+ <SelectValue />
222
+ </SelectTrigger>
223
+ <SelectContent>
224
+ {servers.map((s) => (
225
+ <SelectItem key={s} value={s}>
226
+ {s.replace(/^https?:\/\//, "")}
227
+ </SelectItem>
228
+ ))}
229
+ </SelectContent>
230
+ </Select>
231
+ ) : (
232
+ <span>{server.replace(/^https?:\/\//, "")}</span>
233
+ )}
234
+ </div>
235
+ );
236
+
203
237
  return (
204
238
  <FormProvider
205
239
  {...{ register, control, handleSubmit, watch, setValue, ...form }}
206
240
  >
207
241
  <form onSubmit={handleSubmit((data) => queryMutation.mutateAsync(data))}>
208
- <div className="grid grid-cols-2 text-sm h-full">
242
+ <div className="grid grid-cols-[8fr_7fr] text-sm h-full">
209
243
  <div className="flex flex-col gap-4 p-8 bg-muted/50 after:bg-muted-foreground/20 relative after:absolute after:w-px after:inset-0 after:left-auto">
210
244
  <div className="flex gap-2 items-stretch">
211
245
  <div className="flex flex-1 items-center w-full border rounded-md">
212
246
  <div className="border-r p-2 bg-muted rounded-l-md self-stretch font-semibold font-mono">
213
247
  {method.toUpperCase()}
214
248
  </div>
215
- <div className="p-2 font-mono text-xs">
249
+ <div className="flex items-center flex-wrap p-2 font-mono text-xs">
250
+ {serverSelect}
216
251
  {path}
217
252
  {urlQueryParams.length > 0 ? "?" : ""}
218
253
  {urlQueryParams}
@@ -296,7 +331,7 @@ export const Playground = ({
296
331
  </TabsContent>
297
332
  </Tabs>
298
333
  </div>
299
- <div className="p-8 bg-muted/70">
334
+ <div className="min-w-0 p-8 bg-muted/70">
300
335
  {queryMutation.error ? (
301
336
  <div className="flex flex-col gap-2">
302
337
  {formState.pathParams.some((p) => p.value === "") && (
@@ -54,7 +54,6 @@ export const ResponseTab = ({
54
54
  view === "raw" ? (jsonContent ? "plain" : detectedLanguage) : "json"
55
55
  }
56
56
  noBackground
57
- showLanguageIndicator
58
57
  // playground dialog has h-5/6 ≈ 83.333vh
59
58
  className="overflow-x-auto p-4 text-xs max-h-[calc(83.333vh-180px)]"
60
59
  code={view === "raw" ? body : beautifiedBody}
@@ -2,6 +2,7 @@ import {
2
2
  AlertTriangleIcon,
3
3
  InfoIcon,
4
4
  LightbulbIcon,
5
+ type LucideIcon,
5
6
  ShieldAlertIcon,
6
7
  } from "lucide-react";
7
8
  import type { ReactNode } from "react";
@@ -14,7 +15,7 @@ const stylesMap = {
14
15
  iconColor: "text-gray-600 dark:text-zinc-300",
15
16
  titleColor: "text-gray-600 dark:text-zinc-300",
16
17
  textColor: "text-gray-600 dark:text-zinc-300",
17
- Icon: InfoIcon,
18
+ Icon: InfoIcon as LucideIcon,
18
19
  },
19
20
  tip: {
20
21
  border: "border-green-500 dark:border-green-800",
@@ -22,7 +23,7 @@ const stylesMap = {
22
23
  iconColor: "text-green-600 dark:text-green-200",
23
24
  titleColor: "text-green-700 dark:text-green-200",
24
25
  textColor: "text-green-600 dark:text-green-50",
25
- Icon: LightbulbIcon,
26
+ Icon: LightbulbIcon as LucideIcon,
26
27
  },
27
28
  info: {
28
29
  border: "border-blue-400 dark:border-blue-900/60",
@@ -30,7 +31,7 @@ const stylesMap = {
30
31
  iconColor: "text-blue-400 dark:text-blue-200",
31
32
  titleColor: "text-blue-700 dark:text-blue-200",
32
33
  textColor: "text-blue-600 dark:text-blue-100",
33
- Icon: InfoIcon,
34
+ Icon: InfoIcon as LucideIcon,
34
35
  },
35
36
  caution: {
36
37
  border: "border-yellow-400 dark:border-yellow-400/25",
@@ -38,7 +39,7 @@ const stylesMap = {
38
39
  iconColor: "text-yellow-500 dark:text-yellow-300",
39
40
  titleColor: "text-yellow-600 dark:text-yellow-300",
40
41
  textColor: "text-yellow-700 dark:text-yellow-200",
41
- Icon: AlertTriangleIcon,
42
+ Icon: AlertTriangleIcon as LucideIcon,
42
43
  },
43
44
  danger: {
44
45
  border: "border-rose-400 dark:border-rose-800",
@@ -46,9 +47,9 @@ const stylesMap = {
46
47
  iconColor: "text-rose-400 dark:text-rose-300",
47
48
  titleColor: "text-rose-800 dark:text-rose-300",
48
49
  textColor: "text-rose-700 dark:text-rose-100",
49
- Icon: ShieldAlertIcon,
50
+ Icon: ShieldAlertIcon as LucideIcon,
50
51
  },
51
- };
52
+ } as const;
52
53
 
53
54
  type CalloutProps = {
54
55
  type: keyof typeof stylesMap;
@@ -13,16 +13,16 @@ const Drawer = ({
13
13
  );
14
14
  Drawer.displayName = "Drawer";
15
15
 
16
- const DrawerTrigger = DrawerPrimitive.Trigger;
16
+ const DrawerTrigger: typeof DrawerPrimitive.Trigger = DrawerPrimitive.Trigger;
17
17
 
18
- const DrawerPortal = DrawerPrimitive.Portal;
18
+ const DrawerPortal: typeof DrawerPrimitive.Portal = DrawerPrimitive.Portal;
19
19
 
20
- const DrawerClose = DrawerPrimitive.Close;
20
+ const DrawerClose: typeof DrawerPrimitive.Close = DrawerPrimitive.Close;
21
21
 
22
- const DrawerOverlay = React.forwardRef<
23
- React.ElementRef<typeof DrawerPrimitive.Overlay>,
24
- React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Overlay>
25
- >(({ className, ...props }, ref) => (
22
+ const DrawerOverlay: React.ForwardRefExoticComponent<
23
+ React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Overlay> &
24
+ React.RefAttributes<React.ElementRef<typeof DrawerPrimitive.Overlay>>
25
+ > = React.forwardRef(({ className, ...props }, ref) => (
26
26
  <DrawerPrimitive.Overlay
27
27
  ref={ref}
28
28
  className={cn("fixed inset-0 z-50 bg-black/80", className)}
@@ -31,29 +31,31 @@ const DrawerOverlay = React.forwardRef<
31
31
  ));
32
32
  DrawerOverlay.displayName = DrawerPrimitive.Overlay.displayName;
33
33
 
34
- const DrawerContent = React.forwardRef<
35
- React.ElementRef<typeof DrawerPrimitive.Content>,
34
+ const DrawerContent: React.ForwardRefExoticComponent<
36
35
  React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Content> & {
37
36
  hideBar?: boolean;
38
- }
39
- >(({ className, children, hideBar = true, ...props }, ref) => (
40
- <DrawerPortal>
41
- <DrawerOverlay />
42
- <DrawerPrimitive.Content
43
- ref={ref}
44
- className={cn(
45
- "fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border bg-background",
46
- className,
47
- )}
48
- {...props}
49
- >
50
- {!hideBar && (
51
- <div className="mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted" />
52
- )}
53
- {children}
54
- </DrawerPrimitive.Content>
55
- </DrawerPortal>
56
- ));
37
+ } & React.RefAttributes<React.ElementRef<typeof DrawerPrimitive.Content>>
38
+ > = React.forwardRef(
39
+ ({ className, children, hideBar = true, ...props }, ref) => (
40
+ <DrawerPortal>
41
+ <DrawerOverlay />
42
+ <DrawerPrimitive.Content
43
+ ref={ref}
44
+ className={cn(
45
+ "fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border bg-background",
46
+ className,
47
+ )}
48
+ {...props}
49
+ >
50
+ {!hideBar && (
51
+ <div className="mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted" />
52
+ )}
53
+ {children}
54
+ </DrawerPrimitive.Content>
55
+ </DrawerPortal>
56
+ ),
57
+ );
58
+
57
59
  DrawerContent.displayName = "DrawerContent";
58
60
 
59
61
  const DrawerHeader = ({
@@ -78,10 +80,10 @@ const DrawerFooter = ({
78
80
  );
79
81
  DrawerFooter.displayName = "DrawerFooter";
80
82
 
81
- const DrawerTitle = React.forwardRef<
82
- React.ElementRef<typeof DrawerPrimitive.Title>,
83
- React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Title>
84
- >(({ className, ...props }, ref) => (
83
+ const DrawerTitle: React.ForwardRefExoticComponent<
84
+ React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Title> &
85
+ React.RefAttributes<React.ElementRef<typeof DrawerPrimitive.Title>>
86
+ > = React.forwardRef(({ className, ...props }, ref) => (
85
87
  <DrawerPrimitive.Title
86
88
  ref={ref}
87
89
  className={cn(
@@ -93,10 +95,10 @@ const DrawerTitle = React.forwardRef<
93
95
  ));
94
96
  DrawerTitle.displayName = DrawerPrimitive.Title.displayName;
95
97
 
96
- const DrawerDescription = React.forwardRef<
97
- React.ElementRef<typeof DrawerPrimitive.Description>,
98
- React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Description>
99
- >(({ className, ...props }, ref) => (
98
+ const DrawerDescription: React.ForwardRefExoticComponent<
99
+ React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Description> &
100
+ React.RefAttributes<React.ElementRef<typeof DrawerPrimitive.Description>>
101
+ > = React.forwardRef(({ className, ...props }, ref) => (
100
102
  <DrawerPrimitive.Description
101
103
  ref={ref}
102
104
  className={cn("text-sm text-muted-foreground", className)}
@@ -0,0 +1,10 @@
1
+ import { useLocation, useNavigate, useSearchParams } from "react-router-dom";
2
+ import type { ExposedComponentProps } from "../components/SlotletProvider.js";
3
+
4
+ export const useExposedProps = (): ExposedComponentProps => {
5
+ const location = useLocation();
6
+ const navigate = useNavigate();
7
+ const [searchParams, setSearchParams] = useSearchParams();
8
+
9
+ return { location, navigate, searchParams, setSearchParams };
10
+ };
@@ -1,8 +0,0 @@
1
- import type { ReactNode } from "react";
2
- import type { DevPortalPlugin, NavigationPlugin } from "../../core/plugins.js";
3
- type CustomPageConfig = Array<{
4
- path: string;
5
- element: ReactNode;
6
- }>;
7
- export declare const customPagePlugin: (config: CustomPageConfig) => DevPortalPlugin & NavigationPlugin;
8
- export {};
@@ -1,12 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { ProseClasses } from "../../components/Markdown.js";
3
- export const customPagePlugin = (config) => {
4
- return {
5
- getRoutes: () => config.map(({ path, element }) => ({
6
- path,
7
- // TODO: we should componentize prose pages
8
- element: _jsx("div", { className: ProseClasses + " max-w-full", children: element }),
9
- })),
10
- };
11
- };
12
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/plugins/custom-page/index.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAQ5D,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAC9B,MAAwB,EACY,EAAE;IACtC,OAAO;QACL,SAAS,EAAE,GAAkB,EAAE,CAC7B,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,CAAC;YACjC,IAAI;YACJ,2CAA2C;YAC3C,OAAO,EAAE,cAAK,SAAS,EAAE,YAAY,GAAG,aAAa,YAAG,OAAO,GAAO;SACvE,CAAC,CAAC;KACN,CAAC;AACJ,CAAC,CAAC"}
@@ -1 +0,0 @@
1
- export declare const Editor: () => void;
@@ -1,5 +0,0 @@
1
- export const Editor = () => {
2
- // const XoXo = lazy(() => import("@monaco-editor/react"));
3
- // return <XoXo />;
4
- };
5
- //# sourceMappingURL=Editor.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Editor.js","sourceRoot":"","sources":["../../../../../src/lib/plugins/openapi/playground/Editor.tsx"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,EAAE;IACzB,2DAA2D;IAC3D,mBAAmB;AACrB,CAAC,CAAC"}
@@ -1,7 +0,0 @@
1
- import * as urql from "urql";
2
- export declare const useQuery: typeof urql.useQuery;
3
- export declare const Provider: import("react").Provider<object | urql.Client>;
4
- export declare const cacheExchange: urql.Exchange;
5
- export declare const fetchExchange: urql.Exchange;
6
- export declare const mapExchange: ({ onOperation, onResult, onError, }: urql.MapExchangeOpts) => urql.Exchange;
7
- export declare const Client: new (opts: urql.ClientOptions) => urql.Client;
@@ -1,8 +0,0 @@
1
- import * as urql from "urql";
2
- export const useQuery = urql.useQuery;
3
- export const Provider = urql.Provider;
4
- export const cacheExchange = urql.cacheExchange;
5
- export const fetchExchange = urql.fetchExchange;
6
- export const mapExchange = urql.mapExchange;
7
- export const Client = urql.Client;
8
- //# sourceMappingURL=urql.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"urql.js","sourceRoot":"","sources":["../../../../../src/lib/plugins/openapi/util/urql.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAE7B,MAAM,CAAC,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;AACtC,MAAM,CAAC,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;AACtC,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,CAAC,aAAa,CAAC;AAChD,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,CAAC,aAAa,CAAC;AAChD,MAAM,CAAC,MAAM,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC;AAC5C,MAAM,CAAC,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC"}
@@ -1,18 +0,0 @@
1
- import { j as r } from "./jsx-runtime-B6kdoens.js";
2
- import { L as a } from "./index-BG0g4WW0.js";
3
- import { C as n } from "./CategoryHeading-EN3W3xEN.js";
4
- import { P as i, H as t } from "./Markdown-BUUIyZbc.js";
5
- const p = ({
6
- title: e = "An error occurred",
7
- message: o,
8
- category: s
9
- }) => /* @__PURE__ */ r.jsxs("div", { className: i + " h-full pt-[--padding-content-top]", children: [
10
- s && /* @__PURE__ */ r.jsx(n, { children: s }),
11
- e && /* @__PURE__ */ r.jsx(t, { level: 1, className: "flex gap-3.5 items-center", children: e }),
12
- /* @__PURE__ */ r.jsx("p", { children: o }),
13
- /* @__PURE__ */ r.jsx(a, { to: "/", children: "Go back home" })
14
- ] });
15
- export {
16
- p as E
17
- };
18
- //# sourceMappingURL=ErrorPage-C5Pnyfbg.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ErrorPage-C5Pnyfbg.js","sources":["../src/lib/components/ErrorPage.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport { Link } from \"react-router-dom\";\nimport { CategoryHeading } from \"./CategoryHeading.js\";\nimport { Heading } from \"./Heading.js\";\nimport { ProseClasses } from \"./Markdown.js\";\n\nexport const ErrorPage = ({\n title = \"An error occurred\",\n message,\n category,\n}: {\n title?: ReactNode;\n message?: ReactNode;\n category?: ReactNode;\n}) => {\n return (\n <div className={ProseClasses + \" h-full pt-[--padding-content-top]\"}>\n {category && <CategoryHeading>{category}</CategoryHeading>}\n {title && (\n <Heading level={1} className=\"flex gap-3.5 items-center\">\n {title}\n </Heading>\n )}\n <p>{message}</p>\n <Link to=\"/\">Go back home</Link>\n </div>\n );\n};\n"],"names":["ErrorPage","title","message","category","jsxs","ProseClasses","jsx","CategoryHeading","Heading","Link"],"mappings":";;;;AAMO,MAAMA,IAAY,CAAC;AAAA,EACxB,OAAAC,IAAQ;AAAA,EACR,SAAAC;AAAA,EACA,UAAAC;AACF,MAMKC,gBAAAA,EAAAA,KAAA,OAAA,EAAI,WAAWC,IAAe,sCAC5B,UAAA;AAAA,EAAYF,KAAAG,gBAAAA,EAAAA,IAACC,KAAiB,UAASJ,EAAA,CAAA;AAAA,EACvCF,KACEK,gBAAAA,EAAAA,IAAAE,GAAA,EAAQ,OAAO,GAAG,WAAU,6BAC1B,UACHP,GAAA;AAAA,EAEFK,gBAAAA,EAAAA,IAAC,OAAG,UAAQJ,EAAA,CAAA;AAAA,EACXI,gBAAAA,EAAA,IAAAG,GAAA,EAAK,IAAG,KAAI,UAAY,gBAAA;AAC3B,EAAA,CAAA;"}