feat(v1.3.0): 图片编辑器(裁剪/旋转/图像大小/调色) + 批量水印 + AI生图 + 收藏体系 + 图片新窗口打开按钮 + 合拼拼图 + 返回顶部

This commit is contained in:
jinghui committed 2026-11-17 23:36:32 +08:00
1 parent e345456abf
commit 94ac94436c
46 files changed
+6521 -114

No files matched your search

+31 -3
View File
@@ -2,7 +2,7 @@
* 图片单元格组件
*/
import { Play, FileText, Palette, Music, File } from 'lucide-react';
import { Play, FileText, Palette, Music, File, Star, ExternalLink } from 'lucide-react';
const ImageCell = ({
image,
@@ -12,8 +12,10 @@ const ImageCell = ({
editingFilename,
editInputRef,
getThumbnailUrl,
getOriginalUrl,
onImageClick,
onImageDoubleClick,
onToggleFavorite,
onContextMenu,
onDragStart,
onEditingChange,
@@ -72,9 +74,9 @@ const ImageCell = ({
}}
/>
{/* 文件类型标识 */}
{/* 文件类型标识(右让位给「新窗口打开」按钮) */}
{image.fileType && image.fileType !== 'image' && (
<div className={`absolute top-2 right-2 rounded-md px-2 py-1 flex items-center gap-1 shadow-lg ${
<div className={`absolute top-2 right-11 rounded-md px-2 py-1 flex items-center gap-1 shadow-lg ${
image.fileType === 'video' ? 'bg-blue-500 bg-opacity-90' :
image.fileType === 'audio' ? 'bg-pink-500 bg-opacity-90' :
image.fileType === 'document' ? 'bg-green-500 bg-opacity-90' :
@@ -92,6 +94,32 @@ const ImageCell = ({
</div>
)}
{/* 在新窗口打开原图(右上角) */}
<a
href={getOriginalUrl ? getOriginalUrl(image) : ''}
target="_blank"
rel="noopener noreferrer"
title="在新窗口打开"
onClick={(e) => e.stopPropagation()}
onDoubleClick={(e) => e.stopPropagation()}
className="absolute top-2 right-2 z-10 p-1 rounded-full backdrop-blur-sm bg-black/40 hover:bg-black/70 transition-all opacity-0 group-hover:opacity-100"
>
<ExternalLink size={14} className="text-white" />
</a>
{/* 收藏标记 / 收藏按钮 */}
<button
type="button"
onClick={(e) => { e.stopPropagation(); onToggleFavorite?.(image); }}
title={image.favorite ? '取消收藏' : '收藏'}
className={`absolute top-2 left-2 z-10 p-1 rounded-full backdrop-blur-sm transition-all ${
image.favorite
? 'opacity-100 bg-amber-400/80'
: 'opacity-0 group-hover:opacity-100 bg-black/40'
}`}
>
<Star size={14} className={image.favorite ? 'fill-white text-white' : 'text-white'} />
</button>
<div className="absolute inset-0 bg-black bg-opacity-0 group-hover:bg-opacity-20 transition-all pointer-events-none" />
</div>