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/7957
Vanessa66360757b3e8
diff --git a/app/src/layout/dock/Outline.ts b/app/src/layout/dock/Outline.tsindex 108062f0b6..b6b029d5a4 100644--- a/app/src/layout/dock/Outline.ts+++ b/app/src/layout/dock/Outline.ts@@ -272,28 +272,48 @@ export class Outline extends Model {documentSelf.onselect = null;ghostElement.remove();item.style.opacity = "";++ if (selectItem) {+ getAllModels().editor.find(editItem => {+ if (editItem.editor.protyle.block.rootID === this.blockId) {+ let previousID+ let parentID+ const undoPreviousID = item.previousElementSibling?.getAttribute("data-node-id")+ const undoParentID = item.parentElement.previousElementSibling?.getAttribute("data-node-id")+ if (selectItem.classList.contains("dragover")) {+ parentID = selectItem.getAttribute("data-node-id");+ if (selectItem.nextElementSibling && selectItem.nextElementSibling.tagName === "UL") {+ selectItem.nextElementSibling.insertAdjacentElement("afterbegin", item);+ } else {+ selectItem.insertAdjacentHTML("afterend", `<ul>${item.outerHTML}</ul>`);+ item.remove();+ }+ } else if (selectItem.classList.contains("dragover__top")) {+ parentID = selectItem.parentElement.previousElementSibling?.getAttribute("data-node-id");+ previousID = selectItem.previousElementSibling?.getAttribute("data-node-id");+ selectItem.before(item);+ } else if (selectItem.classList.contains("dragover__bottom")) {+ previousID = selectItem.getAttribute("data-node-id");+ selectItem.after(item);+ }+ transaction(editItem.editor.protyle, [{+ action: "moveOutlineHeading",+ id: item.dataset.nodeId,+ previousID,+ parentID,+ }], [{+ action: "moveOutlineHeading",+ id: item.dataset.nodeId,+ previousID: undoPreviousID,+ parentID: undoParentID,+ }]);+ return true;+ }+ });+ }this.element.querySelectorAll(".dragover__top, .dragover__bottom, .dragover").forEach(item => {item.classList.remove("dragover__top", "dragover__bottom", "dragover");});- if (!selectItem) {- return;- }- getAllModels().editor.find(editItem => {- if (editItem.editor.protyle.block.rootID === this.blockId) {- transaction(editItem.editor.protyle, [{- action: "moveOutlineHeading",- id: item.dataset.nodeId,- previousID: selectItem.previousElementSibling?.getAttribute("data-node-id"),- parentID: selectItem.parentElement.previousElementSibling?.getAttribute("data-node-id"),- }], [{- action: "moveOutlineHeading",- id: item.dataset.nodeId,- previousID: item.previousElementSibling?.getAttribute("data-node-id"),- parentID: item.parentElement.previousElementSibling?.getAttribute("data-node-id"),- }]);- return true;- }- });};});}diff --git a/app/src/protyle/wysiwyg/transaction.ts b/app/src/protyle/wysiwyg/transaction.tsindex a875a059b8..424d82122f 100644--- a/app/src/protyle/wysiwyg/transaction.ts+++ b/app/src/protyle/wysiwyg/transaction.ts@@ -728,9 +728,13 @@ export const onTransaction = (protyle: IProtyle, operation: IOperation, isUndo:});// 更新 ws 引用块updateRef(protyle, operation.id);- } else if (operation.action === "append") {+ return;+ }+ if (operation.action === "append") {reloadProtyle(protyle, false);- } else if (["addAttrViewCol", "insertAttrViewBlock", "updateAttrViewCol", "updateAttrViewColOptions",+ return;+ }+ if (["addAttrViewCol", "insertAttrViewBlock", "updateAttrViewCol", "updateAttrViewColOptions","updateAttrViewColOption", "updateAttrViewCell", "sortAttrViewRow", "sortAttrViewCol", "setAttrViewColHidden","setAttrViewColWrap", "setAttrViewColWidth", "removeAttrViewColOption", "setAttrViewName", "setAttrViewFilters","setAttrViewSorts", "setAttrViewColCalc", "removeAttrViewCol", "updateAttrViewColNumberFormat", "removeAttrViewBlock",@@ -738,10 +742,13 @@ export const onTransaction = (protyle: IProtyle, operation: IOperation, isUndo:"removeAttrViewView", "setAttrViewViewName", "setAttrViewViewIcon", "duplicateAttrViewView", "sortAttrViewView","updateAttrViewColRelation", "setAttrViewPageSize", "updateAttrViewColRollup"].includes(operation.action)) {refreshAV(protyle, operation);- } else if (operation.action === "doUpdateUpdated") {+ return;+ }+ if (operation.action === "doUpdateUpdated") {updateElements.forEach(item => {item.setAttribute("updated", operation.data);});+ return;}};