@tulip-systems/core 0.4.1 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (602) hide show
  1. package/dist/auth/client.d.mts +2 -2
  2. package/dist/auth/client.mjs +2 -2
  3. package/dist/commands/client.d.mts +3 -3
  4. package/dist/commands/client.mjs +3 -3
  5. package/dist/components/client.d.mts +3 -5
  6. package/dist/components/client.mjs +3 -5
  7. package/dist/components/common/icons.d.mts +52 -52
  8. package/dist/components/common/icons.d.mts.map +1 -1
  9. package/dist/components/common/status.d.mts +3 -3
  10. package/dist/components/common/status.d.mts.map +1 -1
  11. package/dist/components/editor/components/block-dropdown.mjs +28 -14
  12. package/dist/components/editor/components/block-dropdown.mjs.map +1 -1
  13. package/dist/components/editor/components/content.client.d.mts +2 -2
  14. package/dist/components/editor/components/content.client.mjs +1 -1
  15. package/dist/components/editor/components/content.client.mjs.map +1 -1
  16. package/dist/components/editor/components/editor.client.d.mts +48 -0
  17. package/dist/components/editor/components/editor.client.d.mts.map +1 -0
  18. package/dist/components/editor/components/editor.client.mjs +53 -0
  19. package/dist/components/editor/components/editor.client.mjs.map +1 -0
  20. package/dist/components/editor/components/menu-fixed.client.d.mts +7 -0
  21. package/dist/components/editor/components/menu-fixed.client.d.mts.map +1 -0
  22. package/dist/components/editor/components/{fixed-menu.client.mjs → menu-fixed.client.mjs} +21 -27
  23. package/dist/components/editor/components/menu-fixed.client.mjs.map +1 -0
  24. package/dist/components/editor/lib/constants.d.mts +60 -0
  25. package/dist/components/editor/lib/constants.d.mts.map +1 -0
  26. package/dist/components/editor/lib/constants.mjs +90 -0
  27. package/dist/components/editor/lib/constants.mjs.map +1 -0
  28. package/dist/components/editor/lib/extensions.d.mts +62 -0
  29. package/dist/components/editor/lib/extensions.d.mts.map +1 -0
  30. package/dist/components/editor/lib/extensions.mjs +52 -0
  31. package/dist/components/editor/lib/extensions.mjs.map +1 -0
  32. package/dist/components/editor/lib/helpers.mjs +3 -3
  33. package/dist/components/editor/lib/helpers.mjs.map +1 -1
  34. package/dist/components/editor/lib/variants.mjs +8 -0
  35. package/dist/components/editor/lib/variants.mjs.map +1 -0
  36. package/dist/components/header/back-button.client.d.mts +2 -2
  37. package/dist/components/header/bottom-bar.client.d.mts +3 -3
  38. package/dist/components/header/breadcrumbs.client.d.mts +7 -7
  39. package/dist/components/header/header.client.d.mts +2 -2
  40. package/dist/components/header/mobile-nav-switcher.client.d.mts +2 -2
  41. package/dist/components/header/top-bar.client.d.mts +4 -4
  42. package/dist/components/header/top-bar.client.mjs +1 -1
  43. package/dist/components/header/top-bar.client.mjs.map +1 -1
  44. package/dist/components/layouts/admin-content.client.d.mts +2 -2
  45. package/dist/components/layouts/admin-content.client.mjs +1 -1
  46. package/dist/components/layouts/admin-content.client.mjs.map +1 -1
  47. package/dist/components/layouts/admin-layout.d.mts +2 -2
  48. package/dist/components/layouts/admin-layout.d.mts.map +1 -1
  49. package/dist/components/layouts/admin-loading.d.mts +2 -2
  50. package/dist/components/layouts/admin-loading.d.mts.map +1 -1
  51. package/dist/components/layouts/empty-page.d.mts +4 -4
  52. package/dist/components/layouts/empty-page.d.mts.map +1 -1
  53. package/dist/components/layouts/list-layout.d.mts +2 -2
  54. package/dist/components/layouts/list-layout.d.mts.map +1 -1
  55. package/dist/components/layouts/not-found-page.d.mts +3 -3
  56. package/dist/components/layouts/not-found-page.d.mts.map +1 -1
  57. package/dist/components/layouts/providers.client.d.mts +2 -2
  58. package/dist/components/layouts/root-layout.server.d.mts +4 -4
  59. package/dist/components/layouts/root-layout.server.d.mts.map +1 -1
  60. package/dist/components/layouts/root-loading.d.mts +2 -2
  61. package/dist/components/layouts/root-loading.d.mts.map +1 -1
  62. package/dist/components/layouts/tab-layout.d.mts +2 -2
  63. package/dist/components/layouts/tab-layout.d.mts.map +1 -1
  64. package/dist/components/lists/data-list.d.mts +5 -5
  65. package/dist/components/lists/data-list.d.mts.map +1 -1
  66. package/dist/components/lists/data-stack.d.mts +8 -8
  67. package/dist/components/lists/data-stack.d.mts.map +1 -1
  68. package/dist/components/navigation/admin-sidebar-paths.client.d.mts +10 -10
  69. package/dist/components/ui/accordion.d.mts +5 -5
  70. package/dist/components/ui/alert-dialog.d.mts +12 -12
  71. package/dist/components/ui/alert.d.mts +4 -4
  72. package/dist/components/ui/aspect-ratio.d.mts +2 -2
  73. package/dist/components/ui/avatar.client.d.mts +4 -4
  74. package/dist/components/ui/badge.d.mts +2 -2
  75. package/dist/components/ui/breadcrumb.d.mts +8 -8
  76. package/dist/components/ui/button.d.mts +2 -2
  77. package/dist/components/ui/calendar.d.mts +17 -4
  78. package/dist/components/ui/calendar.d.mts.map +1 -1
  79. package/dist/components/ui/calendar.mjs +90 -37
  80. package/dist/components/ui/calendar.mjs.map +1 -1
  81. package/dist/components/ui/card.d.mts +7 -7
  82. package/dist/components/ui/carousel.d.mts +6 -6
  83. package/dist/components/ui/chart.client.d.mts +5 -5
  84. package/dist/components/ui/checkbox.d.mts +2 -2
  85. package/dist/components/ui/collapsible.client.d.mts +4 -4
  86. package/dist/components/ui/color-picker.client.d.mts +2 -2
  87. package/dist/components/ui/combobox-dropdown.client.d.mts +2 -2
  88. package/dist/components/ui/combobox.client.d.mts +2 -2
  89. package/dist/components/ui/command.d.mts +10 -10
  90. package/dist/components/ui/context-menu.d.mts +16 -16
  91. package/dist/components/ui/date-picker.client.d.mts +2 -2
  92. package/dist/components/ui/dialog.client.d.mts +11 -11
  93. package/dist/components/ui/drawer.client.d.mts +11 -11
  94. package/dist/components/ui/dropdown-menu.d.mts +16 -16
  95. package/dist/components/ui/form.client.d.mts +7 -7
  96. package/dist/components/ui/hover-card.client.d.mts +4 -4
  97. package/dist/components/ui/input-recipient.d.mts +5 -3
  98. package/dist/components/ui/input-recipient.d.mts.map +1 -1
  99. package/dist/components/ui/input-recipient.mjs +2 -2
  100. package/dist/components/ui/input-recipient.mjs.map +1 -1
  101. package/dist/components/ui/input.d.mts +2 -2
  102. package/dist/components/ui/label.d.mts +2 -2
  103. package/dist/components/ui/navigation-menu.d.mts +9 -9
  104. package/dist/components/ui/pagination.d.mts +8 -8
  105. package/dist/components/ui/popover.d.mts +5 -5
  106. package/dist/components/ui/progress.client.d.mts +2 -2
  107. package/dist/components/ui/radio-group.d.mts +3 -3
  108. package/dist/components/ui/resizable.client.d.mts +4 -4
  109. package/dist/components/ui/scroll-area.d.mts +3 -3
  110. package/dist/components/ui/select.client.d.mts +11 -11
  111. package/dist/components/ui/separator.d.mts +2 -2
  112. package/dist/components/ui/sheet.client.d.mts +9 -9
  113. package/dist/components/ui/sidebar.client.d.mts +26 -26
  114. package/dist/components/ui/skeleton.d.mts +2 -2
  115. package/dist/components/ui/slider.d.mts +2 -2
  116. package/dist/components/ui/sonner.client.d.mts +2 -2
  117. package/dist/components/ui/switch.d.mts +2 -2
  118. package/dist/components/ui/tabs.d.mts +5 -5
  119. package/dist/components/ui/textarea.d.mts +2 -2
  120. package/dist/components/ui/time-input.client.d.mts +2 -2
  121. package/dist/components/ui/toggle-group.client.d.mts +3 -3
  122. package/dist/components/ui/toggle.d.mts +4 -4
  123. package/dist/components/ui/toggle.d.mts.map +1 -1
  124. package/dist/components/ui/tooltip.client.d.mts +5 -5
  125. package/dist/components/ui/tooltip.client.d.mts.map +1 -1
  126. package/dist/components.d.mts +2 -2
  127. package/dist/components.mjs +2 -2
  128. package/dist/config/server.d.mts +1 -2
  129. package/dist/config/server.mjs +1 -2
  130. package/dist/data-tables.d.mts +6 -5
  131. package/dist/data-tables.mjs +4 -3
  132. package/dist/inline-edit/client.d.mts +4 -4
  133. package/dist/inline-edit/client.mjs +3 -3
  134. package/dist/lib/hooks/use-action.d.mts +2 -2
  135. package/dist/lib/hooks/use-indicator.d.mts +2 -2
  136. package/dist/lib.mjs +1 -1
  137. package/dist/modules/auth/components/allowed.client.d.mts +2 -2
  138. package/dist/modules/auth/components/allowed.client.d.mts.map +1 -1
  139. package/dist/modules/auth/components/auth-layout.server.d.mts +2 -2
  140. package/dist/modules/auth/components/auth-layout.server.d.mts.map +1 -1
  141. package/dist/modules/auth/components/auth-loading.d.mts +2 -2
  142. package/dist/modules/auth/components/auth-loading.d.mts.map +1 -1
  143. package/dist/modules/auth/components/create-first-user-page.client.d.mts +2 -2
  144. package/dist/modules/auth/components/create-first-user-page.client.d.mts.map +1 -1
  145. package/dist/modules/auth/components/forget-password-page.client.d.mts +2 -2
  146. package/dist/modules/auth/components/forget-password-page.client.d.mts.map +1 -1
  147. package/dist/modules/auth/components/guard-first-user.server.d.mts +2 -2
  148. package/dist/modules/auth/components/guard-first-user.server.d.mts.map +1 -1
  149. package/dist/modules/auth/components/guard.server.d.mts +2 -2
  150. package/dist/modules/auth/components/guard.server.d.mts.map +1 -1
  151. package/dist/modules/auth/components/login-page.client.d.mts +2 -2
  152. package/dist/modules/auth/components/login-page.client.d.mts.map +1 -1
  153. package/dist/modules/auth/components/reset-password-page.client.d.mts +2 -2
  154. package/dist/modules/auth/components/reset-password-page.client.d.mts.map +1 -1
  155. package/dist/modules/auth/components/update-password-command.d.mts +2 -2
  156. package/dist/modules/auth/components/update-password-command.d.mts.map +1 -1
  157. package/dist/modules/auth/db/schema.d.mts +247 -230
  158. package/dist/modules/auth/db/schema.d.mts.map +1 -1
  159. package/dist/modules/auth/db/schema.mjs +12 -20
  160. package/dist/modules/auth/db/schema.mjs.map +1 -1
  161. package/dist/modules/auth/handler/client.client.d.mts +129 -129
  162. package/dist/modules/auth/handler/client.client.d.mts.map +1 -1
  163. package/dist/modules/auth/handler/client.client.mjs +10 -6
  164. package/dist/modules/auth/handler/client.client.mjs.map +1 -1
  165. package/dist/modules/auth/handler/init.d.mts +134 -131
  166. package/dist/modules/auth/handler/init.d.mts.map +1 -1
  167. package/dist/modules/auth/handler/init.mjs +5 -2
  168. package/dist/modules/auth/handler/init.mjs.map +1 -1
  169. package/dist/modules/auth/hooks/use-permission.d.mts +2 -2
  170. package/dist/modules/auth/hooks/use-permission.d.mts.map +1 -1
  171. package/dist/modules/auth/hooks/use-permission.mjs +7 -2
  172. package/dist/modules/auth/hooks/use-permission.mjs.map +1 -1
  173. package/dist/modules/auth/hooks/use-session.d.mts +119 -3
  174. package/dist/modules/auth/hooks/use-session.d.mts.map +1 -1
  175. package/dist/modules/auth/hooks/use-session.mjs +15 -10
  176. package/dist/modules/auth/hooks/use-session.mjs.map +1 -1
  177. package/dist/modules/auth/lib/helpers.server.d.mts +5 -5
  178. package/dist/modules/auth/lib/helpers.server.d.mts.map +1 -1
  179. package/dist/modules/auth/lib/validators.d.mts +1 -1
  180. package/dist/modules/auth/lib/validators.d.mts.map +1 -1
  181. package/dist/modules/auth/lib/validators.mjs +1 -1
  182. package/dist/modules/auth/lib/validators.mjs.map +1 -1
  183. package/dist/modules/commands/components/alert-dialog-command.client.d.mts +10 -10
  184. package/dist/modules/commands/components/alert-dialog-command.client.d.mts.map +1 -1
  185. package/dist/modules/commands/components/alert-dialog-command.client.mjs +2 -2
  186. package/dist/modules/commands/components/alert-dialog-command.client.mjs.map +1 -1
  187. package/dist/modules/commands/components/click-command.client.d.mts +2 -2
  188. package/dist/modules/commands/components/click-command.client.d.mts.map +1 -1
  189. package/dist/modules/commands/components/click-command.client.mjs +2 -2
  190. package/dist/modules/commands/components/click-command.client.mjs.map +1 -1
  191. package/dist/modules/commands/components/command-trigger.client.d.mts +6 -6
  192. package/dist/modules/commands/components/command-trigger.client.d.mts.map +1 -1
  193. package/dist/modules/commands/components/dialog-command.client.d.mts +18 -8
  194. package/dist/modules/commands/components/dialog-command.client.d.mts.map +1 -1
  195. package/dist/modules/commands/components/dialog-command.client.mjs +12 -8
  196. package/dist/modules/commands/components/dialog-command.client.mjs.map +1 -1
  197. package/dist/modules/commands/components/dropdown-command.client.d.mts +5 -5
  198. package/dist/modules/commands/components/dropdown-command.client.d.mts.map +1 -1
  199. package/dist/modules/commands/components/dropdown-command.client.mjs +2 -2
  200. package/dist/modules/commands/components/dropdown-command.client.mjs.map +1 -1
  201. package/dist/modules/commands/components/empty-command.client.d.mts +2 -2
  202. package/dist/modules/commands/components/form-dialog-command.client.d.mts +11 -11
  203. package/dist/modules/commands/components/form-dialog-command.client.mjs +2 -2
  204. package/dist/modules/commands/components/form-dialog-command.client.mjs.map +1 -1
  205. package/dist/modules/commands/hooks/use-command-mutation.client.d.mts +17 -0
  206. package/dist/modules/commands/hooks/use-command-mutation.client.d.mts.map +1 -0
  207. package/dist/modules/commands/hooks/use-command-mutation.client.mjs +42 -0
  208. package/dist/modules/commands/hooks/use-command-mutation.client.mjs.map +1 -0
  209. package/dist/modules/commands/menus/context-menu.client.d.mts +2 -2
  210. package/dist/modules/commands/menus/dropdown-menu.client.d.mts +3 -3
  211. package/dist/modules/commands/menus/inline-menu.client.d.mts +3 -3
  212. package/dist/modules/commands/menus/responsive-menu.client.d.mts +3 -3
  213. package/dist/modules/commands/utils/archive-command.client.d.mts +3 -3
  214. package/dist/modules/commands/utils/delete-command.client.d.mts +13 -8
  215. package/dist/modules/commands/utils/delete-command.client.d.mts.map +1 -1
  216. package/dist/modules/commands/utils/delete-command.client.mjs +10 -1
  217. package/dist/modules/commands/utils/delete-command.client.mjs.map +1 -1
  218. package/dist/modules/config/db/helpers.d.mts +5 -5
  219. package/dist/modules/config/db/helpers.d.mts.map +1 -1
  220. package/dist/modules/config/lib/config.d.mts +3 -3
  221. package/dist/modules/config/lib/config.d.mts.map +1 -1
  222. package/dist/modules/config/lib/config.mjs.map +1 -1
  223. package/dist/modules/config/lib/context.d.mts +2 -2
  224. package/dist/modules/config/lib/context.d.mts.map +1 -1
  225. package/dist/modules/config/lib/context.mjs.map +1 -1
  226. package/dist/modules/data-tables/components/cell/common.client.d.mts +5 -5
  227. package/dist/modules/data-tables/components/cell/common.client.d.mts.map +1 -1
  228. package/dist/modules/data-tables/components/column-header.d.mts +2 -2
  229. package/dist/modules/data-tables/components/filters/combobox.client.d.mts +2 -2
  230. package/dist/modules/data-tables/components/filters/combobox.client.d.mts.map +1 -1
  231. package/dist/modules/data-tables/components/filters/combobox.client.mjs +5 -2
  232. package/dist/modules/data-tables/components/filters/combobox.client.mjs.map +1 -1
  233. package/dist/modules/data-tables/components/filters/slider.client.d.mts +2 -2
  234. package/dist/modules/data-tables/components/filters/slider.client.d.mts.map +1 -1
  235. package/dist/modules/data-tables/components/header.d.mts +4 -4
  236. package/dist/modules/data-tables/components/layout.d.mts +2 -2
  237. package/dist/modules/data-tables/components/layout.d.mts.map +1 -1
  238. package/dist/modules/data-tables/components/search-input.client.d.mts +2 -2
  239. package/dist/modules/data-tables/components/search-input.client.d.mts.map +1 -1
  240. package/dist/modules/data-tables/components/skeleton.d.mts +2 -2
  241. package/dist/modules/data-tables/components/skeleton.d.mts.map +1 -1
  242. package/dist/modules/data-tables/components/table.d.mts +7 -7
  243. package/dist/modules/data-tables/components/table.d.mts.map +1 -1
  244. package/dist/modules/data-tables/components/toolbar.d.mts +3 -3
  245. package/dist/modules/data-tables/components/toolbar.d.mts.map +1 -1
  246. package/dist/modules/data-tables/hooks/use-context.client.d.mts +13 -10
  247. package/dist/modules/data-tables/hooks/use-context.client.d.mts.map +1 -1
  248. package/dist/modules/data-tables/hooks/use-context.client.mjs.map +1 -1
  249. package/dist/modules/data-tables/hooks/use-table.client.d.mts +2 -1
  250. package/dist/modules/data-tables/hooks/use-table.client.d.mts.map +1 -1
  251. package/dist/modules/data-tables/hooks/use-table.client.mjs.map +1 -1
  252. package/dist/modules/data-tables/lib/converters/search.d.mts +1 -1
  253. package/dist/modules/data-tables/lib/converters/sorting.d.mts +1 -1
  254. package/dist/modules/data-tables/lib/filters/config.d.mts +4 -1
  255. package/dist/modules/data-tables/lib/filters/config.d.mts.map +1 -1
  256. package/dist/modules/data-tables/lib/filters/config.mjs.map +1 -1
  257. package/dist/modules/data-tables/lib/filters/helpers.d.mts +11 -0
  258. package/dist/modules/data-tables/lib/filters/helpers.d.mts.map +1 -0
  259. package/dist/modules/data-tables/lib/filters/helpers.mjs +17 -0
  260. package/dist/modules/data-tables/lib/filters/helpers.mjs.map +1 -0
  261. package/dist/modules/data-tables/lib/filters/parsers.d.mts +7 -2
  262. package/dist/modules/data-tables/lib/filters/parsers.d.mts.map +1 -1
  263. package/dist/modules/data-tables/lib/filters/parsers.mjs +6 -1
  264. package/dist/modules/data-tables/lib/filters/parsers.mjs.map +1 -1
  265. package/dist/modules/data-tables/lib/filters/resolvers.d.mts +6 -1
  266. package/dist/modules/data-tables/lib/filters/resolvers.d.mts.map +1 -1
  267. package/dist/modules/data-tables/lib/filters/resolvers.mjs +8 -1
  268. package/dist/modules/data-tables/lib/filters/resolvers.mjs.map +1 -1
  269. package/dist/modules/data-tables/lib/types.d.mts +8 -5
  270. package/dist/modules/data-tables/lib/types.d.mts.map +1 -1
  271. package/dist/modules/data-tables/server/get-data.server.d.mts +1 -1
  272. package/dist/modules/data-tables/tables/data-table/components/table.d.mts +2 -2
  273. package/dist/modules/data-tables/tables/data-table/components/table.d.mts.map +1 -1
  274. package/dist/modules/data-tables/tables/inline-table/components/cells/common.d.mts +2 -2
  275. package/dist/modules/data-tables/tables/inline-table/components/cells/common.d.mts.map +1 -1
  276. package/dist/modules/data-tables/tables/inline-table/components/cells/drag-handle.client.d.mts +2 -2
  277. package/dist/modules/data-tables/tables/inline-table/components/cells/drag-handle.client.d.mts.map +1 -1
  278. package/dist/modules/data-tables/tables/inline-table/components/cells/drag-handle.client.mjs +1 -1
  279. package/dist/modules/data-tables/tables/inline-table/components/cells/drag-handle.client.mjs.map +1 -1
  280. package/dist/modules/data-tables/tables/inline-table/components/inputs/advanced-select.client.d.mts +2 -2
  281. package/dist/modules/data-tables/tables/inline-table/components/inputs/advanced-select.client.d.mts.map +1 -1
  282. package/dist/modules/data-tables/tables/inline-table/components/inputs/combobox.client.d.mts +2 -2
  283. package/dist/modules/data-tables/tables/inline-table/components/inputs/combobox.client.d.mts.map +1 -1
  284. package/dist/modules/data-tables/tables/inline-table/components/inputs/input.client.d.mts +3 -3
  285. package/dist/modules/data-tables/tables/inline-table/components/inputs/input.client.d.mts.map +1 -1
  286. package/dist/modules/data-tables/tables/inline-table/components/inputs/read-only.d.mts +2 -2
  287. package/dist/modules/data-tables/tables/inline-table/components/inputs/read-only.d.mts.map +1 -1
  288. package/dist/modules/data-tables/tables/inline-table/components/inputs/select.client.d.mts +2 -2
  289. package/dist/modules/data-tables/tables/inline-table/components/inputs/select.client.d.mts.map +1 -1
  290. package/dist/modules/data-tables/tables/inline-table/components/table.d.mts +2 -2
  291. package/dist/modules/data-tables/tables/inline-table/components/table.d.mts.map +1 -1
  292. package/dist/modules/data-tables/tables/inline-table/hooks/context.client.d.mts +2 -2
  293. package/dist/modules/data-tables/tables/inline-table/hooks/context.client.d.mts.map +1 -1
  294. package/dist/modules/inline-edit/components/combobox-dropdown.client.d.mts +5 -2
  295. package/dist/modules/inline-edit/components/combobox-dropdown.client.d.mts.map +1 -1
  296. package/dist/modules/inline-edit/components/combobox-dropdown.client.mjs +7 -3
  297. package/dist/modules/inline-edit/components/combobox-dropdown.client.mjs.map +1 -1
  298. package/dist/modules/inline-edit/components/combobox.client.d.mts +5 -2
  299. package/dist/modules/inline-edit/components/combobox.client.d.mts.map +1 -1
  300. package/dist/modules/inline-edit/components/combobox.client.mjs +6 -2
  301. package/dist/modules/inline-edit/components/combobox.client.mjs.map +1 -1
  302. package/dist/modules/inline-edit/components/date-input.client.d.mts +6 -3
  303. package/dist/modules/inline-edit/components/date-input.client.d.mts.map +1 -1
  304. package/dist/modules/inline-edit/components/date-input.client.mjs +5 -3
  305. package/dist/modules/inline-edit/components/date-input.client.mjs.map +1 -1
  306. package/dist/modules/inline-edit/components/date-picker.client.d.mts +7 -3
  307. package/dist/modules/inline-edit/components/date-picker.client.d.mts.map +1 -1
  308. package/dist/modules/inline-edit/components/date-picker.client.mjs +5 -3
  309. package/dist/modules/inline-edit/components/date-picker.client.mjs.map +1 -1
  310. package/dist/modules/inline-edit/components/deprecated-editor.client.d.mts +21 -0
  311. package/dist/modules/inline-edit/components/deprecated-editor.client.d.mts.map +1 -0
  312. package/dist/modules/inline-edit/components/deprecated-editor.client.mjs +37 -0
  313. package/dist/modules/inline-edit/components/deprecated-editor.client.mjs.map +1 -0
  314. package/dist/modules/inline-edit/components/editor.client.d.mts +10 -7
  315. package/dist/modules/inline-edit/components/editor.client.d.mts.map +1 -1
  316. package/dist/modules/inline-edit/components/editor.client.mjs +13 -18
  317. package/dist/modules/inline-edit/components/editor.client.mjs.map +1 -1
  318. package/dist/modules/inline-edit/components/input-recipient.client.d.mts +4 -2
  319. package/dist/modules/inline-edit/components/input-recipient.client.d.mts.map +1 -1
  320. package/dist/modules/inline-edit/components/input-recipient.client.mjs +7 -3
  321. package/dist/modules/inline-edit/components/input-recipient.client.mjs.map +1 -1
  322. package/dist/modules/inline-edit/components/input-toggle.client.d.mts +3 -2
  323. package/dist/modules/inline-edit/components/input-toggle.client.d.mts.map +1 -1
  324. package/dist/modules/inline-edit/components/input-toggle.client.mjs +3 -2
  325. package/dist/modules/inline-edit/components/input-toggle.client.mjs.map +1 -1
  326. package/dist/modules/inline-edit/components/input.client.d.mts +18 -4
  327. package/dist/modules/inline-edit/components/input.client.d.mts.map +1 -1
  328. package/dist/modules/inline-edit/components/input.client.mjs +26 -5
  329. package/dist/modules/inline-edit/components/input.client.mjs.map +1 -1
  330. package/dist/modules/inline-edit/components/select.client.d.mts +8 -6
  331. package/dist/modules/inline-edit/components/select.client.d.mts.map +1 -1
  332. package/dist/modules/inline-edit/components/select.client.mjs +3 -2
  333. package/dist/modules/inline-edit/components/select.client.mjs.map +1 -1
  334. package/dist/modules/inline-edit/components/switch.client.d.mts +3 -2
  335. package/dist/modules/inline-edit/components/switch.client.d.mts.map +1 -1
  336. package/dist/modules/inline-edit/components/switch.client.mjs +3 -2
  337. package/dist/modules/inline-edit/components/switch.client.mjs.map +1 -1
  338. package/dist/modules/inline-edit/components/toggle.client.d.mts +3 -2
  339. package/dist/modules/inline-edit/components/toggle.client.d.mts.map +1 -1
  340. package/dist/modules/inline-edit/components/toggle.client.mjs +3 -2
  341. package/dist/modules/inline-edit/components/toggle.client.mjs.map +1 -1
  342. package/dist/modules/inline-edit/hooks/context.client.d.mts +2 -2
  343. package/dist/modules/inline-edit/hooks/context.client.d.mts.map +1 -1
  344. package/dist/modules/inline-edit/hooks/use-inline.client.d.mts +1 -1
  345. package/dist/modules/inline-edit/hooks/use-inline.client.mjs.map +1 -1
  346. package/dist/modules/inline-edit/lib/variants.d.mts +3 -3
  347. package/dist/modules/inline-edit/lib/variants.mjs +1 -1
  348. package/dist/modules/inline-edit/lib/variants.mjs.map +1 -1
  349. package/dist/modules/router/handler/context.server.d.mts +2 -2
  350. package/dist/modules/router/handler/context.server.d.mts.map +1 -1
  351. package/dist/modules/router/handler/init.server.d.mts +7 -7
  352. package/dist/modules/router/lib/query-client.server.d.mts +2 -2
  353. package/dist/modules/router/lib/query-client.server.d.mts.map +1 -1
  354. package/dist/modules/{uploads/components/dropzone/context.d.mts → storage/components/dropzone-context.client.d.mts} +2 -2
  355. package/dist/modules/storage/components/dropzone-context.client.d.mts.map +1 -0
  356. package/dist/modules/{uploads/components/dropzone/context.mjs → storage/components/dropzone-context.client.mjs} +2 -2
  357. package/dist/modules/storage/components/dropzone-context.client.mjs.map +1 -0
  358. package/dist/modules/{uploads/components/dropzone/index.d.mts → storage/components/dropzone.client.d.mts} +7 -7
  359. package/dist/modules/storage/components/dropzone.client.d.mts.map +1 -0
  360. package/dist/modules/{uploads/components/dropzone/index.mjs → storage/components/dropzone.client.mjs} +6 -6
  361. package/dist/modules/storage/components/dropzone.client.mjs.map +1 -0
  362. package/dist/modules/storage/components/image-grid.client.d.mts +26 -0
  363. package/dist/modules/storage/components/image-grid.client.d.mts.map +1 -0
  364. package/dist/modules/storage/components/image-grid.client.mjs +169 -0
  365. package/dist/modules/storage/components/image-grid.client.mjs.map +1 -0
  366. package/dist/modules/storage/components/upload-zone-context.client.d.mts +34 -0
  367. package/dist/modules/storage/components/upload-zone-context.client.d.mts.map +1 -0
  368. package/dist/modules/storage/components/upload-zone-context.client.mjs +21 -0
  369. package/dist/modules/storage/components/upload-zone-context.client.mjs.map +1 -0
  370. package/dist/modules/storage/components/upload-zone.client.d.mts +51 -0
  371. package/dist/modules/storage/components/upload-zone.client.d.mts.map +1 -0
  372. package/dist/modules/storage/components/upload-zone.client.mjs +196 -0
  373. package/dist/modules/storage/components/upload-zone.client.mjs.map +1 -0
  374. package/dist/modules/{uploads/lib → storage/config}/filters.d.mts +2 -2
  375. package/dist/modules/storage/config/filters.d.mts.map +1 -0
  376. package/dist/modules/{uploads/lib → storage/config}/filters.mjs +3 -3
  377. package/dist/modules/storage/config/filters.mjs.map +1 -0
  378. package/dist/modules/storage/lib/constants.d.mts +10 -0
  379. package/dist/modules/storage/lib/constants.d.mts.map +1 -0
  380. package/dist/modules/{uploads → storage}/lib/constants.mjs +3 -2
  381. package/dist/modules/storage/lib/constants.mjs.map +1 -0
  382. package/dist/modules/storage/lib/create-client.server.d.mts +11 -0
  383. package/dist/modules/storage/lib/create-client.server.d.mts.map +1 -0
  384. package/dist/modules/storage/lib/create-client.server.mjs +11 -0
  385. package/dist/modules/storage/lib/create-client.server.mjs.map +1 -0
  386. package/dist/modules/storage/lib/helpers.d.mts +45 -0
  387. package/dist/modules/storage/lib/helpers.d.mts.map +1 -0
  388. package/dist/modules/{uploads → storage}/lib/helpers.mjs +20 -6
  389. package/dist/modules/storage/lib/helpers.mjs.map +1 -0
  390. package/dist/modules/storage/lib/proxy.server.d.mts +21 -0
  391. package/dist/modules/storage/lib/proxy.server.d.mts.map +1 -0
  392. package/dist/modules/storage/lib/proxy.server.mjs +46 -0
  393. package/dist/modules/storage/lib/proxy.server.mjs.map +1 -0
  394. package/dist/modules/storage/lib/router.server.d.mts +29074 -0
  395. package/dist/modules/storage/lib/router.server.d.mts.map +1 -0
  396. package/dist/modules/storage/lib/router.server.mjs +83 -0
  397. package/dist/modules/storage/lib/router.server.mjs.map +1 -0
  398. package/dist/modules/{uploads → storage}/lib/schema.d.mts +414 -150
  399. package/dist/modules/storage/lib/schema.d.mts.map +1 -0
  400. package/dist/modules/{uploads → storage}/lib/schema.mjs +23 -18
  401. package/dist/modules/storage/lib/schema.mjs.map +1 -0
  402. package/dist/modules/storage/lib/service.server.d.mts +188 -0
  403. package/dist/modules/storage/lib/service.server.d.mts.map +1 -0
  404. package/dist/modules/storage/lib/service.server.mjs +297 -0
  405. package/dist/modules/storage/lib/service.server.mjs.map +1 -0
  406. package/dist/modules/{uploads → storage}/lib/validators.d.mts +413 -108
  407. package/dist/modules/storage/lib/validators.d.mts.map +1 -0
  408. package/dist/modules/storage/lib/validators.mjs +106 -0
  409. package/dist/modules/storage/lib/validators.mjs.map +1 -0
  410. package/dist/storage/client.d.mts +6 -0
  411. package/dist/storage/client.mjs +14 -0
  412. package/dist/storage/client.mjs.map +1 -0
  413. package/dist/storage/server.d.mts +4 -0
  414. package/dist/storage/server.mjs +5 -0
  415. package/dist/storage.d.mts +6 -0
  416. package/dist/storage.mjs +7 -0
  417. package/package.json +32 -20
  418. package/src/components/editor/components/block-dropdown.tsx +43 -25
  419. package/src/components/editor/components/content.client.tsx +1 -1
  420. package/src/components/editor/components/editor.client.tsx +95 -0
  421. package/src/components/editor/components/menu-fixed.client.tsx +165 -0
  422. package/src/components/editor/components/spinner.tsx +2 -2
  423. package/src/components/editor/lib/constants.ts +109 -0
  424. package/src/components/editor/lib/extensions.ts +195 -0
  425. package/src/components/editor/lib/helpers.ts +3 -3
  426. package/src/components/editor/lib/variants.ts +5 -0
  427. package/src/components/entry.client.ts +2 -4
  428. package/src/components/header/top-bar.client.tsx +1 -1
  429. package/src/components/layouts/admin-content.client.tsx +1 -1
  430. package/src/components/ui/calendar.tsx +152 -44
  431. package/src/components/ui/input-recipient.tsx +3 -0
  432. package/src/entry.ts +4 -4
  433. package/src/modules/auth/db/schema.ts +13 -21
  434. package/src/modules/auth/handler/client.client.ts +2 -0
  435. package/src/modules/auth/handler/init.ts +4 -1
  436. package/src/modules/auth/hooks/use-permission.ts +3 -2
  437. package/src/modules/auth/hooks/use-session.ts +16 -10
  438. package/src/modules/auth/lib/validators.ts +1 -1
  439. package/src/modules/commands/components/alert-dialog-command.client.tsx +2 -2
  440. package/src/modules/commands/components/click-command.client.tsx +2 -2
  441. package/src/modules/commands/components/dialog-command.client.tsx +20 -8
  442. package/src/modules/commands/components/dropdown-command.client.tsx +2 -2
  443. package/src/modules/commands/components/form-dialog-command.client.tsx +2 -2
  444. package/src/modules/commands/entry.client.ts +1 -1
  445. package/src/modules/commands/hooks/{use-command-action.client.tsx → use-command-mutation.client.tsx} +9 -47
  446. package/src/modules/commands/utils/delete-command.client.tsx +14 -2
  447. package/src/modules/config/db/create-client.ts +11 -4
  448. package/src/modules/config/entry.server.ts +0 -1
  449. package/src/modules/config/lib/config.ts +3 -3
  450. package/src/modules/config/lib/context.ts +2 -2
  451. package/src/modules/data-tables/components/filters/combobox.client.tsx +3 -3
  452. package/src/modules/data-tables/entry.ts +1 -1
  453. package/src/modules/data-tables/hooks/use-context.client.tsx +31 -13
  454. package/src/modules/data-tables/hooks/use-table.client.ts +6 -3
  455. package/src/modules/data-tables/lib/filters/config.ts +1 -0
  456. package/src/modules/data-tables/lib/filters/helpers.ts +19 -0
  457. package/src/modules/data-tables/lib/filters/parsers.ts +14 -1
  458. package/src/modules/data-tables/lib/filters/resolvers.ts +8 -0
  459. package/src/modules/data-tables/lib/types.ts +10 -3
  460. package/src/modules/data-tables/tables/inline-table/components/cells/drag-handle.client.tsx +1 -1
  461. package/src/modules/inline-edit/components/combobox-dropdown.client.tsx +9 -2
  462. package/src/modules/inline-edit/components/combobox.client.tsx +8 -1
  463. package/src/modules/inline-edit/components/date-input.client.tsx +7 -3
  464. package/src/modules/inline-edit/components/date-picker.client.tsx +10 -3
  465. package/src/modules/inline-edit/components/deprecated-editor.client.tsx +48 -0
  466. package/src/modules/inline-edit/components/editor.client.tsx +32 -29
  467. package/src/modules/inline-edit/components/input-recipient.client.tsx +6 -2
  468. package/src/modules/inline-edit/components/input-toggle.client.tsx +2 -0
  469. package/src/modules/inline-edit/components/input.client.tsx +39 -0
  470. package/src/modules/inline-edit/components/select.client.tsx +9 -2
  471. package/src/modules/inline-edit/components/switch.client.tsx +2 -0
  472. package/src/modules/inline-edit/components/toggle.client.tsx +2 -0
  473. package/src/modules/inline-edit/entry.client.ts +1 -1
  474. package/src/modules/inline-edit/hooks/use-inline.client.tsx +2 -2
  475. package/src/modules/inline-edit/lib/variants.ts +1 -1
  476. package/src/modules/{uploads/components/dropzone/index.tsx → storage/components/dropzone.client.tsx} +2 -2
  477. package/src/modules/storage/components/image-grid.client.tsx +225 -0
  478. package/src/modules/{uploads/components/button.client.tsx → storage/components/upload-button.client.tsx} +1 -1
  479. package/src/modules/storage/components/upload-zone-context.client.tsx +32 -0
  480. package/src/modules/storage/components/upload-zone.client.tsx +258 -0
  481. package/src/modules/{uploads/lib → storage/config}/filters.ts +2 -2
  482. package/src/modules/storage/entry.client.ts +12 -0
  483. package/src/modules/storage/entry.server.ts +6 -0
  484. package/src/modules/{uploads → storage}/entry.ts +1 -1
  485. package/src/modules/storage/lib/constants.ts +14 -0
  486. package/src/modules/storage/lib/create-client.server.ts +14 -0
  487. package/src/modules/{uploads → storage}/lib/helpers.ts +23 -9
  488. package/src/modules/storage/lib/proxy.server.ts +63 -0
  489. package/src/modules/storage/lib/router.server.ts +174 -0
  490. package/src/modules/{uploads → storage}/lib/schema.ts +34 -13
  491. package/src/modules/storage/lib/service.server.ts +463 -0
  492. package/src/modules/storage/lib/validators.ts +156 -0
  493. package/dist/components/editor/components/fixed-menu.client.d.mts +0 -7
  494. package/dist/components/editor/components/fixed-menu.client.d.mts.map +0 -1
  495. package/dist/components/editor/components/fixed-menu.client.mjs.map +0 -1
  496. package/dist/components/editor/context.client.d.mts +0 -33
  497. package/dist/components/editor/context.client.d.mts.map +0 -1
  498. package/dist/components/editor/context.client.mjs +0 -45
  499. package/dist/components/editor/context.client.mjs.map +0 -1
  500. package/dist/components/editor/index.client.d.mts +0 -11
  501. package/dist/components/editor/index.client.d.mts.map +0 -1
  502. package/dist/components/editor/index.client.mjs +0 -17
  503. package/dist/components/editor/index.client.mjs.map +0 -1
  504. package/dist/components/editor/preview.client.d.mts +0 -12
  505. package/dist/components/editor/preview.client.d.mts.map +0 -1
  506. package/dist/components/editor/preview.client.mjs +0 -19
  507. package/dist/components/editor/preview.client.mjs.map +0 -1
  508. package/dist/modules/commands/hooks/use-command-action.client.d.mts +0 -22
  509. package/dist/modules/commands/hooks/use-command-action.client.d.mts.map +0 -1
  510. package/dist/modules/commands/hooks/use-command-action.client.mjs +0 -74
  511. package/dist/modules/commands/hooks/use-command-action.client.mjs.map +0 -1
  512. package/dist/modules/config/providers/blob.d.mts +0 -10
  513. package/dist/modules/config/providers/blob.d.mts.map +0 -1
  514. package/dist/modules/config/providers/blob.mjs +0 -11
  515. package/dist/modules/config/providers/blob.mjs.map +0 -1
  516. package/dist/modules/inline-edit/components/richtext.client.d.mts +0 -15
  517. package/dist/modules/inline-edit/components/richtext.client.d.mts.map +0 -1
  518. package/dist/modules/inline-edit/components/richtext.client.mjs +0 -31
  519. package/dist/modules/inline-edit/components/richtext.client.mjs.map +0 -1
  520. package/dist/modules/uploads/components/button.client.d.mts +0 -12
  521. package/dist/modules/uploads/components/button.client.d.mts.map +0 -1
  522. package/dist/modules/uploads/components/button.client.mjs +0 -34
  523. package/dist/modules/uploads/components/button.client.mjs.map +0 -1
  524. package/dist/modules/uploads/components/dropzone/context.d.mts.map +0 -1
  525. package/dist/modules/uploads/components/dropzone/context.mjs.map +0 -1
  526. package/dist/modules/uploads/components/dropzone/index.d.mts.map +0 -1
  527. package/dist/modules/uploads/components/dropzone/index.mjs.map +0 -1
  528. package/dist/modules/uploads/components/images/grid.client.d.mts +0 -11
  529. package/dist/modules/uploads/components/images/grid.client.d.mts.map +0 -1
  530. package/dist/modules/uploads/components/images/grid.client.mjs +0 -119
  531. package/dist/modules/uploads/components/images/grid.client.mjs.map +0 -1
  532. package/dist/modules/uploads/components/images/input.client.d.mts +0 -16
  533. package/dist/modules/uploads/components/images/input.client.d.mts.map +0 -1
  534. package/dist/modules/uploads/components/images/input.client.mjs +0 -28
  535. package/dist/modules/uploads/components/images/input.client.mjs.map +0 -1
  536. package/dist/modules/uploads/components/preview-dialog.client.d.mts +0 -16
  537. package/dist/modules/uploads/components/preview-dialog.client.d.mts.map +0 -1
  538. package/dist/modules/uploads/components/preview-dialog.client.mjs +0 -22
  539. package/dist/modules/uploads/components/preview-dialog.client.mjs.map +0 -1
  540. package/dist/modules/uploads/components/zone.client.d.mts +0 -21
  541. package/dist/modules/uploads/components/zone.client.d.mts.map +0 -1
  542. package/dist/modules/uploads/components/zone.client.mjs +0 -38
  543. package/dist/modules/uploads/components/zone.client.mjs.map +0 -1
  544. package/dist/modules/uploads/hooks/use-upload-image.client.d.mts +0 -34
  545. package/dist/modules/uploads/hooks/use-upload-image.client.d.mts.map +0 -1
  546. package/dist/modules/uploads/hooks/use-upload-image.client.mjs +0 -101
  547. package/dist/modules/uploads/hooks/use-upload-image.client.mjs.map +0 -1
  548. package/dist/modules/uploads/hooks/use-upload-zone.client.d.mts +0 -39
  549. package/dist/modules/uploads/hooks/use-upload-zone.client.d.mts.map +0 -1
  550. package/dist/modules/uploads/hooks/use-upload-zone.client.mjs +0 -20
  551. package/dist/modules/uploads/hooks/use-upload-zone.client.mjs.map +0 -1
  552. package/dist/modules/uploads/lib/constants.d.mts +0 -9
  553. package/dist/modules/uploads/lib/constants.d.mts.map +0 -1
  554. package/dist/modules/uploads/lib/constants.mjs.map +0 -1
  555. package/dist/modules/uploads/lib/filters.d.mts.map +0 -1
  556. package/dist/modules/uploads/lib/filters.mjs.map +0 -1
  557. package/dist/modules/uploads/lib/helpers.d.mts +0 -36
  558. package/dist/modules/uploads/lib/helpers.d.mts.map +0 -1
  559. package/dist/modules/uploads/lib/helpers.mjs.map +0 -1
  560. package/dist/modules/uploads/lib/procedures.server.d.mts +0 -13628
  561. package/dist/modules/uploads/lib/procedures.server.d.mts.map +0 -1
  562. package/dist/modules/uploads/lib/procedures.server.mjs +0 -176
  563. package/dist/modules/uploads/lib/procedures.server.mjs.map +0 -1
  564. package/dist/modules/uploads/lib/proxy.server.d.mts +0 -54
  565. package/dist/modules/uploads/lib/proxy.server.d.mts.map +0 -1
  566. package/dist/modules/uploads/lib/proxy.server.mjs +0 -97
  567. package/dist/modules/uploads/lib/proxy.server.mjs.map +0 -1
  568. package/dist/modules/uploads/lib/route.server.d.mts +0 -43
  569. package/dist/modules/uploads/lib/route.server.d.mts.map +0 -1
  570. package/dist/modules/uploads/lib/route.server.mjs +0 -70
  571. package/dist/modules/uploads/lib/route.server.mjs.map +0 -1
  572. package/dist/modules/uploads/lib/schema.d.mts.map +0 -1
  573. package/dist/modules/uploads/lib/schema.mjs.map +0 -1
  574. package/dist/modules/uploads/lib/validators.d.mts.map +0 -1
  575. package/dist/modules/uploads/lib/validators.mjs +0 -26
  576. package/dist/modules/uploads/lib/validators.mjs.map +0 -1
  577. package/dist/uploads/client.d.mts +0 -10
  578. package/dist/uploads/client.mjs +0 -11
  579. package/dist/uploads/server.d.mts +0 -4
  580. package/dist/uploads/server.mjs +0 -5
  581. package/dist/uploads.d.mts +0 -6
  582. package/dist/uploads.mjs +0 -7
  583. package/src/components/editor/components/fixed-menu.client.tsx +0 -143
  584. package/src/components/editor/context.client.tsx +0 -116
  585. package/src/components/editor/index.client.tsx +0 -13
  586. package/src/components/editor/preview.client.tsx +0 -13
  587. package/src/modules/config/providers/blob.ts +0 -11
  588. package/src/modules/inline-edit/components/richtext.client.tsx +0 -38
  589. package/src/modules/uploads/components/images/grid.client.tsx +0 -162
  590. package/src/modules/uploads/components/images/input.client.tsx +0 -34
  591. package/src/modules/uploads/components/preview-dialog.client.tsx +0 -21
  592. package/src/modules/uploads/components/zone.client.tsx +0 -56
  593. package/src/modules/uploads/entry.client.ts +0 -16
  594. package/src/modules/uploads/entry.server.ts +0 -6
  595. package/src/modules/uploads/hooks/use-upload-image.client.tsx +0 -131
  596. package/src/modules/uploads/hooks/use-upload-zone.client.ts +0 -44
  597. package/src/modules/uploads/lib/constants.ts +0 -10
  598. package/src/modules/uploads/lib/procedures.server.ts +0 -332
  599. package/src/modules/uploads/lib/proxy.server.ts +0 -139
  600. package/src/modules/uploads/lib/route.server.ts +0 -93
  601. package/src/modules/uploads/lib/validators.ts +0 -50
  602. /package/src/modules/{uploads/components/dropzone/context.tsx → storage/components/dropzone-context.client.tsx} +0 -0
@@ -1,45 +0,0 @@
1
- "use client";
2
-
3
- import { cn } from "../../lib/utils/cn.mjs";
4
- import { jsx } from "react/jsx-runtime";
5
- import { createContext } from "react";
6
- import StarterKit from "@tiptap/starter-kit";
7
- import { useEditor } from "@tiptap/react";
8
- import { Color } from "@tiptap/extension-color";
9
- import Highlight from "@tiptap/extension-highlight";
10
- import Link from "@tiptap/extension-link";
11
- import { TextStyle } from "@tiptap/extension-text-style";
12
- import Underline from "@tiptap/extension-underline";
13
-
14
- //#region src/components/editor/context.client.tsx
15
- const EditorContext = createContext({});
16
- function EditorContextProvider({ value, onChange, disabled, className, children }) {
17
- const editor = useEditor({
18
- extensions: [
19
- StarterKit,
20
- Underline,
21
- Link,
22
- TextStyle,
23
- Color,
24
- Highlight.configure({ multicolor: true })
25
- ],
26
- content: value,
27
- onUpdate: ({ editor: editor$1 }) => onChange?.(editor$1.getJSON()),
28
- editable: !disabled,
29
- injectCSS: false,
30
- immediatelyRender: false,
31
- editorProps: {
32
- transformPastedHTML: (html) => html.replace(/<img.*?>/g, ""),
33
- attributes: { class: cn("prose max-w-full min-h-96 dark:prose-invert p-5 focus:outline-none prose-a:text-primary prose-li:marker:text-primary", className) }
34
- }
35
- });
36
- if (!editor) return null;
37
- return /* @__PURE__ */ jsx(EditorContext.Provider, {
38
- value: { editor },
39
- children
40
- });
41
- }
42
-
43
- //#endregion
44
- export { EditorContext, EditorContextProvider };
45
- //# sourceMappingURL=context.client.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"context.client.mjs","names":["editor"],"sources":["../../../src/components/editor/context.client.tsx"],"sourcesContent":["\"use client\";\n\nimport { cn } from \"@/lib/utils/cn\";\nimport { Color } from \"@tiptap/extension-color\";\nimport Highlight from \"@tiptap/extension-highlight\";\nimport Link from \"@tiptap/extension-link\";\nimport { TextStyle } from \"@tiptap/extension-text-style\";\nimport Underline from \"@tiptap/extension-underline\";\nimport { Content, Editor, useEditor } from \"@tiptap/react\";\nimport StarterKit from \"@tiptap/starter-kit\";\nimport { createContext, PropsWithChildren } from \"react\";\nimport { EditorJSONContent } from \"./lib/types\";\n\n/**\n * Editor context\n */\ntype EditorContextValue = {\n editor: Editor;\n};\n\nexport const EditorContext = createContext({} as EditorContextValue);\n\n/**\n * Editor context provider\n */\ntype EditorContextProviderProps = PropsWithChildren<{\n value?: Content;\n onChange?: (value: EditorJSONContent) => void;\n disabled?: boolean;\n className?: string;\n}>;\n\nexport function EditorContextProvider({\n value,\n onChange,\n disabled,\n className,\n children,\n}: EditorContextProviderProps) {\n // const { uploadImage } = useUploadEditor();\n\n const editor = useEditor({\n extensions: [\n StarterKit,\n Underline,\n Link,\n TextStyle,\n Color,\n Highlight.configure({ multicolor: true }),\n // Image.configure({\n // allowBase64: false,\n // }),\n // FileHandler.configure({\n // allowedMimeTypes: [\"image/png\", \"image/jpeg\", \"image/gif\", \"image/webp\"],\n // onDrop: (currentEditor, files, pos) => {\n // files.forEach((file) => {\n // const fileReader = new FileReader();\n\n // fileReader.readAsArrayBuffer(file);\n // fileReader.onload = async () => {\n // const response = await uploadImage(file);\n // if (!response) return;\n\n // currentEditor\n // .chain()\n // .insertContentAt(pos, {\n // type: \"image\",\n // attrs: { src: response.url },\n // })\n // .focus()\n // .run();\n // };\n // });\n // },\n // onPaste: (currentEditor, files) => {\n // files.forEach((file) => {\n // const fileReader = new FileReader();\n\n // fileReader.readAsArrayBuffer(file);\n // fileReader.onload = async () => {\n // const response = await uploadImage(file);\n // if (!response) return;\n\n // currentEditor\n // .chain()\n // .insertContentAt(currentEditor.state.selection.anchor, {\n // type: \"image\",\n // attrs: { src: response.url },\n // })\n // .focus()\n // .run();\n // };\n // });\n // },\n // }),\n ],\n content: value,\n onUpdate: ({ editor }) => onChange?.(editor.getJSON()),\n editable: !disabled,\n injectCSS: false,\n immediatelyRender: false,\n editorProps: {\n transformPastedHTML: (html) => html.replace(/<img.*?>/g, \"\"),\n attributes: {\n class: cn(\n \"prose max-w-full min-h-96 dark:prose-invert p-5 focus:outline-none prose-a:text-primary prose-li:marker:text-primary\",\n className,\n ),\n },\n },\n });\n\n if (!editor) return null;\n\n return <EditorContext.Provider value={{ editor }}>{children}</EditorContext.Provider>;\n}\n"],"mappings":";;;;;;;;;;;;;;AAoBA,MAAa,gBAAgB,cAAc,EAAE,CAAuB;AAYpE,SAAgB,sBAAsB,EACpC,OACA,UACA,UACA,WACA,YAC6B;CAG7B,MAAM,SAAS,UAAU;EACvB,YAAY;GACV;GACA;GACA;GACA;GACA;GACA,UAAU,UAAU,EAAE,YAAY,MAAM,CAAC;GA+C1C;EACD,SAAS;EACT,WAAW,EAAE,uBAAa,WAAWA,SAAO,SAAS,CAAC;EACtD,UAAU,CAAC;EACX,WAAW;EACX,mBAAmB;EACnB,aAAa;GACX,sBAAsB,SAAS,KAAK,QAAQ,aAAa,GAAG;GAC5D,YAAY,EACV,OAAO,GACL,wHACA,UACD,EACF;GACF;EACF,CAAC;AAEF,KAAI,CAAC,OAAQ,QAAO;AAEpB,QAAO,oBAAC,cAAc;EAAS,OAAO,EAAE,QAAQ;EAAG;GAAkC"}
@@ -1,11 +0,0 @@
1
- import * as react_jsx_runtime124 from "react/jsx-runtime";
2
- import { HTMLAttributes } from "react";
3
-
4
- //#region src/components/editor/index.client.d.ts
5
- declare function Editor({
6
- className,
7
- ...props
8
- }: HTMLAttributes<HTMLDivElement>): react_jsx_runtime124.JSX.Element;
9
- //#endregion
10
- export { Editor };
11
- //# sourceMappingURL=index.client.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.client.d.mts","names":[],"sources":["../../../src/components/editor/index.client.tsx"],"sourcesContent":[],"mappings":";;;;iBAKgB,MAAA;;;GAAgC,eAAe,kBAAe,oBAAA,CAAA,GAAA,CAAA"}
@@ -1,17 +0,0 @@
1
- import { cn } from "../../lib/utils/cn.mjs";
2
- import { EditorContent } from "./components/content.client.mjs";
3
- import { FixedMenu } from "./components/fixed-menu.client.mjs";
4
- import { jsx, jsxs } from "react/jsx-runtime";
5
-
6
- //#region src/components/editor/index.client.tsx
7
- function Editor({ className, ...props }) {
8
- return /* @__PURE__ */ jsxs("div", {
9
- className: cn("border-input rounded-lg border", className),
10
- ...props,
11
- children: [/* @__PURE__ */ jsx(FixedMenu, {}), /* @__PURE__ */ jsx(EditorContent, {})]
12
- });
13
- }
14
-
15
- //#endregion
16
- export { Editor };
17
- //# sourceMappingURL=index.client.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.client.mjs","names":[],"sources":["../../../src/components/editor/index.client.tsx"],"sourcesContent":["import { cn } from \"@/lib/utils/cn\";\nimport { type HTMLAttributes } from \"react\";\nimport { EditorContent } from \"./components/content.client\";\nimport { FixedMenu } from \"./components/fixed-menu.client\";\n\nexport function Editor({ className, ...props }: HTMLAttributes<HTMLDivElement>) {\n return (\n <div className={cn(\"border-input rounded-lg border\", className)} {...props}>\n <FixedMenu />\n <EditorContent />\n </div>\n );\n}\n"],"mappings":";;;;;;AAKA,SAAgB,OAAO,EAAE,WAAW,GAAG,SAAyC;AAC9E,QACE,qBAAC;EAAI,WAAW,GAAG,kCAAkC,UAAU;EAAE,GAAI;aACnE,oBAAC,cAAY,EACb,oBAAC,kBAAgB;GACb"}
@@ -1,12 +0,0 @@
1
- import { EditorJSONContent } from "./lib/types.mjs";
2
- import * as react_jsx_runtime125 from "react/jsx-runtime";
3
-
4
- //#region src/components/editor/preview.client.d.ts
5
- declare function EditorPreview({
6
- value
7
- }: {
8
- value?: EditorJSONContent;
9
- }): react_jsx_runtime125.JSX.Element;
10
- //#endregion
11
- export { EditorPreview };
12
- //# sourceMappingURL=preview.client.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"preview.client.d.mts","names":[],"sources":["../../../src/components/editor/preview.client.tsx"],"sourcesContent":[],"mappings":";;;;iBAMgB,aAAA;;;UAAmC;IAAmB,oBAAA,CAAA,GAAA,CAAA"}
@@ -1,19 +0,0 @@
1
- "use client";
2
-
3
- import { EditorContextProvider } from "./context.client.mjs";
4
- import { EditorContent } from "./components/content.client.mjs";
5
- import { jsx } from "react/jsx-runtime";
6
-
7
- //#region src/components/editor/preview.client.tsx
8
- function EditorPreview({ value }) {
9
- return /* @__PURE__ */ jsx(EditorContextProvider, {
10
- value,
11
- className: "min-h-0 p-0",
12
- disabled: true,
13
- children: /* @__PURE__ */ jsx(EditorContent, {})
14
- });
15
- }
16
-
17
- //#endregion
18
- export { EditorPreview };
19
- //# sourceMappingURL=preview.client.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"preview.client.mjs","names":[],"sources":["../../../src/components/editor/preview.client.tsx"],"sourcesContent":["\"use client\";\n\nimport { EditorContent } from \"./components/content.client\";\nimport { EditorContextProvider } from \"./context.client\";\nimport { EditorJSONContent } from \"./lib/types\";\n\nexport function EditorPreview({ value }: { value?: EditorJSONContent }) {\n return (\n <EditorContextProvider value={value} className=\"min-h-0 p-0\" disabled>\n <EditorContent />\n </EditorContextProvider>\n );\n}\n"],"mappings":";;;;;;;AAMA,SAAgB,cAAc,EAAE,SAAwC;AACtE,QACE,oBAAC;EAA6B;EAAO,WAAU;EAAc;YAC3D,oBAAC,kBAAgB;GACK"}
@@ -1,22 +0,0 @@
1
- import * as _tanstack_react_query0 from "@tanstack/react-query";
2
- import { DefaultError, MutationOptions } from "@tanstack/react-query";
3
-
4
- //#region src/modules/commands/hooks/use-command-action.client.d.ts
5
- type CommandActionResult = Promise<unknown>;
6
- type CommandAction<TInput = void> = (input: TInput) => CommandActionResult;
7
- type BulkCommandAction = (params: {
8
- ids: string[];
9
- }) => CommandActionResult;
10
- /**
11
- * Hook to use command
12
- * @returns Command context value
13
- */
14
- declare function useCommandAction<TInput = void>(action: CommandAction<TInput>, options?: {
15
- message?: string;
16
- onSuccess?: () => Promise<void> | void;
17
- onError?: () => Promise<void> | void;
18
- }): (input: TInput) => CommandActionResult;
19
- declare function useCommandAction2<TData = unknown, TError = DefaultError, TVariables = void, TOnMutateResult = unknown>(options?: MutationOptions<TData, TError, TVariables, TOnMutateResult>): _tanstack_react_query0.UseMutationResult<TData, TError, TVariables, TOnMutateResult>;
20
- //#endregion
21
- export { BulkCommandAction, CommandAction, CommandActionResult, useCommandAction, useCommandAction2 };
22
- //# sourceMappingURL=use-command-action.client.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-command-action.client.d.mts","names":[],"sources":["../../../../src/modules/commands/hooks/use-command-action.client.tsx"],"sourcesContent":[],"mappings":";;;;KAOY,mBAAA,GAAsB;KAEtB,uCAAuC,WAAW;KAClD,iBAAA;EAHA,GAAA,EAAA,MAAA,EAAA;AAEZ,CAAA,EAAA,GAC+D,mBADtC;AACzB;AAMA;;;AAIsB,iBAJN,gBAIM,CAAA,SAAA,IAAA,CAAA,CAAA,MAAA,EAHZ,aAGY,CAHE,MAGF,CAAA,EAAA,OAmCwC,CAnCxC,EAAA;EACF,OAAA,CAAA,EAAA,MAAA;EAkCY,SAAA,CAAA,EAAA,GAAA,GAnCV,OAmCU,CAAA,IAAA,CAAA,GAAA,IAAA;EAAW,OAAA,CAAA,EAAA,GAAA,GAlCvB,OAkCuB,CAAA,IAAA,CAAA,GAAA,IAAA;CAAmB,CAAA,EAAA,CAAA,KAAA,EAA9B,MAA8B,EAAA,GAAnB,mBAAmB;AAG9C,iBAAA,iBAAiB,CAAA,QAAA,OAAA,EAAA,SAEtB,YAFsB,EAAA,aAAA,IAAA,EAAA,kBAAA,OAAA,CAAA,CAAA,OAAA,CAAA,EAKrB,eALqB,CAKL,KALK,EAKE,MALF,EAKU,UALV,EAKsB,eALtB,CAAA,CAAA,EAKsC,sBAAA,CAAA,iBALtC,CAKsC,KALtC,EAKsC,MALtC,EAKsC,UALtC,EAKsC,eALtC,CAAA"}
@@ -1,74 +0,0 @@
1
- "use client";
2
-
3
- import { useCommand } from "./context.client.mjs";
4
- import { useAction } from "../../../lib/hooks/use-action.mjs";
5
- import { toast } from "sonner";
6
-
7
- //#region src/modules/commands/hooks/use-command-action.client.tsx
8
- /**
9
- * Hook to use command
10
- * @returns Command context value
11
- */
12
- function useCommandAction(action, options) {
13
- const commandContext = useCommand();
14
- const { mutateAsync } = useAction({
15
- mutationFn: action,
16
- onMutate: () => {
17
- commandContext.setStatus("pending");
18
- },
19
- onSuccess: async () => {
20
- commandContext.setStatus("success");
21
- toast.success(options?.message || "Actie voltooid!");
22
- await options?.onSuccess?.();
23
- await commandContext.onSuccess?.();
24
- },
25
- onRedirect: async () => {
26
- commandContext.setStatus("success");
27
- toast.success(options?.message || "Actie voltooid!");
28
- await options?.onSuccess?.();
29
- await commandContext.onSuccess?.();
30
- },
31
- onError: async () => {
32
- commandContext.setStatus("error");
33
- await options?.onError?.();
34
- await commandContext.onError?.();
35
- },
36
- onSettled: () => {
37
- commandContext.setStatus("idle");
38
- }
39
- });
40
- return mutateAsync;
41
- }
42
- function useCommandAction2(options) {
43
- const commandContext = useCommand();
44
- return useAction({
45
- ...options,
46
- mutationFn: options?.mutationFn,
47
- onMutate: async (...params) => {
48
- const result = options?.onMutate?.(...params);
49
- commandContext.setStatus("pending");
50
- return await result;
51
- },
52
- onSuccess: async (...params) => {
53
- const result = options?.onSuccess?.(...params);
54
- commandContext.setStatus("success");
55
- await commandContext.onSuccess?.();
56
- return await result;
57
- },
58
- onError: async (...params) => {
59
- const result = options?.onError?.(...params);
60
- commandContext.setStatus("error");
61
- await commandContext.onError?.();
62
- return await result;
63
- },
64
- onSettled: async (...params) => {
65
- const result = options?.onSettled?.(...params);
66
- commandContext.setStatus("idle");
67
- return await result;
68
- }
69
- });
70
- }
71
-
72
- //#endregion
73
- export { useCommandAction, useCommandAction2 };
74
- //# sourceMappingURL=use-command-action.client.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-command-action.client.mjs","names":[],"sources":["../../../../src/modules/commands/hooks/use-command-action.client.tsx"],"sourcesContent":["\"use client\";\n\nimport { useAction } from \"@/lib/hooks/use-action\";\nimport type { DefaultError, MutationFunction, MutationOptions } from \"@tanstack/react-query\";\nimport { toast } from \"sonner\";\nimport { useCommand } from \"./context.client\";\n\nexport type CommandActionResult = Promise<unknown>;\n\nexport type CommandAction<TInput = void> = (input: TInput) => CommandActionResult;\nexport type BulkCommandAction = (params: { ids: string[] }) => CommandActionResult;\n\n/**\n * Hook to use command\n * @returns Command context value\n */\nexport function useCommandAction<TInput = void>(\n action: CommandAction<TInput>,\n options?: {\n message?: string;\n onSuccess?: () => Promise<void> | void;\n onError?: () => Promise<void> | void;\n },\n) {\n const commandContext = useCommand();\n\n const { mutateAsync } = useAction({\n mutationFn: action,\n onMutate: () => {\n commandContext.setStatus(\"pending\");\n },\n onSuccess: async () => {\n commandContext.setStatus(\"success\");\n toast.success(options?.message || \"Actie voltooid!\");\n await options?.onSuccess?.();\n await commandContext.onSuccess?.();\n },\n onRedirect: async () => {\n commandContext.setStatus(\"success\");\n toast.success(options?.message || \"Actie voltooid!\");\n await options?.onSuccess?.();\n await commandContext.onSuccess?.();\n },\n onError: async () => {\n commandContext.setStatus(\"error\");\n await options?.onError?.();\n await commandContext.onError?.();\n },\n onSettled: () => {\n commandContext.setStatus(\"idle\");\n // finnalyCallback?.();\n // options?.callback?.();\n },\n });\n\n return mutateAsync as (input: TInput) => CommandActionResult;\n}\n\nexport function useCommandAction2<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n>(options?: MutationOptions<TData, TError, TVariables, TOnMutateResult>) {\n const commandContext = useCommand();\n\n const mutation = useAction({\n ...options,\n mutationFn: options?.mutationFn as MutationFunction<TData, TVariables>,\n onMutate: async (...params) => {\n const result = options?.onMutate?.(...params);\n\n commandContext.setStatus(\"pending\");\n\n return (await result) as TOnMutateResult;\n },\n onSuccess: async (...params) => {\n const result = options?.onSuccess?.(...params);\n\n commandContext.setStatus(\"success\");\n await commandContext.onSuccess?.();\n\n return await result;\n },\n onError: async (...params) => {\n const result = options?.onError?.(...params);\n\n commandContext.setStatus(\"error\");\n await commandContext.onError?.();\n\n return await result;\n },\n onSettled: async (...params) => {\n const result = options?.onSettled?.(...params);\n\n commandContext.setStatus(\"idle\");\n\n return await result;\n },\n });\n\n return mutation;\n}\n"],"mappings":";;;;;;;;;;;AAgBA,SAAgB,iBACd,QACA,SAKA;CACA,MAAM,iBAAiB,YAAY;CAEnC,MAAM,EAAE,gBAAgB,UAAU;EAChC,YAAY;EACZ,gBAAgB;AACd,kBAAe,UAAU,UAAU;;EAErC,WAAW,YAAY;AACrB,kBAAe,UAAU,UAAU;AACnC,SAAM,QAAQ,SAAS,WAAW,kBAAkB;AACpD,SAAM,SAAS,aAAa;AAC5B,SAAM,eAAe,aAAa;;EAEpC,YAAY,YAAY;AACtB,kBAAe,UAAU,UAAU;AACnC,SAAM,QAAQ,SAAS,WAAW,kBAAkB;AACpD,SAAM,SAAS,aAAa;AAC5B,SAAM,eAAe,aAAa;;EAEpC,SAAS,YAAY;AACnB,kBAAe,UAAU,QAAQ;AACjC,SAAM,SAAS,WAAW;AAC1B,SAAM,eAAe,WAAW;;EAElC,iBAAiB;AACf,kBAAe,UAAU,OAAO;;EAInC,CAAC;AAEF,QAAO;;AAGT,SAAgB,kBAKd,SAAuE;CACvE,MAAM,iBAAiB,YAAY;AAqCnC,QAnCiB,UAAU;EACzB,GAAG;EACH,YAAY,SAAS;EACrB,UAAU,OAAO,GAAG,WAAW;GAC7B,MAAM,SAAS,SAAS,WAAW,GAAG,OAAO;AAE7C,kBAAe,UAAU,UAAU;AAEnC,UAAQ,MAAM;;EAEhB,WAAW,OAAO,GAAG,WAAW;GAC9B,MAAM,SAAS,SAAS,YAAY,GAAG,OAAO;AAE9C,kBAAe,UAAU,UAAU;AACnC,SAAM,eAAe,aAAa;AAElC,UAAO,MAAM;;EAEf,SAAS,OAAO,GAAG,WAAW;GAC5B,MAAM,SAAS,SAAS,UAAU,GAAG,OAAO;AAE5C,kBAAe,UAAU,QAAQ;AACjC,SAAM,eAAe,WAAW;AAEhC,UAAO,MAAM;;EAEf,WAAW,OAAO,GAAG,WAAW;GAC9B,MAAM,SAAS,SAAS,YAAY,GAAG,OAAO;AAE9C,kBAAe,UAAU,OAAO;AAEhC,UAAO,MAAM;;EAEhB,CAAC"}
@@ -1,10 +0,0 @@
1
- import "server-cli-only";
2
- import { S3Client, S3ClientConfig } from "@aws-sdk/client-s3";
3
-
4
- //#region src/modules/config/providers/blob.d.ts
5
- type InitBlobProviderProps = S3ClientConfig;
6
- declare function initBlobProvider(props: InitBlobProviderProps): S3Client;
7
- type BlobClient = ReturnType<typeof initBlobProvider>;
8
- //#endregion
9
- export { BlobClient, initBlobProvider };
10
- //# sourceMappingURL=blob.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"blob.d.mts","names":[],"sources":["../../../../src/modules/config/providers/blob.ts"],"sourcesContent":[],"mappings":";;;;KAIK,qBAAA,GAAwB;iBAEb,gBAAA,QAAwB,wBAAqB;AAFxD,KAMO,UAAA,GAAa,UANC,CAAA,OAMiB,gBANA,CAAA"}
@@ -1,11 +0,0 @@
1
- import "server-cli-only";
2
- import { S3Client } from "@aws-sdk/client-s3";
3
-
4
- //#region src/modules/config/providers/blob.ts
5
- function initBlobProvider(props) {
6
- return new S3Client(props);
7
- }
8
-
9
- //#endregion
10
- export { initBlobProvider };
11
- //# sourceMappingURL=blob.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"blob.mjs","names":[],"sources":["../../../../src/modules/config/providers/blob.ts"],"sourcesContent":["import \"server-cli-only\";\n\nimport { S3Client, S3ClientConfig } from \"@aws-sdk/client-s3\";\n\ntype InitBlobProviderProps = S3ClientConfig;\n\nexport function initBlobProvider(props: InitBlobProviderProps) {\n return new S3Client(props);\n}\n\nexport type BlobClient = ReturnType<typeof initBlobProvider>;\n"],"mappings":";;;;AAMA,SAAgB,iBAAiB,OAA8B;AAC7D,QAAO,IAAI,SAAS,MAAM"}
@@ -1,15 +0,0 @@
1
- import { Input } from "../../../components/ui/input.mjs";
2
- import { useInlineEditOptions } from "../hooks/use-inline.client.mjs";
3
- import * as react_jsx_runtime25 from "react/jsx-runtime";
4
- import { ComponentProps } from "react";
5
-
6
- //#region src/modules/inline-edit/components/richtext.client.d.ts
7
- declare function InlineRichtext({
8
- initialValue,
9
- action,
10
- disabled,
11
- ...props
12
- }: Omit<ComponentProps<typeof Input>, "type"> & useInlineEditOptions<string>): react_jsx_runtime25.JSX.Element;
13
- //#endregion
14
- export { InlineRichtext };
15
- //# sourceMappingURL=richtext.client.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"richtext.client.d.mts","names":[],"sources":["../../../../src/modules/inline-edit/components/richtext.client.tsx"],"sourcesContent":[],"mappings":";;;;;;iBASgB,cAAA;;;;;GAKb,KAAK,sBAAsB,kBAAkB,+BAA4B,mBAAA,CAAA,GAAA,CAAA"}
@@ -1,31 +0,0 @@
1
- "use client";
2
-
3
- import { EditorContextProvider } from "../../../components/editor/context.client.mjs";
4
- import { Editor } from "../../../components/editor/index.client.mjs";
5
- import { useInlineEdit } from "../hooks/use-inline.client.mjs";
6
- import { jsx } from "react/jsx-runtime";
7
- import { useEffect } from "react";
8
- import { useDebounce } from "use-debounce";
9
-
10
- //#region src/modules/inline-edit/components/richtext.client.tsx
11
- function InlineRichtext({ initialValue, action, disabled, ...props }) {
12
- const { value, setValue, handleUpdate } = useInlineEdit({
13
- initialValue,
14
- action
15
- });
16
- const [debouncedValue] = useDebounce(value, 500);
17
- useEffect(() => {
18
- if (!value) return;
19
- handleUpdate(value);
20
- }, [debouncedValue]);
21
- return /* @__PURE__ */ jsx(EditorContextProvider, {
22
- value: value ? JSON.parse(value) : void 0,
23
- onChange: (value$1) => setValue(JSON.stringify(value$1)),
24
- disabled,
25
- children: /* @__PURE__ */ jsx(Editor, { ...props })
26
- });
27
- }
28
-
29
- //#endregion
30
- export { InlineRichtext };
31
- //# sourceMappingURL=richtext.client.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"richtext.client.mjs","names":["value"],"sources":["../../../../src/modules/inline-edit/components/richtext.client.tsx"],"sourcesContent":["\"use client\";\n\nimport { EditorContextProvider } from \"@/components/editor/context.client\";\nimport { Editor } from \"@/components/editor/index.client\";\nimport { Input } from \"@/components/ui/input\";\nimport { ComponentProps, useEffect } from \"react\";\nimport { useDebounce } from \"use-debounce\";\nimport { useInlineEdit, type useInlineEditOptions } from \"../hooks/use-inline.client\";\n\nexport function InlineRichtext({\n initialValue,\n action,\n disabled,\n ...props\n}: Omit<ComponentProps<typeof Input>, \"type\"> & useInlineEditOptions<string>) {\n const { value, setValue, handleUpdate } = useInlineEdit<string>({\n initialValue,\n action,\n });\n\n const [debouncedValue] = useDebounce(value, 500);\n\n useEffect(() => {\n if (!value) return;\n handleUpdate(value);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [debouncedValue]);\n\n return (\n <EditorContextProvider\n value={value ? JSON.parse(value) : undefined}\n onChange={(value) => setValue(JSON.stringify(value))}\n disabled={disabled}\n >\n <Editor {...props} />\n </EditorContextProvider>\n );\n}\n"],"mappings":";;;;;;;;;;AASA,SAAgB,eAAe,EAC7B,cACA,QACA,UACA,GAAG,SACyE;CAC5E,MAAM,EAAE,OAAO,UAAU,iBAAiB,cAAsB;EAC9D;EACA;EACD,CAAC;CAEF,MAAM,CAAC,kBAAkB,YAAY,OAAO,IAAI;AAEhD,iBAAgB;AACd,MAAI,CAAC,MAAO;AACZ,eAAa,MAAM;IAElB,CAAC,eAAe,CAAC;AAEpB,QACE,oBAAC;EACC,OAAO,QAAQ,KAAK,MAAM,MAAM,GAAG;EACnC,WAAW,YAAU,SAAS,KAAK,UAAUA,QAAM,CAAC;EAC1C;YAEV,oBAAC,UAAO,GAAI,QAAS;GACC"}
@@ -1,12 +0,0 @@
1
- import { Button } from "../../../components/ui/button.mjs";
2
- import * as react_jsx_runtime3 from "react/jsx-runtime";
3
- import { ComponentProps } from "react";
4
-
5
- //#region src/modules/uploads/components/button.client.d.ts
6
- declare function UploadButton({
7
- className,
8
- ...props
9
- }: ComponentProps<typeof Button>): react_jsx_runtime3.JSX.Element;
10
- //#endregion
11
- export { UploadButton };
12
- //# sourceMappingURL=button.client.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"button.client.d.mts","names":[],"sources":["../../../../src/modules/uploads/components/button.client.tsx"],"sourcesContent":[],"mappings":";;;;;iBASgB,YAAA;;;GAAsC,sBAAsB,UAAO,kBAAA,CAAA,GAAA,CAAA"}
@@ -1,34 +0,0 @@
1
- "use client";
2
-
3
- import { cn } from "../../../lib/utils/cn.mjs";
4
- import { Button } from "../../../components/ui/button.mjs";
5
- import { Input } from "../../../components/ui/input.mjs";
6
- import { useUploadZone } from "../hooks/use-upload-zone.client.mjs";
7
- import { UploadIcon } from "lucide-react";
8
- import { jsx, jsxs } from "react/jsx-runtime";
9
-
10
- //#region src/modules/uploads/components/button.client.tsx
11
- function UploadButton({ className, ...props }) {
12
- const { onUpload } = useUploadZone();
13
- return /* @__PURE__ */ jsxs(Button, {
14
- ...props,
15
- className: cn("relative gap-2", className),
16
- children: [
17
- /* @__PURE__ */ jsx(UploadIcon, { className: "h-3 w-3" }),
18
- /* @__PURE__ */ jsx("span", { children: "Upload" }),
19
- /* @__PURE__ */ jsx(Input, {
20
- type: "file",
21
- className: "absolute inset-0 z-10 h-full w-full cursor-pointer opacity-0",
22
- multiple: true,
23
- onChange: (e) => {
24
- if (!e.target.files) return;
25
- Array.from(e.target.files).forEach(onUpload);
26
- }
27
- })
28
- ]
29
- });
30
- }
31
-
32
- //#endregion
33
- export { UploadButton };
34
- //# sourceMappingURL=button.client.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"button.client.mjs","names":[],"sources":["../../../../src/modules/uploads/components/button.client.tsx"],"sourcesContent":["\"use client\";\n\nimport { Button } from \"@/components/ui/button\";\nimport { Input } from \"@/components/ui/input\";\nimport { cn } from \"@/lib/utils/cn\";\nimport { UploadIcon } from \"lucide-react\";\nimport { ComponentProps } from \"react\";\nimport { useUploadZone } from \"../hooks/use-upload-zone.client\";\n\nexport function UploadButton({ className, ...props }: ComponentProps<typeof Button>) {\n const { onUpload } = useUploadZone();\n\n return (\n <Button {...props} className={cn(\"relative gap-2\", className)}>\n <UploadIcon className=\"h-3 w-3\" />\n <span>Upload</span>\n\n <Input\n type=\"file\"\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 Array.from(e.target.files).forEach(onUpload);\n }}\n />\n </Button>\n );\n}\n"],"mappings":";;;;;;;;;;AASA,SAAgB,aAAa,EAAE,WAAW,GAAG,SAAwC;CACnF,MAAM,EAAE,aAAa,eAAe;AAEpC,QACE,qBAAC;EAAO,GAAI;EAAO,WAAW,GAAG,kBAAkB,UAAU;;GAC3D,oBAAC,cAAW,WAAU,YAAY;GAClC,oBAAC,oBAAK,WAAa;GAEnB,oBAAC;IACC,MAAK;IACL,WAAU;IACV;IACA,WAAW,MAAM;AACf,SAAI,CAAC,EAAE,OAAO,MAAO;AACrB,WAAM,KAAK,EAAE,OAAO,MAAM,CAAC,QAAQ,SAAS;;KAE9C;;GACK"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"context.d.mts","names":[],"sources":["../../../../../src/modules/uploads/components/dropzone/context.tsx"],"sourcesContent":[],"mappings":";;;;KAKK,mBAAA;QACG;WACG;EAFN,OAAA,CAAA,EAGO,eAHY,CAAA,SAAA,CAAA;EAChB,OAAA,CAAA,EAGI,eAHJ,CAAA,SAAA,CAAA;EACG,QAAA,CAAA,EAGE,eAHF,CAAA,UAAA,CAAA;CACC;AACA,cAIC,eAJD,EAIgB,MAAA,CAAA,OAJhB,CAIgB,mBAJhB,GAAA,SAAA,CAAA;;;AAIZ;AAKgB,iBAAA,kBAAA,CAAA,CAAkB,EAAA,mBAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"context.mjs","names":[],"sources":["../../../../../src/modules/uploads/components/dropzone/context.tsx"],"sourcesContent":["\"use client\";\n\nimport { createContext, use } from \"react\";\nimport { DropzoneOptions } from \"react-dropzone\";\n\ntype DropzoneContextType = {\n src?: File[];\n accept?: DropzoneOptions[\"accept\"];\n maxSize?: DropzoneOptions[\"maxSize\"];\n minSize?: DropzoneOptions[\"minSize\"];\n maxFiles?: DropzoneOptions[\"maxFiles\"];\n};\n\nexport const DropzoneContext = createContext<DropzoneContextType | undefined>(undefined);\n\n/**\n * Dropzone context hook\n */\nexport function useDropzoneContext() {\n const context = use(DropzoneContext);\n if (!context) throw new Error(\"useDropzoneContext must be used within a Dropzone\");\n return context;\n}\n"],"mappings":";;;;;AAaA,MAAa,kBAAkB,cAA+C,OAAU;;;;AAKxF,SAAgB,qBAAqB;CACnC,MAAM,UAAU,IAAI,gBAAgB;AACpC,KAAI,CAAC,QAAS,OAAM,IAAI,MAAM,oDAAoD;AAClF,QAAO"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../../../../../src/modules/uploads/components/dropzone/index.tsx"],"sourcesContent":[],"mappings":";;;;;;;;;KAcY,aAAA,GAAgB,KAAK;EAArB,GAAA,CAAA,EACJ,IADI,EAAA;EAAqB,SAAA,CAAA,EAAA,MAAA;EAAL,MAAA,CAAA,EAAA,CAAA,aAAA,EAGD,IAHC,EAAA,EAAA,cAAA,EAGuB,aAHvB,EAAA,EAAA,KAAA,EAG+C,SAH/C,EAAA,GAAA,IAAA;EACpB,QAAA,CAAA,EAGK,SAHL;CAEmB;AAAwB,iBAInC,QAAA,CAJmC;EAAA,MAAA;EAAA,QAAA;EAAA,OAAA;EAAA,OAAA;EAAA,MAAA;EAAA,OAAA;EAAA,QAAA;EAAA,GAAA;EAAA,SAAA;EAAA,QAAA;EAAA,GAAA;AAAA,CAAA,EAgBhD,aAhBgD,CAAA,EAgBnC,kBAAA,CAAA,GAAA,CAAA,OAhBmC;;;;AAInC,KAsDJ,oBAAA,GAtDY;EACtB,QAAA,CAAA,EAsDW,SAtDX;EACA,SAAA,CAAA,EAAA,MAAA;CACA;AACA,iBAyDc,eAAA,CAzDd;EAAA,QAAA;EAAA;AAAA,CAAA,EAyDuD,oBAzDvD,CAAA,EAAA,MAAA,GAAA,MAAA,GAAA,MAAA,GAAA,IAAA,GAyD2E,QAzD3E,CAyD2E,SAzD3E,CAAA,GAyD2E,OAzD3E,CAAA,MAAA,GAAA,MAAA,GAAA,MAAA,GAAA,OAAA,GAyD2E,MAAA,CAAA,WAAA,GAAA,MAAA,CAAA,YAzD3E,CAAA,OAAA,EAAA,MAAA,GAyD2E,MAAA,CAAA,qBAzD3E,CAAA,GAAA,CAAA,CAAA,GAyD2E,QAzD3E,CAyD2E,SAzD3E,CAAA,GAAA,IAAA,GAAA,SAAA,CAAA,GAyD2E,kBAAA,CAAA,GAAA,CAAA,OAAA,GAzD3E,IAAA;;;;AAIA,KAmFU,uBAAA,GAnFV;EACA,QAAA,CAAA,EAmFW,SAnFX;EACA,SAAA,CAAA,EAAA,MAAA;CAEC;AAAa,iBAoFA,kBAAA,CApFA;EAAA,QAAA;EAAA;AAAA,CAAA,EAoF4C,uBApF5C,CAAA,EAAA,MAAA,GAAA,MAAA,GAAA,MAAA,GAAA,IAAA,GAoFmE,QApFnE,CAoFmE,SApFnE,CAAA,GAoFmE,OApFnE,CAAA,MAAA,GAAA,MAAA,GAAA,MAAA,GAAA,OAAA,GAoFmE,MAAA,CAAA,WAAA,GAAA,MAAA,CAAA,YApFnE,CAAA,OAAA,EAAA,MAAA,GAoFmE,MAAA,CAAA,qBApFnE,CAAA,GAAA,CAAA,CAAA,GAoFmE,QApFnE,CAoFmE,SApFnE,CAAA,GAAA,IAAA,GAAA,SAAA,CAAA,GAoFmE,kBAAA,CAAA,GAAA,CAAA,OAAA,GApFnE,IAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../../../../../src/modules/uploads/components/dropzone/index.tsx"],"sourcesContent":["\"use client\";\n\nimport { Button } from \"@/components/ui/button\";\nimport { cn } from \"@/lib/utils/cn\";\nimport { UploadIcon } from \"lucide-react\";\nimport type { ReactNode } from \"react\";\nimport type { DropEvent, DropzoneOptions, FileRejection } from \"react-dropzone\";\nimport { useDropzone } from \"react-dropzone\";\nimport { renderBytes } from \"../../lib/helpers\";\nimport { DropzoneContext, useDropzoneContext } from \"./context\";\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,11 +0,0 @@
1
- import * as react_jsx_runtime7 from "react/jsx-runtime";
2
- import { HTMLAttributes } from "react";
3
-
4
- //#region src/modules/uploads/components/images/grid.client.d.ts
5
- /**
6
- * Image Grid
7
- */
8
- declare function ImageGrid(props: HTMLAttributes<HTMLElement>): react_jsx_runtime7.JSX.Element;
9
- //#endregion
10
- export { ImageGrid };
11
- //# sourceMappingURL=grid.client.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"grid.client.d.mts","names":[],"sources":["../../../../../src/modules/uploads/components/images/grid.client.tsx"],"sourcesContent":[],"mappings":";;;;;;;AAuCgB,iBAAA,SAAA,CAAS,KAAA,EAAQ,cAAR,CAAuB,WAAvB,CAAA,CAAA,EAAmC,kBAAA,CAAA,GAAA,CAAA,OAAnC"}
@@ -1,119 +0,0 @@
1
- "use client";
2
-
3
- import { Icons } from "../../../../components/common/icons.mjs";
4
- import { cn } from "../../../../lib/utils/cn.mjs";
5
- import { Button } from "../../../../components/ui/button.mjs";
6
- import { Dialog, DialogContent, DialogTrigger } from "../../../../components/ui/dialog.client.mjs";
7
- import { Card } from "../../../../components/ui/card.mjs";
8
- import { Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious } from "../../../../components/ui/carousel.mjs";
9
- import { useUploadZone } from "../../hooks/use-upload-zone.client.mjs";
10
- import { ImageInput } from "./input.client.mjs";
11
- import { GripIcon } from "lucide-react";
12
- import { jsx, jsxs } from "react/jsx-runtime";
13
- import React from "react";
14
- import Image$1 from "next/image";
15
- import { SortableContext, rectSortingStrategy, sortableKeyboardCoordinates, useSortable } from "@dnd-kit/sortable";
16
- import { DndContext, KeyboardSensor, PointerSensor, closestCenter, useDroppable, useSensor, useSensors } from "@dnd-kit/core";
17
- import { CSS } from "@dnd-kit/utilities";
18
-
19
- //#region src/modules/uploads/components/images/grid.client.tsx
20
- /**
21
- * Image Grid
22
- */
23
- function ImageGrid(props) {
24
- const { files, disabled, onUpload, onMove } = useUploadZone();
25
- const [current, setCurrent] = React.useState(0);
26
- const { setNodeRef } = useDroppable({ id: "image grid" });
27
- const sensors = useSensors(useSensor(PointerSensor), useSensor(KeyboardSensor, { coordinateGetter: sortableKeyboardCoordinates }));
28
- return /* @__PURE__ */ jsxs(Dialog, {
29
- ...props,
30
- children: [/* @__PURE__ */ jsx(DndContext, {
31
- sensors,
32
- collisionDetection: closestCenter,
33
- onDragEnd: onMove,
34
- children: /* @__PURE__ */ jsx("div", {
35
- ref: setNodeRef,
36
- className: "grid grid-cols-[repeat(auto-fill,_minmax(10rem,_1fr))] gap-5",
37
- children: /* @__PURE__ */ jsxs(SortableContext, {
38
- items: files.map((file) => file.url),
39
- strategy: rectSortingStrategy,
40
- children: [files.map(({ url, isLoading }, index) => /* @__PURE__ */ jsx(ImageGridItem, {
41
- url,
42
- index,
43
- isLoading,
44
- setCurrent
45
- }, url)), !disabled && /* @__PURE__ */ jsx(ImageInput, { onUpload })]
46
- })
47
- })
48
- }), /* @__PURE__ */ jsx(Carousel, {
49
- className: "w-full",
50
- opts: { startIndex: current },
51
- children: /* @__PURE__ */ jsxs(DialogContent, {
52
- className: "border-none bg-transparent p-0 shadow-none md:max-w-[80vw] xl:max-w-[60vw]",
53
- children: [
54
- /* @__PURE__ */ jsx(CarouselContent, {
55
- className: "md:max-h-[80vh]",
56
- children: files.map(({ url }, index) => /* @__PURE__ */ jsx(CarouselItem, {
57
- className: "overflow-hidden rounded-xl",
58
- children: /* @__PURE__ */ jsx(Image$1, {
59
- src: url,
60
- alt: "Image Preview",
61
- width: 1920,
62
- height: 1080,
63
- className: "h-full w-full rounded-xl object-contain"
64
- })
65
- }, index))
66
- }),
67
- /* @__PURE__ */ jsx(CarouselPrevious, {}),
68
- /* @__PURE__ */ jsx(CarouselNext, {})
69
- ]
70
- })
71
- })]
72
- });
73
- }
74
- function ImageGridItem({ url, index, isLoading, setCurrent }) {
75
- const { onDelete, onMove } = useUploadZone();
76
- const { attributes, listeners, setNodeRef, transform, transition } = useSortable({ id: url });
77
- return /* @__PURE__ */ jsxs(Card, {
78
- id: url,
79
- ref: setNodeRef,
80
- style: {
81
- transform: CSS.Transform.toString(transform),
82
- transition
83
- },
84
- className: cn("group relative aspect-square w-full", isLoading && "opacity-30"),
85
- children: [
86
- /* @__PURE__ */ jsx(DialogTrigger, {
87
- onClick: () => setCurrent(index),
88
- children: /* @__PURE__ */ jsx(Image$1, {
89
- src: url,
90
- alt: "Image Preview",
91
- width: 100,
92
- height: 100,
93
- className: "bg-muted absolute inset-0 h-full w-full cursor-pointer rounded-lg object-contain"
94
- })
95
- }),
96
- onMove && /* @__PURE__ */ jsx(Button, {
97
- ...attributes,
98
- ...listeners,
99
- type: "button",
100
- variant: "secondary",
101
- size: "icon",
102
- className: "absolute right-2 top-2 hidden p-1 group-hover:flex",
103
- children: /* @__PURE__ */ jsx(GripIcon, { className: "size-4" })
104
- }),
105
- onDelete && /* @__PURE__ */ jsx(Button, {
106
- type: "button",
107
- variant: "destructive",
108
- size: "icon",
109
- onClick: () => onDelete(url),
110
- className: "absolute left-2 top-2 hidden p-1 group-hover:flex",
111
- children: /* @__PURE__ */ jsx(Icons.trash, { className: "size-4" })
112
- })
113
- ]
114
- });
115
- }
116
-
117
- //#endregion
118
- export { ImageGrid };
119
- //# sourceMappingURL=grid.client.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"grid.client.mjs","names":["Image"],"sources":["../../../../../src/modules/uploads/components/images/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 { cn } from \"@/lib/utils/cn\";\nimport {\n closestCenter,\n DndContext,\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 } from \"lucide-react\";\nimport Image from \"next/image\";\nimport React, { type HTMLAttributes } from \"react\";\nimport { useUploadZone } from \"../../hooks/use-upload-zone.client\";\nimport { ImageInput } from \"./input.client\";\n\n/**\n * Image Grid\n */\nexport function ImageGrid(props: HTMLAttributes<HTMLElement>) {\n const { files, disabled, onUpload, onMove } = useUploadZone();\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 return (\n <Dialog {...props}>\n <DndContext sensors={sensors} collisionDetection={closestCenter} onDragEnd={onMove}>\n <div\n ref={setNodeRef}\n className=\"grid grid-cols-[repeat(auto-fill,_minmax(10rem,_1fr))] gap-5\"\n >\n <SortableContext items={files.map((file) => file.url)} strategy={rectSortingStrategy}>\n {files.map(({ url, isLoading }, index) => (\n <ImageGridItem\n key={url}\n url={url}\n index={index}\n isLoading={isLoading}\n setCurrent={setCurrent}\n />\n ))}\n\n {!disabled && <ImageInput onUpload={onUpload} />}\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 {files.map(({ url }, index) => (\n <CarouselItem key={index} 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 />\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 url: string;\n index: number;\n isLoading: boolean | undefined;\n setCurrent: React.Dispatch<React.SetStateAction<number>>;\n};\n\nfunction ImageGridItem({ url, index, isLoading, setCurrent }: ImageGridItemProps) {\n const { onDelete, onMove } = useUploadZone();\n\n const { attributes, listeners, setNodeRef, transform, transition } = useSortable({\n id: url,\n });\n\n return (\n <Card\n id={url}\n ref={setNodeRef}\n style={{\n transform: CSS.Transform.toString(transform),\n transition,\n }}\n className={cn(\"group relative aspect-square w-full\", isLoading && \"opacity-30\")}\n >\n <DialogTrigger onClick={() => setCurrent(index)}>\n <Image\n src={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 />\n </DialogTrigger>\n\n {onMove && (\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\n {onDelete && (\n <Button\n type=\"button\"\n variant=\"destructive\"\n size=\"icon\"\n onClick={() => onDelete(url)}\n className=\"absolute left-2 top-2 hidden p-1 group-hover:flex\"\n >\n <Icons.trash className=\"size-4\" />\n </Button>\n )}\n </Card>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAuCA,SAAgB,UAAU,OAAoC;CAC5D,MAAM,EAAE,OAAO,UAAU,UAAU,WAAW,eAAe;CAE7D,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;AAED,QACE,qBAAC;EAAO,GAAI;aACV,oBAAC;GAAoB;GAAS,oBAAoB;GAAe,WAAW;aAC1E,oBAAC;IACC,KAAK;IACL,WAAU;cAEV,qBAAC;KAAgB,OAAO,MAAM,KAAK,SAAS,KAAK,IAAI;KAAE,UAAU;gBAC9D,MAAM,KAAK,EAAE,KAAK,aAAa,UAC9B,oBAAC;MAEM;MACE;MACI;MACC;QAJP,IAKL,CACF,EAED,CAAC,YAAY,oBAAC,cAAqB,WAAY;MAChC;KACd;IACK,EAEb,oBAAC;GAAS,WAAU;GAAS,MAAM,EAAE,YAAY,SAAS;aACxD,qBAAC;IAAc,WAAU;;KACvB,oBAAC;MAAgB,WAAU;gBACxB,MAAM,KAAK,EAAE,OAAO,UACnB,oBAAC;OAAyB,WAAU;iBAClC,oBAACA;QACC,KAAK;QACL,KAAI;QACJ,OAAO;QACP,QAAQ;QACR,WAAU;SACV;SAPe,MAQJ,CACf;OACc;KAClB,oBAAC,qBAAmB;KACpB,oBAAC,iBAAe;;KACF;IACP;GACJ;;AAcb,SAAS,cAAc,EAAE,KAAK,OAAO,WAAW,cAAkC;CAChF,MAAM,EAAE,UAAU,WAAW,eAAe;CAE5C,MAAM,EAAE,YAAY,WAAW,YAAY,WAAW,eAAe,YAAY,EAC/E,IAAI,KACL,CAAC;AAEF,QACE,qBAAC;EACC,IAAI;EACJ,KAAK;EACL,OAAO;GACL,WAAW,IAAI,UAAU,SAAS,UAAU;GAC5C;GACD;EACD,WAAW,GAAG,uCAAuC,aAAa,aAAa;;GAE/E,oBAAC;IAAc,eAAe,WAAW,MAAM;cAC7C,oBAACA;KACC,KAAK;KACL,KAAI;KACJ,OAAO;KACP,QAAQ;KACR,WAAU;MACV;KACY;GAEf,UACC,oBAAC;IACC,GAAI;IACJ,GAAI;IACJ,MAAK;IACL,SAAQ;IACR,MAAK;IACL,WAAU;cAEV,oBAAC,YAAS,WAAU,WAAW;KACxB;GAGV,YACC,oBAAC;IACC,MAAK;IACL,SAAQ;IACR,MAAK;IACL,eAAe,SAAS,IAAI;IAC5B,WAAU;cAEV,oBAAC,MAAM,SAAM,WAAU,WAAW;KAC3B;;GAEN"}
@@ -1,16 +0,0 @@
1
- import * as react_jsx_runtime8 from "react/jsx-runtime";
2
- import React from "react";
3
- import "client-only";
4
-
5
- //#region src/modules/uploads/components/images/input.client.d.ts
6
- type ImageInputProps = React.HTMLAttributes<HTMLElement> & {
7
- onUpload: (file: File) => void;
8
- };
9
- declare function ImageInput({
10
- onUpload,
11
- className,
12
- ...props
13
- }: ImageInputProps): react_jsx_runtime8.JSX.Element;
14
- //#endregion
15
- export { ImageInput, ImageInputProps };
16
- //# sourceMappingURL=input.client.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"input.client.d.mts","names":[],"sources":["../../../../../src/modules/uploads/components/images/input.client.tsx"],"sourcesContent":[],"mappings":";;;;;KAOY,eAAA,GAAkB,KAAA,CAAM,eAAe;mBAChC;;AADP,iBAII,UAAA,CAJW;EAAA,QAAA;EAAA,SAAA;EAAA,GAAA;AAAA,CAAA,EAImC,eAJnC,CAAA,EAIkD,kBAAA,CAAA,GAAA,CAAA,OAJlD"}