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:
Vanessad5113b3075f0
diff --git a/app/src/protyle/render/av/cell.ts b/app/src/protyle/render/av/cell.tsindex a1cce89c9d..f168f70931 100644--- a/app/src/protyle/render/av/cell.ts+++ b/app/src/protyle/render/av/cell.ts@@ -331,9 +331,9 @@ const updateCellValue = (protyle: IProtyle, type: TAVCol, cellElements: HTMLElemreturn;}- const avMaskElement = document.querySelector(".av__mask")- const doOperations: IOperation[] = []- const undoOperations: IOperation[] = []+ const avMaskElement = document.querySelector(".av__mask");+ const doOperations: IOperation[] = [];+ const undoOperations: IOperation[] = [];const avID = blockElement.getAttribute("data-av-id");cellElements.forEach((item) => {const rowElement = hasClosestByClassName(item, "av__row");@@ -364,7 +364,7 @@ const updateCellValue = (protyle: IProtyle, type: TAVCol, cellElements: HTMLElemdata: {[type]: inputValue}- })+ });undoOperations.push({action: "updateAttrViewCell",id: cellId,@@ -374,8 +374,8 @@ const updateCellValue = (protyle: IProtyle, type: TAVCol, cellElements: HTMLElemdata: {[type]: oldValue}- })- })+ });+ });transaction(protyle, doOperations, undoOperations);setTimeout(() => {avMaskElement.remove();diff --git a/app/src/protyle/render/av/col.ts b/app/src/protyle/render/av/col.tsindex 7ad5fd707e..3fdcede97f 100644--- a/app/src/protyle/render/av/col.ts+++ b/app/src/protyle/render/av/col.ts@@ -13,7 +13,7 @@ export const getEditHTML = (options: {data: IAV}) => {// TODO-}+};export const getColIconByType = (type: TAVCol) => {switch (type) {diff --git a/app/src/protyle/render/av/select.ts b/app/src/protyle/render/av/select.tsindex 326443c528..68be6bfcda 100644--- a/app/src/protyle/render/av/select.ts+++ b/app/src/protyle/render/av/select.ts@@ -49,8 +49,8 @@ export const removeSelectCell = (protyle: IProtyle, data: IAV, options: {return;}const colId = options.cellElements[0].dataset.colId;- const doOperations: IOperation[] = []- const undoOperations: IOperation[] = []+ const doOperations: IOperation[] = [];+ const undoOperations: IOperation[] = [];options.cellElements.forEach(item => {const rowID = item.parentElement.dataset.id;const cellId = item.dataset.id;@@ -81,7 +81,7 @@ export const removeSelectCell = (protyle: IProtyle, data: IAV, options: {rowID,avID: data.id,data: cellData.value- })+ });undoOperations.push({action: "updateAttrViewCell",id: cellId,@@ -91,8 +91,8 @@ export const removeSelectCell = (protyle: IProtyle, data: IAV, options: {data: {mSelect: oldValue}- })- })+ });+ });transaction(protyle, doOperations, undoOperations);target.remove();};@@ -354,7 +354,7 @@ export const addSelectColAndCell = (protyle: IProtyle, data: IAV, options: {hasSelected = true;return true;}- })+ });if (hasSelected) {menuElement.querySelector("input").focus();return;@@ -379,8 +379,8 @@ export const addSelectColAndCell = (protyle: IProtyle, data: IAV, options: {}});- const cellDoOperations: IOperation[] = []- const cellUndoOperations: IOperation[] = []+ const cellDoOperations: IOperation[] = [];+ const cellUndoOperations: IOperation[] = [];options.cellElements.forEach(item => {let cellData: IAVCell;const rowID = item.parentElement.dataset.id;@@ -401,8 +401,8 @@ export const addSelectColAndCell = (protyle: IProtyle, data: IAV, options: {let hasOption = false;cellData.value.mSelect.find((item) => {if (item.content === currentElement.dataset.name) {- hasOption = true- return true+ hasOption = true;+ return true;}});if (!hasOption) {@@ -424,7 +424,7 @@ export const addSelectColAndCell = (protyle: IProtyle, data: IAV, options: {rowID,avID: data.id,data: cellData.value- })+ });cellUndoOperations.push({action: "updateAttrViewCell",id: cellData.id,@@ -434,8 +434,8 @@ export const addSelectColAndCell = (protyle: IProtyle, data: IAV, options: {data: {[colData.type]: oldValue}- })- })+ });+ });if (currentElement.querySelector(".b3-menu__accelerator")) {colData.options.push({@@ -447,7 +447,7 @@ export const addSelectColAndCell = (protyle: IProtyle, data: IAV, options: {id: colId,avID: data.id,data: colData.options- })+ });transaction(protyle, cellDoOperations, [{action: "removeAttrViewColOption",id: colId,@@ -474,24 +474,24 @@ export const getSelectHTML = (data: IAVTable, options: { cellElements: HTMLEleme}});- const commonOptions: { content: string, color: string }[][] = []- const allUniqueOptions: { content: string, color: string }[] = []+ const commonOptions: { content: string, color: string }[][] = [];+ const allUniqueOptions: { content: string, color: string }[] = [];options.cellElements.forEach((cellElement) => {data.rows.find(row => {if (cellElement.parentElement.dataset.id === row.id) {- const commonOption: { content: string, color: string }[] = []+ const commonOption: { content: string, color: string }[] = [];row.cells.find(cell => {if (cell.id === cellElement.dataset.id) {if (cell.value && cell.value.mSelect) {cell.value.mSelect.forEach((item: { content: string, color: string }) => {- commonOption.push(item)- allUniqueOptions.push(item)+ commonOption.push(item);+ allUniqueOptions.push(item);});}return true;}});- commonOptions.push(commonOption)+ commonOptions.push(commonOption);return true;}});@@ -499,20 +499,20 @@ export const getSelectHTML = (data: IAVTable, options: { cellElements: HTMLElemelet selectedHTML = "";allUniqueOptions.forEach((unique) => {- let everyRowHas = true+ let everyRowHas = true;commonOptions.find(item => {- let hasContent = false+ let hasContent = false;item.find((option) => {if (option.content === unique.content) {- hasContent = true+ hasContent = true;return true;}- })+ });if (!hasContent) {- everyRowHas = false- return true+ everyRowHas = false;+ return true;}- })+ });if (everyRowHas && selectedHTML.indexOf(`data-content="${unique.content}"`) === -1) {selectedHTML += `<div class="b3-chip b3-chip--middle" data-content="${unique.content}" style="background-color:var(--b3-font-background${unique.color});color:var(--b3-font-color${unique.color})">${unique.content}<svg class="b3-chip__close" data-type="removeSelectCell"><use xlink:href="#iconCloseRound"></use></svg></div>`;}