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/v3/index.es.js
CHANGED
|
@@ -4978,7 +4978,6 @@ const hr = { key: 0 }, dr = /* @__PURE__ */ B("td", {
|
|
|
4978
4978
|
return n === y.DELETE ? "-" : n === y.ADD ? "+" : "";
|
|
4979
4979
|
}
|
|
4980
4980
|
function g(n) {
|
|
4981
|
-
window.getSelection().removeAllRanges();
|
|
4982
4981
|
const t = document.querySelectorAll(".file-diff-split .split-side-left"), i = document.querySelectorAll(".file-diff-split .split-side-right");
|
|
4983
4982
|
for (const s of i)
|
|
4984
4983
|
s.classList.toggle("no-select", n === "left");
|
package/dist/v3/index.umd.js
CHANGED
|
@@ -13,6 +13,6 @@ https://github.com/highlightjs/highlight.js/issues/2277`),z=m,U=A),C===void 0&&(
|
|
|
13
13
|
`);if(M===void 0){for(const R of S){let I=i(),P=i();const $=X(l,R);L===N.EQUAL&&(c++,f++,I=s(N.EQUAL,c,$),P=s(N.EQUAL,f,$)),L===N.DELETE&&(c++,I=s(N.DELETE,c,$),P=i()),L===N.ADD&&(f++,I=i(),P=s(N.ADD,f,$)),d.push({left:I,right:P})}break}if(L===N.EQUAL)for(const R of S){c++,f++;const I=X(l,R);d.push({left:s(N.EQUAL,c,I),right:s(N.EQUAL,f,I)})}const O=M.value.replace(/\n$/,"").split(`
|
|
14
14
|
`);if(L===N.DELETE){if(D===N.EQUAL)for(const R of S)c++,d.push({left:s(N.DELETE,c,X(l,R)),right:i()});if(D===N.ADD){p=!0;const R=Math.max(y.count,M.count);for(let I=0;I<R;I++){I<y.count&&c++,I<M.count&&f++;const[P,$]=[S[I],O[I]],x=h||S.length===O.length,K=x?we($,P,u):P,ie=x?we(P,$,u):$,ge=o!=null&&o.test(P)?N.EQUAL:N.DELETE,m=o!=null&&o.test($)?N.EQUAL:N.ADD,A=I<y.count?s(ge,c,X(l,K)):i(),C=I<M.count?s(m,f,X(l,ie)):i();d.push({left:A,right:C})}}}if(L===N.ADD)for(const R of S)f++,d.push({left:i(),right:s(N.ADD,f,X(l,R))})}if(e===r){for(let v=0;v<d.length;v++)d[v].fold=!1;return _}for(let v=0;v<d.length;v++){const y=d[v];if(y.left.type===N.DELETE||y.right.type===N.ADD){const[M,L]=[Math.max(v-n,0),Math.min(v+n+1,d.length)];for(let D=M;D<L;D++)d[D].fold=!1}y.fold===void 0&&(y.fold=!0)}const b=[];let E=[];for(let v=0;v<d.length;v++){const y=d[v];if(y.fold===!1){E.length&&(E[0].hideIndex=_.collector.length,_.collector.push({lines:E,fold:!0}),E=[]),b.push(y);continue}y.hide=!0,E.push(y),b.push(y)}return E.length&&(E[0].hideIndex=_.collector.length,_.collector.push({lines:E,fold:!0}),E=[]),_.changes=b,_}function xt(e,r,l="plaintext",u="word",h=!1,n=10,t){const i=dn(e,r),s=t?new RegExp(t):void 0;let a=0,o=0,c=!1;const f=[],p={changes:f,collector:[],stat:pn(i,s)};for(let b=0;b<i.length;b++){if(c){c=!1;continue}const[E,v]=[i[b],i[b+1]],[y,M]=[ue(E),ue(v)],L=E.value.replace(/\n$/,"").split(`
|
|
15
15
|
`);if(v===void 0){for(const S of L){y===N.EQUAL&&(a++,o++),y===N.DELETE&&a++,y===N.ADD&&o++;const O=X(l,S);f.push({type:y,code:O,addNum:y===N.DELETE?void 0:o,delNum:y===N.ADD?void 0:a})}break}if(y===N.EQUAL)for(const S of L){a++,o++;const O=X(l,S);f.push({type:N.EQUAL,code:O,delNum:a,addNum:o})}const D=v.value.replace(/\n$/,"").split(`
|
|
16
|
-
`);if(y===N.DELETE)if(M===N.ADD&&(L.length===D.length||h)){for(let S=0;S<L.length;S++){const O=L[S],R=D[S];a++;const I=X(l,we(R,O,u));f.push({type:s!=null&&s.test(O)?N.EQUAL:N.DELETE,code:I,delNum:a})}for(let S=0;S<D.length;S++){const O=L[S],R=D[S];o++;const I=X(l,we(O,R,u));f.push({type:s!=null&&s.test(R)?N.EQUAL:N.ADD,code:I,addNum:o})}c=!0}else for(const S of L){a++;const O=X(l,S);f.push({type:N.DELETE,code:O,delNum:a})}if(y===N.ADD)for(const S of L){o++;const O=X(l,S);f.push({type:N.ADD,code:O,addNum:o})}}for(let b=0;b<f.length;b++){const E=f[b];if(E.type===N.DELETE||E.type===N.ADD){const[v,y]=[Math.max(b-n,0),Math.min(b+n+1,f.length)];for(let M=v;M<y;M++)f[M].fold=!1}E.fold===void 0&&(E.fold=!0)}if(e===r){for(let b=0;b<f.length;b++)f[b].fold=!1;return p}const d=[];let _=[];for(let b=0;b<f.length;b++){const E=f[b];if(E.fold===!1){_.length&&(_[0].hideIndex=p.collector.length,p.collector.push({lines:_,fold:!0}),_=[]),d.push(E);continue}E.type==="equal"&&(E.hide=!0,_.push(E)),d.push(E)}return _.length&&(_[0].hideIndex=p.collector.length,p.collector.push({lines:_,fold:!0}),_=[]),p.changes=d,p}const Vt={key:0},Gt=g.createElementVNode("td",{class:"blob-code blob-code-hunk",align:"left"}," ⋯ ",-1),Kt={key:1},Wt=["data-code-marker","innerHTML"],Qt=g.defineComponent({__name:"UnifiedLine",props:{line:{}},emits:["expand"],setup(e,{emit:r}){const l=r;function u(h){return h===N.DELETE?"-":h===N.ADD?"+":""}return(h,n)=>h.line.hideIndex!==void 0&&h.line.hide?(g.openBlock(),g.createElementBlock("tr",Vt,[g.createElementVNode("td",{class:"blob-num blob-num-hunk text-center",colspan:"2",onClick:n[0]||(n[0]=t=>l("expand",h.line))}," > "),Gt])):h.line.hide?g.createCommentVNode("",!0):(g.openBlock(),g.createElementBlock("tr",Kt,[g.createElementVNode("td",{class:g.normalizeClass(["blob-num",{"blob-num-deletion":h.line.type===g.unref(N).DELETE,"blob-num-addition":h.line.type===g.unref(N).ADD,"blob-num-context":h.line.type===g.unref(N).EQUAL,"blob-num-hunk":h.line.hide!==void 0}])},g.toDisplayString(h.line.delNum),3),g.createElementVNode("td",{class:g.normalizeClass(["blob-num",{"blob-num-deletion":h.line.type===g.unref(N).DELETE,"blob-num-addition":h.line.type===g.unref(N).ADD,"blob-num-context":h.line.type===g.unref(N).EQUAL,"blob-num-hunk":h.line.hide!==void 0}])},g.toDisplayString(h.line.addNum),3),g.createElementVNode("td",{class:g.normalizeClass(["blob-code",{"blob-code-deletion":h.line.type===g.unref(N).DELETE,"blob-code-addition":h.line.type===g.unref(N).ADD,"blob-code-context":h.line.type===g.unref(N).EQUAL,"blob-code-hunk":h.line.hide!==void 0}])},[g.createElementVNode("span",{class:"blob-code-inner blob-code-marker","data-code-marker":u(h.line.type),innerHTML:h.line.code},null,8,Wt)],2)]))}}),Zt={class:"diff-table"},Yt=g.defineComponent({__name:"UnifiedViewer",props:{diffChange:{}},setup(e){const r=e;function l({hideIndex:u}){u!==void 0&&r.diffChange.collector[u].lines.forEach(h=>{h.hide=!1,h.fold=!1})}return(u,h)=>{var n;return g.openBlock(),g.createElementBlock("table",Zt,[g.createElementVNode("tbody",null,[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList((n=u.diffChange)==null?void 0:n.changes,(t,i)=>(g.openBlock(),g.createBlock(Qt,{key:i,line:t,onExpand:l},null,8,["line"]))),128))])])}}}),Xt={key:0},jt=g.createElementVNode("td",{class:"blob-code blob-code-inner blob-code-hunk",colspan:"3",align:"left"}," ⋯ ",-1),qt={key:1},Jt=g.createElementVNode("td",{class:"blob-num blob-num-empty empty-cell"},null,-1),er=g.createElementVNode("td",{class:"blob-code blob-code-empty empty-cell"},null,-1),nr=["onMousedown"],tr=["data-code-marker","innerHTML"],rr=g.defineComponent({__name:"SplitLine",props:{splitLine:{}},emits:["expand"],setup(e,{emit:r}){const l=r;function u(n){return n===N.DELETE?"-":n===N.ADD?"+":""}function h(n){
|
|
16
|
+
`);if(y===N.DELETE)if(M===N.ADD&&(L.length===D.length||h)){for(let S=0;S<L.length;S++){const O=L[S],R=D[S];a++;const I=X(l,we(R,O,u));f.push({type:s!=null&&s.test(O)?N.EQUAL:N.DELETE,code:I,delNum:a})}for(let S=0;S<D.length;S++){const O=L[S],R=D[S];o++;const I=X(l,we(O,R,u));f.push({type:s!=null&&s.test(R)?N.EQUAL:N.ADD,code:I,addNum:o})}c=!0}else for(const S of L){a++;const O=X(l,S);f.push({type:N.DELETE,code:O,delNum:a})}if(y===N.ADD)for(const S of L){o++;const O=X(l,S);f.push({type:N.ADD,code:O,addNum:o})}}for(let b=0;b<f.length;b++){const E=f[b];if(E.type===N.DELETE||E.type===N.ADD){const[v,y]=[Math.max(b-n,0),Math.min(b+n+1,f.length)];for(let M=v;M<y;M++)f[M].fold=!1}E.fold===void 0&&(E.fold=!0)}if(e===r){for(let b=0;b<f.length;b++)f[b].fold=!1;return p}const d=[];let _=[];for(let b=0;b<f.length;b++){const E=f[b];if(E.fold===!1){_.length&&(_[0].hideIndex=p.collector.length,p.collector.push({lines:_,fold:!0}),_=[]),d.push(E);continue}E.type==="equal"&&(E.hide=!0,_.push(E)),d.push(E)}return _.length&&(_[0].hideIndex=p.collector.length,p.collector.push({lines:_,fold:!0}),_=[]),p.changes=d,p}const Vt={key:0},Gt=g.createElementVNode("td",{class:"blob-code blob-code-hunk",align:"left"}," ⋯ ",-1),Kt={key:1},Wt=["data-code-marker","innerHTML"],Qt=g.defineComponent({__name:"UnifiedLine",props:{line:{}},emits:["expand"],setup(e,{emit:r}){const l=r;function u(h){return h===N.DELETE?"-":h===N.ADD?"+":""}return(h,n)=>h.line.hideIndex!==void 0&&h.line.hide?(g.openBlock(),g.createElementBlock("tr",Vt,[g.createElementVNode("td",{class:"blob-num blob-num-hunk text-center",colspan:"2",onClick:n[0]||(n[0]=t=>l("expand",h.line))}," > "),Gt])):h.line.hide?g.createCommentVNode("",!0):(g.openBlock(),g.createElementBlock("tr",Kt,[g.createElementVNode("td",{class:g.normalizeClass(["blob-num",{"blob-num-deletion":h.line.type===g.unref(N).DELETE,"blob-num-addition":h.line.type===g.unref(N).ADD,"blob-num-context":h.line.type===g.unref(N).EQUAL,"blob-num-hunk":h.line.hide!==void 0}])},g.toDisplayString(h.line.delNum),3),g.createElementVNode("td",{class:g.normalizeClass(["blob-num",{"blob-num-deletion":h.line.type===g.unref(N).DELETE,"blob-num-addition":h.line.type===g.unref(N).ADD,"blob-num-context":h.line.type===g.unref(N).EQUAL,"blob-num-hunk":h.line.hide!==void 0}])},g.toDisplayString(h.line.addNum),3),g.createElementVNode("td",{class:g.normalizeClass(["blob-code",{"blob-code-deletion":h.line.type===g.unref(N).DELETE,"blob-code-addition":h.line.type===g.unref(N).ADD,"blob-code-context":h.line.type===g.unref(N).EQUAL,"blob-code-hunk":h.line.hide!==void 0}])},[g.createElementVNode("span",{class:"blob-code-inner blob-code-marker","data-code-marker":u(h.line.type),innerHTML:h.line.code},null,8,Wt)],2)]))}}),Zt={class:"diff-table"},Yt=g.defineComponent({__name:"UnifiedViewer",props:{diffChange:{}},setup(e){const r=e;function l({hideIndex:u}){u!==void 0&&r.diffChange.collector[u].lines.forEach(h=>{h.hide=!1,h.fold=!1})}return(u,h)=>{var n;return g.openBlock(),g.createElementBlock("table",Zt,[g.createElementVNode("tbody",null,[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList((n=u.diffChange)==null?void 0:n.changes,(t,i)=>(g.openBlock(),g.createBlock(Qt,{key:i,line:t,onExpand:l},null,8,["line"]))),128))])])}}}),Xt={key:0},jt=g.createElementVNode("td",{class:"blob-code blob-code-inner blob-code-hunk",colspan:"3",align:"left"}," ⋯ ",-1),qt={key:1},Jt=g.createElementVNode("td",{class:"blob-num blob-num-empty empty-cell"},null,-1),er=g.createElementVNode("td",{class:"blob-code blob-code-empty empty-cell"},null,-1),nr=["onMousedown"],tr=["data-code-marker","innerHTML"],rr=g.defineComponent({__name:"SplitLine",props:{splitLine:{}},emits:["expand"],setup(e,{emit:r}){const l=r;function u(n){return n===N.DELETE?"-":n===N.ADD?"+":""}function h(n){const t=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",n==="left");for(const s of t)s.classList.toggle("no-select",n==="right")}return(n,t)=>n.splitLine.hideIndex!==void 0&&n.splitLine.hide?(g.openBlock(),g.createElementBlock("tr",Xt,[g.createElementVNode("td",{class:"blob-num blob-num-hunk",colspan:"1",onClick:t[0]||(t[0]=i=>l("expand",n.splitLine))}," > "),jt])):n.splitLine.hide?g.createCommentVNode("",!0):(g.openBlock(),g.createElementBlock("tr",qt,[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList([n.splitLine.left,n.splitLine.right],(i,s)=>(g.openBlock(),g.createElementBlock(g.Fragment,null,[i.type===g.unref(N).EMPTY?(g.openBlock(),g.createElementBlock(g.Fragment,{key:0},[Jt,er],64)):(g.openBlock(),g.createElementBlock(g.Fragment,{key:1},[g.createElementVNode("td",{class:g.normalizeClass(["blob-num",{"blob-num-deletion":i.type===g.unref(N).DELETE,"blob-num-addition":i.type===g.unref(N).ADD,"blob-num-context":i.type===g.unref(N).EQUAL,"blob-num-hunk":n.splitLine.hide!==void 0}])},g.toDisplayString(i.num),3),g.createElementVNode("td",{class:g.normalizeClass(["blob-code",{"blob-code-deletion":i.type===g.unref(N).DELETE,"blob-code-addition":i.type===g.unref(N).ADD,"blob-code-context":i.type===g.unref(N).EQUAL,"blob-code-hunk":n.splitLine.hide!==void 0,"split-side-left":s===0,"split-side-right":s===1}]),onMousedown:a=>h(s===0?"left":"right")},[g.createElementVNode("span",{class:"blob-code-inner blob-code-marker","data-code-marker":u(i.type),innerHTML:i.code},null,8,tr)],42,nr)],64))],64))),256))]))}}),ir={class:"file-diff-split diff-table"},sr=g.createElementVNode("colgroup",null,[g.createElementVNode("col",{width:"44"}),g.createElementVNode("col"),g.createElementVNode("col",{width:"44"}),g.createElementVNode("col")],-1),ar=g.defineComponent({__name:"SplitViewer",props:{diffChange:{}},setup(e){const r=e;function l({hideIndex:u}){u!==void 0&&r.diffChange.collector[u].lines.forEach(h=>{h.hide=!1,h.fold=!1})}return(u,h)=>{var n;return g.openBlock(),g.createElementBlock("table",ir,[sr,g.createElementVNode("tbody",null,[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList((n=u.diffChange)==null?void 0:n.changes,(t,i)=>(g.openBlock(),g.createBlock(rr,{key:i,"split-line":t,onExpand:l},null,8,["split-line"]))),128))])])}}}),_n=(e,r)=>{const l=e.__vccOpts||e;for(const[u,h]of r)l[u]=h;return l},or={name:"DownArrowIcon"},lr={width:"1rem",viewBox:"0 0 512 512",xmlns:"http://www.w3.org/2000/svg"},cr=[g.createElementVNode("path",{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"},null,-1)];function fr(e,r,l,u,h,n){return g.openBlock(),g.createElementBlock("svg",lr,cr)}const bn=_n(or,[["render",fr]]),ur={name:"UpArrowIcon"},gr={width:"1rem",viewBox:"0 0 512 512",xmlns:"http://www.w3.org/2000/svg"},hr=[g.createElementVNode("path",{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"},null,-1)];function dr(e,r,l,u,h,n){return g.openBlock(),g.createElementBlock("svg",gr,hr)}const mn=_n(ur,[["render",dr]]),Gr="",pr=["theme"],_r={key:0,class:"file-header"},br={key:0,class:"file-info"},mr={class:"info-left"},Er={class:"info-left"},vr={class:"diff-commandbar"},yr={key:0,class:"diff-stat"},wr={class:"diff-stat-added"},Nr={class:"diff-stat-deleted"},Ar={key:1,class:"file-info"},Mr={class:"info-left"},Sr={class:"info-right"},Tr={style:{"margin-left":"20px"}},Dr={class:"diff-commandbar"},Lr={key:0,class:"diff-stat"},Rr={class:"diff-stat-added"},Or={class:"diff-stat-deleted"},Cr=g.defineComponent({__name:"CodeDiff",props:{newString:{},oldString:{},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(e,{emit:r}){const l=e,u=r,h=g.computed(()=>l.outputFormat==="line-by-line"),n=g.computed(()=>{let d=l.oldString||"";return d=l.trim?d.trim():d,d=l.noDiffLineFeed?d.replace(/(\r\n)/g,`
|
|
17
17
|
`):d,d}),t=g.computed(()=>{let d=l.newString||"";return d=l.trim?d.trim():d,d=l.noDiffLineFeed?d.replace(/(\r\n)/g,`
|
|
18
18
|
`):d,d}),i=g.computed(()=>h.value?xt(n.value,t.value,l.language,l.diffStyle,l.forceInlineComparison,l.context,l.ignoreMatchingLines):zt(n.value,t.value,l.language,l.diffStyle,l.forceInlineComparison,l.context,l.ignoreMatchingLines)),s=g.ref(i.value),a=g.computed(()=>s.value.stat.additionsNum===0&&s.value.stat.deletionsNum===0),o=g.ref(-1);function c(){const d=document.querySelectorAll(".blob-code-addition");o.value<d.length-1&&(o.value++,p(d))}function f(){const d=document.querySelectorAll(".blob-code-addition");o.value>0&&(o.value--,p(d))}function p(d){d.forEach(b=>b.classList.remove("current-diff"));const _=d[o.value];_&&(_.classList.add("current-diff"),_.scrollIntoView({behavior:"smooth",block:"center"}))}return g.watch(()=>l,()=>{s.value=i.value,u("diff",{stat:{isChanged:!a.value,addNum:s.value.stat.additionsNum,delNum:s.value.stat.deletionsNum}})},{deep:!0,immediate:!0}),(d,_)=>(g.openBlock(),g.createElementBlock("div",{class:"code-diff-view",theme:d.theme,style:g.normalizeStyle({maxHeight:d.maxHeight})},[d.hideHeader?g.createCommentVNode("",!0):(g.openBlock(),g.createElementBlock("div",_r,[g.unref(h)?(g.openBlock(),g.createElementBlock("div",br,[g.createElementVNode("span",null,[g.createElementVNode("div",mr,g.toDisplayString(d.filename),1),g.createElementVNode("div",Er,g.toDisplayString(d.newFilename),1)]),g.createElementVNode("span",vr,[g.createElementVNode("button",{class:"command-item-button",title:"Next Change",onClick:c},[g.createVNode(bn)]),g.createElementVNode("button",{class:"command-item-button",title:"Previous Change",onClick:f},[g.createVNode(mn)])]),d.hideStat?g.createCommentVNode("",!0):(g.openBlock(),g.createElementBlock("span",yr,[g.renderSlot(d.$slots,"stat",{stat:g.unref(s).stat},()=>[g.createElementVNode("span",wr,"+"+g.toDisplayString(g.unref(s).stat.additionsNum)+" additions",1),g.createElementVNode("span",Nr,"-"+g.toDisplayString(g.unref(s).stat.deletionsNum)+" deletions",1)])]))])):(g.openBlock(),g.createElementBlock("div",Ar,[g.createElementVNode("span",Mr,g.toDisplayString(d.filename),1),g.createElementVNode("span",Sr,[g.createElementVNode("span",Tr,g.toDisplayString(d.newFilename),1),g.createElementVNode("span",Dr,[g.createElementVNode("button",{class:"command-item-button",title:"Next Change",onClick:c},[g.createVNode(bn)]),g.createElementVNode("button",{class:"command-item-button",title:"Previous Change",onClick:f},[g.createVNode(mn)])]),d.hideStat?g.createCommentVNode("",!0):(g.openBlock(),g.createElementBlock("span",Lr,[g.renderSlot(d.$slots,"stat",{stat:g.unref(s).stat},()=>[g.createElementVNode("span",Rr,"+"+g.toDisplayString(g.unref(s).stat.additionsNum)+" additions",1),g.createElementVNode("span",Or,"-"+g.toDisplayString(g.unref(s).stat.deletionsNum)+" deletions",1)])]))])]))])),g.unref(h)?(g.openBlock(),g.createBlock(Yt,{key:1,"diff-change":g.unref(s)},null,8,["diff-change"])):(g.openBlock(),g.createBlock(ar,{key:2,"diff-change":g.unref(s)},null,8,["diff-change"]))],12,pr))}});function kr(e){e.component("CodeDiff",Cr)}return{install:kr,hljs:Y}});
|
package/package.json
CHANGED
package/src/split/SplitLine.vue
CHANGED
|
@@ -17,8 +17,6 @@ function getCodeMarker(type: DiffType) {
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
function onSplitLineMousedown(side: 'left' | 'right') {
|
|
20
|
-
window.getSelection()!.removeAllRanges()
|
|
21
|
-
|
|
22
20
|
const leftElements = document.querySelectorAll('.file-diff-split .split-side-left')!
|
|
23
21
|
const rightElements = document.querySelectorAll('.file-diff-split .split-side-right')!
|
|
24
22
|
|