Comparing version 0.6.0-pre.2 to 0.6.0-pre.3
@@ -15,3 +15,2 @@ /** | ||
import { directive } from '../lit-html.js'; | ||
const tmp = document.createElement('template'); | ||
/** | ||
@@ -25,2 +24,3 @@ * Renders the result as HTML, rather than text. | ||
export const unsafeHTML = (value) => directive((_part) => { | ||
const tmp = document.createElement('template'); | ||
tmp.innerHTML = value; | ||
@@ -27,0 +27,0 @@ return document.importNode(tmp.content, true); |
@@ -105,3 +105,3 @@ /** | ||
this.element = document.createElement('template'); | ||
this.element.innerHTML = this._getHtml(strings, svg); | ||
this.element.innerHTML = this._getHtml(strings, this.svg); | ||
const nodesToRemove = []; | ||
@@ -334,2 +334,6 @@ const attributesToRemove = []; | ||
// array.map((i) => html`${i}`), by reusing existing TemplateInstances. | ||
// If _previousValue is an array, then the previous render was of an iterable | ||
// and _previousValue will contain the NodeParts from the previous render. | ||
// If _previousValue is not an array, clear this part and make a new array | ||
// for NodeParts. | ||
if (!Array.isArray(this._previousValue)) { | ||
@@ -494,5 +498,5 @@ this.clear(); | ||
if (this.template.svg) { | ||
const container = fragment.firstChild; | ||
fragment.removeChild(container); | ||
const nodes = container.childNodes; | ||
const svgElement = fragment.firstChild; | ||
fragment.removeChild(svgElement); | ||
const nodes = svgElement.childNodes; | ||
for (let i = 0; i < nodes.length; i++) { | ||
@@ -499,0 +503,0 @@ fragment.appendChild(nodes.item(i)); |
{ | ||
"name": "lit-html", | ||
"version": "0.6.0-pre.2", | ||
"version": "0.6.0-pre.3", | ||
"description": "HTML template literals in JavaScript", | ||
@@ -5,0 +5,0 @@ "license": "BSD-3-Clause", |
@@ -17,4 +17,2 @@ /** | ||
const tmp = document.createElement('template'); | ||
/** | ||
@@ -29,4 +27,5 @@ * Renders the result as HTML, rather than text. | ||
directive((_part: NodePart) => { | ||
const tmp = document.createElement('template'); | ||
tmp.innerHTML = value; | ||
return document.importNode(tmp.content, true); | ||
}); |
@@ -124,3 +124,3 @@ /** | ||
this.element = document.createElement('template'); | ||
this.element.innerHTML = this._getHtml(strings, svg); | ||
this.element.innerHTML = this._getHtml(strings, this.svg); | ||
@@ -388,2 +388,6 @@ const nodesToRemove: Node[] = []; | ||
// If _previousValue is an array, then the previous render was of an iterable | ||
// and _previousValue will contain the NodeParts from the previous render. | ||
// If _previousValue is not an array, clear this part and make a new array | ||
// for NodeParts. | ||
if (!Array.isArray(this._previousValue)) { | ||
@@ -568,7 +572,7 @@ this.clear(); | ||
} | ||
if (this.template.svg) { | ||
const container = fragment.firstChild!; | ||
fragment.removeChild(container); | ||
const nodes = container.childNodes; | ||
const svgElement = fragment.firstChild!; | ||
fragment.removeChild(svgElement); | ||
const nodes = svgElement.childNodes; | ||
for (let i = 0; i < nodes.length; i++) { | ||
@@ -575,0 +579,0 @@ fragment.appendChild(nodes.item(i)); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
864476
4976