@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,18 +1,20 @@
1
1
  import { ComboboxProps } from "../../../components/ui/combobox.client.mjs";
2
2
  import { useInlineEditOptions } from "../hooks/use-inline.client.mjs";
3
- import * as react_jsx_runtime160 from "react/jsx-runtime";
3
+ import * as react_jsx_runtime2 from "react/jsx-runtime";
4
4
 
5
5
  //#region src/modules/inline-edit/components/combobox.client.d.ts
6
- type InlineComboboxProps<TValue> = useInlineEditOptions<string> & Omit<ComboboxProps<TValue>, "value">;
7
- declare function InlineCombobox<TValue>({
6
+ type InlineComboboxProps<TValue, Required extends boolean = false> = useInlineEditOptions<string, Required> & Omit<ComboboxProps<TValue>, "value">;
7
+ declare function InlineCombobox<TValue, Required extends boolean>({
8
8
  initialValue,
9
9
  action,
10
10
  permission,
11
11
  onSelect,
12
12
  onBlur,
13
13
  disabled,
14
+ updateStrategy,
15
+ isRequired,
14
16
  ...props
15
- }: InlineComboboxProps<TValue>): react_jsx_runtime160.JSX.Element;
17
+ }: InlineComboboxProps<TValue, Required>): react_jsx_runtime2.JSX.Element;
16
18
  //#endregion
17
19
  export { InlineCombobox, InlineComboboxProps };
18
20
  //# sourceMappingURL=combobox.client.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"combobox.client.d.mts","names":[],"sources":["../../../../src/modules/inline-edit/components/combobox.client.tsx"],"sourcesContent":[],"mappings":";;;;;KAKY,8BAA8B,+BACxC,KAAK,cAAc;iBAEL;;;;;;;;GAQb,oBAAoB,UAAO,oBAAA,CAAA,GAAA,CAAA"}
1
+ {"version":3,"file":"combobox.client.d.mts","names":[],"sources":["../../../../src/modules/inline-edit/components/combobox.client.tsx"],"sourcesContent":[],"mappings":";;;;;KAKY,gEAAgE,6BAE1E,YAEA,KAAK,cAAc;iBAEL;;;;;;;;;;GAUb,oBAAoB,QAAQ,YAAS,kBAAA,CAAA,GAAA,CAAA"}
@@ -5,22 +5,24 @@ import { useInlineEdit } from "../hooks/use-inline.client.mjs";
5
5
  import { jsx } from "react/jsx-runtime";
6
6
 
7
7
  //#region src/modules/inline-edit/components/combobox.client.tsx
8
- function InlineCombobox({ initialValue, action, permission, onSelect, onBlur, disabled, ...props }) {
9
- const { value, setValue, handleUpdate, isAllowed } = useInlineEdit({
8
+ function InlineCombobox({ initialValue, action, permission, onSelect, onBlur, disabled, updateStrategy, isRequired, ...props }) {
9
+ const { value, handleChange, handleBlur, isAllowed } = useInlineEdit({
10
10
  initialValue,
11
11
  action,
12
- permission
12
+ permission,
13
+ updateStrategy,
14
+ isRequired
13
15
  });
14
16
  return /* @__PURE__ */ jsx(Combobox, {
15
17
  ...props,
16
18
  value,
17
19
  disabled: disabled || !isAllowed,
18
20
  onSelect: (value$1) => {
19
- setValue(value$1);
21
+ handleChange(value$1 ?? null);
20
22
  onSelect?.(value$1);
21
23
  },
22
24
  onBlur: (e) => {
23
- handleUpdate(e.target.value);
25
+ handleBlur(e.target.value ?? null);
24
26
  onBlur?.(e);
25
27
  }
26
28
  });
@@ -1 +1 @@
1
- {"version":3,"file":"combobox.client.mjs","names":["value"],"sources":["../../../../src/modules/inline-edit/components/combobox.client.tsx"],"sourcesContent":["\"use client\";\n\nimport { Combobox, ComboboxProps } from \"@/components/ui/combobox.client\";\nimport { useInlineEdit, useInlineEditOptions } from \"../hooks/use-inline.client\";\n\nexport type InlineComboboxProps<TValue> = useInlineEditOptions<string> &\n Omit<ComboboxProps<TValue>, \"value\">;\n\nexport function InlineCombobox<TValue>({\n initialValue,\n action,\n permission,\n onSelect,\n onBlur,\n disabled,\n ...props\n}: InlineComboboxProps<TValue>) {\n const { value, setValue, handleUpdate, isAllowed } = useInlineEdit({\n initialValue,\n action,\n permission,\n });\n\n return (\n <Combobox\n {...props}\n value={value}\n disabled={disabled || !isAllowed}\n onSelect={(value) => {\n setValue(value);\n onSelect?.(value as TValue);\n }}\n onBlur={(e) => {\n handleUpdate(e.target.value);\n onBlur?.(e);\n }}\n />\n );\n}\n"],"mappings":";;;;;;;AAQA,SAAgB,eAAuB,EACrC,cACA,QACA,YACA,UACA,QACA,UACA,GAAG,SAC2B;CAC9B,MAAM,EAAE,OAAO,UAAU,cAAc,cAAc,cAAc;EACjE;EACA;EACA;EACD,CAAC;AAEF,QACE,oBAAC;EACC,GAAI;EACG;EACP,UAAU,YAAY,CAAC;EACvB,WAAW,YAAU;AACnB,YAASA,QAAM;AACf,cAAWA,QAAgB;;EAE7B,SAAS,MAAM;AACb,gBAAa,EAAE,OAAO,MAAM;AAC5B,YAAS,EAAE;;GAEb"}
1
+ {"version":3,"file":"combobox.client.mjs","names":["value"],"sources":["../../../../src/modules/inline-edit/components/combobox.client.tsx"],"sourcesContent":["\"use client\";\n\nimport { Combobox, ComboboxProps } from \"@/components/ui/combobox.client\";\nimport { useInlineEdit, useInlineEditOptions } from \"../hooks/use-inline.client\";\n\nexport type InlineComboboxProps<TValue, Required extends boolean = false> = useInlineEditOptions<\n string,\n Required\n> &\n Omit<ComboboxProps<TValue>, \"value\">;\n\nexport function InlineCombobox<TValue, Required extends boolean>({\n initialValue,\n action,\n permission,\n onSelect,\n onBlur,\n disabled,\n updateStrategy,\n isRequired,\n ...props\n}: InlineComboboxProps<TValue, Required>) {\n const { value, handleChange, handleBlur, isAllowed } = useInlineEdit({\n initialValue,\n action,\n permission,\n updateStrategy,\n isRequired,\n });\n\n return (\n <Combobox\n {...props}\n value={value}\n disabled={disabled || !isAllowed}\n onSelect={(value) => {\n handleChange(value ?? null);\n onSelect?.(value as TValue);\n }}\n onBlur={(e) => {\n handleBlur(e.target.value ?? null);\n onBlur?.(e);\n }}\n />\n );\n}\n"],"mappings":";;;;;;;AAWA,SAAgB,eAAiD,EAC/D,cACA,QACA,YACA,UACA,QACA,UACA,gBACA,YACA,GAAG,SACqC;CACxC,MAAM,EAAE,OAAO,cAAc,YAAY,cAAc,cAAc;EACnE;EACA;EACA;EACA;EACA;EACD,CAAC;AAEF,QACE,oBAAC;EACC,GAAI;EACG;EACP,UAAU,YAAY,CAAC;EACvB,WAAW,YAAU;AACnB,gBAAaA,WAAS,KAAK;AAC3B,cAAWA,QAAgB;;EAE7B,SAAS,MAAM;AACb,cAAW,EAAE,OAAO,SAAS,KAAK;AAClC,YAAS,EAAE;;GAEb"}
@@ -1,17 +1,19 @@
1
1
  import { useInlineEditOptions } from "../hooks/use-inline.client.mjs";
2
2
  import { InlineEditVariantsProps } from "../lib/variants.mjs";
3
- import * as react_jsx_runtime161 from "react/jsx-runtime";
3
+ import * as react_jsx_runtime3 from "react/jsx-runtime";
4
4
  import { ComponentProps } from "react";
5
5
 
6
6
  //#region src/modules/inline-edit/components/date-input.client.d.ts
7
- declare function InlineDateInput({
7
+ declare function InlineDateInput<Required extends boolean = false>({
8
8
  initialValue,
9
9
  action,
10
10
  permission,
11
11
  variant,
12
12
  className,
13
+ updateStrategy,
14
+ isRequired,
13
15
  ...props
14
- }: ComponentProps<"div"> & useInlineEditOptions<Date> & InlineEditVariantsProps): react_jsx_runtime161.JSX.Element;
16
+ }: ComponentProps<"div"> & useInlineEditOptions<Date, Required> & InlineEditVariantsProps): react_jsx_runtime3.JSX.Element;
15
17
  //#endregion
16
18
  export { InlineDateInput };
17
19
  //# sourceMappingURL=date-input.client.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"date-input.client.d.mts","names":[],"sources":["../../../../src/modules/inline-edit/components/date-input.client.tsx"],"sourcesContent":[],"mappings":";;;;;;iBAgBgB,eAAA;;;;;;;GAOb,wBAAwB,qBAAqB,QAAQ,0BAAuB,oBAAA,CAAA,GAAA,CAAA"}
1
+ {"version":3,"file":"date-input.client.d.mts","names":[],"sources":["../../../../src/modules/inline-edit/components/date-input.client.tsx"],"sourcesContent":[],"mappings":";;;;;;iBAiBgB;;;;;;;;;GASb,wBAAwB,qBAAqB,MAAM,YAAY,0BAAuB,kBAAA,CAAA,GAAA,CAAA"}
@@ -15,27 +15,39 @@ import { format } from "date-fns";
15
15
  //#region src/modules/inline-edit/components/date-input.client.tsx
16
16
  const formatDate = (value) => format(value, "dd/MM/yyyy");
17
17
  const parseDate = (value) => new Date(value.split("/").reverse().join("-"));
18
- function InlineDateInput({ initialValue, action, permission, variant, className, ...props }) {
18
+ const isValidDate = (date) => date instanceof Date && date.toString() !== "Invalid Date";
19
+ function InlineDateInput({ initialValue, action, permission, variant, className, updateStrategy, isRequired, ...props }) {
19
20
  const [inValid, setInValid] = React.useState(false);
20
- const { value, setValue, handleUpdate, isAllowed } = useInlineEdit({
21
+ const { value, setValue, handleChange, handleBlur, status, isAllowed } = useInlineEdit({
21
22
  initialValue,
22
23
  action,
23
- permission
24
+ permission,
25
+ updateStrategy,
26
+ isRequired
24
27
  });
25
28
  const [stringDate, setStringDate] = React.useState(initialValue ? formatDate(initialValue) : "");
29
+ /**
30
+ * Update string date when value changes
31
+ */
32
+ React.useEffect(() => {
33
+ if (value) setStringDate(formatDate(value));
34
+ }, [value]);
26
35
  return /* @__PURE__ */ jsxs(Popover, { children: [/* @__PURE__ */ jsxs("div", {
27
36
  ...props,
28
- className: cn("relative h-full", inlineEditVariants({ variant }), className),
37
+ className: cn("relative h-full", className),
29
38
  children: [/* @__PURE__ */ jsx(Input, {
30
39
  "data-input": true,
31
40
  type: "string",
32
41
  value: stringDate,
33
- className: cn(inValid && "text-destructive"),
42
+ className: cn(inlineEditVariants({
43
+ variant,
44
+ status
45
+ }), inValid && "text-destructive"),
34
46
  disabled: !isAllowed,
35
47
  onChange: (e) => {
36
48
  setStringDate(e.target.value);
37
49
  const parsedDate = parseDate(e.target.value);
38
- if (parsedDate.toString() === "Invalid Date") {
50
+ if (!isValidDate(parsedDate)) {
39
51
  setInValid(true);
40
52
  setValue(void 0);
41
53
  } else {
@@ -44,7 +56,8 @@ function InlineDateInput({ initialValue, action, permission, variant, className,
44
56
  }
45
57
  },
46
58
  onBlur: (e) => {
47
- handleUpdate(parseDate(e.target.value));
59
+ const parsedDate = parseDate(e.target.value);
60
+ handleBlur(isValidDate(parsedDate) ? parsedDate : null);
48
61
  }
49
62
  }), /* @__PURE__ */ jsx(PopoverTrigger, {
50
63
  asChild: true,
@@ -60,15 +73,15 @@ function InlineDateInput({ initialValue, action, permission, variant, className,
60
73
  className: "w-auto p-0",
61
74
  children: /* @__PURE__ */ jsx(Calendar$1, {
62
75
  mode: "single",
63
- initialFocus: true,
64
- selected: value,
65
- defaultMonth: value,
66
- disabled: status === "pending",
76
+ autoFocus: true,
77
+ selected: value ?? void 0,
78
+ defaultMonth: value ?? void 0,
79
+ disabled: !isAllowed,
67
80
  onSelect: (selectedDate) => {
68
81
  if (!selectedDate) return;
69
- setValue(selectedDate);
70
82
  setStringDate(formatDate(selectedDate));
71
- handleUpdate(selectedDate);
83
+ handleChange(selectedDate ?? null);
84
+ handleBlur(selectedDate ?? null);
72
85
  setInValid(false);
73
86
  }
74
87
  })
@@ -1 +1 @@
1
- {"version":3,"file":"date-input.client.mjs","names":["Calendar"],"sources":["../../../../src/modules/inline-edit/components/date-input.client.tsx"],"sourcesContent":["\"use client\";\n\nimport { Button } from \"@/components/ui/button\";\nimport { Calendar } from \"@/components/ui/calendar\";\nimport { Input } from \"@/components/ui/input\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"@/components/ui/popover\";\nimport { cn } from \"@/lib/utils/cn\";\nimport { format } from \"date-fns\";\nimport { CalendarIcon } from \"lucide-react\";\nimport React, { ComponentProps } from \"react\";\nimport { useInlineEdit, type useInlineEditOptions } from \"../hooks/use-inline.client\";\nimport { inlineEditVariants, InlineEditVariantsProps } from \"../lib/variants\";\n\nconst formatDate = (value: Date) => format(value, \"dd/MM/yyyy\");\nconst parseDate = (value: string) => new Date(value.split(\"/\").reverse().join(\"-\"));\n\nexport function InlineDateInput({\n initialValue,\n action,\n permission,\n variant,\n className,\n ...props\n}: ComponentProps<\"div\"> & useInlineEditOptions<Date> & InlineEditVariantsProps) {\n const [inValid, setInValid] = React.useState<boolean>(false);\n\n const { value, setValue, handleUpdate, isAllowed } = useInlineEdit({\n initialValue,\n action,\n permission,\n });\n\n const [stringDate, setStringDate] = React.useState<string>(\n initialValue ? formatDate(initialValue) : \"\",\n );\n\n return (\n <Popover>\n <div {...props} className={cn(\"relative h-full\", inlineEditVariants({ variant }), className)}>\n <Input\n data-input\n type=\"string\"\n value={stringDate}\n className={cn(inValid && \"text-destructive\")}\n disabled={!isAllowed}\n onChange={(e) => {\n setStringDate(e.target.value);\n const parsedDate = parseDate(e.target.value);\n\n if (parsedDate.toString() === \"Invalid Date\") {\n setInValid(true);\n setValue(undefined);\n } else {\n setInValid(false);\n setValue(parsedDate);\n }\n }}\n onBlur={(e) => {\n const parsedDate = parseDate(e.target.value);\n handleUpdate(parsedDate);\n }}\n />\n\n <PopoverTrigger asChild>\n <Button\n variant=\"ghost\"\n tabIndex={-1}\n disabled={!isAllowed}\n className={cn(\n \"absolute bottom-0 right-0 top-0 opacity-50\",\n !value && \"text-muted-foreground\",\n )}\n >\n <CalendarIcon className=\"h-4 w-4\" />\n </Button>\n </PopoverTrigger>\n </div>\n <PopoverContent className=\"w-auto p-0\">\n <Calendar\n mode=\"single\"\n initialFocus\n selected={value}\n defaultMonth={value}\n disabled={status === \"pending\"}\n onSelect={(selectedDate) => {\n if (!selectedDate) return;\n setValue(selectedDate);\n setStringDate(formatDate(selectedDate));\n handleUpdate(selectedDate);\n setInValid(false);\n }}\n />\n </PopoverContent>\n </Popover>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;AAaA,MAAM,cAAc,UAAgB,OAAO,OAAO,aAAa;AAC/D,MAAM,aAAa,UAAkB,IAAI,KAAK,MAAM,MAAM,IAAI,CAAC,SAAS,CAAC,KAAK,IAAI,CAAC;AAEnF,SAAgB,gBAAgB,EAC9B,cACA,QACA,YACA,SACA,WACA,GAAG,SAC4E;CAC/E,MAAM,CAAC,SAAS,cAAc,MAAM,SAAkB,MAAM;CAE5D,MAAM,EAAE,OAAO,UAAU,cAAc,cAAc,cAAc;EACjE;EACA;EACA;EACD,CAAC;CAEF,MAAM,CAAC,YAAY,iBAAiB,MAAM,SACxC,eAAe,WAAW,aAAa,GAAG,GAC3C;AAED,QACE,qBAAC,sBACC,qBAAC;EAAI,GAAI;EAAO,WAAW,GAAG,mBAAmB,mBAAmB,EAAE,SAAS,CAAC,EAAE,UAAU;aAC1F,oBAAC;GACC;GACA,MAAK;GACL,OAAO;GACP,WAAW,GAAG,WAAW,mBAAmB;GAC5C,UAAU,CAAC;GACX,WAAW,MAAM;AACf,kBAAc,EAAE,OAAO,MAAM;IAC7B,MAAM,aAAa,UAAU,EAAE,OAAO,MAAM;AAE5C,QAAI,WAAW,UAAU,KAAK,gBAAgB;AAC5C,gBAAW,KAAK;AAChB,cAAS,OAAU;WACd;AACL,gBAAW,MAAM;AACjB,cAAS,WAAW;;;GAGxB,SAAS,MAAM;AAEb,iBADmB,UAAU,EAAE,OAAO,MAAM,CACpB;;IAE1B,EAEF,oBAAC;GAAe;aACd,oBAAC;IACC,SAAQ;IACR,UAAU;IACV,UAAU,CAAC;IACX,WAAW,GACT,8CACA,CAAC,SAAS,wBACX;cAED,oBAAC,gBAAa,WAAU,YAAY;KAC7B;IACM;GACb,EACN,oBAAC;EAAe,WAAU;YACxB,oBAACA;GACC,MAAK;GACL;GACA,UAAU;GACV,cAAc;GACd,UAAU,WAAW;GACrB,WAAW,iBAAiB;AAC1B,QAAI,CAAC,aAAc;AACnB,aAAS,aAAa;AACtB,kBAAc,WAAW,aAAa,CAAC;AACvC,iBAAa,aAAa;AAC1B,eAAW,MAAM;;IAEnB;GACa,IACT"}
1
+ {"version":3,"file":"date-input.client.mjs","names":["Calendar"],"sources":["../../../../src/modules/inline-edit/components/date-input.client.tsx"],"sourcesContent":["\"use client\";\n\nimport { Button } from \"@/components/ui/button\";\nimport { Calendar } from \"@/components/ui/calendar\";\nimport { Input } from \"@/components/ui/input\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"@/components/ui/popover\";\nimport { cn } from \"@/lib/utils/cn\";\nimport { format } from \"date-fns\";\nimport { CalendarIcon } from \"lucide-react\";\nimport React, { ComponentProps } from \"react\";\nimport { useInlineEdit, type useInlineEditOptions } from \"../hooks/use-inline.client\";\nimport { inlineEditVariants, InlineEditVariantsProps } from \"../lib/variants\";\n\nconst formatDate = (value: Date) => format(value, \"dd/MM/yyyy\");\nconst parseDate = (value: string) => new Date(value.split(\"/\").reverse().join(\"-\"));\nconst isValidDate = (date: Date) => date instanceof Date && date.toString() !== \"Invalid Date\";\n\nexport function InlineDateInput<Required extends boolean = false>({\n initialValue,\n action,\n permission,\n variant,\n className,\n updateStrategy,\n isRequired,\n ...props\n}: ComponentProps<\"div\"> & useInlineEditOptions<Date, Required> & InlineEditVariantsProps) {\n const [inValid, setInValid] = React.useState<boolean>(false);\n\n const { value, setValue, handleChange, handleBlur, status, isAllowed } = useInlineEdit({\n initialValue,\n action,\n permission,\n updateStrategy,\n isRequired,\n });\n\n const [stringDate, setStringDate] = React.useState<string>(\n initialValue ? formatDate(initialValue) : \"\",\n );\n\n /**\n * Update string date when value changes\n */\n React.useEffect(() => {\n if (value) setStringDate(formatDate(value));\n }, [value]);\n\n return (\n <Popover>\n <div {...props} className={cn(\"relative h-full\", className)}>\n <Input\n data-input\n type=\"string\"\n value={stringDate}\n className={cn(inlineEditVariants({ variant, status }), inValid && \"text-destructive\")}\n disabled={!isAllowed}\n onChange={(e) => {\n setStringDate(e.target.value);\n const parsedDate = parseDate(e.target.value);\n\n if (!isValidDate(parsedDate)) {\n setInValid(true);\n setValue(undefined);\n } else {\n setInValid(false);\n setValue(parsedDate);\n }\n }}\n onBlur={(e) => {\n const parsedDate = parseDate(e.target.value);\n handleBlur(isValidDate(parsedDate) ? parsedDate : null);\n }}\n />\n\n <PopoverTrigger asChild>\n <Button\n variant=\"ghost\"\n tabIndex={-1}\n disabled={!isAllowed}\n className={cn(\n \"absolute bottom-0 right-0 top-0 opacity-50\",\n !value && \"text-muted-foreground\",\n )}\n >\n <CalendarIcon className=\"h-4 w-4\" />\n </Button>\n </PopoverTrigger>\n </div>\n\n <PopoverContent className=\"w-auto p-0\">\n <Calendar\n mode=\"single\"\n autoFocus\n selected={value ?? undefined}\n defaultMonth={value ?? undefined}\n disabled={!isAllowed}\n onSelect={(selectedDate) => {\n if (!selectedDate) return;\n\n setStringDate(formatDate(selectedDate));\n\n handleChange(selectedDate ?? null);\n handleBlur(selectedDate ?? null);\n\n setInValid(false);\n }}\n />\n </PopoverContent>\n </Popover>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;AAaA,MAAM,cAAc,UAAgB,OAAO,OAAO,aAAa;AAC/D,MAAM,aAAa,UAAkB,IAAI,KAAK,MAAM,MAAM,IAAI,CAAC,SAAS,CAAC,KAAK,IAAI,CAAC;AACnF,MAAM,eAAe,SAAe,gBAAgB,QAAQ,KAAK,UAAU,KAAK;AAEhF,SAAgB,gBAAkD,EAChE,cACA,QACA,YACA,SACA,WACA,gBACA,YACA,GAAG,SACsF;CACzF,MAAM,CAAC,SAAS,cAAc,MAAM,SAAkB,MAAM;CAE5D,MAAM,EAAE,OAAO,UAAU,cAAc,YAAY,QAAQ,cAAc,cAAc;EACrF;EACA;EACA;EACA;EACA;EACD,CAAC;CAEF,MAAM,CAAC,YAAY,iBAAiB,MAAM,SACxC,eAAe,WAAW,aAAa,GAAG,GAC3C;;;;AAKD,OAAM,gBAAgB;AACpB,MAAI,MAAO,eAAc,WAAW,MAAM,CAAC;IAC1C,CAAC,MAAM,CAAC;AAEX,QACE,qBAAC,sBACC,qBAAC;EAAI,GAAI;EAAO,WAAW,GAAG,mBAAmB,UAAU;aACzD,oBAAC;GACC;GACA,MAAK;GACL,OAAO;GACP,WAAW,GAAG,mBAAmB;IAAE;IAAS;IAAQ,CAAC,EAAE,WAAW,mBAAmB;GACrF,UAAU,CAAC;GACX,WAAW,MAAM;AACf,kBAAc,EAAE,OAAO,MAAM;IAC7B,MAAM,aAAa,UAAU,EAAE,OAAO,MAAM;AAE5C,QAAI,CAAC,YAAY,WAAW,EAAE;AAC5B,gBAAW,KAAK;AAChB,cAAS,OAAU;WACd;AACL,gBAAW,MAAM;AACjB,cAAS,WAAW;;;GAGxB,SAAS,MAAM;IACb,MAAM,aAAa,UAAU,EAAE,OAAO,MAAM;AAC5C,eAAW,YAAY,WAAW,GAAG,aAAa,KAAK;;IAEzD,EAEF,oBAAC;GAAe;aACd,oBAAC;IACC,SAAQ;IACR,UAAU;IACV,UAAU,CAAC;IACX,WAAW,GACT,8CACA,CAAC,SAAS,wBACX;cAED,oBAAC,gBAAa,WAAU,YAAY;KAC7B;IACM;GACb,EAEN,oBAAC;EAAe,WAAU;YACxB,oBAACA;GACC,MAAK;GACL;GACA,UAAU,SAAS;GACnB,cAAc,SAAS;GACvB,UAAU,CAAC;GACX,WAAW,iBAAiB;AAC1B,QAAI,CAAC,aAAc;AAEnB,kBAAc,WAAW,aAAa,CAAC;AAEvC,iBAAa,gBAAgB,KAAK;AAClC,eAAW,gBAAgB,KAAK;AAEhC,eAAW,MAAM;;IAEnB;GACa,IACT"}
@@ -1,20 +1,22 @@
1
1
  import { Button } from "../../../components/ui/button.mjs";
2
2
  import { useInlineEditOptions } from "../hooks/use-inline.client.mjs";
3
3
  import { InlineEditVariantsProps } from "../lib/variants.mjs";
4
- import * as react_jsx_runtime162 from "react/jsx-runtime";
4
+ import * as react_jsx_runtime4 from "react/jsx-runtime";
5
5
  import { ComponentProps } from "react";
6
6
 
7
7
  //#region src/modules/inline-edit/components/date-picker.client.d.ts
8
- type InlineEditDatePickerProps = ComponentProps<typeof Button> & useInlineEditOptions<Date> & InlineEditVariantsProps;
9
- declare function InlineDatePicker({
8
+ type InlineEditDatePickerProps<Required extends boolean> = ComponentProps<typeof Button> & useInlineEditOptions<Date, Required> & InlineEditVariantsProps;
9
+ declare function InlineDatePicker<Required extends boolean = false>({
10
10
  initialValue,
11
11
  action,
12
12
  permission,
13
13
  variant,
14
14
  className,
15
15
  disabled,
16
+ updateStrategy,
17
+ isRequired,
16
18
  ...props
17
- }: InlineEditDatePickerProps): react_jsx_runtime162.JSX.Element;
19
+ }: InlineEditDatePickerProps<Required>): react_jsx_runtime4.JSX.Element;
18
20
  //#endregion
19
21
  export { InlineDatePicker };
20
22
  //# sourceMappingURL=date-picker.client.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"date-picker.client.d.mts","names":[],"sources":["../../../../src/modules/inline-edit/components/date-picker.client.tsx"],"sourcesContent":[],"mappings":";;;;;;;KAYK,yBAAA,GAA4B,sBAAsB,UACrD,qBAAqB,QACrB;iBAEc,gBAAA;;;;;;;;GAQb,4BAAyB,oBAAA,CAAA,GAAA,CAAA"}
1
+ {"version":3,"file":"date-picker.client.d.mts","names":[],"sources":["../../../../src/modules/inline-edit/components/date-picker.client.tsx"],"sourcesContent":[],"mappings":";;;;;;;KAYK,sDAAsD,sBAAsB,UAC/E,qBAAqB,MAAM,YAC3B;iBAEc;;;;;;;;;;GAUb,0BAA0B,YAAS,kBAAA,CAAA,GAAA,CAAA"}
@@ -12,18 +12,20 @@ import { jsx, jsxs } from "react/jsx-runtime";
12
12
  import React from "react";
13
13
 
14
14
  //#region src/modules/inline-edit/components/date-picker.client.tsx
15
- function InlineDatePicker({ initialValue, action, permission, variant, className, disabled, ...props }) {
15
+ function InlineDatePicker({ initialValue, action, permission, variant, className, disabled, updateStrategy, isRequired, ...props }) {
16
16
  const [open, setOpen] = React.useState(false);
17
- const { value, setValue, handleUpdate, isAllowed } = useInlineEdit({
17
+ const { value, handleChange, handleBlur, isAllowed, status } = useInlineEdit({
18
18
  initialValue,
19
19
  action,
20
- permission
20
+ permission,
21
+ updateStrategy,
22
+ isRequired
21
23
  });
22
24
  return /* @__PURE__ */ jsxs(Popover, {
23
25
  open,
24
26
  onOpenChange: (open$1) => {
25
27
  setOpen(open$1);
26
- if (!open$1 && value) handleUpdate(value);
28
+ if (!open$1 && value) handleBlur(value);
27
29
  },
28
30
  children: [/* @__PURE__ */ jsx(PopoverTrigger, {
29
31
  asChild: true,
@@ -31,7 +33,10 @@ function InlineDatePicker({ initialValue, action, permission, variant, className
31
33
  ...props,
32
34
  type: "button",
33
35
  variant: "outline",
34
- className: cn("w-full", inlineEditVariants({ variant }), className),
36
+ className: cn("w-full", inlineEditVariants({
37
+ variant,
38
+ status
39
+ }), className),
35
40
  disabled: disabled || !isAllowed,
36
41
  children: [/* @__PURE__ */ jsx(CalendarIcon, { className: "mr-2 h-4 w-4" }), value ? formatDate(value) : /* @__PURE__ */ jsx("span", { children: "Kies een datum" })]
37
42
  })
@@ -39,9 +44,9 @@ function InlineDatePicker({ initialValue, action, permission, variant, className
39
44
  className: "w-auto p-0",
40
45
  children: /* @__PURE__ */ jsx(Calendar$1, {
41
46
  mode: "single",
47
+ autoFocus: true,
42
48
  selected: value ? new Date(value) : void 0,
43
- onSelect: (date) => date && setValue(date),
44
- initialFocus: true
49
+ onSelect: (date) => handleChange(date ?? null)
45
50
  })
46
51
  })]
47
52
  });
@@ -1 +1 @@
1
- {"version":3,"file":"date-picker.client.mjs","names":["open","Calendar"],"sources":["../../../../src/modules/inline-edit/components/date-picker.client.tsx"],"sourcesContent":["\"use client\";\n\nimport { Button } from \"@/components/ui/button\";\nimport { Calendar } from \"@/components/ui/calendar\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"@/components/ui/popover\";\nimport { cn } from \"@/lib/utils/cn\";\nimport { formatDate } from \"@/lib/utils/format\";\nimport { CalendarIcon } from \"lucide-react\";\nimport React, { ComponentProps } from \"react\";\nimport { useInlineEdit, type useInlineEditOptions } from \"../hooks/use-inline.client\";\nimport { inlineEditVariants, InlineEditVariantsProps } from \"../lib/variants\";\n\ntype InlineEditDatePickerProps = ComponentProps<typeof Button> &\n useInlineEditOptions<Date> &\n InlineEditVariantsProps;\n\nexport function InlineDatePicker({\n initialValue,\n action,\n permission,\n variant,\n className,\n disabled,\n ...props\n}: InlineEditDatePickerProps) {\n const [open, setOpen] = React.useState(false);\n\n const { value, setValue, handleUpdate, isAllowed } = useInlineEdit({\n initialValue,\n action,\n permission,\n });\n\n return (\n <Popover\n open={open}\n onOpenChange={(open) => {\n setOpen(open);\n if (!open && value) handleUpdate(value);\n }}\n >\n <PopoverTrigger asChild>\n <Button\n {...props}\n type=\"button\"\n variant=\"outline\"\n className={cn(\"w-full\", inlineEditVariants({ variant }), className)}\n disabled={disabled || !isAllowed}\n >\n <CalendarIcon className=\"mr-2 h-4 w-4\" />\n {value ? formatDate(value) : <span>Kies een datum</span>}\n </Button>\n </PopoverTrigger>\n\n <PopoverContent className=\"w-auto p-0\">\n <Calendar\n mode=\"single\"\n selected={value ? new Date(value) : undefined}\n onSelect={(date) => date && setValue(date)}\n initialFocus\n />\n </PopoverContent>\n </Popover>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AAgBA,SAAgB,iBAAiB,EAC/B,cACA,QACA,YACA,SACA,WACA,UACA,GAAG,SACyB;CAC5B,MAAM,CAAC,MAAM,WAAW,MAAM,SAAS,MAAM;CAE7C,MAAM,EAAE,OAAO,UAAU,cAAc,cAAc,cAAc;EACjE;EACA;EACA;EACD,CAAC;AAEF,QACE,qBAAC;EACO;EACN,eAAe,WAAS;AACtB,WAAQA,OAAK;AACb,OAAI,CAACA,UAAQ,MAAO,cAAa,MAAM;;aAGzC,oBAAC;GAAe;aACd,qBAAC;IACC,GAAI;IACJ,MAAK;IACL,SAAQ;IACR,WAAW,GAAG,UAAU,mBAAmB,EAAE,SAAS,CAAC,EAAE,UAAU;IACnE,UAAU,YAAY,CAAC;eAEvB,oBAAC,gBAAa,WAAU,iBAAiB,EACxC,QAAQ,WAAW,MAAM,GAAG,oBAAC,oBAAK,mBAAqB;KACjD;IACM,EAEjB,oBAAC;GAAe,WAAU;aACxB,oBAACC;IACC,MAAK;IACL,UAAU,QAAQ,IAAI,KAAK,MAAM,GAAG;IACpC,WAAW,SAAS,QAAQ,SAAS,KAAK;IAC1C;KACA;IACa;GACT"}
1
+ {"version":3,"file":"date-picker.client.mjs","names":["open","Calendar"],"sources":["../../../../src/modules/inline-edit/components/date-picker.client.tsx"],"sourcesContent":["\"use client\";\n\nimport { Button } from \"@/components/ui/button\";\nimport { Calendar } from \"@/components/ui/calendar\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"@/components/ui/popover\";\nimport { cn } from \"@/lib/utils/cn\";\nimport { formatDate } from \"@/lib/utils/format\";\nimport { CalendarIcon } from \"lucide-react\";\nimport React, { ComponentProps } from \"react\";\nimport { useInlineEdit, type useInlineEditOptions } from \"../hooks/use-inline.client\";\nimport { inlineEditVariants, InlineEditVariantsProps } from \"../lib/variants\";\n\ntype InlineEditDatePickerProps<Required extends boolean> = ComponentProps<typeof Button> &\n useInlineEditOptions<Date, Required> &\n InlineEditVariantsProps;\n\nexport function InlineDatePicker<Required extends boolean = false>({\n initialValue,\n action,\n permission,\n variant,\n className,\n disabled,\n updateStrategy,\n isRequired,\n ...props\n}: InlineEditDatePickerProps<Required>) {\n const [open, setOpen] = React.useState(false);\n\n const { value, handleChange, handleBlur, isAllowed, status } = useInlineEdit({\n initialValue,\n action,\n permission,\n updateStrategy,\n isRequired,\n });\n\n return (\n <Popover\n open={open}\n onOpenChange={(open) => {\n setOpen(open);\n if (!open && value) handleBlur(value);\n }}\n >\n <PopoverTrigger asChild>\n <Button\n {...props}\n type=\"button\"\n variant=\"outline\"\n className={cn(\"w-full\", inlineEditVariants({ variant, status }), className)}\n disabled={disabled || !isAllowed}\n >\n <CalendarIcon className=\"mr-2 h-4 w-4\" />\n {value ? formatDate(value) : <span>Kies een datum</span>}\n </Button>\n </PopoverTrigger>\n\n <PopoverContent className=\"w-auto p-0\">\n <Calendar\n mode=\"single\"\n autoFocus\n selected={value ? new Date(value) : undefined}\n onSelect={(date) => handleChange(date ?? null)}\n />\n </PopoverContent>\n </Popover>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AAgBA,SAAgB,iBAAmD,EACjE,cACA,QACA,YACA,SACA,WACA,UACA,gBACA,YACA,GAAG,SACmC;CACtC,MAAM,CAAC,MAAM,WAAW,MAAM,SAAS,MAAM;CAE7C,MAAM,EAAE,OAAO,cAAc,YAAY,WAAW,WAAW,cAAc;EAC3E;EACA;EACA;EACA;EACA;EACD,CAAC;AAEF,QACE,qBAAC;EACO;EACN,eAAe,WAAS;AACtB,WAAQA,OAAK;AACb,OAAI,CAACA,UAAQ,MAAO,YAAW,MAAM;;aAGvC,oBAAC;GAAe;aACd,qBAAC;IACC,GAAI;IACJ,MAAK;IACL,SAAQ;IACR,WAAW,GAAG,UAAU,mBAAmB;KAAE;KAAS;KAAQ,CAAC,EAAE,UAAU;IAC3E,UAAU,YAAY,CAAC;eAEvB,oBAAC,gBAAa,WAAU,iBAAiB,EACxC,QAAQ,WAAW,MAAM,GAAG,oBAAC,oBAAK,mBAAqB;KACjD;IACM,EAEjB,oBAAC;GAAe,WAAU;aACxB,oBAACC;IACC,MAAK;IACL;IACA,UAAU,QAAQ,IAAI,KAAK,MAAM,GAAG;IACpC,WAAW,SAAS,aAAa,QAAQ,KAAK;KAC9C;IACa;GACT"}
@@ -2,20 +2,22 @@ import { EditorJSONContent } from "../../../components/editor/lib/types.mjs";
2
2
  import { EditorProps } from "../../../components/editor/components/editor.client.mjs";
3
3
  import { useInlineEditOptions } from "../hooks/use-inline.client.mjs";
4
4
  import { InlineEditVariantsProps } from "../lib/variants.mjs";
5
- import * as react_jsx_runtime164 from "react/jsx-runtime";
5
+ import * as react_jsx_runtime5 from "react/jsx-runtime";
6
6
 
7
7
  //#region src/modules/inline-edit/components/editor.client.d.ts
8
- type InlineEditorProps = useInlineEditOptions<EditorJSONContent> & InlineEditVariantsProps & Omit<EditorProps, "value" | "onUpdate" | "onBlur" | "variant">;
9
- declare function InlineEditor({
8
+ type InlineEditorProps<Required extends boolean = false> = useInlineEditOptions<EditorJSONContent, Required> & InlineEditVariantsProps & Omit<EditorProps, "value" | "onUpdate" | "onBlur" | "variant">;
9
+ declare function InlineEditor<Required extends boolean = false>({
10
10
  initialValue,
11
11
  action,
12
12
  extensions,
13
13
  variant,
14
14
  disabled,
15
15
  permission,
16
+ updateStrategy,
17
+ isRequired,
16
18
  className,
17
19
  children
18
- }: InlineEditorProps): react_jsx_runtime164.JSX.Element;
20
+ }: InlineEditorProps<Required>): react_jsx_runtime5.JSX.Element;
19
21
  //#endregion
20
22
  export { InlineEditor, InlineEditorProps };
21
23
  //# sourceMappingURL=editor.client.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"editor.client.d.mts","names":[],"sources":["../../../../src/modules/inline-edit/components/editor.client.tsx"],"sourcesContent":[],"mappings":";;;;;;;KAQY,iBAAA,GAAoB,qBAAqB,qBACnD,0BACA,KAAK;iBAES,YAAA;;;;;;;;;GASb,oBAAiB,oBAAA,CAAA,GAAA,CAAA"}
1
+ {"version":3,"file":"editor.client.d.mts","names":[],"sources":["../../../../src/modules/inline-edit/components/editor.client.tsx"],"sourcesContent":[],"mappings":";;;;;;;KAQY,sDAAsD,qBAChE,mBACA,YAEA,0BACA,KAAK;iBAES;;;;;;;;;;;GAWb,kBAAkB,YAAS,kBAAA,CAAA,GAAA,CAAA"}
@@ -7,18 +7,23 @@ import { inlineEditVariants } from "../lib/variants.mjs";
7
7
  import { jsx } from "react/jsx-runtime";
8
8
 
9
9
  //#region src/modules/inline-edit/components/editor.client.tsx
10
- function InlineEditor({ initialValue, action, extensions, variant, disabled, permission, className, children }) {
11
- const { value, setValue, handleUpdate, isAllowed } = useInlineEdit({
10
+ function InlineEditor({ initialValue, action, extensions, variant, disabled, permission, updateStrategy, isRequired, className, children }) {
11
+ const { value, handleChange, handleBlur, isAllowed, status } = useInlineEdit({
12
12
  initialValue,
13
13
  action,
14
- permission
14
+ permission,
15
+ updateStrategy,
16
+ isRequired
15
17
  });
16
18
  return /* @__PURE__ */ jsx(Editor, {
17
19
  value,
18
20
  extensions,
19
- onUpdate: (value$1) => setValue(value$1),
20
- onBlur: (value$1) => handleUpdate(value$1),
21
- className: cn(inlineEditVariants({ variant }), className),
21
+ onUpdate: (value$1) => handleChange(value$1),
22
+ onBlur: (value$1) => handleBlur(value$1),
23
+ className: cn(inlineEditVariants({
24
+ variant,
25
+ status
26
+ }), className),
22
27
  disabled: disabled || !isAllowed,
23
28
  variant,
24
29
  children
@@ -1 +1 @@
1
- {"version":3,"file":"editor.client.mjs","names":["value"],"sources":["../../../../src/modules/inline-edit/components/editor.client.tsx"],"sourcesContent":["\"use client\";\n\nimport { Editor, EditorProps } from \"@/components/editor/components/editor.client\";\nimport { EditorJSONContent } from \"@/components/editor/lib/types\";\nimport { cn } from \"@/lib/utils/cn\";\nimport { useInlineEdit, type useInlineEditOptions } from \"../hooks/use-inline.client\";\nimport { inlineEditVariants, InlineEditVariantsProps } from \"../lib/variants\";\n\nexport type InlineEditorProps = useInlineEditOptions<EditorJSONContent> &\n InlineEditVariantsProps &\n Omit<EditorProps, \"value\" | \"onUpdate\" | \"onBlur\" | \"variant\">;\n\nexport function InlineEditor({\n initialValue,\n action,\n extensions,\n variant,\n disabled,\n permission,\n className,\n children,\n}: InlineEditorProps) {\n const { value, setValue, handleUpdate, isAllowed } = useInlineEdit<EditorJSONContent>({\n initialValue,\n action,\n permission,\n });\n\n // const [debouncedValue] = useDebounce(value, 500);\n // useEffect(() => {\n // if (!value) return;\n // handleUpdate(value);\n // // eslint-disable-next-line react-hooks/exhaustive-deps\n // }, [debouncedValue]);\n\n return (\n <Editor\n value={value}\n extensions={extensions}\n onUpdate={(value) => setValue(value)}\n onBlur={(value) => handleUpdate(value)}\n className={cn(inlineEditVariants({ variant }), className)}\n disabled={disabled || !isAllowed}\n variant={variant}\n >\n {children}\n </Editor>\n );\n}\n"],"mappings":";;;;;;;;;AAYA,SAAgB,aAAa,EAC3B,cACA,QACA,YACA,SACA,UACA,YACA,WACA,YACoB;CACpB,MAAM,EAAE,OAAO,UAAU,cAAc,cAAc,cAAiC;EACpF;EACA;EACA;EACD,CAAC;AASF,QACE,oBAAC;EACQ;EACK;EACZ,WAAW,YAAU,SAASA,QAAM;EACpC,SAAS,YAAU,aAAaA,QAAM;EACtC,WAAW,GAAG,mBAAmB,EAAE,SAAS,CAAC,EAAE,UAAU;EACzD,UAAU,YAAY,CAAC;EACd;EAER;GACM"}
1
+ {"version":3,"file":"editor.client.mjs","names":["value"],"sources":["../../../../src/modules/inline-edit/components/editor.client.tsx"],"sourcesContent":["\"use client\";\n\nimport { Editor, EditorProps } from \"@/components/editor/components/editor.client\";\nimport { EditorJSONContent } from \"@/components/editor/lib/types\";\nimport { cn } from \"@/lib/utils/cn\";\nimport { useInlineEdit, type useInlineEditOptions } from \"../hooks/use-inline.client\";\nimport { inlineEditVariants, InlineEditVariantsProps } from \"../lib/variants\";\n\nexport type InlineEditorProps<Required extends boolean = false> = useInlineEditOptions<\n EditorJSONContent,\n Required\n> &\n InlineEditVariantsProps &\n Omit<EditorProps, \"value\" | \"onUpdate\" | \"onBlur\" | \"variant\">;\n\nexport function InlineEditor<Required extends boolean = false>({\n initialValue,\n action,\n extensions,\n variant,\n disabled,\n permission,\n updateStrategy,\n isRequired,\n className,\n children,\n}: InlineEditorProps<Required>) {\n const { value, handleChange, handleBlur, isAllowed, status } = useInlineEdit({\n initialValue,\n action,\n permission,\n updateStrategy,\n isRequired,\n });\n\n return (\n <Editor\n value={value}\n extensions={extensions}\n onUpdate={(value) => handleChange(value)}\n onBlur={(value) => handleBlur(value)}\n className={cn(inlineEditVariants({ variant, status }), className)}\n disabled={disabled || !isAllowed}\n variant={variant}\n >\n {children}\n </Editor>\n );\n}\n"],"mappings":";;;;;;;;;AAeA,SAAgB,aAA+C,EAC7D,cACA,QACA,YACA,SACA,UACA,YACA,gBACA,YACA,WACA,YAC8B;CAC9B,MAAM,EAAE,OAAO,cAAc,YAAY,WAAW,WAAW,cAAc;EAC3E;EACA;EACA;EACA;EACA;EACD,CAAC;AAEF,QACE,oBAAC;EACQ;EACK;EACZ,WAAW,YAAU,aAAaA,QAAM;EACxC,SAAS,YAAU,WAAWA,QAAM;EACpC,WAAW,GAAG,mBAAmB;GAAE;GAAS;GAAQ,CAAC,EAAE,UAAU;EACjE,UAAU,YAAY,CAAC;EACd;EAER;GACM"}
@@ -1,26 +1,28 @@
1
1
  import { useInlineEditOptions } from "../hooks/use-inline.client.mjs";
2
2
  import { InlineEditVariantsProps } from "../lib/variants.mjs";
3
3
  import { Contact, RecipientInput } from "../../../components/ui/input-recipient.mjs";
4
- import * as react_jsx_runtime169 from "react/jsx-runtime";
4
+ import * as react_jsx_runtime6 from "react/jsx-runtime";
5
5
  import { ComponentProps } from "react";
6
6
 
7
7
  //#region src/modules/inline-edit/components/input-recipient.client.d.ts
8
- type InlineRecipientInputProps = Omit<ComponentProps<typeof RecipientInput>, "value" | "onChange"> & useInlineEditOptions<string[]> & InlineEditVariantsProps & {
8
+ type InlineRecipientInputProps<Required extends boolean = false> = Omit<ComponentProps<typeof RecipientInput>, "value" | "onChange"> & useInlineEditOptions<string[], Required> & InlineEditVariantsProps & {
9
9
  contacts: Contact[];
10
10
  };
11
11
  /**
12
12
  * The inline edit recipient input component.
13
13
  */
14
- declare function InlineRecipientInput({
14
+ declare function InlineRecipientInput<Required extends boolean = false>({
15
15
  initialValue,
16
16
  action,
17
17
  variant,
18
18
  disabled,
19
19
  contacts,
20
20
  permission,
21
+ updateStrategy,
22
+ isRequired,
21
23
  className,
22
24
  ...props
23
- }: InlineRecipientInputProps): react_jsx_runtime169.JSX.Element;
25
+ }: InlineRecipientInputProps<Required>): react_jsx_runtime6.JSX.Element;
24
26
  //#endregion
25
27
  export { InlineRecipientInput };
26
28
  //# sourceMappingURL=input-recipient.client.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"input-recipient.client.d.mts","names":[],"sources":["../../../../src/modules/inline-edit/components/input-recipient.client.tsx"],"sourcesContent":[],"mappings":";;;;;;;KAQK,yBAAA,GAA4B,KAAK,sBAAsB,yCAC1D,iCACA;YACY;;AALgE;;;AAE7C,iBASjB,oBAAA,CATiB;EAAA,YAAA;EAAA,MAAA;EAAA,OAAA;EAAA,QAAA;EAAA,QAAA;EAAA,UAAA;EAAA,SAAA;EAAA,GAAA;AAAA,CAAA,EAkB9B,yBAlB8B,CAAA,EAkBL,oBAAA,CAAA,GAAA,CAAA,OAlBK"}
1
+ {"version":3,"file":"input-recipient.client.d.mts","names":[],"sources":["../../../../src/modules/inline-edit/components/input-recipient.client.tsx"],"sourcesContent":[],"mappings":";;;;;;;KAQK,8DAA8D,KACjE,sBAAsB,yCAGtB,+BAA+B,YAC/B;YACY;;AARgE;;;AAEX,iBAYnD,oBAZmD,CAAA,iBAAA,OAAA,GAAA,KAAA,CAAA,CAAA;EAAA,YAAA;EAAA,MAAA;EAAA,OAAA;EAAA,QAAA;EAAA,QAAA;EAAA,UAAA;EAAA,cAAA;EAAA,UAAA;EAAA,SAAA;EAAA,GAAA;AAAA,CAAA,EAuBhE,yBAvBgE,CAuBtC,QAvBsC,CAAA,CAAA,EAuB7B,kBAAA,CAAA,GAAA,CAAA,OAvB6B"}
@@ -10,22 +10,27 @@ import { jsx } from "react/jsx-runtime";
10
10
  /**
11
11
  * The inline edit recipient input component.
12
12
  */
13
- function InlineRecipientInput({ initialValue, action, variant, disabled, contacts, permission, className, ...props }) {
14
- const { value, setValue, handleUpdate, isAllowed } = useInlineEdit({
13
+ function InlineRecipientInput({ initialValue, action, variant, disabled, contacts, permission, updateStrategy, isRequired, className, ...props }) {
14
+ const { value, handleChange, handleBlur, isAllowed, status } = useInlineEdit({
15
15
  initialValue,
16
16
  action,
17
- permission
17
+ permission,
18
+ updateStrategy,
19
+ isRequired
18
20
  });
19
21
  return /* @__PURE__ */ jsx(RecipientInput, {
20
22
  ...props,
21
23
  contacts,
22
24
  value: value ?? [],
23
25
  onChange: (newValue) => {
24
- setValue(newValue);
25
- handleUpdate(newValue);
26
+ handleChange(newValue);
27
+ handleBlur(newValue);
26
28
  },
27
29
  disabled: disabled || !isAllowed,
28
- className: cn(inlineEditVariants({ variant }), className)
30
+ className: cn(inlineEditVariants({
31
+ variant,
32
+ status
33
+ }), className)
29
34
  });
30
35
  }
31
36
 
@@ -1 +1 @@
1
- {"version":3,"file":"input-recipient.client.mjs","names":[],"sources":["../../../../src/modules/inline-edit/components/input-recipient.client.tsx"],"sourcesContent":["\"use client\";\n\nimport { Contact, RecipientInput } from \"@/components/ui/input-recipient\";\nimport { cn } from \"@/lib/utils/cn\";\nimport { ComponentProps } from \"react\";\nimport { useInlineEdit, type useInlineEditOptions } from \"../hooks/use-inline.client\";\nimport { inlineEditVariants, InlineEditVariantsProps } from \"../lib/variants\";\n\ntype InlineRecipientInputProps = Omit<ComponentProps<typeof RecipientInput>, \"value\" | \"onChange\"> &\n useInlineEditOptions<string[]> &\n InlineEditVariantsProps & {\n contacts: Contact[];\n };\n\n/**\n * The inline edit recipient input component.\n */\nexport function InlineRecipientInput({\n initialValue,\n action,\n variant,\n disabled,\n contacts,\n permission,\n className,\n ...props\n}: InlineRecipientInputProps) {\n const { value, setValue, handleUpdate, isAllowed } = useInlineEdit<string[]>({\n initialValue,\n action,\n permission,\n });\n\n return (\n <RecipientInput\n {...props}\n contacts={contacts}\n value={value ?? []}\n onChange={(newValue) => {\n setValue(newValue);\n handleUpdate(newValue);\n }}\n disabled={disabled || !isAllowed}\n className={cn(inlineEditVariants({ variant }), className)}\n />\n );\n}\n"],"mappings":";;;;;;;;;;;;AAiBA,SAAgB,qBAAqB,EACnC,cACA,QACA,SACA,UACA,UACA,YACA,WACA,GAAG,SACyB;CAC5B,MAAM,EAAE,OAAO,UAAU,cAAc,cAAc,cAAwB;EAC3E;EACA;EACA;EACD,CAAC;AAEF,QACE,oBAAC;EACC,GAAI;EACM;EACV,OAAO,SAAS,EAAE;EAClB,WAAW,aAAa;AACtB,YAAS,SAAS;AAClB,gBAAa,SAAS;;EAExB,UAAU,YAAY,CAAC;EACvB,WAAW,GAAG,mBAAmB,EAAE,SAAS,CAAC,EAAE,UAAU;GACzD"}
1
+ {"version":3,"file":"input-recipient.client.mjs","names":[],"sources":["../../../../src/modules/inline-edit/components/input-recipient.client.tsx"],"sourcesContent":["\"use client\";\n\nimport { Contact, RecipientInput } from \"@/components/ui/input-recipient\";\nimport { cn } from \"@/lib/utils/cn\";\nimport { ComponentProps } from \"react\";\nimport { useInlineEdit, type useInlineEditOptions } from \"../hooks/use-inline.client\";\nimport { inlineEditVariants, InlineEditVariantsProps } from \"../lib/variants\";\n\ntype InlineRecipientInputProps<Required extends boolean = false> = Omit<\n ComponentProps<typeof RecipientInput>,\n \"value\" | \"onChange\"\n> &\n useInlineEditOptions<string[], Required> &\n InlineEditVariantsProps & {\n contacts: Contact[];\n };\n\n/**\n * The inline edit recipient input component.\n */\nexport function InlineRecipientInput<Required extends boolean = false>({\n initialValue,\n action,\n variant,\n disabled,\n contacts,\n permission,\n updateStrategy,\n isRequired,\n className,\n ...props\n}: InlineRecipientInputProps<Required>) {\n const { value, handleChange, handleBlur, isAllowed, status } = useInlineEdit({\n initialValue,\n action,\n permission,\n updateStrategy,\n isRequired,\n });\n\n return (\n <RecipientInput\n {...props}\n contacts={contacts}\n value={value ?? []}\n onChange={(newValue) => {\n handleChange(newValue);\n handleBlur(newValue);\n }}\n disabled={disabled || !isAllowed}\n className={cn(inlineEditVariants({ variant, status }), className)}\n />\n );\n}\n"],"mappings":";;;;;;;;;;;;AAoBA,SAAgB,qBAAuD,EACrE,cACA,QACA,SACA,UACA,UACA,YACA,gBACA,YACA,WACA,GAAG,SACmC;CACtC,MAAM,EAAE,OAAO,cAAc,YAAY,WAAW,WAAW,cAAc;EAC3E;EACA;EACA;EACA;EACA;EACD,CAAC;AAEF,QACE,oBAAC;EACC,GAAI;EACM;EACV,OAAO,SAAS,EAAE;EAClB,WAAW,aAAa;AACtB,gBAAa,SAAS;AACtB,cAAW,SAAS;;EAEtB,UAAU,YAAY,CAAC;EACvB,WAAW,GAAG,mBAAmB;GAAE;GAAS;GAAQ,CAAC,EAAE,UAAU;GACjE"}
@@ -1,18 +1,20 @@
1
1
  import { Input } from "../../../components/ui/input.mjs";
2
2
  import { useInlineEditOptions } from "../hooks/use-inline.client.mjs";
3
- import * as react_jsx_runtime170 from "react/jsx-runtime";
3
+ import * as react_jsx_runtime8 from "react/jsx-runtime";
4
4
  import { ComponentProps } from "react";
5
5
 
6
6
  //#region src/modules/inline-edit/components/input-toggle.client.d.ts
7
- type InlineStringInputToggleProps<TValue> = Omit<ComponentProps<typeof Input>, "type"> & useInlineEditOptions<TValue>;
8
- declare function InlineStringInputToggle({
7
+ type InlineStringInputToggleProps<Required extends boolean = false> = Omit<ComponentProps<typeof Input>, "type"> & useInlineEditOptions<string, Required>;
8
+ declare function InlineStringInputToggle<Required extends boolean>({
9
9
  initialValue,
10
10
  action,
11
11
  disabled,
12
12
  permission,
13
+ updateStrategy,
14
+ isRequired,
13
15
  className,
14
16
  ...props
15
- }: InlineStringInputToggleProps<string>): react_jsx_runtime170.JSX.Element;
17
+ }: InlineStringInputToggleProps<Required>): react_jsx_runtime8.JSX.Element;
16
18
  //#endregion
17
19
  export { InlineStringInputToggle };
18
20
  //# sourceMappingURL=input-toggle.client.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"input-toggle.client.d.mts","names":[],"sources":["../../../../src/modules/inline-edit/components/input-toggle.client.tsx"],"sourcesContent":[],"mappings":";;;;;;KASK,uCAAuC,KAAK,sBAAsB,kBACrE,qBAAqB;iBAEP,uBAAA;;;;;;;GAOb,uCAAoC,oBAAA,CAAA,GAAA,CAAA"}
1
+ {"version":3,"file":"input-toggle.client.d.mts","names":[],"sources":["../../../../src/modules/inline-edit/components/input-toggle.client.tsx"],"sourcesContent":[],"mappings":";;;;;;KASK,iEAAiE,KACpE,sBAAsB,kBAGtB,6BAA6B;iBAEf;;;;;;;;;GASb,6BAA6B,YAAS,kBAAA,CAAA,GAAA,CAAA"}
@@ -9,17 +9,19 @@ import { jsx, jsxs } from "react/jsx-runtime";
9
9
  import { useState } from "react";
10
10
 
11
11
  //#region src/modules/inline-edit/components/input-toggle.client.tsx
12
- function InlineStringInputToggle({ initialValue, action, disabled, permission, className, ...props }) {
12
+ function InlineStringInputToggle({ initialValue, action, disabled, permission, updateStrategy, isRequired, className, ...props }) {
13
13
  const [enabled, setEnabled] = useState(!!initialValue);
14
- const { value, setValue, handleUpdate, isAllowed } = useInlineEdit({
14
+ const { value, handleChange, handleBlur, isAllowed } = useInlineEdit({
15
15
  initialValue,
16
16
  action,
17
- permission
17
+ permission,
18
+ updateStrategy,
19
+ isRequired
18
20
  });
19
21
  function handleToggle() {
20
22
  setEnabled(!enabled);
21
23
  if (!enabled) return;
22
- handleUpdate("");
24
+ handleBlur(null);
23
25
  }
24
26
  const isDisabled = !enabled || disabled || !isAllowed;
25
27
  return /* @__PURE__ */ jsxs("div", {
@@ -27,10 +29,10 @@ function InlineStringInputToggle({ initialValue, action, disabled, permission, c
27
29
  children: [/* @__PURE__ */ jsx(Input, {
28
30
  ...props,
29
31
  type: "text",
30
- value,
32
+ value: value ?? void 0,
31
33
  disabled: isDisabled,
32
- onChange: (e) => setValue(e.target.value),
33
- onBlur: (e) => handleUpdate(e.target.value),
34
+ onChange: (e) => handleChange(e.target.value ? e.target.value : null),
35
+ onBlur: (e) => handleBlur(e.target.value ? e.target.value : null),
34
36
  className: cn("border-border/70 hover:border-border w-full", className)
35
37
  }), /* @__PURE__ */ jsx(Button, {
36
38
  variant: "ghost",
@@ -1 +1 @@
1
- {"version":3,"file":"input-toggle.client.mjs","names":[],"sources":["../../../../src/modules/inline-edit/components/input-toggle.client.tsx"],"sourcesContent":["\"use client\";\n\nimport { Button } from \"@/components/ui/button\";\nimport { Input } from \"@/components/ui/input\";\nimport { cn } from \"@/lib/entry\";\nimport { CheckIcon, XIcon } from \"lucide-react\";\nimport { ComponentProps, useState } from \"react\";\nimport { useInlineEdit, useInlineEditOptions } from \"../hooks/use-inline.client\";\n\ntype InlineStringInputToggleProps<TValue> = Omit<ComponentProps<typeof Input>, \"type\"> &\n useInlineEditOptions<TValue>;\n\nexport function InlineStringInputToggle({\n initialValue,\n action,\n disabled,\n permission,\n className,\n ...props\n}: InlineStringInputToggleProps<string>) {\n const [enabled, setEnabled] = useState(!!initialValue);\n\n const { value, setValue, handleUpdate, isAllowed } = useInlineEdit({\n initialValue,\n action,\n permission,\n });\n\n function handleToggle() {\n setEnabled(!enabled);\n if (!enabled) return;\n\n handleUpdate(\"\");\n }\n\n const isDisabled = !enabled || disabled || !isAllowed;\n\n return (\n <div className=\"relative\">\n <Input\n {...props}\n type=\"text\"\n value={value}\n disabled={isDisabled}\n onChange={(e) => setValue(e.target.value)}\n onBlur={(e) => handleUpdate(e.target.value)}\n className={cn(\"border-border/70 hover:border-border w-full\", className)}\n />\n\n <Button\n variant=\"ghost\"\n onClick={handleToggle}\n tabIndex={-1}\n className={cn(\n \"absolute bottom-0 right-0 top-0 opacity-50\",\n !value && \"text-muted-foreground\",\n )}\n >\n {enabled ? <CheckIcon /> : <XIcon />}\n </Button>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;AAYA,SAAgB,wBAAwB,EACtC,cACA,QACA,UACA,YACA,WACA,GAAG,SACoC;CACvC,MAAM,CAAC,SAAS,cAAc,SAAS,CAAC,CAAC,aAAa;CAEtD,MAAM,EAAE,OAAO,UAAU,cAAc,cAAc,cAAc;EACjE;EACA;EACA;EACD,CAAC;CAEF,SAAS,eAAe;AACtB,aAAW,CAAC,QAAQ;AACpB,MAAI,CAAC,QAAS;AAEd,eAAa,GAAG;;CAGlB,MAAM,aAAa,CAAC,WAAW,YAAY,CAAC;AAE5C,QACE,qBAAC;EAAI,WAAU;aACb,oBAAC;GACC,GAAI;GACJ,MAAK;GACE;GACP,UAAU;GACV,WAAW,MAAM,SAAS,EAAE,OAAO,MAAM;GACzC,SAAS,MAAM,aAAa,EAAE,OAAO,MAAM;GAC3C,WAAW,GAAG,+CAA+C,UAAU;IACvE,EAEF,oBAAC;GACC,SAAQ;GACR,SAAS;GACT,UAAU;GACV,WAAW,GACT,8CACA,CAAC,SAAS,wBACX;aAEA,UAAU,oBAAC,cAAY,GAAG,oBAAC,UAAQ;IAC7B;GACL"}
1
+ {"version":3,"file":"input-toggle.client.mjs","names":[],"sources":["../../../../src/modules/inline-edit/components/input-toggle.client.tsx"],"sourcesContent":["\"use client\";\n\nimport { Button } from \"@/components/ui/button\";\nimport { Input } from \"@/components/ui/input\";\nimport { cn } from \"@/lib/entry\";\nimport { CheckIcon, XIcon } from \"lucide-react\";\nimport { ComponentProps, useState } from \"react\";\nimport { useInlineEdit, useInlineEditOptions } from \"../hooks/use-inline.client\";\n\ntype InlineStringInputToggleProps<Required extends boolean = false> = Omit<\n ComponentProps<typeof Input>,\n \"type\"\n> &\n useInlineEditOptions<string, Required>;\n\nexport function InlineStringInputToggle<Required extends boolean>({\n initialValue,\n action,\n disabled,\n permission,\n updateStrategy,\n isRequired,\n className,\n ...props\n}: InlineStringInputToggleProps<Required>) {\n const [enabled, setEnabled] = useState(!!initialValue);\n\n const { value, handleChange, handleBlur, isAllowed } = useInlineEdit({\n initialValue,\n action,\n permission,\n updateStrategy,\n isRequired,\n });\n\n function handleToggle() {\n setEnabled(!enabled);\n if (!enabled) return;\n\n handleBlur(null);\n }\n\n const isDisabled = !enabled || disabled || !isAllowed;\n\n return (\n <div className=\"relative\">\n <Input\n {...props}\n type=\"text\"\n value={value ?? undefined}\n disabled={isDisabled}\n onChange={(e) => handleChange(e.target.value ? e.target.value : null)}\n onBlur={(e) => handleBlur(e.target.value ? e.target.value : null)}\n className={cn(\"border-border/70 hover:border-border w-full\", className)}\n />\n\n <Button\n variant=\"ghost\"\n onClick={handleToggle}\n tabIndex={-1}\n className={cn(\n \"absolute bottom-0 right-0 top-0 opacity-50\",\n !value && \"text-muted-foreground\",\n )}\n >\n {enabled ? <CheckIcon /> : <XIcon />}\n </Button>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;AAeA,SAAgB,wBAAkD,EAChE,cACA,QACA,UACA,YACA,gBACA,YACA,WACA,GAAG,SACsC;CACzC,MAAM,CAAC,SAAS,cAAc,SAAS,CAAC,CAAC,aAAa;CAEtD,MAAM,EAAE,OAAO,cAAc,YAAY,cAAc,cAAc;EACnE;EACA;EACA;EACA;EACA;EACD,CAAC;CAEF,SAAS,eAAe;AACtB,aAAW,CAAC,QAAQ;AACpB,MAAI,CAAC,QAAS;AAEd,aAAW,KAAK;;CAGlB,MAAM,aAAa,CAAC,WAAW,YAAY,CAAC;AAE5C,QACE,qBAAC;EAAI,WAAU;aACb,oBAAC;GACC,GAAI;GACJ,MAAK;GACL,OAAO,SAAS;GAChB,UAAU;GACV,WAAW,MAAM,aAAa,EAAE,OAAO,QAAQ,EAAE,OAAO,QAAQ,KAAK;GACrE,SAAS,MAAM,WAAW,EAAE,OAAO,QAAQ,EAAE,OAAO,QAAQ,KAAK;GACjE,WAAW,GAAG,+CAA+C,UAAU;IACvE,EAEF,oBAAC;GACC,SAAQ;GACR,SAAS;GACT,UAAU;GACV,WAAW,GACT,8CACA,CAAC,SAAS,wBACX;aAEA,UAAU,oBAAC,cAAY,GAAG,oBAAC,UAAQ;IAC7B;GACL"}