@tltdsh/mx 1.0.9 → 1.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/mx.mjs +1 -1
  2. package/package.json +1 -1
package/mx.mjs CHANGED
@@ -1,3 +1,3 @@
1
1
  var mx, dom, define, components;
2
- !function(d,i,o){o=components={},define=(d,i={})=>{if(i.$){let d=i.$;i.$=function(i){let o=d.call(this,l(this.$state||={},i));return o._?this.render(o):this.render(...o)}}o[d=d.toLowerCase()]=i};let l=Object.assign,m={value:1,checked:1,selected:1},g="http://www.w3.org/2000/svg",s=(i,m)=>{if("svg"==i|m)return d.createElementNS(g,i);let s=d.createElement(i),e=o[i];return e&&l(s,e),s};i.$attrs=function(d,i,o){for(i in d)o=d[i],i[0]=="."?this[i.slice(1)]=o:o?.call?this[i]=o:!(o==null|!1===o)?this.setAttribute(i,o==!0?"":o):this.removeAttribute(i);return this},i.render=function(...l){let i=this,d=i.firstChild,o=g==i.namespaceURI;for(let g of l){let f,e,n;if(g==null|!1===g)continue;if(g._)[e,f,n]=g;else if(g.nodeType){d!=g&&(d?d.replaceWith(g):i.append(g)),d=g.nextSibling;continue}if(d)!e?d.localName?d.replaceWith(d=new Text(g)):d.nodeValue!=""+g&&(d.nodeValue=""+g):e!=d.localName&&d.replaceWith(d=s(e,o));else if(e)i.append(d=s(e,o));else{i.append(g);continue}if(e){let i=f;if(d.$)d._$=0;else{let o=d._$||={},s=o.__||={},l=o._=-~o._;for(let s in o){if(s[0]=="_")continue;(!i||!(s in f))&&("."!=s[0]&&(d.removeAttribute(s),m[s]&&(d[s]="")),delete o[s])}if(i)for(let i in f){let g=f[i];if(g==o[i]){g?.call||m[i]?s[i]=l:i[0]=="."&&(s[i.slice(1)]=l);continue}i[0]=="."?(d[i.slice(1)]=g,s[i.slice(1)]=l,o[i]=g):g!=null&g!==!1?(g?.call?(d[i]=g,s[i]=l):(d.setAttribute(i,g),m[i]&&(d[i]=g,s[i]=l)),o[i]=g):(d.removeAttribute(i),m[i]&&(d[i]=""),delete o[i])}for(let i in s)l!=s[i]&&(d[i]=null,delete s[i])}d.$?d.$.call(d,f):d.render(...n)}d=d.nextSibling}for(;d;){let i=d.nextSibling;d.remove(),d=i}return this};let n={},e=d=>new Proxy(d,{get:(i,o)=>d.bind(0,o)}),f=d=>n[d]||=d.replace(/[A-Z]/g,"-$&").toLowerCase();mx=e((d,i,...o)=>{d=f(d);let m=i?.constructor==Object&&!i.nodeType?[d,i,o]:[d,null,[i,...o]];return m._=1,m}),dom=e((d,i,...o)=>{let m=s(f(d));if(i?.constructor==Object&&!i.nodeType){if(m.$)return m.$(i);m.$attrs(i)}else o=[i,...o];return m.render(...o),m})}(document,Element.prototype)
2
+ !function(d,i,o){o=components={},define=(d,i={})=>{if(i.$){let d=i.$;i.$=function(i){let o=d.call(this,l(this.$state||={},i));return o._?this.render(o):this.render(...o)}}o[d=d.toLowerCase()]=i};let l=Object.assign,m={value:1,checked:1,selected:1},g="http://www.w3.org/2000/svg",s=(i,m)=>{if("svg"==i|m)return d.createElementNS(g,i);let s=d.createElement(i),e=o[i];return e&&l(s,e),s};i.$attrs=function(d,i,o){for(i in d)o=d[i],i[0]=="."?this[i.slice(1)]=o:o?.call?this[i]=o:!(o==null|!1===o)?this.setAttribute(i,o==!0?"":o):this.removeAttribute(i);return this},i.render=function(...l){let i=this,d=i.firstChild,o=g==i.namespaceURI;for(let g of l){let f,e,n;if(g==null|!1===g)continue;if(g._)[e,f,n]=g;else if(g.nodeType){d!=g&&(d?d.replaceWith(g):i.append(g)),d=g.nextSibling;continue}if(d)!e?d.localName?d.replaceWith(d=new Text(g)):d.nodeValue!=""+g&&(d.nodeValue=""+g):e!=d.localName&&d.replaceWith(d=s(e,o));else if(e)i.append(d=s(e,o));else{i.append(g);continue}if(e){let i=f;if(d.$)d._$=0;else{let o=d._$||={},s=o.__||={},l=o._=-~o._;for(let s in o){if(s[0]=="_")continue;(!i||!(s in f))&&("."!=s[0]&&(d.removeAttribute(s),m[s]&&(d[s]="")),delete o[s])}if(i)for(let i in f){let g=f[i];if(g==o[i]){g?.call||m[i]?s[i]=l:i[0]=="."&&(s[i.slice(1)]=l);continue}i[0]=="."?(d[i.slice(1)]=g,s[i.slice(1)]=l,o[i]=g):g!=null&g!==!1?(g?.call?(d[i]=g,s[i]=l):(d.setAttribute(i,g),m[i]&&(d[i]=g,s[i]=l)),o[i]=g):(d.removeAttribute(i),m[i]&&(d[i]=""),delete o[i])}for(let i in s)l!=s[i]&&(d[i]=null,delete s[i])}d.$?d.$.call(d,f):d.render(...n)}d=d.nextSibling}for(;d;){let i=d.nextSibling;d.remove(),d=i}return this};let n={},e=d=>new Proxy(d,{get:(i,o)=>d.bind(0,o)}),f=d=>n[d]||=d.replace(/[A-Z]/g,"-$&").toLowerCase();mx=e((d,i,...o)=>{d=f(d);let m=i?.constructor==Object&&!i.nodeType?[d,i,o]:[d,null,[i,...o]];return m._=1,m}),dom=e((d,i,...o)=>{let m=s(f(d));if(i?.constructor==Object&&!i.nodeType){if(m.$)return m.$(i);m.$attrs(i)}else o=[i,...o];return m.render(...o),m})}(document,Element.prototype);
3
3
  export { mx, dom, define, components };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tltdsh/mx",
3
- "version": "1.0.9",
3
+ "version": "1.0.10",
4
4
  "description": "<1KB UI engine. Build big. Ship small, ship fast.",
5
5
  "license": "0BSD",
6
6
  "author": "tltdsh",