@tulip-systems/core 0.4.1 → 0.5.1
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/status.d.mts +3 -3
- 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/{block-dropdown.mjs → menu-nodes.client.mjs} +25 -15
- package/dist/components/editor/components/menu-nodes.client.mjs.map +1 -0
- package/dist/components/editor/components/menu.client.d.mts +10 -0
- package/dist/components/editor/components/menu.client.d.mts.map +1 -0
- package/dist/components/editor/components/menu.client.mjs +166 -0
- package/dist/components/editor/components/menu.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 +65 -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/empty-page.d.mts +4 -4
- package/dist/components/layouts/list-layout.d.mts +2 -2
- package/dist/components/layouts/not-found-page.d.mts +3 -3
- 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/tab-layout.d.mts +2 -2
- package/dist/components/lists/data-list.d.mts +5 -5
- package/dist/components/lists/data-stack.d.mts +8 -8
- package/dist/components/navigation/admin-sidebar-paths.client.d.mts +10 -10
- package/dist/components/ui/accordion.d.mts +5 -5
- package/dist/components/ui/alert-dialog.d.mts +12 -12
- package/dist/components/ui/alert.d.mts +6 -6
- package/dist/components/ui/aspect-ratio.d.mts +2 -2
- package/dist/components/ui/avatar.client.d.mts +4 -4
- package/dist/components/ui/badge.d.mts +4 -4
- package/dist/components/ui/breadcrumb.d.mts +8 -8
- package/dist/components/ui/breadcrumb.d.mts.map +1 -1
- package/dist/components/ui/button.d.mts +5 -5
- package/dist/components/ui/button.d.mts.map +1 -1
- package/dist/components/ui/calendar.d.mts +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/card.d.mts.map +1 -1
- package/dist/components/ui/carousel.d.mts +6 -6
- package/dist/components/ui/carousel.d.mts.map +1 -1
- package/dist/components/ui/chart.client.d.mts +5 -5
- package/dist/components/ui/checkbox.d.mts +2 -2
- package/dist/components/ui/checkbox.d.mts.map +1 -1
- package/dist/components/ui/collapsible.client.d.mts +4 -4
- package/dist/components/ui/color-picker.client.d.mts +2 -2
- package/dist/components/ui/combobox-dropdown.client.d.mts +2 -2
- package/dist/components/ui/combobox.client.d.mts +2 -2
- package/dist/components/ui/command.d.mts +10 -10
- package/dist/components/ui/command.d.mts.map +1 -1
- package/dist/components/ui/context-menu.d.mts +16 -16
- package/dist/components/ui/date-picker.client.d.mts +2 -2
- package/dist/components/ui/dialog.client.d.mts +11 -11
- package/dist/components/ui/drawer.client.d.mts +11 -11
- package/dist/components/ui/dropdown-menu.d.mts +16 -16
- package/dist/components/ui/form.client.d.mts +7 -7
- package/dist/components/ui/hover-card.client.d.mts +4 -4
- package/dist/components/ui/input-recipient.d.mts +3 -1
- 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 +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/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/hooks/use-indicator.d.mts.map +1 -1
- 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 +131 -131
- 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 +3 -3
- 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/empty-command.client.d.mts.map +1 -1
- package/dist/modules/commands/components/form-dialog-command.client.d.mts +11 -11
- package/dist/modules/commands/components/form-dialog-command.client.d.mts.map +1 -1
- package/dist/modules/commands/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/context-menu.client.d.mts.map +1 -1
- package/dist/modules/commands/menus/dropdown-menu.client.d.mts +3 -3
- package/dist/modules/commands/menus/dropdown-menu.client.d.mts.map +1 -1
- package/dist/modules/commands/menus/inline-menu.client.d.mts +3 -3
- package/dist/modules/commands/menus/inline-menu.client.d.mts.map +1 -1
- package/dist/modules/commands/menus/responsive-menu.client.d.mts +3 -3
- package/dist/modules/commands/menus/responsive-menu.client.d.mts.map +1 -1
- package/dist/modules/commands/utils/archive-command.client.d.mts +3 -3
- package/dist/modules/commands/utils/archive-command.client.d.mts.map +1 -1
- package/dist/modules/commands/utils/delete-command.client.d.mts +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/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.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/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/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/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/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/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 +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 +3 -0
- 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 +1 -0
- 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 +1 -0
- 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/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 +2 -2
- 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/{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} +6 -6
- 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 +84 -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 +298 -0
- package/dist/modules/storage/lib/service.server.mjs.map +1 -0
- package/dist/modules/{uploads → storage}/lib/validators.d.mts +358 -53
- 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/content.client.tsx +1 -1
- package/src/components/editor/components/editor.client.tsx +95 -0
- package/src/components/editor/components/{block-dropdown.tsx → menu-nodes.client.tsx} +17 -4
- package/src/components/editor/components/menu.client.tsx +214 -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 +180 -0
- package/src/modules/{uploads → storage}/lib/schema.ts +34 -13
- package/src/modules/storage/lib/service.server.ts +476 -0
- package/src/modules/storage/lib/validators.ts +156 -0
- package/dist/components/editor/components/block-dropdown.mjs.map +0 -1
- 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 +0 -134
- 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,134 +0,0 @@
|
|
|
1
|
-
import { Button } from "../../ui/button.mjs";
|
|
2
|
-
import { Popover, PopoverContent, PopoverTrigger } from "../../ui/popover.mjs";
|
|
3
|
-
import { Separator } from "../../ui/separator.mjs";
|
|
4
|
-
import { EditorContext } from "../context.client.mjs";
|
|
5
|
-
import { ColorPicker } from "../../ui/color-picker.client.mjs";
|
|
6
|
-
import { BlockDropdown } from "./block-dropdown.mjs";
|
|
7
|
-
import { BaselineIcon, BoldIcon, EraserIcon, ItalicIcon, PaintBucketIcon, RedoIcon, StrikethroughIcon, UnderlineIcon, UndoIcon } from "lucide-react";
|
|
8
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
-
import { useContext } from "react";
|
|
10
|
-
|
|
11
|
-
//#region src/components/editor/components/fixed-menu.client.tsx
|
|
12
|
-
function FixedMenu() {
|
|
13
|
-
const { editor } = useContext(EditorContext);
|
|
14
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
15
|
-
className: "border-input bg-muted/30 z-10 flex items-center gap-3 overflow-auto border-b p-2",
|
|
16
|
-
children: [
|
|
17
|
-
/* @__PURE__ */ jsxs("div", {
|
|
18
|
-
className: "flex items-center gap-1",
|
|
19
|
-
children: [/* @__PURE__ */ jsx(Button, {
|
|
20
|
-
onClick: () => editor.commands.undo(),
|
|
21
|
-
disabled: !editor?.can().undo(),
|
|
22
|
-
type: "button",
|
|
23
|
-
"aria-label": "Undo",
|
|
24
|
-
size: "icon",
|
|
25
|
-
className: "p-2",
|
|
26
|
-
variant: "outline",
|
|
27
|
-
children: /* @__PURE__ */ jsx(UndoIcon, { className: "size-3.5" })
|
|
28
|
-
}), /* @__PURE__ */ jsx(Button, {
|
|
29
|
-
onClick: () => editor.commands.redo(),
|
|
30
|
-
disabled: !editor?.can().redo(),
|
|
31
|
-
type: "button",
|
|
32
|
-
"aria-label": "Redo",
|
|
33
|
-
size: "icon",
|
|
34
|
-
className: "p-2",
|
|
35
|
-
variant: "outline",
|
|
36
|
-
children: /* @__PURE__ */ jsx(RedoIcon, { className: "size-3.5" })
|
|
37
|
-
})]
|
|
38
|
-
}),
|
|
39
|
-
/* @__PURE__ */ jsx(Separator, {
|
|
40
|
-
orientation: "vertical",
|
|
41
|
-
className: "h-8"
|
|
42
|
-
}),
|
|
43
|
-
/* @__PURE__ */ jsx(BlockDropdown, {}),
|
|
44
|
-
/* @__PURE__ */ jsx(Separator, {
|
|
45
|
-
orientation: "vertical",
|
|
46
|
-
className: "h-8"
|
|
47
|
-
}),
|
|
48
|
-
/* @__PURE__ */ jsxs("div", {
|
|
49
|
-
className: "flex items-center gap-1",
|
|
50
|
-
children: [
|
|
51
|
-
/* @__PURE__ */ jsx(Button, {
|
|
52
|
-
type: "button",
|
|
53
|
-
size: "icon",
|
|
54
|
-
variant: editor?.isActive("bold") ? "secondary" : "outline",
|
|
55
|
-
onClick: () => editor.chain().focus().toggleBold().run(),
|
|
56
|
-
className: "border",
|
|
57
|
-
children: /* @__PURE__ */ jsx(BoldIcon, { className: "h-3.5 w-3.5" })
|
|
58
|
-
}),
|
|
59
|
-
/* @__PURE__ */ jsx(Button, {
|
|
60
|
-
type: "button",
|
|
61
|
-
size: "icon",
|
|
62
|
-
variant: editor?.isActive("italic") ? "secondary" : "outline",
|
|
63
|
-
onClick: () => editor.chain().focus().toggleItalic().run(),
|
|
64
|
-
className: "border",
|
|
65
|
-
children: /* @__PURE__ */ jsx(ItalicIcon, { className: "size-3.5" })
|
|
66
|
-
}),
|
|
67
|
-
/* @__PURE__ */ jsx(Button, {
|
|
68
|
-
type: "button",
|
|
69
|
-
size: "icon",
|
|
70
|
-
variant: editor?.isActive("underline") ? "secondary" : "outline",
|
|
71
|
-
onClick: () => editor.chain().focus().toggleUnderline().run(),
|
|
72
|
-
className: "border",
|
|
73
|
-
children: /* @__PURE__ */ jsx(UnderlineIcon, { className: "size-3.5" })
|
|
74
|
-
}),
|
|
75
|
-
/* @__PURE__ */ jsx(Button, {
|
|
76
|
-
type: "button",
|
|
77
|
-
size: "icon",
|
|
78
|
-
variant: editor?.isActive("strike") ? "secondary" : "outline",
|
|
79
|
-
onClick: () => editor.chain().focus().toggleStrike().run(),
|
|
80
|
-
className: "border",
|
|
81
|
-
children: /* @__PURE__ */ jsx(StrikethroughIcon, { className: "size-3.5" })
|
|
82
|
-
})
|
|
83
|
-
]
|
|
84
|
-
}),
|
|
85
|
-
/* @__PURE__ */ jsx(Separator, {
|
|
86
|
-
orientation: "vertical",
|
|
87
|
-
className: "h-8"
|
|
88
|
-
}),
|
|
89
|
-
/* @__PURE__ */ jsxs("div", {
|
|
90
|
-
className: "flex items-center gap-1",
|
|
91
|
-
children: [
|
|
92
|
-
/* @__PURE__ */ jsxs(Popover, { children: [/* @__PURE__ */ jsx(PopoverTrigger, {
|
|
93
|
-
asChild: true,
|
|
94
|
-
children: /* @__PURE__ */ jsx(Button, {
|
|
95
|
-
size: "icon",
|
|
96
|
-
variant: "outline",
|
|
97
|
-
children: /* @__PURE__ */ jsx(BaselineIcon, { className: "size-3.5" })
|
|
98
|
-
})
|
|
99
|
-
}), /* @__PURE__ */ jsx(PopoverContent, {
|
|
100
|
-
className: "w-fit p-0",
|
|
101
|
-
children: /* @__PURE__ */ jsx(ColorPicker, { onValueChange: (color) => editor.chain().focus().setColor(color).run() })
|
|
102
|
-
})] }),
|
|
103
|
-
/* @__PURE__ */ jsxs(Popover, { children: [/* @__PURE__ */ jsx(PopoverTrigger, {
|
|
104
|
-
asChild: true,
|
|
105
|
-
children: /* @__PURE__ */ jsx(Button, {
|
|
106
|
-
size: "icon",
|
|
107
|
-
variant: "outline",
|
|
108
|
-
disabled: !editor?.can().setHighlight(),
|
|
109
|
-
children: /* @__PURE__ */ jsx(PaintBucketIcon, { className: "size-3.5" })
|
|
110
|
-
})
|
|
111
|
-
}), /* @__PURE__ */ jsx(PopoverContent, {
|
|
112
|
-
className: "w-fit p-0",
|
|
113
|
-
children: /* @__PURE__ */ jsx(ColorPicker, { onValueChange: (color) => editor.chain().focus().setHighlight({ color }).run() })
|
|
114
|
-
})] }),
|
|
115
|
-
/* @__PURE__ */ jsx(Button, {
|
|
116
|
-
type: "button",
|
|
117
|
-
size: "icon",
|
|
118
|
-
variant: "outline",
|
|
119
|
-
className: "border",
|
|
120
|
-
onClick: () => {
|
|
121
|
-
editor.commands.unsetColor();
|
|
122
|
-
editor.commands.unsetHighlight();
|
|
123
|
-
},
|
|
124
|
-
children: /* @__PURE__ */ jsx(EraserIcon, { className: "h-4 w-4" })
|
|
125
|
-
})
|
|
126
|
-
]
|
|
127
|
-
})
|
|
128
|
-
]
|
|
129
|
-
});
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
//#endregion
|
|
133
|
-
export { FixedMenu };
|
|
134
|
-
//# sourceMappingURL=fixed-menu.client.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fixed-menu.client.mjs","names":[],"sources":["../../../../src/components/editor/components/fixed-menu.client.tsx"],"sourcesContent":["import { ColorPicker } from \"@/components/ui/color-picker.client\";\nimport { Button } from \"@/components/ui/button\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"@/components/ui/popover\";\nimport { Separator } from \"@/components/ui/separator\";\nimport {\n BaselineIcon,\n BoldIcon,\n EraserIcon,\n ItalicIcon,\n PaintBucketIcon,\n RedoIcon,\n StrikethroughIcon,\n UnderlineIcon,\n UndoIcon,\n} from \"lucide-react\";\nimport { useContext } from \"react\";\nimport { EditorContext } from \"../context.client\";\nimport { BlockDropdown } from \"./block-dropdown\";\n\nexport function FixedMenu() {\n const { editor } = useContext(EditorContext);\n\n return (\n <div className=\"border-input bg-muted/30 z-10 flex items-center gap-3 overflow-auto border-b p-2\">\n <div className=\"flex items-center gap-1\">\n <Button\n onClick={() => editor.commands.undo()}\n disabled={!editor?.can().undo()}\n type=\"button\"\n aria-label=\"Undo\"\n size=\"icon\"\n className=\"p-2\"\n variant=\"outline\"\n >\n <UndoIcon className=\"size-3.5\" />\n </Button>\n\n <Button\n onClick={() => editor.commands.redo()}\n disabled={!editor?.can().redo()}\n type=\"button\"\n aria-label=\"Redo\"\n size=\"icon\"\n className=\"p-2\"\n variant=\"outline\"\n >\n <RedoIcon className=\"size-3.5\" />\n </Button>\n </div>\n\n <Separator orientation=\"vertical\" className=\"h-8\" />\n\n <BlockDropdown />\n\n <Separator orientation=\"vertical\" className=\"h-8\" />\n\n <div className=\"flex items-center gap-1\">\n <Button\n type=\"button\"\n size=\"icon\"\n variant={editor?.isActive(\"bold\") ? \"secondary\" : \"outline\"}\n onClick={() => editor.chain().focus().toggleBold().run()}\n className=\"border\"\n >\n <BoldIcon className=\"h-3.5 w-3.5\" />\n </Button>\n\n <Button\n type=\"button\"\n size=\"icon\"\n variant={editor?.isActive(\"italic\") ? \"secondary\" : \"outline\"}\n onClick={() => editor.chain().focus().toggleItalic().run()}\n className=\"border\"\n >\n <ItalicIcon className=\"size-3.5\" />\n </Button>\n\n <Button\n type=\"button\"\n size=\"icon\"\n variant={editor?.isActive(\"underline\") ? \"secondary\" : \"outline\"}\n onClick={() => editor.chain().focus().toggleUnderline().run()}\n className=\"border\"\n >\n <UnderlineIcon className=\"size-3.5\" />\n </Button>\n\n <Button\n type=\"button\"\n size=\"icon\"\n variant={editor?.isActive(\"strike\") ? \"secondary\" : \"outline\"}\n onClick={() => editor.chain().focus().toggleStrike().run()}\n className=\"border\"\n >\n <StrikethroughIcon className=\"size-3.5\" />\n </Button>\n </div>\n\n <Separator orientation=\"vertical\" className=\"h-8\" />\n\n <div className=\"flex items-center gap-1\">\n <Popover>\n <PopoverTrigger asChild>\n <Button size=\"icon\" variant=\"outline\">\n <BaselineIcon className=\"size-3.5\" />\n </Button>\n </PopoverTrigger>\n\n <PopoverContent className=\"w-fit p-0\">\n <ColorPicker onValueChange={(color) => editor.chain().focus().setColor(color).run()} />\n </PopoverContent>\n </Popover>\n\n <Popover>\n <PopoverTrigger asChild>\n <Button size=\"icon\" variant=\"outline\" disabled={!editor?.can().setHighlight()}>\n <PaintBucketIcon className=\"size-3.5\" />\n </Button>\n </PopoverTrigger>\n\n <PopoverContent className=\"w-fit p-0\">\n <ColorPicker\n onValueChange={(color) => editor.chain().focus().setHighlight({ color }).run()}\n />\n </PopoverContent>\n </Popover>\n\n <Button\n type=\"button\"\n size=\"icon\"\n variant=\"outline\"\n className=\"border\"\n onClick={() => {\n editor.commands.unsetColor();\n editor.commands.unsetHighlight();\n }}\n >\n <EraserIcon className=\"h-4 w-4\" />\n </Button>\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;AAmBA,SAAgB,YAAY;CAC1B,MAAM,EAAE,WAAW,WAAW,cAAc;AAE5C,QACE,qBAAC;EAAI,WAAU;;GACb,qBAAC;IAAI,WAAU;eACb,oBAAC;KACC,eAAe,OAAO,SAAS,MAAM;KACrC,UAAU,CAAC,QAAQ,KAAK,CAAC,MAAM;KAC/B,MAAK;KACL,cAAW;KACX,MAAK;KACL,WAAU;KACV,SAAQ;eAER,oBAAC,YAAS,WAAU,aAAa;MAC1B,EAET,oBAAC;KACC,eAAe,OAAO,SAAS,MAAM;KACrC,UAAU,CAAC,QAAQ,KAAK,CAAC,MAAM;KAC/B,MAAK;KACL,cAAW;KACX,MAAK;KACL,WAAU;KACV,SAAQ;eAER,oBAAC,YAAS,WAAU,aAAa;MAC1B;KACL;GAEN,oBAAC;IAAU,aAAY;IAAW,WAAU;KAAQ;GAEpD,oBAAC,kBAAgB;GAEjB,oBAAC;IAAU,aAAY;IAAW,WAAU;KAAQ;GAEpD,qBAAC;IAAI,WAAU;;KACb,oBAAC;MACC,MAAK;MACL,MAAK;MACL,SAAS,QAAQ,SAAS,OAAO,GAAG,cAAc;MAClD,eAAe,OAAO,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,KAAK;MACxD,WAAU;gBAEV,oBAAC,YAAS,WAAU,gBAAgB;OAC7B;KAET,oBAAC;MACC,MAAK;MACL,MAAK;MACL,SAAS,QAAQ,SAAS,SAAS,GAAG,cAAc;MACpD,eAAe,OAAO,OAAO,CAAC,OAAO,CAAC,cAAc,CAAC,KAAK;MAC1D,WAAU;gBAEV,oBAAC,cAAW,WAAU,aAAa;OAC5B;KAET,oBAAC;MACC,MAAK;MACL,MAAK;MACL,SAAS,QAAQ,SAAS,YAAY,GAAG,cAAc;MACvD,eAAe,OAAO,OAAO,CAAC,OAAO,CAAC,iBAAiB,CAAC,KAAK;MAC7D,WAAU;gBAEV,oBAAC,iBAAc,WAAU,aAAa;OAC/B;KAET,oBAAC;MACC,MAAK;MACL,MAAK;MACL,SAAS,QAAQ,SAAS,SAAS,GAAG,cAAc;MACpD,eAAe,OAAO,OAAO,CAAC,OAAO,CAAC,cAAc,CAAC,KAAK;MAC1D,WAAU;gBAEV,oBAAC,qBAAkB,WAAU,aAAa;OACnC;;KACL;GAEN,oBAAC;IAAU,aAAY;IAAW,WAAU;KAAQ;GAEpD,qBAAC;IAAI,WAAU;;KACb,qBAAC,sBACC,oBAAC;MAAe;gBACd,oBAAC;OAAO,MAAK;OAAO,SAAQ;iBAC1B,oBAAC,gBAAa,WAAU,aAAa;QAC9B;OACM,EAEjB,oBAAC;MAAe,WAAU;gBACxB,oBAAC,eAAY,gBAAgB,UAAU,OAAO,OAAO,CAAC,OAAO,CAAC,SAAS,MAAM,CAAC,KAAK,GAAI;OACxE,IACT;KAEV,qBAAC,sBACC,oBAAC;MAAe;gBACd,oBAAC;OAAO,MAAK;OAAO,SAAQ;OAAU,UAAU,CAAC,QAAQ,KAAK,CAAC,cAAc;iBAC3E,oBAAC,mBAAgB,WAAU,aAAa;QACjC;OACM,EAEjB,oBAAC;MAAe,WAAU;gBACxB,oBAAC,eACC,gBAAgB,UAAU,OAAO,OAAO,CAAC,OAAO,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC,KAAK,GAC9E;OACa,IACT;KAEV,oBAAC;MACC,MAAK;MACL,MAAK;MACL,SAAQ;MACR,WAAU;MACV,eAAe;AACb,cAAO,SAAS,YAAY;AAC5B,cAAO,SAAS,gBAAgB;;gBAGlC,oBAAC,cAAW,WAAU,YAAY;OAC3B;;KACL;;GACF"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { EditorJSONContent } from "./lib/types.mjs";
|
|
2
|
-
import * as react_jsx_runtime123 from "react/jsx-runtime";
|
|
3
|
-
import * as react7 from "react";
|
|
4
|
-
import { PropsWithChildren } from "react";
|
|
5
|
-
import { Content, Editor } from "@tiptap/react";
|
|
6
|
-
|
|
7
|
-
//#region src/components/editor/context.client.d.ts
|
|
8
|
-
/**
|
|
9
|
-
* Editor context
|
|
10
|
-
*/
|
|
11
|
-
type EditorContextValue = {
|
|
12
|
-
editor: Editor;
|
|
13
|
-
};
|
|
14
|
-
declare const EditorContext: react7.Context<EditorContextValue>;
|
|
15
|
-
/**
|
|
16
|
-
* Editor context provider
|
|
17
|
-
*/
|
|
18
|
-
type EditorContextProviderProps = PropsWithChildren<{
|
|
19
|
-
value?: Content;
|
|
20
|
-
onChange?: (value: EditorJSONContent) => void;
|
|
21
|
-
disabled?: boolean;
|
|
22
|
-
className?: string;
|
|
23
|
-
}>;
|
|
24
|
-
declare function EditorContextProvider({
|
|
25
|
-
value,
|
|
26
|
-
onChange,
|
|
27
|
-
disabled,
|
|
28
|
-
className,
|
|
29
|
-
children
|
|
30
|
-
}: EditorContextProviderProps): react_jsx_runtime123.JSX.Element | null;
|
|
31
|
-
//#endregion
|
|
32
|
-
export { EditorContext, EditorContextProvider };
|
|
33
|
-
//# sourceMappingURL=context.client.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"context.client.d.mts","names":[],"sources":["../../../src/components/editor/context.client.tsx"],"sourcesContent":[],"mappings":";;;;;;;;;;KAgBK,kBAAA;EAAA,MAAA,EACK,MADL;AAIL,CAAA;AAKK,cALQ,aAKkB,EALL,MAAA,CAAA,OAKK,CALL,kBAKK,CAAA;;;;KAA1B,0BAAA,GAA6B,iBAAiB,CAAA;EAOnC,KAAA,CAAA,EANN,OAMM;EACd,QAAA,CAAA,EAAA,CAAA,KAAA,EANmB,iBAMnB,EAAA,GAAA,IAAA;EACA,QAAA,CAAA,EAAA,OAAA;EACA,SAAA,CAAA,EAAA,MAAA;CACA,CAAA;AACA,iBALc,qBAAA,CAKd;EAAA,KAAA;EAAA,QAAA;EAAA,QAAA;EAAA,SAAA;EAAA;AAAA,CAAA,EACC,0BADD,CAAA,EAC2B,oBAAA,CAAA,GAAA,CAAA,OAAA,GAD3B,IAAA"}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { cn } from "../../lib/utils/cn.mjs";
|
|
4
|
-
import { jsx } from "react/jsx-runtime";
|
|
5
|
-
import { createContext } from "react";
|
|
6
|
-
import StarterKit from "@tiptap/starter-kit";
|
|
7
|
-
import { useEditor } from "@tiptap/react";
|
|
8
|
-
import { Color } from "@tiptap/extension-color";
|
|
9
|
-
import Highlight from "@tiptap/extension-highlight";
|
|
10
|
-
import Link from "@tiptap/extension-link";
|
|
11
|
-
import { TextStyle } from "@tiptap/extension-text-style";
|
|
12
|
-
import Underline from "@tiptap/extension-underline";
|
|
13
|
-
|
|
14
|
-
//#region src/components/editor/context.client.tsx
|
|
15
|
-
const EditorContext = createContext({});
|
|
16
|
-
function EditorContextProvider({ value, onChange, disabled, className, children }) {
|
|
17
|
-
const editor = useEditor({
|
|
18
|
-
extensions: [
|
|
19
|
-
StarterKit,
|
|
20
|
-
Underline,
|
|
21
|
-
Link,
|
|
22
|
-
TextStyle,
|
|
23
|
-
Color,
|
|
24
|
-
Highlight.configure({ multicolor: true })
|
|
25
|
-
],
|
|
26
|
-
content: value,
|
|
27
|
-
onUpdate: ({ editor: editor$1 }) => onChange?.(editor$1.getJSON()),
|
|
28
|
-
editable: !disabled,
|
|
29
|
-
injectCSS: false,
|
|
30
|
-
immediatelyRender: false,
|
|
31
|
-
editorProps: {
|
|
32
|
-
transformPastedHTML: (html) => html.replace(/<img.*?>/g, ""),
|
|
33
|
-
attributes: { class: cn("prose max-w-full min-h-96 dark:prose-invert p-5 focus:outline-none prose-a:text-primary prose-li:marker:text-primary", className) }
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
if (!editor) return null;
|
|
37
|
-
return /* @__PURE__ */ jsx(EditorContext.Provider, {
|
|
38
|
-
value: { editor },
|
|
39
|
-
children
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
//#endregion
|
|
44
|
-
export { EditorContext, EditorContextProvider };
|
|
45
|
-
//# sourceMappingURL=context.client.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"context.client.mjs","names":["editor"],"sources":["../../../src/components/editor/context.client.tsx"],"sourcesContent":["\"use client\";\n\nimport { cn } from \"@/lib/utils/cn\";\nimport { Color } from \"@tiptap/extension-color\";\nimport Highlight from \"@tiptap/extension-highlight\";\nimport Link from \"@tiptap/extension-link\";\nimport { TextStyle } from \"@tiptap/extension-text-style\";\nimport Underline from \"@tiptap/extension-underline\";\nimport { Content, Editor, useEditor } from \"@tiptap/react\";\nimport StarterKit from \"@tiptap/starter-kit\";\nimport { createContext, PropsWithChildren } from \"react\";\nimport { EditorJSONContent } from \"./lib/types\";\n\n/**\n * Editor context\n */\ntype EditorContextValue = {\n editor: Editor;\n};\n\nexport const EditorContext = createContext({} as EditorContextValue);\n\n/**\n * Editor context provider\n */\ntype EditorContextProviderProps = PropsWithChildren<{\n value?: Content;\n onChange?: (value: EditorJSONContent) => void;\n disabled?: boolean;\n className?: string;\n}>;\n\nexport function EditorContextProvider({\n value,\n onChange,\n disabled,\n className,\n children,\n}: EditorContextProviderProps) {\n // const { uploadImage } = useUploadEditor();\n\n const editor = useEditor({\n extensions: [\n StarterKit,\n Underline,\n Link,\n TextStyle,\n Color,\n Highlight.configure({ multicolor: true }),\n // Image.configure({\n // allowBase64: false,\n // }),\n // FileHandler.configure({\n // allowedMimeTypes: [\"image/png\", \"image/jpeg\", \"image/gif\", \"image/webp\"],\n // onDrop: (currentEditor, files, pos) => {\n // files.forEach((file) => {\n // const fileReader = new FileReader();\n\n // fileReader.readAsArrayBuffer(file);\n // fileReader.onload = async () => {\n // const response = await uploadImage(file);\n // if (!response) return;\n\n // currentEditor\n // .chain()\n // .insertContentAt(pos, {\n // type: \"image\",\n // attrs: { src: response.url },\n // })\n // .focus()\n // .run();\n // };\n // });\n // },\n // onPaste: (currentEditor, files) => {\n // files.forEach((file) => {\n // const fileReader = new FileReader();\n\n // fileReader.readAsArrayBuffer(file);\n // fileReader.onload = async () => {\n // const response = await uploadImage(file);\n // if (!response) return;\n\n // currentEditor\n // .chain()\n // .insertContentAt(currentEditor.state.selection.anchor, {\n // type: \"image\",\n // attrs: { src: response.url },\n // })\n // .focus()\n // .run();\n // };\n // });\n // },\n // }),\n ],\n content: value,\n onUpdate: ({ editor }) => onChange?.(editor.getJSON()),\n editable: !disabled,\n injectCSS: false,\n immediatelyRender: false,\n editorProps: {\n transformPastedHTML: (html) => html.replace(/<img.*?>/g, \"\"),\n attributes: {\n class: cn(\n \"prose max-w-full min-h-96 dark:prose-invert p-5 focus:outline-none prose-a:text-primary prose-li:marker:text-primary\",\n className,\n ),\n },\n },\n });\n\n if (!editor) return null;\n\n return <EditorContext.Provider value={{ editor }}>{children}</EditorContext.Provider>;\n}\n"],"mappings":";;;;;;;;;;;;;;AAoBA,MAAa,gBAAgB,cAAc,EAAE,CAAuB;AAYpE,SAAgB,sBAAsB,EACpC,OACA,UACA,UACA,WACA,YAC6B;CAG7B,MAAM,SAAS,UAAU;EACvB,YAAY;GACV;GACA;GACA;GACA;GACA;GACA,UAAU,UAAU,EAAE,YAAY,MAAM,CAAC;GA+C1C;EACD,SAAS;EACT,WAAW,EAAE,uBAAa,WAAWA,SAAO,SAAS,CAAC;EACtD,UAAU,CAAC;EACX,WAAW;EACX,mBAAmB;EACnB,aAAa;GACX,sBAAsB,SAAS,KAAK,QAAQ,aAAa,GAAG;GAC5D,YAAY,EACV,OAAO,GACL,wHACA,UACD,EACF;GACF;EACF,CAAC;AAEF,KAAI,CAAC,OAAQ,QAAO;AAEpB,QAAO,oBAAC,cAAc;EAAS,OAAO,EAAE,QAAQ;EAAG;GAAkC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime124 from "react/jsx-runtime";
|
|
2
|
-
import { HTMLAttributes } from "react";
|
|
3
|
-
|
|
4
|
-
//#region src/components/editor/index.client.d.ts
|
|
5
|
-
declare function Editor({
|
|
6
|
-
className,
|
|
7
|
-
...props
|
|
8
|
-
}: HTMLAttributes<HTMLDivElement>): react_jsx_runtime124.JSX.Element;
|
|
9
|
-
//#endregion
|
|
10
|
-
export { Editor };
|
|
11
|
-
//# sourceMappingURL=index.client.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.client.d.mts","names":[],"sources":["../../../src/components/editor/index.client.tsx"],"sourcesContent":[],"mappings":";;;;iBAKgB,MAAA;;;GAAgC,eAAe,kBAAe,oBAAA,CAAA,GAAA,CAAA"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { cn } from "../../lib/utils/cn.mjs";
|
|
2
|
-
import { EditorContent } from "./components/content.client.mjs";
|
|
3
|
-
import { FixedMenu } from "./components/fixed-menu.client.mjs";
|
|
4
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
-
|
|
6
|
-
//#region src/components/editor/index.client.tsx
|
|
7
|
-
function Editor({ className, ...props }) {
|
|
8
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
9
|
-
className: cn("border-input rounded-lg border", className),
|
|
10
|
-
...props,
|
|
11
|
-
children: [/* @__PURE__ */ jsx(FixedMenu, {}), /* @__PURE__ */ jsx(EditorContent, {})]
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
//#endregion
|
|
16
|
-
export { Editor };
|
|
17
|
-
//# sourceMappingURL=index.client.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.client.mjs","names":[],"sources":["../../../src/components/editor/index.client.tsx"],"sourcesContent":["import { cn } from \"@/lib/utils/cn\";\nimport { type HTMLAttributes } from \"react\";\nimport { EditorContent } from \"./components/content.client\";\nimport { FixedMenu } from \"./components/fixed-menu.client\";\n\nexport function Editor({ className, ...props }: HTMLAttributes<HTMLDivElement>) {\n return (\n <div className={cn(\"border-input rounded-lg border\", className)} {...props}>\n <FixedMenu />\n <EditorContent />\n </div>\n );\n}\n"],"mappings":";;;;;;AAKA,SAAgB,OAAO,EAAE,WAAW,GAAG,SAAyC;AAC9E,QACE,qBAAC;EAAI,WAAW,GAAG,kCAAkC,UAAU;EAAE,GAAI;aACnE,oBAAC,cAAY,EACb,oBAAC,kBAAgB;GACb"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { EditorJSONContent } from "./lib/types.mjs";
|
|
2
|
-
import * as react_jsx_runtime125 from "react/jsx-runtime";
|
|
3
|
-
|
|
4
|
-
//#region src/components/editor/preview.client.d.ts
|
|
5
|
-
declare function EditorPreview({
|
|
6
|
-
value
|
|
7
|
-
}: {
|
|
8
|
-
value?: EditorJSONContent;
|
|
9
|
-
}): react_jsx_runtime125.JSX.Element;
|
|
10
|
-
//#endregion
|
|
11
|
-
export { EditorPreview };
|
|
12
|
-
//# sourceMappingURL=preview.client.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"preview.client.d.mts","names":[],"sources":["../../../src/components/editor/preview.client.tsx"],"sourcesContent":[],"mappings":";;;;iBAMgB,aAAA;;;UAAmC;IAAmB,oBAAA,CAAA,GAAA,CAAA"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { EditorContextProvider } from "./context.client.mjs";
|
|
4
|
-
import { EditorContent } from "./components/content.client.mjs";
|
|
5
|
-
import { jsx } from "react/jsx-runtime";
|
|
6
|
-
|
|
7
|
-
//#region src/components/editor/preview.client.tsx
|
|
8
|
-
function EditorPreview({ value }) {
|
|
9
|
-
return /* @__PURE__ */ jsx(EditorContextProvider, {
|
|
10
|
-
value,
|
|
11
|
-
className: "min-h-0 p-0",
|
|
12
|
-
disabled: true,
|
|
13
|
-
children: /* @__PURE__ */ jsx(EditorContent, {})
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
//#endregion
|
|
18
|
-
export { EditorPreview };
|
|
19
|
-
//# sourceMappingURL=preview.client.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"preview.client.mjs","names":[],"sources":["../../../src/components/editor/preview.client.tsx"],"sourcesContent":["\"use client\";\n\nimport { EditorContent } from \"./components/content.client\";\nimport { EditorContextProvider } from \"./context.client\";\nimport { EditorJSONContent } from \"./lib/types\";\n\nexport function EditorPreview({ value }: { value?: EditorJSONContent }) {\n return (\n <EditorContextProvider value={value} className=\"min-h-0 p-0\" disabled>\n <EditorContent />\n </EditorContextProvider>\n );\n}\n"],"mappings":";;;;;;;AAMA,SAAgB,cAAc,EAAE,SAAwC;AACtE,QACE,oBAAC;EAA6B;EAAO,WAAU;EAAc;YAC3D,oBAAC,kBAAgB;GACK"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import * as _tanstack_react_query0 from "@tanstack/react-query";
|
|
2
|
-
import { DefaultError, MutationOptions } from "@tanstack/react-query";
|
|
3
|
-
|
|
4
|
-
//#region src/modules/commands/hooks/use-command-action.client.d.ts
|
|
5
|
-
type CommandActionResult = Promise<unknown>;
|
|
6
|
-
type CommandAction<TInput = void> = (input: TInput) => CommandActionResult;
|
|
7
|
-
type BulkCommandAction = (params: {
|
|
8
|
-
ids: string[];
|
|
9
|
-
}) => CommandActionResult;
|
|
10
|
-
/**
|
|
11
|
-
* Hook to use command
|
|
12
|
-
* @returns Command context value
|
|
13
|
-
*/
|
|
14
|
-
declare function useCommandAction<TInput = void>(action: CommandAction<TInput>, options?: {
|
|
15
|
-
message?: string;
|
|
16
|
-
onSuccess?: () => Promise<void> | void;
|
|
17
|
-
onError?: () => Promise<void> | void;
|
|
18
|
-
}): (input: TInput) => CommandActionResult;
|
|
19
|
-
declare function useCommandAction2<TData = unknown, TError = DefaultError, TVariables = void, TOnMutateResult = unknown>(options?: MutationOptions<TData, TError, TVariables, TOnMutateResult>): _tanstack_react_query0.UseMutationResult<TData, TError, TVariables, TOnMutateResult>;
|
|
20
|
-
//#endregion
|
|
21
|
-
export { BulkCommandAction, CommandAction, CommandActionResult, useCommandAction, useCommandAction2 };
|
|
22
|
-
//# sourceMappingURL=use-command-action.client.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use-command-action.client.d.mts","names":[],"sources":["../../../../src/modules/commands/hooks/use-command-action.client.tsx"],"sourcesContent":[],"mappings":";;;;KAOY,mBAAA,GAAsB;KAEtB,uCAAuC,WAAW;KAClD,iBAAA;EAHA,GAAA,EAAA,MAAA,EAAA;AAEZ,CAAA,EAAA,GAC+D,mBADtC;AACzB;AAMA;;;AAIsB,iBAJN,gBAIM,CAAA,SAAA,IAAA,CAAA,CAAA,MAAA,EAHZ,aAGY,CAHE,MAGF,CAAA,EAAA,OAmCwC,CAnCxC,EAAA;EACF,OAAA,CAAA,EAAA,MAAA;EAkCY,SAAA,CAAA,EAAA,GAAA,GAnCV,OAmCU,CAAA,IAAA,CAAA,GAAA,IAAA;EAAW,OAAA,CAAA,EAAA,GAAA,GAlCvB,OAkCuB,CAAA,IAAA,CAAA,GAAA,IAAA;CAAmB,CAAA,EAAA,CAAA,KAAA,EAA9B,MAA8B,EAAA,GAAnB,mBAAmB;AAG9C,iBAAA,iBAAiB,CAAA,QAAA,OAAA,EAAA,SAEtB,YAFsB,EAAA,aAAA,IAAA,EAAA,kBAAA,OAAA,CAAA,CAAA,OAAA,CAAA,EAKrB,eALqB,CAKL,KALK,EAKE,MALF,EAKU,UALV,EAKsB,eALtB,CAAA,CAAA,EAKsC,sBAAA,CAAA,iBALtC,CAKsC,KALtC,EAKsC,MALtC,EAKsC,UALtC,EAKsC,eALtC,CAAA"}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { useCommand } from "./context.client.mjs";
|
|
4
|
-
import { useAction } from "../../../lib/hooks/use-action.mjs";
|
|
5
|
-
import { toast } from "sonner";
|
|
6
|
-
|
|
7
|
-
//#region src/modules/commands/hooks/use-command-action.client.tsx
|
|
8
|
-
/**
|
|
9
|
-
* Hook to use command
|
|
10
|
-
* @returns Command context value
|
|
11
|
-
*/
|
|
12
|
-
function useCommandAction(action, options) {
|
|
13
|
-
const commandContext = useCommand();
|
|
14
|
-
const { mutateAsync } = useAction({
|
|
15
|
-
mutationFn: action,
|
|
16
|
-
onMutate: () => {
|
|
17
|
-
commandContext.setStatus("pending");
|
|
18
|
-
},
|
|
19
|
-
onSuccess: async () => {
|
|
20
|
-
commandContext.setStatus("success");
|
|
21
|
-
toast.success(options?.message || "Actie voltooid!");
|
|
22
|
-
await options?.onSuccess?.();
|
|
23
|
-
await commandContext.onSuccess?.();
|
|
24
|
-
},
|
|
25
|
-
onRedirect: async () => {
|
|
26
|
-
commandContext.setStatus("success");
|
|
27
|
-
toast.success(options?.message || "Actie voltooid!");
|
|
28
|
-
await options?.onSuccess?.();
|
|
29
|
-
await commandContext.onSuccess?.();
|
|
30
|
-
},
|
|
31
|
-
onError: async () => {
|
|
32
|
-
commandContext.setStatus("error");
|
|
33
|
-
await options?.onError?.();
|
|
34
|
-
await commandContext.onError?.();
|
|
35
|
-
},
|
|
36
|
-
onSettled: () => {
|
|
37
|
-
commandContext.setStatus("idle");
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
return mutateAsync;
|
|
41
|
-
}
|
|
42
|
-
function useCommandAction2(options) {
|
|
43
|
-
const commandContext = useCommand();
|
|
44
|
-
return useAction({
|
|
45
|
-
...options,
|
|
46
|
-
mutationFn: options?.mutationFn,
|
|
47
|
-
onMutate: async (...params) => {
|
|
48
|
-
const result = options?.onMutate?.(...params);
|
|
49
|
-
commandContext.setStatus("pending");
|
|
50
|
-
return await result;
|
|
51
|
-
},
|
|
52
|
-
onSuccess: async (...params) => {
|
|
53
|
-
const result = options?.onSuccess?.(...params);
|
|
54
|
-
commandContext.setStatus("success");
|
|
55
|
-
await commandContext.onSuccess?.();
|
|
56
|
-
return await result;
|
|
57
|
-
},
|
|
58
|
-
onError: async (...params) => {
|
|
59
|
-
const result = options?.onError?.(...params);
|
|
60
|
-
commandContext.setStatus("error");
|
|
61
|
-
await commandContext.onError?.();
|
|
62
|
-
return await result;
|
|
63
|
-
},
|
|
64
|
-
onSettled: async (...params) => {
|
|
65
|
-
const result = options?.onSettled?.(...params);
|
|
66
|
-
commandContext.setStatus("idle");
|
|
67
|
-
return await result;
|
|
68
|
-
}
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
//#endregion
|
|
73
|
-
export { useCommandAction, useCommandAction2 };
|
|
74
|
-
//# sourceMappingURL=use-command-action.client.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use-command-action.client.mjs","names":[],"sources":["../../../../src/modules/commands/hooks/use-command-action.client.tsx"],"sourcesContent":["\"use client\";\n\nimport { useAction } from \"@/lib/hooks/use-action\";\nimport type { DefaultError, MutationFunction, MutationOptions } from \"@tanstack/react-query\";\nimport { toast } from \"sonner\";\nimport { useCommand } from \"./context.client\";\n\nexport type CommandActionResult = Promise<unknown>;\n\nexport type CommandAction<TInput = void> = (input: TInput) => CommandActionResult;\nexport type BulkCommandAction = (params: { ids: string[] }) => CommandActionResult;\n\n/**\n * Hook to use command\n * @returns Command context value\n */\nexport function useCommandAction<TInput = void>(\n action: CommandAction<TInput>,\n options?: {\n message?: string;\n onSuccess?: () => Promise<void> | void;\n onError?: () => Promise<void> | void;\n },\n) {\n const commandContext = useCommand();\n\n const { mutateAsync } = useAction({\n mutationFn: action,\n onMutate: () => {\n commandContext.setStatus(\"pending\");\n },\n onSuccess: async () => {\n commandContext.setStatus(\"success\");\n toast.success(options?.message || \"Actie voltooid!\");\n await options?.onSuccess?.();\n await commandContext.onSuccess?.();\n },\n onRedirect: async () => {\n commandContext.setStatus(\"success\");\n toast.success(options?.message || \"Actie voltooid!\");\n await options?.onSuccess?.();\n await commandContext.onSuccess?.();\n },\n onError: async () => {\n commandContext.setStatus(\"error\");\n await options?.onError?.();\n await commandContext.onError?.();\n },\n onSettled: () => {\n commandContext.setStatus(\"idle\");\n // finnalyCallback?.();\n // options?.callback?.();\n },\n });\n\n return mutateAsync as (input: TInput) => CommandActionResult;\n}\n\nexport function useCommandAction2<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n>(options?: MutationOptions<TData, TError, TVariables, TOnMutateResult>) {\n const commandContext = useCommand();\n\n const mutation = useAction({\n ...options,\n mutationFn: options?.mutationFn as MutationFunction<TData, TVariables>,\n onMutate: async (...params) => {\n const result = options?.onMutate?.(...params);\n\n commandContext.setStatus(\"pending\");\n\n return (await result) as TOnMutateResult;\n },\n onSuccess: async (...params) => {\n const result = options?.onSuccess?.(...params);\n\n commandContext.setStatus(\"success\");\n await commandContext.onSuccess?.();\n\n return await result;\n },\n onError: async (...params) => {\n const result = options?.onError?.(...params);\n\n commandContext.setStatus(\"error\");\n await commandContext.onError?.();\n\n return await result;\n },\n onSettled: async (...params) => {\n const result = options?.onSettled?.(...params);\n\n commandContext.setStatus(\"idle\");\n\n return await result;\n },\n });\n\n return mutation;\n}\n"],"mappings":";;;;;;;;;;;AAgBA,SAAgB,iBACd,QACA,SAKA;CACA,MAAM,iBAAiB,YAAY;CAEnC,MAAM,EAAE,gBAAgB,UAAU;EAChC,YAAY;EACZ,gBAAgB;AACd,kBAAe,UAAU,UAAU;;EAErC,WAAW,YAAY;AACrB,kBAAe,UAAU,UAAU;AACnC,SAAM,QAAQ,SAAS,WAAW,kBAAkB;AACpD,SAAM,SAAS,aAAa;AAC5B,SAAM,eAAe,aAAa;;EAEpC,YAAY,YAAY;AACtB,kBAAe,UAAU,UAAU;AACnC,SAAM,QAAQ,SAAS,WAAW,kBAAkB;AACpD,SAAM,SAAS,aAAa;AAC5B,SAAM,eAAe,aAAa;;EAEpC,SAAS,YAAY;AACnB,kBAAe,UAAU,QAAQ;AACjC,SAAM,SAAS,WAAW;AAC1B,SAAM,eAAe,WAAW;;EAElC,iBAAiB;AACf,kBAAe,UAAU,OAAO;;EAInC,CAAC;AAEF,QAAO;;AAGT,SAAgB,kBAKd,SAAuE;CACvE,MAAM,iBAAiB,YAAY;AAqCnC,QAnCiB,UAAU;EACzB,GAAG;EACH,YAAY,SAAS;EACrB,UAAU,OAAO,GAAG,WAAW;GAC7B,MAAM,SAAS,SAAS,WAAW,GAAG,OAAO;AAE7C,kBAAe,UAAU,UAAU;AAEnC,UAAQ,MAAM;;EAEhB,WAAW,OAAO,GAAG,WAAW;GAC9B,MAAM,SAAS,SAAS,YAAY,GAAG,OAAO;AAE9C,kBAAe,UAAU,UAAU;AACnC,SAAM,eAAe,aAAa;AAElC,UAAO,MAAM;;EAEf,SAAS,OAAO,GAAG,WAAW;GAC5B,MAAM,SAAS,SAAS,UAAU,GAAG,OAAO;AAE5C,kBAAe,UAAU,QAAQ;AACjC,SAAM,eAAe,WAAW;AAEhC,UAAO,MAAM;;EAEf,WAAW,OAAO,GAAG,WAAW;GAC9B,MAAM,SAAS,SAAS,YAAY,GAAG,OAAO;AAE9C,kBAAe,UAAU,OAAO;AAEhC,UAAO,MAAM;;EAEhB,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import "server-cli-only";
|
|
2
|
-
import { S3Client, S3ClientConfig } from "@aws-sdk/client-s3";
|
|
3
|
-
|
|
4
|
-
//#region src/modules/config/providers/blob.d.ts
|
|
5
|
-
type InitBlobProviderProps = S3ClientConfig;
|
|
6
|
-
declare function initBlobProvider(props: InitBlobProviderProps): S3Client;
|
|
7
|
-
type BlobClient = ReturnType<typeof initBlobProvider>;
|
|
8
|
-
//#endregion
|
|
9
|
-
export { BlobClient, initBlobProvider };
|
|
10
|
-
//# sourceMappingURL=blob.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"blob.d.mts","names":[],"sources":["../../../../src/modules/config/providers/blob.ts"],"sourcesContent":[],"mappings":";;;;KAIK,qBAAA,GAAwB;iBAEb,gBAAA,QAAwB,wBAAqB;AAFxD,KAMO,UAAA,GAAa,UANC,CAAA,OAMiB,gBANA,CAAA"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import "server-cli-only";
|
|
2
|
-
import { S3Client } from "@aws-sdk/client-s3";
|
|
3
|
-
|
|
4
|
-
//#region src/modules/config/providers/blob.ts
|
|
5
|
-
function initBlobProvider(props) {
|
|
6
|
-
return new S3Client(props);
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
//#endregion
|
|
10
|
-
export { initBlobProvider };
|
|
11
|
-
//# sourceMappingURL=blob.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"blob.mjs","names":[],"sources":["../../../../src/modules/config/providers/blob.ts"],"sourcesContent":["import \"server-cli-only\";\n\nimport { S3Client, S3ClientConfig } from \"@aws-sdk/client-s3\";\n\ntype InitBlobProviderProps = S3ClientConfig;\n\nexport function initBlobProvider(props: InitBlobProviderProps) {\n return new S3Client(props);\n}\n\nexport type BlobClient = ReturnType<typeof initBlobProvider>;\n"],"mappings":";;;;AAMA,SAAgB,iBAAiB,OAA8B;AAC7D,QAAO,IAAI,SAAS,MAAM"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { Input } from "../../../components/ui/input.mjs";
|
|
2
|
-
import { useInlineEditOptions } from "../hooks/use-inline.client.mjs";
|
|
3
|
-
import * as react_jsx_runtime25 from "react/jsx-runtime";
|
|
4
|
-
import { ComponentProps } from "react";
|
|
5
|
-
|
|
6
|
-
//#region src/modules/inline-edit/components/richtext.client.d.ts
|
|
7
|
-
declare function InlineRichtext({
|
|
8
|
-
initialValue,
|
|
9
|
-
action,
|
|
10
|
-
disabled,
|
|
11
|
-
...props
|
|
12
|
-
}: Omit<ComponentProps<typeof Input>, "type"> & useInlineEditOptions<string>): react_jsx_runtime25.JSX.Element;
|
|
13
|
-
//#endregion
|
|
14
|
-
export { InlineRichtext };
|
|
15
|
-
//# sourceMappingURL=richtext.client.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"richtext.client.d.mts","names":[],"sources":["../../../../src/modules/inline-edit/components/richtext.client.tsx"],"sourcesContent":[],"mappings":";;;;;;iBASgB,cAAA;;;;;GAKb,KAAK,sBAAsB,kBAAkB,+BAA4B,mBAAA,CAAA,GAAA,CAAA"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { EditorContextProvider } from "../../../components/editor/context.client.mjs";
|
|
4
|
-
import { Editor } from "../../../components/editor/index.client.mjs";
|
|
5
|
-
import { useInlineEdit } from "../hooks/use-inline.client.mjs";
|
|
6
|
-
import { jsx } from "react/jsx-runtime";
|
|
7
|
-
import { useEffect } from "react";
|
|
8
|
-
import { useDebounce } from "use-debounce";
|
|
9
|
-
|
|
10
|
-
//#region src/modules/inline-edit/components/richtext.client.tsx
|
|
11
|
-
function InlineRichtext({ initialValue, action, disabled, ...props }) {
|
|
12
|
-
const { value, setValue, handleUpdate } = useInlineEdit({
|
|
13
|
-
initialValue,
|
|
14
|
-
action
|
|
15
|
-
});
|
|
16
|
-
const [debouncedValue] = useDebounce(value, 500);
|
|
17
|
-
useEffect(() => {
|
|
18
|
-
if (!value) return;
|
|
19
|
-
handleUpdate(value);
|
|
20
|
-
}, [debouncedValue]);
|
|
21
|
-
return /* @__PURE__ */ jsx(EditorContextProvider, {
|
|
22
|
-
value: value ? JSON.parse(value) : void 0,
|
|
23
|
-
onChange: (value$1) => setValue(JSON.stringify(value$1)),
|
|
24
|
-
disabled,
|
|
25
|
-
children: /* @__PURE__ */ jsx(Editor, { ...props })
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
//#endregion
|
|
30
|
-
export { InlineRichtext };
|
|
31
|
-
//# sourceMappingURL=richtext.client.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"richtext.client.mjs","names":["value"],"sources":["../../../../src/modules/inline-edit/components/richtext.client.tsx"],"sourcesContent":["\"use client\";\n\nimport { EditorContextProvider } from \"@/components/editor/context.client\";\nimport { Editor } from \"@/components/editor/index.client\";\nimport { Input } from \"@/components/ui/input\";\nimport { ComponentProps, useEffect } from \"react\";\nimport { useDebounce } from \"use-debounce\";\nimport { useInlineEdit, type useInlineEditOptions } from \"../hooks/use-inline.client\";\n\nexport function InlineRichtext({\n initialValue,\n action,\n disabled,\n ...props\n}: Omit<ComponentProps<typeof Input>, \"type\"> & useInlineEditOptions<string>) {\n const { value, setValue, handleUpdate } = useInlineEdit<string>({\n initialValue,\n action,\n });\n\n const [debouncedValue] = useDebounce(value, 500);\n\n useEffect(() => {\n if (!value) return;\n handleUpdate(value);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [debouncedValue]);\n\n return (\n <EditorContextProvider\n value={value ? JSON.parse(value) : undefined}\n onChange={(value) => setValue(JSON.stringify(value))}\n disabled={disabled}\n >\n <Editor {...props} />\n </EditorContextProvider>\n );\n}\n"],"mappings":";;;;;;;;;;AASA,SAAgB,eAAe,EAC7B,cACA,QACA,UACA,GAAG,SACyE;CAC5E,MAAM,EAAE,OAAO,UAAU,iBAAiB,cAAsB;EAC9D;EACA;EACD,CAAC;CAEF,MAAM,CAAC,kBAAkB,YAAY,OAAO,IAAI;AAEhD,iBAAgB;AACd,MAAI,CAAC,MAAO;AACZ,eAAa,MAAM;IAElB,CAAC,eAAe,CAAC;AAEpB,QACE,oBAAC;EACC,OAAO,QAAQ,KAAK,MAAM,MAAM,GAAG;EACnC,WAAW,YAAU,SAAS,KAAK,UAAUA,QAAM,CAAC;EAC1C;YAEV,oBAAC,UAAO,GAAI,QAAS;GACC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { Button } from "../../../components/ui/button.mjs";
|
|
2
|
-
import * as react_jsx_runtime3 from "react/jsx-runtime";
|
|
3
|
-
import { ComponentProps } from "react";
|
|
4
|
-
|
|
5
|
-
//#region src/modules/uploads/components/button.client.d.ts
|
|
6
|
-
declare function UploadButton({
|
|
7
|
-
className,
|
|
8
|
-
...props
|
|
9
|
-
}: ComponentProps<typeof Button>): react_jsx_runtime3.JSX.Element;
|
|
10
|
-
//#endregion
|
|
11
|
-
export { UploadButton };
|
|
12
|
-
//# sourceMappingURL=button.client.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"button.client.d.mts","names":[],"sources":["../../../../src/modules/uploads/components/button.client.tsx"],"sourcesContent":[],"mappings":";;;;;iBASgB,YAAA;;;GAAsC,sBAAsB,UAAO,kBAAA,CAAA,GAAA,CAAA"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { cn } from "../../../lib/utils/cn.mjs";
|
|
4
|
-
import { Button } from "../../../components/ui/button.mjs";
|
|
5
|
-
import { Input } from "../../../components/ui/input.mjs";
|
|
6
|
-
import { useUploadZone } from "../hooks/use-upload-zone.client.mjs";
|
|
7
|
-
import { UploadIcon } from "lucide-react";
|
|
8
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
-
|
|
10
|
-
//#region src/modules/uploads/components/button.client.tsx
|
|
11
|
-
function UploadButton({ className, ...props }) {
|
|
12
|
-
const { onUpload } = useUploadZone();
|
|
13
|
-
return /* @__PURE__ */ jsxs(Button, {
|
|
14
|
-
...props,
|
|
15
|
-
className: cn("relative gap-2", className),
|
|
16
|
-
children: [
|
|
17
|
-
/* @__PURE__ */ jsx(UploadIcon, { className: "h-3 w-3" }),
|
|
18
|
-
/* @__PURE__ */ jsx("span", { children: "Upload" }),
|
|
19
|
-
/* @__PURE__ */ jsx(Input, {
|
|
20
|
-
type: "file",
|
|
21
|
-
className: "absolute inset-0 z-10 h-full w-full cursor-pointer opacity-0",
|
|
22
|
-
multiple: true,
|
|
23
|
-
onChange: (e) => {
|
|
24
|
-
if (!e.target.files) return;
|
|
25
|
-
Array.from(e.target.files).forEach(onUpload);
|
|
26
|
-
}
|
|
27
|
-
})
|
|
28
|
-
]
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
//#endregion
|
|
33
|
-
export { UploadButton };
|
|
34
|
-
//# sourceMappingURL=button.client.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"button.client.mjs","names":[],"sources":["../../../../src/modules/uploads/components/button.client.tsx"],"sourcesContent":["\"use client\";\n\nimport { Button } from \"@/components/ui/button\";\nimport { Input } from \"@/components/ui/input\";\nimport { cn } from \"@/lib/utils/cn\";\nimport { UploadIcon } from \"lucide-react\";\nimport { ComponentProps } from \"react\";\nimport { useUploadZone } from \"../hooks/use-upload-zone.client\";\n\nexport function UploadButton({ className, ...props }: ComponentProps<typeof Button>) {\n const { onUpload } = useUploadZone();\n\n return (\n <Button {...props} className={cn(\"relative gap-2\", className)}>\n <UploadIcon className=\"h-3 w-3\" />\n <span>Upload</span>\n\n <Input\n type=\"file\"\n className=\"absolute inset-0 z-10 h-full w-full cursor-pointer opacity-0\"\n multiple\n onChange={(e) => {\n if (!e.target.files) return;\n Array.from(e.target.files).forEach(onUpload);\n }}\n />\n </Button>\n );\n}\n"],"mappings":";;;;;;;;;;AASA,SAAgB,aAAa,EAAE,WAAW,GAAG,SAAwC;CACnF,MAAM,EAAE,aAAa,eAAe;AAEpC,QACE,qBAAC;EAAO,GAAI;EAAO,WAAW,GAAG,kBAAkB,UAAU;;GAC3D,oBAAC,cAAW,WAAU,YAAY;GAClC,oBAAC,oBAAK,WAAa;GAEnB,oBAAC;IACC,MAAK;IACL,WAAU;IACV;IACA,WAAW,MAAM;AACf,SAAI,CAAC,EAAE,OAAO,MAAO;AACrB,WAAM,KAAK,EAAE,OAAO,MAAM,CAAC,QAAQ,SAAS;;KAE9C;;GACK"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.mts","names":[],"sources":["../../../../../src/modules/uploads/components/dropzone/context.tsx"],"sourcesContent":[],"mappings":";;;;KAKK,mBAAA;QACG;WACG;EAFN,OAAA,CAAA,EAGO,eAHY,CAAA,SAAA,CAAA;EAChB,OAAA,CAAA,EAGI,eAHJ,CAAA,SAAA,CAAA;EACG,QAAA,CAAA,EAGE,eAHF,CAAA,UAAA,CAAA;CACC;AACA,cAIC,eAJD,EAIgB,MAAA,CAAA,OAJhB,CAIgB,mBAJhB,GAAA,SAAA,CAAA;;;AAIZ;AAKgB,iBAAA,kBAAA,CAAA,CAAkB,EAAA,mBAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"context.mjs","names":[],"sources":["../../../../../src/modules/uploads/components/dropzone/context.tsx"],"sourcesContent":["\"use client\";\n\nimport { createContext, use } from \"react\";\nimport { DropzoneOptions } from \"react-dropzone\";\n\ntype DropzoneContextType = {\n src?: File[];\n accept?: DropzoneOptions[\"accept\"];\n maxSize?: DropzoneOptions[\"maxSize\"];\n minSize?: DropzoneOptions[\"minSize\"];\n maxFiles?: DropzoneOptions[\"maxFiles\"];\n};\n\nexport const DropzoneContext = createContext<DropzoneContextType | undefined>(undefined);\n\n/**\n * Dropzone context hook\n */\nexport function useDropzoneContext() {\n const context = use(DropzoneContext);\n if (!context) throw new Error(\"useDropzoneContext must be used within a Dropzone\");\n return context;\n}\n"],"mappings":";;;;;AAaA,MAAa,kBAAkB,cAA+C,OAAU;;;;AAKxF,SAAgB,qBAAqB;CACnC,MAAM,UAAU,IAAI,gBAAgB;AACpC,KAAI,CAAC,QAAS,OAAM,IAAI,MAAM,oDAAoD;AAClF,QAAO"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../../../../../src/modules/uploads/components/dropzone/index.tsx"],"sourcesContent":[],"mappings":";;;;;;;;;KAcY,aAAA,GAAgB,KAAK;EAArB,GAAA,CAAA,EACJ,IADI,EAAA;EAAqB,SAAA,CAAA,EAAA,MAAA;EAAL,MAAA,CAAA,EAAA,CAAA,aAAA,EAGD,IAHC,EAAA,EAAA,cAAA,EAGuB,aAHvB,EAAA,EAAA,KAAA,EAG+C,SAH/C,EAAA,GAAA,IAAA;EACpB,QAAA,CAAA,EAGK,SAHL;CAEmB;AAAwB,iBAInC,QAAA,CAJmC;EAAA,MAAA;EAAA,QAAA;EAAA,OAAA;EAAA,OAAA;EAAA,MAAA;EAAA,OAAA;EAAA,QAAA;EAAA,GAAA;EAAA,SAAA;EAAA,QAAA;EAAA,GAAA;AAAA,CAAA,EAgBhD,aAhBgD,CAAA,EAgBnC,kBAAA,CAAA,GAAA,CAAA,OAhBmC;;;;AAInC,KAsDJ,oBAAA,GAtDY;EACtB,QAAA,CAAA,EAsDW,SAtDX;EACA,SAAA,CAAA,EAAA,MAAA;CACA;AACA,iBAyDc,eAAA,CAzDd;EAAA,QAAA;EAAA;AAAA,CAAA,EAyDuD,oBAzDvD,CAAA,EAAA,MAAA,GAAA,MAAA,GAAA,MAAA,GAAA,IAAA,GAyD2E,QAzD3E,CAyD2E,SAzD3E,CAAA,GAyD2E,OAzD3E,CAAA,MAAA,GAAA,MAAA,GAAA,MAAA,GAAA,OAAA,GAyD2E,MAAA,CAAA,WAAA,GAAA,MAAA,CAAA,YAzD3E,CAAA,OAAA,EAAA,MAAA,GAyD2E,MAAA,CAAA,qBAzD3E,CAAA,GAAA,CAAA,CAAA,GAyD2E,QAzD3E,CAyD2E,SAzD3E,CAAA,GAAA,IAAA,GAAA,SAAA,CAAA,GAyD2E,kBAAA,CAAA,GAAA,CAAA,OAAA,GAzD3E,IAAA;;;;AAIA,KAmFU,uBAAA,GAnFV;EACA,QAAA,CAAA,EAmFW,SAnFX;EACA,SAAA,CAAA,EAAA,MAAA;CAEC;AAAa,iBAoFA,kBAAA,CApFA;EAAA,QAAA;EAAA;AAAA,CAAA,EAoF4C,uBApF5C,CAAA,EAAA,MAAA,GAAA,MAAA,GAAA,MAAA,GAAA,IAAA,GAoFmE,QApFnE,CAoFmE,SApFnE,CAAA,GAoFmE,OApFnE,CAAA,MAAA,GAAA,MAAA,GAAA,MAAA,GAAA,OAAA,GAoFmE,MAAA,CAAA,WAAA,GAAA,MAAA,CAAA,YApFnE,CAAA,OAAA,EAAA,MAAA,GAoFmE,MAAA,CAAA,qBApFnE,CAAA,GAAA,CAAA,CAAA,GAoFmE,QApFnE,CAoFmE,SApFnE,CAAA,GAAA,IAAA,GAAA,SAAA,CAAA,GAoFmE,kBAAA,CAAA,GAAA,CAAA,OAAA,GApFnE,IAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../../../../../src/modules/uploads/components/dropzone/index.tsx"],"sourcesContent":["\"use client\";\n\nimport { Button } from \"@/components/ui/button\";\nimport { cn } from \"@/lib/utils/cn\";\nimport { UploadIcon } from \"lucide-react\";\nimport type { ReactNode } from \"react\";\nimport type { DropEvent, DropzoneOptions, FileRejection } from \"react-dropzone\";\nimport { useDropzone } from \"react-dropzone\";\nimport { renderBytes } from \"../../lib/helpers\";\nimport { DropzoneContext, useDropzoneContext } from \"./context\";\n\n/**\n * Dropzone\n */\nexport type DropzoneProps = Omit<DropzoneOptions, \"onDrop\"> & {\n src?: File[];\n className?: string;\n onDrop?: (acceptedFiles: File[], fileRejections: FileRejection[], event: DropEvent) => void;\n children?: ReactNode;\n};\n\nexport function Dropzone({\n accept,\n maxFiles = 1,\n maxSize,\n minSize,\n onDrop,\n onError,\n disabled,\n src,\n className,\n children,\n ...props\n}: DropzoneProps) {\n const { getRootProps, getInputProps, isDragActive } = useDropzone({\n accept,\n maxFiles,\n maxSize,\n minSize,\n onError,\n disabled,\n onDrop: (acceptedFiles, fileRejections, event) => {\n if (fileRejections.length > 0) {\n const message = fileRejections.at(0)?.errors.at(0)?.message;\n onError?.(new Error(message));\n return;\n }\n onDrop?.(acceptedFiles, fileRejections, event);\n },\n ...props,\n });\n\n return (\n <DropzoneContext key={JSON.stringify(src)} value={{ src, accept, maxSize, minSize, maxFiles }}>\n <Button\n className={cn(\n \"relative h-auto w-full flex-col overflow-hidden p-8\",\n isDragActive && \"ring-ring outline-none ring-1\",\n className,\n )}\n disabled={disabled}\n type=\"button\"\n variant=\"outline\"\n {...getRootProps()}\n >\n <input {...getInputProps()} disabled={disabled} />\n {children}\n </Button>\n </DropzoneContext>\n );\n}\n\n/**\n * DropzoneContent\n */\nexport type DropzoneContentProps = {\n children?: ReactNode;\n className?: string;\n};\n\nconst maxLabelItems = 3;\n\nexport function DropzoneContent({ children, className }: DropzoneContentProps) {\n const { src } = useDropzoneContext();\n if (!src) return null;\n\n if (children) return children;\n\n return (\n <div className={cn(\"flex flex-col items-center justify-center\", className)}>\n <div className=\"bg-muted text-muted-foreground flex size-8 items-center justify-center rounded-md\">\n <UploadIcon size={16} />\n </div>\n\n <p className=\"my-2 w-full truncate text-sm font-medium\">\n {src.length > maxLabelItems\n ? `${new Intl.ListFormat(\"en\").format(\n src.slice(0, maxLabelItems).map((file) => file.name),\n )} and ${src.length - maxLabelItems} more`\n : new Intl.ListFormat(\"en\").format(src.map((file) => file.name))}\n </p>\n\n <p className=\"text-muted-foreground w-full text-wrap text-xs\">\n Drag and drop or click to replace\n </p>\n </div>\n );\n}\n\n/**\n * DropzoneEmptyState\n */\nexport type DropzoneEmptyStateProps = {\n children?: ReactNode;\n className?: string;\n};\n\nexport function DropzoneEmptyState({ children, className }: DropzoneEmptyStateProps) {\n const { src, accept, maxSize, minSize, maxFiles } = useDropzoneContext();\n if (src) {\n return null;\n }\n if (children) {\n return children;\n }\n let caption = \"\";\n if (accept) {\n caption += \"Accepts \";\n caption += new Intl.ListFormat(\"en\").format(Object.keys(accept));\n }\n if (minSize && maxSize) {\n caption += ` between ${renderBytes(minSize)} and ${renderBytes(maxSize)}`;\n } else if (minSize) {\n caption += ` at least ${renderBytes(minSize)}`;\n } else if (maxSize) {\n caption += ` less than ${renderBytes(maxSize)}`;\n }\n return (\n <div className={cn(\"flex flex-col items-center justify-center\", className)}>\n <div className=\"bg-muted text-muted-foreground flex size-8 items-center justify-center rounded-md\">\n <UploadIcon size={16} />\n </div>\n <p className=\"my-2 w-full truncate text-wrap text-sm font-medium\">\n Upload {maxFiles === 1 ? \"a file\" : \"files\"}\n </p>\n <p className=\"text-muted-foreground w-full truncate text-wrap text-xs\">\n Drag and drop or click to upload\n </p>\n {caption && <p className=\"text-muted-foreground text-wrap text-xs\">{caption}.</p>}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;AAqBA,SAAgB,SAAS,EACvB,QACA,WAAW,GACX,SACA,SACA,QACA,SACA,UACA,KACA,WACA,UACA,GAAG,SACa;CAChB,MAAM,EAAE,cAAc,eAAe,iBAAiB,YAAY;EAChE;EACA;EACA;EACA;EACA;EACA;EACA,SAAS,eAAe,gBAAgB,UAAU;AAChD,OAAI,eAAe,SAAS,GAAG;IAC7B,MAAM,UAAU,eAAe,GAAG,EAAE,EAAE,OAAO,GAAG,EAAE,EAAE;AACpD,cAAU,IAAI,MAAM,QAAQ,CAAC;AAC7B;;AAEF,YAAS,eAAe,gBAAgB,MAAM;;EAEhD,GAAG;EACJ,CAAC;AAEF,QACE,oBAAC;EAA0C,OAAO;GAAE;GAAK;GAAQ;GAAS;GAAS;GAAU;YAC3F,qBAAC;GACC,WAAW,GACT,uDACA,gBAAgB,iCAChB,UACD;GACS;GACV,MAAK;GACL,SAAQ;GACR,GAAI,cAAc;cAElB,oBAAC;IAAM,GAAI,eAAe;IAAY;KAAY,EACjD;IACM;IAdW,KAAK,UAAU,IAAI,CAevB;;AAYtB,MAAM,gBAAgB;AAEtB,SAAgB,gBAAgB,EAAE,UAAU,aAAmC;CAC7E,MAAM,EAAE,QAAQ,oBAAoB;AACpC,KAAI,CAAC,IAAK,QAAO;AAEjB,KAAI,SAAU,QAAO;AAErB,QACE,qBAAC;EAAI,WAAW,GAAG,6CAA6C,UAAU;;GACxE,oBAAC;IAAI,WAAU;cACb,oBAAC,cAAW,MAAM,KAAM;KACpB;GAEN,oBAAC;IAAE,WAAU;cACV,IAAI,SAAS,gBACV,GAAG,IAAI,KAAK,WAAW,KAAK,CAAC,OAC3B,IAAI,MAAM,GAAG,cAAc,CAAC,KAAK,SAAS,KAAK,KAAK,CACrD,CAAC,OAAO,IAAI,SAAS,cAAc,SACpC,IAAI,KAAK,WAAW,KAAK,CAAC,OAAO,IAAI,KAAK,SAAS,KAAK,KAAK,CAAC;KAChE;GAEJ,oBAAC;IAAE,WAAU;cAAiD;KAE1D;;GACA;;AAYV,SAAgB,mBAAmB,EAAE,UAAU,aAAsC;CACnF,MAAM,EAAE,KAAK,QAAQ,SAAS,SAAS,aAAa,oBAAoB;AACxE,KAAI,IACF,QAAO;AAET,KAAI,SACF,QAAO;CAET,IAAI,UAAU;AACd,KAAI,QAAQ;AACV,aAAW;AACX,aAAW,IAAI,KAAK,WAAW,KAAK,CAAC,OAAO,OAAO,KAAK,OAAO,CAAC;;AAElE,KAAI,WAAW,QACb,YAAW,YAAY,YAAY,QAAQ,CAAC,OAAO,YAAY,QAAQ;UAC9D,QACT,YAAW,aAAa,YAAY,QAAQ;UACnC,QACT,YAAW,cAAc,YAAY,QAAQ;AAE/C,QACE,qBAAC;EAAI,WAAW,GAAG,6CAA6C,UAAU;;GACxE,oBAAC;IAAI,WAAU;cACb,oBAAC,cAAW,MAAM,KAAM;KACpB;GACN,qBAAC;IAAE,WAAU;eAAqD,WACxD,aAAa,IAAI,WAAW;KAClC;GACJ,oBAAC;IAAE,WAAU;cAA0D;KAEnE;GACH,WAAW,qBAAC;IAAE,WAAU;eAA2C,SAAQ;KAAK;;GAC7E"}
|