文生 / 图生 3D 面板入口合并到同一个 opener

- src/components/image-editor/useImageCanvasGenerationWorkflow.ts:新增 openModel3dGenerationDialog(mode),openModel3dTextToModelDialog / openModel3dImageToModelDialog 退化成两个只传 mode 的薄包装;两条入口此前是除 mode 外逐字相同的复制,改逻辑时容易只改一处

验证:npm run typecheck
This commit is contained in:
2026-09-22 13:31:48 +08:00
parent b41d156edd
commit d1478e3859
@@ -1746,37 +1746,30 @@ export function useImageCanvasGenerationWorkflow({
viewport,
]);
const openModel3dTextToModelDialog = useCallback(() => {
openPlacedCanvasGenerationDialog(
createModel3dGenerationDialogDraft({
canvasSize,
viewport,
mode: 'model3d-text-to-model',
}),
);
activateCanvasGenerationEntry('model3d');
}, [
activateCanvasGenerationEntry,
canvasSize,
openPlacedCanvasGenerationDialog,
viewport,
]);
const openModel3dGenerationDialog = useCallback(
(mode: 'model3d-text-to-model' | 'model3d-image-to-model') => {
openPlacedCanvasGenerationDialog(
createModel3dGenerationDialogDraft({ canvasSize, viewport, mode }),
);
activateCanvasGenerationEntry('model3d');
},
[
activateCanvasGenerationEntry,
canvasSize,
openPlacedCanvasGenerationDialog,
viewport,
],
);
const openModel3dImageToModelDialog = useCallback(() => {
openPlacedCanvasGenerationDialog(
createModel3dGenerationDialogDraft({
canvasSize,
viewport,
mode: 'model3d-image-to-model',
}),
);
activateCanvasGenerationEntry('model3d');
}, [
activateCanvasGenerationEntry,
canvasSize,
openPlacedCanvasGenerationDialog,
viewport,
]);
const openModel3dTextToModelDialog = useCallback(
() => openModel3dGenerationDialog('model3d-text-to-model'),
[openModel3dGenerationDialog],
);
const openModel3dImageToModelDialog = useCallback(
() => openModel3dGenerationDialog('model3d-image-to-model'),
[openModel3dGenerationDialog],
);
const openEditDialog = useCallback(
(sourceLayer: CanvasLayer) => {