as-custom-element
Advanced tools
Comparing version 0.2.0 to 0.2.1
@@ -56,3 +56,3 @@ 'use strict'; | ||
) => { | ||
mainLoop(observer.takeRecords()); | ||
// mainLoop(observer.takeRecords()); | ||
const {a, c, d} = wm.get(target) || set(target); | ||
@@ -59,0 +59,0 @@ if (observedAttributes) { |
@@ -1,1 +0,1 @@ | ||
self.asCustomElement=function(e){"use strict";const t=new Set,a=new MutationObserver(e=>{t.forEach(r,e)});function r(e){e(this,a)}a.observe(document,{subtree:!0,childList:!0}),t.observer=a;const n=new WeakMap,{observer:o}=t,c=e=>{for(let t=0,{length:a}=e;t<a;t++){const{target:a,attributeName:r,oldValue:o}=e[t],c=a.getAttribute(r);n.get(a).a[r].forEach(e=>{e.call(a,r,o,c)})}},s=(e,t)=>{for(let a=0,{length:r}=e;a<r;a++){const r=e[a];n.has(r)&&n.get(r)[t].forEach(u,r),s(r.children||[],t)}},l=e=>{for(let t=0,{length:a}=e;t<a;t++){const{addedNodes:a,removedNodes:r}=e[t];s(a,"c"),c(d.takeRecords()),s(r,"d")}},d=new MutationObserver(c);t.add(l);function u(e){e.call(this)}return e.default=(e,{connectedCallback:t,disconnectedCallback:a,observedAttributes:r,attributeChangedCallback:c})=>{l(o.takeRecords());const{a:s,c:u,d:i}=n.get(e)||(e=>{const t={a:{},c:new Set,d:new Set};return n.set(e,t),t})(e);return r&&(d.observe(e,{attributes:!0,attributeOldValue:!0,attributeFilter:r}),r.forEach(t=>{(s[t]||(s[t]=new Set)).add(c),e.hasAttribute(t)&&c.call(e,t,null,e.getAttribute(t))})),a&&i.add(a),t&&(u.add(t),e.ownerDocument.compareDocumentPosition(e)&e.DOCUMENT_POSITION_DISCONNECTED||t.call(e)),e},e}({}).default; | ||
self.asCustomElement=function(t){"use strict";const e=new Set,a=new MutationObserver(t=>{e.forEach(n,t)});function n(t){t(this,a)}a.observe(document,{subtree:!0,childList:!0}),e.observer=a;const r=new WeakMap,o=t=>{for(let e=0,{length:a}=t;e<a;e++){const{target:a,attributeName:n,oldValue:o}=t[e],c=a.getAttribute(n);r.get(a).a[n].forEach(t=>{t.call(a,n,o,c)})}},c=(t,e)=>{for(let a=0,{length:n}=t;a<n;a++){const n=t[a];r.has(n)&&r.get(n)[e].forEach(s,n),c(n.children||[],e)}},l=new MutationObserver(o);e.add(t=>{for(let e=0,{length:a}=t;e<a;e++){const{addedNodes:a,removedNodes:n}=t[e];c(a,"c"),o(l.takeRecords()),c(n,"d")}});function s(t){t.call(this)}return t.default=(t,{connectedCallback:e,disconnectedCallback:a,observedAttributes:n,attributeChangedCallback:o})=>{const{a:c,c:s,d:d}=r.get(t)||(t=>{const e={a:{},c:new Set,d:new Set};return r.set(t,e),e})(t);return n&&(l.observe(t,{attributes:!0,attributeOldValue:!0,attributeFilter:n}),n.forEach(e=>{(c[e]||(c[e]=new Set)).add(o),t.hasAttribute(e)&&o.call(t,e,null,t.getAttribute(e))})),a&&d.add(a),e&&(s.add(e),t.ownerDocument.compareDocumentPosition(t)&t.DOCUMENT_POSITION_DISCONNECTED||e.call(t)),t},t}({}).default; |
@@ -55,3 +55,3 @@ import sdo from 'shared-document-observer'; | ||
) => { | ||
mainLoop(observer.takeRecords()); | ||
// mainLoop(observer.takeRecords()); | ||
const {a, c, d} = wm.get(target) || set(target); | ||
@@ -58,0 +58,0 @@ if (observedAttributes) { |
@@ -19,3 +19,2 @@ self.asCustomElement = (function (exports) { | ||
var wm = new WeakMap(); | ||
var observer$1 = set.observer; | ||
@@ -76,4 +75,4 @@ var attributeChanged = function attributeChanged(records) { | ||
attributeChangedCallback = _ref.attributeChangedCallback; | ||
mainLoop(observer$1.takeRecords()); | ||
// mainLoop(observer.takeRecords()); | ||
var _ref2 = wm.get(target) || set$1(target), | ||
@@ -80,0 +79,0 @@ a = _ref2.a, |
@@ -1,1 +0,1 @@ | ||
self.asCustomElement=function(e){"use strict";var t=new Set,a=new MutationObserver((function(e){t.forEach(r,e)}));function r(e){e(this,a)}a.observe(document,{subtree:!0,childList:!0}),t.observer=a;var n=new WeakMap,o=t.observer,c=function(e){for(var t=function(t,a){var r=e[t],o=r.target,c=r.attributeName,u=r.oldValue,i=o.getAttribute(c);n.get(o).a[c].forEach((function(e){e.call(o,c,u,i)}))},a=0,r=e.length;a<r;a++)t(a)},u=function e(t,a){for(var r=0,o=t.length;r<o;r++){var c=t[r];n.has(c)&&n.get(c)[a].forEach(l,c),e(c.children||[],a)}},i=function(e){for(var t=0,a=e.length;t<a;t++){var r=e[t],n=r.addedNodes,o=r.removedNodes;u(n,"c"),c(d.takeRecords()),u(o,"d")}},d=new MutationObserver(c);t.add(i);function l(e){e.call(this)}return e.default=function(e,t){var a=t.connectedCallback,r=t.disconnectedCallback,c=t.observedAttributes,u=t.attributeChangedCallback;i(o.takeRecords());var l=n.get(e)||function(e){var t={a:{},c:new Set,d:new Set};return n.set(e,t),t}(e),s=l.a,f=l.c,b=l.d;return c&&(d.observe(e,{attributes:!0,attributeOldValue:!0,attributeFilter:c}),c.forEach((function(t){(s[t]||(s[t]=new Set)).add(u),e.hasAttribute(t)&&u.call(e,t,null,e.getAttribute(t))}))),r&&b.add(r),a&&(f.add(a),e.ownerDocument.compareDocumentPosition(e)&e.DOCUMENT_POSITION_DISCONNECTED||a.call(e)),e},e}({}).default; | ||
self.asCustomElement=function(t){"use strict";var e=new Set,a=new MutationObserver((function(t){e.forEach(n,t)}));function n(t){t(this,a)}a.observe(document,{subtree:!0,childList:!0}),e.observer=a;var r=new WeakMap,o=function(t){for(var e=function(e,a){var n=t[e],o=n.target,c=n.attributeName,u=n.oldValue,i=o.getAttribute(c);r.get(o).a[c].forEach((function(t){t.call(o,c,u,i)}))},a=0,n=t.length;a<n;a++)e(a)},c=function t(e,a){for(var n=0,o=e.length;n<o;n++){var c=e[n];r.has(c)&&r.get(c)[a].forEach(i,c),t(c.children||[],a)}},u=new MutationObserver(o);e.add((function(t){for(var e=0,a=t.length;e<a;e++){var n=t[e],r=n.addedNodes,i=n.removedNodes;c(r,"c"),o(u.takeRecords()),c(i,"d")}}));function i(t){t.call(this)}return t.default=function(t,e){var a=e.connectedCallback,n=e.disconnectedCallback,o=e.observedAttributes,c=e.attributeChangedCallback,i=r.get(t)||function(t){var e={a:{},c:new Set,d:new Set};return r.set(t,e),e}(t),d=i.a,l=i.c,s=i.d;return o&&(u.observe(t,{attributes:!0,attributeOldValue:!0,attributeFilter:o}),o.forEach((function(e){(d[e]||(d[e]=new Set)).add(c),t.hasAttribute(e)&&c.call(t,e,null,t.getAttribute(e))}))),n&&s.add(n),a&&(l.add(a),t.ownerDocument.compareDocumentPosition(t)&t.DOCUMENT_POSITION_DISCONNECTED||a.call(t)),t},t}({}).default; |
{ | ||
"name": "as-custom-element", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"description": "Setup any element as if it was a Custom Element", | ||
@@ -5,0 +5,0 @@ "main": "./cjs/index.js", |
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
13782
262