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:
Vanessae8359edebc88
diff --git a/app/src/layout/getAll.ts b/app/src/layout/getAll.tsindex 36fe6fd35f..2872d55378 100644--- a/app/src/layout/getAll.ts+++ b/app/src/layout/getAll.ts@@ -16,16 +16,16 @@ export const getAllEditor = () => {const models = getAllModels();const editors: Protyle[] = [];models.editor.forEach(item => {- editors.push(item.editor)- })+ editors.push(item.editor);+ });models.search.forEach(item => {- editors.push(item.edit)- })+ editors.push(item.edit);+ });models.custom.forEach(item => {if (item.data?.editor instanceof Protyle) {- editors.push(item.data.editor)+ editors.push(item.data.editor);}- })+ });models.backlink.forEach(item => {item.editors.forEach(editorItem => {editors.push(editorItem);@@ -33,12 +33,12 @@ export const getAllEditor = () => {});window.siyuan.dialogs.forEach(item => {if (item.editor) {- editors.push(item.editor)+ editors.push(item.editor);}});window.siyuan.blockPanels.forEach(item => {item.editors.forEach(editorItem => {- editors.push(editorItem)+ editors.push(editorItem);});});return editors;diff --git a/app/src/protyle/render/av/openMenuPanel.ts b/app/src/protyle/render/av/openMenuPanel.tsindex fc40d4a866..5d64dd4caa 100644--- a/app/src/protyle/render/av/openMenuPanel.ts+++ b/app/src/protyle/render/av/openMenuPanel.ts@@ -328,7 +328,7 @@ export const openMenuPanel = (options: {avPanelElement.remove();} else {// 优先关闭资源文件搜索- hideElements(["util"], options.protyle)+ hideElements(["util"], options.protyle);}window.siyuan.menus.menu.remove();event.preventDefault();@@ -680,7 +680,7 @@ export const openMenuPanel = (options: {event.stopPropagation();break;} else if (type === "addAssetExist") {- const rect = target.getBoundingClientRect()+ const rect = target.getBoundingClientRect();options.protyle.toolbar.showAssets(options.protyle, {x: rect.right, y: rect.bottom, w: target.parentElement.clientWidth + 8, h: rect.height}, (url) => {let value: IAVCellAssetValue;if (Constants.SIYUAN_ASSETS_IMAGE.includes(pathPosix().extname(url).toLowerCase())) {@@ -688,13 +688,13 @@ export const openMenuPanel = (options: {type: "image",content: url,name: ""- }+ };} else {value = {type: "file",content: url,name: pathPosix().basename(url).substring(0, Constants.SIZE_LINK_TEXT_MAX)- }+ };}updateAssetCell({protyle: options.protyle,diff --git a/app/src/protyle/toolbar/index.ts b/app/src/protyle/toolbar/index.tsindex 3abff76f3f..fbf66a9a69 100644--- a/app/src/protyle/toolbar/index.ts+++ b/app/src/protyle/toolbar/index.ts@@ -1577,9 +1577,9 @@ export class Toolbar {if (event.key === "Enter") {if (!isEmpty) {- const currentURL = this.subElement.querySelector(".b3-list-item--focus").getAttribute("data-value")+ const currentURL = this.subElement.querySelector(".b3-list-item--focus").getAttribute("data-value");if (avCB) {- avCB(currentURL)+ avCB(currentURL);} else {hintRenderAssets(currentURL, protyle);}@@ -1625,9 +1625,9 @@ export class Toolbar {const listItemElement = hasClosestByClassName(target, "b3-list-item");if (listItemElement) {event.stopPropagation();- const currentURL = listItemElement.getAttribute("data-value")+ const currentURL = listItemElement.getAttribute("data-value");if (avCB) {- avCB(currentURL)+ avCB(currentURL);} else {hintRenderAssets(currentURL, protyle);}diff --git a/app/src/protyle/wysiwyg/keydown.ts b/app/src/protyle/wysiwyg/keydown.tsindex ffffccb898..fde17c8a5a 100644--- a/app/src/protyle/wysiwyg/keydown.ts+++ b/app/src/protyle/wysiwyg/keydown.ts@@ -76,15 +76,15 @@ const getContentByInlineHTML = (range: Range, cb: (content: string) => void) =>let html = "";Array.from(range.cloneContents().childNodes).forEach((item: HTMLElement) => {if (item.nodeType === 3) {- html += item.textContent+ html += item.textContent;} else {- html += item.outerHTML+ html += item.outerHTML;}- })+ });fetchPost("/api/block/getDOMText", {dom: html}, (response) => {- cb(response.data)- })-}+ cb(response.data);+ });+};export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {editorElement.addEventListener("keydown", (event: KeyboardEvent & { target: HTMLElement }) => {