实现pdf中划句子ai伴读的功能,修复pdf高亮显示的问题

This commit is contained in:
yhy
2026-08-29 23:18:15 +08:00
parent 0ed8f42029
commit 913e3675ae
14 changed files with 789 additions and 68 deletions
+29
View File
@@ -1038,6 +1038,35 @@ collapsible-section[open] > :not(.head) .chatpapers-lecture-root {
overflow-y: auto;
}
.chatpapers-lecture-selection-explain {
display: flex;
flex-direction: column;
gap: 6px;
padding: 10px;
border-radius: 8px;
background: color-mix(in srgb, #2563eb 6%, transparent);
border: 1px solid color-mix(in srgb, #2563eb 18%, transparent);
font-size: 12px;
line-height: 1.45;
max-height: 220px;
overflow-y: auto;
}
.chatpapers-lecture-selection-title {
font-size: 12px;
font-weight: 700;
color: #1d4ed8;
}
.chatpapers-lecture-selection-replay {
align-self: flex-start;
margin-top: 4px;
}
.chatpapers-selection-explain-btn {
white-space: nowrap;
}
.chatpapers-lecture-para-kind {
font-size: 11px;
font-weight: 600;
@@ -0,0 +1,11 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="context-stroke" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<!-- Lucide: FoldVertical (adaptive off / fixed height) -->
<path d="M12 22v-6"/>
<path d="M12 8V2"/>
<path d="M4 12H2"/>
<path d="M10 12H8"/>
<path d="M16 12h-2"/>
<path d="M22 12h-2"/>
<path d="m15 19-3-3-3 3"/>
<path d="m15 5-3 3-3-3"/>
</svg>

After

Width:  |  Height:  |  Size: 449 B

@@ -0,0 +1,11 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="context-stroke" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<!-- Lucide: UnfoldVertical (adaptive on) -->
<path d="M12 22v-6"/>
<path d="M12 8V2"/>
<path d="M4 12H2"/>
<path d="M10 12H8"/>
<path d="M16 12h-2"/>
<path d="M22 12h-2"/>
<path d="m15 19-3 3-3-3"/>
<path d="m15 5-3-3-3 3"/>
</svg>

After

Width:  |  Height:  |  Size: 435 B

+7
View File
@@ -0,0 +1,7 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="context-stroke" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<!-- Lucide: AppWindow -->
<rect x="2" y="4" width="20" height="16" rx="2"/>
<path d="M10 4v4"/>
<path d="M2 8h20"/>
<path d="M6 4v4"/>
</svg>

After

Width:  |  Height:  |  Size: 337 B

+10
View File
@@ -101,6 +101,16 @@ lecture-sentence-list-title = Sentences (original, then explanation)
lecture-sentence-label = P{ $p }·S{ $s }
lecture-sentence-list-hint = Sentences in this paragraph
lecture-pdf-sync-hint = The matching passage is highlighted in the PDF reader while playing.
lecture-explain-selection = Explain & read selection
lecture-explain-selection-short = Explain
lecture-selection-empty = Select a sentence in the PDF first
lecture-selection-explaining = Generating explanation for selection…
lecture-selection-done = Selection explanation ready
lecture-selection-no-item = Cannot resolve the current PDF item
lecture-selection-title = Selection explain
lecture-selection-syntax = Syntax / terms
lecture-selection-context = Context role
lecture-selection-replay = Replay explanation
lecture-playing-en = Playing: original
lecture-playing-zh = Playing: translation
lecture-status-ready-step2 = Ready: { $count } paragraphs + note synced
+10
View File
@@ -101,6 +101,16 @@ lecture-sentence-list-title = 逐句精读(先读原文,再听讲解)
lecture-sentence-label = 段{ $p }·句{ $s }
lecture-sentence-list-hint = 本段各句
lecture-pdf-sync-hint = 播放时会在 PDF 阅读器中高亮对应原文。
lecture-explain-selection = 解释朗读选区
lecture-explain-selection-short = 解释朗读
lecture-selection-empty = 请先在 PDF 中选中要解释的句子
lecture-selection-explaining = 正在生成选区讲解…
lecture-selection-done = 选区讲解完成
lecture-selection-no-item = 无法识别当前 PDF 条目
lecture-selection-title = 选区讲解
lecture-selection-syntax = 句法/术语
lecture-selection-context = 上下文作用
lecture-selection-replay = 重播讲解
lecture-playing-en = 正在播放:原文朗读
lecture-playing-zh = 正在播放:中文讲解
lecture-status-ready-step2 = 备课完成:{ $count } 段逐段精读可播放,笔记已同步