feat: 合并代码后 系统设置 ui样式优化、bug修复、全局统一图标对齐等
This commit is contained in:
@@ -17,6 +17,12 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
|
||||
import {
|
||||
EyeOff as ActionEyeOff,
|
||||
Eye as ActionEye,
|
||||
X as ActionX,
|
||||
ArrowDown as ActionArrowDown,
|
||||
} from '@/components/common/icons/ActionIcons';
|
||||
import React, { useContext } from 'react';
|
||||
import {
|
||||
Card,
|
||||
@@ -31,7 +37,6 @@ import {
|
||||
import {
|
||||
MessageSquare,
|
||||
Eye,
|
||||
EyeOff,
|
||||
Sparkles,
|
||||
Brain,
|
||||
Code2,
|
||||
@@ -44,8 +49,6 @@ import {
|
||||
Layers,
|
||||
Paintbrush,
|
||||
Upload,
|
||||
ArrowDown,
|
||||
X,
|
||||
ListChecks,
|
||||
} from 'lucide-react';
|
||||
import { useChatScroll } from '../../hooks/playground/useChatScroll';
|
||||
@@ -597,7 +600,7 @@ const ChatArea = ({
|
||||
type='button'
|
||||
onClick={onEnterSelectionMode}
|
||||
aria-label={t('多选导出')}
|
||||
className='flex items-center gap-2 cursor-pointer px-4 py-2 rounded-xl bg-white/80 dark:bg-neutral-800/80 backdrop-blur-md border border-gray-200/60 dark:border-neutral-700/60 shadow-[0_2px_8px_rgba(0,0,0,0.04)] hover:shadow-[0_4px_16px_rgba(139,92,246,0.12)] hover:border-brand-from/80 dark:hover:border-brand-deep/60 transition-all duration-300'
|
||||
className='app-action-button flex items-center gap-2 cursor-pointer px-4 py-2 rounded-xl bg-white/80 dark:bg-neutral-800/80 backdrop-blur-md border border-gray-200/60 dark:border-neutral-700/60 shadow-[0_2px_8px_rgba(0,0,0,0.04)] hover:shadow-[0_4px_16px_rgba(139,92,246,0.12)] hover:border-brand-from/80 dark:hover:border-brand-deep/60 transition-all duration-300'
|
||||
>
|
||||
<ListChecks size={14} className='text-brand flex-shrink-0' />
|
||||
<span className='text-sm font-medium text-gray-700 dark:text-gray-200'>
|
||||
@@ -626,7 +629,11 @@ const ChatArea = ({
|
||||
<div className='flex items-center gap-2'>
|
||||
<Button
|
||||
icon={
|
||||
showDebugPanel ? <EyeOff size={14} /> : <Eye size={14} />
|
||||
showDebugPanel ? (
|
||||
<ActionEyeOff size={14} />
|
||||
) : (
|
||||
<ActionEye size={14} />
|
||||
)
|
||||
}
|
||||
onClick={onToggleDebugPanel}
|
||||
theme='borderless'
|
||||
@@ -935,10 +942,10 @@ const ChatArea = ({
|
||||
<button
|
||||
type='button'
|
||||
onClick={() => setLongConvHintDismissed(true)}
|
||||
className='flex-shrink-0 text-amber-500 hover:text-amber-700 dark:hover:text-amber-300'
|
||||
className='app-action-button flex-shrink-0 text-amber-500 hover:text-amber-700 dark:hover:text-amber-300'
|
||||
aria-label={t('关闭提示')}
|
||||
>
|
||||
<X size={14} />
|
||||
<ActionX size={14} />
|
||||
</button>
|
||||
</div>
|
||||
)}
|
||||
@@ -982,18 +989,10 @@ const ChatArea = ({
|
||||
type='button'
|
||||
onClick={() => scrollToBottom()}
|
||||
style={{ bottom: 'calc(var(--composer-height, 90px) + 14px)' }}
|
||||
className='
|
||||
absolute z-30 left-1/2 -translate-x-1/2
|
||||
flex items-center gap-1.5 px-3 py-1.5 rounded-full
|
||||
bg-white/95 dark:bg-neutral-800/95 backdrop-blur-sm
|
||||
border border-gray-200/80 dark:border-neutral-700/80
|
||||
text-xs font-medium text-gray-700 dark:text-gray-200
|
||||
shadow-md hover:shadow-lg hover:scale-105 active:scale-95
|
||||
transition-all duration-200
|
||||
'
|
||||
className='app-action-button \n absolute z-30 left-1/2 -translate-x-1/2\n flex items-center gap-1.5 px-3 py-1.5 rounded-full\n bg-white/95 dark:bg-neutral-800/95 backdrop-blur-sm\n border border-gray-200/80 dark:border-neutral-700/80\n text-xs font-medium text-gray-700 dark:text-gray-200\n shadow-md hover:shadow-lg hover:scale-105 active:scale-95\n transition-all duration-200\n '
|
||||
title={t('回到最新消息')}
|
||||
>
|
||||
<ArrowDown size={13} className='text-brand' />
|
||||
<ActionArrowDown size={13} className='text-brand' />
|
||||
{t('回到最新')}
|
||||
</button>
|
||||
)}
|
||||
|
||||
@@ -17,9 +17,13 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
|
||||
import {
|
||||
Copy as ActionCopy,
|
||||
ChevronUp as ActionChevronUp,
|
||||
ChevronDown as ActionChevronDown,
|
||||
} from '@/components/common/icons/ActionIcons';
|
||||
import React, { useState, useMemo, useCallback } from 'react';
|
||||
import { Button, Tooltip, Toast } from '@/components/ui';
|
||||
import { Copy, ChevronDown, ChevronUp } from 'lucide-react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { copy } from '../../helpers';
|
||||
|
||||
@@ -256,7 +260,7 @@ const CodeViewer = ({ content, title, language = 'json' }) => {
|
||||
>
|
||||
<Tooltip content={copied ? t('已复制') : t('复制代码')}>
|
||||
<Button
|
||||
icon={<Copy size={14} />}
|
||||
icon={<ActionCopy size={14} />}
|
||||
onClick={handleCopy}
|
||||
size='small'
|
||||
theme='borderless'
|
||||
@@ -319,7 +323,11 @@ const CodeViewer = ({ content, title, language = 'json' }) => {
|
||||
<Tooltip content={isExpanded ? t('收起内容') : t('显示完整内容')}>
|
||||
<Button
|
||||
icon={
|
||||
isExpanded ? <ChevronUp size={14} /> : <ChevronDown size={14} />
|
||||
isExpanded ? (
|
||||
<ActionChevronUp size={14} />
|
||||
) : (
|
||||
<ActionChevronDown size={14} />
|
||||
)
|
||||
}
|
||||
onClick={handleToggleExpand}
|
||||
size='small'
|
||||
|
||||
@@ -17,9 +17,15 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
|
||||
import {
|
||||
Settings2 as ActionSettings2,
|
||||
RotateCcw as ActionRotateCcw,
|
||||
Download as ActionDownload,
|
||||
Upload as ActionUpload,
|
||||
} from '@/components/common/icons/ActionIcons';
|
||||
import React, { useRef } from 'react';
|
||||
import { Button, Typography, Toast, Modal, Dropdown } from '@/components/ui';
|
||||
import { Download, Upload, RotateCcw, Settings2 } from 'lucide-react';
|
||||
import { Download, Upload, RotateCcw } from 'lucide-react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import {
|
||||
exportConfig,
|
||||
@@ -205,7 +211,7 @@ const ConfigManager = ({
|
||||
menu={dropdownItems}
|
||||
>
|
||||
<Button
|
||||
icon={<Settings2 size={14} />}
|
||||
icon={<ActionSettings2 size={14} />}
|
||||
theme='borderless'
|
||||
type='tertiary'
|
||||
size='small'
|
||||
@@ -233,7 +239,7 @@ const ConfigManager = ({
|
||||
{getConfigStatus()}
|
||||
</Typography.Text>
|
||||
<Button
|
||||
icon={<RotateCcw size={12} />}
|
||||
icon={<ActionRotateCcw size={12} />}
|
||||
size='small'
|
||||
theme='borderless'
|
||||
type='danger'
|
||||
@@ -245,7 +251,7 @@ const ConfigManager = ({
|
||||
{/* 导出和导入按钮 */}
|
||||
<div className='flex gap-2'>
|
||||
<Button
|
||||
icon={<Download size={12} />}
|
||||
icon={<ActionDownload size={12} />}
|
||||
size='small'
|
||||
theme='solid'
|
||||
type='primary'
|
||||
@@ -256,7 +262,7 @@ const ConfigManager = ({
|
||||
</Button>
|
||||
|
||||
<Button
|
||||
icon={<Upload size={12} />}
|
||||
icon={<ActionUpload size={12} />}
|
||||
size='small'
|
||||
theme='outline'
|
||||
type='primary'
|
||||
|
||||
@@ -17,21 +17,23 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
|
||||
import {
|
||||
AlertTriangle as ActionAlertTriangle,
|
||||
RotateCw as ActionRotateCw,
|
||||
X as ActionX,
|
||||
Paperclip as ActionPaperclip,
|
||||
MicOff as ActionMicOff,
|
||||
Mic as ActionMic,
|
||||
Globe as ActionGlobe,
|
||||
} from '@/components/common/icons/ActionIcons';
|
||||
import React, { useRef, useEffect, useCallback, useContext } from 'react';
|
||||
import { Toast, Tooltip, Modal } from '@/components/ui';
|
||||
import {
|
||||
Globe,
|
||||
Paperclip,
|
||||
X,
|
||||
FileText,
|
||||
Image as ImageIcon,
|
||||
Paintbrush,
|
||||
RotateCw,
|
||||
AlertCircle,
|
||||
AlertTriangle,
|
||||
Loader2,
|
||||
Mic,
|
||||
MicOff,
|
||||
} from 'lucide-react';
|
||||
import { useSpeechRecognition } from '../../hooks/playground/useSpeechRecognition';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
@@ -242,9 +244,9 @@ const AttachmentChip = ({ file, onRemove, onRestore, onRetry, t }) => {
|
||||
aria-label={t('查看 {{old}} 格式转换说明', {
|
||||
old: legacyFormat.old,
|
||||
})}
|
||||
className='absolute -top-1 -right-1 w-4 h-4 flex items-center justify-center bg-amber-500 rounded-full ring-1 ring-white dark:ring-neutral-900 cursor-pointer hover:bg-amber-600 transition-colors z-10'
|
||||
className='app-action-button absolute -top-1 -right-1 w-4 h-4 flex items-center justify-center bg-amber-500 rounded-full ring-1 ring-white dark:ring-neutral-900 cursor-pointer hover:bg-amber-600 transition-colors z-10'
|
||||
>
|
||||
<AlertTriangle size={9} className='text-white' />
|
||||
<ActionAlertTriangle size={9} className='text-white' />
|
||||
</button>
|
||||
</Tooltip>
|
||||
)}
|
||||
@@ -295,10 +297,10 @@ const AttachmentChip = ({ file, onRemove, onRestore, onRetry, t }) => {
|
||||
e.stopPropagation();
|
||||
onRetry(file.id);
|
||||
}}
|
||||
className='w-5 h-5 flex items-center justify-center rounded text-red-500 hover:bg-red-100 dark:hover:bg-red-900/30 transition-colors'
|
||||
className='app-action-button w-5 h-5 flex items-center justify-center rounded text-red-500 hover:bg-red-100 dark:hover:bg-red-900/30 transition-colors'
|
||||
title={t('重试上传')}
|
||||
>
|
||||
<RotateCw size={11} />
|
||||
<ActionRotateCw size={11} />
|
||||
</button>
|
||||
)}
|
||||
<button
|
||||
@@ -306,10 +308,10 @@ const AttachmentChip = ({ file, onRemove, onRestore, onRetry, t }) => {
|
||||
e.stopPropagation();
|
||||
handleRemoveWithUndo({ file, onRemove, onRestore, t });
|
||||
}}
|
||||
className='w-5 h-5 flex items-center justify-center rounded text-gray-400 hover:text-red-500 hover:bg-gray-100 dark:hover:bg-neutral-700 transition-colors'
|
||||
className='app-action-button w-5 h-5 flex items-center justify-center rounded text-gray-400 hover:text-red-500 hover:bg-gray-100 dark:hover:bg-neutral-700 transition-colors'
|
||||
title={isUploading ? t('取消上传') : t('移除')}
|
||||
>
|
||||
<X size={11} />
|
||||
<ActionX size={11} />
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@@ -719,14 +721,19 @@ const CustomInputRender = (props) => {
|
||||
fileInputRef.current?.click();
|
||||
}}
|
||||
disabled={uploadDisabled}
|
||||
className={`w-[38px] h-[38px] min-w-[38px] flex items-center justify-center rounded-xl bg-gray-50 dark:bg-neutral-800 border border-gray-200/60 dark:border-neutral-700/60 transition-all duration-300 flex-shrink-0 ${
|
||||
uploadDisabled
|
||||
? 'opacity-40 cursor-not-allowed text-gray-300 dark:text-neutral-600'
|
||||
: 'text-gray-400 hover:text-blue-500 hover:bg-blue-50 dark:hover:bg-blue-900/30 hover:border-blue-200 dark:hover:border-blue-800 hover:scale-105 active:scale-95'
|
||||
}`}
|
||||
className={[
|
||||
'app-action-button',
|
||||
`w-[38px] h-[38px] min-w-[38px] flex items-center justify-center rounded-xl bg-gray-50 dark:bg-neutral-800 border border-gray-200/60 dark:border-neutral-700/60 transition-all duration-300 flex-shrink-0 ${
|
||||
uploadDisabled
|
||||
? 'opacity-40 cursor-not-allowed text-gray-300 dark:text-neutral-600'
|
||||
: 'text-gray-400 hover:text-blue-500 hover:bg-blue-50 dark:hover:bg-blue-900/30 hover:border-blue-200 dark:hover:border-blue-800 hover:scale-105 active:scale-95'
|
||||
}`,
|
||||
]
|
||||
.filter(Boolean)
|
||||
.join(' ')}
|
||||
style={{ boxShadow: '0 1px 3px rgba(0,0,0,0.04)' }}
|
||||
>
|
||||
<Paperclip size={16} />
|
||||
<ActionPaperclip size={16} />
|
||||
</button>
|
||||
</Tooltip>
|
||||
);
|
||||
@@ -818,11 +825,16 @@ const CustomInputRender = (props) => {
|
||||
e.stopPropagation();
|
||||
speech.toggle();
|
||||
}}
|
||||
className={`w-[38px] h-[38px] min-w-[38px] flex items-center justify-center rounded-xl border transition-all duration-300 hover:scale-105 active:scale-95 flex-shrink-0 ${
|
||||
speech.isListening
|
||||
? 'bg-red-50 dark:bg-red-900/30 text-red-500 dark:text-red-400 border-red-200 dark:border-red-800 shadow-sm shadow-red-500/10 animate-pulse'
|
||||
: 'bg-gray-50 dark:bg-neutral-800 text-gray-400 hover:text-rose-500 border-gray-200/60 dark:border-neutral-700/60 hover:border-rose-200 dark:hover:border-rose-800 hover:bg-rose-50 dark:hover:bg-rose-900/30'
|
||||
}`}
|
||||
className={[
|
||||
'app-action-button',
|
||||
`w-[38px] h-[38px] min-w-[38px] flex items-center justify-center rounded-xl border transition-all duration-300 hover:scale-105 active:scale-95 flex-shrink-0 ${
|
||||
speech.isListening
|
||||
? 'bg-red-50 dark:bg-red-900/30 text-red-500 dark:text-red-400 border-red-200 dark:border-red-800 shadow-sm shadow-red-500/10 animate-pulse'
|
||||
: 'bg-gray-50 dark:bg-neutral-800 text-gray-400 hover:text-rose-500 border-gray-200/60 dark:border-neutral-700/60 hover:border-rose-200 dark:hover:border-rose-800 hover:bg-rose-50 dark:hover:bg-rose-900/30'
|
||||
}`,
|
||||
]
|
||||
.filter(Boolean)
|
||||
.join(' ')}
|
||||
style={{
|
||||
boxShadow: speech.isListening
|
||||
? undefined
|
||||
@@ -830,9 +842,9 @@ const CustomInputRender = (props) => {
|
||||
}}
|
||||
>
|
||||
{speech.isListening ? (
|
||||
<MicOff size={16} />
|
||||
<ActionMicOff size={16} />
|
||||
) : (
|
||||
<Mic size={16} />
|
||||
<ActionMic size={16} />
|
||||
)}
|
||||
</button>
|
||||
</Tooltip>
|
||||
@@ -851,18 +863,23 @@ const CustomInputRender = (props) => {
|
||||
e.stopPropagation();
|
||||
onToggleWebSearch && onToggleWebSearch();
|
||||
}}
|
||||
className={`w-[38px] h-[38px] min-w-[38px] flex items-center justify-center rounded-xl border transition-all duration-300 hover:scale-105 active:scale-95 flex-shrink-0 ${
|
||||
enableWebSearch
|
||||
? 'bg-green-50 dark:bg-green-900/30 text-green-600 dark:text-green-400 border-green-200 dark:border-green-800 shadow-sm shadow-green-500/10'
|
||||
: 'bg-gray-50 dark:bg-neutral-800 text-gray-400 hover:text-green-500 border-gray-200/60 dark:border-neutral-700/60 hover:border-green-200 dark:hover:border-green-800 hover:bg-green-50 dark:hover:bg-green-900/30'
|
||||
}`}
|
||||
className={[
|
||||
'app-action-button',
|
||||
`w-[38px] h-[38px] min-w-[38px] flex items-center justify-center rounded-xl border transition-all duration-300 hover:scale-105 active:scale-95 flex-shrink-0 ${
|
||||
enableWebSearch
|
||||
? 'bg-green-50 dark:bg-green-900/30 text-green-600 dark:text-green-400 border-green-200 dark:border-green-800 shadow-sm shadow-green-500/10'
|
||||
: 'bg-gray-50 dark:bg-neutral-800 text-gray-400 hover:text-green-500 border-gray-200/60 dark:border-neutral-700/60 hover:border-green-200 dark:hover:border-green-800 hover:bg-green-50 dark:hover:bg-green-900/30'
|
||||
}`,
|
||||
]
|
||||
.filter(Boolean)
|
||||
.join(' ')}
|
||||
style={{
|
||||
boxShadow: enableWebSearch
|
||||
? undefined
|
||||
: '0 1px 3px rgba(0,0,0,0.04)',
|
||||
}}
|
||||
>
|
||||
<Globe size={16} />
|
||||
<ActionGlobe size={16} />
|
||||
</button>
|
||||
</Tooltip>
|
||||
)}
|
||||
@@ -883,11 +900,16 @@ const CustomInputRender = (props) => {
|
||||
onToggleImageGenMode && onToggleImageGenMode();
|
||||
}}
|
||||
disabled={isImageGenerating}
|
||||
className={`w-[38px] h-[38px] min-w-[38px] flex items-center justify-center rounded-xl border transition-all duration-300 hover:scale-105 active:scale-95 flex-shrink-0 ${
|
||||
imageGenMode
|
||||
? 'bg-brand/5 dark:bg-brand-deep/30 text-brand-deep dark:text-brand-from border-brand/20 dark:border-brand-deep shadow-sm shadow-brand/10'
|
||||
: 'bg-gray-50 dark:bg-neutral-800 text-gray-400 hover:text-brand border-gray-200/60 dark:border-neutral-700/60 hover:border-brand/20 dark:hover:border-brand-deep hover:bg-brand/5 dark:hover:bg-brand-deep/30'
|
||||
} ${isImageGenerating ? 'opacity-50 cursor-not-allowed' : ''}`}
|
||||
className={[
|
||||
'app-action-button',
|
||||
`w-[38px] h-[38px] min-w-[38px] flex items-center justify-center rounded-xl border transition-all duration-300 hover:scale-105 active:scale-95 flex-shrink-0 ${
|
||||
imageGenMode
|
||||
? 'bg-brand/5 dark:bg-brand-deep/30 text-brand-deep dark:text-brand-from border-brand/20 dark:border-brand-deep shadow-sm shadow-brand/10'
|
||||
: 'bg-gray-50 dark:bg-neutral-800 text-gray-400 hover:text-brand border-gray-200/60 dark:border-neutral-700/60 hover:border-brand/20 dark:hover:border-brand-deep hover:bg-brand/5 dark:hover:bg-brand-deep/30'
|
||||
} ${isImageGenerating ? 'opacity-50 cursor-not-allowed' : ''}`,
|
||||
]
|
||||
.filter(Boolean)
|
||||
.join(' ')}
|
||||
style={{
|
||||
boxShadow: imageGenMode
|
||||
? undefined
|
||||
@@ -939,11 +961,16 @@ const CustomInputRender = (props) => {
|
||||
e.stopPropagation();
|
||||
speech.toggle();
|
||||
}}
|
||||
className={`w-[38px] h-[38px] min-w-[38px] flex items-center justify-center rounded-xl border transition-all duration-300 hover:scale-105 active:scale-95 flex-shrink-0 ${
|
||||
speech.isListening
|
||||
? 'bg-red-50 dark:bg-red-900/30 text-red-500 dark:text-red-400 border-red-200 dark:border-red-800 shadow-sm shadow-red-500/10 animate-pulse'
|
||||
: 'bg-gray-50 dark:bg-neutral-800 text-gray-400 hover:text-rose-500 border-gray-200/60 dark:border-neutral-700/60 hover:border-rose-200 dark:hover:border-rose-800 hover:bg-rose-50 dark:hover:bg-rose-900/30'
|
||||
}`}
|
||||
className={[
|
||||
'app-action-button',
|
||||
`w-[38px] h-[38px] min-w-[38px] flex items-center justify-center rounded-xl border transition-all duration-300 hover:scale-105 active:scale-95 flex-shrink-0 ${
|
||||
speech.isListening
|
||||
? 'bg-red-50 dark:bg-red-900/30 text-red-500 dark:text-red-400 border-red-200 dark:border-red-800 shadow-sm shadow-red-500/10 animate-pulse'
|
||||
: 'bg-gray-50 dark:bg-neutral-800 text-gray-400 hover:text-rose-500 border-gray-200/60 dark:border-neutral-700/60 hover:border-rose-200 dark:hover:border-rose-800 hover:bg-rose-50 dark:hover:bg-rose-900/30'
|
||||
}`,
|
||||
]
|
||||
.filter(Boolean)
|
||||
.join(' ')}
|
||||
style={{
|
||||
boxShadow: speech.isListening
|
||||
? undefined
|
||||
@@ -951,9 +978,9 @@ const CustomInputRender = (props) => {
|
||||
}}
|
||||
>
|
||||
{speech.isListening ? (
|
||||
<MicOff size={16} />
|
||||
<ActionMicOff size={16} />
|
||||
) : (
|
||||
<Mic size={16} />
|
||||
<ActionMic size={16} />
|
||||
)}
|
||||
</button>
|
||||
</Tooltip>
|
||||
@@ -972,18 +999,23 @@ const CustomInputRender = (props) => {
|
||||
e.stopPropagation();
|
||||
onToggleWebSearch && onToggleWebSearch();
|
||||
}}
|
||||
className={`w-[38px] h-[38px] min-w-[38px] flex items-center justify-center rounded-xl border transition-all duration-300 hover:scale-105 active:scale-95 flex-shrink-0 ${
|
||||
enableWebSearch
|
||||
? 'bg-green-50 dark:bg-green-900/30 text-green-600 dark:text-green-400 border-green-200 dark:border-green-800 shadow-sm shadow-green-500/10'
|
||||
: 'bg-gray-50 dark:bg-neutral-800 text-gray-400 hover:text-green-500 border-gray-200/60 dark:border-neutral-700/60 hover:border-green-200 dark:hover:border-green-800 hover:bg-green-50 dark:hover:bg-green-900/30'
|
||||
}`}
|
||||
className={[
|
||||
'app-action-button',
|
||||
`w-[38px] h-[38px] min-w-[38px] flex items-center justify-center rounded-xl border transition-all duration-300 hover:scale-105 active:scale-95 flex-shrink-0 ${
|
||||
enableWebSearch
|
||||
? 'bg-green-50 dark:bg-green-900/30 text-green-600 dark:text-green-400 border-green-200 dark:border-green-800 shadow-sm shadow-green-500/10'
|
||||
: 'bg-gray-50 dark:bg-neutral-800 text-gray-400 hover:text-green-500 border-gray-200/60 dark:border-neutral-700/60 hover:border-green-200 dark:hover:border-green-800 hover:bg-green-50 dark:hover:bg-green-900/30'
|
||||
}`,
|
||||
]
|
||||
.filter(Boolean)
|
||||
.join(' ')}
|
||||
style={{
|
||||
boxShadow: enableWebSearch
|
||||
? undefined
|
||||
: '0 1px 3px rgba(0,0,0,0.04)',
|
||||
}}
|
||||
>
|
||||
<Globe size={16} />
|
||||
<ActionGlobe size={16} />
|
||||
</button>
|
||||
</Tooltip>
|
||||
)}
|
||||
@@ -1004,11 +1036,16 @@ const CustomInputRender = (props) => {
|
||||
onToggleImageGenMode && onToggleImageGenMode();
|
||||
}}
|
||||
disabled={isImageGenerating}
|
||||
className={`w-[38px] h-[38px] min-w-[38px] flex items-center justify-center rounded-xl border transition-all duration-300 hover:scale-105 active:scale-95 flex-shrink-0 ${
|
||||
imageGenMode
|
||||
? 'bg-brand/5 dark:bg-brand-deep/30 text-brand-deep dark:text-brand-from border-brand/20 dark:border-brand-deep shadow-sm shadow-brand/10'
|
||||
: 'bg-gray-50 dark:bg-neutral-800 text-gray-400 hover:text-brand border-gray-200/60 dark:border-neutral-700/60 hover:border-brand/20 dark:hover:border-brand-deep hover:bg-brand/5 dark:hover:bg-brand-deep/30'
|
||||
} ${isImageGenerating ? 'opacity-50 cursor-not-allowed' : ''}`}
|
||||
className={[
|
||||
'app-action-button',
|
||||
`w-[38px] h-[38px] min-w-[38px] flex items-center justify-center rounded-xl border transition-all duration-300 hover:scale-105 active:scale-95 flex-shrink-0 ${
|
||||
imageGenMode
|
||||
? 'bg-brand/5 dark:bg-brand-deep/30 text-brand-deep dark:text-brand-from border-brand/20 dark:border-brand-deep shadow-sm shadow-brand/10'
|
||||
: 'bg-gray-50 dark:bg-neutral-800 text-gray-400 hover:text-brand border-gray-200/60 dark:border-neutral-700/60 hover:border-brand/20 dark:hover:border-brand-deep hover:bg-brand/5 dark:hover:bg-brand-deep/30'
|
||||
} ${isImageGenerating ? 'opacity-50 cursor-not-allowed' : ''}`,
|
||||
]
|
||||
.filter(Boolean)
|
||||
.join(' ')}
|
||||
style={{
|
||||
boxShadow: imageGenMode
|
||||
? undefined
|
||||
|
||||
@@ -17,10 +17,11 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
|
||||
import { Edit as ActionEdit } from '@/components/common/icons/ActionIcons';
|
||||
import { useEffectEvent } from '../../hooks/common/useEffectEvent';
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import { TextArea, Typography, Button, Switch, Banner } from '@/components/ui';
|
||||
import { Code, Edit, Check, X, AlertTriangle } from 'lucide-react';
|
||||
import { Code, Check, X, AlertTriangle } from 'lucide-react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
const CustomRequestEditor = ({
|
||||
@@ -170,7 +171,7 @@ const CustomRequestEditor = ({
|
||||
theme='borderless'
|
||||
type='tertiary'
|
||||
size='small'
|
||||
icon={<Edit size={14} />}
|
||||
icon={<ActionEdit size={14} />}
|
||||
onClick={formatJson}
|
||||
disabled={!isValid}
|
||||
className='!rounded-lg'
|
||||
|
||||
@@ -17,6 +17,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
|
||||
import { X as ActionX } from '@/components/common/icons/ActionIcons';
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import {
|
||||
Card,
|
||||
@@ -26,7 +27,7 @@ import {
|
||||
Button,
|
||||
Dropdown,
|
||||
} from '@/components/ui';
|
||||
import { Code, Zap, Clock, X, Eye, Send } from 'lucide-react';
|
||||
import { Code, Zap, Clock, Eye, Send } from 'lucide-react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import CodeViewer from './CodeViewer';
|
||||
import SSEViewer from './SSEViewer';
|
||||
@@ -119,7 +120,7 @@ const DebugPanel = ({
|
||||
|
||||
{styleState.isMobile && onCloseDebugPanel && (
|
||||
<Button
|
||||
icon={<X size={16} />}
|
||||
icon={<ActionX size={16} />}
|
||||
onClick={onCloseDebugPanel}
|
||||
theme='borderless'
|
||||
type='tertiary'
|
||||
|
||||
@@ -17,9 +17,14 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
|
||||
import {
|
||||
ExternalLink as ActionExternalLink,
|
||||
Download as ActionDownload,
|
||||
X as ActionX,
|
||||
} from '@/components/common/icons/ActionIcons';
|
||||
import React, { useCallback, useMemo } from 'react';
|
||||
import { Modal, Toast } from '@/components/ui';
|
||||
import { Download, ExternalLink, X, FileText } from 'lucide-react';
|
||||
import { FileText } from 'lucide-react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
// 体验中心消息气泡里"点击附件 chip 弹出预览"的统一入口。
|
||||
@@ -110,20 +115,30 @@ const FilePreviewModal = ({ visible, file, onClose }) => {
|
||||
</span>
|
||||
</div>
|
||||
<div className='flex items-center gap-1.5'>
|
||||
<button onClick={handleOpenInNewTab} className={btnClass}>
|
||||
<ExternalLink size={14} />
|
||||
<button
|
||||
onClick={handleOpenInNewTab}
|
||||
className={['app-action-button', btnClass]
|
||||
.filter(Boolean)
|
||||
.join(' ')}
|
||||
>
|
||||
<ActionExternalLink size={14} />
|
||||
{t('新窗口打开')}
|
||||
</button>
|
||||
<button onClick={handleDownload} className={btnClass}>
|
||||
<Download size={14} />
|
||||
<button
|
||||
onClick={handleDownload}
|
||||
className={['app-action-button', btnClass]
|
||||
.filter(Boolean)
|
||||
.join(' ')}
|
||||
>
|
||||
<ActionDownload size={14} />
|
||||
{t('下载')}
|
||||
</button>
|
||||
<button
|
||||
onClick={onClose}
|
||||
className='w-9 h-9 flex items-center justify-center rounded-lg bg-white/10 hover:bg-white/20 text-white/80 hover:text-white transition-all'
|
||||
className='app-action-button w-9 h-9 flex items-center justify-center rounded-lg bg-white/10 hover:bg-white/20 text-white/80 hover:text-white transition-all'
|
||||
title={t('关闭')}
|
||||
>
|
||||
<X size={20} />
|
||||
<ActionX size={20} />
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -156,12 +171,22 @@ const FilePreviewModal = ({ visible, file, onClose }) => {
|
||||
)}
|
||||
</div>
|
||||
<div className='flex items-center gap-2 mt-2'>
|
||||
<button onClick={handleOpenInNewTab} className={btnClass}>
|
||||
<ExternalLink size={14} />
|
||||
<button
|
||||
onClick={handleOpenInNewTab}
|
||||
className={['app-action-button', btnClass]
|
||||
.filter(Boolean)
|
||||
.join(' ')}
|
||||
>
|
||||
<ActionExternalLink size={14} />
|
||||
{t('新窗口打开')}
|
||||
</button>
|
||||
<button onClick={handleDownload} className={btnClass}>
|
||||
<Download size={14} />
|
||||
<button
|
||||
onClick={handleDownload}
|
||||
className={['app-action-button', btnClass]
|
||||
.filter(Boolean)
|
||||
.join(' ')}
|
||||
>
|
||||
<ActionDownload size={14} />
|
||||
{t('下载')}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@@ -17,9 +17,13 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
|
||||
import {
|
||||
Settings as ActionSettings,
|
||||
EyeOff as ActionEyeOff,
|
||||
Eye as ActionEye,
|
||||
} from '@/components/common/icons/ActionIcons';
|
||||
import React from 'react';
|
||||
import { Button } from '@/components/ui';
|
||||
import { Settings, Eye, EyeOff } from 'lucide-react';
|
||||
|
||||
const FloatingButtons = ({
|
||||
styleState,
|
||||
@@ -36,7 +40,7 @@ const FloatingButtons = ({
|
||||
{/* 设置按钮(体验模式下设置面板不渲染,按钮也隐藏,避免出现死按钮) */}
|
||||
{!showSettings && !hideSettingsButton && (
|
||||
<Button
|
||||
icon={<Settings size={18} />}
|
||||
icon={<ActionSettings size={18} />}
|
||||
style={{
|
||||
position: 'fixed',
|
||||
right: 16,
|
||||
@@ -62,7 +66,13 @@ const FloatingButtons = ({
|
||||
{/* 调试按钮 */}
|
||||
{!showSettings && (
|
||||
<Button
|
||||
icon={showDebugPanel ? <EyeOff size={18} /> : <Eye size={18} />}
|
||||
icon={
|
||||
showDebugPanel ? (
|
||||
<ActionEyeOff size={18} />
|
||||
) : (
|
||||
<ActionEye size={18} />
|
||||
)
|
||||
}
|
||||
onClick={onToggleDebugPanel}
|
||||
theme='solid'
|
||||
type={showDebugPanel ? 'danger' : 'primary'}
|
||||
|
||||
@@ -17,9 +17,15 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
|
||||
import {
|
||||
ZoomOut as ActionZoomOut,
|
||||
ZoomIn as ActionZoomIn,
|
||||
RotateCw as ActionRotateCw,
|
||||
Download as ActionDownload,
|
||||
X as ActionX,
|
||||
} from '@/components/common/icons/ActionIcons';
|
||||
import React, { useState, useCallback, useEffect } from 'react';
|
||||
import { Modal } from '@/components/ui';
|
||||
import { Download, ZoomIn, ZoomOut, X, RotateCw } from 'lucide-react';
|
||||
|
||||
const ImagePreviewModal = ({ visible, imageUrl, onClose }) => {
|
||||
const [scale, setScale] = useState(1);
|
||||
@@ -92,25 +98,51 @@ const ImagePreviewModal = ({ visible, imageUrl, onClose }) => {
|
||||
}}
|
||||
>
|
||||
<div className='flex items-center gap-1.5'>
|
||||
<button onClick={handleZoomOut} className={btnClass}>
|
||||
<ZoomOut size={18} />
|
||||
<button
|
||||
onClick={handleZoomOut}
|
||||
className={['app-action-button', btnClass]
|
||||
.filter(Boolean)
|
||||
.join(' ')}
|
||||
>
|
||||
<ActionZoomOut size={18} />
|
||||
</button>
|
||||
<span className='text-white/70 text-sm min-w-[48px] text-center'>
|
||||
{Math.round(scale * 100)}%
|
||||
</span>
|
||||
<button onClick={handleZoomIn} className={btnClass}>
|
||||
<ZoomIn size={18} />
|
||||
<button
|
||||
onClick={handleZoomIn}
|
||||
className={['app-action-button', btnClass]
|
||||
.filter(Boolean)
|
||||
.join(' ')}
|
||||
>
|
||||
<ActionZoomIn size={18} />
|
||||
</button>
|
||||
<button onClick={handleResetZoom} className={btnClass} title='Reset'>
|
||||
<RotateCw size={16} />
|
||||
<button
|
||||
onClick={handleResetZoom}
|
||||
className={['app-action-button', btnClass]
|
||||
.filter(Boolean)
|
||||
.join(' ')}
|
||||
title='Reset'
|
||||
>
|
||||
<ActionRotateCw size={16} />
|
||||
</button>
|
||||
</div>
|
||||
<div className='flex items-center gap-1.5'>
|
||||
<button onClick={handleDownload} className={btnClass}>
|
||||
<Download size={18} />
|
||||
<button
|
||||
onClick={handleDownload}
|
||||
className={['app-action-button', btnClass]
|
||||
.filter(Boolean)
|
||||
.join(' ')}
|
||||
>
|
||||
<ActionDownload size={18} />
|
||||
</button>
|
||||
<button onClick={handleClose} className={btnClass}>
|
||||
<X size={20} />
|
||||
<button
|
||||
onClick={handleClose}
|
||||
className={['app-action-button', btnClass]
|
||||
.filter(Boolean)
|
||||
.join(' ')}
|
||||
>
|
||||
<ActionX size={20} />
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -17,10 +17,14 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
|
||||
import {
|
||||
Plus as ActionPlus,
|
||||
X as ActionX,
|
||||
} from '@/components/common/icons/ActionIcons';
|
||||
import React from 'react';
|
||||
import { Input, Typography, Button, Switch } from '@/components/ui';
|
||||
import { IconFile } from '@/components/ui/icons';
|
||||
import { Plus, X, Image } from 'lucide-react';
|
||||
import { Image } from 'lucide-react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
const ImageUrlInput = ({
|
||||
@@ -77,7 +81,7 @@ const ImageUrlInput = ({
|
||||
disabled={disabled}
|
||||
/>
|
||||
<Button
|
||||
icon={<Plus size={14} />}
|
||||
icon={<ActionPlus size={14} />}
|
||||
size='small'
|
||||
theme='solid'
|
||||
type='primary'
|
||||
@@ -124,7 +128,7 @@ const ImageUrlInput = ({
|
||||
/>
|
||||
</div>
|
||||
<Button
|
||||
icon={<X size={12} />}
|
||||
icon={<ActionX size={12} />}
|
||||
size='small'
|
||||
theme='borderless'
|
||||
type='danger'
|
||||
|
||||
@@ -17,9 +17,15 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
|
||||
import {
|
||||
RefreshCw as ActionRefreshCw,
|
||||
Copy as ActionCopy,
|
||||
Edit as ActionEdit,
|
||||
UserCheck as ActionUserCheck,
|
||||
Trash2 as ActionTrash2,
|
||||
} from '@/components/common/icons/ActionIcons';
|
||||
import React from 'react';
|
||||
import { Button, Tooltip } from '@/components/ui';
|
||||
import { RefreshCw, Copy, Trash2, UserCheck, Edit } from 'lucide-react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
const MessageActions = ({
|
||||
@@ -57,7 +63,7 @@ const MessageActions = ({
|
||||
theme='borderless'
|
||||
type='tertiary'
|
||||
size='small'
|
||||
icon={<RefreshCw size={styleState.isMobile ? 12 : 14} />}
|
||||
icon={<ActionRefreshCw size={styleState.isMobile ? 12 : 14} />}
|
||||
onClick={() => !shouldDisableActions && onMessageReset(message)}
|
||||
disabled={shouldDisableActions}
|
||||
className={`!rounded-full ${shouldDisableActions ? '!text-gray-300 !cursor-not-allowed' : '!text-gray-400 hover:!text-blue-600 hover:!bg-blue-50'} ${styleState.isMobile ? '!w-6 !h-6' : '!w-7 !h-7'} !p-0 transition-all`}
|
||||
@@ -72,7 +78,7 @@ const MessageActions = ({
|
||||
theme='borderless'
|
||||
type='tertiary'
|
||||
size='small'
|
||||
icon={<Copy size={styleState.isMobile ? 12 : 14} />}
|
||||
icon={<ActionCopy size={styleState.isMobile ? 12 : 14} />}
|
||||
onClick={() => onMessageCopy(message)}
|
||||
className={`!rounded-full !text-gray-400 hover:!text-green-600 hover:!bg-green-50 ${styleState.isMobile ? '!w-6 !h-6' : '!w-7 !h-7'} !p-0 transition-all`}
|
||||
aria-label={t('复制')}
|
||||
@@ -89,7 +95,7 @@ const MessageActions = ({
|
||||
theme='borderless'
|
||||
type='tertiary'
|
||||
size='small'
|
||||
icon={<Edit size={styleState.isMobile ? 12 : 14} />}
|
||||
icon={<ActionEdit size={styleState.isMobile ? 12 : 14} />}
|
||||
onClick={() => !shouldDisableActions && onMessageEdit(message)}
|
||||
disabled={shouldDisableActions}
|
||||
className={`!rounded-full ${shouldDisableActions ? '!text-gray-300 !cursor-not-allowed' : '!text-gray-400 hover:!text-yellow-600 hover:!bg-yellow-50'} ${styleState.isMobile ? '!w-6 !h-6' : '!w-7 !h-7'} !p-0 transition-all`}
|
||||
@@ -113,7 +119,7 @@ const MessageActions = ({
|
||||
theme='borderless'
|
||||
type='tertiary'
|
||||
size='small'
|
||||
icon={<UserCheck size={styleState.isMobile ? 12 : 14} />}
|
||||
icon={<ActionUserCheck size={styleState.isMobile ? 12 : 14} />}
|
||||
onClick={() =>
|
||||
!shouldDisableActions && onRoleToggle && onRoleToggle(message)
|
||||
}
|
||||
@@ -137,7 +143,7 @@ const MessageActions = ({
|
||||
theme='borderless'
|
||||
type='tertiary'
|
||||
size='small'
|
||||
icon={<Trash2 size={styleState.isMobile ? 12 : 14} />}
|
||||
icon={<ActionTrash2 size={styleState.isMobile ? 12 : 14} />}
|
||||
onClick={() => !shouldDisableActions && onMessageDelete(message)}
|
||||
disabled={shouldDisableActions}
|
||||
className={`!rounded-full ${shouldDisableActions ? '!text-gray-300 !cursor-not-allowed' : '!text-gray-400 hover:!text-red-600 hover:!bg-red-50'} ${styleState.isMobile ? '!w-6 !h-6' : '!w-7 !h-7'} !p-0 transition-all`}
|
||||
|
||||
@@ -17,25 +17,23 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
|
||||
import {
|
||||
X as ActionX,
|
||||
Check as ActionCheck,
|
||||
FileText as ActionFileText,
|
||||
Globe as ActionGlobe,
|
||||
ChevronDown as ActionChevronDown,
|
||||
FastForward as ActionFastForward,
|
||||
VolumeX as ActionVolumeX,
|
||||
Volume2 as ActionVolume2,
|
||||
} from '@/components/common/icons/ActionIcons';
|
||||
import React, { useRef, useEffect, useState } from 'react';
|
||||
import { Typography, TextArea, Button, Tooltip } from '@/components/ui';
|
||||
import MarkdownRenderer from '../common/markdown/MarkdownRenderer';
|
||||
import ThinkingContent from './ThinkingContent';
|
||||
import ImagePreviewModal from './ImagePreviewModal';
|
||||
import FilePreviewModal from './FilePreviewModal';
|
||||
import {
|
||||
Loader2,
|
||||
Check,
|
||||
X,
|
||||
FileText,
|
||||
Globe,
|
||||
ExternalLink,
|
||||
Volume2,
|
||||
VolumeX,
|
||||
Sparkles,
|
||||
FastForward,
|
||||
ChevronDown,
|
||||
} from 'lucide-react';
|
||||
import { Loader2, FileText, Globe, ExternalLink, Sparkles } from 'lucide-react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
// 注意:不要从 helpers/utils 里 import getTextContent —— 本组件下方有同名 const,
|
||||
// 同名遮蔽在 Vite/terser 生产构建里会把两者缩成同一个变量名,触发 TDZ 错误:
|
||||
@@ -417,7 +415,7 @@ const MessageContent = ({
|
||||
size='small'
|
||||
type='danger'
|
||||
theme='light'
|
||||
icon={<X size={14} />}
|
||||
icon={<ActionX size={14} />}
|
||||
onClick={onEditCancel}
|
||||
className='flex-1'
|
||||
>
|
||||
@@ -427,7 +425,7 @@ const MessageContent = ({
|
||||
size='small'
|
||||
type='warning'
|
||||
theme='solid'
|
||||
icon={<Check size={14} />}
|
||||
icon={<ActionCheck size={14} />}
|
||||
onClick={onEditSave}
|
||||
disabled={!editValue || editValue.trim() === ''}
|
||||
className='flex-1'
|
||||
@@ -572,7 +570,12 @@ const MessageContent = ({
|
||||
key={index}
|
||||
type='button'
|
||||
onClick={() => setPreviewFile(fileItem.file)}
|
||||
className={`flex items-center gap-2 px-3 py-2 rounded-xl ${s.bg} border border-gray-200/60 dark:border-neutral-700/60 shadow-sm hover:shadow-md hover:scale-[1.02] active:scale-100 transition-all duration-200 group cursor-pointer text-left ${isHistoricalAttachment ? 'opacity-60 grayscale' : ''}`}
|
||||
className={[
|
||||
'app-action-button',
|
||||
`flex items-center gap-2 px-3 py-2 rounded-xl ${s.bg} border border-gray-200/60 dark:border-neutral-700/60 shadow-sm hover:shadow-md hover:scale-[1.02] active:scale-100 transition-all duration-200 group cursor-pointer text-left ${isHistoricalAttachment ? 'opacity-60 grayscale' : ''}`,
|
||||
]
|
||||
.filter(Boolean)
|
||||
.join(' ')}
|
||||
// 历史 chip 已用 Semi Tooltip 显示提示,不再加 native title 防止重影
|
||||
title={
|
||||
isHistoricalAttachment ? undefined : t('点击预览')
|
||||
@@ -590,7 +593,7 @@ const MessageContent = ({
|
||||
: t('附件 {{name}}', { name: fileName })
|
||||
}
|
||||
>
|
||||
<FileText
|
||||
<ActionFileText
|
||||
size={16}
|
||||
className={`${s.color} flex-shrink-0`}
|
||||
/>
|
||||
@@ -701,20 +704,25 @@ const MessageContent = ({
|
||||
<button
|
||||
type='button'
|
||||
onClick={() => setSourcesExpanded((v) => !v)}
|
||||
className={`flex items-center gap-1.5 w-full text-left transition-colors hover:opacity-80 ${sourcesExpanded ? 'mb-2' : ''}`}
|
||||
className={[
|
||||
'app-action-button',
|
||||
`flex items-center gap-1.5 w-full text-left transition-colors hover:opacity-80 ${sourcesExpanded ? 'mb-2' : ''}`,
|
||||
]
|
||||
.filter(Boolean)
|
||||
.join(' ')}
|
||||
aria-expanded={sourcesExpanded}
|
||||
aria-label={
|
||||
sourcesExpanded ? t('收起参考来源') : t('展开参考来源')
|
||||
}
|
||||
>
|
||||
<Globe
|
||||
<ActionGlobe
|
||||
size={13}
|
||||
className='text-brand dark:text-brand-from flex-shrink-0'
|
||||
/>
|
||||
<span className='text-[11px] font-medium text-brand-deep dark:text-brand-from uppercase tracking-wide'>
|
||||
{t('参考来源')} · {message.webSearchSources.length}
|
||||
</span>
|
||||
<ChevronDown
|
||||
<ActionChevronDown
|
||||
size={12}
|
||||
className={`ml-auto text-brand-from dark:text-brand transition-transform duration-200 ${sourcesExpanded ? 'rotate-180' : ''}`}
|
||||
/>
|
||||
@@ -844,10 +852,10 @@ const MessageContent = ({
|
||||
t('请接着上面的内容继续输出,不要重复已经写过的部分'),
|
||||
)
|
||||
}
|
||||
className='inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[11px] bg-amber-50 dark:bg-amber-900/30 hover:bg-amber-100 dark:hover:bg-amber-900/50 text-amber-700 dark:text-amber-300 border border-amber-300/70 dark:border-amber-700/50 transition-colors font-medium'
|
||||
className='app-action-button inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[11px] bg-amber-50 dark:bg-amber-900/30 hover:bg-amber-100 dark:hover:bg-amber-900/50 text-amber-700 dark:text-amber-300 border border-amber-300/70 dark:border-amber-700/50 transition-colors font-medium'
|
||||
title={t('上次响应因长度限制被截断,点击让模型接着写')}
|
||||
>
|
||||
<FastForward size={11} />
|
||||
<ActionFastForward size={11} />
|
||||
{t('继续生成')}
|
||||
</button>
|
||||
)}
|
||||
@@ -856,17 +864,22 @@ const MessageContent = ({
|
||||
<button
|
||||
type='button'
|
||||
onClick={() => tts.speak(message.id, plainText)}
|
||||
className={`inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[11px] transition-colors border ${
|
||||
isThisSpeaking
|
||||
? 'bg-brand/10 dark:bg-brand-deep/30 text-brand-deep dark:text-brand-from border-brand-from dark:border-brand-deep animate-pulse'
|
||||
: 'bg-gray-50/80 dark:bg-neutral-800/60 hover:bg-brand/5 dark:hover:bg-brand-deep/30 text-gray-500 dark:text-gray-400 hover:text-brand-deep dark:hover:text-brand-from border-gray-200/60 dark:border-neutral-700/60'
|
||||
}`}
|
||||
className={[
|
||||
'app-action-button',
|
||||
`inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[11px] transition-colors border ${
|
||||
isThisSpeaking
|
||||
? 'bg-brand/10 dark:bg-brand-deep/30 text-brand-deep dark:text-brand-from border-brand-from dark:border-brand-deep animate-pulse'
|
||||
: 'bg-gray-50/80 dark:bg-neutral-800/60 hover:bg-brand/5 dark:hover:bg-brand-deep/30 text-gray-500 dark:text-gray-400 hover:text-brand-deep dark:hover:text-brand-from border-gray-200/60 dark:border-neutral-700/60'
|
||||
}`,
|
||||
]
|
||||
.filter(Boolean)
|
||||
.join(' ')}
|
||||
title={isThisSpeaking ? t('停止朗读') : t('朗读')}
|
||||
>
|
||||
{isThisSpeaking ? (
|
||||
<VolumeX size={11} />
|
||||
<ActionVolumeX size={11} />
|
||||
) : (
|
||||
<Volume2 size={11} />
|
||||
<ActionVolume2 size={11} />
|
||||
)}
|
||||
{isThisSpeaking ? t('停止朗读') : t('朗读')}
|
||||
</button>
|
||||
@@ -879,7 +892,7 @@ const MessageContent = ({
|
||||
key={idx}
|
||||
type='button'
|
||||
onClick={() => onSendQuickPrompt?.(prompt)}
|
||||
className='inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[11px] bg-gray-50/80 dark:bg-neutral-800/60 hover:bg-brand/5 dark:hover:bg-brand-deep/30 text-gray-500 dark:text-gray-400 hover:text-brand-deep dark:hover:text-brand-from border border-gray-200/60 dark:border-neutral-700/60 transition-colors'
|
||||
className='app-action-button inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[11px] bg-gray-50/80 dark:bg-neutral-800/60 hover:bg-brand/5 dark:hover:bg-brand-deep/30 text-gray-500 dark:text-gray-400 hover:text-brand-deep dark:hover:text-brand-from border border-gray-200/60 dark:border-neutral-700/60 transition-colors'
|
||||
title={t('一键追问')}
|
||||
>
|
||||
<Sparkles size={11} />
|
||||
|
||||
@@ -19,9 +19,12 @@ For commercial licensing, please contact support@quantumnous.com
|
||||
|
||||
// 多选导出:底部悬浮操作条。展示型组件,状态由父级(Playground/index.jsx)持有。
|
||||
|
||||
import {
|
||||
Download as ActionDownload,
|
||||
X as ActionX,
|
||||
} from '@/components/common/icons/ActionIcons';
|
||||
import React, { useState } from 'react';
|
||||
import { Button, RadioGroup, Radio } from '@/components/ui';
|
||||
import { Download, X } from 'lucide-react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
const MessageSelectionBar = ({
|
||||
@@ -76,7 +79,7 @@ const MessageSelectionBar = ({
|
||||
size='small'
|
||||
theme='solid'
|
||||
type='primary'
|
||||
icon={<Download size={14} />}
|
||||
icon={<ActionDownload size={14} />}
|
||||
disabled={selectedCount === 0 || exporting}
|
||||
loading={exporting}
|
||||
onClick={handleExport}
|
||||
@@ -89,7 +92,7 @@ const MessageSelectionBar = ({
|
||||
<Button
|
||||
size='small'
|
||||
theme='borderless'
|
||||
icon={<X size={14} />}
|
||||
icon={<ActionX size={14} />}
|
||||
// 导出进行中禁用「取消」——否则 bar 被关闭但 docx 仍在 await 中,
|
||||
// 最终仍会触发一次下载,对用户体感是「我已经取消了为什么还有文件」。
|
||||
disabled={exporting}
|
||||
|
||||
@@ -17,19 +17,14 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
|
||||
import {
|
||||
Check as ActionCheck,
|
||||
X as ActionX,
|
||||
} from '@/components/common/icons/ActionIcons';
|
||||
import React from 'react';
|
||||
import { Input, Slider, Typography, Button, Tag } from '@/components/ui';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import {
|
||||
Hash,
|
||||
Thermometer,
|
||||
Target,
|
||||
Repeat,
|
||||
Ban,
|
||||
Shuffle,
|
||||
Check,
|
||||
X,
|
||||
} from 'lucide-react';
|
||||
import { Hash, Thermometer, Target, Repeat, Ban, Shuffle } from 'lucide-react';
|
||||
|
||||
const ParameterControl = ({
|
||||
inputs,
|
||||
@@ -62,9 +57,9 @@ const ParameterControl = ({
|
||||
size='small'
|
||||
icon={
|
||||
parameterEnabled.temperature ? (
|
||||
<Check size={10} />
|
||||
<ActionCheck size={10} />
|
||||
) : (
|
||||
<X size={10} />
|
||||
<ActionX size={10} />
|
||||
)
|
||||
}
|
||||
onClick={() => onParameterToggle('temperature')}
|
||||
@@ -105,7 +100,11 @@ const ParameterControl = ({
|
||||
type={parameterEnabled.top_p ? 'primary' : 'tertiary'}
|
||||
size='small'
|
||||
icon={
|
||||
parameterEnabled.top_p ? <Check size={10} /> : <X size={10} />
|
||||
parameterEnabled.top_p ? (
|
||||
<ActionCheck size={10} />
|
||||
) : (
|
||||
<ActionX size={10} />
|
||||
)
|
||||
}
|
||||
onClick={() => onParameterToggle('top_p')}
|
||||
className='!rounded-full !w-4 !h-4 !p-0 !min-w-0 param-toggle-hit'
|
||||
@@ -146,9 +145,9 @@ const ParameterControl = ({
|
||||
size='small'
|
||||
icon={
|
||||
parameterEnabled.frequency_penalty ? (
|
||||
<Check size={10} />
|
||||
<ActionCheck size={10} />
|
||||
) : (
|
||||
<X size={10} />
|
||||
<ActionX size={10} />
|
||||
)
|
||||
}
|
||||
onClick={() => onParameterToggle('frequency_penalty')}
|
||||
@@ -190,9 +189,9 @@ const ParameterControl = ({
|
||||
size='small'
|
||||
icon={
|
||||
parameterEnabled.presence_penalty ? (
|
||||
<Check size={10} />
|
||||
<ActionCheck size={10} />
|
||||
) : (
|
||||
<X size={10} />
|
||||
<ActionX size={10} />
|
||||
)
|
||||
}
|
||||
onClick={() => onParameterToggle('presence_penalty')}
|
||||
@@ -231,9 +230,9 @@ const ParameterControl = ({
|
||||
size='small'
|
||||
icon={
|
||||
parameterEnabled.max_tokens ? (
|
||||
<Check size={10} />
|
||||
<ActionCheck size={10} />
|
||||
) : (
|
||||
<X size={10} />
|
||||
<ActionX size={10} />
|
||||
)
|
||||
}
|
||||
onClick={() => onParameterToggle('max_tokens')}
|
||||
@@ -272,7 +271,13 @@ const ParameterControl = ({
|
||||
theme={parameterEnabled.seed ? 'solid' : 'borderless'}
|
||||
type={parameterEnabled.seed ? 'primary' : 'tertiary'}
|
||||
size='small'
|
||||
icon={parameterEnabled.seed ? <Check size={10} /> : <X size={10} />}
|
||||
icon={
|
||||
parameterEnabled.seed ? (
|
||||
<ActionCheck size={10} />
|
||||
) : (
|
||||
<ActionX size={10} />
|
||||
)
|
||||
}
|
||||
onClick={() => onParameterToggle('seed')}
|
||||
className='!rounded-full !w-4 !h-4 !p-0 !min-w-0 param-toggle-hit'
|
||||
disabled={disabled}
|
||||
|
||||
@@ -17,6 +17,11 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
|
||||
import {
|
||||
Copy as ActionCopy,
|
||||
ChevronUp as ActionChevronUp,
|
||||
ChevronDown as ActionChevronDown,
|
||||
} from '@/components/common/icons/ActionIcons';
|
||||
import React, { useState, useMemo, useCallback } from 'react';
|
||||
import {
|
||||
Button,
|
||||
@@ -26,14 +31,7 @@ import {
|
||||
Badge,
|
||||
Typography,
|
||||
} from '@/components/ui';
|
||||
import {
|
||||
Copy,
|
||||
ChevronDown,
|
||||
ChevronUp,
|
||||
Zap,
|
||||
CheckCircle,
|
||||
XCircle,
|
||||
} from 'lucide-react';
|
||||
import { Zap, CheckCircle, XCircle } from 'lucide-react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { copy } from '../../helpers';
|
||||
|
||||
@@ -167,7 +165,7 @@ const SSEViewer = ({ sseData }) => {
|
||||
{JSON.stringify(item.parsed, null, 2)}
|
||||
</pre>
|
||||
<Button
|
||||
icon={<Copy size={12} />}
|
||||
icon={<ActionCopy size={12} />}
|
||||
size='small'
|
||||
theme='borderless'
|
||||
onClick={() => handleCopySingle(item)}
|
||||
@@ -235,7 +233,7 @@ const SSEViewer = ({ sseData }) => {
|
||||
<div className='flex items-center gap-2'>
|
||||
<Tooltip content={t('复制全部')}>
|
||||
<Button
|
||||
icon={<Copy size={14} />}
|
||||
icon={<ActionCopy size={14} />}
|
||||
size='small'
|
||||
onClick={handleCopyAll}
|
||||
theme='borderless'
|
||||
@@ -253,9 +251,9 @@ const SSEViewer = ({ sseData }) => {
|
||||
<Button
|
||||
icon={
|
||||
expandedKeys.length === parsedSSEData.length ? (
|
||||
<ChevronUp size={14} />
|
||||
<ActionChevronUp size={14} />
|
||||
) : (
|
||||
<ChevronDown size={14} />
|
||||
<ActionChevronDown size={14} />
|
||||
)
|
||||
}
|
||||
size='small'
|
||||
|
||||
@@ -17,6 +17,13 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
|
||||
import {
|
||||
ChevronRight as ActionChevronRight,
|
||||
Plus as ActionPlus,
|
||||
X as ActionX,
|
||||
ChevronLeft as ActionChevronLeft,
|
||||
MoreHorizontal as ActionMoreHorizontal,
|
||||
} from '@/components/common/icons/ActionIcons';
|
||||
import React, {
|
||||
useMemo,
|
||||
useState,
|
||||
@@ -35,14 +42,9 @@ import {
|
||||
Dropdown,
|
||||
} from '@/components/ui';
|
||||
import {
|
||||
Plus,
|
||||
MessageSquare,
|
||||
Trash2,
|
||||
ChevronLeft,
|
||||
ChevronRight,
|
||||
Search,
|
||||
X,
|
||||
MoreHorizontal,
|
||||
Edit3,
|
||||
Sparkles,
|
||||
Download,
|
||||
@@ -200,7 +202,7 @@ const SessionSidebar = ({
|
||||
<div className='relative flex flex-col items-center pt-4 gap-2'>
|
||||
<Tooltip content={t('展开会话列表')} position='right'>
|
||||
<Button
|
||||
icon={<ChevronRight size={16} />}
|
||||
icon={<ActionChevronRight size={16} />}
|
||||
theme='borderless'
|
||||
type='tertiary'
|
||||
onClick={onToggleCollapse}
|
||||
@@ -209,7 +211,7 @@ const SessionSidebar = ({
|
||||
</Tooltip>
|
||||
<Tooltip content={t('新建对话')} position='right'>
|
||||
<Button
|
||||
icon={<Plus size={16} />}
|
||||
icon={<ActionPlus size={16} />}
|
||||
theme='solid'
|
||||
type='primary'
|
||||
loading={creating}
|
||||
@@ -254,7 +256,7 @@ const SessionSidebar = ({
|
||||
</div>
|
||||
{isMobile && onClose ? (
|
||||
<Button
|
||||
icon={<X size={16} />}
|
||||
icon={<ActionX size={16} />}
|
||||
theme='borderless'
|
||||
type='tertiary'
|
||||
onClick={onClose}
|
||||
@@ -265,7 +267,7 @@ const SessionSidebar = ({
|
||||
onToggleCollapse && (
|
||||
<Tooltip content={t('收起')} position='bottom'>
|
||||
<Button
|
||||
icon={<ChevronLeft size={16} />}
|
||||
icon={<ActionChevronLeft size={16} />}
|
||||
theme='borderless'
|
||||
type='tertiary'
|
||||
onClick={onToggleCollapse}
|
||||
@@ -280,7 +282,7 @@ const SessionSidebar = ({
|
||||
{/* 新建按钮 */}
|
||||
<div className='relative px-3 pb-2'>
|
||||
<Button
|
||||
icon={<Plus size={16} />}
|
||||
icon={<ActionPlus size={16} />}
|
||||
theme='solid'
|
||||
type='primary'
|
||||
block
|
||||
@@ -486,15 +488,11 @@ const SessionSidebar = ({
|
||||
>
|
||||
<button
|
||||
type='button'
|
||||
className='
|
||||
opacity-0 group-hover:opacity-100 [@media(hover:none)]:opacity-100 transition-opacity
|
||||
flex-shrink-0 p-1 rounded hover:bg-gray-200/80 dark:hover:bg-neutral-700/80
|
||||
text-gray-400 hover:text-gray-700 dark:hover:text-gray-200
|
||||
'
|
||||
className='app-action-button \n opacity-0 group-hover:opacity-100 [@media(hover:none)]:opacity-100 transition-opacity\n flex-shrink-0 p-1 rounded hover:bg-gray-200/80 dark:hover:bg-neutral-700/80\n text-gray-400 hover:text-gray-700 dark:hover:text-gray-200\n '
|
||||
onClick={(e) => e.stopPropagation()}
|
||||
aria-label={t('更多操作')}
|
||||
>
|
||||
<MoreHorizontal size={14} />
|
||||
<ActionMoreHorizontal size={14} />
|
||||
</button>
|
||||
</Dropdown>
|
||||
)}
|
||||
|
||||
@@ -17,17 +17,10 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
|
||||
import { X as ActionX } from '@/components/common/icons/ActionIcons';
|
||||
import React from 'react';
|
||||
import { Select, Typography, Button, Switch } from '@/components/ui';
|
||||
import {
|
||||
Users,
|
||||
ToggleLeft,
|
||||
X,
|
||||
Settings,
|
||||
Sliders,
|
||||
Bot,
|
||||
Zap,
|
||||
} from 'lucide-react';
|
||||
import { Users, ToggleLeft, Settings, Sliders, Bot, Zap } from 'lucide-react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import {
|
||||
renderGroupOption,
|
||||
@@ -133,7 +126,7 @@ const SettingsPanel = ({
|
||||
|
||||
{styleState.isMobile && onCloseSettings && (
|
||||
<Button
|
||||
icon={<X size={16} />}
|
||||
icon={<ActionX size={16} />}
|
||||
onClick={onCloseSettings}
|
||||
theme='borderless'
|
||||
type='tertiary'
|
||||
|
||||
Reference in New Issue
Block a user