dsh-game-material-master 0.1.1 → 0.2.0

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 CHANGED
@@ -47,6 +47,13 @@ window.__ModuleLoader__.load({
47
47
  ["revealProject", true],
48
48
  ["runImage", true],
49
49
  ["runImages", true],
50
+ ["setImageMode", true],
51
+ ["runTurnVideo", true],
52
+ ["runTurnFrames", true],
53
+ ["setTurnPick", true],
54
+ ["setTurnPicks", true],
55
+ ["resetTurnPicks", true],
56
+ ["cutTurnFrames", true],
50
57
  ["runVideos", true],
51
58
  ["pollVideos", true],
52
59
  ["clearVideos", true],
@@ -472,6 +479,37 @@ window.__ModuleLoader__.load({
472
479
  .SPR_badge{font-size:11px;padding:1px 7px;border-radius:999px;background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-tertiary)}
473
480
  .SPR_videoWrap{position:relative;width:100%}
474
481
  .SPR_video{width:100%;border-radius:8px;display:block;background:#000}
482
+ /* 转圈视频多半是竖屏(角色立绘比例):按 width:100% 铺开会有上千像素高,把下面的
483
+ 时间轴与八个方向图全顶出屏幕,所以改成按高度封顶、水平居中。 */
484
+ .SPR_videoTurn{width:auto;max-width:100%;max-height:360px;margin:0 auto}
485
+ /* 双击看大图:序列帧缩略图太小,看不清动作与抠像质量 */
486
+ .SPR_zoomMask{position:fixed;inset:0;z-index:80;background:rgba(10,12,16,.84);display:flex;align-items:center;justify-content:center;padding:28px;box-sizing:border-box;cursor:zoom-out}
487
+ .SPR_zoomImg{max-width:92vw;max-height:82vh;object-fit:contain;image-rendering:pixelated;border-radius:8px;background-color:var(--dsw-alias-bg-layer-1);cursor:default;box-shadow:0 14px 44px rgba(0,0,0,.5)}
488
+ .SPR_zoomClose{position:absolute;top:16px;right:20px;width:36px;height:36px;border-radius:999px;border:1px solid rgba(255,255,255,.34);background:rgba(28,32,40,.86);color:#fff;font-size:20px;line-height:1;cursor:pointer;font-family:inherit;display:flex;align-items:center;justify-content:center;padding:0}
489
+ .SPR_zoomClose:hover{background:rgba(64,70,82,.96)}
490
+ .SPR_zoomCaption{position:absolute;left:20px;right:20px;bottom:16px;text-align:center;color:#e9ebf1;font-size:12px}
491
+ .SPR_input[data-dirty=true]{border-color:var(--dsw-alias-state-business-primary)}
492
+ /* 阶段①的生成方式切换(转圈截帧为默认,逐方向生图为备选) */
493
+ .SPR_modeBar{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:0 0 10px}
494
+ .SPR_modeBarLabel{font-size:12px;color:var(--dsw-alias-label-tertiary)}
495
+ .SPR_mode{font:inherit;font-size:12px;cursor:pointer;display:inline-flex;align-items:center;gap:6px;background:var(--dsw-alias-bg-layer-1);border:1px solid var(--dsw-alias-border-l2);border-radius:999px;padding:4px 12px;color:var(--dsw-alias-label-secondary)}
496
+ .SPR_mode[data-active=true]{color:var(--dsw-alias-label-primary);border-color:var(--dsw-alias-state-business-primary);box-shadow:0 0 0 1px color-mix(in srgb, var(--dsw-alias-state-business-primary) 28%, transparent)}
497
+ .SPR_modeTag{font-size:10px;line-height:14px;padding:0 5px;border-radius:999px;background:var(--dsw-alias-state-business-primary);color:#fff}
498
+ .SPR_modeBarHint{font-size:11px;color:var(--dsw-alias-label-tertiary)}
499
+ /* 转圈截帧的时间轴:缩略条带 + 八个可拖动的圆圈 */
500
+ .SPR_axisWrap{margin:12px 0 4px}
501
+ .SPR_axis{position:relative;border:1px solid var(--dsw-alias-border-l2);border-radius:10px;background:var(--dsw-alias-bg-layer-1);padding:34px 0 8px;touch-action:none;user-select:none}
502
+ .SPR_axis[data-dragging=true]{cursor:ew-resize}
503
+ .SPR_axisStrip{display:block;width:100%;border-radius:6px;pointer-events:none;-webkit-user-drag:none}
504
+ .SPR_axisDot{position:absolute;transform:translateX(-50%);min-width:30px;padding:2px 6px;display:flex;flex-direction:column;align-items:center;gap:0;font:inherit;font-size:11px;line-height:14px;cursor:grab;border:1px solid var(--dsw-alias-state-business-primary);border-radius:999px;background:var(--dsw-alias-bg-layer-3);color:var(--dsw-alias-label-primary);box-shadow:0 1px 3px rgba(0,0,0,.22)}
505
+ .SPR_axisDot:active{cursor:grabbing}
506
+ .SPR_axisDot[data-active=true]{box-shadow:0 0 0 2px color-mix(in srgb, var(--dsw-alias-state-business-primary) 40%, transparent)}
507
+ .SPR_axisDot[data-approved=true]{border-color:var(--dsw-alias-state-success-primary)}
508
+ .SPR_axisDot[data-approved=true] .SPR_axisDotIndex{color:var(--dsw-alias-state-success-primary)}
509
+ .SPR_axisDotLabel{font-weight:600;white-space:nowrap}
510
+ .SPR_axisDotIndex{font-size:10px;color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums}
511
+ .SPR_axisRuler{display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:11px;color:var(--dsw-alias-label-tertiary);margin-top:6px}
512
+ .SPR_axisRulerMid{text-align:center}
475
513
  .SPR_modules{display:flex;gap:8px;padding:10px 18px;border-bottom:1px solid var(--dsw-alias-border-l2);flex:none;flex-wrap:wrap}
476
514
  .SPR_module{font:inherit;cursor:pointer;text-align:left;display:flex;flex-direction:column;gap:1px;padding:6px 12px;border-radius:10px;border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-secondary)}
477
515
  .SPR_module:hover{background:var(--dsw-alias-interactive-bg-hover-solid)}
@@ -681,20 +719,65 @@ window.__ModuleLoader__.load({
681
719
  "aria-busy": busy === true ? "true" : undefined
682
720
  }, children);
683
721
  }
684
- function NumField({ label, value, onChange, min, max, step }) {
722
+ /**
723
+ * 数字参数输入框。
724
+ *
725
+ * ★ 必须**在失焦 / 回车时才提交**,不能边打字边提交:宿主那边对每个参数
726
+ * 都会 clamp(单格宽最小 16、时长最小 4 秒…),敲一个字符就提交一次的话,
727
+ * 想输入「128」会在敲下「1」的瞬间被夹成 16、输入框随即被回包覆盖——
728
+ * 表现就是「数字总跳成别的值,根本没法输入」。所以这里本地存草稿文本,
729
+ * 只在 onBlur / Enter 时解析 + 夹取 + 回调,输入过程中一个远程调用都不发。
730
+ */
731
+ function NumField({ label, value, onChange, min, max, step, hint }) {
732
+ const [text, setText] = React.useState(String(value ?? ""));
733
+ const [focused, setFocused] = React.useState(false);
734
+ // 外部值变了(宿主回包、切换项目)而用户没在输入时,同步过来。
735
+ React.useEffect(() => {
736
+ if (!focused)
737
+ setText(String(value ?? ""));
738
+ }, [value, focused]);
739
+ const commit = () => {
740
+ const parsed = Number(text);
741
+ if (text.trim() === "" || !Number.isFinite(parsed)) {
742
+ setText(String(value ?? ""));
743
+ return;
744
+ }
745
+ const clamped = Math.min(max ?? Number.POSITIVE_INFINITY, Math.max(min ?? Number.NEGATIVE_INFINITY, parsed));
746
+ setText(String(clamped));
747
+ if (clamped !== value)
748
+ onChange(clamped);
749
+ };
685
750
  return h("label", { className: "SPR_field" }, h("span", { className: "SPR_fieldLabel" }, label), h("input", {
686
751
  className: "SPR_input",
687
752
  type: "number",
688
- value: value,
753
+ inputMode: "decimal",
754
+ value: text,
689
755
  min,
690
756
  max,
691
757
  step: step === undefined ? 1 : step,
692
- onChange: (event) => {
693
- const next = Number(event.target.value);
694
- if (Number.isFinite(next))
695
- onChange(next);
758
+ "data-dirty": focused && text !== String(value ?? "") ? "true" : undefined,
759
+ onChange: (event) => setText(event.target.value),
760
+ onFocus: (event) => {
761
+ setFocused(true);
762
+ // 光标落进来就全选:改参数基本都是整份替换,省一次三击。
763
+ try {
764
+ event.target.select?.();
765
+ }
766
+ catch {
767
+ /* 个别浏览器对 number 输入框的 select 有限制,忽略即可 */
768
+ }
769
+ },
770
+ onBlur: () => {
771
+ setFocused(false);
772
+ commit();
773
+ },
774
+ onKeyDown: (event) => {
775
+ if (event.key === "Enter") {
776
+ event.preventDefault();
777
+ event.currentTarget.blur();
778
+ }
696
779
  }
697
- }));
780
+ }), hint === undefined ? null : h("span", { className: "SPR_fieldLabel" }, hint));
698
781
  }
699
782
  /**
700
783
  * 全局模型设置。生图模型 / 视频模型都是插件级设置(设置 → 游戏素材大师),
@@ -732,6 +815,67 @@ window.__ModuleLoader__.load({
732
815
  const suffix = version === undefined ? "" : `?v=${version}`;
733
816
  return `${base}${relative}${suffix}`;
734
817
  }
818
+ /**
819
+ * 双击看大图的缩略图。
820
+ *
821
+ * 序列帧缩略图按格子尺寸显示(默认 256px、像素风还会更小),肉眼根本看不清
822
+ * 动作与抠像质量——双击弹出原图,右上角「×」、点背景、按 Esc 都能关。
823
+ * 遮罩用 position:fixed,所以它在卡片内部渲染也能盖住整页。
824
+ */
825
+ function ZoomableImage({ src, alt, className, caption, style }) {
826
+ const [open, setOpen] = React.useState(false);
827
+ React.useEffect(() => {
828
+ if (!open)
829
+ return undefined;
830
+ const onKey = (event) => {
831
+ if (event.key === "Escape")
832
+ setOpen(false);
833
+ };
834
+ if (typeof window !== "undefined")
835
+ window.addEventListener("keydown", onKey);
836
+ return () => {
837
+ if (typeof window !== "undefined")
838
+ window.removeEventListener("keydown", onKey);
839
+ };
840
+ }, [open]);
841
+ const openImage = (event) => {
842
+ event.preventDefault();
843
+ event.stopPropagation();
844
+ setOpen(true);
845
+ };
846
+ return h(React.Fragment, null, h("img", {
847
+ className,
848
+ src,
849
+ alt,
850
+ style,
851
+ title: "双击看大图",
852
+ "data-zoomable": "true",
853
+ onDoubleClick: openImage
854
+ }), open
855
+ ? h("div", {
856
+ className: "SPR_zoomMask",
857
+ role: "dialog",
858
+ "aria-modal": "true",
859
+ "data-testid": "zoom-mask",
860
+ onClick: () => setOpen(false)
861
+ }, h("button", {
862
+ type: "button",
863
+ className: "SPR_zoomClose",
864
+ "aria-label": "关闭大图",
865
+ title: "关闭(Esc)",
866
+ "data-testid": "zoom-close",
867
+ onClick: (event) => {
868
+ event.stopPropagation();
869
+ setOpen(false);
870
+ }
871
+ }, "×"), h("img", {
872
+ className: "SPR_zoomImg",
873
+ src,
874
+ alt,
875
+ onClick: (event) => event.stopPropagation()
876
+ }), caption !== undefined && caption !== null ? h("div", { className: "SPR_zoomCaption" }, caption) : null)
877
+ : null);
878
+ }
735
879
  // ── 「正在调用接口」的视觉反馈 ───────────────────────────────────────
736
880
  /**
737
881
  * 点一次按钮 = 一次远程调用。调用期间界面必须看得见「在跑」,
@@ -906,7 +1050,11 @@ window.__ModuleLoader__.load({
906
1050
  setStage(intent.stage);
907
1051
  }, [intent]);
908
1052
  const busy = project !== null && ((project.jobs?.length ?? 0) > 0 ||
909
- DIRECTION_KEYS.some((key) => project.videos?.[key]?.status === "running"));
1053
+ DIRECTION_KEYS.some((key) => project.videos?.[key]?.status === "running") ||
1054
+ // 转圈视频是「提交完就返回」的后台任务:kick 的那条记录在提交结束时就撤了,
1055
+ // 之后只剩节点自己还是 running。不把它算进来,界面在几分钟的等视频期间
1056
+ // 一次都不会刷新(宿主其实一直在轮询),看着就像卡住了。
1057
+ project.turn?.video?.status === "running");
910
1058
  // 轮询条件也要算上正在跑的这一次调用,否则点完按钮到 running 落盘之间不会刷新。
911
1059
  const polling = busy || tasks.active;
912
1060
  const refreshProjects = React.useCallback(async () => {
@@ -1125,7 +1273,10 @@ window.__ModuleLoader__.load({
1125
1273
  ? "var(--dsw-alias-state-success-primary)"
1126
1274
  : "var(--dsw-alias-label-tertiary)"
1127
1275
  }
1128
- }), item.title))), h("div", { className: "SPR_card" }, h("div", { className: "SPR_cardHead" }, h("h3", null, activeStage.title)), h("p", { className: "SPR_hint" }, activeStage.hint), stage === "images"
1276
+ }), item.title))), h("div", { className: "SPR_card" }, h("div", { className: "SPR_cardHead" }, h("h3", null, activeStage.title)),
1277
+ // 阶段①的说明跟着生成方式走:转圈截帧不是「八个方向各生成一次」,
1278
+ // 沿用逐方向生图那句话会让人以为走错了页面。
1279
+ h("p", { className: "SPR_hint" }, stageHint(project, stage, activeStage)), stage === "images"
1129
1280
  ? renderImageStage({
1130
1281
  project,
1131
1282
  api,
@@ -1204,6 +1355,13 @@ window.__ModuleLoader__.load({
1204
1355
  ? h(SequenceModule, { api })
1205
1356
  : h(RigModule, { api }));
1206
1357
  }
1358
+ /** 阶段卡片下方的说明文字(阶段①有两种生成方式,各说各的)。 */
1359
+ function stageHint(project, stage, activeStage) {
1360
+ if (stage === "images" && imageModeOf(project) === "turn") {
1361
+ return "先生成一段「角色原地匀速转一整圈」的绿幕视频,再按时间截出八个方向的帧;下面时间轴上的八个圆圈就是各自的截帧位置,拖动即可改。";
1362
+ }
1363
+ return activeStage.hint;
1364
+ }
1207
1365
  function stageDone(project, key) {
1208
1366
  if (key === "images")
1209
1367
  return DIRECTION_KEYS.every((k) => project.images?.[k]?.approved);
@@ -1221,8 +1379,309 @@ window.__ModuleLoader__.load({
1221
1379
  const KEY_IMG_ALL = "image:*all";
1222
1380
  const KEY_IMG_REGENERATE = "image:*regenerate";
1223
1381
  const KEY_PROMPT_RESET = "prompt:*reset";
1382
+ // ── 阶段①的另一种生成方式:转圈截帧 ──────────────────────────────────
1383
+ //
1384
+ // 逐方向生图是八次独立调用,模型每次都要重新「理解」角色,脸型/发色/服装
1385
+ // 容易在八个方向之间漂移。转圈截帧只生成**一段**「原地匀速转一整圈」的视频,
1386
+ // 八个方向是它时间轴上的八个截帧位置——八个方向天生同源,一致性最好。
1387
+ // 这条是默认路径,逐方向生图保留为备选(单张更清晰,但一致性看运气)。
1388
+ const IMAGE_MODES = [
1389
+ { key: "turn", title: "转圈截帧", hint: "先生成一段「原地匀速转一整圈」的视频,再按时间截出八个方向(默认,一致性最好)" },
1390
+ { key: "direct", title: "逐方向生图", hint: "每个方向单独生图(备选:单张更清晰,但八个方向容易不一致)" }
1391
+ ];
1392
+ const KEY_TURN_VIDEO = "turn:*video";
1393
+ const KEY_TURN_FRAMES = "turn:*frames";
1394
+ const KEY_TURN_PICK = (key) => `turn:pick:${key}`;
1395
+ const TURN_FRAME_MIN = 8;
1396
+ const TURN_FRAME_MAX = 64;
1397
+ /**
1398
+ * 项目用的是哪种生成方式。
1399
+ *
1400
+ * 宿主 `normalizeProject` 一定会补齐 `imageMode`;这里再兜一层是给**渲染桩数据**
1401
+ * 用的(测试里的项目对象不经过宿主),也是给「字段还不存在的老项目」用的:
1402
+ * 已经有图就按逐方向生图走,否则走默认的转圈截帧。
1403
+ */
1404
+ function imageModeOf(project) {
1405
+ if (project?.imageMode === "direct")
1406
+ return "direct";
1407
+ if (project?.imageMode === "turn")
1408
+ return "turn";
1409
+ const hasImages = DIRECTION_KEYS.some((key) => project?.images?.[key]?.file !== undefined);
1410
+ return hasImages ? "direct" : "turn";
1411
+ }
1412
+ /** 方向的短名(轴上的圆圈放不下「西南 · 四分之三正面」这种长标签)。 */
1413
+ function shortLabelOf(key) {
1414
+ const label = LABEL_OF[key] ?? key;
1415
+ return label.split(" · ")[0];
1416
+ }
1417
+ function clamp01(value) {
1418
+ return Math.min(1, Math.max(0, value));
1419
+ }
1420
+ /** 阶段①的生成方式切换条。 */
1421
+ function ImageModeBar({ project, api, start, mode }) {
1422
+ return h("div", { className: "SPR_modeBar" }, h("span", { className: "SPR_modeBarLabel" }, "生成方式"), IMAGE_MODES.map((entry) => h("button", {
1423
+ key: entry.key,
1424
+ type: "button",
1425
+ className: "SPR_mode",
1426
+ "data-active": mode === entry.key ? "true" : "false",
1427
+ title: entry.hint,
1428
+ "data-testid": `image-mode-${entry.key}`,
1429
+ onClick: () => void start(() => api.setImageMode({ projectId: project.id, mode: entry.key }), { reload: true })
1430
+ }, h("span", { className: "SPR_modeTitle" }, entry.title), entry.key === "turn" ? h("span", { className: "SPR_modeTag" }, "默认") : null)), h("span", { className: "SPR_modeBarHint" }, (IMAGE_MODES.find((entry) => entry.key === mode) ?? IMAGE_MODES[0]).hint));
1431
+ }
1432
+ /**
1433
+ * 八个截帧位置的时间轴。
1434
+ *
1435
+ * 轴底是整圈候选帧的缩略条带,「对着画面拖圆圈」是唯一不需要解释的交互——
1436
+ * 拖到哪个位置,那个方向就切那一帧。松手才提交(拖动过程只改本地状态),
1437
+ * 所以一次拖动最多只触发一次重切。方向键 ←/→ 也能逐个候选帧地微调。
1438
+ */
1439
+ function TurnAxis({ project, total, duration, picks, images, api, start, busy }) {
1440
+ const trackRef = React.useRef(null);
1441
+ // 拖动过程只改这份本地状态(圆圈跟着手走),松手才提交一次远程调用。
1442
+ const [drag, setDrag] = React.useState(null);
1443
+ const pickOf = (key) => {
1444
+ if (drag !== null && drag.key === key)
1445
+ return drag.index;
1446
+ return Math.min(total - 1, Math.max(0, Number(picks?.[key] ?? 0)));
1447
+ };
1448
+ const indexFromEvent = (event) => {
1449
+ const node = trackRef.current;
1450
+ if (node === null || total <= 0)
1451
+ return 0;
1452
+ const rect = node.getBoundingClientRect();
1453
+ if (rect.width <= 0)
1454
+ return 0;
1455
+ const fraction = clamp01((event.clientX - rect.left) / rect.width);
1456
+ return Math.min(total - 1, Math.max(0, Math.round(fraction * total - 0.5)));
1457
+ };
1458
+ const commit = (key, index) => {
1459
+ const current = Math.min(total - 1, Math.max(0, Number(picks?.[key] ?? 0)));
1460
+ if (index === current)
1461
+ return;
1462
+ void start(() => api.setTurnPick({ projectId: project.id, key, index }), { reload: true }, { key: KEY_TURN_PICK(key), label: `正在切出「${LABEL_OF[key] ?? key}」第 ${index + 1} 帧…` });
1463
+ };
1464
+ const nudge = (key, delta) => {
1465
+ const next = Math.min(total - 1, Math.max(0, Number(picks?.[key] ?? 0) + delta));
1466
+ commit(key, next);
1467
+ };
1468
+ // 两个方向被拖到同一帧时会叠在一起,往上错一层;顺序不变,只是看起来分明。
1469
+ const lanes = {};
1470
+ const used = [];
1471
+ [...DIRECTION_KEYS]
1472
+ .map((key) => ({ key, index: pickOf(key) }))
1473
+ .sort((a, b) => a.index - b.index)
1474
+ .forEach((item) => {
1475
+ let lane = 0;
1476
+ while (used.some((slot) => slot.lane === lane && Math.abs(slot.index - item.index) < 2))
1477
+ lane++;
1478
+ used.push({ lane, index: item.index });
1479
+ lanes[item.key] = lane;
1480
+ });
1481
+ return h("div", { className: "SPR_axisWrap" }, h("div", {
1482
+ className: "SPR_axis",
1483
+ ref: trackRef,
1484
+ "data-dragging": drag === null ? undefined : "true",
1485
+ onPointerMove: (event) => {
1486
+ if (drag === null)
1487
+ return;
1488
+ const index = indexFromEvent(event);
1489
+ if (index !== drag.index)
1490
+ setDrag({ key: drag.key, index });
1491
+ },
1492
+ onPointerUp: (event) => {
1493
+ if (drag === null)
1494
+ return;
1495
+ const index = indexFromEvent(event);
1496
+ const key = drag.key;
1497
+ setDrag(null);
1498
+ commit(key, index);
1499
+ },
1500
+ onPointerLeave: () => {
1501
+ if (drag === null)
1502
+ return;
1503
+ setDrag(null);
1504
+ }
1505
+ }, h("img", {
1506
+ className: "SPR_axisStrip",
1507
+ src: assetUrl(project, project.turn?.frames?.strip, project.turn?.frames?.updatedAt),
1508
+ alt: "整圈候选帧",
1509
+ draggable: false
1510
+ }), DIRECTION_KEYS.map((key) => {
1511
+ const index = pickOf(key);
1512
+ const approved = images?.[key]?.approved === true;
1513
+ const active = drag !== null && drag.key === key;
1514
+ const time = duration > 0 && total > 0 ? (index * duration) / total : 0;
1515
+ return h("button", {
1516
+ key,
1517
+ type: "button",
1518
+ className: "SPR_axisDot",
1519
+ "data-active": active ? "true" : "false",
1520
+ "data-approved": approved ? "true" : "false",
1521
+ "data-dragging": busy === true ? "true" : undefined,
1522
+ "data-testid": `turn-dot-${key}`,
1523
+ style: { left: `${((index + 0.5) / Math.max(1, total)) * 100}%`, top: `${6 + (lanes[key] ?? 0) * 26}px` },
1524
+ title: `${LABEL_OF[key] ?? key}:第 ${index + 1}/${total} 帧(${time.toFixed(2)} 秒)— 拖动改位置,←/→ 微调`,
1525
+ "aria-label": `${LABEL_OF[key] ?? key} 第 ${index + 1} 帧`,
1526
+ onPointerDown: (event) => {
1527
+ event.preventDefault();
1528
+ setDrag({ key, index });
1529
+ try {
1530
+ event.currentTarget.setPointerCapture?.(event.pointerId);
1531
+ }
1532
+ catch {
1533
+ /* 指针捕获失败不影响拖动:move/up 挂在轴上 */
1534
+ }
1535
+ },
1536
+ onKeyDown: (event) => {
1537
+ if (event.key !== "ArrowLeft" && event.key !== "ArrowRight")
1538
+ return;
1539
+ event.preventDefault();
1540
+ nudge(key, event.key === "ArrowLeft" ? -1 : 1);
1541
+ }
1542
+ }, h("span", { className: "SPR_axisDotLabel" }, shortLabelOf(key)), h("span", { className: "SPR_axisDotIndex" }, `${index + 1}`));
1543
+ })), h("div", { className: "SPR_axisRuler" }, h("span", null, "0 秒"), h("span", { className: "SPR_axisRulerMid" }, total > 0
1544
+ ? `共 ${total} 张候选帧 · 每张约 ${(duration / total).toFixed(2)} 秒 —— 拖动圆圈调整每个方向截在哪一帧`
1545
+ : "还没有候选帧:先点「生成转圈视频」,视频到手会自动抽帧"), h("span", null, `${duration.toFixed(2)} 秒`)));
1546
+ }
1547
+ /** 转圈截帧:转圈视频 → 候选帧 → 八圆圈时间轴 → 八张方向图。 */
1548
+ function TurnImageStage({ project, api, start, setNotice, tasks, savePrompts }) {
1549
+ const video = project.turn?.video ?? {};
1550
+ const frames = project.turn?.frames ?? {};
1551
+ const total = Array.isArray(frames.frames) ? frames.frames.length : 0;
1552
+ const duration = Number(frames.duration ?? 0);
1553
+ const picks = frames.picks ?? {};
1554
+ const [promptDraft, setPromptDraft] = React.useState(project.prompts?.turn ?? "");
1555
+ const [countDraft, setCountDraft] = React.useState(null);
1556
+ React.useEffect(() => {
1557
+ setPromptDraft(project.prompts?.turn ?? "");
1558
+ }, [project.prompts?.turn]);
1559
+ const videoRunning = video.status === "running" || tasks.has(KEY_TURN_VIDEO);
1560
+ const videoLabel = tasks.label(KEY_TURN_VIDEO) ?? (video.remoteStatus ?? "正在生成转圈视频…");
1561
+ // 「在切帧」= 本地刚点下去 / 宿主那批抽帧还在跑。抽帧是 kick 型调用,
1562
+ // 一提交就返回,真正的活(抽 32 张 + 切 8 张图)在后台,所以两者都要看。
1563
+ const hostFrames = hostJob(project, "turn:frames");
1564
+ const cutting = frames.status === "running" || tasks.has(KEY_TURN_FRAMES) || hostFrames !== undefined;
1565
+ const cutLabel = tasks.label(KEY_TURN_FRAMES) ?? (frames.status === "running" ? "正在抽取候选帧…" : "正在抽取候选帧并切出八个方向…");
1566
+ const promptDirty = promptDraft !== (project.prompts?.turn ?? "");
1567
+ const frameCount = Number(countDraft ?? project.settings?.turnFrameCount ?? 32);
1568
+ const allApproved = DIRECTION_KEYS.every((key) => project.images?.[key]?.approved);
1569
+ const readyImages = DIRECTION_KEYS.filter((key) => project.images?.[key]?.file !== undefined).length;
1570
+ const stale = frames.stale === true;
1571
+ return h(React.Fragment, null, h("p", { className: "SPR_hint" }, "先生成一段「角色原地匀速转一整圈」的视频(绿幕、保持原图风格、除旋转外不做任何动作),再按时间截出八个方向的帧。八个方向出自同一段视频,一致性比逐方向生图好得多;下面时间轴上的八个圆圈就是各自的截帧位置,随便拖。"), h("textarea", {
1572
+ className: "SPR_area",
1573
+ value: promptDraft,
1574
+ "data-testid": "turn-prompt",
1575
+ onChange: (event) => setPromptDraft(event.target.value)
1576
+ }), h("div", { className: "SPR_toolbar" }, h(Btn, { disabled: !promptDirty, onClick: () => void savePrompts({ turn: promptDraft }) }, promptDirty ? "保存转圈提示词" : "转圈提示词已保存"), h(Btn, {
1577
+ onClick: () => void start(() => api.savePrompts({ projectId: project.id, resetTurnToDefault: true }), {
1578
+ reload: true,
1579
+ notice: "转圈提示词已重置为默认模板",
1580
+ noticeKind: "ok"
1581
+ })
1582
+ }, "重置为默认")), h("div", { className: "SPR_toolbar" }, h(BusyBtn, {
1583
+ primary: video.file === undefined,
1584
+ busy: tasks.has(KEY_TURN_VIDEO),
1585
+ busyText: "正在提交…",
1586
+ disabled: project.source === null || videoRunning,
1587
+ onClick: () => void start(() => api.runTurnVideo({ projectId: project.id }), { reload: true }, {
1588
+ key: KEY_TURN_VIDEO,
1589
+ label: "正在提交转圈视频任务…"
1590
+ })
1591
+ }, video.file === undefined
1592
+ ? "生成转圈视频(计费一次)"
1593
+ : videoRunning
1594
+ ? "转圈视频生成中…"
1595
+ : "重新生成转圈视频(计费一次)"), h(BusyBtn, {
1596
+ busy: tasks.has(KEY_TURN_FRAMES),
1597
+ busyText: "正在抽帧…",
1598
+ disabled: video.file === undefined || cutting,
1599
+ onClick: () => void start(() => api.runTurnFrames({ projectId: project.id }), { reload: true }, {
1600
+ key: KEY_TURN_FRAMES,
1601
+ label: "正在抽取候选帧并切出八个方向…"
1602
+ })
1603
+ }, total > 0 ? `重新抽帧(当前 ${total} 张)` : "抽取候选帧"), h(NumField, {
1604
+ label: "候选帧数(8~64)",
1605
+ value: frameCount,
1606
+ min: TURN_FRAME_MIN,
1607
+ max: TURN_FRAME_MAX,
1608
+ onChange: (value) => setCountDraft(value)
1609
+ }), h(BusyBtn, {
1610
+ busy: tasks.has(KEY_TURN_FRAMES),
1611
+ busyText: "正在抽帧…",
1612
+ disabled: video.file === undefined || cutting || countDraft === null || countDraft === project.settings?.turnFrameCount,
1613
+ onClick: () => void start(() => api.runTurnFrames({ projectId: project.id, count: frameCount }), { reload: true, notice: `已按 ${frameCount} 张重抽候选帧`, noticeKind: "ok" }, {
1614
+ key: KEY_TURN_FRAMES,
1615
+ label: `正在按 ${frameCount} 张重抽候选帧…`
1616
+ })
1617
+ }, "应用帧数"), h("span", { className: "SPR_refRow" }, project.settings?.turnFrameCount === frameCount ? `当前 ${project.settings?.turnFrameCount ?? "—"} 张` : `未应用(当前 ${project.settings?.turnFrameCount ?? "—"} 张)`)), h("div", { className: "SPR_toolbar" }, h(Btn, {
1618
+ disabled: total === 0 || cutting,
1619
+ onClick: () => void start(() => api.resetTurnPicks({ projectId: project.id }), { reload: true, notice: "八个圆圈已回到默认等分位置", noticeKind: "ok" })
1620
+ }, "重置八个圆圈"), h(Btn, {
1621
+ disabled: total === 0 || cutting,
1622
+ title: "转圈方向决定默认位置怎么排;拖动过的圆圈以你的位置为准",
1623
+ onClick: () => void start(() => api.resetTurnPicks({ projectId: project.id, direction: project.turn?.direction === "ccw" ? "cw" : "ccw" }), {
1624
+ reload: true,
1625
+ notice: project.turn?.direction === "ccw" ? "已改为顺时针并重排八个圆圈" : "已改为逆时针并重排八个圆圈",
1626
+ noticeKind: "ok"
1627
+ })
1628
+ }, project.turn?.direction === "ccw" ? "转圈方向:逆时针(点一下换向)" : "转圈方向:顺时针(点一下换向)"), h(Btn, {
1629
+ on: allApproved,
1630
+ disabled: readyImages === 0,
1631
+ onClick: () => void start(() => api.setApproved({ projectId: project.id, stage: "images", approved: !allApproved }), { reload: true })
1632
+ }, allApproved ? "取消全部通过" : "全部标记通过"), h(BusyBadge, { show: videoRunning || cutting, text: videoRunning ? videoLabel : cutLabel })), video.file !== undefined
1633
+ ? h("div", { className: "SPR_videoWrap" }, h(MediaBox, {
1634
+ overlay: videoRunning,
1635
+ text: videoLabel,
1636
+ children: h("video", {
1637
+ className: "SPR_video SPR_videoTurn",
1638
+ src: assetUrl(project, video.file, video.updatedAt),
1639
+ controls: true,
1640
+ preload: "metadata",
1641
+ "data-testid": "turn-video"
1642
+ })
1643
+ }))
1644
+ : h("div", { className: "SPR_thumbEmpty", style: { aspectRatio: "16/9" } }, videoRunning ? "正在生成转圈视频…" : "还没有转圈视频:点上面的「生成转圈视频」"), video.error !== undefined ? h("p", { className: "SPR_error" }, video.error) : null, h("div", { className: "SPR_refRow" }, `首帧用的是${video.firstFrame !== undefined && String(video.firstFrame).startsWith("images/") ? "已生成的正面绿幕图" : "上传的源图"}:${video.firstFrame ?? "—"}`), total > 0
1645
+ ? h(TurnAxis, {
1646
+ project,
1647
+ total,
1648
+ duration,
1649
+ picks,
1650
+ images: project.images,
1651
+ api,
1652
+ start,
1653
+ busy: cutting
1654
+ })
1655
+ : h("div", { className: "SPR_thumbEmpty", style: { marginTop: 10 } }, cutting ? "正在抽取候选帧…" : stale ? "候选帧已过期(转圈视频换过了):点「重新抽帧」" : "还没有候选帧"), frames.error !== undefined ? h("p", { className: "SPR_error" }, frames.error) : null, h("div", { className: "SPR_grid", style: { marginTop: 12 } }, DIRECTION_KEYS.map((key) => {
1656
+ const node = project.images?.[key];
1657
+ const index = Math.min(Math.max(0, total - 1), Math.max(0, Number(picks[key] ?? 0)));
1658
+ const queued = (tasks.has(KEY_TURN_FRAMES) || jobCovers(hostFrames, key)) && node?.status !== "error";
1659
+ const nodeBusy = node?.status === "running" || tasks.has(KEY_TURN_PICK(key)) || queued;
1660
+ const overlayText = tasks.label(KEY_TURN_PICK(key)) ?? (queued ? cutLabel : "正在切出这一帧…");
1661
+ return h("div", { key, className: "SPR_node", "data-busy": nodeBusy ? "true" : undefined }, h("div", { className: "SPR_nodeTop" }, h("span", { className: "SPR_nodeTitle" }, LABEL_OF[key] ?? key), nodeBusy ? h(Chip, { kind: "running", text: "切帧中" }) : h(StatusChip, { node })), node?.file !== undefined
1662
+ ? h(MediaBox, { overlay: nodeBusy, text: overlayText }, h("img", { className: "SPR_thumb", src: assetUrl(project, node.file, node.updatedAt ?? project.updatedAt), alt: LABEL_OF[key] ?? key }))
1663
+ : h("div", { className: "SPR_thumbEmpty" }, nodeBusy ? "正在切出这一帧…" : "还没有这一方向的图"), node?.error !== undefined ? h("p", { className: "SPR_error" }, node.error) : null, h("span", { className: "SPR_refRow" }, total > 0
1664
+ ? `第 ${index + 1}/${total} 帧 · ${((index * duration) / Math.max(1, total)).toFixed(2)} 秒`
1665
+ : "等待候选帧"), h("div", { className: "SPR_btnRow" }, h(Btn, {
1666
+ disabled: node?.status !== "ready" || nodeBusy,
1667
+ on: node?.approved === true,
1668
+ onClick: () => void start(() => api.setApproved({
1669
+ projectId: project.id,
1670
+ stage: "images",
1671
+ key,
1672
+ approved: node?.approved !== true
1673
+ }), { reload: true })
1674
+ }, node?.approved === true ? "已通过" : "通过")));
1675
+ })));
1676
+ }
1224
1677
  function renderImageStage(ctx) {
1225
1678
  const { project, api, promptDraft, setPromptDraft, promptOpen, setPromptOpen, savePrompts, start, setNotice, tasks } = ctx;
1679
+ const mode = imageModeOf(project);
1680
+ const modeBar = h(ImageModeBar, { project, api, start, mode });
1681
+ // 转圈截帧(默认):整条链路都在 TurnImageStage 里,产物同样是 images/<方向>.png。
1682
+ if (mode === "turn") {
1683
+ return h(React.Fragment, null, modeBar, h(TurnImageStage, { project, api, start, setNotice, tasks, savePrompts }));
1684
+ }
1226
1685
  const allApproved = DIRECTION_KEYS.every((key) => project.images?.[key]?.approved);
1227
1686
  // 「一键生成全部」/「全部重新生成」提交后,八个方向都可能要重出图,
1228
1687
  // 在宿主状态回来之前先整体盖住,别让用户以为按钮没生效。
@@ -1233,7 +1692,7 @@ window.__ModuleLoader__.load({
1233
1692
  const hostAll = hostJob(project, "images:all");
1234
1693
  const batchBusy = batch || hostAll !== undefined;
1235
1694
  const resetting = tasks.has(KEY_PROMPT_RESET);
1236
- return h(React.Fragment, null, h("div", { className: "SPR_toolbar" }, h(BusyBtn, {
1695
+ return h(React.Fragment, null, modeBar, h("div", { className: "SPR_toolbar" }, h(BusyBtn, {
1237
1696
  primary: true,
1238
1697
  busy: tasks.has(KEY_IMG_ALL),
1239
1698
  busyText: "正在提交全部方向…",
@@ -1464,7 +1923,8 @@ window.__ModuleLoader__.load({
1464
1923
  min: 1,
1465
1924
  max: 8,
1466
1925
  onChange: (value) => saveSettings({ concurrency: value })
1467
- })), h("p", { className: "SPR_hint" }, "抽帧抽到的是「工作尺寸」(长边上限),不是最终格子尺寸。自动裁剪、统一缩放和像素量化都在第 4 步做,这样八个方向才能共享同一个裁剪框、脚底对齐同一条基线。改完这里需要重新抽帧。"), h("div", { className: "SPR_toolbar" }, h(BusyBtn, {
1926
+ })), h("p", { className: "SPR_hint" }, "抽帧抽到的是「工作尺寸」(长边上限),不是最终格子尺寸。自动裁剪、统一缩放和像素量化都在第 4 步做,这样八个方向才能共享同一个裁剪框、脚底对齐同一条基线。改完这里需要重新抽帧。" +
1927
+ "预览带是**双击看大图**:格子尺寸只有 256px,看不清动作和抠像质量。"), h("div", { className: "SPR_toolbar" }, h(BusyBtn, {
1468
1928
  primary: true,
1469
1929
  busy: tasks.has(KEY_FRAMES_ALL),
1470
1930
  busyText: "正在抽取全部序列帧…",
@@ -1488,7 +1948,12 @@ window.__ModuleLoader__.load({
1488
1948
  const nodeBusy = node?.status === "running" || tasks.has(taskKey) || queued;
1489
1949
  const overlayText = tasks.label(taskKey) ?? (queued ? batchLabel : undefined) ?? "正在抽取序列帧…";
1490
1950
  return h("div", { key: direction.key, className: "SPR_node", "data-busy": nodeBusy ? "true" : undefined }, h("div", { className: "SPR_nodeTop" }, h("span", { className: "SPR_nodeTitle" }, direction.label), nodeBusy ? h(Chip, { kind: "running", text: "抽帧中" }) : h(StatusChip, { node })), node?.strip !== undefined
1491
- ? h(MediaBox, { overlay: nodeBusy, text: overlayText }, h("img", { className: "SPR_thumb", src: assetUrl(project, node.strip, node.updatedAt), alt: `${direction.label} 序列帧` }))
1951
+ ? h(MediaBox, { overlay: nodeBusy, text: overlayText }, h(ZoomableImage, {
1952
+ className: "SPR_thumb",
1953
+ src: assetUrl(project, node.strip, node.updatedAt),
1954
+ alt: `${direction.label} 序列帧`,
1955
+ caption: `${direction.label} · ${node.frames?.length ?? 0} 帧 · 视频 ${(node.duration ?? 0).toFixed(2)} 秒(点「×」/ 背景 / Esc 关闭)`
1956
+ }))
1492
1957
  : h("div", { className: "SPR_thumbEmpty" }, nodeBusy ? "正在抽帧…" : "尚未抽帧"), nodeBusy ? h(BusyBadge, { show: true, text: overlayText }) : null, node?.duration !== undefined
1493
1958
  ? h("span", { className: "SPR_refRow" }, `${node.frames?.length ?? 0} 帧 · 视频 ${node.duration.toFixed(2)} 秒`)
1494
1959
  : null, node?.error !== undefined ? h("p", { className: "SPR_error" }, node.error) : null, h("div", { className: "SPR_btnRow" }, h(BusyBtn, {
@@ -1519,10 +1984,15 @@ window.__ModuleLoader__.load({
1519
1984
  function renderSheetStage(ctx) {
1520
1985
  const { project, settingsDraft, setSettingsDraft, saveSettings, start, api, tasks } = ctx;
1521
1986
  const draft = settingsDraft ?? project.settings ?? {};
1987
+ // 用户会问「第 3 步不是已经抠过了吗」,所以这里把两处抠像的分工讲清楚:
1988
+ // 第 3 步抠的是**每个方向的预览带**(顺手把整图也合出来),第 4 步在同样的
1989
+ // 帧缓存上重抠一遍,只是为了让上面那十个参数改完立刻生效、不必重新抽帧。
1990
+ // 两处读的是同一份 raw.bin、同一套参数,所以结果永远一致。
1522
1991
  const rowOrder = Array.isArray(draft.rowOrder) && draft.rowOrder.length > 0 ? draft.rowOrder : DIRECTION_KEYS;
1523
1992
  const framesReady = DIRECTION_KEYS.filter((key) => project.frames?.[key]?.status === "ready").length;
1524
1993
  // 合成整图是本地 CPU 重活,宿主侧会标 running;重抠像同样走这个状态。
1525
1994
  const composing = project.sheet?.status === "running" || tasks.has(KEY_SHEET_COMPOSE) || tasks.has(KEY_SHEET_REKEY);
1995
+ const keyed = project.sheet?.backgroundFraction;
1526
1996
  const composeLabel = tasks.label(KEY_SHEET_REKEY) ?? tasks.label(KEY_SHEET_COMPOSE) ?? "正在抠绿幕并合成整图…";
1527
1997
  const moveRow = (index, delta) => {
1528
1998
  const next = [...rowOrder];
@@ -1535,7 +2005,8 @@ window.__ModuleLoader__.load({
1535
2005
  setSettingsDraft({ ...draft, rowOrder: next });
1536
2006
  void saveSettings({ rowOrder: next });
1537
2007
  };
1538
- return h(React.Fragment, null, h("div", { className: "SPR_fields" }, h(NumField, {
2008
+ return h(React.Fragment, null, h("p", { className: "SPR_hint" }, "抠像在这里会**再跑一次**:第 3 步那次抠的是每个方向的预览带(顺便把整图合出来),这里重抠是为了让下面这些参数改完立刻生效——两次读的是同一份帧缓存(raw.bin)、同一套参数,所以结果一致。" +
2009
+ "改完参数会自动重新抠像并合成整图,不需要重新抽帧。"), h("div", { className: "SPR_fields" }, h(NumField, {
1539
2010
  label: "整图单格宽(px)",
1540
2011
  value: draft.cellWidth ?? 256,
1541
2012
  min: 16,
@@ -1659,11 +2130,16 @@ window.__ModuleLoader__.load({
1659
2130
  disabled: project.sheet?.status !== "ready" || composing,
1660
2131
  onClick: () => void start(() => api.setApproved({ projectId: project.id, stage: "sheet", approved: project.sheet?.approved !== true }), { reload: true })
1661
2132
  }, project.sheet?.approved === true ? "整图已通过" : "整图通过")), project.sheet?.error !== undefined ? h("p", { className: "SPR_error" }, project.sheet.error) : null, h("div", { style: { display: "flex", gap: 18, alignItems: "flex-start", flexWrap: "wrap" } }, h("div", { className: "SPR_rowOrder" }, h("span", { className: "SPR_fieldLabel" }, "行序(第 1 行在最上方)"), rowOrder.map((key, index) => h("div", { key: `${key}-${index}`, className: "SPR_rowOrderItem" }, h("span", { className: "SPR_rowOrderIdx" }, String(index + 1)), h("span", { className: "SPR_rowOrderName" }, LABEL_OF[key] ?? key), h("button", { type: "button", className: "SPR_miniBtn", disabled: index === 0 || composing, onClick: () => moveRow(index, -1) }, "↑"), h("button", { type: "button", className: "SPR_miniBtn", disabled: index === rowOrder.length - 1 || composing, onClick: () => moveRow(index, 1) }, "↓")))), h("div", { style: { flex: 1, minWidth: 300 } }, project.sheet?.file !== undefined
1662
- ? h(React.Fragment, null, h("p", { className: "SPR_hint" }, `输出 ${project.sheet.width}×${project.sheet.height} 像素 · 单格 ${draft.cellWidth}×${draft.cellHeight} · 每行 ${draft.frameCount ?? 8} 帧`), h("div", { className: "SPR_sheetWrap", style: { position: "relative" } }, h("img", {
2133
+ ? h(React.Fragment, null, h("p", { className: "SPR_hint" }, `输出 ${project.sheet.width}×${project.sheet.height} 像素 · 单格 ${draft.cellWidth}×${draft.cellHeight} · 每行 ${draft.frameCount ?? 8} 帧` +
2134
+ (keyed === undefined ? "" : ` · 抠掉的背景占 ${(keyed * 100).toFixed(1)}%`) +
2135
+ ((project.sheet?.borderSamplesDropped ?? 0) > 0
2136
+ ? ` · 边框采样排除了 ${project.sheet.borderSamplesDropped} 个不属于背景主色的点(角色贴边)`
2137
+ : "")), h("div", { className: "SPR_sheetWrap", style: { position: "relative" } }, h(ZoomableImage, {
1663
2138
  className: "SPR_sheet",
1664
2139
  src: assetUrl(project, project.sheet.file, project.sheet.generatedAt),
1665
2140
  alt: "整图",
1666
- style: { visibility: composing ? "hidden" : undefined }
2141
+ style: { visibility: composing ? "hidden" : undefined },
2142
+ caption: `整图 ${project.sheet.width}×${project.sheet.height} · 单格 ${draft.cellWidth}×${draft.cellHeight}(点「×」/ 背景 / Esc 关闭)`
1667
2143
  }), h(LoadingOverlay, { show: composing, text: composeLabel, sub: "本地抠像 + 合成,不上传" })))
1668
2144
  : h("div", { style: { position: "relative", minHeight: 160 } }, h("p", { className: "SPR_empty" }, composing ? "正在生成第一张整图…" : framesReady === 0 ? "请先完成第 3 步的抽帧" : "还没有合成整图"), h(LoadingOverlay, { show: composing, text: composeLabel })))));
1669
2145
  }
@@ -2437,7 +2913,13 @@ window.__ModuleLoader__.load({
2437
2913
  ? h("div", { className: "SPR_sheetWrap", style: { position: "relative" } }, h("img", { className: "SPR_sheet", src: `${job.assetBase}${job.sheet.file}?v=${job.sheet.updatedAt}`, alt: "序列帧条图", style: { visibility: composing ? "hidden" : undefined } }), h(LoadingOverlay, { show: composing, text: composeText }))
2438
2914
  : null, frameUrls.length === 0
2439
2915
  ? null
2440
- : h("div", { className: "SPR_frames" }, frameUrls.map((url, index) => h("img", { key: index, className: "SPR_frame", src: url, alt: `第 ${index + 1} 帧` })))), h("div", { className: "SPR_card" }, h("div", { className: "SPR_cardHead" }, h("h3", null, "⑤ 验收")), h("p", { className: "SPR_hint" }, "三步各自打「通过」。对话里的 agent 读写同一份标记:选「每一步人工审核」时,它会等你通过才继续。"), h(ReviewModeBar, { api, module: "sequence", id: job.id, mode: job.reviewMode, onChanged: () => void load(job.id) }), [
2916
+ : h("div", { className: "SPR_frames" }, frameUrls.map((url, index) => h(ZoomableImage, {
2917
+ key: index,
2918
+ className: "SPR_frame",
2919
+ src: url,
2920
+ alt: `第 ${index + 1} 帧`,
2921
+ caption: `第 ${index + 1} / ${frameUrls.length} 帧(点「×」/ 背景 / Esc 关闭)`
2922
+ })))), h("div", { className: "SPR_card" }, h("div", { className: "SPR_cardHead" }, h("h3", null, "⑤ 验收")), h("p", { className: "SPR_hint" }, "三步各自打「通过」。对话里的 agent 读写同一份标记:选「每一步人工审核」时,它会等你通过才继续。"), h(ReviewModeBar, { api, module: "sequence", id: job.id, mode: job.reviewMode, onChanged: () => void load(job.id) }), [
2441
2923
  { step: "video", title: "① 生成视频", node: job.video },
2442
2924
  { step: "frames", title: "② 抽帧 + 抠像", node: job.frames },
2443
2925
  { step: "sheet", title: "③ 横向条图", node: job.sheet }
@@ -5063,6 +5545,13 @@ window.__ModuleLoader__.load({
5063
5545
  revealProject: (payload) => call("revealProject", payload),
5064
5546
  runImage: (payload) => call("runImage", payload),
5065
5547
  runImages: (payload) => call("runImages", payload),
5548
+ setImageMode: (payload) => call("setImageMode", payload),
5549
+ runTurnVideo: (payload) => call("runTurnVideo", payload),
5550
+ runTurnFrames: (payload) => call("runTurnFrames", payload),
5551
+ setTurnPick: (payload) => call("setTurnPick", payload),
5552
+ setTurnPicks: (payload) => call("setTurnPicks", payload),
5553
+ resetTurnPicks: (payload) => call("resetTurnPicks", payload),
5554
+ cutTurnFrames: (payload) => call("cutTurnFrames", payload),
5066
5555
  runVideos: (payload) => call("runVideos", payload),
5067
5556
  pollVideos: (payload) => call("pollVideos", payload),
5068
5557
  clearVideos: (payload) => call("clearVideos", payload),
@@ -5180,7 +5669,7 @@ window.__ModuleLoader__.load({
5180
5669
  bundleModule.exports.GAME_STUDIO_PANEL_ID = GAME_STUDIO_PANEL_ID;
5181
5670
  // 仅测试用把手:三个模块组件在工厂闭包里,脚本要能拿出来单独渲染
5182
5671
  // (见 scripts/verify-feedback.mjs)。运行时没有任何调用点。
5183
- bundleModule.exports.__test = { StudioPanel, ImageModule, SequenceModule, usePendingTasks, LoadingOverlay, MediaBox, BusyBtn, BusyBadge, CSS, subscribeIntent, parseIntents, openStudioIntent, OPEN_QUERY_KEY };
5672
+ bundleModule.exports.__test = { StudioPanel, ImageModule, SequenceModule, usePendingTasks, LoadingOverlay, MediaBox, BusyBtn, BusyBadge, NumField, ZoomableImage, CSS, subscribeIntent, parseIntents, openStudioIntent, OPEN_QUERY_KEY };
5184
5673
  return bundleModule.exports;
5185
5674
  }
5186
5675
  });