Skip to content

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

:art: fix https://github.com/siyuan-note/siyuan/issues/11075

Vanessa06a095bce1dd
diff --git a/app/src/protyle/render/av/action.ts b/app/src/protyle/render/av/action.ts
index 4301409646..6e5450368a 100644
--- a/app/src/protyle/render/av/action.ts
+++ b/app/src/protyle/render/av/action.ts
@@ -33,10 +33,13 @@ import * as dayjs from "dayjs";
import {openCalcMenu} from "./calc";
import {avRender} from "./render";
import {addView, openViewMenu} from "./view";
-import {isOnlyMeta, openByMobile, writeText} from "../../util/compatibility";
+import {isOnlyMeta, writeText} from "../../util/compatibility";
import {openSearchAV} from "./relation";
export const avClick = (protyle: IProtyle, event: MouseEvent & { target: HTMLElement }) => {
+ if (isOnlyMeta(event)) {
+ return false;
+ }
const blockElement = hasClosestBlock(event.target);
if (!blockElement) {
return false;
diff --git a/app/src/protyle/wysiwyg/index.ts b/app/src/protyle/wysiwyg/index.ts
index e5aa000df9..49c511a6f4 100644
--- a/app/src/protyle/wysiwyg/index.ts
+++ b/app/src/protyle/wysiwyg/index.ts
@@ -2195,7 +2195,7 @@ export class WYSIWYG {
}
const embedItemElement = hasClosestByClassName(event.target, "protyle-wysiwyg__embed");
- if (embedItemElement) {
+ if (embedItemElement && !ctrlIsPressed) {
const embedId = embedItemElement.getAttribute("data-id");
checkFold(embedId, (zoomIn, action) => {
/// #if MOBILE
@@ -2288,7 +2288,7 @@ export class WYSIWYG {
}
const languageElement = hasClosestByClassName(event.target, "protyle-action__language");
- if (languageElement && !protyle.disabled) {
+ if (languageElement && !protyle.disabled && !ctrlIsPressed) {
protyle.toolbar.showCodeLanguage(protyle, languageElement);
event.stopPropagation();
event.preventDefault();
@@ -2311,6 +2311,8 @@ export class WYSIWYG {
clientX: event.clientX + 4,
clientY: event.clientY
});
+ event.stopPropagation();
+ return;
} else if (actionElement.parentElement.classList.contains("li")) {
const actionId = actionElement.parentElement.getAttribute("data-node-id");
if (event.altKey && !protyle.disabled) {
@@ -2367,9 +2369,9 @@ export class WYSIWYG {
}
}
}
+ event.stopPropagation();
+ return;
}
- event.stopPropagation();
- return;
}
const selectElement = hasClosestByClassName(event.target, "hr") ||
@@ -2599,6 +2601,10 @@ export class WYSIWYG {
if (ctrlIsPressed && range.toString() === "") {
let ctrlElement = hasClosestBlock(event.target);
if (ctrlElement) {
+ const embedBlockElement = hasClosestByAttribute(ctrlElement, "data-type", "NodeBlockQueryEmbed");
+ if (embedBlockElement) {
+ ctrlElement = embedBlockElement;
+ }
ctrlElement = getTopAloneElement(ctrlElement) as HTMLElement;
if (ctrlElement.classList.contains("protyle-wysiwyg--select")) {
ctrlElement.classList.remove("protyle-wysiwyg--select");