@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
|
@@ -4,43 +4,28 @@ import { Input } from "@/components/ui/input";
|
|
|
4
4
|
import { toast } from "@/components/ui/sonner.client";
|
|
5
5
|
import { cn } from "@/lib/entry";
|
|
6
6
|
import { useAction } from "@/lib/hooks/use-action";
|
|
7
|
-
import { generateDefaultUUID } from "@/modules/config/entry";
|
|
8
7
|
import { useQueryClient } from "@tanstack/react-query";
|
|
9
8
|
import { ComponentProps, useCallback, useState } from "react";
|
|
10
|
-
import {
|
|
9
|
+
import { UploadClient, UploadFileRequest, UploadHooks } from "../lib/create-upload.client";
|
|
10
|
+
import { FileNode, Node, UploadFileSchema } from "../lib/validators";
|
|
11
11
|
import { UploadZoneContext } from "./upload-zone-context.client";
|
|
12
12
|
|
|
13
13
|
export type UploadZoneProps = ComponentProps<"div"> & {
|
|
14
|
-
namespace: string;
|
|
15
|
-
parentId: string | null;
|
|
16
|
-
|
|
17
14
|
queryKey: readonly unknown[];
|
|
18
15
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
confirmAction: (params: { id: string }) => Promise<Node>;
|
|
24
|
-
onConfirmStarted?: (id: string) => Promise<void> | void;
|
|
25
|
-
onConfirmCompleted?: (node: Node) => Promise<void> | void;
|
|
26
|
-
|
|
27
|
-
deleteAction: (params: { ids: string[] }) => Promise<unknown>;
|
|
16
|
+
variables: Pick<UploadFileSchema, "namespace" | "parentId" | "mode" | "hidden" | "readonly">;
|
|
17
|
+
uploadClient: UploadClient;
|
|
18
|
+
uploadHooks?: UploadHooks;
|
|
28
19
|
|
|
29
20
|
onUploadCompleted?: (node: Node) => Promise<void> | void;
|
|
30
21
|
onUploadFailed?: (error: unknown) => Promise<void> | void;
|
|
31
22
|
};
|
|
32
23
|
|
|
33
24
|
export function UploadZone({
|
|
34
|
-
|
|
35
|
-
parentId,
|
|
25
|
+
variables,
|
|
36
26
|
queryKey,
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
deleteAction,
|
|
40
|
-
onPresignStarted,
|
|
41
|
-
onPresignCompleted,
|
|
42
|
-
onConfirmStarted,
|
|
43
|
-
onConfirmCompleted,
|
|
27
|
+
uploadClient,
|
|
28
|
+
uploadHooks,
|
|
44
29
|
onUploadCompleted,
|
|
45
30
|
onUploadFailed,
|
|
46
31
|
children,
|
|
@@ -74,7 +59,7 @@ export function UploadZone({
|
|
|
74
59
|
* Delete mutation
|
|
75
60
|
*/
|
|
76
61
|
const deleteMutation = useAction({
|
|
77
|
-
mutationFn:
|
|
62
|
+
mutationFn: async (params: { ids: string[] }) => uploadClient.deleteFiles(params.ids),
|
|
78
63
|
onMutate: async (variables) => {
|
|
79
64
|
await updateData((prev) => prev.filter((node) => !variables.ids.includes(node.id)));
|
|
80
65
|
},
|
|
@@ -88,15 +73,10 @@ export function UploadZone({
|
|
|
88
73
|
});
|
|
89
74
|
|
|
90
75
|
/**
|
|
91
|
-
*
|
|
76
|
+
* Upload mutation
|
|
92
77
|
*/
|
|
93
|
-
const
|
|
94
|
-
mutationFn: async (params:
|
|
95
|
-
await onPresignStarted?.(params);
|
|
96
|
-
const data = await presignAction(params);
|
|
97
|
-
await onPresignCompleted?.(data);
|
|
98
|
-
return data;
|
|
99
|
-
},
|
|
78
|
+
const uploadMutation = useAction({
|
|
79
|
+
mutationFn: async (params: UploadFileRequest) => uploadClient.upload(params, uploadHooks),
|
|
100
80
|
onMutate: async (variables) => {
|
|
101
81
|
// Generate a new node
|
|
102
82
|
const newNode = {
|
|
@@ -107,61 +87,6 @@ export function UploadZone({
|
|
|
107
87
|
|
|
108
88
|
await updateData((prev) => [...(prev ?? []), newNode]);
|
|
109
89
|
},
|
|
110
|
-
onError: async (error, variables) => {
|
|
111
|
-
await onUploadFailed?.(error);
|
|
112
|
-
|
|
113
|
-
console.error("Presign error: ", error);
|
|
114
|
-
toast.error("Bestand uploaden mislukt", {
|
|
115
|
-
description: error instanceof Error ? error.message : undefined,
|
|
116
|
-
});
|
|
117
|
-
|
|
118
|
-
console.info("Deleting failed upload");
|
|
119
|
-
await deleteMutation.mutateAsync({ ids: [variables.id] });
|
|
120
|
-
},
|
|
121
|
-
});
|
|
122
|
-
|
|
123
|
-
/**
|
|
124
|
-
* Upload mutation
|
|
125
|
-
*/
|
|
126
|
-
const uploadMutation = useAction({
|
|
127
|
-
mutationFn: async (input: { id: string; presignedUrl: string; file: File }) => {
|
|
128
|
-
/**
|
|
129
|
-
* Upload the file
|
|
130
|
-
*/
|
|
131
|
-
const uploadResponse = await fetch(input.presignedUrl, {
|
|
132
|
-
method: "PUT",
|
|
133
|
-
headers: { "Content-Type": input.file.type },
|
|
134
|
-
body: input.file,
|
|
135
|
-
});
|
|
136
|
-
|
|
137
|
-
if (!uploadResponse.ok) {
|
|
138
|
-
const message = await uploadResponse.text();
|
|
139
|
-
throw new Error(`Upload failed: ${message}`);
|
|
140
|
-
}
|
|
141
|
-
},
|
|
142
|
-
onError: async (error, variables) => {
|
|
143
|
-
await onUploadFailed?.(error);
|
|
144
|
-
|
|
145
|
-
console.error("Upload error: ", error);
|
|
146
|
-
toast.error("Bestand uploaden mislukt", {
|
|
147
|
-
description: error instanceof Error ? error.message : undefined,
|
|
148
|
-
});
|
|
149
|
-
|
|
150
|
-
console.info("Deleting failed upload");
|
|
151
|
-
await deleteMutation.mutateAsync({ ids: [variables.id] });
|
|
152
|
-
},
|
|
153
|
-
});
|
|
154
|
-
|
|
155
|
-
/**
|
|
156
|
-
* Confirm upload mutation
|
|
157
|
-
*/
|
|
158
|
-
const confirmMutation = useAction({
|
|
159
|
-
mutationFn: async (params: { id: string }) => {
|
|
160
|
-
await onConfirmStarted?.(params.id);
|
|
161
|
-
const data = await confirmAction(params);
|
|
162
|
-
await onConfirmCompleted?.(data);
|
|
163
|
-
return data;
|
|
164
|
-
},
|
|
165
90
|
onSuccess: async (data) => {
|
|
166
91
|
await onUploadCompleted?.(data);
|
|
167
92
|
toast.success(`Succesvol geupload: ${data.name}`);
|
|
@@ -169,7 +94,7 @@ export function UploadZone({
|
|
|
169
94
|
onError: async (error, variables) => {
|
|
170
95
|
await onUploadFailed?.(error);
|
|
171
96
|
|
|
172
|
-
console.error("
|
|
97
|
+
console.error("Upload error: ", error);
|
|
173
98
|
toast.error("Bestand uploaden mislukt", {
|
|
174
99
|
description: error instanceof Error ? error.message : undefined,
|
|
175
100
|
});
|
|
@@ -187,29 +112,10 @@ export function UploadZone({
|
|
|
187
112
|
*/
|
|
188
113
|
const onUpload = useCallback(
|
|
189
114
|
async (file: File) => {
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
*/
|
|
193
|
-
const { id, presignedUrl } = await presignMutation.mutateAsync({
|
|
194
|
-
id: generateDefaultUUID(),
|
|
195
|
-
name: file.name,
|
|
196
|
-
size: file.size,
|
|
197
|
-
contentType: file.type,
|
|
198
|
-
namespace,
|
|
199
|
-
parentId,
|
|
200
|
-
});
|
|
201
|
-
|
|
202
|
-
/**
|
|
203
|
-
* Uploading the file
|
|
204
|
-
*/
|
|
205
|
-
await uploadMutation.mutateAsync({ id, presignedUrl, file });
|
|
206
|
-
|
|
207
|
-
/**
|
|
208
|
-
* Confirming the upload
|
|
209
|
-
*/
|
|
210
|
-
return await confirmMutation.mutateAsync({ id });
|
|
115
|
+
const req = uploadClient.prepareUpload({ ...variables, file });
|
|
116
|
+
return await uploadMutation.mutateAsync(req);
|
|
211
117
|
},
|
|
212
|
-
[
|
|
118
|
+
[uploadClient, variables, uploadMutation],
|
|
213
119
|
);
|
|
214
120
|
|
|
215
121
|
return (
|
|
@@ -243,9 +149,7 @@ export function UploadZone({
|
|
|
243
149
|
)}
|
|
244
150
|
<UploadZoneContext
|
|
245
151
|
value={{
|
|
246
|
-
|
|
247
|
-
confirmMutation: (params) => confirmMutation.mutateAsync(params),
|
|
248
|
-
deleteMutation: (params) => deleteMutation.mutateAsync(params),
|
|
152
|
+
uploadClient,
|
|
249
153
|
onUpload,
|
|
250
154
|
updateData,
|
|
251
155
|
invalidateQuery,
|
|
@@ -7,4 +7,6 @@ export const nodesTableFilters = createTableFilters({
|
|
|
7
7
|
types: parseFilterArray(z.array(z.enum(nodeTypeEnum.enumValues))),
|
|
8
8
|
nodeIds: parseFilterArray(z.array(z.string())),
|
|
9
9
|
isDeleted: parseFilterBoolean(z.boolean()),
|
|
10
|
+
isOrphaned: parseFilterBoolean(z.boolean()),
|
|
11
|
+
hidden: parseFilterBoolean(z.boolean()),
|
|
10
12
|
});
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { generateDefaultUUID } from "@/modules/config/entry";
|
|
2
|
+
import { BulkActionSchema } from "@/modules/router/entry";
|
|
3
|
+
import { PresignFileSchema, SelectNodeSchema, UpdateNodeSchema } from "./validators";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Upload request
|
|
7
|
+
*/
|
|
8
|
+
export type PrepareUploadInput = Omit<UploadFileRequest, "id" | "name" | "size" | "contentType">;
|
|
9
|
+
export type UploadFileRequest = PresignFileSchema & { file: File };
|
|
10
|
+
export type UploadHooks = {
|
|
11
|
+
beforePresign?: (input: UploadFileRequest) => Promise<void> | void;
|
|
12
|
+
afterPresign?: (presignResult: { id: string; presignedUrl: string }) => Promise<void> | void;
|
|
13
|
+
beforeConfirm?: (presignResult: { id: string; presignedUrl: string }) => Promise<void> | void;
|
|
14
|
+
afterConfirm?: (node: SelectNodeSchema) => Promise<void> | void;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Upload client
|
|
19
|
+
*/
|
|
20
|
+
export type UploadClient = {
|
|
21
|
+
prepareUpload: (input: PrepareUploadInput) => UploadFileRequest;
|
|
22
|
+
upload: (input: UploadFileRequest, hooks?: UploadHooks) => Promise<SelectNodeSchema>;
|
|
23
|
+
deleteFiles: (ids: string[]) => Promise<void>;
|
|
24
|
+
updateNode: (id: string, data: UpdateNodeSchema) => Promise<SelectNodeSchema>;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Create upload client
|
|
29
|
+
*/
|
|
30
|
+
type CreateUploadClientProps = {
|
|
31
|
+
endpoints: {
|
|
32
|
+
presign: (input: PresignFileSchema) => Promise<{ id: string; presignedUrl: string }>;
|
|
33
|
+
confirm: (input: { id: string }) => Promise<SelectNodeSchema>;
|
|
34
|
+
deleteNodes: (input: BulkActionSchema) => Promise<void>;
|
|
35
|
+
updateNode: (input: { id: string; data: UpdateNodeSchema }) => Promise<SelectNodeSchema>;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export function createUploadClient(props: CreateUploadClientProps): UploadClient {
|
|
40
|
+
/**
|
|
41
|
+
* Create input schema for the upload method
|
|
42
|
+
* @param {PrepareUploadInput} input
|
|
43
|
+
* @returns {UploadFileRequest}
|
|
44
|
+
*/
|
|
45
|
+
function prepareUpload(input: PrepareUploadInput): UploadFileRequest {
|
|
46
|
+
return {
|
|
47
|
+
...input,
|
|
48
|
+
id: generateDefaultUUID(),
|
|
49
|
+
name: input.file.name,
|
|
50
|
+
size: input.file.size,
|
|
51
|
+
contentType: input.file.type,
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Upload file to the server
|
|
57
|
+
* @param {UploadFileRequest} input
|
|
58
|
+
* @returns {Promise<SelectNodeSchema>}
|
|
59
|
+
*/
|
|
60
|
+
async function upload(input: UploadFileRequest, hooks?: UploadHooks): Promise<SelectNodeSchema> {
|
|
61
|
+
try {
|
|
62
|
+
/**
|
|
63
|
+
* Presign
|
|
64
|
+
*/
|
|
65
|
+
await hooks?.beforePresign?.(input);
|
|
66
|
+
const presignResult = await props.endpoints.presign(input);
|
|
67
|
+
await hooks?.afterPresign?.(presignResult);
|
|
68
|
+
/**
|
|
69
|
+
* Upload the file
|
|
70
|
+
*/
|
|
71
|
+
const uploadResponse = await fetch(presignResult.presignedUrl, {
|
|
72
|
+
method: "PUT",
|
|
73
|
+
headers: { "Content-Type": input.file.type },
|
|
74
|
+
body: input.file,
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
if (!uploadResponse.ok) {
|
|
78
|
+
const message = await uploadResponse.text();
|
|
79
|
+
throw new Error(`Upload failed: ${message}`);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Confirm
|
|
84
|
+
*/
|
|
85
|
+
await hooks?.beforeConfirm?.(presignResult);
|
|
86
|
+
const node = await props.endpoints.confirm({ id: presignResult.id });
|
|
87
|
+
await hooks?.afterConfirm?.(node);
|
|
88
|
+
/**
|
|
89
|
+
* Return
|
|
90
|
+
*/
|
|
91
|
+
return node;
|
|
92
|
+
} catch (err) {
|
|
93
|
+
console.error("Upload error: ", err);
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Delete if upload failed
|
|
97
|
+
* */
|
|
98
|
+
try {
|
|
99
|
+
await deleteFiles([input.id]);
|
|
100
|
+
} catch (cleanupErr) {
|
|
101
|
+
console.error("Cleanup delete failed:", cleanupErr);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
throw err;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Delete files
|
|
110
|
+
* @param {string[]} ids
|
|
111
|
+
*/
|
|
112
|
+
async function deleteFiles(ids: string[]) {
|
|
113
|
+
await props.endpoints.deleteNodes({ ids });
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Update node
|
|
118
|
+
* @param {string} id
|
|
119
|
+
* @param {UpdateNodeSchema} data
|
|
120
|
+
*/
|
|
121
|
+
async function updateNode(id: string, data: UpdateNodeSchema) {
|
|
122
|
+
return props.endpoints.updateNode({ id, data });
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Upload client
|
|
127
|
+
*/
|
|
128
|
+
return {
|
|
129
|
+
prepareUpload,
|
|
130
|
+
upload,
|
|
131
|
+
deleteFiles,
|
|
132
|
+
updateNode,
|
|
133
|
+
};
|
|
134
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ImageLoaderProps } from "next/image";
|
|
2
2
|
import { ImageVariant } from "./constants";
|
|
3
|
-
import {
|
|
3
|
+
import { CreateNodeSchema, GetFileURLSchema, Node } from "./validators";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Check if the node is a file
|
|
@@ -62,7 +62,8 @@ export type NodeSubtype = (typeof nodeSubtypes)[number];
|
|
|
62
62
|
export function inferNodeSubtype({
|
|
63
63
|
name,
|
|
64
64
|
contentType,
|
|
65
|
-
}: Pick<
|
|
65
|
+
}: Pick<CreateNodeSchema, "name" | "contentType">): NodeSubtype {
|
|
66
|
+
if (!contentType) return "other";
|
|
66
67
|
if (contentType?.startsWith("image/")) return "image";
|
|
67
68
|
if (contentType === "application/pdf") return "document";
|
|
68
69
|
if (contentType?.includes("spreadsheet")) return "spreadsheet";
|
|
@@ -100,6 +100,7 @@ export function createDriveBaseProcedures() {
|
|
|
100
100
|
*/
|
|
101
101
|
presign: protectedProcedure
|
|
102
102
|
.input(presignFileSchema)
|
|
103
|
+
.output(z.object({ id: z.string(), presignedUrl: z.string() }))
|
|
103
104
|
.handler(async ({ context, input }) => context.storage.presignUpload(input)),
|
|
104
105
|
/**
|
|
105
106
|
* Confirm the upload
|
|
@@ -21,9 +21,11 @@ export const nodes = pgTable("nodes", (t) => ({
|
|
|
21
21
|
size: t.integer().default(0),
|
|
22
22
|
contentType: t.varchar({ length: 255 }),
|
|
23
23
|
readonly: boolean().default(false),
|
|
24
|
+
hidden: boolean().default(false),
|
|
24
25
|
createdBy: t.uuid().references(() => users.id, { onDelete: "set null" }),
|
|
25
26
|
isPending: t.boolean().default(false).notNull(),
|
|
26
27
|
isDeleted: t.boolean().default(false).notNull(),
|
|
28
|
+
orphanedAt: t.timestamp(),
|
|
27
29
|
parentId: t.uuid().references((): AnyPgColumn => nodes.id, { onDelete: "cascade" }),
|
|
28
30
|
}));
|
|
29
31
|
|
|
@@ -16,13 +16,14 @@ import {
|
|
|
16
16
|
} from "@aws-sdk/client-s3";
|
|
17
17
|
import { getSignedUrl } from "@aws-sdk/s3-request-presigner";
|
|
18
18
|
import { addSeconds } from "date-fns";
|
|
19
|
-
import { and, asc, eq, inArray, isNull, SQL } from "drizzle-orm";
|
|
19
|
+
import { and, asc, eq, inArray, isNotNull, isNull, SQL } from "drizzle-orm";
|
|
20
20
|
import { after } from "next/server";
|
|
21
21
|
import { deviceSizes } from "./constants";
|
|
22
22
|
import { getDriveBucketKey, inferNodeSubtype, isFile, isFolder } from "./helpers";
|
|
23
23
|
import { nodePresignedUrls, nodes, nodeVariants } from "./schema";
|
|
24
24
|
import {
|
|
25
25
|
CreateFolderNodeSchema,
|
|
26
|
+
FileNode,
|
|
26
27
|
GetFileURLSchema,
|
|
27
28
|
getFileURLSchemaDefaults,
|
|
28
29
|
GetNodesByParentIdInput,
|
|
@@ -101,8 +102,8 @@ export class StorageService<TSchema extends TDatabaseSchema> {
|
|
|
101
102
|
Bucket: BUCKET_NAME,
|
|
102
103
|
Key: getDriveBucketKey(input.id, input.variant),
|
|
103
104
|
Body: input.body,
|
|
104
|
-
ContentType: input.contentType,
|
|
105
|
-
ContentLength: input.size,
|
|
105
|
+
ContentType: input.contentType ?? undefined,
|
|
106
|
+
ContentLength: input.size ?? undefined,
|
|
106
107
|
Metadata: {
|
|
107
108
|
nodeId: input.id,
|
|
108
109
|
},
|
|
@@ -117,6 +118,13 @@ export class StorageService<TSchema extends TDatabaseSchema> {
|
|
|
117
118
|
return await this.#blob.send(putCommand);
|
|
118
119
|
}
|
|
119
120
|
|
|
121
|
+
/**
|
|
122
|
+
* Get node by id
|
|
123
|
+
*/
|
|
124
|
+
async getNodeById(id: string) {
|
|
125
|
+
return this.#db.select().from(nodes).where(eq(nodes.id, id));
|
|
126
|
+
}
|
|
127
|
+
|
|
120
128
|
/**
|
|
121
129
|
* Get nodes by parent id
|
|
122
130
|
*/
|
|
@@ -132,6 +140,12 @@ export class StorageService<TSchema extends TDatabaseSchema> {
|
|
|
132
140
|
filters.nodeIds != null ? inArray(nodes.id, filters.nodeIds) : undefined,
|
|
133
141
|
filters.types != null ? inArray(nodes.type, filters.types) : undefined,
|
|
134
142
|
filters.isDeleted != null ? eq(nodes.isDeleted, filters.isDeleted) : undefined,
|
|
143
|
+
filters.isOrphaned === true
|
|
144
|
+
? isNotNull(nodes.orphanedAt)
|
|
145
|
+
: filters.isOrphaned === false
|
|
146
|
+
? isNull(nodes.orphanedAt)
|
|
147
|
+
: undefined,
|
|
148
|
+
filters.hidden != null ? eq(nodes.hidden, filters.hidden) : undefined,
|
|
135
149
|
filters.parentId ? eq(nodes.parentId, filters.parentId) : isNull(nodes.parentId),
|
|
136
150
|
eq(nodes.namespace, filters.namespace),
|
|
137
151
|
search,
|
|
@@ -305,7 +319,7 @@ export class StorageService<TSchema extends TDatabaseSchema> {
|
|
|
305
319
|
// after(async () => {});
|
|
306
320
|
await this.generatePreviews(input);
|
|
307
321
|
|
|
308
|
-
return result;
|
|
322
|
+
return result as FileNode;
|
|
309
323
|
}
|
|
310
324
|
|
|
311
325
|
/**
|
|
@@ -38,26 +38,6 @@ export const updateNodeSchema = createUpdateSchema(nodes);
|
|
|
38
38
|
export type UpdateNodeInput = z.input<typeof updateNodeSchema>;
|
|
39
39
|
export type UpdateNodeSchema = z.infer<typeof updateNodeSchema>;
|
|
40
40
|
|
|
41
|
-
/**
|
|
42
|
-
* Create folder node
|
|
43
|
-
*/
|
|
44
|
-
export const createFolderNodeSchema = createNodeSchema.omit({
|
|
45
|
-
type: true,
|
|
46
|
-
contentType: true,
|
|
47
|
-
size: true,
|
|
48
|
-
subtype: true,
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
export type CreateFolderNodeSchema = z.infer<typeof createFolderNodeSchema>;
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Create file node
|
|
55
|
-
*/
|
|
56
|
-
export const createFileNodeSchema = createNodeSchema.omit({
|
|
57
|
-
type: true,
|
|
58
|
-
});
|
|
59
|
-
export type CreateFileNodeSchema = z.infer<typeof createFileNodeSchema>;
|
|
60
|
-
|
|
61
41
|
/**
|
|
62
42
|
* Select node
|
|
63
43
|
*/
|
|
@@ -78,22 +58,32 @@ export const nodesTableFiltersSchema = resolveFiltersSchema(nodesTableFilters)
|
|
|
78
58
|
namespace: z.string(),
|
|
79
59
|
parentId: z.string().nullable(),
|
|
80
60
|
})
|
|
81
|
-
.transform((input) => ({
|
|
61
|
+
.transform((input) => ({
|
|
62
|
+
...input,
|
|
63
|
+
hidden: input?.hidden ?? false,
|
|
64
|
+
isDeleted: input?.isDeleted ?? false,
|
|
65
|
+
orphanedAt: input?.isOrphaned ?? false,
|
|
66
|
+
}));
|
|
82
67
|
|
|
83
68
|
export type NodesTableFilters = z.input<typeof nodesTableFiltersSchema>;
|
|
84
69
|
|
|
85
70
|
/**
|
|
86
|
-
*
|
|
71
|
+
* Create folder node
|
|
87
72
|
*/
|
|
88
|
-
export const
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
size: z.number().optional().default(0),
|
|
94
|
-
contentType: z.string().optional().default(""),
|
|
73
|
+
export const createFolderNodeSchema = createNodeSchema.omit({
|
|
74
|
+
type: true,
|
|
75
|
+
contentType: true,
|
|
76
|
+
size: true,
|
|
77
|
+
subtype: true,
|
|
95
78
|
});
|
|
96
79
|
|
|
80
|
+
export type CreateFolderNodeSchema = z.infer<typeof createFolderNodeSchema>;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Upload file schema
|
|
84
|
+
*/
|
|
85
|
+
export const uploadFileSchema = createNodeSchema.omit({ type: true });
|
|
86
|
+
|
|
97
87
|
export type UploadFileSchema = z.infer<typeof uploadFileSchema>;
|
|
98
88
|
|
|
99
89
|
/**
|
|
@@ -145,8 +135,8 @@ export const putObjectSchema = z.object({
|
|
|
145
135
|
name: z.string().optional().default(""),
|
|
146
136
|
variant: z.enum(imageVariants).optional().default("main"),
|
|
147
137
|
body: z.any().optional(),
|
|
148
|
-
contentType: z.string().
|
|
149
|
-
size: z.number().
|
|
138
|
+
contentType: z.string().nullable().optional(),
|
|
139
|
+
size: z.number().nullable().optional(),
|
|
150
140
|
});
|
|
151
141
|
|
|
152
142
|
export type PutObjectInput = z.input<typeof putObjectSchema> & {
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { useInlineEditOptions } from "../hooks/use-inline.client.mjs";
|
|
2
|
-
import { InlineEditVariantsProps } from "../lib/variants.mjs";
|
|
3
|
-
import * as react_jsx_runtime14 from "react/jsx-runtime";
|
|
4
|
-
import { ComponentProps } from "react";
|
|
5
|
-
import { JSONContent } from "@tiptap/react";
|
|
6
|
-
|
|
7
|
-
//#region src/modules/inline-edit/components/deprecated-editor.client.d.ts
|
|
8
|
-
/**
|
|
9
|
-
* @deprecated
|
|
10
|
-
*/
|
|
11
|
-
declare function InlineEditorDeprecated({
|
|
12
|
-
initialValue,
|
|
13
|
-
action,
|
|
14
|
-
variant,
|
|
15
|
-
className,
|
|
16
|
-
disabled,
|
|
17
|
-
...props
|
|
18
|
-
}: Omit<ComponentProps<"input">, "type"> & useInlineEditOptions<JSONContent> & InlineEditVariantsProps): react_jsx_runtime14.JSX.Element;
|
|
19
|
-
//#endregion
|
|
20
|
-
export { InlineEditorDeprecated };
|
|
21
|
-
//# sourceMappingURL=deprecated-editor.client.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"deprecated-editor.client.d.mts","names":[],"sources":["../../../../src/modules/inline-edit/components/deprecated-editor.client.tsx"],"sourcesContent":[],"mappings":";;;;;;;;;;AAYgB,iBAAA,sBAAA,CAAsB;EAAA,YAAA;EAAA,MAAA;EAAA,OAAA;EAAA,SAAA;EAAA,QAAA;EAAA,GAAA;AAAA,CAAA,EAOnC,IAPmC,CAO9B,cAP8B,CAAA,OAAA,CAAA,EAAA,MAAA,CAAA,GAQpC,oBARoC,CAQf,WARe,CAAA,GASpC,uBAToC,CAAA,EASb,mBAAA,CAAA,GAAA,CAAA,OATa"}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { cn } from "../../../lib/utils/cn.mjs";
|
|
4
|
-
import { EDITOR_EXTENSIONS_VALUES } from "../../../components/editor/lib/constants.mjs";
|
|
5
|
-
import { useInlineEdit } from "../hooks/use-inline.client.mjs";
|
|
6
|
-
import { inlineEditVariants } from "../lib/variants.mjs";
|
|
7
|
-
import { jsx } from "react/jsx-runtime";
|
|
8
|
-
import { EditorContent, useEditor } from "@tiptap/react";
|
|
9
|
-
|
|
10
|
-
//#region src/modules/inline-edit/components/deprecated-editor.client.tsx
|
|
11
|
-
/**
|
|
12
|
-
* @deprecated
|
|
13
|
-
*/
|
|
14
|
-
function InlineEditorDeprecated({ initialValue, action, variant, className, disabled, ...props }) {
|
|
15
|
-
const { value, setValue, handleUpdate, isAllowed } = useInlineEdit({
|
|
16
|
-
initialValue,
|
|
17
|
-
action
|
|
18
|
-
});
|
|
19
|
-
const editor = useEditor({
|
|
20
|
-
extensions: EDITOR_EXTENSIONS_VALUES,
|
|
21
|
-
content: value,
|
|
22
|
-
editable: !disabled && isAllowed,
|
|
23
|
-
immediatelyRender: false,
|
|
24
|
-
injectCSS: false,
|
|
25
|
-
onUpdate: ({ editor: editor$1 }) => setValue(editor$1.getJSON()),
|
|
26
|
-
onBlur: ({ editor: editor$1 }) => handleUpdate(editor$1.getJSON()),
|
|
27
|
-
editorProps: { attributes: { class: cn("prose max-w-full bg-background ring-offset-background rounded-md border border-input dark:prose-invert p-3 focus:outline-none prose-a:text-primary prose-li:marker:text-primary ring-offset-background file:text-foreground placeholder:text-muted-foreground focus-visible:ring-ring rounded-md border text-base file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 [&[contenteditable=false]]:opacity-50 [&[contenteditable=false]]:cursor-not-allowed md:text-sm", inlineEditVariants({ variant }), className) } }
|
|
28
|
-
});
|
|
29
|
-
return /* @__PURE__ */ jsx(EditorContent, {
|
|
30
|
-
...props,
|
|
31
|
-
editor
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
//#endregion
|
|
36
|
-
export { InlineEditorDeprecated };
|
|
37
|
-
//# sourceMappingURL=deprecated-editor.client.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"deprecated-editor.client.mjs","names":["editor"],"sources":["../../../../src/modules/inline-edit/components/deprecated-editor.client.tsx"],"sourcesContent":["\"use client\";\n\nimport { EDITOR_EXTENSIONS_VALUES } from \"@/components/editor/lib/constants\";\nimport { cn } from \"@/lib/utils/cn\";\nimport { EditorContent, JSONContent, useEditor } from \"@tiptap/react\";\nimport { ComponentProps } from \"react\";\nimport { useInlineEdit, type useInlineEditOptions } from \"../hooks/use-inline.client\";\nimport { inlineEditVariants, InlineEditVariantsProps } from \"../lib/variants\";\n\n/**\n * @deprecated\n */\nexport function InlineEditorDeprecated({\n initialValue,\n action,\n variant,\n className,\n disabled,\n ...props\n}: Omit<ComponentProps<\"input\">, \"type\"> &\n useInlineEditOptions<JSONContent> &\n InlineEditVariantsProps) {\n const { value, setValue, handleUpdate, isAllowed } = useInlineEdit({\n initialValue,\n action,\n });\n\n const editor = useEditor({\n extensions: EDITOR_EXTENSIONS_VALUES,\n content: value,\n editable: !disabled && isAllowed,\n immediatelyRender: false,\n injectCSS: false,\n onUpdate: ({ editor }) => setValue(editor.getJSON()),\n onBlur: ({ editor }) => handleUpdate(editor.getJSON()),\n editorProps: {\n attributes: {\n class: cn(\n \"prose max-w-full bg-background ring-offset-background rounded-md border border-input dark:prose-invert p-3 focus:outline-none prose-a:text-primary prose-li:marker:text-primary ring-offset-background file:text-foreground placeholder:text-muted-foreground focus-visible:ring-ring rounded-md border text-base file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 [&[contenteditable=false]]:opacity-50 [&[contenteditable=false]]:cursor-not-allowed md:text-sm\",\n inlineEditVariants({ variant }),\n className,\n ),\n },\n },\n });\n\n return <EditorContent {...props} editor={editor} />;\n}\n"],"mappings":";;;;;;;;;;;;;AAYA,SAAgB,uBAAuB,EACrC,cACA,QACA,SACA,WACA,UACA,GAAG,SAGsB;CACzB,MAAM,EAAE,OAAO,UAAU,cAAc,cAAc,cAAc;EACjE;EACA;EACD,CAAC;CAEF,MAAM,SAAS,UAAU;EACvB,YAAY;EACZ,SAAS;EACT,UAAU,CAAC,YAAY;EACvB,mBAAmB;EACnB,WAAW;EACX,WAAW,EAAE,uBAAa,SAASA,SAAO,SAAS,CAAC;EACpD,SAAS,EAAE,uBAAa,aAAaA,SAAO,SAAS,CAAC;EACtD,aAAa,EACX,YAAY,EACV,OAAO,GACL,giBACA,mBAAmB,EAAE,SAAS,CAAC,EAC/B,UACD,EACF,EACF;EACF,CAAC;AAEF,QAAO,oBAAC;EAAc,GAAI;EAAe;GAAU"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"client.mjs","names":[],"sources":["../../src/modules/storage/entry.client.ts"],"sourcesContent":["/**\n * Components\n */\nexport * from \"./components/dropzone-context.client\";\nexport * from \"./components/dropzone.client\";\nexport * from \"./components/image-grid.client\";\nexport * from \"./components/upload-zone-context.client\";\nexport * from \"./components/upload-zone.client\";\n\n/**\n * Hooks\n */\n"],"mappings":""}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { EDITOR_EXTENSIONS_VALUES } from "@/components/editor/lib/constants";
|
|
4
|
-
import { cn } from "@/lib/utils/cn";
|
|
5
|
-
import { EditorContent, JSONContent, useEditor } from "@tiptap/react";
|
|
6
|
-
import { ComponentProps } from "react";
|
|
7
|
-
import { useInlineEdit, type useInlineEditOptions } from "../hooks/use-inline.client";
|
|
8
|
-
import { inlineEditVariants, InlineEditVariantsProps } from "../lib/variants";
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* @deprecated
|
|
12
|
-
*/
|
|
13
|
-
export function InlineEditorDeprecated({
|
|
14
|
-
initialValue,
|
|
15
|
-
action,
|
|
16
|
-
variant,
|
|
17
|
-
className,
|
|
18
|
-
disabled,
|
|
19
|
-
...props
|
|
20
|
-
}: Omit<ComponentProps<"input">, "type"> &
|
|
21
|
-
useInlineEditOptions<JSONContent> &
|
|
22
|
-
InlineEditVariantsProps) {
|
|
23
|
-
const { value, setValue, handleUpdate, isAllowed } = useInlineEdit({
|
|
24
|
-
initialValue,
|
|
25
|
-
action,
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
const editor = useEditor({
|
|
29
|
-
extensions: EDITOR_EXTENSIONS_VALUES,
|
|
30
|
-
content: value,
|
|
31
|
-
editable: !disabled && isAllowed,
|
|
32
|
-
immediatelyRender: false,
|
|
33
|
-
injectCSS: false,
|
|
34
|
-
onUpdate: ({ editor }) => setValue(editor.getJSON()),
|
|
35
|
-
onBlur: ({ editor }) => handleUpdate(editor.getJSON()),
|
|
36
|
-
editorProps: {
|
|
37
|
-
attributes: {
|
|
38
|
-
class: cn(
|
|
39
|
-
"prose max-w-full bg-background ring-offset-background rounded-md border border-input dark:prose-invert p-3 focus:outline-none prose-a:text-primary prose-li:marker:text-primary ring-offset-background file:text-foreground placeholder:text-muted-foreground focus-visible:ring-ring rounded-md border text-base file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 [&[contenteditable=false]]:opacity-50 [&[contenteditable=false]]:cursor-not-allowed md:text-sm",
|
|
40
|
-
inlineEditVariants({ variant }),
|
|
41
|
-
className,
|
|
42
|
-
),
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
return <EditorContent {...props} editor={editor} />;
|
|
48
|
-
}
|