2020-05-15 14:33:31 +02:00
|
|
|
import "../components/message-history";
|
|
|
|
import xss from "xss/dist/xss";
|
|
|
|
import { CustomElement } from './element.js';
|
|
|
|
import { html } from 'lit-element';
|
|
|
|
import { unsafeHTML } from 'lit-html/directives/unsafe-html.js';
|
2020-07-01 21:45:18 +02:00
|
|
|
import { api } from "@converse/headless/converse-core";
|
2020-05-15 14:33:31 +02:00
|
|
|
|
2020-07-01 21:45:18 +02:00
|
|
|
export default class ChatContent extends CustomElement {
|
2020-05-15 14:33:31 +02:00
|
|
|
|
|
|
|
static get properties () {
|
|
|
|
return {
|
|
|
|
chatview: { type: Object},
|
|
|
|
messages: { type: Array},
|
|
|
|
notifications: { type: String }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
render () {
|
|
|
|
const notifications = xss.filterXSS(this.notifications, {'whiteList': {}});
|
|
|
|
return html`
|
|
|
|
<converse-message-history
|
|
|
|
.chatview=${this.chatview}
|
|
|
|
.messages=${this.messages}>
|
|
|
|
</converse-message-history>
|
|
|
|
<div class="chat-content__notifications">${unsafeHTML(notifications)}</div>
|
|
|
|
`;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-07-01 21:45:18 +02:00
|
|
|
api.elements.define('converse-chat-content', ChatContent);
|