mirror of
https://github.com/redhat-developer/odo.git
synced 2025-10-19 03:06:19 +03:00
* Serve UI from api server * Build UI static files + check generation with GHAction * Update UI static files * Use specific commit for verify-changed-files action * Add pkg/apiserver-impl/ui to .gitattributes * Ignore pkg/apiserver-impl/ui/** for sonar
1 line
8.5 KiB
JavaScript
Generated
1 line
8.5 KiB
JavaScript
Generated
"use strict";(self.webpackChunkdevfile_builder=self.webpackChunkdevfile_builder||[]).push([[592],{5847:(G,B,b)=>{b.d(B,{Z:()=>M});var D=b(8267),y=b(486);const M=m=>!(m=>(m=>{const{r:N,g:L,b:$}=y.Z.parse(m),U=.2126*D.Z.channel.toLinear(N)+.7152*D.Z.channel.toLinear(L)+.0722*D.Z.channel.toLinear($);return D.Z.lang.round(U)})(m)>=.5)(m)},4724:(G,B,b)=>{b.d(B,{a:()=>Z,f:()=>O});var D=b(8814),y=b(5703),I=b(4976),s=b(855),v=b(9111),P=b(5963),R=b(3057),M=b(1775);const m={},L=function(t,n,E,i,f,u){const h=i.select(`[id="${E}"]`);Object.keys(t).forEach(function(c){const l=t[c];let k="default";l.classes.length>0&&(k=l.classes.join(" "));const w=(0,v.m)(l.styles);let o,e=void 0!==l.text?l.text:l.id;if((0,s.j)((0,s.g)().flowchart.htmlLabels)){const S={label:e.replace(/fa[blrs]?:fa-[\w-]+/g,g=>`<i class='${g.replace(":"," ")}'></i>`)};o=(0,R.a)(h,S).node(),o.parentNode.removeChild(o)}else{const S=f.createElementNS("http://www.w3.org/2000/svg","text");S.setAttribute("style",w.labelStyle.replace("color:","fill:"));const g=e.split(s.d.lineBreakRegex);for(const A of g){const C=f.createElementNS("http://www.w3.org/2000/svg","tspan");C.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),C.setAttribute("dy","1em"),C.setAttribute("x","1"),C.textContent=A,S.appendChild(C)}o=S}let d=0,r="";switch(l.type){case"round":d=5,r="rect";break;case"square":case"group":default:r="rect";break;case"diamond":r="question";break;case"hexagon":r="hexagon";break;case"odd":case"odd_right":r="rect_left_inv_arrow";break;case"lean_right":r="lean_right";break;case"lean_left":r="lean_left";break;case"trapezoid":r="trapezoid";break;case"inv_trapezoid":r="inv_trapezoid";break;case"circle":r="circle";break;case"ellipse":r="ellipse";break;case"stadium":r="stadium";break;case"subroutine":r="subroutine";break;case"cylinder":r="cylinder";break;case"doublecircle":r="doublecircle"}n.setNode(l.id,{labelStyle:w.labelStyle,shape:r,labelText:e,rx:d,ry:d,class:k,style:w.style,id:l.id,link:l.link,linkTarget:l.linkTarget,tooltip:u.db.getTooltip(l.id)||"",domId:u.db.lookUpDomId(l.id),haveCallback:l.haveCallback,width:"group"===l.type?500:void 0,dir:l.dir,type:l.type,props:l.props,padding:(0,s.g)().flowchart.padding}),s.l.info("setNode",{labelStyle:w.labelStyle,shape:r,labelText:e,rx:d,ry:d,class:k,style:w.style,id:l.id,domId:u.db.lookUpDomId(l.id),width:"group"===l.type?500:void 0,type:l.type,dir:l.dir,props:l.props,padding:(0,s.g)().flowchart.padding})})},$=function(t,n,E){s.l.info("abc78 edges = ",t);let u,h,i=0,f={};if(void 0!==t.defaultStyle){const a=(0,v.m)(t.defaultStyle);u=a.style,h=a.labelStyle}t.forEach(function(a){i++;var c="L-"+a.start+"-"+a.end;void 0===f[c]?(f[c]=0,s.l.info("abc78 new entry",c,f[c])):(f[c]++,s.l.info("abc78 new entry",c,f[c]));let l=c+"-"+f[c];s.l.info("abc78 new link id to be used is",c,l,f[c]);var k="LS-"+a.start,w="LE-"+a.end;const e={style:"",labelStyle:""};switch(e.minlen=a.length||1,e.arrowhead="arrow_open"===a.type?"none":"normal",e.arrowTypeStart="arrow_open",e.arrowTypeEnd="arrow_open",a.type){case"double_arrow_cross":e.arrowTypeStart="arrow_cross";case"arrow_cross":e.arrowTypeEnd="arrow_cross";break;case"double_arrow_point":e.arrowTypeStart="arrow_point";case"arrow_point":e.arrowTypeEnd="arrow_point";break;case"double_arrow_circle":e.arrowTypeStart="arrow_circle";case"arrow_circle":e.arrowTypeEnd="arrow_circle"}let o="",d="";switch(a.stroke){case"normal":o="fill:none;",void 0!==u&&(o=u),void 0!==h&&(d=h),e.thickness="normal",e.pattern="solid";break;case"dotted":e.thickness="normal",e.pattern="dotted",e.style="fill:none;stroke-width:2px;stroke-dasharray:3;";break;case"thick":e.thickness="thick",e.pattern="solid",e.style="stroke-width: 3.5px;fill:none;";break;case"invisible":e.thickness="invisible",e.pattern="solid",e.style="stroke-width: 0;fill:none;"}if(void 0!==a.style){const r=(0,v.m)(a.style);o=r.style,d=r.labelStyle}e.style=e.style+=o,e.labelStyle=e.labelStyle+=d,e.curve=(0,v.n)(void 0!==a.interpolate?a.interpolate:void 0!==t.defaultInterpolate?t.defaultInterpolate:m.curve,y.c_6),void 0===a.text?void 0!==a.style&&(e.arrowheadStyle="fill: #333"):(e.arrowheadStyle="fill: #333",e.labelpos="c"),e.labelType="text",e.label=a.text.replace(s.d.lineBreakRegex,"\n"),void 0===a.style&&(e.style=e.style||"stroke: #333; stroke-width: 1.5px;fill:none;"),e.labelStyle=e.labelStyle.replace("color:","fill:"),e.id=l,e.classes="flowchart-link "+k+" "+w,n.setEdge(a.start,a.end,e,i)})},O={setConf:function(t){const n=Object.keys(t);for(const E of n)m[E]=t[E]},addVertices:L,addEdges:$,getClasses:function(t,n){s.l.info("Extracting classes"),n.db.clear();try{return n.parse(t),n.db.getClasses()}catch{return}},draw:function(t,n,E,i){s.l.info("Drawing flowchart"),i.db.clear(),I.f.setGen("gen-2"),i.parser.parse(t);let f=i.db.getDirection();void 0===f&&(f="TD");const{securityLevel:u,flowchart:h}=(0,s.g)(),a=h.nodeSpacing||50,c=h.rankSpacing||50;let l;"sandbox"===u&&(l=(0,y.Ys)("#i"+n));const k=(0,y.Ys)("sandbox"===u?l.nodes()[0].contentDocument.body:"body"),w="sandbox"===u?l.nodes()[0].contentDocument:document,e=new D.k({multigraph:!0,compound:!0}).setGraph({rankdir:f,nodesep:a,ranksep:c,marginx:0,marginy:0}).setDefaultEdgeLabel(function(){return{}});let o;const d=i.db.getSubGraphs();s.l.info("Subgraphs - ",d);for(let p=d.length-1;p>=0;p--)o=d[p],s.l.info("Subgraph - ",o),i.db.addVertex(o.id,o.title,"group",void 0,o.classes,o.dir);const r=i.db.getVertices(),S=i.db.getEdges();s.l.info("Edges",S);let g=0;for(g=d.length-1;g>=0;g--){o=d[g],(0,y.td_)("cluster").append("text");for(let p=0;p<o.nodes.length;p++)s.l.info("Setting up subgraphs",o.nodes[p],o.id),e.setParent(o.nodes[p],o.id)}L(r,e,n,k,w,i),$(S,e);const A=k.select(`[id="${n}"]`),C=k.select("#"+n+" g");if((0,P.r)(C,e,["point","circle","cross"],"flowchart",n),v.u.insertTitle(A,"flowchartTitleText",h.titleTopMargin,i.db.getDiagramTitle()),(0,M.s)(e,A,h.diagramPadding,h.useMaxWidth),i.db.indexNodes("subGraph"+g),!h.htmlLabels){const p=w.querySelectorAll('[id="'+n+'"] .edgeLabel .label');for(const x of p){const T=x.getBBox(),_=w.createElementNS("http://www.w3.org/2000/svg","rect");_.setAttribute("rx",0),_.setAttribute("ry",0),_.setAttribute("width",T.width),_.setAttribute("height",T.height),x.insertBefore(_,x.firstChild)}}Object.keys(r).forEach(function(p){const x=r[p];if(x.link){const T=(0,y.Ys)("#"+n+' [id="'+p+'"]');if(T){const _=w.createElementNS("http://www.w3.org/2000/svg","a");_.setAttributeNS("http://www.w3.org/2000/svg","class",x.classes.join(" ")),_.setAttributeNS("http://www.w3.org/2000/svg","href",x.link),_.setAttributeNS("http://www.w3.org/2000/svg","rel","noopener"),"sandbox"===u?_.setAttributeNS("http://www.w3.org/2000/svg","target","_top"):x.linkTarget&&_.setAttributeNS("http://www.w3.org/2000/svg","target",x.linkTarget);const W=T.insert(function(){return _},":first-child"),K=T.select(".label-container");K&&W.append(function(){return K.node()});const z=T.select(".label");z&&W.append(function(){return z.node()})}}})}},Z=t=>`.label {\n font-family: ${t.fontFamily};\n color: ${t.nodeTextColor||t.textColor};\n }\n .cluster-label text {\n fill: ${t.titleColor};\n }\n .cluster-label span {\n color: ${t.titleColor};\n }\n\n .label text,span {\n fill: ${t.nodeTextColor||t.textColor};\n color: ${t.nodeTextColor||t.textColor};\n }\n\n .node rect,\n .node circle,\n .node ellipse,\n .node polygon,\n .node path {\n fill: ${t.mainBkg};\n stroke: ${t.nodeBorder};\n stroke-width: 1px;\n }\n\n .node .label {\n text-align: center;\n }\n .node.clickable {\n cursor: pointer;\n }\n\n .arrowheadPath {\n fill: ${t.arrowheadColor};\n }\n\n .edgePath .path {\n stroke: ${t.lineColor};\n stroke-width: 2.0px;\n }\n\n .flowchart-link {\n stroke: ${t.lineColor};\n fill: none;\n }\n\n .edgeLabel {\n background-color: ${t.edgeLabelBackground};\n rect {\n opacity: 0.5;\n background-color: ${t.edgeLabelBackground};\n fill: ${t.edgeLabelBackground};\n }\n text-align: center;\n }\n\n .cluster rect {\n fill: ${t.clusterBkg};\n stroke: ${t.clusterBorder};\n stroke-width: 1px;\n }\n\n .cluster text {\n fill: ${t.titleColor};\n }\n\n .cluster span {\n color: ${t.titleColor};\n }\n /* .cluster div {\n color: ${t.titleColor};\n } */\n\n div.mermaidTooltip {\n position: absolute;\n text-align: center;\n max-width: 200px;\n padding: 2px;\n font-family: ${t.fontFamily};\n font-size: 12px;\n background: ${t.tertiaryColor};\n border: 1px solid ${t.border2};\n border-radius: 2px;\n pointer-events: none;\n z-index: 100;\n }\n\n .flowchartTitleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ${t.textColor};\n }\n`}}]); |