zudoku 0.12.2 → 0.13.1

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 (197) hide show
  1. package/dist/app/main.js +3 -3
  2. package/dist/app/main.js.map +1 -1
  3. package/dist/cli/dev/handler.js +2 -2
  4. package/dist/cli/dev/handler.js.map +1 -1
  5. package/dist/config/validators/validate.d.ts +42 -23
  6. package/dist/config/validators/validate.js +6 -2
  7. package/dist/config/validators/validate.js.map +1 -1
  8. package/dist/index.d.ts +1 -0
  9. package/dist/lib/components/Banner.js +7 -1
  10. package/dist/lib/components/Banner.js.map +1 -1
  11. package/dist/lib/components/Header.js +1 -1
  12. package/dist/lib/components/Header.js.map +1 -1
  13. package/dist/lib/components/Layout.js +1 -1
  14. package/dist/lib/components/Layout.js.map +1 -1
  15. package/dist/lib/components/MobileTopNavigation.js +2 -1
  16. package/dist/lib/components/MobileTopNavigation.js.map +1 -1
  17. package/dist/lib/components/Search.js +1 -1
  18. package/dist/lib/components/Search.js.map +1 -1
  19. package/dist/lib/components/SlotletProvider.d.ts +9 -2
  20. package/dist/lib/components/SlotletProvider.js +4 -2
  21. package/dist/lib/components/SlotletProvider.js.map +1 -1
  22. package/dist/lib/components/index.d.ts +2 -1
  23. package/dist/lib/components/index.js.map +1 -1
  24. package/dist/lib/core/DevPortalContext.d.ts +1 -1
  25. package/dist/lib/oas/graphql/index.js +2 -6
  26. package/dist/lib/oas/graphql/index.js.map +1 -1
  27. package/dist/lib/plugins/custom-pages/CustomPage.d.ts +2 -0
  28. package/dist/lib/plugins/custom-pages/CustomPage.js +10 -0
  29. package/dist/lib/plugins/custom-pages/CustomPage.js.map +1 -0
  30. package/dist/lib/plugins/custom-pages/index.d.ts +10 -0
  31. package/dist/lib/plugins/custom-pages/index.js +11 -0
  32. package/dist/lib/plugins/custom-pages/index.js.map +1 -0
  33. package/dist/lib/plugins/openapi/Endpoint.js +1 -1
  34. package/dist/lib/plugins/openapi/Endpoint.js.map +1 -1
  35. package/dist/lib/plugins/openapi/OperationList.js +1 -1
  36. package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
  37. package/dist/lib/plugins/openapi/Route.d.ts +1 -1
  38. package/dist/lib/plugins/openapi/Route.js +1 -1
  39. package/dist/lib/plugins/openapi/Route.js.map +1 -1
  40. package/dist/lib/plugins/openapi/Sidecar.js +1 -1
  41. package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
  42. package/dist/lib/plugins/openapi/client/createMemoryClient.js +1 -1
  43. package/dist/lib/plugins/openapi/client/createMemoryClient.js.map +1 -1
  44. package/dist/lib/plugins/openapi/client/createWorkerClient.js +1 -1
  45. package/dist/lib/plugins/openapi/client/createWorkerClient.js.map +1 -1
  46. package/dist/lib/plugins/openapi/index.js +1 -1
  47. package/dist/lib/plugins/openapi/index.js.map +1 -1
  48. package/dist/lib/ui/Callout.d.ts +36 -35
  49. package/dist/lib/ui/Callout.js.map +1 -1
  50. package/dist/lib/ui/Drawer.d.ts +8 -10
  51. package/dist/lib/ui/Drawer.js.map +1 -1
  52. package/dist/lib/util/useExposedProps.d.ts +2 -0
  53. package/dist/lib/util/useExposedProps.js +8 -0
  54. package/dist/lib/util/useExposedProps.js.map +1 -0
  55. package/dist/vite/config.js +2 -0
  56. package/dist/vite/config.js.map +1 -1
  57. package/dist/vite/dev-server.d.ts +6 -1
  58. package/dist/vite/dev-server.js +13 -3
  59. package/dist/vite/dev-server.js.map +1 -1
  60. package/dist/vite/plugin-component.js +0 -1
  61. package/dist/vite/plugin-component.js.map +1 -1
  62. package/dist/vite/plugin-custom-pages.d.ts +4 -0
  63. package/dist/vite/plugin-custom-pages.js +30 -0
  64. package/dist/vite/plugin-custom-pages.js.map +1 -0
  65. package/dist/vite/plugin.js +2 -0
  66. package/dist/vite/plugin.js.map +1 -1
  67. package/lib/{AuthenticationPlugin-Bx9FK124.js → AuthenticationPlugin-CbgJ5SAh.js} +3 -3
  68. package/lib/{AuthenticationPlugin-Bx9FK124.js.map → AuthenticationPlugin-CbgJ5SAh.js.map} +1 -1
  69. package/lib/{DeveloperHint-YeWHKvyr.js → DeveloperHint-CiXPc9Xm.js} +2 -2
  70. package/lib/{DeveloperHint-YeWHKvyr.js.map → DeveloperHint-CiXPc9Xm.js.map} +1 -1
  71. package/lib/ErrorPage-B-zoPPVx.js +15 -0
  72. package/lib/{ErrorPage-CsZAN_za.js.map → ErrorPage-B-zoPPVx.js.map} +1 -1
  73. package/lib/Input-QMLhK7Rb.js +2229 -0
  74. package/lib/Input-QMLhK7Rb.js.map +1 -0
  75. package/lib/{Markdown-DapSf3wG.js → Markdown-D6Nze6qq.js} +3281 -5392
  76. package/lib/Markdown-D6Nze6qq.js.map +1 -0
  77. package/lib/{MdxPage-BqBWsXZ1.js → MdxPage-DBhq6-5F.js} +15 -15
  78. package/lib/{MdxPage-BqBWsXZ1.js.map → MdxPage-DBhq6-5F.js.map} +1 -1
  79. package/lib/{OperationList-CYrmxPa8.js → OperationList-Ba24gUd2.js} +50 -51
  80. package/lib/OperationList-Ba24gUd2.js.map +1 -0
  81. package/lib/{Route-Q5mqNQrv.js → Route-DI38nxYt.js} +3 -4
  82. package/lib/Route-DI38nxYt.js.map +1 -0
  83. package/lib/SidebarBadge-B9-VJSQr.js +503 -0
  84. package/lib/SidebarBadge-B9-VJSQr.js.map +1 -0
  85. package/lib/{SlotletProvider-D3UD5Go3.js → SlotletProvider-Cb8mGpBO.js} +46 -46
  86. package/lib/{SlotletProvider-D3UD5Go3.js.map → SlotletProvider-Cb8mGpBO.js.map} +1 -1
  87. package/lib/ZudokuContext-BEmsYQoq.js +1173 -0
  88. package/lib/ZudokuContext-BEmsYQoq.js.map +1 -0
  89. package/lib/assets/{index-B9EWVYfo.js → index-B_Jk_Yzp.js} +968 -938
  90. package/lib/assets/index-B_Jk_Yzp.js.map +1 -0
  91. package/lib/assets/{worker-Bcj4NA2p.js → worker-Bf8vjASY.js} +4582 -4303
  92. package/lib/assets/worker-Bf8vjASY.js.map +1 -0
  93. package/lib/cn-BmFQLtkS.js +2279 -0
  94. package/lib/cn-BmFQLtkS.js.map +1 -0
  95. package/lib/{index-BG0g4WW0.js → index-BRCiYFaL.js} +747 -737
  96. package/lib/index-BRCiYFaL.js.map +1 -0
  97. package/lib/{index-CLd8ycZz.js → index-CkwDvuPt.js} +947 -917
  98. package/lib/index-CkwDvuPt.js.map +1 -0
  99. package/lib/{index-LNp6rxyU.js → index-D06ATMgg.js} +2 -2
  100. package/lib/{index-LNp6rxyU.js.map → index-D06ATMgg.js.map} +1 -1
  101. package/lib/{index-BlJ2rj99.js → index-DA74gNq3.js} +1124 -974
  102. package/lib/index-DA74gNq3.js.map +1 -0
  103. package/lib/index-DJqnphbT.js +35 -0
  104. package/lib/{index-Bn6Lc9tq.js.map → index-DJqnphbT.js.map} +1 -1
  105. package/lib/{index-BngPzhKn.js → index-dgcPryXi.js} +3 -3
  106. package/lib/{index-BngPzhKn.js.map → index-dgcPryXi.js.map} +1 -1
  107. package/lib/{index-Dolisrci.js → index-g_JJcuFg.js} +603 -549
  108. package/lib/index-g_JJcuFg.js.map +1 -0
  109. package/lib/router-Oe6YmY6B.js +3024 -0
  110. package/lib/router-Oe6YmY6B.js.map +1 -0
  111. package/lib/state-CsuHT8ZO.js +183 -0
  112. package/lib/state-CsuHT8ZO.js.map +1 -0
  113. package/lib/urql-core-KJnLL26g.js +1455 -0
  114. package/lib/urql-core-KJnLL26g.js.map +1 -0
  115. package/lib/useExposedProps-Csw8oAlt.js +9 -0
  116. package/lib/useExposedProps-Csw8oAlt.js.map +1 -0
  117. package/lib/{utils-ByIc_KIM.js → utils-Chi3p5nE.js} +4 -4
  118. package/lib/utils-Chi3p5nE.js.map +1 -0
  119. package/lib/zudoku.auth-auth0.js +1 -1
  120. package/lib/zudoku.auth-clerk.js +2 -2
  121. package/lib/zudoku.auth-openid.js +363 -350
  122. package/lib/zudoku.auth-openid.js.map +1 -1
  123. package/lib/zudoku.components.js +1697 -1623
  124. package/lib/zudoku.components.js.map +1 -1
  125. package/lib/zudoku.openapi-worker.js +4599 -4319
  126. package/lib/zudoku.openapi-worker.js.map +1 -1
  127. package/lib/zudoku.plugin-api-keys.js +7 -7
  128. package/lib/zudoku.plugin-custom-pages.js +21 -0
  129. package/lib/zudoku.plugin-custom-pages.js.map +1 -0
  130. package/lib/zudoku.plugin-markdown.js +1 -1
  131. package/lib/zudoku.plugin-openapi.js +8 -8
  132. package/lib/zudoku.plugin-redirect.js +1 -1
  133. package/package.json +61 -68
  134. package/src/app/main.tsx +3 -3
  135. package/src/lib/components/Banner.tsx +12 -2
  136. package/src/lib/components/Header.tsx +4 -2
  137. package/src/lib/components/Layout.tsx +1 -0
  138. package/src/lib/components/MobileTopNavigation.tsx +4 -0
  139. package/src/lib/components/Search.tsx +1 -1
  140. package/src/lib/components/SlotletProvider.tsx +27 -4
  141. package/src/lib/components/index.ts +1 -1
  142. package/src/lib/core/DevPortalContext.ts +1 -1
  143. package/src/lib/oas/graphql/index.ts +3 -11
  144. package/src/lib/plugins/custom-pages/CustomPage.tsx +15 -0
  145. package/src/lib/plugins/custom-pages/index.tsx +24 -0
  146. package/src/lib/plugins/openapi/Endpoint.tsx +1 -1
  147. package/src/lib/plugins/openapi/OperationList.tsx +1 -1
  148. package/src/lib/plugins/openapi/Route.tsx +1 -2
  149. package/src/lib/plugins/openapi/Sidecar.tsx +1 -1
  150. package/src/lib/plugins/openapi/client/createMemoryClient.ts +1 -6
  151. package/src/lib/plugins/openapi/client/createWorkerClient.ts +1 -6
  152. package/src/lib/plugins/openapi/index.tsx +1 -5
  153. package/src/lib/ui/Callout.tsx +7 -6
  154. package/src/lib/ui/Drawer.tsx +38 -36
  155. package/src/lib/util/useExposedProps.tsx +10 -0
  156. package/dist/lib/plugins/custom-page/index.d.ts +0 -8
  157. package/dist/lib/plugins/custom-page/index.js +0 -12
  158. package/dist/lib/plugins/custom-page/index.js.map +0 -1
  159. package/dist/lib/plugins/openapi/playground/Editor.d.ts +0 -1
  160. package/dist/lib/plugins/openapi/playground/Editor.js +0 -5
  161. package/dist/lib/plugins/openapi/playground/Editor.js.map +0 -1
  162. package/dist/lib/plugins/openapi/util/urql.d.ts +0 -7
  163. package/dist/lib/plugins/openapi/util/urql.js +0 -8
  164. package/dist/lib/plugins/openapi/util/urql.js.map +0 -1
  165. package/lib/CategoryHeading-ovR-zHRq.js +0 -10
  166. package/lib/CategoryHeading-ovR-zHRq.js.map +0 -1
  167. package/lib/ErrorPage-CsZAN_za.js +0 -16
  168. package/lib/Input-CtVUl3eT.js +0 -2198
  169. package/lib/Input-CtVUl3eT.js.map +0 -1
  170. package/lib/Markdown-DapSf3wG.js.map +0 -1
  171. package/lib/OperationList-CYrmxPa8.js.map +0 -1
  172. package/lib/Route-Q5mqNQrv.js.map +0 -1
  173. package/lib/SidebarBadge-Dx7jtnoA.js +0 -498
  174. package/lib/SidebarBadge-Dx7jtnoA.js.map +0 -1
  175. package/lib/ZudokuContext-cr-pTRY1.js +0 -1084
  176. package/lib/ZudokuContext-cr-pTRY1.js.map +0 -1
  177. package/lib/_commonjsHelpers-BkfeUUK-.js +0 -29
  178. package/lib/_commonjsHelpers-BkfeUUK-.js.map +0 -1
  179. package/lib/assets/index-B9EWVYfo.js.map +0 -1
  180. package/lib/assets/worker-Bcj4NA2p.js.map +0 -1
  181. package/lib/index-BG0g4WW0.js.map +0 -1
  182. package/lib/index-BlJ2rj99.js.map +0 -1
  183. package/lib/index-Bn6Lc9tq.js +0 -9
  184. package/lib/index-CLd8ycZz.js.map +0 -1
  185. package/lib/index-Dolisrci.js.map +0 -1
  186. package/lib/router-D2p7Olpn.js +0 -2971
  187. package/lib/router-D2p7Olpn.js.map +0 -1
  188. package/lib/state-hNe1dw4B.js +0 -548
  189. package/lib/state-hNe1dw4B.js.map +0 -1
  190. package/lib/urql-YhcsXYy8.js +0 -1591
  191. package/lib/urql-YhcsXYy8.js.map +0 -1
  192. package/lib/utils-ByIc_KIM.js.map +0 -1
  193. package/lib/zudoku.plugin-custom-page.js +0 -13
  194. package/lib/zudoku.plugin-custom-page.js.map +0 -1
  195. package/src/lib/plugins/custom-page/index.tsx +0 -22
  196. package/src/lib/plugins/openapi/playground/Editor.tsx +0 -4
  197. package/src/lib/plugins/openapi/util/urql.ts +0 -8
@@ -1,13 +1,13 @@
1
1
  import { j as e } from "./jsx-runtime-B6kdoens.js";
2
- import { S as x, R as f } from "./SlotletProvider-D3UD5Go3.js";
3
- import { u as g, a as d, I as j, S as v, b as w, c as b, d as k, e as K, f as m } from "./Input-CtVUl3eT.js";
4
- import { a as N, L as u, O as I } from "./index-BG0g4WW0.js";
5
- import { u as h, a as E, b as S } from "./ZudokuContext-cr-pTRY1.js";
6
- import { B as l, m as A } from "./index-Dolisrci.js";
7
- import { D as C } from "./DeveloperHint-YeWHKvyr.js";
2
+ import { S as x, R as f } from "./SlotletProvider-Cb8mGpBO.js";
3
+ import { u as g, a as d, I as j, S as v, b as w, c as b, d as k, e as K, f as m } from "./Input-QMLhK7Rb.js";
4
+ import { a as N, L as u, O as I } from "./index-BRCiYFaL.js";
5
+ import { u as h, a as E, b as S } from "./ZudokuContext-BEmsYQoq.js";
6
+ import { B as l, n as A } from "./index-g_JJcuFg.js";
7
+ import { D as C } from "./DeveloperHint-CiXPc9Xm.js";
8
8
  import { RotateCwIcon as P, TrashIcon as D, EyeOffIcon as R, EyeIcon as q, CheckIcon as O, CopyIcon as z } from "lucide-react";
9
9
  import { useState as p } from "react";
10
- import { a as T } from "./Markdown-DapSf3wG.js";
10
+ import { c as T } from "./cn-BmFQLtkS.js";
11
11
  function c(t, s) {
12
12
  if (t)
13
13
  return;
@@ -0,0 +1,21 @@
1
+ import { j as s } from "./jsx-runtime-B6kdoens.js";
2
+ import n from "react";
3
+ import { c as a } from "./cn-BmFQLtkS.js";
4
+ import { u as c } from "./useExposedProps-Csw8oAlt.js";
5
+ const u = ({
6
+ element: e,
7
+ render: t,
8
+ prose: o = !0
9
+ }) => {
10
+ const r = c(), m = t ? n.createElement(t, r) : e;
11
+ return /* @__PURE__ */ s.jsx("div", { className: a(o && "prose max-w-full"), children: m });
12
+ }, f = (e) => ({
13
+ getRoutes: () => e.map(({ path: t, ...o }) => ({
14
+ path: t,
15
+ element: /* @__PURE__ */ s.jsx(u, { ...o })
16
+ }))
17
+ });
18
+ export {
19
+ f as customPagesPlugin
20
+ };
21
+ //# sourceMappingURL=zudoku.plugin-custom-pages.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zudoku.plugin-custom-pages.js","sources":["../src/lib/plugins/custom-pages/CustomPage.tsx","../src/lib/plugins/custom-pages/index.tsx"],"sourcesContent":["import React from \"react\";\nimport { cn } from \"../../util/cn.js\";\nimport { useExposedProps } from \"../../util/useExposedProps.js\";\nimport type { CustomPageConfig } from \"./index.js\";\n\nexport const CustomPage = ({\n element,\n render,\n prose = true,\n}: Omit<CustomPageConfig, \"path\">) => {\n const slotletProps = useExposedProps();\n const content = render ? React.createElement(render, slotletProps) : element;\n\n return <div className={cn(prose && \"prose max-w-full\")}>{content}</div>;\n};\n","import { type ComponentType, type ReactNode } from \"react\";\nimport type { RouteObject } from \"react-router-dom\";\nimport { type ExposedComponentProps } from \"../../components/SlotletProvider.js\";\nimport type { DevPortalPlugin, NavigationPlugin } from \"../../core/plugins.js\";\nimport { CustomPage } from \"./CustomPage.js\";\n\nexport type CustomPageConfig = {\n path: string;\n prose?: boolean;\n element?: ReactNode;\n render?: ComponentType<ExposedComponentProps>;\n};\n\nexport const customPagesPlugin = (\n config: CustomPageConfig[],\n): DevPortalPlugin & NavigationPlugin => {\n return {\n getRoutes: (): RouteObject[] =>\n config.map(({ path, ...props }) => ({\n path,\n element: <CustomPage {...props} />,\n })),\n };\n};\n"],"names":["CustomPage","element","render","prose","slotletProps","useExposedProps","content","React","cn","customPagesPlugin","config","path","props","jsx"],"mappings":";;;;AAKO,MAAMA,IAAa,CAAC;AAAA,EACzB,SAAAC;AAAA,EACA,QAAAC;AAAA,EACA,OAAAC,IAAQ;AACV,MAAsC;AACpC,QAAMC,IAAeC,KACfC,IAAUJ,IAASK,EAAM,cAAcL,GAAQE,CAAY,IAAIH;AAErE,+BAAQ,OAAI,EAAA,WAAWO,EAAGL,KAAS,kBAAkB,GAAI,UAAQG,EAAA,CAAA;AACnE,GCDaG,IAAoB,CAC/BC,OAEO;AAAA,EACL,WAAW,MACTA,EAAO,IAAI,CAAC,EAAE,MAAAC,GAAM,GAAGC,SAAa;AAAA,IAClC,MAAAD;AAAA,IACA,SAASE,gBAAAA,EAAAA,IAACb,GAAY,EAAA,GAAGY,EAAO,CAAA;AAAA,EAAA,EAChC;AAAA;"}
@@ -6,7 +6,7 @@ const x = (t, e, n) => Object.entries(t).flatMap(([a, p]) => {
6
6
  return s ? {
7
7
  path: s,
8
8
  lazy: async () => {
9
- const { MdxPage: i } = await import("./MdxPage-BqBWsXZ1.js"), { default: m, ...l } = await p();
9
+ const { MdxPage: i } = await import("./MdxPage-DBhq6-5F.js"), { default: m, ...l } = await p();
10
10
  return {
11
11
  element: /* @__PURE__ */ u.jsx(
12
12
  i,
@@ -1,15 +1,15 @@
1
1
  import "./jsx-runtime-B6kdoens.js";
2
- import { o as u } from "./index-BlJ2rj99.js";
3
- import "./urql-YhcsXYy8.js";
4
- import "./ZudokuContext-cr-pTRY1.js";
2
+ import { o as u } from "./index-DA74gNq3.js";
3
+ import "./ZudokuContext-BEmsYQoq.js";
5
4
  import "lucide-react";
6
5
  import "zudoku/openapi-worker";
7
- import "./index-Dolisrci.js";
8
- import "./ErrorPage-CsZAN_za.js";
9
- import "./Markdown-DapSf3wG.js";
6
+ import "./index-g_JJcuFg.js";
7
+ import "./ErrorPage-B-zoPPVx.js";
8
+ import "./Markdown-D6Nze6qq.js";
10
9
  import "./joinPath-B7kNnUX4.js";
11
- import "./router-D2p7Olpn.js";
12
- import "./index-BG0g4WW0.js";
10
+ import "./urql-core-KJnLL26g.js";
11
+ import "./router-Oe6YmY6B.js";
12
+ import "./index-BRCiYFaL.js";
13
13
  export {
14
14
  u as openApiPlugin
15
15
  };
@@ -1,4 +1,4 @@
1
- import { r as o } from "./router-D2p7Olpn.js";
1
+ import { r as o } from "./router-Oe6YmY6B.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.12.2",
3
+ "version": "0.13.1",
4
4
  "type": "module",
5
5
  "homepage": "https://zudoku.dev",
6
6
  "repository": {
@@ -61,9 +61,9 @@
61
61
  "import": "./lib/zudoku.plugin-redirect.js",
62
62
  "types": "./dist/lib/plugins/redirect/index.d.ts"
63
63
  },
64
- "./plugins/custom-page": {
65
- "import": "./lib/zudoku.plugin-custom-page.js",
66
- "types": "./dist/lib/plugins/custom-page/index.d.ts"
64
+ "./plugins/custom-pages": {
65
+ "import": "./lib/zudoku.plugin-custom-pages.js",
66
+ "types": "./dist/lib/plugins/custom-pages/index.d.ts"
67
67
  },
68
68
  "./plugins/search-inkeep": {
69
69
  "import": "./lib/zudoku.plugin-search-inkeep.js",
@@ -98,54 +98,58 @@
98
98
  }
99
99
  },
100
100
  "dependencies": {
101
- "@envelop/core": "5.0.1",
101
+ "@envelop/core": "5.0.2",
102
102
  "@graphql-typed-document-node/core": "3.2.0",
103
103
  "@hiogawa/vite-plugin-ssr-css": "0.0.1",
104
104
  "@lekoarts/rehype-meta-as-attributes": "3.0.1",
105
105
  "@mdx-js/react": "3.0.1",
106
106
  "@mdx-js/rollup": "3.0.1",
107
- "@monaco-editor/react": "^4.6.0",
108
107
  "@pothos/core": "3.41.0",
109
- "@radix-ui/react-collapsible": "1.1.0",
110
- "@radix-ui/react-dropdown-menu": "^2.1.1",
111
- "@radix-ui/react-select": "2.1.1",
112
- "@radix-ui/react-visually-hidden": "1.1.0",
113
- "@sentry/node": "8.11.0",
108
+ "@radix-ui/react-collapsible": "1.1.1",
109
+ "@radix-ui/react-dialog": "1.1.2",
110
+ "@radix-ui/react-dropdown-menu": "2.1.2",
111
+ "@radix-ui/react-select": "2.1.2",
112
+ "@radix-ui/react-slot": "1.1.0",
113
+ "@radix-ui/react-tabs": "1.1.1",
114
+ "@radix-ui/react-visually-hidden": "1",
115
+ "@sentry/node": "8.34.0",
114
116
  "@sindresorhus/slugify": "2.2.1",
115
117
  "@stefanprobst/rehype-extract-toc": "2.2.0",
116
- "@tailwindcss/typography": "0.5.13",
117
- "@tanstack/react-query": "5.50.1",
118
+ "@tailwindcss/typography": "0.5.15",
119
+ "@tanstack/react-query": "5.59.13",
120
+ "@types/react": "18.3.11",
121
+ "@types/react-dom": "18.3.1",
118
122
  "@vitejs/plugin-react": "4.3.1",
123
+ "@zudoku/httpsnippet": "10.0.9",
119
124
  "@zudoku/react-helmet-async": "2.0.4",
120
- "autoprefixer": "10.4.19",
121
- "chokidar": "^3.6.0",
125
+ "autoprefixer": "10.4.20",
126
+ "chokidar": "3.6.0",
122
127
  "class-variance-authority": "0.7.0",
128
+ "clsx": "2.1.1",
123
129
  "dotenv": "16.4.5",
124
- "express": "4.20.0",
125
- "glob": "^11.0.0",
130
+ "express": "4.21.1",
131
+ "glob": "11.0.0",
126
132
  "graphql": "16.9.0",
127
133
  "graphql-type-json": "0.3.2",
128
- "graphql-yoga": "5.2.0",
129
- "gray-matter": "^4.0.3",
130
- "http-terminator": "^3.2.0",
131
- "loglevel": "^1.9.1",
132
- "lru-cache": "11.0.0",
133
- "lucide-react": "0.438.0",
134
- "mdx": "0.3.1",
134
+ "graphql-yoga": "5.7.0",
135
+ "gray-matter": "4.0.3",
136
+ "http-terminator": "3.2.0",
137
+ "loglevel": "1.9.2",
138
+ "lru-cache": "11.0.1",
139
+ "lucide-react": "0.452.0",
140
+ "oauth4webapi": "2.17.0",
135
141
  "object-hash": "3.0.0",
136
142
  "openapi-types": "12.1.3",
137
- "picocolors": "^1.0.1",
138
- "postcss": "8.4.39",
139
- "posthog-node": "^4.1.1",
140
- "prism-react-renderer": "2.3.1",
143
+ "picocolors": "1.1.0",
144
+ "postcss": "8.4.47",
145
+ "posthog-node": "4.2.1",
146
+ "prism-react-renderer": "2.4.0",
141
147
  "prismjs": "1.29.0",
142
- "react": "18.3.1",
143
- "react-dom": "18.3.1",
144
- "react-error-boundary": "^4.0.13",
145
- "react-hook-form": "^7.52.1",
148
+ "react-error-boundary": "4.0.13",
149
+ "react-hook-form": "7.53.0",
146
150
  "react-is": "18.3.1",
147
151
  "react-markdown": "9.0.1",
148
- "react-router-dom": "6.25.1",
152
+ "react-router-dom": "6.27.0",
149
153
  "rehype-raw": "7.0.0",
150
154
  "rehype-slug": "6.0.0",
151
155
  "remark-comment": "1.0.0",
@@ -154,53 +158,42 @@
154
158
  "remark-frontmatter": "5.0.0",
155
159
  "remark-gfm": "4.0.0",
156
160
  "remark-mdx-frontmatter": "5.0.0",
157
- "rollup": "^4.21.2",
158
- "semver": "7.6.2",
159
- "sitemap": "^8.0.0",
161
+ "rollup": "4.24.0",
162
+ "semver": "7.6.3",
163
+ "sitemap": "8.0.0",
160
164
  "strip-ansi": "7.1.0",
161
- "tailwind-merge": "2.5.2",
162
- "tailwindcss": "3.4.4",
163
- "tsx": "4.19.0",
164
- "ulidx": "^2.3.0",
165
+ "tailwind-merge": "2.5.4",
166
+ "tailwindcss": "3.4.13",
167
+ "tsx": "4.19.1",
168
+ "ulidx": "2.4.1",
165
169
  "unist-util-visit": "5.0.0",
166
170
  "urql": "4.1.0",
167
- "vaul": "0.9.2",
168
- "vite": "5.3.6",
169
- "yaml": "2.5.0",
171
+ "vaul": "1.1.0",
172
+ "vite": "5.4.9",
173
+ "yaml": "2.6.0",
170
174
  "yargs": "17.7.2",
171
175
  "zod": "3.23.8",
172
- "zod-validation-error": "3.3.1",
173
- "zustand": "4.5.5"
176
+ "zod-validation-error": "3.4.0",
177
+ "zustand": "5.0.0"
174
178
  },
175
179
  "devDependencies": {
176
- "@radix-ui/react-dialog": "1.1.1",
177
- "@radix-ui/react-slot": "1.1.0",
178
- "@radix-ui/react-tabs": "1.1.0",
179
- "@types/express": "^4.17.21",
180
- "@types/har-format": "^1.2.15",
180
+ "@types/express": "4.17.21",
181
+ "@types/har-format": "1.2.15",
181
182
  "@types/json-schema": "7.0.15",
182
183
  "@types/mdx": "2.0.13",
183
- "@types/node": "20.12.10",
184
- "@types/object-hash": "^3.0.6",
185
- "@types/react": "18.3.3",
186
- "@types/react-dom": "18.3.0",
184
+ "@types/node": "20.16.11",
185
+ "@types/object-hash": "3.0.6",
187
186
  "@types/react-is": "18.3.0",
188
- "@types/rollup": "^0.54.0",
189
- "@types/semver": "^7.5.8",
190
- "@types/yargs": "^17.0.32",
191
- "@zudoku/httpsnippet": "10.0.9",
192
- "clsx": "2.1.1",
193
- "oauth4webapi": "2.11.1",
194
- "prism-react-renderer": "2.3.1",
195
- "prismjs": "1.29.0",
196
- "react-markdown": "9.0.1",
197
- "react-router-dom": "6.25.1",
198
- "rollup-plugin-visualizer": "^5.12.0",
199
- "typescript": "5.5.3"
187
+ "@types/semver": "7.5.8",
188
+ "@types/yargs": "17.0.33",
189
+ "rollup-plugin-visualizer": "5.12.0",
190
+ "react": "18.3.1",
191
+ "react-dom": "18.3.1",
192
+ "typescript": "5.6.3"
200
193
  },
201
194
  "peerDependencies": {
202
- "react": ">18.0.0",
203
- "react-dom": ">18.0.0"
195
+ "react": ">=18",
196
+ "react-dom": ">=18"
204
197
  },
205
198
  "optionalDependencies": {
206
199
  "@clerk/clerk-js": "5.11.0",
package/src/app/main.tsx CHANGED
@@ -2,13 +2,13 @@ import { redirect, type RouteObject } from "react-router-dom";
2
2
  import { configuredApiKeysPlugin } from "virtual:zudoku-api-keys-plugin";
3
3
  import { configuredApiPlugins } from "virtual:zudoku-api-plugins";
4
4
  import { configuredAuthProvider } from "virtual:zudoku-auth";
5
+ import { configuredCustomPagesPlugin } from "virtual:zudoku-custom-pages-plugin";
5
6
  import { configuredDocsPlugins } from "virtual:zudoku-docs-plugins";
6
7
  import { configuredRedirectPlugin } from "virtual:zudoku-redirect-plugin";
7
8
  import { configuredSidebar } from "virtual:zudoku-sidebar";
8
9
  import "virtual:zudoku-theme.css";
9
10
  import { DevPortal, Layout, RouterError } from "zudoku/components";
10
11
  import { isNavigationPlugin } from "zudoku/internal";
11
- import { customPagePlugin } from "zudoku/plugins/custom-page";
12
12
  import { inkeepSearchPlugin } from "zudoku/plugins/search-inkeep";
13
13
  import type { ZudokuConfig } from "../config/config.js";
14
14
  import { traverseSidebar } from "../lib/components/navigation/utils.js";
@@ -42,7 +42,7 @@ export const convertZudokuConfigToOptions = (
42
42
  },
43
43
  },
44
44
  },
45
- slotlets: config.slotlets,
45
+ slotlets: config.UNSAFE_slotlets,
46
46
  metadata: {
47
47
  favicon: "https://cdn.zudoku.dev/logos/favicon.svg",
48
48
  title: "%s - Zudoku",
@@ -60,7 +60,7 @@ export const convertZudokuConfigToOptions = (
60
60
  ...configuredApiPlugins,
61
61
  ...(configuredRedirectPlugin ? [configuredRedirectPlugin] : []),
62
62
  ...(configuredApiKeysPlugin ? [configuredApiKeysPlugin] : []),
63
- ...(config.customPages ? [customPagePlugin(config.customPages)] : []),
63
+ ...(configuredCustomPagesPlugin ? [configuredCustomPagesPlugin] : []),
64
64
  ...(configuredAuthProvider?.getAuthenticationPlugin
65
65
  ? [configuredAuthProvider.getAuthenticationPlugin()]
66
66
  : []),
@@ -9,7 +9,7 @@ const COLOR_MAP = {
9
9
  tip: "bg-green-600",
10
10
  caution: "bg-orange-500",
11
11
  danger: "bg-rose-500",
12
- };
12
+ } as const;
13
13
 
14
14
  export const Banner = () => {
15
15
  const { page } = useZudoku();
@@ -19,12 +19,22 @@ export const Banner = () => {
19
19
  return <style>{`:root { --banner-height: 0px; }`}</style>;
20
20
  }
21
21
 
22
+ const mappedColor =
23
+ page.banner.color && page.banner.color in COLOR_MAP
24
+ ? COLOR_MAP[page.banner.color as keyof typeof COLOR_MAP]
25
+ : !page.banner.color
26
+ ? "bg-primary"
27
+ : undefined;
28
+
29
+ const style = !mappedColor ? { backgroundColor: page.banner.color } : {};
30
+
22
31
  return (
23
32
  <div
24
33
  className={cn(
25
34
  "relative text-primary-foreground text-sm font-medium px-4 py-2 flex gap-2 items-center",
26
- page.banner.color ? COLOR_MAP[page.banner.color] : "bg-primary",
35
+ mappedColor,
27
36
  )}
37
+ style={style}
28
38
  >
29
39
  <div className="w-full">{page.banner.message}</div>
30
40
  {page.banner.dismissible && (
@@ -91,8 +91,8 @@ export const Header = memo(function HeaderInner() {
91
91
  </div>
92
92
  </Link>
93
93
  </div>
94
- <div className="grid grid-cols-2 md:grid-cols-[--sidecar-grid-cols] items-center gap-8">
95
- <div className="w-full justify-center flex">
94
+ <div className="grid grid-cols-1 lg:grid-cols-[--sidecar-grid-cols] items-center gap-8">
95
+ <div className="w-full justify-center hidden lg:flex">
96
96
  <Search />
97
97
  </div>
98
98
 
@@ -133,7 +133,9 @@ export const Header = memo(function HeaderInner() {
133
133
  </div>
134
134
  </div>
135
135
  </div>
136
+ <Slotlet name="top-navigation-before" />
136
137
  <TopNavigation />
138
+ <Slotlet name="top-navigation-after" />
137
139
  </div>
138
140
  </header>
139
141
  );
@@ -49,6 +49,7 @@ export const Layout = ({ children }: { children?: ReactNode }) => {
49
49
  </Helmet>
50
50
  <Slotlet name="layout-before-head" />
51
51
  <Header />
52
+ <Slotlet name="layout-after-head" />
52
53
 
53
54
  <div className="w-full max-w-screen-2xl mx-auto px-10 lg:px-12">
54
55
  <Suspense
@@ -10,6 +10,7 @@ import {
10
10
  DrawerTrigger,
11
11
  } from "../ui/Drawer.js";
12
12
  import { useZudoku } from "./context/ZudokuContext.js";
13
+ import { Search } from "./Search.js";
13
14
 
14
15
  export const MobileTopNavigation = () => {
15
16
  const { topNavigation } = useZudoku();
@@ -27,6 +28,9 @@ export const MobileTopNavigation = () => {
27
28
  <VisuallyHidden>
28
29
  <DrawerTitle>Navigation</DrawerTitle>
29
30
  </VisuallyHidden>
31
+ <div className="flex p-4">
32
+ <Search />
33
+ </div>
30
34
  <ul className="flex flex-col items-center gap-4 p-4">
31
35
  {topNavigation.map((item) => (
32
36
  <li key={item.label}>
@@ -39,7 +39,7 @@ export const Search = () => {
39
39
  <button
40
40
  type="button"
41
41
  onClick={() => setIsOpen(true)}
42
- className="flex items-center border border-input hover:bg-accent hover:text-accent-foreground p-4 relative h-8 justify-start rounded-lg bg-background text-sm text-muted-foreground shadow-none w-40 sm:w-72"
42
+ className="flex items-center border border-input hover:bg-accent hover:text-accent-foreground p-4 relative h-8 justify-start rounded-lg bg-background text-sm text-muted-foreground shadow-none w-full sm:w-72"
43
43
  >
44
44
  <div className="flex items-center gap-2 flex-grow">
45
45
  <SearchIcon size={14} />
@@ -1,6 +1,21 @@
1
- import React, { type ReactElement, ReactNode, useContext } from "react";
1
+ import React, {
2
+ type ComponentType,
3
+ type ReactElement,
4
+ ReactNode,
5
+ useContext,
6
+ } from "react";
2
7
  import { isValidElementType } from "react-is";
3
- export type Slotlets = Record<string, ReactNode | ReactElement>;
8
+ import {
9
+ type Location,
10
+ type NavigateFunction,
11
+ type SetURLSearchParams,
12
+ } from "react-router-dom";
13
+ import { useExposedProps } from "../util/useExposedProps.js";
14
+
15
+ export type Slotlets = Record<
16
+ string,
17
+ ReactNode | ReactElement | ComponentType<ExposedComponentProps>
18
+ >;
4
19
 
5
20
  const SlotletContext = React.createContext<Slotlets | undefined>({});
6
21
 
@@ -18,13 +33,21 @@ export const SlotletProvider = ({
18
33
  );
19
34
  };
20
35
 
36
+ export type ExposedComponentProps = {
37
+ location: Location;
38
+ navigate: NavigateFunction;
39
+ searchParams: URLSearchParams;
40
+ setSearchParams: SetURLSearchParams;
41
+ };
42
+
21
43
  export const Slotlet = ({ name }: { name: string }) => {
22
44
  const context = useContext(SlotletContext);
23
45
  const componentOrElement = context?.[name];
46
+ const slotletProps = useExposedProps();
24
47
 
25
48
  if (isValidElementType(componentOrElement)) {
26
- return React.createElement(componentOrElement);
49
+ return React.createElement(componentOrElement, slotletProps);
27
50
  }
28
51
 
29
- return componentOrElement;
52
+ return componentOrElement as ReactNode;
30
53
  };
@@ -16,7 +16,7 @@ export const useMDXComponents = /*@__PURE__*/ useMDXComponentsImport;
16
16
  export const Callout = /*@__PURE__*/ CalloutImport;
17
17
  export const DevPortal = /*@__PURE__*/ DevPortalImport;
18
18
  export const Layout = /*@__PURE__*/ LayoutImport;
19
- export const Link = /*@__PURE__*/ LinkImport;
19
+ export const Link: typeof LinkImport = /*@__PURE__*/ LinkImport;
20
20
  export const RouterError = /*@__PURE__*/ RouterErrorImport;
21
21
  export const ServerError = /*@__PURE__*/ ServerErrorImport;
22
22
  export const Bootstrap = /*@__PURE__*/ BootstrapImport;
@@ -51,7 +51,7 @@ type Page = Partial<{
51
51
  };
52
52
  banner?: {
53
53
  message: ReactNode;
54
- color?: "note" | "tip" | "info" | "caution" | "danger";
54
+ color?: "note" | "tip" | "info" | "caution" | "danger" | (string & {});
55
55
  dismissible?: boolean;
56
56
  };
57
57
  }>;
@@ -58,9 +58,10 @@ export const createOperationSlug = (
58
58
  );
59
59
  };
60
60
 
61
- const cache = new LRUCache<string, Promise<OpenAPIDocument>>({
61
+ const cache = new LRUCache<string, OpenAPIDocument>({
62
62
  ttl: 60 * 10 * 1000,
63
63
  ttlAutopurge: true,
64
+ fetchMethod: (_key, _oldValue, { context }) => validate(context as string),
64
65
  });
65
66
 
66
67
  const builder = new SchemaBuilder<{
@@ -429,16 +430,7 @@ const Schema = builder.objectRef<OpenAPIDocument>("Schema").implement({
429
430
 
430
431
  const loadOpenAPISchema = async (input: NonNullable<unknown>) => {
431
432
  const hash = hashit(input);
432
-
433
- if (cache.has(hash)) {
434
- return cache.get(hash)!;
435
- }
436
-
437
- const schema = validate(input);
438
-
439
- cache.set(hash, schema);
440
-
441
- return schema;
433
+ return await cache.forceFetch(hash, { context: input });
442
434
  };
443
435
 
444
436
  const SchemaSource = builder.enumType("SchemaType", {
@@ -0,0 +1,15 @@
1
+ import React from "react";
2
+ import { cn } from "../../util/cn.js";
3
+ import { useExposedProps } from "../../util/useExposedProps.js";
4
+ import type { CustomPageConfig } from "./index.js";
5
+
6
+ export const CustomPage = ({
7
+ element,
8
+ render,
9
+ prose = true,
10
+ }: Omit<CustomPageConfig, "path">) => {
11
+ const slotletProps = useExposedProps();
12
+ const content = render ? React.createElement(render, slotletProps) : element;
13
+
14
+ return <div className={cn(prose && "prose max-w-full")}>{content}</div>;
15
+ };
@@ -0,0 +1,24 @@
1
+ import { type ComponentType, type ReactNode } from "react";
2
+ import type { RouteObject } from "react-router-dom";
3
+ import { type ExposedComponentProps } from "../../components/SlotletProvider.js";
4
+ import type { DevPortalPlugin, NavigationPlugin } from "../../core/plugins.js";
5
+ import { CustomPage } from "./CustomPage.js";
6
+
7
+ export type CustomPageConfig = {
8
+ path: string;
9
+ prose?: boolean;
10
+ element?: ReactNode;
11
+ render?: ComponentType<ExposedComponentProps>;
12
+ };
13
+
14
+ export const customPagesPlugin = (
15
+ config: CustomPageConfig[],
16
+ ): DevPortalPlugin & NavigationPlugin => {
17
+ return {
18
+ getRoutes: (): RouteObject[] =>
19
+ config.map(({ path, ...props }) => ({
20
+ path,
21
+ element: <CustomPage {...props} />,
22
+ })),
23
+ };
24
+ };
@@ -1,12 +1,12 @@
1
1
  import { CheckIcon, CopyIcon } from "lucide-react";
2
2
  import { useState, useTransition } from "react";
3
+ import { useQuery } from "urql";
3
4
  import { useSelectedServerStore } from "../../authentication/state.js";
4
5
  import { InlineCode } from "../../components/InlineCode.js";
5
6
  import { Button } from "../../ui/Button.js";
6
7
  import { useOasConfig } from "./context.js";
7
8
  import { graphql } from "./graphql/index.js";
8
9
  import { SimpleSelect } from "./SimpleSelect.js";
9
- import { useQuery } from "./util/urql.js";
10
10
 
11
11
  const ServersQuery = graphql(/* GraphQL */ `
12
12
  query ServersQuery($input: JSON!, $type: SchemaType!) {
@@ -1,4 +1,5 @@
1
1
  import { ResultOf } from "@graphql-typed-document-node/core";
2
+ import { useQuery } from "urql";
2
3
  import { CategoryHeading } from "../../components/CategoryHeading.js";
3
4
  import { DeveloperHint } from "../../components/DeveloperHint.js";
4
5
  import { ErrorPage } from "../../components/ErrorPage.js";
@@ -12,7 +13,6 @@ import { OperationListItem } from "./OperationListItem.js";
12
13
  import StaggeredRender from "./StaggeredRender.js";
13
14
  import { useOasConfig } from "./context.js";
14
15
  import { graphql } from "./graphql/index.js";
15
- import { useQuery } from "./util/urql.js";
16
16
 
17
17
  export const OperationsFragment = graphql(/* GraphQL */ `
18
18
  fragment OperationsFragment on OperationItem {
@@ -1,9 +1,8 @@
1
1
  import { Outlet } from "react-router-dom";
2
+ import { Provider, Client as UrqlClient } from "urql";
2
3
  import { OasConfigProvider } from "./context.js";
3
4
  import { OasPluginConfig } from "./interfaces.js";
4
5
 
5
- import { Provider, Client as UrqlClient } from "./util/urql.js";
6
-
7
6
  export function OpenApiRoute({
8
7
  config,
9
8
  client,
@@ -1,6 +1,7 @@
1
1
  import { HTTPSnippet } from "@zudoku/httpsnippet";
2
2
  import { Fragment, useMemo, useTransition } from "react";
3
3
  import { useSearchParams } from "react-router-dom";
4
+ import { useQuery } from "urql";
4
5
  import { useSelectedServerStore } from "../../authentication/state.js";
5
6
  import { TextColorMap } from "../../components/navigation/SidebarBadge.js";
6
7
  import { SyntaxHighlight } from "../../components/SyntaxHighlight.js";
@@ -16,7 +17,6 @@ import { ResponsesSidecarBox } from "./ResponsesSidecarBox.js";
16
17
  import * as SidecarBox from "./SidecarBox.js";
17
18
  import { SimpleSelect } from "./SimpleSelect.js";
18
19
  import { generateSchemaExample } from "./util/generateSchemaExample.js";
19
- import { useQuery } from "./util/urql.js";
20
20
 
21
21
  const getConverted = (snippet: HTTPSnippet, option: string) => {
22
22
  let converted;
@@ -1,10 +1,5 @@
1
1
  /* eslint-disable no-console */
2
- import {
3
- cacheExchange,
4
- Client,
5
- fetchExchange,
6
- mapExchange,
7
- } from "../util/urql.js";
2
+ import { cacheExchange, Client, fetchExchange, mapExchange } from "urql";
8
3
  import { createServer } from "./createServer.js";
9
4
  import { CreateClientFunction } from "./interfaces.js";
10
5
 
@@ -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