zudoku 0.47.1 → 0.48.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (325) hide show
  1. package/dist/app/ZuploBuildConfig.d.ts +11 -121
  2. package/dist/app/ZuploBuildConfig.js +8 -8
  3. package/dist/app/ZuploBuildConfig.js.map +1 -1
  4. package/dist/app/demo.js +4 -3
  5. package/dist/app/demo.js.map +1 -1
  6. package/dist/app/entry.client.d.ts +0 -2
  7. package/dist/app/entry.client.js +0 -2
  8. package/dist/app/entry.client.js.map +1 -1
  9. package/dist/app/entry.server.d.ts +0 -2
  10. package/dist/app/entry.server.js +0 -2
  11. package/dist/app/entry.server.js.map +1 -1
  12. package/dist/app/env.d.ts +7 -7
  13. package/dist/app/env.js +8 -0
  14. package/dist/app/env.js.map +1 -1
  15. package/dist/app/main.d.ts +1 -0
  16. package/dist/app/main.js +6 -5
  17. package/dist/app/main.js.map +1 -1
  18. package/dist/app/standalone.js +4 -3
  19. package/dist/app/standalone.js.map +1 -1
  20. package/dist/config/loader.js +1 -2
  21. package/dist/config/loader.js.map +1 -1
  22. package/dist/config/validators/BuildSchema.d.ts +20 -44
  23. package/dist/config/validators/BuildSchema.js +3 -14
  24. package/dist/config/validators/BuildSchema.js.map +1 -1
  25. package/dist/config/validators/InputNavigationSchema.d.ts +7217 -0
  26. package/dist/config/validators/InputNavigationSchema.js +74 -0
  27. package/dist/config/validators/InputNavigationSchema.js.map +1 -0
  28. package/dist/config/validators/InputNavigationSchema.test-d.d.ts +1 -0
  29. package/dist/config/validators/InputNavigationSchema.test-d.js +146 -0
  30. package/dist/config/validators/InputNavigationSchema.test-d.js.map +1 -0
  31. package/dist/config/validators/NavigationSchema.d.ts +44 -0
  32. package/dist/config/validators/NavigationSchema.js +95 -0
  33. package/dist/config/validators/NavigationSchema.js.map +1 -0
  34. package/dist/config/validators/icon-types.d.ts +2 -1
  35. package/dist/config/validators/icon-types.js +1775 -1
  36. package/dist/config/validators/icon-types.js.map +1 -1
  37. package/dist/config/validators/validate.d.ts +451 -5666
  38. package/dist/config/validators/validate.js +59 -66
  39. package/dist/config/validators/validate.js.map +1 -1
  40. package/dist/config/validators/validate.test.js +0 -2
  41. package/dist/config/validators/validate.test.js.map +1 -1
  42. package/dist/index.d.ts +1 -1
  43. package/dist/index.js.map +1 -1
  44. package/dist/lib/auth/issuer.js +1 -1
  45. package/dist/lib/auth/issuer.js.map +1 -1
  46. package/dist/lib/auth/issuer.test.js +1 -1
  47. package/dist/lib/auth/issuer.test.js.map +1 -1
  48. package/dist/lib/authentication/components/CallbackHandler.js +1 -1
  49. package/dist/lib/authentication/components/CallbackHandler.js.map +1 -1
  50. package/dist/lib/components/BuildCheck.js +1 -1
  51. package/dist/lib/components/BuildCheck.js.map +1 -1
  52. package/dist/lib/components/Framed.d.ts +7 -0
  53. package/dist/lib/components/Framed.js +26 -0
  54. package/dist/lib/components/Framed.js.map +1 -0
  55. package/dist/lib/components/Header.js +10 -9
  56. package/dist/lib/components/Header.js.map +1 -1
  57. package/dist/lib/components/Heading.d.ts +6 -2
  58. package/dist/lib/components/Heading.js +2 -2
  59. package/dist/lib/components/Heading.js.map +1 -1
  60. package/dist/lib/components/Main.js +4 -4
  61. package/dist/lib/components/Main.js.map +1 -1
  62. package/dist/lib/components/MobileTopNavigation.js +6 -5
  63. package/dist/lib/components/MobileTopNavigation.js.map +1 -1
  64. package/dist/lib/components/PageProgress.d.ts +1 -0
  65. package/dist/lib/components/PageProgress.js +20 -0
  66. package/dist/lib/components/PageProgress.js.map +1 -0
  67. package/dist/lib/components/TopNavigation.d.ts +2 -3
  68. package/dist/lib/components/TopNavigation.js +45 -44
  69. package/dist/lib/components/TopNavigation.js.map +1 -1
  70. package/dist/lib/components/context/ZudokuContext.d.ts +3 -7
  71. package/dist/lib/components/context/ZudokuContext.js +44 -26
  72. package/dist/lib/components/context/ZudokuContext.js.map +1 -1
  73. package/dist/lib/components/navigation/Navigation.d.ts +5 -0
  74. package/dist/lib/components/navigation/Navigation.js +12 -0
  75. package/dist/lib/components/navigation/Navigation.js.map +1 -0
  76. package/dist/lib/components/navigation/{SidebarBadge.d.ts → NavigationBadge.d.ts} +1 -1
  77. package/dist/lib/components/navigation/{SidebarBadge.js → NavigationBadge.js} +2 -2
  78. package/dist/lib/components/navigation/NavigationBadge.js.map +1 -0
  79. package/dist/lib/components/navigation/NavigationCategory.d.ts +5 -0
  80. package/dist/lib/components/navigation/{SidebarCategory.js → NavigationCategory.js} +14 -12
  81. package/dist/lib/components/navigation/NavigationCategory.js.map +1 -0
  82. package/dist/lib/components/navigation/NavigationItem.d.ts +6 -0
  83. package/dist/lib/components/navigation/NavigationItem.js +47 -0
  84. package/dist/lib/components/navigation/NavigationItem.js.map +1 -0
  85. package/dist/lib/components/navigation/{SidebarWrapper.d.ts → NavigationWrapper.d.ts} +1 -1
  86. package/dist/lib/components/navigation/{SidebarWrapper.js → NavigationWrapper.js} +3 -3
  87. package/dist/lib/components/navigation/NavigationWrapper.js.map +1 -0
  88. package/dist/lib/components/navigation/utils.d.ts +7 -9
  89. package/dist/lib/components/navigation/utils.js +17 -17
  90. package/dist/lib/components/navigation/utils.js.map +1 -1
  91. package/dist/lib/core/ZudokuContext.d.ts +6 -8
  92. package/dist/lib/core/ZudokuContext.js +5 -7
  93. package/dist/lib/core/ZudokuContext.js.map +1 -1
  94. package/dist/lib/core/plugins.d.ts +2 -2
  95. package/dist/lib/hooks/useEvent.test.js +5 -3
  96. package/dist/lib/hooks/useEvent.test.js.map +1 -1
  97. package/dist/lib/plugins/api-catalog/Catalog.d.ts +1 -1
  98. package/dist/lib/plugins/api-catalog/index.d.ts +6 -6
  99. package/dist/lib/plugins/api-catalog/index.js +10 -10
  100. package/dist/lib/plugins/api-catalog/index.js.map +1 -1
  101. package/dist/lib/plugins/api-keys/SettingsApiKeys.js +6 -6
  102. package/dist/lib/plugins/api-keys/SettingsApiKeys.js.map +1 -1
  103. package/dist/lib/plugins/custom-pages/index.d.ts +3 -2
  104. package/dist/lib/plugins/custom-pages/index.js +15 -8
  105. package/dist/lib/plugins/custom-pages/index.js.map +1 -1
  106. package/dist/lib/plugins/markdown/MdxPage.js +6 -3
  107. package/dist/lib/plugins/markdown/MdxPage.js.map +1 -1
  108. package/dist/lib/plugins/markdown/index.d.ts +2 -1
  109. package/dist/lib/plugins/markdown/index.js +9 -26
  110. package/dist/lib/plugins/markdown/index.js.map +1 -1
  111. package/dist/lib/plugins/openapi/OperationList.js +1 -1
  112. package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
  113. package/dist/lib/plugins/openapi/OperationListItem.js +1 -1
  114. package/dist/lib/plugins/openapi/OperationListItem.js.map +1 -1
  115. package/dist/lib/plugins/openapi/SchemaList.js +1 -1
  116. package/dist/lib/plugins/openapi/SchemaList.js.map +1 -1
  117. package/dist/lib/plugins/openapi/graphql/gql.d.ts +1 -1
  118. package/dist/lib/plugins/openapi/graphql/gql.js +1 -1
  119. package/dist/lib/plugins/openapi/graphql/gql.js.map +1 -1
  120. package/dist/lib/plugins/openapi/graphql/graphql.d.ts +3 -3
  121. package/dist/lib/plugins/openapi/graphql/graphql.js +2 -2
  122. package/dist/lib/plugins/openapi/graphql/graphql.js.map +1 -1
  123. package/dist/lib/plugins/openapi/index.d.ts +3 -3
  124. package/dist/lib/plugins/openapi/index.js +9 -9
  125. package/dist/lib/plugins/openapi/index.js.map +1 -1
  126. package/dist/lib/plugins/openapi/interfaces.d.ts +3 -3
  127. package/dist/lib/plugins/openapi/schema/SchemaView.js +1 -1
  128. package/dist/lib/plugins/openapi/schema/SchemaView.js.map +1 -1
  129. package/dist/lib/plugins/openapi/util/createNavigationCategory.d.ts +9 -0
  130. package/dist/lib/plugins/openapi/util/{createSidebarCategory.js → createNavigationCategory.js} +5 -4
  131. package/dist/lib/plugins/openapi/util/createNavigationCategory.js.map +1 -0
  132. package/dist/lib/plugins/openapi/util/getRoutes.js +2 -2
  133. package/dist/lib/plugins/openapi/util/getRoutes.js.map +1 -1
  134. package/dist/lib/plugins/openapi/util/methodColorMap.d.ts +1 -1
  135. package/dist/lib/ui/CodeBlock.js +1 -1
  136. package/dist/lib/ui/CodeBlock.js.map +1 -1
  137. package/dist/lib/util/MdxComponents.d.ts +6 -0
  138. package/dist/lib/util/MdxComponents.js +4 -2
  139. package/dist/lib/util/MdxComponents.js.map +1 -1
  140. package/dist/lib/util/useScrollToAnchor.js +3 -3
  141. package/dist/lib/util/useScrollToAnchor.js.map +1 -1
  142. package/dist/vite/api/SchemaManager.d.ts +4 -4
  143. package/dist/vite/api/SchemaManager.js +19 -19
  144. package/dist/vite/api/SchemaManager.js.map +1 -1
  145. package/dist/vite/api/SchemaManager.test.js +4 -4
  146. package/dist/vite/api/SchemaManager.test.js.map +1 -1
  147. package/dist/vite/config.js +1 -0
  148. package/dist/vite/config.js.map +1 -1
  149. package/dist/vite/css/plugin.js +11 -0
  150. package/dist/vite/css/plugin.js.map +1 -1
  151. package/dist/vite/plugin-api.js +8 -8
  152. package/dist/vite/plugin-api.js.map +1 -1
  153. package/dist/vite/plugin-config-reload.js +2 -0
  154. package/dist/vite/plugin-config-reload.js.map +1 -1
  155. package/dist/vite/plugin-custom-pages.js +2 -2
  156. package/dist/vite/plugin-custom-pages.js.map +1 -1
  157. package/dist/vite/plugin-docs.js +61 -59
  158. package/dist/vite/plugin-docs.js.map +1 -1
  159. package/dist/vite/plugin-mdx.js +4 -2
  160. package/dist/vite/plugin-mdx.js.map +1 -1
  161. package/dist/vite/{plugin-sidebar.d.ts → plugin-navigation.d.ts} +1 -1
  162. package/dist/vite/{plugin-sidebar.js → plugin-navigation.js} +20 -19
  163. package/dist/vite/plugin-navigation.js.map +1 -0
  164. package/dist/vite/plugin-theme.d.ts +8 -0
  165. package/dist/vite/plugin-theme.js +223 -0
  166. package/dist/vite/plugin-theme.js.map +1 -0
  167. package/dist/vite/plugin-theme.test.d.ts +1 -0
  168. package/dist/vite/plugin-theme.test.js +270 -0
  169. package/dist/vite/plugin-theme.test.js.map +1 -0
  170. package/dist/vite/plugin.js +4 -6
  171. package/dist/vite/plugin.js.map +1 -1
  172. package/dist/vite/shadcn-registry.d.ts +45 -0
  173. package/dist/vite/shadcn-registry.js +29 -0
  174. package/dist/vite/shadcn-registry.js.map +1 -0
  175. package/lib/Drawer-BzkOKwgC.js.map +1 -1
  176. package/lib/{Markdown-r4buN85T.js → Markdown-DCAIYXF5.js} +885 -840
  177. package/lib/Markdown-DCAIYXF5.js.map +1 -0
  178. package/lib/{MdxPage-DYKsTerz.js → MdxPage-Cf9YXWoC.js} +30 -30
  179. package/lib/MdxPage-Cf9YXWoC.js.map +1 -0
  180. package/lib/OasProvider-JMVTfG6_.js +35 -0
  181. package/lib/OasProvider-JMVTfG6_.js.map +1 -0
  182. package/lib/{OperationList-BCVHtZNK.js → OperationList-m4tFCI4S.js} +8 -8
  183. package/lib/{OperationList-BCVHtZNK.js.map → OperationList-m4tFCI4S.js.map} +1 -1
  184. package/lib/{RouteGuard-B7GVW4oL.js → RouteGuard-gV7nvzi7.js} +2 -2
  185. package/lib/{RouteGuard-B7GVW4oL.js.map → RouteGuard-gV7nvzi7.js.map} +1 -1
  186. package/lib/{SchemaList-1oJKvBxh.js → SchemaList-_wRy4aQ0.js} +20 -20
  187. package/lib/SchemaList-_wRy4aQ0.js.map +1 -0
  188. package/lib/{SchemaView-CTqaB-79.js → SchemaView-CRl_cQYH.js} +13 -13
  189. package/lib/{SchemaView-CTqaB-79.js.map → SchemaView-CRl_cQYH.js.map} +1 -1
  190. package/lib/{SignUp-CRIKdWt9.js → SignUp-B6w5AwHM.js} +2 -2
  191. package/lib/{SignUp-CRIKdWt9.js.map → SignUp-B6w5AwHM.js.map} +1 -1
  192. package/lib/{Slot-B5qSAnwR.js → Slot-BkYrj_uC.js} +4 -4
  193. package/lib/{Slot-B5qSAnwR.js.map → Slot-BkYrj_uC.js.map} +1 -1
  194. package/lib/{SyntaxHighlight-CqKHkyEy.js → SyntaxHighlight-CH9OUJre.js} +2 -2
  195. package/lib/{SyntaxHighlight-CqKHkyEy.js.map → SyntaxHighlight-CH9OUJre.js.map} +1 -1
  196. package/lib/{Toc-lxYQEOzX.js → Toc-DRxqEsFc.js} +2 -2
  197. package/lib/{Toc-lxYQEOzX.js.map → Toc-DRxqEsFc.js.map} +1 -1
  198. package/lib/{circular-ZGGPtwMq.js → circular-wJaV4vh_.js} +2 -2
  199. package/lib/{circular-ZGGPtwMq.js.map → circular-wJaV4vh_.js.map} +1 -1
  200. package/lib/clerk-yAKDC3Qz.js.map +1 -1
  201. package/lib/{createServer-DUBpXfvA.js → createServer-DN5AJLcN.js} +3 -3
  202. package/lib/{createServer-DUBpXfvA.js.map → createServer-DN5AJLcN.js.map} +1 -1
  203. package/lib/{errors-D27ZTQgx.js → errors-D_5vKvUq.js} +10 -10
  204. package/lib/{errors-D27ZTQgx.js.map → errors-D_5vKvUq.js.map} +1 -1
  205. package/lib/hook-CHXroBFt.js +1503 -0
  206. package/lib/hook-CHXroBFt.js.map +1 -0
  207. package/lib/index-CrcNWbel.js.map +1 -1
  208. package/lib/{index-Cucjfk3D.js → index-DJVaRmzI.js} +63 -62
  209. package/lib/index-DJVaRmzI.js.map +1 -0
  210. package/lib/index-QzXzw_ra.js.map +1 -1
  211. package/lib/{mutation-C1XCQTQL.js → mutation-BpcyTgWI.js} +2 -2
  212. package/lib/{mutation-C1XCQTQL.js.map → mutation-BpcyTgWI.js.map} +1 -1
  213. package/lib/ui/CodeBlock.js +7 -7
  214. package/lib/ui/CodeBlock.js.map +1 -1
  215. package/lib/ui/SyntaxHighlight.js +2 -2
  216. package/lib/{useMutation-BKvPttRn.js → useMutation-N4ockVKi.js} +3 -3
  217. package/lib/{useMutation-BKvPttRn.js.map → useMutation-N4ockVKi.js.map} +1 -1
  218. package/lib/zudoku.auth-auth0.js +1 -1
  219. package/lib/zudoku.auth-azureb2c.js +2 -2
  220. package/lib/zudoku.auth-clerk.js +2 -2
  221. package/lib/zudoku.auth-openid.js +2 -2
  222. package/lib/zudoku.components.js +2756 -3423
  223. package/lib/zudoku.components.js.map +1 -1
  224. package/lib/zudoku.hooks.js +2 -2
  225. package/lib/zudoku.plugin-api-catalog.js +44 -44
  226. package/lib/zudoku.plugin-api-catalog.js.map +1 -1
  227. package/lib/zudoku.plugin-api-keys.js +84 -73
  228. package/lib/zudoku.plugin-api-keys.js.map +1 -1
  229. package/lib/zudoku.plugin-custom-pages.js +22 -16
  230. package/lib/zudoku.plugin-custom-pages.js.map +1 -1
  231. package/lib/zudoku.plugin-markdown.js +20 -69
  232. package/lib/zudoku.plugin-markdown.js.map +1 -1
  233. package/lib/zudoku.plugin-openapi.js +5 -5
  234. package/lib/zudoku.plugin-search-pagefind.js +2 -2
  235. package/lib/zudoku.plugins.js.map +1 -1
  236. package/package.json +16 -13
  237. package/src/app/ZuploBuildConfig.ts +8 -8
  238. package/src/app/defaultTheme.css +68 -49
  239. package/src/app/demo.tsx +4 -3
  240. package/src/app/entry.client.tsx +0 -2
  241. package/src/app/entry.server.tsx +0 -2
  242. package/src/app/env.ts +8 -0
  243. package/src/app/main.css +6 -52
  244. package/src/app/main.tsx +7 -5
  245. package/src/app/standalone.tsx +4 -3
  246. package/src/lib/auth/issuer.test.ts +1 -1
  247. package/src/lib/auth/issuer.ts +1 -1
  248. package/src/lib/authentication/components/CallbackHandler.tsx +1 -1
  249. package/src/lib/components/BuildCheck.tsx +1 -1
  250. package/src/lib/components/Framed.tsx +51 -0
  251. package/src/lib/components/Header.tsx +5 -3
  252. package/src/lib/components/Heading.tsx +7 -3
  253. package/src/lib/components/Main.tsx +8 -8
  254. package/src/lib/components/MobileTopNavigation.tsx +16 -11
  255. package/src/lib/components/PageProgress.tsx +28 -0
  256. package/src/lib/components/TopNavigation.tsx +57 -66
  257. package/src/lib/components/context/ZudokuContext.ts +50 -32
  258. package/src/lib/components/navigation/{Sidebar.tsx → Navigation.tsx} +18 -16
  259. package/src/lib/components/navigation/{SidebarBadge.tsx → NavigationBadge.tsx} +1 -1
  260. package/src/lib/components/navigation/{SidebarCategory.tsx → NavigationCategory.tsx} +16 -14
  261. package/src/lib/components/navigation/{SidebarItem.tsx → NavigationItem.tsx} +23 -17
  262. package/src/lib/components/navigation/{SidebarWrapper.tsx → NavigationWrapper.tsx} +2 -2
  263. package/src/lib/components/navigation/utils.ts +27 -28
  264. package/src/lib/core/ZudokuContext.ts +9 -15
  265. package/src/lib/core/plugins.ts +2 -2
  266. package/src/lib/hooks/useEvent.test.tsx +7 -5
  267. package/src/lib/plugins/api-catalog/Catalog.tsx +1 -1
  268. package/src/lib/plugins/api-catalog/index.tsx +19 -19
  269. package/src/lib/plugins/api-keys/SettingsApiKeys.tsx +14 -10
  270. package/src/lib/plugins/custom-pages/index.tsx +20 -11
  271. package/src/lib/plugins/markdown/MdxPage.tsx +6 -3
  272. package/src/lib/plugins/markdown/index.tsx +19 -40
  273. package/src/lib/plugins/openapi/OperationList.tsx +1 -1
  274. package/src/lib/plugins/openapi/OperationListItem.tsx +1 -1
  275. package/src/lib/plugins/openapi/SchemaList.tsx +2 -2
  276. package/src/lib/plugins/openapi/graphql/gql.ts +5 -5
  277. package/src/lib/plugins/openapi/graphql/graphql.ts +6 -6
  278. package/src/lib/plugins/openapi/index.tsx +11 -11
  279. package/src/lib/plugins/openapi/interfaces.ts +3 -3
  280. package/src/lib/plugins/openapi/schema/SchemaView.tsx +1 -1
  281. package/src/lib/plugins/openapi/util/{createSidebarCategory.tsx → createNavigationCategory.tsx} +6 -5
  282. package/src/lib/plugins/openapi/util/getRoutes.tsx +2 -2
  283. package/src/lib/plugins/openapi/util/methodColorMap.tsx +1 -1
  284. package/src/lib/ui/CodeBlock.tsx +1 -1
  285. package/src/lib/util/MdxComponents.tsx +13 -2
  286. package/src/lib/util/useScrollToAnchor.ts +3 -3
  287. package/dist/config/validators/InputSidebarSchema.d.ts +0 -220
  288. package/dist/config/validators/InputSidebarSchema.js +0 -63
  289. package/dist/config/validators/InputSidebarSchema.js.map +0 -1
  290. package/dist/config/validators/SidebarSchema.d.ts +0 -46
  291. package/dist/config/validators/SidebarSchema.js +0 -118
  292. package/dist/config/validators/SidebarSchema.js.map +0 -1
  293. package/dist/lib/components/navigation/Sidebar.d.ts +0 -5
  294. package/dist/lib/components/navigation/Sidebar.js +0 -10
  295. package/dist/lib/components/navigation/Sidebar.js.map +0 -1
  296. package/dist/lib/components/navigation/SidebarBadge.js.map +0 -1
  297. package/dist/lib/components/navigation/SidebarCategory.d.ts +0 -5
  298. package/dist/lib/components/navigation/SidebarCategory.js.map +0 -1
  299. package/dist/lib/components/navigation/SidebarItem.d.ts +0 -6
  300. package/dist/lib/components/navigation/SidebarItem.js +0 -44
  301. package/dist/lib/components/navigation/SidebarItem.js.map +0 -1
  302. package/dist/lib/components/navigation/SidebarWrapper.js.map +0 -1
  303. package/dist/lib/plugins/markdown/resolver.d.ts +0 -32
  304. package/dist/lib/plugins/markdown/resolver.js +0 -46
  305. package/dist/lib/plugins/markdown/resolver.js.map +0 -1
  306. package/dist/lib/plugins/openapi/util/createSidebarCategory.d.ts +0 -9
  307. package/dist/lib/plugins/openapi/util/createSidebarCategory.js.map +0 -1
  308. package/dist/vite/plugin-configure-tailwind.d.ts +0 -2
  309. package/dist/vite/plugin-configure-tailwind.js +0 -38
  310. package/dist/vite/plugin-configure-tailwind.js.map +0 -1
  311. package/dist/vite/plugin-sidebar.js.map +0 -1
  312. package/dist/vite/plugin-theme-css.d.ts +0 -5
  313. package/dist/vite/plugin-theme-css.js +0 -77
  314. package/dist/vite/plugin-theme-css.js.map +0 -1
  315. package/lib/Markdown-r4buN85T.js.map +0 -1
  316. package/lib/MdxPage-DYKsTerz.js.map +0 -1
  317. package/lib/OasProvider-8vNiLpIG.js +0 -33
  318. package/lib/OasProvider-8vNiLpIG.js.map +0 -1
  319. package/lib/SchemaList-1oJKvBxh.js.map +0 -1
  320. package/lib/hook-7wZANGJP.js +0 -1483
  321. package/lib/hook-7wZANGJP.js.map +0 -1
  322. package/lib/index-Cucjfk3D.js.map +0 -1
  323. package/lib/joinPath-B7kNnUX4.js +0 -8
  324. package/lib/joinPath-B7kNnUX4.js.map +0 -1
  325. package/src/lib/plugins/markdown/resolver.ts +0 -59
@@ -1,6 +1,6 @@
1
1
  import { z as p } from "./index--oeBayMa.js";
2
- import { k as n, i as a, m as c } from "./hook-7wZANGJP.js";
3
- import { C as H } from "./hook-7wZANGJP.js";
2
+ import { k as n, i as a, m as c } from "./hook-CHXroBFt.js";
3
+ import { C as H } from "./hook-CHXroBFt.js";
4
4
  import { u as f } from "./useExposedProps-BZQkZneR.js";
5
5
  import { useState as i, useEffect as E } from "react";
6
6
  import { u as d } from "./index-QzXzw_ra.js";
@@ -1,43 +1,43 @@
1
1
  import { j as t } from "./jsx-runtime-C5mzlN2N.js";
2
2
  import { s as f } from "./index-BvvmIczU.js";
3
3
  import { d as b, m as j } from "./chunk-DQRVZFIR-BblmKnHy.js";
4
- import { u as x, d as y, j as m } from "./hook-7wZANGJP.js";
5
- import { H as v } from "./index.esm-BFcSKCe-.js";
4
+ import { u as x, d as v, j as d } from "./hook-CHXroBFt.js";
5
+ import { H as y } from "./index.esm-BFcSKCe-.js";
6
6
  import { Link as N } from "./zudoku.components.js";
7
- import { H as S, M as w } from "./Markdown-r4buN85T.js";
8
- const H = ({
9
- items: r,
10
- filterCatalogItems: o = (n) => n,
7
+ import { H as k, M as S } from "./Markdown-DCAIYXF5.js";
8
+ const w = ({
9
+ items: n,
10
+ filterCatalogItems: o = (r) => r,
11
11
  label: c = "API Library",
12
- categoryLabel: a
12
+ categoryLabel: s
13
13
  }) => {
14
- const n = x(), s = b({ path: "/catalog/:category" })?.params.category, l = y({
15
- queryFn: () => o(r, { auth: n }),
16
- queryKey: ["catalogItems", n]
17
- }), d = s ? { "data-pagefind-ignore": "all" } : {};
18
- return /* @__PURE__ */ t.jsxs("section", { className: "pt-(--padding-content-top)", ...d, children: [
19
- /* @__PURE__ */ t.jsx(v, { children: /* @__PURE__ */ t.jsxs("title", { children: [
20
- a ? `${a} - ` : "",
14
+ const r = x(), a = b({ path: "/catalog/:category" })?.params.category, l = v({
15
+ queryFn: () => o(n, { auth: r }),
16
+ queryKey: ["catalogItems", r]
17
+ }), m = a ? { "data-pagefind-ignore": "all" } : {};
18
+ return /* @__PURE__ */ t.jsxs("section", { className: "pt-(--padding-content-top)", ...m, children: [
19
+ /* @__PURE__ */ t.jsx(y, { children: /* @__PURE__ */ t.jsxs("title", { children: [
20
+ s ? `${s} - ` : "",
21
21
  c
22
22
  ] }) }),
23
23
  /* @__PURE__ */ t.jsxs("div", { className: "grid gap-4", children: [
24
- /* @__PURE__ */ t.jsxs(S, { level: 2, children: [
24
+ /* @__PURE__ */ t.jsxs(k, { level: 2, children: [
25
25
  c,
26
- a && ` - ${a}`
26
+ s && ` - ${s}`
27
27
  ] }),
28
28
  /* @__PURE__ */ t.jsx("div", { className: "grid grid-cols-2 gap-4", children: l.data.filter(
29
- (e) => !s || e.categories.find(
30
- (i) => i.tags.find((h) => u(i.label, h) === s)
29
+ (e) => !a || e.categories.find(
30
+ (i) => i.tags.find((g) => h(i.label, g) === a)
31
31
  )
32
32
  ).map((e) => /* @__PURE__ */ t.jsx(
33
33
  N,
34
34
  {
35
- to: m(e.path),
35
+ to: d(e.path),
36
36
  className: "no-underline hover:!text-foreground",
37
37
  children: /* @__PURE__ */ t.jsxs("div", { className: "border h-full rounded-lg p-4 flex flex-col gap-2 cursor-pointer hover:bg-border/20 font-normal", children: [
38
38
  /* @__PURE__ */ t.jsx("span", { className: "font-semibold", children: e.label }),
39
39
  /* @__PURE__ */ t.jsx(
40
- w,
40
+ S,
41
41
  {
42
42
  className: "text-sm whitespace-pre-wrap mb-6 line-clamp-2",
43
43
  content: e.description
@@ -49,69 +49,69 @@ const H = ({
49
49
  )) })
50
50
  ] })
51
51
  ] });
52
- }, u = (r, o) => f(`${r}-${o}`), A = ({
53
- navigationId: r,
52
+ }, h = (n, o) => f(`${n}-${o}`), q = ({
53
+ path: n,
54
54
  items: o,
55
55
  label: c,
56
- categories: a = [],
57
- filterCatalogItems: n
56
+ categories: s = [],
57
+ filterCatalogItems: r
58
58
  }) => {
59
59
  const p = Object.fromEntries(
60
- a.flatMap(
61
- (s) => [void 0, ...s.tags].map((l) => [
62
- m(r, l ? u(s.label, l) : void 0),
60
+ s.flatMap(
61
+ (a) => [void 0, ...a.tags].map((l) => [
62
+ d(n, l ? h(a.label, l) : void 0),
63
63
  l
64
64
  ])
65
65
  )
66
66
  );
67
67
  return {
68
- getSidebar: async (s) => {
68
+ getNavigation: async (a) => {
69
69
  if (!Object.keys(p).some(
70
- (e) => j(e, s)
70
+ (e) => j(e, a)
71
71
  ))
72
72
  return [];
73
- const d = a.map((e) => ({
73
+ const m = s.map((e) => ({
74
74
  type: "category",
75
75
  label: e.label,
76
76
  collapsible: !1,
77
77
  items: e.tags.map((i) => ({
78
- type: "doc",
79
- id: m(r, u(e.label, i)),
78
+ type: "link",
79
+ to: d(n, h(e.label, i)),
80
80
  label: i,
81
81
  badge: {
82
82
  label: String(
83
83
  o.filter(
84
- (h) => h.categories.find((g) => g.tags.includes(i))
84
+ (g) => g.categories.find((u) => u.tags.includes(i))
85
85
  ).length
86
86
  ),
87
87
  color: "outline"
88
88
  }
89
89
  }))
90
90
  }));
91
- return d.unshift({
92
- type: "doc",
93
- id: m(r),
91
+ return m.unshift({
92
+ type: "link",
93
+ to: d(n),
94
94
  label: "Overview",
95
95
  badge: { label: String(o.length), color: "outline" }
96
- }), d;
96
+ }), m;
97
97
  },
98
- getRoutes: () => Object.entries(p).map(([s, l]) => ({
99
- path: s,
98
+ getRoutes: () => Object.entries(p).map(([a, l]) => ({
99
+ path: a,
100
100
  element: /* @__PURE__ */ t.jsx(
101
- H,
101
+ w,
102
102
  {
103
103
  label: c,
104
104
  categoryLabel: l,
105
105
  items: o,
106
- filterCatalogItems: n,
107
- categories: a
106
+ filterCatalogItems: r,
107
+ categories: s
108
108
  }
109
109
  )
110
110
  }))
111
111
  };
112
112
  };
113
113
  export {
114
- A as apiCatalogPlugin,
115
- u as getKey
114
+ q as apiCatalogPlugin,
115
+ h as getKey
116
116
  };
117
117
  //# sourceMappingURL=zudoku.plugin-api-catalog.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"zudoku.plugin-api-catalog.js","sources":["../src/lib/plugins/api-catalog/Catalog.tsx","../src/lib/plugins/api-catalog/index.tsx"],"sourcesContent":["import { useSuspenseQuery } from \"@tanstack/react-query\";\nimport { Helmet } from \"@zudoku/react-helmet-async\";\nimport { useMatch } from \"react-router\";\nimport { Link } from \"zudoku/components\";\nimport { useAuthState } from \"../../authentication/state.js\";\nimport { Heading } from \"../../components/Heading.js\";\nimport { Markdown } from \"../../components/Markdown.js\";\nimport { joinUrl } from \"../../util/joinUrl.js\";\nimport { type ApiCatalogPluginOptions, getKey } from \"./index.js\";\n\nexport const Catalog = ({\n items,\n filterCatalogItems = (items) => items,\n label = \"API Library\",\n categoryLabel,\n}: Omit<ApiCatalogPluginOptions, \"navigationId\"> & {\n categoryLabel?: string;\n}) => {\n const auth = useAuthState();\n const match = useMatch({ path: \"/catalog/:category\" });\n const activeCategory = match?.params.category;\n\n const catalogItems = useSuspenseQuery({\n queryFn: () => filterCatalogItems(items, { auth }),\n queryKey: [\"catalogItems\", auth],\n });\n\n // Only index the overview page, ignore the rest\n const dataSet = activeCategory ? { \"data-pagefind-ignore\": \"all\" } : {};\n\n return (\n <section className=\"pt-(--padding-content-top)\" {...dataSet}>\n <Helmet>\n <title>\n {categoryLabel ? `${categoryLabel} - ` : \"\"}\n {label}\n </title>\n </Helmet>\n <div className=\"grid gap-4\">\n <Heading level={2}>\n {label}\n {categoryLabel && ` - ${categoryLabel}`}\n </Heading>\n\n <div className=\"grid grid-cols-2 gap-4\">\n {catalogItems.data\n .filter(\n (api) =>\n !activeCategory ||\n api.categories.find((c) =>\n c.tags.find((t) => getKey(c.label, t) === activeCategory),\n ),\n )\n .map((api) => (\n <Link\n to={joinUrl(api.path)}\n className=\"no-underline hover:!text-foreground\"\n key={api.path}\n >\n <div className=\"border h-full rounded-lg p-4 flex flex-col gap-2 cursor-pointer hover:bg-border/20 font-normal\">\n <span className=\"font-semibold\">{api.label}</span>\n <Markdown\n className=\"text-sm whitespace-pre-wrap mb-6 line-clamp-2\"\n content={api.description}\n />\n </div>\n </Link>\n ))}\n </div>\n </div>\n </section>\n );\n};\n","import slugify from \"@sindresorhus/slugify\";\nimport { matchPath } from \"react-router\";\nimport type { SidebarItem } from \"../../../config/validators/SidebarSchema.js\";\nimport type { AuthState } from \"../../authentication/state.js\";\nimport type { ZudokuPlugin } from \"../../core/plugins.js\";\nimport { joinUrl } from \"../../util/joinUrl.js\";\nimport { Catalog } from \"./Catalog.js\";\n\nexport const getKey = (category: string, tag: string) =>\n slugify(`${category}-${tag}`);\n\nexport type ApiCatalogItem = {\n path: string;\n label: string;\n description: string;\n categories: CatalogCategory[];\n};\n\nexport type CatalogCategory = {\n label: string;\n tags: string[];\n};\n\nexport type ApiCatalogPluginOptions = {\n navigationId: string;\n label: string;\n categories?: CatalogCategory[];\n items: ApiCatalogItem[];\n filterCatalogItems?: filterCatalogItems;\n};\n\nexport type CatalogContext<ProviderData = unknown> = {\n auth: AuthState<ProviderData>;\n};\n\nexport type filterCatalogItems<ProviderData = unknown> = (\n items: ApiCatalogItem[],\n { auth }: CatalogContext<ProviderData>,\n) => ApiCatalogItem[];\n\nexport const apiCatalogPlugin = ({\n navigationId,\n items,\n label,\n categories = [],\n filterCatalogItems,\n}: {\n navigationId: string;\n label: string;\n categories?: CatalogCategory[];\n items: ApiCatalogItem[];\n filterCatalogItems?: filterCatalogItems;\n}): ZudokuPlugin => {\n const paths = Object.fromEntries(\n categories.flatMap((category) =>\n [undefined, ...category.tags].map((tag) => [\n joinUrl(navigationId, tag ? getKey(category.label, tag) : undefined),\n tag,\n ]),\n ),\n );\n\n return {\n getSidebar: async (currentPath) => {\n const matches = Object.keys(paths).some((path) =>\n matchPath(path, currentPath),\n );\n\n if (!matches) {\n return [];\n }\n\n const sidebar: SidebarItem[] = categories.map((category) => ({\n type: \"category\" as const,\n label: category.label,\n collapsible: false,\n items: category.tags.map((tag) => ({\n type: \"doc\" as const,\n id: joinUrl(navigationId, getKey(category.label, tag)),\n label: tag,\n badge: {\n label: String(\n items.filter((api) =>\n api.categories.find((c) => c.tags.includes(tag)),\n ).length,\n ),\n color: \"outline\" as const,\n },\n })),\n }));\n\n sidebar.unshift({\n type: \"doc\" as const,\n id: joinUrl(navigationId),\n label: \"Overview\",\n badge: { label: String(items.length), color: \"outline\" as const },\n });\n\n return sidebar;\n },\n getRoutes: () =>\n Object.entries(paths).map(([path, tag]) => ({\n path,\n element: (\n <Catalog\n label={label}\n categoryLabel={tag}\n items={items}\n filterCatalogItems={filterCatalogItems}\n categories={categories}\n />\n ),\n })),\n };\n};\n"],"names":["Catalog","items","filterCatalogItems","label","categoryLabel","auth","useAuthState","activeCategory","useMatch","catalogItems","useSuspenseQuery","dataSet","jsxs","jsx","Helmet","Heading","api","c","t","getKey","Link","joinUrl","Markdown","category","tag","slugify","apiCatalogPlugin","navigationId","categories","paths","currentPath","path","matchPath","sidebar"],"mappings":";;;;;;;AAUO,MAAMA,IAAU,CAAC;AAAA,EACtB,OAAAC;AAAA,EACA,oBAAAC,IAAqB,CAACD,MAAUA;AAAAA,EAChC,OAAAE,IAAQ;AAAA,EACR,eAAAC;AACF,MAEM;AACJ,QAAMC,IAAOC,EAAa,GAEpBC,IADQC,EAAS,EAAE,MAAM,sBAAsB,GACvB,OAAO,UAE/BC,IAAeC,EAAiB;AAAA,IACpC,SAAS,MAAMR,EAAmBD,GAAO,EAAE,MAAAI,GAAM;AAAA,IACjD,UAAU,CAAC,gBAAgBA,CAAI;AAAA,EAAA,CAChC,GAGKM,IAAUJ,IAAiB,EAAE,wBAAwB,UAAU,CAAC;AAEtE,SACGK,gBAAAA,EAAAA,KAAA,WAAA,EAAQ,WAAU,8BAA8B,GAAGD,GAClD,UAAA;AAAA,IAACE,gBAAAA,EAAA,IAAAC,GA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AMP,CAAG,OAAO;AAAA,MAC1C,MAAAO;AAAA,MACA,SACElB,gBAAAA,EAAA;AAAA,QAACb;AAAA,QAAA;AAAA,UACC,OAAAG;AAAA,UACA,eAAeqB;AAAA,UACf,OAAAvB;AAAA,UACA,oBAAAC;AAAA,UACA,YAAA0B;AAAA,QAAA;AAAA,MAAA;AAAA,IACF,EAEF;AAAA,EACN;AACF;"}
1
+ {"version":3,"file":"zudoku.plugin-api-catalog.js","sources":["../src/lib/plugins/api-catalog/Catalog.tsx","../src/lib/plugins/api-catalog/index.tsx"],"sourcesContent":["import { useSuspenseQuery } from \"@tanstack/react-query\";\nimport { Helmet } from \"@zudoku/react-helmet-async\";\nimport { useMatch } from \"react-router\";\nimport { Link } from \"zudoku/components\";\nimport { useAuthState } from \"../../authentication/state.js\";\nimport { Heading } from \"../../components/Heading.js\";\nimport { Markdown } from \"../../components/Markdown.js\";\nimport { joinUrl } from \"../../util/joinUrl.js\";\nimport { type ApiCatalogPluginOptions, getKey } from \"./index.js\";\n\nexport const Catalog = ({\n items,\n filterCatalogItems = (items) => items,\n label = \"API Library\",\n categoryLabel,\n}: Omit<ApiCatalogPluginOptions, \"path\"> & {\n categoryLabel?: string;\n}) => {\n const auth = useAuthState();\n const match = useMatch({ path: \"/catalog/:category\" });\n const activeCategory = match?.params.category;\n\n const catalogItems = useSuspenseQuery({\n queryFn: () => filterCatalogItems(items, { auth }),\n queryKey: [\"catalogItems\", auth],\n });\n\n // Only index the overview page, ignore the rest\n const dataSet = activeCategory ? { \"data-pagefind-ignore\": \"all\" } : {};\n\n return (\n <section className=\"pt-(--padding-content-top)\" {...dataSet}>\n <Helmet>\n <title>\n {categoryLabel ? `${categoryLabel} - ` : \"\"}\n {label}\n </title>\n </Helmet>\n <div className=\"grid gap-4\">\n <Heading level={2}>\n {label}\n {categoryLabel && ` - ${categoryLabel}`}\n </Heading>\n\n <div className=\"grid grid-cols-2 gap-4\">\n {catalogItems.data\n .filter(\n (api) =>\n !activeCategory ||\n api.categories.find((c) =>\n c.tags.find((t) => getKey(c.label, t) === activeCategory),\n ),\n )\n .map((api) => (\n <Link\n to={joinUrl(api.path)}\n className=\"no-underline hover:!text-foreground\"\n key={api.path}\n >\n <div className=\"border h-full rounded-lg p-4 flex flex-col gap-2 cursor-pointer hover:bg-border/20 font-normal\">\n <span className=\"font-semibold\">{api.label}</span>\n <Markdown\n className=\"text-sm whitespace-pre-wrap mb-6 line-clamp-2\"\n content={api.description}\n />\n </div>\n </Link>\n ))}\n </div>\n </div>\n </section>\n );\n};\n","import slugify from \"@sindresorhus/slugify\";\nimport { matchPath } from \"react-router\";\nimport type { NavigationItem } from \"../../../config/validators/NavigationSchema.js\";\nimport type { AuthState } from \"../../authentication/state.js\";\nimport type { ZudokuPlugin } from \"../../core/plugins.js\";\nimport { joinUrl } from \"../../util/joinUrl.js\";\nimport { Catalog } from \"./Catalog.js\";\n\nexport const getKey = (category: string, tag: string) =>\n slugify(`${category}-${tag}`);\n\nexport type ApiCatalogItem = {\n path: string;\n label: string;\n description: string;\n categories: CatalogCategory[];\n};\n\nexport type CatalogCategory = {\n label: string;\n tags: string[];\n};\n\nexport type ApiCatalogPluginOptions = {\n path: string;\n label: string;\n categories?: CatalogCategory[];\n items: ApiCatalogItem[];\n filterCatalogItems?: FilterCatalogItemsFn;\n};\n\nexport type CatalogContext<ProviderData = unknown> = {\n auth: AuthState<ProviderData>;\n};\n\nexport type FilterCatalogItemsFn<ProviderData = unknown> = (\n items: ApiCatalogItem[],\n { auth }: CatalogContext<ProviderData>,\n) => ApiCatalogItem[];\n\nexport const apiCatalogPlugin = ({\n path,\n items,\n label,\n categories = [],\n filterCatalogItems,\n}: {\n path: string;\n label: string;\n categories?: CatalogCategory[];\n items: ApiCatalogItem[];\n filterCatalogItems?: FilterCatalogItemsFn;\n}): ZudokuPlugin => {\n const paths = Object.fromEntries(\n categories.flatMap((category) =>\n [undefined, ...category.tags].map((tag) => [\n joinUrl(path, tag ? getKey(category.label, tag) : undefined),\n tag,\n ]),\n ),\n );\n\n return {\n getNavigation: async (currentPath) => {\n const matches = Object.keys(paths).some((path) =>\n matchPath(path, currentPath),\n );\n\n if (!matches) {\n return [];\n }\n\n const navigation: NavigationItem[] = categories.map((category) => ({\n type: \"category\",\n label: category.label,\n collapsible: false,\n items: category.tags.map((tag) => ({\n type: \"link\",\n to: joinUrl(path, getKey(category.label, tag)),\n label: tag,\n badge: {\n label: String(\n items.filter((api) =>\n api.categories.find((c) => c.tags.includes(tag)),\n ).length,\n ),\n color: \"outline\",\n },\n })),\n }));\n\n navigation.unshift({\n type: \"link\",\n to: joinUrl(path),\n label: \"Overview\",\n badge: { label: String(items.length), color: \"outline\" },\n });\n\n return navigation;\n },\n getRoutes: () =>\n Object.entries(paths).map(([path, tag]) => ({\n path,\n element: (\n <Catalog\n label={label}\n categoryLabel={tag}\n items={items}\n filterCatalogItems={filterCatalogItems}\n categories={categories}\n />\n ),\n })),\n };\n};\n"],"names":["Catalog","items","filterCatalogItems","label","categoryLabel","auth","useAuthState","activeCategory","useMatch","catalogItems","useSuspenseQuery","dataSet","jsxs","jsx","Helmet","Heading","api","c","t","getKey","Link","joinUrl","Markdown","category","tag","slugify","apiCatalogPlugin","path","categories","paths","currentPath","matchPath","navigation"],"mappings":";;;;;;;AAUO,MAAMA,IAAU,CAAC;AAAA,EACtB,OAAAC;AAAA,EACA,oBAAAC,IAAqB,CAACD,MAAUA;AAAAA,EAChC,OAAAE,IAAQ;AAAA,EACR,eAAAC;AACF,MAEM;AACJ,QAAMC,IAAOC,EAAa,GAEpBC,IADQC,EAAS,EAAE,MAAM,sBAAsB,GACvB,OAAO,UAE/BC,IAAeC,EAAiB;AAAA,IACpC,SAAS,MAAMR,EAAmBD,GAAO,EAAE,MAAAI,GAAM;AAAA,IACjD,UAAU,CAAC,gBAAgBA,CAAI;AAAA,EAAA,CAChC,GAGKM,IAAUJ,IAAiB,EAAE,wBAAwB,UAAU,CAAC;AAEtE,SACGK,gBAAAA,EAAAA,KAAA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EM+B;AAAA,IACT;AAAA,IACA,WAAW,MACT,OAAO,QAAQH,CAAK,EAAE,IAAI,CAAC,CAACF,GAAMH,CAAG,OAAO;AAAA,MAC1C,MAAAG;AAAAA,MACA,SACEd,gBAAAA,EAAA;AAAA,QAACb;AAAA,QAAA;AAAA,UACC,OAAAG;AAAA,UACA,eAAeqB;AAAA,UACf,OAAAvB;AAAA,UACA,oBAAAC;AAAA,UACA,YAAA0B;AAAA,QAAA;AAAA,MAAA;AAAA,IACF,EAEF;AAAA,EACN;AACF;"}
@@ -1,11 +1,11 @@
1
1
  import { j as e } from "./jsx-runtime-C5mzlN2N.js";
2
- import { CheckIcon as _, XIcon as se, PencilLineIcon as ne, RotateCwIcon as ie, EyeOffIcon as re, EyeIcon as ae, CopyIcon as oe, TrashIcon as le, KeyRoundIcon as de } from "lucide-react";
3
- import { D as ce, S as O, R as ue } from "./Slot-B5qSAnwR.js";
2
+ import { CheckIcon as _, XIcon as se, PencilLineIcon as ne, RefreshCwIcon as ie, EyeOffIcon as re, EyeIcon as ae, CopyIcon as oe, TrashIcon as le, KeyRoundIcon as de } from "lucide-react";
3
+ import { D as ce, S as O, R as ue } from "./Slot-BkYrj_uC.js";
4
4
  import { i as P } from "./invariant-DAFpPywt.js";
5
- import { O as he, L as Q } from "./chunk-DQRVZFIR-BblmKnHy.js";
6
- import { i as fe, k as pe, e as xe, d as me } from "./hook-7wZANGJP.js";
5
+ import { O as fe, L as Q } from "./chunk-DQRVZFIR-BblmKnHy.js";
6
+ import { i as he, k as pe, e as xe, d as me } from "./hook-CHXroBFt.js";
7
7
  import { Button as j } from "./ui/Button.js";
8
- import { u as z } from "./useMutation-BKvPttRn.js";
8
+ import { u as z } from "./useMutation-N4ockVKi.js";
9
9
  import * as S from "react";
10
10
  import ye, { createContext as q, useRef as D, useLayoutEffect as ge, useEffect as B, useId as L, useContext as $, useInsertionEffect as je, useMemo as M, useCallback as Ce, Children as ve, isValidElement as we, useState as E } from "react";
11
11
  import { C as ke, a as be } from "./Card-DPhGbYUM.js";
@@ -13,8 +13,8 @@ import { D as U, e as W, a as X, b as Y, c as G, d as J, f as V, g as K } from "
13
13
  import { Input as Ee } from "./ui/Input.js";
14
14
  import { c as R } from "./cn-wvCW-ho6.js";
15
15
  const De = () => {
16
- const t = fe();
17
- return t.isAuthEnabled && t.isPending ? null : t.isAuthenticated ? /* @__PURE__ */ e.jsx(he, {}) : t.isAuthEnabled ? /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col justify-center gap-2 items-center h-1/2", children: [
16
+ const t = he();
17
+ return t.isAuthEnabled && t.isPending ? null : t.isAuthenticated ? /* @__PURE__ */ e.jsx(fe, {}) : t.isAuthEnabled ? /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col justify-center gap-2 items-center h-1/2", children: [
18
18
  "Please login first to view this page",
19
19
  /* @__PURE__ */ e.jsx(j, { onClick: () => t.login(), children: "Login" })
20
20
  ] }) : /* @__PURE__ */ e.jsx("div", { className: "flex flex-col justify-center gap-2 items-center h-1/2", children: /* @__PURE__ */ e.jsxs(ce, { className: "max-w-[600px]", children: [
@@ -27,7 +27,7 @@ function Z(t) {
27
27
  const i = D(null);
28
28
  return i.current === null && (i.current = t()), i.current;
29
29
  }
30
- const Ie = typeof window < "u", Ne = Ie ? ge : B, ee = /* @__PURE__ */ q(null);
30
+ const Ne = typeof window < "u", Ie = Ne ? ge : B, ee = /* @__PURE__ */ q(null);
31
31
  function Ke(t) {
32
32
  return typeof t == "object" && t !== null;
33
33
  }
@@ -66,46 +66,46 @@ function ze({ children: t, isPresent: i, anchorX: s }) {
66
66
  right: 0
67
67
  }), { nonce: u } = $(Ae);
68
68
  return je(() => {
69
- const { width: m, height: h, top: x, left: d, right: c } = r.current;
70
- if (i || !o.current || !m || !h)
69
+ const { width: m, height: f, top: x, left: c, right: d } = r.current;
70
+ if (i || !o.current || !m || !f)
71
71
  return;
72
- const y = s === "left" ? `left: ${d}` : `right: ${c}`;
72
+ const y = s === "left" ? `left: ${c}` : `right: ${d}`;
73
73
  o.current.dataset.motionPopId = n;
74
- const f = document.createElement("style");
75
- return u && (f.nonce = u), document.head.appendChild(f), f.sheet && f.sheet.insertRule(`
74
+ const h = document.createElement("style");
75
+ return u && (h.nonce = u), document.head.appendChild(h), h.sheet && h.sheet.insertRule(`
76
76
  [data-motion-pop-id="${n}"] {
77
77
  position: absolute !important;
78
78
  width: ${m}px !important;
79
- height: ${h}px !important;
79
+ height: ${f}px !important;
80
80
  ${y}px !important;
81
81
  top: ${x}px !important;
82
82
  }
83
83
  `), () => {
84
- document.head.contains(f) && document.head.removeChild(f);
84
+ document.head.contains(h) && document.head.removeChild(h);
85
85
  };
86
86
  }, [i]), e.jsx(Te, { isPresent: i, childRef: o, sizeRef: r, children: S.cloneElement(t, { ref: o }) });
87
87
  }
88
88
  const Me = ({ children: t, initial: i, isPresent: s, onExitComplete: n, custom: o, presenceAffectsLayout: r, mode: u, anchorX: m }) => {
89
- const h = Z(Se), x = L();
90
- let d = !0, c = M(() => (d = !1, {
89
+ const f = Z(Se), x = L();
90
+ let c = !0, d = M(() => (c = !1, {
91
91
  id: x,
92
92
  initial: i,
93
93
  isPresent: s,
94
94
  custom: o,
95
95
  onExitComplete: (y) => {
96
- h.set(y, !0);
97
- for (const f of h.values())
98
- if (!f)
96
+ f.set(y, !0);
97
+ for (const h of f.values())
98
+ if (!h)
99
99
  return;
100
100
  n && n();
101
101
  },
102
- register: (y) => (h.set(y, !1), () => h.delete(y))
103
- }), [s, h, n]);
104
- return r && d && (c = { ...c }), M(() => {
105
- h.forEach((y, f) => h.set(f, !1));
102
+ register: (y) => (f.set(y, !1), () => f.delete(y))
103
+ }), [s, f, n]);
104
+ return r && c && (d = { ...d }), M(() => {
105
+ f.forEach((y, h) => f.set(h, !1));
106
106
  }, [s]), S.useEffect(() => {
107
- !s && !h.size && n && n();
108
- }, [s]), u === "popLayout" && (t = e.jsx(ze, { isPresent: s, anchorX: m, children: t })), e.jsx(ee.Provider, { value: c, children: t });
107
+ !s && !f.size && n && n();
108
+ }, [s]), u === "popLayout" && (t = e.jsx(ze, { isPresent: s, anchorX: m, children: t })), e.jsx(ee.Provider, { value: d, children: t });
109
109
  };
110
110
  function Se() {
111
111
  return /* @__PURE__ */ new Map();
@@ -122,7 +122,7 @@ function qe(t = !0) {
122
122
  const u = Ce(() => t && n && n(r), [r, n, t]);
123
123
  return !s && n ? [!1, u] : [!0];
124
124
  }
125
- const I = (t) => t.key || "";
125
+ const N = (t) => t.key || "";
126
126
  function H(t) {
127
127
  const i = [];
128
128
  return ve.forEach(t, (s) => {
@@ -130,27 +130,27 @@ function H(t) {
130
130
  }), i;
131
131
  }
132
132
  const Le = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presenceAffectsLayout: o = !0, mode: r = "sync", propagate: u = !1, anchorX: m = "left" }) => {
133
- const [h, x] = qe(u), d = M(() => H(t), [t]), c = u && !h ? [] : d.map(I), y = D(!0), f = D(d), k = Z(() => /* @__PURE__ */ new Map()), [a, l] = E(d), [p, v] = E(d);
134
- Ne(() => {
135
- y.current = !1, f.current = d;
133
+ const [f, x] = qe(u), c = M(() => H(t), [t]), d = u && !f ? [] : c.map(N), y = D(!0), h = D(c), k = Z(() => /* @__PURE__ */ new Map()), [a, l] = E(c), [p, v] = E(c);
134
+ Ie(() => {
135
+ y.current = !1, h.current = c;
136
136
  for (let w = 0; w < p.length; w++) {
137
- const g = I(p[w]);
138
- c.includes(g) ? k.delete(g) : k.get(g) !== !0 && k.set(g, !1);
137
+ const g = N(p[w]);
138
+ d.includes(g) ? k.delete(g) : k.get(g) !== !0 && k.set(g, !1);
139
139
  }
140
- }, [p, c.length, c.join("-")]);
140
+ }, [p, d.length, d.join("-")]);
141
141
  const C = [];
142
- if (d !== a) {
143
- let w = [...d];
142
+ if (c !== a) {
143
+ let w = [...c];
144
144
  for (let g = 0; g < p.length; g++) {
145
- const b = p[g], T = I(b);
146
- c.includes(T) || (w.splice(g, 0, b), C.push(b));
145
+ const b = p[g], T = N(b);
146
+ d.includes(T) || (w.splice(g, 0, b), C.push(b));
147
147
  }
148
- return r === "wait" && C.length && (w = C), v(H(w)), l(d), null;
148
+ return r === "wait" && C.length && (w = C), v(H(w)), l(c), null;
149
149
  }
150
150
  process.env.NODE_ENV !== "production" && r === "wait" && p.length > 1 && console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);
151
151
  const { forceRender: A } = $(Pe);
152
152
  return e.jsx(e.Fragment, { children: p.map((w) => {
153
- const g = I(w), b = u && !h ? !1 : d === p || c.includes(g), T = () => {
153
+ const g = N(w), b = u && !f ? !1 : c === p || d.includes(g), T = () => {
154
154
  if (k.has(g))
155
155
  k.set(g, !0);
156
156
  else
@@ -158,14 +158,14 @@ const Le = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presen
158
158
  let F = !0;
159
159
  k.forEach((te) => {
160
160
  te || (F = !1);
161
- }), F && (A?.(), v(f.current), u && x?.(), n && n());
161
+ }), F && (A?.(), v(h.current), u && x?.(), n && n());
162
162
  };
163
163
  return e.jsx(Me, { isPresent: b, initial: !y.current || s ? void 0 : !1, custom: i, presenceAffectsLayout: o, mode: r, onExitComplete: b ? void 0 : T, anchorX: m, children: w }, g);
164
164
  }) });
165
165
  }, $e = ({ service: t }) => {
166
166
  const i = pe(), s = xe(), [n, o] = E(
167
167
  null
168
- ), [r, u] = E(""), { data: m, isFetching: h } = me({
168
+ ), [r, u] = E(""), { data: m, isFetching: f } = me({
169
169
  queryFn: () => t.getConsumers(i),
170
170
  queryKey: ["api-keys"],
171
171
  retry: !1
@@ -194,7 +194,7 @@ const Le = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presen
194
194
  onSuccess: () => {
195
195
  s.invalidateQueries({ queryKey: ["api-keys"] });
196
196
  }
197
- }), d = z({
197
+ }), c = z({
198
198
  mutationFn: ({
199
199
  consumerId: a,
200
200
  label: l
@@ -217,7 +217,7 @@ const Le = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presen
217
217
  onSuccess: () => {
218
218
  s.invalidateQueries({ queryKey: ["api-keys"] });
219
219
  }
220
- }), c = z({
220
+ }), d = z({
221
221
  mutationFn: (a) => {
222
222
  if (!t.rollKey)
223
223
  throw new Error("rollKey not implemented");
@@ -226,8 +226,8 @@ const Le = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presen
226
226
  onSuccess: () => s.invalidateQueries({ queryKey: ["api-keys"] })
227
227
  }), y = (a, l) => {
228
228
  o(a), u(l);
229
- }, f = (a) => {
230
- r.trim() && d.mutate({
229
+ }, h = (a) => {
230
+ r.trim() && c.mutate({
231
231
  consumerId: a,
232
232
  label: r.trim()
233
233
  }), o(null), u("");
@@ -273,7 +273,7 @@ const Le = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presen
273
273
  value: r,
274
274
  onChange: (l) => u(l.target.value),
275
275
  onKeyDown: (l) => {
276
- l.key === "Enter" ? f(a.id) : l.key === "Escape" && k();
276
+ l.key === "Enter" ? h(a.id) : l.key === "Escape" && k();
277
277
  },
278
278
  className: "text-lg font-medium",
279
279
  autoFocus: !0
@@ -285,7 +285,7 @@ const Le = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presen
285
285
  {
286
286
  size: "icon",
287
287
  variant: "ghost",
288
- onClick: () => f(a.id),
288
+ onClick: () => h(a.id),
289
289
  disabled: !r.trim(),
290
290
  children: /* @__PURE__ */ e.jsx(_, { size: 16 })
291
291
  }
@@ -317,29 +317,40 @@ const Le = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presen
317
317
  ] })
318
318
  ] }),
319
319
  /* @__PURE__ */ e.jsxs("div", { className: "flex justify-end", children: [
320
- t.updateConsumer && /* @__PURE__ */ e.jsx(
320
+ t.updateConsumer && /* @__PURE__ */ e.jsxs(
321
321
  j,
322
322
  {
323
- size: "icon",
324
323
  variant: "ghost",
325
324
  onClick: () => y(a.id, a.label),
326
325
  className: R(
326
+ "flex gap-2",
327
327
  n === a.id && "opacity-0! pointer-events-none"
328
328
  ),
329
329
  disabled: n === a.id,
330
- children: /* @__PURE__ */ e.jsx(ne, { size: 16 })
330
+ children: [
331
+ /* @__PURE__ */ e.jsx(ne, { size: 16 }),
332
+ "Edit label"
333
+ ]
331
334
  }
332
335
  ),
333
336
  t.rollKey && /* @__PURE__ */ e.jsxs(U, { children: [
334
- /* @__PURE__ */ e.jsx(W, { asChild: !0, children: /* @__PURE__ */ e.jsx(
337
+ /* @__PURE__ */ e.jsx(W, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
335
338
  j,
336
339
  {
337
- size: "icon",
338
340
  title: "Roll this key",
339
341
  variant: "ghost",
340
- disabled: c.isPending,
341
- className: c.isPending ? "animate-spin" : void 0,
342
- children: /* @__PURE__ */ e.jsx(ie, { size: 16 })
342
+ disabled: d.isPending,
343
+ className: "flex items-center gap-2",
344
+ children: [
345
+ /* @__PURE__ */ e.jsx(
346
+ ie,
347
+ {
348
+ size: 16,
349
+ className: d.isPending ? "animate-spin" : void 0
350
+ }
351
+ ),
352
+ "Roll key"
353
+ ]
343
354
  }
344
355
  ) }),
345
356
  /* @__PURE__ */ e.jsxs(X, { children: [
@@ -353,7 +364,7 @@ const Le = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presen
353
364
  j,
354
365
  {
355
366
  onClick: () => {
356
- c.mutate(a.id);
367
+ d.mutate(a.id);
357
368
  },
358
369
  children: "Roll Key"
359
370
  }
@@ -374,7 +385,7 @@ const Le = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presen
374
385
  keyId: l.id
375
386
  });
376
387
  },
377
- className: x.variables?.keyId === l.id && (x.isPending || h) ? "opacity-10!" : void 0
388
+ className: x.variables?.keyId === l.id && (x.isPending || f) ? "opacity-10!" : void 0
378
389
  }
379
390
  ),
380
391
  /* @__PURE__ */ e.jsx("div", { className: "col-span-full h-px bg-border" })
@@ -394,9 +405,9 @@ const Le = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presen
394
405
  onDeleteKey: i,
395
406
  className: s
396
407
  }) => {
397
- const [n, o] = E(!1), [r, u] = E(!1), { key: m, createdOn: h, expiresOn: x } = t, d = x && new Date(x) < /* @__PURE__ */ new Date(), c = x ? Math.ceil(
408
+ const [n, o] = E(!1), [r, u] = E(!1), { key: m, createdOn: f, expiresOn: x } = t, c = x && new Date(x) < /* @__PURE__ */ new Date(), d = x ? Math.ceil(
398
409
  (new Date(x).getTime() - (/* @__PURE__ */ new Date()).getTime()) / (1e3 * 60 * 60 * 24)
399
- ) : 1 / 0, y = c <= 7 && !d;
410
+ ) : 1 / 0, y = d <= 7 && !c;
400
411
  return /* @__PURE__ */ e.jsxs("div", { className: R("grid col-span-full grid-cols-subgrid p-6", s), children: [
401
412
  /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-1", children: [
402
413
  /* @__PURE__ */ e.jsxs("div", { className: "flex gap-2 items-center text-sm border rounded-md w-fit px-1", children: [
@@ -406,7 +417,7 @@ const Le = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presen
406
417
  {
407
418
  className: R(
408
419
  "rounded-full w-2 h-2 bg-emerald-400 mr-2",
409
- (y || d) && "bg-neutral-200"
420
+ (y || c) && "bg-neutral-200"
410
421
  )
411
422
  }
412
423
  ),
@@ -419,7 +430,7 @@ const Le = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presen
419
430
  j,
420
431
  {
421
432
  variant: "ghost",
422
- onClick: () => o((f) => !f),
433
+ onClick: () => o((h) => !h),
423
434
  size: "icon",
424
435
  children: n ? /* @__PURE__ */ e.jsx(re, { size: 16 }) : /* @__PURE__ */ e.jsx(ae, { size: 16 })
425
436
  }
@@ -439,27 +450,27 @@ const Le = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presen
439
450
  )
440
451
  ] }),
441
452
  /* @__PURE__ */ e.jsxs("div", { className: "flex gap-1 mt-0.5 text-nowrap", children: [
442
- h && /* @__PURE__ */ e.jsxs("span", { className: "text-xs text-muted-foreground", children: [
453
+ f && /* @__PURE__ */ e.jsxs("span", { className: "text-xs text-muted-foreground", children: [
443
454
  "Created ",
444
- Fe(h),
455
+ Fe(f),
445
456
  "."
446
457
  ] }),
447
458
  " ",
448
459
  x && y && /* @__PURE__ */ e.jsxs("span", { className: "text-xs text-primary", children: [
449
460
  "Expires in ",
450
- c,
461
+ d,
451
462
  " ",
452
- c === 1 ? "day" : "days",
463
+ d === 1 ? "day" : "days",
453
464
  "."
454
465
  ] }),
455
- x && d && /* @__PURE__ */ e.jsxs("span", { className: "text-xs text-primary", children: [
466
+ x && c && /* @__PURE__ */ e.jsxs("span", { className: "text-xs text-primary", children: [
456
467
  "Expired",
457
468
  " ",
458
- c === 0 ? "today." : `${c * -1} days ago.`
469
+ d === 0 ? "today." : `${d * -1} days ago.`
459
470
  ] })
460
471
  ] })
461
472
  ] }),
462
- /* @__PURE__ */ e.jsx("div", { className: "flex justify-end", children: d && i && /* @__PURE__ */ e.jsxs(U, { children: [
473
+ /* @__PURE__ */ e.jsx("div", { className: "flex justify-end", children: x && i && /* @__PURE__ */ e.jsxs(U, { children: [
463
474
  /* @__PURE__ */ e.jsx(W, { asChild: !0, children: /* @__PURE__ */ e.jsx(j, { variant: "ghost", size: "icon", children: /* @__PURE__ */ e.jsx(le, { size: 16 }) }) }),
464
475
  /* @__PURE__ */ e.jsxs(X, { children: [
465
476
  /* @__PURE__ */ e.jsxs(Y, { children: [
@@ -481,10 +492,10 @@ const Le = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presen
481
492
  ] })
482
493
  ] }) })
483
494
  ] });
484
- }, N = "https://api.zuploedge.com/v2/client", Qe = (t) => ({
495
+ }, I = "https://api.zuploedge.com/v2/client", Qe = (t) => ({
485
496
  deleteKey: async (i, s, n) => {
486
497
  const o = new Request(
487
- N + `/${t}/consumers/${i}/keys/${s}`,
498
+ I + `/${t}/consumers/${i}/keys/${s}`,
488
499
  {
489
500
  method: "DELETE"
490
501
  }
@@ -497,7 +508,7 @@ const Le = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presen
497
508
  const n = await fetch(
498
509
  await s.signRequest(
499
510
  new Request(
500
- N + `/${t}/consumers/${i.id}`,
511
+ I + `/${t}/consumers/${i.id}`,
501
512
  {
502
513
  method: "PATCH",
503
514
  headers: {
@@ -516,7 +527,7 @@ const Le = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presen
516
527
  const n = await fetch(
517
528
  await s.signRequest(
518
529
  new Request(
519
- N + `/${t}/consumers/${i}/roll-key`,
530
+ I + `/${t}/consumers/${i}/roll-key`,
520
531
  {
521
532
  method: "POST",
522
533
  headers: {
@@ -531,7 +542,7 @@ const Le = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presen
531
542
  },
532
543
  getConsumers: async (i) => {
533
544
  const s = new Request(
534
- N + `/${t}/consumers`
545
+ I + `/${t}/consumers`
535
546
  );
536
547
  await i.signRequest(s);
537
548
  const n = await fetch(s);