mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-20 19:10:49 +08:00
🚨
This commit is contained in:
parent
a7dadc5a1f
commit
01e5df1e3d
@ -48,7 +48,6 @@ import {activeBlur, renderTextMenu, showKeyboardToolbarUtil} from "../../mobile/
|
|||||||
import {hideTooltip} from "../../dialog/tooltip";
|
import {hideTooltip} from "../../dialog/tooltip";
|
||||||
import {appearanceMenu} from "../toolbar/Font";
|
import {appearanceMenu} from "../toolbar/Font";
|
||||||
import {setPosition} from "../../util/setPosition";
|
import {setPosition} from "../../util/setPosition";
|
||||||
import {avRender} from "../render/av/render";
|
|
||||||
import {emitOpenMenu} from "../../plugin/EventBus";
|
import {emitOpenMenu} from "../../plugin/EventBus";
|
||||||
import {insertAttrViewBlockAnimation} from "../render/av/row";
|
import {insertAttrViewBlockAnimation} from "../render/av/row";
|
||||||
import {avContextmenu, duplicateCompletely} from "../render/av/action";
|
import {avContextmenu, duplicateCompletely} from "../render/av/action";
|
||||||
|
@ -406,4 +406,4 @@ const openEdit = (protyle: IProtyle, element:HTMLElement, event: MouseEvent) =>
|
|||||||
}
|
}
|
||||||
target = target.parentElement;
|
target = target.parentElement;
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
@ -613,7 +613,7 @@ export const focusBlock = (element: Element, parentElement?: HTMLElement, toStar
|
|||||||
} else {
|
} else {
|
||||||
// li 下面为 hr、嵌入块、数学公式、iframe、音频、视频、图表渲染块等时递归处理
|
// li 下面为 hr、嵌入块、数学公式、iframe、音频、视频、图表渲染块等时递归处理
|
||||||
if (element.classList.contains("li")) {
|
if (element.classList.contains("li")) {
|
||||||
return focusBlock(element.querySelector('[data-node-id]'), parentElement, toStart);
|
return focusBlock(element.querySelector("[data-node-id]"), parentElement, toStart);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@ -1336,9 +1336,9 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const isMatchList = matchHotKey(window.siyuan.config.keymap.editor.insert.list.custom, event)
|
const isMatchList = matchHotKey(window.siyuan.config.keymap.editor.insert.list.custom, event);
|
||||||
const isMatchCheck = matchHotKey(window.siyuan.config.keymap.editor.insert.check.custom, event)
|
const isMatchCheck = matchHotKey(window.siyuan.config.keymap.editor.insert.check.custom, event);
|
||||||
const isMatchOList = matchHotKey(window.siyuan.config.keymap.editor.insert["ordered-list"].custom, event)
|
const isMatchOList = matchHotKey(window.siyuan.config.keymap.editor.insert["ordered-list"].custom, event);
|
||||||
if (isMatchList || isMatchOList || isMatchCheck) {
|
if (isMatchList || isMatchOList || isMatchCheck) {
|
||||||
const selectsElement: HTMLElement[] = Array.from(protyle.wysiwyg.element.querySelectorAll(".protyle-wysiwyg--select"));
|
const selectsElement: HTMLElement[] = Array.from(protyle.wysiwyg.element.querySelectorAll(".protyle-wysiwyg--select"));
|
||||||
if (selectsElement.length === 0) {
|
if (selectsElement.length === 0) {
|
||||||
@ -1346,8 +1346,8 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
|
|||||||
protyle.hint.lastIndex = -1;
|
protyle.hint.lastIndex = -1;
|
||||||
protyle.hint.fill((isMatchCheck ? "* [ ] " : (isMatchList ? "* " : "1. ")) + Lute.Caret, protyle);
|
protyle.hint.fill((isMatchCheck ? "* [ ] " : (isMatchList ? "* " : "1. ")) + Lute.Caret, protyle);
|
||||||
} else if (selectsElement.length === 1) {
|
} else if (selectsElement.length === 1) {
|
||||||
const subType = selectsElement[0].dataset.subtype
|
const subType = selectsElement[0].dataset.subtype;
|
||||||
const type = selectsElement[0].dataset.type
|
const type = selectsElement[0].dataset.type;
|
||||||
if (type === "NodeParagraph") {
|
if (type === "NodeParagraph") {
|
||||||
turnsIntoOneTransaction({
|
turnsIntoOneTransaction({
|
||||||
protyle,
|
protyle,
|
||||||
@ -1355,7 +1355,7 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
|
|||||||
type: isMatchCheck ? "Blocks2TLs" : (isMatchList ? "Blocks2ULs" : "Blocks2OLs")
|
type: isMatchCheck ? "Blocks2TLs" : (isMatchList ? "Blocks2ULs" : "Blocks2OLs")
|
||||||
});
|
});
|
||||||
} else if (type === "NodeList") {
|
} else if (type === "NodeList") {
|
||||||
const id = selectsElement[0].dataset.nodeId
|
const id = selectsElement[0].dataset.nodeId;
|
||||||
if (subType === "o" && (isMatchList || isMatchCheck)) {
|
if (subType === "o" && (isMatchList || isMatchCheck)) {
|
||||||
turnsOneInto({
|
turnsOneInto({
|
||||||
protyle,
|
protyle,
|
||||||
|
@ -1116,7 +1116,7 @@ export const turnsOneInto = async (options: {
|
|||||||
processRender(options.protyle.wysiwyg.element);
|
processRender(options.protyle.wysiwyg.element);
|
||||||
highlightRender(options.protyle.wysiwyg.element);
|
highlightRender(options.protyle.wysiwyg.element);
|
||||||
avRender(options.protyle.wysiwyg.element, options.protyle);
|
avRender(options.protyle.wysiwyg.element, options.protyle);
|
||||||
}
|
};
|
||||||
|
|
||||||
const updateRef = (protyle: IProtyle, id: string, index = 0) => {
|
const updateRef = (protyle: IProtyle, id: string, index = 0) => {
|
||||||
if (index > 6) {
|
if (index > 6) {
|
||||||
|
Loading…
Reference in New Issue
Block a user