@lumino/virtualdom
Advanced tools
Comparing version 1.14.2 to 1.14.3
@@ -425,3 +425,6 @@ import { ArrayExt } from '@lumino/algorithm'; | ||
if (oldVNode.type === 'text' && newVNode.type === 'text') { | ||
currElem.textContent = newVNode.content; | ||
// Avoid spurious updates for performance. | ||
if (currElem.textContent !== newVNode.content) { | ||
currElem.textContent = newVNode.content; | ||
} | ||
currElem = currElem.nextSibling; | ||
@@ -428,0 +431,0 @@ continue; |
@@ -429,3 +429,6 @@ (function (global, factory) { | ||
if (oldVNode.type === 'text' && newVNode.type === 'text') { | ||
currElem.textContent = newVNode.content; | ||
// Avoid spurious updates for performance. | ||
if (currElem.textContent !== newVNode.content) { | ||
currElem.textContent = newVNode.content; | ||
} | ||
currElem = currElem.nextSibling; | ||
@@ -432,0 +435,0 @@ continue; |
@@ -15,3 +15,3 @@ !function(i,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@lumino/algorithm")):"function"==typeof define&&define.amd?define(["exports","@lumino/algorithm"],t):t((i="undefined"!=typeof globalThis?globalThis:i||self).lumino_virtualdom={},i.lumino_algorithm)}(this,(function(i,t){"use strict"; | ||
PERFORMANCE OF THIS SOFTWARE. | ||
***************************************************************************** */var e=function(i,t){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,t){i.__proto__=t}||function(i,t){for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(i[e]=t[e])},e(i,t)};var n,d,o=function(i){this.type="text",this.content=i},r=function(i,t,e,n){this.type="element",this.tag=i,this.attrs=t,this.children=e,this.renderer=n},a=function(i){function t(t,e,n){return i.call(this,t,e,[],n||void 0)||this}return function(i,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=i}e(i,t),i.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,i),t}(r);function s(i){for(var t,e={},n=[],d=1,a=arguments.length;d<a;++d){var s=arguments[d];"string"==typeof s?n.push(new o(s)):s instanceof o||s instanceof r?n.push(s):s instanceof Array?l(n,s):1!==d&&2!==d||!s||"object"!=typeof s||("render"in s?t=s:e=s)}return new r(i,e,n,t);function l(i,t){for(var e=0,n=t;e<n.length;e++){var d=n[e];"string"==typeof d?i.push(new o(d)):(d instanceof o||d instanceof r)&&i.push(d)}}}!function(i){i.a=i.bind(void 0,"a"),i.abbr=i.bind(void 0,"abbr"),i.address=i.bind(void 0,"address"),i.area=i.bind(void 0,"area"),i.article=i.bind(void 0,"article"),i.aside=i.bind(void 0,"aside"),i.audio=i.bind(void 0,"audio"),i.b=i.bind(void 0,"b"),i.bdi=i.bind(void 0,"bdi"),i.bdo=i.bind(void 0,"bdo"),i.blockquote=i.bind(void 0,"blockquote"),i.br=i.bind(void 0,"br"),i.button=i.bind(void 0,"button"),i.canvas=i.bind(void 0,"canvas"),i.caption=i.bind(void 0,"caption"),i.cite=i.bind(void 0,"cite"),i.code=i.bind(void 0,"code"),i.col=i.bind(void 0,"col"),i.colgroup=i.bind(void 0,"colgroup"),i.data=i.bind(void 0,"data"),i.datalist=i.bind(void 0,"datalist"),i.dd=i.bind(void 0,"dd"),i.del=i.bind(void 0,"del"),i.dfn=i.bind(void 0,"dfn"),i.div=i.bind(void 0,"div"),i.dl=i.bind(void 0,"dl"),i.dt=i.bind(void 0,"dt"),i.em=i.bind(void 0,"em"),i.embed=i.bind(void 0,"embed"),i.fieldset=i.bind(void 0,"fieldset"),i.figcaption=i.bind(void 0,"figcaption"),i.figure=i.bind(void 0,"figure"),i.footer=i.bind(void 0,"footer"),i.form=i.bind(void 0,"form"),i.h1=i.bind(void 0,"h1"),i.h2=i.bind(void 0,"h2"),i.h3=i.bind(void 0,"h3"),i.h4=i.bind(void 0,"h4"),i.h5=i.bind(void 0,"h5"),i.h6=i.bind(void 0,"h6"),i.header=i.bind(void 0,"header"),i.hr=i.bind(void 0,"hr"),i.i=i.bind(void 0,"i"),i.iframe=i.bind(void 0,"iframe"),i.img=i.bind(void 0,"img"),i.input=i.bind(void 0,"input"),i.ins=i.bind(void 0,"ins"),i.kbd=i.bind(void 0,"kbd"),i.label=i.bind(void 0,"label"),i.legend=i.bind(void 0,"legend"),i.li=i.bind(void 0,"li"),i.main=i.bind(void 0,"main"),i.map=i.bind(void 0,"map"),i.mark=i.bind(void 0,"mark"),i.meter=i.bind(void 0,"meter"),i.nav=i.bind(void 0,"nav"),i.noscript=i.bind(void 0,"noscript"),i.object=i.bind(void 0,"object"),i.ol=i.bind(void 0,"ol"),i.optgroup=i.bind(void 0,"optgroup"),i.option=i.bind(void 0,"option"),i.output=i.bind(void 0,"output"),i.p=i.bind(void 0,"p"),i.param=i.bind(void 0,"param"),i.pre=i.bind(void 0,"pre"),i.progress=i.bind(void 0,"progress"),i.q=i.bind(void 0,"q"),i.rp=i.bind(void 0,"rp"),i.rt=i.bind(void 0,"rt"),i.ruby=i.bind(void 0,"ruby"),i.s=i.bind(void 0,"s"),i.samp=i.bind(void 0,"samp"),i.section=i.bind(void 0,"section"),i.select=i.bind(void 0,"select"),i.small=i.bind(void 0,"small"),i.source=i.bind(void 0,"source"),i.span=i.bind(void 0,"span"),i.strong=i.bind(void 0,"strong"),i.sub=i.bind(void 0,"sub"),i.summary=i.bind(void 0,"summary"),i.sup=i.bind(void 0,"sup"),i.table=i.bind(void 0,"table"),i.tbody=i.bind(void 0,"tbody"),i.td=i.bind(void 0,"td"),i.textarea=i.bind(void 0,"textarea"),i.tfoot=i.bind(void 0,"tfoot"),i.th=i.bind(void 0,"th"),i.thead=i.bind(void 0,"thead"),i.time=i.bind(void 0,"time"),i.title=i.bind(void 0,"title"),i.tr=i.bind(void 0,"tr"),i.track=i.bind(void 0,"track"),i.u=i.bind(void 0,"u"),i.ul=i.bind(void 0,"ul"),i.var_=i.bind(void 0,"var"),i.video=i.bind(void 0,"video"),i.wbr=i.bind(void 0,"wbr")}(s||(s={})),i.VirtualDOM=void 0,(n=i.VirtualDOM||(i.VirtualDOM={})).realize=function(i){return d.createDOMNode(i)},n.render=function(i,t){var e=d.hostMap.get(t)||[],n=d.asContentArray(i);d.hostMap.set(t,n),d.updateContent(t,e,n)},function(i){function e(i){var t=arguments[1]||null,n=arguments[2]||null;if(t)t.insertBefore(e(i),n);else{if("text"===i.type)return document.createTextNode(i.content);if(o(t=document.createElement(i.tag),i.attrs),i.renderer)return i.renderer.render(t,{attrs:i.attrs,children:i.children}),t;for(var d=0,r=i.children.length;d<r;++d)e(i.children[d],t)}return t}function n(i,t,e,d){for(var o=t.length-1;o>=e;--o){var r=t[o],a=d?i.lastChild:i.childNodes[o];"text"===r.type||(r.renderer&&r.renderer.unrender?r.renderer.unrender(a,{attrs:r.attrs,children:r.children}):n(a,r.children,0,!1)),d&&i.removeChild(a)}}i.hostMap=new WeakMap,i.asContentArray=function(i){return i?i instanceof Array?i:[i]:[]},i.createDOMNode=e,i.updateContent=function i(d,o,a){if(o!==a){for(var s=function(i,t){for(var e=i.firstChild,n=Object.create(null),d=0,o=t;d<o.length;d++){var r=o[d];"element"===r.type&&r.attrs.key&&(n[r.attrs.key]={vNode:r,element:e}),e=e.nextSibling}return n}(d,o),l=o.slice(),b=d.firstChild,v=a.length,u=0;u<v;++u)if(u>=l.length)e(a[u],d);else{var c=l[u],f=a[u];if(c!==f)if("text"!==c.type||"text"!==f.type)if("text"!==c.type&&"text"!==f.type)if(!c.renderer==!f.renderer){var h=f.attrs.key;if(h&&h in s){var p=s[h];p.vNode!==c&&(t.ArrayExt.move(l,l.indexOf(p.vNode,u+1),u),d.insertBefore(p.element,b),c=p.vNode,b=p.element)}if(c!==f){var m=c.attrs.key;m&&m!==h?(t.ArrayExt.insert(l,u,f),e(f,d,b)):c.tag===f.tag?(r(b,c.attrs,f.attrs),f.renderer?f.renderer.render(b,{attrs:f.attrs,children:f.children}):i(b,c.children,f.children),b=b.nextSibling):(t.ArrayExt.insert(l,u,f),e(f,d,b))}else b=b.nextSibling}else t.ArrayExt.insert(l,u,f),e(f,d,b);else t.ArrayExt.insert(l,u,f),e(f,d,b);else b.textContent=f.content,b=b.nextSibling;else b=b.nextSibling}n(d,l,v,!0)}};var d={key:!0,className:!0,htmlFor:!0,dataset:!0,style:!0};function o(i,t){for(var e in t)e in d||("on"===e.substr(0,2)?i[e]=t[e]:i.setAttribute(e,t[e]));void 0!==t.className&&i.setAttribute("class",t.className),void 0!==t.htmlFor&&i.setAttribute("for",t.htmlFor),t.dataset&&function(i,t){for(var e in t)i.setAttribute("data-"+e,t[e])}(i,t.dataset),t.style&&function(i,t){var e,n=i.style;for(e in t)n[e]=t[e]}(i,t.style)}function r(i,t,e){if(t!==e){var n;for(n in t)n in d||n in e||("on"===n.substr(0,2)?i[n]=null:i.removeAttribute(n));for(n in e)n in d||t[n]===e[n]||("on"===n.substr(0,2)?i[n]=e[n]:i.setAttribute(n,e[n]));t.className!==e.className&&(void 0!==e.className?i.setAttribute("class",e.className):i.removeAttribute("class")),t.htmlFor!==e.htmlFor&&(void 0!==e.htmlFor?i.setAttribute("for",e.htmlFor):i.removeAttribute("for")),t.dataset!==e.dataset&&function(i,t,e){for(var n in t)n in e||i.removeAttribute("data-"+n);for(var d in e)t[d]!==e[d]&&i.setAttribute("data-"+d,e[d])}(i,t.dataset||{},e.dataset||{}),t.style!==e.style&&function(i,t,e){var n,d=i.style;for(n in t)n in e||(d[n]="");for(n in e)t[n]!==e[n]&&(d[n]=e[n])}(i,t.style||{},e.style||{})}}}(d||(d={})),i.VirtualElement=r,i.VirtualElementPass=a,i.VirtualText=o,i.h=s,i.hpass=function(i){var t={},e=null;if(2===arguments.length){var n=arguments[1];"render"in n?e=n:t=n}else if(3===arguments.length)t=arguments[1],e=arguments[2];else if(arguments.length>3)throw new Error("hpass() should be called with 1, 2, or 3 arguments");return new a(i,t,e)},Object.defineProperty(i,"__esModule",{value:!0})})); | ||
***************************************************************************** */var e=function(i,t){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,t){i.__proto__=t}||function(i,t){for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(i[e]=t[e])},e(i,t)};var n,d,o=function(i){this.type="text",this.content=i},r=function(i,t,e,n){this.type="element",this.tag=i,this.attrs=t,this.children=e,this.renderer=n},a=function(i){function t(t,e,n){return i.call(this,t,e,[],n||void 0)||this}return function(i,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=i}e(i,t),i.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,i),t}(r);function s(i){for(var t,e={},n=[],d=1,a=arguments.length;d<a;++d){var s=arguments[d];"string"==typeof s?n.push(new o(s)):s instanceof o||s instanceof r?n.push(s):s instanceof Array?l(n,s):1!==d&&2!==d||!s||"object"!=typeof s||("render"in s?t=s:e=s)}return new r(i,e,n,t);function l(i,t){for(var e=0,n=t;e<n.length;e++){var d=n[e];"string"==typeof d?i.push(new o(d)):(d instanceof o||d instanceof r)&&i.push(d)}}}!function(i){i.a=i.bind(void 0,"a"),i.abbr=i.bind(void 0,"abbr"),i.address=i.bind(void 0,"address"),i.area=i.bind(void 0,"area"),i.article=i.bind(void 0,"article"),i.aside=i.bind(void 0,"aside"),i.audio=i.bind(void 0,"audio"),i.b=i.bind(void 0,"b"),i.bdi=i.bind(void 0,"bdi"),i.bdo=i.bind(void 0,"bdo"),i.blockquote=i.bind(void 0,"blockquote"),i.br=i.bind(void 0,"br"),i.button=i.bind(void 0,"button"),i.canvas=i.bind(void 0,"canvas"),i.caption=i.bind(void 0,"caption"),i.cite=i.bind(void 0,"cite"),i.code=i.bind(void 0,"code"),i.col=i.bind(void 0,"col"),i.colgroup=i.bind(void 0,"colgroup"),i.data=i.bind(void 0,"data"),i.datalist=i.bind(void 0,"datalist"),i.dd=i.bind(void 0,"dd"),i.del=i.bind(void 0,"del"),i.dfn=i.bind(void 0,"dfn"),i.div=i.bind(void 0,"div"),i.dl=i.bind(void 0,"dl"),i.dt=i.bind(void 0,"dt"),i.em=i.bind(void 0,"em"),i.embed=i.bind(void 0,"embed"),i.fieldset=i.bind(void 0,"fieldset"),i.figcaption=i.bind(void 0,"figcaption"),i.figure=i.bind(void 0,"figure"),i.footer=i.bind(void 0,"footer"),i.form=i.bind(void 0,"form"),i.h1=i.bind(void 0,"h1"),i.h2=i.bind(void 0,"h2"),i.h3=i.bind(void 0,"h3"),i.h4=i.bind(void 0,"h4"),i.h5=i.bind(void 0,"h5"),i.h6=i.bind(void 0,"h6"),i.header=i.bind(void 0,"header"),i.hr=i.bind(void 0,"hr"),i.i=i.bind(void 0,"i"),i.iframe=i.bind(void 0,"iframe"),i.img=i.bind(void 0,"img"),i.input=i.bind(void 0,"input"),i.ins=i.bind(void 0,"ins"),i.kbd=i.bind(void 0,"kbd"),i.label=i.bind(void 0,"label"),i.legend=i.bind(void 0,"legend"),i.li=i.bind(void 0,"li"),i.main=i.bind(void 0,"main"),i.map=i.bind(void 0,"map"),i.mark=i.bind(void 0,"mark"),i.meter=i.bind(void 0,"meter"),i.nav=i.bind(void 0,"nav"),i.noscript=i.bind(void 0,"noscript"),i.object=i.bind(void 0,"object"),i.ol=i.bind(void 0,"ol"),i.optgroup=i.bind(void 0,"optgroup"),i.option=i.bind(void 0,"option"),i.output=i.bind(void 0,"output"),i.p=i.bind(void 0,"p"),i.param=i.bind(void 0,"param"),i.pre=i.bind(void 0,"pre"),i.progress=i.bind(void 0,"progress"),i.q=i.bind(void 0,"q"),i.rp=i.bind(void 0,"rp"),i.rt=i.bind(void 0,"rt"),i.ruby=i.bind(void 0,"ruby"),i.s=i.bind(void 0,"s"),i.samp=i.bind(void 0,"samp"),i.section=i.bind(void 0,"section"),i.select=i.bind(void 0,"select"),i.small=i.bind(void 0,"small"),i.source=i.bind(void 0,"source"),i.span=i.bind(void 0,"span"),i.strong=i.bind(void 0,"strong"),i.sub=i.bind(void 0,"sub"),i.summary=i.bind(void 0,"summary"),i.sup=i.bind(void 0,"sup"),i.table=i.bind(void 0,"table"),i.tbody=i.bind(void 0,"tbody"),i.td=i.bind(void 0,"td"),i.textarea=i.bind(void 0,"textarea"),i.tfoot=i.bind(void 0,"tfoot"),i.th=i.bind(void 0,"th"),i.thead=i.bind(void 0,"thead"),i.time=i.bind(void 0,"time"),i.title=i.bind(void 0,"title"),i.tr=i.bind(void 0,"tr"),i.track=i.bind(void 0,"track"),i.u=i.bind(void 0,"u"),i.ul=i.bind(void 0,"ul"),i.var_=i.bind(void 0,"var"),i.video=i.bind(void 0,"video"),i.wbr=i.bind(void 0,"wbr")}(s||(s={})),i.VirtualDOM=void 0,(n=i.VirtualDOM||(i.VirtualDOM={})).realize=function(i){return d.createDOMNode(i)},n.render=function(i,t){var e=d.hostMap.get(t)||[],n=d.asContentArray(i);d.hostMap.set(t,n),d.updateContent(t,e,n)},function(i){function e(i){var t=arguments[1]||null,n=arguments[2]||null;if(t)t.insertBefore(e(i),n);else{if("text"===i.type)return document.createTextNode(i.content);if(o(t=document.createElement(i.tag),i.attrs),i.renderer)return i.renderer.render(t,{attrs:i.attrs,children:i.children}),t;for(var d=0,r=i.children.length;d<r;++d)e(i.children[d],t)}return t}function n(i,t,e,d){for(var o=t.length-1;o>=e;--o){var r=t[o],a=d?i.lastChild:i.childNodes[o];"text"===r.type||(r.renderer&&r.renderer.unrender?r.renderer.unrender(a,{attrs:r.attrs,children:r.children}):n(a,r.children,0,!1)),d&&i.removeChild(a)}}i.hostMap=new WeakMap,i.asContentArray=function(i){return i?i instanceof Array?i:[i]:[]},i.createDOMNode=e,i.updateContent=function i(d,o,a){if(o!==a){for(var s=function(i,t){for(var e=i.firstChild,n=Object.create(null),d=0,o=t;d<o.length;d++){var r=o[d];"element"===r.type&&r.attrs.key&&(n[r.attrs.key]={vNode:r,element:e}),e=e.nextSibling}return n}(d,o),l=o.slice(),b=d.firstChild,v=a.length,u=0;u<v;++u)if(u>=l.length)e(a[u],d);else{var c=l[u],f=a[u];if(c!==f)if("text"!==c.type||"text"!==f.type)if("text"!==c.type&&"text"!==f.type)if(!c.renderer==!f.renderer){var h=f.attrs.key;if(h&&h in s){var p=s[h];p.vNode!==c&&(t.ArrayExt.move(l,l.indexOf(p.vNode,u+1),u),d.insertBefore(p.element,b),c=p.vNode,b=p.element)}if(c!==f){var m=c.attrs.key;m&&m!==h?(t.ArrayExt.insert(l,u,f),e(f,d,b)):c.tag===f.tag?(r(b,c.attrs,f.attrs),f.renderer?f.renderer.render(b,{attrs:f.attrs,children:f.children}):i(b,c.children,f.children),b=b.nextSibling):(t.ArrayExt.insert(l,u,f),e(f,d,b))}else b=b.nextSibling}else t.ArrayExt.insert(l,u,f),e(f,d,b);else t.ArrayExt.insert(l,u,f),e(f,d,b);else b.textContent!==f.content&&(b.textContent=f.content),b=b.nextSibling;else b=b.nextSibling}n(d,l,v,!0)}};var d={key:!0,className:!0,htmlFor:!0,dataset:!0,style:!0};function o(i,t){for(var e in t)e in d||("on"===e.substr(0,2)?i[e]=t[e]:i.setAttribute(e,t[e]));void 0!==t.className&&i.setAttribute("class",t.className),void 0!==t.htmlFor&&i.setAttribute("for",t.htmlFor),t.dataset&&function(i,t){for(var e in t)i.setAttribute("data-"+e,t[e])}(i,t.dataset),t.style&&function(i,t){var e,n=i.style;for(e in t)n[e]=t[e]}(i,t.style)}function r(i,t,e){if(t!==e){var n;for(n in t)n in d||n in e||("on"===n.substr(0,2)?i[n]=null:i.removeAttribute(n));for(n in e)n in d||t[n]===e[n]||("on"===n.substr(0,2)?i[n]=e[n]:i.setAttribute(n,e[n]));t.className!==e.className&&(void 0!==e.className?i.setAttribute("class",e.className):i.removeAttribute("class")),t.htmlFor!==e.htmlFor&&(void 0!==e.htmlFor?i.setAttribute("for",e.htmlFor):i.removeAttribute("for")),t.dataset!==e.dataset&&function(i,t,e){for(var n in t)n in e||i.removeAttribute("data-"+n);for(var d in e)t[d]!==e[d]&&i.setAttribute("data-"+d,e[d])}(i,t.dataset||{},e.dataset||{}),t.style!==e.style&&function(i,t,e){var n,d=i.style;for(n in t)n in e||(d[n]="");for(n in e)t[n]!==e[n]&&(d[n]=e[n])}(i,t.style||{},e.style||{})}}}(d||(d={})),i.VirtualElement=r,i.VirtualElementPass=a,i.VirtualText=o,i.h=s,i.hpass=function(i){var t={},e=null;if(2===arguments.length){var n=arguments[1];"render"in n?e=n:t=n}else if(3===arguments.length)t=arguments[1],e=arguments[2];else if(arguments.length>3)throw new Error("hpass() should be called with 1, 2, or 3 arguments");return new a(i,t,e)},Object.defineProperty(i,"__esModule",{value:!0})})); | ||
//# sourceMappingURL=index.min.js.map |
{ | ||
"name": "@lumino/virtualdom", | ||
"version": "1.14.2", | ||
"version": "1.14.3", | ||
"description": "Lumino Virtual DOM", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/jupyterlab/lumino", |
@@ -1352,3 +1352,6 @@ // Copyright (c) Jupyter Development Team. | ||
if (oldVNode.type === 'text' && newVNode.type === 'text') { | ||
currElem!.textContent = newVNode.content; | ||
// Avoid spurious updates for performance. | ||
if (currElem!.textContent !== newVNode.content) { | ||
currElem!.textContent = newVNode.content; | ||
} | ||
currElem = currElem!.nextSibling; | ||
@@ -1355,0 +1358,0 @@ continue; |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
393370
3644
0