zudoku 0.0.0-eff6f9b → 0.0.0-f1a6fd4

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 (268) hide show
  1. package/README.md +121 -0
  2. package/dist/app/main.js +3 -3
  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/config.d.ts +2 -1
  7. package/dist/config/validators/InputSidebarSchema.d.ts +1 -0
  8. package/dist/config/validators/validate.d.ts +42 -23
  9. package/dist/config/validators/validate.js +6 -2
  10. package/dist/config/validators/validate.js.map +1 -1
  11. package/dist/index.d.ts +2 -1
  12. package/dist/lib/authentication/state.d.ts +16 -0
  13. package/dist/lib/authentication/state.js +5 -0
  14. package/dist/lib/authentication/state.js.map +1 -1
  15. package/dist/lib/components/Banner.js +7 -1
  16. package/dist/lib/components/Banner.js.map +1 -1
  17. package/dist/lib/components/ErrorPage.js +1 -2
  18. package/dist/lib/components/ErrorPage.js.map +1 -1
  19. package/dist/lib/components/Header.js +1 -1
  20. package/dist/lib/components/Header.js.map +1 -1
  21. package/dist/lib/components/InlineCode.d.ts +2 -1
  22. package/dist/lib/components/InlineCode.js +9 -1
  23. package/dist/lib/components/InlineCode.js.map +1 -1
  24. package/dist/lib/components/Layout.js +1 -1
  25. package/dist/lib/components/Layout.js.map +1 -1
  26. package/dist/lib/components/MobileTopNavigation.js +2 -1
  27. package/dist/lib/components/MobileTopNavigation.js.map +1 -1
  28. package/dist/lib/components/Search.js +1 -1
  29. package/dist/lib/components/Search.js.map +1 -1
  30. package/dist/lib/components/SlotletProvider.d.ts +9 -2
  31. package/dist/lib/components/SlotletProvider.js +4 -2
  32. package/dist/lib/components/SlotletProvider.js.map +1 -1
  33. package/dist/lib/components/index.d.ts +2 -1
  34. package/dist/lib/components/index.js.map +1 -1
  35. package/dist/lib/core/DevPortalContext.d.ts +1 -1
  36. package/dist/lib/oas/graphql/index.d.ts +2 -1
  37. package/dist/lib/oas/graphql/index.js +23 -15
  38. package/dist/lib/oas/graphql/index.js.map +1 -1
  39. package/dist/lib/oas/parser/index.d.ts +1 -0
  40. package/dist/lib/oas/parser/index.js.map +1 -1
  41. package/dist/lib/plugins/custom-pages/CustomPage.d.ts +2 -0
  42. package/dist/lib/plugins/custom-pages/CustomPage.js +11 -0
  43. package/dist/lib/plugins/custom-pages/CustomPage.js.map +1 -0
  44. package/dist/lib/plugins/custom-pages/index.d.ts +10 -0
  45. package/dist/lib/plugins/custom-pages/index.js +11 -0
  46. package/dist/lib/plugins/custom-pages/index.js.map +1 -0
  47. package/dist/lib/plugins/markdown/MdxPage.js +2 -2
  48. package/dist/lib/plugins/markdown/MdxPage.js.map +1 -1
  49. package/dist/lib/plugins/openapi/Endpoint.d.ts +1 -3
  50. package/dist/lib/plugins/openapi/Endpoint.js +46 -8
  51. package/dist/lib/plugins/openapi/Endpoint.js.map +1 -1
  52. package/dist/lib/plugins/openapi/OperationList.js +2 -2
  53. package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
  54. package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.d.ts +2 -1
  55. package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.js +2 -2
  56. package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.js.map +1 -1
  57. package/dist/lib/plugins/openapi/Route.d.ts +1 -1
  58. package/dist/lib/plugins/openapi/Route.js +1 -1
  59. package/dist/lib/plugins/openapi/Route.js.map +1 -1
  60. package/dist/lib/plugins/openapi/Sidecar.js +15 -4
  61. package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
  62. package/dist/lib/plugins/openapi/SimpleSelect.d.ts +2 -1
  63. package/dist/lib/plugins/openapi/SimpleSelect.js +1 -1
  64. package/dist/lib/plugins/openapi/SimpleSelect.js.map +1 -1
  65. package/dist/lib/plugins/openapi/client/createMemoryClient.js +1 -1
  66. package/dist/lib/plugins/openapi/client/createMemoryClient.js.map +1 -1
  67. package/dist/lib/plugins/openapi/client/createWorkerClient.js +1 -1
  68. package/dist/lib/plugins/openapi/client/createWorkerClient.js.map +1 -1
  69. package/dist/lib/plugins/openapi/graphql/gql.d.ts +10 -2
  70. package/dist/lib/plugins/openapi/graphql/gql.js +2 -1
  71. package/dist/lib/plugins/openapi/graphql/gql.js.map +1 -1
  72. package/dist/lib/plugins/openapi/graphql/graphql.d.ts +26 -0
  73. package/dist/lib/plugins/openapi/graphql/graphql.js +87 -0
  74. package/dist/lib/plugins/openapi/graphql/graphql.js.map +1 -1
  75. package/dist/lib/plugins/openapi/index.js +3 -2
  76. package/dist/lib/plugins/openapi/index.js.map +1 -1
  77. package/dist/lib/plugins/openapi/playground/Playground.d.ts +2 -1
  78. package/dist/lib/plugins/openapi/playground/Playground.js +13 -5
  79. package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
  80. package/dist/lib/plugins/openapi/playground/ResponseTab.js +1 -1
  81. package/dist/lib/plugins/openapi/playground/ResponseTab.js.map +1 -1
  82. package/dist/lib/plugins/openapi/playground/createUrl.js +3 -1
  83. package/dist/lib/plugins/openapi/playground/createUrl.js.map +1 -1
  84. package/dist/lib/ui/Callout.d.ts +36 -35
  85. package/dist/lib/ui/Callout.js.map +1 -1
  86. package/dist/lib/ui/Drawer.d.ts +8 -10
  87. package/dist/lib/ui/Drawer.js.map +1 -1
  88. package/dist/lib/util/useExposedProps.d.ts +2 -0
  89. package/dist/lib/util/useExposedProps.js +8 -0
  90. package/dist/lib/util/useExposedProps.js.map +1 -0
  91. package/dist/vite/config.d.ts +1 -1
  92. package/dist/vite/config.js +21 -15
  93. package/dist/vite/config.js.map +1 -1
  94. package/dist/vite/dev-server.d.ts +6 -1
  95. package/dist/vite/dev-server.js +14 -4
  96. package/dist/vite/dev-server.js.map +1 -1
  97. package/dist/vite/plugin-api.js +4 -7
  98. package/dist/vite/plugin-api.js.map +1 -1
  99. package/dist/vite/plugin-component.js +0 -1
  100. package/dist/vite/plugin-component.js.map +1 -1
  101. package/dist/vite/plugin-config-reload.js +9 -4
  102. package/dist/vite/plugin-config-reload.js.map +1 -1
  103. package/dist/vite/plugin-custom-pages.d.ts +4 -0
  104. package/dist/vite/plugin-custom-pages.js +30 -0
  105. package/dist/vite/plugin-custom-pages.js.map +1 -0
  106. package/dist/vite/plugin-frontmatter.d.ts +2 -0
  107. package/dist/vite/plugin-frontmatter.js +30 -0
  108. package/dist/vite/plugin-frontmatter.js.map +1 -0
  109. package/dist/vite/plugin-mdx.js +3 -0
  110. package/dist/vite/plugin-mdx.js.map +1 -1
  111. package/dist/vite/plugin-sidebar.js +14 -1
  112. package/dist/vite/plugin-sidebar.js.map +1 -1
  113. package/dist/vite/plugin.js +4 -2
  114. package/dist/vite/plugin.js.map +1 -1
  115. package/lib/{AuthenticationPlugin-gtf8JS3V.js → AuthenticationPlugin-CbgJ5SAh.js} +3 -3
  116. package/lib/{AuthenticationPlugin-gtf8JS3V.js.map → AuthenticationPlugin-CbgJ5SAh.js.map} +1 -1
  117. package/lib/{CategoryHeading-XnFqN2lJ.js → CategoryHeading-3Qtp2yZ8.js} +2 -2
  118. package/lib/{CategoryHeading-XnFqN2lJ.js.map → CategoryHeading-3Qtp2yZ8.js.map} +1 -1
  119. package/lib/{DeveloperHint-FBb2uXJe.js → DeveloperHint-BE9DzNhv.js} +2 -2
  120. package/lib/{DeveloperHint-FBb2uXJe.js.map → DeveloperHint-BE9DzNhv.js.map} +1 -1
  121. package/lib/ErrorPage-B0COs372.js +16 -0
  122. package/lib/ErrorPage-B0COs372.js.map +1 -0
  123. package/lib/Input-CHfE_2Qk.js +2229 -0
  124. package/lib/Input-CHfE_2Qk.js.map +1 -0
  125. package/lib/{Markdown-B4aR03g6.js → Markdown-CWI6lU11.js} +1448 -1286
  126. package/lib/Markdown-CWI6lU11.js.map +1 -0
  127. package/lib/{MdxPage-BcftTg5g.js → MdxPage-C3tlrV4j.js} +24 -24
  128. package/lib/MdxPage-C3tlrV4j.js.map +1 -0
  129. package/lib/{OperationList-Da36LrGl.js → OperationList-BO-ES1C5.js} +149 -108
  130. package/lib/OperationList-BO-ES1C5.js.map +1 -0
  131. package/lib/{Route-CWj1ECzh.js → Route-Dq6zv0Pi.js} +3 -4
  132. package/lib/Route-Dq6zv0Pi.js.map +1 -0
  133. package/lib/SidebarBadge-DmI5hT04.js +503 -0
  134. package/lib/SidebarBadge-DmI5hT04.js.map +1 -0
  135. package/lib/{SlotletProvider-DJMaOUDs.js → SlotletProvider-RvaeLR6z.js} +43 -42
  136. package/lib/{SlotletProvider-DJMaOUDs.js.map → SlotletProvider-RvaeLR6z.js.map} +1 -1
  137. package/lib/ZudokuContext-BEmsYQoq.js +1173 -0
  138. package/lib/ZudokuContext-BEmsYQoq.js.map +1 -0
  139. package/lib/assets/{index-B9EWVYfo.js → index-B_Jk_Yzp.js} +968 -938
  140. package/lib/assets/index-B_Jk_Yzp.js.map +1 -0
  141. package/lib/assets/{worker-TYRbYl6N.js → worker-Bf8vjASY.js} +6768 -4410
  142. package/lib/assets/worker-Bf8vjASY.js.map +1 -0
  143. package/lib/{index-BG0g4WW0.js → index-BRCiYFaL.js} +747 -737
  144. package/lib/index-BRCiYFaL.js.map +1 -0
  145. package/lib/{index-CLd8ycZz.js → index-CkwDvuPt.js} +947 -917
  146. package/lib/index-CkwDvuPt.js.map +1 -0
  147. package/lib/index-D06ATMgg.js +2094 -0
  148. package/lib/index-D06ATMgg.js.map +1 -0
  149. package/lib/index-DJqnphbT.js +35 -0
  150. package/lib/index-DJqnphbT.js.map +1 -0
  151. package/lib/{index-DIkaYL-l.js → index-DNfiZTPV.js} +1956 -1676
  152. package/lib/index-DNfiZTPV.js.map +1 -0
  153. package/lib/{index-BoXX7LeD.js → index-Do_BBSIs.js} +597 -544
  154. package/lib/index-Do_BBSIs.js.map +1 -0
  155. package/lib/{index-B_9xr661.js → index-Dvh1BL_e.js} +3 -3
  156. package/lib/{index-B_9xr661.js.map → index-Dvh1BL_e.js.map} +1 -1
  157. package/lib/joinPath-B7kNnUX4.js +8 -0
  158. package/lib/joinPath-B7kNnUX4.js.map +1 -0
  159. package/lib/router-Oe6YmY6B.js +3024 -0
  160. package/lib/router-Oe6YmY6B.js.map +1 -0
  161. package/lib/state-CsuHT8ZO.js +183 -0
  162. package/lib/state-CsuHT8ZO.js.map +1 -0
  163. package/lib/urql-core-KJnLL26g.js +1455 -0
  164. package/lib/urql-core-KJnLL26g.js.map +1 -0
  165. package/lib/useExposedProps-Csw8oAlt.js +9 -0
  166. package/lib/useExposedProps-Csw8oAlt.js.map +1 -0
  167. package/lib/{utils-DtEHoAvg.js → utils-Chi3p5nE.js} +101 -104
  168. package/lib/utils-Chi3p5nE.js.map +1 -0
  169. package/lib/zudoku.auth-auth0.js +1 -1
  170. package/lib/zudoku.auth-clerk.js +2 -2
  171. package/lib/zudoku.auth-openid.js +363 -350
  172. package/lib/zudoku.auth-openid.js.map +1 -1
  173. package/lib/zudoku.components.js +1695 -1621
  174. package/lib/zudoku.components.js.map +1 -1
  175. package/lib/zudoku.openapi-worker.js +4671 -4383
  176. package/lib/zudoku.openapi-worker.js.map +1 -1
  177. package/lib/zudoku.plugin-api-keys.js +7 -7
  178. package/lib/zudoku.plugin-custom-pages.js +21 -0
  179. package/lib/zudoku.plugin-custom-pages.js.map +1 -0
  180. package/lib/zudoku.plugin-markdown.js +1 -1
  181. package/lib/zudoku.plugin-openapi.js +10 -9
  182. package/lib/zudoku.plugin-openapi.js.map +1 -1
  183. package/lib/zudoku.plugin-redirect.js +1 -1
  184. package/package.json +71 -69
  185. package/src/app/main.tsx +3 -3
  186. package/src/lib/authentication/state.ts +17 -0
  187. package/src/lib/components/Banner.tsx +12 -2
  188. package/src/lib/components/ErrorPage.tsx +0 -2
  189. package/src/lib/components/Header.tsx +4 -2
  190. package/src/lib/components/InlineCode.tsx +10 -0
  191. package/src/lib/components/Layout.tsx +2 -1
  192. package/src/lib/components/MobileTopNavigation.tsx +4 -0
  193. package/src/lib/components/Search.tsx +1 -1
  194. package/src/lib/components/SlotletProvider.tsx +27 -4
  195. package/src/lib/components/index.ts +1 -1
  196. package/src/lib/core/DevPortalContext.ts +1 -1
  197. package/src/lib/oas/graphql/index.ts +35 -23
  198. package/src/lib/oas/parser/index.ts +1 -0
  199. package/src/lib/plugins/custom-pages/CustomPage.tsx +18 -0
  200. package/src/lib/plugins/custom-pages/index.tsx +24 -0
  201. package/src/lib/plugins/markdown/MdxPage.tsx +2 -2
  202. package/src/lib/plugins/openapi/Endpoint.tsx +86 -22
  203. package/src/lib/plugins/openapi/OperationList.tsx +4 -2
  204. package/src/lib/plugins/openapi/PlaygroundDialogWrapper.tsx +3 -0
  205. package/src/lib/plugins/openapi/Route.tsx +1 -2
  206. package/src/lib/plugins/openapi/Sidecar.tsx +18 -3
  207. package/src/lib/plugins/openapi/SimpleSelect.tsx +10 -2
  208. package/src/lib/plugins/openapi/client/createMemoryClient.ts +1 -6
  209. package/src/lib/plugins/openapi/client/createWorkerClient.ts +1 -6
  210. package/src/lib/plugins/openapi/graphql/gql.ts +11 -3
  211. package/src/lib/plugins/openapi/graphql/graphql.ts +113 -1
  212. package/src/lib/plugins/openapi/index.tsx +3 -6
  213. package/src/lib/plugins/openapi/playground/Playground.tsx +39 -5
  214. package/src/lib/plugins/openapi/playground/ResponseTab.tsx +0 -1
  215. package/src/lib/plugins/openapi/playground/createUrl.ts +6 -1
  216. package/src/lib/ui/Callout.tsx +7 -6
  217. package/src/lib/ui/Drawer.tsx +38 -36
  218. package/src/lib/util/useExposedProps.tsx +10 -0
  219. package/dist/lib/plugins/custom-page/index.d.ts +0 -8
  220. package/dist/lib/plugins/custom-page/index.js +0 -12
  221. package/dist/lib/plugins/custom-page/index.js.map +0 -1
  222. package/dist/lib/plugins/openapi/playground/Editor.d.ts +0 -1
  223. package/dist/lib/plugins/openapi/playground/Editor.js +0 -5
  224. package/dist/lib/plugins/openapi/playground/Editor.js.map +0 -1
  225. package/dist/lib/plugins/openapi/util/urql.d.ts +0 -7
  226. package/dist/lib/plugins/openapi/util/urql.js +0 -8
  227. package/dist/lib/plugins/openapi/util/urql.js.map +0 -1
  228. package/dist/lib/util/slugify.d.ts +0 -2
  229. package/dist/lib/util/slugify.js +0 -3
  230. package/dist/lib/util/slugify.js.map +0 -1
  231. package/dist/vite/plugin-icons.d.ts +0 -3
  232. package/dist/vite/plugin-icons.js +0 -47
  233. package/dist/vite/plugin-icons.js.map +0 -1
  234. package/lib/ErrorPage-knunPbKI.js +0 -18
  235. package/lib/ErrorPage-knunPbKI.js.map +0 -1
  236. package/lib/Input-B1kkVL1R.js +0 -2198
  237. package/lib/Input-B1kkVL1R.js.map +0 -1
  238. package/lib/Markdown-B4aR03g6.js.map +0 -1
  239. package/lib/MdxPage-BcftTg5g.js.map +0 -1
  240. package/lib/OperationList-Da36LrGl.js.map +0 -1
  241. package/lib/Route-CWj1ECzh.js.map +0 -1
  242. package/lib/SidebarBadge-DdvT2qep.js +0 -498
  243. package/lib/SidebarBadge-DdvT2qep.js.map +0 -1
  244. package/lib/ZudokuContext-em1gHkIY.js +0 -1084
  245. package/lib/ZudokuContext-em1gHkIY.js.map +0 -1
  246. package/lib/_commonjsHelpers-BkfeUUK-.js +0 -29
  247. package/lib/_commonjsHelpers-BkfeUUK-.js.map +0 -1
  248. package/lib/assets/index-B9EWVYfo.js.map +0 -1
  249. package/lib/assets/worker-TYRbYl6N.js.map +0 -1
  250. package/lib/index-BG0g4WW0.js.map +0 -1
  251. package/lib/index-BoXX7LeD.js.map +0 -1
  252. package/lib/index-CLd8ycZz.js.map +0 -1
  253. package/lib/index-DIkaYL-l.js.map +0 -1
  254. package/lib/router-D2p7Olpn.js +0 -2971
  255. package/lib/router-D2p7Olpn.js.map +0 -1
  256. package/lib/slugify-DbLhpSPt.js +0 -28
  257. package/lib/slugify-DbLhpSPt.js.map +0 -1
  258. package/lib/state-BUM4jc0J.js +0 -288
  259. package/lib/state-BUM4jc0J.js.map +0 -1
  260. package/lib/urql-YhcsXYy8.js +0 -1591
  261. package/lib/urql-YhcsXYy8.js.map +0 -1
  262. package/lib/utils-DtEHoAvg.js.map +0 -1
  263. package/lib/zudoku.plugin-custom-page.js +0 -13
  264. package/lib/zudoku.plugin-custom-page.js.map +0 -1
  265. package/src/lib/plugins/custom-page/index.tsx +0 -22
  266. package/src/lib/plugins/openapi/playground/Editor.tsx +0 -4
  267. package/src/lib/plugins/openapi/util/urql.ts +0 -8
  268. package/src/lib/util/slugify.ts +0 -3
@@ -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";
@@ -16,6 +12,7 @@ import { ErrorPage } from "../../components/ErrorPage.js";
16
12
  import { ColorMap } from "../../components/navigation/SidebarBadge.js";
17
13
  import { SyntaxHighlight } from "../../components/SyntaxHighlight.js";
18
14
  import { Button } from "../../ui/Button.js";
15
+ import { joinPath } from "../../util/joinPath.js";
19
16
  import { OasPluginConfig } from "./interfaces.js";
20
17
  import type { PlaygroundContentProps } from "./playground/Playground.js";
21
18
  import { PlaygroundDialog } from "./playground/PlaygroundDialog.js";
@@ -72,7 +69,7 @@ export type OpenApiPluginOptions = OasPluginConfig & InternalOasPluginConfig;
72
69
  export const openApiPlugin = (
73
70
  config: OpenApiPluginOptions,
74
71
  ): DevPortalPlugin => {
75
- const basePath = "/reference";
72
+ const basePath = joinPath(config.navigationId ?? "/reference");
76
73
 
77
74
  const client = config.server
78
75
  ? new UrqlClient({
@@ -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, {
@@ -200,19 +205,48 @@ export const Playground = ({
200
205
  </Fragment>
201
206
  ));
202
207
 
208
+ const serverSelect = (
209
+ <div className="inline-block opacity-50 hover:opacity-100 transition">
210
+ {servers && servers.length > 1 ? (
211
+ <Select
212
+ onValueChange={(value) => {
213
+ startTransition(() => {
214
+ setSelectedServer(value);
215
+ });
216
+ }}
217
+ value={selectedServer}
218
+ >
219
+ <SelectTrigger className="p-0 border-none flex-row-reverse bg-transparent text-xs gap-0.5 h-auto">
220
+ <SelectValue />
221
+ </SelectTrigger>
222
+ <SelectContent>
223
+ {servers.map((s) => (
224
+ <SelectItem key={s} value={s}>
225
+ {s.replace(/^https?:\/\//, "")}
226
+ </SelectItem>
227
+ ))}
228
+ </SelectContent>
229
+ </Select>
230
+ ) : (
231
+ <span>{server.replace(/^https?:\/\//, "")}</span>
232
+ )}
233
+ </div>
234
+ );
235
+
203
236
  return (
204
237
  <FormProvider
205
238
  {...{ register, control, handleSubmit, watch, setValue, ...form }}
206
239
  >
207
240
  <form onSubmit={handleSubmit((data) => queryMutation.mutateAsync(data))}>
208
- <div className="grid grid-cols-2 text-sm h-full">
241
+ <div className="grid grid-cols-[8fr_7fr] text-sm h-full">
209
242
  <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
243
  <div className="flex gap-2 items-stretch">
211
244
  <div className="flex flex-1 items-center w-full border rounded-md">
212
245
  <div className="border-r p-2 bg-muted rounded-l-md self-stretch font-semibold font-mono">
213
246
  {method.toUpperCase()}
214
247
  </div>
215
- <div className="p-2 font-mono text-xs">
248
+ <div className="flex items-center flex-wrap p-2 font-mono text-xs">
249
+ {serverSelect}
216
250
  {path}
217
251
  {urlQueryParams.length > 0 ? "?" : ""}
218
252
  {urlQueryParams}
@@ -296,7 +330,7 @@ export const Playground = ({
296
330
  </TabsContent>
297
331
  </Tabs>
298
332
  </div>
299
- <div className="p-8 bg-muted/70">
333
+ <div className="min-w-0 p-8 bg-muted/70">
300
334
  {queryMutation.error ? (
301
335
  <div className="flex flex-col gap-2">
302
336
  {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}
@@ -8,7 +8,12 @@ export const createUrl = (host: string, path: string, data: PlaygroundForm) => {
8
8
  return value ?? match;
9
9
  });
10
10
 
11
- const url = new URL(filledPath, host);
11
+ // Ensure host ends with a slash and path doesn't start with one,
12
+ // so they form a correct URL, without overriding the host's path.
13
+ const url = new URL(
14
+ filledPath.replace(/^\//, ""),
15
+ host.endsWith("/") ? host : `${host}/`,
16
+ );
12
17
 
13
18
  data.queryParams
14
19
  .filter((param) => param.active)
@@ -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,2 +0,0 @@
1
- import slugify from "slugify";
2
- export default slugify;
@@ -1,3 +0,0 @@
1
- import slugify from "slugify";
2
- export default slugify;
3
- //# sourceMappingURL=slugify.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"slugify.js","sourceRoot":"","sources":["../../../src/lib/util/slugify.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,SAAS,CAAC;AAE9B,eAAe,OAAO,CAAC"}
@@ -1,3 +0,0 @@
1
- import type { Plugin } from "vite";
2
- export declare const replaceSidebarIcons: (code: string) => string;
3
- export declare const viteIconsPlugin: () => Plugin;
@@ -1,47 +0,0 @@
1
- import matter from "gray-matter";
2
- import { readFile } from "node:fs/promises";
3
- const matchIconAnnotation = /"icon":\s*"(.*?)"/g;
4
- const toPascalCase = (str) => str.replace(/(^\w|-\w)/g, (match) => match.replace("-", "").toUpperCase());
5
- export const replaceSidebarIcons = (code) => {
6
- const collectedIcons = new Set();
7
- let match;
8
- while ((match = matchIconAnnotation.exec(code)) !== null) {
9
- collectedIcons.add(match[1]);
10
- }
11
- const importStatement = `import { ${[...collectedIcons].map(toPascalCase).join(", ")} } from "zudoku/icons";`;
12
- const replacedString = code.replaceAll(matchIconAnnotation,
13
- // The element will be created by the implementers side
14
- (_, iconName) => `"icon": ${toPascalCase(iconName)}`);
15
- return `${importStatement}export const configuredSidebar = ${replacedString};`;
16
- };
17
- // This plugin is responsible to restart the dev server when a sidebar icon is changed inside a markdown file.
18
- export const viteIconsPlugin = () => {
19
- const iconMap = new Map();
20
- return {
21
- enforce: "pre",
22
- name: "zudoku-icons-plugin",
23
- configureServer: ({ watcher, restart }) => {
24
- watcher.on("change", async (filePath) => {
25
- if (/\.mdx?$/.test(filePath)) {
26
- const code = await readFile(filePath, "utf-8");
27
- const { sidebar_icon: sidebarIcon } = matter(code).data;
28
- const previousIcon = iconMap.get(filePath);
29
- if ((!previousIcon && sidebarIcon) ||
30
- (previousIcon && !sidebarIcon) ||
31
- previousIcon !== sidebarIcon) {
32
- await restart();
33
- }
34
- iconMap.set(filePath, sidebarIcon);
35
- }
36
- });
37
- },
38
- async load(id) {
39
- if (/\.mdx?$/.test(id)) {
40
- const code = await readFile(id, "utf-8");
41
- const { sidebar_icon: sidebarIcon } = matter(code).data;
42
- iconMap.set(id, sidebarIcon);
43
- }
44
- },
45
- };
46
- };
47
- //# sourceMappingURL=plugin-icons.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugin-icons.js","sourceRoot":"","sources":["../../src/vite/plugin-icons.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAG5C,MAAM,mBAAmB,GAAG,oBAAoB,CAAC;AAEjD,MAAM,YAAY,GAAG,CAAC,GAAW,EAAE,EAAE,CACnC,GAAG,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;AAE7E,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,IAAY,EAAE,EAAE;IAClD,MAAM,cAAc,GAAG,IAAI,GAAG,EAAU,CAAC;IAEzC,IAAI,KAAK,CAAC;IACV,OAAO,CAAC,KAAK,GAAG,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC;QACzD,cAAc,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IAC/B,CAAC;IAED,MAAM,eAAe,GAAG,YAAY,CAAC,GAAG,cAAc,CAAC,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,yBAAyB,CAAC;IAC9G,MAAM,cAAc,GAAG,IAAI,CAAC,UAAU,CACpC,mBAAmB;IACnB,uDAAuD;IACvD,CAAC,CAAC,EAAE,QAAQ,EAAE,EAAE,CAAC,WAAW,YAAY,CAAC,QAAQ,CAAC,EAAE,CACrD,CAAC;IAEF,OAAO,GAAG,eAAe,oCAAoC,cAAc,GAAG,CAAC;AACjF,CAAC,CAAC;AAEF,8GAA8G;AAC9G,MAAM,CAAC,MAAM,eAAe,GAAG,GAAW,EAAE;IAC1C,MAAM,OAAO,GAAG,IAAI,GAAG,EAAyB,CAAC;IAEjD,OAAO;QACL,OAAO,EAAE,KAAK;QACd,IAAI,EAAE,qBAAqB;QAC3B,eAAe,EAAE,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE;YACxC,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE;gBACtC,IAAI,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;oBAC7B,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;oBAC/C,MAAM,EAAE,YAAY,EAAE,WAAW,EAAE,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC;oBACxD,MAAM,YAAY,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;oBAE3C,IACE,CAAC,CAAC,YAAY,IAAI,WAAW,CAAC;wBAC9B,CAAC,YAAY,IAAI,CAAC,WAAW,CAAC;wBAC9B,YAAY,KAAK,WAAW,EAC5B,CAAC;wBACD,MAAM,OAAO,EAAE,CAAC;oBAClB,CAAC;oBAED,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;gBACrC,CAAC;YACH,CAAC,CAAC,CAAC;QACL,CAAC;QACD,KAAK,CAAC,IAAI,CAAC,EAAE;YACX,IAAI,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC;gBACvB,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;gBACzC,MAAM,EAAE,YAAY,EAAE,WAAW,EAAE,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC;gBACxD,OAAO,CAAC,GAAG,CAAC,EAAE,EAAE,WAAW,CAAC,CAAC;YAC/B,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC,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-XnFqN2lJ.js";
4
- import { P as i, H as t } from "./Markdown-B4aR03g6.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-knunPbKI.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ErrorPage-knunPbKI.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;"}