An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:art: fix https://github.com/siyuan-note/siyuan/issues/7253
Vanessa82865e5bd479
diff --git a/app/src/menus/protyle.ts b/app/src/menus/protyle.tsindex b5c8b44a18..ae9fc7617c 100644--- a/app/src/menus/protyle.ts+++ b/app/src/menus/protyle.ts@@ -40,12 +40,14 @@ import {exportAsset} from "./util";import {removeLink} from "../protyle/toolbar/Link";import {alignImgCenter, alignImgLeft} from "../protyle/wysiwyg/commonHotkey";import {renameTag} from "../util/noRelyPCFunction";+import {hideElements} from "../protyle/ui/hideElements";export const refMenu = (protyle: IProtyle, element: HTMLElement) => {const nodeElement = hasClosestBlock(element);if (!nodeElement) {return;}+ hideElements(["util", "toolbar", "hint"], protyle);const refBlockId = element.getAttribute("data-id");const id = nodeElement.getAttribute("data-node-id");let oldHTML = nodeElement.outerHTML;@@ -494,6 +496,7 @@ export const imgMenu = (protyle: IProtyle, range: Range, assetElement: HTMLElemeif (!nodeElement) {return;}+ hideElements(["util", "toolbar", "hint"], protyle);const id = nodeElement.getAttribute("data-node-id");const imgElement = assetElement.querySelector("img");const titleElement = assetElement.querySelector(".protyle-action__title") as HTMLElement;@@ -680,6 +683,7 @@ export const linkMenu = (protyle: IProtyle, linkElement: HTMLElement, focusTextif (!nodeElement) {return;}+ hideElements(["util", "toolbar", "hint"], protyle);const id = nodeElement.getAttribute("data-node-id");const html = nodeElement.outerHTML;const linkAddress = linkElement.getAttribute("data-href");@@ -854,6 +858,7 @@ export const tagMenu = (protyle: IProtyle, tagElement: HTMLElement) => {if (!nodeElement) {return;}+ hideElements(["util", "toolbar", "hint"], protyle);const id = nodeElement.getAttribute("data-node-id");let html = nodeElement.outerHTML;window.siyuan.menus.menu.append(new MenuItem({diff --git a/app/src/protyle/gutter/index.ts b/app/src/protyle/gutter/index.tsindex c759813a72..cbfa7a9666 100644--- a/app/src/protyle/gutter/index.ts+++ b/app/src/protyle/gutter/index.ts@@ -673,7 +673,7 @@ export class Gutter {}public renderMenu(protyle: IProtyle, buttonElement: Element) {- hideElements(["hint"], protyle);+ hideElements(["util", "toolbar", "hint"], protyle);window.siyuan.menus.menu.remove();const id = buttonElement.getAttribute("data-node-id");const selectsElement = protyle.wysiwyg.element.querySelectorAll(".protyle-wysiwyg--select");diff --git a/app/src/protyle/toolbar/index.ts b/app/src/protyle/toolbar/index.tsindex 4ac621a838..541051a918 100644--- a/app/src/protyle/toolbar/index.ts+++ b/app/src/protyle/toolbar/index.ts@@ -725,6 +725,8 @@ export class Toolbar {if (!nodeElement) {return;}+ hideElements(["hint"], protyle);+ window.siyuan.menus.menu.remove();const id = nodeElement.getAttribute("data-node-id");const html = nodeElement.outerHTML;this.subElement.style.width = isMobile() ? "80vw" : Math.min(480, window.innerWidth) + "px";@@ -798,6 +800,8 @@ export class Toolbar {if (!nodeElement) {return;}+ hideElements(["hint"], protyle);+ window.siyuan.menus.menu.remove();const id = nodeElement.getAttribute("data-node-id");const types = (renderElement.getAttribute("data-type") || "").split(" ");const html = oldHTML || protyle.lute.SpinBlockDOM(nodeElement.outerHTML);@@ -1173,6 +1177,8 @@ export class Toolbar {if (!nodeElement) {return;}+ hideElements(["hint"], protyle);+ window.siyuan.menus.menu.remove();this.range = getEditorRange(nodeElement);const id = nodeElement.getAttribute("data-node-id");let oldHtml = nodeElement.outerHTML;@@ -1292,6 +1298,8 @@ export class Toolbar {public showTpl(protyle: IProtyle, nodeElement: HTMLElement, range: Range) {this.range = range;+ hideElements(["hint"], protyle);+ window.siyuan.menus.menu.remove();fetchPost("/api/search/searchTemplate", {k: "",}, (response) => {@@ -1420,6 +1428,8 @@ export class Toolbar {public showWidget(protyle: IProtyle, nodeElement: HTMLElement, range: Range) {this.range = range;+ hideElements(["hint"], protyle);+ window.siyuan.menus.menu.remove();fetchPost("/api/search/searchWidget", {k: "",}, (response) => {@@ -1480,6 +1490,8 @@ export class Toolbar {public showAssets(protyle: IProtyle, nodeElement: HTMLElement, range: Range) {this.range = range;+ hideElements(["hint"], protyle);+ window.siyuan.menus.menu.remove();fetchPost("/api/search/searchAsset", {k: "",}, (response) => {