You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
63 lines
36 KiB
JavaScript
63 lines
36 KiB
JavaScript
|
9 months ago
|
"use strict";exports.id=233,exports.ids=[233],exports.modules={91233:(t,e,r)=>{r.d(e,{diagram:()=>B});var i=r(15537),a=r(3896);r(48869),r(43795),r(57581);var c=function(){var t=function(t,e,r,i){for(r=r||{},i=t.length;i--;r[t[i]]=e);return r},e=[1,3],r=[1,6],i=[1,4],a=[1,5],c=[2,5],s=[1,12],n=[5,7,13,19,21,23,24,26,28,31,36,39,46],o=[7,13,19,21,23,24,26,28,31,36,39],l=[7,12,13,19,21,23,24,26,28,31,36,39],h=[7,13,46],m=[1,42],u=[1,41],y=[7,13,29,32,34,37,46],g=[1,55],p=[1,56],b=[1,57],d=[7,13,32,34,41,46],f={trace:function(){},yy:{},symbols_:{error:2,start:3,eol:4,GG:5,document:6,EOF:7,":":8,DIR:9,options:10,body:11,OPT:12,NL:13,line:14,statement:15,commitStatement:16,mergeStatement:17,cherryPickStatement:18,acc_title:19,acc_title_value:20,acc_descr:21,acc_descr_value:22,acc_descr_multiline_value:23,section:24,branchStatement:25,CHECKOUT:26,ref:27,BRANCH:28,ORDER:29,NUM:30,CHERRY_PICK:31,COMMIT_ID:32,STR:33,COMMIT_TAG:34,EMPTYSTR:35,MERGE:36,COMMIT_TYPE:37,commitType:38,COMMIT:39,commit_arg:40,COMMIT_MSG:41,NORMAL:42,REVERSE:43,HIGHLIGHT:44,ID:45,";":46,$accept:0,$end:1},terminals_:{2:"error",5:"GG",7:"EOF",8:":",9:"DIR",12:"OPT",13:"NL",19:"acc_title",20:"acc_title_value",21:"acc_descr",22:"acc_descr_value",23:"acc_descr_multiline_value",24:"section",26:"CHECKOUT",28:"BRANCH",29:"ORDER",30:"NUM",31:"CHERRY_PICK",32:"COMMIT_ID",33:"STR",34:"COMMIT_TAG",35:"EMPTYSTR",36:"MERGE",37:"COMMIT_TYPE",39:"COMMIT",41:"COMMIT_MSG",42:"NORMAL",43:"REVERSE",44:"HIGHLIGHT",45:"ID",46:";"},productions_:[0,[3,2],[3,3],[3,4],[3,5],[6,0],[6,2],[10,2],[10,1],[11,0],[11,2],[14,2],[14,1],[15,1],[15,1],[15,1],[15,2],[15,2],[15,1],[15,1],[15,1],[15,2],[25,2],[25,4],[18,3],[18,5],[18,5],[18,5],[18,5],[17,2],[17,4],[17,4],[17,4],[17,6],[17,6],[17,6],[17,6],[17,6],[17,6],[17,8],[17,8],[17,8],[17,8],[17,8],[17,8],[16,2],[16,3],[16,3],[16,5],[16,5],[16,3],[16,5],[16,5],[16,5],[16,5],[16,7],[16,7],[16,7],[16,7],[16,7],[16,7],[16,3],[16,5],[16,5],[16,5],[16,5],[16,5],[16,5],[16,7],[16,7],[16,7],[16,7],[16,7],[16,7],[16,7],[16,7],[16,7],[16,7],[16,7],[16,7],[16,7],[16,7],[16,7],[16,7],[16,7],[16,7],[16,9],[16,9],[16,9],[16,9],[16,9],[16,9],[16,9],[16,9],[16,9],[16,9],[16,9],[16,9],[16,9],[16,9],[16,9],[16,9],[16,9],[16,9],[16,9],[16,9],[16,9],[16,9],[16,9],[16,9],[40,0],[40,1],[38,1],[38,1],[38,1],[27,1],[27,1],[4,1],[4,1],[4,1]],performAction:function(t,e,r,i,a,c,s){var n=c.length-1;switch(a){case 2:return c[n];case 3:return c[n-1];case 4:return i.setDirection(c[n-3]),c[n-1];case 6:i.setOptions(c[n-1]),this.$=c[n];break;case 7:c[n-1]+=c[n],this.$=c[n-1];break;case 9:this.$=[];break;case 10:c[n-1].push(c[n]),this.$=c[n-1];break;case 11:this.$=c[n-1];break;case 16:this.$=c[n].trim(),i.setAccTitle(this.$);break;case 17:case 18:this.$=c[n].trim(),i.setAccDescription(this.$);break;case 19:i.addSection(c[n].substr(8)),this.$=c[n].substr(8);break;case 21:i.checkout(c[n]);break;case 22:i.branch(c[n]);break;case 23:i.branch(c[n-2],c[n]);break;case 24:i.cherryPick(c[n],"",void 0);break;case 25:i.cherryPick(c[n-2],"",c[n]);break;case 26:case 28:i.cherryPick(c[n-2],"","");break;case 27:i.cherryPick(c[n],"",c[n-2]);break;case 29:i.merge(c[n],"","","");break;case 30:i.merge(c[n-2],c[n],"","");break;case 31:i.merge(c[n-2],"",c[n],"");break;case 32:i.merge(c[n-2],"","",c[n]);break;case 33:i.merge(c[n-4],c[n],"",c[n-2]);break;case 34:i.merge(c[n-4],"",c[n],c[n-2]);break;case 35:i.merge(c[n-4],"",c[n-2],c[n]);break;case 36:i.merge(c[n-4],c[n-2],c[n],"");break;case 37:i.merge(c[n-4],c[n-2],"",c[n]);break;case 38:i.merge(c[n-4],c[n],c[n-2],"");break;case 39:i.merge(c[n-6],c[n-4],c[n-2],c[n]);break;case 40:i.merge(c[n-6],c[n],c[n-4],c[n-2]);break;case 41:i.merge(c[n-6],c[n-4],c[n],c[n-2]);break;case 42:i.merge(c[n-6],c[n-2],c[n-4],c[n]);break;case 43:i.merge(c[n-6],c[n],c[n-2],c[n-4]);break;case 44:i.merge(c[n-6],c[n-2],c[n],c[n-4]);break;case 45:i.commit(c[n]);break;case 46:i.commit("","",i.commitType.NORMAL,c[n]);break;case 47:i.commit("","",c[n],"");break;case 48:i.commit("","",c[n],c[n-2]);break;case 49:i.commit("","",c[n-2],c[n]);break;case 50:i.commit("",c[n],i.co
|
||
|
|
${n-a.width/2-2},${h+2}
|
||
|
|
${n-a.width/2-2},${h-2}
|
||
|
|
${n+10-a.width/2-4},${h-c-2}
|
||
|
|
${n+10+a.width/2+4},${h-c-2}
|
||
|
|
${n+10+a.width/2+4},${h+c+2}
|
||
|
|
${n+10-a.width/2-4},${h+c+2}`),e.attr("cx",n-a.width/2+2).attr("cy",h).attr("r",1.5).attr("class","tag-hole"),"TB"===M&&(t.attr("class","tag-label-bkg").attr("points",`
|
||
|
|
${l},${n+2}
|
||
|
|
${l},${n-2}
|
||
|
|
${l+10},${n-c-2}
|
||
|
|
${l+10+a.width+4},${n-c-2}
|
||
|
|
${l+10+a.width+4},${n+c+2}
|
||
|
|
${l+10},${n+c+2}`).attr("transform","translate(12,12) rotate(45, "+l+","+n+")"),e.attr("cx",l+2).attr("cy",n).attr("transform","translate(12,12) rotate(45, "+l+","+n+")"),r.attr("x",l+5).attr("y",n+3).attr("transform","translate(14,14) rotate(45, "+l+","+n+")"))}}(n+=50)>R&&(R=n)})},O=(t,e,r)=>Object.keys(r).filter(i=>r[i].branch===e.branch&&r[i].seq>t.seq&&r[i].seq<e.seq).length>0,C=(t,e,r=0)=>{let i=t+Math.abs(t-e)/2;if(r>5)return i;if(L.every(t=>Math.abs(t-i)>=10))return L.push(i),i;let a=Math.abs(t-e);return C(t,e-a/5,r+1)},S=(t,e,r,i)=>{let a;let c=w[e.id],s=w[r.id],n=O(e,r,i),o="",l="",h=0,m=0,u=T[r.branch].index;if(n){o="A 10 10, 0, 0, 0,",l="A 10 10, 0, 0, 1,",h=10,m=10,u=T[r.branch].index;let t=c.y<s.y?C(c.y,s.y):C(s.y,c.y),e=c.x<s.x?C(c.x,s.x):C(s.x,c.x);a="TB"===M?c.x<s.x?`M ${c.x} ${c.y} L ${e-h} ${c.y} ${l} ${e} ${c.y+m} L ${e} ${s.y-h} ${o} ${e+m} ${s.y} L ${s.x} ${s.y}`:`M ${c.x} ${c.y} L ${e+h} ${c.y} ${o} ${e} ${c.y+m} L ${e} ${s.y-h} ${l} ${e-m} ${s.y} L ${s.x} ${s.y}`:c.y<s.y?`M ${c.x} ${c.y} L ${c.x} ${t-h} ${o} ${c.x+m} ${t} L ${s.x-h} ${t} ${l} ${s.x} ${t+m} L ${s.x} ${s.y}`:`M ${c.x} ${c.y} L ${c.x} ${t+h} ${l} ${c.x+m} ${t} L ${s.x-h} ${t} ${o} ${s.x} ${t-m} L ${s.x} ${s.y}`}else"TB"===M?(c.x<s.x&&(o="A 20 20, 0, 0, 0,",l="A 20 20, 0, 0, 1,",h=20,m=20,u=T[r.branch].index,a=`M ${c.x} ${c.y} L ${s.x-h} ${c.y} ${l} ${s.x} ${c.y+m} L ${s.x} ${s.y}`),c.x>s.x&&(o="A 20 20, 0, 0, 0,",l="A 20 20, 0, 0, 1,",h=20,m=20,u=T[e.branch].index,a=`M ${c.x} ${c.y} L ${c.x} ${s.y-h} ${l} ${c.x-m} ${s.y} L ${s.x} ${s.y}`),c.x===s.x&&(u=T[e.branch].index,a=`M ${c.x} ${c.y} L ${c.x+h} ${c.y} ${o} ${c.x+m} ${s.y+h} L ${s.x} ${s.y}`)):(c.y<s.y&&(o="A 20 20, 0, 0, 0,",h=20,m=20,u=T[r.branch].index,a=`M ${c.x} ${c.y} L ${c.x} ${s.y-h} ${o} ${c.x+m} ${s.y} L ${s.x} ${s.y}`),c.y>s.y&&(o="A 20 20, 0, 0, 0,",h=20,m=20,u=T[e.branch].index,a=`M ${c.x} ${c.y} L ${s.x-h} ${c.y} ${o} ${s.x} ${c.y-m} L ${s.x} ${s.y}`),c.y===s.y&&(u=T[e.branch].index,a=`M ${c.x} ${c.y} L ${c.x} ${s.y-h} ${o} ${c.x+m} ${s.y} L ${s.x} ${s.y}`));t.append("path").attr("d",a).attr("class","arrow arrow"+u%8)},P=(t,e)=>{let r=t.append("g").attr("class","commit-arrows");Object.keys(e).forEach(t=>{let i=e[t];i.parents&&i.parents.length>0&&i.parents.forEach(t=>{S(r,e[t],i,e)})})},G=(t,e)=>{let r=(0,i.c)().gitGraph,a=t.append("g");e.forEach((t,e)=>{let i=e%8,c=T[t.name].pos,s=a.append("line");s.attr("x1",0),s.attr("y1",c),s.attr("x2",R),s.attr("y2",c),s.attr("class","branch branch"+i),"TB"===M&&(s.attr("y1",30),s.attr("x1",c),s.attr("y2",R),s.attr("x2",c)),L.push(c);let n=v(t.name),o=a.insert("rect"),l=a.insert("g").attr("class","branchLabel").insert("g").attr("class","label branch-label"+i);l.node().appendChild(n);let h=n.getBBox();o.attr("class","branchLabelBkg label"+i).attr("rx",4).attr("ry",4).attr("x",-h.width-4-(!0===r.rotateCommitLabel?30:0)).attr("y",-h.height/2+8).attr("width",h.width+18).attr("height",h.height+4),l.attr("transform","translate("+(-h.width-14-(!0===r.rotateCommitLabel?30:0))+", "+(c-h.height/2-1)+")"),"TB"===M&&(o.attr("x",c-h.width/2-10).attr("y",0),l.attr("transform","translate("+(c-h.width/2-5)+", 0)")),"TB"!==M&&o.attr("transform","translate(-19, "+(c-h.height/2)+")")})},B={parser:c,db:x,renderer:{draw:function(t,e,r,c){I();let s=(0,i.c)(),n=s.gitGraph;i.l.debug("in gitgraph renderer",t+"\n","id:",e,r),_=c.db.getCommits();let o=c.db.getBranchesAsObjArray();M=c.db.getDirection();let l=(0,a.Ys)(`[id="${e}"]`),h=0;o.forEach((t,e)=>{let r=v(t.name),i=l.append("g"),a=i.insert("g").attr("class","branchLabel"),c=a.insert("g").attr("class","label branch-label");c.node().appendChild(r);let s=r.getBBox();T[t.name]={pos:h,index:e},h+=50+(n.rotateCommitLabel?40:0)+("TB"===M?s.width/2:0),c.remove(),a.remove(),i.remove()}),A(l,_,!1),n.showBranches&&G(l,o),P(l,_),A(l,_,!0),i.u.insertTitle(l,"gitTitleText",n.titleTopMargin,c.db.getDiagramTitle()),(0,i.y)(void 0,l,n.diagramPadding,n.useMaxWidth??s.useMaxWidth)}},styles:t=>`
|
||
|
|
.commit-id,
|
||
|
|
.commit-msg,
|
||
|
|
.branch-label {
|
||
|
|
fill: lightgrey;
|
||
|
|
color: lightgrey;
|
||
|
|
font-family: 'trebuchet ms', verdana, arial, sans-serif;
|
||
|
|
font-family: var(--mermaid-font-family);
|
||
|
|
}
|
||
|
|
${[0,1,2,3,4,5,6,7].map(e=>`
|
||
|
|
.branch-label${e} { fill: ${t["gitBranchLabel"+e]}; }
|
||
|
|
.commit${e} { stroke: ${t["git"+e]}; fill: ${t["git"+e]}; }
|
||
|
|
.commit-highlight${e} { stroke: ${t["gitInv"+e]}; fill: ${t["gitInv"+e]}; }
|
||
|
|
.label${e} { fill: ${t["git"+e]}; }
|
||
|
|
.arrow${e} { stroke: ${t["git"+e]}; }
|
||
|
|
`).join("\n")}
|
||
|
|
|
||
|
|
.branch {
|
||
|
|
stroke-width: 1;
|
||
|
|
stroke: ${t.lineColor};
|
||
|
|
stroke-dasharray: 2;
|
||
|
|
}
|
||
|
|
.commit-label { font-size: ${t.commitLabelFontSize}; fill: ${t.commitLabelColor};}
|
||
|
|
.commit-label-bkg { font-size: ${t.commitLabelFontSize}; fill: ${t.commitLabelBackground}; opacity: 0.5; }
|
||
|
|
.tag-label { font-size: ${t.tagLabelFontSize}; fill: ${t.tagLabelColor};}
|
||
|
|
.tag-label-bkg { fill: ${t.tagLabelBackground}; stroke: ${t.tagLabelBorder}; }
|
||
|
|
.tag-hole { fill: ${t.textColor}; }
|
||
|
|
|
||
|
|
.commit-merge {
|
||
|
|
stroke: ${t.primaryColor};
|
||
|
|
fill: ${t.primaryColor};
|
||
|
|
}
|
||
|
|
.commit-reverse {
|
||
|
|
stroke: ${t.primaryColor};
|
||
|
|
fill: ${t.primaryColor};
|
||
|
|
stroke-width: 3;
|
||
|
|
}
|
||
|
|
.commit-highlight-outer {
|
||
|
|
}
|
||
|
|
.commit-highlight-inner {
|
||
|
|
stroke: ${t.primaryColor};
|
||
|
|
fill: ${t.primaryColor};
|
||
|
|
}
|
||
|
|
|
||
|
|
.arrow { stroke-width: 8; stroke-linecap: round; fill: none}
|
||
|
|
.gitTitleText {
|
||
|
|
text-anchor: middle;
|
||
|
|
font-size: 18px;
|
||
|
|
fill: ${t.textColor};
|
||
|
|
}
|
||
|
|
`}}};
|