🐛 Fixed the issue of scroll wheel modifying font size and the problem of automatic language detection failing

This commit is contained in:
2026-03-28 22:35:09 +08:00
parent 6e49516962
commit 03191a219f
8 changed files with 216 additions and 141 deletions

View File

@@ -78,7 +78,7 @@
"eslint-plugin-vue": "^10.6.2",
"globals": "^16.5.0",
"typescript": "^5.9.3",
"typescript-eslint": "^8.50.1",
"typescript-eslint": "^8.51.0",
"unplugin-vue-components": "^30.0.0",
"vite": "npm:rolldown-vite@latest",
"vite-plugin-node-polyfills": "^0.24.0",
@@ -142,7 +142,6 @@
"resolved": "https://registry.npmmirror.com/@babel/parser/-/parser-7.28.5.tgz",
"integrity": "sha512-KKBU1VGYR7ORr3At5HAtUQ+TV3SzRCXmA/8OdDZiLDBIZxVyzXuztPjfLd3BV1PRAQGCMWWSHYhL0F8d5uHBDQ==",
"license": "MIT",
"peer": true,
"dependencies": {
"@babel/types": "^7.28.5"
},
@@ -610,9 +609,9 @@
}
},
"node_modules/@codemirror/view": {
"version": "6.39.6",
"resolved": "https://registry.npmmirror.com/@codemirror/view/-/view-6.39.6.tgz",
"integrity": "sha512-/N+SoP5NndJjkGInp3BwlUa3KQKD6bDo0TV6ep37ueAdQ7BVu/PqlZNywmgjCq0MQoZadZd8T+MZucSr7fktyQ==",
"version": "6.39.8",
"resolved": "https://registry.npmmirror.com/@codemirror/view/-/view-6.39.8.tgz",
"integrity": "sha512-1rASYd9Z/mE3tkbC9wInRlCNyCkSn+nLsiQKZhEDUUJiUfs/5FHDpCUDaQpoTIaNGeDc6/bhaEAyLmeEucEFPw==",
"license": "MIT",
"dependencies": {
"@codemirror/state": "^6.5.0",
@@ -1341,13 +1340,13 @@
}
},
"node_modules/@intlify/core-base": {
"version": "11.2.7",
"resolved": "https://registry.npmmirror.com/@intlify/core-base/-/core-base-11.2.7.tgz",
"integrity": "sha512-+Ra9I/LAzXDnmv/IrTO03WMCiLya7pHRmGJvNl9fKwx/W4REJ0xaMk2PxCRqnxcBsX443amEMdebQ3R1geiuIw==",
"version": "11.2.8",
"resolved": "https://registry.npmmirror.com/@intlify/core-base/-/core-base-11.2.8.tgz",
"integrity": "sha512-nBq6Y1tVkjIUsLsdOjDSJj4AsjvD0UG3zsg9Fyc+OivwlA/oMHSKooUy9tpKj0HqZ+NWFifweHavdljlBLTwdA==",
"license": "MIT",
"dependencies": {
"@intlify/message-compiler": "11.2.7",
"@intlify/shared": "11.2.7"
"@intlify/message-compiler": "11.2.8",
"@intlify/shared": "11.2.8"
},
"engines": {
"node": ">= 16"
@@ -1357,12 +1356,12 @@
}
},
"node_modules/@intlify/message-compiler": {
"version": "11.2.7",
"resolved": "https://registry.npmmirror.com/@intlify/message-compiler/-/message-compiler-11.2.7.tgz",
"integrity": "sha512-TFamC+GzJAotAFwUNvbtRVBgvuSn2nCwKNresmPUHv3IIVMmXJt7QQJj/DORI1h8hs46ZF6L0Fs2xBohSOE4iQ==",
"version": "11.2.8",
"resolved": "https://registry.npmmirror.com/@intlify/message-compiler/-/message-compiler-11.2.8.tgz",
"integrity": "sha512-A5n33doOjmHsBtCN421386cG1tWp5rpOjOYPNsnpjIJbQ4POF0QY2ezhZR9kr0boKwaHjbOifvyQvHj2UTrDFQ==",
"license": "MIT",
"dependencies": {
"@intlify/shared": "11.2.7",
"@intlify/shared": "11.2.8",
"source-map-js": "^1.0.2"
},
"engines": {
@@ -1373,9 +1372,9 @@
}
},
"node_modules/@intlify/shared": {
"version": "11.2.7",
"resolved": "https://registry.npmmirror.com/@intlify/shared/-/shared-11.2.7.tgz",
"integrity": "sha512-uvlkvc/0uQ4FDlHQZccpUnmcOwNcaI3i+69ck2YJ+GqM35AoVbuS63b+YfirV4G0SZh64Ij2UMcFRMmB4nr95w==",
"version": "11.2.8",
"resolved": "https://registry.npmmirror.com/@intlify/shared/-/shared-11.2.8.tgz",
"integrity": "sha512-l6e4NZyUgv8VyXXH4DbuucFOBmxLF56C/mqh2tvApbzl2Hrhi1aTDcuv5TKdxzfHYmpO3UB0Cz04fgDT9vszfw==",
"license": "MIT",
"engines": {
"node": ">= 16"
@@ -2469,21 +2468,21 @@
"license": "MIT"
},
"node_modules/@toml-tools/lexer": {
"version": "1.0.0",
"resolved": "https://registry.npmmirror.com/@toml-tools/lexer/-/lexer-1.0.0.tgz",
"integrity": "sha512-rVoOC9FibF2CICwCBWQnYcjAEOmLCJExer178K2AsY0Nk9FjJNVoVJuR5UAtuq42BZOajvH+ainf6Gj2GpCnXQ==",
"version": "1.0.1",
"resolved": "https://registry.npmmirror.com/@toml-tools/lexer/-/lexer-1.0.1.tgz",
"integrity": "sha512-jn2fl8m/9QPcUD507Hbt2W3TVMKzF5HEY8xKIxqY2r2dTG2udeCKlo2ejJ5k/RSOJsWNIuw+Ir/nxW5PItUApA==",
"license": "MIT",
"dependencies": {
"chevrotain": "^11.0.1"
}
},
"node_modules/@toml-tools/parser": {
"version": "1.0.0",
"resolved": "https://registry.npmmirror.com/@toml-tools/parser/-/parser-1.0.0.tgz",
"integrity": "sha512-j8cd3A3ccLHppGoWI69urbiVJslrpwI6sZ61ySDUPxM/FTkQWRx/JkkF8aipnl0Ds0feWXyjyvmWzn70mIohYg==",
"version": "1.0.1",
"resolved": "https://registry.npmmirror.com/@toml-tools/parser/-/parser-1.0.1.tgz",
"integrity": "sha512-W+YdnB8KDgKjIqhoArEXjiTTPnKSXVvI/B+raHfou9+sip3rxhzVsELn46GG7dZyNHyu9pS+gYgYrdF9c5AQDg==",
"license": "MIT",
"dependencies": {
"@toml-tools/lexer": "^1.0.0",
"@toml-tools/lexer": "^1.0.1",
"chevrotain": "^11.0.1"
}
},
@@ -2865,23 +2864,25 @@
"resolved": "https://registry.npmmirror.com/@types/whatwg-mimetype/-/whatwg-mimetype-3.0.2.tgz",
"integrity": "sha512-c2AKvDT8ToxLIOUlN51gTiHXflsfIFisS4pO7pDPoKouJCESkhZnEy623gwP9laCy5lnLDAw1vAzu2vM2YLOrA==",
"dev": true,
"license": "MIT"
"license": "MIT",
"optional": true,
"peer": true
},
"node_modules/@typescript-eslint/eslint-plugin": {
"version": "8.50.1",
"resolved": "https://registry.npmmirror.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.50.1.tgz",
"integrity": "sha512-PKhLGDq3JAg0Jk/aK890knnqduuI/Qj+udH7wCf0217IGi4gt+acgCyPVe79qoT+qKUvHMDQkwJeKW9fwl8Cyw==",
"version": "8.51.0",
"resolved": "https://registry.npmmirror.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.51.0.tgz",
"integrity": "sha512-XtssGWJvypyM2ytBnSnKtHYOGT+4ZwTnBVl36TA4nRO2f4PRNGz5/1OszHzcZCvcBMh+qb7I06uoCmLTRdR9og==",
"dev": true,
"license": "MIT",
"dependencies": {
"@eslint-community/regexpp": "^4.10.0",
"@typescript-eslint/scope-manager": "8.50.1",
"@typescript-eslint/type-utils": "8.50.1",
"@typescript-eslint/utils": "8.50.1",
"@typescript-eslint/visitor-keys": "8.50.1",
"@typescript-eslint/scope-manager": "8.51.0",
"@typescript-eslint/type-utils": "8.51.0",
"@typescript-eslint/utils": "8.51.0",
"@typescript-eslint/visitor-keys": "8.51.0",
"ignore": "^7.0.0",
"natural-compare": "^1.4.0",
"ts-api-utils": "^2.1.0"
"ts-api-utils": "^2.2.0"
},
"engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
@@ -2891,7 +2892,7 @@
"url": "https://opencollective.com/typescript-eslint"
},
"peerDependencies": {
"@typescript-eslint/parser": "^8.50.1",
"@typescript-eslint/parser": "^8.51.0",
"eslint": "^8.57.0 || ^9.0.0",
"typescript": ">=4.8.4 <6.0.0"
}
@@ -2907,16 +2908,16 @@
}
},
"node_modules/@typescript-eslint/parser": {
"version": "8.50.1",
"resolved": "https://registry.npmmirror.com/@typescript-eslint/parser/-/parser-8.50.1.tgz",
"integrity": "sha512-hM5faZwg7aVNa819m/5r7D0h0c9yC4DUlWAOvHAtISdFTc8xB86VmX5Xqabrama3wIPJ/q9RbGS1worb6JfnMg==",
"version": "8.51.0",
"resolved": "https://registry.npmmirror.com/@typescript-eslint/parser/-/parser-8.51.0.tgz",
"integrity": "sha512-3xP4XzzDNQOIqBMWogftkwxhg5oMKApqY0BAflmLZiFYHqyhSOxv/cd/zPQLTcCXr4AkaKb25joocY0BD1WC6A==",
"dev": true,
"license": "MIT",
"dependencies": {
"@typescript-eslint/scope-manager": "8.50.1",
"@typescript-eslint/types": "8.50.1",
"@typescript-eslint/typescript-estree": "8.50.1",
"@typescript-eslint/visitor-keys": "8.50.1",
"@typescript-eslint/scope-manager": "8.51.0",
"@typescript-eslint/types": "8.51.0",
"@typescript-eslint/typescript-estree": "8.51.0",
"@typescript-eslint/visitor-keys": "8.51.0",
"debug": "^4.3.4"
},
"engines": {
@@ -2932,14 +2933,14 @@
}
},
"node_modules/@typescript-eslint/project-service": {
"version": "8.50.1",
"resolved": "https://registry.npmmirror.com/@typescript-eslint/project-service/-/project-service-8.50.1.tgz",
"integrity": "sha512-E1ur1MCVf+YiP89+o4Les/oBAVzmSbeRB0MQLfSlYtbWU17HPxZ6Bhs5iYmKZRALvEuBoXIZMOIRRc/P++Ortg==",
"version": "8.51.0",
"resolved": "https://registry.npmmirror.com/@typescript-eslint/project-service/-/project-service-8.51.0.tgz",
"integrity": "sha512-Luv/GafO07Z7HpiI7qeEW5NW8HUtZI/fo/kE0YbtQEFpJRUuR0ajcWfCE5bnMvL7QQFrmT/odMe8QZww8X2nfQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"@typescript-eslint/tsconfig-utils": "^8.50.1",
"@typescript-eslint/types": "^8.50.1",
"@typescript-eslint/tsconfig-utils": "^8.51.0",
"@typescript-eslint/types": "^8.51.0",
"debug": "^4.3.4"
},
"engines": {
@@ -2954,14 +2955,14 @@
}
},
"node_modules/@typescript-eslint/scope-manager": {
"version": "8.50.1",
"resolved": "https://registry.npmmirror.com/@typescript-eslint/scope-manager/-/scope-manager-8.50.1.tgz",
"integrity": "sha512-mfRx06Myt3T4vuoHaKi8ZWNTPdzKPNBhiblze5N50//TSHOAQQevl/aolqA/BcqqbJ88GUnLqjjcBc8EWdBcVw==",
"version": "8.51.0",
"resolved": "https://registry.npmmirror.com/@typescript-eslint/scope-manager/-/scope-manager-8.51.0.tgz",
"integrity": "sha512-JhhJDVwsSx4hiOEQPeajGhCWgBMBwVkxC/Pet53EpBVs7zHHtayKefw1jtPaNRXpI9RA2uocdmpdfE7T+NrizA==",
"dev": true,
"license": "MIT",
"dependencies": {
"@typescript-eslint/types": "8.50.1",
"@typescript-eslint/visitor-keys": "8.50.1"
"@typescript-eslint/types": "8.51.0",
"@typescript-eslint/visitor-keys": "8.51.0"
},
"engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
@@ -2972,9 +2973,9 @@
}
},
"node_modules/@typescript-eslint/tsconfig-utils": {
"version": "8.50.1",
"resolved": "https://registry.npmmirror.com/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.50.1.tgz",
"integrity": "sha512-ooHmotT/lCWLXi55G4mvaUF60aJa012QzvLK0Y+Mp4WdSt17QhMhWOaBWeGTFVkb2gDgBe19Cxy1elPXylslDw==",
"version": "8.51.0",
"resolved": "https://registry.npmmirror.com/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.51.0.tgz",
"integrity": "sha512-Qi5bSy/vuHeWyir2C8u/uqGMIlIDu8fuiYWv48ZGlZ/k+PRPHtaAu7erpc7p5bzw2WNNSniuxoMSO4Ar6V9OXw==",
"dev": true,
"license": "MIT",
"engines": {
@@ -2989,17 +2990,17 @@
}
},
"node_modules/@typescript-eslint/type-utils": {
"version": "8.50.1",
"resolved": "https://registry.npmmirror.com/@typescript-eslint/type-utils/-/type-utils-8.50.1.tgz",
"integrity": "sha512-7J3bf022QZE42tYMO6SL+6lTPKFk/WphhRPe9Tw/el+cEwzLz1Jjz2PX3GtGQVxooLDKeMVmMt7fWpYRdG5Etg==",
"version": "8.51.0",
"resolved": "https://registry.npmmirror.com/@typescript-eslint/type-utils/-/type-utils-8.51.0.tgz",
"integrity": "sha512-0XVtYzxnobc9K0VU7wRWg1yiUrw4oQzexCG2V2IDxxCxhqBMSMbjB+6o91A+Uc0GWtgjCa3Y8bi7hwI0Tu4n5Q==",
"dev": true,
"license": "MIT",
"dependencies": {
"@typescript-eslint/types": "8.50.1",
"@typescript-eslint/typescript-estree": "8.50.1",
"@typescript-eslint/utils": "8.50.1",
"@typescript-eslint/types": "8.51.0",
"@typescript-eslint/typescript-estree": "8.51.0",
"@typescript-eslint/utils": "8.51.0",
"debug": "^4.3.4",
"ts-api-utils": "^2.1.0"
"ts-api-utils": "^2.2.0"
},
"engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
@@ -3014,9 +3015,9 @@
}
},
"node_modules/@typescript-eslint/types": {
"version": "8.50.1",
"resolved": "https://registry.npmmirror.com/@typescript-eslint/types/-/types-8.50.1.tgz",
"integrity": "sha512-v5lFIS2feTkNyMhd7AucE/9j/4V9v5iIbpVRncjk/K0sQ6Sb+Np9fgYS/63n6nwqahHQvbmujeBL7mp07Q9mlA==",
"version": "8.51.0",
"resolved": "https://registry.npmmirror.com/@typescript-eslint/types/-/types-8.51.0.tgz",
"integrity": "sha512-TizAvWYFM6sSscmEakjY3sPqGwxZRSywSsPEiuZF6d5GmGD9Gvlsv0f6N8FvAAA0CD06l3rIcWNbsN1e5F/9Ag==",
"dev": true,
"license": "MIT",
"engines": {
@@ -3028,21 +3029,21 @@
}
},
"node_modules/@typescript-eslint/typescript-estree": {
"version": "8.50.1",
"resolved": "https://registry.npmmirror.com/@typescript-eslint/typescript-estree/-/typescript-estree-8.50.1.tgz",
"integrity": "sha512-woHPdW+0gj53aM+cxchymJCrh0cyS7BTIdcDxWUNsclr9VDkOSbqC13juHzxOmQ22dDkMZEpZB+3X1WpUvzgVQ==",
"version": "8.51.0",
"resolved": "https://registry.npmmirror.com/@typescript-eslint/typescript-estree/-/typescript-estree-8.51.0.tgz",
"integrity": "sha512-1qNjGqFRmlq0VW5iVlcyHBbCjPB7y6SxpBkrbhNWMy/65ZoncXCEPJxkRZL8McrseNH6lFhaxCIaX+vBuFnRng==",
"dev": true,
"license": "MIT",
"dependencies": {
"@typescript-eslint/project-service": "8.50.1",
"@typescript-eslint/tsconfig-utils": "8.50.1",
"@typescript-eslint/types": "8.50.1",
"@typescript-eslint/visitor-keys": "8.50.1",
"@typescript-eslint/project-service": "8.51.0",
"@typescript-eslint/tsconfig-utils": "8.51.0",
"@typescript-eslint/types": "8.51.0",
"@typescript-eslint/visitor-keys": "8.51.0",
"debug": "^4.3.4",
"minimatch": "^9.0.4",
"semver": "^7.6.0",
"tinyglobby": "^0.2.15",
"ts-api-utils": "^2.1.0"
"ts-api-utils": "^2.2.0"
},
"engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
@@ -3082,16 +3083,16 @@
}
},
"node_modules/@typescript-eslint/utils": {
"version": "8.50.1",
"resolved": "https://registry.npmmirror.com/@typescript-eslint/utils/-/utils-8.50.1.tgz",
"integrity": "sha512-lCLp8H1T9T7gPbEuJSnHwnSuO9mDf8mfK/Nion5mZmiEaQD9sWf9W4dfeFqRyqRjF06/kBuTmAqcs9sewM2NbQ==",
"version": "8.51.0",
"resolved": "https://registry.npmmirror.com/@typescript-eslint/utils/-/utils-8.51.0.tgz",
"integrity": "sha512-11rZYxSe0zabiKaCP2QAwRf/dnmgFgvTmeDTtZvUvXG3UuAdg/GU02NExmmIXzz3vLGgMdtrIosI84jITQOxUA==",
"dev": true,
"license": "MIT",
"dependencies": {
"@eslint-community/eslint-utils": "^4.7.0",
"@typescript-eslint/scope-manager": "8.50.1",
"@typescript-eslint/types": "8.50.1",
"@typescript-eslint/typescript-estree": "8.50.1"
"@typescript-eslint/scope-manager": "8.51.0",
"@typescript-eslint/types": "8.51.0",
"@typescript-eslint/typescript-estree": "8.51.0"
},
"engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
@@ -3106,13 +3107,13 @@
}
},
"node_modules/@typescript-eslint/visitor-keys": {
"version": "8.50.1",
"resolved": "https://registry.npmmirror.com/@typescript-eslint/visitor-keys/-/visitor-keys-8.50.1.tgz",
"integrity": "sha512-IrDKrw7pCRUR94zeuCSUWQ+w8JEf5ZX5jl/e6AHGSLi1/zIr0lgutfn/7JpfCey+urpgQEdrZVYzCaVVKiTwhQ==",
"version": "8.51.0",
"resolved": "https://registry.npmmirror.com/@typescript-eslint/visitor-keys/-/visitor-keys-8.51.0.tgz",
"integrity": "sha512-mM/JRQOzhVN1ykejrvwnBRV3+7yTKK8tVANVN3o1O0t0v7o+jqdVu9crPy5Y9dov15TJk/FTIgoUGHrTOVL3Zg==",
"dev": true,
"license": "MIT",
"dependencies": {
"@typescript-eslint/types": "8.50.1",
"@typescript-eslint/types": "8.51.0",
"eslint-visitor-keys": "^4.2.1"
},
"engines": {
@@ -5733,6 +5734,8 @@
"integrity": "sha512-QsCdAUHAmiDeKeaNojb1OHOPF7NjcWPBR7obdu3NwH2a/oyQaLg5d0aaCy/9My6CdPChYF07dvz5chaXBGaD4g==",
"dev": true,
"license": "MIT",
"optional": true,
"peer": true,
"dependencies": {
"@types/node": "^20.0.0",
"@types/whatwg-mimetype": "^3.0.2",
@@ -5748,6 +5751,8 @@
"integrity": "sha512-ZsJzA5thDQMSQO788d7IocwwQbI8B5OPzmqNvpf3NY/+MHDAS759Wo0gd2WQeXYt5AAAQjzcrTVC6SKCuYgoCQ==",
"dev": true,
"license": "MIT",
"optional": true,
"peer": true,
"dependencies": {
"undici-types": "~6.21.0"
}
@@ -5757,7 +5762,9 @@
"resolved": "https://registry.npmmirror.com/undici-types/-/undici-types-6.21.0.tgz",
"integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==",
"dev": true,
"license": "MIT"
"license": "MIT",
"optional": true,
"peer": true
},
"node_modules/has-flag": {
"version": "4.0.0",
@@ -8160,9 +8167,9 @@
}
},
"node_modules/ts-api-utils": {
"version": "2.1.0",
"resolved": "https://registry.npmmirror.com/ts-api-utils/-/ts-api-utils-2.1.0.tgz",
"integrity": "sha512-CUgTZL1irw8u29bzrOD/nH85jqyc74D6SshFgujOIA7osm2Rz7dYH77agkx7H4FBNxDq7Cjf+IjaX/8zwFW+ZQ==",
"version": "2.4.0",
"resolved": "https://registry.npmmirror.com/ts-api-utils/-/ts-api-utils-2.4.0.tgz",
"integrity": "sha512-3TaVTaAv2gTiMB35i3FiGJaRfwb3Pyn/j3m/bfAvGe8FB7CF6u+LMYqYlDh7reQf7UNvoTvdfAqHGmPGOSsPmA==",
"dev": true,
"license": "MIT",
"engines": {
@@ -8231,16 +8238,16 @@
}
},
"node_modules/typescript-eslint": {
"version": "8.50.1",
"resolved": "https://registry.npmmirror.com/typescript-eslint/-/typescript-eslint-8.50.1.tgz",
"integrity": "sha512-ytTHO+SoYSbhAH9CrYnMhiLx8To6PSSvqnvXyPUgPETCvB6eBKmTI9w6XMPS3HsBRGkwTVBX+urA8dYQx6bHfQ==",
"version": "8.51.0",
"resolved": "https://registry.npmmirror.com/typescript-eslint/-/typescript-eslint-8.51.0.tgz",
"integrity": "sha512-jh8ZuM5oEh2PSdyQG9YAEM1TCGuWenLSuSUhf/irbVUNW9O5FhbFVONviN2TgMTBnUmyHv7E56rYnfLZK6TkiA==",
"dev": true,
"license": "MIT",
"dependencies": {
"@typescript-eslint/eslint-plugin": "8.50.1",
"@typescript-eslint/parser": "8.50.1",
"@typescript-eslint/typescript-estree": "8.50.1",
"@typescript-eslint/utils": "8.50.1"
"@typescript-eslint/eslint-plugin": "8.51.0",
"@typescript-eslint/parser": "8.51.0",
"@typescript-eslint/typescript-estree": "8.51.0",
"@typescript-eslint/utils": "8.51.0"
},
"engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
@@ -8946,13 +8953,13 @@
}
},
"node_modules/vue-i18n": {
"version": "11.2.7",
"resolved": "https://registry.npmmirror.com/vue-i18n/-/vue-i18n-11.2.7.tgz",
"integrity": "sha512-LPv8bAY5OA0UvFEXl4vBQOBqJzRrlExy92tWgRuwW7tbykHf7CH71G2Y4TM2OwGcIS4+hyqKHS2EVBqaYwPY9Q==",
"version": "11.2.8",
"resolved": "https://registry.npmmirror.com/vue-i18n/-/vue-i18n-11.2.8.tgz",
"integrity": "sha512-vJ123v/PXCZntd6Qj5Jumy7UBmIuE92VrtdX+AXr+1WzdBHojiBxnAxdfctUFL+/JIN+VQH4BhsfTtiGsvVObg==",
"license": "MIT",
"dependencies": {
"@intlify/core-base": "11.2.7",
"@intlify/shared": "11.2.7",
"@intlify/core-base": "11.2.8",
"@intlify/shared": "11.2.8",
"@vue/devtools-api": "^6.5.0"
},
"engines": {
@@ -9041,6 +9048,8 @@
"integrity": "sha512-nt+N2dzIutVRxARx1nghPKGv1xHikU7HKdfafKkLNLindmPU/ch3U31NOCGGA/dmPcmb1VlofO0vnKAcsm0o/Q==",
"dev": true,
"license": "MIT",
"optional": true,
"peer": true,
"engines": {
"node": ">=12"
}

View File

@@ -183,7 +183,7 @@ const selectLanguage = (languageId: SupportedLanguage) => {
try {
const view = editorStore.currentEditor;
const state = view.state;
const dispatch = view.dispatch;
const dispatch = view.dispatch.bind(view);
const [targetLanguage, autoDetect] = languageId === 'auto'
? ['text', true]

View File

@@ -92,8 +92,14 @@ export const useEditorStore = defineStore('editor', () => {
// 滚轮缩放扩展
const wheelZoomExtension = createWheelZoomExtension({
increaseFontSize: () => configStore.increaseFontSizeLocal(),
decreaseFontSize: () => configStore.decreaseFontSizeLocal(),
increaseFontSize: () => {
configStore.increaseFontSizeLocal();
applyFontSettings();
},
decreaseFontSize: () => {
configStore.decreaseFontSizeLocal();
applyFontSettings();
},
onSave: () => configStore.saveFontSize(),
saveDelay: 1000
});

View File

@@ -8,6 +8,7 @@ import { EditorView } from "@codemirror/view";
import { Command } from "@codemirror/view";
import { LANGUAGES } from "./lang-parser/languages";
import { USER_EVENTS, codeBlockEvent, CONTENT_EDIT } from "./annotation";
import * as runtime from "@wailsio/runtime";
/**
* 构建块分隔符正则表达式
@@ -62,29 +63,37 @@ function copiedRange(state: EditorState, forCut: boolean = false) {
*/
export const codeBlockCopyCut = EditorView.domEventHandlers({
copy(event, view) {
event.preventDefault();
let { text } = copiedRange(view.state);
// 将块分隔符替换为双换行符
text = text.replaceAll(blockSeparatorRegex, "\n\n");
const data = event.clipboardData;
if (data) {
event.preventDefault();
data.clearData();
data.setData("text/plain", text);
}
// 优先使用 Wails 原生剪贴板 API
runtime.Clipboard.SetText(text).catch(() => {
// 降级方案:使用浏览器剪贴板
const data = event.clipboardData;
if (data) {
data.clearData();
data.setData("text/plain", text);
}
});
},
cut(event, view) {
event.preventDefault();
let { text, ranges } = copiedRange(view.state, true);
// 将块分隔符替换为双换行符
text = text.replaceAll(blockSeparatorRegex, "\n\n");
const data = event.clipboardData;
if (data) {
event.preventDefault();
data.clearData();
data.setData("text/plain", text);
}
// 优先使用 Wails 原生剪贴板 API
runtime.Clipboard.SetText(text).catch(() => {
// 降级方案:使用浏览器剪贴板
const data = event.clipboardData;
if (data) {
data.clearData();
data.setData("text/plain", text);
}
});
if (!view.state.readOnly) {
view.dispatch({
@@ -94,20 +103,52 @@ export const codeBlockCopyCut = EditorView.domEventHandlers({
annotations: [codeBlockEvent.of(CONTENT_EDIT)],
});
}
},
paste(event, view) {
if (view.state.readOnly) {
return false;
}
event.preventDefault();
// 使用 Wails 原生剪贴板 API
runtime.Clipboard.Text()
.then(text => {
if (text) {
doPaste(view, text);
}
})
.catch(error => {
console.error('[Clipboard] Failed to read from system clipboard:', error);
const data = event.clipboardData;
if (data) {
const text = data.getData("text/plain");
if (text) {
doPaste(view, text);
}
}
});
return true;
}
});
/**
* 复制和剪切的通用函数
* 复制和剪切的通用函数 - 使用 Wails 原生剪贴板 API
*/
const copyCut = (view: EditorView, cut: boolean): boolean => {
let { text, ranges } = copiedRange(view.state, cut);
// 将块分隔符替换为双换行符
text = text.replaceAll(blockSeparatorRegex, "\n\n");
if (navigator.clipboard && navigator.clipboard.writeText) {
navigator.clipboard.writeText(text);
}
runtime.Clipboard.SetText(text).catch(err => {
console.error('[Clipboard] Failed to write to system clipboard:', err);
if (navigator.clipboard && navigator.clipboard.writeText) {
navigator.clipboard.writeText(text);
}
});
if (cut && !view.state.readOnly) {
view.dispatch({
@@ -166,20 +207,32 @@ export const cutCommand: Command = (view) => {
};
/**
* 粘贴命令
* 粘贴命令 - 使用 Wails 原生剪贴板 API
*/
export const pasteCommand: Command = (view) => {
if (navigator.clipboard && navigator.clipboard.readText) {
navigator.clipboard.readText()
.then(text => {
// 使用 Wails 原生剪贴板 API正确处理系统编码
runtime.Clipboard.Text()
.then(text => {
if (text) {
doPaste(view, text);
})
.catch(err => {
console.error('Failed to read from clipboard:', err);
});
} else {
console.warn('The clipboard API is not available, please use your browser\'s native paste feature');
}
}
})
.catch(err => {
console.error('[Clipboard] Failed to read from system clipboard:', err);
if (navigator.clipboard && navigator.clipboard.readText) {
navigator.clipboard.readText()
.then(text => {
if (text) {
doPaste(view, text);
}
})
.catch(fallbackErr => {
console.error('[Clipboard] Fallback also failed:', fallbackErr);
});
}
});
return true;
};

View File

@@ -68,13 +68,20 @@ function createDetectionMap(): Map<string, SupportedLanguage> {
LANGUAGES.forEach(lang => {
if (lang.detectIds) {
lang.detectIds.forEach(detectId => {
map.set(detectId, lang.token);
// 保留首个映射,避免重复 detectId 覆盖更基础的语言,例如 js -> ts。
if (!map.has(detectId)) {
map.set(detectId, lang.token);
}
});
}
});
return map;
}
function createWorkerUrl(): URL {
return new URL(`${import.meta.env.BASE_URL}langdetect-worker.js`, window.location.href);
}
/**
* 检测ID到语言token的映射表
*/
@@ -131,7 +138,7 @@ class LanguageDetectionWorker {
*/
private initWorker(): void {
try {
this.worker = new Worker('/langdetect-worker.js');
this.worker = new Worker(createWorkerUrl());
this.worker.onmessage = (event) => {
const response: WorkerResponse = event.data;
const request = this.pendingRequests.get(response.idx);

View File

@@ -46,10 +46,10 @@ function collectBlocksFromTree(tree: Tree, state: EditorState): Block[] | null {
if (child.type.id === BlockDelimiter) {
delimiter = { from: child.from, to: child.to };
const delimiterText = doc.sliceString(child.from, child.to);
const match = delimiterText.match(/∞∞∞([a-zA-Z0-9_-]+)(-a)?\n/);
if (match) {
language = match[1] || DEFAULT_LANGUAGE;
auto = match[2] === '-a';
const delimiterInfo = parseDelimiter(delimiterText);
if (delimiterInfo) {
language = delimiterInfo.language;
auto = delimiterInfo.auto;
} else {
child.node.firstChild?.cursor().iterate(langChild => {
if (langChild.type.id === BlockLanguage) {

View File

@@ -87,7 +87,7 @@ export interface EditorOptions {
// 分隔符格式常量
export const DELIMITER_REGEX = /^\n∞∞∞([a-zA-Z0-9_-]+)(-a)?\n/gm;
export const DELIMITER_REGEX = /^\n∞∞∞([a-zA-Z0-9_]+)(-a)?\n/gm;
export const DELIMITER_PREFIX = '\n∞∞∞';
export const DELIMITER_SUFFIX = '\n';
export const AUTO_DETECT_SUFFIX = '-a';

View File

@@ -1 +1 @@
VERSION=1.5.6
VERSION=1.5.7