Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: https://github.com/siyuan-note/siyuan/issues/10414

Vanessaf77d6bca7c1b
diff --git a/app/src/assets/scss/business/_av.scss b/app/src/assets/scss/business/_av.scss
index b9d14208db..b85135d41d 100644
--- a/app/src/assets/scss/business/_av.scss
+++ b/app/src/assets/scss/business/_av.scss
@@ -330,8 +330,6 @@
}
&-content {
- max-width: 100%;
- width: 100%;
white-space: break-spaces;
word-break: break-word;
margin: 8px 8px 0;
diff --git a/app/src/protyle/gutter/index.ts b/app/src/protyle/gutter/index.ts
index d4d1931948..880792b6d8 100644
--- a/app/src/protyle/gutter/index.ts
+++ b/app/src/protyle/gutter/index.ts
@@ -2,7 +2,7 @@ import {
hasClosestBlock,
hasClosestByClassName,
hasClosestByTag,
- hasTopClosestByClassName,
+ hasTopClosestByClassName, isInAVBlock,
isInEmbedBlock
} from "../util/hasClosest";
import {getIconByType} from "../../editor/getIcon";
@@ -2283,7 +2283,7 @@ export class Gutter {
let hideParent = false;
while (nodeElement) {
let parentElement = hasClosestBlock(nodeElement.parentElement);
- if (!isInEmbedBlock(nodeElement)) {
+ if (!isInEmbedBlock(nodeElement) && !isInAVBlock(nodeElement)) {
let type;
if (!hideParent) {
type = nodeElement.getAttribute("data-type");
diff --git a/app/src/protyle/ui/initUI.ts b/app/src/protyle/ui/initUI.ts
index 0522aba893..a994da9b7b 100644
--- a/app/src/protyle/ui/initUI.ts
+++ b/app/src/protyle/ui/initUI.ts
@@ -204,9 +204,9 @@ export const initUI = (protyle: IProtyle) => {
const embedElement = isInEmbedBlock(nodeElement);
if (embedElement) {
protyle.gutter.render(protyle, embedElement, protyle.wysiwyg.element);
- } else {
- protyle.gutter.render(protyle, nodeElement, protyle.wysiwyg.element, event.target);
+ return;
}
+ protyle.gutter.render(protyle, nodeElement, protyle.wysiwyg.element, event.target);
return;
}
diff --git a/app/src/protyle/util/hasClosest.ts b/app/src/protyle/util/hasClosest.ts
index a0af525f3a..1fe6bbb63b 100644
--- a/app/src/protyle/util/hasClosest.ts
+++ b/app/src/protyle/util/hasClosest.ts
@@ -122,3 +122,10 @@ export const isInEmbedBlock = (element: Element) => {
return false;
}
};
+
+export const isInAVBlock = (element: Element) => {
+ if (hasClosestByClassName(element, 'av__gallery-cover')) {
+ return hasClosestByClassName(element, "av");
+ }
+ return false;
+};