update: md渲染优化与依赖更新(0715 02:07)
This commit is contained in:
@@ -5,6 +5,8 @@
|
||||
"ComputedRef": true,
|
||||
"DirectiveBinding": true,
|
||||
"EffectScope": true,
|
||||
"ElMessage": true,
|
||||
"ElMessageBox": true,
|
||||
"ExtractDefaultPropTypes": true,
|
||||
"ExtractPropTypes": true,
|
||||
"ExtractPublicPropTypes": true,
|
||||
|
||||
@@ -31,56 +31,58 @@
|
||||
"dependencies": {
|
||||
"@element-plus/icons-vue": "^2.3.1",
|
||||
"@fingerprintjs/fingerprintjs": "^3.4.2",
|
||||
"@floating-ui/core": "^1.7.1",
|
||||
"@floating-ui/dom": "^1.7.1",
|
||||
"@floating-ui/vue": "^1.1.6",
|
||||
"@floating-ui/core": "^1.7.2",
|
||||
"@floating-ui/dom": "^1.7.2",
|
||||
"@floating-ui/vue": "^1.1.7",
|
||||
"@jsonlee_12138/enum": "^1.0.4",
|
||||
"@vueuse/core": "^13.3.0",
|
||||
"@vueuse/integrations": "^13.3.0",
|
||||
"element-plus": "^2.9.11",
|
||||
"@vueuse/core": "^13.5.0",
|
||||
"@vueuse/integrations": "^13.5.0",
|
||||
"element-plus": "^2.10.4",
|
||||
"fingerprintjs": "^0.5.3",
|
||||
"hook-fetch": "^2.0.4-beta.1",
|
||||
"lodash-es": "^4.17.21",
|
||||
"nprogress": "^0.2.0",
|
||||
"pinia": "^3.0.3",
|
||||
"pinia-plugin-persistedstate": "^4.3.0",
|
||||
"pinia-plugin-persistedstate": "^4.4.1",
|
||||
"qrcode": "^1.5.4",
|
||||
"radash": "^12.1.0",
|
||||
"radash": "^12.1.1",
|
||||
"reset-css": "^5.0.2",
|
||||
"vue": "^3.5.16",
|
||||
"vue": "^3.5.17",
|
||||
"vue-element-plus-x": "1.3.0",
|
||||
"vue-router": "4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@antfu/eslint-config": "^4.13.3",
|
||||
"@changesets/cli": "^2.29.4",
|
||||
"@antfu/eslint-config": "^4.16.2",
|
||||
"@changesets/cli": "^2.29.5",
|
||||
"@commitlint/config-conventional": "^19.8.1",
|
||||
"@types/fingerprintjs__fingerprintjs": "^3.0.2",
|
||||
"@vitejs/plugin-vue": "^5.2.4",
|
||||
"@vitejs/plugin-vue": "^6.0.0",
|
||||
"@vue/tsconfig": "^0.7.0",
|
||||
"commitlint": "^19.8.1",
|
||||
"cz-git": "^1.11.1",
|
||||
"eslint": "^9.28.0",
|
||||
"cz-git": "^1.12.0",
|
||||
"eslint": "^9.31.0",
|
||||
"husky": "^9.1.7",
|
||||
"lint-staged": "^16.1.0",
|
||||
"prettier": "^3.5.3",
|
||||
"sass-embedded": "^1.89.1",
|
||||
"stylelint": "^16.20.0",
|
||||
"lint-staged": "^16.1.2",
|
||||
"postcss": "8.4.31",
|
||||
"postcss-html": "1.5.0",
|
||||
"prettier": "^3.6.2",
|
||||
"sass-embedded": "^1.89.2",
|
||||
"stylelint": "^16.21.2",
|
||||
"stylelint-config-html": "^1.1.0",
|
||||
"stylelint-config-recess-order": "^6.0.0",
|
||||
"stylelint-config-recess-order": "^7.1.0",
|
||||
"stylelint-config-recommended-scss": "^15.0.1",
|
||||
"stylelint-config-recommended-vue": "^1.6.0",
|
||||
"stylelint-config-recommended-vue": "^1.6.1",
|
||||
"stylelint-config-standard": "^38.0.0",
|
||||
"stylelint-config-standard-scss": "^15.0.1",
|
||||
"typescript": "~5.8.3",
|
||||
"typescript-api-pro": "^0.0.7",
|
||||
"unocss": "66.1.3",
|
||||
"unocss": "66.3.3",
|
||||
"unplugin-auto-import": "^19.3.0",
|
||||
"unplugin-vue-components": "^28.7.0",
|
||||
"unplugin-vue-components": "^28.8.0",
|
||||
"vite": "^6.3.5",
|
||||
"vite-plugin-env-typed": "^0.0.2",
|
||||
"vite-plugin-svg-icons": "^2.0.1",
|
||||
"vue-tsc": "^2.2.10"
|
||||
"vue-tsc": "^3.0.1"
|
||||
},
|
||||
"config": {
|
||||
"commitizen": {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
<!-- 每个回话对应的聊天内容 -->
|
||||
<script setup lang="ts">
|
||||
import type { AnyObject } from 'typescript-api-pro';
|
||||
import type { Sender } from 'vue-element-plus-x';
|
||||
import type { BubbleProps } from 'vue-element-plus-x/types/Bubble';
|
||||
import type { BubbleListInstance } from 'vue-element-plus-x/types/BubbleList';
|
||||
import type { FilesCardProps } from 'vue-element-plus-x/types/FilesCard';
|
||||
@@ -10,6 +9,7 @@ import { ArrowLeftBold, ArrowRightBold, Loading } from '@element-plus/icons-vue'
|
||||
import { ElIcon, ElMessage } from 'element-plus';
|
||||
import { useHookFetch } from 'hook-fetch/vue';
|
||||
import { computed, nextTick, ref, watch } from 'vue';
|
||||
import { Sender } from 'vue-element-plus-x';
|
||||
import { useRoute } from 'vue-router';
|
||||
import { send } from '@/api';
|
||||
import ModelSelect from '@/components/ModelSelect/index.vue';
|
||||
@@ -27,6 +27,7 @@ type MessageItem = BubbleProps & {
|
||||
avatar: string;
|
||||
thinkingStatus?: ThinkingStatus;
|
||||
thinlCollapse?: boolean;
|
||||
reasoning_content?: string;
|
||||
};
|
||||
|
||||
const route = useRoute();
|
||||
@@ -242,6 +243,7 @@ function addMessage(message: string, isUser: boolean) {
|
||||
reasoning_content: '',
|
||||
thinkingStatus: 'start',
|
||||
thinlCollapse: false,
|
||||
noStyle: !isUser,
|
||||
};
|
||||
bubbleItems.value.push(obj);
|
||||
}
|
||||
@@ -292,7 +294,12 @@ function copy(item: any) {
|
||||
</template>
|
||||
<!-- 自定义气泡内容 -->
|
||||
<template #content="{ item }">
|
||||
<XMarkdown v-if="item.content" class="markdown-body" :markdown="item.content" />
|
||||
<!-- chat 内容走 markdown -->
|
||||
<XMarkdown v-if="item.content && (item.role === 'assistant' || item.role === 'system')" class="markdown-body" :markdown="item.content" :themes="{ light: 'github-light', dark: 'github-dark' }" default-theme-mode="dark" />
|
||||
<!-- user 内容 纯文本 -->
|
||||
<div v-if="item.content && item.role === 'user'" class="user-content">
|
||||
{{ item.content }}
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<!-- 自定义底部 -->
|
||||
@@ -392,9 +399,21 @@ function copy(item: any) {
|
||||
overflow: hidden;
|
||||
border-radius: 12px;
|
||||
}
|
||||
.user-content {
|
||||
// 换行
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
.markdown-body {
|
||||
background-color: transparent;
|
||||
}
|
||||
.markdown-elxLanguage-header-div {
|
||||
top: -25px !important;
|
||||
}
|
||||
|
||||
// xmarkdown 样式
|
||||
.elx-xmarkdown-container {
|
||||
padding: 8px 4px;
|
||||
}
|
||||
}
|
||||
.chat-defaul-sender {
|
||||
width: 100%;
|
||||
|
||||
@@ -20,5 +20,5 @@
|
||||
"skipLibCheck": true,
|
||||
"noUncheckedSideEffectImports": true
|
||||
},
|
||||
"include": ["vite.config.ts"]
|
||||
"include": ["vite.config.mts"]
|
||||
}
|
||||
|
||||
27
Yi.Ai.Vue3/types/components.d.ts
vendored
27
Yi.Ai.Vue3/types/components.d.ts
vendored
@@ -11,6 +11,30 @@ declare module 'vue' {
|
||||
AccountPassword: typeof import('./../src/components/LoginDialog/components/FormLogin/AccountPassword.vue')['default']
|
||||
APIKeyManagement: typeof import('./../src/components/userPersonalCenter/components/APIKeyManagement.vue')['default']
|
||||
DeepThinking: typeof import('./../src/components/DeepThinking/index.vue')['default']
|
||||
ElAlert: typeof import('element-plus/es')['ElAlert']
|
||||
ElAvatar: typeof import('element-plus/es')['ElAvatar']
|
||||
ElButton: typeof import('element-plus/es')['ElButton']
|
||||
ElButtonGroup: typeof import('element-plus/es')['ElButtonGroup']
|
||||
ElCard: typeof import('element-plus/es')['ElCard']
|
||||
ElCollapse: typeof import('element-plus/es')['ElCollapse']
|
||||
ElCollapseItem: typeof import('element-plus/es')['ElCollapseItem']
|
||||
ElContainer: typeof import('element-plus/es')['ElContainer']
|
||||
ElDialog: typeof import('element-plus/es')['ElDialog']
|
||||
ElDivider: typeof import('element-plus/es')['ElDivider']
|
||||
ElEmpty: typeof import('element-plus/es')['ElEmpty']
|
||||
ElForm: typeof import('element-plus/es')['ElForm']
|
||||
ElFormItem: typeof import('element-plus/es')['ElFormItem']
|
||||
ElHeader: typeof import('element-plus/es')['ElHeader']
|
||||
ElIcon: typeof import('element-plus/es')['ElIcon']
|
||||
ElImage: typeof import('element-plus/es')['ElImage']
|
||||
ElInput: typeof import('element-plus/es')['ElInput']
|
||||
ElMain: typeof import('element-plus/es')['ElMain']
|
||||
ElMenu: typeof import('element-plus/es')['ElMenu']
|
||||
ElMenuItem: typeof import('element-plus/es')['ElMenuItem']
|
||||
ElPagination: typeof import('element-plus/es')['ElPagination']
|
||||
ElTable: typeof import('element-plus/es')['ElTable']
|
||||
ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
|
||||
ElTooltip: typeof import('element-plus/es')['ElTooltip']
|
||||
FilesSelect: typeof import('./../src/components/FilesSelect/index.vue')['default']
|
||||
IconSelect: typeof import('./../src/components/IconSelect/index.vue')['default']
|
||||
Indexl: typeof import('./../src/components/SupportModelProducts/indexl.vue')['default']
|
||||
@@ -29,4 +53,7 @@ declare module 'vue' {
|
||||
VerificationCode: typeof import('./../src/components/LoginDialog/components/FormLogin/VerificationCode.vue')['default']
|
||||
WelecomeText: typeof import('./../src/components/WelecomeText/index.vue')['default']
|
||||
}
|
||||
export interface GlobalDirectives {
|
||||
vLoading: typeof import('element-plus/es')['ElLoadingDirective']
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user