Comparing version 5.1.0 to 5.1.1
@@ -1,2 +0,2 @@ | ||
var e,t,n,i={},r={},u="euid",d=[],o=[],s={},a={},f=[];function c(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]=c(e.children[i]);return e}}function h(e,t){void 0===t&&(t=!1);var n=typeof e;if("undefined"===n)return!1;if("string"===n||"number"===n)return document.createTextNode(e);if("boolean"===n)return document.createTextNode("");var i=document.createElement(e.element);if(t&&e.element&&e.uuid&&function(e){var t=a[e];t.mounted&&f.push(t.mounted);m()}(e.uuid),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?v(s,i):"style"===o?l(s,i):i.setAttribute(o,s)}if(e.children&&e.children.length)for(var c=0;c<e.children.length;c++)i.appendChild(h(e.children[c],t));return i}function v(t,n){if(n){!function(t){for(var n=Object.keys(t),i=0;i<n.length;i++)d.push(n[i]);!function(){var t;for(;t=d.pop();)o.includes(t)||(o.push(t),e.addEventListener(t,function(e){var t=e.target.getAttribute("data-"+u);if(t&&s[t]){var n=e.type,i=s[t][n];i&&i(e)}}))}()}(t);var i=p();n.setAttribute("data-"+u,i),s[i]=t}}function l(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 b(i){var r=c(t()),d=Object.assign({},n);return n=Object.assign({},r),function e(t,n,i,r){void 0===r&&(r=0);if(!t)return;var d=typeof n;var o=typeof i;var c=t.childNodes[r];if("undefined"===o)t.appendChild(h(n)),C(n,"mounted");else if("undefined"===d)O(c),t.removeChild(c),C(i,"unmounted");else if(!1!==i||!n.element&&"string"!==d&&"number"!==d)if(!1!==n||!i.element&&"string"!==o&&"number"!==o){if(function(e,t,n,i){return n!==i||"string"===n&&e!==t||e.element!==t.element}(n,i,d,o))O(c),t.replaceChild(h(n),c),C(i,"unmounted"),C(n,"mounted");else if(n.element){!function(e,t,n){for(var i=0,r=Object.entries(t.attributes);i<r.length;i+=1){var u=r[i],d=u[0],o=u[1],s=n.attributes?n.attributes[d]:void 0;"style"===d?(void 0,void 0,h=typeof(f=s),"object"===(c=typeof(a=o))&&"object"===h&&JSON.stringify(a)===JSON.stringify(f)||"undefined"===c&&"undefined"===h||(e.removeAttribute("style"),l(o,e))):"events"===d?(O(e),v(o,e)):"value"===d&&o!==s?e.value=o:s&&o===s||e.setAttribute(d,o)}var a,f,c,h}(c,n,i),n.uuid===i.uuid?C(n,"updated"):n.uuid!==i.uuid&&(C(i,"unmounted"),C(n,"mounted"));var b=n.children?n.children.length:0,p=c.childNodes.length;if(b<p)for(var g=p-1;g>0;g--)if(void 0===n.children[g]){var y=c.lastChild;O(y),y.remove(),C(i.children[g],"unmounted")}for(var j=0;j<b;j++)e(c,n.children[j],i.children[j],j)}}else O(c),t.replaceChild(h(n),c),C(i,"unmounted");else O(c),t.replaceChild(h(n),c),C(n,"mounted");function O(e){if(e&&e.getAttribute){var t=e.getAttribute("data-"+u);t&&delete s[t]}}function C(e,t){if(e&&e.uuid){var n=a[e.uuid][t];n&&(f.push(n),m())}}}(e,r,d,0)}function m(){var e=new Event("__LITERAL_LIFECYCLE__");return window.dispatchEvent(e)}function p(){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 s=e.render;void 0===s&&(s=function(){});var f=p();return r[f]=t,function(e){return void 0===e&&(e={}),{uuid:f,render:function(){for(var t in this.uuid=f,this.props=e,this.mounted=n.bind(this),this.updated=u.bind(this),this.unmounted=d.bind(this),a[this.uuid]={mounted:this.mounted,updated:this.updated,unmounted:this.unmounted},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,b()}.bind(this),this.getStore=function(){return Object.assign({},i)},this.setStore=function(e){var t=Object.assign({},this.getStore(),e);i=t,b()}.bind(this),"function"==typeof o&&(o=o.bind(this)()),o)this[t]=o[t].bind(this);return s.bind(this)()}}}},render:function(r,u,d){void 0===d&&(d={}),i=Object.assign({},i,d),e=document.getElementById(u);var o=c(r());function s(){for(var e;e=f.pop();)e()}t=r,n=Object.assign({},o),e.appendChild(h(o,!0)),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,[])}}}; | ||
var e,t,n,i={},r={},u="euid",d=[],o=[],s={},a={},f=[];function c(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]=c(e.children[i]);return e}}function h(e,t){void 0===t&&(t=!1);var n=typeof e;if("string"===n||"number"===n)return document.createTextNode(e);if("boolean"===n||"undefined"===n)return document.createTextNode("");var i,r=document.createElement(e.element);if(t&&e.element&&e.uuid&&function(e){var t=a[e];t.mounted&&f.push(t.mounted);m()}(e.uuid),e.attributes&&"object"==typeof e.attributes)for(var u=0,d=Object.entries(e.attributes);u<d.length;u+=1){var o=d[u],s=o[0],c=o[1];"events"===s?v(c,r):"style"===s?l(c,r):r.setAttribute(s,c)}if(e.children&&e.children.length)for(var b=0;b<e.children.length;b++)i=h(e.children[b],t),r.appendChild(i);return r}function v(t,n){if(n){!function(t){for(var n=Object.keys(t),i=0;i<n.length;i++)d.push(n[i]);!function(){var t;for(;t=d.pop();)o.includes(t)||(o.push(t),e.addEventListener(t,function(e){var t=e.target.getAttribute("data-"+u);if(t&&s[t]){var n=e.type,i=s[t][n];i&&i(e)}}))}()}(t);var i=p();n.setAttribute("data-"+u,i),s[i]=t}}function l(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 b(i){var r=c(t()),d=Object.assign({},n);return n=Object.assign({},r),function e(t,n,i,r){void 0===r&&(r=0);if(!t)return;var d=typeof n;var o=typeof i;var c=t.childNodes[r];if(!c)return;if("undefined"===o)t.appendChild(h(n)),C(n,"mounted");else if("undefined"===d)O(c),t.removeChild(c),C(i,"unmounted");else if(!1!==i||!n.element&&"string"!==d&&"number"!==d)if(!1!==n||!i.element&&"string"!==o&&"number"!==o){if(function(e,t,n,i){return n!==i||"string"===n&&e!==t||e.element!==t.element||e.uuid&&t.uuid&&e.uuid!==t.uuid}(n,i,d,o))O(c),t.replaceChild(h(n),c),C(i,"unmounted"),C(n,"mounted");else if(n.element){!function(e,t,n){for(var i=0,r=Object.entries(t.attributes);i<r.length;i+=1){var u=r[i],d=u[0],o=u[1],s=n.attributes?n.attributes[d]:void 0;"style"===d?(void 0,void 0,h=typeof(f=s),"object"===(c=typeof(a=o))&&"object"===h&&JSON.stringify(a)===JSON.stringify(f)||"undefined"===c&&"undefined"===h||(e.removeAttribute("style"),l(o,e))):"events"===d?(O(e),v(o,e)):"value"===d&&o!==s?e.value=o:s&&o===s||e.setAttribute(d,o)}var a,f,c,h}(c,n,i),C(n,"updated");var b=n.children?n.children.length:0,p=i.children?i.children.length:0;if(b<p)for(var g=p-1;g>0;g--)if(void 0===n.children[g]){var y=c.lastChild;O(y),y&&y.remove(),C(i.children[g],"unmounted")}for(var j=0;j<b;j++)e(c,n.children[j],i.children[j],j)}}else O(c),t.replaceChild(h(n),c),C(i,"unmounted");else O(c),t.replaceChild(h(n),c),C(n,"mounted");function O(e){if(e&&e.getAttribute){var t=e.getAttribute("data-"+u);t&&delete s[t]}}function C(e,t){if(e&&e.uuid){var n=a[e.uuid][t];n&&(f.push(n),m())}}}(e,r,d,0)}function m(){var e=new Event("__LITERAL_LIFECYCLE__");return window.dispatchEvent(e)}function p(){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 s=e.render;void 0===s&&(s=function(){});var f=p();return r[f]=t,function(e){return void 0===e&&(e={}),{uuid:f,render:function(){for(var t in this.uuid=f,this.props=e,this.mounted=n.bind(this),this.updated=u.bind(this),this.unmounted=d.bind(this),a[this.uuid]={mounted:this.mounted,updated:this.updated,unmounted:this.unmounted},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,b()}.bind(this),this.getStore=function(){return Object.assign({},i)},this.setStore=function(e){var t=Object.assign({},this.getStore(),e);i=t,b()}.bind(this),"function"==typeof o&&(o=o.bind(this)()),o)this[t]=o[t].bind(this);return s.bind(this)()}}}},render:function(r,u,d){void 0===d&&(d={}),i=Object.assign({},i,d),e=document.getElementById(u);var o=c(r());function s(){for(var e;e=f.pop();)e()}t=r,n=Object.assign({},o),e.appendChild(h(o,!0)),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,[])}}}; | ||
//# sourceMappingURL=index.js.map |
@@ -1,2 +0,2 @@ | ||
var e,t,n,i={},r={},u="euid",d=[],o=[],s={},a={},f=[],c=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,[])}},h=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=f.pop();)e()}t=r,n=Object.assign({},o),e.appendChild(b(o,!0)),s(),window.addEventListener("__LITERAL_LIFECYCLE__",s)},v=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=j();return r[f]=t,function(e){return void 0===e&&(e={}),{uuid:f,render:function(){for(var t in this.uuid=f,this.props=e,this.mounted=n.bind(this),this.updated=u.bind(this),this.unmounted=d.bind(this),a[this.uuid]={mounted:this.mounted,updated:this.updated,unmounted:this.unmounted},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(this.uuid)}.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)this[t]=o[t].bind(this);return s.bind(this)()}}}};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 b(e,t){void 0===t&&(t=!1);var n=typeof e;if("undefined"===n)return!1;if("string"===n||"number"===n)return document.createTextNode(e);if("boolean"===n)return document.createTextNode("");var i=document.createElement(e.element);if(t&&e.element&&e.uuid&&function(e){var t=a[e];t.mounted&&f.push(t.mounted);y()}(e.uuid),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?m(s,i):"style"===o?p(s,i):i.setAttribute(o,s)}if(e.children&&e.children.length)for(var c=0;c<e.children.length;c++)i.appendChild(b(e.children[c],t));return i}function m(t,n){if(n){!function(t){for(var n=Object.keys(t),i=0;i<n.length;i++)d.push(n[i]);!function(){var t;for(;t=d.pop();)o.includes(t)||(o.push(t),e.addEventListener(t,function(e){var t=e.target.getAttribute("data-"+u);if(t&&s[t]){var n=e.type,i=s[t][n];i&&i(e)}}))}()}(t);var i=j();n.setAttribute("data-"+u,i),s[i]=t}}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]}}function g(i){var r=l(t()),d=Object.assign({},n);return n=Object.assign({},r),function e(t,n,i,r){void 0===r&&(r=0);if(!t)return;var d=typeof n;var o=typeof i;var c=t.childNodes[r];if("undefined"===o)t.appendChild(b(n)),C(n,"mounted");else if("undefined"===d)O(c),t.removeChild(c),C(i,"unmounted");else if(!1!==i||!n.element&&"string"!==d&&"number"!==d)if(!1!==n||!i.element&&"string"!==o&&"number"!==o){if(function(e,t,n,i){return n!==i||"string"===n&&e!==t||e.element!==t.element}(n,i,d,o))O(c),t.replaceChild(b(n),c),C(i,"unmounted"),C(n,"mounted");else if(n.element){!function(e,t,n){for(var i=0,r=Object.entries(t.attributes);i<r.length;i+=1){var u=r[i],d=u[0],o=u[1],s=n.attributes?n.attributes[d]:void 0;"style"===d?(void 0,void 0,h=typeof(f=s),"object"===(c=typeof(a=o))&&"object"===h&&JSON.stringify(a)===JSON.stringify(f)||"undefined"===c&&"undefined"===h||(e.removeAttribute("style"),p(o,e))):"events"===d?(O(e),m(o,e)):"value"===d&&o!==s?e.value=o:s&&o===s||e.setAttribute(d,o)}var a,f,c,h}(c,n,i),n.uuid===i.uuid?C(n,"updated"):n.uuid!==i.uuid&&(C(i,"unmounted"),C(n,"mounted"));var h=n.children?n.children.length:0,v=c.childNodes.length;if(h<v)for(var l=v-1;l>0;l--)if(void 0===n.children[l]){var g=c.lastChild;O(g),g.remove(),C(i.children[l],"unmounted")}for(var j=0;j<h;j++)e(c,n.children[j],i.children[j],j)}}else O(c),t.replaceChild(b(n),c),C(i,"unmounted");else O(c),t.replaceChild(b(n),c),C(n,"mounted");function O(e){if(e&&e.getAttribute){var t=e.getAttribute("data-"+u);t&&delete s[t]}}function C(e,t){if(e&&e.uuid){var n=a[e.uuid][t];n&&(f.push(n),y())}}}(e,r,d,0)}function y(){var e=new Event("__LITERAL_LIFECYCLE__");return window.dispatchEvent(e)}function j(){return Math.random().toString(36).substring(2)+(new Date).getTime().toString(36)}export default{component:v,render:h,h:c};export{c as h,h as render,v as component}; | ||
var e,t,n,i={},r={},u="euid",d=[],o=[],s={},a={},f=[],c=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,[])}},h=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=f.pop();)e()}t=r,n=Object.assign({},o),e.appendChild(b(o,!0)),s(),window.addEventListener("__LITERAL_LIFECYCLE__",s)},v=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=j();return r[f]=t,function(e){return void 0===e&&(e={}),{uuid:f,render:function(){for(var t in this.uuid=f,this.props=e,this.mounted=n.bind(this),this.updated=u.bind(this),this.unmounted=d.bind(this),a[this.uuid]={mounted:this.mounted,updated:this.updated,unmounted:this.unmounted},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(this.uuid)}.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)this[t]=o[t].bind(this);return s.bind(this)()}}}};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 b(e,t){void 0===t&&(t=!1);var n=typeof e;if("string"===n||"number"===n)return document.createTextNode(e);if("boolean"===n||"undefined"===n)return document.createTextNode("");var i,r=document.createElement(e.element);if(t&&e.element&&e.uuid&&function(e){var t=a[e];t.mounted&&f.push(t.mounted);y()}(e.uuid),e.attributes&&"object"==typeof e.attributes)for(var u=0,d=Object.entries(e.attributes);u<d.length;u+=1){var o=d[u],s=o[0],c=o[1];"events"===s?p(c,r):"style"===s?m(c,r):r.setAttribute(s,c)}if(e.children&&e.children.length)for(var h=0;h<e.children.length;h++)i=b(e.children[h],t),r.appendChild(i);return r}function p(t,n){if(n){!function(t){for(var n=Object.keys(t),i=0;i<n.length;i++)d.push(n[i]);!function(){var t;for(;t=d.pop();)o.includes(t)||(o.push(t),e.addEventListener(t,function(e){var t=e.target.getAttribute("data-"+u);if(t&&s[t]){var n=e.type,i=s[t][n];i&&i(e)}}))}()}(t);var i=j();n.setAttribute("data-"+u,i),s[i]=t}}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 g(i){var r=l(t()),d=Object.assign({},n);return n=Object.assign({},r),function e(t,n,i,r){void 0===r&&(r=0);if(!t)return;var d=typeof n;var o=typeof i;var c=t.childNodes[r];if(!c)return;if("undefined"===o)t.appendChild(b(n)),C(n,"mounted");else if("undefined"===d)O(c),t.removeChild(c),C(i,"unmounted");else if(!1!==i||!n.element&&"string"!==d&&"number"!==d)if(!1!==n||!i.element&&"string"!==o&&"number"!==o){if(function(e,t,n,i){return n!==i||"string"===n&&e!==t||e.element!==t.element||e.uuid&&t.uuid&&e.uuid!==t.uuid}(n,i,d,o))O(c),t.replaceChild(b(n),c),C(i,"unmounted"),C(n,"mounted");else if(n.element){!function(e,t,n){for(var i=0,r=Object.entries(t.attributes);i<r.length;i+=1){var u=r[i],d=u[0],o=u[1],s=n.attributes?n.attributes[d]:void 0;"style"===d?(void 0,void 0,h=typeof(f=s),"object"===(c=typeof(a=o))&&"object"===h&&JSON.stringify(a)===JSON.stringify(f)||"undefined"===c&&"undefined"===h||(e.removeAttribute("style"),m(o,e))):"events"===d?(O(e),p(o,e)):"value"===d&&o!==s?e.value=o:s&&o===s||e.setAttribute(d,o)}var a,f,c,h}(c,n,i),C(n,"updated");var h=n.children?n.children.length:0,v=i.children?i.children.length:0;if(h<v)for(var l=v-1;l>0;l--)if(void 0===n.children[l]){var g=c.lastChild;O(g),g&&g.remove(),C(i.children[l],"unmounted")}for(var j=0;j<h;j++)e(c,n.children[j],i.children[j],j)}}else O(c),t.replaceChild(b(n),c),C(i,"unmounted");else O(c),t.replaceChild(b(n),c),C(n,"mounted");function O(e){if(e&&e.getAttribute){var t=e.getAttribute("data-"+u);t&&delete s[t]}}function C(e,t){if(e&&e.uuid){var n=a[e.uuid][t];n&&(f.push(n),y())}}}(e,r,d,0)}function y(){var e=new Event("__LITERAL_LIFECYCLE__");return window.dispatchEvent(e)}function j(){return Math.random().toString(36).substring(2)+(new Date).getTime().toString(36)}export default{component:v,render:h,h:c};export{c as h,h as render,v 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=[];function c(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]=c(e.children[i]);return e}}function h(e,t){void 0===t&&(t=!1);var n=typeof e;if("undefined"===n)return!1;if("string"===n||"number"===n)return document.createTextNode(e);if("boolean"===n)return document.createTextNode("");var i=document.createElement(e.element);if(t&&e.element&&e.uuid&&function(e){var t=a[e];t.mounted&&f.push(t.mounted);m()}(e.uuid),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?l(s,i):"style"===o?v(s,i):i.setAttribute(o,s)}if(e.children&&e.children.length)for(var c=0;c<e.children.length;c++)i.appendChild(h(e.children[c],t));return i}function l(t,n){if(n){!function(t){for(var n=Object.keys(t),i=0;i<n.length;i++)d.push(n[i]);!function(){var t;for(;t=d.pop();)o.includes(t)||(o.push(t),e.addEventListener(t,function(e){var t=e.target.getAttribute("data-"+u);if(t&&s[t]){var n=e.type,i=s[t][n];i&&i(e)}}))}()}(t);var i=p();n.setAttribute("data-"+u,i),s[i]=t}}function v(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 b(i){var r=c(t()),d=Object.assign({},n);return n=Object.assign({},r),function e(t,n,i,r){void 0===r&&(r=0);if(!t)return;var d=typeof n;var o=typeof i;var c=t.childNodes[r];if("undefined"===o)t.appendChild(h(n)),C(n,"mounted");else if("undefined"===d)O(c),t.removeChild(c),C(i,"unmounted");else if(!1!==i||!n.element&&"string"!==d&&"number"!==d)if(!1!==n||!i.element&&"string"!==o&&"number"!==o){if(function(e,t,n,i){return n!==i||"string"===n&&e!==t||e.element!==t.element}(n,i,d,o))O(c),t.replaceChild(h(n),c),C(i,"unmounted"),C(n,"mounted");else if(n.element){!function(e,t,n){for(var i=0,r=Object.entries(t.attributes);i<r.length;i+=1){var u=r[i],d=u[0],o=u[1],s=n.attributes?n.attributes[d]:void 0;"style"===d?(void 0,void 0,h=typeof(f=s),"object"===(c=typeof(a=o))&&"object"===h&&JSON.stringify(a)===JSON.stringify(f)||"undefined"===c&&"undefined"===h||(e.removeAttribute("style"),v(o,e))):"events"===d?(O(e),l(o,e)):"value"===d&&o!==s?e.value=o:s&&o===s||e.setAttribute(d,o)}var a,f,c,h}(c,n,i),n.uuid===i.uuid?C(n,"updated"):n.uuid!==i.uuid&&(C(i,"unmounted"),C(n,"mounted"));var b=n.children?n.children.length:0,p=c.childNodes.length;if(b<p)for(var g=p-1;g>0;g--)if(void 0===n.children[g]){var y=c.lastChild;O(y),y.remove(),C(i.children[g],"unmounted")}for(var j=0;j<b;j++)e(c,n.children[j],i.children[j],j)}}else O(c),t.replaceChild(h(n),c),C(i,"unmounted");else O(c),t.replaceChild(h(n),c),C(n,"mounted");function O(e){if(e&&e.getAttribute){var t=e.getAttribute("data-"+u);t&&delete s[t]}}function C(e,t){if(e&&e.uuid){var n=a[e.uuid][t];n&&(f.push(n),m())}}}(e,r,d,0)}function m(){var e=new Event("__LITERAL_LIFECYCLE__");return window.dispatchEvent(e)}function p(){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=p();return r[f]=t,function(e){return void 0===e&&(e={}),{uuid:f,render:function(){for(var t in this.uuid=f,this.props=e,this.mounted=n.bind(this),this.updated=u.bind(this),this.unmounted=d.bind(this),a[this.uuid]={mounted:this.mounted,updated:this.updated,unmounted:this.unmounted},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,b()}.bind(this),this.getStore=function(){return Object.assign({},i)},this.setStore=function(e){var t=Object.assign({},this.getStore(),e);i=t,b()}.bind(this),"function"==typeof o&&(o=o.bind(this)()),o)this[t]=o[t].bind(this);return s.bind(this)()}}}},render:function(r,u,d){void 0===d&&(d={}),i=Object.assign({},i,d),e=document.getElementById(u);var o=c(r());function s(){for(var e;e=f.pop();)e()}t=r,n=Object.assign({},o),e.appendChild(h(o,!0)),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="euid",d=[],o=[],s={},a={},f=[];function c(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]=c(e.children[i]);return e}}function h(e,t){void 0===t&&(t=!1);var n=typeof e;if("string"===n||"number"===n)return document.createTextNode(e);if("boolean"===n||"undefined"===n)return document.createTextNode("");var i,r=document.createElement(e.element);if(t&&e.element&&e.uuid&&function(e){var t=a[e];t.mounted&&f.push(t.mounted);p()}(e.uuid),e.attributes&&"object"==typeof e.attributes)for(var u=0,d=Object.entries(e.attributes);u<d.length;u+=1){var o=d[u],s=o[0],c=o[1];"events"===s?l(c,r):"style"===s?v(c,r):r.setAttribute(s,c)}if(e.children&&e.children.length)for(var b=0;b<e.children.length;b++)i=h(e.children[b],t),r.appendChild(i);return r}function l(t,n){if(n){!function(t){for(var n=Object.keys(t),i=0;i<n.length;i++)d.push(n[i]);!function(){var t;for(;t=d.pop();)o.includes(t)||(o.push(t),e.addEventListener(t,function(e){var t=e.target.getAttribute("data-"+u);if(t&&s[t]){var n=e.type,i=s[t][n];i&&i(e)}}))}()}(t);var i=m();n.setAttribute("data-"+u,i),s[i]=t}}function v(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 b(i){var r=c(t()),d=Object.assign({},n);return n=Object.assign({},r),function e(t,n,i,r){void 0===r&&(r=0);if(!t)return;var d=typeof n;var o=typeof i;var c=t.childNodes[r];if(!c)return;if("undefined"===o)t.appendChild(h(n)),C(n,"mounted");else if("undefined"===d)O(c),t.removeChild(c),C(i,"unmounted");else if(!1!==i||!n.element&&"string"!==d&&"number"!==d)if(!1!==n||!i.element&&"string"!==o&&"number"!==o){if(function(e,t,n,i){return n!==i||"string"===n&&e!==t||e.element!==t.element||e.uuid&&t.uuid&&e.uuid!==t.uuid}(n,i,d,o))O(c),t.replaceChild(h(n),c),C(i,"unmounted"),C(n,"mounted");else if(n.element){!function(e,t,n){for(var i=0,r=Object.entries(t.attributes);i<r.length;i+=1){var u=r[i],d=u[0],o=u[1],s=n.attributes?n.attributes[d]:void 0;"style"===d?(void 0,void 0,h=typeof(f=s),"object"===(c=typeof(a=o))&&"object"===h&&JSON.stringify(a)===JSON.stringify(f)||"undefined"===c&&"undefined"===h||(e.removeAttribute("style"),v(o,e))):"events"===d?(O(e),l(o,e)):"value"===d&&o!==s?e.value=o:s&&o===s||e.setAttribute(d,o)}var a,f,c,h}(c,n,i),C(n,"updated");var b=n.children?n.children.length:0,m=i.children?i.children.length:0;if(b<m)for(var g=m-1;g>0;g--)if(void 0===n.children[g]){var y=c.lastChild;O(y),y&&y.remove(),C(i.children[g],"unmounted")}for(var j=0;j<b;j++)e(c,n.children[j],i.children[j],j)}}else O(c),t.replaceChild(h(n),c),C(i,"unmounted");else O(c),t.replaceChild(h(n),c),C(n,"mounted");function O(e){if(e&&e.getAttribute){var t=e.getAttribute("data-"+u);t&&delete s[t]}}function C(e,t){if(e&&e.uuid){var n=a[e.uuid][t];n&&(f.push(n),p())}}}(e,r,d,0)}function p(){var e=new Event("__LITERAL_LIFECYCLE__");return window.dispatchEvent(e)}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(){for(var t in this.uuid=f,this.props=e,this.mounted=n.bind(this),this.updated=u.bind(this),this.unmounted=d.bind(this),a[this.uuid]={mounted:this.mounted,updated:this.updated,unmounted:this.unmounted},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,b()}.bind(this),this.getStore=function(){return Object.assign({},i)},this.setStore=function(e){var t=Object.assign({},this.getStore(),e);i=t,b()}.bind(this),"function"==typeof o&&(o=o.bind(this)()),o)this[t]=o[t].bind(this);return s.bind(this)()}}}},render:function(r,u,d){void 0===d&&(d={}),i=Object.assign({},i,d),e=document.getElementById(u);var o=c(r());function s(){for(var e;e=f.pop();)e()}t=r,n=Object.assign({},o),e.appendChild(h(o,!0)),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,[])}}}}); | ||
//# sourceMappingURL=index.umd.js.map |
{ | ||
"name": "literaljs", | ||
"version": "5.1.0", | ||
"version": "5.1.1", | ||
"description": "A small JavaScript library for building reactive user interfaces.", | ||
@@ -5,0 +5,0 @@ "main": "build/index.js", |
@@ -12,7 +12,7 @@ <p align="center"> | ||
Recent 5.1.0 microbundle: | ||
Recent 5.1.1 microbundle: | ||
```js | ||
$ microbundle | ||
Build output to build: | ||
1.8 kB: index.js | ||
1.81 kB: index.js | ||
1.83 kB: index.m.js | ||
@@ -19,0 +19,0 @@ 1.86 kB: index.umd.js |
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
401976