zudoku 0.0.0-feat-mermaid-component.c0baaa18 → 0.0.0-feat-navigation-at-property.z8cd07fa5

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 (648) hide show
  1. package/dist/app/main.d.ts +6 -6
  2. package/dist/app/main.js +1 -1
  3. package/dist/app/main.js.map +1 -1
  4. package/dist/app/sentry.js +1 -1
  5. package/dist/cli/common/version-check.js +12 -3
  6. package/dist/cli/common/version-check.js.map +1 -1
  7. package/dist/config/create-plugin.d.ts +2 -0
  8. package/dist/config/create-plugin.js +55 -0
  9. package/dist/config/create-plugin.js.map +1 -0
  10. package/dist/config/loader.js +3 -1
  11. package/dist/config/loader.js.map +1 -1
  12. package/dist/config/validators/BuildSchema.js +18 -3
  13. package/dist/config/validators/BuildSchema.js.map +1 -1
  14. package/dist/config/validators/InputNavigationSchema.d.ts +133 -45
  15. package/dist/config/validators/InputNavigationSchema.js +30 -0
  16. package/dist/config/validators/InputNavigationSchema.js.map +1 -1
  17. package/dist/config/validators/NavigationSchema.d.ts +18 -4
  18. package/dist/config/validators/NavigationSchema.js +15 -5
  19. package/dist/config/validators/NavigationSchema.js.map +1 -1
  20. package/dist/config/validators/ProtectedRoutesSchema.d.ts +1 -1
  21. package/dist/config/validators/validate.d.ts +102 -14
  22. package/dist/config/validators/validate.js +14 -4
  23. package/dist/config/validators/validate.js.map +1 -1
  24. package/dist/flat-config.d.ts +67 -32
  25. package/dist/index.d.ts +4 -2
  26. package/dist/index.js +3 -1
  27. package/dist/index.js.map +1 -1
  28. package/dist/lib/auth/issuer.js +1 -1
  29. package/dist/lib/auth/issuer.js.map +1 -1
  30. package/dist/lib/authentication/authentication.d.ts +3 -2
  31. package/dist/lib/authentication/components/CallbackHandler.js +1 -1
  32. package/dist/lib/authentication/components/CallbackHandler.js.map +1 -1
  33. package/dist/lib/authentication/components/SignIn.js +4 -2
  34. package/dist/lib/authentication/components/SignIn.js.map +1 -1
  35. package/dist/lib/authentication/components/SignUp.js +4 -2
  36. package/dist/lib/authentication/components/SignUp.js.map +1 -1
  37. package/dist/lib/authentication/hook.d.ts +2 -0
  38. package/dist/lib/authentication/hook.js +10 -0
  39. package/dist/lib/authentication/hook.js.map +1 -1
  40. package/dist/lib/authentication/providers/auth0.js +11 -7
  41. package/dist/lib/authentication/providers/auth0.js.map +1 -1
  42. package/dist/lib/authentication/providers/clerk.js +0 -22
  43. package/dist/lib/authentication/providers/clerk.js.map +1 -1
  44. package/dist/lib/authentication/providers/firebase.js +67 -9
  45. package/dist/lib/authentication/providers/firebase.js.map +1 -1
  46. package/dist/lib/authentication/providers/supabase.js +6 -15
  47. package/dist/lib/authentication/providers/supabase.js.map +1 -1
  48. package/dist/lib/authentication/ui/EmailVerificationUi.d.ts +4 -0
  49. package/dist/lib/authentication/ui/EmailVerificationUi.js +34 -0
  50. package/dist/lib/authentication/ui/EmailVerificationUi.js.map +1 -0
  51. package/dist/lib/authentication/ui/ZudokuAuthUi.d.ts +7 -2
  52. package/dist/lib/authentication/ui/ZudokuAuthUi.js +48 -12
  53. package/dist/lib/authentication/ui/ZudokuAuthUi.js.map +1 -1
  54. package/dist/lib/authentication/utils/relativeRedirectUrl.d.ts +1 -0
  55. package/dist/lib/authentication/utils/relativeRedirectUrl.js +8 -0
  56. package/dist/lib/authentication/utils/relativeRedirectUrl.js.map +1 -0
  57. package/dist/lib/components/Bootstrap.js +1 -2
  58. package/dist/lib/components/Bootstrap.js.map +1 -1
  59. package/dist/lib/components/Heading.d.ts +1 -1
  60. package/dist/lib/components/Mermaid.js +13 -3
  61. package/dist/lib/components/Mermaid.js.map +1 -1
  62. package/dist/lib/components/MobileTopNavigation.js +3 -2
  63. package/dist/lib/components/MobileTopNavigation.js.map +1 -1
  64. package/dist/lib/components/PagefindSearchMeta.d.ts +8 -0
  65. package/dist/lib/components/PagefindSearchMeta.js +7 -0
  66. package/dist/lib/components/PagefindSearchMeta.js.map +1 -0
  67. package/dist/lib/components/Pagination.js +2 -2
  68. package/dist/lib/components/Pagination.js.map +1 -1
  69. package/dist/lib/components/Slot.test.js +1 -1
  70. package/dist/lib/components/Slot.test.js.map +1 -1
  71. package/dist/lib/components/TopNavigation.d.ts +7 -1
  72. package/dist/lib/components/TopNavigation.js +8 -3
  73. package/dist/lib/components/TopNavigation.js.map +1 -1
  74. package/dist/lib/components/Zudoku.d.ts +4 -1
  75. package/dist/lib/components/Zudoku.js +5 -11
  76. package/dist/lib/components/Zudoku.js.map +1 -1
  77. package/dist/lib/components/context/ZudokuContext.d.ts +9 -4
  78. package/dist/lib/components/context/ZudokuContext.js +26 -8
  79. package/dist/lib/components/context/ZudokuContext.js.map +1 -1
  80. package/dist/lib/components/context/ZudokuProvider.js +1 -1
  81. package/dist/lib/components/context/ZudokuProvider.js.map +1 -1
  82. package/dist/lib/components/context/ZudokuReactContext.d.ts +11 -0
  83. package/dist/lib/components/context/ZudokuReactContext.js +4 -0
  84. package/dist/lib/components/context/ZudokuReactContext.js.map +1 -0
  85. package/dist/lib/components/index.d.ts +18 -69
  86. package/dist/lib/components/index.js +19 -32
  87. package/dist/lib/components/index.js.map +1 -1
  88. package/dist/lib/components/navigation/Navigation.js +4 -3
  89. package/dist/lib/components/navigation/Navigation.js.map +1 -1
  90. package/dist/lib/components/navigation/NavigationCategory.js +8 -0
  91. package/dist/lib/components/navigation/NavigationCategory.js.map +1 -1
  92. package/dist/lib/components/navigation/NavigationFilterContext.d.ts +8 -0
  93. package/dist/lib/components/navigation/NavigationFilterContext.js +12 -0
  94. package/dist/lib/components/navigation/NavigationFilterContext.js.map +1 -0
  95. package/dist/lib/components/navigation/NavigationFilterInput.d.ts +3 -0
  96. package/dist/lib/components/navigation/NavigationFilterInput.js +9 -0
  97. package/dist/lib/components/navigation/NavigationFilterInput.js.map +1 -0
  98. package/dist/lib/components/navigation/NavigationItem.js +13 -3
  99. package/dist/lib/components/navigation/NavigationItem.js.map +1 -1
  100. package/dist/lib/components/navigation/NavigationWrapper.js +1 -1
  101. package/dist/lib/components/navigation/NavigationWrapper.js.map +1 -1
  102. package/dist/lib/components/navigation/utils.d.ts +6 -1
  103. package/dist/lib/components/navigation/utils.js +26 -2
  104. package/dist/lib/components/navigation/utils.js.map +1 -1
  105. package/dist/lib/core/RouteGuard.js +12 -7
  106. package/dist/lib/core/RouteGuard.js.map +1 -1
  107. package/dist/lib/core/ZudokuContext.d.ts +2 -1
  108. package/dist/lib/core/ZudokuContext.js +3 -1
  109. package/dist/lib/core/ZudokuContext.js.map +1 -1
  110. package/dist/lib/core/__internal.d.ts +1 -0
  111. package/dist/lib/core/__internal.js +2 -0
  112. package/dist/lib/core/__internal.js.map +1 -1
  113. package/dist/lib/core/plugins.d.ts +18 -4
  114. package/dist/lib/core/plugins.js +1 -0
  115. package/dist/lib/core/plugins.js.map +1 -1
  116. package/dist/lib/core/react-query.d.ts +1 -0
  117. package/dist/lib/core/react-query.js +2 -0
  118. package/dist/lib/core/react-query.js.map +1 -0
  119. package/dist/lib/core/transform-config.d.ts +4 -0
  120. package/dist/lib/core/transform-config.js +42 -0
  121. package/dist/lib/core/transform-config.js.map +1 -0
  122. package/dist/lib/core/transform-config.test.d.ts +1 -0
  123. package/dist/lib/core/transform-config.test.js +83 -0
  124. package/dist/lib/core/transform-config.test.js.map +1 -0
  125. package/dist/lib/errors/ErrorAlert.js +1 -2
  126. package/dist/lib/errors/ErrorAlert.js.map +1 -1
  127. package/dist/lib/errors/ErrorMessage.d.ts +3 -0
  128. package/dist/lib/errors/ErrorMessage.js +16 -0
  129. package/dist/lib/errors/ErrorMessage.js.map +1 -0
  130. package/dist/lib/hooks/index.d.ts +7 -28
  131. package/dist/lib/hooks/index.js +7 -15
  132. package/dist/lib/hooks/index.js.map +1 -1
  133. package/dist/lib/hooks/useEvent.test.js +1 -1
  134. package/dist/lib/hooks/useEvent.test.js.map +1 -1
  135. package/dist/lib/navigation/pathMatcher.d.ts +8 -0
  136. package/dist/lib/navigation/pathMatcher.js +62 -0
  137. package/dist/lib/navigation/pathMatcher.js.map +1 -0
  138. package/dist/lib/navigation/pathMatcher.test.d.ts +1 -0
  139. package/dist/lib/navigation/pathMatcher.test.js +115 -0
  140. package/dist/lib/navigation/pathMatcher.test.js.map +1 -0
  141. package/dist/lib/navigation/positionItems.d.ts +10 -0
  142. package/dist/lib/navigation/positionItems.js +54 -0
  143. package/dist/lib/navigation/positionItems.js.map +1 -0
  144. package/dist/lib/navigation/positionItems.test.d.ts +1 -0
  145. package/dist/lib/navigation/positionItems.test.js +229 -0
  146. package/dist/lib/navigation/positionItems.test.js.map +1 -0
  147. package/dist/lib/oas/graphql/circular.d.ts +2 -0
  148. package/dist/lib/oas/graphql/circular.js +21 -16
  149. package/dist/lib/oas/graphql/circular.js.map +1 -1
  150. package/dist/lib/oas/graphql/circular.test.d.ts +1 -0
  151. package/dist/lib/oas/graphql/circular.test.js +183 -0
  152. package/dist/lib/oas/graphql/circular.test.js.map +1 -0
  153. package/dist/lib/oas/graphql/index.js +7 -3
  154. package/dist/lib/oas/graphql/index.js.map +1 -1
  155. package/dist/lib/oas/parser/index.d.ts +1 -0
  156. package/dist/lib/oas/parser/index.js +14 -5
  157. package/dist/lib/oas/parser/index.js.map +1 -1
  158. package/dist/lib/plugins/api-keys/SettingsApiKeys.js +9 -172
  159. package/dist/lib/plugins/api-keys/SettingsApiKeys.js.map +1 -1
  160. package/dist/lib/plugins/api-keys/index.d.ts +11 -4
  161. package/dist/lib/plugins/api-keys/index.js +36 -22
  162. package/dist/lib/plugins/api-keys/index.js.map +1 -1
  163. package/dist/lib/plugins/api-keys/settings/ApiKeyItem.d.ts +12 -0
  164. package/dist/lib/plugins/api-keys/settings/ApiKeyItem.js +133 -0
  165. package/dist/lib/plugins/api-keys/settings/ApiKeyItem.js.map +1 -0
  166. package/dist/lib/plugins/api-keys/settings/ApiKeyList.d.ts +4 -0
  167. package/dist/lib/plugins/api-keys/settings/ApiKeyList.js +33 -0
  168. package/dist/lib/plugins/api-keys/settings/ApiKeyList.js.map +1 -0
  169. package/dist/lib/plugins/api-keys/settings/RevealApiKey.d.ts +6 -0
  170. package/dist/lib/plugins/api-keys/settings/RevealApiKey.js +39 -0
  171. package/dist/lib/plugins/api-keys/settings/RevealApiKey.js.map +1 -0
  172. package/dist/lib/plugins/openapi/DownloadSchemaButton.d.ts +3 -0
  173. package/dist/lib/plugins/openapi/DownloadSchemaButton.js +47 -0
  174. package/dist/lib/plugins/openapi/DownloadSchemaButton.js.map +1 -0
  175. package/dist/lib/plugins/openapi/Endpoint.js +3 -6
  176. package/dist/lib/plugins/openapi/Endpoint.js.map +1 -1
  177. package/dist/lib/plugins/openapi/GeneratedExampleSidecarBox.js +1 -1
  178. package/dist/lib/plugins/openapi/OasProvider.js +26 -13
  179. package/dist/lib/plugins/openapi/OasProvider.js.map +1 -1
  180. package/dist/lib/plugins/openapi/OperationList.js +20 -10
  181. package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
  182. package/dist/lib/plugins/openapi/OperationListItem.js +2 -2
  183. package/dist/lib/plugins/openapi/OperationListItem.js.map +1 -1
  184. package/dist/lib/plugins/openapi/ParamInfos.js +1 -0
  185. package/dist/lib/plugins/openapi/ParamInfos.js.map +1 -1
  186. package/dist/lib/plugins/openapi/ParameterList.js +1 -1
  187. package/dist/lib/plugins/openapi/ParameterList.js.map +1 -1
  188. package/dist/lib/plugins/openapi/ResponsesSidecarBox.d.ts +2 -1
  189. package/dist/lib/plugins/openapi/ResponsesSidecarBox.js +4 -3
  190. package/dist/lib/plugins/openapi/ResponsesSidecarBox.js.map +1 -1
  191. package/dist/lib/plugins/openapi/SchemaList.js +2 -1
  192. package/dist/lib/plugins/openapi/SchemaList.js.map +1 -1
  193. package/dist/lib/plugins/openapi/Sidecar.js +12 -3
  194. package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
  195. package/dist/lib/plugins/openapi/index.js +11 -5
  196. package/dist/lib/plugins/openapi/index.js.map +1 -1
  197. package/dist/lib/plugins/openapi/interfaces.d.ts +19 -13
  198. package/dist/lib/plugins/openapi/playground/Playground.js +8 -4
  199. package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
  200. package/dist/lib/plugins/openapi/playground/fileUtils.d.ts +1 -0
  201. package/dist/lib/plugins/openapi/playground/fileUtils.js +3 -0
  202. package/dist/lib/plugins/openapi/playground/fileUtils.js.map +1 -1
  203. package/dist/lib/plugins/openapi/playground/result-panel/AudioPlayer.d.ts +6 -0
  204. package/dist/lib/plugins/openapi/playground/result-panel/AudioPlayer.js +20 -0
  205. package/dist/lib/plugins/openapi/playground/result-panel/AudioPlayer.js.map +1 -0
  206. package/dist/lib/plugins/openapi/playground/result-panel/ResponseTab.js +7 -2
  207. package/dist/lib/plugins/openapi/playground/result-panel/ResponseTab.js.map +1 -1
  208. package/dist/lib/plugins/openapi/schema/SchemaView.d.ts +1 -1
  209. package/dist/lib/plugins/openapi/schema/SchemaView.js +16 -7
  210. package/dist/lib/plugins/openapi/schema/SchemaView.js.map +1 -1
  211. package/dist/lib/plugins/openapi/schema/utils.d.ts +2 -2
  212. package/dist/lib/plugins/openapi/schema/utils.js +11 -3
  213. package/dist/lib/plugins/openapi/schema/utils.js.map +1 -1
  214. package/dist/lib/plugins/openapi/util/createHttpSnippet.js +24 -1
  215. package/dist/lib/plugins/openapi/util/createHttpSnippet.js.map +1 -1
  216. package/dist/lib/plugins/openapi/util/getRoutes.d.ts +9 -1
  217. package/dist/lib/plugins/openapi/util/getRoutes.js +30 -2
  218. package/dist/lib/plugins/openapi/util/getRoutes.js.map +1 -1
  219. package/dist/lib/plugins/search-pagefind/IndexingDialog.d.ts +3 -0
  220. package/dist/lib/plugins/search-pagefind/IndexingDialog.js +64 -0
  221. package/dist/lib/plugins/search-pagefind/IndexingDialog.js.map +1 -0
  222. package/dist/lib/plugins/search-pagefind/PagefindSearch.js +22 -5
  223. package/dist/lib/plugins/search-pagefind/PagefindSearch.js.map +1 -1
  224. package/dist/lib/plugins/search-pagefind/ResultList.js +5 -4
  225. package/dist/lib/plugins/search-pagefind/ResultList.js.map +1 -1
  226. package/dist/lib/shiki.d.ts +1 -1
  227. package/dist/lib/shiki.js +18 -12
  228. package/dist/lib/shiki.js.map +1 -1
  229. package/dist/lib/ui/Alert.d.ts +3 -2
  230. package/dist/lib/ui/Alert.js +9 -5
  231. package/dist/lib/ui/Alert.js.map +1 -1
  232. package/dist/lib/ui/Button.d.ts +2 -2
  233. package/dist/lib/ui/Button.js +10 -9
  234. package/dist/lib/ui/Button.js.map +1 -1
  235. package/dist/lib/ui/ButtonGroup.d.ts +11 -0
  236. package/dist/lib/ui/ButtonGroup.js +28 -0
  237. package/dist/lib/ui/ButtonGroup.js.map +1 -0
  238. package/dist/lib/ui/Command.d.ts +3 -3
  239. package/dist/lib/ui/Command.js +2 -2
  240. package/dist/lib/ui/Command.js.map +1 -1
  241. package/dist/lib/ui/DropdownMenu.d.ts +21 -23
  242. package/dist/lib/ui/DropdownMenu.js +47 -32
  243. package/dist/lib/ui/DropdownMenu.js.map +1 -1
  244. package/dist/lib/ui/InputGroup.d.ts +16 -0
  245. package/dist/lib/ui/InputGroup.js +65 -0
  246. package/dist/lib/ui/InputGroup.js.map +1 -0
  247. package/dist/lib/ui/Kbd.d.ts +3 -0
  248. package/dist/lib/ui/Kbd.js +10 -0
  249. package/dist/lib/ui/Kbd.js.map +1 -0
  250. package/dist/lib/ui/Secret.js +2 -2
  251. package/dist/lib/ui/Secret.js.map +1 -1
  252. package/dist/lib/util/flattenAllOf.d.ts +0 -2
  253. package/dist/lib/util/flattenAllOf.js +0 -23
  254. package/dist/lib/util/flattenAllOf.js.map +1 -1
  255. package/dist/lib/util/flattenAllOf.test.js +69 -13
  256. package/dist/lib/util/flattenAllOf.test.js.map +1 -1
  257. package/dist/lib/util/flattenAllOfProcessor.d.ts +2 -0
  258. package/dist/lib/util/flattenAllOfProcessor.js +48 -0
  259. package/dist/lib/util/flattenAllOfProcessor.js.map +1 -0
  260. package/dist/lib/util/invariant.d.ts +1 -1
  261. package/dist/lib/util/invariant.js +2 -2
  262. package/dist/lib/util/invariant.js.map +1 -1
  263. package/dist/lib/util/readFrontmatter.d.ts +6 -0
  264. package/dist/lib/util/readFrontmatter.js +13 -0
  265. package/dist/lib/util/readFrontmatter.js.map +1 -0
  266. package/dist/vite/api/SchemaManager.d.ts +17 -1
  267. package/dist/vite/api/SchemaManager.js +52 -11
  268. package/dist/vite/api/SchemaManager.js.map +1 -1
  269. package/dist/vite/api/SchemaManager.test.js +111 -0
  270. package/dist/vite/api/SchemaManager.test.js.map +1 -1
  271. package/dist/vite/build.js +91 -73
  272. package/dist/vite/build.js.map +1 -1
  273. package/dist/vite/config.js +16 -1
  274. package/dist/vite/config.js.map +1 -1
  275. package/dist/vite/dev-server.js +25 -0
  276. package/dist/vite/dev-server.js.map +1 -1
  277. package/dist/vite/error-handler.js +1 -5
  278. package/dist/vite/error-handler.js.map +1 -1
  279. package/dist/vite/mdx/remark-inject-filepath.js +5 -1
  280. package/dist/vite/mdx/remark-inject-filepath.js.map +1 -1
  281. package/dist/vite/mdx/remark-link-rewrite.js +4 -3
  282. package/dist/vite/mdx/remark-link-rewrite.js.map +1 -1
  283. package/dist/vite/pagefind-dev-index.d.ts +16 -0
  284. package/dist/vite/pagefind-dev-index.js +68 -0
  285. package/dist/vite/pagefind-dev-index.js.map +1 -0
  286. package/dist/vite/plugin-api-keys.js +5 -1
  287. package/dist/vite/plugin-api-keys.js.map +1 -1
  288. package/dist/vite/plugin-api.js +44 -4
  289. package/dist/vite/plugin-api.js.map +1 -1
  290. package/dist/vite/plugin-config.js +16 -4
  291. package/dist/vite/plugin-config.js.map +1 -1
  292. package/dist/vite/plugin-docs.js +9 -7
  293. package/dist/vite/plugin-docs.js.map +1 -1
  294. package/dist/vite/plugin-frontmatter.js +3 -5
  295. package/dist/vite/plugin-frontmatter.js.map +1 -1
  296. package/dist/vite/plugin-markdown-export.js +8 -7
  297. package/dist/vite/plugin-markdown-export.js.map +1 -1
  298. package/dist/vite/plugin-theme.js +2 -1
  299. package/dist/vite/plugin-theme.js.map +1 -1
  300. package/dist/vite/prerender/prerender.js +4 -20
  301. package/dist/vite/prerender/prerender.js.map +1 -1
  302. package/dist/vite/prerender/utils.d.ts +2 -0
  303. package/dist/vite/prerender/utils.js +30 -0
  304. package/dist/vite/prerender/utils.js.map +1 -0
  305. package/dist/vite/prerender/worker.js +6 -1
  306. package/dist/vite/prerender/worker.js.map +1 -1
  307. package/dist/vite/zuplo.d.ts +13 -0
  308. package/dist/vite/zuplo.js +15 -0
  309. package/dist/vite/zuplo.js.map +1 -0
  310. package/lib/ActionButton-B0CXL1Lq.js +25 -0
  311. package/lib/ActionButton-B0CXL1Lq.js.map +1 -0
  312. package/lib/Button-GUVe7pmt.js +54 -0
  313. package/lib/Button-GUVe7pmt.js.map +1 -0
  314. package/lib/{Card-KFniaZn5.js → Card-DCdq37aA.js} +2 -2
  315. package/lib/{Card-KFniaZn5.js.map → Card-DCdq37aA.js.map} +1 -1
  316. package/lib/ClaudeLogo-DoZ7fHHk.js +73 -0
  317. package/lib/ClaudeLogo-DoZ7fHHk.js.map +1 -0
  318. package/lib/{Command-CUcrW3qs.js → Command-N6VujV30.js} +26 -26
  319. package/lib/Command-N6VujV30.js.map +1 -0
  320. package/lib/{Dialog-BQciPiHN.js → Dialog-hlvmmQ_c.js} +2 -2
  321. package/lib/{Dialog-BQciPiHN.js.map → Dialog-hlvmmQ_c.js.map} +1 -1
  322. package/lib/{Drawer-Ci7XwhqT.js → Drawer-Ch7927PF.js} +7 -7
  323. package/lib/{Drawer-Ci7XwhqT.js.map → Drawer-Ch7927PF.js.map} +1 -1
  324. package/lib/DropdownMenu-DN0jNrjj.js +104 -0
  325. package/lib/DropdownMenu-DN0jNrjj.js.map +1 -0
  326. package/lib/Frame-DKlOmSkU.js +205 -0
  327. package/lib/Frame-DKlOmSkU.js.map +1 -0
  328. package/lib/HydrationBoundary-CJu4vUlG.js +601 -0
  329. package/lib/HydrationBoundary-CJu4vUlG.js.map +1 -0
  330. package/lib/IndexingDialog-D0YdGfbn.js +100 -0
  331. package/lib/IndexingDialog-D0YdGfbn.js.map +1 -0
  332. package/lib/Input-Cx-GeKoF.js +22 -0
  333. package/lib/Input-Cx-GeKoF.js.map +1 -0
  334. package/lib/MdxPage-Bc_5OsQ5.js +210 -0
  335. package/lib/MdxPage-Bc_5OsQ5.js.map +1 -0
  336. package/lib/Mermaid-Chx5BPHn.js +104 -0
  337. package/lib/Mermaid-Chx5BPHn.js.map +1 -0
  338. package/lib/{OAuthErrorPage-DMWRAojU.js → OAuthErrorPage-D-VcZ5cO.js} +26 -23
  339. package/lib/OAuthErrorPage-D-VcZ5cO.js.map +1 -0
  340. package/lib/OasProvider-CZqLHoRo.js +48 -0
  341. package/lib/OasProvider-CZqLHoRo.js.map +1 -0
  342. package/lib/{OperationList-DtF1IC-C.js → OperationList-BmV1XvEY.js} +2135 -2001
  343. package/lib/OperationList-BmV1XvEY.js.map +1 -0
  344. package/lib/RouteGuard-Dns7HD7C.js +77 -0
  345. package/lib/RouteGuard-Dns7HD7C.js.map +1 -0
  346. package/lib/{SchemaList-LalwoDIj.js → SchemaList-D23IyrX5.js} +28 -27
  347. package/lib/SchemaList-D23IyrX5.js.map +1 -0
  348. package/lib/SchemaView-DVbiGPo3.js +438 -0
  349. package/lib/SchemaView-DVbiGPo3.js.map +1 -0
  350. package/lib/Secret-CyhXSA8i.js +263 -0
  351. package/lib/Secret-CyhXSA8i.js.map +1 -0
  352. package/lib/SignUp-DfEe1w5X.js +55 -0
  353. package/lib/SignUp-DfEe1w5X.js.map +1 -0
  354. package/lib/{SyntaxHighlight-CwfFh-is.js → SyntaxHighlight-N2RffYNz.js} +1469 -1411
  355. package/lib/SyntaxHighlight-N2RffYNz.js.map +1 -0
  356. package/lib/{Toc-D_Ppanz9.js → Toc-Cpo_HSYx.js} +3 -3
  357. package/lib/{Toc-D_Ppanz9.js.map → Toc-Cpo_HSYx.js.map} +1 -1
  358. package/lib/{ErrorAlert-CrbMrCVu.js → Zudoku-GbutmWzP.js} +5667 -4488
  359. package/lib/Zudoku-GbutmWzP.js.map +1 -0
  360. package/lib/ZudokuContext-LPkD2SQs.js +250 -0
  361. package/lib/ZudokuContext-LPkD2SQs.js.map +1 -0
  362. package/lib/ZudokuReactContext-DGJAP1sN.js +222 -0
  363. package/lib/ZudokuReactContext-DGJAP1sN.js.map +1 -0
  364. package/lib/chunk-EPOLDU6W-C6C8jAwd.js +8558 -0
  365. package/lib/chunk-EPOLDU6W-C6C8jAwd.js.map +1 -0
  366. package/lib/{circular-CvJ_KSDG.js → circular-DfSpMuY7.js} +1689 -1686
  367. package/lib/{circular-CvJ_KSDG.js.map → circular-DfSpMuY7.js.map} +1 -1
  368. package/lib/{cn-dYga0KKN.js → cn-5-Gd1Dss.js} +531 -498
  369. package/lib/cn-5-Gd1Dss.js.map +1 -0
  370. package/lib/{createServer-ClOQMwLC.js → createServer-4kaAMuIM.js} +2476 -2458
  371. package/lib/createServer-4kaAMuIM.js.map +1 -0
  372. package/lib/createVariantComponent-Dc0vtOvr.js +18 -0
  373. package/lib/createVariantComponent-Dc0vtOvr.js.map +1 -0
  374. package/lib/{errors-DgL4mmha.js → errors-CtZTDEB6.js} +3 -3
  375. package/lib/{errors-DgL4mmha.js.map → errors-CtZTDEB6.js.map} +1 -1
  376. package/lib/firebase-D286uF4e.js +7615 -0
  377. package/lib/firebase-D286uF4e.js.map +1 -0
  378. package/lib/hook-DyEn6D2Q.js +53 -0
  379. package/lib/hook-DyEn6D2Q.js.map +1 -0
  380. package/lib/{index-D3Rf0-PX.js → index-B7bvsQHg.js} +879 -841
  381. package/lib/index-B7bvsQHg.js.map +1 -0
  382. package/lib/{index-K8lE07zQ.js → index-CVumYRba.js} +2 -2
  383. package/lib/{index-K8lE07zQ.js.map → index-CVumYRba.js.map} +1 -1
  384. package/lib/index-CrcNWbel.js.map +1 -1
  385. package/lib/index-DAWHN3cH.js +86 -0
  386. package/lib/index-DAWHN3cH.js.map +1 -0
  387. package/lib/index.esm-BYObtETB.js.map +1 -1
  388. package/lib/index.esm-BkpWrvLZ.js +34 -0
  389. package/lib/index.esm-BkpWrvLZ.js.map +1 -0
  390. package/lib/{index.esm-BnYHxCYC.js → index.esm-Ca5zvoff.js} +2 -2
  391. package/lib/{index.esm-BnYHxCYC.js.map → index.esm-Ca5zvoff.js.map} +1 -1
  392. package/lib/{invariant-Bm-FVUQE.js → invariant-B_t_F2s_.js} +4 -4
  393. package/lib/invariant-B_t_F2s_.js.map +1 -0
  394. package/lib/jsx-runtime-BzflLqGi.js.map +1 -1
  395. package/lib/{mutation-DICuPw5p.js → mutation-B7eFBLZY.js} +70 -44
  396. package/lib/mutation-B7eFBLZY.js.map +1 -0
  397. package/lib/ui/Accordion.js +1 -1
  398. package/lib/ui/ActionButton.js +2 -2
  399. package/lib/ui/Alert.js +32 -20
  400. package/lib/ui/Alert.js.map +1 -1
  401. package/lib/ui/AlertDialog.js +1 -1
  402. package/lib/ui/Badge.js +1 -1
  403. package/lib/ui/Breadcrumb.js +1 -1
  404. package/lib/ui/Button.js +27 -25
  405. package/lib/ui/Button.js.map +1 -1
  406. package/lib/ui/ButtonGroup.js +77 -0
  407. package/lib/ui/ButtonGroup.js.map +1 -0
  408. package/lib/ui/Callout.js +1 -1
  409. package/lib/ui/Card.js +1 -1
  410. package/lib/ui/Carousel.js +1 -1
  411. package/lib/ui/Carousel.js.map +1 -1
  412. package/lib/ui/Checkbox.js +1 -1
  413. package/lib/ui/CodeBlock.js +1 -1
  414. package/lib/ui/Command.js +5 -5
  415. package/lib/ui/Command.js.map +1 -1
  416. package/lib/ui/Dialog.js +1 -1
  417. package/lib/ui/Drawer.js +3 -3
  418. package/lib/ui/DropdownMenu.js +227 -140
  419. package/lib/ui/DropdownMenu.js.map +1 -1
  420. package/lib/ui/EmbeddedCodeBlock.js +1 -1
  421. package/lib/ui/Form.js +1 -1
  422. package/lib/ui/Frame.js +1 -1
  423. package/lib/ui/HoverCard.js +1 -1
  424. package/lib/ui/Input.js +1 -1
  425. package/lib/ui/InputGroup.js +155 -0
  426. package/lib/ui/InputGroup.js.map +1 -0
  427. package/lib/ui/Item.js +1 -1
  428. package/lib/ui/Kbd.js +32 -0
  429. package/lib/ui/Kbd.js.map +1 -0
  430. package/lib/ui/Label.js +1 -1
  431. package/lib/ui/NativeSelect.js +1 -1
  432. package/lib/ui/Pagination.js +1 -1
  433. package/lib/ui/Popover.js +1 -1
  434. package/lib/ui/Progress.js +1 -1
  435. package/lib/ui/RadioGroup.js +1 -1
  436. package/lib/ui/ScrollArea.js +1 -1
  437. package/lib/ui/Secret.js +3 -3
  438. package/lib/ui/Secret.js.map +1 -1
  439. package/lib/ui/Separator.js +1 -1
  440. package/lib/ui/Skeleton.js +1 -1
  441. package/lib/ui/Slider.js +1 -1
  442. package/lib/ui/Switch.js +1 -1
  443. package/lib/ui/SyntaxHighlight.js +3 -3
  444. package/lib/ui/Tabs.js +1 -1
  445. package/lib/ui/Textarea.js +1 -1
  446. package/lib/ui/Toggle.js +1 -1
  447. package/lib/ui/ToggleGroup.js +1 -1
  448. package/lib/ui/Value.js +1 -1
  449. package/lib/ui/util.js +1 -1
  450. package/lib/useExposedProps-CzTDfXfq.js +30 -0
  451. package/lib/useExposedProps-CzTDfXfq.js.map +1 -0
  452. package/lib/useMutation-CErliDZ9.js +119 -0
  453. package/lib/useMutation-CErliDZ9.js.map +1 -0
  454. package/lib/useQuery-ht7aWJ3S.js +1212 -0
  455. package/lib/useQuery-ht7aWJ3S.js.map +1 -0
  456. package/lib/useSuspenseQuery-DQH4Bmc2.js +18 -0
  457. package/lib/useSuspenseQuery-DQH4Bmc2.js.map +1 -0
  458. package/lib/zudoku.__internal.js +1540 -1553
  459. package/lib/zudoku.__internal.js.map +1 -1
  460. package/lib/zudoku.auth-auth0.js +17 -16
  461. package/lib/zudoku.auth-auth0.js.map +1 -1
  462. package/lib/zudoku.auth-azureb2c.js +14 -13
  463. package/lib/zudoku.auth-azureb2c.js.map +1 -1
  464. package/lib/zudoku.auth-clerk.js +52 -75
  465. package/lib/zudoku.auth-clerk.js.map +1 -1
  466. package/lib/zudoku.auth-firebase.js +10 -0
  467. package/lib/zudoku.auth-firebase.js.map +1 -0
  468. package/lib/zudoku.auth-openid.js +8 -7
  469. package/lib/zudoku.auth-openid.js.map +1 -1
  470. package/lib/zudoku.auth-supabase.js +31 -40
  471. package/lib/zudoku.auth-supabase.js.map +1 -1
  472. package/lib/zudoku.components.js +29 -25
  473. package/lib/zudoku.components.js.map +1 -1
  474. package/lib/zudoku.hooks.js +24 -11
  475. package/lib/zudoku.hooks.js.map +1 -1
  476. package/lib/zudoku.mermaid.js +5 -4
  477. package/lib/zudoku.mermaid.js.map +1 -1
  478. package/lib/zudoku.plugin-api-catalog.js +42 -37
  479. package/lib/zudoku.plugin-api-catalog.js.map +1 -1
  480. package/lib/zudoku.plugin-api-keys.js +617 -551
  481. package/lib/zudoku.plugin-api-keys.js.map +1 -1
  482. package/lib/zudoku.plugin-custom-pages.js +1 -1
  483. package/lib/zudoku.plugin-markdown.js +1 -1
  484. package/lib/zudoku.plugin-openapi.js +3 -3
  485. package/lib/zudoku.plugin-redirect.js +1 -1
  486. package/lib/zudoku.plugin-search-pagefind.js +186 -226
  487. package/lib/zudoku.plugin-search-pagefind.js.map +1 -1
  488. package/lib/zudoku.plugins.js +9 -8
  489. package/lib/zudoku.plugins.js.map +1 -1
  490. package/lib/zudoku.react-query.js +441 -0
  491. package/lib/zudoku.react-query.js.map +1 -0
  492. package/lib/zudoku.router.js +1130 -1404
  493. package/lib/zudoku.router.js.map +1 -1
  494. package/package.json +53 -35
  495. package/src/app/defaultTheme.css +4 -0
  496. package/src/app/main.css +2 -0
  497. package/src/app/main.tsx +1 -1
  498. package/src/app/sentry.ts +1 -1
  499. package/src/lib/auth/issuer.ts +1 -1
  500. package/src/lib/authentication/authentication.ts +8 -2
  501. package/src/lib/authentication/components/CallbackHandler.tsx +1 -1
  502. package/src/lib/authentication/components/SignIn.tsx +5 -2
  503. package/src/lib/authentication/components/SignUp.tsx +5 -2
  504. package/src/lib/authentication/hook.ts +16 -0
  505. package/src/lib/authentication/providers/auth0.tsx +15 -9
  506. package/src/lib/authentication/providers/clerk.tsx +0 -26
  507. package/src/lib/authentication/providers/firebase.tsx +98 -6
  508. package/src/lib/authentication/providers/supabase.tsx +6 -15
  509. package/src/lib/authentication/ui/EmailVerificationUi.tsx +129 -0
  510. package/src/lib/authentication/ui/ZudokuAuthUi.tsx +181 -39
  511. package/src/lib/authentication/utils/relativeRedirectUrl.ts +12 -0
  512. package/src/lib/components/Bootstrap.tsx +1 -4
  513. package/src/lib/components/Mermaid.tsx +17 -3
  514. package/src/lib/components/MobileTopNavigation.tsx +16 -9
  515. package/src/lib/components/PagefindSearchMeta.tsx +14 -0
  516. package/src/lib/components/Pagination.tsx +4 -5
  517. package/src/lib/components/Slot.test.tsx +1 -1
  518. package/src/lib/components/TopNavigation.tsx +26 -8
  519. package/src/lib/components/Zudoku.tsx +22 -21
  520. package/src/lib/components/context/ZudokuContext.ts +33 -12
  521. package/src/lib/components/context/ZudokuProvider.tsx +1 -1
  522. package/src/lib/components/context/ZudokuReactContext.tsx +17 -0
  523. package/src/lib/components/index.ts +19 -35
  524. package/src/lib/components/navigation/Navigation.tsx +4 -3
  525. package/src/lib/components/navigation/NavigationCategory.tsx +9 -0
  526. package/src/lib/components/navigation/NavigationFilterContext.tsx +28 -0
  527. package/src/lib/components/navigation/NavigationFilterInput.tsx +35 -0
  528. package/src/lib/components/navigation/NavigationItem.tsx +26 -4
  529. package/src/lib/components/navigation/NavigationWrapper.tsx +1 -1
  530. package/src/lib/components/navigation/utils.ts +44 -2
  531. package/src/lib/core/RouteGuard.tsx +30 -24
  532. package/src/lib/core/ZudokuContext.ts +7 -1
  533. package/src/lib/core/__internal.tsx +2 -0
  534. package/src/lib/core/plugins.ts +27 -3
  535. package/src/lib/core/react-query.ts +1 -0
  536. package/src/lib/core/transform-config.test.tsx +99 -0
  537. package/src/lib/core/transform-config.ts +67 -0
  538. package/src/lib/errors/ErrorAlert.tsx +1 -6
  539. package/src/lib/errors/ErrorMessage.tsx +38 -0
  540. package/src/lib/hooks/index.ts +7 -16
  541. package/src/lib/hooks/useEvent.test.tsx +1 -1
  542. package/src/lib/navigation/pathMatcher.test.ts +136 -0
  543. package/src/lib/navigation/pathMatcher.ts +93 -0
  544. package/src/lib/navigation/positionItems.test.ts +265 -0
  545. package/src/lib/navigation/positionItems.ts +111 -0
  546. package/src/lib/oas/graphql/circular.test.ts +221 -0
  547. package/src/lib/oas/graphql/circular.ts +31 -18
  548. package/src/lib/oas/graphql/index.ts +7 -3
  549. package/src/lib/oas/parser/index.ts +19 -6
  550. package/src/lib/plugins/api-keys/SettingsApiKeys.tsx +36 -476
  551. package/src/lib/plugins/api-keys/index.tsx +76 -32
  552. package/src/lib/plugins/api-keys/settings/ApiKeyItem.tsx +342 -0
  553. package/src/lib/plugins/api-keys/settings/ApiKeyList.tsx +67 -0
  554. package/src/lib/plugins/api-keys/settings/RevealApiKey.tsx +124 -0
  555. package/src/lib/plugins/openapi/DownloadSchemaButton.tsx +115 -0
  556. package/src/lib/plugins/openapi/Endpoint.tsx +20 -27
  557. package/src/lib/plugins/openapi/GeneratedExampleSidecarBox.tsx +1 -1
  558. package/src/lib/plugins/openapi/OasProvider.tsx +38 -17
  559. package/src/lib/plugins/openapi/OperationList.tsx +48 -28
  560. package/src/lib/plugins/openapi/OperationListItem.tsx +5 -5
  561. package/src/lib/plugins/openapi/ParamInfos.tsx +1 -0
  562. package/src/lib/plugins/openapi/ParameterList.tsx +2 -2
  563. package/src/lib/plugins/openapi/ResponsesSidecarBox.tsx +22 -2
  564. package/src/lib/plugins/openapi/SchemaList.tsx +4 -0
  565. package/src/lib/plugins/openapi/Sidecar.tsx +20 -3
  566. package/src/lib/plugins/openapi/index.tsx +16 -7
  567. package/src/lib/plugins/openapi/interfaces.ts +21 -7
  568. package/src/lib/plugins/openapi/playground/Playground.tsx +8 -4
  569. package/src/lib/plugins/openapi/playground/fileUtils.ts +4 -0
  570. package/src/lib/plugins/openapi/playground/result-panel/AudioPlayer.tsx +50 -0
  571. package/src/lib/plugins/openapi/playground/result-panel/ResponseTab.tsx +33 -17
  572. package/src/lib/plugins/openapi/schema/SchemaView.tsx +56 -43
  573. package/src/lib/plugins/openapi/schema/utils.ts +20 -6
  574. package/src/lib/plugins/openapi/util/createHttpSnippet.ts +29 -1
  575. package/src/lib/plugins/openapi/util/getRoutes.tsx +38 -3
  576. package/src/lib/plugins/search-pagefind/IndexingDialog.tsx +163 -0
  577. package/src/lib/plugins/search-pagefind/PagefindSearch.tsx +61 -22
  578. package/src/lib/plugins/search-pagefind/ResultList.tsx +8 -3
  579. package/src/lib/shiki.ts +21 -12
  580. package/src/lib/ui/Alert.tsx +17 -5
  581. package/src/lib/ui/Button.tsx +11 -10
  582. package/src/lib/ui/ButtonGroup.tsx +82 -0
  583. package/src/lib/ui/Command.tsx +3 -3
  584. package/src/lib/ui/DropdownMenu.tsx +226 -170
  585. package/src/lib/ui/InputGroup.tsx +168 -0
  586. package/src/lib/ui/Kbd.tsx +28 -0
  587. package/src/lib/ui/Secret.tsx +2 -2
  588. package/src/lib/util/flattenAllOf.test.ts +73 -20
  589. package/src/lib/util/flattenAllOf.ts +0 -36
  590. package/src/lib/util/flattenAllOfProcessor.ts +58 -0
  591. package/src/lib/util/invariant.ts +2 -1
  592. package/src/lib/util/readFrontmatter.ts +14 -0
  593. package/src/shiki/langs/c3.js +1 -0
  594. package/src/shiki/langs/gn.js +1 -0
  595. package/src/shiki/langs/markdown-nix.js +1 -0
  596. package/src/shiki/langs/moonbit.js +1 -0
  597. package/src/shiki/langs/openscad.js +1 -0
  598. package/src/zuplo/enrich-with-zuplo-mcp.ts +168 -0
  599. package/src/zuplo/enrich-with-zuplo.ts +254 -0
  600. package/src/zuplo/policy-types.ts +46 -0
  601. package/src/zuplo/with-zuplo-processors.ts +35 -0
  602. package/src/zuplo/with-zuplo.ts +14 -0
  603. package/dist/vite/create-pagefind-index.d.ts +0 -4
  604. package/dist/vite/create-pagefind-index.js +0 -12
  605. package/dist/vite/create-pagefind-index.js.map +0 -1
  606. package/lib/Button-B3ucvvQw.js +0 -52
  607. package/lib/Button-B3ucvvQw.js.map +0 -1
  608. package/lib/Command-CUcrW3qs.js.map +0 -1
  609. package/lib/DropdownMenu-BZ2NKQ3K.js +0 -126
  610. package/lib/DropdownMenu-BZ2NKQ3K.js.map +0 -1
  611. package/lib/ErrorAlert-CrbMrCVu.js.map +0 -1
  612. package/lib/MdxPage-CvvEoyh8.js +0 -240
  613. package/lib/MdxPage-CvvEoyh8.js.map +0 -1
  614. package/lib/Mermaid-BKhcBY07.js +0 -95
  615. package/lib/Mermaid-BKhcBY07.js.map +0 -1
  616. package/lib/OAuthErrorPage-DMWRAojU.js.map +0 -1
  617. package/lib/OasProvider-RctJl9gc.js +0 -36
  618. package/lib/OasProvider-RctJl9gc.js.map +0 -1
  619. package/lib/OperationList-DtF1IC-C.js.map +0 -1
  620. package/lib/Pagination-BUSofxWZ.js +0 -37
  621. package/lib/Pagination-BUSofxWZ.js.map +0 -1
  622. package/lib/RouteGuard-DF6zsphX.js +0 -77
  623. package/lib/RouteGuard-DF6zsphX.js.map +0 -1
  624. package/lib/RouterError-uoqPiEpw.js +0 -42
  625. package/lib/RouterError-uoqPiEpw.js.map +0 -1
  626. package/lib/SchemaList-LalwoDIj.js.map +0 -1
  627. package/lib/SchemaView-P2n1cbxy.js +0 -572
  628. package/lib/SchemaView-P2n1cbxy.js.map +0 -1
  629. package/lib/Select-BEtQcIMq.js +0 -337
  630. package/lib/Select-BEtQcIMq.js.map +0 -1
  631. package/lib/SignUp-DVtgeEAO.js +0 -50
  632. package/lib/SignUp-DVtgeEAO.js.map +0 -1
  633. package/lib/SyntaxHighlight-CwfFh-is.js.map +0 -1
  634. package/lib/ZudokuContext-BHJB1CtE.js +0 -1508
  635. package/lib/ZudokuContext-BHJB1CtE.js.map +0 -1
  636. package/lib/chunk-PVWAREVJ-BMhpCH5D.js +0 -7965
  637. package/lib/chunk-PVWAREVJ-BMhpCH5D.js.map +0 -1
  638. package/lib/cn-dYga0KKN.js.map +0 -1
  639. package/lib/createServer-ClOQMwLC.js.map +0 -1
  640. package/lib/hook-ROaSkijS.js +0 -40
  641. package/lib/hook-ROaSkijS.js.map +0 -1
  642. package/lib/index-BGEIF_V8.js +0 -133
  643. package/lib/index-BGEIF_V8.js.map +0 -1
  644. package/lib/index-CB4W5R53.js +0 -1059
  645. package/lib/index-CB4W5R53.js.map +0 -1
  646. package/lib/index-D3Rf0-PX.js.map +0 -1
  647. package/lib/invariant-Bm-FVUQE.js.map +0 -1
  648. package/lib/mutation-DICuPw5p.js.map +0 -1
@@ -27,16 +27,31 @@ export const RouteGuard = () => {
27
27
  const shouldBypass = use(BypassProtectedRoutesContext);
28
28
  const { protectedRoutes } = zudoku.options;
29
29
 
30
- const authCheckFn =
31
- !shouldBypass && protectedRoutes
32
- ? Object.entries(protectedRoutes).find(([path]) =>
33
- matchPath({ path, end: true }, location.pathname),
34
- )?.[1]
35
- : undefined;
30
+ const protectedRouteEntry = protectedRoutes
31
+ ? Object.entries(protectedRoutes).find(([path]) =>
32
+ matchPath({ path, end: true }, location.pathname),
33
+ )
34
+ : undefined;
36
35
 
37
- const isProtectedRoute = authCheckFn !== undefined;
38
- const needsToSignIn =
39
- isProtectedRoute && !authCheckFn({ auth, context: zudoku });
36
+ const isProtectedRoute = protectedRouteEntry !== undefined;
37
+
38
+ // SSR/prerendering mode: render content with search meta tag, skip all auth
39
+ if (shouldBypass) {
40
+ return (
41
+ <>
42
+ {isProtectedRoute && (
43
+ <Helmet>
44
+ <meta
45
+ name="pagefind"
46
+ data-pagefind-filter={`section:${SEARCH_PROTECTED_SECTION}`}
47
+ content="true"
48
+ />
49
+ </Helmet>
50
+ )}
51
+ <Outlet />
52
+ </>
53
+ );
54
+ }
40
55
 
41
56
  if (isProtectedRoute && !auth.isAuthEnabled) {
42
57
  throw new ZudokuError("Authentication is not enabled", {
@@ -46,6 +61,10 @@ export const RouteGuard = () => {
46
61
  });
47
62
  }
48
63
 
64
+ const authCheckFn = protectedRouteEntry?.[1];
65
+ const needsToSignIn =
66
+ isProtectedRoute && !authCheckFn?.({ auth, context: zudoku });
67
+
49
68
  if (needsToSignIn && auth.isPending && typeof window !== "undefined") {
50
69
  return null;
51
70
  }
@@ -91,7 +110,7 @@ export const RouteGuard = () => {
91
110
  )
92
111
  }
93
112
  >
94
- Login{" "}
113
+ Login
95
114
  </Button>
96
115
  </DialogFooter>
97
116
  </DialogContent>
@@ -99,18 +118,5 @@ export const RouteGuard = () => {
99
118
  );
100
119
  }
101
120
 
102
- return (
103
- <>
104
- {shouldBypass && (
105
- <Helmet>
106
- <meta
107
- name="pagefind"
108
- data-pagefind-filter={`section:${SEARCH_PROTECTED_SECTION}`}
109
- content="true"
110
- />
111
- </Helmet>
112
- )}
113
- <Outlet />
114
- </>
115
- );
121
+ return <Outlet />;
116
122
  };
@@ -132,10 +132,15 @@ export class ZudokuContext {
132
132
  public readonly getAuthState: () => AuthState;
133
133
  public readonly queryClient: QueryClient;
134
134
  public readonly options: ZudokuContextOptions;
135
+ public readonly env: Record<string, string | undefined>;
135
136
  private readonly navigationPlugins: NavigationPlugin[];
136
137
  private emitter = createNanoEvents<ZudokuEvents>();
137
138
 
138
- constructor(options: ZudokuContextOptions, queryClient: QueryClient) {
139
+ constructor(
140
+ options: ZudokuContextOptions,
141
+ queryClient: QueryClient,
142
+ env: Record<string, string | undefined>,
143
+ ) {
139
144
  const pluginProtectedRoutes = Object.fromEntries(
140
145
  (options.plugins ?? []).flatMap((plugin) => {
141
146
  if (!isNavigationPlugin(plugin)) return [];
@@ -152,6 +157,7 @@ export class ZudokuContext {
152
157
  };
153
158
 
154
159
  this.queryClient = queryClient;
160
+ this.env = env;
155
161
  this.options = { ...options, protectedRoutes };
156
162
  this.plugins = options.plugins ?? [];
157
163
  this.navigation = options.navigation ?? [];
@@ -17,6 +17,7 @@ import { StatusPage as StatusPageImport } from "../components/StatusPage.js";
17
17
  import { RouterError as RouterErrorImport } from "../errors/RouterError.js";
18
18
  import { ServerError as ServerErrorImport } from "../errors/ServerError.js";
19
19
  import { RouteGuard as RouteGuardImport } from "./RouteGuard.js";
20
+ import { runPluginTransformConfig as runPluginTransformConfigImport } from "./transform-config.js";
20
21
 
21
22
  export const Layout = LayoutImport;
22
23
  export const RouterError = RouterErrorImport;
@@ -28,3 +29,4 @@ export const Head = Helmet;
28
29
  export const StatusPage = StatusPageImport;
29
30
  export const BuildCheck = BuildCheckImport;
30
31
  export const Meta = MetaImport;
32
+ export const runPluginTransformConfig = runPluginTransformConfigImport;
@@ -1,8 +1,9 @@
1
1
  import type { LucideIcon } from "lucide-react";
2
- import type { ReactElement } from "react";
2
+ import type { ReactNode } from "react";
3
3
  import type { Location, RouteObject } from "react-router";
4
4
  import type { Navigation } from "../../config/validators/NavigationSchema.js";
5
5
  import type { ProtectedRoutesInput } from "../../config/validators/ProtectedRoutesSchema.js";
6
+ import type { ZudokuConfig } from "../../config/validators/validate.js";
6
7
  import type { AuthenticationPlugin } from "../authentication/authentication.js";
7
8
  import type { MdxComponentsType } from "../util/MdxComponents.js";
8
9
  import type {
@@ -18,7 +19,8 @@ export type ZudokuPlugin =
18
19
  | ApiIdentityPlugin
19
20
  | SearchProviderPlugin
20
21
  | EventConsumerPlugin
21
- | AuthenticationPlugin;
22
+ | AuthenticationPlugin
23
+ | TransformConfigPlugin;
22
24
 
23
25
  export type { AuthenticationPlugin, RouteObject };
24
26
 
@@ -60,11 +62,28 @@ export type ProfileNavigationItem = {
60
62
  icon?: LucideIcon;
61
63
  };
62
64
 
65
+ export interface ConfigHookContext {
66
+ mode: typeof process.env.ZUDOKU_ENV;
67
+ rootDir: string;
68
+ configPath: string;
69
+ }
70
+
71
+ export interface TransformConfigContext {
72
+ config: ZudokuConfig;
73
+ merge: <T extends Partial<ZudokuConfig>>(partial: T) => ZudokuConfig & T;
74
+ }
75
+
76
+ export interface TransformConfigPlugin {
77
+ transformConfig?: (
78
+ context: TransformConfigContext,
79
+ ) => ZudokuConfig | void | Promise<ZudokuConfig | void>;
80
+ }
81
+
63
82
  export interface CommonPlugin {
64
83
  initialize?: (
65
84
  context: ZudokuContext,
66
85
  ) => Promise<void | boolean> | void | boolean;
67
- getHead?: ({ location }: { location: Location }) => ReactElement | undefined;
86
+ getHead?: (args: { location: Location }) => ReactNode | undefined;
68
87
  getMdxComponents?: () => MdxComponentsType;
69
88
  }
70
89
 
@@ -110,3 +129,8 @@ export const isApiIdentityPlugin = (
110
129
  obj: ZudokuPlugin,
111
130
  ): obj is ApiIdentityPlugin =>
112
131
  "getIdentities" in obj && typeof obj.getIdentities === "function";
132
+
133
+ export const isTransformConfigPlugin = (
134
+ obj: ZudokuPlugin,
135
+ ): obj is TransformConfigPlugin =>
136
+ "transformConfig" in obj && typeof obj.transformConfig === "function";
@@ -0,0 +1 @@
1
+ export * from "@tanstack/react-query";
@@ -0,0 +1,99 @@
1
+ import { describe, expect, test } from "vitest";
2
+ import { isPlainObject, mergeConfig } from "./transform-config.js";
3
+
4
+ describe("isPlainObject", () => {
5
+ test("returns true for plain objects", () => {
6
+ expect(isPlainObject({})).toBe(true);
7
+ expect(isPlainObject({ a: 1 })).toBe(true);
8
+ });
9
+
10
+ test("returns false for arrays", () => {
11
+ expect(isPlainObject([])).toBe(false);
12
+ expect(isPlainObject([1, 2, 3])).toBe(false);
13
+ });
14
+
15
+ test("returns false for null and undefined", () => {
16
+ expect(isPlainObject(null)).toBe(false);
17
+ expect(isPlainObject(undefined)).toBe(false);
18
+ });
19
+
20
+ test("returns false for class instances", () => {
21
+ expect(isPlainObject(new Date())).toBe(false);
22
+ expect(isPlainObject(new Map())).toBe(false);
23
+ expect(isPlainObject(/regex/)).toBe(false);
24
+ });
25
+ });
26
+
27
+ describe("mergeConfig", () => {
28
+ test("merges flat objects", () => {
29
+ const target = { a: 1, b: 2 };
30
+ const source = { b: 3, c: 4 };
31
+ expect(mergeConfig(target, source)).toEqual({ a: 1, b: 3, c: 4 });
32
+ });
33
+
34
+ test("merges nested objects", () => {
35
+ const target = { nested: { a: 1, b: 2 } } as Record<string, unknown>;
36
+ const source = { nested: { b: 3, c: 4 } };
37
+ expect(mergeConfig(target, source)).toEqual({
38
+ nested: { a: 1, b: 3, c: 4 },
39
+ });
40
+ });
41
+
42
+ test("replaces arrays instead of merging", () => {
43
+ const target = { arr: [1, 2, 3] };
44
+ const source = { arr: [4, 5] };
45
+ expect(mergeConfig(target, source)).toEqual({ arr: [4, 5] });
46
+ });
47
+
48
+ test("preserves React elements without deep cloning", () => {
49
+ const element = <div className="test">Hello</div>;
50
+ const target = { banner: { message: "old" } };
51
+ const source = { banner: { message: element } };
52
+
53
+ const result = mergeConfig(target, source);
54
+
55
+ // Should be the exact same reference, not a clone
56
+ expect(result.banner.message).toBe(element);
57
+ });
58
+
59
+ test("does not clone React element children", () => {
60
+ const child = <strong>Bold</strong>;
61
+ const element = <div>{child} text</div>;
62
+ const target = { site: { banner: {} } };
63
+ const source = { site: { banner: { message: element } } };
64
+
65
+ const result = mergeConfig(target, source);
66
+
67
+ // The element should be identical (same reference)
68
+ expect(result.site.banner.message).toBe(element);
69
+ // Children should be preserved exactly
70
+ expect(result.site.banner.message.props.children).toBe(
71
+ element.props.children,
72
+ );
73
+ });
74
+
75
+ test("handles null and undefined values", () => {
76
+ const target = { a: 1, b: 2 };
77
+ const source = { a: null, c: undefined };
78
+ expect(mergeConfig(target, source)).toEqual({
79
+ a: null,
80
+ b: 2,
81
+ c: undefined,
82
+ });
83
+ });
84
+
85
+ test("replaces non-plain objects", () => {
86
+ const date = new Date("2024-01-01");
87
+ const target = { date: new Date("2020-01-01") };
88
+ const source = { date };
89
+ const result = mergeConfig(target, source);
90
+ expect(result.date).toBe(date);
91
+ });
92
+
93
+ test("does not mutate target", () => {
94
+ const target = { a: 1, nested: { b: 2 } };
95
+ const source = { a: 2, nested: { c: 3 } };
96
+ mergeConfig(target, source);
97
+ expect(target).toEqual({ a: 1, nested: { b: 2 } });
98
+ });
99
+ });
@@ -0,0 +1,67 @@
1
+ import { isValidElement } from "react";
2
+ import type { ZudokuConfig } from "../../config/validators/validate.js";
3
+ import { isTransformConfigPlugin } from "./plugins.js";
4
+
5
+ export const isPlainObject = (
6
+ value: unknown,
7
+ ): value is Record<string, unknown> =>
8
+ typeof value === "object" &&
9
+ value !== null &&
10
+ !Array.isArray(value) &&
11
+ Object.getPrototypeOf(value) === Object.prototype;
12
+
13
+ export const mergeConfig = <
14
+ T extends Record<string, unknown>,
15
+ S extends Record<string, unknown>,
16
+ >(
17
+ target: T,
18
+ source: S,
19
+ ): T & S => {
20
+ const result = { ...target } as T & S;
21
+
22
+ for (const key of Object.keys(source) as (keyof S)[]) {
23
+ const sourceValue = source[key];
24
+ const targetValue = target[key as keyof T];
25
+
26
+ // Don't merge React elements, arrays, or non-plain objects - just replace
27
+ if (
28
+ isValidElement(sourceValue) ||
29
+ Array.isArray(sourceValue) ||
30
+ !isPlainObject(sourceValue)
31
+ ) {
32
+ (result as Record<string, unknown>)[key as string] = sourceValue;
33
+ } else if (isPlainObject(targetValue)) {
34
+ (result as Record<string, unknown>)[key as string] = mergeConfig(
35
+ targetValue,
36
+ sourceValue,
37
+ );
38
+ } else {
39
+ (result as Record<string, unknown>)[key as string] = sourceValue;
40
+ }
41
+ }
42
+
43
+ return result;
44
+ };
45
+
46
+ export const runPluginTransformConfig = async <T extends ZudokuConfig>(
47
+ config: T,
48
+ ): Promise<T> => {
49
+ const plugins = config.plugins ?? [];
50
+
51
+ let result = config;
52
+
53
+ for (const plugin of plugins.filter(isTransformConfigPlugin)) {
54
+ const merge = <T extends Record<string, unknown>>(partial: T) =>
55
+ mergeConfig(result, partial);
56
+
57
+ const transformed = await plugin.transformConfig?.({
58
+ config: result,
59
+ merge,
60
+ });
61
+ if (!transformed) continue;
62
+
63
+ result = transformed as T;
64
+ }
65
+
66
+ return result;
67
+ };
@@ -1,4 +1,3 @@
1
- import { SyntaxHighlight } from "zudoku/ui/SyntaxHighlight.js";
2
1
  import { DeveloperHint } from "../components/DeveloperHint.js";
3
2
  import { Heading } from "../components/Heading.js";
4
3
  import { Typography } from "../components/Typography.js";
@@ -22,11 +21,7 @@ export function ErrorAlert({ error }: { error: unknown }) {
22
21
  Error: {message}
23
22
  {hint && <DeveloperHint className="mb-4">{hint}</DeveloperHint>}
24
23
  {stringError && (
25
- <SyntaxHighlight
26
- className="max-h-[400px] [&>pre]:p-4"
27
- language="js"
28
- code={stringError}
29
- />
24
+ <pre className="max-h-[400px] [&>pre]:p-4">{stringError}</pre>
30
25
  )}
31
26
  </Typography>
32
27
  );
@@ -0,0 +1,38 @@
1
+ import { Alert, AlertDescription, AlertTitle } from "zudoku/ui/Alert.js";
2
+ import { SyntaxHighlight } from "zudoku/ui/SyntaxHighlight.js";
3
+ import { DeveloperHint } from "../components/DeveloperHint.js";
4
+ import { ZudokuError } from "../util/invariant.js";
5
+
6
+ export function ErrorMessage({ error }: { error: unknown }) {
7
+ const message =
8
+ error instanceof Error ? error.message : "Something went wrong";
9
+
10
+ const showDeveloperHints = process.env.NODE_ENV === "development";
11
+
12
+ const hint = error instanceof ZudokuError ? error.developerHint : undefined;
13
+ const title =
14
+ error instanceof ZudokuError ? error.title : "Something went wrong";
15
+ const stack = error instanceof Error ? error.stack : undefined;
16
+ const cause = error instanceof Error ? error.cause : undefined;
17
+
18
+ const stringError = cause instanceof Error ? String(cause.stack) : stack;
19
+
20
+ return (
21
+ <>
22
+ <Alert variant="destructive">
23
+ <AlertTitle>{title}</AlertTitle>
24
+ <AlertDescription>{message}</AlertDescription>
25
+ </Alert>
26
+ {showDeveloperHints && hint && (
27
+ <DeveloperHint className="mb-4">{hint}</DeveloperHint>
28
+ )}
29
+ {showDeveloperHints && stringError && (
30
+ <SyntaxHighlight
31
+ className="max-h-[400px] [&>pre]:p-4"
32
+ language="js"
33
+ code={stringError}
34
+ />
35
+ )}
36
+ </>
37
+ );
38
+ }
@@ -1,16 +1,7 @@
1
- import { useMDXComponents as useMDXComponentsImport } from "@mdx-js/react";
2
- import { useTheme as useThemeImport } from "next-themes";
3
- import { useAuth as useAuthImport } from "../authentication/hook.js";
4
- import { CACHE_KEYS, useCache as useCacheImport } from "../components/cache.js";
5
- import { useZudoku as useZudokuImport } from "../components/context/ZudokuContext.js";
6
- import { useExposedProps as useExposedPropsImport } from "../util/useExposedProps.js";
7
- import { useEvent as useEventImport } from "./useEvent.js";
8
-
9
- export const useEvent = /*@__PURE__*/ useEventImport;
10
- export const useTheme = /*@__PURE__*/ useThemeImport;
11
- export const useExposedProps = /*@__PURE__*/ useExposedPropsImport;
12
- export const useMDXComponents = /*@__PURE__*/ useMDXComponentsImport;
13
- export const useAuth = /*@__PURE__*/ useAuthImport;
14
- export const useZudoku = /*@__PURE__*/ useZudokuImport;
15
- export const useCache = /*@__PURE__*/ useCacheImport;
16
- export { CACHE_KEYS };
1
+ export { useMDXComponents } from "@mdx-js/react";
2
+ export { useTheme } from "next-themes";
3
+ export { useAuth } from "../authentication/hook.js";
4
+ export { CACHE_KEYS, useCache } from "../components/cache.js";
5
+ export { useZudoku } from "../components/context/ZudokuContext.js";
6
+ export { useExposedProps } from "../util/useExposedProps.js";
7
+ export { useEvent } from "./useEvent.js";
@@ -13,7 +13,7 @@ import { useEvent } from "./useEvent.js";
13
13
 
14
14
  const createTestContext = () => {
15
15
  const queryClient = new QueryClient();
16
- const context = new ZudokuContext({}, queryClient);
16
+ const context = new ZudokuContext({}, queryClient, {});
17
17
  const wrapper = ({ children }: PropsWithChildren) => (
18
18
  <QueryClientProvider client={queryClient}>
19
19
  <ZudokuProvider context={context}>{children}</ZudokuProvider>
@@ -0,0 +1,136 @@
1
+ import { describe, expect, it } from "vitest";
2
+ import type { NavigationItem } from "../../config/validators/NavigationSchema.js";
3
+ import { findByPath } from "./pathMatcher.js";
4
+
5
+ const mockNavigation: NavigationItem[] = [
6
+ {
7
+ type: "category",
8
+ label: "Shipments",
9
+ items: [
10
+ { type: "link", label: "Track a Shipment", to: "/track" },
11
+ { type: "link", label: "Create Shipment", to: "/create" },
12
+ {
13
+ type: "category",
14
+ label: "Nested Category",
15
+ items: [
16
+ { type: "link", label: "First Nested", to: "/nested/first" },
17
+ { type: "link", label: "Second Nested", to: "/nested/second" },
18
+ ],
19
+ },
20
+ ],
21
+ },
22
+ { type: "link", label: "About", to: "/about" },
23
+ ];
24
+
25
+ describe("pathMatcher", () => {
26
+ describe("findByPath", () => {
27
+ it("should find item by label", () => {
28
+ const result = findByPath(mockNavigation, "Shipments");
29
+ expect(result.found).toBe(true);
30
+ expect(result.item?.label).toBe("Shipments");
31
+ expect(result.index).toBe(0);
32
+ });
33
+
34
+ it("should find nested item by label path", () => {
35
+ const result = findByPath(mockNavigation, "Shipments/Track a Shipment");
36
+ expect(result.found).toBe(true);
37
+ expect(result.item?.label).toBe("Track a Shipment");
38
+ expect(result.index).toBe(0);
39
+ });
40
+
41
+ it("should find item by index", () => {
42
+ const result = findByPath(mockNavigation, "Shipments/0");
43
+ expect(result.found).toBe(true);
44
+ expect(result.item?.label).toBe("Track a Shipment");
45
+ expect(result.index).toBe(0);
46
+ });
47
+
48
+ it("should find nested item by mixed path (label + index)", () => {
49
+ const result = findByPath(mockNavigation, "Shipments/2/0");
50
+ expect(result.found).toBe(true);
51
+ expect(result.item?.label).toBe("First Nested");
52
+ expect(result.index).toBe(0);
53
+ });
54
+
55
+ it("should be case-insensitive for label matching", () => {
56
+ const result = findByPath(mockNavigation, "shipments/track a shipment");
57
+ expect(result.found).toBe(true);
58
+ expect(result.item?.label).toBe("Track a Shipment");
59
+ });
60
+
61
+ it("should find deeply nested items", () => {
62
+ const result = findByPath(
63
+ mockNavigation,
64
+ "Shipments/Nested Category/Second Nested",
65
+ );
66
+ expect(result.found).toBe(true);
67
+ expect(result.item?.label).toBe("Second Nested");
68
+ expect(result.index).toBe(1);
69
+ });
70
+
71
+ it("should return found=false for non-existent path", () => {
72
+ const result = findByPath(mockNavigation, "Nonexistent/Path");
73
+ expect(result.found).toBe(false);
74
+ expect(result.item).toBeUndefined();
75
+ });
76
+
77
+ it("should return found=false for invalid index", () => {
78
+ const result = findByPath(mockNavigation, "Shipments/999");
79
+ expect(result.found).toBe(false);
80
+ });
81
+
82
+ it("should handle root-level items", () => {
83
+ const result = findByPath(mockNavigation, "About");
84
+ expect(result.found).toBe(true);
85
+ expect(result.item?.label).toBe("About");
86
+ expect(result.index).toBe(1);
87
+ });
88
+
89
+ it("should provide parentItems for inserting siblings", () => {
90
+ const result = findByPath(mockNavigation, "Shipments/0");
91
+ expect(result.parentItems).toBeDefined();
92
+ expect(result.parentItems?.length).toBe(3); // 2 links + 1 category
93
+ });
94
+
95
+ it("should handle empty path", () => {
96
+ const result = findByPath(mockNavigation, "");
97
+ expect(result.found).toBe(false);
98
+ });
99
+
100
+ it("should support negative indices (-1 for last item)", () => {
101
+ const result = findByPath(mockNavigation, "Shipments/-1");
102
+ expect(result.found).toBe(true);
103
+ expect(result.item?.label).toBe("Nested Category");
104
+ });
105
+
106
+ it("should support negative indices (-2 for second-to-last)", () => {
107
+ const result = findByPath(mockNavigation, "Shipments/-2");
108
+ expect(result.found).toBe(true);
109
+ expect(result.item?.label).toBe("Create Shipment");
110
+ });
111
+
112
+ it("should support negative indices in nested paths", () => {
113
+ const result = findByPath(mockNavigation, "Shipments/-1/-1");
114
+ expect(result.found).toBe(true);
115
+ expect(result.item?.label).toBe("Second Nested");
116
+ });
117
+
118
+ it("should handle paths with trailing slashes", () => {
119
+ const result = findByPath(mockNavigation, "Shipments/0/");
120
+ expect(result.found).toBe(true);
121
+ expect(result.item?.label).toBe("Track a Shipment");
122
+ });
123
+
124
+ it("should handle paths with double slashes", () => {
125
+ const result = findByPath(mockNavigation, "Shipments//0");
126
+ expect(result.found).toBe(true);
127
+ expect(result.item?.label).toBe("Track a Shipment");
128
+ });
129
+
130
+ it("should handle paths with leading slashes", () => {
131
+ const result = findByPath(mockNavigation, "/Shipments/0");
132
+ expect(result.found).toBe(true);
133
+ expect(result.item?.label).toBe("Track a Shipment");
134
+ });
135
+ });
136
+ });
@@ -0,0 +1,93 @@
1
+ import type { NavigationItem } from "../../config/validators/NavigationSchema.js";
2
+
3
+ type PathSegment = string | number;
4
+
5
+ export type PathMatchResult = {
6
+ found: boolean;
7
+ item?: NavigationItem;
8
+ parentItems?: NavigationItem[];
9
+ index?: number;
10
+ };
11
+
12
+ const parsePath = (path: string): PathSegment[] => {
13
+ if (!path || path === "/") return [];
14
+
15
+ return path
16
+ .split("/")
17
+ .filter((segment) => segment !== "")
18
+ .map((segment) => {
19
+ const num = Number(segment);
20
+ return Number.isInteger(num) ? num : segment;
21
+ });
22
+ };
23
+
24
+ const matchesSegment = (
25
+ segment: PathSegment,
26
+ item: NavigationItem,
27
+ index: number,
28
+ arrayLength: number,
29
+ ): boolean => {
30
+ if (typeof segment === "number") {
31
+ // Support negative indices (-1 for last, -2 for second-to-last, etc.)
32
+ const normalizedIndex = segment < 0 ? arrayLength + segment : segment;
33
+ return normalizedIndex === index;
34
+ }
35
+
36
+ return item.label?.toLowerCase() === segment.toLowerCase();
37
+ };
38
+
39
+ export const findByPath = (
40
+ navigation: NavigationItem[],
41
+ pathString: string,
42
+ ): PathMatchResult => {
43
+ const segments = parsePath(pathString);
44
+
45
+ if (segments.length === 0) {
46
+ return { found: false };
47
+ }
48
+
49
+ let currentItems = navigation;
50
+ let currentItem: NavigationItem | undefined;
51
+ let parentItems: NavigationItem[] | undefined;
52
+ let itemIndex: number | undefined;
53
+
54
+ for (let i = 0; i < segments.length; i++) {
55
+ const segment = segments[i];
56
+ if (segment === undefined) {
57
+ return { found: false };
58
+ }
59
+ const isLastSegment = i === segments.length - 1;
60
+
61
+ const foundIndex = currentItems.findIndex((item, idx) =>
62
+ matchesSegment(segment, item, idx, currentItems.length),
63
+ );
64
+
65
+ if (foundIndex === -1) {
66
+ return { found: false };
67
+ }
68
+
69
+ currentItem = currentItems[foundIndex];
70
+ if (!currentItem) {
71
+ return { found: false };
72
+ }
73
+
74
+ if (isLastSegment) {
75
+ parentItems = currentItems;
76
+ itemIndex = foundIndex;
77
+ break;
78
+ }
79
+
80
+ if (currentItem.type === "category") {
81
+ currentItems = currentItem.items;
82
+ } else {
83
+ return { found: false };
84
+ }
85
+ }
86
+
87
+ return {
88
+ found: true,
89
+ item: currentItem,
90
+ parentItems,
91
+ index: itemIndex,
92
+ };
93
+ };