Compare commits

...

6 commits

Author SHA1 Message Date
Vanessa
533e11cc1e Merge remote-tracking branch 'origin/dev' into dev 2025-09-21 21:46:41 +08:00
Vanessa
b262d63085 🎨 https://github.com/siyuan-note/siyuan/issues/15889 2025-09-21 21:46:27 +08:00
Jeffrey Chen
8e443ce5c3
🎨 Change the unordered list marker from "*" to "-" (#15902) 2025-09-21 18:41:37 +08:00
Vanessa
f96298e34c 🐛 https://github.com/siyuan-note/siyuan/issues/15890 2025-09-21 17:18:40 +08:00
Vanessa
63bbf34329 🚨 2025-09-21 17:16:46 +08:00
Daniel
b79f89d8a0
🎨 Improve copy/cut/delete Headings and Bottom Blocks menu https://github.com/siyuan-note/siyuan/issues/15797
Signed-off-by: Daniel <845765@qq.com>
2025-09-21 13:05:02 +08:00
9 changed files with 23 additions and 19 deletions

View file

@ -246,9 +246,9 @@ const renderSlashMenu = (protyle: IProtyle, toolbarElement: Element) => {
${getSlashItem("#### " + Lute.Caret, "iconH4", window.siyuan.languages.heading4, "true")}
${getSlashItem("##### " + Lute.Caret, "iconH5", window.siyuan.languages.heading5, "true")}
${getSlashItem("###### " + Lute.Caret, "iconH6", window.siyuan.languages.heading6, "true")}
${getSlashItem("* " + Lute.Caret, "iconList", window.siyuan.languages.list, "true")}
${getSlashItem("- " + Lute.Caret, "iconList", window.siyuan.languages.list, "true")}
${getSlashItem("1. " + Lute.Caret, "iconOrderedList", window.siyuan.languages["ordered-list"], "true")}
${getSlashItem("* [ ] " + Lute.Caret, "iconCheck", window.siyuan.languages.check, "true")}
${getSlashItem("- [ ] " + Lute.Caret, "iconCheck", window.siyuan.languages.check, "true")}
${getSlashItem("> " + Lute.Caret, "iconQuote", window.siyuan.languages.quote, "true")}
${getSlashItem("```", "iconCode", window.siyuan.languages.code, "true")}
${getSlashItem(`| ${Lute.Caret} | | |\n| --- | --- | --- |\n| | | |\n| | | |`, "iconTable", window.siyuan.languages.table, "true")}

View file

@ -113,8 +113,8 @@ export const hintSlash = (key: string, protyle: IProtyle) => {
}, {
filter: [window.siyuan.languages.list, "unordered list", "无序列表", "wuxvliebiao", "wuxuliebiao", "wxlb"],
id: "list",
value: "* " + Lute.Caret,
html: `<div class="b3-list-item__first"><svg class="b3-list-item__graphic"><use xlink:href="#iconList"></use></svg><span class="b3-list-item__text">${window.siyuan.languages.list}</span>${getHotkeyOrMarker(window.siyuan.config.keymap.editor.insert.list.custom, "* ")}</div>`,
value: "- " + Lute.Caret,
html: `<div class="b3-list-item__first"><svg class="b3-list-item__graphic"><use xlink:href="#iconList"></use></svg><span class="b3-list-item__text">${window.siyuan.languages.list}</span>${getHotkeyOrMarker(window.siyuan.config.keymap.editor.insert.list.custom, "- ")}</div>`,
}, {
filter: [window.siyuan.languages["ordered-list"], "order list", "ordered list", "有序列表", "youxvliebiao", "youxuliebiao", "yxlb"],
id: "orderedList",
@ -123,7 +123,7 @@ export const hintSlash = (key: string, protyle: IProtyle) => {
}, {
filter: [window.siyuan.languages.check, "task list", "todo list", "任务列表", "renwuliebiao", "rwlb"],
id: "check",
value: "* [ ] " + Lute.Caret,
value: "- [ ] " + Lute.Caret,
html: `<div class="b3-list-item__first"><svg class="b3-list-item__graphic"><use xlink:href="#iconCheck"></use></svg><span class="b3-list-item__text">${window.siyuan.languages.check}</span>${getHotkeyOrMarker(window.siyuan.config.keymap.editor.insert.check.custom, "[]")}</div>`,
}, {
filter: [window.siyuan.languages.quote, "blockquote", "bq", "引述", "yinshu", "ys"],

View file

@ -38,7 +38,7 @@ import {openMobileFileById} from "../../mobile/editor";
import {processRender} from "../util/processCode";
import {AIChat} from "../../ai/chat";
import {isMobile} from "../../util/functions";
import {isIPhone, isNotCtrl, isOnlyMeta} from "../util/compatibility";
import {isNotCtrl, isOnlyMeta} from "../util/compatibility";
import {avRender} from "../render/av/render";
import {genIconHTML} from "../render/util";
import {updateAttrViewCellAnimation} from "../render/av/action";

View file

@ -394,7 +394,7 @@ export const avContextmenu = (protyle: IProtyle, rowElement: HTMLElement, positi
let text = "";
rowElements.forEach((item, i) => {
if (rowElements.length > 1) {
text += "* ";
text += "- ";
}
text += item.querySelector('.av__cell[data-dtype="block"] .av__celltext').textContent.trim();
if (ids.length > 1 && i !== ids.length - 1) {
@ -421,7 +421,7 @@ export const avContextmenu = (protyle: IProtyle, rowElement: HTMLElement, positi
content = `((${id} '${cellElement.querySelector(".av__celltext").textContent.replace(/[\n]+/g, " ")}'))`;
}
if (ids.length > 1) {
text += "* ";
text += "- ";
}
text += content;
if (ids.length > 1 && i !== ids.length - 1) {
@ -438,7 +438,7 @@ export const avContextmenu = (protyle: IProtyle, rowElement: HTMLElement, positi
let text = "";
ids.forEach((id, index) => {
if (ids.length > 1) {
text += "* ";
text += "- ";
}
const cellElement = rowElements[index].querySelector(".av__cell[data-dtype='block']");
if (cellElement.getAttribute("data-detached") === "true") {
@ -460,7 +460,7 @@ export const avContextmenu = (protyle: IProtyle, rowElement: HTMLElement, positi
let text = "";
ids.forEach((id, index) => {
if (ids.length > 1) {
text += "* ";
text += "- ";
}
const cellElement = rowElements[index].querySelector(".av__cell[data-dtype='block']");
if (cellElement.getAttribute("data-detached") === "true") {
@ -490,7 +490,7 @@ export const avContextmenu = (protyle: IProtyle, rowElement: HTMLElement, positi
content = `[${cellElement.querySelector(".av__celltext").textContent.replace(/[\n]+/g, " ")}](siyuan://blocks/${id})`;
}
if (ids.length > 1) {
text += "* ";
text += "- ";
}
text += content;
if (ids.length > 1 && i !== ids.length - 1) {
@ -517,7 +517,7 @@ export const avContextmenu = (protyle: IProtyle, rowElement: HTMLElement, positi
}
if (ids.length > 1) {
text += "* ";
text += "- ";
}
text += content;
if (ids.length > 1 && i !== ids.length - 1) {
@ -534,7 +534,7 @@ export const avContextmenu = (protyle: IProtyle, rowElement: HTMLElement, positi
let text = "";
ids.forEach((id, index) => {
if (ids.length > 1) {
text += "* ";
text += "- ";
}
const cellElement = rowElements[index].querySelector(".av__cell[data-dtype='block']");
if (cellElement.getAttribute("data-detached") === "true") {

View file

@ -333,7 +333,7 @@ ${html}
${keyword ? genSelectItemHTML({
type: "empty",
newName: Lute.EscapeHTMLStr(keyword),
text: `<span style="color: var(--b3-protyle-inline-blockref-color);" data-id="${refElement.getAttribute("data-id")}">${refElement.textContent}</span>`,
text: `<span style="color: var(--b3-protyle-inline-blockref-color);" class="popover__block" data-id="${refElement.getAttribute("data-id")}">${refElement.textContent}</span>`,
}) : (html ? "" : genSelectItemHTML({type: "empty"}))}`;
menuElement.querySelector(".b3-menu__items .b3-menu__item:not(.fn__none)").classList.add("b3-menu__item--current");
updateCopyRelatedItems(menuElement);
@ -417,7 +417,7 @@ ${html || genSelectItemHTML({type: "empty"})}`;
const selectedElements = options.menuElement.querySelectorAll('.b3-menu__item[draggable="true"]');
selectedElements.forEach((item: HTMLElement) => {
if (selectedElements.length > 1) {
copyText += "* ";
copyText += "- ";
}
const textElement = item.querySelector(".b3-menu__label") as HTMLElement;
if (!textElement.dataset.id || textElement.dataset.id === "undefined") {

View file

@ -1352,7 +1352,7 @@ export const dropEvent = (protyle: IProtyle, editorElement: HTMLElement) => {
let html = "";
for (let i = 0; i < ids.length; i++) {
if (ids.length > 1) {
html += "* ";
html += "- ";
}
const response = await fetchSyncPost("/api/block/getRefText", {id: ids[i]});
html += `((${ids[i]} '${response.data}'))`;

View file

@ -166,7 +166,7 @@ const setHTML = (options: {
removeElements.forEach(item => {
item.remove();
});
protyle.contentElement.scrollTop = protyle.contentElement.scrollTop + (removeElement.getBoundingClientRect().top - lastRemoveTop);
protyle.contentElement.scrollTop = protyle.contentElement.scrollTop + (removeElement.getBoundingClientRect().top - lastRemoveTop) - 1;
protyle.scroll.lastScrollTop = protyle.contentElement.scrollTop;
hideElements(["toolbar"], protyle);
}

View file

@ -1585,7 +1585,7 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
} else {
protyle.hint.splitChar = "/";
protyle.hint.lastIndex = -1;
protyle.hint.fill((isMatchCheck ? "* [ ] " : (isMatchList ? "* " : "1. ")) + Lute.Caret, protyle);
protyle.hint.fill((isMatchCheck ? "- [ ] " : (isMatchList ? "- " : "1. ")) + Lute.Caret, protyle);
}
}
} else {

View file

@ -741,7 +741,11 @@ func GetHeadingChildrenDOM(id string, removeFoldAttr bool) (ret string) {
return ast.WalkContinue
})
child.SetIALAttr("parent-heading", id)
if removeFoldAttr {
child.RemoveIALAttr("parent-heading")
} else {
child.SetIALAttr("parent-heading", id)
}
}
if removeFoldAttr {