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:
Vanessab1c3f64b8045
diff --git a/app/src/protyle/wysiwyg/keydown.ts b/app/src/protyle/wysiwyg/keydown.tsindex 6b3cae8666..6c4ddf437c 100644--- a/app/src/protyle/wysiwyg/keydown.ts+++ b/app/src/protyle/wysiwyg/keydown.ts@@ -38,7 +38,7 @@ import {fontEvent} from "../toolbar/Font";import {listIndent, listOutdent} from "./list";import {newFileContentBySelect, rename, replaceFileName} from "../../editor/rename";import {insertEmptyBlock, jumpToParentNext} from "../../block/util";-import {getDisplayName, isLocalPath, pathPosix} from "../../util/pathName";+import {isLocalPath, pathPosix} from "../../util/pathName";/// #if !MOBILEimport {openBy, openFileById} from "../../editor/util";/// #endif@@ -1058,7 +1058,7 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {markdown: ""}, response => {insertHTML(`<span data-type="block-ref" data-id="${response.data}" data-subtype="d">${escapeHtml(newFileName.substring(0, window.siyuan.config.editor.blockRefDynamicAnchorTextMaxLen))}</span>`, protyle);- hideElements(["toolbar"], protyle)+ hideElements(["toolbar"], protyle);});});}@@ -1082,7 +1082,7 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {markdown: ""}, response => {insertHTML(`<span data-type="block-ref" data-id="${response.data}" data-subtype="d">${escapeHtml(newFileName.substring(0, window.siyuan.config.editor.blockRefDynamicAnchorTextMaxLen))}</span>`, protyle);- hideElements(["toolbar"], protyle)+ hideElements(["toolbar"], protyle);});});}diff --git a/app/src/search/util.ts b/app/src/search/util.tsindex e6aecba4c0..49f3a20a7f 100644--- a/app/src/search/util.ts+++ b/app/src/search/util.ts@@ -21,13 +21,13 @@ import {hasClosestByClassName} from "../protyle/util/hasClosest";const saveKeyList = (type: "keys" | "replaceKeys", value: string) => {const searchKeys = JSON.parse(localStorage.getItem(Constants.LOCAL_SEARCHEKEYS) || "{}");- let list: string[] = searchKeys[type] || []+ let list: string[] = searchKeys[type] || [];list.splice(0, 0, value);list = Array.from(new Set(list));if (list.length > window.siyuan.config.search.limit) {list.splice(window.siyuan.config.search.limit, list.length - window.siyuan.config.search.limit);}- searchKeys[type] = list+ searchKeys[type] = list;localStorage.setItem(Constants.LOCAL_SEARCHEKEYS, JSON.stringify(searchKeys));};@@ -352,7 +352,7 @@ export const genSearch = (config: ISearchOption, element: Element, closeCB?: ()event.preventDefault();break;} else if (target.id === "searchHistoryBtn") {- const list = JSON.parse(localStorage.getItem(Constants.LOCAL_SEARCHEKEYS)||"{}")+ const list = JSON.parse(localStorage.getItem(Constants.LOCAL_SEARCHEKEYS)||"{}");if (!list.keys || list.keys.length === 0) {return;}@@ -372,7 +372,7 @@ export const genSearch = (config: ISearchOption, element: Element, closeCB?: ()event.preventDefault();return;} else if (target.id === "replaceHistoryBtn") {- const list = JSON.parse(localStorage.getItem(Constants.LOCAL_SEARCHEKEYS)||"{}")+ const list = JSON.parse(localStorage.getItem(Constants.LOCAL_SEARCHEKEYS)||"{}");if (!list.replaceKeys || list.replaceKeys.length === 0) {return;}@@ -477,7 +477,7 @@ export const genSearch = (config: ISearchOption, element: Element, closeCB?: ()inputTimeout = inputEvent(element, config, inputTimeout, edit, event);});searchInputElement.addEventListener("blur", () => {- saveKeyList("keys", searchInputElement.value)+ saveKeyList("keys", searchInputElement.value);});searchInputElement.addEventListener("keydown", (event: KeyboardEvent) => {let currentList: HTMLElement = searchPanelElement.querySelector(".b3-list-item--focus");@@ -985,7 +985,7 @@ const replace = (element: Element, config: ISearchOption, edit: Protyle, isAll:if (!loadElement.classList.contains("fn__none")) {return;}- saveKeyList("replaceKeys", replaceInputElement.value)+ saveKeyList("replaceKeys", replaceInputElement.value);let currentList: HTMLElement = searchPanelElement.querySelector(".b3-list-item--focus");if (!currentList) {return;diff --git a/app/src/util/globalShortcut.ts b/app/src/util/globalShortcut.tsindex f4f52f0da9..5a12100774 100644--- a/app/src/util/globalShortcut.ts+++ b/app/src/util/globalShortcut.ts@@ -1320,7 +1320,7 @@ const panelTreeKeydown = (event: KeyboardEvent) => {tree = (model as Backlink).mTree;}if (!tree) {- return false+ return false;}if (event.key === "Enter") {tree.click(activeItemElement);