zudoku 0.26.0 → 0.27.0

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 (300) hide show
  1. package/dist/app/main.d.ts +1 -1
  2. package/dist/app/main.js +19 -7
  3. package/dist/app/main.js.map +1 -1
  4. package/dist/config/config.d.ts +1 -0
  5. package/dist/config/validators/InputSidebarSchema.d.ts +2 -2
  6. package/dist/config/validators/common.d.ts +78 -0
  7. package/dist/config/validators/common.js +6 -0
  8. package/dist/config/validators/common.js.map +1 -1
  9. package/dist/config/validators/validate.d.ts +34 -0
  10. package/dist/lib/authentication/providers/auth0.js +1 -1
  11. package/dist/lib/authentication/providers/auth0.js.map +1 -1
  12. package/dist/lib/authentication/providers/openid.d.ts +1 -1
  13. package/dist/lib/authentication/providers/openid.js +10 -6
  14. package/dist/lib/authentication/providers/openid.js.map +1 -1
  15. package/dist/lib/components/AnchorLink.js +5 -2
  16. package/dist/lib/components/AnchorLink.js.map +1 -1
  17. package/dist/lib/components/Autocomplete.d.ts +12 -0
  18. package/dist/lib/components/Autocomplete.js +47 -0
  19. package/dist/lib/components/Autocomplete.js.map +1 -0
  20. package/dist/lib/components/Header.js +4 -4
  21. package/dist/lib/components/Header.js.map +1 -1
  22. package/dist/lib/components/Heading.d.ts +1 -1
  23. package/dist/lib/components/Markdown.d.ts +2 -2
  24. package/dist/lib/components/Markdown.js +3 -1
  25. package/dist/lib/components/Markdown.js.map +1 -1
  26. package/dist/lib/components/StatusPage.d.ts +7 -0
  27. package/dist/lib/components/StatusPage.js +71 -0
  28. package/dist/lib/components/StatusPage.js.map +1 -0
  29. package/dist/lib/components/SyntaxHighlight.d.ts +2 -1
  30. package/dist/lib/components/SyntaxHighlight.js +2 -2
  31. package/dist/lib/components/SyntaxHighlight.js.map +1 -1
  32. package/dist/lib/components/ThemeSwitch.js +4 -4
  33. package/dist/lib/components/ThemeSwitch.js.map +1 -1
  34. package/dist/lib/components/cache.d.ts +6 -0
  35. package/dist/lib/components/cache.js +13 -0
  36. package/dist/lib/components/cache.js.map +1 -0
  37. package/dist/lib/components/context/ViewportAnchorContext.js +16 -4
  38. package/dist/lib/components/context/ViewportAnchorContext.js.map +1 -1
  39. package/dist/lib/components/context/ZudokuContext.js +2 -1
  40. package/dist/lib/components/context/ZudokuContext.js.map +1 -1
  41. package/dist/lib/components/index.d.ts +9 -2
  42. package/dist/lib/components/index.js +5 -2
  43. package/dist/lib/components/index.js.map +1 -1
  44. package/dist/lib/core/RouteGuard.d.ts +1 -0
  45. package/dist/lib/core/RouteGuard.js +28 -0
  46. package/dist/lib/core/RouteGuard.js.map +1 -0
  47. package/dist/lib/core/ZudokuContext.d.ts +4 -2
  48. package/dist/lib/core/ZudokuContext.js +9 -7
  49. package/dist/lib/core/ZudokuContext.js.map +1 -1
  50. package/dist/lib/oas/graphql/circular.d.ts +3 -0
  51. package/dist/lib/oas/graphql/circular.js +27 -0
  52. package/dist/lib/oas/graphql/circular.js.map +1 -0
  53. package/dist/lib/oas/graphql/index.js +5 -6
  54. package/dist/lib/oas/graphql/index.js.map +1 -1
  55. package/dist/lib/oas/parser/dereference/index.d.ts +0 -1
  56. package/dist/lib/oas/parser/dereference/index.js +1 -1
  57. package/dist/lib/oas/parser/dereference/index.js.map +1 -1
  58. package/dist/lib/plugins/markdown/MdxPage.js +8 -2
  59. package/dist/lib/plugins/markdown/MdxPage.js.map +1 -1
  60. package/dist/lib/plugins/openapi/OperationListItem.js +1 -1
  61. package/dist/lib/plugins/openapi/OperationListItem.js.map +1 -1
  62. package/dist/lib/plugins/openapi/ParameterListItem.js +1 -1
  63. package/dist/lib/plugins/openapi/ParameterListItem.js.map +1 -1
  64. package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.d.ts +3 -1
  65. package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.js +3 -2
  66. package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.js.map +1 -1
  67. package/dist/lib/plugins/openapi/Sidecar.js +3 -3
  68. package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
  69. package/dist/lib/plugins/openapi/index.js +4 -11
  70. package/dist/lib/plugins/openapi/index.js.map +1 -1
  71. package/dist/lib/plugins/openapi/interfaces.d.ts +7 -2
  72. package/dist/lib/plugins/openapi/playground/ExamplesDropdown.d.ts +6 -0
  73. package/dist/lib/plugins/openapi/playground/ExamplesDropdown.js +12 -0
  74. package/dist/lib/plugins/openapi/playground/ExamplesDropdown.js.map +1 -0
  75. package/dist/lib/plugins/openapi/playground/Headers.js +67 -4
  76. package/dist/lib/plugins/openapi/playground/Headers.js.map +1 -1
  77. package/dist/lib/plugins/openapi/playground/ParamsGrid.d.ts +5 -0
  78. package/dist/lib/plugins/openapi/playground/ParamsGrid.js +4 -0
  79. package/dist/lib/plugins/openapi/playground/ParamsGrid.js.map +1 -0
  80. package/dist/lib/plugins/openapi/playground/PathParams.js +4 -12
  81. package/dist/lib/plugins/openapi/playground/PathParams.js.map +1 -1
  82. package/dist/lib/plugins/openapi/playground/Playground.d.ts +18 -1
  83. package/dist/lib/plugins/openapi/playground/Playground.js +53 -40
  84. package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
  85. package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js +1 -1
  86. package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js.map +1 -1
  87. package/dist/lib/plugins/openapi/playground/QueryParams.js +21 -30
  88. package/dist/lib/plugins/openapi/playground/QueryParams.js.map +1 -1
  89. package/dist/lib/plugins/openapi/playground/SubmitButton.d.ts +7 -0
  90. package/dist/lib/plugins/openapi/playground/SubmitButton.js +22 -0
  91. package/dist/lib/plugins/openapi/playground/SubmitButton.js.map +1 -0
  92. package/dist/lib/plugins/openapi/playground/result-panel/RequestTab.d.ts +7 -0
  93. package/dist/lib/plugins/openapi/playground/result-panel/RequestTab.js +11 -0
  94. package/dist/lib/plugins/openapi/playground/result-panel/RequestTab.js.map +1 -0
  95. package/dist/lib/plugins/openapi/playground/result-panel/ResponseTab.d.ts +8 -0
  96. package/dist/lib/plugins/openapi/playground/result-panel/ResponseTab.js +95 -0
  97. package/dist/lib/plugins/openapi/playground/result-panel/ResponseTab.js.map +1 -0
  98. package/dist/lib/plugins/openapi/playground/result-panel/ResultPanel.d.ts +7 -0
  99. package/dist/lib/plugins/openapi/playground/result-panel/ResultPanel.js +16 -0
  100. package/dist/lib/plugins/openapi/playground/result-panel/ResultPanel.js.map +1 -0
  101. package/dist/lib/plugins/openapi/playground/result-panel/convertToTypes.d.ts +10 -0
  102. package/dist/lib/plugins/openapi/playground/result-panel/convertToTypes.js +32 -0
  103. package/dist/lib/plugins/openapi/playground/result-panel/convertToTypes.js.map +1 -0
  104. package/dist/lib/plugins/openapi/playground/result-panel/convertToTypes.test.d.ts +1 -0
  105. package/dist/lib/plugins/openapi/playground/result-panel/convertToTypes.test.js +56 -0
  106. package/dist/lib/plugins/openapi/playground/result-panel/convertToTypes.test.js.map +1 -0
  107. package/dist/lib/plugins/openapi/post-processors/removeExtensions.d.ts +2 -1
  108. package/dist/lib/plugins/openapi/post-processors/removeExtensions.js +5 -3
  109. package/dist/lib/plugins/openapi/post-processors/removeExtensions.js.map +1 -1
  110. package/dist/lib/plugins/openapi/post-processors/removeExtensions.test.js +49 -0
  111. package/dist/lib/plugins/openapi/post-processors/removeExtensions.test.js.map +1 -1
  112. package/dist/lib/plugins/openapi/post-processors/removeParameters.d.ts +10 -0
  113. package/dist/lib/plugins/openapi/post-processors/removeParameters.js +66 -0
  114. package/dist/lib/plugins/openapi/post-processors/removeParameters.js.map +1 -0
  115. package/dist/lib/plugins/openapi/post-processors/removeParameters.test.d.ts +1 -0
  116. package/dist/lib/plugins/openapi/post-processors/removeParameters.test.js +131 -0
  117. package/dist/lib/plugins/openapi/post-processors/removeParameters.test.js.map +1 -0
  118. package/dist/lib/plugins/openapi/schema/SchemaComponents.js +1 -1
  119. package/dist/lib/plugins/openapi/schema/SchemaComponents.js.map +1 -1
  120. package/dist/lib/ui/Command.d.ts +9 -1
  121. package/dist/lib/ui/Command.js +5 -1
  122. package/dist/lib/ui/Command.js.map +1 -1
  123. package/dist/lib/ui/Select.js +2 -2
  124. package/dist/lib/ui/Select.js.map +1 -1
  125. package/dist/lib/util/MdxComponents.js +2 -2
  126. package/dist/lib/util/MdxComponents.js.map +1 -1
  127. package/dist/lib/util/joinUrl.d.ts +1 -0
  128. package/dist/lib/util/joinUrl.js +40 -0
  129. package/dist/lib/util/joinUrl.js.map +1 -0
  130. package/dist/lib/util/useScrollToAnchor.d.ts +1 -0
  131. package/dist/lib/util/useScrollToAnchor.js +26 -15
  132. package/dist/lib/util/useScrollToAnchor.js.map +1 -1
  133. package/dist/vite/build.js +10 -10
  134. package/dist/vite/build.js.map +1 -1
  135. package/dist/vite/config.js +4 -1
  136. package/dist/vite/config.js.map +1 -1
  137. package/dist/vite/dev-server.js +4 -1
  138. package/dist/vite/dev-server.js.map +1 -1
  139. package/dist/vite/plugin-api.d.ts +1 -1
  140. package/dist/vite/plugin-api.js +31 -7
  141. package/dist/vite/plugin-api.js.map +1 -1
  142. package/dist/vite/plugin-auth.js +4 -1
  143. package/dist/vite/plugin-auth.js.map +1 -1
  144. package/dist/vite/plugin-mdx.js +9 -4
  145. package/dist/vite/plugin-mdx.js.map +1 -1
  146. package/dist/vite/prerender.d.ts +2 -2
  147. package/dist/vite/prerender.js +5 -4
  148. package/dist/vite/prerender.js.map +1 -1
  149. package/dist/zuplo/enrich-with-zuplo.d.ts +5 -0
  150. package/dist/zuplo/enrich-with-zuplo.js +184 -0
  151. package/dist/zuplo/enrich-with-zuplo.js.map +1 -0
  152. package/dist/zuplo/env.d.ts +1 -0
  153. package/dist/zuplo/env.js +3 -0
  154. package/dist/zuplo/env.js.map +1 -1
  155. package/dist/zuplo/policy-types.d.ts +33 -0
  156. package/dist/zuplo/policy-types.js +8 -0
  157. package/dist/zuplo/policy-types.js.map +1 -0
  158. package/dist/zuplo/with-zuplo-processors.d.ts +3 -0
  159. package/dist/zuplo/with-zuplo-processors.js +26 -0
  160. package/dist/zuplo/with-zuplo-processors.js.map +1 -0
  161. package/dist/zuplo/with-zuplo.d.ts +1 -1
  162. package/dist/zuplo/with-zuplo.js +7 -26
  163. package/dist/zuplo/with-zuplo.js.map +1 -1
  164. package/lib/{AuthenticationPlugin-DNXBcsVN.js → AuthenticationPlugin-CO_YCd2x.js} +3 -3
  165. package/lib/{AuthenticationPlugin-DNXBcsVN.js.map → AuthenticationPlugin-CO_YCd2x.js.map} +1 -1
  166. package/lib/{Markdown-BrfrjEk_.js → Markdown-B8o9Qz4q.js} +1197 -1186
  167. package/lib/{Markdown-BrfrjEk_.js.map → Markdown-B8o9Qz4q.js.map} +1 -1
  168. package/lib/{MdxPage-LNZLj_A5.js → MdxPage-BxRt3Ly7.js} +63 -58
  169. package/lib/MdxPage-BxRt3Ly7.js.map +1 -0
  170. package/lib/OperationList-DH-zIgtq.js +5160 -0
  171. package/lib/OperationList-DH-zIgtq.js.map +1 -0
  172. package/lib/{Route-Pzk6qwIk.js → Route-DJ0ZlVq1.js} +3 -3
  173. package/lib/{Route-Pzk6qwIk.js.map → Route-DJ0ZlVq1.js.map} +1 -1
  174. package/lib/{Select-DkOpAG0c.js → Select-B7UXR0SB.js} +61 -61
  175. package/lib/Select-B7UXR0SB.js.map +1 -0
  176. package/lib/{SlotletProvider-DPbx9KdU.js → SlotletProvider-CtIp8rP3.js} +4 -4
  177. package/lib/{SlotletProvider-DPbx9KdU.js.map → SlotletProvider-CtIp8rP3.js.map} +1 -1
  178. package/lib/{Button-oroWHXAy.js → Spinner-BlzrEEk1.js} +15 -12
  179. package/lib/Spinner-BlzrEEk1.js.map +1 -0
  180. package/lib/{SyntaxHighlight-CJCSPG1F.js → SyntaxHighlight-C1w1QPdY.js} +300 -295
  181. package/lib/{SyntaxHighlight-CJCSPG1F.js.map → SyntaxHighlight-C1w1QPdY.js.map} +1 -1
  182. package/lib/{ZudokuContext-D3ayHjP-.js → ZudokuContext-8jts0fF3.js} +259 -248
  183. package/lib/ZudokuContext-8jts0fF3.js.map +1 -0
  184. package/lib/{chunk-SYFQ2XB5-KWlHsT7t.js → chunk-SYFQ2XB5-BPvC-soB.js} +6 -5
  185. package/lib/{chunk-SYFQ2XB5-KWlHsT7t.js.map → chunk-SYFQ2XB5-BPvC-soB.js.map} +1 -1
  186. package/lib/circular-Dgpd6AN-.js +15397 -0
  187. package/lib/circular-Dgpd6AN-.js.map +1 -0
  188. package/lib/{createServer-BcaswoFO.js → createServer-BV0tHzLK.js} +3450 -5577
  189. package/lib/createServer-BV0tHzLK.js.map +1 -0
  190. package/lib/{hook-DUyACbIK.js → hook-BG02esyv.js} +2 -2
  191. package/lib/{hook-DUyACbIK.js.map → hook-BG02esyv.js.map} +1 -1
  192. package/lib/index-B7mqiOei.js +509 -0
  193. package/lib/index-B7mqiOei.js.map +1 -0
  194. package/lib/index-DmqsUPcm.js +1915 -0
  195. package/lib/index-DmqsUPcm.js.map +1 -0
  196. package/lib/joinUrl-BTy9bvoK.js +20 -0
  197. package/lib/joinUrl-BTy9bvoK.js.map +1 -0
  198. package/lib/post-processors/removeExtensions.js +7 -7
  199. package/lib/post-processors/removeExtensions.js.map +1 -1
  200. package/lib/post-processors/removeParameters.js +48 -0
  201. package/lib/post-processors/removeParameters.js.map +1 -0
  202. package/lib/ui/ActionButton.js +10 -11
  203. package/lib/ui/ActionButton.js.map +1 -1
  204. package/lib/ui/Command.js +125 -13
  205. package/lib/ui/Command.js.map +1 -1
  206. package/lib/ui/Select.js +2 -2
  207. package/lib/ui/Select.js.map +1 -1
  208. package/lib/{useExposedProps-BBHR7aLM.js → useExposedProps-BLKFBylA.js} +2 -2
  209. package/lib/{useExposedProps-BBHR7aLM.js.map → useExposedProps-BLKFBylA.js.map} +1 -1
  210. package/lib/useScrollToAnchor-Bl6mz9_x.js +288 -0
  211. package/lib/useScrollToAnchor-Bl6mz9_x.js.map +1 -0
  212. package/lib/zudoku.auth-auth0.js +7 -9
  213. package/lib/zudoku.auth-auth0.js.map +1 -1
  214. package/lib/zudoku.auth-clerk.js +1 -1
  215. package/lib/zudoku.auth-openid.js +223 -219
  216. package/lib/zudoku.auth-openid.js.map +1 -1
  217. package/lib/zudoku.components.js +754 -992
  218. package/lib/zudoku.components.js.map +1 -1
  219. package/lib/zudoku.plugin-api-catalog.js +3 -3
  220. package/lib/zudoku.plugin-api-keys.js +5 -5
  221. package/lib/zudoku.plugin-custom-pages.js +2 -2
  222. package/lib/zudoku.plugin-markdown.js +1 -1
  223. package/lib/zudoku.plugin-openapi.js +4 -4
  224. package/lib/zudoku.plugin-redirect.js +1 -1
  225. package/package.json +2 -2
  226. package/src/app/main.css +50 -50
  227. package/src/app/main.tsx +26 -7
  228. package/src/lib/authentication/providers/auth0.tsx +1 -4
  229. package/src/lib/authentication/providers/openid.tsx +12 -5
  230. package/src/lib/components/AnchorLink.tsx +5 -2
  231. package/src/lib/components/Autocomplete.tsx +111 -0
  232. package/src/lib/components/Header.tsx +4 -4
  233. package/src/lib/components/Markdown.tsx +14 -15
  234. package/src/lib/components/StatusPage.tsx +91 -0
  235. package/src/lib/components/SyntaxHighlight.tsx +14 -0
  236. package/src/lib/components/ThemeSwitch.tsx +14 -15
  237. package/src/lib/components/cache.ts +15 -0
  238. package/src/lib/components/context/ViewportAnchorContext.tsx +20 -6
  239. package/src/lib/components/context/ZudokuContext.ts +3 -1
  240. package/src/lib/components/index.ts +9 -2
  241. package/src/lib/core/RouteGuard.tsx +35 -0
  242. package/src/lib/core/ZudokuContext.ts +9 -8
  243. package/src/lib/oas/graphql/circular.ts +29 -0
  244. package/src/lib/oas/graphql/index.ts +9 -9
  245. package/src/lib/oas/parser/dereference/index.ts +1 -2
  246. package/src/lib/plugins/markdown/MdxPage.tsx +9 -1
  247. package/src/lib/plugins/openapi/OperationListItem.tsx +0 -2
  248. package/src/lib/plugins/openapi/ParameterListItem.tsx +1 -0
  249. package/src/lib/plugins/openapi/PlaygroundDialogWrapper.tsx +5 -0
  250. package/src/lib/plugins/openapi/Sidecar.tsx +4 -2
  251. package/src/lib/plugins/openapi/index.tsx +9 -15
  252. package/src/lib/plugins/openapi/interfaces.ts +10 -2
  253. package/src/lib/plugins/openapi/playground/ExamplesDropdown.tsx +54 -0
  254. package/src/lib/plugins/openapi/playground/Headers.tsx +136 -39
  255. package/src/lib/plugins/openapi/playground/ParamsGrid.tsx +8 -0
  256. package/src/lib/plugins/openapi/playground/PathParams.tsx +34 -74
  257. package/src/lib/plugins/openapi/playground/Playground.tsx +219 -177
  258. package/src/lib/plugins/openapi/playground/PlaygroundDialog.tsx +1 -1
  259. package/src/lib/plugins/openapi/playground/QueryParams.tsx +90 -122
  260. package/src/lib/plugins/openapi/playground/SubmitButton.tsx +75 -0
  261. package/src/lib/plugins/openapi/playground/result-panel/RequestTab.tsx +73 -0
  262. package/src/lib/plugins/openapi/playground/result-panel/ResponseTab.tsx +210 -0
  263. package/src/lib/plugins/openapi/playground/result-panel/ResultPanel.tsx +101 -0
  264. package/src/lib/plugins/openapi/playground/result-panel/convertToTypes.test.ts +64 -0
  265. package/src/lib/plugins/openapi/playground/result-panel/convertToTypes.ts +36 -0
  266. package/src/lib/plugins/openapi/post-processors/removeExtensions.test.ts +58 -0
  267. package/src/lib/plugins/openapi/post-processors/removeExtensions.ts +7 -4
  268. package/src/lib/plugins/openapi/post-processors/removeParameters.test.ts +148 -0
  269. package/src/lib/plugins/openapi/post-processors/removeParameters.ts +101 -0
  270. package/src/lib/plugins/openapi/schema/SchemaComponents.tsx +1 -1
  271. package/src/lib/ui/Command.tsx +20 -0
  272. package/src/lib/ui/Select.tsx +1 -1
  273. package/src/lib/util/MdxComponents.tsx +2 -1
  274. package/src/lib/util/joinUrl.ts +57 -0
  275. package/src/lib/util/useScrollToAnchor.ts +32 -15
  276. package/dist/lib/plugins/openapi/playground/EnumSelector.d.ts +0 -8
  277. package/dist/lib/plugins/openapi/playground/EnumSelector.js +0 -21
  278. package/dist/lib/plugins/openapi/playground/EnumSelector.js.map +0 -1
  279. package/dist/lib/plugins/openapi/playground/ResponseTab.d.ts +0 -4
  280. package/dist/lib/plugins/openapi/playground/ResponseTab.js +0 -42
  281. package/dist/lib/plugins/openapi/playground/ResponseTab.js.map +0 -1
  282. package/lib/AnchorLink-_Vu02ceN.js +0 -34
  283. package/lib/AnchorLink-_Vu02ceN.js.map +0 -1
  284. package/lib/Button-oroWHXAy.js.map +0 -1
  285. package/lib/Command-D5DE0DD7.js +0 -611
  286. package/lib/Command-D5DE0DD7.js.map +0 -1
  287. package/lib/MdxPage-LNZLj_A5.js.map +0 -1
  288. package/lib/OperationList-PCwzTp1r.js +0 -5144
  289. package/lib/OperationList-PCwzTp1r.js.map +0 -1
  290. package/lib/Select-DkOpAG0c.js.map +0 -1
  291. package/lib/Spinner-C5gHXrVz.js +0 -7
  292. package/lib/Spinner-C5gHXrVz.js.map +0 -1
  293. package/lib/ZudokuContext-D3ayHjP-.js.map +0 -1
  294. package/lib/createServer-BcaswoFO.js.map +0 -1
  295. package/lib/index-CaILD1AV.js +0 -1292
  296. package/lib/index-CaILD1AV.js.map +0 -1
  297. package/lib/index-TaRXY2w1.js +0 -43
  298. package/lib/index-TaRXY2w1.js.map +0 -1
  299. package/src/lib/plugins/openapi/playground/EnumSelector.tsx +0 -86
  300. package/src/lib/plugins/openapi/playground/ResponseTab.tsx +0 -76
@@ -1,10 +1,10 @@
1
1
  import { j as e } from "./jsx-runtime-Bdg6XQ1m.js";
2
2
  import { s as j } from "./index-LNp6rxyU.js";
3
- import { u as b } from "./ZudokuContext-D3ayHjP-.js";
4
- import { b as y } from "./chunk-SYFQ2XB5-KWlHsT7t.js";
3
+ import { u as b } from "./ZudokuContext-8jts0fF3.js";
4
+ import { b as y } from "./chunk-SYFQ2XB5-BPvC-soB.js";
5
5
  import { Head as v, Link as N } from "./zudoku.components.js";
6
6
  import { u as w } from "./state-mM7uaXTW.js";
7
- import { M as C } from "./Markdown-BrfrjEk_.js";
7
+ import { M as C } from "./Markdown-B8o9Qz4q.js";
8
8
  import { c as h } from "./cn-qaFjX9_3.js";
9
9
  const f = (r, n) => j(`${r}-${n}`), k = ({
10
10
  items: r,
@@ -1,14 +1,14 @@
1
1
  import { j as e } from "./jsx-runtime-Bdg6XQ1m.js";
2
2
  import { RotateCwIcon as g, TrashIcon as f, EyeOffIcon as j, EyeIcon as v, CheckIcon as w, CopyIcon as b, FileKey2Icon as K } from "lucide-react";
3
- import { D as k, S as m, R as N } from "./SlotletProvider-DPbx9KdU.js";
3
+ import { D as k, S as m, R as N } from "./SlotletProvider-CtIp8rP3.js";
4
4
  import { i as c } from "./invariant-Caa8-XvF.js";
5
- import { u as d, S as I, a as S, b as A, c as C, d as E, e as x } from "./Select-DkOpAG0c.js";
5
+ import { u as d, S as I, a as S, b as A, c as C, d as E, e as x } from "./Select-B7UXR0SB.js";
6
6
  import { a as P } from "./index.esm-CrSoEshU.js";
7
- import { a as D, L as u, O as R } from "./chunk-SYFQ2XB5-KWlHsT7t.js";
8
- import { a as y, e as q, u as O } from "./ZudokuContext-D3ayHjP-.js";
7
+ import { a as D, L as u, O as R } from "./chunk-SYFQ2XB5-BPvC-soB.js";
8
+ import { a as y, e as q, u as O } from "./ZudokuContext-8jts0fF3.js";
9
9
  import { Button as l } from "./ui/Button.js";
10
10
  import { Input as z } from "./ui/Input.js";
11
- import { u as F } from "./hook-DUyACbIK.js";
11
+ import { u as F } from "./hook-BG02esyv.js";
12
12
  import { useState as p } from "react";
13
13
  import { c as T } from "./cn-qaFjX9_3.js";
14
14
  const L = ({ service: t }) => {
@@ -1,8 +1,8 @@
1
1
  import { j as o } from "./jsx-runtime-Bdg6XQ1m.js";
2
2
  import a from "react";
3
- import { P as n } from "./Markdown-BrfrjEk_.js";
3
+ import { P as n } from "./Markdown-B8o9Qz4q.js";
4
4
  import { c } from "./cn-qaFjX9_3.js";
5
- import { u as p } from "./useExposedProps-BBHR7aLM.js";
5
+ import { u as p } from "./useExposedProps-BLKFBylA.js";
6
6
  const u = ({
7
7
  element: t,
8
8
  render: s,
@@ -74,7 +74,7 @@ const C = (n) => ({
74
74
  const h = {
75
75
  path: r,
76
76
  lazy: async () => {
77
- const { MdxPage: l } = await import("./MdxPage-LNZLj_A5.js"), { default: p, ...g } = await a();
77
+ const { MdxPage: l } = await import("./MdxPage-BxRt3Ly7.js"), { default: p, ...g } = await a();
78
78
  return {
79
79
  element: /* @__PURE__ */ P.jsx(
80
80
  l,
@@ -1,10 +1,10 @@
1
1
  import "./jsx-runtime-Bdg6XQ1m.js";
2
- import "./chunk-SYFQ2XB5-KWlHsT7t.js";
3
- import { o as a } from "./index-CaILD1AV.js";
4
- import "./ZudokuContext-D3ayHjP-.js";
2
+ import "./chunk-SYFQ2XB5-BPvC-soB.js";
3
+ import { o as a } from "./index-DmqsUPcm.js";
5
4
  import "lucide-react";
6
- import "./hook-DUyACbIK.js";
5
+ import "./hook-BG02esyv.js";
7
6
  import "./ui/Button.js";
7
+ import "./ZudokuContext-8jts0fF3.js";
8
8
  export {
9
9
  a as openApiPlugin
10
10
  };
@@ -1,4 +1,4 @@
1
- import { r as o } from "./chunk-SYFQ2XB5-KWlHsT7t.js";
1
+ import { r as o } from "./chunk-SYFQ2XB5-BPvC-soB.js";
2
2
  const a = (r) => ({
3
3
  getRoutes: () => r.redirects.map(({ from: e, to: t }) => ({
4
4
  path: e,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zudoku",
3
- "version": "0.26.0",
3
+ "version": "0.27.0",
4
4
  "type": "module",
5
5
  "homepage": "https://zudoku.dev",
6
6
  "repository": {
@@ -131,7 +131,7 @@
131
131
  "@radix-ui/react-progress": "1.1.1",
132
132
  "@radix-ui/react-radio-group": "1.2.2",
133
133
  "@radix-ui/react-scroll-area": "1.2.2",
134
- "@radix-ui/react-select": "2.1.4",
134
+ "@radix-ui/react-select": "2.1.5",
135
135
  "@radix-ui/react-slider": "1.2.2",
136
136
  "@radix-ui/react-slot": "1.1.1",
137
137
  "@radix-ui/react-switch": "1.1.2",
package/src/app/main.css CHANGED
@@ -238,57 +238,57 @@
238
238
  }
239
239
 
240
240
  /* Theme */
241
-
242
- @layer base {
243
- :root {
244
- --background: 0 0% 100%;
245
- --foreground: 240 10% 3.9%;
246
- --card: 0 0% 100%;
247
- --card-foreground: 240 10% 3.9%;
248
- --popover: 0 0% 100%;
249
- --popover-foreground: 240 10% 3.9%;
250
- --primary: 240 5.9% 10%;
251
- --primary-foreground: 0 0% 98%;
252
- --secondary: 240 4.8% 95.9%;
253
- --secondary-foreground: 240 5.9% 10%;
254
- --muted: 240 4.8% 95.9%;
255
- --muted-foreground: 240 3.8% 46.1%;
256
- --accent: 240 4.8% 95.9%;
257
- --accent-foreground: 240 5.9% 10%;
258
- --destructive: 0 84.2% 60.2%;
259
- --destructive-foreground: 0 0% 98%;
260
- --border: 240 5.9% 95%;
261
- --input: 240 5.9% 90%;
262
- --ring: 240 5.9% 10%;
263
- --radius: 0.75rem;
264
- --chart-1: 12 76% 61%;
265
- --chart-2: 173 58% 39%;
266
- --chart-3: 197 37% 24%;
267
- --chart-4: 43 74% 66%;
268
- --chart-5: 27 87% 67%;
269
- }
270
241
 
271
- .dark {
272
- --background: 240 10% 3.9%;
273
- --foreground: 0 0% 98%;
274
- --card: 240 10% 3.9%;
275
- --card-foreground: 0 0% 98%;
276
- --popover: 240 10% 3.9%;
277
- --popover-foreground: 0 0% 98%;
278
- --primary: 0 0% 98%;
279
- --primary-foreground: 240 5.9% 10%;
280
- --secondary: 240 3.7% 15.9%;
281
- --secondary-foreground: 0 0% 98%;
282
- --muted: 240 3.7% 15.9%;
283
- --muted-foreground: 240 5% 64.9%;
284
- --accent: 240 3.7% 15.9%;
285
- --accent-foreground: 0 0% 98%;
286
- --destructive: 0 62.8% 30.6%;
287
- --destructive-foreground: 0 0% 98%;
288
- --border: 240 3.7% 15.9%;
289
- --input: 240 3.7% 15.9%;
290
- --ring: 240 4.9% 83.9%;
291
- --chart-1: 220 70% 50%;
242
+ @layer base {
243
+ :root {
244
+ --background: 0 0% 100%;
245
+ --foreground: 240 10% 3.9%;
246
+ --card: 0 0% 100%;
247
+ --card-foreground: 240 10% 3.9%;
248
+ --popover: 0 0% 100%;
249
+ --popover-foreground: 240 10% 3.9%;
250
+ --primary: 240 5.9% 10%;
251
+ --primary-foreground: 0 0% 98%;
252
+ --secondary: 240 4.8% 95.9%;
253
+ --secondary-foreground: 240 5.9% 10%;
254
+ --muted: 240 4.8% 95.9%;
255
+ --muted-foreground: 240 3.8% 46.1%;
256
+ --accent: 240 4.8% 95.9%;
257
+ --accent-foreground: 240 5.9% 10%;
258
+ --destructive: 0 84.2% 60.2%;
259
+ --destructive-foreground: 0 0% 98%;
260
+ --border: 240 5.9% 95%;
261
+ --input: 240 5.9% 90%;
262
+ --ring: 240 5.9% 10%;
263
+ --radius: 0.75rem;
264
+ --chart-1: 12 76% 61%;
265
+ --chart-2: 173 58% 39%;
266
+ --chart-3: 197 37% 24%;
267
+ --chart-4: 43 74% 66%;
268
+ --chart-5: 27 87% 67%;
269
+ }
270
+
271
+ .dark {
272
+ --background: 240 10% 3.9%;
273
+ --foreground: 0 0% 98%;
274
+ --card: 240 10% 3.9%;
275
+ --card-foreground: 0 0% 98%;
276
+ --popover: 240 10% 3.9%;
277
+ --popover-foreground: 0 0% 98%;
278
+ --primary: 0 0% 98%;
279
+ --primary-foreground: 240 5.9% 10%;
280
+ --secondary: 240 3.7% 15.9%;
281
+ --secondary-foreground: 0 0% 98%;
282
+ --muted: 240 3.7% 15.9%;
283
+ --muted-foreground: 240 5% 64.9%;
284
+ --accent: 240 3.7% 15.9%;
285
+ --accent-foreground: 0 0% 98%;
286
+ --destructive: 0 62.8% 30.6%;
287
+ --destructive-foreground: 0 0% 98%;
288
+ --border: 240 3.7% 15.9%;
289
+ --input: 240 3.7% 15.9%;
290
+ --ring: 240 4.9% 83.9%;
291
+ --chart-1: 220 70% 50%;
292
292
  --chart-2: 160 60% 45%;
293
293
  --chart-3: 30 80% 55%;
294
294
  --chart-4: 280 65% 60%;
package/src/app/main.tsx CHANGED
@@ -13,8 +13,10 @@ import { configuredSidebar } from "virtual:zudoku-sidebar";
13
13
  import "virtual:zudoku-theme.css";
14
14
  import { Layout, RouterError, Zudoku } from "zudoku/components";
15
15
  import type { ZudokuConfig } from "../config/config.js";
16
+ import { StatusPage } from "../lib/components/StatusPage.js";
16
17
  import type { ZudokuContextOptions } from "../lib/core/ZudokuContext.js";
17
18
  import { isNavigationPlugin } from "../lib/core/plugins.js";
19
+ import { RouteGuard } from "../lib/core/RouteGuard.js";
18
20
 
19
21
  export const convertZudokuConfigToOptions = (
20
22
  config: ZudokuConfig,
@@ -32,6 +34,7 @@ export const convertZudokuConfigToOptions = (
32
34
  !config.page?.logo?.src?.dark;
33
35
 
34
36
  return {
37
+ protectedRoutes: config.protectedRoutes,
35
38
  page: {
36
39
  ...config.page,
37
40
  logo: {
@@ -69,7 +72,10 @@ export const convertZudokuConfigToOptions = (
69
72
  };
70
73
  };
71
74
 
72
- export const getRoutesByOptions = (options: ZudokuContextOptions) => {
75
+ export const getRoutesByOptions = (
76
+ options: ZudokuContextOptions,
77
+ enableStatusPages = false,
78
+ ) => {
73
79
  const allPlugins = [
74
80
  ...(options.plugins ? options.plugins : []),
75
81
  ...(options.authentication?.getAuthenticationPlugin
@@ -79,19 +85,31 @@ export const getRoutesByOptions = (options: ZudokuContextOptions) => {
79
85
 
80
86
  const routes = allPlugins
81
87
  .flatMap((plugin) => (isNavigationPlugin(plugin) ? plugin.getRoutes() : []))
82
- .concat({
83
- path: "*",
84
- loader: () => {
85
- throw new Response("Not Found", { status: 404 });
88
+ .concat(
89
+ enableStatusPages
90
+ ? [400, 403, 404, 405, 414, 416, 500, 501, 502, 503, 504].map(
91
+ (statusCode) => ({
92
+ path: `/.static/${statusCode}`,
93
+ element: <StatusPage statusCode={statusCode} />,
94
+ }),
95
+ )
96
+ : [],
97
+ )
98
+ .concat([
99
+ {
100
+ path: "*",
101
+ loader: () => {
102
+ throw new Response("Not Found", { status: 404 });
103
+ },
86
104
  },
87
- });
105
+ ]);
88
106
 
89
107
  return routes;
90
108
  };
91
109
 
92
110
  export const getRoutesByConfig = (config: ZudokuConfig): RouteObject[] => {
93
111
  const options = convertZudokuConfigToOptions(config);
94
- const routes = getRoutesByOptions(options);
112
+ const routes = getRoutesByOptions(options, config.enableStatusPages);
95
113
 
96
114
  return [
97
115
  {
@@ -102,6 +120,7 @@ export const getRoutesByConfig = (config: ZudokuConfig): RouteObject[] => {
102
120
  ),
103
121
  children: [
104
122
  {
123
+ element: <RouteGuard />,
105
124
  errorElement: <RouterError />,
106
125
  children: routes,
107
126
  },
@@ -35,10 +35,7 @@ class Auth0AuthenticationProvider extends OpenIDAuthenticationProvider {
35
35
  providerData: null,
36
36
  });
37
37
 
38
- const redirectUrl = new URL(
39
- window.location.origin + this.logoutRedirectUrlPath,
40
- );
41
-
38
+ const redirectUrl = new URL(window.location.origin);
42
39
  redirectUrl.pathname = this.logoutRedirectUrlPath;
43
40
 
44
41
  // SEE: https://auth0.com/docs/authenticate/login/logout/log-users-out-of-auth0
@@ -2,6 +2,7 @@ import logger from "loglevel";
2
2
  import * as oauth from "oauth4webapi";
3
3
  import { OpenIDAuthenticationConfig } from "../../../config/config.js";
4
4
  import { ClientOnly } from "../../components/ClientOnly.js";
5
+ import { joinUrl } from "../../util/joinUrl.js";
5
6
  import {
6
7
  AuthenticationProvider,
7
8
  AuthenticationProviderInitializer,
@@ -49,8 +50,8 @@ export class OpenIDAuthenticationProvider implements AuthenticationProvider {
49
50
 
50
51
  protected authorizationServer: oauth.AuthorizationServer | undefined;
51
52
 
52
- protected callbackUrlPath = "/oauth/callback";
53
- protected logoutRedirectUrlPath = "/";
53
+ protected callbackUrlPath: string;
54
+ protected logoutRedirectUrlPath: string;
54
55
  protected onAuthorizationUrl?: (
55
56
  authorizationUrl: URL,
56
57
  options: { isSignIn: boolean; isSignUp: boolean },
@@ -67,6 +68,7 @@ export class OpenIDAuthenticationProvider implements AuthenticationProvider {
67
68
  redirectToAfterSignUp,
68
69
  redirectToAfterSignIn,
69
70
  redirectToAfterSignOut,
71
+ basePath,
70
72
  }: OpenIDAuthenticationConfig) {
71
73
  this.client = {
72
74
  client_id: clientId,
@@ -74,9 +76,14 @@ export class OpenIDAuthenticationProvider implements AuthenticationProvider {
74
76
  };
75
77
  this.audience = audience;
76
78
  this.issuer = issuer;
77
- this.redirectToAfterSignUp = redirectToAfterSignUp ?? "/";
78
- this.redirectToAfterSignIn = redirectToAfterSignIn ?? "/";
79
- this.redirectToAfterSignOut = redirectToAfterSignOut ?? "/";
79
+ this.callbackUrlPath = joinUrl(basePath, "/oauth/callback");
80
+
81
+ const root = joinUrl(basePath, "/");
82
+
83
+ this.logoutRedirectUrlPath = root;
84
+ this.redirectToAfterSignUp = redirectToAfterSignUp ?? root;
85
+ this.redirectToAfterSignIn = redirectToAfterSignIn ?? root;
86
+ this.redirectToAfterSignOut = redirectToAfterSignOut ?? root;
80
87
  }
81
88
 
82
89
  protected async getAuthServer() {
@@ -1,19 +1,22 @@
1
1
  import React from "react";
2
2
  import { Link, type LinkProps, useLocation } from "react-router";
3
+ import { useScrollToHash } from "../util/useScrollToAnchor.js";
3
4
 
4
5
  /**
5
6
  * Link that scrolls to anchor even if the hash is already set in the URL.
6
7
  */
7
8
  export const AnchorLink = (props: LinkProps) => {
8
9
  const location = useLocation();
10
+ const scrollToHash = useScrollToHash();
9
11
  const hash = typeof props.to === "string" ? props.to : props.to.hash;
10
12
 
11
13
  const handleClick = (event: React.MouseEvent<HTMLAnchorElement>) => {
14
+ props.onClick?.(event);
12
15
  if (!hash?.startsWith("#") || hash !== location.hash) return;
13
16
 
14
17
  event.preventDefault();
15
- document.getElementById(hash.slice(1))?.scrollIntoView();
18
+ scrollToHash(hash);
16
19
  };
17
20
 
18
- return <Link onClick={handleClick} {...props} />;
21
+ return <Link {...props} onClick={handleClick} />;
19
22
  };
@@ -0,0 +1,111 @@
1
+ import { PopoverAnchor } from "@radix-ui/react-popover";
2
+ import { useCommandState } from "cmdk";
3
+ import { useRef, useState, type Ref } from "react";
4
+ import {
5
+ Command,
6
+ CommandInlineInput,
7
+ CommandItem,
8
+ CommandList,
9
+ } from "zudoku/ui/Command.js";
10
+ import { Popover, PopoverContent } from "zudoku/ui/Popover.js";
11
+ import { cn } from "../util/cn.js";
12
+
13
+ type AutocompleteProps = {
14
+ value: string;
15
+ options: readonly string[];
16
+ onChange: (e: string) => void;
17
+ className?: string;
18
+ placeholder?: string;
19
+ onEnterPress?: (e: React.KeyboardEvent<HTMLInputElement>) => void;
20
+ ref?: Ref<HTMLInputElement>;
21
+ };
22
+
23
+ const AutocompletePopover = ({
24
+ value,
25
+ options,
26
+ onChange,
27
+ className,
28
+ placeholder = "Enter value",
29
+ onEnterPress,
30
+ ref,
31
+ }: AutocompleteProps) => {
32
+ const [open, setOpen] = useState(false);
33
+ const [dontClose, setDontClose] = useState(false);
34
+ const count = useCommandState((state) => state.filtered.count);
35
+ const inputRef = useRef<HTMLInputElement>(null);
36
+ return (
37
+ <Popover open={open}>
38
+ <PopoverAnchor>
39
+ <CommandInlineInput
40
+ ref={(el) => {
41
+ inputRef.current = el;
42
+ if (typeof ref === "function") {
43
+ ref(el);
44
+ } else if (ref) {
45
+ ref.current = el;
46
+ }
47
+ }}
48
+ value={value}
49
+ placeholder={placeholder}
50
+ className={cn("h-9 bg-transparent", className)}
51
+ onFocus={() => setOpen(true)}
52
+ onBlur={() => {
53
+ if (dontClose) {
54
+ return;
55
+ }
56
+ setOpen(false);
57
+ }}
58
+ onKeyDown={(e) => {
59
+ if (e.key === "Enter") {
60
+ setOpen(false);
61
+ inputRef.current?.blur();
62
+ onEnterPress?.(e);
63
+ }
64
+ }}
65
+ onValueChange={(e) => onChange(e)}
66
+ />
67
+ </PopoverAnchor>
68
+ <PopoverContent
69
+ onMouseEnter={() => setDontClose(true)}
70
+ onMouseLeave={() => setDontClose(false)}
71
+ onOpenAutoFocus={(e) => e.preventDefault()}
72
+ className={cn("p-0 w-[--radix-popover-trigger-width]", {
73
+ "border-0": count === 0,
74
+ })}
75
+ align="start"
76
+ side="bottom"
77
+ onWheel={(e) => {
78
+ // See: https://github.com/radix-ui/primitives/issues/1159
79
+ e.stopPropagation();
80
+ }}
81
+ onTouchMove={(e) => {
82
+ e.stopPropagation();
83
+ }}
84
+ >
85
+ <CommandList className="max-h-[140px]">
86
+ {options.map((enumValue) => (
87
+ <CommandItem
88
+ key={enumValue}
89
+ value={enumValue}
90
+ onSelect={(selected) => {
91
+ onChange(selected);
92
+ setOpen(false);
93
+ }}
94
+ className="cursor-pointer"
95
+ >
96
+ {enumValue}
97
+ </CommandItem>
98
+ ))}
99
+ </CommandList>
100
+ </PopoverContent>
101
+ </Popover>
102
+ );
103
+ };
104
+
105
+ export const Autocomplete = (props: AutocompleteProps) => {
106
+ return (
107
+ <Command className="bg-transparent">
108
+ <AutocompletePopover {...props} />
109
+ </Command>
110
+ );
111
+ };
@@ -16,7 +16,7 @@ import {
16
16
  DropdownMenuSubTrigger,
17
17
  DropdownMenuTrigger,
18
18
  } from "../ui/DropdownMenu.js";
19
- import { joinPath } from "../util/joinPath.js";
19
+ import { joinUrl } from "../util/joinUrl.js";
20
20
  import { Banner } from "./Banner.js";
21
21
  import { ClientOnly } from "./ClientOnly.js";
22
22
  import { useZudoku } from "./context/ZudokuContext.js";
@@ -76,7 +76,7 @@ export const Header = memo(function HeaderInner() {
76
76
  src={
77
77
  /https?:\/\//.test(page.logo.src.light)
78
78
  ? page.logo.src.light
79
- : joinPath(
79
+ : joinUrl(
80
80
  import.meta.env.BASE_URL,
81
81
  page.logo.src.light,
82
82
  )
@@ -90,7 +90,7 @@ export const Header = memo(function HeaderInner() {
90
90
  src={
91
91
  /https?:\/\//.test(page.logo.src.dark)
92
92
  ? page.logo.src.dark
93
- : joinPath(
93
+ : joinUrl(
94
94
  import.meta.env.BASE_URL,
95
95
  page.logo.src.dark,
96
96
  )
@@ -171,8 +171,8 @@ export const Header = memo(function HeaderInner() {
171
171
  )}
172
172
  </ClientOnly>
173
173
  )}
174
- <ThemeSwitch />
175
174
  <Slotlet name="head-navigation-end" />
175
+ <ThemeSwitch />
176
176
  </div>
177
177
  </div>
178
178
  </div>
@@ -1,3 +1,4 @@
1
+ import { memo } from "react";
1
2
  import rehypeRaw from "rehype-raw";
2
3
  import remarkGfm from "remark-gfm";
3
4
  import { visit } from "unist-util-visit";
@@ -20,19 +21,17 @@ const rehypePlugins = [rehypeCodeBlockPlugin, rehypeRaw];
20
21
  // other styles are defined in main.css .prose
21
22
  export const ProseClasses = "prose dark:prose-invert prose-neutral";
22
23
 
23
- export const Markdown = ({
24
- content,
25
- className,
26
- }: {
27
- content: string;
28
- className?: string;
29
- }) => (
30
- <ReactMarkdown
31
- remarkPlugins={remarkPlugins}
32
- rehypePlugins={rehypePlugins}
33
- components={MdxComponents}
34
- className={className}
35
- >
36
- {content}
37
- </ReactMarkdown>
24
+ export const Markdown = memo(
25
+ ({ content, className }: { content: string; className?: string }) => (
26
+ <ReactMarkdown
27
+ remarkPlugins={remarkPlugins}
28
+ rehypePlugins={rehypePlugins}
29
+ components={MdxComponents}
30
+ className={className}
31
+ >
32
+ {content}
33
+ </ReactMarkdown>
34
+ ),
38
35
  );
36
+
37
+ Markdown.displayName = "Markdown";
@@ -0,0 +1,91 @@
1
+ import type { ReactNode } from "react";
2
+ import { ErrorPage } from "./ErrorPage.js";
3
+
4
+ type StatusPageProps = {
5
+ statusCode: number;
6
+ message?: ReactNode;
7
+ };
8
+
9
+ const getDefaultContent = (
10
+ statusCode: number,
11
+ ): { title: string; message: string } => {
12
+ switch (statusCode) {
13
+ case 400:
14
+ return {
15
+ title: "Bad Request",
16
+ message:
17
+ "The request could not be understood by the server due to malformed syntax.",
18
+ };
19
+ case 403:
20
+ return {
21
+ title: "Forbidden",
22
+ message: "You don't have permission to access this resource.",
23
+ };
24
+ case 404:
25
+ return {
26
+ title: "Not Found",
27
+ message: "The requested resource could not be found.",
28
+ };
29
+ case 405:
30
+ return {
31
+ title: "Method Not Allowed",
32
+ message:
33
+ "The request method is not supported for the requested resource.",
34
+ };
35
+ case 414:
36
+ return {
37
+ title: "Request URI Too Large",
38
+ message: "The request URI is too large.",
39
+ };
40
+ case 416:
41
+ return {
42
+ title: "Range Not Satisfiable",
43
+ message: "The server cannot satisfy the request range.",
44
+ };
45
+ case 500:
46
+ return {
47
+ title: "Internal Server Error",
48
+ message: "An unexpected error occurred while processing your request.",
49
+ };
50
+ case 501:
51
+ return {
52
+ title: "Not Implemented",
53
+ message:
54
+ "The server does not support the functionality required to fulfill the request.",
55
+ };
56
+ case 502:
57
+ return {
58
+ title: "Bad Gateway",
59
+ message:
60
+ "The server received an invalid response from the upstream server.",
61
+ };
62
+ case 503:
63
+ return {
64
+ title: "Service Unavailable",
65
+ message: "The server is temporarily unable to handle the request.",
66
+ };
67
+ case 504:
68
+ return {
69
+ title: "Gateway Timeout",
70
+ message:
71
+ "The server did not receive a timely response from the upstream server.",
72
+ };
73
+ default:
74
+ return {
75
+ title: "An error occurred",
76
+ message: "Something went wrong while processing your request.",
77
+ };
78
+ }
79
+ };
80
+
81
+ export const StatusPage = ({ statusCode, message }: StatusPageProps) => {
82
+ const defaultContent = getDefaultContent(statusCode);
83
+
84
+ return (
85
+ <ErrorPage
86
+ title={defaultContent.title}
87
+ message={message ?? defaultContent.message}
88
+ category={statusCode}
89
+ />
90
+ );
91
+ };