Chore: frontend infrastructure upgrade (#16420)

Co-authored-by: NFish <douxc512@gmail.com>
Co-authored-by: zxhlyh <jasonapring2015@outlook.com>
Co-authored-by: twwu <twwu@dify.ai>
Co-authored-by: jZonG <jzongcode@gmail.com>
This commit is contained in:
Joel
2025-03-21 17:41:03 +08:00
committed by GitHub
parent e61415223b
commit 7709d9df20
1435 changed files with 13372 additions and 11612 deletions

View File

@@ -47,14 +47,14 @@ const FileInAttachmentItem = ({
return (
<>
<div className={cn(
'flex items-center pr-3 h-12 rounded-lg border-[0.5px] border-components-panel-border bg-components-panel-on-panel-item-bg shadow-xs',
progress === -1 && 'bg-state-destructive-hover border-state-destructive-border',
'flex h-12 items-center rounded-lg border-[0.5px] border-components-panel-border bg-components-panel-on-panel-item-bg pr-3 shadow-xs',
progress === -1 && 'border-state-destructive-border bg-state-destructive-hover',
)}>
<div className='flex items-center justify-center w-12 h-12'>
<div className='flex h-12 w-12 items-center justify-center'>
{
isImageFile && (
<FileImageRender
className='w-8 h-8'
className='h-8 w-8'
imageUrl={base64Url || url || ''}
/>
)
@@ -68,14 +68,14 @@ const FileInAttachmentItem = ({
)
}
</div>
<div className='grow w-0 mr-1'>
<div className='mr-1 w-0 grow'>
<div
className='flex items-center mb-0.5 system-xs-medium text-text-secondary truncate'
className='system-xs-medium mb-0.5 flex items-center truncate text-text-secondary'
title={file.name}
>
<div className='truncate'>{name}</div>
</div>
<div className='flex items-center system-2xs-medium-uppercase text-text-tertiary'>
<div className='system-2xs-medium-uppercase flex items-center text-text-tertiary'>
{
ext && (
<span>{ext.toLowerCase()}</span>
@@ -83,7 +83,7 @@ const FileInAttachmentItem = ({
}
{
ext && (
<span className='mx-1 system-2xs-medium'></span>
<span className='system-2xs-medium mx-1'></span>
)
}
{
@@ -93,7 +93,7 @@ const FileInAttachmentItem = ({
}
</div>
</div>
<div className='shrink-0 flex items-center'>
<div className='flex shrink-0 items-center'>
{
progress >= 0 && !fileIsUploaded(file) && (
<ProgressCircle
@@ -108,21 +108,21 @@ const FileInAttachmentItem = ({
className='mr-1'
onClick={() => onReUpload?.(id)}
>
<ReplayLine className='w-4 h-4 text-text-tertiary' />
<ReplayLine className='h-4 w-4 text-text-tertiary' />
</ActionButton>
)
}
{
showDeleteAction && (
<ActionButton onClick={() => onRemove?.(id)}>
<RiDeleteBinLine className='w-4 h-4' />
<RiDeleteBinLine className='h-4 w-4' />
</ActionButton>
)
}
{
canPreview && isImageFile && (
<ActionButton className='mr-1' onClick={() => setImagePreviewUrl(url || '')}>
<RiEyeLine className='w-4 h-4' />
<RiEyeLine className='h-4 w-4' />
</ActionButton>
)
}
@@ -132,7 +132,7 @@ const FileInAttachmentItem = ({
e.stopPropagation()
downloadFile(url || base64Url || '', name)
}}>
<RiDownloadLine className='w-4 h-4' />
<RiDownloadLine className='h-4 w-4' />
</ActionButton>
)
}

View File

@@ -23,7 +23,7 @@ import { TransferMethod } from '@/types/app'
type Option = {
value: string
label: string
icon: JSX.Element
icon: React.JSX.Element
}
type FileUploaderInAttachmentProps = {
fileConfig: FileUpload
@@ -41,12 +41,12 @@ const FileUploaderInAttachment = ({
{
value: TransferMethod.local_file,
label: t('common.fileUploader.uploadFromComputer'),
icon: <RiUploadCloud2Line className='w-4 h-4' />,
icon: <RiUploadCloud2Line className='h-4 w-4' />,
},
{
value: TransferMethod.remote_url,
label: t('common.fileUploader.pasteFileLink'),
icon: <RiLink className='w-4 h-4' />,
icon: <RiLink className='h-4 w-4' />,
},
]
@@ -55,7 +55,7 @@ const FileUploaderInAttachment = ({
<Button
key={option.value}
variant='tertiary'
className={cn('grow relative', open && 'bg-components-button-tertiary-bg-hover')}
className={cn('relative grow', open && 'bg-components-button-tertiary-bg-hover')}
disabled={!!(fileConfig.number_limits && files.length >= fileConfig.number_limits)}
>
{option.icon}