2020-12-03 13:40:30 +01:00
|
|
|
import { api, converse } from "@converse/headless/core";
|
2020-08-26 16:07:59 +02:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* `converse-root` is an optional custom element which can be used to
|
|
|
|
* declaratively insert the Converse UI into the DOM.
|
|
|
|
*
|
|
|
|
* It can be inserted into the DOM before or after Converse has loaded or been
|
|
|
|
* initialized.
|
|
|
|
*/
|
|
|
|
class ConverseRoot extends HTMLElement {
|
|
|
|
|
2020-09-03 16:05:56 +02:00
|
|
|
async connectedCallback () {
|
|
|
|
await api.waitUntil('initialized');
|
2020-08-26 16:07:59 +02:00
|
|
|
converse.insertInto(this);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
customElements.define('converse-root', ConverseRoot);
|