zudoku 0.0.0-feat-openapi-docs-redesign.dab3fc6a → 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 (656) 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 +104 -14
  22. package/dist/config/validators/validate.js +15 -4
  23. package/dist/config/validators/validate.js.map +1 -1
  24. package/dist/config/validators/validate.test.js +43 -0
  25. package/dist/config/validators/validate.test.js.map +1 -1
  26. package/dist/flat-config.d.ts +68 -32
  27. package/dist/index.d.ts +4 -2
  28. package/dist/index.js +3 -1
  29. package/dist/index.js.map +1 -1
  30. package/dist/lib/auth/issuer.js +1 -1
  31. package/dist/lib/auth/issuer.js.map +1 -1
  32. package/dist/lib/authentication/authentication.d.ts +3 -2
  33. package/dist/lib/authentication/components/CallbackHandler.js +1 -1
  34. package/dist/lib/authentication/components/CallbackHandler.js.map +1 -1
  35. package/dist/lib/authentication/components/SignIn.js +4 -2
  36. package/dist/lib/authentication/components/SignIn.js.map +1 -1
  37. package/dist/lib/authentication/components/SignUp.js +4 -2
  38. package/dist/lib/authentication/components/SignUp.js.map +1 -1
  39. package/dist/lib/authentication/hook.d.ts +2 -0
  40. package/dist/lib/authentication/hook.js +10 -0
  41. package/dist/lib/authentication/hook.js.map +1 -1
  42. package/dist/lib/authentication/providers/auth0.js +17 -8
  43. package/dist/lib/authentication/providers/auth0.js.map +1 -1
  44. package/dist/lib/authentication/providers/clerk.js +0 -22
  45. package/dist/lib/authentication/providers/clerk.js.map +1 -1
  46. package/dist/lib/authentication/providers/firebase.js +67 -9
  47. package/dist/lib/authentication/providers/firebase.js.map +1 -1
  48. package/dist/lib/authentication/providers/supabase.js +6 -15
  49. package/dist/lib/authentication/providers/supabase.js.map +1 -1
  50. package/dist/lib/authentication/ui/EmailVerificationUi.d.ts +4 -0
  51. package/dist/lib/authentication/ui/EmailVerificationUi.js +34 -0
  52. package/dist/lib/authentication/ui/EmailVerificationUi.js.map +1 -0
  53. package/dist/lib/authentication/ui/ZudokuAuthUi.d.ts +7 -2
  54. package/dist/lib/authentication/ui/ZudokuAuthUi.js +48 -12
  55. package/dist/lib/authentication/ui/ZudokuAuthUi.js.map +1 -1
  56. package/dist/lib/authentication/utils/relativeRedirectUrl.d.ts +1 -0
  57. package/dist/lib/authentication/utils/relativeRedirectUrl.js +8 -0
  58. package/dist/lib/authentication/utils/relativeRedirectUrl.js.map +1 -0
  59. package/dist/lib/components/Bootstrap.js +1 -2
  60. package/dist/lib/components/Bootstrap.js.map +1 -1
  61. package/dist/lib/components/Heading.d.ts +1 -1
  62. package/dist/lib/components/Mermaid.d.ts +7 -0
  63. package/dist/lib/components/Mermaid.js +42 -0
  64. package/dist/lib/components/Mermaid.js.map +1 -0
  65. package/dist/lib/components/MobileTopNavigation.js +3 -2
  66. package/dist/lib/components/MobileTopNavigation.js.map +1 -1
  67. package/dist/lib/components/PagefindSearchMeta.d.ts +8 -0
  68. package/dist/lib/components/PagefindSearchMeta.js +7 -0
  69. package/dist/lib/components/PagefindSearchMeta.js.map +1 -0
  70. package/dist/lib/components/Pagination.js +2 -2
  71. package/dist/lib/components/Pagination.js.map +1 -1
  72. package/dist/lib/components/Slot.test.js +1 -1
  73. package/dist/lib/components/Slot.test.js.map +1 -1
  74. package/dist/lib/components/TopNavigation.d.ts +7 -1
  75. package/dist/lib/components/TopNavigation.js +8 -3
  76. package/dist/lib/components/TopNavigation.js.map +1 -1
  77. package/dist/lib/components/Zudoku.d.ts +4 -1
  78. package/dist/lib/components/Zudoku.js +5 -11
  79. package/dist/lib/components/Zudoku.js.map +1 -1
  80. package/dist/lib/components/context/ZudokuContext.d.ts +9 -4
  81. package/dist/lib/components/context/ZudokuContext.js +26 -8
  82. package/dist/lib/components/context/ZudokuContext.js.map +1 -1
  83. package/dist/lib/components/context/ZudokuProvider.js +1 -1
  84. package/dist/lib/components/context/ZudokuProvider.js.map +1 -1
  85. package/dist/lib/components/context/ZudokuReactContext.d.ts +11 -0
  86. package/dist/lib/components/context/ZudokuReactContext.js +4 -0
  87. package/dist/lib/components/context/ZudokuReactContext.js.map +1 -0
  88. package/dist/lib/components/index.d.ts +18 -69
  89. package/dist/lib/components/index.js +19 -32
  90. package/dist/lib/components/index.js.map +1 -1
  91. package/dist/lib/components/navigation/Navigation.js +4 -3
  92. package/dist/lib/components/navigation/Navigation.js.map +1 -1
  93. package/dist/lib/components/navigation/NavigationCategory.js +8 -0
  94. package/dist/lib/components/navigation/NavigationCategory.js.map +1 -1
  95. package/dist/lib/components/navigation/NavigationFilterContext.d.ts +8 -0
  96. package/dist/lib/components/navigation/NavigationFilterContext.js +12 -0
  97. package/dist/lib/components/navigation/NavigationFilterContext.js.map +1 -0
  98. package/dist/lib/components/navigation/NavigationFilterInput.d.ts +3 -0
  99. package/dist/lib/components/navigation/NavigationFilterInput.js +9 -0
  100. package/dist/lib/components/navigation/NavigationFilterInput.js.map +1 -0
  101. package/dist/lib/components/navigation/NavigationItem.js +13 -3
  102. package/dist/lib/components/navigation/NavigationItem.js.map +1 -1
  103. package/dist/lib/components/navigation/NavigationWrapper.js +1 -1
  104. package/dist/lib/components/navigation/NavigationWrapper.js.map +1 -1
  105. package/dist/lib/components/navigation/utils.d.ts +6 -1
  106. package/dist/lib/components/navigation/utils.js +26 -2
  107. package/dist/lib/components/navigation/utils.js.map +1 -1
  108. package/dist/lib/core/RouteGuard.js +12 -7
  109. package/dist/lib/core/RouteGuard.js.map +1 -1
  110. package/dist/lib/core/ZudokuContext.d.ts +2 -1
  111. package/dist/lib/core/ZudokuContext.js +3 -1
  112. package/dist/lib/core/ZudokuContext.js.map +1 -1
  113. package/dist/lib/core/__internal.d.ts +1 -0
  114. package/dist/lib/core/__internal.js +2 -0
  115. package/dist/lib/core/__internal.js.map +1 -1
  116. package/dist/lib/core/plugins.d.ts +18 -4
  117. package/dist/lib/core/plugins.js +1 -0
  118. package/dist/lib/core/plugins.js.map +1 -1
  119. package/dist/lib/core/react-query.d.ts +1 -0
  120. package/dist/lib/core/react-query.js +2 -0
  121. package/dist/lib/core/react-query.js.map +1 -0
  122. package/dist/lib/core/transform-config.d.ts +4 -0
  123. package/dist/lib/core/transform-config.js +42 -0
  124. package/dist/lib/core/transform-config.js.map +1 -0
  125. package/dist/lib/core/transform-config.test.d.ts +1 -0
  126. package/dist/lib/core/transform-config.test.js +83 -0
  127. package/dist/lib/core/transform-config.test.js.map +1 -0
  128. package/dist/lib/errors/ErrorAlert.js +1 -2
  129. package/dist/lib/errors/ErrorAlert.js.map +1 -1
  130. package/dist/lib/errors/ErrorMessage.d.ts +3 -0
  131. package/dist/lib/errors/ErrorMessage.js +16 -0
  132. package/dist/lib/errors/ErrorMessage.js.map +1 -0
  133. package/dist/lib/hooks/index.d.ts +7 -28
  134. package/dist/lib/hooks/index.js +7 -15
  135. package/dist/lib/hooks/index.js.map +1 -1
  136. package/dist/lib/hooks/useEvent.test.js +1 -1
  137. package/dist/lib/hooks/useEvent.test.js.map +1 -1
  138. package/dist/lib/navigation/pathMatcher.d.ts +8 -0
  139. package/dist/lib/navigation/pathMatcher.js +62 -0
  140. package/dist/lib/navigation/pathMatcher.js.map +1 -0
  141. package/dist/lib/navigation/pathMatcher.test.d.ts +1 -0
  142. package/dist/lib/navigation/pathMatcher.test.js +115 -0
  143. package/dist/lib/navigation/pathMatcher.test.js.map +1 -0
  144. package/dist/lib/navigation/positionItems.d.ts +10 -0
  145. package/dist/lib/navigation/positionItems.js +54 -0
  146. package/dist/lib/navigation/positionItems.js.map +1 -0
  147. package/dist/lib/navigation/positionItems.test.d.ts +1 -0
  148. package/dist/lib/navigation/positionItems.test.js +229 -0
  149. package/dist/lib/navigation/positionItems.test.js.map +1 -0
  150. package/dist/lib/oas/graphql/circular.d.ts +2 -0
  151. package/dist/lib/oas/graphql/circular.js +21 -16
  152. package/dist/lib/oas/graphql/circular.js.map +1 -1
  153. package/dist/lib/oas/graphql/circular.test.d.ts +1 -0
  154. package/dist/lib/oas/graphql/circular.test.js +183 -0
  155. package/dist/lib/oas/graphql/circular.test.js.map +1 -0
  156. package/dist/lib/oas/graphql/index.js +7 -3
  157. package/dist/lib/oas/graphql/index.js.map +1 -1
  158. package/dist/lib/oas/parser/index.d.ts +1 -0
  159. package/dist/lib/oas/parser/index.js +14 -5
  160. package/dist/lib/oas/parser/index.js.map +1 -1
  161. package/dist/lib/plugins/api-keys/SettingsApiKeys.js +9 -172
  162. package/dist/lib/plugins/api-keys/SettingsApiKeys.js.map +1 -1
  163. package/dist/lib/plugins/api-keys/index.d.ts +11 -4
  164. package/dist/lib/plugins/api-keys/index.js +36 -22
  165. package/dist/lib/plugins/api-keys/index.js.map +1 -1
  166. package/dist/lib/plugins/api-keys/settings/ApiKeyItem.d.ts +12 -0
  167. package/dist/lib/plugins/api-keys/settings/ApiKeyItem.js +133 -0
  168. package/dist/lib/plugins/api-keys/settings/ApiKeyItem.js.map +1 -0
  169. package/dist/lib/plugins/api-keys/settings/ApiKeyList.d.ts +4 -0
  170. package/dist/lib/plugins/api-keys/settings/ApiKeyList.js +33 -0
  171. package/dist/lib/plugins/api-keys/settings/ApiKeyList.js.map +1 -0
  172. package/dist/lib/plugins/api-keys/settings/RevealApiKey.d.ts +6 -0
  173. package/dist/lib/plugins/api-keys/settings/RevealApiKey.js +39 -0
  174. package/dist/lib/plugins/api-keys/settings/RevealApiKey.js.map +1 -0
  175. package/dist/lib/plugins/openapi/DownloadSchemaButton.d.ts +3 -0
  176. package/dist/lib/plugins/openapi/DownloadSchemaButton.js +47 -0
  177. package/dist/lib/plugins/openapi/DownloadSchemaButton.js.map +1 -0
  178. package/dist/lib/plugins/openapi/Endpoint.js +3 -6
  179. package/dist/lib/plugins/openapi/Endpoint.js.map +1 -1
  180. package/dist/lib/plugins/openapi/GeneratedExampleSidecarBox.js +1 -1
  181. package/dist/lib/plugins/openapi/OasProvider.js +26 -13
  182. package/dist/lib/plugins/openapi/OasProvider.js.map +1 -1
  183. package/dist/lib/plugins/openapi/OperationList.js +20 -10
  184. package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
  185. package/dist/lib/plugins/openapi/OperationListItem.js +2 -2
  186. package/dist/lib/plugins/openapi/OperationListItem.js.map +1 -1
  187. package/dist/lib/plugins/openapi/ParamInfos.js +1 -0
  188. package/dist/lib/plugins/openapi/ParamInfos.js.map +1 -1
  189. package/dist/lib/plugins/openapi/ParameterList.js +1 -1
  190. package/dist/lib/plugins/openapi/ParameterList.js.map +1 -1
  191. package/dist/lib/plugins/openapi/ResponsesSidecarBox.d.ts +2 -1
  192. package/dist/lib/plugins/openapi/ResponsesSidecarBox.js +4 -3
  193. package/dist/lib/plugins/openapi/ResponsesSidecarBox.js.map +1 -1
  194. package/dist/lib/plugins/openapi/SchemaList.js +2 -1
  195. package/dist/lib/plugins/openapi/SchemaList.js.map +1 -1
  196. package/dist/lib/plugins/openapi/Sidecar.js +12 -3
  197. package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
  198. package/dist/lib/plugins/openapi/index.js +11 -5
  199. package/dist/lib/plugins/openapi/index.js.map +1 -1
  200. package/dist/lib/plugins/openapi/interfaces.d.ts +19 -13
  201. package/dist/lib/plugins/openapi/playground/Playground.js +8 -4
  202. package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
  203. package/dist/lib/plugins/openapi/playground/fileUtils.d.ts +1 -0
  204. package/dist/lib/plugins/openapi/playground/fileUtils.js +3 -0
  205. package/dist/lib/plugins/openapi/playground/fileUtils.js.map +1 -1
  206. package/dist/lib/plugins/openapi/playground/result-panel/AudioPlayer.d.ts +6 -0
  207. package/dist/lib/plugins/openapi/playground/result-panel/AudioPlayer.js +20 -0
  208. package/dist/lib/plugins/openapi/playground/result-panel/AudioPlayer.js.map +1 -0
  209. package/dist/lib/plugins/openapi/playground/result-panel/ResponseTab.js +7 -2
  210. package/dist/lib/plugins/openapi/playground/result-panel/ResponseTab.js.map +1 -1
  211. package/dist/lib/plugins/openapi/schema/SchemaView.d.ts +1 -1
  212. package/dist/lib/plugins/openapi/schema/SchemaView.js +16 -7
  213. package/dist/lib/plugins/openapi/schema/SchemaView.js.map +1 -1
  214. package/dist/lib/plugins/openapi/schema/utils.d.ts +2 -2
  215. package/dist/lib/plugins/openapi/schema/utils.js +11 -3
  216. package/dist/lib/plugins/openapi/schema/utils.js.map +1 -1
  217. package/dist/lib/plugins/openapi/util/createHttpSnippet.js +24 -1
  218. package/dist/lib/plugins/openapi/util/createHttpSnippet.js.map +1 -1
  219. package/dist/lib/plugins/openapi/util/getRoutes.d.ts +9 -1
  220. package/dist/lib/plugins/openapi/util/getRoutes.js +30 -2
  221. package/dist/lib/plugins/openapi/util/getRoutes.js.map +1 -1
  222. package/dist/lib/plugins/search-pagefind/IndexingDialog.d.ts +3 -0
  223. package/dist/lib/plugins/search-pagefind/IndexingDialog.js +64 -0
  224. package/dist/lib/plugins/search-pagefind/IndexingDialog.js.map +1 -0
  225. package/dist/lib/plugins/search-pagefind/PagefindSearch.js +22 -5
  226. package/dist/lib/plugins/search-pagefind/PagefindSearch.js.map +1 -1
  227. package/dist/lib/plugins/search-pagefind/ResultList.js +5 -4
  228. package/dist/lib/plugins/search-pagefind/ResultList.js.map +1 -1
  229. package/dist/lib/shiki.d.ts +1 -1
  230. package/dist/lib/shiki.js +18 -12
  231. package/dist/lib/shiki.js.map +1 -1
  232. package/dist/lib/ui/Alert.d.ts +3 -2
  233. package/dist/lib/ui/Alert.js +9 -5
  234. package/dist/lib/ui/Alert.js.map +1 -1
  235. package/dist/lib/ui/Button.d.ts +2 -2
  236. package/dist/lib/ui/Button.js +10 -9
  237. package/dist/lib/ui/Button.js.map +1 -1
  238. package/dist/lib/ui/ButtonGroup.d.ts +11 -0
  239. package/dist/lib/ui/ButtonGroup.js +28 -0
  240. package/dist/lib/ui/ButtonGroup.js.map +1 -0
  241. package/dist/lib/ui/Command.d.ts +3 -3
  242. package/dist/lib/ui/Command.js +2 -2
  243. package/dist/lib/ui/Command.js.map +1 -1
  244. package/dist/lib/ui/DropdownMenu.d.ts +21 -23
  245. package/dist/lib/ui/DropdownMenu.js +47 -32
  246. package/dist/lib/ui/DropdownMenu.js.map +1 -1
  247. package/dist/lib/ui/InputGroup.d.ts +16 -0
  248. package/dist/lib/ui/InputGroup.js +65 -0
  249. package/dist/lib/ui/InputGroup.js.map +1 -0
  250. package/dist/lib/ui/Kbd.d.ts +3 -0
  251. package/dist/lib/ui/Kbd.js +10 -0
  252. package/dist/lib/ui/Kbd.js.map +1 -0
  253. package/dist/lib/ui/Secret.js +2 -2
  254. package/dist/lib/ui/Secret.js.map +1 -1
  255. package/dist/lib/util/MdxComponents.d.ts +1 -0
  256. package/dist/lib/util/MdxComponents.js +2 -0
  257. package/dist/lib/util/MdxComponents.js.map +1 -1
  258. package/dist/lib/util/flattenAllOf.d.ts +0 -2
  259. package/dist/lib/util/flattenAllOf.js +0 -23
  260. package/dist/lib/util/flattenAllOf.js.map +1 -1
  261. package/dist/lib/util/flattenAllOf.test.js +69 -13
  262. package/dist/lib/util/flattenAllOf.test.js.map +1 -1
  263. package/dist/lib/util/flattenAllOfProcessor.d.ts +2 -0
  264. package/dist/lib/util/flattenAllOfProcessor.js +48 -0
  265. package/dist/lib/util/flattenAllOfProcessor.js.map +1 -0
  266. package/dist/lib/util/invariant.d.ts +1 -1
  267. package/dist/lib/util/invariant.js +2 -2
  268. package/dist/lib/util/invariant.js.map +1 -1
  269. package/dist/lib/util/readFrontmatter.d.ts +6 -0
  270. package/dist/lib/util/readFrontmatter.js +13 -0
  271. package/dist/lib/util/readFrontmatter.js.map +1 -0
  272. package/dist/vite/api/SchemaManager.d.ts +17 -1
  273. package/dist/vite/api/SchemaManager.js +52 -11
  274. package/dist/vite/api/SchemaManager.js.map +1 -1
  275. package/dist/vite/api/SchemaManager.test.js +111 -0
  276. package/dist/vite/api/SchemaManager.test.js.map +1 -1
  277. package/dist/vite/build.js +91 -73
  278. package/dist/vite/build.js.map +1 -1
  279. package/dist/vite/config.js +16 -1
  280. package/dist/vite/config.js.map +1 -1
  281. package/dist/vite/dev-server.js +25 -0
  282. package/dist/vite/dev-server.js.map +1 -1
  283. package/dist/vite/error-handler.js +1 -5
  284. package/dist/vite/error-handler.js.map +1 -1
  285. package/dist/vite/mdx/remark-inject-filepath.js +5 -1
  286. package/dist/vite/mdx/remark-inject-filepath.js.map +1 -1
  287. package/dist/vite/mdx/remark-last-modified.js +57 -3
  288. package/dist/vite/mdx/remark-last-modified.js.map +1 -1
  289. package/dist/vite/mdx/remark-link-rewrite.js +4 -3
  290. package/dist/vite/mdx/remark-link-rewrite.js.map +1 -1
  291. package/dist/vite/pagefind-dev-index.d.ts +16 -0
  292. package/dist/vite/pagefind-dev-index.js +68 -0
  293. package/dist/vite/pagefind-dev-index.js.map +1 -0
  294. package/dist/vite/plugin-api-keys.js +5 -1
  295. package/dist/vite/plugin-api-keys.js.map +1 -1
  296. package/dist/vite/plugin-api.js +44 -4
  297. package/dist/vite/plugin-api.js.map +1 -1
  298. package/dist/vite/plugin-config.js +16 -4
  299. package/dist/vite/plugin-config.js.map +1 -1
  300. package/dist/vite/plugin-docs.js +9 -7
  301. package/dist/vite/plugin-docs.js.map +1 -1
  302. package/dist/vite/plugin-frontmatter.js +3 -5
  303. package/dist/vite/plugin-frontmatter.js.map +1 -1
  304. package/dist/vite/plugin-markdown-export.js +8 -7
  305. package/dist/vite/plugin-markdown-export.js.map +1 -1
  306. package/dist/vite/plugin-theme.js +2 -1
  307. package/dist/vite/plugin-theme.js.map +1 -1
  308. package/dist/vite/prerender/prerender.js +4 -20
  309. package/dist/vite/prerender/prerender.js.map +1 -1
  310. package/dist/vite/prerender/utils.d.ts +2 -0
  311. package/dist/vite/prerender/utils.js +30 -0
  312. package/dist/vite/prerender/utils.js.map +1 -0
  313. package/dist/vite/prerender/worker.js +6 -1
  314. package/dist/vite/prerender/worker.js.map +1 -1
  315. package/dist/vite/zuplo.d.ts +13 -0
  316. package/dist/vite/zuplo.js +15 -0
  317. package/dist/vite/zuplo.js.map +1 -0
  318. package/lib/ActionButton-B0CXL1Lq.js +25 -0
  319. package/lib/ActionButton-B0CXL1Lq.js.map +1 -0
  320. package/lib/Button-GUVe7pmt.js +54 -0
  321. package/lib/Button-GUVe7pmt.js.map +1 -0
  322. package/lib/{Card-KFniaZn5.js → Card-DCdq37aA.js} +2 -2
  323. package/lib/{Card-KFniaZn5.js.map → Card-DCdq37aA.js.map} +1 -1
  324. package/lib/ClaudeLogo-DoZ7fHHk.js +73 -0
  325. package/lib/ClaudeLogo-DoZ7fHHk.js.map +1 -0
  326. package/lib/{Command-CUcrW3qs.js → Command-N6VujV30.js} +26 -26
  327. package/lib/Command-N6VujV30.js.map +1 -0
  328. package/lib/{Dialog-BQciPiHN.js → Dialog-hlvmmQ_c.js} +2 -2
  329. package/lib/{Dialog-BQciPiHN.js.map → Dialog-hlvmmQ_c.js.map} +1 -1
  330. package/lib/{Drawer-Ci7XwhqT.js → Drawer-Ch7927PF.js} +7 -7
  331. package/lib/{Drawer-Ci7XwhqT.js.map → Drawer-Ch7927PF.js.map} +1 -1
  332. package/lib/DropdownMenu-DN0jNrjj.js +104 -0
  333. package/lib/DropdownMenu-DN0jNrjj.js.map +1 -0
  334. package/lib/Frame-DKlOmSkU.js +205 -0
  335. package/lib/Frame-DKlOmSkU.js.map +1 -0
  336. package/lib/HydrationBoundary-CJu4vUlG.js +601 -0
  337. package/lib/HydrationBoundary-CJu4vUlG.js.map +1 -0
  338. package/lib/IndexingDialog-D0YdGfbn.js +100 -0
  339. package/lib/IndexingDialog-D0YdGfbn.js.map +1 -0
  340. package/lib/Input-Cx-GeKoF.js +22 -0
  341. package/lib/Input-Cx-GeKoF.js.map +1 -0
  342. package/lib/MdxPage-Bc_5OsQ5.js +210 -0
  343. package/lib/MdxPage-Bc_5OsQ5.js.map +1 -0
  344. package/lib/Mermaid-Chx5BPHn.js +104 -0
  345. package/lib/Mermaid-Chx5BPHn.js.map +1 -0
  346. package/lib/{OAuthErrorPage-DnKnq4xK.js → OAuthErrorPage-D-VcZ5cO.js} +26 -23
  347. package/lib/OAuthErrorPage-D-VcZ5cO.js.map +1 -0
  348. package/lib/OasProvider-CZqLHoRo.js +48 -0
  349. package/lib/OasProvider-CZqLHoRo.js.map +1 -0
  350. package/lib/{OperationList-D8EDc9v7.js → OperationList-BmV1XvEY.js} +2136 -2002
  351. package/lib/OperationList-BmV1XvEY.js.map +1 -0
  352. package/lib/RouteGuard-Dns7HD7C.js +77 -0
  353. package/lib/RouteGuard-Dns7HD7C.js.map +1 -0
  354. package/lib/{SchemaList-E6lF7dID.js → SchemaList-D23IyrX5.js} +28 -27
  355. package/lib/SchemaList-D23IyrX5.js.map +1 -0
  356. package/lib/SchemaView-DVbiGPo3.js +438 -0
  357. package/lib/SchemaView-DVbiGPo3.js.map +1 -0
  358. package/lib/Secret-CyhXSA8i.js +263 -0
  359. package/lib/Secret-CyhXSA8i.js.map +1 -0
  360. package/lib/SignUp-DfEe1w5X.js +55 -0
  361. package/lib/SignUp-DfEe1w5X.js.map +1 -0
  362. package/lib/{SyntaxHighlight-C19vH0V_.js → SyntaxHighlight-N2RffYNz.js} +1469 -1411
  363. package/lib/SyntaxHighlight-N2RffYNz.js.map +1 -0
  364. package/lib/{Toc-DbWS75JZ.js → Toc-Cpo_HSYx.js} +3 -3
  365. package/lib/{Toc-DbWS75JZ.js.map → Toc-Cpo_HSYx.js.map} +1 -1
  366. package/lib/{ErrorAlert-_1Zmhr68.js → Zudoku-GbutmWzP.js} +5663 -4482
  367. package/lib/Zudoku-GbutmWzP.js.map +1 -0
  368. package/lib/ZudokuContext-LPkD2SQs.js +250 -0
  369. package/lib/ZudokuContext-LPkD2SQs.js.map +1 -0
  370. package/lib/ZudokuReactContext-DGJAP1sN.js +222 -0
  371. package/lib/ZudokuReactContext-DGJAP1sN.js.map +1 -0
  372. package/lib/chunk-EPOLDU6W-C6C8jAwd.js +8558 -0
  373. package/lib/chunk-EPOLDU6W-C6C8jAwd.js.map +1 -0
  374. package/lib/{circular-BoYo7au5.js → circular-DfSpMuY7.js} +6429 -6019
  375. package/lib/circular-DfSpMuY7.js.map +1 -0
  376. package/lib/{cn-dYga0KKN.js → cn-5-Gd1Dss.js} +531 -498
  377. package/lib/cn-5-Gd1Dss.js.map +1 -0
  378. package/lib/{createServer-B_BZ7xX8.js → createServer-4kaAMuIM.js} +2790 -2737
  379. package/lib/createServer-4kaAMuIM.js.map +1 -0
  380. package/lib/createVariantComponent-Dc0vtOvr.js +18 -0
  381. package/lib/createVariantComponent-Dc0vtOvr.js.map +1 -0
  382. package/lib/{errors-CD873hrG.js → errors-CtZTDEB6.js} +3 -3
  383. package/lib/{errors-CD873hrG.js.map → errors-CtZTDEB6.js.map} +1 -1
  384. package/lib/firebase-D286uF4e.js +7615 -0
  385. package/lib/firebase-D286uF4e.js.map +1 -0
  386. package/lib/hook-DyEn6D2Q.js +53 -0
  387. package/lib/hook-DyEn6D2Q.js.map +1 -0
  388. package/lib/{index-HNVs5cgX.js → index-B7bvsQHg.js} +853 -802
  389. package/lib/index-B7bvsQHg.js.map +1 -0
  390. package/lib/{index-BK0jKRrX.js → index-CVumYRba.js} +2 -2
  391. package/lib/{index-BK0jKRrX.js.map → index-CVumYRba.js.map} +1 -1
  392. package/lib/index-CrcNWbel.js.map +1 -1
  393. package/lib/index-DAWHN3cH.js +86 -0
  394. package/lib/index-DAWHN3cH.js.map +1 -0
  395. package/lib/index.esm-BYObtETB.js.map +1 -1
  396. package/lib/index.esm-BkpWrvLZ.js +34 -0
  397. package/lib/index.esm-BkpWrvLZ.js.map +1 -0
  398. package/lib/{index.esm-BnYHxCYC.js → index.esm-Ca5zvoff.js} +2 -2
  399. package/lib/{index.esm-BnYHxCYC.js.map → index.esm-Ca5zvoff.js.map} +1 -1
  400. package/lib/{invariant-Bm-FVUQE.js → invariant-B_t_F2s_.js} +4 -4
  401. package/lib/invariant-B_t_F2s_.js.map +1 -0
  402. package/lib/jsx-runtime-BzflLqGi.js.map +1 -1
  403. package/lib/{mutation-BSU0xu4m.js → mutation-B7eFBLZY.js} +70 -44
  404. package/lib/mutation-B7eFBLZY.js.map +1 -0
  405. package/lib/ui/Accordion.js +1 -1
  406. package/lib/ui/ActionButton.js +2 -2
  407. package/lib/ui/Alert.js +32 -20
  408. package/lib/ui/Alert.js.map +1 -1
  409. package/lib/ui/AlertDialog.js +1 -1
  410. package/lib/ui/Badge.js +1 -1
  411. package/lib/ui/Breadcrumb.js +1 -1
  412. package/lib/ui/Button.js +27 -25
  413. package/lib/ui/Button.js.map +1 -1
  414. package/lib/ui/ButtonGroup.js +77 -0
  415. package/lib/ui/ButtonGroup.js.map +1 -0
  416. package/lib/ui/Callout.js +1 -1
  417. package/lib/ui/Card.js +1 -1
  418. package/lib/ui/Carousel.js +1 -1
  419. package/lib/ui/Carousel.js.map +1 -1
  420. package/lib/ui/Checkbox.js +1 -1
  421. package/lib/ui/CodeBlock.js +1 -1
  422. package/lib/ui/Command.js +5 -5
  423. package/lib/ui/Command.js.map +1 -1
  424. package/lib/ui/Dialog.js +1 -1
  425. package/lib/ui/Drawer.js +3 -3
  426. package/lib/ui/DropdownMenu.js +227 -140
  427. package/lib/ui/DropdownMenu.js.map +1 -1
  428. package/lib/ui/EmbeddedCodeBlock.js +1 -1
  429. package/lib/ui/Form.js +1 -1
  430. package/lib/ui/Frame.js +1 -1
  431. package/lib/ui/HoverCard.js +1 -1
  432. package/lib/ui/Input.js +1 -1
  433. package/lib/ui/InputGroup.js +155 -0
  434. package/lib/ui/InputGroup.js.map +1 -0
  435. package/lib/ui/Item.js +1 -1
  436. package/lib/ui/Kbd.js +32 -0
  437. package/lib/ui/Kbd.js.map +1 -0
  438. package/lib/ui/Label.js +1 -1
  439. package/lib/ui/NativeSelect.js +1 -1
  440. package/lib/ui/Pagination.js +1 -1
  441. package/lib/ui/Popover.js +1 -1
  442. package/lib/ui/Progress.js +1 -1
  443. package/lib/ui/RadioGroup.js +1 -1
  444. package/lib/ui/ScrollArea.js +1 -1
  445. package/lib/ui/Secret.js +3 -3
  446. package/lib/ui/Secret.js.map +1 -1
  447. package/lib/ui/Separator.js +1 -1
  448. package/lib/ui/Skeleton.js +1 -1
  449. package/lib/ui/Slider.js +1 -1
  450. package/lib/ui/Switch.js +1 -1
  451. package/lib/ui/SyntaxHighlight.js +3 -3
  452. package/lib/ui/Tabs.js +1 -1
  453. package/lib/ui/Textarea.js +1 -1
  454. package/lib/ui/Toggle.js +1 -1
  455. package/lib/ui/ToggleGroup.js +1 -1
  456. package/lib/ui/Value.js +1 -1
  457. package/lib/ui/util.js +1 -1
  458. package/lib/useExposedProps-CzTDfXfq.js +30 -0
  459. package/lib/useExposedProps-CzTDfXfq.js.map +1 -0
  460. package/lib/useMutation-CErliDZ9.js +119 -0
  461. package/lib/useMutation-CErliDZ9.js.map +1 -0
  462. package/lib/useQuery-ht7aWJ3S.js +1212 -0
  463. package/lib/useQuery-ht7aWJ3S.js.map +1 -0
  464. package/lib/useSuspenseQuery-DQH4Bmc2.js +18 -0
  465. package/lib/useSuspenseQuery-DQH4Bmc2.js.map +1 -0
  466. package/lib/zudoku.__internal.js +1540 -1553
  467. package/lib/zudoku.__internal.js.map +1 -1
  468. package/lib/zudoku.auth-auth0.js +19 -18
  469. package/lib/zudoku.auth-auth0.js.map +1 -1
  470. package/lib/zudoku.auth-azureb2c.js +14 -13
  471. package/lib/zudoku.auth-azureb2c.js.map +1 -1
  472. package/lib/zudoku.auth-clerk.js +52 -75
  473. package/lib/zudoku.auth-clerk.js.map +1 -1
  474. package/lib/zudoku.auth-firebase.js +10 -0
  475. package/lib/zudoku.auth-firebase.js.map +1 -0
  476. package/lib/zudoku.auth-openid.js +8 -7
  477. package/lib/zudoku.auth-openid.js.map +1 -1
  478. package/lib/zudoku.auth-supabase.js +31 -40
  479. package/lib/zudoku.auth-supabase.js.map +1 -1
  480. package/lib/zudoku.components.js +29 -25
  481. package/lib/zudoku.components.js.map +1 -1
  482. package/lib/zudoku.hooks.js +20 -20
  483. package/lib/zudoku.hooks.js.map +1 -1
  484. package/lib/zudoku.mermaid.js +11 -0
  485. package/lib/zudoku.mermaid.js.map +1 -0
  486. package/lib/zudoku.plugin-api-catalog.js +42 -37
  487. package/lib/zudoku.plugin-api-catalog.js.map +1 -1
  488. package/lib/zudoku.plugin-api-keys.js +617 -550
  489. package/lib/zudoku.plugin-api-keys.js.map +1 -1
  490. package/lib/zudoku.plugin-custom-pages.js +1 -1
  491. package/lib/zudoku.plugin-markdown.js +1 -1
  492. package/lib/zudoku.plugin-openapi.js +3 -3
  493. package/lib/zudoku.plugin-redirect.js +1 -1
  494. package/lib/zudoku.plugin-search-pagefind.js +186 -226
  495. package/lib/zudoku.plugin-search-pagefind.js.map +1 -1
  496. package/lib/zudoku.plugins.js +9 -8
  497. package/lib/zudoku.plugins.js.map +1 -1
  498. package/lib/zudoku.react-query.js +441 -0
  499. package/lib/zudoku.react-query.js.map +1 -0
  500. package/lib/zudoku.router.js +1130 -1404
  501. package/lib/zudoku.router.js.map +1 -1
  502. package/package.json +63 -37
  503. package/src/app/defaultTheme.css +4 -0
  504. package/src/app/main.css +2 -0
  505. package/src/app/main.tsx +1 -1
  506. package/src/app/sentry.ts +1 -1
  507. package/src/lib/auth/issuer.ts +1 -1
  508. package/src/lib/authentication/authentication.ts +8 -2
  509. package/src/lib/authentication/components/CallbackHandler.tsx +1 -1
  510. package/src/lib/authentication/components/SignIn.tsx +5 -2
  511. package/src/lib/authentication/components/SignUp.tsx +5 -2
  512. package/src/lib/authentication/hook.ts +16 -0
  513. package/src/lib/authentication/providers/auth0.tsx +21 -10
  514. package/src/lib/authentication/providers/clerk.tsx +0 -26
  515. package/src/lib/authentication/providers/firebase.tsx +98 -6
  516. package/src/lib/authentication/providers/supabase.tsx +6 -15
  517. package/src/lib/authentication/ui/EmailVerificationUi.tsx +129 -0
  518. package/src/lib/authentication/ui/ZudokuAuthUi.tsx +181 -39
  519. package/src/lib/authentication/utils/relativeRedirectUrl.ts +12 -0
  520. package/src/lib/components/Bootstrap.tsx +1 -4
  521. package/src/lib/components/Mermaid.tsx +68 -0
  522. package/src/lib/components/MobileTopNavigation.tsx +16 -9
  523. package/src/lib/components/PagefindSearchMeta.tsx +14 -0
  524. package/src/lib/components/Pagination.tsx +4 -5
  525. package/src/lib/components/Slot.test.tsx +1 -1
  526. package/src/lib/components/TopNavigation.tsx +26 -8
  527. package/src/lib/components/Zudoku.tsx +22 -21
  528. package/src/lib/components/context/ZudokuContext.ts +33 -12
  529. package/src/lib/components/context/ZudokuProvider.tsx +1 -1
  530. package/src/lib/components/context/ZudokuReactContext.tsx +17 -0
  531. package/src/lib/components/index.ts +19 -35
  532. package/src/lib/components/navigation/Navigation.tsx +4 -3
  533. package/src/lib/components/navigation/NavigationCategory.tsx +9 -0
  534. package/src/lib/components/navigation/NavigationFilterContext.tsx +28 -0
  535. package/src/lib/components/navigation/NavigationFilterInput.tsx +35 -0
  536. package/src/lib/components/navigation/NavigationItem.tsx +26 -4
  537. package/src/lib/components/navigation/NavigationWrapper.tsx +1 -1
  538. package/src/lib/components/navigation/utils.ts +44 -2
  539. package/src/lib/core/RouteGuard.tsx +30 -24
  540. package/src/lib/core/ZudokuContext.ts +7 -1
  541. package/src/lib/core/__internal.tsx +2 -0
  542. package/src/lib/core/plugins.ts +27 -3
  543. package/src/lib/core/react-query.ts +1 -0
  544. package/src/lib/core/transform-config.test.tsx +99 -0
  545. package/src/lib/core/transform-config.ts +67 -0
  546. package/src/lib/errors/ErrorAlert.tsx +1 -6
  547. package/src/lib/errors/ErrorMessage.tsx +38 -0
  548. package/src/lib/hooks/index.ts +7 -16
  549. package/src/lib/hooks/useEvent.test.tsx +1 -1
  550. package/src/lib/navigation/pathMatcher.test.ts +136 -0
  551. package/src/lib/navigation/pathMatcher.ts +93 -0
  552. package/src/lib/navigation/positionItems.test.ts +265 -0
  553. package/src/lib/navigation/positionItems.ts +111 -0
  554. package/src/lib/oas/graphql/circular.test.ts +221 -0
  555. package/src/lib/oas/graphql/circular.ts +31 -18
  556. package/src/lib/oas/graphql/index.ts +7 -3
  557. package/src/lib/oas/parser/index.ts +19 -6
  558. package/src/lib/plugins/api-keys/SettingsApiKeys.tsx +36 -476
  559. package/src/lib/plugins/api-keys/index.tsx +76 -32
  560. package/src/lib/plugins/api-keys/settings/ApiKeyItem.tsx +342 -0
  561. package/src/lib/plugins/api-keys/settings/ApiKeyList.tsx +67 -0
  562. package/src/lib/plugins/api-keys/settings/RevealApiKey.tsx +124 -0
  563. package/src/lib/plugins/openapi/DownloadSchemaButton.tsx +115 -0
  564. package/src/lib/plugins/openapi/Endpoint.tsx +20 -27
  565. package/src/lib/plugins/openapi/GeneratedExampleSidecarBox.tsx +1 -1
  566. package/src/lib/plugins/openapi/OasProvider.tsx +38 -17
  567. package/src/lib/plugins/openapi/OperationList.tsx +48 -28
  568. package/src/lib/plugins/openapi/OperationListItem.tsx +5 -5
  569. package/src/lib/plugins/openapi/ParamInfos.tsx +1 -0
  570. package/src/lib/plugins/openapi/ParameterList.tsx +2 -2
  571. package/src/lib/plugins/openapi/ResponsesSidecarBox.tsx +37 -15
  572. package/src/lib/plugins/openapi/SchemaList.tsx +4 -0
  573. package/src/lib/plugins/openapi/Sidecar.tsx +20 -3
  574. package/src/lib/plugins/openapi/index.tsx +16 -7
  575. package/src/lib/plugins/openapi/interfaces.ts +21 -7
  576. package/src/lib/plugins/openapi/playground/Playground.tsx +8 -4
  577. package/src/lib/plugins/openapi/playground/fileUtils.ts +4 -0
  578. package/src/lib/plugins/openapi/playground/result-panel/AudioPlayer.tsx +50 -0
  579. package/src/lib/plugins/openapi/playground/result-panel/ResponseTab.tsx +33 -17
  580. package/src/lib/plugins/openapi/schema/SchemaView.tsx +56 -43
  581. package/src/lib/plugins/openapi/schema/utils.ts +20 -6
  582. package/src/lib/plugins/openapi/util/createHttpSnippet.ts +29 -1
  583. package/src/lib/plugins/openapi/util/getRoutes.tsx +38 -3
  584. package/src/lib/plugins/search-pagefind/IndexingDialog.tsx +163 -0
  585. package/src/lib/plugins/search-pagefind/PagefindSearch.tsx +61 -22
  586. package/src/lib/plugins/search-pagefind/ResultList.tsx +8 -3
  587. package/src/lib/shiki.ts +21 -12
  588. package/src/lib/ui/Alert.tsx +17 -5
  589. package/src/lib/ui/Button.tsx +11 -10
  590. package/src/lib/ui/ButtonGroup.tsx +82 -0
  591. package/src/lib/ui/Command.tsx +3 -3
  592. package/src/lib/ui/DropdownMenu.tsx +226 -170
  593. package/src/lib/ui/InputGroup.tsx +168 -0
  594. package/src/lib/ui/Kbd.tsx +28 -0
  595. package/src/lib/ui/Secret.tsx +2 -2
  596. package/src/lib/util/MdxComponents.tsx +2 -0
  597. package/src/lib/util/flattenAllOf.test.ts +73 -20
  598. package/src/lib/util/flattenAllOf.ts +0 -36
  599. package/src/lib/util/flattenAllOfProcessor.ts +58 -0
  600. package/src/lib/util/invariant.ts +2 -1
  601. package/src/lib/util/readFrontmatter.ts +14 -0
  602. package/src/shiki/langs/c3.js +1 -0
  603. package/src/shiki/langs/gn.js +1 -0
  604. package/src/shiki/langs/markdown-nix.js +1 -0
  605. package/src/shiki/langs/moonbit.js +1 -0
  606. package/src/shiki/langs/openscad.js +1 -0
  607. package/src/zuplo/enrich-with-zuplo-mcp.ts +168 -0
  608. package/src/zuplo/enrich-with-zuplo.ts +254 -0
  609. package/src/zuplo/policy-types.ts +46 -0
  610. package/src/zuplo/with-zuplo-processors.ts +35 -0
  611. package/src/zuplo/with-zuplo.ts +14 -0
  612. package/dist/vite/create-pagefind-index.d.ts +0 -4
  613. package/dist/vite/create-pagefind-index.js +0 -12
  614. package/dist/vite/create-pagefind-index.js.map +0 -1
  615. package/lib/Button-B3ucvvQw.js +0 -52
  616. package/lib/Button-B3ucvvQw.js.map +0 -1
  617. package/lib/Command-CUcrW3qs.js.map +0 -1
  618. package/lib/DropdownMenu-BZ2NKQ3K.js +0 -126
  619. package/lib/DropdownMenu-BZ2NKQ3K.js.map +0 -1
  620. package/lib/ErrorAlert-_1Zmhr68.js.map +0 -1
  621. package/lib/MdxPage-B2t1EShN.js +0 -240
  622. package/lib/MdxPage-B2t1EShN.js.map +0 -1
  623. package/lib/OAuthErrorPage-DnKnq4xK.js.map +0 -1
  624. package/lib/OasProvider-BhuIkD4Z.js +0 -36
  625. package/lib/OasProvider-BhuIkD4Z.js.map +0 -1
  626. package/lib/OperationList-D8EDc9v7.js.map +0 -1
  627. package/lib/Pagination-hk-llhpw.js +0 -37
  628. package/lib/Pagination-hk-llhpw.js.map +0 -1
  629. package/lib/RouteGuard-Brz95MSt.js +0 -77
  630. package/lib/RouteGuard-Brz95MSt.js.map +0 -1
  631. package/lib/RouterError-CMaIfdjb.js +0 -42
  632. package/lib/RouterError-CMaIfdjb.js.map +0 -1
  633. package/lib/SchemaList-E6lF7dID.js.map +0 -1
  634. package/lib/SchemaView-CIv-OXgv.js +0 -572
  635. package/lib/SchemaView-CIv-OXgv.js.map +0 -1
  636. package/lib/Select-DFRCS31-.js +0 -399
  637. package/lib/Select-DFRCS31-.js.map +0 -1
  638. package/lib/SignUp-sGYAsj2K.js +0 -50
  639. package/lib/SignUp-sGYAsj2K.js.map +0 -1
  640. package/lib/SyntaxHighlight-C19vH0V_.js.map +0 -1
  641. package/lib/ZudokuContext-BUZ5hkWB.js +0 -1508
  642. package/lib/ZudokuContext-BUZ5hkWB.js.map +0 -1
  643. package/lib/chunk-PVWAREVJ-BMhpCH5D.js +0 -7965
  644. package/lib/chunk-PVWAREVJ-BMhpCH5D.js.map +0 -1
  645. package/lib/circular-BoYo7au5.js.map +0 -1
  646. package/lib/cn-dYga0KKN.js.map +0 -1
  647. package/lib/createServer-B_BZ7xX8.js.map +0 -1
  648. package/lib/hook-CMeoxziF.js +0 -40
  649. package/lib/hook-CMeoxziF.js.map +0 -1
  650. package/lib/index-HNVs5cgX.js.map +0 -1
  651. package/lib/index-pMMX55GH.js +0 -1059
  652. package/lib/index-pMMX55GH.js.map +0 -1
  653. package/lib/invariant-Bm-FVUQE.js.map +0 -1
  654. package/lib/mutation-BSU0xu4m.js.map +0 -1
  655. package/lib/useExposedProps-U3pmsHaG.js +0 -113
  656. package/lib/useExposedProps-U3pmsHaG.js.map +0 -1
@@ -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
+ };
@@ -0,0 +1,265 @@
1
+ import { describe, expect, it, vi } from "vitest";
2
+ import type { AtPosition } from "../../config/validators/InputNavigationSchema.js";
3
+ import type { NavigationItem } from "../../config/validators/NavigationSchema.js";
4
+ import { repositionItems } from "./positionItems.js";
5
+
6
+ type NavigationItemWithAt = NavigationItem & { at?: AtPosition };
7
+
8
+ describe("positionItems", () => {
9
+ it("should return navigation unchanged if no items have `at` property", () => {
10
+ const navigation: NavigationItem[] = [
11
+ { type: "link", label: "Home", to: "/" },
12
+ { type: "link", label: "About", to: "/about" },
13
+ ];
14
+
15
+ const result = repositionItems(navigation);
16
+ expect(result).toEqual(navigation);
17
+ });
18
+
19
+ it("should position item with 'before' relative to target", () => {
20
+ const navigation: NavigationItemWithAt[] = [
21
+ {
22
+ type: "category",
23
+ label: "Docs",
24
+ items: [
25
+ { type: "link", label: "First", to: "/first" },
26
+ { type: "link", label: "Second", to: "/second" },
27
+ ],
28
+ },
29
+ {
30
+ type: "link",
31
+ label: "Inserted",
32
+ to: "/inserted",
33
+ at: { path: "Docs/Second", position: "before" },
34
+ },
35
+ ];
36
+
37
+ const result = repositionItems(navigation);
38
+ const docsCategory = result[0];
39
+
40
+ expect(docsCategory).toBeDefined();
41
+ expect(docsCategory?.type).toBe("category");
42
+ if (docsCategory?.type === "category") {
43
+ expect(docsCategory.items[0]?.label).toBe("First");
44
+ expect(docsCategory.items[1]?.label).toBe("Inserted");
45
+ expect(docsCategory.items[2]?.label).toBe("Second");
46
+ }
47
+ });
48
+
49
+ it("should position item with 'after' relative to target", () => {
50
+ const navigation: NavigationItemWithAt[] = [
51
+ {
52
+ type: "category",
53
+ label: "Docs",
54
+ items: [
55
+ { type: "link", label: "First", to: "/first" },
56
+ { type: "link", label: "Second", to: "/second" },
57
+ ],
58
+ },
59
+ {
60
+ type: "link",
61
+ label: "Inserted",
62
+ to: "/inserted",
63
+ at: { path: "Docs/First", position: "after" },
64
+ },
65
+ ];
66
+
67
+ const result = repositionItems(navigation);
68
+ const docsCategory = result[0];
69
+
70
+ expect(docsCategory).toBeDefined();
71
+ expect(docsCategory?.type).toBe("category");
72
+ if (docsCategory?.type === "category") {
73
+ expect(docsCategory.items[0]?.label).toBe("First");
74
+ expect(docsCategory.items[1]?.label).toBe("Inserted");
75
+ expect(docsCategory.items[2]?.label).toBe("Second");
76
+ }
77
+ });
78
+
79
+ it("should handle multiple items with `at` property", () => {
80
+ const navigation: NavigationItemWithAt[] = [
81
+ {
82
+ type: "category",
83
+ label: "API",
84
+ items: [{ type: "link", label: "Original", to: "/original" }],
85
+ },
86
+ {
87
+ type: "link",
88
+ label: "First",
89
+ to: "/first",
90
+ at: { path: "API/Original", position: "before" },
91
+ },
92
+ {
93
+ type: "link",
94
+ label: "Last",
95
+ to: "/last",
96
+ at: { path: "API/Original", position: "after" },
97
+ },
98
+ ];
99
+
100
+ const result = repositionItems(navigation);
101
+ const apiCategory = result[0];
102
+
103
+ expect(apiCategory?.type).toBe("category");
104
+ if (apiCategory?.type === "category") {
105
+ expect(apiCategory?.items[0]?.label).toBe("First");
106
+ expect(apiCategory?.items[1]?.label).toBe("Original");
107
+ expect(apiCategory?.items[2]?.label).toBe("Last");
108
+ }
109
+ });
110
+
111
+ it("should handle nested items with `at` property", () => {
112
+ const navigation: NavigationItemWithAt[] = [
113
+ {
114
+ type: "category",
115
+ label: "Outer",
116
+ items: [{ type: "link", label: "Item", to: "/item" }],
117
+ },
118
+ {
119
+ type: "category",
120
+ label: "Inner Category",
121
+ at: { path: "Outer/Item", position: "after" },
122
+ items: [
123
+ {
124
+ type: "link",
125
+ label: "Nested",
126
+ to: "/nested",
127
+ at: { path: "Outer/Item", position: "after" },
128
+ },
129
+ ],
130
+ },
131
+ ];
132
+
133
+ const result = repositionItems(navigation);
134
+ const outerCategory = result[0];
135
+
136
+ expect(outerCategory).toBeDefined();
137
+ expect(outerCategory?.type).toBe("category");
138
+ if (outerCategory?.type === "category") {
139
+ // Both items positioned after Item
140
+ expect(outerCategory?.items.length).toBe(3);
141
+ expect(outerCategory?.items[0]?.label).toBe("Item");
142
+ expect(outerCategory?.items[1]?.label).toBe("Nested");
143
+ expect(outerCategory?.items[2]?.label).toBe("Inner Category");
144
+ }
145
+ });
146
+
147
+ it("should keep item at root if target path not found", () => {
148
+ const consoleWarnSpy = vi
149
+ .spyOn(console, "warn")
150
+ .mockImplementation(() => {});
151
+
152
+ const navigation: NavigationItemWithAt[] = [
153
+ { type: "link", label: "Home", to: "/" },
154
+ {
155
+ type: "link",
156
+ label: "Orphan",
157
+ to: "/orphan",
158
+ at: { path: "Nonexistent/Path", position: "before" },
159
+ },
160
+ ];
161
+
162
+ const result = repositionItems(navigation);
163
+
164
+ expect(result.length).toBe(2);
165
+ expect(result[1]?.label).toBe("Orphan");
166
+ expect("at" in (result[1] ?? {})).toBe(false);
167
+ expect(consoleWarnSpy).toHaveBeenCalledWith(
168
+ expect.stringContaining('target path "Nonexistent/Path" not found'),
169
+ );
170
+
171
+ consoleWarnSpy.mockRestore();
172
+ });
173
+
174
+ it("should remove `at` property from positioned items", () => {
175
+ const navigation: NavigationItemWithAt[] = [
176
+ { type: "link", label: "Target", to: "/target" },
177
+ {
178
+ type: "link",
179
+ label: "Item",
180
+ to: "/item",
181
+ at: { path: "Target", position: "before" },
182
+ },
183
+ ];
184
+
185
+ const result = repositionItems(navigation);
186
+
187
+ result.forEach((item) => {
188
+ expect("at" in item).toBe(false);
189
+ });
190
+ });
191
+
192
+ it("should handle positioning by index", () => {
193
+ const navigation: NavigationItemWithAt[] = [
194
+ {
195
+ type: "category",
196
+ label: "Shipments",
197
+ items: [
198
+ { type: "link", label: "Op1", to: "/op1" },
199
+ { type: "link", label: "Op2", to: "/op2" },
200
+ ],
201
+ },
202
+ {
203
+ type: "doc",
204
+ file: "overview",
205
+ label: "Overview",
206
+ path: "/overview",
207
+ at: { path: "Shipments/0", position: "before" },
208
+ },
209
+ ];
210
+
211
+ const result = repositionItems(navigation);
212
+ const shipmentsCategory = result[0];
213
+
214
+ expect(shipmentsCategory).toBeDefined();
215
+ expect(shipmentsCategory?.type).toBe("category");
216
+ if (shipmentsCategory?.type === "category") {
217
+ expect(shipmentsCategory.items[0]?.label).toBe("Overview");
218
+ expect(shipmentsCategory?.items[1]?.label).toBe("Op1");
219
+ expect(shipmentsCategory?.items[2]?.label).toBe("Op2");
220
+ }
221
+ });
222
+
223
+ it("should not share nested array references between failed and successful insertions", () => {
224
+ const consoleWarnSpy = vi
225
+ .spyOn(console, "warn")
226
+ .mockImplementation(() => {});
227
+
228
+ const navigation: NavigationItemWithAt[] = [
229
+ {
230
+ type: "category",
231
+ label: "Cat1",
232
+ items: [{ type: "link", label: "Original", to: "/original" }],
233
+ },
234
+ {
235
+ type: "link",
236
+ label: "BadTarget",
237
+ to: "/bad",
238
+ at: { path: "Nonexistent/Path", position: "before" },
239
+ },
240
+ {
241
+ type: "link",
242
+ label: "GoodTarget",
243
+ to: "/good",
244
+ at: { path: "Cat1/Original", position: "before" },
245
+ },
246
+ ];
247
+
248
+ const result = repositionItems(navigation);
249
+
250
+ // Verify BadTarget is at root level (failed positioning)
251
+ expect(result.length).toBe(2);
252
+ expect(result[1]?.label).toBe("BadTarget");
253
+
254
+ // Verify GoodTarget was inserted correctly into Cat1
255
+ const cat1 = result[0];
256
+ expect(cat1?.type).toBe("category");
257
+ if (cat1?.type === "category") {
258
+ expect(cat1.items.length).toBe(2);
259
+ expect(cat1.items[0]?.label).toBe("GoodTarget");
260
+ expect(cat1.items[1]?.label).toBe("Original");
261
+ }
262
+
263
+ consoleWarnSpy.mockRestore();
264
+ });
265
+ });
@@ -0,0 +1,111 @@
1
+ import type { AtPosition } from "../../config/validators/InputNavigationSchema.js";
2
+ import type {
3
+ NavigationCategory,
4
+ NavigationCustomPage,
5
+ NavigationDoc,
6
+ NavigationItem,
7
+ NavigationLink,
8
+ } from "../../config/validators/NavigationSchema.js";
9
+ import { findByPath } from "./pathMatcher.js";
10
+
11
+ type PositionedItem = (
12
+ | NavigationDoc
13
+ | NavigationLink
14
+ | NavigationCustomPage
15
+ | NavigationCategory
16
+ ) & { at: AtPosition };
17
+
18
+ export const isPositionedItem = (
19
+ item: NavigationItem,
20
+ ): item is PositionedItem => "at" in item && item.at !== undefined;
21
+
22
+ const cloneWithoutPositioned = (items: NavigationItem[]): NavigationItem[] =>
23
+ items.flatMap<NavigationItem>((item) =>
24
+ isPositionedItem(item)
25
+ ? []
26
+ : item.type === "category"
27
+ ? { ...item, items: cloneWithoutPositioned(item.items) }
28
+ : { ...item },
29
+ );
30
+
31
+ export const extractPositionedItems = (
32
+ navigation: NavigationItem[],
33
+ ): PositionedItem[] => {
34
+ return navigation.flatMap((item) => {
35
+ const nested =
36
+ item.type === "category" ? extractPositionedItems(item.items) : [];
37
+
38
+ return isPositionedItem(item) ? [item, ...nested] : nested;
39
+ });
40
+ };
41
+
42
+ const removeAt = ({ at: _at, ...item }: PositionedItem): NavigationItem => item;
43
+
44
+ const insertItem = (
45
+ navigation: NavigationItem[],
46
+ item: PositionedItem,
47
+ ): NavigationItem[] => {
48
+ const match = findByPath(navigation, item.at.path);
49
+
50
+ if (!match.found || !match.parentItems || match.index === undefined) {
51
+ // biome-ignore lint/suspicious/noConsole: Intentional warning for positioning debug
52
+ console.warn(
53
+ `Navigation positioning: target path "${item.at.path}" not found, keeping item in place`,
54
+ );
55
+
56
+ return [...navigation, removeAt(item)];
57
+ }
58
+
59
+ const insertIndex =
60
+ item.at.position === "before" ? match.index : match.index + 1;
61
+
62
+ match.parentItems.splice(insertIndex, 0, removeAt(item));
63
+
64
+ return navigation;
65
+ };
66
+
67
+ export const repositionItems = (
68
+ navigation: NavigationItem[],
69
+ ): NavigationItem[] => {
70
+ const itemsToPosition = extractPositionedItems(navigation);
71
+
72
+ if (itemsToPosition.length === 0) return navigation;
73
+
74
+ return itemsToPosition.reduce(
75
+ (result, item) => insertItem(result, item),
76
+ cloneWithoutPositioned(navigation),
77
+ );
78
+ };
79
+
80
+ // Filter and normalize positioned items for the current section
81
+ // Only keeps items whose paths start with topNavLabel, then strips that prefix
82
+ const filterAndNormalizePaths = (
83
+ items: PositionedItem[],
84
+ topNavLabel?: string,
85
+ ): PositionedItem[] => {
86
+ if (!topNavLabel) return [];
87
+
88
+ const normalizedLabel = topNavLabel.toLowerCase();
89
+
90
+ return items.flatMap((item) => {
91
+ const [firstSegment, ...rest] = item.at.path.split("/");
92
+ if (firstSegment?.toLowerCase() === normalizedLabel) {
93
+ return { ...item, at: { ...item.at, path: rest.join("/") } };
94
+ }
95
+ return [];
96
+ });
97
+ };
98
+
99
+ // Merge positioned items from rootNavigation into baseNavigation
100
+ // Normalizes paths to handle top-level category nesting
101
+ export const mergePositionedItems = (
102
+ baseNavigation: NavigationItem[],
103
+ rootNavigation: NavigationItem[],
104
+ topNavLabel?: string,
105
+ ): NavigationItem[] => {
106
+ const itemsToPosition = extractPositionedItems(rootNavigation);
107
+ const normalizedItems = filterAndNormalizePaths(itemsToPosition, topNavLabel);
108
+ const combined = [...baseNavigation, ...normalizedItems];
109
+
110
+ return repositionItems(combined);
111
+ };