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/15475
Vanessa5ad8b148a5e5
diff --git a/app/src/protyle/index.ts b/app/src/protyle/index.tsindex 47bf013648..c0bcbef035 100644--- a/app/src/protyle/index.ts+++ b/app/src/protyle/index.ts@@ -148,7 +148,7 @@ export class Protyle {}break;case "refreshAttributeView":- Array.from(this.protyle.wysiwyg.element.querySelectorAll(`[data-av-id="${data.data.id}"]`)).forEach((item: HTMLElement) => {+ Array.from(this.protyle.wysiwyg.element.querySelectorAll(`.av[data-av-id="${data.data.id}"]`)).forEach((item: HTMLElement) => {item.removeAttribute("data-render");avRender(item, this.protyle);});diff --git a/app/src/protyle/render/av/action.ts b/app/src/protyle/render/av/action.tsindex d9e8f03e3d..f8bd4e612b 100644--- a/app/src/protyle/render/av/action.ts+++ b/app/src/protyle/render/av/action.ts@@ -791,7 +791,7 @@ export const updateAVName = (protyle: IProtyle, blockElement: Element) => {nameElement.dataset.title = newData;// 当前页面不能进行推送,否则光标会乱跳- Array.from(protyle.wysiwyg.element.querySelectorAll(`[data-av-id="${avId}"]`)).forEach((item: HTMLElement) => {+ Array.from(protyle.wysiwyg.element.querySelectorAll(`.av[data-av-id="${avId}"]`)).forEach((item: HTMLElement) => {if (blockElement === item) {return;}diff --git a/app/src/protyle/render/av/blockAttr.ts b/app/src/protyle/render/av/blockAttr.tsindex f4f27a05fe..f9e03f8a9b 100644--- a/app/src/protyle/render/av/blockAttr.ts+++ b/app/src/protyle/render/av/blockAttr.ts@@ -211,7 +211,7 @@ class="fn__flex-1 fn__flex${["url", "text", "number", "email", "phone", "block"]if (element.innerHTML) {// 防止 blockElement 找不到- element.querySelector(`div[data-node-id="${id}"][data-av-id="${table.avID}"]`).innerHTML = innerHTML;+ element.querySelector(`.av[data-node-id="${id}"][data-av-id="${table.avID}"]`).innerHTML = innerHTML;}});if (element.innerHTML === "") {diff --git a/app/src/protyle/render/av/render.ts b/app/src/protyle/render/av/render.tsindex 3bd96c2bbd..17a01479af 100644--- a/app/src/protyle/render/av/render.ts+++ b/app/src/protyle/render/av/render.ts@@ -564,7 +564,7 @@ const refreshTimeouts: {export const refreshAV = (protyle: IProtyle, operation: IOperation) => {if (operation.action === "setAttrViewName") {- Array.from(protyle.wysiwyg.element.querySelectorAll(`[data-av-id="${operation.id}"]`)).forEach((item: HTMLElement) => {+ Array.from(protyle.wysiwyg.element.querySelectorAll(`.av[data-av-id="${operation.id}"]`)).forEach((item: HTMLElement) => {const titleElement = item.querySelector(".av__title") as HTMLElement;if (!titleElement) {return;@@ -574,7 +574,7 @@ export const refreshAV = (protyle: IProtyle, operation: IOperation) => {});}if (operation.action === "setAttrViewColWidth") {- Array.from(protyle.wysiwyg.element.querySelectorAll(`[data-av-id="${operation.avID}"]`)).forEach((item: HTMLElement) => {+ Array.from(protyle.wysiwyg.element.querySelectorAll(`.av[data-av-id="${operation.avID}"]`)).forEach((item: HTMLElement) => {const cellElement = item.querySelector(`.av__cell[data-col-id="${operation.id}"]`) as HTMLElement;if (!cellElement || cellElement.style.width === operation.data || item.getAttribute(Constants.CUSTOM_SY_AV_VIEW) !== operation.keyID) {return;@@ -586,7 +586,7 @@ export const refreshAV = (protyle: IProtyle, operation: IOperation) => {return;}if (operation.action === "setAttrViewCardSize") {- Array.from(protyle.wysiwyg.element.querySelectorAll(`[data-av-id="${operation.avID}"]`)).forEach((item: HTMLElement) => {+ Array.from(protyle.wysiwyg.element.querySelectorAll(`.av[data-av-id="${operation.avID}"]`)).forEach((item: HTMLElement) => {item.querySelectorAll(".av__gallery").forEach(galleryItem => {galleryItem.classList.remove("av__gallery--small", "av__gallery--big");if (operation.data === 0) {@@ -599,7 +599,7 @@ export const refreshAV = (protyle: IProtyle, operation: IOperation) => {return;}if (operation.action === "setAttrViewCardAspectRatio") {- Array.from(protyle.wysiwyg.element.querySelectorAll(`[data-av-id="${operation.avID}"]`)).forEach((item: HTMLElement) => {+ Array.from(protyle.wysiwyg.element.querySelectorAll(`.av[data-av-id="${operation.avID}"]`)).forEach((item: HTMLElement) => {item.querySelectorAll(".av__gallery-cover").forEach(coverItem => {coverItem.className = "av__gallery-cover av__gallery-cover--" + operation.data;});@@ -607,7 +607,7 @@ export const refreshAV = (protyle: IProtyle, operation: IOperation) => {return;}if (operation.action === "hideAttrViewName") {- Array.from(protyle.wysiwyg.element.querySelectorAll(`[data-av-id="${operation.avID}"]`)).forEach((item: HTMLElement) => {+ Array.from(protyle.wysiwyg.element.querySelectorAll(`.av[data-av-id="${operation.avID}"]`)).forEach((item: HTMLElement) => {const titleElement = item.querySelector(".av__title");if (titleElement) {if (!operation.data) {@@ -630,7 +630,7 @@ export const refreshAV = (protyle: IProtyle, operation: IOperation) => {return;}if (operation.action === "setAttrViewWrapField") {- Array.from(protyle.wysiwyg.element.querySelectorAll(`[data-av-id="${operation.avID}"]`)).forEach((item: HTMLElement) => {+ Array.from(protyle.wysiwyg.element.querySelectorAll(`.av[data-av-id="${operation.avID}"]`)).forEach((item: HTMLElement) => {item.querySelectorAll(".av__cell").forEach(fieldItem => {fieldItem.setAttribute("data-wrap", operation.data.toString());});@@ -638,7 +638,7 @@ export const refreshAV = (protyle: IProtyle, operation: IOperation) => {return;}if (operation.action === "setAttrViewShowIcon") {- Array.from(protyle.wysiwyg.element.querySelectorAll(`[data-av-id="${operation.avID}"]`)).forEach((item: HTMLElement) => {+ Array.from(protyle.wysiwyg.element.querySelectorAll(`.av[data-av-id="${operation.avID}"]`)).forEach((item: HTMLElement) => {item.querySelectorAll('.av__cell[data-dtype="block"] .b3-menu__avemoji, .av__cell[data-dtype="relation"] .b3-menu__avemoji').forEach(cellItem => {if (operation.data) {cellItem.classList.remove("fn__none");@@ -650,7 +650,7 @@ export const refreshAV = (protyle: IProtyle, operation: IOperation) => {return;}if (operation.action === "setAttrViewColWrap") {- Array.from(protyle.wysiwyg.element.querySelectorAll(`[data-av-id="${operation.avID}"]`)).forEach((item: HTMLElement) => {+ Array.from(protyle.wysiwyg.element.querySelectorAll(`.av[data-av-id="${operation.avID}"]`)).forEach((item: HTMLElement) => {item.querySelectorAll(`.av__cell[data-col-id="${operation.id}"],.av__cell[data-field-id="${operation.id}"]`).forEach(cellItem => {cellItem.setAttribute("data-wrap", operation.data.toString());});@@ -658,7 +658,7 @@ export const refreshAV = (protyle: IProtyle, operation: IOperation) => {return;}if (operation.action === "foldAttrViewGroup") {- Array.from(protyle.wysiwyg.element.querySelectorAll(`[data-av-id="${operation.avID}"]`)).forEach((item: HTMLElement) => {+ Array.from(protyle.wysiwyg.element.querySelectorAll(`.av[data-av-id="${operation.avID}"]`)).forEach((item: HTMLElement) => {const foldElement = item.querySelector(`[data-type="av-group-fold"][data-id="${operation.id}"]`);if (operation.data) {foldElement.firstElementChild.classList.remove("av__group-arrow--open");@@ -676,7 +676,7 @@ export const refreshAV = (protyle: IProtyle, operation: IOperation) => {refreshTimeouts[protyle.id] = window.setTimeout(() => {// 修改表格名 avID 传入到 id 上了 https://github.com/siyuan-note/siyuan/issues/12724const avID = operation.action === "setAttrViewName" ? operation.id : operation.avID;- Array.from(protyle.wysiwyg.element.querySelectorAll(`[data-av-id="${avID}"]`)).forEach((item: HTMLElement) => {+ Array.from(protyle.wysiwyg.element.querySelectorAll(`.av[data-av-id="${avID}"]`)).forEach((item: HTMLElement) => {item.removeAttribute("data-render");if (operation.action === "sortAttrViewCol" || operation.action === "sortAttrViewRow") {item.querySelectorAll(".av__cell--active").forEach((item: HTMLElement) => {@@ -708,7 +708,7 @@ export const refreshAV = (protyle: IProtyle, operation: IOperation) => {}}avRender(item, protyle, () => {- const attrElement = document.querySelector(`.b3-dialog--open[data-key="${Constants.DIALOG_ATTR}"] div[data-av-id="${avID}"]`) as HTMLElement;+ const attrElement = document.querySelector(`.b3-dialog--open[data-key="${Constants.DIALOG_ATTR}"] .av[data-av-id="${avID}"]`) as HTMLElement;if (attrElement) {// 更新属性面板renderAVAttribute(attrElement.parentElement, attrElement.dataset.nodeId, protyle);diff --git a/app/src/protyle/wysiwyg/transaction.ts b/app/src/protyle/wysiwyg/transaction.tsindex 14cae7d375..1591558829 100644--- a/app/src/protyle/wysiwyg/transaction.ts+++ b/app/src/protyle/wysiwyg/transaction.ts@@ -870,7 +870,7 @@ export const onTransaction = (protyle: IProtyle, operation: IOperation, isUndo:refreshAV(protyle, operation);} else if (operation.action === "setAttrViewName") {// setAttrViewName 同文档不会推送,需手动刷新- Array.from(protyle.wysiwyg.element.querySelectorAll(`[data-av-id="${operation.id}"]`)).forEach((item: HTMLElement) => {+ Array.from(protyle.wysiwyg.element.querySelectorAll(`.av[data-av-id="${operation.id}"]`)).forEach((item: HTMLElement) => {const titleElement = item.querySelector(".av__title") as HTMLElement;if (!titleElement) {return;