| 139 | onHoverChange: (hovered: boolean) => void |
| 140 | listenToUpdate(cb: VoidFunction): VoidFunction |
| 141 | }> = props => { |
| 142 | const {name, type} = props.node |
| 143 | const hoverProps = createHover(props.onHoverChange) |
| 144 | |
| 145 | const {pingUpdated, OwnerName} = ui.createHighlightedOwnerName() |
| 146 | props.listenToUpdate(pingUpdated) |
| 147 | |
| 148 | const margin = theme.spacing[2] |
| 149 | |
| 150 | return ( |
| 151 | <div |
| 152 | class={clsx( |
| 153 | 'group relative flex items-center', |
| 154 | // inspected nodes are ont clickable |
| 155 | props.isInspected ? 'cursor-default' : 'cursor-pointer', |
| 156 | )} |
| 157 | style={{ |
| 158 | height: `calc(${grid_size} - ${margin} * 2)`, |
| 159 | 'min-width': `calc(${grid_size} * 2)`, |
| 160 | transform: `translateX(calc(${props.depth} * ${grid_size}))`, |
| 161 | margin: margin, |
| 162 | padding: `0 0.4rem`, |
| 163 | }} |
| 164 | onClick={props.onInspect} |
| 165 | {...hoverProps} |
| 166 | > |
| 167 | <div |
| 168 | class={clsx( |
| 169 | 'absolute inset-0 opacity-80 b-2px b-solid rounded-md transition', |
| 170 | props.isHovered ? 'bg-panel-2' : 'bg-transparent group-hover:bg-panel-2', |
| 171 | props.isInspected ? 'b-panel-6' : 'b-transparent group-active:b-panel-4', |
| 172 | )} |
| 173 | style={{'box-shadow': `0 0 ${margin} ${theme.spacing[1]} ${theme.vars.panel[1]}`}} |
| 174 | /> |
| 175 | <OwnerName name={name} type={type} /> |
| 176 | </div> |
| 177 | ) |
| 178 | } |
| 179 | |
| 180 | function Line(props: { |
| 181 | length: number |
nothing calls this directly
no test coverage detected
searching dependent graphs…