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:
Vanessa6f0c68f506fa
diff --git a/app/src/layout/tabUtil.ts b/app/src/layout/tabUtil.tsindex 4c23658991..48a4872b53 100644--- a/app/src/layout/tabUtil.ts+++ b/app/src/layout/tabUtil.ts@@ -6,7 +6,6 @@ import {pdfResize} from "../asset/renderAssets";import {App} from "../index";import {Model} from "./Model";import {Editor} from "../editor";-import {saveScroll} from "../protyle/scroll/saveScroll";import {Asset} from "../asset";import {Graph} from "./dock/Graph";import {Files} from "./dock/Files";diff --git a/app/src/layout/util.ts b/app/src/layout/util.tsindex a95ca8c909..e6e8381832 100644--- a/app/src/layout/util.ts+++ b/app/src/layout/util.ts@@ -229,8 +229,8 @@ export const exportLayout = (options: {};layoutToJSON(window.siyuan.layout.layout, layoutJSON.layout);getAllModels().editor.forEach(item => {- saveScroll(item.editor.protyle)- })+ saveScroll(item.editor.protyle);+ });sessionStorage.setItem("layout", JSON.stringify(layoutJSON));options.cb();return;@@ -248,8 +248,8 @@ export const exportLayout = (options: {};layoutToJSON(window.siyuan.layout.layout, layoutJSON.layout);getAllModels().editor.forEach(item => {- saveScroll(item.editor.protyle)- })+ saveScroll(item.editor.protyle);+ });fetchPost("/api/system/setUILayout", {layout: layoutJSON,errorExit: options.errorExit // 后台不接受该参数,用于请求发生错误时退出程序@@ -268,7 +268,7 @@ export const getAllLayout = () => {};layoutToJSON(window.siyuan.layout.layout, layoutJSON.layout);return layoutJSON;-}+};const initInternalDock = (dockItem: IDockTab[]) => {dockItem.forEach((existSubItem) => {diff --git a/app/src/menus/protyle.ts b/app/src/menus/protyle.tsindex c21ccf5461..0e34eb04a0 100644--- a/app/src/menus/protyle.ts+++ b/app/src/menus/protyle.ts@@ -1100,7 +1100,7 @@ export const linkMenu = (protyle: IProtyle, linkElement: HTMLElement, focusTextconst id = nodeElement.getAttribute("data-node-id");let html = nodeElement.outerHTML;const linkAddress = linkElement.getAttribute("data-href");- let inputElements: NodeListOf<HTMLTextAreaElement>+ let inputElements: NodeListOf<HTMLTextAreaElement>;window.siyuan.menus.menu.append(new MenuItem({iconHTML: "",type: "readonly",diff --git a/app/src/mobile/editor.ts b/app/src/mobile/editor.tsindex 87bc41c07c..2b5cccfead 100644--- a/app/src/mobile/editor.ts+++ b/app/src/mobile/editor.ts@@ -61,7 +61,7 @@ export const openMobileFileById = (app: App, id: string, action = [Constants.CB_preview: {actions: ["mp-wechat", "zhihu"]}- }+ };if (window.siyuan.mobile.editor) {pushBack();addLoading(window.siyuan.mobile.editor.protyle);diff --git a/app/src/protyle/header/openTitleMenu.ts b/app/src/protyle/header/openTitleMenu.tsindex dfc4f87636..1c3870b78d 100644--- a/app/src/protyle/header/openTitleMenu.ts+++ b/app/src/protyle/header/openTitleMenu.ts@@ -27,7 +27,6 @@ import {openDocHistory} from "../../history/doc";import {openNewWindowById} from "../../window/openNewWindow";import {genImportMenu} from "../../menus/navigation";import {transferBlockRef} from "../../menus/block";-import {saveScroll} from "../scroll/saveScroll";export const openTitleMenu = (protyle: IProtyle, position: IPosition) => {hideTooltip();diff --git a/app/src/protyle/render/av/calc.ts b/app/src/protyle/render/av/calc.tsindex f528496f13..6a14539960 100644--- a/app/src/protyle/render/av/calc.ts+++ b/app/src/protyle/render/av/calc.ts@@ -33,7 +33,7 @@ const calcItem = (options: {}}]);} else {- options.target.querySelector(".b3-menu__accelerator").textContent = getNameByOperator(options.operator, true)+ options.target.querySelector(".b3-menu__accelerator").textContent = getNameByOperator(options.operator, true);const colData = options.data.view.columns.find((item) => {if (item.id === options.colId) {if (!item.rollup) {@@ -440,6 +440,6 @@ export const getNameByOperator = (operator: string, isRollup: boolean) => {case "Latest":return window.siyuan.languages.calcOperatorLatest;default:- return ""+ return "";}-}+};diff --git a/app/src/protyle/render/av/cell.ts b/app/src/protyle/render/av/cell.tsindex 4a8fa2fa58..e2f42e009d 100644--- a/app/src/protyle/render/av/cell.ts+++ b/app/src/protyle/render/av/cell.ts@@ -667,7 +667,7 @@ export const renderCell = (cellValue: IAVCellValue, wrap: boolean) => {};const renderRollup = (cellValue: IAVCellValue) => {- let text = ""+ let text = "";if (["text"].includes(cellValue.type)) {text = cellValue ? (cellValue[cellValue.type as "text"].content || "") : "";} else if (["url", "email", "phone"].includes(cellValue.type)) {@@ -700,7 +700,7 @@ const renderRollup = (cellValue: IAVCellValue) => {}}return text;-}+};export const updateHeaderCell = (cellElement: HTMLElement, headerValue: {icon?: string,diff --git a/app/src/protyle/render/av/col.ts b/app/src/protyle/render/av/col.tsindex 85abf8104c..432d329dd3 100644--- a/app/src/protyle/render/av/col.ts+++ b/app/src/protyle/render/av/col.ts@@ -530,7 +530,7 @@ export const showColMenu = (protyle: IProtyle, blockElement: Element, cellElemenicon: "iconEdit",label: window.siyuan.languages.edit,click() {- const colName = (menu.element.querySelector(".b3-text-field") as HTMLInputElement).value+ const colName = (menu.element.querySelector(".b3-text-field") as HTMLInputElement).value;openMenuPanel({protyle,blockElement,@@ -538,7 +538,7 @@ export const showColMenu = (protyle: IProtyle, blockElement: Element, cellElemencolId,cb(avElement) {// 修改名字后点击编辑,需要更新名字- const editNameElement = avElement.querySelector('.b3-text-field[data-type="name"]') as HTMLInputElement+ const editNameElement = avElement.querySelector('.b3-text-field[data-type="name"]') as HTMLInputElement;editNameElement.value = colName;editNameElement.select();}diff --git a/app/src/protyle/render/av/filter.ts b/app/src/protyle/render/av/filter.tsindex 2894035c95..615cccf146 100644--- a/app/src/protyle/render/av/filter.ts+++ b/app/src/protyle/render/av/filter.ts@@ -66,7 +66,7 @@ export const setFilter = async (options: {}const menu = new Menu("set-filter-" + options.filter.column, () => {const oldFilters = JSON.parse(JSON.stringify(options.data.view.filters));- const selectElement = window.siyuan.menus.menu.element.querySelector(".b3-select") as HTMLSelectElement+ const selectElement = window.siyuan.menus.menu.element.querySelector(".b3-select") as HTMLSelectElement;if (!selectElement) {return;}@@ -162,10 +162,10 @@ export const setFilter = async (options: {});return;}- let targetAVId = ""+ let targetAVId = "";options.data.view.columns.find((column) => {if (column.id === colData.rollup.relationKeyID) {- targetAVId = column.relation.avID+ targetAVId = column.relation.avID;return true;}});@@ -180,10 +180,10 @@ export const setFilter = async (options: {if (item.column === colData.id && item.type) {item.operator = getDefaultOperatorByType(filterType);item.value = genCellValue(filterType, "");- delete item.type+ delete item.type;return true;}- })+ });}switch (filterType) {case "checkbox":diff --git a/app/src/protyle/render/av/rollup.ts b/app/src/protyle/render/av/rollup.tsindex 4c5f6e8a99..1f3a78108a 100644--- a/app/src/protyle/render/av/rollup.ts+++ b/app/src/protyle/render/av/rollup.ts@@ -18,9 +18,9 @@ const updateCol = (options: {isRelation: boolean,}, itemElement: HTMLElement) => {if (itemElement.classList.contains("b3-list--empty")) {- return+ return;}- options.target.querySelector(".b3-menu__accelerator").textContent = itemElement.querySelector(".b3-list-item__text").textContent+ options.target.querySelector(".b3-menu__accelerator").textContent = itemElement.querySelector(".b3-list-item__text").textContent;const colData = options.data.view.columns.find((item) => {if (item.id === options.colId) {@@ -62,7 +62,7 @@ const updateCol = (options: {const genSearchList = (element: Element, keyword: string, avId: string, isRelation: boolean, cb?: () => void) => {if (!isRelation && !avId) {showMessage(window.siyuan.languages.selectRelation);- return+ return;}fetchPost(isRelation ? "/api/av/searchAttributeViewRelationKey" : "/api/av/searchAttributeViewNonRelationKey", {avID: avId,@@ -172,8 +172,8 @@ export const getRollupHTML = (options: { data?: IAV, cellElements?: HTMLElement[<span class="b3-menu__label">${window.siyuan.languages.calc}</span><span class="b3-menu__accelerator">${getNameByOperator(colData.rollup?.calc?.operator, true)}</span><svg class="b3-menu__icon b3-menu__icon--small"><use xlink:href="#iconRight"></use></svg>-</button>`-}+</button>`;+};export const bindRollupEvent = (options: {protyle: IProtyle,@@ -184,7 +184,7 @@ export const bindRollupEvent = (options: {if (goSearchRollupColElement) {const oldValue = JSON.parse(goSearchRollupColElement.dataset.oldValue) as IAVCellRollupValue;const goSearchRollupTargetElement = options.menuElement.querySelector('[data-type="goSearchRollupTarget"]') as HTMLElement;- let targetKeyAVId = ""+ let targetKeyAVId = "";if (oldValue.relationKeyID) {options.data.view.columns.find((item) => {if (item.id === oldValue.relationKeyID) {@@ -193,13 +193,13 @@ export const bindRollupEvent = (options: {goSearchRollupTargetElement.dataset.avId = targetKeyAVId;return true;}- })+ });}if (oldValue.keyID && targetKeyAVId) {fetchPost("/api/av/getAttributeView", {id: targetKeyAVId}, (response) => {response.data.av.keyValues.find((item: { key: { id: string, name: string, type: TAVCol } }) => {if (item.key.id === oldValue.keyID) {- goSearchRollupTargetElement.querySelector('.b3-menu__accelerator').textContent = item.key.name;+ goSearchRollupTargetElement.querySelector(".b3-menu__accelerator").textContent = item.key.name;const goSearchRollupCalcElement = options.menuElement.querySelector('[data-type="goSearchRollupCalc"]') as HTMLElement;goSearchRollupCalcElement.dataset.colType = item.key.type;goSearchRollupCalcElement.dataset.calc = oldValue.calc.operator;@@ -209,4 +209,4 @@ export const bindRollupEvent = (options: {});}}-}+};diff --git a/app/src/protyle/util/onGet.ts b/app/src/protyle/util/onGet.tsindex f303582cdc..f417322134 100644--- a/app/src/protyle/util/onGet.ts+++ b/app/src/protyle/util/onGet.ts@@ -391,7 +391,7 @@ const focusElementById = (protyle: IProtyle, action: string[], scrollAttr?: IScr}/// #endif}- const hasScrollTop = scrollAttr && typeof scrollAttr.scrollTop === "number"+ const hasScrollTop = scrollAttr && typeof scrollAttr.scrollTop === "number";if (hasScrollTop) {protyle.contentElement.scrollTop = scrollAttr.scrollTop;}