Socket
Socket
Sign inDemoInstall

lit-html

Package Overview
Dependencies
Maintainers
10
Versions
102
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lit-html - npm Package Compare versions

Comparing version 2.0.0-pre.4 to 2.0.0-pre.5

static.d.ts

2

development/lit-html.js

@@ -1016,3 +1016,3 @@ /**

// eslint-disable-next-line @typescript-eslint/no-explicit-any
((_a = globalThis)['litHtmlVersions'] ?? (_a['litHtmlVersions'] = [])).push('2.0.0-pre.4');
((_a = globalThis)['litHtmlVersions'] ?? (_a['litHtmlVersions'] = [])).push('2.0.0-pre.5');
//# sourceMappingURL=lit-html.js.map

@@ -14,3 +14,3 @@ /**

*/
var t;const s=`lit$${(Math.random()+"").slice(9)}$`,i="?"+s,e=`<${i}>`,h=document,o=(t="")=>h.createComment(t),n=t=>null===t||"object"!=typeof t&&"function"!=typeof t,r=Array.isArray,l=t=>r(t)||"function"==typeof t?.[Symbol.iterator],c=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,a=/-->/g,u=/>/g,_=/>|[ \n \r](?:([^--Ÿ "'>=/]+)([ \n \r]*=[ \n \r]*(?:[^ \n \r"'`<>=]|("|')|))|$)/g,d=/'/g,f=/"/g,v=/^(?:script|style|textarea)$/i,m=t=>(s,...i)=>({_$litType$:t,strings:s,values:i}),p=m(1),$=m(2),g=Symbol.for("lit-noChange"),y=Symbol.for("lit-nothing"),x=new Map,b=(t,s,i)=>{const e=i?.renderBefore??s;let h=e.t;if(void 0===h){const t=i?.renderBefore??null;e.t=h=new E(s.insertBefore(o(),t),t,void 0,i)}return h.M(t),h},T=h.createTreeWalker(h,133,null,!1),w=(t,i)=>{const h=t.length-1,o=[];let n,r=2===i?"<svg>":"",l=c;for(let i=0;i<h;i++){const h=t[i];let m,p,$=-1,g=0;for(;g<h.length&&(l.lastIndex=g,p=l.exec(h),null!==p);)g=l.lastIndex,l===c?"!--"===p[1]?l=a:void 0!==p[1]?l=u:void 0!==p[2]?(v.test(p[2])&&(n=RegExp("</"+p[2],"g")),l=_):void 0!==p[3]&&(l=_):l===_?">"===p[0]?(l=n??c,$=-1):void 0===p[1]?$=-2:($=l.lastIndex-p[2].length,m=p[1],l=void 0===p[3]?_:'"'===p[3]?f:d):l===f||l===d?l=_:l===a||l===u?l=c:(l=_,n=void 0);r+=l===c?h+e:$>=0?(o.push(m),h.slice(0,$)+"$lit$"+h.slice($)+s):h+s+(-2===$?":"+i:"")}return[r+(t[h]||"<?>")+(2===i?"</svg>":""),o]};class A{constructor({strings:t,_$litType$:e},h){let n;this.o=[],this.C=h;let r=0,l=0,c=0;const a=t.length-1,[u,_]=w(t,e);if(this.B=this.A(u),T.currentNode=this.B.content,2===e){const t=this.B.content,s=t.firstChild;s.remove(),t.append(...s.childNodes)}for(;null!==(n=T.nextNode())&&l<a;){if(1===n.nodeType){if(n.hasAttributes()){const t=[];for(const i of n.getAttributeNames())if(i.endsWith("$lit$")){const e=_[c++],h=n.getAttribute(e.toLowerCase()+"$lit$");t.push(i);const o=h.split(s),a=/([.?@])?(.*)/.exec(e);this.o.push({h:1,l:r,u:a[2],v:o,p:"."===a[1]?I:"?"===a[1]?M:"@"===a[1]?C:S}),l+=o.length-1}else i.startsWith(s)&&(t.push(i),this.o.push({h:6,l:r}));for(const s of t)n.removeAttribute(s)}if(v.test(n.tagName)){const t=n.textContent.split(s),i=t.length-1;if(i>0){n.textContent="";for(let s=0;s<i;s++)n.append(t[s]||o()),this.o.push({h:2,l:++r}),l++;n.append(t[i]||o())}}}else if(8===n.nodeType)if(n.data===i)l++,this.o.push({h:2,l:r});else{let t=-1;for(;-1!==(t=n.data.indexOf(s,t+1));)this.o.push({h:7,l:r}),l++,t+=s.length-1}r++}}A(t){const s=h.createElement("template");return s.innerHTML=t,s}}function V(t,s,i=t,e){var h;let o=void 0!==e?i.Σ_?.[e]:i.Σm;const r=n(s)?void 0:s._$litDirective$;return o?.constructor!==r&&(o?.R?.(!1),o=void 0===r?void 0:new r({...t,$:t,P:i,g:e}),void 0!==e?((h=i).Σ_??(h.Σ_=[]))[e]=o:i.Σm=o),void 0!==o&&(s=o.k(s.values)),s}class P{constructor(t,s){this.o=[],this.Q=void 0,this.G=t,this.P=s}V(t){const{B:{content:s},o:i}=this.G,e=h.importNode(s,!0);T.currentNode=e;let o=T.nextNode(),n=0,r=0,l=i[0];for(;void 0!==l&&null!==o;){if(n===l.l){let s;2===l.h?s=new E(o,o.nextSibling,this,t):1===l.h?s=new l.p(o,l.u,l.v,this,t):6===l.h&&(s=new N(o,this,t)),this.o.push(s),l=i[++r]}void 0!==l&&n!==l.l&&(o=T.nextNode(),n++)}return e}j(t){let s=0;for(const i of this.o)void 0!==i&&(void 0!==i.strings?(i.M(t,i,s),s+=i.strings.length-2):i.M(t[s])),s++}}class E{constructor(t,s,i,e){this.type=2,this.Q=void 0,this.D=t,this.E=s,this.P=i,this.options=e}setConnected(t){this.S?.(t)}get parentNode(){return this.D.parentNode}M(t,s=this){t=V(this,t,s),n(t)?t===y?(this.T(),this.L=y):t!==this.L&&t!==g&&this.Z(t):void 0!==t._$litType$?this.U(t):void 0!==t.nodeType?this.Y(t):l(t)?this.q(t):this.Z(t)}X(t,s=this.E){return this.D.parentNode.insertBefore(t,s)}Y(t){this.L!==t&&(this.T(),this.L=this.X(t))}Z(t){const s=this.D.nextSibling;t??(t=""),null!==s&&3===s.nodeType&&(null===this.E?null===s.nextSibling:s===this.E.previousSibling)?s.data=t:this.Y(h.createTextNode(t)),this.L=t}U(t){const{values:s,strings:i}=t,e=this.F(i,t);if(this.L?.G===e)this.L.j(s);else{const t=new P(e,this),i=t.V(this.options);t.j(s),this.Y(i),this.L=t}}F(t,s){let i=x.get(t);return void 0===i&&x.set(t,i=new A(s)),i}q(t){r(this.L)||(this.L=[],this.T());const s=this.L;let i,e=0;for(const h of t)e===s.length?s.push(i=new E(this.X(o()),this.X(o()),this,this.options)):i=s[e],i.M(h),e++;e<s.length&&(this.T(i?.E.nextSibling,e),s.length=e)}T(t=this.D.nextSibling,s){for(this.S?.(!1,!0,s);t&&t!==this.E;){const s=t.nextSibling;t.remove(),t=s}}}class S{constructor(t,s,i,e,h){this.type=1,this.L=y,this.Q=void 0,this.tt=void 0,this.element=t,this.name=s,this.P=e,this.options=h,i.length>2||""!==i[0]||""!==i[1]?(this.L=Array(i.length-1).fill(y),this.strings=i):this.L=y}get tagName(){return this.element.tagName}M(t,s=this,i,e){const h=this.strings;let o=!1;if(void 0===h)t=V(this,t,s,0),o=!n(t)||t!==this.L&&t!==g,o&&(this.L=t);else{const e=t;let r,l;for(t=h[0],r=0;r<h.length-1;r++)l=V(this,e[i+r],s,r),l===g&&(l=this.L[r]),o||(o=!n(l)||l!==this.L[r]),l===y?t=y:t!==y&&(t+=(l??"")+h[r+1]),this.L[r]=l}o&&!e&&this.it(t)}it(t){t===y?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class I extends S{constructor(){super(...arguments),this.type=3}it(t){this.element[this.name]=t===y?void 0:t}}class M extends S{constructor(){super(...arguments),this.type=4}it(t){t&&t!==y?this.element.setAttribute(this.name,""):this.element.removeAttribute(this.name)}}class C extends S{constructor(){super(...arguments),this.type=5}M(t,s=this){if((t=V(this,t,s,0)??y)===g)return;const i=this.L,e=t===y&&i!==y||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,h=t!==y&&(i===y||e);e&&this.element.removeEventListener(this.name,this,i),h&&this.element.addEventListener(this.name,this,t),this.L=t}handleEvent(t){"function"==typeof this.L?this.L.call(this.options?.host??this.element,t):this.L.handleEvent(t)}}class N{constructor(t,s,i){this.element=t,this.type=6,this.Q=void 0,this.tt=void 0,this.P=s,this.options=i}M(t){V(this,t)}}const R={et:"$lit$",nt:s,ot:i,rt:1,ht:w,lt:P,ct:l,dt:V,ut:E,at:S,ft:M,vt:C,wt:I};globalThis.litHtmlPlatformSupport?.(A,E),((t=globalThis).litHtmlVersions??(t.litHtmlVersions=[])).push("2.0.0-pre.4");export{R as _$private,p as html,g as noChange,y as nothing,b as render,$ as svg};
var t;const s=`lit$${(Math.random()+"").slice(9)}$`,i="?"+s,e=`<${i}>`,h=document,o=(t="")=>h.createComment(t),n=t=>null===t||"object"!=typeof t&&"function"!=typeof t,r=Array.isArray,l=t=>r(t)||"function"==typeof t?.[Symbol.iterator],c=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,a=/-->/g,u=/>/g,_=/>|[ \n \r](?:([^--Ÿ "'>=/]+)([ \n \r]*=[ \n \r]*(?:[^ \n \r"'`<>=]|("|')|))|$)/g,d=/'/g,f=/"/g,v=/^(?:script|style|textarea)$/i,m=t=>(s,...i)=>({_$litType$:t,strings:s,values:i}),p=m(1),$=m(2),g=Symbol.for("lit-noChange"),y=Symbol.for("lit-nothing"),x=new Map,b=(t,s,i)=>{const e=i?.renderBefore??s;let h=e.t;if(void 0===h){const t=i?.renderBefore??null;e.t=h=new E(s.insertBefore(o(),t),t,void 0,i)}return h.M(t),h},T=h.createTreeWalker(h,133,null,!1),w=(t,i)=>{const h=t.length-1,o=[];let n,r=2===i?"<svg>":"",l=c;for(let i=0;i<h;i++){const h=t[i];let m,p,$=-1,g=0;for(;g<h.length&&(l.lastIndex=g,p=l.exec(h),null!==p);)g=l.lastIndex,l===c?"!--"===p[1]?l=a:void 0!==p[1]?l=u:void 0!==p[2]?(v.test(p[2])&&(n=RegExp("</"+p[2],"g")),l=_):void 0!==p[3]&&(l=_):l===_?">"===p[0]?(l=n??c,$=-1):void 0===p[1]?$=-2:($=l.lastIndex-p[2].length,m=p[1],l=void 0===p[3]?_:'"'===p[3]?f:d):l===f||l===d?l=_:l===a||l===u?l=c:(l=_,n=void 0);r+=l===c?h+e:$>=0?(o.push(m),h.slice(0,$)+"$lit$"+h.slice($)+s):h+s+(-2===$?":"+i:"")}return[r+(t[h]||"<?>")+(2===i?"</svg>":""),o]};class A{constructor({strings:t,_$litType$:e},h){let n;this.o=[],this.C=h;let r=0,l=0,c=0;const a=t.length-1,[u,_]=w(t,e);if(this.B=this.A(u),T.currentNode=this.B.content,2===e){const t=this.B.content,s=t.firstChild;s.remove(),t.append(...s.childNodes)}for(;null!==(n=T.nextNode())&&l<a;){if(1===n.nodeType){if(n.hasAttributes()){const t=[];for(const i of n.getAttributeNames())if(i.endsWith("$lit$")){const e=_[c++],h=n.getAttribute(e.toLowerCase()+"$lit$");t.push(i);const o=h.split(s),a=/([.?@])?(.*)/.exec(e);this.o.push({h:1,l:r,u:a[2],v:o,p:"."===a[1]?I:"?"===a[1]?M:"@"===a[1]?C:S}),l+=o.length-1}else i.startsWith(s)&&(t.push(i),this.o.push({h:6,l:r}));for(const s of t)n.removeAttribute(s)}if(v.test(n.tagName)){const t=n.textContent.split(s),i=t.length-1;if(i>0){n.textContent="";for(let s=0;s<i;s++)n.append(t[s]||o()),this.o.push({h:2,l:++r}),l++;n.append(t[i]||o())}}}else if(8===n.nodeType)if(n.data===i)l++,this.o.push({h:2,l:r});else{let t=-1;for(;-1!==(t=n.data.indexOf(s,t+1));)this.o.push({h:7,l:r}),l++,t+=s.length-1}r++}}A(t){const s=h.createElement("template");return s.innerHTML=t,s}}function V(t,s,i=t,e){var h;let o=void 0!==e?i.Σ_?.[e]:i.Σm;const r=n(s)?void 0:s._$litDirective$;return o?.constructor!==r&&(o?.R?.(!1),o=void 0===r?void 0:new r({...t,$:t,P:i,g:e}),void 0!==e?((h=i).Σ_??(h.Σ_=[]))[e]=o:i.Σm=o),void 0!==o&&(s=o.k(s.values)),s}class P{constructor(t,s){this.o=[],this.Q=void 0,this.G=t,this.P=s}V(t){const{B:{content:s},o:i}=this.G,e=h.importNode(s,!0);T.currentNode=e;let o=T.nextNode(),n=0,r=0,l=i[0];for(;void 0!==l&&null!==o;){if(n===l.l){let s;2===l.h?s=new E(o,o.nextSibling,this,t):1===l.h?s=new l.p(o,l.u,l.v,this,t):6===l.h&&(s=new N(o,this,t)),this.o.push(s),l=i[++r]}void 0!==l&&n!==l.l&&(o=T.nextNode(),n++)}return e}j(t){let s=0;for(const i of this.o)void 0!==i&&(void 0!==i.strings?(i.M(t,i,s),s+=i.strings.length-2):i.M(t[s])),s++}}class E{constructor(t,s,i,e){this.type=2,this.Q=void 0,this.D=t,this.E=s,this.P=i,this.options=e}setConnected(t){this.S?.(t)}get parentNode(){return this.D.parentNode}M(t,s=this){t=V(this,t,s),n(t)?t===y?(this.T(),this.L=y):t!==this.L&&t!==g&&this.Z(t):void 0!==t._$litType$?this.U(t):void 0!==t.nodeType?this.Y(t):l(t)?this.q(t):this.Z(t)}X(t,s=this.E){return this.D.parentNode.insertBefore(t,s)}Y(t){this.L!==t&&(this.T(),this.L=this.X(t))}Z(t){const s=this.D.nextSibling;t??(t=""),null!==s&&3===s.nodeType&&(null===this.E?null===s.nextSibling:s===this.E.previousSibling)?s.data=t:this.Y(h.createTextNode(t)),this.L=t}U(t){const{values:s,strings:i}=t,e=this.F(i,t);if(this.L?.G===e)this.L.j(s);else{const t=new P(e,this),i=t.V(this.options);t.j(s),this.Y(i),this.L=t}}F(t,s){let i=x.get(t);return void 0===i&&x.set(t,i=new A(s)),i}q(t){r(this.L)||(this.L=[],this.T());const s=this.L;let i,e=0;for(const h of t)e===s.length?s.push(i=new E(this.X(o()),this.X(o()),this,this.options)):i=s[e],i.M(h),e++;e<s.length&&(this.T(i?.E.nextSibling,e),s.length=e)}T(t=this.D.nextSibling,s){for(this.S?.(!1,!0,s);t&&t!==this.E;){const s=t.nextSibling;t.remove(),t=s}}}class S{constructor(t,s,i,e,h){this.type=1,this.L=y,this.Q=void 0,this.tt=void 0,this.element=t,this.name=s,this.P=e,this.options=h,i.length>2||""!==i[0]||""!==i[1]?(this.L=Array(i.length-1).fill(y),this.strings=i):this.L=y}get tagName(){return this.element.tagName}M(t,s=this,i,e){const h=this.strings;let o=!1;if(void 0===h)t=V(this,t,s,0),o=!n(t)||t!==this.L&&t!==g,o&&(this.L=t);else{const e=t;let r,l;for(t=h[0],r=0;r<h.length-1;r++)l=V(this,e[i+r],s,r),l===g&&(l=this.L[r]),o||(o=!n(l)||l!==this.L[r]),l===y?t=y:t!==y&&(t+=(l??"")+h[r+1]),this.L[r]=l}o&&!e&&this.it(t)}it(t){t===y?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class I extends S{constructor(){super(...arguments),this.type=3}it(t){this.element[this.name]=t===y?void 0:t}}class M extends S{constructor(){super(...arguments),this.type=4}it(t){t&&t!==y?this.element.setAttribute(this.name,""):this.element.removeAttribute(this.name)}}class C extends S{constructor(){super(...arguments),this.type=5}M(t,s=this){if((t=V(this,t,s,0)??y)===g)return;const i=this.L,e=t===y&&i!==y||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,h=t!==y&&(i===y||e);e&&this.element.removeEventListener(this.name,this,i),h&&this.element.addEventListener(this.name,this,t),this.L=t}handleEvent(t){"function"==typeof this.L?this.L.call(this.options?.host??this.element,t):this.L.handleEvent(t)}}class N{constructor(t,s,i){this.element=t,this.type=6,this.Q=void 0,this.tt=void 0,this.P=s,this.options=i}M(t){V(this,t)}}const R={et:"$lit$",nt:s,ot:i,rt:1,ht:w,lt:P,ct:l,dt:V,ut:E,at:S,ft:M,vt:C,wt:I};globalThis.litHtmlPlatformSupport?.(A,E),((t=globalThis).litHtmlVersions??(t.litHtmlVersions=[])).push("2.0.0-pre.5");export{R as _$private,p as html,g as noChange,y as nothing,b as render,$ as svg};
//# sourceMappingURL=lit-html.js.map
{
"name": "lit-html",
"version": "2.0.0-pre.4",
"version": "2.0.0-pre.5",
"description": "HTML templates literals in JavaScript",

@@ -64,6 +64,2 @@ "license": "BSD-3-Clause",

"/directives/",
"/lit-html.d.ts",
"/lit-html.d.ts.map",
"/lit-html.js",
"/lit-html.js.map",
"/directive.d.ts",

@@ -81,2 +77,10 @@ "/directive.d.ts.map",

"/disconnectable-directive.js.map",
"/hydrate.js",
"/hydrate.js.map",
"/hydrate.d.ts",
"/hydrate.d.ts.map",
"/lit-html.d.ts",
"/lit-html.d.ts.map",
"/lit-html.js",
"/lit-html.js.map",
"/platform-support.d.ts",

@@ -86,6 +90,2 @@ "/platform-support.d.ts.map",

"/platform-support.js.map",
"/hydrate.js",
"/hydrate.js.map",
"/hydrate.d.ts",
"/hydrate.d.ts.map",
"/private-ssr-support.js",

@@ -96,3 +96,7 @@ "/private-ssr-support.js.map",

"/src/",
"!/src/test/"
"!/src/test/",
"/static.js",
"/static.js.map",
"/static.d.ts",
"/static.d.ts.map"
],

@@ -99,0 +103,0 @@ "dependencies": {},

@@ -1424,2 +1424,2 @@ /**

// eslint-disable-next-line @typescript-eslint/no-explicit-any
((globalThis as any)['litHtmlVersions'] ??= []).push('2.0.0-pre.4');
((globalThis as any)['litHtmlVersions'] ??= []).push('2.0.0-pre.5');

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc