Spaces:
Running
Running
| import{r as e}from"./chunk-CilyBKbf.js";import{i as t,s as n}from"./searchRegex-Cg1bSWsl.js";import{f as r,i,l as a,o,p as s,x as c}from"./index-BW3HzWsZ.js";import{n as l,r as u,t as d}from"./useSidebar-p7AnOBpj.js";import{n as f,r as p,t as m}from"./NodeIcon-KhlmW9ZJ.js";var h=e(n(),1),g=t(),_=h.memo(({node:e,depth:t,parentMap:n})=>{let{data:a,dagData:o,expanded:l,activeId:d,setActiveId:h,toggleNode:v,requestForceCenter:y,isFullyExpanded:b,searchQuery:x}=i(),{t:S}=c(),C=l.has(e.id),w=d===e.id,T=!!e.children&&e.children.length>0,E=t=>{if(t.stopPropagation(),T){let t=!C;v(e.id),h(e.id),(t||b)&&y()}else h(e.id)},D=S(`nodes.${e.id}.name`,{defaultValue:e.name||``});return(0,g.jsxs)(`div`,{children:[(0,g.jsxs)(`div`,{className:`flex items-center py-1.5 px-2 cursor-pointer transition-colors ${w?`bg-blue-100 dark:bg-blue-900/30`:`hover:bg-black/5 dark:hover:bg-white/5`}`,style:{paddingLeft:`${t*20+8}px`},onClick:E,children:[(0,g.jsx)(`div`,{className:`flex-shrink-0 w-6 flex justify-center items-center mr-1 text-gray-400 dark:text-gray-500`,children:T&&(0,g.jsx)(`div`,{className:`transition-transform duration-200 ${C?`rotate-90`:``}`,children:(0,g.jsx)(f,{})})}),(0,g.jsx)(m,{node:e,data:a,dagData:o}),(0,g.jsxs)(`div`,{className:`text-sm select-none whitespace-nowrap overflow-hidden text-ellipsis ${w?`font-semibold text-blue-700 dark:text-blue-300`:`text-gray-800 dark:text-gray-200`}`,children:[(0,g.jsx)(u,{text:D,query:x}),e.attachments&&e.attachments.length>0&&(0,g.jsx)(p,{size:12,className:`ml-1 inline-block opacity-70 text-gray-600 dark:text-gray-300 flex-shrink-0`})]}),o&&s(o,e.id,n)&&(0,g.jsxs)(`button`,{onClick:e=>{e.stopPropagation()},title:`Also in: ${r(o,e.id,n).map(e=>o.nodes[e]?.name??e).join(`, `)}`,className:`ml-1.5 text-[10px] px-1.5 py-0.5 rounded-full bg-amber-100 dark:bg-amber-900/40\r | |
| text-amber-700 dark:text-amber-300 flex-shrink-0 cursor-pointer hover:bg-amber-200\r | |
| dark:hover:bg-amber-800/60 transition-colors`,"aria-label":`${r(o,e.id,n).length} parent groups — click to see`,children:[`×`,r(o,e.id,n).length]})]}),T&&C&&(0,g.jsx)(`div`,{className:`flex flex-col`,children:e.children.map(e=>(0,g.jsx)(_,{node:e,depth:t+1,parentMap:n},e.id))})]})});function v({ref:e}){let{data:t,dagData:n,activeId:r}=i(),{open:s,setOpen:c,width:u,setWidth:f}=d(r),p=(0,h.useMemo)(()=>n?a(n):new Map,[n]),m=t?o(t,r):null;return(0,g.jsxs)(`div`,{ref:e,className:`flex h-[95vh] w-full overflow-hidden bg-white dark:bg-[#1e1e1e]`,onClick:()=>{c(!1)},children:[(0,g.jsx)(`div`,{className:`flex-1 overflow-auto pt-4 pb-32`,style:{paddingLeft:`260px`},children:(0,g.jsx)(`div`,{className:`max-w-5xl px-6`,children:t&&(0,g.jsx)(_,{node:t,depth:0,parentMap:p})})}),s&&(0,g.jsx)(`div`,{style:{width:u,flexShrink:0}}),(0,g.jsx)(l,{open:s,onClose:()=>{c(!1)},node:m,initialWidth:u,onWidthChange:e=>f(e)})]})}export{v as default}; |