|
|
|
@ -134,12 +134,20 @@ if (appInfo.value.ee) {
|
|
|
|
|
|
|
|
|
|
const colorStyles = bUser?.id === user.value?.id ? '' : 'bg-[#D4F7E0] text-[#17803D]' |
|
|
|
|
|
|
|
|
|
return `<span data-type="mention" data-id='{ |
|
|
|
|
"id": "${bUser?.id}", |
|
|
|
|
"email": "${bUser?.email}", |
|
|
|
|
"name": "${bUser?.display_name ?? ''}", |
|
|
|
|
"isSameUser": "${bUser?.id === user.value?.id}" |
|
|
|
|
}' class="${colorStyles} mention font-semibold m-0.5 rounded-md px-1">@${processedContent}</span>` |
|
|
|
|
const span = document.createElement('span') |
|
|
|
|
span.setAttribute('data-type', 'mention') |
|
|
|
|
span.setAttribute( |
|
|
|
|
'data-id', |
|
|
|
|
JSON.stringify({ |
|
|
|
|
id: bUser?.id, |
|
|
|
|
email: bUser?.email, |
|
|
|
|
name: bUser?.display_name ?? '', |
|
|
|
|
isSameUser: bUser?.id === user.value?.id, |
|
|
|
|
}), |
|
|
|
|
) |
|
|
|
|
span.setAttribute('class', `${colorStyles} mention font-semibold m-0.5 rounded-md px-1`) |
|
|
|
|
span.textContent = `@${processedContent}` |
|
|
|
|
return span.outerHTML |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return text.replace(regex, replacement) |
|
|
|
@ -160,7 +168,7 @@ if (appInfo.value.ee) {
|
|
|
|
|
name: user.display_name, |
|
|
|
|
email: user.email, |
|
|
|
|
})) |
|
|
|
|
.filter((user) => user.label.toLowerCase() === content.toLowerCase())[0] |
|
|
|
|
.find((user) => user.label.toLowerCase() === content.toLowerCase()) as any |
|
|
|
|
|
|
|
|
|
return `@(${user.id}|${user.email}|${user.display_name ?? ''})` |
|
|
|
|
}, |
|
|
|
|