From 475c50b101cbeb70a9e8e25c12ddd2e99de9616d Mon Sep 17 00:00:00 2001 From: Shariq Ansari Date: Fri, 12 Jul 2024 17:21:06 +0530 Subject: [PATCH 1/7] build(deps): added tiptap paragraph extension --- frontend/package.json | 1 + yarn.lock | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/frontend/package.json b/frontend/package.json index 4f46436b..b899efda 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -9,6 +9,7 @@ "serve": "vite preview" }, "dependencies": { + "@tiptap/extension-paragraph": "^2.4.0", "@twilio/voice-sdk": "^2.10.2", "@vueuse/core": "^10.3.0", "@vueuse/integrations": "^10.3.0", diff --git a/yarn.lock b/yarn.lock index 085c4557..af6a364a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1808,6 +1808,11 @@ resolved "https://registry.yarnpkg.com/@tiptap/extension-paragraph/-/extension-paragraph-2.2.6.tgz#0e66d2ce21116e43fd006961c42f187ee5e5beab" integrity sha512-M2rM3pfzziUb7xS9x2dANCokO89okbqg5IqU4VPkZhk0Mfq9czyCatt58TYkAsE3ccsGhdTYtFBTDeKBtsHUqg== +"@tiptap/extension-paragraph@^2.4.0": + version "2.4.0" + resolved "https://registry.yarnpkg.com/@tiptap/extension-paragraph/-/extension-paragraph-2.4.0.tgz#5b9aea8775937b327bbe6754be12ae3144fb09ff" + integrity sha512-+yse0Ow67IRwcACd9K/CzBcxlpr9OFnmf0x9uqpaWt1eHck1sJnti6jrw5DVVkyEBHDh/cnkkV49gvctT/NyCw== + "@tiptap/extension-placeholder@^2.0.3": version "2.2.6" resolved "https://registry.yarnpkg.com/@tiptap/extension-placeholder/-/extension-placeholder-2.2.6.tgz#7cb63e398a5301d1e132d4145daef3acb87e7dc5" From ee8fdf099f4037691ea6caa059c7530e569dada9 Mon Sep 17 00:00:00 2001 From: Shariq Ansari Date: Fri, 12 Jul 2024 17:22:43 +0530 Subject: [PATCH 2/7] fix: added custom paragraph in tiptap editor to allow adding class attribute --- frontend/src/components/Activities.vue | 20 ++++++++----- frontend/src/components/EmailEditor.vue | 39 ++++++++++++++++++++++--- 2 files changed, 48 insertions(+), 11 deletions(-) diff --git a/frontend/src/components/Activities.vue b/frontend/src/components/Activities.vue index 3bf06991..8df55c2d 100644 --- a/frontend/src/components/Activities.vue +++ b/frontend/src/components/Activities.vue @@ -442,7 +442,7 @@ 'outgoing_call', ].includes(activity.activity_type), 'bg-white': ['added', 'removed', 'changed'].includes( - activity.activity_type + activity.activity_type, ), }" > @@ -528,7 +528,10 @@ {{ activity.data.bcc }} -
+
{ }, ] return actions.filter((action) => - action.condition ? action.condition() : true + action.condition ? action.condition() : true, ) }) @@ -1120,12 +1123,12 @@ const activities = computed(() => { } else if (props.title == 'Emails') { if (!all_activities.data?.versions) return [] activities = all_activities.data.versions.filter( - (activity) => activity.activity_type === 'communication' + (activity) => activity.activity_type === 'communication', ) } else if (props.title == 'Comments') { if (!all_activities.data?.versions) return [] activities = all_activities.data.versions.filter( - (activity) => activity.activity_type === 'comment' + (activity) => activity.activity_type === 'comment', ) } else if (props.title == 'Calls') { if (!all_activities.data?.calls) return [] @@ -1338,12 +1341,15 @@ function reply(email, reply_all = false) { editor.bccEmails = bcc } + let repliedMessage = `
${message}
` + editor.editor .chain() .clearContent() - .insertContent(message) + .insertContent('

.

') + .updateAttributes('paragraph', {class:'reply-to-content'}) + .insertContent(repliedMessage) .focus('all') - .setBlockquote() .insertContentAt(0, { type: 'paragraph' }) .focus('start') .run() diff --git a/frontend/src/components/EmailEditor.vue b/frontend/src/components/EmailEditor.vue index d7f88179..2398aba5 100644 --- a/frontend/src/components/EmailEditor.vue +++ b/frontend/src/components/EmailEditor.vue @@ -1,12 +1,20 @@