Socket
Socket
Sign inDemoInstall

@neuronet.io/vido

Package Overview
Dependencies
Maintainers
1
Versions
212
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@neuronet.io/vido - npm Package Compare versions

Comparing version 1.0.6 to 1.0.7

2

package.json
{
"name": "@neuronet.io/vido",
"version": "1.0.6",
"version": "1.0.7",
"description": "Compilation-less and eval free frontend framework for fast scalable apps.",

@@ -5,0 +5,0 @@ "main": "vido.js",

@@ -147,3 +147,3 @@ /**

* http://polymer.github.io/PATENTS.txt
*/export default function(e,n){let s=0;const o={};let i,r,a=[],l=0;const c=Promise.resolve();function d(e){return t((function(t,n){return function(s){const o=s.committer.element;for(const s of t)if("function"==typeof s){const t=a.find(t=>t.instance===e&&t.componentAction.create===s&&t.element===o);if(t)t.props=n;else{void 0!==o.__vido__&&delete o.__vido__;const t={create:s,update(){},destroy(){}};a.push({instance:e,componentAction:t,element:o,props:n})}}}}))}const u={state:e,api:n,html:R,svg:O,directive:t,asyncAppend:F,asyncReplace:j,cache:q,classMap:G,guard:K,ifDefined:Q,repeat:se,styleMap:ie,unsafeHTML:ae,until:ce,actions(e,t){},onDestroy(){},onChange(e){},createComponent(e,t){const n=s++,i=function(e){return{instance:e,destroy:()=>u.destroyComponent(e),update:()=>u.updateTemplate(),change(t){o[e].change(t)},html:(t={})=>o[e].update(t)}}(n);const r=[];const a=[];const l={destroy(){for(const e of r)e()},update:e(Object.assign(Object.assign({},u),{update:function(){u.updateTemplate()},onDestroy:function(e){r.push(e)},onChange:function(e){a.push(e)},instance:n,actions:d(n)}),t),change(e){for(const t of a)t(e)}};return o[n]=l,o[n].change(t),i},destroyComponent(e){"function"==typeof o[e].destroy&&o[e].destroy(),a=a.filter(t=>(t.instance===e&&"function"==typeof t.componentAction.destroy&&t.componentAction.destroy(t.element,t.props),t.instance!==e)),delete o[e]},updateTemplate(){const e=++l,t=this;c.then((function(){e===l&&(t.render(),l=0)}))},createApp(e,t){r=t;const n=this.createComponent(e);return i=n.instance,this.render(),n},executeActions(){for(const e of a)if(void 0===e.element.__vido__){if("function"==typeof e.componentAction.create){const t=e.componentAction.create(e.element,e.props);void 0!==t&&("function"==typeof t.update&&(e.componentAction.update=t.update),"function"==typeof t.destroy&&(e.componentAction.destroy=t.destroy))}}else"function"==typeof e.componentAction.update&&e.componentAction.update(e.element,e.props);for(const e of a)e.element.__vido__={instance:e.instance,props:e.props}},render(){H(o[i].update(),r),u.executeActions()}};return u}
*/export default function(e,n){let s=0;const o={};let i,r,a=[],l=0;const c=Promise.resolve();function d(e){return t((function(t,n){return function(s){const o=s.committer.element;for(const s of t)if("function"==typeof s){const t=a.find(t=>t.instance===e&&t.componentAction.create===s&&t.element===o);if(t)t.props=n;else{void 0!==o.__vido__&&delete o.__vido__;const t={create:s,update(){},destroy(){}};a.push({instance:e,componentAction:t,element:o,props:n})}}}}))}const u={state:e,api:n,html:R,svg:O,directive:t,asyncAppend:F,asyncReplace:j,cache:q,classMap:G,guard:K,ifDefined:Q,repeat:se,styleMap:ie,unsafeHTML:ae,until:ce,actions(e,t){},onDestroy(){},onChange(e){},createComponent(e,t){const n=s++,i=function(e){return{instance:e,destroy:()=>u.destroyComponent(e),update:()=>u.updateTemplate(),change(t){o[e]&&o[e].change(t)},html(t={}){if(o[e])return o[e].update(t)}}}(n);const r=[];const a=[];const l={destroy(){for(const e of r)e()},update:e(Object.assign(Object.assign({},u),{update:function(){u.updateTemplate()},onDestroy:function(e){r.push(e)},onChange:function(e){a.push(e)},instance:n,actions:d(n)}),t),change(e){for(const n in t)if(e[n]===t[n])return;for(const t of a)t(e)}};return o[n]=l,o[n].change(t),i},destroyComponent(e){"function"==typeof o[e].destroy&&o[e].destroy(),a=a.filter(t=>(t.instance===e&&"function"==typeof t.componentAction.destroy&&t.componentAction.destroy(t.element,t.props),t.instance!==e)),delete o[e]},updateTemplate(){const e=++l,t=this;c.then((function(){e===l&&(t.render(),l=0)}))},createApp(e,t){r=t;const n=this.createComponent(e);return i=n.instance,this.render(),n},executeActions(){for(const e of a)if(void 0===e.element.__vido__){if("function"==typeof e.componentAction.create){const t=e.componentAction.create(e.element,e.props);void 0!==t&&("function"==typeof t.update&&(e.componentAction.update=t.update),"function"==typeof t.destroy&&(e.componentAction.destroy=t.destroy))}}else"function"==typeof e.componentAction.update&&e.componentAction.update(e.element,e.props);for(const e of a)e.element.__vido__={instance:e.instance,props:e.props}},render(){H(o[i].update(),r),u.executeActions()}};return u}
//# sourceMappingURL=vido.esm.min.js.map

@@ -14,3 +14,3 @@ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).Vido=t()}(this,(function(){"use strict";

* http://polymer.github.io/PATENTS.txt
*/const e=new WeakMap,t=t=>(...n)=>{const s=t(...n);return e.set(s,!0),s},n=t=>"function"==typeof t&&e.has(t),s=void 0!==window.customElements&&void 0!==window.customElements.polyfillWrapFlushCallback,o=(e,t,n=null,s=null)=>{for(;t!==n;){const n=t.nextSibling;e.insertBefore(t,s),t=n}},i=(e,t,n=null)=>{for(;t!==n;){const n=t.nextSibling;e.removeChild(t),t=n}},r={},a={},l=`{{lit-${String(Math.random()).slice(2)}}}`,c=`\x3c!--${l}--\x3e`,d=new RegExp(`${l}|${c}`),u="$lit$";class h{constructor(e,t){this.parts=[],this.element=t;const n=[],s=[],o=document.createTreeWalker(t.content,133,null,!1);let i=0,r=-1,a=0;const{strings:c,values:{length:h}}=e;for(;a<h;){const e=o.nextNode();if(null!==e){if(r++,1===e.nodeType){if(e.hasAttributes()){const t=e.attributes,{length:n}=t;let s=0;for(let e=0;e<n;e++)p(t[e].name,u)&&s++;for(;s-- >0;){const t=c[a],n=v.exec(t)[2],s=n.toLowerCase()+u,o=e.getAttribute(s);e.removeAttribute(s);const i=o.split(d);this.parts.push({type:"attribute",index:r,name:n,strings:i}),a+=i.length-1}}"TEMPLATE"===e.tagName&&(s.push(e),o.currentNode=e.content)}else if(3===e.nodeType){const t=e.data;if(t.indexOf(l)>=0){const s=e.parentNode,o=t.split(d),i=o.length-1;for(let t=0;t<i;t++){let n,i=o[t];if(""===i)n=f();else{const e=v.exec(i);null!==e&&p(e[2],u)&&(i=i.slice(0,e.index)+e[1]+e[2].slice(0,-u.length)+e[3]),n=document.createTextNode(i)}s.insertBefore(n,e),this.parts.push({type:"node",index:++r})}""===o[i]?(s.insertBefore(f(),e),n.push(e)):e.data=o[i],a+=i}}else if(8===e.nodeType)if(e.data===l){const t=e.parentNode;null!==e.previousSibling&&r!==i||(r++,t.insertBefore(f(),e)),i=r,this.parts.push({type:"node",index:r}),null===e.nextSibling?e.data="":(n.push(e),r--),a++}else{let t=-1;for(;-1!==(t=e.data.indexOf(l,t+1));)this.parts.push({type:"node",index:-1}),a++}}else o.currentNode=s.pop()}for(const e of n)e.parentNode.removeChild(e)}}const p=(e,t)=>{const n=e.length-t.length;return n>=0&&e.slice(n)===t},m=e=>-1!==e.index,f=()=>document.createComment(""),v=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/;
*/const e=new WeakMap,t=t=>(...n)=>{const s=t(...n);return e.set(s,!0),s},n=t=>"function"==typeof t&&e.has(t),s=void 0!==window.customElements&&void 0!==window.customElements.polyfillWrapFlushCallback,o=(e,t,n=null,s=null)=>{for(;t!==n;){const n=t.nextSibling;e.insertBefore(t,s),t=n}},i=(e,t,n=null)=>{for(;t!==n;){const n=t.nextSibling;e.removeChild(t),t=n}},r={},a={},l=`{{lit-${String(Math.random()).slice(2)}}}`,c=`\x3c!--${l}--\x3e`,d=new RegExp(`${l}|${c}`),u="$lit$";class h{constructor(e,t){this.parts=[],this.element=t;const n=[],s=[],o=document.createTreeWalker(t.content,133,null,!1);let i=0,r=-1,a=0;const{strings:c,values:{length:h}}=e;for(;a<h;){const e=o.nextNode();if(null!==e){if(r++,1===e.nodeType){if(e.hasAttributes()){const t=e.attributes,{length:n}=t;let s=0;for(let e=0;e<n;e++)p(t[e].name,u)&&s++;for(;s-- >0;){const t=c[a],n=v.exec(t)[2],s=n.toLowerCase()+u,o=e.getAttribute(s);e.removeAttribute(s);const i=o.split(d);this.parts.push({type:"attribute",index:r,name:n,strings:i}),a+=i.length-1}}"TEMPLATE"===e.tagName&&(s.push(e),o.currentNode=e.content)}else if(3===e.nodeType){const t=e.data;if(t.indexOf(l)>=0){const s=e.parentNode,o=t.split(d),i=o.length-1;for(let t=0;t<i;t++){let n,i=o[t];if(""===i)n=m();else{const e=v.exec(i);null!==e&&p(e[2],u)&&(i=i.slice(0,e.index)+e[1]+e[2].slice(0,-u.length)+e[3]),n=document.createTextNode(i)}s.insertBefore(n,e),this.parts.push({type:"node",index:++r})}""===o[i]?(s.insertBefore(m(),e),n.push(e)):e.data=o[i],a+=i}}else if(8===e.nodeType)if(e.data===l){const t=e.parentNode;null!==e.previousSibling&&r!==i||(r++,t.insertBefore(m(),e)),i=r,this.parts.push({type:"node",index:r}),null===e.nextSibling?e.data="":(n.push(e),r--),a++}else{let t=-1;for(;-1!==(t=e.data.indexOf(l,t+1));)this.parts.push({type:"node",index:-1}),a++}}else o.currentNode=s.pop()}for(const e of n)e.parentNode.removeChild(e)}}const p=(e,t)=>{const n=e.length-t.length;return n>=0&&e.slice(n)===t},f=e=>-1!==e.index,m=()=>document.createComment(""),v=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/;
/**

@@ -29,3 +29,3 @@ * @license

*/
class g{constructor(e,t,n){this.__parts=[],this.template=e,this.processor=t,this.options=n}update(e){let t=0;for(const n of this.__parts)void 0!==n&&n.setValue(e[t]),t++;for(const e of this.__parts)void 0!==e&&e.commit()}_clone(){const e=s?this.template.element.content.cloneNode(!0):document.importNode(this.template.element.content,!0),t=[],n=this.template.parts,o=document.createTreeWalker(e,133,null,!1);let i,r=0,a=0,l=o.nextNode();for(;r<n.length;)if(i=n[r],m(i)){for(;a<i.index;)a++,"TEMPLATE"===l.nodeName&&(t.push(l),o.currentNode=l.content),null===(l=o.nextNode())&&(o.currentNode=t.pop(),l=o.nextNode());if("node"===i.type){const e=this.processor.handleTextExpression(this.options);e.insertAfterNode(l.previousSibling),this.__parts.push(e)}else this.__parts.push(...this.processor.handleAttributeExpressions(l,i.name,i.strings,this.options));r++}else this.__parts.push(void 0),r++;return s&&(document.adoptNode(e),customElements.upgrade(e)),e}}
class g{constructor(e,t,n){this.__parts=[],this.template=e,this.processor=t,this.options=n}update(e){let t=0;for(const n of this.__parts)void 0!==n&&n.setValue(e[t]),t++;for(const e of this.__parts)void 0!==e&&e.commit()}_clone(){const e=s?this.template.element.content.cloneNode(!0):document.importNode(this.template.element.content,!0),t=[],n=this.template.parts,o=document.createTreeWalker(e,133,null,!1);let i,r=0,a=0,l=o.nextNode();for(;r<n.length;)if(i=n[r],f(i)){for(;a<i.index;)a++,"TEMPLATE"===l.nodeName&&(t.push(l),o.currentNode=l.content),null===(l=o.nextNode())&&(o.currentNode=t.pop(),l=o.nextNode());if("node"===i.type){const e=this.processor.handleTextExpression(this.options);e.insertAfterNode(l.previousSibling),this.__parts.push(e)}else this.__parts.push(...this.processor.handleAttributeExpressions(l,i.name,i.strings,this.options));r++}else this.__parts.push(void 0),r++;return s&&(document.adoptNode(e),customElements.upgrade(e)),e}}
/**

@@ -56,3 +56,3 @@ * @license

* http://polymer.github.io/PATENTS.txt
*/const w=e=>null===e||!("object"==typeof e||"function"==typeof e),N=e=>Array.isArray(e)||!(!e||!e[Symbol.iterator]);class b{constructor(e,t,n){this.dirty=!0,this.element=e,this.name=t,this.strings=n,this.parts=[];for(let e=0;e<n.length-1;e++)this.parts[e]=this._createPart()}_createPart(){return new V(this)}_getValue(){const e=this.strings,t=e.length-1;let n="";for(let s=0;s<t;s++){n+=e[s];const t=this.parts[s];if(void 0!==t){const e=t.value;if(w(e)||!N(e))n+="string"==typeof e?e:String(e);else for(const t of e)n+="string"==typeof t?t:String(t)}}return n+=e[t]}commit(){this.dirty&&(this.dirty=!1,this.element.setAttribute(this.name,this._getValue()))}}class V{constructor(e){this.value=void 0,this.committer=e}setValue(e){e===r||w(e)&&e===this.value||(this.value=e,n(e)||(this.committer.dirty=!0))}commit(){for(;n(this.value);){const e=this.value;this.value=r,e(this)}this.value!==r&&this.committer.commit()}}class A{constructor(e){this.value=void 0,this.__pendingValue=void 0,this.options=e}appendInto(e){this.startNode=e.appendChild(f()),this.endNode=e.appendChild(f())}insertAfterNode(e){this.startNode=e,this.endNode=e.nextSibling}appendIntoPart(e){e.__insert(this.startNode=f()),e.__insert(this.endNode=f())}insertAfterPart(e){e.__insert(this.startNode=f()),this.endNode=e.endNode,e.endNode=this.startNode}setValue(e){this.__pendingValue=e}commit(){for(;n(this.__pendingValue);){const e=this.__pendingValue;this.__pendingValue=r,e(this)}const e=this.__pendingValue;e!==r&&(w(e)?e!==this.value&&this.__commitText(e):e instanceof y?this.__commitTemplateResult(e):e instanceof Node?this.__commitNode(e):N(e)?this.__commitIterable(e):e===a?(this.value=a,this.clear()):this.__commitText(e))}__insert(e){this.endNode.parentNode.insertBefore(e,this.endNode)}__commitNode(e){this.value!==e&&(this.clear(),this.__insert(e),this.value=e)}__commitText(e){const t=this.startNode.nextSibling,n="string"==typeof(e=null==e?"":e)?e:String(e);t===this.endNode.previousSibling&&3===t.nodeType?t.data=n:this.__commitNode(document.createTextNode(n)),this.value=e}__commitTemplateResult(e){const t=this.options.templateFactory(e);if(this.value instanceof g&&this.value.template===t)this.value.update(e.values);else{const n=new g(t,e.processor,this.options),s=n._clone();n.update(e.values),this.__commitNode(s),this.value=n}}__commitIterable(e){Array.isArray(this.value)||(this.value=[],this.clear());const t=this.value;let n,s=0;for(const o of e)void 0===(n=t[s])&&(n=new A(this.options),t.push(n),0===s?n.appendIntoPart(this):n.insertAfterPart(t[s-1])),n.setValue(o),n.commit(),s++;s<t.length&&(t.length=s,this.clear(n&&n.endNode))}clear(e=this.startNode){i(this.startNode.parentNode,e.nextSibling,this.endNode)}}class T{constructor(e,t,n){if(this.value=void 0,this.__pendingValue=void 0,2!==n.length||""!==n[0]||""!==n[1])throw new Error("Boolean attributes can only contain a single expression");this.element=e,this.name=t,this.strings=n}setValue(e){this.__pendingValue=e}commit(){for(;n(this.__pendingValue);){const e=this.__pendingValue;this.__pendingValue=r,e(this)}if(this.__pendingValue===r)return;const e=!!this.__pendingValue;this.value!==e&&(e?this.element.setAttribute(this.name,""):this.element.removeAttribute(this.name),this.value=e),this.__pendingValue=r}}class E extends b{constructor(e,t,n){super(e,t,n),this.single=2===n.length&&""===n[0]&&""===n[1]}_createPart(){return new M(this)}_getValue(){return this.single?this.parts[0].value:super._getValue()}commit(){this.dirty&&(this.dirty=!1,this.element[this.name]=this._getValue())}}class M extends V{}let S=!1;try{const e={get capture(){return S=!0,!1}};window.addEventListener("test",e,e),window.removeEventListener("test",e,e)}catch(e){}class I{constructor(e,t,n){this.value=void 0,this.__pendingValue=void 0,this.element=e,this.eventName=t,this.eventContext=n,this.__boundHandleEvent=e=>this.handleEvent(e)}setValue(e){this.__pendingValue=e}commit(){for(;n(this.__pendingValue);){const e=this.__pendingValue;this.__pendingValue=r,e(this)}if(this.__pendingValue===r)return;const e=this.__pendingValue,t=this.value,s=null==e||null!=t&&(e.capture!==t.capture||e.once!==t.once||e.passive!==t.passive),o=null!=e&&(null==t||s);s&&this.element.removeEventListener(this.eventName,this.__boundHandleEvent,this.__options),o&&(this.__options=k(e),this.element.addEventListener(this.eventName,this.__boundHandleEvent,this.__options)),this.value=e,this.__pendingValue=r}handleEvent(e){"function"==typeof this.value?this.value.call(this.eventContext||this.element,e):this.value.handleEvent(e)}}const k=e=>e&&(S?{capture:e.capture,passive:e.passive,once:e.once}:e.capture);
*/const w=e=>null===e||!("object"==typeof e||"function"==typeof e),N=e=>Array.isArray(e)||!(!e||!e[Symbol.iterator]);class b{constructor(e,t,n){this.dirty=!0,this.element=e,this.name=t,this.strings=n,this.parts=[];for(let e=0;e<n.length-1;e++)this.parts[e]=this._createPart()}_createPart(){return new V(this)}_getValue(){const e=this.strings,t=e.length-1;let n="";for(let s=0;s<t;s++){n+=e[s];const t=this.parts[s];if(void 0!==t){const e=t.value;if(w(e)||!N(e))n+="string"==typeof e?e:String(e);else for(const t of e)n+="string"==typeof t?t:String(t)}}return n+=e[t]}commit(){this.dirty&&(this.dirty=!1,this.element.setAttribute(this.name,this._getValue()))}}class V{constructor(e){this.value=void 0,this.committer=e}setValue(e){e===r||w(e)&&e===this.value||(this.value=e,n(e)||(this.committer.dirty=!0))}commit(){for(;n(this.value);){const e=this.value;this.value=r,e(this)}this.value!==r&&this.committer.commit()}}class A{constructor(e){this.value=void 0,this.__pendingValue=void 0,this.options=e}appendInto(e){this.startNode=e.appendChild(m()),this.endNode=e.appendChild(m())}insertAfterNode(e){this.startNode=e,this.endNode=e.nextSibling}appendIntoPart(e){e.__insert(this.startNode=m()),e.__insert(this.endNode=m())}insertAfterPart(e){e.__insert(this.startNode=m()),this.endNode=e.endNode,e.endNode=this.startNode}setValue(e){this.__pendingValue=e}commit(){for(;n(this.__pendingValue);){const e=this.__pendingValue;this.__pendingValue=r,e(this)}const e=this.__pendingValue;e!==r&&(w(e)?e!==this.value&&this.__commitText(e):e instanceof y?this.__commitTemplateResult(e):e instanceof Node?this.__commitNode(e):N(e)?this.__commitIterable(e):e===a?(this.value=a,this.clear()):this.__commitText(e))}__insert(e){this.endNode.parentNode.insertBefore(e,this.endNode)}__commitNode(e){this.value!==e&&(this.clear(),this.__insert(e),this.value=e)}__commitText(e){const t=this.startNode.nextSibling,n="string"==typeof(e=null==e?"":e)?e:String(e);t===this.endNode.previousSibling&&3===t.nodeType?t.data=n:this.__commitNode(document.createTextNode(n)),this.value=e}__commitTemplateResult(e){const t=this.options.templateFactory(e);if(this.value instanceof g&&this.value.template===t)this.value.update(e.values);else{const n=new g(t,e.processor,this.options),s=n._clone();n.update(e.values),this.__commitNode(s),this.value=n}}__commitIterable(e){Array.isArray(this.value)||(this.value=[],this.clear());const t=this.value;let n,s=0;for(const o of e)void 0===(n=t[s])&&(n=new A(this.options),t.push(n),0===s?n.appendIntoPart(this):n.insertAfterPart(t[s-1])),n.setValue(o),n.commit(),s++;s<t.length&&(t.length=s,this.clear(n&&n.endNode))}clear(e=this.startNode){i(this.startNode.parentNode,e.nextSibling,this.endNode)}}class T{constructor(e,t,n){if(this.value=void 0,this.__pendingValue=void 0,2!==n.length||""!==n[0]||""!==n[1])throw new Error("Boolean attributes can only contain a single expression");this.element=e,this.name=t,this.strings=n}setValue(e){this.__pendingValue=e}commit(){for(;n(this.__pendingValue);){const e=this.__pendingValue;this.__pendingValue=r,e(this)}if(this.__pendingValue===r)return;const e=!!this.__pendingValue;this.value!==e&&(e?this.element.setAttribute(this.name,""):this.element.removeAttribute(this.name),this.value=e),this.__pendingValue=r}}class E extends b{constructor(e,t,n){super(e,t,n),this.single=2===n.length&&""===n[0]&&""===n[1]}_createPart(){return new M(this)}_getValue(){return this.single?this.parts[0].value:super._getValue()}commit(){this.dirty&&(this.dirty=!1,this.element[this.name]=this._getValue())}}class M extends V{}let S=!1;try{const e={get capture(){return S=!0,!1}};window.addEventListener("test",e,e),window.removeEventListener("test",e,e)}catch(e){}class I{constructor(e,t,n){this.value=void 0,this.__pendingValue=void 0,this.element=e,this.eventName=t,this.eventContext=n,this.__boundHandleEvent=e=>this.handleEvent(e)}setValue(e){this.__pendingValue=e}commit(){for(;n(this.__pendingValue);){const e=this.__pendingValue;this.__pendingValue=r,e(this)}if(this.__pendingValue===r)return;const e=this.__pendingValue,t=this.value,s=null==e||null!=t&&(e.capture!==t.capture||e.once!==t.once||e.passive!==t.passive),o=null!=e&&(null==t||s);s&&this.element.removeEventListener(this.eventName,this.__boundHandleEvent,this.__options),o&&(this.__options=k(e),this.element.addEventListener(this.eventName,this.__boundHandleEvent,this.__options)),this.value=e,this.__pendingValue=r}handleEvent(e){"function"==typeof this.value?this.value.call(this.eventContext||this.element,e):this.value.handleEvent(e)}}const k=e=>e&&(S?{capture:e.capture,passive:e.passive,once:e.once}:e.capture);
/**

@@ -124,3 +124,3 @@ * @license

*/
var B=function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e="function"==typeof __values?__values(e):e[Symbol.iterator](),t={},s("next"),s("throw"),s("return"),t[Symbol.asyncIterator]=function(){return this},t);function s(n){t[n]=e[n]&&function(t){return new Promise((function(s,o){(function(e,t,n,s){Promise.resolve(s).then((function(t){e({value:t,done:n})}),t)})(s,o,(t=e[n](t)).done,t.value)}))}}};const F=t((e,t)=>async n=>{var s,o;if(!(n instanceof A))throw new Error("asyncAppend can only be used in text bindings");if(e===n.value)return;let i;n.value=e;let r=0;try{for(var a,l=B(e);!(a=await l.next()).done;){let s=a.value;if(n.value!==e)break;0===r&&n.clear(),void 0!==t&&(s=t(s,r));let o=n.startNode;void 0!==i&&(o=f(),i.endNode=o,n.endNode.parentNode.insertBefore(o,n.endNode)),(i=new A(n.options)).insertAfterNode(o),i.setValue(s),i.commit(),r++}}catch(e){s={error:e}}finally{try{a&&!a.done&&(o=l.return)&&await o.call(l)}finally{if(s)throw s.error}}});
var B=function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e="function"==typeof __values?__values(e):e[Symbol.iterator](),t={},s("next"),s("throw"),s("return"),t[Symbol.asyncIterator]=function(){return this},t);function s(n){t[n]=e[n]&&function(t){return new Promise((function(s,o){(function(e,t,n,s){Promise.resolve(s).then((function(t){e({value:t,done:n})}),t)})(s,o,(t=e[n](t)).done,t.value)}))}}};const F=t((e,t)=>async n=>{var s,o;if(!(n instanceof A))throw new Error("asyncAppend can only be used in text bindings");if(e===n.value)return;let i;n.value=e;let r=0;try{for(var a,l=B(e);!(a=await l.next()).done;){let s=a.value;if(n.value!==e)break;0===r&&n.clear(),void 0!==t&&(s=t(s,r));let o=n.startNode;void 0!==i&&(o=m(),i.endNode=o,n.endNode.parentNode.insertBefore(o,n.endNode)),(i=new A(n.options)).insertAfterNode(o),i.setValue(s),i.commit(),r++}}catch(e){s={error:e}}finally{try{a&&!a.done&&(o=l.return)&&await o.call(l)}finally{if(s)throw s.error}}});
/**

@@ -138,3 +138,3 @@ * @license

* http://polymer.github.io/PATENTS.txt
*/var $=function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e="function"==typeof __values?__values(e):e[Symbol.iterator](),t={},s("next"),s("throw"),s("return"),t[Symbol.asyncIterator]=function(){return this},t);function s(n){t[n]=e[n]&&function(t){return new Promise((function(s,o){(function(e,t,n,s){Promise.resolve(s).then((function(t){e({value:t,done:n})}),t)})(s,o,(t=e[n](t)).done,t.value)}))}}};const j=t((e,t)=>async n=>{var s,o;if(!(n instanceof A))throw new Error("asyncReplace can only be used in text bindings");if(e===n.value)return;const i=new A(n.options);n.value=e;let r=0;try{for(var a,l=$(e);!(a=await l.next()).done;){let s=a.value;if(n.value!==e)break;0===r&&(n.clear(),i.appendIntoPart(n)),void 0!==t&&(s=t(s,r)),i.setValue(s),i.commit(),r++}}catch(e){s={error:e}}finally{try{a&&!a.done&&(o=l.return)&&await o.call(l)}finally{if(s)throw s.error}}}),D=new WeakMap,q=t(e=>t=>{if(!(t instanceof A))throw new Error("cache can only be used in text bindings");let n=D.get(t);void 0===n&&(n=new WeakMap,D.set(t,n));const s=t.value;if(s instanceof g){if(e instanceof y&&s.template===t.options.templateFactory(e))return void t.setValue(e);{let e=n.get(s.template);void 0===e&&(e={instance:s,nodes:document.createDocumentFragment()},n.set(s.template,e)),o(e.nodes,t.startNode.nextSibling,t.endNode)}}if(e instanceof y){const s=t.options.templateFactory(e),o=n.get(s);void 0!==o&&(t.setValue(o.nodes),t.commit(),t.value=o.instance)}t.setValue(e)}),z=new WeakMap,G=t(e=>t=>{if(!(t instanceof V)||t instanceof M||"class"!==t.committer.name||t.committer.parts.length>1)throw new Error("The `classMap` directive must be used in the `class` attribute and must be the only part in the attribute.");const{committer:n}=t,{element:s}=n;z.has(t)||(s.className=n.strings.join(" "));const{classList:o}=s,i=z.get(t);for(const t in i)t in e||o.remove(t);for(const t in e){const n=e[t];if(!i||n!==i[t]){o[n?"add":"remove"](t)}}z.set(t,e)}),J=new WeakMap,K=t((e,t)=>n=>{const s=J.get(n);if(Array.isArray(e)){if(Array.isArray(s)&&s.length===e.length&&e.every((e,t)=>e===s[t]))return}else if(s===e&&(void 0!==e||J.has(n)))return;n.setValue(t()),J.set(n,Array.isArray(e)?Array.from(e):e)}),Q=t(e=>t=>{if(void 0===e&&t instanceof V){if(e!==t.value){const e=t.committer.name;t.committer.element.removeAttribute(e)}}else t.setValue(e)}),U=(e,t)=>{const n=e.startNode.parentNode,s=void 0===t?e.endNode:t.startNode,o=n.insertBefore(f(),s);n.insertBefore(f(),s);const i=new A(e.options);return i.insertAfterNode(o),i},X=(e,t)=>(e.setValue(t),e.commit(),e),Y=(e,t,n)=>{const s=e.startNode.parentNode,i=n?n.startNode:e.endNode,r=t.endNode.nextSibling;r!==i&&o(s,t.startNode,r,i)},Z=e=>{i(e.startNode.parentNode,e.startNode,e.endNode.nextSibling)},ee=(e,t,n)=>{const s=new Map;for(let o=t;o<=n;o++)s.set(e[o],o);return s},te=new WeakMap,ne=new WeakMap,se=t((e,t,n)=>{let s;return void 0===n?n=t:void 0!==t&&(s=t),t=>{if(!(t instanceof A))throw new Error("repeat can only be used in text bindings");const o=te.get(t)||[],i=ne.get(t)||[],r=[],a=[],l=[];let c,d,u=0;for(const t of e)l[u]=s?s(t,u):u,a[u]=n(t,u),u++;let h=0,p=o.length-1,m=0,f=a.length-1;for(;h<=p&&m<=f;)if(null===o[h])h++;else if(null===o[p])p--;else if(i[h]===l[m])r[m]=X(o[h],a[m]),h++,m++;else if(i[p]===l[f])r[f]=X(o[p],a[f]),p--,f--;else if(i[h]===l[f])r[f]=X(o[h],a[f]),Y(t,o[h],r[f+1]),h++,f--;else if(i[p]===l[m])r[m]=X(o[p],a[m]),Y(t,o[p],o[h]),p--,m++;else if(void 0===c&&(c=ee(l,m,f),d=ee(i,h,p)),c.has(i[h]))if(c.has(i[p])){const e=d.get(l[m]),n=void 0!==e?o[e]:null;if(null===n){const e=U(t,o[h]);X(e,a[m]),r[m]=e}else r[m]=X(n,a[m]),Y(t,n,o[h]),o[e]=null;m++}else Z(o[p]),p--;else Z(o[h]),h++;for(;m<=f;){const e=U(t,r[f+1]);X(e,a[m]),r[m++]=e}for(;h<=p;){const e=o[h++];null!==e&&Z(e)}te.set(t,r),ne.set(t,l)}}),oe=new WeakMap,ie=t(e=>t=>{if(!(t instanceof V)||t instanceof M||"style"!==t.committer.name||t.committer.parts.length>1)throw new Error("The `styleMap` directive must be used in the style attribute and must be the only part in the attribute.");const{committer:n}=t,{style:s}=n.element;oe.has(t)||(s.cssText=n.strings.join(" "));const o=oe.get(t);for(const t in o)t in e||(-1===t.indexOf("-")?s[t]=null:s.removeProperty(t));for(const t in e)-1===t.indexOf("-")?s[t]=e[t]:s.setProperty(t,e[t]);oe.set(t,e)}),re=new WeakMap,ae=t(e=>t=>{if(!(t instanceof A))throw new Error("unsafeHTML can only be used in text bindings");const n=re.get(t);if(void 0!==n&&w(e)&&e===n.value&&t.value===n.fragment)return;const s=document.createElement("template");s.innerHTML=e;const o=document.importNode(s.content,!0);t.setValue(o),re.set(t,{value:e,fragment:o})}),le=new WeakMap,ce=t((...e)=>t=>{let n=le.get(t);void 0===n&&(n={lastRenderedIndex:2147483647,values:[]},le.set(t,n));const s=n.values;let o=s.length;n.values=e;for(let i=0;i<e.length&&!(i>n.lastRenderedIndex);i++){const r=e[i];if(w(r)||"function"!=typeof r.then){t.setValue(r),n.lastRenderedIndex=i;break}i<o&&r===s[i]||(n.lastRenderedIndex=2147483647,o=0,Promise.resolve(r).then(e=>{const s=n.values.indexOf(r);s>-1&&s<n.lastRenderedIndex&&(n.lastRenderedIndex=s,t.setValue(e),t.commit())}))}});
*/var $=function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e="function"==typeof __values?__values(e):e[Symbol.iterator](),t={},s("next"),s("throw"),s("return"),t[Symbol.asyncIterator]=function(){return this},t);function s(n){t[n]=e[n]&&function(t){return new Promise((function(s,o){(function(e,t,n,s){Promise.resolve(s).then((function(t){e({value:t,done:n})}),t)})(s,o,(t=e[n](t)).done,t.value)}))}}};const j=t((e,t)=>async n=>{var s,o;if(!(n instanceof A))throw new Error("asyncReplace can only be used in text bindings");if(e===n.value)return;const i=new A(n.options);n.value=e;let r=0;try{for(var a,l=$(e);!(a=await l.next()).done;){let s=a.value;if(n.value!==e)break;0===r&&(n.clear(),i.appendIntoPart(n)),void 0!==t&&(s=t(s,r)),i.setValue(s),i.commit(),r++}}catch(e){s={error:e}}finally{try{a&&!a.done&&(o=l.return)&&await o.call(l)}finally{if(s)throw s.error}}}),D=new WeakMap,q=t(e=>t=>{if(!(t instanceof A))throw new Error("cache can only be used in text bindings");let n=D.get(t);void 0===n&&(n=new WeakMap,D.set(t,n));const s=t.value;if(s instanceof g){if(e instanceof y&&s.template===t.options.templateFactory(e))return void t.setValue(e);{let e=n.get(s.template);void 0===e&&(e={instance:s,nodes:document.createDocumentFragment()},n.set(s.template,e)),o(e.nodes,t.startNode.nextSibling,t.endNode)}}if(e instanceof y){const s=t.options.templateFactory(e),o=n.get(s);void 0!==o&&(t.setValue(o.nodes),t.commit(),t.value=o.instance)}t.setValue(e)}),z=new WeakMap,G=t(e=>t=>{if(!(t instanceof V)||t instanceof M||"class"!==t.committer.name||t.committer.parts.length>1)throw new Error("The `classMap` directive must be used in the `class` attribute and must be the only part in the attribute.");const{committer:n}=t,{element:s}=n;z.has(t)||(s.className=n.strings.join(" "));const{classList:o}=s,i=z.get(t);for(const t in i)t in e||o.remove(t);for(const t in e){const n=e[t];if(!i||n!==i[t]){o[n?"add":"remove"](t)}}z.set(t,e)}),J=new WeakMap,K=t((e,t)=>n=>{const s=J.get(n);if(Array.isArray(e)){if(Array.isArray(s)&&s.length===e.length&&e.every((e,t)=>e===s[t]))return}else if(s===e&&(void 0!==e||J.has(n)))return;n.setValue(t()),J.set(n,Array.isArray(e)?Array.from(e):e)}),Q=t(e=>t=>{if(void 0===e&&t instanceof V){if(e!==t.value){const e=t.committer.name;t.committer.element.removeAttribute(e)}}else t.setValue(e)}),U=(e,t)=>{const n=e.startNode.parentNode,s=void 0===t?e.endNode:t.startNode,o=n.insertBefore(m(),s);n.insertBefore(m(),s);const i=new A(e.options);return i.insertAfterNode(o),i},X=(e,t)=>(e.setValue(t),e.commit(),e),Y=(e,t,n)=>{const s=e.startNode.parentNode,i=n?n.startNode:e.endNode,r=t.endNode.nextSibling;r!==i&&o(s,t.startNode,r,i)},Z=e=>{i(e.startNode.parentNode,e.startNode,e.endNode.nextSibling)},ee=(e,t,n)=>{const s=new Map;for(let o=t;o<=n;o++)s.set(e[o],o);return s},te=new WeakMap,ne=new WeakMap,se=t((e,t,n)=>{let s;return void 0===n?n=t:void 0!==t&&(s=t),t=>{if(!(t instanceof A))throw new Error("repeat can only be used in text bindings");const o=te.get(t)||[],i=ne.get(t)||[],r=[],a=[],l=[];let c,d,u=0;for(const t of e)l[u]=s?s(t,u):u,a[u]=n(t,u),u++;let h=0,p=o.length-1,f=0,m=a.length-1;for(;h<=p&&f<=m;)if(null===o[h])h++;else if(null===o[p])p--;else if(i[h]===l[f])r[f]=X(o[h],a[f]),h++,f++;else if(i[p]===l[m])r[m]=X(o[p],a[m]),p--,m--;else if(i[h]===l[m])r[m]=X(o[h],a[m]),Y(t,o[h],r[m+1]),h++,m--;else if(i[p]===l[f])r[f]=X(o[p],a[f]),Y(t,o[p],o[h]),p--,f++;else if(void 0===c&&(c=ee(l,f,m),d=ee(i,h,p)),c.has(i[h]))if(c.has(i[p])){const e=d.get(l[f]),n=void 0!==e?o[e]:null;if(null===n){const e=U(t,o[h]);X(e,a[f]),r[f]=e}else r[f]=X(n,a[f]),Y(t,n,o[h]),o[e]=null;f++}else Z(o[p]),p--;else Z(o[h]),h++;for(;f<=m;){const e=U(t,r[m+1]);X(e,a[f]),r[f++]=e}for(;h<=p;){const e=o[h++];null!==e&&Z(e)}te.set(t,r),ne.set(t,l)}}),oe=new WeakMap,ie=t(e=>t=>{if(!(t instanceof V)||t instanceof M||"style"!==t.committer.name||t.committer.parts.length>1)throw new Error("The `styleMap` directive must be used in the style attribute and must be the only part in the attribute.");const{committer:n}=t,{style:s}=n.element;oe.has(t)||(s.cssText=n.strings.join(" "));const o=oe.get(t);for(const t in o)t in e||(-1===t.indexOf("-")?s[t]=null:s.removeProperty(t));for(const t in e)-1===t.indexOf("-")?s[t]=e[t]:s.setProperty(t,e[t]);oe.set(t,e)}),re=new WeakMap,ae=t(e=>t=>{if(!(t instanceof A))throw new Error("unsafeHTML can only be used in text bindings");const n=re.get(t);if(void 0!==n&&w(e)&&e===n.value&&t.value===n.fragment)return;const s=document.createElement("template");s.innerHTML=e;const o=document.importNode(s.content,!0);t.setValue(o),re.set(t,{value:e,fragment:o})}),le=new WeakMap,ce=t((...e)=>t=>{let n=le.get(t);void 0===n&&(n={lastRenderedIndex:2147483647,values:[]},le.set(t,n));const s=n.values;let o=s.length;n.values=e;for(let i=0;i<e.length&&!(i>n.lastRenderedIndex);i++){const r=e[i];if(w(r)||"function"!=typeof r.then){t.setValue(r),n.lastRenderedIndex=i;break}i<o&&r===s[i]||(n.lastRenderedIndex=2147483647,o=0,Promise.resolve(r).then(e=>{const s=n.values.indexOf(r);s>-1&&s<n.lastRenderedIndex&&(n.lastRenderedIndex=s,t.setValue(e),t.commit())}))}});
/**

@@ -152,3 +152,3 @@ * @license

* http://polymer.github.io/PATENTS.txt
*/return function(e,n){let s=0;const o={};let i,r,a=[],l=0;const c=Promise.resolve();function d(e){return t((function(t,n){return function(s){const o=s.committer.element;for(const s of t)if("function"==typeof s){const t=a.find(t=>t.instance===e&&t.componentAction.create===s&&t.element===o);if(t)t.props=n;else{void 0!==o.__vido__&&delete o.__vido__;const t={create:s,update(){},destroy(){}};a.push({instance:e,componentAction:t,element:o,props:n})}}}}))}const u={state:e,api:n,html:R,svg:O,directive:t,asyncAppend:F,asyncReplace:j,cache:q,classMap:G,guard:K,ifDefined:Q,repeat:se,styleMap:ie,unsafeHTML:ae,until:ce,actions(e,t){},onDestroy(){},onChange(e){},createComponent(e,t){const n=s++,i=function(e){return{instance:e,destroy:()=>u.destroyComponent(e),update:()=>u.updateTemplate(),change(t){o[e].change(t)},html:(t={})=>o[e].update(t)}}(n);const r=[];const a=[];const l={destroy(){for(const e of r)e()},update:e(Object.assign(Object.assign({},u),{update:function(){u.updateTemplate()},onDestroy:function(e){r.push(e)},onChange:function(e){a.push(e)},instance:n,actions:d(n)}),t),change(e){for(const t of a)t(e)}};return o[n]=l,o[n].change(t),i},destroyComponent(e){"function"==typeof o[e].destroy&&o[e].destroy(),a=a.filter(t=>(t.instance===e&&"function"==typeof t.componentAction.destroy&&t.componentAction.destroy(t.element,t.props),t.instance!==e)),delete o[e]},updateTemplate(){const e=++l,t=this;c.then((function(){e===l&&(t.render(),l=0)}))},createApp(e,t){r=t;const n=this.createComponent(e);return i=n.instance,this.render(),n},executeActions(){for(const e of a)if(void 0===e.element.__vido__){if("function"==typeof e.componentAction.create){const t=e.componentAction.create(e.element,e.props);void 0!==t&&("function"==typeof t.update&&(e.componentAction.update=t.update),"function"==typeof t.destroy&&(e.componentAction.destroy=t.destroy))}}else"function"==typeof e.componentAction.update&&e.componentAction.update(e.element,e.props);for(const e of a)e.element.__vido__={instance:e.instance,props:e.props}},render(){H(o[i].update(),r),u.executeActions()}};return u}}));
*/return function(e,n){let s=0;const o={};let i,r,a=[],l=0;const c=Promise.resolve();function d(e){return t((function(t,n){return function(s){const o=s.committer.element;for(const s of t)if("function"==typeof s){const t=a.find(t=>t.instance===e&&t.componentAction.create===s&&t.element===o);if(t)t.props=n;else{void 0!==o.__vido__&&delete o.__vido__;const t={create:s,update(){},destroy(){}};a.push({instance:e,componentAction:t,element:o,props:n})}}}}))}const u={state:e,api:n,html:R,svg:O,directive:t,asyncAppend:F,asyncReplace:j,cache:q,classMap:G,guard:K,ifDefined:Q,repeat:se,styleMap:ie,unsafeHTML:ae,until:ce,actions(e,t){},onDestroy(){},onChange(e){},createComponent(e,t){const n=s++,i=function(e){return{instance:e,destroy:()=>u.destroyComponent(e),update:()=>u.updateTemplate(),change(t){o[e]&&o[e].change(t)},html(t={}){if(o[e])return o[e].update(t)}}}(n);const r=[];const a=[];const l={destroy(){for(const e of r)e()},update:e(Object.assign(Object.assign({},u),{update:function(){u.updateTemplate()},onDestroy:function(e){r.push(e)},onChange:function(e){a.push(e)},instance:n,actions:d(n)}),t),change(e){for(const n in t)if(e[n]===t[n])return;for(const t of a)t(e)}};return o[n]=l,o[n].change(t),i},destroyComponent(e){"function"==typeof o[e].destroy&&o[e].destroy(),a=a.filter(t=>(t.instance===e&&"function"==typeof t.componentAction.destroy&&t.componentAction.destroy(t.element,t.props),t.instance!==e)),delete o[e]},updateTemplate(){const e=++l,t=this;c.then((function(){e===l&&(t.render(),l=0)}))},createApp(e,t){r=t;const n=this.createComponent(e);return i=n.instance,this.render(),n},executeActions(){for(const e of a)if(void 0===e.element.__vido__){if("function"==typeof e.componentAction.create){const t=e.componentAction.create(e.element,e.props);void 0!==t&&("function"==typeof t.update&&(e.componentAction.update=t.update),"function"==typeof t.destroy&&(e.componentAction.destroy=t.destroy))}}else"function"==typeof e.componentAction.update&&e.componentAction.update(e.element,e.props);for(const e of a)e.element.__vido__={instance:e.instance,props:e.props}},render(){H(o[i].update(),r),u.executeActions()}};return u}}));
//# sourceMappingURL=vido.min.js.map

@@ -88,5 +88,10 @@ import { render, html, directive, svg } from 'lit-html';

update: component(vidoInstance, props),
change(props) {
change(changedProps) {
for (const prop in props) {
if (changedProps[prop] === props[prop]) {
return;
}
}
for (const fn of onChangeFunctions) {
fn(props);
fn(changedProps);
}

@@ -175,7 +180,7 @@ }

change(props) {
components[instance].change(props);
if (components[instance]) components[instance].change(props);
},
html(props = {}) {
return components[instance].update(props);
if (components[instance]) return components[instance].update(props);
}

@@ -182,0 +187,0 @@ };

Sorry, the diff of this file is too big to display

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 too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc