An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:rotating_light:
Vanessadbe4eb7d4da9
diff --git a/app/src/protyle/render/av/col.ts b/app/src/protyle/render/av/col.tsindex 708fa109b7..64e5ac09d8 100644--- a/app/src/protyle/render/av/col.ts+++ b/app/src/protyle/render/av/col.ts@@ -64,20 +64,20 @@ export const duplicateCol = (protyle: IProtyle, type: TAVCol, avID: string, colIavID,}]);}-}+};export const getEditHTML = (options: {protyle: IProtyle,colId: string,data: IAV}) => {- let colData: IAVColumn+ let colData: IAVColumn;options.data.view.columns.find((item) => {if (item.id === options.colId) {colData = item;return true;}- })+ });let html = `<button class="b3-menu__item" data-type="nobg" data-col-id="${options.colId}"><span class="block__icon" style="padding: 8px;margin-left: -4px;" data-type="goProperties"><svg><use xlink:href="#iconLeft"></use></svg>@@ -95,7 +95,7 @@ export const getEditHTML = (options: {<button class="b3-menu__item"><svg class="b3-menu__icon" style=""><use xlink:href="#iconAdd"></use></svg><span class="b3-menu__label"><input data-type="addOption" style="margin: 4px 0" class="b3-text-field" type="text" placeholder="Enter ${window.siyuan.languages.addAttr}"></span>-</button>`+</button>`;colData.options.forEach(item => {html += `<button class="b3-menu__item${html ? "" : " b3-menu__item--current"}" draggable="true" data-name="${item.name}" data-color="${item.color}"><svg class="b3-menu__icon"><use xlink:href="#iconDrag"></use></svg>@@ -129,7 +129,7 @@ export const bindEditEvent = (options: { protyle: IProtyle, data: IAV, menuElemeconst colId = options.menuElement.firstElementChild.getAttribute("data-col-id");const colData = options.data.view.columns.find((item: IAVColumn) => item.id === colId);const nameElement = options.menuElement.querySelector('[data-type="name"]') as HTMLInputElement;- nameElement.addEventListener("blur", (event) => {+ nameElement.addEventListener("blur", () => {const newValue = nameElement.value;if (newValue === colData.name) {return;@@ -151,7 +151,7 @@ export const bindEditEvent = (options: { protyle: IProtyle, data: IAV, menuEleme});nameElement.addEventListener("keydown", (event: KeyboardEvent) => {if (event.isComposing) {- return+ return;}if (event.key === "Escape") {options.menuElement.parentElement.remove();@@ -196,7 +196,7 @@ export const bindEditEvent = (options: { protyle: IProtyle, data: IAV, menuEleme(options.menuElement.querySelector('[data-type="addOption"]') as HTMLInputElement).focus();}});-}+};export const getColIconByType = (type: TAVCol) => {switch (type) {diff --git a/app/src/protyle/render/av/openMenuPanel.ts b/app/src/protyle/render/av/openMenuPanel.tsindex bcd20ce3f4..ffa9e8c4fa 100644--- a/app/src/protyle/render/av/openMenuPanel.ts+++ b/app/src/protyle/render/av/openMenuPanel.ts@@ -57,7 +57,7 @@ export const openMenuPanel = (options: {if (options.type === "sorts") {bindSortsEvent(options.protyle, menuElement, data);} else if (options.type === "edit") {- bindEditEvent({protyle: options.protyle, data, menuElement})+ bindEditEvent({protyle: options.protyle, data, menuElement});}}avPanelElement.addEventListener("dragstart", (event) => {@@ -127,7 +127,7 @@ export const openMenuPanel = (options: {data,colId});- bindEditEvent({protyle: options.protyle, data, menuElement})+ bindEditEvent({protyle: options.protyle, data, menuElement});}return;}@@ -479,7 +479,7 @@ export const openMenuPanel = (options: {event.stopPropagation();break;} else if (type === "hideCol") {- const isEdit = menuElement.querySelector('[data-type="goProperties"]')+ const isEdit = menuElement.querySelector('[data-type="goProperties"]');const colId = isEdit ? menuElement.firstElementChild.getAttribute("data-col-id") : target.parentElement.getAttribute("data-id");transaction(options.protyle, [{action: "setAttrViewColHidden",@@ -507,7 +507,7 @@ export const openMenuPanel = (options: {event.stopPropagation();break;} else if (type === "showCol") {- const isEdit = menuElement.querySelector('[data-type="goProperties"]')+ const isEdit = menuElement.querySelector('[data-type="goProperties"]');const colId = isEdit ? menuElement.firstElementChild.getAttribute("data-col-id") : target.parentElement.getAttribute("data-id");transaction(options.protyle, [{action: "setAttrViewColHidden",@@ -535,15 +535,15 @@ export const openMenuPanel = (options: {event.stopPropagation();break;} else if (type === "duplicateCol") {- const colId = menuElement.firstElementChild.getAttribute("data-col-id")- const colData = data.view.columns.find((item: IAVColumn) => item.id === colId)+ const colId = menuElement.firstElementChild.getAttribute("data-col-id");+ const colData = data.view.columns.find((item: IAVColumn) => item.id === colId);duplicateCol(options.protyle, colData.type, avID, colId, colData.name);avPanelElement.remove();event.stopPropagation();break;} else if (type === "removeCol") {- const colId = menuElement.firstElementChild.getAttribute("data-col-id")- const colData = data.view.columns.find((item: IAVColumn) => item.id === colId)+ const colId = menuElement.firstElementChild.getAttribute("data-col-id");+ const colData = data.view.columns.find((item: IAVColumn) => item.id === colId);transaction(options.protyle, [{action: "removeAttrViewCol",id: colId,diff --git a/app/src/protyle/render/av/render.ts b/app/src/protyle/render/av/render.tsindex 3b5de8c4e4..5a1d5c7f06 100644--- a/app/src/protyle/render/av/render.ts+++ b/app/src/protyle/render/av/render.ts@@ -62,7 +62,7 @@ style="width: ${column.width || "200px"}">${getCalcValue(column) || '<svg><use xif (cell.valueType === "text") {text = `<span class="av__celltext">${cell.value?.text.content || ""}</span>`;} else if (cell.valueType === "block") {- text = `<span class="av__celltext">${cell.value?.block.content || ""}</span>`+ text = `<span class="av__celltext">${cell.value?.block.content || ""}</span>`;if (cell.value?.block.id) {text += `<span class="b3-chip b3-chip--small" data-type="block-ref" data-id="${cell.value.block.id}" data-subtype="s">${window.siyuan.languages.openBy}</span>`;}diff --git a/app/src/protyle/render/av/select.ts b/app/src/protyle/render/av/select.tsindex 7c0fb2a63a..f27a849a32 100644--- a/app/src/protyle/render/av/select.ts+++ b/app/src/protyle/render/av/select.ts@@ -140,7 +140,7 @@ export const setColOption = (protyle: IProtyle, data: IAV, target: HTMLElement,});if (!cellElements) {menuElement.innerHTML = getEditHTML({protyle, data, colId});- bindEditEvent({protyle, data, menuElement})+ bindEditEvent({protyle, data, menuElement});} else {cellElements.forEach((cellElement: HTMLMediaElement) => {data.view.rows.find(row => {@@ -159,7 +159,7 @@ export const setColOption = (protyle: IProtyle, data: IAV, target: HTMLElement,return true;}});- })+ });menuElement.innerHTML = getSelectHTML(data.view, cellElements);bindSelectEvent(protyle, data, menuElement, cellElements);}@@ -203,7 +203,7 @@ export const setColOption = (protyle: IProtyle, data: IAV, target: HTMLElement,});if (!cellElements) {menuElement.innerHTML = getEditHTML({protyle, data, colId});- bindEditEvent({protyle, data, menuElement})+ bindEditEvent({protyle, data, menuElement});} else {cellElements.forEach((cellElement: HTMLElement) => {data.view.rows.find(row => {@@ -222,7 +222,7 @@ export const setColOption = (protyle: IProtyle, data: IAV, target: HTMLElement,return true;}});- })+ });menuElement.innerHTML = getSelectHTML(data.view, cellElements);bindSelectEvent(protyle, data, menuElement, cellElements);}@@ -277,7 +277,7 @@ export const setColOption = (protyle: IProtyle, data: IAV, target: HTMLElement,});if (!cellElements) {menuElement.innerHTML = getEditHTML({protyle, data, colId});- bindEditEvent({protyle, data, menuElement})+ bindEditEvent({protyle, data, menuElement});} else {cellElements.forEach((cellElement: HTMLElement) => {data.view.rows.find(row => {@@ -297,7 +297,7 @@ export const setColOption = (protyle: IProtyle, data: IAV, target: HTMLElement,return true;}});- })+ });menuElement.innerHTML = getSelectHTML(data.view, cellElements);bindSelectEvent(protyle, data, menuElement, cellElements);}