diff --git a/dist/dde-with-observables.js b/dist/dde-with-observables.js
index 2d874f4..f6eb9fd 100644
--- a/dist/dde-with-observables.js
+++ b/dist/dde-with-observables.js
@@ -1,31 +1,31 @@
//deka-dom-el library is available via global namespace `dde`
(()=> {
-var A={isObservable(t){return!1},processReactiveAttribute(t,e,n,r){return n}};function T(t,e=!0){return e?Object.assign(A,t):(Object.setPrototypeOf(t,A),t)}function C(t){return A.isPrototypeOf(t)&&t!==A?t:A}function y(t){return typeof t>"u"}function B(t){let e=typeof t;return e!=="object"?e:t===null?"null":Object.prototype.toString.call(t)}function S(t,e){if(!t||!(t instanceof AbortSignal))return!0;if(!t.aborted)return t.addEventListener("abort",e),function(){t.removeEventListener("abort",e)}}function N(t,e){let{observedAttributes:n=[]}=t.constructor;return n.reduce(function(r,o){return Reflect.set(r,ot(o),e(t,o)),r},{})}function ot(t){return t.replace(/-./g,e=>e[1].toUpperCase())}var M={setDeleteAttr:ct,ssr:""};function ct(t,e,n){if(Reflect.set(t,e,n),!!y(n)){if(Reflect.deleteProperty(t,e),t instanceof HTMLElement&&t.getAttribute(e)==="undefined")return t.removeAttribute(e);if(Reflect.get(t,e)==="undefined")return Reflect.set(t,e,"")}}var x=[{scope:document.body,host:t=>t?t(document.body):document.body,custom_element:!1,prevent:!0}],b={get current(){return x[x.length-1]},get host(){return this.current.host},preventDefault(){let{current:t}=this;return t.prevent=!0,t},get state(){return[...x]},push(t={}){return x.push(Object.assign({},this.current,{prevent:!1},t))},pushRoot(){return x.push(x[0])},pop(){if(x.length!==1)return x.pop()}};function H(...t){return this.appendOriginal(...t),this}function st(t){return t.append===H||(t.appendOriginal=t.append,t.append=H),t}var P;function w(t,e,...n){let r=C(this),o=0,c,s;switch((Object(e)!==e||r.isObservable(e))&&(e={textContent:e}),!0){case typeof t=="function":{o=1,b.push({scope:t,host:(...l)=>l.length?(o===1?n.unshift(...l):l.forEach(h=>h(s)),void 0):s}),c=t(e||void 0);let a=c instanceof DocumentFragment;if(c.nodeName==="#comment")break;let d=w.mark({type:"component",name:t.name,host:a?"this":"parentElement"});c.prepend(d),a&&(s=d);break}case t==="#text":c=O.call(this,document.createTextNode(""),e);break;case(t==="<>"||!t):c=O.call(this,document.createDocumentFragment(),e);break;case!!P:c=O.call(this,document.createElementNS(P,t),e);break;case!c:c=O.call(this,document.createElement(t),e)}return st(c),s||(s=c),n.forEach(a=>a(s)),o&&b.pop(),o=2,c}function wt(t,e=t,n=void 0){let r=Symbol.for("default"),o=Array.from(e.querySelectorAll("slot")).reduce((s,a)=>Reflect.set(s,a.name||r,a)&&s,{}),c=Reflect.has(o,r);if(t.append=new Proxy(t.append,{apply(s,a,d){if(!d.length)return t;let l=document.createDocumentFragment();for(let h of d){if(!h||!h.slot){c&&l.appendChild(h);continue}let i=h.slot,u=o[i];ft(h,"remove","slot"),u&&(it(u,h,n),Reflect.deleteProperty(o,i))}return c&&(o[r].replaceWith(l),Reflect.deleteProperty(o,r)),t.append=s,t}}),t!==e){let s=Array.from(t.childNodes);s.forEach(a=>a.remove()),t.append(...s)}return e}function it(t,e,n){n&&n(t,e);try{t.replaceWith(O(e,{className:[e.className,t.className],dataset:{...t.dataset}}))}catch{t.replaceWith(e)}}w.mark=function(t,e=!1){t=Object.entries(t).map(([o,c])=>o+`="${c}"`).join(" ");let n=e?"":"/",r=document.createComment(``);return e||(r.end=document.createComment("")),r};function Rt(t){let e=this;return function(...r){P=t;let o=w.call(e,...r);return P=void 0,o}}var{setDeleteAttr:I}=M,j=new WeakMap;function O(t,...e){if(!e.length)return t;j.set(t,G(t,this));for(let[n,r]of Object.entries(Object.assign({},...e)))Z.call(this,t,n,r);return j.delete(t),t}function Z(t,e,n){let{setRemoveAttr:r,s:o}=G(t,this),c=this;n=o.processReactiveAttribute(t,e,n,(a,d)=>Z.call(c,t,a,d));let[s]=e;if(s==="=")return r(e.slice(1),n);if(s===".")return J(t,e.slice(1),n);if(/(aria|data)([A-Z])/.test(e))return e=e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),r(e,n);switch(e==="className"&&(e="class"),e){case"xlink:href":return r(e,n,"http://www.w3.org/1999/xlink");case"textContent":return I(t,e,n);case"style":if(typeof n!="object")break;case"dataset":return $(o,n,J.bind(null,t[e]));case"ariaset":return $(o,n,(a,d)=>r("aria-"+a,d));case"classList":return ut.call(c,t,n)}return at(t,e)?I(t,e,n):r(e,n)}function G(t,e){if(j.has(t))return j.get(t);let r=(t instanceof SVGElement?lt:dt).bind(null,t,"Attribute"),o=C(e);return{setRemoveAttr:r,s:o}}function ut(t,e){let n=C(this);return $(n,e,(r,o)=>t.classList.toggle(r,o===-1?void 0:!!o)),t}function Ct(t){return Array.from(t.children).forEach(e=>e.remove()),t}function ft(t,e,n,r){return t instanceof HTMLElement?t[e+"Attribute"](n,r):t[e+"AttributeNS"](null,n,r)}function at(t,e){if(!Reflect.has(t,e))return!1;let n=V(t,e);return!y(n.set)}function V(t,e){if(t=Object.getPrototypeOf(t),!t)return{};let n=Object.getOwnPropertyDescriptor(t,e);return n||V(t,e)}function $(t,e,n){if(!(typeof e!="object"||e===null))return Object.entries(e).forEach(function([o,c]){o&&(c=t.processReactiveAttribute(e,o,c,n),n(o,c))})}function K(t){return Array.isArray(t)?t.filter(Boolean).join(" "):t}function dt(t,e,n,r){return t[(y(r)?"remove":"set")+e](n,K(r))}function lt(t,e,n,r,o=null){return t[(y(r)?"remove":"set")+e+"NS"](o,n,K(r))}function J(t,e,n){if(Reflect.set(t,e,n),!!y(n))return Reflect.deleteProperty(t,e)}function jt(t,e,n=pt){b.push({scope:t,host:(...o)=>o.length?o.forEach(c=>c(t)):t,custom_element:t}),typeof n=="function"&&(n=n.call(t,t));let r=e.call(t,n);return b.pop(),r}function kt(t){for(let n of["connected","disconnected"])Q(t.prototype,n+"Callback",function(r,o,c){r.apply(o,c),o.dispatchEvent(new Event("dde:"+n))});let e="attributeChanged";return Q(t.prototype,e+"Callback",function(n,r,o){let[c,,s]=o;r.dispatchEvent(new CustomEvent("dde:"+e,{detail:[c,s]})),n.apply(r,o)}),t.prototype.__dde_lifecycleToEvents=!0,t}function Q(t,e,n){t[e]=new Proxy(t[e]||(()=>{}),{apply:n})}function pt(t){return N(t,(e,n)=>e.getAttribute(n))}function Wt(t,e,n){return e||(e={}),function(o,...c){n&&(c.unshift(o),o=typeof n=="function"?n():n);let s=c.length?new CustomEvent(t,Object.assign({detail:c[0]},e)):new Event(t,e);return o.dispatchEvent(s)}}function E(t,e,n){return function(o){return o.addEventListener(t,e,n),o}}var k=bt(),ht=new WeakSet;E.connected=function(t,e){let{custom_element:n}=b.current,r="connected";return typeof e!="object"&&(e={}),e.once=!0,function(c){n&&(c=n);let s="dde:"+r;return c.addEventListener(s,t,e),c.__dde_lifecycleToEvents?c:c.isConnected?(c.dispatchEvent(new Event(s)),c):(S(e.signal,()=>k.offConnected(c,t))&&k.onConnected(c,t),c)}};E.disconnected=function(t,e){let{custom_element:n}=b.current,r="disconnected";return typeof e!="object"&&(e={}),e.once=!0,function(c){n&&(c=n);let s="dde:"+r;return c.addEventListener(s,t,e),c.__dde_lifecycleToEvents||S(e.signal,()=>k.offDisconnected(c,t))&&k.onDisconnected(c,t),c}};var F=new WeakMap;E.disconnectedAsAbort=function(t){if(F.has(t))return F.get(t);let e=new AbortController;return F.set(t,e),t(E.disconnected(()=>e.abort())),e};E.attributeChanged=function(t,e){let n="attributeChanged";return typeof e!="object"&&(e={}),function(o){let c="dde:"+n;if(o.addEventListener(c,t,e),o.__dde_lifecycleToEvents||ht.has(o))return o;let s=new MutationObserver(function(d){for(let{attributeName:l,target:h}of d)h.dispatchEvent(new CustomEvent(c,{detail:[l,h.getAttribute(l)]}))});return S(e.signal,()=>s.disconnect())&&s.observe(o,{attributes:!0}),o}};function bt(){let t=new Map,e=!1,n=new MutationObserver(function(i){for(let u of i)if(u.type==="childList"){if(l(u.addedNodes,!0)){s();continue}h(u.removedNodes,!0)&&s()}});return{onConnected(i,u){c();let f=o(i);f.connected.has(u)||(f.connected.add(u),f.length_c+=1)},offConnected(i,u){if(!t.has(i))return;let f=t.get(i);f.connected.has(u)&&(f.connected.delete(u),f.length_c-=1,r(i,f))},onDisconnected(i,u){c();let f=o(i);f.disconnected.has(u)||(f.disconnected.add(u),f.length_d+=1)},offDisconnected(i,u){if(!t.has(i))return;let f=t.get(i);f.disconnected.has(u)&&(f.disconnected.delete(u),f.length_d-=1,r(i,f))}};function r(i,u){u.length_c||u.length_d||(t.delete(i),s())}function o(i){if(t.has(i))return t.get(i);let u={connected:new WeakSet,length_c:0,disconnected:new WeakSet,length_d:0};return t.set(i,u),u}function c(){e||(e=!0,n.observe(document.body,{childList:!0,subtree:!0}))}function s(){!e||t.size||(e=!1,n.disconnect())}function a(){return new Promise(function(i){(requestIdleCallback||requestAnimationFrame)(i)})}async function d(i){t.size>30&&await a();let u=[];if(!(i instanceof Node))return u;for(let f of t.keys())f===i||!(f instanceof Node)||i.contains(f)&&u.push(f);return u}function l(i,u){let f=!1;for(let v of i){if(u&&d(v).then(l),!t.has(v))continue;let _=t.get(v);_.length_c&&(v.dispatchEvent(new Event("dde:connected")),_.connected=new WeakSet,_.length_c=0,_.length_d||t.delete(v),f=!0)}return f}function h(i,u){let f=!1;for(let v of i)u&&d(v).then(h),!(!t.has(v)||!t.get(v).length_d)&&(v.dispatchEvent(new Event("dde:disconnected")),t.delete(v),f=!0);return f}}var p=Symbol.for("observable");function D(t){try{return Reflect.has(t,p)}catch{return!1}}var W=[],g=new WeakMap;function m(t,e){if(typeof t!="function")return X(!1,t,e);if(D(t))return t;let n=X(!0),r=function(){let[o,...c]=g.get(r);if(g.set(r,new Set([o])),W.push(r),rt(n,t()),W.pop(),!c.length)return;let s=g.get(r);for(let a of c)s.has(a)||R(a,r)};return g.set(n[p],r),g.set(r,new Set([n])),r(),n}m.action=function(t,e,...n){let r=t[p],{actions:o}=r;if(!o||!Reflect.has(o,e))throw new Error(`'${t}' has no action with name '${e}'!`);if(o[e].apply(r,n),r.skip)return Reflect.deleteProperty(r,"skip");r.listeners.forEach(c=>c(r.value))};m.on=function t(e,n,r={}){let{signal:o}=r;if(!(o&&o.aborted)){if(Array.isArray(e))return e.forEach(c=>t(c,n,r));q(e,n),o&&o.addEventListener("abort",()=>R(e,n))}};m.symbols={onclear:Symbol.for("Observable.onclear")};m.clear=function(...t){for(let n of t){Reflect.deleteProperty(n,"toJSON");let r=n[p];r.onclear.forEach(o=>o.call(r)),e(n,r),Reflect.deleteProperty(n,p)}function e(n,r){r.listeners.forEach(o=>{if(r.listeners.delete(o),!g.has(o))return;let c=g.get(o);c.delete(n),!(c.size>1)&&(n.clear(...c),g.delete(o))})}};var L="__dde_reactive";m.el=function(t,e){let n=w.mark({type:"reactive"},!1),r=n.end,o=document.createDocumentFragment();o.append(n,r);let{current:c}=b,s=a=>{if(!n.parentNode||!r.parentNode)return R(t,s);b.push(c);let d=e(a);b.pop(),Array.isArray(d)||(d=[d]);let l=n;for(;(l=n.nextSibling)!==r;)l.remove();n.after(...d)};return q(t,s),et(t,s,n,e),s(t()),o};function gt(t,e){let n=(...r)=>r.length?t.setAttribute(e,...r):t.getAttribute(e);return n.attribute=e,n}var z="__dde_attributes";m.observedAttributes=function(t){let e=N(t,gt),n=t[z]={},r={_set(o){this.value=o}};return Object.keys(e).forEach(o=>{let c=e[o]=nt(e[o],e[o](),r);n[c.attribute]=c}),E.attributeChanged(function({detail:c}){/*! This maps attributes to observables (`O.observedAttributes`).
- * Investigate `__dde_attributes` key of the element.*/let[s,a]=c,d=t[z][s];if(d)return m.action(d,"_set",a)})(t),E.disconnected(function(){/*! This removes all observables mapped to attributes (`O.observedAttributes`).
- * Investigate `__dde_attributes` key of the element.*/m.clear(...Object.values(t[z]))})(t),e};var tt={isObservable:D,processReactiveAttribute(t,e,n,r){if(!D(n))return n;let o=c=>r(e,c);return q(n,o),et(n,o,t,e),n()}};function et(t,e,...n){let{current:r}=b;r.prevent||r.host(function(o){o[L]||(o[L]=[],E.disconnected(()=>o[L].forEach(([[c,s]])=>R(c,s,c[p]?.host()===o)))(o)),o[L].push([[t,e],...n])})}function X(t,e,n){let r=t?()=>Y(r):(...o)=>o.length?rt(r,...o):Y(r);return nt(r,e,n)}var vt=Object.assign(Object.create(null),{stopPropagation(){this.skip=!0}}),U=class extends Error{constructor(){super();let[e,...n]=this.stack.split(`
-`),r=e.slice(e.indexOf("@"),e.indexOf(".js:")+4);this.stack=n.find(o=>!o.includes(r))}};function nt(t,e,n){let r=[];B(n)!=="[object Object]"&&(n={});let{onclear:o}=m.symbols;n[o]&&(r.push(n[o]),Reflect.deleteProperty(n,o));let{host:c}=b;return Reflect.defineProperty(t,p,{value:{value:e,actions:n,onclear:r,host:c,listeners:new Set,defined:new U},enumerable:!1,writable:!1,configurable:!0}),t.toJSON=()=>t(),Object.setPrototypeOf(t[p],vt),t}function mt(){return W[W.length-1]}function Y(t){if(!t[p])return;let{value:e,listeners:n}=t[p],r=mt();return r&&n.add(r),g.has(r)&&g.get(r).add(t),e}function rt(t,e,n){if(!t[p])return;let r=t[p];if(!(!n&&r.value===e))return r.value=e,r.listeners.forEach(o=>o(e)),e}function q(t,e){if(t[p])return t[p].listeners.add(e)}function R(t,e,n){let r=t[p];if(!r)return;let o=r.listeners.delete(e);if(n&&!r.listeners.size){if(t.clear(t),!g.has(r))return o;let c=g.get(r);if(!g.has(c))return o;g.get(c).forEach(s=>R(s,c,!0))}return o}T(tt);
+var A={isObservable(t){return!1},processReactiveAttribute(t,e,n,r){return n}};function M(t,e=!0){return e?Object.assign(A,t):(Object.setPrototypeOf(t,A),t)}function C(t){return A.isPrototypeOf(t)&&t!==A?t:A}function y(t){return typeof t>"u"}function H(t){let e=typeof t;return e!=="object"?e:t===null?"null":Object.prototype.toString.call(t)}function S(t,e){if(!t||!(t instanceof AbortSignal))return!0;if(!t.aborted)return t.addEventListener("abort",e),function(){t.removeEventListener("abort",e)}}function N(t,e){let{observedAttributes:n=[]}=t.constructor;return n.reduce(function(r,o){return Reflect.set(r,ct(o),e(t,o)),r},{})}function ct(t){return t.replace(/-./g,e=>e[1].toUpperCase())}var $={setDeleteAttr:st,ssr:""};function st(t,e,n){if(Reflect.set(t,e,n),!!y(n)){if(Reflect.deleteProperty(t,e),t instanceof HTMLElement&&t.getAttribute(e)==="undefined")return t.removeAttribute(e);if(Reflect.get(t,e)==="undefined")return Reflect.set(t,e,"")}}var x=[{scope:document.body,host:t=>t?t(document.body):document.body,custom_element:!1,prevent:!0}],g={get current(){return x[x.length-1]},get host(){return this.current.host},preventDefault(){let{current:t}=this;return t.prevent=!0,t},get state(){return[...x]},push(t={}){return x.push(Object.assign({},this.current,{prevent:!1},t))},pushRoot(){return x.push(x[0])},pop(){if(x.length!==1)return x.pop()}};function I(...t){return this.appendOriginal(...t),this}function it(t){return t.append===I||(t.appendOriginal=t.append,t.append=I),t}var P;function w(t,e,...n){let r=C(this),o=0,c,s;switch((Object(e)!==e||r.isObservable(e))&&(e={textContent:e}),!0){case typeof t=="function":{o=1,g.push({scope:t,host:(...p)=>p.length?(o===1?n.unshift(...p):p.forEach(b=>b(s)),void 0):s}),c=t(e||void 0);let a=c instanceof DocumentFragment;if(c.nodeName==="#comment")break;let d=w.mark({type:"component",name:t.name,host:a?"this":"parentElement"});c.prepend(d),a&&(s=d);break}case t==="#text":c=O.call(this,document.createTextNode(""),e);break;case(t==="<>"||!t):c=O.call(this,document.createDocumentFragment(),e);break;case!!P:c=O.call(this,document.createElementNS(P,t),e);break;case!c:c=O.call(this,document.createElement(t),e)}return it(c),s||(s=c),n.forEach(a=>a(s)),o&&g.pop(),o=2,c}function Rt(t,e=t,n=void 0){let r=Symbol.for("default"),o=Array.from(e.querySelectorAll("slot")).reduce((s,a)=>Reflect.set(s,a.name||r,a)&&s,{}),c=Reflect.has(o,r);if(t.append=new Proxy(t.append,{apply(s,a,d){if(!d.length)return t;let p=document.createDocumentFragment();for(let b of d){if(!b||!b.slot){c&&p.appendChild(b);continue}let i=b.slot,u=o[i];at(b,"remove","slot"),u&&(ut(u,b,n),Reflect.deleteProperty(o,i))}return c&&(o[r].replaceWith(p),Reflect.deleteProperty(o,r)),t.append=s,t}}),t!==e){let s=Array.from(t.childNodes);s.forEach(a=>a.remove()),t.append(...s)}return e}function ut(t,e,n){n&&n(t,e);try{t.replaceWith(O(e,{className:[e.className,t.className],dataset:{...t.dataset}}))}catch{t.replaceWith(e)}}w.mark=function(t,e=!1){t=Object.entries(t).map(([o,c])=>o+`="${c}"`).join(" ");let n=e?"":"/",r=document.createComment(``);return e||(r.end=document.createComment("")),r};function Ct(t){let e=this;return function(...r){P=t;let o=w.call(e,...r);return P=void 0,o}}var{setDeleteAttr:J}=$,j=new WeakMap;function O(t,...e){if(!e.length)return t;j.set(t,V(t,this));for(let[n,r]of Object.entries(Object.assign({},...e)))G.call(this,t,n,r);return j.delete(t),t}function G(t,e,n){let{setRemoveAttr:r,s:o}=V(t,this),c=this;n=o.processReactiveAttribute(t,e,n,(a,d)=>G.call(c,t,a,d));let[s]=e;if(s==="=")return r(e.slice(1),n);if(s===".")return Z(t,e.slice(1),n);if(/(aria|data)([A-Z])/.test(e))return e=e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),r(e,n);switch(e==="className"&&(e="class"),e){case"xlink:href":return r(e,n,"http://www.w3.org/1999/xlink");case"textContent":return J(t,e,n);case"style":if(typeof n!="object")break;case"dataset":return F(o,n,Z.bind(null,t[e]));case"ariaset":return F(o,n,(a,d)=>r("aria-"+a,d));case"classList":return ft.call(c,t,n)}return dt(t,e)?J(t,e,n):r(e,n)}function V(t,e){if(j.has(t))return j.get(t);let r=(t instanceof SVGElement?pt:lt).bind(null,t,"Attribute"),o=C(e);return{setRemoveAttr:r,s:o}}function ft(t,e){let n=C(this);return F(n,e,(r,o)=>t.classList.toggle(r,o===-1?void 0:!!o)),t}function St(t){return Array.from(t.children).forEach(e=>e.remove()),t}function at(t,e,n,r){return t instanceof HTMLElement?t[e+"Attribute"](n,r):t[e+"AttributeNS"](null,n,r)}function dt(t,e){if(!Reflect.has(t,e))return!1;let n=K(t,e);return!y(n.set)}function K(t,e){if(t=Object.getPrototypeOf(t),!t)return{};let n=Object.getOwnPropertyDescriptor(t,e);return n||K(t,e)}function F(t,e,n){if(!(typeof e!="object"||e===null))return Object.entries(e).forEach(function([o,c]){o&&(c=t.processReactiveAttribute(e,o,c,n),n(o,c))})}function Q(t){return Array.isArray(t)?t.filter(Boolean).join(" "):t}function lt(t,e,n,r){return t[(y(r)?"remove":"set")+e](n,Q(r))}function pt(t,e,n,r,o=null){return t[(y(r)?"remove":"set")+e+"NS"](o,n,Q(r))}function Z(t,e,n){if(Reflect.set(t,e,n),!!y(n))return Reflect.deleteProperty(t,e)}function kt(t,e,n=ht){g.push({scope:t,host:(...o)=>o.length?o.forEach(c=>c(t)):t,custom_element:t}),typeof n=="function"&&(n=n.call(t,t));let r=e.call(t,n);return g.pop(),r}function Lt(t){for(let n of["connected","disconnected"])X(t.prototype,n+"Callback",function(r,o,c){r.apply(o,c),o.dispatchEvent(new Event("dde:"+n))});let e="attributeChanged";return X(t.prototype,e+"Callback",function(n,r,o){let[c,,s]=o;r.dispatchEvent(new CustomEvent("dde:"+e,{detail:[c,s]})),n.apply(r,o)}),t.prototype.__dde_lifecycleToEvents=!0,t}function X(t,e,n){t[e]=new Proxy(t[e]||(()=>{}),{apply:n})}function ht(t){return N(t,(e,n)=>e.getAttribute(n))}function Tt(t,e,n){return e||(e={}),function(o,...c){n&&(c.unshift(o),o=typeof n=="function"?n():n);let s=c.length?new CustomEvent(t,Object.assign({detail:c[0]},e)):new Event(t,e);return o.dispatchEvent(s)}}function E(t,e,n){return function(o){return o.addEventListener(t,e,n),o}}var k=gt(),bt=new WeakSet;E.connected=function(t,e){let{custom_element:n}=g.current,r="connected";return typeof e!="object"&&(e={}),e.once=!0,function(c){n&&(c=n);let s="dde:"+r;return c.addEventListener(s,t,e),c.__dde_lifecycleToEvents?c:c.isConnected?(c.dispatchEvent(new Event(s)),c):(S(e.signal,()=>k.offConnected(c,t))&&k.onConnected(c,t),c)}};E.disconnected=function(t,e){let{custom_element:n}=g.current,r="disconnected";return typeof e!="object"&&(e={}),e.once=!0,function(c){n&&(c=n);let s="dde:"+r;return c.addEventListener(s,t,e),c.__dde_lifecycleToEvents||S(e.signal,()=>k.offDisconnected(c,t))&&k.onDisconnected(c,t),c}};var z=new WeakMap;E.disconnectedAsAbort=function(t){if(z.has(t))return z.get(t);let e=new AbortController;return z.set(t,e),t(E.disconnected(()=>e.abort())),e};E.attributeChanged=function(t,e){let n="attributeChanged";return typeof e!="object"&&(e={}),function(o){let c="dde:"+n;if(o.addEventListener(c,t,e),o.__dde_lifecycleToEvents||bt.has(o))return o;let s=new MutationObserver(function(d){for(let{attributeName:p,target:b}of d)b.dispatchEvent(new CustomEvent(c,{detail:[p,b.getAttribute(p)]}))});return S(e.signal,()=>s.disconnect())&&s.observe(o,{attributes:!0}),o}};function gt(){let t=new Map,e=!1,n=new MutationObserver(function(i){for(let u of i)if(u.type==="childList"){if(p(u.addedNodes,!0)){s();continue}b(u.removedNodes,!0)&&s()}});return{onConnected(i,u){c();let f=o(i);f.connected.has(u)||(f.connected.add(u),f.length_c+=1)},offConnected(i,u){if(!t.has(i))return;let f=t.get(i);f.connected.has(u)&&(f.connected.delete(u),f.length_c-=1,r(i,f))},onDisconnected(i,u){c();let f=o(i);f.disconnected.has(u)||(f.disconnected.add(u),f.length_d+=1)},offDisconnected(i,u){if(!t.has(i))return;let f=t.get(i);f.disconnected.has(u)&&(f.disconnected.delete(u),f.length_d-=1,r(i,f))}};function r(i,u){u.length_c||u.length_d||(t.delete(i),s())}function o(i){if(t.has(i))return t.get(i);let u={connected:new WeakSet,length_c:0,disconnected:new WeakSet,length_d:0};return t.set(i,u),u}function c(){e||(e=!0,n.observe(document.body,{childList:!0,subtree:!0}))}function s(){!e||t.size||(e=!1,n.disconnect())}function a(){return new Promise(function(i){(requestIdleCallback||requestAnimationFrame)(i)})}async function d(i,u){t.size>30&&await a();let f=[];if(!(i instanceof Node))return f;for(let l of t.keys())l===i||!(l instanceof Node)||u(l)||i.contains(l)&&f.push(l);return f}function p(i,u){let f=!1;for(let l of i){if(u&&d(l,T=>!T.isConnectedd).then(p),!t.has(l))continue;let _=t.get(l);_.length_c&&(l.dispatchEvent(new Event("dde:connected")),_.connected=new WeakSet,_.length_c=0,_.length_d||t.delete(l),f=!0)}return f}function b(i,u){let f=!1;for(let l of i)u&&d(l,T=>T.isConnectedd).then(b),!(!t.has(l)||!t.get(l).length_d)&&(l.dispatchEvent(new Event("dde:disconnected")),t.delete(l),f=!0);return f}}var h=Symbol.for("observable");function D(t){try{return Reflect.has(t,h)}catch{return!1}}var W=[],v=new WeakMap;function m(t,e){if(typeof t!="function")return Y(!1,t,e);if(D(t))return t;let n=Y(!0),r=function(){let[o,...c]=v.get(r);if(v.set(r,new Set([o])),W.push(r),ot(n,t()),W.pop(),!c.length)return;let s=v.get(r);for(let a of c)s.has(a)||R(a,r)};return v.set(n[h],r),v.set(r,new Set([n])),r(),n}m.action=function(t,e,...n){let r=t[h],{actions:o}=r;if(!o||!Reflect.has(o,e))throw new Error(`'${t}' has no action with name '${e}'!`);if(o[e].apply(r,n),r.skip)return Reflect.deleteProperty(r,"skip");r.listeners.forEach(c=>c(r.value))};m.on=function t(e,n,r={}){let{signal:o}=r;if(!(o&&o.aborted)){if(Array.isArray(e))return e.forEach(c=>t(c,n,r));B(e,n),o&&o.addEventListener("abort",()=>R(e,n))}};m.symbols={onclear:Symbol.for("Observable.onclear")};m.clear=function(...t){for(let n of t){Reflect.deleteProperty(n,"toJSON");let r=n[h];r.onclear.forEach(o=>o.call(r)),e(n,r),Reflect.deleteProperty(n,h)}function e(n,r){r.listeners.forEach(o=>{if(r.listeners.delete(o),!v.has(o))return;let c=v.get(o);c.delete(n),!(c.size>1)&&(n.clear(...c),v.delete(o))})}};var L="__dde_reactive";m.el=function(t,e){let n=w.mark({type:"reactive"},!1),r=n.end,o=document.createDocumentFragment();o.append(n,r);let{current:c}=g,s=a=>{if(!n.parentNode||!r.parentNode)return R(t,s);g.push(c);let d=e(a);g.pop(),Array.isArray(d)||(d=[d]);let p=n;for(;(p=n.nextSibling)!==r;)p.remove();n.after(...d)};return B(t,s),nt(t,s,n,e),s(t()),o};function vt(t,e){let n=(...r)=>r.length?t.setAttribute(e,...r):t.getAttribute(e);return n.attribute=e,n}var U="__dde_attributes";m.observedAttributes=function(t){let e=N(t,vt),n=t[U]={},r={_set(o){this.value=o}};return Object.keys(e).forEach(o=>{let c=e[o]=rt(e[o],e[o](),r);n[c.attribute]=c}),E.attributeChanged(function({detail:c}){/*! This maps attributes to observables (`O.observedAttributes`).
+ * Investigate `__dde_attributes` key of the element.*/let[s,a]=c,d=t[U][s];if(d)return m.action(d,"_set",a)})(t),E.disconnected(function(){/*! This removes all observables mapped to attributes (`O.observedAttributes`).
+ * Investigate `__dde_attributes` key of the element.*/m.clear(...Object.values(t[U]))})(t),e};var et={isObservable:D,processReactiveAttribute(t,e,n,r){if(!D(n))return n;let o=c=>r(e,c);return B(n,o),nt(n,o,t,e),n()}};function nt(t,e,...n){let{current:r}=g;r.prevent||r.host(function(o){o[L]||(o[L]=[],E.disconnected(()=>o[L].forEach(([[c,s]])=>R(c,s,c[h]?.host()===o)))(o)),o[L].push([[t,e],...n])})}function Y(t,e,n){let r=t?()=>tt(r):(...o)=>o.length?ot(r,...o):tt(r);return rt(r,e,n)}var mt=Object.assign(Object.create(null),{stopPropagation(){this.skip=!0}}),q=class extends Error{constructor(){super();let[e,...n]=this.stack.split(`
+`),r=e.slice(e.indexOf("@"),e.indexOf(".js:")+4);this.stack=n.find(o=>!o.includes(r))}};function rt(t,e,n){let r=[];H(n)!=="[object Object]"&&(n={});let{onclear:o}=m.symbols;n[o]&&(r.push(n[o]),Reflect.deleteProperty(n,o));let{host:c}=g;return Reflect.defineProperty(t,h,{value:{value:e,actions:n,onclear:r,host:c,listeners:new Set,defined:new q},enumerable:!1,writable:!1,configurable:!0}),t.toJSON=()=>t(),Object.setPrototypeOf(t[h],mt),t}function Et(){return W[W.length-1]}function tt(t){if(!t[h])return;let{value:e,listeners:n}=t[h],r=Et();return r&&n.add(r),v.has(r)&&v.get(r).add(t),e}function ot(t,e,n){if(!t[h])return;let r=t[h];if(!(!n&&r.value===e))return r.value=e,r.listeners.forEach(o=>o(e)),e}function B(t,e){if(t[h])return t[h].listeners.add(e)}function R(t,e,n){let r=t[h];if(!r)return;let o=r.listeners.delete(e);if(n&&!r.listeners.size){if(m.clear(t),!v.has(r))return o;let c=v.get(r);if(!v.has(c))return o;v.get(c).forEach(s=>R(s,c,!0))}return o}M(et);
globalThis.dde= {O: m,
assign: O,
-assignAttribute: Z,
-chainableAppend: st,
-classListDeclarative: ut,
+assignAttribute: G,
+chainableAppend: it,
+classListDeclarative: ft,
createElement: w,
-createElementNS: Rt,
-customElementRender: jt,
-customElementWithDDE: kt,
-dispatchEvent: Wt,
+createElementNS: Ct,
+customElementRender: kt,
+customElementWithDDE: Lt,
+dispatchEvent: Tt,
el: w,
-elNS: Rt,
-elementAttribute: ft,
-empty: Ct,
+elNS: Ct,
+elementAttribute: at,
+empty: St,
isObservable: D,
-lifecycleToEvents: kt,
+lifecycleToEvents: Lt,
observable: m,
-observedAttributes: pt,
+observedAttributes: ht,
on: E,
-registerReactivity: T,
-scope: b,
-simulateSlots: wt
+registerReactivity: M,
+scope: g,
+simulateSlots: Rt
};
})();
\ No newline at end of file
diff --git a/dist/dde.js b/dist/dde.js
index 21c4c2d..bc6f3ec 100644
--- a/dist/dde.js
+++ b/dist/dde.js
@@ -1,25 +1,25 @@
//deka-dom-el library is available via global namespace `dde`
(()=> {
-var m={isObservable(t){return!1},processReactiveAttribute(t,e,n,c){return n}};function q(t,e=!0){return e?Object.assign(m,t):(Object.setPrototypeOf(t,m),t)}function _(t){return m.isPrototypeOf(t)&&t!==m?t:m}function v(t){return typeof t>"u"}function y(t,e){if(!t||!(t instanceof AbortSignal))return!0;if(!t.aborted)return t.addEventListener("abort",e),function(){t.removeEventListener("abort",e)}}function L(t,e){let{observedAttributes:n=[]}=t.constructor;return n.reduce(function(c,r){return Reflect.set(c,F(r),e(t,r)),c},{})}function F(t){return t.replace(/-./g,e=>e[1].toUpperCase())}var R={setDeleteAttr:z,ssr:""};function z(t,e,n){if(Reflect.set(t,e,n),!!v(n)){if(Reflect.deleteProperty(t,e),t instanceof HTMLElement&&t.getAttribute(e)==="undefined")return t.removeAttribute(e);if(Reflect.get(t,e)==="undefined")return Reflect.set(t,e,"")}}var b=[{scope:document.body,host:t=>t?t(document.body):document.body,custom_element:!1,prevent:!0}],g={get current(){return b[b.length-1]},get host(){return this.current.host},preventDefault(){let{current:t}=this;return t.prevent=!0,t},get state(){return[...b]},push(t={}){return b.push(Object.assign({},this.current,{prevent:!1},t))},pushRoot(){return b.push(b[0])},pop(){if(b.length!==1)return b.pop()}};function P(...t){return this.appendOriginal(...t),this}function B(t){return t.append===P||(t.appendOriginal=t.append,t.append=P),t}var w;function N(t,e,...n){let c=_(this),r=0,o,s;switch((Object(e)!==e||c.isObservable(e))&&(e={textContent:e}),!0){case typeof t=="function":{r=1,g.push({scope:t,host:(...l)=>l.length?(r===1?n.unshift(...l):l.forEach(p=>p(s)),void 0):s}),o=t(e||void 0);let a=o instanceof DocumentFragment;if(o.nodeName==="#comment")break;let d=N.mark({type:"component",name:t.name,host:a?"this":"parentElement"});o.prepend(d),a&&(s=d);break}case t==="#text":o=x.call(this,document.createTextNode(""),e);break;case(t==="<>"||!t):o=x.call(this,document.createDocumentFragment(),e);break;case!!w:o=x.call(this,document.createElementNS(w,t),e);break;case!o:o=x.call(this,document.createElement(t),e)}return B(o),s||(s=o),n.forEach(a=>a(s)),r&&g.pop(),r=2,o}function ct(t,e=t,n=void 0){let c=Symbol.for("default"),r=Array.from(e.querySelectorAll("slot")).reduce((s,a)=>Reflect.set(s,a.name||c,a)&&s,{}),o=Reflect.has(r,c);if(t.append=new Proxy(t.append,{apply(s,a,d){if(!d.length)return t;let l=document.createDocumentFragment();for(let p of d){if(!p||!p.slot){o&&l.appendChild(p);continue}let i=p.slot,u=r[i];Z(p,"remove","slot"),u&&(H(u,p,n),Reflect.deleteProperty(r,i))}return o&&(r[c].replaceWith(l),Reflect.deleteProperty(r,c)),t.append=s,t}}),t!==e){let s=Array.from(t.childNodes);s.forEach(a=>a.remove()),t.append(...s)}return e}function H(t,e,n){n&&n(t,e);try{t.replaceWith(x(e,{className:[e.className,t.className],dataset:{...t.dataset}}))}catch{t.replaceWith(e)}}N.mark=function(t,e=!1){t=Object.entries(t).map(([r,o])=>r+`="${o}"`).join(" ");let n=e?"":"/",c=document.createComment(``);return e||(c.end=document.createComment("")),c};function st(t){let e=this;return function(...c){w=t;let r=N.call(e,...c);return w=void 0,r}}var{setDeleteAttr:W}=R,C=new WeakMap;function x(t,...e){if(!e.length)return t;C.set(t,M(t,this));for(let[n,c]of Object.entries(Object.assign({},...e)))T.call(this,t,n,c);return C.delete(t),t}function T(t,e,n){let{setRemoveAttr:c,s:r}=M(t,this),o=this;n=r.processReactiveAttribute(t,e,n,(a,d)=>T.call(o,t,a,d));let[s]=e;if(s==="=")return c(e.slice(1),n);if(s===".")return j(t,e.slice(1),n);if(/(aria|data)([A-Z])/.test(e))return e=e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),c(e,n);switch(e==="className"&&(e="class"),e){case"xlink:href":return c(e,n,"http://www.w3.org/1999/xlink");case"textContent":return W(t,e,n);case"style":if(typeof n!="object")break;case"dataset":return S(r,n,j.bind(null,t[e]));case"ariaset":return S(r,n,(a,d)=>c("aria-"+a,d));case"classList":return I.call(o,t,n)}return G(t,e)?W(t,e,n):c(e,n)}function M(t,e){if(C.has(t))return C.get(t);let c=(t instanceof SVGElement?J:V).bind(null,t,"Attribute"),r=_(e);return{setRemoveAttr:c,s:r}}function I(t,e){let n=_(this);return S(n,e,(c,r)=>t.classList.toggle(c,r===-1?void 0:!!r)),t}function it(t){return Array.from(t.children).forEach(e=>e.remove()),t}function Z(t,e,n,c){return t instanceof HTMLElement?t[e+"Attribute"](n,c):t[e+"AttributeNS"](null,n,c)}function G(t,e){if(!Reflect.has(t,e))return!1;let n=$(t,e);return!v(n.set)}function $(t,e){if(t=Object.getPrototypeOf(t),!t)return{};let n=Object.getOwnPropertyDescriptor(t,e);return n||$(t,e)}function S(t,e,n){if(!(typeof e!="object"||e===null))return Object.entries(e).forEach(function([r,o]){r&&(o=t.processReactiveAttribute(e,r,o,n),n(r,o))})}function k(t){return Array.isArray(t)?t.filter(Boolean).join(" "):t}function V(t,e,n,c){return t[(v(c)?"remove":"set")+e](n,k(c))}function J(t,e,n,c,r=null){return t[(v(c)?"remove":"set")+e+"NS"](r,n,k(c))}function j(t,e,n){if(Reflect.set(t,e,n),!!v(n))return Reflect.deleteProperty(t,e)}function dt(t,e,n=K){g.push({scope:t,host:(...r)=>r.length?r.forEach(o=>o(t)):t,custom_element:t}),typeof n=="function"&&(n=n.call(t,t));let c=e.call(t,n);return g.pop(),c}function pt(t){for(let n of["connected","disconnected"])U(t.prototype,n+"Callback",function(c,r,o){c.apply(r,o),r.dispatchEvent(new Event("dde:"+n))});let e="attributeChanged";return U(t.prototype,e+"Callback",function(n,c,r){let[o,,s]=r;c.dispatchEvent(new CustomEvent("dde:"+e,{detail:[o,s]})),n.apply(c,r)}),t.prototype.__dde_lifecycleToEvents=!0,t}function U(t,e,n){t[e]=new Proxy(t[e]||(()=>{}),{apply:n})}function K(t){return L(t,(e,n)=>e.getAttribute(n))}function bt(t,e,n){return e||(e={}),function(r,...o){n&&(o.unshift(r),r=typeof n=="function"?n():n);let s=o.length?new CustomEvent(t,Object.assign({detail:o[0]},e)):new Event(t,e);return r.dispatchEvent(s)}}function A(t,e,n){return function(r){return r.addEventListener(t,e,n),r}}var O=X(),Q=new WeakSet;A.connected=function(t,e){let{custom_element:n}=g.current,c="connected";return typeof e!="object"&&(e={}),e.once=!0,function(o){n&&(o=n);let s="dde:"+c;return o.addEventListener(s,t,e),o.__dde_lifecycleToEvents?o:o.isConnected?(o.dispatchEvent(new Event(s)),o):(y(e.signal,()=>O.offConnected(o,t))&&O.onConnected(o,t),o)}};A.disconnected=function(t,e){let{custom_element:n}=g.current,c="disconnected";return typeof e!="object"&&(e={}),e.once=!0,function(o){n&&(o=n);let s="dde:"+c;return o.addEventListener(s,t,e),o.__dde_lifecycleToEvents||y(e.signal,()=>O.offDisconnected(o,t))&&O.onDisconnected(o,t),o}};var D=new WeakMap;A.disconnectedAsAbort=function(t){if(D.has(t))return D.get(t);let e=new AbortController;return D.set(t,e),t(A.disconnected(()=>e.abort())),e};A.attributeChanged=function(t,e){let n="attributeChanged";return typeof e!="object"&&(e={}),function(r){let o="dde:"+n;if(r.addEventListener(o,t,e),r.__dde_lifecycleToEvents||Q.has(r))return r;let s=new MutationObserver(function(d){for(let{attributeName:l,target:p}of d)p.dispatchEvent(new CustomEvent(o,{detail:[l,p.getAttribute(l)]}))});return y(e.signal,()=>s.disconnect())&&s.observe(r,{attributes:!0}),r}};function X(){let t=new Map,e=!1,n=new MutationObserver(function(i){for(let u of i)if(u.type==="childList"){if(l(u.addedNodes,!0)){s();continue}p(u.removedNodes,!0)&&s()}});return{onConnected(i,u){o();let f=r(i);f.connected.has(u)||(f.connected.add(u),f.length_c+=1)},offConnected(i,u){if(!t.has(i))return;let f=t.get(i);f.connected.has(u)&&(f.connected.delete(u),f.length_c-=1,c(i,f))},onDisconnected(i,u){o();let f=r(i);f.disconnected.has(u)||(f.disconnected.add(u),f.length_d+=1)},offDisconnected(i,u){if(!t.has(i))return;let f=t.get(i);f.disconnected.has(u)&&(f.disconnected.delete(u),f.length_d-=1,c(i,f))}};function c(i,u){u.length_c||u.length_d||(t.delete(i),s())}function r(i){if(t.has(i))return t.get(i);let u={connected:new WeakSet,length_c:0,disconnected:new WeakSet,length_d:0};return t.set(i,u),u}function o(){e||(e=!0,n.observe(document.body,{childList:!0,subtree:!0}))}function s(){!e||t.size||(e=!1,n.disconnect())}function a(){return new Promise(function(i){(requestIdleCallback||requestAnimationFrame)(i)})}async function d(i){t.size>30&&await a();let u=[];if(!(i instanceof Node))return u;for(let f of t.keys())f===i||!(f instanceof Node)||i.contains(f)&&u.push(f);return u}function l(i,u){let f=!1;for(let h of i){if(u&&d(h).then(l),!t.has(h))continue;let E=t.get(h);E.length_c&&(h.dispatchEvent(new Event("dde:connected")),E.connected=new WeakSet,E.length_c=0,E.length_d||t.delete(h),f=!0)}return f}function p(i,u){let f=!1;for(let h of i)u&&d(h).then(p),!(!t.has(h)||!t.get(h).length_d)&&(h.dispatchEvent(new Event("dde:disconnected")),t.delete(h),f=!0);return f}}
+var m={isObservable(t){return!1},processReactiveAttribute(t,e,n,c){return n}};function F(t,e=!0){return e?Object.assign(m,t):(Object.setPrototypeOf(t,m),t)}function _(t){return m.isPrototypeOf(t)&&t!==m?t:m}function v(t){return typeof t>"u"}function y(t,e){if(!t||!(t instanceof AbortSignal))return!0;if(!t.aborted)return t.addEventListener("abort",e),function(){t.removeEventListener("abort",e)}}function P(t,e){let{observedAttributes:n=[]}=t.constructor;return n.reduce(function(c,r){return Reflect.set(c,z(r),e(t,r)),c},{})}function z(t){return t.replace(/-./g,e=>e[1].toUpperCase())}var S={setDeleteAttr:B,ssr:""};function B(t,e,n){if(Reflect.set(t,e,n),!!v(n)){if(Reflect.deleteProperty(t,e),t instanceof HTMLElement&&t.getAttribute(e)==="undefined")return t.removeAttribute(e);if(Reflect.get(t,e)==="undefined")return Reflect.set(t,e,"")}}var b=[{scope:document.body,host:t=>t?t(document.body):document.body,custom_element:!1,prevent:!0}],g={get current(){return b[b.length-1]},get host(){return this.current.host},preventDefault(){let{current:t}=this;return t.prevent=!0,t},get state(){return[...b]},push(t={}){return b.push(Object.assign({},this.current,{prevent:!1},t))},pushRoot(){return b.push(b[0])},pop(){if(b.length!==1)return b.pop()}};function W(...t){return this.appendOriginal(...t),this}function H(t){return t.append===W||(t.appendOriginal=t.append,t.append=W),t}var w;function D(t,e,...n){let c=_(this),r=0,o,s;switch((Object(e)!==e||c.isObservable(e))&&(e={textContent:e}),!0){case typeof t=="function":{r=1,g.push({scope:t,host:(...h)=>h.length?(r===1?n.unshift(...h):h.forEach(l=>l(s)),void 0):s}),o=t(e||void 0);let a=o instanceof DocumentFragment;if(o.nodeName==="#comment")break;let p=D.mark({type:"component",name:t.name,host:a?"this":"parentElement"});o.prepend(p),a&&(s=p);break}case t==="#text":o=x.call(this,document.createTextNode(""),e);break;case(t==="<>"||!t):o=x.call(this,document.createDocumentFragment(),e);break;case!!w:o=x.call(this,document.createElementNS(w,t),e);break;case!o:o=x.call(this,document.createElement(t),e)}return H(o),s||(s=o),n.forEach(a=>a(s)),r&&g.pop(),r=2,o}function st(t,e=t,n=void 0){let c=Symbol.for("default"),r=Array.from(e.querySelectorAll("slot")).reduce((s,a)=>Reflect.set(s,a.name||c,a)&&s,{}),o=Reflect.has(r,c);if(t.append=new Proxy(t.append,{apply(s,a,p){if(!p.length)return t;let h=document.createDocumentFragment();for(let l of p){if(!l||!l.slot){o&&h.appendChild(l);continue}let i=l.slot,u=r[i];G(l,"remove","slot"),u&&(I(u,l,n),Reflect.deleteProperty(r,i))}return o&&(r[c].replaceWith(h),Reflect.deleteProperty(r,c)),t.append=s,t}}),t!==e){let s=Array.from(t.childNodes);s.forEach(a=>a.remove()),t.append(...s)}return e}function I(t,e,n){n&&n(t,e);try{t.replaceWith(x(e,{className:[e.className,t.className],dataset:{...t.dataset}}))}catch{t.replaceWith(e)}}D.mark=function(t,e=!1){t=Object.entries(t).map(([r,o])=>r+`="${o}"`).join(" ");let n=e?"":"/",c=document.createComment(``);return e||(c.end=document.createComment("")),c};function it(t){let e=this;return function(...c){w=t;let r=D.call(e,...c);return w=void 0,r}}var{setDeleteAttr:j}=S,C=new WeakMap;function x(t,...e){if(!e.length)return t;C.set(t,$(t,this));for(let[n,c]of Object.entries(Object.assign({},...e)))M.call(this,t,n,c);return C.delete(t),t}function M(t,e,n){let{setRemoveAttr:c,s:r}=$(t,this),o=this;n=r.processReactiveAttribute(t,e,n,(a,p)=>M.call(o,t,a,p));let[s]=e;if(s==="=")return c(e.slice(1),n);if(s===".")return T(t,e.slice(1),n);if(/(aria|data)([A-Z])/.test(e))return e=e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),c(e,n);switch(e==="className"&&(e="class"),e){case"xlink:href":return c(e,n,"http://www.w3.org/1999/xlink");case"textContent":return j(t,e,n);case"style":if(typeof n!="object")break;case"dataset":return N(r,n,T.bind(null,t[e]));case"ariaset":return N(r,n,(a,p)=>c("aria-"+a,p));case"classList":return Z.call(o,t,n)}return V(t,e)?j(t,e,n):c(e,n)}function $(t,e){if(C.has(t))return C.get(t);let c=(t instanceof SVGElement?K:J).bind(null,t,"Attribute"),r=_(e);return{setRemoveAttr:c,s:r}}function Z(t,e){let n=_(this);return N(n,e,(c,r)=>t.classList.toggle(c,r===-1?void 0:!!r)),t}function ut(t){return Array.from(t.children).forEach(e=>e.remove()),t}function G(t,e,n,c){return t instanceof HTMLElement?t[e+"Attribute"](n,c):t[e+"AttributeNS"](null,n,c)}function V(t,e){if(!Reflect.has(t,e))return!1;let n=k(t,e);return!v(n.set)}function k(t,e){if(t=Object.getPrototypeOf(t),!t)return{};let n=Object.getOwnPropertyDescriptor(t,e);return n||k(t,e)}function N(t,e,n){if(!(typeof e!="object"||e===null))return Object.entries(e).forEach(function([r,o]){r&&(o=t.processReactiveAttribute(e,r,o,n),n(r,o))})}function U(t){return Array.isArray(t)?t.filter(Boolean).join(" "):t}function J(t,e,n,c){return t[(v(c)?"remove":"set")+e](n,U(c))}function K(t,e,n,c,r=null){return t[(v(c)?"remove":"set")+e+"NS"](r,n,U(c))}function T(t,e,n){if(Reflect.set(t,e,n),!!v(n))return Reflect.deleteProperty(t,e)}function pt(t,e,n=Q){g.push({scope:t,host:(...r)=>r.length?r.forEach(o=>o(t)):t,custom_element:t}),typeof n=="function"&&(n=n.call(t,t));let c=e.call(t,n);return g.pop(),c}function lt(t){for(let n of["connected","disconnected"])q(t.prototype,n+"Callback",function(c,r,o){c.apply(r,o),r.dispatchEvent(new Event("dde:"+n))});let e="attributeChanged";return q(t.prototype,e+"Callback",function(n,c,r){let[o,,s]=r;c.dispatchEvent(new CustomEvent("dde:"+e,{detail:[o,s]})),n.apply(c,r)}),t.prototype.__dde_lifecycleToEvents=!0,t}function q(t,e,n){t[e]=new Proxy(t[e]||(()=>{}),{apply:n})}function Q(t){return P(t,(e,n)=>e.getAttribute(n))}function gt(t,e,n){return e||(e={}),function(r,...o){n&&(o.unshift(r),r=typeof n=="function"?n():n);let s=o.length?new CustomEvent(t,Object.assign({detail:o[0]},e)):new Event(t,e);return r.dispatchEvent(s)}}function A(t,e,n){return function(r){return r.addEventListener(t,e,n),r}}var O=Y(),X=new WeakSet;A.connected=function(t,e){let{custom_element:n}=g.current,c="connected";return typeof e!="object"&&(e={}),e.once=!0,function(o){n&&(o=n);let s="dde:"+c;return o.addEventListener(s,t,e),o.__dde_lifecycleToEvents?o:o.isConnected?(o.dispatchEvent(new Event(s)),o):(y(e.signal,()=>O.offConnected(o,t))&&O.onConnected(o,t),o)}};A.disconnected=function(t,e){let{custom_element:n}=g.current,c="disconnected";return typeof e!="object"&&(e={}),e.once=!0,function(o){n&&(o=n);let s="dde:"+c;return o.addEventListener(s,t,e),o.__dde_lifecycleToEvents||y(e.signal,()=>O.offDisconnected(o,t))&&O.onDisconnected(o,t),o}};var L=new WeakMap;A.disconnectedAsAbort=function(t){if(L.has(t))return L.get(t);let e=new AbortController;return L.set(t,e),t(A.disconnected(()=>e.abort())),e};A.attributeChanged=function(t,e){let n="attributeChanged";return typeof e!="object"&&(e={}),function(r){let o="dde:"+n;if(r.addEventListener(o,t,e),r.__dde_lifecycleToEvents||X.has(r))return r;let s=new MutationObserver(function(p){for(let{attributeName:h,target:l}of p)l.dispatchEvent(new CustomEvent(o,{detail:[h,l.getAttribute(h)]}))});return y(e.signal,()=>s.disconnect())&&s.observe(r,{attributes:!0}),r}};function Y(){let t=new Map,e=!1,n=new MutationObserver(function(i){for(let u of i)if(u.type==="childList"){if(h(u.addedNodes,!0)){s();continue}l(u.removedNodes,!0)&&s()}});return{onConnected(i,u){o();let f=r(i);f.connected.has(u)||(f.connected.add(u),f.length_c+=1)},offConnected(i,u){if(!t.has(i))return;let f=t.get(i);f.connected.has(u)&&(f.connected.delete(u),f.length_c-=1,c(i,f))},onDisconnected(i,u){o();let f=r(i);f.disconnected.has(u)||(f.disconnected.add(u),f.length_d+=1)},offDisconnected(i,u){if(!t.has(i))return;let f=t.get(i);f.disconnected.has(u)&&(f.disconnected.delete(u),f.length_d-=1,c(i,f))}};function c(i,u){u.length_c||u.length_d||(t.delete(i),s())}function r(i){if(t.has(i))return t.get(i);let u={connected:new WeakSet,length_c:0,disconnected:new WeakSet,length_d:0};return t.set(i,u),u}function o(){e||(e=!0,n.observe(document.body,{childList:!0,subtree:!0}))}function s(){!e||t.size||(e=!1,n.disconnect())}function a(){return new Promise(function(i){(requestIdleCallback||requestAnimationFrame)(i)})}async function p(i,u){t.size>30&&await a();let f=[];if(!(i instanceof Node))return f;for(let d of t.keys())d===i||!(d instanceof Node)||u(d)||i.contains(d)&&f.push(d);return f}function h(i,u){let f=!1;for(let d of i){if(u&&p(d,R=>!R.isConnectedd).then(h),!t.has(d))continue;let E=t.get(d);E.length_c&&(d.dispatchEvent(new Event("dde:connected")),E.connected=new WeakSet,E.length_c=0,E.length_d||t.delete(d),f=!0)}return f}function l(i,u){let f=!1;for(let d of i)u&&p(d,R=>R.isConnectedd).then(l),!(!t.has(d)||!t.get(d).length_d)&&(d.dispatchEvent(new Event("dde:disconnected")),t.delete(d),f=!0);return f}}
globalThis.dde= {assign: x,
-assignAttribute: T,
-chainableAppend: B,
-classListDeclarative: I,
-createElement: N,
-createElementNS: st,
-customElementRender: dt,
-customElementWithDDE: pt,
-dispatchEvent: bt,
-el: N,
-elNS: st,
-elementAttribute: Z,
-empty: it,
-lifecycleToEvents: pt,
-observedAttributes: K,
+assignAttribute: M,
+chainableAppend: H,
+classListDeclarative: Z,
+createElement: D,
+createElementNS: it,
+customElementRender: pt,
+customElementWithDDE: lt,
+dispatchEvent: gt,
+el: D,
+elNS: it,
+elementAttribute: G,
+empty: ut,
+lifecycleToEvents: lt,
+observedAttributes: Q,
on: A,
-registerReactivity: q,
+registerReactivity: F,
scope: g,
-simulateSlots: ct
+simulateSlots: st
};
})();
\ No newline at end of file
diff --git a/dist/esm-with-observables.js b/dist/esm-with-observables.js
index 00b01a9..dba3aee 100644
--- a/dist/esm-with-observables.js
+++ b/dist/esm-with-observables.js
@@ -1,4 +1,4 @@
-var A={isObservable(t){return!1},processReactiveAttribute(t,e,n,r){return n}};function T(t,e=!0){return e?Object.assign(A,t):(Object.setPrototypeOf(t,A),t)}function C(t){return A.isPrototypeOf(t)&&t!==A?t:A}function y(t){return typeof t>"u"}function B(t){let e=typeof t;return e!=="object"?e:t===null?"null":Object.prototype.toString.call(t)}function S(t,e){if(!t||!(t instanceof AbortSignal))return!0;if(!t.aborted)return t.addEventListener("abort",e),function(){t.removeEventListener("abort",e)}}function N(t,e){let{observedAttributes:n=[]}=t.constructor;return n.reduce(function(r,o){return Reflect.set(r,ot(o),e(t,o)),r},{})}function ot(t){return t.replace(/-./g,e=>e[1].toUpperCase())}var M={setDeleteAttr:ct,ssr:""};function ct(t,e,n){if(Reflect.set(t,e,n),!!y(n)){if(Reflect.deleteProperty(t,e),t instanceof HTMLElement&&t.getAttribute(e)==="undefined")return t.removeAttribute(e);if(Reflect.get(t,e)==="undefined")return Reflect.set(t,e,"")}}var x=[{scope:document.body,host:t=>t?t(document.body):document.body,custom_element:!1,prevent:!0}],b={get current(){return x[x.length-1]},get host(){return this.current.host},preventDefault(){let{current:t}=this;return t.prevent=!0,t},get state(){return[...x]},push(t={}){return x.push(Object.assign({},this.current,{prevent:!1},t))},pushRoot(){return x.push(x[0])},pop(){if(x.length!==1)return x.pop()}};function H(...t){return this.appendOriginal(...t),this}function st(t){return t.append===H||(t.appendOriginal=t.append,t.append=H),t}var P;function w(t,e,...n){let r=C(this),o=0,c,s;switch((Object(e)!==e||r.isObservable(e))&&(e={textContent:e}),!0){case typeof t=="function":{o=1,b.push({scope:t,host:(...l)=>l.length?(o===1?n.unshift(...l):l.forEach(h=>h(s)),void 0):s}),c=t(e||void 0);let a=c instanceof DocumentFragment;if(c.nodeName==="#comment")break;let d=w.mark({type:"component",name:t.name,host:a?"this":"parentElement"});c.prepend(d),a&&(s=d);break}case t==="#text":c=O.call(this,document.createTextNode(""),e);break;case(t==="<>"||!t):c=O.call(this,document.createDocumentFragment(),e);break;case!!P:c=O.call(this,document.createElementNS(P,t),e);break;case!c:c=O.call(this,document.createElement(t),e)}return st(c),s||(s=c),n.forEach(a=>a(s)),o&&b.pop(),o=2,c}function wt(t,e=t,n=void 0){let r=Symbol.for("default"),o=Array.from(e.querySelectorAll("slot")).reduce((s,a)=>Reflect.set(s,a.name||r,a)&&s,{}),c=Reflect.has(o,r);if(t.append=new Proxy(t.append,{apply(s,a,d){if(!d.length)return t;let l=document.createDocumentFragment();for(let h of d){if(!h||!h.slot){c&&l.appendChild(h);continue}let i=h.slot,u=o[i];ft(h,"remove","slot"),u&&(it(u,h,n),Reflect.deleteProperty(o,i))}return c&&(o[r].replaceWith(l),Reflect.deleteProperty(o,r)),t.append=s,t}}),t!==e){let s=Array.from(t.childNodes);s.forEach(a=>a.remove()),t.append(...s)}return e}function it(t,e,n){n&&n(t,e);try{t.replaceWith(O(e,{className:[e.className,t.className],dataset:{...t.dataset}}))}catch{t.replaceWith(e)}}w.mark=function(t,e=!1){t=Object.entries(t).map(([o,c])=>o+`="${c}"`).join(" ");let n=e?"":"/",r=document.createComment(``);return e||(r.end=document.createComment("")),r};function Rt(t){let e=this;return function(...r){P=t;let o=w.call(e,...r);return P=void 0,o}}var{setDeleteAttr:I}=M,j=new WeakMap;function O(t,...e){if(!e.length)return t;j.set(t,G(t,this));for(let[n,r]of Object.entries(Object.assign({},...e)))Z.call(this,t,n,r);return j.delete(t),t}function Z(t,e,n){let{setRemoveAttr:r,s:o}=G(t,this),c=this;n=o.processReactiveAttribute(t,e,n,(a,d)=>Z.call(c,t,a,d));let[s]=e;if(s==="=")return r(e.slice(1),n);if(s===".")return J(t,e.slice(1),n);if(/(aria|data)([A-Z])/.test(e))return e=e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),r(e,n);switch(e==="className"&&(e="class"),e){case"xlink:href":return r(e,n,"http://www.w3.org/1999/xlink");case"textContent":return I(t,e,n);case"style":if(typeof n!="object")break;case"dataset":return $(o,n,J.bind(null,t[e]));case"ariaset":return $(o,n,(a,d)=>r("aria-"+a,d));case"classList":return ut.call(c,t,n)}return at(t,e)?I(t,e,n):r(e,n)}function G(t,e){if(j.has(t))return j.get(t);let r=(t instanceof SVGElement?lt:dt).bind(null,t,"Attribute"),o=C(e);return{setRemoveAttr:r,s:o}}function ut(t,e){let n=C(this);return $(n,e,(r,o)=>t.classList.toggle(r,o===-1?void 0:!!o)),t}function Ct(t){return Array.from(t.children).forEach(e=>e.remove()),t}function ft(t,e,n,r){return t instanceof HTMLElement?t[e+"Attribute"](n,r):t[e+"AttributeNS"](null,n,r)}function at(t,e){if(!Reflect.has(t,e))return!1;let n=V(t,e);return!y(n.set)}function V(t,e){if(t=Object.getPrototypeOf(t),!t)return{};let n=Object.getOwnPropertyDescriptor(t,e);return n||V(t,e)}function $(t,e,n){if(!(typeof e!="object"||e===null))return Object.entries(e).forEach(function([o,c]){o&&(c=t.processReactiveAttribute(e,o,c,n),n(o,c))})}function K(t){return Array.isArray(t)?t.filter(Boolean).join(" "):t}function dt(t,e,n,r){return t[(y(r)?"remove":"set")+e](n,K(r))}function lt(t,e,n,r,o=null){return t[(y(r)?"remove":"set")+e+"NS"](o,n,K(r))}function J(t,e,n){if(Reflect.set(t,e,n),!!y(n))return Reflect.deleteProperty(t,e)}function jt(t,e,n=pt){b.push({scope:t,host:(...o)=>o.length?o.forEach(c=>c(t)):t,custom_element:t}),typeof n=="function"&&(n=n.call(t,t));let r=e.call(t,n);return b.pop(),r}function kt(t){for(let n of["connected","disconnected"])Q(t.prototype,n+"Callback",function(r,o,c){r.apply(o,c),o.dispatchEvent(new Event("dde:"+n))});let e="attributeChanged";return Q(t.prototype,e+"Callback",function(n,r,o){let[c,,s]=o;r.dispatchEvent(new CustomEvent("dde:"+e,{detail:[c,s]})),n.apply(r,o)}),t.prototype.__dde_lifecycleToEvents=!0,t}function Q(t,e,n){t[e]=new Proxy(t[e]||(()=>{}),{apply:n})}function pt(t){return N(t,(e,n)=>e.getAttribute(n))}function Wt(t,e,n){return e||(e={}),function(o,...c){n&&(c.unshift(o),o=typeof n=="function"?n():n);let s=c.length?new CustomEvent(t,Object.assign({detail:c[0]},e)):new Event(t,e);return o.dispatchEvent(s)}}function E(t,e,n){return function(o){return o.addEventListener(t,e,n),o}}var k=bt(),ht=new WeakSet;E.connected=function(t,e){let{custom_element:n}=b.current,r="connected";return typeof e!="object"&&(e={}),e.once=!0,function(c){n&&(c=n);let s="dde:"+r;return c.addEventListener(s,t,e),c.__dde_lifecycleToEvents?c:c.isConnected?(c.dispatchEvent(new Event(s)),c):(S(e.signal,()=>k.offConnected(c,t))&&k.onConnected(c,t),c)}};E.disconnected=function(t,e){let{custom_element:n}=b.current,r="disconnected";return typeof e!="object"&&(e={}),e.once=!0,function(c){n&&(c=n);let s="dde:"+r;return c.addEventListener(s,t,e),c.__dde_lifecycleToEvents||S(e.signal,()=>k.offDisconnected(c,t))&&k.onDisconnected(c,t),c}};var F=new WeakMap;E.disconnectedAsAbort=function(t){if(F.has(t))return F.get(t);let e=new AbortController;return F.set(t,e),t(E.disconnected(()=>e.abort())),e};E.attributeChanged=function(t,e){let n="attributeChanged";return typeof e!="object"&&(e={}),function(o){let c="dde:"+n;if(o.addEventListener(c,t,e),o.__dde_lifecycleToEvents||ht.has(o))return o;let s=new MutationObserver(function(d){for(let{attributeName:l,target:h}of d)h.dispatchEvent(new CustomEvent(c,{detail:[l,h.getAttribute(l)]}))});return S(e.signal,()=>s.disconnect())&&s.observe(o,{attributes:!0}),o}};function bt(){let t=new Map,e=!1,n=new MutationObserver(function(i){for(let u of i)if(u.type==="childList"){if(l(u.addedNodes,!0)){s();continue}h(u.removedNodes,!0)&&s()}});return{onConnected(i,u){c();let f=o(i);f.connected.has(u)||(f.connected.add(u),f.length_c+=1)},offConnected(i,u){if(!t.has(i))return;let f=t.get(i);f.connected.has(u)&&(f.connected.delete(u),f.length_c-=1,r(i,f))},onDisconnected(i,u){c();let f=o(i);f.disconnected.has(u)||(f.disconnected.add(u),f.length_d+=1)},offDisconnected(i,u){if(!t.has(i))return;let f=t.get(i);f.disconnected.has(u)&&(f.disconnected.delete(u),f.length_d-=1,r(i,f))}};function r(i,u){u.length_c||u.length_d||(t.delete(i),s())}function o(i){if(t.has(i))return t.get(i);let u={connected:new WeakSet,length_c:0,disconnected:new WeakSet,length_d:0};return t.set(i,u),u}function c(){e||(e=!0,n.observe(document.body,{childList:!0,subtree:!0}))}function s(){!e||t.size||(e=!1,n.disconnect())}function a(){return new Promise(function(i){(requestIdleCallback||requestAnimationFrame)(i)})}async function d(i){t.size>30&&await a();let u=[];if(!(i instanceof Node))return u;for(let f of t.keys())f===i||!(f instanceof Node)||i.contains(f)&&u.push(f);return u}function l(i,u){let f=!1;for(let v of i){if(u&&d(v).then(l),!t.has(v))continue;let _=t.get(v);_.length_c&&(v.dispatchEvent(new Event("dde:connected")),_.connected=new WeakSet,_.length_c=0,_.length_d||t.delete(v),f=!0)}return f}function h(i,u){let f=!1;for(let v of i)u&&d(v).then(h),!(!t.has(v)||!t.get(v).length_d)&&(v.dispatchEvent(new Event("dde:disconnected")),t.delete(v),f=!0);return f}}var p=Symbol.for("observable");function D(t){try{return Reflect.has(t,p)}catch{return!1}}var W=[],g=new WeakMap;function m(t,e){if(typeof t!="function")return X(!1,t,e);if(D(t))return t;let n=X(!0),r=function(){let[o,...c]=g.get(r);if(g.set(r,new Set([o])),W.push(r),rt(n,t()),W.pop(),!c.length)return;let s=g.get(r);for(let a of c)s.has(a)||R(a,r)};return g.set(n[p],r),g.set(r,new Set([n])),r(),n}m.action=function(t,e,...n){let r=t[p],{actions:o}=r;if(!o||!Reflect.has(o,e))throw new Error(`'${t}' has no action with name '${e}'!`);if(o[e].apply(r,n),r.skip)return Reflect.deleteProperty(r,"skip");r.listeners.forEach(c=>c(r.value))};m.on=function t(e,n,r={}){let{signal:o}=r;if(!(o&&o.aborted)){if(Array.isArray(e))return e.forEach(c=>t(c,n,r));q(e,n),o&&o.addEventListener("abort",()=>R(e,n))}};m.symbols={onclear:Symbol.for("Observable.onclear")};m.clear=function(...t){for(let n of t){Reflect.deleteProperty(n,"toJSON");let r=n[p];r.onclear.forEach(o=>o.call(r)),e(n,r),Reflect.deleteProperty(n,p)}function e(n,r){r.listeners.forEach(o=>{if(r.listeners.delete(o),!g.has(o))return;let c=g.get(o);c.delete(n),!(c.size>1)&&(n.clear(...c),g.delete(o))})}};var L="__dde_reactive";m.el=function(t,e){let n=w.mark({type:"reactive"},!1),r=n.end,o=document.createDocumentFragment();o.append(n,r);let{current:c}=b,s=a=>{if(!n.parentNode||!r.parentNode)return R(t,s);b.push(c);let d=e(a);b.pop(),Array.isArray(d)||(d=[d]);let l=n;for(;(l=n.nextSibling)!==r;)l.remove();n.after(...d)};return q(t,s),et(t,s,n,e),s(t()),o};function gt(t,e){let n=(...r)=>r.length?t.setAttribute(e,...r):t.getAttribute(e);return n.attribute=e,n}var z="__dde_attributes";m.observedAttributes=function(t){let e=N(t,gt),n=t[z]={},r={_set(o){this.value=o}};return Object.keys(e).forEach(o=>{let c=e[o]=nt(e[o],e[o](),r);n[c.attribute]=c}),E.attributeChanged(function({detail:c}){/*! This maps attributes to observables (`O.observedAttributes`).
- * Investigate `__dde_attributes` key of the element.*/let[s,a]=c,d=t[z][s];if(d)return m.action(d,"_set",a)})(t),E.disconnected(function(){/*! This removes all observables mapped to attributes (`O.observedAttributes`).
- * Investigate `__dde_attributes` key of the element.*/m.clear(...Object.values(t[z]))})(t),e};var tt={isObservable:D,processReactiveAttribute(t,e,n,r){if(!D(n))return n;let o=c=>r(e,c);return q(n,o),et(n,o,t,e),n()}};function et(t,e,...n){let{current:r}=b;r.prevent||r.host(function(o){o[L]||(o[L]=[],E.disconnected(()=>o[L].forEach(([[c,s]])=>R(c,s,c[p]?.host()===o)))(o)),o[L].push([[t,e],...n])})}function X(t,e,n){let r=t?()=>Y(r):(...o)=>o.length?rt(r,...o):Y(r);return nt(r,e,n)}var vt=Object.assign(Object.create(null),{stopPropagation(){this.skip=!0}}),U=class extends Error{constructor(){super();let[e,...n]=this.stack.split(`
-`),r=e.slice(e.indexOf("@"),e.indexOf(".js:")+4);this.stack=n.find(o=>!o.includes(r))}};function nt(t,e,n){let r=[];B(n)!=="[object Object]"&&(n={});let{onclear:o}=m.symbols;n[o]&&(r.push(n[o]),Reflect.deleteProperty(n,o));let{host:c}=b;return Reflect.defineProperty(t,p,{value:{value:e,actions:n,onclear:r,host:c,listeners:new Set,defined:new U},enumerable:!1,writable:!1,configurable:!0}),t.toJSON=()=>t(),Object.setPrototypeOf(t[p],vt),t}function mt(){return W[W.length-1]}function Y(t){if(!t[p])return;let{value:e,listeners:n}=t[p],r=mt();return r&&n.add(r),g.has(r)&&g.get(r).add(t),e}function rt(t,e,n){if(!t[p])return;let r=t[p];if(!(!n&&r.value===e))return r.value=e,r.listeners.forEach(o=>o(e)),e}function q(t,e){if(t[p])return t[p].listeners.add(e)}function R(t,e,n){let r=t[p];if(!r)return;let o=r.listeners.delete(e);if(n&&!r.listeners.size){if(t.clear(t),!g.has(r))return o;let c=g.get(r);if(!g.has(c))return o;g.get(c).forEach(s=>R(s,c,!0))}return o}T(tt);export{m as O,O as assign,Z as assignAttribute,st as chainableAppend,ut as classListDeclarative,w as createElement,Rt as createElementNS,jt as customElementRender,kt as customElementWithDDE,Wt as dispatchEvent,w as el,Rt as elNS,ft as elementAttribute,Ct as empty,D as isObservable,kt as lifecycleToEvents,m as observable,pt as observedAttributes,E as on,T as registerReactivity,b as scope,wt as simulateSlots};
+var A={isObservable(t){return!1},processReactiveAttribute(t,e,n,r){return n}};function M(t,e=!0){return e?Object.assign(A,t):(Object.setPrototypeOf(t,A),t)}function C(t){return A.isPrototypeOf(t)&&t!==A?t:A}function y(t){return typeof t>"u"}function H(t){let e=typeof t;return e!=="object"?e:t===null?"null":Object.prototype.toString.call(t)}function S(t,e){if(!t||!(t instanceof AbortSignal))return!0;if(!t.aborted)return t.addEventListener("abort",e),function(){t.removeEventListener("abort",e)}}function N(t,e){let{observedAttributes:n=[]}=t.constructor;return n.reduce(function(r,o){return Reflect.set(r,ct(o),e(t,o)),r},{})}function ct(t){return t.replace(/-./g,e=>e[1].toUpperCase())}var $={setDeleteAttr:st,ssr:""};function st(t,e,n){if(Reflect.set(t,e,n),!!y(n)){if(Reflect.deleteProperty(t,e),t instanceof HTMLElement&&t.getAttribute(e)==="undefined")return t.removeAttribute(e);if(Reflect.get(t,e)==="undefined")return Reflect.set(t,e,"")}}var x=[{scope:document.body,host:t=>t?t(document.body):document.body,custom_element:!1,prevent:!0}],g={get current(){return x[x.length-1]},get host(){return this.current.host},preventDefault(){let{current:t}=this;return t.prevent=!0,t},get state(){return[...x]},push(t={}){return x.push(Object.assign({},this.current,{prevent:!1},t))},pushRoot(){return x.push(x[0])},pop(){if(x.length!==1)return x.pop()}};function I(...t){return this.appendOriginal(...t),this}function it(t){return t.append===I||(t.appendOriginal=t.append,t.append=I),t}var P;function w(t,e,...n){let r=C(this),o=0,c,s;switch((Object(e)!==e||r.isObservable(e))&&(e={textContent:e}),!0){case typeof t=="function":{o=1,g.push({scope:t,host:(...p)=>p.length?(o===1?n.unshift(...p):p.forEach(b=>b(s)),void 0):s}),c=t(e||void 0);let a=c instanceof DocumentFragment;if(c.nodeName==="#comment")break;let d=w.mark({type:"component",name:t.name,host:a?"this":"parentElement"});c.prepend(d),a&&(s=d);break}case t==="#text":c=O.call(this,document.createTextNode(""),e);break;case(t==="<>"||!t):c=O.call(this,document.createDocumentFragment(),e);break;case!!P:c=O.call(this,document.createElementNS(P,t),e);break;case!c:c=O.call(this,document.createElement(t),e)}return it(c),s||(s=c),n.forEach(a=>a(s)),o&&g.pop(),o=2,c}function Rt(t,e=t,n=void 0){let r=Symbol.for("default"),o=Array.from(e.querySelectorAll("slot")).reduce((s,a)=>Reflect.set(s,a.name||r,a)&&s,{}),c=Reflect.has(o,r);if(t.append=new Proxy(t.append,{apply(s,a,d){if(!d.length)return t;let p=document.createDocumentFragment();for(let b of d){if(!b||!b.slot){c&&p.appendChild(b);continue}let i=b.slot,u=o[i];at(b,"remove","slot"),u&&(ut(u,b,n),Reflect.deleteProperty(o,i))}return c&&(o[r].replaceWith(p),Reflect.deleteProperty(o,r)),t.append=s,t}}),t!==e){let s=Array.from(t.childNodes);s.forEach(a=>a.remove()),t.append(...s)}return e}function ut(t,e,n){n&&n(t,e);try{t.replaceWith(O(e,{className:[e.className,t.className],dataset:{...t.dataset}}))}catch{t.replaceWith(e)}}w.mark=function(t,e=!1){t=Object.entries(t).map(([o,c])=>o+`="${c}"`).join(" ");let n=e?"":"/",r=document.createComment(``);return e||(r.end=document.createComment("")),r};function Ct(t){let e=this;return function(...r){P=t;let o=w.call(e,...r);return P=void 0,o}}var{setDeleteAttr:J}=$,j=new WeakMap;function O(t,...e){if(!e.length)return t;j.set(t,V(t,this));for(let[n,r]of Object.entries(Object.assign({},...e)))G.call(this,t,n,r);return j.delete(t),t}function G(t,e,n){let{setRemoveAttr:r,s:o}=V(t,this),c=this;n=o.processReactiveAttribute(t,e,n,(a,d)=>G.call(c,t,a,d));let[s]=e;if(s==="=")return r(e.slice(1),n);if(s===".")return Z(t,e.slice(1),n);if(/(aria|data)([A-Z])/.test(e))return e=e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),r(e,n);switch(e==="className"&&(e="class"),e){case"xlink:href":return r(e,n,"http://www.w3.org/1999/xlink");case"textContent":return J(t,e,n);case"style":if(typeof n!="object")break;case"dataset":return F(o,n,Z.bind(null,t[e]));case"ariaset":return F(o,n,(a,d)=>r("aria-"+a,d));case"classList":return ft.call(c,t,n)}return dt(t,e)?J(t,e,n):r(e,n)}function V(t,e){if(j.has(t))return j.get(t);let r=(t instanceof SVGElement?pt:lt).bind(null,t,"Attribute"),o=C(e);return{setRemoveAttr:r,s:o}}function ft(t,e){let n=C(this);return F(n,e,(r,o)=>t.classList.toggle(r,o===-1?void 0:!!o)),t}function St(t){return Array.from(t.children).forEach(e=>e.remove()),t}function at(t,e,n,r){return t instanceof HTMLElement?t[e+"Attribute"](n,r):t[e+"AttributeNS"](null,n,r)}function dt(t,e){if(!Reflect.has(t,e))return!1;let n=K(t,e);return!y(n.set)}function K(t,e){if(t=Object.getPrototypeOf(t),!t)return{};let n=Object.getOwnPropertyDescriptor(t,e);return n||K(t,e)}function F(t,e,n){if(!(typeof e!="object"||e===null))return Object.entries(e).forEach(function([o,c]){o&&(c=t.processReactiveAttribute(e,o,c,n),n(o,c))})}function Q(t){return Array.isArray(t)?t.filter(Boolean).join(" "):t}function lt(t,e,n,r){return t[(y(r)?"remove":"set")+e](n,Q(r))}function pt(t,e,n,r,o=null){return t[(y(r)?"remove":"set")+e+"NS"](o,n,Q(r))}function Z(t,e,n){if(Reflect.set(t,e,n),!!y(n))return Reflect.deleteProperty(t,e)}function kt(t,e,n=ht){g.push({scope:t,host:(...o)=>o.length?o.forEach(c=>c(t)):t,custom_element:t}),typeof n=="function"&&(n=n.call(t,t));let r=e.call(t,n);return g.pop(),r}function Lt(t){for(let n of["connected","disconnected"])X(t.prototype,n+"Callback",function(r,o,c){r.apply(o,c),o.dispatchEvent(new Event("dde:"+n))});let e="attributeChanged";return X(t.prototype,e+"Callback",function(n,r,o){let[c,,s]=o;r.dispatchEvent(new CustomEvent("dde:"+e,{detail:[c,s]})),n.apply(r,o)}),t.prototype.__dde_lifecycleToEvents=!0,t}function X(t,e,n){t[e]=new Proxy(t[e]||(()=>{}),{apply:n})}function ht(t){return N(t,(e,n)=>e.getAttribute(n))}function Tt(t,e,n){return e||(e={}),function(o,...c){n&&(c.unshift(o),o=typeof n=="function"?n():n);let s=c.length?new CustomEvent(t,Object.assign({detail:c[0]},e)):new Event(t,e);return o.dispatchEvent(s)}}function E(t,e,n){return function(o){return o.addEventListener(t,e,n),o}}var k=gt(),bt=new WeakSet;E.connected=function(t,e){let{custom_element:n}=g.current,r="connected";return typeof e!="object"&&(e={}),e.once=!0,function(c){n&&(c=n);let s="dde:"+r;return c.addEventListener(s,t,e),c.__dde_lifecycleToEvents?c:c.isConnected?(c.dispatchEvent(new Event(s)),c):(S(e.signal,()=>k.offConnected(c,t))&&k.onConnected(c,t),c)}};E.disconnected=function(t,e){let{custom_element:n}=g.current,r="disconnected";return typeof e!="object"&&(e={}),e.once=!0,function(c){n&&(c=n);let s="dde:"+r;return c.addEventListener(s,t,e),c.__dde_lifecycleToEvents||S(e.signal,()=>k.offDisconnected(c,t))&&k.onDisconnected(c,t),c}};var z=new WeakMap;E.disconnectedAsAbort=function(t){if(z.has(t))return z.get(t);let e=new AbortController;return z.set(t,e),t(E.disconnected(()=>e.abort())),e};E.attributeChanged=function(t,e){let n="attributeChanged";return typeof e!="object"&&(e={}),function(o){let c="dde:"+n;if(o.addEventListener(c,t,e),o.__dde_lifecycleToEvents||bt.has(o))return o;let s=new MutationObserver(function(d){for(let{attributeName:p,target:b}of d)b.dispatchEvent(new CustomEvent(c,{detail:[p,b.getAttribute(p)]}))});return S(e.signal,()=>s.disconnect())&&s.observe(o,{attributes:!0}),o}};function gt(){let t=new Map,e=!1,n=new MutationObserver(function(i){for(let u of i)if(u.type==="childList"){if(p(u.addedNodes,!0)){s();continue}b(u.removedNodes,!0)&&s()}});return{onConnected(i,u){c();let f=o(i);f.connected.has(u)||(f.connected.add(u),f.length_c+=1)},offConnected(i,u){if(!t.has(i))return;let f=t.get(i);f.connected.has(u)&&(f.connected.delete(u),f.length_c-=1,r(i,f))},onDisconnected(i,u){c();let f=o(i);f.disconnected.has(u)||(f.disconnected.add(u),f.length_d+=1)},offDisconnected(i,u){if(!t.has(i))return;let f=t.get(i);f.disconnected.has(u)&&(f.disconnected.delete(u),f.length_d-=1,r(i,f))}};function r(i,u){u.length_c||u.length_d||(t.delete(i),s())}function o(i){if(t.has(i))return t.get(i);let u={connected:new WeakSet,length_c:0,disconnected:new WeakSet,length_d:0};return t.set(i,u),u}function c(){e||(e=!0,n.observe(document.body,{childList:!0,subtree:!0}))}function s(){!e||t.size||(e=!1,n.disconnect())}function a(){return new Promise(function(i){(requestIdleCallback||requestAnimationFrame)(i)})}async function d(i,u){t.size>30&&await a();let f=[];if(!(i instanceof Node))return f;for(let l of t.keys())l===i||!(l instanceof Node)||u(l)||i.contains(l)&&f.push(l);return f}function p(i,u){let f=!1;for(let l of i){if(u&&d(l,T=>!T.isConnectedd).then(p),!t.has(l))continue;let _=t.get(l);_.length_c&&(l.dispatchEvent(new Event("dde:connected")),_.connected=new WeakSet,_.length_c=0,_.length_d||t.delete(l),f=!0)}return f}function b(i,u){let f=!1;for(let l of i)u&&d(l,T=>T.isConnectedd).then(b),!(!t.has(l)||!t.get(l).length_d)&&(l.dispatchEvent(new Event("dde:disconnected")),t.delete(l),f=!0);return f}}var h=Symbol.for("observable");function D(t){try{return Reflect.has(t,h)}catch{return!1}}var W=[],v=new WeakMap;function m(t,e){if(typeof t!="function")return Y(!1,t,e);if(D(t))return t;let n=Y(!0),r=function(){let[o,...c]=v.get(r);if(v.set(r,new Set([o])),W.push(r),ot(n,t()),W.pop(),!c.length)return;let s=v.get(r);for(let a of c)s.has(a)||R(a,r)};return v.set(n[h],r),v.set(r,new Set([n])),r(),n}m.action=function(t,e,...n){let r=t[h],{actions:o}=r;if(!o||!Reflect.has(o,e))throw new Error(`'${t}' has no action with name '${e}'!`);if(o[e].apply(r,n),r.skip)return Reflect.deleteProperty(r,"skip");r.listeners.forEach(c=>c(r.value))};m.on=function t(e,n,r={}){let{signal:o}=r;if(!(o&&o.aborted)){if(Array.isArray(e))return e.forEach(c=>t(c,n,r));B(e,n),o&&o.addEventListener("abort",()=>R(e,n))}};m.symbols={onclear:Symbol.for("Observable.onclear")};m.clear=function(...t){for(let n of t){Reflect.deleteProperty(n,"toJSON");let r=n[h];r.onclear.forEach(o=>o.call(r)),e(n,r),Reflect.deleteProperty(n,h)}function e(n,r){r.listeners.forEach(o=>{if(r.listeners.delete(o),!v.has(o))return;let c=v.get(o);c.delete(n),!(c.size>1)&&(n.clear(...c),v.delete(o))})}};var L="__dde_reactive";m.el=function(t,e){let n=w.mark({type:"reactive"},!1),r=n.end,o=document.createDocumentFragment();o.append(n,r);let{current:c}=g,s=a=>{if(!n.parentNode||!r.parentNode)return R(t,s);g.push(c);let d=e(a);g.pop(),Array.isArray(d)||(d=[d]);let p=n;for(;(p=n.nextSibling)!==r;)p.remove();n.after(...d)};return B(t,s),nt(t,s,n,e),s(t()),o};function vt(t,e){let n=(...r)=>r.length?t.setAttribute(e,...r):t.getAttribute(e);return n.attribute=e,n}var U="__dde_attributes";m.observedAttributes=function(t){let e=N(t,vt),n=t[U]={},r={_set(o){this.value=o}};return Object.keys(e).forEach(o=>{let c=e[o]=rt(e[o],e[o](),r);n[c.attribute]=c}),E.attributeChanged(function({detail:c}){/*! This maps attributes to observables (`O.observedAttributes`).
+ * Investigate `__dde_attributes` key of the element.*/let[s,a]=c,d=t[U][s];if(d)return m.action(d,"_set",a)})(t),E.disconnected(function(){/*! This removes all observables mapped to attributes (`O.observedAttributes`).
+ * Investigate `__dde_attributes` key of the element.*/m.clear(...Object.values(t[U]))})(t),e};var et={isObservable:D,processReactiveAttribute(t,e,n,r){if(!D(n))return n;let o=c=>r(e,c);return B(n,o),nt(n,o,t,e),n()}};function nt(t,e,...n){let{current:r}=g;r.prevent||r.host(function(o){o[L]||(o[L]=[],E.disconnected(()=>o[L].forEach(([[c,s]])=>R(c,s,c[h]?.host()===o)))(o)),o[L].push([[t,e],...n])})}function Y(t,e,n){let r=t?()=>tt(r):(...o)=>o.length?ot(r,...o):tt(r);return rt(r,e,n)}var mt=Object.assign(Object.create(null),{stopPropagation(){this.skip=!0}}),q=class extends Error{constructor(){super();let[e,...n]=this.stack.split(`
+`),r=e.slice(e.indexOf("@"),e.indexOf(".js:")+4);this.stack=n.find(o=>!o.includes(r))}};function rt(t,e,n){let r=[];H(n)!=="[object Object]"&&(n={});let{onclear:o}=m.symbols;n[o]&&(r.push(n[o]),Reflect.deleteProperty(n,o));let{host:c}=g;return Reflect.defineProperty(t,h,{value:{value:e,actions:n,onclear:r,host:c,listeners:new Set,defined:new q},enumerable:!1,writable:!1,configurable:!0}),t.toJSON=()=>t(),Object.setPrototypeOf(t[h],mt),t}function Et(){return W[W.length-1]}function tt(t){if(!t[h])return;let{value:e,listeners:n}=t[h],r=Et();return r&&n.add(r),v.has(r)&&v.get(r).add(t),e}function ot(t,e,n){if(!t[h])return;let r=t[h];if(!(!n&&r.value===e))return r.value=e,r.listeners.forEach(o=>o(e)),e}function B(t,e){if(t[h])return t[h].listeners.add(e)}function R(t,e,n){let r=t[h];if(!r)return;let o=r.listeners.delete(e);if(n&&!r.listeners.size){if(m.clear(t),!v.has(r))return o;let c=v.get(r);if(!v.has(c))return o;v.get(c).forEach(s=>R(s,c,!0))}return o}M(et);export{m as O,O as assign,G as assignAttribute,it as chainableAppend,ft as classListDeclarative,w as createElement,Ct as createElementNS,kt as customElementRender,Lt as customElementWithDDE,Tt as dispatchEvent,w as el,Ct as elNS,at as elementAttribute,St as empty,D as isObservable,Lt as lifecycleToEvents,m as observable,ht as observedAttributes,E as on,M as registerReactivity,g as scope,Rt as simulateSlots};
diff --git a/dist/esm.js b/dist/esm.js
index 7e51b15..b977011 100644
--- a/dist/esm.js
+++ b/dist/esm.js
@@ -1 +1 @@
-var m={isObservable(t){return!1},processReactiveAttribute(t,e,n,c){return n}};function q(t,e=!0){return e?Object.assign(m,t):(Object.setPrototypeOf(t,m),t)}function _(t){return m.isPrototypeOf(t)&&t!==m?t:m}function v(t){return typeof t>"u"}function y(t,e){if(!t||!(t instanceof AbortSignal))return!0;if(!t.aborted)return t.addEventListener("abort",e),function(){t.removeEventListener("abort",e)}}function L(t,e){let{observedAttributes:n=[]}=t.constructor;return n.reduce(function(c,r){return Reflect.set(c,F(r),e(t,r)),c},{})}function F(t){return t.replace(/-./g,e=>e[1].toUpperCase())}var R={setDeleteAttr:z,ssr:""};function z(t,e,n){if(Reflect.set(t,e,n),!!v(n)){if(Reflect.deleteProperty(t,e),t instanceof HTMLElement&&t.getAttribute(e)==="undefined")return t.removeAttribute(e);if(Reflect.get(t,e)==="undefined")return Reflect.set(t,e,"")}}var b=[{scope:document.body,host:t=>t?t(document.body):document.body,custom_element:!1,prevent:!0}],g={get current(){return b[b.length-1]},get host(){return this.current.host},preventDefault(){let{current:t}=this;return t.prevent=!0,t},get state(){return[...b]},push(t={}){return b.push(Object.assign({},this.current,{prevent:!1},t))},pushRoot(){return b.push(b[0])},pop(){if(b.length!==1)return b.pop()}};function P(...t){return this.appendOriginal(...t),this}function B(t){return t.append===P||(t.appendOriginal=t.append,t.append=P),t}var w;function N(t,e,...n){let c=_(this),r=0,o,s;switch((Object(e)!==e||c.isObservable(e))&&(e={textContent:e}),!0){case typeof t=="function":{r=1,g.push({scope:t,host:(...l)=>l.length?(r===1?n.unshift(...l):l.forEach(p=>p(s)),void 0):s}),o=t(e||void 0);let a=o instanceof DocumentFragment;if(o.nodeName==="#comment")break;let d=N.mark({type:"component",name:t.name,host:a?"this":"parentElement"});o.prepend(d),a&&(s=d);break}case t==="#text":o=x.call(this,document.createTextNode(""),e);break;case(t==="<>"||!t):o=x.call(this,document.createDocumentFragment(),e);break;case!!w:o=x.call(this,document.createElementNS(w,t),e);break;case!o:o=x.call(this,document.createElement(t),e)}return B(o),s||(s=o),n.forEach(a=>a(s)),r&&g.pop(),r=2,o}function ct(t,e=t,n=void 0){let c=Symbol.for("default"),r=Array.from(e.querySelectorAll("slot")).reduce((s,a)=>Reflect.set(s,a.name||c,a)&&s,{}),o=Reflect.has(r,c);if(t.append=new Proxy(t.append,{apply(s,a,d){if(!d.length)return t;let l=document.createDocumentFragment();for(let p of d){if(!p||!p.slot){o&&l.appendChild(p);continue}let i=p.slot,u=r[i];Z(p,"remove","slot"),u&&(H(u,p,n),Reflect.deleteProperty(r,i))}return o&&(r[c].replaceWith(l),Reflect.deleteProperty(r,c)),t.append=s,t}}),t!==e){let s=Array.from(t.childNodes);s.forEach(a=>a.remove()),t.append(...s)}return e}function H(t,e,n){n&&n(t,e);try{t.replaceWith(x(e,{className:[e.className,t.className],dataset:{...t.dataset}}))}catch{t.replaceWith(e)}}N.mark=function(t,e=!1){t=Object.entries(t).map(([r,o])=>r+`="${o}"`).join(" ");let n=e?"":"/",c=document.createComment(``);return e||(c.end=document.createComment("")),c};function st(t){let e=this;return function(...c){w=t;let r=N.call(e,...c);return w=void 0,r}}var{setDeleteAttr:W}=R,C=new WeakMap;function x(t,...e){if(!e.length)return t;C.set(t,M(t,this));for(let[n,c]of Object.entries(Object.assign({},...e)))T.call(this,t,n,c);return C.delete(t),t}function T(t,e,n){let{setRemoveAttr:c,s:r}=M(t,this),o=this;n=r.processReactiveAttribute(t,e,n,(a,d)=>T.call(o,t,a,d));let[s]=e;if(s==="=")return c(e.slice(1),n);if(s===".")return j(t,e.slice(1),n);if(/(aria|data)([A-Z])/.test(e))return e=e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),c(e,n);switch(e==="className"&&(e="class"),e){case"xlink:href":return c(e,n,"http://www.w3.org/1999/xlink");case"textContent":return W(t,e,n);case"style":if(typeof n!="object")break;case"dataset":return S(r,n,j.bind(null,t[e]));case"ariaset":return S(r,n,(a,d)=>c("aria-"+a,d));case"classList":return I.call(o,t,n)}return G(t,e)?W(t,e,n):c(e,n)}function M(t,e){if(C.has(t))return C.get(t);let c=(t instanceof SVGElement?J:V).bind(null,t,"Attribute"),r=_(e);return{setRemoveAttr:c,s:r}}function I(t,e){let n=_(this);return S(n,e,(c,r)=>t.classList.toggle(c,r===-1?void 0:!!r)),t}function it(t){return Array.from(t.children).forEach(e=>e.remove()),t}function Z(t,e,n,c){return t instanceof HTMLElement?t[e+"Attribute"](n,c):t[e+"AttributeNS"](null,n,c)}function G(t,e){if(!Reflect.has(t,e))return!1;let n=$(t,e);return!v(n.set)}function $(t,e){if(t=Object.getPrototypeOf(t),!t)return{};let n=Object.getOwnPropertyDescriptor(t,e);return n||$(t,e)}function S(t,e,n){if(!(typeof e!="object"||e===null))return Object.entries(e).forEach(function([r,o]){r&&(o=t.processReactiveAttribute(e,r,o,n),n(r,o))})}function k(t){return Array.isArray(t)?t.filter(Boolean).join(" "):t}function V(t,e,n,c){return t[(v(c)?"remove":"set")+e](n,k(c))}function J(t,e,n,c,r=null){return t[(v(c)?"remove":"set")+e+"NS"](r,n,k(c))}function j(t,e,n){if(Reflect.set(t,e,n),!!v(n))return Reflect.deleteProperty(t,e)}function dt(t,e,n=K){g.push({scope:t,host:(...r)=>r.length?r.forEach(o=>o(t)):t,custom_element:t}),typeof n=="function"&&(n=n.call(t,t));let c=e.call(t,n);return g.pop(),c}function pt(t){for(let n of["connected","disconnected"])U(t.prototype,n+"Callback",function(c,r,o){c.apply(r,o),r.dispatchEvent(new Event("dde:"+n))});let e="attributeChanged";return U(t.prototype,e+"Callback",function(n,c,r){let[o,,s]=r;c.dispatchEvent(new CustomEvent("dde:"+e,{detail:[o,s]})),n.apply(c,r)}),t.prototype.__dde_lifecycleToEvents=!0,t}function U(t,e,n){t[e]=new Proxy(t[e]||(()=>{}),{apply:n})}function K(t){return L(t,(e,n)=>e.getAttribute(n))}function bt(t,e,n){return e||(e={}),function(r,...o){n&&(o.unshift(r),r=typeof n=="function"?n():n);let s=o.length?new CustomEvent(t,Object.assign({detail:o[0]},e)):new Event(t,e);return r.dispatchEvent(s)}}function A(t,e,n){return function(r){return r.addEventListener(t,e,n),r}}var O=X(),Q=new WeakSet;A.connected=function(t,e){let{custom_element:n}=g.current,c="connected";return typeof e!="object"&&(e={}),e.once=!0,function(o){n&&(o=n);let s="dde:"+c;return o.addEventListener(s,t,e),o.__dde_lifecycleToEvents?o:o.isConnected?(o.dispatchEvent(new Event(s)),o):(y(e.signal,()=>O.offConnected(o,t))&&O.onConnected(o,t),o)}};A.disconnected=function(t,e){let{custom_element:n}=g.current,c="disconnected";return typeof e!="object"&&(e={}),e.once=!0,function(o){n&&(o=n);let s="dde:"+c;return o.addEventListener(s,t,e),o.__dde_lifecycleToEvents||y(e.signal,()=>O.offDisconnected(o,t))&&O.onDisconnected(o,t),o}};var D=new WeakMap;A.disconnectedAsAbort=function(t){if(D.has(t))return D.get(t);let e=new AbortController;return D.set(t,e),t(A.disconnected(()=>e.abort())),e};A.attributeChanged=function(t,e){let n="attributeChanged";return typeof e!="object"&&(e={}),function(r){let o="dde:"+n;if(r.addEventListener(o,t,e),r.__dde_lifecycleToEvents||Q.has(r))return r;let s=new MutationObserver(function(d){for(let{attributeName:l,target:p}of d)p.dispatchEvent(new CustomEvent(o,{detail:[l,p.getAttribute(l)]}))});return y(e.signal,()=>s.disconnect())&&s.observe(r,{attributes:!0}),r}};function X(){let t=new Map,e=!1,n=new MutationObserver(function(i){for(let u of i)if(u.type==="childList"){if(l(u.addedNodes,!0)){s();continue}p(u.removedNodes,!0)&&s()}});return{onConnected(i,u){o();let f=r(i);f.connected.has(u)||(f.connected.add(u),f.length_c+=1)},offConnected(i,u){if(!t.has(i))return;let f=t.get(i);f.connected.has(u)&&(f.connected.delete(u),f.length_c-=1,c(i,f))},onDisconnected(i,u){o();let f=r(i);f.disconnected.has(u)||(f.disconnected.add(u),f.length_d+=1)},offDisconnected(i,u){if(!t.has(i))return;let f=t.get(i);f.disconnected.has(u)&&(f.disconnected.delete(u),f.length_d-=1,c(i,f))}};function c(i,u){u.length_c||u.length_d||(t.delete(i),s())}function r(i){if(t.has(i))return t.get(i);let u={connected:new WeakSet,length_c:0,disconnected:new WeakSet,length_d:0};return t.set(i,u),u}function o(){e||(e=!0,n.observe(document.body,{childList:!0,subtree:!0}))}function s(){!e||t.size||(e=!1,n.disconnect())}function a(){return new Promise(function(i){(requestIdleCallback||requestAnimationFrame)(i)})}async function d(i){t.size>30&&await a();let u=[];if(!(i instanceof Node))return u;for(let f of t.keys())f===i||!(f instanceof Node)||i.contains(f)&&u.push(f);return u}function l(i,u){let f=!1;for(let h of i){if(u&&d(h).then(l),!t.has(h))continue;let E=t.get(h);E.length_c&&(h.dispatchEvent(new Event("dde:connected")),E.connected=new WeakSet,E.length_c=0,E.length_d||t.delete(h),f=!0)}return f}function p(i,u){let f=!1;for(let h of i)u&&d(h).then(p),!(!t.has(h)||!t.get(h).length_d)&&(h.dispatchEvent(new Event("dde:disconnected")),t.delete(h),f=!0);return f}}export{x as assign,T as assignAttribute,B as chainableAppend,I as classListDeclarative,N as createElement,st as createElementNS,dt as customElementRender,pt as customElementWithDDE,bt as dispatchEvent,N as el,st as elNS,Z as elementAttribute,it as empty,pt as lifecycleToEvents,K as observedAttributes,A as on,q as registerReactivity,g as scope,ct as simulateSlots};
+var m={isObservable(t){return!1},processReactiveAttribute(t,e,n,c){return n}};function F(t,e=!0){return e?Object.assign(m,t):(Object.setPrototypeOf(t,m),t)}function _(t){return m.isPrototypeOf(t)&&t!==m?t:m}function v(t){return typeof t>"u"}function y(t,e){if(!t||!(t instanceof AbortSignal))return!0;if(!t.aborted)return t.addEventListener("abort",e),function(){t.removeEventListener("abort",e)}}function P(t,e){let{observedAttributes:n=[]}=t.constructor;return n.reduce(function(c,r){return Reflect.set(c,z(r),e(t,r)),c},{})}function z(t){return t.replace(/-./g,e=>e[1].toUpperCase())}var S={setDeleteAttr:B,ssr:""};function B(t,e,n){if(Reflect.set(t,e,n),!!v(n)){if(Reflect.deleteProperty(t,e),t instanceof HTMLElement&&t.getAttribute(e)==="undefined")return t.removeAttribute(e);if(Reflect.get(t,e)==="undefined")return Reflect.set(t,e,"")}}var b=[{scope:document.body,host:t=>t?t(document.body):document.body,custom_element:!1,prevent:!0}],g={get current(){return b[b.length-1]},get host(){return this.current.host},preventDefault(){let{current:t}=this;return t.prevent=!0,t},get state(){return[...b]},push(t={}){return b.push(Object.assign({},this.current,{prevent:!1},t))},pushRoot(){return b.push(b[0])},pop(){if(b.length!==1)return b.pop()}};function W(...t){return this.appendOriginal(...t),this}function H(t){return t.append===W||(t.appendOriginal=t.append,t.append=W),t}var w;function D(t,e,...n){let c=_(this),r=0,o,s;switch((Object(e)!==e||c.isObservable(e))&&(e={textContent:e}),!0){case typeof t=="function":{r=1,g.push({scope:t,host:(...h)=>h.length?(r===1?n.unshift(...h):h.forEach(l=>l(s)),void 0):s}),o=t(e||void 0);let a=o instanceof DocumentFragment;if(o.nodeName==="#comment")break;let p=D.mark({type:"component",name:t.name,host:a?"this":"parentElement"});o.prepend(p),a&&(s=p);break}case t==="#text":o=x.call(this,document.createTextNode(""),e);break;case(t==="<>"||!t):o=x.call(this,document.createDocumentFragment(),e);break;case!!w:o=x.call(this,document.createElementNS(w,t),e);break;case!o:o=x.call(this,document.createElement(t),e)}return H(o),s||(s=o),n.forEach(a=>a(s)),r&&g.pop(),r=2,o}function st(t,e=t,n=void 0){let c=Symbol.for("default"),r=Array.from(e.querySelectorAll("slot")).reduce((s,a)=>Reflect.set(s,a.name||c,a)&&s,{}),o=Reflect.has(r,c);if(t.append=new Proxy(t.append,{apply(s,a,p){if(!p.length)return t;let h=document.createDocumentFragment();for(let l of p){if(!l||!l.slot){o&&h.appendChild(l);continue}let i=l.slot,u=r[i];G(l,"remove","slot"),u&&(I(u,l,n),Reflect.deleteProperty(r,i))}return o&&(r[c].replaceWith(h),Reflect.deleteProperty(r,c)),t.append=s,t}}),t!==e){let s=Array.from(t.childNodes);s.forEach(a=>a.remove()),t.append(...s)}return e}function I(t,e,n){n&&n(t,e);try{t.replaceWith(x(e,{className:[e.className,t.className],dataset:{...t.dataset}}))}catch{t.replaceWith(e)}}D.mark=function(t,e=!1){t=Object.entries(t).map(([r,o])=>r+`="${o}"`).join(" ");let n=e?"":"/",c=document.createComment(``);return e||(c.end=document.createComment("")),c};function it(t){let e=this;return function(...c){w=t;let r=D.call(e,...c);return w=void 0,r}}var{setDeleteAttr:j}=S,C=new WeakMap;function x(t,...e){if(!e.length)return t;C.set(t,$(t,this));for(let[n,c]of Object.entries(Object.assign({},...e)))M.call(this,t,n,c);return C.delete(t),t}function M(t,e,n){let{setRemoveAttr:c,s:r}=$(t,this),o=this;n=r.processReactiveAttribute(t,e,n,(a,p)=>M.call(o,t,a,p));let[s]=e;if(s==="=")return c(e.slice(1),n);if(s===".")return T(t,e.slice(1),n);if(/(aria|data)([A-Z])/.test(e))return e=e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),c(e,n);switch(e==="className"&&(e="class"),e){case"xlink:href":return c(e,n,"http://www.w3.org/1999/xlink");case"textContent":return j(t,e,n);case"style":if(typeof n!="object")break;case"dataset":return N(r,n,T.bind(null,t[e]));case"ariaset":return N(r,n,(a,p)=>c("aria-"+a,p));case"classList":return Z.call(o,t,n)}return V(t,e)?j(t,e,n):c(e,n)}function $(t,e){if(C.has(t))return C.get(t);let c=(t instanceof SVGElement?K:J).bind(null,t,"Attribute"),r=_(e);return{setRemoveAttr:c,s:r}}function Z(t,e){let n=_(this);return N(n,e,(c,r)=>t.classList.toggle(c,r===-1?void 0:!!r)),t}function ut(t){return Array.from(t.children).forEach(e=>e.remove()),t}function G(t,e,n,c){return t instanceof HTMLElement?t[e+"Attribute"](n,c):t[e+"AttributeNS"](null,n,c)}function V(t,e){if(!Reflect.has(t,e))return!1;let n=k(t,e);return!v(n.set)}function k(t,e){if(t=Object.getPrototypeOf(t),!t)return{};let n=Object.getOwnPropertyDescriptor(t,e);return n||k(t,e)}function N(t,e,n){if(!(typeof e!="object"||e===null))return Object.entries(e).forEach(function([r,o]){r&&(o=t.processReactiveAttribute(e,r,o,n),n(r,o))})}function U(t){return Array.isArray(t)?t.filter(Boolean).join(" "):t}function J(t,e,n,c){return t[(v(c)?"remove":"set")+e](n,U(c))}function K(t,e,n,c,r=null){return t[(v(c)?"remove":"set")+e+"NS"](r,n,U(c))}function T(t,e,n){if(Reflect.set(t,e,n),!!v(n))return Reflect.deleteProperty(t,e)}function pt(t,e,n=Q){g.push({scope:t,host:(...r)=>r.length?r.forEach(o=>o(t)):t,custom_element:t}),typeof n=="function"&&(n=n.call(t,t));let c=e.call(t,n);return g.pop(),c}function lt(t){for(let n of["connected","disconnected"])q(t.prototype,n+"Callback",function(c,r,o){c.apply(r,o),r.dispatchEvent(new Event("dde:"+n))});let e="attributeChanged";return q(t.prototype,e+"Callback",function(n,c,r){let[o,,s]=r;c.dispatchEvent(new CustomEvent("dde:"+e,{detail:[o,s]})),n.apply(c,r)}),t.prototype.__dde_lifecycleToEvents=!0,t}function q(t,e,n){t[e]=new Proxy(t[e]||(()=>{}),{apply:n})}function Q(t){return P(t,(e,n)=>e.getAttribute(n))}function gt(t,e,n){return e||(e={}),function(r,...o){n&&(o.unshift(r),r=typeof n=="function"?n():n);let s=o.length?new CustomEvent(t,Object.assign({detail:o[0]},e)):new Event(t,e);return r.dispatchEvent(s)}}function A(t,e,n){return function(r){return r.addEventListener(t,e,n),r}}var O=Y(),X=new WeakSet;A.connected=function(t,e){let{custom_element:n}=g.current,c="connected";return typeof e!="object"&&(e={}),e.once=!0,function(o){n&&(o=n);let s="dde:"+c;return o.addEventListener(s,t,e),o.__dde_lifecycleToEvents?o:o.isConnected?(o.dispatchEvent(new Event(s)),o):(y(e.signal,()=>O.offConnected(o,t))&&O.onConnected(o,t),o)}};A.disconnected=function(t,e){let{custom_element:n}=g.current,c="disconnected";return typeof e!="object"&&(e={}),e.once=!0,function(o){n&&(o=n);let s="dde:"+c;return o.addEventListener(s,t,e),o.__dde_lifecycleToEvents||y(e.signal,()=>O.offDisconnected(o,t))&&O.onDisconnected(o,t),o}};var L=new WeakMap;A.disconnectedAsAbort=function(t){if(L.has(t))return L.get(t);let e=new AbortController;return L.set(t,e),t(A.disconnected(()=>e.abort())),e};A.attributeChanged=function(t,e){let n="attributeChanged";return typeof e!="object"&&(e={}),function(r){let o="dde:"+n;if(r.addEventListener(o,t,e),r.__dde_lifecycleToEvents||X.has(r))return r;let s=new MutationObserver(function(p){for(let{attributeName:h,target:l}of p)l.dispatchEvent(new CustomEvent(o,{detail:[h,l.getAttribute(h)]}))});return y(e.signal,()=>s.disconnect())&&s.observe(r,{attributes:!0}),r}};function Y(){let t=new Map,e=!1,n=new MutationObserver(function(i){for(let u of i)if(u.type==="childList"){if(h(u.addedNodes,!0)){s();continue}l(u.removedNodes,!0)&&s()}});return{onConnected(i,u){o();let f=r(i);f.connected.has(u)||(f.connected.add(u),f.length_c+=1)},offConnected(i,u){if(!t.has(i))return;let f=t.get(i);f.connected.has(u)&&(f.connected.delete(u),f.length_c-=1,c(i,f))},onDisconnected(i,u){o();let f=r(i);f.disconnected.has(u)||(f.disconnected.add(u),f.length_d+=1)},offDisconnected(i,u){if(!t.has(i))return;let f=t.get(i);f.disconnected.has(u)&&(f.disconnected.delete(u),f.length_d-=1,c(i,f))}};function c(i,u){u.length_c||u.length_d||(t.delete(i),s())}function r(i){if(t.has(i))return t.get(i);let u={connected:new WeakSet,length_c:0,disconnected:new WeakSet,length_d:0};return t.set(i,u),u}function o(){e||(e=!0,n.observe(document.body,{childList:!0,subtree:!0}))}function s(){!e||t.size||(e=!1,n.disconnect())}function a(){return new Promise(function(i){(requestIdleCallback||requestAnimationFrame)(i)})}async function p(i,u){t.size>30&&await a();let f=[];if(!(i instanceof Node))return f;for(let d of t.keys())d===i||!(d instanceof Node)||u(d)||i.contains(d)&&f.push(d);return f}function h(i,u){let f=!1;for(let d of i){if(u&&p(d,R=>!R.isConnectedd).then(h),!t.has(d))continue;let E=t.get(d);E.length_c&&(d.dispatchEvent(new Event("dde:connected")),E.connected=new WeakSet,E.length_c=0,E.length_d||t.delete(d),f=!0)}return f}function l(i,u){let f=!1;for(let d of i)u&&p(d,R=>R.isConnectedd).then(l),!(!t.has(d)||!t.get(d).length_d)&&(d.dispatchEvent(new Event("dde:disconnected")),t.delete(d),f=!0);return f}}export{x as assign,M as assignAttribute,H as chainableAppend,Z as classListDeclarative,D as createElement,it as createElementNS,pt as customElementRender,lt as customElementWithDDE,gt as dispatchEvent,D as el,it as elNS,G as elementAttribute,ut as empty,lt as lifecycleToEvents,Q as observedAttributes,A as on,F as registerReactivity,g as scope,st as simulateSlots};
diff --git a/examples/components/todosComponent.js b/examples/components/todosComponent.js
index 55b1e86..230461f 100644
--- a/examples/components/todosComponent.js
+++ b/examples/components/todosComponent.js
@@ -16,7 +16,7 @@ const className= style.host(todosComponent).css`
`;
/** @param {{ todos: string[] }} */
export function todosComponent({ todos= [ "Task A" ] }= {}){
- const todosS= O(todos.map(t=> O(t)), {
+ const todosO= O(todos.map(t=> O(t)), {
add(v){ this.value.push(O(v)); },
remove(i){ O.clear(this.value.splice(i, 1)[0]); }
});
@@ -25,24 +25,31 @@ export function todosComponent({ todos= [ "Task A" ] }= {}){
const onsubmitAdd= on("submit", event=> {
const el= event.target.elements[name];
event.preventDefault();
- O.action(todosS, "add", el.value);
+ O.action(todosO, "add", el.value);
el.value= "";
});
const onremove= on("remove", event=>
- O.action(todosS, "remove", event.detail));
+ O.action(todosO, "remove", event.detail));
- const ul_todos= el("ul").append(
- O.el(todosS, ts=> ts
+ const ul_todos_version= 1; // ul_todos_v1/ul_todos_v2
+ const ul_todos_v1= el("ul").append(
+ O.el(todosO, ts=> ts
.map((textContent, value)=>
el(todoComponent, { textContent, value, className }, onremove))
));
+ const ul_todos_v2= (ts)=> el("ul").append(
+ ...ts.map((textContent, value)=>
+ el(todoComponent, { textContent, value, className }, onremove))
+ );
+
return el("div", { className }).append(
el("div").append(
el("h2", "Todos:"),
el("h3", "List of todos:"),
- O.el(todosS, ts=> !ts.length
+ O.el(todosO, ts=> !ts.length
? el("p", "No todos yet")
- : ul_todos),
+ : ( (ul_todos_version-1) ? ul_todos_v1 : ul_todos_v2(ts) )
+ ),
el("p", "Click to the text to edit it.")
),
el("form", null, onsubmitAdd).append(
@@ -54,12 +61,12 @@ export function todosComponent({ todos= [ "Task A" ] }= {}){
),
el("div").append(
el("h3", "Output (JSON):"),
- el("output", O(()=> JSON.stringify(todosS, null, "\t")))
+ el("output", O(()=> JSON.stringify(todosO, null, "\t")))
)
)
}
/**
- * @dispatch {number} remove
+ * @dispatchs {number} remove
* */
function todoComponent({ textContent, value }){
const { host }= scope;
diff --git a/package-lock.json b/package-lock.json
index 01a315c..e4d338b 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "deka-dom-el",
- "version": "0.7.3",
+ "version": "0.7.7",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "deka-dom-el",
- "version": "0.7.3",
+ "version": "0.7.7",
"license": "MIT",
"devDependencies": {
"@size-limit/preset-small-lib": "^11.0.1",
@@ -21,10 +21,26 @@
"node": ">=18"
}
},
+ "node_modules/@esbuild/aix-ppc64": {
+ "version": "0.19.11",
+ "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.19.11.tgz",
+ "integrity": "sha512-FnzU0LyE3ySQk7UntJO4+qIiQgI7KoODnZg5xzXIrFJlKd2P2gwHsHY4927xj9y5PJmJSzULiUCWmv7iWnNa7g==",
+ "cpu": [
+ "ppc64"
+ ],
+ "dev": true,
+ "optional": true,
+ "os": [
+ "aix"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
"node_modules/@esbuild/android-arm": {
- "version": "0.19.9",
- "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.9.tgz",
- "integrity": "sha512-jkYjjq7SdsWuNI6b5quymW0oC83NN5FdRPuCbs9HZ02mfVdAP8B8eeqLSYU3gb6OJEaY5CQabtTFbqBf26H3GA==",
+ "version": "0.19.11",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.11.tgz",
+ "integrity": "sha512-5OVapq0ClabvKvQ58Bws8+wkLCV+Rxg7tUVbo9xu034Nm536QTII4YzhaFriQ7rMrorfnFKUsArD2lqKbFY4vw==",
"cpu": [
"arm"
],
@@ -38,9 +54,9 @@
}
},
"node_modules/@esbuild/android-arm64": {
- "version": "0.19.9",
- "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.19.9.tgz",
- "integrity": "sha512-q4cR+6ZD0938R19MyEW3jEsMzbb/1rulLXiNAJQADD/XYp7pT+rOS5JGxvpRW8dFDEfjW4wLgC/3FXIw4zYglQ==",
+ "version": "0.19.11",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.19.11.tgz",
+ "integrity": "sha512-aiu7K/5JnLj//KOnOfEZ0D90obUkRzDMyqd/wNAUQ34m4YUPVhRZpnqKV9uqDGxT7cToSDnIHsGooyIczu9T+Q==",
"cpu": [
"arm64"
],
@@ -54,9 +70,9 @@
}
},
"node_modules/@esbuild/android-x64": {
- "version": "0.19.9",
- "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.19.9.tgz",
- "integrity": "sha512-KOqoPntWAH6ZxDwx1D6mRntIgZh9KodzgNOy5Ebt9ghzffOk9X2c1sPwtM9P+0eXbefnDhqYfkh5PLP5ULtWFA==",
+ "version": "0.19.11",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.19.11.tgz",
+ "integrity": "sha512-eccxjlfGw43WYoY9QgB82SgGgDbibcqyDTlk3l3C0jOVHKxrjdc9CTwDUQd0vkvYg5um0OH+GpxYvp39r+IPOg==",
"cpu": [
"x64"
],
@@ -70,9 +86,9 @@
}
},
"node_modules/@esbuild/darwin-arm64": {
- "version": "0.19.9",
- "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.19.9.tgz",
- "integrity": "sha512-KBJ9S0AFyLVx2E5D8W0vExqRW01WqRtczUZ8NRu+Pi+87opZn5tL4Y0xT0mA4FtHctd0ZgwNoN639fUUGlNIWw==",
+ "version": "0.19.11",
+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.19.11.tgz",
+ "integrity": "sha512-ETp87DRWuSt9KdDVkqSoKoLFHYTrkyz2+65fj9nfXsaV3bMhTCjtQfw3y+um88vGRKRiF7erPrh/ZuIdLUIVxQ==",
"cpu": [
"arm64"
],
@@ -86,9 +102,9 @@
}
},
"node_modules/@esbuild/darwin-x64": {
- "version": "0.19.9",
- "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.19.9.tgz",
- "integrity": "sha512-vE0VotmNTQaTdX0Q9dOHmMTao6ObjyPm58CHZr1UK7qpNleQyxlFlNCaHsHx6Uqv86VgPmR4o2wdNq3dP1qyDQ==",
+ "version": "0.19.11",
+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.19.11.tgz",
+ "integrity": "sha512-fkFUiS6IUK9WYUO/+22omwetaSNl5/A8giXvQlcinLIjVkxwTLSktbF5f/kJMftM2MJp9+fXqZ5ezS7+SALp4g==",
"cpu": [
"x64"
],
@@ -102,9 +118,9 @@
}
},
"node_modules/@esbuild/freebsd-arm64": {
- "version": "0.19.9",
- "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.9.tgz",
- "integrity": "sha512-uFQyd/o1IjiEk3rUHSwUKkqZwqdvuD8GevWF065eqgYfexcVkxh+IJgwTaGZVu59XczZGcN/YMh9uF1fWD8j1g==",
+ "version": "0.19.11",
+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.11.tgz",
+ "integrity": "sha512-lhoSp5K6bxKRNdXUtHoNc5HhbXVCS8V0iZmDvyWvYq9S5WSfTIHU2UGjcGt7UeS6iEYp9eeymIl5mJBn0yiuxA==",
"cpu": [
"arm64"
],
@@ -118,9 +134,9 @@
}
},
"node_modules/@esbuild/freebsd-x64": {
- "version": "0.19.9",
- "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.19.9.tgz",
- "integrity": "sha512-WMLgWAtkdTbTu1AWacY7uoj/YtHthgqrqhf1OaEWnZb7PQgpt8eaA/F3LkV0E6K/Lc0cUr/uaVP/49iE4M4asA==",
+ "version": "0.19.11",
+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.19.11.tgz",
+ "integrity": "sha512-JkUqn44AffGXitVI6/AbQdoYAq0TEullFdqcMY/PCUZ36xJ9ZJRtQabzMA+Vi7r78+25ZIBosLTOKnUXBSi1Kw==",
"cpu": [
"x64"
],
@@ -134,9 +150,9 @@
}
},
"node_modules/@esbuild/linux-arm": {
- "version": "0.19.9",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.19.9.tgz",
- "integrity": "sha512-C/ChPohUYoyUaqn1h17m/6yt6OB14hbXvT8EgM1ZWaiiTYz7nWZR0SYmMnB5BzQA4GXl3BgBO1l8MYqL/He3qw==",
+ "version": "0.19.11",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.19.11.tgz",
+ "integrity": "sha512-3CRkr9+vCV2XJbjwgzjPtO8T0SZUmRZla+UL1jw+XqHZPkPgZiyWvbDvl9rqAN8Zl7qJF0O/9ycMtjU67HN9/Q==",
"cpu": [
"arm"
],
@@ -150,9 +166,9 @@
}
},
"node_modules/@esbuild/linux-arm64": {
- "version": "0.19.9",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.19.9.tgz",
- "integrity": "sha512-PiPblfe1BjK7WDAKR1Cr9O7VVPqVNpwFcPWgfn4xu0eMemzRp442hXyzF/fSwgrufI66FpHOEJk0yYdPInsmyQ==",
+ "version": "0.19.11",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.19.11.tgz",
+ "integrity": "sha512-LneLg3ypEeveBSMuoa0kwMpCGmpu8XQUh+mL8XXwoYZ6Be2qBnVtcDI5azSvh7vioMDhoJFZzp9GWp9IWpYoUg==",
"cpu": [
"arm64"
],
@@ -166,9 +182,9 @@
}
},
"node_modules/@esbuild/linux-ia32": {
- "version": "0.19.9",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.19.9.tgz",
- "integrity": "sha512-f37i/0zE0MjDxijkPSQw1CO/7C27Eojqb+r3BbHVxMLkj8GCa78TrBZzvPyA/FNLUMzP3eyHCVkAopkKVja+6Q==",
+ "version": "0.19.11",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.19.11.tgz",
+ "integrity": "sha512-caHy++CsD8Bgq2V5CodbJjFPEiDPq8JJmBdeyZ8GWVQMjRD0sU548nNdwPNvKjVpamYYVL40AORekgfIubwHoA==",
"cpu": [
"ia32"
],
@@ -182,9 +198,9 @@
}
},
"node_modules/@esbuild/linux-loong64": {
- "version": "0.19.9",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.19.9.tgz",
- "integrity": "sha512-t6mN147pUIf3t6wUt3FeumoOTPfmv9Cc6DQlsVBpB7eCpLOqQDyWBP1ymXn1lDw4fNUSb/gBcKAmvTP49oIkaA==",
+ "version": "0.19.11",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.19.11.tgz",
+ "integrity": "sha512-ppZSSLVpPrwHccvC6nQVZaSHlFsvCQyjnvirnVjbKSHuE5N24Yl8F3UwYUUR1UEPaFObGD2tSvVKbvR+uT1Nrg==",
"cpu": [
"loong64"
],
@@ -198,9 +214,9 @@
}
},
"node_modules/@esbuild/linux-mips64el": {
- "version": "0.19.9",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.19.9.tgz",
- "integrity": "sha512-jg9fujJTNTQBuDXdmAg1eeJUL4Jds7BklOTkkH80ZgQIoCTdQrDaHYgbFZyeTq8zbY+axgptncko3v9p5hLZtw==",
+ "version": "0.19.11",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.19.11.tgz",
+ "integrity": "sha512-B5x9j0OgjG+v1dF2DkH34lr+7Gmv0kzX6/V0afF41FkPMMqaQ77pH7CrhWeR22aEeHKaeZVtZ6yFwlxOKPVFyg==",
"cpu": [
"mips64el"
],
@@ -214,9 +230,9 @@
}
},
"node_modules/@esbuild/linux-ppc64": {
- "version": "0.19.9",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.19.9.tgz",
- "integrity": "sha512-tkV0xUX0pUUgY4ha7z5BbDS85uI7ABw3V1d0RNTii7E9lbmV8Z37Pup2tsLV46SQWzjOeyDi1Q7Wx2+QM8WaCQ==",
+ "version": "0.19.11",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.19.11.tgz",
+ "integrity": "sha512-MHrZYLeCG8vXblMetWyttkdVRjQlQUb/oMgBNurVEnhj4YWOr4G5lmBfZjHYQHHN0g6yDmCAQRR8MUHldvvRDA==",
"cpu": [
"ppc64"
],
@@ -230,9 +246,9 @@
}
},
"node_modules/@esbuild/linux-riscv64": {
- "version": "0.19.9",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.19.9.tgz",
- "integrity": "sha512-DfLp8dj91cufgPZDXr9p3FoR++m3ZJ6uIXsXrIvJdOjXVREtXuQCjfMfvmc3LScAVmLjcfloyVtpn43D56JFHg==",
+ "version": "0.19.11",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.19.11.tgz",
+ "integrity": "sha512-f3DY++t94uVg141dozDu4CCUkYW+09rWtaWfnb3bqe4w5NqmZd6nPVBm+qbz7WaHZCoqXqHz5p6CM6qv3qnSSQ==",
"cpu": [
"riscv64"
],
@@ -246,9 +262,9 @@
}
},
"node_modules/@esbuild/linux-s390x": {
- "version": "0.19.9",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.19.9.tgz",
- "integrity": "sha512-zHbglfEdC88KMgCWpOl/zc6dDYJvWGLiUtmPRsr1OgCViu3z5GncvNVdf+6/56O2Ca8jUU+t1BW261V6kp8qdw==",
+ "version": "0.19.11",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.19.11.tgz",
+ "integrity": "sha512-A5xdUoyWJHMMlcSMcPGVLzYzpcY8QP1RtYzX5/bS4dvjBGVxdhuiYyFwp7z74ocV7WDc0n1harxmpq2ePOjI0Q==",
"cpu": [
"s390x"
],
@@ -262,9 +278,9 @@
}
},
"node_modules/@esbuild/linux-x64": {
- "version": "0.19.9",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.19.9.tgz",
- "integrity": "sha512-JUjpystGFFmNrEHQnIVG8hKwvA2DN5o7RqiO1CVX8EN/F/gkCjkUMgVn6hzScpwnJtl2mPR6I9XV1oW8k9O+0A==",
+ "version": "0.19.11",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.19.11.tgz",
+ "integrity": "sha512-grbyMlVCvJSfxFQUndw5mCtWs5LO1gUlwP4CDi4iJBbVpZcqLVT29FxgGuBJGSzyOxotFG4LoO5X+M1350zmPA==",
"cpu": [
"x64"
],
@@ -278,9 +294,9 @@
}
},
"node_modules/@esbuild/netbsd-x64": {
- "version": "0.19.9",
- "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.19.9.tgz",
- "integrity": "sha512-GThgZPAwOBOsheA2RUlW5UeroRfESwMq/guy8uEe3wJlAOjpOXuSevLRd70NZ37ZrpO6RHGHgEHvPg1h3S1Jug==",
+ "version": "0.19.11",
+ "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.19.11.tgz",
+ "integrity": "sha512-13jvrQZJc3P230OhU8xgwUnDeuC/9egsjTkXN49b3GcS5BKvJqZn86aGM8W9pd14Kd+u7HuFBMVtrNGhh6fHEQ==",
"cpu": [
"x64"
],
@@ -294,9 +310,9 @@
}
},
"node_modules/@esbuild/openbsd-x64": {
- "version": "0.19.9",
- "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.19.9.tgz",
- "integrity": "sha512-Ki6PlzppaFVbLnD8PtlVQfsYw4S9n3eQl87cqgeIw+O3sRr9IghpfSKY62mggdt1yCSZ8QWvTZ9jo9fjDSg9uw==",
+ "version": "0.19.11",
+ "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.19.11.tgz",
+ "integrity": "sha512-ysyOGZuTp6SNKPE11INDUeFVVQFrhcNDVUgSQVDzqsqX38DjhPEPATpid04LCoUr2WXhQTEZ8ct/EgJCUDpyNw==",
"cpu": [
"x64"
],
@@ -310,9 +326,9 @@
}
},
"node_modules/@esbuild/sunos-x64": {
- "version": "0.19.9",
- "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.19.9.tgz",
- "integrity": "sha512-MLHj7k9hWh4y1ddkBpvRj2b9NCBhfgBt3VpWbHQnXRedVun/hC7sIyTGDGTfsGuXo4ebik2+3ShjcPbhtFwWDw==",
+ "version": "0.19.11",
+ "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.19.11.tgz",
+ "integrity": "sha512-Hf+Sad9nVwvtxy4DXCZQqLpgmRTQqyFyhT3bZ4F2XlJCjxGmRFF0Shwn9rzhOYRB61w9VMXUkxlBy56dk9JJiQ==",
"cpu": [
"x64"
],
@@ -326,9 +342,9 @@
}
},
"node_modules/@esbuild/win32-arm64": {
- "version": "0.19.9",
- "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.19.9.tgz",
- "integrity": "sha512-GQoa6OrQ8G08guMFgeXPH7yE/8Dt0IfOGWJSfSH4uafwdC7rWwrfE6P9N8AtPGIjUzdo2+7bN8Xo3qC578olhg==",
+ "version": "0.19.11",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.19.11.tgz",
+ "integrity": "sha512-0P58Sbi0LctOMOQbpEOvOL44Ne0sqbS0XWHMvvrg6NE5jQ1xguCSSw9jQeUk2lfrXYsKDdOe6K+oZiwKPilYPQ==",
"cpu": [
"arm64"
],
@@ -342,9 +358,9 @@
}
},
"node_modules/@esbuild/win32-ia32": {
- "version": "0.19.9",
- "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.19.9.tgz",
- "integrity": "sha512-UOozV7Ntykvr5tSOlGCrqU3NBr3d8JqPes0QWN2WOXfvkWVGRajC+Ym0/Wj88fUgecUCLDdJPDF0Nna2UK3Qtg==",
+ "version": "0.19.11",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.19.11.tgz",
+ "integrity": "sha512-6YOrWS+sDJDmshdBIQU+Uoyh7pQKrdykdefC1avn76ss5c+RN6gut3LZA4E2cH5xUEp5/cA0+YxRaVtRAb0xBg==",
"cpu": [
"ia32"
],
@@ -358,9 +374,9 @@
}
},
"node_modules/@esbuild/win32-x64": {
- "version": "0.19.9",
- "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.19.9.tgz",
- "integrity": "sha512-oxoQgglOP7RH6iasDrhY+R/3cHrfwIDvRlT4CGChflq6twk8iENeVvMJjmvBb94Ik1Z+93iGO27err7w6l54GQ==",
+ "version": "0.19.11",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.19.11.tgz",
+ "integrity": "sha512-vfkhltrjCAb603XaFhqhAF4LGDi2M4OrCRrFusyQ+iTLQ/o60QQXxc9cZC/FFpihBI9N1Grn6SMKVJ4KP7Fuiw==",
"cpu": [
"x64"
],
@@ -485,9 +501,9 @@
"dev": true
},
"node_modules/@types/node": {
- "version": "20.10.4",
- "resolved": "https://registry.npmjs.org/@types/node/-/node-20.10.4.tgz",
- "integrity": "sha512-D08YG6rr8X90YB56tSIuBaddy/UXAA9RKJoFvrsnogAum/0pmjkgi4+2nx96A330FmioegBWmEYQ+syqCFaveg==",
+ "version": "20.10.6",
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-20.10.6.tgz",
+ "integrity": "sha512-Vac8H+NlRNNlAmDfGUP7b5h/KA+AtWIzuXy0E6OyP8f1tCLYAtPvKRRDJjAPqhpCb0t6U2j7/xqAuLEebW2kiw==",
"dev": true,
"dependencies": {
"undici-types": "~5.26.4"
@@ -756,15 +772,15 @@
}
},
"node_modules/cssstyle": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-3.0.0.tgz",
- "integrity": "sha512-N4u2ABATi3Qplzf0hWbVCdjenim8F3ojEXpBDF5hBpjzW182MjNGLqfmQ0SkSPeQ+V86ZXgeH8aXj6kayd4jgg==",
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-4.0.1.tgz",
+ "integrity": "sha512-8ZYiJ3A/3OkDd093CBT/0UKDWry7ak4BdPTFP2+QEP7cmhouyq/Up709ASSj2cK02BbZiMgk7kYjZNS4QP5qrQ==",
"dev": true,
"dependencies": {
"rrweb-cssom": "^0.6.0"
},
"engines": {
- "node": ">=14"
+ "node": ">=18"
}
},
"node_modules/data-uri-to-buffer": {
@@ -905,9 +921,9 @@
"dev": true
},
"node_modules/esbuild": {
- "version": "0.19.9",
- "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.19.9.tgz",
- "integrity": "sha512-U9CHtKSy+EpPsEBa+/A2gMs/h3ylBC0H0KSqIg7tpztHerLi6nrrcoUJAkNCEPumx8yJ+Byic4BVwHgRbN0TBg==",
+ "version": "0.19.11",
+ "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.19.11.tgz",
+ "integrity": "sha512-HJ96Hev2hX/6i5cDVwcqiJBBtuo9+FeIJOtZ9W1kA5M6AMJRHUZlpYZ1/SbEwtO0ioNAW8rUooVpC/WehY2SfA==",
"dev": true,
"hasInstallScript": true,
"bin": {
@@ -917,28 +933,29 @@
"node": ">=12"
},
"optionalDependencies": {
- "@esbuild/android-arm": "0.19.9",
- "@esbuild/android-arm64": "0.19.9",
- "@esbuild/android-x64": "0.19.9",
- "@esbuild/darwin-arm64": "0.19.9",
- "@esbuild/darwin-x64": "0.19.9",
- "@esbuild/freebsd-arm64": "0.19.9",
- "@esbuild/freebsd-x64": "0.19.9",
- "@esbuild/linux-arm": "0.19.9",
- "@esbuild/linux-arm64": "0.19.9",
- "@esbuild/linux-ia32": "0.19.9",
- "@esbuild/linux-loong64": "0.19.9",
- "@esbuild/linux-mips64el": "0.19.9",
- "@esbuild/linux-ppc64": "0.19.9",
- "@esbuild/linux-riscv64": "0.19.9",
- "@esbuild/linux-s390x": "0.19.9",
- "@esbuild/linux-x64": "0.19.9",
- "@esbuild/netbsd-x64": "0.19.9",
- "@esbuild/openbsd-x64": "0.19.9",
- "@esbuild/sunos-x64": "0.19.9",
- "@esbuild/win32-arm64": "0.19.9",
- "@esbuild/win32-ia32": "0.19.9",
- "@esbuild/win32-x64": "0.19.9"
+ "@esbuild/aix-ppc64": "0.19.11",
+ "@esbuild/android-arm": "0.19.11",
+ "@esbuild/android-arm64": "0.19.11",
+ "@esbuild/android-x64": "0.19.11",
+ "@esbuild/darwin-arm64": "0.19.11",
+ "@esbuild/darwin-x64": "0.19.11",
+ "@esbuild/freebsd-arm64": "0.19.11",
+ "@esbuild/freebsd-x64": "0.19.11",
+ "@esbuild/linux-arm": "0.19.11",
+ "@esbuild/linux-arm64": "0.19.11",
+ "@esbuild/linux-ia32": "0.19.11",
+ "@esbuild/linux-loong64": "0.19.11",
+ "@esbuild/linux-mips64el": "0.19.11",
+ "@esbuild/linux-ppc64": "0.19.11",
+ "@esbuild/linux-riscv64": "0.19.11",
+ "@esbuild/linux-s390x": "0.19.11",
+ "@esbuild/linux-x64": "0.19.11",
+ "@esbuild/netbsd-x64": "0.19.11",
+ "@esbuild/openbsd-x64": "0.19.11",
+ "@esbuild/sunos-x64": "0.19.11",
+ "@esbuild/win32-arm64": "0.19.11",
+ "@esbuild/win32-ia32": "0.19.11",
+ "@esbuild/win32-x64": "0.19.11"
}
},
"node_modules/event-target-shim": {
@@ -976,9 +993,9 @@
}
},
"node_modules/fastq": {
- "version": "1.15.0",
- "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz",
- "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==",
+ "version": "1.16.0",
+ "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.16.0.tgz",
+ "integrity": "sha512-ifCoaXsDrsdkWTtiNJX5uzHDsrck5TzfKKDcuFFTIrrc/BS076qgEIfoIy1VeZqViznfKiysPYTh/QeHtnIsYA==",
"dev": true,
"dependencies": {
"reusify": "^1.0.4"
@@ -1329,12 +1346,12 @@
"dev": true
},
"node_modules/jsdom": {
- "version": "23.0.1",
- "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-23.0.1.tgz",
- "integrity": "sha512-2i27vgvlUsGEBO9+/kJQRbtqtm+191b5zAZrU/UezVmnC2dlDAFLgDYJvAEi94T4kjsRKkezEtLQTgsNEsW2lQ==",
+ "version": "23.1.0",
+ "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-23.1.0.tgz",
+ "integrity": "sha512-wRscu8dBFxi7O65Cvi0jFRDv0Qa7XEHPix8Qg/vlXHLAMQsRWV1EDeQHBermzXf4Dt7JtFgBLbva3iTcBZDXEQ==",
"dev": true,
"dependencies": {
- "cssstyle": "^3.0.0",
+ "cssstyle": "^4.0.1",
"data-urls": "^5.0.0",
"decimal.js": "^10.4.3",
"form-data": "^4.0.0",
@@ -1353,7 +1370,7 @@
"whatwg-encoding": "^3.1.1",
"whatwg-mimetype": "^4.0.0",
"whatwg-url": "^14.0.0",
- "ws": "^8.14.2",
+ "ws": "^8.16.0",
"xml-name-validator": "^5.0.0"
},
"engines": {
@@ -2156,9 +2173,9 @@
}
},
"node_modules/web-streams-polyfill": {
- "version": "3.2.1",
- "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.2.1.tgz",
- "integrity": "sha512-e0MO3wdXWKrLbL0DgGnUV7WHVuw9OUvL4hjgnPkIeEvESk74gAITi5G606JtZPp39cd8HA9VQzCIvA49LpPN5Q==",
+ "version": "3.3.2",
+ "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.3.2.tgz",
+ "integrity": "sha512-3pRGuxRF5gpuZc0W+EpwQRmCD7gRqcDOMt688KmdlDAgAyaB1XlN0zq2njfDNm44XVdIouE7pZ6GzbdyH47uIQ==",
"dev": true,
"engines": {
"node": ">= 8"
@@ -2231,9 +2248,9 @@
"dev": true
},
"node_modules/ws": {
- "version": "8.15.1",
- "resolved": "https://registry.npmjs.org/ws/-/ws-8.15.1.tgz",
- "integrity": "sha512-W5OZiCjXEmk0yZ66ZN82beM5Sz7l7coYxpRkzS+p9PP+ToQry8szKh+61eNktr7EA9DOwvFGhfC605jDHbP6QQ==",
+ "version": "8.16.0",
+ "resolved": "https://registry.npmjs.org/ws/-/ws-8.16.0.tgz",
+ "integrity": "sha512-HS0c//TP7Ina87TfiPUz1rQzMhHrl/SG2guqRcTOIUYD2q8uhUdNHZYJUaQ8aTGPzCh+c6oawMKW35nFl1dxyQ==",
"dev": true,
"engines": {
"node": ">=10.0.0"
diff --git a/package.json b/package.json
index 13a1bd1..197408d 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "deka-dom-el",
- "version": "0.7.6",
+ "version": "0.7.7",
"description": "A low-code library that simplifies the creation of native DOM elements/components using small wrappers and tweaks.",
"author": "Jan Andrle ",
"license": "MIT",
@@ -59,7 +59,7 @@
"size-limit": [
{
"path": "./index.js",
- "limit": "9.85 kB",
+ "limit": "9.9 kB",
"gzip": false,
"brotli": false
diff --git a/src/events.js b/src/events.js
index 537bf65..45fb47a 100644
--- a/src/events.js
+++ b/src/events.js
@@ -166,13 +166,13 @@ function connectionsChangesObserverConstructor(){
function requestIdle(){ return new Promise(function(resolve){
(requestIdleCallback || requestAnimationFrame)(resolve);
}); }
- async function collectChildren(element){
+ async function collectChildren(element, filter){
if(store.size > 30)//TODO limit?
await requestIdle();
const out= [];
if(!(element instanceof Node)) return out;
for(const el of store.keys()){
- if(el===element || !(el instanceof Node)) continue;
+ if(el===element || !(el instanceof Node) || filter(el)) continue;
if(element.contains(el))
out.push(el);
}
@@ -181,7 +181,7 @@ function connectionsChangesObserverConstructor(){
function observerAdded(addedNodes, is_root){
let out= false;
for(const element of addedNodes){
- if(is_root) collectChildren(element).then(observerAdded);
+ if(is_root) collectChildren(element, el=> !el.isConnectedd).then(observerAdded);
if(!store.has(element)) continue;
const ls= store.get(element);
@@ -198,7 +198,7 @@ function connectionsChangesObserverConstructor(){
function observerRemoved(removedNodes, is_root){
let out= false;
for(const element of removedNodes){
- if(is_root) collectChildren(element).then(observerRemoved);
+ if(is_root) collectChildren(element, el=> el.isConnectedd).then(observerRemoved);
if(!store.has(element)) continue;
const ls= store.get(element);
diff --git a/src/observables-lib.js b/src/observables-lib.js
index ae40c49..e2e141d 100644
--- a/src/observables-lib.js
+++ b/src/observables-lib.js
@@ -249,7 +249,7 @@ function removeObservableListener(o, listener, clear_when_empty){
if(!s) return;
const out= s.listeners.delete(listener);
if(clear_when_empty && !s.listeners.size){
- o.clear(o);
+ observable.clear(o);
if(!deps.has(s)) return out;
const c= deps.get(s);
if(!deps.has(c)) return out;