Nodes style fixes, blueprint code inside element

This commit is contained in:
barsdeveloper
2023-04-27 22:07:22 +02:00
parent d97f1f39d7
commit dc3e50e09b
13 changed files with 269 additions and 92 deletions

View File

@@ -62,6 +62,13 @@ export default class BlueprintTemplate extends ITemplate {
super.initialize(element)
this.element.style.cssText = Object.entries(BlueprintTemplate.styleVariables)
.map(([k, v]) => `${k}:${v};`).join("")
const htmlTemplate = /** @type {HTMLTemplateElement} */(
this.element.querySelector(":scope > template")
)?.content.textContent
if (htmlTemplate) {
this.element.requestUpdate()
this.element.updateComplete.then(() => this.getPasteInputObject().pasted(htmlTemplate))
}
}
setup() {