Skip to content

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

:art: Embed blocks support in-place editing https://github.com/siyuan-note/siyuan/issues/17800

Danielafe5f5aa8a11
diff --git a/app/src/protyle/util/editorCommonEvent.ts b/app/src/protyle/util/editorCommonEvent.ts
index d76cfa989e..8cb05070cc 100644
--- a/app/src/protyle/util/editorCommonEvent.ts
+++ b/app/src/protyle/util/editorCommonEvent.ts
@@ -1785,6 +1785,12 @@ export const dropEvent = (protyle: IProtyle, editorElement: HTMLElement) => {
hideDragTip();
return;
}
+ // 不允许拖拽到嵌入块中(嵌入块本身或其内部任意内容均不可作为拖拽目标)
+ // 需置于列表/超级块等会提前 return 的分支之前,否则列表项、超级块等场景会绕过该限制
+ if (isInEmbedBlock(targetElement) || targetElement.getAttribute("data-type") === "NodeBlockQueryEmbed") {
+ clearDragoverElement(dragoverElement);
+ return;
+ }
const isNotAvItem = !targetElement.classList.contains("av__row") &&
!targetElement.classList.contains("av__row--util") &&
!targetElement.classList.contains("av__gallery-item") &&
@@ -2112,11 +2118,6 @@ export const dropEvent = (protyle: IProtyle, editorElement: HTMLElement) => {
clearDragoverElement(dragoverElement);
return;
}
- if (isInEmbedBlock(targetElement)) {
- // 不允许托入嵌入块
- clearDragoverElement(dragoverElement);
- return;
- }
if (gutterTypes[0] === "nodelistitem" && "NodeListItem" === targetElement.getAttribute("data-type")) {
if (gutterTypes[1] !== targetElement.getAttribute("data-subtype")) {
// 排除类型不同的列表项