zudoku 0.0.0-eff6f9b → 0.0.0-f3858d6

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 (318) hide show
  1. package/cli.js +2 -2
  2. package/dist/app/entry.client.js +2 -2
  3. package/dist/app/entry.client.js.map +1 -1
  4. package/dist/app/entry.server.js +3 -0
  5. package/dist/app/entry.server.js.map +1 -1
  6. package/dist/app/main.d.ts +1 -0
  7. package/dist/app/main.js +9 -24
  8. package/dist/app/main.js.map +1 -1
  9. package/dist/app/standalone.js.map +1 -1
  10. package/dist/cli/common/machine-id/lib.js.map +1 -1
  11. package/dist/cli/common/outdated.js.map +1 -1
  12. package/dist/cli/common/utils/box.js.map +1 -1
  13. package/dist/cli/dev/handler.js +2 -2
  14. package/dist/cli/dev/handler.js.map +1 -1
  15. package/dist/config/config.d.ts +2 -1
  16. package/dist/config/validators/InputSidebarSchema.d.ts +2 -1
  17. package/dist/config/validators/SidebarSchema.d.ts +1 -1
  18. package/dist/config/validators/SidebarSchema.js +5 -9
  19. package/dist/config/validators/SidebarSchema.js.map +1 -1
  20. package/dist/config/validators/validate.d.ts +97 -30
  21. package/dist/config/validators/validate.js +10 -7
  22. package/dist/config/validators/validate.js.map +1 -1
  23. package/dist/index.d.ts +5 -1
  24. package/dist/index.js +1 -1
  25. package/dist/index.js.map +1 -1
  26. package/dist/lib/authentication/state.d.ts +16 -0
  27. package/dist/lib/authentication/state.js +5 -0
  28. package/dist/lib/authentication/state.js.map +1 -1
  29. package/dist/lib/components/Banner.js +7 -1
  30. package/dist/lib/components/Banner.js.map +1 -1
  31. package/dist/lib/components/ErrorPage.js +1 -2
  32. package/dist/lib/components/ErrorPage.js.map +1 -1
  33. package/dist/lib/components/Header.js +5 -1
  34. package/dist/lib/components/Header.js.map +1 -1
  35. package/dist/lib/components/InlineCode.d.ts +2 -1
  36. package/dist/lib/components/InlineCode.js +9 -1
  37. package/dist/lib/components/InlineCode.js.map +1 -1
  38. package/dist/lib/components/Layout.js +1 -1
  39. package/dist/lib/components/Layout.js.map +1 -1
  40. package/dist/lib/components/MobileTopNavigation.js +2 -1
  41. package/dist/lib/components/MobileTopNavigation.js.map +1 -1
  42. package/dist/lib/components/SlotletProvider.d.ts +5 -2
  43. package/dist/lib/components/SlotletProvider.js +6 -2
  44. package/dist/lib/components/SlotletProvider.js.map +1 -1
  45. package/dist/lib/components/TopNavigation.js +30 -5
  46. package/dist/lib/components/TopNavigation.js.map +1 -1
  47. package/dist/lib/components/context/ZudokuContext.d.ts +4 -9
  48. package/dist/lib/components/context/ZudokuContext.js +26 -20
  49. package/dist/lib/components/context/ZudokuContext.js.map +1 -1
  50. package/dist/lib/components/index.d.ts +2 -1
  51. package/dist/lib/components/index.js.map +1 -1
  52. package/dist/lib/components/navigation/Sidebar.js +3 -3
  53. package/dist/lib/components/navigation/Sidebar.js.map +1 -1
  54. package/dist/lib/components/navigation/SidebarCategory.js +1 -3
  55. package/dist/lib/components/navigation/SidebarCategory.js.map +1 -1
  56. package/dist/lib/components/navigation/SidebarItem.js +1 -3
  57. package/dist/lib/components/navigation/SidebarItem.js.map +1 -1
  58. package/dist/lib/components/navigation/utils.js +10 -14
  59. package/dist/lib/components/navigation/utils.js.map +1 -1
  60. package/dist/lib/core/DevPortalContext.d.ts +4 -7
  61. package/dist/lib/core/DevPortalContext.js.map +1 -1
  62. package/dist/lib/core/plugins.d.ts +1 -0
  63. package/dist/lib/core/plugins.js.map +1 -1
  64. package/dist/lib/oas/graphql/index.d.ts +2 -1
  65. package/dist/lib/oas/graphql/index.js +23 -15
  66. package/dist/lib/oas/graphql/index.js.map +1 -1
  67. package/dist/lib/oas/parser/index.d.ts +1 -0
  68. package/dist/lib/oas/parser/index.js.map +1 -1
  69. package/dist/lib/plugins/{custom-page → custom-pages}/index.d.ts +2 -2
  70. package/dist/lib/plugins/{custom-page → custom-pages}/index.js +1 -1
  71. package/dist/lib/plugins/custom-pages/index.js.map +1 -0
  72. package/dist/lib/plugins/markdown/MdxPage.js +2 -2
  73. package/dist/lib/plugins/markdown/MdxPage.js.map +1 -1
  74. package/dist/lib/plugins/markdown/index.d.ts +5 -6
  75. package/dist/lib/plugins/markdown/index.js +31 -3
  76. package/dist/lib/plugins/markdown/index.js.map +1 -1
  77. package/dist/lib/plugins/markdown/resolver.d.ts +38 -0
  78. package/dist/lib/plugins/markdown/resolver.js +75 -0
  79. package/dist/lib/plugins/markdown/resolver.js.map +1 -0
  80. package/dist/lib/plugins/openapi/Endpoint.d.ts +1 -3
  81. package/dist/lib/plugins/openapi/Endpoint.js +46 -8
  82. package/dist/lib/plugins/openapi/Endpoint.js.map +1 -1
  83. package/dist/lib/plugins/openapi/OperationList.js +2 -2
  84. package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
  85. package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.d.ts +2 -1
  86. package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.js +2 -2
  87. package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.js.map +1 -1
  88. package/dist/lib/plugins/openapi/RequestBodySidecarBox.js.map +1 -1
  89. package/dist/lib/plugins/openapi/Route.d.ts +1 -1
  90. package/dist/lib/plugins/openapi/Route.js +1 -1
  91. package/dist/lib/plugins/openapi/Route.js.map +1 -1
  92. package/dist/lib/plugins/openapi/Sidecar.js +15 -4
  93. package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
  94. package/dist/lib/plugins/openapi/SimpleSelect.d.ts +2 -1
  95. package/dist/lib/plugins/openapi/SimpleSelect.js +1 -1
  96. package/dist/lib/plugins/openapi/SimpleSelect.js.map +1 -1
  97. package/dist/lib/plugins/openapi/client/createMemoryClient.js +1 -1
  98. package/dist/lib/plugins/openapi/client/createMemoryClient.js.map +1 -1
  99. package/dist/lib/plugins/openapi/client/createWorkerClient.js +1 -1
  100. package/dist/lib/plugins/openapi/client/createWorkerClient.js.map +1 -1
  101. package/dist/lib/plugins/openapi/client/worker.js.map +1 -1
  102. package/dist/lib/plugins/openapi/graphql/gql.d.ts +10 -2
  103. package/dist/lib/plugins/openapi/graphql/gql.js +2 -1
  104. package/dist/lib/plugins/openapi/graphql/gql.js.map +1 -1
  105. package/dist/lib/plugins/openapi/graphql/graphql.d.ts +26 -0
  106. package/dist/lib/plugins/openapi/graphql/graphql.js +87 -0
  107. package/dist/lib/plugins/openapi/graphql/graphql.js.map +1 -1
  108. package/dist/lib/plugins/openapi/index.js +3 -2
  109. package/dist/lib/plugins/openapi/index.js.map +1 -1
  110. package/dist/lib/plugins/openapi/playground/Playground.d.ts +2 -1
  111. package/dist/lib/plugins/openapi/playground/Playground.js +13 -5
  112. package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
  113. package/dist/lib/plugins/openapi/playground/ResponseTab.js +1 -1
  114. package/dist/lib/plugins/openapi/playground/ResponseTab.js.map +1 -1
  115. package/dist/lib/plugins/openapi/playground/createUrl.js +3 -1
  116. package/dist/lib/plugins/openapi/playground/createUrl.js.map +1 -1
  117. package/dist/lib/ui/Callout.d.ts +36 -35
  118. package/dist/lib/ui/Callout.js.map +1 -1
  119. package/dist/lib/ui/Drawer.d.ts +8 -10
  120. package/dist/lib/ui/Drawer.js.map +1 -1
  121. package/dist/lib/util/useScrollToAnchor.js.map +1 -1
  122. package/dist/vite/build.js +7 -2
  123. package/dist/vite/build.js.map +1 -1
  124. package/dist/vite/config.d.ts +1 -1
  125. package/dist/vite/config.js +22 -16
  126. package/dist/vite/config.js.map +1 -1
  127. package/dist/vite/debug.d.ts +1 -0
  128. package/dist/vite/debug.js +10 -0
  129. package/dist/vite/debug.js.map +1 -0
  130. package/dist/vite/dev-server.d.ts +6 -1
  131. package/dist/vite/dev-server.js +14 -4
  132. package/dist/vite/dev-server.js.map +1 -1
  133. package/dist/vite/plugin-api.js +4 -7
  134. package/dist/vite/plugin-api.js.map +1 -1
  135. package/dist/vite/plugin-component.js +0 -1
  136. package/dist/vite/plugin-component.js.map +1 -1
  137. package/dist/vite/plugin-config-reload.js +9 -4
  138. package/dist/vite/plugin-config-reload.js.map +1 -1
  139. package/dist/vite/plugin-custom-pages.d.ts +4 -0
  140. package/dist/vite/plugin-custom-pages.js +30 -0
  141. package/dist/vite/plugin-custom-pages.js.map +1 -0
  142. package/dist/vite/plugin-docs.js +26 -26
  143. package/dist/vite/plugin-docs.js.map +1 -1
  144. package/dist/vite/plugin-frontmatter.d.ts +2 -0
  145. package/dist/vite/plugin-frontmatter.js +30 -0
  146. package/dist/vite/plugin-frontmatter.js.map +1 -0
  147. package/dist/vite/plugin-sidebar.js +19 -3
  148. package/dist/vite/plugin-sidebar.js.map +1 -1
  149. package/dist/vite/plugin.js +4 -2
  150. package/dist/vite/plugin.js.map +1 -1
  151. package/dist/vite/prerender.d.ts +5 -1
  152. package/dist/vite/prerender.js +6 -5
  153. package/dist/vite/prerender.js.map +1 -1
  154. package/lib/{utils-DtEHoAvg.js → AnchorLink-DovtSBJk.js} +214 -261
  155. package/lib/AnchorLink-DovtSBJk.js.map +1 -0
  156. package/lib/{AuthenticationPlugin-gtf8JS3V.js → AuthenticationPlugin-Cnqy9csQ.js} +3 -3
  157. package/lib/{AuthenticationPlugin-gtf8JS3V.js.map → AuthenticationPlugin-Cnqy9csQ.js.map} +1 -1
  158. package/lib/{CategoryHeading-XnFqN2lJ.js → CategoryHeading-C7VfgpFZ.js} +2 -2
  159. package/lib/{CategoryHeading-XnFqN2lJ.js.map → CategoryHeading-C7VfgpFZ.js.map} +1 -1
  160. package/lib/{DeveloperHint-FBb2uXJe.js → DeveloperHint-CNyuFROc.js} +2 -2
  161. package/lib/{DeveloperHint-FBb2uXJe.js.map → DeveloperHint-CNyuFROc.js.map} +1 -1
  162. package/lib/ErrorPage-CUz-Zzmx.js +16 -0
  163. package/lib/ErrorPage-CUz-Zzmx.js.map +1 -0
  164. package/lib/Input-x-t53FyR.js +2229 -0
  165. package/lib/Input-x-t53FyR.js.map +1 -0
  166. package/lib/{Markdown-B4aR03g6.js → Markdown-C-0TaxoY.js} +1448 -1286
  167. package/lib/Markdown-C-0TaxoY.js.map +1 -0
  168. package/lib/{MdxPage-BcftTg5g.js → MdxPage-C5I9c7R1.js} +19 -18
  169. package/lib/MdxPage-C5I9c7R1.js.map +1 -0
  170. package/lib/{OperationList-Da36LrGl.js → OperationList-qsBOguHS.js} +149 -108
  171. package/lib/OperationList-qsBOguHS.js.map +1 -0
  172. package/lib/{Route-CWj1ECzh.js → Route-DlKvXPAO.js} +3 -4
  173. package/lib/Route-DlKvXPAO.js.map +1 -0
  174. package/lib/SidebarBadge-DaA0-bFW.js +503 -0
  175. package/lib/SidebarBadge-DaA0-bFW.js.map +1 -0
  176. package/lib/{SlotletProvider-DJMaOUDs.js → SlotletProvider-BGEs7yyu.js} +28 -26
  177. package/lib/{SlotletProvider-DJMaOUDs.js.map → SlotletProvider-BGEs7yyu.js.map} +1 -1
  178. package/lib/ZudokuContext-DSipF8sq.js +1222 -0
  179. package/lib/ZudokuContext-DSipF8sq.js.map +1 -0
  180. package/lib/__vite-browser-external-BYRIRx8p.js +9 -0
  181. package/lib/__vite-browser-external-BYRIRx8p.js.map +1 -0
  182. package/lib/assets/{index-B9EWVYfo.js → index-B_Jk_Yzp.js} +968 -938
  183. package/lib/assets/index-B_Jk_Yzp.js.map +1 -0
  184. package/lib/assets/{worker-TYRbYl6N.js → worker-DaFlmuyf.js} +6549 -4277
  185. package/lib/assets/worker-DaFlmuyf.js.map +1 -0
  186. package/lib/{index-DIkaYL-l.js → index-BIl-R3aH.js} +1943 -1675
  187. package/lib/index-BIl-R3aH.js.map +1 -0
  188. package/lib/{index-B_9xr661.js → index-CKmSo0py.js} +3 -3
  189. package/lib/{index-B_9xr661.js.map → index-CKmSo0py.js.map} +1 -1
  190. package/lib/{index-CLd8ycZz.js → index-CkwDvuPt.js} +947 -917
  191. package/lib/index-CkwDvuPt.js.map +1 -0
  192. package/lib/index-D06ATMgg.js +2094 -0
  193. package/lib/index-D06ATMgg.js.map +1 -0
  194. package/lib/index-DJqnphbT.js +35 -0
  195. package/lib/index-DJqnphbT.js.map +1 -0
  196. package/lib/{index-BoXX7LeD.js → index-Dssw7Gff.js} +597 -544
  197. package/lib/index-Dssw7Gff.js.map +1 -0
  198. package/lib/{index-BG0g4WW0.js → index-SrtqdZ3j.js} +746 -736
  199. package/lib/index-SrtqdZ3j.js.map +1 -0
  200. package/lib/router-Oe6YmY6B.js +3024 -0
  201. package/lib/router-Oe6YmY6B.js.map +1 -0
  202. package/lib/state-CsuHT8ZO.js +183 -0
  203. package/lib/state-CsuHT8ZO.js.map +1 -0
  204. package/lib/urql-core-KJnLL26g.js +1455 -0
  205. package/lib/urql-core-KJnLL26g.js.map +1 -0
  206. package/lib/zudoku.auth-auth0.js +1 -1
  207. package/lib/zudoku.auth-clerk.js +2 -2
  208. package/lib/zudoku.auth-openid.js +363 -350
  209. package/lib/zudoku.auth-openid.js.map +1 -1
  210. package/lib/zudoku.components.js +1717 -1633
  211. package/lib/zudoku.components.js.map +1 -1
  212. package/lib/zudoku.openapi-worker.js +4485 -4283
  213. package/lib/zudoku.openapi-worker.js.map +1 -1
  214. package/lib/zudoku.plugin-api-keys.js +7 -7
  215. package/lib/{zudoku.plugin-custom-page.js → zudoku.plugin-custom-pages.js} +3 -3
  216. package/lib/zudoku.plugin-custom-pages.js.map +1 -0
  217. package/lib/zudoku.plugin-markdown.js +93 -27
  218. package/lib/zudoku.plugin-markdown.js.map +1 -1
  219. package/lib/zudoku.plugin-openapi.js +8 -8
  220. package/lib/zudoku.plugin-redirect.js +1 -1
  221. package/package.json +71 -69
  222. package/src/app/entry.client.tsx +4 -2
  223. package/src/app/entry.server.tsx +4 -0
  224. package/src/app/main.css +4 -0
  225. package/src/app/main.tsx +12 -28
  226. package/src/app/standalone.tsx +1 -1
  227. package/src/lib/authentication/state.ts +17 -0
  228. package/src/lib/components/Banner.tsx +12 -2
  229. package/src/lib/components/ErrorPage.tsx +0 -2
  230. package/src/lib/components/Header.tsx +13 -3
  231. package/src/lib/components/InlineCode.tsx +10 -0
  232. package/src/lib/components/Layout.tsx +2 -1
  233. package/src/lib/components/MobileTopNavigation.tsx +2 -0
  234. package/src/lib/components/SlotletProvider.tsx +20 -4
  235. package/src/lib/components/TopNavigation.tsx +58 -24
  236. package/src/lib/components/context/ZudokuContext.ts +28 -20
  237. package/src/lib/components/index.ts +1 -1
  238. package/src/lib/components/navigation/Sidebar.tsx +5 -5
  239. package/src/lib/components/navigation/SidebarCategory.tsx +1 -3
  240. package/src/lib/components/navigation/SidebarItem.tsx +1 -3
  241. package/src/lib/components/navigation/utils.ts +11 -16
  242. package/src/lib/core/DevPortalContext.ts +4 -3
  243. package/src/lib/core/plugins.ts +2 -0
  244. package/src/lib/oas/graphql/index.ts +35 -23
  245. package/src/lib/oas/parser/index.ts +1 -0
  246. package/src/lib/plugins/{custom-page → custom-pages}/index.tsx +3 -3
  247. package/src/lib/plugins/markdown/MdxPage.tsx +2 -2
  248. package/src/lib/plugins/markdown/index.tsx +49 -12
  249. package/src/lib/plugins/markdown/resolver.ts +92 -0
  250. package/src/lib/plugins/openapi/Endpoint.tsx +86 -22
  251. package/src/lib/plugins/openapi/OperationList.tsx +4 -2
  252. package/src/lib/plugins/openapi/PlaygroundDialogWrapper.tsx +3 -0
  253. package/src/lib/plugins/openapi/RequestBodySidecarBox.tsx +1 -1
  254. package/src/lib/plugins/openapi/Route.tsx +1 -2
  255. package/src/lib/plugins/openapi/Sidecar.tsx +19 -4
  256. package/src/lib/plugins/openapi/SimpleSelect.tsx +10 -2
  257. package/src/lib/plugins/openapi/client/createMemoryClient.ts +1 -6
  258. package/src/lib/plugins/openapi/client/createWorkerClient.ts +1 -6
  259. package/src/lib/plugins/openapi/client/worker.ts +2 -2
  260. package/src/lib/plugins/openapi/graphql/gql.ts +11 -3
  261. package/src/lib/plugins/openapi/graphql/graphql.ts +113 -1
  262. package/src/lib/plugins/openapi/index.tsx +4 -7
  263. package/src/lib/plugins/openapi/playground/Playground.tsx +39 -5
  264. package/src/lib/plugins/openapi/playground/ResponseTab.tsx +0 -1
  265. package/src/lib/plugins/openapi/playground/createUrl.ts +6 -1
  266. package/src/lib/ui/Callout.tsx +7 -6
  267. package/src/lib/ui/Drawer.tsx +38 -36
  268. package/src/lib/util/useScrollToAnchor.ts +1 -1
  269. package/dist/lib/plugins/custom-page/index.js.map +0 -1
  270. package/dist/lib/plugins/markdown/generateRoutes.d.ts +0 -3
  271. package/dist/lib/plugins/markdown/generateRoutes.js +0 -21
  272. package/dist/lib/plugins/markdown/generateRoutes.js.map +0 -1
  273. package/dist/lib/plugins/openapi/playground/Editor.d.ts +0 -1
  274. package/dist/lib/plugins/openapi/playground/Editor.js +0 -5
  275. package/dist/lib/plugins/openapi/playground/Editor.js.map +0 -1
  276. package/dist/lib/plugins/openapi/util/urql.d.ts +0 -7
  277. package/dist/lib/plugins/openapi/util/urql.js +0 -8
  278. package/dist/lib/plugins/openapi/util/urql.js.map +0 -1
  279. package/dist/lib/util/slugify.d.ts +0 -2
  280. package/dist/lib/util/slugify.js +0 -3
  281. package/dist/lib/util/slugify.js.map +0 -1
  282. package/dist/vite/plugin-icons.d.ts +0 -3
  283. package/dist/vite/plugin-icons.js +0 -47
  284. package/dist/vite/plugin-icons.js.map +0 -1
  285. package/lib/ErrorPage-knunPbKI.js +0 -18
  286. package/lib/ErrorPage-knunPbKI.js.map +0 -1
  287. package/lib/Input-B1kkVL1R.js +0 -2198
  288. package/lib/Input-B1kkVL1R.js.map +0 -1
  289. package/lib/Markdown-B4aR03g6.js.map +0 -1
  290. package/lib/MdxPage-BcftTg5g.js.map +0 -1
  291. package/lib/OperationList-Da36LrGl.js.map +0 -1
  292. package/lib/Route-CWj1ECzh.js.map +0 -1
  293. package/lib/SidebarBadge-DdvT2qep.js +0 -498
  294. package/lib/SidebarBadge-DdvT2qep.js.map +0 -1
  295. package/lib/ZudokuContext-em1gHkIY.js +0 -1084
  296. package/lib/ZudokuContext-em1gHkIY.js.map +0 -1
  297. package/lib/_commonjsHelpers-BkfeUUK-.js +0 -29
  298. package/lib/_commonjsHelpers-BkfeUUK-.js.map +0 -1
  299. package/lib/assets/index-B9EWVYfo.js.map +0 -1
  300. package/lib/assets/worker-TYRbYl6N.js.map +0 -1
  301. package/lib/index-BG0g4WW0.js.map +0 -1
  302. package/lib/index-BoXX7LeD.js.map +0 -1
  303. package/lib/index-CLd8ycZz.js.map +0 -1
  304. package/lib/index-DIkaYL-l.js.map +0 -1
  305. package/lib/router-D2p7Olpn.js +0 -2971
  306. package/lib/router-D2p7Olpn.js.map +0 -1
  307. package/lib/slugify-DbLhpSPt.js +0 -28
  308. package/lib/slugify-DbLhpSPt.js.map +0 -1
  309. package/lib/state-BUM4jc0J.js +0 -288
  310. package/lib/state-BUM4jc0J.js.map +0 -1
  311. package/lib/urql-YhcsXYy8.js +0 -1591
  312. package/lib/urql-YhcsXYy8.js.map +0 -1
  313. package/lib/utils-DtEHoAvg.js.map +0 -1
  314. package/lib/zudoku.plugin-custom-page.js.map +0 -1
  315. package/src/lib/plugins/markdown/generateRoutes.tsx +0 -38
  316. package/src/lib/plugins/openapi/playground/Editor.tsx +0 -4
  317. package/src/lib/plugins/openapi/util/urql.ts +0 -8
  318. package/src/lib/util/slugify.ts +0 -3
@@ -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-DJMaOUDs.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-B1kkVL1R.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-em1gHkIY.js";
6
- import { B as l, m as A } from "./index-BoXX7LeD.js";
7
- import { D as C } from "./DeveloperHint-FBb2uXJe.js";
2
+ import { S as x, R as f } from "./SlotletProvider-BGEs7yyu.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-x-t53FyR.js";
4
+ import { a as N, L as u, O as I } from "./index-SrtqdZ3j.js";
5
+ import { b as h, c as E, d as S } from "./ZudokuContext-DSipF8sq.js";
6
+ import { B as l, n as A } from "./index-Dssw7Gff.js";
7
+ import { D as C } from "./DeveloperHint-CNyuFROc.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-B4aR03g6.js";
10
+ import { a as T } from "./Markdown-C-0TaxoY.js";
11
11
  function c(t, s) {
12
12
  if (t)
13
13
  return;
@@ -1,5 +1,5 @@
1
1
  import { j as m } from "./jsx-runtime-B6kdoens.js";
2
- import { P as o } from "./Markdown-B4aR03g6.js";
2
+ import { P as o } from "./Markdown-C-0TaxoY.js";
3
3
  const l = (s) => ({
4
4
  getRoutes: () => s.map(({ path: e, element: t }) => ({
5
5
  path: e,
@@ -8,6 +8,6 @@ const l = (s) => ({
8
8
  }))
9
9
  });
10
10
  export {
11
- l as customPagePlugin
11
+ l as customPagesPlugin
12
12
  };
13
- //# sourceMappingURL=zudoku.plugin-custom-page.js.map
13
+ //# 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/index.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport type { RouteObject } from \"react-router-dom\";\nimport { ProseClasses } from \"../../components/Markdown.js\";\nimport type { DevPortalPlugin, NavigationPlugin } from \"../../core/plugins.js\";\n\ntype CustomPagesConfig = Array<{\n path: string;\n element: ReactNode;\n}>;\n\nexport const customPagesPlugin = (\n config: CustomPagesConfig,\n): DevPortalPlugin & NavigationPlugin => {\n return {\n getRoutes: (): RouteObject[] =>\n config.map(({ path, element }) => ({\n path,\n // TODO: we should componentize prose pages\n element: <div className={ProseClasses + \" max-w-full\"}>{element}</div>,\n })),\n };\n};\n"],"names":["customPagesPlugin","config","path","element","jsx","ProseClasses"],"mappings":";;AAUa,MAAAA,IAAoB,CAC/BC,OAEO;AAAA,EACL,WAAW,MACTA,EAAO,IAAI,CAAC,EAAE,MAAAC,GAAM,SAAAC,SAAe;AAAA,IACjC,MAAAD;AAAA;AAAA,IAEA,SAAUE,gBAAAA,EAAAA,IAAA,OAAA,EAAI,WAAWC,IAAe,eAAgB,UAAQF,GAAA;AAAA,EAAA,EAChE;AAAA;"}
@@ -1,32 +1,98 @@
1
- import { j as u } from "./jsx-runtime-B6kdoens.js";
2
- const x = (t, e, n) => Object.entries(t).flatMap(([a, p]) => {
3
- let o = e.split("**")[0];
4
- o = o.replace("/**", "/");
5
- const c = new RegExp(`^${o}(.*).mdx?`), r = a.match(c), s = r == null ? void 0 : r.at(1);
6
- return s ? {
7
- path: s,
8
- lazy: async () => {
9
- const { MdxPage: i } = await import("./MdxPage-BcftTg5g.js"), { default: m, ...l } = await p();
10
- return {
11
- element: /* @__PURE__ */ u.jsx(
12
- i,
13
- {
14
- mdxComponent: m,
15
- ...l,
16
- defaultOptions: n
1
+ var d = Object.defineProperty;
2
+ var m = (n, t, o) => t in n ? d(n, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : n[t] = o;
3
+ var f = (n, t, o) => m(n, typeof t != "symbol" ? t + "" : t, o);
4
+ import { j as P } from "./jsx-runtime-B6kdoens.js";
5
+ import { f as u } from "./__vite-browser-external-BYRIRx8p.js";
6
+ const x = "/pages/**/*.{md,mdx}", D = [".md", ".mdx"];
7
+ class c {
8
+ constructor(t) {
9
+ f(this, "fileMap", /* @__PURE__ */ new Map());
10
+ this.config = t;
11
+ }
12
+ /**
13
+ * Gets the default docs config from the zudoku config
14
+ */
15
+ getDocsConfigs() {
16
+ return this.config.docs ? Array.isArray(this.config.docs) ? this.config.docs : [this.config.docs] : [{ files: x }];
17
+ }
18
+ /**
19
+ * Resolves the first matching file system path for a given docId
20
+ * @param docId - The docId to resolve
21
+ * @returns
22
+ */
23
+ resolveFilePath(t) {
24
+ const o = this.getDocsConfigs();
25
+ let s;
26
+ return o.forEach(({ files: i }) => {
27
+ if (s)
28
+ return;
29
+ const e = c.getRootDir(i);
30
+ for (const a of D) {
31
+ if (s)
32
+ return;
33
+ const r = u.join(e, `${t}${a}`);
34
+ u.existsSync(r) && (s = r);
35
+ }
36
+ }), s;
37
+ }
38
+ /**
39
+ * Gets the root directory from a files glob
40
+ */
41
+ static getRootDir(t) {
42
+ let o = t.split("**")[0];
43
+ if (!o)
44
+ throw new Error("Invalid files glob. Must have '**' in the path.");
45
+ return o = o.replace("/**", "/"), o;
46
+ }
47
+ /**
48
+ * Resolves the route path for a given file system path
49
+ * @param options - The options to resolve the route path
50
+ * @returns The string route path
51
+ */
52
+ static resolveRoutePath({
53
+ filesGlob: t,
54
+ fsPath: o
55
+ }) {
56
+ const s = this.getRootDir(t), i = new RegExp(`^${s}(.*).mdx?`), e = o.match(i);
57
+ return e == null ? void 0 : e.at(1);
58
+ }
59
+ }
60
+ const C = (n) => ({
61
+ getRoutes: () => {
62
+ const t = /* @__PURE__ */ new Map();
63
+ return n.forEach(
64
+ ({ fileImports: o, files: s, defaultOptions: i }) => Object.entries(o).flatMap(([e, a]) => {
65
+ const r = c.resolveRoutePath({
66
+ filesGlob: s,
67
+ fsPath: e
68
+ });
69
+ if (!r) return [];
70
+ if (t.has(r))
71
+ return console.warn(
72
+ `Duplicate route path found for ${r}. Skipping file at '${e}'.`
73
+ ), [];
74
+ const h = {
75
+ path: r,
76
+ lazy: async () => {
77
+ const { MdxPage: l } = await import("./MdxPage-C5I9c7R1.js"), { default: p, ...g } = await a();
78
+ return {
79
+ element: /* @__PURE__ */ P.jsx(
80
+ l,
81
+ {
82
+ mdxComponent: p,
83
+ ...g,
84
+ defaultOptions: i
85
+ }
86
+ )
87
+ };
17
88
  }
18
- )
19
- };
20
- }
21
- } : [];
22
- }), f = ({
23
- markdownFiles: t,
24
- defaultOptions: e,
25
- filesPath: n
26
- }) => ({
27
- getRoutes: () => x(t, n, e)
89
+ };
90
+ t.set(r, h);
91
+ })
92
+ ), [...t.values()];
93
+ }
28
94
  });
29
95
  export {
30
- f as markdownPlugin
96
+ C as markdownPlugin
31
97
  };
32
98
  //# sourceMappingURL=zudoku.plugin-markdown.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"zudoku.plugin-markdown.js","sources":["../src/lib/plugins/markdown/generateRoutes.tsx","../src/lib/plugins/markdown/index.tsx"],"sourcesContent":["import { type RouteObject } from \"react-router-dom\";\n\nimport {\n MarkdownPluginDefaultOptions,\n MarkdownPluginOptions,\n} from \"./index.js\";\n\nexport const generateRoutes = (\n markdownFiles: MarkdownPluginOptions[\"markdownFiles\"],\n filesPath: string,\n defaultOptions?: MarkdownPluginDefaultOptions,\n): RouteObject[] =>\n Object.entries(markdownFiles).flatMap(([file, importPromise]) => {\n let rootDir = filesPath.split(\"**\")[0];\n rootDir = rootDir.replace(\"/**\", \"/\");\n const re = new RegExp(`^${rootDir}(.*).mdx?`);\n const match = file.match(re);\n const fsPath = match?.at(1);\n\n if (!fsPath) return [];\n\n return {\n path: fsPath,\n lazy: async () => {\n const { MdxPage } = await import(\"./MdxPage.js\");\n const { default: Component, ...props } = await importPromise();\n return {\n element: (\n <MdxPage\n mdxComponent={Component}\n {...props}\n defaultOptions={defaultOptions}\n />\n ),\n };\n },\n } satisfies RouteObject;\n });\n","import type { Toc } from \"@stefanprobst/rehype-extract-toc\";\nimport type { MDXProps } from \"mdx/types.js\";\nimport type { DevPortalPlugin } from \"../../core/plugins.js\";\nimport { generateRoutes } from \"./generateRoutes.js\";\n\nexport type MarkdownPluginOptions = {\n markdownFiles: Record<string, () => Promise<MDXImport>>;\n defaultOptions?: MarkdownPluginDefaultOptions;\n filesPath: string;\n};\nexport type MarkdownPluginDefaultOptions = Pick<\n Frontmatter,\n \"toc\" | \"disablePager\"\n>;\n\nexport type Frontmatter = {\n title?: string;\n description?: string;\n category?: string;\n toc?: boolean;\n disablePager?: boolean;\n};\n\nexport type MDXImport = {\n tableOfContents: Toc;\n frontmatter: Frontmatter;\n default: (props: MDXProps) => JSX.Element;\n};\n\nexport const markdownPlugin = ({\n markdownFiles,\n defaultOptions,\n filesPath,\n}: MarkdownPluginOptions): DevPortalPlugin => ({\n getRoutes: () => generateRoutes(markdownFiles, filesPath, defaultOptions),\n});\n"],"names":["generateRoutes","markdownFiles","filesPath","defaultOptions","file","importPromise","rootDir","re","match","fsPath","MdxPage","Component","props","jsx","markdownPlugin"],"mappings":";AAOO,MAAMA,IAAiB,CAC5BC,GACAC,GACAC,MAEA,OAAO,QAAQF,CAAa,EAAE,QAAQ,CAAC,CAACG,GAAMC,CAAa,MAAM;AAC/D,MAAIC,IAAUJ,EAAU,MAAM,IAAI,EAAE,CAAC;AAC3B,EAAAI,IAAAA,EAAQ,QAAQ,OAAO,GAAG;AACpC,QAAMC,IAAK,IAAI,OAAO,IAAID,CAAO,WAAW,GACtCE,IAAQJ,EAAK,MAAMG,CAAE,GACrBE,IAASD,KAAA,gBAAAA,EAAO,GAAG;AAErB,SAACC,IAEE;AAAA,IACL,MAAMA;AAAA,IACN,MAAM,YAAY;AAChB,YAAM,EAAE,SAAAC,EAAA,IAAY,MAAM,OAAO,uBAAc,GACzC,EAAE,SAASC,GAAW,GAAGC,EAAM,IAAI,MAAMP;AACxC,aAAA;AAAA,QACL,SACEQ,gBAAAA,EAAA;AAAA,UAACH;AAAA,UAAA;AAAA,YACC,cAAcC;AAAA,YACb,GAAGC;AAAA,YACJ,gBAAAT;AAAA,UAAA;AAAA,QACF;AAAA,MAAA;AAAA,IAGN;AAAA,EAAA,IAhBkB;AAkBtB,CAAC,GCRUW,IAAiB,CAAC;AAAA,EAC7B,eAAAb;AAAA,EACA,gBAAAE;AAAA,EACA,WAAAD;AACF,OAA+C;AAAA,EAC7C,WAAW,MAAMF,EAAeC,GAAeC,GAAWC,CAAc;AAC1E;"}
1
+ {"version":3,"file":"zudoku.plugin-markdown.js","sources":["../src/lib/plugins/markdown/resolver.ts","../src/lib/plugins/markdown/index.tsx"],"sourcesContent":["import fs from \"fs\";\nimport path from \"path\";\nimport {\n ZudokuConfig,\n ZudokuDocsConfig,\n} from \"../../../config/validators/validate.js\";\n\nconst DEFAULT_DOCS_FILES = \"/pages/**/*.{md,mdx}\";\n\n// TODO: This should be dynamic based on the glob selector\nconst SUPPORTED_EXTENSIONS = [\".md\", \".mdx\"];\n\n/**\n * Utilities for resolving markdown file paths and routes\n */\nexport class DocResolver {\n constructor(private config: ZudokuConfig) {}\n\n fileMap = new Map<string, string>();\n\n /**\n * Gets the default docs config from the zudoku config\n */\n getDocsConfigs() {\n const docsConfigs: ZudokuDocsConfig[] = this.config.docs\n ? Array.isArray(this.config.docs)\n ? this.config.docs\n : [this.config.docs]\n : [{ files: DEFAULT_DOCS_FILES }];\n\n return docsConfigs;\n }\n\n /**\n * Resolves the first matching file system path for a given docId\n * @param docId - The docId to resolve\n * @returns\n */\n resolveFilePath(docId: string) {\n const docsConfigs = this.getDocsConfigs();\n let fsPath: string | undefined;\n\n docsConfigs.forEach(({ files: fileGlob }) => {\n if (fsPath) {\n return;\n }\n const rootDir = DocResolver.getRootDir(fileGlob);\n for (const ext of SUPPORTED_EXTENSIONS) {\n if (fsPath) {\n return;\n }\n const checkPath = path.join(rootDir, `${docId}${ext}`);\n if (fs.existsSync(checkPath)) {\n fsPath = checkPath;\n }\n }\n });\n\n return fsPath;\n }\n\n /**\n * Gets the root directory from a files glob\n */\n private static getRootDir(filesGlob: string) {\n let rootDir = filesGlob.split(\"**\")[0];\n if (!rootDir) {\n throw new Error(\"Invalid files glob. Must have '**' in the path.\");\n }\n rootDir = rootDir.replace(\"/**\", \"/\");\n return rootDir;\n }\n\n /**\n * Resolves the route path for a given file system path\n * @param options - The options to resolve the route path\n * @returns The string route path\n */\n static resolveRoutePath({\n filesGlob,\n fsPath,\n }: {\n filesGlob: string;\n fsPath: string;\n }) {\n const rootDir = this.getRootDir(filesGlob);\n const re = new RegExp(`^${rootDir}(.*).mdx?`);\n const match = fsPath.match(re);\n const routePath = match?.at(1);\n return routePath;\n }\n}\n","import type { Toc } from \"@stefanprobst/rehype-extract-toc\";\nimport type { MDXProps } from \"mdx/types.js\";\nimport { RouteObject } from \"react-router-dom\";\nimport { ZudokuDocsConfig } from \"../../../config/validators/validate.js\";\nimport type { DevPortalPlugin } from \"../../core/plugins.js\";\nimport { DocResolver } from \"./resolver.js\";\n\nexport interface MarkdownPluginOptions extends ZudokuDocsConfig {\n fileImports: Record<string, () => Promise<MDXImport>>;\n}\nexport type MarkdownPluginDefaultOptions = Pick<\n Frontmatter,\n \"toc\" | \"disablePager\"\n>;\n\nexport type Frontmatter = {\n title?: string;\n description?: string;\n category?: string;\n toc?: boolean;\n disablePager?: boolean;\n};\n\nexport type MDXImport = {\n tableOfContents: Toc;\n frontmatter: Frontmatter;\n default: (props: MDXProps) => JSX.Element;\n};\n\nexport const markdownPlugin = (\n options: MarkdownPluginOptions[],\n): DevPortalPlugin => ({\n getRoutes: () => {\n const routeMap = new Map<string, RouteObject>();\n options.forEach(({ fileImports, files, defaultOptions }) =>\n Object.entries(fileImports).flatMap(([file, importPromise]) => {\n const routePath = DocResolver.resolveRoutePath({\n filesGlob: files,\n fsPath: file,\n });\n\n if (!routePath) return [];\n\n if (routeMap.has(routePath)) {\n // eslint-disable-next-line no-console\n console.warn(\n `Duplicate route path found for ${routePath}. Skipping file at '${file}'.`,\n );\n return [];\n }\n\n const route: RouteObject = {\n path: routePath,\n lazy: async () => {\n const { MdxPage } = await import(\"./MdxPage.js\");\n const { default: Component, ...props } = await importPromise();\n return {\n element: (\n <MdxPage\n mdxComponent={Component}\n {...props}\n defaultOptions={defaultOptions}\n />\n ),\n };\n },\n };\n routeMap.set(routePath, route);\n }),\n );\n return [...routeMap.values()];\n },\n});\n"],"names":["DEFAULT_DOCS_FILES","SUPPORTED_EXTENSIONS","DocResolver","config","__publicField","docId","docsConfigs","fsPath","fileGlob","rootDir","ext","checkPath","path","fs","filesGlob","re","match","markdownPlugin","options","routeMap","fileImports","files","defaultOptions","file","importPromise","routePath","route","MdxPage","Component","props","jsx"],"mappings":";;;;;AAOA,MAAMA,IAAqB,wBAGrBC,IAAuB,CAAC,OAAO,MAAM;AAKpC,MAAMC,EAAY;AAAA,EACvB,YAAoBC,GAAsB;AAE1C,IAAAC,EAAA,qCAAc;AAFM,SAAA,SAAAD;AAAA,EAAuB;AAAA;AAAA;AAAA;AAAA,EAO3C,iBAAiB;AAOR,WANiC,KAAK,OAAO,OAChD,MAAM,QAAQ,KAAK,OAAO,IAAI,IAC5B,KAAK,OAAO,OACZ,CAAC,KAAK,OAAO,IAAI,IACnB,CAAC,EAAE,OAAOH,EAAA,CAAoB;AAAA,EAGpC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,gBAAgBK,GAAe;AACvB,UAAAC,IAAc,KAAK;AACrB,QAAAC;AAEJ,WAAAD,EAAY,QAAQ,CAAC,EAAE,OAAOE,QAAe;AAC3C,UAAID;AACF;AAEI,YAAAE,IAAUP,EAAY,WAAWM,CAAQ;AAC/C,iBAAWE,KAAOT,GAAsB;AACtC,YAAIM;AACF;AAEI,cAAAI,IAAYC,EAAK,KAAKH,GAAS,GAAGJ,CAAK,GAAGK,CAAG,EAAE;AACjD,QAAAG,EAAG,WAAWF,CAAS,MAChBJ,IAAAI;AAAA,MAEb;AAAA,IAAA,CACD,GAEMJ;AAAA,EACT;AAAA;AAAA;AAAA;AAAA,EAKA,OAAe,WAAWO,GAAmB;AAC3C,QAAIL,IAAUK,EAAU,MAAM,IAAI,EAAE,CAAC;AACrC,QAAI,CAACL;AACG,YAAA,IAAI,MAAM,iDAAiD;AAEzD,WAAAA,IAAAA,EAAQ,QAAQ,OAAO,GAAG,GAC7BA;AAAA,EACT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,OAAO,iBAAiB;AAAA,IACtB,WAAAK;AAAA,IACA,QAAAP;AAAA,EAAA,GAIC;AACK,UAAAE,IAAU,KAAK,WAAWK,CAAS,GACnCC,IAAK,IAAI,OAAO,IAAIN,CAAO,WAAW,GACtCO,IAAQT,EAAO,MAAMQ,CAAE;AAEtB,WADWC,KAAA,gBAAAA,EAAO,GAAG;AAAA,EAE9B;AACF;AC9Da,MAAAC,IAAiB,CAC5BC,OACqB;AAAA,EACrB,WAAW,MAAM;AACT,UAAAC,wBAAe;AACb,WAAAD,EAAA;AAAA,MAAQ,CAAC,EAAE,aAAAE,GAAa,OAAAC,GAAO,gBAAAC,QACrC,OAAO,QAAQF,CAAW,EAAE,QAAQ,CAAC,CAACG,GAAMC,CAAa,MAAM;AACvD,cAAAC,IAAYvB,EAAY,iBAAiB;AAAA,UAC7C,WAAWmB;AAAA,UACX,QAAQE;AAAA,QAAA,CACT;AAEG,YAAA,CAACE,EAAW,QAAO;AAEnB,YAAAN,EAAS,IAAIM,CAAS;AAEhB,yBAAA;AAAA,YACN,kCAAkCA,CAAS,uBAAuBF,CAAI;AAAA,UAAA,GAEjE;AAGT,cAAMG,IAAqB;AAAA,UACzB,MAAMD;AAAA,UACN,MAAM,YAAY;AAChB,kBAAM,EAAE,SAAAE,EAAA,IAAY,MAAM,OAAO,uBAAc,GACzC,EAAE,SAASC,GAAW,GAAGC,EAAM,IAAI,MAAML;AACxC,mBAAA;AAAA,cACL,SACEM,gBAAAA,EAAA;AAAA,gBAACH;AAAA,gBAAA;AAAA,kBACC,cAAcC;AAAA,kBACb,GAAGC;AAAA,kBACJ,gBAAAP;AAAA,gBAAA;AAAA,cACF;AAAA,YAAA;AAAA,UAGN;AAAA,QAAA;AAEO,QAAAH,EAAA,IAAIM,GAAWC,CAAK;AAAA,MAAA,CAC9B;AAAA,IAAA,GAEI,CAAC,GAAGP,EAAS,OAAA,CAAQ;AAAA,EAC9B;AACF;"}
@@ -1,14 +1,14 @@
1
1
  import "./jsx-runtime-B6kdoens.js";
2
- import { o as s } from "./index-DIkaYL-l.js";
3
- import "./urql-YhcsXYy8.js";
4
- import "./ZudokuContext-em1gHkIY.js";
2
+ import { o as s } from "./index-BIl-R3aH.js";
3
+ import "./ZudokuContext-DSipF8sq.js";
5
4
  import "lucide-react";
6
5
  import "zudoku/openapi-worker";
7
- import "./index-BoXX7LeD.js";
8
- import "./ErrorPage-knunPbKI.js";
9
- import "./Markdown-B4aR03g6.js";
10
- import "./router-D2p7Olpn.js";
11
- import "./index-BG0g4WW0.js";
6
+ import "./index-Dssw7Gff.js";
7
+ import "./ErrorPage-CUz-Zzmx.js";
8
+ import "./Markdown-C-0TaxoY.js";
9
+ import "./urql-core-KJnLL26g.js";
10
+ import "./router-Oe6YmY6B.js";
11
+ import "./index-SrtqdZ3j.js";
12
12
  export {
13
13
  s as openApiPlugin
14
14
  };
@@ -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,7 +1,16 @@
1
1
  {
2
2
  "name": "zudoku",
3
- "version": "0.0.0-eff6f9b",
3
+ "version": "0.0.0-f3858d6",
4
4
  "type": "module",
5
+ "homepage": "https://zudoku.dev",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/zuplo/zudoku.git"
9
+ },
10
+ "bugs": {
11
+ "url": "https://github.com/zuplo/zudoku/issues"
12
+ },
13
+ "description": "Framework for building high quality, interactive API documentation.",
5
14
  "files": [
6
15
  "dist",
7
16
  "lib",
@@ -52,9 +61,9 @@
52
61
  "import": "./lib/zudoku.plugin-redirect.js",
53
62
  "types": "./dist/lib/plugins/redirect/index.d.ts"
54
63
  },
55
- "./plugins/custom-page": {
56
- "import": "./lib/zudoku.plugin-custom-page.js",
57
- "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"
58
67
  },
59
68
  "./plugins/search-inkeep": {
60
69
  "import": "./lib/zudoku.plugin-search-inkeep.js",
@@ -89,53 +98,58 @@
89
98
  }
90
99
  },
91
100
  "dependencies": {
92
- "@envelop/core": "5.0.1",
101
+ "@envelop/core": "5.0.2",
93
102
  "@graphql-typed-document-node/core": "3.2.0",
94
103
  "@hiogawa/vite-plugin-ssr-css": "0.0.1",
95
104
  "@lekoarts/rehype-meta-as-attributes": "3.0.1",
96
105
  "@mdx-js/react": "3.0.1",
97
106
  "@mdx-js/rollup": "3.0.1",
98
- "@monaco-editor/react": "^4.6.0",
99
107
  "@pothos/core": "3.41.0",
100
- "@radix-ui/react-collapsible": "1.1.0",
101
- "@radix-ui/react-dropdown-menu": "^2.1.1",
102
- "@radix-ui/react-select": "2.1.1",
103
- "@radix-ui/react-visually-hidden": "1.1.0",
104
- "@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",
116
+ "@sindresorhus/slugify": "2.2.1",
105
117
  "@stefanprobst/rehype-extract-toc": "2.2.0",
106
- "@tailwindcss/typography": "0.5.13",
107
- "@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",
108
122
  "@vitejs/plugin-react": "4.3.1",
123
+ "@zudoku/httpsnippet": "10.0.9",
109
124
  "@zudoku/react-helmet-async": "2.0.4",
110
- "autoprefixer": "10.4.19",
111
- "chokidar": "^3.6.0",
125
+ "autoprefixer": "10.4.20",
126
+ "chokidar": "3.6.0",
112
127
  "class-variance-authority": "0.7.0",
128
+ "clsx": "2.1.1",
113
129
  "dotenv": "16.4.5",
114
- "express": "4.19.2",
115
- "glob": "^11.0.0",
130
+ "express": "4.21.1",
131
+ "glob": "11.0.0",
116
132
  "graphql": "16.9.0",
117
133
  "graphql-type-json": "0.3.2",
118
- "graphql-yoga": "5.2.0",
119
- "gray-matter": "^4.0.3",
120
- "http-terminator": "^3.2.0",
121
- "loglevel": "^1.9.1",
122
- "lru-cache": "11.0.0",
123
- "lucide-react": "0.438.0",
124
- "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",
125
141
  "object-hash": "3.0.0",
126
142
  "openapi-types": "12.1.3",
127
- "picocolors": "^1.0.1",
128
- "postcss": "8.4.39",
129
- "posthog-node": "^4.1.1",
130
- "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",
131
147
  "prismjs": "1.29.0",
132
- "react": "18.3.1",
133
- "react-dom": "18.3.1",
134
- "react-error-boundary": "^4.0.13",
135
- "react-hook-form": "^7.52.1",
148
+ "react-error-boundary": "4.0.13",
149
+ "react-hook-form": "7.53.0",
136
150
  "react-is": "18.3.1",
137
151
  "react-markdown": "9.0.1",
138
- "react-router-dom": "6.25.1",
152
+ "react-router-dom": "6.27.0",
139
153
  "rehype-raw": "7.0.0",
140
154
  "rehype-slug": "6.0.0",
141
155
  "remark-comment": "1.0.0",
@@ -144,54 +158,42 @@
144
158
  "remark-frontmatter": "5.0.0",
145
159
  "remark-gfm": "4.0.0",
146
160
  "remark-mdx-frontmatter": "5.0.0",
147
- "rollup": "^4.21.2",
148
- "semver": "7.6.2",
149
- "sitemap": "^8.0.0",
150
- "slugify": "1.6.6",
161
+ "rollup": "4.24.0",
162
+ "semver": "7.6.3",
163
+ "sitemap": "8.0.0",
151
164
  "strip-ansi": "7.1.0",
152
- "tailwind-merge": "2.5.2",
153
- "tailwindcss": "3.4.4",
154
- "tsx": "4.19.0",
155
- "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",
156
169
  "unist-util-visit": "5.0.0",
157
170
  "urql": "4.1.0",
158
- "vaul": "0.9.2",
159
- "vite": "5.3.6",
160
- "yaml": "2.5.0",
171
+ "vaul": "1.1.0",
172
+ "vite": "5.4.9",
173
+ "yaml": "2.6.0",
161
174
  "yargs": "17.7.2",
162
175
  "zod": "3.23.8",
163
- "zod-validation-error": "3.3.1",
164
- "zustand": "4.5.5"
176
+ "zod-validation-error": "3.4.0",
177
+ "zustand": "5.0.0"
165
178
  },
166
179
  "devDependencies": {
167
- "@radix-ui/react-dialog": "1.1.1",
168
- "@radix-ui/react-slot": "1.1.0",
169
- "@radix-ui/react-tabs": "1.1.0",
170
- "@types/express": "^4.17.21",
171
- "@types/har-format": "^1.2.15",
180
+ "@types/express": "4.17.21",
181
+ "@types/har-format": "1.2.15",
172
182
  "@types/json-schema": "7.0.15",
173
183
  "@types/mdx": "2.0.13",
174
- "@types/node": "20.12.10",
175
- "@types/object-hash": "^3.0.6",
176
- "@types/react": "18.3.3",
177
- "@types/react-dom": "18.3.0",
184
+ "@types/node": "20.16.11",
185
+ "@types/object-hash": "3.0.6",
178
186
  "@types/react-is": "18.3.0",
179
- "@types/rollup": "^0.54.0",
180
- "@types/semver": "^7.5.8",
181
- "@types/yargs": "^17.0.32",
182
- "@zudoku/httpsnippet": "10.0.9",
183
- "clsx": "2.1.1",
184
- "oauth4webapi": "2.11.1",
185
- "prism-react-renderer": "2.3.1",
186
- "prismjs": "1.29.0",
187
- "react-markdown": "9.0.1",
188
- "react-router-dom": "6.25.1",
189
- "rollup-plugin-visualizer": "^5.12.0",
190
- "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"
191
193
  },
192
194
  "peerDependencies": {
193
- "react": ">18.0.0",
194
- "react-dom": ">18.0.0"
195
+ "react": ">=18",
196
+ "react-dom": ">=18"
195
197
  },
196
198
  "optionalDependencies": {
197
199
  "@clerk/clerk-js": "5.11.0",
@@ -20,8 +20,10 @@ if (root.childElementCount > 0) {
20
20
  }
21
21
 
22
22
  async function hydrateLazyRoutes(routes: RouteObject[]) {
23
- const path = window.location.pathname.slice(config.basePath?.length ?? 0);
24
- const lazyMatches = matchRoutes(routes, path)?.filter((m) => m.route.lazy);
23
+ const path = window.location.pathname;
24
+ const lazyMatches = matchRoutes(routes, path, config.basePath)?.filter(
25
+ (m) => m.route.lazy,
26
+ );
25
27
 
26
28
  if (lazyMatches?.length) {
27
29
  await Promise.all(
@@ -96,6 +96,10 @@ export const render = async ({
96
96
 
97
97
  const [htmlStart, htmlEnd] = template.split("<!--app-html-->");
98
98
 
99
+ if (!htmlStart) {
100
+ throw new Error("No <!--app-html--> found in template");
101
+ }
102
+
99
103
  response.write(
100
104
  htmlStart.replace(
101
105
  "<!--app-helmet-->",
package/src/app/main.css CHANGED
@@ -103,6 +103,10 @@
103
103
  @apply h-full overscroll-none;
104
104
  }
105
105
 
106
+ details summary {
107
+ @apply cursor-pointer;
108
+ }
109
+
106
110
  #root {
107
111
  @apply min-h-screen w-full;
108
112
  }
package/src/app/main.tsx CHANGED
@@ -1,19 +1,17 @@
1
- import { redirect, type RouteObject } from "react-router-dom";
1
+ import { 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
- import { traverseSidebar } from "../lib/components/navigation/utils.js";
15
14
  import type { ZudokuContextOptions } from "../lib/core/DevPortalContext.js";
16
- import { joinPath } from "../lib/util/joinPath.js";
17
15
 
18
16
  export const convertZudokuConfigToOptions = (
19
17
  config: ZudokuConfig,
@@ -42,7 +40,7 @@ export const convertZudokuConfigToOptions = (
42
40
  },
43
41
  },
44
42
  },
45
- slotlets: config.slotlets,
43
+ slotlets: config.UNSAFE_slotlets,
46
44
  metadata: {
47
45
  favicon: "https://cdn.zudoku.dev/logos/favicon.svg",
48
46
  title: "%s - Zudoku",
@@ -60,7 +58,7 @@ export const convertZudokuConfigToOptions = (
60
58
  ...configuredApiPlugins,
61
59
  ...(configuredRedirectPlugin ? [configuredRedirectPlugin] : []),
62
60
  ...(configuredApiKeysPlugin ? [configuredApiKeysPlugin] : []),
63
- ...(config.customPages ? [customPagePlugin(config.customPages)] : []),
61
+ ...(configuredCustomPagesPlugin ? [configuredCustomPagesPlugin] : []),
64
62
  ...(configuredAuthProvider?.getAuthenticationPlugin
65
63
  ? [configuredAuthProvider.getAuthenticationPlugin()]
66
64
  : []),
@@ -69,9 +67,7 @@ export const convertZudokuConfigToOptions = (
69
67
  };
70
68
  };
71
69
 
72
- export const getRoutesByConfig = (config: ZudokuConfig): RouteObject[] => {
73
- const options = convertZudokuConfigToOptions(config);
74
-
70
+ export const getRoutesByOptions = (options: ZudokuContextOptions) => {
75
71
  const allPlugins = [
76
72
  ...(options.plugins ? options.plugins : []),
77
73
  ...(options.authentication?.getAuthenticationPlugin
@@ -79,27 +75,8 @@ export const getRoutesByConfig = (config: ZudokuConfig): RouteObject[] => {
79
75
  : []),
80
76
  ];
81
77
 
82
- const topNavRedirects =
83
- options.topNavigation?.flatMap((topNavItem) => {
84
- if (!options.sidebars?.[topNavItem.id]) return [];
85
-
86
- const first =
87
- topNavItem.default ??
88
- traverseSidebar(options.sidebars[topNavItem.id], (item) => {
89
- if (item.type === "doc") return joinPath(topNavItem.id, item.id);
90
- });
91
-
92
- if (!first) return [];
93
-
94
- return {
95
- path: topNavItem.id,
96
- loader: () => redirect(joinPath(first)),
97
- } satisfies RouteObject;
98
- }) ?? [];
99
-
100
78
  const routes = allPlugins
101
79
  .flatMap((plugin) => (isNavigationPlugin(plugin) ? plugin.getRoutes() : []))
102
- .concat(topNavRedirects)
103
80
  .concat({
104
81
  path: "*",
105
82
  loader: () => {
@@ -107,6 +84,13 @@ export const getRoutesByConfig = (config: ZudokuConfig): RouteObject[] => {
107
84
  },
108
85
  });
109
86
 
87
+ return routes;
88
+ };
89
+
90
+ export const getRoutesByConfig = (config: ZudokuConfig): RouteObject[] => {
91
+ const options = convertZudokuConfigToOptions(config);
92
+ const routes = getRoutesByOptions(options);
93
+
110
94
  return [
111
95
  {
112
96
  element: (
@@ -16,7 +16,7 @@ if (!root) {
16
16
  themeToggle();
17
17
 
18
18
  const apiUrl = root.getAttribute("data-api-url");
19
- const pageTitle = document.getElementsByTagName("title")[0].innerText;
19
+ const pageTitle = document.getElementsByTagName("title")[0]!.innerText;
20
20
  const logoUrl = root.getAttribute("data-logo-url");
21
21
 
22
22
  // IMPORTANT: This component must not contain tailwind classes
@@ -1,4 +1,5 @@
1
1
  import { create } from "zustand";
2
+ import { persist } from "zustand/middleware";
2
3
 
3
4
  export const useAuthState = create<AuthState>(() => ({
4
5
  isPending: false,
@@ -19,3 +20,19 @@ export interface UserProfile {
19
20
  pictureUrl: string | undefined;
20
21
  [key: string]: string | boolean | undefined;
21
22
  }
23
+
24
+ interface SelectedServerState {
25
+ selectedServer?: string;
26
+ setSelectedServer: (newServer: string) => void;
27
+ }
28
+
29
+ export const useSelectedServerStore = create<SelectedServerState>()(
30
+ persist(
31
+ (set) => ({
32
+ selectedServer: undefined,
33
+ setSelectedServer: (newServer: string) =>
34
+ set({ selectedServer: newServer }),
35
+ }),
36
+ { name: "zudoku-selected-server" },
37
+ ),
38
+ );
@@ -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 && (
@@ -1,5 +1,4 @@
1
1
  import type { ReactNode } from "react";
2
- import { Link } from "react-router-dom";
3
2
  import { CategoryHeading } from "./CategoryHeading.js";
4
3
  import { Heading } from "./Heading.js";
5
4
  import { ProseClasses } from "./Markdown.js";
@@ -22,7 +21,6 @@ export const ErrorPage = ({
22
21
  </Heading>
23
22
  )}
24
23
  <p>{message}</p>
25
- <Link to="/">Go back home</Link>
26
24
  </div>
27
25
  );
28
26
  };