diff --git a/electron.vite.config.ts b/electron.vite.config.ts index 83f82b5f4..af821caa6 100644 --- a/electron.vite.config.ts +++ b/electron.vite.config.ts @@ -4,7 +4,7 @@ import { defineConfig, externalizeDepsPlugin } from 'electron-vite' import { resolve } from 'path' import { visualizer } from 'rollup-plugin-visualizer' -import pkg from './package.json' assert { type: 'json' } +import pkg from './package.json' const visualizerPlugin = (type: 'renderer' | 'main') => { return process.env[`VISUALIZER_${type.toUpperCase()}`] ? [visualizer({ open: true })] : [] diff --git a/packages/aiCore/package.json b/packages/aiCore/package.json index e61db529e..cdf68d901 100644 --- a/packages/aiCore/package.json +++ b/packages/aiCore/package.json @@ -13,15 +13,7 @@ "test": "vitest run", "test:watch": "vitest" }, - "keywords": [ - "ai", - "sdk", - "openai", - "anthropic", - "google", - "cherry-studio", - "vercel-ai-sdk" - ], + "keywords": ["ai", "sdk", "openai", "anthropic", "google", "cherry-studio", "vercel-ai-sdk"], "author": "Cherry Studio", "license": "MIT", "repository": { @@ -56,9 +48,7 @@ "engines": { "node": ">=18.0.0" }, - "files": [ - "dist" - ], + "files": ["dist"], "exports": { ".": { "types": "./dist/index.d.ts", diff --git a/packages/aiCore/src/core/plugins/built-in/googleToolsPlugin/index.ts b/packages/aiCore/src/core/plugins/built-in/googleToolsPlugin/index.ts index cb581e17c..09a741d9f 100644 --- a/packages/aiCore/src/core/plugins/built-in/googleToolsPlugin/index.ts +++ b/packages/aiCore/src/core/plugins/built-in/googleToolsPlugin/index.ts @@ -24,7 +24,6 @@ export const googleToolsPlugin = (config?: ToolConfig) => if (!typedParams.tools) { typedParams.tools = {} } - // 使用类型安全的方式遍历配置 ;(Object.keys(config) as ToolConfigKey[]).forEach((key) => { if (config[key] && key in toolNameMap && key in google.tools) { diff --git a/packages/aiCore/tsconfig.json b/packages/aiCore/tsconfig.json index 9ee30166c..110b2106e 100644 --- a/packages/aiCore/tsconfig.json +++ b/packages/aiCore/tsconfig.json @@ -1,26 +1,21 @@ { "compilerOptions": { - "target": "ES2020", + "allowSyntheticDefaultImports": true, + "declaration": true, + "emitDecoratorMetadata": true, + "esModuleInterop": true, + "experimentalDecorators": true, + "forceConsistentCasingInFileNames": true, "module": "ESNext", "moduleResolution": "bundler", - "declaration": true, - "outDir": "./dist", - "rootDir": "./src", - "strict": true, - "esModuleInterop": true, - "skipLibCheck": true, - "forceConsistentCasingInFileNames": true, - "resolveJsonModule": true, - "allowSyntheticDefaultImports": true, "noEmitOnError": false, - "experimentalDecorators": true, - "emitDecoratorMetadata": true + "outDir": "./dist", + "resolveJsonModule": true, + "rootDir": "./src", + "skipLibCheck": true, + "strict": true, + "target": "ES2020" }, - "include": [ - "src/**/*" - ], - "exclude": [ - "node_modules", - "dist" - ] -} \ No newline at end of file + "exclude": ["node_modules", "dist"], + "include": ["src/**/*"] +} diff --git a/packages/extension-table-plus/package.json b/packages/extension-table-plus/package.json index d34c25ccd..0128bd296 100755 --- a/packages/extension-table-plus/package.json +++ b/packages/extension-table-plus/package.json @@ -3,10 +3,7 @@ "description": "table extension for tiptap forked from tiptap/extension-table", "version": "3.0.11", "homepage": "https://cherry-ai.com", - "keywords": [ - "tiptap", - "tiptap extension" - ], + "keywords": ["tiptap", "tiptap extension"], "license": "MIT", "type": "module", "exports": { @@ -62,10 +59,7 @@ "main": "dist/index.cjs", "module": "dist/index.js", "types": "dist/index.d.ts", - "files": [ - "src", - "dist" - ], + "files": ["src", "dist"], "devDependencies": { "@tiptap/core": "^3.2.0", "@tiptap/pm": "^3.2.0", diff --git a/src/renderer/src/assets/fonts/country-flag-fonts/flag.css b/src/renderer/src/assets/fonts/country-flag-fonts/flag.css index b73d4ae76..50447f413 100644 --- a/src/renderer/src/assets/fonts/country-flag-fonts/flag.css +++ b/src/renderer/src/assets/fonts/country-flag-fonts/flag.css @@ -1,13 +1,13 @@ @font-face { - font-family: 'Twemoji Country Flags'; + font-family: "Twemoji Country Flags"; unicode-range: U+1F1E6-1F1FF, U+1F3F4, U+E0062-E0063, U+E0065, U+E0067, U+E006C, U+E006E, U+E0073-E0074, U+E0077, U+E007F; /*https://github.com/beyondkmp/country-flag-emoji-polyfill/blob/master/font/TwemojiCountryFlags.woff2 */ - src: url('TwemojiCountryFlags.woff2') format('woff2'); + src: url("TwemojiCountryFlags.woff2") format("woff2"); font-display: swap; } /* 国旗字体样式类 */ .country-flag-font { - font-family: 'Twemoji Country Flags', 'Apple Color Emoji', 'Segoe UI Emoji', sans-serif; + font-family: "Twemoji Country Flags", "Apple Color Emoji", "Segoe UI Emoji", sans-serif; } diff --git a/src/renderer/src/assets/fonts/icon-fonts/iconfont.css b/src/renderer/src/assets/fonts/icon-fonts/iconfont.css index ae76c0026..dbb0603ad 100644 --- a/src/renderer/src/assets/fonts/icon-fonts/iconfont.css +++ b/src/renderer/src/assets/fonts/icon-fonts/iconfont.css @@ -1,10 +1,10 @@ @font-face { - font-family: 'iconfont'; /* Project id 4753420 */ - src: url('iconfont.woff2?t=1742793497518') format('woff2'); + font-family: "iconfont"; /* Project id 4753420 */ + src: url("iconfont.woff2?t=1742793497518") format("woff2"); } .iconfont { - font-family: 'iconfont' !important; + font-family: "iconfont" !important; font-size: 16px; font-style: normal; -webkit-font-smoothing: antialiased; @@ -12,101 +12,101 @@ } .icon-plugin:before { - content: '\e612'; + content: "\e612"; } .icon-tools:before { - content: '\e762'; + content: "\e762"; } .icon-OCRshibie:before { - content: '\e658'; + content: "\e658"; } .icon-obsidian:before { - content: '\e677'; + content: "\e677"; } .icon-notion:before { - content: '\e690'; + content: "\e690"; } .icon-thinking:before { - content: '\e65b'; + content: "\e65b"; } .icon-at:before { - content: '\e623'; + content: "\e623"; } .icon-icon-adaptive-width:before { - content: '\e87a'; + content: "\e87a"; } .icon-at1:before { - content: '\e630'; + content: "\e630"; } .icon-ai-model:before { - content: '\e827'; + content: "\e827"; } .icon-ai-model1:before { - content: '\ec09'; + content: "\ec09"; } .icon-gridlines:before { - content: '\e942'; + content: "\e942"; } .icon-inbox:before { - content: '\e869'; + content: "\e869"; } .icon-business-smart-assistant:before { - content: '\e601'; + content: "\e601"; } .icon-copy:before { - content: '\e6ae'; + content: "\e6ae"; } .icon-ic_send:before { - content: '\e795'; + content: "\e795"; } .icon-dark1:before { - content: '\e72f'; + content: "\e72f"; } .icon-theme-light:before { - content: '\e6b7'; + content: "\e6b7"; } .icon-translate_line:before { - content: '\e7de'; + content: "\e7de"; } .icon-history:before { - content: '\e758'; + content: "\e758"; } .icon-hide-sidebar:before { - content: '\e8eb'; + content: "\e8eb"; } .icon-show-sidebar:before { - content: '\e944'; + content: "\e944"; } .icon-appstore:before { - content: '\e792'; + content: "\e792"; } .icon-chat:before { - content: '\e615'; + content: "\e615"; } .icon-setting:before { - content: '\e78e'; + content: "\e78e"; } diff --git a/src/renderer/src/assets/fonts/ubuntu/ubuntu.css b/src/renderer/src/assets/fonts/ubuntu/ubuntu.css index 0a0317a9d..12fc9e1f9 100644 --- a/src/renderer/src/assets/fonts/ubuntu/ubuntu.css +++ b/src/renderer/src/assets/fonts/ubuntu/ubuntu.css @@ -1,55 +1,55 @@ @font-face { - font-family: 'Ubuntu'; - src: url('Ubuntu-Regular.ttf') format('truetype'); + font-family: "Ubuntu"; + src: url("Ubuntu-Regular.ttf") format("truetype"); font-weight: normal; font-style: normal; } @font-face { - font-family: 'Ubuntu'; - src: url('Ubuntu-Italic.ttf') format('truetype'); + font-family: "Ubuntu"; + src: url("Ubuntu-Italic.ttf") format("truetype"); font-weight: normal; font-style: italic; } @font-face { - font-family: 'Ubuntu'; - src: url('Ubuntu-Bold.ttf') format('truetype'); + font-family: "Ubuntu"; + src: url("Ubuntu-Bold.ttf") format("truetype"); font-weight: bold; font-style: normal; } @font-face { - font-family: 'Ubuntu'; - src: url('Ubuntu-BoldItalic.ttf') format('truetype'); + font-family: "Ubuntu"; + src: url("Ubuntu-BoldItalic.ttf") format("truetype"); font-weight: bold; font-style: italic; } @font-face { - font-family: 'Ubuntu'; - src: url('Ubuntu-Light.ttf') format('truetype'); + font-family: "Ubuntu"; + src: url("Ubuntu-Light.ttf") format("truetype"); font-weight: 300; font-style: normal; } @font-face { - font-family: 'Ubuntu'; - src: url('Ubuntu-LightItalic.ttf') format('truetype'); + font-family: "Ubuntu"; + src: url("Ubuntu-LightItalic.ttf") format("truetype"); font-weight: 300; font-style: italic; } @font-face { - font-family: 'Ubuntu'; - src: url('Ubuntu-Medium.ttf') format('truetype'); + font-family: "Ubuntu"; + src: url("Ubuntu-Medium.ttf") format("truetype"); font-weight: 500; font-style: normal; } @font-face { - font-family: 'Ubuntu'; - src: url('Ubuntu-MediumItalic.ttf') format('truetype'); + font-family: "Ubuntu"; + src: url("Ubuntu-MediumItalic.ttf") format("truetype"); font-weight: 500; font-style: italic; } diff --git a/src/renderer/src/assets/styles/CommandListPopover.css b/src/renderer/src/assets/styles/CommandListPopover.css index a1bb27ec5..9cc915de3 100644 --- a/src/renderer/src/assets/styles/CommandListPopover.css +++ b/src/renderer/src/assets/styles/CommandListPopover.css @@ -1,24 +1,23 @@ .command-list-popover { /* Base styles are handled inline for theme support */ - /* Arrow styles based on placement */ } -.command-list-popover[data-placement^='bottom'] { +.command-list-popover[data-placement^="bottom"] { transform-origin: top center; animation: slideDownAndFadeIn 0.15s ease-out; } -.command-list-popover[data-placement^='top'] { +.command-list-popover[data-placement^="top"] { transform-origin: bottom center; animation: slideUpAndFadeIn 0.15s ease-out; } -.command-list-popover[data-placement*='start'] { +.command-list-popover[data-placement*="start"] { transform-origin: left center; } -.command-list-popover[data-placement*='end'] { +.command-list-popover[data-placement*="end"] { transform-origin: right center; } diff --git a/src/renderer/src/assets/styles/ant.css b/src/renderer/src/assets/styles/ant.css index 30005ff73..0bd4499c1 100644 --- a/src/renderer/src/assets/styles/ant.css +++ b/src/renderer/src/assets/styles/ant.css @@ -1,4 +1,4 @@ -@import './container.css'; +@import "./container.css"; /* Modal 关闭按钮不应该可拖拽,以确保点击正常 */ .ant-modal-close { @@ -76,19 +76,19 @@ background-color: transparent !important; } -[navbar-position='left'] .minapp-drawer { +[navbar-position="left"] .minapp-drawer { max-width: calc(100vw - var(--sidebar-width)); } -[navbar-position='left'] .minapp-drawer .ant-drawer-header { +[navbar-position="left"] .minapp-drawer .ant-drawer-header { width: calc(100vw - var(--sidebar-width)); } -[navbar-position='top'] .minapp-drawer { +[navbar-position="top"] .minapp-drawer { max-width: 100vw; } -[navbar-position='top'] .minapp-drawer .ant-drawer-header { +[navbar-position="top"] .minapp-drawer .ant-drawer-header { width: 100vw; } diff --git a/src/renderer/src/assets/styles/color.css b/src/renderer/src/assets/styles/color.css index 5d625937e..411ecbcac 100644 --- a/src/renderer/src/assets/styles/color.css +++ b/src/renderer/src/assets/styles/color.css @@ -70,7 +70,7 @@ --color-status-warning: #faad14; } -[theme-mode='light'] { +[theme-mode="light"] { --color-white: #ffffff; --color-white-soft: rgba(0, 0, 0, 0.04); --color-white-mute: #eee; @@ -136,12 +136,12 @@ --chat-text-user: var(--color-text); } -[navbar-position='left'][theme-mode='light'] { +[navbar-position="left"][theme-mode="light"] { --color-list-item: #eee; --color-list-item-hover: #f5f5f5; } -[navbar-position='left'][theme-mode='dark'] { +[navbar-position="left"][theme-mode="dark"] { --color-list-item: #252525; --color-list-item-hover: #1e1e1e; } diff --git a/src/renderer/src/assets/styles/container.css b/src/renderer/src/assets/styles/container.css index a8a1852e6..68024ff79 100644 --- a/src/renderer/src/assets/styles/container.css +++ b/src/renderer/src/assets/styles/container.css @@ -2,7 +2,7 @@ background-color: var(--color-background); } -[navbar-position='left'] #content-container { +[navbar-position="left"] #content-container { border-top: 0.5px solid var(--color-border); border-top-left-radius: 10px; border-left: 0.5px solid var(--color-border); diff --git a/src/renderer/src/assets/styles/font.css b/src/renderer/src/assets/styles/font.css index 8e122fe88..f7729b824 100644 --- a/src/renderer/src/assets/styles/font.css +++ b/src/renderer/src/assets/styles/font.css @@ -1,24 +1,24 @@ :root { --font-family: - var(--user-font-family), Ubuntu, -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, Roboto, Oxygen, - Cantarell, 'Open Sans', 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', - 'Segoe UI Symbol', 'Noto Color Emoji'; + var(--user-font-family), Ubuntu, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto, Oxygen, + Cantarell, "Open Sans", "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", + "Segoe UI Symbol", "Noto Color Emoji"; --font-family-serif: - serif, -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, Ubuntu, Roboto, Oxygen, Cantarell, 'Open Sans', - 'Helvetica Neue', Arial, 'Noto Sans', 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'; + serif, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Ubuntu, Roboto, Oxygen, Cantarell, "Open Sans", + "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; - --code-font-family: var(--user-code-font-family), 'Cascadia Code', 'Fira Code', 'Consolas', Menlo, Courier, monospace; + --code-font-family: var(--user-code-font-family), "Cascadia Code", "Fira Code", "Consolas", Menlo, Courier, monospace; } /* Windows系统专用字体配置 */ -body[os='windows'] { +body[os="windows"] { --font-family: - var(--user-font-family), 'Twemoji Country Flags', Ubuntu, -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, - Roboto, Oxygen, Cantarell, 'Open Sans', 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', - 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'; + var(--user-font-family), "Twemoji Country Flags", Ubuntu, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, + Roboto, Oxygen, Cantarell, "Open Sans", "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", + "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; --code-font-family: - var(--user-code-font-family), 'Cascadia Code', 'Fira Code', 'Consolas', 'Sarasa Mono SC', 'Microsoft YaHei UI', + var(--user-code-font-family), "Cascadia Code", "Fira Code", "Consolas", "Sarasa Mono SC", "Microsoft YaHei UI", Courier, monospace; } diff --git a/src/renderer/src/assets/styles/index.css b/src/renderer/src/assets/styles/index.css index b344e60ae..d3492ced0 100644 --- a/src/renderer/src/assets/styles/index.css +++ b/src/renderer/src/assets/styles/index.css @@ -1,15 +1,15 @@ -@import './color.css'; -@import './font.css'; -@import './markdown.css'; -@import './ant.css'; -@import './scrollbar.css'; -@import './container.css'; -@import './animation.css'; -@import './richtext.css'; -@import './responsive.css'; -@import '../fonts/icon-fonts/iconfont.css'; -@import '../fonts/ubuntu/ubuntu.css'; -@import '../fonts/country-flag-fonts/flag.css'; +@import "./color.css"; +@import "./font.css"; +@import "./markdown.css"; +@import "./ant.css"; +@import "./scrollbar.css"; +@import "./container.css"; +@import "./animation.css"; +@import "./richtext.css"; +@import "./responsive.css"; +@import "../fonts/icon-fonts/iconfont.css"; +@import "../fonts/ubuntu/ubuntu.css"; +@import "../fonts/country-flag-fonts/flag.css"; *, *::before, @@ -64,7 +64,7 @@ body { input, textarea, -[contenteditable='true'], +[contenteditable="true"], .markdown, #messages, .selectable, diff --git a/src/renderer/src/assets/styles/responsive.css b/src/renderer/src/assets/styles/responsive.css index e84cc1e69..4b299b750 100644 --- a/src/renderer/src/assets/styles/responsive.css +++ b/src/renderer/src/assets/styles/responsive.css @@ -12,7 +12,7 @@ --scrollbar-width: 5px; } -[navbar-position='left'] { +[navbar-position="left"] { --navbar-height: 42px; --list-item-border-radius: 20px; } diff --git a/src/renderer/src/assets/styles/richtext.css b/src/renderer/src/assets/styles/richtext.css index 547a5e17b..1110276b3 100644 --- a/src/renderer/src/assets/styles/richtext.css +++ b/src/renderer/src/assets/styles/richtext.css @@ -217,7 +217,7 @@ } .tiptap .selectedCell::after { - content: ''; + content: ""; position: absolute; inset: 0; pointer-events: none; @@ -283,8 +283,8 @@ grid-template-columns: 1fr 25px; grid-template-rows: 1fr 25px; grid-template-areas: - 'table column-btn' - 'row-btn corner'; + "table column-btn" + "row-btn corner"; gap: 5px; } @@ -348,7 +348,7 @@ .tiptap .tableWrapper .add-row-button::before, .tiptap .tableWrapper .add-column-button::before { - content: '+'; + content: "+"; font-weight: bold; } @@ -402,7 +402,7 @@ .tiptap .tableWrapper .row-action-trigger::before, .tiptap .tableWrapper .column-action-trigger::before { - content: '•••'; + content: "•••"; } .tiptap.resize-cursor { @@ -438,18 +438,18 @@ list-style: decimal; } -.tiptap ul[data-type='taskList'] { +.tiptap ul[data-type="taskList"] { list-style: none; margin-left: 0; padding: 0; } -.tiptap ul[data-type='taskList'] li { +.tiptap ul[data-type="taskList"] li { align-items: center; display: flex; } -.tiptap ul[data-type='taskList'] li > label { +.tiptap ul[data-type="taskList"] li > label { flex: 0 0 auto; margin-right: 0.5rem; user-select: none; @@ -457,32 +457,32 @@ align-items: center; } -.tiptap ul[data-type='taskList'] li > div { +.tiptap ul[data-type="taskList"] li > div { flex: 1 1 auto; } -.tiptap ul[data-type='taskList'] li > div p { +.tiptap ul[data-type="taskList"] li > div p { margin: 0; } /* Checked task item appearance */ -.tiptap ul[data-type='taskList'] li[data-checked='true'] > div { +.tiptap ul[data-type="taskList"] li[data-checked="true"] > div { color: var(--color-text-2); text-decoration: line-through; } -.tiptap ul[data-type='taskList'] input[type='checkbox'] { +.tiptap ul[data-type="taskList"] input[type="checkbox"] { cursor: pointer; } /* Use primary color for checked checkbox */ -.tiptap ul[data-type='taskList'] input[type='checkbox']:checked { +.tiptap ul[data-type="taskList"] input[type="checkbox"]:checked { accent-color: var(--color-primary); background-color: var(--color-primary); border-color: var(--color-primary); } -.tiptap ul[data-type='taskList'] ul[data-type='taskList'] { +.tiptap ul[data-type="taskList"] ul[data-type="taskList"] { margin: 0; } @@ -496,7 +496,7 @@ /* Bottom spacer to create viewport padding */ .tiptap::after { - content: ''; + content: ""; display: block; height: 50px; pointer-events: none; diff --git a/src/renderer/src/assets/styles/scrollbar.css b/src/renderer/src/assets/styles/scrollbar.css index 461384381..d58088b2c 100644 --- a/src/renderer/src/assets/styles/scrollbar.css +++ b/src/renderer/src/assets/styles/scrollbar.css @@ -12,7 +12,7 @@ --scrollbar-thumb-radius: 10px; } -body[theme-mode='light'] { +body[theme-mode="light"] { --color-scrollbar-thumb: var(--color-scrollbar-thumb-light); --color-scrollbar-thumb-hover: var(--color-scrollbar-thumb-light-hover); } diff --git a/src/renderer/src/assets/styles/selection-toolbar.css b/src/renderer/src/assets/styles/selection-toolbar.css index 6efcb57d1..dc5c4f097 100644 --- a/src/renderer/src/assets/styles/selection-toolbar.css +++ b/src/renderer/src/assets/styles/selection-toolbar.css @@ -1,4 +1,4 @@ -@import './font.css'; +@import "./font.css"; html { font-family: var(--font-family); @@ -56,7 +56,7 @@ html { --selection-toolbar-button-bgcolor-hover: #333333; } -[theme-mode='light'] { +[theme-mode="light"] { --selection-toolbar-border: none; --selection-toolbar-box-shadow: 0px 2px 3px rgba(50, 50, 50, 0.1); --selection-toolbar-background: rgba(245, 245, 245, 0.95); diff --git a/src/renderer/src/assets/styles/tailwind.css b/src/renderer/src/assets/styles/tailwind.css index 4d9e0d4f0..cabf5fb6c 100644 --- a/src/renderer/src/assets/styles/tailwind.css +++ b/src/renderer/src/assets/styles/tailwind.css @@ -1,5 +1,5 @@ @import 'tailwindcss' source('../../../../renderer'); -@import 'tw-animate-css'; +@import "tw-animate-css"; /* heroui */ @plugin '../../hero.ts'; diff --git a/src/renderer/src/components/Avatar/EmojiAvatar.tsx b/src/renderer/src/components/Avatar/EmojiAvatar.tsx index e01024735..6803156f5 100644 --- a/src/renderer/src/components/Avatar/EmojiAvatar.tsx +++ b/src/renderer/src/components/Avatar/EmojiAvatar.tsx @@ -25,7 +25,8 @@ const EmojiAvatar = ({ $fontSize={fontSize ?? size * 0.5} onClick={onClick} className={className} - style={style}> + style={style} + > {children} ) diff --git a/src/renderer/src/components/Avatar/ModelAvatar.tsx b/src/renderer/src/components/Avatar/ModelAvatar.tsx index d1a6f98be..b2b4634ec 100644 --- a/src/renderer/src/components/Avatar/ModelAvatar.tsx +++ b/src/renderer/src/components/Avatar/ModelAvatar.tsx @@ -25,7 +25,8 @@ const ModelAvatar: FC = ({ model, size, props, className }) => { justifyContent: 'center' }} {...props} - className={className}> + className={className} + > {first(model?.name)} ) diff --git a/src/renderer/src/components/CodeBlockView/HtmlArtifactsPopup.tsx b/src/renderer/src/components/CodeBlockView/HtmlArtifactsPopup.tsx index 9453866f2..9cee54603 100644 --- a/src/renderer/src/components/CodeBlockView/HtmlArtifactsPopup.tsx +++ b/src/renderer/src/components/CodeBlockView/HtmlArtifactsPopup.tsx @@ -82,21 +82,24 @@ const HtmlArtifactsPopup: React.FC = ({ open, title, ht size="small" type={viewMode === 'split' ? 'primary' : 'default'} icon={} - onClick={() => setViewMode('split')}> + onClick={() => setViewMode('split')} + > {t('html_artifacts.split')} } - onClick={() => setViewMode('code')}> + onClick={() => setViewMode('code')} + > {t('html_artifacts.code')} } - onClick={() => setViewMode('preview')}> + onClick={() => setViewMode('preview')} + > {t('html_artifacts.preview')} @@ -120,7 +123,8 @@ const HtmlArtifactsPopup: React.FC = ({ open, title, ht onClick: () => handleCapture('clipboard') } ] - }}> + }} + > @@ -232,13 +233,15 @@ export function LocalBackupManager({ visible, onClose, localBackupDir, restoreMe icon={} onClick={handleDeleteSelected} disabled={selectedRowKeys.length === 0 || deleting} - loading={deleting}> + loading={deleting} + > {t('settings.data.local.backup.manager.delete.selected')} ({selectedRowKeys.length}) , - ]}> + ]} + > {t('common.confirm')} - ]}> + ]} + > setCustomFileName(e.target.value)} diff --git a/src/renderer/src/components/MarkdownEditor/index.tsx b/src/renderer/src/components/MarkdownEditor/index.tsx index 427ff1ccc..e6bacb5f6 100644 --- a/src/renderer/src/components/MarkdownEditor/index.tsx +++ b/src/renderer/src/components/MarkdownEditor/index.tsx @@ -44,7 +44,8 @@ const MarkdownEditor: FC = ({ + rehypePlugins={[rehypeRaw, rehypeKatex]} + > {inputValue || t('settings.provider.notes.markdown_editor_default_value')} diff --git a/src/renderer/src/components/MinApp/MinAppTabsPool.tsx b/src/renderer/src/components/MinApp/MinAppTabsPool.tsx index af2c255f5..6cebf23c7 100644 --- a/src/renderer/src/components/MinApp/MinAppTabsPool.tsx +++ b/src/renderer/src/components/MinApp/MinAppTabsPool.tsx @@ -99,7 +99,8 @@ const MinAppTabsPool: React.FC = () => { : { visibility: 'hidden' } } data-minapp-tabs-pool - aria-hidden={!shouldShow}> + aria-hidden={!shouldShow} + > {apps.map((app) => ( { root: { maxWidth: '400px' } - }}> + }} + > handleCopyUrl(e, url ?? appInfo.url)}>{appInfo.name} {appInfo.canOpenExternalLink && ( @@ -431,7 +432,8 @@ const MinappPopupContainer: React.FC = () => { + isTopNavbar={isTopNavbar} + > handleGoBack(appInfo.id)}> @@ -459,7 +461,8 @@ const MinappPopupContainer: React.FC = () => { : t('minapp.add_to_sidebar') } mouseEnterDelay={0.8} - placement="bottom"> + placement="bottom" + > handleTogglePin(appInfo.id)} className={appInfo.isPinned ? 'pinned' : ''}> @@ -472,7 +475,8 @@ const MinappPopupContainer: React.FC = () => { : t('minapp.popup.open_link_external_off') } mouseEnterDelay={0.8} - placement="bottom"> + placement="bottom" + > @@ -547,7 +551,8 @@ const MinappPopupContainer: React.FC = () => { body: { borderTopLeftRadius: '10px' } - }}> + }} + > {/* 在所有小程序中显示GoogleLoginTip */} {!isReady && ( diff --git a/src/renderer/src/components/ModelIdWithTags.tsx b/src/renderer/src/components/ModelIdWithTags.tsx index bf902ae1c..4556fb978 100644 --- a/src/renderer/src/components/ModelIdWithTags.tsx +++ b/src/renderer/src/components/ModelIdWithTags.tsx @@ -33,7 +33,8 @@ const ModelIdWithTags = ({ } mouseEnterDelay={0.5} - placement="top"> + placement="top" + > {model.name} diff --git a/src/renderer/src/components/OGCard.tsx b/src/renderer/src/components/OGCard.tsx index 93446b674..1399c9e43 100644 --- a/src/renderer/src/components/OGCard.tsx +++ b/src/renderer/src/components/OGCard.tsx @@ -67,7 +67,8 @@ export const OGCard = ({ link, show }: Props) => { fontSize: '14px', lineHeight: '1.2', color: 'var(--color-text)' - }}> + }} + > {metadata['og:title'] || hostname} @@ -78,7 +79,8 @@ export const OGCard = ({ link, show }: Props) => { fontSize: '12px', lineHeight: '1.2', color: 'var(--color-text-secondary)' - }}> + }} + > {metadata['og:description'] || link} diff --git a/src/renderer/src/components/ObsidianExportDialog.tsx b/src/renderer/src/components/ObsidianExportDialog.tsx index 0c3d1c003..259410426 100644 --- a/src/renderer/src/components/ObsidianExportDialog.tsx +++ b/src/renderer/src/components/ObsidianExportDialog.tsx @@ -316,7 +316,8 @@ const PopupContainer: React.FC = ({ disabled: vaults.length === 0 || loading || !!error }} okText={i18n.t('chat.topics.export.obsidian_btn')} - afterClose={() => setOpen(open)}> + afterClose={() => setOpen(open)} + > {error && }
@@ -333,7 +334,8 @@ const PopupContainer: React.FC = ({ value={selectedVault} onChange={handleVaultChange} placeholder={i18n.t('chat.topics.export.obsidian_vault_placeholder')} - style={{ width: '100%' }}> + style={{ width: '100%' }} + > {vaults.map((vault) => (