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:
Vanessa7cff7ce7046e
diff --git a/app/src/protyle/export/util.ts b/app/src/protyle/export/util.tsindex 1f5f4e085d..c3d2c02062 100644--- a/app/src/protyle/export/util.ts+++ b/app/src/protyle/export/util.ts@@ -65,12 +65,12 @@ export const exportImage = (id: string) => {setStorageVal(Constants.LOCAL_EXPORTIMG, window.siyuan.storage[Constants.LOCAL_EXPORTIMG]);setTimeout(() => {addScript("/stage/protyle/js/html-to-image.min.js?v=1.11.13", "protyleHtml2image").then(async () => {- let blob = await window.htmlToImage.toBlob(exportDialog.element.querySelector(".b3-dialog__content"))+ let blob = await window.htmlToImage.toBlob(exportDialog.element.querySelector(".b3-dialog__content"));if (isIPhone() || isSafari()) {- await window.htmlToImage.toBlob(exportDialog.element.querySelector(".b3-dialog__content"))- await window.htmlToImage.toBlob(exportDialog.element.querySelector(".b3-dialog__content"))- await window.htmlToImage.toBlob(exportDialog.element.querySelector(".b3-dialog__content"))- blob = await window.htmlToImage.toBlob(exportDialog.element.querySelector(".b3-dialog__content"))+ await window.htmlToImage.toBlob(exportDialog.element.querySelector(".b3-dialog__content"));+ await window.htmlToImage.toBlob(exportDialog.element.querySelector(".b3-dialog__content"));+ await window.htmlToImage.toBlob(exportDialog.element.querySelector(".b3-dialog__content"));+ blob = await window.htmlToImage.toBlob(exportDialog.element.querySelector(".b3-dialog__content"));}const formData = new FormData();formData.append("file", blob, btnsElement[1].getAttribute("data-title"));diff --git a/app/src/protyle/render/av/cell.ts b/app/src/protyle/render/av/cell.tsindex 73d26c71e1..d874f4dbd0 100644--- a/app/src/protyle/render/av/cell.ts+++ b/app/src/protyle/render/av/cell.ts@@ -79,7 +79,7 @@ export const genCellValueByElement = (colType: TAVCol, cellElement: HTMLElement)if (colType === "block" && textElement.dataset.id) {cellValue.block.id = textElement.dataset.id;if (textElement.previousElementSibling?.classList.contains("b3-menu__avemoji")) {- const unicode = textElement.previousElementSibling.getAttribute("data-unicode")+ const unicode = textElement.previousElementSibling.getAttribute("data-unicode");if (unicode) {cellValue.block.icon = unicode;}diff --git a/app/src/protyle/render/av/keydown.ts b/app/src/protyle/render/av/keydown.tsindex 1c22a55570..b33c9e02e3 100644--- a/app/src/protyle/render/av/keydown.ts+++ b/app/src/protyle/render/av/keydown.ts@@ -205,12 +205,12 @@ export const bindAVPanelKeydown = (event: KeyboardEvent) => {if (avPanelElement && window.siyuan.menus.menu.element.classList.contains("fn__none")) {if ((avPanelElement.querySelector('[data-type="goSearchRollupCol"]') && !avPanelElement.querySelector(".b3-text-field")) ||avPanelElement.querySelector('[data-type="addAssetExist"]')) {- const menuElement = avPanelElement.querySelector(".b3-menu__items")+ const menuElement = avPanelElement.querySelector(".b3-menu__items");if (event.key === "Enter") {const currentElement = menuElement.querySelector(".b3-menu__item--current");if (currentElement) {- const editElement = currentElement.querySelector('[data-type="editAssetItem"]')- const uploadElement = currentElement.querySelector(".b3-form__upload")+ const editElement = currentElement.querySelector('[data-type="editAssetItem"]');+ const uploadElement = currentElement.querySelector(".b3-form__upload");if (editElement) {avPanelElement.dispatchEvent(new CustomEvent("click", {detail: {@@ -219,7 +219,7 @@ export const bindAVPanelKeydown = (event: KeyboardEvent) => {}}));} else if (uploadElement) {- uploadElement.dispatchEvent(new MouseEvent('click', {bubbles: true}));+ uploadElement.dispatchEvent(new MouseEvent("click", {bubbles: true}));} else {avPanelElement.dispatchEvent(new CustomEvent("click", {detail: {@@ -232,10 +232,10 @@ export const bindAVPanelKeydown = (event: KeyboardEvent) => {} else if (event.key === "Escape") {avPanelElement.dispatchEvent(new CustomEvent("click", {detail: "close"}));} else {- upDownHint(menuElement, event, "b3-menu__item--current", menuElement.firstElementChild)+ upDownHint(menuElement, event, "b3-menu__item--current", menuElement.firstElementChild);}return true;}}return false;-}+};diff --git a/app/src/protyle/render/chartRender.ts b/app/src/protyle/render/chartRender.tsindex 3af86f82a9..e334901a8b 100644--- a/app/src/protyle/render/chartRender.ts+++ b/app/src/protyle/render/chartRender.ts@@ -32,7 +32,7 @@ export const chartRender = (element: Element, cdn = Constants.PROTYLE_CDN) => {}const renderElement = e.firstElementChild.nextElementSibling as HTMLElement;try {- const chartInstance = window.echarts.getInstanceById(renderElement.getAttribute("_echarts_instance_"))+ const chartInstance = window.echarts.getInstanceById(renderElement.getAttribute("_echarts_instance_"));const option = await looseJsonParse(Lute.UnEscapeHTMLStr(e.getAttribute("data-content")));if (chartInstance && chartInstance.getOption().series[0]?.type !== option.series[0]?.type) {chartInstance.clear();diff --git a/app/src/protyle/render/util.ts b/app/src/protyle/render/util.tsindex 3ef9ee470a..809ce20068 100644--- a/app/src/protyle/render/util.ts+++ b/app/src/protyle/render/util.ts@@ -31,7 +31,7 @@ export const genRenderFrame = (renderElement: Element) => {} else if (type==="NodeMathBlock") {renderElement.firstElementChild.innerHTML = `<span></span><span class="protyle-cursor">${Constants.ZWSP}</span>`;}-}+};export const processClonePHElement = (item: Element) => {if (item.getAttribute("data-type") === "NodeHTMLBlock") {diff --git a/app/src/protyle/util/selection.ts b/app/src/protyle/util/selection.tsindex 7d7fb09f16..8cae0b895e 100644--- a/app/src/protyle/util/selection.ts+++ b/app/src/protyle/util/selection.ts@@ -153,7 +153,7 @@ export const getEditorRange = (element: Element): Range => {}if (element.classList.contains("li") || element.classList.contains("list")) {- const childElement = element.querySelector("[data-node-id]")+ const childElement = element.querySelector("[data-node-id]");if (childElement) {return getEditorRange(childElement);}diff --git a/app/src/protyle/wysiwyg/transaction.ts b/app/src/protyle/wysiwyg/transaction.tsindex 6ac0efcc43..009b618e57 100644--- a/app/src/protyle/wysiwyg/transaction.ts+++ b/app/src/protyle/wysiwyg/transaction.ts@@ -457,15 +457,15 @@ export const onTransaction = (protyle: IProtyle, operation: IOperation, isUndo:if (operation.action === "update") {// 缩放后仅更新局部 https://github.com/siyuan-note/siyuan/issues/14326if (updateElements.length === 0) {- const newUpdateElement = protyle.wysiwyg.element.firstElementChild- const newUpdateId = newUpdateElement.getAttribute("data-node-id")+ const newUpdateElement = protyle.wysiwyg.element.firstElementChild;+ const newUpdateId = newUpdateElement.getAttribute("data-node-id");const tempElement = document.createElement("template");tempElement.innerHTML = operation.data;const newTempElement = tempElement.content.querySelector(`[data-node-id="${newUpdateId}"]`);if (newTempElement) {- updateElements.push(newUpdateElement)- operation.data = newTempElement.outerHTML- operation.id = newUpdateId+ updateElements.push(newUpdateElement);+ operation.data = newTempElement.outerHTML;+ operation.id = newUpdateId;}}if (updateElements.length > 0) {diff --git a/app/src/util/newFile.ts b/app/src/util/newFile.tsindex 5d4e0a33c6..843ccbaf89 100644--- a/app/src/util/newFile.ts+++ b/app/src/util/newFile.ts@@ -13,7 +13,6 @@ import {replaceFileName, validateName} from "../editor/rename";import {hideElements} from "../protyle/ui/hideElements";import {openMobileFileById} from "../mobile/editor";import {App} from "../index";-import {escapeHtml} from "./escape";export const getNewFilePath = (useSavePath: boolean) => {let notebookId = "";diff --git a/app/src/window/index.ts b/app/src/window/index.tsindex 9f935c3f6a..a506d154f4 100644--- a/app/src/window/index.ts+++ b/app/src/window/index.ts@@ -62,7 +62,7 @@ class App {break;case "reloadEmbedBlock":reloadEmbedBlock(data.data);- break+ break;case "reloadPlugin":reloadPlugin(this, data.data);break;