全能创作:定妆/台词/换款与剧情方向硬约束,资源可下载
修角色定妆修改不重出图、角色图混入商品、宠物旁白腔、换款同点复读、剧情反转方向漂移,并补会话资源下载与外观/空消息闸门。
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { useEffect, useState, type ReactNode } from "react";
|
||||
import { createPortal } from "react-dom";
|
||||
import { CheckCircle2, Inbox, Music, Shield, Trash2, X } from "lucide-react";
|
||||
import { CheckCircle2, Download, Inbox, Music, Shield, Trash2, X } from "lucide-react";
|
||||
|
||||
// 抽屉 / 弹窗 / 全屏播放器必须挂到 document.body。
|
||||
// 写在页面树里会被顶栏(sticky + z-index)盖住:搜索、余额、铃铛会浮在抽屉上。
|
||||
@@ -55,12 +55,13 @@ export function useOverlayTransition(open: boolean, onClose?: () => void, durati
|
||||
|
||||
// 通用媒体预览灯箱:点击图片放大 / 点击视频弹窗播放 / 点击音频弹窗试听(复用 .np-lightbox 样式)
|
||||
// 背景点击 / Esc / 关闭键都可关闭;点媒体本身不关闭。
|
||||
export function MediaLightbox({ open, src, kind, name, close }: {
|
||||
export function MediaLightbox({ open, src, kind, name, close, onDownload }: {
|
||||
open: boolean;
|
||||
src: string;
|
||||
kind?: "image" | "video" | "audio";
|
||||
name?: string;
|
||||
close: () => void;
|
||||
onDownload?: () => void;
|
||||
}) {
|
||||
useBodyScrollLock(open && !!src);
|
||||
useEffect(() => {
|
||||
@@ -73,7 +74,12 @@ export function MediaLightbox({ open, src, kind, name, close }: {
|
||||
// 挂到 body:浮层才能盖住顶栏(搜索 / 余额 / 铃铛)和侧栏
|
||||
return createPortal(
|
||||
<div className="np-lightbox show" onClick={close}>
|
||||
<button className="lb-x" type="button" aria-label="关闭" onClick={close}><X /></button>
|
||||
<div className="lb-actions" onClick={(event) => event.stopPropagation()}>
|
||||
{onDownload ? (
|
||||
<button className="lb-dl" type="button" aria-label="下载" title="下载" onClick={onDownload}><Download size={16} /></button>
|
||||
) : null}
|
||||
<button className="lb-x" type="button" aria-label="关闭" onClick={close}><X /></button>
|
||||
</div>
|
||||
{kind === "video" ? (
|
||||
<video
|
||||
src={src}
|
||||
|
||||
@@ -2025,9 +2025,16 @@ select.duration-select:focus,
|
||||
border-radius: var(--r-md);
|
||||
box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
|
||||
}
|
||||
.np-lightbox .lb-x {
|
||||
.np-lightbox .lb-actions {
|
||||
position: fixed;
|
||||
top: 24px; right: 24px;
|
||||
z-index: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
}
|
||||
.np-lightbox .lb-x,
|
||||
.np-lightbox .lb-dl {
|
||||
width: 44px; height: 44px;
|
||||
border-radius: 50%;
|
||||
background: rgba(255, 255, 255, .12);
|
||||
@@ -2038,8 +2045,10 @@ select.duration-select:focus,
|
||||
place-items: center;
|
||||
transition: background var(--t-base);
|
||||
}
|
||||
.np-lightbox .lb-x:hover { background: rgba(255, 255, 255, .24); }
|
||||
.np-lightbox .lb-x svg { width: 18px; height: 18px; }
|
||||
.np-lightbox .lb-x:hover,
|
||||
.np-lightbox .lb-dl:hover { background: rgba(255, 255, 255, .24); }
|
||||
.np-lightbox .lb-x svg,
|
||||
.np-lightbox .lb-dl svg { width: 18px; height: 18px; }
|
||||
.np-lightbox .lb-name {
|
||||
position: fixed;
|
||||
bottom: 24px; left: 50%;
|
||||
|
||||
@@ -2527,9 +2527,10 @@
|
||||
box-shadow: -8px 12px 40px rgba(20, 27, 38, .16);
|
||||
}
|
||||
|
||||
.omni-prompt-drawer header {
|
||||
.omni-prompt-drawer header,
|
||||
.omni-prompt-drawer-head {
|
||||
display: grid;
|
||||
grid-template-columns: 36px minmax(0, 1fr) 32px;
|
||||
grid-template-columns: 36px minmax(0, 1fr) 32px 32px;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
padding: 14px 14px 12px;
|
||||
@@ -2552,29 +2553,35 @@
|
||||
height: 16px;
|
||||
}
|
||||
|
||||
.omni-prompt-drawer header div {
|
||||
.omni-prompt-drawer header div,
|
||||
.omni-prompt-drawer-head div {
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.omni-prompt-drawer header strong,
|
||||
.omni-prompt-drawer header small {
|
||||
.omni-prompt-drawer header small,
|
||||
.omni-prompt-drawer-head strong,
|
||||
.omni-prompt-drawer-head small {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.omni-prompt-drawer header strong {
|
||||
.omni-prompt-drawer header strong,
|
||||
.omni-prompt-drawer-head strong {
|
||||
overflow: hidden;
|
||||
font-size: 15px;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.omni-prompt-drawer header small {
|
||||
.omni-prompt-drawer header small,
|
||||
.omni-prompt-drawer-head small {
|
||||
margin-top: 2px;
|
||||
color: #8b919a;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.omni-prompt-drawer header button {
|
||||
.omni-prompt-drawer header button,
|
||||
.omni-prompt-drawer-head button {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
display: grid;
|
||||
@@ -3188,6 +3195,149 @@
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
/* 对话资源 / 文档卡下载 */
|
||||
.omni-doc-head-actions {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
flex: 0 0 auto;
|
||||
}
|
||||
|
||||
.omni-doc-download {
|
||||
flex: 0 0 auto;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
display: grid;
|
||||
place-items: center;
|
||||
border: 1px solid var(--border-faint);
|
||||
border-radius: 8px;
|
||||
background: var(--surface);
|
||||
color: var(--accent-black);
|
||||
cursor: pointer;
|
||||
transition: background var(--t-base), border-color var(--t-base), color var(--t-base);
|
||||
}
|
||||
|
||||
.omni-doc-download:hover {
|
||||
border-color: var(--border-loud);
|
||||
background: var(--background-lighter);
|
||||
color: var(--klein);
|
||||
}
|
||||
|
||||
.omni-doc-download svg {
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
}
|
||||
|
||||
.omni-prompt-file-actions {
|
||||
display: flex;
|
||||
flex: 0 0 auto;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.omni-prompt-file-actions button {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
.omni-prompt-file-actions button.is-secondary {
|
||||
background: transparent;
|
||||
border: 1px solid var(--border-faint);
|
||||
color: var(--accent-black);
|
||||
}
|
||||
|
||||
.omni-prompt-file-actions button svg {
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
}
|
||||
|
||||
.omni-assets-card {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.omni-assets-card-main {
|
||||
display: flex;
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
background: transparent;
|
||||
color: inherit;
|
||||
text-align: left;
|
||||
width: 100%;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.omni-assets-card.is-doc .omni-assets-card-main,
|
||||
.omni-assets-grid.is-list .omni-assets-card-main {
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.omni-assets-card-main:disabled {
|
||||
cursor: default;
|
||||
opacity: .72;
|
||||
}
|
||||
|
||||
.omni-assets-dl {
|
||||
position: absolute;
|
||||
right: 8px;
|
||||
bottom: 8px;
|
||||
z-index: 1;
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
display: grid;
|
||||
place-items: center;
|
||||
border: 0;
|
||||
border-radius: 8px;
|
||||
color: #fff;
|
||||
background: rgba(16, 16, 18, .72);
|
||||
cursor: pointer;
|
||||
opacity: 0;
|
||||
pointer-events: none;
|
||||
transition: opacity .16s ease;
|
||||
}
|
||||
|
||||
.omni-assets-card.is-doc .omni-assets-dl,
|
||||
.omni-assets-grid.is-list .omni-assets-dl {
|
||||
position: static;
|
||||
flex: 0 0 auto;
|
||||
margin-left: auto;
|
||||
color: var(--accent-black);
|
||||
background: var(--background-lighter);
|
||||
opacity: 1;
|
||||
pointer-events: auto;
|
||||
}
|
||||
|
||||
.omni-assets-card:hover .omni-assets-dl,
|
||||
.omni-assets-dl:focus-visible {
|
||||
opacity: 1;
|
||||
pointer-events: auto;
|
||||
}
|
||||
|
||||
.omni-assets-dl:disabled {
|
||||
opacity: .4;
|
||||
cursor: default;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.omni-assets-dl svg {
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
}
|
||||
|
||||
@media (hover: none) {
|
||||
.omni-assets-dl {
|
||||
opacity: 1;
|
||||
pointer-events: auto;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.omni-model-picker-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
|
||||
@@ -666,10 +666,57 @@ function planDocumentBody(payload: Record<string, unknown>): string {
|
||||
].join("\n\n");
|
||||
}
|
||||
|
||||
|
||||
function sanitizeDownloadName(name: string, fallback: string): string {
|
||||
const cleaned = String(name || "").trim().replace(/[\\/:*?"<>|]+/g, "_");
|
||||
return cleaned || fallback;
|
||||
}
|
||||
|
||||
function triggerBlobDownload(blob: Blob, filename: string) {
|
||||
const href = URL.createObjectURL(blob);
|
||||
const anchor = document.createElement("a");
|
||||
anchor.href = href;
|
||||
anchor.download = filename;
|
||||
document.body.appendChild(anchor);
|
||||
anchor.click();
|
||||
anchor.remove();
|
||||
window.setTimeout(() => URL.revokeObjectURL(href), 1000);
|
||||
}
|
||||
|
||||
/** 对话资源下载:文档走本地 blob;图片/视频优先 fetch blob,跨域失败则新开标签。 */
|
||||
async function downloadSessionResource(options: {
|
||||
kind: SessionAssetKind;
|
||||
title: string;
|
||||
src?: string;
|
||||
body?: string;
|
||||
}) {
|
||||
const { kind, title, src, body } = options;
|
||||
if (kind === "document") {
|
||||
const filename = sanitizeDownloadName(title, "对话资源.md");
|
||||
const safeName = filename.toLowerCase().endsWith(".md") ? filename : `${filename}.md`;
|
||||
triggerBlobDownload(new Blob([String(body || "")], { type: "text/markdown;charset=utf-8" }), safeName);
|
||||
return;
|
||||
}
|
||||
if (!src) return;
|
||||
const fallback = kind === "video" ? "生成视频.mp4" : "生成图片.png";
|
||||
const filename = sanitizeDownloadName(title, fallback);
|
||||
try {
|
||||
const response = await fetch(src, { mode: "cors" });
|
||||
if (!response.ok) throw new Error(`download failed: ${response.status}`);
|
||||
const blob = await response.blob();
|
||||
let finalName = filename;
|
||||
if (kind === "video" && !/\.\w+$/.test(finalName)) finalName = `${finalName}.mp4`;
|
||||
if (kind === "image" && !/\.\w+$/.test(finalName)) finalName = `${finalName}.png`;
|
||||
triggerBlobDownload(blob, finalName);
|
||||
} catch {
|
||||
window.open(src, "_blank", "noopener,noreferrer");
|
||||
}
|
||||
}
|
||||
|
||||
function documentDescription(title: string): string {
|
||||
if (title.includes("创作策略")) return "创作策略 · 点击查看";
|
||||
if (title.includes("视频最终方案")) return "视频方案 · 点击查看";
|
||||
return "出片指令 · 点击查看";
|
||||
if (title.includes("创作策略")) return "创作策略 · 可下载";
|
||||
if (title.includes("视频最终方案")) return "视频方案 · 可下载";
|
||||
return "出片指令 · 可下载";
|
||||
}
|
||||
|
||||
/** 从本会话已加载 messages(+pinned_refs / 会话上传)聚合聊天资产,不另打 BE。 */
|
||||
@@ -864,7 +911,22 @@ function StrategyCard({ payload }: { payload: Record<string, unknown> }) {
|
||||
<section className="omni-strategy-card">
|
||||
<header className="omni-strategy-head">
|
||||
<strong>创作策略理解</strong>
|
||||
<span>平台自动判断</span>
|
||||
<div className="omni-doc-head-actions">
|
||||
<span>平台自动判断</span>
|
||||
<button
|
||||
type="button"
|
||||
className="omni-doc-download"
|
||||
title="下载"
|
||||
aria-label="下载创作策略"
|
||||
onClick={() => void downloadSessionResource({
|
||||
kind: "document",
|
||||
title: "创作策略摘要.md",
|
||||
body: strategyDocumentBody(payload),
|
||||
})}
|
||||
>
|
||||
<Download />
|
||||
</button>
|
||||
</div>
|
||||
</header>
|
||||
<div className="omni-strategy-grid">
|
||||
{items.map(([label, value]) => (
|
||||
@@ -935,7 +997,22 @@ function PlanCard({ payload }: { payload: Record<string, unknown> }) {
|
||||
<section className="omni-video-plan-card">
|
||||
<header className="omni-video-plan-head">
|
||||
<strong>视频最终方案</strong>
|
||||
<span>确认后进入出片参数核对</span>
|
||||
<div className="omni-doc-head-actions">
|
||||
<span>确认后进入出片参数核对</span>
|
||||
<button
|
||||
type="button"
|
||||
className="omni-doc-download"
|
||||
title="下载"
|
||||
aria-label="下载视频最终方案"
|
||||
onClick={() => void downloadSessionResource({
|
||||
kind: "document",
|
||||
title: "视频最终方案.md",
|
||||
body: planDocumentBody(payload),
|
||||
})}
|
||||
>
|
||||
<Download />
|
||||
</button>
|
||||
</div>
|
||||
</header>
|
||||
<section className="omni-plan-section">
|
||||
<strong>卖点做减法</strong>
|
||||
@@ -1007,9 +1084,15 @@ function PromptFileCard({
|
||||
<small>已根据方案、参数和 {String(payload.ref_count ?? 0)} 组参考素材在后台整理完成</small>
|
||||
</div>
|
||||
{body ? (
|
||||
<button type="button" onClick={() => onView(title, body)}>
|
||||
查看 Prompt
|
||||
</button>
|
||||
<div className="omni-prompt-file-actions">
|
||||
<button type="button" className="is-secondary" onClick={() => void downloadSessionResource({ kind: "document", title, body })}>
|
||||
<Download />
|
||||
下载
|
||||
</button>
|
||||
<button type="button" onClick={() => onView(title, body)}>
|
||||
查看 Prompt
|
||||
</button>
|
||||
</div>
|
||||
) : null}
|
||||
</section>
|
||||
);
|
||||
@@ -1533,9 +1616,24 @@ function ElicitCard({
|
||||
const question = message.text || fields[0]?.label || "这项你想怎么定?";
|
||||
const compactChoiceOnly = String(message.payload.topic || "") === "cast_relation";
|
||||
// 兼容多种 options 来源:单选、多选、或字段内直接携带 options
|
||||
const rawChoiceField = fields.find(
|
||||
const fieldChoice = fields.find(
|
||||
(field) => Array.isArray(field.options) && field.options.length > 0,
|
||||
);
|
||||
const replyOptions = Array.isArray(message.payload.reply_options)
|
||||
? (message.payload.reply_options as Array<{ label?: string; text?: string; value?: string }>)
|
||||
: [];
|
||||
const replyChoiceField = replyOptions.length > 0
|
||||
? {
|
||||
key: fields[0]?.key || "answer",
|
||||
label: fields[0]?.label || question,
|
||||
type: "single" as const,
|
||||
options: replyOptions.map((item, index) => ({
|
||||
value: String(item.text || item.value || item.label || `option_${index + 1}`),
|
||||
label: String(item.label || item.text || item.value || `选项 ${index + 1}`),
|
||||
})),
|
||||
}
|
||||
: null;
|
||||
const rawChoiceField = fieldChoice || replyChoiceField;
|
||||
// 如果是痛点方向追问、或文案明确提及「直接点击一个选项」,但在 fields 里未能取到 options,提供兜底选项
|
||||
const isPainPointQuestion =
|
||||
fields[0]?.key === "pain_point_direction"
|
||||
@@ -1596,7 +1694,14 @@ function ElicitCard({
|
||||
type="button"
|
||||
key={value || index}
|
||||
disabled={disabled}
|
||||
onClick={() => onSubmit({ [choiceField.key || "choice"]: value }, [])}
|
||||
onClick={() => {
|
||||
// reply_options 是快捷整句回答,走聊天正文;字段 options 仍走 elicit answers。
|
||||
if (replyChoiceField && !fieldChoice) {
|
||||
onChatAnswer(value);
|
||||
return;
|
||||
}
|
||||
onSubmit({ [choiceField.key || "choice"]: value }, []);
|
||||
}}
|
||||
>
|
||||
{label}
|
||||
</button>
|
||||
@@ -3708,7 +3813,7 @@ export function OmniSessionPage({
|
||||
<>
|
||||
<button type="button" className="omni-prompt-drawer-bg" aria-label="关闭 Prompt" onClick={() => setPromptView(null)} />
|
||||
<aside className="omni-prompt-drawer" role="dialog" aria-label={promptView.title}>
|
||||
<header>
|
||||
<header className="omni-prompt-drawer-head">
|
||||
<span className="omni-prompt-drawer-file">
|
||||
<FileText />
|
||||
</span>
|
||||
@@ -3716,6 +3821,19 @@ export function OmniSessionPage({
|
||||
<strong>{promptView.title}</strong>
|
||||
<small>{documentDescription(promptView.title)}</small>
|
||||
</div>
|
||||
<button
|
||||
type="button"
|
||||
className="omni-doc-download"
|
||||
title="下载"
|
||||
aria-label="下载文档"
|
||||
onClick={() => void downloadSessionResource({
|
||||
kind: "document",
|
||||
title: promptView.title,
|
||||
body: promptView.body,
|
||||
})}
|
||||
>
|
||||
<Download />
|
||||
</button>
|
||||
<button type="button" onClick={() => setPromptView(null)} aria-label="关闭">
|
||||
<X />
|
||||
</button>
|
||||
@@ -3924,59 +4042,91 @@ export function OmniSessionPage({
|
||||
{group.items.map((asset) => {
|
||||
if (asset.kind === "document") {
|
||||
return (
|
||||
<button
|
||||
type="button"
|
||||
className="omni-assets-card is-doc"
|
||||
key={asset.key}
|
||||
onClick={() => {
|
||||
setPromptView({
|
||||
<div className="omni-assets-card is-doc" key={asset.key}>
|
||||
<button
|
||||
type="button"
|
||||
className="omni-assets-card-main"
|
||||
onClick={() => {
|
||||
setPromptView({
|
||||
title: asset.promptTitle || asset.title,
|
||||
body: asset.promptBody || "暂无内容",
|
||||
});
|
||||
}}
|
||||
>
|
||||
<span className="omni-assets-thumb is-doc">
|
||||
<FileText />
|
||||
</span>
|
||||
<span className="omni-assets-meta">
|
||||
<strong>{asset.title}</strong>
|
||||
<small>{asset.documentDescription || "文档 · 点击查看"}</small>
|
||||
</span>
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
className="omni-assets-dl"
|
||||
title="下载"
|
||||
aria-label={`下载${asset.title}`}
|
||||
onClick={() => void downloadSessionResource({
|
||||
kind: "document",
|
||||
title: asset.promptTitle || asset.title,
|
||||
body: asset.promptBody || "暂无内容",
|
||||
});
|
||||
}}
|
||||
>
|
||||
<span className="omni-assets-thumb is-doc">
|
||||
<FileText />
|
||||
</span>
|
||||
<span className="omni-assets-meta">
|
||||
<strong>{asset.title}</strong>
|
||||
<small>{asset.documentDescription || "文档 · 点击查看"}</small>
|
||||
</span>
|
||||
</button>
|
||||
body: asset.promptBody || "",
|
||||
})}
|
||||
>
|
||||
<Download />
|
||||
</button>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
return (
|
||||
<button
|
||||
type="button"
|
||||
className={`omni-assets-card is-${asset.kind}`}
|
||||
key={asset.key}
|
||||
disabled={!asset.src}
|
||||
onClick={() => {
|
||||
if (!asset.src) return;
|
||||
setAssetPreview({
|
||||
src: asset.src,
|
||||
kind: asset.kind === "video" ? "video" : "image",
|
||||
name: asset.title,
|
||||
});
|
||||
}}
|
||||
>
|
||||
<span className="omni-assets-thumb">
|
||||
{asset.thumb ? (
|
||||
<img src={asset.thumb} alt="" />
|
||||
) : (
|
||||
<i>{asset.kind === "video" ? <Play /> : <Image />}</i>
|
||||
)}
|
||||
{asset.kind === "video" ? (
|
||||
<span className="omni-assets-play" aria-hidden="true">
|
||||
<Play />
|
||||
</span>
|
||||
) : null}
|
||||
</span>
|
||||
<span className="omni-assets-meta">
|
||||
<strong>{asset.title}</strong>
|
||||
<small>{asset.kind === "video" ? "视频" : "图片"}</small>
|
||||
</span>
|
||||
</button>
|
||||
<div className={`omni-assets-card is-${asset.kind}`} key={asset.key}>
|
||||
<button
|
||||
type="button"
|
||||
className="omni-assets-card-main"
|
||||
disabled={!asset.src}
|
||||
onClick={() => {
|
||||
if (!asset.src) return;
|
||||
setAssetPreview({
|
||||
src: asset.src,
|
||||
kind: asset.kind === "video" ? "video" : "image",
|
||||
name: asset.title,
|
||||
});
|
||||
}}
|
||||
>
|
||||
<span className="omni-assets-thumb">
|
||||
{asset.thumb ? (
|
||||
<img src={asset.thumb} alt="" />
|
||||
) : (
|
||||
<i>{asset.kind === "video" ? <Play /> : <Image />}</i>
|
||||
)}
|
||||
{asset.kind === "video" ? (
|
||||
<span className="omni-assets-play" aria-hidden="true">
|
||||
<Play />
|
||||
</span>
|
||||
) : null}
|
||||
</span>
|
||||
<span className="omni-assets-meta">
|
||||
<strong>{asset.title}</strong>
|
||||
<small>{asset.kind === "video" ? "视频" : "图片"}</small>
|
||||
</span>
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
className="omni-assets-dl"
|
||||
title="下载"
|
||||
aria-label={`下载${asset.title}`}
|
||||
disabled={!asset.src}
|
||||
onClick={() => {
|
||||
if (!asset.src) return;
|
||||
void downloadSessionResource({
|
||||
kind: asset.kind,
|
||||
title: asset.title,
|
||||
src: asset.src,
|
||||
});
|
||||
}}
|
||||
>
|
||||
<Download />
|
||||
</button>
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
@@ -4030,6 +4180,11 @@ export function OmniSessionPage({
|
||||
kind={assetPreview?.kind}
|
||||
name={assetPreview?.name}
|
||||
close={() => setAssetPreview(null)}
|
||||
onDownload={assetPreview?.src ? () => void downloadSessionResource({
|
||||
kind: assetPreview.kind === "video" ? "video" : "image",
|
||||
title: assetPreview.name || (assetPreview.kind === "video" ? "生成视频.mp4" : "生成图片.png"),
|
||||
src: assetPreview.src,
|
||||
}) : undefined}
|
||||
/>
|
||||
<AssetSelectModal
|
||||
open={sessionAssetModalOpen}
|
||||
|
||||
Reference in New Issue
Block a user