diff --git a/frontend/src/components/editor/TextEditor.vue b/frontend/src/components/editor/TextEditor.vue index 337ace53..f9ea4256 100644 --- a/frontend/src/components/editor/TextEditor.vue +++ b/frontend/src/components/editor/TextEditor.vue @@ -68,23 +68,41 @@ > -
- - - -
+ + + + + + {{ editor?.isActive('link') + ? $t('globals.messages.edit', { name: $t('globals.terms.link', 1).toLowerCase() + ' ' + $t('globals.terms.url', 1).toLowerCase() }) + : $t('globals.messages.add', { name: $t('globals.terms.link', 1).toLowerCase() + ' ' + $t('globals.terms.url', 1).toLowerCase() }) + }} + + + +
+
+ +
+ + + + +
+
+
@@ -99,8 +117,6 @@ import { List, ListOrdered, Link as LinkIcon, - Check, - X } from 'lucide-vue-next' import { Button } from '@/components/ui/button' import { @@ -110,6 +126,14 @@ import { DropdownMenuTrigger } from '@/components/ui/dropdown-menu' import { Input } from '@/components/ui/input' +import { + Dialog, + DialogContent, + DialogFooter, + DialogHeader, + DialogTitle, + DialogDescription +} from '@/components/ui/dialog' import Placeholder from '@tiptap/extension-placeholder' import Image from '@tiptap/extension-image' import StarterKit from '@tiptap/starter-kit' @@ -121,7 +145,7 @@ import TableHeader from '@tiptap/extension-table-header' const textContent = defineModel('textContent', { default: '' }) const htmlContent = defineModel('htmlContent', { default: '' }) -const showLinkInput = ref(false) +const showLinkDialog = ref(false) const linkUrl = ref('') const props = defineProps({ @@ -249,19 +273,19 @@ const openLinkModal = () => { } else { linkUrl.value = '' } - showLinkInput.value = true + showLinkDialog.value = true } const setLink = () => { if (linkUrl.value) { editor.value?.chain().focus().extendMarkRange('link').setLink({ href: linkUrl.value }).run() } - showLinkInput.value = false + showLinkDialog.value = false } const unsetLink = () => { editor.value?.chain().focus().unsetLink().run() - showLinkInput.value = false + showLinkDialog.value = false }