feat(core): doc explorer list item drag preview (#12553)

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->

## Summary by CodeRabbit

- **Style**
  - Improved the appearance of drag preview elements in the document list, including updated layout, spacing, background, and icon size for a more polished visual experience when dragging items.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
CatsJuice
2025-05-27 06:29:13 +00:00
parent 2f139bd02c
commit b5b911b5d2
2 changed files with 18 additions and 2 deletions

View File

@@ -6,6 +6,20 @@ export const root = style({
height: '100%',
});
export const dragPreview = style({
display: 'flex',
alignItems: 'center',
gap: 8,
padding: '8px 16px 8px 12px',
background: cssVarV2.layer.background.primary,
borderRadius: 4,
border: `1px solid ${cssVarV2.layer.insideBorder.border}`,
fontSize: 14,
});
export const dragPreviewIcon = style({
fontSize: 24,
});
export const listViewRoot = style({
padding: '0px 4px',
width: '100%',

View File

@@ -181,8 +181,10 @@ export const DocListItem = ({ ...props }: DocListItemProps) => {
)}
</WorkbenchLink>
<CustomDragPreview>
<RawDocIcon id={props.docId} />
<RawDocTitle id={props.docId} />
<div className={styles.dragPreview}>
<RawDocIcon id={props.docId} className={styles.dragPreviewIcon} />
<RawDocTitle id={props.docId} />
</div>
</CustomDragPreview>
</>
);