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/8992
Vanessa2a713b087f05
diff --git a/app/src/block/Panel.ts b/app/src/block/Panel.tsindex 4fcc7c41a6..15486d2f8d 100644--- a/app/src/block/Panel.ts+++ b/app/src/block/Panel.ts@@ -15,6 +15,7 @@ import {disabledProtyle} from "../protyle/util/onGet";import {fetchPost} from "../util/fetch";import {showMessage} from "../dialog/message";import {App} from "../index";+import {isMobile} from "../util/functions";export class BlockPanel {public element: HTMLElement;@@ -185,6 +186,13 @@ export class BlockPanel {if (afterCB) {afterCB();}+ // https://ld246.com/article/1653639418266+ if (editor.protyle.element.nextElementSibling || editor.protyle.element.previousElementSibling) {+ editor.protyle.element.style.minHeight = Math.min(30 + editor.protyle.wysiwyg.element.clientHeight, window.innerHeight / 3) + "px";+ }+ // 由于 afterCB 中高度的设定,需在之后再进行设定+ // 49 = 16(上图标)+16(下图标)+8(padding)+9(底部距离)+ editor.protyle.scroll.element.parentElement.setAttribute("style", `--b3-dynamicscroll-width:${Math.min(editor.protyle.contentElement.clientHeight - 49, 200)}px;${isMobile() ? "" : "right:10px"}`);}});this.editors.push(editor);@@ -268,7 +276,9 @@ export class BlockPanel {}}// 单击嵌入块悬浮窗的位置最好是覆盖嵌入块- setPosition(this.element, targetRect.left, Math.max(top - 84, Constants.SIZE_TOOLBAR_HEIGHT), 0, 8);+ // 防止图片撑高后悬浮窗显示不下,只能设置高度+ this.element.style.height = Math.min(window.innerHeight - Constants.SIZE_TOOLBAR_HEIGHT, targetRect.height + 42) + "px";+ setPosition(this.element, targetRect.left, Math.max(top - 42, Constants.SIZE_TOOLBAR_HEIGHT), -42, 0);} else if (this.targetElement) {if (this.targetElement.classList.contains("pdf__rect")) {targetRect = this.targetElement.firstElementChild.getBoundingClientRect();@@ -285,10 +295,12 @@ export class BlockPanel {setPosition(this.element, this.x, this.y);}const elementRect = this.element.getBoundingClientRect();- if (this.targetElement && elementRect.top < targetRect.top) {- this.element.style.maxHeight = Math.floor(targetRect.top - elementRect.top - 8) + "px";- } else {- this.element.style.maxHeight = Math.floor(window.innerHeight - elementRect.top - 8) + "px";+ if (this.targetElement && !this.targetElement.classList.contains("protyle-wysiwyg__embed")) {+ if (elementRect.top < targetRect.top) {+ this.element.style.maxHeight = Math.floor(targetRect.top - elementRect.top - 8) + "px";+ } else {+ this.element.style.maxHeight = Math.floor(window.innerHeight - elementRect.top - 8) + "px";+ }}this.element.classList.add("block__popover--open");} : undefined);diff --git a/app/src/protyle/util/onGet.ts b/app/src/protyle/util/onGet.tsindex ec969d83e5..be48441b8f 100644--- a/app/src/protyle/util/onGet.ts+++ b/app/src/protyle/util/onGet.ts@@ -249,14 +249,6 @@ const setHTML = (options: {});protyle.options.defId = undefined;}- // https://ld246.com/article/1653639418266- if (protyle.element.classList.contains("block__edit")) {- if (protyle.element.nextElementSibling || protyle.element.previousElementSibling) {- protyle.element.style.minHeight = Math.min(30 + protyle.wysiwyg.element.clientHeight, window.innerHeight / 3) + "px";- }- // 49 = 16(上图标)+16(下图标)+8(padding)+9(底部距离)- protyle.scroll.element.parentElement.setAttribute("style", `--b3-dynamicscroll-width:${Math.min(protyle.contentElement.clientHeight - 49, 200)}px;${isMobile() ? "" : "right:10px"}`);- }// 屏幕太高的页签 https://github.com/siyuan-note/siyuan/issues/5018if (!protyle.scroll.element.classList.contains("fn__none") &&protyle.wysiwyg.element.lastElementChild.getAttribute("data-eof") !== "2" &&