Comparing version 5.1.62 to 5.2.0
@@ -1,2 +0,2 @@ | ||
var e,t,n,i={},r={},u="euid",d=[],o=[],a={},s={},c=["abort","blur","error","focus","load","mouseenter","mouseleave","resize","scroll","unload"],f=[];function l(e){var t;if(void 0!==e){if("function"==typeof e.element){var n=Object.assign({},e.attributes.props)||{};delete e.attributes.props,(e=e.element(n)).render&&(t=e.uuid,(e=new e.render).uuid=t)}else"function"==typeof e.render&&(t=e.uuid,(e=new e.render).uuid=t);if(e.children)for(var i=0;i<e.children.length;i++)e.children[i]=l(e.children[i]);return e}}function v(e){var t=typeof e;if("string"===t||"number"===t)return document.createTextNode(e);if("boolean"===t||"undefined"===t)return document.createTextNode("");var n,i=document.createElement(e.element);if(e.attributes&&"object"==typeof e.attributes)for(var r=0,u=Object.entries(e.attributes);r<u.length;r+=1){var d=u[r],o=d[0],a=d[1];"events"===o?(e.euid=m(),h(e.euid,a,i)):"style"===o?b(a,i):i.setAttribute(o,a)}if(p(e,"mounted"),e.children&&e.children.length)for(var s=0;s<e.children.length;s++)n=v(e.children[s]),i.appendChild(n);return i}function h(t,n,i){if(i){var r=Object.keys(n),s=r.length;if(s){var f;i.setAttribute("data-"+u,t),a[t]=n,function(t){for(var n=Object.keys(t),i=0;i<n.length;i++)c.includes(n[i])||d.push(n[i]);!function(){var t,n=function(e){if("#document"!==e.parentNode.nodeName){var t=e.getAttribute("data-"+u);return t||n(e.parentNode)}};for(;t=d.pop();)o.includes(t)||(o.push(t),e.addEventListener(t,function(e){var t=n(e.target);if(t&&a[t]){var i=a[t][e.type];i&&i(e)}}))}()}(n);for(var l=0;l<s;l++)c.includes(f=r[l])&&i.addEventListener(f,a[t][f])}}}function b(e,t){if(e&&"object"==typeof e)for(var n=0,i=Object.entries(e);n<i.length;n+=1){var r=i[n];t.style[r[0]]=r[1]}}function g(i){var r=l(t()),u=Object.assign({},n);return n=Object.assign({},r),function e(t,n,i,r){void 0===r&&(r=0);if(!t)return;var u=typeof n;var d=typeof i;var o=t.childNodes[r];if("undefined"===d)t.appendChild(v(n));else if("undefined"===u)j(i),t.removeChild(o);else if(!1!==i||!n.element&&"string"!==u&&"number"!==u)if(!1!==n||!i.element&&"string"!==d&&"number"!==d){if(function(e,t,n,i){return n!==i||("string"===n||"number"===n)&&e!==t||e.element!==t.element||e.uuid!==t.uuid}(n,i,u,d))j(i),t.replaceChild(v(n),o);else if(n.element){!function(e,t,n){for(var i,r,u,d=Object.keys(t.attributes),o=0;o<d.length;o++)r=t.attributes[u=d[o]],i=n.attributes?n.attributes[u]:void 0,"style"===u?(void 0,void 0,f=typeof(s=i),"object"===(c=typeof(a=r))&&"object"===f&&JSON.stringify(a)===JSON.stringify(s)||"undefined"===c&&"undefined"===f||(e.removeAttribute("style"),b(r,e))):"events"===u?(E(e,n.euid),O(n.euid),t.euid=m(),h(t.euid,r,e)):"value"===u&&r!==i?e.value=r:i&&r===i||e.setAttribute(u,r);var a,s,c,f}(o,n,i),p(n,"updated");var s=n.children?n.children.length:0,f=i.children?i.children.length:0;if(s<f)for(var l,g=f-1;g>=0;g--)void 0===n.children[g]&&(l=o.lastChild)&&(j(i.children[g]),l.remove());for(var y=0;y<s;y++)e(o,n.children[y],i.children[y],y)}}else j(i),t.replaceChild(v(n),o);else t.replaceChild(v(n),o);function j(e){if(p(e,"unmounted"),e&&(O(e.euid),e.children))for(var t=e.children.length,n=0;n<t;n++)j(e.children[n])}function O(e){e&&delete a[e]}function E(e,t){if(t)for(var n=Object.keys(a[t]),i=0;i<n.length;i++)c.includes(n[i])&&e.removeEventListener(n[i],a[t][n[i]])}}(e,r,u,0)}function p(e,t){if(e&&e.uuid){var n=s[e.uuid];n[t]&&(f.push(n[t]),i=new Event("__LITERAL_LIFECYCLE__"),window.dispatchEvent(i))}var i}function m(){return Math.random().toString(36).substring(2)+(new Date).getTime().toString(36)}module.exports={component:function(e){void 0===e&&(e={});var t=e.state;void 0===t&&(t={});var n=e.mounted;void 0===n&&(n=function(){});var u=e.updated;void 0===u&&(u=function(){});var d=e.unmounted;void 0===d&&(d=function(){});var o=e.methods;void 0===o&&(o=function(){});var a=e.render;void 0===a&&(a=function(){});var c=m();return r[c]=t,function(e){return void 0===e&&(e={}),{uuid:c,render:function(){var f=this;for(var l in this.uuid=c,this.props=e,s[this.uuid]={mounted:n.bind(this),updated:u.bind(this),unmounted:function(){r[f.uuid]=t,d.bind(f)()}},this.getState=function(){return Object.assign({},r[this.uuid])}.bind(this),this.setState=function(e){var t=Object.assign({},this.getState(),e);r[this.uuid]=t,g()}.bind(this),this.getStore=function(){return Object.assign({},i)},this.setStore=function(e){var t=Object.assign({},this.getStore(),e);i=t,g()}.bind(this),"function"==typeof o&&(o=o.bind(this)()),o)f[l]=o[l].bind(f);return a.bind(this)()}}}},render:function(r,u,d){void 0===d&&(d={}),i=Object.assign({},i,d),e=document.getElementById(u);var o=l(r());function a(){for(var e;e=f.shift();)e()}t=r,n=Object.assign({},o),e.appendChild(v(o)),a(),window.addEventListener("__LITERAL_LIFECYCLE__",a)},h:function(e,t){for(var n=[],i=arguments.length-2;i-- >0;)n[i]=arguments[i+2];return{element:e,attributes:Object.assign({},t),children:function e(t,n){for(var i=0;i<t.length;i++)Array.isArray(t[i])?e(t[i],n):n.push(t[i]);return n}(n,[])}}}; | ||
var e,t,n,i={},r={},u="luid",d="euid",o=[],a=[],s={},c={},f=["abort","blur","error","focus","load","mouseenter","mouseleave","resize","scroll","unload"],l=!1,v=[];function h(e){var t;if(void 0!==e){if("function"==typeof e.element){var n=Object.assign({},e.attributes.props)||{};delete e.attributes.props,(e=e.element(n)).render&&(t=e.uuid,(e=new e.render).uuid=t,e.attributes&&(e.attributes["data-"+u]=t))}else"function"==typeof e.render&&(t=e.uuid,(e=new e.render).uuid=t,e.attributes&&(e.attributes["data-"+u]=t));if(e.children)for(var i=0;i<e.children.length;i++)e.children[i]=h(e.children[i]);return e}}function b(e){var t=typeof e;if("string"===t||"number"===t)return document.createTextNode(e);if("boolean"===t||"undefined"===t)return document.createTextNode("");var n,i=document.createElement(e.element);if(e.attributes&&"object"==typeof e.attributes)for(var r=0,u=Object.entries(e.attributes);r<u.length;r+=1){var d=u[r],o=d[0],a=d[1];"events"===o?(e.euid=w(),g(e.euid,a,i)):"style"===o?p(a,i):i.setAttribute(o,a)}if(S(e,"mounted"),e.children&&e.children.length)for(var s=0;s<e.children.length;s++)n=b(e.children[s]),i.appendChild(n);return i}function g(t,n,i){if(i){var r=Object.keys(n),u=r.length;if(u){var c;i.setAttribute("data-"+d,t),s[t]=n,function(t){for(var n=Object.keys(t),i=0;i<n.length;i++)f.includes(n[i])||o.push(n[i]);!function(){var t,n=function(e){if("#document"!==e.parentNode.nodeName){var t=e.getAttribute("data-"+d);return t||n(e.parentNode)}};for(;t=o.pop();)a.includes(t)||(a.push(t),e.addEventListener(t,function(e){var t=n(e.target);if(t&&s[t]){var i=s[t][e.type];i&&i(e)}}))}()}(n);for(var l=0;l<u;l++)f.includes(c=r[l])&&i.addEventListener(c,s[t][c])}}}function p(e,t){if(e&&"object"==typeof e)for(var n=0,i=Object.entries(e);n<i.length;n+=1){var r=i[n];t.style[r[0]]=r[1]}}var m=function(e,t){return l={newTree:e,oldTree:t}},y=function(e,t,n,i){if(l)return i(l);if(void 0===e)return i(m(void 0,void 0));if(e.uuid&&e.uuid===n)return i(m(e,t));if(e.children)for(var r,u,d=e.children.length,o=0;o<d;o++)if(u=t.children[o],void 0!==(r=e.children[o])){if(r.uuid&&r.uuid===n)return i(m(r,u));y(r,u,n,i)}};function j(i){var r=h(t()),d=Object.assign({},n);if(n=Object.assign({},r),!i)return O(e,r,d,0);var o=document.querySelector("[data-"+u+'="'+i+'"]').parentNode;y(r,d,i,function(e){var t;l=!1;for(var n=0;n<o.children.length;n++)if((t=o.children[n].getAttribute("data-"+u))&&t===i)return O(o,e.newTree,e.oldTree,n)})}function O(e,t,n,i){if(void 0===i&&(i=0),e){var r=typeof t,u=typeof n,d=e.childNodes[i];if("undefined"===u)e.appendChild(b(t));else if("undefined"===r)E(n),e.removeChild(d);else if(!1!==n||!t.element&&"string"!==r&&"number"!==r)if(!1!==t||!n.element&&"string"!==u&&"number"!==u){if(function(e,t,n,i){return n!==i||("string"===n||"number"===n)&&e!==t||e.element!==t.element||e.uuid!==t.uuid}(t,n,r,u))E(n),e.replaceChild(b(t),d);else if(t.element){!function(e,t,n){S(t,"updated");for(var i,r,u,d=Object.keys(t.attributes),o=0;o<d.length;o++)r=t.attributes[u=d[o]],i=n.attributes?n.attributes[u]:void 0,"style"===u?(void 0,void 0,f=typeof(s=i),"object"===(c=typeof(a=r))&&"object"===f&&JSON.stringify(a)===JSON.stringify(s)||"undefined"===c&&"undefined"===f||(e.removeAttribute("style"),p(r,e))):"events"===u?(L(e,n.euid),C(n.euid),t.euid=w(),g(t.euid,r,e)):"value"===u&&r!==i?e.value=r:i&&r===i||e.setAttribute(u,r);var a,s,c,f}(d,t,n);var o=t.children?t.children.length:0,a=n.children?n.children.length:0;if(o<a)for(var s,c=a-1;c>=0;c--)void 0===t.children[c]&&(s=d.lastChild)&&(E(n.children[c]),s.remove());for(var f=0;f<o;f++)O(d,t.children[f],n.children[f],f)}}else E(n),e.replaceChild(b(t),d);else e.replaceChild(b(t),d)}}function E(e){if(S(e,"unmounted"),e&&(C(e.euid),e.children))for(var t=e.children.length,n=0;n<t;n++)E(e.children[n])}function C(e){e&&delete s[e]}function L(e,t){if(t)for(var n=Object.keys(s[t]),i=0;i<n.length;i++)f.includes(n[i])&&e.removeEventListener(n[i],s[t][n[i]])}function S(e,t){if(e&&e.uuid){var n=c[e.uuid];n[t]&&(v.push(n[t]),i=new Event("__LITERAL_LIFECYCLE__"),window.dispatchEvent(i))}var i}function w(){return Math.random().toString(36).substring(2)+(new Date).getTime().toString(36)}module.exports={component:function(e){void 0===e&&(e={});var t=e.state;void 0===t&&(t={});var n=e.mounted;void 0===n&&(n=function(){});var u=e.updated;void 0===u&&(u=function(){});var d=e.unmounted;void 0===d&&(d=function(){});var o=e.methods;void 0===o&&(o=function(){});var a=e.render;void 0===a&&(a=function(){});var s=w();return r[s]=t,function(e){return void 0===e&&(e={}),{uuid:s,render:function(){var f=this;for(var l in this.uuid=s,this.props=e,c[this.uuid]={mounted:n.bind(this),updated:u.bind(this),unmounted:function(){r[f.uuid]=t,d.bind(f)()}},this.getState=function(){return Object.assign({},r[this.uuid])}.bind(this),this.setState=function(e){var t=Object.assign({},this.getState(),e);r[this.uuid]=t,j(this.uuid)}.bind(this),this.getStore=function(){return Object.assign({},i)},this.setStore=function(e){var t=Object.assign({},this.getStore(),e);i=t,j()}.bind(this),"function"==typeof o&&(o=o.bind(this)()),o)f[l]=o[l].bind(f);return a.bind(this)()}}}},render:function(r,u,d){void 0===d&&(d={}),i=Object.assign({},i,d),e=document.getElementById(u);var o=h(r());function a(){for(var e;e=v.shift();)e()}t=r,n=Object.assign({},o),e.appendChild(b(o)),a(),window.addEventListener("__LITERAL_LIFECYCLE__",a)},h:function(e,t){for(var n=[],i=arguments.length-2;i-- >0;)n[i]=arguments[i+2];return{element:e,attributes:Object.assign({},t),children:function e(t,n){for(var i=0;i<t.length;i++)Array.isArray(t[i])?e(t[i],n):n.push(t[i]);return n}(n,[])}}}; | ||
//# sourceMappingURL=index.js.map |
@@ -1,2 +0,2 @@ | ||
var e,t,n,i={},r={},u="euid",d=[],o=[],a={},s={},c=["abort","blur","error","focus","load","mouseenter","mouseleave","resize","scroll","unload"],f=[],l=function(e,t){for(var n=[],i=arguments.length-2;i-- >0;)n[i]=arguments[i+2];return{element:e,attributes:Object.assign({},t),children:function e(t,n){for(var i=0;i<t.length;i++)Array.isArray(t[i])?e(t[i],n):n.push(t[i]);return n}(n,[])}},v=function(r,u,d){void 0===d&&(d={}),i=Object.assign({},i,d),e=document.getElementById(u);var o=b(r());function a(){for(var e;e=f.shift();)e()}t=r,n=Object.assign({},o),e.appendChild(g(o)),a(),window.addEventListener("__LITERAL_LIFECYCLE__",a)},h=function(e){void 0===e&&(e={});var t=e.state;void 0===t&&(t={});var n=e.mounted;void 0===n&&(n=function(){});var u=e.updated;void 0===u&&(u=function(){});var d=e.unmounted;void 0===d&&(d=function(){});var o=e.methods;void 0===o&&(o=function(){});var a=e.render;void 0===a&&(a=function(){});var c=O();return r[c]=t,function(e){return void 0===e&&(e={}),{uuid:c,render:function(){var f=this;for(var l in this.uuid=c,this.props=e,s[this.uuid]={mounted:n.bind(this),updated:u.bind(this),unmounted:function(){r[f.uuid]=t,d.bind(f)()}},this.getState=function(){return Object.assign({},r[this.uuid])}.bind(this),this.setState=function(e){var t=Object.assign({},this.getState(),e);r[this.uuid]=t,y(this.uuid)}.bind(this),this.getStore=function(){return Object.assign({},i)},this.setStore=function(e){var t=Object.assign({},this.getStore(),e);i=t,y()}.bind(this),"function"==typeof o&&(o=o.bind(this)()),o)f[l]=o[l].bind(f);return a.bind(this)()}}}};function b(e){var t;if(void 0!==e){if("function"==typeof e.element){var n=Object.assign({},e.attributes.props)||{};delete e.attributes.props,(e=e.element(n)).render&&(t=e.uuid,(e=new e.render).uuid=t)}else"function"==typeof e.render&&(t=e.uuid,(e=new e.render).uuid=t);if(e.children)for(var i=0;i<e.children.length;i++)e.children[i]=b(e.children[i]);return e}}function g(e){var t=typeof e;if("string"===t||"number"===t)return document.createTextNode(e);if("boolean"===t||"undefined"===t)return document.createTextNode("");var n,i=document.createElement(e.element);if(e.attributes&&"object"==typeof e.attributes)for(var r=0,u=Object.entries(e.attributes);r<u.length;r+=1){var d=u[r],o=d[0],a=d[1];"events"===o?(e.euid=O(),p(e.euid,a,i)):"style"===o?m(a,i):i.setAttribute(o,a)}if(j(e,"mounted"),e.children&&e.children.length)for(var s=0;s<e.children.length;s++)n=g(e.children[s]),i.appendChild(n);return i}function p(t,n,i){if(i){var r=Object.keys(n),s=r.length;if(s){var f;i.setAttribute("data-"+u,t),a[t]=n,function(t){for(var n=Object.keys(t),i=0;i<n.length;i++)c.includes(n[i])||d.push(n[i]);!function(){var t,n=function(e){if("#document"!==e.parentNode.nodeName){var t=e.getAttribute("data-"+u);return t||n(e.parentNode)}};for(;t=d.pop();)o.includes(t)||(o.push(t),e.addEventListener(t,function(e){var t=n(e.target);if(t&&a[t]){var i=a[t][e.type];i&&i(e)}}))}()}(n);for(var l=0;l<s;l++)c.includes(f=r[l])&&i.addEventListener(f,a[t][f])}}}function m(e,t){if(e&&"object"==typeof e)for(var n=0,i=Object.entries(e);n<i.length;n+=1){var r=i[n];t.style[r[0]]=r[1]}}function y(i){var r=b(t()),u=Object.assign({},n);return n=Object.assign({},r),function e(t,n,i,r){void 0===r&&(r=0);if(!t)return;var u=typeof n;var d=typeof i;var o=t.childNodes[r];if("undefined"===d)t.appendChild(g(n));else if("undefined"===u)b(i),t.removeChild(o);else if(!1!==i||!n.element&&"string"!==u&&"number"!==u)if(!1!==n||!i.element&&"string"!==d&&"number"!==d){if(function(e,t,n,i){return n!==i||("string"===n||"number"===n)&&e!==t||e.element!==t.element||e.uuid!==t.uuid}(n,i,u,d))b(i),t.replaceChild(g(n),o);else if(n.element){!function(e,t,n){for(var i,r,u,d=Object.keys(t.attributes),o=0;o<d.length;o++)r=t.attributes[u=d[o]],i=n.attributes?n.attributes[u]:void 0,"style"===u?(void 0,void 0,f=typeof(s=i),"object"===(c=typeof(a=r))&&"object"===f&&JSON.stringify(a)===JSON.stringify(s)||"undefined"===c&&"undefined"===f||(e.removeAttribute("style"),m(r,e))):"events"===u?(E(e,n.euid),y(n.euid),t.euid=O(),p(t.euid,r,e)):"value"===u&&r!==i?e.value=r:i&&r===i||e.setAttribute(u,r);var a,s,c,f}(o,n,i),j(n,"updated");var s=n.children?n.children.length:0,f=i.children?i.children.length:0;if(s<f)for(var l,v=f-1;v>=0;v--)void 0===n.children[v]&&(l=o.lastChild)&&(b(i.children[v]),l.remove());for(var h=0;h<s;h++)e(o,n.children[h],i.children[h],h)}}else b(i),t.replaceChild(g(n),o);else t.replaceChild(g(n),o);function b(e){if(j(e,"unmounted"),e&&(y(e.euid),e.children))for(var t=e.children.length,n=0;n<t;n++)b(e.children[n])}function y(e){e&&delete a[e]}function E(e,t){if(t)for(var n=Object.keys(a[t]),i=0;i<n.length;i++)c.includes(n[i])&&e.removeEventListener(n[i],a[t][n[i]])}}(e,r,u,0)}function j(e,t){if(e&&e.uuid){var n=s[e.uuid];n[t]&&(f.push(n[t]),i=new Event("__LITERAL_LIFECYCLE__"),window.dispatchEvent(i))}var i}function O(){return Math.random().toString(36).substring(2)+(new Date).getTime().toString(36)}export default{component:h,render:v,h:l};export{l as h,v as render,h as component}; | ||
var e,t,n,i={},r={},u="luid",d="euid",o=[],a=[],s={},f={},c=["abort","blur","error","focus","load","mouseenter","mouseleave","resize","scroll","unload"],l=!1,v=[],h=function(e,t){for(var n=[],i=arguments.length-2;i-- >0;)n[i]=arguments[i+2];return{element:e,attributes:Object.assign({},t),children:function e(t,n){for(var i=0;i<t.length;i++)Array.isArray(t[i])?e(t[i],n):n.push(t[i]);return n}(n,[])}},b=function(r,u,d){void 0===d&&(d={}),i=Object.assign({},i,d),e=document.getElementById(u);var o=p(r());function a(){for(var e;e=v.shift();)e()}t=r,n=Object.assign({},o),e.appendChild(m(o)),a(),window.addEventListener("__LITERAL_LIFECYCLE__",a)},g=function(e){void 0===e&&(e={});var t=e.state;void 0===t&&(t={});var n=e.mounted;void 0===n&&(n=function(){});var u=e.updated;void 0===u&&(u=function(){});var d=e.unmounted;void 0===d&&(d=function(){});var o=e.methods;void 0===o&&(o=function(){});var a=e.render;void 0===a&&(a=function(){});var s=N();return r[s]=t,function(e){return void 0===e&&(e={}),{uuid:s,render:function(){var c=this;for(var l in this.uuid=s,this.props=e,f[this.uuid]={mounted:n.bind(this),updated:u.bind(this),unmounted:function(){r[c.uuid]=t,d.bind(c)()}},this.getState=function(){return Object.assign({},r[this.uuid])}.bind(this),this.setState=function(e){var t=Object.assign({},this.getState(),e);r[this.uuid]=t,C(this.uuid)}.bind(this),this.getStore=function(){return Object.assign({},i)},this.setStore=function(e){var t=Object.assign({},this.getStore(),e);i=t,C()}.bind(this),"function"==typeof o&&(o=o.bind(this)()),o)c[l]=o[l].bind(c);return a.bind(this)()}}}};function p(e){var t;if(void 0!==e){if("function"==typeof e.element){var n=Object.assign({},e.attributes.props)||{};delete e.attributes.props,(e=e.element(n)).render&&(t=e.uuid,(e=new e.render).uuid=t,e.attributes&&(e.attributes["data-"+u]=t))}else"function"==typeof e.render&&(t=e.uuid,(e=new e.render).uuid=t,e.attributes&&(e.attributes["data-"+u]=t));if(e.children)for(var i=0;i<e.children.length;i++)e.children[i]=p(e.children[i]);return e}}function m(e){var t=typeof e;if("string"===t||"number"===t)return document.createTextNode(e);if("boolean"===t||"undefined"===t)return document.createTextNode("");var n,i=document.createElement(e.element);if(e.attributes&&"object"==typeof e.attributes)for(var r=0,u=Object.entries(e.attributes);r<u.length;r+=1){var d=u[r],o=d[0],a=d[1];"events"===o?(e.euid=N(),y(e.euid,a,i)):"style"===o?j(a,i):i.setAttribute(o,a)}if(_(e,"mounted"),e.children&&e.children.length)for(var s=0;s<e.children.length;s++)n=m(e.children[s]),i.appendChild(n);return i}function y(t,n,i){if(i){var r=Object.keys(n),u=r.length;if(u){var f;i.setAttribute("data-"+d,t),s[t]=n,function(t){for(var n=Object.keys(t),i=0;i<n.length;i++)c.includes(n[i])||o.push(n[i]);!function(){var t,n=function(e){if("#document"!==e.parentNode.nodeName){var t=e.getAttribute("data-"+d);return t||n(e.parentNode)}};for(;t=o.pop();)a.includes(t)||(a.push(t),e.addEventListener(t,function(e){var t=n(e.target);if(t&&s[t]){var i=s[t][e.type];i&&i(e)}}))}()}(n);for(var l=0;l<u;l++)c.includes(f=r[l])&&i.addEventListener(f,s[t][f])}}}function j(e,t){if(e&&"object"==typeof e)for(var n=0,i=Object.entries(e);n<i.length;n+=1){var r=i[n];t.style[r[0]]=r[1]}}var O=function(e,t){return l={newTree:e,oldTree:t}},E=function(e,t,n,i){if(l)return i(l);if(void 0===e)return i(O(void 0,void 0));if(e.uuid&&e.uuid===n)return i(O(e,t));if(e.children)for(var r,u,d=e.children.length,o=0;o<d;o++)if(u=t.children[o],void 0!==(r=e.children[o])){if(r.uuid&&r.uuid===n)return i(O(r,u));E(r,u,n,i)}};function C(i){var r=p(t()),d=Object.assign({},n);if(n=Object.assign({},r),!i)return L(e,r,d,0);var o=document.querySelector("[data-"+u+'="'+i+'"]').parentNode;E(r,d,i,function(e){var t;l=!1;for(var n=0;n<o.children.length;n++)if((t=o.children[n].getAttribute("data-"+u))&&t===i)return L(o,e.newTree,e.oldTree,n)})}function L(e,t,n,i){if(void 0===i&&(i=0),e){var r=typeof t,u=typeof n,d=e.childNodes[i];if("undefined"===u)e.appendChild(m(t));else if("undefined"===r)S(n),e.removeChild(d);else if(!1!==n||!t.element&&"string"!==r&&"number"!==r)if(!1!==t||!n.element&&"string"!==u&&"number"!==u){if(function(e,t,n,i){return n!==i||("string"===n||"number"===n)&&e!==t||e.element!==t.element||e.uuid!==t.uuid}(t,n,r,u))S(n),e.replaceChild(m(t),d);else if(t.element){!function(e,t,n){_(t,"updated");for(var i,r,u,d=Object.keys(t.attributes),o=0;o<d.length;o++)r=t.attributes[u=d[o]],i=n.attributes?n.attributes[u]:void 0,"style"===u?(void 0,void 0,c=typeof(s=i),"object"===(f=typeof(a=r))&&"object"===c&&JSON.stringify(a)===JSON.stringify(s)||"undefined"===f&&"undefined"===c||(e.removeAttribute("style"),j(r,e))):"events"===u?(A(e,n.euid),w(n.euid),t.euid=N(),y(t.euid,r,e)):"value"===u&&r!==i?e.value=r:i&&r===i||e.setAttribute(u,r);var a,s,f,c}(d,t,n);var o=t.children?t.children.length:0,a=n.children?n.children.length:0;if(o<a)for(var s,f=a-1;f>=0;f--)void 0===t.children[f]&&(s=d.lastChild)&&(S(n.children[f]),s.remove());for(var c=0;c<o;c++)L(d,t.children[c],n.children[c],c)}}else S(n),e.replaceChild(m(t),d);else e.replaceChild(m(t),d)}}function S(e){if(_(e,"unmounted"),e&&(w(e.euid),e.children))for(var t=e.children.length,n=0;n<t;n++)S(e.children[n])}function w(e){e&&delete s[e]}function A(e,t){if(t)for(var n=Object.keys(s[t]),i=0;i<n.length;i++)c.includes(n[i])&&e.removeEventListener(n[i],s[t][n[i]])}function _(e,t){if(e&&e.uuid){var n=f[e.uuid];n[t]&&(v.push(n[t]),i=new Event("__LITERAL_LIFECYCLE__"),window.dispatchEvent(i))}var i}function N(){return Math.random().toString(36).substring(2)+(new Date).getTime().toString(36)}export default{component:g,render:b,h:h};export{h,b as render,g as component}; | ||
//# sourceMappingURL=index.m.js.map |
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.literaljs=t()}(this,function(){var e,t,n,i={},r={},u="euid",d=[],o=[],s={},a={},f=["abort","blur","error","focus","load","mouseenter","mouseleave","resize","scroll","unload"],c=[];function l(e){var t;if(void 0!==e){if("function"==typeof e.element){var n=Object.assign({},e.attributes.props)||{};delete e.attributes.props,(e=e.element(n)).render&&(t=e.uuid,(e=new e.render).uuid=t)}else"function"==typeof e.render&&(t=e.uuid,(e=new e.render).uuid=t);if(e.children)for(var i=0;i<e.children.length;i++)e.children[i]=l(e.children[i]);return e}}function v(e){var t=typeof e;if("string"===t||"number"===t)return document.createTextNode(e);if("boolean"===t||"undefined"===t)return document.createTextNode("");var n,i=document.createElement(e.element);if(e.attributes&&"object"==typeof e.attributes)for(var r=0,u=Object.entries(e.attributes);r<u.length;r+=1){var d=u[r],o=d[0],s=d[1];"events"===o?(e.euid=m(),h(e.euid,s,i)):"style"===o?b(s,i):i.setAttribute(o,s)}if(g(e,"mounted"),e.children&&e.children.length)for(var a=0;a<e.children.length;a++)n=v(e.children[a]),i.appendChild(n);return i}function h(t,n,i){if(i){var r=Object.keys(n),a=r.length;if(a){var c;i.setAttribute("data-"+u,t),s[t]=n,function(t){for(var n=Object.keys(t),i=0;i<n.length;i++)f.includes(n[i])||d.push(n[i]);!function(){var t,n=function(e){if("#document"!==e.parentNode.nodeName){var t=e.getAttribute("data-"+u);return t||n(e.parentNode)}};for(;t=d.pop();)o.includes(t)||(o.push(t),e.addEventListener(t,function(e){var t=n(e.target);if(t&&s[t]){var i=s[t][e.type];i&&i(e)}}))}()}(n);for(var l=0;l<a;l++)f.includes(c=r[l])&&i.addEventListener(c,s[t][c])}}}function b(e,t){if(e&&"object"==typeof e)for(var n=0,i=Object.entries(e);n<i.length;n+=1){var r=i[n];t.style[r[0]]=r[1]}}function p(i){var r=l(t()),u=Object.assign({},n);return n=Object.assign({},r),function e(t,n,i,r){void 0===r&&(r=0);if(!t)return;var u=typeof n;var d=typeof i;var o=t.childNodes[r];if("undefined"===d)t.appendChild(v(n));else if("undefined"===u)j(i),t.removeChild(o);else if(!1!==i||!n.element&&"string"!==u&&"number"!==u)if(!1!==n||!i.element&&"string"!==d&&"number"!==d){if(function(e,t,n,i){return n!==i||("string"===n||"number"===n)&&e!==t||e.element!==t.element||e.uuid!==t.uuid}(n,i,u,d))j(i),t.replaceChild(v(n),o);else if(n.element){!function(e,t,n){for(var i,r,u,d=Object.keys(t.attributes),o=0;o<d.length;o++)r=t.attributes[u=d[o]],i=n.attributes?n.attributes[u]:void 0,"style"===u?(void 0,void 0,c=typeof(a=i),"object"===(f=typeof(s=r))&&"object"===c&&JSON.stringify(s)===JSON.stringify(a)||"undefined"===f&&"undefined"===c||(e.removeAttribute("style"),b(r,e))):"events"===u?(E(e,n.euid),O(n.euid),t.euid=m(),h(t.euid,r,e)):"value"===u&&r!==i?e.value=r:i&&r===i||e.setAttribute(u,r);var s,a,f,c}(o,n,i),g(n,"updated");var a=n.children?n.children.length:0,c=i.children?i.children.length:0;if(a<c)for(var l,p=c-1;p>=0;p--)void 0===n.children[p]&&(l=o.lastChild)&&(j(i.children[p]),l.remove());for(var y=0;y<a;y++)e(o,n.children[y],i.children[y],y)}}else j(i),t.replaceChild(v(n),o);else t.replaceChild(v(n),o);function j(e){if(g(e,"unmounted"),e&&(O(e.euid),e.children))for(var t=e.children.length,n=0;n<t;n++)j(e.children[n])}function O(e){e&&delete s[e]}function E(e,t){if(t)for(var n=Object.keys(s[t]),i=0;i<n.length;i++)f.includes(n[i])&&e.removeEventListener(n[i],s[t][n[i]])}}(e,r,u,0)}function g(e,t){if(e&&e.uuid){var n=a[e.uuid];n[t]&&(c.push(n[t]),i=new Event("__LITERAL_LIFECYCLE__"),window.dispatchEvent(i))}var i}function m(){return Math.random().toString(36).substring(2)+(new Date).getTime().toString(36)}return{component:function(e){void 0===e&&(e={});var t=e.state;void 0===t&&(t={});var n=e.mounted;void 0===n&&(n=function(){});var u=e.updated;void 0===u&&(u=function(){});var d=e.unmounted;void 0===d&&(d=function(){});var o=e.methods;void 0===o&&(o=function(){});var s=e.render;void 0===s&&(s=function(){});var f=m();return r[f]=t,function(e){return void 0===e&&(e={}),{uuid:f,render:function(){var c=this;for(var l in this.uuid=f,this.props=e,a[this.uuid]={mounted:n.bind(this),updated:u.bind(this),unmounted:function(){r[c.uuid]=t,d.bind(c)()}},this.getState=function(){return Object.assign({},r[this.uuid])}.bind(this),this.setState=function(e){var t=Object.assign({},this.getState(),e);r[this.uuid]=t,p()}.bind(this),this.getStore=function(){return Object.assign({},i)},this.setStore=function(e){var t=Object.assign({},this.getStore(),e);i=t,p()}.bind(this),"function"==typeof o&&(o=o.bind(this)()),o)c[l]=o[l].bind(c);return s.bind(this)()}}}},render:function(r,u,d){void 0===d&&(d={}),i=Object.assign({},i,d),e=document.getElementById(u);var o=l(r());function s(){for(var e;e=c.shift();)e()}t=r,n=Object.assign({},o),e.appendChild(v(o)),s(),window.addEventListener("__LITERAL_LIFECYCLE__",s)},h:function(e,t){for(var n=[],i=arguments.length-2;i-- >0;)n[i]=arguments[i+2];return{element:e,attributes:Object.assign({},t),children:function e(t,n){for(var i=0;i<t.length;i++)Array.isArray(t[i])?e(t[i],n):n.push(t[i]);return n}(n,[])}}}}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.literaljs=t()}(this,function(){var e,t,n,i={},r={},u="luid",d="euid",o=[],a=[],f={},s={},c=["abort","blur","error","focus","load","mouseenter","mouseleave","resize","scroll","unload"],l=!1,v=[];function h(e){var t;if(void 0!==e){if("function"==typeof e.element){var n=Object.assign({},e.attributes.props)||{};delete e.attributes.props,(e=e.element(n)).render&&(t=e.uuid,(e=new e.render).uuid=t,e.attributes&&(e.attributes["data-"+u]=t))}else"function"==typeof e.render&&(t=e.uuid,(e=new e.render).uuid=t,e.attributes&&(e.attributes["data-"+u]=t));if(e.children)for(var i=0;i<e.children.length;i++)e.children[i]=h(e.children[i]);return e}}function b(e){var t=typeof e;if("string"===t||"number"===t)return document.createTextNode(e);if("boolean"===t||"undefined"===t)return document.createTextNode("");var n,i=document.createElement(e.element);if(e.attributes&&"object"==typeof e.attributes)for(var r=0,u=Object.entries(e.attributes);r<u.length;r+=1){var d=u[r],o=d[0],a=d[1];"events"===o?(e.euid=w(),p(e.euid,a,i)):"style"===o?g(a,i):i.setAttribute(o,a)}if(S(e,"mounted"),e.children&&e.children.length)for(var f=0;f<e.children.length;f++)n=b(e.children[f]),i.appendChild(n);return i}function p(t,n,i){if(i){var r=Object.keys(n),u=r.length;if(u){var s;i.setAttribute("data-"+d,t),f[t]=n,function(t){for(var n=Object.keys(t),i=0;i<n.length;i++)c.includes(n[i])||o.push(n[i]);!function(){var t,n=function(e){if("#document"!==e.parentNode.nodeName){var t=e.getAttribute("data-"+d);return t||n(e.parentNode)}};for(;t=o.pop();)a.includes(t)||(a.push(t),e.addEventListener(t,function(e){var t=n(e.target);if(t&&f[t]){var i=f[t][e.type];i&&i(e)}}))}()}(n);for(var l=0;l<u;l++)c.includes(s=r[l])&&i.addEventListener(s,f[t][s])}}}function g(e,t){if(e&&"object"==typeof e)for(var n=0,i=Object.entries(e);n<i.length;n+=1){var r=i[n];t.style[r[0]]=r[1]}}var m=function(e,t){return l={newTree:e,oldTree:t}},y=function(e,t,n,i){if(l)return i(l);if(void 0===e)return i(m(void 0,void 0));if(e.uuid&&e.uuid===n)return i(m(e,t));if(e.children)for(var r,u,d=e.children.length,o=0;o<d;o++)if(u=t.children[o],void 0!==(r=e.children[o])){if(r.uuid&&r.uuid===n)return i(m(r,u));y(r,u,n,i)}};function j(i){var r=h(t()),d=Object.assign({},n);if(n=Object.assign({},r),!i)return O(e,r,d,0);var o=document.querySelector("[data-"+u+'="'+i+'"]').parentNode;y(r,d,i,function(e){var t;l=!1;for(var n=0;n<o.children.length;n++)if((t=o.children[n].getAttribute("data-"+u))&&t===i)return O(o,e.newTree,e.oldTree,n)})}function O(e,t,n,i){if(void 0===i&&(i=0),e){var r=typeof t,u=typeof n,d=e.childNodes[i];if("undefined"===u)e.appendChild(b(t));else if("undefined"===r)E(n),e.removeChild(d);else if(!1!==n||!t.element&&"string"!==r&&"number"!==r)if(!1!==t||!n.element&&"string"!==u&&"number"!==u){if(function(e,t,n,i){return n!==i||("string"===n||"number"===n)&&e!==t||e.element!==t.element||e.uuid!==t.uuid}(t,n,r,u))E(n),e.replaceChild(b(t),d);else if(t.element){!function(e,t,n){S(t,"updated");for(var i,r,u,d=Object.keys(t.attributes),o=0;o<d.length;o++)r=t.attributes[u=d[o]],i=n.attributes?n.attributes[u]:void 0,"style"===u?(void 0,void 0,c=typeof(f=i),"object"===(s=typeof(a=r))&&"object"===c&&JSON.stringify(a)===JSON.stringify(f)||"undefined"===s&&"undefined"===c||(e.removeAttribute("style"),g(r,e))):"events"===u?(L(e,n.euid),C(n.euid),t.euid=w(),p(t.euid,r,e)):"value"===u&&r!==i?e.value=r:i&&r===i||e.setAttribute(u,r);var a,f,s,c}(d,t,n);var o=t.children?t.children.length:0,a=n.children?n.children.length:0;if(o<a)for(var f,s=a-1;s>=0;s--)void 0===t.children[s]&&(f=d.lastChild)&&(E(n.children[s]),f.remove());for(var c=0;c<o;c++)O(d,t.children[c],n.children[c],c)}}else E(n),e.replaceChild(b(t),d);else e.replaceChild(b(t),d)}}function E(e){if(S(e,"unmounted"),e&&(C(e.euid),e.children))for(var t=e.children.length,n=0;n<t;n++)E(e.children[n])}function C(e){e&&delete f[e]}function L(e,t){if(t)for(var n=Object.keys(f[t]),i=0;i<n.length;i++)c.includes(n[i])&&e.removeEventListener(n[i],f[t][n[i]])}function S(e,t){if(e&&e.uuid){var n=s[e.uuid];n[t]&&(v.push(n[t]),i=new Event("__LITERAL_LIFECYCLE__"),window.dispatchEvent(i))}var i}function w(){return Math.random().toString(36).substring(2)+(new Date).getTime().toString(36)}return{component:function(e){void 0===e&&(e={});var t=e.state;void 0===t&&(t={});var n=e.mounted;void 0===n&&(n=function(){});var u=e.updated;void 0===u&&(u=function(){});var d=e.unmounted;void 0===d&&(d=function(){});var o=e.methods;void 0===o&&(o=function(){});var a=e.render;void 0===a&&(a=function(){});var f=w();return r[f]=t,function(e){return void 0===e&&(e={}),{uuid:f,render:function(){var c=this;for(var l in this.uuid=f,this.props=e,s[this.uuid]={mounted:n.bind(this),updated:u.bind(this),unmounted:function(){r[c.uuid]=t,d.bind(c)()}},this.getState=function(){return Object.assign({},r[this.uuid])}.bind(this),this.setState=function(e){var t=Object.assign({},this.getState(),e);r[this.uuid]=t,j(this.uuid)}.bind(this),this.getStore=function(){return Object.assign({},i)},this.setStore=function(e){var t=Object.assign({},this.getStore(),e);i=t,j()}.bind(this),"function"==typeof o&&(o=o.bind(this)()),o)c[l]=o[l].bind(c);return a.bind(this)()}}}},render:function(r,u,d){void 0===d&&(d={}),i=Object.assign({},i,d),e=document.getElementById(u);var o=h(r());function a(){for(var e;e=v.shift();)e()}t=r,n=Object.assign({},o),e.appendChild(b(o)),a(),window.addEventListener("__LITERAL_LIFECYCLE__",a)},h:function(e,t){for(var n=[],i=arguments.length-2;i-- >0;)n[i]=arguments[i+2];return{element:e,attributes:Object.assign({},t),children:function e(t,n){for(var i=0;i<t.length;i++)Array.isArray(t[i])?e(t[i],n):n.push(t[i]);return n}(n,[])}}}}); | ||
//# sourceMappingURL=index.umd.js.map |
{ | ||
"name": "literaljs", | ||
"version": "5.1.62", | ||
"version": "5.2.0", | ||
"description": "A small JavaScript library for building reactive user interfaces.", | ||
@@ -5,0 +5,0 @@ "main": "build/index.js", |
@@ -12,9 +12,9 @@ <p align="center"> | ||
Recent 5.1.62 microbundle: | ||
Recent 5.2.0 microbundle: | ||
```js | ||
$ microbundle | ||
Build output to build: | ||
1.95 kB: index.js | ||
1.98 kB: index.m.js | ||
2.01 kB: index.umd.js | ||
2.16 kB: index.js | ||
2.18 kB: index.m.js | ||
2.22 kB: index.umd.js | ||
``` | ||
@@ -21,0 +21,0 @@ ### [Features and stuff](#features) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
421520
580