Skip to content

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

:art: fix https://github.com/siyuan-note/siyuan/issues/9004

Vanessae5c96b499d99
diff --git a/app/src/assets/scss/protyle/_wysiwyg.scss b/app/src/assets/scss/protyle/_wysiwyg.scss
index d5bbff5e08..d23ee1f169 100644
--- a/app/src/assets/scss/protyle/_wysiwyg.scss
+++ b/app/src/assets/scss/protyle/_wysiwyg.scss
@@ -555,6 +555,23 @@
}
}
+// 只读情况下列表前的圆点需要可以点击进行缩放
+.protyle .protyle-wysiwyg {
+ .li[data-subtype="o"] > .protyle-action,
+ .li[data-subtype="u"] > .protyle-action,
+ &[contenteditable="true"] .li[data-subtype="t"] > .protyle-action {
+ cursor: pointer;
+
+ &:hover {
+ &:after {
+ background-color: var(--b3-theme-background-light);
+ }
+
+ color: var(--b3-theme-on-background);
+ }
+ }
+}
+
// 导出 html 不需要编辑样式
.protyle-wysiwyg[contenteditable="true"] {
span[data-type~="inline-math"],
@@ -563,7 +580,6 @@
span[data-type~="file-annotation-ref"],
.protyle-action__language,
.img > span:nth-child(2),
- .li > .protyle-action,
.render-node {
cursor: pointer;
}
@@ -577,14 +593,6 @@
opacity: 1;
}
- .li > .protyle-action:hover {
- &:after {
- opacity: .68;
- }
-
- color: var(--b3-theme-on-background);
- }
-
.code-block .protyle-action {
-webkit-user-modify: read-only;
diff --git a/app/src/protyle/wysiwyg/index.ts b/app/src/protyle/wysiwyg/index.ts
index 87239e20f1..e2732a5384 100644
--- a/app/src/protyle/wysiwyg/index.ts
+++ b/app/src/protyle/wysiwyg/index.ts
@@ -1932,8 +1932,8 @@ export class WYSIWYG {
clientX: event.clientX + 4,
clientY: event.clientY
});
- } else if (!protyle.disabled && actionElement.parentElement.classList.contains("li")) {
- if (event.altKey) {
+ } else if (actionElement.parentElement.classList.contains("li")) {
+ if (event.altKey && !protyle.disabled) {
// 展开/折叠当前层级的所有列表项
if (actionElement.parentElement.parentElement.classList.contains("protyle-wysiwyg")) {
// 缩放列表项 https://ld246.com/article/1653123034794
@@ -1961,22 +1961,24 @@ export class WYSIWYG {
updateTransaction(protyle, actionElement.parentElement.parentElement.getAttribute("data-node-id"), actionElement.parentElement.parentElement.outerHTML, oldHTML);
}
hideElements(["gutter"], protyle);
- } else if (event.shiftKey) {
+ } else if (event.shiftKey && !protyle.disabled) {
openAttr(actionElement.parentElement);
} else if (ctrlIsPressed) {
zoomOut({protyle, id: actionElement.parentElement.getAttribute("data-node-id")});
} else {
if (actionElement.classList.contains("protyle-action--task")) {
- const html = actionElement.parentElement.outerHTML;
- if (actionElement.parentElement.classList.contains("protyle-task--done")) {
- actionElement.querySelector("use").setAttribute("xlink:href", "#iconUncheck");
- actionElement.parentElement.classList.remove("protyle-task--done");
- } else {
- actionElement.querySelector("use").setAttribute("xlink:href", "#iconCheck");
- actionElement.parentElement.classList.add("protyle-task--done");
+ if (!protyle.disabled) {
+ const html = actionElement.parentElement.outerHTML;
+ if (actionElement.parentElement.classList.contains("protyle-task--done")) {
+ actionElement.querySelector("use").setAttribute("xlink:href", "#iconUncheck");
+ actionElement.parentElement.classList.remove("protyle-task--done");
+ } else {
+ actionElement.querySelector("use").setAttribute("xlink:href", "#iconCheck");
+ actionElement.parentElement.classList.add("protyle-task--done");
+ }
+ actionElement.parentElement.setAttribute("updated", dayjs().format("YYYYMMDDHHmmss"));
+ updateTransaction(protyle, actionElement.parentElement.getAttribute("data-node-id"), actionElement.parentElement.outerHTML, html);
}
- actionElement.parentElement.setAttribute("updated", dayjs().format("YYYYMMDDHHmmss"));
- updateTransaction(protyle, actionElement.parentElement.getAttribute("data-node-id"), actionElement.parentElement.outerHTML, html);
} else {
zoomOut({protyle, id: actionElement.parentElement.getAttribute("data-node-id")});
}