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/index.cjs.js
CHANGED
|
@@ -13,6 +13,6 @@ https://github.com/highlightjs/highlight.js/issues/2277`),H=b,U=w),L===void 0&&(
|
|
|
13
13
|
`);if(A===void 0){for(const C of N){let I=i(),B=i();const $=j(a,C);D===T.EQUAL&&(c++,u++,I=s(T.EQUAL,c,$),B=s(T.EQUAL,u,$)),D===T.DELETE&&(c++,I=s(T.DELETE,c,$),B=i()),D===T.ADD&&(u++,I=i(),B=s(T.ADD,u,$)),g.push({left:I,right:B})}break}if(D===T.EQUAL)for(const C of N){c++,u++;const I=j(a,C);g.push({left:s(T.EQUAL,c,I),right:s(T.EQUAL,u,I)})}const R=A.value.replace(/\n$/,"").split(`
|
|
14
14
|
`);if(D===T.DELETE){if(S===T.EQUAL)for(const C of N)c++,g.push({left:s(T.DELETE,c,j(a,C)),right:i()});if(S===T.ADD){h=!0;const C=Math.max(E.count,A.count);for(let I=0;I<C;I++){I<E.count&&c++,I<A.count&&u++;const[B,$]=[N[I],R[I]],F=d||N.length===R.length,K=F?De($,B,f):B,re=F?De(B,$,f):$,ce=l!=null&&l.test(B)?T.EQUAL:T.DELETE,b=l!=null&&l.test($)?T.EQUAL:T.ADD,w=I<E.count?s(ce,c,j(a,K)):i(),L=I<A.count?s(b,u,j(a,re)):i();g.push({left:w,right:L})}}}if(D===T.ADD)for(const C of N)u++,g.push({left:i(),right:s(T.ADD,u,j(a,C))})}if(e===n){for(let m=0;m<g.length;m++)g[m].fold=!1;return p}for(let m=0;m<g.length;m++){const E=g[m];if(E.left.type===T.DELETE||E.right.type===T.ADD){const[A,D]=[Math.max(m-t,0),Math.min(m+t+1,g.length)];for(let S=A;S<D;S++)g[S].fold=!1}E.fold===void 0&&(E.fold=!0)}const _=[];let v=[];for(let m=0;m<g.length;m++){const E=g[m];if(E.fold===!1){v.length&&(v[0].hideIndex=p.collector.length,p.collector.push({lines:v,fold:!0}),v=[]),_.push(E);continue}E.hide=!0,v.push(E),_.push(E)}return v.length&&(v[0].hideIndex=p.collector.length,p.collector.push({lines:v,fold:!0}),v=[]),p.changes=_,p}function cr(e,n,a="plaintext",f="word",d=!1,t=10,r){const i=In(e,n),s=r?new RegExp(r):void 0;let o=0,l=0,c=!1;const u=[],h={changes:u,collector:[],stat:kn(i,s)};for(let _=0;_<i.length;_++){if(c){c=!1;continue}const[v,m]=[i[_],i[_+1]],[E,A]=[he(v),he(m)],D=v.value.replace(/\n$/,"").split(`
|
|
15
15
|
`);if(m===void 0){for(const N of D){E===T.EQUAL&&(o++,l++),E===T.DELETE&&o++,E===T.ADD&&l++;const R=j(a,N);u.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 D){o++,l++;const R=j(a,N);u.push({type:T.EQUAL,code:R,delNum:o,addNum:l})}const S=m.value.replace(/\n$/,"").split(`
|
|
16
|
-
`);if(E===T.DELETE)if(A===T.ADD&&(D.length===S.length||d)){for(let N=0;N<D.length;N++){const R=D[N],C=S[N];o++;const I=j(a,De(C,R,f));u.push({type:s!=null&&s.test(R)?T.EQUAL:T.DELETE,code:I,delNum:o})}for(let N=0;N<S.length;N++){const R=D[N],C=S[N];l++;const I=j(a,De(R,C,f));u.push({type:s!=null&&s.test(C)?T.EQUAL:T.ADD,code:I,addNum:l})}c=!0}else for(const N of D){o++;const R=j(a,N);u.push({type:T.DELETE,code:R,delNum:o})}if(E===T.ADD)for(const N of D){l++;const R=j(a,N);u.push({type:T.ADD,code:R,addNum:l})}}for(let _=0;_<u.length;_++){const v=u[_];if(v.type===T.DELETE||v.type===T.ADD){const[m,E]=[Math.max(_-t,0),Math.min(_+t+1,u.length)];for(let A=m;A<E;A++)u[A].fold=!1}v.fold===void 0&&(v.fold=!0)}if(e===n){for(let _=0;_<u.length;_++)u[_].fold=!1;return h}const g=[];let p=[];for(let _=0;_<u.length;_++){const v=u[_];if(v.fold===!1){p.length&&(p[0].hideIndex=h.collector.length,h.collector.push({lines:p,fold:!0}),p=[]),g.push(v);continue}v.type==="equal"&&(v.hide=!0,p.push(v)),g.push(v)}return p.length&&(p[0].hideIndex=h.collector.length,h.collector.push({lines:p,fold:!0}),p=[]),h.changes=g,h}const Ge={};Ge.props={line:{key:"line",required:!0,type:null}};Ge.setup=(e,n)=>{const a=n.emit;function f(d){return d===T.DELETE?"-":d===T.ADD?"+":""}return{DiffType:T,emit:a,getCodeMarker:f}};var ur=function(){var e=this,n=e.$createElement,a=e._self._c||n;return e.line.hideIndex!==void 0&&e.line.hide?a("tr",[a("td",{staticClass:"blob-num blob-num-hunk text-center",attrs:{colspan:"2"},on:{click:function(f){return e.emit("expand",e.line)}}},[e._v(" > ")]),a("td",{staticClass:"blob-code blob-code-hunk",attrs:{align:"left"}},[e._v(" ⋯ ")])]):e.line.hide?e._e():a("tr",[a("td",{staticClass:"blob-num",class:{"blob-num-deletion":e.line.type===e.DiffType.DELETE,"blob-num-addition":e.line.type===e.DiffType.ADD,"blob-num-context":e.line.type===e.DiffType.EQUAL,"blob-num-hunk":e.line.hide!==void 0}},[e._v(" "+e._s(e.line.delNum)+" ")]),a("td",{staticClass:"blob-num",class:{"blob-num-deletion":e.line.type===e.DiffType.DELETE,"blob-num-addition":e.line.type===e.DiffType.ADD,"blob-num-context":e.line.type===e.DiffType.EQUAL,"blob-num-hunk":e.line.hide!==void 0}},[e._v(" "+e._s(e.line.addNum)+" ")]),a("td",{staticClass:"blob-code",class:{"blob-code-deletion":e.line.type===e.DiffType.DELETE,"blob-code-addition":e.line.type===e.DiffType.ADD,"blob-code-context":e.line.type===e.DiffType.EQUAL,"blob-code-hunk":e.line.hide!==void 0}},[a("span",{staticClass:"blob-code-inner blob-code-marker",attrs:{"data-code-marker":e.getCodeMarker(e.line.type)},domProps:{innerHTML:e._s(e.line.code)}})])])},fr=[];function le(e,n,a,f,d,t,r,i){var s=typeof e=="function"?e.options:e;n&&(s.render=n,s.staticRenderFns=a,s._compiled=!0),f&&(s.functional=!0),t&&(s._scopeId="data-v-"+t);var o;if(r?(o=function(u){u=u||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,!u&&typeof __VUE_SSR_CONTEXT__!="undefined"&&(u=__VUE_SSR_CONTEXT__),d&&d.call(this,u),u&&u._registeredComponents&&u._registeredComponents.add(r)},s._ssrRegister=o):d&&(o=i?function(){d.call(this,(s.functional?this.parent:this).$root.$options.shadowRoot)}:d),o)if(s.functional){s._injectStyles=o;var l=s.render;s.render=function(h,g){return o.call(g),l(h,g)}}else{var c=s.beforeCreate;s.beforeCreate=c?[].concat(c,o):[o]}return{exports:e,options:s}}const ln={};var gr=le(Ge,ur,fr,!1,hr,null,null,null);function hr(e){for(let n in ln)this[n]=ln[n]}const dr=function(){return gr.exports}(),be={};be.props={diffChange:{key:"diffChange",required:!0,type:null}};be.setup=(e,n)=>{const a=e;function f({hideIndex:d}){d!==void 0&&a.diffChange.collector[d].lines.forEach(t=>{t.hide=!1,t.fold=!1})}return{expandHandler:f}};be.components=Object.assign({UnifiedLine:dr},be.components);var pr=function(){var e,n=this,a=n.$createElement,f=n._self._c||a;return f("table",{staticClass:"diff-table"},[f("tbody",n._l((e=n.diffChange)===null||e===void 0?void 0:e.changes,function(d,t){return f("UnifiedLine",{key:t,attrs:{line:d},on:{expand:n.expandHandler}})}),1)])},_r=[];const cn={};var br=le(be,pr,_r,!1,vr,null,null,null);function vr(e){for(let n in cn)this[n]=cn[n]}const mr=function(){return br.exports}(),Ke={};Ke.props={splitLine:{key:"splitLine",required:!0,type:null}};Ke.setup=(e,n)=>{const a=n.emit;function f(t){return t===T.DELETE?"-":t===T.ADD?"+":""}function d(t){
|
|
16
|
+
`);if(E===T.DELETE)if(A===T.ADD&&(D.length===S.length||d)){for(let N=0;N<D.length;N++){const R=D[N],C=S[N];o++;const I=j(a,De(C,R,f));u.push({type:s!=null&&s.test(R)?T.EQUAL:T.DELETE,code:I,delNum:o})}for(let N=0;N<S.length;N++){const R=D[N],C=S[N];l++;const I=j(a,De(R,C,f));u.push({type:s!=null&&s.test(C)?T.EQUAL:T.ADD,code:I,addNum:l})}c=!0}else for(const N of D){o++;const R=j(a,N);u.push({type:T.DELETE,code:R,delNum:o})}if(E===T.ADD)for(const N of D){l++;const R=j(a,N);u.push({type:T.ADD,code:R,addNum:l})}}for(let _=0;_<u.length;_++){const v=u[_];if(v.type===T.DELETE||v.type===T.ADD){const[m,E]=[Math.max(_-t,0),Math.min(_+t+1,u.length)];for(let A=m;A<E;A++)u[A].fold=!1}v.fold===void 0&&(v.fold=!0)}if(e===n){for(let _=0;_<u.length;_++)u[_].fold=!1;return h}const g=[];let p=[];for(let _=0;_<u.length;_++){const v=u[_];if(v.fold===!1){p.length&&(p[0].hideIndex=h.collector.length,h.collector.push({lines:p,fold:!0}),p=[]),g.push(v);continue}v.type==="equal"&&(v.hide=!0,p.push(v)),g.push(v)}return p.length&&(p[0].hideIndex=h.collector.length,h.collector.push({lines:p,fold:!0}),p=[]),h.changes=g,h}const Ge={};Ge.props={line:{key:"line",required:!0,type:null}};Ge.setup=(e,n)=>{const a=n.emit;function f(d){return d===T.DELETE?"-":d===T.ADD?"+":""}return{DiffType:T,emit:a,getCodeMarker:f}};var ur=function(){var e=this,n=e.$createElement,a=e._self._c||n;return e.line.hideIndex!==void 0&&e.line.hide?a("tr",[a("td",{staticClass:"blob-num blob-num-hunk text-center",attrs:{colspan:"2"},on:{click:function(f){return e.emit("expand",e.line)}}},[e._v(" > ")]),a("td",{staticClass:"blob-code blob-code-hunk",attrs:{align:"left"}},[e._v(" ⋯ ")])]):e.line.hide?e._e():a("tr",[a("td",{staticClass:"blob-num",class:{"blob-num-deletion":e.line.type===e.DiffType.DELETE,"blob-num-addition":e.line.type===e.DiffType.ADD,"blob-num-context":e.line.type===e.DiffType.EQUAL,"blob-num-hunk":e.line.hide!==void 0}},[e._v(" "+e._s(e.line.delNum)+" ")]),a("td",{staticClass:"blob-num",class:{"blob-num-deletion":e.line.type===e.DiffType.DELETE,"blob-num-addition":e.line.type===e.DiffType.ADD,"blob-num-context":e.line.type===e.DiffType.EQUAL,"blob-num-hunk":e.line.hide!==void 0}},[e._v(" "+e._s(e.line.addNum)+" ")]),a("td",{staticClass:"blob-code",class:{"blob-code-deletion":e.line.type===e.DiffType.DELETE,"blob-code-addition":e.line.type===e.DiffType.ADD,"blob-code-context":e.line.type===e.DiffType.EQUAL,"blob-code-hunk":e.line.hide!==void 0}},[a("span",{staticClass:"blob-code-inner blob-code-marker",attrs:{"data-code-marker":e.getCodeMarker(e.line.type)},domProps:{innerHTML:e._s(e.line.code)}})])])},fr=[];function le(e,n,a,f,d,t,r,i){var s=typeof e=="function"?e.options:e;n&&(s.render=n,s.staticRenderFns=a,s._compiled=!0),f&&(s.functional=!0),t&&(s._scopeId="data-v-"+t);var o;if(r?(o=function(u){u=u||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,!u&&typeof __VUE_SSR_CONTEXT__!="undefined"&&(u=__VUE_SSR_CONTEXT__),d&&d.call(this,u),u&&u._registeredComponents&&u._registeredComponents.add(r)},s._ssrRegister=o):d&&(o=i?function(){d.call(this,(s.functional?this.parent:this).$root.$options.shadowRoot)}:d),o)if(s.functional){s._injectStyles=o;var l=s.render;s.render=function(h,g){return o.call(g),l(h,g)}}else{var c=s.beforeCreate;s.beforeCreate=c?[].concat(c,o):[o]}return{exports:e,options:s}}const ln={};var gr=le(Ge,ur,fr,!1,hr,null,null,null);function hr(e){for(let n in ln)this[n]=ln[n]}const dr=function(){return gr.exports}(),be={};be.props={diffChange:{key:"diffChange",required:!0,type:null}};be.setup=(e,n)=>{const a=e;function f({hideIndex:d}){d!==void 0&&a.diffChange.collector[d].lines.forEach(t=>{t.hide=!1,t.fold=!1})}return{expandHandler:f}};be.components=Object.assign({UnifiedLine:dr},be.components);var pr=function(){var e,n=this,a=n.$createElement,f=n._self._c||a;return f("table",{staticClass:"diff-table"},[f("tbody",n._l((e=n.diffChange)===null||e===void 0?void 0:e.changes,function(d,t){return f("UnifiedLine",{key:t,attrs:{line:d},on:{expand:n.expandHandler}})}),1)])},_r=[];const cn={};var br=le(be,pr,_r,!1,vr,null,null,null);function vr(e){for(let n in cn)this[n]=cn[n]}const mr=function(){return br.exports}(),Ke={};Ke.props={splitLine:{key:"splitLine",required:!0,type:null}};Ke.setup=(e,n)=>{const a=n.emit;function f(t){return t===T.DELETE?"-":t===T.ADD?"+":""}function d(t){const r=document.querySelectorAll(".file-diff-split .split-side-left"),i=document.querySelectorAll(".file-diff-split .split-side-right");for(const s of i)s.classList.toggle("no-select",t==="left");for(const s of r)s.classList.toggle("no-select",t==="right")}return{DiffType:T,emit:a,getCodeMarker:f,onSplitLineMousedown:d}};var Er=function(){var e=this,n=e.$createElement,a=e._self._c||n;return e.splitLine.hideIndex!==void 0&&e.splitLine.hide?a("tr",[a("td",{staticClass:"blob-num blob-num-hunk",attrs:{colspan:"1"},on:{click:function(f){return e.emit("expand",e.splitLine)}}},[e._v(" > ")]),a("td",{staticClass:"blob-code blob-code-inner blob-code-hunk",attrs:{colspan:"3",align:"left"}},[e._v(" ⋯ ")])]):e.splitLine.hide?e._e():a("tr",[e._l([e.splitLine.left,e.splitLine.right],function(f,d){return[f.type===e.DiffType.EMPTY?[a("td",{staticClass:"blob-num blob-num-empty empty-cell"}),a("td",{staticClass:"blob-code blob-code-empty empty-cell"})]:[a("td",{staticClass:"blob-num",class:{"blob-num-deletion":f.type===e.DiffType.DELETE,"blob-num-addition":f.type===e.DiffType.ADD,"blob-num-context":f.type===e.DiffType.EQUAL,"blob-num-hunk":e.splitLine.hide!==void 0}},[e._v(" "+e._s(f.num)+" ")]),a("td",{staticClass:"blob-code",class:{"blob-code-deletion":f.type===e.DiffType.DELETE,"blob-code-addition":f.type===e.DiffType.ADD,"blob-code-context":f.type===e.DiffType.EQUAL,"blob-code-hunk":e.splitLine.hide!==void 0,"split-side-left":d===0,"split-side-right":d===1},on:{mousedown:function(t){return e.onSplitLineMousedown(d===0?"left":"right")}}},[a("span",{staticClass:"blob-code-inner blob-code-marker",attrs:{"data-code-marker":e.getCodeMarker(f.type)},domProps:{innerHTML:e._s(f.code)}})])]]})],2)},yr=[];const un={};var wr=le(Ke,Er,yr,!1,Ar,null,null,null);function Ar(e){for(let n in un)this[n]=un[n]}const Nr=function(){return wr.exports}(),ve={};ve.props={diffChange:{key:"diffChange",required:!0,type:null}};ve.setup=(e,n)=>{const a=e;function f({hideIndex:d}){d!==void 0&&a.diffChange.collector[d].lines.forEach(t=>{t.hide=!1,t.fold=!1})}return{expandHandler:f}};ve.components=Object.assign({SplitLine:Nr},ve.components);var Mr=function(){var e,n=this,a=n.$createElement,f=n._self._c||a;return f("table",{staticClass:"file-diff-split diff-table"},[n._m(0),f("tbody",n._l((e=n.diffChange)===null||e===void 0?void 0:e.changes,function(d,t){return f("SplitLine",{key:t,attrs:{"split-line":d},on:{expand:n.expandHandler}})}),1)])},Tr=[function(){var e=this,n=e.$createElement,a=e._self._c||n;return a("colgroup",[a("col",{attrs:{width:"44"}}),a("col"),a("col",{attrs:{width:"44"}}),a("col")])}];const fn={};var Sr=le(ve,Mr,Tr,!1,Dr,null,null,null);function Dr(e){for(let n in fn)this[n]=fn[n]}const Cr=function(){return Sr.exports}();var Rr=function(){var e=this,n=e.$createElement,a=e._self._c||n;return a("svg",{attrs:{width:"1rem",viewBox:"0 0 512 512",xmlns:"http://www.w3.org/2000/svg"}},[a("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"}})])},Lr=[];const Or={name:"DownArrowIcon"},gn={};var Ir=le(Or,Rr,Lr,!1,kr,null,null,null);function kr(e){for(let n in gn)this[n]=gn[n]}const $r=function(){return Ir.exports}();var Br=function(){var e=this,n=e.$createElement,a=e._self._c||n;return a("svg",{attrs:{width:"1rem",viewBox:"0 0 512 512",xmlns:"http://www.w3.org/2000/svg"}},[a("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"}})])},Ur=[];const Pr={name:"UpArrowIcon"},hn={};var xr=le(Pr,Br,Ur,!1,Hr,null,null,null);function Hr(e){for(let n in hn)this[n]=hn[n]}const Fr=function(){return xr.exports}();const me={};me.props={newString:{key:"newString",required:!0,type:String},oldString:{key:"oldString",required:!0,type:String},language:{key:"language",required:!1,type:String,default:"plaintext"},context:{key:"context",required:!1,type:Number,default:10},diffStyle:{key:"diffStyle",required:!1,type:String,default:"word"},forceInlineComparison:{key:"forceInlineComparison",required:!1,type:Boolean,default:!1},outputFormat:{key:"outputFormat",required:!1,type:String,default:"line-by-line"},trim:{key:"trim",required:!1,type:Boolean,default:!1},noDiffLineFeed:{key:"noDiffLineFeed",required:!1,type:Boolean,default:!1},maxHeight:{key:"maxHeight",required:!1,type:String,default:void 0},filename:{key:"filename",required:!1,type:String,default:void 0},newFilename:{key:"newFilename",required:!1,type:String,default:void 0},hideHeader:{key:"hideHeader",required:!1,type:Boolean,default:!1},hideStat:{key:"hideStat",required:!1,type:Boolean,default:!1},theme:{key:"theme",required:!1,type:String,default:"light"},ignoreMatchingLines:{key:"ignoreMatchingLines",required:!1,type:String,default:void 0}};me.setup=(e,n)=>{const a=e,f=n.emit,d=J.computed(()=>a.outputFormat==="line-by-line"),t=J.computed(()=>{let g=a.oldString||"";return g=a.trim?g.trim():g,g=a.noDiffLineFeed?g.replace(/(\r\n)/g,`
|
|
17
17
|
`):g,g}),r=J.computed(()=>{let g=a.newString||"";return g=a.trim?g.trim():g,g=a.noDiffLineFeed?g.replace(/(\r\n)/g,`
|
|
18
18
|
`):g,g}),i=J.computed(()=>d.value?cr(t.value,r.value,a.language,a.diffStyle,a.forceInlineComparison,a.context,a.ignoreMatchingLines):lr(t.value,r.value,a.language,a.diffStyle,a.forceInlineComparison,a.context,a.ignoreMatchingLines)),s=J.ref(i.value),o=J.computed(()=>s.value.stat.additionsNum===0&&s.value.stat.deletionsNum===0),l=J.ref(-1);function c(){const g=document.querySelectorAll(".blob-code-addition");l.value<g.length-1&&(l.value++,h(g))}function u(){const g=document.querySelectorAll(".blob-code-addition");l.value>0&&(l.value--,h(g))}function h(g){g.forEach(_=>_.classList.remove("current-diff"));const p=g[l.value];p&&(p.classList.add("current-diff"),p.scrollIntoView({behavior:"smooth",block:"center"}))}return J.watch(()=>a,()=>{s.value=i.value,f("diff",{stat:{isChanged:!o.value,addNum:s.value.stat.additionsNum,delNum:s.value.stat.deletionsNum}})},{deep:!0,immediate:!0}),{isUnifiedViewer:d,diffChange:s,goToNextDiff:c,goToPrevDiff:u}};me.components=Object.assign({DownArrowIcon:$r,UpArrowIcon:Fr,UnifiedViewer:mr,SplitViewer:Cr},me.components);var zr=function(){var e=this,n=e.$createElement,a=e._self._c||n;return a("div",{staticClass:"code-diff-view",style:{maxHeight:e.maxHeight},attrs:{theme:e.theme}},[e.hideHeader?e._e():a("div",{staticClass:"file-header"},[e.isUnifiedViewer?a("div",{staticClass:"file-info"},[a("span",[a("div",{staticClass:"info-left"},[e._v(e._s(e.filename))]),a("div",{staticClass:"info-left"},[e._v(e._s(e.newFilename))])]),a("span",{staticClass:"diff-commandbar"},[a("button",{staticClass:"command-item-button",attrs:{title:"Next Change"},on:{click:e.goToNextDiff}},[a("DownArrowIcon")],1),a("button",{staticClass:"command-item-button",attrs:{title:"Previous Change"},on:{click:e.goToPrevDiff}},[a("UpArrowIcon")],1)]),e.hideStat?e._e():a("span",{staticClass:"diff-stat"},[e._t("stat",function(){return[a("span",{staticClass:"diff-stat-added"},[e._v("+"+e._s(e.diffChange.stat.additionsNum)+" additions")]),a("span",{staticClass:"diff-stat-deleted"},[e._v("-"+e._s(e.diffChange.stat.deletionsNum)+" deletions")])]},{stat:e.diffChange.stat})],2)]):a("div",{staticClass:"file-info"},[a("span",{staticClass:"info-left"},[e._v(e._s(e.filename))]),a("span",{staticClass:"info-right"},[a("span",{staticStyle:{"margin-left":"20px"}},[e._v(e._s(e.newFilename))]),a("span",{staticClass:"diff-commandbar"},[a("button",{staticClass:"command-item-button",attrs:{title:"Next Change"},on:{click:e.goToNextDiff}},[a("DownArrowIcon")],1),a("button",{staticClass:"command-item-button",attrs:{title:"Previous Change"},on:{click:e.goToPrevDiff}},[a("UpArrowIcon")],1)]),e.hideStat?e._e():a("span",{staticClass:"diff-stat"},[e._t("stat",function(){return[a("span",{staticClass:"diff-stat-added"},[e._v("+"+e._s(e.diffChange.stat.additionsNum)+" additions")]),a("span",{staticClass:"diff-stat-deleted"},[e._v("-"+e._s(e.diffChange.stat.deletionsNum)+" deletions")])]},{stat:e.diffChange.stat})],2)])])]),e.isUnifiedViewer?a("UnifiedViewer",{attrs:{"diff-change":e.diffChange}}):a("SplitViewer",{attrs:{"diff-change":e.diffChange}})],1)},Gr=[];const dn={};var Kr=le(me,zr,Gr,!1,Wr,null,null,null);function Wr(e){for(let n in dn)this[n]=dn[n]}const $n=function(){return Kr.exports}();function qr(e){e.component("CodeDiff",$n)}const Qr={install:qr,hljs:Q};exports.CodeDiff=$n;exports.default=Qr;exports.hljs=Q;
|
package/dist/v2/index.es.js
CHANGED
|
@@ -5076,7 +5076,6 @@ Ke.setup = (e, n) => {
|
|
|
5076
5076
|
return t === T.DELETE ? "-" : t === T.ADD ? "+" : "";
|
|
5077
5077
|
}
|
|
5078
5078
|
function d(t) {
|
|
5079
|
-
window.getSelection().removeAllRanges();
|
|
5080
5079
|
const r = document.querySelectorAll(".file-diff-split .split-side-left"), i = document.querySelectorAll(".file-diff-split .split-side-right");
|
|
5081
5080
|
for (const s of i)
|
|
5082
5081
|
s.classList.toggle("no-select", t === "left");
|