Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
Vanessa 2025-06-01 15:43:15 +08:00
commit c39509d9d4
17 changed files with 39 additions and 29 deletions

View file

@ -35,7 +35,7 @@ import {
} from "../../search/toggleHistory";
const replace = (element: Element, config: Config.IUILayoutTabSearchConfig, isAll: boolean) => {
if (config.method === 1 || config.method === 2) {
if (config.method === 2) {
showMessage(window.siyuan.languages._kernel[132]);
return;
}
@ -55,7 +55,7 @@ const replace = (element: Element, config: Config.IUILayoutTabSearchConfig, isAl
loadElement.nextElementSibling.classList.add("fn__none");
const currentId = currentLiElement.getAttribute("data-node-id");
fetchPost("/api/search/findReplace", {
k: config.method === 0 ? getKeyByLiElement(currentLiElement) : (document.querySelector("#toolbarSearch") as HTMLInputElement).value,
k: config.method === 0 || config.method === 1 ? getKeyByLiElement(currentLiElement) : (document.querySelector("#toolbarSearch") as HTMLInputElement).value,
r: replaceInputElement.value,
ids: isAll ? [] : [currentId],
types: config.types,

View file

@ -2,7 +2,8 @@ import {listIndent, listOutdent} from "../../protyle/wysiwyg/list";
import {
hasClosestBlock,
hasClosestByAttribute,
hasClosestByClassName, hasClosestByTag,
hasClosestByClassName,
hasClosestByTag,
} from "../../protyle/util/hasClosest";
import {moveToDown, moveToUp} from "../../protyle/wysiwyg/move";
import {Constants} from "../../constants";
@ -11,7 +12,7 @@ import {getCurrentEditor} from "../editor";
import {fontEvent, getFontNodeElements} from "../../protyle/toolbar/Font";
import {hideElements} from "../../protyle/ui/hideElements";
import {softEnter} from "../../protyle/wysiwyg/enter";
import {isInAndroid} from "../../protyle/util/compatibility";
import {isInAndroid, isInHarmony} from "../../protyle/util/compatibility";
let renderKeyboardToolbarTimeout: number;
let showUtil = false;
@ -519,7 +520,7 @@ export const initKeyboardToolbar = () => {
<button class="keyboard__action" data-type="done"><svg style="width: 36px"><use xlink:href="#iconKeyboardHide"></use></svg></button>
</div>
<div class="keyboard__util"></div>`;
toolbarElement.addEventListener(isInAndroid() ? "touchstart" : "click", (event) => {
toolbarElement.addEventListener(isInAndroid() || isInHarmony() ? "touchstart" : "click", (event) => {
const protyle = getCurrentEditor()?.protyle;
const target = event.target as HTMLElement;
const slashBtnElement = hasClosestByClassName(event.target as HTMLElement, "keyboard__slash-item");

View file

@ -9,14 +9,7 @@ import {openFile, openFileById} from "../editor/util";
import {showMessage} from "../dialog/message";
import {reloadProtyle} from "../protyle/util/reload";
import {MenuItem} from "../menus/Menu";
import {
getDisplayName,
getNotebookIcon,
getNotebookName,
movePathTo,
pathPosix,
useShell
} from "../util/pathName";
import {getDisplayName, getNotebookIcon, getNotebookName, movePathTo, pathPosix, useShell} from "../util/pathName";
import {Protyle} from "../protyle";
import {onGet} from "../protyle/util/onGet";
import {addLoading} from "../protyle/ui/initUI";
@ -1161,7 +1154,7 @@ export const getArticle = (options: {
};
export const replace = (element: Element, config: Config.IUILayoutTabSearchConfig, edit: Protyle, isAll: boolean) => {
if (config.method === 1 || config.method === 2) {
if (config.method === 2) {
showMessage(window.siyuan.languages._kernel[132]);
return;
}
@ -1181,7 +1174,7 @@ export const replace = (element: Element, config: Config.IUILayoutTabSearchConfi
loadElement.classList.remove("fn__none");
const currentId = currentList.getAttribute("data-node-id");
fetchPost("/api/search/findReplace", {
k: config.method === 0 ? getKeyByLiElement(currentList) : searchInputElement.value,
k: config.method === 0 || config.method === 1 ? getKeyByLiElement(currentList) : searchInputElement.value,
r: replaceInputElement.value,
method: config.method,
types: config.types,