@tulip-systems/core 0.5.2 → 0.5.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auth/client.d.mts +3 -3
- package/dist/auth/client.mjs +2 -2
- package/dist/components/client.d.mts +2 -2
- package/dist/components/common/icons.d.mts +2 -2
- package/dist/components/common/icons.d.mts.map +1 -1
- package/dist/components/common/status.d.mts +3 -3
- package/dist/components/common/status.d.mts.map +1 -1
- package/dist/components/editor/components/content.client.d.mts +2 -2
- package/dist/components/editor/components/content.client.d.mts.map +1 -1
- package/dist/components/editor/components/editor.client.d.mts +6 -6
- package/dist/components/editor/components/editor.client.d.mts.map +1 -1
- package/dist/components/editor/components/editor.client.mjs +2 -2
- package/dist/components/editor/components/editor.client.mjs.map +1 -1
- package/dist/components/editor/components/menu.client.d.mts +3 -3
- package/dist/components/editor/components/menu.client.d.mts.map +1 -1
- package/dist/components/editor/components/menu.client.mjs +3 -0
- package/dist/components/editor/components/menu.client.mjs.map +1 -1
- package/dist/components/editor/extensions/file-handler/extension.d.mts +21 -0
- package/dist/components/editor/extensions/file-handler/extension.d.mts.map +1 -0
- package/dist/components/editor/extensions/file-handler/extension.mjs +40 -0
- package/dist/components/editor/extensions/file-handler/extension.mjs.map +1 -0
- package/dist/components/editor/extensions/file-handler/strategy.d.mts +29 -0
- package/dist/components/editor/extensions/file-handler/strategy.d.mts.map +1 -0
- package/dist/components/editor/extensions/file-handler/strategy.mjs +111 -0
- package/dist/components/editor/extensions/file-handler/strategy.mjs.map +1 -0
- package/dist/components/editor/extensions/file-handler/utils.mjs +50 -0
- package/dist/components/editor/extensions/file-handler/utils.mjs.map +1 -0
- package/dist/components/editor/extensions/image/extension.d.mts +8 -0
- package/dist/components/editor/extensions/image/extension.d.mts.map +1 -0
- package/dist/components/editor/extensions/image/extension.mjs +51 -0
- package/dist/components/editor/extensions/image/extension.mjs.map +1 -0
- package/dist/components/editor/extensions/skeleton/extension.mjs +41 -0
- package/dist/components/editor/extensions/skeleton/extension.mjs.map +1 -0
- package/dist/components/editor/extensions/skeleton/renderer.mjs +25 -0
- package/dist/components/editor/extensions/skeleton/renderer.mjs.map +1 -0
- package/dist/components/editor/lib/constants.d.mts +31 -28
- package/dist/components/editor/lib/constants.d.mts.map +1 -1
- package/dist/components/editor/lib/constants.mjs +17 -5
- package/dist/components/editor/lib/constants.mjs.map +1 -1
- package/dist/components/editor/lib/extensions.d.mts +7 -3
- package/dist/components/editor/lib/extensions.d.mts.map +1 -1
- package/dist/components/editor/lib/extensions.mjs.map +1 -1
- package/dist/components/editor/lib/helpers.d.mts.map +1 -1
- package/dist/components/editor/lib/helpers.mjs +38 -3
- package/dist/components/editor/lib/helpers.mjs.map +1 -1
- package/dist/components/editor/lib/variants.mjs +10 -2
- package/dist/components/editor/lib/variants.mjs.map +1 -1
- package/dist/components/header/back-button.client.d.mts +2 -2
- package/dist/components/header/back-button.client.d.mts.map +1 -1
- package/dist/components/header/bottom-bar.client.d.mts +3 -3
- package/dist/components/header/bottom-bar.client.d.mts.map +1 -1
- package/dist/components/header/breadcrumbs.client.d.mts +7 -7
- package/dist/components/header/breadcrumbs.client.d.mts.map +1 -1
- package/dist/components/header/header.client.d.mts +2 -2
- package/dist/components/header/header.client.d.mts.map +1 -1
- package/dist/components/header/mobile-nav-switcher.client.d.mts +2 -2
- package/dist/components/header/mobile-nav-switcher.client.d.mts.map +1 -1
- package/dist/components/header/top-bar.client.d.mts +4 -4
- package/dist/components/header/top-bar.client.d.mts.map +1 -1
- package/dist/components/layouts/admin-content.client.d.mts +2 -2
- package/dist/components/layouts/admin-content.client.d.mts.map +1 -1
- package/dist/components/layouts/admin-layout.d.mts +2 -2
- package/dist/components/layouts/admin-layout.d.mts.map +1 -1
- package/dist/components/layouts/admin-loading.d.mts +2 -2
- package/dist/components/layouts/admin-loading.d.mts.map +1 -1
- package/dist/components/layouts/empty-page.d.mts +4 -4
- package/dist/components/layouts/empty-page.d.mts.map +1 -1
- package/dist/components/layouts/error-page.d.mts +23 -0
- package/dist/components/layouts/error-page.d.mts.map +1 -0
- package/dist/components/layouts/error-page.mjs +58 -0
- package/dist/components/layouts/error-page.mjs.map +1 -0
- package/dist/components/layouts/list-layout.d.mts +2 -2
- package/dist/components/layouts/list-layout.d.mts.map +1 -1
- package/dist/components/layouts/not-allowed-page.d.mts +22 -0
- package/dist/components/layouts/not-allowed-page.d.mts.map +1 -0
- package/dist/components/layouts/not-allowed-page.mjs +25 -0
- package/dist/components/layouts/not-allowed-page.mjs.map +1 -0
- package/dist/components/layouts/not-found-page.d.mts +3 -3
- package/dist/components/layouts/not-found-page.d.mts.map +1 -1
- package/dist/components/layouts/providers.client.d.mts +2 -2
- package/dist/components/layouts/providers.client.d.mts.map +1 -1
- package/dist/components/layouts/root-layout.server.d.mts +2 -2
- package/dist/components/layouts/root-layout.server.d.mts.map +1 -1
- package/dist/components/layouts/root-loading.d.mts +2 -2
- package/dist/components/layouts/root-loading.d.mts.map +1 -1
- package/dist/components/layouts/tab-layout.d.mts +2 -2
- package/dist/components/layouts/tab-layout.d.mts.map +1 -1
- package/dist/components/lists/data-list.d.mts +5 -5
- package/dist/components/lists/data-list.d.mts.map +1 -1
- package/dist/components/lists/data-stack.d.mts +8 -8
- package/dist/components/lists/data-stack.d.mts.map +1 -1
- package/dist/components/navigation/admin-sidebar-paths.client.d.mts +21 -11
- package/dist/components/navigation/admin-sidebar-paths.client.d.mts.map +1 -1
- package/dist/components/navigation/admin-sidebar-paths.client.mjs +7 -5
- package/dist/components/navigation/admin-sidebar-paths.client.mjs.map +1 -1
- package/dist/components/ui/accordion.d.mts +5 -5
- package/dist/components/ui/accordion.d.mts.map +1 -1
- package/dist/components/ui/alert-dialog.d.mts +12 -12
- package/dist/components/ui/alert-dialog.d.mts.map +1 -1
- package/dist/components/ui/alert.d.mts +6 -6
- package/dist/components/ui/alert.d.mts.map +1 -1
- package/dist/components/ui/aspect-ratio.d.mts +2 -2
- package/dist/components/ui/aspect-ratio.d.mts.map +1 -1
- package/dist/components/ui/avatar.client.d.mts +4 -4
- package/dist/components/ui/avatar.client.d.mts.map +1 -1
- package/dist/components/ui/badge.d.mts +4 -4
- package/dist/components/ui/badge.d.mts.map +1 -1
- package/dist/components/ui/breadcrumb.d.mts +8 -8
- package/dist/components/ui/breadcrumb.d.mts.map +1 -1
- package/dist/components/ui/button.d.mts +5 -5
- package/dist/components/ui/button.d.mts.map +1 -1
- package/dist/components/ui/calendar.d.mts +3 -3
- package/dist/components/ui/calendar.d.mts.map +1 -1
- package/dist/components/ui/card.d.mts +7 -7
- package/dist/components/ui/card.d.mts.map +1 -1
- package/dist/components/ui/carousel.d.mts +6 -6
- package/dist/components/ui/carousel.d.mts.map +1 -1
- package/dist/components/ui/chart.client.d.mts +5 -5
- package/dist/components/ui/chart.client.d.mts.map +1 -1
- package/dist/components/ui/checkbox.d.mts +2 -2
- package/dist/components/ui/checkbox.d.mts.map +1 -1
- package/dist/components/ui/collapsible.client.d.mts +4 -4
- package/dist/components/ui/collapsible.client.d.mts.map +1 -1
- package/dist/components/ui/color-picker.client.d.mts +2 -2
- package/dist/components/ui/color-picker.client.d.mts.map +1 -1
- package/dist/components/ui/combobox-dropdown.client.d.mts +2 -2
- package/dist/components/ui/combobox-dropdown.client.d.mts.map +1 -1
- package/dist/components/ui/combobox.client.d.mts +2 -2
- package/dist/components/ui/combobox.client.d.mts.map +1 -1
- package/dist/components/ui/command.d.mts +10 -10
- package/dist/components/ui/command.d.mts.map +1 -1
- package/dist/components/ui/context-menu.d.mts +16 -16
- package/dist/components/ui/context-menu.d.mts.map +1 -1
- package/dist/components/ui/date-picker.client.d.mts +2 -2
- package/dist/components/ui/date-picker.client.d.mts.map +1 -1
- package/dist/components/ui/dialog.client.d.mts +11 -11
- package/dist/components/ui/dialog.client.d.mts.map +1 -1
- package/dist/components/ui/drawer.client.d.mts +11 -11
- package/dist/components/ui/drawer.client.d.mts.map +1 -1
- package/dist/components/ui/dropdown-menu.d.mts +16 -16
- package/dist/components/ui/form.client.d.mts +7 -7
- package/dist/components/ui/form.client.d.mts.map +1 -1
- package/dist/components/ui/hover-card.client.d.mts +4 -4
- package/dist/components/ui/hover-card.client.d.mts.map +1 -1
- package/dist/components/ui/input-recipient.d.mts +2 -2
- package/dist/components/ui/input.d.mts +2 -2
- package/dist/components/ui/label.d.mts +2 -2
- package/dist/components/ui/navigation-menu.d.mts +11 -11
- package/dist/components/ui/pagination.d.mts +8 -8
- package/dist/components/ui/popover.d.mts +5 -5
- package/dist/components/ui/progress.client.d.mts +2 -2
- package/dist/components/ui/progress.client.d.mts.map +1 -1
- package/dist/components/ui/radio-group.d.mts +3 -3
- package/dist/components/ui/resizable.client.d.mts +4 -4
- package/dist/components/ui/resizable.client.d.mts.map +1 -1
- package/dist/components/ui/scroll-area.d.mts +3 -3
- package/dist/components/ui/select.client.d.mts +11 -11
- package/dist/components/ui/select.client.d.mts.map +1 -1
- package/dist/components/ui/separator.d.mts +2 -2
- package/dist/components/ui/sheet.client.d.mts +9 -9
- package/dist/components/ui/sheet.client.d.mts.map +1 -1
- package/dist/components/ui/sidebar.client.d.mts +26 -26
- package/dist/components/ui/sidebar.client.d.mts.map +1 -1
- package/dist/components/ui/skeleton.d.mts +2 -2
- package/dist/components/ui/slider.d.mts +2 -2
- package/dist/components/ui/sonner.client.d.mts +2 -2
- package/dist/components/ui/switch.d.mts +2 -2
- package/dist/components/ui/tabs.d.mts +5 -5
- package/dist/components/ui/textarea.d.mts +2 -2
- package/dist/components/ui/time-input.client.d.mts +2 -2
- package/dist/components/ui/toggle-group.client.d.mts +3 -3
- package/dist/components/ui/toggle.d.mts +2 -2
- package/dist/components/ui/toggle.d.mts.map +1 -1
- package/dist/components/ui/tooltip.client.d.mts +5 -5
- package/dist/components/ui/tooltip.client.d.mts.map +1 -1
- package/dist/components/ui/tooltip.client.mjs +1 -1
- package/dist/components/ui/tooltip.client.mjs.map +1 -1
- package/dist/components.d.mts +4 -1
- package/dist/components.mjs +5 -2
- package/dist/data-tables.d.mts +2 -2
- package/dist/data-tables.mjs +2 -2
- package/dist/inline-edit/client.d.mts +2 -3
- package/dist/inline-edit/client.mjs +1 -2
- package/dist/lib/client.d.mts +2 -2
- package/dist/lib/client.mjs +2 -2
- package/dist/lib/hooks/use-action.d.mts +2 -2
- package/dist/lib/hooks/use-indicator.d.mts +11 -3
- package/dist/lib/hooks/use-indicator.d.mts.map +1 -1
- package/dist/lib/hooks/use-indicator.mjs +19 -8
- package/dist/lib/hooks/use-indicator.mjs.map +1 -1
- package/dist/modules/auth/components/allowed.client.d.mts +21 -7
- package/dist/modules/auth/components/allowed.client.d.mts.map +1 -1
- package/dist/modules/auth/components/allowed.client.mjs +8 -2
- package/dist/modules/auth/components/allowed.client.mjs.map +1 -1
- package/dist/modules/auth/components/auth-layout.server.d.mts +2 -2
- package/dist/modules/auth/components/auth-layout.server.d.mts.map +1 -1
- package/dist/modules/auth/components/auth-loading.d.mts +2 -2
- package/dist/modules/auth/components/auth-loading.d.mts.map +1 -1
- package/dist/modules/auth/components/create-first-user-page.client.d.mts +2 -2
- package/dist/modules/auth/components/create-first-user-page.client.d.mts.map +1 -1
- package/dist/modules/auth/components/forget-password-page.client.d.mts +2 -2
- package/dist/modules/auth/components/forget-password-page.client.d.mts.map +1 -1
- package/dist/modules/auth/components/guard-first-user.server.d.mts +2 -2
- package/dist/modules/auth/components/guard-first-user.server.d.mts.map +1 -1
- package/dist/modules/auth/components/guard.server.d.mts +2 -2
- package/dist/modules/auth/components/guard.server.d.mts.map +1 -1
- package/dist/modules/auth/components/login-page.client.d.mts +2 -2
- package/dist/modules/auth/components/login-page.client.d.mts.map +1 -1
- package/dist/modules/auth/components/reset-password-page.client.d.mts +2 -2
- package/dist/modules/auth/components/reset-password-page.client.d.mts.map +1 -1
- package/dist/modules/auth/components/update-password-command.d.mts +2 -2
- package/dist/modules/auth/components/update-password-command.d.mts.map +1 -1
- package/dist/modules/auth/db/schema.d.mts +73 -73
- package/dist/modules/auth/db/schema.d.mts.map +1 -1
- package/dist/modules/auth/handler/client.client.d.mts +143 -143
- package/dist/modules/auth/handler/client.client.d.mts.map +1 -1
- package/dist/modules/auth/handler/init.d.mts +131 -131
- package/dist/modules/auth/handler/init.d.mts.map +1 -1
- package/dist/modules/auth/hooks/use-permission.d.mts +48 -4
- package/dist/modules/auth/hooks/use-permission.d.mts.map +1 -1
- package/dist/modules/auth/hooks/use-permission.mjs +51 -4
- package/dist/modules/auth/hooks/use-permission.mjs.map +1 -1
- package/dist/modules/auth/lib/helpers.server.mjs +1 -1
- package/dist/modules/auth/lib/validators.d.mts +2 -2
- package/dist/modules/auth/lib/validators.d.mts.map +1 -1
- package/dist/modules/commands/components/alert-dialog-command.client.d.mts +10 -10
- package/dist/modules/commands/components/click-command.client.d.mts +2 -2
- package/dist/modules/commands/components/command-trigger.client.d.mts +6 -6
- package/dist/modules/commands/components/dialog-command.client.d.mts +8 -8
- package/dist/modules/commands/components/dropdown-command.client.d.mts +5 -5
- package/dist/modules/commands/components/empty-command.client.d.mts +2 -2
- package/dist/modules/commands/components/form-dialog-command.client.d.mts +11 -11
- package/dist/modules/commands/hooks/use-command-menu.client.d.mts.map +1 -1
- package/dist/modules/commands/hooks/use-command-menu.client.mjs +0 -5
- package/dist/modules/commands/hooks/use-command-menu.client.mjs.map +1 -1
- package/dist/modules/commands/hooks/use-command-mutation.client.d.mts +2 -2
- package/dist/modules/commands/menus/context-menu.client.d.mts +2 -2
- package/dist/modules/commands/menus/dropdown-menu.client.d.mts +3 -3
- package/dist/modules/commands/menus/inline-menu.client.d.mts +3 -3
- package/dist/modules/commands/menus/responsive-menu.client.d.mts +3 -3
- package/dist/modules/commands/utils/archive-command.client.d.mts +3 -3
- package/dist/modules/commands/utils/delete-command.client.d.mts +3 -3
- package/dist/modules/config/db/helpers.d.mts +5 -5
- package/dist/modules/config/db/helpers.d.mts.map +1 -1
- package/dist/modules/data-tables/components/cell/common.client.d.mts +5 -5
- package/dist/modules/data-tables/components/column-header.d.mts +2 -2
- package/dist/modules/data-tables/components/filters/combobox.client.d.mts +2 -2
- package/dist/modules/data-tables/components/filters/slider.client.d.mts +2 -2
- package/dist/modules/data-tables/components/header.d.mts +4 -4
- package/dist/modules/data-tables/components/layout.d.mts +2 -2
- package/dist/modules/data-tables/components/search-input.client.d.mts +2 -2
- package/dist/modules/data-tables/components/skeleton.d.mts +2 -2
- package/dist/modules/data-tables/components/table.d.mts +7 -7
- package/dist/modules/data-tables/components/toolbar.d.mts +3 -3
- package/dist/modules/data-tables/hooks/use-context.client.d.mts +2 -2
- package/dist/modules/data-tables/lib/filters/parsers.d.mts +6 -1
- package/dist/modules/data-tables/lib/filters/parsers.d.mts.map +1 -1
- package/dist/modules/data-tables/lib/filters/parsers.mjs +6 -1
- package/dist/modules/data-tables/lib/filters/parsers.mjs.map +1 -1
- package/dist/modules/data-tables/tables/data-table/components/table.d.mts +2 -2
- package/dist/modules/data-tables/tables/inline-table/components/cells/common.d.mts +2 -2
- package/dist/modules/data-tables/tables/inline-table/components/cells/drag-handle.client.d.mts +2 -2
- package/dist/modules/data-tables/tables/inline-table/components/inputs/advanced-select.client.d.mts +2 -2
- package/dist/modules/data-tables/tables/inline-table/components/inputs/combobox.client.d.mts +2 -2
- package/dist/modules/data-tables/tables/inline-table/components/inputs/input.client.d.mts +3 -3
- package/dist/modules/data-tables/tables/inline-table/components/inputs/read-only.d.mts +2 -2
- package/dist/modules/data-tables/tables/inline-table/components/inputs/select.client.d.mts +2 -2
- package/dist/modules/data-tables/tables/inline-table/components/table.d.mts +2 -2
- package/dist/modules/data-tables/tables/inline-table/hooks/context.client.d.mts +2 -2
- package/dist/modules/inline-edit/components/combobox-dropdown.client.d.mts +6 -4
- package/dist/modules/inline-edit/components/combobox-dropdown.client.d.mts.map +1 -1
- package/dist/modules/inline-edit/components/combobox-dropdown.client.mjs +11 -6
- package/dist/modules/inline-edit/components/combobox-dropdown.client.mjs.map +1 -1
- package/dist/modules/inline-edit/components/combobox.client.d.mts +6 -4
- package/dist/modules/inline-edit/components/combobox.client.d.mts.map +1 -1
- package/dist/modules/inline-edit/components/combobox.client.mjs +7 -5
- package/dist/modules/inline-edit/components/combobox.client.mjs.map +1 -1
- package/dist/modules/inline-edit/components/date-input.client.d.mts +5 -3
- package/dist/modules/inline-edit/components/date-input.client.d.mts.map +1 -1
- package/dist/modules/inline-edit/components/date-input.client.mjs +26 -13
- package/dist/modules/inline-edit/components/date-input.client.mjs.map +1 -1
- package/dist/modules/inline-edit/components/date-picker.client.d.mts +6 -4
- package/dist/modules/inline-edit/components/date-picker.client.d.mts.map +1 -1
- package/dist/modules/inline-edit/components/date-picker.client.mjs +12 -7
- package/dist/modules/inline-edit/components/date-picker.client.mjs.map +1 -1
- package/dist/modules/inline-edit/components/editor.client.d.mts +6 -4
- package/dist/modules/inline-edit/components/editor.client.d.mts.map +1 -1
- package/dist/modules/inline-edit/components/editor.client.mjs +11 -6
- package/dist/modules/inline-edit/components/editor.client.mjs.map +1 -1
- package/dist/modules/inline-edit/components/input-recipient.client.d.mts +6 -4
- package/dist/modules/inline-edit/components/input-recipient.client.d.mts.map +1 -1
- package/dist/modules/inline-edit/components/input-recipient.client.mjs +11 -6
- package/dist/modules/inline-edit/components/input-recipient.client.mjs.map +1 -1
- package/dist/modules/inline-edit/components/input-toggle.client.d.mts +6 -4
- package/dist/modules/inline-edit/components/input-toggle.client.d.mts.map +1 -1
- package/dist/modules/inline-edit/components/input-toggle.client.mjs +9 -7
- package/dist/modules/inline-edit/components/input-toggle.client.mjs.map +1 -1
- package/dist/modules/inline-edit/components/input.client.d.mts +13 -10
- package/dist/modules/inline-edit/components/input.client.d.mts.map +1 -1
- package/dist/modules/inline-edit/components/input.client.mjs +35 -19
- package/dist/modules/inline-edit/components/input.client.mjs.map +1 -1
- package/dist/modules/inline-edit/components/select.client.d.mts +10 -9
- package/dist/modules/inline-edit/components/select.client.d.mts.map +1 -1
- package/dist/modules/inline-edit/components/select.client.mjs +14 -7
- package/dist/modules/inline-edit/components/select.client.mjs.map +1 -1
- package/dist/modules/inline-edit/components/switch.client.d.mts +5 -3
- package/dist/modules/inline-edit/components/switch.client.d.mts.map +1 -1
- package/dist/modules/inline-edit/components/switch.client.mjs +8 -6
- package/dist/modules/inline-edit/components/switch.client.mjs.map +1 -1
- package/dist/modules/inline-edit/components/toggle.client.d.mts +6 -4
- package/dist/modules/inline-edit/components/toggle.client.d.mts.map +1 -1
- package/dist/modules/inline-edit/components/toggle.client.mjs +9 -7
- package/dist/modules/inline-edit/components/toggle.client.mjs.map +1 -1
- package/dist/modules/inline-edit/hooks/context.client.d.mts +2 -2
- package/dist/modules/inline-edit/hooks/use-inline.client.d.mts +35 -3
- package/dist/modules/inline-edit/hooks/use-inline.client.d.mts.map +1 -1
- package/dist/modules/inline-edit/hooks/use-inline.client.mjs +71 -9
- package/dist/modules/inline-edit/hooks/use-inline.client.mjs.map +1 -1
- package/dist/modules/inline-edit/lib/variants.d.mts +1 -0
- package/dist/modules/inline-edit/lib/variants.d.mts.map +1 -1
- package/dist/modules/inline-edit/lib/variants.mjs +12 -4
- package/dist/modules/inline-edit/lib/variants.mjs.map +1 -1
- package/dist/modules/router/handler/init.server.d.mts +4 -4
- package/dist/modules/router/handler/init.server.mjs +1 -1
- package/dist/modules/router/lib/query-client.server.d.mts +2 -2
- package/dist/modules/storage/components/dropzone-context.client.d.mts +2 -2
- package/dist/modules/storage/components/dropzone.client.d.mts +5 -5
- package/dist/modules/storage/components/image-grid.client.d.mts +3 -3
- package/dist/modules/storage/components/image-grid.client.mjs +2 -2
- package/dist/modules/storage/components/image-grid.client.mjs.map +1 -1
- package/dist/modules/storage/components/upload-zone-context.client.d.mts +3 -11
- package/dist/modules/storage/components/upload-zone-context.client.d.mts.map +1 -1
- package/dist/modules/storage/components/upload-zone-context.client.mjs.map +1 -1
- package/dist/modules/storage/components/upload-zone.client.d.mts +10 -33
- package/dist/modules/storage/components/upload-zone.client.d.mts.map +1 -1
- package/dist/modules/storage/components/upload-zone.client.mjs +19 -93
- package/dist/modules/storage/components/upload-zone.client.mjs.map +1 -1
- package/dist/modules/storage/config/filters.d.mts +1 -0
- package/dist/modules/storage/config/filters.d.mts.map +1 -1
- package/dist/modules/storage/config/filters.mjs +1 -0
- package/dist/modules/storage/config/filters.mjs.map +1 -1
- package/dist/modules/storage/lib/create-upload.client.d.mts +56 -0
- package/dist/modules/storage/lib/create-upload.client.d.mts.map +1 -0
- package/dist/modules/storage/lib/create-upload.client.mjs +98 -0
- package/dist/modules/storage/lib/create-upload.client.mjs.map +1 -0
- package/dist/modules/storage/lib/helpers.d.mts +1 -1
- package/dist/modules/storage/lib/router.server.d.mts +3239 -2319
- package/dist/modules/storage/lib/router.server.d.mts.map +1 -1
- package/dist/modules/storage/lib/router.server.mjs +5 -2
- package/dist/modules/storage/lib/router.server.mjs.map +1 -1
- package/dist/modules/storage/lib/schema.d.mts +124 -90
- package/dist/modules/storage/lib/schema.d.mts.map +1 -1
- package/dist/modules/storage/lib/schema.mjs +2 -1
- package/dist/modules/storage/lib/schema.mjs.map +1 -1
- package/dist/modules/storage/lib/service.server.d.mts +28 -39
- package/dist/modules/storage/lib/service.server.d.mts.map +1 -1
- package/dist/modules/storage/lib/service.server.mjs +6 -6
- package/dist/modules/storage/lib/service.server.mjs.map +1 -1
- package/dist/modules/storage/lib/validators.d.mts +166 -86
- package/dist/modules/storage/lib/validators.d.mts.map +1 -1
- package/dist/modules/storage/lib/validators.mjs +2 -1
- package/dist/modules/storage/lib/validators.mjs.map +1 -1
- package/dist/router/server.mjs +1 -1
- package/dist/storage/client.d.mts +2 -1
- package/dist/storage/client.mjs +2 -8
- package/dist/storage.d.mts +2 -2
- package/dist/storage.mjs +1 -1
- package/package.json +4 -3
- package/src/components/editor/components/editor.client.tsx +7 -2
- package/src/components/editor/components/menu.client.tsx +26 -0
- package/src/components/editor/extensions/file-handler/extension.ts +69 -0
- package/src/components/editor/extensions/file-handler/strategy.ts +167 -0
- package/src/components/editor/extensions/file-handler/utils.ts +51 -0
- package/src/components/editor/extensions/image/extension.ts +55 -0
- package/src/components/editor/extensions/skeleton/extension.ts +35 -0
- package/src/components/editor/extensions/skeleton/renderer.tsx +14 -0
- package/src/components/editor/lib/constants.ts +16 -2
- package/src/components/editor/lib/extensions.ts +4 -1
- package/src/components/editor/lib/helpers.ts +39 -3
- package/src/components/editor/lib/utils.ts +32 -0
- package/src/components/editor/lib/variants.ts +72 -1
- package/src/components/entry.ts +4 -1
- package/src/components/layouts/error-page.tsx +61 -0
- package/src/components/layouts/not-allowed-page.tsx +1 -1
- package/src/components/navigation/admin-sidebar-paths.client.tsx +18 -2
- package/src/components/ui/tooltip.client.tsx +1 -1
- package/src/lib/hooks/use-indicator.tsx +27 -18
- package/src/modules/auth/components/allowed.client.tsx +35 -7
- package/src/modules/auth/hooks/use-permission.ts +88 -2
- package/src/modules/commands/hooks/use-command-menu.client.tsx +4 -7
- package/src/modules/data-tables/lib/filters/parsers.ts +14 -0
- package/src/modules/inline-edit/components/combobox-dropdown.client.tsx +21 -12
- package/src/modules/inline-edit/components/combobox.client.tsx +13 -6
- package/src/modules/inline-edit/components/date-input.client.tsx +29 -13
- package/src/modules/inline-edit/components/date-picker.client.tsx +13 -9
- package/src/modules/inline-edit/components/editor.client.tsx +14 -14
- package/src/modules/inline-edit/components/input-recipient.client.tsx +15 -8
- package/src/modules/inline-edit/components/input-toggle.client.tsx +16 -9
- package/src/modules/inline-edit/components/input.client.tsx +38 -24
- package/src/modules/inline-edit/components/select.client.tsx +16 -9
- package/src/modules/inline-edit/components/switch.client.tsx +10 -6
- package/src/modules/inline-edit/components/toggle.client.tsx +13 -9
- package/src/modules/inline-edit/entry.client.ts +0 -1
- package/src/modules/inline-edit/hooks/use-inline.client.tsx +139 -20
- package/src/modules/inline-edit/lib/variants.ts +7 -0
- package/src/modules/storage/components/image-grid.client.tsx +2 -2
- package/src/modules/storage/components/upload-zone-context.client.tsx +3 -4
- package/src/modules/storage/components/upload-zone.client.tsx +17 -116
- package/src/modules/storage/config/filters.ts +1 -0
- package/src/modules/storage/entry.client.ts +2 -1
- package/src/modules/storage/lib/create-upload.client.ts +134 -0
- package/src/modules/storage/lib/router.server.ts +1 -0
- package/src/modules/storage/lib/schema.ts +1 -0
- package/src/modules/storage/lib/service.server.ts +10 -4
- package/src/modules/storage/lib/validators.ts +1 -0
- package/dist/modules/auth/lib/utils.mjs +0 -21
- package/dist/modules/auth/lib/utils.mjs.map +0 -1
- package/dist/modules/inline-edit/components/deprecated-editor.client.d.mts +0 -21
- package/dist/modules/inline-edit/components/deprecated-editor.client.d.mts.map +0 -1
- package/dist/modules/inline-edit/components/deprecated-editor.client.mjs +0 -37
- package/dist/modules/inline-edit/components/deprecated-editor.client.mjs.map +0 -1
- package/dist/storage/client.mjs.map +0 -1
- package/src/modules/inline-edit/components/deprecated-editor.client.tsx +0 -48
|
@@ -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,iBAY0D,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,cAAA,CAAA,iBANtD,EAAA,2BAAA,kCAAA;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,13 +1,57 @@
|
|
|
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
|
/**
|
|
6
6
|
* UsePermission
|
|
7
7
|
*/
|
|
8
|
-
|
|
8
|
+
type UsePermissionProps = {
|
|
9
|
+
/**
|
|
10
|
+
* Strategy to use when checking multiple permissions
|
|
11
|
+
* - "all": all permissions must be allowed
|
|
12
|
+
* - "any": at least one permission must be allowed
|
|
13
|
+
* @default "all"
|
|
14
|
+
*/
|
|
15
|
+
strategy?: "all";
|
|
16
|
+
/**
|
|
17
|
+
* Permission to check
|
|
18
|
+
* @example { project: ["view", "create"] }
|
|
19
|
+
*/
|
|
20
|
+
permission?: Permission;
|
|
21
|
+
} | {
|
|
22
|
+
/**
|
|
23
|
+
* Strategy to use when checking multiple permissions
|
|
24
|
+
* - "all": all permissions must be allowed
|
|
25
|
+
* - "any": at least one permission must be allowed
|
|
26
|
+
* @default "all"
|
|
27
|
+
*/
|
|
28
|
+
strategy?: "any";
|
|
29
|
+
/**
|
|
30
|
+
* Permission to check
|
|
31
|
+
* @example [{ project: ["view", "create"] }, { client: ["view"] }, { drive: ["view"] }]
|
|
32
|
+
*/
|
|
33
|
+
permission?: Permission[];
|
|
34
|
+
};
|
|
35
|
+
declare function usePermission({
|
|
36
|
+
permission,
|
|
37
|
+
strategy
|
|
38
|
+
}: UsePermissionProps): _tanstack_react_query4.UseSuspenseQueryResult<{
|
|
39
|
+
permission: undefined;
|
|
40
|
+
success: boolean;
|
|
41
|
+
} | {
|
|
42
|
+
permission: Permission | Permission[];
|
|
43
|
+
success: boolean;
|
|
44
|
+
}, Error>;
|
|
45
|
+
/**
|
|
46
|
+
* Check multiple permissions in parallel
|
|
47
|
+
* @param permission
|
|
48
|
+
* @param strategy
|
|
49
|
+
* @returns
|
|
50
|
+
* @deprecated Use `usePermission` with strategy "any" or "all" instead
|
|
51
|
+
*/
|
|
52
|
+
declare function usePermissions(permission?: Permission): {
|
|
9
53
|
data: null;
|
|
10
|
-
errors:
|
|
54
|
+
errors: _tanstack_react_query4.UseSuspenseQueryResult<{
|
|
11
55
|
permission: Permission;
|
|
12
56
|
success: boolean;
|
|
13
57
|
}, Error>[];
|
|
@@ -22,5 +66,5 @@ declare function usePermission(permission?: Permission): {
|
|
|
22
66
|
errors: null;
|
|
23
67
|
};
|
|
24
68
|
//#endregion
|
|
25
|
-
export { usePermission };
|
|
69
|
+
export { UsePermissionProps, usePermission, usePermissions };
|
|
26
70
|
//# sourceMappingURL=use-permission.d.mts.map
|
|
@@ -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":";;;;;;;AAUY,KAAA,kBAAA,GAAkB;EAgCd;;;;;;;;;AAsDhB;;eAxEmB;;;;;;;;;;;;;eAeA;;iBAGH,aAAA;;;GAAgD,4CAAkB;;;;;;;;;;;;;;iBAsDlE,cAAA,cAA4B"}
|
|
@@ -2,13 +2,60 @@
|
|
|
2
2
|
|
|
3
3
|
import { authClient } from "../handler/client.client.mjs";
|
|
4
4
|
import { useSession } from "./use-session.mjs";
|
|
5
|
-
import { useSuspenseQueries } from "@tanstack/react-query";
|
|
5
|
+
import { useSuspenseQueries, useSuspenseQuery } from "@tanstack/react-query";
|
|
6
6
|
|
|
7
7
|
//#region src/modules/auth/hooks/use-permission.ts
|
|
8
|
+
function usePermission({ permission, strategy = "all" }) {
|
|
9
|
+
const sessionQuery = useSession();
|
|
10
|
+
return useSuspenseQuery({
|
|
11
|
+
queryKey: ["permission", {
|
|
12
|
+
permission,
|
|
13
|
+
strategy
|
|
14
|
+
}],
|
|
15
|
+
queryFn: async () => {
|
|
16
|
+
if (!permission) return {
|
|
17
|
+
permission,
|
|
18
|
+
success: true
|
|
19
|
+
};
|
|
20
|
+
if (!sessionQuery.data) return {
|
|
21
|
+
permission,
|
|
22
|
+
success: false
|
|
23
|
+
};
|
|
24
|
+
const userId = sessionQuery.data?.user.id;
|
|
25
|
+
if (!userId) return {
|
|
26
|
+
permission,
|
|
27
|
+
success: false
|
|
28
|
+
};
|
|
29
|
+
const permissions = Array.isArray(permission) ? permission : [permission];
|
|
30
|
+
const results = await Promise.all(permissions.map((permission$1) => authClient.admin.hasPermission({
|
|
31
|
+
permission: permission$1,
|
|
32
|
+
userId
|
|
33
|
+
})));
|
|
34
|
+
const data = results.map(({ data: data$1 }) => data$1).filter((data$1) => !!data$1);
|
|
35
|
+
const errors = results.filter(({ error }) => !!error).map(({ error }) => error);
|
|
36
|
+
if (errors.length > 0) {
|
|
37
|
+
console.error(...errors);
|
|
38
|
+
return {
|
|
39
|
+
permission,
|
|
40
|
+
success: false
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
return {
|
|
44
|
+
permission,
|
|
45
|
+
success: strategy === "all" ? data.every(({ success }) => success) : data.some(({ success }) => success)
|
|
46
|
+
};
|
|
47
|
+
},
|
|
48
|
+
staleTime: 300 * 1e3
|
|
49
|
+
});
|
|
50
|
+
}
|
|
8
51
|
/**
|
|
9
|
-
*
|
|
52
|
+
* Check multiple permissions in parallel
|
|
53
|
+
* @param permission
|
|
54
|
+
* @param strategy
|
|
55
|
+
* @returns
|
|
56
|
+
* @deprecated Use `usePermission` with strategy "any" or "all" instead
|
|
10
57
|
*/
|
|
11
|
-
function
|
|
58
|
+
function usePermissions(permission) {
|
|
12
59
|
const sessionQuery = useSession();
|
|
13
60
|
return useSuspenseQueries({
|
|
14
61
|
queries: Object.entries(permission ?? {}).flatMap(([resource, permissions]) => permissions.map((permission$1) => ({ [resource]: [permission$1] }))).map((permission$1) => ({
|
|
@@ -53,5 +100,5 @@ function usePermission(permission) {
|
|
|
53
100
|
}
|
|
54
101
|
|
|
55
102
|
//#endregion
|
|
56
|
-
export { usePermission };
|
|
103
|
+
export { usePermission, usePermissions };
|
|
57
104
|
//# sourceMappingURL=use-permission.mjs.map
|
|
@@ -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 { 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":"
|
|
1
|
+
{"version":3,"file":"use-permission.mjs","names":["data","permission"],"sources":["../../../../src/modules/auth/hooks/use-permission.ts"],"sourcesContent":["\"use client\";\n\nimport { useSuspenseQueries, useSuspenseQuery } 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 type UsePermissionProps =\n | {\n /**\n * Strategy to use when checking multiple permissions\n * - \"all\": all permissions must be allowed\n * - \"any\": at least one permission must be allowed\n * @default \"all\"\n */\n strategy?: \"all\";\n\n /**\n * Permission to check\n * @example { project: [\"view\", \"create\"] }\n */\n permission?: Permission;\n }\n | {\n /**\n * Strategy to use when checking multiple permissions\n * - \"all\": all permissions must be allowed\n * - \"any\": at least one permission must be allowed\n * @default \"all\"\n */\n strategy?: \"any\";\n\n /**\n * Permission to check\n * @example [{ project: [\"view\", \"create\"] }, { client: [\"view\"] }, { drive: [\"view\"] }]\n */\n permission?: Permission[];\n };\n\nexport function usePermission({ permission, strategy = \"all\" }: UsePermissionProps) {\n const sessionQuery = useSession();\n\n return useSuspenseQuery({\n queryKey: [\"permission\", { permission, strategy }],\n queryFn: async () => {\n // If no permission is provided, allow by default\n if (!permission) return { permission, success: true };\n\n // If no user is logged in, deny by default\n if (!sessionQuery.data) return { permission, success: false };\n const userId = sessionQuery.data?.user.id;\n if (!userId) return { permission, success: false };\n\n // If the strategy is \"any\", check if the user has any of the permissions\n const permissions = Array.isArray(permission) ? permission : [permission];\n\n // Check if the user has the permission\n const results = await Promise.all(\n permissions.map((permission) => authClient.admin.hasPermission({ permission, userId })),\n );\n\n const data = results.map(({ data }) => data).filter((data) => !!data);\n const errors = results.filter(({ error }) => !!error).map(({ error }) => error);\n\n // If there is an error, log it and return false\n if (errors.length > 0) {\n console.error(...errors);\n return { permission, success: false };\n }\n\n // Determine if the user has the permission based on the strategy\n const success =\n strategy === \"all\"\n ? data.every(({ success }) => success)\n : data.some(({ success }) => success);\n\n // Return the result\n return {\n permission,\n success,\n };\n },\n staleTime: 5 * 60 * 1000, // 5 minutes\n });\n}\n\n/**\n * Check multiple permissions in parallel\n * @param permission\n * @param strategy\n * @returns\n * @deprecated Use `usePermission` with strategy \"any\" or \"all\" instead\n */\nexport function usePermissions(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":";;;;;;;AA0CA,SAAgB,cAAc,EAAE,YAAY,WAAW,SAA6B;CAClF,MAAM,eAAe,YAAY;AAEjC,QAAO,iBAAiB;EACtB,UAAU,CAAC,cAAc;GAAE;GAAY;GAAU,CAAC;EAClD,SAAS,YAAY;AAEnB,OAAI,CAAC,WAAY,QAAO;IAAE;IAAY,SAAS;IAAM;AAGrD,OAAI,CAAC,aAAa,KAAM,QAAO;IAAE;IAAY,SAAS;IAAO;GAC7D,MAAM,SAAS,aAAa,MAAM,KAAK;AACvC,OAAI,CAAC,OAAQ,QAAO;IAAE;IAAY,SAAS;IAAO;GAGlD,MAAM,cAAc,MAAM,QAAQ,WAAW,GAAG,aAAa,CAAC,WAAW;GAGzE,MAAM,UAAU,MAAM,QAAQ,IAC5B,YAAY,KAAK,iBAAe,WAAW,MAAM,cAAc;IAAE;IAAY;IAAQ,CAAC,CAAC,CACxF;GAED,MAAM,OAAO,QAAQ,KAAK,EAAE,mBAAWA,OAAK,CAAC,QAAQ,WAAS,CAAC,CAACA,OAAK;GACrE,MAAM,SAAS,QAAQ,QAAQ,EAAE,YAAY,CAAC,CAAC,MAAM,CAAC,KAAK,EAAE,YAAY,MAAM;AAG/E,OAAI,OAAO,SAAS,GAAG;AACrB,YAAQ,MAAM,GAAG,OAAO;AACxB,WAAO;KAAE;KAAY,SAAS;KAAO;;AAUvC,UAAO;IACL;IACA,SAPA,aAAa,QACT,KAAK,OAAO,EAAE,cAAc,QAAQ,GACpC,KAAK,MAAM,EAAE,cAAc,QAAQ;IAMxC;;EAEH,WAAW,MAAS;EACrB,CAAC;;;;;;;;;AAUJ,SAAgB,eAAe,YAAyB;CACtD,MAAM,eAAe,YAAY;AAMjC,QAAO,mBAAmB;EACxB,SALW,OAAO,QAAQ,cAAc,EAAE,CAAC,CAAC,SAAS,CAAC,UAAU,iBAChE,YAAY,KAAK,kBAAgB,GAAG,WAAW,CAACC,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"}
|
|
@@ -43,10 +43,10 @@ type CreateUserSchema = z$1.infer<typeof createUserSchema>;
|
|
|
43
43
|
* Update user schema
|
|
44
44
|
*/
|
|
45
45
|
declare const updateUserSchema: z$1.ZodObject<{
|
|
46
|
-
firstName: z$1.ZodString;
|
|
47
|
-
lastName: z$1.ZodString;
|
|
48
46
|
email: z$1.ZodString;
|
|
49
47
|
image: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
48
|
+
firstName: z$1.ZodString;
|
|
49
|
+
lastName: z$1.ZodString;
|
|
50
50
|
}, {
|
|
51
51
|
out: {};
|
|
52
52
|
in: {};
|
|
@@ -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;;;;;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,
|
|
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,SAAA,eAAA;EAAA,QAAA,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"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime282 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_runtime282.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_runtime282.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_runtime282.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_runtime282.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_runtime282.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_runtime282.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_runtime282.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_runtime282.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_runtime282.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,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime292 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_runtime292.JSX.Element | null;
|
|
25
25
|
//#endregion
|
|
26
26
|
export { CommandClick, CommandClickProps };
|
|
27
27
|
//# sourceMappingURL=click-command.client.d.mts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime293 from "react/jsx-runtime";
|
|
2
|
+
import * as react105 from "react";
|
|
3
3
|
import { PropsWithChildren } from "react";
|
|
4
4
|
|
|
5
5
|
//#region src/modules/commands/components/command-trigger.client.d.ts
|
|
@@ -9,7 +9,7 @@ import { PropsWithChildren } from "react";
|
|
|
9
9
|
type CommandTriggerContextValue = {
|
|
10
10
|
label?: string;
|
|
11
11
|
};
|
|
12
|
-
declare const CommandTriggerContext:
|
|
12
|
+
declare const CommandTriggerContext: react105.Context<CommandTriggerContextValue>;
|
|
13
13
|
/**
|
|
14
14
|
* Command trigger
|
|
15
15
|
*/
|
|
@@ -18,17 +18,17 @@ declare function CommandTrigger({
|
|
|
18
18
|
children
|
|
19
19
|
}: PropsWithChildren<{
|
|
20
20
|
label?: string;
|
|
21
|
-
}>):
|
|
21
|
+
}>): react_jsx_runtime293.JSX.Element;
|
|
22
22
|
/**
|
|
23
23
|
* Command label
|
|
24
24
|
*/
|
|
25
|
-
declare function CommandLabel():
|
|
25
|
+
declare function CommandLabel(): react_jsx_runtime293.JSX.Element | null;
|
|
26
26
|
/**
|
|
27
27
|
* Command icon
|
|
28
28
|
*/
|
|
29
29
|
declare function CommandIcon({
|
|
30
30
|
children
|
|
31
|
-
}: PropsWithChildren):
|
|
31
|
+
}: PropsWithChildren): react_jsx_runtime293.JSX.Element;
|
|
32
32
|
//#endregion
|
|
33
33
|
export { CommandIcon, CommandLabel, CommandTrigger, CommandTriggerContext };
|
|
34
34
|
//# sourceMappingURL=command-trigger.client.d.mts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime296 from "react/jsx-runtime";
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { DialogContentProps, DialogProps } from "@radix-ui/react-dialog";
|
|
4
4
|
import { Keys } from "react-hotkeys-hook";
|
|
@@ -20,7 +20,7 @@ declare function CommandDialog({
|
|
|
20
20
|
...props
|
|
21
21
|
}: Omit<DialogProps, "open" | "onOpenChange"> & {
|
|
22
22
|
openState?: CommandDialogOpenState;
|
|
23
|
-
}):
|
|
23
|
+
}): react_jsx_runtime296.JSX.Element;
|
|
24
24
|
/**
|
|
25
25
|
* CommandDialogTrigger
|
|
26
26
|
*/
|
|
@@ -37,42 +37,42 @@ declare function CommandDialogTrigger({
|
|
|
37
37
|
children,
|
|
38
38
|
disabled,
|
|
39
39
|
...props
|
|
40
|
-
}: CommandDialogTriggerProps):
|
|
40
|
+
}: CommandDialogTriggerProps): react_jsx_runtime296.JSX.Element | undefined;
|
|
41
41
|
/**
|
|
42
42
|
* CommandDialogContent
|
|
43
43
|
*/
|
|
44
44
|
declare function CommandDialogContent({
|
|
45
45
|
children,
|
|
46
46
|
...props
|
|
47
|
-
}: DialogContentProps):
|
|
47
|
+
}: DialogContentProps): react_jsx_runtime296.JSX.Element;
|
|
48
48
|
/**
|
|
49
49
|
* CommandDialogHeader
|
|
50
50
|
*/
|
|
51
51
|
declare function CommandDialogHeader({
|
|
52
52
|
children,
|
|
53
53
|
...props
|
|
54
|
-
}: React.HTMLAttributes<HTMLElement>):
|
|
54
|
+
}: React.HTMLAttributes<HTMLElement>): react_jsx_runtime296.JSX.Element;
|
|
55
55
|
/**
|
|
56
56
|
* CommandDialogTitle
|
|
57
57
|
*/
|
|
58
58
|
declare function CommandDialogTitle({
|
|
59
59
|
children,
|
|
60
60
|
...props
|
|
61
|
-
}: React.HTMLAttributes<HTMLElement>):
|
|
61
|
+
}: React.HTMLAttributes<HTMLElement>): react_jsx_runtime296.JSX.Element;
|
|
62
62
|
/**
|
|
63
63
|
* CommandDialogDescription
|
|
64
64
|
*/
|
|
65
65
|
declare function CommandDialogDescription({
|
|
66
66
|
children,
|
|
67
67
|
...props
|
|
68
|
-
}: React.HTMLAttributes<HTMLElement>):
|
|
68
|
+
}: React.HTMLAttributes<HTMLElement>): react_jsx_runtime296.JSX.Element;
|
|
69
69
|
/**
|
|
70
70
|
* CommandDialogFooter
|
|
71
71
|
*/
|
|
72
72
|
declare function CommandDialogFooter({
|
|
73
73
|
children,
|
|
74
74
|
...props
|
|
75
|
-
}: React.HTMLAttributes<HTMLElement>):
|
|
75
|
+
}: React.HTMLAttributes<HTMLElement>): react_jsx_runtime296.JSX.Element;
|
|
76
76
|
//#endregion
|
|
77
77
|
export { CommandDialog, CommandDialogContent, CommandDialogDescription, CommandDialogFooter, CommandDialogHeader, CommandDialogTitle, CommandDialogTrigger };
|
|
78
78
|
//# sourceMappingURL=dialog-command.client.d.mts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime303 from "react/jsx-runtime";
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { DefaultError, MutationOptions } from "@tanstack/react-query";
|
|
4
4
|
|
|
@@ -13,7 +13,7 @@ type CommandDropdownProps = {
|
|
|
13
13
|
declare function CommandDropdown({
|
|
14
14
|
children,
|
|
15
15
|
...props
|
|
16
|
-
}: CommandDropdownProps):
|
|
16
|
+
}: CommandDropdownProps): react_jsx_runtime303.JSX.Element | null;
|
|
17
17
|
/**
|
|
18
18
|
* CommandDropdownContent
|
|
19
19
|
*/
|
|
@@ -24,7 +24,7 @@ type CommandDropdownContentProps = {
|
|
|
24
24
|
declare function CommandDropdownContent({
|
|
25
25
|
children,
|
|
26
26
|
...props
|
|
27
|
-
}: CommandDropdownContentProps):
|
|
27
|
+
}: CommandDropdownContentProps): react_jsx_runtime303.JSX.Element | null;
|
|
28
28
|
/**
|
|
29
29
|
* CommandDropdownTrigger
|
|
30
30
|
*/
|
|
@@ -39,7 +39,7 @@ declare function CommandDropdownTrigger({
|
|
|
39
39
|
disabled,
|
|
40
40
|
children,
|
|
41
41
|
...props
|
|
42
|
-
}: CommandDropdownTriggerProps):
|
|
42
|
+
}: CommandDropdownTriggerProps): react_jsx_runtime303.JSX.Element | null;
|
|
43
43
|
/**
|
|
44
44
|
* CommandDropdownItem
|
|
45
45
|
*/
|
|
@@ -54,7 +54,7 @@ declare function CommandDropdownItem<TData = unknown, TError = DefaultError, TVa
|
|
|
54
54
|
mutation,
|
|
55
55
|
children,
|
|
56
56
|
...props
|
|
57
|
-
}: CommandDropdownItemProps<TData, TError, TVariables, TOnMutateResult>):
|
|
57
|
+
}: CommandDropdownItemProps<TData, TError, TVariables, TOnMutateResult>): react_jsx_runtime303.JSX.Element | null;
|
|
58
58
|
//#endregion
|
|
59
59
|
export { CommandDropdown, CommandDropdownContent, CommandDropdownItem, CommandDropdownProps, CommandDropdownTrigger };
|
|
60
60
|
//# sourceMappingURL=dropdown-command.client.d.mts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime307 from "react/jsx-runtime";
|
|
2
2
|
import React from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/modules/commands/components/empty-command.client.d.ts
|
|
@@ -13,7 +13,7 @@ declare function CommandEmpty({
|
|
|
13
13
|
children,
|
|
14
14
|
disabled,
|
|
15
15
|
...props
|
|
16
|
-
}: CommandEmptyProps):
|
|
16
|
+
}: CommandEmptyProps): react_jsx_runtime307.JSX.Element | null;
|
|
17
17
|
//#endregion
|
|
18
18
|
export { CommandEmpty, CommandEmptyProps };
|
|
19
19
|
//# sourceMappingURL=empty-command.client.d.mts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime308 from "react/jsx-runtime";
|
|
2
2
|
import React, { ComponentProps } from "react";
|
|
3
3
|
import { DefaultError, MutationOptions } from "@tanstack/react-query";
|
|
4
4
|
import { FieldValues, Form } from "react-hook-form";
|
|
@@ -12,7 +12,7 @@ import { Keys } from "react-hotkeys-hook";
|
|
|
12
12
|
declare function CommandFormDialog({
|
|
13
13
|
children,
|
|
14
14
|
...props
|
|
15
|
-
}: DialogProps):
|
|
15
|
+
}: DialogProps): react_jsx_runtime308.JSX.Element;
|
|
16
16
|
/**
|
|
17
17
|
* CommandFormDialogTrigger
|
|
18
18
|
*/
|
|
@@ -29,28 +29,28 @@ declare function CommandFormDialogTrigger({
|
|
|
29
29
|
children,
|
|
30
30
|
disabled,
|
|
31
31
|
...props
|
|
32
|
-
}: CommandFormDialogTriggerProps):
|
|
32
|
+
}: CommandFormDialogTriggerProps): react_jsx_runtime308.JSX.Element | undefined;
|
|
33
33
|
/**
|
|
34
34
|
* CommandFormDialogHeader
|
|
35
35
|
*/
|
|
36
36
|
declare function CommandFormDialogHeader({
|
|
37
37
|
children,
|
|
38
38
|
...props
|
|
39
|
-
}: React.HTMLAttributes<HTMLElement>):
|
|
39
|
+
}: React.HTMLAttributes<HTMLElement>): react_jsx_runtime308.JSX.Element;
|
|
40
40
|
/**
|
|
41
41
|
* CommandFormDialogTitle
|
|
42
42
|
*/
|
|
43
43
|
declare function CommandFormDialogTitle({
|
|
44
44
|
children,
|
|
45
45
|
...props
|
|
46
|
-
}: React.HTMLAttributes<HTMLElement>):
|
|
46
|
+
}: React.HTMLAttributes<HTMLElement>): react_jsx_runtime308.JSX.Element;
|
|
47
47
|
/**
|
|
48
48
|
* CommandFormDialogDescription
|
|
49
49
|
*/
|
|
50
50
|
declare function CommandFormDialogDescription({
|
|
51
51
|
children,
|
|
52
52
|
...props
|
|
53
|
-
}: React.HTMLAttributes<HTMLElement>):
|
|
53
|
+
}: React.HTMLAttributes<HTMLElement>): react_jsx_runtime308.JSX.Element;
|
|
54
54
|
declare const CommandFormDialogContentProvider: typeof Form;
|
|
55
55
|
/**
|
|
56
56
|
* CommandFormDialogContent
|
|
@@ -65,7 +65,7 @@ declare function CommandFormDialogContent<TValues extends FieldValues, TData = u
|
|
|
65
65
|
mutation,
|
|
66
66
|
children,
|
|
67
67
|
...props
|
|
68
|
-
}: CommandFormDialogContentProps<TValues, TData, TError, TVariables, TOnMutateResult>):
|
|
68
|
+
}: CommandFormDialogContentProps<TValues, TData, TError, TVariables, TOnMutateResult>): react_jsx_runtime308.JSX.Element;
|
|
69
69
|
/**
|
|
70
70
|
* FormDialogFields
|
|
71
71
|
*/
|
|
@@ -73,28 +73,28 @@ declare function CommandFormDialogFields({
|
|
|
73
73
|
children,
|
|
74
74
|
className,
|
|
75
75
|
...props
|
|
76
|
-
}: ComponentProps<"div">):
|
|
76
|
+
}: ComponentProps<"div">): react_jsx_runtime308.JSX.Element;
|
|
77
77
|
/**
|
|
78
78
|
* CommandFormDialogFooter
|
|
79
79
|
*/
|
|
80
80
|
declare function CommandFormDialogFooter({
|
|
81
81
|
children,
|
|
82
82
|
...props
|
|
83
|
-
}: React.HTMLAttributes<HTMLElement>):
|
|
83
|
+
}: React.HTMLAttributes<HTMLElement>): react_jsx_runtime308.JSX.Element;
|
|
84
84
|
/**
|
|
85
85
|
* CommandFormDialogCancel
|
|
86
86
|
*/
|
|
87
87
|
declare function CommandFormDialogCancel({
|
|
88
88
|
children,
|
|
89
89
|
...props
|
|
90
|
-
}: React.HTMLAttributes<HTMLElement>):
|
|
90
|
+
}: React.HTMLAttributes<HTMLElement>): react_jsx_runtime308.JSX.Element;
|
|
91
91
|
/**
|
|
92
92
|
* CommandFormDialogSubmit
|
|
93
93
|
*/
|
|
94
94
|
declare function CommandFormDialogSubmit({
|
|
95
95
|
children,
|
|
96
96
|
...props
|
|
97
|
-
}: React.HTMLAttributes<HTMLElement>):
|
|
97
|
+
}: React.HTMLAttributes<HTMLElement>): react_jsx_runtime308.JSX.Element;
|
|
98
98
|
//#endregion
|
|
99
99
|
export { CommandFormDialog, CommandFormDialogCancel, CommandFormDialogContent, CommandFormDialogContentProps, CommandFormDialogContentProvider, CommandFormDialogDescription, CommandFormDialogFields, CommandFormDialogFooter, CommandFormDialogHeader, CommandFormDialogSubmit, CommandFormDialogTitle, CommandFormDialogTrigger };
|
|
100
100
|
//# sourceMappingURL=form-dialog-command.client.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-command-menu.client.d.mts","names":[],"sources":["../../../../src/modules/commands/hooks/use-command-menu.client.tsx"],"sourcesContent":[],"mappings":";;;;;;;;;
|
|
1
|
+
{"version":3,"file":"use-command-menu.client.d.mts","names":[],"sources":["../../../../src/modules/commands/hooks/use-command-menu.client.tsx"],"sourcesContent":[],"mappings":";;;;;;;;;KAWY;QACJ;EADI,QAAA,EAEA,UAFA,CAEW,KAFW,EAEJ,KAFI,CAAA,EAAA;EAC1B,IAAA,CAAA,EAEC,KAFD;CACe"}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
-
import { mergePermissions } from "../../auth/lib/utils.mjs";
|
|
4
|
-
import { usePermission } from "../../auth/hooks/use-permission.mjs";
|
|
5
|
-
|
|
6
3
|
//#region src/modules/commands/hooks/use-command-menu.client.tsx
|
|
7
4
|
/**
|
|
8
5
|
* Check if a command has an id field in the data
|
|
@@ -37,7 +34,6 @@ function renderBulkCommand({ data, command, meta }) {
|
|
|
37
34
|
* useSingleCommandMenu
|
|
38
35
|
*/
|
|
39
36
|
function useSingleCommandMenu({ data, commands, meta }) {
|
|
40
|
-
usePermission(mergePermissions(commands.map((command) => command.permission).filter(Boolean)));
|
|
41
37
|
const validCommands = commands.filter((command) => command.mode === "single" ? validateSingleCommand({
|
|
42
38
|
data,
|
|
43
39
|
command
|
|
@@ -62,7 +58,6 @@ function useSingleCommandMenu({ data, commands, meta }) {
|
|
|
62
58
|
* useBulkCommandMenu
|
|
63
59
|
*/
|
|
64
60
|
function useBulkCommandMenu({ data, commands, meta }) {
|
|
65
|
-
usePermission(mergePermissions(commands.map((command) => command.permission).filter(Boolean)));
|
|
66
61
|
/**
|
|
67
62
|
* Filter out commands that don't have valid conditions
|
|
68
63
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-command-menu.client.mjs","names":["data"],"sources":["../../../../src/modules/commands/hooks/use-command-menu.client.tsx"],"sourcesContent":["\"use client\";\n\nimport {
|
|
1
|
+
{"version":3,"file":"use-command-menu.client.mjs","names":["data"],"sources":["../../../../src/modules/commands/hooks/use-command-menu.client.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n type BulkCommandDefRenderParams,\n type CommandDef,\n type SingleCommandDefRenderParams,\n} from \"../lib/definitions\";\n\n/**\n * Command menu props\n */\nexport type SingleCommandMenuProps<TData, TMeta> = {\n data: TData;\n commands: CommandDef<TData, TMeta>[];\n meta?: TMeta;\n};\n\nexport type BulkCommandMenuProps<TData, TMeta> = {\n data: TData[];\n commands: CommandDef<TData, TMeta>[];\n meta?: TMeta;\n};\n\n/**\n * Check if a command has an id field in the data\n */\nfunction dataHasId<TData>(data: TData) {\n return data && typeof data === \"object\" && \"id\" in data && typeof data.id === \"string\";\n}\n\n/**\n * Single command validation\n */\ntype ValidateSingleCommandParams<TData, TMeta> = {\n data: TData;\n command: CommandDef<TData, TMeta> & { mode: \"single\" };\n};\n\nfunction validateSingleCommand<TData, TMeta>({\n data,\n command,\n}: ValidateSingleCommandParams<TData, TMeta>) {\n const valid = command.conditions?.({ data });\n return Array.isArray(valid) ? valid.every(Boolean) : (valid ?? true);\n}\n\n/**\n * Single command rendering\n */\ntype RenderSingleCommandParams<TData, TMeta> = {\n data: TData;\n meta?: TMeta;\n command: CommandDef<TData, TMeta> & { mode: \"single\" };\n};\n\nfunction renderSingleCommand<TData, TMeta>({\n data,\n command,\n meta,\n}: RenderSingleCommandParams<TData, TMeta>) {\n return command.render({\n data,\n meta: meta ?? ({} as TMeta),\n ...(dataHasId(data) ? { id: (data as TData & { id: string }).id } : {}),\n } as SingleCommandDefRenderParams<TData, TMeta>);\n}\n\n/**\n * Bulk command validation\n */\ntype ValidateBulkCommandParams<TData, TMeta> = {\n data: TData[];\n command: CommandDef<TData, TMeta> & { mode: \"bulk\" };\n};\n\nfunction validateBulkCommand<TData, TMeta>({\n data,\n command,\n}: ValidateBulkCommandParams<TData, TMeta>) {\n const valid = command.conditions?.({ data });\n return Array.isArray(valid) ? valid.every(Boolean) : (valid ?? true);\n}\n\n/**\n * Bulk command rendering\n */\ntype RenderBulkCommandParams<TData, TMeta> = {\n data: TData[];\n command: CommandDef<TData, TMeta> & { mode: \"bulk\" };\n meta?: TMeta;\n};\n\nfunction renderBulkCommand<TData, TMeta>({\n data,\n command,\n meta,\n}: RenderBulkCommandParams<TData, TMeta>) {\n const ids = data.filter(dataHasId).map((data) => (data as TData & { id: string }).id);\n\n return command.render({\n data,\n meta: meta ?? ({} as TMeta),\n ...(ids.length > 0 ? { ids } : {}),\n } as BulkCommandDefRenderParams<TData, TMeta>);\n}\n\n/**\n * useSingleCommandMenu\n */\nexport function useSingleCommandMenu<TData, TMeta>({\n data,\n commands,\n meta,\n}: SingleCommandMenuProps<TData, TMeta> & { data: TData }) {\n // const permissions = commands.map((command) => command.permission).filter(Boolean) as Permission[];\n // usePermission(mergePermissions(permissions));\n\n // filter out commands that don't have valid conditions\n const validCommands = commands.filter((command) =>\n command.mode === \"single\"\n ? validateSingleCommand({ data, command })\n : validateBulkCommand({ data: [data], command }),\n );\n\n function renderCommand(command: (typeof validCommands)[number]) {\n return command.mode === \"single\"\n ? renderSingleCommand({ command, data, meta })\n : renderBulkCommand({ command, data: [data], meta });\n }\n\n return [validCommands, renderCommand] as const;\n}\n\n/**\n * useBulkCommandMenu\n */\nexport function useBulkCommandMenu<TData, TMeta>({\n data,\n commands,\n meta,\n}: BulkCommandMenuProps<TData, TMeta>) {\n // const permissions = commands.map((command) => command.permission).filter(Boolean) as Permission[];\n // usePermission(mergePermissions(permissions));\n\n /**\n * Filter out commands that don't have valid conditions\n */\n const validCommands = commands\n // filter out commands that have mode \"bulk\"\n .filter((command) => command.mode === \"bulk\")\n // filter out commands that don't have valid conditions\n .filter((command) => command.mode === \"bulk\" && validateBulkCommand({ data, command }));\n\n /**\n * Render command\n */\n function renderCommand(command: (typeof commands)[number]) {\n if (command.mode === \"single\") return null;\n\n return renderBulkCommand({ command, data, meta });\n }\n\n return [validCommands, renderCommand] as const;\n}\n\n// export function useBulkCommandMenu<TData, TMeta>({\n// data,\n// commands,\n// meta,\n// }: BulkCommandMenuProps<TData, TMeta>) {\n// /**\n// * Filter out commands that don't have valid conditions\n// */\n// const validCommands = useSuspenseQueries({\n// queries: commands.flatMap((command) => ({\n// queryKey: [\"command\", command],\n// queryFn: async () => {\n// const { mode, permission } = command;\n\n// // filter out commands that have mode \"bulk\"\n// if (mode !== \"bulk\") return null;\n\n// // filter out commands that don't have valid conditions\n// if (!validateBulkCommand({ data, command })) return null;\n\n// // filter out commands that don't have a permissions defined\n// if (!permission) return command;\n\n// // filter out commands that don't have valid permissions\n// const session = await authClient.getSession();\n// const userId = session.data?.user.id;\n// const hasPermission = await authClient.admin.hasPermission({ permission, userId });\n// if (!hasPermission.data?.success) return null;\n\n// return command;\n// },\n// })),\n// combine: (items) =>\n// items.filter(({ data }) => data).map(({ data }) => data as NonNullable<typeof data>),\n// });\n\n// /**\n// * Render command\n// */\n// const renderCommand = (command: (typeof validCommands)[number]) =>\n// renderBulkCommand({ command, data, meta });\n\n// return [validCommands, renderCommand] as const;\n// }\n\n// */\n// export function useSingleCommandMenu<TData, TMeta>({\n// data,\n// commands,\n// meta,\n// }: SingleCommandMenuProps<TData, TMeta> & { data: TData }) {\n// /**\n// * Filter out commands that don't have valid conditions\n// */\n// const validCommands = useSuspenseQueries({\n// queries: commands.flatMap((command) => ({\n// queryKey: [\"command\", command],\n// queryFn: async () => {\n// const { mode, permission } = command;\n\n// // filter out commands that don't have valid conditions\n// if (mode === \"single\" && !validateSingleCommand({ data, command })) return null;\n// if (mode === \"bulk\" && !validateBulkCommand({ data: [data], command })) return null;\n\n// // filter out commands that don't have a permissions defined\n// if (!permission) return command;\n\n// // filter out commands that don't have valid permissions\n// const session = await authClient.getSession();\n// const userId = session.data?.user.id;\n// const hasPermission = await authClient.admin.hasPermission({ permission, userId });\n// if (!hasPermission.data?.success) return null;\n\n// return command;\n// },\n// })),\n// combine: (items) =>\n// items.filter(({ data }) => data).map(({ data }) => data as NonNullable<typeof data>),\n// });\n\n// /**\n// * Render command\n// */\n// function renderCommand(command: (typeof validCommands)[number]) {\n// return command.mode === \"single\"\n// ? renderSingleCommand({ command, data, meta })\n// : renderBulkCommand({ command, data: [data], meta });\n// }\n\n// return [validCommands, renderCommand] as const;\n// }\n"],"mappings":";;;;;;AA0BA,SAAS,UAAiB,MAAa;AACrC,QAAO,QAAQ,OAAO,SAAS,YAAY,QAAQ,QAAQ,OAAO,KAAK,OAAO;;AAWhF,SAAS,sBAAoC,EAC3C,MACA,WAC4C;CAC5C,MAAM,QAAQ,QAAQ,aAAa,EAAE,MAAM,CAAC;AAC5C,QAAO,MAAM,QAAQ,MAAM,GAAG,MAAM,MAAM,QAAQ,GAAI,SAAS;;AAYjE,SAAS,oBAAkC,EACzC,MACA,SACA,QAC0C;AAC1C,QAAO,QAAQ,OAAO;EACpB;EACA,MAAM,QAAS,EAAE;EACjB,GAAI,UAAU,KAAK,GAAG,EAAE,IAAK,KAAgC,IAAI,GAAG,EAAE;EACvE,CAA+C;;AAWlD,SAAS,oBAAkC,EACzC,MACA,WAC0C;CAC1C,MAAM,QAAQ,QAAQ,aAAa,EAAE,MAAM,CAAC;AAC5C,QAAO,MAAM,QAAQ,MAAM,GAAG,MAAM,MAAM,QAAQ,GAAI,SAAS;;AAYjE,SAAS,kBAAgC,EACvC,MACA,SACA,QACwC;CACxC,MAAM,MAAM,KAAK,OAAO,UAAU,CAAC,KAAK,WAAUA,OAAgC,GAAG;AAErF,QAAO,QAAQ,OAAO;EACpB;EACA,MAAM,QAAS,EAAE;EACjB,GAAI,IAAI,SAAS,IAAI,EAAE,KAAK,GAAG,EAAE;EAClC,CAA6C;;;;;AAMhD,SAAgB,qBAAmC,EACjD,MACA,UACA,QACyD;CAKzD,MAAM,gBAAgB,SAAS,QAAQ,YACrC,QAAQ,SAAS,WACb,sBAAsB;EAAE;EAAM;EAAS,CAAC,GACxC,oBAAoB;EAAE,MAAM,CAAC,KAAK;EAAE;EAAS,CAAC,CACnD;CAED,SAAS,cAAc,SAAyC;AAC9D,SAAO,QAAQ,SAAS,WACpB,oBAAoB;GAAE;GAAS;GAAM;GAAM,CAAC,GAC5C,kBAAkB;GAAE;GAAS,MAAM,CAAC,KAAK;GAAE;GAAM,CAAC;;AAGxD,QAAO,CAAC,eAAe,cAAc;;;;;AAMvC,SAAgB,mBAAiC,EAC/C,MACA,UACA,QACqC;;;;CAOrC,MAAM,gBAAgB,SAEnB,QAAQ,YAAY,QAAQ,SAAS,OAAO,CAE5C,QAAQ,YAAY,QAAQ,SAAS,UAAU,oBAAoB;EAAE;EAAM;EAAS,CAAC,CAAC;;;;CAKzF,SAAS,cAAc,SAAoC;AACzD,MAAI,QAAQ,SAAS,SAAU,QAAO;AAEtC,SAAO,kBAAkB;GAAE;GAAS;GAAM;GAAM,CAAC;;AAGnD,QAAO,CAAC,eAAe,cAAc"}
|