This commit is contained in:
Vanessa 2023-11-12 12:28:20 +08:00
parent 2c71478d83
commit 4f263b31cc
19 changed files with 110 additions and 88 deletions

View file

@ -30,7 +30,7 @@ import {openMobileFileById} from "../../mobile/editor";
import {processRender} from "../util/processCode";
import {AIChat} from "../../ai/chat";
import {isMobile} from "../../util/functions";
import {isCtrl, isIPhone} from "../util/compatibility";
import {isIPhone, isNotCtrl, isOnlyMeta} from "../util/compatibility";
import {avRender} from "../render/av/render";
import {genIconHTML} from "../render/util";
@ -59,10 +59,10 @@ export class Hint {
const btnElement = hasClosestByMatchTag(eventTarget, "BUTTON");
if (btnElement && !btnElement.classList.contains("emojis__item") && !btnElement.classList.contains("emojis__type")) {
if (this.source !== "search") {
this.fill(decodeURIComponent(btnElement.getAttribute("data-value")), protyle, true, isCtrl(event));
this.fill(decodeURIComponent(btnElement.getAttribute("data-value")), protyle, true, isOnlyMeta(event));
} else {
setTimeout(() => {
this.fill(decodeURIComponent(btnElement.getAttribute("data-value")), protyle, true, !isCtrl(event));
this.fill(decodeURIComponent(btnElement.getAttribute("data-value")), protyle, true, isNotCtrl(event));
}, 148); // 划选引用点击,需先重置 range
}
focusByRange(protyle.toolbar.range);
@ -302,7 +302,7 @@ ${unicode2Emoji(emoji.unicode)}</button>`;
upDownHint(this.element.lastElementChild, event);
if (event.key === "Enter") {
setTimeout(() => {
this.fill(decodeURIComponent(this.element.querySelector(".b3-list-item--focus").getAttribute("data-value")), protyle, true, !isCtrl(event));
this.fill(decodeURIComponent(this.element.querySelector(".b3-list-item--focus").getAttribute("data-value")), protyle, true, isNotCtrl(event));
}, 148); // 划选引用点击,需先重置 range
focusByRange(protyle.toolbar.range);
event.preventDefault();
@ -826,7 +826,7 @@ ${genHintItemHTML(item)}
if (mark === Constants.ZWSP + 3) {
(this.element.querySelector(".b3-list-item--focus input") as HTMLElement).click();
} else {
this.fill(mark, protyle, true, isCtrl(event));
this.fill(mark, protyle, true, isOnlyMeta(event));
}
}
event.preventDefault();