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:
Vanessa4406dc687bf5
diff --git a/app/src/card/openCard.ts b/app/src/card/openCard.tsindex acc42cb00c..0b98bcd42d 100644--- a/app/src/card/openCard.ts+++ b/app/src/card/openCard.ts@@ -12,7 +12,6 @@ import {MenuItem} from "../menus/Menu";import {escapeHtml} from "../util/escape";/// #if !MOBILEimport {openFile} from "../editor/util";-import {newCardModel} from "./newCardTab";/// #endifimport {getDisplayName, movePathTo} from "../util/pathName";import {App} from "../index";diff --git a/app/src/editor/util.ts b/app/src/editor/util.tsindex ad67a3dec3..0db465187c 100644--- a/app/src/editor/util.ts+++ b/app/src/editor/util.ts@@ -15,6 +15,7 @@ import {onGet} from "../protyle/util/onGet";/// #if !BROWSERimport {shell} from "electron";import {BrowserWindow, getCurrentWindow} from "@electron/remote";+import {newCardModel} from "../card/newCardTab";/// #endifimport {pushBack} from "../util/backForward";import {Asset} from "../asset";@@ -28,7 +29,6 @@ import {objEquals} from "../util/functions";import {resize} from "../protyle/util/resize";import {Search} from "../search";import {App} from "../index";-import {newCardModel} from "../card/newCardTab";export const openFileById = async (options: {app: App,@@ -444,7 +444,7 @@ const newTab = (options: IOpenFileOptions) => {}));return true;}- })+ });}} else {// plugin 0.8.3 历史兼容diff --git a/app/src/layout/dock/util.ts b/app/src/layout/dock/util.tsindex 25eb0d0a67..4cb2bfc316 100644--- a/app/src/layout/dock/util.ts+++ b/app/src/layout/dock/util.ts@@ -118,4 +118,4 @@ export const toggleDockBar = (useElement:Element)=> {});resizeTabs();resetFloatDockSize();-}+};diff --git a/app/src/layout/status.ts b/app/src/layout/status.tsindex df03ea8fb0..ac1dd1d9e8 100644--- a/app/src/layout/status.ts+++ b/app/src/layout/status.ts@@ -1,5 +1,5 @@/// #if !MOBILE-import {getDockByType, resizeTabs} from "./util";+import {getDockByType} from "./util";import {hasClosestByClassName} from "../protyle/util/hasClosest";import {fetchPost} from "../util/fetch";import {mountHelp} from "../util/mount";diff --git a/app/src/menus/Menu.ts b/app/src/menus/Menu.tsindex 3afe8a2989..c72e0509e4 100644--- a/app/src/menus/Menu.ts+++ b/app/src/menus/Menu.ts@@ -308,7 +308,7 @@ export const bindMenuKeydown = (event: KeyboardEvent) => {if (!currentElement) {return true;}- const parentItemElement = hasClosestByClassName(currentElement, "b3-menu__item--show")+ const parentItemElement = hasClosestByClassName(currentElement, "b3-menu__item--show");if (parentItemElement) {parentItemElement.classList.remove("b3-menu__item--show");parentItemElement.classList.add("b3-menu__item--current");diff --git a/app/src/plugin/index.ts b/app/src/plugin/index.tsindex 08ddc8264f..b289b5ac2c 100644--- a/app/src/plugin/index.ts+++ b/app/src/plugin/index.ts@@ -4,13 +4,13 @@ import {fetchPost} from "../util/fetch";import {isMobile, isWindow} from "../util/functions";/// #if !MOBILEimport {Custom} from "../layout/dock/Custom";+import {getAllModels} from "../layout/getAll";/// #endifimport {Tab} from "../layout/Tab";import {getDockByType, setPanelFocus} from "../layout/util";import {hasClosestByAttribute} from "../protyle/util/hasClosest";import {BlockPanel} from "../block/Panel";import {Setting} from "./Setting";-import {getAllModels} from "../layout/getAll";export class Plugin {private app: App;@@ -182,16 +182,18 @@ export class Plugin {}public getOpenedTab() {- const tabs: { [key: string]: Custom[] } = {}- const modelKeys = Object.keys(this.models)+ const tabs: { [key: string]: Custom[] } = {};+ const modelKeys = Object.keys(this.models);modelKeys.forEach(item => {- tabs[item.replace(this.name, "")] = []- })+ tabs[item.replace(this.name, "")] = [];+ });+ /// #if !MOBILEgetAllModels().custom.find(item => {if (modelKeys.includes(item.type)) {tabs[item.type.replace(this.name, "")].push(item);}- })+ });+ /// #endifreturn tabs;}diff --git a/app/src/protyle/util/compatibility.ts b/app/src/protyle/util/compatibility.tsindex 38be59ba7c..5ff3c40c2e 100644--- a/app/src/protyle/util/compatibility.ts+++ b/app/src/protyle/util/compatibility.ts@@ -159,8 +159,8 @@ export const getLocalStorage = (cb: () => void) => {k: "",};Constants.SIYUAN_ASSETS_SEARCH.forEach(type => {- defaultStorage[Constants.LOCAL_SEARCHASSET].types[type] = true- })+ defaultStorage[Constants.LOCAL_SEARCHASSET].types[type] = true;+ });defaultStorage[Constants.LOCAL_SEARCHKEYS] = {keys: [],replaceKeys: [],diff --git a/app/src/search/assets.ts b/app/src/search/assets.tsindex 1892d8ee04..c4be087f67 100644--- a/app/src/search/assets.ts+++ b/app/src/search/assets.ts@@ -407,7 +407,7 @@ export const assetMoreMenu = (target: Element, element: Element, cb: () => void)}window.siyuan.menus.menu.remove();window.siyuan.menus.menu.element.setAttribute("data-name", "searchAssetMore");- const localData = window.siyuan.storage[Constants.LOCAL_SEARCHASSET]+ const localData = window.siyuan.storage[Constants.LOCAL_SEARCHASSET];const sortMenu = [{iconHTML: Constants.ZWSP,label: window.siyuan.languages.sortByRankAsc,@@ -457,7 +457,7 @@ export const assetMoreMenu = (target: Element, element: Element, cb: () => void)current: localData.layout === 0,click() {element.querySelector(".search__layout").classList.remove("search__layout--row");- const previewElement = element.querySelector("#searchAssetPreview") as HTMLElement+ const previewElement = element.querySelector("#searchAssetPreview") as HTMLElement;previewElement.style.width = "";if (localData.row) {previewElement.style.height = localData.row;@@ -473,11 +473,11 @@ export const assetMoreMenu = (target: Element, element: Element, cb: () => void)label: window.siyuan.languages.leftRightLayout,current: localData.layout === 1,click() {- const previewElement = element.querySelector("#searchAssetPreview") as HTMLElement+ const previewElement = element.querySelector("#searchAssetPreview") as HTMLElement;element.querySelector(".search__layout").classList.add("search__layout--row");previewElement.style.height = "";if (localData.col) {- previewElement.style.width = localData.col+ previewElement.style.width = localData.col;previewElement.classList.remove("fn__flex-1");} else {previewElement.classList.add("fn__flex-1");@@ -493,10 +493,10 @@ export const assetMoreMenu = (target: Element, element: Element, cb: () => void)click() {element.nextElementSibling.classList.remove("fn__none");fetchPost("/api/asset/fullReindexAssetContent", {}, () => {- assetInputEvent(element, localData)+ assetInputEvent(element, localData);});},}).element);const rect = target.getBoundingClientRect();window.siyuan.menus.menu.popup({x: rect.right, y: rect.bottom}, true);-}+};diff --git a/app/src/search/util.ts b/app/src/search/util.tsindex 6f47259186..011bec46b2 100644--- a/app/src/search/util.ts+++ b/app/src/search/util.ts@@ -640,7 +640,7 @@ export const genSearch = (app: App, config: ISearchOption, element: Element, cloassetMoreMenu(target, assetsElement, () => {assetInputEvent(assetsElement);setStorageVal(Constants.LOCAL_SEARCHASSET, window.siyuan.storage[Constants.LOCAL_SEARCHASSET]);- })+ });event.stopPropagation();event.preventDefault();break;