@tulip-systems/core 0.5.1 → 0.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/common/icons.d.mts +52 -52
- package/dist/components/common/icons.d.mts.map +1 -1
- package/dist/components/common/status.d.mts +3 -3
- package/dist/components/common/status.d.mts.map +1 -1
- package/dist/components/editor/components/content.client.d.mts +2 -2
- package/dist/components/editor/components/editor.client.d.mts +4 -4
- package/dist/components/editor/components/editor.client.mjs +2 -2
- package/dist/components/editor/components/editor.client.mjs.map +1 -1
- package/dist/components/editor/components/menu.client.d.mts +3 -3
- package/dist/components/editor/components/menu.client.mjs +3 -0
- package/dist/components/editor/components/menu.client.mjs.map +1 -1
- package/dist/components/editor/extensions/file-handler/extension.d.mts +21 -0
- package/dist/components/editor/extensions/file-handler/extension.d.mts.map +1 -0
- package/dist/components/editor/extensions/file-handler/extension.mjs +40 -0
- package/dist/components/editor/extensions/file-handler/extension.mjs.map +1 -0
- package/dist/components/editor/extensions/file-handler/strategy.d.mts +29 -0
- package/dist/components/editor/extensions/file-handler/strategy.d.mts.map +1 -0
- package/dist/components/editor/extensions/file-handler/strategy.mjs +111 -0
- package/dist/components/editor/extensions/file-handler/strategy.mjs.map +1 -0
- package/dist/components/editor/extensions/file-handler/utils.mjs +50 -0
- package/dist/components/editor/extensions/file-handler/utils.mjs.map +1 -0
- package/dist/components/editor/extensions/image/extension.d.mts +8 -0
- package/dist/components/editor/extensions/image/extension.d.mts.map +1 -0
- package/dist/components/editor/extensions/image/extension.mjs +52 -0
- package/dist/components/editor/extensions/image/extension.mjs.map +1 -0
- package/dist/components/editor/extensions/skeleton/extension.mjs +41 -0
- package/dist/components/editor/extensions/skeleton/extension.mjs.map +1 -0
- package/dist/components/editor/extensions/skeleton/renderer.mjs +25 -0
- package/dist/components/editor/extensions/skeleton/renderer.mjs.map +1 -0
- package/dist/components/editor/lib/constants.d.mts +29 -26
- package/dist/components/editor/lib/constants.d.mts.map +1 -1
- package/dist/components/editor/lib/constants.mjs +14 -2
- package/dist/components/editor/lib/constants.mjs.map +1 -1
- package/dist/components/editor/lib/extensions.d.mts +5 -1
- package/dist/components/editor/lib/extensions.d.mts.map +1 -1
- package/dist/components/editor/lib/extensions.mjs.map +1 -1
- package/dist/components/editor/lib/variants.mjs +10 -2
- package/dist/components/editor/lib/variants.mjs.map +1 -1
- package/dist/components/header/back-button.client.d.mts +2 -2
- package/dist/components/header/bottom-bar.client.d.mts +3 -3
- package/dist/components/header/breadcrumbs.client.d.mts +7 -7
- package/dist/components/header/header.client.d.mts +2 -2
- package/dist/components/header/mobile-nav-switcher.client.d.mts +2 -2
- package/dist/components/header/top-bar.client.d.mts +4 -4
- package/dist/components/layouts/admin-content.client.d.mts +2 -2
- package/dist/components/layouts/admin-layout.d.mts +2 -2
- package/dist/components/layouts/admin-loading.d.mts +2 -2
- package/dist/components/layouts/admin-loading.d.mts.map +1 -1
- package/dist/components/layouts/empty-page.d.mts +4 -4
- package/dist/components/layouts/empty-page.d.mts.map +1 -1
- package/dist/components/layouts/list-layout.d.mts +2 -2
- package/dist/components/layouts/list-layout.d.mts.map +1 -1
- package/dist/components/layouts/not-found-page.d.mts +3 -3
- package/dist/components/layouts/not-found-page.d.mts.map +1 -1
- package/dist/components/layouts/providers.client.d.mts +2 -2
- package/dist/components/layouts/root-layout.server.d.mts +2 -2
- package/dist/components/layouts/root-layout.server.d.mts.map +1 -1
- package/dist/components/layouts/root-loading.d.mts +2 -2
- package/dist/components/layouts/root-loading.d.mts.map +1 -1
- package/dist/components/layouts/tab-layout.d.mts +2 -2
- package/dist/components/layouts/tab-layout.d.mts.map +1 -1
- package/dist/components/lists/data-list.d.mts +5 -5
- package/dist/components/lists/data-list.d.mts.map +1 -1
- package/dist/components/lists/data-stack.d.mts +8 -8
- package/dist/components/navigation/admin-sidebar-paths.client.d.mts +10 -10
- package/dist/components/ui/accordion.d.mts +5 -5
- package/dist/components/ui/alert-dialog.d.mts +12 -12
- package/dist/components/ui/alert.d.mts +6 -6
- package/dist/components/ui/aspect-ratio.d.mts +2 -2
- package/dist/components/ui/avatar.client.d.mts +4 -4
- package/dist/components/ui/badge.d.mts +4 -4
- package/dist/components/ui/breadcrumb.d.mts +8 -8
- package/dist/components/ui/breadcrumb.d.mts.map +1 -1
- package/dist/components/ui/button.d.mts +5 -5
- package/dist/components/ui/button.d.mts.map +1 -1
- package/dist/components/ui/calendar.d.mts +3 -3
- package/dist/components/ui/calendar.d.mts.map +1 -1
- package/dist/components/ui/card.d.mts +7 -7
- package/dist/components/ui/card.d.mts.map +1 -1
- package/dist/components/ui/carousel.d.mts +6 -6
- package/dist/components/ui/carousel.d.mts.map +1 -1
- package/dist/components/ui/chart.client.d.mts +5 -5
- package/dist/components/ui/checkbox.d.mts +2 -2
- package/dist/components/ui/checkbox.d.mts.map +1 -1
- package/dist/components/ui/collapsible.client.d.mts +4 -4
- package/dist/components/ui/color-picker.client.d.mts +2 -2
- package/dist/components/ui/combobox-dropdown.client.d.mts +2 -2
- package/dist/components/ui/combobox.client.d.mts +2 -2
- package/dist/components/ui/command.d.mts +10 -10
- package/dist/components/ui/command.d.mts.map +1 -1
- package/dist/components/ui/context-menu.d.mts +16 -16
- package/dist/components/ui/date-picker.client.d.mts +2 -2
- package/dist/components/ui/dialog.client.d.mts +11 -11
- package/dist/components/ui/drawer.client.d.mts +11 -11
- package/dist/components/ui/dropdown-menu.d.mts +16 -16
- package/dist/components/ui/form.client.d.mts +7 -7
- package/dist/components/ui/hover-card.client.d.mts +4 -4
- package/dist/components/ui/input-recipient.d.mts +2 -2
- package/dist/components/ui/input.d.mts +2 -2
- package/dist/components/ui/label.d.mts +2 -2
- package/dist/components/ui/navigation-menu.d.mts +11 -11
- package/dist/components/ui/pagination.d.mts +8 -8
- package/dist/components/ui/popover.d.mts +5 -5
- package/dist/components/ui/popover.d.mts.map +1 -1
- package/dist/components/ui/progress.client.d.mts +2 -2
- package/dist/components/ui/radio-group.d.mts +3 -3
- package/dist/components/ui/resizable.client.d.mts +4 -4
- package/dist/components/ui/scroll-area.d.mts +3 -3
- package/dist/components/ui/select.client.d.mts +11 -11
- package/dist/components/ui/separator.d.mts +2 -2
- package/dist/components/ui/sheet.client.d.mts +9 -9
- package/dist/components/ui/sidebar.client.d.mts +24 -24
- package/dist/components/ui/skeleton.d.mts +2 -2
- package/dist/components/ui/slider.d.mts +2 -2
- package/dist/components/ui/sonner.client.d.mts +2 -2
- package/dist/components/ui/switch.d.mts +2 -2
- package/dist/components/ui/tabs.d.mts +5 -5
- package/dist/components/ui/textarea.d.mts +2 -2
- package/dist/components/ui/time-input.client.d.mts +2 -2
- package/dist/components/ui/toggle-group.client.d.mts +3 -3
- package/dist/components/ui/toggle.d.mts +2 -2
- package/dist/components/ui/tooltip.client.d.mts +5 -5
- package/dist/components.d.mts +2 -1
- package/dist/components.mjs +3 -2
- package/dist/data-tables.d.mts +2 -2
- package/dist/data-tables.mjs +2 -2
- package/dist/inline-edit/client.d.mts +2 -3
- package/dist/inline-edit/client.mjs +1 -2
- package/dist/lib/client.d.mts +2 -2
- package/dist/lib/client.mjs +2 -2
- package/dist/lib/hooks/use-action.d.mts +2 -2
- package/dist/lib/hooks/use-indicator.d.mts +11 -3
- package/dist/lib/hooks/use-indicator.d.mts.map +1 -1
- package/dist/lib/hooks/use-indicator.mjs +19 -8
- package/dist/lib/hooks/use-indicator.mjs.map +1 -1
- package/dist/modules/auth/components/allowed.client.d.mts +2 -2
- package/dist/modules/auth/components/allowed.client.d.mts.map +1 -1
- package/dist/modules/auth/components/auth-layout.server.d.mts +2 -2
- package/dist/modules/auth/components/auth-layout.server.d.mts.map +1 -1
- package/dist/modules/auth/components/auth-loading.d.mts +2 -2
- package/dist/modules/auth/components/create-first-user-page.client.d.mts +2 -2
- package/dist/modules/auth/components/create-first-user-page.client.d.mts.map +1 -1
- package/dist/modules/auth/components/forget-password-page.client.d.mts +2 -2
- package/dist/modules/auth/components/forget-password-page.client.d.mts.map +1 -1
- package/dist/modules/auth/components/guard-first-user.server.d.mts +2 -2
- package/dist/modules/auth/components/guard-first-user.server.d.mts.map +1 -1
- package/dist/modules/auth/components/guard.server.d.mts +2 -2
- package/dist/modules/auth/components/guard.server.d.mts.map +1 -1
- package/dist/modules/auth/components/login-page.client.d.mts +2 -2
- package/dist/modules/auth/components/login-page.client.d.mts.map +1 -1
- package/dist/modules/auth/components/reset-password-page.client.d.mts +2 -2
- package/dist/modules/auth/components/reset-password-page.client.d.mts.map +1 -1
- package/dist/modules/auth/components/update-password-command.d.mts +2 -2
- package/dist/modules/auth/components/update-password-command.d.mts.map +1 -1
- package/dist/modules/auth/db/schema.d.mts +73 -73
- package/dist/modules/auth/db/schema.d.mts.map +1 -1
- package/dist/modules/auth/handler/client.client.d.mts +8 -8
- package/dist/modules/auth/hooks/use-permission.d.mts +2 -2
- package/dist/modules/auth/hooks/use-session.d.mts +4 -4
- package/dist/modules/auth/lib/validators.d.mts +2 -2
- package/dist/modules/auth/lib/validators.d.mts.map +1 -1
- package/dist/modules/commands/components/alert-dialog-command.client.d.mts +10 -10
- package/dist/modules/commands/components/alert-dialog-command.client.d.mts.map +1 -1
- package/dist/modules/commands/components/click-command.client.d.mts +2 -2
- package/dist/modules/commands/components/click-command.client.d.mts.map +1 -1
- package/dist/modules/commands/components/command-trigger.client.d.mts +6 -6
- package/dist/modules/commands/components/command-trigger.client.d.mts.map +1 -1
- package/dist/modules/commands/components/dialog-command.client.d.mts +8 -8
- package/dist/modules/commands/components/dialog-command.client.d.mts.map +1 -1
- package/dist/modules/commands/components/dropdown-command.client.d.mts +5 -5
- package/dist/modules/commands/components/dropdown-command.client.d.mts.map +1 -1
- package/dist/modules/commands/components/empty-command.client.d.mts +2 -2
- package/dist/modules/commands/components/empty-command.client.d.mts.map +1 -1
- package/dist/modules/commands/components/form-dialog-command.client.d.mts +11 -11
- package/dist/modules/commands/components/form-dialog-command.client.d.mts.map +1 -1
- package/dist/modules/commands/hooks/use-command-mutation.client.d.mts +2 -2
- package/dist/modules/commands/menus/context-menu.client.d.mts +2 -2
- package/dist/modules/commands/menus/context-menu.client.d.mts.map +1 -1
- package/dist/modules/commands/menus/dropdown-menu.client.d.mts +3 -3
- package/dist/modules/commands/menus/dropdown-menu.client.d.mts.map +1 -1
- package/dist/modules/commands/menus/inline-menu.client.d.mts +3 -3
- package/dist/modules/commands/menus/inline-menu.client.d.mts.map +1 -1
- package/dist/modules/commands/menus/responsive-menu.client.d.mts +3 -3
- package/dist/modules/commands/menus/responsive-menu.client.d.mts.map +1 -1
- package/dist/modules/commands/utils/archive-command.client.d.mts +3 -3
- package/dist/modules/commands/utils/archive-command.client.d.mts.map +1 -1
- package/dist/modules/commands/utils/delete-command.client.d.mts +3 -3
- package/dist/modules/commands/utils/delete-command.client.d.mts.map +1 -1
- package/dist/modules/config/db/helpers.d.mts +5 -5
- package/dist/modules/config/db/helpers.d.mts.map +1 -1
- package/dist/modules/data-tables/components/cell/common.client.d.mts +5 -5
- package/dist/modules/data-tables/components/cell/common.client.d.mts.map +1 -1
- package/dist/modules/data-tables/components/column-header.d.mts +2 -2
- package/dist/modules/data-tables/components/filters/combobox.client.d.mts +2 -2
- package/dist/modules/data-tables/components/filters/combobox.client.d.mts.map +1 -1
- package/dist/modules/data-tables/components/filters/slider.client.d.mts +2 -2
- package/dist/modules/data-tables/components/filters/slider.client.d.mts.map +1 -1
- package/dist/modules/data-tables/components/header.d.mts +4 -4
- package/dist/modules/data-tables/components/layout.d.mts +2 -2
- package/dist/modules/data-tables/components/search-input.client.d.mts +2 -2
- package/dist/modules/data-tables/components/search-input.client.d.mts.map +1 -1
- package/dist/modules/data-tables/components/skeleton.d.mts +2 -2
- package/dist/modules/data-tables/components/table.d.mts +7 -7
- package/dist/modules/data-tables/components/toolbar.d.mts +3 -3
- package/dist/modules/data-tables/hooks/use-context.client.d.mts +2 -2
- package/dist/modules/data-tables/hooks/use-context.client.d.mts.map +1 -1
- package/dist/modules/data-tables/lib/filters/parsers.d.mts +6 -1
- package/dist/modules/data-tables/lib/filters/parsers.d.mts.map +1 -1
- package/dist/modules/data-tables/lib/filters/parsers.mjs +6 -1
- package/dist/modules/data-tables/lib/filters/parsers.mjs.map +1 -1
- package/dist/modules/data-tables/tables/data-table/components/table.d.mts +2 -2
- package/dist/modules/data-tables/tables/data-table/components/table.d.mts.map +1 -1
- package/dist/modules/data-tables/tables/inline-table/components/cells/common.d.mts +2 -2
- package/dist/modules/data-tables/tables/inline-table/components/cells/common.d.mts.map +1 -1
- package/dist/modules/data-tables/tables/inline-table/components/cells/drag-handle.client.d.mts +2 -2
- package/dist/modules/data-tables/tables/inline-table/components/cells/drag-handle.client.d.mts.map +1 -1
- package/dist/modules/data-tables/tables/inline-table/components/inputs/advanced-select.client.d.mts +2 -2
- package/dist/modules/data-tables/tables/inline-table/components/inputs/advanced-select.client.d.mts.map +1 -1
- package/dist/modules/data-tables/tables/inline-table/components/inputs/combobox.client.d.mts +2 -2
- package/dist/modules/data-tables/tables/inline-table/components/inputs/combobox.client.d.mts.map +1 -1
- package/dist/modules/data-tables/tables/inline-table/components/inputs/input.client.d.mts +3 -3
- package/dist/modules/data-tables/tables/inline-table/components/inputs/input.client.d.mts.map +1 -1
- package/dist/modules/data-tables/tables/inline-table/components/inputs/read-only.d.mts +2 -2
- package/dist/modules/data-tables/tables/inline-table/components/inputs/read-only.d.mts.map +1 -1
- package/dist/modules/data-tables/tables/inline-table/components/inputs/select.client.d.mts +2 -2
- package/dist/modules/data-tables/tables/inline-table/components/inputs/select.client.d.mts.map +1 -1
- package/dist/modules/data-tables/tables/inline-table/components/table.d.mts +2 -2
- package/dist/modules/data-tables/tables/inline-table/components/table.d.mts.map +1 -1
- package/dist/modules/data-tables/tables/inline-table/hooks/context.client.d.mts +2 -2
- package/dist/modules/data-tables/tables/inline-table/hooks/context.client.d.mts.map +1 -1
- package/dist/modules/inline-edit/components/combobox-dropdown.client.d.mts +6 -4
- package/dist/modules/inline-edit/components/combobox-dropdown.client.d.mts.map +1 -1
- package/dist/modules/inline-edit/components/combobox-dropdown.client.mjs +11 -6
- package/dist/modules/inline-edit/components/combobox-dropdown.client.mjs.map +1 -1
- package/dist/modules/inline-edit/components/combobox.client.d.mts +6 -4
- package/dist/modules/inline-edit/components/combobox.client.d.mts.map +1 -1
- package/dist/modules/inline-edit/components/combobox.client.mjs +7 -5
- package/dist/modules/inline-edit/components/combobox.client.mjs.map +1 -1
- package/dist/modules/inline-edit/components/date-input.client.d.mts +5 -3
- package/dist/modules/inline-edit/components/date-input.client.d.mts.map +1 -1
- package/dist/modules/inline-edit/components/date-input.client.mjs +26 -13
- package/dist/modules/inline-edit/components/date-input.client.mjs.map +1 -1
- package/dist/modules/inline-edit/components/date-picker.client.d.mts +6 -4
- package/dist/modules/inline-edit/components/date-picker.client.d.mts.map +1 -1
- package/dist/modules/inline-edit/components/date-picker.client.mjs +12 -7
- package/dist/modules/inline-edit/components/date-picker.client.mjs.map +1 -1
- package/dist/modules/inline-edit/components/editor.client.d.mts +6 -4
- package/dist/modules/inline-edit/components/editor.client.d.mts.map +1 -1
- package/dist/modules/inline-edit/components/editor.client.mjs +11 -6
- package/dist/modules/inline-edit/components/editor.client.mjs.map +1 -1
- package/dist/modules/inline-edit/components/input-recipient.client.d.mts +6 -4
- package/dist/modules/inline-edit/components/input-recipient.client.d.mts.map +1 -1
- package/dist/modules/inline-edit/components/input-recipient.client.mjs +11 -6
- package/dist/modules/inline-edit/components/input-recipient.client.mjs.map +1 -1
- package/dist/modules/inline-edit/components/input-toggle.client.d.mts +6 -4
- package/dist/modules/inline-edit/components/input-toggle.client.d.mts.map +1 -1
- package/dist/modules/inline-edit/components/input-toggle.client.mjs +9 -7
- package/dist/modules/inline-edit/components/input-toggle.client.mjs.map +1 -1
- package/dist/modules/inline-edit/components/input.client.d.mts +13 -10
- package/dist/modules/inline-edit/components/input.client.d.mts.map +1 -1
- package/dist/modules/inline-edit/components/input.client.mjs +35 -19
- package/dist/modules/inline-edit/components/input.client.mjs.map +1 -1
- package/dist/modules/inline-edit/components/select.client.d.mts +10 -9
- package/dist/modules/inline-edit/components/select.client.d.mts.map +1 -1
- package/dist/modules/inline-edit/components/select.client.mjs +14 -7
- package/dist/modules/inline-edit/components/select.client.mjs.map +1 -1
- package/dist/modules/inline-edit/components/switch.client.d.mts +5 -3
- package/dist/modules/inline-edit/components/switch.client.d.mts.map +1 -1
- package/dist/modules/inline-edit/components/switch.client.mjs +8 -6
- package/dist/modules/inline-edit/components/switch.client.mjs.map +1 -1
- package/dist/modules/inline-edit/components/toggle.client.d.mts +6 -4
- package/dist/modules/inline-edit/components/toggle.client.d.mts.map +1 -1
- package/dist/modules/inline-edit/components/toggle.client.mjs +9 -7
- package/dist/modules/inline-edit/components/toggle.client.mjs.map +1 -1
- package/dist/modules/inline-edit/hooks/use-inline.client.d.mts +35 -3
- package/dist/modules/inline-edit/hooks/use-inline.client.d.mts.map +1 -1
- package/dist/modules/inline-edit/hooks/use-inline.client.mjs +71 -9
- package/dist/modules/inline-edit/hooks/use-inline.client.mjs.map +1 -1
- package/dist/modules/inline-edit/lib/variants.d.mts +1 -0
- package/dist/modules/inline-edit/lib/variants.d.mts.map +1 -1
- package/dist/modules/inline-edit/lib/variants.mjs +12 -4
- package/dist/modules/inline-edit/lib/variants.mjs.map +1 -1
- package/dist/modules/router/handler/init.server.d.mts +6 -6
- package/dist/modules/router/handler/init.server.d.mts.map +1 -1
- package/dist/modules/router/lib/query-client.server.d.mts +2 -2
- package/dist/modules/storage/components/dropzone-context.client.d.mts +2 -2
- package/dist/modules/storage/components/dropzone-context.client.d.mts.map +1 -1
- package/dist/modules/storage/components/dropzone.client.d.mts +5 -5
- package/dist/modules/storage/components/dropzone.client.d.mts.map +1 -1
- package/dist/modules/storage/components/dropzone.client.mjs +1 -1
- package/dist/modules/storage/components/image-grid.client.d.mts +3 -3
- package/dist/modules/storage/components/image-grid.client.d.mts.map +1 -1
- package/dist/modules/storage/components/image-grid.client.mjs +3 -3
- package/dist/modules/storage/components/image-grid.client.mjs.map +1 -1
- package/dist/modules/storage/components/upload-zone-context.client.d.mts +3 -11
- package/dist/modules/storage/components/upload-zone-context.client.d.mts.map +1 -1
- package/dist/modules/storage/components/upload-zone-context.client.mjs.map +1 -1
- package/dist/modules/storage/components/upload-zone.client.d.mts +10 -31
- package/dist/modules/storage/components/upload-zone.client.d.mts.map +1 -1
- package/dist/modules/storage/components/upload-zone.client.mjs +19 -91
- package/dist/modules/storage/components/upload-zone.client.mjs.map +1 -1
- package/dist/modules/storage/config/filters.d.mts +2 -0
- package/dist/modules/storage/config/filters.d.mts.map +1 -1
- package/dist/modules/storage/config/filters.mjs +3 -1
- package/dist/modules/storage/config/filters.mjs.map +1 -1
- package/dist/modules/storage/lib/create-upload.client.d.mts +56 -0
- package/dist/modules/storage/lib/create-upload.client.d.mts.map +1 -0
- package/dist/modules/storage/lib/create-upload.client.mjs +98 -0
- package/dist/modules/storage/lib/create-upload.client.mjs.map +1 -0
- package/dist/modules/storage/lib/helpers.d.mts +2 -2
- package/dist/modules/storage/lib/helpers.d.mts.map +1 -1
- package/dist/modules/storage/lib/helpers.mjs +1 -0
- package/dist/modules/storage/lib/helpers.mjs.map +1 -1
- package/dist/modules/storage/lib/router.server.d.mts +4181 -2283
- package/dist/modules/storage/lib/router.server.d.mts.map +1 -1
- package/dist/modules/storage/lib/router.server.mjs +5 -2
- package/dist/modules/storage/lib/router.server.mjs.map +1 -1
- package/dist/modules/storage/lib/schema.d.mts +156 -88
- package/dist/modules/storage/lib/schema.d.mts.map +1 -1
- package/dist/modules/storage/lib/schema.mjs +3 -1
- package/dist/modules/storage/lib/schema.mjs.map +1 -1
- package/dist/modules/storage/lib/service.server.d.mts +54 -38
- package/dist/modules/storage/lib/service.server.d.mts.map +1 -1
- package/dist/modules/storage/lib/service.server.mjs +11 -5
- package/dist/modules/storage/lib/service.server.mjs.map +1 -1
- package/dist/modules/storage/lib/validators.d.mts +232 -71
- package/dist/modules/storage/lib/validators.d.mts.map +1 -1
- package/dist/modules/storage/lib/validators.mjs +16 -25
- package/dist/modules/storage/lib/validators.mjs.map +1 -1
- package/dist/storage/client.d.mts +2 -1
- package/dist/storage/client.mjs +2 -8
- package/dist/storage.d.mts +3 -3
- package/dist/storage.mjs +3 -3
- package/package.json +2 -1
- package/src/components/editor/components/editor.client.tsx +7 -2
- package/src/components/editor/components/menu.client.tsx +26 -0
- package/src/components/editor/extensions/file-handler/extension.ts +69 -0
- package/src/components/editor/extensions/file-handler/strategy.ts +167 -0
- package/src/components/editor/extensions/file-handler/utils.ts +51 -0
- package/src/components/editor/extensions/image/extension.ts +57 -0
- package/src/components/editor/extensions/skeleton/extension.ts +35 -0
- package/src/components/editor/extensions/skeleton/renderer.tsx +14 -0
- package/src/components/editor/lib/constants.ts +16 -2
- package/src/components/editor/lib/extensions.ts +4 -1
- package/src/components/editor/lib/utils.ts +32 -0
- package/src/components/editor/lib/variants.ts +72 -1
- package/src/components/entry.ts +2 -1
- package/src/lib/hooks/use-indicator.tsx +27 -18
- package/src/modules/data-tables/lib/filters/parsers.ts +14 -0
- package/src/modules/inline-edit/components/combobox-dropdown.client.tsx +21 -12
- package/src/modules/inline-edit/components/combobox.client.tsx +13 -6
- package/src/modules/inline-edit/components/date-input.client.tsx +29 -13
- package/src/modules/inline-edit/components/date-picker.client.tsx +13 -9
- package/src/modules/inline-edit/components/editor.client.tsx +14 -14
- package/src/modules/inline-edit/components/input-recipient.client.tsx +15 -8
- package/src/modules/inline-edit/components/input-toggle.client.tsx +16 -9
- package/src/modules/inline-edit/components/input.client.tsx +38 -24
- package/src/modules/inline-edit/components/select.client.tsx +16 -9
- package/src/modules/inline-edit/components/switch.client.tsx +10 -6
- package/src/modules/inline-edit/components/toggle.client.tsx +13 -9
- package/src/modules/inline-edit/entry.client.ts +0 -1
- package/src/modules/inline-edit/hooks/use-inline.client copy.tsx +97 -0
- package/src/modules/inline-edit/hooks/use-inline.client.tsx +139 -20
- package/src/modules/inline-edit/lib/variants.ts +7 -0
- package/src/modules/storage/components/image-grid.client.tsx +2 -2
- package/src/modules/storage/components/upload-zone-context.client.tsx +3 -4
- package/src/modules/storage/components/upload-zone.client.tsx +17 -113
- package/src/modules/storage/config/filters.ts +2 -0
- package/src/modules/storage/entry.client.ts +2 -1
- package/src/modules/storage/lib/create-upload.client.ts +134 -0
- package/src/modules/storage/lib/helpers.ts +3 -2
- package/src/modules/storage/lib/router.server.ts +1 -0
- package/src/modules/storage/lib/schema.ts +2 -0
- package/src/modules/storage/lib/service.server.ts +18 -4
- package/src/modules/storage/lib/validators.ts +21 -31
- package/dist/modules/inline-edit/components/deprecated-editor.client.d.mts +0 -21
- package/dist/modules/inline-edit/components/deprecated-editor.client.d.mts.map +0 -1
- package/dist/modules/inline-edit/components/deprecated-editor.client.mjs +0 -37
- package/dist/modules/inline-edit/components/deprecated-editor.client.mjs.map +0 -1
- package/dist/storage/client.mjs.map +0 -1
- package/src/modules/inline-edit/components/deprecated-editor.client.tsx +0 -48
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
SelectTrigger,
|
|
8
8
|
SelectValue,
|
|
9
9
|
} from "@/components/ui/select.client";
|
|
10
|
+
import { useIndicator } from "@/lib/entry.client";
|
|
10
11
|
import { cn } from "@/lib/utils/cn";
|
|
11
12
|
import type {
|
|
12
13
|
SelectContentProps,
|
|
@@ -18,29 +19,31 @@ import type {
|
|
|
18
19
|
import { useInlineEdit, type useInlineEditOptions } from "../hooks/use-inline.client";
|
|
19
20
|
import { inlineEditVariants, InlineEditVariantsProps } from "../lib/variants";
|
|
20
21
|
|
|
21
|
-
export
|
|
22
|
-
|
|
23
|
-
export function InlineSelect({
|
|
22
|
+
export function InlineSelect<Required extends boolean = false>({
|
|
24
23
|
initialValue,
|
|
25
24
|
action,
|
|
26
25
|
permission,
|
|
26
|
+
updateStrategy,
|
|
27
|
+
isRequired,
|
|
27
28
|
disabled,
|
|
28
29
|
...props
|
|
29
|
-
}:
|
|
30
|
-
const { value,
|
|
30
|
+
}: SelectProps & useInlineEditOptions<string, Required>) {
|
|
31
|
+
const { value, handleChange, handleBlur, isAllowed } = useInlineEdit({
|
|
31
32
|
initialValue,
|
|
32
33
|
action,
|
|
33
34
|
permission,
|
|
35
|
+
updateStrategy,
|
|
36
|
+
isRequired,
|
|
34
37
|
});
|
|
35
38
|
|
|
36
39
|
return (
|
|
37
40
|
<Select
|
|
38
41
|
{...props}
|
|
39
42
|
disabled={disabled || !isAllowed}
|
|
40
|
-
defaultValue={value}
|
|
43
|
+
defaultValue={value ?? undefined}
|
|
41
44
|
onValueChange={(value) => {
|
|
42
|
-
|
|
43
|
-
|
|
45
|
+
handleChange(value ? value : null);
|
|
46
|
+
handleBlur(value ? value : null);
|
|
44
47
|
}}
|
|
45
48
|
/>
|
|
46
49
|
);
|
|
@@ -53,7 +56,11 @@ export function InlineSelectTrigger({
|
|
|
53
56
|
className,
|
|
54
57
|
...props
|
|
55
58
|
}: InlineSelectTriggerProps & InlineEditVariantsProps) {
|
|
56
|
-
|
|
59
|
+
const { status } = useIndicator();
|
|
60
|
+
|
|
61
|
+
return (
|
|
62
|
+
<SelectTrigger {...props} className={cn(inlineEditVariants({ variant, status }), className)} />
|
|
63
|
+
);
|
|
57
64
|
}
|
|
58
65
|
|
|
59
66
|
export type InlineSelectContentProps = SelectContentProps;
|
|
@@ -4,27 +4,31 @@ import { Switch } from "@/components/ui/switch";
|
|
|
4
4
|
import { type SwitchProps } from "@radix-ui/react-switch";
|
|
5
5
|
import { useInlineEdit, type useInlineEditOptions } from "../hooks/use-inline.client";
|
|
6
6
|
|
|
7
|
-
export function InlineSwitch({
|
|
7
|
+
export function InlineSwitch<Required extends boolean = false>({
|
|
8
8
|
initialValue,
|
|
9
9
|
action,
|
|
10
10
|
permission,
|
|
11
|
+
updateStrategy,
|
|
12
|
+
isRequired,
|
|
11
13
|
disabled,
|
|
12
14
|
...props
|
|
13
|
-
}: SwitchProps & useInlineEditOptions<boolean>) {
|
|
14
|
-
const { value,
|
|
15
|
+
}: SwitchProps & useInlineEditOptions<boolean, Required>) {
|
|
16
|
+
const { value, handleChange, handleBlur, isAllowed } = useInlineEdit({
|
|
15
17
|
initialValue,
|
|
16
18
|
action,
|
|
17
19
|
permission,
|
|
20
|
+
updateStrategy,
|
|
21
|
+
isRequired,
|
|
18
22
|
});
|
|
19
23
|
|
|
20
24
|
return (
|
|
21
25
|
<Switch
|
|
22
26
|
{...props}
|
|
23
27
|
disabled={disabled || !isAllowed}
|
|
24
|
-
defaultChecked={value}
|
|
28
|
+
defaultChecked={value ?? undefined}
|
|
25
29
|
onCheckedChange={(checked) => {
|
|
26
|
-
|
|
27
|
-
|
|
30
|
+
handleChange(checked ?? null);
|
|
31
|
+
handleBlur(checked ?? null);
|
|
28
32
|
}}
|
|
29
33
|
/>
|
|
30
34
|
);
|
|
@@ -5,21 +5,25 @@ import { cn } from "@/lib/utils/cn";
|
|
|
5
5
|
import type React from "react";
|
|
6
6
|
import { useInlineEdit, type useInlineEditOptions } from "../hooks/use-inline.client";
|
|
7
7
|
|
|
8
|
-
export type InlineEditToggleProps =
|
|
9
|
-
useInlineEditOptions<boolean>;
|
|
8
|
+
export type InlineEditToggleProps<Required extends boolean = false> =
|
|
9
|
+
React.HTMLAttributes<HTMLDivElement> & useInlineEditOptions<boolean, Required>;
|
|
10
10
|
|
|
11
|
-
export function InlineToggle({
|
|
11
|
+
export function InlineToggle<Required extends boolean = false>({
|
|
12
12
|
initialValue,
|
|
13
13
|
action,
|
|
14
14
|
children,
|
|
15
15
|
permission,
|
|
16
|
+
updateStrategy,
|
|
17
|
+
isRequired,
|
|
16
18
|
className,
|
|
17
19
|
...props
|
|
18
|
-
}: InlineEditToggleProps) {
|
|
19
|
-
const { value,
|
|
20
|
+
}: InlineEditToggleProps<Required>) {
|
|
21
|
+
const { value, handleChange, handleBlur, isAllowed } = useInlineEdit({
|
|
20
22
|
initialValue,
|
|
21
23
|
action,
|
|
22
24
|
permission,
|
|
25
|
+
updateStrategy,
|
|
26
|
+
isRequired,
|
|
23
27
|
});
|
|
24
28
|
|
|
25
29
|
return (
|
|
@@ -27,11 +31,11 @@ export function InlineToggle({
|
|
|
27
31
|
<Toggle
|
|
28
32
|
disabled={!isAllowed}
|
|
29
33
|
variant="outline"
|
|
30
|
-
pressed={value}
|
|
31
|
-
defaultChecked={initialValue}
|
|
34
|
+
pressed={value ?? undefined}
|
|
35
|
+
defaultChecked={initialValue ?? undefined}
|
|
32
36
|
onPressedChange={(value) => {
|
|
33
|
-
|
|
34
|
-
|
|
37
|
+
handleChange(value);
|
|
38
|
+
handleBlur(value);
|
|
35
39
|
}}
|
|
36
40
|
>
|
|
37
41
|
{children}
|
|
@@ -2,7 +2,6 @@ export * from "./components/combobox-dropdown.client";
|
|
|
2
2
|
export * from "./components/combobox.client";
|
|
3
3
|
export * from "./components/date-input.client";
|
|
4
4
|
export * from "./components/date-picker.client";
|
|
5
|
-
export * from "./components/deprecated-editor.client";
|
|
6
5
|
export * from "./components/editor.client";
|
|
7
6
|
export * from "./components/input-recipient.client";
|
|
8
7
|
export * from "./components/input-toggle.client";
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { EditorJSONContent } from "@/components/entry";
|
|
4
|
+
import { useAction } from "@/lib/hooks/use-action";
|
|
5
|
+
import { usePermission } from "@/modules/auth/hooks/use-permission";
|
|
6
|
+
import { Permission } from "@/modules/auth/lib/permissions";
|
|
7
|
+
import { useState } from "react";
|
|
8
|
+
import { toast } from "sonner";
|
|
9
|
+
import { useInlineEditContext } from "./context.client";
|
|
10
|
+
|
|
11
|
+
type UpdateStrategy = {
|
|
12
|
+
trigger: "change" | "blur";
|
|
13
|
+
delay?: number;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const defaultUpdateStrategy: UpdateStrategy = {
|
|
17
|
+
trigger: "blur",
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export type useInlineEditOptions<TValue> = {
|
|
21
|
+
initialValue?: TValue;
|
|
22
|
+
action: (value: { id: string; value: TValue }) => Promise<unknown>;
|
|
23
|
+
permission?: Permission;
|
|
24
|
+
/**
|
|
25
|
+
* Update strategy
|
|
26
|
+
* - trigger: when to update the value (default: "blur")
|
|
27
|
+
* - delay: delay in milliseconds before updating the value (only for "change" trigger)
|
|
28
|
+
* @default { trigger: "blur" }
|
|
29
|
+
*/
|
|
30
|
+
updateStrategy?: UpdateStrategy;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export function useInlineEdit<
|
|
34
|
+
TValue extends string | number | Date | boolean | JSON | EditorJSONContent | undefined,
|
|
35
|
+
>(props: useInlineEditOptions<TValue>) {
|
|
36
|
+
const strategy = props.updateStrategy ?? defaultUpdateStrategy;
|
|
37
|
+
/**
|
|
38
|
+
* The inline edit context.
|
|
39
|
+
*/
|
|
40
|
+
const context = useInlineEditContext();
|
|
41
|
+
|
|
42
|
+
const { data } = usePermission(props.permission ?? context.permission);
|
|
43
|
+
const isAllowed = data?.success;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* The current value of the inline edit.
|
|
47
|
+
*/
|
|
48
|
+
const [value, setValue] = useState(props.initialValue);
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Execute the action to update the value.
|
|
52
|
+
*/
|
|
53
|
+
const { mutate, status } = useAction({
|
|
54
|
+
mutationFn: props.action,
|
|
55
|
+
onError: (error) => {
|
|
56
|
+
setValue(props.initialValue);
|
|
57
|
+
toast.error("Er is iets misgegaan", {
|
|
58
|
+
description: error instanceof Error ? error.message : undefined,
|
|
59
|
+
});
|
|
60
|
+
},
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Handle the update of the value.
|
|
65
|
+
*/
|
|
66
|
+
const handleUpdate = (value: TValue) => {
|
|
67
|
+
if (!isAllowed) {
|
|
68
|
+
toast.error("Je hebt geen toestemming om dit te bewerken");
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// If the value is the same as the initial value, do nothing
|
|
73
|
+
if (value === props.initialValue) return;
|
|
74
|
+
|
|
75
|
+
return mutate({ id: context.id, value });
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Handle change updates
|
|
80
|
+
*/
|
|
81
|
+
function handleChange(value: TValue) {
|
|
82
|
+
setValue(value);
|
|
83
|
+
|
|
84
|
+
// if the strategy is change, update the value after the delay
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Handle blur updates
|
|
89
|
+
*/
|
|
90
|
+
function handleBlur(value: TValue) {
|
|
91
|
+
setValue(value);
|
|
92
|
+
|
|
93
|
+
// if the strategy is blur, update the value
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
return { value, setValue, handleUpdate, status, isAllowed };
|
|
97
|
+
}
|
|
@@ -1,40 +1,105 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import { EditorJSONContent } from "@/components/entry";
|
|
4
|
+
import { useLocalIndicator } from "@/lib/entry.client";
|
|
4
5
|
import { useAction } from "@/lib/hooks/use-action";
|
|
5
6
|
import { usePermission } from "@/modules/auth/hooks/use-permission";
|
|
6
7
|
import { Permission } from "@/modules/auth/lib/permissions";
|
|
7
|
-
import { useState } from "react";
|
|
8
|
+
import { useCallback, useState } from "react";
|
|
8
9
|
import { toast } from "sonner";
|
|
10
|
+
import { useDebouncedCallback } from "use-debounce";
|
|
9
11
|
import { useInlineEditContext } from "./context.client";
|
|
10
12
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
type UpdateStrategy =
|
|
14
|
+
| {
|
|
15
|
+
mode: "change";
|
|
16
|
+
delay?: number;
|
|
17
|
+
}
|
|
18
|
+
| {
|
|
19
|
+
mode: "blur";
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const defaultUpdateStrategy: UpdateStrategy = {
|
|
23
|
+
mode: "blur",
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
type MaybeValue<TValue, Required extends boolean> = Required extends true ? TValue : TValue | null;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Use the inline edit hook options.
|
|
30
|
+
*/
|
|
31
|
+
export type useInlineEditOptions<TValue, Required extends boolean = false> = {
|
|
32
|
+
/**
|
|
33
|
+
* Initial value
|
|
34
|
+
*/
|
|
35
|
+
initialValue?: MaybeValue<TValue, Required>;
|
|
36
|
+
/**
|
|
37
|
+
* Action to execute on update
|
|
38
|
+
*/
|
|
39
|
+
action: (value: { id: string; value: MaybeValue<TValue, Required> }) => Promise<unknown>;
|
|
40
|
+
/**
|
|
41
|
+
* Permission required to edit
|
|
42
|
+
*/
|
|
14
43
|
permission?: Permission;
|
|
44
|
+
/**
|
|
45
|
+
* Update strategy
|
|
46
|
+
* - trigger: when to update the value (default: "blur")
|
|
47
|
+
* - delay: delay in milliseconds before updating the value (only for "change" trigger)
|
|
48
|
+
* @default { trigger: "blur" }
|
|
49
|
+
*/
|
|
50
|
+
updateStrategy?: UpdateStrategy;
|
|
51
|
+
/**
|
|
52
|
+
* Is the value required
|
|
53
|
+
* @default false
|
|
54
|
+
*/
|
|
55
|
+
isRequired?: Required;
|
|
15
56
|
};
|
|
16
57
|
|
|
58
|
+
/**
|
|
59
|
+
* Use the inline edit hook.
|
|
60
|
+
*/
|
|
17
61
|
export function useInlineEdit<
|
|
18
|
-
TValue extends string | number | Date | boolean | JSON | EditorJSONContent
|
|
19
|
-
|
|
62
|
+
TValue extends string | number | Date | boolean | JSON | EditorJSONContent,
|
|
63
|
+
Required extends boolean = false,
|
|
64
|
+
>(props: useInlineEditOptions<TValue, Required>) {
|
|
65
|
+
/**
|
|
66
|
+
* The update strategy.
|
|
67
|
+
*/
|
|
68
|
+
const strategy = props.updateStrategy ?? defaultUpdateStrategy;
|
|
69
|
+
const delay = strategy.mode === "change" ? (strategy.delay ?? 0) : 0;
|
|
70
|
+
|
|
20
71
|
/**
|
|
21
72
|
* The inline edit context.
|
|
22
73
|
*/
|
|
23
74
|
const context = useInlineEditContext();
|
|
24
75
|
|
|
25
|
-
const { data } = usePermission(props.permission ?? context.permission);
|
|
26
|
-
const isAllowed = data?.success;
|
|
27
|
-
|
|
28
76
|
/**
|
|
29
77
|
* The current value of the inline edit.
|
|
30
78
|
*/
|
|
31
|
-
const [value, setValue] = useState(props.initialValue);
|
|
79
|
+
const [value, setValue] = useState<MaybeValue<TValue, Required> | undefined>(props.initialValue);
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* The indicator status.
|
|
83
|
+
*/
|
|
84
|
+
const { status, setStatus } = useLocalIndicator();
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Permission guard
|
|
88
|
+
*/
|
|
89
|
+
const { data } = usePermission(props.permission ?? context.permission);
|
|
90
|
+
const isAllowed = data?.success;
|
|
32
91
|
|
|
33
92
|
/**
|
|
34
93
|
* Execute the action to update the value.
|
|
35
94
|
*/
|
|
36
|
-
const
|
|
95
|
+
const mutation = useAction({
|
|
37
96
|
mutationFn: props.action,
|
|
97
|
+
onMutate: () => {
|
|
98
|
+
setStatus("pending");
|
|
99
|
+
},
|
|
100
|
+
onSuccess: () => {
|
|
101
|
+
setStatus("success");
|
|
102
|
+
},
|
|
38
103
|
onError: (error) => {
|
|
39
104
|
setValue(props.initialValue);
|
|
40
105
|
toast.error("Er is iets misgegaan", {
|
|
@@ -44,19 +109,73 @@ export function useInlineEdit<
|
|
|
44
109
|
});
|
|
45
110
|
|
|
46
111
|
/**
|
|
47
|
-
* Handle
|
|
112
|
+
* Handle instant mutate
|
|
113
|
+
*/
|
|
114
|
+
const handleMutateInstant = useCallback(
|
|
115
|
+
(value: MaybeValue<TValue, Required>) => {
|
|
116
|
+
// Permission guard
|
|
117
|
+
if (!isAllowed) {
|
|
118
|
+
toast.error("Je hebt geen toestemming om dit te bewerken");
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
// If the value is the same as the initial value, do nothing
|
|
123
|
+
if (value === props.initialValue) return;
|
|
124
|
+
|
|
125
|
+
// Update the value
|
|
126
|
+
return mutation.mutate({ id: context.id, value });
|
|
127
|
+
},
|
|
128
|
+
[isAllowed, props.initialValue, mutation, context.id],
|
|
129
|
+
);
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Handle mutate with debounce
|
|
48
133
|
*/
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
|
|
134
|
+
const handleMutateDebounced = useDebouncedCallback(handleMutateInstant, delay);
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Handle change updates
|
|
138
|
+
*/
|
|
139
|
+
function handleChange(next: MaybeValue<TValue, Required> | null) {
|
|
140
|
+
// Set value in state
|
|
141
|
+
setValue(next ?? undefined);
|
|
142
|
+
|
|
143
|
+
// If the strategy is not change, exit
|
|
144
|
+
if (strategy.mode !== "change") return;
|
|
145
|
+
|
|
146
|
+
// If it is required and the value is null or empty, reset to initial value
|
|
147
|
+
if (props.isRequired && next === null) {
|
|
148
|
+
setValue(props.initialValue ?? undefined);
|
|
149
|
+
setStatus("error");
|
|
150
|
+
toast.error("Dit veld is verplicht");
|
|
52
151
|
return;
|
|
53
152
|
}
|
|
54
153
|
|
|
55
|
-
// If the
|
|
56
|
-
|
|
154
|
+
// If the strategy is change, update the value after the delay
|
|
155
|
+
handleMutateDebounced(next as MaybeValue<TValue, Required>);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* Handle blur updates
|
|
160
|
+
*/
|
|
161
|
+
function handleBlur(next: MaybeValue<TValue, Required> | null) {
|
|
162
|
+
// Set value in state
|
|
163
|
+
setValue(next ?? undefined);
|
|
164
|
+
|
|
165
|
+
// If the strategy is not blur, exit
|
|
166
|
+
if (strategy.mode !== "blur") return;
|
|
167
|
+
|
|
168
|
+
// If it is required and the value is null or empty, reset to initial value
|
|
169
|
+
if (props.isRequired && next === null) {
|
|
170
|
+
setValue(props.initialValue ?? undefined);
|
|
171
|
+
setStatus("error");
|
|
172
|
+
toast.error("Dit veld is verplicht");
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
57
175
|
|
|
58
|
-
|
|
59
|
-
|
|
176
|
+
// If the strategy is blur, update the value
|
|
177
|
+
handleMutateInstant(next as MaybeValue<TValue, Required>);
|
|
178
|
+
}
|
|
60
179
|
|
|
61
|
-
return { value, setValue,
|
|
180
|
+
return { value, setValue, handleChange, handleBlur, status, isAllowed };
|
|
62
181
|
}
|
|
@@ -7,9 +7,16 @@ export const inlineEditVariants = cva("", {
|
|
|
7
7
|
table:
|
|
8
8
|
"min-h-9 px-3 py-1 text-base md:text-sm rounded-none h-full w-full border-none outline-none ring-0 focus:border-0 focus:outline-none focus:ring-0 focus:ring-offset-0 focus-visible:outline-none focus-visible:ring-0 focus-visible:ring-offset-0",
|
|
9
9
|
},
|
|
10
|
+
status: {
|
|
11
|
+
idle: "",
|
|
12
|
+
pending: "opacity-70 animate-pulse",
|
|
13
|
+
success: "",
|
|
14
|
+
error: "border-destructive text-destructive",
|
|
15
|
+
},
|
|
10
16
|
},
|
|
11
17
|
defaultVariants: {
|
|
12
18
|
variant: "default",
|
|
19
|
+
// status: "idle",
|
|
13
20
|
},
|
|
14
21
|
});
|
|
15
22
|
|
|
@@ -156,7 +156,7 @@ type ImageGridItemProps = {
|
|
|
156
156
|
};
|
|
157
157
|
|
|
158
158
|
function ImageGridItem({ node, index, setCurrent }: ImageGridItemProps) {
|
|
159
|
-
const {
|
|
159
|
+
const { uploadClient } = useUploadZone();
|
|
160
160
|
|
|
161
161
|
const { attributes, listeners, setNodeRef, transform, transition } = useSortable({ id: node.id });
|
|
162
162
|
|
|
@@ -198,7 +198,7 @@ function ImageGridItem({ node, index, setCurrent }: ImageGridItemProps) {
|
|
|
198
198
|
type="button"
|
|
199
199
|
variant="destructive"
|
|
200
200
|
size="icon"
|
|
201
|
-
onClick={() =>
|
|
201
|
+
onClick={() => uploadClient.deleteFiles([node.id])}
|
|
202
202
|
className="absolute left-2 top-2 hidden p-1 group-hover:flex"
|
|
203
203
|
>
|
|
204
204
|
<Icons.trash className="size-4" />
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import React from "react";
|
|
4
|
-
import {
|
|
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
|
-
|
|
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>;
|