forked from 77media/video-flow
推进更改
This commit is contained in:
parent
320dc7bc21
commit
1f391c189c
@ -53,6 +53,7 @@ export const useRoleServiceHook = (): UseRoleService => {
|
||||
const [currentRoleText, setCurrentRoleText] = useState<string | null>(null);
|
||||
const [userRoleLibrary, setUserRoleLibrary] = useState<RoleEntity[]>([]);
|
||||
const [projectId, setProjectId] = useState<string>(''); // 添加项目ID状态
|
||||
const [cacheRole, setCacheRole] = useState<RoleEntity | null>(null);
|
||||
|
||||
// UseCase实例 - 在角色选择时初始化
|
||||
const [roleEditUseCase, setRoleEditUseCase] = useState<RoleEditUseCase | null>(null);
|
||||
@ -100,7 +101,11 @@ export const useRoleServiceHook = (): UseRoleService => {
|
||||
console.log('selectRole', role);
|
||||
// 根据 role.name 完全替换掉旧的数据
|
||||
setRoleList(prev => prev.map(r => r.name === role.name ? role : r));
|
||||
setSelectedRole(role);
|
||||
setSelectedRole(role);
|
||||
// 如果缓存角色为空,则设置缓存角色,名字不同也切换
|
||||
if(!cacheRole||cacheRole.name!==role.name){
|
||||
setCacheRole(role);
|
||||
}
|
||||
|
||||
// 调用selectRole方法
|
||||
roleEditUseCase!.selectRole(role);
|
||||
|
||||
@ -239,3 +239,6 @@ export const useRoleShotServiceHook = (projectId: string,selectRole?:RoleEntity)
|
||||
setSelectedRole
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
@ -71,3 +71,35 @@ export interface VideoSegmentEntity extends BaseEntity {
|
||||
/**镜头项 */
|
||||
lens: LensType[];
|
||||
}
|
||||
|
||||
/**
|
||||
* 图片故事类型枚举
|
||||
* @description 标识图片故事的来源类型
|
||||
*/
|
||||
export enum ImageStoryType {
|
||||
/** 空文案自动生成故事 */
|
||||
autoStory = 'autoStory',
|
||||
/** 用户描述生成故事 */
|
||||
userStory = 'userStory',
|
||||
/** 模板故事 */
|
||||
templateStory = 'templateStory',
|
||||
}
|
||||
|
||||
/**
|
||||
* 图片故事实体接口
|
||||
* @description 表示一条图片故事及其相关信息
|
||||
*/
|
||||
export interface ImageStoryEntity extends BaseEntity {
|
||||
/** 图片URL */
|
||||
imageUrl: string;
|
||||
/** 图片描述 */
|
||||
imageDescription: string;
|
||||
/** 图片故事内容 */
|
||||
imageStory: string;
|
||||
/** 图片故事剧本 */
|
||||
imageScript: string;
|
||||
/** 故事涉及的角色 */
|
||||
storyRole: RoleEntity[];
|
||||
/** 故事类型 */
|
||||
storyType: ImageStoryType;
|
||||
}
|
||||
|
||||
41
app/service/test/image.test.ts
Normal file
41
app/service/test/image.test.ts
Normal file
@ -0,0 +1,41 @@
|
||||
|
||||
console.log([
|
||||
{"status": "streaming", "content": "**Core Elements**\n\n1. ", "message": "正在根据图片和文本生成剧本..."}
|
||||
,{"status": "streaming", "content": "Protagonist:\n\n Core Identity: JULIAN VANCE (58), a celebrated, semi-retired architect. His appearance is one of studied elegance: impeccably styled salt-and-pepper hair, a trimmed beard, and a gaze that is both intelligent and weary. He lives alone in a stark, minimalist penthouse", "message": "正在根据图片和文本生成剧本..."}
|
||||
,{"status": "streaming", "content": " in a major metropolis, a space that reflects his personality—controlled, orderly, and emotionally vacant.\n\n Initial State & Flaw: Julian lives in a fortress of emotional suppression built after his wife's death years ago. He has channeled his grief into creating cold, perfect structures. His critical flaw is **emotional coward", "message": "正在根据图片和文本生成剧本..."}
|
||||
,{"status": "streaming", "content": "ice masked as intellectual control**; he believes emotion is a messy variable to be engineered out of his life, and he steadfastly avoids anything that could force him to confront his pain.\n\n2. The Inciting Incident:\n\n (State Clearly) Julian receives an anonymous package containing a single flash drive and an", "message": "正在根据图片和文本生成剧本..."}
|
||||
,{"status": "streaming", "content": " origami crane—a signature token of his late wife, Elena. The drive contains a video of Elena, recorded just before her death. Looking directly at the camera, she shatters the \"natural\" cause of her death he had accepted. Her words are a direct assault on the controlled, logical world he has built around his", "message": "正在根据图片和文本生成剧本..."}
|
||||
,{"status": "streaming", "content": " grief.\n\n3. The Problem & New Goal:\n\n (State Clearly) The sterile peace of Julian's life is revealed to be a lie. His wife was murdered, and he never knew. His core problem is now brutally concrete: **\"How do I find the killer who hid in plain sight?\"", "message": "正在根据图片和文本生成剧本..."}
|
||||
,{"status": "streaming", "content": "** This revelation forces him out of his intellectual fortress and gives him a new, urgent goal: uncover the truth, no matter the cost.\n\n4. Conflict & Obstacles:\n\n Primary Conflict: Julian (a logical, emotionally stunted man) versus a hidden, ruthless killer who is likely part of his own", "message": "正在根据图片和文本生成剧本..."}
|
||||
,{"status": "streaming", "content": " trusted social or professional circle. The core conflict is also deeply internal: Julian's precise, orderly mind against the chaotic storm of grief, rage, and paranoia he must now embrace to find justice.\n\n Key Obstacles:\n 1. The trail is cold; the murder happened years ago under the guise of illness", "message": "正在根据图片和文本生成剧本..."}
|
||||
,{"status": "streaming", "content": ".\n 2. The suspect pool is made up of friends and colleagues, turning his entire world into a web of deceit.\n\n5. The Stakes:\n\n What is at stake?: If he succeeds, he will gain justice for Elena and, more importantly, a chance to finally grieve her properly and reclaim", "message": "正在根据图片和文本生成剧本..."}
|
||||
,{"status": "streaming", "content": " his own humanity. If he fails, the killer walks free, his wife's memory remains violated, and he will be permanently trapped as a hollow man who failed her in life and in death. His own life is also in grave danger.\n\n6. Character Arc Accomplished:\n\n (State the Result Clearly", "message": "正在根据图片和文本生成剧本..."}
|
||||
,{"status": "streaming", "content": ") To solve the mystery, Julian must abandon his rigid control and embrace the emotional chaos he has always feared. He will learn to read people's hearts, not just their blueprints. By confronting the killer, he doesn't just find justice for Elena; he completes his own transformation. He overcomes his emotional cowardice", "message": "正在根据图片和文本生成剧本..."}
|
||||
,{"status": "streaming", "content": ", finally integrating his intellect with his heart, and becomes whole again.\n\n**GENRE:** Thriller\n\n---\n\n**INT. PENTHOUSE APARTMENT - DAY**\n\n[SCENE BLUEPRINT: A vast, minimalist living room defined by cold materials—polished concrete, glass, steel. Floor-to-ceiling", "message": "正在根据图片和文本生成剧本..."}
|
||||
,{"status": "streaming", "content": " WINDOWS (Point A) dominate the north wall, showing a stark city skyline. A single, severe black leather SOFA (Point B) is positioned in the center, facing the windows. A sleek, metallic CONSOLE TABLE (Point C) rests against the west wall. The front DOOR (Point D) is a", "message": "正在根据图片和文本生成剧本..."}
|
||||
,{"status": "streaming", "content": " flush, handleless panel on the south wall.]\n\nThe room is silent, sterile as an operating theater. Light slices through the space in hard geometric shapes. JULIAN stands at the [WINDOWS (Point A)], his back to the room, a silhouette against the grey sky.\n\nA door CHIME, sharp and piercing,", "message": "正在根据图片和文本生成剧本..."}
|
||||
,{"status": "streaming", "content": " shatters the quiet.\n\nJulian remains still. A statue. The CHIME sounds again, insistent. He turns, his movement economical and precise. He walks from the [WINDOWS (A)] across the vast floor to the [DOOR (D)].\n\nHe opens it. A COURIER offers a small, plain", "message": "正在根据图片和文本生成剧本..."}
|
||||
,{"status": "streaming", "content": " brown box. Julian takes it without a word, his expression unreadable.\n\nHe closes the door, the lock clicking shut with unnerving volume. He moves from the [DOOR (D)] to the [CONSOLE TABLE (C)] and places the box in the exact center of its surface. He stares at it.", "message": "正在根据图片和文本生成剧本..."}
|
||||
,{"status": "streaming", "content": " A foreign object in his perfect world.\n\n**JULIAN (V.O.)**\nMy world had rules. Order.\nPredictable lines. Predictable endings.\n\n**INT. PENTHOUSE APARTMENT - CONTINUOUS**\n\nCLOSE UP on Julian's hands. Steady. He uses a silver letter opener", "message": "正在根据图片和文本生成剧本..."}
|
||||
,{"status": "streaming", "content": " to slice the tape with surgical precision.\n\nHe lifts the lid. Inside, nestled on black tissue paper, are two items: a delicate origami crane of pale blue paper, and a small, black flash drive.\n\nJulian’s breath catches. His disciplined composure momentarily fails. His hand trembles as it hovers over the crane", "message": "正在根据图片和文本生成剧本..."}
|
||||
,{"status": "streaming", "content": ".\n\n**JULIAN (V.O.)**\nElena’s fold. A signature.\nA ghost on my table.\n\nHe ignores the crane, picking up the flash drive instead. He moves from the [CONSOLE TABLE (C)] to a hidden media nook near the [SOFA (B)], where a sleek laptop", "message": "正在根据图片和文本生成剧本..."}
|
||||
,{"status": "streaming", "content": " sits open.\n\nHe inserts the drive. His own face, stern and weary, stares back from the dark screen.\n\n**INT. PENTHOUSE APARTMENT - CONTINUOUS**\n\nOn the screen, a single file: `ForJulian.mp4`. He hesitates for a beat, then his finger", "message": "正在根据图片和文本生成剧本..."}
|
||||
,{"status": "streaming", "content": " clicks the trackpad.\n\nThe video opens. The cold room is invaded by warmth and color. ELENA (40s, vibrant, alive) sits in a sun-drenched garden. She smiles, but her eyes are heavy with intent. She looks directly through the screen, at him.\n\n**EL", "message": "正在根据图片和文本生成剧本..."}
|
||||
,{"status": "streaming", "content": "ENA**\n(On video)\nJulian, my love. Forgive me.\nIf you are seeing this...\n\nHer voice, so long unheard, fills the oppressive silence.\nCLOSE UP on Julian’s face. A mask of stone slowly beginning to crack. A muscle pulses in his jaw.\n\n**ELENA", "message": "正在根据图片和文本生成剧本..."}
|
||||
,{"status": "streaming", "content": "**\n(calmly, terribly)\n...it means I couldn't tell you.\nI was afraid to.\n\nHer gaze holds his. The final words land like blows.\n\n**ELENA**\nI didn't die from the illness.\nI was murdered.\n\nThe video cuts to BLACK", "message": "正在根据图片和文本生成剧本..."}
|
||||
,{"status": "streaming", "content": ". The only sound is the faint electronic hum of the laptop. Julian is frozen, staring at his own haunted reflection on the screen.\n\n**INT. PENTHOUSE APARTMENT - MOMENTS LATER**\n\nJulian hasn’t moved. His breathing is shallow. He slowly reaches out a finger and touches the screen", "message": "正在根据图片和文本生成剧本..."}
|
||||
,{"status": "streaming", "content": ", right where her face was. A smudge appears on his reflection.\n\nHe looks around the perfect, soulless room. A monument to a lie.\nHis hand, resting on the table, slowly curls into a tight fist. The knuckles are white.\n\n**JULIAN**\n(A ragged whisper)\nWho", "message": "正在根据图片和文本生成剧本..."}
|
||||
,{"status": "streaming", "content": "... who would do this?\nHow do I find them?\n\nA new energy ignites behind his eyes. He stands abruptly. He strides back to the [WINDOWS (A)]. This time, he isn't admiring the architecture. He is surveying a hunting ground. The design is no longer about beauty. It'", "message": "正在根据图片和文本生成剧本..."}
|
||||
,{"status": "streaming", "content": "s about demolition.\n\n**JULIAN (V.O.)**\nThe lines were broken.\nThe foundation was a lie.\nNow... there is only one design.\n\nFADE TO BLACK.\n\n---\n\n### Part 2: Addendum for Director & Performance\n\n**【Decoding the Directing Style】**", "message": "正在根据图片和文本生成剧本..."}
|
||||
,{"status": "streaming", "content": "\n\n* **Core Visual Tone:** High-contrast, architectural black and white. Use hard lines, deep shadows, and stark compositions to visually represent Julian's rigid, self-imposed prison. The only source of vibrant color must be the video of Elena, making her memory a shocking intrusion of life and warmth into his", "message": "正在根据图片和文本生成剧本..."}
|
||||
,{"status": "streaming", "content": " monochromatic world.\n* **Key Scene Treatment Suggestion:** During the video reveal in Scene 3, hold an EXTREME CLOSE-UP on Julian's eye, letting the audience see Elena’s image reflected in his pupil. When she says, \"I was murdered,\" SNAP to a stark WIDE SHOT", "message": "正在根据图片和文本生成剧本..."}
|
||||
,{"status": "streaming", "content": ", showing him as a tiny, isolated figure in his vast, empty room, visually crushing him with the weight of the revelation. The blocking of his movement from the window, to the door, to the laptop, and finally back to the window creates a complete loop of a man whose entire world has been demolished and is", "message": "正在根据图片和文本生成剧本..."}
|
||||
,{"status": "streaming", "content": " being rebuilt with a new, terrifying purpose.\n\n**【The Core Performance Key】**\n\n* **The Character's Physicality:** Julian’s initial movements are masterpieces of control—deliberate, economical, almost robotic. He walks in straight lines; his posture is ramrod straight. After the video, this", "message": "正在根据图片和文本生成剧本..."}
|
||||
,{"status": "streaming", "content": " control must fracture subtly. A slight tremor in the hand that holds the flash drive, a new tension in his shoulders, and his measured stride should transform into a more predatory, restless pacing.\n* **Subtextual Drive:** The subtext of Julian's life before the video is: \"I will survive", "message": "正在根据图片和文本生成剧本..."}
|
||||
,{"status": "streaming", "content": " this grief by pretending it doesn't exist.\" The moment the video ends, the subtext for every subsequent action, word, and glance becomes: \"I will dismantle the world to find the truth, and in doing so, punish myself for having been blind to it.\"\n\n**【Connection to the Zeitgeist】**", "message": "正在根据图片和文本生成剧本..."}
|
||||
,{"status": "streaming", "content": "\n\n* This story of a man discovering his accepted reality is a meticulously constructed lie resonates powerfully in an era of \"alternative facts\" and digital deception, exploring the terrifying notion that the deepest truths of our lives can be hidden in plain sight.", "message": "正在根据图片和文本生成剧本..."}
|
||||
,{"status": "completed", "content": "", "message": "剧本生成完成"}
|
||||
].map(item=>{
|
||||
return item.content
|
||||
}).join('')
|
||||
)
|
||||
@ -43,7 +43,6 @@ export const useEditData = (tabType: string, originalText?: string) => {
|
||||
regenerateRole,
|
||||
uploadImageAndUpdateRole,
|
||||
saveRoleToLibrary,
|
||||
|
||||
} = useRoleServiceHook();
|
||||
|
||||
const {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user