refertor:使用antdX重构dify聊天渲染组件,到处引用文件
This commit is contained in:
@@ -298,4 +298,201 @@
|
||||
.message-card.assistant .markdown-content {
|
||||
background-color: #a4e2ad;
|
||||
max-width: 65vh;
|
||||
}
|
||||
|
||||
/* ============================================================================ */
|
||||
/* 引用来源样式 - 绿白主题配色 */
|
||||
/* ============================================================================ */
|
||||
|
||||
/* 普通引用上标 */
|
||||
.source-ref-plain {
|
||||
color: #00684a;
|
||||
font-size: 0.75em;
|
||||
vertical-align: super;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
/* 引用来源面板外层容器 */
|
||||
.sources-panel-wrapper {
|
||||
padding-left: 8px;
|
||||
margin-top: 4px;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
/* 引用来源面板 - 更紧凑的设计 */
|
||||
.sources-panel {
|
||||
padding: 6px 10px;
|
||||
background: transparent;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.sources-panel-header {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
font-size: 11px;
|
||||
font-weight: 500;
|
||||
color: #6b7280;
|
||||
margin-right: 8px;
|
||||
}
|
||||
|
||||
.sources-panel-header i {
|
||||
font-size: 12px;
|
||||
color: #00684a;
|
||||
}
|
||||
|
||||
.sources-panel-list {
|
||||
display: inline-flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 6px;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
/* 引用项 - 更小更紧凑 */
|
||||
.source-item {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
padding: 2px 8px;
|
||||
background: #fff;
|
||||
border: 1px solid #d1e7dd;
|
||||
border-radius: 12px;
|
||||
font-size: 11px;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s ease;
|
||||
max-width: 200px;
|
||||
}
|
||||
|
||||
.source-item:hover {
|
||||
border-color: #00684a;
|
||||
background: #f0fdf4;
|
||||
}
|
||||
|
||||
/* 引用编号 - 使用绿色主题 */
|
||||
.source-item-number {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
background: #00684a;
|
||||
color: #fff;
|
||||
border-radius: 50%;
|
||||
font-size: 9px;
|
||||
font-weight: 600;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.source-item-name {
|
||||
color: #374151;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
/* 得分显示 - 使用绿色渐变 */
|
||||
.source-item-score {
|
||||
flex-shrink: 0;
|
||||
font-size: 10px;
|
||||
color: #00684a;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
/* 引用来源 Tooltip 样式 - 绿色半透明主题 */
|
||||
.source-tooltip-overlay {
|
||||
max-width: 480px !important;
|
||||
}
|
||||
|
||||
.source-tooltip-overlay .ant-tooltip-inner {
|
||||
padding: 12px 14px;
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 4px 16px rgba(0, 104, 74, 0.25);
|
||||
}
|
||||
|
||||
.source-tooltip {
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.source-tooltip-header {
|
||||
margin-bottom: 10px;
|
||||
padding-bottom: 8px;
|
||||
border-bottom: 1px solid rgba(255, 255, 255, 0.2);
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.source-tooltip-content {
|
||||
font-size: 12px;
|
||||
line-height: 1.6;
|
||||
color: rgba(255, 255, 255, 0.95);
|
||||
margin-bottom: 10px;
|
||||
white-space: pre-wrap;
|
||||
word-break: break-word;
|
||||
max-height: 300px;
|
||||
overflow-y: auto;
|
||||
padding-right: 4px;
|
||||
}
|
||||
|
||||
/* 自定义滚动条样式 */
|
||||
.source-tooltip-content::-webkit-scrollbar {
|
||||
width: 5px;
|
||||
}
|
||||
|
||||
.source-tooltip-content::-webkit-scrollbar-track {
|
||||
background: rgba(255, 255, 255, 0.1);
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
.source-tooltip-content::-webkit-scrollbar-thumb {
|
||||
background: rgba(255, 255, 255, 0.35);
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
.source-tooltip-content::-webkit-scrollbar-thumb:hover {
|
||||
background: rgba(255, 255, 255, 0.5);
|
||||
}
|
||||
|
||||
.source-tooltip-meta {
|
||||
font-size: 11px;
|
||||
color: rgba(255, 255, 255, 0.7);
|
||||
padding-top: 8px;
|
||||
border-top: 1px solid rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
|
||||
/* Ant Design X Sources 组件样式覆盖 - 使用绿色主题 */
|
||||
.markdown-content .ant-x-sources {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
.markdown-content .ant-x-sources-tag {
|
||||
font-size: 11px;
|
||||
padding: 0 3px;
|
||||
cursor: pointer;
|
||||
color: #00684a;
|
||||
background: transparent;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.markdown-content .ant-x-sources-tag:hover {
|
||||
color: #005a3f;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
/* 响应式调整 */
|
||||
@media (max-width: 768px) {
|
||||
.sources-panel-wrapper {
|
||||
padding-left: 4px;
|
||||
}
|
||||
|
||||
.sources-panel-list {
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.source-item {
|
||||
max-width: 180px;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user