@tulip-systems/core 0.5.2 → 0.5.4
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/auth/client.d.mts +3 -3
- package/dist/auth/client.mjs +2 -2
- package/dist/components/client.d.mts +2 -2
- package/dist/components/common/icons.d.mts +2 -2
- 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/content.client.d.mts.map +1 -1
- package/dist/components/editor/components/editor.client.d.mts +6 -6
- package/dist/components/editor/components/editor.client.d.mts.map +1 -1
- 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.d.mts.map +1 -1
- 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 +51 -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 +31 -28
- package/dist/components/editor/lib/constants.d.mts.map +1 -1
- package/dist/components/editor/lib/constants.mjs +17 -5
- package/dist/components/editor/lib/constants.mjs.map +1 -1
- package/dist/components/editor/lib/extensions.d.mts +7 -3
- 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/helpers.d.mts.map +1 -1
- package/dist/components/editor/lib/helpers.mjs +38 -3
- package/dist/components/editor/lib/helpers.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/back-button.client.d.mts.map +1 -1
- package/dist/components/header/bottom-bar.client.d.mts +3 -3
- package/dist/components/header/bottom-bar.client.d.mts.map +1 -1
- package/dist/components/header/breadcrumbs.client.d.mts +7 -7
- package/dist/components/header/breadcrumbs.client.d.mts.map +1 -1
- package/dist/components/header/header.client.d.mts +2 -2
- package/dist/components/header/header.client.d.mts.map +1 -1
- package/dist/components/header/mobile-nav-switcher.client.d.mts +2 -2
- package/dist/components/header/mobile-nav-switcher.client.d.mts.map +1 -1
- package/dist/components/header/top-bar.client.d.mts +4 -4
- package/dist/components/header/top-bar.client.d.mts.map +1 -1
- package/dist/components/layouts/admin-content.client.d.mts +2 -2
- package/dist/components/layouts/admin-content.client.d.mts.map +1 -1
- package/dist/components/layouts/admin-layout.d.mts +2 -2
- package/dist/components/layouts/admin-layout.d.mts.map +1 -1
- 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/error-page.d.mts +23 -0
- package/dist/components/layouts/error-page.d.mts.map +1 -0
- package/dist/components/layouts/error-page.mjs +58 -0
- package/dist/components/layouts/error-page.mjs.map +1 -0
- 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-allowed-page.d.mts +22 -0
- package/dist/components/layouts/not-allowed-page.d.mts.map +1 -0
- package/dist/components/layouts/not-allowed-page.mjs +25 -0
- package/dist/components/layouts/not-allowed-page.mjs.map +1 -0
- 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/providers.client.d.mts.map +1 -1
- 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/lists/data-stack.d.mts.map +1 -1
- package/dist/components/navigation/admin-sidebar-paths.client.d.mts +21 -11
- package/dist/components/navigation/admin-sidebar-paths.client.d.mts.map +1 -1
- package/dist/components/navigation/admin-sidebar-paths.client.mjs +7 -5
- package/dist/components/navigation/admin-sidebar-paths.client.mjs.map +1 -1
- package/dist/components/ui/accordion.d.mts +5 -5
- package/dist/components/ui/accordion.d.mts.map +1 -1
- package/dist/components/ui/alert-dialog.d.mts +12 -12
- package/dist/components/ui/alert-dialog.d.mts.map +1 -1
- package/dist/components/ui/alert.d.mts +6 -6
- package/dist/components/ui/alert.d.mts.map +1 -1
- package/dist/components/ui/aspect-ratio.d.mts +2 -2
- package/dist/components/ui/aspect-ratio.d.mts.map +1 -1
- package/dist/components/ui/avatar.client.d.mts +4 -4
- package/dist/components/ui/avatar.client.d.mts.map +1 -1
- package/dist/components/ui/badge.d.mts +4 -4
- package/dist/components/ui/badge.d.mts.map +1 -1
- 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/chart.client.d.mts.map +1 -1
- 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/collapsible.client.d.mts.map +1 -1
- package/dist/components/ui/color-picker.client.d.mts +2 -2
- package/dist/components/ui/color-picker.client.d.mts.map +1 -1
- package/dist/components/ui/combobox-dropdown.client.d.mts +2 -2
- package/dist/components/ui/combobox-dropdown.client.d.mts.map +1 -1
- package/dist/components/ui/combobox.client.d.mts +2 -2
- package/dist/components/ui/combobox.client.d.mts.map +1 -1
- 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/context-menu.d.mts.map +1 -1
- package/dist/components/ui/date-picker.client.d.mts +2 -2
- package/dist/components/ui/date-picker.client.d.mts.map +1 -1
- package/dist/components/ui/dialog.client.d.mts +11 -11
- package/dist/components/ui/dialog.client.d.mts.map +1 -1
- package/dist/components/ui/drawer.client.d.mts +11 -11
- package/dist/components/ui/drawer.client.d.mts.map +1 -1
- package/dist/components/ui/dropdown-menu.d.mts +16 -16
- package/dist/components/ui/form.client.d.mts +7 -7
- package/dist/components/ui/form.client.d.mts.map +1 -1
- package/dist/components/ui/hover-card.client.d.mts +4 -4
- package/dist/components/ui/hover-card.client.d.mts.map +1 -1
- 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/progress.client.d.mts +2 -2
- package/dist/components/ui/progress.client.d.mts.map +1 -1
- package/dist/components/ui/radio-group.d.mts +3 -3
- package/dist/components/ui/resizable.client.d.mts +4 -4
- package/dist/components/ui/resizable.client.d.mts.map +1 -1
- package/dist/components/ui/scroll-area.d.mts +3 -3
- package/dist/components/ui/select.client.d.mts +11 -11
- package/dist/components/ui/select.client.d.mts.map +1 -1
- package/dist/components/ui/separator.d.mts +2 -2
- package/dist/components/ui/sheet.client.d.mts +9 -9
- package/dist/components/ui/sheet.client.d.mts.map +1 -1
- package/dist/components/ui/sidebar.client.d.mts +26 -26
- package/dist/components/ui/sidebar.client.d.mts.map +1 -1
- 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/toggle.d.mts.map +1 -1
- package/dist/components/ui/tooltip.client.d.mts +5 -5
- package/dist/components/ui/tooltip.client.d.mts.map +1 -1
- package/dist/components/ui/tooltip.client.mjs +1 -1
- package/dist/components/ui/tooltip.client.mjs.map +1 -1
- package/dist/components.d.mts +4 -1
- package/dist/components.mjs +5 -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 +21 -7
- package/dist/modules/auth/components/allowed.client.d.mts.map +1 -1
- package/dist/modules/auth/components/allowed.client.mjs +8 -2
- package/dist/modules/auth/components/allowed.client.mjs.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/auth-loading.d.mts.map +1 -1
- 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 +143 -143
- package/dist/modules/auth/handler/client.client.d.mts.map +1 -1
- package/dist/modules/auth/handler/init.d.mts +131 -131
- package/dist/modules/auth/handler/init.d.mts.map +1 -1
- package/dist/modules/auth/hooks/use-permission.d.mts +48 -4
- package/dist/modules/auth/hooks/use-permission.d.mts.map +1 -1
- package/dist/modules/auth/hooks/use-permission.mjs +51 -4
- package/dist/modules/auth/hooks/use-permission.mjs.map +1 -1
- package/dist/modules/auth/lib/helpers.server.mjs +1 -1
- 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/click-command.client.d.mts +2 -2
- package/dist/modules/commands/components/command-trigger.client.d.mts +6 -6
- package/dist/modules/commands/components/dialog-command.client.d.mts +8 -8
- package/dist/modules/commands/components/dropdown-command.client.d.mts +5 -5
- package/dist/modules/commands/components/empty-command.client.d.mts +2 -2
- package/dist/modules/commands/components/form-dialog-command.client.d.mts +11 -11
- package/dist/modules/commands/hooks/use-command-menu.client.d.mts.map +1 -1
- package/dist/modules/commands/hooks/use-command-menu.client.mjs +0 -5
- package/dist/modules/commands/hooks/use-command-menu.client.mjs.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/dropdown-menu.client.d.mts +3 -3
- package/dist/modules/commands/menus/inline-menu.client.d.mts +3 -3
- package/dist/modules/commands/menus/responsive-menu.client.d.mts +3 -3
- package/dist/modules/commands/utils/archive-command.client.d.mts +3 -3
- package/dist/modules/commands/utils/delete-command.client.d.mts +3 -3
- 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/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/slider.client.d.mts +2 -2
- 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/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/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/inline-table/components/cells/common.d.mts +2 -2
- 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/inputs/advanced-select.client.d.mts +2 -2
- 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/input.client.d.mts +3 -3
- 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/select.client.d.mts +2 -2
- package/dist/modules/data-tables/tables/inline-table/components/table.d.mts +2 -2
- package/dist/modules/data-tables/tables/inline-table/hooks/context.client.d.mts +2 -2
- 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/context.client.d.mts +2 -2
- 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 +4 -4
- package/dist/modules/router/handler/init.server.mjs +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.client.d.mts +5 -5
- package/dist/modules/storage/components/image-grid.client.d.mts +3 -3
- package/dist/modules/storage/components/image-grid.client.mjs +2 -2
- 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 -33
- package/dist/modules/storage/components/upload-zone.client.d.mts.map +1 -1
- package/dist/modules/storage/components/upload-zone.client.mjs +19 -93
- package/dist/modules/storage/components/upload-zone.client.mjs.map +1 -1
- package/dist/modules/storage/config/filters.d.mts +1 -0
- package/dist/modules/storage/config/filters.d.mts.map +1 -1
- package/dist/modules/storage/config/filters.mjs +1 -0
- 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 +1 -1
- package/dist/modules/storage/lib/router.server.d.mts +3239 -2319
- 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 +124 -90
- package/dist/modules/storage/lib/schema.d.mts.map +1 -1
- package/dist/modules/storage/lib/schema.mjs +2 -1
- package/dist/modules/storage/lib/schema.mjs.map +1 -1
- package/dist/modules/storage/lib/service.server.d.mts +28 -39
- package/dist/modules/storage/lib/service.server.d.mts.map +1 -1
- package/dist/modules/storage/lib/service.server.mjs +6 -6
- package/dist/modules/storage/lib/service.server.mjs.map +1 -1
- package/dist/modules/storage/lib/validators.d.mts +166 -86
- package/dist/modules/storage/lib/validators.d.mts.map +1 -1
- package/dist/modules/storage/lib/validators.mjs +2 -1
- package/dist/modules/storage/lib/validators.mjs.map +1 -1
- package/dist/router/server.mjs +1 -1
- package/dist/storage/client.d.mts +2 -1
- package/dist/storage/client.mjs +2 -8
- package/dist/storage.d.mts +2 -2
- package/dist/storage.mjs +1 -1
- package/package.json +4 -3
- 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 +55 -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/helpers.ts +39 -3
- package/src/components/editor/lib/utils.ts +32 -0
- package/src/components/editor/lib/variants.ts +72 -1
- package/src/components/entry.ts +4 -1
- package/src/components/layouts/error-page.tsx +61 -0
- package/src/components/layouts/not-allowed-page.tsx +1 -1
- package/src/components/navigation/admin-sidebar-paths.client.tsx +18 -2
- package/src/components/ui/tooltip.client.tsx +1 -1
- package/src/lib/hooks/use-indicator.tsx +27 -18
- package/src/modules/auth/components/allowed.client.tsx +35 -7
- package/src/modules/auth/hooks/use-permission.ts +88 -2
- package/src/modules/commands/hooks/use-command-menu.client.tsx +4 -7
- 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.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 -116
- package/src/modules/storage/config/filters.ts +1 -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/router.server.ts +1 -0
- package/src/modules/storage/lib/schema.ts +1 -0
- package/src/modules/storage/lib/service.server.ts +10 -4
- package/src/modules/storage/lib/validators.ts +1 -0
- package/dist/modules/auth/lib/utils.mjs +0 -21
- package/dist/modules/auth/lib/utils.mjs.map +0 -1
- 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
|
@@ -3,22 +3,29 @@
|
|
|
3
3
|
import { Combobox, ComboboxProps } from "@/components/ui/combobox.client";
|
|
4
4
|
import { useInlineEdit, useInlineEditOptions } from "../hooks/use-inline.client";
|
|
5
5
|
|
|
6
|
-
export type InlineComboboxProps<TValue> = useInlineEditOptions<
|
|
6
|
+
export type InlineComboboxProps<TValue, Required extends boolean = false> = useInlineEditOptions<
|
|
7
|
+
string,
|
|
8
|
+
Required
|
|
9
|
+
> &
|
|
7
10
|
Omit<ComboboxProps<TValue>, "value">;
|
|
8
11
|
|
|
9
|
-
export function InlineCombobox<TValue>({
|
|
12
|
+
export function InlineCombobox<TValue, Required extends boolean>({
|
|
10
13
|
initialValue,
|
|
11
14
|
action,
|
|
12
15
|
permission,
|
|
13
16
|
onSelect,
|
|
14
17
|
onBlur,
|
|
15
18
|
disabled,
|
|
19
|
+
updateStrategy,
|
|
20
|
+
isRequired,
|
|
16
21
|
...props
|
|
17
|
-
}: InlineComboboxProps<TValue>) {
|
|
18
|
-
const { value,
|
|
22
|
+
}: InlineComboboxProps<TValue, Required>) {
|
|
23
|
+
const { value, handleChange, handleBlur, isAllowed } = useInlineEdit({
|
|
19
24
|
initialValue,
|
|
20
25
|
action,
|
|
21
26
|
permission,
|
|
27
|
+
updateStrategy,
|
|
28
|
+
isRequired,
|
|
22
29
|
});
|
|
23
30
|
|
|
24
31
|
return (
|
|
@@ -27,11 +34,11 @@ export function InlineCombobox<TValue>({
|
|
|
27
34
|
value={value}
|
|
28
35
|
disabled={disabled || !isAllowed}
|
|
29
36
|
onSelect={(value) => {
|
|
30
|
-
|
|
37
|
+
handleChange(value ?? null);
|
|
31
38
|
onSelect?.(value as TValue);
|
|
32
39
|
}}
|
|
33
40
|
onBlur={(e) => {
|
|
34
|
-
|
|
41
|
+
handleBlur(e.target.value ?? null);
|
|
35
42
|
onBlur?.(e);
|
|
36
43
|
}}
|
|
37
44
|
/>
|
|
@@ -13,41 +13,53 @@ import { inlineEditVariants, InlineEditVariantsProps } from "../lib/variants";
|
|
|
13
13
|
|
|
14
14
|
const formatDate = (value: Date) => format(value, "dd/MM/yyyy");
|
|
15
15
|
const parseDate = (value: string) => new Date(value.split("/").reverse().join("-"));
|
|
16
|
+
const isValidDate = (date: Date) => date instanceof Date && date.toString() !== "Invalid Date";
|
|
16
17
|
|
|
17
|
-
export function InlineDateInput({
|
|
18
|
+
export function InlineDateInput<Required extends boolean = false>({
|
|
18
19
|
initialValue,
|
|
19
20
|
action,
|
|
20
21
|
permission,
|
|
21
22
|
variant,
|
|
22
23
|
className,
|
|
24
|
+
updateStrategy,
|
|
25
|
+
isRequired,
|
|
23
26
|
...props
|
|
24
|
-
}: ComponentProps<"div"> & useInlineEditOptions<Date> & InlineEditVariantsProps) {
|
|
27
|
+
}: ComponentProps<"div"> & useInlineEditOptions<Date, Required> & InlineEditVariantsProps) {
|
|
25
28
|
const [inValid, setInValid] = React.useState<boolean>(false);
|
|
26
29
|
|
|
27
|
-
const { value, setValue,
|
|
30
|
+
const { value, setValue, handleChange, handleBlur, status, isAllowed } = useInlineEdit({
|
|
28
31
|
initialValue,
|
|
29
32
|
action,
|
|
30
33
|
permission,
|
|
34
|
+
updateStrategy,
|
|
35
|
+
isRequired,
|
|
31
36
|
});
|
|
32
37
|
|
|
33
38
|
const [stringDate, setStringDate] = React.useState<string>(
|
|
34
39
|
initialValue ? formatDate(initialValue) : "",
|
|
35
40
|
);
|
|
36
41
|
|
|
42
|
+
/**
|
|
43
|
+
* Update string date when value changes
|
|
44
|
+
*/
|
|
45
|
+
React.useEffect(() => {
|
|
46
|
+
if (value) setStringDate(formatDate(value));
|
|
47
|
+
}, [value]);
|
|
48
|
+
|
|
37
49
|
return (
|
|
38
50
|
<Popover>
|
|
39
|
-
<div {...props} className={cn("relative h-full",
|
|
51
|
+
<div {...props} className={cn("relative h-full", className)}>
|
|
40
52
|
<Input
|
|
41
53
|
data-input
|
|
42
54
|
type="string"
|
|
43
55
|
value={stringDate}
|
|
44
|
-
className={cn(inValid && "text-destructive")}
|
|
56
|
+
className={cn(inlineEditVariants({ variant, status }), inValid && "text-destructive")}
|
|
45
57
|
disabled={!isAllowed}
|
|
46
58
|
onChange={(e) => {
|
|
47
59
|
setStringDate(e.target.value);
|
|
48
60
|
const parsedDate = parseDate(e.target.value);
|
|
49
61
|
|
|
50
|
-
if (parsedDate
|
|
62
|
+
if (!isValidDate(parsedDate)) {
|
|
51
63
|
setInValid(true);
|
|
52
64
|
setValue(undefined);
|
|
53
65
|
} else {
|
|
@@ -57,7 +69,7 @@ export function InlineDateInput({
|
|
|
57
69
|
}}
|
|
58
70
|
onBlur={(e) => {
|
|
59
71
|
const parsedDate = parseDate(e.target.value);
|
|
60
|
-
|
|
72
|
+
handleBlur(isValidDate(parsedDate) ? parsedDate : null);
|
|
61
73
|
}}
|
|
62
74
|
/>
|
|
63
75
|
|
|
@@ -75,18 +87,22 @@ export function InlineDateInput({
|
|
|
75
87
|
</Button>
|
|
76
88
|
</PopoverTrigger>
|
|
77
89
|
</div>
|
|
90
|
+
|
|
78
91
|
<PopoverContent className="w-auto p-0">
|
|
79
92
|
<Calendar
|
|
80
93
|
mode="single"
|
|
81
|
-
|
|
82
|
-
selected={value}
|
|
83
|
-
defaultMonth={value}
|
|
84
|
-
disabled={
|
|
94
|
+
autoFocus
|
|
95
|
+
selected={value ?? undefined}
|
|
96
|
+
defaultMonth={value ?? undefined}
|
|
97
|
+
disabled={!isAllowed}
|
|
85
98
|
onSelect={(selectedDate) => {
|
|
86
99
|
if (!selectedDate) return;
|
|
87
|
-
|
|
100
|
+
|
|
88
101
|
setStringDate(formatDate(selectedDate));
|
|
89
|
-
|
|
102
|
+
|
|
103
|
+
handleChange(selectedDate ?? null);
|
|
104
|
+
handleBlur(selectedDate ?? null);
|
|
105
|
+
|
|
90
106
|
setInValid(false);
|
|
91
107
|
}}
|
|
92
108
|
/>
|
|
@@ -10,25 +10,29 @@ import React, { ComponentProps } from "react";
|
|
|
10
10
|
import { useInlineEdit, type useInlineEditOptions } from "../hooks/use-inline.client";
|
|
11
11
|
import { inlineEditVariants, InlineEditVariantsProps } from "../lib/variants";
|
|
12
12
|
|
|
13
|
-
type InlineEditDatePickerProps = ComponentProps<typeof Button> &
|
|
14
|
-
useInlineEditOptions<Date> &
|
|
13
|
+
type InlineEditDatePickerProps<Required extends boolean> = ComponentProps<typeof Button> &
|
|
14
|
+
useInlineEditOptions<Date, Required> &
|
|
15
15
|
InlineEditVariantsProps;
|
|
16
16
|
|
|
17
|
-
export function InlineDatePicker({
|
|
17
|
+
export function InlineDatePicker<Required extends boolean = false>({
|
|
18
18
|
initialValue,
|
|
19
19
|
action,
|
|
20
20
|
permission,
|
|
21
21
|
variant,
|
|
22
22
|
className,
|
|
23
23
|
disabled,
|
|
24
|
+
updateStrategy,
|
|
25
|
+
isRequired,
|
|
24
26
|
...props
|
|
25
|
-
}: InlineEditDatePickerProps) {
|
|
27
|
+
}: InlineEditDatePickerProps<Required>) {
|
|
26
28
|
const [open, setOpen] = React.useState(false);
|
|
27
29
|
|
|
28
|
-
const { value,
|
|
30
|
+
const { value, handleChange, handleBlur, isAllowed, status } = useInlineEdit({
|
|
29
31
|
initialValue,
|
|
30
32
|
action,
|
|
31
33
|
permission,
|
|
34
|
+
updateStrategy,
|
|
35
|
+
isRequired,
|
|
32
36
|
});
|
|
33
37
|
|
|
34
38
|
return (
|
|
@@ -36,7 +40,7 @@ export function InlineDatePicker({
|
|
|
36
40
|
open={open}
|
|
37
41
|
onOpenChange={(open) => {
|
|
38
42
|
setOpen(open);
|
|
39
|
-
if (!open && value)
|
|
43
|
+
if (!open && value) handleBlur(value);
|
|
40
44
|
}}
|
|
41
45
|
>
|
|
42
46
|
<PopoverTrigger asChild>
|
|
@@ -44,7 +48,7 @@ export function InlineDatePicker({
|
|
|
44
48
|
{...props}
|
|
45
49
|
type="button"
|
|
46
50
|
variant="outline"
|
|
47
|
-
className={cn("w-full", inlineEditVariants({ variant }), className)}
|
|
51
|
+
className={cn("w-full", inlineEditVariants({ variant, status }), className)}
|
|
48
52
|
disabled={disabled || !isAllowed}
|
|
49
53
|
>
|
|
50
54
|
<CalendarIcon className="mr-2 h-4 w-4" />
|
|
@@ -55,9 +59,9 @@ export function InlineDatePicker({
|
|
|
55
59
|
<PopoverContent className="w-auto p-0">
|
|
56
60
|
<Calendar
|
|
57
61
|
mode="single"
|
|
62
|
+
autoFocus
|
|
58
63
|
selected={value ? new Date(value) : undefined}
|
|
59
|
-
onSelect={(date) => date
|
|
60
|
-
initialFocus
|
|
64
|
+
onSelect={(date) => handleChange(date ?? null)}
|
|
61
65
|
/>
|
|
62
66
|
</PopoverContent>
|
|
63
67
|
</Popover>
|
|
@@ -6,40 +6,40 @@ import { cn } from "@/lib/utils/cn";
|
|
|
6
6
|
import { useInlineEdit, type useInlineEditOptions } from "../hooks/use-inline.client";
|
|
7
7
|
import { inlineEditVariants, InlineEditVariantsProps } from "../lib/variants";
|
|
8
8
|
|
|
9
|
-
export type InlineEditorProps = useInlineEditOptions<
|
|
9
|
+
export type InlineEditorProps<Required extends boolean = false> = useInlineEditOptions<
|
|
10
|
+
EditorJSONContent,
|
|
11
|
+
Required
|
|
12
|
+
> &
|
|
10
13
|
InlineEditVariantsProps &
|
|
11
14
|
Omit<EditorProps, "value" | "onUpdate" | "onBlur" | "variant">;
|
|
12
15
|
|
|
13
|
-
export function InlineEditor({
|
|
16
|
+
export function InlineEditor<Required extends boolean = false>({
|
|
14
17
|
initialValue,
|
|
15
18
|
action,
|
|
16
19
|
extensions,
|
|
17
20
|
variant,
|
|
18
21
|
disabled,
|
|
19
22
|
permission,
|
|
23
|
+
updateStrategy,
|
|
24
|
+
isRequired,
|
|
20
25
|
className,
|
|
21
26
|
children,
|
|
22
|
-
}: InlineEditorProps) {
|
|
23
|
-
const { value,
|
|
27
|
+
}: InlineEditorProps<Required>) {
|
|
28
|
+
const { value, handleChange, handleBlur, isAllowed, status } = useInlineEdit({
|
|
24
29
|
initialValue,
|
|
25
30
|
action,
|
|
26
31
|
permission,
|
|
32
|
+
updateStrategy,
|
|
33
|
+
isRequired,
|
|
27
34
|
});
|
|
28
35
|
|
|
29
|
-
// const [debouncedValue] = useDebounce(value, 500);
|
|
30
|
-
// useEffect(() => {
|
|
31
|
-
// if (!value) return;
|
|
32
|
-
// handleUpdate(value);
|
|
33
|
-
// // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
34
|
-
// }, [debouncedValue]);
|
|
35
|
-
|
|
36
36
|
return (
|
|
37
37
|
<Editor
|
|
38
38
|
value={value}
|
|
39
39
|
extensions={extensions}
|
|
40
|
-
onUpdate={(value) =>
|
|
41
|
-
onBlur={(value) =>
|
|
42
|
-
className={cn(inlineEditVariants({ variant }), className)}
|
|
40
|
+
onUpdate={(value) => handleChange(value)}
|
|
41
|
+
onBlur={(value) => handleBlur(value)}
|
|
42
|
+
className={cn(inlineEditVariants({ variant, status }), className)}
|
|
43
43
|
disabled={disabled || !isAllowed}
|
|
44
44
|
variant={variant}
|
|
45
45
|
>
|
|
@@ -6,8 +6,11 @@ import { ComponentProps } from "react";
|
|
|
6
6
|
import { useInlineEdit, type useInlineEditOptions } from "../hooks/use-inline.client";
|
|
7
7
|
import { inlineEditVariants, InlineEditVariantsProps } from "../lib/variants";
|
|
8
8
|
|
|
9
|
-
type InlineRecipientInputProps
|
|
10
|
-
|
|
9
|
+
type InlineRecipientInputProps<Required extends boolean = false> = Omit<
|
|
10
|
+
ComponentProps<typeof RecipientInput>,
|
|
11
|
+
"value" | "onChange"
|
|
12
|
+
> &
|
|
13
|
+
useInlineEditOptions<string[], Required> &
|
|
11
14
|
InlineEditVariantsProps & {
|
|
12
15
|
contacts: Contact[];
|
|
13
16
|
};
|
|
@@ -15,20 +18,24 @@ type InlineRecipientInputProps = Omit<ComponentProps<typeof RecipientInput>, "va
|
|
|
15
18
|
/**
|
|
16
19
|
* The inline edit recipient input component.
|
|
17
20
|
*/
|
|
18
|
-
export function InlineRecipientInput({
|
|
21
|
+
export function InlineRecipientInput<Required extends boolean = false>({
|
|
19
22
|
initialValue,
|
|
20
23
|
action,
|
|
21
24
|
variant,
|
|
22
25
|
disabled,
|
|
23
26
|
contacts,
|
|
24
27
|
permission,
|
|
28
|
+
updateStrategy,
|
|
29
|
+
isRequired,
|
|
25
30
|
className,
|
|
26
31
|
...props
|
|
27
|
-
}: InlineRecipientInputProps) {
|
|
28
|
-
const { value,
|
|
32
|
+
}: InlineRecipientInputProps<Required>) {
|
|
33
|
+
const { value, handleChange, handleBlur, isAllowed, status } = useInlineEdit({
|
|
29
34
|
initialValue,
|
|
30
35
|
action,
|
|
31
36
|
permission,
|
|
37
|
+
updateStrategy,
|
|
38
|
+
isRequired,
|
|
32
39
|
});
|
|
33
40
|
|
|
34
41
|
return (
|
|
@@ -37,11 +44,11 @@ export function InlineRecipientInput({
|
|
|
37
44
|
contacts={contacts}
|
|
38
45
|
value={value ?? []}
|
|
39
46
|
onChange={(newValue) => {
|
|
40
|
-
|
|
41
|
-
|
|
47
|
+
handleChange(newValue);
|
|
48
|
+
handleBlur(newValue);
|
|
42
49
|
}}
|
|
43
50
|
disabled={disabled || !isAllowed}
|
|
44
|
-
className={cn(inlineEditVariants({ variant }), className)}
|
|
51
|
+
className={cn(inlineEditVariants({ variant, status }), className)}
|
|
45
52
|
/>
|
|
46
53
|
);
|
|
47
54
|
}
|
|
@@ -7,30 +7,37 @@ import { CheckIcon, XIcon } from "lucide-react";
|
|
|
7
7
|
import { ComponentProps, useState } from "react";
|
|
8
8
|
import { useInlineEdit, useInlineEditOptions } from "../hooks/use-inline.client";
|
|
9
9
|
|
|
10
|
-
type InlineStringInputToggleProps<
|
|
11
|
-
|
|
10
|
+
type InlineStringInputToggleProps<Required extends boolean = false> = Omit<
|
|
11
|
+
ComponentProps<typeof Input>,
|
|
12
|
+
"type"
|
|
13
|
+
> &
|
|
14
|
+
useInlineEditOptions<string, Required>;
|
|
12
15
|
|
|
13
|
-
export function InlineStringInputToggle({
|
|
16
|
+
export function InlineStringInputToggle<Required extends boolean>({
|
|
14
17
|
initialValue,
|
|
15
18
|
action,
|
|
16
19
|
disabled,
|
|
17
20
|
permission,
|
|
21
|
+
updateStrategy,
|
|
22
|
+
isRequired,
|
|
18
23
|
className,
|
|
19
24
|
...props
|
|
20
|
-
}: InlineStringInputToggleProps<
|
|
25
|
+
}: InlineStringInputToggleProps<Required>) {
|
|
21
26
|
const [enabled, setEnabled] = useState(!!initialValue);
|
|
22
27
|
|
|
23
|
-
const { value,
|
|
28
|
+
const { value, handleChange, handleBlur, isAllowed } = useInlineEdit({
|
|
24
29
|
initialValue,
|
|
25
30
|
action,
|
|
26
31
|
permission,
|
|
32
|
+
updateStrategy,
|
|
33
|
+
isRequired,
|
|
27
34
|
});
|
|
28
35
|
|
|
29
36
|
function handleToggle() {
|
|
30
37
|
setEnabled(!enabled);
|
|
31
38
|
if (!enabled) return;
|
|
32
39
|
|
|
33
|
-
|
|
40
|
+
handleBlur(null);
|
|
34
41
|
}
|
|
35
42
|
|
|
36
43
|
const isDisabled = !enabled || disabled || !isAllowed;
|
|
@@ -40,10 +47,10 @@ export function InlineStringInputToggle({
|
|
|
40
47
|
<Input
|
|
41
48
|
{...props}
|
|
42
49
|
type="text"
|
|
43
|
-
value={value}
|
|
50
|
+
value={value ?? undefined}
|
|
44
51
|
disabled={isDisabled}
|
|
45
|
-
onChange={(e) =>
|
|
46
|
-
onBlur={(e) =>
|
|
52
|
+
onChange={(e) => handleChange(e.target.value ? e.target.value : null)}
|
|
53
|
+
onBlur={(e) => handleBlur(e.target.value ? e.target.value : null)}
|
|
47
54
|
className={cn("border-border/70 hover:border-border w-full", className)}
|
|
48
55
|
/>
|
|
49
56
|
|
|
@@ -6,39 +6,46 @@ import { ComponentProps } from "react";
|
|
|
6
6
|
import { useInlineEdit, type useInlineEditOptions } from "../hooks/use-inline.client";
|
|
7
7
|
import { inlineEditVariants, InlineEditVariantsProps } from "../lib/variants";
|
|
8
8
|
|
|
9
|
-
type InlineEditInputProps<TValue> = Omit<
|
|
10
|
-
|
|
9
|
+
type InlineEditInputProps<TValue, Required extends boolean = false> = Omit<
|
|
10
|
+
ComponentProps<typeof Input>,
|
|
11
|
+
"type"
|
|
12
|
+
> &
|
|
13
|
+
useInlineEditOptions<TValue, Required> &
|
|
11
14
|
InlineEditVariantsProps;
|
|
12
15
|
|
|
13
16
|
/**
|
|
14
17
|
* The inline edit string input component.
|
|
15
18
|
*/
|
|
16
|
-
export function InlineStringInput({
|
|
19
|
+
export function InlineStringInput<Required extends boolean = false>({
|
|
17
20
|
initialValue,
|
|
18
21
|
action,
|
|
19
22
|
variant,
|
|
20
23
|
className,
|
|
21
24
|
permission,
|
|
25
|
+
updateStrategy,
|
|
26
|
+
isRequired,
|
|
22
27
|
disabled,
|
|
23
28
|
...props
|
|
24
|
-
}: InlineEditInputProps<string
|
|
25
|
-
const { value,
|
|
29
|
+
}: InlineEditInputProps<string, Required>) {
|
|
30
|
+
const { value, handleChange, handleBlur, isAllowed, status } = useInlineEdit({
|
|
26
31
|
initialValue,
|
|
27
32
|
action,
|
|
28
33
|
permission,
|
|
34
|
+
updateStrategy,
|
|
35
|
+
isRequired,
|
|
29
36
|
});
|
|
30
37
|
|
|
31
38
|
return (
|
|
32
39
|
<Input
|
|
33
40
|
{...props}
|
|
34
41
|
type="text"
|
|
35
|
-
value={value}
|
|
42
|
+
value={value ?? undefined}
|
|
36
43
|
disabled={disabled || !isAllowed}
|
|
37
|
-
onChange={(e) =>
|
|
38
|
-
onBlur={(e) =>
|
|
44
|
+
onChange={(e) => handleChange(e.target.value ? e.target.value : null)}
|
|
45
|
+
onBlur={(e) => handleBlur(e.target.value ? e.target.value : null)}
|
|
39
46
|
className={cn(
|
|
40
47
|
"border-border/70 hover:border-border w-full",
|
|
41
|
-
inlineEditVariants({ variant }),
|
|
48
|
+
inlineEditVariants({ variant, status }),
|
|
42
49
|
className,
|
|
43
50
|
)}
|
|
44
51
|
/>
|
|
@@ -48,19 +55,26 @@ export function InlineStringInput({
|
|
|
48
55
|
/**
|
|
49
56
|
* The inline edit number input component.
|
|
50
57
|
*/
|
|
51
|
-
|
|
58
|
+
const parseValueAsNumber = (valueAsNumber: number): number | null =>
|
|
59
|
+
!isNaN(Number(valueAsNumber)) ? valueAsNumber : null;
|
|
60
|
+
|
|
61
|
+
export function InlineNumberInput<Required extends boolean = false>({
|
|
52
62
|
initialValue,
|
|
53
63
|
action,
|
|
54
64
|
variant,
|
|
55
65
|
className,
|
|
56
66
|
permission,
|
|
67
|
+
updateStrategy,
|
|
68
|
+
isRequired,
|
|
57
69
|
disabled,
|
|
58
70
|
...props
|
|
59
|
-
}: InlineEditInputProps<number
|
|
60
|
-
const { value,
|
|
71
|
+
}: InlineEditInputProps<number, Required>) {
|
|
72
|
+
const { value, handleChange, handleBlur, isAllowed, status } = useInlineEdit({
|
|
61
73
|
initialValue,
|
|
62
74
|
action,
|
|
63
75
|
permission,
|
|
76
|
+
updateStrategy,
|
|
77
|
+
isRequired,
|
|
64
78
|
});
|
|
65
79
|
|
|
66
80
|
return (
|
|
@@ -69,15 +83,11 @@ export function InlineNumberInput({
|
|
|
69
83
|
type="number"
|
|
70
84
|
value={value ?? undefined}
|
|
71
85
|
disabled={disabled || !isAllowed}
|
|
72
|
-
onChange={(e) =>
|
|
73
|
-
|
|
74
|
-
}
|
|
75
|
-
onBlur={(e) =>
|
|
76
|
-
handleUpdate(!isNaN(e.target.valueAsNumber) ? e.target.valueAsNumber : undefined)
|
|
77
|
-
}
|
|
86
|
+
onChange={(e) => handleChange(parseValueAsNumber(e.target.valueAsNumber))}
|
|
87
|
+
onBlur={(e) => handleBlur(parseValueAsNumber(e.target.valueAsNumber))}
|
|
78
88
|
className={cn(
|
|
79
89
|
"border-border/70 hover:border-border w-full",
|
|
80
|
-
inlineEditVariants({ variant }),
|
|
90
|
+
inlineEditVariants({ variant, status }),
|
|
81
91
|
className,
|
|
82
92
|
)}
|
|
83
93
|
/>
|
|
@@ -93,13 +103,17 @@ export function InlineDecimalInput({
|
|
|
93
103
|
variant,
|
|
94
104
|
className,
|
|
95
105
|
permission,
|
|
106
|
+
updateStrategy,
|
|
107
|
+
isRequired,
|
|
96
108
|
disabled,
|
|
97
109
|
...props
|
|
98
|
-
}: InlineEditInputProps<string
|
|
99
|
-
const { value,
|
|
110
|
+
}: InlineEditInputProps<string>) {
|
|
111
|
+
const { value, handleChange, handleBlur, isAllowed, status } = useInlineEdit({
|
|
100
112
|
initialValue,
|
|
101
113
|
action,
|
|
102
114
|
permission,
|
|
115
|
+
updateStrategy,
|
|
116
|
+
isRequired,
|
|
103
117
|
});
|
|
104
118
|
|
|
105
119
|
return (
|
|
@@ -108,11 +122,11 @@ export function InlineDecimalInput({
|
|
|
108
122
|
type="number"
|
|
109
123
|
value={value ?? undefined}
|
|
110
124
|
disabled={disabled || !isAllowed}
|
|
111
|
-
onChange={(e) =>
|
|
112
|
-
onBlur={(e) =>
|
|
125
|
+
onChange={(e) => handleChange(e.target.value ? e.target.value : null)}
|
|
126
|
+
onBlur={(e) => handleBlur(e.target.value ? e.target.value : null)}
|
|
113
127
|
className={cn(
|
|
114
128
|
"border-border/70 hover:border-border w-full",
|
|
115
|
-
inlineEditVariants({ variant }),
|
|
129
|
+
inlineEditVariants({ variant, status }),
|
|
116
130
|
className,
|
|
117
131
|
)}
|
|
118
132
|
/>
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
SelectTrigger,
|
|
8
8
|
SelectValue,
|
|
9
9
|
} from "@/components/ui/select.client";
|
|
10
|
+
import { useIndicator } from "@/lib/entry.client";
|
|
10
11
|
import { cn } from "@/lib/utils/cn";
|
|
11
12
|
import type {
|
|
12
13
|
SelectContentProps,
|
|
@@ -18,29 +19,31 @@ import type {
|
|
|
18
19
|
import { useInlineEdit, type useInlineEditOptions } from "../hooks/use-inline.client";
|
|
19
20
|
import { inlineEditVariants, InlineEditVariantsProps } from "../lib/variants";
|
|
20
21
|
|
|
21
|
-
export
|
|
22
|
-
|
|
23
|
-
export function InlineSelect({
|
|
22
|
+
export function InlineSelect<Required extends boolean = false>({
|
|
24
23
|
initialValue,
|
|
25
24
|
action,
|
|
26
25
|
permission,
|
|
26
|
+
updateStrategy,
|
|
27
|
+
isRequired,
|
|
27
28
|
disabled,
|
|
28
29
|
...props
|
|
29
|
-
}:
|
|
30
|
-
const { value,
|
|
30
|
+
}: SelectProps & useInlineEditOptions<string, Required>) {
|
|
31
|
+
const { value, handleChange, handleBlur, isAllowed } = useInlineEdit({
|
|
31
32
|
initialValue,
|
|
32
33
|
action,
|
|
33
34
|
permission,
|
|
35
|
+
updateStrategy,
|
|
36
|
+
isRequired,
|
|
34
37
|
});
|
|
35
38
|
|
|
36
39
|
return (
|
|
37
40
|
<Select
|
|
38
41
|
{...props}
|
|
39
42
|
disabled={disabled || !isAllowed}
|
|
40
|
-
defaultValue={value}
|
|
43
|
+
defaultValue={value ?? undefined}
|
|
41
44
|
onValueChange={(value) => {
|
|
42
|
-
|
|
43
|
-
|
|
45
|
+
handleChange(value ? value : null);
|
|
46
|
+
handleBlur(value ? value : null);
|
|
44
47
|
}}
|
|
45
48
|
/>
|
|
46
49
|
);
|
|
@@ -53,7 +56,11 @@ export function InlineSelectTrigger({
|
|
|
53
56
|
className,
|
|
54
57
|
...props
|
|
55
58
|
}: InlineSelectTriggerProps & InlineEditVariantsProps) {
|
|
56
|
-
|
|
59
|
+
const { status } = useIndicator();
|
|
60
|
+
|
|
61
|
+
return (
|
|
62
|
+
<SelectTrigger {...props} className={cn(inlineEditVariants({ variant, status }), className)} />
|
|
63
|
+
);
|
|
57
64
|
}
|
|
58
65
|
|
|
59
66
|
export type InlineSelectContentProps = SelectContentProps;
|
|
@@ -4,27 +4,31 @@ import { Switch } from "@/components/ui/switch";
|
|
|
4
4
|
import { type SwitchProps } from "@radix-ui/react-switch";
|
|
5
5
|
import { useInlineEdit, type useInlineEditOptions } from "../hooks/use-inline.client";
|
|
6
6
|
|
|
7
|
-
export function InlineSwitch({
|
|
7
|
+
export function InlineSwitch<Required extends boolean = false>({
|
|
8
8
|
initialValue,
|
|
9
9
|
action,
|
|
10
10
|
permission,
|
|
11
|
+
updateStrategy,
|
|
12
|
+
isRequired,
|
|
11
13
|
disabled,
|
|
12
14
|
...props
|
|
13
|
-
}: SwitchProps & useInlineEditOptions<boolean>) {
|
|
14
|
-
const { value,
|
|
15
|
+
}: SwitchProps & useInlineEditOptions<boolean, Required>) {
|
|
16
|
+
const { value, handleChange, handleBlur, isAllowed } = useInlineEdit({
|
|
15
17
|
initialValue,
|
|
16
18
|
action,
|
|
17
19
|
permission,
|
|
20
|
+
updateStrategy,
|
|
21
|
+
isRequired,
|
|
18
22
|
});
|
|
19
23
|
|
|
20
24
|
return (
|
|
21
25
|
<Switch
|
|
22
26
|
{...props}
|
|
23
27
|
disabled={disabled || !isAllowed}
|
|
24
|
-
defaultChecked={value}
|
|
28
|
+
defaultChecked={value ?? undefined}
|
|
25
29
|
onCheckedChange={(checked) => {
|
|
26
|
-
|
|
27
|
-
|
|
30
|
+
handleChange(checked ?? null);
|
|
31
|
+
handleBlur(checked ?? null);
|
|
28
32
|
}}
|
|
29
33
|
/>
|
|
30
34
|
);
|
|
@@ -5,21 +5,25 @@ import { cn } from "@/lib/utils/cn";
|
|
|
5
5
|
import type React from "react";
|
|
6
6
|
import { useInlineEdit, type useInlineEditOptions } from "../hooks/use-inline.client";
|
|
7
7
|
|
|
8
|
-
export type InlineEditToggleProps =
|
|
9
|
-
useInlineEditOptions<boolean>;
|
|
8
|
+
export type InlineEditToggleProps<Required extends boolean = false> =
|
|
9
|
+
React.HTMLAttributes<HTMLDivElement> & useInlineEditOptions<boolean, Required>;
|
|
10
10
|
|
|
11
|
-
export function InlineToggle({
|
|
11
|
+
export function InlineToggle<Required extends boolean = false>({
|
|
12
12
|
initialValue,
|
|
13
13
|
action,
|
|
14
14
|
children,
|
|
15
15
|
permission,
|
|
16
|
+
updateStrategy,
|
|
17
|
+
isRequired,
|
|
16
18
|
className,
|
|
17
19
|
...props
|
|
18
|
-
}: InlineEditToggleProps) {
|
|
19
|
-
const { value,
|
|
20
|
+
}: InlineEditToggleProps<Required>) {
|
|
21
|
+
const { value, handleChange, handleBlur, isAllowed } = useInlineEdit({
|
|
20
22
|
initialValue,
|
|
21
23
|
action,
|
|
22
24
|
permission,
|
|
25
|
+
updateStrategy,
|
|
26
|
+
isRequired,
|
|
23
27
|
});
|
|
24
28
|
|
|
25
29
|
return (
|
|
@@ -27,11 +31,11 @@ export function InlineToggle({
|
|
|
27
31
|
<Toggle
|
|
28
32
|
disabled={!isAllowed}
|
|
29
33
|
variant="outline"
|
|
30
|
-
pressed={value}
|
|
31
|
-
defaultChecked={initialValue}
|
|
34
|
+
pressed={value ?? undefined}
|
|
35
|
+
defaultChecked={initialValue ?? undefined}
|
|
32
36
|
onPressedChange={(value) => {
|
|
33
|
-
|
|
34
|
-
|
|
37
|
+
handleChange(value);
|
|
38
|
+
handleBlur(value);
|
|
35
39
|
}}
|
|
36
40
|
>
|
|
37
41
|
{children}
|
|
@@ -2,7 +2,6 @@ export * from "./components/combobox-dropdown.client";
|
|
|
2
2
|
export * from "./components/combobox.client";
|
|
3
3
|
export * from "./components/date-input.client";
|
|
4
4
|
export * from "./components/date-picker.client";
|
|
5
|
-
export * from "./components/deprecated-editor.client";
|
|
6
5
|
export * from "./components/editor.client";
|
|
7
6
|
export * from "./components/input-recipient.client";
|
|
8
7
|
export * from "./components/input-toggle.client";
|