@waterwx/dsh-novel-forge 1.7.0 → 1.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/client.js +2537 -1858
- package/lib/client.js.map +1 -1
- package/lib/index.js +657 -45
- package/lib/index.js.map +1 -1
- package/lib/types/client/api.d.ts +2 -0
- package/lib/types/client/locales.d.ts +0 -1
- package/lib/types/client/panel/FlowGuide.d.ts +21 -0
- package/lib/types/client/panel/MangaRoleLibrary.d.ts +18 -0
- package/lib/types/client/panel/MangaWorkspace.d.ts +2 -2
- package/lib/types/client/panel/StoryboardTab.d.ts +5 -1
- package/lib/types/engine.d.ts +15 -8
- package/lib/types/protocol.d.ts +124 -0
- package/package.json +2 -1
- package/src/client/api.ts +5 -0
- package/src/client/locales.ts +0 -1
- package/src/client/panel/AssetsTab.tsx +22 -22
- package/src/client/panel/AssistantTab.tsx +3 -3
- package/src/client/panel/BookshelfBar.tsx +1 -1
- package/src/client/panel/CreateBookView.tsx +10 -10
- package/src/client/panel/FlowGuide.tsx +83 -0
- package/src/client/panel/MangaRoleLibrary.tsx +810 -0
- package/src/client/panel/MangaWorkspace.tsx +359 -297
- package/src/client/panel/NovelPanel.tsx +107 -107
- package/src/client/panel/ReaderView.tsx +4 -4
- package/src/client/panel/RunPanel.tsx +8 -8
- package/src/client/panel/SceneLibrary.tsx +68 -67
- package/src/client/panel/StoryboardTab.tsx +105 -41
- package/src/client/panel/StyleCard.tsx +13 -13
- package/src/client/panel/StyleGallery.tsx +2 -2
- package/src/client/panel/WorldTab.tsx +5 -5
- package/src/client/panel/panel.module.css +861 -510
- package/src/client/panel/views.tsx +24 -24
- package/src/engine.ts +482 -51
- package/src/protocol.ts +125 -0
- package/src/routes.ts +203 -0
- package/src/client/panel/RoleVisualPanel.tsx +0 -485
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 漫剧工作台·全流程步骤条(唯一导航,方案X):
|
|
3
|
+
* ①创建方案 → ②视觉规则 → ③剧情骨架 → ④分镜表 → ⑤导入角色 → ⑥角色定妆 → ⑦视频提示词 → ⑧场景库 → ⑨导出使用。
|
|
4
|
+
* 每个步骤对应一个独立页面主体;完成度自动判定(读 project 现有字段)。
|
|
5
|
+
*/
|
|
6
|
+
import type { ProjectState } from '../../protocol.ts'
|
|
7
|
+
import css from './panel.module.css'
|
|
8
|
+
|
|
9
|
+
/** 步骤 → 页面主体的一一对应目标。 */
|
|
10
|
+
export type FlowTarget =
|
|
11
|
+
| 'plan' // ① 创建方案页
|
|
12
|
+
| 'rules' // ② 视觉规则页
|
|
13
|
+
| 'skeleton' // ③ 剧情骨架页(分镜·骨架)
|
|
14
|
+
| 'table' // ④ 分镜表页(分镜·分镜表)
|
|
15
|
+
| 'import' // ⑤ 导入角色页(角色·导入)
|
|
16
|
+
| 'makeup' // ⑥ 角色定妆页(角色·卡片)
|
|
17
|
+
| 'prompts' // ⑦ 视频提示词页(分镜·提示词)
|
|
18
|
+
| 'scenes' // ⑧ 场景库页
|
|
19
|
+
| 'export' // ⑨ 导出使用页
|
|
20
|
+
|
|
21
|
+
export interface FlowStep {
|
|
22
|
+
no: number
|
|
23
|
+
label: string
|
|
24
|
+
hint: string
|
|
25
|
+
done: boolean
|
|
26
|
+
target: FlowTarget
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/** 依据 project 数据计算 9 步完成度(与存储顺序无关,按生产顺序排列)。 */
|
|
30
|
+
export function computeFlowSteps(project: ProjectState | null): FlowStep[] {
|
|
31
|
+
const plans = project?.mangaPlans ?? []
|
|
32
|
+
const rules = project?.visualRules ?? []
|
|
33
|
+
const sbs = project?.storyboards ?? []
|
|
34
|
+
const manga = project?.mangaRoles ?? []
|
|
35
|
+
const scenes = project?.scenes ?? []
|
|
36
|
+
const hasSkeleton = sbs.some(e => e.skeleton !== undefined)
|
|
37
|
+
const hasTable = sbs.some(e => e.table !== undefined)
|
|
38
|
+
const hasPrompts = sbs.some(e => (e.prompts ?? []).length > 0)
|
|
39
|
+
return [
|
|
40
|
+
{ no: 1, label: '创建方案', hint: '选基底风格+可选滤镜并命名;此后所有提示词按此风格生成', done: plans.length > 0, target: 'plan' },
|
|
41
|
+
{ no: 2, label: '视觉规则', hint: '从道藏提炼 3-6 条视觉世界观规则,自动注入所有生图/生视频提示词', done: rules.length > 0, target: 'rules' },
|
|
42
|
+
{ no: 3, label: '剧情骨架', hint: '分镜①:本章弧线+节拍链+出场角色(characters 提名地基)', done: hasSkeleton, target: 'skeleton' },
|
|
43
|
+
{ no: 4, label: '分镜表', hint: '分镜②:骨架展开为镜头级画面(景别/机位/台词/每镜头角色)', done: hasTable, target: 'table' },
|
|
44
|
+
{ no: 5, label: '导入角色', hint: '从本集分镜提名→小说库匹配(规则+LLM 两段式)→导入为漫剧卡', done: manga.length > 0, target: 'import' },
|
|
45
|
+
{ no: 6, label: '角色定妆', hint: '生成形象锚点→精修提示词→上传/生成定妆图(status=已定妆)', done: manga.some(c => c.status === 'anchored'), target: 'makeup' },
|
|
46
|
+
{ no: 7, label: '视频提示词', hint: '分镜③:每镜头一段即梦可粘贴提示词,带风格词块与定妆绑定', done: hasPrompts, target: 'prompts' },
|
|
47
|
+
{ no: 8, label: '场景库', hint: '(选做)从正文提炼场景卡并采纳,分镜表会标注使用场景', done: scenes.length > 0, target: 'scenes' },
|
|
48
|
+
{ no: 9, label: '导出使用', hint: '复制提示词到即梦/豆包/ComfyUI 出图生视频;定妆卡按 mangaRoleIds 绑定参考图', done: hasPrompts, target: 'export' },
|
|
49
|
+
]
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export function FlowGuide({
|
|
53
|
+
project,
|
|
54
|
+
onNavigate,
|
|
55
|
+
}: {
|
|
56
|
+
project: ProjectState | null
|
|
57
|
+
onNavigate: (target: FlowTarget) => void
|
|
58
|
+
}) {
|
|
59
|
+
const steps = computeFlowSteps(project)
|
|
60
|
+
const doneCount = steps.filter(s => s.done).length
|
|
61
|
+
return (
|
|
62
|
+
<div style={{ display: 'flex', flexDirection: 'column', gap: 'var(--nf-space-6)', marginTop: 'var(--nf-space-8)' }}>
|
|
63
|
+
<div className={css.row} style={{ justifyContent: 'space-between', flexWrap: 'wrap' }}>
|
|
64
|
+
<span className={css.meta}>🧭 全流程({doneCount}/{steps.length}):每步一个页面,完成自动打勾</span>
|
|
65
|
+
<span className={css.meta}>点击步骤打开对应页面</span>
|
|
66
|
+
</div>
|
|
67
|
+
<div style={{ display: 'flex', flexWrap: 'wrap', gap: 'var(--nf-space-6)' }}>
|
|
68
|
+
{steps.map(s => (
|
|
69
|
+
<button
|
|
70
|
+
key={s.no}
|
|
71
|
+
type="button"
|
|
72
|
+
title={s.hint}
|
|
73
|
+
className={css.button + ' ' + css.buttonSmall + (s.done ? ' ' + css.buttonPrimary : '')}
|
|
74
|
+
style={{ minWidth: 0 }}
|
|
75
|
+
onClick={() => { onNavigate(s.target) }}
|
|
76
|
+
>
|
|
77
|
+
{s.done ? '✓ ' : s.no + '. '}{s.label}
|
|
78
|
+
</button>
|
|
79
|
+
))}
|
|
80
|
+
</div>
|
|
81
|
+
</div>
|
|
82
|
+
)
|
|
83
|
+
}
|