@neuronet.io/vido
Advanced tools
Comparing version 4.1.7 to 4.1.8
@@ -115,8 +115,8 @@ import { Directive, directive } from 'lit-html/directive.js'; | ||
const elementStyle = element.style; | ||
const currentElementStyles = elementStyle.cssText | ||
.split(';') | ||
.map((item) => item.substr(0, item.indexOf(':')).trim()) | ||
.filter((item) => !!item); | ||
if (this.schedule) { | ||
requestAnimationFrame(() => { | ||
const currentElementStyles = element.style.cssText | ||
.split(';') | ||
.map((item) => item.substr(0, item.indexOf(':')).trim()) | ||
.filter((item) => !!item); | ||
this.updateStyle(elementStyle, currentElementStyles, style, element); | ||
@@ -126,6 +126,2 @@ }); | ||
else { | ||
const currentElementStyles = element.style.cssText | ||
.split(';') | ||
.map((item) => item.substr(0, item.indexOf(':')).trim()) | ||
.filter((item) => !!item); | ||
this.updateStyle(elementStyle, currentElementStyles, style, element); | ||
@@ -132,0 +128,0 @@ } |
@@ -260,8 +260,8 @@ /** | ||
const elementStyle = element.style; | ||
const currentElementStyles = elementStyle.cssText | ||
.split(';') | ||
.map((item) => item.substr(0, item.indexOf(':')).trim()) | ||
.filter((item) => !!item); | ||
if (this.schedule) { | ||
requestAnimationFrame(() => { | ||
const currentElementStyles = element.style.cssText | ||
.split(';') | ||
.map((item) => item.substr(0, item.indexOf(':')).trim()) | ||
.filter((item) => !!item); | ||
this.updateStyle(elementStyle, currentElementStyles, style, element); | ||
@@ -271,6 +271,2 @@ }); | ||
else { | ||
const currentElementStyles = element.style.cssText | ||
.split(';') | ||
.map((item) => item.substr(0, item.indexOf(':')).trim()) | ||
.filter((item) => !!item); | ||
this.updateStyle(elementStyle, currentElementStyles, style, element); | ||
@@ -277,0 +273,0 @@ } |
@@ -62,3 +62,3 @@ /** | ||
* SPDX-License-Identifier: BSD-3-Clause | ||
*/class Et extends k{update(t,e){return e[0].execute(t),_}render(t){return t.toString()}}class It{constructor(t,e={schedule:!1}){this.schedule=!1,this.style=t,this._directive=R(Et),this.execute=this.execute.bind(this),this.schedule=e.schedule}directive(){return this._directive(this)}setStyle(t){this.style=t}toString(){return Object.keys(this.style).reduce(((t,e)=>{const s=this.style[e];return null==s?t:t+`${e=e.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${s};`}),"")}updateStyle(t,e,s,n){const i=s.previousStyle;for(const t of e)t&&void 0===this.style[t]&&(s.toRemove.includes(t)||s.toRemove.push(t));for(const t in i)t&&t in this.style&&void 0===this.style[t]&&e.includes(t)&&(s.toRemove.includes(t)||s.toRemove.push(t));for(const t in this.style){if(!t)continue;if(!(t in this.style))continue;const n=this.style[t];if(!n)continue;const o=i[t];void 0!==o&&o===n&&e.includes(t)||s.toUpdate.push(t)}if(s.toRemove.length||s.toUpdate.length){for(const e of s.toRemove)t.removeProperty(e),t[e]&&delete t[e];for(const e of s.toUpdate){const s=this.style[e];s&&(e.includes("-")?t.setProperty(e,s):t[e]=s)}s.previousStyle=Object.assign({},this.style)}}execute(t){const e=t.element;let s;wt.has(e)?s=wt.get(e):(s={toUpdate:[],toRemove:[],previousStyle:{}},wt.set(e,s)),s.toRemove.length=0,s.toUpdate.length=0;const n=e.style;if(this.schedule)requestAnimationFrame((()=>{const t=e.style.cssText.split(";").map((t=>t.substr(0,t.indexOf(":")).trim())).filter((t=>!!t));this.updateStyle(n,t,s,e)}));else{const t=e.style.cssText.split(";").map((t=>t.substr(0,t.indexOf(":")).trim())).filter((t=>!!t));this.updateStyle(n,t,s,e)}wt.set(e,s)}} | ||
*/class Et extends k{update(t,e){return e[0].execute(t),_}render(t){return t.toString()}}class It{constructor(t,e={schedule:!1}){this.schedule=!1,this.style=t,this._directive=R(Et),this.execute=this.execute.bind(this),this.schedule=e.schedule}directive(){return this._directive(this)}setStyle(t){this.style=t}toString(){return Object.keys(this.style).reduce(((t,e)=>{const s=this.style[e];return null==s?t:t+`${e=e.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${s};`}),"")}updateStyle(t,e,s,n){const i=s.previousStyle;for(const t of e)t&&void 0===this.style[t]&&(s.toRemove.includes(t)||s.toRemove.push(t));for(const t in i)t&&t in this.style&&void 0===this.style[t]&&e.includes(t)&&(s.toRemove.includes(t)||s.toRemove.push(t));for(const t in this.style){if(!t)continue;if(!(t in this.style))continue;const n=this.style[t];if(!n)continue;const o=i[t];void 0!==o&&o===n&&e.includes(t)||s.toUpdate.push(t)}if(s.toRemove.length||s.toUpdate.length){for(const e of s.toRemove)t.removeProperty(e),t[e]&&delete t[e];for(const e of s.toUpdate){const s=this.style[e];s&&(e.includes("-")?t.setProperty(e,s):t[e]=s)}s.previousStyle=Object.assign({},this.style)}}execute(t){const e=t.element;let s;wt.has(e)?s=wt.get(e):(s={toUpdate:[],toRemove:[],previousStyle:{}},wt.set(e,s)),s.toRemove.length=0,s.toUpdate.length=0;const n=e.style,i=n.cssText.split(";").map((t=>t.substr(0,t.indexOf(":")).trim())).filter((t=>!!t));this.schedule?requestAnimationFrame((()=>{this.updateStyle(n,i,s,e)})):this.updateStyle(n,i,s,e),wt.set(e,s)}} | ||
/** | ||
@@ -65,0 +65,0 @@ * @license |
@@ -62,3 +62,3 @@ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).Vido=e()}(this,(function(){"use strict"; | ||
* SPDX-License-Identifier: BSD-3-Clause | ||
*/class Xt extends W{update(t,e){return e[0].execute(t),_}render(t){return t.toString()}}class Pt{constructor(t,e={schedule:!1}){this.schedule=!1,this.style=t,this._directive=j(Xt),this.execute=this.execute.bind(this),this.schedule=e.schedule}directive(){return this._directive(this)}setStyle(t){this.style=t}toString(){return Object.keys(this.style).reduce(((t,e)=>{const s=this.style[e];return null==s?t:t+`${e=e.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${s};`}),"")}updateStyle(t,e,s,n){const i=s.previousStyle;for(const t of e)t&&void 0===this.style[t]&&(s.toRemove.includes(t)||s.toRemove.push(t));for(const t in i)t&&t in this.style&&void 0===this.style[t]&&e.includes(t)&&(s.toRemove.includes(t)||s.toRemove.push(t));for(const t in this.style){if(!t)continue;if(!(t in this.style))continue;const n=this.style[t];if(!n)continue;const o=i[t];void 0!==o&&o===n&&e.includes(t)||s.toUpdate.push(t)}if(s.toRemove.length||s.toUpdate.length){for(const e of s.toRemove)t.removeProperty(e),t[e]&&delete t[e];for(const e of s.toUpdate){const s=this.style[e];s&&(e.includes("-")?t.setProperty(e,s):t[e]=s)}s.previousStyle=Object.assign({},this.style)}}execute(t){const e=t.element;let s;Yt.has(e)?s=Yt.get(e):(s={toUpdate:[],toRemove:[],previousStyle:{}},Yt.set(e,s)),s.toRemove.length=0,s.toUpdate.length=0;const n=e.style;if(this.schedule)requestAnimationFrame((()=>{const t=e.style.cssText.split(";").map((t=>t.substr(0,t.indexOf(":")).trim())).filter((t=>!!t));this.updateStyle(n,t,s,e)}));else{const t=e.style.cssText.split(";").map((t=>t.substr(0,t.indexOf(":")).trim())).filter((t=>!!t));this.updateStyle(n,t,s,e)}Yt.set(e,s)}} | ||
*/class Xt extends W{update(t,e){return e[0].execute(t),_}render(t){return t.toString()}}class Pt{constructor(t,e={schedule:!1}){this.schedule=!1,this.style=t,this._directive=j(Xt),this.execute=this.execute.bind(this),this.schedule=e.schedule}directive(){return this._directive(this)}setStyle(t){this.style=t}toString(){return Object.keys(this.style).reduce(((t,e)=>{const s=this.style[e];return null==s?t:t+`${e=e.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${s};`}),"")}updateStyle(t,e,s,n){const i=s.previousStyle;for(const t of e)t&&void 0===this.style[t]&&(s.toRemove.includes(t)||s.toRemove.push(t));for(const t in i)t&&t in this.style&&void 0===this.style[t]&&e.includes(t)&&(s.toRemove.includes(t)||s.toRemove.push(t));for(const t in this.style){if(!t)continue;if(!(t in this.style))continue;const n=this.style[t];if(!n)continue;const o=i[t];void 0!==o&&o===n&&e.includes(t)||s.toUpdate.push(t)}if(s.toRemove.length||s.toUpdate.length){for(const e of s.toRemove)t.removeProperty(e),t[e]&&delete t[e];for(const e of s.toUpdate){const s=this.style[e];s&&(e.includes("-")?t.setProperty(e,s):t[e]=s)}s.previousStyle=Object.assign({},this.style)}}execute(t){const e=t.element;let s;Yt.has(e)?s=Yt.get(e):(s={toUpdate:[],toRemove:[],previousStyle:{}},Yt.set(e,s)),s.toRemove.length=0,s.toUpdate.length=0;const n=e.style,i=n.cssText.split(";").map((t=>t.substr(0,t.indexOf(":")).trim())).filter((t=>!!t));this.schedule?requestAnimationFrame((()=>{this.updateStyle(n,i,s,e)})):this.updateStyle(n,i,s,e),Yt.set(e,s)}} | ||
/** | ||
@@ -65,0 +65,0 @@ * @license |
{ | ||
"name": "@neuronet.io/vido", | ||
"version": "4.1.7", | ||
"version": "4.1.8", | ||
"description": "Compilation-less and eval free frontend framework for fast scalable apps.", | ||
@@ -5,0 +5,0 @@ "main": "dist/vido.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 too big to display
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
773931
4056