An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:art: https://ld246.com/article/1715604432709
Vanessa5b17896a49d6
diff --git a/app/src/menus/protyle.ts b/app/src/menus/protyle.tsindex bd781c455d..1cacbfa30e 100644--- a/app/src/menus/protyle.ts+++ b/app/src/menus/protyle.ts@@ -1086,9 +1086,7 @@ export const imgMenu = (protyle: IProtyle, range: Range, assetElement: HTMLElemewindow.siyuan.menus.menu.append(new MenuItem({type: "separator"}).element);openMenu(protyle.app, imgSrc, false, false);}- /// #if !BROWSERwindow.siyuan.menus.menu.append(new MenuItem(exportAsset(imgElement.getAttribute("data-src"))).element);- /// #endifif (protyle?.app?.plugins) {emitOpenMenu({plugins: protyle.app.plugins,@@ -1220,11 +1218,9 @@ export const linkMenu = (protyle: IProtyle, linkElement: HTMLElement, focusText}if (linkAddress) {openMenu(protyle.app, linkAddress, false, true);- /// #if !BROWSERif (linkAddress?.startsWith("assets/")) {window.siyuan.menus.menu.append(new MenuItem(exportAsset(linkAddress)).element);}- /// #endif}if (!protyle.disabled) {if (linkAddress?.startsWith("assets/")) {@@ -1583,9 +1579,7 @@ export const videoMenu = (protyle: IProtyle, nodeElement: Element, type: string)submenu: openMenu(protyle.app, VideoSrc, true, false) as IMenu[]});}- /// #if !BROWSERsubMenus.push(exportAsset(src));- /// #endifreturn subMenus;};diff --git a/app/src/menus/util.ts b/app/src/menus/util.tsindex 23990b604f..5f082caebe 100644--- a/app/src/menus/util.ts+++ b/app/src/menus/util.ts@@ -9,15 +9,17 @@ import {Constants} from "../constants";import {openNewWindowById} from "../window/openNewWindow";import {MenuItem} from "./Menu";import {App} from "../index";-import {isInAndroid, updateHotkeyTip} from "../protyle/util/compatibility";+import {isInAndroid, openByMobile, updateHotkeyTip} from "../protyle/util/compatibility";import {checkFold} from "../util/noRelyPCFunction";export const exportAsset = (src: string) => {- /// #if !BROWSERreturn {label: window.siyuan.languages.export,icon: "iconUpload",async click() {+ /// #if BROWSER+ openByMobile(src);+ /// #elseconst result = await ipcRenderer.invoke(Constants.SIYUAN_GET, {cmd: "showSaveDialog",defaultPath: getAssetName(src) + pathPosix().extname(src),@@ -26,9 +28,9 @@ export const exportAsset = (src: string) => {if (!result.canceled) {fetchPost("/api/file/copyFile", {src, dest: result.filePath});}+ /// #endif}};- /// #endif};export const openEditorTab = (app: App, ids: string[], notebookId?: string, pathString?: string) => {diff --git a/app/src/protyle/render/av/asset.ts b/app/src/protyle/render/av/asset.tsindex a80f7d732a..7be73da842 100644--- a/app/src/protyle/render/av/asset.ts+++ b/app/src/protyle/render/av/asset.ts@@ -244,11 +244,9 @@ ${window.siyuan.languages.title}}});openMenu(protyle ? protyle.app : window.siyuan.ws.app, linkAddress, false, true);- /// #if !BROWSERif (linkAddress?.startsWith("assets/")) {window.siyuan.menus.menu.append(new MenuItem(exportAsset(linkAddress)).element);}- /// #endifconst rect = target.getBoundingClientRect();menu.open({x: rect.right,