feat(ui): enhance theme toggle styling and add Chinese localization

- Redesign theme toggle with improved visual effects including gradient overlays, enhanced shadows, and smoother cubic-bezier transitions
- Update toggle dimensions and icon positioning for better visual balance
- Add SVG filter effects for sun/moon icons in dark mode
- Replace English UI text with Chinese localization in MilkdownEditor
- Refactor copilotPlugin by removing unused decoration functions and improving ghost mark text node handling
This commit is contained in:
2026-02-15 18:24:34 +08:00
parent 838eec30a8
commit 190bb2b756
3 changed files with 76 additions and 59 deletions

View File

@@ -38,8 +38,8 @@
<button
type="button"
class="action-btn"
aria-label="Insert Image"
title="Insert Image"
aria-label="上传图片"
title="上传图片"
@click="toggleImageDropdown"
>
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
@@ -47,11 +47,11 @@
<circle cx="8.5" cy="8.5" r="1.5"/>
<polyline points="21 15 16 10 5 21"/>
</svg>
<span class="btn-tooltip">Insert Image</span>
<span class="btn-tooltip">上传图片</span>
</button>
<div v-if="showImageDropdown" class="image-dropdown">
<button type="button" @click="triggerImageUpload">Upload Local Image</button>
<button type="button" @click="showUrlDialog = true; showImageDropdown = false">Insert from URL</button>
<button type="button" @click="triggerImageUpload">上传本地图片</button>
<button type="button" @click="showUrlDialog = true; showImageDropdown = false">通过 URL 插入</button>
</div>
</div>
<input type="file" ref="imageInputRef" @change="handleImageUpload" accept="image/*" style="display:none">
@@ -65,9 +65,14 @@
:aria-label="aiButtonLabel"
:title="aiButtonLabel"
>
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M12 2a10 10 0 1 0 10 10A10 10 0 0 0 12 2z"/>
<path d="M12 6v6l4 2"/>
<svg v-if="aiEnabled && !isOverLimit" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M12 3l1.9 3.9L18 9l-4.1 2.1L12 15l-1.9-3.9L6 9l4.1-2.1L12 3z"/>
<path d="M5 14l.9 1.8L8 16.7l-2.1.9L5 20l-.9-2.4L2 16.7l2.1-.9L5 14z"/>
<path d="M19 14l.6 1.2 1.4.6-1.4.6L19 18l-.6-1.6-1.4-.6 1.4-.6L19 14z"/>
</svg>
<svg v-else width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<circle cx="12" cy="12" r="9"/>
<line x1="5" y1="5" x2="19" y2="19"/>
</svg>
<span class="btn-tooltip">{{ aiButtonLabel }}</span>
</button>
@@ -79,16 +84,16 @@
<div v-if="showUrlDialog" class="url-dialog-overlay" @click.self="showUrlDialog = false">
<div class="url-dialog">
<h3>Insert Image from URL</h3>
<h3>通过 URL 插入图片</h3>
<input
v-model="imageUrl"
type="url"
placeholder="Enter image URL"
placeholder="请输入图片 URL"
@keyup.enter="insertImageFromUrl"
/>
<div class="url-dialog-buttons">
<button type="button" class="dialog-btn primary" @click="insertImageFromUrl">Insert</button>
<button type="button" class="dialog-btn" @click="showUrlDialog = false; imageUrl = ''">Cancel</button>
<button type="button" class="dialog-btn primary" @click="insertImageFromUrl">插入</button>
<button type="button" class="dialog-btn" @click="showUrlDialog = false; imageUrl = ''">取消</button>
</div>
</div>
</div>