@tulip-systems/core 0.4.1 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auth/client.d.mts +2 -2
- package/dist/auth/client.mjs +2 -2
- package/dist/commands/client.d.mts +3 -3
- package/dist/commands/client.mjs +3 -3
- package/dist/components/client.d.mts +3 -5
- package/dist/components/client.mjs +3 -5
- 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/block-dropdown.mjs +28 -14
- package/dist/components/editor/components/block-dropdown.mjs.map +1 -1
- package/dist/components/editor/components/content.client.d.mts +2 -2
- package/dist/components/editor/components/content.client.mjs +1 -1
- package/dist/components/editor/components/content.client.mjs.map +1 -1
- package/dist/components/editor/components/editor.client.d.mts +48 -0
- package/dist/components/editor/components/editor.client.d.mts.map +1 -0
- package/dist/components/editor/components/editor.client.mjs +53 -0
- package/dist/components/editor/components/editor.client.mjs.map +1 -0
- package/dist/components/editor/components/menu-fixed.client.d.mts +7 -0
- package/dist/components/editor/components/menu-fixed.client.d.mts.map +1 -0
- package/dist/components/editor/components/{fixed-menu.client.mjs → menu-fixed.client.mjs} +21 -27
- package/dist/components/editor/components/menu-fixed.client.mjs.map +1 -0
- package/dist/components/editor/lib/constants.d.mts +60 -0
- package/dist/components/editor/lib/constants.d.mts.map +1 -0
- package/dist/components/editor/lib/constants.mjs +90 -0
- package/dist/components/editor/lib/constants.mjs.map +1 -0
- package/dist/components/editor/lib/extensions.d.mts +62 -0
- package/dist/components/editor/lib/extensions.d.mts.map +1 -0
- package/dist/components/editor/lib/extensions.mjs +52 -0
- package/dist/components/editor/lib/extensions.mjs.map +1 -0
- package/dist/components/editor/lib/helpers.mjs +3 -3
- package/dist/components/editor/lib/helpers.mjs.map +1 -1
- package/dist/components/editor/lib/variants.mjs +8 -0
- package/dist/components/editor/lib/variants.mjs.map +1 -0
- 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/header/top-bar.client.mjs +1 -1
- package/dist/components/header/top-bar.client.mjs.map +1 -1
- package/dist/components/layouts/admin-content.client.d.mts +2 -2
- package/dist/components/layouts/admin-content.client.mjs +1 -1
- package/dist/components/layouts/admin-content.client.mjs.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/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 +4 -4
- 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 +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 +4 -4
- 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 +2 -2
- package/dist/components/ui/breadcrumb.d.mts +8 -8
- package/dist/components/ui/button.d.mts +2 -2
- package/dist/components/ui/calendar.d.mts +17 -4
- package/dist/components/ui/calendar.d.mts.map +1 -1
- package/dist/components/ui/calendar.mjs +90 -37
- package/dist/components/ui/calendar.mjs.map +1 -1
- package/dist/components/ui/card.d.mts +7 -7
- package/dist/components/ui/carousel.d.mts +6 -6
- package/dist/components/ui/chart.client.d.mts +5 -5
- package/dist/components/ui/checkbox.d.mts +2 -2
- 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/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 +5 -3
- package/dist/components/ui/input-recipient.d.mts.map +1 -1
- package/dist/components/ui/input-recipient.mjs +2 -2
- package/dist/components/ui/input-recipient.mjs.map +1 -1
- 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 +9 -9
- 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/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 +26 -26
- 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 +4 -4
- 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.d.mts +2 -2
- package/dist/components.mjs +2 -2
- package/dist/config/server.d.mts +1 -2
- package/dist/config/server.mjs +1 -2
- package/dist/data-tables.d.mts +6 -5
- package/dist/data-tables.mjs +4 -3
- package/dist/inline-edit/client.d.mts +4 -4
- package/dist/inline-edit/client.mjs +3 -3
- package/dist/lib/hooks/use-action.d.mts +2 -2
- package/dist/lib/hooks/use-indicator.d.mts +2 -2
- package/dist/lib.mjs +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/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 +247 -230
- package/dist/modules/auth/db/schema.d.mts.map +1 -1
- package/dist/modules/auth/db/schema.mjs +12 -20
- package/dist/modules/auth/db/schema.mjs.map +1 -1
- package/dist/modules/auth/handler/client.client.d.mts +129 -129
- package/dist/modules/auth/handler/client.client.d.mts.map +1 -1
- package/dist/modules/auth/handler/client.client.mjs +10 -6
- package/dist/modules/auth/handler/client.client.mjs.map +1 -1
- package/dist/modules/auth/handler/init.d.mts +134 -131
- package/dist/modules/auth/handler/init.d.mts.map +1 -1
- package/dist/modules/auth/handler/init.mjs +5 -2
- package/dist/modules/auth/handler/init.mjs.map +1 -1
- package/dist/modules/auth/hooks/use-permission.d.mts +2 -2
- package/dist/modules/auth/hooks/use-permission.d.mts.map +1 -1
- package/dist/modules/auth/hooks/use-permission.mjs +7 -2
- package/dist/modules/auth/hooks/use-permission.mjs.map +1 -1
- package/dist/modules/auth/hooks/use-session.d.mts +119 -3
- package/dist/modules/auth/hooks/use-session.d.mts.map +1 -1
- package/dist/modules/auth/hooks/use-session.mjs +15 -10
- package/dist/modules/auth/hooks/use-session.mjs.map +1 -1
- package/dist/modules/auth/lib/helpers.server.d.mts +5 -5
- package/dist/modules/auth/lib/helpers.server.d.mts.map +1 -1
- package/dist/modules/auth/lib/validators.d.mts +1 -1
- package/dist/modules/auth/lib/validators.d.mts.map +1 -1
- package/dist/modules/auth/lib/validators.mjs +1 -1
- package/dist/modules/auth/lib/validators.mjs.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/alert-dialog-command.client.mjs +2 -2
- package/dist/modules/commands/components/alert-dialog-command.client.mjs.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/click-command.client.mjs +2 -2
- package/dist/modules/commands/components/click-command.client.mjs.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 +18 -8
- package/dist/modules/commands/components/dialog-command.client.d.mts.map +1 -1
- package/dist/modules/commands/components/dialog-command.client.mjs +12 -8
- package/dist/modules/commands/components/dialog-command.client.mjs.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/dropdown-command.client.mjs +2 -2
- package/dist/modules/commands/components/dropdown-command.client.mjs.map +1 -1
- package/dist/modules/commands/components/empty-command.client.d.mts +2 -2
- package/dist/modules/commands/components/form-dialog-command.client.d.mts +11 -11
- package/dist/modules/commands/components/form-dialog-command.client.mjs +2 -2
- package/dist/modules/commands/components/form-dialog-command.client.mjs.map +1 -1
- package/dist/modules/commands/hooks/use-command-mutation.client.d.mts +17 -0
- package/dist/modules/commands/hooks/use-command-mutation.client.d.mts.map +1 -0
- package/dist/modules/commands/hooks/use-command-mutation.client.mjs +42 -0
- package/dist/modules/commands/hooks/use-command-mutation.client.mjs.map +1 -0
- 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 +13 -8
- package/dist/modules/commands/utils/delete-command.client.d.mts.map +1 -1
- package/dist/modules/commands/utils/delete-command.client.mjs +10 -1
- package/dist/modules/commands/utils/delete-command.client.mjs.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/config/lib/config.d.mts +3 -3
- package/dist/modules/config/lib/config.d.mts.map +1 -1
- package/dist/modules/config/lib/config.mjs.map +1 -1
- package/dist/modules/config/lib/context.d.mts +2 -2
- package/dist/modules/config/lib/context.d.mts.map +1 -1
- package/dist/modules/config/lib/context.mjs.map +1 -1
- package/dist/modules/data-tables/components/cell/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/combobox.client.mjs +5 -2
- package/dist/modules/data-tables/components/filters/combobox.client.mjs.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/layout.d.mts.map +1 -1
- 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/skeleton.d.mts.map +1 -1
- package/dist/modules/data-tables/components/table.d.mts +7 -7
- package/dist/modules/data-tables/components/table.d.mts.map +1 -1
- package/dist/modules/data-tables/components/toolbar.d.mts +3 -3
- package/dist/modules/data-tables/components/toolbar.d.mts.map +1 -1
- package/dist/modules/data-tables/hooks/use-context.client.d.mts +13 -10
- package/dist/modules/data-tables/hooks/use-context.client.d.mts.map +1 -1
- package/dist/modules/data-tables/hooks/use-context.client.mjs.map +1 -1
- package/dist/modules/data-tables/hooks/use-table.client.d.mts +2 -1
- package/dist/modules/data-tables/hooks/use-table.client.d.mts.map +1 -1
- package/dist/modules/data-tables/hooks/use-table.client.mjs.map +1 -1
- package/dist/modules/data-tables/lib/converters/search.d.mts +1 -1
- package/dist/modules/data-tables/lib/converters/sorting.d.mts +1 -1
- package/dist/modules/data-tables/lib/filters/config.d.mts +4 -1
- package/dist/modules/data-tables/lib/filters/config.d.mts.map +1 -1
- package/dist/modules/data-tables/lib/filters/config.mjs.map +1 -1
- package/dist/modules/data-tables/lib/filters/helpers.d.mts +11 -0
- package/dist/modules/data-tables/lib/filters/helpers.d.mts.map +1 -0
- package/dist/modules/data-tables/lib/filters/helpers.mjs +17 -0
- package/dist/modules/data-tables/lib/filters/helpers.mjs.map +1 -0
- package/dist/modules/data-tables/lib/filters/parsers.d.mts +7 -2
- 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/lib/filters/resolvers.d.mts +6 -1
- package/dist/modules/data-tables/lib/filters/resolvers.d.mts.map +1 -1
- package/dist/modules/data-tables/lib/filters/resolvers.mjs +8 -1
- package/dist/modules/data-tables/lib/filters/resolvers.mjs.map +1 -1
- package/dist/modules/data-tables/lib/types.d.mts +8 -5
- package/dist/modules/data-tables/lib/types.d.mts.map +1 -1
- package/dist/modules/data-tables/server/get-data.server.d.mts +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/cells/drag-handle.client.mjs +1 -1
- package/dist/modules/data-tables/tables/inline-table/components/cells/drag-handle.client.mjs.map +1 -1
- package/dist/modules/data-tables/tables/inline-table/components/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 +5 -2
- package/dist/modules/inline-edit/components/combobox-dropdown.client.d.mts.map +1 -1
- package/dist/modules/inline-edit/components/combobox-dropdown.client.mjs +7 -3
- package/dist/modules/inline-edit/components/combobox-dropdown.client.mjs.map +1 -1
- package/dist/modules/inline-edit/components/combobox.client.d.mts +5 -2
- package/dist/modules/inline-edit/components/combobox.client.d.mts.map +1 -1
- package/dist/modules/inline-edit/components/combobox.client.mjs +6 -2
- package/dist/modules/inline-edit/components/combobox.client.mjs.map +1 -1
- package/dist/modules/inline-edit/components/date-input.client.d.mts +6 -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 +5 -3
- package/dist/modules/inline-edit/components/date-input.client.mjs.map +1 -1
- package/dist/modules/inline-edit/components/date-picker.client.d.mts +7 -3
- package/dist/modules/inline-edit/components/date-picker.client.d.mts.map +1 -1
- package/dist/modules/inline-edit/components/date-picker.client.mjs +5 -3
- package/dist/modules/inline-edit/components/date-picker.client.mjs.map +1 -1
- package/dist/modules/inline-edit/components/deprecated-editor.client.d.mts +21 -0
- package/dist/modules/inline-edit/components/deprecated-editor.client.d.mts.map +1 -0
- package/dist/modules/inline-edit/components/deprecated-editor.client.mjs +37 -0
- package/dist/modules/inline-edit/components/deprecated-editor.client.mjs.map +1 -0
- package/dist/modules/inline-edit/components/editor.client.d.mts +10 -7
- package/dist/modules/inline-edit/components/editor.client.d.mts.map +1 -1
- package/dist/modules/inline-edit/components/editor.client.mjs +13 -18
- package/dist/modules/inline-edit/components/editor.client.mjs.map +1 -1
- package/dist/modules/inline-edit/components/input-recipient.client.d.mts +4 -2
- package/dist/modules/inline-edit/components/input-recipient.client.d.mts.map +1 -1
- package/dist/modules/inline-edit/components/input-recipient.client.mjs +7 -3
- package/dist/modules/inline-edit/components/input-recipient.client.mjs.map +1 -1
- package/dist/modules/inline-edit/components/input-toggle.client.d.mts +3 -2
- package/dist/modules/inline-edit/components/input-toggle.client.d.mts.map +1 -1
- package/dist/modules/inline-edit/components/input-toggle.client.mjs +3 -2
- package/dist/modules/inline-edit/components/input-toggle.client.mjs.map +1 -1
- package/dist/modules/inline-edit/components/input.client.d.mts +18 -4
- package/dist/modules/inline-edit/components/input.client.d.mts.map +1 -1
- package/dist/modules/inline-edit/components/input.client.mjs +26 -5
- package/dist/modules/inline-edit/components/input.client.mjs.map +1 -1
- package/dist/modules/inline-edit/components/select.client.d.mts +8 -6
- package/dist/modules/inline-edit/components/select.client.d.mts.map +1 -1
- package/dist/modules/inline-edit/components/select.client.mjs +3 -2
- package/dist/modules/inline-edit/components/select.client.mjs.map +1 -1
- package/dist/modules/inline-edit/components/switch.client.d.mts +3 -2
- package/dist/modules/inline-edit/components/switch.client.d.mts.map +1 -1
- package/dist/modules/inline-edit/components/switch.client.mjs +3 -2
- package/dist/modules/inline-edit/components/switch.client.mjs.map +1 -1
- package/dist/modules/inline-edit/components/toggle.client.d.mts +3 -2
- package/dist/modules/inline-edit/components/toggle.client.d.mts.map +1 -1
- package/dist/modules/inline-edit/components/toggle.client.mjs +3 -2
- 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/context.client.d.mts.map +1 -1
- package/dist/modules/inline-edit/hooks/use-inline.client.d.mts +1 -1
- package/dist/modules/inline-edit/hooks/use-inline.client.mjs.map +1 -1
- package/dist/modules/inline-edit/lib/variants.d.mts +3 -3
- package/dist/modules/inline-edit/lib/variants.mjs +1 -1
- package/dist/modules/inline-edit/lib/variants.mjs.map +1 -1
- package/dist/modules/router/handler/context.server.d.mts +2 -2
- package/dist/modules/router/handler/context.server.d.mts.map +1 -1
- package/dist/modules/router/handler/init.server.d.mts +7 -7
- package/dist/modules/router/lib/query-client.server.d.mts +2 -2
- package/dist/modules/router/lib/query-client.server.d.mts.map +1 -1
- package/dist/modules/{uploads/components/dropzone/context.d.mts → storage/components/dropzone-context.client.d.mts} +2 -2
- package/dist/modules/storage/components/dropzone-context.client.d.mts.map +1 -0
- package/dist/modules/{uploads/components/dropzone/context.mjs → storage/components/dropzone-context.client.mjs} +2 -2
- package/dist/modules/storage/components/dropzone-context.client.mjs.map +1 -0
- package/dist/modules/{uploads/components/dropzone/index.d.mts → storage/components/dropzone.client.d.mts} +7 -7
- package/dist/modules/storage/components/dropzone.client.d.mts.map +1 -0
- package/dist/modules/{uploads/components/dropzone/index.mjs → storage/components/dropzone.client.mjs} +6 -6
- package/dist/modules/storage/components/dropzone.client.mjs.map +1 -0
- package/dist/modules/storage/components/image-grid.client.d.mts +26 -0
- package/dist/modules/storage/components/image-grid.client.d.mts.map +1 -0
- package/dist/modules/storage/components/image-grid.client.mjs +169 -0
- package/dist/modules/storage/components/image-grid.client.mjs.map +1 -0
- package/dist/modules/storage/components/upload-zone-context.client.d.mts +34 -0
- package/dist/modules/storage/components/upload-zone-context.client.d.mts.map +1 -0
- package/dist/modules/storage/components/upload-zone-context.client.mjs +21 -0
- package/dist/modules/storage/components/upload-zone-context.client.mjs.map +1 -0
- package/dist/modules/storage/components/upload-zone.client.d.mts +51 -0
- package/dist/modules/storage/components/upload-zone.client.d.mts.map +1 -0
- package/dist/modules/storage/components/upload-zone.client.mjs +196 -0
- package/dist/modules/storage/components/upload-zone.client.mjs.map +1 -0
- package/dist/modules/{uploads/lib → storage/config}/filters.d.mts +2 -2
- package/dist/modules/storage/config/filters.d.mts.map +1 -0
- package/dist/modules/{uploads/lib → storage/config}/filters.mjs +3 -3
- package/dist/modules/storage/config/filters.mjs.map +1 -0
- package/dist/modules/storage/lib/constants.d.mts +10 -0
- package/dist/modules/storage/lib/constants.d.mts.map +1 -0
- package/dist/modules/{uploads → storage}/lib/constants.mjs +3 -2
- package/dist/modules/storage/lib/constants.mjs.map +1 -0
- package/dist/modules/storage/lib/create-client.server.d.mts +11 -0
- package/dist/modules/storage/lib/create-client.server.d.mts.map +1 -0
- package/dist/modules/storage/lib/create-client.server.mjs +11 -0
- package/dist/modules/storage/lib/create-client.server.mjs.map +1 -0
- package/dist/modules/storage/lib/helpers.d.mts +45 -0
- package/dist/modules/storage/lib/helpers.d.mts.map +1 -0
- package/dist/modules/{uploads → storage}/lib/helpers.mjs +20 -6
- package/dist/modules/storage/lib/helpers.mjs.map +1 -0
- package/dist/modules/storage/lib/proxy.server.d.mts +21 -0
- package/dist/modules/storage/lib/proxy.server.d.mts.map +1 -0
- package/dist/modules/storage/lib/proxy.server.mjs +46 -0
- package/dist/modules/storage/lib/proxy.server.mjs.map +1 -0
- package/dist/modules/storage/lib/router.server.d.mts +29074 -0
- package/dist/modules/storage/lib/router.server.d.mts.map +1 -0
- package/dist/modules/storage/lib/router.server.mjs +83 -0
- package/dist/modules/storage/lib/router.server.mjs.map +1 -0
- package/dist/modules/{uploads → storage}/lib/schema.d.mts +414 -150
- package/dist/modules/storage/lib/schema.d.mts.map +1 -0
- package/dist/modules/{uploads → storage}/lib/schema.mjs +23 -18
- package/dist/modules/storage/lib/schema.mjs.map +1 -0
- package/dist/modules/storage/lib/service.server.d.mts +188 -0
- package/dist/modules/storage/lib/service.server.d.mts.map +1 -0
- package/dist/modules/storage/lib/service.server.mjs +297 -0
- package/dist/modules/storage/lib/service.server.mjs.map +1 -0
- package/dist/modules/{uploads → storage}/lib/validators.d.mts +413 -108
- package/dist/modules/storage/lib/validators.d.mts.map +1 -0
- package/dist/modules/storage/lib/validators.mjs +106 -0
- package/dist/modules/storage/lib/validators.mjs.map +1 -0
- package/dist/storage/client.d.mts +6 -0
- package/dist/storage/client.mjs +14 -0
- package/dist/storage/client.mjs.map +1 -0
- package/dist/storage/server.d.mts +4 -0
- package/dist/storage/server.mjs +5 -0
- package/dist/storage.d.mts +6 -0
- package/dist/storage.mjs +7 -0
- package/package.json +32 -20
- package/src/components/editor/components/block-dropdown.tsx +43 -25
- package/src/components/editor/components/content.client.tsx +1 -1
- package/src/components/editor/components/editor.client.tsx +95 -0
- package/src/components/editor/components/menu-fixed.client.tsx +165 -0
- package/src/components/editor/components/spinner.tsx +2 -2
- package/src/components/editor/lib/constants.ts +109 -0
- package/src/components/editor/lib/extensions.ts +195 -0
- package/src/components/editor/lib/helpers.ts +3 -3
- package/src/components/editor/lib/variants.ts +5 -0
- package/src/components/entry.client.ts +2 -4
- package/src/components/header/top-bar.client.tsx +1 -1
- package/src/components/layouts/admin-content.client.tsx +1 -1
- package/src/components/ui/calendar.tsx +152 -44
- package/src/components/ui/input-recipient.tsx +3 -0
- package/src/entry.ts +4 -4
- package/src/modules/auth/db/schema.ts +13 -21
- package/src/modules/auth/handler/client.client.ts +2 -0
- package/src/modules/auth/handler/init.ts +4 -1
- package/src/modules/auth/hooks/use-permission.ts +3 -2
- package/src/modules/auth/hooks/use-session.ts +16 -10
- package/src/modules/auth/lib/validators.ts +1 -1
- package/src/modules/commands/components/alert-dialog-command.client.tsx +2 -2
- package/src/modules/commands/components/click-command.client.tsx +2 -2
- package/src/modules/commands/components/dialog-command.client.tsx +20 -8
- package/src/modules/commands/components/dropdown-command.client.tsx +2 -2
- package/src/modules/commands/components/form-dialog-command.client.tsx +2 -2
- package/src/modules/commands/entry.client.ts +1 -1
- package/src/modules/commands/hooks/{use-command-action.client.tsx → use-command-mutation.client.tsx} +9 -47
- package/src/modules/commands/utils/delete-command.client.tsx +14 -2
- package/src/modules/config/db/create-client.ts +11 -4
- package/src/modules/config/entry.server.ts +0 -1
- package/src/modules/config/lib/config.ts +3 -3
- package/src/modules/config/lib/context.ts +2 -2
- package/src/modules/data-tables/components/filters/combobox.client.tsx +3 -3
- package/src/modules/data-tables/entry.ts +1 -1
- package/src/modules/data-tables/hooks/use-context.client.tsx +31 -13
- package/src/modules/data-tables/hooks/use-table.client.ts +6 -3
- package/src/modules/data-tables/lib/filters/config.ts +1 -0
- package/src/modules/data-tables/lib/filters/helpers.ts +19 -0
- package/src/modules/data-tables/lib/filters/parsers.ts +14 -1
- package/src/modules/data-tables/lib/filters/resolvers.ts +8 -0
- package/src/modules/data-tables/lib/types.ts +10 -3
- package/src/modules/data-tables/tables/inline-table/components/cells/drag-handle.client.tsx +1 -1
- package/src/modules/inline-edit/components/combobox-dropdown.client.tsx +9 -2
- package/src/modules/inline-edit/components/combobox.client.tsx +8 -1
- package/src/modules/inline-edit/components/date-input.client.tsx +7 -3
- package/src/modules/inline-edit/components/date-picker.client.tsx +10 -3
- package/src/modules/inline-edit/components/deprecated-editor.client.tsx +48 -0
- package/src/modules/inline-edit/components/editor.client.tsx +32 -29
- package/src/modules/inline-edit/components/input-recipient.client.tsx +6 -2
- package/src/modules/inline-edit/components/input-toggle.client.tsx +2 -0
- package/src/modules/inline-edit/components/input.client.tsx +39 -0
- package/src/modules/inline-edit/components/select.client.tsx +9 -2
- package/src/modules/inline-edit/components/switch.client.tsx +2 -0
- package/src/modules/inline-edit/components/toggle.client.tsx +2 -0
- package/src/modules/inline-edit/entry.client.ts +1 -1
- package/src/modules/inline-edit/hooks/use-inline.client.tsx +2 -2
- package/src/modules/inline-edit/lib/variants.ts +1 -1
- package/src/modules/{uploads/components/dropzone/index.tsx → storage/components/dropzone.client.tsx} +2 -2
- package/src/modules/storage/components/image-grid.client.tsx +225 -0
- package/src/modules/{uploads/components/button.client.tsx → storage/components/upload-button.client.tsx} +1 -1
- package/src/modules/storage/components/upload-zone-context.client.tsx +32 -0
- package/src/modules/storage/components/upload-zone.client.tsx +258 -0
- package/src/modules/{uploads/lib → storage/config}/filters.ts +2 -2
- package/src/modules/storage/entry.client.ts +12 -0
- package/src/modules/storage/entry.server.ts +6 -0
- package/src/modules/{uploads → storage}/entry.ts +1 -1
- package/src/modules/storage/lib/constants.ts +14 -0
- package/src/modules/storage/lib/create-client.server.ts +14 -0
- package/src/modules/{uploads → storage}/lib/helpers.ts +23 -9
- package/src/modules/storage/lib/proxy.server.ts +63 -0
- package/src/modules/storage/lib/router.server.ts +174 -0
- package/src/modules/{uploads → storage}/lib/schema.ts +34 -13
- package/src/modules/storage/lib/service.server.ts +463 -0
- package/src/modules/storage/lib/validators.ts +156 -0
- package/dist/components/editor/components/fixed-menu.client.d.mts +0 -7
- package/dist/components/editor/components/fixed-menu.client.d.mts.map +0 -1
- package/dist/components/editor/components/fixed-menu.client.mjs.map +0 -1
- package/dist/components/editor/context.client.d.mts +0 -33
- package/dist/components/editor/context.client.d.mts.map +0 -1
- package/dist/components/editor/context.client.mjs +0 -45
- package/dist/components/editor/context.client.mjs.map +0 -1
- package/dist/components/editor/index.client.d.mts +0 -11
- package/dist/components/editor/index.client.d.mts.map +0 -1
- package/dist/components/editor/index.client.mjs +0 -17
- package/dist/components/editor/index.client.mjs.map +0 -1
- package/dist/components/editor/preview.client.d.mts +0 -12
- package/dist/components/editor/preview.client.d.mts.map +0 -1
- package/dist/components/editor/preview.client.mjs +0 -19
- package/dist/components/editor/preview.client.mjs.map +0 -1
- package/dist/modules/commands/hooks/use-command-action.client.d.mts +0 -22
- package/dist/modules/commands/hooks/use-command-action.client.d.mts.map +0 -1
- package/dist/modules/commands/hooks/use-command-action.client.mjs +0 -74
- package/dist/modules/commands/hooks/use-command-action.client.mjs.map +0 -1
- package/dist/modules/config/providers/blob.d.mts +0 -10
- package/dist/modules/config/providers/blob.d.mts.map +0 -1
- package/dist/modules/config/providers/blob.mjs +0 -11
- package/dist/modules/config/providers/blob.mjs.map +0 -1
- package/dist/modules/inline-edit/components/richtext.client.d.mts +0 -15
- package/dist/modules/inline-edit/components/richtext.client.d.mts.map +0 -1
- package/dist/modules/inline-edit/components/richtext.client.mjs +0 -31
- package/dist/modules/inline-edit/components/richtext.client.mjs.map +0 -1
- package/dist/modules/uploads/components/button.client.d.mts +0 -12
- package/dist/modules/uploads/components/button.client.d.mts.map +0 -1
- package/dist/modules/uploads/components/button.client.mjs +0 -34
- package/dist/modules/uploads/components/button.client.mjs.map +0 -1
- package/dist/modules/uploads/components/dropzone/context.d.mts.map +0 -1
- package/dist/modules/uploads/components/dropzone/context.mjs.map +0 -1
- package/dist/modules/uploads/components/dropzone/index.d.mts.map +0 -1
- package/dist/modules/uploads/components/dropzone/index.mjs.map +0 -1
- package/dist/modules/uploads/components/images/grid.client.d.mts +0 -11
- package/dist/modules/uploads/components/images/grid.client.d.mts.map +0 -1
- package/dist/modules/uploads/components/images/grid.client.mjs +0 -119
- package/dist/modules/uploads/components/images/grid.client.mjs.map +0 -1
- package/dist/modules/uploads/components/images/input.client.d.mts +0 -16
- package/dist/modules/uploads/components/images/input.client.d.mts.map +0 -1
- package/dist/modules/uploads/components/images/input.client.mjs +0 -28
- package/dist/modules/uploads/components/images/input.client.mjs.map +0 -1
- package/dist/modules/uploads/components/preview-dialog.client.d.mts +0 -16
- package/dist/modules/uploads/components/preview-dialog.client.d.mts.map +0 -1
- package/dist/modules/uploads/components/preview-dialog.client.mjs +0 -22
- package/dist/modules/uploads/components/preview-dialog.client.mjs.map +0 -1
- package/dist/modules/uploads/components/zone.client.d.mts +0 -21
- package/dist/modules/uploads/components/zone.client.d.mts.map +0 -1
- package/dist/modules/uploads/components/zone.client.mjs +0 -38
- package/dist/modules/uploads/components/zone.client.mjs.map +0 -1
- package/dist/modules/uploads/hooks/use-upload-image.client.d.mts +0 -34
- package/dist/modules/uploads/hooks/use-upload-image.client.d.mts.map +0 -1
- package/dist/modules/uploads/hooks/use-upload-image.client.mjs +0 -101
- package/dist/modules/uploads/hooks/use-upload-image.client.mjs.map +0 -1
- package/dist/modules/uploads/hooks/use-upload-zone.client.d.mts +0 -39
- package/dist/modules/uploads/hooks/use-upload-zone.client.d.mts.map +0 -1
- package/dist/modules/uploads/hooks/use-upload-zone.client.mjs +0 -20
- package/dist/modules/uploads/hooks/use-upload-zone.client.mjs.map +0 -1
- package/dist/modules/uploads/lib/constants.d.mts +0 -9
- package/dist/modules/uploads/lib/constants.d.mts.map +0 -1
- package/dist/modules/uploads/lib/constants.mjs.map +0 -1
- package/dist/modules/uploads/lib/filters.d.mts.map +0 -1
- package/dist/modules/uploads/lib/filters.mjs.map +0 -1
- package/dist/modules/uploads/lib/helpers.d.mts +0 -36
- package/dist/modules/uploads/lib/helpers.d.mts.map +0 -1
- package/dist/modules/uploads/lib/helpers.mjs.map +0 -1
- package/dist/modules/uploads/lib/procedures.server.d.mts +0 -13628
- package/dist/modules/uploads/lib/procedures.server.d.mts.map +0 -1
- package/dist/modules/uploads/lib/procedures.server.mjs +0 -176
- package/dist/modules/uploads/lib/procedures.server.mjs.map +0 -1
- package/dist/modules/uploads/lib/proxy.server.d.mts +0 -54
- package/dist/modules/uploads/lib/proxy.server.d.mts.map +0 -1
- package/dist/modules/uploads/lib/proxy.server.mjs +0 -97
- package/dist/modules/uploads/lib/proxy.server.mjs.map +0 -1
- package/dist/modules/uploads/lib/route.server.d.mts +0 -43
- package/dist/modules/uploads/lib/route.server.d.mts.map +0 -1
- package/dist/modules/uploads/lib/route.server.mjs +0 -70
- package/dist/modules/uploads/lib/route.server.mjs.map +0 -1
- package/dist/modules/uploads/lib/schema.d.mts.map +0 -1
- package/dist/modules/uploads/lib/schema.mjs.map +0 -1
- package/dist/modules/uploads/lib/validators.d.mts.map +0 -1
- package/dist/modules/uploads/lib/validators.mjs +0 -26
- package/dist/modules/uploads/lib/validators.mjs.map +0 -1
- package/dist/uploads/client.d.mts +0 -10
- package/dist/uploads/client.mjs +0 -11
- package/dist/uploads/server.d.mts +0 -4
- package/dist/uploads/server.mjs +0 -5
- package/dist/uploads.d.mts +0 -6
- package/dist/uploads.mjs +0 -7
- package/src/components/editor/components/fixed-menu.client.tsx +0 -143
- package/src/components/editor/context.client.tsx +0 -116
- package/src/components/editor/index.client.tsx +0 -13
- package/src/components/editor/preview.client.tsx +0 -13
- package/src/modules/config/providers/blob.ts +0 -11
- package/src/modules/inline-edit/components/richtext.client.tsx +0 -38
- package/src/modules/uploads/components/images/grid.client.tsx +0 -162
- package/src/modules/uploads/components/images/input.client.tsx +0 -34
- package/src/modules/uploads/components/preview-dialog.client.tsx +0 -21
- package/src/modules/uploads/components/zone.client.tsx +0 -56
- package/src/modules/uploads/entry.client.ts +0 -16
- package/src/modules/uploads/entry.server.ts +0 -6
- package/src/modules/uploads/hooks/use-upload-image.client.tsx +0 -131
- package/src/modules/uploads/hooks/use-upload-zone.client.ts +0 -44
- package/src/modules/uploads/lib/constants.ts +0 -10
- package/src/modules/uploads/lib/procedures.server.ts +0 -332
- package/src/modules/uploads/lib/proxy.server.ts +0 -139
- package/src/modules/uploads/lib/route.server.ts +0 -93
- package/src/modules/uploads/lib/validators.ts +0 -50
- /package/src/modules/{uploads/components/dropzone/context.tsx → storage/components/dropzone-context.client.tsx} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.mts","names":[],"sources":["../../../../src/modules/auth/handler/init.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;;cAca,gBAAA;KAER,8BAA8B;MAC7B,eAAe;SACZ;UACC;MACJ,kBAAkB;6BAEF;;AART,iBAYG,QAZa,CAAA,gBAYY,eAZZ,CAAA,CAAA,KAAA,EAYoC,aAZpC,CAYkD,OAZlD,CAAA,CAAA,
|
|
1
|
+
{"version":3,"file":"init.d.mts","names":[],"sources":["../../../../src/modules/auth/handler/init.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;;cAca,gBAAA;KAER,8BAA8B;MAC7B,eAAe;SACZ;UACC;MACJ,kBAAkB;6BAEF;;AART,iBAYG,QAZa,CAAA,gBAYY,eAZZ,CAAA,CAAA,KAAA,EAYoC,aAZpC,CAYkD,OAZlD,CAAA,CAAA,eAY0D,IAZ1D,CAAA;EAExB,QAAA,EAAA;IAA8B,YAAA,EAAA,MAAA;IACd,QAAA,EAAA;MAAf,UAAA,EAAA,GAAA,GAAA,KAAA;IACG,CAAA;EACC,CAAA;EACc,QAAA,EAAA,CAAA,OAAA,EAMsD,YAAA,CAAA,iBANtD,EAAA,yBAAA,gCAAA;EAAlB,gBAAA,EAAA;IAEgB,OAAA,EAAA,IAAA;EAAI,CAAA;EAIV,IAAA,EAAA;IAAyB,WAAA,EAAA;MAAsC,OAAA,EAAA,IAAA;IAAd,CAAA;IAAa,gBAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAAS,EAAA,EAAA,MAAA;cAAA,SAAA,MAAA;cAoFjE,SAAqB,MAAlB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAAb,UAAA,GAAa,kBAAkB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { users } from "../db/schema.mjs";
|
|
2
1
|
import { url } from "../../../lib/utils/url.mjs";
|
|
2
|
+
import { users } from "../db/schema.mjs";
|
|
3
3
|
import forget_password_email_default from "../../../components/emails/forget-password-email.mjs";
|
|
4
4
|
import { eq } from "drizzle-orm";
|
|
5
5
|
import { passkey } from "@better-auth/passkey";
|
|
@@ -12,7 +12,10 @@ import { admin, createAuthMiddleware, emailOTP } from "better-auth/plugins";
|
|
|
12
12
|
const authCookiePrefix = "tulip";
|
|
13
13
|
function initAuth(props) {
|
|
14
14
|
return betterAuth({
|
|
15
|
-
advanced: {
|
|
15
|
+
advanced: {
|
|
16
|
+
cookiePrefix: authCookiePrefix,
|
|
17
|
+
database: { generateId: () => false }
|
|
18
|
+
},
|
|
16
19
|
database: drizzleAdapter(props.db, {
|
|
17
20
|
provider: "pg",
|
|
18
21
|
usePlural: true
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.mjs","names":["ForgetPasswordEmail"],"sources":["../../../../src/modules/auth/handler/init.ts"],"sourcesContent":["import ForgetPasswordEmail from \"@/components/emails/forget-password-email\";\nimport { url } from \"@/lib/utils/url\";\nimport { TDatabaseSchema } from \"@/modules/config/entry\";\nimport { DatabaseClient, EmailClient } from \"@/modules/config/entry.server\";\nimport { TulipConfig } from \"@/modules/config/lib/config\";\nimport { passkey } from \"@better-auth/passkey\";\nimport { drizzleAdapter } from \"better-auth/adapters/drizzle\";\nimport { betterAuth } from \"better-auth/minimal\";\nimport { nextCookies } from \"better-auth/next-js\";\nimport { admin, createAuthMiddleware, emailOTP } from \"better-auth/plugins\";\nimport { eq } from \"drizzle-orm\";\nimport { users } from \"../entry\";\nimport { createAccessControl, Role } from \"../lib/permissions\";\n\nexport const authCookiePrefix = \"tulip\";\n\ntype InitAuthProps<TSchema extends TDatabaseSchema> = {\n db: DatabaseClient<TSchema>;\n email: EmailClient;\n config: TulipConfig;\n ac: ReturnType<typeof createAccessControl>;\n roles: {\n [key in string]?: Role;\n };\n};\n\nexport function initAuth<TSchema extends TDatabaseSchema>(props: InitAuthProps<TSchema>) {\n return betterAuth({\n advanced: {\n cookiePrefix: authCookiePrefix,\n },\n database: drizzleAdapter(props.db, {\n provider: \"pg\",\n
|
|
1
|
+
{"version":3,"file":"init.mjs","names":["ForgetPasswordEmail"],"sources":["../../../../src/modules/auth/handler/init.ts"],"sourcesContent":["import ForgetPasswordEmail from \"@/components/emails/forget-password-email\";\nimport { url } from \"@/lib/utils/url\";\nimport { TDatabaseSchema } from \"@/modules/config/entry\";\nimport { DatabaseClient, EmailClient } from \"@/modules/config/entry.server\";\nimport { TulipConfig } from \"@/modules/config/lib/config\";\nimport { passkey } from \"@better-auth/passkey\";\nimport { drizzleAdapter } from \"better-auth/adapters/drizzle\";\nimport { betterAuth } from \"better-auth/minimal\";\nimport { nextCookies } from \"better-auth/next-js\";\nimport { admin, createAuthMiddleware, emailOTP } from \"better-auth/plugins\";\nimport { eq } from \"drizzle-orm\";\nimport { users } from \"../entry\";\nimport { createAccessControl, Role } from \"../lib/permissions\";\n\nexport const authCookiePrefix = \"tulip\";\n\ntype InitAuthProps<TSchema extends TDatabaseSchema> = {\n db: DatabaseClient<TSchema>;\n email: EmailClient;\n config: TulipConfig;\n ac: ReturnType<typeof createAccessControl>;\n roles: {\n [key in string]?: Role;\n };\n};\n\nexport function initAuth<TSchema extends TDatabaseSchema>(props: InitAuthProps<TSchema>) {\n return betterAuth({\n advanced: {\n cookiePrefix: authCookiePrefix,\n database: {\n generateId: () => false,\n },\n },\n database: drizzleAdapter(props.db, {\n provider: \"pg\",\n usePlural: true,\n // schema: props.schema,\n }),\n emailAndPassword: {\n enabled: true,\n },\n user: {\n changeEmail: {\n enabled: true,\n },\n additionalFields: {\n firstName: {\n type: \"string\",\n required: true,\n input: true,\n },\n lastName: {\n type: \"string\",\n required: true,\n input: true,\n },\n },\n },\n hooks: {\n after: createAuthMiddleware(async (ctx) => {\n if (!ctx.path.startsWith(\"/sign-up\")) return;\n\n const session = ctx.context.newSession;\n if (!session) return;\n\n const existingUsers = await props.db.select().from(users);\n\n if (existingUsers.length === 1) {\n await props.db\n .update(users)\n .set({ role: \"developer\" })\n .where(eq(users.id, session.user.id));\n }\n }),\n },\n plugins: [\n nextCookies(),\n passkey(),\n admin({\n roles: props.roles,\n ac: props.ac,\n adminRoles: [\"admin\", \"developer\"],\n }),\n emailOTP({\n sendVerificationOTP: async ({ email, otp, type }) => {\n /**\n * Send a forget password mail\n */\n if (type === \"forget-password\") {\n const searchParams = new URLSearchParams();\n searchParams.set(\"email\", email);\n searchParams.set(\"otp\", otp);\n\n const resetPasswordHref = url(`/auth/reset-password?${searchParams.toString()}`);\n\n const result = await props.email.emails.send({\n from: props.config.email.defaultFrom,\n to: email,\n subject: \"Wachtwoord herstellen\",\n react: ForgetPasswordEmail({ resetPasswordHref }),\n });\n if (result.error) throw new Error(result.error.message);\n }\n },\n }),\n ],\n });\n}\n\nexport type AuthClient = ReturnType<typeof initAuth>;\n"],"mappings":";;;;;;;;;;;AAcA,MAAa,mBAAmB;AAYhC,SAAgB,SAA0C,OAA+B;AACvF,QAAO,WAAW;EAChB,UAAU;GACR,cAAc;GACd,UAAU,EACR,kBAAkB,OACnB;GACF;EACD,UAAU,eAAe,MAAM,IAAI;GACjC,UAAU;GACV,WAAW;GAEZ,CAAC;EACF,kBAAkB,EAChB,SAAS,MACV;EACD,MAAM;GACJ,aAAa,EACX,SAAS,MACV;GACD,kBAAkB;IAChB,WAAW;KACT,MAAM;KACN,UAAU;KACV,OAAO;KACR;IACD,UAAU;KACR,MAAM;KACN,UAAU;KACV,OAAO;KACR;IACF;GACF;EACD,OAAO,EACL,OAAO,qBAAqB,OAAO,QAAQ;AACzC,OAAI,CAAC,IAAI,KAAK,WAAW,WAAW,CAAE;GAEtC,MAAM,UAAU,IAAI,QAAQ;AAC5B,OAAI,CAAC,QAAS;AAId,QAFsB,MAAM,MAAM,GAAG,QAAQ,CAAC,KAAK,MAAM,EAEvC,WAAW,EAC3B,OAAM,MAAM,GACT,OAAO,MAAM,CACb,IAAI,EAAE,MAAM,aAAa,CAAC,CAC1B,MAAM,GAAG,MAAM,IAAI,QAAQ,KAAK,GAAG,CAAC;IAEzC,EACH;EACD,SAAS;GACP,aAAa;GACb,SAAS;GACT,MAAM;IACJ,OAAO,MAAM;IACb,IAAI,MAAM;IACV,YAAY,CAAC,SAAS,YAAY;IACnC,CAAC;GACF,SAAS,EACP,qBAAqB,OAAO,EAAE,OAAO,KAAK,WAAW;;;;AAInD,QAAI,SAAS,mBAAmB;KAC9B,MAAM,eAAe,IAAI,iBAAiB;AAC1C,kBAAa,IAAI,SAAS,MAAM;AAChC,kBAAa,IAAI,OAAO,IAAI;KAE5B,MAAM,oBAAoB,IAAI,wBAAwB,aAAa,UAAU,GAAG;KAEhF,MAAM,SAAS,MAAM,MAAM,MAAM,OAAO,KAAK;MAC3C,MAAM,MAAM,OAAO,MAAM;MACzB,IAAI;MACJ,SAAS;MACT,OAAOA,8BAAoB,EAAE,mBAAmB,CAAC;MAClD,CAAC;AACF,SAAI,OAAO,MAAO,OAAM,IAAI,MAAM,OAAO,MAAM,QAAQ;;MAG5D,CAAC;GACH;EACF,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Permission } from "../lib/permissions.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as _tanstack_react_query4 from "@tanstack/react-query";
|
|
3
3
|
|
|
4
4
|
//#region src/modules/auth/hooks/use-permission.d.ts
|
|
5
5
|
/**
|
|
@@ -7,7 +7,7 @@ import * as _tanstack_react_query0 from "@tanstack/react-query";
|
|
|
7
7
|
*/
|
|
8
8
|
declare function usePermission(permission?: Permission): {
|
|
9
9
|
data: null;
|
|
10
|
-
errors:
|
|
10
|
+
errors: _tanstack_react_query4.UseSuspenseQueryResult<{
|
|
11
11
|
permission: Permission;
|
|
12
12
|
success: boolean;
|
|
13
13
|
}, Error>[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-permission.d.mts","names":[],"sources":["../../../../src/modules/auth/hooks/use-permission.ts"],"sourcesContent":[],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"use-permission.d.mts","names":[],"sources":["../../../../src/modules/auth/hooks/use-permission.ts"],"sourcesContent":[],"mappings":";;;;;;;AAUgB,iBAAA,aAAA,CAAa,UAAA,CAAA,EAAc,UAAd,CAAA,EAAA;EAAc,IAAA,EAAA,IAAA"}
|
|
@@ -15,6 +15,10 @@ function usePermission(permission) {
|
|
|
15
15
|
queryKey: ["permission", permission$1],
|
|
16
16
|
queryFn: async () => {
|
|
17
17
|
const userId = sessionQuery.data?.user.id;
|
|
18
|
+
if (!userId) return {
|
|
19
|
+
permission: permission$1,
|
|
20
|
+
success: false
|
|
21
|
+
};
|
|
18
22
|
const { data, error } = await authClient.admin.hasPermission({
|
|
19
23
|
permission: permission$1,
|
|
20
24
|
userId
|
|
@@ -27,7 +31,8 @@ function usePermission(permission) {
|
|
|
27
31
|
permission: permission$1,
|
|
28
32
|
success: data.success
|
|
29
33
|
};
|
|
30
|
-
}
|
|
34
|
+
},
|
|
35
|
+
staleTime: 300 * 1e3
|
|
31
36
|
})),
|
|
32
37
|
combine: (results) => {
|
|
33
38
|
const errors = results.filter(({ error }) => error);
|
|
@@ -38,7 +43,7 @@ function usePermission(permission) {
|
|
|
38
43
|
const values = results.map(({ data }) => data);
|
|
39
44
|
return {
|
|
40
45
|
data: {
|
|
41
|
-
success: results.every(({ data }) => data
|
|
46
|
+
success: results.every(({ data }) => data?.success),
|
|
42
47
|
values
|
|
43
48
|
},
|
|
44
49
|
errors: null
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-permission.mjs","names":["permission"],"sources":["../../../../src/modules/auth/hooks/use-permission.ts"],"sourcesContent":["\"use client\";\n\nimport { useSuspenseQueries } from \"@tanstack/react-query\";\nimport {
|
|
1
|
+
{"version":3,"file":"use-permission.mjs","names":["permission"],"sources":["../../../../src/modules/auth/hooks/use-permission.ts"],"sourcesContent":["\"use client\";\n\nimport { useSuspenseQueries } from \"@tanstack/react-query\";\nimport { authClient } from \"../handler/client.client\";\nimport { type Permission } from \"../lib/permissions\";\nimport { useSession } from \"./use-session\";\n\n/**\n * UsePermission\n */\nexport function usePermission(permission?: Permission) {\n const sessionQuery = useSession();\n\n const keys = Object.entries(permission ?? {}).flatMap(([resource, permissions]) =>\n permissions.map((permission) => ({ [resource]: [permission] }) as Permission),\n );\n\n return useSuspenseQueries({\n queries: keys.map((permission) => ({\n queryKey: [\"permission\", permission],\n queryFn: async () => {\n const userId = sessionQuery.data?.user.id;\n if (!userId) return { permission, success: false };\n\n const { data, error } = await authClient.admin.hasPermission({ permission, userId });\n if (error) {\n console.error(error);\n throw error;\n }\n\n return {\n permission,\n success: data.success,\n };\n },\n staleTime: 5 * 60 * 1000, // 5 minutes\n })),\n combine: (results) => {\n const errors = results.filter(({ error }) => error);\n if (errors.length) return { data: null, errors };\n\n const values = results.map(({ data }) => data);\n const success = results.every(({ data }) => data?.success);\n\n return { data: { success, values }, errors: null };\n },\n });\n}\n"],"mappings":";;;;;;;;;;AAUA,SAAgB,cAAc,YAAyB;CACrD,MAAM,eAAe,YAAY;AAMjC,QAAO,mBAAmB;EACxB,SALW,OAAO,QAAQ,cAAc,EAAE,CAAC,CAAC,SAAS,CAAC,UAAU,iBAChE,YAAY,KAAK,kBAAgB,GAAG,WAAW,CAACA,aAAW,EAAE,EAAgB,CAC9E,CAGe,KAAK,kBAAgB;GACjC,UAAU,CAAC,cAAcA,aAAW;GACpC,SAAS,YAAY;IACnB,MAAM,SAAS,aAAa,MAAM,KAAK;AACvC,QAAI,CAAC,OAAQ,QAAO;KAAE;KAAY,SAAS;KAAO;IAElD,MAAM,EAAE,MAAM,UAAU,MAAM,WAAW,MAAM,cAAc;KAAE;KAAY;KAAQ,CAAC;AACpF,QAAI,OAAO;AACT,aAAQ,MAAM,MAAM;AACpB,WAAM;;AAGR,WAAO;KACL;KACA,SAAS,KAAK;KACf;;GAEH,WAAW,MAAS;GACrB,EAAE;EACH,UAAU,YAAY;GACpB,MAAM,SAAS,QAAQ,QAAQ,EAAE,YAAY,MAAM;AACnD,OAAI,OAAO,OAAQ,QAAO;IAAE,MAAM;IAAM;IAAQ;GAEhD,MAAM,SAAS,QAAQ,KAAK,EAAE,WAAW,KAAK;AAG9C,UAAO;IAAE,MAAM;KAAE,SAFD,QAAQ,OAAO,EAAE,WAAW,MAAM,QAAQ;KAEhC;KAAQ;IAAE,QAAQ;IAAM;;EAErD,CAAC"}
|
|
@@ -1,7 +1,123 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _tanstack_react_query0 from "@tanstack/react-query";
|
|
2
2
|
|
|
3
3
|
//#region src/modules/auth/hooks/use-session.d.ts
|
|
4
|
-
declare
|
|
4
|
+
declare const sessionQueryOptions: _tanstack_react_query0.OmitKeyof<_tanstack_react_query0.UseQueryOptions<{
|
|
5
|
+
user: {
|
|
6
|
+
id: string;
|
|
7
|
+
createdAt: Date;
|
|
8
|
+
updatedAt: Date;
|
|
9
|
+
email: string;
|
|
10
|
+
emailVerified: boolean;
|
|
11
|
+
name: string;
|
|
12
|
+
image?: string | null | undefined;
|
|
13
|
+
banned: boolean | null | undefined;
|
|
14
|
+
role?: string | null | undefined;
|
|
15
|
+
banReason?: string | null | undefined;
|
|
16
|
+
banExpires?: Date | null | undefined;
|
|
17
|
+
firstName: string;
|
|
18
|
+
lastName: string;
|
|
19
|
+
};
|
|
20
|
+
session: {
|
|
21
|
+
id: string;
|
|
22
|
+
createdAt: Date;
|
|
23
|
+
updatedAt: Date;
|
|
24
|
+
userId: string;
|
|
25
|
+
expiresAt: Date;
|
|
26
|
+
token: string;
|
|
27
|
+
ipAddress?: string | null | undefined;
|
|
28
|
+
userAgent?: string | null | undefined;
|
|
29
|
+
impersonatedBy?: string | null | undefined;
|
|
30
|
+
};
|
|
31
|
+
} | null, Error, {
|
|
32
|
+
user: {
|
|
33
|
+
id: string;
|
|
34
|
+
createdAt: Date;
|
|
35
|
+
updatedAt: Date;
|
|
36
|
+
email: string;
|
|
37
|
+
emailVerified: boolean;
|
|
38
|
+
name: string;
|
|
39
|
+
image?: string | null | undefined;
|
|
40
|
+
banned: boolean | null | undefined;
|
|
41
|
+
role?: string | null | undefined;
|
|
42
|
+
banReason?: string | null | undefined;
|
|
43
|
+
banExpires?: Date | null | undefined;
|
|
44
|
+
firstName: string;
|
|
45
|
+
lastName: string;
|
|
46
|
+
};
|
|
47
|
+
session: {
|
|
48
|
+
id: string;
|
|
49
|
+
createdAt: Date;
|
|
50
|
+
updatedAt: Date;
|
|
51
|
+
userId: string;
|
|
52
|
+
expiresAt: Date;
|
|
53
|
+
token: string;
|
|
54
|
+
ipAddress?: string | null | undefined;
|
|
55
|
+
userAgent?: string | null | undefined;
|
|
56
|
+
impersonatedBy?: string | null | undefined;
|
|
57
|
+
};
|
|
58
|
+
} | null, string[]>, "queryFn"> & {
|
|
59
|
+
queryFn?: _tanstack_react_query0.QueryFunction<{
|
|
60
|
+
user: {
|
|
61
|
+
id: string;
|
|
62
|
+
createdAt: Date;
|
|
63
|
+
updatedAt: Date;
|
|
64
|
+
email: string;
|
|
65
|
+
emailVerified: boolean;
|
|
66
|
+
name: string;
|
|
67
|
+
image?: string | null | undefined;
|
|
68
|
+
banned: boolean | null | undefined;
|
|
69
|
+
role?: string | null | undefined;
|
|
70
|
+
banReason?: string | null | undefined;
|
|
71
|
+
banExpires?: Date | null | undefined;
|
|
72
|
+
firstName: string;
|
|
73
|
+
lastName: string;
|
|
74
|
+
};
|
|
75
|
+
session: {
|
|
76
|
+
id: string;
|
|
77
|
+
createdAt: Date;
|
|
78
|
+
updatedAt: Date;
|
|
79
|
+
userId: string;
|
|
80
|
+
expiresAt: Date;
|
|
81
|
+
token: string;
|
|
82
|
+
ipAddress?: string | null | undefined;
|
|
83
|
+
userAgent?: string | null | undefined;
|
|
84
|
+
impersonatedBy?: string | null | undefined;
|
|
85
|
+
};
|
|
86
|
+
} | null, string[], never> | undefined;
|
|
87
|
+
} & {
|
|
88
|
+
queryKey: string[] & {
|
|
89
|
+
[dataTagSymbol]: {
|
|
90
|
+
user: {
|
|
91
|
+
id: string;
|
|
92
|
+
createdAt: Date;
|
|
93
|
+
updatedAt: Date;
|
|
94
|
+
email: string;
|
|
95
|
+
emailVerified: boolean;
|
|
96
|
+
name: string;
|
|
97
|
+
image?: string | null | undefined;
|
|
98
|
+
banned: boolean | null | undefined;
|
|
99
|
+
role?: string | null | undefined;
|
|
100
|
+
banReason?: string | null | undefined;
|
|
101
|
+
banExpires?: Date | null | undefined;
|
|
102
|
+
firstName: string;
|
|
103
|
+
lastName: string;
|
|
104
|
+
};
|
|
105
|
+
session: {
|
|
106
|
+
id: string;
|
|
107
|
+
createdAt: Date;
|
|
108
|
+
updatedAt: Date;
|
|
109
|
+
userId: string;
|
|
110
|
+
expiresAt: Date;
|
|
111
|
+
token: string;
|
|
112
|
+
ipAddress?: string | null | undefined;
|
|
113
|
+
userAgent?: string | null | undefined;
|
|
114
|
+
impersonatedBy?: string | null | undefined;
|
|
115
|
+
};
|
|
116
|
+
} | null;
|
|
117
|
+
[dataTagErrorSymbol]: Error;
|
|
118
|
+
};
|
|
119
|
+
};
|
|
120
|
+
declare function useSession(): _tanstack_react_query0.UseSuspenseQueryResult<{
|
|
5
121
|
user: {
|
|
6
122
|
id: string;
|
|
7
123
|
createdAt: Date;
|
|
@@ -30,5 +146,5 @@ declare function useSession(): _tanstack_react_query1.UseSuspenseQueryResult<{
|
|
|
30
146
|
};
|
|
31
147
|
} | null, Error>;
|
|
32
148
|
//#endregion
|
|
33
|
-
export { useSession };
|
|
149
|
+
export { sessionQueryOptions, useSession };
|
|
34
150
|
//# sourceMappingURL=use-session.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-session.d.mts","names":[],"sources":["../../../../src/modules/auth/hooks/use-session.ts"],"sourcesContent":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"use-session.d.mts","names":[],"sources":["../../../../src/modules/auth/hooks/use-session.ts"],"sourcesContent":[],"mappings":";;;cAKa,qBAAmB,sBAAA,CAAA,iCAAA;;;IAAnB,SAAA,MAAA;;;;;;;;;;;;;;;IAAmB,SAAA,MAAA;;;;;;;;;;;;;;;;;;IAehB,MAAA,EAAA,OAAU,GAAA,IAAA,GAAA,SAAA;;;;;;;;;IAAA,SAAA,MAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAV,UAAA,CAAA,0BAAU"}
|
|
@@ -1,20 +1,25 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import { authClient } from "../handler/client.client.mjs";
|
|
4
|
-
import { useSuspenseQuery } from "@tanstack/react-query";
|
|
4
|
+
import { queryOptions, useSuspenseQuery } from "@tanstack/react-query";
|
|
5
5
|
|
|
6
6
|
//#region src/modules/auth/hooks/use-session.ts
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
return
|
|
7
|
+
const sessionQueryOptions = queryOptions({
|
|
8
|
+
queryKey: ["session"],
|
|
9
|
+
queryFn: async () => {
|
|
10
|
+
const session = await authClient.getSession();
|
|
11
|
+
if (session.error) {
|
|
12
|
+
console.error(session.error);
|
|
13
|
+
return null;
|
|
14
14
|
}
|
|
15
|
-
|
|
15
|
+
return session.data;
|
|
16
|
+
},
|
|
17
|
+
staleTime: 1e3 * 60 * 60
|
|
18
|
+
});
|
|
19
|
+
function useSession() {
|
|
20
|
+
return useSuspenseQuery(sessionQueryOptions);
|
|
16
21
|
}
|
|
17
22
|
|
|
18
23
|
//#endregion
|
|
19
|
-
export { useSession };
|
|
24
|
+
export { sessionQueryOptions, useSession };
|
|
20
25
|
//# sourceMappingURL=use-session.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-session.mjs","names":[],"sources":["../../../../src/modules/auth/hooks/use-session.ts"],"sourcesContent":["\"use client\";\n\nimport { useSuspenseQuery } from \"@tanstack/react-query\";\nimport { authClient } from \"../entry.client\";\n\nexport
|
|
1
|
+
{"version":3,"file":"use-session.mjs","names":[],"sources":["../../../../src/modules/auth/hooks/use-session.ts"],"sourcesContent":["\"use client\";\n\nimport { queryOptions, useSuspenseQuery } from \"@tanstack/react-query\";\nimport { authClient } from \"../entry.client\";\n\nexport const sessionQueryOptions = queryOptions({\n queryKey: [\"session\"],\n queryFn: async () => {\n const session = await authClient.getSession();\n\n if (session.error) {\n console.error(session.error);\n return null;\n }\n\n return session.data;\n },\n staleTime: 1000 * 60 * 60,\n});\n\nexport function useSession() {\n const session = useSuspenseQuery(sessionQueryOptions);\n return session;\n}\n"],"mappings":";;;;;;AAKA,MAAa,sBAAsB,aAAa;CAC9C,UAAU,CAAC,UAAU;CACrB,SAAS,YAAY;EACnB,MAAM,UAAU,MAAM,WAAW,YAAY;AAE7C,MAAI,QAAQ,OAAO;AACjB,WAAQ,MAAM,QAAQ,MAAM;AAC5B,UAAO;;AAGT,SAAO,QAAQ;;CAEjB,WAAW,MAAO,KAAK;CACxB,CAAC;AAEF,SAAgB,aAAa;AAE3B,QADgB,iBAAiB,oBAAoB"}
|
|
@@ -3,7 +3,7 @@ import { TDatabaseSchema } from "../../config/db/types.mjs";
|
|
|
3
3
|
import { TulipContext } from "../../config/lib/context.mjs";
|
|
4
4
|
import "../../../config.mjs";
|
|
5
5
|
import "server-cli-only";
|
|
6
|
-
import * as
|
|
6
|
+
import * as better_auth_plugins0 from "better-auth/plugins";
|
|
7
7
|
|
|
8
8
|
//#region src/modules/auth/lib/helpers.server.d.ts
|
|
9
9
|
/**
|
|
@@ -52,7 +52,7 @@ declare function createUser<TSchema extends TDatabaseSchema>({
|
|
|
52
52
|
}: {
|
|
53
53
|
body: CreateUserSchema;
|
|
54
54
|
}): Promise<{
|
|
55
|
-
user:
|
|
55
|
+
user: better_auth_plugins0.UserWithRole;
|
|
56
56
|
}>;
|
|
57
57
|
/**
|
|
58
58
|
* Update a user
|
|
@@ -66,19 +66,19 @@ declare function updateUser<TSchema extends TDatabaseSchema>({
|
|
|
66
66
|
userId: string;
|
|
67
67
|
body: Partial<UpdateUserSchema>;
|
|
68
68
|
}): Promise<{
|
|
69
|
-
id: string;
|
|
70
69
|
name: string;
|
|
71
70
|
firstName: string;
|
|
72
71
|
lastName: string;
|
|
73
72
|
email: string;
|
|
74
73
|
emailVerified: boolean;
|
|
75
74
|
image: string | null;
|
|
76
|
-
createdAt: Date;
|
|
77
|
-
updatedAt: Date;
|
|
78
75
|
role: string | null;
|
|
79
76
|
banned: boolean | null;
|
|
80
77
|
banReason: string | null;
|
|
81
78
|
banExpires: Date | null;
|
|
79
|
+
id: string;
|
|
80
|
+
createdAt: Date;
|
|
81
|
+
updatedAt: Date;
|
|
82
82
|
}>;
|
|
83
83
|
//#endregion
|
|
84
84
|
export { createUser, getSession, updateUser };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.server.d.mts","names":[],"sources":["../../../../src/modules/auth/lib/helpers.server.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;iBAasB,2BAA2B;;GAE9C,KAAK,aAAa,oBAAiB;EAFhB,OAAA,EAAA;IAA2B,EAAA,EAAA,MAAA;IAC/C,SAAA,MAAA;IACmB,SAAA,MAAA;IAAb,MAAA,EAAA,MAAA;IAAL,SAAA,MAAA;;;;;;;IAAmC,EAAA,EAAA,MAAA;IAAA,SAAA,MAAA;IAOtB,SAAU,MAAA;IAAiB,KAAA,EAAA,MAAA;IACvC,aAAA,EAAA,OAAA;IAAM,IAAA,EAAA,MAAA;IAAwB,KAAA,CAAA,EAAA,MAAA,GAAA,IAAA,GAAA,SAAA,GAAA,SAAA;IAAb,SAAA,EAAA,MAAA;IAAmC,QAAA,EAAA,MAAA;IACpD,MAAA,EAAA,OAAA,GAAA,IAAA,GAAA,SAAA;IAAgB,IAAA,CAAA,EAAA,MAAA,GAAA,IAAA,GAAA,SAAA;IAAgB,SAAA,CAAA,EAAA,MAAA,GAAA,IAAA,GAAA,SAAA;IAAE,UAAA,CAAA,MAAA,GAAA,IAAA,GAAA,SAAA;EAAA,CAAA;AAkBtC,CAAA,GAAsB,IAAA,CAAA;;;;AACZ,iBArBM,UAqBN,CAAA,gBArBiC,eAqBjC,CAAA,CAAA;EAAA,IAAA;EAAA;CAAA,EApBW,YAoBX,CApBwB,OAoBxB,CAAA,GAAA;EACN,OAAA,EArBoD,OAqBpD;CAAQ,EAAA;EAAA;CAAA,EAAA;EAAwC,IAAA,EApBhC,gBAoBgC;CAAR,CAAA,EApBN,OAoBM,CAAA;QApBR,
|
|
1
|
+
{"version":3,"file":"helpers.server.d.mts","names":[],"sources":["../../../../src/modules/auth/lib/helpers.server.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;iBAasB,2BAA2B;;GAE9C,KAAK,aAAa,oBAAiB;EAFhB,OAAA,EAAA;IAA2B,EAAA,EAAA,MAAA;IAC/C,SAAA,MAAA;IACmB,SAAA,MAAA;IAAb,MAAA,EAAA,MAAA;IAAL,SAAA,MAAA;;;;;;;IAAmC,EAAA,EAAA,MAAA;IAAA,SAAA,MAAA;IAOtB,SAAU,MAAA;IAAiB,KAAA,EAAA,MAAA;IACvC,aAAA,EAAA,OAAA;IAAM,IAAA,EAAA,MAAA;IAAwB,KAAA,CAAA,EAAA,MAAA,GAAA,IAAA,GAAA,SAAA,GAAA,SAAA;IAAb,SAAA,EAAA,MAAA;IAAmC,QAAA,EAAA,MAAA;IACpD,MAAA,EAAA,OAAA,GAAA,IAAA,GAAA,SAAA;IAAgB,IAAA,CAAA,EAAA,MAAA,GAAA,IAAA,GAAA,SAAA;IAAgB,SAAA,CAAA,EAAA,MAAA,GAAA,IAAA,GAAA,SAAA;IAAE,UAAA,CAAA,MAAA,GAAA,IAAA,GAAA,SAAA;EAAA,CAAA;AAkBtC,CAAA,GAAsB,IAAA,CAAA;;;;AACZ,iBArBM,UAqBN,CAAA,gBArBiC,eAqBjC,CAAA,CAAA;EAAA,IAAA;EAAA;CAAA,EApBW,YAoBX,CApBwB,OAoBxB,CAAA,GAAA;EACN,OAAA,EArBoD,OAqBpD;CAAQ,EAAA;EAAA;CAAA,EAAA;EAAwC,IAAA,EApBhC,gBAoBgC;CAAR,CAAA,EApBN,OAoBM,CAAA;QApBR,oBAAA,CAAA;;;;;iBAkBd,2BAA2B;;GACvC,aAAa;;;;;QACqB,QAAQ;IAAmB"}
|
|
@@ -36,7 +36,7 @@ declare const createUserSchema: z$1.ZodObject<{
|
|
|
36
36
|
firstName: z$1.ZodString;
|
|
37
37
|
lastName: z$1.ZodString;
|
|
38
38
|
password: z$1.ZodString;
|
|
39
|
-
role: z$1.
|
|
39
|
+
role: z$1.ZodString;
|
|
40
40
|
}, z$1.core.$strip>;
|
|
41
41
|
type CreateUserSchema = z$1.infer<typeof createUserSchema>;
|
|
42
42
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validators.d.mts","names":[],"sources":["../../../../src/modules/auth/lib/validators.ts"],"sourcesContent":[],"mappings":";;;;;;;AAQA;AAKa,KALD,IAAA,GAcV,OAdwB,KAAA,CAAM,YAc9B;;;;AATsB,cAAX,WAAW,EAAA,GAAA,CAAA,SAAA,CAAA;EAAA,KAAA,cAAA;EAcX,QAAA,eAAA;;;;;AAAmB,cAAnB,mBAAmB,EAAA,GAAA,CAAA,SAAA,CAAA;EAmBnB,QAAA,eAAA;;;;;AAUb;cAVa,sBAAoB,GAAA,CAAA;;;;;;cAUpB,kBAAgB,GAAA,CAAA
|
|
1
|
+
{"version":3,"file":"validators.d.mts","names":[],"sources":["../../../../src/modules/auth/lib/validators.ts"],"sourcesContent":[],"mappings":";;;;;;;AAQA;AAKa,KALD,IAAA,GAcV,OAdwB,KAAA,CAAM,YAc9B;;;;AATsB,cAAX,WAAW,EAAA,GAAA,CAAA,SAAA,CAAA;EAAA,KAAA,cAAA;EAcX,QAAA,eAAA;;;;;AAAmB,cAAnB,mBAAmB,EAAA,GAAA,CAAA,SAAA,CAAA;EAmBnB,QAAA,eAAA;;;;;AAUb;cAVa,sBAAoB,GAAA,CAAA;;;;;;cAUpB,kBAAgB,GAAA,CAAA;;;;;EAAA,QAAA,eAAA;EAAA,IAAA,eAAA;AAa7B,CAAA,iBAAY,CAAA;AAKC,KALD,gBAAA,GAAmB,GAAA,CAAE,KAU/B,CAAA,OAV4C,gBAU5C,CAAA;;;;cALW,kBAAgB,GAAA,CAAA;;;EAAA,QAAA,eAAA;EAAA,KAAA,eAAA;AAO7B,CAAA,EAAA;EAKa,GAAA,EAAA,CAAA,CAAA;;;AAAoB,KALrB,gBAAA,GAAmB,GAAA,CAAE,KAKA,CAAA,OALa,gBAKb,CAAA;;AAIjC;;cAJa,sBAAoB,GAAA,CAAA;;;KAIrB,oBAAA,GAAuB,GAAA,CAAE,aAAa"}
|
|
@@ -35,7 +35,7 @@ const createUserSchema = userSchema.pick({
|
|
|
35
35
|
firstName: z$1.string().min(2, { message: "Voornaam moet langer zijn dan 2 karakters" }).max(50, { message: "Voornaam mag niet langer zijn dan 50 karakters" }),
|
|
36
36
|
lastName: z$1.string().min(2, { message: "Achternaam moet langer zijn dan 2 karakters" }).max(50, { message: "Achternaam mag niet langer zijn dan 50 karakters" }),
|
|
37
37
|
password: z$1.string().min(6, { message: "Wachtwoord moet minimaal 6 karakters hebben" }),
|
|
38
|
-
role: z$1.string()
|
|
38
|
+
role: z$1.string()
|
|
39
39
|
});
|
|
40
40
|
/**
|
|
41
41
|
* Update user schema
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validators.mjs","names":["z"],"sources":["../../../../src/modules/auth/lib/validators.ts"],"sourcesContent":["import { userSchema } from \"better-auth/db\";\nimport { createInsertSchema } from \"drizzle-zod\";\nimport { z } from \"zod\";\nimport { users } from \"../db/schema\";\n\n/**\n * User type\n */\nexport type User = typeof users.$inferSelect;\n\n/**\n * Login schema\n */\nexport const loginSchema = z.object({\n email: z\n .email({ message: \"Email moet een geldig email adres zijn\" })\n .min(2, { message: \"Email moet langer zijn dan 2 karakters\" })\n .max(50, { message: \"Email mag niet langer zijn dan 50 karakters\" }),\n password: z\n .string()\n .min(2, { message: \"Wachtwoord moet langer zijn dan 2 karakters\" })\n .max(50, { message: \"Wachtwoord mag niet langer zijn dan 50 karakters\" }),\n});\n\n/**\n * Reset password schema\n */\nexport const resetPasswordSchema = z\n .object({\n password: z\n .string()\n .min(2, { message: \"Wachtwoord moet langer zijn dan 2 karakters\" })\n .max(50, { message: \"Wachtwoord mag niet langer zijn dan 50 karakters\" }),\n passwordConfirmation: z\n .string()\n .min(2, { message: \"Wachtwoord moet langer zijn dan 2 karakters\" })\n .max(50, { message: \"Wachtwoord mag niet langer zijn dan 50 karakters\" }),\n })\n .refine((data) => data.password === data.passwordConfirmation, {\n message: \"Wachtwoorden komen niet overeen\",\n path: [\"passwordConfirmation\"],\n });\n\n/**\n * Forgot password schema\n */\nexport const forgotPasswordSchema = z.object({\n email: z\n .email({ error: \"Email moet een geldig email adres zijn\" })\n .min(2, { message: \"Email moet langer zijn dan 2 karakters\" })\n .max(50, { message: \"Email mag niet langer zijn dan 50 karakters\" }),\n});\n\n/**\n * Create user schema\n */\nexport const createUserSchema = userSchema.pick({ email: true, image: true }).extend({\n firstName: z\n .string()\n .min(2, { message: \"Voornaam moet langer zijn dan 2 karakters\" })\n .max(50, { message: \"Voornaam mag niet langer zijn dan 50 karakters\" }),\n lastName: z\n .string()\n .min(2, { message: \"Achternaam moet langer zijn dan 2 karakters\" })\n .max(50, { message: \"Achternaam mag niet langer zijn dan 50 karakters\" }),\n password: z.string().min(6, { message: \"Wachtwoord moet minimaal 6 karakters hebben\" }),\n role: z.string()
|
|
1
|
+
{"version":3,"file":"validators.mjs","names":["z"],"sources":["../../../../src/modules/auth/lib/validators.ts"],"sourcesContent":["import { userSchema } from \"better-auth/db\";\nimport { createInsertSchema } from \"drizzle-zod\";\nimport { z } from \"zod\";\nimport { users } from \"../db/schema\";\n\n/**\n * User type\n */\nexport type User = typeof users.$inferSelect;\n\n/**\n * Login schema\n */\nexport const loginSchema = z.object({\n email: z\n .email({ message: \"Email moet een geldig email adres zijn\" })\n .min(2, { message: \"Email moet langer zijn dan 2 karakters\" })\n .max(50, { message: \"Email mag niet langer zijn dan 50 karakters\" }),\n password: z\n .string()\n .min(2, { message: \"Wachtwoord moet langer zijn dan 2 karakters\" })\n .max(50, { message: \"Wachtwoord mag niet langer zijn dan 50 karakters\" }),\n});\n\n/**\n * Reset password schema\n */\nexport const resetPasswordSchema = z\n .object({\n password: z\n .string()\n .min(2, { message: \"Wachtwoord moet langer zijn dan 2 karakters\" })\n .max(50, { message: \"Wachtwoord mag niet langer zijn dan 50 karakters\" }),\n passwordConfirmation: z\n .string()\n .min(2, { message: \"Wachtwoord moet langer zijn dan 2 karakters\" })\n .max(50, { message: \"Wachtwoord mag niet langer zijn dan 50 karakters\" }),\n })\n .refine((data) => data.password === data.passwordConfirmation, {\n message: \"Wachtwoorden komen niet overeen\",\n path: [\"passwordConfirmation\"],\n });\n\n/**\n * Forgot password schema\n */\nexport const forgotPasswordSchema = z.object({\n email: z\n .email({ error: \"Email moet een geldig email adres zijn\" })\n .min(2, { message: \"Email moet langer zijn dan 2 karakters\" })\n .max(50, { message: \"Email mag niet langer zijn dan 50 karakters\" }),\n});\n\n/**\n * Create user schema\n */\nexport const createUserSchema = userSchema.pick({ email: true, image: true }).extend({\n firstName: z\n .string()\n .min(2, { message: \"Voornaam moet langer zijn dan 2 karakters\" })\n .max(50, { message: \"Voornaam mag niet langer zijn dan 50 karakters\" }),\n lastName: z\n .string()\n .min(2, { message: \"Achternaam moet langer zijn dan 2 karakters\" })\n .max(50, { message: \"Achternaam mag niet langer zijn dan 50 karakters\" }),\n password: z.string().min(6, { message: \"Wachtwoord moet minimaal 6 karakters hebben\" }),\n role: z.string(),\n});\n\nexport type CreateUserSchema = z.infer<typeof createUserSchema>;\n\n/**\n * Update user schema\n */\nexport const updateUserSchema = createInsertSchema(users).pick({\n firstName: true,\n lastName: true,\n email: true,\n image: true,\n});\n\nexport type UpdateUserSchema = z.infer<typeof updateUserSchema>;\n\n/**\n * Update password input validation\n */\nexport const updatePasswordSchema = z.object({\n password: z.string().min(6, { message: \"Wachtwoord moet minimaal 6 karakters hebben\" }),\n});\n\nexport type UpdatePasswordSchema = z.infer<typeof updatePasswordSchema>;\n"],"mappings":";;;;;;;;;AAaA,MAAa,cAAcA,IAAE,OAAO;CAClC,OAAOA,IACJ,MAAM,EAAE,SAAS,0CAA0C,CAAC,CAC5D,IAAI,GAAG,EAAE,SAAS,0CAA0C,CAAC,CAC7D,IAAI,IAAI,EAAE,SAAS,+CAA+C,CAAC;CACtE,UAAUA,IACP,QAAQ,CACR,IAAI,GAAG,EAAE,SAAS,+CAA+C,CAAC,CAClE,IAAI,IAAI,EAAE,SAAS,oDAAoD,CAAC;CAC5E,CAAC;;;;AAKF,MAAa,sBAAsBA,IAChC,OAAO;CACN,UAAUA,IACP,QAAQ,CACR,IAAI,GAAG,EAAE,SAAS,+CAA+C,CAAC,CAClE,IAAI,IAAI,EAAE,SAAS,oDAAoD,CAAC;CAC3E,sBAAsBA,IACnB,QAAQ,CACR,IAAI,GAAG,EAAE,SAAS,+CAA+C,CAAC,CAClE,IAAI,IAAI,EAAE,SAAS,oDAAoD,CAAC;CAC5E,CAAC,CACD,QAAQ,SAAS,KAAK,aAAa,KAAK,sBAAsB;CAC7D,SAAS;CACT,MAAM,CAAC,uBAAuB;CAC/B,CAAC;;;;AAKJ,MAAa,uBAAuBA,IAAE,OAAO,EAC3C,OAAOA,IACJ,MAAM,EAAE,OAAO,0CAA0C,CAAC,CAC1D,IAAI,GAAG,EAAE,SAAS,0CAA0C,CAAC,CAC7D,IAAI,IAAI,EAAE,SAAS,+CAA+C,CAAC,EACvE,CAAC;;;;AAKF,MAAa,mBAAmB,WAAW,KAAK;CAAE,OAAO;CAAM,OAAO;CAAM,CAAC,CAAC,OAAO;CACnF,WAAWA,IACR,QAAQ,CACR,IAAI,GAAG,EAAE,SAAS,6CAA6C,CAAC,CAChE,IAAI,IAAI,EAAE,SAAS,kDAAkD,CAAC;CACzE,UAAUA,IACP,QAAQ,CACR,IAAI,GAAG,EAAE,SAAS,+CAA+C,CAAC,CAClE,IAAI,IAAI,EAAE,SAAS,oDAAoD,CAAC;CAC3E,UAAUA,IAAE,QAAQ,CAAC,IAAI,GAAG,EAAE,SAAS,+CAA+C,CAAC;CACvF,MAAMA,IAAE,QAAQ;CACjB,CAAC;;;;AAOF,MAAa,mBAAmB,mBAAmB,MAAM,CAAC,KAAK;CAC7D,WAAW;CACX,UAAU;CACV,OAAO;CACP,OAAO;CACR,CAAC;;;;AAOF,MAAa,uBAAuBA,IAAE,OAAO,EAC3C,UAAUA,IAAE,QAAQ,CAAC,IAAI,GAAG,EAAE,SAAS,+CAA+C,CAAC,EACxF,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { DefaultError, MutationOptions } from "@tanstack/react-query";
|
|
4
4
|
import { Keys } from "react-hotkeys-hook";
|
|
@@ -11,7 +11,7 @@ import { AlertDialogCancelProps, AlertDialogContentProps, AlertDialogProps } fro
|
|
|
11
11
|
declare function CommandAlertDialog({
|
|
12
12
|
children,
|
|
13
13
|
...props
|
|
14
|
-
}: AlertDialogProps):
|
|
14
|
+
}: AlertDialogProps): react_jsx_runtime0.JSX.Element;
|
|
15
15
|
/**
|
|
16
16
|
* CommandAlertDialogTrigger
|
|
17
17
|
*/
|
|
@@ -28,49 +28,49 @@ declare function CommandAlertDialogTrigger({
|
|
|
28
28
|
children,
|
|
29
29
|
disabled,
|
|
30
30
|
...props
|
|
31
|
-
}: CommandAlertDialogTriggerProps):
|
|
31
|
+
}: CommandAlertDialogTriggerProps): react_jsx_runtime0.JSX.Element | undefined;
|
|
32
32
|
/**
|
|
33
33
|
* CommandAlertDialogContent
|
|
34
34
|
*/
|
|
35
35
|
declare function CommandAlertDialogContent({
|
|
36
36
|
children,
|
|
37
37
|
...props
|
|
38
|
-
}: AlertDialogContentProps):
|
|
38
|
+
}: AlertDialogContentProps): react_jsx_runtime0.JSX.Element;
|
|
39
39
|
/**
|
|
40
40
|
* CommandAlertDialogHeader
|
|
41
41
|
*/
|
|
42
42
|
declare function CommandAlertDialogHeader({
|
|
43
43
|
children,
|
|
44
44
|
...props
|
|
45
|
-
}: React.HTMLAttributes<HTMLElement>):
|
|
45
|
+
}: React.HTMLAttributes<HTMLElement>): react_jsx_runtime0.JSX.Element;
|
|
46
46
|
/**
|
|
47
47
|
* CommandAlertDialogTitle
|
|
48
48
|
*/
|
|
49
49
|
declare function CommandAlertDialogTitle({
|
|
50
50
|
children,
|
|
51
51
|
...props
|
|
52
|
-
}: React.HTMLAttributes<HTMLElement>):
|
|
52
|
+
}: React.HTMLAttributes<HTMLElement>): react_jsx_runtime0.JSX.Element;
|
|
53
53
|
/**
|
|
54
54
|
* CommandAlertDialogDescription
|
|
55
55
|
*/
|
|
56
56
|
declare function CommandAlertDialogDescription({
|
|
57
57
|
children,
|
|
58
58
|
...props
|
|
59
|
-
}: React.HTMLAttributes<HTMLElement>):
|
|
59
|
+
}: React.HTMLAttributes<HTMLElement>): react_jsx_runtime0.JSX.Element;
|
|
60
60
|
/**
|
|
61
61
|
* CommandAlertDialogFooter
|
|
62
62
|
*/
|
|
63
63
|
declare function CommandAlertDialogFooter({
|
|
64
64
|
children,
|
|
65
65
|
...props
|
|
66
|
-
}: React.HTMLAttributes<HTMLElement>):
|
|
66
|
+
}: React.HTMLAttributes<HTMLElement>): react_jsx_runtime0.JSX.Element;
|
|
67
67
|
/**
|
|
68
68
|
* CommandAlertDialogCancel
|
|
69
69
|
*/
|
|
70
70
|
declare function CommandAlertDialogCancel({
|
|
71
71
|
children,
|
|
72
72
|
...props
|
|
73
|
-
}: AlertDialogCancelProps):
|
|
73
|
+
}: AlertDialogCancelProps): react_jsx_runtime0.JSX.Element;
|
|
74
74
|
/**
|
|
75
75
|
* CommandAlertDialogAction
|
|
76
76
|
*/
|
|
@@ -87,7 +87,7 @@ declare function CommandAlertDialogAction<TData = unknown, TError = DefaultError
|
|
|
87
87
|
children,
|
|
88
88
|
disabled,
|
|
89
89
|
...props
|
|
90
|
-
}: CommandAlertDialogActionProps<TData, TError, TVariables, TOnMutateResult>):
|
|
90
|
+
}: CommandAlertDialogActionProps<TData, TError, TVariables, TOnMutateResult>): react_jsx_runtime0.JSX.Element;
|
|
91
91
|
//#endregion
|
|
92
92
|
export { CommandAlertDialog, CommandAlertDialogAction, CommandAlertDialogCancel, CommandAlertDialogContent, CommandAlertDialogDescription, CommandAlertDialogFooter, CommandAlertDialogHeader, CommandAlertDialogTitle, CommandAlertDialogTrigger };
|
|
93
93
|
//# sourceMappingURL=alert-dialog-command.client.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alert-dialog-command.client.d.mts","names":[],"sources":["../../../../src/modules/commands/components/alert-dialog-command.client.tsx"],"sourcesContent":[],"mappings":";;;;;;;;;;AA2CgB,iBAAA,kBAAA,CAAkB;EAAA,QAAA;EAAA,GAAA;AAAA,CAAA,EAAyB,gBAAzB,CAAA,EAAyC,
|
|
1
|
+
{"version":3,"file":"alert-dialog-command.client.d.mts","names":[],"sources":["../../../../src/modules/commands/components/alert-dialog-command.client.tsx"],"sourcesContent":[],"mappings":";;;;;;;;;;AA2CgB,iBAAA,kBAAA,CAAkB;EAAA,QAAA;EAAA,GAAA;AAAA,CAAA,EAAyB,gBAAzB,CAAA,EAAyC,kBAAA,CAAA,GAAA,CAAA,OAAzC;;;;KAe7B,8BAAA,GAfsE;EAetE,QAAA,EACO,KAAA,CAAM,SADb;EAQW,SAAA,CAAA,EAAA,MAAA;EACd,KAAA,CAAA,EAAA,MAAA;EACA,MAAA,CAAA,EANS,IAMT;EACA,QAAA,CAAA,EAAA,OAAA;CACA;AAEC,iBANa,yBAAA,CAMb;EAAA,KAAA;EAAA,MAAA;EAAA,QAAA;EAAA,QAAA;EAAA,GAAA;AAAA,CAAA,EAAA,8BAAA,CAAA,EAA8B,kBAAA,CAAA,GAAA,CAAA,OAAA,GAA9B,SAAA;;;AAgEH;AAA4C,iBAA5B,yBAAA,CAA4B;EAAA,QAAA;EAAA,GAAA;AAAA,CAAA,EAAsB,uBAAtB,CAAA,EAA6C,kBAAA,CAAA,GAAA,CAAA,OAA7C;;;;AAO5B,iBAAA,wBAAA,CAAwB;EAAA,QAAA;EAAA,GAAA;AAAA,CAAA,EAGrC,KAAA,CAAM,cAH+B,CAGhB,WAHgB,CAAA,CAAA,EAGJ,kBAAA,CAAA,GAAA,CAAA,OAHI;;;;AAGJ,iBAOpB,uBAAA,CAPoB;EAAA,QAAA;EAAA,GAAA;AAAA,CAAA,EAO4B,KAAA,CAAM,cAPlC,CAOiD,WAPjD,CAAA,CAAA,EAO6D,kBAAA,CAAA,GAAA,CAAA,OAP7D;;AAOpC;;AAAqF,iBAOrE,6BAAA,CAPqE;EAAA,QAAA;EAAA,GAAA;AAAA,CAAA,EAUlF,KAAA,CAAM,cAV4E,CAU7D,WAV6D,CAAA,CAAA,EAUjD,kBAAA,CAAA,GAAA,CAAA,OAViD;;;;AAOrE,iBAUA,wBAAA,CAV6B;EAAA,QAAA;EAAA,GAAA;AAAA,CAAA,EAa1C,KAAA,CAAM,cAboC,CAarB,WAbqB,CAAA,CAAA,EAaT,kBAAA,CAAA,GAAA,CAAA,OAbS;;;;AAGT,iBAiBpB,wBAAA,CAjBoB;EAAA,QAAA;EAAA,GAAA;AAAA,CAAA,EAiB6B,sBAjB7B,CAAA,EAiBmD,kBAAA,CAAA,GAAA,CAAA,OAjBnD;;AAOpC;;KAiBK,6BAdmB,CAAA,QAAA,OAAA,EAAA,SAgBb,YAhBa,EAAA,aAAA,SAAA,EAAA,kBAAA,OAAA,CAAA,GAAA;EAArB,SAAM,EAoBI,UApBJ;EAA2B,QAAA,EAqBxB,eArBwB,CAqBR,KArBQ,EAqBD,MArBC,EAqBO,UArBP,EAqBmB,eArBnB,CAAA;EAAA,QAAA,EAsBxB,KAAA,CAAM,SAtBkB;EAOpB,SAAA,CAAA,EAAA,MAAA;EAA2B,QAAA,CAAA,EAAA,OAAA;CAAsB;AAAsB,iBAoBvE,wBApBuE,CAAA,QAAA,OAAA,EAAA,SAsB5E,YAtB4E,EAAA,aAAA,SAAA,EAAA,kBAAA,OAAA,CAAA,CAAA;EAAA,SAAA;EAAA,QAAA;EAAA,QAAA;EAAA,QAAA;EAAA,GAAA;AAAA,CAAA,EA+BpF,6BA/BoF,CA+BtD,KA/BsD,EA+B/C,MA/B+C,EA+BvC,UA/BuC,EA+B3B,eA/B2B,CAAA,CAAA,EA+BX,kBAAA,CAAA,GAAA,CAAA,OA/BW"}
|
|
@@ -7,7 +7,7 @@ import { ContextMenuItem } from "../../../components/ui/context-menu.mjs";
|
|
|
7
7
|
import { DropdownMenuItem } from "../../../components/ui/dropdown-menu.mjs";
|
|
8
8
|
import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger } from "../../../components/ui/alert-dialog.mjs";
|
|
9
9
|
import { useCommand } from "../hooks/context.client.mjs";
|
|
10
|
-
import {
|
|
10
|
+
import { useCommandMutation } from "../hooks/use-command-mutation.client.mjs";
|
|
11
11
|
import { CommandTrigger } from "./command-trigger.client.mjs";
|
|
12
12
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
13
13
|
import React from "react";
|
|
@@ -138,7 +138,7 @@ function CommandAlertDialogCancel({ children, ...props }) {
|
|
|
138
138
|
function CommandAlertDialogAction({ variables, mutation, children, disabled, ...props }) {
|
|
139
139
|
const { setOpen } = React.useContext(CommandAlertDialogContext);
|
|
140
140
|
const { status } = useCommand();
|
|
141
|
-
const { mutateAsync } =
|
|
141
|
+
const { mutateAsync } = useCommandMutation({
|
|
142
142
|
...mutation,
|
|
143
143
|
onSuccess: async (...params) => {
|
|
144
144
|
setOpen(false);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alert-dialog-command.client.mjs","names":[],"sources":["../../../../src/modules/commands/components/alert-dialog-command.client.tsx"],"sourcesContent":["\"use client\";\n\nimport { Icons } from \"@/components/common/icons\";\nimport {\n AlertDialog,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogContent,\n AlertDialogDescription,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogTitle,\n AlertDialogTrigger,\n} from \"@/components/ui/alert-dialog\";\nimport { buttonVariants } from \"@/components/ui/button\";\nimport { ContextMenuItem } from \"@/components/ui/context-menu\";\nimport { DropdownMenuItem } from \"@/components/ui/dropdown-menu\";\nimport { cn } from \"@/lib/utils/cn\";\nimport {\n AlertDialogCancelProps,\n AlertDialogContentProps,\n AlertDialogProps,\n} from \"@radix-ui/react-alert-dialog\";\nimport { DefaultError, MutationOptions } from \"@tanstack/react-query\";\nimport React from \"react\";\nimport { Keys, useHotkeys } from \"react-hotkeys-hook\";\nimport { useCommand } from \"../hooks/context.client\";\nimport {
|
|
1
|
+
{"version":3,"file":"alert-dialog-command.client.mjs","names":[],"sources":["../../../../src/modules/commands/components/alert-dialog-command.client.tsx"],"sourcesContent":["\"use client\";\n\nimport { Icons } from \"@/components/common/icons\";\nimport {\n AlertDialog,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogContent,\n AlertDialogDescription,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogTitle,\n AlertDialogTrigger,\n} from \"@/components/ui/alert-dialog\";\nimport { buttonVariants } from \"@/components/ui/button\";\nimport { ContextMenuItem } from \"@/components/ui/context-menu\";\nimport { DropdownMenuItem } from \"@/components/ui/dropdown-menu\";\nimport { cn } from \"@/lib/utils/cn\";\nimport {\n AlertDialogCancelProps,\n AlertDialogContentProps,\n AlertDialogProps,\n} from \"@radix-ui/react-alert-dialog\";\nimport { DefaultError, MutationOptions } from \"@tanstack/react-query\";\nimport React from \"react\";\nimport { Keys, useHotkeys } from \"react-hotkeys-hook\";\nimport { useCommand } from \"../hooks/context.client\";\nimport { useCommandMutation } from \"../hooks/use-command-mutation.client\";\nimport { CommandTrigger } from \"./command-trigger.client\";\n\n/**\n * CommandAlertDialogContext\n */\ntype CommandAlertDialogContextValue = {\n open: boolean;\n setOpen: React.Dispatch<React.SetStateAction<boolean>>;\n};\n\nconst CommandAlertDialogContext = React.createContext({} as CommandAlertDialogContextValue);\n\n/**\n * CommandAlertDialog\n */\nexport function CommandAlertDialog({ children, ...props }: AlertDialogProps) {\n const [open, setOpen] = React.useState(false);\n\n return (\n <AlertDialog {...props} open={open} onOpenChange={setOpen}>\n <CommandAlertDialogContext.Provider value={{ open, setOpen }}>\n {children}\n </CommandAlertDialogContext.Provider>\n </AlertDialog>\n );\n}\n\n/**\n * CommandAlertDialogTrigger\n */\ntype CommandAlertDialogTriggerProps = {\n children: React.ReactNode;\n className?: string;\n label?: string;\n hotkey?: Keys;\n disabled?: boolean;\n};\n\nexport function CommandAlertDialogTrigger({\n label,\n hotkey,\n children,\n disabled,\n ...props\n}: CommandAlertDialogTriggerProps) {\n const { menu, status } = useCommand();\n const { setOpen } = React.useContext(CommandAlertDialogContext);\n\n const isDisabled = disabled || status === \"pending\";\n\n useHotkeys(hotkey ?? \"\", () => setOpen(true), { enabled: !isDisabled && hotkey !== undefined });\n\n if (menu === \"inline\" || menu === \"table\") {\n return (\n <CommandTrigger label={label}>\n <AlertDialogTrigger\n {...props}\n disabled={isDisabled}\n className={cn(buttonVariants({ variant: \"outline\", size: \"sm\" }), props.className)}\n >\n {children}\n </AlertDialogTrigger>\n </CommandTrigger>\n );\n }\n\n if (menu === \"dropdown\") {\n return (\n <CommandTrigger label={label}>\n <AlertDialogTrigger asChild>\n <DropdownMenuItem\n {...props}\n disabled={isDisabled}\n onClick={(e) => {\n e.preventDefault();\n setOpen(true);\n }}\n >\n {children}\n </DropdownMenuItem>\n </AlertDialogTrigger>\n </CommandTrigger>\n );\n }\n\n if (menu === \"context\") {\n return (\n <CommandTrigger label={label}>\n <AlertDialogTrigger asChild>\n <ContextMenuItem\n {...props}\n disabled={isDisabled}\n onClick={(e) => {\n e.preventDefault();\n setOpen(true);\n }}\n >\n {children}\n </ContextMenuItem>\n </AlertDialogTrigger>\n </CommandTrigger>\n );\n }\n}\n\n/**\n * CommandAlertDialogContent\n */\nexport function CommandAlertDialogContent({ children, ...props }: AlertDialogContentProps) {\n return <AlertDialogContent {...props}>{children}</AlertDialogContent>;\n}\n\n/**\n * CommandAlertDialogHeader\n */\nexport function CommandAlertDialogHeader({\n children,\n ...props\n}: React.HTMLAttributes<HTMLElement>) {\n return <AlertDialogHeader {...props}>{children}</AlertDialogHeader>;\n}\n\n/**\n * CommandAlertDialogTitle\n */\nexport function CommandAlertDialogTitle({ children, ...props }: React.HTMLAttributes<HTMLElement>) {\n return <AlertDialogTitle {...props}>{children}</AlertDialogTitle>;\n}\n\n/**\n * CommandAlertDialogDescription\n */\nexport function CommandAlertDialogDescription({\n children,\n ...props\n}: React.HTMLAttributes<HTMLElement>) {\n return <AlertDialogDescription {...props}>{children}</AlertDialogDescription>;\n}\n\n/**\n * CommandAlertDialogFooter\n */\nexport function CommandAlertDialogFooter({\n children,\n ...props\n}: React.HTMLAttributes<HTMLElement>) {\n return <AlertDialogFooter {...props}>{children}</AlertDialogFooter>;\n}\n\n/**\n * CommandAlertDialogCancel\n */\nexport function CommandAlertDialogCancel({ children, ...props }: AlertDialogCancelProps) {\n return <AlertDialogCancel {...props}>{children}</AlertDialogCancel>;\n}\n\n/**\n * CommandAlertDialogAction\n */\ntype CommandAlertDialogActionProps<\n TData = unknown,\n TError = DefaultError,\n TVariables = undefined,\n TOnMutateResult = unknown,\n> = {\n variables: TVariables;\n mutation: MutationOptions<TData, TError, TVariables, TOnMutateResult>;\n children: React.ReactNode;\n className?: string;\n disabled?: boolean;\n};\n\nexport function CommandAlertDialogAction<\n TData = unknown,\n TError = DefaultError,\n TVariables = undefined,\n TOnMutateResult = unknown,\n>({\n variables,\n mutation,\n children,\n disabled,\n ...props\n}: CommandAlertDialogActionProps<TData, TError, TVariables, TOnMutateResult>) {\n const { setOpen } = React.useContext(CommandAlertDialogContext);\n const { status } = useCommand();\n\n const { mutateAsync } = useCommandMutation({\n ...mutation,\n onSuccess: async (...params) => {\n setOpen(false);\n\n return await mutation?.onSuccess?.(...params);\n },\n });\n\n const isDisabled = disabled || status === \"pending\";\n\n return (\n <AlertDialogAction {...props} disabled={isDisabled} onClick={() => mutateAsync(variables)}>\n {status === \"pending\" && <Icons.spinner className=\"mr-2 h-4 w-4 animate-spin\" />}\n {children}\n </AlertDialogAction>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAsCA,MAAM,4BAA4B,MAAM,cAAc,EAAE,CAAmC;;;;AAK3F,SAAgB,mBAAmB,EAAE,UAAU,GAAG,SAA2B;CAC3E,MAAM,CAAC,MAAM,WAAW,MAAM,SAAS,MAAM;AAE7C,QACE,oBAAC;EAAY,GAAI;EAAa;EAAM,cAAc;YAChD,oBAAC,0BAA0B;GAAS,OAAO;IAAE;IAAM;IAAS;GACzD;IACkC;GACzB;;AAelB,SAAgB,0BAA0B,EACxC,OACA,QACA,UACA,UACA,GAAG,SAC8B;CACjC,MAAM,EAAE,MAAM,WAAW,YAAY;CACrC,MAAM,EAAE,YAAY,MAAM,WAAW,0BAA0B;CAE/D,MAAM,aAAa,YAAY,WAAW;AAE1C,YAAW,UAAU,UAAU,QAAQ,KAAK,EAAE,EAAE,SAAS,CAAC,cAAc,WAAW,QAAW,CAAC;AAE/F,KAAI,SAAS,YAAY,SAAS,QAChC,QACE,oBAAC;EAAsB;YACrB,oBAAC;GACC,GAAI;GACJ,UAAU;GACV,WAAW,GAAG,eAAe;IAAE,SAAS;IAAW,MAAM;IAAM,CAAC,EAAE,MAAM,UAAU;GAEjF;IACkB;GACN;AAIrB,KAAI,SAAS,WACX,QACE,oBAAC;EAAsB;YACrB,oBAAC;GAAmB;aAClB,oBAAC;IACC,GAAI;IACJ,UAAU;IACV,UAAU,MAAM;AACd,OAAE,gBAAgB;AAClB,aAAQ,KAAK;;IAGd;KACgB;IACA;GACN;AAIrB,KAAI,SAAS,UACX,QACE,oBAAC;EAAsB;YACrB,oBAAC;GAAmB;aAClB,oBAAC;IACC,GAAI;IACJ,UAAU;IACV,UAAU,MAAM;AACd,OAAE,gBAAgB;AAClB,aAAQ,KAAK;;IAGd;KACe;IACC;GACN;;;;;AAQvB,SAAgB,0BAA0B,EAAE,UAAU,GAAG,SAAkC;AACzF,QAAO,oBAAC;EAAmB,GAAI;EAAQ;GAA8B;;;;;AAMvE,SAAgB,yBAAyB,EACvC,UACA,GAAG,SACiC;AACpC,QAAO,oBAAC;EAAkB,GAAI;EAAQ;GAA6B;;;;;AAMrE,SAAgB,wBAAwB,EAAE,UAAU,GAAG,SAA4C;AACjG,QAAO,oBAAC;EAAiB,GAAI;EAAQ;GAA4B;;;;;AAMnE,SAAgB,8BAA8B,EAC5C,UACA,GAAG,SACiC;AACpC,QAAO,oBAAC;EAAuB,GAAI;EAAQ;GAAkC;;;;;AAM/E,SAAgB,yBAAyB,EACvC,UACA,GAAG,SACiC;AACpC,QAAO,oBAAC;EAAkB,GAAI;EAAQ;GAA6B;;;;;AAMrE,SAAgB,yBAAyB,EAAE,UAAU,GAAG,SAAiC;AACvF,QAAO,oBAAC;EAAkB,GAAI;EAAQ;GAA6B;;AAmBrE,SAAgB,yBAKd,EACA,WACA,UACA,UACA,UACA,GAAG,SACyE;CAC5E,MAAM,EAAE,YAAY,MAAM,WAAW,0BAA0B;CAC/D,MAAM,EAAE,WAAW,YAAY;CAE/B,MAAM,EAAE,gBAAgB,mBAAmB;EACzC,GAAG;EACH,WAAW,OAAO,GAAG,WAAW;AAC9B,WAAQ,MAAM;AAEd,UAAO,MAAM,UAAU,YAAY,GAAG,OAAO;;EAEhD,CAAC;CAEF,MAAM,aAAa,YAAY,WAAW;AAE1C,QACE,qBAAC;EAAkB,GAAI;EAAO,UAAU;EAAY,eAAe,YAAY,UAAU;aACtF,WAAW,aAAa,oBAAC,MAAM,WAAQ,WAAU,8BAA8B,EAC/E;GACiB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime8 from "react/jsx-runtime";
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { DefaultError, MutationOptions } from "@tanstack/react-query";
|
|
4
4
|
import { Keys } from "react-hotkeys-hook";
|
|
@@ -21,7 +21,7 @@ declare function CommandClick<TData = unknown, TError = DefaultError, TVariables
|
|
|
21
21
|
hotkey,
|
|
22
22
|
disabled,
|
|
23
23
|
...props
|
|
24
|
-
}: CommandClickProps<TData, TError, TVariables, TOnMutateResult>):
|
|
24
|
+
}: CommandClickProps<TData, TError, TVariables, TOnMutateResult>): react_jsx_runtime8.JSX.Element | null;
|
|
25
25
|
//#endregion
|
|
26
26
|
export { CommandClick, CommandClickProps };
|
|
27
27
|
//# sourceMappingURL=click-command.client.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"click-command.client.d.mts","names":[],"sources":["../../../../src/modules/commands/components/click-command.client.tsx"],"sourcesContent":[],"mappings":";;;;;;KAYY,4CAED;YAIC,KAAA,CAAM;;EANN,QAAA,CAAA,EAAA,OAAA;EAED,SAAA,EAOE,UAPF;EAIC,QAAM,EAIN,eAJM,CAIU,KAJV,EAIiB,MAJjB,EAIyB,UAJzB,EAIqC,eAJrC,CAAA;EAGL,KAAA,CAAA,EAAA,MAAA;EACe,MAAA,CAAA,EAEjB,IAFiB;CAAO;AAAQ,iBAK3B,YAL2B,CAAA,QAAA,OAAA,EAAA,SAOhC,YAPgC,EAAA,aAAA,SAAA,EAAA,kBAAA,OAAA,CAAA,CAAA;EAAA,QAAA;EAAA,SAAA;EAAA,QAAA;EAAA,KAAA;EAAA,MAAA;EAAA,QAAA;EAAA,GAAA;AAAA,CAAA,EAkBxC,iBAlBwC,CAkBtB,KAlBsB,EAkBf,MAlBe,EAkBP,UAlBO,EAkBK,eAlBL,CAAA,CAAA,EAkBqB,
|
|
1
|
+
{"version":3,"file":"click-command.client.d.mts","names":[],"sources":["../../../../src/modules/commands/components/click-command.client.tsx"],"sourcesContent":[],"mappings":";;;;;;KAYY,4CAED;YAIC,KAAA,CAAM;;EANN,QAAA,CAAA,EAAA,OAAA;EAED,SAAA,EAOE,UAPF;EAIC,QAAM,EAIN,eAJM,CAIU,KAJV,EAIiB,MAJjB,EAIyB,UAJzB,EAIqC,eAJrC,CAAA;EAGL,KAAA,CAAA,EAAA,MAAA;EACe,MAAA,CAAA,EAEjB,IAFiB;CAAO;AAAQ,iBAK3B,YAL2B,CAAA,QAAA,OAAA,EAAA,SAOhC,YAPgC,EAAA,aAAA,SAAA,EAAA,kBAAA,OAAA,CAAA,CAAA;EAAA,QAAA;EAAA,SAAA;EAAA,QAAA;EAAA,KAAA;EAAA,MAAA;EAAA,QAAA;EAAA,GAAA;AAAA,CAAA,EAkBxC,iBAlBwC,CAkBtB,KAlBsB,EAkBf,MAlBe,EAkBP,UAlBO,EAkBK,eAlBL,CAAA,CAAA,EAkBqB,kBAAA,CAAA,GAAA,CAAA,OAAA,GAlBrB,IAAA"}
|
|
@@ -4,7 +4,7 @@ import { Button } from "../../../components/ui/button.mjs";
|
|
|
4
4
|
import { ContextMenuItem } from "../../../components/ui/context-menu.mjs";
|
|
5
5
|
import { DropdownMenuItem } from "../../../components/ui/dropdown-menu.mjs";
|
|
6
6
|
import { useCommand } from "../hooks/context.client.mjs";
|
|
7
|
-
import {
|
|
7
|
+
import { useCommandMutation } from "../hooks/use-command-mutation.client.mjs";
|
|
8
8
|
import { CommandTrigger } from "./command-trigger.client.mjs";
|
|
9
9
|
import { jsx } from "react/jsx-runtime";
|
|
10
10
|
import React from "react";
|
|
@@ -13,7 +13,7 @@ import { useHotkeys } from "react-hotkeys-hook";
|
|
|
13
13
|
//#region src/modules/commands/components/click-command.client.tsx
|
|
14
14
|
function CommandClick({ children, variables, mutation, label, hotkey, disabled, ...props }) {
|
|
15
15
|
const { menu, status } = useCommand();
|
|
16
|
-
const { mutate } =
|
|
16
|
+
const { mutate } = useCommandMutation(mutation);
|
|
17
17
|
const isDisabled = disabled || status === "pending";
|
|
18
18
|
const handleClick = () => mutate(variables);
|
|
19
19
|
useHotkeys(hotkey ?? "", () => handleClick(), { enabled: !isDisabled && hotkey !== void 0 });
|