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:
Vanessa6850abe88ab1
diff --git a/app/src/card/openCard.ts b/app/src/card/openCard.tsindex c93d2fd87f..bc6a2a0976 100644--- a/app/src/card/openCard.ts+++ b/app/src/card/openCard.ts@@ -336,7 +336,7 @@ export const bindCardEvent = (options: {hideElements(["toolbar", "hint", "util"], editor.protyle);if (type === "-1") { // 显示答案if (actionElements[0].classList.contains("fn__none")) {- type = "3"+ type = "3";} else {editor.protyle.element.classList.remove("card__block--hidemark", "card__block--hideli", "card__block--hidesb", "card__block--hideh");actionElements[0].classList.add("fn__none");diff --git a/app/src/constants.ts b/app/src/constants.tsindex 7a145f90b4..a96098e340 100644--- a/app/src/constants.ts+++ b/app/src/constants.ts@@ -543,7 +543,7 @@ export abstract class Constants {"code-block": true,"math-block": true,"html-block": true- }+ };// imagepublic static readonly SIYUAN_IMAGE_VIP: string = `<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">diff --git a/app/src/protyle/render/av/cell.ts b/app/src/protyle/render/av/cell.tsindex d902801458..4550870e2c 100644--- a/app/src/protyle/render/av/cell.ts+++ b/app/src/protyle/render/av/cell.ts@@ -12,7 +12,7 @@ export const getCellText = (cellElement: HTMLElement | false) => {if (!cellElement) {return "";}- let cellText = ""+ let cellText = "";const textElement = cellElement.querySelector(".av__celltext");if (textElement) {if (textElement.querySelector(".av__cellicon")) {@@ -29,7 +29,7 @@ export const getCellText = (cellElement: HTMLElement | false) => {const genCellValueByElement = (colType: TAVCol, cellElement: HTMLElement) => {let cellValue: IAVCellValue;if (colType === "number") {- const value = cellElement.querySelector(".av__celltext").getAttribute("data-content")+ const value = cellElement.querySelector(".av__celltext").getAttribute("data-content");cellValue = {type: colType,number: {@@ -45,13 +45,13 @@ const genCellValueByElement = (colType: TAVCol, cellElement: HTMLElement) => {}};} else if (colType === "mSelect" || colType === "select") {- const mSelect: IAVCellSelectValue[] = []+ const mSelect: IAVCellSelectValue[] = [];cellElement.querySelectorAll(".b3-chip").forEach((item: HTMLElement) => {mSelect.push({content: item.textContent.trim(),color: item.style.color.replace("var(--b3-font-color", "").replace(")", "")- })- })+ });+ });cellValue = {type: colType,mSelect@@ -70,7 +70,7 @@ const genCellValueByElement = (colType: TAVCol, cellElement: HTMLElement) => {};}return cellValue;-}+};export const genCellValue = (colType: TAVCol, value: string | any) => {let cellValue: IAVCellValue;@@ -323,7 +323,7 @@ const updateCellValueByInput = (protyle: IProtyle, type: TAVCol, cellElements: Hlet tempElement = protyle.wysiwyg.element.querySelector(`.av__cell[data-id="${cellElements[0].dataset.id}"]`) as HTMLElement;if (!tempElement) {// 修改单元格后修改其他没有内容的单元格(id 会随机)- tempElement = protyle.wysiwyg.element.querySelector(`.av__row[data-id="${rowElement.dataset.id}"] .av__cell[data-col-id="${cellElements[0].dataset.colId}"]`) as HTMLElement+ tempElement = protyle.wysiwyg.element.querySelector(`.av__row[data-id="${rowElement.dataset.id}"] .av__cell[data-col-id="${cellElements[0].dataset.colId}"]`) as HTMLElement;}if (!tempElement) {return;@@ -451,18 +451,18 @@ const updateCellValueByInput = (protyle: IProtyle, type: TAVCol, cellElements: H};export const updateCellsValue = (protyle: IProtyle, nodeElement: HTMLElement, value = "") => {- const doOperations: IOperation[] = []- const undoOperations: IOperation[] = []+ const doOperations: IOperation[] = [];+ const undoOperations: IOperation[] = [];- const avID = nodeElement.dataset.avId- const id = nodeElement.dataset.nodeId- let text = ''+ const avID = nodeElement.dataset.avId;+ const id = nodeElement.dataset.nodeId;+ let text = "";const cellElements: Element[] = Array.from(nodeElement.querySelectorAll(".av__cell--select")) || [];if (cellElements.length === 0) {nodeElement.querySelectorAll(".av__row--select:not(.av__row--header)").forEach(rowElement => {rowElement.querySelectorAll(".av__cell").forEach(cellElement => {- cellElements.push(cellElement)- })+ cellElements.push(cellElement);+ });});}cellElements.forEach((item: HTMLElement) => {@@ -499,19 +499,19 @@ export const updateCellsValue = (protyle: IProtyle, nodeElement: HTMLElement, vaif (!hasClosestByClassName(cellElements[0], "custom-attr")) {updateAttrViewCellAnimation(item);}- })+ });if (doOperations.length > 0) {doOperations.push({action: "doUpdateUpdated",id,data: dayjs().format("YYYYMMDDHHmmss"),- })+ });undoOperations.push({action: "doUpdateUpdated",id,data: nodeElement.getAttribute("updated"),- })+ });transaction(protyle, doOperations, undoOperations);}return text;-}+};diff --git a/app/src/protyle/render/av/row.ts b/app/src/protyle/render/av/row.tsindex e160617a33..60d830e24c 100644--- a/app/src/protyle/render/av/row.ts+++ b/app/src/protyle/render/av/row.ts@@ -90,9 +90,9 @@ export const insertAttrViewBlockAnimation = (blockElement: Element, srcIDs: stri</div>`;});previousElement.insertAdjacentHTML("afterend", html);- const pageSize = parseInt(blockElement.getAttribute("data-page-size"))+ const pageSize = parseInt(blockElement.getAttribute("data-page-size"));if (pageSize) {- const currentCount = blockElement.querySelectorAll(".av__row:not(.av__row--header)").length+ const currentCount = blockElement.querySelectorAll(".av__row:not(.av__row--header)").length;if (pageSize < currentCount) {blockElement.setAttribute("data-page-size", currentCount.toString());}@@ -253,4 +253,4 @@ export const deleteRow = (blockElement: HTMLElement, protyle: IProtyle) => {});stickyRow(blockElement, protyle.contentElement.getBoundingClientRect(), "all");updateHeader(blockElement.querySelector(".av__row"));-}+};diff --git a/app/src/protyle/util/insertHTML.ts b/app/src/protyle/util/insertHTML.tsindex a90b90a172..36a4a7eddf 100644--- a/app/src/protyle/util/insertHTML.ts+++ b/app/src/protyle/util/insertHTML.ts@@ -54,10 +54,10 @@ export const insertHTML = (html: string, protyle: IProtyle, isBlock = false,range.deleteContents();const text = readText();if (typeof text === "string") {- processAV(range, text, protyle, blockElement)+ processAV(range, text, protyle, blockElement);} else {text.then((t) => {- processAV(range, t, protyle, blockElement)+ processAV(range, t, protyle, blockElement);});}return;diff --git a/app/src/protyle/wysiwyg/index.ts b/app/src/protyle/wysiwyg/index.tsindex 180659dca6..d9beba8698 100644--- a/app/src/protyle/wysiwyg/index.ts+++ b/app/src/protyle/wysiwyg/index.ts@@ -289,8 +289,8 @@ export class WYSIWYG {if (cellElements.length === 0) {nodeElement.querySelectorAll(".av__row--select:not(.av__row--header)").forEach(rowElement => {rowElement.querySelectorAll(".av__cell").forEach(cellElement => {- cellElements.push(cellElement)- })+ cellElements.push(cellElement);+ });});}cellElements.forEach((item: HTMLElement) => {diff --git a/app/src/search/menu.ts b/app/src/search/menu.tsindex 5885712054..e3f2e3d2c2 100644--- a/app/src/search/menu.ts+++ b/app/src/search/menu.ts@@ -162,7 +162,7 @@ export const replaceFilterMenu = (config: ISearchOption) => {<span class="fn__space"></span><input class="b3-switch fn__flex-center" data-type="${key}" type="checkbox"${config.replaceTypes[key] ? " checked" : ""}></label>`;- })+ });const filterDialog = new Dialog({title: window.siyuan.languages.type,content: `<div class="b3-dialog__content">${html}</div>