@tulip-systems/core 0.5.16 → 0.6.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 (915) hide show
  1. package/dist/auth/server.d.mts +1 -1
  2. package/dist/auth/server.mjs +1 -1
  3. package/dist/components/client.d.mts +1 -1
  4. package/dist/components/client.mjs +1 -1
  5. package/dist/components/common/icons.d.mts +52 -52
  6. package/dist/components/common/icons.d.mts.map +1 -1
  7. package/dist/components/common/icons.mjs.map +1 -1
  8. package/dist/components/common/status.d.mts +3 -3
  9. package/dist/components/common/status.d.mts.map +1 -1
  10. package/dist/components/common/status.mjs.map +1 -1
  11. package/dist/components/editor/components/content.client.d.mts +2 -2
  12. package/dist/components/editor/components/content.client.d.mts.map +1 -1
  13. package/dist/components/editor/components/content.client.mjs.map +1 -1
  14. package/dist/components/editor/components/editor.client.d.mts +6 -6
  15. package/dist/components/editor/components/editor.client.d.mts.map +1 -1
  16. package/dist/components/editor/components/editor.client.mjs +2 -2
  17. package/dist/components/editor/components/editor.client.mjs.map +1 -1
  18. package/dist/components/editor/components/menu-nodes.client.mjs +2 -2
  19. package/dist/components/editor/components/menu-nodes.client.mjs.map +1 -1
  20. package/dist/components/editor/components/menu.client.d.mts +3 -3
  21. package/dist/components/editor/components/menu.client.d.mts.map +1 -1
  22. package/dist/components/editor/components/menu.client.mjs.map +1 -1
  23. package/dist/components/editor/extensions/file-handler/extension.d.mts.map +1 -1
  24. package/dist/components/editor/extensions/file-handler/extension.mjs.map +1 -1
  25. package/dist/components/editor/extensions/file-handler/strategy.d.mts.map +1 -1
  26. package/dist/components/editor/extensions/file-handler/strategy.mjs.map +1 -1
  27. package/dist/components/editor/extensions/file-handler/utils.mjs.map +1 -1
  28. package/dist/components/editor/extensions/image/extension.d.mts.map +1 -1
  29. package/dist/components/editor/extensions/image/extension.mjs.map +1 -1
  30. package/dist/components/editor/extensions/skeleton/renderer.mjs +1 -1
  31. package/dist/components/editor/extensions/skeleton/renderer.mjs.map +1 -1
  32. package/dist/components/editor/lib/constants.d.mts +27 -27
  33. package/dist/components/editor/lib/constants.d.mts.map +1 -1
  34. package/dist/components/editor/lib/extensions.d.mts +0 -1
  35. package/dist/components/editor/lib/extensions.d.mts.map +1 -1
  36. package/dist/components/editor/lib/extensions.mjs +6 -8
  37. package/dist/components/editor/lib/extensions.mjs.map +1 -1
  38. package/dist/components/editor/lib/helpers.d.mts +0 -1
  39. package/dist/components/editor/lib/helpers.d.mts.map +1 -1
  40. package/dist/components/editor/lib/helpers.mjs.map +1 -1
  41. package/dist/components/editor/lib/types.d.mts +0 -1
  42. package/dist/components/editor/lib/types.d.mts.map +1 -1
  43. package/dist/components/editor/lib/variants.mjs.map +1 -1
  44. package/dist/components/emails/forget-password-email.mjs +1 -2
  45. package/dist/components/emails/forget-password-email.mjs.map +1 -1
  46. package/dist/components/header/back-button.client.d.mts +2 -2
  47. package/dist/components/header/back-button.client.d.mts.map +1 -1
  48. package/dist/components/header/back-button.client.mjs.map +1 -1
  49. package/dist/components/header/bottom-bar.client.d.mts +3 -3
  50. package/dist/components/header/bottom-bar.client.d.mts.map +1 -1
  51. package/dist/components/header/bottom-bar.client.mjs.map +1 -1
  52. package/dist/components/header/breadcrumbs.client.d.mts +7 -7
  53. package/dist/components/header/breadcrumbs.client.d.mts.map +1 -1
  54. package/dist/components/header/breadcrumbs.client.mjs.map +1 -1
  55. package/dist/components/header/header.client.d.mts +2 -2
  56. package/dist/components/header/header.client.d.mts.map +1 -1
  57. package/dist/components/header/header.client.mjs.map +1 -1
  58. package/dist/components/header/indicator.client.mjs.map +1 -1
  59. package/dist/components/header/mobile-nav-switcher.client.d.mts +2 -2
  60. package/dist/components/header/mobile-nav-switcher.client.d.mts.map +1 -1
  61. package/dist/components/header/top-bar.client.d.mts +4 -4
  62. package/dist/components/header/top-bar.client.d.mts.map +1 -1
  63. package/dist/components/header/top-bar.client.mjs.map +1 -1
  64. package/dist/components/layouts/admin-content.client.d.mts +2 -2
  65. package/dist/components/layouts/admin-content.client.d.mts.map +1 -1
  66. package/dist/components/layouts/admin-content.client.mjs.map +1 -1
  67. package/dist/components/layouts/admin-error-pages.d.mts +4 -4
  68. package/dist/components/layouts/admin-error-pages.d.mts.map +1 -1
  69. package/dist/components/layouts/admin-error-pages.mjs.map +1 -1
  70. package/dist/components/layouts/admin-layout.d.mts +2 -2
  71. package/dist/components/layouts/admin-layout.d.mts.map +1 -1
  72. package/dist/components/layouts/admin-layout.mjs.map +1 -1
  73. package/dist/components/layouts/admin-loading.d.mts +2 -2
  74. package/dist/components/layouts/admin-loading.d.mts.map +1 -1
  75. package/dist/components/layouts/admin-loading.mjs.map +1 -1
  76. package/dist/components/layouts/empty-page.d.mts +4 -4
  77. package/dist/components/layouts/empty-page.d.mts.map +1 -1
  78. package/dist/components/layouts/empty-page.mjs.map +1 -1
  79. package/dist/components/layouts/error-page.d.mts +9 -9
  80. package/dist/components/layouts/error-page.d.mts.map +1 -1
  81. package/dist/components/layouts/error-page.mjs.map +1 -1
  82. package/dist/components/layouts/error-sections.d.mts +5 -5
  83. package/dist/components/layouts/error-sections.d.mts.map +1 -1
  84. package/dist/components/layouts/error-sections.mjs.map +1 -1
  85. package/dist/components/layouts/list-layout.d.mts +2 -2
  86. package/dist/components/layouts/list-layout.d.mts.map +1 -1
  87. package/dist/components/layouts/list-layout.mjs.map +1 -1
  88. package/dist/components/layouts/providers.client.d.mts +2 -2
  89. package/dist/components/layouts/providers.client.d.mts.map +1 -1
  90. package/dist/components/layouts/providers.client.mjs +1 -1
  91. package/dist/components/layouts/providers.client.mjs.map +1 -1
  92. package/dist/components/layouts/root-error-pages.d.mts +2 -2
  93. package/dist/components/layouts/root-error-pages.d.mts.map +1 -1
  94. package/dist/components/layouts/root-layout.server.d.mts +2 -2
  95. package/dist/components/layouts/root-layout.server.d.mts.map +1 -1
  96. package/dist/components/layouts/root-layout.server.mjs.map +1 -1
  97. package/dist/components/layouts/root-loading.d.mts +2 -2
  98. package/dist/components/layouts/root-loading.d.mts.map +1 -1
  99. package/dist/components/layouts/tab-layout.d.mts +2 -2
  100. package/dist/components/layouts/tab-layout.d.mts.map +1 -1
  101. package/dist/components/layouts/tab-layout.mjs +3 -3
  102. package/dist/components/layouts/tab-layout.mjs.map +1 -1
  103. package/dist/components/lists/data-list.d.mts +5 -5
  104. package/dist/components/lists/data-list.d.mts.map +1 -1
  105. package/dist/components/lists/data-list.mjs.map +1 -1
  106. package/dist/components/lists/data-stack.d.mts +8 -8
  107. package/dist/components/lists/data-stack.d.mts.map +1 -1
  108. package/dist/components/lists/data-stack.mjs.map +1 -1
  109. package/dist/components/navigation/admin-sidebar-header.client.mjs.map +1 -1
  110. package/dist/components/navigation/admin-sidebar-paths.client.d.mts +10 -10
  111. package/dist/components/navigation/admin-sidebar-paths.client.d.mts.map +1 -1
  112. package/dist/components/navigation/admin-sidebar-paths.client.mjs.map +1 -1
  113. package/dist/components/navigation/admin-sidebar-skeleton.mjs.map +1 -1
  114. package/dist/components/ui/accordion.d.mts +5 -5
  115. package/dist/components/ui/accordion.d.mts.map +1 -1
  116. package/dist/components/ui/accordion.mjs +0 -1
  117. package/dist/components/ui/accordion.mjs.map +1 -1
  118. package/dist/components/ui/alert-dialog.d.mts +12 -12
  119. package/dist/components/ui/alert-dialog.d.mts.map +1 -1
  120. package/dist/components/ui/alert-dialog.mjs +0 -1
  121. package/dist/components/ui/alert-dialog.mjs.map +1 -1
  122. package/dist/components/ui/alert.d.mts +4 -4
  123. package/dist/components/ui/alert.d.mts.map +1 -1
  124. package/dist/components/ui/alert.mjs +0 -1
  125. package/dist/components/ui/alert.mjs.map +1 -1
  126. package/dist/components/ui/aspect-ratio.d.mts +2 -2
  127. package/dist/components/ui/aspect-ratio.d.mts.map +1 -1
  128. package/dist/components/ui/avatar.client.d.mts +4 -4
  129. package/dist/components/ui/avatar.client.d.mts.map +1 -1
  130. package/dist/components/ui/avatar.client.mjs +0 -1
  131. package/dist/components/ui/avatar.client.mjs.map +1 -1
  132. package/dist/components/ui/badge.d.mts +3 -3
  133. package/dist/components/ui/badge.d.mts.map +1 -1
  134. package/dist/components/ui/badge.mjs +0 -1
  135. package/dist/components/ui/badge.mjs.map +1 -1
  136. package/dist/components/ui/breadcrumb.d.mts +8 -8
  137. package/dist/components/ui/breadcrumb.d.mts.map +1 -1
  138. package/dist/components/ui/breadcrumb.mjs +1 -2
  139. package/dist/components/ui/breadcrumb.mjs.map +1 -1
  140. package/dist/components/ui/button.d.mts +5 -5
  141. package/dist/components/ui/button.d.mts.map +1 -1
  142. package/dist/components/ui/button.mjs +0 -1
  143. package/dist/components/ui/button.mjs.map +1 -1
  144. package/dist/components/ui/calendar.d.mts +3 -3
  145. package/dist/components/ui/calendar.d.mts.map +1 -1
  146. package/dist/components/ui/calendar.mjs +12 -12
  147. package/dist/components/ui/calendar.mjs.map +1 -1
  148. package/dist/components/ui/card.d.mts +7 -7
  149. package/dist/components/ui/card.d.mts.map +1 -1
  150. package/dist/components/ui/card.mjs +0 -1
  151. package/dist/components/ui/card.mjs.map +1 -1
  152. package/dist/components/ui/carousel.d.mts +6 -6
  153. package/dist/components/ui/carousel.d.mts.map +1 -1
  154. package/dist/components/ui/carousel.mjs +4 -4
  155. package/dist/components/ui/carousel.mjs.map +1 -1
  156. package/dist/components/ui/chart.client.d.mts +5 -5
  157. package/dist/components/ui/chart.client.d.mts.map +1 -1
  158. package/dist/components/ui/chart.client.mjs +6 -6
  159. package/dist/components/ui/chart.client.mjs.map +1 -1
  160. package/dist/components/ui/checkbox.d.mts +2 -2
  161. package/dist/components/ui/checkbox.d.mts.map +1 -1
  162. package/dist/components/ui/checkbox.mjs +0 -1
  163. package/dist/components/ui/checkbox.mjs.map +1 -1
  164. package/dist/components/ui/collapsible.client.d.mts +4 -4
  165. package/dist/components/ui/collapsible.client.d.mts.map +1 -1
  166. package/dist/components/ui/color-picker.client.d.mts +2 -2
  167. package/dist/components/ui/color-picker.client.d.mts.map +1 -1
  168. package/dist/components/ui/color-picker.client.mjs +6 -5
  169. package/dist/components/ui/color-picker.client.mjs.map +1 -1
  170. package/dist/components/ui/combobox-dropdown.client.d.mts +2 -3
  171. package/dist/components/ui/combobox-dropdown.client.d.mts.map +1 -1
  172. package/dist/components/ui/combobox-dropdown.client.mjs +3 -3
  173. package/dist/components/ui/combobox-dropdown.client.mjs.map +1 -1
  174. package/dist/components/ui/combobox.client.d.mts +2 -2
  175. package/dist/components/ui/combobox.client.d.mts.map +1 -1
  176. package/dist/components/ui/combobox.client.mjs +2 -2
  177. package/dist/components/ui/combobox.client.mjs.map +1 -1
  178. package/dist/components/ui/command.d.mts +10 -10
  179. package/dist/components/ui/command.d.mts.map +1 -1
  180. package/dist/components/ui/command.mjs +0 -1
  181. package/dist/components/ui/command.mjs.map +1 -1
  182. package/dist/components/ui/context-menu.d.mts +16 -16
  183. package/dist/components/ui/context-menu.d.mts.map +1 -1
  184. package/dist/components/ui/context-menu.mjs +0 -1
  185. package/dist/components/ui/context-menu.mjs.map +1 -1
  186. package/dist/components/ui/date-picker.client.d.mts +2 -2
  187. package/dist/components/ui/date-picker.client.d.mts.map +1 -1
  188. package/dist/components/ui/date-picker.client.mjs +3 -3
  189. package/dist/components/ui/date-picker.client.mjs.map +1 -1
  190. package/dist/components/ui/dialog.client.d.mts +11 -11
  191. package/dist/components/ui/dialog.client.d.mts.map +1 -1
  192. package/dist/components/ui/dialog.client.mjs +0 -1
  193. package/dist/components/ui/dialog.client.mjs.map +1 -1
  194. package/dist/components/ui/drawer.client.d.mts +11 -11
  195. package/dist/components/ui/drawer.client.d.mts.map +1 -1
  196. package/dist/components/ui/drawer.client.mjs +0 -1
  197. package/dist/components/ui/drawer.client.mjs.map +1 -1
  198. package/dist/components/ui/dropdown-menu.d.mts +16 -16
  199. package/dist/components/ui/dropdown-menu.d.mts.map +1 -1
  200. package/dist/components/ui/dropdown-menu.mjs +0 -1
  201. package/dist/components/ui/dropdown-menu.mjs.map +1 -1
  202. package/dist/components/ui/form.client.d.mts +7 -7
  203. package/dist/components/ui/form.client.d.mts.map +1 -1
  204. package/dist/components/ui/form.client.mjs.map +1 -1
  205. package/dist/components/ui/hover-card.client.d.mts +4 -4
  206. package/dist/components/ui/hover-card.client.d.mts.map +1 -1
  207. package/dist/components/ui/hover-card.client.mjs +0 -1
  208. package/dist/components/ui/hover-card.client.mjs.map +1 -1
  209. package/dist/components/ui/input-date-time.d.mts +2 -2
  210. package/dist/components/ui/input-date-time.d.mts.map +1 -1
  211. package/dist/components/ui/input-date-time.mjs.map +1 -1
  212. package/dist/components/ui/input-date.d.mts +2 -2
  213. package/dist/components/ui/input-date.d.mts.map +1 -1
  214. package/dist/components/ui/input-recipient.d.mts +2 -2
  215. package/dist/components/ui/input-recipient.d.mts.map +1 -1
  216. package/dist/components/ui/input-recipient.mjs +2 -2
  217. package/dist/components/ui/input-recipient.mjs.map +1 -1
  218. package/dist/components/ui/input-time.d.mts +2 -2
  219. package/dist/components/ui/input-time.d.mts.map +1 -1
  220. package/dist/components/ui/input.d.mts +2 -2
  221. package/dist/components/ui/input.d.mts.map +1 -1
  222. package/dist/components/ui/input.mjs +0 -1
  223. package/dist/components/ui/input.mjs.map +1 -1
  224. package/dist/components/ui/label.d.mts +2 -2
  225. package/dist/components/ui/label.d.mts.map +1 -1
  226. package/dist/components/ui/label.mjs +0 -1
  227. package/dist/components/ui/label.mjs.map +1 -1
  228. package/dist/components/ui/navigation-menu.d.mts +11 -11
  229. package/dist/components/ui/navigation-menu.d.mts.map +1 -1
  230. package/dist/components/ui/navigation-menu.mjs +0 -1
  231. package/dist/components/ui/navigation-menu.mjs.map +1 -1
  232. package/dist/components/ui/pagination.d.mts +8 -8
  233. package/dist/components/ui/pagination.d.mts.map +1 -1
  234. package/dist/components/ui/pagination.mjs +0 -1
  235. package/dist/components/ui/pagination.mjs.map +1 -1
  236. package/dist/components/ui/popover.d.mts +5 -5
  237. package/dist/components/ui/popover.d.mts.map +1 -1
  238. package/dist/components/ui/popover.mjs +0 -1
  239. package/dist/components/ui/popover.mjs.map +1 -1
  240. package/dist/components/ui/progress.client.d.mts +2 -2
  241. package/dist/components/ui/progress.client.d.mts.map +1 -1
  242. package/dist/components/ui/progress.client.mjs +0 -1
  243. package/dist/components/ui/progress.client.mjs.map +1 -1
  244. package/dist/components/ui/radio-group.d.mts +3 -3
  245. package/dist/components/ui/radio-group.d.mts.map +1 -1
  246. package/dist/components/ui/radio-group.mjs +0 -1
  247. package/dist/components/ui/radio-group.mjs.map +1 -1
  248. package/dist/components/ui/resizable.client.d.mts +4 -4
  249. package/dist/components/ui/resizable.client.d.mts.map +1 -1
  250. package/dist/components/ui/resizable.client.mjs +0 -1
  251. package/dist/components/ui/resizable.client.mjs.map +1 -1
  252. package/dist/components/ui/scroll-area.d.mts +3 -3
  253. package/dist/components/ui/scroll-area.d.mts.map +1 -1
  254. package/dist/components/ui/scroll-area.mjs +0 -1
  255. package/dist/components/ui/scroll-area.mjs.map +1 -1
  256. package/dist/components/ui/select.client.d.mts +11 -11
  257. package/dist/components/ui/select.client.d.mts.map +1 -1
  258. package/dist/components/ui/select.client.mjs +0 -1
  259. package/dist/components/ui/select.client.mjs.map +1 -1
  260. package/dist/components/ui/separator.d.mts +2 -2
  261. package/dist/components/ui/separator.d.mts.map +1 -1
  262. package/dist/components/ui/separator.mjs +0 -1
  263. package/dist/components/ui/separator.mjs.map +1 -1
  264. package/dist/components/ui/sheet.client.d.mts +9 -9
  265. package/dist/components/ui/sheet.client.d.mts.map +1 -1
  266. package/dist/components/ui/sheet.client.mjs +0 -1
  267. package/dist/components/ui/sheet.client.mjs.map +1 -1
  268. package/dist/components/ui/sidebar.client.d.mts +26 -26
  269. package/dist/components/ui/sidebar.client.d.mts.map +1 -1
  270. package/dist/components/ui/sidebar.client.mjs +2 -2
  271. package/dist/components/ui/sidebar.client.mjs.map +1 -1
  272. package/dist/components/ui/skeleton.d.mts +2 -2
  273. package/dist/components/ui/skeleton.d.mts.map +1 -1
  274. package/dist/components/ui/slider.d.mts +2 -2
  275. package/dist/components/ui/slider.d.mts.map +1 -1
  276. package/dist/components/ui/sonner.client.d.mts +2 -2
  277. package/dist/components/ui/sonner.client.d.mts.map +1 -1
  278. package/dist/components/ui/sonner.client.mjs.map +1 -1
  279. package/dist/components/ui/switch.d.mts +2 -2
  280. package/dist/components/ui/switch.d.mts.map +1 -1
  281. package/dist/components/ui/switch.mjs +0 -1
  282. package/dist/components/ui/switch.mjs.map +1 -1
  283. package/dist/components/ui/tabs.d.mts +5 -5
  284. package/dist/components/ui/tabs.d.mts.map +1 -1
  285. package/dist/components/ui/tabs.mjs +0 -1
  286. package/dist/components/ui/tabs.mjs.map +1 -1
  287. package/dist/components/ui/textarea.d.mts +2 -2
  288. package/dist/components/ui/textarea.d.mts.map +1 -1
  289. package/dist/components/ui/textarea.mjs +0 -1
  290. package/dist/components/ui/textarea.mjs.map +1 -1
  291. package/dist/components/ui/toggle-group.client.d.mts +3 -3
  292. package/dist/components/ui/toggle-group.client.d.mts.map +1 -1
  293. package/dist/components/ui/toggle-group.client.mjs.map +1 -1
  294. package/dist/components/ui/toggle.d.mts +4 -4
  295. package/dist/components/ui/toggle.d.mts.map +1 -1
  296. package/dist/components/ui/toggle.mjs +0 -1
  297. package/dist/components/ui/toggle.mjs.map +1 -1
  298. package/dist/components/ui/tooltip.client.d.mts +5 -5
  299. package/dist/components/ui/tooltip.client.d.mts.map +1 -1
  300. package/dist/components/ui/tooltip.client.mjs +0 -1
  301. package/dist/components/ui/tooltip.client.mjs.map +1 -1
  302. package/dist/components.d.mts +1 -1
  303. package/dist/components.mjs +1 -1
  304. package/dist/data-tables/client.d.mts +4 -4
  305. package/dist/data-tables/client.mjs +4 -4
  306. package/dist/inline-edit/client.d.mts +2 -2
  307. package/dist/inline-edit/client.mjs +2 -2
  308. package/dist/lib/config/constants.d.mts.map +1 -1
  309. package/dist/lib/config/constants.mjs.map +1 -1
  310. package/dist/lib/hooks/use-action.d.mts +0 -1
  311. package/dist/lib/hooks/use-action.d.mts.map +1 -1
  312. package/dist/lib/hooks/use-action.mjs.map +1 -1
  313. package/dist/lib/hooks/use-indicator.d.mts +2 -2
  314. package/dist/lib/hooks/use-indicator.d.mts.map +1 -1
  315. package/dist/lib/hooks/use-indicator.mjs +4 -4
  316. package/dist/lib/hooks/use-indicator.mjs.map +1 -1
  317. package/dist/lib/hooks/use-mobile.client.d.mts.map +1 -1
  318. package/dist/lib/types/config.d.mts.map +1 -1
  319. package/dist/lib/utils/array-move.d.mts.map +1 -1
  320. package/dist/lib/utils/cn.d.mts.map +1 -1
  321. package/dist/lib/utils/cn.mjs.map +1 -1
  322. package/dist/lib/utils/fonts.d.mts.map +1 -1
  323. package/dist/lib/utils/format.d.mts.map +1 -1
  324. package/dist/lib/utils/manifest.d.mts.map +1 -1
  325. package/dist/lib/utils/manifest.mjs.map +1 -1
  326. package/dist/lib/utils/url.d.mts.map +1 -1
  327. package/dist/lib/utils/url.mjs +1 -1
  328. package/dist/lib/utils/url.mjs.map +1 -1
  329. package/dist/modules/auth/components/allowed.client.d.mts +2 -2
  330. package/dist/modules/auth/components/allowed.client.d.mts.map +1 -1
  331. package/dist/modules/auth/components/allowed.client.mjs.map +1 -1
  332. package/dist/modules/auth/components/auth-layout.server.d.mts +2 -2
  333. package/dist/modules/auth/components/auth-layout.server.d.mts.map +1 -1
  334. package/dist/modules/auth/components/auth-layout.server.mjs.map +1 -1
  335. package/dist/modules/auth/components/auth-loading.d.mts +2 -2
  336. package/dist/modules/auth/components/auth-loading.d.mts.map +1 -1
  337. package/dist/modules/auth/components/create-first-user-page.client.d.mts +2 -2
  338. package/dist/modules/auth/components/create-first-user-page.client.d.mts.map +1 -1
  339. package/dist/modules/auth/components/create-first-user-page.client.mjs +1 -1
  340. package/dist/modules/auth/components/create-first-user-page.client.mjs.map +1 -1
  341. package/dist/modules/auth/components/forget-password-page.client.d.mts +2 -2
  342. package/dist/modules/auth/components/forget-password-page.client.d.mts.map +1 -1
  343. package/dist/modules/auth/components/forget-password-page.client.mjs +2 -2
  344. package/dist/modules/auth/components/forget-password-page.client.mjs.map +1 -1
  345. package/dist/modules/auth/components/guard-first-user.server.d.mts +2 -2
  346. package/dist/modules/auth/components/guard-first-user.server.d.mts.map +1 -1
  347. package/dist/modules/auth/components/guard-first-user.server.mjs.map +1 -1
  348. package/dist/modules/auth/components/guard.server.d.mts +2 -2
  349. package/dist/modules/auth/components/guard.server.d.mts.map +1 -1
  350. package/dist/modules/auth/components/guard.server.mjs.map +1 -1
  351. package/dist/modules/auth/components/login-page.client.d.mts +2 -2
  352. package/dist/modules/auth/components/login-page.client.d.mts.map +1 -1
  353. package/dist/modules/auth/components/login-page.client.mjs +1 -1
  354. package/dist/modules/auth/components/login-page.client.mjs.map +1 -1
  355. package/dist/modules/auth/components/reset-password-page.client.d.mts +2 -2
  356. package/dist/modules/auth/components/reset-password-page.client.d.mts.map +1 -1
  357. package/dist/modules/auth/components/reset-password-page.client.mjs +2 -2
  358. package/dist/modules/auth/components/reset-password-page.client.mjs.map +1 -1
  359. package/dist/modules/auth/components/update-password-command.d.mts +2 -2
  360. package/dist/modules/auth/components/update-password-command.d.mts.map +1 -1
  361. package/dist/modules/auth/components/update-password-command.mjs +0 -1
  362. package/dist/modules/auth/components/update-password-command.mjs.map +1 -1
  363. package/dist/modules/auth/db/schema.d.mts +73 -73
  364. package/dist/modules/auth/db/schema.d.mts.map +1 -1
  365. package/dist/modules/auth/db/schema.mjs +1 -1
  366. package/dist/modules/auth/db/schema.mjs.map +1 -1
  367. package/dist/modules/auth/handler/create-client.client.d.mts +159 -159
  368. package/dist/modules/auth/handler/create-client.client.d.mts.map +1 -1
  369. package/dist/modules/auth/handler/create-client.client.mjs.map +1 -1
  370. package/dist/modules/auth/handler/init.d.mts +98 -98
  371. package/dist/modules/auth/handler/init.d.mts.map +1 -1
  372. package/dist/modules/auth/handler/init.mjs +2 -2
  373. package/dist/modules/auth/handler/init.mjs.map +1 -1
  374. package/dist/modules/auth/handler/proxy.server.d.mts +0 -1
  375. package/dist/modules/auth/handler/proxy.server.d.mts.map +1 -1
  376. package/dist/modules/auth/handler/proxy.server.mjs +0 -1
  377. package/dist/modules/auth/handler/proxy.server.mjs.map +1 -1
  378. package/dist/modules/auth/handler/route.server.d.mts +0 -1
  379. package/dist/modules/auth/handler/route.server.d.mts.map +1 -1
  380. package/dist/modules/auth/handler/route.server.mjs.map +1 -1
  381. package/dist/modules/auth/hooks/use-auth-client.d.mts +4 -4
  382. package/dist/modules/auth/hooks/use-auth-client.d.mts.map +1 -1
  383. package/dist/modules/auth/hooks/use-auth-client.mjs.map +1 -1
  384. package/dist/modules/auth/hooks/use-permission.d.mts.map +1 -1
  385. package/dist/modules/auth/hooks/use-permission.mjs +2 -2
  386. package/dist/modules/auth/hooks/use-permission.mjs.map +1 -1
  387. package/dist/modules/auth/hooks/use-session.d.mts +2 -2
  388. package/dist/modules/auth/hooks/use-session.d.mts.map +1 -1
  389. package/dist/modules/auth/hooks/use-session.mjs.map +1 -1
  390. package/dist/modules/auth/lib/helpers.server.d.mts.map +1 -1
  391. package/dist/modules/auth/lib/helpers.server.mjs +2 -2
  392. package/dist/modules/auth/lib/helpers.server.mjs.map +1 -1
  393. package/dist/modules/auth/lib/permissions.d.mts.map +1 -1
  394. package/dist/modules/auth/lib/validators.d.mts +2 -3
  395. package/dist/modules/auth/lib/validators.d.mts.map +1 -1
  396. package/dist/modules/commands/components/alert-dialog-command.client.d.mts +10 -10
  397. package/dist/modules/commands/components/alert-dialog-command.client.d.mts.map +1 -1
  398. package/dist/modules/commands/components/alert-dialog-command.client.mjs.map +1 -1
  399. package/dist/modules/commands/components/click-command.client.d.mts +2 -2
  400. package/dist/modules/commands/components/click-command.client.d.mts.map +1 -1
  401. package/dist/modules/commands/components/click-command.client.mjs +0 -1
  402. package/dist/modules/commands/components/click-command.client.mjs.map +1 -1
  403. package/dist/modules/commands/components/command-trigger.client.d.mts +6 -6
  404. package/dist/modules/commands/components/command-trigger.client.d.mts.map +1 -1
  405. package/dist/modules/commands/components/command-trigger.client.mjs.map +1 -1
  406. package/dist/modules/commands/components/dialog-command.client.d.mts +8 -8
  407. package/dist/modules/commands/components/dialog-command.client.d.mts.map +1 -1
  408. package/dist/modules/commands/components/dialog-command.client.mjs.map +1 -1
  409. package/dist/modules/commands/components/dropdown-command.client.d.mts +5 -5
  410. package/dist/modules/commands/components/dropdown-command.client.d.mts.map +1 -1
  411. package/dist/modules/commands/components/dropdown-command.client.mjs.map +1 -1
  412. package/dist/modules/commands/components/empty-command.client.d.mts +2 -2
  413. package/dist/modules/commands/components/empty-command.client.d.mts.map +1 -1
  414. package/dist/modules/commands/components/empty-command.client.mjs +0 -1
  415. package/dist/modules/commands/components/empty-command.client.mjs.map +1 -1
  416. package/dist/modules/commands/components/form-dialog-command.client.d.mts +11 -11
  417. package/dist/modules/commands/components/form-dialog-command.client.d.mts.map +1 -1
  418. package/dist/modules/commands/components/form-dialog-command.client.mjs.map +1 -1
  419. package/dist/modules/commands/components/render-command.mjs.map +1 -1
  420. package/dist/modules/commands/hooks/context.client.mjs.map +1 -1
  421. package/dist/modules/commands/hooks/use-command-menu.client.d.mts.map +1 -1
  422. package/dist/modules/commands/hooks/use-command-menu.client.mjs +1 -1
  423. package/dist/modules/commands/hooks/use-command-menu.client.mjs.map +1 -1
  424. package/dist/modules/commands/hooks/use-command-mutation.client.d.mts +2 -2
  425. package/dist/modules/commands/hooks/use-command-mutation.client.d.mts.map +1 -1
  426. package/dist/modules/commands/hooks/use-command-mutation.client.mjs.map +1 -1
  427. package/dist/modules/commands/lib/definitions.d.mts +0 -1
  428. package/dist/modules/commands/lib/definitions.d.mts.map +1 -1
  429. package/dist/modules/commands/lib/factory.d.mts.map +1 -1
  430. package/dist/modules/commands/menus/context-menu.client.d.mts +2 -2
  431. package/dist/modules/commands/menus/context-menu.client.d.mts.map +1 -1
  432. package/dist/modules/commands/menus/context-menu.client.mjs +5 -5
  433. package/dist/modules/commands/menus/context-menu.client.mjs.map +1 -1
  434. package/dist/modules/commands/menus/data-table-menu.client.mjs.map +1 -1
  435. package/dist/modules/commands/menus/dropdown-menu.client.d.mts +3 -3
  436. package/dist/modules/commands/menus/dropdown-menu.client.d.mts.map +1 -1
  437. package/dist/modules/commands/menus/dropdown-menu.client.mjs.map +1 -1
  438. package/dist/modules/commands/menus/inline-menu.client.d.mts +3 -3
  439. package/dist/modules/commands/menus/inline-menu.client.d.mts.map +1 -1
  440. package/dist/modules/commands/menus/inline-menu.client.mjs +0 -1
  441. package/dist/modules/commands/menus/inline-menu.client.mjs.map +1 -1
  442. package/dist/modules/commands/menus/responsive-menu.client.d.mts +3 -3
  443. package/dist/modules/commands/menus/responsive-menu.client.d.mts.map +1 -1
  444. package/dist/modules/commands/menus/responsive-menu.client.mjs.map +1 -1
  445. package/dist/modules/commands/utils/archive-command.client.d.mts +3 -3
  446. package/dist/modules/commands/utils/archive-command.client.d.mts.map +1 -1
  447. package/dist/modules/commands/utils/archive-command.client.mjs.map +1 -1
  448. package/dist/modules/commands/utils/delete-command.client.d.mts +3 -3
  449. package/dist/modules/commands/utils/delete-command.client.d.mts.map +1 -1
  450. package/dist/modules/commands/utils/delete-command.client.mjs.map +1 -1
  451. package/dist/modules/config/db/helpers.d.mts +5 -5
  452. package/dist/modules/config/db/helpers.d.mts.map +1 -1
  453. package/dist/modules/config/db/helpers.mjs.map +1 -1
  454. package/dist/modules/config/db/init.d.mts.map +1 -1
  455. package/dist/modules/config/db/init.mjs.map +1 -1
  456. package/dist/modules/config/db/types.d.mts.map +1 -1
  457. package/dist/modules/config/lib/config.d.mts.map +1 -1
  458. package/dist/modules/config/lib/context.d.mts.map +1 -1
  459. package/dist/modules/config/lib/context.mjs.map +1 -1
  460. package/dist/modules/config/paths/helpers.d.mts +0 -1
  461. package/dist/modules/config/paths/helpers.d.mts.map +1 -1
  462. package/dist/modules/config/paths/helpers.mjs.map +1 -1
  463. package/dist/modules/config/paths/types.d.mts +0 -1
  464. package/dist/modules/config/paths/types.d.mts.map +1 -1
  465. package/dist/modules/config/providers/email.d.mts.map +1 -1
  466. package/dist/modules/data-tables/components/cell/common.client.d.mts +5 -5
  467. package/dist/modules/data-tables/components/cell/common.client.d.mts.map +1 -1
  468. package/dist/modules/data-tables/components/cell/common.client.mjs.map +1 -1
  469. package/dist/modules/data-tables/components/cell/index.client.d.mts.map +1 -1
  470. package/dist/modules/data-tables/components/cell/select.client.d.mts.map +1 -1
  471. package/dist/modules/data-tables/components/column-header.d.mts +2 -2
  472. package/dist/modules/data-tables/components/column-header.d.mts.map +1 -1
  473. package/dist/modules/data-tables/components/column-header.mjs.map +1 -1
  474. package/dist/modules/data-tables/components/filters/combobox.client.d.mts +2 -2
  475. package/dist/modules/data-tables/components/filters/combobox.client.d.mts.map +1 -1
  476. package/dist/modules/data-tables/components/filters/combobox.client.mjs.map +1 -1
  477. package/dist/modules/data-tables/components/filters/slider.client.d.mts +2 -2
  478. package/dist/modules/data-tables/components/filters/slider.client.d.mts.map +1 -1
  479. package/dist/modules/data-tables/components/filters/slider.client.mjs +1 -1
  480. package/dist/modules/data-tables/components/filters/slider.client.mjs.map +1 -1
  481. package/dist/modules/data-tables/components/footer.mjs.map +1 -1
  482. package/dist/modules/data-tables/components/header.d.mts +4 -4
  483. package/dist/modules/data-tables/components/header.d.mts.map +1 -1
  484. package/dist/modules/data-tables/components/header.mjs.map +1 -1
  485. package/dist/modules/data-tables/components/layout.d.mts +2 -2
  486. package/dist/modules/data-tables/components/layout.d.mts.map +1 -1
  487. package/dist/modules/data-tables/components/layout.mjs.map +1 -1
  488. package/dist/modules/data-tables/components/search-input.client.d.mts +2 -2
  489. package/dist/modules/data-tables/components/search-input.client.d.mts.map +1 -1
  490. package/dist/modules/data-tables/components/skeleton.d.mts +2 -2
  491. package/dist/modules/data-tables/components/skeleton.d.mts.map +1 -1
  492. package/dist/modules/data-tables/components/skeleton.mjs +4 -4
  493. package/dist/modules/data-tables/components/skeleton.mjs.map +1 -1
  494. package/dist/modules/data-tables/components/table.d.mts +7 -7
  495. package/dist/modules/data-tables/components/table.d.mts.map +1 -1
  496. package/dist/modules/data-tables/components/table.mjs +0 -1
  497. package/dist/modules/data-tables/components/table.mjs.map +1 -1
  498. package/dist/modules/data-tables/components/toolbar.d.mts +3 -3
  499. package/dist/modules/data-tables/components/toolbar.d.mts.map +1 -1
  500. package/dist/modules/data-tables/components/toolbar.mjs.map +1 -1
  501. package/dist/modules/data-tables/hooks/use-context.client.d.mts +2 -2
  502. package/dist/modules/data-tables/hooks/use-context.client.d.mts.map +1 -1
  503. package/dist/modules/data-tables/hooks/use-context.client.mjs.map +1 -1
  504. package/dist/modules/data-tables/hooks/use-selection.client.mjs.map +1 -1
  505. package/dist/modules/data-tables/hooks/use-table.client.d.mts.map +1 -1
  506. package/dist/modules/data-tables/hooks/use-table.client.mjs.map +1 -1
  507. package/dist/modules/data-tables/lib/converters/cursor.d.mts +0 -1
  508. package/dist/modules/data-tables/lib/converters/cursor.d.mts.map +1 -1
  509. package/dist/modules/data-tables/lib/converters/cursor.mjs.map +1 -1
  510. package/dist/modules/data-tables/lib/converters/dto.d.mts +0 -1
  511. package/dist/modules/data-tables/lib/converters/dto.d.mts.map +1 -1
  512. package/dist/modules/data-tables/lib/converters/dto.mjs.map +1 -1
  513. package/dist/modules/data-tables/lib/converters/filter.d.mts.map +1 -1
  514. package/dist/modules/data-tables/lib/converters/search.d.mts +1 -1
  515. package/dist/modules/data-tables/lib/converters/search.d.mts.map +1 -1
  516. package/dist/modules/data-tables/lib/converters/search.mjs.map +1 -1
  517. package/dist/modules/data-tables/lib/converters/sorting.d.mts +1 -1
  518. package/dist/modules/data-tables/lib/converters/sorting.d.mts.map +1 -1
  519. package/dist/modules/data-tables/lib/converters/sorting.mjs.map +1 -1
  520. package/dist/modules/data-tables/lib/filters/config.d.mts.map +1 -1
  521. package/dist/modules/data-tables/lib/filters/config.mjs.map +1 -1
  522. package/dist/modules/data-tables/lib/filters/helpers.d.mts.map +1 -1
  523. package/dist/modules/data-tables/lib/filters/helpers.mjs +4 -4
  524. package/dist/modules/data-tables/lib/filters/helpers.mjs.map +1 -1
  525. package/dist/modules/data-tables/lib/filters/parsers.d.mts.map +1 -1
  526. package/dist/modules/data-tables/lib/filters/parsers.mjs.map +1 -1
  527. package/dist/modules/data-tables/lib/filters/resolvers.d.mts.map +1 -1
  528. package/dist/modules/data-tables/lib/filters/resolvers.mjs +1 -1
  529. package/dist/modules/data-tables/lib/filters/resolvers.mjs.map +1 -1
  530. package/dist/modules/data-tables/lib/helpers/create-column.mjs.map +1 -1
  531. package/dist/modules/data-tables/lib/search-params.d.mts +6 -6
  532. package/dist/modules/data-tables/lib/search-params.d.mts.map +1 -1
  533. package/dist/modules/data-tables/lib/types.d.mts +0 -1
  534. package/dist/modules/data-tables/lib/types.d.mts.map +1 -1
  535. package/dist/modules/data-tables/lib/validators.d.mts +0 -1
  536. package/dist/modules/data-tables/lib/validators.d.mts.map +1 -1
  537. package/dist/modules/data-tables/server/get-data.server.d.mts +1 -1
  538. package/dist/modules/data-tables/server/get-data.server.d.mts.map +1 -1
  539. package/dist/modules/data-tables/server/get-data.server.mjs.map +1 -1
  540. package/dist/modules/data-tables/strategies/helpers/sorting.mjs.map +1 -1
  541. package/dist/modules/data-tables/strategies/infinite/components.mjs +1 -1
  542. package/dist/modules/data-tables/strategies/infinite/components.mjs.map +1 -1
  543. package/dist/modules/data-tables/strategies/infinite/strategy.d.mts.map +1 -1
  544. package/dist/modules/data-tables/strategies/infinite/strategy.mjs.map +1 -1
  545. package/dist/modules/data-tables/strategies/pagination/components.mjs.map +1 -1
  546. package/dist/modules/data-tables/strategies/pagination/strategy.d.mts.map +1 -1
  547. package/dist/modules/data-tables/strategies/pagination/strategy.mjs.map +1 -1
  548. package/dist/modules/data-tables/tables/data-table/components/body.mjs.map +1 -1
  549. package/dist/modules/data-tables/tables/data-table/components/header.mjs.map +1 -1
  550. package/dist/modules/data-tables/tables/data-table/components/row.mjs +0 -1
  551. package/dist/modules/data-tables/tables/data-table/components/row.mjs.map +1 -1
  552. package/dist/modules/data-tables/tables/data-table/components/table.d.mts +2 -2
  553. package/dist/modules/data-tables/tables/data-table/components/table.d.mts.map +1 -1
  554. package/dist/modules/data-tables/tables/data-table/components/table.mjs.map +1 -1
  555. package/dist/modules/data-tables/tables/inline-table/components/body.mjs.map +1 -1
  556. package/dist/modules/data-tables/tables/inline-table/components/cells/common.d.mts +2 -2
  557. package/dist/modules/data-tables/tables/inline-table/components/cells/common.d.mts.map +1 -1
  558. package/dist/modules/data-tables/tables/inline-table/components/cells/common.mjs +0 -1
  559. package/dist/modules/data-tables/tables/inline-table/components/cells/common.mjs.map +1 -1
  560. package/dist/modules/data-tables/tables/inline-table/components/cells/drag-handle.client.d.mts +2 -2
  561. package/dist/modules/data-tables/tables/inline-table/components/cells/drag-handle.client.d.mts.map +1 -1
  562. package/dist/modules/data-tables/tables/inline-table/components/cells/drag-handle.client.mjs.map +1 -1
  563. package/dist/modules/data-tables/tables/inline-table/components/cells/read-only.d.mts +2 -2
  564. package/dist/modules/data-tables/tables/inline-table/components/cells/read-only.d.mts.map +1 -1
  565. package/dist/modules/data-tables/tables/inline-table/components/cells/read-only.mjs +0 -1
  566. package/dist/modules/data-tables/tables/inline-table/components/cells/read-only.mjs.map +1 -1
  567. package/dist/modules/data-tables/tables/inline-table/components/header.mjs.map +1 -1
  568. package/dist/modules/data-tables/tables/inline-table/components/row.client.mjs +0 -1
  569. package/dist/modules/data-tables/tables/inline-table/components/row.client.mjs.map +1 -1
  570. package/dist/modules/data-tables/tables/inline-table/components/table.d.mts +2 -2
  571. package/dist/modules/data-tables/tables/inline-table/components/table.d.mts.map +1 -1
  572. package/dist/modules/data-tables/tables/inline-table/components/table.mjs.map +1 -1
  573. package/dist/modules/data-tables/tables/inline-table/hooks/context.client.d.mts +2 -2
  574. package/dist/modules/data-tables/tables/inline-table/hooks/context.client.d.mts.map +1 -1
  575. package/dist/modules/data-tables/tables/inline-table/hooks/context.client.mjs.map +1 -1
  576. package/dist/modules/inline-edit/components/combobox-dropdown.client.d.mts +2 -2
  577. package/dist/modules/inline-edit/components/combobox-dropdown.client.d.mts.map +1 -1
  578. package/dist/modules/inline-edit/components/combobox-dropdown.client.mjs.map +1 -1
  579. package/dist/modules/inline-edit/components/combobox.client.d.mts +2 -2
  580. package/dist/modules/inline-edit/components/combobox.client.d.mts.map +1 -1
  581. package/dist/modules/inline-edit/components/combobox.client.mjs +3 -3
  582. package/dist/modules/inline-edit/components/combobox.client.mjs.map +1 -1
  583. package/dist/modules/inline-edit/components/date-input.client.d.mts +2 -2
  584. package/dist/modules/inline-edit/components/date-input.client.d.mts.map +1 -1
  585. package/dist/modules/inline-edit/components/date-input.client.mjs.map +1 -1
  586. package/dist/modules/inline-edit/components/date-picker.client.d.mts +2 -2
  587. package/dist/modules/inline-edit/components/date-picker.client.d.mts.map +1 -1
  588. package/dist/modules/inline-edit/components/date-picker.client.mjs +3 -3
  589. package/dist/modules/inline-edit/components/date-picker.client.mjs.map +1 -1
  590. package/dist/modules/inline-edit/components/date-time.client.d.mts +2 -2
  591. package/dist/modules/inline-edit/components/date-time.client.d.mts.map +1 -1
  592. package/dist/modules/inline-edit/components/date-time.client.mjs.map +1 -1
  593. package/dist/modules/inline-edit/components/editor.client.d.mts +2 -2
  594. package/dist/modules/inline-edit/components/editor.client.d.mts.map +1 -1
  595. package/dist/modules/inline-edit/components/editor.client.mjs +2 -2
  596. package/dist/modules/inline-edit/components/editor.client.mjs.map +1 -1
  597. package/dist/modules/inline-edit/components/input-recipient.client.d.mts +2 -2
  598. package/dist/modules/inline-edit/components/input-recipient.client.d.mts.map +1 -1
  599. package/dist/modules/inline-edit/components/input-recipient.client.mjs.map +1 -1
  600. package/dist/modules/inline-edit/components/input-toggle.client.d.mts +2 -2
  601. package/dist/modules/inline-edit/components/input-toggle.client.d.mts.map +1 -1
  602. package/dist/modules/inline-edit/components/input-toggle.client.mjs.map +1 -1
  603. package/dist/modules/inline-edit/components/input.client.d.mts +4 -4
  604. package/dist/modules/inline-edit/components/input.client.d.mts.map +1 -1
  605. package/dist/modules/inline-edit/components/input.client.mjs +1 -1
  606. package/dist/modules/inline-edit/components/input.client.mjs.map +1 -1
  607. package/dist/modules/inline-edit/components/select.client.d.mts +6 -6
  608. package/dist/modules/inline-edit/components/select.client.d.mts.map +1 -1
  609. package/dist/modules/inline-edit/components/select.client.mjs +3 -3
  610. package/dist/modules/inline-edit/components/select.client.mjs.map +1 -1
  611. package/dist/modules/inline-edit/components/switch.client.d.mts +2 -2
  612. package/dist/modules/inline-edit/components/switch.client.d.mts.map +1 -1
  613. package/dist/modules/inline-edit/components/switch.client.mjs.map +1 -1
  614. package/dist/modules/inline-edit/components/toggle.client.d.mts +2 -2
  615. package/dist/modules/inline-edit/components/toggle.client.d.mts.map +1 -1
  616. package/dist/modules/inline-edit/components/toggle.client.mjs +3 -3
  617. package/dist/modules/inline-edit/components/toggle.client.mjs.map +1 -1
  618. package/dist/modules/inline-edit/hooks/context.client.d.mts +2 -2
  619. package/dist/modules/inline-edit/hooks/context.client.d.mts.map +1 -1
  620. package/dist/modules/inline-edit/hooks/context.client.mjs +1 -1
  621. package/dist/modules/inline-edit/hooks/context.client.mjs.map +1 -1
  622. package/dist/modules/inline-edit/hooks/use-inline.client.d.mts +2 -2
  623. package/dist/modules/inline-edit/hooks/use-inline.client.d.mts.map +1 -1
  624. package/dist/modules/inline-edit/hooks/use-inline.client.mjs +3 -3
  625. package/dist/modules/inline-edit/hooks/use-inline.client.mjs.map +1 -1
  626. package/dist/modules/inline-edit/lib/validators.d.mts +0 -1
  627. package/dist/modules/inline-edit/lib/validators.d.mts.map +1 -1
  628. package/dist/modules/inline-edit/lib/validators.mjs.map +1 -1
  629. package/dist/modules/inline-edit/lib/variants.d.mts +3 -3
  630. package/dist/modules/inline-edit/lib/variants.d.mts.map +1 -1
  631. package/dist/modules/inline-edit/lib/variants.mjs.map +1 -1
  632. package/dist/modules/router/handler/caller.client.d.mts +0 -1
  633. package/dist/modules/router/handler/caller.client.d.mts.map +1 -1
  634. package/dist/modules/router/handler/caller.client.mjs.map +1 -1
  635. package/dist/modules/router/handler/caller.server.d.mts.map +1 -1
  636. package/dist/modules/router/handler/context.server.d.mts.map +1 -1
  637. package/dist/modules/router/handler/context.server.mjs.map +1 -1
  638. package/dist/modules/router/handler/init.server.d.mts +6 -6
  639. package/dist/modules/router/handler/init.server.d.mts.map +1 -1
  640. package/dist/modules/router/handler/init.server.mjs.map +1 -1
  641. package/dist/modules/router/handler/register.server.d.mts.map +1 -1
  642. package/dist/modules/router/handler/register.server.mjs.map +1 -1
  643. package/dist/modules/router/handler/route.server.d.mts +0 -1
  644. package/dist/modules/router/handler/route.server.d.mts.map +1 -1
  645. package/dist/modules/router/handler/route.server.mjs.map +1 -1
  646. package/dist/modules/router/lib/query-client.d.mts +0 -1
  647. package/dist/modules/router/lib/query-client.d.mts.map +1 -1
  648. package/dist/modules/router/lib/query-client.mjs.map +1 -1
  649. package/dist/modules/router/lib/query-client.server.d.mts.map +1 -1
  650. package/dist/modules/router/lib/validators.d.mts +0 -1
  651. package/dist/modules/router/lib/validators.d.mts.map +1 -1
  652. package/dist/modules/storage/components/dropzone-context.client.d.mts +2 -2
  653. package/dist/modules/storage/components/dropzone-context.client.d.mts.map +1 -1
  654. package/dist/modules/storage/components/dropzone-context.client.mjs.map +1 -1
  655. package/dist/modules/storage/components/dropzone.client.d.mts +3 -3
  656. package/dist/modules/storage/components/dropzone.client.d.mts.map +1 -1
  657. package/dist/modules/storage/components/dropzone.client.mjs.map +1 -1
  658. package/dist/modules/storage/components/image-grid.client.d.mts +3 -3
  659. package/dist/modules/storage/components/image-grid.client.d.mts.map +1 -1
  660. package/dist/modules/storage/components/image-grid.client.mjs +2 -0
  661. package/dist/modules/storage/components/image-grid.client.mjs.map +1 -1
  662. package/dist/modules/storage/components/upload-zone-context.client.d.mts +0 -1
  663. package/dist/modules/storage/components/upload-zone-context.client.d.mts.map +1 -1
  664. package/dist/modules/storage/components/upload-zone-context.client.mjs.map +1 -1
  665. package/dist/modules/storage/components/upload-zone.client.d.mts +2 -2
  666. package/dist/modules/storage/components/upload-zone.client.d.mts.map +1 -1
  667. package/dist/modules/storage/components/upload-zone.client.mjs +4 -4
  668. package/dist/modules/storage/components/upload-zone.client.mjs.map +1 -1
  669. package/dist/modules/storage/config/filters.d.mts.map +1 -1
  670. package/dist/modules/storage/config/filters.mjs.map +1 -1
  671. package/dist/modules/storage/lib/constants.d.mts.map +1 -1
  672. package/dist/modules/storage/lib/create-client.server.d.mts.map +1 -1
  673. package/dist/modules/storage/lib/create-client.server.mjs.map +1 -1
  674. package/dist/modules/storage/lib/create-upload.client.d.mts.map +1 -1
  675. package/dist/modules/storage/lib/create-upload.client.mjs.map +1 -1
  676. package/dist/modules/storage/lib/helpers.d.mts +0 -1
  677. package/dist/modules/storage/lib/helpers.d.mts.map +1 -1
  678. package/dist/modules/storage/lib/helpers.mjs.map +1 -1
  679. package/dist/modules/storage/lib/proxy.server.d.mts.map +1 -1
  680. package/dist/modules/storage/lib/proxy.server.mjs.map +1 -1
  681. package/dist/modules/storage/lib/router.server.d.mts +28 -28
  682. package/dist/modules/storage/lib/router.server.d.mts.map +1 -1
  683. package/dist/modules/storage/lib/router.server.mjs.map +1 -1
  684. package/dist/modules/storage/lib/schema.d.mts +92 -92
  685. package/dist/modules/storage/lib/schema.d.mts.map +1 -1
  686. package/dist/modules/storage/lib/schema.mjs +1 -1
  687. package/dist/modules/storage/lib/schema.mjs.map +1 -1
  688. package/dist/modules/storage/lib/service.server.d.mts +21 -21
  689. package/dist/modules/storage/lib/service.server.d.mts.map +1 -1
  690. package/dist/modules/storage/lib/service.server.mjs.map +1 -1
  691. package/dist/modules/storage/lib/validators.d.mts +91 -91
  692. package/dist/modules/storage/lib/validators.d.mts.map +1 -1
  693. package/dist/modules/storage/lib/validators.mjs.map +1 -1
  694. package/dist/storage/client.d.mts +1 -1
  695. package/package.json +89 -92
  696. package/src/components/common/icons.tsx +2 -2
  697. package/src/components/common/status.tsx +1 -1
  698. package/src/components/editor/components/content.client.tsx +1 -1
  699. package/src/components/editor/components/editor.client.tsx +6 -6
  700. package/src/components/editor/components/menu-nodes.client.tsx +9 -9
  701. package/src/components/editor/components/menu.client.tsx +5 -5
  702. package/src/components/editor/components/spinner.tsx +2 -8
  703. package/src/components/editor/extensions/file-handler/extension.ts +1 -1
  704. package/src/components/editor/extensions/file-handler/strategy.ts +4 -4
  705. package/src/components/editor/extensions/file-handler/utils.ts +4 -2
  706. package/src/components/editor/extensions/image/extension.ts +4 -1
  707. package/src/components/editor/extensions/skeleton/renderer.tsx +4 -3
  708. package/src/components/editor/lib/extensions.ts +23 -26
  709. package/src/components/editor/lib/helpers.ts +1 -1
  710. package/src/components/editor/lib/utils.ts +1 -33
  711. package/src/components/editor/lib/variants.ts +1 -1
  712. package/src/components/emails/forget-password-email.tsx +1 -1
  713. package/src/components/entry.client.ts +1 -1
  714. package/src/components/entry.ts +1 -1
  715. package/src/components/header/back-button.client.tsx +1 -1
  716. package/src/components/header/bottom-bar.client.tsx +3 -3
  717. package/src/components/header/breadcrumbs.client.tsx +2 -2
  718. package/src/components/header/header.client.tsx +1 -1
  719. package/src/components/header/indicator.client.tsx +2 -2
  720. package/src/components/header/top-bar.client.tsx +3 -3
  721. package/src/components/layouts/admin-content.client.tsx +1 -1
  722. package/src/components/layouts/admin-error-pages.tsx +1 -1
  723. package/src/components/layouts/admin-layout.tsx +1 -1
  724. package/src/components/layouts/admin-loading.tsx +1 -1
  725. package/src/components/layouts/empty-page.tsx +1 -1
  726. package/src/components/layouts/error-page.tsx +2 -2
  727. package/src/components/layouts/error-sections.tsx +1 -1
  728. package/src/components/layouts/list-layout.tsx +1 -1
  729. package/src/components/layouts/providers.client.tsx +4 -4
  730. package/src/components/layouts/root-layout.server.tsx +3 -3
  731. package/src/components/layouts/tab-layout.tsx +3 -3
  732. package/src/components/lists/data-list.tsx +1 -1
  733. package/src/components/lists/data-stack.tsx +1 -1
  734. package/src/components/navigation/admin-sidebar-header.client.tsx +13 -13
  735. package/src/components/navigation/admin-sidebar-paths.client.tsx +6 -6
  736. package/src/components/navigation/admin-sidebar-skeleton.tsx +1 -1
  737. package/src/components/navigation/admin-sidebar.client.tsx +5 -5
  738. package/src/components/ui/accordion.tsx +1 -2
  739. package/src/components/ui/alert-dialog.tsx +1 -1
  740. package/src/components/ui/alert.tsx +1 -1
  741. package/src/components/ui/avatar.client.tsx +1 -1
  742. package/src/components/ui/badge.tsx +1 -1
  743. package/src/components/ui/breadcrumb.tsx +4 -2
  744. package/src/components/ui/button.tsx +1 -1
  745. package/src/components/ui/calendar.tsx +2 -3
  746. package/src/components/ui/card.tsx +1 -1
  747. package/src/components/ui/carousel.tsx +2 -0
  748. package/src/components/ui/chart.client.tsx +12 -10
  749. package/src/components/ui/checkbox.tsx +1 -1
  750. package/src/components/ui/color-picker.client.tsx +4 -3
  751. package/src/components/ui/combobox-dropdown.client.tsx +2 -4
  752. package/src/components/ui/combobox.client.tsx +2 -2
  753. package/src/components/ui/command.tsx +1 -1
  754. package/src/components/ui/context-menu.tsx +1 -1
  755. package/src/components/ui/date-picker.client.tsx +2 -2
  756. package/src/components/ui/dialog.client.tsx +1 -1
  757. package/src/components/ui/drawer.client.tsx +1 -1
  758. package/src/components/ui/dropdown-menu.tsx +1 -1
  759. package/src/components/ui/form.client.tsx +4 -4
  760. package/src/components/ui/hover-card.client.tsx +1 -1
  761. package/src/components/ui/input-date-time.tsx +1 -1
  762. package/src/components/ui/input-recipient.tsx +6 -3
  763. package/src/components/ui/input.tsx +1 -1
  764. package/src/components/ui/label.tsx +1 -1
  765. package/src/components/ui/navigation-menu.tsx +1 -1
  766. package/src/components/ui/pagination.tsx +4 -2
  767. package/src/components/ui/popover.tsx +1 -1
  768. package/src/components/ui/progress.client.tsx +1 -1
  769. package/src/components/ui/radio-group.tsx +1 -1
  770. package/src/components/ui/resizable.client.tsx +1 -1
  771. package/src/components/ui/scroll-area.tsx +1 -1
  772. package/src/components/ui/select.client.tsx +1 -1
  773. package/src/components/ui/separator.tsx +1 -1
  774. package/src/components/ui/sheet.client.tsx +1 -1
  775. package/src/components/ui/sidebar.client.tsx +5 -2
  776. package/src/components/ui/sonner.client.tsx +1 -1
  777. package/src/components/ui/switch.tsx +1 -1
  778. package/src/components/ui/tabs.tsx +1 -1
  779. package/src/components/ui/textarea.tsx +1 -1
  780. package/src/components/ui/toggle-group.client.tsx +1 -1
  781. package/src/components/ui/toggle.tsx +1 -1
  782. package/src/components/ui/tooltip.client.tsx +1 -1
  783. package/src/lib/config/constants.ts +1 -1
  784. package/src/lib/hooks/use-action.ts +3 -3
  785. package/src/lib/types/config.ts +1 -1
  786. package/src/lib/utils/cn.ts +1 -1
  787. package/src/lib/utils/manifest.ts +3 -2
  788. package/src/lib/utils/time-picker.ts +2 -2
  789. package/src/lib/utils/url.ts +1 -1
  790. package/src/modules/auth/components/allowed.client.tsx +2 -2
  791. package/src/modules/auth/components/auth-layout.server.tsx +1 -1
  792. package/src/modules/auth/components/create-first-user-page.client.tsx +10 -11
  793. package/src/modules/auth/components/forget-password-page.client.tsx +5 -5
  794. package/src/modules/auth/components/guard-first-user.server.tsx +2 -5
  795. package/src/modules/auth/components/guard.server.tsx +3 -3
  796. package/src/modules/auth/components/login-page.client.tsx +5 -5
  797. package/src/modules/auth/components/reset-password-page.client.tsx +7 -7
  798. package/src/modules/auth/components/update-password-command.tsx +5 -5
  799. package/src/modules/auth/db/schema.ts +2 -2
  800. package/src/modules/auth/entry.server.ts +1 -1
  801. package/src/modules/auth/handler/create-client.client.ts +3 -3
  802. package/src/modules/auth/handler/init.ts +6 -6
  803. package/src/modules/auth/handler/proxy.server.ts +1 -2
  804. package/src/modules/auth/handler/route.server.ts +2 -2
  805. package/src/modules/auth/hooks/use-auth-client.tsx +3 -3
  806. package/src/modules/auth/hooks/use-permission.ts +1 -1
  807. package/src/modules/auth/hooks/use-session.ts +1 -2
  808. package/src/modules/auth/lib/helpers.server.ts +4 -4
  809. package/src/modules/commands/components/alert-dialog-command.client.tsx +8 -8
  810. package/src/modules/commands/components/click-command.client.tsx +3 -3
  811. package/src/modules/commands/components/command-trigger.client.tsx +1 -1
  812. package/src/modules/commands/components/dialog-command.client.tsx +3 -3
  813. package/src/modules/commands/components/dropdown-command.client.tsx +2 -2
  814. package/src/modules/commands/components/empty-command.client.tsx +1 -1
  815. package/src/modules/commands/components/form-dialog-command.client.tsx +5 -5
  816. package/src/modules/commands/components/render-command.tsx +2 -2
  817. package/src/modules/commands/hooks/context.client.tsx +1 -1
  818. package/src/modules/commands/hooks/use-command-menu.client.tsx +4 -4
  819. package/src/modules/commands/hooks/use-command-mutation.client.tsx +1 -1
  820. package/src/modules/commands/menus/context-menu.client.tsx +20 -19
  821. package/src/modules/commands/menus/data-table-menu.client.tsx +2 -2
  822. package/src/modules/commands/menus/dropdown-menu.client.tsx +6 -3
  823. package/src/modules/commands/menus/inline-menu.client.tsx +6 -2
  824. package/src/modules/commands/menus/responsive-menu.client.tsx +1 -1
  825. package/src/modules/commands/utils/archive-command.client.tsx +1 -1
  826. package/src/modules/commands/utils/delete-command.client.tsx +1 -1
  827. package/src/modules/config/db/helpers.ts +1 -1
  828. package/src/modules/config/db/init.ts +2 -2
  829. package/src/modules/config/lib/context.ts +5 -5
  830. package/src/modules/config/paths/helpers.ts +1 -1
  831. package/src/modules/config/paths/types.ts +4 -5
  832. package/src/modules/data-tables/components/cell/common.client.tsx +1 -1
  833. package/src/modules/data-tables/components/column-header.tsx +2 -2
  834. package/src/modules/data-tables/components/filters/combobox.client.tsx +3 -3
  835. package/src/modules/data-tables/components/filters/slider.client.tsx +5 -5
  836. package/src/modules/data-tables/components/footer.tsx +2 -2
  837. package/src/modules/data-tables/components/header.tsx +2 -2
  838. package/src/modules/data-tables/components/layout.tsx +1 -1
  839. package/src/modules/data-tables/components/skeleton.tsx +22 -29
  840. package/src/modules/data-tables/components/table.tsx +1 -1
  841. package/src/modules/data-tables/components/toolbar.tsx +1 -1
  842. package/src/modules/data-tables/entry.client.ts +9 -13
  843. package/src/modules/data-tables/hooks/use-context.client.tsx +6 -6
  844. package/src/modules/data-tables/hooks/use-selection.client.ts +1 -1
  845. package/src/modules/data-tables/hooks/use-table.client.ts +1 -1
  846. package/src/modules/data-tables/lib/converters/cursor.ts +1 -1
  847. package/src/modules/data-tables/lib/converters/dto.ts +1 -1
  848. package/src/modules/data-tables/lib/converters/search.ts +2 -2
  849. package/src/modules/data-tables/lib/converters/sorting.ts +2 -2
  850. package/src/modules/data-tables/lib/filters/config.ts +2 -2
  851. package/src/modules/data-tables/lib/filters/helpers.ts +4 -4
  852. package/src/modules/data-tables/lib/filters/parsers.ts +2 -2
  853. package/src/modules/data-tables/lib/filters/resolvers.ts +2 -2
  854. package/src/modules/data-tables/lib/helpers/create-column.ts +1 -1
  855. package/src/modules/data-tables/lib/types.ts +6 -5
  856. package/src/modules/data-tables/server/get-data.server.ts +8 -8
  857. package/src/modules/data-tables/strategies/helpers/sorting.ts +7 -3
  858. package/src/modules/data-tables/strategies/infinite/components.tsx +4 -4
  859. package/src/modules/data-tables/strategies/infinite/strategy.ts +2 -2
  860. package/src/modules/data-tables/strategies/pagination/components.tsx +2 -2
  861. package/src/modules/data-tables/strategies/pagination/strategy.ts +2 -2
  862. package/src/modules/data-tables/tables/data-table/components/body.tsx +3 -3
  863. package/src/modules/data-tables/tables/data-table/components/header.tsx +1 -1
  864. package/src/modules/data-tables/tables/data-table/components/row.tsx +3 -3
  865. package/src/modules/data-tables/tables/data-table/components/table.tsx +2 -2
  866. package/src/modules/data-tables/tables/inline-table/components/body.tsx +5 -5
  867. package/src/modules/data-tables/tables/inline-table/components/cells/common.tsx +1 -1
  868. package/src/modules/data-tables/tables/inline-table/components/cells/drag-handle.client.tsx +9 -5
  869. package/src/modules/data-tables/tables/inline-table/components/cells/read-only.tsx +1 -1
  870. package/src/modules/data-tables/tables/inline-table/components/header.tsx +1 -1
  871. package/src/modules/data-tables/tables/inline-table/components/row.client.tsx +5 -5
  872. package/src/modules/data-tables/tables/inline-table/components/table.tsx +3 -3
  873. package/src/modules/data-tables/tables/inline-table/hooks/context.client.tsx +2 -2
  874. package/src/modules/inline-edit/components/combobox-dropdown.client.tsx +2 -2
  875. package/src/modules/inline-edit/components/combobox.client.tsx +2 -2
  876. package/src/modules/inline-edit/components/date-input.client.tsx +4 -4
  877. package/src/modules/inline-edit/components/date-picker.client.tsx +3 -3
  878. package/src/modules/inline-edit/components/date-time.client.tsx +5 -3
  879. package/src/modules/inline-edit/components/editor.client.tsx +3 -3
  880. package/src/modules/inline-edit/components/input-recipient.client.tsx +3 -3
  881. package/src/modules/inline-edit/components/input-toggle.client.tsx +3 -3
  882. package/src/modules/inline-edit/components/input.client.tsx +3 -3
  883. package/src/modules/inline-edit/components/select.client.tsx +8 -8
  884. package/src/modules/inline-edit/components/switch.client.tsx +1 -1
  885. package/src/modules/inline-edit/components/toggle.client.tsx +1 -1
  886. package/src/modules/inline-edit/entry.client.ts +3 -2
  887. package/src/modules/inline-edit/hooks/context.client.tsx +3 -2
  888. package/src/modules/inline-edit/hooks/use-inline.client.tsx +5 -5
  889. package/src/modules/inline-edit/lib/validators.ts +1 -1
  890. package/src/modules/inline-edit/lib/variants.ts +1 -1
  891. package/src/modules/router/handler/caller.client.tsx +2 -2
  892. package/src/modules/router/handler/context.server.ts +4 -4
  893. package/src/modules/router/handler/init.server.ts +3 -3
  894. package/src/modules/router/handler/register.server.ts +3 -3
  895. package/src/modules/router/handler/route.server.ts +3 -3
  896. package/src/modules/router/lib/query-client.ts +0 -1
  897. package/src/modules/storage/components/dropzone-context.client.tsx +1 -1
  898. package/src/modules/storage/components/dropzone.client.tsx +3 -3
  899. package/src/modules/storage/components/image-grid.client.tsx +23 -19
  900. package/src/modules/storage/components/upload-button.client.tsx +2 -2
  901. package/src/modules/storage/components/upload-zone-context.client.tsx +2 -2
  902. package/src/modules/storage/components/upload-zone.client.tsx +5 -5
  903. package/src/modules/storage/config/filters.ts +1 -1
  904. package/src/modules/storage/entry.client.ts +3 -2
  905. package/src/modules/storage/lib/create-client.server.ts +2 -2
  906. package/src/modules/storage/lib/create-upload.client.ts +2 -2
  907. package/src/modules/storage/lib/helpers.ts +3 -3
  908. package/src/modules/storage/lib/proxy.server.ts +4 -4
  909. package/src/modules/storage/lib/router.server.ts +5 -5
  910. package/src/modules/storage/lib/schema.ts +2 -2
  911. package/src/modules/storage/lib/service.server.ts +21 -21
  912. package/src/modules/storage/lib/validators.ts +3 -3
  913. package/src/styles.css +1 -1
  914. package/src/modules/auth/lib/utils.ts +0 -17
  915. package/src/modules/config/db/create-client.ts +0 -40
@@ -1 +1 @@
1
- {"version":3,"file":"dropzone.client.mjs","names":[],"sources":["../../../../src/modules/storage/components/dropzone.client.tsx"],"sourcesContent":["\"use client\";\n\nimport { Button } from \"@/components/ui/button\";\nimport { cn } from \"@/lib/utils/cn\";\nimport { renderBytes } from \"@/modules/storage/lib/helpers\";\nimport { UploadIcon } from \"lucide-react\";\nimport type { ReactNode } from \"react\";\nimport type { DropEvent, DropzoneOptions, FileRejection } from \"react-dropzone\";\nimport { useDropzone } from \"react-dropzone\";\nimport { DropzoneContext, useDropzoneContext } from \"./dropzone-context.client\";\n\n/**\n * Dropzone\n */\nexport type DropzoneProps = Omit<DropzoneOptions, \"onDrop\"> & {\n src?: File[];\n className?: string;\n onDrop?: (acceptedFiles: File[], fileRejections: FileRejection[], event: DropEvent) => void;\n children?: ReactNode;\n};\n\nexport function Dropzone({\n accept,\n maxFiles = 1,\n maxSize,\n minSize,\n onDrop,\n onError,\n disabled,\n src,\n className,\n children,\n ...props\n}: DropzoneProps) {\n const { getRootProps, getInputProps, isDragActive } = useDropzone({\n accept,\n maxFiles,\n maxSize,\n minSize,\n onError,\n disabled,\n onDrop: (acceptedFiles, fileRejections, event) => {\n if (fileRejections.length > 0) {\n const message = fileRejections.at(0)?.errors.at(0)?.message;\n onError?.(new Error(message));\n return;\n }\n onDrop?.(acceptedFiles, fileRejections, event);\n },\n ...props,\n });\n\n return (\n <DropzoneContext key={JSON.stringify(src)} value={{ src, accept, maxSize, minSize, maxFiles }}>\n <Button\n className={cn(\n \"relative h-auto w-full flex-col overflow-hidden p-8\",\n isDragActive && \"ring-ring outline-none ring-1\",\n className,\n )}\n disabled={disabled}\n type=\"button\"\n variant=\"outline\"\n {...getRootProps()}\n >\n <input {...getInputProps()} disabled={disabled} />\n {children}\n </Button>\n </DropzoneContext>\n );\n}\n\n/**\n * DropzoneContent\n */\nexport type DropzoneContentProps = {\n children?: ReactNode;\n className?: string;\n};\n\nconst maxLabelItems = 3;\n\nexport function DropzoneContent({ children, className }: DropzoneContentProps) {\n const { src } = useDropzoneContext();\n if (!src) return null;\n\n if (children) return children;\n\n return (\n <div className={cn(\"flex flex-col items-center justify-center\", className)}>\n <div className=\"bg-muted text-muted-foreground flex size-8 items-center justify-center rounded-md\">\n <UploadIcon size={16} />\n </div>\n\n <p className=\"my-2 w-full truncate text-sm font-medium\">\n {src.length > maxLabelItems\n ? `${new Intl.ListFormat(\"en\").format(\n src.slice(0, maxLabelItems).map((file) => file.name),\n )} and ${src.length - maxLabelItems} more`\n : new Intl.ListFormat(\"en\").format(src.map((file) => file.name))}\n </p>\n\n <p className=\"text-muted-foreground w-full text-wrap text-xs\">\n Drag and drop or click to replace\n </p>\n </div>\n );\n}\n\n/**\n * DropzoneEmptyState\n */\nexport type DropzoneEmptyStateProps = {\n children?: ReactNode;\n className?: string;\n};\n\nexport function DropzoneEmptyState({ children, className }: DropzoneEmptyStateProps) {\n const { src, accept, maxSize, minSize, maxFiles } = useDropzoneContext();\n if (src) {\n return null;\n }\n if (children) {\n return children;\n }\n let caption = \"\";\n if (accept) {\n caption += \"Accepts \";\n caption += new Intl.ListFormat(\"en\").format(Object.keys(accept));\n }\n if (minSize && maxSize) {\n caption += ` between ${renderBytes(minSize)} and ${renderBytes(maxSize)}`;\n } else if (minSize) {\n caption += ` at least ${renderBytes(minSize)}`;\n } else if (maxSize) {\n caption += ` less than ${renderBytes(maxSize)}`;\n }\n return (\n <div className={cn(\"flex flex-col items-center justify-center\", className)}>\n <div className=\"bg-muted text-muted-foreground flex size-8 items-center justify-center rounded-md\">\n <UploadIcon size={16} />\n </div>\n <p className=\"my-2 w-full truncate text-wrap text-sm font-medium\">\n Upload {maxFiles === 1 ? \"a file\" : \"files\"}\n </p>\n <p className=\"text-muted-foreground w-full truncate text-wrap text-xs\">\n Drag and drop or click to upload\n </p>\n {caption && <p className=\"text-muted-foreground text-wrap text-xs\">{caption}.</p>}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;AAqBA,SAAgB,SAAS,EACvB,QACA,WAAW,GACX,SACA,SACA,QACA,SACA,UACA,KACA,WACA,UACA,GAAG,SACa;CAChB,MAAM,EAAE,cAAc,eAAe,iBAAiB,YAAY;EAChE;EACA;EACA;EACA;EACA;EACA;EACA,SAAS,eAAe,gBAAgB,UAAU;AAChD,OAAI,eAAe,SAAS,GAAG;IAC7B,MAAM,UAAU,eAAe,GAAG,EAAE,EAAE,OAAO,GAAG,EAAE,EAAE;AACpD,cAAU,IAAI,MAAM,QAAQ,CAAC;AAC7B;;AAEF,YAAS,eAAe,gBAAgB,MAAM;;EAEhD,GAAG;EACJ,CAAC;AAEF,QACE,oBAAC;EAA0C,OAAO;GAAE;GAAK;GAAQ;GAAS;GAAS;GAAU;YAC3F,qBAAC;GACC,WAAW,GACT,uDACA,gBAAgB,iCAChB,UACD;GACS;GACV,MAAK;GACL,SAAQ;GACR,GAAI,cAAc;cAElB,oBAAC;IAAM,GAAI,eAAe;IAAY;KAAY,EACjD;IACM;IAdW,KAAK,UAAU,IAAI,CAevB;;AAYtB,MAAM,gBAAgB;AAEtB,SAAgB,gBAAgB,EAAE,UAAU,aAAmC;CAC7E,MAAM,EAAE,QAAQ,oBAAoB;AACpC,KAAI,CAAC,IAAK,QAAO;AAEjB,KAAI,SAAU,QAAO;AAErB,QACE,qBAAC;EAAI,WAAW,GAAG,6CAA6C,UAAU;;GACxE,oBAAC;IAAI,WAAU;cACb,oBAAC,cAAW,MAAM,KAAM;KACpB;GAEN,oBAAC;IAAE,WAAU;cACV,IAAI,SAAS,gBACV,GAAG,IAAI,KAAK,WAAW,KAAK,CAAC,OAC3B,IAAI,MAAM,GAAG,cAAc,CAAC,KAAK,SAAS,KAAK,KAAK,CACrD,CAAC,OAAO,IAAI,SAAS,cAAc,SACpC,IAAI,KAAK,WAAW,KAAK,CAAC,OAAO,IAAI,KAAK,SAAS,KAAK,KAAK,CAAC;KAChE;GAEJ,oBAAC;IAAE,WAAU;cAAiD;KAE1D;;GACA;;AAYV,SAAgB,mBAAmB,EAAE,UAAU,aAAsC;CACnF,MAAM,EAAE,KAAK,QAAQ,SAAS,SAAS,aAAa,oBAAoB;AACxE,KAAI,IACF,QAAO;AAET,KAAI,SACF,QAAO;CAET,IAAI,UAAU;AACd,KAAI,QAAQ;AACV,aAAW;AACX,aAAW,IAAI,KAAK,WAAW,KAAK,CAAC,OAAO,OAAO,KAAK,OAAO,CAAC;;AAElE,KAAI,WAAW,QACb,YAAW,YAAY,YAAY,QAAQ,CAAC,OAAO,YAAY,QAAQ;UAC9D,QACT,YAAW,aAAa,YAAY,QAAQ;UACnC,QACT,YAAW,cAAc,YAAY,QAAQ;AAE/C,QACE,qBAAC;EAAI,WAAW,GAAG,6CAA6C,UAAU;;GACxE,oBAAC;IAAI,WAAU;cACb,oBAAC,cAAW,MAAM,KAAM;KACpB;GACN,qBAAC;IAAE,WAAU;eAAqD,WACxD,aAAa,IAAI,WAAW;KAClC;GACJ,oBAAC;IAAE,WAAU;cAA0D;KAEnE;GACH,WAAW,qBAAC;IAAE,WAAU;eAA2C,SAAQ;KAAK;;GAC7E"}
1
+ {"version":3,"file":"dropzone.client.mjs","names":[],"sources":["../../../../src/modules/storage/components/dropzone.client.tsx"],"sourcesContent":["\"use client\";\n\nimport { UploadIcon } from \"lucide-react\";\nimport type { ReactNode } from \"react\";\nimport type { DropEvent, DropzoneOptions, FileRejection } from \"react-dropzone\";\nimport { useDropzone } from \"react-dropzone\";\nimport { Button } from \"@/components/ui/button\";\nimport { cn } from \"@/lib/utils/cn\";\nimport { renderBytes } from \"@/modules/storage/lib/helpers\";\nimport { DropzoneContext, useDropzoneContext } from \"./dropzone-context.client\";\n\n/**\n * Dropzone\n */\nexport type DropzoneProps = Omit<DropzoneOptions, \"onDrop\"> & {\n src?: File[];\n className?: string;\n onDrop?: (acceptedFiles: File[], fileRejections: FileRejection[], event: DropEvent) => void;\n children?: ReactNode;\n};\n\nexport function Dropzone({\n accept,\n maxFiles = 1,\n maxSize,\n minSize,\n onDrop,\n onError,\n disabled,\n src,\n className,\n children,\n ...props\n}: DropzoneProps) {\n const { getRootProps, getInputProps, isDragActive } = useDropzone({\n accept,\n maxFiles,\n maxSize,\n minSize,\n onError,\n disabled,\n onDrop: (acceptedFiles, fileRejections, event) => {\n if (fileRejections.length > 0) {\n const message = fileRejections.at(0)?.errors.at(0)?.message;\n onError?.(new Error(message));\n return;\n }\n onDrop?.(acceptedFiles, fileRejections, event);\n },\n ...props,\n });\n\n return (\n <DropzoneContext key={JSON.stringify(src)} value={{ src, accept, maxSize, minSize, maxFiles }}>\n <Button\n className={cn(\n \"relative h-auto w-full flex-col overflow-hidden p-8\",\n isDragActive && \"ring-ring outline-none ring-1\",\n className,\n )}\n disabled={disabled}\n type=\"button\"\n variant=\"outline\"\n {...getRootProps()}\n >\n <input {...getInputProps()} disabled={disabled} />\n {children}\n </Button>\n </DropzoneContext>\n );\n}\n\n/**\n * DropzoneContent\n */\nexport type DropzoneContentProps = {\n children?: ReactNode;\n className?: string;\n};\n\nconst maxLabelItems = 3;\n\nexport function DropzoneContent({ children, className }: DropzoneContentProps) {\n const { src } = useDropzoneContext();\n if (!src) return null;\n\n if (children) return children;\n\n return (\n <div className={cn(\"flex flex-col items-center justify-center\", className)}>\n <div className=\"bg-muted text-muted-foreground flex size-8 items-center justify-center rounded-md\">\n <UploadIcon size={16} />\n </div>\n\n <p className=\"my-2 w-full truncate text-sm font-medium\">\n {src.length > maxLabelItems\n ? `${new Intl.ListFormat(\"en\").format(\n src.slice(0, maxLabelItems).map((file) => file.name),\n )} and ${src.length - maxLabelItems} more`\n : new Intl.ListFormat(\"en\").format(src.map((file) => file.name))}\n </p>\n\n <p className=\"text-muted-foreground w-full text-wrap text-xs\">\n Drag and drop or click to replace\n </p>\n </div>\n );\n}\n\n/**\n * DropzoneEmptyState\n */\nexport type DropzoneEmptyStateProps = {\n children?: ReactNode;\n className?: string;\n};\n\nexport function DropzoneEmptyState({ children, className }: DropzoneEmptyStateProps) {\n const { src, accept, maxSize, minSize, maxFiles } = useDropzoneContext();\n if (src) {\n return null;\n }\n if (children) {\n return children;\n }\n let caption = \"\";\n if (accept) {\n caption += \"Accepts \";\n caption += new Intl.ListFormat(\"en\").format(Object.keys(accept));\n }\n if (minSize && maxSize) {\n caption += ` between ${renderBytes(minSize)} and ${renderBytes(maxSize)}`;\n } else if (minSize) {\n caption += ` at least ${renderBytes(minSize)}`;\n } else if (maxSize) {\n caption += ` less than ${renderBytes(maxSize)}`;\n }\n return (\n <div className={cn(\"flex flex-col items-center justify-center\", className)}>\n <div className=\"bg-muted text-muted-foreground flex size-8 items-center justify-center rounded-md\">\n <UploadIcon size={16} />\n </div>\n <p className=\"my-2 w-full truncate text-wrap text-sm font-medium\">\n Upload {maxFiles === 1 ? \"a file\" : \"files\"}\n </p>\n <p className=\"text-muted-foreground w-full truncate text-wrap text-xs\">\n Drag and drop or click to upload\n </p>\n {caption && <p className=\"text-muted-foreground text-wrap text-xs\">{caption}.</p>}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;AAqBA,SAAgB,SAAS,EACvB,QACA,WAAW,GACX,SACA,SACA,QACA,SACA,UACA,KACA,WACA,UACA,GAAG,SACa;CAChB,MAAM,EAAE,cAAc,eAAe,iBAAiB,YAAY;EAChE;EACA;EACA;EACA;EACA;EACA;EACA,SAAS,eAAe,gBAAgB,UAAU;AAChD,OAAI,eAAe,SAAS,GAAG;IAC7B,MAAM,UAAU,eAAe,GAAG,EAAE,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AAElE,KAAI,WAAW,QACb,YAAW,YAAY,YAAY,QAAQ,CAAC,OAAO,YAAY,QAAQ;UAC9D,QACT,YAAW,aAAa,YAAY,QAAQ;UACnC,QACT,YAAW,cAAc,YAAY,QAAQ;AAE/C,QACE,qBAAC;EAAI,WAAW,GAAG,6CAA6C,UAAU;;GACxE,oBAAC;IAAI,WAAU;cACb,oBAAC,cAAW,MAAM,KAAM;KACpB;GACN,qBAAC;IAAE,WAAU;eAAqD,WACxD,aAAa,IAAI,WAAW;KAClC;GACJ,oBAAC;IAAE,WAAU;cAA0D;KAEnE;GACH,WAAW,qBAAC;IAAE,WAAU;eAA2C,SAAQ;KAAK;;GAC7E"}
@@ -1,5 +1,5 @@
1
1
  import { FileNode } from "../lib/validators.mjs";
2
- import * as react_jsx_runtime3 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
3
3
  import { ComponentProps } from "react";
4
4
 
5
5
  //#region src/modules/storage/components/image-grid.client.d.ts
@@ -26,8 +26,8 @@ declare function ImageGrid({
26
26
  optimistic,
27
27
  disabled,
28
28
  ...props
29
- }: ImageGridProps): react_jsx_runtime3.JSX.Element;
30
- declare function ImageGridSkeleton(props: ComponentProps<"div">): react_jsx_runtime3.JSX.Element;
29
+ }: ImageGridProps): react_jsx_runtime0.JSX.Element;
30
+ declare function ImageGridSkeleton(props: ComponentProps<"div">): react_jsx_runtime0.JSX.Element;
31
31
  //#endregion
32
32
  export { ImageGrid, ImageGridSkeleton };
33
33
  //# sourceMappingURL=image-grid.client.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"image-grid.client.d.mts","names":[],"sources":["../../../../src/modules/storage/components/image-grid.client.tsx"],"sourcesContent":[],"mappings":";;;;;;;;AAsC6C,KAMxC,cAAA,GAAiB,cAAH,CAAA,KAAA,CAAA,GAAA;EAAG,KAAA,EACb,QADa,EAAA;EACb,QAAA,CAAA,EAAA,OAAA;EAEyD,UAAA,EAAA,CAAA,MAAA,EAAA;IAEH,SAAA,EAAA,MAAA;IAAO,OAAA,EAAA,MAAA;EAItD,CAAA,EAAA,GANkD,OAMzC,CAAA,IAAA,CAAA;EAAG,UAAA,CAAA,EAAA;IAAO,IAAA,CAAA,EAAA,CAAA,MAAA,EAAA;MAAY,SAAA,EAAA,MAAA;MAAY,OAAA,EAAA,MAAA;IAAsB,CAAA,EAAA,GAJlB,OAIkB,CAAA,IAAA,CAAA,GAAA,IAAA;EAAc,CAAA;CAAA;AAkK/E,iBAlKA,SAAA,CAkKiB;EAAA,KAAQ;EAAA,UAAqB;EAAA,UAAA;EAAA,QAAA;EAAA,GAAA;AAAA,CAAA,EAlKmB,cAkKnB,CAAA,EAlKiC,kBAAA,CAAA,GAAA,CAAA,OAkKjC;iBAA9C,iBAAA,QAAyB,wBAAqB,kBAAA,CAAA,GAAA,CAAA"}
1
+ {"version":3,"file":"image-grid.client.d.mts","names":[],"sources":["../../../../src/modules/storage/components/image-grid.client.tsx"],"mappings":";;;;;;;;KA4CK,cAAA,GAAiB,cAAA;EACpB,KAAA,EAAO,QAAA;EACP,QAAA;EACA,UAAA,GAAa,MAAA;IAAU,SAAA;IAAmB,OAAA;EAAA,MAAsB,OAAA;EAChE,UAAA;IACE,IAAA,IAAQ,MAAA;MAAU,SAAA;MAAmB,OAAA;IAAA,MAAsB,OAAA;EAAA;AAAA;AAAA,iBAI/C,SAAA,CAAA;EAAY,KAAA;EAAO,UAAA;EAAY,UAAA;EAAY,QAAA;EAAA,GAAa;AAAA,GAAS,cAAA,GAAc,kBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,iBAsK/E,iBAAA,CAAkB,KAAA,EAAO,cAAA,UAAqB,kBAAA,CAAA,GAAA,CAAA,OAAA"}
@@ -71,8 +71,10 @@ function ImageGrid({ nodes, moveAction, optimistic, disabled, ...props }) {
71
71
  index,
72
72
  setCurrent
73
73
  }, node.id)), !disabled && /* @__PURE__ */ jsxs("label", {
74
+ htmlFor: "file-upload",
74
75
  className: "border-muted-foreground bg-muted hover:border-primary relative flex aspect-square w-full cursor-pointer flex-col items-center justify-center rounded-lg border border-dashed",
75
76
  children: [/* @__PURE__ */ jsx(UploadIcon, { className: "h-8 w-8" }), /* @__PURE__ */ jsx(Input, {
77
+ id: "file-upload",
76
78
  type: "file",
77
79
  accept: "image/jpeg, image/png, image/webp, image/gif",
78
80
  className: "absolute inset-0 z-10 h-full w-full cursor-pointer opacity-0",
@@ -1 +1 @@
1
- {"version":3,"file":"image-grid.client.mjs","names":["Image"],"sources":["../../../../src/modules/storage/components/image-grid.client.tsx"],"sourcesContent":["\"use client\";\n\nimport { Icons } from \"@/components/common/icons\";\nimport { Button } from \"@/components/ui/button\";\nimport { Card } from \"@/components/ui/card\";\nimport {\n Carousel,\n CarouselContent,\n CarouselItem,\n CarouselNext,\n CarouselPrevious,\n} from \"@/components/ui/carousel\";\nimport { Dialog, DialogContent, DialogTrigger } from \"@/components/ui/dialog.client\";\nimport { Input } from \"@/components/ui/input\";\nimport { Skeleton } from \"@/components/ui/skeleton\";\nimport { useAction } from \"@/lib/entry.client\";\nimport { cn } from \"@/lib/utils/cn\";\nimport {\n closestCenter,\n DndContext,\n DragEndEvent,\n KeyboardSensor,\n PointerSensor,\n useDroppable,\n useSensor,\n useSensors,\n} from \"@dnd-kit/core\";\nimport {\n rectSortingStrategy,\n SortableContext,\n sortableKeyboardCoordinates,\n useSortable,\n} from \"@dnd-kit/sortable\";\nimport { CSS } from \"@dnd-kit/utilities\";\nimport { GripIcon, UploadIcon } from \"lucide-react\";\nimport Image from \"next/image\";\nimport React, { ComponentProps } from \"react\";\nimport { getFileUrl, imageLoader } from \"../lib/helpers\";\nimport { FileNode } from \"../lib/validators\";\nimport { useUploadZone } from \"./upload-zone-context.client\";\n\n/**\n * Image Grid\n */\ntype ImageGridProps = ComponentProps<\"div\"> & {\n nodes: FileNode[];\n disabled?: boolean;\n moveAction: (params: { fromIndex: number; toIndex: number }) => Promise<void>;\n optimistic?: {\n move?: (params: { fromIndex: number; toIndex: number }) => Promise<void> | void;\n };\n};\n\nexport function ImageGrid({ nodes, moveAction, optimistic, disabled, ...props }: ImageGridProps) {\n const uploadZone = useUploadZone();\n\n const images = nodes.flatMap((node) => ({ ...node, url: getFileUrl(node.id) }));\n\n const [current, setCurrent] = React.useState<number>(0);\n\n const { setNodeRef } = useDroppable({ id: \"image-grid\" });\n const sensors = useSensors(\n useSensor(PointerSensor),\n useSensor(KeyboardSensor, {\n coordinateGetter: sortableKeyboardCoordinates,\n }),\n );\n\n const moveMuration = useAction({\n mutationFn: async ({ active, over }: DragEndEvent) => {\n if (!moveAction) return Promise.resolve();\n\n const activeId = active.id;\n const overId = over?.id;\n if (!activeId || !overId || activeId === overId) return Promise.resolve();\n\n const fromIndex = images.findIndex((image) => image.id === activeId);\n const toIndex = images.findIndex((image) => image.id === overId);\n\n await optimistic?.move?.({ fromIndex, toIndex });\n await moveAction({ fromIndex, toIndex });\n },\n onSuccess: async () => {\n setCurrent(0);\n await uploadZone.optimistic?.invalidate?.();\n },\n onError: (error) => {\n console.error(\"Error moving image:\", error);\n },\n });\n\n return (\n <Dialog {...props}>\n <DndContext\n sensors={sensors}\n collisionDetection={closestCenter}\n onDragEnd={moveMuration.mutate}\n >\n <div\n ref={setNodeRef}\n className=\"grid grid-cols-[repeat(auto-fill,minmax(10rem,1fr))] gap-5\"\n >\n <SortableContext items={images.map((image) => image.id)} strategy={rectSortingStrategy}>\n {images.map((node, index) => (\n <ImageGridItem key={node.id} node={node} index={index} setCurrent={setCurrent} />\n ))}\n\n {!disabled && (\n <label className=\"border-muted-foreground bg-muted hover:border-primary relative flex aspect-square w-full cursor-pointer flex-col items-center justify-center rounded-lg border border-dashed\">\n <UploadIcon className=\"h-8 w-8\" />\n <Input\n type=\"file\"\n accept=\"image/jpeg, image/png, image/webp, image/gif\"\n className=\"absolute inset-0 z-10 h-full w-full cursor-pointer opacity-0\"\n multiple\n onChange={(e) => {\n if (!e.target.files) return;\n return Array.from(e.target.files).map(uploadZone.onUpload);\n }}\n />\n </label>\n )}\n </SortableContext>\n </div>\n </DndContext>\n\n <Carousel className=\"w-full\" opts={{ startIndex: current }}>\n <DialogContent className=\"border-none bg-transparent p-0 shadow-none md:max-w-[80vw] xl:max-w-[60vw]\">\n <CarouselContent className=\"md:max-h-[80vh]\">\n {images.map(({ id, url }) => (\n <CarouselItem key={id} className=\"overflow-hidden rounded-xl\">\n <Image\n src={url}\n alt=\"Image Preview\"\n width={1920}\n height={1080}\n className=\"h-full w-full rounded-xl object-contain\"\n loader={imageLoader}\n />\n </CarouselItem>\n ))}\n </CarouselContent>\n <CarouselPrevious />\n <CarouselNext />\n </DialogContent>\n </Carousel>\n </Dialog>\n );\n}\n\n/**\n * Image Grid Item\n */\ntype ImageGridItemProps = {\n node: FileNode & { url: string };\n index: number;\n setCurrent: React.Dispatch<React.SetStateAction<number>>;\n};\n\nfunction ImageGridItem({ node, index, setCurrent }: ImageGridItemProps) {\n const uploadZone = useUploadZone();\n\n const { attributes, listeners, setNodeRef, transform, transition } = useSortable({ id: node.id });\n\n return (\n <Card\n id={node.id}\n ref={setNodeRef}\n style={{\n transform: CSS.Transform.toString(transform),\n transition,\n }}\n className={cn(\"group relative aspect-square w-full\", node.isPending && \"opacity-30\")}\n >\n {!node.isPending ? (\n <>\n <DialogTrigger onClick={() => setCurrent(index)}>\n <Image\n src={node.url}\n alt=\"Image Preview\"\n width={100}\n height={100}\n className=\"bg-muted absolute inset-0 h-full w-full cursor-pointer rounded-lg object-contain\"\n loader={imageLoader}\n />\n </DialogTrigger>\n\n <Button\n {...attributes}\n {...listeners}\n type=\"button\"\n variant=\"secondary\"\n size=\"icon\"\n className=\"absolute right-2 top-2 hidden p-1 group-hover:flex\"\n >\n <GripIcon className=\"size-4\" />\n </Button>\n\n <Button\n type=\"button\"\n variant=\"destructive\"\n size=\"icon\"\n onClick={() => uploadZone.onRemove([node.id])}\n className=\"absolute left-2 top-2 hidden p-1 group-hover:flex\"\n >\n <Icons.trash className=\"size-4\" />\n </Button>\n </>\n ) : (\n <Skeleton className=\"absolute inset-0 h-full w-full rounded-lg\" />\n )}\n </Card>\n );\n}\n\nexport function ImageGridSkeleton(props: ComponentProps<\"div\">) {\n return (\n <div\n {...props}\n className={cn(\"grid grid-cols-[repeat(auto-fill,minmax(10rem,1fr))] gap-5\", props.className)}\n >\n {Array.from({ length: 12 }).map((_, index) => (\n <Skeleton key={index} className=\"aspect-square w-full rounded-lg\" />\n ))}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAqDA,SAAgB,UAAU,EAAE,OAAO,YAAY,YAAY,UAAU,GAAG,SAAyB;CAC/F,MAAM,aAAa,eAAe;CAElC,MAAM,SAAS,MAAM,SAAS,UAAU;EAAE,GAAG;EAAM,KAAK,WAAW,KAAK,GAAG;EAAE,EAAE;CAE/E,MAAM,CAAC,SAAS,cAAc,MAAM,SAAiB,EAAE;CAEvD,MAAM,EAAE,eAAe,aAAa,EAAE,IAAI,cAAc,CAAC;CACzD,MAAM,UAAU,WACd,UAAU,cAAc,EACxB,UAAU,gBAAgB,EACxB,kBAAkB,6BACnB,CAAC,CACH;CAED,MAAM,eAAe,UAAU;EAC7B,YAAY,OAAO,EAAE,QAAQ,WAAyB;AACpD,OAAI,CAAC,WAAY,QAAO,QAAQ,SAAS;GAEzC,MAAM,WAAW,OAAO;GACxB,MAAM,SAAS,MAAM;AACrB,OAAI,CAAC,YAAY,CAAC,UAAU,aAAa,OAAQ,QAAO,QAAQ,SAAS;GAEzE,MAAM,YAAY,OAAO,WAAW,UAAU,MAAM,OAAO,SAAS;GACpE,MAAM,UAAU,OAAO,WAAW,UAAU,MAAM,OAAO,OAAO;AAEhE,SAAM,YAAY,OAAO;IAAE;IAAW;IAAS,CAAC;AAChD,SAAM,WAAW;IAAE;IAAW;IAAS,CAAC;;EAE1C,WAAW,YAAY;AACrB,cAAW,EAAE;AACb,SAAM,WAAW,YAAY,cAAc;;EAE7C,UAAU,UAAU;AAClB,WAAQ,MAAM,uBAA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AAe,WAAW,MAAM;cAC7C,oBAACA;KACC,KAAK,KAAK;KACV,KAAI;KACJ,OAAO;KACP,QAAQ;KACR,WAAU;KACV,QAAQ;MACR;KACY;GAEhB,oBAAC;IACC,GAAI;IACJ,GAAI;IACJ,MAAK;IACL,SAAQ;IACR,MAAK;IACL,WAAU;cAEV,oBAAC,YAAS,WAAU,WAAW;KACxB;GAET,oBAAC;IACC,MAAK;IACL,SAAQ;IACR,MAAK;IACL,eAAe,WAAW,SAAS,CAAC,KAAK,GAAG,CAAC;IAC7C,WAAU;cAEV,oBAAC,MAAM,SAAM,WAAU,WAAW;KAC3B;MACR,GAEH,oBAAC,YAAS,WAAU,8CAA8C;GAE/D;;AAIX,SAAgB,kBAAkB,OAA8B;AAC9D,QACE,oBAAC;EACC,GAAI;EACJ,WAAW,GAAG,8DAA8D,MAAM,UAAU;YAE3F,MAAM,KAAK,EAAE,QAAQ,IAAI,CAAC,CAAC,KAAK,GAAG,UAClC,oBAAC,YAAqB,WAAU,qCAAjB,MAAqD,CACpE;GACE"}
1
+ {"version":3,"file":"image-grid.client.mjs","names":["Image"],"sources":["../../../../src/modules/storage/components/image-grid.client.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n closestCenter,\n DndContext,\n type DragEndEvent,\n KeyboardSensor,\n PointerSensor,\n useDroppable,\n useSensor,\n useSensors,\n} from \"@dnd-kit/core\";\nimport {\n rectSortingStrategy,\n SortableContext,\n sortableKeyboardCoordinates,\n useSortable,\n} from \"@dnd-kit/sortable\";\nimport { CSS } from \"@dnd-kit/utilities\";\nimport { GripIcon, UploadIcon } from \"lucide-react\";\nimport Image from \"next/image\";\nimport React, { type ComponentProps } from \"react\";\nimport { Icons } from \"@/components/common/icons\";\nimport { Button } from \"@/components/ui/button\";\nimport { Card } from \"@/components/ui/card\";\nimport {\n Carousel,\n CarouselContent,\n CarouselItem,\n CarouselNext,\n CarouselPrevious,\n} from \"@/components/ui/carousel\";\nimport { Dialog, DialogContent, DialogTrigger } from \"@/components/ui/dialog.client\";\nimport { Input } from \"@/components/ui/input\";\nimport { Skeleton } from \"@/components/ui/skeleton\";\nimport { useAction } from \"@/lib/entry.client\";\nimport { cn } from \"@/lib/utils/cn\";\nimport { getFileUrl, imageLoader } from \"../lib/helpers\";\nimport type { FileNode } from \"../lib/validators\";\nimport { useUploadZone } from \"./upload-zone-context.client\";\n\n/**\n * Image Grid\n */\ntype ImageGridProps = ComponentProps<\"div\"> & {\n nodes: FileNode[];\n disabled?: boolean;\n moveAction: (params: { fromIndex: number; toIndex: number }) => Promise<void>;\n optimistic?: {\n move?: (params: { fromIndex: number; toIndex: number }) => Promise<void> | void;\n };\n};\n\nexport function ImageGrid({ nodes, moveAction, optimistic, disabled, ...props }: ImageGridProps) {\n const uploadZone = useUploadZone();\n\n const images = nodes.flatMap((node) => ({ ...node, url: getFileUrl(node.id) }));\n\n const [current, setCurrent] = React.useState<number>(0);\n\n const { setNodeRef } = useDroppable({ id: \"image-grid\" });\n const sensors = useSensors(\n useSensor(PointerSensor),\n useSensor(KeyboardSensor, {\n coordinateGetter: sortableKeyboardCoordinates,\n }),\n );\n\n const moveMuration = useAction({\n mutationFn: async ({ active, over }: DragEndEvent) => {\n if (!moveAction) return Promise.resolve();\n\n const activeId = active.id;\n const overId = over?.id;\n if (!activeId || !overId || activeId === overId) return Promise.resolve();\n\n const fromIndex = images.findIndex((image) => image.id === activeId);\n const toIndex = images.findIndex((image) => image.id === overId);\n\n await optimistic?.move?.({ fromIndex, toIndex });\n await moveAction({ fromIndex, toIndex });\n },\n onSuccess: async () => {\n setCurrent(0);\n await uploadZone.optimistic?.invalidate?.();\n },\n onError: (error) => {\n console.error(\"Error moving image:\", error);\n },\n });\n\n return (\n <Dialog {...props}>\n <DndContext\n sensors={sensors}\n collisionDetection={closestCenter}\n onDragEnd={moveMuration.mutate}\n >\n <div\n ref={setNodeRef}\n className=\"grid grid-cols-[repeat(auto-fill,minmax(10rem,1fr))] gap-5\"\n >\n <SortableContext items={images.map((image) => image.id)} strategy={rectSortingStrategy}>\n {images.map((node, index) => (\n <ImageGridItem key={node.id} node={node} index={index} setCurrent={setCurrent} />\n ))}\n\n {!disabled && (\n <label\n htmlFor=\"file-upload\"\n className=\"border-muted-foreground bg-muted hover:border-primary relative flex aspect-square w-full cursor-pointer flex-col items-center justify-center rounded-lg border border-dashed\"\n >\n <UploadIcon className=\"h-8 w-8\" />\n <Input\n id=\"file-upload\"\n type=\"file\"\n accept=\"image/jpeg, image/png, image/webp, image/gif\"\n className=\"absolute inset-0 z-10 h-full w-full cursor-pointer opacity-0\"\n multiple\n onChange={(e) => {\n if (!e.target.files) return;\n return Array.from(e.target.files).map(uploadZone.onUpload);\n }}\n />\n </label>\n )}\n </SortableContext>\n </div>\n </DndContext>\n\n <Carousel className=\"w-full\" opts={{ startIndex: current }}>\n <DialogContent className=\"border-none bg-transparent p-0 shadow-none md:max-w-[80vw] xl:max-w-[60vw]\">\n <CarouselContent className=\"md:max-h-[80vh]\">\n {images.map(({ id, url }) => (\n <CarouselItem key={id} className=\"overflow-hidden rounded-xl\">\n <Image\n src={url}\n alt=\"Image Preview\"\n width={1920}\n height={1080}\n className=\"h-full w-full rounded-xl object-contain\"\n loader={imageLoader}\n />\n </CarouselItem>\n ))}\n </CarouselContent>\n <CarouselPrevious />\n <CarouselNext />\n </DialogContent>\n </Carousel>\n </Dialog>\n );\n}\n\n/**\n * Image Grid Item\n */\ntype ImageGridItemProps = {\n node: FileNode & { url: string };\n index: number;\n setCurrent: React.Dispatch<React.SetStateAction<number>>;\n};\n\nfunction ImageGridItem({ node, index, setCurrent }: ImageGridItemProps) {\n const uploadZone = useUploadZone();\n\n const { attributes, listeners, setNodeRef, transform, transition } = useSortable({ id: node.id });\n\n return (\n <Card\n id={node.id}\n ref={setNodeRef}\n style={{\n transform: CSS.Transform.toString(transform),\n transition,\n }}\n className={cn(\"group relative aspect-square w-full\", node.isPending && \"opacity-30\")}\n >\n {!node.isPending ? (\n <>\n <DialogTrigger onClick={() => setCurrent(index)}>\n <Image\n src={node.url}\n alt=\"Image Preview\"\n width={100}\n height={100}\n className=\"bg-muted absolute inset-0 h-full w-full cursor-pointer rounded-lg object-contain\"\n loader={imageLoader}\n />\n </DialogTrigger>\n\n <Button\n {...attributes}\n {...listeners}\n type=\"button\"\n variant=\"secondary\"\n size=\"icon\"\n className=\"absolute right-2 top-2 hidden p-1 group-hover:flex\"\n >\n <GripIcon className=\"size-4\" />\n </Button>\n\n <Button\n type=\"button\"\n variant=\"destructive\"\n size=\"icon\"\n onClick={() => uploadZone.onRemove([node.id])}\n className=\"absolute left-2 top-2 hidden p-1 group-hover:flex\"\n >\n <Icons.trash className=\"size-4\" />\n </Button>\n </>\n ) : (\n <Skeleton className=\"absolute inset-0 h-full w-full rounded-lg\" />\n )}\n </Card>\n );\n}\n\nexport function ImageGridSkeleton(props: ComponentProps<\"div\">) {\n return (\n <div\n {...props}\n className={cn(\"grid grid-cols-[repeat(auto-fill,minmax(10rem,1fr))] gap-5\", props.className)}\n >\n {Array.from({ length: 12 }).map((_, index) => (\n <Skeleton key={index} className=\"aspect-square w-full rounded-lg\" />\n ))}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAqDA,SAAgB,UAAU,EAAE,OAAO,YAAY,YAAY,UAAU,GAAG,SAAyB;CAC/F,MAAM,aAAa,eAAe;CAElC,MAAM,SAAS,MAAM,SAAS,UAAU;EAAE,GAAG;EAAM,KAAK,WAAW,KAAK,GAAG;EAAE,EAAE;CAE/E,MAAM,CAAC,SAAS,cAAc,MAAM,SAAiB,EAAE;CAEvD,MAAM,EAAE,eAAe,aAAa,EAAE,IAAI,cAAc,CAAC;CACzD,MAAM,UAAU,WACd,UAAU,cAAc,EACxB,UAAU,gBAAgB,EACxB,kBAAkB,6BACnB,CAAC,CACH;CAED,MAAM,eAAe,UAAU;EAC7B,YAAY,OAAO,EAAE,QAAQ,WAAyB;AACpD,OAAI,CAAC,WAAY,QAAO,QAAQ,SAAS;GAEzC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R,WAAU;QACV,QAAQ;SACR;SARe,GASJ,CACf;OACc;KAClB,oBAAC,qBAAmB;KACpB,oBAAC,iBAAe;;KACF;IACP;GACJ;;AAab,SAAS,cAAc,EAAE,MAAM,OAAO,cAAkC;CACtE,MAAM,aAAa,eAAe;CAElC,MAAM,EAAE,YAAY,WAAW,YAAY,WAAW,eAAe,YAAY,EAAE,IAAI,KAAK,IAAI,CAAC;AAEjG,QACE,oBAAC;EACC,IAAI,KAAK;EACT,KAAK;EACL,OAAO;GACL,WAAW,IAAI,UAAU,SAAS,UAAU;GAC5C;GACD;EACD,WAAW,GAAG,uCAAuC,KAAK,aAAa,aAAa;YAEnF,CAAC,KAAK,YACL;GACE,oBAAC;IAAc,eAAe,WAAW,MAAM;cAC7C,oBAACA;KACC,KAAK,KAAK;KACV,KAAI;KACJ,OAAO;KACP,QAAQ;KACR,WAAU;KACV,QAAQ;MACR;KACY;GAEhB,oBAAC;IACC,GAAI;IACJ,GAAI;IACJ,MAAK;IACL,SAAQ;IACR,MAAK;IACL,WAAU;cAEV,oBAAC,YAAS,WAAU,WAAW;KACxB;GAET,oBAAC;IACC,MAAK;IACL,SAAQ;IACR,MAAK;IACL,eAAe,WAAW,SAAS,CAAC,KAAK,GAAG,CAAC;IAC7C,WAAU;cAEV,oBAAC,MAAM,SAAM,WAAU,WAAW;KAC3B;MACR,GAEH,oBAAC,YAAS,WAAU,8CAA8C;GAE/D;;AAIX,SAAgB,kBAAkB,OAA8B;AAC9D,QACE,oBAAC;EACC,GAAI;EACJ,WAAW,GAAG,8DAA8D,MAAM,UAAU;YAE3F,MAAM,KAAK,EAAE,QAAQ,IAAI,CAAC,CAAC,KAAK,GAAG,UAClC,oBAAC,YAAqB,WAAU,qCAAjB,MAAqD,CACpE;GACE"}
@@ -3,7 +3,6 @@ import { UploadClient } from "../lib/create-upload.client.mjs";
3
3
  import React from "react";
4
4
 
5
5
  //#region src/modules/storage/components/upload-zone-context.client.d.ts
6
-
7
6
  /**
8
7
  * Upload Zone Context Value
9
8
  */
@@ -1 +1 @@
1
- {"version":3,"file":"upload-zone-context.client.d.mts","names":[],"sources":["../../../../src/modules/storage/components/upload-zone-context.client.tsx"],"sourcesContent":[],"mappings":";;;;;;;;AASA;AACgB,KADJ,sBAAA,GACI;EACG,YAAA,EADH,YACG;EAAiB,QAAA,EAAA,CAAA,IAAA,EAAjB,IAAiB,EAAA,GAAR,OAAQ,CAAA,IAAA,CAAA;EAAR,QAAA,EAAA,CAAA,GAAA,EAAA,MAAA,EAAA,EAAA,GACG,OADH,CAAA,IAAA,CAAA;EACG,UAAA,CAAA,EAAA;IAEV,GAAA,CAAA,EAAA,CAAA,QAAA,EAAA,QAAA,EAAA,GAAa,OAAb,CAAA,IAAA,CAAA,GAAA,IAAA;IAAa,MAAA,CAAA,EAAA,CAAA,GAAA,EAAA,MAAA,EAAA,EAAA,GACF,OADE,CAAA,IAAA,CAAA,GAAA,IAAA;IACF,UAAA,CAAA,EAAA,GAAA,GACT,OADS,CAAA,IAAA,CAAA,GAAA,IAAA;IACT,MAAA,CAAA,EAAA,GAAA,GACJ,OADI,CAAA,IAAA,CAAA,GAAA,IAAA;EACJ,CAAA;CAAO;AAS1B;AAKA;;cALa,mBAAiB,KAAA,CAAA,QAAA;;;;iBAKd,aAAA,CAAA,GAAa"}
1
+ {"version":3,"file":"upload-zone-context.client.d.mts","names":[],"sources":["../../../../src/modules/storage/components/upload-zone-context.client.tsx"],"mappings":";;;;;;;AASA;KAAY,sBAAA;EACV,YAAA,EAAc,YAAA;EACd,QAAA,GAAW,IAAA,EAAM,IAAA,KAAS,OAAA,CAAQ,IAAA;EAClC,QAAA,GAAW,GAAA,eAAkB,OAAA;EAC7B,UAAA;IACE,GAAA,IAAO,QAAA,EAAU,QAAA,KAAa,OAAA;IAC9B,MAAA,IAAU,GAAA,eAAkB,OAAA;IAC5B,UAAA,SAAmB,OAAA;IACnB,MAAA,SAAe,OAAA;EAAA;AAAA;;;;cASN,iBAAA,EAAiB,KAAA,CAAA,OAAA,CAAA,sBAAA;;;;iBAKd,aAAA,CAAA,GAAa,sBAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"upload-zone-context.client.mjs","names":[],"sources":["../../../../src/modules/storage/components/upload-zone-context.client.tsx"],"sourcesContent":["\"use client\";\n\nimport React from \"react\";\nimport { UploadClient } from \"../lib/create-upload.client\";\nimport { FileNode, Node } from \"../lib/validators\";\n\n/**\n * Upload Zone Context Value\n */\nexport type UploadZoneContextValue = {\n uploadClient: UploadClient;\n onUpload: (file: File) => Promise<Node>;\n onRemove: (ids: string[]) => Promise<void>;\n optimistic?: {\n add?: (newValue: FileNode) => Promise<void> | void;\n remove?: (ids: string[]) => Promise<void> | void;\n invalidate?: () => Promise<void> | void;\n cancel?: () => Promise<void> | void;\n };\n // updateData: (newValue: FileNode[] | ((oldValue: FileNode[]) => FileNode[])) => Promise<void>;\n // invalidateQuery: () => Promise<void> | void;\n};\n\n/**\n * Upload Zone Context\n */\nexport const UploadZoneContext = React.createContext({} as UploadZoneContextValue);\n\n/**\n * Upload Zone Hook\n */\nexport function useUploadZone() {\n const context = React.useContext(UploadZoneContext);\n if (!context) {\n throw new Error(\"useUploadZone must be used within an UploadZoneProvider\");\n }\n return context;\n}\n"],"mappings":";;;;;;;;AA0BA,MAAa,oBAAoB,MAAM,cAAc,EAAE,CAA2B;;;;AAKlF,SAAgB,gBAAgB;CAC9B,MAAM,UAAU,MAAM,WAAW,kBAAkB;AACnD,KAAI,CAAC,QACH,OAAM,IAAI,MAAM,0DAA0D;AAE5E,QAAO"}
1
+ {"version":3,"file":"upload-zone-context.client.mjs","names":[],"sources":["../../../../src/modules/storage/components/upload-zone-context.client.tsx"],"sourcesContent":["\"use client\";\n\nimport React from \"react\";\nimport type { UploadClient } from \"../lib/create-upload.client\";\nimport type { FileNode, Node } from \"../lib/validators\";\n\n/**\n * Upload Zone Context Value\n */\nexport type UploadZoneContextValue = {\n uploadClient: UploadClient;\n onUpload: (file: File) => Promise<Node>;\n onRemove: (ids: string[]) => Promise<void>;\n optimistic?: {\n add?: (newValue: FileNode) => Promise<void> | void;\n remove?: (ids: string[]) => Promise<void> | void;\n invalidate?: () => Promise<void> | void;\n cancel?: () => Promise<void> | void;\n };\n // updateData: (newValue: FileNode[] | ((oldValue: FileNode[]) => FileNode[])) => Promise<void>;\n // invalidateQuery: () => Promise<void> | void;\n};\n\n/**\n * Upload Zone Context\n */\nexport const UploadZoneContext = React.createContext({} as UploadZoneContextValue);\n\n/**\n * Upload Zone Hook\n */\nexport function useUploadZone() {\n const context = React.useContext(UploadZoneContext);\n if (!context) {\n throw new Error(\"useUploadZone must be used within an UploadZoneProvider\");\n }\n return context;\n}\n"],"mappings":";;;;;;;;AA0BA,MAAa,oBAAoB,MAAM,cAAc,EAAE,CAA2B;;;;AAKlF,SAAgB,gBAAgB;CAC9B,MAAM,UAAU,MAAM,WAAW,kBAAkB;AACnD,KAAI,CAAC,QACH,OAAM,IAAI,MAAM,0DAA0D;AAE5E,QAAO"}
@@ -1,7 +1,7 @@
1
1
  import { Node, UploadFileSchema } from "../lib/validators.mjs";
2
2
  import { UploadHooks } from "../lib/create-upload.client.mjs";
3
3
  import { UploadZoneContextValue } from "./upload-zone-context.client.mjs";
4
- import * as react_jsx_runtime5 from "react/jsx-runtime";
4
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
5
5
  import { ComponentProps } from "react";
6
6
 
7
7
  //#region src/modules/storage/components/upload-zone.client.d.ts
@@ -21,7 +21,7 @@ declare function UploadZone({
21
21
  children,
22
22
  className,
23
23
  ...props
24
- }: UploadZoneProps): react_jsx_runtime5.JSX.Element;
24
+ }: UploadZoneProps): react_jsx_runtime0.JSX.Element;
25
25
  //#endregion
26
26
  export { UploadZone, UploadZoneProps };
27
27
  //# sourceMappingURL=upload-zone.client.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"upload-zone.client.d.mts","names":[],"sources":["../../../../src/modules/storage/components/upload-zone.client.tsx"],"sourcesContent":[],"mappings":";;;;;;;KAWY,eAAA,GAAkB,wBAC5B,KAAK;aACQ,KAAK;gBACF;EAHN,iBAAA,CAAe,EAAA,CAAA,IAAA,EAKI,IALJ,EAAA,GAKa,OALb,CAAA,IAAA,CAAA,GAAA,IAAA;EAAG,cAAA,CAAA,EAAA,CAAA,KAAA,EAAA,OAAA,EAAA,GAMW,OANX,CAAA,IAAA,CAAA,GAAA,IAAA;CACvB;AAAL,iBAQc,UAAA,CARd;EAAA,SAAA;EAAA,UAAA;EAAA,YAAA;EAAA,WAAA;EAAA,iBAAA;EAAA,cAAA;EAAA,QAAA;EAAA,SAAA;EAAA,GAAA;AAAA,CAAA,EAkBC,eAlBD,CAAA,EAkBgB,kBAAA,CAAA,GAAA,CAAA,OAlBhB"}
1
+ {"version":3,"file":"upload-zone.client.d.mts","names":[],"sources":["../../../../src/modules/storage/components/upload-zone.client.tsx"],"mappings":";;;;;;;KAWY,eAAA,GAAkB,cAAA,UAC5B,IAAA,CAAK,sBAAA;EACH,SAAA,EAAW,IAAA,CAAK,gBAAA;EAChB,WAAA,GAAc,WAAA;EAEd,iBAAA,IAAqB,IAAA,EAAM,IAAA,KAAS,OAAA;EACpC,cAAA,IAAkB,KAAA,cAAmB,OAAA;AAAA;AAAA,iBAGzB,UAAA,CAAA;EACd,SAAA;EACA,UAAA;EACA,YAAA;EACA,WAAA;EACA,iBAAA;EACA,cAAA;EACA,QAAA;EACA,SAAA;EAAA,GACG;AAAA,GACF,eAAA,GAAe,kBAAA,CAAA,GAAA,CAAA,OAAA"}
@@ -32,9 +32,9 @@ function UploadZone({ variables, optimistic, uploadClient, uploadHooks, onUpload
32
32
  */
33
33
  const uploadMutation = useAction({
34
34
  mutationFn: async (params) => uploadClient.upload(params, uploadHooks),
35
- onMutate: async (variables$1) => {
35
+ onMutate: async (variables) => {
36
36
  const newNode = {
37
- ...variables$1,
37
+ ...variables,
38
38
  type: "file",
39
39
  isPending: true
40
40
  };
@@ -45,12 +45,12 @@ function UploadZone({ variables, optimistic, uploadClient, uploadHooks, onUpload
45
45
  await onUploadCompleted?.(data);
46
46
  toast.success(`Succesvol geupload: ${data.name}`);
47
47
  },
48
- onError: async (error, variables$1) => {
48
+ onError: async (error, variables) => {
49
49
  await onUploadFailed?.(error);
50
50
  console.error("Upload error: ", error);
51
51
  toast.error("Bestand uploaden mislukt", { description: error instanceof Error ? error.message : void 0 });
52
52
  console.info("Deleting failed upload");
53
- await deleteMutation.mutateAsync([variables$1.id]);
53
+ await deleteMutation.mutateAsync([variables.id]);
54
54
  },
55
55
  onSettled: () => {
56
56
  optimistic?.invalidate?.();
@@ -1 +1 @@
1
- {"version":3,"file":"upload-zone.client.mjs","names":["variables"],"sources":["../../../../src/modules/storage/components/upload-zone.client.tsx"],"sourcesContent":["\"use client\";\n\nimport { toast } from \"@/components/ui/sonner.client\";\nimport { useAction } from \"@/lib/hooks/use-action\";\nimport { cn } from \"@/lib/utils/cn\";\nimport { ComponentProps, useCallback } from \"react\";\nimport { useDropzone } from \"react-dropzone\";\nimport { UploadFileRequest, UploadHooks } from \"../lib/create-upload.client\";\nimport { FileNode, Node, UploadFileSchema } from \"../lib/validators\";\nimport { UploadZoneContext, UploadZoneContextValue } from \"./upload-zone-context.client\";\n\nexport type UploadZoneProps = ComponentProps<\"div\"> &\n Pick<UploadZoneContextValue, \"optimistic\" | \"uploadClient\"> & {\n variables: Pick<UploadFileSchema, \"namespace\" | \"parentId\" | \"mode\" | \"hidden\" | \"readonly\">;\n uploadHooks?: UploadHooks;\n\n onUploadCompleted?: (node: Node) => Promise<void> | void;\n onUploadFailed?: (error: unknown) => Promise<void> | void;\n };\n\nexport function UploadZone({\n variables,\n optimistic,\n uploadClient,\n uploadHooks,\n onUploadCompleted,\n onUploadFailed,\n children,\n className,\n ...props\n}: UploadZoneProps) {\n /**\n * Delete mutation\n */\n const deleteMutation = useAction({\n mutationFn: async (ids: string[]) => uploadClient.deleteFiles(ids),\n onMutate: async (ids) => {\n await optimistic?.cancel?.();\n await optimistic?.remove?.(ids);\n },\n onError: async (error) => {\n console.error(\"Delete failed upload error: \", error);\n await onUploadFailed?.(error);\n },\n onSettled: () => {\n optimistic?.invalidate?.();\n },\n });\n\n /**\n * Upload mutation\n */\n const uploadMutation = useAction({\n mutationFn: async (params: UploadFileRequest) => uploadClient.upload(params, uploadHooks),\n onMutate: async (variables) => {\n // Generate a new node\n const newNode = {\n ...variables,\n type: \"file\",\n isPending: true,\n } as FileNode;\n\n await optimistic?.cancel?.();\n await optimistic?.add?.(newNode);\n },\n onSuccess: async (data) => {\n await onUploadCompleted?.(data);\n toast.success(`Succesvol geupload: ${data.name}`);\n },\n onError: async (error, variables) => {\n await onUploadFailed?.(error);\n\n console.error(\"Upload error: \", error);\n toast.error(\"Bestand uploaden mislukt\", {\n description: error instanceof Error ? error.message : undefined,\n });\n\n console.info(\"Deleting failed upload\");\n await deleteMutation.mutateAsync([variables.id]);\n },\n onSettled: () => {\n optimistic?.invalidate?.();\n },\n });\n\n /**\n * Upload file handler\n */\n const onUpload = useCallback(\n async (file: File) => {\n console.info(\"Uploading file\", file);\n const req = uploadClient.prepareUpload({ ...variables, file });\n return await uploadMutation.mutateAsync(req);\n },\n [uploadClient, variables, uploadMutation],\n );\n\n /**\n * Drop handler\n */\n const onDrop = useCallback(\n async (acceptedFiles: File[]) => {\n if (acceptedFiles.length === 0) return;\n await Promise.allSettled(acceptedFiles.map(onUpload));\n },\n [onUpload],\n );\n\n const { getRootProps, getInputProps, isDragActive } = useDropzone({ onDrop, noClick: true });\n\n return (\n <div {...props} {...getRootProps()} className={cn(\"relative z-0\", className)}>\n <input {...getInputProps()} />\n\n {/* Show drag overlay when drag is active */}\n {isDragActive && (\n <div className=\"bg-primary/20 absolute inset-0 z-10 rounded-md opacity-70 backdrop-blur-3xl\" />\n )}\n\n <UploadZoneContext\n value={{\n uploadClient,\n onUpload,\n onRemove: deleteMutation.mutateAsync,\n optimistic,\n }}\n >\n {children}\n </UploadZoneContext>\n </div>\n );\n}\n"],"mappings":";;;;;;;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AAY;EAAE,QARrD,YACb,OAAO,kBAA0B;AAC/B,OAAI,cAAc,WAAW,EAAG;AAChC,SAAM,QAAQ,WAAW,cAAc,IAAI,SAAS,CAAC;KAEvD,CAAC,SAAS,CACX;EAE2E,SAAS;EAAM,CAAC;AAE5F,QACE,qBAAC;EAAI,GAAI;EAAO,GAAI,cAAc;EAAE,WAAW,GAAG,gBAAgB,UAAU;;GAC1E,oBAAC,WAAM,GAAI,eAAe,GAAI;GAG7B,gBACC,oBAAC,SAAI,WAAU,gFAAgF;GAGjG,oBAAC;IACC,OAAO;KACL;KACA;KACA,UAAU,eAAe;KACzB;KACD;IAEA;KACiB;;GAChB"}
1
+ {"version":3,"file":"upload-zone.client.mjs","names":[],"sources":["../../../../src/modules/storage/components/upload-zone.client.tsx"],"sourcesContent":["\"use client\";\n\nimport { type ComponentProps, useCallback } from \"react\";\nimport { useDropzone } from \"react-dropzone\";\nimport { toast } from \"@/components/ui/sonner.client\";\nimport { useAction } from \"@/lib/hooks/use-action\";\nimport { cn } from \"@/lib/utils/cn\";\nimport type { UploadFileRequest, UploadHooks } from \"../lib/create-upload.client\";\nimport type { FileNode, Node, UploadFileSchema } from \"../lib/validators\";\nimport { UploadZoneContext, type UploadZoneContextValue } from \"./upload-zone-context.client\";\n\nexport type UploadZoneProps = ComponentProps<\"div\"> &\n Pick<UploadZoneContextValue, \"optimistic\" | \"uploadClient\"> & {\n variables: Pick<UploadFileSchema, \"namespace\" | \"parentId\" | \"mode\" | \"hidden\" | \"readonly\">;\n uploadHooks?: UploadHooks;\n\n onUploadCompleted?: (node: Node) => Promise<void> | void;\n onUploadFailed?: (error: unknown) => Promise<void> | void;\n };\n\nexport function UploadZone({\n variables,\n optimistic,\n uploadClient,\n uploadHooks,\n onUploadCompleted,\n onUploadFailed,\n children,\n className,\n ...props\n}: UploadZoneProps) {\n /**\n * Delete mutation\n */\n const deleteMutation = useAction({\n mutationFn: async (ids: string[]) => uploadClient.deleteFiles(ids),\n onMutate: async (ids) => {\n await optimistic?.cancel?.();\n await optimistic?.remove?.(ids);\n },\n onError: async (error) => {\n console.error(\"Delete failed upload error: \", error);\n await onUploadFailed?.(error);\n },\n onSettled: () => {\n optimistic?.invalidate?.();\n },\n });\n\n /**\n * Upload mutation\n */\n const uploadMutation = useAction({\n mutationFn: async (params: UploadFileRequest) => uploadClient.upload(params, uploadHooks),\n onMutate: async (variables) => {\n // Generate a new node\n const newNode = {\n ...variables,\n type: \"file\",\n isPending: true,\n } as FileNode;\n\n await optimistic?.cancel?.();\n await optimistic?.add?.(newNode);\n },\n onSuccess: async (data) => {\n await onUploadCompleted?.(data);\n toast.success(`Succesvol geupload: ${data.name}`);\n },\n onError: async (error, variables) => {\n await onUploadFailed?.(error);\n\n console.error(\"Upload error: \", error);\n toast.error(\"Bestand uploaden mislukt\", {\n description: error instanceof Error ? error.message : undefined,\n });\n\n console.info(\"Deleting failed upload\");\n await deleteMutation.mutateAsync([variables.id]);\n },\n onSettled: () => {\n optimistic?.invalidate?.();\n },\n });\n\n /**\n * Upload file handler\n */\n const onUpload = useCallback(\n async (file: File) => {\n console.info(\"Uploading file\", file);\n const req = uploadClient.prepareUpload({ ...variables, file });\n return await uploadMutation.mutateAsync(req);\n },\n [uploadClient, variables, uploadMutation],\n );\n\n /**\n * Drop handler\n */\n const onDrop = useCallback(\n async (acceptedFiles: File[]) => {\n if (acceptedFiles.length === 0) return;\n await Promise.allSettled(acceptedFiles.map(onUpload));\n },\n [onUpload],\n );\n\n const { getRootProps, getInputProps, isDragActive } = useDropzone({ onDrop, noClick: true });\n\n return (\n <div {...props} {...getRootProps()} className={cn(\"relative z-0\", className)}>\n <input {...getInputProps()} />\n\n {/* Show drag overlay when drag is active */}\n {isDragActive && (\n <div className=\"bg-primary/20 absolute inset-0 z-10 rounded-md opacity-70 backdrop-blur-3xl\" />\n )}\n\n <UploadZoneContext\n value={{\n uploadClient,\n onUpload,\n onRemove: deleteMutation.mutateAsync,\n optimistic,\n }}\n >\n {children}\n </UploadZ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,MAAM,EAAE,cAAc,eAAe,iBAAiB,YAAY;EAAE,QARrD,YACb,OAAO,kBAA0B;AAC/B,OAAI,cAAc,WAAW,EAAG;AAChC,SAAM,QAAQ,WAAW,cAAc,IAAI,SAAS,CAAC;KAEvD,CAAC,SAAS,CACX;EAE2E,SAAS;EAAM,CAAC;AAE5F,QACE,qBAAC;EAAI,GAAI;EAAO,GAAI,cAAc;EAAE,WAAW,GAAG,gBAAgB,UAAU;;GAC1E,oBAAC,WAAM,GAAI,eAAe,GAAI;GAG7B,gBACC,oBAAC,SAAI,WAAU,gFAAgF;GAGjG,oBAAC;IACC,OAAO;KACL;KACA;KACA,UAAU,eAAe;KACzB;KACD;IAEA;KACiB;;GAChB"}
@@ -1 +1 @@
1
- {"version":3,"file":"filters.d.mts","names":[],"sources":["../../../../src/modules/storage/config/filters.ts"],"sourcesContent":[],"mappings":";;;;cAKa;;;IAAA,MAAA,EAAA,QAMX"}
1
+ {"version":3,"file":"filters.d.mts","names":[],"sources":["../../../../src/modules/storage/config/filters.ts"],"mappings":";;;;cAKa,iBAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"filters.mjs","names":[],"sources":["../../../../src/modules/storage/config/filters.ts"],"sourcesContent":["import { createTableFilters } from \"@/modules/data-tables/lib/filters/config\";\nimport { parseFilterArray, parseFilterBoolean } from \"@/modules/data-tables/lib/filters/parsers\";\nimport z from \"zod\";\nimport { nodeTypeEnum } from \"../lib/schema\";\n\nexport const nodesTableFilters = createTableFilters({\n types: parseFilterArray(z.array(z.enum(nodeTypeEnum.enumValues))),\n nodeIds: parseFilterArray(z.array(z.string())),\n isDeleted: parseFilterBoolean(z.boolean()),\n isOrphaned: parseFilterBoolean(z.boolean()),\n hidden: parseFilterBoolean(z.boolean()),\n});\n"],"mappings":";;;;;;AAKA,MAAa,oBAAoB,mBAAmB;CAClD,OAAO,iBAAiB,EAAE,MAAM,EAAE,KAAK,aAAa,WAAW,CAAC,CAAC;CACjE,SAAS,iBAAiB,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;CAC9C,WAAW,mBAAmB,EAAE,SAAS,CAAC;CAC1C,YAAY,mBAAmB,EAAE,SAAS,CAAC;CAC3C,QAAQ,mBAAmB,EAAE,SAAS,CAAC;CACxC,CAAC"}
1
+ {"version":3,"file":"filters.mjs","names":[],"sources":["../../../../src/modules/storage/config/filters.ts"],"sourcesContent":["import z from \"zod\";\nimport { createTableFilters } from \"@/modules/data-tables/lib/filters/config\";\nimport { parseFilterArray, parseFilterBoolean } from \"@/modules/data-tables/lib/filters/parsers\";\nimport { nodeTypeEnum } from \"../lib/schema\";\n\nexport const nodesTableFilters = createTableFilters({\n types: parseFilterArray(z.array(z.enum(nodeTypeEnum.enumValues))),\n nodeIds: parseFilterArray(z.array(z.string())),\n isDeleted: parseFilterBoolean(z.boolean()),\n isOrphaned: parseFilterBoolean(z.boolean()),\n hidden: parseFilterBoolean(z.boolean()),\n});\n"],"mappings":";;;;;;AAKA,MAAa,oBAAoB,mBAAmB;CAClD,OAAO,iBAAiB,EAAE,MAAM,EAAE,KAAK,aAAa,WAAW,CAAC,CAAC;CACjE,SAAS,iBAAiB,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;CAC9C,WAAW,mBAAmB,EAAE,SAAS,CAAC;CAC1C,YAAY,mBAAmB,EAAE,SAAS,CAAC;CAC3C,QAAQ,mBAAmB,EAAE,SAAS,CAAC;CACxC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.mts","names":[],"sources":["../../../../src/modules/storage/lib/constants.ts"],"sourcesContent":[],"mappings":";cACa;AAAA,cACA,UAD2D,EAAA,MAAA,EAAA;AAC3D,cAGA,aAHwB,EAAA,SAAA,CAAA,MAAA,EAAA,GAAA,WAAA,MAAA,EAAA,EAAA,CAAA;AAGxB,KAID,YAAA,GADF,CAAA,OACyB,aADzB,CAAA,CAAA,MAAA,CAAA;AACE,cAGC,iBAHsB,EAAA,SAAa,CAAA,QAAA,EAAA,YAAA,CAAA;AAGnC,KACD,gBAAA,GADsD,CAAA,OAC3B,iBAD2B,CAAA,CAAA,MAAA,CAAA"}
1
+ {"version":3,"file":"constants.d.mts","names":[],"sources":["../../../../src/modules/storage/lib/constants.ts"],"mappings":";cACa,WAAA;AAAA,cACA,UAAA;AAAA,cAGA,aAAA;AAAA,KAID,YAAA,WAAuB,aAAA;AAAA,cAGtB,iBAAA;AAAA,KACD,gBAAA,WAA2B,iBAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"create-client.server.d.mts","names":[],"sources":["../../../../src/modules/storage/lib/create-client.server.ts"],"sourcesContent":[],"mappings":";;;;;;iBAKgB,oCAAoC,wBAC3C,qBAAqB,WAAQ,eAAA;KAK1B,8BAA8B,mBAAmB,kBACpD,oBAAoB"}
1
+ {"version":3,"file":"create-client.server.d.mts","names":[],"sources":["../../../../src/modules/storage/lib/create-client.server.ts"],"mappings":";;;;;;iBAKgB,mBAAA,iBAAoC,eAAA,CAAA,CAClD,KAAA,EAAO,oBAAA,CAAqB,OAAA,IAAQ,cAAA,CAAA,OAAA;AAAA,KAK1B,aAAA,iBAA8B,eAAA,IAAmB,UAAA,QACpD,mBAAA,CAAoB,OAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"create-client.server.mjs","names":[],"sources":["../../../../src/modules/storage/lib/create-client.server.ts"],"sourcesContent":["import \"server-cli-only\";\n\nimport { TDatabaseSchema } from \"@/modules/config/entry\";\nimport { StorageService, StorageServiceConfig } from \"./service.server\";\n\nexport function createStorageClient<TSchema extends TDatabaseSchema>(\n props: StorageServiceConfig<TSchema>,\n) {\n return new StorageService(props);\n}\n\nexport type StorageClient<TSchema extends TDatabaseSchema> = ReturnType<\n typeof createStorageClient<TSchema>\n>;\n"],"mappings":";;;;AAKA,SAAgB,oBACd,OACA;AACA,QAAO,IAAI,eAAe,MAAM"}
1
+ {"version":3,"file":"create-client.server.mjs","names":[],"sources":["../../../../src/modules/storage/lib/create-client.server.ts"],"sourcesContent":["import \"server-cli-only\";\n\nimport type { TDatabaseSchema } from \"@/modules/config/entry\";\nimport { StorageService, type StorageServiceConfig } from \"./service.server\";\n\nexport function createStorageClient<TSchema extends TDatabaseSchema>(\n props: StorageServiceConfig<TSchema>,\n) {\n return new StorageService(props);\n}\n\nexport type StorageClient<TSchema extends TDatabaseSchema> = ReturnType<\n typeof createStorageClient<TSchema>\n>;\n"],"mappings":";;;;AAKA,SAAgB,oBACd,OACA;AACA,QAAO,IAAI,eAAe,MAAM"}
@@ -1 +1 @@
1
- {"version":3,"file":"create-upload.client.d.mts","names":[],"sources":["../../../../src/modules/storage/lib/create-upload.client.ts"],"sourcesContent":[],"mappings":";;;;;;;;AAOY,KAAA,kBAAA,GAAqB,IAAK,CAAA,iBAAA,EAAL,IAAI,GAAA,MAAA,GAAA,MAAA,GAAA,aAAA,CAAA;AACzB,KAAA,iBAAA,GAAoB,iBAAA,GAAA;EACpB,IAAA,EADgD,IAChD;CACc;AAAsB,KADpC,WAAA,GACoC;EAC0B,aAAA,CAAA,EAAA,CAAA,KAAA,EADhD,iBACgD,EAAA,GAD1B,OAC0B,CAAA,IAAA,CAAA,GAAA,IAAA;EACC,YAAA,CAAA,EAAA,CAAA,aAAA,EAAA;IACnD,EAAA,EAAA,MAAA;IAAqB,YAAA,EAAA,MAAA;EAAO,CAAA,EAAA,GAFsB,OAEtB,CAAA,IAAA,CAAA,GAAA,IAAA;EAMxC,aAAA,CAAA,EAAY,CAAA,aAAA,EAAA;IACC,EAAA,EAAA,MAAA;IAAuB,YAAA,EAAA,MAAA;EAC9B,CAAA,EAAA,GATyD,OASzD,CAAA,IAAA,CAAA,GAAA,IAAA;EAA2B,YAAA,CAAA,EAAA,CAAA,IAAA,EARrB,gBAQqB,EAAA,GARA,OAQA,CAAA,IAAA,CAAA,GAAA,IAAA;CAAwB;;;;AAEP,KAJlD,YAAA,GAIkD;EAAR,aAAA,EAAA,CAAA,KAAA,EAH7B,kBAG6B,EAAA,GAHN,iBAGM;EAAO,MAAA,EAAA,CAAA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AAA,GAAa,EAAA,UAAY,IAAA,EAAM,gBAAA,KAAqB,OAAA,CAAQ,gBAAA;AAAA;;;;KAMzD,uBAAA;EACH,SAAA;IACE,OAAA,GAAU,KAAA,EAAO,iBAAA,KAAsB,OAAA;MAAU,EAAA;MAAY,YAAA;IAAA;IAC7D,OAAA,GAAU,KAAA;MAAS,EAAA;IAAA,MAAiB,OAAA,CAAQ,gBAAA;IAC5C,WAAA,GAAc,KAAA,EAAO,gBAAA,KAAqB,OAAA;IAC1C,UAAA,GAAa,KAAA;MAAS,EAAA;MAAY,IAAA,EAAM,gBAAA;IAAA,MAAuB,OAAA,CAAQ,gBAAA;EAAA;AAAA;AAAA,iBAI3D,kBAAA,CAAmB,KAAA,EAAO,uBAAA,GAA0B,YAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"create-upload.client.mjs","names":[],"sources":["../../../../src/modules/storage/lib/create-upload.client.ts"],"sourcesContent":["import { generateDefaultUUID } from \"@/modules/config/entry\";\nimport { BulkActionSchema } from \"@/modules/router/entry\";\nimport { PresignFileSchema, SelectNodeSchema, UpdateNodeSchema } from \"./validators\";\n\n/**\n * Upload request\n */\nexport type PrepareUploadInput = Omit<UploadFileRequest, \"id\" | \"name\" | \"size\" | \"contentType\">;\nexport type UploadFileRequest = PresignFileSchema & { file: File };\nexport type UploadHooks = {\n beforePresign?: (input: UploadFileRequest) => Promise<void> | void;\n afterPresign?: (presignResult: { id: string; presignedUrl: string }) => Promise<void> | void;\n beforeConfirm?: (presignResult: { id: string; presignedUrl: string }) => Promise<void> | void;\n afterConfirm?: (node: SelectNodeSchema) => Promise<void> | void;\n};\n\n/**\n * Upload client\n */\nexport type UploadClient = {\n prepareUpload: (input: PrepareUploadInput) => UploadFileRequest;\n upload: (input: UploadFileRequest, hooks?: UploadHooks) => Promise<SelectNodeSchema>;\n deleteFiles: (ids: string[]) => Promise<void>;\n updateNode: (id: string, data: UpdateNodeSchema) => Promise<SelectNodeSchema>;\n};\n\n/**\n * Create upload client\n */\ntype CreateUploadClientProps = {\n endpoints: {\n presign: (input: PresignFileSchema) => Promise<{ id: string; presignedUrl: string }>;\n confirm: (input: { id: string }) => Promise<SelectNodeSchema>;\n deleteNodes: (input: BulkActionSchema) => Promise<void>;\n updateNode: (input: { id: string; data: UpdateNodeSchema }) => Promise<SelectNodeSchema>;\n };\n};\n\nexport function createUploadClient(props: CreateUploadClientProps): UploadClient {\n /**\n * Create input schema for the upload method\n * @param {PrepareUploadInput} input\n * @returns {UploadFileRequest}\n */\n function prepareUpload(input: PrepareUploadInput): UploadFileRequest {\n return {\n ...input,\n id: generateDefaultUUID(),\n name: input.file.name,\n size: input.file.size,\n contentType: input.file.type,\n };\n }\n\n /**\n * Upload file to the server\n * @param {UploadFileRequest} input\n * @returns {Promise<SelectNodeSchema>}\n */\n async function upload(input: UploadFileRequest, hooks?: UploadHooks): Promise<SelectNodeSchema> {\n try {\n /**\n * Presign\n */\n await hooks?.beforePresign?.(input);\n const presignResult = await props.endpoints.presign(input);\n await hooks?.afterPresign?.(presignResult);\n /**\n * Upload the file\n */\n const uploadResponse = await fetch(presignResult.presignedUrl, {\n method: \"PUT\",\n headers: { \"Content-Type\": input.file.type },\n body: input.file,\n });\n\n if (!uploadResponse.ok) {\n const message = await uploadResponse.text();\n throw new Error(`Upload failed: ${message}`);\n }\n\n /**\n * Confirm\n */\n await hooks?.beforeConfirm?.(presignResult);\n const node = await props.endpoints.confirm({ id: presignResult.id });\n await hooks?.afterConfirm?.(node);\n /**\n * Return\n */\n return node;\n } catch (err) {\n console.error(\"Upload error: \", err);\n\n /**\n * Delete if upload failed\n * */\n try {\n await deleteFiles([input.id]);\n } catch (cleanupErr) {\n console.error(\"Cleanup delete failed:\", cleanupErr);\n }\n\n throw err;\n }\n }\n\n /**\n * Delete files\n * @param {string[]} ids\n */\n async function deleteFiles(ids: string[]) {\n await props.endpoints.deleteNodes({ ids });\n }\n\n /**\n * Update node\n * @param {string} id\n * @param {UpdateNodeSchema} data\n */\n async function updateNode(id: string, data: UpdateNodeSchema) {\n return props.endpoints.updateNode({ id, data });\n }\n\n /**\n * Upload client\n */\n return {\n prepareUpload,\n upload,\n deleteFiles,\n updateNode,\n };\n}\n"],"mappings":";;;AAsCA,SAAgB,mBAAmB,OAA8C;;;;;;CAM/E,SAAS,cAAc,OAA8C;AACnE,SAAO;GACL,GAAG;GACH,IAAI,qBAAqB;GACzB,MAAM,MAAM,KAAK;GACjB,MAAM,MAAM,KAAK;GACjB,aAAa,MAAM,KAAK;GACzB;;;;;;;CAQH,eAAe,OAAO,OAA0B,OAAgD;AAC9F,MAAI;;;;AAIF,SAAM,OAAO,gBAAgB,MAAM;GACnC,MAAM,gBAAgB,MAAM,MAAM,UAAU,QAAQ,MAAM;AAC1D,SAAM,OAAO,eAAe,cAAc;;;;GAI1C,MAAM,iBAAiB,MAAM,MAAM,cAAc,cAAc;IAC7D,QAAQ;IACR,SAAS,EAAE,gBAAgB,MAAM,KAAK,MAAM;IAC5C,MAAM,MAAM;IACb,CAAC;AAEF,OAAI,CAAC,eAAe,IAAI;IACtB,MAAM,UAAU,MAAM,eAAe,MAAM;AAC3C,UAAM,IAAI,MAAM,kBAAkB,UAAU;;;;;AAM9C,SAAM,OAAO,gBAAgB,cAAc;GAC3C,MAAM,OAAO,MAAM,MAAM,UAAU,QAAQ,EAAE,IAAI,cAAc,IAAI,CAAC;AACpE,SAAM,OAAO,eAAe,KAAK;;;;AAIjC,UAAO;WACA,KAAK;AACZ,WAAQ,MAAM,kBAAkB,IAAI;;;;AAKpC,OAAI;AACF,UAAM,YAAY,CAAC,MAAM,GAAG,CAAC;YACtB,YAAY;AACnB,YAAQ,MAAM,0BAA0B,WAAW;;AAGrD,SAAM;;;;;;;CAQV,eAAe,YAAY,KAAe;AACxC,QAAM,MAAM,UAAU,YAAY,EAAE,KAAK,CAAC;;;;;;;CAQ5C,eAAe,WAAW,IAAY,MAAwB;AAC5D,SAAO,MAAM,UAAU,WAAW;GAAE;GAAI;GAAM,CAAC;;;;;AAMjD,QAAO;EACL;EACA;EACA;EACA;EACD"}
1
+ {"version":3,"file":"create-upload.client.mjs","names":[],"sources":["../../../../src/modules/storage/lib/create-upload.client.ts"],"sourcesContent":["import { generateDefaultUUID } from \"@/modules/config/entry\";\nimport type { BulkActionSchema } from \"@/modules/router/entry\";\nimport type { PresignFileSchema, SelectNodeSchema, UpdateNodeSchema } from \"./validators\";\n\n/**\n * Upload request\n */\nexport type PrepareUploadInput = Omit<UploadFileRequest, \"id\" | \"name\" | \"size\" | \"contentType\">;\nexport type UploadFileRequest = PresignFileSchema & { file: File };\nexport type UploadHooks = {\n beforePresign?: (input: UploadFileRequest) => Promise<void> | void;\n afterPresign?: (presignResult: { id: string; presignedUrl: string }) => Promise<void> | void;\n beforeConfirm?: (presignResult: { id: string; presignedUrl: string }) => Promise<void> | void;\n afterConfirm?: (node: SelectNodeSchema) => Promise<void> | void;\n};\n\n/**\n * Upload client\n */\nexport type UploadClient = {\n prepareUpload: (input: PrepareUploadInput) => UploadFileRequest;\n upload: (input: UploadFileRequest, hooks?: UploadHooks) => Promise<SelectNodeSchema>;\n deleteFiles: (ids: string[]) => Promise<void>;\n updateNode: (id: string, data: UpdateNodeSchema) => Promise<SelectNodeSchema>;\n};\n\n/**\n * Create upload client\n */\ntype CreateUploadClientProps = {\n endpoints: {\n presign: (input: PresignFileSchema) => Promise<{ id: string; presignedUrl: string }>;\n confirm: (input: { id: string }) => Promise<SelectNodeSchema>;\n deleteNodes: (input: BulkActionSchema) => Promise<void>;\n updateNode: (input: { id: string; data: UpdateNodeSchema }) => Promise<SelectNodeSchema>;\n };\n};\n\nexport function createUploadClient(props: CreateUploadClientProps): UploadClient {\n /**\n * Create input schema for the upload method\n * @param {PrepareUploadInput} input\n * @returns {UploadFileRequest}\n */\n function prepareUpload(input: PrepareUploadInput): UploadFileRequest {\n return {\n ...input,\n id: generateDefaultUUID(),\n name: input.file.name,\n size: input.file.size,\n contentType: input.file.type,\n };\n }\n\n /**\n * Upload file to the server\n * @param {UploadFileRequest} input\n * @returns {Promise<SelectNodeSchema>}\n */\n async function upload(input: UploadFileRequest, hooks?: UploadHooks): Promise<SelectNodeSchema> {\n try {\n /**\n * Presign\n */\n await hooks?.beforePresign?.(input);\n const presignResult = await props.endpoints.presign(input);\n await hooks?.afterPresign?.(presignResult);\n /**\n * Upload the file\n */\n const uploadResponse = await fetch(presignResult.presignedUrl, {\n method: \"PUT\",\n headers: { \"Content-Type\": input.file.type },\n body: input.file,\n });\n\n if (!uploadResponse.ok) {\n const message = await uploadResponse.text();\n throw new Error(`Upload failed: ${message}`);\n }\n\n /**\n * Confirm\n */\n await hooks?.beforeConfirm?.(presignResult);\n const node = await props.endpoints.confirm({ id: presignResult.id });\n await hooks?.afterConfirm?.(node);\n /**\n * Return\n */\n return node;\n } catch (err) {\n console.error(\"Upload error: \", err);\n\n /**\n * Delete if upload failed\n * */\n try {\n await deleteFiles([input.id]);\n } catch (cleanupErr) {\n console.error(\"Cleanup delete failed:\", cleanupErr);\n }\n\n throw err;\n }\n }\n\n /**\n * Delete files\n * @param {string[]} ids\n */\n async function deleteFiles(ids: string[]) {\n await props.endpoints.deleteNodes({ ids });\n }\n\n /**\n * Update node\n * @param {string} id\n * @param {UpdateNodeSchema} data\n */\n async function updateNode(id: string, data: UpdateNodeSchema) {\n return props.endpoints.updateNode({ id, data });\n }\n\n /**\n * Upload client\n */\n return {\n prepareUpload,\n upload,\n deleteFiles,\n updateNode,\n };\n}\n"],"mappings":";;;AAsCA,SAAgB,mBAAmB,OAA8C;;;;;;CAM/E,SAAS,cAAc,OAA8C;AACnE,SAAO;GACL,GAAG;GACH,IAAI,qBAAqB;GACzB,MAAM,MAAM,KAAK;GACjB,MAAM,MAAM,KAAK;GACjB,aAAa,MAAM,KAAK;GACzB;;;;;;;CAQH,eAAe,OAAO,OAA0B,OAAgD;AAC9F,MAAI;;;;AAIF,SAAM,OAAO,gBAAgB,MAAM;GACnC,MAAM,gBAAgB,MAAM,MAAM,UAAU,QAAQ,MAAM;AAC1D,SAAM,OAAO,eAAe,cAAc;;;;GAI1C,MAAM,iBAAiB,MAAM,MAAM,cAAc,cAAc;IAC7D,QAAQ;IACR,SAAS,EAAE,gBAAgB,MAAM,KAAK,MAAM;IAC5C,MAAM,MAAM;IACb,CAAC;AAEF,OAAI,CAAC,eAAe,IAAI;IACtB,MAAM,UAAU,MAAM,eAAe,MAAM;AAC3C,UAAM,IAAI,MAAM,kBAAkB,UAAU;;;;;AAM9C,SAAM,OAAO,gBAAgB,cAAc;GAC3C,MAAM,OAAO,MAAM,MAAM,UAAU,QAAQ,EAAE,IAAI,cAAc,IAAI,CAAC;AACpE,SAAM,OAAO,eAAe,KAAK;;;;AAIjC,UAAO;WACA,KAAK;AACZ,WAAQ,MAAM,kBAAkB,IAAI;;;;AAKpC,OAAI;AACF,UAAM,YAAY,CAAC,MAAM,GAAG,CAAC;YACtB,YAAY;AACnB,YAAQ,MAAM,0BAA0B,WAAW;;AAGrD,SAAM;;;;;;;CAQV,eAAe,YAAY,KAAe;AACxC,QAAM,MAAM,UAAU,YAAY,EAAE,KAAK,CAAC;;;;;;;CAQ5C,eAAe,WAAW,IAAY,MAAwB;AAC5D,SAAO,MAAM,UAAU,WAAW;GAAE;GAAI;GAAM,CAAC;;;;;AAMjD,QAAO;EACL;EACA;EACA;EACA;EACD"}
@@ -3,7 +3,6 @@ import { CreateNodeSchema, GetFileURLSchema, Node } from "./validators.mjs";
3
3
  import { ImageLoaderProps } from "next/image";
4
4
 
5
5
  //#region src/modules/storage/lib/helpers.d.ts
6
-
7
6
  /**
8
7
  * Check if the node is a file
9
8
  */
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.d.mts","names":[],"sources":["../../../../src/modules/storage/lib/helpers.ts"],"sourcesContent":[],"mappings":";;;;;;;;AAOA;AAAkC,iBAAlB,MAAA,CAAkB,IAAA,EAAL,IAAK,CAAA,IAAA,EAAA,MAAA,CAAA,CAAA,EAAA,IAAA,IAAwB,IAAxB;;;;AAOlB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1C,YAAA;AAAA,KAUD,WAAA,WAAsB,YAAA;AAAA,iBAElB,gBAAA,CAAA;EACd,IAAA;EACA;AAAA,GACC,IAAA,CAAK,gBAAA,4BAA4C,WAAA;;;;iBAqBpC,WAAA,CAAY,KAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.mjs","names":[],"sources":["../../../../src/modules/storage/lib/helpers.ts"],"sourcesContent":["import { ImageLoaderProps } from \"next/image\";\nimport { ImageVariant } from \"./constants\";\nimport { CreateNodeSchema, GetFileURLSchema, Node } from \"./validators\";\n\n/**\n * Check if the node is a file\n */\nexport function isFile(node: Pick<Node, \"type\">): node is Node {\n return node.type === \"file\";\n}\n\n/**\n * Check if the node is a folder\n */\nexport function isFolder(node: Pick<Node, \"type\">): node is Node {\n return node.type === \"folder\";\n}\n\n/**\n * Get file url\n */\nexport function getFileUrl(id: string, options: Partial<GetFileURLSchema> = {}) {\n const searchParams = new URLSearchParams();\n searchParams.set(\"id\", id);\n if (options?.variant) searchParams.set(\"variant\", options.variant);\n if (options?.disposition) searchParams.set(\"disposition\", options.disposition);\n\n return `/api/storage/files?${searchParams.toString()}`;\n}\n\n/**\n * Image loader\n */\nexport function imageLoader({ src, width }: ImageLoaderProps) {\n const url = new URL(src, window.location.origin);\n url.searchParams.set(\"variant\", `preview-${width}`);\n return url.toString();\n}\n\n/**\n * Generate object key\n */\nexport function getDriveBucketKey(id: string, variant: ImageVariant) {\n return `storage/${id}/${variant}`;\n}\n\n/**\n * Node subtype\n */\nexport const nodeSubtypes = [\n \"image\",\n \"document\",\n \"spreadsheet\",\n \"video\",\n \"audio\",\n \"archive\",\n \"other\",\n] as const;\n\nexport type NodeSubtype = (typeof nodeSubtypes)[number];\n\nexport function inferNodeSubtype({\n name,\n contentType,\n}: Pick<CreateNodeSchema, \"name\" | \"contentType\">): NodeSubtype {\n if (!contentType) return \"other\";\n if (contentType?.startsWith(\"image/\")) return \"image\";\n if (contentType === \"application/pdf\") return \"document\";\n if (contentType?.includes(\"spreadsheet\")) return \"spreadsheet\";\n if (contentType?.startsWith(\"video/\")) return \"video\";\n if (contentType?.startsWith(\"audio/\")) return \"audio\";\n if (contentType?.includes(\"zip\") || contentType?.includes(\"archive\")) return \"archive\";\n\n const ext = name.split(\".\").pop()?.toLowerCase();\n if ([\"jpg\", \"jpeg\", \"png\", \"gif\", \"bmp\", \"webp\"].includes(ext ?? \"\")) return \"image\";\n if ([\"pdf\", \"doc\", \"docx\", \"txt\"].includes(ext ?? \"\")) return \"document\";\n if ([\"xls\", \"xlsx\", \"ods\"].includes(ext ?? \"\")) return \"spreadsheet\";\n if ([\"zip\", \"rar\", \"7z\"].includes(ext ?? \"\")) return \"archive\";\n\n return \"other\";\n}\n\n/**\n * Render bytes\n */\nexport function renderBytes(bytes: number) {\n const units = [\"B\", \"KB\", \"MB\", \"GB\", \"TB\", \"PB\"];\n\n let size = bytes;\n let unitIndex = 0;\n\n while (size >= 1024 && unitIndex < units.length - 1) {\n size /= 1024;\n unitIndex++;\n }\n\n return `${size.toFixed(2)}${units[unitIndex]}`;\n}\n"],"mappings":";;;;AAOA,SAAgB,OAAO,MAAwC;AAC7D,QAAO,KAAK,SAAS;;;;;AAMvB,SAAgB,SAAS,MAAwC;AAC/D,QAAO,KAAK,SAAS;;;;;AAMvB,SAAgB,WAAW,IAAY,UAAqC,EAAE,EAAE;CAC9E,MAAM,eAAe,IAAI,iBAAiB;AAC1C,cAAa,IAAI,MAAM,GAAG;AAC1B,KAAI,SAAS,QAAS,cAAa,IAAI,WAAW,QAAQ,QAAQ;AAClE,KAAI,SAAS,YAAa,cAAa,IAAI,eAAe,QAAQ,YAAY;AAE9E,QAAO,sBAAsB,aAAa,UAAU;;;;;AAMtD,SAAgB,YAAY,EAAE,KAAK,SAA2B;CAC5D,MAAM,MAAM,IAAI,IAAI,KAAK,OAAO,SAAS,OAAO;AAChD,KAAI,aAAa,IAAI,WAAW,WAAW,QAAQ;AACnD,QAAO,IAAI,UAAU;;;;;AAMvB,SAAgB,kBAAkB,IAAY,SAAuB;AACnE,QAAO,WAAW,GAAG,GAAG;;;;;AAM1B,MAAa,eAAe;CAC1B;CACA;CACA;CACA;CACA;CACA;CACA;CACD;AAID,SAAgB,iBAAiB,EAC/B,MACA,eAC8D;AAC9D,KAAI,CAAC,YAAa,QAAO;AACzB,KAAI,aAAa,WAAW,SAAS,CAAE,QAAO;AAC9C,KAAI,gBAAgB,kBAAmB,QAAO;AAC9C,KAAI,aAAa,SAAS,cAAc,CAAE,QAAO;AACjD,KAAI,aAAa,WAAW,SAAS,CAAE,QAAO;AAC9C,KAAI,aAAa,WAAW,SAAS,CAAE,QAAO;AAC9C,KAAI,aAAa,SAAS,MAAM,IAAI,aAAa,SAAS,UAAU,CAAE,QAAO;CAE7E,MAAM,MAAM,KAAK,MAAM,IAAI,CAAC,KAAK,EAAE,aAAa;AAChD,KAAI;EAAC;EAAO;EAAQ;EAAO;EAAO;EAAO;EAAO,CAAC,SAAS,OAAO,GAAG,CAAE,QAAO;AAC7E,KAAI;EAAC;EAAO;EAAO;EAAQ;EAAM,CAAC,SAAS,OAAO,GAAG,CAAE,QAAO;AAC9D,KAAI;EAAC;EAAO;EAAQ;EAAM,CAAC,SAAS,OAAO,GAAG,CAAE,QAAO;AACvD,KAAI;EAAC;EAAO;EAAO;EAAK,CAAC,SAAS,OAAO,GAAG,CAAE,QAAO;AAErD,QAAO;;;;;AAMT,SAAgB,YAAY,OAAe;CACzC,MAAM,QAAQ;EAAC;EAAK;EAAM;EAAM;EAAM;EAAM;EAAK;CAEjD,IAAI,OAAO;CACX,IAAI,YAAY;AAEhB,QAAO,QAAQ,QAAQ,YAAY,MAAM,SAAS,GAAG;AACnD,UAAQ;AACR;;AAGF,QAAO,GAAG,KAAK,QAAQ,EAAE,GAAG,MAAM"}
1
+ {"version":3,"file":"helpers.mjs","names":[],"sources":["../../../../src/modules/storage/lib/helpers.ts"],"sourcesContent":["import type { ImageLoaderProps } from \"next/image\";\nimport type { ImageVariant } from \"./constants\";\nimport type { CreateNodeSchema, GetFileURLSchema, Node } from \"./validators\";\n\n/**\n * Check if the node is a file\n */\nexport function isFile(node: Pick<Node, \"type\">): node is Node {\n return node.type === \"file\";\n}\n\n/**\n * Check if the node is a folder\n */\nexport function isFolder(node: Pick<Node, \"type\">): node is Node {\n return node.type === \"folder\";\n}\n\n/**\n * Get file url\n */\nexport function getFileUrl(id: string, options: Partial<GetFileURLSchema> = {}) {\n const searchParams = new URLSearchParams();\n searchParams.set(\"id\", id);\n if (options?.variant) searchParams.set(\"variant\", options.variant);\n if (options?.disposition) searchParams.set(\"disposition\", options.disposition);\n\n return `/api/storage/files?${searchParams.toString()}`;\n}\n\n/**\n * Image loader\n */\nexport function imageLoader({ src, width }: ImageLoaderProps) {\n const url = new URL(src, window.location.origin);\n url.searchParams.set(\"variant\", `preview-${width}`);\n return url.toString();\n}\n\n/**\n * Generate object key\n */\nexport function getDriveBucketKey(id: string, variant: ImageVariant) {\n return `storage/${id}/${variant}`;\n}\n\n/**\n * Node subtype\n */\nexport const nodeSubtypes = [\n \"image\",\n \"document\",\n \"spreadsheet\",\n \"video\",\n \"audio\",\n \"archive\",\n \"other\",\n] as const;\n\nexport type NodeSubtype = (typeof nodeSubtypes)[number];\n\nexport function inferNodeSubtype({\n name,\n contentType,\n}: Pick<CreateNodeSchema, \"name\" | \"contentType\">): NodeSubtype {\n if (!contentType) return \"other\";\n if (contentType?.startsWith(\"image/\")) return \"image\";\n if (contentType === \"application/pdf\") return \"document\";\n if (contentType?.includes(\"spreadsheet\")) return \"spreadsheet\";\n if (contentType?.startsWith(\"video/\")) return \"video\";\n if (contentType?.startsWith(\"audio/\")) return \"audio\";\n if (contentType?.includes(\"zip\") || contentType?.includes(\"archive\")) return \"archive\";\n\n const ext = name.split(\".\").pop()?.toLowerCase();\n if ([\"jpg\", \"jpeg\", \"png\", \"gif\", \"bmp\", \"webp\"].includes(ext ?? \"\")) return \"image\";\n if ([\"pdf\", \"doc\", \"docx\", \"txt\"].includes(ext ?? \"\")) return \"document\";\n if ([\"xls\", \"xlsx\", \"ods\"].includes(ext ?? \"\")) return \"spreadsheet\";\n if ([\"zip\", \"rar\", \"7z\"].includes(ext ?? \"\")) return \"archive\";\n\n return \"other\";\n}\n\n/**\n * Render bytes\n */\nexport function renderBytes(bytes: number) {\n const units = [\"B\", \"KB\", \"MB\", \"GB\", \"TB\", \"PB\"];\n\n let size = bytes;\n let unitIndex = 0;\n\n while (size >= 1024 && unitIndex < units.length - 1) {\n size /= 1024;\n unitIndex++;\n }\n\n return `${size.toFixed(2)}${units[unitIndex]}`;\n}\n"],"mappings":";;;;AAOA,SAAgB,OAAO,MAAwC;AAC7D,QAAO,KAAK,SAAS;;;;;AAMvB,SAAgB,SAAS,MAAwC;AAC/D,QAAO,KAAK,SAAS;;;;;AAMvB,SAAgB,WAAW,IAAY,UAAqC,EAAE,EAAE;CAC9E,MAAM,eAAe,IAAI,iBAAiB;AAC1C,cAAa,IAAI,MAAM,GAAG;AAC1B,KAAI,SAAS,QAAS,cAAa,IAAI,WAAW,QAAQ,QAAQ;AAClE,KAAI,SAAS,YAAa,cAAa,IAAI,eAAe,QAAQ,YAAY;AAE9E,QAAO,sBAAsB,aAAa,UAAU;;;;;AAMtD,SAAgB,YAAY,EAAE,KAAK,SAA2B;CAC5D,MAAM,MAAM,IAAI,IAAI,KAAK,OAAO,SAAS,OAAO;AAChD,KAAI,aAAa,IAAI,WAAW,WAAW,QAAQ;AACnD,QAAO,IAAI,UAAU;;;;;AAMvB,SAAgB,kBAAkB,IAAY,SAAuB;AACnE,QAAO,WAAW,GAAG,GAAG;;;;;AAM1B,MAAa,eAAe;CAC1B;CACA;CACA;CACA;CACA;CACA;CACA;CACD;AAID,SAAgB,iBAAiB,EAC/B,MACA,eAC8D;AAC9D,KAAI,CAAC,YAAa,QAAO;AACzB,KAAI,aAAa,WAAW,SAAS,CAAE,QAAO;AAC9C,KAAI,gBAAgB,kBAAmB,QAAO;AAC9C,KAAI,aAAa,SAAS,cAAc,CAAE,QAAO;AACjD,KAAI,aAAa,WAAW,SAAS,CAAE,QAAO;AAC9C,KAAI,aAAa,WAAW,SAAS,CAAE,QAAO;AAC9C,KAAI,aAAa,SAAS,MAAM,IAAI,aAAa,SAAS,UAAU,CAAE,QAAO;CAE7E,MAAM,MAAM,KAAK,MAAM,IAAI,CAAC,KAAK,EAAE,aAAa;AAChD,KAAI;EAAC;EAAO;EAAQ;EAAO;EAAO;EAAO;EAAO,CAAC,SAAS,OAAO,GAAG,CAAE,QAAO;AAC7E,KAAI;EAAC;EAAO;EAAO;EAAQ;EAAM,CAAC,SAAS,OAAO,GAAG,CAAE,QAAO;AAC9D,KAAI;EAAC;EAAO;EAAQ;EAAM,CAAC,SAAS,OAAO,GAAG,CAAE,QAAO;AACvD,KAAI;EAAC;EAAO;EAAO;EAAK,CAAC,SAAS,OAAO,GAAG,CAAE,QAAO;AAErD,QAAO;;;;;AAMT,SAAgB,YAAY,OAAe;CACzC,MAAM,QAAQ;EAAC;EAAK;EAAM;EAAM;EAAM;EAAM;EAAK;CAEjD,IAAI,OAAO;CACX,IAAI,YAAY;AAEhB,QAAO,QAAQ,QAAQ,YAAY,MAAM,SAAS,GAAG;AACnD,UAAQ;AACR;;AAGF,QAAO,GAAG,KAAK,QAAQ,EAAE,GAAG,MAAM"}
@@ -1 +1 @@
1
- {"version":3,"file":"proxy.server.d.mts","names":[],"sources":["../../../../src/modules/storage/lib/proxy.server.ts"],"sourcesContent":[],"mappings":";;;;;;;KASK,2CAA2C;WACrC,aAAa;;AAJsB;;;AAInC,iBAMK,qBANL,CAAA,gBAM2C,WAN3C,CAAA,CAAA;EAAA;AAAA,CAAA,EAQR,0BARQ,CAQmB,OARnB,CAAA,CAAA,EAAA;EAAY,GAAA,EAAA,CAAA,OAAA,EAYO,WAZP,EAAA,GAYkB,OAZlB,CAYkB,QAZlB,CAAA;AAMvB,CAAA"}
1
+ {"version":3,"file":"proxy.server.d.mts","names":[],"sources":["../../../../src/modules/storage/lib/proxy.server.ts"],"mappings":";;;;;;;KASK,0BAAA,iBAA2C,WAAA;EAC9C,OAAA,EAAS,YAAA,CAAa,OAAA;AAAA;AAJ2B;;;AAAA,iBAUnC,qBAAA,iBAAsC,WAAA,CAAA,CAAA;EACpD;AAAA,GACC,0BAAA,CAA2B,OAAA;iBAIA,WAAA,KAAW,OAAA,CAAA,QAAA;AAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"proxy.server.mjs","names":[],"sources":["../../../../src/modules/storage/lib/proxy.server.ts"],"sourcesContent":["import \"server-cli-only\";\n\nimport { getSession } from \"@/modules/auth/entry.server\";\nimport { TulipContext } from \"@/modules/config/entry\";\nimport { eq } from \"drizzle-orm\";\nimport { connection, NextRequest } from \"next/server\";\nimport { DriveSchema, nodes } from \"./schema\";\nimport { getFileURLSchema } from \"./validators\";\n\ntype CreateDriveProxyRouteProps<TSchema extends DriveSchema> = {\n context: TulipContext<TSchema>;\n};\n\n/**\n * Create drive proxy route\n */\nexport function createDriveProxyRoute<TSchema extends DriveSchema>({\n context,\n}: CreateDriveProxyRouteProps<TSchema>) {\n /**\n * GET: Drive node proxy\n */\n async function GET(request: NextRequest) {\n // Make endpoint dynamic\n await connection();\n\n try {\n // Get the params\n const searchParams = request.nextUrl.searchParams;\n const id = searchParams.get(\"id\");\n if (!id) return Response.json(\"Missing id\", { status: 400 });\n\n console.info(\"Proxying file: \", id);\n\n // Get the node\n const [node] = await context.db.select().from(nodes).where(eq(nodes.id, id));\n if (!node) return Response.json(\"Bestand kon niet worden gevonden\", { status: 404 });\n\n // If the node is private check if the user is authenticated\n if (node.mode === \"private\") {\n const session = await getSession(context);\n if (!session) return Response.json(\"Unauthorized\", { status: 401 });\n }\n\n const variant = searchParams.get(\"variant\") ?? undefined;\n const disposition = searchParams.get(\"disposition\") ?? undefined;\n\n // Parse the options\n const options = getFileURLSchema.parse({ variant, disposition });\n\n // Get the file url\n const url = await context.storage.getSignedURL(node, options);\n\n // Return the file\n return Response.redirect(url, 307);\n } catch (error) {\n console.error(\"error\", error);\n return Response.json(\"Error\", { status: 500 });\n }\n }\n\n return { GET };\n}\n"],"mappings":";;;;;;;;;;;AAgBA,SAAgB,sBAAmD,EACjE,WACsC;;;;CAItC,eAAe,IAAI,SAAsB;AAEvC,QAAM,YAAY;AAElB,MAAI;GAEF,MAAM,eAAe,QAAQ,QAAQ;GACrC,MAAM,KAAK,aAAa,IAAI,KAAK;AACjC,OAAI,CAAC,GAAI,QAAO,SAAS,KAAK,cAAc,EAAE,QAAQ,KAAK,CAAC;AAE5D,WAAQ,KAAK,mBAAmB,GAAG;GAGnC,MAAM,CAAC,QAAQ,MAAM,QAAQ,GAAG,QAAQ,CAAC,KAAK,MAAM,CAAC,MAAM,GAAG,MAAM,IAAI,GAAG,CAAC;AAC5E,OAAI,CAAC,KAAM,QAAO,SAAS,KAAK,oCAAoC,EAAE,QAAQ,KAAK,CAAC;AAGpF,OAAI,KAAK,SAAS,WAEhB;QAAI,CADY,MAAM,WAAW,QAAQ,CAC3B,QAAO,SAAS,KAAK,gBAAgB,EAAE,QAAQ,KAAK,CAAC;;GAGrE,MAAM,UAAU,aAAa,IAAI,UAAU,IAAI;GAC/C,MAAM,cAAc,aAAa,IAAI,cAAc,IAAI;GAGvD,MAAM,UAAU,iBAAiB,MAAM;IAAE;IAAS;IAAa,CAAC;GAGhE,MAAM,MAAM,MAAM,QAAQ,QAAQ,aAAa,MAAM,QAAQ;AAG7D,UAAO,SAAS,SAAS,KAAK,IAAI;WAC3B,OAAO;AACd,WAAQ,MAAM,SAAS,MAAM;AAC7B,UAAO,SAAS,KAAK,SAAS,EAAE,QAAQ,KAAK,CAAC;;;AAIlD,QAAO,EAAE,KAAK"}
1
+ {"version":3,"file":"proxy.server.mjs","names":[],"sources":["../../../../src/modules/storage/lib/proxy.server.ts"],"sourcesContent":["import \"server-cli-only\";\n\nimport { eq } from \"drizzle-orm\";\nimport { connection, type NextRequest } from \"next/server\";\nimport { getSession } from \"@/modules/auth/entry.server\";\nimport type { TulipContext } from \"@/modules/config/entry\";\nimport { type DriveSchema, nodes } from \"./schema\";\nimport { getFileURLSchema } from \"./validators\";\n\ntype CreateDriveProxyRouteProps<TSchema extends DriveSchema> = {\n context: TulipContext<TSchema>;\n};\n\n/**\n * Create drive proxy route\n */\nexport function createDriveProxyRoute<TSchema extends DriveSchema>({\n context,\n}: CreateDriveProxyRouteProps<TSchema>) {\n /**\n * GET: Drive node proxy\n */\n async function GET(request: NextRequest) {\n // Make endpoint dynamic\n await connection();\n\n try {\n // Get the params\n const searchParams = request.nextUrl.searchParams;\n const id = searchParams.get(\"id\");\n if (!id) return Response.json(\"Missing id\", { status: 400 });\n\n console.info(\"Proxying file: \", id);\n\n // Get the node\n const [node] = await context.db.select().from(nodes).where(eq(nodes.id, id));\n if (!node) return Response.json(\"Bestand kon niet worden gevonden\", { status: 404 });\n\n // If the node is private check if the user is authenticated\n if (node.mode === \"private\") {\n const session = await getSession(context);\n if (!session) return Response.json(\"Unauthorized\", { status: 401 });\n }\n\n const variant = searchParams.get(\"variant\") ?? undefined;\n const disposition = searchParams.get(\"disposition\") ?? undefined;\n\n // Parse the options\n const options = getFileURLSchema.parse({ variant, disposition });\n\n // Get the file url\n const url = await context.storage.getSignedURL(node, options);\n\n // Return the file\n return Response.redirect(url, 307);\n } catch (error) {\n console.error(\"error\", error);\n return Response.json(\"Error\", { status: 500 });\n }\n }\n\n return { GET };\n}\n"],"mappings":";;;;;;;;;;;AAgBA,SAAgB,sBAAmD,EACjE,WACsC;;;;CAItC,eAAe,IAAI,SAAsB;AAEvC,QAAM,YAAY;AAElB,MAAI;GAEF,MAAM,eAAe,QAAQ,QAAQ;GACrC,MAAM,KAAK,aAAa,IAAI,KAAK;AACjC,OAAI,CAAC,GAAI,QAAO,SAAS,KAAK,cAAc,EAAE,QAAQ,KAAK,CAAC;AAE5D,WAAQ,KAAK,mBAAmB,GAAG;GAGnC,MAAM,CAAC,QAAQ,MAAM,QAAQ,GAAG,QAAQ,CAAC,KAAK,MAAM,CAAC,MAAM,GAAG,MAAM,IAAI,GAAG,CAAC;AAC5E,OAAI,CAAC,KAAM,QAAO,SAAS,KAAK,oCAAoC,EAAE,QAAQ,KAAK,CAAC;AAGpF,OAAI,KAAK,SAAS,WAEhB;QAAI,CADY,MAAM,WAAW,QAAQ,CAC3B,QAAO,SAAS,KAAK,gBAAgB,EAAE,QAAQ,KAAK,CAAC;;GAGrE,MAAM,UAAU,aAAa,IAAI,UAAU,IAAI;GAC/C,MAAM,cAAc,aAAa,IAAI,cAAc,IAAI;GAGvD,MAAM,UAAU,iBAAiB,MAAM;IAAE;IAAS;IAAa,CAAC;GAGhE,MAAM,MAAM,MAAM,QAAQ,QAAQ,aAAa,MAAM,QAAQ;AAG7D,UAAO,SAAS,SAAS,KAAK,IAAI;WAC3B,OAAO;AACd,WAAQ,MAAM,SAAS,MAAM;AAC7B,UAAO,SAAS,KAAK,SAAS,EAAE,QAAQ,KAAK,CAAC;;;AAIlD,QAAO,EAAE,KAAK"}
@@ -1,8 +1,8 @@
1
1
  import { ProtectedRPCContext, RPCContext } from "../../router/handler/context.server.mjs";
2
2
  import "../../../router/server.mjs";
3
3
  import * as _orpc_server0 from "@orpc/server";
4
- import * as drizzle_orm_pg_core0 from "drizzle-orm/pg-core";
5
4
  import * as drizzle_orm0 from "drizzle-orm";
5
+ import * as drizzle_orm_pg_core0 from "drizzle-orm/pg-core";
6
6
  import * as drizzle_zod0 from "drizzle-zod";
7
7
  import { z as z$1 } from "zod";
8
8
  import * as _orpc_contract0 from "@orpc/contract";
@@ -9386,44 +9386,44 @@ declare function createDriveBaseProcedures(): {
9386
9386
  id: z$1.ZodNullable<z$1.ZodString>;
9387
9387
  namespace: z$1.ZodString;
9388
9388
  }, z$1.core.$strip>, _orpc_contract0.Schema<(Pick<{
9389
- name: string;
9390
- namespace: string;
9389
+ id: string;
9390
+ readonly: boolean | null;
9391
9391
  type: "file" | "folder" | null;
9392
+ createdAt: Date;
9393
+ updatedAt: Date;
9394
+ name: string;
9392
9395
  mode: "private" | "public" | null;
9396
+ isPending: boolean;
9397
+ namespace: string;
9393
9398
  subtype: "image" | "document" | "spreadsheet" | "video" | "audio" | "archive" | "other";
9394
9399
  size: number | null;
9395
9400
  contentType: string | null;
9396
- readonly: boolean | null;
9397
9401
  hidden: boolean | null;
9398
- id: string;
9399
- createdAt: Date;
9400
- updatedAt: Date;
9401
9402
  createdBy: string | null;
9402
- isPending: boolean;
9403
9403
  isDeleted: boolean;
9404
9404
  orphanedAt: Date | null;
9405
9405
  parentId: string | null;
9406
- }, "name" | "id" | "parentId"> & {
9406
+ }, "id" | "name" | "parentId"> & {
9407
9407
  depth: number;
9408
9408
  })[], (Pick<{
9409
- name: string;
9410
- namespace: string;
9409
+ id: string;
9410
+ readonly: boolean | null;
9411
9411
  type: "file" | "folder" | null;
9412
+ createdAt: Date;
9413
+ updatedAt: Date;
9414
+ name: string;
9412
9415
  mode: "private" | "public" | null;
9416
+ isPending: boolean;
9417
+ namespace: string;
9413
9418
  subtype: "image" | "document" | "spreadsheet" | "video" | "audio" | "archive" | "other";
9414
9419
  size: number | null;
9415
9420
  contentType: string | null;
9416
- readonly: boolean | null;
9417
9421
  hidden: boolean | null;
9418
- id: string;
9419
- createdAt: Date;
9420
- updatedAt: Date;
9421
9422
  createdBy: string | null;
9422
- isPending: boolean;
9423
9423
  isDeleted: boolean;
9424
9424
  orphanedAt: Date | null;
9425
9425
  parentId: string | null;
9426
- }, "name" | "id" | "parentId"> & {
9426
+ }, "id" | "name" | "parentId"> & {
9427
9427
  depth: number;
9428
9428
  })[]>, Record<never, never>, Record<never, never>>;
9429
9429
  /**
@@ -15244,12 +15244,16 @@ declare function createDriveBaseProcedures(): {
15244
15244
  node: drizzle_orm0.One<"nodes", true>;
15245
15245
  }>;
15246
15246
  }>>, z$1.ZodObject<{
15247
+ readonly: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodBoolean>>;
15248
+ createdAt: z$1.ZodOptional<z$1.ZodDate>;
15249
+ updatedAt: z$1.ZodOptional<z$1.ZodDate>;
15247
15250
  name: z$1.ZodString;
15248
- namespace: z$1.ZodString;
15249
15251
  mode: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodEnum<{
15250
15252
  private: "private";
15251
15253
  public: "public";
15252
15254
  }>>>;
15255
+ isPending: z$1.ZodOptional<z$1.ZodBoolean>;
15256
+ namespace: z$1.ZodString;
15253
15257
  subtype: z$1.ZodOptional<z$1.ZodEnum<{
15254
15258
  image: "image";
15255
15259
  document: "document";
@@ -15261,12 +15265,8 @@ declare function createDriveBaseProcedures(): {
15261
15265
  }>>;
15262
15266
  size: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodInt>>;
15263
15267
  contentType: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
15264
- readonly: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodBoolean>>;
15265
15268
  hidden: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodBoolean>>;
15266
- createdAt: z$1.ZodOptional<z$1.ZodDate>;
15267
- updatedAt: z$1.ZodOptional<z$1.ZodDate>;
15268
15269
  createdBy: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodUUID>>;
15269
- isPending: z$1.ZodOptional<z$1.ZodBoolean>;
15270
15270
  isDeleted: z$1.ZodOptional<z$1.ZodBoolean>;
15271
15271
  orphanedAt: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodDate>>;
15272
15272
  parentId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodUUID>>;
@@ -21380,19 +21380,19 @@ declare function createDriveBaseProcedures(): {
21380
21380
  node: drizzle_orm0.One<"nodes", true>;
21381
21381
  }>;
21382
21382
  }>>, z$1.ZodObject<{
21383
+ id: z$1.ZodOptional<z$1.ZodUUID>;
21384
+ readonly: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodBoolean>>;
21385
+ createdAt: z$1.ZodOptional<z$1.ZodDate>;
21386
+ updatedAt: z$1.ZodOptional<z$1.ZodDate>;
21383
21387
  name: z$1.ZodString;
21384
- namespace: z$1.ZodString;
21385
21388
  mode: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodEnum<{
21386
21389
  private: "private";
21387
21390
  public: "public";
21388
21391
  }>>>;
21389
- readonly: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodBoolean>>;
21392
+ isPending: z$1.ZodOptional<z$1.ZodBoolean>;
21393
+ namespace: z$1.ZodString;
21390
21394
  hidden: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodBoolean>>;
21391
- id: z$1.ZodOptional<z$1.ZodUUID>;
21392
- createdAt: z$1.ZodOptional<z$1.ZodDate>;
21393
- updatedAt: z$1.ZodOptional<z$1.ZodDate>;
21394
21395
  createdBy: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodUUID>>;
21395
- isPending: z$1.ZodOptional<z$1.ZodBoolean>;
21396
21396
  isDeleted: z$1.ZodOptional<z$1.ZodBoolean>;
21397
21397
  orphanedAt: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodDate>>;
21398
21398
  parentId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodUUID>>;
@@ -1 +1 @@
1
- {"version":3,"file":"router.server.d.mts","names":[],"sources":["../../../../src/modules/storage/lib/router.server.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;iBAsBgB,yBAAA,CAAA;;;;;;MAAA,IAAA,EAAA,OAAA;MAAyB,MAAA,EAAA,SAAA;;cAAA,oBAAA,CAAA"}
1
+ {"version":3,"file":"router.server.d.mts","names":[],"sources":["../../../../src/modules/storage/lib/router.server.ts"],"mappings":";;;;;;;;;;;;;iBAsBgB,yBAAA,CAAA;;;;;;;;;cAAyB,oBAAA,CAAA,QAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"router.server.mjs","names":["z"],"sources":["../../../../src/modules/storage/lib/router.server.ts"],"sourcesContent":["import { bulkActionSchema } from \"@/modules/router/entry\";\nimport { ServerError } from \"@/modules/router/entry.server\";\nimport { initRPC } from \"@/modules/router/handler/init.server\";\nimport { and, eq, sql } from \"drizzle-orm\";\nimport { QueryResult } from \"pg\";\nimport { z } from \"zod\";\nimport { isFolder } from \"./helpers\";\nimport { DriveSchema, nodes } from \"./schema\";\nimport {\n createFolderNodeSchema,\n getFileURLSchema,\n getNodesByParentIdSchema,\n Node,\n presignFileSchema,\n selectNodeSchema,\n selectNodeWithChildrenSchema,\n updateNodeSchema,\n} from \"./validators\";\n\n/**\n * Create Drive base procedures\n */\nexport function createDriveBaseProcedures() {\n const { protectedProcedure } = initRPC<DriveSchema>();\n\n return {\n /**\n * Get node and its children\n */\n getNodeById: protectedProcedure\n .input(z.object({ id: z.string(), namespace: z.string() }))\n .output(selectNodeWithChildrenSchema.optional())\n .handler(async ({ context, input }) =>\n context.db.query.nodes.findFirst({\n where: and(eq(nodes.id, input.id), eq(nodes.namespace, input.namespace)),\n with: { children: true },\n }),\n ),\n /**\n * Get folders by parent id\n */\n getNodesByParentId: protectedProcedure\n .input(getNodesByParentIdSchema)\n .output(z.array(selectNodeSchema))\n .handler(async ({ context, input }) => context.storage.getNodesByParentId(input)),\n /**\n * Get parents of a folder\n */\n getFolderParents: protectedProcedure\n .input(z.object({ id: z.string().nullable(), namespace: z.string() }))\n .handler(async ({ context, input }) => {\n if (!input.id) return [];\n\n const startNodeQuery = context.db\n .select({\n id: nodes.id,\n name: nodes.name,\n parentId: nodes.parentId,\n depth: sql<number>`0`.as(\"depth\"),\n })\n .from(nodes)\n .where(and(eq(nodes.id, input.id), eq(nodes.namespace, input.namespace)));\n\n const alias = \"parent_nodes\";\n const parentNodesQueryAlias = startNodeQuery.as(alias);\n const recursiveQueryName = sql.raw(`\"${alias}\"`);\n\n const recursiveQuery = startNodeQuery.unionAll(\n context.db\n .select({\n id: nodes.id,\n name: nodes.name,\n parentId: nodes.parentId,\n depth: sql<number>`${parentNodesQueryAlias.depth} + 1`,\n })\n .from(nodes)\n .innerJoin(recursiveQueryName, eq(nodes.id, parentNodesQueryAlias.parentId)),\n );\n\n const result = (await context.db.execute(\n sql`WITH RECURSIVE ${recursiveQueryName} AS ${recursiveQuery} SELECT * FROM ${recursiveQueryName}`,\n )) as QueryResult<Pick<Node, \"id\" | \"name\" | \"parentId\"> & { depth: number }>;\n\n return result?.rows?.toSorted((a, b) => Number(b.depth) - Number(a.depth)) ?? [];\n }),\n /**\n * Get presigned url for opening a file\n */\n getSignedURL: protectedProcedure\n .input(getFileURLSchema.extend({ id: z.string() }))\n .output(z.string().nullable())\n .handler(async ({ context, input: { id, ...options } }) => {\n const [node] = await context.db.select().from(nodes).where(eq(nodes.id, id));\n if (!node) return null;\n\n return await context.storage.getSignedURL(node, options);\n }),\n\n /**\n * Get presigned url for uploading a file\n */\n presign: protectedProcedure\n .input(presignFileSchema)\n .output(z.object({ id: z.string(), presignedUrl: z.string() }))\n .handler(async ({ context, input }) => context.storage.presignUpload(input)),\n /**\n * Confirm the upload\n */\n confirm: protectedProcedure\n .input(z.object({ id: z.string() }))\n .output(selectNodeSchema)\n .handler(async ({ context, input }) => context.storage.confirmUpload(input)),\n /**\n * Create a folder\n */\n createFolder: protectedProcedure\n .input(createFolderNodeSchema)\n .output(selectNodeSchema)\n .handler(async ({ context, input }) => context.storage.createFolder(input)),\n /**\n * Update node\n */\n updateNode: protectedProcedure\n .input(z.object({ id: z.string(), data: updateNodeSchema }))\n .output(selectNodeSchema)\n .handler(async ({ context, input }) => context.storage.updateNode(input)),\n /**\n * Change node parent\n */\n changeParent: protectedProcedure\n .input(z.object({ id: z.string(), parentId: z.string().nullish() }))\n .handler(async ({ context, input }) => {\n const [parent, node] = await Promise.all([\n input.parentId &&\n (await context.db.query.nodes.findFirst({\n where: eq(nodes.id, input.parentId),\n })),\n context.db.query.nodes.findFirst({\n where: eq(nodes.id, input.id),\n }),\n ]);\n\n /**\n * Validate\n */\n if (node?.readonly) {\n throw new ServerError(\"BAD_REQUEST\", {\n message: \"Deze node is alleen leesbaar en kan niet worden gewijzigd\",\n });\n }\n\n if (input.parentId && !parent)\n throw new ServerError(\"BAD_REQUEST\", { message: \"Parent not found\" });\n if (!node) throw new ServerError(\"BAD_REQUEST\", { message: \"Node not found\" });\n\n if (parent && !isFolder(parent)) {\n throw new ServerError(\"BAD_REQUEST\", { message: \"Parent is not a folder\" });\n }\n\n if (parent && parent.namespace !== node.namespace) {\n throw new ServerError(\"BAD_REQUEST\", {\n message: \"Parent is not in the same namespace\",\n });\n }\n\n /**\n * Update the parent\n */\n await context.db\n .update(nodes)\n .set({ parentId: input.parentId })\n .where(eq(nodes.id, input.id));\n }),\n /**\n * Delete nodes\n */\n deleteNodes: protectedProcedure\n .input(bulkActionSchema)\n .output(z.void())\n .handler(async ({ context, input }) => context.storage.deleteNodes(input)),\n };\n}\n"],"mappings":";;;;;;;;;;;;;AAsBA,SAAgB,4BAA4B;CAC1C,MAAM,EAAE,uBAAuB,SAAsB;AAErD,QAAO;EAIL,aAAa,mBACV,MAAMA,IAAE,OAAO;GAAE,IAAIA,IAAE,QAAQ;GAAE,WAAWA,IAAE,QAAQ;GAAE,CAAC,CAAC,CAC1D,OAAO,6BAA6B,UAAU,CAAC,CAC/C,QAAQ,OAAO,EAAE,SAAS,YACzB,QAAQ,GAAG,MAAM,MAAM,UAAU;GAC/B,OAAO,IAAI,GAAG,MAAM,IAAI,MAAM,GAAG,EAAE,GAAG,MAAM,WAAW,MAAM,UAAU,CAAC;GACxE,MAAM,EAAE,UAAU,MAAM;GACzB,CAAC,CACH;EAIH,oBAAoB,mBACjB,MAAM,yBAAyB,CAC/B,OAAOA,IAAE,MAAM,iBAAiB,CAAC,CACjC,QAAQ,OAAO,EAAE,SAAS,YAAY,QAAQ,QAAQ,mBAAmB,MAAM,CAAC;EAInF,kBAAkB,mBACf,MAAMA,IAAE,OAAO;GAAE,IAAIA,IAAE,QAAQ,CAAC,UAAU;GAAE,WAAWA,IAAE,QAAQ;GAAE,CAAC,CAAC,CACrE,QAAQ,OAAO,EAAE,SAAS,YAAY;AACrC,OAAI,CAAC,MAAM,GAAI,QAAO,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,OAAI,CAAC,KAAM,OAAM,IAAI,YAAY,eAAe,EAAE,SAAS,kBAAkB,CAAC;AAE9E,OAAI,UAAU,CAAC,SAAS,OAAO,CAC7B,OAAM,IAAI,YAAY,eAAe,EAAE,SAAS,0BAA0B,CAAC;AAG7E,OAAI,UAAU,OAAO,cAAc,KAAK,UACtC,OAAM,IAAI,YAAY,eAAe,EACnC,SAAS,uCACV,CAAC;;;;AAMJ,SAAM,QAAQ,GACX,OAAO,MAAM,CACb,IAAI,EAAE,UAAU,MAAM,UAAU,CAAC,CACjC,MAAM,GAAG,MAAM,IAAI,MAAM,GAAG,CAAC;IAChC;EAIJ,aAAa,mBACV,MAAM,iBAAiB,CACvB,OAAOA,IAAE,MAAM,CAAC,CAChB,QAAQ,OAAO,EAAE,SAAS,YAAY,QAAQ,QAAQ,YAAY,MAAM,CAAC;EAC7E"}
1
+ {"version":3,"file":"router.server.mjs","names":["z"],"sources":["../../../../src/modules/storage/lib/router.server.ts"],"sourcesContent":["import { and, eq, sql } from \"drizzle-orm\";\nimport type { QueryResult } from \"pg\";\nimport { z } from \"zod\";\nimport { bulkActionSchema } from \"@/modules/router/entry\";\nimport { ServerError } from \"@/modules/router/entry.server\";\nimport { initRPC } from \"@/modules/router/handler/init.server\";\nimport { isFolder } from \"./helpers\";\nimport { type DriveSchema, nodes } from \"./schema\";\nimport {\n createFolderNodeSchema,\n getFileURLSchema,\n getNodesByParentIdSchema,\n type Node,\n presignFileSchema,\n selectNodeSchema,\n selectNodeWithChildrenSchema,\n updateNodeSchema,\n} from \"./validators\";\n\n/**\n * Create Drive base procedures\n */\nexport function createDriveBaseProcedures() {\n const { protectedProcedure } = initRPC<DriveSchema>();\n\n return {\n /**\n * Get node and its children\n */\n getNodeById: protectedProcedure\n .input(z.object({ id: z.string(), namespace: z.string() }))\n .output(selectNodeWithChildrenSchema.optional())\n .handler(async ({ context, input }) =>\n context.db.query.nodes.findFirst({\n where: and(eq(nodes.id, input.id), eq(nodes.namespace, input.namespace)),\n with: { children: true },\n }),\n ),\n /**\n * Get folders by parent id\n */\n getNodesByParentId: protectedProcedure\n .input(getNodesByParentIdSchema)\n .output(z.array(selectNodeSchema))\n .handler(async ({ context, input }) => context.storage.getNodesByParentId(input)),\n /**\n * Get parents of a folder\n */\n getFolderParents: protectedProcedure\n .input(z.object({ id: z.string().nullable(), namespace: z.string() }))\n .handler(async ({ context, input }) => {\n if (!input.id) return [];\n\n const startNodeQuery = context.db\n .select({\n id: nodes.id,\n name: nodes.name,\n parentId: nodes.parentId,\n depth: sql<number>`0`.as(\"depth\"),\n })\n .from(nodes)\n .where(and(eq(nodes.id, input.id), eq(nodes.namespace, input.namespace)));\n\n const alias = \"parent_nodes\";\n const parentNodesQueryAlias = startNodeQuery.as(alias);\n const recursiveQueryName = sql.raw(`\"${alias}\"`);\n\n const recursiveQuery = startNodeQuery.unionAll(\n context.db\n .select({\n id: nodes.id,\n name: nodes.name,\n parentId: nodes.parentId,\n depth: sql<number>`${parentNodesQueryAlias.depth} + 1`,\n })\n .from(nodes)\n .innerJoin(recursiveQueryName, eq(nodes.id, parentNodesQueryAlias.parentId)),\n );\n\n const result = (await context.db.execute(\n sql`WITH RECURSIVE ${recursiveQueryName} AS ${recursiveQuery} SELECT * FROM ${recursiveQueryName}`,\n )) as QueryResult<Pick<Node, \"id\" | \"name\" | \"parentId\"> & { depth: number }>;\n\n return result?.rows?.toSorted((a, b) => Number(b.depth) - Number(a.depth)) ?? [];\n }),\n /**\n * Get presigned url for opening a file\n */\n getSignedURL: protectedProcedure\n .input(getFileURLSchema.extend({ id: z.string() }))\n .output(z.string().nullable())\n .handler(async ({ context, input: { id, ...options } }) => {\n const [node] = await context.db.select().from(nodes).where(eq(nodes.id, id));\n if (!node) return null;\n\n return await context.storage.getSignedURL(node, options);\n }),\n\n /**\n * Get presigned url for uploading a file\n */\n presign: protectedProcedure\n .input(presignFileSchema)\n .output(z.object({ id: z.string(), presignedUrl: z.string() }))\n .handler(async ({ context, input }) => context.storage.presignUpload(input)),\n /**\n * Confirm the upload\n */\n confirm: protectedProcedure\n .input(z.object({ id: z.string() }))\n .output(selectNodeSchema)\n .handler(async ({ context, input }) => context.storage.confirmUpload(input)),\n /**\n * Create a folder\n */\n createFolder: protectedProcedure\n .input(createFolderNodeSchema)\n .output(selectNodeSchema)\n .handler(async ({ context, input }) => context.storage.createFolder(input)),\n /**\n * Update node\n */\n updateNode: protectedProcedure\n .input(z.object({ id: z.string(), data: updateNodeSchema }))\n .output(selectNodeSchema)\n .handler(async ({ context, input }) => context.storage.updateNode(input)),\n /**\n * Change node parent\n */\n changeParent: protectedProcedure\n .input(z.object({ id: z.string(), parentId: z.string().nullish() }))\n .handler(async ({ context, input }) => {\n const [parent, node] = await Promise.all([\n input.parentId &&\n (await context.db.query.nodes.findFirst({\n where: eq(nodes.id, input.parentId),\n })),\n context.db.query.nodes.findFirst({\n where: eq(nodes.id, input.id),\n }),\n ]);\n\n /**\n * Validate\n */\n if (node?.readonly) {\n throw new ServerError(\"BAD_REQUEST\", {\n message: \"Deze node is alleen leesbaar en kan niet worden gewijzigd\",\n });\n }\n\n if (input.parentId && !parent)\n throw new ServerError(\"BAD_REQUEST\", { message: \"Parent not found\" });\n if (!node) throw new ServerError(\"BAD_REQUEST\", { message: \"Node not found\" });\n\n if (parent && !isFolder(parent)) {\n throw new ServerError(\"BAD_REQUEST\", { message: \"Parent is not a folder\" });\n }\n\n if (parent && parent.namespace !== node.namespace) {\n throw new ServerError(\"BAD_REQUEST\", {\n message: \"Parent is not in the same namespace\",\n });\n }\n\n /**\n * Update the parent\n */\n await context.db\n .update(nodes)\n .set({ parentId: input.parentId })\n .where(eq(nodes.id, input.id));\n }),\n /**\n * Delete nodes\n */\n deleteNodes: protectedProcedure\n .input(bulkActionSchema)\n .output(z.void())\n .handler(async ({ context, input }) => context.storage.deleteNodes(input)),\n };\n}\n"],"mappings":";;;;;;;;;;;;;AAsBA,SAAgB,4BAA4B;CAC1C,MAAM,EAAE,uBAAuB,SAAsB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