@tulip-systems/core 0.5.2 → 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 (366) hide show
  1. package/dist/components/common/icons.d.mts +2 -2
  2. package/dist/components/common/status.d.mts +3 -3
  3. package/dist/components/editor/components/content.client.d.mts +2 -2
  4. package/dist/components/editor/components/editor.client.d.mts +2 -2
  5. package/dist/components/editor/components/editor.client.mjs +2 -2
  6. package/dist/components/editor/components/editor.client.mjs.map +1 -1
  7. package/dist/components/editor/components/menu.client.d.mts +3 -3
  8. package/dist/components/editor/components/menu.client.mjs +3 -0
  9. package/dist/components/editor/components/menu.client.mjs.map +1 -1
  10. package/dist/components/editor/extensions/file-handler/extension.d.mts +21 -0
  11. package/dist/components/editor/extensions/file-handler/extension.d.mts.map +1 -0
  12. package/dist/components/editor/extensions/file-handler/extension.mjs +40 -0
  13. package/dist/components/editor/extensions/file-handler/extension.mjs.map +1 -0
  14. package/dist/components/editor/extensions/file-handler/strategy.d.mts +29 -0
  15. package/dist/components/editor/extensions/file-handler/strategy.d.mts.map +1 -0
  16. package/dist/components/editor/extensions/file-handler/strategy.mjs +111 -0
  17. package/dist/components/editor/extensions/file-handler/strategy.mjs.map +1 -0
  18. package/dist/components/editor/extensions/file-handler/utils.mjs +50 -0
  19. package/dist/components/editor/extensions/file-handler/utils.mjs.map +1 -0
  20. package/dist/components/editor/extensions/image/extension.d.mts +8 -0
  21. package/dist/components/editor/extensions/image/extension.d.mts.map +1 -0
  22. package/dist/components/editor/extensions/image/extension.mjs +52 -0
  23. package/dist/components/editor/extensions/image/extension.mjs.map +1 -0
  24. package/dist/components/editor/extensions/skeleton/extension.mjs +41 -0
  25. package/dist/components/editor/extensions/skeleton/extension.mjs.map +1 -0
  26. package/dist/components/editor/extensions/skeleton/renderer.mjs +25 -0
  27. package/dist/components/editor/extensions/skeleton/renderer.mjs.map +1 -0
  28. package/dist/components/editor/lib/constants.d.mts +29 -26
  29. package/dist/components/editor/lib/constants.d.mts.map +1 -1
  30. package/dist/components/editor/lib/constants.mjs +14 -2
  31. package/dist/components/editor/lib/constants.mjs.map +1 -1
  32. package/dist/components/editor/lib/extensions.d.mts +5 -1
  33. package/dist/components/editor/lib/extensions.d.mts.map +1 -1
  34. package/dist/components/editor/lib/extensions.mjs.map +1 -1
  35. package/dist/components/editor/lib/variants.mjs +10 -2
  36. package/dist/components/editor/lib/variants.mjs.map +1 -1
  37. package/dist/components/header/back-button.client.d.mts +2 -2
  38. package/dist/components/header/bottom-bar.client.d.mts +3 -3
  39. package/dist/components/header/breadcrumbs.client.d.mts +7 -7
  40. package/dist/components/header/header.client.d.mts +2 -2
  41. package/dist/components/header/mobile-nav-switcher.client.d.mts +2 -2
  42. package/dist/components/header/top-bar.client.d.mts +4 -4
  43. package/dist/components/layouts/admin-content.client.d.mts +2 -2
  44. package/dist/components/layouts/admin-layout.d.mts +2 -2
  45. package/dist/components/layouts/admin-layout.d.mts.map +1 -1
  46. package/dist/components/layouts/admin-loading.d.mts +2 -2
  47. package/dist/components/layouts/empty-page.d.mts +4 -4
  48. package/dist/components/layouts/list-layout.d.mts +2 -2
  49. package/dist/components/layouts/not-found-page.d.mts +3 -3
  50. package/dist/components/layouts/providers.client.d.mts +2 -2
  51. package/dist/components/layouts/root-layout.server.d.mts +2 -2
  52. package/dist/components/layouts/root-loading.d.mts +2 -2
  53. package/dist/components/layouts/tab-layout.d.mts +2 -2
  54. package/dist/components/lists/data-list.d.mts +5 -5
  55. package/dist/components/lists/data-stack.d.mts +8 -8
  56. package/dist/components/lists/data-stack.d.mts.map +1 -1
  57. package/dist/components/navigation/admin-sidebar-paths.client.d.mts +10 -10
  58. package/dist/components/ui/accordion.d.mts +5 -5
  59. package/dist/components/ui/accordion.d.mts.map +1 -1
  60. package/dist/components/ui/alert-dialog.d.mts +12 -12
  61. package/dist/components/ui/alert-dialog.d.mts.map +1 -1
  62. package/dist/components/ui/alert.d.mts +4 -4
  63. package/dist/components/ui/alert.d.mts.map +1 -1
  64. package/dist/components/ui/aspect-ratio.d.mts +2 -2
  65. package/dist/components/ui/aspect-ratio.d.mts.map +1 -1
  66. package/dist/components/ui/avatar.client.d.mts +4 -4
  67. package/dist/components/ui/badge.d.mts +2 -2
  68. package/dist/components/ui/badge.d.mts.map +1 -1
  69. package/dist/components/ui/breadcrumb.d.mts +8 -8
  70. package/dist/components/ui/breadcrumb.d.mts.map +1 -1
  71. package/dist/components/ui/button.d.mts +2 -2
  72. package/dist/components/ui/button.d.mts.map +1 -1
  73. package/dist/components/ui/calendar.d.mts +3 -3
  74. package/dist/components/ui/calendar.d.mts.map +1 -1
  75. package/dist/components/ui/card.d.mts +7 -7
  76. package/dist/components/ui/card.d.mts.map +1 -1
  77. package/dist/components/ui/carousel.d.mts +6 -6
  78. package/dist/components/ui/carousel.d.mts.map +1 -1
  79. package/dist/components/ui/chart.client.d.mts +5 -5
  80. package/dist/components/ui/checkbox.d.mts +2 -2
  81. package/dist/components/ui/checkbox.d.mts.map +1 -1
  82. package/dist/components/ui/collapsible.client.d.mts +4 -4
  83. package/dist/components/ui/color-picker.client.d.mts +2 -2
  84. package/dist/components/ui/combobox-dropdown.client.d.mts +2 -2
  85. package/dist/components/ui/combobox.client.d.mts +2 -2
  86. package/dist/components/ui/command.d.mts +10 -10
  87. package/dist/components/ui/command.d.mts.map +1 -1
  88. package/dist/components/ui/context-menu.d.mts +16 -16
  89. package/dist/components/ui/context-menu.d.mts.map +1 -1
  90. package/dist/components/ui/date-picker.client.d.mts +2 -2
  91. package/dist/components/ui/dialog.client.d.mts +11 -11
  92. package/dist/components/ui/drawer.client.d.mts +11 -11
  93. package/dist/components/ui/dropdown-menu.d.mts +16 -16
  94. package/dist/components/ui/form.client.d.mts +7 -7
  95. package/dist/components/ui/hover-card.client.d.mts +4 -4
  96. package/dist/components/ui/input-recipient.d.mts +2 -2
  97. package/dist/components/ui/input.d.mts +2 -2
  98. package/dist/components/ui/label.d.mts +2 -2
  99. package/dist/components/ui/navigation-menu.d.mts +9 -9
  100. package/dist/components/ui/pagination.d.mts +8 -8
  101. package/dist/components/ui/popover.d.mts +5 -5
  102. package/dist/components/ui/popover.d.mts.map +1 -1
  103. package/dist/components/ui/progress.client.d.mts +2 -2
  104. package/dist/components/ui/radio-group.d.mts +3 -3
  105. package/dist/components/ui/resizable.client.d.mts +4 -4
  106. package/dist/components/ui/scroll-area.d.mts +3 -3
  107. package/dist/components/ui/select.client.d.mts +11 -11
  108. package/dist/components/ui/separator.d.mts +2 -2
  109. package/dist/components/ui/sheet.client.d.mts +9 -9
  110. package/dist/components/ui/sidebar.client.d.mts +24 -24
  111. package/dist/components/ui/skeleton.d.mts +2 -2
  112. package/dist/components/ui/slider.d.mts +2 -2
  113. package/dist/components/ui/sonner.client.d.mts +2 -2
  114. package/dist/components/ui/switch.d.mts +2 -2
  115. package/dist/components/ui/tabs.d.mts +5 -5
  116. package/dist/components/ui/textarea.d.mts +2 -2
  117. package/dist/components/ui/time-input.client.d.mts +2 -2
  118. package/dist/components/ui/toggle-group.client.d.mts +3 -3
  119. package/dist/components/ui/toggle.d.mts +2 -2
  120. package/dist/components/ui/tooltip.client.d.mts +5 -5
  121. package/dist/components.d.mts +2 -1
  122. package/dist/components.mjs +3 -2
  123. package/dist/data-tables.d.mts +2 -2
  124. package/dist/data-tables.mjs +2 -2
  125. package/dist/inline-edit/client.d.mts +2 -3
  126. package/dist/inline-edit/client.mjs +1 -2
  127. package/dist/lib/client.d.mts +2 -2
  128. package/dist/lib/client.mjs +2 -2
  129. package/dist/lib/hooks/use-action.d.mts +2 -2
  130. package/dist/lib/hooks/use-indicator.d.mts +11 -3
  131. package/dist/lib/hooks/use-indicator.d.mts.map +1 -1
  132. package/dist/lib/hooks/use-indicator.mjs +19 -8
  133. package/dist/lib/hooks/use-indicator.mjs.map +1 -1
  134. package/dist/modules/auth/components/allowed.client.d.mts +2 -2
  135. package/dist/modules/auth/components/allowed.client.d.mts.map +1 -1
  136. package/dist/modules/auth/components/auth-layout.server.d.mts +2 -2
  137. package/dist/modules/auth/components/auth-layout.server.d.mts.map +1 -1
  138. package/dist/modules/auth/components/auth-loading.d.mts +2 -2
  139. package/dist/modules/auth/components/create-first-user-page.client.d.mts +2 -2
  140. package/dist/modules/auth/components/create-first-user-page.client.d.mts.map +1 -1
  141. package/dist/modules/auth/components/forget-password-page.client.d.mts +2 -2
  142. package/dist/modules/auth/components/forget-password-page.client.d.mts.map +1 -1
  143. package/dist/modules/auth/components/guard-first-user.server.d.mts +2 -2
  144. package/dist/modules/auth/components/guard-first-user.server.d.mts.map +1 -1
  145. package/dist/modules/auth/components/guard.server.d.mts +2 -2
  146. package/dist/modules/auth/components/guard.server.d.mts.map +1 -1
  147. package/dist/modules/auth/components/login-page.client.d.mts +2 -2
  148. package/dist/modules/auth/components/login-page.client.d.mts.map +1 -1
  149. package/dist/modules/auth/components/reset-password-page.client.d.mts +2 -2
  150. package/dist/modules/auth/components/reset-password-page.client.d.mts.map +1 -1
  151. package/dist/modules/auth/components/update-password-command.d.mts +2 -2
  152. package/dist/modules/auth/components/update-password-command.d.mts.map +1 -1
  153. package/dist/modules/auth/db/schema.d.mts +73 -73
  154. package/dist/modules/auth/db/schema.d.mts.map +1 -1
  155. package/dist/modules/auth/handler/client.client.d.mts +6 -6
  156. package/dist/modules/auth/hooks/use-permission.d.mts +2 -2
  157. package/dist/modules/auth/hooks/use-session.d.mts +4 -4
  158. package/dist/modules/auth/lib/validators.d.mts +2 -2
  159. package/dist/modules/auth/lib/validators.d.mts.map +1 -1
  160. package/dist/modules/commands/components/alert-dialog-command.client.d.mts +10 -10
  161. package/dist/modules/commands/components/alert-dialog-command.client.d.mts.map +1 -1
  162. package/dist/modules/commands/components/click-command.client.d.mts +2 -2
  163. package/dist/modules/commands/components/click-command.client.d.mts.map +1 -1
  164. package/dist/modules/commands/components/command-trigger.client.d.mts +6 -6
  165. package/dist/modules/commands/components/command-trigger.client.d.mts.map +1 -1
  166. package/dist/modules/commands/components/dialog-command.client.d.mts +8 -8
  167. package/dist/modules/commands/components/dialog-command.client.d.mts.map +1 -1
  168. package/dist/modules/commands/components/dropdown-command.client.d.mts +5 -5
  169. package/dist/modules/commands/components/dropdown-command.client.d.mts.map +1 -1
  170. package/dist/modules/commands/components/empty-command.client.d.mts +2 -2
  171. package/dist/modules/commands/components/empty-command.client.d.mts.map +1 -1
  172. package/dist/modules/commands/components/form-dialog-command.client.d.mts +11 -11
  173. package/dist/modules/commands/components/form-dialog-command.client.d.mts.map +1 -1
  174. package/dist/modules/commands/hooks/use-command-mutation.client.d.mts +2 -2
  175. package/dist/modules/commands/menus/context-menu.client.d.mts +2 -2
  176. package/dist/modules/commands/menus/context-menu.client.d.mts.map +1 -1
  177. package/dist/modules/commands/menus/dropdown-menu.client.d.mts +3 -3
  178. package/dist/modules/commands/menus/dropdown-menu.client.d.mts.map +1 -1
  179. package/dist/modules/commands/menus/inline-menu.client.d.mts +3 -3
  180. package/dist/modules/commands/menus/inline-menu.client.d.mts.map +1 -1
  181. package/dist/modules/commands/menus/responsive-menu.client.d.mts +3 -3
  182. package/dist/modules/commands/menus/responsive-menu.client.d.mts.map +1 -1
  183. package/dist/modules/commands/utils/archive-command.client.d.mts +3 -3
  184. package/dist/modules/commands/utils/archive-command.client.d.mts.map +1 -1
  185. package/dist/modules/commands/utils/delete-command.client.d.mts +3 -3
  186. package/dist/modules/commands/utils/delete-command.client.d.mts.map +1 -1
  187. package/dist/modules/config/db/helpers.d.mts +5 -5
  188. package/dist/modules/config/db/helpers.d.mts.map +1 -1
  189. package/dist/modules/data-tables/components/cell/common.client.d.mts +5 -5
  190. package/dist/modules/data-tables/components/column-header.d.mts +2 -2
  191. package/dist/modules/data-tables/components/column-header.d.mts.map +1 -1
  192. package/dist/modules/data-tables/components/filters/combobox.client.d.mts +2 -2
  193. package/dist/modules/data-tables/components/filters/slider.client.d.mts +2 -2
  194. package/dist/modules/data-tables/components/header.d.mts +4 -4
  195. package/dist/modules/data-tables/components/header.d.mts.map +1 -1
  196. package/dist/modules/data-tables/components/layout.d.mts +2 -2
  197. package/dist/modules/data-tables/components/layout.d.mts.map +1 -1
  198. package/dist/modules/data-tables/components/search-input.client.d.mts +2 -2
  199. package/dist/modules/data-tables/components/skeleton.d.mts +2 -2
  200. package/dist/modules/data-tables/components/skeleton.d.mts.map +1 -1
  201. package/dist/modules/data-tables/components/table.d.mts +7 -7
  202. package/dist/modules/data-tables/components/table.d.mts.map +1 -1
  203. package/dist/modules/data-tables/components/toolbar.d.mts +3 -3
  204. package/dist/modules/data-tables/components/toolbar.d.mts.map +1 -1
  205. package/dist/modules/data-tables/hooks/use-context.client.d.mts +2 -2
  206. package/dist/modules/data-tables/lib/filters/parsers.d.mts +6 -1
  207. package/dist/modules/data-tables/lib/filters/parsers.d.mts.map +1 -1
  208. package/dist/modules/data-tables/lib/filters/parsers.mjs +6 -1
  209. package/dist/modules/data-tables/lib/filters/parsers.mjs.map +1 -1
  210. package/dist/modules/data-tables/tables/data-table/components/table.d.mts +2 -2
  211. package/dist/modules/data-tables/tables/inline-table/components/cells/common.d.mts +2 -2
  212. package/dist/modules/data-tables/tables/inline-table/components/cells/drag-handle.client.d.mts +2 -2
  213. package/dist/modules/data-tables/tables/inline-table/components/inputs/advanced-select.client.d.mts +2 -2
  214. package/dist/modules/data-tables/tables/inline-table/components/inputs/combobox.client.d.mts +2 -2
  215. package/dist/modules/data-tables/tables/inline-table/components/inputs/input.client.d.mts +3 -3
  216. package/dist/modules/data-tables/tables/inline-table/components/inputs/read-only.d.mts +2 -2
  217. package/dist/modules/data-tables/tables/inline-table/components/inputs/select.client.d.mts +2 -2
  218. package/dist/modules/data-tables/tables/inline-table/components/table.d.mts +2 -2
  219. package/dist/modules/data-tables/tables/inline-table/hooks/context.client.d.mts +2 -2
  220. package/dist/modules/inline-edit/components/combobox-dropdown.client.d.mts +6 -4
  221. package/dist/modules/inline-edit/components/combobox-dropdown.client.d.mts.map +1 -1
  222. package/dist/modules/inline-edit/components/combobox-dropdown.client.mjs +11 -6
  223. package/dist/modules/inline-edit/components/combobox-dropdown.client.mjs.map +1 -1
  224. package/dist/modules/inline-edit/components/combobox.client.d.mts +6 -4
  225. package/dist/modules/inline-edit/components/combobox.client.d.mts.map +1 -1
  226. package/dist/modules/inline-edit/components/combobox.client.mjs +7 -5
  227. package/dist/modules/inline-edit/components/combobox.client.mjs.map +1 -1
  228. package/dist/modules/inline-edit/components/date-input.client.d.mts +5 -3
  229. package/dist/modules/inline-edit/components/date-input.client.d.mts.map +1 -1
  230. package/dist/modules/inline-edit/components/date-input.client.mjs +26 -13
  231. package/dist/modules/inline-edit/components/date-input.client.mjs.map +1 -1
  232. package/dist/modules/inline-edit/components/date-picker.client.d.mts +6 -4
  233. package/dist/modules/inline-edit/components/date-picker.client.d.mts.map +1 -1
  234. package/dist/modules/inline-edit/components/date-picker.client.mjs +12 -7
  235. package/dist/modules/inline-edit/components/date-picker.client.mjs.map +1 -1
  236. package/dist/modules/inline-edit/components/editor.client.d.mts +6 -4
  237. package/dist/modules/inline-edit/components/editor.client.d.mts.map +1 -1
  238. package/dist/modules/inline-edit/components/editor.client.mjs +11 -6
  239. package/dist/modules/inline-edit/components/editor.client.mjs.map +1 -1
  240. package/dist/modules/inline-edit/components/input-recipient.client.d.mts +6 -4
  241. package/dist/modules/inline-edit/components/input-recipient.client.d.mts.map +1 -1
  242. package/dist/modules/inline-edit/components/input-recipient.client.mjs +11 -6
  243. package/dist/modules/inline-edit/components/input-recipient.client.mjs.map +1 -1
  244. package/dist/modules/inline-edit/components/input-toggle.client.d.mts +6 -4
  245. package/dist/modules/inline-edit/components/input-toggle.client.d.mts.map +1 -1
  246. package/dist/modules/inline-edit/components/input-toggle.client.mjs +9 -7
  247. package/dist/modules/inline-edit/components/input-toggle.client.mjs.map +1 -1
  248. package/dist/modules/inline-edit/components/input.client.d.mts +13 -10
  249. package/dist/modules/inline-edit/components/input.client.d.mts.map +1 -1
  250. package/dist/modules/inline-edit/components/input.client.mjs +35 -19
  251. package/dist/modules/inline-edit/components/input.client.mjs.map +1 -1
  252. package/dist/modules/inline-edit/components/select.client.d.mts +10 -9
  253. package/dist/modules/inline-edit/components/select.client.d.mts.map +1 -1
  254. package/dist/modules/inline-edit/components/select.client.mjs +14 -7
  255. package/dist/modules/inline-edit/components/select.client.mjs.map +1 -1
  256. package/dist/modules/inline-edit/components/switch.client.d.mts +5 -3
  257. package/dist/modules/inline-edit/components/switch.client.d.mts.map +1 -1
  258. package/dist/modules/inline-edit/components/switch.client.mjs +8 -6
  259. package/dist/modules/inline-edit/components/switch.client.mjs.map +1 -1
  260. package/dist/modules/inline-edit/components/toggle.client.d.mts +6 -4
  261. package/dist/modules/inline-edit/components/toggle.client.d.mts.map +1 -1
  262. package/dist/modules/inline-edit/components/toggle.client.mjs +9 -7
  263. package/dist/modules/inline-edit/components/toggle.client.mjs.map +1 -1
  264. package/dist/modules/inline-edit/hooks/context.client.d.mts +2 -2
  265. package/dist/modules/inline-edit/hooks/context.client.d.mts.map +1 -1
  266. package/dist/modules/inline-edit/hooks/use-inline.client.d.mts +35 -3
  267. package/dist/modules/inline-edit/hooks/use-inline.client.d.mts.map +1 -1
  268. package/dist/modules/inline-edit/hooks/use-inline.client.mjs +71 -9
  269. package/dist/modules/inline-edit/hooks/use-inline.client.mjs.map +1 -1
  270. package/dist/modules/inline-edit/lib/variants.d.mts +1 -0
  271. package/dist/modules/inline-edit/lib/variants.d.mts.map +1 -1
  272. package/dist/modules/inline-edit/lib/variants.mjs +12 -4
  273. package/dist/modules/inline-edit/lib/variants.mjs.map +1 -1
  274. package/dist/modules/router/handler/init.server.d.mts +6 -6
  275. package/dist/modules/router/handler/init.server.d.mts.map +1 -1
  276. package/dist/modules/router/lib/query-client.server.d.mts +2 -2
  277. package/dist/modules/router/lib/query-client.server.d.mts.map +1 -1
  278. package/dist/modules/storage/components/dropzone-context.client.d.mts +2 -2
  279. package/dist/modules/storage/components/dropzone.client.d.mts +5 -5
  280. package/dist/modules/storage/components/dropzone.client.mjs +1 -1
  281. package/dist/modules/storage/components/image-grid.client.d.mts +3 -3
  282. package/dist/modules/storage/components/image-grid.client.mjs +3 -3
  283. package/dist/modules/storage/components/image-grid.client.mjs.map +1 -1
  284. package/dist/modules/storage/components/upload-zone-context.client.d.mts +3 -11
  285. package/dist/modules/storage/components/upload-zone-context.client.d.mts.map +1 -1
  286. package/dist/modules/storage/components/upload-zone-context.client.mjs.map +1 -1
  287. package/dist/modules/storage/components/upload-zone.client.d.mts +10 -33
  288. package/dist/modules/storage/components/upload-zone.client.d.mts.map +1 -1
  289. package/dist/modules/storage/components/upload-zone.client.mjs +19 -93
  290. package/dist/modules/storage/components/upload-zone.client.mjs.map +1 -1
  291. package/dist/modules/storage/config/filters.d.mts +1 -0
  292. package/dist/modules/storage/config/filters.d.mts.map +1 -1
  293. package/dist/modules/storage/config/filters.mjs +1 -0
  294. package/dist/modules/storage/config/filters.mjs.map +1 -1
  295. package/dist/modules/storage/lib/create-upload.client.d.mts +56 -0
  296. package/dist/modules/storage/lib/create-upload.client.d.mts.map +1 -0
  297. package/dist/modules/storage/lib/create-upload.client.mjs +98 -0
  298. package/dist/modules/storage/lib/create-upload.client.mjs.map +1 -0
  299. package/dist/modules/storage/lib/helpers.d.mts +1 -1
  300. package/dist/modules/storage/lib/router.server.d.mts +3265 -2345
  301. package/dist/modules/storage/lib/router.server.d.mts.map +1 -1
  302. package/dist/modules/storage/lib/router.server.mjs +5 -2
  303. package/dist/modules/storage/lib/router.server.mjs.map +1 -1
  304. package/dist/modules/storage/lib/schema.d.mts +124 -90
  305. package/dist/modules/storage/lib/schema.d.mts.map +1 -1
  306. package/dist/modules/storage/lib/schema.mjs +2 -1
  307. package/dist/modules/storage/lib/schema.mjs.map +1 -1
  308. package/dist/modules/storage/lib/service.server.d.mts +31 -42
  309. package/dist/modules/storage/lib/service.server.d.mts.map +1 -1
  310. package/dist/modules/storage/lib/service.server.mjs +5 -5
  311. package/dist/modules/storage/lib/service.server.mjs.map +1 -1
  312. package/dist/modules/storage/lib/validators.d.mts +170 -90
  313. package/dist/modules/storage/lib/validators.d.mts.map +1 -1
  314. package/dist/modules/storage/lib/validators.mjs +2 -1
  315. package/dist/modules/storage/lib/validators.mjs.map +1 -1
  316. package/dist/storage/client.d.mts +2 -1
  317. package/dist/storage/client.mjs +2 -8
  318. package/dist/storage.d.mts +2 -2
  319. package/dist/storage.mjs +1 -1
  320. package/package.json +4 -3
  321. package/src/components/editor/components/editor.client.tsx +7 -2
  322. package/src/components/editor/components/menu.client.tsx +26 -0
  323. package/src/components/editor/extensions/file-handler/extension.ts +69 -0
  324. package/src/components/editor/extensions/file-handler/strategy.ts +167 -0
  325. package/src/components/editor/extensions/file-handler/utils.ts +51 -0
  326. package/src/components/editor/extensions/image/extension.ts +57 -0
  327. package/src/components/editor/extensions/skeleton/extension.ts +35 -0
  328. package/src/components/editor/extensions/skeleton/renderer.tsx +14 -0
  329. package/src/components/editor/lib/constants.ts +16 -2
  330. package/src/components/editor/lib/extensions.ts +4 -1
  331. package/src/components/editor/lib/utils.ts +32 -0
  332. package/src/components/editor/lib/variants.ts +72 -1
  333. package/src/components/entry.ts +2 -1
  334. package/src/lib/hooks/use-indicator.tsx +27 -18
  335. package/src/modules/data-tables/lib/filters/parsers.ts +14 -0
  336. package/src/modules/inline-edit/components/combobox-dropdown.client.tsx +21 -12
  337. package/src/modules/inline-edit/components/combobox.client.tsx +13 -6
  338. package/src/modules/inline-edit/components/date-input.client.tsx +29 -13
  339. package/src/modules/inline-edit/components/date-picker.client.tsx +13 -9
  340. package/src/modules/inline-edit/components/editor.client.tsx +14 -14
  341. package/src/modules/inline-edit/components/input-recipient.client.tsx +15 -8
  342. package/src/modules/inline-edit/components/input-toggle.client.tsx +16 -9
  343. package/src/modules/inline-edit/components/input.client.tsx +38 -24
  344. package/src/modules/inline-edit/components/select.client.tsx +16 -9
  345. package/src/modules/inline-edit/components/switch.client.tsx +10 -6
  346. package/src/modules/inline-edit/components/toggle.client.tsx +13 -9
  347. package/src/modules/inline-edit/entry.client.ts +0 -1
  348. package/src/modules/inline-edit/hooks/use-inline.client copy.tsx +97 -0
  349. package/src/modules/inline-edit/hooks/use-inline.client.tsx +139 -20
  350. package/src/modules/inline-edit/lib/variants.ts +7 -0
  351. package/src/modules/storage/components/image-grid.client.tsx +2 -2
  352. package/src/modules/storage/components/upload-zone-context.client.tsx +3 -4
  353. package/src/modules/storage/components/upload-zone.client.tsx +17 -116
  354. package/src/modules/storage/config/filters.ts +1 -0
  355. package/src/modules/storage/entry.client.ts +2 -1
  356. package/src/modules/storage/lib/create-upload.client.ts +134 -0
  357. package/src/modules/storage/lib/router.server.ts +1 -0
  358. package/src/modules/storage/lib/schema.ts +1 -0
  359. package/src/modules/storage/lib/service.server.ts +10 -4
  360. package/src/modules/storage/lib/validators.ts +1 -0
  361. package/dist/modules/inline-edit/components/deprecated-editor.client.d.mts +0 -21
  362. package/dist/modules/inline-edit/components/deprecated-editor.client.d.mts.map +0 -1
  363. package/dist/modules/inline-edit/components/deprecated-editor.client.mjs +0 -37
  364. package/dist/modules/inline-edit/components/deprecated-editor.client.mjs.map +0 -1
  365. package/dist/storage/client.mjs.map +0 -1
  366. package/src/modules/inline-edit/components/deprecated-editor.client.tsx +0 -48
@@ -1,15 +1,14 @@
1
1
  "use client";
2
2
 
3
3
  import React from "react";
4
- import { FileNode, Node, PresignFileSchema } from "../lib/validators";
4
+ import { UploadClient } from "../lib/create-upload.client";
5
+ import { FileNode, Node } from "../lib/validators";
5
6
 
6
7
  /**
7
8
  * Upload Zone Context Value
8
9
  */
9
10
  export type UploadZoneContextValue = {
10
- presignMutation: (params: PresignFileSchema) => Promise<{ id: string; presignedUrl: string }>;
11
- confirmMutation: (params: { id: string }) => Promise<Node>;
12
- deleteMutation: (params: { ids: string[] }) => Promise<unknown>;
11
+ uploadClient: UploadClient;
13
12
  updateData: (newValue: FileNode[] | ((oldValue: FileNode[]) => FileNode[])) => Promise<void>;
14
13
  invalidateQuery: () => Promise<void> | void;
15
14
  onUpload: (file: File) => Promise<Node>;
@@ -4,45 +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, UploadFileSchema } 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
- options?: Pick<UploadFileSchema, "readonly" | "hidden" | "mode">;
17
-
18
14
  queryKey: readonly unknown[];
19
15
 
20
- presignAction: (params: PresignFileSchema) => Promise<{ id: string; presignedUrl: string }>;
21
- onPresignStarted?: (file: PresignFileSchema) => Promise<void> | void;
22
- onPresignCompleted?: (data: { id: string; presignedUrl: string }) => Promise<void> | void;
23
-
24
- confirmAction: (params: { id: string }) => Promise<Node>;
25
- onConfirmStarted?: (id: string) => Promise<void> | void;
26
- onConfirmCompleted?: (node: Node) => Promise<void> | void;
27
-
28
- deleteAction: (params: { ids: string[] }) => Promise<unknown>;
16
+ variables: Pick<UploadFileSchema, "namespace" | "parentId" | "mode" | "hidden" | "readonly">;
17
+ uploadClient: UploadClient;
18
+ uploadHooks?: UploadHooks;
29
19
 
30
20
  onUploadCompleted?: (node: Node) => Promise<void> | void;
31
21
  onUploadFailed?: (error: unknown) => Promise<void> | void;
32
22
  };
33
23
 
34
24
  export function UploadZone({
35
- namespace,
36
- parentId,
37
- options,
25
+ variables,
38
26
  queryKey,
39
- presignAction,
40
- confirmAction,
41
- deleteAction,
42
- onPresignStarted,
43
- onPresignCompleted,
44
- onConfirmStarted,
45
- onConfirmCompleted,
27
+ uploadClient,
28
+ uploadHooks,
46
29
  onUploadCompleted,
47
30
  onUploadFailed,
48
31
  children,
@@ -76,7 +59,7 @@ export function UploadZone({
76
59
  * Delete mutation
77
60
  */
78
61
  const deleteMutation = useAction({
79
- mutationFn: deleteAction,
62
+ mutationFn: async (params: { ids: string[] }) => uploadClient.deleteFiles(params.ids),
80
63
  onMutate: async (variables) => {
81
64
  await updateData((prev) => prev.filter((node) => !variables.ids.includes(node.id)));
82
65
  },
@@ -90,15 +73,10 @@ export function UploadZone({
90
73
  });
91
74
 
92
75
  /**
93
- * Presign upload mutation
76
+ * Upload mutation
94
77
  */
95
- const presignMutation = useAction({
96
- mutationFn: async (params: PresignFileSchema) => {
97
- await onPresignStarted?.(params);
98
- const data = await presignAction(params);
99
- await onPresignCompleted?.(data);
100
- return data;
101
- },
78
+ const uploadMutation = useAction({
79
+ mutationFn: async (params: UploadFileRequest) => uploadClient.upload(params, uploadHooks),
102
80
  onMutate: async (variables) => {
103
81
  // Generate a new node
104
82
  const newNode = {
@@ -109,61 +87,6 @@ export function UploadZone({
109
87
 
110
88
  await updateData((prev) => [...(prev ?? []), newNode]);
111
89
  },
112
- onError: async (error, variables) => {
113
- await onUploadFailed?.(error);
114
-
115
- console.error("Presign error: ", error);
116
- toast.error("Bestand uploaden mislukt", {
117
- description: error instanceof Error ? error.message : undefined,
118
- });
119
-
120
- console.info("Deleting failed upload");
121
- await deleteMutation.mutateAsync({ ids: [variables.id] });
122
- },
123
- });
124
-
125
- /**
126
- * Upload mutation
127
- */
128
- const uploadMutation = useAction({
129
- mutationFn: async (input: { id: string; presignedUrl: string; file: File }) => {
130
- /**
131
- * Upload the file
132
- */
133
- const uploadResponse = await fetch(input.presignedUrl, {
134
- method: "PUT",
135
- headers: { "Content-Type": input.file.type },
136
- body: input.file,
137
- });
138
-
139
- if (!uploadResponse.ok) {
140
- const message = await uploadResponse.text();
141
- throw new Error(`Upload failed: ${message}`);
142
- }
143
- },
144
- onError: async (error, variables) => {
145
- await onUploadFailed?.(error);
146
-
147
- console.error("Upload error: ", error);
148
- toast.error("Bestand uploaden mislukt", {
149
- description: error instanceof Error ? error.message : undefined,
150
- });
151
-
152
- console.info("Deleting failed upload");
153
- await deleteMutation.mutateAsync({ ids: [variables.id] });
154
- },
155
- });
156
-
157
- /**
158
- * Confirm upload mutation
159
- */
160
- const confirmMutation = useAction({
161
- mutationFn: async (params: { id: string }) => {
162
- await onConfirmStarted?.(params.id);
163
- const data = await confirmAction(params);
164
- await onConfirmCompleted?.(data);
165
- return data;
166
- },
167
90
  onSuccess: async (data) => {
168
91
  await onUploadCompleted?.(data);
169
92
  toast.success(`Succesvol geupload: ${data.name}`);
@@ -171,7 +94,7 @@ export function UploadZone({
171
94
  onError: async (error, variables) => {
172
95
  await onUploadFailed?.(error);
173
96
 
174
- console.error("Confirm error: ", error);
97
+ console.error("Upload error: ", error);
175
98
  toast.error("Bestand uploaden mislukt", {
176
99
  description: error instanceof Error ? error.message : undefined,
177
100
  });
@@ -189,30 +112,10 @@ export function UploadZone({
189
112
  */
190
113
  const onUpload = useCallback(
191
114
  async (file: File) => {
192
- /**
193
- * Send the presign request
194
- */
195
- const { id, presignedUrl } = await presignMutation.mutateAsync({
196
- ...options,
197
- id: generateDefaultUUID(),
198
- name: file.name,
199
- size: file.size,
200
- contentType: file.type,
201
- namespace,
202
- parentId,
203
- });
204
-
205
- /**
206
- * Uploading the file
207
- */
208
- await uploadMutation.mutateAsync({ id, presignedUrl, file });
209
-
210
- /**
211
- * Confirming the upload
212
- */
213
- return await confirmMutation.mutateAsync({ id });
115
+ const req = uploadClient.prepareUpload({ ...variables, file });
116
+ return await uploadMutation.mutateAsync(req);
214
117
  },
215
- [presignMutation, options, namespace, parentId, uploadMutation, confirmMutation],
118
+ [uploadClient, variables, uploadMutation],
216
119
  );
217
120
 
218
121
  return (
@@ -246,9 +149,7 @@ export function UploadZone({
246
149
  )}
247
150
  <UploadZoneContext
248
151
  value={{
249
- presignMutation: (params) => presignMutation.mutateAsync(params),
250
- confirmMutation: (params) => confirmMutation.mutateAsync(params),
251
- deleteMutation: (params) => deleteMutation.mutateAsync(params),
152
+ uploadClient,
252
153
  onUpload,
253
154
  updateData,
254
155
  invalidateQuery,
@@ -7,5 +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()),
10
11
  hidden: parseFilterBoolean(z.boolean()),
11
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
+ }
@@ -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
@@ -25,6 +25,7 @@ export const nodes = pgTable("nodes", (t) => ({
25
25
  createdBy: t.uuid().references(() => users.id, { onDelete: "set null" }),
26
26
  isPending: t.boolean().default(false).notNull(),
27
27
  isDeleted: t.boolean().default(false).notNull(),
28
+ orphanedAt: t.timestamp(),
28
29
  parentId: t.uuid().references((): AnyPgColumn => nodes.id, { onDelete: "cascade" }),
29
30
  }));
30
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 ?? 0,
105
+ ContentType: input.contentType ?? undefined,
106
+ ContentLength: input.size ?? undefined,
106
107
  Metadata: {
107
108
  nodeId: input.id,
108
109
  },
@@ -139,6 +140,11 @@ export class StorageService<TSchema extends TDatabaseSchema> {
139
140
  filters.nodeIds != null ? inArray(nodes.id, filters.nodeIds) : undefined,
140
141
  filters.types != null ? inArray(nodes.type, filters.types) : undefined,
141
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,
142
148
  filters.hidden != null ? eq(nodes.hidden, filters.hidden) : undefined,
143
149
  filters.parentId ? eq(nodes.parentId, filters.parentId) : isNull(nodes.parentId),
144
150
  eq(nodes.namespace, filters.namespace),
@@ -313,7 +319,7 @@ export class StorageService<TSchema extends TDatabaseSchema> {
313
319
  // after(async () => {});
314
320
  await this.generatePreviews(input);
315
321
 
316
- return result;
322
+ return result as FileNode;
317
323
  }
318
324
 
319
325
  /**
@@ -62,6 +62,7 @@ export const nodesTableFiltersSchema = resolveFiltersSchema(nodesTableFilters)
62
62
  ...input,
63
63
  hidden: input?.hidden ?? false,
64
64
  isDeleted: input?.isDeleted ?? false,
65
+ orphanedAt: input?.isOrphaned ?? false,
65
66
  }));
66
67
 
67
68
  export type NodesTableFilters = z.input<typeof nodesTableFiltersSchema>;
@@ -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_runtime163 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_runtime163.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,oBAAA,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
- }