From d8f654525e1eb666496322d0b96f1ae145e435ea Mon Sep 17 00:00:00 2001 From: "A. Block" <3756473+zendive@users.noreply.github.com> Date: Fri, 15 Sep 2023 02:18:07 +0300 Subject: [PATCH] v3.0.3 (#15) * update jsdiffpatch from 0.4.1 to 0.5.0 --------- Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .vscode/settings.json | 9 +- bundle/js/jsdiff-panel.js | 34 +-- manifest.json | 2 +- package.json | 16 +- pnpm-lock.yaml | 226 +++++++++--------- src/view/panel.header.vue | 157 ++++++++++++ ...rogress-indicator.vue => panel.loader.vue} | 4 +- src/view/panel.vue | 187 ++++----------- 8 files changed, 363 insertions(+), 272 deletions(-) create mode 100644 src/view/panel.header.vue rename src/view/{progress-indicator.vue => panel.loader.vue} (94%) diff --git a/.vscode/settings.json b/.vscode/settings.json index 3de184f..40c20a9 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,3 +1,10 @@ { - "json.schemaDownload.enable": true + "json.schemaDownload.enable": true, + "editor.formatOnSave": true, + "json.schemas": [ + { + "fileMatch": ["manifest.json"], + "url": "https://json.schemastore.org/chrome-manifest.json" + } + ] } diff --git a/bundle/js/jsdiff-panel.js b/bundle/js/jsdiff-panel.js index b11d43c..04cd5e3 100644 --- a/bundle/js/jsdiff-panel.js +++ b/bundle/js/jsdiff-panel.js @@ -1,12 +1,12 @@ -(()=>{var Ml={785:(me,q,ne)=>{"use strict";ne.d(q,{Z:()=>ge});var le=ne(916),ae=ne.n(le),Q=ne(282),G=ne.n(Q),se=G()(ae());se.push([me.id,'.jsondiffpatch-delta{font-family:"Bitstream Vera Sans Mono","DejaVu Sans Mono",Monaco,Courier,monospace;font-size:12px;margin:0;padding:0 0 0 12px;display:inline-block}.jsondiffpatch-delta pre{font-family:"Bitstream Vera Sans Mono","DejaVu Sans Mono",Monaco,Courier,monospace;font-size:12px;margin:0;padding:0;display:inline-block}ul.jsondiffpatch-delta{list-style-type:none;padding:0 0 0 20px;margin:0}.jsondiffpatch-delta ul{list-style-type:none;padding:0 0 0 20px;margin:0}.jsondiffpatch-added .jsondiffpatch-property-name,.jsondiffpatch-added .jsondiffpatch-value pre,.jsondiffpatch-modified .jsondiffpatch-right-value pre,.jsondiffpatch-textdiff-added{background:#bfb}.jsondiffpatch-deleted .jsondiffpatch-property-name,.jsondiffpatch-deleted pre,.jsondiffpatch-modified .jsondiffpatch-left-value pre,.jsondiffpatch-textdiff-deleted{background:#fbb;text-decoration:line-through}.jsondiffpatch-unchanged,.jsondiffpatch-movedestination{color:gray}.jsondiffpatch-unchanged,.jsondiffpatch-movedestination>.jsondiffpatch-value{transition:all .5s;-webkit-transition:all .5s;overflow-y:hidden}.jsondiffpatch-unchanged-showing .jsondiffpatch-unchanged,.jsondiffpatch-unchanged-showing .jsondiffpatch-movedestination>.jsondiffpatch-value{max-height:100px}.jsondiffpatch-unchanged-hidden .jsondiffpatch-unchanged,.jsondiffpatch-unchanged-hidden .jsondiffpatch-movedestination>.jsondiffpatch-value{max-height:0}.jsondiffpatch-unchanged-hiding .jsondiffpatch-movedestination>.jsondiffpatch-value,.jsondiffpatch-unchanged-hidden .jsondiffpatch-movedestination>.jsondiffpatch-value{display:block}.jsondiffpatch-unchanged-visible .jsondiffpatch-unchanged,.jsondiffpatch-unchanged-visible .jsondiffpatch-movedestination>.jsondiffpatch-value{max-height:100px}.jsondiffpatch-unchanged-hiding .jsondiffpatch-unchanged,.jsondiffpatch-unchanged-hiding .jsondiffpatch-movedestination>.jsondiffpatch-value{max-height:0}.jsondiffpatch-unchanged-showing .jsondiffpatch-arrow,.jsondiffpatch-unchanged-hiding .jsondiffpatch-arrow{display:none}.jsondiffpatch-value{display:inline-block}.jsondiffpatch-property-name{display:inline-block;padding-right:5px;vertical-align:top}.jsondiffpatch-property-name:after{content:": "}.jsondiffpatch-child-node-type-array>.jsondiffpatch-property-name:after{content:": ["}.jsondiffpatch-child-node-type-array:after{content:"],"}div.jsondiffpatch-child-node-type-array:before{content:"["}div.jsondiffpatch-child-node-type-array:after{content:"]"}.jsondiffpatch-child-node-type-object>.jsondiffpatch-property-name:after{content:": {"}.jsondiffpatch-child-node-type-object:after{content:"},"}div.jsondiffpatch-child-node-type-object:before{content:"{"}div.jsondiffpatch-child-node-type-object:after{content:"}"}.jsondiffpatch-value pre:after{content:","}li:last-child>.jsondiffpatch-value pre:after,.jsondiffpatch-modified>.jsondiffpatch-left-value pre:after{content:""}.jsondiffpatch-modified .jsondiffpatch-value{display:inline-block}.jsondiffpatch-modified .jsondiffpatch-right-value{margin-left:5px}.jsondiffpatch-moved .jsondiffpatch-value{display:none}.jsondiffpatch-moved .jsondiffpatch-moved-destination{display:inline-block;background:#ffb;color:#888}.jsondiffpatch-moved .jsondiffpatch-moved-destination:before{content:" => "}ul.jsondiffpatch-textdiff{padding:0}.jsondiffpatch-textdiff-location{color:#bbb;display:inline-block;min-width:60px}.jsondiffpatch-textdiff-line{display:inline-block}.jsondiffpatch-textdiff-line-number:after{content:","}.jsondiffpatch-error{background:red;color:#fff;font-weight:bold}',""]);const ge=se},110:(me,q,ne)=>{"use strict";ne.d(q,{Z:()=>ge});var le=ne(916),ae=ne.n(le),Q=ne(282),G=ne.n(Q),se=G()(ae());se.push([me.id,":root{--colour-background: #fff;--colour-text: #000;--colour-text-diff: #000;--colour-found: 0, 222, 255;--header-height: 1.625rem;--header-background: #fff;--header-border: 1px solid #bbb;--button-background: rgba(0, 0, 0, 0.05);--button-hackground-hover: rgba(0, 0, 0, 0.3);--diff-added-background: #bbffbb;--diff-deleted-background: #ffbbbb}.dark{--colour-background: rgb(32 33 36);--colour-text: rgb(189, 198, 207);--colour-found: 0, 191, 255;--header-background: rgb(41, 42, 45);--header-border: 1px solid rgb(73, 76, 80)}*{box-sizing:border-box}body{margin:0 0 0 0;padding:0;overflow:hidden;height:100%}.jsdiff-panel{background-color:var(--colour-background);color:var(--colour-text);display:flex;flex-direction:column;height:100vh}.jsdiff-panel .-header{flex-shrink:0;width:100%;background-color:var(--header-background);border-bottom:var(--header-border);display:flex;align-items:center;height:var(--header-height);min-width:512px;user-select:none}.jsdiff-panel .-header .-toolbox{display:flex;justify-content:center;align-items:center;padding-left:10px}.jsdiff-panel .-header .-toolbox .btn{height:var(--header-height);cursor:pointer;border:none;border-radius:0;outline:none;background-color:var(--button-background);color:var(--colour-text);margin:0 2px}.jsdiff-panel .-header .-toolbox .btn:hover{background-color:var(--button-hackground-hover)}.jsdiff-panel .-header .-toolbox .-last-updated{cursor:default;margin-left:10px}.jsdiff-panel .-header .-toolbox .-last-updated .-value{font-weight:bold;color:var(--colour-text);opacity:.5}.jsdiff-panel .-header .-last-error{display:flex;justify-content:center;align-items:center;padding-left:10px;color:#b62121}.jsdiff-panel .-header .-badge{position:fixed;top:0;right:1rem;display:flex;flex-direction:column;align-items:center;padding:4px 4px}.jsdiff-panel .-header .-badge .-version{font-family:monospace}.jsdiff-panel .-header .-badge .-icon img{width:32px}.jsdiff-panel .-body{flex:1 0 0%;overflow:auto;overflow-wrap:break-word;overflow-anchor:none;transform:translateZ(0)}.jsdiff-panel .-body .-match{display:flex;align-items:center;height:100%}.jsdiff-panel .-body .-match .-center{margin:0 auto;text-align:center;font-size:26px;color:#bbb}.jsdiff-panel .-body .-empty{display:flex;height:calc(100vh - var(--header-height));justify-content:center;align-items:center}.jsdiff-panel .-body .-empty .-links{margin-top:16px;font-size:11px}.jsdiff-panel .-body .-empty .-center{margin:0 auto;text-align:center;font-size:26px;color:#bbb}.jsdiff-panel .-body .-content{padding:.5rem 0}.jsdiff-panel .-body .-content .-delta .jsdiff-found{outline:2px solid rgba(var(--colour-found), 1);outline-offset:-1px}.jsdiff-panel .-body .-content .-delta .jsdiff-found.jsdiff-found-this{color:var(--colour-text-diff);animation:found_this .8s infinite alternate}@keyframes found_this{0%{background-color:rgba(var(--colour-found), 0.6)}100%{background-color:rgba(var(--colour-found), 1)}}.jsdiff-panel .jsondiffpatch-delta pre{white-space:pre-wrap;word-break:break-all}.jsdiff-panel .jsondiffpatch-added .jsondiffpatch-property-name,.jsdiff-panel .jsondiffpatch-added .jsondiffpatch-value pre,.jsdiff-panel .jsondiffpatch-modified .jsondiffpatch-right-value pre,.jsdiff-panel .jsondiffpatch-textdiff-added{background:var(--diff-added-background);color:var(--colour-text-diff)}.jsdiff-panel .jsondiffpatch-deleted .jsondiffpatch-property-name,.jsdiff-panel .jsondiffpatch-deleted pre,.jsdiff-panel .jsondiffpatch-modified .jsondiffpatch-left-value pre,.jsdiff-panel .jsondiffpatch-textdiff-deleted{background:var(--diff-deleted-background);text-decoration:line-through;color:var(--colour-text-diff)}",""]);const ge=se},794:(me,q,ne)=>{"use strict";ne.d(q,{Z:()=>ge});var le=ne(916),ae=ne.n(le),Q=ne(282),G=ne.n(Q),se=G()(ae());se.push([me.id,".progress-indicator[data-v-28e0d635]{background-color:rgba(0,0,0,0);height:2px;width:100%;overflow:hidden;position:fixed;top:0;display:block}.progress-indicator>.-eye[data-v-28e0d635]{background-image:linear-gradient(to right, rgba(179, 7, 247, 0) 15%, rgb(241, 14, 14) 50%, rgba(179, 7, 247, 0) 85%);color:rgba(0,0,0,0);height:100%;width:20%;animation:wt-scanning-eye-animation-28e0d635 1s linear infinite alternate,wt-scanning-eye-animation-blink-28e0d635 1.25s linear infinite alternate}@keyframes wt-scanning-eye-animation-28e0d635{from{transform:translateX(-100%)}to{transform:translateX(500%)}}@keyframes wt-scanning-eye-animation-blink-28e0d635{0%{filter:hue-rotate(0deg)}80%{filter:hue-rotate(0deg)}100%{filter:hue-rotate(360deg)}}",""]);const ge=se},282:me=>{"use strict";me.exports=function(q){var ne=[];return ne.toString=function(){return this.map(function(ae){var Q="",G=typeof ae[5]<"u";return ae[4]&&(Q+="@supports (".concat(ae[4],") {")),ae[2]&&(Q+="@media ".concat(ae[2]," {")),G&&(Q+="@layer".concat(ae[5].length>0?" ".concat(ae[5]):""," {")),Q+=q(ae),G&&(Q+="}"),ae[2]&&(Q+="}"),ae[4]&&(Q+="}"),Q}).join("")},ne.i=function(ae,Q,G,se,ge){typeof ae=="string"&&(ae=[[null,ae,void 0]]);var Ie={};if(G)for(var je=0;je"u"||(Te[1]="@layer".concat(Te[5].length>0?" ".concat(Te[5]):""," {").concat(Te[1],"}")),Te[5]=ge),Q&&(Te[2]&&(Te[1]="@media ".concat(Te[2]," {").concat(Te[1],"}")),Te[2]=Q),se&&(Te[4]?(Te[1]="@supports (".concat(Te[4],") {").concat(Te[1],"}"),Te[4]=se):Te[4]="".concat(se)),ne.push(Te))}},ne}},916:me=>{"use strict";me.exports=function(q){return q[1]}},931:()=>{},908:function(me,q,ne){(function(le,ae){ae(q,ne(931))})(this,function(le,ae){"use strict";ae=ae&&ae.hasOwnProperty("default")?ae.default:ae;var Q=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(E){return typeof E}:function(E){return E&&typeof Symbol=="function"&&E.constructor===Symbol&&E!==Symbol.prototype?"symbol":typeof E},G=function(E,o){if(!(E instanceof o))throw new TypeError("Cannot call a class as a function")},se=function(){function E(o,f){for(var l=0;l"u")return this.pipes[f];this.pipes[f]=d}if(f&&f.name){if(d=f,d.processor===this)return d;this.pipes[d.name]=d}return d.processor=this,d}},{key:"process",value:function(f,l){var d=f;d.options=this.options();for(var a=l||f.pipe||"default",c=void 0,h=void 0;a;)typeof d.nextAfterChildren<"u"&&(d.next=d.nextAfterChildren,d.nextAfterChildren=null),typeof a=="string"&&(a=this.pipe(a)),a.process(d),h=d,c=a,a=null,d&&d.next&&(d=d.next,a=h.nextPipe||d.pipe||c);return d.hasResult?d.result:void 0}}]),E}(),Ze=function(){function E(o){G(this,E),this.name=o,this.filters=[]}return se(E,[{key:"process",value:function(f){if(!this.processor)throw new Error("add this pipe to a processor before using it");for(var l=this.debug,d=this.filters.length,a=f,c=0;c"u"?"undefined":Q(a))==="object"&&a.exiting){a.exiting=!1;break}}!a.next&&this.resultCheck&&this.resultCheck(a)}},{key:"log",value:function(f){console.log("[jsondiffpatch] "+this.name+" pipe, "+f)}},{key:"append",value:function(){var f;return(f=this.filters).push.apply(f,arguments),this}},{key:"prepend",value:function(){var f;return(f=this.filters).unshift.apply(f,arguments),this}},{key:"indexOf",value:function(f){if(!f)throw new Error("a filter name is required");for(var l=0;l"u"?"undefined":Q(E))!=="object")return E;if(E===null)return null;if(Ft(E))return E.map(Se);if(E instanceof Date)return new Date(E.getTime());if(E instanceof RegExp)return _e(E);var o={};for(var f in E)Object.prototype.hasOwnProperty.call(E,f)&&(o[f]=Se(E[f]));return o}var ht=function(E){Ie(o,E);function o(f,l){G(this,o);var d=je(this,(o.__proto__||Object.getPrototypeOf(o)).call(this));return d.left=f,d.right=l,d.pipe="diff",d}return se(o,[{key:"setResult",value:function(l){if(this.options.cloneDiffValues&&(typeof l>"u"?"undefined":Q(l))==="object"){var d=typeof this.options.cloneDiffValues=="function"?this.options.cloneDiffValues:Se;Q(l[0])==="object"&&(l[0]=d(l[0])),Q(l[1])==="object"&&(l[1]=d(l[1]))}return _t.prototype.setResult.apply(this,arguments)}}]),o}(_t),Fe=function(E){Ie(o,E);function o(f,l){G(this,o);var d=je(this,(o.__proto__||Object.getPrototypeOf(o)).call(this));return d.left=f,d.delta=l,d.pipe="patch",d}return o}(_t),Rn=function(E){Ie(o,E);function o(f){G(this,o);var l=je(this,(o.__proto__||Object.getPrototypeOf(o)).call(this));return l.delta=f,l.pipe="reverse",l}return o}(_t),an=typeof Array.isArray=="function"?Array.isArray:function(E){return E instanceof Array},Dt=function(o){if(o.left===o.right){o.setResult(void 0).exit();return}if(typeof o.left>"u"){if(typeof o.right=="function")throw new Error("functions are not supported");o.setResult([o.right]).exit();return}if(typeof o.right>"u"){o.setResult([o.left,0,0]).exit();return}if(typeof o.left=="function"||typeof o.right=="function")throw new Error("functions are not supported");if(o.leftType=o.left===null?"null":Q(o.left),o.rightType=o.right===null?"null":Q(o.right),o.leftType!==o.rightType){o.setResult([o.left,o.right]).exit();return}if(o.leftType==="boolean"||o.leftType==="number"){o.setResult([o.left,o.right]).exit();return}if(o.leftType==="object"&&(o.leftIsArray=an(o.left)),o.rightType==="object"&&(o.rightIsArray=an(o.right)),o.leftIsArray!==o.rightIsArray){o.setResult([o.left,o.right]).exit();return}o.left instanceof RegExp&&(o.right instanceof RegExp?o.setResult([o.left.toString(),o.right.toString()]).exit():o.setResult([o.left,o.right]).exit())};Dt.filterName="trivial";var Wr=function(o){if(typeof o.delta>"u"){o.setResult(o.left).exit();return}if(o.nested=!an(o.delta),!o.nested){if(o.delta.length===1){o.setResult(o.delta[0]).exit();return}if(o.delta.length===2){if(o.left instanceof RegExp){var f=/^\/(.*)\/([gimyu]+)$/.exec(o.delta[1]);if(f){o.setResult(new RegExp(f[1],f[2])).exit();return}}o.setResult(o.delta[1]).exit();return}o.delta.length===3&&o.delta[2]===0&&o.setResult(void 0).exit()}};Wr.filterName="trivial";var or=function(o){if(typeof o.delta>"u"){o.setResult(o.delta).exit();return}if(o.nested=!an(o.delta),!o.nested){if(o.delta.length===1){o.setResult([o.delta[0],0,0]).exit();return}if(o.delta.length===2){o.setResult([o.delta[1],o.delta[0]]).exit();return}o.delta.length===3&&o.delta[2]===0&&o.setResult([o.delta[0]]).exit()}};or.filterName="trivial";function Pn(E){if(!(!E||!E.children)){for(var o=E.children.length,f=void 0,l=E.result,d=0;d"u")&&(l=l||{},l[f.childName]=f.result);l&&E.leftIsArray&&(l._t="a"),E.setResult(l).exit()}}Pn.filterName="collectChildren";function ln(E){if(!(E.leftIsArray||E.leftType!=="object")){var o=void 0,f=void 0,l=E.options.propertyFilter;for(o in E.left)Object.prototype.hasOwnProperty.call(E.left,o)&&(l&&!l(o,E)||(f=new ht(E.left[o],E.right[o]),E.push(f,o)));for(o in E.right)Object.prototype.hasOwnProperty.call(E.right,o)&&(l&&!l(o,E)||typeof E.left[o]>"u"&&(f=new ht(void 0,E.right[o]),E.push(f,o)));if(!E.children||E.children.length===0){E.setResult(void 0).exit();return}E.exit()}}ln.filterName="objects";var Ui=function(o){if(o.nested&&!o.delta._t){var f=void 0,l=void 0;for(f in o.delta)l=new Fe(o.left[f],o.delta[f]),o.push(l,f);o.exit()}};Ui.filterName="objects";var fn=function(o){if(!(!o||!o.children)&&!o.delta._t){for(var f=o.children.length,l=void 0,d=0;dm?--c:--a}}return h},ar=function(o,f,l,d){var a=d||{},c=Nt(o,f,l||xi,a),h=qr(c,o,f,a);return typeof o=="string"&&typeof f=="string"&&(h.sequence=h.sequence.join("")),h},un={get:ar},pt=3,cn=typeof Array.isArray=="function"?Array.isArray:function(E){return E instanceof Array},dn=typeof Array.prototype.indexOf=="function"?function(E,o){return E.indexOf(o)}:function(E,o){for(var f=E.length,l=0;l"u"?"undefined":Q(a))!=="object"||(typeof c>"u"?"undefined":Q(c))!=="object")return!1;var h=d.objectHash;if(!h)return d.matchByPosition&&f===l;var g=void 0,_=void 0;return typeof f=="number"?(d.hashCache1=d.hashCache1||[],g=d.hashCache1[f],typeof g>"u"&&(d.hashCache1[f]=g=h(a,f))):g=h(a),typeof g>"u"||(typeof l=="number"?(d.hashCache2=d.hashCache2||[],_=d.hashCache2[l],typeof _>"u"&&(d.hashCache2[l]=_=h(c,l))):_=h(c),typeof _>"u")?!1:g===_}var Sn=function(o){if(o.leftIsArray){var f={objectHash:o.options&&o.options.objectHash,matchByPosition:o.options&&o.options.matchByPosition},l=0,d=0,a=void 0,c=void 0,h=void 0,g=o.left,_=o.right,m=g.length,C=_.length,j=void 0;for(m>0&&C>0&&!f.objectHash&&typeof f.matchByPosition!="boolean"&&(f.matchByPosition=!Jr(g,_,m,C));l0){for(var Pe=0;Pe=0;f--){l=c[f];var _=d["_"+l],m=a.splice(l,1)[0];_[2]===pt&&h.push({index:_[1],value:m})}h=h.sort(Yr.numericallyBy("index"));var C=h.length;for(f=0;f0)for(f=0;fd?d++:h>=d&&g"u"&&(a=so(E.delta,f.childName,f.result)),l[a]!==f.result&&(l[a]=f.result)}E.setResult(l).exit()}}Zr.filterName="arraysCollectChildren";var lr=function(o){o.left instanceof Date?(o.right instanceof Date?o.left.getTime()!==o.right.getTime()?o.setResult([o.left,o.right]):o.setResult(void 0):o.setResult([o.left,o.right]),o.exit()):o.right instanceof Date&&o.setResult([o.left,o.right]).exit()};lr.filterName="dates";function oo(E,o){return o={exports:{}},E(o,o.exports),o.exports}var zt=oo(function(E){function o(){this.Diff_Timeout=1,this.Diff_EditCost=4,this.Match_Threshold=.5,this.Match_Distance=1e3,this.Patch_DeleteThreshold=.5,this.Patch_Margin=4,this.Match_MaxBits=32}var f=-1,l=1,d=0;o.prototype.diff_main=function(a,c,h,g){typeof g>"u"&&(this.Diff_Timeout<=0?g=Number.MAX_VALUE:g=new Date().getTime()+this.Diff_Timeout*1e3);var _=g;if(a==null||c==null)throw new Error("Null input. (diff_main)");if(a==c)return a?[[d,a]]:[];typeof h>"u"&&(h=!0);var m=h,C=this.diff_commonPrefix(a,c),j=a.substring(0,C);a=a.substring(C),c=c.substring(C),C=this.diff_commonSuffix(a,c);var M=a.substring(a.length-C);a=a.substring(0,a.length-C),c=c.substring(0,c.length-C);var N=this.diff_compute_(a,c,m,_);return j&&N.unshift([d,j]),M&&N.push([d,M]),this.diff_cleanupMerge(N),N},o.prototype.diff_compute_=function(a,c,h,g){var _;if(!a)return[[l,c]];if(!c)return[[f,a]];var m=a.length>c.length?a:c,C=a.length>c.length?c:a,j=m.indexOf(C);if(j!=-1)return _=[[l,m.substring(0,j)],[d,C],[l,m.substring(j+C.length)]],a.length>c.length&&(_[0][0]=_[2][0]=f),_;if(C.length==1)return[[f,a],[l,c]];var M=this.diff_halfMatch_(a,c);if(M){var N=M[0],x=M[1],X=M[2],de=M[3],ve=M[4],Ce=this.diff_main(N,X,h,g),Me=this.diff_main(x,de,h,g);return Ce.concat([[d,ve]],Me)}return h&&a.length>100&&c.length>100?this.diff_lineMode_(a,c,g):this.diff_bisect_(a,c,g)},o.prototype.diff_lineMode_=function(a,c,h){var g=this.diff_linesToChars_(a,c);a=g.chars1,c=g.chars2;var _=g.lineArray,m=this.diff_main(a,c,!1,h);this.diff_charsToLines_(m,_),this.diff_cleanupSemantic(m),m.push([d,""]);for(var C=0,j=0,M=0,N="",x="";C=1&&M>=1){m.splice(C-j-M,j+M),C=C-j-M;for(var g=this.diff_main(N,x,!1,h),X=g.length-1;X>=0;X--)m.splice(C,0,g[X]);C=C+g.length}M=0,j=0,N="",x="";break}C++}return m.pop(),m},o.prototype.diff_bisect_=function(a,c,h){for(var g=a.length,_=c.length,m=Math.ceil((g+_)/2),C=m,j=2*m,M=new Array(j),N=new Array(j),x=0;xh);ke++){for(var Pe=-ke+ve;Pe<=ke-Ce;Pe+=2){var xe=C+Pe,Be;Pe==-ke||Pe!=ke&&M[xe-1]g)Ce+=2;else if(qe>_)ve+=2;else if(de){var Ke=C+X-Pe;if(Ke>=0&&Ke=$e)return this.diff_bisectSplit_(a,c,Be,qe,h)}}}for(var Xe=-ke+Me;Xe<=ke-Ne;Xe+=2){var Ke=C+Xe,$e;Xe==-ke||Xe!=ke&&N[Ke-1]g)Ne+=2;else if(vt>_)Me+=2;else if(!de){var xe=C+X-Xe;if(xe>=0&&xe=$e)return this.diff_bisectSplit_(a,c,Be,qe,h)}}}}return[[f,a],[l,c]]},o.prototype.diff_bisectSplit_=function(a,c,h,g,_){var m=a.substring(0,h),C=c.substring(0,g),j=a.substring(h),M=c.substring(g),N=this.diff_main(m,C,!1,_),x=this.diff_main(j,M,!1,_);return N.concat(x)},o.prototype.diff_linesToChars_=function(a,c){var h=[],g={};h[0]="";function _(j){for(var M="",N=0,x=-1,X=h.length;xg?a=a.substring(h-g):hc.length?a:c,g=a.length>c.length?c:a;if(h.length<4||g.length*2=Ce.length?[Be,qe,Ke,$e,xe]:null}var C=m(h,g,Math.ceil(h.length/4)),j=m(h,g,Math.ceil(h.length/2)),M;if(!C&&!j)return null;j?C?M=C[4].length>j[4].length?C:j:M=j:M=C;var N,x,X,de;a.length>c.length?(N=M[0],x=M[1],X=M[2],de=M[3]):(X=M[0],de=M[1],N=M[2],x=M[3]);var ve=M[4];return[N,x,X,de,ve]},o.prototype.diff_cleanupSemantic=function(a){for(var c=!1,h=[],g=0,_=null,m=0,C=0,j=0,M=0,N=0;m0?h[g-1]:-1,C=0,j=0,M=0,N=0,_=null,c=!0)),m++;for(c&&this.diff_cleanupMerge(a),this.diff_cleanupSemanticLossless(a),m=1;m=ve?(de>=x.length/2||de>=X.length/2)&&(a.splice(m,0,[d,X.substring(0,de)]),a[m-1][1]=x.substring(0,x.length-de),a[m+1][1]=X.substring(de),m++):(ve>=x.length/2||ve>=X.length/2)&&(a.splice(m,0,[d,x.substring(0,ve)]),a[m-1][0]=l,a[m-1][1]=X.substring(0,X.length-ve),a[m+1][0]=f,a[m+1][1]=x.substring(ve),m++),m++}m++}},o.prototype.diff_cleanupSemanticLossless=function(a){function c(ve,Ce){if(!ve||!Ce)return 6;var Me=ve.charAt(ve.length-1),Ne=Ce.charAt(0),ke=Me.match(o.nonAlphaNumericRegex_),Pe=Ne.match(o.nonAlphaNumericRegex_),xe=ke&&Me.match(o.whitespaceRegex_),Be=Pe&&Ne.match(o.whitespaceRegex_),qe=xe&&Me.match(o.linebreakRegex_),Ke=Be&&Ne.match(o.linebreakRegex_),$e=qe&&ve.match(o.blanklineEndRegex_),Xe=Ke&&Ce.match(o.blanklineStartRegex_);return $e||Xe?5:qe||Ke?4:ke&&!xe&&Be?3:xe||Be?2:ke||Pe?1:0}for(var h=1;h=X&&(X=de,M=g,N=_,x=m)}a[h-1][1]!=M&&(M?a[h-1][1]=M:(a.splice(h-1,1),h--),a[h][1]=N,x?a[h+1][1]=x:(a.splice(h+1,1),h--))}h++}},o.nonAlphaNumericRegex_=/[^a-zA-Z0-9]/,o.whitespaceRegex_=/\s/,o.linebreakRegex_=/[\r\n]/,o.blanklineEndRegex_=/\n\r?\n$/,o.blanklineStartRegex_=/^\r?\n\r?\n/,o.prototype.diff_cleanupEfficiency=function(a){for(var c=!1,h=[],g=0,_=null,m=0,C=!1,j=!1,M=!1,N=!1;m0?h[g-1]:-1,M=N=!1),c=!0)),m++;c&&this.diff_cleanupMerge(a)},o.prototype.diff_cleanupMerge=function(a){a.push([d,""]);for(var c=0,h=0,g=0,_="",m="",C;c1?(h!==0&&g!==0&&(C=this.diff_commonPrefix(m,_),C!==0&&(c-h-g>0&&a[c-h-g-1][0]==d?a[c-h-g-1][1]+=m.substring(0,C):(a.splice(0,0,[d,m.substring(0,C)]),c++),m=m.substring(C),_=_.substring(C)),C=this.diff_commonSuffix(m,_),C!==0&&(a[c][1]=m.substring(m.length-C)+a[c][1],m=m.substring(0,m.length-C),_=_.substring(0,_.length-C))),h===0?a.splice(c-g,h+g,[l,m]):g===0?a.splice(c-h,h+g,[f,_]):a.splice(c-h-g,h+g,[f,_],[l,m]),c=c-h-g+(h?1:0)+(g?1:0)+1):c!==0&&a[c-1][0]==d?(a[c-1][1]+=a[c][1],a.splice(c,1)):c++,g=0,h=0,_="",m="";break}a[a.length-1][1]===""&&a.pop();var j=!1;for(c=1;cc));C++)_=h,m=g;return a.length!=C&&a[C][0]===f?m:m+(c-_)},o.prototype.diff_prettyHtml=function(a){for(var c=[],h=/&/g,g=//g,m=/\n/g,C=0;C");switch(j){case l:c[C]=''+N+"";break;case f:c[C]=''+N+"";break;case d:c[C]=""+N+"";break}}return c.join("")},o.prototype.diff_text1=function(a){for(var c=[],h=0;hthis.Match_MaxBits)throw new Error("Pattern too long for this browser.");var g=this.match_alphabet_(c),_=this;function m(Be,qe){var Ke=Be/c.length,$e=Math.abs(h-qe);return _.Match_Distance?Ke+$e/_.Match_Distance:$e?1:Ke}var C=this.Match_Threshold,j=a.indexOf(c,h);j!=-1&&(C=Math.min(m(0,j),C),j=a.lastIndexOf(c,h+c.length),j!=-1&&(C=Math.min(m(0,j),C)));var M=1<=Ce;ke--){var Pe=g[a.charAt(ke-1)];if(ve===0?Ne[ke]=(Ne[ke+1]<<1|1)&Pe:Ne[ke]=(Ne[ke+1]<<1|1)&Pe|((de[ke+1]|de[ke])<<1|1)|de[ke+1],Ne[ke]&M){var xe=m(ve,ke-1);if(xe<=C)if(C=xe,j=ke-1,j>h)Ce=Math.max(1,2*h-j);else break}}if(m(ve+1,h)>C)break;de=Ne}return j},o.prototype.match_alphabet_=function(a){for(var c={},h=0;h"u")g=a,_=this.diff_main(g,c,!0),_.length>2&&(this.diff_cleanupSemantic(_),this.diff_cleanupEfficiency(_));else if(a&&typeof a=="object"&&typeof c>"u"&&typeof h>"u")_=a,g=this.diff_text1(_);else if(typeof a=="string"&&c&&typeof c=="object"&&typeof h>"u")g=a,_=c;else if(typeof a=="string"&&typeof c=="string"&&h&&typeof h=="object")g=a,_=h;else throw new Error("Unknown call format to patch_make.");if(_.length===0)return[];for(var m=[],C=new o.patch_obj,j=0,M=0,N=0,x=g,X=g,de=0;de<_.length;de++){var ve=_[de][0],Ce=_[de][1];switch(!j&&ve!==d&&(C.start1=M,C.start2=N),ve){case l:C.diffs[j++]=_[de],C.length2+=Ce.length,X=X.substring(0,N)+Ce+X.substring(N);break;case f:C.length1+=Ce.length,C.diffs[j++]=_[de],X=X.substring(0,N)+X.substring(N+Ce.length);break;case d:Ce.length<=2*this.Patch_Margin&&j&&_.length!=de+1?(C.diffs[j++]=_[de],C.length1+=Ce.length,C.length2+=Ce.length):Ce.length>=2*this.Patch_Margin&&j&&(this.patch_addContext_(C,x),m.push(C),C=new o.patch_obj,j=0,x=X,M=N);break}ve!==l&&(M+=Ce.length),ve!==f&&(N+=Ce.length)}return j&&(this.patch_addContext_(C,x),m.push(C)),m},o.prototype.patch_deepCopy=function(a){for(var c=[],h=0;hthis.Match_MaxBits?(M=this.match_main(c,j.substring(0,this.Match_MaxBits),C),M!=-1&&(N=this.match_main(c,j.substring(j.length-this.Match_MaxBits),C+j.length-this.Match_MaxBits),(N==-1||M>=N)&&(M=-1))):M=this.match_main(c,j,C),M==-1)_[m]=!1,g-=a[m].length2-a[m].length1;else{_[m]=!0,g=M-C;var x;if(N==-1?x=c.substring(M,M+j.length):x=c.substring(M,N+this.Match_MaxBits),j==x)c=c.substring(0,M)+this.diff_text2(a[m].diffs)+c.substring(M+j.length);else{var X=this.diff_main(j,x,!1);if(j.length>this.Match_MaxBits&&this.diff_levenshtein(X)/j.length>this.Patch_DeleteThreshold)_[m]=!1;else{this.diff_cleanupSemanticLossless(X);for(var de=0,ve,Ce=0;Cem[0][1].length){var C=c-m[0][1].length;m[0][1]=h.substring(m[0][1].length)+m[0][1],_.start1-=C,_.start2-=C,_.length1+=C,_.length2+=C}if(_=a[a.length-1],m=_.diffs,m.length==0||m[m.length-1][0]!=d)m.push([d,h]),_.length1+=c,_.length2+=c;else if(c>m[m.length-1][1].length){var C=c-m[m.length-1][1].length;m[m.length-1][1]+=h.substring(0,C),_.length1+=C,_.length2+=C}return h},o.prototype.patch_splitMax=function(a){for(var c=this.Match_MaxBits,h=0;h2*c?(j.length1+=x.length,_+=x.length,M=!1,j.diffs.push([N,x]),g.diffs.shift()):(x=x.substring(0,c-j.length1-this.Patch_Margin),j.length1+=x.length,_+=x.length,N===d?(j.length2+=x.length,m+=x.length):M=!1,j.diffs.push([N,x]),x==g.diffs[0][1]?g.diffs.shift():g.diffs[0][1]=g.diffs[0][1].substring(x.length))}C=this.diff_text2(j.diffs),C=C.substring(C.length-this.Patch_Margin);var X=this.diff_text1(g.diffs).substring(0,this.Patch_Margin);X!==""&&(j.length1+=X.length,j.length2+=X.length,j.diffs.length!==0&&j.diffs[j.diffs.length-1][0]===d?j.diffs[j.diffs.length-1][1]+=X:j.diffs.push([d,X])),M||a.splice(++h,0,j)}}},o.prototype.patch_toText=function(a){for(var c=[],h=0;h"u"&&typeof a>"u")){var C=this.getDeltaType(l,h),j=C==="node"?l._t==="a"?"array":"object":"";typeof a<"u"?this.nodeBegin(f,a,c,C,j,g):this.rootBegin(f,C,j);var M=void 0;try{M=this["format_"+C]||this.typeFormattterNotFound(f,C),M.call(this,f,l,m,a,c,h)}catch(N){this.typeFormattterErrorFormatter(f,N,l,m,a,c,h),typeof console<"u"&&console.error&&console.error(N.stack)}typeof a<"u"?this.nodeEnd(f,a,c,C,j,g):this.rootEnd(f,C,j)}}},{key:"formatDeltaChildren",value:function(f,l,d){var a=this;this.forEachDeltaKey(l,d,function(c,h,g,_){a.recurse(f,l[c],d?d[h]:void 0,c,h,g,_)})}},{key:"forEachDeltaKey",value:function(f,l,d){var a=lo(f),c=f._t==="a",h={},g=void 0;if(typeof l<"u")for(g in l)Object.prototype.hasOwnProperty.call(l,g)&&typeof f[g]>"u"&&(!c||typeof f["_"+g]>"u")&&a.push(g);for(g in f)if(Object.prototype.hasOwnProperty.call(f,g)){var _=f[g];Qr(_)&&_[2]===3&&(h[_[1].toString()]={key:g,value:l&&l[parseInt(g.substr(1))]},this.includeMoveDestinations!==!1&&typeof l>"u"&&typeof f[_[1]]>"u"&&a.push(_[1].toString()))}c?a.sort(Gr):a.sort();for(var m=0,C=a.length;m"u")return typeof l<"u"?"movedestination":"unchanged";if(Qr(f)){if(f.length===1)return"added";if(f.length===2)return"modified";if(f.length===3&&f[2]===0)return"deleted";if(f.length===3&&f[2]===2)return"textdiff";if(f.length===3&&f[2]===3)return"moved"}else if((typeof f>"u"?"undefined":Q(f))==="object")return"node";return"unknown"}},{key:"parseTextDiff",value:function(f){for(var l=[],d=f.split(` -@@ `),a=0,c=d.length;a'+d+"")}},{key:"formatValue",value:function(l,d){l.out("
"+ei(JSON.stringify(d,null,2))+"
")}},{key:"formatTextDiffString",value:function(l,d){var a=this.parseTextDiff(d);l.out('
    ');for(var c=0,h=a.length;c
    '+(''+g.location.line+''+g.location.chr+'
    '));for(var _=g.pieces,m=0,C=_.length;m'+ei(decodeURI(j.text))+"")}l.out("
    ")}l.out("
")}},{key:"rootBegin",value:function(l,d,a){var c="jsondiffpatch-"+d+(a?" jsondiffpatch-child-node-type-"+a:"");l.out('
')}},{key:"rootEnd",value:function(l){l.out("
"+(l.hasArrows?' + + diff --git a/src/view/progress-indicator.vue b/src/view/panel.loader.vue similarity index 94% rename from src/view/progress-indicator.vue rename to src/view/panel.loader.vue index 3ccc2dc..528bffb 100644 --- a/src/view/progress-indicator.vue +++ b/src/view/panel.loader.vue @@ -1,5 +1,5 @@ @@ -7,7 +7,7 @@