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