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:
Vanessada24409e9683
diff --git a/app/src/card/newCardTab.ts b/app/src/card/newCardTab.tsindex 246ee75058..1ee21a27f3 100644--- a/app/src/card/newCardTab.ts+++ b/app/src/card/newCardTab.ts@@ -66,5 +66,5 @@ export const newCardModel = (options: {});}});- return custom-}+ return custom;+};diff --git a/app/src/card/openCard.ts b/app/src/card/openCard.tsindex 1270708e9d..53d7f17534 100644--- a/app/src/card/openCard.ts+++ b/app/src/card/openCard.ts@@ -21,7 +21,7 @@ export const genCardHTML = (options: {blocks: ICard[],isTab: boolean}) => {- let iconsHTML:string+ let iconsHTML:string;/// #if MOBILEiconsHTML=`<div class="toolbar toolbar--border"><svg class="toolbar__icon"><use xlink:href="#iconRiffCard"></use></svg>diff --git a/app/src/editor/util.ts b/app/src/editor/util.tsindex f981970f10..9e8840fa92 100644--- a/app/src/editor/util.ts+++ b/app/src/editor/util.ts@@ -1,7 +1,7 @@import {Tab} from "../layout/Tab";import {Editor} from "./index";import {Wnd} from "../layout/Wnd";-import {getDockByType, getInstanceById, getWndByLayout, pdfIsLoading, resizeTabs, setPanelFocus} from "../layout/util";+import {getDockByType, getInstanceById, getWndByLayout, pdfIsLoading, setPanelFocus} from "../layout/util";import {getAllModels, getAllTabs} from "../layout/getAll";import {highlightById, scrollCenter} from "../util/highlightById";import {getDisplayName, pathPosix} from "../util/pathName";diff --git a/app/src/layout/util.ts b/app/src/layout/util.tsindex 1831ce13c4..453c946cbc 100644--- a/app/src/layout/util.ts+++ b/app/src/layout/util.ts@@ -35,7 +35,7 @@ import {getIdZoomInByPath} from "../util/pathName";import {openHistory} from "../history/history";import {Custom} from "./dock/Custom";import {newCardModel} from "../card/newCardTab";-import {openRecentDocs} from "../business/openRecentDocs";+import { openRecentDocs } from "../business/openRecentDocs";export const setPanelFocus = (element: Element) => {if (element.classList.contains("layout__tab--active") || element.classList.contains("layout__wnd--active")) {@@ -799,6 +799,8 @@ export const newCenterEmptyTab = () => {</div><div class="b3-label__text">${window.siyuan.languages.slogan}</div></div>+ <h1>${window.siyuan.languages.noOpenFile}</h1>+ <div class="fn__hr"></div><div class="fn__hr"></div><div class="b3-list-item" id="editorEmptySearch"><svg class="b3-list-item__graphic"><use xlink:href="#iconSearch"></use></svg>@@ -836,7 +838,7 @@ export const newCenterEmptyTab = () => {if (target.id === "editorEmptySearch") {openSearch(window.siyuan.config.keymap.general.globalSearch.custom);event.stopPropagation();- event.preventDefault()+ event.preventDefault();break;} else if (target.id === "editorEmptyRecent") {const openRecentDocsDialog = window.siyuan.dialogs.find(item => {@@ -850,32 +852,32 @@ export const newCenterEmptyTab = () => {}openRecentDocs();event.stopPropagation();- event.preventDefault()+ event.preventDefault();break;}else if (target.id === "editorEmptyHistory") {openHistory();event.stopPropagation();- event.preventDefault()+ event.preventDefault();break;}else if (target.id === "editorEmptyFile") {newFile(undefined, undefined, undefined, true);event.stopPropagation();- event.preventDefault()+ event.preventDefault();break;}else if (target.id === "editorEmptyNewNotebook") {newNotebook();event.stopPropagation();- event.preventDefault()+ event.preventDefault();break;}else if (target.id === "editorEmptyHelp") {- mountHelp()+ mountHelp();event.stopPropagation();- event.preventDefault()+ event.preventDefault();break;}- target = target.parentElement+ target = target.parentElement;}- })+ });}});};diff --git a/app/src/mobile/util/setEmpty.ts b/app/src/mobile/util/setEmpty.tsindex 7fa95fb2f9..d96c4ee5e7 100644--- a/app/src/mobile/util/setEmpty.ts+++ b/app/src/mobile/util/setEmpty.ts@@ -14,7 +14,8 @@ export const setEmpty = () => {if (emptyElement.innerHTML !== "") {return;}- emptyElement.innerHTML = `+ emptyElement.innerHTML = `<h1 style="width: 200px">${window.siyuan.languages.noOpenFile}</h1>+<div class="fn__hr--b"></div><div id="emptySearch" class="b3-list-item"><svg class="b3-list-item__graphic"><use xlink:href="#iconSearch"></use></svg><span class="b3-list-item__text">${window.siyuan.languages.search}</span></div>@@ -39,17 +40,17 @@ export const setEmpty = () => {if (target.id === "emptySearch") {popSearch();event.stopPropagation();- event.preventDefault()+ event.preventDefault();break;} else if (target.id === "emptyRecent") {getRecentDocs();event.stopPropagation();- event.preventDefault()+ event.preventDefault();break;} else if (target.id === "emptyHistory") {openHistory();event.stopPropagation();- event.preventDefault()+ event.preventDefault();break;} else if (target.id === "emptyNewFile") {if (window.siyuan.mobile.editor) {@@ -63,17 +64,17 @@ export const setEmpty = () => {});}event.stopPropagation();- event.preventDefault()+ event.preventDefault();break;} else if (target.id === "emptyNewNotebook") {newNotebook();event.stopPropagation();- event.preventDefault()+ event.preventDefault();break;} else if (target.id === "emptyHelp") {mountHelp();event.stopPropagation();- event.preventDefault()+ event.preventDefault();break;}target = target.parentElement;diff --git a/app/src/protyle/hint/extend.ts b/app/src/protyle/hint/extend.tsindex 661d59f8c4..6b0a345d23 100644--- a/app/src/protyle/hint/extend.ts+++ b/app/src/protyle/hint/extend.ts@@ -36,7 +36,7 @@ export const hintSlash = (key: string, protyle: IProtyle) => {}, {filter: ["引用块", "yinyong", "yy", "block reference"],value: "((",- html: `<div class="b3-list-item__first"><svg class="b3-list-item__graphic"><use xlink:href="#iconRef"></use></svg><span class="b3-list-item__text">${window.siyuan.languages.ref}</span><span class="b3-list-item__meta">((</span></div>`,+ html: `<div class="b3-list-item__first"><svg class="b3-list-item__graphic"><use xlink:href="#iconRef"></use></svg><span class="b3-list-item__text">${window.siyuan.languages.blockRef}</span><span class="b3-list-item__meta">((</span></div>`,}, {filter: ["嵌入块", "qianrukuai", "qrk", "embed block"],value: "{{",@@ -323,7 +323,7 @@ export const hintRef = (key: string, protyle: IProtyle, isQuick = false): IHintDlet iconHTML;if (item.type === "NodeDocument" && item.ial.icon){iconHTML = unicode2Emoji(item.ial.icon, false, "b3-list-item__graphic popover__block", true);- iconHTML = iconHTML.replace('popover__block"', `popover__block" data-id="${item.id}"`)+ iconHTML = iconHTML.replace('popover__block"', `popover__block" data-id="${item.id}"`);} else {iconHTML = `<svg class="b3-list-item__graphic popover__block" data-id="${item.id}"><use xlink:href="#${getIconByType(item.type)}"></use></svg>`;}@@ -387,7 +387,7 @@ export const hintEmbed = (key: string, protyle: IProtyle): IHintData[] => {let iconHTML;if (item.type === "NodeDocument" && item.ial.icon){iconHTML = unicode2Emoji(item.ial.icon, false, "b3-list-item__graphic popover__block", true);- iconHTML = iconHTML.replace('popover__block"', `popover__block" data-id="${item.id}"`)+ iconHTML = iconHTML.replace('popover__block"', `popover__block" data-id="${item.id}"`);} else {iconHTML = `<svg class="b3-list-item__graphic popover__block" data-id="${item.id}"><use xlink:href="#${getIconByType(item.type)}"></use></svg>`;}diff --git a/app/src/protyle/hint/index.ts b/app/src/protyle/hint/index.tsindex e8efff8e78..06eff5de71 100644--- a/app/src/protyle/hint/index.ts+++ b/app/src/protyle/hint/index.ts@@ -340,7 +340,7 @@ ${unicode2Emoji(emoji.unicode, true)}</button>`;let iconHTML;if (item.type === "NodeDocument" && item.ial.icon) {iconHTML = unicode2Emoji(item.ial.icon, false, "b3-list-item__graphic popover__block", true);- iconHTML = iconHTML.replace('popover__block"', `popover__block" data-id="${item.id}"`)+ iconHTML = iconHTML.replace('popover__block"', `popover__block" data-id="${item.id}"`);} else {iconHTML = `<svg class="b3-list-item__graphic popover__block" data-id="${item.id}"><use xlink:href="#${getIconByType(item.type)}"></use></svg>`;}diff --git a/app/src/util/functions.ts b/app/src/util/functions.tsindex 158a83886e..3e5c6a4408 100644--- a/app/src/util/functions.ts+++ b/app/src/util/functions.ts@@ -50,7 +50,7 @@ export const looseJsonParse = (text: string) => {export const objEquals = (a: any, b: any): boolean => {if (a === b) return true;if (a instanceof Date && b instanceof Date) return a.getTime() === b.getTime();- if (!a || !b || (typeof a !== 'object' && typeof b !== 'object')) return a === b;+ if (!a || !b || (typeof a !== "object" && typeof b !== "object")) return a === b;if (a.prototype !== b.prototype) return false;const keys = Object.keys(a);if (keys.length !== Object.keys(b).length) return false;