An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:sparkles: https://github.com/siyuan-note/siyuan/issues/8664
Vanessa65e1a32268dd
diff --git a/app/src/protyle/render/av/action.ts b/app/src/protyle/render/av/action.tsindex e921804295..588bf31467 100644--- a/app/src/protyle/render/av/action.ts+++ b/app/src/protyle/render/av/action.ts@@ -162,10 +162,10 @@ export const avContextmenu = (protyle: IProtyle, event: MouseEvent & { detail: atransaction(protyle, [{action: "removeAttrViewBlock",srcIDs: blockIds,- parentID: blockElement.getAttribute("data-av-id"),+ avID: blockElement.getAttribute("data-av-id"),}], [{action: "insertAttrViewBlock",- parentID: blockElement.getAttribute("data-av-id"),+ avID: blockElement.getAttribute("data-av-id"),previousID: rowElement.previousElementSibling?.getAttribute("data-id") || "",srcIDs: rowIds,}]);diff --git a/app/src/protyle/render/av/addCol.ts b/app/src/protyle/render/av/addCol.tsindex 401b536470..98c92c7f0c 100644--- a/app/src/protyle/render/av/addCol.ts+++ b/app/src/protyle/render/av/addCol.ts@@ -3,6 +3,8 @@ import {transaction} from "../../wysiwyg/transaction";export const addCol = (protyle: IProtyle, blockElement: HTMLElement) => {const menu = new Menu("av-header-add");+ const avID = blockElement.getAttribute("data-av-id");+ const viewID = blockElement.querySelector(".item--focus").getAttribute("data-id");menu.addItem({icon: "iconAlignLeft",label: window.siyuan.languages.text,@@ -11,13 +13,15 @@ export const addCol = (protyle: IProtyle, blockElement: HTMLElement) => {transaction(protyle, [{action: "addAttrViewCol",name: "Text",- parentID: blockElement.getAttribute("data-av-id"),+ avID,+ viewID,type: "text",id}], [{action: "removeAttrViewCol",id,- parentID: blockElement.getAttribute("data-av-id"),+ avID,+ viewID,}]);}});@@ -29,13 +33,15 @@ export const addCol = (protyle: IProtyle, blockElement: HTMLElement) => {transaction(protyle, [{action: "addAttrViewCol",name: "Number",- parentID: blockElement.getAttribute("data-av-id"),+ avID,+ viewID,type: "number",id}], [{action: "removeAttrViewCol",id,- parentID: blockElement.getAttribute("data-av-id"),+ avID,+ viewID,}]);}});@@ -47,13 +53,15 @@ export const addCol = (protyle: IProtyle, blockElement: HTMLElement) => {transaction(protyle, [{action: "addAttrViewCol",name: "Select",- parentID: blockElement.getAttribute("data-av-id"),+ avID,+ viewID,type: "select",id}], [{action: "removeAttrViewCol",id,- parentID: blockElement.getAttribute("data-av-id"),+ avID,+ viewID,}]);}});@@ -65,13 +73,15 @@ export const addCol = (protyle: IProtyle, blockElement: HTMLElement) => {transaction(protyle, [{action: "addAttrViewCol",name: "Multi-select",- parentID: blockElement.getAttribute("data-av-id"),+ avID,+ viewID,type: "mSelect",id}], [{action: "removeAttrViewCol",id,- parentID: blockElement.getAttribute("data-av-id"),+ avID,+ viewID,}]);}});@@ -83,13 +93,15 @@ export const addCol = (protyle: IProtyle, blockElement: HTMLElement) => {transaction(protyle, [{action: "addAttrViewCol",name: "Date",- parentID: blockElement.getAttribute("data-av-id"),+ avID,+ viewID,type: "date",id}], [{action: "removeAttrViewCol",id,- parentID: blockElement.getAttribute("data-av-id"),+ avID,+ viewID,}]);}});diff --git a/app/src/protyle/render/av/col.ts b/app/src/protyle/render/av/col.tsindex 6bed834b31..b2792e42d4 100644--- a/app/src/protyle/render/av/col.ts+++ b/app/src/protyle/render/av/col.ts@@ -75,13 +75,15 @@ export const showColMenu = (protyle: IProtyle, blockElement: HTMLElement, cellEltransaction(protyle, [{action: "updateAttrViewCol",id: colId,- parentID: avId,+ avID: avId,+ viewID: viewId,name: newValue,type,}], [{action: "updateAttrViewCol",id: colId,- parentID: avId,+ avID: avId,+ viewID: viewId,name: cellElement.textContent.trim(),type,}]);@@ -110,14 +112,14 @@ export const showColMenu = (protyle: IProtyle, blockElement: HTMLElement, cellElavID: response.data.id,viewID: response.data.viewID,data: [{- column: colId,- order: "ASC"- }]+ column: colId,+ order: "ASC"+ }]}], [{action: "setAttrViewSorts",avID: response.data.id,viewID: response.data.viewID,- data: response.data.view.sorts+ data: response.data.view.sorts}]);});}@@ -131,10 +133,10 @@ export const showColMenu = (protyle: IProtyle, blockElement: HTMLElement, cellElaction: "setAttrViewSorts",avID: response.data.id,viewID: response.data.viewID,- data: [{- column: colId,- order: "DESC"- }]+ data: [{+ column: colId,+ order: "DESC"+ }]}], [{action: "setAttrViewSorts",avID: response.data.id,@@ -168,7 +170,7 @@ export const showColMenu = (protyle: IProtyle, blockElement: HTMLElement, cellElaction: "setAttrViewFilters",avID: avId,viewID: avData.viewID,- data: [filter]+ data: [filter]}], [{action: "setAttrViewFilters",avID: avId,@@ -220,11 +222,13 @@ export const showColMenu = (protyle: IProtyle, blockElement: HTMLElement, cellEltransaction(protyle, [{action: "removeAttrViewCol",id: colId,- parentID: avId,+ avID: avId,+ viewID: viewId,}], [{action: "addAttrViewCol",name: cellElement.textContent.trim(),- parentID: avId,+ avID: avId,+ viewID: viewId,type: type,id: colId}]);diff --git a/app/src/protyle/render/av/openMenuPanel.ts b/app/src/protyle/render/av/openMenuPanel.tsindex afed25de16..482b56da50 100644--- a/app/src/protyle/render/av/openMenuPanel.ts+++ b/app/src/protyle/render/av/openMenuPanel.ts@@ -188,12 +188,14 @@ export const openMenuPanel = (protyle: IProtyle,}transaction(protyle, [{action: "sortAttrViewCol",- parentID: avId,+ avID: avId,+ viewID: data.viewID,previousID: (targetElement.classList.contains("dragover__top") ? targetElement.previousElementSibling?.getAttribute("data-id") : targetElement.getAttribute("data-id")) || "",id: sourceId,}], [{action: "sortAttrViewCol",- parentID: avId,+ avID: avId,+ viewID: data.viewID,previousID: sourceElement.previousElementSibling?.getAttribute("data-id") || "",id: sourceId,}]);diff --git a/app/src/protyle/util/editorCommonEvent.ts b/app/src/protyle/util/editorCommonEvent.tsindex 27df812806..77fc85c490 100644--- a/app/src/protyle/util/editorCommonEvent.ts+++ b/app/src/protyle/util/editorCommonEvent.ts@@ -823,15 +823,18 @@ export const dropEvent = (protyle: IProtyle, editorElement: HTMLElement) => {if (!blockElement) {return;}- const avId = blockElement.getAttribute("data-av-id");+ const avID = blockElement.getAttribute("data-av-id");+ const viewID = blockElement.querySelector(".item--focus").getAttribute("data-av-id");transaction(protyle, [{action: "sortAttrViewCol",- parentID: avId,+ avID,+ viewID,previousID: (targetElement.classList.contains("dragover__left") ? targetElement.previousElementSibling?.getAttribute("data-id") : targetElement.getAttribute("data-id")) || "",id: gutterTypes[2],}], [{action: "sortAttrViewCol",- parentID: avId,+ avID,+ viewID,previousID: targetElement.parentElement.querySelector(`[data-id="${gutterTypes[2]}"`).previousElementSibling?.getAttribute("data-id") || "",id: gutterTypes[2],}]);@@ -849,7 +852,8 @@ export const dropEvent = (protyle: IProtyle, editorElement: HTMLElement) => {} else {previousID = targetElement.previousElementSibling?.getAttribute("data-id") || "";}- const avId = blockElement.getAttribute("data-av-id");+ const avID = blockElement.getAttribute("data-av-id");+ const viewID = blockElement.querySelector(".item--focus").getAttribute("data-id");if (gutterTypes[0] === "nodeattributeview" && gutterTypes[1] === "row") {// 行内拖拽const doOperations: IOperation[] = [];@@ -858,13 +862,15 @@ export const dropEvent = (protyle: IProtyle, editorElement: HTMLElement) => {selectedIds.reverse().forEach(item => {doOperations.push({action: "sortAttrViewRow",- parentID: avId,+ avID,+ viewID,previousID,id: item,});undoOperations.push({action: "sortAttrViewRow",- parentID: avId,+ avID,+ viewID,previousID: undoPreviousId,id: item,});@@ -873,13 +879,13 @@ export const dropEvent = (protyle: IProtyle, editorElement: HTMLElement) => {} else {transaction(protyle, [{action: "insertAttrViewBlock",- parentID: avId,+ avID,previousID,srcIDs: sourceIds,}], [{action: "removeAttrViewBlock",srcIDs: sourceIds,- parentID: avId,+ avID,}]);}return;diff --git a/app/src/types/index.d.ts b/app/src/types/index.d.tsindex 67be7120a8..031f58e1d7 100644--- a/app/src/types/index.d.ts+++ b/app/src/types/index.d.ts@@ -309,7 +309,7 @@ interface IOperation {avID?: string, // avviewID?: string, // avdata?: any, // updateAttr 时为 { old: IObject, new: IObject }, updateAttrViewCell 时为 {TAVCol: {content: string}}- parentID?: string // 为 insertAttrViewBlock 传 avid+ parentID?: stringpreviousID?: stringretData?: anynextID?: string // insert 专享