Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: https://github.com/siyuan-note/siyuan/issues/5066 "click-editorcontent" | "click-pdf"

Vanessa981c6688b895
diff --git a/app/src/protyle/gutter/index.ts b/app/src/protyle/gutter/index.ts
index 4f44a0e067..7d4637a24e 100644
--- a/app/src/protyle/gutter/index.ts
+++ b/app/src/protyle/gutter/index.ts
@@ -579,7 +579,9 @@ export class Gutter {
}).element);
}
}
- AIActions(selectsElement, protyle);
+ if (!protyle.disabled) {
+ AIActions(selectsElement, protyle);
+ }
const copyMenu: IMenu[] = [{
label: window.siyuan.languages.copy,
accelerator: "⌘C",
@@ -710,6 +712,7 @@ export class Gutter {
}
this.app?.plugins?.forEach((plugin) => {
plugin.eventBus.emit("click-blockicon", {
+ protyle,
menu: window.siyuan.menus.menu,
blockElements: selectsElement,
});
@@ -996,7 +999,9 @@ export class Gutter {
submenu: turnIntoSubmenu
}).element);
}
- AIActions([nodeElement], protyle);
+ if (!protyle.disabled) {
+ AIActions([nodeElement], protyle);
+ }
const copyMenu = (copySubMenu(id, true, nodeElement) as IMenu[]).concat([{
label: window.siyuan.languages.copy,
accelerator: "⌘C",
@@ -1509,6 +1514,7 @@ export class Gutter {
}).element);
this.app?.plugins?.forEach((plugin) => {
plugin.eventBus.emit("click-blockicon", {
+ protyle,
menu: window.siyuan.menus.menu,
blockElements: [nodeElement]
});
diff --git a/app/src/protyle/wysiwyg/index.ts b/app/src/protyle/wysiwyg/index.ts
index fa9b0807cd..14170d6c8b 100644
--- a/app/src/protyle/wysiwyg/index.ts
+++ b/app/src/protyle/wysiwyg/index.ts
@@ -1503,7 +1503,10 @@ export class WYSIWYG {
let shiftStartElement: HTMLElement;
this.element.addEventListener("click", (event: MouseEvent & { target: HTMLElement }) => {
this.app.plugins.forEach(item => {
- item.eventBus.emit("click-editorcontent", event);
+ item.eventBus.emit("click-editorcontent", {
+ protyle,
+ event
+ });
});
hideElements(["hint", "util"], protyle);
const ctrlIsPressed = event.metaKey || event.ctrlKey;