fix: 自定义标签融入原生标签栏,点击切换而非消失

- StyleSelector 新增 customTags 属性,自定义标签作为「自定义标签」行展示在原生标签栏中
- 自定义标签点击切换 true/false,不再移除 key,解决点击消失问题
- CustomTagsEditor 简化为仅输入框+添加按钮
- extractTags 仅提取激活态自定义标签(value=true)
- 导出 CUSTOM_PREFIX 供组件使用
This commit is contained in:
2026-05-25 19:55:29 +08:00
parent 9d3b8fcd20
commit f44fd56e22
8 changed files with 50 additions and 49 deletions
@@ -2,7 +2,7 @@ import { useEffect } from 'react'
import { useParams } from 'react-router-dom'
import { useProjectStore } from '../stores/project'
import { useToastStore } from '../stores/toast'
import { PROJECT_TYPES, PROJECT_TYPE_KEY } from '../utils/style'
import { PROJECT_TYPES, PROJECT_TYPE_KEY, getCustomTags } from '../utils/style'
import StyleSelector from './StyleSelector'
import CustomTagsEditor from './CustomTagsEditor'
import Skeleton from './Skeleton'
@@ -82,6 +82,7 @@ export default function ProjectConfigPanel() {
label: '工程类型',
options: PROJECT_TYPES.map(p => ({ value: p.value, label: p.label })),
}]}
customTags={getCustomTags(draftStyle)}
/>
<CustomTagsEditor style={draftStyle} onChange={setDraftStyle} />
</div>