Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (store.themeElement.childNodes.length === 0) {
let frag = document.createRange().createContextualFragment(html);
store.themeElement.appendChild(frag);
this.dispatchEvent(
new CustomEvent("json-outline-schema-active-body-changed", {
bubbles: true,
composed: true,
cancelable: false,
detail: html
})
);
}
}, 5);
// if there are, dynamically import them
if (varExists(this.manifest, "metadata.node.dynamicElementLoader")) {
let tagsFound = findTagsInHTML(html);
const basePath = this.pathFromUrl(
decodeURIComponent(import.meta.url)
);
for (var i in tagsFound) {
const tagName = tagsFound[i];
if (
this.manifest.metadata.node.dynamicElementLoader[tagName] &&
!window.customElements.get(tagName)
) {
import(`${basePath}../../../../${
this.manifest.metadata.node.dynamicElementLoader[tagName]
}`)
.then(response => {
// useful to debug if dynamic references are coming in
//console.log(tagName + ' dynamic import');
})
let frag = document.createRange().createContextualFragment(html);
this.appendChild(frag);
const evt = new CustomEvent(
"json-outline-schema-active-body-changed",
{
bubbles: true,
composed: true,
cancelable: false,
detail: { html }
}
);
}, 5);
});
// if there are, dynamically import them
if (varExists(this.manifest, "metadata.node.dynamicElementLoader")) {
let tagsFound = findTagsInHTML(html);
const basePath = this.pathFromUrl(
decodeURIComponent(import.meta.url)
);
for (var i in tagsFound) {
const tagName = tagsFound[i];
if (
this.manifest.metadata.node.dynamicElementLoader[tagName] &&
!window.customElements.get(tagName)
) {
import(`${basePath}../../../../../${
this.manifest.metadata.node.dynamicElementLoader[tagName]
}`)
.then(response => {
//console.log(tagName + ' dynamic import');
})
.catch(error => {
if (newValue) {
var html = newValue;
// only append if not empty
if (html !== null) {
html = encapScript(newValue);
wipeSlot(this, "*");
// insert the content as quickly as possible, then work on the dynamic imports
microTask.run(() => {
setTimeout(() => {
let frag = document.createRange().createContextualFragment(html);
this.appendChild(frag);
}, 5);
});
// if there are, dynamically import them
if (varExists(this.manifest, "metadata.node.dynamicElementLoader")) {
let tagsFound = findTagsInHTML(html);
const basePath = this.pathFromUrl(
decodeURIComponent(import.meta.url)
);
for (var i in tagsFound) {
const tagName = tagsFound[i];
if (
this.manifest.metadata.node.dynamicElementLoader[tagName] &&
!window.customElements.get(tagName)
) {
import(`${basePath}../../../../../${
this.manifest.metadata.node.dynamicElementLoader[tagName]
}`)
.then(response => {
//console.log(tagName + ' dynamic import');
})
.catch(error => {