全能创作:定妆/台词/换款与剧情方向硬约束,资源可下载
修角色定妆修改不重出图、角色图混入商品、宠物旁白腔、换款同点复读、剧情反转方向漂移,并补会话资源下载与外观/空消息闸门。
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}
|
||||
|
||||
Reference in New Issue
Block a user