@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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validators.mjs","names":["z"],"sources":["../../../../src/modules/storage/lib/validators.ts"],"sourcesContent":["import { tableQuerySchema } from \"@/modules/data-tables/entry\";\nimport { resolveFiltersSchema } from \"@/modules/data-tables/lib/filters/resolvers\";\nimport { PutObjectCommandInput } from \"@aws-sdk/client-s3\";\nimport { createInsertSchema, createSelectSchema, createUpdateSchema } from \"drizzle-zod\";\nimport { z } from \"zod\";\nimport { nodesTableFilters } from \"../config/filters\";\nimport { imageDispositions, imageVariants } from \"./constants\";\nimport { nodeModeEnum, nodes } from \"./schema\";\n\n/**\n * Nodes\n */\nexport type Node = typeof nodes.$inferSelect;\nexport type FileNode = typeof nodes.$inferSelect & { type: \"file\" };\nexport type FolderNode = typeof nodes.$inferSelect & { type: \"folder\" };\n\n/**\n * Node mode\n */\nexport const nodeModeSchema = z.enum(nodeModeEnum.enumValues);\nexport type NodeMode = z.infer<typeof nodeModeSchema>;\n\n/**\n * Create node\n */\nexport const createNodeSchema = createInsertSchema(nodes, {\n namespace: z.string(),\n});\n\nexport type CreateNodeInput = z.input<typeof createNodeSchema>;\nexport type CreateNodeSchema = z.infer<typeof createNodeSchema>;\n\n/**\n * Update node\n */\nexport const updateNodeSchema = createUpdateSchema(nodes);\n\nexport type UpdateNodeInput = z.input<typeof updateNodeSchema>;\nexport type UpdateNodeSchema = z.infer<typeof updateNodeSchema>;\n\n/**\n * Create folder node\n */\nexport const createFolderNodeSchema = createNodeSchema.omit({\n type: true,\n contentType: true,\n size: true,\n subtype: true,\n});\n\nexport type CreateFolderNodeSchema = z.infer<typeof createFolderNodeSchema>;\n\n/**\n * Create file node\n */\nexport const createFileNodeSchema = createNodeSchema.omit({\n type: true,\n});\nexport type CreateFileNodeSchema = z.infer<typeof createFileNodeSchema>;\n\n/**\n * Select node\n */\nexport const selectNodeSchema = createSelectSchema(nodes);\nexport const selectNodeWithChildrenSchema = selectNodeSchema.extend({\n children: z.array(selectNodeSchema),\n});\n\nexport type SelectNodeSchema = z.infer<typeof selectNodeSchema>;\nexport type SelectNodeWithChildrenSchema = z.infer<typeof selectNodeWithChildrenSchema>;\n\n/**\n * Where input\n */\nexport const nodesTableFiltersSchema = resolveFiltersSchema(nodesTableFilters)\n .partial()\n .extend({\n namespace: z.string(),\n parentId: z.string().nullable(),\n })\n .transform((input) => ({ ...input, isDeleted: input?.isDeleted ?? false }));\n\nexport type NodesTableFilters = z.input<typeof nodesTableFiltersSchema>;\n\n/**\n * Upload file schema\n */\nexport const uploadFileSchema = z.object({\n name: z.string().min(1),\n namespace: z.string(),\n mode: nodeModeSchema.optional(),\n parentId: z.uuid().nullable(),\n size: z.number().optional().default(0),\n contentType: z.string().optional().default(\"\"),\n});\n\nexport type UploadFileSchema = z.infer<typeof uploadFileSchema>;\n\n/**\n * Presign file schema\n */\nexport const presignFileSchema = uploadFileSchema.extend({ id: z.uuid() });\n\nexport type PresignFileSchema = z.infer<typeof presignFileSchema>;\n\n/**\n * Get file url schema\n */\nexport const getFileURLSchemaDefaults = { variant: \"main\", disposition: \"inline\" } as const;\n\nexport const getFileURLSchema = z.object({\n variant: z.enum(imageVariants).optional().default(getFileURLSchemaDefaults.variant),\n disposition: z.enum(imageDispositions).optional().default(getFileURLSchemaDefaults.disposition),\n});\n\nexport type GetFileUrlInput = z.input<typeof getFileURLSchema>;\nexport type GetFileURLSchema = z.infer<typeof getFileURLSchema>;\n\n/**\n * Get by parent id input\n */\nexport const getNodesByParentIdSchema = tableQuerySchema\n .pick({ order: true, sort: true, search: true })\n .extend({ filters: nodesTableFiltersSchema });\n\nexport type GetNodesByParentIdInput = z.input<typeof getNodesByParentIdSchema>;\n\n/**\n * Get object input\n */\nexport const getObjectSchema = z.object({\n id: z.string(),\n variant: z.enum(imageVariants).optional().default(getFileURLSchemaDefaults.variant),\n disposition: z.string().optional().default(getFileURLSchemaDefaults.disposition),\n});\n\nexport type GetObjectInput = z.input<typeof getObjectSchema>;\nexport type GetObjectSchema = z.infer<typeof getObjectSchema>;\n\n/**\n * Put object input\n */\nexport const putObjectSchema = z.object({\n id: z.string(),\n name: z.string().optional().default(\"\"),\n variant: z.enum(imageVariants).optional().default(\"main\"),\n body: z.any().optional(),\n contentType: z.string().optional().default(\"\"),\n size: z.number().optional().default(0),\n});\n\nexport type PutObjectInput = z.input<typeof putObjectSchema> & {\n body?: PutObjectCommandInput[\"Body\"];\n};\n\nexport type PutObjectSchema = z.infer<typeof putObjectSchema>;\n"],"mappings":";;;;;;;;;;;;AAmBA,MAAa,iBAAiBA,IAAE,KAAK,aAAa,WAAW;;;;AAM7D,MAAa,mBAAmB,mBAAmB,OAAO,EACxD,WAAWA,IAAE,QAAQ,EACtB,CAAC;;;;AAQF,MAAa,mBAAmB,mBAAmB,MAAM;;;;AAQzD,MAAa,yBAAyB,iBAAiB,KAAK;CAC1D,MAAM;CACN,aAAa;CACb,MAAM;CACN,SAAS;CACV,CAAC;;;;AAOF,MAAa,uBAAuB,iBAAiB,KAAK,EACxD,MAAM,MACP,CAAC;;;;AAMF,MAAa,mBAAmB,mBAAmB,MAAM;AACzD,MAAa,+BAA+B,iBAAiB,OAAO,EAClE,UAAUA,IAAE,MAAM,iBAAiB,EACpC,CAAC;;;;AAQF,MAAa,0BAA0B,qBAAqB,kBAAkB,CAC3E,SAAS,CACT,OAAO;CACN,WAAWA,IAAE,QAAQ;CACrB,UAAUA,IAAE,QAAQ,CAAC,UAAU;CAChC,CAAC,CACD,WAAW,WAAW;CAAE,GAAG;CAAO,WAAW,OAAO,aAAa;CAAO,EAAE;;;;AAO7E,MAAa,mBAAmBA,IAAE,OAAO;CACvC,MAAMA,IAAE,QAAQ,CAAC,IAAI,EAAE;CACvB,WAAWA,IAAE,QAAQ;CACrB,MAAM,eAAe,UAAU;CAC/B,UAAUA,IAAE,MAAM,CAAC,UAAU;CAC7B,MAAMA,IAAE,QAAQ,CAAC,UAAU,CAAC,QAAQ,EAAE;CACtC,aAAaA,IAAE,QAAQ,CAAC,UAAU,CAAC,QAAQ,GAAG;CAC/C,CAAC;;;;AAOF,MAAa,oBAAoB,iBAAiB,OAAO,EAAE,IAAIA,IAAE,MAAM,EAAE,CAAC;;;;AAO1E,MAAa,2BAA2B;CAAE,SAAS;CAAQ,aAAa;CAAU;AAElF,MAAa,mBAAmBA,IAAE,OAAO;CACvC,SAASA,IAAE,KAAK,cAAc,CAAC,UAAU,CAAC,QAAQ,yBAAyB,QAAQ;CACnF,aAAaA,IAAE,KAAK,kBAAkB,CAAC,UAAU,CAAC,QAAQ,yBAAyB,YAAY;CAChG,CAAC;;;;AAQF,MAAa,2BAA2B,iBACrC,KAAK;CAAE,OAAO;CAAM,MAAM;CAAM,QAAQ;CAAM,CAAC,CAC/C,OAAO,EAAE,SAAS,yBAAyB,CAAC;;;;AAO/C,MAAa,kBAAkBA,IAAE,OAAO;CACtC,IAAIA,IAAE,QAAQ;CACd,SAASA,IAAE,KAAK,cAAc,CAAC,UAAU,CAAC,QAAQ,yBAAyB,QAAQ;CACnF,aAAaA,IAAE,QAAQ,CAAC,UAAU,CAAC,QAAQ,yBAAyB,YAAY;CACjF,CAAC;;;;AAQF,MAAa,kBAAkBA,IAAE,OAAO;CACtC,IAAIA,IAAE,QAAQ;CACd,MAAMA,IAAE,QAAQ,CAAC,UAAU,CAAC,QAAQ,GAAG;CACvC,SAASA,IAAE,KAAK,cAAc,CAAC,UAAU,CAAC,QAAQ,OAAO;CACzD,MAAMA,IAAE,KAAK,CAAC,UAAU;CACxB,aAAaA,IAAE,QAAQ,CAAC,UAAU,CAAC,QAAQ,GAAG;CAC9C,MAAMA,IAAE,QAAQ,CAAC,UAAU,CAAC,QAAQ,EAAE;CACvC,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { DropzoneContext, useDropzoneContext } from "../modules/storage/components/dropzone-context.client.mjs";
|
|
2
|
+
import { Dropzone, DropzoneContent, DropzoneContentProps, DropzoneEmptyState, DropzoneEmptyStateProps, DropzoneProps } from "../modules/storage/components/dropzone.client.mjs";
|
|
3
|
+
import { ImageGrid, ImageGridSkeleton } from "../modules/storage/components/image-grid.client.mjs";
|
|
4
|
+
import { UploadZoneContext, UploadZoneContextValue, useUploadZone } from "../modules/storage/components/upload-zone-context.client.mjs";
|
|
5
|
+
import { UploadZone, UploadZoneProps } from "../modules/storage/components/upload-zone.client.mjs";
|
|
6
|
+
export { Dropzone, DropzoneContent, DropzoneContentProps, DropzoneContext, DropzoneEmptyState, DropzoneEmptyStateProps, DropzoneProps, ImageGrid, ImageGridSkeleton, UploadZone, UploadZoneContext, UploadZoneContextValue, UploadZoneProps, useDropzoneContext, useUploadZone };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { DropzoneContext, useDropzoneContext } from "../modules/storage/components/dropzone-context.client.mjs";
|
|
2
|
+
import { Dropzone, DropzoneContent, DropzoneEmptyState } from "../modules/storage/components/dropzone.client.mjs";
|
|
3
|
+
import { UploadZoneContext, useUploadZone } from "../modules/storage/components/upload-zone-context.client.mjs";
|
|
4
|
+
import { ImageGrid, ImageGridSkeleton } from "../modules/storage/components/image-grid.client.mjs";
|
|
5
|
+
import { UploadZone } from "../modules/storage/components/upload-zone.client.mjs";
|
|
6
|
+
|
|
7
|
+
//#region src/modules/storage/entry.client.ts
|
|
8
|
+
/**
|
|
9
|
+
* Hooks
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
//#endregion
|
|
13
|
+
export { Dropzone, DropzoneContent, DropzoneContext, DropzoneEmptyState, ImageGrid, ImageGridSkeleton, UploadZone, UploadZoneContext, useDropzoneContext, useUploadZone };
|
|
14
|
+
//# sourceMappingURL=client.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.mjs","names":[],"sources":["../../src/modules/storage/entry.client.ts"],"sourcesContent":["/**\n * Components\n */\nexport * from \"./components/dropzone-context.client\";\nexport * from \"./components/dropzone.client\";\nexport * from \"./components/image-grid.client\";\nexport * from \"./components/upload-zone-context.client\";\nexport * from \"./components/upload-zone.client\";\n\n/**\n * Hooks\n */\n"],"mappings":""}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { StorageClient, createStorageClient } from "../modules/storage/lib/create-client.server.mjs";
|
|
2
|
+
import { createDriveProxyRoute } from "../modules/storage/lib/proxy.server.mjs";
|
|
3
|
+
import { createDriveBaseProcedures } from "../modules/storage/lib/router.server.mjs";
|
|
4
|
+
export { StorageClient, createDriveBaseProcedures, createDriveProxyRoute, createStorageClient };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { createStorageClient } from "../modules/storage/lib/create-client.server.mjs";
|
|
2
|
+
import { createDriveProxyRoute } from "../modules/storage/lib/proxy.server.mjs";
|
|
3
|
+
import { createDriveBaseProcedures } from "../modules/storage/lib/router.server.mjs";
|
|
4
|
+
|
|
5
|
+
export { createDriveBaseProcedures, createDriveProxyRoute, createStorageClient };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { DriveSchema, nodeModeEnum, nodePresignedUrls, nodePresignedUrlsRelations, nodeTypeEnum, nodeVariants, nodeVariantsRelations, nodes, nodesRelations } from "./modules/storage/lib/schema.mjs";
|
|
2
|
+
import { CreateFileNodeSchema, CreateFolderNodeSchema, CreateNodeInput, CreateNodeSchema, FileNode, FolderNode, GetFileURLSchema, GetFileUrlInput, GetNodesByParentIdInput, GetObjectInput, GetObjectSchema, Node, NodeMode, NodesTableFilters, PresignFileSchema, PutObjectInput, PutObjectSchema, SelectNodeSchema, SelectNodeWithChildrenSchema, UpdateNodeInput, UpdateNodeSchema, UploadFileSchema, createFileNodeSchema, createFolderNodeSchema, createNodeSchema, getFileURLSchema, getFileURLSchemaDefaults, getNodesByParentIdSchema, getObjectSchema, nodeModeSchema, nodesTableFiltersSchema, presignFileSchema, putObjectSchema, selectNodeSchema, selectNodeWithChildrenSchema, updateNodeSchema, uploadFileSchema } from "./modules/storage/lib/validators.mjs";
|
|
3
|
+
import { nodesTableFilters } from "./modules/storage/config/filters.mjs";
|
|
4
|
+
import { ImageDisposition, ImageVariant, deviceSizes, imageDispositions, imageSizes, imageVariants } from "./modules/storage/lib/constants.mjs";
|
|
5
|
+
import { NodeSubtype, getDriveBucketKey, getFileUrl, imageLoader, inferNodeSubtype, isFile, isFolder, nodeSubtypes, renderBytes } from "./modules/storage/lib/helpers.mjs";
|
|
6
|
+
export { CreateFileNodeSchema, CreateFolderNodeSchema, CreateNodeInput, CreateNodeSchema, DriveSchema, FileNode, FolderNode, GetFileURLSchema, GetFileUrlInput, GetNodesByParentIdInput, GetObjectInput, GetObjectSchema, ImageDisposition, ImageVariant, Node, NodeMode, NodeSubtype, NodesTableFilters, PresignFileSchema, PutObjectInput, PutObjectSchema, SelectNodeSchema, SelectNodeWithChildrenSchema, UpdateNodeInput, UpdateNodeSchema, UploadFileSchema, createFileNodeSchema, createFolderNodeSchema, createNodeSchema, deviceSizes, getDriveBucketKey, getFileURLSchema, getFileURLSchemaDefaults, getFileUrl, getNodesByParentIdSchema, getObjectSchema, imageDispositions, imageLoader, imageSizes, imageVariants, inferNodeSubtype, isFile, isFolder, nodeModeEnum, nodeModeSchema, nodePresignedUrls, nodePresignedUrlsRelations, nodeSubtypes, nodeTypeEnum, nodeVariants, nodeVariantsRelations, nodes, nodesRelations, nodesTableFilters, nodesTableFiltersSchema, presignFileSchema, putObjectSchema, renderBytes, selectNodeSchema, selectNodeWithChildrenSchema, updateNodeSchema, uploadFileSchema };
|
package/dist/storage.mjs
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { deviceSizes, imageDispositions, imageSizes, imageVariants } from "./modules/storage/lib/constants.mjs";
|
|
2
|
+
import { getDriveBucketKey, getFileUrl, imageLoader, inferNodeSubtype, isFile, isFolder, nodeSubtypes, renderBytes } from "./modules/storage/lib/helpers.mjs";
|
|
3
|
+
import { nodeModeEnum, nodePresignedUrls, nodePresignedUrlsRelations, nodeTypeEnum, nodeVariants, nodeVariantsRelations, nodes, nodesRelations } from "./modules/storage/lib/schema.mjs";
|
|
4
|
+
import { nodesTableFilters } from "./modules/storage/config/filters.mjs";
|
|
5
|
+
import { createFileNodeSchema, createFolderNodeSchema, createNodeSchema, getFileURLSchema, getFileURLSchemaDefaults, getNodesByParentIdSchema, getObjectSchema, nodeModeSchema, nodesTableFiltersSchema, presignFileSchema, putObjectSchema, selectNodeSchema, selectNodeWithChildrenSchema, updateNodeSchema, uploadFileSchema } from "./modules/storage/lib/validators.mjs";
|
|
6
|
+
|
|
7
|
+
export { createFileNodeSchema, createFolderNodeSchema, createNodeSchema, deviceSizes, getDriveBucketKey, getFileURLSchema, getFileURLSchemaDefaults, getFileUrl, getNodesByParentIdSchema, getObjectSchema, imageDispositions, imageLoader, imageSizes, imageVariants, inferNodeSubtype, isFile, isFolder, nodeModeEnum, nodeModeSchema, nodePresignedUrls, nodePresignedUrlsRelations, nodeSubtypes, nodeTypeEnum, nodeVariants, nodeVariantsRelations, nodes, nodesRelations, nodesTableFilters, nodesTableFiltersSchema, presignFileSchema, putObjectSchema, renderBytes, selectNodeSchema, selectNodeWithChildrenSchema, updateNodeSchema, uploadFileSchema };
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tulip-systems/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"devDependencies": {
|
|
8
|
-
"@types/react": "
|
|
9
|
-
"@types/react-dom": "
|
|
8
|
+
"@types/react": "19.2.7",
|
|
9
|
+
"@types/react-dom": "19.2.3",
|
|
10
10
|
"eslint": "^9.39.1",
|
|
11
11
|
"tailwindcss": "^4.1.17",
|
|
12
12
|
"tsdown": "^0.17.1",
|
|
@@ -62,36 +62,48 @@
|
|
|
62
62
|
"@tanstack/react-query-devtools": "^5.91.1",
|
|
63
63
|
"@tanstack/react-table": "^8.21.2",
|
|
64
64
|
"@tanstack/react-virtual": "^3.13.13",
|
|
65
|
-
"@tiptap/
|
|
66
|
-
"@tiptap/extension-
|
|
67
|
-
"@tiptap/extension-
|
|
68
|
-
"@tiptap/extension-
|
|
69
|
-
"@tiptap/extension-
|
|
70
|
-
"@tiptap/extension-
|
|
71
|
-
"@tiptap/
|
|
72
|
-
"@tiptap/
|
|
73
|
-
"@tiptap/
|
|
74
|
-
"@tiptap/
|
|
75
|
-
"@
|
|
65
|
+
"@tiptap/core": "^3.14.0",
|
|
66
|
+
"@tiptap/extension-blockquote": "^3.14.0",
|
|
67
|
+
"@tiptap/extension-bold": "^3.14.0",
|
|
68
|
+
"@tiptap/extension-color": "^3.14.0",
|
|
69
|
+
"@tiptap/extension-document": "^3.14.0",
|
|
70
|
+
"@tiptap/extension-hard-break": "^3.14.0",
|
|
71
|
+
"@tiptap/extension-heading": "^3.14.0",
|
|
72
|
+
"@tiptap/extension-highlight": "^3.14.0",
|
|
73
|
+
"@tiptap/extension-horizontal-rule": "^3.14.0",
|
|
74
|
+
"@tiptap/extension-image": "^3.14.0",
|
|
75
|
+
"@tiptap/extension-italic": "^3.14.0",
|
|
76
|
+
"@tiptap/extension-link": "^3.14.0",
|
|
77
|
+
"@tiptap/extension-list": "^3.14.0",
|
|
78
|
+
"@tiptap/extension-paragraph": "^3.14.0",
|
|
79
|
+
"@tiptap/extension-strike": "^3.14.0",
|
|
80
|
+
"@tiptap/extension-text": "^3.14.0",
|
|
81
|
+
"@tiptap/extension-text-style": "^3.14.0",
|
|
82
|
+
"@tiptap/extension-underline": "^3.14.0",
|
|
83
|
+
"@tiptap/extensions": "^3.14.0",
|
|
84
|
+
"@tiptap/html": "^3.14.0",
|
|
85
|
+
"@tiptap/pm": "^3.14.0",
|
|
86
|
+
"@tiptap/react": "^3.14.0",
|
|
76
87
|
"better-auth": "^1.4.5",
|
|
77
88
|
"class-variance-authority": "^0.7.1",
|
|
78
89
|
"client-only": "^0.0.1",
|
|
79
90
|
"clsx": "^2.1.1",
|
|
80
91
|
"cmdk": "1.1.1",
|
|
81
92
|
"date-fns": "^4.1.0",
|
|
93
|
+
"deepmerge": "^4.3.1",
|
|
82
94
|
"drizzle-orm": "^0.45.0",
|
|
83
95
|
"drizzle-zod": "^0.8.3",
|
|
84
96
|
"embla-carousel-react": "^8.5.2",
|
|
85
97
|
"lucide-react": "^0.556.0",
|
|
86
98
|
"motion": "^12.23.25",
|
|
87
|
-
"next": "16.
|
|
99
|
+
"next": "16.1.1",
|
|
88
100
|
"next-themes": "^0.4.6",
|
|
89
101
|
"nuqs": "2.8.3",
|
|
90
102
|
"postgres": "^3.4.5",
|
|
91
|
-
"react": "
|
|
103
|
+
"react": "19.2.3",
|
|
92
104
|
"react-colorful": "^5.6.1",
|
|
93
105
|
"react-day-picker": "9.12.0",
|
|
94
|
-
"react-dom": "
|
|
106
|
+
"react-dom": "19.2.3",
|
|
95
107
|
"react-dropzone": "^14.3.8",
|
|
96
108
|
"react-email": "^5.0.6",
|
|
97
109
|
"react-hook-form": "^7.68.0",
|
|
@@ -150,9 +162,9 @@
|
|
|
150
162
|
"./router": "./dist/router.mjs",
|
|
151
163
|
"./router/client": "./dist/router/client.mjs",
|
|
152
164
|
"./router/server": "./dist/router/server.mjs",
|
|
153
|
-
"./
|
|
154
|
-
"./
|
|
155
|
-
"./
|
|
165
|
+
"./storage": "./dist/storage.mjs",
|
|
166
|
+
"./storage/client": "./dist/storage/client.mjs",
|
|
167
|
+
"./storage/server": "./dist/storage/server.mjs",
|
|
156
168
|
"./package.json": "./package.json",
|
|
157
169
|
"./styles.css": "./src/styles.css"
|
|
158
170
|
},
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { TooltipProvider } from "@/components/ui/tooltip.client";
|
|
4
4
|
import { EditorContent as TiptapEditorContent } from "@tiptap/react";
|
|
5
5
|
import { useContext } from "react";
|
|
6
|
-
import { EditorContext } from "
|
|
6
|
+
import { EditorContext } from "./editor.client";
|
|
7
7
|
|
|
8
8
|
export function EditorContent() {
|
|
9
9
|
const { editor } = useContext(EditorContext);
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { cn } from "@/lib/utils/cn";
|
|
4
|
+
import { Content, Editor as TiptapEditor, useEditor } from "@tiptap/react";
|
|
5
|
+
import { cva, VariantProps } from "class-variance-authority";
|
|
6
|
+
import { createContext, PropsWithChildren } from "react";
|
|
7
|
+
import {
|
|
8
|
+
EditorExtensionsConfig,
|
|
9
|
+
EditorExtensionsConfigResult,
|
|
10
|
+
editorExtensionsConfigToExtensions,
|
|
11
|
+
flattenEditorExtensionsConfig,
|
|
12
|
+
} from "../lib/extensions";
|
|
13
|
+
import { EditorJSONContent } from "../lib/types";
|
|
14
|
+
import { editorProseVariants } from "../lib/variants";
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Editor context
|
|
18
|
+
*/
|
|
19
|
+
type EditorContextValue = {
|
|
20
|
+
editor: TiptapEditor;
|
|
21
|
+
extensions: EditorExtensionsConfigResult;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export const EditorContext = createContext({} as EditorContextValue);
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Editor variants
|
|
28
|
+
*/
|
|
29
|
+
export const editorVariants = cva("", {
|
|
30
|
+
variants: {
|
|
31
|
+
variant: {
|
|
32
|
+
default:
|
|
33
|
+
"border-input rounded-lg border [&_.editor-content]:p-3 [&_.editor-content[contenteditable='false']]:pointer-events-none [&_.editor-content[contenteditable='false']]:cursor-not-allowed [&_.editor-content[contenteditable='false']]:opacity-50",
|
|
34
|
+
table:
|
|
35
|
+
"[&_.editor-content[contenteditable='false']]:pointer-events-none [&_.editor-content[contenteditable='false']]:cursor-not-allowed [&_.editor-content[contenteditable='false']]:opacity-50",
|
|
36
|
+
preview: "bg-transparent [&_.editor-content]:p-0 [&_.editor-content]:min-h-0",
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
defaultVariants: {
|
|
40
|
+
variant: "default",
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Editor context provider
|
|
46
|
+
*/
|
|
47
|
+
export type EditorProps = VariantProps<typeof editorVariants> &
|
|
48
|
+
PropsWithChildren<{
|
|
49
|
+
value?: Content;
|
|
50
|
+
extensions?: Partial<EditorExtensionsConfig>;
|
|
51
|
+
onUpdate?: (value: EditorJSONContent) => void;
|
|
52
|
+
onBlur?: (value: EditorJSONContent) => void;
|
|
53
|
+
disabled?: boolean;
|
|
54
|
+
className?: string;
|
|
55
|
+
}>;
|
|
56
|
+
|
|
57
|
+
export function Editor({
|
|
58
|
+
value,
|
|
59
|
+
extensions,
|
|
60
|
+
onUpdate,
|
|
61
|
+
onBlur,
|
|
62
|
+
disabled,
|
|
63
|
+
variant,
|
|
64
|
+
className,
|
|
65
|
+
children,
|
|
66
|
+
}: EditorProps) {
|
|
67
|
+
const editor = useEditor({
|
|
68
|
+
extensions: editorExtensionsConfigToExtensions(extensions),
|
|
69
|
+
content: value,
|
|
70
|
+
onUpdate: ({ editor }) => onUpdate?.(editor.getJSON()),
|
|
71
|
+
onBlur: ({ editor }) => onBlur?.(editor.getJSON()),
|
|
72
|
+
editable: !disabled,
|
|
73
|
+
injectCSS: false,
|
|
74
|
+
immediatelyRender: false,
|
|
75
|
+
editorProps: {
|
|
76
|
+
transformPastedHTML: (html) => html.replace(/<img.*?>/g, ""),
|
|
77
|
+
attributes: {
|
|
78
|
+
class: cn("editor-content text-sm max-w-full focus:outline-none", editorProseVariants(), className),
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
if (!editor) return null;
|
|
84
|
+
|
|
85
|
+
return (
|
|
86
|
+
<EditorContext.Provider
|
|
87
|
+
value={{
|
|
88
|
+
editor,
|
|
89
|
+
extensions: flattenEditorExtensionsConfig(extensions),
|
|
90
|
+
}}
|
|
91
|
+
>
|
|
92
|
+
<div className={editorVariants({ variant })}>{children}</div>
|
|
93
|
+
</EditorContext.Provider>
|
|
94
|
+
);
|
|
95
|
+
}
|
|
@@ -18,7 +18,8 @@ import {
|
|
|
18
18
|
TextIcon,
|
|
19
19
|
} from "lucide-react";
|
|
20
20
|
import { useContext } from "react";
|
|
21
|
-
import {
|
|
21
|
+
import { EditorExtensionsConfigResult } from "../lib/extensions";
|
|
22
|
+
import { EditorContext } from "./editor.client";
|
|
22
23
|
|
|
23
24
|
const blocks = [
|
|
24
25
|
{
|
|
@@ -26,57 +27,69 @@ const blocks = [
|
|
|
26
27
|
icon: TextIcon,
|
|
27
28
|
selected: (editor: Editor) => editor.isActive("paragraph"),
|
|
28
29
|
handler: (editor: Editor) => editor.commands.setParagraph(),
|
|
30
|
+
hidden: (extensions: EditorExtensionsConfigResult) => !extensions.paragraph,
|
|
29
31
|
},
|
|
30
32
|
{
|
|
31
33
|
label: "Titel 1",
|
|
32
34
|
icon: Heading1Icon,
|
|
33
35
|
selected: (editor: Editor) => editor.isActive("heading", { level: 1 }),
|
|
34
36
|
handler: (editor: Editor) => editor.commands.setHeading({ level: 1 }),
|
|
37
|
+
hidden: (extensions: EditorExtensionsConfigResult) => !extensions.heading,
|
|
35
38
|
},
|
|
36
39
|
{
|
|
37
40
|
label: "Titel 2",
|
|
38
41
|
icon: Heading2Icon,
|
|
39
42
|
selected: (editor: Editor) => editor.isActive("heading", { level: 2 }),
|
|
40
43
|
handler: (editor: Editor) => editor.commands.setHeading({ level: 2 }),
|
|
44
|
+
hidden: (extensions: EditorExtensionsConfigResult) => !extensions.heading,
|
|
41
45
|
},
|
|
42
46
|
{
|
|
43
47
|
label: "Titel 3",
|
|
44
48
|
icon: Heading3Icon,
|
|
45
49
|
selected: (editor: Editor) => editor.isActive("heading", { level: 3 }),
|
|
46
50
|
handler: (editor: Editor) => editor.commands.setHeading({ level: 3 }),
|
|
51
|
+
hidden: (extensions: EditorExtensionsConfigResult) => !extensions.heading,
|
|
47
52
|
},
|
|
48
53
|
{
|
|
49
54
|
label: "Titel 4",
|
|
50
55
|
icon: Heading4Icon,
|
|
51
56
|
selected: (editor: Editor) => editor.isActive("heading", { level: 4 }),
|
|
52
57
|
handler: (editor: Editor) => editor.commands.setHeading({ level: 4 }),
|
|
58
|
+
hidden: (extensions: EditorExtensionsConfigResult) => !extensions.heading,
|
|
53
59
|
},
|
|
54
60
|
{
|
|
55
61
|
label: "Titel 5",
|
|
56
62
|
icon: Heading5Icon,
|
|
57
63
|
selected: (editor: Editor) => editor.isActive("heading", { level: 5 }),
|
|
58
64
|
handler: (editor: Editor) => editor.commands.setHeading({ level: 5 }),
|
|
65
|
+
hidden: (extensions: EditorExtensionsConfigResult) => !extensions.heading,
|
|
59
66
|
},
|
|
60
67
|
{
|
|
61
68
|
label: "Numbered List",
|
|
62
69
|
icon: ListOrderedIcon,
|
|
63
70
|
selected: (editor: Editor) => editor.isActive("orderedList"),
|
|
64
71
|
handler: (editor: Editor) => editor.commands.toggleOrderedList(),
|
|
72
|
+
hidden: (extensions: EditorExtensionsConfigResult) => !extensions.orderedList,
|
|
65
73
|
},
|
|
66
74
|
{
|
|
67
75
|
label: "Bulleted List",
|
|
68
76
|
icon: ListIcon,
|
|
69
77
|
selected: (editor: Editor) => editor.isActive("bulletList"),
|
|
70
78
|
handler: (editor: Editor) => editor.commands.toggleBulletList(),
|
|
79
|
+
hidden: (extensions: EditorExtensionsConfigResult) => !extensions.bulletList,
|
|
71
80
|
},
|
|
72
81
|
];
|
|
73
82
|
|
|
74
|
-
export function
|
|
75
|
-
const { editor } = useContext(EditorContext);
|
|
83
|
+
export function EditorMenuNodes() {
|
|
84
|
+
const { editor, extensions } = useContext(EditorContext);
|
|
76
85
|
|
|
77
86
|
const selectedBlock = blocks.find((block) => block.selected(editor));
|
|
78
87
|
const Icon = selectedBlock?.icon;
|
|
79
88
|
|
|
89
|
+
const filteredBlocks = blocks.filter((block) => !block.hidden(extensions));
|
|
90
|
+
|
|
91
|
+
if (filteredBlocks.length === 0) return null;
|
|
92
|
+
|
|
80
93
|
return (
|
|
81
94
|
<DropdownMenu>
|
|
82
95
|
<DropdownMenuTrigger asChild>
|
|
@@ -91,7 +104,7 @@ export function BlockDropdown() {
|
|
|
91
104
|
</DropdownMenuTrigger>
|
|
92
105
|
|
|
93
106
|
<DropdownMenuContent>
|
|
94
|
-
{
|
|
107
|
+
{filteredBlocks.map(({ label, icon: Icon, handler }, index) => (
|
|
95
108
|
<DropdownMenuItem
|
|
96
109
|
key={index}
|
|
97
110
|
onClick={() => handler(editor)}
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
import { Button } from "@/components/ui/button";
|
|
2
|
+
import { ColorPicker } from "@/components/ui/color-picker.client";
|
|
3
|
+
import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover";
|
|
4
|
+
import { cn } from "@/lib/entry";
|
|
5
|
+
import { BubbleMenu } from "@tiptap/react/menus";
|
|
6
|
+
import {
|
|
7
|
+
BaselineIcon,
|
|
8
|
+
BoldIcon,
|
|
9
|
+
EraserIcon,
|
|
10
|
+
ItalicIcon,
|
|
11
|
+
PaintBucketIcon,
|
|
12
|
+
RedoIcon,
|
|
13
|
+
StrikethroughIcon,
|
|
14
|
+
UnderlineIcon,
|
|
15
|
+
UndoIcon,
|
|
16
|
+
} from "lucide-react";
|
|
17
|
+
import { ComponentProps, PropsWithChildren, useContext } from "react";
|
|
18
|
+
import { EditorContext } from "./editor.client";
|
|
19
|
+
import { EditorMenuNodes } from "./menu-nodes.client";
|
|
20
|
+
|
|
21
|
+
export function EditorMenuFixed(props: React.ComponentProps<"div">) {
|
|
22
|
+
return (
|
|
23
|
+
<div
|
|
24
|
+
{...props}
|
|
25
|
+
className={cn("border-input bg-muted/30 z-10 overflow-auto border-b p-2", props.className)}
|
|
26
|
+
>
|
|
27
|
+
<EditorMenuContent>
|
|
28
|
+
<EditorMenuUndoRedo />
|
|
29
|
+
<EditorMenuNodes />
|
|
30
|
+
<EditorMenuMarks />
|
|
31
|
+
<EditorMenuColor />
|
|
32
|
+
</EditorMenuContent>
|
|
33
|
+
</div>
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export function EditorMenuBubble(props: ComponentProps<typeof BubbleMenu>) {
|
|
38
|
+
const { editor } = useContext(EditorContext);
|
|
39
|
+
|
|
40
|
+
return (
|
|
41
|
+
<BubbleMenu
|
|
42
|
+
{...props}
|
|
43
|
+
editor={editor}
|
|
44
|
+
options={{ ...props.options, strategy: "fixed" }}
|
|
45
|
+
className={cn("border-input bg-muted z-10 rounded-lg border p-2", props.className)}
|
|
46
|
+
>
|
|
47
|
+
<EditorMenuContent>
|
|
48
|
+
<EditorMenuMarks />
|
|
49
|
+
</EditorMenuContent>
|
|
50
|
+
</BubbleMenu>
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function EditorMenuContent(props: PropsWithChildren) {
|
|
55
|
+
return <div className="flex items-center gap-6">{props.children}</div>;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Editor menu undo/redo
|
|
60
|
+
*/
|
|
61
|
+
function EditorMenuUndoRedo() {
|
|
62
|
+
const { editor, extensions } = useContext(EditorContext);
|
|
63
|
+
|
|
64
|
+
if (!extensions.undoRedo) return null;
|
|
65
|
+
|
|
66
|
+
return (
|
|
67
|
+
<div className="flex items-center gap-1">
|
|
68
|
+
<Button
|
|
69
|
+
onClick={() => editor.commands.undo()}
|
|
70
|
+
disabled={!editor?.can().undo()}
|
|
71
|
+
type="button"
|
|
72
|
+
aria-label="Undo"
|
|
73
|
+
size="icon"
|
|
74
|
+
className="p-2"
|
|
75
|
+
variant="outline"
|
|
76
|
+
>
|
|
77
|
+
<UndoIcon className="size-3.5" />
|
|
78
|
+
</Button>
|
|
79
|
+
|
|
80
|
+
<Button
|
|
81
|
+
onClick={() => editor.commands.redo()}
|
|
82
|
+
disabled={!editor?.can().redo()}
|
|
83
|
+
type="button"
|
|
84
|
+
aria-label="Redo"
|
|
85
|
+
size="icon"
|
|
86
|
+
className="p-2"
|
|
87
|
+
variant="outline"
|
|
88
|
+
>
|
|
89
|
+
<RedoIcon className="size-3.5" />
|
|
90
|
+
</Button>
|
|
91
|
+
</div>
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Editor menu marks
|
|
97
|
+
*/
|
|
98
|
+
function EditorMenuMarks() {
|
|
99
|
+
const { editor, extensions } = useContext(EditorContext);
|
|
100
|
+
|
|
101
|
+
if (!extensions.bold && !extensions.italic && !extensions.underline && !extensions.strike) {
|
|
102
|
+
return null;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
return (
|
|
106
|
+
<div className="flex items-center gap-1">
|
|
107
|
+
{extensions.bold && (
|
|
108
|
+
<Button
|
|
109
|
+
type="button"
|
|
110
|
+
size="icon"
|
|
111
|
+
variant={editor?.isActive("bold") ? "secondary" : "outline"}
|
|
112
|
+
onClick={() => editor.chain().focus().toggleBold().run()}
|
|
113
|
+
className="border"
|
|
114
|
+
>
|
|
115
|
+
<BoldIcon className="h-3.5 w-3.5" />
|
|
116
|
+
</Button>
|
|
117
|
+
)}
|
|
118
|
+
|
|
119
|
+
{extensions.italic && (
|
|
120
|
+
<Button
|
|
121
|
+
type="button"
|
|
122
|
+
size="icon"
|
|
123
|
+
variant={editor?.isActive("italic") ? "secondary" : "outline"}
|
|
124
|
+
onClick={() => editor.chain().focus().toggleItalic().run()}
|
|
125
|
+
className="border"
|
|
126
|
+
>
|
|
127
|
+
<ItalicIcon className="size-3.5" />
|
|
128
|
+
</Button>
|
|
129
|
+
)}
|
|
130
|
+
|
|
131
|
+
{extensions.underline && (
|
|
132
|
+
<Button
|
|
133
|
+
type="button"
|
|
134
|
+
size="icon"
|
|
135
|
+
variant={editor?.isActive("underline") ? "secondary" : "outline"}
|
|
136
|
+
onClick={() => editor.chain().focus().toggleUnderline().run()}
|
|
137
|
+
className="border"
|
|
138
|
+
>
|
|
139
|
+
<UnderlineIcon className="size-3.5" />
|
|
140
|
+
</Button>
|
|
141
|
+
)}
|
|
142
|
+
|
|
143
|
+
{extensions.strike && (
|
|
144
|
+
<Button
|
|
145
|
+
type="button"
|
|
146
|
+
size="icon"
|
|
147
|
+
variant={editor?.isActive("strike") ? "secondary" : "outline"}
|
|
148
|
+
onClick={() => editor.chain().focus().toggleStrike().run()}
|
|
149
|
+
className="border"
|
|
150
|
+
>
|
|
151
|
+
<StrikethroughIcon className="size-3.5" />
|
|
152
|
+
</Button>
|
|
153
|
+
)}
|
|
154
|
+
</div>
|
|
155
|
+
);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* Editor menu alignment
|
|
160
|
+
*/
|
|
161
|
+
function EditorMenuColor() {
|
|
162
|
+
const { editor, extensions } = useContext(EditorContext);
|
|
163
|
+
|
|
164
|
+
if (!extensions.color && !extensions.highlight) {
|
|
165
|
+
return null;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
return (
|
|
169
|
+
<div className="flex items-center gap-1">
|
|
170
|
+
{extensions.color && (
|
|
171
|
+
<Popover>
|
|
172
|
+
<PopoverTrigger asChild>
|
|
173
|
+
<Button size="icon" variant="outline">
|
|
174
|
+
<BaselineIcon className="size-3.5" />
|
|
175
|
+
</Button>
|
|
176
|
+
</PopoverTrigger>
|
|
177
|
+
|
|
178
|
+
<PopoverContent className="w-fit p-0">
|
|
179
|
+
<ColorPicker onValueChange={(color) => editor.chain().focus().setColor(color).run()} />
|
|
180
|
+
</PopoverContent>
|
|
181
|
+
</Popover>
|
|
182
|
+
)}
|
|
183
|
+
|
|
184
|
+
{extensions.highlight && (
|
|
185
|
+
<Popover>
|
|
186
|
+
<PopoverTrigger asChild>
|
|
187
|
+
<Button size="icon" variant="outline" disabled={!editor?.can().setHighlight()}>
|
|
188
|
+
<PaintBucketIcon className="size-3.5" />
|
|
189
|
+
</Button>
|
|
190
|
+
</PopoverTrigger>
|
|
191
|
+
|
|
192
|
+
<PopoverContent className="w-fit p-0">
|
|
193
|
+
<ColorPicker
|
|
194
|
+
onValueChange={(color) => editor.chain().focus().setHighlight({ color }).run()}
|
|
195
|
+
/>
|
|
196
|
+
</PopoverContent>
|
|
197
|
+
</Popover>
|
|
198
|
+
)}
|
|
199
|
+
|
|
200
|
+
<Button
|
|
201
|
+
type="button"
|
|
202
|
+
size="icon"
|
|
203
|
+
variant="outline"
|
|
204
|
+
className="border"
|
|
205
|
+
onClick={() => {
|
|
206
|
+
editor.commands.unsetColor();
|
|
207
|
+
editor.commands.unsetHighlight();
|
|
208
|
+
}}
|
|
209
|
+
>
|
|
210
|
+
<EraserIcon className="h-4 w-4" />
|
|
211
|
+
</Button>
|
|
212
|
+
</div>
|
|
213
|
+
);
|
|
214
|
+
}
|
|
@@ -17,12 +17,12 @@ export function SpinnerComponent({ ref, className, ...props }: React.SVGProps<SV
|
|
|
17
17
|
r="10"
|
|
18
18
|
stroke="currentColor"
|
|
19
19
|
strokeWidth="4"
|
|
20
|
-
|
|
20
|
+
/>
|
|
21
21
|
<path
|
|
22
22
|
className="opacity-75"
|
|
23
23
|
fill="currentColor"
|
|
24
24
|
d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
|
|
25
|
-
|
|
25
|
+
/>
|
|
26
26
|
</svg>
|
|
27
27
|
);
|
|
28
28
|
}
|