diff --git a/app/pnpm-lock.yaml b/app/pnpm-lock.yaml index c0a300e15..9382c6bda 100644 --- a/app/pnpm-lock.yaml +++ b/app/pnpm-lock.yaml @@ -10,7 +10,7 @@ importers: dependencies: '@electron/remote': specifier: ^2.1.2 - version: 2.1.2(electron@35.3.0) + version: 2.1.2(electron@35.2.2) devDependencies: '@eslint/eslintrc': specifier: ^3.3.1 @@ -40,8 +40,8 @@ importers: specifier: ^1.11.5 version: 1.11.13 electron: - specifier: 35.3.0 - version: 35.3.0 + specifier: 35.2.2 + version: 35.2.2 electron-builder: specifier: 26.0.12 version: 26.0.12(electron-builder-squirrel-windows@26.0.11) @@ -451,42 +451,36 @@ packages: engines: {node: '>= 10.0.0'} cpu: [arm] os: [linux] - libc: [glibc] '@parcel/watcher-linux-arm-musl@2.5.1': resolution: {integrity: sha512-6E+m/Mm1t1yhB8X412stiKFG3XykmgdIOqhjWj+VL8oHkKABfu/gjFj8DvLrYVHSBNC+/u5PeNrujiSQ1zwd1Q==} engines: {node: '>= 10.0.0'} cpu: [arm] os: [linux] - libc: [musl] '@parcel/watcher-linux-arm64-glibc@2.5.1': resolution: {integrity: sha512-LrGp+f02yU3BN9A+DGuY3v3bmnFUggAITBGriZHUREfNEzZh/GO06FF5u2kx8x+GBEUYfyTGamol4j3m9ANe8w==} engines: {node: '>= 10.0.0'} cpu: [arm64] os: [linux] - libc: [glibc] '@parcel/watcher-linux-arm64-musl@2.5.1': resolution: {integrity: sha512-cFOjABi92pMYRXS7AcQv9/M1YuKRw8SZniCDw0ssQb/noPkRzA+HBDkwmyOJYp5wXcsTrhxO0zq1U11cK9jsFg==} engines: {node: '>= 10.0.0'} cpu: [arm64] os: [linux] - libc: [musl] '@parcel/watcher-linux-x64-glibc@2.5.1': resolution: {integrity: sha512-GcESn8NZySmfwlTsIur+49yDqSny2IhPeZfXunQi48DMugKeZ7uy1FX83pO0X22sHntJ4Ub+9k34XQCX+oHt2A==} engines: {node: '>= 10.0.0'} cpu: [x64] os: [linux] - libc: [glibc] '@parcel/watcher-linux-x64-musl@2.5.1': resolution: {integrity: sha512-n0E2EQbatQ3bXhcH2D1XIAANAcTZkQICBPVaxMeaCVBtOpBZpWJuf7LwyWPSBDITb7In8mqQgJ7gH8CILCURXg==} engines: {node: '>= 10.0.0'} cpu: [x64] os: [linux] - libc: [musl] '@parcel/watcher-win32-arm64@2.5.1': resolution: {integrity: sha512-RFzklRvmc3PkjKjry3hLF9wD7ppR4AKcWNzH7kXR7GUe0Igb3Nz8fyPwtZCSquGrhU5HhUNDr/mKBqj7tqA2Vw==} @@ -1191,8 +1185,8 @@ packages: resolution: {integrity: sha512-bO3y10YikuUwUuDUQRM4KfwNkKhnpVO7IPdbsrejwN9/AABJzzTQ4GeHwyzNSrVO+tEH3/Np255a3sVZpZDjvg==} engines: {node: '>=8.0.0'} - electron@35.3.0: - resolution: {integrity: sha512-6dLslJrQYB1qvqVPYRv1PhAA/uytC66nUeiTcq2JXiBzrmTWCHppqtGUjZhvnSRVatBCT5/SFdizdzcBiEiYUg==} + electron@35.2.2: + resolution: {integrity: sha512-jZnCOtIgrt28esWP5z/PKndj/vPQ/Zt+cvNRlb/qOGnK/AjW1mASwPMtQ099NlSodf69RR3JrhnZCYbTWeDR4g==} engines: {node: '>= 12.20.55'} hasBin: true @@ -2858,9 +2852,9 @@ snapshots: - bluebird - supports-color - '@electron/remote@2.1.2(electron@35.3.0)': + '@electron/remote@2.1.2(electron@35.2.2)': dependencies: - electron: 35.3.0 + electron: 35.2.2 '@electron/universal@2.0.1': dependencies: @@ -4025,7 +4019,7 @@ snapshots: transitivePeerDependencies: - supports-color - electron@35.3.0: + electron@35.2.2: dependencies: '@electron/get': 2.0.3 '@types/node': 22.15.3 diff --git a/app/src/boot/globalEvent/click.ts b/app/src/boot/globalEvent/click.ts index e43571ee9..0c8d76168 100644 --- a/app/src/boot/globalEvent/click.ts +++ b/app/src/boot/globalEvent/click.ts @@ -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"); if (copyElement) { let text = copyElement.parentElement.nextElementSibling.textContent.replace(/\n$/, ""); diff --git a/app/src/protyle/ui/hideElements.ts b/app/src/protyle/ui/hideElements.ts index 92b302b8a..69514edec 100644 --- a/app/src/protyle/ui/hideElements.ts +++ b/app/src/protyle/ui/hideElements.ts @@ -62,10 +62,13 @@ export const hideAllElements = (types: string[]) => { if (types.includes("util")) { getAllEditor().forEach(item => { if (item.protyle.toolbar) { - item.protyle.toolbar.subElement.classList.add("fn__none"); - if (item.protyle.toolbar.subElementCloseCB) { - item.protyle.toolbar.subElementCloseCB(); - item.protyle.toolbar.subElementCloseCB = undefined; + const pinElement = item.protyle.toolbar.subElement.querySelector('[data-type="pin"]'); + if (!pinElement || (pinElement && pinElement.getAttribute("aria-label") === window.siyuan.languages.pin)) { + item.protyle.toolbar.subElement.classList.add("fn__none"); + if (item.protyle.toolbar.subElementCloseCB) { + item.protyle.toolbar.subElementCloseCB(); + item.protyle.toolbar.subElementCloseCB = undefined; + } } } });