mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-19 16:10:12 +01:00
🎨 点击其余地方需关闭字体面板
This commit is contained in:
parent
f1ed7ea50d
commit
bc75e7491d
3 changed files with 22 additions and 18 deletions
22
app/pnpm-lock.yaml
generated
22
app/pnpm-lock.yaml
generated
|
|
@ -10,7 +10,7 @@ importers:
|
||||||
dependencies:
|
dependencies:
|
||||||
'@electron/remote':
|
'@electron/remote':
|
||||||
specifier: ^2.1.2
|
specifier: ^2.1.2
|
||||||
version: 2.1.2(electron@35.3.0)
|
version: 2.1.2(electron@35.2.2)
|
||||||
devDependencies:
|
devDependencies:
|
||||||
'@eslint/eslintrc':
|
'@eslint/eslintrc':
|
||||||
specifier: ^3.3.1
|
specifier: ^3.3.1
|
||||||
|
|
@ -40,8 +40,8 @@ importers:
|
||||||
specifier: ^1.11.5
|
specifier: ^1.11.5
|
||||||
version: 1.11.13
|
version: 1.11.13
|
||||||
electron:
|
electron:
|
||||||
specifier: 35.3.0
|
specifier: 35.2.2
|
||||||
version: 35.3.0
|
version: 35.2.2
|
||||||
electron-builder:
|
electron-builder:
|
||||||
specifier: 26.0.12
|
specifier: 26.0.12
|
||||||
version: 26.0.12(electron-builder-squirrel-windows@26.0.11)
|
version: 26.0.12(electron-builder-squirrel-windows@26.0.11)
|
||||||
|
|
@ -451,42 +451,36 @@ packages:
|
||||||
engines: {node: '>= 10.0.0'}
|
engines: {node: '>= 10.0.0'}
|
||||||
cpu: [arm]
|
cpu: [arm]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
libc: [glibc]
|
|
||||||
|
|
||||||
'@parcel/watcher-linux-arm-musl@2.5.1':
|
'@parcel/watcher-linux-arm-musl@2.5.1':
|
||||||
resolution: {integrity: sha512-6E+m/Mm1t1yhB8X412stiKFG3XykmgdIOqhjWj+VL8oHkKABfu/gjFj8DvLrYVHSBNC+/u5PeNrujiSQ1zwd1Q==}
|
resolution: {integrity: sha512-6E+m/Mm1t1yhB8X412stiKFG3XykmgdIOqhjWj+VL8oHkKABfu/gjFj8DvLrYVHSBNC+/u5PeNrujiSQ1zwd1Q==}
|
||||||
engines: {node: '>= 10.0.0'}
|
engines: {node: '>= 10.0.0'}
|
||||||
cpu: [arm]
|
cpu: [arm]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
libc: [musl]
|
|
||||||
|
|
||||||
'@parcel/watcher-linux-arm64-glibc@2.5.1':
|
'@parcel/watcher-linux-arm64-glibc@2.5.1':
|
||||||
resolution: {integrity: sha512-LrGp+f02yU3BN9A+DGuY3v3bmnFUggAITBGriZHUREfNEzZh/GO06FF5u2kx8x+GBEUYfyTGamol4j3m9ANe8w==}
|
resolution: {integrity: sha512-LrGp+f02yU3BN9A+DGuY3v3bmnFUggAITBGriZHUREfNEzZh/GO06FF5u2kx8x+GBEUYfyTGamol4j3m9ANe8w==}
|
||||||
engines: {node: '>= 10.0.0'}
|
engines: {node: '>= 10.0.0'}
|
||||||
cpu: [arm64]
|
cpu: [arm64]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
libc: [glibc]
|
|
||||||
|
|
||||||
'@parcel/watcher-linux-arm64-musl@2.5.1':
|
'@parcel/watcher-linux-arm64-musl@2.5.1':
|
||||||
resolution: {integrity: sha512-cFOjABi92pMYRXS7AcQv9/M1YuKRw8SZniCDw0ssQb/noPkRzA+HBDkwmyOJYp5wXcsTrhxO0zq1U11cK9jsFg==}
|
resolution: {integrity: sha512-cFOjABi92pMYRXS7AcQv9/M1YuKRw8SZniCDw0ssQb/noPkRzA+HBDkwmyOJYp5wXcsTrhxO0zq1U11cK9jsFg==}
|
||||||
engines: {node: '>= 10.0.0'}
|
engines: {node: '>= 10.0.0'}
|
||||||
cpu: [arm64]
|
cpu: [arm64]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
libc: [musl]
|
|
||||||
|
|
||||||
'@parcel/watcher-linux-x64-glibc@2.5.1':
|
'@parcel/watcher-linux-x64-glibc@2.5.1':
|
||||||
resolution: {integrity: sha512-GcESn8NZySmfwlTsIur+49yDqSny2IhPeZfXunQi48DMugKeZ7uy1FX83pO0X22sHntJ4Ub+9k34XQCX+oHt2A==}
|
resolution: {integrity: sha512-GcESn8NZySmfwlTsIur+49yDqSny2IhPeZfXunQi48DMugKeZ7uy1FX83pO0X22sHntJ4Ub+9k34XQCX+oHt2A==}
|
||||||
engines: {node: '>= 10.0.0'}
|
engines: {node: '>= 10.0.0'}
|
||||||
cpu: [x64]
|
cpu: [x64]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
libc: [glibc]
|
|
||||||
|
|
||||||
'@parcel/watcher-linux-x64-musl@2.5.1':
|
'@parcel/watcher-linux-x64-musl@2.5.1':
|
||||||
resolution: {integrity: sha512-n0E2EQbatQ3bXhcH2D1XIAANAcTZkQICBPVaxMeaCVBtOpBZpWJuf7LwyWPSBDITb7In8mqQgJ7gH8CILCURXg==}
|
resolution: {integrity: sha512-n0E2EQbatQ3bXhcH2D1XIAANAcTZkQICBPVaxMeaCVBtOpBZpWJuf7LwyWPSBDITb7In8mqQgJ7gH8CILCURXg==}
|
||||||
engines: {node: '>= 10.0.0'}
|
engines: {node: '>= 10.0.0'}
|
||||||
cpu: [x64]
|
cpu: [x64]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
libc: [musl]
|
|
||||||
|
|
||||||
'@parcel/watcher-win32-arm64@2.5.1':
|
'@parcel/watcher-win32-arm64@2.5.1':
|
||||||
resolution: {integrity: sha512-RFzklRvmc3PkjKjry3hLF9wD7ppR4AKcWNzH7kXR7GUe0Igb3Nz8fyPwtZCSquGrhU5HhUNDr/mKBqj7tqA2Vw==}
|
resolution: {integrity: sha512-RFzklRvmc3PkjKjry3hLF9wD7ppR4AKcWNzH7kXR7GUe0Igb3Nz8fyPwtZCSquGrhU5HhUNDr/mKBqj7tqA2Vw==}
|
||||||
|
|
@ -1191,8 +1185,8 @@ packages:
|
||||||
resolution: {integrity: sha512-bO3y10YikuUwUuDUQRM4KfwNkKhnpVO7IPdbsrejwN9/AABJzzTQ4GeHwyzNSrVO+tEH3/Np255a3sVZpZDjvg==}
|
resolution: {integrity: sha512-bO3y10YikuUwUuDUQRM4KfwNkKhnpVO7IPdbsrejwN9/AABJzzTQ4GeHwyzNSrVO+tEH3/Np255a3sVZpZDjvg==}
|
||||||
engines: {node: '>=8.0.0'}
|
engines: {node: '>=8.0.0'}
|
||||||
|
|
||||||
electron@35.3.0:
|
electron@35.2.2:
|
||||||
resolution: {integrity: sha512-6dLslJrQYB1qvqVPYRv1PhAA/uytC66nUeiTcq2JXiBzrmTWCHppqtGUjZhvnSRVatBCT5/SFdizdzcBiEiYUg==}
|
resolution: {integrity: sha512-jZnCOtIgrt28esWP5z/PKndj/vPQ/Zt+cvNRlb/qOGnK/AjW1mASwPMtQ099NlSodf69RR3JrhnZCYbTWeDR4g==}
|
||||||
engines: {node: '>= 12.20.55'}
|
engines: {node: '>= 12.20.55'}
|
||||||
hasBin: true
|
hasBin: true
|
||||||
|
|
||||||
|
|
@ -2858,9 +2852,9 @@ snapshots:
|
||||||
- bluebird
|
- bluebird
|
||||||
- supports-color
|
- supports-color
|
||||||
|
|
||||||
'@electron/remote@2.1.2(electron@35.3.0)':
|
'@electron/remote@2.1.2(electron@35.2.2)':
|
||||||
dependencies:
|
dependencies:
|
||||||
electron: 35.3.0
|
electron: 35.2.2
|
||||||
|
|
||||||
'@electron/universal@2.0.1':
|
'@electron/universal@2.0.1':
|
||||||
dependencies:
|
dependencies:
|
||||||
|
|
@ -4025,7 +4019,7 @@ snapshots:
|
||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
- supports-color
|
- supports-color
|
||||||
|
|
||||||
electron@35.3.0:
|
electron@35.2.2:
|
||||||
dependencies:
|
dependencies:
|
||||||
'@electron/get': 2.0.3
|
'@electron/get': 2.0.3
|
||||||
'@types/node': 22.15.3
|
'@types/node': 22.15.3
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,13 @@ export const globalClick = (event: MouseEvent & { target: HTMLElement }) => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!hasTopClosestByClassName(event.target, "protyle-util") &&
|
||||||
|
!hasTopClosestByClassName(event.target, "protyle-toolbar")) {
|
||||||
|
document.querySelectorAll(".protyle-font").forEach((item: HTMLElement) => {
|
||||||
|
item.parentElement.classList.add("fn__none");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
const copyElement = hasTopClosestByClassName(event.target, "protyle-action__copy");
|
const copyElement = hasTopClosestByClassName(event.target, "protyle-action__copy");
|
||||||
if (copyElement) {
|
if (copyElement) {
|
||||||
let text = copyElement.parentElement.nextElementSibling.textContent.replace(/\n$/, "");
|
let text = copyElement.parentElement.nextElementSibling.textContent.replace(/\n$/, "");
|
||||||
|
|
|
||||||
|
|
@ -62,10 +62,13 @@ export const hideAllElements = (types: string[]) => {
|
||||||
if (types.includes("util")) {
|
if (types.includes("util")) {
|
||||||
getAllEditor().forEach(item => {
|
getAllEditor().forEach(item => {
|
||||||
if (item.protyle.toolbar) {
|
if (item.protyle.toolbar) {
|
||||||
item.protyle.toolbar.subElement.classList.add("fn__none");
|
const pinElement = item.protyle.toolbar.subElement.querySelector('[data-type="pin"]');
|
||||||
if (item.protyle.toolbar.subElementCloseCB) {
|
if (!pinElement || (pinElement && pinElement.getAttribute("aria-label") === window.siyuan.languages.pin)) {
|
||||||
item.protyle.toolbar.subElementCloseCB();
|
item.protyle.toolbar.subElement.classList.add("fn__none");
|
||||||
item.protyle.toolbar.subElementCloseCB = undefined;
|
if (item.protyle.toolbar.subElementCloseCB) {
|
||||||
|
item.protyle.toolbar.subElementCloseCB();
|
||||||
|
item.protyle.toolbar.subElementCloseCB = undefined;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue