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/14034

Daniel3291817f1fcc
diff --git a/app/src/protyle/util/editorCommonEvent.ts b/app/src/protyle/util/editorCommonEvent.ts
index e5d5a5b2e0..481407a6f8 100644
--- a/app/src/protyle/util/editorCommonEvent.ts
+++ b/app/src/protyle/util/editorCommonEvent.ts
@@ -1375,10 +1375,17 @@ export const dropEvent = (protyle: IProtyle, editorElement: HTMLElement) => {
showDragTip(window.siyuan.dragTitle || "",
event.altKey ? window.siyuan.languages.dragTip2Heading : window.siyuan.languages.dragTipRef,
event.clientX, event.clientY);
- } else if (gutterType && !gutterType.startsWith(`${Constants.SIYUAN_DROP_GUTTER}NodeAttributeView${Constants.ZWSP}`.toLowerCase())) {
- // 普通块(段落/标题/列表/引用等,排除 AV)拖入编辑器(含编辑器内重排):Alt=插入引用,Shift=嵌入块,默认=移动
+ } else if (gutterType && !gutterType.includes(`${Constants.SIYUAN_DROP_GUTTER}NodeAttributeView`.toLowerCase())) {
+ // 普通块(段落/标题/列表/引用等,排除 AV 行/列/视图/卡片)拖入编辑器
let action: string;
- if (event.altKey) {
+ if (hasClosestByClassName(event.target, "av__row") ||
+ hasClosestByClassName(event.target, "av__row--util") ||
+ hasClosestByClassName(event.target, "av__gallery-item") ||
+ hasClosestByClassName(event.target, "av__gallery-add")) {
+ // 拖到数据库视图:绑定为记录
+ action = window.siyuan.languages.addToDatabase;
+ } else if (event.altKey) {
+ // 编辑器内重排:Alt=插入引用,Shift=嵌入块,默认=移动
action = window.siyuan.languages.dragTipRef;
} else if (event.shiftKey) {
action = window.siyuan.languages.blockEmbed;