修复画板私有素材预览
让生成参考图和角色动作参考图通过 objectKey 换签显示 让视频图层 poster 与框选预览复用签名读取 补充参考槽、框选预览和视频图层回归测试 沉淀框选预览换签缓存踩坑
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
import { type ReactNode, type RefObject } from 'react';
|
||||
import { X } from 'lucide-react';
|
||||
|
||||
import { ResolvedAssetImage } from '../ResolvedAssetImage';
|
||||
|
||||
type ImageCanvasReferenceSlotTone =
|
||||
| 'default'
|
||||
| 'spec'
|
||||
@@ -20,6 +22,7 @@ type ImageCanvasReferenceSlotProps = {
|
||||
ariaLabel: string;
|
||||
title?: string;
|
||||
imageSrc?: string | null;
|
||||
objectKey?: string | null;
|
||||
disabled?: boolean;
|
||||
isAdd?: boolean;
|
||||
onClick?: () => void;
|
||||
@@ -36,13 +39,14 @@ export function ImageCanvasReferenceSlot({
|
||||
ariaLabel,
|
||||
title,
|
||||
imageSrc,
|
||||
objectKey,
|
||||
disabled = false,
|
||||
isAdd = false,
|
||||
onClick,
|
||||
onRemove,
|
||||
removeLabel,
|
||||
}: ImageCanvasReferenceSlotProps) {
|
||||
const hasPreviewImage = Boolean(imageSrc);
|
||||
const hasPreviewImage = Boolean(imageSrc?.trim() || objectKey?.trim());
|
||||
const slotClassName = [
|
||||
'image-canvas-editor__reference-chip',
|
||||
`image-canvas-editor__reference-chip--${tone}`,
|
||||
@@ -58,7 +62,12 @@ export function ImageCanvasReferenceSlot({
|
||||
<>
|
||||
<span className="image-canvas-editor__reference-chip-icon">
|
||||
{hasPreviewImage ? (
|
||||
<img src={imageSrc ?? undefined} alt="" aria-hidden="true" />
|
||||
<ResolvedAssetImage
|
||||
src={imageSrc}
|
||||
objectKey={objectKey}
|
||||
alt=""
|
||||
aria-hidden="true"
|
||||
/>
|
||||
) : (
|
||||
icon
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user