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:
Vanessacb2560ffdaf2
diff --git a/app/src/constants.ts b/app/src/constants.tsindex d77617a285..c56e53b0a8 100644--- a/app/src/constants.ts+++ b/app/src/constants.ts@@ -732,7 +732,7 @@ export abstract class Constants {"tag","inline-math","inline-memo",- ]+ ];// Google Analytics 事件public static readonly ANALYTICS_EVT_ON_GET_CONFIG: string = "siyuan.onGetConfig";diff --git a/app/src/emoji/index.ts b/app/src/emoji/index.tsindex 0451bbdf36..d4a8c0658e 100644--- a/app/src/emoji/index.ts+++ b/app/src/emoji/index.ts@@ -201,7 +201,7 @@ const genWeekdayOptions = (lang: string, weekdayType: string) => {"3": ["Sunday", "星期日", "星期日"],"4": ["SUNDAY", "星期天", "星期天"],};- let currentLang = 0+ let currentLang = 0;if (lang === "") {lang = window.siyuan.config.lang;}@@ -213,8 +213,8 @@ const genWeekdayOptions = (lang: string, weekdayType: string) => {return `<option value="1" ${weekdayType === "1" ? " selected" : ""}>${dynamicWeekdayLang[1][currentLang]}</option><option value="2" ${weekdayType === "2" ? " selected" : ""}>${dynamicWeekdayLang[2][currentLang]}</option><option value="3" ${weekdayType === "3" ? " selected" : ""}>${dynamicWeekdayLang[3][currentLang]}</option>-<option value="4" ${weekdayType === "4" ? " selected" : ""}>${dynamicWeekdayLang[4][currentLang]}</option>`-}+<option value="4" ${weekdayType === "4" ? " selected" : ""}>${dynamicWeekdayLang[4][currentLang]}</option>`;+};export const openEmojiPanel = (id: string, type: "doc" | "notebook" | "av", position: IPosition, avCB?: (emoji: string) => void, dynamicImgElement?: HTMLElement) => {if (type !== "av") {@@ -235,7 +235,7 @@ export const openEmojiPanel = (id: string, type: "doc" | "notebook" | "av", posiif (dynamicImgElement && dynamicImgElement.getAttribute("src").startsWith(dynamicURL)) {const dynamicCurrentUrl = new URLSearchParams(dynamicImgElement.getAttribute("src").replace(dynamicURL, ""));dynamicCurrentObj.color = dynamicCurrentUrl.get("color") || "#d23f31";- if (!dynamicCurrentObj.color.startsWith('#')) {+ if (!dynamicCurrentObj.color.startsWith("#")) {dynamicCurrentObj.color = "#" + dynamicCurrentObj.color;}dynamicCurrentObj.lang = dynamicCurrentUrl.get("lang") || "";@@ -631,7 +631,7 @@ ${unicode2Emoji(emoji.unicode)}</button>`;url.delete("lang");}item.setAttribute("src", dynamicURL + url.toString());- dynamicLangElements[1].innerHTML = genWeekdayOptions(dynamicLangElements[0].value, dynamicLangElements[1].value)+ dynamicLangElements[1].innerHTML = genWeekdayOptions(dynamicLangElements[0].value, dynamicLangElements[1].value);});});dynamicLangElements[1].addEventListener("change", () => {diff --git a/app/src/menus/protyle.ts b/app/src/menus/protyle.tsindex 934b6ce3fc..f615db85a5 100644--- a/app/src/menus/protyle.ts+++ b/app/src/menus/protyle.ts@@ -1716,9 +1716,9 @@ export const tagMenu = (protyle: IProtyle, tagElement: HTMLElement) => {label: window.siyuan.languages.copy,icon: "iconCopy",click() {- const range = document.createRange()+ const range = document.createRange();range.selectNode(tagElement);- focusByRange(range)+ focusByRange(range);document.execCommand("copy");}}).element);@@ -1726,9 +1726,9 @@ export const tagMenu = (protyle: IProtyle, tagElement: HTMLElement) => {label: window.siyuan.languages.cut,icon: "iconCut",click() {- const range = document.createRange()+ const range = document.createRange();range.selectNode(tagElement);- focusByRange(range)+ focusByRange(range);document.execCommand("cut");}}).element);@@ -1780,9 +1780,9 @@ export const inlineMathMenu = (protyle: IProtyle, element: Element) => {label: window.siyuan.languages.copy,icon: "iconCopy",click() {- const range = document.createRange()+ const range = document.createRange();range.selectNode(element);- focusByRange(range)+ focusByRange(range);document.execCommand("copy");}}).element);@@ -1791,9 +1791,9 @@ export const inlineMathMenu = (protyle: IProtyle, element: Element) => {icon: "iconCut",label: window.siyuan.languages.cut,click() {- const range = document.createRange()+ const range = document.createRange();range.selectNode(element);- focusByRange(range)+ focusByRange(range);document.execCommand("cut");}}).element);diff --git a/app/src/protyle/render/av/cell.ts b/app/src/protyle/render/av/cell.tsindex 9922b90b93..11569311c6 100644--- a/app/src/protyle/render/av/cell.ts+++ b/app/src/protyle/render/av/cell.ts@@ -669,13 +669,13 @@ export const updateCellsValue = (protyle: IProtyle, nodeElement: HTMLElement, vaif (!item) {return;}- let hasSameContent = false+ let hasSameContent = false;oldValue.mSelect.find((mSelectItem) => {if (mSelectItem.content === item) {- hasSameContent = true- return true+ hasSameContent = true;+ return true;}- })+ });if (hasSameContent) {return;}@@ -683,8 +683,8 @@ export const updateCellsValue = (protyle: IProtyle, nodeElement: HTMLElement, vanewMSelectValue.push({content: item,color: colorIndex.toString()- })- })+ });+ });value = oldValue.mSelect.concat(newMSelectValue);}}diff --git a/app/src/protyle/util/Options.ts b/app/src/protyle/util/Options.tsindex ed5b838e6d..096d59e5b2 100644--- a/app/src/protyle/util/Options.ts+++ b/app/src/protyle/util/Options.ts@@ -1,7 +1,6 @@import {Constants} from "../../constants";import {merge} from "./merge";import {hintEmbed, hintRef, hintSlash, hintTag} from "../hint/extend";-import {isMobile} from "../../util/functions";import {toolbarKeyToMenu} from "../toolbar/util";export class Options {diff --git a/app/src/protyle/util/insertHTML.ts b/app/src/protyle/util/insertHTML.tsindex 2547204230..a531c4ccb3 100644--- a/app/src/protyle/util/insertHTML.ts+++ b/app/src/protyle/util/insertHTML.ts@@ -194,7 +194,7 @@ const processAV = (range: Range, html: string, protyle: IProtyle, blockElement:} else if (cellsElement.length > 0) {if (cellsElement.length > 1) {// 选择多个单元格时,逐行填充- let rowIndex = 0+ let rowIndex = 0;text.split("\n").find((row) => {if (!row) {return false;@@ -205,7 +205,7 @@ const processAV = (range: Range, html: string, protyle: IProtyle, blockElement:} else {return true;}- })+ });} else {updateCellsValue(protyle, blockElement as HTMLElement, text, cellsElement, columns, html);}