fix(editor): middle click open new tab (#12902)

Close
[BS-3251](https://linear.app/affine-design/issue/BS-3251/正文的inline链接,chrome中,中键开新窗口的行为丢失了)

#### PR Dependency Tree


* **PR #12902** 👈

This tree was auto-generated by
[Charcoal](https://github.com/danerwilliams/charcoal)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
- Middle-clicking on links and references now opens them in a new
browser tab.
- Linux platform detection has been added for improved
environment-specific behavior.

- **Bug Fixes**
- Middle-click paste prevention is now limited to Linux environments
when the relevant setting is disabled and excludes clicks on links and
references.

- **Tests**
- Added end-to-end tests to verify that middle-clicking links opens them
in a new tab for external links, internal links, and reference
documents.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
L-Sun
2025-06-23 20:33:51 +08:00
committed by GitHub
parent a8c18cd631
commit 1686b92adb
5 changed files with 96 additions and 2 deletions

View File

@@ -26,4 +26,6 @@ export const IS_IPAD =
export const IS_WINDOWS = /Win/.test(platform) || /win32/.test(platform);
export const IS_LINUX = /Linux/.test(platform);
export const IS_MOBILE = IS_IOS || IS_IPAD || IS_ANDROID;