An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:art: https://github.com/siyuan-note/siyuan/issues/7284
Vanessa12847659d2cd
diff --git a/app/src/constants.ts b/app/src/constants.tsindex 5b80e191e3..c7e49859a2 100644--- a/app/src/constants.ts+++ b/app/src/constants.ts@@ -16,6 +16,7 @@ export abstract class Constants {// drop 事件public static readonly SIYUAN_DROP_FILE: string = "application/siyuan-file";+ public static readonly SIYUAN_DROP_GUTTER: string = "application/siyuan-gutter";public static readonly SIYUAN_DROP_TAB: string = "application/siyuan-tab";public static readonly SIYUAN_DROP_TABTOWINDOW: string = "application/siyuan-tabtowindow";public static readonly SIYUAN_DROP_EDITOR: string = "application/siyuan-editor";diff --git a/app/src/protyle/gutter/index.ts b/app/src/protyle/gutter/index.tsindex 5feb97c40f..e169bc7bf8 100644--- a/app/src/protyle/gutter/index.ts+++ b/app/src/protyle/gutter/index.ts@@ -58,6 +58,7 @@ export class Gutter {}event.target.style.opacity = "0.1";window.siyuan.dragElement = event.target;+ event.dataTransfer.setData(Constants.SIYUAN_DROP_GUTTER, selectIds.toString());window.siyuan.dragElement.setAttribute("data-selected-ids", selectIds.toString());});this.element.addEventListener("dragend", () => {diff --git a/app/src/protyle/util/editorCommonEvent.ts b/app/src/protyle/util/editorCommonEvent.tsindex da8d140b29..2e7866f426 100644--- a/app/src/protyle/util/editorCommonEvent.ts+++ b/app/src/protyle/util/editorCommonEvent.ts@@ -708,6 +708,7 @@ export const dropEvent = (protyle: IProtyle, editorElement: HTMLElement) => {window.siyuan.dragElement = undefined;event.preventDefault();} else {+ event.dataTransfer.setData(Constants.SIYUAN_DROP_GUTTER, target.parentElement.getAttribute("data-node-id"));window.siyuan.dragElement = target.parentElement;}return;@@ -846,6 +847,7 @@ export const dropEvent = (protyle: IProtyle, editorElement: HTMLElement) => {event.preventDefault();return;}+ // TODO !event.dataTransfer.types.includes(Constants.SIYUAN_DROP_GUTTER) https://github.com/siyuan-note/siyuan/issues/7284if (!window.siyuan.dragElement) {// https://github.com/siyuan-note/siyuan/issues/6436event.preventDefault();@@ -865,7 +867,7 @@ export const dropEvent = (protyle: IProtyle, editorElement: HTMLElement) => {if (!targetElement) {return;}- const fileTreeIds = window.siyuan.dragElement.innerText;+ const fileTreeIds = window.siyuan.dragElement ? window.siyuan.dragElement.innerText || "";if (targetElement && dragoverElement && targetElement.isSameNode(dragoverElement)) {// 性能优化,目标为同一个元素不再进行校验const nodeRect = targetElement.getBoundingClientRect();@@ -901,7 +903,6 @@ export const dropEvent = (protyle: IProtyle, editorElement: HTMLElement) => {}return;}-if (window.siyuan.dragElement.parentElement?.classList.contains("protyle-gutters") ||// 列表项之前的点window.siyuan.dragElement.getAttribute("data-type") === "NodeListItem") {