qsa-observer
Advanced tools
Comparing version 3.0.0 to 3.0.1
@@ -63,3 +63,3 @@ 'use strict'; | ||
const shadowRoot = attachShadow.call(this, init); | ||
observer.add(shadowRoot); | ||
observer.observe(shadowRoot); | ||
return shadowRoot; | ||
@@ -66,0 +66,0 @@ }; |
self.qsaObserver=function(e){"use strict"; | ||
/*! (c) Andrea Giammarchi - ISC */const t=!0,o=!1,r="querySelectorAll",l="querySelectorAll",{document:s,Element:a,MutationObserver:n,Set:d,WeakMap:c}=self,h=e=>l in e,{filter:f}=[];return e.default=e=>{const u=new c,i=(t,o)=>{let r;if(o)for(let l,s=(e=>e.matches||e.webkitMatchesSelector||e.msMatchesSelector)(t),a=0,{length:n}=S;a<n;a++)s.call(t,l=S[a])&&(u.has(t)||u.set(t,new d),r=u.get(t),r.has(l)||(r.add(l),e.handle(t,o,l)));else u.has(t)&&(r=u.get(t),u.delete(t),r.forEach((r=>{e.handle(t,o,r)})))},v=(e,t=!0)=>{for(let o=0,{length:r}=e;o<r;o++)i(e[o],t)},{query:S}=e,b=e.root||s,g=((e,l=document,s=MutationObserver,a=["*"])=>{const n=(o,l,s,a,d,c)=>{for(const h of o)(c||r in h)&&(d?s.has(h)||(s.add(h),a.delete(h),e(h,d)):a.has(h)||(a.add(h),s.delete(h),e(h,d)),c||n(h[r](l),l,s,a,d,t))},d=new s((e=>{if(a.length){const r=a.join(","),l=new Set,s=new Set;for(const{addedNodes:a,removedNodes:d}of e)n(d,r,l,s,o,o),n(a,r,l,s,t,o)}})),{observe:c}=d;return(d.observe=e=>c.call(d,e,{subtree:t,childList:t}))(l),d})(i,b,n,S),{attachShadow:w}=a.prototype;return w&&(a.prototype.attachShadow=function(e){const t=w.call(this,e);return g.add(t),t}),S.length&&v(b[l](S)),{drop:e=>{for(let t=0,{length:o}=e;t<o;t++)u.delete(e[t])},flush:()=>{const e=g.takeRecords();for(let t=0,{length:o}=e;t<o;t++)v(f.call(e[t].removedNodes,h),!1),v(f.call(e[t].addedNodes,h),!0)},observer:g,parse:v}},e}({}).default; | ||
/*! (c) Andrea Giammarchi - ISC */const t=!0,o=!1,r="querySelectorAll",l="querySelectorAll",{document:s,Element:n,MutationObserver:a,Set:d,WeakMap:c}=self,h=e=>l in e,{filter:f}=[];return e.default=e=>{const u=new c,i=(t,o)=>{let r;if(o)for(let l,s=(e=>e.matches||e.webkitMatchesSelector||e.msMatchesSelector)(t),n=0,{length:a}=b;n<a;n++)s.call(t,l=b[n])&&(u.has(t)||u.set(t,new d),r=u.get(t),r.has(l)||(r.add(l),e.handle(t,o,l)));else u.has(t)&&(r=u.get(t),u.delete(t),r.forEach((r=>{e.handle(t,o,r)})))},v=(e,t=!0)=>{for(let o=0,{length:r}=e;o<r;o++)i(e[o],t)},{query:b}=e,S=e.root||s,g=((e,l=document,s=MutationObserver,n=["*"])=>{const a=(o,l,s,n,d,c)=>{for(const h of o)(c||r in h)&&(d?s.has(h)||(s.add(h),n.delete(h),e(h,d)):n.has(h)||(n.add(h),s.delete(h),e(h,d)),c||a(h[r](l),l,s,n,d,t))},d=new s((e=>{if(n.length){const r=n.join(","),l=new Set,s=new Set;for(const{addedNodes:n,removedNodes:d}of e)a(d,r,l,s,o,o),a(n,r,l,s,t,o)}})),{observe:c}=d;return(d.observe=e=>c.call(d,e,{subtree:t,childList:t}))(l),d})(i,S,a,b),{attachShadow:w}=n.prototype;return w&&(n.prototype.attachShadow=function(e){const t=w.call(this,e);return g.observe(t),t}),b.length&&v(S[l](b)),{drop:e=>{for(let t=0,{length:o}=e;t<o;t++)u.delete(e[t])},flush:()=>{const e=g.takeRecords();for(let t=0,{length:o}=e;t<o;t++)v(f.call(e[t].removedNodes,h),!1),v(f.call(e[t].addedNodes,h),!0)},observer:g,parse:v}},e}({}).default; |
/*! (c) Andrea Giammarchi - ISC */ | ||
const e="querySelectorAll",t="querySelectorAll",{document:o,Element:l,MutationObserver:r,Set:a,WeakMap:s}=self,d=e=>t in e,{filter:n}=[];var c=c=>{const h=new s,f=(e,t)=>{let o;if(t)for(let l,r=(e=>e.matches||e.webkitMatchesSelector||e.msMatchesSelector)(e),s=0,{length:d}=i;s<d;s++)r.call(e,l=i[s])&&(h.has(e)||h.set(e,new a),o=h.get(e),o.has(l)||(o.add(l),c.handle(e,t,l)));else h.has(e)&&(o=h.get(e),h.delete(e),o.forEach((o=>{c.handle(e,t,o)})))},u=(e,t=!0)=>{for(let o=0,{length:l}=e;o<l;o++)f(e[o],t)},{query:i}=c,S=c.root||o,g=((t,o=document,l=MutationObserver,r=["*"])=>{const a=(o,l,r,s,d,n)=>{for(const c of o)(n||e in c)&&(d?r.has(c)||(r.add(c),s.delete(c),t(c,d)):s.has(c)||(s.add(c),r.delete(c),t(c,d)),n||a(c[e](l),l,r,s,d,!0))},s=new l((e=>{if(r.length){const t=r.join(","),o=new Set,l=new Set;for(const{addedNodes:r,removedNodes:s}of e)a(s,t,o,l,!1,!1),a(r,t,o,l,!0,!1)}})),{observe:d}=s;return(s.observe=e=>d.call(s,e,{subtree:!0,childList:!0}))(o),s})(f,S,r,i),{attachShadow:p}=l.prototype;return p&&(l.prototype.attachShadow=function(e){const t=p.call(this,e);return g.add(t),t}),i.length&&u(S[t](i)),{drop:e=>{for(let t=0,{length:o}=e;t<o;t++)h.delete(e[t])},flush:()=>{const e=g.takeRecords();for(let t=0,{length:o}=e;t<o;t++)u(n.call(e[t].removedNodes,d),!1),u(n.call(e[t].addedNodes,d),!0)},observer:g,parse:u}};export{c as default}; | ||
const e="querySelectorAll",t="querySelectorAll",{document:o,Element:l,MutationObserver:r,Set:s,WeakMap:a}=self,n=e=>t in e,{filter:d}=[];var c=c=>{const h=new a,f=(e,t)=>{let o;if(t)for(let l,r=(e=>e.matches||e.webkitMatchesSelector||e.msMatchesSelector)(e),a=0,{length:n}=i;a<n;a++)r.call(e,l=i[a])&&(h.has(e)||h.set(e,new s),o=h.get(e),o.has(l)||(o.add(l),c.handle(e,t,l)));else h.has(e)&&(o=h.get(e),h.delete(e),o.forEach((o=>{c.handle(e,t,o)})))},u=(e,t=!0)=>{for(let o=0,{length:l}=e;o<l;o++)f(e[o],t)},{query:i}=c,v=c.root||o,S=((t,o=document,l=MutationObserver,r=["*"])=>{const s=(o,l,r,a,n,d)=>{for(const c of o)(d||e in c)&&(n?r.has(c)||(r.add(c),a.delete(c),t(c,n)):a.has(c)||(a.add(c),r.delete(c),t(c,n)),d||s(c[e](l),l,r,a,n,!0))},a=new l((e=>{if(r.length){const t=r.join(","),o=new Set,l=new Set;for(const{addedNodes:r,removedNodes:a}of e)s(a,t,o,l,!1,!1),s(r,t,o,l,!0,!1)}})),{observe:n}=a;return(a.observe=e=>n.call(a,e,{subtree:!0,childList:!0}))(o),a})(f,v,r,i),{attachShadow:b}=l.prototype;return b&&(l.prototype.attachShadow=function(e){const t=b.call(this,e);return S.observe(t),t}),i.length&&u(v[t](i)),{drop:e=>{for(let t=0,{length:o}=e;t<o;t++)h.delete(e[t])},flush:()=>{const e=S.takeRecords();for(let t=0,{length:o}=e;t<o;t++)u(d.call(e[t].removedNodes,n),!1),u(d.call(e[t].addedNodes,n),!0)},observer:S,parse:u}};export{c as default}; |
@@ -62,3 +62,3 @@ import {notify} from 'element-notifier'; | ||
const shadowRoot = attachShadow.call(this, init); | ||
observer.add(shadowRoot); | ||
observer.observe(shadowRoot); | ||
return shadowRoot; | ||
@@ -65,0 +65,0 @@ }; |
@@ -113,3 +113,3 @@ self.qsaObserver = (function (exports) { | ||
const shadowRoot = attachShadow.call(this, init); | ||
observer.add(shadowRoot); | ||
observer.observe(shadowRoot); | ||
return shadowRoot; | ||
@@ -116,0 +116,0 @@ }; |
{ | ||
"name": "qsa-observer", | ||
"version": "3.0.0", | ||
"version": "3.0.1", | ||
"description": "handle elements lifecycle through CSS selectors", | ||
@@ -24,3 +24,3 @@ "main": "./cjs/index.js", | ||
"ascjs": "^5.0.1", | ||
"rollup": "^2.74.1", | ||
"rollup": "^2.75.5", | ||
"rollup-plugin-terser": "^7.0.2" | ||
@@ -27,0 +27,0 @@ }, |
15237