增加阅读是pdf中高亮显示

This commit is contained in:
yhy
2026-08-29 22:46:28 +08:00
parent 3a2438f566
commit 1475f8b3c5
17 changed files with 2125 additions and 95 deletions
@@ -2,6 +2,10 @@ import { config } from "../../../../package.json";
import { getLocaleID, getString } from "../../../utils/locale";
import { findPdfAttachment } from "../../pdf/extractor";
import { ensureChatPapersStyles } from "../../ui/readerPane";
import {
onItemPaneSectionToggle,
prepareItemPaneBody,
} from "../../ui/itemPaneSection";
import { LecturePaneView } from "./lecturePane";
const views = new WeakMap<HTMLElement, LecturePaneView>();
@@ -25,6 +29,7 @@ export function registerLecturePane() {
onInit: ({ body }) => {
const doc = body.ownerDocument;
if (doc) ensureChatPapersStyles(doc);
prepareItemPaneBody(body);
},
onDestroy: ({ body }) => {
views.get(body)?.destroy();
@@ -60,6 +65,13 @@ export function registerLecturePane() {
err.textContent = getString("lecture-mount-error");
body.append(err);
}
const section = body.closest("collapsible-section");
if (section && !section.hasAttribute("open")) {
onItemPaneSectionToggle({ body });
}
},
onToggle: ({ body, event }) => {
onItemPaneSectionToggle({ body, event });
},
});
}