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:
Vanessa30cb2390ae55
diff --git a/app/src/boot/onGetConfig.ts b/app/src/boot/onGetConfig.tsindex 6e6365a6d3..0721aa883a 100644--- a/app/src/boot/onGetConfig.ts+++ b/app/src/boot/onGetConfig.ts@@ -180,7 +180,7 @@ export const initWindow = () => {const winOnBlur = () => {document.body.classList.add("body--blur");- }+ };const winOnClose = (currentWindow: Electron.BrowserWindow, close = false) => {exportLayout(false, () => {@@ -224,7 +224,7 @@ export const initWindow = () => {} else {document.getElementById("toolbar").style.paddingLeft = "0";}- }+ };const winOnLeaveFullscreen = () => {if (isWindow()) {@@ -232,7 +232,7 @@ export const initWindow = () => {} else {document.getElementById("toolbar").setAttribute("style", "");}- }+ };const currentWindow = getCurrentWindow();currentWindow.on("focus", winOnFocus);diff --git a/app/src/protyle/wysiwyg/input.ts b/app/src/protyle/wysiwyg/input.tsindex 878a1ccdd9..6ebec9717e 100644--- a/app/src/protyle/wysiwyg/input.ts+++ b/app/src/protyle/wysiwyg/input.ts@@ -205,10 +205,10 @@ export const input = async (protyle: IProtyle, blockElement: HTMLElement, range:protyle.hint.render(protyle);}hideElements(["gutter"], protyle);- updateInput(html, protyle, id, type);+ updateInput(html, protyle, id);};-const updateInput = (html: string, protyle: IProtyle, id: string, type: string) => {+const updateInput = (html: string, protyle: IProtyle, id: string) => {const tempElement = document.createElement("template");tempElement.innerHTML = html;const doOperations: IOperation[] = [];diff --git a/app/src/protyle/wysiwyg/turnIntoList.ts b/app/src/protyle/wysiwyg/turnIntoList.tsindex a015f9309d..8c4010cf15 100644--- a/app/src/protyle/wysiwyg/turnIntoList.ts+++ b/app/src/protyle/wysiwyg/turnIntoList.ts@@ -26,15 +26,15 @@ export const turnIntoTaskList = (protyle: IProtyle, type: string, blockElement:if (isDone) {blockElement.parentElement.classList.add("protyle-task--done");}- blockElement.previousElementSibling.outerHTML = `<div class="protyle-action protyle-action--task" draggable="true"><svg><use xlink:href="#icon${isDone ? "C" : "Unc"}heck"></use></svg></div>`+ blockElement.previousElementSibling.outerHTML = `<div class="protyle-action protyle-action--task" draggable="true"><svg><use xlink:href="#icon${isDone ? "C" : "Unc"}heck"></use></svg></div>`;editElement.innerHTML = editElement.innerHTML.substring(contextStartIndex);updateTransaction(protyle, liElement.getAttribute("data-node-id"), liElement.outerHTML, oldHTML);- focusByWbr(protyle.wysiwyg.element, range)+ focusByWbr(protyle.wysiwyg.element, range);return true;}return false;} else {- const id = blockElement.getAttribute("data-node-id")+ const id = blockElement.getAttribute("data-node-id");const newId = Lute.NewNodeID();const emptyId = Lute.NewNodeID();const liItemId = Lute.NewNodeID();@@ -68,18 +68,18 @@ export const turnIntoTaskList = (protyle: IProtyle, type: string, blockElement:action: "delete",id: newId}]);- blockElement.outerHTML = `<div data-subtype="t" data-node-id="${newId}" data-type="NodeList" class="list" updated="${newId.split("-")[0]}"><div data-marker="*" data-subtype="t" data-node-id="${liItemId}" data-type="NodeListItem" class="li${isDone ? " protyle-task--done" : ""}" updated="${liItemId.split("-")[0]}"><div class="protyle-action protyle-action--task" draggable="true"><svg><use xlink:href="#icon${isDone ? "C" : "Unc"}heck"></use></svg></div>${blockElement.outerHTML}<div class="protyle-attr" contenteditable="false"></div></div><div class="protyle-attr" contenteditable="false"></div></div>`- focusByWbr(protyle.wysiwyg.element, range)+ blockElement.outerHTML = `<div data-subtype="t" data-node-id="${newId}" data-type="NodeList" class="list" updated="${newId.split("-")[0]}"><div data-marker="*" data-subtype="t" data-node-id="${liItemId}" data-type="NodeListItem" class="li${isDone ? " protyle-task--done" : ""}" updated="${liItemId.split("-")[0]}"><div class="protyle-action protyle-action--task" draggable="true"><svg><use xlink:href="#icon${isDone ? "C" : "Unc"}heck"></use></svg></div>${blockElement.outerHTML}<div class="protyle-attr" contenteditable="false"></div></div><div class="protyle-attr" contenteditable="false"></div></div>`;+ focusByWbr(protyle.wysiwyg.element, range);return true;}}- return false-}+ return false;+};export const headingTurnIntoList = (protyle: IProtyle, type: string, blockElement: HTMLElement, editElement: HTMLElement, range: Range) => {if (type === "NodeHeading" && ["* ", "- "].includes(editElement.innerHTML.substring(0, 2)) &&blockElement.parentElement.getAttribute("data-type") !== "NodeListItem") {- const id = blockElement.getAttribute("data-node-id")+ const id = blockElement.getAttribute("data-node-id");const newId = Lute.NewNodeID();const emptyId = Lute.NewNodeID();const liItemId = Lute.NewNodeID();@@ -113,9 +113,9 @@ export const headingTurnIntoList = (protyle: IProtyle, type: string, blockElemenaction: "delete",id: newId}]);- blockElement.outerHTML = `<div data-subtype="u" data-node-id="${newId}" data-type="NodeList" class="list" updated="${newId.split("-")[0]}"><div data-marker="${editElement.innerHTML.substring(0, 1)}" data-subtype="u" data-node-id="${liItemId}" data-type="NodeListItem" class="li" updated="${liItemId.split("-")[0]}"><div class="protyle-action" draggable="true"><svg><use xlink:href="#iconDot"></use></svg></div>${blockElement.outerHTML}<div class="protyle-attr" contenteditable="false"></div></div><div class="protyle-attr" contenteditable="false"></div></div>`- focusByWbr(protyle.wysiwyg.element, range)- return true+ blockElement.outerHTML = `<div data-subtype="u" data-node-id="${newId}" data-type="NodeList" class="list" updated="${newId.split("-")[0]}"><div data-marker="${editElement.innerHTML.substring(0, 1)}" data-subtype="u" data-node-id="${liItemId}" data-type="NodeListItem" class="li" updated="${liItemId.split("-")[0]}"><div class="protyle-action" draggable="true"><svg><use xlink:href="#iconDot"></use></svg></div>${blockElement.outerHTML}<div class="protyle-attr" contenteditable="false"></div></div><div class="protyle-attr" contenteditable="false"></div></div>`;+ focusByWbr(protyle.wysiwyg.element, range);+ return true;}- return false-}+ return false;+};