发布封面导入器收敛为单选
- 新增 COVER_IMPORTER_SETTINGS(maxItems: 1),FormCard 封面导入改用该设置,避免多选后静默丢弃其余图片
This commit is contained in:
@@ -127,6 +127,16 @@ export const DESIGN_IMAGE_IMPORTER_SETTINGS: AssetImporterSettings =
|
||||
export const SPRITE_IMPORTER_SETTINGS: AssetImporterSettings =
|
||||
imageImporterSettings(imageRequirements);
|
||||
|
||||
/**
|
||||
* 单张封面:发布表单的封面槽只装一个路径,导入器同样收敛成单选;沿用多选的
|
||||
* `SPRITE_IMPORTER_SETTINGS` 时用户多选的其余图片会被静默丢弃。
|
||||
*/
|
||||
export const COVER_IMPORTER_SETTINGS: AssetImporterSettings =
|
||||
imageImporterSettings({
|
||||
maxItems: 1,
|
||||
maxFileSizeBytes: 20 * 1024 * 1024,
|
||||
});
|
||||
|
||||
/**
|
||||
* 平台图标(小红书小工具等):本地项目与云端素材库两个来源都要能选,单张、png/jpg/jpeg、≤5 MiB。
|
||||
* 上限与白名单跟宿主 `validate_icon` 对齐,免得选完了保存时才被宿主的硬校验挡回来。
|
||||
|
||||
+5
-2
@@ -2,7 +2,10 @@ import { ImagePlus, Sparkles, Trash2 } from 'lucide-react';
|
||||
import { type ReactNode, useState } from 'react';
|
||||
|
||||
import { AssetImporter } from '../../../../../components/AssetImporter';
|
||||
import { SPRITE_IMPORTER_SETTINGS } from '../../../../../components/AssetImporter/settings';
|
||||
import {
|
||||
COVER_IMPORTER_SETTINGS,
|
||||
SPRITE_IMPORTER_SETTINGS,
|
||||
} from '../../../../../components/AssetImporter/settings';
|
||||
import { MAX_AGC_GAME_SCREENSHOTS } from '../../../../../services/gameDistributionPublish';
|
||||
import type { TaonierExportForm } from '../../generated/TaonierExportForm';
|
||||
import {
|
||||
@@ -382,7 +385,7 @@ export function FormCard({
|
||||
<AssetImporter
|
||||
open={coverImporterOpen}
|
||||
projectPath={projectPath ?? ''}
|
||||
settings={SPRITE_IMPORTER_SETTINGS}
|
||||
settings={COVER_IMPORTER_SETTINGS}
|
||||
onClose={() => setCoverImporterOpen(false)}
|
||||
onImport={(assets) => {
|
||||
const picked = assets.at(-1);
|
||||
|
||||
Reference in New Issue
Block a user