merge: 同步 origin/ui-optimization(d224d5b6),保留 weiyuan 功能与 Semi 迁移
- 冲突以 weiyuan 功能(小程序登录、i18n 文案)为准,并保留远端 lint 重构与依赖收敛 - 删除 weiyuan 已移除、远端仅做 lint 修正的 3 个图片相关文件 - 适配远端零警告 ESLint:Monitoring/Subscription 改用 useEffectEvent,EditChannelModal 注明 t 依赖 - effect-events 单测补充 react-i18next mock - 对合并后仍不符合 Prettier 的文件做纯格式化
This commit is contained in:
@@ -43,7 +43,11 @@ export const RESERVED_LOGIN_NAMES = [
|
||||
|
||||
/** 是否命中保留名(大小写不敏感、去空格,与后端同口径)。 */
|
||||
export function isReservedLoginName(name) {
|
||||
return RESERVED_LOGIN_NAMES.includes(String(name || '').trim().toLowerCase());
|
||||
return RESERVED_LOGIN_NAMES.includes(
|
||||
String(name || '')
|
||||
.trim()
|
||||
.toLowerCase(),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+32
-30
@@ -17,6 +17,38 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
|
||||
import {
|
||||
OpenAIMono as OpenAI,
|
||||
ClaudeColor as Claude,
|
||||
GeminiColor as Gemini,
|
||||
MoonshotMono as Moonshot,
|
||||
ZhipuColor as Zhipu,
|
||||
QwenColor as Qwen,
|
||||
DeepSeekColor as DeepSeek,
|
||||
MinimaxColor as Minimax,
|
||||
WenxinColor as Wenxin,
|
||||
SparkColor as Spark,
|
||||
MidjourneyMono as Midjourney,
|
||||
HunyuanColor as Hunyuan,
|
||||
CohereColor as Cohere,
|
||||
CloudflareColor as Cloudflare,
|
||||
Ai360Color as Ai360,
|
||||
YiColor as Yi,
|
||||
JinaMono as Jina,
|
||||
MistralColor as Mistral,
|
||||
XAIMono as XAI,
|
||||
OllamaMono as Ollama,
|
||||
DoubaoColor as Doubao,
|
||||
SunoMono as Suno,
|
||||
XinferenceColor as Xinference,
|
||||
OpenRouterMono as OpenRouter,
|
||||
DifyColor as Dify,
|
||||
CozeMono as Coze,
|
||||
SiliconCloudColor as SiliconCloud,
|
||||
KlingColor as Kling,
|
||||
PerplexityColor as Perplexity,
|
||||
ReplicateMono as Replicate,
|
||||
} from '@/assets/brand-icons/primitives';
|
||||
import React, { lazy, Suspense } from 'react';
|
||||
import i18next from 'i18next';
|
||||
// React 18-compatible LobeHub icons lack these brands; use generic icons.
|
||||
@@ -24,36 +56,6 @@ import { Lock, Bot as FastGPT, Image as Jimeng } from 'lucide-react';
|
||||
import { Modal, Tag, Typography } from '@/components/ui';
|
||||
import { copy, getCurrencySymbol, showSuccess } from './utils';
|
||||
import { visit } from 'unist-util-visit';
|
||||
import OpenAI from '@lobehub/icons/es/OpenAI/components/Mono';
|
||||
import Claude from '@lobehub/icons/es/Claude/components/Color';
|
||||
import Gemini from '@lobehub/icons/es/Gemini/components/Color';
|
||||
import Moonshot from '@lobehub/icons/es/Moonshot/components/Mono';
|
||||
import Zhipu from '@lobehub/icons/es/Zhipu/components/Color';
|
||||
import Qwen from '@lobehub/icons/es/Qwen/components/Color';
|
||||
import DeepSeek from '@lobehub/icons/es/DeepSeek/components/Color';
|
||||
import Minimax from '@lobehub/icons/es/Minimax/components/Color';
|
||||
import Wenxin from '@lobehub/icons/es/Wenxin/components/Color';
|
||||
import Spark from '@lobehub/icons/es/Spark/components/Color';
|
||||
import Midjourney from '@lobehub/icons/es/Midjourney/components/Mono';
|
||||
import Hunyuan from '@lobehub/icons/es/Hunyuan/components/Color';
|
||||
import Cohere from '@lobehub/icons/es/Cohere/components/Color';
|
||||
import Cloudflare from '@lobehub/icons/es/Cloudflare/components/Color';
|
||||
import Ai360 from '@lobehub/icons/es/Ai360/components/Color';
|
||||
import Yi from '@lobehub/icons/es/Yi/components/Color';
|
||||
import Jina from '@lobehub/icons/es/Jina/components/Mono';
|
||||
import Mistral from '@lobehub/icons/es/Mistral/components/Color';
|
||||
import XAI from '@lobehub/icons/es/XAI/components/Mono';
|
||||
import Ollama from '@lobehub/icons/es/Ollama/components/Mono';
|
||||
import Doubao from '@lobehub/icons/es/Doubao/components/Color';
|
||||
import Suno from '@lobehub/icons/es/Suno/components/Mono';
|
||||
import Xinference from '@lobehub/icons/es/Xinference/components/Color';
|
||||
import OpenRouter from '@lobehub/icons/es/OpenRouter/components/Mono';
|
||||
import Dify from '@lobehub/icons/es/Dify/components/Color';
|
||||
import Coze from '@lobehub/icons/es/Coze/components/Mono';
|
||||
import SiliconCloud from '@lobehub/icons/es/SiliconCloud/components/Color';
|
||||
import Kling from '@lobehub/icons/es/Kling/components/Color';
|
||||
import Perplexity from '@lobehub/icons/es/Perplexity/components/Color';
|
||||
import Replicate from '@lobehub/icons/es/Replicate/components/Mono';
|
||||
|
||||
// Full Avatar/Text/Combine variants are loaded only when configured icons render.
|
||||
const LobeHubIcon = lazy(() => import('../components/common/LobeHubIcon'));
|
||||
|
||||
+32
-26
@@ -59,7 +59,9 @@ function parseConfig(jsonString) {
|
||||
export function setPresetOverrides(jsonString, { persist = true } = {}) {
|
||||
try {
|
||||
presetOverrides =
|
||||
jsonString && typeof jsonString === 'string' ? JSON.parse(jsonString) : {};
|
||||
jsonString && typeof jsonString === 'string'
|
||||
? JSON.parse(jsonString)
|
||||
: {};
|
||||
if (!presetOverrides || typeof presetOverrides !== 'object') {
|
||||
presetOverrides = {};
|
||||
}
|
||||
@@ -68,10 +70,7 @@ export function setPresetOverrides(jsonString, { persist = true } = {}) {
|
||||
}
|
||||
if (!persist) return;
|
||||
try {
|
||||
window.localStorage.setItem(
|
||||
PRESETS_CACHE_KEY,
|
||||
jsonString || '{}',
|
||||
);
|
||||
window.localStorage.setItem(PRESETS_CACHE_KEY, jsonString || '{}');
|
||||
} catch {
|
||||
/* ignore */
|
||||
}
|
||||
@@ -203,7 +202,10 @@ export function applyTheme(jsonString, { persist = true } = {}) {
|
||||
doApply(config);
|
||||
if (!persist) return;
|
||||
try {
|
||||
window.localStorage.setItem(CACHE_KEY, jsonString || JSON.stringify(config));
|
||||
window.localStorage.setItem(
|
||||
CACHE_KEY,
|
||||
jsonString || JSON.stringify(config),
|
||||
);
|
||||
} catch {
|
||||
/* ignore */
|
||||
}
|
||||
@@ -281,7 +283,12 @@ function doApply(config) {
|
||||
|
||||
function cachePresplashCSS() {
|
||||
try {
|
||||
const ids = [STYLE_ID_LIGHT, STYLE_ID_DARK, STYLE_ID_CONTROLS_LIGHT, STYLE_ID_CONTROLS_DARK];
|
||||
const ids = [
|
||||
STYLE_ID_LIGHT,
|
||||
STYLE_ID_DARK,
|
||||
STYLE_ID_CONTROLS_LIGHT,
|
||||
STYLE_ID_CONTROLS_DARK,
|
||||
];
|
||||
const css = ids
|
||||
.map((id) => {
|
||||
const el = document.getElementById(id);
|
||||
@@ -307,37 +314,36 @@ function cachePresplashCSS() {
|
||||
function buildControlRules(baseHex, isDark, infoHex) {
|
||||
const base = colord(baseHex);
|
||||
const info = colord(infoHex || baseHex);
|
||||
const step = (c, n) =>
|
||||
isDark ? c.lighten(n).toHex() : c.darken(n).toHex();
|
||||
const step = (c, n) => (isDark ? c.lighten(n).toHex() : c.darken(n).toHex());
|
||||
const alphaSoft = (c, a) => c.alpha(a).toRgbString();
|
||||
|
||||
// 浅暗模式 light 系列透明度策略略不同(参考 Semi 默认)
|
||||
const softDefault = isDark ? 0.2 : 0.12;
|
||||
const softHover = isDark ? 0.3 : 0.16;
|
||||
const softActive = isDark ? 0.4 : 0.2;
|
||||
const infoHexNorm = (infoHex || baseHex);
|
||||
const infoHexNorm = infoHex || baseHex;
|
||||
|
||||
return {
|
||||
/* primary(7 个)—— 跟随 brand-primary */
|
||||
'ui-color-primary': baseHex,
|
||||
'ui-color-primary-hover': step(base, 0.05),
|
||||
'ui-color-primary-active': step(base, 0.1),
|
||||
'ui-color-primary-disabled': alphaSoft(base, 0.4),
|
||||
'ui-color-primary': baseHex,
|
||||
'ui-color-primary-hover': step(base, 0.05),
|
||||
'ui-color-primary-active': step(base, 0.1),
|
||||
'ui-color-primary-disabled': alphaSoft(base, 0.4),
|
||||
'ui-color-primary-light-default': alphaSoft(base, softDefault),
|
||||
'ui-color-primary-light-hover': alphaSoft(base, softHover),
|
||||
'ui-color-primary-light-active': alphaSoft(base, softActive),
|
||||
'ui-color-primary-light-hover': alphaSoft(base, softHover),
|
||||
'ui-color-primary-light-active': alphaSoft(base, softActive),
|
||||
/* info(7 个)—— 跟随 accent-blue,保留"信息=蓝"语义 */
|
||||
'ui-color-info': infoHexNorm,
|
||||
'ui-color-info-hover': step(info, 0.05),
|
||||
'ui-color-info-active': step(info, 0.1),
|
||||
'ui-color-info-disabled': alphaSoft(info, 0.4),
|
||||
'ui-color-info-light-default': alphaSoft(info, softDefault),
|
||||
'ui-color-info-light-hover': alphaSoft(info, softHover),
|
||||
'ui-color-info-light-active': alphaSoft(info, softActive),
|
||||
'ui-color-info': infoHexNorm,
|
||||
'ui-color-info-hover': step(info, 0.05),
|
||||
'ui-color-info-active': step(info, 0.1),
|
||||
'ui-color-info-disabled': alphaSoft(info, 0.4),
|
||||
'ui-color-info-light-default': alphaSoft(info, softDefault),
|
||||
'ui-color-info-light-hover': alphaSoft(info, softHover),
|
||||
'ui-color-info-light-active': alphaSoft(info, softActive),
|
||||
/* link(4 个)—— 跟随 brand-primary */
|
||||
'ui-color-link': baseHex,
|
||||
'ui-color-link-hover': step(base, 0.05),
|
||||
'ui-color-link-active': step(base, 0.1),
|
||||
'ui-color-link': baseHex,
|
||||
'ui-color-link-hover': step(base, 0.05),
|
||||
'ui-color-link-active': step(base, 0.1),
|
||||
'ui-color-link-visited': baseHex,
|
||||
/* focus-border(1 个) */
|
||||
'ui-color-focus-border': baseHex,
|
||||
|
||||
Reference in New Issue
Block a user