mirror of
https://github.com/lobehub/lobehub.git
synced 2026-03-27 13:29:15 +07:00
📝 docs(bot): Auto sync agents & plugin to readme
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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}`,
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user