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:
Vanessab1bb3f1fa64d
diff --git a/app/src/config/util/snippets.ts b/app/src/config/util/snippets.tsindex 4caea26ca7..248dcb6c8d 100644--- a/app/src/config/util/snippets.ts+++ b/app/src/config/util/snippets.ts@@ -1,5 +1,4 @@import {fetchPost} from "../../util/fetch";-import {hasClosestByClassName} from "../../protyle/util/hasClosest";import {Dialog} from "../../dialog";import {objEquals} from "../../util/functions";import {confirmDialog} from "../../dialog/confirmDialog";diff --git a/app/src/menus/protyle.ts b/app/src/menus/protyle.tsindex 66b4955d48..61dfe9edc0 100644--- a/app/src/menus/protyle.ts+++ b/app/src/menus/protyle.ts@@ -583,7 +583,7 @@ export const refMenu = (protyle: IProtyle, element: HTMLElement) => {y: rect.top + 26,h: 26});- window.siyuan.menus.menu.element.setAttribute("data-from", hasClosestByClassName(protyle.element, "block__edit") ? "popover" : "app")+ window.siyuan.menus.menu.element.setAttribute("data-from", hasClosestByClassName(protyle.element, "block__edit") ? "popover" : "app");if (!protyle.disabled) {window.siyuan.menus.menu.element.querySelector("input").select();window.siyuan.menus.menu.removeCB = () => {@@ -1063,7 +1063,7 @@ export const imgMenu = (protyle: IProtyle, range: Range, assetElement: HTMLEleme}window.siyuan.menus.menu.popup({x: position.clientX, y: position.clientY});- window.siyuan.menus.menu.element.setAttribute("data-from", hasClosestByClassName(protyle.element, "block__edit") ? "popover" : "app")+ window.siyuan.menus.menu.element.setAttribute("data-from", hasClosestByClassName(protyle.element, "block__edit") ? "popover" : "app");if (!protyle.disabled) {const textElements = window.siyuan.menus.menu.element.querySelectorAll("textarea");textElements[0].focus();@@ -1250,7 +1250,7 @@ export const linkMenu = (protyle: IProtyle, linkElement: HTMLElement, focusTexty: rect.top + 26,h: 26});- window.siyuan.menus.menu.element.setAttribute("data-from", hasClosestByClassName(protyle.element, "block__edit") ? "popover" : "app")+ window.siyuan.menus.menu.element.setAttribute("data-from", hasClosestByClassName(protyle.element, "block__edit") ? "popover" : "app");const textElements = window.siyuan.menus.menu.element.querySelectorAll("textarea");if (focusText || protyle.lute.IsValidLinkDest(linkAddress)) {textElements[1].select();@@ -1387,7 +1387,7 @@ export const tagMenu = (protyle: IProtyle, tagElement: HTMLElement) => {y: rect.top + 26,h: 26});- window.siyuan.menus.menu.element.setAttribute("data-from", hasClosestByClassName(protyle.element, "block__edit") ? "popover" : "app")+ window.siyuan.menus.menu.element.setAttribute("data-from", hasClosestByClassName(protyle.element, "block__edit") ? "popover" : "app");window.siyuan.menus.menu.element.querySelector("input").select();};diff --git a/app/src/protyle/gutter/index.ts b/app/src/protyle/gutter/index.tsindex 43ad05d231..6719a1ab87 100644--- a/app/src/protyle/gutter/index.ts+++ b/app/src/protyle/gutter/index.ts@@ -247,7 +247,7 @@ export class Gutter {window.siyuan.menus.menu.fullscreen();} else {window.siyuan.menus.menu.popup({x: event.clientX - 16, y: event.clientY - 16, isLeft: true});- window.siyuan.menus.menu.element.setAttribute("data-from", hasClosestByClassName(protyle.element, "block__edit") ? "popover" : "app")+ window.siyuan.menus.menu.element.setAttribute("data-from", hasClosestByClassName(protyle.element, "block__edit") ? "popover" : "app");focusByRange(protyle.toolbar.range);}}@@ -260,7 +260,7 @@ export class Gutter {if (!window.siyuan.ctrlIsPressed && !window.siyuan.altIsPressed && !window.siyuan.shiftIsPressed) {this.renderMenu(protyle, buttonElement);window.siyuan.menus.menu.popup({x: event.clientX - 16, y: event.clientY - 16, isLeft: true});- window.siyuan.menus.menu.element.setAttribute("data-from", hasClosestByClassName(protyle.element, "block__edit") ? "popover" : "app")+ window.siyuan.menus.menu.element.setAttribute("data-from", hasClosestByClassName(protyle.element, "block__edit") ? "popover" : "app");}event.preventDefault();event.stopPropagation();diff --git a/app/src/protyle/render/av/cell.ts b/app/src/protyle/render/av/cell.tsindex 1b3b8da27d..75c946c992 100644--- a/app/src/protyle/render/av/cell.ts+++ b/app/src/protyle/render/av/cell.ts@@ -589,7 +589,7 @@ export const renderCell = (cellValue: IAVCellValue, wrap: boolean) => {text += `<span ${cellValue.type !== "number" ? "" : 'style="right:auto;left:5px"'} data-type="copy" class="block__icon"><svg><use xlink:href="#iconCopy"></use></svg></span>`;}return text;-}+};export const updateHeaderCell = (cellElement: HTMLElement, headerValue: {icon?: string,@@ -598,16 +598,16 @@ export const updateHeaderCell = (cellElement: HTMLElement, headerValue: {}) => {if (typeof headerValue.icon !== "undefined") {cellElement.dataset.icon = headerValue.icon;- cellElement.querySelector(".av__cellheadericon").outerHTML = headerValue.icon ? unicode2Emoji(headerValue.icon, "av__cellheadericon", true) : `<svg class="av__cellheadericon"><use xlink:href="#${getColIconByType(cellElement.dataset.dtype as TAVCol)}"></use></svg>`+ cellElement.querySelector(".av__cellheadericon").outerHTML = headerValue.icon ? unicode2Emoji(headerValue.icon, "av__cellheadericon", true) : `<svg class="av__cellheadericon"><use xlink:href="#${getColIconByType(cellElement.dataset.dtype as TAVCol)}"></use></svg>`;}if (typeof headerValue.name !== "undefined") {cellElement.querySelector(".av__celltext").textContent = headerValue.name;}if (typeof headerValue.pin !== "undefined") {- const textElement = cellElement.querySelector(".av__celltext")+ const textElement = cellElement.querySelector(".av__celltext");if (headerValue.pin) {if (!textElement.nextElementSibling) {- textElement.insertAdjacentHTML("afterend", '<div class="fn__flex-1"></div><svg class="av__cellheadericon"><use xlink:href="#iconPin"></use></svg>')+ textElement.insertAdjacentHTML("afterend", '<div class="fn__flex-1"></div><svg class="av__cellheadericon"><use xlink:href="#iconPin"></use></svg>');}} else {if (textElement.nextElementSibling) {@@ -616,4 +616,4 @@ export const updateHeaderCell = (cellElement: HTMLElement, headerValue: {}}}-}+};diff --git a/app/src/protyle/wysiwyg/enter.ts b/app/src/protyle/wysiwyg/enter.tsindex 0de4f8b273..76576162aa 100644--- a/app/src/protyle/wysiwyg/enter.ts+++ b/app/src/protyle/wysiwyg/enter.ts@@ -389,12 +389,12 @@ export const enter = (blockElement: HTMLElement, range: Range, protyle: IProtyleaction: "update",data: blockElement.outerHTML,id: id,- }]+ }];const undoOperation: IOperation[] = [{action: "update",data: html,id: id,- }]+ }];let previousElement = blockElement;Array.from(newElement.children).forEach((item: HTMLElement) => {const newId = item.getAttribute("data-node-id");@@ -403,15 +403,15 @@ export const enter = (blockElement: HTMLElement, range: Range, protyle: IProtyledata: item.outerHTML,id: newId,previousID: previousElement.getAttribute("data-node-id"),- })+ });undoOperation.push({action: "delete",id: newId,- })+ });previousElement.insertAdjacentElement("afterend", item);mathRender(previousElement.nextElementSibling);previousElement = item;- })+ });transaction(protyle, doOperation, undoOperation);focusBlock(blockElement.nextElementSibling);scrollCenter(protyle);