增加阅读是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
+9
View File
@@ -1,6 +1,7 @@
import { config } from "../../../package.json";
import { getLocaleID, getString } from "../../utils/locale";
import { ChatView } from "./chatView";
import { onItemPaneSectionToggle, prepareItemPaneBody } from "./itemPaneSection";
const views = new WeakMap<HTMLElement, ChatView>();
@@ -23,6 +24,7 @@ export function registerChatPane() {
onInit: ({ body }) => {
const doc = body.ownerDocument;
if (doc) ensureStyles(doc);
prepareItemPaneBody(body);
},
onDestroy: ({ body }) => {
views.get(body)?.destroy();
@@ -51,6 +53,13 @@ export function registerChatPane() {
const view = new ChatView(doc, body, item);
views.set(body, view);
await view.mount();
const section = body.closest("collapsible-section");
if (section && !section.hasAttribute("open")) {
onItemPaneSectionToggle({ body });
}
},
onToggle: ({ body, event }) => {
onItemPaneSectionToggle({ body, event });
},
});
}