@tulip-systems/core 0.5.1 → 0.5.3

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 (381) hide show
  1. package/dist/components/common/icons.d.mts +52 -52
  2. package/dist/components/common/icons.d.mts.map +1 -1
  3. package/dist/components/common/status.d.mts +3 -3
  4. package/dist/components/common/status.d.mts.map +1 -1
  5. package/dist/components/editor/components/content.client.d.mts +2 -2
  6. package/dist/components/editor/components/editor.client.d.mts +4 -4
  7. package/dist/components/editor/components/editor.client.mjs +2 -2
  8. package/dist/components/editor/components/editor.client.mjs.map +1 -1
  9. package/dist/components/editor/components/menu.client.d.mts +3 -3
  10. package/dist/components/editor/components/menu.client.mjs +3 -0
  11. package/dist/components/editor/components/menu.client.mjs.map +1 -1
  12. package/dist/components/editor/extensions/file-handler/extension.d.mts +21 -0
  13. package/dist/components/editor/extensions/file-handler/extension.d.mts.map +1 -0
  14. package/dist/components/editor/extensions/file-handler/extension.mjs +40 -0
  15. package/dist/components/editor/extensions/file-handler/extension.mjs.map +1 -0
  16. package/dist/components/editor/extensions/file-handler/strategy.d.mts +29 -0
  17. package/dist/components/editor/extensions/file-handler/strategy.d.mts.map +1 -0
  18. package/dist/components/editor/extensions/file-handler/strategy.mjs +111 -0
  19. package/dist/components/editor/extensions/file-handler/strategy.mjs.map +1 -0
  20. package/dist/components/editor/extensions/file-handler/utils.mjs +50 -0
  21. package/dist/components/editor/extensions/file-handler/utils.mjs.map +1 -0
  22. package/dist/components/editor/extensions/image/extension.d.mts +8 -0
  23. package/dist/components/editor/extensions/image/extension.d.mts.map +1 -0
  24. package/dist/components/editor/extensions/image/extension.mjs +52 -0
  25. package/dist/components/editor/extensions/image/extension.mjs.map +1 -0
  26. package/dist/components/editor/extensions/skeleton/extension.mjs +41 -0
  27. package/dist/components/editor/extensions/skeleton/extension.mjs.map +1 -0
  28. package/dist/components/editor/extensions/skeleton/renderer.mjs +25 -0
  29. package/dist/components/editor/extensions/skeleton/renderer.mjs.map +1 -0
  30. package/dist/components/editor/lib/constants.d.mts +29 -26
  31. package/dist/components/editor/lib/constants.d.mts.map +1 -1
  32. package/dist/components/editor/lib/constants.mjs +14 -2
  33. package/dist/components/editor/lib/constants.mjs.map +1 -1
  34. package/dist/components/editor/lib/extensions.d.mts +5 -1
  35. package/dist/components/editor/lib/extensions.d.mts.map +1 -1
  36. package/dist/components/editor/lib/extensions.mjs.map +1 -1
  37. package/dist/components/editor/lib/variants.mjs +10 -2
  38. package/dist/components/editor/lib/variants.mjs.map +1 -1
  39. package/dist/components/header/back-button.client.d.mts +2 -2
  40. package/dist/components/header/bottom-bar.client.d.mts +3 -3
  41. package/dist/components/header/breadcrumbs.client.d.mts +7 -7
  42. package/dist/components/header/header.client.d.mts +2 -2
  43. package/dist/components/header/mobile-nav-switcher.client.d.mts +2 -2
  44. package/dist/components/header/top-bar.client.d.mts +4 -4
  45. package/dist/components/layouts/admin-content.client.d.mts +2 -2
  46. package/dist/components/layouts/admin-layout.d.mts +2 -2
  47. package/dist/components/layouts/admin-loading.d.mts +2 -2
  48. package/dist/components/layouts/admin-loading.d.mts.map +1 -1
  49. package/dist/components/layouts/empty-page.d.mts +4 -4
  50. package/dist/components/layouts/empty-page.d.mts.map +1 -1
  51. package/dist/components/layouts/list-layout.d.mts +2 -2
  52. package/dist/components/layouts/list-layout.d.mts.map +1 -1
  53. package/dist/components/layouts/not-found-page.d.mts +3 -3
  54. package/dist/components/layouts/not-found-page.d.mts.map +1 -1
  55. package/dist/components/layouts/providers.client.d.mts +2 -2
  56. package/dist/components/layouts/root-layout.server.d.mts +2 -2
  57. package/dist/components/layouts/root-layout.server.d.mts.map +1 -1
  58. package/dist/components/layouts/root-loading.d.mts +2 -2
  59. package/dist/components/layouts/root-loading.d.mts.map +1 -1
  60. package/dist/components/layouts/tab-layout.d.mts +2 -2
  61. package/dist/components/layouts/tab-layout.d.mts.map +1 -1
  62. package/dist/components/lists/data-list.d.mts +5 -5
  63. package/dist/components/lists/data-list.d.mts.map +1 -1
  64. package/dist/components/lists/data-stack.d.mts +8 -8
  65. package/dist/components/navigation/admin-sidebar-paths.client.d.mts +10 -10
  66. package/dist/components/ui/accordion.d.mts +5 -5
  67. package/dist/components/ui/alert-dialog.d.mts +12 -12
  68. package/dist/components/ui/alert.d.mts +6 -6
  69. package/dist/components/ui/aspect-ratio.d.mts +2 -2
  70. package/dist/components/ui/avatar.client.d.mts +4 -4
  71. package/dist/components/ui/badge.d.mts +4 -4
  72. package/dist/components/ui/breadcrumb.d.mts +8 -8
  73. package/dist/components/ui/breadcrumb.d.mts.map +1 -1
  74. package/dist/components/ui/button.d.mts +5 -5
  75. package/dist/components/ui/button.d.mts.map +1 -1
  76. package/dist/components/ui/calendar.d.mts +3 -3
  77. package/dist/components/ui/calendar.d.mts.map +1 -1
  78. package/dist/components/ui/card.d.mts +7 -7
  79. package/dist/components/ui/card.d.mts.map +1 -1
  80. package/dist/components/ui/carousel.d.mts +6 -6
  81. package/dist/components/ui/carousel.d.mts.map +1 -1
  82. package/dist/components/ui/chart.client.d.mts +5 -5
  83. package/dist/components/ui/checkbox.d.mts +2 -2
  84. package/dist/components/ui/checkbox.d.mts.map +1 -1
  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/command.d.mts.map +1 -1
  91. package/dist/components/ui/context-menu.d.mts +16 -16
  92. package/dist/components/ui/date-picker.client.d.mts +2 -2
  93. package/dist/components/ui/dialog.client.d.mts +11 -11
  94. package/dist/components/ui/drawer.client.d.mts +11 -11
  95. package/dist/components/ui/dropdown-menu.d.mts +16 -16
  96. package/dist/components/ui/form.client.d.mts +7 -7
  97. package/dist/components/ui/hover-card.client.d.mts +4 -4
  98. package/dist/components/ui/input-recipient.d.mts +2 -2
  99. package/dist/components/ui/input.d.mts +2 -2
  100. package/dist/components/ui/label.d.mts +2 -2
  101. package/dist/components/ui/navigation-menu.d.mts +11 -11
  102. package/dist/components/ui/pagination.d.mts +8 -8
  103. package/dist/components/ui/popover.d.mts +5 -5
  104. package/dist/components/ui/popover.d.mts.map +1 -1
  105. package/dist/components/ui/progress.client.d.mts +2 -2
  106. package/dist/components/ui/radio-group.d.mts +3 -3
  107. package/dist/components/ui/resizable.client.d.mts +4 -4
  108. package/dist/components/ui/scroll-area.d.mts +3 -3
  109. package/dist/components/ui/select.client.d.mts +11 -11
  110. package/dist/components/ui/separator.d.mts +2 -2
  111. package/dist/components/ui/sheet.client.d.mts +9 -9
  112. package/dist/components/ui/sidebar.client.d.mts +24 -24
  113. package/dist/components/ui/skeleton.d.mts +2 -2
  114. package/dist/components/ui/slider.d.mts +2 -2
  115. package/dist/components/ui/sonner.client.d.mts +2 -2
  116. package/dist/components/ui/switch.d.mts +2 -2
  117. package/dist/components/ui/tabs.d.mts +5 -5
  118. package/dist/components/ui/textarea.d.mts +2 -2
  119. package/dist/components/ui/time-input.client.d.mts +2 -2
  120. package/dist/components/ui/toggle-group.client.d.mts +3 -3
  121. package/dist/components/ui/toggle.d.mts +2 -2
  122. package/dist/components/ui/tooltip.client.d.mts +5 -5
  123. package/dist/components.d.mts +2 -1
  124. package/dist/components.mjs +3 -2
  125. package/dist/data-tables.d.mts +2 -2
  126. package/dist/data-tables.mjs +2 -2
  127. package/dist/inline-edit/client.d.mts +2 -3
  128. package/dist/inline-edit/client.mjs +1 -2
  129. package/dist/lib/client.d.mts +2 -2
  130. package/dist/lib/client.mjs +2 -2
  131. package/dist/lib/hooks/use-action.d.mts +2 -2
  132. package/dist/lib/hooks/use-indicator.d.mts +11 -3
  133. package/dist/lib/hooks/use-indicator.d.mts.map +1 -1
  134. package/dist/lib/hooks/use-indicator.mjs +19 -8
  135. package/dist/lib/hooks/use-indicator.mjs.map +1 -1
  136. package/dist/modules/auth/components/allowed.client.d.mts +2 -2
  137. package/dist/modules/auth/components/allowed.client.d.mts.map +1 -1
  138. package/dist/modules/auth/components/auth-layout.server.d.mts +2 -2
  139. package/dist/modules/auth/components/auth-layout.server.d.mts.map +1 -1
  140. package/dist/modules/auth/components/auth-loading.d.mts +2 -2
  141. package/dist/modules/auth/components/create-first-user-page.client.d.mts +2 -2
  142. package/dist/modules/auth/components/create-first-user-page.client.d.mts.map +1 -1
  143. package/dist/modules/auth/components/forget-password-page.client.d.mts +2 -2
  144. package/dist/modules/auth/components/forget-password-page.client.d.mts.map +1 -1
  145. package/dist/modules/auth/components/guard-first-user.server.d.mts +2 -2
  146. package/dist/modules/auth/components/guard-first-user.server.d.mts.map +1 -1
  147. package/dist/modules/auth/components/guard.server.d.mts +2 -2
  148. package/dist/modules/auth/components/guard.server.d.mts.map +1 -1
  149. package/dist/modules/auth/components/login-page.client.d.mts +2 -2
  150. package/dist/modules/auth/components/login-page.client.d.mts.map +1 -1
  151. package/dist/modules/auth/components/reset-password-page.client.d.mts +2 -2
  152. package/dist/modules/auth/components/reset-password-page.client.d.mts.map +1 -1
  153. package/dist/modules/auth/components/update-password-command.d.mts +2 -2
  154. package/dist/modules/auth/components/update-password-command.d.mts.map +1 -1
  155. package/dist/modules/auth/db/schema.d.mts +73 -73
  156. package/dist/modules/auth/db/schema.d.mts.map +1 -1
  157. package/dist/modules/auth/handler/client.client.d.mts +8 -8
  158. package/dist/modules/auth/hooks/use-permission.d.mts +2 -2
  159. package/dist/modules/auth/hooks/use-session.d.mts +4 -4
  160. package/dist/modules/auth/lib/validators.d.mts +2 -2
  161. package/dist/modules/auth/lib/validators.d.mts.map +1 -1
  162. package/dist/modules/commands/components/alert-dialog-command.client.d.mts +10 -10
  163. package/dist/modules/commands/components/alert-dialog-command.client.d.mts.map +1 -1
  164. package/dist/modules/commands/components/click-command.client.d.mts +2 -2
  165. package/dist/modules/commands/components/click-command.client.d.mts.map +1 -1
  166. package/dist/modules/commands/components/command-trigger.client.d.mts +6 -6
  167. package/dist/modules/commands/components/command-trigger.client.d.mts.map +1 -1
  168. package/dist/modules/commands/components/dialog-command.client.d.mts +8 -8
  169. package/dist/modules/commands/components/dialog-command.client.d.mts.map +1 -1
  170. package/dist/modules/commands/components/dropdown-command.client.d.mts +5 -5
  171. package/dist/modules/commands/components/dropdown-command.client.d.mts.map +1 -1
  172. package/dist/modules/commands/components/empty-command.client.d.mts +2 -2
  173. package/dist/modules/commands/components/empty-command.client.d.mts.map +1 -1
  174. package/dist/modules/commands/components/form-dialog-command.client.d.mts +11 -11
  175. package/dist/modules/commands/components/form-dialog-command.client.d.mts.map +1 -1
  176. package/dist/modules/commands/hooks/use-command-mutation.client.d.mts +2 -2
  177. package/dist/modules/commands/menus/context-menu.client.d.mts +2 -2
  178. package/dist/modules/commands/menus/context-menu.client.d.mts.map +1 -1
  179. package/dist/modules/commands/menus/dropdown-menu.client.d.mts +3 -3
  180. package/dist/modules/commands/menus/dropdown-menu.client.d.mts.map +1 -1
  181. package/dist/modules/commands/menus/inline-menu.client.d.mts +3 -3
  182. package/dist/modules/commands/menus/inline-menu.client.d.mts.map +1 -1
  183. package/dist/modules/commands/menus/responsive-menu.client.d.mts +3 -3
  184. package/dist/modules/commands/menus/responsive-menu.client.d.mts.map +1 -1
  185. package/dist/modules/commands/utils/archive-command.client.d.mts +3 -3
  186. package/dist/modules/commands/utils/archive-command.client.d.mts.map +1 -1
  187. package/dist/modules/commands/utils/delete-command.client.d.mts +3 -3
  188. package/dist/modules/commands/utils/delete-command.client.d.mts.map +1 -1
  189. package/dist/modules/config/db/helpers.d.mts +5 -5
  190. package/dist/modules/config/db/helpers.d.mts.map +1 -1
  191. package/dist/modules/data-tables/components/cell/common.client.d.mts +5 -5
  192. package/dist/modules/data-tables/components/cell/common.client.d.mts.map +1 -1
  193. package/dist/modules/data-tables/components/column-header.d.mts +2 -2
  194. package/dist/modules/data-tables/components/filters/combobox.client.d.mts +2 -2
  195. package/dist/modules/data-tables/components/filters/combobox.client.d.mts.map +1 -1
  196. package/dist/modules/data-tables/components/filters/slider.client.d.mts +2 -2
  197. package/dist/modules/data-tables/components/filters/slider.client.d.mts.map +1 -1
  198. package/dist/modules/data-tables/components/header.d.mts +4 -4
  199. package/dist/modules/data-tables/components/layout.d.mts +2 -2
  200. package/dist/modules/data-tables/components/search-input.client.d.mts +2 -2
  201. package/dist/modules/data-tables/components/search-input.client.d.mts.map +1 -1
  202. package/dist/modules/data-tables/components/skeleton.d.mts +2 -2
  203. package/dist/modules/data-tables/components/table.d.mts +7 -7
  204. package/dist/modules/data-tables/components/toolbar.d.mts +3 -3
  205. package/dist/modules/data-tables/hooks/use-context.client.d.mts +2 -2
  206. package/dist/modules/data-tables/hooks/use-context.client.d.mts.map +1 -1
  207. package/dist/modules/data-tables/lib/filters/parsers.d.mts +6 -1
  208. package/dist/modules/data-tables/lib/filters/parsers.d.mts.map +1 -1
  209. package/dist/modules/data-tables/lib/filters/parsers.mjs +6 -1
  210. package/dist/modules/data-tables/lib/filters/parsers.mjs.map +1 -1
  211. package/dist/modules/data-tables/tables/data-table/components/table.d.mts +2 -2
  212. package/dist/modules/data-tables/tables/data-table/components/table.d.mts.map +1 -1
  213. package/dist/modules/data-tables/tables/inline-table/components/cells/common.d.mts +2 -2
  214. package/dist/modules/data-tables/tables/inline-table/components/cells/common.d.mts.map +1 -1
  215. package/dist/modules/data-tables/tables/inline-table/components/cells/drag-handle.client.d.mts +2 -2
  216. package/dist/modules/data-tables/tables/inline-table/components/cells/drag-handle.client.d.mts.map +1 -1
  217. package/dist/modules/data-tables/tables/inline-table/components/inputs/advanced-select.client.d.mts +2 -2
  218. package/dist/modules/data-tables/tables/inline-table/components/inputs/advanced-select.client.d.mts.map +1 -1
  219. package/dist/modules/data-tables/tables/inline-table/components/inputs/combobox.client.d.mts +2 -2
  220. package/dist/modules/data-tables/tables/inline-table/components/inputs/combobox.client.d.mts.map +1 -1
  221. package/dist/modules/data-tables/tables/inline-table/components/inputs/input.client.d.mts +3 -3
  222. package/dist/modules/data-tables/tables/inline-table/components/inputs/input.client.d.mts.map +1 -1
  223. package/dist/modules/data-tables/tables/inline-table/components/inputs/read-only.d.mts +2 -2
  224. package/dist/modules/data-tables/tables/inline-table/components/inputs/read-only.d.mts.map +1 -1
  225. package/dist/modules/data-tables/tables/inline-table/components/inputs/select.client.d.mts +2 -2
  226. package/dist/modules/data-tables/tables/inline-table/components/inputs/select.client.d.mts.map +1 -1
  227. package/dist/modules/data-tables/tables/inline-table/components/table.d.mts +2 -2
  228. package/dist/modules/data-tables/tables/inline-table/components/table.d.mts.map +1 -1
  229. package/dist/modules/data-tables/tables/inline-table/hooks/context.client.d.mts +2 -2
  230. package/dist/modules/data-tables/tables/inline-table/hooks/context.client.d.mts.map +1 -1
  231. package/dist/modules/inline-edit/components/combobox-dropdown.client.d.mts +6 -4
  232. package/dist/modules/inline-edit/components/combobox-dropdown.client.d.mts.map +1 -1
  233. package/dist/modules/inline-edit/components/combobox-dropdown.client.mjs +11 -6
  234. package/dist/modules/inline-edit/components/combobox-dropdown.client.mjs.map +1 -1
  235. package/dist/modules/inline-edit/components/combobox.client.d.mts +6 -4
  236. package/dist/modules/inline-edit/components/combobox.client.d.mts.map +1 -1
  237. package/dist/modules/inline-edit/components/combobox.client.mjs +7 -5
  238. package/dist/modules/inline-edit/components/combobox.client.mjs.map +1 -1
  239. package/dist/modules/inline-edit/components/date-input.client.d.mts +5 -3
  240. package/dist/modules/inline-edit/components/date-input.client.d.mts.map +1 -1
  241. package/dist/modules/inline-edit/components/date-input.client.mjs +26 -13
  242. package/dist/modules/inline-edit/components/date-input.client.mjs.map +1 -1
  243. package/dist/modules/inline-edit/components/date-picker.client.d.mts +6 -4
  244. package/dist/modules/inline-edit/components/date-picker.client.d.mts.map +1 -1
  245. package/dist/modules/inline-edit/components/date-picker.client.mjs +12 -7
  246. package/dist/modules/inline-edit/components/date-picker.client.mjs.map +1 -1
  247. package/dist/modules/inline-edit/components/editor.client.d.mts +6 -4
  248. package/dist/modules/inline-edit/components/editor.client.d.mts.map +1 -1
  249. package/dist/modules/inline-edit/components/editor.client.mjs +11 -6
  250. package/dist/modules/inline-edit/components/editor.client.mjs.map +1 -1
  251. package/dist/modules/inline-edit/components/input-recipient.client.d.mts +6 -4
  252. package/dist/modules/inline-edit/components/input-recipient.client.d.mts.map +1 -1
  253. package/dist/modules/inline-edit/components/input-recipient.client.mjs +11 -6
  254. package/dist/modules/inline-edit/components/input-recipient.client.mjs.map +1 -1
  255. package/dist/modules/inline-edit/components/input-toggle.client.d.mts +6 -4
  256. package/dist/modules/inline-edit/components/input-toggle.client.d.mts.map +1 -1
  257. package/dist/modules/inline-edit/components/input-toggle.client.mjs +9 -7
  258. package/dist/modules/inline-edit/components/input-toggle.client.mjs.map +1 -1
  259. package/dist/modules/inline-edit/components/input.client.d.mts +13 -10
  260. package/dist/modules/inline-edit/components/input.client.d.mts.map +1 -1
  261. package/dist/modules/inline-edit/components/input.client.mjs +35 -19
  262. package/dist/modules/inline-edit/components/input.client.mjs.map +1 -1
  263. package/dist/modules/inline-edit/components/select.client.d.mts +10 -9
  264. package/dist/modules/inline-edit/components/select.client.d.mts.map +1 -1
  265. package/dist/modules/inline-edit/components/select.client.mjs +14 -7
  266. package/dist/modules/inline-edit/components/select.client.mjs.map +1 -1
  267. package/dist/modules/inline-edit/components/switch.client.d.mts +5 -3
  268. package/dist/modules/inline-edit/components/switch.client.d.mts.map +1 -1
  269. package/dist/modules/inline-edit/components/switch.client.mjs +8 -6
  270. package/dist/modules/inline-edit/components/switch.client.mjs.map +1 -1
  271. package/dist/modules/inline-edit/components/toggle.client.d.mts +6 -4
  272. package/dist/modules/inline-edit/components/toggle.client.d.mts.map +1 -1
  273. package/dist/modules/inline-edit/components/toggle.client.mjs +9 -7
  274. package/dist/modules/inline-edit/components/toggle.client.mjs.map +1 -1
  275. package/dist/modules/inline-edit/hooks/use-inline.client.d.mts +35 -3
  276. package/dist/modules/inline-edit/hooks/use-inline.client.d.mts.map +1 -1
  277. package/dist/modules/inline-edit/hooks/use-inline.client.mjs +71 -9
  278. package/dist/modules/inline-edit/hooks/use-inline.client.mjs.map +1 -1
  279. package/dist/modules/inline-edit/lib/variants.d.mts +1 -0
  280. package/dist/modules/inline-edit/lib/variants.d.mts.map +1 -1
  281. package/dist/modules/inline-edit/lib/variants.mjs +12 -4
  282. package/dist/modules/inline-edit/lib/variants.mjs.map +1 -1
  283. package/dist/modules/router/handler/init.server.d.mts +6 -6
  284. package/dist/modules/router/handler/init.server.d.mts.map +1 -1
  285. package/dist/modules/router/lib/query-client.server.d.mts +2 -2
  286. package/dist/modules/storage/components/dropzone-context.client.d.mts +2 -2
  287. package/dist/modules/storage/components/dropzone-context.client.d.mts.map +1 -1
  288. package/dist/modules/storage/components/dropzone.client.d.mts +5 -5
  289. package/dist/modules/storage/components/dropzone.client.d.mts.map +1 -1
  290. package/dist/modules/storage/components/dropzone.client.mjs +1 -1
  291. package/dist/modules/storage/components/image-grid.client.d.mts +3 -3
  292. package/dist/modules/storage/components/image-grid.client.d.mts.map +1 -1
  293. package/dist/modules/storage/components/image-grid.client.mjs +3 -3
  294. package/dist/modules/storage/components/image-grid.client.mjs.map +1 -1
  295. package/dist/modules/storage/components/upload-zone-context.client.d.mts +3 -11
  296. package/dist/modules/storage/components/upload-zone-context.client.d.mts.map +1 -1
  297. package/dist/modules/storage/components/upload-zone-context.client.mjs.map +1 -1
  298. package/dist/modules/storage/components/upload-zone.client.d.mts +10 -31
  299. package/dist/modules/storage/components/upload-zone.client.d.mts.map +1 -1
  300. package/dist/modules/storage/components/upload-zone.client.mjs +19 -91
  301. package/dist/modules/storage/components/upload-zone.client.mjs.map +1 -1
  302. package/dist/modules/storage/config/filters.d.mts +2 -0
  303. package/dist/modules/storage/config/filters.d.mts.map +1 -1
  304. package/dist/modules/storage/config/filters.mjs +3 -1
  305. package/dist/modules/storage/config/filters.mjs.map +1 -1
  306. package/dist/modules/storage/lib/create-upload.client.d.mts +56 -0
  307. package/dist/modules/storage/lib/create-upload.client.d.mts.map +1 -0
  308. package/dist/modules/storage/lib/create-upload.client.mjs +98 -0
  309. package/dist/modules/storage/lib/create-upload.client.mjs.map +1 -0
  310. package/dist/modules/storage/lib/helpers.d.mts +2 -2
  311. package/dist/modules/storage/lib/helpers.d.mts.map +1 -1
  312. package/dist/modules/storage/lib/helpers.mjs +1 -0
  313. package/dist/modules/storage/lib/helpers.mjs.map +1 -1
  314. package/dist/modules/storage/lib/router.server.d.mts +4181 -2283
  315. package/dist/modules/storage/lib/router.server.d.mts.map +1 -1
  316. package/dist/modules/storage/lib/router.server.mjs +5 -2
  317. package/dist/modules/storage/lib/router.server.mjs.map +1 -1
  318. package/dist/modules/storage/lib/schema.d.mts +156 -88
  319. package/dist/modules/storage/lib/schema.d.mts.map +1 -1
  320. package/dist/modules/storage/lib/schema.mjs +3 -1
  321. package/dist/modules/storage/lib/schema.mjs.map +1 -1
  322. package/dist/modules/storage/lib/service.server.d.mts +54 -38
  323. package/dist/modules/storage/lib/service.server.d.mts.map +1 -1
  324. package/dist/modules/storage/lib/service.server.mjs +11 -5
  325. package/dist/modules/storage/lib/service.server.mjs.map +1 -1
  326. package/dist/modules/storage/lib/validators.d.mts +232 -71
  327. package/dist/modules/storage/lib/validators.d.mts.map +1 -1
  328. package/dist/modules/storage/lib/validators.mjs +16 -25
  329. package/dist/modules/storage/lib/validators.mjs.map +1 -1
  330. package/dist/storage/client.d.mts +2 -1
  331. package/dist/storage/client.mjs +2 -8
  332. package/dist/storage.d.mts +3 -3
  333. package/dist/storage.mjs +3 -3
  334. package/package.json +2 -1
  335. package/src/components/editor/components/editor.client.tsx +7 -2
  336. package/src/components/editor/components/menu.client.tsx +26 -0
  337. package/src/components/editor/extensions/file-handler/extension.ts +69 -0
  338. package/src/components/editor/extensions/file-handler/strategy.ts +167 -0
  339. package/src/components/editor/extensions/file-handler/utils.ts +51 -0
  340. package/src/components/editor/extensions/image/extension.ts +57 -0
  341. package/src/components/editor/extensions/skeleton/extension.ts +35 -0
  342. package/src/components/editor/extensions/skeleton/renderer.tsx +14 -0
  343. package/src/components/editor/lib/constants.ts +16 -2
  344. package/src/components/editor/lib/extensions.ts +4 -1
  345. package/src/components/editor/lib/utils.ts +32 -0
  346. package/src/components/editor/lib/variants.ts +72 -1
  347. package/src/components/entry.ts +2 -1
  348. package/src/lib/hooks/use-indicator.tsx +27 -18
  349. package/src/modules/data-tables/lib/filters/parsers.ts +14 -0
  350. package/src/modules/inline-edit/components/combobox-dropdown.client.tsx +21 -12
  351. package/src/modules/inline-edit/components/combobox.client.tsx +13 -6
  352. package/src/modules/inline-edit/components/date-input.client.tsx +29 -13
  353. package/src/modules/inline-edit/components/date-picker.client.tsx +13 -9
  354. package/src/modules/inline-edit/components/editor.client.tsx +14 -14
  355. package/src/modules/inline-edit/components/input-recipient.client.tsx +15 -8
  356. package/src/modules/inline-edit/components/input-toggle.client.tsx +16 -9
  357. package/src/modules/inline-edit/components/input.client.tsx +38 -24
  358. package/src/modules/inline-edit/components/select.client.tsx +16 -9
  359. package/src/modules/inline-edit/components/switch.client.tsx +10 -6
  360. package/src/modules/inline-edit/components/toggle.client.tsx +13 -9
  361. package/src/modules/inline-edit/entry.client.ts +0 -1
  362. package/src/modules/inline-edit/hooks/use-inline.client copy.tsx +97 -0
  363. package/src/modules/inline-edit/hooks/use-inline.client.tsx +139 -20
  364. package/src/modules/inline-edit/lib/variants.ts +7 -0
  365. package/src/modules/storage/components/image-grid.client.tsx +2 -2
  366. package/src/modules/storage/components/upload-zone-context.client.tsx +3 -4
  367. package/src/modules/storage/components/upload-zone.client.tsx +17 -113
  368. package/src/modules/storage/config/filters.ts +2 -0
  369. package/src/modules/storage/entry.client.ts +2 -1
  370. package/src/modules/storage/lib/create-upload.client.ts +134 -0
  371. package/src/modules/storage/lib/helpers.ts +3 -2
  372. package/src/modules/storage/lib/router.server.ts +1 -0
  373. package/src/modules/storage/lib/schema.ts +2 -0
  374. package/src/modules/storage/lib/service.server.ts +18 -4
  375. package/src/modules/storage/lib/validators.ts +21 -31
  376. package/dist/modules/inline-edit/components/deprecated-editor.client.d.mts +0 -21
  377. package/dist/modules/inline-edit/components/deprecated-editor.client.d.mts.map +0 -1
  378. package/dist/modules/inline-edit/components/deprecated-editor.client.mjs +0 -37
  379. package/dist/modules/inline-edit/components/deprecated-editor.client.mjs.map +0 -1
  380. package/dist/storage/client.mjs.map +0 -1
  381. package/src/modules/inline-edit/components/deprecated-editor.client.tsx +0 -48
@@ -4,43 +4,28 @@ import { Input } from "@/components/ui/input";
4
4
  import { toast } from "@/components/ui/sonner.client";
5
5
  import { cn } from "@/lib/entry";
6
6
  import { useAction } from "@/lib/hooks/use-action";
7
- import { generateDefaultUUID } from "@/modules/config/entry";
8
7
  import { useQueryClient } from "@tanstack/react-query";
9
8
  import { ComponentProps, useCallback, useState } from "react";
10
- import { FileNode, Node, PresignFileSchema } from "../lib/validators";
9
+ import { UploadClient, UploadFileRequest, UploadHooks } from "../lib/create-upload.client";
10
+ import { FileNode, Node, UploadFileSchema } from "../lib/validators";
11
11
  import { UploadZoneContext } from "./upload-zone-context.client";
12
12
 
13
13
  export type UploadZoneProps = ComponentProps<"div"> & {
14
- namespace: string;
15
- parentId: string | null;
16
-
17
14
  queryKey: readonly unknown[];
18
15
 
19
- presignAction: (params: PresignFileSchema) => Promise<{ id: string; presignedUrl: string }>;
20
- onPresignStarted?: (file: PresignFileSchema) => Promise<void> | void;
21
- onPresignCompleted?: (data: { id: string; presignedUrl: string }) => Promise<void> | void;
22
-
23
- confirmAction: (params: { id: string }) => Promise<Node>;
24
- onConfirmStarted?: (id: string) => Promise<void> | void;
25
- onConfirmCompleted?: (node: Node) => Promise<void> | void;
26
-
27
- deleteAction: (params: { ids: string[] }) => Promise<unknown>;
16
+ variables: Pick<UploadFileSchema, "namespace" | "parentId" | "mode" | "hidden" | "readonly">;
17
+ uploadClient: UploadClient;
18
+ uploadHooks?: UploadHooks;
28
19
 
29
20
  onUploadCompleted?: (node: Node) => Promise<void> | void;
30
21
  onUploadFailed?: (error: unknown) => Promise<void> | void;
31
22
  };
32
23
 
33
24
  export function UploadZone({
34
- namespace,
35
- parentId,
25
+ variables,
36
26
  queryKey,
37
- presignAction,
38
- confirmAction,
39
- deleteAction,
40
- onPresignStarted,
41
- onPresignCompleted,
42
- onConfirmStarted,
43
- onConfirmCompleted,
27
+ uploadClient,
28
+ uploadHooks,
44
29
  onUploadCompleted,
45
30
  onUploadFailed,
46
31
  children,
@@ -74,7 +59,7 @@ export function UploadZone({
74
59
  * Delete mutation
75
60
  */
76
61
  const deleteMutation = useAction({
77
- mutationFn: deleteAction,
62
+ mutationFn: async (params: { ids: string[] }) => uploadClient.deleteFiles(params.ids),
78
63
  onMutate: async (variables) => {
79
64
  await updateData((prev) => prev.filter((node) => !variables.ids.includes(node.id)));
80
65
  },
@@ -88,15 +73,10 @@ export function UploadZone({
88
73
  });
89
74
 
90
75
  /**
91
- * Presign upload mutation
76
+ * Upload mutation
92
77
  */
93
- const presignMutation = useAction({
94
- mutationFn: async (params: PresignFileSchema) => {
95
- await onPresignStarted?.(params);
96
- const data = await presignAction(params);
97
- await onPresignCompleted?.(data);
98
- return data;
99
- },
78
+ const uploadMutation = useAction({
79
+ mutationFn: async (params: UploadFileRequest) => uploadClient.upload(params, uploadHooks),
100
80
  onMutate: async (variables) => {
101
81
  // Generate a new node
102
82
  const newNode = {
@@ -107,61 +87,6 @@ export function UploadZone({
107
87
 
108
88
  await updateData((prev) => [...(prev ?? []), newNode]);
109
89
  },
110
- onError: async (error, variables) => {
111
- await onUploadFailed?.(error);
112
-
113
- console.error("Presign error: ", error);
114
- toast.error("Bestand uploaden mislukt", {
115
- description: error instanceof Error ? error.message : undefined,
116
- });
117
-
118
- console.info("Deleting failed upload");
119
- await deleteMutation.mutateAsync({ ids: [variables.id] });
120
- },
121
- });
122
-
123
- /**
124
- * Upload mutation
125
- */
126
- const uploadMutation = useAction({
127
- mutationFn: async (input: { id: string; presignedUrl: string; file: File }) => {
128
- /**
129
- * Upload the file
130
- */
131
- const uploadResponse = await fetch(input.presignedUrl, {
132
- method: "PUT",
133
- headers: { "Content-Type": input.file.type },
134
- body: input.file,
135
- });
136
-
137
- if (!uploadResponse.ok) {
138
- const message = await uploadResponse.text();
139
- throw new Error(`Upload failed: ${message}`);
140
- }
141
- },
142
- onError: async (error, variables) => {
143
- await onUploadFailed?.(error);
144
-
145
- console.error("Upload error: ", error);
146
- toast.error("Bestand uploaden mislukt", {
147
- description: error instanceof Error ? error.message : undefined,
148
- });
149
-
150
- console.info("Deleting failed upload");
151
- await deleteMutation.mutateAsync({ ids: [variables.id] });
152
- },
153
- });
154
-
155
- /**
156
- * Confirm upload mutation
157
- */
158
- const confirmMutation = useAction({
159
- mutationFn: async (params: { id: string }) => {
160
- await onConfirmStarted?.(params.id);
161
- const data = await confirmAction(params);
162
- await onConfirmCompleted?.(data);
163
- return data;
164
- },
165
90
  onSuccess: async (data) => {
166
91
  await onUploadCompleted?.(data);
167
92
  toast.success(`Succesvol geupload: ${data.name}`);
@@ -169,7 +94,7 @@ export function UploadZone({
169
94
  onError: async (error, variables) => {
170
95
  await onUploadFailed?.(error);
171
96
 
172
- console.error("Confirm error: ", error);
97
+ console.error("Upload error: ", error);
173
98
  toast.error("Bestand uploaden mislukt", {
174
99
  description: error instanceof Error ? error.message : undefined,
175
100
  });
@@ -187,29 +112,10 @@ export function UploadZone({
187
112
  */
188
113
  const onUpload = useCallback(
189
114
  async (file: File) => {
190
- /**
191
- * Send the presign request
192
- */
193
- const { id, presignedUrl } = await presignMutation.mutateAsync({
194
- id: generateDefaultUUID(),
195
- name: file.name,
196
- size: file.size,
197
- contentType: file.type,
198
- namespace,
199
- parentId,
200
- });
201
-
202
- /**
203
- * Uploading the file
204
- */
205
- await uploadMutation.mutateAsync({ id, presignedUrl, file });
206
-
207
- /**
208
- * Confirming the upload
209
- */
210
- return await confirmMutation.mutateAsync({ id });
115
+ const req = uploadClient.prepareUpload({ ...variables, file });
116
+ return await uploadMutation.mutateAsync(req);
211
117
  },
212
- [presignMutation, uploadMutation, confirmMutation, namespace, parentId],
118
+ [uploadClient, variables, uploadMutation],
213
119
  );
214
120
 
215
121
  return (
@@ -243,9 +149,7 @@ export function UploadZone({
243
149
  )}
244
150
  <UploadZoneContext
245
151
  value={{
246
- presignMutation: (params) => presignMutation.mutateAsync(params),
247
- confirmMutation: (params) => confirmMutation.mutateAsync(params),
248
- deleteMutation: (params) => deleteMutation.mutateAsync(params),
152
+ uploadClient,
249
153
  onUpload,
250
154
  updateData,
251
155
  invalidateQuery,
@@ -7,4 +7,6 @@ export const nodesTableFilters = createTableFilters({
7
7
  types: parseFilterArray(z.array(z.enum(nodeTypeEnum.enumValues))),
8
8
  nodeIds: parseFilterArray(z.array(z.string())),
9
9
  isDeleted: parseFilterBoolean(z.boolean()),
10
+ isOrphaned: parseFilterBoolean(z.boolean()),
11
+ hidden: parseFilterBoolean(z.boolean()),
10
12
  });
@@ -8,5 +8,6 @@ export * from "./components/upload-zone-context.client";
8
8
  export * from "./components/upload-zone.client";
9
9
 
10
10
  /**
11
- * Hooks
11
+ * Lib
12
12
  */
13
+ export * from "./lib/create-upload.client";
@@ -0,0 +1,134 @@
1
+ import { generateDefaultUUID } from "@/modules/config/entry";
2
+ import { BulkActionSchema } from "@/modules/router/entry";
3
+ import { PresignFileSchema, SelectNodeSchema, UpdateNodeSchema } from "./validators";
4
+
5
+ /**
6
+ * Upload request
7
+ */
8
+ export type PrepareUploadInput = Omit<UploadFileRequest, "id" | "name" | "size" | "contentType">;
9
+ export type UploadFileRequest = PresignFileSchema & { file: File };
10
+ export type UploadHooks = {
11
+ beforePresign?: (input: UploadFileRequest) => Promise<void> | void;
12
+ afterPresign?: (presignResult: { id: string; presignedUrl: string }) => Promise<void> | void;
13
+ beforeConfirm?: (presignResult: { id: string; presignedUrl: string }) => Promise<void> | void;
14
+ afterConfirm?: (node: SelectNodeSchema) => Promise<void> | void;
15
+ };
16
+
17
+ /**
18
+ * Upload client
19
+ */
20
+ export type UploadClient = {
21
+ prepareUpload: (input: PrepareUploadInput) => UploadFileRequest;
22
+ upload: (input: UploadFileRequest, hooks?: UploadHooks) => Promise<SelectNodeSchema>;
23
+ deleteFiles: (ids: string[]) => Promise<void>;
24
+ updateNode: (id: string, data: UpdateNodeSchema) => Promise<SelectNodeSchema>;
25
+ };
26
+
27
+ /**
28
+ * Create upload client
29
+ */
30
+ type CreateUploadClientProps = {
31
+ endpoints: {
32
+ presign: (input: PresignFileSchema) => Promise<{ id: string; presignedUrl: string }>;
33
+ confirm: (input: { id: string }) => Promise<SelectNodeSchema>;
34
+ deleteNodes: (input: BulkActionSchema) => Promise<void>;
35
+ updateNode: (input: { id: string; data: UpdateNodeSchema }) => Promise<SelectNodeSchema>;
36
+ };
37
+ };
38
+
39
+ export function createUploadClient(props: CreateUploadClientProps): UploadClient {
40
+ /**
41
+ * Create input schema for the upload method
42
+ * @param {PrepareUploadInput} input
43
+ * @returns {UploadFileRequest}
44
+ */
45
+ function prepareUpload(input: PrepareUploadInput): UploadFileRequest {
46
+ return {
47
+ ...input,
48
+ id: generateDefaultUUID(),
49
+ name: input.file.name,
50
+ size: input.file.size,
51
+ contentType: input.file.type,
52
+ };
53
+ }
54
+
55
+ /**
56
+ * Upload file to the server
57
+ * @param {UploadFileRequest} input
58
+ * @returns {Promise<SelectNodeSchema>}
59
+ */
60
+ async function upload(input: UploadFileRequest, hooks?: UploadHooks): Promise<SelectNodeSchema> {
61
+ try {
62
+ /**
63
+ * Presign
64
+ */
65
+ await hooks?.beforePresign?.(input);
66
+ const presignResult = await props.endpoints.presign(input);
67
+ await hooks?.afterPresign?.(presignResult);
68
+ /**
69
+ * Upload the file
70
+ */
71
+ const uploadResponse = await fetch(presignResult.presignedUrl, {
72
+ method: "PUT",
73
+ headers: { "Content-Type": input.file.type },
74
+ body: input.file,
75
+ });
76
+
77
+ if (!uploadResponse.ok) {
78
+ const message = await uploadResponse.text();
79
+ throw new Error(`Upload failed: ${message}`);
80
+ }
81
+
82
+ /**
83
+ * Confirm
84
+ */
85
+ await hooks?.beforeConfirm?.(presignResult);
86
+ const node = await props.endpoints.confirm({ id: presignResult.id });
87
+ await hooks?.afterConfirm?.(node);
88
+ /**
89
+ * Return
90
+ */
91
+ return node;
92
+ } catch (err) {
93
+ console.error("Upload error: ", err);
94
+
95
+ /**
96
+ * Delete if upload failed
97
+ * */
98
+ try {
99
+ await deleteFiles([input.id]);
100
+ } catch (cleanupErr) {
101
+ console.error("Cleanup delete failed:", cleanupErr);
102
+ }
103
+
104
+ throw err;
105
+ }
106
+ }
107
+
108
+ /**
109
+ * Delete files
110
+ * @param {string[]} ids
111
+ */
112
+ async function deleteFiles(ids: string[]) {
113
+ await props.endpoints.deleteNodes({ ids });
114
+ }
115
+
116
+ /**
117
+ * Update node
118
+ * @param {string} id
119
+ * @param {UpdateNodeSchema} data
120
+ */
121
+ async function updateNode(id: string, data: UpdateNodeSchema) {
122
+ return props.endpoints.updateNode({ id, data });
123
+ }
124
+
125
+ /**
126
+ * Upload client
127
+ */
128
+ return {
129
+ prepareUpload,
130
+ upload,
131
+ deleteFiles,
132
+ updateNode,
133
+ };
134
+ }
@@ -1,6 +1,6 @@
1
1
  import { ImageLoaderProps } from "next/image";
2
2
  import { ImageVariant } from "./constants";
3
- import { FileNode, GetFileURLSchema, Node } from "./validators";
3
+ import { CreateNodeSchema, GetFileURLSchema, Node } from "./validators";
4
4
 
5
5
  /**
6
6
  * Check if the node is a file
@@ -62,7 +62,8 @@ export type NodeSubtype = (typeof nodeSubtypes)[number];
62
62
  export function inferNodeSubtype({
63
63
  name,
64
64
  contentType,
65
- }: Pick<FileNode, "name" | "contentType">): NodeSubtype {
65
+ }: Pick<CreateNodeSchema, "name" | "contentType">): NodeSubtype {
66
+ if (!contentType) return "other";
66
67
  if (contentType?.startsWith("image/")) return "image";
67
68
  if (contentType === "application/pdf") return "document";
68
69
  if (contentType?.includes("spreadsheet")) return "spreadsheet";
@@ -100,6 +100,7 @@ export function createDriveBaseProcedures() {
100
100
  */
101
101
  presign: protectedProcedure
102
102
  .input(presignFileSchema)
103
+ .output(z.object({ id: z.string(), presignedUrl: z.string() }))
103
104
  .handler(async ({ context, input }) => context.storage.presignUpload(input)),
104
105
  /**
105
106
  * Confirm the upload
@@ -21,9 +21,11 @@ export const nodes = pgTable("nodes", (t) => ({
21
21
  size: t.integer().default(0),
22
22
  contentType: t.varchar({ length: 255 }),
23
23
  readonly: boolean().default(false),
24
+ hidden: boolean().default(false),
24
25
  createdBy: t.uuid().references(() => users.id, { onDelete: "set null" }),
25
26
  isPending: t.boolean().default(false).notNull(),
26
27
  isDeleted: t.boolean().default(false).notNull(),
28
+ orphanedAt: t.timestamp(),
27
29
  parentId: t.uuid().references((): AnyPgColumn => nodes.id, { onDelete: "cascade" }),
28
30
  }));
29
31
 
@@ -16,13 +16,14 @@ import {
16
16
  } from "@aws-sdk/client-s3";
17
17
  import { getSignedUrl } from "@aws-sdk/s3-request-presigner";
18
18
  import { addSeconds } from "date-fns";
19
- import { and, asc, eq, inArray, isNull, SQL } from "drizzle-orm";
19
+ import { and, asc, eq, inArray, isNotNull, isNull, SQL } from "drizzle-orm";
20
20
  import { after } from "next/server";
21
21
  import { deviceSizes } from "./constants";
22
22
  import { getDriveBucketKey, inferNodeSubtype, isFile, isFolder } from "./helpers";
23
23
  import { nodePresignedUrls, nodes, nodeVariants } from "./schema";
24
24
  import {
25
25
  CreateFolderNodeSchema,
26
+ FileNode,
26
27
  GetFileURLSchema,
27
28
  getFileURLSchemaDefaults,
28
29
  GetNodesByParentIdInput,
@@ -101,8 +102,8 @@ export class StorageService<TSchema extends TDatabaseSchema> {
101
102
  Bucket: BUCKET_NAME,
102
103
  Key: getDriveBucketKey(input.id, input.variant),
103
104
  Body: input.body,
104
- ContentType: input.contentType,
105
- ContentLength: input.size,
105
+ ContentType: input.contentType ?? undefined,
106
+ ContentLength: input.size ?? undefined,
106
107
  Metadata: {
107
108
  nodeId: input.id,
108
109
  },
@@ -117,6 +118,13 @@ export class StorageService<TSchema extends TDatabaseSchema> {
117
118
  return await this.#blob.send(putCommand);
118
119
  }
119
120
 
121
+ /**
122
+ * Get node by id
123
+ */
124
+ async getNodeById(id: string) {
125
+ return this.#db.select().from(nodes).where(eq(nodes.id, id));
126
+ }
127
+
120
128
  /**
121
129
  * Get nodes by parent id
122
130
  */
@@ -132,6 +140,12 @@ export class StorageService<TSchema extends TDatabaseSchema> {
132
140
  filters.nodeIds != null ? inArray(nodes.id, filters.nodeIds) : undefined,
133
141
  filters.types != null ? inArray(nodes.type, filters.types) : undefined,
134
142
  filters.isDeleted != null ? eq(nodes.isDeleted, filters.isDeleted) : undefined,
143
+ filters.isOrphaned === true
144
+ ? isNotNull(nodes.orphanedAt)
145
+ : filters.isOrphaned === false
146
+ ? isNull(nodes.orphanedAt)
147
+ : undefined,
148
+ filters.hidden != null ? eq(nodes.hidden, filters.hidden) : undefined,
135
149
  filters.parentId ? eq(nodes.parentId, filters.parentId) : isNull(nodes.parentId),
136
150
  eq(nodes.namespace, filters.namespace),
137
151
  search,
@@ -305,7 +319,7 @@ export class StorageService<TSchema extends TDatabaseSchema> {
305
319
  // after(async () => {});
306
320
  await this.generatePreviews(input);
307
321
 
308
- return result;
322
+ return result as FileNode;
309
323
  }
310
324
 
311
325
  /**
@@ -38,26 +38,6 @@ export const updateNodeSchema = createUpdateSchema(nodes);
38
38
  export type UpdateNodeInput = z.input<typeof updateNodeSchema>;
39
39
  export type UpdateNodeSchema = z.infer<typeof updateNodeSchema>;
40
40
 
41
- /**
42
- * Create folder node
43
- */
44
- export const createFolderNodeSchema = createNodeSchema.omit({
45
- type: true,
46
- contentType: true,
47
- size: true,
48
- subtype: true,
49
- });
50
-
51
- export type CreateFolderNodeSchema = z.infer<typeof createFolderNodeSchema>;
52
-
53
- /**
54
- * Create file node
55
- */
56
- export const createFileNodeSchema = createNodeSchema.omit({
57
- type: true,
58
- });
59
- export type CreateFileNodeSchema = z.infer<typeof createFileNodeSchema>;
60
-
61
41
  /**
62
42
  * Select node
63
43
  */
@@ -78,22 +58,32 @@ export const nodesTableFiltersSchema = resolveFiltersSchema(nodesTableFilters)
78
58
  namespace: z.string(),
79
59
  parentId: z.string().nullable(),
80
60
  })
81
- .transform((input) => ({ ...input, isDeleted: input?.isDeleted ?? false }));
61
+ .transform((input) => ({
62
+ ...input,
63
+ hidden: input?.hidden ?? false,
64
+ isDeleted: input?.isDeleted ?? false,
65
+ orphanedAt: input?.isOrphaned ?? false,
66
+ }));
82
67
 
83
68
  export type NodesTableFilters = z.input<typeof nodesTableFiltersSchema>;
84
69
 
85
70
  /**
86
- * Upload file schema
71
+ * Create folder node
87
72
  */
88
- export const uploadFileSchema = z.object({
89
- name: z.string().min(1),
90
- namespace: z.string(),
91
- mode: nodeModeSchema.optional(),
92
- parentId: z.uuid().nullable(),
93
- size: z.number().optional().default(0),
94
- contentType: z.string().optional().default(""),
73
+ export const createFolderNodeSchema = createNodeSchema.omit({
74
+ type: true,
75
+ contentType: true,
76
+ size: true,
77
+ subtype: true,
95
78
  });
96
79
 
80
+ export type CreateFolderNodeSchema = z.infer<typeof createFolderNodeSchema>;
81
+
82
+ /**
83
+ * Upload file schema
84
+ */
85
+ export const uploadFileSchema = createNodeSchema.omit({ type: true });
86
+
97
87
  export type UploadFileSchema = z.infer<typeof uploadFileSchema>;
98
88
 
99
89
  /**
@@ -145,8 +135,8 @@ export const putObjectSchema = z.object({
145
135
  name: z.string().optional().default(""),
146
136
  variant: z.enum(imageVariants).optional().default("main"),
147
137
  body: z.any().optional(),
148
- contentType: z.string().optional().default(""),
149
- size: z.number().optional().default(0),
138
+ contentType: z.string().nullable().optional(),
139
+ size: z.number().nullable().optional(),
150
140
  });
151
141
 
152
142
  export type PutObjectInput = z.input<typeof putObjectSchema> & {
@@ -1,21 +0,0 @@
1
- import { useInlineEditOptions } from "../hooks/use-inline.client.mjs";
2
- import { InlineEditVariantsProps } from "../lib/variants.mjs";
3
- import * as react_jsx_runtime14 from "react/jsx-runtime";
4
- import { ComponentProps } from "react";
5
- import { JSONContent } from "@tiptap/react";
6
-
7
- //#region src/modules/inline-edit/components/deprecated-editor.client.d.ts
8
- /**
9
- * @deprecated
10
- */
11
- declare function InlineEditorDeprecated({
12
- initialValue,
13
- action,
14
- variant,
15
- className,
16
- disabled,
17
- ...props
18
- }: Omit<ComponentProps<"input">, "type"> & useInlineEditOptions<JSONContent> & InlineEditVariantsProps): react_jsx_runtime14.JSX.Element;
19
- //#endregion
20
- export { InlineEditorDeprecated };
21
- //# sourceMappingURL=deprecated-editor.client.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"deprecated-editor.client.d.mts","names":[],"sources":["../../../../src/modules/inline-edit/components/deprecated-editor.client.tsx"],"sourcesContent":[],"mappings":";;;;;;;;;;AAYgB,iBAAA,sBAAA,CAAsB;EAAA,YAAA;EAAA,MAAA;EAAA,OAAA;EAAA,SAAA;EAAA,QAAA;EAAA,GAAA;AAAA,CAAA,EAOnC,IAPmC,CAO9B,cAP8B,CAAA,OAAA,CAAA,EAAA,MAAA,CAAA,GAQpC,oBARoC,CAQf,WARe,CAAA,GASpC,uBAToC,CAAA,EASb,mBAAA,CAAA,GAAA,CAAA,OATa"}
@@ -1,37 +0,0 @@
1
- "use client";
2
-
3
- import { cn } from "../../../lib/utils/cn.mjs";
4
- import { EDITOR_EXTENSIONS_VALUES } from "../../../components/editor/lib/constants.mjs";
5
- import { useInlineEdit } from "../hooks/use-inline.client.mjs";
6
- import { inlineEditVariants } from "../lib/variants.mjs";
7
- import { jsx } from "react/jsx-runtime";
8
- import { EditorContent, useEditor } from "@tiptap/react";
9
-
10
- //#region src/modules/inline-edit/components/deprecated-editor.client.tsx
11
- /**
12
- * @deprecated
13
- */
14
- function InlineEditorDeprecated({ initialValue, action, variant, className, disabled, ...props }) {
15
- const { value, setValue, handleUpdate, isAllowed } = useInlineEdit({
16
- initialValue,
17
- action
18
- });
19
- const editor = useEditor({
20
- extensions: EDITOR_EXTENSIONS_VALUES,
21
- content: value,
22
- editable: !disabled && isAllowed,
23
- immediatelyRender: false,
24
- injectCSS: false,
25
- onUpdate: ({ editor: editor$1 }) => setValue(editor$1.getJSON()),
26
- onBlur: ({ editor: editor$1 }) => handleUpdate(editor$1.getJSON()),
27
- editorProps: { attributes: { class: cn("prose max-w-full bg-background ring-offset-background rounded-md border border-input dark:prose-invert p-3 focus:outline-none prose-a:text-primary prose-li:marker:text-primary ring-offset-background file:text-foreground placeholder:text-muted-foreground focus-visible:ring-ring rounded-md border text-base file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 [&[contenteditable=false]]:opacity-50 [&[contenteditable=false]]:cursor-not-allowed md:text-sm", inlineEditVariants({ variant }), className) } }
28
- });
29
- return /* @__PURE__ */ jsx(EditorContent, {
30
- ...props,
31
- editor
32
- });
33
- }
34
-
35
- //#endregion
36
- export { InlineEditorDeprecated };
37
- //# sourceMappingURL=deprecated-editor.client.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"deprecated-editor.client.mjs","names":["editor"],"sources":["../../../../src/modules/inline-edit/components/deprecated-editor.client.tsx"],"sourcesContent":["\"use client\";\n\nimport { EDITOR_EXTENSIONS_VALUES } from \"@/components/editor/lib/constants\";\nimport { cn } from \"@/lib/utils/cn\";\nimport { EditorContent, JSONContent, useEditor } from \"@tiptap/react\";\nimport { ComponentProps } from \"react\";\nimport { useInlineEdit, type useInlineEditOptions } from \"../hooks/use-inline.client\";\nimport { inlineEditVariants, InlineEditVariantsProps } from \"../lib/variants\";\n\n/**\n * @deprecated\n */\nexport function InlineEditorDeprecated({\n initialValue,\n action,\n variant,\n className,\n disabled,\n ...props\n}: Omit<ComponentProps<\"input\">, \"type\"> &\n useInlineEditOptions<JSONContent> &\n InlineEditVariantsProps) {\n const { value, setValue, handleUpdate, isAllowed } = useInlineEdit({\n initialValue,\n action,\n });\n\n const editor = useEditor({\n extensions: EDITOR_EXTENSIONS_VALUES,\n content: value,\n editable: !disabled && isAllowed,\n immediatelyRender: false,\n injectCSS: false,\n onUpdate: ({ editor }) => setValue(editor.getJSON()),\n onBlur: ({ editor }) => handleUpdate(editor.getJSON()),\n editorProps: {\n attributes: {\n class: cn(\n \"prose max-w-full bg-background ring-offset-background rounded-md border border-input dark:prose-invert p-3 focus:outline-none prose-a:text-primary prose-li:marker:text-primary ring-offset-background file:text-foreground placeholder:text-muted-foreground focus-visible:ring-ring rounded-md border text-base file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 [&[contenteditable=false]]:opacity-50 [&[contenteditable=false]]:cursor-not-allowed md:text-sm\",\n inlineEditVariants({ variant }),\n className,\n ),\n },\n },\n });\n\n return <EditorContent {...props} editor={editor} />;\n}\n"],"mappings":";;;;;;;;;;;;;AAYA,SAAgB,uBAAuB,EACrC,cACA,QACA,SACA,WACA,UACA,GAAG,SAGsB;CACzB,MAAM,EAAE,OAAO,UAAU,cAAc,cAAc,cAAc;EACjE;EACA;EACD,CAAC;CAEF,MAAM,SAAS,UAAU;EACvB,YAAY;EACZ,SAAS;EACT,UAAU,CAAC,YAAY;EACvB,mBAAmB;EACnB,WAAW;EACX,WAAW,EAAE,uBAAa,SAASA,SAAO,SAAS,CAAC;EACpD,SAAS,EAAE,uBAAa,aAAaA,SAAO,SAAS,CAAC;EACtD,aAAa,EACX,YAAY,EACV,OAAO,GACL,giBACA,mBAAmB,EAAE,SAAS,CAAC,EAC/B,UACD,EACF,EACF;EACF,CAAC;AAEF,QAAO,oBAAC;EAAc,GAAI;EAAe;GAAU"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"client.mjs","names":[],"sources":["../../src/modules/storage/entry.client.ts"],"sourcesContent":["/**\n * Components\n */\nexport * from \"./components/dropzone-context.client\";\nexport * from \"./components/dropzone.client\";\nexport * from \"./components/image-grid.client\";\nexport * from \"./components/upload-zone-context.client\";\nexport * from \"./components/upload-zone.client\";\n\n/**\n * Hooks\n */\n"],"mappings":""}
@@ -1,48 +0,0 @@
1
- "use client";
2
-
3
- import { EDITOR_EXTENSIONS_VALUES } from "@/components/editor/lib/constants";
4
- import { cn } from "@/lib/utils/cn";
5
- import { EditorContent, JSONContent, useEditor } from "@tiptap/react";
6
- import { ComponentProps } from "react";
7
- import { useInlineEdit, type useInlineEditOptions } from "../hooks/use-inline.client";
8
- import { inlineEditVariants, InlineEditVariantsProps } from "../lib/variants";
9
-
10
- /**
11
- * @deprecated
12
- */
13
- export function InlineEditorDeprecated({
14
- initialValue,
15
- action,
16
- variant,
17
- className,
18
- disabled,
19
- ...props
20
- }: Omit<ComponentProps<"input">, "type"> &
21
- useInlineEditOptions<JSONContent> &
22
- InlineEditVariantsProps) {
23
- const { value, setValue, handleUpdate, isAllowed } = useInlineEdit({
24
- initialValue,
25
- action,
26
- });
27
-
28
- const editor = useEditor({
29
- extensions: EDITOR_EXTENSIONS_VALUES,
30
- content: value,
31
- editable: !disabled && isAllowed,
32
- immediatelyRender: false,
33
- injectCSS: false,
34
- onUpdate: ({ editor }) => setValue(editor.getJSON()),
35
- onBlur: ({ editor }) => handleUpdate(editor.getJSON()),
36
- editorProps: {
37
- attributes: {
38
- class: cn(
39
- "prose max-w-full bg-background ring-offset-background rounded-md border border-input dark:prose-invert p-3 focus:outline-none prose-a:text-primary prose-li:marker:text-primary ring-offset-background file:text-foreground placeholder:text-muted-foreground focus-visible:ring-ring rounded-md border text-base file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 [&[contenteditable=false]]:opacity-50 [&[contenteditable=false]]:cursor-not-allowed md:text-sm",
40
- inlineEditVariants({ variant }),
41
- className,
42
- ),
43
- },
44
- },
45
- });
46
-
47
- return <EditorContent {...props} editor={editor} />;
48
- }