@tulip-systems/core 0.4.1 → 0.5.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 (602) hide show
  1. package/dist/auth/client.d.mts +2 -2
  2. package/dist/auth/client.mjs +2 -2
  3. package/dist/commands/client.d.mts +3 -3
  4. package/dist/commands/client.mjs +3 -3
  5. package/dist/components/client.d.mts +3 -5
  6. package/dist/components/client.mjs +3 -5
  7. package/dist/components/common/icons.d.mts +52 -52
  8. package/dist/components/common/icons.d.mts.map +1 -1
  9. package/dist/components/common/status.d.mts +3 -3
  10. package/dist/components/common/status.d.mts.map +1 -1
  11. package/dist/components/editor/components/block-dropdown.mjs +28 -14
  12. package/dist/components/editor/components/block-dropdown.mjs.map +1 -1
  13. package/dist/components/editor/components/content.client.d.mts +2 -2
  14. package/dist/components/editor/components/content.client.mjs +1 -1
  15. package/dist/components/editor/components/content.client.mjs.map +1 -1
  16. package/dist/components/editor/components/editor.client.d.mts +48 -0
  17. package/dist/components/editor/components/editor.client.d.mts.map +1 -0
  18. package/dist/components/editor/components/editor.client.mjs +53 -0
  19. package/dist/components/editor/components/editor.client.mjs.map +1 -0
  20. package/dist/components/editor/components/menu-fixed.client.d.mts +7 -0
  21. package/dist/components/editor/components/menu-fixed.client.d.mts.map +1 -0
  22. package/dist/components/editor/components/{fixed-menu.client.mjs → menu-fixed.client.mjs} +21 -27
  23. package/dist/components/editor/components/menu-fixed.client.mjs.map +1 -0
  24. package/dist/components/editor/lib/constants.d.mts +60 -0
  25. package/dist/components/editor/lib/constants.d.mts.map +1 -0
  26. package/dist/components/editor/lib/constants.mjs +90 -0
  27. package/dist/components/editor/lib/constants.mjs.map +1 -0
  28. package/dist/components/editor/lib/extensions.d.mts +62 -0
  29. package/dist/components/editor/lib/extensions.d.mts.map +1 -0
  30. package/dist/components/editor/lib/extensions.mjs +52 -0
  31. package/dist/components/editor/lib/extensions.mjs.map +1 -0
  32. package/dist/components/editor/lib/helpers.mjs +3 -3
  33. package/dist/components/editor/lib/helpers.mjs.map +1 -1
  34. package/dist/components/editor/lib/variants.mjs +8 -0
  35. package/dist/components/editor/lib/variants.mjs.map +1 -0
  36. package/dist/components/header/back-button.client.d.mts +2 -2
  37. package/dist/components/header/bottom-bar.client.d.mts +3 -3
  38. package/dist/components/header/breadcrumbs.client.d.mts +7 -7
  39. package/dist/components/header/header.client.d.mts +2 -2
  40. package/dist/components/header/mobile-nav-switcher.client.d.mts +2 -2
  41. package/dist/components/header/top-bar.client.d.mts +4 -4
  42. package/dist/components/header/top-bar.client.mjs +1 -1
  43. package/dist/components/header/top-bar.client.mjs.map +1 -1
  44. package/dist/components/layouts/admin-content.client.d.mts +2 -2
  45. package/dist/components/layouts/admin-content.client.mjs +1 -1
  46. package/dist/components/layouts/admin-content.client.mjs.map +1 -1
  47. package/dist/components/layouts/admin-layout.d.mts +2 -2
  48. package/dist/components/layouts/admin-layout.d.mts.map +1 -1
  49. package/dist/components/layouts/admin-loading.d.mts +2 -2
  50. package/dist/components/layouts/admin-loading.d.mts.map +1 -1
  51. package/dist/components/layouts/empty-page.d.mts +4 -4
  52. package/dist/components/layouts/empty-page.d.mts.map +1 -1
  53. package/dist/components/layouts/list-layout.d.mts +2 -2
  54. package/dist/components/layouts/list-layout.d.mts.map +1 -1
  55. package/dist/components/layouts/not-found-page.d.mts +3 -3
  56. package/dist/components/layouts/not-found-page.d.mts.map +1 -1
  57. package/dist/components/layouts/providers.client.d.mts +2 -2
  58. package/dist/components/layouts/root-layout.server.d.mts +4 -4
  59. package/dist/components/layouts/root-layout.server.d.mts.map +1 -1
  60. package/dist/components/layouts/root-loading.d.mts +2 -2
  61. package/dist/components/layouts/root-loading.d.mts.map +1 -1
  62. package/dist/components/layouts/tab-layout.d.mts +2 -2
  63. package/dist/components/layouts/tab-layout.d.mts.map +1 -1
  64. package/dist/components/lists/data-list.d.mts +5 -5
  65. package/dist/components/lists/data-list.d.mts.map +1 -1
  66. package/dist/components/lists/data-stack.d.mts +8 -8
  67. package/dist/components/lists/data-stack.d.mts.map +1 -1
  68. package/dist/components/navigation/admin-sidebar-paths.client.d.mts +10 -10
  69. package/dist/components/ui/accordion.d.mts +5 -5
  70. package/dist/components/ui/alert-dialog.d.mts +12 -12
  71. package/dist/components/ui/alert.d.mts +4 -4
  72. package/dist/components/ui/aspect-ratio.d.mts +2 -2
  73. package/dist/components/ui/avatar.client.d.mts +4 -4
  74. package/dist/components/ui/badge.d.mts +2 -2
  75. package/dist/components/ui/breadcrumb.d.mts +8 -8
  76. package/dist/components/ui/button.d.mts +2 -2
  77. package/dist/components/ui/calendar.d.mts +17 -4
  78. package/dist/components/ui/calendar.d.mts.map +1 -1
  79. package/dist/components/ui/calendar.mjs +90 -37
  80. package/dist/components/ui/calendar.mjs.map +1 -1
  81. package/dist/components/ui/card.d.mts +7 -7
  82. package/dist/components/ui/carousel.d.mts +6 -6
  83. package/dist/components/ui/chart.client.d.mts +5 -5
  84. package/dist/components/ui/checkbox.d.mts +2 -2
  85. package/dist/components/ui/collapsible.client.d.mts +4 -4
  86. package/dist/components/ui/color-picker.client.d.mts +2 -2
  87. package/dist/components/ui/combobox-dropdown.client.d.mts +2 -2
  88. package/dist/components/ui/combobox.client.d.mts +2 -2
  89. package/dist/components/ui/command.d.mts +10 -10
  90. package/dist/components/ui/context-menu.d.mts +16 -16
  91. package/dist/components/ui/date-picker.client.d.mts +2 -2
  92. package/dist/components/ui/dialog.client.d.mts +11 -11
  93. package/dist/components/ui/drawer.client.d.mts +11 -11
  94. package/dist/components/ui/dropdown-menu.d.mts +16 -16
  95. package/dist/components/ui/form.client.d.mts +7 -7
  96. package/dist/components/ui/hover-card.client.d.mts +4 -4
  97. package/dist/components/ui/input-recipient.d.mts +5 -3
  98. package/dist/components/ui/input-recipient.d.mts.map +1 -1
  99. package/dist/components/ui/input-recipient.mjs +2 -2
  100. package/dist/components/ui/input-recipient.mjs.map +1 -1
  101. package/dist/components/ui/input.d.mts +2 -2
  102. package/dist/components/ui/label.d.mts +2 -2
  103. package/dist/components/ui/navigation-menu.d.mts +9 -9
  104. package/dist/components/ui/pagination.d.mts +8 -8
  105. package/dist/components/ui/popover.d.mts +5 -5
  106. package/dist/components/ui/progress.client.d.mts +2 -2
  107. package/dist/components/ui/radio-group.d.mts +3 -3
  108. package/dist/components/ui/resizable.client.d.mts +4 -4
  109. package/dist/components/ui/scroll-area.d.mts +3 -3
  110. package/dist/components/ui/select.client.d.mts +11 -11
  111. package/dist/components/ui/separator.d.mts +2 -2
  112. package/dist/components/ui/sheet.client.d.mts +9 -9
  113. package/dist/components/ui/sidebar.client.d.mts +26 -26
  114. package/dist/components/ui/skeleton.d.mts +2 -2
  115. package/dist/components/ui/slider.d.mts +2 -2
  116. package/dist/components/ui/sonner.client.d.mts +2 -2
  117. package/dist/components/ui/switch.d.mts +2 -2
  118. package/dist/components/ui/tabs.d.mts +5 -5
  119. package/dist/components/ui/textarea.d.mts +2 -2
  120. package/dist/components/ui/time-input.client.d.mts +2 -2
  121. package/dist/components/ui/toggle-group.client.d.mts +3 -3
  122. package/dist/components/ui/toggle.d.mts +4 -4
  123. package/dist/components/ui/toggle.d.mts.map +1 -1
  124. package/dist/components/ui/tooltip.client.d.mts +5 -5
  125. package/dist/components/ui/tooltip.client.d.mts.map +1 -1
  126. package/dist/components.d.mts +2 -2
  127. package/dist/components.mjs +2 -2
  128. package/dist/config/server.d.mts +1 -2
  129. package/dist/config/server.mjs +1 -2
  130. package/dist/data-tables.d.mts +6 -5
  131. package/dist/data-tables.mjs +4 -3
  132. package/dist/inline-edit/client.d.mts +4 -4
  133. package/dist/inline-edit/client.mjs +3 -3
  134. package/dist/lib/hooks/use-action.d.mts +2 -2
  135. package/dist/lib/hooks/use-indicator.d.mts +2 -2
  136. package/dist/lib.mjs +1 -1
  137. package/dist/modules/auth/components/allowed.client.d.mts +2 -2
  138. package/dist/modules/auth/components/allowed.client.d.mts.map +1 -1
  139. package/dist/modules/auth/components/auth-layout.server.d.mts +2 -2
  140. package/dist/modules/auth/components/auth-layout.server.d.mts.map +1 -1
  141. package/dist/modules/auth/components/auth-loading.d.mts +2 -2
  142. package/dist/modules/auth/components/auth-loading.d.mts.map +1 -1
  143. package/dist/modules/auth/components/create-first-user-page.client.d.mts +2 -2
  144. package/dist/modules/auth/components/create-first-user-page.client.d.mts.map +1 -1
  145. package/dist/modules/auth/components/forget-password-page.client.d.mts +2 -2
  146. package/dist/modules/auth/components/forget-password-page.client.d.mts.map +1 -1
  147. package/dist/modules/auth/components/guard-first-user.server.d.mts +2 -2
  148. package/dist/modules/auth/components/guard-first-user.server.d.mts.map +1 -1
  149. package/dist/modules/auth/components/guard.server.d.mts +2 -2
  150. package/dist/modules/auth/components/guard.server.d.mts.map +1 -1
  151. package/dist/modules/auth/components/login-page.client.d.mts +2 -2
  152. package/dist/modules/auth/components/login-page.client.d.mts.map +1 -1
  153. package/dist/modules/auth/components/reset-password-page.client.d.mts +2 -2
  154. package/dist/modules/auth/components/reset-password-page.client.d.mts.map +1 -1
  155. package/dist/modules/auth/components/update-password-command.d.mts +2 -2
  156. package/dist/modules/auth/components/update-password-command.d.mts.map +1 -1
  157. package/dist/modules/auth/db/schema.d.mts +247 -230
  158. package/dist/modules/auth/db/schema.d.mts.map +1 -1
  159. package/dist/modules/auth/db/schema.mjs +12 -20
  160. package/dist/modules/auth/db/schema.mjs.map +1 -1
  161. package/dist/modules/auth/handler/client.client.d.mts +129 -129
  162. package/dist/modules/auth/handler/client.client.d.mts.map +1 -1
  163. package/dist/modules/auth/handler/client.client.mjs +10 -6
  164. package/dist/modules/auth/handler/client.client.mjs.map +1 -1
  165. package/dist/modules/auth/handler/init.d.mts +134 -131
  166. package/dist/modules/auth/handler/init.d.mts.map +1 -1
  167. package/dist/modules/auth/handler/init.mjs +5 -2
  168. package/dist/modules/auth/handler/init.mjs.map +1 -1
  169. package/dist/modules/auth/hooks/use-permission.d.mts +2 -2
  170. package/dist/modules/auth/hooks/use-permission.d.mts.map +1 -1
  171. package/dist/modules/auth/hooks/use-permission.mjs +7 -2
  172. package/dist/modules/auth/hooks/use-permission.mjs.map +1 -1
  173. package/dist/modules/auth/hooks/use-session.d.mts +119 -3
  174. package/dist/modules/auth/hooks/use-session.d.mts.map +1 -1
  175. package/dist/modules/auth/hooks/use-session.mjs +15 -10
  176. package/dist/modules/auth/hooks/use-session.mjs.map +1 -1
  177. package/dist/modules/auth/lib/helpers.server.d.mts +5 -5
  178. package/dist/modules/auth/lib/helpers.server.d.mts.map +1 -1
  179. package/dist/modules/auth/lib/validators.d.mts +1 -1
  180. package/dist/modules/auth/lib/validators.d.mts.map +1 -1
  181. package/dist/modules/auth/lib/validators.mjs +1 -1
  182. package/dist/modules/auth/lib/validators.mjs.map +1 -1
  183. package/dist/modules/commands/components/alert-dialog-command.client.d.mts +10 -10
  184. package/dist/modules/commands/components/alert-dialog-command.client.d.mts.map +1 -1
  185. package/dist/modules/commands/components/alert-dialog-command.client.mjs +2 -2
  186. package/dist/modules/commands/components/alert-dialog-command.client.mjs.map +1 -1
  187. package/dist/modules/commands/components/click-command.client.d.mts +2 -2
  188. package/dist/modules/commands/components/click-command.client.d.mts.map +1 -1
  189. package/dist/modules/commands/components/click-command.client.mjs +2 -2
  190. package/dist/modules/commands/components/click-command.client.mjs.map +1 -1
  191. package/dist/modules/commands/components/command-trigger.client.d.mts +6 -6
  192. package/dist/modules/commands/components/command-trigger.client.d.mts.map +1 -1
  193. package/dist/modules/commands/components/dialog-command.client.d.mts +18 -8
  194. package/dist/modules/commands/components/dialog-command.client.d.mts.map +1 -1
  195. package/dist/modules/commands/components/dialog-command.client.mjs +12 -8
  196. package/dist/modules/commands/components/dialog-command.client.mjs.map +1 -1
  197. package/dist/modules/commands/components/dropdown-command.client.d.mts +5 -5
  198. package/dist/modules/commands/components/dropdown-command.client.d.mts.map +1 -1
  199. package/dist/modules/commands/components/dropdown-command.client.mjs +2 -2
  200. package/dist/modules/commands/components/dropdown-command.client.mjs.map +1 -1
  201. package/dist/modules/commands/components/empty-command.client.d.mts +2 -2
  202. package/dist/modules/commands/components/form-dialog-command.client.d.mts +11 -11
  203. package/dist/modules/commands/components/form-dialog-command.client.mjs +2 -2
  204. package/dist/modules/commands/components/form-dialog-command.client.mjs.map +1 -1
  205. package/dist/modules/commands/hooks/use-command-mutation.client.d.mts +17 -0
  206. package/dist/modules/commands/hooks/use-command-mutation.client.d.mts.map +1 -0
  207. package/dist/modules/commands/hooks/use-command-mutation.client.mjs +42 -0
  208. package/dist/modules/commands/hooks/use-command-mutation.client.mjs.map +1 -0
  209. package/dist/modules/commands/menus/context-menu.client.d.mts +2 -2
  210. package/dist/modules/commands/menus/dropdown-menu.client.d.mts +3 -3
  211. package/dist/modules/commands/menus/inline-menu.client.d.mts +3 -3
  212. package/dist/modules/commands/menus/responsive-menu.client.d.mts +3 -3
  213. package/dist/modules/commands/utils/archive-command.client.d.mts +3 -3
  214. package/dist/modules/commands/utils/delete-command.client.d.mts +13 -8
  215. package/dist/modules/commands/utils/delete-command.client.d.mts.map +1 -1
  216. package/dist/modules/commands/utils/delete-command.client.mjs +10 -1
  217. package/dist/modules/commands/utils/delete-command.client.mjs.map +1 -1
  218. package/dist/modules/config/db/helpers.d.mts +5 -5
  219. package/dist/modules/config/db/helpers.d.mts.map +1 -1
  220. package/dist/modules/config/lib/config.d.mts +3 -3
  221. package/dist/modules/config/lib/config.d.mts.map +1 -1
  222. package/dist/modules/config/lib/config.mjs.map +1 -1
  223. package/dist/modules/config/lib/context.d.mts +2 -2
  224. package/dist/modules/config/lib/context.d.mts.map +1 -1
  225. package/dist/modules/config/lib/context.mjs.map +1 -1
  226. package/dist/modules/data-tables/components/cell/common.client.d.mts +5 -5
  227. package/dist/modules/data-tables/components/cell/common.client.d.mts.map +1 -1
  228. package/dist/modules/data-tables/components/column-header.d.mts +2 -2
  229. package/dist/modules/data-tables/components/filters/combobox.client.d.mts +2 -2
  230. package/dist/modules/data-tables/components/filters/combobox.client.d.mts.map +1 -1
  231. package/dist/modules/data-tables/components/filters/combobox.client.mjs +5 -2
  232. package/dist/modules/data-tables/components/filters/combobox.client.mjs.map +1 -1
  233. package/dist/modules/data-tables/components/filters/slider.client.d.mts +2 -2
  234. package/dist/modules/data-tables/components/filters/slider.client.d.mts.map +1 -1
  235. package/dist/modules/data-tables/components/header.d.mts +4 -4
  236. package/dist/modules/data-tables/components/layout.d.mts +2 -2
  237. package/dist/modules/data-tables/components/layout.d.mts.map +1 -1
  238. package/dist/modules/data-tables/components/search-input.client.d.mts +2 -2
  239. package/dist/modules/data-tables/components/search-input.client.d.mts.map +1 -1
  240. package/dist/modules/data-tables/components/skeleton.d.mts +2 -2
  241. package/dist/modules/data-tables/components/skeleton.d.mts.map +1 -1
  242. package/dist/modules/data-tables/components/table.d.mts +7 -7
  243. package/dist/modules/data-tables/components/table.d.mts.map +1 -1
  244. package/dist/modules/data-tables/components/toolbar.d.mts +3 -3
  245. package/dist/modules/data-tables/components/toolbar.d.mts.map +1 -1
  246. package/dist/modules/data-tables/hooks/use-context.client.d.mts +13 -10
  247. package/dist/modules/data-tables/hooks/use-context.client.d.mts.map +1 -1
  248. package/dist/modules/data-tables/hooks/use-context.client.mjs.map +1 -1
  249. package/dist/modules/data-tables/hooks/use-table.client.d.mts +2 -1
  250. package/dist/modules/data-tables/hooks/use-table.client.d.mts.map +1 -1
  251. package/dist/modules/data-tables/hooks/use-table.client.mjs.map +1 -1
  252. package/dist/modules/data-tables/lib/converters/search.d.mts +1 -1
  253. package/dist/modules/data-tables/lib/converters/sorting.d.mts +1 -1
  254. package/dist/modules/data-tables/lib/filters/config.d.mts +4 -1
  255. package/dist/modules/data-tables/lib/filters/config.d.mts.map +1 -1
  256. package/dist/modules/data-tables/lib/filters/config.mjs.map +1 -1
  257. package/dist/modules/data-tables/lib/filters/helpers.d.mts +11 -0
  258. package/dist/modules/data-tables/lib/filters/helpers.d.mts.map +1 -0
  259. package/dist/modules/data-tables/lib/filters/helpers.mjs +17 -0
  260. package/dist/modules/data-tables/lib/filters/helpers.mjs.map +1 -0
  261. package/dist/modules/data-tables/lib/filters/parsers.d.mts +7 -2
  262. package/dist/modules/data-tables/lib/filters/parsers.d.mts.map +1 -1
  263. package/dist/modules/data-tables/lib/filters/parsers.mjs +6 -1
  264. package/dist/modules/data-tables/lib/filters/parsers.mjs.map +1 -1
  265. package/dist/modules/data-tables/lib/filters/resolvers.d.mts +6 -1
  266. package/dist/modules/data-tables/lib/filters/resolvers.d.mts.map +1 -1
  267. package/dist/modules/data-tables/lib/filters/resolvers.mjs +8 -1
  268. package/dist/modules/data-tables/lib/filters/resolvers.mjs.map +1 -1
  269. package/dist/modules/data-tables/lib/types.d.mts +8 -5
  270. package/dist/modules/data-tables/lib/types.d.mts.map +1 -1
  271. package/dist/modules/data-tables/server/get-data.server.d.mts +1 -1
  272. package/dist/modules/data-tables/tables/data-table/components/table.d.mts +2 -2
  273. package/dist/modules/data-tables/tables/data-table/components/table.d.mts.map +1 -1
  274. package/dist/modules/data-tables/tables/inline-table/components/cells/common.d.mts +2 -2
  275. package/dist/modules/data-tables/tables/inline-table/components/cells/common.d.mts.map +1 -1
  276. package/dist/modules/data-tables/tables/inline-table/components/cells/drag-handle.client.d.mts +2 -2
  277. package/dist/modules/data-tables/tables/inline-table/components/cells/drag-handle.client.d.mts.map +1 -1
  278. package/dist/modules/data-tables/tables/inline-table/components/cells/drag-handle.client.mjs +1 -1
  279. package/dist/modules/data-tables/tables/inline-table/components/cells/drag-handle.client.mjs.map +1 -1
  280. package/dist/modules/data-tables/tables/inline-table/components/inputs/advanced-select.client.d.mts +2 -2
  281. package/dist/modules/data-tables/tables/inline-table/components/inputs/advanced-select.client.d.mts.map +1 -1
  282. package/dist/modules/data-tables/tables/inline-table/components/inputs/combobox.client.d.mts +2 -2
  283. package/dist/modules/data-tables/tables/inline-table/components/inputs/combobox.client.d.mts.map +1 -1
  284. package/dist/modules/data-tables/tables/inline-table/components/inputs/input.client.d.mts +3 -3
  285. package/dist/modules/data-tables/tables/inline-table/components/inputs/input.client.d.mts.map +1 -1
  286. package/dist/modules/data-tables/tables/inline-table/components/inputs/read-only.d.mts +2 -2
  287. package/dist/modules/data-tables/tables/inline-table/components/inputs/read-only.d.mts.map +1 -1
  288. package/dist/modules/data-tables/tables/inline-table/components/inputs/select.client.d.mts +2 -2
  289. package/dist/modules/data-tables/tables/inline-table/components/inputs/select.client.d.mts.map +1 -1
  290. package/dist/modules/data-tables/tables/inline-table/components/table.d.mts +2 -2
  291. package/dist/modules/data-tables/tables/inline-table/components/table.d.mts.map +1 -1
  292. package/dist/modules/data-tables/tables/inline-table/hooks/context.client.d.mts +2 -2
  293. package/dist/modules/data-tables/tables/inline-table/hooks/context.client.d.mts.map +1 -1
  294. package/dist/modules/inline-edit/components/combobox-dropdown.client.d.mts +5 -2
  295. package/dist/modules/inline-edit/components/combobox-dropdown.client.d.mts.map +1 -1
  296. package/dist/modules/inline-edit/components/combobox-dropdown.client.mjs +7 -3
  297. package/dist/modules/inline-edit/components/combobox-dropdown.client.mjs.map +1 -1
  298. package/dist/modules/inline-edit/components/combobox.client.d.mts +5 -2
  299. package/dist/modules/inline-edit/components/combobox.client.d.mts.map +1 -1
  300. package/dist/modules/inline-edit/components/combobox.client.mjs +6 -2
  301. package/dist/modules/inline-edit/components/combobox.client.mjs.map +1 -1
  302. package/dist/modules/inline-edit/components/date-input.client.d.mts +6 -3
  303. package/dist/modules/inline-edit/components/date-input.client.d.mts.map +1 -1
  304. package/dist/modules/inline-edit/components/date-input.client.mjs +5 -3
  305. package/dist/modules/inline-edit/components/date-input.client.mjs.map +1 -1
  306. package/dist/modules/inline-edit/components/date-picker.client.d.mts +7 -3
  307. package/dist/modules/inline-edit/components/date-picker.client.d.mts.map +1 -1
  308. package/dist/modules/inline-edit/components/date-picker.client.mjs +5 -3
  309. package/dist/modules/inline-edit/components/date-picker.client.mjs.map +1 -1
  310. package/dist/modules/inline-edit/components/deprecated-editor.client.d.mts +21 -0
  311. package/dist/modules/inline-edit/components/deprecated-editor.client.d.mts.map +1 -0
  312. package/dist/modules/inline-edit/components/deprecated-editor.client.mjs +37 -0
  313. package/dist/modules/inline-edit/components/deprecated-editor.client.mjs.map +1 -0
  314. package/dist/modules/inline-edit/components/editor.client.d.mts +10 -7
  315. package/dist/modules/inline-edit/components/editor.client.d.mts.map +1 -1
  316. package/dist/modules/inline-edit/components/editor.client.mjs +13 -18
  317. package/dist/modules/inline-edit/components/editor.client.mjs.map +1 -1
  318. package/dist/modules/inline-edit/components/input-recipient.client.d.mts +4 -2
  319. package/dist/modules/inline-edit/components/input-recipient.client.d.mts.map +1 -1
  320. package/dist/modules/inline-edit/components/input-recipient.client.mjs +7 -3
  321. package/dist/modules/inline-edit/components/input-recipient.client.mjs.map +1 -1
  322. package/dist/modules/inline-edit/components/input-toggle.client.d.mts +3 -2
  323. package/dist/modules/inline-edit/components/input-toggle.client.d.mts.map +1 -1
  324. package/dist/modules/inline-edit/components/input-toggle.client.mjs +3 -2
  325. package/dist/modules/inline-edit/components/input-toggle.client.mjs.map +1 -1
  326. package/dist/modules/inline-edit/components/input.client.d.mts +18 -4
  327. package/dist/modules/inline-edit/components/input.client.d.mts.map +1 -1
  328. package/dist/modules/inline-edit/components/input.client.mjs +26 -5
  329. package/dist/modules/inline-edit/components/input.client.mjs.map +1 -1
  330. package/dist/modules/inline-edit/components/select.client.d.mts +8 -6
  331. package/dist/modules/inline-edit/components/select.client.d.mts.map +1 -1
  332. package/dist/modules/inline-edit/components/select.client.mjs +3 -2
  333. package/dist/modules/inline-edit/components/select.client.mjs.map +1 -1
  334. package/dist/modules/inline-edit/components/switch.client.d.mts +3 -2
  335. package/dist/modules/inline-edit/components/switch.client.d.mts.map +1 -1
  336. package/dist/modules/inline-edit/components/switch.client.mjs +3 -2
  337. package/dist/modules/inline-edit/components/switch.client.mjs.map +1 -1
  338. package/dist/modules/inline-edit/components/toggle.client.d.mts +3 -2
  339. package/dist/modules/inline-edit/components/toggle.client.d.mts.map +1 -1
  340. package/dist/modules/inline-edit/components/toggle.client.mjs +3 -2
  341. package/dist/modules/inline-edit/components/toggle.client.mjs.map +1 -1
  342. package/dist/modules/inline-edit/hooks/context.client.d.mts +2 -2
  343. package/dist/modules/inline-edit/hooks/context.client.d.mts.map +1 -1
  344. package/dist/modules/inline-edit/hooks/use-inline.client.d.mts +1 -1
  345. package/dist/modules/inline-edit/hooks/use-inline.client.mjs.map +1 -1
  346. package/dist/modules/inline-edit/lib/variants.d.mts +3 -3
  347. package/dist/modules/inline-edit/lib/variants.mjs +1 -1
  348. package/dist/modules/inline-edit/lib/variants.mjs.map +1 -1
  349. package/dist/modules/router/handler/context.server.d.mts +2 -2
  350. package/dist/modules/router/handler/context.server.d.mts.map +1 -1
  351. package/dist/modules/router/handler/init.server.d.mts +7 -7
  352. package/dist/modules/router/lib/query-client.server.d.mts +2 -2
  353. package/dist/modules/router/lib/query-client.server.d.mts.map +1 -1
  354. package/dist/modules/{uploads/components/dropzone/context.d.mts → storage/components/dropzone-context.client.d.mts} +2 -2
  355. package/dist/modules/storage/components/dropzone-context.client.d.mts.map +1 -0
  356. package/dist/modules/{uploads/components/dropzone/context.mjs → storage/components/dropzone-context.client.mjs} +2 -2
  357. package/dist/modules/storage/components/dropzone-context.client.mjs.map +1 -0
  358. package/dist/modules/{uploads/components/dropzone/index.d.mts → storage/components/dropzone.client.d.mts} +7 -7
  359. package/dist/modules/storage/components/dropzone.client.d.mts.map +1 -0
  360. package/dist/modules/{uploads/components/dropzone/index.mjs → storage/components/dropzone.client.mjs} +6 -6
  361. package/dist/modules/storage/components/dropzone.client.mjs.map +1 -0
  362. package/dist/modules/storage/components/image-grid.client.d.mts +26 -0
  363. package/dist/modules/storage/components/image-grid.client.d.mts.map +1 -0
  364. package/dist/modules/storage/components/image-grid.client.mjs +169 -0
  365. package/dist/modules/storage/components/image-grid.client.mjs.map +1 -0
  366. package/dist/modules/storage/components/upload-zone-context.client.d.mts +34 -0
  367. package/dist/modules/storage/components/upload-zone-context.client.d.mts.map +1 -0
  368. package/dist/modules/storage/components/upload-zone-context.client.mjs +21 -0
  369. package/dist/modules/storage/components/upload-zone-context.client.mjs.map +1 -0
  370. package/dist/modules/storage/components/upload-zone.client.d.mts +51 -0
  371. package/dist/modules/storage/components/upload-zone.client.d.mts.map +1 -0
  372. package/dist/modules/storage/components/upload-zone.client.mjs +196 -0
  373. package/dist/modules/storage/components/upload-zone.client.mjs.map +1 -0
  374. package/dist/modules/{uploads/lib → storage/config}/filters.d.mts +2 -2
  375. package/dist/modules/storage/config/filters.d.mts.map +1 -0
  376. package/dist/modules/{uploads/lib → storage/config}/filters.mjs +3 -3
  377. package/dist/modules/storage/config/filters.mjs.map +1 -0
  378. package/dist/modules/storage/lib/constants.d.mts +10 -0
  379. package/dist/modules/storage/lib/constants.d.mts.map +1 -0
  380. package/dist/modules/{uploads → storage}/lib/constants.mjs +3 -2
  381. package/dist/modules/storage/lib/constants.mjs.map +1 -0
  382. package/dist/modules/storage/lib/create-client.server.d.mts +11 -0
  383. package/dist/modules/storage/lib/create-client.server.d.mts.map +1 -0
  384. package/dist/modules/storage/lib/create-client.server.mjs +11 -0
  385. package/dist/modules/storage/lib/create-client.server.mjs.map +1 -0
  386. package/dist/modules/storage/lib/helpers.d.mts +45 -0
  387. package/dist/modules/storage/lib/helpers.d.mts.map +1 -0
  388. package/dist/modules/{uploads → storage}/lib/helpers.mjs +20 -6
  389. package/dist/modules/storage/lib/helpers.mjs.map +1 -0
  390. package/dist/modules/storage/lib/proxy.server.d.mts +21 -0
  391. package/dist/modules/storage/lib/proxy.server.d.mts.map +1 -0
  392. package/dist/modules/storage/lib/proxy.server.mjs +46 -0
  393. package/dist/modules/storage/lib/proxy.server.mjs.map +1 -0
  394. package/dist/modules/storage/lib/router.server.d.mts +29074 -0
  395. package/dist/modules/storage/lib/router.server.d.mts.map +1 -0
  396. package/dist/modules/storage/lib/router.server.mjs +83 -0
  397. package/dist/modules/storage/lib/router.server.mjs.map +1 -0
  398. package/dist/modules/{uploads → storage}/lib/schema.d.mts +414 -150
  399. package/dist/modules/storage/lib/schema.d.mts.map +1 -0
  400. package/dist/modules/{uploads → storage}/lib/schema.mjs +23 -18
  401. package/dist/modules/storage/lib/schema.mjs.map +1 -0
  402. package/dist/modules/storage/lib/service.server.d.mts +188 -0
  403. package/dist/modules/storage/lib/service.server.d.mts.map +1 -0
  404. package/dist/modules/storage/lib/service.server.mjs +297 -0
  405. package/dist/modules/storage/lib/service.server.mjs.map +1 -0
  406. package/dist/modules/{uploads → storage}/lib/validators.d.mts +413 -108
  407. package/dist/modules/storage/lib/validators.d.mts.map +1 -0
  408. package/dist/modules/storage/lib/validators.mjs +106 -0
  409. package/dist/modules/storage/lib/validators.mjs.map +1 -0
  410. package/dist/storage/client.d.mts +6 -0
  411. package/dist/storage/client.mjs +14 -0
  412. package/dist/storage/client.mjs.map +1 -0
  413. package/dist/storage/server.d.mts +4 -0
  414. package/dist/storage/server.mjs +5 -0
  415. package/dist/storage.d.mts +6 -0
  416. package/dist/storage.mjs +7 -0
  417. package/package.json +32 -20
  418. package/src/components/editor/components/block-dropdown.tsx +43 -25
  419. package/src/components/editor/components/content.client.tsx +1 -1
  420. package/src/components/editor/components/editor.client.tsx +95 -0
  421. package/src/components/editor/components/menu-fixed.client.tsx +165 -0
  422. package/src/components/editor/components/spinner.tsx +2 -2
  423. package/src/components/editor/lib/constants.ts +109 -0
  424. package/src/components/editor/lib/extensions.ts +195 -0
  425. package/src/components/editor/lib/helpers.ts +3 -3
  426. package/src/components/editor/lib/variants.ts +5 -0
  427. package/src/components/entry.client.ts +2 -4
  428. package/src/components/header/top-bar.client.tsx +1 -1
  429. package/src/components/layouts/admin-content.client.tsx +1 -1
  430. package/src/components/ui/calendar.tsx +152 -44
  431. package/src/components/ui/input-recipient.tsx +3 -0
  432. package/src/entry.ts +4 -4
  433. package/src/modules/auth/db/schema.ts +13 -21
  434. package/src/modules/auth/handler/client.client.ts +2 -0
  435. package/src/modules/auth/handler/init.ts +4 -1
  436. package/src/modules/auth/hooks/use-permission.ts +3 -2
  437. package/src/modules/auth/hooks/use-session.ts +16 -10
  438. package/src/modules/auth/lib/validators.ts +1 -1
  439. package/src/modules/commands/components/alert-dialog-command.client.tsx +2 -2
  440. package/src/modules/commands/components/click-command.client.tsx +2 -2
  441. package/src/modules/commands/components/dialog-command.client.tsx +20 -8
  442. package/src/modules/commands/components/dropdown-command.client.tsx +2 -2
  443. package/src/modules/commands/components/form-dialog-command.client.tsx +2 -2
  444. package/src/modules/commands/entry.client.ts +1 -1
  445. package/src/modules/commands/hooks/{use-command-action.client.tsx → use-command-mutation.client.tsx} +9 -47
  446. package/src/modules/commands/utils/delete-command.client.tsx +14 -2
  447. package/src/modules/config/db/create-client.ts +11 -4
  448. package/src/modules/config/entry.server.ts +0 -1
  449. package/src/modules/config/lib/config.ts +3 -3
  450. package/src/modules/config/lib/context.ts +2 -2
  451. package/src/modules/data-tables/components/filters/combobox.client.tsx +3 -3
  452. package/src/modules/data-tables/entry.ts +1 -1
  453. package/src/modules/data-tables/hooks/use-context.client.tsx +31 -13
  454. package/src/modules/data-tables/hooks/use-table.client.ts +6 -3
  455. package/src/modules/data-tables/lib/filters/config.ts +1 -0
  456. package/src/modules/data-tables/lib/filters/helpers.ts +19 -0
  457. package/src/modules/data-tables/lib/filters/parsers.ts +14 -1
  458. package/src/modules/data-tables/lib/filters/resolvers.ts +8 -0
  459. package/src/modules/data-tables/lib/types.ts +10 -3
  460. package/src/modules/data-tables/tables/inline-table/components/cells/drag-handle.client.tsx +1 -1
  461. package/src/modules/inline-edit/components/combobox-dropdown.client.tsx +9 -2
  462. package/src/modules/inline-edit/components/combobox.client.tsx +8 -1
  463. package/src/modules/inline-edit/components/date-input.client.tsx +7 -3
  464. package/src/modules/inline-edit/components/date-picker.client.tsx +10 -3
  465. package/src/modules/inline-edit/components/deprecated-editor.client.tsx +48 -0
  466. package/src/modules/inline-edit/components/editor.client.tsx +32 -29
  467. package/src/modules/inline-edit/components/input-recipient.client.tsx +6 -2
  468. package/src/modules/inline-edit/components/input-toggle.client.tsx +2 -0
  469. package/src/modules/inline-edit/components/input.client.tsx +39 -0
  470. package/src/modules/inline-edit/components/select.client.tsx +9 -2
  471. package/src/modules/inline-edit/components/switch.client.tsx +2 -0
  472. package/src/modules/inline-edit/components/toggle.client.tsx +2 -0
  473. package/src/modules/inline-edit/entry.client.ts +1 -1
  474. package/src/modules/inline-edit/hooks/use-inline.client.tsx +2 -2
  475. package/src/modules/inline-edit/lib/variants.ts +1 -1
  476. package/src/modules/{uploads/components/dropzone/index.tsx → storage/components/dropzone.client.tsx} +2 -2
  477. package/src/modules/storage/components/image-grid.client.tsx +225 -0
  478. package/src/modules/{uploads/components/button.client.tsx → storage/components/upload-button.client.tsx} +1 -1
  479. package/src/modules/storage/components/upload-zone-context.client.tsx +32 -0
  480. package/src/modules/storage/components/upload-zone.client.tsx +258 -0
  481. package/src/modules/{uploads/lib → storage/config}/filters.ts +2 -2
  482. package/src/modules/storage/entry.client.ts +12 -0
  483. package/src/modules/storage/entry.server.ts +6 -0
  484. package/src/modules/{uploads → storage}/entry.ts +1 -1
  485. package/src/modules/storage/lib/constants.ts +14 -0
  486. package/src/modules/storage/lib/create-client.server.ts +14 -0
  487. package/src/modules/{uploads → storage}/lib/helpers.ts +23 -9
  488. package/src/modules/storage/lib/proxy.server.ts +63 -0
  489. package/src/modules/storage/lib/router.server.ts +174 -0
  490. package/src/modules/{uploads → storage}/lib/schema.ts +34 -13
  491. package/src/modules/storage/lib/service.server.ts +463 -0
  492. package/src/modules/storage/lib/validators.ts +156 -0
  493. package/dist/components/editor/components/fixed-menu.client.d.mts +0 -7
  494. package/dist/components/editor/components/fixed-menu.client.d.mts.map +0 -1
  495. package/dist/components/editor/components/fixed-menu.client.mjs.map +0 -1
  496. package/dist/components/editor/context.client.d.mts +0 -33
  497. package/dist/components/editor/context.client.d.mts.map +0 -1
  498. package/dist/components/editor/context.client.mjs +0 -45
  499. package/dist/components/editor/context.client.mjs.map +0 -1
  500. package/dist/components/editor/index.client.d.mts +0 -11
  501. package/dist/components/editor/index.client.d.mts.map +0 -1
  502. package/dist/components/editor/index.client.mjs +0 -17
  503. package/dist/components/editor/index.client.mjs.map +0 -1
  504. package/dist/components/editor/preview.client.d.mts +0 -12
  505. package/dist/components/editor/preview.client.d.mts.map +0 -1
  506. package/dist/components/editor/preview.client.mjs +0 -19
  507. package/dist/components/editor/preview.client.mjs.map +0 -1
  508. package/dist/modules/commands/hooks/use-command-action.client.d.mts +0 -22
  509. package/dist/modules/commands/hooks/use-command-action.client.d.mts.map +0 -1
  510. package/dist/modules/commands/hooks/use-command-action.client.mjs +0 -74
  511. package/dist/modules/commands/hooks/use-command-action.client.mjs.map +0 -1
  512. package/dist/modules/config/providers/blob.d.mts +0 -10
  513. package/dist/modules/config/providers/blob.d.mts.map +0 -1
  514. package/dist/modules/config/providers/blob.mjs +0 -11
  515. package/dist/modules/config/providers/blob.mjs.map +0 -1
  516. package/dist/modules/inline-edit/components/richtext.client.d.mts +0 -15
  517. package/dist/modules/inline-edit/components/richtext.client.d.mts.map +0 -1
  518. package/dist/modules/inline-edit/components/richtext.client.mjs +0 -31
  519. package/dist/modules/inline-edit/components/richtext.client.mjs.map +0 -1
  520. package/dist/modules/uploads/components/button.client.d.mts +0 -12
  521. package/dist/modules/uploads/components/button.client.d.mts.map +0 -1
  522. package/dist/modules/uploads/components/button.client.mjs +0 -34
  523. package/dist/modules/uploads/components/button.client.mjs.map +0 -1
  524. package/dist/modules/uploads/components/dropzone/context.d.mts.map +0 -1
  525. package/dist/modules/uploads/components/dropzone/context.mjs.map +0 -1
  526. package/dist/modules/uploads/components/dropzone/index.d.mts.map +0 -1
  527. package/dist/modules/uploads/components/dropzone/index.mjs.map +0 -1
  528. package/dist/modules/uploads/components/images/grid.client.d.mts +0 -11
  529. package/dist/modules/uploads/components/images/grid.client.d.mts.map +0 -1
  530. package/dist/modules/uploads/components/images/grid.client.mjs +0 -119
  531. package/dist/modules/uploads/components/images/grid.client.mjs.map +0 -1
  532. package/dist/modules/uploads/components/images/input.client.d.mts +0 -16
  533. package/dist/modules/uploads/components/images/input.client.d.mts.map +0 -1
  534. package/dist/modules/uploads/components/images/input.client.mjs +0 -28
  535. package/dist/modules/uploads/components/images/input.client.mjs.map +0 -1
  536. package/dist/modules/uploads/components/preview-dialog.client.d.mts +0 -16
  537. package/dist/modules/uploads/components/preview-dialog.client.d.mts.map +0 -1
  538. package/dist/modules/uploads/components/preview-dialog.client.mjs +0 -22
  539. package/dist/modules/uploads/components/preview-dialog.client.mjs.map +0 -1
  540. package/dist/modules/uploads/components/zone.client.d.mts +0 -21
  541. package/dist/modules/uploads/components/zone.client.d.mts.map +0 -1
  542. package/dist/modules/uploads/components/zone.client.mjs +0 -38
  543. package/dist/modules/uploads/components/zone.client.mjs.map +0 -1
  544. package/dist/modules/uploads/hooks/use-upload-image.client.d.mts +0 -34
  545. package/dist/modules/uploads/hooks/use-upload-image.client.d.mts.map +0 -1
  546. package/dist/modules/uploads/hooks/use-upload-image.client.mjs +0 -101
  547. package/dist/modules/uploads/hooks/use-upload-image.client.mjs.map +0 -1
  548. package/dist/modules/uploads/hooks/use-upload-zone.client.d.mts +0 -39
  549. package/dist/modules/uploads/hooks/use-upload-zone.client.d.mts.map +0 -1
  550. package/dist/modules/uploads/hooks/use-upload-zone.client.mjs +0 -20
  551. package/dist/modules/uploads/hooks/use-upload-zone.client.mjs.map +0 -1
  552. package/dist/modules/uploads/lib/constants.d.mts +0 -9
  553. package/dist/modules/uploads/lib/constants.d.mts.map +0 -1
  554. package/dist/modules/uploads/lib/constants.mjs.map +0 -1
  555. package/dist/modules/uploads/lib/filters.d.mts.map +0 -1
  556. package/dist/modules/uploads/lib/filters.mjs.map +0 -1
  557. package/dist/modules/uploads/lib/helpers.d.mts +0 -36
  558. package/dist/modules/uploads/lib/helpers.d.mts.map +0 -1
  559. package/dist/modules/uploads/lib/helpers.mjs.map +0 -1
  560. package/dist/modules/uploads/lib/procedures.server.d.mts +0 -13628
  561. package/dist/modules/uploads/lib/procedures.server.d.mts.map +0 -1
  562. package/dist/modules/uploads/lib/procedures.server.mjs +0 -176
  563. package/dist/modules/uploads/lib/procedures.server.mjs.map +0 -1
  564. package/dist/modules/uploads/lib/proxy.server.d.mts +0 -54
  565. package/dist/modules/uploads/lib/proxy.server.d.mts.map +0 -1
  566. package/dist/modules/uploads/lib/proxy.server.mjs +0 -97
  567. package/dist/modules/uploads/lib/proxy.server.mjs.map +0 -1
  568. package/dist/modules/uploads/lib/route.server.d.mts +0 -43
  569. package/dist/modules/uploads/lib/route.server.d.mts.map +0 -1
  570. package/dist/modules/uploads/lib/route.server.mjs +0 -70
  571. package/dist/modules/uploads/lib/route.server.mjs.map +0 -1
  572. package/dist/modules/uploads/lib/schema.d.mts.map +0 -1
  573. package/dist/modules/uploads/lib/schema.mjs.map +0 -1
  574. package/dist/modules/uploads/lib/validators.d.mts.map +0 -1
  575. package/dist/modules/uploads/lib/validators.mjs +0 -26
  576. package/dist/modules/uploads/lib/validators.mjs.map +0 -1
  577. package/dist/uploads/client.d.mts +0 -10
  578. package/dist/uploads/client.mjs +0 -11
  579. package/dist/uploads/server.d.mts +0 -4
  580. package/dist/uploads/server.mjs +0 -5
  581. package/dist/uploads.d.mts +0 -6
  582. package/dist/uploads.mjs +0 -7
  583. package/src/components/editor/components/fixed-menu.client.tsx +0 -143
  584. package/src/components/editor/context.client.tsx +0 -116
  585. package/src/components/editor/index.client.tsx +0 -13
  586. package/src/components/editor/preview.client.tsx +0 -13
  587. package/src/modules/config/providers/blob.ts +0 -11
  588. package/src/modules/inline-edit/components/richtext.client.tsx +0 -38
  589. package/src/modules/uploads/components/images/grid.client.tsx +0 -162
  590. package/src/modules/uploads/components/images/input.client.tsx +0 -34
  591. package/src/modules/uploads/components/preview-dialog.client.tsx +0 -21
  592. package/src/modules/uploads/components/zone.client.tsx +0 -56
  593. package/src/modules/uploads/entry.client.ts +0 -16
  594. package/src/modules/uploads/entry.server.ts +0 -6
  595. package/src/modules/uploads/hooks/use-upload-image.client.tsx +0 -131
  596. package/src/modules/uploads/hooks/use-upload-zone.client.ts +0 -44
  597. package/src/modules/uploads/lib/constants.ts +0 -10
  598. package/src/modules/uploads/lib/procedures.server.ts +0 -332
  599. package/src/modules/uploads/lib/proxy.server.ts +0 -139
  600. package/src/modules/uploads/lib/route.server.ts +0 -93
  601. package/src/modules/uploads/lib/validators.ts +0 -50
  602. /package/src/modules/{uploads/components/dropzone/context.tsx → storage/components/dropzone-context.client.tsx} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"init.d.mts","names":[],"sources":["../../../../src/modules/auth/handler/init.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;;cAca,gBAAA;KAER,8BAA8B;MAC7B,eAAe;SACZ;UACC;MACJ,kBAAkB;6BAEF;;AART,iBAYG,QAZa,CAAA,gBAYY,eAZZ,CAAA,CAAA,KAAA,EAYoC,aAZpC,CAYkD,OAZlD,CAAA,CAAA,iBAY0D,IAZ1D,CAAA;EAExB,QAAA,EAAA;IAA8B,YAAA,EAAA,MAAA;EACd,CAAA;EAAf,QAAA,EAAA,CAAA,OAAA,EASwE,cAAA,CAAA,iBATxE,EAAA,2BAAA,kCAAA;EACG,gBAAA,EAAA;IACC,OAAA,EAAA,IAAA;EACc,CAAA;EAAlB,IAAA,EAAA;IAEgB,WAAA,EAAA;MAAI,OAAA,EAAA,IAAA;IAIV,CAAA;IAAyB,gBAAA,EAAA;MAAsC,SAAA,EAAA;QAAd,IAAA,EAAA,QAAA;QAAa,QAAA,EAAA,IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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from "../db/schema.mjs";
2
1
  import { url } from "../../../lib/utils/url.mjs";
2
+ import { users } from "../db/schema.mjs";
3
3
  import forget_password_email_default from "../../../components/emails/forget-password-email.mjs";
4
4
  import { eq } from "drizzle-orm";
5
5
  import { passkey } from "@better-auth/passkey";
@@ -12,7 +12,10 @@ import { admin, createAuthMiddleware, emailOTP } from "better-auth/plugins";
12
12
  const authCookiePrefix = "tulip";
13
13
  function initAuth(props) {
14
14
  return betterAuth({
15
- advanced: { cookiePrefix: authCookiePrefix },
15
+ advanced: {
16
+ cookiePrefix: authCookiePrefix,
17
+ database: { generateId: () => false }
18
+ },
16
19
  database: drizzleAdapter(props.db, {
17
20
  provider: "pg",
18
21
  usePlural: true
@@ -1 +1 @@
1
- {"version":3,"file":"init.mjs","names":["ForgetPasswordEmail"],"sources":["../../../../src/modules/auth/handler/init.ts"],"sourcesContent":["import ForgetPasswordEmail from \"@/components/emails/forget-password-email\";\nimport { url } from \"@/lib/utils/url\";\nimport { TDatabaseSchema } from \"@/modules/config/entry\";\nimport { DatabaseClient, EmailClient } from \"@/modules/config/entry.server\";\nimport { TulipConfig } from \"@/modules/config/lib/config\";\nimport { passkey } from \"@better-auth/passkey\";\nimport { drizzleAdapter } from \"better-auth/adapters/drizzle\";\nimport { betterAuth } from \"better-auth/minimal\";\nimport { nextCookies } from \"better-auth/next-js\";\nimport { admin, createAuthMiddleware, emailOTP } from \"better-auth/plugins\";\nimport { eq } from \"drizzle-orm\";\nimport { users } from \"../entry\";\nimport { createAccessControl, Role } from \"../lib/permissions\";\n\nexport const authCookiePrefix = \"tulip\";\n\ntype InitAuthProps<TSchema extends TDatabaseSchema> = {\n db: DatabaseClient<TSchema>;\n email: EmailClient;\n config: TulipConfig;\n ac: ReturnType<typeof createAccessControl>;\n roles: {\n [key in string]?: Role;\n };\n};\n\nexport function initAuth<TSchema extends TDatabaseSchema>(props: InitAuthProps<TSchema>) {\n return betterAuth({\n advanced: {\n cookiePrefix: authCookiePrefix,\n },\n database: drizzleAdapter(props.db, {\n provider: \"pg\",\n // schema: props.schema,\n usePlural: true,\n }),\n emailAndPassword: {\n enabled: true,\n },\n user: {\n changeEmail: {\n enabled: true,\n },\n additionalFields: {\n firstName: {\n type: \"string\",\n required: true,\n input: true,\n },\n lastName: {\n type: \"string\",\n required: true,\n input: true,\n },\n },\n },\n hooks: {\n after: createAuthMiddleware(async (ctx) => {\n if (!ctx.path.startsWith(\"/sign-up\")) return;\n\n const session = ctx.context.newSession;\n if (!session) return;\n\n const existingUsers = await props.db.select().from(users);\n\n if (existingUsers.length === 1) {\n await props.db\n .update(users)\n .set({ role: \"developer\" })\n .where(eq(users.id, session.user.id));\n }\n }),\n },\n plugins: [\n nextCookies(),\n passkey(),\n admin({\n roles: props.roles,\n ac: props.ac,\n adminRoles: [\"admin\", \"developer\"],\n }),\n emailOTP({\n sendVerificationOTP: async ({ email, otp, type }) => {\n /**\n * Send a forget password mail\n */\n if (type === \"forget-password\") {\n const searchParams = new URLSearchParams();\n searchParams.set(\"email\", email);\n searchParams.set(\"otp\", otp);\n\n const resetPasswordHref = url(`/auth/reset-password?${searchParams.toString()}`);\n\n const result = await props.email.emails.send({\n from: props.config.email.defaultFrom,\n to: email,\n subject: \"Wachtwoord herstellen\",\n react: ForgetPasswordEmail({ resetPasswordHref }),\n });\n if (result.error) throw new Error(result.error.message);\n }\n },\n }),\n ],\n });\n}\n\nexport type AuthClient = ReturnType<typeof initAuth>;\n"],"mappings":";;;;;;;;;;;AAcA,MAAa,mBAAmB;AAYhC,SAAgB,SAA0C,OAA+B;AACvF,QAAO,WAAW;EAChB,UAAU,EACR,cAAc,kBACf;EACD,UAAU,eAAe,MAAM,IAAI;GACjC,UAAU;GAEV,WAAW;GACZ,CAAC;EACF,kBAAkB,EAChB,SAAS,MACV;EACD,MAAM;GACJ,aAAa,EACX,SAAS,MACV;GACD,kBAAkB;IAChB,WAAW;KACT,MAAM;KACN,UAAU;KACV,OAAO;KACR;IACD,UAAU;KACR,MAAM;KACN,UAAU;KACV,OAAO;KACR;IACF;GACF;EACD,OAAO,EACL,OAAO,qBAAqB,OAAO,QAAQ;AACzC,OAAI,CAAC,IAAI,KAAK,WAAW,WAAW,CAAE;GAEtC,MAAM,UAAU,IAAI,QAAQ;AAC5B,OAAI,CAAC,QAAS;AAId,QAFsB,MAAM,MAAM,GAAG,QAAQ,CAAC,KAAK,MAAM,EAEvC,WAAW,EAC3B,OAAM,MAAM,GACT,OAAO,MAAM,CACb,IAAI,EAAE,MAAM,aAAa,CAAC,CAC1B,MAAM,GAAG,MAAM,IAAI,QAAQ,KAAK,GAAG,CAAC;IAEzC,EACH;EACD,SAAS;GACP,aAAa;GACb,SAAS;GACT,MAAM;IACJ,OAAO,MAAM;IACb,IAAI,MAAM;IACV,YAAY,CAAC,SAAS,YAAY;IACnC,CAAC;GACF,SAAS,EACP,qBAAqB,OAAO,EAAE,OAAO,KAAK,WAAW;;;;AAInD,QAAI,SAAS,mBAAmB;KAC9B,MAAM,eAAe,IAAI,iBAAiB;AAC1C,kBAAa,IAAI,SAAS,MAAM;AAChC,kBAAa,IAAI,OAAO,IAAI;KAE5B,MAAM,oBAAoB,IAAI,wBAAwB,aAAa,UAAU,GAAG;KAEhF,MAAM,SAAS,MAAM,MAAM,MAAM,OAAO,KAAK;MAC3C,MAAM,MAAM,OAAO,MAAM;MACzB,IAAI;MACJ,SAAS;MACT,OAAOA,8BAAoB,EAAE,mBAAmB,CAAC;MAClD,CAAC;AACF,SAAI,OAAO,MAAO,OAAM,IAAI,MAAM,OAAO,MAAM,QAAQ;;MAG5D,CAAC;GACH;EACF,CAAC"}
1
+ {"version":3,"file":"init.mjs","names":["ForgetPasswordEmail"],"sources":["../../../../src/modules/auth/handler/init.ts"],"sourcesContent":["import ForgetPasswordEmail from \"@/components/emails/forget-password-email\";\nimport { url } from \"@/lib/utils/url\";\nimport { TDatabaseSchema } from \"@/modules/config/entry\";\nimport { DatabaseClient, EmailClient } from \"@/modules/config/entry.server\";\nimport { TulipConfig } from \"@/modules/config/lib/config\";\nimport { passkey } from \"@better-auth/passkey\";\nimport { drizzleAdapter } from \"better-auth/adapters/drizzle\";\nimport { betterAuth } from \"better-auth/minimal\";\nimport { nextCookies } from \"better-auth/next-js\";\nimport { admin, createAuthMiddleware, emailOTP } from \"better-auth/plugins\";\nimport { eq } from \"drizzle-orm\";\nimport { users } from \"../entry\";\nimport { createAccessControl, Role } from \"../lib/permissions\";\n\nexport const authCookiePrefix = \"tulip\";\n\ntype InitAuthProps<TSchema extends TDatabaseSchema> = {\n db: DatabaseClient<TSchema>;\n email: EmailClient;\n config: TulipConfig;\n ac: ReturnType<typeof createAccessControl>;\n roles: {\n [key in string]?: Role;\n };\n};\n\nexport function initAuth<TSchema extends TDatabaseSchema>(props: InitAuthProps<TSchema>) {\n return betterAuth({\n advanced: {\n cookiePrefix: authCookiePrefix,\n database: {\n generateId: () => false,\n },\n },\n database: drizzleAdapter(props.db, {\n provider: \"pg\",\n usePlural: true,\n // schema: props.schema,\n }),\n emailAndPassword: {\n enabled: true,\n },\n user: {\n changeEmail: {\n enabled: true,\n },\n additionalFields: {\n firstName: {\n type: \"string\",\n required: true,\n input: true,\n },\n lastName: {\n type: \"string\",\n required: true,\n input: true,\n },\n },\n },\n hooks: {\n after: createAuthMiddleware(async (ctx) => {\n if (!ctx.path.startsWith(\"/sign-up\")) return;\n\n const session = ctx.context.newSession;\n if (!session) return;\n\n const existingUsers = await props.db.select().from(users);\n\n if (existingUsers.length === 1) {\n await props.db\n .update(users)\n .set({ role: \"developer\" })\n .where(eq(users.id, session.user.id));\n }\n }),\n },\n plugins: [\n nextCookies(),\n passkey(),\n admin({\n roles: props.roles,\n ac: props.ac,\n adminRoles: [\"admin\", \"developer\"],\n }),\n emailOTP({\n sendVerificationOTP: async ({ email, otp, type }) => {\n /**\n * Send a forget password mail\n */\n if (type === \"forget-password\") {\n const searchParams = new URLSearchParams();\n searchParams.set(\"email\", email);\n searchParams.set(\"otp\", otp);\n\n const resetPasswordHref = url(`/auth/reset-password?${searchParams.toString()}`);\n\n const result = await props.email.emails.send({\n from: props.config.email.defaultFrom,\n to: email,\n subject: \"Wachtwoord herstellen\",\n react: ForgetPasswordEmail({ resetPasswordHref }),\n });\n if (result.error) throw new Error(result.error.message);\n }\n },\n }),\n ],\n });\n}\n\nexport type AuthClient = ReturnType<typeof initAuth>;\n"],"mappings":";;;;;;;;;;;AAcA,MAAa,mBAAmB;AAYhC,SAAgB,SAA0C,OAA+B;AACvF,QAAO,WAAW;EAChB,UAAU;GACR,cAAc;GACd,UAAU,EACR,kBAAkB,OACnB;GACF;EACD,UAAU,eAAe,MAAM,IAAI;GACjC,UAAU;GACV,WAAW;GAEZ,CAAC;EACF,kBAAkB,EAChB,SAAS,MACV;EACD,MAAM;GACJ,aAAa,EACX,SAAS,MACV;GACD,kBAAkB;IAChB,WAAW;KACT,MAAM;KACN,UAAU;KACV,OAAO;KACR;IACD,UAAU;KACR,MAAM;KACN,UAAU;KACV,OAAO;KACR;IACF;GACF;EACD,OAAO,EACL,OAAO,qBAAqB,OAAO,QAAQ;AACzC,OAAI,CAAC,IAAI,KAAK,WAAW,WAAW,CAAE;GAEtC,MAAM,UAAU,IAAI,QAAQ;AAC5B,OAAI,CAAC,QAAS;AAId,QAFsB,MAAM,MAAM,GAAG,QAAQ,CAAC,KAAK,MAAM,EAEvC,WAAW,EAC3B,OAAM,MAAM,GACT,OAAO,MAAM,CACb,IAAI,EAAE,MAAM,aAAa,CAAC,CAC1B,MAAM,GAAG,MAAM,IAAI,QAAQ,KAAK,GAAG,CAAC;IAEzC,EACH;EACD,SAAS;GACP,aAAa;GACb,SAAS;GACT,MAAM;IACJ,OAAO,MAAM;IACb,IAAI,MAAM;IACV,YAAY,CAAC,SAAS,YAAY;IACnC,CAAC;GACF,SAAS,EACP,qBAAqB,OAAO,EAAE,OAAO,KAAK,WAAW;;;;AAInD,QAAI,SAAS,mBAAmB;KAC9B,MAAM,eAAe,IAAI,iBAAiB;AAC1C,kBAAa,IAAI,SAAS,MAAM;AAChC,kBAAa,IAAI,OAAO,IAAI;KAE5B,MAAM,oBAAoB,IAAI,wBAAwB,aAAa,UAAU,GAAG;KAEhF,MAAM,SAAS,MAAM,MAAM,MAAM,OAAO,KAAK;MAC3C,MAAM,MAAM,OAAO,MAAM;MACzB,IAAI;MACJ,SAAS;MACT,OAAOA,8BAAoB,EAAE,mBAAmB,CAAC;MAClD,CAAC;AACF,SAAI,OAAO,MAAO,OAAM,IAAI,MAAM,OAAO,MAAM,QAAQ;;MAG5D,CAAC;GACH;EACF,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { Permission } from "../lib/permissions.mjs";
2
- import * as _tanstack_react_query0 from "@tanstack/react-query";
2
+ import * as _tanstack_react_query4 from "@tanstack/react-query";
3
3
 
4
4
  //#region src/modules/auth/hooks/use-permission.d.ts
5
5
  /**
@@ -7,7 +7,7 @@ import * as _tanstack_react_query0 from "@tanstack/react-query";
7
7
  */
8
8
  declare function usePermission(permission?: Permission): {
9
9
  data: null;
10
- errors: _tanstack_react_query0.UseSuspenseQueryResult<{
10
+ errors: _tanstack_react_query4.UseSuspenseQueryResult<{
11
11
  permission: Permission;
12
12
  success: boolean;
13
13
  }, Error>[];
@@ -1 +1 @@
1
- {"version":3,"file":"use-permission.d.mts","names":[],"sources":["../../../../src/modules/auth/hooks/use-permission.ts"],"sourcesContent":[],"mappings":";;;;;;;AAWgB,iBAAA,aAAA,CAAa,UAAA,CAAA,EAAc,UAAd,CAAA,EAAA;EAAc,IAAA,EAAA,IAAA"}
1
+ {"version":3,"file":"use-permission.d.mts","names":[],"sources":["../../../../src/modules/auth/hooks/use-permission.ts"],"sourcesContent":[],"mappings":";;;;;;;AAUgB,iBAAA,aAAA,CAAa,UAAA,CAAA,EAAc,UAAd,CAAA,EAAA;EAAc,IAAA,EAAA,IAAA"}
@@ -15,6 +15,10 @@ function usePermission(permission) {
15
15
  queryKey: ["permission", permission$1],
16
16
  queryFn: async () => {
17
17
  const userId = sessionQuery.data?.user.id;
18
+ if (!userId) return {
19
+ permission: permission$1,
20
+ success: false
21
+ };
18
22
  const { data, error } = await authClient.admin.hasPermission({
19
23
  permission: permission$1,
20
24
  userId
@@ -27,7 +31,8 @@ function usePermission(permission) {
27
31
  permission: permission$1,
28
32
  success: data.success
29
33
  };
30
- }
34
+ },
35
+ staleTime: 300 * 1e3
31
36
  })),
32
37
  combine: (results) => {
33
38
  const errors = results.filter(({ error }) => error);
@@ -38,7 +43,7 @@ function usePermission(permission) {
38
43
  const values = results.map(({ data }) => data);
39
44
  return {
40
45
  data: {
41
- success: results.every(({ data }) => data.success),
46
+ success: results.every(({ data }) => data?.success),
42
47
  values
43
48
  },
44
49
  errors: null
@@ -1 +1 @@
1
- {"version":3,"file":"use-permission.mjs","names":["permission"],"sources":["../../../../src/modules/auth/hooks/use-permission.ts"],"sourcesContent":["\"use client\";\n\nimport { useSuspenseQueries } from \"@tanstack/react-query\";\nimport { LiteralString } from \"better-auth\";\nimport { authClient } from \"../handler/client.client\";\nimport { type Permission } from \"../lib/permissions\";\nimport { useSession } from \"./use-session\";\n\n/**\n * UsePermission\n */\nexport function usePermission(permission?: Permission) {\n const sessionQuery = useSession();\n\n const keys = Object.entries(permission ?? {}).flatMap(([resource, permissions]) =>\n permissions.map((permission) => ({ [resource]: [permission] }) as Permission),\n );\n\n return useSuspenseQueries({\n queries: keys.map((permission) => ({\n queryKey: [\"permission\", permission],\n queryFn: async () => {\n const userId = sessionQuery.data?.user.id;\n\n const { data, error } = await authClient.admin.hasPermission({ permission, userId });\n if (error) {\n console.error(error);\n throw error;\n }\n\n return {\n permission,\n success: data.success,\n };\n },\n })),\n combine: (results) => {\n const errors = results.filter(({ error }) => error);\n if (errors.length) return { data: null, errors };\n\n const values = results.map(({ data }) => data);\n const success = results.every(({ data }) => data.success);\n\n return { data: { success, values }, errors: null };\n },\n });\n}\n"],"mappings":";;;;;;;;;;AAWA,SAAgB,cAAc,YAAyB;CACrD,MAAM,eAAe,YAAY;AAMjC,QAAO,mBAAmB;EACxB,SALW,OAAO,QAAQ,cAAc,EAAE,CAAC,CAAC,SAAS,CAAC,UAAU,iBAChE,YAAY,KAAK,kBAAgB,GAAG,WAAW,CAACA,aAAW,EAAE,EAAgB,CAC9E,CAGe,KAAK,kBAAgB;GACjC,UAAU,CAAC,cAAcA,aAAW;GACpC,SAAS,YAAY;IACnB,MAAM,SAAS,aAAa,MAAM,KAAK;IAEvC,MAAM,EAAE,MAAM,UAAU,MAAM,WAAW,MAAM,cAAc;KAAE;KAAY;KAAQ,CAAC;AACpF,QAAI,OAAO;AACT,aAAQ,MAAM,MAAM;AACpB,WAAM;;AAGR,WAAO;KACL;KACA,SAAS,KAAK;KACf;;GAEJ,EAAE;EACH,UAAU,YAAY;GACpB,MAAM,SAAS,QAAQ,QAAQ,EAAE,YAAY,MAAM;AACnD,OAAI,OAAO,OAAQ,QAAO;IAAE,MAAM;IAAM;IAAQ;GAEhD,MAAM,SAAS,QAAQ,KAAK,EAAE,WAAW,KAAK;AAG9C,UAAO;IAAE,MAAM;KAAE,SAFD,QAAQ,OAAO,EAAE,WAAW,KAAK,QAAQ;KAE/B;KAAQ;IAAE,QAAQ;IAAM;;EAErD,CAAC"}
1
+ {"version":3,"file":"use-permission.mjs","names":["permission"],"sources":["../../../../src/modules/auth/hooks/use-permission.ts"],"sourcesContent":["\"use client\";\n\nimport { useSuspenseQueries } from \"@tanstack/react-query\";\nimport { authClient } from \"../handler/client.client\";\nimport { type Permission } from \"../lib/permissions\";\nimport { useSession } from \"./use-session\";\n\n/**\n * UsePermission\n */\nexport function usePermission(permission?: Permission) {\n const sessionQuery = useSession();\n\n const keys = Object.entries(permission ?? {}).flatMap(([resource, permissions]) =>\n permissions.map((permission) => ({ [resource]: [permission] }) as Permission),\n );\n\n return useSuspenseQueries({\n queries: keys.map((permission) => ({\n queryKey: [\"permission\", permission],\n queryFn: async () => {\n const userId = sessionQuery.data?.user.id;\n if (!userId) return { permission, success: false };\n\n const { data, error } = await authClient.admin.hasPermission({ permission, userId });\n if (error) {\n console.error(error);\n throw error;\n }\n\n return {\n permission,\n success: data.success,\n };\n },\n staleTime: 5 * 60 * 1000, // 5 minutes\n })),\n combine: (results) => {\n const errors = results.filter(({ error }) => error);\n if (errors.length) return { data: null, errors };\n\n const values = results.map(({ data }) => data);\n const success = results.every(({ data }) => data?.success);\n\n return { data: { success, values }, errors: null };\n },\n });\n}\n"],"mappings":";;;;;;;;;;AAUA,SAAgB,cAAc,YAAyB;CACrD,MAAM,eAAe,YAAY;AAMjC,QAAO,mBAAmB;EACxB,SALW,OAAO,QAAQ,cAAc,EAAE,CAAC,CAAC,SAAS,CAAC,UAAU,iBAChE,YAAY,KAAK,kBAAgB,GAAG,WAAW,CAACA,aAAW,EAAE,EAAgB,CAC9E,CAGe,KAAK,kBAAgB;GACjC,UAAU,CAAC,cAAcA,aAAW;GACpC,SAAS,YAAY;IACnB,MAAM,SAAS,aAAa,MAAM,KAAK;AACvC,QAAI,CAAC,OAAQ,QAAO;KAAE;KAAY,SAAS;KAAO;IAElD,MAAM,EAAE,MAAM,UAAU,MAAM,WAAW,MAAM,cAAc;KAAE;KAAY;KAAQ,CAAC;AACpF,QAAI,OAAO;AACT,aAAQ,MAAM,MAAM;AACpB,WAAM;;AAGR,WAAO;KACL;KACA,SAAS,KAAK;KACf;;GAEH,WAAW,MAAS;GACrB,EAAE;EACH,UAAU,YAAY;GACpB,MAAM,SAAS,QAAQ,QAAQ,EAAE,YAAY,MAAM;AACnD,OAAI,OAAO,OAAQ,QAAO;IAAE,MAAM;IAAM;IAAQ;GAEhD,MAAM,SAAS,QAAQ,KAAK,EAAE,WAAW,KAAK;AAG9C,UAAO;IAAE,MAAM;KAAE,SAFD,QAAQ,OAAO,EAAE,WAAW,MAAM,QAAQ;KAEhC;KAAQ;IAAE,QAAQ;IAAM;;EAErD,CAAC"}
@@ -1,7 +1,123 @@
1
- import * as _tanstack_react_query1 from "@tanstack/react-query";
1
+ import * as _tanstack_react_query0 from "@tanstack/react-query";
2
2
 
3
3
  //#region src/modules/auth/hooks/use-session.d.ts
4
- declare function useSession(): _tanstack_react_query1.UseSuspenseQueryResult<{
4
+ declare const sessionQueryOptions: _tanstack_react_query0.OmitKeyof<_tanstack_react_query0.UseQueryOptions<{
5
+ user: {
6
+ id: string;
7
+ createdAt: Date;
8
+ updatedAt: Date;
9
+ email: string;
10
+ emailVerified: boolean;
11
+ name: string;
12
+ image?: string | null | undefined;
13
+ banned: boolean | null | undefined;
14
+ role?: string | null | undefined;
15
+ banReason?: string | null | undefined;
16
+ banExpires?: Date | null | undefined;
17
+ firstName: string;
18
+ lastName: string;
19
+ };
20
+ session: {
21
+ id: string;
22
+ createdAt: Date;
23
+ updatedAt: Date;
24
+ userId: string;
25
+ expiresAt: Date;
26
+ token: string;
27
+ ipAddress?: string | null | undefined;
28
+ userAgent?: string | null | undefined;
29
+ impersonatedBy?: string | null | undefined;
30
+ };
31
+ } | null, Error, {
32
+ user: {
33
+ id: string;
34
+ createdAt: Date;
35
+ updatedAt: Date;
36
+ email: string;
37
+ emailVerified: boolean;
38
+ name: string;
39
+ image?: string | null | undefined;
40
+ banned: boolean | null | undefined;
41
+ role?: string | null | undefined;
42
+ banReason?: string | null | undefined;
43
+ banExpires?: Date | null | undefined;
44
+ firstName: string;
45
+ lastName: string;
46
+ };
47
+ session: {
48
+ id: string;
49
+ createdAt: Date;
50
+ updatedAt: Date;
51
+ userId: string;
52
+ expiresAt: Date;
53
+ token: string;
54
+ ipAddress?: string | null | undefined;
55
+ userAgent?: string | null | undefined;
56
+ impersonatedBy?: string | null | undefined;
57
+ };
58
+ } | null, string[]>, "queryFn"> & {
59
+ queryFn?: _tanstack_react_query0.QueryFunction<{
60
+ user: {
61
+ id: string;
62
+ createdAt: Date;
63
+ updatedAt: Date;
64
+ email: string;
65
+ emailVerified: boolean;
66
+ name: string;
67
+ image?: string | null | undefined;
68
+ banned: boolean | null | undefined;
69
+ role?: string | null | undefined;
70
+ banReason?: string | null | undefined;
71
+ banExpires?: Date | null | undefined;
72
+ firstName: string;
73
+ lastName: string;
74
+ };
75
+ session: {
76
+ id: string;
77
+ createdAt: Date;
78
+ updatedAt: Date;
79
+ userId: string;
80
+ expiresAt: Date;
81
+ token: string;
82
+ ipAddress?: string | null | undefined;
83
+ userAgent?: string | null | undefined;
84
+ impersonatedBy?: string | null | undefined;
85
+ };
86
+ } | null, string[], never> | undefined;
87
+ } & {
88
+ queryKey: string[] & {
89
+ [dataTagSymbol]: {
90
+ user: {
91
+ id: string;
92
+ createdAt: Date;
93
+ updatedAt: Date;
94
+ email: string;
95
+ emailVerified: boolean;
96
+ name: string;
97
+ image?: string | null | undefined;
98
+ banned: boolean | null | undefined;
99
+ role?: string | null | undefined;
100
+ banReason?: string | null | undefined;
101
+ banExpires?: Date | null | undefined;
102
+ firstName: string;
103
+ lastName: string;
104
+ };
105
+ session: {
106
+ id: string;
107
+ createdAt: Date;
108
+ updatedAt: Date;
109
+ userId: string;
110
+ expiresAt: Date;
111
+ token: string;
112
+ ipAddress?: string | null | undefined;
113
+ userAgent?: string | null | undefined;
114
+ impersonatedBy?: string | null | undefined;
115
+ };
116
+ } | null;
117
+ [dataTagErrorSymbol]: Error;
118
+ };
119
+ };
120
+ declare function useSession(): _tanstack_react_query0.UseSuspenseQueryResult<{
5
121
  user: {
6
122
  id: string;
7
123
  createdAt: Date;
@@ -30,5 +146,5 @@ declare function useSession(): _tanstack_react_query1.UseSuspenseQueryResult<{
30
146
  };
31
147
  } | null, Error>;
32
148
  //#endregion
33
- export { useSession };
149
+ export { sessionQueryOptions, useSession };
34
150
  //# sourceMappingURL=use-session.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-session.d.mts","names":[],"sources":["../../../../src/modules/auth/hooks/use-session.ts"],"sourcesContent":[],"mappings":";;;iBAKgB,UAAA,CAAA,0BAAU;;;IAAV,SAAU,MAAA;;;;;;;;sBAAA,GAAA,IAAA,GAAA,SAAA;IAAA,UAAA,CAAA,MAAA,GAAA,IAAA,GAAA,SAAA"}
1
+ {"version":3,"file":"use-session.d.mts","names":[],"sources":["../../../../src/modules/auth/hooks/use-session.ts"],"sourcesContent":[],"mappings":";;;cAKa,qBAAmB,sBAAA,CAAA,iCAAA;;;IAAnB,SAAA,MAAA;;;;;;;;;;;;;;;IAAmB,SAAA,MAAA;;;;;;;;;;;;;;;;;;IAehB,MAAA,EAAA,OAAU,GAAA,IAAA,GAAA,SAAA;;;;;;;;;IAAA,SAAA,MAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAV,UAAA,CAAA,0BAAU"}
@@ -1,20 +1,25 @@
1
1
  "use client";
2
2
 
3
3
  import { authClient } from "../handler/client.client.mjs";
4
- import { useSuspenseQuery } from "@tanstack/react-query";
4
+ import { queryOptions, useSuspenseQuery } from "@tanstack/react-query";
5
5
 
6
6
  //#region src/modules/auth/hooks/use-session.ts
7
- function useSession() {
8
- return useSuspenseQuery({
9
- queryKey: ["session"],
10
- queryFn: async () => {
11
- const session = await authClient.getSession();
12
- if (session.error) throw session.error;
13
- return session.data;
7
+ const sessionQueryOptions = queryOptions({
8
+ queryKey: ["session"],
9
+ queryFn: async () => {
10
+ const session = await authClient.getSession();
11
+ if (session.error) {
12
+ console.error(session.error);
13
+ return null;
14
14
  }
15
- });
15
+ return session.data;
16
+ },
17
+ staleTime: 1e3 * 60 * 60
18
+ });
19
+ function useSession() {
20
+ return useSuspenseQuery(sessionQueryOptions);
16
21
  }
17
22
 
18
23
  //#endregion
19
- export { useSession };
24
+ export { sessionQueryOptions, useSession };
20
25
  //# sourceMappingURL=use-session.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-session.mjs","names":[],"sources":["../../../../src/modules/auth/hooks/use-session.ts"],"sourcesContent":["\"use client\";\n\nimport { useSuspenseQuery } from \"@tanstack/react-query\";\nimport { authClient } from \"../entry.client\";\n\nexport function useSession() {\n const session = useSuspenseQuery({\n queryKey: [\"session\"],\n queryFn: async () => {\n const session = await authClient.getSession();\n if (session.error) throw session.error;\n\n return session.data;\n },\n });\n\n return session;\n}\n"],"mappings":";;;;;;AAKA,SAAgB,aAAa;AAW3B,QAVgB,iBAAiB;EAC/B,UAAU,CAAC,UAAU;EACrB,SAAS,YAAY;GACnB,MAAM,UAAU,MAAM,WAAW,YAAY;AAC7C,OAAI,QAAQ,MAAO,OAAM,QAAQ;AAEjC,UAAO,QAAQ;;EAElB,CAAC"}
1
+ {"version":3,"file":"use-session.mjs","names":[],"sources":["../../../../src/modules/auth/hooks/use-session.ts"],"sourcesContent":["\"use client\";\n\nimport { queryOptions, useSuspenseQuery } from \"@tanstack/react-query\";\nimport { authClient } from \"../entry.client\";\n\nexport const sessionQueryOptions = queryOptions({\n queryKey: [\"session\"],\n queryFn: async () => {\n const session = await authClient.getSession();\n\n if (session.error) {\n console.error(session.error);\n return null;\n }\n\n return session.data;\n },\n staleTime: 1000 * 60 * 60,\n});\n\nexport function useSession() {\n const session = useSuspenseQuery(sessionQueryOptions);\n return session;\n}\n"],"mappings":";;;;;;AAKA,MAAa,sBAAsB,aAAa;CAC9C,UAAU,CAAC,UAAU;CACrB,SAAS,YAAY;EACnB,MAAM,UAAU,MAAM,WAAW,YAAY;AAE7C,MAAI,QAAQ,OAAO;AACjB,WAAQ,MAAM,QAAQ,MAAM;AAC5B,UAAO;;AAGT,SAAO,QAAQ;;CAEjB,WAAW,MAAO,KAAK;CACxB,CAAC;AAEF,SAAgB,aAAa;AAE3B,QADgB,iBAAiB,oBAAoB"}
@@ -3,7 +3,7 @@ import { TDatabaseSchema } from "../../config/db/types.mjs";
3
3
  import { TulipContext } from "../../config/lib/context.mjs";
4
4
  import "../../../config.mjs";
5
5
  import "server-cli-only";
6
- import * as better_auth_plugins22 from "better-auth/plugins";
6
+ import * as better_auth_plugins0 from "better-auth/plugins";
7
7
 
8
8
  //#region src/modules/auth/lib/helpers.server.d.ts
9
9
  /**
@@ -52,7 +52,7 @@ declare function createUser<TSchema extends TDatabaseSchema>({
52
52
  }: {
53
53
  body: CreateUserSchema;
54
54
  }): Promise<{
55
- user: better_auth_plugins22.UserWithRole;
55
+ user: better_auth_plugins0.UserWithRole;
56
56
  }>;
57
57
  /**
58
58
  * Update a user
@@ -66,19 +66,19 @@ declare function updateUser<TSchema extends TDatabaseSchema>({
66
66
  userId: string;
67
67
  body: Partial<UpdateUserSchema>;
68
68
  }): Promise<{
69
- id: string;
70
69
  name: string;
71
70
  firstName: string;
72
71
  lastName: string;
73
72
  email: string;
74
73
  emailVerified: boolean;
75
74
  image: string | null;
76
- createdAt: Date;
77
- updatedAt: Date;
78
75
  role: string | null;
79
76
  banned: boolean | null;
80
77
  banReason: string | null;
81
78
  banExpires: Date | null;
79
+ id: string;
80
+ createdAt: Date;
81
+ updatedAt: Date;
82
82
  }>;
83
83
  //#endregion
84
84
  export { createUser, getSession, updateUser };
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.server.d.mts","names":[],"sources":["../../../../src/modules/auth/lib/helpers.server.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;iBAasB,2BAA2B;;GAE9C,KAAK,aAAa,oBAAiB;EAFhB,OAAA,EAAA;IAA2B,EAAA,EAAA,MAAA;IAC/C,SAAA,MAAA;IACmB,SAAA,MAAA;IAAb,MAAA,EAAA,MAAA;IAAL,SAAA,MAAA;;;;;;;IAAmC,EAAA,EAAA,MAAA;IAAA,SAAA,MAAA;IAOtB,SAAU,MAAA;IAAiB,KAAA,EAAA,MAAA;IACvC,aAAA,EAAA,OAAA;IAAM,IAAA,EAAA,MAAA;IAAwB,KAAA,CAAA,EAAA,MAAA,GAAA,IAAA,GAAA,SAAA,GAAA,SAAA;IAAb,SAAA,EAAA,MAAA;IAAmC,QAAA,EAAA,MAAA;IACpD,MAAA,EAAA,OAAA,GAAA,IAAA,GAAA,SAAA;IAAgB,IAAA,CAAA,EAAA,MAAA,GAAA,IAAA,GAAA,SAAA;IAAgB,SAAA,CAAA,EAA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A;;;;AACZ,iBArBM,UAqBN,CAAA,gBArBiC,eAqBjC,CAAA,CAAA;EAAA,IAAA;EAAA;CAAA,EApBW,YAoBX,CApBwB,OAoBxB,CAAA,GAAA;EACN,OAAA,EArBoD,OAqBpD;CAAQ,EAAA;EAAA;CAAA,EAAA;EAAwC,IAAA,EApBhC,gBAoBgC;CAAR,CAAA,EApBN,OAoBM,CAAA;QApBR,oBAAA,CAAA;;;;;iBAkBd,2BAA2B;;GACvC,aAAa;;;;;QACqB,QAAQ;IAAmB"}
@@ -36,7 +36,7 @@ declare const createUserSchema: z$1.ZodObject<{
36
36
  firstName: z$1.ZodString;
37
37
  lastName: z$1.ZodString;
38
38
  password: z$1.ZodString;
39
- role: z$1.ZodDefault<z$1.ZodString>;
39
+ role: z$1.ZodString;
40
40
  }, z$1.core.$strip>;
41
41
  type CreateUserSchema = z$1.infer<typeof createUserSchema>;
42
42
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"validators.d.mts","names":[],"sources":["../../../../src/modules/auth/lib/validators.ts"],"sourcesContent":[],"mappings":";;;;;;;AAQA;AAKa,KALD,IAAA,GAcV,OAdwB,KAAA,CAAM,YAc9B;;;;AATsB,cAAX,WAAW,EAAA,GAAA,CAAA,SAAA,CAAA;EAAA,KAAA,cAAA;EAcX,QAAA,eAAA;;;;;AAAmB,cAAnB,mBAAmB,EAAA,GAAA,CAAA,SAAA,CAAA;EAmBnB,QAAA,eAAA;;;;;AAUb;cAVa,sBAAoB,GAAA,CAAA;;;;;;cAUpB,kBAAgB,GAAA,CAAA;;;;;;EAAA,IAAA,gBAAA,cAAA,CAAA;CAAA,iBAAA,CAAA;AAajB,KAAA,gBAAA,GAAmB,GAAA,CAAE,KAAa,CAAA,OAAA,gBAAb,CAAA;AAKjC;;;cAAa,kBAAgB,GAAA,CAAA;;;;EAAA,KAAA,eAAA;CAAA,EAAA;EAOjB,GAAA,EAAA,CAAA,CAAA;EAKC,EAAA,EAAA,CAAA,CAAA;;KALD,gBAAA,GAAmB,GAAA,CAAE,aAAa;;;AAS9C;cAJa,sBAAoB,GAAA,CAAA;;;KAIrB,oBAAA,GAAuB,GAAA,CAAE,aAAa"}
1
+ {"version":3,"file":"validators.d.mts","names":[],"sources":["../../../../src/modules/auth/lib/validators.ts"],"sourcesContent":[],"mappings":";;;;;;;AAQA;AAKa,KALD,IAAA,GAcV,OAdwB,KAAA,CAAM,YAc9B;;;;AATsB,cAAX,WAAW,EAAA,GAAA,CAAA,SAAA,CAAA;EAAA,KAAA,cAAA;EAcX,QAAA,eAAA;;;;;AAAmB,cAAnB,mBAAmB,EAAA,GAAA,CAAA,SAAA,CAAA;EAmBnB,QAAA,eAAA;;;;;AAUb;cAVa,sBAAoB,GAAA,CAAA;;;;;;cAUpB,kBAAgB,GAAA,CAAA;;;;;EAAA,QAAA,eAAA;EAAA,IAAA,eAAA;AAa7B,CAAA,iBAAY,CAAA;AAKC,KALD,gBAAA,GAAmB,GAAA,CAAE,KAU/B,CAAA,OAV4C,gBAU5C,CAAA;;;;cALW,kBAAgB,GAAA,CAAA;;;EAAA,QAAA,eAAA;EAAA,KAAA,eAAA;AAO7B,CAAA,EAAA;EAKa,GAAA,EAAA,CAAA,CAAA;;;AAAoB,KALrB,gBAAA,GAAmB,GAAA,CAAE,KAKA,CAAA,OALa,gBAKb,CAAA;;AAIjC;;cAJa,sBAAoB,GAAA,CAAA;;;KAIrB,oBAAA,GAAuB,GAAA,CAAE,aAAa"}
@@ -35,7 +35,7 @@ const createUserSchema = userSchema.pick({
35
35
  firstName: z$1.string().min(2, { message: "Voornaam moet langer zijn dan 2 karakters" }).max(50, { message: "Voornaam mag niet langer zijn dan 50 karakters" }),
36
36
  lastName: z$1.string().min(2, { message: "Achternaam moet langer zijn dan 2 karakters" }).max(50, { message: "Achternaam mag niet langer zijn dan 50 karakters" }),
37
37
  password: z$1.string().min(6, { message: "Wachtwoord moet minimaal 6 karakters hebben" }),
38
- role: z$1.string().default("user")
38
+ role: z$1.string()
39
39
  });
40
40
  /**
41
41
  * Update user schema
@@ -1 +1 @@
1
- {"version":3,"file":"validators.mjs","names":["z"],"sources":["../../../../src/modules/auth/lib/validators.ts"],"sourcesContent":["import { userSchema } from \"better-auth/db\";\nimport { createInsertSchema } from \"drizzle-zod\";\nimport { z } from \"zod\";\nimport { users } from \"../db/schema\";\n\n/**\n * User type\n */\nexport type User = typeof users.$inferSelect;\n\n/**\n * Login schema\n */\nexport const loginSchema = z.object({\n email: z\n .email({ message: \"Email moet een geldig email adres zijn\" })\n .min(2, { message: \"Email moet langer zijn dan 2 karakters\" })\n .max(50, { message: \"Email mag niet langer zijn dan 50 karakters\" }),\n password: z\n .string()\n .min(2, { message: \"Wachtwoord moet langer zijn dan 2 karakters\" })\n .max(50, { message: \"Wachtwoord mag niet langer zijn dan 50 karakters\" }),\n});\n\n/**\n * Reset password schema\n */\nexport const resetPasswordSchema = z\n .object({\n password: z\n .string()\n .min(2, { message: \"Wachtwoord moet langer zijn dan 2 karakters\" })\n .max(50, { message: \"Wachtwoord mag niet langer zijn dan 50 karakters\" }),\n passwordConfirmation: z\n .string()\n .min(2, { message: \"Wachtwoord moet langer zijn dan 2 karakters\" })\n .max(50, { message: \"Wachtwoord mag niet langer zijn dan 50 karakters\" }),\n })\n .refine((data) => data.password === data.passwordConfirmation, {\n message: \"Wachtwoorden komen niet overeen\",\n path: [\"passwordConfirmation\"],\n });\n\n/**\n * Forgot password schema\n */\nexport const forgotPasswordSchema = z.object({\n email: z\n .email({ error: \"Email moet een geldig email adres zijn\" })\n .min(2, { message: \"Email moet langer zijn dan 2 karakters\" })\n .max(50, { message: \"Email mag niet langer zijn dan 50 karakters\" }),\n});\n\n/**\n * Create user schema\n */\nexport const createUserSchema = userSchema.pick({ email: true, image: true }).extend({\n firstName: z\n .string()\n .min(2, { message: \"Voornaam moet langer zijn dan 2 karakters\" })\n .max(50, { message: \"Voornaam mag niet langer zijn dan 50 karakters\" }),\n lastName: z\n .string()\n .min(2, { message: \"Achternaam moet langer zijn dan 2 karakters\" })\n .max(50, { message: \"Achternaam mag niet langer zijn dan 50 karakters\" }),\n password: z.string().min(6, { message: \"Wachtwoord moet minimaal 6 karakters hebben\" }),\n role: z.string().default(\"user\"),\n});\n\nexport type CreateUserSchema = z.infer<typeof createUserSchema>;\n\n/**\n * Update user schema\n */\nexport const updateUserSchema = createInsertSchema(users).pick({\n firstName: true,\n lastName: true,\n email: true,\n image: true,\n});\n\nexport type UpdateUserSchema = z.infer<typeof updateUserSchema>;\n\n/**\n * Update password input validation\n */\nexport const updatePasswordSchema = z.object({\n password: z.string().min(6, { message: \"Wachtwoord moet minimaal 6 karakters hebben\" }),\n});\n\nexport type UpdatePasswordSchema = z.infer<typeof updatePasswordSchema>;\n"],"mappings":";;;;;;;;;AAaA,MAAa,cAAcA,IAAE,OAAO;CAClC,OAAOA,IACJ,MAAM,EAAE,SAAS,0CAA0C,CAAC,CAC5D,IAAI,GAAG,EAAE,SAAS,0CAA0C,CAAC,CAC7D,IAAI,IAAI,EAAE,SAAS,+CAA+C,CAAC;CACtE,UAAUA,IACP,QAAQ,CACR,IAAI,GAAG,EAAE,SAAS,+CAA+C,CAAC,CAClE,IAAI,IAAI,EAAE,SAAS,oDAAoD,CAAC;CAC5E,CAAC;;;;AAKF,MAAa,sBAAsBA,IAChC,OAAO;CACN,UAAUA,IACP,QAAQ,CACR,IAAI,GAAG,EAAE,SAAS,+CAA+C,CAAC,CAClE,IAAI,IAAI,EAAE,SAAS,oDAAoD,CAAC;CAC3E,sBAAsBA,IACnB,QAAQ,CACR,IAAI,GAAG,EAAE,SAAS,+CAA+C,CAAC,CAClE,IAAI,IAAI,EAAE,SAAS,oDAAoD,CAAC;CAC5E,CAAC,CACD,QAAQ,SAAS,KAAK,aAAa,KAAK,sBAAsB;CAC7D,SAAS;CACT,MAAM,CAAC,uBAAuB;CAC/B,CAAC;;;;AAKJ,MAAa,uBAAuBA,IAAE,OAAO,EAC3C,OAAOA,IACJ,MAAM,EAAE,OAAO,0CAA0C,CAAC,CAC1D,IAAI,GAAG,EAAE,SAAS,0CAA0C,CAAC,CAC7D,IAAI,IAAI,EAAE,SAAS,+CAA+C,CAAC,EACvE,CAAC;;;;AAKF,MAAa,mBAAmB,WAAW,KAAK;CAAE,OAAO;CAAM,OAAO;CAAM,CAAC,CAAC,OAAO;CACnF,WAAWA,IACR,QAAQ,CACR,IAAI,GAAG,EAAE,SAAS,6CAA6C,CAAC,CAChE,IAAI,IAAI,EAAE,SAAS,kDAAkD,CAAC;CACzE,UAAUA,IACP,QAAQ,CACR,IAAI,GAAG,EAAE,SAAS,+CAA+C,CAAC,CAClE,IAAI,IAAI,EAAE,SAAS,oDAAoD,CAAC;CAC3E,UAAUA,IAAE,QAAQ,CAAC,IAAI,GAAG,EAAE,SAAS,+CAA+C,CAAC;CACvF,MAAMA,IAAE,QAAQ,CAAC,QAAQ,OAAO;CACjC,CAAC;;;;AAOF,MAAa,mBAAmB,mBAAmB,MAAM,CAAC,KAAK;CAC7D,WAAW;CACX,UAAU;CACV,OAAO;CACP,OAAO;CACR,CAAC;;;;AAOF,MAAa,uBAAuBA,IAAE,OAAO,EAC3C,UAAUA,IAAE,QAAQ,CAAC,IAAI,GAAG,EAAE,SAAS,+CAA+C,CAAC,EACxF,CAAC"}
1
+ {"version":3,"file":"validators.mjs","names":["z"],"sources":["../../../../src/modules/auth/lib/validators.ts"],"sourcesContent":["import { userSchema } from \"better-auth/db\";\nimport { createInsertSchema } from \"drizzle-zod\";\nimport { z } from \"zod\";\nimport { users } from \"../db/schema\";\n\n/**\n * User type\n */\nexport type User = typeof users.$inferSelect;\n\n/**\n * Login schema\n */\nexport const loginSchema = z.object({\n email: z\n .email({ message: \"Email moet een geldig email adres zijn\" })\n .min(2, { message: \"Email moet langer zijn dan 2 karakters\" })\n .max(50, { message: \"Email mag niet langer zijn dan 50 karakters\" }),\n password: z\n .string()\n .min(2, { message: \"Wachtwoord moet langer zijn dan 2 karakters\" })\n .max(50, { message: \"Wachtwoord mag niet langer zijn dan 50 karakters\" }),\n});\n\n/**\n * Reset password schema\n */\nexport const resetPasswordSchema = z\n .object({\n password: z\n .string()\n .min(2, { message: \"Wachtwoord moet langer zijn dan 2 karakters\" })\n .max(50, { message: \"Wachtwoord mag niet langer zijn dan 50 karakters\" }),\n passwordConfirmation: z\n .string()\n .min(2, { message: \"Wachtwoord moet langer zijn dan 2 karakters\" })\n .max(50, { message: \"Wachtwoord mag niet langer zijn dan 50 karakters\" }),\n })\n .refine((data) => data.password === data.passwordConfirmation, {\n message: \"Wachtwoorden komen niet overeen\",\n path: [\"passwordConfirmation\"],\n });\n\n/**\n * Forgot password schema\n */\nexport const forgotPasswordSchema = z.object({\n email: z\n .email({ error: \"Email moet een geldig email adres zijn\" })\n .min(2, { message: \"Email moet langer zijn dan 2 karakters\" })\n .max(50, { message: \"Email mag niet langer zijn dan 50 karakters\" }),\n});\n\n/**\n * Create user schema\n */\nexport const createUserSchema = userSchema.pick({ email: true, image: true }).extend({\n firstName: z\n .string()\n .min(2, { message: \"Voornaam moet langer zijn dan 2 karakters\" })\n .max(50, { message: \"Voornaam mag niet langer zijn dan 50 karakters\" }),\n lastName: z\n .string()\n .min(2, { message: \"Achternaam moet langer zijn dan 2 karakters\" })\n .max(50, { message: \"Achternaam mag niet langer zijn dan 50 karakters\" }),\n password: z.string().min(6, { message: \"Wachtwoord moet minimaal 6 karakters hebben\" }),\n role: z.string(),\n});\n\nexport type CreateUserSchema = z.infer<typeof createUserSchema>;\n\n/**\n * Update user schema\n */\nexport const updateUserSchema = createInsertSchema(users).pick({\n firstName: true,\n lastName: true,\n email: true,\n image: true,\n});\n\nexport type UpdateUserSchema = z.infer<typeof updateUserSchema>;\n\n/**\n * Update password input validation\n */\nexport const updatePasswordSchema = z.object({\n password: z.string().min(6, { message: \"Wachtwoord moet minimaal 6 karakters hebben\" }),\n});\n\nexport type UpdatePasswordSchema = z.infer<typeof updatePasswordSchema>;\n"],"mappings":";;;;;;;;;AAaA,MAAa,cAAcA,IAAE,OAA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MAAMA,IAAE,QAAQ;CACjB,CAAC;;;;AAOF,MAAa,mBAAmB,mBAAmB,MAAM,CAAC,KAAK;CAC7D,WAAW;CACX,UAAU;CACV,OAAO;CACP,OAAO;CACR,CAAC;;;;AAOF,MAAa,uBAAuBA,IAAE,OAAO,EAC3C,UAAUA,IAAE,QAAQ,CAAC,IAAI,GAAG,EAAE,SAAS,+CAA+C,CAAC,EACxF,CAAC"}
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime51 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
2
2
  import React from "react";
3
3
  import { DefaultError, MutationOptions } from "@tanstack/react-query";
4
4
  import { Keys } from "react-hotkeys-hook";
@@ -11,7 +11,7 @@ import { AlertDialogCancelProps, AlertDialogContentProps, AlertDialogProps } fro
11
11
  declare function CommandAlertDialog({
12
12
  children,
13
13
  ...props
14
- }: AlertDialogProps): react_jsx_runtime51.JSX.Element;
14
+ }: AlertDialogProps): react_jsx_runtime0.JSX.Element;
15
15
  /**
16
16
  * CommandAlertDialogTrigger
17
17
  */
@@ -28,49 +28,49 @@ declare function CommandAlertDialogTrigger({
28
28
  children,
29
29
  disabled,
30
30
  ...props
31
- }: CommandAlertDialogTriggerProps): react_jsx_runtime51.JSX.Element | undefined;
31
+ }: CommandAlertDialogTriggerProps): react_jsx_runtime0.JSX.Element | undefined;
32
32
  /**
33
33
  * CommandAlertDialogContent
34
34
  */
35
35
  declare function CommandAlertDialogContent({
36
36
  children,
37
37
  ...props
38
- }: AlertDialogContentProps): react_jsx_runtime51.JSX.Element;
38
+ }: AlertDialogContentProps): react_jsx_runtime0.JSX.Element;
39
39
  /**
40
40
  * CommandAlertDialogHeader
41
41
  */
42
42
  declare function CommandAlertDialogHeader({
43
43
  children,
44
44
  ...props
45
- }: React.HTMLAttributes<HTMLElement>): react_jsx_runtime51.JSX.Element;
45
+ }: React.HTMLAttributes<HTMLElement>): react_jsx_runtime0.JSX.Element;
46
46
  /**
47
47
  * CommandAlertDialogTitle
48
48
  */
49
49
  declare function CommandAlertDialogTitle({
50
50
  children,
51
51
  ...props
52
- }: React.HTMLAttributes<HTMLElement>): react_jsx_runtime51.JSX.Element;
52
+ }: React.HTMLAttributes<HTMLElement>): react_jsx_runtime0.JSX.Element;
53
53
  /**
54
54
  * CommandAlertDialogDescription
55
55
  */
56
56
  declare function CommandAlertDialogDescription({
57
57
  children,
58
58
  ...props
59
- }: React.HTMLAttributes<HTMLElement>): react_jsx_runtime51.JSX.Element;
59
+ }: React.HTMLAttributes<HTMLElement>): react_jsx_runtime0.JSX.Element;
60
60
  /**
61
61
  * CommandAlertDialogFooter
62
62
  */
63
63
  declare function CommandAlertDialogFooter({
64
64
  children,
65
65
  ...props
66
- }: React.HTMLAttributes<HTMLElement>): react_jsx_runtime51.JSX.Element;
66
+ }: React.HTMLAttributes<HTMLElement>): react_jsx_runtime0.JSX.Element;
67
67
  /**
68
68
  * CommandAlertDialogCancel
69
69
  */
70
70
  declare function CommandAlertDialogCancel({
71
71
  children,
72
72
  ...props
73
- }: AlertDialogCancelProps): react_jsx_runtime51.JSX.Element;
73
+ }: AlertDialogCancelProps): react_jsx_runtime0.JSX.Element;
74
74
  /**
75
75
  * CommandAlertDialogAction
76
76
  */
@@ -87,7 +87,7 @@ declare function CommandAlertDialogAction<TData = unknown, TError = DefaultError
87
87
  children,
88
88
  disabled,
89
89
  ...props
90
- }: CommandAlertDialogActionProps<TData, TError, TVariables, TOnMutateResult>): react_jsx_runtime51.JSX.Element;
90
+ }: CommandAlertDialogActionProps<TData, TError, TVariables, TOnMutateResult>): react_jsx_runtime0.JSX.Element;
91
91
  //#endregion
92
92
  export { CommandAlertDialog, CommandAlertDialogAction, CommandAlertDialogCancel, CommandAlertDialogContent, CommandAlertDialogDescription, CommandAlertDialogFooter, CommandAlertDialogHeader, CommandAlertDialogTitle, CommandAlertDialogTrigger };
93
93
  //# sourceMappingURL=alert-dialog-command.client.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"alert-dialog-command.client.d.mts","names":[],"sources":["../../../../src/modules/commands/components/alert-dialog-command.client.tsx"],"sourcesContent":[],"mappings":";;;;;;;;;;AA2CgB,iBAAA,kBAAA,CAAkB;EAAA,QAAA;EAAA,GAAA;AAAA,CAAA,EAAyB,gBAAzB,CAAA,EAAyC,mBAAA,CAAA,GAAA,CAAA,OAAzC;;;;KAe7B,8BAAA,GAfsE;EAetE,QAAA,EACO,KAAA,CAAM,SADb;EAQW,SAAA,CAAA,EAAA,MAAA;EACd,KAAA,CAAA,EAAA,MAAA;EACA,MAAA,CAAA,EANS,IAMT;EACA,QAAA,CAAA,EAAA,OAAA;CACA;AAEC,iBANa,yBAAA,CAMb;EAAA,KAAA;EAAA,MAAA;EAAA,QAAA;EAAA,QAAA;EAAA,GAAA;AAAA,CAAA,EAAA,8BAAA,CAAA,EAA8B,mBAAA,CAAA,GAAA,CAAA,OAAA,GAA9B,SAAA;;;AAgEH;AAA4C,iBAA5B,yBAAA,CAA4B;EAAA,QAAA;EAAA,GAAA;AAAA,CAAA,EAAsB,uBAAtB,CAAA,EAA6C,mBAAA,CAAA,GAAA,CAAA,OAA7C;;;;AAO5B,iBAAA,wBAAA,CAAwB;EAAA,QAAA;EAAA,GAAA;AAAA,CAAA,EAGrC,KAAA,CAAM,cAH+B,CAGhB,WAHgB,CAAA,CAAA,EAGJ,mBAAA,CAAA,GAAA,CAAA,OAHI;;;;AAGJ,iBAOpB,uBAAA,CAPoB;EAAA,QAAA;EAAA,GAAA;AAAA,CAAA,EAO4B,KAAA,CAAM,cAPlC,CAOiD,WAPjD,CAAA,CAAA,EAO6D,mBAAA,CAAA,GAAA,CAAA,OAP7D;;AAOpC;;AAAqF,iBAOrE,6BAAA,CAPqE;EAAA,QAAA;EAAA,GAAA;AAAA,CAAA,EAUlF,KAAA,CAAM,cAV4E,CAU7D,WAV6D,CAAA,CAAA,EAUjD,mBAAA,CAAA,GAAA,CAAA,OAViD;;;;AAOrE,iBAUA,wBAAA,CAV6B;EAAA,QAAA;EAAA,GAAA;AAAA,CAAA,EAa1C,KAAA,CAAM,cAboC,CAarB,WAbqB,CAAA,CAAA,EAaT,mBAAA,CAAA,GAAA,CAAA,OAbS;;;;AAGT,iBAiBpB,wBAAA,CAjBoB;EAAA,QAAA;EAAA,GAAA;AAAA,CAAA,EAiB6B,sBAjB7B,CAAA,EAiBmD,mBAAA,CAAA,GAAA,CAAA,OAjBnD;;AAOpC;;KAiBK,6BAdmB,CAAA,QAAA,OAAA,EAAA,SAgBb,YAhBa,EAAA,aAAA,SAAA,EAAA,kBAAA,OAAA,CAAA,GAAA;EAArB,SAAM,EAoBI,UApBJ;EAA2B,QAAA,EAqBxB,eArBwB,CAqBR,KArBQ,EAqBD,MArBC,EAqBO,UArBP,EAqBmB,eArBnB,CAAA;EAAA,QAAA,EAsBxB,KAAA,CAAM,SAtBkB;EAOpB,SAAA,CAAA,EAAA,MAAA;EAA2B,QAAA,CAAA,EAAA,OAAA;CAAsB;AAAsB,iBAoBvE,wBApBuE,CAAA,QAAA,OAAA,EAAA,SAsB5E,YAtB4E,EAAA,aAAA,SAAA,EAAA,kBAAA,OAAA,CAAA,CAAA;EAAA,SAAA;EAAA,QAAA;EAAA,QAAA;EAAA,QAAA;EAAA,GAAA;AAAA,CAAA,EA+BpF,6BA/BoF,CA+BtD,KA/BsD,EA+B/C,MA/B+C,EA+BvC,UA/BuC,EA+B3B,eA/B2B,CAAA,CAAA,EA+BX,mBAAA,CAAA,GAAA,CAAA,OA/BW"}
1
+ {"version":3,"file":"alert-dialog-command.client.d.mts","names":[],"sources":["../../../../src/modules/commands/components/alert-dialog-command.client.tsx"],"sourcesContent":[],"mappings":";;;;;;;;;;AA2CgB,iBAAA,kBAAA,CAAkB;EAAA,QAAA;EAAA,GAAA;AAAA,CAAA,EAAyB,gBAAzB,CAAA,EAAyC,kBAAA,CAAA,GAAA,CAAA,OAAzC;;;;KAe7B,8BAAA,GAfsE;EAetE,QAAA,EACO,KAAA,CAAM,SADb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mB,CAAA,QAAA,OAAA,EAAA,SAgBb,YAhBa,EAAA,aAAA,SAAA,EAAA,kBAAA,OAAA,CAAA,GAAA;EAArB,SAAM,EAoBI,UApBJ;EAA2B,QAAA,EAqBxB,eArBwB,CAqBR,KArBQ,EAqBD,MArBC,EAqBO,UArBP,EAqBmB,eArBnB,CAAA;EAAA,QAAA,EAsBxB,KAAA,CAAM,SAtBkB;EAOpB,SAAA,CAAA,EAAA,MAAA;EAA2B,QAAA,CAAA,EAAA,OAAA;CAAsB;AAAsB,iBAoBvE,wBApBuE,CAAA,QAAA,OAAA,EAAA,SAsB5E,YAtB4E,EAAA,aAAA,SAAA,EAAA,kBAAA,OAAA,CAAA,CAAA;EAAA,SAAA;EAAA,QAAA;EAAA,QAAA;EAAA,QAAA;EAAA,GAAA;AAAA,CAAA,EA+BpF,6BA/BoF,CA+BtD,KA/BsD,EA+B/C,MA/B+C,EA+BvC,UA/BuC,EA+B3B,eA/B2B,CAAA,CAAA,EA+BX,kBAAA,CAAA,GAAA,CAAA,OA/BW"}
@@ -7,7 +7,7 @@ import { ContextMenuItem } from "../../../components/ui/context-menu.mjs";
7
7
  import { DropdownMenuItem } from "../../../components/ui/dropdown-menu.mjs";
8
8
  import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger } from "../../../components/ui/alert-dialog.mjs";
9
9
  import { useCommand } from "../hooks/context.client.mjs";
10
- import { useCommandAction2 } from "../hooks/use-command-action.client.mjs";
10
+ import { useCommandMutation } from "../hooks/use-command-mutation.client.mjs";
11
11
  import { CommandTrigger } from "./command-trigger.client.mjs";
12
12
  import { jsx, jsxs } from "react/jsx-runtime";
13
13
  import React from "react";
@@ -138,7 +138,7 @@ function CommandAlertDialogCancel({ children, ...props }) {
138
138
  function CommandAlertDialogAction({ variables, mutation, children, disabled, ...props }) {
139
139
  const { setOpen } = React.useContext(CommandAlertDialogContext);
140
140
  const { status } = useCommand();
141
- const { mutateAsync } = useCommandAction2({
141
+ const { mutateAsync } = useCommandMutation({
142
142
  ...mutation,
143
143
  onSuccess: async (...params) => {
144
144
  setOpen(false);
@@ -1 +1 @@
1
- {"version":3,"file":"alert-dialog-command.client.mjs","names":[],"sources":["../../../../src/modules/commands/components/alert-dialog-command.client.tsx"],"sourcesContent":["\"use client\";\n\nimport { Icons } from \"@/components/common/icons\";\nimport {\n AlertDialog,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogContent,\n AlertDialogDescription,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogTitle,\n AlertDialogTrigger,\n} from \"@/components/ui/alert-dialog\";\nimport { buttonVariants } from \"@/components/ui/button\";\nimport { ContextMenuItem } from \"@/components/ui/context-menu\";\nimport { DropdownMenuItem } from \"@/components/ui/dropdown-menu\";\nimport { cn } from \"@/lib/utils/cn\";\nimport {\n AlertDialogCancelProps,\n AlertDialogContentProps,\n AlertDialogProps,\n} from \"@radix-ui/react-alert-dialog\";\nimport { DefaultError, MutationOptions } from \"@tanstack/react-query\";\nimport React from \"react\";\nimport { Keys, useHotkeys } from \"react-hotkeys-hook\";\nimport { useCommand } from \"../hooks/context.client\";\nimport { useCommandAction2 } from \"../hooks/use-command-action.client\";\nimport { CommandTrigger } from \"./command-trigger.client\";\n\n/**\n * CommandAlertDialogContext\n */\ntype CommandAlertDialogContextValue = {\n open: boolean;\n setOpen: React.Dispatch<React.SetStateAction<boolean>>;\n};\n\nconst CommandAlertDialogContext = React.createContext({} as CommandAlertDialogContextValue);\n\n/**\n * CommandAlertDialog\n */\nexport function CommandAlertDialog({ children, ...props }: AlertDialogProps) {\n const [open, setOpen] = React.useState(false);\n\n return (\n <AlertDialog {...props} open={open} onOpenChange={setOpen}>\n <CommandAlertDialogContext.Provider value={{ open, setOpen }}>\n {children}\n </CommandAlertDialogContext.Provider>\n </AlertDialog>\n );\n}\n\n/**\n * CommandAlertDialogTrigger\n */\ntype CommandAlertDialogTriggerProps = {\n children: React.ReactNode;\n className?: string;\n label?: string;\n hotkey?: Keys;\n disabled?: boolean;\n};\n\nexport function CommandAlertDialogTrigger({\n label,\n hotkey,\n children,\n disabled,\n ...props\n}: CommandAlertDialogTriggerProps) {\n const { menu, status } = useCommand();\n const { setOpen } = React.useContext(CommandAlertDialogContext);\n\n const isDisabled = disabled || status === \"pending\";\n\n useHotkeys(hotkey ?? \"\", () => setOpen(true), { enabled: !isDisabled && hotkey !== undefined });\n\n if (menu === \"inline\" || menu === \"table\") {\n return (\n <CommandTrigger label={label}>\n <AlertDialogTrigger\n {...props}\n disabled={isDisabled}\n className={cn(buttonVariants({ variant: \"outline\", size: \"sm\" }), props.className)}\n >\n {children}\n </AlertDialogTrigger>\n </CommandTrigger>\n );\n }\n\n if (menu === \"dropdown\") {\n return (\n <CommandTrigger label={label}>\n <AlertDialogTrigger asChild>\n <DropdownMenuItem\n {...props}\n disabled={isDisabled}\n onClick={(e) => {\n e.preventDefault();\n setOpen(true);\n }}\n >\n {children}\n </DropdownMenuItem>\n </AlertDialogTrigger>\n </CommandTrigger>\n );\n }\n\n if (menu === \"context\") {\n return (\n <CommandTrigger label={label}>\n <AlertDialogTrigger asChild>\n <ContextMenuItem\n {...props}\n disabled={isDisabled}\n onClick={(e) => {\n e.preventDefault();\n setOpen(true);\n }}\n >\n {children}\n </ContextMenuItem>\n </AlertDialogTrigger>\n </CommandTrigger>\n );\n }\n}\n\n/**\n * CommandAlertDialogContent\n */\nexport function CommandAlertDialogContent({ children, ...props }: AlertDialogContentProps) {\n return <AlertDialogContent {...props}>{children}</AlertDialogContent>;\n}\n\n/**\n * CommandAlertDialogHeader\n */\nexport function CommandAlertDialogHeader({\n children,\n ...props\n}: React.HTMLAttributes<HTMLElement>) {\n return <AlertDialogHeader {...props}>{children}</AlertDialogHeader>;\n}\n\n/**\n * CommandAlertDialogTitle\n */\nexport function CommandAlertDialogTitle({ children, ...props }: React.HTMLAttributes<HTMLElement>) {\n return <AlertDialogTitle {...props}>{children}</AlertDialogTitle>;\n}\n\n/**\n * CommandAlertDialogDescription\n */\nexport function CommandAlertDialogDescription({\n children,\n ...props\n}: React.HTMLAttributes<HTMLElement>) {\n return <AlertDialogDescription {...props}>{children}</AlertDialogDescription>;\n}\n\n/**\n * CommandAlertDialogFooter\n */\nexport function CommandAlertDialogFooter({\n children,\n ...props\n}: React.HTMLAttributes<HTMLElement>) {\n return <AlertDialogFooter {...props}>{children}</AlertDialogFooter>;\n}\n\n/**\n * CommandAlertDialogCancel\n */\nexport function CommandAlertDialogCancel({ children, ...props }: AlertDialogCancelProps) {\n return <AlertDialogCancel {...props}>{children}</AlertDialogCancel>;\n}\n\n/**\n * CommandAlertDialogAction\n */\ntype CommandAlertDialogActionProps<\n TData = unknown,\n TError = DefaultError,\n TVariables = undefined,\n TOnMutateResult = unknown,\n> = {\n variables: TVariables;\n mutation: MutationOptions<TData, TError, TVariables, TOnMutateResult>;\n children: React.ReactNode;\n className?: string;\n disabled?: boolean;\n};\n\nexport function CommandAlertDialogAction<\n TData = unknown,\n TError = DefaultError,\n TVariables = undefined,\n TOnMutateResult = unknown,\n>({\n variables,\n mutation,\n children,\n disabled,\n ...props\n}: CommandAlertDialogActionProps<TData, TError, TVariables, TOnMutateResult>) {\n const { setOpen } = React.useContext(CommandAlertDialogContext);\n const { status } = useCommand();\n\n const { mutateAsync } = useCommandAction2({\n ...mutation,\n onSuccess: async (...params) => {\n setOpen(false);\n\n return await mutation?.onSuccess?.(...params);\n },\n });\n\n const isDisabled = disabled || status === \"pending\";\n\n return (\n <AlertDialogAction {...props} disabled={isDisabled} onClick={() => mutateAsync(variables)}>\n {status === \"pending\" && <Icons.spinner className=\"mr-2 h-4 w-4 animate-spin\" />}\n {children}\n </AlertDialogAction>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAsCA,MAAM,4BAA4B,MAAM,cAAc,EAAE,CAAmC;;;;AAK3F,SAAgB,mBAAmB,EAAE,UAAU,GAAG,SAA2B;CAC3E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C;EAAiB,GAAI;EAAQ;GAA4B;;;;;AAMnE,SAAgB,8BAA8B,EAC5C,UACA,GAAG,SACiC;AACpC,QAAO,oBAAC;EAAuB,GAAI;EAAQ;GAAkC;;;;;AAM/E,SAAgB,yBAAyB,EACvC,UACA,GAAG,SACiC;AACpC,QAAO,oBAAC;EAAkB,GAAI;EAAQ;GAA6B;;;;;AAMrE,SAAgB,yBAAyB,EAAE,UAAU,GAAG,SAAiC;AACvF,QAAO,oBAAC;EAAkB,GAAI;EAAQ;GAA6B;;AAmBrE,SAAgB,yBAKd,EACA,WACA,UACA,UACA,UACA,GAAG,SACyE;CAC5E,MAAM,EAAE,YAAY,MAAM,WAAW,0BAA0B;CAC/D,MAAM,EAAE,WAAW,YAAY;CAE/B,MAAM,EAAE,gBAAgB,kBAAkB;EACxC,GAAG;EACH,WAAW,OAAO,GAAG,WAAW;AAC9B,WAAQ,MAAM;AAEd,UAAO,MAAM,UAAU,YAAY,GAAG,OAAO;;EAEhD,CAAC;CAEF,MAAM,aAAa,YAAY,WAAW;AAE1C,QACE,qBAAC;EAAkB,GAAI;EAAO,UAAU;EAAY,eAAe,YAAY,UAAU;aACtF,WAAW,aAAa,oBAAC,MAAM,WAAQ,WAAU,8BAA8B,EAC/E;GACiB"}
1
+ {"version":3,"file":"alert-dialog-command.client.mjs","names":[],"sources":["../../../../src/modules/commands/components/alert-dialog-command.client.tsx"],"sourcesContent":["\"use client\";\n\nimport { Icons } from \"@/components/common/icons\";\nimport {\n AlertDialog,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogContent,\n AlertDialogDescription,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogTitle,\n AlertDialogTrigger,\n} from \"@/components/ui/alert-dialog\";\nimport { buttonVariants } from \"@/components/ui/button\";\nimport { ContextMenuItem } from \"@/components/ui/context-menu\";\nimport { DropdownMenuItem } from \"@/components/ui/dropdown-menu\";\nimport { cn } from \"@/lib/utils/cn\";\nimport {\n AlertDialogCancelProps,\n AlertDialogContentProps,\n AlertDialogProps,\n} from \"@radix-ui/react-alert-dialog\";\nimport { DefaultError, MutationOptions } from \"@tanstack/react-query\";\nimport React from \"react\";\nimport { Keys, useHotkeys } from \"react-hotkeys-hook\";\nimport { useCommand } from \"../hooks/context.client\";\nimport { useCommandMutation } from \"../hooks/use-command-mutation.client\";\nimport { CommandTrigger } from \"./command-trigger.client\";\n\n/**\n * CommandAlertDialogContext\n */\ntype CommandAlertDialogContextValue = {\n open: boolean;\n setOpen: React.Dispatch<React.SetStateAction<boolean>>;\n};\n\nconst CommandAlertDialogContext = React.createContext({} as CommandAlertDialogContextValue);\n\n/**\n * CommandAlertDialog\n */\nexport function CommandAlertDialog({ children, ...props }: AlertDialogProps) {\n const [open, setOpen] = React.useState(false);\n\n return (\n <AlertDialog {...props} open={open} onOpenChange={setOpen}>\n <CommandAlertDialogContext.Provider value={{ open, setOpen }}>\n {children}\n </CommandAlertDialogContext.Provider>\n </AlertDialog>\n );\n}\n\n/**\n * CommandAlertDialogTrigger\n */\ntype CommandAlertDialogTriggerProps = {\n children: React.ReactNode;\n className?: string;\n label?: string;\n hotkey?: Keys;\n disabled?: boolean;\n};\n\nexport function CommandAlertDialogTrigger({\n label,\n hotkey,\n children,\n disabled,\n ...props\n}: CommandAlertDialogTriggerProps) {\n const { menu, status } = useCommand();\n const { setOpen } = React.useContext(CommandAlertDialogContext);\n\n const isDisabled = disabled || status === \"pending\";\n\n useHotkeys(hotkey ?? \"\", () => setOpen(true), { enabled: !isDisabled && hotkey !== undefined });\n\n if (menu === \"inline\" || menu === \"table\") {\n return (\n <CommandTrigger label={label}>\n <AlertDialogTrigger\n {...props}\n disabled={isDisabled}\n className={cn(buttonVariants({ variant: \"outline\", size: \"sm\" }), props.className)}\n >\n {children}\n </AlertDialogTrigger>\n </CommandTrigger>\n );\n }\n\n if (menu === \"dropdown\") {\n return (\n <CommandTrigger label={label}>\n <AlertDialogTrigger asChild>\n <DropdownMenuItem\n {...props}\n disabled={isDisabled}\n onClick={(e) => {\n e.preventDefault();\n setOpen(true);\n }}\n >\n {children}\n </DropdownMenuItem>\n </AlertDialogTrigger>\n </CommandTrigger>\n );\n }\n\n if (menu === \"context\") {\n return (\n <CommandTrigger label={label}>\n <AlertDialogTrigger asChild>\n <ContextMenuItem\n {...props}\n disabled={isDisabled}\n onClick={(e) => {\n e.preventDefault();\n setOpen(true);\n }}\n >\n {children}\n </ContextMenuItem>\n </AlertDialogTrigger>\n </CommandTrigger>\n );\n }\n}\n\n/**\n * CommandAlertDialogContent\n */\nexport function CommandAlertDialogContent({ children, ...props }: AlertDialogContentProps) {\n return <AlertDialogContent {...props}>{children}</AlertDialogContent>;\n}\n\n/**\n * CommandAlertDialogHeader\n */\nexport function CommandAlertDialogHeader({\n children,\n ...props\n}: React.HTMLAttributes<HTMLElement>) {\n return <AlertDialogHeader {...props}>{children}</AlertDialogHeader>;\n}\n\n/**\n * CommandAlertDialogTitle\n */\nexport function CommandAlertDialogTitle({ children, ...props }: React.HTMLAttributes<HTMLElement>) {\n return <AlertDialogTitle {...props}>{children}</AlertDialogTitle>;\n}\n\n/**\n * CommandAlertDialogDescription\n */\nexport function CommandAlertDialogDescription({\n children,\n ...props\n}: React.HTMLAttributes<HTMLElement>) {\n return <AlertDialogDescription {...props}>{children}</AlertDialogDescription>;\n}\n\n/**\n * CommandAlertDialogFooter\n */\nexport function CommandAlertDialogFooter({\n children,\n ...props\n}: React.HTMLAttributes<HTMLElement>) {\n return <AlertDialogFooter {...props}>{children}</AlertDialogFooter>;\n}\n\n/**\n * CommandAlertDialogCancel\n */\nexport function CommandAlertDialogCancel({ children, ...props }: AlertDialogCancelProps) {\n return <AlertDialogCancel {...props}>{children}</AlertDialogCancel>;\n}\n\n/**\n * CommandAlertDialogAction\n */\ntype CommandAlertDialogActionProps<\n TData = unknown,\n TError = DefaultError,\n TVariables = undefined,\n TOnMutateResult = unknown,\n> = {\n variables: TVariables;\n mutation: MutationOptions<TData, TError, TVariables, TOnMutateResult>;\n children: React.ReactNode;\n className?: string;\n disabled?: boolean;\n};\n\nexport function CommandAlertDialogAction<\n TData = unknown,\n TError = DefaultError,\n TVariables = undefined,\n TOnMutateResult = unknown,\n>({\n variables,\n mutation,\n children,\n disabled,\n ...props\n}: CommandAlertDialogActionProps<TData, TError, TVariables, TOnMutateResult>) {\n const { setOpen } = React.useContext(CommandAlertDialogContext);\n const { status } = useCommand();\n\n const { mutateAsync } = useCommandMutation({\n ...mutation,\n onSuccess: async (...params) => {\n setOpen(false);\n\n return await mutation?.onSuccess?.(...params);\n },\n });\n\n const isDisabled = disabled || status === \"pending\";\n\n return (\n <AlertDialogAction {...props} disabled={isDisabled} onClick={() => mutateAsync(variables)}>\n {status === \"pending\" && <Icons.spinner className=\"mr-2 h-4 w-4 animate-spin\" />}\n {children}\n </AlertDialogAction>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAsCA,MAAM,4BAA4B,MAAM,cAAc,EAAE,CAAmC;;;;AAK3F,SAAgB,mBAAmB,EAAE,UAAU,GAAG,SAA2B;CAC3E,MAAM,CAAC,MAAM,WAAW,MAAM,SAAS,MAAM;AAE7C,QACE,oBAAC;EAAY,GAAI;EAAa;EAAM,cAAc;YAChD,oBAAC,0BAA0B;GAAS,OAAO;IAAE;IAAM;IAAS;GACzD;IACkC;GACzB;;AAelB,SAAgB,0BAA0B,EACxC,OACA,QACA,UACA,UACA,GAAG,SAC8B;CACjC,MAAM,EAAE,MAAM,WAAW,YAAY;CACrC,MAAM,EAAE,YAAY,MAAM,WAAW,0BAA0B;CAE/D,MAAM,aAAa,YAAY,WAAW;AAE1C,YAAW,UAAU,UAAU,QAAQ,KAAK,EAAE,EAAE,SAAS,CAAC,cAAc,WAAW,QAAW,CAAC;AAE/F,KAAI,SAAS,YAAY,SAAS,QAChC,QACE,oBAAC;EAAsB;YACrB,oBAAC;GACC,GAAI;GACJ,UAAU;GACV,WAAW,GAAG,eAAe;IAAE,SAAS;IAAW,MAAM;IAAM,CAAC,EAAE,MA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U,YAAY,GAAG,OAAO;;EAEhD,CAAC;CAEF,MAAM,aAAa,YAAY,WAAW;AAE1C,QACE,qBAAC;EAAkB,GAAI;EAAO,UAAU;EAAY,eAAe,YAAY,UAAU;aACtF,WAAW,aAAa,oBAAC,MAAM,WAAQ,WAAU,8BAA8B,EAC/E;GACiB"}
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime60 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime8 from "react/jsx-runtime";
2
2
  import React from "react";
3
3
  import { DefaultError, MutationOptions } from "@tanstack/react-query";
4
4
  import { Keys } from "react-hotkeys-hook";
@@ -21,7 +21,7 @@ declare function CommandClick<TData = unknown, TError = DefaultError, TVariables
21
21
  hotkey,
22
22
  disabled,
23
23
  ...props
24
- }: CommandClickProps<TData, TError, TVariables, TOnMutateResult>): react_jsx_runtime60.JSX.Element | null;
24
+ }: CommandClickProps<TData, TError, TVariables, TOnMutateResult>): react_jsx_runtime8.JSX.Element | null;
25
25
  //#endregion
26
26
  export { CommandClick, CommandClickProps };
27
27
  //# sourceMappingURL=click-command.client.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"click-command.client.d.mts","names":[],"sources":["../../../../src/modules/commands/components/click-command.client.tsx"],"sourcesContent":[],"mappings":";;;;;;KAYY,4CAED;YAIC,KAAA,CAAM;;EANN,QAAA,CAAA,EAAA,OAAA;EAED,SAAA,EAOE,UAPF;EAIC,QAAM,EAIN,eAJM,CAIU,KAJV,EAIiB,MAJjB,EAIyB,UAJzB,EAIqC,eAJrC,CAAA;EAGL,KAAA,CAAA,EAAA,MAAA;EACe,MAAA,CAAA,EAEjB,IAFiB;CAAO;AAAQ,iBAK3B,YAL2B,CAAA,QAAA,OAAA,EAAA,SAOhC,YAPgC,EAAA,aAAA,SAAA,EAAA,kBAAA,OAAA,CAAA,CAAA;EAAA,QAAA;EAAA,SAAA;EAAA,QAAA;EAAA,KAAA;EAAA,MAAA;EAAA,QAAA;EAAA,GAAA;AAAA,CAAA,EAkBxC,iBAlBwC,CAkBtB,KAlBsB,EAkBf,MAlBe,EAkBP,UAlBO,EAkBK,eAlBL,CAAA,CAAA,EAkBqB,mBAAA,CAAA,GAAA,CAAA,OAAA,GAlBrB,IAAA"}
1
+ {"version":3,"file":"click-command.client.d.mts","names":[],"sources":["../../../../src/modules/commands/components/click-command.client.tsx"],"sourcesContent":[],"mappings":";;;;;;KAYY,4CAED;YAIC,KAAA,CAAM;;EANN,QAAA,CAAA,EAAA,OAAA;EAED,SAAA,EAOE,UAPF;EAIC,QAAM,EAIN,eAJM,CAIU,KAJV,EAIiB,MAJjB,EAIyB,UAJzB,EAIqC,eAJrC,CAAA;EAGL,KAAA,CAAA,EAAA,MAAA;EACe,MAAA,CAAA,EAEjB,IAFiB;CAAO;AAAQ,iBAK3B,YAL2B,CAAA,QAAA,OAAA,EAAA,SAOhC,YAPgC,EAAA,aAAA,SAAA,EAAA,kBAAA,OAAA,CAAA,CAAA;EAAA,QAAA;EAAA,SAAA;EAAA,QAAA;EAAA,KAAA;EAAA,MAAA;EAAA,QAAA;EAAA,GAAA;AAAA,CAAA,EAkBxC,iBAlBwC,CAkBtB,KAlBsB,EAkBf,MAlBe,EAkBP,UAlBO,EAkBK,eAlBL,CAAA,CAAA,EAkBqB,kBAAA,CAAA,GAAA,CAAA,OAAA,GAlBrB,IAAA"}
@@ -4,7 +4,7 @@ import { Button } from "../../../components/ui/button.mjs";
4
4
  import { ContextMenuItem } from "../../../components/ui/context-menu.mjs";
5
5
  import { DropdownMenuItem } from "../../../components/ui/dropdown-menu.mjs";
6
6
  import { useCommand } from "../hooks/context.client.mjs";
7
- import { useCommandAction2 } from "../hooks/use-command-action.client.mjs";
7
+ import { useCommandMutation } from "../hooks/use-command-mutation.client.mjs";
8
8
  import { CommandTrigger } from "./command-trigger.client.mjs";
9
9
  import { jsx } from "react/jsx-runtime";
10
10
  import React from "react";
@@ -13,7 +13,7 @@ import { useHotkeys } from "react-hotkeys-hook";
13
13
  //#region src/modules/commands/components/click-command.client.tsx
14
14
  function CommandClick({ children, variables, mutation, label, hotkey, disabled, ...props }) {
15
15
  const { menu, status } = useCommand();
16
- const { mutate } = useCommandAction2(mutation);
16
+ const { mutate } = useCommandMutation(mutation);
17
17
  const isDisabled = disabled || status === "pending";
18
18
  const handleClick = () => mutate(variables);
19
19
  useHotkeys(hotkey ?? "", () => handleClick(), { enabled: !isDisabled && hotkey !== void 0 });