-
-
-
-
+
+
+
+
+
-
-
-
-
- Outgoing email templates
- Email notification templates
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+ Outgoing email templates
+ Email notification templates
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/frontend/src/components/admin/templates/dataTableDropdown.vue b/frontend/src/components/admin/templates/dataTableDropdown.vue
index 480bfb69..726f1188 100644
--- a/frontend/src/components/admin/templates/dataTableDropdown.vue
+++ b/frontend/src/components/admin/templates/dataTableDropdown.vue
@@ -14,7 +14,7 @@ import { handleHTTPError } from '@/utils/http'
import api from '@/api'
const router = useRouter()
-const emit = useEmitter()
+const emitter = useEmitter()
const props = defineProps({
template: {
type: Object,
@@ -32,11 +32,11 @@ const editTemplate = (id) => {
const deleteTemplate = async (id) => {
try {
await api.deleteTemplate(id)
- emit.emit(EMITTER_EVENTS.REFRESH_LIST, {
+ emitter.emit(EMITTER_EVENTS.REFRESH_LIST, {
model: 'templates'
})
} catch (error) {
- emit.emit(EMITTER_EVENTS.SHOW_TOAST, {
+ emitter.emit(EMITTER_EVENTS.SHOW_TOAST, {
title: 'Error',
variant: 'destructive',
description: handleHTTPError(error).message
diff --git a/frontend/src/components/admin/templates/formSchema.js b/frontend/src/components/admin/templates/formSchema.js
index 7da8177a..f8206692 100644
--- a/frontend/src/components/admin/templates/formSchema.js
+++ b/frontend/src/components/admin/templates/formSchema.js
@@ -10,7 +10,7 @@ export const formSchema = z
}),
type: z.string().optional(),
subject: z.string().optional(),
- is_default: z.boolean().optional(),
+ is_default: z.boolean().optional().default(false),
})
.superRefine((data, ctx) => {
if (data.type !== 'email_outgoing' && !data.subject) {
diff --git a/frontend/src/components/command/CommandBox.vue b/frontend/src/components/command/CommandBox.vue
index 1042a478..24a53f36 100644
--- a/frontend/src/components/command/CommandBox.vue
+++ b/frontend/src/components/command/CommandBox.vue
@@ -1,5 +1,5 @@
-
+
@@ -203,9 +203,19 @@ const showDatePicker = ref(false)
const selectedDate = ref(null)
const selectedTime = ref('12:00')
-const keys = useMagicKeys()
-const cmdK = keys['meta+k']
-const ctrlK = keys['ctrl+k']
+const { Meta_K, Ctrl_K } = useMagicKeys({
+ passive: false,
+ onEventFired(e) {
+ if (e.key === 'k' && (e.metaKey || e.ctrlKey)) {
+ e.preventDefault()
+ }
+ }
+})
+
+watch([Meta_K, Ctrl_K], ([mac, win]) => {
+ if (mac || win) handleOpenChange()
+})
+
const highlightedMacro = ref(null)
function handleApplyMacro(macro) {
@@ -290,31 +300,16 @@ function onInputKeydown(e) {
}
}
-function preventDefaultKey(event) {
- if ((event.metaKey || event.ctrlKey) && event.key === 'k') {
- event.preventDefault()
- event.stopPropagation()
- return false
- }
-}
-
onMounted(() => {
emitter.on(EMITTER_EVENTS.SET_NESTED_COMMAND, (command) => {
setNestedCommand(command)
open.value = true
})
- window.addEventListener('keydown', preventDefaultKey)
-
watchHighlightedMacro()
})
onUnmounted(() => {
emitter.off(EMITTER_EVENTS.SET_NESTED_COMMAND)
- window.removeEventListener('keydown', preventDefaultKey)
-})
-
-watch([cmdK, ctrlK], ([mac, win]) => {
- if (mac || win) handleOpenChange()
})
const watchHighlightedMacro = () => {
diff --git a/frontend/src/components/conversation/ConversationTextEditor.vue b/frontend/src/components/conversation/ConversationTextEditor.vue
index de89f428..82df297f 100644
--- a/frontend/src/components/conversation/ConversationTextEditor.vue
+++ b/frontend/src/components/conversation/ConversationTextEditor.vue
@@ -94,7 +94,7 @@ const getSelectionText = (from, to, doc) => doc.textBetween(from, to)
const editorConfig = {
extensions: [
- // Lists are unstyled in tailwind, so we need to add classes to them.
+ // Lists are unstyled in tailwind, so need to add classes to them.
StarterKit.configure({
bulletList: {
HTMLAttributes: {
@@ -136,7 +136,7 @@ const editorConfig = {
const editor = ref(
useEditor({
...editorConfig,
- content: textContent.value,
+ content: htmlContent.value,
onSelectionUpdate: ({ editor }) => {
const { from, to } = editor.state.selection
selectedText.value = getSelectionText(from, to, editor.state.doc)
@@ -251,6 +251,15 @@ onUnmounted(() => {
padding: 10px;
}
+.fullscreen-tiptap-editor {
+ @apply p-0;
+ .ProseMirror {
+ min-height: 600px !important;
+ width: 90%;
+ scrollbar-width: none;
+ }
+}
+
.tiptap {
a {
color: #0066cc;
diff --git a/frontend/src/components/conversation/ReplyBox.vue b/frontend/src/components/conversation/ReplyBox.vue
index 56bea5bd..4e8de7cd 100644
--- a/frontend/src/components/conversation/ReplyBox.vue
+++ b/frontend/src/components/conversation/ReplyBox.vue
@@ -1,24 +1,77 @@
-