Vanessa 2023-12-01 23:17:30 +08:00
parent 350b9a8247
commit 63402ffaa9
6 changed files with 22 additions and 2 deletions

View File

@ -1,5 +1,8 @@
document.body.insertAdjacentHTML('afterbegin', `<svg style="position: absolute; width: 0; height: 0; overflow: hidden;" xmlns="http://www.w3.org/2000/svg">
<defs>
<symbol id="iconArrowDown" viewBox="0 0 32 32">
<path d="M16.95 30.017l12.874-14.834c0.098-0.114 0.153-0.259 0.153-0.412v-3.475c0-0.29-0.361-0.424-0.55-0.204l-11.936 13.75v-22.977c0-0.173-0.141-0.314-0.314-0.314h-2.356c-0.173 0-0.314 0.141-0.314 0.314v22.973l-11.936-13.75c-0.192-0.22-0.55-0.086-0.55 0.204v3.593c0 0.075 0.028 0.149 0.079 0.204l12.949 14.928c0.232 0.266 0.572 0.433 0.95 0.433s0.718-0.167 0.949-0.431l0.001-0.001z"></path>
</symbol>
<symbol id="iconOpen" viewBox="0 0 32 32">
<path d="M1 27.979l22.693-22.693h-14.121v-4.286h21.429v21.429h-4.286v-14.121l-22.693 22.693-3.021-3.021z"></path>
</symbol>

View File

@ -2,5 +2,5 @@
"name": "ant",
"author": "Vanessa",
"url": "https://github.com/Vanessa219",
"version": "1.26.0"
"version": "1.27.0"
}

View File

@ -28,6 +28,12 @@
<body>
<h2>SiYuan</h2>
<div class="fn__clear">
<div>
<svg>
<use xlink:href="#iconArrowDown"></use>
</svg>
iconArrowDown
</div>
<div>
<svg>
<use xlink:href="#iconOpen"></use>

View File

@ -1,5 +1,8 @@
document.body.insertAdjacentHTML('afterbegin', `<svg style="position: absolute; width: 0; height: 0; overflow: hidden;" xmlns="http://www.w3.org/2000/svg">
<defs>
<symbol id="iconArrowDown" viewBox="0 0 32 32">
<path d="M1.5 16l1.948-1.903 11.192 11.192v-23.789h2.719v23.789l11.192-11.192 1.948 1.903-14.5 14.5z"></path>
</symbol>
<symbol id="iconOpen" viewBox="0 0 32 32">
<path d="M1 27.979l22.693-22.693h-14.121v-4.286h21.429v21.429h-4.286v-14.121l-22.693 22.693-3.021-3.021z"></path>
</symbol>

View File

@ -2,5 +2,5 @@
"name": "material",
"author": "Vanessa",
"url": "https://github.com/Vanessa219",
"version": "1.26.0"
"version": "1.27.0"
}

View File

@ -11,6 +11,8 @@ import {focusByRange, getSelectionPosition} from "../../protyle/util/selection";
import {getCurrentEditor} from "../editor";
import {fontEvent, getFontNodeElements} from "../../protyle/toolbar/Font";
import {hideElements} from "../../protyle/ui/hideElements";
import {input} from "../../protyle/wysiwyg/input";
import {showMessage} from "../../dialog/message";
let renderKeyboardToolbarTimeout: number;
let showUtil = false;
@ -474,6 +476,7 @@ export const initKeyboardToolbar = () => {
<span class="keyboard__split"></span>
<button class="keyboard__action" data-type="moveup"><svg><use xlink:href="#iconUp"></use></svg></button>
<button class="keyboard__action" data-type="movedown"><svg><use xlink:href="#iconDown"></use></svg></button>
<button class="keyboard__action" data-type="softLine"><svg><use xlink:href="#iconArrowDown"></use></svg></button>
</div>
<div class="fn__none keyboard__dynamic">
<button class="keyboard__action" data-type="goback"><svg><use xlink:href="#iconBack"></use></svg></button>
@ -622,6 +625,11 @@ export const initKeyboardToolbar = () => {
moveToDown(protyle, nodeElement, range);
focusByRange(range);
return;
} else if (type === "softLine") {
range.insertNode(document.createTextNode("\n"));
range.collapse(false);
input(protyle, nodeElement, range);
return;
} else if (type === "add") {
if (buttonElement.classList.contains("protyle-toolbar__item--current")) {
hideKeyboardToolbarUtil();