@@ -24,7 +24,7 @@ import {
24
24
DraggableTreeNodeItemRenderProps ,
25
25
} from "components/DraggableTree/types" ;
26
26
import RefTreeComp from "comps/comps/refTreeComp" ;
27
- import { ActiveTextColor , NormalMenuIconColor } from "constants/style" ;
27
+ import { ActiveTextColor , BorderActiveColor , NormalMenuIconColor } from "constants/style" ;
28
28
29
29
const Contain = styled . div `
30
30
flex-grow: 1;
@@ -269,6 +269,7 @@ export function BottomSidebar(props: BottomSidebarProps) {
269
269
disable = { ! ! search }
270
270
unfoldAll = { ! ! search }
271
271
showSubInDragOverlay = { false }
272
+ showDropInPositionLine = { false }
272
273
showPositionLineDot
273
274
positionLineDotDiameter = { 4 }
274
275
positionLineHeight = { 1 }
@@ -316,20 +317,28 @@ export function BottomSidebar(props: BottomSidebarProps) {
316
317
) ;
317
318
}
318
319
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 {
320
331
$color ?: boolean ;
321
- level : number ;
322
- foldable : boolean ;
323
332
isOverlay : boolean ;
324
- } > `
333
+ }
334
+
335
+ const ColumnDiv = styled . div < ColumnDivProps > `
325
336
width: 100%;
326
337
height: 25px;
327
338
display: flex;
328
339
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;
333
342
/* background-color: #ffffff; */
334
343
/* margin: 2px 0; */
335
344
background-color: ${ ( props ) => ( props . isOverlay ? "rgba(255, 255, 255, 0.11)" : "" ) } ;
@@ -403,8 +412,18 @@ interface BottomSidebarItemProps extends DraggableTreeNodeItemRenderProps {
403
412
}
404
413
405
414
function 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 ;
408
427
const [ error , setError ] = useState < string | undefined > ( undefined ) ;
409
428
const [ editing , setEditing ] = useState ( false ) ;
410
429
const editorState = useContext ( EditorContext ) ;
@@ -451,36 +470,32 @@ function BottomSidebarItem(props: BottomSidebarItemProps) {
451
470
} ;
452
471
453
472
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 >
484
499
</ ColumnDiv >
485
500
) ;
486
501
}
0 commit comments