v-code-diff 1.12.0 → 1.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/v2/index.cjs.js +1 -1
- package/dist/v2/index.es.js +0 -1
- package/dist/v2/index.umd.js +9 -9
- package/dist/v2.7/index.cjs.js +1 -1
- package/dist/v2.7/index.es.js +0 -1
- package/dist/v2.7/index.umd.js +1 -1
- package/dist/v3/index.cjs.js +9 -9
- package/dist/v3/index.es.js +0 -1
- package/dist/v3/index.umd.js +1 -1
- package/package.json +1 -1
- package/src/split/SplitLine.vue +0 -2
package/dist/v2.7/index.cjs.js
CHANGED
|
@@ -13,6 +13,6 @@ https://github.com/highlightjs/highlight.js/issues/2277`),F=b,P=y),L===void 0&&(
|
|
|
13
13
|
`);if(A===void 0){for(const C of N){let I=i(),$=i();const B=Y(s,C);S===T.EQUAL&&(c++,f++,I=a(T.EQUAL,c,B),$=a(T.EQUAL,f,B)),S===T.DELETE&&(c++,I=a(T.DELETE,c,B),$=i()),S===T.ADD&&(f++,I=i(),$=a(T.ADD,f,B)),d.push({left:I,right:$})}break}if(S===T.EQUAL)for(const C of N){c++,f++;const I=Y(s,C);d.push({left:a(T.EQUAL,c,I),right:a(T.EQUAL,f,I)})}const R=A.value.replace(/\n$/,"").split(`
|
|
14
14
|
`);if(S===T.DELETE){if(D===T.EQUAL)for(const C of N)c++,d.push({left:a(T.DELETE,c,Y(s,C)),right:i()});if(D===T.ADD){g=!0;const C=Math.max(E.count,A.count);for(let I=0;I<C;I++){I<E.count&&c++,I<A.count&&f++;const[$,B]=[N[I],R[I]],H=h||N.length===R.length,K=H?Me(B,$,u):$,re=H?Me($,B,u):B,ce=l!=null&&l.test($)?T.EQUAL:T.DELETE,b=l!=null&&l.test(B)?T.EQUAL:T.ADD,y=I<E.count?a(ce,c,Y(s,K)):i(),L=I<A.count?a(b,f,Y(s,re)):i();d.push({left:y,right:L})}}}if(S===T.ADD)for(const C of N)f++,d.push({left:i(),right:a(T.ADD,f,Y(s,C))})}if(n===e){for(let m=0;m<d.length;m++)d[m].fold=!1;return _}for(let m=0;m<d.length;m++){const E=d[m];if(E.left.type===T.DELETE||E.right.type===T.ADD){const[A,S]=[Math.max(m-t,0),Math.min(m+t+1,d.length)];for(let D=A;D<S;D++)d[D].fold=!1}E.fold===void 0&&(E.fold=!0)}const p=[];let v=[];for(let m=0;m<d.length;m++){const E=d[m];if(E.fold===!1){v.length&&(v[0].hideIndex=_.collector.length,_.collector.push({lines:v,fold:!0}),v=[]),p.push(E);continue}E.hide=!0,v.push(E),p.push(E)}return v.length&&(v[0].hideIndex=_.collector.length,_.collector.push({lines:v,fold:!0}),v=[]),_.changes=p,_}function Yt(n,e,s="plaintext",u="word",h=!1,t=10,r){const i=En(n,e),a=r?new RegExp(r):void 0;let o=0,l=0,c=!1;const f=[],g={changes:f,collector:[],stat:wn(i,a)};for(let p=0;p<i.length;p++){if(c){c=!1;continue}const[v,m]=[i[p],i[p+1]],[E,A]=[he(v),he(m)],S=v.value.replace(/\n$/,"").split(`
|
|
15
15
|
`);if(m===void 0){for(const N of S){E===T.EQUAL&&(o++,l++),E===T.DELETE&&o++,E===T.ADD&&l++;const R=Y(s,N);f.push({type:E,code:R,addNum:E===T.DELETE?void 0:l,delNum:E===T.ADD?void 0:o})}break}if(E===T.EQUAL)for(const N of S){o++,l++;const R=Y(s,N);f.push({type:T.EQUAL,code:R,delNum:o,addNum:l})}const D=m.value.replace(/\n$/,"").split(`
|
|
16
|
-
`);if(E===T.DELETE)if(A===T.ADD&&(S.length===D.length||h)){for(let N=0;N<S.length;N++){const R=S[N],C=D[N];o++;const I=Y(s,Me(C,R,u));f.push({type:a!=null&&a.test(R)?T.EQUAL:T.DELETE,code:I,delNum:o})}for(let N=0;N<D.length;N++){const R=S[N],C=D[N];l++;const I=Y(s,Me(R,C,u));f.push({type:a!=null&&a.test(C)?T.EQUAL:T.ADD,code:I,addNum:l})}c=!0}else for(const N of S){o++;const R=Y(s,N);f.push({type:T.DELETE,code:R,delNum:o})}if(E===T.ADD)for(const N of S){l++;const R=Y(s,N);f.push({type:T.ADD,code:R,addNum:l})}}for(let p=0;p<f.length;p++){const v=f[p];if(v.type===T.DELETE||v.type===T.ADD){const[m,E]=[Math.max(p-t,0),Math.min(p+t+1,f.length)];for(let A=m;A<E;A++)f[A].fold=!1}v.fold===void 0&&(v.fold=!0)}if(n===e){for(let p=0;p<f.length;p++)f[p].fold=!1;return g}const d=[];let _=[];for(let p=0;p<f.length;p++){const v=f[p];if(v.fold===!1){_.length&&(_[0].hideIndex=g.collector.length,g.collector.push({lines:_,fold:!0}),_=[]),d.push(v);continue}v.type==="equal"&&(v.hide=!0,_.push(v)),d.push(v)}return _.length&&(_[0].hideIndex=g.collector.length,g.collector.push({lines:_,fold:!0}),_=[]),g.changes=d,g}const Xt=Q.defineComponent({__name:"UnifiedLine",props:{line:null},emits:["expand"],setup(n,{emit:e}){function s(u){return u===T.DELETE?"-":u===T.ADD?"+":""}return{__sfc:!0,emit:e,getCodeMarker:s,DiffType:T}}});function le(n,e,s,u,h,t,r,i){var a=typeof n=="function"?n.options:n;e&&(a.render=e,a.staticRenderFns=s,a._compiled=!0),u&&(a.functional=!0),t&&(a._scopeId="data-v-"+t);var o;if(r?(o=function(f){f=f||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,!f&&typeof __VUE_SSR_CONTEXT__!="undefined"&&(f=__VUE_SSR_CONTEXT__),h&&h.call(this,f),f&&f._registeredComponents&&f._registeredComponents.add(r)},a._ssrRegister=o):h&&(o=i?function(){h.call(this,(a.functional?this.parent:this).$root.$options.shadowRoot)}:h),o)if(a.functional){a._injectStyles=o;var l=a.render;a.render=function(g,d){return o.call(d),l(g,d)}}else{var c=a.beforeCreate;a.beforeCreate=c?[].concat(c,o):[o]}return{exports:n,options:a}}var jt=function(){var e=this,s=e._self._c,u=e._self._setupProxy;return e.line.hideIndex!==void 0&&e.line.hide?s("tr",[s("td",{staticClass:"blob-num blob-num-hunk text-center",attrs:{colspan:"2"},on:{click:function(h){return u.emit("expand",e.line)}}},[e._v(" > ")]),s("td",{staticClass:"blob-code blob-code-hunk",attrs:{align:"left"}},[e._v(" ⋯ ")])]):e.line.hide?e._e():s("tr",[s("td",{staticClass:"blob-num",class:{"blob-num-deletion":e.line.type===u.DiffType.DELETE,"blob-num-addition":e.line.type===u.DiffType.ADD,"blob-num-context":e.line.type===u.DiffType.EQUAL,"blob-num-hunk":e.line.hide!==void 0}},[e._v(" "+e._s(e.line.delNum)+" ")]),s("td",{staticClass:"blob-num",class:{"blob-num-deletion":e.line.type===u.DiffType.DELETE,"blob-num-addition":e.line.type===u.DiffType.ADD,"blob-num-context":e.line.type===u.DiffType.EQUAL,"blob-num-hunk":e.line.hide!==void 0}},[e._v(" "+e._s(e.line.addNum)+" ")]),s("td",{staticClass:"blob-code",class:{"blob-code-deletion":e.line.type===u.DiffType.DELETE,"blob-code-addition":e.line.type===u.DiffType.ADD,"blob-code-context":e.line.type===u.DiffType.EQUAL,"blob-code-hunk":e.line.hide!==void 0}},[s("span",{staticClass:"blob-code-inner blob-code-marker",attrs:{"data-code-marker":u.getCodeMarker(e.line.type)},domProps:{innerHTML:e._s(e.line.code)}})])])},qt=[],Jt=le(Xt,jt,qt,!1,null,null,null,null);const er=Jt.exports,nr=Q.defineComponent({__name:"UnifiedViewer",props:{diffChange:null},setup(n){const e=n;function s({hideIndex:u}){u!==void 0&&e.diffChange.collector[u].lines.forEach(h=>{h.hide=!1,h.fold=!1})}return{__sfc:!0,props:e,expandHandler:s,UnifiedLine:er}}});var tr=function(){var h;var e=this,s=e._self._c,u=e._self._setupProxy;return s("table",{staticClass:"diff-table"},[s("tbody",e._l((h=e.diffChange)==null?void 0:h.changes,function(t,r){return s(u.UnifiedLine,{key:r,attrs:{line:t},on:{expand:u.expandHandler}})}),1)])},rr=[],ir=le(nr,tr,rr,!1,null,"238e1326",null,null);const sr=ir.exports,ar=Q.defineComponent({__name:"SplitLine",props:{splitLine:null},emits:["expand"],setup(n,{emit:e}){function s(h){return h===T.DELETE?"-":h===T.ADD?"+":""}function u(h){
|
|
16
|
+
`);if(E===T.DELETE)if(A===T.ADD&&(S.length===D.length||h)){for(let N=0;N<S.length;N++){const R=S[N],C=D[N];o++;const I=Y(s,Me(C,R,u));f.push({type:a!=null&&a.test(R)?T.EQUAL:T.DELETE,code:I,delNum:o})}for(let N=0;N<D.length;N++){const R=S[N],C=D[N];l++;const I=Y(s,Me(R,C,u));f.push({type:a!=null&&a.test(C)?T.EQUAL:T.ADD,code:I,addNum:l})}c=!0}else for(const N of S){o++;const R=Y(s,N);f.push({type:T.DELETE,code:R,delNum:o})}if(E===T.ADD)for(const N of S){l++;const R=Y(s,N);f.push({type:T.ADD,code:R,addNum:l})}}for(let p=0;p<f.length;p++){const v=f[p];if(v.type===T.DELETE||v.type===T.ADD){const[m,E]=[Math.max(p-t,0),Math.min(p+t+1,f.length)];for(let A=m;A<E;A++)f[A].fold=!1}v.fold===void 0&&(v.fold=!0)}if(n===e){for(let p=0;p<f.length;p++)f[p].fold=!1;return g}const d=[];let _=[];for(let p=0;p<f.length;p++){const v=f[p];if(v.fold===!1){_.length&&(_[0].hideIndex=g.collector.length,g.collector.push({lines:_,fold:!0}),_=[]),d.push(v);continue}v.type==="equal"&&(v.hide=!0,_.push(v)),d.push(v)}return _.length&&(_[0].hideIndex=g.collector.length,g.collector.push({lines:_,fold:!0}),_=[]),g.changes=d,g}const Xt=Q.defineComponent({__name:"UnifiedLine",props:{line:null},emits:["expand"],setup(n,{emit:e}){function s(u){return u===T.DELETE?"-":u===T.ADD?"+":""}return{__sfc:!0,emit:e,getCodeMarker:s,DiffType:T}}});function le(n,e,s,u,h,t,r,i){var a=typeof n=="function"?n.options:n;e&&(a.render=e,a.staticRenderFns=s,a._compiled=!0),u&&(a.functional=!0),t&&(a._scopeId="data-v-"+t);var o;if(r?(o=function(f){f=f||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,!f&&typeof __VUE_SSR_CONTEXT__!="undefined"&&(f=__VUE_SSR_CONTEXT__),h&&h.call(this,f),f&&f._registeredComponents&&f._registeredComponents.add(r)},a._ssrRegister=o):h&&(o=i?function(){h.call(this,(a.functional?this.parent:this).$root.$options.shadowRoot)}:h),o)if(a.functional){a._injectStyles=o;var l=a.render;a.render=function(g,d){return o.call(d),l(g,d)}}else{var c=a.beforeCreate;a.beforeCreate=c?[].concat(c,o):[o]}return{exports:n,options:a}}var jt=function(){var e=this,s=e._self._c,u=e._self._setupProxy;return e.line.hideIndex!==void 0&&e.line.hide?s("tr",[s("td",{staticClass:"blob-num blob-num-hunk text-center",attrs:{colspan:"2"},on:{click:function(h){return u.emit("expand",e.line)}}},[e._v(" > ")]),s("td",{staticClass:"blob-code blob-code-hunk",attrs:{align:"left"}},[e._v(" ⋯ ")])]):e.line.hide?e._e():s("tr",[s("td",{staticClass:"blob-num",class:{"blob-num-deletion":e.line.type===u.DiffType.DELETE,"blob-num-addition":e.line.type===u.DiffType.ADD,"blob-num-context":e.line.type===u.DiffType.EQUAL,"blob-num-hunk":e.line.hide!==void 0}},[e._v(" "+e._s(e.line.delNum)+" ")]),s("td",{staticClass:"blob-num",class:{"blob-num-deletion":e.line.type===u.DiffType.DELETE,"blob-num-addition":e.line.type===u.DiffType.ADD,"blob-num-context":e.line.type===u.DiffType.EQUAL,"blob-num-hunk":e.line.hide!==void 0}},[e._v(" "+e._s(e.line.addNum)+" ")]),s("td",{staticClass:"blob-code",class:{"blob-code-deletion":e.line.type===u.DiffType.DELETE,"blob-code-addition":e.line.type===u.DiffType.ADD,"blob-code-context":e.line.type===u.DiffType.EQUAL,"blob-code-hunk":e.line.hide!==void 0}},[s("span",{staticClass:"blob-code-inner blob-code-marker",attrs:{"data-code-marker":u.getCodeMarker(e.line.type)},domProps:{innerHTML:e._s(e.line.code)}})])])},qt=[],Jt=le(Xt,jt,qt,!1,null,null,null,null);const er=Jt.exports,nr=Q.defineComponent({__name:"UnifiedViewer",props:{diffChange:null},setup(n){const e=n;function s({hideIndex:u}){u!==void 0&&e.diffChange.collector[u].lines.forEach(h=>{h.hide=!1,h.fold=!1})}return{__sfc:!0,props:e,expandHandler:s,UnifiedLine:er}}});var tr=function(){var h;var e=this,s=e._self._c,u=e._self._setupProxy;return s("table",{staticClass:"diff-table"},[s("tbody",e._l((h=e.diffChange)==null?void 0:h.changes,function(t,r){return s(u.UnifiedLine,{key:r,attrs:{line:t},on:{expand:u.expandHandler}})}),1)])},rr=[],ir=le(nr,tr,rr,!1,null,"238e1326",null,null);const sr=ir.exports,ar=Q.defineComponent({__name:"SplitLine",props:{splitLine:null},emits:["expand"],setup(n,{emit:e}){function s(h){return h===T.DELETE?"-":h===T.ADD?"+":""}function u(h){const t=document.querySelectorAll(".file-diff-split .split-side-left"),r=document.querySelectorAll(".file-diff-split .split-side-right");for(const i of r)i.classList.toggle("no-select",h==="left");for(const i of t)i.classList.toggle("no-select",h==="right")}return{__sfc:!0,emit:e,getCodeMarker:s,onSplitLineMousedown:u,DiffType:T}}});var or=function(){var e=this,s=e._self._c,u=e._self._setupProxy;return e.splitLine.hideIndex!==void 0&&e.splitLine.hide?s("tr",[s("td",{staticClass:"blob-num blob-num-hunk",attrs:{colspan:"1"},on:{click:function(h){return u.emit("expand",e.splitLine)}}},[e._v(" > ")]),s("td",{staticClass:"blob-code blob-code-inner blob-code-hunk",attrs:{colspan:"3",align:"left"}},[e._v(" ⋯ ")])]):e.splitLine.hide?e._e():s("tr",[e._l([e.splitLine.left,e.splitLine.right],function(h,t){return[h.type===u.DiffType.EMPTY?[s("td",{staticClass:"blob-num blob-num-empty empty-cell"}),s("td",{staticClass:"blob-code blob-code-empty empty-cell"})]:[s("td",{staticClass:"blob-num",class:{"blob-num-deletion":h.type===u.DiffType.DELETE,"blob-num-addition":h.type===u.DiffType.ADD,"blob-num-context":h.type===u.DiffType.EQUAL,"blob-num-hunk":e.splitLine.hide!==void 0}},[e._v(" "+e._s(h.num)+" ")]),s("td",{staticClass:"blob-code",class:{"blob-code-deletion":h.type===u.DiffType.DELETE,"blob-code-addition":h.type===u.DiffType.ADD,"blob-code-context":h.type===u.DiffType.EQUAL,"blob-code-hunk":e.splitLine.hide!==void 0,"split-side-left":t===0,"split-side-right":t===1},on:{mousedown:function(r){return u.onSplitLineMousedown(t===0?"left":"right")}}},[s("span",{staticClass:"blob-code-inner blob-code-marker",attrs:{"data-code-marker":u.getCodeMarker(h.type)},domProps:{innerHTML:e._s(h.code)}})])]]})],2)},lr=[],cr=le(ar,or,lr,!1,null,null,null,null);const ur=cr.exports,fr=Q.defineComponent({__name:"SplitViewer",props:{diffChange:null},setup(n){const e=n;function s({hideIndex:u}){u!==void 0&&e.diffChange.collector[u].lines.forEach(h=>{h.hide=!1,h.fold=!1})}return{__sfc:!0,props:e,expandHandler:s,SplitLine:ur}}});var gr=function(){var h;var e=this,s=e._self._c,u=e._self._setupProxy;return s("table",{staticClass:"file-diff-split diff-table"},[e._m(0),s("tbody",e._l((h=e.diffChange)==null?void 0:h.changes,function(t,r){return s(u.SplitLine,{key:r,attrs:{"split-line":t},on:{expand:u.expandHandler}})}),1)])},hr=[function(){var n=this,e=n._self._c;return n._self._setupProxy,e("colgroup",[e("col",{attrs:{width:"44"}}),e("col"),e("col",{attrs:{width:"44"}}),e("col")])}],dr=le(fr,gr,hr,!1,null,"829edc33",null,null);const _r=dr.exports,pr={name:"DownArrowIcon"};var br=function(){var e=this,s=e._self._c;return s("svg",{attrs:{width:"1rem",viewBox:"0 0 512 512",xmlns:"http://www.w3.org/2000/svg"}},[s("path",{attrs:{d:"M383.6,322.7L278.6,423c-5.8,6-13.7,9-22.4,9c-8.7,0-16.5-3-22.4-9L128.4,322.7c-12.5-11.9-12.5-31.3,0-43.2 c12.5-11.9,32.7-11.9,45.2,0l50.4,48.2v-217c0-16.9,14.3-30.6,32-30.6c17.7,0,32,13.7,32,30.6v217l50.4-48.2 c12.5-11.9,32.7-11.9,45.2,0C396.1,291.4,396.1,310.7,383.6,322.7z"}})])},vr=[],mr=le(pr,br,vr,!1,null,null,null,null);const Er=mr.exports,wr={name:"UpArrowIcon"};var yr=function(){var e=this,s=e._self._c;return s("svg",{attrs:{width:"1rem",viewBox:"0 0 512 512",xmlns:"http://www.w3.org/2000/svg"}},[s("path",{attrs:{d:"M128.4,189.3L233.4,89c5.8-6,13.7-9,22.4-9c8.7,0,16.5,3,22.4,9l105.4,100.3c12.5,11.9,12.5,31.3,0,43.2 c-12.5,11.9-32.7,11.9-45.2,0L288,184.4v217c0,16.9-14.3,30.6-32,30.6c-17.7,0-32-13.7-32-30.6v-217l-50.4,48.2 c-12.5,11.9-32.7,11.9-45.2,0C115.9,220.6,115.9,201.3,128.4,189.3z"}})])},Ar=[],Nr=le(wr,yr,Ar,!1,null,null,null,null);const Mr=Nr.exports;const Tr=Q.defineComponent({__name:"CodeDiff",props:{newString:null,oldString:null,language:{default:"plaintext"},context:{default:10},diffStyle:{default:"word"},forceInlineComparison:{type:Boolean,default:!1},outputFormat:{default:"line-by-line"},trim:{type:Boolean,default:!1},noDiffLineFeed:{type:Boolean,default:!1},maxHeight:{default:void 0},filename:{default:void 0},newFilename:{default:void 0},hideHeader:{type:Boolean,default:!1},hideStat:{type:Boolean,default:!1},theme:{default:"light"},ignoreMatchingLines:{default:void 0}},emits:["diff"],setup(n,{emit:e}){const s=n,u=Q.computed(()=>s.outputFormat==="line-by-line"),h=Q.computed(()=>{let g=s.oldString||"";return g=s.trim?g.trim():g,g=s.noDiffLineFeed?g.replace(/(\r\n)/g,`
|
|
17
17
|
`):g,g}),t=Q.computed(()=>{let g=s.newString||"";return g=s.trim?g.trim():g,g=s.noDiffLineFeed?g.replace(/(\r\n)/g,`
|
|
18
18
|
`):g,g}),r=Q.computed(()=>u.value?Yt(h.value,t.value,s.language,s.diffStyle,s.forceInlineComparison,s.context,s.ignoreMatchingLines):Zt(h.value,t.value,s.language,s.diffStyle,s.forceInlineComparison,s.context,s.ignoreMatchingLines)),i=Q.ref(r.value),a=Q.computed(()=>i.value.stat.additionsNum===0&&i.value.stat.deletionsNum===0),o=Q.ref(-1);function l(){const g=document.querySelectorAll(".blob-code-addition");o.value<g.length-1&&(o.value++,f(g))}function c(){const g=document.querySelectorAll(".blob-code-addition");o.value>0&&(o.value--,f(g))}function f(g){g.forEach(_=>_.classList.remove("current-diff"));const d=g[o.value];d&&(d.classList.add("current-diff"),d.scrollIntoView({behavior:"smooth",block:"center"}))}return Q.watch(()=>s,()=>{i.value=r.value,e("diff",{stat:{isChanged:!a.value,addNum:i.value.stat.additionsNum,delNum:i.value.stat.deletionsNum}})},{deep:!0,immediate:!0}),{__sfc:!0,props:s,emits:e,isUnifiedViewer:u,oldString:h,newString:t,raw:r,diffChange:i,isNotChanged:a,currentDiffIndex:o,goToNextDiff:l,goToPrevDiff:c,updateCurrentDiffHighlight:f,UnifiedViewer:sr,SplitViewer:_r,DownArrowIcon:Er,UpArrowIcon:Mr}}});var Dr=function(){var e=this,s=e._self._c,u=e._self._setupProxy;return s("div",{staticClass:"code-diff-view",style:{maxHeight:e.maxHeight},attrs:{theme:e.theme}},[e.hideHeader?e._e():s("div",{staticClass:"file-header"},[u.isUnifiedViewer?s("div",{staticClass:"file-info"},[s("span",[s("div",{staticClass:"info-left"},[e._v(e._s(e.filename))]),s("div",{staticClass:"info-left"},[e._v(e._s(e.newFilename))])]),s("span",{staticClass:"diff-commandbar"},[s("button",{staticClass:"command-item-button",attrs:{title:"Next Change"},on:{click:u.goToNextDiff}},[s(u.DownArrowIcon)],1),s("button",{staticClass:"command-item-button",attrs:{title:"Previous Change"},on:{click:u.goToPrevDiff}},[s(u.UpArrowIcon)],1)]),e.hideStat?e._e():s("span",{staticClass:"diff-stat"},[e._t("stat",function(){return[s("span",{staticClass:"diff-stat-added"},[e._v("+"+e._s(u.diffChange.stat.additionsNum)+" additions")]),s("span",{staticClass:"diff-stat-deleted"},[e._v("-"+e._s(u.diffChange.stat.deletionsNum)+" deletions")])]},{stat:u.diffChange.stat})],2)]):s("div",{staticClass:"file-info"},[s("span",{staticClass:"info-left"},[e._v(e._s(e.filename))]),s("span",{staticClass:"info-right"},[s("span",{staticStyle:{"margin-left":"20px"}},[e._v(e._s(e.newFilename))]),s("span",{staticClass:"diff-commandbar"},[s("button",{staticClass:"command-item-button",attrs:{title:"Next Change"},on:{click:u.goToNextDiff}},[s(u.DownArrowIcon)],1),s("button",{staticClass:"command-item-button",attrs:{title:"Previous Change"},on:{click:u.goToPrevDiff}},[s(u.UpArrowIcon)],1)]),e.hideStat?e._e():s("span",{staticClass:"diff-stat"},[e._t("stat",function(){return[s("span",{staticClass:"diff-stat-added"},[e._v("+"+e._s(u.diffChange.stat.additionsNum)+" additions")]),s("span",{staticClass:"diff-stat-deleted"},[e._v("-"+e._s(u.diffChange.stat.deletionsNum)+" deletions")])]},{stat:u.diffChange.stat})],2)])])]),u.isUnifiedViewer?s(u.UnifiedViewer,{attrs:{"diff-change":u.diffChange}}):s(u.SplitViewer,{attrs:{"diff-change":u.diffChange}})],1)},Sr=[],Cr=le(Tr,Dr,Sr,!1,null,null,null,null);const yn=Cr.exports;function Rr(n){n.component("CodeDiff",yn)}const Lr={install:Rr,hljs:Z};exports.CodeDiff=yn;exports.default=Lr;exports.hljs=Z;
|
package/dist/v2.7/index.es.js
CHANGED
|
@@ -4998,7 +4998,6 @@ const lr = or.exports, cr = /* @__PURE__ */ be({
|
|
|
4998
4998
|
return h === T.DELETE ? "-" : h === T.ADD ? "+" : "";
|
|
4999
4999
|
}
|
|
5000
5000
|
function u(h) {
|
|
5001
|
-
window.getSelection().removeAllRanges();
|
|
5002
5001
|
const t = document.querySelectorAll(".file-diff-split .split-side-left"), r = document.querySelectorAll(".file-diff-split .split-side-right");
|
|
5003
5002
|
for (const i of r)
|
|
5004
5003
|
i.classList.toggle("no-select", h === "left");
|
package/dist/v2.7/index.umd.js
CHANGED
|
@@ -13,6 +13,6 @@ https://github.com/highlightjs/highlight.js/issues/2277`),F=b,U=y),L===void 0&&(
|
|
|
13
13
|
`);if(A===void 0){for(const C of N){let I=i(),$=i();const B=j(s,C);S===T.EQUAL&&(c++,f++,I=a(T.EQUAL,c,B),$=a(T.EQUAL,f,B)),S===T.DELETE&&(c++,I=a(T.DELETE,c,B),$=i()),S===T.ADD&&(f++,I=i(),$=a(T.ADD,f,B)),d.push({left:I,right:$})}break}if(S===T.EQUAL)for(const C of N){c++,f++;const I=j(s,C);d.push({left:a(T.EQUAL,c,I),right:a(T.EQUAL,f,I)})}const R=A.value.replace(/\n$/,"").split(`
|
|
14
14
|
`);if(S===T.DELETE){if(D===T.EQUAL)for(const C of N)c++,d.push({left:a(T.DELETE,c,j(s,C)),right:i()});if(D===T.ADD){g=!0;const C=Math.max(E.count,A.count);for(let I=0;I<C;I++){I<E.count&&c++,I<A.count&&f++;const[$,B]=[N[I],R[I]],H=h||N.length===R.length,W=H?Ae(B,$,u):$,ie=H?Ae($,B,u):B,he=l!=null&&l.test($)?T.EQUAL:T.DELETE,b=l!=null&&l.test(B)?T.EQUAL:T.ADD,y=I<E.count?a(he,c,j(s,W)):i(),L=I<A.count?a(b,f,j(s,ie)):i();d.push({left:y,right:L})}}}if(S===T.ADD)for(const C of N)f++,d.push({left:i(),right:a(T.ADD,f,j(s,C))})}if(n===e){for(let m=0;m<d.length;m++)d[m].fold=!1;return _}for(let m=0;m<d.length;m++){const E=d[m];if(E.left.type===T.DELETE||E.right.type===T.ADD){const[A,S]=[Math.max(m-t,0),Math.min(m+t+1,d.length)];for(let D=A;D<S;D++)d[D].fold=!1}E.fold===void 0&&(E.fold=!0)}const p=[];let v=[];for(let m=0;m<d.length;m++){const E=d[m];if(E.fold===!1){v.length&&(v[0].hideIndex=_.collector.length,_.collector.push({lines:v,fold:!0}),v=[]),p.push(E);continue}E.hide=!0,v.push(E),p.push(E)}return v.length&&(v[0].hideIndex=_.collector.length,_.collector.push({lines:v,fold:!0}),v=[]),_.changes=p,_}function Ft(n,e,s="plaintext",u="word",h=!1,t=10,r){const i=_n(n,e),a=r?new RegExp(r):void 0;let o=0,l=0,c=!1;const f=[],g={changes:f,collector:[],stat:pn(i,a)};for(let p=0;p<i.length;p++){if(c){c=!1;continue}const[v,m]=[i[p],i[p+1]],[E,A]=[ge(v),ge(m)],S=v.value.replace(/\n$/,"").split(`
|
|
15
15
|
`);if(m===void 0){for(const N of S){E===T.EQUAL&&(o++,l++),E===T.DELETE&&o++,E===T.ADD&&l++;const R=j(s,N);f.push({type:E,code:R,addNum:E===T.DELETE?void 0:l,delNum:E===T.ADD?void 0:o})}break}if(E===T.EQUAL)for(const N of S){o++,l++;const R=j(s,N);f.push({type:T.EQUAL,code:R,delNum:o,addNum:l})}const D=m.value.replace(/\n$/,"").split(`
|
|
16
|
-
`);if(E===T.DELETE)if(A===T.ADD&&(S.length===D.length||h)){for(let N=0;N<S.length;N++){const R=S[N],C=D[N];o++;const I=j(s,Ae(C,R,u));f.push({type:a!=null&&a.test(R)?T.EQUAL:T.DELETE,code:I,delNum:o})}for(let N=0;N<D.length;N++){const R=S[N],C=D[N];l++;const I=j(s,Ae(R,C,u));f.push({type:a!=null&&a.test(C)?T.EQUAL:T.ADD,code:I,addNum:l})}c=!0}else for(const N of S){o++;const R=j(s,N);f.push({type:T.DELETE,code:R,delNum:o})}if(E===T.ADD)for(const N of S){l++;const R=j(s,N);f.push({type:T.ADD,code:R,addNum:l})}}for(let p=0;p<f.length;p++){const v=f[p];if(v.type===T.DELETE||v.type===T.ADD){const[m,E]=[Math.max(p-t,0),Math.min(p+t+1,f.length)];for(let A=m;A<E;A++)f[A].fold=!1}v.fold===void 0&&(v.fold=!0)}if(n===e){for(let p=0;p<f.length;p++)f[p].fold=!1;return g}const d=[];let _=[];for(let p=0;p<f.length;p++){const v=f[p];if(v.fold===!1){_.length&&(_[0].hideIndex=g.collector.length,g.collector.push({lines:_,fold:!0}),_=[]),d.push(v);continue}v.type==="equal"&&(v.hide=!0,_.push(v)),d.push(v)}return _.length&&(_[0].hideIndex=g.collector.length,g.collector.push({lines:_,fold:!0}),_=[]),g.changes=d,g}const Ht=z.defineComponent({__name:"UnifiedLine",props:{line:null},emits:["expand"],setup(n,{emit:e}){function s(u){return u===T.DELETE?"-":u===T.ADD?"+":""}return{__sfc:!0,emit:e,getCodeMarker:s,DiffType:T}}});function oe(n,e,s,u,h,t,r,i){var a=typeof n=="function"?n.options:n;e&&(a.render=e,a.staticRenderFns=s,a._compiled=!0),u&&(a.functional=!0),t&&(a._scopeId="data-v-"+t);var o;if(r?(o=function(f){f=f||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,!f&&typeof __VUE_SSR_CONTEXT__!="undefined"&&(f=__VUE_SSR_CONTEXT__),h&&h.call(this,f),f&&f._registeredComponents&&f._registeredComponents.add(r)},a._ssrRegister=o):h&&(o=i?function(){h.call(this,(a.functional?this.parent:this).$root.$options.shadowRoot)}:h),o)if(a.functional){a._injectStyles=o;var l=a.render;a.render=function(g,d){return o.call(d),l(g,d)}}else{var c=a.beforeCreate;a.beforeCreate=c?[].concat(c,o):[o]}return{exports:n,options:a}}var zt=function(){var e=this,s=e._self._c,u=e._self._setupProxy;return e.line.hideIndex!==void 0&&e.line.hide?s("tr",[s("td",{staticClass:"blob-num blob-num-hunk text-center",attrs:{colspan:"2"},on:{click:function(h){return u.emit("expand",e.line)}}},[e._v(" > ")]),s("td",{staticClass:"blob-code blob-code-hunk",attrs:{align:"left"}},[e._v(" ⋯ ")])]):e.line.hide?e._e():s("tr",[s("td",{staticClass:"blob-num",class:{"blob-num-deletion":e.line.type===u.DiffType.DELETE,"blob-num-addition":e.line.type===u.DiffType.ADD,"blob-num-context":e.line.type===u.DiffType.EQUAL,"blob-num-hunk":e.line.hide!==void 0}},[e._v(" "+e._s(e.line.delNum)+" ")]),s("td",{staticClass:"blob-num",class:{"blob-num-deletion":e.line.type===u.DiffType.DELETE,"blob-num-addition":e.line.type===u.DiffType.ADD,"blob-num-context":e.line.type===u.DiffType.EQUAL,"blob-num-hunk":e.line.hide!==void 0}},[e._v(" "+e._s(e.line.addNum)+" ")]),s("td",{staticClass:"blob-code",class:{"blob-code-deletion":e.line.type===u.DiffType.DELETE,"blob-code-addition":e.line.type===u.DiffType.ADD,"blob-code-context":e.line.type===u.DiffType.EQUAL,"blob-code-hunk":e.line.hide!==void 0}},[s("span",{staticClass:"blob-code-inner blob-code-marker",attrs:{"data-code-marker":u.getCodeMarker(e.line.type)},domProps:{innerHTML:e._s(e.line.code)}})])])},Gt=[],Kt=oe(Ht,zt,Gt,!1,null,null,null,null);const Wt=Kt.exports,Qt=z.defineComponent({__name:"UnifiedViewer",props:{diffChange:null},setup(n){const e=n;function s({hideIndex:u}){u!==void 0&&e.diffChange.collector[u].lines.forEach(h=>{h.hide=!1,h.fold=!1})}return{__sfc:!0,props:e,expandHandler:s,UnifiedLine:Wt}}}),Lr="";var Zt=function(){var h;var e=this,s=e._self._c,u=e._self._setupProxy;return s("table",{staticClass:"diff-table"},[s("tbody",e._l((h=e.diffChange)==null?void 0:h.changes,function(t,r){return s(u.UnifiedLine,{key:r,attrs:{line:t},on:{expand:u.expandHandler}})}),1)])},Yt=[],Xt=oe(Qt,Zt,Yt,!1,null,"238e1326",null,null);const jt=Xt.exports,Vt=z.defineComponent({__name:"SplitLine",props:{splitLine:null},emits:["expand"],setup(n,{emit:e}){function s(h){return h===T.DELETE?"-":h===T.ADD?"+":""}function u(h){
|
|
16
|
+
`);if(E===T.DELETE)if(A===T.ADD&&(S.length===D.length||h)){for(let N=0;N<S.length;N++){const R=S[N],C=D[N];o++;const I=j(s,Ae(C,R,u));f.push({type:a!=null&&a.test(R)?T.EQUAL:T.DELETE,code:I,delNum:o})}for(let N=0;N<D.length;N++){const R=S[N],C=D[N];l++;const I=j(s,Ae(R,C,u));f.push({type:a!=null&&a.test(C)?T.EQUAL:T.ADD,code:I,addNum:l})}c=!0}else for(const N of S){o++;const R=j(s,N);f.push({type:T.DELETE,code:R,delNum:o})}if(E===T.ADD)for(const N of S){l++;const R=j(s,N);f.push({type:T.ADD,code:R,addNum:l})}}for(let p=0;p<f.length;p++){const v=f[p];if(v.type===T.DELETE||v.type===T.ADD){const[m,E]=[Math.max(p-t,0),Math.min(p+t+1,f.length)];for(let A=m;A<E;A++)f[A].fold=!1}v.fold===void 0&&(v.fold=!0)}if(n===e){for(let p=0;p<f.length;p++)f[p].fold=!1;return g}const d=[];let _=[];for(let p=0;p<f.length;p++){const v=f[p];if(v.fold===!1){_.length&&(_[0].hideIndex=g.collector.length,g.collector.push({lines:_,fold:!0}),_=[]),d.push(v);continue}v.type==="equal"&&(v.hide=!0,_.push(v)),d.push(v)}return _.length&&(_[0].hideIndex=g.collector.length,g.collector.push({lines:_,fold:!0}),_=[]),g.changes=d,g}const Ht=z.defineComponent({__name:"UnifiedLine",props:{line:null},emits:["expand"],setup(n,{emit:e}){function s(u){return u===T.DELETE?"-":u===T.ADD?"+":""}return{__sfc:!0,emit:e,getCodeMarker:s,DiffType:T}}});function oe(n,e,s,u,h,t,r,i){var a=typeof n=="function"?n.options:n;e&&(a.render=e,a.staticRenderFns=s,a._compiled=!0),u&&(a.functional=!0),t&&(a._scopeId="data-v-"+t);var o;if(r?(o=function(f){f=f||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,!f&&typeof __VUE_SSR_CONTEXT__!="undefined"&&(f=__VUE_SSR_CONTEXT__),h&&h.call(this,f),f&&f._registeredComponents&&f._registeredComponents.add(r)},a._ssrRegister=o):h&&(o=i?function(){h.call(this,(a.functional?this.parent:this).$root.$options.shadowRoot)}:h),o)if(a.functional){a._injectStyles=o;var l=a.render;a.render=function(g,d){return o.call(d),l(g,d)}}else{var c=a.beforeCreate;a.beforeCreate=c?[].concat(c,o):[o]}return{exports:n,options:a}}var zt=function(){var e=this,s=e._self._c,u=e._self._setupProxy;return e.line.hideIndex!==void 0&&e.line.hide?s("tr",[s("td",{staticClass:"blob-num blob-num-hunk text-center",attrs:{colspan:"2"},on:{click:function(h){return u.emit("expand",e.line)}}},[e._v(" > ")]),s("td",{staticClass:"blob-code blob-code-hunk",attrs:{align:"left"}},[e._v(" ⋯ ")])]):e.line.hide?e._e():s("tr",[s("td",{staticClass:"blob-num",class:{"blob-num-deletion":e.line.type===u.DiffType.DELETE,"blob-num-addition":e.line.type===u.DiffType.ADD,"blob-num-context":e.line.type===u.DiffType.EQUAL,"blob-num-hunk":e.line.hide!==void 0}},[e._v(" "+e._s(e.line.delNum)+" ")]),s("td",{staticClass:"blob-num",class:{"blob-num-deletion":e.line.type===u.DiffType.DELETE,"blob-num-addition":e.line.type===u.DiffType.ADD,"blob-num-context":e.line.type===u.DiffType.EQUAL,"blob-num-hunk":e.line.hide!==void 0}},[e._v(" "+e._s(e.line.addNum)+" ")]),s("td",{staticClass:"blob-code",class:{"blob-code-deletion":e.line.type===u.DiffType.DELETE,"blob-code-addition":e.line.type===u.DiffType.ADD,"blob-code-context":e.line.type===u.DiffType.EQUAL,"blob-code-hunk":e.line.hide!==void 0}},[s("span",{staticClass:"blob-code-inner blob-code-marker",attrs:{"data-code-marker":u.getCodeMarker(e.line.type)},domProps:{innerHTML:e._s(e.line.code)}})])])},Gt=[],Kt=oe(Ht,zt,Gt,!1,null,null,null,null);const Wt=Kt.exports,Qt=z.defineComponent({__name:"UnifiedViewer",props:{diffChange:null},setup(n){const e=n;function s({hideIndex:u}){u!==void 0&&e.diffChange.collector[u].lines.forEach(h=>{h.hide=!1,h.fold=!1})}return{__sfc:!0,props:e,expandHandler:s,UnifiedLine:Wt}}}),Lr="";var Zt=function(){var h;var e=this,s=e._self._c,u=e._self._setupProxy;return s("table",{staticClass:"diff-table"},[s("tbody",e._l((h=e.diffChange)==null?void 0:h.changes,function(t,r){return s(u.UnifiedLine,{key:r,attrs:{line:t},on:{expand:u.expandHandler}})}),1)])},Yt=[],Xt=oe(Qt,Zt,Yt,!1,null,"238e1326",null,null);const jt=Xt.exports,Vt=z.defineComponent({__name:"SplitLine",props:{splitLine:null},emits:["expand"],setup(n,{emit:e}){function s(h){return h===T.DELETE?"-":h===T.ADD?"+":""}function u(h){const t=document.querySelectorAll(".file-diff-split .split-side-left"),r=document.querySelectorAll(".file-diff-split .split-side-right");for(const i of r)i.classList.toggle("no-select",h==="left");for(const i of t)i.classList.toggle("no-select",h==="right")}return{__sfc:!0,emit:e,getCodeMarker:s,onSplitLineMousedown:u,DiffType:T}}}),Or="";var qt=function(){var e=this,s=e._self._c,u=e._self._setupProxy;return e.splitLine.hideIndex!==void 0&&e.splitLine.hide?s("tr",[s("td",{staticClass:"blob-num blob-num-hunk",attrs:{colspan:"1"},on:{click:function(h){return u.emit("expand",e.splitLine)}}},[e._v(" > ")]),s("td",{staticClass:"blob-code blob-code-inner blob-code-hunk",attrs:{colspan:"3",align:"left"}},[e._v(" ⋯ ")])]):e.splitLine.hide?e._e():s("tr",[e._l([e.splitLine.left,e.splitLine.right],function(h,t){return[h.type===u.DiffType.EMPTY?[s("td",{staticClass:"blob-num blob-num-empty empty-cell"}),s("td",{staticClass:"blob-code blob-code-empty empty-cell"})]:[s("td",{staticClass:"blob-num",class:{"blob-num-deletion":h.type===u.DiffType.DELETE,"blob-num-addition":h.type===u.DiffType.ADD,"blob-num-context":h.type===u.DiffType.EQUAL,"blob-num-hunk":e.splitLine.hide!==void 0}},[e._v(" "+e._s(h.num)+" ")]),s("td",{staticClass:"blob-code",class:{"blob-code-deletion":h.type===u.DiffType.DELETE,"blob-code-addition":h.type===u.DiffType.ADD,"blob-code-context":h.type===u.DiffType.EQUAL,"blob-code-hunk":e.splitLine.hide!==void 0,"split-side-left":t===0,"split-side-right":t===1},on:{mousedown:function(r){return u.onSplitLineMousedown(t===0?"left":"right")}}},[s("span",{staticClass:"blob-code-inner blob-code-marker",attrs:{"data-code-marker":u.getCodeMarker(h.type)},domProps:{innerHTML:e._s(h.code)}})])]]})],2)},Jt=[],er=oe(Vt,qt,Jt,!1,null,null,null,null);const nr=er.exports,tr=z.defineComponent({__name:"SplitViewer",props:{diffChange:null},setup(n){const e=n;function s({hideIndex:u}){u!==void 0&&e.diffChange.collector[u].lines.forEach(h=>{h.hide=!1,h.fold=!1})}return{__sfc:!0,props:e,expandHandler:s,SplitLine:nr}}}),Ir="";var rr=function(){var h;var e=this,s=e._self._c,u=e._self._setupProxy;return s("table",{staticClass:"file-diff-split diff-table"},[e._m(0),s("tbody",e._l((h=e.diffChange)==null?void 0:h.changes,function(t,r){return s(u.SplitLine,{key:r,attrs:{"split-line":t},on:{expand:u.expandHandler}})}),1)])},ir=[function(){var n=this,e=n._self._c;return n._self._setupProxy,e("colgroup",[e("col",{attrs:{width:"44"}}),e("col"),e("col",{attrs:{width:"44"}}),e("col")])}],sr=oe(tr,rr,ir,!1,null,"829edc33",null,null);const ar=sr.exports,or={name:"DownArrowIcon"};var lr=function(){var e=this,s=e._self._c;return s("svg",{attrs:{width:"1rem",viewBox:"0 0 512 512",xmlns:"http://www.w3.org/2000/svg"}},[s("path",{attrs:{d:"M383.6,322.7L278.6,423c-5.8,6-13.7,9-22.4,9c-8.7,0-16.5-3-22.4-9L128.4,322.7c-12.5-11.9-12.5-31.3,0-43.2 c12.5-11.9,32.7-11.9,45.2,0l50.4,48.2v-217c0-16.9,14.3-30.6,32-30.6c17.7,0,32,13.7,32,30.6v217l50.4-48.2 c12.5-11.9,32.7-11.9,45.2,0C396.1,291.4,396.1,310.7,383.6,322.7z"}})])},cr=[],ur=oe(or,lr,cr,!1,null,null,null,null);const fr=ur.exports,gr={name:"UpArrowIcon"};var hr=function(){var e=this,s=e._self._c;return s("svg",{attrs:{width:"1rem",viewBox:"0 0 512 512",xmlns:"http://www.w3.org/2000/svg"}},[s("path",{attrs:{d:"M128.4,189.3L233.4,89c5.8-6,13.7-9,22.4-9c8.7,0,16.5,3,22.4,9l105.4,100.3c12.5,11.9,12.5,31.3,0,43.2 c-12.5,11.9-32.7,11.9-45.2,0L288,184.4v217c0,16.9-14.3,30.6-32,30.6c-17.7,0-32-13.7-32-30.6v-217l-50.4,48.2 c-12.5,11.9-32.7,11.9-45.2,0C115.9,220.6,115.9,201.3,128.4,189.3z"}})])},dr=[],_r=oe(gr,hr,dr,!1,null,null,null,null);const pr=_r.exports,kr="",br=z.defineComponent({__name:"CodeDiff",props:{newString:null,oldString:null,language:{default:"plaintext"},context:{default:10},diffStyle:{default:"word"},forceInlineComparison:{type:Boolean,default:!1},outputFormat:{default:"line-by-line"},trim:{type:Boolean,default:!1},noDiffLineFeed:{type:Boolean,default:!1},maxHeight:{default:void 0},filename:{default:void 0},newFilename:{default:void 0},hideHeader:{type:Boolean,default:!1},hideStat:{type:Boolean,default:!1},theme:{default:"light"},ignoreMatchingLines:{default:void 0}},emits:["diff"],setup(n,{emit:e}){const s=n,u=z.computed(()=>s.outputFormat==="line-by-line"),h=z.computed(()=>{let g=s.oldString||"";return g=s.trim?g.trim():g,g=s.noDiffLineFeed?g.replace(/(\r\n)/g,`
|
|
17
17
|
`):g,g}),t=z.computed(()=>{let g=s.newString||"";return g=s.trim?g.trim():g,g=s.noDiffLineFeed?g.replace(/(\r\n)/g,`
|
|
18
18
|
`):g,g}),r=z.computed(()=>u.value?Ft(h.value,t.value,s.language,s.diffStyle,s.forceInlineComparison,s.context,s.ignoreMatchingLines):xt(h.value,t.value,s.language,s.diffStyle,s.forceInlineComparison,s.context,s.ignoreMatchingLines)),i=z.ref(r.value),a=z.computed(()=>i.value.stat.additionsNum===0&&i.value.stat.deletionsNum===0),o=z.ref(-1);function l(){const g=document.querySelectorAll(".blob-code-addition");o.value<g.length-1&&(o.value++,f(g))}function c(){const g=document.querySelectorAll(".blob-code-addition");o.value>0&&(o.value--,f(g))}function f(g){g.forEach(_=>_.classList.remove("current-diff"));const d=g[o.value];d&&(d.classList.add("current-diff"),d.scrollIntoView({behavior:"smooth",block:"center"}))}return z.watch(()=>s,()=>{i.value=r.value,e("diff",{stat:{isChanged:!a.value,addNum:i.value.stat.additionsNum,delNum:i.value.stat.deletionsNum}})},{deep:!0,immediate:!0}),{__sfc:!0,props:s,emits:e,isUnifiedViewer:u,oldString:h,newString:t,raw:r,diffChange:i,isNotChanged:a,currentDiffIndex:o,goToNextDiff:l,goToPrevDiff:c,updateCurrentDiffHighlight:f,UnifiedViewer:jt,SplitViewer:ar,DownArrowIcon:fr,UpArrowIcon:pr}}}),Br="";var vr=function(){var e=this,s=e._self._c,u=e._self._setupProxy;return s("div",{staticClass:"code-diff-view",style:{maxHeight:e.maxHeight},attrs:{theme:e.theme}},[e.hideHeader?e._e():s("div",{staticClass:"file-header"},[u.isUnifiedViewer?s("div",{staticClass:"file-info"},[s("span",[s("div",{staticClass:"info-left"},[e._v(e._s(e.filename))]),s("div",{staticClass:"info-left"},[e._v(e._s(e.newFilename))])]),s("span",{staticClass:"diff-commandbar"},[s("button",{staticClass:"command-item-button",attrs:{title:"Next Change"},on:{click:u.goToNextDiff}},[s(u.DownArrowIcon)],1),s("button",{staticClass:"command-item-button",attrs:{title:"Previous Change"},on:{click:u.goToPrevDiff}},[s(u.UpArrowIcon)],1)]),e.hideStat?e._e():s("span",{staticClass:"diff-stat"},[e._t("stat",function(){return[s("span",{staticClass:"diff-stat-added"},[e._v("+"+e._s(u.diffChange.stat.additionsNum)+" additions")]),s("span",{staticClass:"diff-stat-deleted"},[e._v("-"+e._s(u.diffChange.stat.deletionsNum)+" deletions")])]},{stat:u.diffChange.stat})],2)]):s("div",{staticClass:"file-info"},[s("span",{staticClass:"info-left"},[e._v(e._s(e.filename))]),s("span",{staticClass:"info-right"},[s("span",{staticStyle:{"margin-left":"20px"}},[e._v(e._s(e.newFilename))]),s("span",{staticClass:"diff-commandbar"},[s("button",{staticClass:"command-item-button",attrs:{title:"Next Change"},on:{click:u.goToNextDiff}},[s(u.DownArrowIcon)],1),s("button",{staticClass:"command-item-button",attrs:{title:"Previous Change"},on:{click:u.goToPrevDiff}},[s(u.UpArrowIcon)],1)]),e.hideStat?e._e():s("span",{staticClass:"diff-stat"},[e._t("stat",function(){return[s("span",{staticClass:"diff-stat-added"},[e._v("+"+e._s(u.diffChange.stat.additionsNum)+" additions")]),s("span",{staticClass:"diff-stat-deleted"},[e._v("-"+e._s(u.diffChange.stat.deletionsNum)+" deletions")])]},{stat:u.diffChange.stat})],2)])])]),u.isUnifiedViewer?s(u.UnifiedViewer,{attrs:{"diff-change":u.diffChange}}):s(u.SplitViewer,{attrs:{"diff-change":u.diffChange}})],1)},mr=[],Er=oe(br,vr,mr,!1,null,null,null,null);const wr=Er.exports;function yr(n){n.component("CodeDiff",wr)}return{install:yr,hljs:X}});
|