|
|
|
@ -29,7 +29,7 @@ import StarterKit from '@tiptap/starter-kit'
|
|
|
|
|
import Underline from '@tiptap/extension-underline'; |
|
|
|
|
import Placeholder from '@tiptap/extension-placeholder' |
|
|
|
|
import { Editor, Extension } from '@tiptap/core' |
|
|
|
|
|
|
|
|
|
import Highlight from '@tiptap/extension-highlight' |
|
|
|
|
const parentEpml = new Epml({ type: 'WINDOW', source: window.parent }) |
|
|
|
|
|
|
|
|
|
class Chat extends LitElement { |
|
|
|
@ -55,7 +55,7 @@ class Chat extends LitElement {
|
|
|
|
|
userFoundModalOpen: { type: Boolean }, |
|
|
|
|
userSelected: { type: Object }, |
|
|
|
|
editor: {type: Object}, |
|
|
|
|
groupInvites: { type: Array } |
|
|
|
|
groupInvites: { type: Array }, |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -118,6 +118,7 @@ class Chat extends LitElement {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
async connectedCallback() { |
|
|
|
|
|
|
|
|
|
super.connectedCallback(); |
|
|
|
|
await this.getUpdateCompleteTextEditor(); |
|
|
|
|
|
|
|
|
@ -147,15 +148,36 @@ class Chat extends LitElement {
|
|
|
|
|
}}) |
|
|
|
|
] |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.unsubscribeStore = window.parent.reduxStore.subscribe(() => { |
|
|
|
|
try { |
|
|
|
|
|
|
|
|
|
if(window.parent.location && window.parent.location.search){ |
|
|
|
|
const queryString = window.parent.location.search; |
|
|
|
|
const params = new URLSearchParams(queryString); |
|
|
|
|
const chat = params.get("chat") |
|
|
|
|
if(chat && chat !== this.activeChatHeadUrl){ |
|
|
|
|
let url = window.parent.location.href; |
|
|
|
|
let newUrl = url.split("?")[0]; |
|
|
|
|
window.parent.history.pushState({}, "", newUrl); |
|
|
|
|
this.setActiveChatHeadUrl(chat) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} catch (error) { |
|
|
|
|
console.error(error) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
disconnectedCallback() { |
|
|
|
|
super.disconnectedCallback(); |
|
|
|
|
this.editor.destroy() |
|
|
|
|
|
|
|
|
|
this.editor.destroy(); |
|
|
|
|
this.unsubscribeStore(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
updatePlaceholder(editor, text){ |
|
|
|
|
editor.extensionManager.extensions.forEach((extension) => { |
|
|
|
|
if (extension.name === "placeholder") { |
|
|
|
@ -215,7 +237,7 @@ class Chat extends LitElement {
|
|
|
|
|
</div> |
|
|
|
|
<div class="chat-history"> |
|
|
|
|
|
|
|
|
|
${window.parent.location.pathname !== "/app/q-chat" || this.activeChatHeadUrl ? html`${this.renderChatPage(this.chatId)}` : html`${this.renderChatWelcomePage()}`} |
|
|
|
|
${this.activeChatHeadUrl ? html`${this.renderChatPage()}` : html`${this.renderChatWelcomePage()}`} |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<!-- Start Chatting Dialog --> |
|
|
|
@ -367,6 +389,8 @@ class Chat extends LitElement {
|
|
|
|
|
` |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async firstUpdated() { |
|
|
|
|
this.changeLanguage(); |
|
|
|
|
this.changeTheme(); |
|
|
|
@ -482,8 +506,11 @@ class Chat extends LitElement {
|
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
parentEpml.imReady() |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
setOpenPrivateMessage(props) { |
|
|
|
|
this.openPrivateMessage = props.open; |
|
|
|
|
this.shadowRoot.getElementById("sendTo").value = props.name |
|
|
|
@ -839,7 +866,7 @@ class Chat extends LitElement {
|
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
renderChatPage(chatId) { |
|
|
|
|
renderChatPage() { |
|
|
|
|
|
|
|
|
|
// Check for the chat ID from and render chat messages
|
|
|
|
|
// Else render Welcome to Q-CHat
|
|
|
|
|