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:
Vanessab8eec1bd3419
diff --git a/app/electron/main.js b/app/electron/main.jsindex ec8b160c55..13a504b37a 100644--- a/app/electron/main.js+++ b/app/electron/main.js@@ -602,13 +602,13 @@ app.commandLine.appendSwitch("force_high_performance_gpu"); // Force using discrwriteLog("app is packaged [" + app.isPackaged + "], command line args [" + process.argv.join(", ") + "]");let argStart = 1;if (!app.isPackaged) {- argStart = 2+ argStart = 2;}for (let i = argStart; i < process.argv.length; i++) {let arg = process.argv[i];if (arg.startsWith("--workspace=") || arg.startsWith("--port=") || arg.startsWith("siyuan://")) {// 跳过内置参数- continue+ continue;}app.commandLine.appendSwitch(arg);diff --git a/app/src/boot/globalEvent/event.ts b/app/src/boot/globalEvent/event.tsindex f0cd6884ee..93c77b246a 100644--- a/app/src/boot/globalEvent/event.ts+++ b/app/src/boot/globalEvent/event.ts@@ -78,7 +78,7 @@ export const initWindowEvent = (app: App) => {return;}// 触摸屏背景和嵌入块按钮显示- const backgroundElement = hasClosestByClassName(target, "protyle-background")+ const backgroundElement = hasClosestByClassName(target, "protyle-background");if (backgroundElement) {if (!globalTouchStart(event)) {backgroundElement.classList.toggle("protyle-background--mobileshow");diff --git a/app/src/boot/globalEvent/touch.ts b/app/src/boot/globalEvent/touch.tsindex 0b2099ec86..836b69b376 100644--- a/app/src/boot/globalEvent/touch.ts+++ b/app/src/boot/globalEvent/touch.ts@@ -15,7 +15,7 @@ import {hideTooltip} from "../../dialog/tooltip";export const globalTouchStart = (event: TouchEvent) => {// 文档背景位置调整const target = event.target as HTMLElement;- const backgroundElement = hasClosestByClassName(target, "protyle-background")+ const backgroundElement = hasClosestByClassName(target, "protyle-background");if (backgroundElement && target.tagName === "IMG" && backgroundElement.firstElementChild.querySelector(".protyle-icons").classList.contains("fn__none")) {const contentElement = hasClosestByClassName(target, "protyle-content", true);if (!contentElement) {@@ -45,7 +45,7 @@ export const globalTouchStart = (event: TouchEvent) => {return true;}return false;-}+};export const globalTouchEnd = (event: TouchEvent, yDiff: number, time: number, app: App) => {const target = event.target as HTMLElement;diff --git a/app/src/menus/protyle.ts b/app/src/menus/protyle.tsindex 3a968f9e88..04b1a02859 100644--- a/app/src/menus/protyle.ts+++ b/app/src/menus/protyle.ts@@ -657,7 +657,7 @@ export const contentMenu = (protyle: IProtyle, nodeElement: Element) => {}).element);} else {// https://github.com/siyuan-note/siyuan/issues/9630- const inlineElement = hasClosestByMatchTag(range.startContainer, "SPAN")+ const inlineElement = hasClosestByMatchTag(range.startContainer, "SPAN");if (inlineElement) {const inlineTypes = protyle.toolbar.getCurrentType(range);if (inlineTypes.includes("code") || inlineTypes.includes("kbd")) {diff --git a/app/src/menus/tab.ts b/app/src/menus/tab.tsindex 639bafec7a..77ee68184f 100644--- a/app/src/menus/tab.ts+++ b/app/src/menus/tab.ts@@ -238,4 +238,4 @@ const unsplitWnd = (target: Wnd | Layout, layout: Layout, onlyWnd: boolean) => {i--;}}-}+};diff --git a/app/src/protyle/header/Background.ts b/app/src/protyle/header/Background.tsindex 50742831a7..8b23c422ce 100644--- a/app/src/protyle/header/Background.ts+++ b/app/src/protyle/header/Background.ts@@ -1,5 +1,5 @@import {hasClosestByClassName} from "../util/hasClosest";-import {getRandom, isMobile, isTouchDevice} from "../../util/functions";+import {getRandom, isMobile} from "../../util/functions";import {hideElements} from "../ui/hideElements";import {uploadFiles} from "../upload";import {fetchPost} from "../../util/fetch";diff --git a/app/src/protyle/render/av/cell.ts b/app/src/protyle/render/av/cell.tsindex ff5ca7e8df..6c7908e174 100644--- a/app/src/protyle/render/av/cell.ts+++ b/app/src/protyle/render/av/cell.ts@@ -1,7 +1,6 @@import {transaction} from "../../wysiwyg/transaction";import {hasClosestBlock, hasClosestByClassName} from "../../util/hasClosest";import {openMenuPanel} from "./openMenuPanel";-import {Menu} from "../../../plugin/Menu";import {updateAttrViewCellAnimation} from "./action";import {isNotCtrl} from "../../util/compatibility";import {objEquals} from "../../../util/functions";@@ -300,13 +299,13 @@ const updateCellValue = (protyle: IProtyle, type: TAVCol, cellElements: HTMLEleminputValue.content = parseFloat(inputValue.content as string);inputValue.isNotEmpty = typeof inputValue.content === "number" && !isNaN(inputValue.content);} else if (type === "checkbox") {- const useElement = item.querySelector("use")- inputValue.checked = useElement.getAttribute("xlink:href") === "#iconUncheck"- oldValue.checked = !inputValue.checked- useElement.setAttribute("xlink:href", inputValue.checked ? "#iconCheck" : "#iconUncheck")+ const useElement = item.querySelector("use");+ inputValue.checked = useElement.getAttribute("xlink:href") === "#iconUncheck";+ oldValue.checked = !inputValue.checked;+ useElement.setAttribute("xlink:href", inputValue.checked ? "#iconCheck" : "#iconUncheck");} else {- inputValue.content = (avMaskElement.querySelector(".b3-text-field") as HTMLInputElement).value- oldValue.content = type === "block" ? item.firstElementChild.textContent.trim() : item.textContent.trim()+ inputValue.content = (avMaskElement.querySelector(".b3-text-field") as HTMLInputElement).value;+ oldValue.content = type === "block" ? item.firstElementChild.textContent.trim() : item.textContent.trim();}if (objEquals(inputValue, oldValue)) {return;diff --git a/app/src/protyle/ui/initUI.ts b/app/src/protyle/ui/initUI.tsindex 8fc4a9d013..67d3668a8a 100644--- a/app/src/protyle/ui/initUI.ts+++ b/app/src/protyle/ui/initUI.ts@@ -2,7 +2,6 @@ import {setEditMode} from "../util/setEditMode";import {scrollEvent} from "../scroll/event";import {isMobile} from "../../util/functions";import {Constants} from "../../constants";-import {hasClosestByAttribute, hasClosestByClassName} from "../util/hasClosest";import {isMac} from "../util/compatibility";import {setInlineStyle} from "../../util/assets";import {fetchPost} from "../../util/fetch";diff --git a/app/src/protyle/wysiwyg/enter.ts b/app/src/protyle/wysiwyg/enter.tsindex f800227ca2..530b49b707 100644--- a/app/src/protyle/wysiwyg/enter.ts+++ b/app/src/protyle/wysiwyg/enter.ts@@ -353,7 +353,7 @@ export const enter = (blockElement: HTMLElement, range: Range, protyle: IProtyleremoveEmptyNode(newElement);return true;}- const wbrElement = document.createElement("wbr")+ const wbrElement = document.createElement("wbr");range.insertNode(wbrElement);const html = blockElement.outerHTML;wbrElement.remove();diff --git a/app/src/protyle/wysiwyg/keydown.ts b/app/src/protyle/wysiwyg/keydown.tsindex 22d27358d1..fcbd09e44a 100644--- a/app/src/protyle/wysiwyg/keydown.ts+++ b/app/src/protyle/wysiwyg/keydown.ts@@ -861,7 +861,7 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {return;}// https://github.com/siyuan-note/siyuan/issues/9690- const inlineElement = hasClosestByMatchTag(range.startContainer, "SPAN")+ const inlineElement = hasClosestByMatchTag(range.startContainer, "SPAN");if (position.start === 2 && inlineElement &&getSelectionOffset(inlineElement, protyle.wysiwyg.element, range).start === 1 &&inlineElement.textContent.startsWith(Constants.ZWSP)) {