@tltdsh/mx 1.2.0 → 1.2.1

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.
package/README.md CHANGED
@@ -21,7 +21,7 @@ Sub-1KB reactive DOM reconciliation engine for building massive platforms and us
21
21
  ### Pinned version
22
22
 
23
23
  ```html
24
- <script src="https://cdn.jsdelivr.net/npm/@tltdsh/mx@1.2.0/mx.min.js"></script>
24
+ <script src="https://cdn.jsdelivr.net/npm/@tltdsh/mx@1.2.1/mx.min.js"></script>
25
25
  ```
26
26
 
27
27
  ### npm / yarn / bun
package/mx.d.ts CHANGED
@@ -95,6 +95,7 @@ interface MxHTMLAttrs {
95
95
  inputmode?: 'none' | 'text' | 'decimal' | 'numeric' | 'tel' | 'search' | 'email' | 'url';
96
96
  enterkeyhint?: 'enter' | 'done' | 'go' | 'next' | 'previous' | 'search' | 'send';
97
97
  autocapitalize?: 'off' | 'none' | 'on' | 'sentences' | 'words' | 'characters';
98
+ nonce?: string;
98
99
 
99
100
  // Popover
100
101
  popover?: 'auto' | 'manual' | boolean;
package/mx.min.js CHANGED
@@ -1 +1 @@
1
- !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)
1
+ !function(m,f,o){o=components={},define=(m,f={})=>{if(f.$){let m=f.$;f.$=function(f){let o=m.call(this,l(this.$state||={},f));return this.render(...o._?[o]:o)}}o[m.toLowerCase()]=f};let i={selected:1,checked:1,value:1},l=Object.assign,e="http://www.w3.org/2000/svg",n=(f,i)=>{if("svg"==f|i)return m.createElementNS(e,f);return l(m.createElement(f),o[f])};f.$attrs=function(m,f,o){for(f in m)o=m[f],f[0]=="."?this[f.slice(1)]=o:o?.call?this[f]=o:o!=null&!1!==o?this.setAttribute(f,!0===o?"":o):this.R(f);return this},f.render=function(...l){let f=this,m=f.firstChild,o=e==f.namespaceURI;for(let e of l){let d,g,h;if(e==null|!1===e)continue;if(e._)[g,d,h]=e;else if(e.nodeType){e!=m&&(m?m.replaceWith(e):f.append(e)),m=e.nextSibling;continue}if(m)!g?m.localName?m.replaceWith(m=new Text(e)):m.data!=e+""&&(m.data=e):g!=m.localName&&m.replaceWith(m=n(g,o));else if(g)f.append(m=n(g,o));else{f.append(e);continue}if(g){if(m.$)m._$=0,m.$(d);else{m.render(...h);let o=m._$||={},n=o.__||={},l=o._=-~o._;for(let f in o){if(f[0]=="_")continue;d&&f in d||((f[0]!="."?(i[f]&&(delete n[f],m[f]=""),m.R(f)):i[f.slice(1)]&&delete n[f.slice(1)]),delete o[f])}for(let f in d){let e=d[f];e===o[f]?f[0]=="."?(m[f.slice(1)]=e,n[f.slice(1)]=l):i[f]?(m[f]=e,n[f]=l):e?.call&&(n[f]=l):f[0]=="."?(m[f.slice(1)]=e,n[f.slice(1)]=l,o[f]=e):e!=null&!1!==e?(e.call?(m[f]=e,n[f]=l):(i[f]&&(m[f]=e,n[f]=l),m.setAttribute(f,e)),o[f]=e):(i[f]&&(delete n[f],m[f]=""),m.R(f),delete o[f])}for(let f in n)l-n[f]&&(m[f]=null,delete n[f])}}m=m.nextSibling}for(let f;m;m=f)f=m.nextSibling,m.remove();return this};let g=m=>new Proxy(m,{get:(f,o)=>m.bind(0,o)}),_={},d=m=>_[m]||=m.replace(/[A-Z]/g,"-$&").toLowerCase();mx=g((m,f,...o)=>{m=d(m);let i=f?.constructor==Object&!f?.nodeType?[m,f,o]:[m,null,[f,...o]];return i._=1,i}),dom=g((m,f,...o)=>{m=d(m);let i=n(m);f?.constructor==Object&!f?.nodeType?i.$?i.$(f):i.$attrs(f).render(...o):i.render(f,...o);return i}),f.R=f.removeAttribute}(document,Element.prototype)
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(m,f,o){o=components={},define=(m,f={})=>{if(f.$){let m=f.$;f.$=function(f){let o=m.call(this,l(this.$state||={},f));return this.render(...o._?[o]:o)}}o[m.toLowerCase()]=f};let i={selected:1,checked:1,value:1},l=Object.assign,e="http://www.w3.org/2000/svg",n=(f,i)=>{if("svg"==f|i)return m.createElementNS(e,f);return l(m.createElement(f),o[f])};f.$attrs=function(m,f,o){for(f in m)o=m[f],f[0]=="."?this[f.slice(1)]=o:o?.call?this[f]=o:o!=null&!1!==o?this.setAttribute(f,!0===o?"":o):this.R(f);return this},f.render=function(...l){let f=this,m=f.firstChild,o=e==f.namespaceURI;for(let e of l){let d,g,h;if(e==null|!1===e)continue;if(e._)[g,d,h]=e;else if(e.nodeType){e!=m&&(m?m.replaceWith(e):f.append(e)),m=e.nextSibling;continue}if(m)!g?m.localName?m.replaceWith(m=new Text(e)):m.data!=e+""&&(m.data=e):g!=m.localName&&m.replaceWith(m=n(g,o));else if(g)f.append(m=n(g,o));else{f.append(e);continue}if(g){if(m.$)m._$=0,m.$(d);else{m.render(...h);let o=m._$||={},n=o.__||={},l=o._=-~o._;for(let f in o){if(f[0]=="_")continue;d&&f in d||((f[0]!="."?(i[f]&&(delete n[f],m[f]=""),m.R(f)):i[f.slice(1)]&&delete n[f.slice(1)]),delete o[f])}for(let f in d){let e=d[f];e===o[f]?f[0]=="."?(m[f.slice(1)]=e,n[f.slice(1)]=l):i[f]?(m[f]=e,n[f]=l):e?.call&&(n[f]=l):f[0]=="."?(m[f.slice(1)]=e,n[f.slice(1)]=l,o[f]=e):e!=null&!1!==e?(e.call?(m[f]=e,n[f]=l):(i[f]&&(m[f]=e,n[f]=l),m.setAttribute(f,e)),o[f]=e):(i[f]&&(delete n[f],m[f]=""),m.R(f),delete o[f])}for(let f in n)l-n[f]&&(m[f]=null,delete n[f])}}m=m.nextSibling}for(let f;m;m=f)f=m.nextSibling,m.remove();return this};let g=m=>new Proxy(m,{get:(f,o)=>m.bind(0,o)}),_={},d=m=>_[m]||=m.replace(/[A-Z]/g,"-$&").toLowerCase();mx=g((m,f,...o)=>{m=d(m);let i=f?.constructor==Object&!f?.nodeType?[m,f,o]:[m,null,[f,...o]];return i._=1,i}),dom=g((m,f,...o)=>{m=d(m);let i=n(m);f?.constructor==Object&!f?.nodeType?i.$?i.$(f):i.$attrs(f).render(...o):i.render(f,...o);return i}),f.R=f.removeAttribute}(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.2.0",
3
+ "version": "1.2.1",
4
4
  "description": "<1KB UI engine. Build big. Ship small. Iterate fast.",
5
5
  "license": "0BSD",
6
6
  "author": "tltdsh",