@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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Table } from "../../../components/table.mjs";
|
|
2
2
|
import { InlineTableProvider } from "../hooks/context.client.mjs";
|
|
3
|
-
import * as
|
|
3
|
+
import * as react_jsx_runtime236 from "react/jsx-runtime";
|
|
4
4
|
import { ComponentProps } from "react";
|
|
5
5
|
|
|
6
6
|
//#region src/modules/data-tables/tables/inline-table/components/table.d.ts
|
|
@@ -10,7 +10,7 @@ declare function InlineTable<TData extends {
|
|
|
10
10
|
disabledColumns,
|
|
11
11
|
moveRowAction,
|
|
12
12
|
...props
|
|
13
|
-
}: ComponentProps<typeof Table> & ComponentProps<typeof InlineTableProvider>):
|
|
13
|
+
}: ComponentProps<typeof Table> & ComponentProps<typeof InlineTableProvider>): react_jsx_runtime236.JSX.Element;
|
|
14
14
|
//#endregion
|
|
15
15
|
export { InlineTable };
|
|
16
16
|
//# sourceMappingURL=table.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table.d.mts","names":[],"sources":["../../../../../../src/modules/data-tables/tables/inline-table/components/table.tsx"],"sourcesContent":[],"mappings":";;;;;;iBAagB;;;;;;GAIb,sBAAsB,SAAS,sBAAsB,uBAAoB,
|
|
1
|
+
{"version":3,"file":"table.d.mts","names":[],"sources":["../../../../../../src/modules/data-tables/tables/inline-table/components/table.tsx"],"sourcesContent":[],"mappings":";;;;;;iBAagB;;;;;;GAIb,sBAAsB,SAAS,sBAAsB,uBAAoB,oBAAA,CAAA,GAAA,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime239 from "react/jsx-runtime";
|
|
2
2
|
import { PropsWithChildren } from "react";
|
|
3
3
|
import { VisibilityState } from "@tanstack/react-table";
|
|
4
4
|
|
|
@@ -41,7 +41,7 @@ declare function InlineTableProvider<TData extends {
|
|
|
41
41
|
fromIndex: number;
|
|
42
42
|
toIndex: number;
|
|
43
43
|
}) => Promise<unknown>;
|
|
44
|
-
}>):
|
|
44
|
+
}>): react_jsx_runtime239.JSX.Element;
|
|
45
45
|
//#endregion
|
|
46
46
|
export { InlineTableContextValue, InlineTableProvider, useInlineTableContext };
|
|
47
47
|
//# sourceMappingURL=context.client.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.client.d.mts","names":[],"sources":["../../../../../../src/modules/data-tables/tables/inline-table/hooks/context.client.tsx"],"sourcesContent":[],"mappings":";;;;;;;;AAMiD,KAK5C,aAAA,GAAa;EAaN,WAAA,EAAA,KAAA;EAaI,OAAA,EAAA,SAAA;AAUhB,CAAA,GAAgB;EACd,WAAA,EAAA,IAAA;EACA,OAAA,EAAA,CAAA,MAAA,EAAA;IACA,SAAA,EAAA,MAAA;IAEkB,OAAA,EAAA,MAAA;EACiD,CAAA,EAAA,GAAA,IAAA;CAFlE;;;;KA3BS,uBAAA,GAA0B;oBAClB;;;;;iBAYJ,qBAAA,CAAA,GAAqB;;;;iBAUrB;;;;;;GAIb;oBACiB;;;;QACiD;KACnE,
|
|
1
|
+
{"version":3,"file":"context.client.d.mts","names":[],"sources":["../../../../../../src/modules/data-tables/tables/inline-table/hooks/context.client.tsx"],"sourcesContent":[],"mappings":";;;;;;;;AAMiD,KAK5C,aAAA,GAAa;EAaN,WAAA,EAAA,KAAA;EAaI,OAAA,EAAA,SAAA;AAUhB,CAAA,GAAgB;EACd,WAAA,EAAA,IAAA;EACA,OAAA,EAAA,CAAA,MAAA,EAAA;IACA,SAAA,EAAA,MAAA;IAEkB,OAAA,EAAA,MAAA;EACiD,CAAA,EAAA,GAAA,IAAA;CAFlE;;;;KA3BS,uBAAA,GAA0B;oBAClB;;;;;iBAYJ,qBAAA,CAAA,GAAqB;;;;iBAUrB;;;;;;GAIb;oBACiB;;;;QACiD;KACnE,oBAAA,CAAA,GAAA,CAAA"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { ComboboxDropdownItem, ComboboxDropdownProps } from "../../../components/ui/combobox-dropdown.client.mjs";
|
|
2
2
|
import { useInlineEditOptions } from "../hooks/use-inline.client.mjs";
|
|
3
3
|
import { InlineEditVariantsProps } from "../lib/variants.mjs";
|
|
4
|
-
import * as
|
|
4
|
+
import * as react_jsx_runtime1 from "react/jsx-runtime";
|
|
5
5
|
|
|
6
6
|
//#region src/modules/inline-edit/components/combobox-dropdown.client.d.ts
|
|
7
|
-
type InlineEditComboboxDropdownProps<TValue extends ComboboxDropdownItem> = useInlineEditOptions<string> & InlineEditVariantsProps & Omit<ComboboxDropdownProps<TValue>, "onSelect"> & {
|
|
7
|
+
type InlineEditComboboxDropdownProps<TValue extends ComboboxDropdownItem, Required extends boolean = false> = useInlineEditOptions<string, Required> & InlineEditVariantsProps & Omit<ComboboxDropdownProps<TValue>, "onSelect"> & {
|
|
8
8
|
onSelect?: ComboboxDropdownProps<TValue>["onSelect"];
|
|
9
9
|
};
|
|
10
|
-
declare function InlineComboboxDropdown<TValue extends ComboboxDropdownItem>({
|
|
10
|
+
declare function InlineComboboxDropdown<TValue extends ComboboxDropdownItem, Required extends boolean>({
|
|
11
11
|
selectedItem,
|
|
12
12
|
variant,
|
|
13
13
|
className,
|
|
@@ -15,9 +15,11 @@ declare function InlineComboboxDropdown<TValue extends ComboboxDropdownItem>({
|
|
|
15
15
|
initialValue,
|
|
16
16
|
action,
|
|
17
17
|
permission,
|
|
18
|
+
updateStrategy,
|
|
19
|
+
isRequired,
|
|
18
20
|
disabled,
|
|
19
21
|
...props
|
|
20
|
-
}: InlineEditComboboxDropdownProps<TValue>):
|
|
22
|
+
}: InlineEditComboboxDropdownProps<TValue, Required>): react_jsx_runtime1.JSX.Element;
|
|
21
23
|
//#endregion
|
|
22
24
|
export { InlineComboboxDropdown, InlineEditComboboxDropdownProps };
|
|
23
25
|
//# sourceMappingURL=combobox-dropdown.client.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"combobox-dropdown.client.d.mts","names":[],"sources":["../../../../src/modules/inline-edit/components/combobox-dropdown.client.tsx"],"sourcesContent":[],"mappings":";;;;;;KAWY,+
|
|
1
|
+
{"version":3,"file":"combobox-dropdown.client.d.mts","names":[],"sources":["../../../../src/modules/inline-edit/components/combobox-dropdown.client.tsx"],"sourcesContent":[],"mappings":";;;;;;KAWY,+CACK,0DAEb,6BAA6B,YAC/B,0BACA,KAAK,sBAAsB;aACd,sBAAsB;;AANzB,iBASI,sBAT2B,CAAA,eAU1B,oBAV0B,EAAA,iBAAA,OAAA,CAAA,CAAA;EAAA,YAAA;EAAA,OAAA;EAAA,SAAA;EAAA,QAAA;EAAA,YAAA;EAAA,MAAA;EAAA,UAAA;EAAA,cAAA;EAAA,UAAA;EAAA,QAAA;EAAA,GAAA;AAAA,CAAA,EAwBxC,+BAxBwC,CAwBR,MAxBQ,EAwBA,QAxBA,CAAA,CAAA,EAwBS,kBAAA,CAAA,GAAA,CAAA,OAxBT"}
|
|
@@ -7,21 +7,26 @@ import { inlineEditVariants } from "../lib/variants.mjs";
|
|
|
7
7
|
import { jsx } from "react/jsx-runtime";
|
|
8
8
|
|
|
9
9
|
//#region src/modules/inline-edit/components/combobox-dropdown.client.tsx
|
|
10
|
-
function InlineComboboxDropdown({ selectedItem, variant, className, onSelect, initialValue, action, permission, disabled, ...props }) {
|
|
11
|
-
const {
|
|
10
|
+
function InlineComboboxDropdown({ selectedItem, variant, className, onSelect, initialValue, action, permission, updateStrategy, isRequired, disabled, ...props }) {
|
|
11
|
+
const { handleChange, handleBlur, isAllowed, status } = useInlineEdit({
|
|
12
12
|
initialValue,
|
|
13
13
|
action,
|
|
14
|
-
permission
|
|
14
|
+
permission,
|
|
15
|
+
updateStrategy,
|
|
16
|
+
isRequired
|
|
15
17
|
});
|
|
16
18
|
const initialSelectedItem = props.items.find((item) => item.id === initialValue);
|
|
17
19
|
return /* @__PURE__ */ jsx(ComboboxDropdown, {
|
|
18
20
|
...props,
|
|
19
|
-
className: cn(inlineEditVariants({
|
|
21
|
+
className: cn(inlineEditVariants({
|
|
22
|
+
variant,
|
|
23
|
+
status
|
|
24
|
+
}), className),
|
|
20
25
|
disabled: disabled || !isAllowed,
|
|
21
26
|
selectedItem: selectedItem ?? initialSelectedItem,
|
|
22
27
|
onSelect: (event) => {
|
|
23
|
-
|
|
24
|
-
|
|
28
|
+
handleChange(event.id ?? null);
|
|
29
|
+
handleBlur(event.id ?? null);
|
|
25
30
|
onSelect?.(event);
|
|
26
31
|
}
|
|
27
32
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"combobox-dropdown.client.mjs","names":[],"sources":["../../../../src/modules/inline-edit/components/combobox-dropdown.client.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n ComboboxDropdown,\n ComboboxDropdownItem,\n type ComboboxDropdownProps,\n} from \"@/components/ui/combobox-dropdown.client\";\nimport { cn } from \"@/lib/utils/cn\";\nimport { useInlineEdit, type useInlineEditOptions } from \"../hooks/use-inline.client\";\nimport { inlineEditVariants, InlineEditVariantsProps } from \"../lib/variants\";\n\nexport type InlineEditComboboxDropdownProps
|
|
1
|
+
{"version":3,"file":"combobox-dropdown.client.mjs","names":[],"sources":["../../../../src/modules/inline-edit/components/combobox-dropdown.client.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n ComboboxDropdown,\n ComboboxDropdownItem,\n type ComboboxDropdownProps,\n} from \"@/components/ui/combobox-dropdown.client\";\nimport { cn } from \"@/lib/utils/cn\";\nimport { useInlineEdit, type useInlineEditOptions } from \"../hooks/use-inline.client\";\nimport { inlineEditVariants, InlineEditVariantsProps } from \"../lib/variants\";\n\nexport type InlineEditComboboxDropdownProps<\n TValue extends ComboboxDropdownItem,\n Required extends boolean = false,\n> = useInlineEditOptions<string, Required> &\n InlineEditVariantsProps &\n Omit<ComboboxDropdownProps<TValue>, \"onSelect\"> & {\n onSelect?: ComboboxDropdownProps<TValue>[\"onSelect\"];\n };\n\nexport function InlineComboboxDropdown<\n TValue extends ComboboxDropdownItem,\n Required extends boolean,\n>({\n selectedItem,\n variant,\n className,\n onSelect,\n initialValue,\n action,\n permission,\n updateStrategy,\n isRequired,\n disabled,\n ...props\n}: InlineEditComboboxDropdownProps<TValue, Required>) {\n const { handleChange, handleBlur, isAllowed, status } = useInlineEdit({\n initialValue,\n action,\n permission,\n updateStrategy,\n isRequired,\n });\n\n const initialSelectedItem = props.items.find((item) => item.id === initialValue);\n\n return (\n <ComboboxDropdown\n {...props}\n className={cn(inlineEditVariants({ variant, status }), className)}\n disabled={disabled || !isAllowed}\n selectedItem={selectedItem ?? initialSelectedItem}\n onSelect={(event) => {\n handleChange(event.id ?? null);\n handleBlur(event.id ?? null);\n onSelect?.(event);\n }}\n />\n );\n}\n"],"mappings":";;;;;;;;;AAoBA,SAAgB,uBAGd,EACA,cACA,SACA,WACA,UACA,cACA,QACA,YACA,gBACA,YACA,UACA,GAAG,SACiD;CACpD,MAAM,EAAE,cAAc,YAAY,WAAW,WAAW,cAAc;EACpE;EACA;EACA;EACA;EACA;EACD,CAAC;CAEF,MAAM,sBAAsB,MAAM,MAAM,MAAM,SAAS,KAAK,OAAO,aAAa;AAEhF,QACE,oBAAC;EACC,GAAI;EACJ,WAAW,GAAG,mBAAmB;GAAE;GAAS;GAAQ,CAAC,EAAE,UAAU;EACjE,UAAU,YAAY,CAAC;EACvB,cAAc,gBAAgB;EAC9B,WAAW,UAAU;AACnB,gBAAa,MAAM,MAAM,KAAK;AAC9B,cAAW,MAAM,MAAM,KAAK;AAC5B,cAAW,MAAM;;GAEnB"}
|
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
import { ComboboxProps } from "../../../components/ui/combobox.client.mjs";
|
|
2
2
|
import { useInlineEditOptions } from "../hooks/use-inline.client.mjs";
|
|
3
|
-
import * as
|
|
3
|
+
import * as react_jsx_runtime2 from "react/jsx-runtime";
|
|
4
4
|
|
|
5
5
|
//#region src/modules/inline-edit/components/combobox.client.d.ts
|
|
6
|
-
type InlineComboboxProps<TValue> = useInlineEditOptions<string> & Omit<ComboboxProps<TValue>, "value">;
|
|
7
|
-
declare function InlineCombobox<TValue>({
|
|
6
|
+
type InlineComboboxProps<TValue, Required extends boolean = false> = useInlineEditOptions<string, Required> & Omit<ComboboxProps<TValue>, "value">;
|
|
7
|
+
declare function InlineCombobox<TValue, Required extends boolean>({
|
|
8
8
|
initialValue,
|
|
9
9
|
action,
|
|
10
10
|
permission,
|
|
11
11
|
onSelect,
|
|
12
12
|
onBlur,
|
|
13
13
|
disabled,
|
|
14
|
+
updateStrategy,
|
|
15
|
+
isRequired,
|
|
14
16
|
...props
|
|
15
|
-
}: InlineComboboxProps<TValue>):
|
|
17
|
+
}: InlineComboboxProps<TValue, Required>): react_jsx_runtime2.JSX.Element;
|
|
16
18
|
//#endregion
|
|
17
19
|
export { InlineCombobox, InlineComboboxProps };
|
|
18
20
|
//# sourceMappingURL=combobox.client.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"combobox.client.d.mts","names":[],"sources":["../../../../src/modules/inline-edit/components/combobox.client.tsx"],"sourcesContent":[],"mappings":";;;;;KAKY,
|
|
1
|
+
{"version":3,"file":"combobox.client.d.mts","names":[],"sources":["../../../../src/modules/inline-edit/components/combobox.client.tsx"],"sourcesContent":[],"mappings":";;;;;KAKY,gEAAgE,6BAE1E,YAEA,KAAK,cAAc;iBAEL;;;;;;;;;;GAUb,oBAAoB,QAAQ,YAAS,kBAAA,CAAA,GAAA,CAAA"}
|
|
@@ -5,22 +5,24 @@ import { useInlineEdit } from "../hooks/use-inline.client.mjs";
|
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
6
|
|
|
7
7
|
//#region src/modules/inline-edit/components/combobox.client.tsx
|
|
8
|
-
function InlineCombobox({ initialValue, action, permission, onSelect, onBlur, disabled, ...props }) {
|
|
9
|
-
const { value,
|
|
8
|
+
function InlineCombobox({ initialValue, action, permission, onSelect, onBlur, disabled, updateStrategy, isRequired, ...props }) {
|
|
9
|
+
const { value, handleChange, handleBlur, isAllowed } = useInlineEdit({
|
|
10
10
|
initialValue,
|
|
11
11
|
action,
|
|
12
|
-
permission
|
|
12
|
+
permission,
|
|
13
|
+
updateStrategy,
|
|
14
|
+
isRequired
|
|
13
15
|
});
|
|
14
16
|
return /* @__PURE__ */ jsx(Combobox, {
|
|
15
17
|
...props,
|
|
16
18
|
value,
|
|
17
19
|
disabled: disabled || !isAllowed,
|
|
18
20
|
onSelect: (value$1) => {
|
|
19
|
-
|
|
21
|
+
handleChange(value$1 ?? null);
|
|
20
22
|
onSelect?.(value$1);
|
|
21
23
|
},
|
|
22
24
|
onBlur: (e) => {
|
|
23
|
-
|
|
25
|
+
handleBlur(e.target.value ?? null);
|
|
24
26
|
onBlur?.(e);
|
|
25
27
|
}
|
|
26
28
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"combobox.client.mjs","names":["value"],"sources":["../../../../src/modules/inline-edit/components/combobox.client.tsx"],"sourcesContent":["\"use client\";\n\nimport { Combobox, ComboboxProps } from \"@/components/ui/combobox.client\";\nimport { useInlineEdit, useInlineEditOptions } from \"../hooks/use-inline.client\";\n\nexport type InlineComboboxProps<TValue> = useInlineEditOptions
|
|
1
|
+
{"version":3,"file":"combobox.client.mjs","names":["value"],"sources":["../../../../src/modules/inline-edit/components/combobox.client.tsx"],"sourcesContent":["\"use client\";\n\nimport { Combobox, ComboboxProps } from \"@/components/ui/combobox.client\";\nimport { useInlineEdit, useInlineEditOptions } from \"../hooks/use-inline.client\";\n\nexport type InlineComboboxProps<TValue, Required extends boolean = false> = useInlineEditOptions<\n string,\n Required\n> &\n Omit<ComboboxProps<TValue>, \"value\">;\n\nexport function InlineCombobox<TValue, Required extends boolean>({\n initialValue,\n action,\n permission,\n onSelect,\n onBlur,\n disabled,\n updateStrategy,\n isRequired,\n ...props\n}: InlineComboboxProps<TValue, Required>) {\n const { value, handleChange, handleBlur, isAllowed } = useInlineEdit({\n initialValue,\n action,\n permission,\n updateStrategy,\n isRequired,\n });\n\n return (\n <Combobox\n {...props}\n value={value}\n disabled={disabled || !isAllowed}\n onSelect={(value) => {\n handleChange(value ?? null);\n onSelect?.(value as TValue);\n }}\n onBlur={(e) => {\n handleBlur(e.target.value ?? null);\n onBlur?.(e);\n }}\n />\n );\n}\n"],"mappings":";;;;;;;AAWA,SAAgB,eAAiD,EAC/D,cACA,QACA,YACA,UACA,QACA,UACA,gBACA,YACA,GAAG,SACqC;CACxC,MAAM,EAAE,OAAO,cAAc,YAAY,cAAc,cAAc;EACnE;EACA;EACA;EACA;EACA;EACD,CAAC;AAEF,QACE,oBAAC;EACC,GAAI;EACG;EACP,UAAU,YAAY,CAAC;EACvB,WAAW,YAAU;AACnB,gBAAaA,WAAS,KAAK;AAC3B,cAAWA,QAAgB;;EAE7B,SAAS,MAAM;AACb,cAAW,EAAE,OAAO,SAAS,KAAK;AAClC,YAAS,EAAE;;GAEb"}
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import { useInlineEditOptions } from "../hooks/use-inline.client.mjs";
|
|
2
2
|
import { InlineEditVariantsProps } from "../lib/variants.mjs";
|
|
3
|
-
import * as
|
|
3
|
+
import * as react_jsx_runtime3 from "react/jsx-runtime";
|
|
4
4
|
import { ComponentProps } from "react";
|
|
5
5
|
|
|
6
6
|
//#region src/modules/inline-edit/components/date-input.client.d.ts
|
|
7
|
-
declare function InlineDateInput({
|
|
7
|
+
declare function InlineDateInput<Required extends boolean = false>({
|
|
8
8
|
initialValue,
|
|
9
9
|
action,
|
|
10
10
|
permission,
|
|
11
11
|
variant,
|
|
12
12
|
className,
|
|
13
|
+
updateStrategy,
|
|
14
|
+
isRequired,
|
|
13
15
|
...props
|
|
14
|
-
}: ComponentProps<"div"> & useInlineEditOptions<Date> & InlineEditVariantsProps):
|
|
16
|
+
}: ComponentProps<"div"> & useInlineEditOptions<Date, Required> & InlineEditVariantsProps): react_jsx_runtime3.JSX.Element;
|
|
15
17
|
//#endregion
|
|
16
18
|
export { InlineDateInput };
|
|
17
19
|
//# sourceMappingURL=date-input.client.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-input.client.d.mts","names":[],"sources":["../../../../src/modules/inline-edit/components/date-input.client.tsx"],"sourcesContent":[],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"date-input.client.d.mts","names":[],"sources":["../../../../src/modules/inline-edit/components/date-input.client.tsx"],"sourcesContent":[],"mappings":";;;;;;iBAiBgB;;;;;;;;;GASb,wBAAwB,qBAAqB,MAAM,YAAY,0BAAuB,kBAAA,CAAA,GAAA,CAAA"}
|
|
@@ -15,27 +15,39 @@ import { format } from "date-fns";
|
|
|
15
15
|
//#region src/modules/inline-edit/components/date-input.client.tsx
|
|
16
16
|
const formatDate = (value) => format(value, "dd/MM/yyyy");
|
|
17
17
|
const parseDate = (value) => new Date(value.split("/").reverse().join("-"));
|
|
18
|
-
|
|
18
|
+
const isValidDate = (date) => date instanceof Date && date.toString() !== "Invalid Date";
|
|
19
|
+
function InlineDateInput({ initialValue, action, permission, variant, className, updateStrategy, isRequired, ...props }) {
|
|
19
20
|
const [inValid, setInValid] = React.useState(false);
|
|
20
|
-
const { value, setValue,
|
|
21
|
+
const { value, setValue, handleChange, handleBlur, status, isAllowed } = useInlineEdit({
|
|
21
22
|
initialValue,
|
|
22
23
|
action,
|
|
23
|
-
permission
|
|
24
|
+
permission,
|
|
25
|
+
updateStrategy,
|
|
26
|
+
isRequired
|
|
24
27
|
});
|
|
25
28
|
const [stringDate, setStringDate] = React.useState(initialValue ? formatDate(initialValue) : "");
|
|
29
|
+
/**
|
|
30
|
+
* Update string date when value changes
|
|
31
|
+
*/
|
|
32
|
+
React.useEffect(() => {
|
|
33
|
+
if (value) setStringDate(formatDate(value));
|
|
34
|
+
}, [value]);
|
|
26
35
|
return /* @__PURE__ */ jsxs(Popover, { children: [/* @__PURE__ */ jsxs("div", {
|
|
27
36
|
...props,
|
|
28
|
-
className: cn("relative h-full",
|
|
37
|
+
className: cn("relative h-full", className),
|
|
29
38
|
children: [/* @__PURE__ */ jsx(Input, {
|
|
30
39
|
"data-input": true,
|
|
31
40
|
type: "string",
|
|
32
41
|
value: stringDate,
|
|
33
|
-
className: cn(
|
|
42
|
+
className: cn(inlineEditVariants({
|
|
43
|
+
variant,
|
|
44
|
+
status
|
|
45
|
+
}), inValid && "text-destructive"),
|
|
34
46
|
disabled: !isAllowed,
|
|
35
47
|
onChange: (e) => {
|
|
36
48
|
setStringDate(e.target.value);
|
|
37
49
|
const parsedDate = parseDate(e.target.value);
|
|
38
|
-
if (parsedDate
|
|
50
|
+
if (!isValidDate(parsedDate)) {
|
|
39
51
|
setInValid(true);
|
|
40
52
|
setValue(void 0);
|
|
41
53
|
} else {
|
|
@@ -44,7 +56,8 @@ function InlineDateInput({ initialValue, action, permission, variant, className,
|
|
|
44
56
|
}
|
|
45
57
|
},
|
|
46
58
|
onBlur: (e) => {
|
|
47
|
-
|
|
59
|
+
const parsedDate = parseDate(e.target.value);
|
|
60
|
+
handleBlur(isValidDate(parsedDate) ? parsedDate : null);
|
|
48
61
|
}
|
|
49
62
|
}), /* @__PURE__ */ jsx(PopoverTrigger, {
|
|
50
63
|
asChild: true,
|
|
@@ -60,15 +73,15 @@ function InlineDateInput({ initialValue, action, permission, variant, className,
|
|
|
60
73
|
className: "w-auto p-0",
|
|
61
74
|
children: /* @__PURE__ */ jsx(Calendar$1, {
|
|
62
75
|
mode: "single",
|
|
63
|
-
|
|
64
|
-
selected: value,
|
|
65
|
-
defaultMonth: value,
|
|
66
|
-
disabled:
|
|
76
|
+
autoFocus: true,
|
|
77
|
+
selected: value ?? void 0,
|
|
78
|
+
defaultMonth: value ?? void 0,
|
|
79
|
+
disabled: !isAllowed,
|
|
67
80
|
onSelect: (selectedDate) => {
|
|
68
81
|
if (!selectedDate) return;
|
|
69
|
-
setValue(selectedDate);
|
|
70
82
|
setStringDate(formatDate(selectedDate));
|
|
71
|
-
|
|
83
|
+
handleChange(selectedDate ?? null);
|
|
84
|
+
handleBlur(selectedDate ?? null);
|
|
72
85
|
setInValid(false);
|
|
73
86
|
}
|
|
74
87
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-input.client.mjs","names":["Calendar"],"sources":["../../../../src/modules/inline-edit/components/date-input.client.tsx"],"sourcesContent":["\"use client\";\n\nimport { Button } from \"@/components/ui/button\";\nimport { Calendar } from \"@/components/ui/calendar\";\nimport { Input } from \"@/components/ui/input\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"@/components/ui/popover\";\nimport { cn } from \"@/lib/utils/cn\";\nimport { format } from \"date-fns\";\nimport { CalendarIcon } from \"lucide-react\";\nimport React, { ComponentProps } from \"react\";\nimport { useInlineEdit, type useInlineEditOptions } from \"../hooks/use-inline.client\";\nimport { inlineEditVariants, InlineEditVariantsProps } from \"../lib/variants\";\n\nconst formatDate = (value: Date) => format(value, \"dd/MM/yyyy\");\nconst parseDate = (value: string) => new Date(value.split(\"/\").reverse().join(\"-\"));\n\nexport function InlineDateInput({\n initialValue,\n action,\n permission,\n variant,\n className,\n ...props\n}: ComponentProps<\"div\"> & useInlineEditOptions<Date> & InlineEditVariantsProps) {\n const [inValid, setInValid] = React.useState<boolean>(false);\n\n const { value, setValue,
|
|
1
|
+
{"version":3,"file":"date-input.client.mjs","names":["Calendar"],"sources":["../../../../src/modules/inline-edit/components/date-input.client.tsx"],"sourcesContent":["\"use client\";\n\nimport { Button } from \"@/components/ui/button\";\nimport { Calendar } from \"@/components/ui/calendar\";\nimport { Input } from \"@/components/ui/input\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"@/components/ui/popover\";\nimport { cn } from \"@/lib/utils/cn\";\nimport { format } from \"date-fns\";\nimport { CalendarIcon } from \"lucide-react\";\nimport React, { ComponentProps } from \"react\";\nimport { useInlineEdit, type useInlineEditOptions } from \"../hooks/use-inline.client\";\nimport { inlineEditVariants, InlineEditVariantsProps } from \"../lib/variants\";\n\nconst formatDate = (value: Date) => format(value, \"dd/MM/yyyy\");\nconst parseDate = (value: string) => new Date(value.split(\"/\").reverse().join(\"-\"));\nconst isValidDate = (date: Date) => date instanceof Date && date.toString() !== \"Invalid Date\";\n\nexport function InlineDateInput<Required extends boolean = false>({\n initialValue,\n action,\n permission,\n variant,\n className,\n updateStrategy,\n isRequired,\n ...props\n}: ComponentProps<\"div\"> & useInlineEditOptions<Date, Required> & InlineEditVariantsProps) {\n const [inValid, setInValid] = React.useState<boolean>(false);\n\n const { value, setValue, handleChange, handleBlur, status, isAllowed } = useInlineEdit({\n initialValue,\n action,\n permission,\n updateStrategy,\n isRequired,\n });\n\n const [stringDate, setStringDate] = React.useState<string>(\n initialValue ? formatDate(initialValue) : \"\",\n );\n\n /**\n * Update string date when value changes\n */\n React.useEffect(() => {\n if (value) setStringDate(formatDate(value));\n }, [value]);\n\n return (\n <Popover>\n <div {...props} className={cn(\"relative h-full\", className)}>\n <Input\n data-input\n type=\"string\"\n value={stringDate}\n className={cn(inlineEditVariants({ variant, status }), inValid && \"text-destructive\")}\n disabled={!isAllowed}\n onChange={(e) => {\n setStringDate(e.target.value);\n const parsedDate = parseDate(e.target.value);\n\n if (!isValidDate(parsedDate)) {\n setInValid(true);\n setValue(undefined);\n } else {\n setInValid(false);\n setValue(parsedDate);\n }\n }}\n onBlur={(e) => {\n const parsedDate = parseDate(e.target.value);\n handleBlur(isValidDate(parsedDate) ? parsedDate : null);\n }}\n />\n\n <PopoverTrigger asChild>\n <Button\n variant=\"ghost\"\n tabIndex={-1}\n disabled={!isAllowed}\n className={cn(\n \"absolute bottom-0 right-0 top-0 opacity-50\",\n !value && \"text-muted-foreground\",\n )}\n >\n <CalendarIcon className=\"h-4 w-4\" />\n </Button>\n </PopoverTrigger>\n </div>\n\n <PopoverContent className=\"w-auto p-0\">\n <Calendar\n mode=\"single\"\n autoFocus\n selected={value ?? undefined}\n defaultMonth={value ?? undefined}\n disabled={!isAllowed}\n onSelect={(selectedDate) => {\n if (!selectedDate) return;\n\n setStringDate(formatDate(selectedDate));\n\n handleChange(selectedDate ?? null);\n handleBlur(selectedDate ?? null);\n\n setInValid(false);\n }}\n />\n </PopoverContent>\n </Popover>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;AAaA,MAAM,cAAc,UAAgB,OAAO,OAAO,aAAa;AAC/D,MAAM,aAAa,UAAkB,IAAI,KAAK,MAAM,MAAM,IAAI,CAAC,SAAS,CAAC,KAAK,IAAI,CAAC;AACnF,MAAM,eAAe,SAAe,gBAAgB,QAAQ,KAAK,UAAU,KAAK;AAEhF,SAAgB,gBAAkD,EAChE,cACA,QACA,YACA,SACA,WACA,gBACA,YACA,GAAG,SACsF;CACzF,MAAM,CAAC,SAAS,cAAc,MAAM,SAAkB,MAAM;CAE5D,MAAM,EAAE,OAAO,UAAU,cAAc,YAAY,QAAQ,cAAc,cAAc;EACrF;EACA;EACA;EACA;EACA;EACD,CAAC;CAEF,MAAM,CAAC,YAAY,iBAAiB,MAAM,SACxC,eAAe,WAAW,aAAa,GAAG,GAC3C;;;;AAKD,OAAM,gBAAgB;AACpB,MAAI,MAAO,eAAc,WAAW,MAAM,CAAC;IAC1C,CAAC,MAAM,CAAC;AAEX,QACE,qBAAC,sBACC,qBAAC;EAAI,GAAI;EAAO,WAAW,GAAG,mBAAmB,UAAU;aACzD,oBAAC;GACC;GACA,MAAK;GACL,OAAO;GACP,WAAW,GAAG,mBAAmB;IAAE;IAAS;IAAQ,CAAC,EAAE,WAAW,mBAAmB;GACrF,UAAU,CAAC;GACX,WAAW,MAAM;AACf,kBAAc,EAAE,OAAO,MAAM;IAC7B,MAAM,aAAa,UAAU,EAAE,OAAO,MAAM;AAE5C,QAAI,CAAC,YAAY,WAAW,EAAE;AAC5B,gBAAW,KAAK;AAChB,cAAS,OAAU;WACd;AACL,gBAAW,MAAM;AACjB,cAAS,WAAW;;;GAGxB,SAAS,MAAM;IACb,MAAM,aAAa,UAAU,EAAE,OAAO,MAAM;AAC5C,eAAW,YAAY,WAAW,GAAG,aAAa,KAAK;;IAEzD,EAEF,oBAAC;GAAe;aACd,oBAAC;IACC,SAAQ;IACR,UAAU;IACV,UAAU,CAAC;IACX,WAAW,GACT,8CACA,CAAC,SAAS,wBACX;cAED,oBAAC,gBAAa,WAAU,YAAY;KAC7B;IACM;GACb,EAEN,oBAAC;EAAe,WAAU;YACxB,oBAACA;GACC,MAAK;GACL;GACA,UAAU,SAAS;GACnB,cAAc,SAAS;GACvB,UAAU,CAAC;GACX,WAAW,iBAAiB;AAC1B,QAAI,CAAC,aAAc;AAEnB,kBAAc,WAAW,aAAa,CAAC;AAEvC,iBAAa,gBAAgB,KAAK;AAClC,eAAW,gBAAgB,KAAK;AAEhC,eAAW,MAAM;;IAEnB;GACa,IACT"}
|
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
import { Button } from "../../../components/ui/button.mjs";
|
|
2
2
|
import { useInlineEditOptions } from "../hooks/use-inline.client.mjs";
|
|
3
3
|
import { InlineEditVariantsProps } from "../lib/variants.mjs";
|
|
4
|
-
import * as
|
|
4
|
+
import * as react_jsx_runtime4 from "react/jsx-runtime";
|
|
5
5
|
import { ComponentProps } from "react";
|
|
6
6
|
|
|
7
7
|
//#region src/modules/inline-edit/components/date-picker.client.d.ts
|
|
8
|
-
type InlineEditDatePickerProps = ComponentProps<typeof Button> & useInlineEditOptions<Date> & InlineEditVariantsProps;
|
|
9
|
-
declare function InlineDatePicker({
|
|
8
|
+
type InlineEditDatePickerProps<Required extends boolean> = ComponentProps<typeof Button> & useInlineEditOptions<Date, Required> & InlineEditVariantsProps;
|
|
9
|
+
declare function InlineDatePicker<Required extends boolean = false>({
|
|
10
10
|
initialValue,
|
|
11
11
|
action,
|
|
12
12
|
permission,
|
|
13
13
|
variant,
|
|
14
14
|
className,
|
|
15
15
|
disabled,
|
|
16
|
+
updateStrategy,
|
|
17
|
+
isRequired,
|
|
16
18
|
...props
|
|
17
|
-
}: InlineEditDatePickerProps):
|
|
19
|
+
}: InlineEditDatePickerProps<Required>): react_jsx_runtime4.JSX.Element;
|
|
18
20
|
//#endregion
|
|
19
21
|
export { InlineDatePicker };
|
|
20
22
|
//# sourceMappingURL=date-picker.client.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-picker.client.d.mts","names":[],"sources":["../../../../src/modules/inline-edit/components/date-picker.client.tsx"],"sourcesContent":[],"mappings":";;;;;;;KAYK,
|
|
1
|
+
{"version":3,"file":"date-picker.client.d.mts","names":[],"sources":["../../../../src/modules/inline-edit/components/date-picker.client.tsx"],"sourcesContent":[],"mappings":";;;;;;;KAYK,sDAAsD,sBAAsB,UAC/E,qBAAqB,MAAM,YAC3B;iBAEc;;;;;;;;;;GAUb,0BAA0B,YAAS,kBAAA,CAAA,GAAA,CAAA"}
|
|
@@ -12,18 +12,20 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
12
12
|
import React from "react";
|
|
13
13
|
|
|
14
14
|
//#region src/modules/inline-edit/components/date-picker.client.tsx
|
|
15
|
-
function InlineDatePicker({ initialValue, action, permission, variant, className, disabled, ...props }) {
|
|
15
|
+
function InlineDatePicker({ initialValue, action, permission, variant, className, disabled, updateStrategy, isRequired, ...props }) {
|
|
16
16
|
const [open, setOpen] = React.useState(false);
|
|
17
|
-
const { value,
|
|
17
|
+
const { value, handleChange, handleBlur, isAllowed, status } = useInlineEdit({
|
|
18
18
|
initialValue,
|
|
19
19
|
action,
|
|
20
|
-
permission
|
|
20
|
+
permission,
|
|
21
|
+
updateStrategy,
|
|
22
|
+
isRequired
|
|
21
23
|
});
|
|
22
24
|
return /* @__PURE__ */ jsxs(Popover, {
|
|
23
25
|
open,
|
|
24
26
|
onOpenChange: (open$1) => {
|
|
25
27
|
setOpen(open$1);
|
|
26
|
-
if (!open$1 && value)
|
|
28
|
+
if (!open$1 && value) handleBlur(value);
|
|
27
29
|
},
|
|
28
30
|
children: [/* @__PURE__ */ jsx(PopoverTrigger, {
|
|
29
31
|
asChild: true,
|
|
@@ -31,7 +33,10 @@ function InlineDatePicker({ initialValue, action, permission, variant, className
|
|
|
31
33
|
...props,
|
|
32
34
|
type: "button",
|
|
33
35
|
variant: "outline",
|
|
34
|
-
className: cn("w-full", inlineEditVariants({
|
|
36
|
+
className: cn("w-full", inlineEditVariants({
|
|
37
|
+
variant,
|
|
38
|
+
status
|
|
39
|
+
}), className),
|
|
35
40
|
disabled: disabled || !isAllowed,
|
|
36
41
|
children: [/* @__PURE__ */ jsx(CalendarIcon, { className: "mr-2 h-4 w-4" }), value ? formatDate(value) : /* @__PURE__ */ jsx("span", { children: "Kies een datum" })]
|
|
37
42
|
})
|
|
@@ -39,9 +44,9 @@ function InlineDatePicker({ initialValue, action, permission, variant, className
|
|
|
39
44
|
className: "w-auto p-0",
|
|
40
45
|
children: /* @__PURE__ */ jsx(Calendar$1, {
|
|
41
46
|
mode: "single",
|
|
47
|
+
autoFocus: true,
|
|
42
48
|
selected: value ? new Date(value) : void 0,
|
|
43
|
-
onSelect: (date) => date
|
|
44
|
-
initialFocus: true
|
|
49
|
+
onSelect: (date) => handleChange(date ?? null)
|
|
45
50
|
})
|
|
46
51
|
})]
|
|
47
52
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-picker.client.mjs","names":["open","Calendar"],"sources":["../../../../src/modules/inline-edit/components/date-picker.client.tsx"],"sourcesContent":["\"use client\";\n\nimport { Button } from \"@/components/ui/button\";\nimport { Calendar } from \"@/components/ui/calendar\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"@/components/ui/popover\";\nimport { cn } from \"@/lib/utils/cn\";\nimport { formatDate } from \"@/lib/utils/format\";\nimport { CalendarIcon } from \"lucide-react\";\nimport React, { ComponentProps } from \"react\";\nimport { useInlineEdit, type useInlineEditOptions } from \"../hooks/use-inline.client\";\nimport { inlineEditVariants, InlineEditVariantsProps } from \"../lib/variants\";\n\ntype InlineEditDatePickerProps = ComponentProps<typeof Button> &\n useInlineEditOptions<Date> &\n InlineEditVariantsProps;\n\nexport function InlineDatePicker({\n initialValue,\n action,\n permission,\n variant,\n className,\n disabled,\n ...props\n}: InlineEditDatePickerProps) {\n const [open, setOpen] = React.useState(false);\n\n const { value,
|
|
1
|
+
{"version":3,"file":"date-picker.client.mjs","names":["open","Calendar"],"sources":["../../../../src/modules/inline-edit/components/date-picker.client.tsx"],"sourcesContent":["\"use client\";\n\nimport { Button } from \"@/components/ui/button\";\nimport { Calendar } from \"@/components/ui/calendar\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"@/components/ui/popover\";\nimport { cn } from \"@/lib/utils/cn\";\nimport { formatDate } from \"@/lib/utils/format\";\nimport { CalendarIcon } from \"lucide-react\";\nimport React, { ComponentProps } from \"react\";\nimport { useInlineEdit, type useInlineEditOptions } from \"../hooks/use-inline.client\";\nimport { inlineEditVariants, InlineEditVariantsProps } from \"../lib/variants\";\n\ntype InlineEditDatePickerProps<Required extends boolean> = ComponentProps<typeof Button> &\n useInlineEditOptions<Date, Required> &\n InlineEditVariantsProps;\n\nexport function InlineDatePicker<Required extends boolean = false>({\n initialValue,\n action,\n permission,\n variant,\n className,\n disabled,\n updateStrategy,\n isRequired,\n ...props\n}: InlineEditDatePickerProps<Required>) {\n const [open, setOpen] = React.useState(false);\n\n const { value, handleChange, handleBlur, isAllowed, status } = useInlineEdit({\n initialValue,\n action,\n permission,\n updateStrategy,\n isRequired,\n });\n\n return (\n <Popover\n open={open}\n onOpenChange={(open) => {\n setOpen(open);\n if (!open && value) handleBlur(value);\n }}\n >\n <PopoverTrigger asChild>\n <Button\n {...props}\n type=\"button\"\n variant=\"outline\"\n className={cn(\"w-full\", inlineEditVariants({ variant, status }), className)}\n disabled={disabled || !isAllowed}\n >\n <CalendarIcon className=\"mr-2 h-4 w-4\" />\n {value ? formatDate(value) : <span>Kies een datum</span>}\n </Button>\n </PopoverTrigger>\n\n <PopoverContent className=\"w-auto p-0\">\n <Calendar\n mode=\"single\"\n autoFocus\n selected={value ? new Date(value) : undefined}\n onSelect={(date) => handleChange(date ?? null)}\n />\n </PopoverContent>\n </Popover>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AAgBA,SAAgB,iBAAmD,EACjE,cACA,QACA,YACA,SACA,WACA,UACA,gBACA,YACA,GAAG,SACmC;CACtC,MAAM,CAAC,MAAM,WAAW,MAAM,SAAS,MAAM;CAE7C,MAAM,EAAE,OAAO,cAAc,YAAY,WAAW,WAAW,cAAc;EAC3E;EACA;EACA;EACA;EACA;EACD,CAAC;AAEF,QACE,qBAAC;EACO;EACN,eAAe,WAAS;AACtB,WAAQA,OAAK;AACb,OAAI,CAACA,UAAQ,MAAO,YAAW,MAAM;;aAGvC,oBAAC;GAAe;aACd,qBAAC;IACC,GAAI;IACJ,MAAK;IACL,SAAQ;IACR,WAAW,GAAG,UAAU,mBAAmB;KAAE;KAAS;KAAQ,CAAC,EAAE,UAAU;IAC3E,UAAU,YAAY,CAAC;eAEvB,oBAAC,gBAAa,WAAU,iBAAiB,EACxC,QAAQ,WAAW,MAAM,GAAG,oBAAC,oBAAK,mBAAqB;KACjD;IACM,EAEjB,oBAAC;GAAe,WAAU;aACxB,oBAACC;IACC,MAAK;IACL;IACA,UAAU,QAAQ,IAAI,KAAK,MAAM,GAAG;IACpC,WAAW,SAAS,aAAa,QAAQ,KAAK;KAC9C;IACa;GACT"}
|
|
@@ -2,20 +2,22 @@ import { EditorJSONContent } from "../../../components/editor/lib/types.mjs";
|
|
|
2
2
|
import { EditorProps } from "../../../components/editor/components/editor.client.mjs";
|
|
3
3
|
import { useInlineEditOptions } from "../hooks/use-inline.client.mjs";
|
|
4
4
|
import { InlineEditVariantsProps } from "../lib/variants.mjs";
|
|
5
|
-
import * as
|
|
5
|
+
import * as react_jsx_runtime5 from "react/jsx-runtime";
|
|
6
6
|
|
|
7
7
|
//#region src/modules/inline-edit/components/editor.client.d.ts
|
|
8
|
-
type InlineEditorProps = useInlineEditOptions<EditorJSONContent> & InlineEditVariantsProps & Omit<EditorProps, "value" | "onUpdate" | "onBlur" | "variant">;
|
|
9
|
-
declare function InlineEditor({
|
|
8
|
+
type InlineEditorProps<Required extends boolean = false> = useInlineEditOptions<EditorJSONContent, Required> & InlineEditVariantsProps & Omit<EditorProps, "value" | "onUpdate" | "onBlur" | "variant">;
|
|
9
|
+
declare function InlineEditor<Required extends boolean = false>({
|
|
10
10
|
initialValue,
|
|
11
11
|
action,
|
|
12
12
|
extensions,
|
|
13
13
|
variant,
|
|
14
14
|
disabled,
|
|
15
15
|
permission,
|
|
16
|
+
updateStrategy,
|
|
17
|
+
isRequired,
|
|
16
18
|
className,
|
|
17
19
|
children
|
|
18
|
-
}: InlineEditorProps):
|
|
20
|
+
}: InlineEditorProps<Required>): react_jsx_runtime5.JSX.Element;
|
|
19
21
|
//#endregion
|
|
20
22
|
export { InlineEditor, InlineEditorProps };
|
|
21
23
|
//# sourceMappingURL=editor.client.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editor.client.d.mts","names":[],"sources":["../../../../src/modules/inline-edit/components/editor.client.tsx"],"sourcesContent":[],"mappings":";;;;;;;KAQY,
|
|
1
|
+
{"version":3,"file":"editor.client.d.mts","names":[],"sources":["../../../../src/modules/inline-edit/components/editor.client.tsx"],"sourcesContent":[],"mappings":";;;;;;;KAQY,sDAAsD,qBAChE,mBACA,YAEA,0BACA,KAAK;iBAES;;;;;;;;;;;GAWb,kBAAkB,YAAS,kBAAA,CAAA,GAAA,CAAA"}
|
|
@@ -7,18 +7,23 @@ import { inlineEditVariants } from "../lib/variants.mjs";
|
|
|
7
7
|
import { jsx } from "react/jsx-runtime";
|
|
8
8
|
|
|
9
9
|
//#region src/modules/inline-edit/components/editor.client.tsx
|
|
10
|
-
function InlineEditor({ initialValue, action, extensions, variant, disabled, permission, className, children }) {
|
|
11
|
-
const { value,
|
|
10
|
+
function InlineEditor({ initialValue, action, extensions, variant, disabled, permission, updateStrategy, isRequired, className, children }) {
|
|
11
|
+
const { value, handleChange, handleBlur, isAllowed, status } = useInlineEdit({
|
|
12
12
|
initialValue,
|
|
13
13
|
action,
|
|
14
|
-
permission
|
|
14
|
+
permission,
|
|
15
|
+
updateStrategy,
|
|
16
|
+
isRequired
|
|
15
17
|
});
|
|
16
18
|
return /* @__PURE__ */ jsx(Editor, {
|
|
17
19
|
value,
|
|
18
20
|
extensions,
|
|
19
|
-
onUpdate: (value$1) =>
|
|
20
|
-
onBlur: (value$1) =>
|
|
21
|
-
className: cn(inlineEditVariants({
|
|
21
|
+
onUpdate: (value$1) => handleChange(value$1),
|
|
22
|
+
onBlur: (value$1) => handleBlur(value$1),
|
|
23
|
+
className: cn(inlineEditVariants({
|
|
24
|
+
variant,
|
|
25
|
+
status
|
|
26
|
+
}), className),
|
|
22
27
|
disabled: disabled || !isAllowed,
|
|
23
28
|
variant,
|
|
24
29
|
children
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editor.client.mjs","names":["value"],"sources":["../../../../src/modules/inline-edit/components/editor.client.tsx"],"sourcesContent":["\"use client\";\n\nimport { Editor, EditorProps } from \"@/components/editor/components/editor.client\";\nimport { EditorJSONContent } from \"@/components/editor/lib/types\";\nimport { cn } from \"@/lib/utils/cn\";\nimport { useInlineEdit, type useInlineEditOptions } from \"../hooks/use-inline.client\";\nimport { inlineEditVariants, InlineEditVariantsProps } from \"../lib/variants\";\n\nexport type InlineEditorProps = useInlineEditOptions
|
|
1
|
+
{"version":3,"file":"editor.client.mjs","names":["value"],"sources":["../../../../src/modules/inline-edit/components/editor.client.tsx"],"sourcesContent":["\"use client\";\n\nimport { Editor, EditorProps } from \"@/components/editor/components/editor.client\";\nimport { EditorJSONContent } from \"@/components/editor/lib/types\";\nimport { cn } from \"@/lib/utils/cn\";\nimport { useInlineEdit, type useInlineEditOptions } from \"../hooks/use-inline.client\";\nimport { inlineEditVariants, InlineEditVariantsProps } from \"../lib/variants\";\n\nexport type InlineEditorProps<Required extends boolean = false> = useInlineEditOptions<\n EditorJSONContent,\n Required\n> &\n InlineEditVariantsProps &\n Omit<EditorProps, \"value\" | \"onUpdate\" | \"onBlur\" | \"variant\">;\n\nexport function InlineEditor<Required extends boolean = false>({\n initialValue,\n action,\n extensions,\n variant,\n disabled,\n permission,\n updateStrategy,\n isRequired,\n className,\n children,\n}: InlineEditorProps<Required>) {\n const { value, handleChange, handleBlur, isAllowed, status } = useInlineEdit({\n initialValue,\n action,\n permission,\n updateStrategy,\n isRequired,\n });\n\n return (\n <Editor\n value={value}\n extensions={extensions}\n onUpdate={(value) => handleChange(value)}\n onBlur={(value) => handleBlur(value)}\n className={cn(inlineEditVariants({ variant, status }), className)}\n disabled={disabled || !isAllowed}\n variant={variant}\n >\n {children}\n </Editor>\n );\n}\n"],"mappings":";;;;;;;;;AAeA,SAAgB,aAA+C,EAC7D,cACA,QACA,YACA,SACA,UACA,YACA,gBACA,YACA,WACA,YAC8B;CAC9B,MAAM,EAAE,OAAO,cAAc,YAAY,WAAW,WAAW,cAAc;EAC3E;EACA;EACA;EACA;EACA;EACD,CAAC;AAEF,QACE,oBAAC;EACQ;EACK;EACZ,WAAW,YAAU,aAAaA,QAAM;EACxC,SAAS,YAAU,WAAWA,QAAM;EACpC,WAAW,GAAG,mBAAmB;GAAE;GAAS;GAAQ,CAAC,EAAE,UAAU;EACjE,UAAU,YAAY,CAAC;EACd;EAER;GACM"}
|
|
@@ -1,26 +1,28 @@
|
|
|
1
1
|
import { useInlineEditOptions } from "../hooks/use-inline.client.mjs";
|
|
2
2
|
import { InlineEditVariantsProps } from "../lib/variants.mjs";
|
|
3
3
|
import { Contact, RecipientInput } from "../../../components/ui/input-recipient.mjs";
|
|
4
|
-
import * as
|
|
4
|
+
import * as react_jsx_runtime6 from "react/jsx-runtime";
|
|
5
5
|
import { ComponentProps } from "react";
|
|
6
6
|
|
|
7
7
|
//#region src/modules/inline-edit/components/input-recipient.client.d.ts
|
|
8
|
-
type InlineRecipientInputProps = Omit<ComponentProps<typeof RecipientInput>, "value" | "onChange"> & useInlineEditOptions<string[]> & InlineEditVariantsProps & {
|
|
8
|
+
type InlineRecipientInputProps<Required extends boolean = false> = Omit<ComponentProps<typeof RecipientInput>, "value" | "onChange"> & useInlineEditOptions<string[], Required> & InlineEditVariantsProps & {
|
|
9
9
|
contacts: Contact[];
|
|
10
10
|
};
|
|
11
11
|
/**
|
|
12
12
|
* The inline edit recipient input component.
|
|
13
13
|
*/
|
|
14
|
-
declare function InlineRecipientInput({
|
|
14
|
+
declare function InlineRecipientInput<Required extends boolean = false>({
|
|
15
15
|
initialValue,
|
|
16
16
|
action,
|
|
17
17
|
variant,
|
|
18
18
|
disabled,
|
|
19
19
|
contacts,
|
|
20
20
|
permission,
|
|
21
|
+
updateStrategy,
|
|
22
|
+
isRequired,
|
|
21
23
|
className,
|
|
22
24
|
...props
|
|
23
|
-
}: InlineRecipientInputProps):
|
|
25
|
+
}: InlineRecipientInputProps<Required>): react_jsx_runtime6.JSX.Element;
|
|
24
26
|
//#endregion
|
|
25
27
|
export { InlineRecipientInput };
|
|
26
28
|
//# sourceMappingURL=input-recipient.client.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input-recipient.client.d.mts","names":[],"sources":["../../../../src/modules/inline-edit/components/input-recipient.client.tsx"],"sourcesContent":[],"mappings":";;;;;;;KAQK,
|
|
1
|
+
{"version":3,"file":"input-recipient.client.d.mts","names":[],"sources":["../../../../src/modules/inline-edit/components/input-recipient.client.tsx"],"sourcesContent":[],"mappings":";;;;;;;KAQK,8DAA8D,KACjE,sBAAsB,yCAGtB,+BAA+B,YAC/B;YACY;;AARgE;;;AAEX,iBAYnD,oBAZmD,CAAA,iBAAA,OAAA,GAAA,KAAA,CAAA,CAAA;EAAA,YAAA;EAAA,MAAA;EAAA,OAAA;EAAA,QAAA;EAAA,QAAA;EAAA,UAAA;EAAA,cAAA;EAAA,UAAA;EAAA,SAAA;EAAA,GAAA;AAAA,CAAA,EAuBhE,yBAvBgE,CAuBtC,QAvBsC,CAAA,CAAA,EAuB7B,kBAAA,CAAA,GAAA,CAAA,OAvB6B"}
|
|
@@ -10,22 +10,27 @@ import { jsx } from "react/jsx-runtime";
|
|
|
10
10
|
/**
|
|
11
11
|
* The inline edit recipient input component.
|
|
12
12
|
*/
|
|
13
|
-
function InlineRecipientInput({ initialValue, action, variant, disabled, contacts, permission, className, ...props }) {
|
|
14
|
-
const { value,
|
|
13
|
+
function InlineRecipientInput({ initialValue, action, variant, disabled, contacts, permission, updateStrategy, isRequired, className, ...props }) {
|
|
14
|
+
const { value, handleChange, handleBlur, isAllowed, status } = useInlineEdit({
|
|
15
15
|
initialValue,
|
|
16
16
|
action,
|
|
17
|
-
permission
|
|
17
|
+
permission,
|
|
18
|
+
updateStrategy,
|
|
19
|
+
isRequired
|
|
18
20
|
});
|
|
19
21
|
return /* @__PURE__ */ jsx(RecipientInput, {
|
|
20
22
|
...props,
|
|
21
23
|
contacts,
|
|
22
24
|
value: value ?? [],
|
|
23
25
|
onChange: (newValue) => {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
+
handleChange(newValue);
|
|
27
|
+
handleBlur(newValue);
|
|
26
28
|
},
|
|
27
29
|
disabled: disabled || !isAllowed,
|
|
28
|
-
className: cn(inlineEditVariants({
|
|
30
|
+
className: cn(inlineEditVariants({
|
|
31
|
+
variant,
|
|
32
|
+
status
|
|
33
|
+
}), className)
|
|
29
34
|
});
|
|
30
35
|
}
|
|
31
36
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input-recipient.client.mjs","names":[],"sources":["../../../../src/modules/inline-edit/components/input-recipient.client.tsx"],"sourcesContent":["\"use client\";\n\nimport { Contact, RecipientInput } from \"@/components/ui/input-recipient\";\nimport { cn } from \"@/lib/utils/cn\";\nimport { ComponentProps } from \"react\";\nimport { useInlineEdit, type useInlineEditOptions } from \"../hooks/use-inline.client\";\nimport { inlineEditVariants, InlineEditVariantsProps } from \"../lib/variants\";\n\ntype InlineRecipientInputProps = Omit
|
|
1
|
+
{"version":3,"file":"input-recipient.client.mjs","names":[],"sources":["../../../../src/modules/inline-edit/components/input-recipient.client.tsx"],"sourcesContent":["\"use client\";\n\nimport { Contact, RecipientInput } from \"@/components/ui/input-recipient\";\nimport { cn } from \"@/lib/utils/cn\";\nimport { ComponentProps } from \"react\";\nimport { useInlineEdit, type useInlineEditOptions } from \"../hooks/use-inline.client\";\nimport { inlineEditVariants, InlineEditVariantsProps } from \"../lib/variants\";\n\ntype InlineRecipientInputProps<Required extends boolean = false> = Omit<\n ComponentProps<typeof RecipientInput>,\n \"value\" | \"onChange\"\n> &\n useInlineEditOptions<string[], Required> &\n InlineEditVariantsProps & {\n contacts: Contact[];\n };\n\n/**\n * The inline edit recipient input component.\n */\nexport function InlineRecipientInput<Required extends boolean = false>({\n initialValue,\n action,\n variant,\n disabled,\n contacts,\n permission,\n updateStrategy,\n isRequired,\n className,\n ...props\n}: InlineRecipientInputProps<Required>) {\n const { value, handleChange, handleBlur, isAllowed, status } = useInlineEdit({\n initialValue,\n action,\n permission,\n updateStrategy,\n isRequired,\n });\n\n return (\n <RecipientInput\n {...props}\n contacts={contacts}\n value={value ?? []}\n onChange={(newValue) => {\n handleChange(newValue);\n handleBlur(newValue);\n }}\n disabled={disabled || !isAllowed}\n className={cn(inlineEditVariants({ variant, status }), className)}\n />\n );\n}\n"],"mappings":";;;;;;;;;;;;AAoBA,SAAgB,qBAAuD,EACrE,cACA,QACA,SACA,UACA,UACA,YACA,gBACA,YACA,WACA,GAAG,SACmC;CACtC,MAAM,EAAE,OAAO,cAAc,YAAY,WAAW,WAAW,cAAc;EAC3E;EACA;EACA;EACA;EACA;EACD,CAAC;AAEF,QACE,oBAAC;EACC,GAAI;EACM;EACV,OAAO,SAAS,EAAE;EAClB,WAAW,aAAa;AACtB,gBAAa,SAAS;AACtB,cAAW,SAAS;;EAEtB,UAAU,YAAY,CAAC;EACvB,WAAW,GAAG,mBAAmB;GAAE;GAAS;GAAQ,CAAC,EAAE,UAAU;GACjE"}
|