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:
Vanessaa8e239574cff
diff --git a/app/src/emoji/index.ts b/app/src/emoji/index.tsindex 232fdf3daa..d072c83e30 100644--- a/app/src/emoji/index.ts+++ b/app/src/emoji/index.ts@@ -201,7 +201,7 @@ export const openEmojiPanel = (id: string, type: "doc" | "notebook" | "av", posiwindow.siyuan.menus.menu.removeScrollEvent();}- const dynamicURL = 'api/icon/getDynamicIcon?'+ const dynamicURL = "api/icon/getDynamicIcon?";const dialog = new Dialog({disableAnimation: true,transparent: true,@@ -555,35 +555,35 @@ ${unicode2Emoji(emoji.unicode)}</button>`;} else {avCB(unicode);}- break+ break;} else if (target.getAttribute("data-type")?.startsWith("tab-")) {dialogElement.querySelectorAll('.emojis__tabheader [data-type|="tab"]').forEach((item: HTMLElement) => {if (item.dataset.type === target.dataset.type) {- item.classList.add("block__icon--active")+ item.classList.add("block__icon--active");} else {- item.classList.remove("block__icon--active")+ item.classList.remove("block__icon--active");}- })- dialogElement.querySelectorAll('.emojis__tabbody > div').forEach((item: HTMLElement) => {+ });+ dialogElement.querySelectorAll(".emojis__tabbody > div").forEach((item: HTMLElement) => {if (item.dataset.type === target.dataset.type) {- item.classList.remove("fn__none")+ item.classList.remove("fn__none");} else {- item.classList.add("fn__none")+ item.classList.add("fn__none");}- })+ });window.siyuan.storage[Constants.LOCAL_EMOJIS].currentTab = target.dataset.type.replace("tab-", "");setStorageVal(Constants.LOCAL_EMOJIS, window.siyuan.storage[Constants.LOCAL_EMOJIS]);- break+ break;} else if (target.classList.contains("color__square")) {dynamicTextElements[0].value = target.getAttribute("style").replace("background-color:", "");dynamicTextElements[0].style.backgroundColor = dynamicTextElements[0].value;- dynamicTextElements[0].dispatchEvent(new CustomEvent("input"))+ dynamicTextElements[0].dispatchEvent(new CustomEvent("input"));break;}target = target.parentElement;}});- const dynamicLangElements: NodeListOf<HTMLSelectElement> = dialog.element.querySelectorAll('[data-type="tab-dynamic"] .b3-select')+ const dynamicLangElements: NodeListOf<HTMLSelectElement> = dialog.element.querySelectorAll('[data-type="tab-dynamic"] .b3-select');dynamicLangElements[0].addEventListener("change", () => {dialog.element.querySelectorAll(".fn__flex-wrap .emoji__dynamic-item").forEach(item => {const url = new URLSearchParams(item.getAttribute("src").replace(dynamicURL, ""));@@ -593,32 +593,32 @@ ${unicode2Emoji(emoji.unicode)}</button>`;url.delete("lang");}item.setAttribute("src", dynamicURL + url.toString());- })+ });});dynamicLangElements[1].addEventListener("change", () => {dialog.element.querySelectorAll(".fn__flex-wrap .emoji__dynamic-item").forEach(item => {const url = new URLSearchParams(item.getAttribute("src").replace(dynamicURL, ""));url.set("weekdayType", dynamicLangElements[1].value);item.setAttribute("src", dynamicURL + url.toString());- })+ });});- const dynamicDateElement = dialog.element.querySelector('[data-type="tab-dynamic"] [type="date"]') as HTMLInputElement+ const dynamicDateElement = dialog.element.querySelector('[data-type="tab-dynamic"] [type="date"]') as HTMLInputElement;dynamicDateElement.addEventListener("change", () => {dialog.element.querySelectorAll(".fn__flex-wrap .emoji__dynamic-item").forEach(item => {const url = new URLSearchParams(item.getAttribute("src").replace(dynamicURL, ""));url.set("date", dynamicDateElement.value ? dayjs(dynamicDateElement.value).format("YYYY-MM-DD") : "");item.setAttribute("src", dynamicURL + url.toString());- })+ });});- const dynamicTextElements: NodeListOf<HTMLInputElement> = dialog.element.querySelectorAll('[data-type="tab-dynamic"] [type="text"]')- const dynamicTextImgElement = dialog.element.querySelector('.emoji__dynamic-item[data-type="text"]')+ const dynamicTextElements: NodeListOf<HTMLInputElement> = dialog.element.querySelectorAll('[data-type="tab-dynamic"] [type="text"]');+ const dynamicTextImgElement = dialog.element.querySelector('.emoji__dynamic-item[data-type="text"]');dynamicTextElements[0].addEventListener("input", () => {dialog.element.querySelectorAll(".emoji__dynamic-item").forEach(item => {const url = new URLSearchParams(item.getAttribute("src").replace(dynamicURL, ""));url.set("color", dynamicTextElements[0].value);item.setAttribute("src", dynamicURL + url.toString());dynamicTextElements[0].style.backgroundColor = dynamicTextElements[0].value;- })+ });});dynamicTextElements[1].addEventListener("input", () => {const url = new URLSearchParams(dynamicTextImgElement.getAttribute("src").replace(dynamicURL, ""));diff --git a/app/src/protyle/render/av/render.ts b/app/src/protyle/render/av/render.tsindex 1a9f45f7ce..d0cd05cd20 100644--- a/app/src/protyle/render/av/render.ts+++ b/app/src/protyle/render/av/render.ts@@ -4,7 +4,7 @@ import {Constants} from "../../../constants";import {addDragFill, renderCell} from "./cell";import {unicode2Emoji} from "../../../emoji";import {focusBlock} from "../../util/selection";-import {hasClosestBlock, hasClosestByClassName, isInEmbedBlock} from "../../util/hasClosest";+import {hasClosestBlock, hasClosestByClassName} from "../../util/hasClosest";import {stickyRow, updateHeader} from "./row";import {getCalcValue} from "./calc";import {renderAVAttribute} from "./blockAttr";diff --git a/app/src/protyle/toolbar/Font.ts b/app/src/protyle/toolbar/Font.tsindex d4471239bf..52d4561a81 100644--- a/app/src/protyle/toolbar/Font.ts+++ b/app/src/protyle/toolbar/Font.ts@@ -223,12 +223,12 @@ export const fontEvent = (protyle: IProtyle, nodeElements: Element[], type?: stre.style.textShadow = "";e.style.backgroundColor = "";e.style.fontSize = "";- e.style.removeProperty("--b3-parent-background")+ e.style.removeProperty("--b3-parent-background");} else if (type === "style1") {const colorList = color.split(Constants.ZWSP);e.style.backgroundColor = colorList[0];e.style.color = colorList[1];- e.style.setProperty('--b3-parent-background', colorList[0]);+ e.style.setProperty("--b3-parent-background", colorList[0]);} else if (type === "style2") {e.style.webkitTextStroke = "0.2px var(--b3-theme-on-background)";e.style.webkitTextFillColor = "transparent";@@ -238,7 +238,7 @@ export const fontEvent = (protyle: IProtyle, nodeElements: Element[], type?: stre.style.color = color;} else if (type === "backgroundColor") {e.style.backgroundColor = color;- e.style.setProperty('--b3-parent-background', color);+ e.style.setProperty("--b3-parent-background", color);} else if (type === "fontSize") {e.style.fontSize = color;}diff --git a/app/src/protyle/toolbar/util.ts b/app/src/protyle/toolbar/util.tsindex 0df245c89f..840b85f085 100644--- a/app/src/protyle/toolbar/util.ts+++ b/app/src/protyle/toolbar/util.ts@@ -212,4 +212,4 @@ export const toolbarKeyToMenu = (toolbar: Array<string | IMenuItem>) => {toolbarResult.push(currentMenuItem);});return toolbarResult;-}+};diff --git a/app/src/protyle/util/compatibility.ts b/app/src/protyle/util/compatibility.tsindex e11871d61e..7d6ae41d97 100644--- a/app/src/protyle/util/compatibility.ts+++ b/app/src/protyle/util/compatibility.ts@@ -112,7 +112,7 @@ export const isHuawei = () => {export const isDisabledFeature = (feature: string): boolean => {return window.siyuan.config.system.disabledFeatures.indexOf(feature) > -1;-}+};export const isIPhone = () => {return navigator.userAgent.indexOf("iPhone") > -1;