Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

📝 docs(bot): Auto sync agents & plugin to readme

lobehubbot1ff4de5efbe4
diff --git a/src/components/DragUpload/index.tsx b/src/components/DragUpload/index.tsx
index 9c5cff69e65..6e82fc69492 100644
--- a/src/components/DragUpload/index.tsx
+++ b/src/components/DragUpload/index.tsx
@@ -42,16 +42,16 @@ const useStyles = createStyles(({ css, token }) => {
margin-block-start: -44px;
`,
iconLeft: css`
+ transform: rotateZ(-20deg) translateX(10px);
border-radius: ${token.borderRadiusLG}px;
color: color-mix(in srgb, ${token.geekblue} 95%, black);
background: color-mix(in srgb, ${token.geekblue} 68%, white);
- transform: rotateZ(-20deg) translateX(10px);
`,
iconRight: css`
+ transform: rotateZ(20deg) translateX(-10px);
border-radius: ${token.borderRadiusLG}px;
color: color-mix(in srgb, ${token.geekblue} 95%, black);
background: color-mix(in srgb, ${token.geekblue} 68%, white);
- transform: rotateZ(20deg) translateX(-10px);
`,
title: css`
font-size: 20px;
@@ -91,11 +91,7 @@ const DragUpload = memo<DragUploadProps>(({ enabledFiles = true, onUploadFiles }
<div className={styles.container}>
<Center className={styles.content} gap={12}>
<Flexbox className={styles.iconGroup} horizontal>
- <Center
- className={styles.iconLeft}
- height={BLOCK_SIZE * 1.25}
- width={BLOCK_SIZE}
- >
+ <Center className={styles.iconLeft} height={BLOCK_SIZE * 1.25} width={BLOCK_SIZE}>
<Icon icon={FileImage} size={ICON_SIZE} />
</Center>
<Center
@@ -109,11 +105,7 @@ const DragUpload = memo<DragUploadProps>(({ enabledFiles = true, onUploadFiles }
>
<Icon icon={FileUpIcon} size={ICON_SIZE} />
</Center>
- <Center
- className={styles.iconRight}
- height={BLOCK_SIZE * 1.25}
- width={BLOCK_SIZE}
- >
+ <Center className={styles.iconRight} height={BLOCK_SIZE * 1.25} width={BLOCK_SIZE}>
<Icon icon={FileText} size={ICON_SIZE} />
</Center>
</Flexbox>
diff --git a/src/features/ResourceManager/components/Explorer/ListView/ListItem/TruncatedFileName.tsx b/src/features/ResourceManager/components/Explorer/ListView/ListItem/TruncatedFileName.tsx
index 380c7aa8bb5..d112f01cf28 100644
--- a/src/features/ResourceManager/components/Explorer/ListView/ListItem/TruncatedFileName.tsx
+++ b/src/features/ResourceManager/components/Explorer/ListView/ListItem/TruncatedFileName.tsx
@@ -27,7 +27,7 @@ const TruncatedFileName = memo<TruncatedFileNameProps>(({ name, className }) =>
measureSpan.style.position = 'absolute';
measureSpan.style.whiteSpace = 'nowrap';
measureSpan.style.font = window.getComputedStyle(container).font;
- document.body.appendChild(measureSpan);
+ document.body.append(measureSpan);
// Measure full name
measureSpan.textContent = name;
@@ -36,7 +36,7 @@ const TruncatedFileName = memo<TruncatedFileNameProps>(({ name, className }) =>
// If it fits, show the full name
if (fullWidth <= containerWidth) {
setDisplayName(name);
- document.body.removeChild(measureSpan);
+ measureSpan.remove();
return;
}
@@ -65,7 +65,7 @@ const TruncatedFileName = memo<TruncatedFileNameProps>(({ name, className }) =>
if (availableWidth <= 0) {
// Not enough space, just show ellipsis + extension
setDisplayName(`...${extension}`);
- document.body.removeChild(measureSpan);
+ measureSpan.remove();
return;
}
@@ -93,7 +93,7 @@ const TruncatedFileName = memo<TruncatedFileNameProps>(({ name, className }) =>
}
}
- document.body.removeChild(measureSpan);
+ measureSpan.remove();
// Construct final truncated name
if (bestFit.length === 0) {
@@ -101,7 +101,9 @@ const TruncatedFileName = memo<TruncatedFileNameProps>(({ name, className }) =>
} else {
const startChars = Math.ceil(bestFit.length / 2);
const endChars = Math.floor(bestFit.length / 2);
- setDisplayName(`${baseName.slice(0, startChars)}...${baseName.slice(-endChars)}${extension}`);
+ setDisplayName(
+ `${baseName.slice(0, startChars)}...${baseName.slice(-endChars)}${extension}`,
+ );
}
};