@@ -24,7 +24,7 @@ import {
2424 DraggableTreeNodeItemRenderProps ,
2525} from "components/DraggableTree/types" ;
2626import RefTreeComp from "comps/comps/refTreeComp" ;
27- import { ActiveTextColor , NormalMenuIconColor } from "constants/style" ;
27+ import { ActiveTextColor , BorderActiveColor , NormalMenuIconColor } from "constants/style" ;
2828
2929const Contain = styled . div `
3030 flex-grow: 1;
@@ -269,6 +269,7 @@ export function BottomSidebar(props: BottomSidebarProps) {
269269 disable = { ! ! search }
270270 unfoldAll = { ! ! search }
271271 showSubInDragOverlay = { false }
272+ showDropInPositionLine = { false }
272273 showPositionLineDot
273274 positionLineDotDiameter = { 4 }
274275 positionLineHeight = { 1 }
@@ -316,20 +317,28 @@ export function BottomSidebar(props: BottomSidebarProps) {
316317 ) ;
317318}
318319
319- const ColumnDiv = styled . div < {
320+ const HighlightBorder = styled . div < { active : boolean ; foldable : boolean ; level : number } > `
321+ flex: 1;
322+ display: flex;
323+ padding-left: ${ ( props ) => props . level * 20 + ( props . foldable ? 0 : 14 ) } px;
324+ border-radius: 4px;
325+ border: 1px solid ${ ( props ) => ( props . active ? BorderActiveColor : "transparent" ) } ;
326+ align-items: center;
327+ justify-content: center;
328+ ` ;
329+
330+ interface ColumnDivProps {
320331 $color ?: boolean ;
321- level : number ;
322- foldable : boolean ;
323332 isOverlay : boolean ;
324- } > `
333+ }
334+
335+ const ColumnDiv = styled . div < ColumnDivProps > `
325336 width: 100%;
326337 height: 25px;
327338 display: flex;
328339 user-select: none;
329- align-items: center;
330- justify-content: center;
331- padding: 0 15px 0 2px;
332- padding-left: ${ ( props ) => 2 + props . level * 20 + ( props . foldable ? 0 : 14 ) } px;
340+ padding-left: 2px;
341+ padding-right: 15px;
333342 /* background-color: #ffffff; */
334343 /* margin: 2px 0; */
335344 background-color: ${ ( props ) => ( props . isOverlay ? "rgba(255, 255, 255, 0.11)" : "" ) } ;
@@ -403,8 +412,18 @@ interface BottomSidebarItemProps extends DraggableTreeNodeItemRenderProps {
403412}
404413
405414function BottomSidebarItem ( props : BottomSidebarItemProps ) {
406- const { id, resComp, isOverlay, path, isFolded, onDelete, onCopy, onSelect, onToggleFold } =
407- props ;
415+ const {
416+ id,
417+ resComp,
418+ isOver,
419+ isOverlay,
420+ path,
421+ isFolded,
422+ onDelete,
423+ onCopy,
424+ onSelect,
425+ onToggleFold,
426+ } = props ;
408427 const [ error , setError ] = useState < string | undefined > ( undefined ) ;
409428 const [ editing , setEditing ] = useState ( false ) ;
410429 const editorState = useContext ( EditorContext ) ;
@@ -451,36 +470,32 @@ function BottomSidebarItem(props: BottomSidebarItemProps) {
451470 } ;
452471
453472 return (
454- < ColumnDiv
455- level = { level }
456- foldable = { isFolder }
457- onClick = { handleClickItem }
458- $color = { isSelected }
459- isOverlay = { isOverlay }
460- >
461- { isFolder && < FoldIconBtn > { ! isFolded ? < FoldedIcon /> : < UnfoldIcon /> } </ FoldIconBtn > }
462- { icon }
463- < div style = { { flexGrow : 1 , marginRight : "8px" , width : "calc(100% - 62px)" } } >
464- < EditText
465- text = { name }
466- forceClickIcon = { isFolder }
467- disabled = { ! isSelected || readOnly || isOverlay }
468- onFinish = { handleFinishRename }
469- onChange = { handleNameChange }
470- onEditStateChange = { ( editing ) => setEditing ( editing ) }
471- />
472- < PopupCard
473- editorFocus = { ! ! error && editing }
474- title = { error ? trans ( "error" ) : "" }
475- content = { error }
476- hasError = { ! ! error }
477- />
478- </ div >
479- { ! readOnly && ! isOverlay && (
480- < EditPopover copy = { ! isFolder ? onCopy : undefined } del = { onDelete } >
481- < Icon tabIndex = { - 1 } />
482- </ EditPopover >
483- ) }
473+ < ColumnDiv onClick = { handleClickItem } $color = { isSelected } isOverlay = { isOverlay } >
474+ < HighlightBorder active = { isOver && isFolder } level = { level } foldable = { isFolder } >
475+ { isFolder && < FoldIconBtn > { ! isFolded ? < FoldedIcon /> : < UnfoldIcon /> } </ FoldIconBtn > }
476+ { icon }
477+ < div style = { { flexGrow : 1 , marginRight : "8px" , width : "calc(100% - 62px)" } } >
478+ < EditText
479+ text = { name }
480+ forceClickIcon = { isFolder }
481+ disabled = { ! isSelected || readOnly || isOverlay }
482+ onFinish = { handleFinishRename }
483+ onChange = { handleNameChange }
484+ onEditStateChange = { ( editing ) => setEditing ( editing ) }
485+ />
486+ < PopupCard
487+ editorFocus = { ! ! error && editing }
488+ title = { error ? trans ( "error" ) : "" }
489+ content = { error }
490+ hasError = { ! ! error }
491+ />
492+ </ div >
493+ { ! readOnly && ! isOverlay && (
494+ < EditPopover copy = { ! isFolder ? onCopy : undefined } del = { onDelete } >
495+ < Icon tabIndex = { - 1 } />
496+ </ EditPopover >
497+ ) }
498+ </ HighlightBorder >
484499 </ ColumnDiv >
485500 ) ;
486501}
0 commit comments