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:
Vanessa45c389629a53
diff --git a/app/src/menus/protyle.ts b/app/src/menus/protyle.tsindex f5dab016bb..e5df3ccd48 100644--- a/app/src/menus/protyle.ts+++ b/app/src/menus/protyle.ts@@ -68,7 +68,7 @@ export const fileAnnotationRefMenu = (protyle: IProtyle, refElement: HTMLElement} else {refElement.innerHTML = "*";}- }+ };anchorElement.addEventListener("input", (event: KeyboardEvent) => {if (event.isComposing) {return;diff --git a/app/src/plugin/EventBus.ts b/app/src/plugin/EventBus.tsindex 59c9157bcc..86a0051bbd 100644--- a/app/src/plugin/EventBus.ts+++ b/app/src/plugin/EventBus.ts@@ -49,4 +49,4 @@ export const emitOpenMenu = (options: {window.siyuan.menus.menu.append(new MenuItem({type: "separator"}).element);}}-}+};diff --git a/app/src/protyle/header/Title.ts b/app/src/protyle/header/Title.tsindex 4c76e41134..340eda547d 100644--- a/app/src/protyle/header/Title.ts+++ b/app/src/protyle/header/Title.ts@@ -5,7 +5,7 @@ import {} from "../util/selection";import {fetchPost} from "../../util/fetch";import {replaceFileName, validateName} from "../../editor/rename";-import {MenuItem, subMenu} from "../../menus/Menu";+import {MenuItem} from "../../menus/Menu";import {copySubMenu,movePathToMenu,diff --git a/app/src/protyle/render/av/action.ts b/app/src/protyle/render/av/action.tsindex 4ebfa4c56a..023bbaadbc 100644--- a/app/src/protyle/render/av/action.ts+++ b/app/src/protyle/render/av/action.ts@@ -133,18 +133,18 @@ export const avClick = (protyle: IProtyle, event: MouseEvent & { target: HTMLEleif (checkElement) {window.siyuan.menus.menu.remove();const rowElement = checkElement.parentElement;- const useElement = checkElement.querySelector("use")+ const useElement = checkElement.querySelector("use");if (rowElement.classList.contains("av__row--header")) {if ("#iconCheck" === useElement.getAttribute("xlink:href")) {rowElement.parentElement.querySelectorAll(".av__firstcol").forEach(item => {item.querySelector("use").setAttribute("xlink:href", "#iconUncheck");item.parentElement.classList.remove("av__row--select");- })+ });} else {rowElement.parentElement.querySelectorAll(".av__firstcol").forEach(item => {item.querySelector("use").setAttribute("xlink:href", "#iconCheck");item.parentElement.classList.add("av__row--select");- })+ });}} else {if (useElement.getAttribute("xlink:href") === "#iconUncheck") {@@ -181,7 +181,7 @@ export const avContextmenu = (protyle: IProtyle, event: MouseEvent & { detail: areturn false;}if (rowElement.classList.contains("av__row--header")) {- return false+ return false;}const blockElement = hasClosestBlock(rowElement);if (!blockElement) {diff --git a/app/src/protyle/render/av/cell.ts b/app/src/protyle/render/av/cell.tsindex 3e10941244..fcb0c50c85 100644--- a/app/src/protyle/render/av/cell.ts+++ b/app/src/protyle/render/av/cell.ts@@ -51,9 +51,9 @@ const updateCellValue = (protyle: IProtyle, cellElement: HTMLElement, type: TAVC}const avMaskElement = document.querySelector(".av__mask");const inputElement = avMaskElement.querySelector(".b3-text-field") as HTMLInputElement;- const cellId = cellElement.getAttribute("data-id")- const avId = blockElement.getAttribute("data-av-id")- const rowId = rowElement.getAttribute("data-id")+ const cellId = cellElement.getAttribute("data-id");+ const avId = blockElement.getAttribute("data-av-id");+ const rowId = rowElement.getAttribute("data-id");transaction(protyle, [{action: "updateAttrViewCell",id: cellId,@@ -90,7 +90,7 @@ const removeCol = (cellElement: HTMLElement) => {export const showHeaderCellMenu = (protyle: IProtyle, blockElement: HTMLElement, cellElement: HTMLElement) => {const type = cellElement.getAttribute("data-dtype") as TAVCol;const menu = new Menu("av-header-cell", () => {- const newValue = (window.siyuan.menus.menu.element.querySelector(".b3-text-field") as HTMLInputElement).value+ const newValue = (window.siyuan.menus.menu.element.querySelector(".b3-text-field") as HTMLInputElement).value;if (newValue === cellElement.textContent.trim()) {return;}diff --git a/app/src/protyle/render/av/col.ts b/app/src/protyle/render/av/col.tsindex 5a0e1c0948..9774730343 100644--- a/app/src/protyle/render/av/col.ts+++ b/app/src/protyle/render/av/col.ts@@ -14,26 +14,26 @@ export const updateHeader = (rowElement: HTMLElement) => {if (!blockElement) {return;}- const selectCount = rowElement.parentElement.querySelectorAll(".av__row--select:not(.av__row--header)").length- const diffCount = rowElement.parentElement.childElementCount - 3 - selectCount- const headElement = rowElement.parentElement.firstElementChild- const headUseElement = headElement.querySelector("use")- const counterElement = blockElement.querySelector(".av__counter")- const avHeadElement = blockElement.querySelector(".av__header") as HTMLElement+ const selectCount = rowElement.parentElement.querySelectorAll(".av__row--select:not(.av__row--header)").length;+ const diffCount = rowElement.parentElement.childElementCount - 3 - selectCount;+ const headElement = rowElement.parentElement.firstElementChild;+ const headUseElement = headElement.querySelector("use");+ const counterElement = blockElement.querySelector(".av__counter");+ const avHeadElement = blockElement.querySelector(".av__header") as HTMLElement;if (diffCount === 0) {headElement.classList.add("av__row--select");headUseElement.setAttribute("xlink:href", "#iconCheck");} else if (diffCount === rowElement.parentElement.childElementCount - 3) {headElement.classList.remove("av__row--select");headUseElement.setAttribute("xlink:href", "#iconUncheck");- counterElement.classList.add("fn__none")- avHeadElement.style.position = ""+ counterElement.classList.add("fn__none");+ avHeadElement.style.position = "";return;} else if (diffCount > 0) {headElement.classList.add("av__row--select");headUseElement.setAttribute("xlink:href", "#iconIndeterminateCheck");}- counterElement.classList.remove("fn__none")- counterElement.innerHTML = `${selectCount} selected`- avHeadElement.style.position = "sticky"-}+ counterElement.classList.remove("fn__none");+ counterElement.innerHTML = `${selectCount} selected`;+ avHeadElement.style.position = "sticky";+};diff --git a/app/src/protyle/render/av/render.ts b/app/src/protyle/render/av/render.tsindex def76de61e..1a2ca7dd46 100644--- a/app/src/protyle/render/av/render.ts+++ b/app/src/protyle/render/av/render.ts@@ -48,19 +48,19 @@ export const avRender = (element: Element, cb?: () => void) => {</div><div class="av__firstcol"><svg><use xlink:href="#iconUncheck"></use></svg></div>`;row.cells.forEach((cell, index) => {- let text: string+ let text: string;if (cell.valueType === "text") {- text = cell.value?.text.content || ""+ text = cell.value?.text.content || "";} else if (cell.valueType === "block") {- text = cell.value?.block.content || ""+ text = cell.value?.block.content || "";} else if (cell.valueType === "number") {- text = cell.value?.number.content || ""+ text = cell.value?.number.content || "";} else if (cell.valueType === "select") {- text = cell.value?.select.content || ""+ text = cell.value?.select.content || "";} else if (cell.valueType === "mSelect") {- text = cell.value?.mSelect.content || ""+ text = cell.value?.mSelect.content || "";} else if (cell.valueType === "date") {- text = cell.value?.date.content || ""+ text = cell.value?.date.content || "";}tableHTML += `<div class="av__cell" ${index === 0 ? 'data-block-id="' + (cell.value.block.id || "") + '"' : ""} data-id="${cell.id}" data-index="${index}" style="width: ${data.columns[index].width || 200}px;${cell.bgColor ? `background-color:${cell.bgColor};` : ""}${cell.color ? `color:${cell.color};` : ""}">${text}</div>`;});diff --git a/app/src/protyle/toolbar/index.ts b/app/src/protyle/toolbar/index.tsindex 1ec180592e..1af5949f39 100644--- a/app/src/protyle/toolbar/index.ts+++ b/app/src/protyle/toolbar/index.ts@@ -15,7 +15,7 @@ import {Link} from "./Link";import {setPosition} from "../../util/setPosition";import {updateTransaction} from "../wysiwyg/transaction";import {Constants} from "../../constants";-import {getEventName, openByMobile, setStorageVal} from "../util/compatibility";+import {openByMobile, setStorageVal} from "../util/compatibility";import {upDownHint} from "../../util/upDownHint";import {highlightRender} from "../render/highlightRender";import {getContenteditableElement, hasNextSibling, hasPreviousSibling} from "../wysiwyg/getBlock";diff --git a/app/src/search/util.ts b/app/src/search/util.tsindex c5dc86366c..2170163ada 100644--- a/app/src/search/util.ts+++ b/app/src/search/util.ts@@ -1015,7 +1015,7 @@ const replace = (element: Element, config: ISearchOption, edit: Protyle, app: Apif (isAll) {return;}- const rootId = currentList.getAttribute("data-root-id")+ const rootId = currentList.getAttribute("data-root-id");getAllModels().editor.forEach(item => {if (rootId === item.editor.protyle.block.rootID) {reloadProtyle(item.editor.protyle, false);