@mcp-graph-workflow/mcp-graph 5.9.0 → 5.10.0
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/api/routes/siebel.d.ts.map +1 -1
- package/dist/api/routes/siebel.js +36 -0
- package/dist/api/routes/siebel.js.map +1 -1
- package/dist/core/rag/node-indexer.d.ts +1 -1
- package/dist/core/rag/node-indexer.d.ts.map +1 -1
- package/dist/core/rag/node-indexer.js +31 -19
- package/dist/core/rag/node-indexer.js.map +1 -1
- package/dist/mcp/tools/import-graph.d.ts.map +1 -1
- package/dist/mcp/tools/import-graph.js +11 -3
- package/dist/mcp/tools/import-graph.js.map +1 -1
- package/dist/mcp/tools/node.d.ts.map +1 -1
- package/dist/mcp/tools/node.js +2 -1
- package/dist/mcp/tools/node.js.map +1 -1
- package/dist/mcp/tools/reindex-knowledge.d.ts.map +1 -1
- package/dist/mcp/tools/reindex-knowledge.js +2 -1
- package/dist/mcp/tools/reindex-knowledge.js.map +1 -1
- package/dist/schemas/knowledge.schema.d.ts +2 -0
- package/dist/schemas/knowledge.schema.d.ts.map +1 -1
- package/dist/schemas/knowledge.schema.js +1 -1
- package/dist/schemas/knowledge.schema.js.map +1 -1
- package/dist/web/dashboard/dist/assets/benchmark-tab-DE9sF83l.js +1 -0
- package/dist/web/dashboard/dist/assets/{constants-z0QkAiYv.js → constants-lq4BIQN3.js} +1 -1
- package/dist/web/dashboard/dist/assets/context-tab-BDBUYfAA.js +1 -0
- package/dist/web/dashboard/dist/assets/{gitnexus-tab-DDw7DUED.js → gitnexus-tab-Yn1v6B3B.js} +16 -16
- package/dist/web/dashboard/dist/assets/graph-section-C6dzE7Vr.js +1 -0
- package/dist/web/dashboard/dist/assets/graph-tab-eIpG9sGq.js +1 -0
- package/dist/web/dashboard/dist/assets/graph-utils-Cq350VUG.js +1 -0
- package/dist/web/dashboard/dist/assets/{index-F9dY4AG_.js → index-BjE9IIVd.js} +2 -2
- package/dist/web/dashboard/dist/assets/index-CsH_Hv51.js +208 -0
- package/dist/web/dashboard/dist/assets/index-p238Jynp.css +1 -0
- package/dist/web/dashboard/dist/assets/index-ruquw1ns.js +1 -0
- package/dist/web/dashboard/dist/assets/{insights-tab-YN7G6mjm.js → insights-tab-iSZItsRP.js} +15 -15
- package/dist/web/dashboard/dist/assets/journey-tab-GXibD334.js +1 -0
- package/dist/web/dashboard/dist/assets/logs-tab-DROI_l7-.js +2 -0
- package/dist/web/dashboard/dist/assets/memories-tab-DUMqEP5R.js +1 -0
- package/dist/web/dashboard/dist/assets/prd-backlog-tab-DIQ0Fmr_.js +1 -0
- package/dist/web/dashboard/dist/assets/siebel-tab-Ci5KiOA6.js +4 -0
- package/dist/web/dashboard/dist/assets/sif-parse.worker-DZrybOHz.js +4 -0
- package/dist/web/dashboard/dist/assets/skills-tab-EfuAQFRT.js +1 -0
- package/dist/web/dashboard/dist/assets/{style-Da3qWU01.js → style-DF9Y1aXX.js} +1 -1
- package/dist/web/dashboard/dist/index.html +5 -2
- package/package.json +2 -2
- package/dist/web/dashboard/dist/assets/benchmark-tab-BoMsoQjO.js +0 -1
- package/dist/web/dashboard/dist/assets/context-tab-BLT4qQ77.js +0 -1
- package/dist/web/dashboard/dist/assets/graph-tab-DG9Q6nko.js +0 -1
- package/dist/web/dashboard/dist/assets/graph-utils-BpYHKE87.js +0 -1
- package/dist/web/dashboard/dist/assets/index-Cu23WCcu.css +0 -1
- package/dist/web/dashboard/dist/assets/index-DtkPX5ZZ.js +0 -55
- package/dist/web/dashboard/dist/assets/journey-tab-BcweuR82.js +0 -1
- package/dist/web/dashboard/dist/assets/logs-tab-BjdAURdy.js +0 -2
- package/dist/web/dashboard/dist/assets/memories-tab-CQ2xM2aw.js +0 -1
- package/dist/web/dashboard/dist/assets/prd-backlog-tab-CIeCpE1a.js +0 -1
- package/dist/web/dashboard/dist/assets/siebel-tab-bj5CT4-Z.js +0 -3
- package/dist/web/dashboard/dist/assets/skills-tab-Bgk72mKO.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as x,j as e}from"./index-CsH_Hv51.js";import{H as E,P as T,g as V,c as W,E as Y,u as K,a as Z,i as q,B as U,C as X}from"./style-DF9Y1aXX.js";import{e as b,f as L}from"./constants-lq4BIQN3.js";import{d as $}from"./index-ruquw1ns.js";import"./index-BjE9IIVd.js";const J=x.memo(function({data:r}){const a=b[r.siebelType]||"#6b7280";return e.jsxs(e.Fragment,{children:[e.jsx(E,{type:"target",position:T.Top,className:"!w-2 !h-2"}),e.jsx("div",{className:`bg-surface border border-edge rounded-lg shadow-sm hover:shadow-md transition-shadow cursor-pointer min-w-[200px] ${r.isImpacted?r.impactLevel==="direct"?"ring-2 ring-red-500/60":"ring-2 ring-orange-400/50":""} ${r.inactive?"opacity-50":""}`,children:e.jsxs("div",{className:"p-2.5",children:[e.jsxs("div",{className:"flex items-center justify-between mb-1",children:[e.jsx("span",{className:"text-[10px] font-semibold uppercase px-1.5 py-0.5 rounded",style:{background:`${a}20`,color:a},children:r.siebelType.replace(/_/g," ")}),r.inactive&&e.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded-full bg-surface-alt text-muted",children:"inactive"})]}),e.jsx("div",{className:"text-sm font-medium leading-tight line-clamp-2 mb-1",children:r.label}),e.jsxs("div",{className:"flex items-center gap-2 text-[10px] text-muted",children:[r.project&&e.jsx("span",{children:r.project}),e.jsxs("span",{children:[r.propertyCount," props"]}),r.childCount>0&&e.jsxs("span",{children:[r.childCount," children"]})]})]})}),e.jsx(E,{type:"source",position:T.Bottom,className:"!w-2 !h-2"})]})}),Q=x.memo(function({id:r,sourceX:a,sourceY:n,targetX:i,targetY:d,sourcePosition:o,targetPosition:h,style:l,data:t}){const[c,m,g]=V({sourceX:a,sourceY:n,sourcePosition:o,targetX:i,targetY:d,targetPosition:h});return e.jsxs(e.Fragment,{children:[e.jsx(W,{id:r,path:c,style:l}),(t==null?void 0:t.relationType)&&e.jsx(Y,{children:e.jsx("div",{className:"absolute text-[9px] px-1 py-0.5 rounded bg-surface border border-edge text-muted pointer-events-none",style:{transform:`translate(-50%, -50%) translate(${m}px, ${g}px)`},children:t.relationType.replace(/_/g," ")})})]})});function ee({object:s,dependencies:r,onClose:a,onShowImpact:n,impactTarget:i}){const d=b[s.type]||"#6b7280",o=x.useMemo(()=>r.filter(t=>t.from.name===s.name&&t.from.type===s.type),[r,s]),h=x.useMemo(()=>r.filter(t=>t.to.name===s.name&&t.to.type===s.type),[r,s]),l=(i==null?void 0:i.name)===s.name&&(i==null?void 0:i.type)===s.type;return e.jsxs("aside",{className:"w-80 flex-shrink-0 border-l border-edge bg-surface-alt overflow-y-auto",children:[e.jsxs("div",{className:"px-4 py-3 border-b border-edge flex items-start justify-between",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("span",{className:"text-[10px] font-semibold uppercase px-1.5 py-0.5 rounded flex-shrink-0",style:{background:`${d}20`,color:d},children:s.type.replace(/_/g," ")}),s.inactive&&e.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-surface text-muted",children:"inactive"})]}),e.jsx("h3",{className:"text-sm font-semibold truncate",children:s.name}),s.project&&e.jsx("p",{className:"text-xs text-muted",children:s.project})]}),e.jsx("button",{onClick:a,"aria-label":"Close detail panel",className:"p-1 text-muted hover:text-foreground cursor-pointer transition-colors",children:e.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),e.jsx("div",{className:"px-4 py-2 border-b border-edge",children:e.jsx("button",{onClick:()=>{l||n(s.type,s.name)},disabled:l,"aria-label":"Show impact analysis",className:`w-full px-3 py-1.5 text-xs font-medium rounded-md transition-opacity cursor-pointer ${l?"bg-orange-500/20 text-orange-400 cursor-default":"bg-accent text-white hover:opacity-90"}`,children:l?"Impact Analysis Active":"Show Impact"})}),s.properties.length>0&&e.jsxs("div",{className:"px-4 py-3 border-b border-edge",children:[e.jsxs("h4",{className:"text-[10px] font-semibold uppercase text-muted mb-2 tracking-wider",children:["Properties (",s.properties.length,")"]}),e.jsx("div",{className:"space-y-1 max-h-48 overflow-y-auto",children:s.properties.map((t,c)=>e.jsxs("div",{className:"flex gap-2 text-[11px]",children:[e.jsx("span",{className:"font-mono text-muted flex-shrink-0",children:t.name}),e.jsx("span",{className:"text-foreground truncate",children:t.value})]},c))})]}),s.children.length>0&&e.jsxs("div",{className:"px-4 py-3 border-b border-edge",children:[e.jsxs("h4",{className:"text-[10px] font-semibold uppercase text-muted mb-2 tracking-wider",children:["Children (",s.children.length,")"]}),e.jsx("div",{className:"space-y-1 max-h-48 overflow-y-auto",children:s.children.map((t,c)=>{const m=b[t.type]||"#6b7280";return e.jsxs("div",{className:"flex items-center gap-2 text-[11px]",children:[e.jsx("span",{className:"text-[9px] font-semibold uppercase px-1 py-0.5 rounded flex-shrink-0",style:{background:`${m}20`,color:m},children:t.type}),e.jsx("span",{className:"truncate",children:t.name})]},c)})})]}),o.length>0&&e.jsxs("div",{className:"px-4 py-3 border-b border-edge",children:[e.jsxs("h4",{className:"text-[10px] font-semibold uppercase text-muted mb-2 tracking-wider",children:["Depends On (",o.length,")"]}),e.jsx("div",{className:"space-y-1",children:o.map((t,c)=>{const m=b[t.to.type]||"#6b7280";return e.jsxs("div",{className:"flex items-center gap-2 text-[11px]",children:[e.jsx("span",{className:"text-[9px] font-semibold uppercase px-1 py-0.5 rounded flex-shrink-0",style:{background:`${m}20`,color:m},children:t.to.type.replace(/_/g," ")}),e.jsx("span",{className:"truncate",children:t.to.name}),e.jsx("span",{className:"text-[9px] text-muted ml-auto flex-shrink-0",children:t.relationType})]},c)})})]}),h.length>0&&e.jsxs("div",{className:"px-4 py-3",children:[e.jsxs("h4",{className:"text-[10px] font-semibold uppercase text-muted mb-2 tracking-wider",children:["Referenced By (",h.length,")"]}),e.jsx("div",{className:"space-y-1",children:h.map((t,c)=>{const m=b[t.from.type]||"#6b7280";return e.jsxs("div",{className:"flex items-center gap-2 text-[11px]",children:[e.jsx("span",{className:"text-[9px] font-semibold uppercase px-1 py-0.5 rounded flex-shrink-0",style:{background:`${m}20`,color:m},children:t.from.type.replace(/_/g," ")}),e.jsx("span",{className:"truncate",children:t.from.name}),e.jsx("span",{className:"text-[9px] text-muted ml-auto flex-shrink-0",children:t.relationType})]},c)})})]})]})}const w=220,B=72;function v(s,r){return`siebel:${s}:${r}`}function te(s,r,a){return s.filter(n=>{var i;return!((i=r==null?void 0:r.types)!=null&&i.size&&!r.types.has(n.type)||!(r!=null&&r.showInactive)&&n.inactive)}).map(n=>{const i=v(n.type,n.name),d=b[n.type]||"#6b7280",o=a==null?void 0:a.get(i);return{id:i,type:"siebelNode",position:{x:0,y:0},data:{label:n.name,siebelType:n.type,project:n.project,propertyCount:n.properties.length,childCount:n.children.length,inactive:n.inactive,sourceObject:n,isImpacted:!!o,impactLevel:o},style:{width:w,borderLeft:`4px solid ${d}`}}})}function se(s,r){return s.map((a,n)=>{const i=v(a.from.type,a.from.name),d=v(a.to.type,a.to.name);if(!r.has(i)||!r.has(d))return null;const o=L[a.relationType]||L.references;return{id:`siebel-edge-${n}`,source:i,target:d,label:o.label,type:"siebelEdge",data:{relationType:a.relationType,inferred:a.inferred},style:{stroke:o.color,strokeDasharray:o.dashed?"5 5":void 0},labelStyle:{fontSize:10,fill:"#6c757d"}}}).filter(a=>a!==null)}let j=null;function re(s,r,a){let n=0;const i=[a,...s,"|",...r];for(const d of i)for(let o=0;o<d.length;o++)n=(n<<5)-n+d.charCodeAt(o)|0;return n}function ne(s,r,a="TB"){const n=s.map(l=>l.id),i=r.map(l=>`${l.source}-${l.target}`),d=re(n,i,a);let o;if(j&&j.key===d)o=j.positions;else{const l=new $.graphlib.Graph;l.setDefaultEdgeLabel(()=>({})),l.setGraph({rankdir:a,ranksep:80,nodesep:50});for(const t of s)l.setNode(t.id,{width:w,height:B});for(const t of r)l.setEdge(t.source,t.target);$.layout(l),o=new Map;for(const t of s){const c=l.node(t.id);o.set(t.id,{x:c.x-w/2,y:c.y-B/2})}j={key:d,positions:o}}return{nodes:s.map(l=>{const t=o.get(l.id)??{x:0,y:0};return{...l,position:t}}),edges:r}}function oe(s,r,a){const n=v(r,a),i=new Map,d=new Map;for(const t of s){const c=v(t.to.type,t.to.name),m=v(t.from.type,t.from.name);d.has(c)||d.set(c,[]),d.get(c).push(m)}const o=[n],h=new Set([n]);let l=0;for(;o.length>0;){const t=o.length;l++;for(let c=0;c<t;c++){const m=o.shift(),g=d.get(m)||[];for(const N of g)h.has(N)||(h.add(N),i.set(N,l===1?"direct":"transitive"),o.push(N))}}return i}const ae={siebelNode:J},le={siebelEdge:Q},ie={hideAttribution:!0};function ue({objects:s,dependencies:r}){const[a,n,i]=K([]),[d,o,h]=Z([]),[l,t]=x.useState(null),[c,m]=x.useState("TB"),[g,N]=x.useState(new Set),[k,_]=x.useState(!1),[y,C]=x.useState(null),S=x.useDeferredValue(g),D=x.useMemo(()=>{const p=new Set;for(const u of s)p.add(u.type);return[...p].sort()},[s]),I=x.useMemo(()=>{if(y)return oe(r,y.type,y.name)},[r,y]);x.useEffect(()=>{if(s.length===0){n([]),o([]);return}const u=te(s,{types:S,showInactive:k},I),f=new Set(u.map(G=>G.id)),F=se(r,f),{nodes:R,edges:H}=ne(u,F,c);n(R),o(H)},[s,r,S,k,c,I,n,o]);const M=x.useCallback((p,u)=>{t(u.data.sourceObject)},[]),A=x.useCallback(()=>{t(null)},[]),P=x.useCallback(p=>{N(u=>{const f=new Set(u);return f.has(p)?f.delete(p):f.add(p),f})},[]),O=x.useCallback((p,u)=>{C({type:p,name:u})},[]),z=x.useCallback(()=>{C(null)},[]);return s.length===0?e.jsx("div",{className:"h-full flex items-center justify-center",children:e.jsxs("div",{className:"text-center space-y-3",children:[e.jsx("svg",{className:"w-12 h-12 mx-auto text-muted",fill:"none",viewBox:"0 0 24 24",strokeWidth:1,stroke:"currentColor","aria-hidden":"true",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7.5 14.25v2.25m3-4.5v4.5m3-6.75v6.75m3-9v9M6 20.25h12A2.25 2.25 0 0020.25 18V6A2.25 2.25 0 0018 3.75H6A2.25 2.25 0 003.75 6v12A2.25 2.25 0 006 20.25z"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:"SIF Dependency Graph"}),e.jsx("p",{className:"text-xs text-muted mt-1",children:"Upload a .sif file to visualize Siebel object relationships"})]})]})}):e.jsxs("div",{className:"h-full flex flex-col",children:[e.jsxs("div",{className:"flex items-center gap-3 px-3 py-2 border-b border-edge bg-surface-alt",children:[e.jsx("div",{className:"flex flex-wrap gap-1 flex-1",children:D.map(p=>{const u=b[p]||"#6b7280",f=g.size===0||g.has(p);return e.jsx("button",{onClick:()=>P(p),"aria-label":`Filter ${p}`,"aria-pressed":g.has(p),className:"px-2 py-0.5 text-[10px] rounded-md border transition-colors cursor-pointer",style:{borderColor:f?u:"var(--color-border)",backgroundColor:f?`${u}15`:"transparent",color:f?u:"var(--color-text-muted)",opacity:f?1:.5},children:p.replace(/_/g," ")},p)})}),e.jsxs("div",{className:"flex items-center gap-1 border-l border-edge pl-3",children:[e.jsx("button",{onClick:()=>m("TB"),"aria-label":"Top to bottom layout",className:`px-2 py-0.5 text-[10px] rounded cursor-pointer transition-colors ${c==="TB"?"bg-accent/10 text-accent":"text-muted"}`,children:"TB"}),e.jsx("button",{onClick:()=>m("LR"),"aria-label":"Left to right layout",className:`px-2 py-0.5 text-[10px] rounded cursor-pointer transition-colors ${c==="LR"?"bg-accent/10 text-accent":"text-muted"}`,children:"LR"})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-[10px] text-muted cursor-pointer border-l border-edge pl-3",children:[e.jsx("input",{type:"checkbox",checked:k,onChange:p=>_(p.target.checked),className:"rounded"}),"Inactive"]}),y&&e.jsxs("div",{className:"flex items-center gap-1.5 border-l border-edge pl-3",children:[e.jsxs("span",{className:"text-[10px] text-orange-400",children:["Impact: ",y.name]}),e.jsx("button",{onClick:z,"aria-label":"Clear impact analysis",className:"text-[10px] px-1.5 py-0.5 rounded bg-surface text-muted hover:text-foreground cursor-pointer transition-colors",children:"Clear"})]}),e.jsxs("span",{className:"text-[10px] text-muted",children:[a.length," nodes"]})]}),e.jsxs("div",{className:"flex-1 flex min-h-0",children:[e.jsx("div",{className:"flex-1",children:e.jsxs(q,{nodes:a,edges:d,onNodesChange:i,onEdgesChange:h,onNodeClick:M,onPaneClick:A,nodeTypes:ae,edgeTypes:le,proOptions:ie,fitView:!0,fitViewOptions:{padding:.2},minZoom:.1,maxZoom:2,children:[e.jsx(U,{gap:16,size:1}),e.jsx(X,{showInteractive:!1})]})}),l&&e.jsx(ee,{object:l,dependencies:r,onClose:()=>t(null),onShowImpact:O,impactTarget:y})]})]})}export{ue as GraphSection};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as s,j as e,a as re}from"./index-CsH_Hv51.js";import{u as oe,a as de,i as ce,B as ie,C as xe}from"./style-DF9Y1aXX.js";import{b as ue,a as pe,g as W,t as me,s as he,c as fe,d as be,W as ge,e as je,N as Ne}from"./graph-utils-Cq350VUG.js";import{A as ye,S as L,a as ve,N as _,E as Ce}from"./constants-lq4BIQN3.js";import"./index-BjE9IIVd.js";import"./index-ruquw1ns.js";const ke=s.memo(function({statuses:h,types:f,direction:y,onStatusToggle:b,onTypeToggle:m,onDirectionChange:o,onClear:u,visibleNodeCount:c,totalNodeCount:i,onExpandAll:v,onCollapseAll:p}){return e.jsxs("div",{className:"flex flex-wrap items-center gap-3 px-4 py-2 border-b border-edge bg-surface-alt text-xs",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"font-medium text-muted",children:"Status:"}),ye.map(r=>e.jsxs("label",{className:"flex items-center gap-1 cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:h.has(r),onChange:()=>b(r),className:"w-3 h-3"}),e.jsx("span",{className:"w-2 h-2 rounded-full inline-block",style:{background:L[r]}}),e.jsx("span",{children:r.replace("_"," ")})]},r))]}),e.jsx("div",{className:"w-px h-4 bg-edge"}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"font-medium text-muted",children:"Type:"}),ve.map(r=>e.jsxs("label",{className:"flex items-center gap-1 cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:f.has(r),onChange:()=>m(r),className:"w-3 h-3"}),e.jsx("span",{className:"w-2 h-2 rounded-full inline-block",style:{background:_[r]}}),e.jsx("span",{children:r.replace("_"," ")})]},r))]}),e.jsx("div",{className:"w-px h-4 bg-edge"}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"font-medium text-muted",children:"Layout:"}),e.jsxs("select",{value:y,onChange:r=>o(r.target.value),className:"bg-surface border border-edge rounded px-1 py-0.5 text-xs",children:[e.jsx("option",{value:"TB",children:"Top → Down"}),e.jsx("option",{value:"LR",children:"Left → Right"})]})]}),e.jsx("div",{className:"w-px h-4 bg-edge"}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("button",{onClick:v,className:"px-2 py-0.5 rounded border border-edge hover:bg-surface-elevated transition-colors",title:i>100?`Warning: ${i} nodes — may be slow`:"Expand all nodes",children:"Expand All"}),e.jsx("button",{onClick:p,className:"px-2 py-0.5 rounded border border-edge hover:bg-surface-elevated transition-colors",children:"Collapse All"})]}),e.jsx("div",{className:"w-px h-4 bg-edge"}),e.jsxs("span",{className:"text-muted",children:["Showing ",c," of ",i]}),e.jsx("button",{onClick:u,className:"text-muted hover:text-foreground underline",children:"Clear"})]})}),Se=s.memo(function({tree:h,expandedIds:f,selectedNodeId:y,onToggleExpand:b,onSelectNode:m}){const[o,u]=s.useState(!1),c=s.useCallback(()=>u(i=>!i),[]);return o?e.jsx("div",{className:"w-8 border-r border-edge bg-surface-alt flex flex-col items-center pt-2",children:e.jsx("button",{onClick:c,className:"text-xs text-muted hover:text-foreground p-1",title:"Show tree panel",children:"▸"})}):e.jsxs("div",{className:"w-64 border-r border-edge bg-surface-alt flex flex-col min-h-0",children:[e.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-edge",children:[e.jsx("span",{className:"text-xs font-medium text-muted",children:"Hierarchy"}),e.jsx("button",{onClick:c,className:"text-xs text-muted hover:text-foreground",title:"Collapse panel",children:"◂"})]}),e.jsx("div",{className:"overflow-y-auto flex-1 py-1",children:h.length===0?e.jsx("div",{className:"px-3 py-4 text-xs text-muted text-center",children:"No nodes"}):h.map(i=>e.jsx($,{item:i,depth:0,expandedIds:f,selectedNodeId:y,onToggleExpand:b,onSelectNode:m},i.node.id))})]})});function $({item:l,depth:h,expandedIds:f,selectedNodeId:y,onToggleExpand:b,onSelectNode:m}){const{node:o,children:u}=l,c=f.has(o.id),i=y===o.id,v=u.length>0,p=L[o.status]||"#9e9e9e",r=_[o.type]||"#6c757d",j=s.useCallback(n=>{n.stopPropagation(),b(o.id)},[o.id,b]),C=s.useCallback(()=>{m(o.id)},[o.id,m]);return e.jsxs(e.Fragment,{children:[e.jsxs("button",{onClick:C,className:`w-full text-left flex items-center gap-1 px-2 py-1 text-xs hover:bg-surface-elevated transition-colors ${i?"bg-surface-elevated font-semibold":""}`,style:{paddingLeft:`${h*16+8}px`},children:[v?e.jsx("span",{onClick:j,className:"w-4 text-center text-muted hover:text-foreground cursor-pointer shrink-0",children:c?"▾":"▸"}):e.jsx("span",{className:"w-4 shrink-0"}),e.jsx("span",{className:"w-2 h-2 rounded-full shrink-0",style:{background:p},title:o.status.replace("_"," ")}),e.jsx("span",{className:"text-[9px] px-1 rounded shrink-0",style:{background:`${r}20`,color:r},children:o.type.slice(0,3)}),e.jsx("span",{className:"truncate",children:o.title}),v&&e.jsx("span",{className:"text-[9px] text-muted ml-auto shrink-0",children:u.length})]}),c&&u.map(n=>e.jsx($,{item:n,depth:h+1,expandedIds:f,selectedNodeId:y,onToggleExpand:b,onSelectNode:m},n.node.id))]})}const I=50,we=s.memo(function({nodes:h,allNodes:f=[],onNodeClick:y}){const b=s.useMemo(()=>{const t=new Map;for(const g of f)t.set(g.id,g.title);return t},[f]),[m,o]=s.useState("priority"),[u,c]=s.useState("asc"),[i,v]=s.useState(""),[p,r]=s.useState(0),j=s.useMemo(()=>{if(!i)return h;const t=i.toLowerCase();return h.filter(g=>g.title.toLowerCase().includes(t)||g.type.toLowerCase().includes(t)||g.status.toLowerCase().includes(t)||(g.sprint||"").toLowerCase().includes(t))},[h,i]),C=s.useMemo(()=>[...j].sort((t,g)=>{const w=t[m]??"",E=g[m]??"",N=typeof w=="number"?w-E:String(w).localeCompare(String(E));return u==="asc"?N:-N}),[j,m,u]),n=Math.max(1,Math.ceil(C.length/I)),S=s.useMemo(()=>C.slice(p*I,(p+1)*I),[C,p]),k=t=>{m===t?c(g=>g==="asc"?"desc":"asc"):(o(t),c("asc"))},T=[{key:"title",label:"Title"},{key:"type",label:"Type"},{key:"status",label:"Status"},{key:"priority",label:"Priority"},{key:"xpSize",label:"Size"},{key:"sprint",label:"Sprint"},{key:"parentId",label:"Parent"}];return e.jsxs("div",{className:"border-t border-edge",children:[e.jsx("div",{className:"px-4 py-2 bg-surface-alt",children:e.jsx("input",{type:"text",placeholder:"Search nodes...",value:i,onChange:t=>v(t.target.value),className:"w-full max-w-xs px-2 py-1 text-sm border border-edge rounded bg-surface"})}),e.jsx("div",{className:"overflow-x-auto max-h-64",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsx("tr",{className:"bg-surface-elevated",children:T.map(t=>e.jsxs("th",{onClick:()=>k(t.key),className:"px-3 py-1.5 text-left text-xs font-medium text-muted cursor-pointer hover:text-foreground",children:[t.label,m===t.key&&(u==="asc"?" ↑":" ↓")]},t.key))})}),e.jsx("tbody",{children:S.length===0?e.jsx("tr",{children:e.jsx("td",{colSpan:7,className:"px-3 py-4 text-center text-muted",children:"No nodes found"})}):S.map(t=>e.jsxs("tr",{onClick:()=>y(t),className:"border-t border-edge hover:bg-surface-alt cursor-pointer",children:[e.jsx("td",{className:"px-3 py-1.5 max-w-[200px] truncate",children:t.title}),e.jsx("td",{className:"px-3 py-1.5",children:e.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded font-medium",style:{background:`${_[t.type]}20`,color:_[t.type]},children:t.type})}),e.jsx("td",{className:"px-3 py-1.5",children:e.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded-full font-medium",style:{background:`${L[t.status]}20`,color:L[t.status]},children:t.status.replace("_"," ")})}),e.jsx("td",{className:"px-3 py-1.5 text-center",children:t.priority}),e.jsx("td",{className:"px-3 py-1.5 text-center",children:t.xpSize||"-"}),e.jsx("td",{className:"px-3 py-1.5",children:t.sprint||"-"}),e.jsx("td",{className:"px-3 py-1.5 max-w-[150px] truncate text-muted",children:t.parentId?b.get(t.parentId)??"-":"-"})]},t.id))})]})}),n>1&&e.jsxs("div",{className:"flex items-center justify-between px-4 py-1.5 bg-surface-alt border-t border-edge text-xs text-muted",children:[e.jsxs("span",{children:[C.length," nodes"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{disabled:p===0,onClick:()=>r(t=>Math.max(0,t-1)),className:"px-2 py-0.5 rounded border border-edge disabled:opacity-30",children:"Prev"}),e.jsxs("span",{children:[p+1,"/",n]}),e.jsx("button",{disabled:p>=n-1,onClick:()=>r(t=>Math.min(n-1,t+1)),className:"px-2 py-0.5 rounded border border-edge disabled:opacity-30",children:"Next"})]})]})]})}),Te=["depends_on","blocks","parent_of","child_of","related_to","priority_over","implements","derived_from"];function Ee({fromId:l,toId:h,fromTitle:f,toTitle:y,onCreated:b,onCancel:m}){const[o,u]=s.useState("depends_on"),[c,i]=s.useState(""),[v,p]=s.useState(!1),[r,j]=s.useState(null),C=s.useCallback(async()=>{p(!0),j(null);try{await re.createEdge({from:l,to:h,relationType:o,reason:c.trim()||void 0}),b()}catch(n){j(n instanceof Error?n.message:"Failed to create edge")}finally{p(!1)}},[l,h,o,c,b]);return e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",children:e.jsxs("div",{className:"bg-surface border border-edge rounded-lg shadow-xl w-96 p-4",children:[e.jsx("h3",{className:"text-sm font-bold mb-3",children:"Create Relationship"}),e.jsxs("div",{className:"space-y-3 text-sm",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-muted block mb-1",children:"From"}),e.jsx("div",{className:"text-xs bg-surface-elevated px-2 py-1.5 rounded truncate",children:f??l})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-muted block mb-1",children:"To"}),e.jsx("div",{className:"text-xs bg-surface-elevated px-2 py-1.5 rounded truncate",children:y??h})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-muted block mb-1",children:"Relation Type"}),e.jsx("select",{value:o,onChange:n=>u(n.target.value),className:"w-full text-xs px-2 py-1.5 rounded bg-surface-elevated border border-edge focus:outline-none focus:border-accent",children:Te.map(n=>{const S=Ce[n];return e.jsx("option",{value:n,children:S.label},n)})})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-muted block mb-1",children:"Reason (optional)"}),e.jsx("input",{type:"text",value:c,onChange:n=>i(n.target.value),placeholder:"Why this relationship exists...",className:"w-full text-xs px-2 py-1.5 rounded bg-surface-elevated border border-edge focus:outline-none focus:border-accent"})]}),r&&e.jsx("div",{className:"text-xs text-danger bg-surface-elevated px-2 py-1.5 rounded",children:r})]}),e.jsxs("div",{className:"flex justify-end gap-2 mt-4",children:[e.jsx("button",{onClick:m,className:"text-xs px-3 py-1.5 rounded bg-surface-elevated hover:bg-edge transition-colors",children:"Cancel"}),e.jsx("button",{onClick:C,disabled:v,className:"text-xs px-3 py-1.5 rounded bg-accent text-white font-medium disabled:opacity-50 hover:opacity-90 transition-opacity",children:v?"Creating...":"Create"})]})]})})}const Le={workflowNode:je},_e={workflowEdge:ge},Pe={hideAttribution:!0};function De({graph:l}){var R,F;const[h,f,y]=oe([]),[b,m,o]=de([]),[u,c]=s.useState(null),[i,v]=s.useState("TB"),[p,r]=s.useState(new Set),[j,C]=s.useState(new Set),[n,S]=s.useState(new Set),[k,T]=s.useState(null),t=s.useDeferredValue(p),g=s.useDeferredValue(j),w=s.useDeferredValue(i),E=s.useRef(null),N=s.useMemo(()=>ue(l.nodes,l.edges),[l.nodes,l.edges]),G=s.useMemo(()=>pe(l.nodes,N),[l.nodes,N]),P=s.useCallback(a=>{S(x=>{const d=new Set(x);return d.has(a)?d.delete(a):d.add(a),d})},[]),V=s.useCallback(()=>{const a=new Set;for(const[x]of N)a.add(x);S(a)},[N]),B=s.useCallback(()=>{S(new Set)},[]),M=s.useCallback((a,x,d)=>{const te=W(l.nodes,n,N),z=me(te,{statuses:a,types:x},N,n,P),D=z.map(ne=>ne.id);if(he(E.current,D)&&d===w)return;E.current=D;const ae=new Set(D),le=fe(l.edges,ae),O=be(z,le,d);f(O.nodes),m(O.edges)},[l,f,m,w,n,N,P]);s.useEffect(()=>{M(t,g,w)},[l,M,t,g,w]);const H=s.useCallback((a,x)=>{c(x.data.sourceNode)},[]),Y=s.useCallback(a=>{c(a)},[]),Z=s.useCallback(a=>{const x=l.nodes.find(d=>d.id===a);x&&c(x)},[l.nodes]),K=s.useCallback(a=>{const x=l.nodes.find(d=>d.id===a);x&&c(x)},[l.nodes]),U=s.useCallback(a=>{a.source&&a.target&&a.source!==a.target&&T({fromId:a.source,toId:a.target})},[]),q=s.useCallback(()=>{T(null)},[]),J=s.useCallback(a=>{r(x=>{const d=new Set(x);return d.has(a)?d.delete(a):d.add(a),d})},[]),Q=s.useCallback(a=>{C(x=>{const d=new Set(x);return d.has(a)?d.delete(a):d.add(a),d})},[]),X=s.useCallback(()=>{r(new Set),C(new Set)},[]),A=s.useMemo(()=>W(l.nodes,n,N).filter(x=>!(p.size&&!p.has(x.status)||j.size&&!j.has(x.type))),[l.nodes,n,N,p,j]),ee=k?(R=l.nodes.find(a=>a.id===k.fromId))==null?void 0:R.title:void 0,se=k?(F=l.nodes.find(a=>a.id===k.toId))==null?void 0:F.title:void 0;return e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsx(ke,{statuses:p,types:j,direction:i,onStatusToggle:J,onTypeToggle:Q,onDirectionChange:v,onClear:X,visibleNodeCount:A.length,totalNodeCount:l.nodes.length,onExpandAll:V,onCollapseAll:B}),e.jsxs("div",{className:"flex flex-1 min-h-0",children:[e.jsx(Se,{tree:G,expandedIds:n,selectedNodeId:(u==null?void 0:u.id)??null,onToggleExpand:P,onSelectNode:K}),e.jsx("div",{className:"flex-1 relative",children:l.nodes.length===0?e.jsx("div",{className:"flex items-center justify-center h-full text-muted",children:e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-lg mb-2",children:"No nodes in graph"}),e.jsx("p",{className:"text-sm",children:"Import a PRD to get started"})]})}):e.jsxs(ce,{nodes:h,edges:b,onNodesChange:y,onEdgesChange:o,onNodeClick:H,onConnect:U,nodeTypes:Le,edgeTypes:_e,nodesDraggable:!1,nodesConnectable:!0,fitView:!0,minZoom:.1,maxZoom:2,proOptions:Pe,children:[e.jsx(ie,{gap:16,size:1}),e.jsx(xe,{showInteractive:!1})]})}),u&&e.jsx(Ne,{node:u,edges:l.edges,allNodes:l.nodes,childrenMap:N,onClose:()=>c(null),onNodeNavigate:Z})]}),e.jsx(we,{nodes:A,allNodes:l.nodes,onNodeClick:Y}),k&&e.jsx(Ee,{fromId:k.fromId,toId:k.toId,fromTitle:ee,toTitle:se,onCreated:q,onCancel:()=>T(null)})]})}function We({graph:l}){return e.jsx("div",{className:"h-full",children:e.jsx(De,{graph:l})})}export{We as GraphTab};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as b,j as t}from"./index-CsH_Hv51.js";import{H as v,P as k,g as L,c as _,E as P}from"./style-DF9Y1aXX.js";import{N as j,S as N,E as h}from"./constants-lq4BIQN3.js";import{d as C}from"./index-ruquw1ns.js";function H(a,e){const r=new Map,i=(s,o)=>{let u=r.get(s);u||(u=new Set,r.set(s,u)),u.add(o)};for(const s of a)s.parentId&&i(s.parentId,s.id);for(const s of e)s.relationType==="parent_of"?i(s.from,s.to):s.relationType==="child_of"&&i(s.to,s.from);const d=new Map;for(const[s,o]of r)d.set(s,[...o]);return d}function A(a,e,r){const i=new Map,d=new Set;for(const n of a)i.set(n.id,n),d.add(n.id);const s=a.filter(n=>!n.parentId||!d.has(n.parentId)),o=[],u=new Set,l=n=>{if(u.has(n))return;u.add(n);const m=i.get(n);if(m&&o.push(m),e.has(n)){const f=r.get(n)??[];for(const c of f)l(c)}};for(const n of s)l(n.id);return o}function B(a,e){if(a.length===0)return[];const r=new Map,i=new Set;for(const l of a)r.set(l.id,l),i.add(l.id);const d=(l,n)=>{if(n.has(l))return null;n.add(l);const m=r.get(l);if(!m)return null;const f=e.get(l)??[],c=[];for(const p of f){const x=d(p,n);x&&c.push(x)}return{node:m,children:c}},s=a.filter(l=>!l.parentId||!i.has(l.parentId)),o=new Set,u=[];for(const l of s){const n=d(l.id,o);n&&u.push(n)}return u}const F=b.memo(function({data:e}){const r=j[e.nodeType]||"#6c757d",i=N[e.status]||"#9e9e9e",d=b.useCallback(s=>{var o;s.stopPropagation(),(o=e.onExpand)==null||o.call(e,e.sourceNode.id)},[e]);return t.jsxs(t.Fragment,{children:[t.jsx(v,{type:"target",position:k.Top,className:"!w-2 !h-2"}),t.jsxs("div",{className:"bg-surface border border-edge rounded-lg shadow-sm hover:shadow-md transition-shadow cursor-pointer min-w-[200px]",children:[t.jsxs("div",{className:"p-2.5",children:[t.jsxs("div",{className:"flex items-center justify-between mb-1",children:[t.jsx("span",{className:"text-[10px] font-semibold uppercase px-1.5 py-0.5 rounded",style:{background:`${r}20`,color:r},children:e.nodeType}),t.jsx("span",{className:"text-[10px] font-medium px-1.5 py-0.5 rounded-full",style:{background:`${i}20`,color:i},children:e.status.replace("_"," ")})]}),t.jsx("div",{className:"text-sm font-medium leading-tight line-clamp-2 mb-1",children:e.label}),t.jsxs("div",{className:"flex items-center gap-2 text-[10px] text-muted",children:[t.jsxs("span",{children:["P",e.priority]}),e.xpSize&&t.jsx("span",{children:e.xpSize}),e.sprint&&t.jsx("span",{children:e.sprint})]})]}),e.hasChildren&&t.jsxs("button",{onClick:d,className:"w-full flex items-center justify-center gap-1.5 py-1.5 text-xs font-medium border-t border-edge text-muted hover:text-foreground hover:bg-surface-elevated transition-colors rounded-b-lg",title:e.isExpanded?"Collapse children":"Expand children",children:[t.jsx("span",{children:e.isExpanded?"▼":"▶"}),t.jsxs("span",{children:[e.childCount," ",e.childCount===1?"child":"children"]})]})]}),t.jsx(v,{type:"source",position:k.Bottom,className:"!w-2 !h-2"})]})}),G=b.memo(function({id:e,sourceX:r,sourceY:i,targetX:d,targetY:s,sourcePosition:o,targetPosition:u,data:l,style:n={}}){const[m,f,c]=L({sourceX:r,sourceY:i,sourcePosition:o,targetX:d,targetY:s,targetPosition:u}),p=(l==null?void 0:l.relationType)||"related_to",x=h[p]||h.related_to;return t.jsxs(t.Fragment,{children:[t.jsx(_,{id:e,path:m,style:{...n,stroke:x.color,strokeDasharray:x.dashed?"5 5":void 0,strokeWidth:1.5}}),t.jsx(P,{children:t.jsx("div",{className:"text-[9px] text-muted bg-surface px-1 rounded pointer-events-none absolute",style:{transform:`translate(-50%, -50%) translate(${f}px,${c}px)`},children:x.label})})]})});function R(a,e){const r=[],i=[];for(const d of e)d.from===a&&r.push(d),d.to===a&&i.push(d);return{outgoing:r,incoming:i}}const Y=b.memo(function({node:e,edges:r=[],allNodes:i=[],childrenMap:d,onClose:s,onNodeNavigate:o}){if(!e)return null;const u=j[e.type]||"#6c757d",l=N[e.status]||"#9e9e9e",n=b.useMemo(()=>R(e.id,r),[e.id,r]),m=b.useMemo(()=>{const c=new Map;for(const p of i)c.set(p.id,p);return c},[i]),f=n.outgoing.length>0||n.incoming.length>0;return t.jsxs("div",{className:"w-80 border-l border-edge bg-surface-alt overflow-y-auto p-4",children:[t.jsxs("div",{className:"flex items-center justify-between mb-3",children:[t.jsx("h3",{className:"text-sm font-bold",children:"Node Details"}),t.jsx("button",{onClick:s,className:"text-muted hover:text-foreground text-lg leading-none",children:"×"})]}),t.jsx("h4",{className:"text-base font-semibold mb-3",children:e.title}),t.jsxs("div",{className:"space-y-2 text-sm",children:[t.jsx(g,{label:"ID",children:t.jsx("code",{className:"text-xs bg-surface-elevated px-1 rounded break-all",children:e.id})}),t.jsx(g,{label:"Type",children:t.jsx("span",{className:"px-2 py-0.5 rounded text-xs font-medium",style:{background:`${u}20`,color:u},children:e.type})}),t.jsx(g,{label:"Status",children:t.jsx("span",{className:"px-2 py-0.5 rounded-full text-xs font-medium",style:{background:`${l}20`,color:l},children:e.status.replace("_"," ")})}),t.jsxs(g,{label:"Priority",children:["P",e.priority]}),e.xpSize&&t.jsx(g,{label:"Size",children:e.xpSize}),e.estimateMinutes!=null&&t.jsxs(g,{label:"Estimate",children:[e.estimateMinutes,"min"]}),e.sprint&&t.jsx(g,{label:"Sprint",children:e.sprint}),e.description&&t.jsxs("div",{className:"pt-2 border-t border-edge",children:[t.jsx("div",{className:"text-xs font-medium text-muted mb-1",children:"Description"}),t.jsx("p",{className:"text-xs whitespace-pre-wrap",children:e.description})]}),d&&(()=>{const c=d.get(e.id)??[];return c.length===0?null:t.jsxs("div",{className:"pt-2 border-t border-edge",children:[t.jsxs("div",{className:"text-xs font-medium text-muted mb-1",children:["Children (",c.length,")"]}),t.jsx("div",{className:"space-y-1",children:c.map(p=>{const x=m.get(p);if(!x)return null;const D=N[x.status]||"#9e9e9e",S=j[x.type]||"#6c757d";return t.jsxs("button",{onClick:()=>o==null?void 0:o(p),className:"w-full text-left flex items-center gap-1.5 px-1.5 py-1 rounded hover:bg-surface-elevated transition-colors text-xs",children:[t.jsx("span",{className:"w-2 h-2 rounded-full shrink-0",style:{background:D}}),t.jsx("span",{className:"text-[9px] px-1 rounded shrink-0",style:{background:`${S}20`,color:S},children:x.type}),t.jsx("span",{className:"truncate font-medium",children:x.title})]},p)})})]})})(),f&&t.jsxs("div",{className:"pt-2 border-t border-edge",children:[t.jsxs("div",{className:"text-xs font-medium text-muted mb-1",children:["Relationships (",n.outgoing.length+n.incoming.length,")"]}),t.jsxs("div",{className:"space-y-1",children:[n.outgoing.map(c=>{const p=m.get(c.to),x=h[c.relationType]||h.related_to;return t.jsx(E,{direction:"out",label:x.label,color:x.color,targetTitle:(p==null?void 0:p.title)??c.to,targetId:c.to,onNavigate:o},c.id)}),n.incoming.map(c=>{const p=m.get(c.from),x=h[c.relationType]||h.related_to;return t.jsx(E,{direction:"in",label:x.label,color:x.color,targetTitle:(p==null?void 0:p.title)??c.from,targetId:c.from,onNavigate:o},c.id)})]})]}),e.acceptanceCriteria&&e.acceptanceCriteria.length>0&&t.jsxs("div",{className:"pt-2 border-t border-edge",children:[t.jsxs("div",{className:"text-xs font-medium text-muted mb-1",children:["Acceptance Criteria (",e.acceptanceCriteria.length,")"]}),t.jsx("ul",{className:"text-xs space-y-1 list-disc pl-4",children:e.acceptanceCriteria.map((c,p)=>t.jsx("li",{children:c},p))})]}),e.tags&&e.tags.length>0&&t.jsxs("div",{className:"pt-2 border-t border-edge",children:[t.jsx("div",{className:"text-xs font-medium text-muted mb-1",children:"Tags"}),t.jsx("div",{className:"flex flex-wrap gap-1",children:e.tags.map(c=>t.jsx("span",{className:"text-[10px] bg-surface-elevated px-1.5 py-0.5 rounded",children:c},c))})]}),e.sourceRef&&t.jsxs("div",{className:"pt-2 border-t border-edge",children:[t.jsx("div",{className:"text-xs font-medium text-muted mb-1",children:"Source"}),t.jsxs("div",{className:"text-xs",children:[e.sourceRef.file,e.sourceRef.startLine!=null&&` (L${e.sourceRef.startLine}–${e.sourceRef.endLine??"?"})`]})]}),t.jsxs("div",{className:"pt-2 border-t border-edge text-[10px] text-muted",children:[t.jsxs("div",{children:["Created: ",new Date(e.createdAt).toLocaleString()]}),t.jsxs("div",{children:["Updated: ",new Date(e.updatedAt).toLocaleString()]})]})]})]})});function g({label:a,children:e}){return t.jsxs("div",{className:"flex items-start justify-between gap-2",children:[t.jsx("span",{className:"text-xs text-muted shrink-0",children:a}),t.jsx("div",{className:"text-right",children:e})]})}function E({direction:a,label:e,color:r,targetTitle:i,targetId:d,onNavigate:s}){const o=a==="out"?"→":"←";return t.jsxs("button",{onClick:()=>s==null?void 0:s(d),className:"w-full text-left flex items-center gap-1.5 px-1.5 py-1 rounded hover:bg-surface-elevated transition-colors text-xs",children:[t.jsx("span",{style:{color:r},children:o}),t.jsx("span",{className:"text-[10px] text-muted",children:e}),t.jsx("span",{className:"truncate font-medium",children:i})]})}const w=240,T=80;function K(a,e,r,i,d){return a.filter(s=>{var o,u;return!((o=e==null?void 0:e.statuses)!=null&&o.size&&!e.statuses.has(s.status)||(u=e==null?void 0:e.types)!=null&&u.size&&!e.types.has(s.type))}).map(s=>{const o=r==null?void 0:r.get(s.id),u=o!=null&&o.length>0;return{id:s.id,type:"workflowNode",position:{x:0,y:0},data:{label:s.title,nodeType:s.type,status:s.status,priority:s.priority,xpSize:s.xpSize,sprint:s.sprint,sourceNode:s,hasChildren:u,isExpanded:(i==null?void 0:i.has(s.id))??!1,childCount:(o==null?void 0:o.length)??0,onExpand:d},style:{width:w,borderLeft:`4px solid ${j[s.type]||"#6c757d"}`}}})}function U(a,e){return a.filter(r=>e.has(r.from)&&e.has(r.to)).map(r=>{const i=h[r.relationType]||h.related_to;return{id:r.id,source:r.from,target:r.to,label:i.label,type:"workflowEdge",data:{relationType:r.relationType},style:{stroke:i.color,strokeDasharray:i.dashed?"5 5":void 0},labelStyle:{fontSize:10,fill:"#6c757d"}}})}function $(a,e,r){let i=0;const d=[r,...a,"|",...e];for(const s of d)for(let o=0;o<s.length;o++)i=(i<<5)-i+s.charCodeAt(o)|0;return i}function V(a,e){if(a===null||a.length!==e.length)return!1;for(let r=0;r<a.length;r++)if(a[r]!==e[r])return!1;return!0}let y=null;function X(a,e,r="TB"){const i=a.map(l=>l.id),d=e.map(l=>`${l.source}-${l.target}`),s=$(i,d,r);let o;if(y&&y.key===s)o=y.positions;else{const l=new C.graphlib.Graph;l.setDefaultEdgeLabel(()=>({})),l.setGraph({rankdir:r,ranksep:60,nodesep:40});for(const n of a)l.setNode(n.id,{width:w,height:T});for(const n of e)l.setEdge(n.source,n.target);C.layout(l),o=new Map;for(const n of a){const m=l.node(n.id);o.set(n.id,{x:m.x-w/2,y:m.y-T/2})}y={key:s,positions:o}}return{nodes:a.map(l=>{const n=o.get(l.id)??{x:0,y:0};return{...l,position:n}}),edges:e}}export{Y as N,G as W,B as a,H as b,U as c,X as d,F as e,A as g,V as s,K as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as ce,g as de,c as ge}from"./index-
|
|
1
|
+
import{b as ce,g as de,c as ge}from"./index-CsH_Hv51.js";function U(e,r,t){e.prototype=r.prototype=t,t.constructor=e}function se(e,r){var t=Object.create(e.prototype);for(var n in r)t[n]=r[n];return t}function M(){}var E=.7,D=1/E,S="\\s*([+-]?\\d+)\\s*",R="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",m="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",be=/^#([0-9a-f]{3,8})$/,pe=new RegExp(`^rgb\\(${S},${S},${S}\\)$`),me=new RegExp(`^rgb\\(${m},${m},${m}\\)$`),ye=new RegExp(`^rgba\\(${S},${S},${S},${R}\\)$`),we=new RegExp(`^rgba\\(${m},${m},${m},${R}\\)$`),ve=new RegExp(`^hsl\\(${R},${m},${m}\\)$`),$e=new RegExp(`^hsla\\(${R},${m},${m},${R}\\)$`),Q={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};U(M,k,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:X,formatHex:X,formatHex8:Ne,formatHsl:Se,formatRgb:Y,toString:Y});function X(){return this.rgb().formatHex()}function Ne(){return this.rgb().formatHex8()}function Se(){return le(this).formatHsl()}function Y(){return this.rgb().formatRgb()}function k(e){var r,t;return e=(e+"").trim().toLowerCase(),(r=be.exec(e))?(t=r[1].length,r=parseInt(r[1],16),t===6?Z(r):t===3?new h(r>>8&15|r>>4&240,r>>4&15|r&240,(r&15)<<4|r&15,1):t===8?j(r>>24&255,r>>16&255,r>>8&255,(r&255)/255):t===4?j(r>>12&15|r>>8&240,r>>8&15|r>>4&240,r>>4&15|r&240,((r&15)<<4|r&15)/255):null):(r=pe.exec(e))?new h(r[1],r[2],r[3],1):(r=me.exec(e))?new h(r[1]*255/100,r[2]*255/100,r[3]*255/100,1):(r=ye.exec(e))?j(r[1],r[2],r[3],r[4]):(r=we.exec(e))?j(r[1]*255/100,r[2]*255/100,r[3]*255/100,r[4]):(r=ve.exec(e))?te(r[1],r[2]/100,r[3]/100,1):(r=$e.exec(e))?te(r[1],r[2]/100,r[3]/100,r[4]):Q.hasOwnProperty(e)?Z(Q[e]):e==="transparent"?new h(NaN,NaN,NaN,0):null}function Z(e){return new h(e>>16&255,e>>8&255,e&255,1)}function j(e,r,t,n){return n<=0&&(e=r=t=NaN),new h(e,r,t,n)}function Ee(e){return e instanceof M||(e=k(e)),e?(e=e.rgb(),new h(e.r,e.g,e.b,e.opacity)):new h}function W(e,r,t,n){return arguments.length===1?Ee(e):new h(e,r,t,n??1)}function h(e,r,t,n){this.r=+e,this.g=+r,this.b=+t,this.opacity=+n}U(h,W,se(M,{brighter(e){return e=e==null?D:Math.pow(D,e),new h(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?E:Math.pow(E,e),new h(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new h($(this.r),$(this.g),$(this.b),I(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:ee,formatHex:ee,formatHex8:Re,formatRgb:re,toString:re}));function ee(){return`#${v(this.r)}${v(this.g)}${v(this.b)}`}function Re(){return`#${v(this.r)}${v(this.g)}${v(this.b)}${v((isNaN(this.opacity)?1:this.opacity)*255)}`}function re(){const e=I(this.opacity);return`${e===1?"rgb(":"rgba("}${$(this.r)}, ${$(this.g)}, ${$(this.b)}${e===1?")":`, ${e})`}`}function I(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function $(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function v(e){return e=$(e),(e<16?"0":"")+e.toString(16)}function te(e,r,t,n){return n<=0?e=r=t=NaN:t<=0||t>=1?e=r=NaN:r<=0&&(e=NaN),new b(e,r,t,n)}function le(e){if(e instanceof b)return new b(e.h,e.s,e.l,e.opacity);if(e instanceof M||(e=k(e)),!e)return new b;if(e instanceof b)return e;e=e.rgb();var r=e.r/255,t=e.g/255,n=e.b/255,i=Math.min(r,t,n),a=Math.max(r,t,n),f=NaN,u=a-i,c=(a+i)/2;return u?(r===a?f=(t-n)/u+(t<n)*6:t===a?f=(n-r)/u+2:f=(r-t)/u+4,u/=c<.5?a+i:2-a-i,f*=60):u=c>0&&c<1?0:f,new b(f,u,c,e.opacity)}function ke(e,r,t,n){return arguments.length===1?le(e):new b(e,r,t,n??1)}function b(e,r,t,n){this.h=+e,this.s=+r,this.l=+t,this.opacity=+n}U(b,ke,se(M,{brighter(e){return e=e==null?D:Math.pow(D,e),new b(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?E:Math.pow(E,e),new b(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,r=isNaN(e)||isNaN(this.s)?0:this.s,t=this.l,n=t+(t<.5?t:1-t)*r,i=2*t-n;return new h(A(e>=240?e-240:e+120,i,n),A(e,i,n),A(e<120?e+240:e-120,i,n),this.opacity)},clamp(){return new b(ne(this.h),_(this.s),_(this.l),I(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=I(this.opacity);return`${e===1?"hsl(":"hsla("}${ne(this.h)}, ${_(this.s)*100}%, ${_(this.l)*100}%${e===1?")":`, ${e})`}`}}));function ne(e){return e=(e||0)%360,e<0?e+360:e}function _(e){return Math.max(0,Math.min(1,e||0))}function A(e,r,t){return(e<60?r+(t-r)*e/60:e<180?t:e<240?r+(t-r)*(240-e)/60:r)*255}const B=e=>()=>e;function Me(e,r){return function(t){return e+t*r}}function He(e,r,t){return e=Math.pow(e,t),r=Math.pow(r,t)-e,t=1/t,function(n){return Math.pow(e+n*r,t)}}function qe(e){return(e=+e)==1?xe:function(r,t){return t-r?He(r,t,e):B(isNaN(r)?t:r)}}function xe(e,r){var t=r-e;return t?Me(e,t):B(isNaN(e)?r:e)}const ie=(function e(r){var t=qe(r);function n(i,a){var f=t((i=W(i)).r,(a=W(a)).r),u=t(i.g,a.g),c=t(i.b,a.b),d=xe(i.opacity,a.opacity);return function(s){return i.r=f(s),i.g=u(s),i.b=c(s),i.opacity=d(s),i+""}}return n.gamma=e,n})(1);function je(e,r){r||(r=[]);var t=e?Math.min(r.length,e.length):0,n=r.slice(),i;return function(a){for(i=0;i<t;++i)n[i]=e[i]*(1-a)+r[i]*a;return n}}function _e(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function De(e,r){var t=r?r.length:0,n=e?Math.min(t,e.length):0,i=new Array(n),a=new Array(t),f;for(f=0;f<n;++f)i[f]=he(e[f],r[f]);for(;f<t;++f)a[f]=r[f];return function(u){for(f=0;f<n;++f)a[f]=i[f](u);return a}}function Ie(e,r){var t=new Date;return e=+e,r=+r,function(n){return t.setTime(e*(1-n)+r*n),t}}function G(e,r){return e=+e,r=+r,function(t){return e*(1-t)+r*t}}function Ae(e,r){var t={},n={},i;(e===null||typeof e!="object")&&(e={}),(r===null||typeof r!="object")&&(r={});for(i in r)i in e?t[i]=he(e[i],r[i]):n[i]=r[i];return function(a){for(i in t)n[i]=t[i](a);return n}}var L=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,V=new RegExp(L.source,"g");function Ve(e){return function(){return e}}function Oe(e){return function(r){return e(r)+""}}function Ce(e,r){var t=L.lastIndex=V.lastIndex=0,n,i,a,f=-1,u=[],c=[];for(e=e+"",r=r+"";(n=L.exec(e))&&(i=V.exec(r));)(a=i.index)>t&&(a=r.slice(t,a),u[f]?u[f]+=a:u[++f]=a),(n=n[0])===(i=i[0])?u[f]?u[f]+=i:u[++f]=i:(u[++f]=null,c.push({i:f,x:G(n,i)})),t=V.lastIndex;return t<r.length&&(a=r.slice(t),u[f]?u[f]+=a:u[++f]=a),u.length<2?c[0]?Oe(c[0].x):Ve(r):(r=c.length,function(d){for(var s=0,o;s<r;++s)u[(o=c[s]).i]=o.x(d);return u.join("")})}function he(e,r){var t=typeof r,n;return r==null||t==="boolean"?B(r):(t==="number"?G:t==="string"?(n=k(r))?(r=n,ie):Ce:r instanceof k?ie:r instanceof Date?Ie:_e(r)?je:Array.isArray(r)?De:typeof r.valueOf!="function"&&typeof r.toString!="function"||isNaN(r)?Ae:G)(e,r)}var O={exports:{}},C={},P={exports:{}},z={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* use-sync-external-store-shim.production.js
|
|
4
4
|
*
|
|
@@ -14,4 +14,4 @@ import{b as ce,g as de,c as ge}from"./index-DtkPX5ZZ.js";function U(e,r,t){e.pro
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var ue;function We(){if(ue)return C;ue=1;var e=ce(),r=ze();function t(d,s){return d===s&&(d!==0||1/d===1/s)||d!==d&&s!==s}var n=typeof Object.is=="function"?Object.is:t,i=r.useSyncExternalStore,a=e.useRef,f=e.useEffect,u=e.useMemo,c=e.useDebugValue;return C.useSyncExternalStoreWithSelector=function(d,s,o,l,g){var p=a(null);if(p.current===null){var x={hasValue:!1,value:null};p.current=x}else x=p.current;p=u(function(){function F(y){if(!T){if(T=!0,H=y,y=l(y),g!==void 0&&x.hasValue){var N=x.value;if(g(N,y))return q=N}return q=y}if(N=q,n(H,y))return N;var K=l(y);return g!==void 0&&g(N,K)?(H=y,N):(H=y,q=K)}var T=!1,H,q,J=o===void 0?null:o;return[function(){return F(s())},J===null?void 0:function(){return F(J())}]},[s,o,l,g]);var w=i(d,p[0],p[1]);return f(function(){x.hasValue=!0,x.value=w},[w]),c(w),w},C}var oe;function Ge(){return oe||(oe=1,O.exports=We()),O.exports}var Le=Ge();const Be=de(Le);var Fe=ge();export{
|
|
17
|
+
*/var ue;function We(){if(ue)return C;ue=1;var e=ce(),r=ze();function t(d,s){return d===s&&(d!==0||1/d===1/s)||d!==d&&s!==s}var n=typeof Object.is=="function"?Object.is:t,i=r.useSyncExternalStore,a=e.useRef,f=e.useEffect,u=e.useMemo,c=e.useDebugValue;return C.useSyncExternalStoreWithSelector=function(d,s,o,l,g){var p=a(null);if(p.current===null){var x={hasValue:!1,value:null};p.current=x}else x=p.current;p=u(function(){function F(y){if(!T){if(T=!0,H=y,y=l(y),g!==void 0&&x.hasValue){var N=x.value;if(g(N,y))return q=N}return q=y}if(N=q,n(H,y))return N;var K=l(y);return g!==void 0&&g(N,K)?(H=y,N):(H=y,q=K)}var T=!1,H,q,J=o===void 0?null:o;return[function(){return F(s())},J===null?void 0:function(){return F(J())}]},[s,o,l,g]);var w=i(d,p[0],p[1]);return f(function(){x.hasValue=!0,x.value=w},[w]),c(w),w},C}var oe;function Ge(){return oe||(oe=1,O.exports=We()),O.exports}var Le=Ge();const Be=de(Le);var Fe=ge();export{G as a,ie as b,k as c,Ce as d,he as i,Fe as r,Be as u,Le as w};
|