@tulip-systems/core 0.6.1 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +662 -0
- package/dist/auth/server.d.mts +3 -3
- package/dist/auth/server.mjs +3 -3
- package/dist/components/client.d.mts +19 -3
- package/dist/components/client.mjs +18 -2
- package/dist/components/editor/components/editor.client.d.mts +4 -3
- package/dist/components/editor/components/editor.client.d.mts.map +1 -1
- package/dist/components/editor/components/editor.client.mjs +5 -2
- package/dist/components/editor/components/editor.client.mjs.map +1 -1
- package/dist/components/editor/components/menu-nodes.client.mjs +1 -1
- package/dist/components/editor/components/menu-nodes.client.mjs.map +1 -1
- package/dist/components/editor/components/menu.client.mjs +3 -3
- package/dist/components/editor/components/menu.client.mjs.map +1 -1
- package/dist/components/editor/extensions/file-handler/extension.d.mts +4 -4
- package/dist/components/editor/extensions/file-handler/extension.d.mts.map +1 -1
- package/dist/components/editor/extensions/file-handler/extension.mjs.map +1 -1
- package/dist/components/editor/extensions/file-handler/strategy.d.mts +4 -6
- package/dist/components/editor/extensions/file-handler/strategy.d.mts.map +1 -1
- package/dist/components/editor/extensions/file-handler/strategy.mjs +11 -11
- package/dist/components/editor/extensions/file-handler/strategy.mjs.map +1 -1
- package/dist/components/editor/extensions/file-handler/utils.mjs +1 -1
- package/dist/components/editor/extensions/file-handler/utils.mjs.map +1 -1
- package/dist/components/editor/extensions/image/extension.mjs +9 -9
- package/dist/components/editor/extensions/image/extension.mjs.map +1 -1
- package/dist/components/editor/lib/constants.d.mts +1 -1
- package/dist/components/editor/lib/constants.mjs +1 -1
- package/dist/components/editor/lib/extensions.d.mts +1 -1
- package/dist/components/editor/lib/helpers.d.mts +11 -3
- package/dist/components/editor/lib/helpers.d.mts.map +1 -1
- package/dist/components/editor/lib/helpers.mjs +27 -13
- package/dist/components/editor/lib/helpers.mjs.map +1 -1
- package/dist/components/emails/forget-password-email.mjs +6 -6
- package/dist/components/emails/forget-password-email.mjs.map +1 -1
- package/dist/components/header/back-button.client.mjs +2 -2
- package/dist/components/header/back-button.client.mjs.map +1 -1
- package/dist/components/header/bottom-bar.client.mjs +2 -2
- package/dist/components/header/bottom-bar.client.mjs.map +1 -1
- package/dist/components/header/breadcrumbs.client.mjs +1 -1
- package/dist/components/header/breadcrumbs.client.mjs.map +1 -1
- package/dist/components/header/header.client.mjs +1 -1
- package/dist/components/header/header.client.mjs.map +1 -1
- package/dist/components/layouts/empty-page.mjs +2 -2
- package/dist/components/layouts/empty-page.mjs.map +1 -1
- package/dist/components/layouts/error-page.mjs +3 -3
- package/dist/components/layouts/error-page.mjs.map +1 -1
- package/dist/components/layouts/providers.client.d.mts.map +1 -1
- package/dist/components/layouts/providers.client.mjs +3 -2
- package/dist/components/layouts/providers.client.mjs.map +1 -1
- package/dist/components/layouts/root-loading.mjs +2 -2
- package/dist/components/layouts/root-loading.mjs.map +1 -1
- package/dist/components/layouts/tab-layout.mjs +1 -1
- package/dist/components/layouts/tab-layout.mjs.map +1 -1
- package/dist/components/lists/data-list.mjs +1 -1
- package/dist/components/lists/data-list.mjs.map +1 -1
- package/dist/components/lists/data-stack.mjs +1 -1
- package/dist/components/lists/data-stack.mjs.map +1 -1
- package/dist/components/navigation/admin-sidebar-header.client.mjs +3 -3
- package/dist/components/navigation/admin-sidebar-header.client.mjs.map +1 -1
- package/dist/components/navigation/admin-sidebar-skeleton.mjs +1 -1
- package/dist/components/navigation/admin-sidebar-skeleton.mjs.map +1 -1
- package/dist/components/ui/accordion.client.d.mts +26 -0
- package/dist/components/ui/accordion.client.d.mts.map +1 -0
- package/dist/components/ui/accordion.client.mjs +58 -0
- package/dist/components/ui/accordion.client.mjs.map +1 -0
- package/dist/components/ui/alert-dialog.client.d.mts +61 -0
- package/dist/components/ui/alert-dialog.client.d.mts.map +1 -0
- package/dist/components/ui/alert-dialog.client.mjs +104 -0
- package/dist/components/ui/alert-dialog.client.mjs.map +1 -0
- package/dist/components/ui/alert.d.mts +5 -1
- package/dist/components/ui/alert.d.mts.map +1 -1
- package/dist/components/ui/alert.mjs +13 -6
- package/dist/components/ui/alert.mjs.map +1 -1
- package/dist/components/ui/aspect-ratio.client.d.mts +10 -0
- package/dist/components/ui/aspect-ratio.client.d.mts.map +1 -0
- package/dist/components/ui/aspect-ratio.client.mjs +16 -0
- package/dist/components/ui/aspect-ratio.client.mjs.map +1 -0
- package/dist/components/ui/avatar.client.d.mts +21 -6
- package/dist/components/ui/avatar.client.d.mts.map +1 -1
- package/dist/components/ui/avatar.client.mjs +31 -9
- package/dist/components/ui/avatar.client.mjs.map +1 -1
- package/dist/components/ui/badge.d.mts +1 -1
- package/dist/components/ui/badge.d.mts.map +1 -1
- package/dist/components/ui/badge.mjs +11 -8
- package/dist/components/ui/badge.mjs.map +1 -1
- package/dist/components/ui/breadcrumb.d.mts +3 -1
- package/dist/components/ui/breadcrumb.d.mts.map +1 -1
- package/dist/components/ui/breadcrumb.mjs +7 -7
- package/dist/components/ui/breadcrumb.mjs.map +1 -1
- package/dist/components/ui/button-group.d.mts +29 -0
- package/dist/components/ui/button-group.d.mts.map +1 -0
- package/dist/components/ui/button-group.mjs +41 -0
- package/dist/components/ui/button-group.mjs.map +1 -0
- package/dist/components/ui/button.d.mts +2 -2
- package/dist/components/ui/button.d.mts.map +1 -1
- package/dist/components/ui/button.mjs +19 -13
- package/dist/components/ui/button.mjs.map +1 -1
- package/dist/components/ui/{calendar.d.mts → calendar.client.d.mts} +7 -4
- package/dist/components/ui/calendar.client.d.mts.map +1 -0
- package/dist/components/ui/{calendar.mjs → calendar.client.mjs} +22 -19
- package/dist/components/ui/calendar.client.mjs.map +1 -0
- package/dist/components/ui/card.d.mts +9 -2
- package/dist/components/ui/card.d.mts.map +1 -1
- package/dist/components/ui/card.mjs +15 -7
- package/dist/components/ui/card.mjs.map +1 -1
- package/dist/components/ui/{carousel.d.mts → carousel.client.d.mts} +12 -3
- package/dist/components/ui/carousel.client.d.mts.map +1 -0
- package/dist/components/ui/{carousel.mjs → carousel.client.mjs} +10 -10
- package/dist/components/ui/carousel.client.mjs.map +1 -0
- package/dist/components/ui/chart.client.d.mts.map +1 -1
- package/dist/components/ui/chart.client.mjs +11 -11
- package/dist/components/ui/chart.client.mjs.map +1 -1
- package/dist/components/ui/checkbox.client.d.mts +12 -0
- package/dist/components/ui/checkbox.client.d.mts.map +1 -0
- package/dist/components/ui/checkbox.client.mjs +24 -0
- package/dist/components/ui/checkbox.client.mjs.map +1 -0
- package/dist/components/ui/collapsible.client.d.mts +6 -6
- package/dist/components/ui/collapsible.client.d.mts.map +1 -1
- package/dist/components/ui/collapsible.client.mjs +6 -6
- package/dist/components/ui/collapsible.client.mjs.map +1 -1
- package/dist/components/ui/combobox-dropdown.client.d.mts +1 -1
- package/dist/components/ui/combobox-dropdown.client.mjs +3 -2
- package/dist/components/ui/combobox-dropdown.client.mjs.map +1 -1
- package/dist/components/ui/combobox.client.mjs +5 -5
- package/dist/components/ui/combobox.client.mjs.map +1 -1
- package/dist/components/ui/{command.d.mts → command.client.d.mts} +8 -2
- package/dist/components/ui/command.client.d.mts.map +1 -0
- package/dist/components/ui/command.client.mjs +91 -0
- package/dist/components/ui/command.client.mjs.map +1 -0
- package/dist/components/ui/context-menu.client.d.mts +86 -0
- package/dist/components/ui/context-menu.client.d.mts.map +1 -0
- package/dist/components/ui/context-menu.client.mjs +128 -0
- package/dist/components/ui/context-menu.client.mjs.map +1 -0
- package/dist/components/ui/date-picker.client.mjs +2 -2
- package/dist/components/ui/date-picker.client.mjs.map +1 -1
- package/dist/components/ui/dialog.client.d.mts +19 -12
- package/dist/components/ui/dialog.client.d.mts.map +1 -1
- package/dist/components/ui/dialog.client.mjs +40 -29
- package/dist/components/ui/dialog.client.mjs.map +1 -1
- package/dist/components/ui/drawer.client.d.mts.map +1 -1
- package/dist/components/ui/drawer.client.mjs +5 -5
- package/dist/components/ui/drawer.client.mjs.map +1 -1
- package/dist/components/ui/dropdown-menu.client.d.mts +85 -0
- package/dist/components/ui/dropdown-menu.client.d.mts.map +1 -0
- package/dist/components/ui/dropdown-menu.client.mjs +131 -0
- package/dist/components/ui/dropdown-menu.client.mjs.map +1 -0
- package/dist/components/ui/empty.d.mts +36 -0
- package/dist/components/ui/empty.d.mts.map +1 -0
- package/dist/components/ui/empty.mjs +62 -0
- package/dist/components/ui/empty.mjs.map +1 -0
- package/dist/components/ui/field.client.d.mts +65 -0
- package/dist/components/ui/field.client.d.mts.map +1 -0
- package/dist/components/ui/field.client.mjs +114 -0
- package/dist/components/ui/field.client.mjs.map +1 -0
- package/dist/components/ui/form.client.d.mts +3 -4
- package/dist/components/ui/form.client.d.mts.map +1 -1
- package/dist/components/ui/form.client.mjs +4 -4
- package/dist/components/ui/form.client.mjs.map +1 -1
- package/dist/components/ui/hover-card.client.d.mts +6 -6
- package/dist/components/ui/hover-card.client.d.mts.map +1 -1
- package/dist/components/ui/hover-card.client.mjs +14 -11
- package/dist/components/ui/hover-card.client.mjs.map +1 -1
- package/dist/components/ui/{input-date-time.d.mts → input-date-time.client.d.mts} +3 -3
- package/dist/components/ui/input-date-time.client.d.mts.map +1 -0
- package/dist/components/ui/{input-date-time.mjs → input-date-time.client.mjs} +4 -2
- package/dist/components/ui/input-date-time.client.mjs.map +1 -0
- package/dist/components/ui/input-date.d.mts +1 -1
- package/dist/components/ui/input-date.d.mts.map +1 -1
- package/dist/components/ui/input-date.mjs.map +1 -1
- package/dist/components/ui/input-group.client.d.mts +59 -0
- package/dist/components/ui/input-group.client.d.mts.map +1 -0
- package/dist/components/ui/input-group.client.mjs +106 -0
- package/dist/components/ui/input-group.client.mjs.map +1 -0
- package/dist/components/ui/input-recipient.mjs +11 -11
- package/dist/components/ui/input-recipient.mjs.map +1 -1
- package/dist/components/ui/input-time.d.mts +1 -1
- package/dist/components/ui/input-time.d.mts.map +1 -1
- package/dist/components/ui/input-time.mjs.map +1 -1
- package/dist/components/ui/input.d.mts.map +1 -1
- package/dist/components/ui/input.mjs +1 -1
- package/dist/components/ui/input.mjs.map +1 -1
- package/dist/components/ui/item.d.mts +63 -0
- package/dist/components/ui/item.d.mts.map +1 -0
- package/dist/components/ui/item.mjs +119 -0
- package/dist/components/ui/item.mjs.map +1 -0
- package/dist/components/ui/kbd.d.mts +14 -0
- package/dist/components/ui/kbd.d.mts.map +1 -0
- package/dist/components/ui/kbd.mjs +22 -0
- package/dist/components/ui/kbd.mjs.map +1 -0
- package/dist/components/ui/label.d.mts +4 -4
- package/dist/components/ui/label.d.mts.map +1 -1
- package/dist/components/ui/label.mjs +5 -5
- package/dist/components/ui/label.mjs.map +1 -1
- package/dist/components/ui/loader.d.mts +7 -0
- package/dist/components/ui/loader.d.mts.map +1 -0
- package/dist/components/ui/loader.mjs +63 -0
- package/dist/components/ui/loader.mjs.map +1 -0
- package/dist/components/ui/navigation-menu.d.mts +11 -11
- package/dist/components/ui/navigation-menu.d.mts.map +1 -1
- package/dist/components/ui/navigation-menu.mjs +18 -20
- package/dist/components/ui/navigation-menu.mjs.map +1 -1
- package/dist/components/ui/pagination.d.mts +8 -2
- package/dist/components/ui/pagination.d.mts.map +1 -1
- package/dist/components/ui/pagination.mjs +29 -21
- package/dist/components/ui/pagination.mjs.map +1 -1
- package/dist/components/ui/popover.client.d.mts +35 -0
- package/dist/components/ui/popover.client.d.mts.map +1 -0
- package/dist/components/ui/popover.client.mjs +59 -0
- package/dist/components/ui/popover.client.mjs.map +1 -0
- package/dist/components/ui/progress.client.d.mts +4 -4
- package/dist/components/ui/progress.client.d.mts.map +1 -1
- package/dist/components/ui/progress.client.mjs +7 -7
- package/dist/components/ui/progress.client.mjs.map +1 -1
- package/dist/components/ui/radio-group.d.mts +5 -5
- package/dist/components/ui/radio-group.d.mts.map +1 -1
- package/dist/components/ui/radio-group.mjs +10 -11
- package/dist/components/ui/radio-group.mjs.map +1 -1
- package/dist/components/ui/resizable.client.d.mts +3 -4
- package/dist/components/ui/resizable.client.d.mts.map +1 -1
- package/dist/components/ui/resizable.client.mjs +5 -9
- package/dist/components/ui/resizable.client.mjs.map +1 -1
- package/dist/components/ui/scroll-area.d.mts +5 -5
- package/dist/components/ui/scroll-area.d.mts.map +1 -1
- package/dist/components/ui/scroll-area.mjs +12 -11
- package/dist/components/ui/scroll-area.mjs.map +1 -1
- package/dist/components/ui/select.client.d.mts +18 -13
- package/dist/components/ui/select.client.d.mts.map +1 -1
- package/dist/components/ui/select.client.mjs +37 -32
- package/dist/components/ui/select.client.mjs.map +1 -1
- package/dist/components/ui/separator.d.mts +4 -4
- package/dist/components/ui/separator.d.mts.map +1 -1
- package/dist/components/ui/separator.mjs +6 -6
- package/dist/components/ui/separator.mjs.map +1 -1
- package/dist/components/ui/sheet.client.d.mts +9 -7
- package/dist/components/ui/sheet.client.d.mts.map +1 -1
- package/dist/components/ui/sheet.client.mjs +30 -20
- package/dist/components/ui/sheet.client.mjs.map +1 -1
- package/dist/components/ui/sidebar.client.mjs +28 -28
- package/dist/components/ui/sidebar.client.mjs.map +1 -1
- package/dist/components/ui/skeleton.mjs +1 -1
- package/dist/components/ui/skeleton.mjs.map +1 -1
- package/dist/components/ui/slider.d.mts +4 -4
- package/dist/components/ui/slider.d.mts.map +1 -1
- package/dist/components/ui/slider.mjs +11 -11
- package/dist/components/ui/slider.mjs.map +1 -1
- package/dist/components/ui/spinner.d.mts +10 -0
- package/dist/components/ui/spinner.d.mts.map +1 -0
- package/dist/components/ui/spinner.mjs +9 -55
- package/dist/components/ui/spinner.mjs.map +1 -1
- package/dist/components/ui/switch.client.d.mts +15 -0
- package/dist/components/ui/switch.client.d.mts.map +1 -0
- package/dist/components/ui/switch.client.mjs +23 -0
- package/dist/components/ui/switch.client.mjs.map +1 -0
- package/dist/components/ui/tabs.client.d.mts +31 -0
- package/dist/components/ui/tabs.client.d.mts.map +1 -0
- package/dist/components/ui/tabs.client.mjs +49 -0
- package/dist/components/ui/tabs.client.mjs.map +1 -0
- package/dist/components/ui/textarea.d.mts.map +1 -1
- package/dist/components/ui/textarea.mjs +1 -1
- package/dist/components/ui/textarea.mjs.map +1 -1
- package/dist/components/ui/toggle-group.client.d.mts +11 -6
- package/dist/components/ui/toggle-group.client.d.mts.map +1 -1
- package/dist/components/ui/toggle-group.client.mjs +20 -12
- package/dist/components/ui/toggle-group.client.mjs.map +1 -1
- package/dist/components/ui/{toggle.d.mts → toggle.client.d.mts} +6 -6
- package/dist/components/ui/toggle.client.d.mts.map +1 -0
- package/dist/components/ui/toggle.client.mjs +40 -0
- package/dist/components/ui/toggle.client.mjs.map +1 -0
- package/dist/components/ui/tooltip.client.d.mts +7 -7
- package/dist/components/ui/tooltip.client.d.mts.map +1 -1
- package/dist/components/ui/tooltip.client.mjs +10 -10
- package/dist/components/ui/tooltip.client.mjs.map +1 -1
- package/dist/components.d.mts +13 -21
- package/dist/components.mjs +13 -21
- package/dist/config/server.d.mts +1 -3
- package/dist/config/server.mjs +1 -4
- package/dist/config.d.mts +2 -2
- package/dist/config.mjs +1 -1
- package/dist/data-tables/client.d.mts +2 -1
- package/dist/data-tables/client.mjs +2 -1
- package/dist/data-tables.d.mts +1 -1
- package/dist/database/client.d.mts +1 -0
- package/dist/database/client.mjs +1 -0
- package/dist/database/server.d.mts +2 -0
- package/dist/database/server.mjs +3 -0
- package/dist/database.d.mts +3 -0
- package/dist/database.mjs +3 -0
- package/dist/emails/client.d.mts +1 -0
- package/dist/emails/client.mjs +1 -0
- package/dist/emails/server.d.mts +2 -0
- package/dist/emails/server.mjs +3 -0
- package/dist/emails.d.mts +1 -0
- package/dist/emails.mjs +1 -0
- package/dist/inline-edit/client.d.mts +2 -2
- package/dist/lib/hooks/use-indicator.d.mts.map +1 -1
- package/dist/lib/hooks/use-indicator.mjs.map +1 -1
- package/dist/lib/utils/markdown.d.mts +10 -0
- package/dist/lib/utils/markdown.d.mts.map +1 -0
- package/dist/lib/utils/markdown.mjs +15 -0
- package/dist/lib/utils/markdown.mjs.map +1 -0
- package/dist/lib/utils/url.mjs +2 -1
- package/dist/lib/utils/url.mjs.map +1 -1
- package/dist/lib/utils/user-agent.mjs +15 -0
- package/dist/lib/utils/user-agent.mjs.map +1 -1
- package/dist/lib.d.mts +2 -2
- package/dist/lib.mjs +2 -2
- package/dist/modules/auth/components/auth-layout.server.mjs +2 -2
- package/dist/modules/auth/components/auth-layout.server.mjs.map +1 -1
- package/dist/modules/auth/components/create-first-user-guard.server.d.mts +16 -0
- package/dist/modules/auth/components/create-first-user-guard.server.d.mts.map +1 -0
- package/dist/modules/auth/components/create-first-user-guard.server.mjs +16 -0
- package/dist/modules/auth/components/create-first-user-guard.server.mjs.map +1 -0
- package/dist/modules/auth/components/create-first-user-page.client.mjs +3 -3
- package/dist/modules/auth/components/create-first-user-page.client.mjs.map +1 -1
- package/dist/modules/auth/components/forget-password-page.client.mjs +1 -1
- package/dist/modules/auth/components/forget-password-page.client.mjs.map +1 -1
- package/dist/modules/auth/components/guard.server.d.mts +2 -2
- package/dist/modules/auth/components/guard.server.mjs +1 -1
- package/dist/modules/auth/components/guard.server.mjs.map +1 -1
- package/dist/modules/auth/components/login-page.client.mjs +5 -5
- package/dist/modules/auth/components/login-page.client.mjs.map +1 -1
- package/dist/modules/auth/components/reset-password-page.client.mjs +5 -5
- package/dist/modules/auth/components/reset-password-page.client.mjs.map +1 -1
- package/dist/modules/auth/db/schema.d.mts +1 -1
- package/dist/modules/auth/db/schema.mjs +2 -2
- package/dist/modules/auth/handler/create-client.client.d.mts +4838 -229
- package/dist/modules/auth/handler/create-client.client.d.mts.map +1 -1
- package/dist/modules/auth/handler/create-client.client.mjs.map +1 -1
- package/dist/modules/auth/handler/proxy.server.mjs +2 -2
- package/dist/modules/auth/handler/proxy.server.mjs.map +1 -1
- package/dist/modules/auth/handler/route.server.d.mts +2 -2
- package/dist/modules/auth/handler/route.server.d.mts.map +1 -1
- package/dist/modules/auth/handler/route.server.mjs.map +1 -1
- package/dist/modules/auth/handler/{init.d.mts → service.server.d.mts} +322 -90
- package/dist/modules/auth/handler/service.server.d.mts.map +1 -0
- package/dist/modules/auth/handler/{init.mjs → service.server.mjs} +19 -8
- package/dist/modules/auth/handler/service.server.mjs.map +1 -0
- package/dist/modules/auth/hooks/use-session.d.mts +9 -4
- package/dist/modules/auth/hooks/use-session.d.mts.map +1 -1
- package/dist/modules/auth/lib/helpers.server.d.mts +1 -1
- package/dist/modules/auth/lib/permissions.d.mts +1 -1
- package/dist/modules/auth/lib/validators.mjs +1 -1
- package/dist/modules/commands/components/alert-dialog-command.client.d.mts +9 -9
- package/dist/modules/commands/components/alert-dialog-command.client.d.mts.map +1 -1
- package/dist/modules/commands/components/alert-dialog-command.client.mjs +3 -3
- package/dist/modules/commands/components/alert-dialog-command.client.mjs.map +1 -1
- package/dist/modules/commands/components/click-command.client.mjs +2 -2
- package/dist/modules/commands/components/click-command.client.mjs.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/dialog-command.client.mjs +2 -2
- package/dist/modules/commands/components/dialog-command.client.mjs.map +1 -1
- package/dist/modules/commands/components/dropdown-command.client.mjs +2 -2
- package/dist/modules/commands/components/dropdown-command.client.mjs.map +1 -1
- package/dist/modules/commands/components/empty-command.client.mjs +2 -2
- package/dist/modules/commands/components/empty-command.client.mjs.map +1 -1
- package/dist/modules/commands/components/form-dialog-command.client.d.mts +11 -9
- package/dist/modules/commands/components/form-dialog-command.client.d.mts.map +1 -1
- package/dist/modules/commands/components/form-dialog-command.client.mjs +8 -6
- package/dist/modules/commands/components/form-dialog-command.client.mjs.map +1 -1
- package/dist/modules/commands/menus/context-menu.client.d.mts +3 -3
- package/dist/modules/commands/menus/context-menu.client.d.mts.map +1 -1
- package/dist/modules/commands/menus/context-menu.client.mjs +1 -1
- package/dist/modules/commands/menus/context-menu.client.mjs.map +1 -1
- package/dist/modules/commands/menus/dropdown-menu.client.mjs +2 -2
- package/dist/modules/commands/menus/dropdown-menu.client.mjs.map +1 -1
- package/dist/modules/commands/menus/floating-menu.client.mjs +2 -2
- package/dist/modules/commands/menus/floating-menu.client.mjs.map +1 -1
- package/dist/modules/commands/utils/archive-command.client.mjs +1 -1
- package/dist/modules/commands/utils/archive-command.client.mjs.map +1 -1
- package/dist/modules/commands/utils/delete-command.client.mjs +1 -1
- package/dist/modules/commands/utils/delete-command.client.mjs.map +1 -1
- package/dist/modules/config/lib/context.d.mts +9 -10
- package/dist/modules/config/lib/context.d.mts.map +1 -1
- package/dist/modules/config/lib/context.mjs.map +1 -1
- package/dist/modules/data-tables/components/cell/select.client.mjs +1 -1
- package/dist/modules/data-tables/components/cell/select.client.mjs.map +1 -1
- package/dist/modules/data-tables/components/column-header.mjs +5 -5
- package/dist/modules/data-tables/components/column-header.mjs.map +1 -1
- package/dist/modules/data-tables/components/filters/combobox.client.mjs +6 -6
- package/dist/modules/data-tables/components/filters/combobox.client.mjs.map +1 -1
- package/dist/modules/data-tables/components/filters/slider.client.mjs +2 -2
- package/dist/modules/data-tables/components/filters/slider.client.mjs.map +1 -1
- package/dist/modules/data-tables/components/header.mjs +1 -1
- package/dist/modules/data-tables/components/header.mjs.map +1 -1
- package/dist/modules/data-tables/components/skeleton.mjs +2 -2
- package/dist/modules/data-tables/components/skeleton.mjs.map +1 -1
- package/dist/modules/data-tables/components/table.mjs +3 -3
- package/dist/modules/data-tables/components/table.mjs.map +1 -1
- package/dist/modules/data-tables/components/toolbar.mjs +1 -1
- package/dist/modules/data-tables/components/toolbar.mjs.map +1 -1
- package/dist/modules/data-tables/lib/converters/search.d.mts +1 -1
- package/dist/modules/data-tables/lib/converters/sorting.d.mts +1 -1
- package/dist/modules/data-tables/server/get-data.server.d.mts +3 -3
- package/dist/modules/data-tables/server/get-data.server.mjs +1 -1
- package/dist/modules/data-tables/server/get-data.server.mjs.map +1 -1
- package/dist/modules/data-tables/strategies/infinite/strategy.d.mts +1 -1
- package/dist/modules/data-tables/strategies/infinite/strategy.mjs +3 -0
- package/dist/modules/data-tables/strategies/infinite/strategy.mjs.map +1 -1
- package/dist/modules/data-tables/strategies/pagination/components.mjs +3 -3
- package/dist/modules/data-tables/strategies/pagination/components.mjs.map +1 -1
- package/dist/modules/data-tables/tables/data-table/components/row.mjs +5 -15
- package/dist/modules/data-tables/tables/data-table/components/row.mjs.map +1 -1
- package/dist/modules/data-tables/tables/inline-table/components/body.mjs +1 -1
- package/dist/modules/data-tables/tables/inline-table/components/body.mjs.map +1 -1
- package/dist/modules/data-tables/tables/inline-table/components/cells/common.mjs +1 -1
- package/dist/modules/data-tables/tables/inline-table/components/cells/common.mjs.map +1 -1
- package/dist/modules/data-tables/tables/inline-table/components/cells/drag-handle.client.mjs +1 -1
- package/dist/modules/data-tables/tables/inline-table/components/cells/drag-handle.client.mjs.map +1 -1
- package/dist/modules/data-tables/tables/inline-table/components/cells/read-only.mjs +1 -1
- package/dist/modules/data-tables/tables/inline-table/components/cells/read-only.mjs.map +1 -1
- package/dist/modules/data-tables/tables/inline-table/components/row.client.mjs +13 -23
- package/dist/modules/data-tables/tables/inline-table/components/row.client.mjs.map +1 -1
- package/dist/modules/data-tables/tables/inline-table/components/table.d.mts +1 -0
- package/dist/modules/data-tables/tables/inline-table/components/table.d.mts.map +1 -1
- package/dist/modules/data-tables/tables/inline-table/components/table.mjs +2 -1
- package/dist/modules/data-tables/tables/inline-table/components/table.mjs.map +1 -1
- package/dist/modules/data-tables/tables/inline-table/hooks/context.client.d.mts +5 -1
- package/dist/modules/data-tables/tables/inline-table/hooks/context.client.d.mts.map +1 -1
- package/dist/modules/data-tables/tables/inline-table/hooks/context.client.mjs +2 -1
- package/dist/modules/data-tables/tables/inline-table/hooks/context.client.mjs.map +1 -1
- package/dist/modules/data-tables/tables/inline-table/hooks/use-hotkeys.client.d.mts +30 -0
- package/dist/modules/data-tables/tables/inline-table/hooks/use-hotkeys.client.d.mts.map +1 -0
- package/dist/modules/data-tables/tables/inline-table/hooks/use-hotkeys.client.mjs +77 -9
- package/dist/modules/data-tables/tables/inline-table/hooks/use-hotkeys.client.mjs.map +1 -1
- package/dist/modules/{config/db → database/lib}/helpers.d.mts +2 -2
- package/dist/modules/database/lib/helpers.d.mts.map +1 -0
- package/dist/modules/{config/db → database/lib}/helpers.mjs +1 -1
- package/dist/modules/database/lib/helpers.mjs.map +1 -0
- package/dist/modules/database/lib/service.server.d.mts +34 -0
- package/dist/modules/database/lib/service.server.d.mts.map +1 -0
- package/dist/modules/database/lib/service.server.mjs +24 -0
- package/dist/modules/database/lib/service.server.mjs.map +1 -0
- package/dist/modules/{config/db → database/lib}/types.d.mts +1 -1
- package/dist/modules/database/lib/types.d.mts.map +1 -0
- package/dist/modules/emails/lib/service.server.d.mts +29 -0
- package/dist/modules/emails/lib/service.server.d.mts.map +1 -0
- package/dist/modules/emails/lib/service.server.mjs +21 -0
- package/dist/modules/emails/lib/service.server.mjs.map +1 -0
- package/dist/modules/inline-edit/components/date-input.client.mjs +4 -4
- package/dist/modules/inline-edit/components/date-input.client.mjs.map +1 -1
- package/dist/modules/inline-edit/components/date-picker.client.mjs +3 -2
- package/dist/modules/inline-edit/components/date-picker.client.mjs.map +1 -1
- package/dist/modules/inline-edit/components/date-time.client.d.mts +1 -1
- package/dist/modules/inline-edit/components/date-time.client.mjs +2 -1
- package/dist/modules/inline-edit/components/date-time.client.mjs.map +1 -1
- package/dist/modules/inline-edit/components/editor.client.mjs +1 -0
- package/dist/modules/inline-edit/components/editor.client.mjs.map +1 -1
- package/dist/modules/inline-edit/components/input-recipient.client.mjs +1 -0
- package/dist/modules/inline-edit/components/input-recipient.client.mjs.map +1 -1
- package/dist/modules/inline-edit/components/input-toggle.client.mjs +3 -2
- package/dist/modules/inline-edit/components/input-toggle.client.mjs.map +1 -1
- package/dist/modules/inline-edit/components/input.client.d.mts.map +1 -1
- package/dist/modules/inline-edit/components/input.client.mjs +6 -3
- package/dist/modules/inline-edit/components/input.client.mjs.map +1 -1
- package/dist/modules/inline-edit/components/select.client.d.mts +8 -11
- package/dist/modules/inline-edit/components/select.client.d.mts.map +1 -1
- package/dist/modules/inline-edit/components/select.client.mjs +1 -0
- package/dist/modules/inline-edit/components/select.client.mjs.map +1 -1
- package/dist/modules/inline-edit/components/switch.client.d.mts +3 -2
- package/dist/modules/inline-edit/components/switch.client.d.mts.map +1 -1
- package/dist/modules/inline-edit/components/switch.client.mjs +2 -1
- package/dist/modules/inline-edit/components/switch.client.mjs.map +1 -1
- package/dist/modules/inline-edit/components/toggle.client.mjs +2 -1
- package/dist/modules/inline-edit/components/toggle.client.mjs.map +1 -1
- package/dist/modules/inline-edit/lib/variants.d.mts +1 -1
- package/dist/modules/inline-edit/lib/variants.mjs +1 -1
- package/dist/modules/inline-edit/lib/variants.mjs.map +1 -1
- package/dist/modules/router/handler/context.server.d.mts +12 -10
- package/dist/modules/router/handler/context.server.d.mts.map +1 -1
- package/dist/modules/router/handler/init.server.d.mts +13 -11
- package/dist/modules/router/handler/init.server.d.mts.map +1 -1
- package/dist/modules/router/handler/init.server.mjs +2 -2
- package/dist/modules/router/handler/init.server.mjs.map +1 -1
- package/dist/modules/router/handler/route.server.d.mts +1 -1
- package/dist/modules/storage/components/dropzone.client.d.mts +2 -2
- package/dist/modules/storage/components/dropzone.client.d.mts.map +1 -1
- package/dist/modules/storage/components/dropzone.client.mjs +8 -8
- package/dist/modules/storage/components/dropzone.client.mjs.map +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 +24 -26
- package/dist/modules/storage/components/image-grid.client.mjs.map +1 -1
- package/dist/modules/storage/components/image.client.d.mts +8 -0
- package/dist/modules/storage/components/image.client.d.mts.map +1 -0
- package/dist/modules/storage/components/image.client.mjs +17 -0
- package/dist/modules/storage/components/image.client.mjs.map +1 -0
- package/dist/modules/storage/components/upload-button.client.d.mts +12 -0
- package/dist/modules/storage/components/upload-button.client.d.mts.map +1 -0
- package/dist/modules/storage/components/upload-button.client.mjs +34 -0
- package/dist/modules/storage/components/upload-button.client.mjs.map +1 -0
- package/dist/modules/storage/components/upload-zone-context.client.d.mts +5 -5
- package/dist/modules/storage/components/upload-zone-context.client.d.mts.map +1 -1
- package/dist/modules/storage/components/upload-zone-context.client.mjs +2 -2
- package/dist/modules/storage/components/upload-zone-context.client.mjs.map +1 -1
- package/dist/modules/storage/components/upload-zone.client.d.mts +4 -4
- package/dist/modules/storage/components/upload-zone.client.d.mts.map +1 -1
- package/dist/modules/storage/components/upload-zone.client.mjs +17 -10
- package/dist/modules/storage/components/upload-zone.client.mjs.map +1 -1
- package/dist/modules/storage/lib/constants.d.mts +1 -5
- package/dist/modules/storage/lib/constants.d.mts.map +1 -1
- package/dist/modules/storage/lib/constants.mjs +1 -13
- package/dist/modules/storage/lib/constants.mjs.map +1 -1
- package/dist/modules/storage/lib/helpers.d.mts +14 -28
- package/dist/modules/storage/lib/helpers.d.mts.map +1 -1
- package/dist/modules/storage/lib/helpers.mjs +17 -75
- package/dist/modules/storage/lib/helpers.mjs.map +1 -1
- package/dist/modules/storage/lib/procedures.server.d.mts +1991 -0
- package/dist/modules/{auth/handler/init.d.mts.map → storage/lib/procedures.server.d.mts.map} +1 -1
- package/dist/modules/storage/lib/procedures.server.mjs +22 -0
- package/dist/modules/storage/lib/procedures.server.mjs.map +1 -0
- package/dist/modules/storage/lib/router-handlers.server.d.mts +41 -0
- package/dist/modules/storage/lib/router-handlers.server.d.mts.map +1 -0
- package/dist/modules/storage/lib/router-handlers.server.mjs +124 -0
- package/dist/modules/storage/lib/router-handlers.server.mjs.map +1 -0
- package/dist/modules/storage/lib/schema.d.mts +68 -958
- package/dist/modules/storage/lib/schema.d.mts.map +1 -1
- package/dist/modules/storage/lib/schema.mjs +28 -65
- package/dist/modules/storage/lib/schema.mjs.map +1 -1
- package/dist/modules/storage/lib/service.server.d.mts +2155 -141
- package/dist/modules/storage/lib/service.server.d.mts.map +1 -1
- package/dist/modules/storage/lib/service.server.mjs +453 -242
- package/dist/modules/storage/lib/service.server.mjs.map +1 -1
- package/dist/modules/storage/lib/upload.client.d.mts +58 -0
- package/dist/modules/storage/lib/upload.client.d.mts.map +1 -0
- package/dist/modules/storage/lib/upload.client.mjs +87 -0
- package/dist/modules/storage/lib/upload.client.mjs.map +1 -0
- package/dist/modules/storage/lib/validators.d.mts +297 -835
- package/dist/modules/storage/lib/validators.d.mts.map +1 -1
- package/dist/modules/storage/lib/validators.mjs +32 -76
- package/dist/modules/storage/lib/validators.mjs.map +1 -1
- package/dist/modules/storage/providers/adapters/s3.server.d.mts +19 -0
- package/dist/modules/storage/providers/adapters/s3.server.d.mts.map +1 -0
- package/dist/modules/storage/providers/adapters/s3.server.mjs +173 -0
- package/dist/modules/storage/providers/adapters/s3.server.mjs.map +1 -0
- package/dist/modules/storage/providers/lib/constants.d.mts +6 -0
- package/dist/modules/storage/providers/lib/constants.d.mts.map +1 -0
- package/dist/modules/storage/providers/lib/constants.mjs +6 -0
- package/dist/modules/storage/providers/lib/constants.mjs.map +1 -0
- package/dist/modules/storage/providers/lib/errors.d.mts +12 -0
- package/dist/modules/storage/providers/lib/errors.d.mts.map +1 -0
- package/dist/modules/storage/providers/lib/errors.mjs +13 -0
- package/dist/modules/storage/providers/lib/errors.mjs.map +1 -0
- package/dist/modules/storage/providers/lib/types.d.mts +21 -0
- package/dist/modules/storage/providers/lib/types.d.mts.map +1 -0
- package/dist/modules/storage/providers/lib/validators.d.mts +112 -0
- package/dist/modules/storage/providers/lib/validators.d.mts.map +1 -0
- package/dist/modules/storage/providers/lib/validators.mjs +75 -0
- package/dist/modules/storage/providers/lib/validators.mjs.map +1 -0
- package/dist/router/server.d.mts +1 -1
- package/dist/storage/client.d.mts +4 -2
- package/dist/storage/client.mjs +4 -2
- package/dist/storage/server.d.mts +5 -4
- package/dist/storage/server.mjs +5 -4
- package/dist/storage.d.mts +9 -6
- package/dist/storage.mjs +8 -6
- package/package.json +20 -32
- package/src/components/editor/components/editor.client.tsx +9 -1
- package/src/components/editor/components/menu-nodes.client.tsx +1 -1
- package/src/components/editor/components/menu.client.tsx +3 -3
- package/src/components/editor/extensions/file-handler/extension.ts +4 -4
- package/src/components/editor/extensions/file-handler/strategy.ts +15 -40
- package/src/components/editor/extensions/file-handler/utils.ts +1 -1
- package/src/components/editor/extensions/image/extension.ts +10 -10
- package/src/components/editor/lib/helpers.ts +28 -11
- package/src/components/emails/forget-password-email.tsx +6 -6
- package/src/components/entry.client.ts +16 -0
- package/src/components/entry.ts +6 -14
- package/src/components/header/back-button.client.tsx +2 -2
- package/src/components/header/bottom-bar.client.tsx +2 -2
- package/src/components/header/breadcrumbs.client.tsx +1 -1
- package/src/components/header/header.client.tsx +1 -1
- package/src/components/layouts/empty-page.tsx +2 -2
- package/src/components/layouts/error-page.tsx +3 -3
- package/src/components/layouts/providers.client.tsx +8 -5
- package/src/components/layouts/root-loading.tsx +2 -2
- package/src/components/layouts/tab-layout.tsx +1 -1
- package/src/components/lists/data-list.tsx +1 -1
- package/src/components/lists/data-stack.tsx +1 -1
- package/src/components/navigation/admin-sidebar-header.client.tsx +3 -3
- package/src/components/navigation/admin-sidebar-skeleton.tsx +1 -1
- package/src/components/ui/accordion.client.tsx +83 -0
- package/src/components/ui/alert-dialog.client.tsx +181 -0
- package/src/components/ui/alert.tsx +15 -7
- package/src/components/ui/aspect-ratio.client.tsx +9 -0
- package/src/components/ui/avatar.client.tsx +61 -6
- package/src/components/ui/badge.tsx +17 -11
- package/src/components/ui/breadcrumb.tsx +9 -10
- package/src/components/ui/button-group.tsx +78 -0
- package/src/components/ui/button.tsx +26 -16
- package/src/components/ui/{calendar.tsx → calendar.client.tsx} +27 -20
- package/src/components/ui/card.tsx +41 -8
- package/src/components/ui/{carousel.tsx → carousel.client.tsx} +12 -12
- package/src/components/ui/chart.client.tsx +105 -103
- package/src/components/ui/checkbox.client.tsx +28 -0
- package/src/components/ui/collapsible.client.tsx +2 -2
- package/src/components/ui/combobox-dropdown.client.tsx +3 -2
- package/src/components/ui/combobox.client.tsx +7 -7
- package/src/components/ui/command.client.tsx +179 -0
- package/src/components/ui/{context-menu.tsx → context-menu.client.tsx} +86 -64
- package/src/components/ui/date-picker.client.tsx +2 -2
- package/src/components/ui/dialog.client.tsx +43 -20
- package/src/components/ui/drawer.client.tsx +13 -15
- package/src/components/ui/{dropdown-menu.tsx → dropdown-menu.client.tsx} +45 -24
- package/src/components/ui/empty.tsx +93 -0
- package/src/components/ui/field.client.tsx +224 -0
- package/src/components/ui/form.client.tsx +4 -4
- package/src/components/ui/hover-card.client.tsx +14 -13
- package/src/components/ui/{input-date-time.tsx → input-date-time.client.tsx} +6 -1
- package/src/components/ui/input-date.tsx +1 -1
- package/src/components/ui/input-group.client.tsx +191 -0
- package/src/components/ui/input-recipient.tsx +12 -12
- package/src/components/ui/input-time.tsx +1 -1
- package/src/components/ui/input.tsx +2 -4
- package/src/components/ui/item.tsx +182 -0
- package/src/components/ui/kbd.tsx +26 -0
- package/src/components/ui/label.tsx +2 -3
- package/src/components/ui/loader.tsx +51 -0
- package/src/components/ui/navigation-menu.tsx +14 -17
- package/src/components/ui/pagination.tsx +31 -26
- package/src/components/ui/popover.client.tsx +73 -0
- package/src/components/ui/progress.client.tsx +6 -4
- package/src/components/ui/radio-group.tsx +5 -7
- package/src/components/ui/resizable.client.tsx +9 -19
- package/src/components/ui/scroll-area.tsx +5 -7
- package/src/components/ui/select.client.tsx +40 -22
- package/src/components/ui/separator.tsx +3 -4
- package/src/components/ui/sheet.client.tsx +19 -18
- package/src/components/ui/sidebar.client.tsx +27 -27
- package/src/components/ui/skeleton.tsx +1 -1
- package/src/components/ui/slider.tsx +5 -10
- package/src/components/ui/spinner.tsx +12 -48
- package/src/components/ui/switch.client.tsx +32 -0
- package/src/components/ui/tabs.client.tsx +79 -0
- package/src/components/ui/textarea.tsx +1 -2
- package/src/components/ui/toggle-group.client.tsx +26 -10
- package/src/components/ui/toggle.client.tsx +44 -0
- package/src/components/ui/tooltip.client.tsx +4 -9
- package/src/entry.ts +12 -51
- package/src/lib/entry.ts +1 -5
- package/src/lib/hooks/use-indicator.tsx +4 -7
- package/src/lib/utils/markdown.ts +10 -0
- package/src/lib/utils/url.ts +2 -1
- package/src/lib/utils/user-agent.ts +15 -0
- package/src/modules/auth/components/auth-layout.server.tsx +2 -2
- package/src/modules/auth/components/{guard-first-user.server.tsx → create-first-user-guard.server.tsx} +8 -8
- package/src/modules/auth/components/create-first-user-page.client.tsx +4 -4
- package/src/modules/auth/components/forget-password-page.client.tsx +1 -1
- package/src/modules/auth/components/guard.server.tsx +1 -1
- package/src/modules/auth/components/login-page.client.tsx +6 -6
- package/src/modules/auth/components/reset-password-page.client.tsx +7 -7
- package/src/modules/auth/entry.server.ts +4 -5
- package/src/modules/auth/handler/create-client.client.ts +2 -2
- package/src/modules/auth/handler/proxy.server.ts +1 -1
- package/src/modules/auth/handler/route.server.ts +2 -2
- package/src/modules/auth/handler/{init.ts → service.server.ts} +30 -9
- package/src/modules/commands/components/alert-dialog-command.client.tsx +20 -16
- package/src/modules/commands/components/click-command.client.tsx +2 -2
- package/src/modules/commands/components/dialog-command.client.tsx +11 -10
- package/src/modules/commands/components/dropdown-command.client.tsx +2 -2
- package/src/modules/commands/components/empty-command.client.tsx +2 -2
- package/src/modules/commands/components/form-dialog-command.client.tsx +29 -13
- package/src/modules/commands/menus/context-menu.client.tsx +3 -4
- package/src/modules/commands/menus/dropdown-menu.client.tsx +2 -2
- package/src/modules/commands/menus/floating-menu.client.tsx +2 -2
- package/src/modules/commands/utils/archive-command.client.tsx +1 -1
- package/src/modules/commands/utils/delete-command.client.tsx +1 -1
- package/src/modules/config/entry.server.ts +0 -9
- package/src/modules/config/entry.ts +2 -2
- package/src/modules/config/lib/context.ts +9 -9
- package/src/modules/data-tables/components/cell/select.client.tsx +1 -1
- package/src/modules/data-tables/components/column-header.tsx +5 -5
- package/src/modules/data-tables/components/filters/combobox.client.tsx +6 -6
- package/src/modules/data-tables/components/filters/slider.client.tsx +2 -2
- package/src/modules/data-tables/components/header.tsx +1 -1
- package/src/modules/data-tables/components/skeleton.tsx +2 -2
- package/src/modules/data-tables/components/table.tsx +3 -3
- package/src/modules/data-tables/components/toolbar.tsx +1 -1
- package/src/modules/data-tables/entry.client.ts +1 -0
- package/src/modules/data-tables/server/get-data.server.ts +1 -1
- package/src/modules/data-tables/strategies/infinite/strategy.ts +4 -1
- package/src/modules/data-tables/strategies/pagination/components.tsx +3 -3
- package/src/modules/data-tables/tables/data-table/components/row.tsx +12 -21
- package/src/modules/data-tables/tables/inline-table/components/body.tsx +1 -1
- package/src/modules/data-tables/tables/inline-table/components/cells/common.tsx +1 -1
- package/src/modules/data-tables/tables/inline-table/components/cells/drag-handle.client.tsx +1 -1
- package/src/modules/data-tables/tables/inline-table/components/cells/read-only.tsx +1 -1
- package/src/modules/data-tables/tables/inline-table/components/row.client.tsx +24 -30
- package/src/modules/data-tables/tables/inline-table/components/table.tsx +6 -1
- package/src/modules/data-tables/tables/inline-table/hooks/context.client.tsx +5 -0
- package/src/modules/data-tables/tables/inline-table/hooks/use-hotkeys.client.ts +119 -91
- package/src/modules/database/entry.client.ts +0 -0
- package/src/modules/database/entry.server.ts +4 -0
- package/src/modules/database/entry.ts +5 -0
- package/src/modules/database/lib/service.server.ts +33 -0
- package/src/modules/emails/entry.client.ts +0 -0
- package/src/modules/emails/entry.server.ts +4 -0
- package/src/modules/emails/entry.ts +0 -0
- package/src/modules/emails/lib/service.server.ts +29 -0
- package/src/modules/inline-edit/components/date-input.client.tsx +4 -4
- package/src/modules/inline-edit/components/date-picker.client.tsx +3 -2
- package/src/modules/inline-edit/components/date-time.client.tsx +2 -1
- package/src/modules/inline-edit/components/editor.client.tsx +3 -0
- package/src/modules/inline-edit/components/input-recipient.client.tsx +1 -0
- package/src/modules/inline-edit/components/input-toggle.client.tsx +3 -2
- package/src/modules/inline-edit/components/input.client.tsx +6 -3
- package/src/modules/inline-edit/components/select.client.tsx +11 -21
- package/src/modules/inline-edit/components/switch.client.tsx +4 -3
- package/src/modules/inline-edit/components/toggle.client.tsx +2 -1
- package/src/modules/inline-edit/lib/variants.ts +1 -1
- package/src/modules/router/handler/init.server.ts +2 -2
- package/src/modules/storage/components/dropzone.client.tsx +9 -9
- package/src/modules/storage/components/image-grid.client.tsx +28 -25
- package/src/modules/storage/components/image.client.tsx +8 -0
- package/src/modules/storage/components/upload-zone-context.client.tsx +11 -8
- package/src/modules/storage/components/upload-zone.client.tsx +23 -17
- package/src/modules/storage/entry.client.ts +3 -1
- package/src/modules/storage/entry.server.ts +9 -3
- package/src/modules/storage/entry.ts +13 -1
- package/src/modules/storage/lib/constants.ts +0 -11
- package/src/modules/storage/lib/helpers.ts +18 -65
- package/src/modules/storage/lib/procedures.server.ts +60 -0
- package/src/modules/storage/lib/router-handlers.server.ts +178 -0
- package/src/modules/storage/lib/schema.ts +26 -97
- package/src/modules/storage/lib/service.server.ts +636 -374
- package/src/modules/storage/lib/upload.client.ts +156 -0
- package/src/modules/storage/lib/validators.ts +50 -111
- package/src/modules/storage/providers/adapters/s3.server.ts +281 -0
- package/src/modules/storage/providers/lib/constants.ts +3 -0
- package/src/modules/storage/providers/lib/errors.ts +21 -0
- package/src/modules/storage/providers/lib/types.ts +28 -0
- package/src/modules/storage/providers/lib/validators.ts +122 -0
- package/src/styles.css +1 -3
- package/dist/components/ui/accordion.d.mts +0 -25
- package/dist/components/ui/accordion.d.mts.map +0 -1
- package/dist/components/ui/accordion.mjs +0 -46
- package/dist/components/ui/accordion.mjs.map +0 -1
- package/dist/components/ui/alert-dialog.d.mts +0 -43
- package/dist/components/ui/alert-dialog.d.mts.map +0 -1
- package/dist/components/ui/alert-dialog.mjs +0 -84
- package/dist/components/ui/alert-dialog.mjs.map +0 -1
- package/dist/components/ui/aspect-ratio.d.mts +0 -8
- package/dist/components/ui/aspect-ratio.d.mts.map +0 -1
- package/dist/components/ui/aspect-ratio.mjs +0 -16
- package/dist/components/ui/aspect-ratio.mjs.map +0 -1
- package/dist/components/ui/calendar.d.mts.map +0 -1
- package/dist/components/ui/calendar.mjs.map +0 -1
- package/dist/components/ui/carousel.d.mts.map +0 -1
- package/dist/components/ui/carousel.mjs.map +0 -1
- package/dist/components/ui/checkbox.d.mts +0 -12
- package/dist/components/ui/checkbox.d.mts.map +0 -1
- package/dist/components/ui/checkbox.mjs +0 -24
- package/dist/components/ui/checkbox.mjs.map +0 -1
- package/dist/components/ui/command.d.mts.map +0 -1
- package/dist/components/ui/command.mjs +0 -88
- package/dist/components/ui/command.mjs.map +0 -1
- package/dist/components/ui/context-menu.d.mts +0 -77
- package/dist/components/ui/context-menu.d.mts.map +0 -1
- package/dist/components/ui/context-menu.mjs +0 -125
- package/dist/components/ui/context-menu.mjs.map +0 -1
- package/dist/components/ui/dropdown-menu.d.mts +0 -78
- package/dist/components/ui/dropdown-menu.d.mts.map +0 -1
- package/dist/components/ui/dropdown-menu.mjs +0 -126
- package/dist/components/ui/dropdown-menu.mjs.map +0 -1
- package/dist/components/ui/input-date-time.d.mts.map +0 -1
- package/dist/components/ui/input-date-time.mjs.map +0 -1
- package/dist/components/ui/popover.d.mts +0 -23
- package/dist/components/ui/popover.d.mts.map +0 -1
- package/dist/components/ui/popover.mjs +0 -38
- package/dist/components/ui/popover.mjs.map +0 -1
- package/dist/components/ui/switch.d.mts +0 -12
- package/dist/components/ui/switch.d.mts.map +0 -1
- package/dist/components/ui/switch.mjs +0 -22
- package/dist/components/ui/switch.mjs.map +0 -1
- package/dist/components/ui/tabs.d.mts +0 -24
- package/dist/components/ui/tabs.d.mts.map +0 -1
- package/dist/components/ui/tabs.mjs +0 -39
- package/dist/components/ui/tabs.mjs.map +0 -1
- package/dist/components/ui/toggle.d.mts.map +0 -1
- package/dist/components/ui/toggle.mjs +0 -40
- package/dist/components/ui/toggle.mjs.map +0 -1
- package/dist/lib/config/constants.d.mts +0 -5
- package/dist/lib/config/constants.d.mts.map +0 -1
- package/dist/lib/config/constants.mjs +0 -6
- package/dist/lib/config/constants.mjs.map +0 -1
- package/dist/modules/auth/components/guard-first-user.server.d.mts +0 -18
- package/dist/modules/auth/components/guard-first-user.server.d.mts.map +0 -1
- package/dist/modules/auth/components/guard-first-user.server.mjs +0 -16
- package/dist/modules/auth/components/guard-first-user.server.mjs.map +0 -1
- package/dist/modules/auth/handler/init.mjs.map +0 -1
- package/dist/modules/config/db/helpers.d.mts.map +0 -1
- package/dist/modules/config/db/helpers.mjs.map +0 -1
- package/dist/modules/config/db/init.d.mts +0 -20
- package/dist/modules/config/db/init.d.mts.map +0 -1
- package/dist/modules/config/db/init.mjs +0 -15
- package/dist/modules/config/db/init.mjs.map +0 -1
- package/dist/modules/config/db/types.d.mts.map +0 -1
- package/dist/modules/config/providers/email.d.mts +0 -12
- package/dist/modules/config/providers/email.d.mts.map +0 -1
- package/dist/modules/config/providers/email.mjs +0 -11
- package/dist/modules/config/providers/email.mjs.map +0 -1
- package/dist/modules/storage/config/filters.d.mts +0 -17
- package/dist/modules/storage/config/filters.d.mts.map +0 -1
- package/dist/modules/storage/config/filters.mjs +0 -17
- package/dist/modules/storage/config/filters.mjs.map +0 -1
- package/dist/modules/storage/lib/create-client.server.d.mts +0 -11
- package/dist/modules/storage/lib/create-client.server.d.mts.map +0 -1
- package/dist/modules/storage/lib/create-client.server.mjs +0 -11
- package/dist/modules/storage/lib/create-client.server.mjs.map +0 -1
- package/dist/modules/storage/lib/create-upload.client.d.mts +0 -56
- package/dist/modules/storage/lib/create-upload.client.d.mts.map +0 -1
- package/dist/modules/storage/lib/create-upload.client.mjs +0 -98
- package/dist/modules/storage/lib/create-upload.client.mjs.map +0 -1
- package/dist/modules/storage/lib/proxy.server.d.mts +0 -21
- package/dist/modules/storage/lib/proxy.server.d.mts.map +0 -1
- package/dist/modules/storage/lib/proxy.server.mjs +0 -46
- package/dist/modules/storage/lib/proxy.server.mjs.map +0 -1
- package/dist/modules/storage/lib/router.server.d.mts +0 -31002
- package/dist/modules/storage/lib/router.server.d.mts.map +0 -1
- package/dist/modules/storage/lib/router.server.mjs +0 -86
- package/dist/modules/storage/lib/router.server.mjs.map +0 -1
- package/src/components/ui/accordion.tsx +0 -63
- package/src/components/ui/alert-dialog.tsx +0 -133
- package/src/components/ui/aspect-ratio.tsx +0 -9
- package/src/components/ui/checkbox.tsx +0 -29
- package/src/components/ui/command.tsx +0 -154
- package/src/components/ui/popover.tsx +0 -42
- package/src/components/ui/switch.tsx +0 -28
- package/src/components/ui/tabs.tsx +0 -54
- package/src/components/ui/toggle.tsx +0 -46
- package/src/lib/config/constants.ts +0 -1
- package/src/lib/utils/time-picker.ts +0 -139
- package/src/modules/config/db/init.ts +0 -21
- package/src/modules/config/providers/email.ts +0 -13
- package/src/modules/storage/config/filters.ts +0 -12
- package/src/modules/storage/lib/create-client.server.ts +0 -14
- package/src/modules/storage/lib/create-upload.client.ts +0 -134
- package/src/modules/storage/lib/proxy.server.ts +0 -63
- package/src/modules/storage/lib/router.server.ts +0 -182
- /package/src/modules/{config/db → database/lib}/helpers.ts +0 -0
- /package/src/modules/{config/db → database/lib}/types.ts +0 -0
|
@@ -46,6 +46,9 @@ export function InlineEditor<Required extends boolean = false>({
|
|
|
46
46
|
className={cn(inlineEditVariants({ variant, status }), className)}
|
|
47
47
|
disabled={disabled || !isAllowed}
|
|
48
48
|
variant={variant}
|
|
49
|
+
attributes={{
|
|
50
|
+
"data-inline-input": "editor",
|
|
51
|
+
}}
|
|
49
52
|
>
|
|
50
53
|
{children}
|
|
51
54
|
</Editor>
|
|
@@ -50,12 +50,13 @@ export function InlineStringInputToggle<Required extends boolean>({
|
|
|
50
50
|
<div className="relative">
|
|
51
51
|
<Input
|
|
52
52
|
{...props}
|
|
53
|
+
data-inline-input="input-toggle"
|
|
53
54
|
type="text"
|
|
54
55
|
value={value ?? undefined}
|
|
55
56
|
disabled={isDisabled}
|
|
56
57
|
onChange={(e) => handleChange(e.target.value ? e.target.value : null)}
|
|
57
58
|
onBlur={(e) => handleBlur(e.target.value ? e.target.value : null)}
|
|
58
|
-
className={cn("border-border/70 hover:border-border
|
|
59
|
+
className={cn("w-full border-border/70 hover:border-border", className)}
|
|
59
60
|
/>
|
|
60
61
|
|
|
61
62
|
<Button
|
|
@@ -63,7 +64,7 @@ export function InlineStringInputToggle<Required extends boolean>({
|
|
|
63
64
|
onClick={handleToggle}
|
|
64
65
|
tabIndex={-1}
|
|
65
66
|
className={cn(
|
|
66
|
-
"absolute
|
|
67
|
+
"absolute top-0 right-0 bottom-0 opacity-50",
|
|
67
68
|
!value && "text-muted-foreground",
|
|
68
69
|
)}
|
|
69
70
|
>
|
|
@@ -42,13 +42,14 @@ export function InlineStringInput<Required extends boolean = false>({
|
|
|
42
42
|
return (
|
|
43
43
|
<Input
|
|
44
44
|
{...props}
|
|
45
|
+
data-inline-input="string"
|
|
45
46
|
type="text"
|
|
46
47
|
value={value ?? undefined}
|
|
47
48
|
disabled={disabled || !isAllowed}
|
|
48
49
|
onChange={(e) => handleChange(e.target.value ? e.target.value : null)}
|
|
49
50
|
onBlur={(e) => handleBlur(e.target.value ? e.target.value : null)}
|
|
50
51
|
className={cn(
|
|
51
|
-
"border-border/70 hover:border-border
|
|
52
|
+
"w-full border-border/70 hover:border-border",
|
|
52
53
|
inlineEditVariants({ variant, status }),
|
|
53
54
|
className,
|
|
54
55
|
)}
|
|
@@ -88,13 +89,14 @@ export function InlineNumberInput<Required extends boolean = false>({
|
|
|
88
89
|
return (
|
|
89
90
|
<Input
|
|
90
91
|
{...props}
|
|
92
|
+
data-inline-input="number"
|
|
91
93
|
type="number"
|
|
92
94
|
value={value ?? undefined}
|
|
93
95
|
disabled={disabled || !isAllowed}
|
|
94
96
|
onChange={(e) => handleChange(parseValueAsNumber(e.target.valueAsNumber))}
|
|
95
97
|
onBlur={(e) => handleBlur(parseValueAsNumber(e.target.valueAsNumber))}
|
|
96
98
|
className={cn(
|
|
97
|
-
"border-border/70 hover:border-border
|
|
99
|
+
"w-full border-border/70 hover:border-border",
|
|
98
100
|
inlineEditVariants({ variant, status }),
|
|
99
101
|
className,
|
|
100
102
|
)}
|
|
@@ -131,13 +133,14 @@ export function InlineDecimalInput({
|
|
|
131
133
|
return (
|
|
132
134
|
<Input
|
|
133
135
|
{...props}
|
|
136
|
+
data-inline-input="decimal"
|
|
134
137
|
type="number"
|
|
135
138
|
value={value ?? undefined}
|
|
136
139
|
disabled={disabled || !isAllowed}
|
|
137
140
|
onChange={(e) => handleChange(e.target.value ? e.target.value : null)}
|
|
138
141
|
onBlur={(e) => handleBlur(e.target.value ? e.target.value : null)}
|
|
139
142
|
className={cn(
|
|
140
|
-
"border-border/70 hover:border-border
|
|
143
|
+
"w-full border-border/70 hover:border-border",
|
|
141
144
|
inlineEditVariants({ variant, status }),
|
|
142
145
|
className,
|
|
143
146
|
)}
|
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
-
import type {
|
|
4
|
-
SelectContentProps,
|
|
5
|
-
SelectItemProps,
|
|
6
|
-
SelectProps,
|
|
7
|
-
SelectTriggerProps,
|
|
8
|
-
SelectValueProps,
|
|
9
|
-
} from "@radix-ui/react-select";
|
|
3
|
+
import type { ComponentProps } from "react";
|
|
10
4
|
import {
|
|
11
5
|
Select,
|
|
12
6
|
SelectContent,
|
|
@@ -27,7 +21,7 @@ export function InlineSelect<Required extends boolean = false>({
|
|
|
27
21
|
isRequired,
|
|
28
22
|
disabled,
|
|
29
23
|
...props
|
|
30
|
-
}:
|
|
24
|
+
}: ComponentProps<typeof Select> & useInlineEditOptions<string, Required>) {
|
|
31
25
|
const { value, handleChange, handleBlur, isAllowed } = useInlineEdit({
|
|
32
26
|
initialValue,
|
|
33
27
|
action,
|
|
@@ -53,34 +47,30 @@ export function InlineSelect<Required extends boolean = false>({
|
|
|
53
47
|
);
|
|
54
48
|
}
|
|
55
49
|
|
|
56
|
-
export type InlineSelectTriggerProps = SelectTriggerProps;
|
|
57
|
-
|
|
58
50
|
export function InlineSelectTrigger({
|
|
59
51
|
variant,
|
|
60
52
|
className,
|
|
61
53
|
...props
|
|
62
|
-
}:
|
|
54
|
+
}: ComponentProps<typeof SelectTrigger> & InlineEditVariantsProps) {
|
|
63
55
|
const { status } = useIndicator();
|
|
64
56
|
|
|
65
57
|
return (
|
|
66
|
-
<SelectTrigger
|
|
58
|
+
<SelectTrigger
|
|
59
|
+
{...props}
|
|
60
|
+
data-inline-input="select"
|
|
61
|
+
className={cn(inlineEditVariants({ variant, status }), className)}
|
|
62
|
+
/>
|
|
67
63
|
);
|
|
68
64
|
}
|
|
69
65
|
|
|
70
|
-
export
|
|
71
|
-
|
|
72
|
-
export function InlineSelectContent(props: InlineSelectContentProps) {
|
|
66
|
+
export function InlineSelectContent(props: ComponentProps<typeof SelectContent>) {
|
|
73
67
|
return <SelectContent {...props} />;
|
|
74
68
|
}
|
|
75
69
|
|
|
76
|
-
export
|
|
77
|
-
|
|
78
|
-
export function InlineSelectValue(props: InlineSelectValueProps) {
|
|
70
|
+
export function InlineSelectValue(props: ComponentProps<typeof SelectValue>) {
|
|
79
71
|
return <SelectValue {...props} />;
|
|
80
72
|
}
|
|
81
73
|
|
|
82
|
-
export
|
|
83
|
-
|
|
84
|
-
export function InlineSelectItem(props: InlineSelectItenProps) {
|
|
74
|
+
export function InlineSelectItem(props: ComponentProps<typeof SelectItem>) {
|
|
85
75
|
return <SelectItem {...props} />;
|
|
86
76
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
-
import type {
|
|
4
|
-
import { Switch } from "@/components/ui/switch";
|
|
3
|
+
import type { ComponentProps } from "react";
|
|
4
|
+
import { Switch } from "@/components/ui/switch.client";
|
|
5
5
|
import { useInlineEdit, type useInlineEditOptions } from "../hooks/use-inline.client";
|
|
6
6
|
|
|
7
7
|
export function InlineSwitch<Required extends boolean = false>({
|
|
@@ -12,7 +12,7 @@ export function InlineSwitch<Required extends boolean = false>({
|
|
|
12
12
|
isRequired,
|
|
13
13
|
disabled,
|
|
14
14
|
...props
|
|
15
|
-
}:
|
|
15
|
+
}: ComponentProps<typeof Switch> & useInlineEditOptions<boolean, Required>) {
|
|
16
16
|
const { value, handleChange, handleBlur, isAllowed } = useInlineEdit({
|
|
17
17
|
initialValue,
|
|
18
18
|
action,
|
|
@@ -28,6 +28,7 @@ export function InlineSwitch<Required extends boolean = false>({
|
|
|
28
28
|
return (
|
|
29
29
|
<Switch
|
|
30
30
|
{...props}
|
|
31
|
+
data-inline-input="switch"
|
|
31
32
|
disabled={disabled || !isAllowed}
|
|
32
33
|
defaultChecked={value ?? undefined}
|
|
33
34
|
onCheckedChange={(checked) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import type React from "react";
|
|
4
|
-
import { Toggle } from "@/components/ui/toggle";
|
|
4
|
+
import { Toggle } from "@/components/ui/toggle.client";
|
|
5
5
|
import { cn } from "@/lib/utils/cn";
|
|
6
6
|
import { useInlineEdit, type useInlineEditOptions } from "../hooks/use-inline.client";
|
|
7
7
|
|
|
@@ -33,6 +33,7 @@ export function InlineToggle<Required extends boolean = false>({
|
|
|
33
33
|
return (
|
|
34
34
|
<div {...props} className={cn("flex flex-wrap items-center justify-start gap-1", className)}>
|
|
35
35
|
<Toggle
|
|
36
|
+
data-inline-input="toggle"
|
|
36
37
|
disabled={!isAllowed}
|
|
37
38
|
variant="outline"
|
|
38
39
|
pressed={value ?? undefined}
|
|
@@ -5,7 +5,7 @@ export const inlineEditVariants = cva("", {
|
|
|
5
5
|
variant: {
|
|
6
6
|
default: "",
|
|
7
7
|
table:
|
|
8
|
-
"min-h-
|
|
8
|
+
"min-h-8 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
10
|
status: {
|
|
11
11
|
idle: "",
|
|
@@ -33,7 +33,7 @@ export function initRPC<TSchema extends TDatabaseSchema>() {
|
|
|
33
33
|
/**
|
|
34
34
|
* Middleware function to check if the user has the required permission
|
|
35
35
|
*/
|
|
36
|
-
function permissionMiddleware(
|
|
36
|
+
function permissionMiddleware(permissions: Permission) {
|
|
37
37
|
/**
|
|
38
38
|
* Middleware function to check if the user has the required permission
|
|
39
39
|
*/
|
|
@@ -41,7 +41,7 @@ export function initRPC<TSchema extends TDatabaseSchema>() {
|
|
|
41
41
|
const { success, error } = await opts.context.auth.api.userHasPermission({
|
|
42
42
|
body: {
|
|
43
43
|
userId: opts.context.session.user.id,
|
|
44
|
-
|
|
44
|
+
permissions,
|
|
45
45
|
},
|
|
46
46
|
});
|
|
47
47
|
|
|
@@ -6,7 +6,7 @@ import type { DropEvent, DropzoneOptions, FileRejection } from "react-dropzone";
|
|
|
6
6
|
import { useDropzone } from "react-dropzone";
|
|
7
7
|
import { Button } from "@/components/ui/button";
|
|
8
8
|
import { cn } from "@/lib/utils/cn";
|
|
9
|
-
import { renderBytes } from "
|
|
9
|
+
import { renderBytes } from "../lib/helpers";
|
|
10
10
|
import { DropzoneContext, useDropzoneContext } from "./dropzone-context.client";
|
|
11
11
|
|
|
12
12
|
/**
|
|
@@ -55,7 +55,7 @@ export function Dropzone({
|
|
|
55
55
|
<Button
|
|
56
56
|
className={cn(
|
|
57
57
|
"relative h-auto w-full flex-col overflow-hidden p-8",
|
|
58
|
-
isDragActive && "
|
|
58
|
+
isDragActive && "outline-none ring-1 ring-ring",
|
|
59
59
|
className,
|
|
60
60
|
)}
|
|
61
61
|
disabled={disabled}
|
|
@@ -88,11 +88,11 @@ export function DropzoneContent({ children, className }: DropzoneContentProps) {
|
|
|
88
88
|
|
|
89
89
|
return (
|
|
90
90
|
<div className={cn("flex flex-col items-center justify-center", className)}>
|
|
91
|
-
<div className="
|
|
91
|
+
<div className="flex size-8 items-center justify-center rounded-md bg-muted text-muted-foreground">
|
|
92
92
|
<UploadIcon size={16} />
|
|
93
93
|
</div>
|
|
94
94
|
|
|
95
|
-
<p className="my-2 w-full truncate text-sm
|
|
95
|
+
<p className="my-2 w-full truncate font-medium text-sm">
|
|
96
96
|
{src.length > maxLabelItems
|
|
97
97
|
? `${new Intl.ListFormat("en").format(
|
|
98
98
|
src.slice(0, maxLabelItems).map((file) => file.name),
|
|
@@ -100,7 +100,7 @@ export function DropzoneContent({ children, className }: DropzoneContentProps) {
|
|
|
100
100
|
: new Intl.ListFormat("en").format(src.map((file) => file.name))}
|
|
101
101
|
</p>
|
|
102
102
|
|
|
103
|
-
<p className="
|
|
103
|
+
<p className="w-full text-wrap text-muted-foreground text-xs">
|
|
104
104
|
Drag and drop or click to replace
|
|
105
105
|
</p>
|
|
106
106
|
</div>
|
|
@@ -137,16 +137,16 @@ export function DropzoneEmptyState({ children, className }: DropzoneEmptyStatePr
|
|
|
137
137
|
}
|
|
138
138
|
return (
|
|
139
139
|
<div className={cn("flex flex-col items-center justify-center", className)}>
|
|
140
|
-
<div className="
|
|
140
|
+
<div className="flex size-8 items-center justify-center rounded-md bg-muted text-muted-foreground">
|
|
141
141
|
<UploadIcon size={16} />
|
|
142
142
|
</div>
|
|
143
|
-
<p className="my-2 w-full truncate text-wrap text-sm
|
|
143
|
+
<p className="my-2 w-full truncate text-wrap font-medium text-sm">
|
|
144
144
|
Upload {maxFiles === 1 ? "a file" : "files"}
|
|
145
145
|
</p>
|
|
146
|
-
<p className="
|
|
146
|
+
<p className="w-full truncate text-wrap text-muted-foreground text-xs">
|
|
147
147
|
Drag and drop or click to upload
|
|
148
148
|
</p>
|
|
149
|
-
{caption && <p className="text-muted-foreground text-
|
|
149
|
+
{caption && <p className="text-wrap text-muted-foreground text-xs">{caption}.</p>}
|
|
150
150
|
</div>
|
|
151
151
|
);
|
|
152
152
|
}
|
|
@@ -18,7 +18,6 @@ import {
|
|
|
18
18
|
} from "@dnd-kit/sortable";
|
|
19
19
|
import { CSS } from "@dnd-kit/utilities";
|
|
20
20
|
import { GripIcon, UploadIcon } from "lucide-react";
|
|
21
|
-
import Image from "next/image";
|
|
22
21
|
import React, { type ComponentProps } from "react";
|
|
23
22
|
import { Icons } from "@/components/common/icons";
|
|
24
23
|
import { Button } from "@/components/ui/button";
|
|
@@ -29,21 +28,22 @@ import {
|
|
|
29
28
|
CarouselItem,
|
|
30
29
|
CarouselNext,
|
|
31
30
|
CarouselPrevious,
|
|
32
|
-
} from "@/components/ui/carousel";
|
|
31
|
+
} from "@/components/ui/carousel.client";
|
|
33
32
|
import { Dialog, DialogContent, DialogTrigger } from "@/components/ui/dialog.client";
|
|
34
33
|
import { Input } from "@/components/ui/input";
|
|
35
34
|
import { Skeleton } from "@/components/ui/skeleton";
|
|
36
35
|
import { useAction } from "@/lib/entry.client";
|
|
37
36
|
import { cn } from "@/lib/utils/cn";
|
|
38
|
-
import {
|
|
39
|
-
import type {
|
|
37
|
+
import { getAssetURL } from "../lib/helpers";
|
|
38
|
+
import type { StorageAsset } from "../lib/validators";
|
|
39
|
+
import { StorageImage } from "./image.client";
|
|
40
40
|
import { useUploadZone } from "./upload-zone-context.client";
|
|
41
41
|
|
|
42
42
|
/**
|
|
43
43
|
* Image Grid
|
|
44
44
|
*/
|
|
45
45
|
type ImageGridProps = ComponentProps<"div"> & {
|
|
46
|
-
|
|
46
|
+
assets: StorageAsset[];
|
|
47
47
|
disabled?: boolean;
|
|
48
48
|
moveAction: (params: { fromIndex: number; toIndex: number }) => Promise<void>;
|
|
49
49
|
optimistic?: {
|
|
@@ -51,10 +51,10 @@ type ImageGridProps = ComponentProps<"div"> & {
|
|
|
51
51
|
};
|
|
52
52
|
};
|
|
53
53
|
|
|
54
|
-
export function ImageGrid({
|
|
54
|
+
export function ImageGrid({ assets, moveAction, optimistic, disabled, ...props }: ImageGridProps) {
|
|
55
55
|
const uploadZone = useUploadZone();
|
|
56
56
|
|
|
57
|
-
const images =
|
|
57
|
+
const images = assets.flatMap((asset) => ({ ...asset, url: getAssetURL(asset.id) }));
|
|
58
58
|
|
|
59
59
|
const [current, setCurrent] = React.useState<number>(0);
|
|
60
60
|
|
|
@@ -101,14 +101,14 @@ export function ImageGrid({ nodes, moveAction, optimistic, disabled, ...props }:
|
|
|
101
101
|
className="grid grid-cols-[repeat(auto-fill,minmax(10rem,1fr))] gap-5"
|
|
102
102
|
>
|
|
103
103
|
<SortableContext items={images.map((image) => image.id)} strategy={rectSortingStrategy}>
|
|
104
|
-
{images.map((
|
|
105
|
-
<ImageGridItem key={
|
|
104
|
+
{images.map((asset, index) => (
|
|
105
|
+
<ImageGridItem key={asset.id} asset={asset} index={index} setCurrent={setCurrent} />
|
|
106
106
|
))}
|
|
107
107
|
|
|
108
108
|
{!disabled && (
|
|
109
109
|
<label
|
|
110
110
|
htmlFor="file-upload"
|
|
111
|
-
className="
|
|
111
|
+
className="relative flex aspect-square w-full cursor-pointer flex-col items-center justify-center rounded-lg border border-muted-foreground border-dashed bg-muted hover:border-primary"
|
|
112
112
|
>
|
|
113
113
|
<UploadIcon className="h-8 w-8" />
|
|
114
114
|
<Input
|
|
@@ -133,13 +133,12 @@ export function ImageGrid({ nodes, moveAction, optimistic, disabled, ...props }:
|
|
|
133
133
|
<CarouselContent className="md:max-h-[80vh]">
|
|
134
134
|
{images.map(({ id, url }) => (
|
|
135
135
|
<CarouselItem key={id} className="overflow-hidden rounded-xl">
|
|
136
|
-
<
|
|
136
|
+
<StorageImage
|
|
137
137
|
src={url}
|
|
138
138
|
alt="Image Preview"
|
|
139
139
|
width={1920}
|
|
140
140
|
height={1080}
|
|
141
141
|
className="h-full w-full rounded-xl object-contain"
|
|
142
|
-
loader={imageLoader}
|
|
143
142
|
/>
|
|
144
143
|
</CarouselItem>
|
|
145
144
|
))}
|
|
@@ -156,36 +155,40 @@ export function ImageGrid({ nodes, moveAction, optimistic, disabled, ...props }:
|
|
|
156
155
|
* Image Grid Item
|
|
157
156
|
*/
|
|
158
157
|
type ImageGridItemProps = {
|
|
159
|
-
|
|
158
|
+
asset: StorageAsset & { url: string };
|
|
160
159
|
index: number;
|
|
161
160
|
setCurrent: React.Dispatch<React.SetStateAction<number>>;
|
|
162
161
|
};
|
|
163
162
|
|
|
164
|
-
function ImageGridItem({
|
|
163
|
+
function ImageGridItem({ asset, index, setCurrent }: ImageGridItemProps) {
|
|
165
164
|
const uploadZone = useUploadZone();
|
|
166
165
|
|
|
167
|
-
const { attributes, listeners, setNodeRef, transform, transition } = useSortable({
|
|
166
|
+
const { attributes, listeners, setNodeRef, transform, transition } = useSortable({
|
|
167
|
+
id: asset.id,
|
|
168
|
+
});
|
|
168
169
|
|
|
169
170
|
return (
|
|
170
171
|
<Card
|
|
171
|
-
id={
|
|
172
|
+
id={asset.id}
|
|
172
173
|
ref={setNodeRef}
|
|
173
174
|
style={{
|
|
174
175
|
transform: CSS.Transform.toString(transform),
|
|
175
176
|
transition,
|
|
176
177
|
}}
|
|
177
|
-
className={cn(
|
|
178
|
+
className={cn(
|
|
179
|
+
"group relative aspect-square w-full",
|
|
180
|
+
asset.status === "pending" && "opacity-30",
|
|
181
|
+
)}
|
|
178
182
|
>
|
|
179
|
-
{
|
|
183
|
+
{asset.status === "ready" ? (
|
|
180
184
|
<>
|
|
181
185
|
<DialogTrigger onClick={() => setCurrent(index)}>
|
|
182
|
-
<
|
|
183
|
-
src={
|
|
186
|
+
<StorageImage
|
|
187
|
+
src={asset.url}
|
|
184
188
|
alt="Image Preview"
|
|
185
189
|
width={100}
|
|
186
190
|
height={100}
|
|
187
|
-
className="
|
|
188
|
-
loader={imageLoader}
|
|
191
|
+
className="absolute inset-0 h-full w-full cursor-pointer rounded-lg bg-muted object-contain"
|
|
189
192
|
/>
|
|
190
193
|
</DialogTrigger>
|
|
191
194
|
|
|
@@ -195,7 +198,7 @@ function ImageGridItem({ node, index, setCurrent }: ImageGridItemProps) {
|
|
|
195
198
|
type="button"
|
|
196
199
|
variant="secondary"
|
|
197
200
|
size="icon"
|
|
198
|
-
className="absolute
|
|
201
|
+
className="absolute top-2 right-2 hidden p-1 group-hover:flex"
|
|
199
202
|
>
|
|
200
203
|
<GripIcon className="size-4" />
|
|
201
204
|
</Button>
|
|
@@ -204,8 +207,8 @@ function ImageGridItem({ node, index, setCurrent }: ImageGridItemProps) {
|
|
|
204
207
|
type="button"
|
|
205
208
|
variant="destructive"
|
|
206
209
|
size="icon"
|
|
207
|
-
onClick={() => uploadZone.onRemove([
|
|
208
|
-
className="absolute
|
|
210
|
+
onClick={() => uploadZone.onRemove([asset.id])}
|
|
211
|
+
className="absolute top-2 left-2 hidden p-1 group-hover:flex"
|
|
209
212
|
>
|
|
210
213
|
<Icons.trash className="size-4" />
|
|
211
214
|
</Button>
|
|
@@ -1,31 +1,34 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import React from "react";
|
|
4
|
-
import type { UploadClient } from "../lib/
|
|
5
|
-
import type {
|
|
4
|
+
import type { UploadClient } from "../lib/upload.client";
|
|
5
|
+
import type { StorageAsset } from "../lib/validators";
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Upload Zone Context Value
|
|
9
9
|
*/
|
|
10
10
|
export type UploadZoneContextValue = {
|
|
11
11
|
uploadClient: UploadClient;
|
|
12
|
-
onUpload: (file: File) => Promise<
|
|
12
|
+
onUpload: (file: File) => Promise<StorageAsset>;
|
|
13
13
|
onRemove: (ids: string[]) => Promise<void>;
|
|
14
14
|
optimistic?: {
|
|
15
|
-
add?: (
|
|
15
|
+
add?: (
|
|
16
|
+
newValue: Omit<
|
|
17
|
+
StorageAsset,
|
|
18
|
+
"id" | "key" | "bucket" | "provider" | "createdAt" | "updatedAt"
|
|
19
|
+
>,
|
|
20
|
+
) => Promise<void> | void;
|
|
16
21
|
remove?: (ids: string[]) => Promise<void> | void;
|
|
17
22
|
invalidate?: () => Promise<void> | void;
|
|
18
23
|
cancel?: () => Promise<void> | void;
|
|
19
24
|
};
|
|
20
25
|
disabled?: boolean;
|
|
21
|
-
// updateData: (newValue: FileNode[] | ((oldValue: FileNode[]) => FileNode[])) => Promise<void>;
|
|
22
|
-
// invalidateQuery: () => Promise<void> | void;
|
|
23
26
|
};
|
|
24
27
|
|
|
25
28
|
/**
|
|
26
29
|
* Upload Zone Context
|
|
27
30
|
*/
|
|
28
|
-
export const UploadZoneContext = React.createContext
|
|
31
|
+
export const UploadZoneContext = React.createContext<UploadZoneContextValue | null>(null);
|
|
29
32
|
|
|
30
33
|
/**
|
|
31
34
|
* Upload Zone Hook
|
|
@@ -33,7 +36,7 @@ export const UploadZoneContext = React.createContext({} as UploadZoneContextValu
|
|
|
33
36
|
export function useUploadZone() {
|
|
34
37
|
const context = React.useContext(UploadZoneContext);
|
|
35
38
|
if (!context) {
|
|
36
|
-
throw new Error("useUploadZone must be used within an
|
|
39
|
+
throw new Error("useUploadZone must be used within an UploadZoneContext provider");
|
|
37
40
|
}
|
|
38
41
|
return context;
|
|
39
42
|
}
|
|
@@ -5,16 +5,16 @@ import { useDropzone } from "react-dropzone";
|
|
|
5
5
|
import { toast } from "@/components/ui/sonner.client";
|
|
6
6
|
import { useAction } from "@/lib/hooks/use-action";
|
|
7
7
|
import { cn } from "@/lib/utils/cn";
|
|
8
|
-
import type { UploadFileRequest, UploadHooks } from "../lib/
|
|
9
|
-
import type {
|
|
8
|
+
import type { UploadFileRequest, UploadHooks } from "../lib/upload.client";
|
|
9
|
+
import type { StorageAsset, UploadInput } from "../lib/validators";
|
|
10
10
|
import { UploadZoneContext, type UploadZoneContextValue } from "./upload-zone-context.client";
|
|
11
11
|
|
|
12
12
|
export type UploadZoneProps = ComponentProps<"div"> &
|
|
13
13
|
Pick<UploadZoneContextValue, "optimistic" | "uploadClient" | "disabled"> & {
|
|
14
|
-
variables: Pick<
|
|
14
|
+
variables: Pick<UploadInput, "visibility">;
|
|
15
15
|
uploadHooks?: UploadHooks;
|
|
16
16
|
|
|
17
|
-
onUploadCompleted?: (
|
|
17
|
+
onUploadCompleted?: (asset: StorageAsset) => Promise<void> | void;
|
|
18
18
|
onUploadFailed?: (error: unknown) => Promise<void> | void;
|
|
19
19
|
};
|
|
20
20
|
|
|
@@ -34,7 +34,9 @@ export function UploadZone({
|
|
|
34
34
|
* Delete mutation
|
|
35
35
|
*/
|
|
36
36
|
const deleteMutation = useAction({
|
|
37
|
-
mutationFn: async (ids: string[]) =>
|
|
37
|
+
mutationFn: async (ids: string[]) => {
|
|
38
|
+
await uploadClient.deleteAssets(ids);
|
|
39
|
+
},
|
|
38
40
|
onMutate: async (ids) => {
|
|
39
41
|
await optimistic?.cancel?.();
|
|
40
42
|
await optimistic?.remove?.(ids);
|
|
@@ -54,30 +56,34 @@ export function UploadZone({
|
|
|
54
56
|
const uploadMutation = useAction({
|
|
55
57
|
mutationFn: async (params: UploadFileRequest) => uploadClient.upload(params, uploadHooks),
|
|
56
58
|
onMutate: async (variables) => {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
+
await optimistic?.cancel?.();
|
|
60
|
+
|
|
61
|
+
const newAsset = {
|
|
59
62
|
...variables,
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
+
visibility: variables.visibility ?? "private",
|
|
64
|
+
status: "pending",
|
|
65
|
+
name: variables.file.name,
|
|
66
|
+
size: variables.file.size,
|
|
67
|
+
contentType: variables.file.type || "application/octet-stream",
|
|
68
|
+
etag: null,
|
|
69
|
+
metadata: null,
|
|
70
|
+
uploadedAt: new Date(),
|
|
71
|
+
deletedAt: null,
|
|
72
|
+
} as Omit<StorageAsset, "id" | "key" | "bucket" | "provider" | "createdAt" | "updatedAt">;
|
|
63
73
|
|
|
64
|
-
await optimistic?.
|
|
65
|
-
await optimistic?.add?.(newNode);
|
|
74
|
+
await optimistic?.add?.(newAsset);
|
|
66
75
|
},
|
|
67
76
|
onSuccess: async (data) => {
|
|
68
77
|
await onUploadCompleted?.(data);
|
|
69
78
|
toast.success(`Succesvol geupload: ${data.name}`);
|
|
70
79
|
},
|
|
71
|
-
onError: async (error
|
|
80
|
+
onError: async (error) => {
|
|
72
81
|
await onUploadFailed?.(error);
|
|
73
82
|
|
|
74
83
|
console.error("Upload error: ", error);
|
|
75
84
|
toast.error("Bestand uploaden mislukt", {
|
|
76
85
|
description: error instanceof Error ? error.message : undefined,
|
|
77
86
|
});
|
|
78
|
-
|
|
79
|
-
console.info("Deleting failed upload");
|
|
80
|
-
await deleteMutation.mutateAsync([variables.id]);
|
|
81
87
|
},
|
|
82
88
|
onSettled: () => {
|
|
83
89
|
optimistic?.invalidate?.();
|
|
@@ -119,7 +125,7 @@ export function UploadZone({
|
|
|
119
125
|
|
|
120
126
|
{/* Show drag overlay when drag is active */}
|
|
121
127
|
{isDragActive && (
|
|
122
|
-
<div className="
|
|
128
|
+
<div className="absolute inset-0 z-10 rounded-md bg-primary/20 opacity-70 backdrop-blur-3xl" />
|
|
123
129
|
)}
|
|
124
130
|
|
|
125
131
|
<UploadZoneContext
|
|
@@ -4,11 +4,13 @@
|
|
|
4
4
|
|
|
5
5
|
export * from "./components/dropzone.client";
|
|
6
6
|
export * from "./components/dropzone-context.client";
|
|
7
|
+
export * from "./components/image.client";
|
|
7
8
|
export * from "./components/image-grid.client";
|
|
9
|
+
export * from "./components/upload-button.client";
|
|
8
10
|
export * from "./components/upload-zone.client";
|
|
9
11
|
export * from "./components/upload-zone-context.client";
|
|
10
12
|
|
|
11
13
|
/**
|
|
12
14
|
* Lib
|
|
13
15
|
*/
|
|
14
|
-
export * from "./lib/
|
|
16
|
+
export * from "./lib/upload.client";
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Lib
|
|
3
3
|
*/
|
|
4
|
-
|
|
5
|
-
export * from "./lib/
|
|
6
|
-
export * from "./lib/router.server";
|
|
4
|
+
|
|
5
|
+
export * from "./lib/procedures.server";
|
|
6
|
+
export * from "./lib/router-handlers.server";
|
|
7
|
+
export * from "./lib/service.server";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Providers
|
|
11
|
+
*/
|
|
12
|
+
export * from "./providers/adapters/s3.server";
|
|
@@ -1,5 +1,17 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Lib
|
|
3
|
+
*/
|
|
4
|
+
|
|
2
5
|
export * from "./lib/constants";
|
|
3
6
|
export * from "./lib/helpers";
|
|
4
7
|
export * from "./lib/schema";
|
|
5
8
|
export * from "./lib/validators";
|
|
9
|
+
export * from "./lib/validators";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Providers
|
|
13
|
+
*/
|
|
14
|
+
export * from "./providers/lib/constants";
|
|
15
|
+
export * from "./providers/lib/errors";
|
|
16
|
+
export * from "./providers/lib/types";
|
|
17
|
+
export * from "./providers/lib/validators";
|
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
// Device sizes
|
|
2
|
-
export const deviceSizes = [640, 750, 828, 1080, 1200, 1920, 2048, 3840];
|
|
3
|
-
export const imageSizes = deviceSizes;
|
|
4
|
-
|
|
5
|
-
// Image variants
|
|
6
|
-
export const imageVariants = [
|
|
7
|
-
"main",
|
|
8
|
-
...deviceSizes.map((size) => `preview-${size}` as const),
|
|
9
|
-
] as const;
|
|
10
|
-
export type ImageVariant = (typeof imageVariants)[number];
|
|
11
|
-
|
|
12
1
|
// Image dispositions
|
|
13
2
|
export const imageDispositions = ["inline", "attachment"] as const;
|
|
14
3
|
export type ImageDisposition = (typeof imageDispositions)[number];
|