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 4.0.3 to 4.0.4

10

dist/Detach.js

@@ -5,10 +5,10 @@ import { nothing } from 'lit-html';

export class Detach extends Directive {
render() {
render(shouldDetach) {
return nothing;
}
update(part, props) {
if (typeof props[0] !== 'function') {
throw new Error('[vido] Detach directive argument should be a function.');
if (typeof props[0] !== 'boolean') {
throw new Error('[vido] Detach directive argument should be a boolean.');
}
const detach = props[0]();
let detach = props[0];
const element = part.element;

@@ -41,3 +41,3 @@ if (detach) {

}
return this.render();
return this.render(detach);
}

@@ -44,0 +44,0 @@ }

@@ -104,10 +104,10 @@ export { PropertiesHyphenFallback as CSSProps } from 'csstype';

class Detach extends i$1 {
render() {
render(shouldDetach) {
return T;
}
update(part, props) {
if (typeof props[0] !== 'function') {
throw new Error('[vido] Detach directive argument should be a function.');
if (typeof props[0] !== 'boolean') {
throw new Error('[vido] Detach directive argument should be a boolean.');
}
const detach = props[0]();
let detach = props[0];
const element = part.element;

@@ -140,3 +140,3 @@ if (detach) {

}
return this.render();
return this.render(detach);
}

@@ -143,0 +143,0 @@ }

@@ -57,3 +57,3 @@ export{PropertiesHyphenFallback as CSSProps}from"csstype";

* SPDX-License-Identifier: BSD-3-Clause
*/const Mt=j(class extends z{render(){return b}update(t,e){if("function"!=typeof e[0])throw new Error("[vido] Detach directive argument should be a function.");const s=e[0](),n=t.element;if(s)wt.has(t)||wt.set(t,{element:n,nextSibling:n.nextSibling,previousSibling:n.previousSibling,parent:n.parentNode}),n.remove();else{const e=wt.get(t);e&&(e.nextSibling&&e.nextSibling.parentNode?e.nextSibling.parentNode.insertBefore(e.element,e.nextSibling):e.previousSibling&&e.previousSibling.parentNode?e.previousSibling.parentNode.appendChild(e.element):e.parent&&e.parent.appendChild(e.element),wt.delete(t))}return this.render()}}),It=j(class extends z{constructor(t){var e;if(super(t),t.type!==k||"style"!==t.name||(null===(e=t.strings)||void 0===e?void 0:e.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(t){return Object.keys(t).reduce((e,s)=>{const n=t[s];return null==n?e:e+`${s=s.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${n};`},"")}update(t,[e]){const{style:s}=t.element;if(void 0===this.ut){this.ut=new Set;for(const t in e)this.ut.add(t);return this.render(e)}this.ut.forEach(t=>{null==e[t]&&(this.ut.delete(t),t.includes("-")?s.removeProperty(t):s[t]="")});for(const t in e){const n=e[t];null!=n&&(this.ut.add(t),t.includes("-")?s.setProperty(t,n):s[t]=n)}return _}}),Yt=j(class extends z{constructor(t){var e;if(super(t),t.type!==k||"class"!==t.name||(null===(e=t.strings)||void 0===e?void 0:e.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter(e=>t[e]).join(" ")+" "}update(t,[e]){var s,n;if(void 0===this.st){this.st=new Set,void 0!==t.strings&&(this.et=new Set(t.strings.join(" ").split(/\s/).filter(t=>""!==t)));for(const t in e)e[t]&&!(null===(s=this.et)||void 0===s?void 0:s.has(t))&&this.st.add(t);return this.render(e)}const i=t.element.classList;this.st.forEach(t=>{t in e||(i.remove(t),this.st.delete(t))});for(const t in e){const s=!!e[t];s===this.st.has(t)||(null===(n=this.et)||void 0===n?void 0:n.has(t))||(s?(i.add(t),this.st.add(t)):(i.remove(t),this.st.delete(t)))}return _}});
*/const Mt=j(class extends z{render(t){return b}update(t,e){if("boolean"!=typeof e[0])throw new Error("[vido] Detach directive argument should be a boolean.");let s=e[0];const n=t.element;if(s)wt.has(t)||wt.set(t,{element:n,nextSibling:n.nextSibling,previousSibling:n.previousSibling,parent:n.parentNode}),n.remove();else{const e=wt.get(t);e&&(e.nextSibling&&e.nextSibling.parentNode?e.nextSibling.parentNode.insertBefore(e.element,e.nextSibling):e.previousSibling&&e.previousSibling.parentNode?e.previousSibling.parentNode.appendChild(e.element):e.parent&&e.parent.appendChild(e.element),wt.delete(t))}return this.render(s)}}),It=j(class extends z{constructor(t){var e;if(super(t),t.type!==k||"style"!==t.name||(null===(e=t.strings)||void 0===e?void 0:e.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(t){return Object.keys(t).reduce((e,s)=>{const n=t[s];return null==n?e:e+`${s=s.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${n};`},"")}update(t,[e]){const{style:s}=t.element;if(void 0===this.ut){this.ut=new Set;for(const t in e)this.ut.add(t);return this.render(e)}this.ut.forEach(t=>{null==e[t]&&(this.ut.delete(t),t.includes("-")?s.removeProperty(t):s[t]="")});for(const t in e){const n=e[t];null!=n&&(this.ut.add(t),t.includes("-")?s.setProperty(t,n):s[t]=n)}return _}}),Yt=j(class extends z{constructor(t){var e;if(super(t),t.type!==k||"class"!==t.name||(null===(e=t.strings)||void 0===e?void 0:e.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter(e=>t[e]).join(" ")+" "}update(t,[e]){var s,n;if(void 0===this.st){this.st=new Set,void 0!==t.strings&&(this.et=new Set(t.strings.join(" ").split(/\s/).filter(t=>""!==t)));for(const t in e)e[t]&&!(null===(s=this.et)||void 0===s?void 0:s.has(t))&&this.st.add(t);return this.render(e)}const i=t.element.classList;this.st.forEach(t=>{t in e||(i.remove(t),this.st.delete(t))});for(const t in e){const s=!!e[t];s===this.st.has(t)||(null===(n=this.et)||void 0===n?void 0:n.has(t))||(s?(i.add(t),this.st.add(t)):(i.remove(t),this.st.delete(t)))}return _}});
/**

@@ -60,0 +60,0 @@ * @license

@@ -108,10 +108,10 @@ (function (global, factory) {

class Detach extends i$1 {
render() {
render(shouldDetach) {
return T;
}
update(part, props) {
if (typeof props[0] !== 'function') {
throw new Error('[vido] Detach directive argument should be a function.');
if (typeof props[0] !== 'boolean') {
throw new Error('[vido] Detach directive argument should be a boolean.');
}
const detach = props[0]();
let detach = props[0];
const element = part.element;

@@ -144,3 +144,3 @@ if (detach) {

}
return this.render();
return this.render(detach);
}

@@ -147,0 +147,0 @@ }

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

* SPDX-License-Identifier: BSD-3-Clause
*/const Mt=z(class extends F{render(){return x}update(t,e){if("function"!=typeof e[0])throw new Error("[vido] Detach directive argument should be a function.");const s=e[0](),n=t.element;if(s)It.has(t)||It.set(t,{element:n,nextSibling:n.nextSibling,previousSibling:n.previousSibling,parent:n.parentNode}),n.remove();else{const e=It.get(t);e&&(e.nextSibling&&e.nextSibling.parentNode?e.nextSibling.parentNode.insertBefore(e.element,e.nextSibling):e.previousSibling&&e.previousSibling.parentNode?e.previousSibling.parentNode.appendChild(e.element):e.parent&&e.parent.appendChild(e.element),It.delete(t))}return this.render()}}),Yt=z(class extends F{constructor(t){var e;if(super(t),t.type!==B||"style"!==t.name||(null===(e=t.strings)||void 0===e?void 0:e.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(t){return Object.keys(t).reduce((e,s)=>{const n=t[s];return null==n?e:e+`${s=s.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${n};`},"")}update(t,[e]){const{style:s}=t.element;if(void 0===this.ut){this.ut=new Set;for(const t in e)this.ut.add(t);return this.render(e)}this.ut.forEach(t=>{null==e[t]&&(this.ut.delete(t),t.includes("-")?s.removeProperty(t):s[t]="")});for(const t in e){const n=e[t];null!=n&&(this.ut.add(t),t.includes("-")?s.setProperty(t,n):s[t]=n)}return b}}),Xt=z(class extends F{constructor(t){var e;if(super(t),t.type!==B||"class"!==t.name||(null===(e=t.strings)||void 0===e?void 0:e.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter(e=>t[e]).join(" ")+" "}update(t,[e]){var s,n;if(void 0===this.st){this.st=new Set,void 0!==t.strings&&(this.et=new Set(t.strings.join(" ").split(/\s/).filter(t=>""!==t)));for(const t in e)e[t]&&!(null===(s=this.et)||void 0===s?void 0:s.has(t))&&this.st.add(t);return this.render(e)}const i=t.element.classList;this.st.forEach(t=>{t in e||(i.remove(t),this.st.delete(t))});for(const t in e){const s=!!e[t];s===this.st.has(t)||(null===(n=this.et)||void 0===n?void 0:n.has(t))||(s?(i.add(t),this.st.add(t)):(i.remove(t),this.st.delete(t)))}return b}});
*/const Mt=z(class extends F{render(t){return x}update(t,e){if("boolean"!=typeof e[0])throw new Error("[vido] Detach directive argument should be a boolean.");let s=e[0];const n=t.element;if(s)It.has(t)||It.set(t,{element:n,nextSibling:n.nextSibling,previousSibling:n.previousSibling,parent:n.parentNode}),n.remove();else{const e=It.get(t);e&&(e.nextSibling&&e.nextSibling.parentNode?e.nextSibling.parentNode.insertBefore(e.element,e.nextSibling):e.previousSibling&&e.previousSibling.parentNode?e.previousSibling.parentNode.appendChild(e.element):e.parent&&e.parent.appendChild(e.element),It.delete(t))}return this.render(s)}}),Yt=z(class extends F{constructor(t){var e;if(super(t),t.type!==B||"style"!==t.name||(null===(e=t.strings)||void 0===e?void 0:e.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(t){return Object.keys(t).reduce((e,s)=>{const n=t[s];return null==n?e:e+`${s=s.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${n};`},"")}update(t,[e]){const{style:s}=t.element;if(void 0===this.ut){this.ut=new Set;for(const t in e)this.ut.add(t);return this.render(e)}this.ut.forEach(t=>{null==e[t]&&(this.ut.delete(t),t.includes("-")?s.removeProperty(t):s[t]="")});for(const t in e){const n=e[t];null!=n&&(this.ut.add(t),t.includes("-")?s.setProperty(t,n):s[t]=n)}return b}}),Xt=z(class extends F{constructor(t){var e;if(super(t),t.type!==B||"class"!==t.name||(null===(e=t.strings)||void 0===e?void 0:e.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter(e=>t[e]).join(" ")+" "}update(t,[e]){var s,n;if(void 0===this.st){this.st=new Set,void 0!==t.strings&&(this.et=new Set(t.strings.join(" ").split(/\s/).filter(t=>""!==t)));for(const t in e)e[t]&&!(null===(s=this.et)||void 0===s?void 0:s.has(t))&&this.st.add(t);return this.render(e)}const i=t.element.classList;this.st.forEach(t=>{t in e||(i.remove(t),this.st.delete(t))});for(const t in e){const s=!!e[t];s===this.st.has(t)||(null===(n=this.et)||void 0===n?void 0:n.has(t))||(s?(i.add(t),this.st.add(t)):(i.remove(t),this.st.delete(t)))}return b}});
/**

@@ -60,0 +60,0 @@ * @license

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

@@ -5,0 +5,0 @@ "main": "dist/vido.umd.min.js",

@@ -14,3 +14,3 @@ import { nothing } from 'lit-html';

export class Detach extends Directive {
render() {
render(shouldDetach: boolean) {
return nothing;

@@ -20,6 +20,6 @@ }

update(part: AttributePart, props: unknown[]) {
if (typeof props[0] !== 'function') {
throw new Error('[vido] Detach directive argument should be a function.');
if (typeof props[0] !== 'boolean') {
throw new Error('[vido] Detach directive argument should be a boolean.');
}
const detach = props[0]();
let detach = props[0];
const element: Element = part.element;

@@ -49,3 +49,3 @@ if (detach) {

}
return this.render();
return this.render(detach);
}

@@ -52,0 +52,0 @@ }

@@ -9,6 +9,6 @@ import { AttributePart, Directive } from 'lit-html/directive';

export declare class Detach extends Directive {
render(): symbol;
render(shouldDetach: boolean): symbol;
update(part: AttributePart, props: unknown[]): symbol;
}
declare const detach: () => import("lit-html/directive").DirectiveResult<typeof Detach>;
declare const detach: (shouldDetach: boolean) => import("lit-html/directive").DirectiveResult<typeof Detach>;
export default detach;

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

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