From a3952b35a4fb9d43eb9f23e721489db48678650c Mon Sep 17 00:00:00 2001 From: Nuckyz <61953774+Nuckyz@users.noreply.github.com> Date: Sun, 3 Nov 2024 11:11:31 -0300 Subject: [PATCH 1/4] wip --- package.json | 1 + pnpm-lock.yaml | 132 ++++++++++-------- src/plugins/_api/memberListDecorators.ts | 2 +- src/plugins/_api/messageAccessories.ts | 2 +- src/plugins/_api/messageDecorations.ts | 2 +- src/plugins/_api/messageEvents.ts | 2 +- src/plugins/_api/messagePopover.ts | 4 +- src/plugins/_api/serverList.ts | 6 +- src/plugins/_core/settings.tsx | 4 +- src/plugins/_core/supportHelper.tsx | 2 +- .../accountPanelServerProfile/index.tsx | 2 +- src/plugins/betterFolders/index.tsx | 4 +- src/plugins/decor/index.tsx | 2 +- src/plugins/friendsSince/index.tsx | 4 +- src/plugins/memberCount/index.tsx | 2 +- src/plugins/noUnblockToJump/index.ts | 6 +- src/plugins/volumeBooster/index.ts | 2 +- src/plugins/webContextMenus.web/index.ts | 12 +- src/utils/intlHash.ts | 53 +++++++ src/utils/patches.ts | 18 ++- 20 files changed, 168 insertions(+), 94 deletions(-) create mode 100644 src/utils/intlHash.ts diff --git a/package.json b/package.json index 9d5ad3e5..63ff0678 100644 --- a/package.json +++ b/package.json @@ -35,6 +35,7 @@ "testTsc": "tsc --noEmit" }, "dependencies": { + "@intrnl/xxhash64": "^0.1.2", "@sapphi-red/web-noise-suppressor": "0.3.5", "@vap/core": "0.0.12", "@vap/shiki": "0.10.5", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index eaa6b537..eeec0536 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -9,13 +9,16 @@ patchedDependencies: hash: japuwsqfkulviwgkm4kd2oi3ky path: patches/eslint-plugin-path-alias@2.1.0.patch eslint@9.8.0: - hash: xm46kqcmdgzlmm4aifkfpxaho4 + hash: pxhhii6sqtzo2kyx3geekthd3a path: patches/eslint@9.8.0.patch importers: .: dependencies: + '@intrnl/xxhash64': + specifier: ^0.1.2 + version: 0.1.2 '@sapphi-red/web-noise-suppressor': specifier: 0.3.5 version: 0.3.5 @@ -43,7 +46,7 @@ importers: devDependencies: '@stylistic/eslint-plugin': specifier: ^2.6.1 - version: 2.6.1(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4))(typescript@5.5.4) + version: 2.6.1(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a))(typescript@5.5.4) '@types/chrome': specifier: ^0.0.269 version: 0.0.269 @@ -76,22 +79,22 @@ importers: version: 0.15.18 eslint: specifier: ^9.8.0 - version: 9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4) + version: 9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a) eslint-import-resolver-alias: specifier: ^1.1.2 - version: 1.1.2(eslint-plugin-import@2.29.1(@typescript-eslint/parser@8.0.0(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4))(typescript@5.5.4))(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4))) + version: 1.1.2(eslint-plugin-import@2.29.1(@typescript-eslint/parser@8.0.0(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a))(typescript@5.5.4))(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a))) eslint-plugin-path-alias: specifier: 2.1.0 - version: 2.1.0(patch_hash=japuwsqfkulviwgkm4kd2oi3ky)(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4)) + version: 2.1.0(patch_hash=japuwsqfkulviwgkm4kd2oi3ky)(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a)) eslint-plugin-simple-header: specifier: ^1.1.1 version: 1.1.1 eslint-plugin-simple-import-sort: specifier: ^12.1.1 - version: 12.1.1(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4)) + version: 12.1.1(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a)) eslint-plugin-unused-imports: specifier: ^4.0.1 - version: 4.0.1(@typescript-eslint/eslint-plugin@8.0.0(@typescript-eslint/parser@8.0.0(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4))(typescript@5.5.4))(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4))(typescript@5.5.4))(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4)) + version: 4.0.1(@typescript-eslint/eslint-plugin@8.0.0(@typescript-eslint/parser@8.0.0(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a))(typescript@5.5.4))(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a))(typescript@5.5.4))(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a)) highlight.js: specifier: 10.7.3 version: 10.7.3 @@ -130,7 +133,7 @@ importers: version: 5.5.4 typescript-eslint: specifier: ^8.0.0 - version: 8.0.0(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4))(typescript@5.5.4) + version: 8.0.0(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a))(typescript@5.5.4) typescript-transform-paths: specifier: ^3.4.7 version: 3.4.7(typescript@5.5.4) @@ -537,6 +540,9 @@ packages: resolution: {integrity: sha512-d2CGZR2o7fS6sWB7DG/3a95bGKQyHMACZ5aW8qGkkqQpUoZV6C0X7Pc7l4ZNMZkfNBf4VWNe9E1jRsf0G146Ew==} engines: {node: '>=18.18'} + '@intrnl/xxhash64@0.1.2': + resolution: {integrity: sha512-1+lx7j99fdph+uy3EnjQyr39KQZ7LP56+aWOr6finJWpgYpvb7XrhFUqDwnEk/wpPC98nCjAT6RulpW3crWjlg==} + '@jridgewell/gen-mapping@0.3.5': resolution: {integrity: sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==} engines: {node: '>=6.0.0'} @@ -2902,9 +2908,9 @@ snapshots: '@esbuild/win32-x64@0.21.5': optional: true - '@eslint-community/eslint-utils@4.4.0(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4))': + '@eslint-community/eslint-utils@4.4.0(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a))': dependencies: - eslint: 9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4) + eslint: 9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a) eslint-visitor-keys: 3.4.2 '@eslint-community/regexpp@4.11.0': {} @@ -2939,6 +2945,8 @@ snapshots: '@humanwhocodes/retry@0.3.0': {} + '@intrnl/xxhash64@0.1.2': {} + '@jridgewell/gen-mapping@0.3.5': dependencies: '@jridgewell/set-array': 1.2.1 @@ -2988,49 +2996,49 @@ snapshots: '@sapphi-red/web-noise-suppressor@0.3.5': {} - '@stylistic/eslint-plugin-js@2.6.1(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4))': + '@stylistic/eslint-plugin-js@2.6.1(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a))': dependencies: '@types/eslint': 9.6.0 acorn: 8.12.1 - eslint: 9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4) + eslint: 9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a) eslint-visitor-keys: 4.0.0 espree: 10.1.0 - '@stylistic/eslint-plugin-jsx@2.6.1(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4))': + '@stylistic/eslint-plugin-jsx@2.6.1(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a))': dependencies: - '@stylistic/eslint-plugin-js': 2.6.1(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4)) + '@stylistic/eslint-plugin-js': 2.6.1(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a)) '@types/eslint': 9.6.0 - eslint: 9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4) + eslint: 9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a) estraverse: 5.3.0 picomatch: 4.0.2 - '@stylistic/eslint-plugin-plus@2.6.1(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4))(typescript@5.5.4)': + '@stylistic/eslint-plugin-plus@2.6.1(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a))(typescript@5.5.4)': dependencies: '@types/eslint': 9.6.0 - '@typescript-eslint/utils': 8.0.0(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4))(typescript@5.5.4) - eslint: 9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4) + '@typescript-eslint/utils': 8.0.0(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a))(typescript@5.5.4) + eslint: 9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a) transitivePeerDependencies: - supports-color - typescript - '@stylistic/eslint-plugin-ts@2.6.1(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4))(typescript@5.5.4)': + '@stylistic/eslint-plugin-ts@2.6.1(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a))(typescript@5.5.4)': dependencies: - '@stylistic/eslint-plugin-js': 2.6.1(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4)) + '@stylistic/eslint-plugin-js': 2.6.1(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a)) '@types/eslint': 9.6.0 - '@typescript-eslint/utils': 8.0.0(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4))(typescript@5.5.4) - eslint: 9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4) + '@typescript-eslint/utils': 8.0.0(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a))(typescript@5.5.4) + eslint: 9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a) transitivePeerDependencies: - supports-color - typescript - '@stylistic/eslint-plugin@2.6.1(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4))(typescript@5.5.4)': + '@stylistic/eslint-plugin@2.6.1(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a))(typescript@5.5.4)': dependencies: - '@stylistic/eslint-plugin-js': 2.6.1(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4)) - '@stylistic/eslint-plugin-jsx': 2.6.1(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4)) - '@stylistic/eslint-plugin-plus': 2.6.1(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4))(typescript@5.5.4) - '@stylistic/eslint-plugin-ts': 2.6.1(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4))(typescript@5.5.4) + '@stylistic/eslint-plugin-js': 2.6.1(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a)) + '@stylistic/eslint-plugin-jsx': 2.6.1(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a)) + '@stylistic/eslint-plugin-plus': 2.6.1(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a))(typescript@5.5.4) + '@stylistic/eslint-plugin-ts': 2.6.1(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a))(typescript@5.5.4) '@types/eslint': 9.6.0 - eslint: 9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4) + eslint: 9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a) transitivePeerDependencies: - supports-color - typescript @@ -3125,15 +3133,15 @@ snapshots: dependencies: '@types/node': 22.0.3 - '@typescript-eslint/eslint-plugin@8.0.0(@typescript-eslint/parser@8.0.0(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4))(typescript@5.5.4))(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4))(typescript@5.5.4)': + '@typescript-eslint/eslint-plugin@8.0.0(@typescript-eslint/parser@8.0.0(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a))(typescript@5.5.4))(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a))(typescript@5.5.4)': dependencies: '@eslint-community/regexpp': 4.11.0 - '@typescript-eslint/parser': 8.0.0(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4))(typescript@5.5.4) + '@typescript-eslint/parser': 8.0.0(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a))(typescript@5.5.4) '@typescript-eslint/scope-manager': 8.0.0 - '@typescript-eslint/type-utils': 8.0.0(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4))(typescript@5.5.4) - '@typescript-eslint/utils': 8.0.0(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4))(typescript@5.5.4) + '@typescript-eslint/type-utils': 8.0.0(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a))(typescript@5.5.4) + '@typescript-eslint/utils': 8.0.0(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a))(typescript@5.5.4) '@typescript-eslint/visitor-keys': 8.0.0 - eslint: 9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4) + eslint: 9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a) graphemer: 1.4.0 ignore: 5.3.1 natural-compare: 1.4.0 @@ -3143,14 +3151,14 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/parser@8.0.0(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4))(typescript@5.5.4)': + '@typescript-eslint/parser@8.0.0(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a))(typescript@5.5.4)': dependencies: '@typescript-eslint/scope-manager': 8.0.0 '@typescript-eslint/types': 8.0.0 '@typescript-eslint/typescript-estree': 8.0.0(typescript@5.5.4) '@typescript-eslint/visitor-keys': 8.0.0 debug: 4.3.6 - eslint: 9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4) + eslint: 9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a) optionalDependencies: typescript: 5.5.4 transitivePeerDependencies: @@ -3161,10 +3169,10 @@ snapshots: '@typescript-eslint/types': 8.0.0 '@typescript-eslint/visitor-keys': 8.0.0 - '@typescript-eslint/type-utils@8.0.0(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4))(typescript@5.5.4)': + '@typescript-eslint/type-utils@8.0.0(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a))(typescript@5.5.4)': dependencies: '@typescript-eslint/typescript-estree': 8.0.0(typescript@5.5.4) - '@typescript-eslint/utils': 8.0.0(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4))(typescript@5.5.4) + '@typescript-eslint/utils': 8.0.0(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a))(typescript@5.5.4) debug: 4.3.6 ts-api-utils: 1.3.0(typescript@5.5.4) optionalDependencies: @@ -3190,13 +3198,13 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/utils@8.0.0(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4))(typescript@5.5.4)': + '@typescript-eslint/utils@8.0.0(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a))(typescript@5.5.4)': dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4)) + '@eslint-community/eslint-utils': 4.4.0(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a)) '@typescript-eslint/scope-manager': 8.0.0 '@typescript-eslint/types': 8.0.0 '@typescript-eslint/typescript-estree': 8.0.0(typescript@5.5.4) - eslint: 9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4) + eslint: 9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a) transitivePeerDependencies: - supports-color - typescript @@ -3848,9 +3856,9 @@ snapshots: optionalDependencies: source-map: 0.6.1 - eslint-import-resolver-alias@1.1.2(eslint-plugin-import@2.29.1(@typescript-eslint/parser@8.0.0(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4))(typescript@5.5.4))(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4))): + eslint-import-resolver-alias@1.1.2(eslint-plugin-import@2.29.1(@typescript-eslint/parser@8.0.0(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a))(typescript@5.5.4))(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a))): dependencies: - eslint-plugin-import: 2.29.1(@typescript-eslint/parser@8.0.0(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4))(typescript@5.5.4))(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4)) + eslint-plugin-import: 2.29.1(@typescript-eslint/parser@8.0.0(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a))(typescript@5.5.4))(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a)) eslint-import-resolver-node@0.3.9: dependencies: @@ -3860,17 +3868,17 @@ snapshots: transitivePeerDependencies: - supports-color - eslint-module-utils@2.8.1(@typescript-eslint/parser@8.0.0(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4))(typescript@5.5.4))(eslint-import-resolver-node@0.3.9)(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4)): + eslint-module-utils@2.8.1(@typescript-eslint/parser@8.0.0(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a))(typescript@5.5.4))(eslint-import-resolver-node@0.3.9)(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a)): dependencies: debug: 3.2.7 optionalDependencies: - '@typescript-eslint/parser': 8.0.0(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4))(typescript@5.5.4) - eslint: 9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4) + '@typescript-eslint/parser': 8.0.0(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a))(typescript@5.5.4) + eslint: 9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a) eslint-import-resolver-node: 0.3.9 transitivePeerDependencies: - supports-color - eslint-plugin-import@2.29.1(@typescript-eslint/parser@8.0.0(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4))(typescript@5.5.4))(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4)): + eslint-plugin-import@2.29.1(@typescript-eslint/parser@8.0.0(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a))(typescript@5.5.4))(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a)): dependencies: array-includes: 3.1.8 array.prototype.findlastindex: 1.2.5 @@ -3878,9 +3886,9 @@ snapshots: array.prototype.flatmap: 1.3.2 debug: 3.2.7 doctrine: 2.1.0 - eslint: 9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4) + eslint: 9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a) eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.8.1(@typescript-eslint/parser@8.0.0(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4))(typescript@5.5.4))(eslint-import-resolver-node@0.3.9)(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4)) + eslint-module-utils: 2.8.1(@typescript-eslint/parser@8.0.0(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a))(typescript@5.5.4))(eslint-import-resolver-node@0.3.9)(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a)) hasown: 2.0.2 is-core-module: 2.15.0 is-glob: 4.0.3 @@ -3891,15 +3899,15 @@ snapshots: semver: 6.3.1 tsconfig-paths: 3.15.0 optionalDependencies: - '@typescript-eslint/parser': 8.0.0(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4))(typescript@5.5.4) + '@typescript-eslint/parser': 8.0.0(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a))(typescript@5.5.4) transitivePeerDependencies: - eslint-import-resolver-typescript - eslint-import-resolver-webpack - supports-color - eslint-plugin-path-alias@2.1.0(patch_hash=japuwsqfkulviwgkm4kd2oi3ky)(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4)): + eslint-plugin-path-alias@2.1.0(patch_hash=japuwsqfkulviwgkm4kd2oi3ky)(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a)): dependencies: - eslint: 9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4) + eslint: 9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a) find-pkg: 2.0.0 get-tsconfig: 4.7.5 nanomatch: 1.2.13 @@ -3908,16 +3916,16 @@ snapshots: eslint-plugin-simple-header@1.1.1: {} - eslint-plugin-simple-import-sort@12.1.1(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4)): + eslint-plugin-simple-import-sort@12.1.1(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a)): dependencies: - eslint: 9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4) + eslint: 9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a) - eslint-plugin-unused-imports@4.0.1(@typescript-eslint/eslint-plugin@8.0.0(@typescript-eslint/parser@8.0.0(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4))(typescript@5.5.4))(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4))(typescript@5.5.4))(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4)): + eslint-plugin-unused-imports@4.0.1(@typescript-eslint/eslint-plugin@8.0.0(@typescript-eslint/parser@8.0.0(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a))(typescript@5.5.4))(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a))(typescript@5.5.4))(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a)): dependencies: - eslint: 9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4) + eslint: 9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a) eslint-rule-composer: 0.3.0 optionalDependencies: - '@typescript-eslint/eslint-plugin': 8.0.0(@typescript-eslint/parser@8.0.0(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4))(typescript@5.5.4))(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4))(typescript@5.5.4) + '@typescript-eslint/eslint-plugin': 8.0.0(@typescript-eslint/parser@8.0.0(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a))(typescript@5.5.4))(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a))(typescript@5.5.4) eslint-rule-composer@0.3.0: {} @@ -3932,9 +3940,9 @@ snapshots: eslint-visitor-keys@4.0.0: {} - eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4): + eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a): dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4)) + '@eslint-community/eslint-utils': 4.4.0(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a)) '@eslint-community/regexpp': 4.11.0 '@eslint/config-array': 0.17.1 '@eslint/eslintrc': 3.1.0 @@ -5232,11 +5240,11 @@ snapshots: is-typed-array: 1.1.13 possible-typed-array-names: 1.0.0 - typescript-eslint@8.0.0(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4))(typescript@5.5.4): + typescript-eslint@8.0.0(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a))(typescript@5.5.4): dependencies: - '@typescript-eslint/eslint-plugin': 8.0.0(@typescript-eslint/parser@8.0.0(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4))(typescript@5.5.4))(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4))(typescript@5.5.4) - '@typescript-eslint/parser': 8.0.0(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4))(typescript@5.5.4) - '@typescript-eslint/utils': 8.0.0(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4))(typescript@5.5.4) + '@typescript-eslint/eslint-plugin': 8.0.0(@typescript-eslint/parser@8.0.0(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a))(typescript@5.5.4))(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a))(typescript@5.5.4) + '@typescript-eslint/parser': 8.0.0(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a))(typescript@5.5.4) + '@typescript-eslint/utils': 8.0.0(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a))(typescript@5.5.4) optionalDependencies: typescript: 5.5.4 transitivePeerDependencies: diff --git a/src/plugins/_api/memberListDecorators.ts b/src/plugins/_api/memberListDecorators.ts index 5e3e5ed1..8e5fe50a 100644 --- a/src/plugins/_api/memberListDecorators.ts +++ b/src/plugins/_api/memberListDecorators.ts @@ -31,7 +31,7 @@ export default definePlugin({ match: /let\{[^}]*lostPermissionTooltipText:\i[^}]*\}=(\i),/, replace: "$&vencordProps=$1," }, { - match: /\.Messages\.GUILD_OWNER(?=.+?decorators:(\i)\(\)).+?\1=?\(\)=>.+?children:\[/, + match: /#intl(?=.+?decorators:(\i)\(\)).+?\1=?\(\)=>.+?children:\[/, replace: "$&...(typeof vencordProps=='undefined'?[]:Vencord.Api.MemberListDecorators.__getDecorators(vencordProps))," } ] diff --git a/src/plugins/_api/messageAccessories.ts b/src/plugins/_api/messageAccessories.ts index a98fdb32..dbf36338 100644 --- a/src/plugins/_api/messageAccessories.ts +++ b/src/plugins/_api/messageAccessories.ts @@ -25,7 +25,7 @@ export default definePlugin({ authors: [Devs.Cyn], patches: [ { - find: ".Messages.REMOVE_ATTACHMENT_BODY", + find: "#intl", replacement: { match: /(?<=.container\)?,children:)(\[.+?\])/, replace: "Vencord.Api.MessageAccessories._modifyAccessories($1,this.props)", diff --git a/src/plugins/_api/messageDecorations.ts b/src/plugins/_api/messageDecorations.ts index b41ec0be..a5fb50c6 100644 --- a/src/plugins/_api/messageDecorations.ts +++ b/src/plugins/_api/messageDecorations.ts @@ -27,7 +27,7 @@ export default definePlugin({ { find: '"Message Username"', replacement: { - match: /\.Messages\.GUILD_COMMUNICATION_DISABLED_BOTTOM_SHEET_TITLE.+?}\),\i(?=\])/, + match: /#intl.+?}\),\i(?=\])/, replace: "$&,...Vencord.Api.MessageDecorations.__addDecorationsToMessage(arguments[0])" } } diff --git a/src/plugins/_api/messageEvents.ts b/src/plugins/_api/messageEvents.ts index 0347d544..a7ddaa49 100644 --- a/src/plugins/_api/messageEvents.ts +++ b/src/plugins/_api/messageEvents.ts @@ -25,7 +25,7 @@ export default definePlugin({ authors: [Devs.Arjix, Devs.hunt, Devs.Ven], patches: [ { - find: ".Messages.EDIT_TEXTAREA_HELP", + find: "#intl", replacement: { match: /(?<=,channel:\i\}\)\.then\().+?(?=return \i\.content!==this\.props\.message\.content&&\i\((.+?)\))/, replace: (match, args) => "" + diff --git a/src/plugins/_api/messagePopover.ts b/src/plugins/_api/messagePopover.ts index 57b9b119..c904017c 100644 --- a/src/plugins/_api/messagePopover.ts +++ b/src/plugins/_api/messagePopover.ts @@ -24,9 +24,9 @@ export default definePlugin({ description: "API to add buttons to message popovers.", authors: [Devs.KingFish, Devs.Ven, Devs.Nuckyz], patches: [{ - find: "Messages.MESSAGE_UTILITIES_A11Y_LABEL", + find: "#intl", replacement: { - match: /\.jsx\)\((\i\.\i),\{label:\i\.\i\.Messages\.MESSAGE_ACTION_REPLY.{0,200}?"reply-self".{0,50}?\}\):null(?=,.+?message:(\i))/, + match: /\.jsx\)\((\i\.\i),\{label:\i\.\i\.string\(\i\.\i#intl.{0,200}?"reply-self".{0,50}?\}\):null(?=,.+?message:(\i))/, replace: "$&,Vencord.Api.MessagePopover._buildPopoverElements($1,$2)" } }], diff --git a/src/plugins/_api/serverList.ts b/src/plugins/_api/serverList.ts index 7904e78b..6b14de70 100644 --- a/src/plugins/_api/serverList.ts +++ b/src/plugins/_api/serverList.ts @@ -25,16 +25,16 @@ export default definePlugin({ description: "Api required for plugins that modify the server list", patches: [ { - find: "Messages.DISCODO_DISABLED", + find: "#intl", replacement: { - match: /(?<=Messages\.DISCODO_DISABLED.+?return)(\(.{0,75}?tutorialContainer.+?}\))(?=}function)/, + match: /(?<=#intl.+?return)(\(.{0,75}?tutorialContainer.+?}\))(?=}function)/, replace: "[$1].concat(Vencord.Api.ServerList.renderAll(Vencord.Api.ServerList.ServerListRenderPosition.Above))" } }, { find: "Messages.SERVERS,children", replacement: { - match: /(?<=Messages\.SERVERS,children:)\i\.map\(\i\)/, + match: /(?<=#intl\),children:)\i\.map\(\i\)/, replace: "Vencord.Api.ServerList.renderAll(Vencord.Api.ServerList.ServerListRenderPosition.In).concat($&)" } } diff --git a/src/plugins/_core/settings.tsx b/src/plugins/_core/settings.tsx index 329c389c..c99e606f 100644 --- a/src/plugins/_core/settings.tsx +++ b/src/plugins/_core/settings.tsx @@ -57,7 +57,7 @@ export default definePlugin({ ] }, { - find: "Messages.ACTIVITY_SETTINGS", + find: "#intl", replacement: [ { match: /(?<=section:(.{0,50})\.DIVIDER\}\))([,;])(?=.{0,200}(\i)\.push.{0,100}label:(\i)\.header)/, @@ -70,7 +70,7 @@ export default definePlugin({ ] }, { - find: "Messages.USER_SETTINGS_ACTIONS_MENU_LABEL", + find: "#intl", replacement: { match: /(?<=function\((\i),\i\)\{)(?=let \i=Object.values\(\i.\i\).*?(\i\.\i)\.open\()/, replace: "$2.open($1);return;" diff --git a/src/plugins/_core/supportHelper.tsx b/src/plugins/_core/supportHelper.tsx index cb8d1d05..dee61a57 100644 --- a/src/plugins/_core/supportHelper.tsx +++ b/src/plugins/_core/supportHelper.tsx @@ -147,7 +147,7 @@ export default definePlugin({ settings, patches: [{ - find: ".BEGINNING_DM.format", + find: "#intl", replacement: { match: /BEGINNING_DM\.format\(\{.+?\}\),(?=.{0,300}(\i)\.isMultiUserDM)/, replace: "$& $self.renderContributorDmWarningCard({ channel: $1 })," diff --git a/src/plugins/accountPanelServerProfile/index.tsx b/src/plugins/accountPanelServerProfile/index.tsx index fe5df48a..dc95fabd 100644 --- a/src/plugins/accountPanelServerProfile/index.tsx +++ b/src/plugins/accountPanelServerProfile/index.tsx @@ -69,7 +69,7 @@ export default definePlugin({ patches: [ { - find: ".Messages.ACCOUNT_SPEAKING_WHILE_MUTED", + find: "#intl", group: true, replacement: [ { diff --git a/src/plugins/betterFolders/index.tsx b/src/plugins/betterFolders/index.tsx index bb1a67eb..8a8de9d9 100644 --- a/src/plugins/betterFolders/index.tsx +++ b/src/plugins/betterFolders/index.tsx @@ -172,7 +172,7 @@ export default definePlugin({ // Disable expanding and collapsing folders transition in the normal GuildsBar sidebar { predicate: () => !settings.store.keepIcons, - match: /(?<=\.Messages\.SERVER_FOLDER_PLACEHOLDER.+?useTransition\)\()/, + match: /(?<=#intl.+?useTransition\)\()/, replace: "$self.shouldShowTransition(arguments[0])&&" }, // If we are rendering the normal GuildsBar sidebar, we avoid rendering guilds from folders that are expanded @@ -205,7 +205,7 @@ export default definePlugin({ } }, { - find: ".Messages.DISCODO_DISABLED", + find: "#intl", predicate: () => settings.store.closeAllHomeButton, replacement: { // Close all folders when clicking the home button diff --git a/src/plugins/decor/index.tsx b/src/plugins/decor/index.tsx index 33d1d40b..f3a28105 100644 --- a/src/plugins/decor/index.tsx +++ b/src/plugins/decor/index.tsx @@ -41,7 +41,7 @@ export default definePlugin({ { find: "DefaultCustomizationSections", replacement: { - match: /(?<=USER_SETTINGS_AVATAR_DECORATION},"decoration"\),)/, + match: /(?<=#intl\)},"decoration"\),)/, replace: "$self.DecorSection()," } }, diff --git a/src/plugins/friendsSince/index.tsx b/src/plugins/friendsSince/index.tsx index cb5634c8..5cb2f674 100644 --- a/src/plugins/friendsSince/index.tsx +++ b/src/plugins/friendsSince/index.tsx @@ -26,7 +26,7 @@ export default definePlugin({ { find: ".PANEL}),nicknameIcons", replacement: { - match: /USER_PROFILE_MEMBER_SINCE,.{0,100}userId:(\i\.id)}\)}\)/, + match: /#intl,.{0,100}userId:(\i\.id)}\)}\)/, replace: "$&,$self.FriendsSinceComponent({userId:$1,isSidebar:true})" } }, @@ -34,7 +34,7 @@ export default definePlugin({ { find: "action:\"PRESS_APP_CONNECTION\"", replacement: { - match: /USER_PROFILE_MEMBER_SINCE,.{0,100}userId:(\i\.id),.{0,100}}\)}\),/, + match: /#intl,.{0,100}userId:(\i\.id),.{0,100}}\)}\),/, replace: "$&,$self.FriendsSinceComponent({userId:$1,isSidebar:false})," } } diff --git a/src/plugins/memberCount/index.tsx b/src/plugins/memberCount/index.tsx index 85dcc4b2..6809832a 100644 --- a/src/plugins/memberCount/index.tsx +++ b/src/plugins/memberCount/index.tsx @@ -74,7 +74,7 @@ export default definePlugin({ { find: ".invitesDisabledTooltip", replacement: { - match: /\.VIEW_AS_ROLES_MENTIONS_WARNING.{0,100}(?=])/, + match: /#intl.{0,100}(?=])/, replace: "$&,$self.renderTooltip(arguments[0].guild)" }, predicate: () => settings.store.toolTip diff --git a/src/plugins/noUnblockToJump/index.ts b/src/plugins/noUnblockToJump/index.ts index cba6bb9a..e2207880 100644 --- a/src/plugins/noUnblockToJump/index.ts +++ b/src/plugins/noUnblockToJump/index.ts @@ -28,21 +28,21 @@ export default definePlugin({ { find: '.id,"Search Results"', replacement: { - match: /if\(.{1,10}\)(.{1,10}\.show\({.{1,50}UNBLOCK_TO_JUMP_TITLE)/, + match: /if\(.{1,10}\)(.{1,10}\.show\({.{1,50}#intl)/, replace: "if(false)$1" } }, { find: "renderJumpButton()", replacement: { - match: /if\(.{1,10}\)(.{1,10}\.show\({.{1,50}UNBLOCK_TO_JUMP_TITLE)/, + match: /if\(.{1,10}\)(.{1,10}\.show\({.{1,50}#intl)/, replace: "if(false)$1" } }, { find: "flash:!0,returnMessageId", replacement: { - match: /.\?(.{1,10}\.show\({.{1,50}UNBLOCK_TO_JUMP_TITLE)/, + match: /.\?(.{1,10}\.show\({.{1,50}#intl)/, replace: "false?$1" } } diff --git a/src/plugins/volumeBooster/index.ts b/src/plugins/volumeBooster/index.ts index c38b2d1a..36b4ce41 100644 --- a/src/plugins/volumeBooster/index.ts +++ b/src/plugins/volumeBooster/index.ts @@ -57,7 +57,7 @@ export default definePlugin({ patches: [ // Change the max volume for sliders to allow for values above 200 ...[ - ".Messages.USER_VOLUME", + "#intl", "currentVolume:" ].map(find => ({ find, diff --git a/src/plugins/webContextMenus.web/index.ts b/src/plugins/webContextMenus.web/index.ts index bae78010..f5d71c28 100644 --- a/src/plugins/webContextMenus.web/index.ts +++ b/src/plugins/webContextMenus.web/index.ts @@ -127,11 +127,11 @@ export default definePlugin({ replace: "return [true" }, { - match: /(?<=COPY_IMAGE_MENU_ITEM,)action:/, + match: /(?<=#intl,)action:/, replace: "action:()=>$self.copyImage(arguments[0]),oldAction:" }, { - match: /(?<=SAVE_IMAGE_MENU_ITEM,)action:/, + match: /(?<=#intl,)action:/, replace: "action:()=>$self.saveImage(arguments[0]),oldAction:" }, ] @@ -224,10 +224,10 @@ export default definePlugin({ { find: '("interactionUsernameProfile', replacement: - { - match: /\i\.isPlatformEmbedded(?=.{0,50}\.tagName)/, - replace: "true" - }, + { + match: /\i\.isPlatformEmbedded(?=.{0,50}\.tagName)/, + replace: "true" + }, } ], diff --git a/src/utils/intlHash.ts b/src/utils/intlHash.ts new file mode 100644 index 00000000..069f8f80 --- /dev/null +++ b/src/utils/intlHash.ts @@ -0,0 +1,53 @@ +/* eslint-disable simple-header/header */ + +/** + * discord-intl + * + * @copyright 2024 Discord, Inc. + * @link https://github.com/discord/discord-intl + * @license MIT + */ + + +import { hash as h64 } from "@intrnl/xxhash64"; + +const BASE64_TABLE = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""); +const IS_BIG_ENDIAN = (() => { + const array = new Uint8Array(4); + const view = new Uint32Array(array.buffer); + return !((view[0] = 1) & array[0]); +})(); + +function numberToBytes(number: number | bigint) { + number = BigInt(number); + const array: number[] = []; + const byteCount = Math.ceil(Math.floor(Math.log2(Number(number)) + 1) / 8); + for (let i = 0; i < byteCount; i++) { + array.unshift(Number((number >> BigInt(8 * i)) & BigInt(255))); + } + + const bytes = new Uint8Array(array); + // The native `hashToMessageKey` always works in Big/Network Endian bytes, so this array + // needs to be converted to the same endianness to get the same base64 result. + return IS_BIG_ENDIAN ? bytes : bytes.reverse(); +} + +/** + * Returns a consistent, short hash of the given key by first processing it through a hash digest, + * then encoding the first few bytes to base64. + * + * This function is specifically written to mirror the native backend hashing function used by + * `@discord/intl-loader-core`, to be able to hash names at runtime. + */ +export function runtimeHashMessageKey(key: string): string { + const hash = h64(key, 0); + const bytes = numberToBytes(hash); + return [ + BASE64_TABLE[bytes[0] >> 2], + BASE64_TABLE[((bytes[0] & 0x03) << 4) | (bytes[1] >> 4)], + BASE64_TABLE[((bytes[1] & 0x0f) << 2) | (bytes[2] >> 6)], + BASE64_TABLE[bytes[2] & 0x3f], + BASE64_TABLE[bytes[3] >> 2], + BASE64_TABLE[((bytes[3] & 0x03) << 4) | (bytes[3] >> 4)], + ].join(""); +} diff --git a/src/utils/patches.ts b/src/utils/patches.ts index 87f3ce78..b247dd13 100644 --- a/src/utils/patches.ts +++ b/src/utils/patches.ts @@ -16,12 +16,24 @@ * along with this program. If not, see . */ +import { runtimeHashMessageKey } from "./intlHash"; import { Patch, PatchReplacement, ReplaceFn } from "./types"; export function canonicalizeMatch(match: T): T { - if (typeof match === "string") return match; - const canonSource = match.source - .replaceAll("\\i", "[A-Za-z_$][\\w$]*"); + let partialCanon = typeof match === "string" ? match : match.source; + partialCanon = partialCanon.replaceAll(/#intl?<([A-Za-z_$][\w$]*)>/g, (_, key) => { + const hashed = runtimeHashMessageKey(key); + const isStr = typeof match === "string"; + + return /^[\d]/.test(hashed) || !/^[\w$]+$/.test(hashed) + ? isStr ? `["${hashed}` : `(?:\\["${hashed}"\\])` + : isStr ? `.${hashed}` : `(?:\\.${hashed})`; + }); + + if (typeof match === "string") return partialCanon as T; + + const canonSource = partialCanon + .replaceAll(String.raw`\i`, String.raw`(?:[A-Za-z_$][\w$]*)`); return new RegExp(canonSource, match.flags) as T; } From 40b948b626cd54752a228ab88ff2230ef07fc0af Mon Sep 17 00:00:00 2001 From: Nuckyz <61953774+Nuckyz@users.noreply.github.com> Date: Sun, 3 Nov 2024 13:14:48 -0300 Subject: [PATCH 2/4] switch syntax --- pnpm-lock.yaml | 124 +++++++++--------- src/plugins/_api/memberListDecorators.ts | 2 +- src/plugins/_api/messageAccessories.ts | 2 +- src/plugins/_api/messageDecorations.ts | 2 +- src/plugins/_api/messageEvents.ts | 2 +- src/plugins/_api/messagePopover.ts | 4 +- src/plugins/_api/serverList.ts | 8 +- src/plugins/_core/settings.tsx | 4 +- src/plugins/_core/supportHelper.tsx | 2 +- .../accountPanelServerProfile/index.tsx | 2 +- src/plugins/betterFolders/index.tsx | 4 +- src/plugins/decor/index.tsx | 2 +- src/plugins/friendsSince/index.tsx | 4 +- src/plugins/memberCount/index.tsx | 2 +- src/plugins/noUnblockToJump/index.ts | 6 +- src/plugins/volumeBooster/index.ts | 2 +- src/plugins/webContextMenus.web/index.ts | 4 +- src/utils/patches.ts | 13 +- 18 files changed, 95 insertions(+), 94 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index eeec0536..a62c40cd 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -9,7 +9,7 @@ patchedDependencies: hash: japuwsqfkulviwgkm4kd2oi3ky path: patches/eslint-plugin-path-alias@2.1.0.patch eslint@9.8.0: - hash: pxhhii6sqtzo2kyx3geekthd3a + hash: xm46kqcmdgzlmm4aifkfpxaho4 path: patches/eslint@9.8.0.patch importers: @@ -46,7 +46,7 @@ importers: devDependencies: '@stylistic/eslint-plugin': specifier: ^2.6.1 - version: 2.6.1(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a))(typescript@5.5.4) + version: 2.6.1(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4))(typescript@5.5.4) '@types/chrome': specifier: ^0.0.269 version: 0.0.269 @@ -79,22 +79,22 @@ importers: version: 0.15.18 eslint: specifier: ^9.8.0 - version: 9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a) + version: 9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4) eslint-import-resolver-alias: specifier: ^1.1.2 - version: 1.1.2(eslint-plugin-import@2.29.1(@typescript-eslint/parser@8.0.0(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a))(typescript@5.5.4))(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a))) + version: 1.1.2(eslint-plugin-import@2.29.1(@typescript-eslint/parser@8.0.0(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4))(typescript@5.5.4))(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4))) eslint-plugin-path-alias: specifier: 2.1.0 - version: 2.1.0(patch_hash=japuwsqfkulviwgkm4kd2oi3ky)(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a)) + version: 2.1.0(patch_hash=japuwsqfkulviwgkm4kd2oi3ky)(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4)) eslint-plugin-simple-header: specifier: ^1.1.1 version: 1.1.1 eslint-plugin-simple-import-sort: specifier: ^12.1.1 - version: 12.1.1(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a)) + version: 12.1.1(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4)) eslint-plugin-unused-imports: specifier: ^4.0.1 - version: 4.0.1(@typescript-eslint/eslint-plugin@8.0.0(@typescript-eslint/parser@8.0.0(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a))(typescript@5.5.4))(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a))(typescript@5.5.4))(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a)) + version: 4.0.1(@typescript-eslint/eslint-plugin@8.0.0(@typescript-eslint/parser@8.0.0(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4))(typescript@5.5.4))(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4))(typescript@5.5.4))(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4)) highlight.js: specifier: 10.7.3 version: 10.7.3 @@ -133,7 +133,7 @@ importers: version: 5.5.4 typescript-eslint: specifier: ^8.0.0 - version: 8.0.0(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a))(typescript@5.5.4) + version: 8.0.0(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4))(typescript@5.5.4) typescript-transform-paths: specifier: ^3.4.7 version: 3.4.7(typescript@5.5.4) @@ -2908,9 +2908,9 @@ snapshots: '@esbuild/win32-x64@0.21.5': optional: true - '@eslint-community/eslint-utils@4.4.0(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a))': + '@eslint-community/eslint-utils@4.4.0(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4))': dependencies: - eslint: 9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a) + eslint: 9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4) eslint-visitor-keys: 3.4.2 '@eslint-community/regexpp@4.11.0': {} @@ -2996,49 +2996,49 @@ snapshots: '@sapphi-red/web-noise-suppressor@0.3.5': {} - '@stylistic/eslint-plugin-js@2.6.1(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a))': + '@stylistic/eslint-plugin-js@2.6.1(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4))': dependencies: '@types/eslint': 9.6.0 acorn: 8.12.1 - eslint: 9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a) + eslint: 9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4) eslint-visitor-keys: 4.0.0 espree: 10.1.0 - '@stylistic/eslint-plugin-jsx@2.6.1(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a))': + '@stylistic/eslint-plugin-jsx@2.6.1(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4))': dependencies: - '@stylistic/eslint-plugin-js': 2.6.1(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a)) + '@stylistic/eslint-plugin-js': 2.6.1(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4)) '@types/eslint': 9.6.0 - eslint: 9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a) + eslint: 9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4) estraverse: 5.3.0 picomatch: 4.0.2 - '@stylistic/eslint-plugin-plus@2.6.1(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a))(typescript@5.5.4)': + '@stylistic/eslint-plugin-plus@2.6.1(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4))(typescript@5.5.4)': dependencies: '@types/eslint': 9.6.0 - '@typescript-eslint/utils': 8.0.0(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a))(typescript@5.5.4) - eslint: 9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a) + '@typescript-eslint/utils': 8.0.0(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4))(typescript@5.5.4) + eslint: 9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4) transitivePeerDependencies: - supports-color - typescript - '@stylistic/eslint-plugin-ts@2.6.1(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a))(typescript@5.5.4)': + '@stylistic/eslint-plugin-ts@2.6.1(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4))(typescript@5.5.4)': dependencies: - '@stylistic/eslint-plugin-js': 2.6.1(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a)) + '@stylistic/eslint-plugin-js': 2.6.1(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4)) '@types/eslint': 9.6.0 - '@typescript-eslint/utils': 8.0.0(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a))(typescript@5.5.4) - eslint: 9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a) + '@typescript-eslint/utils': 8.0.0(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4))(typescript@5.5.4) + eslint: 9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4) transitivePeerDependencies: - supports-color - typescript - '@stylistic/eslint-plugin@2.6.1(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a))(typescript@5.5.4)': + '@stylistic/eslint-plugin@2.6.1(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4))(typescript@5.5.4)': dependencies: - '@stylistic/eslint-plugin-js': 2.6.1(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a)) - '@stylistic/eslint-plugin-jsx': 2.6.1(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a)) - '@stylistic/eslint-plugin-plus': 2.6.1(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a))(typescript@5.5.4) - '@stylistic/eslint-plugin-ts': 2.6.1(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a))(typescript@5.5.4) + '@stylistic/eslint-plugin-js': 2.6.1(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4)) + '@stylistic/eslint-plugin-jsx': 2.6.1(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4)) + '@stylistic/eslint-plugin-plus': 2.6.1(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4))(typescript@5.5.4) + '@stylistic/eslint-plugin-ts': 2.6.1(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4))(typescript@5.5.4) '@types/eslint': 9.6.0 - eslint: 9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a) + eslint: 9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4) transitivePeerDependencies: - supports-color - typescript @@ -3133,15 +3133,15 @@ snapshots: dependencies: '@types/node': 22.0.3 - '@typescript-eslint/eslint-plugin@8.0.0(@typescript-eslint/parser@8.0.0(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a))(typescript@5.5.4))(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a))(typescript@5.5.4)': + '@typescript-eslint/eslint-plugin@8.0.0(@typescript-eslint/parser@8.0.0(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4))(typescript@5.5.4))(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4))(typescript@5.5.4)': dependencies: '@eslint-community/regexpp': 4.11.0 - '@typescript-eslint/parser': 8.0.0(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a))(typescript@5.5.4) + '@typescript-eslint/parser': 8.0.0(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4))(typescript@5.5.4) '@typescript-eslint/scope-manager': 8.0.0 - '@typescript-eslint/type-utils': 8.0.0(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a))(typescript@5.5.4) - '@typescript-eslint/utils': 8.0.0(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a))(typescript@5.5.4) + '@typescript-eslint/type-utils': 8.0.0(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4))(typescript@5.5.4) + '@typescript-eslint/utils': 8.0.0(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4))(typescript@5.5.4) '@typescript-eslint/visitor-keys': 8.0.0 - eslint: 9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a) + eslint: 9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4) graphemer: 1.4.0 ignore: 5.3.1 natural-compare: 1.4.0 @@ -3151,14 +3151,14 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/parser@8.0.0(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a))(typescript@5.5.4)': + '@typescript-eslint/parser@8.0.0(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4))(typescript@5.5.4)': dependencies: '@typescript-eslint/scope-manager': 8.0.0 '@typescript-eslint/types': 8.0.0 '@typescript-eslint/typescript-estree': 8.0.0(typescript@5.5.4) '@typescript-eslint/visitor-keys': 8.0.0 debug: 4.3.6 - eslint: 9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a) + eslint: 9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4) optionalDependencies: typescript: 5.5.4 transitivePeerDependencies: @@ -3169,10 +3169,10 @@ snapshots: '@typescript-eslint/types': 8.0.0 '@typescript-eslint/visitor-keys': 8.0.0 - '@typescript-eslint/type-utils@8.0.0(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a))(typescript@5.5.4)': + '@typescript-eslint/type-utils@8.0.0(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4))(typescript@5.5.4)': dependencies: '@typescript-eslint/typescript-estree': 8.0.0(typescript@5.5.4) - '@typescript-eslint/utils': 8.0.0(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a))(typescript@5.5.4) + '@typescript-eslint/utils': 8.0.0(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4))(typescript@5.5.4) debug: 4.3.6 ts-api-utils: 1.3.0(typescript@5.5.4) optionalDependencies: @@ -3198,13 +3198,13 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/utils@8.0.0(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a))(typescript@5.5.4)': + '@typescript-eslint/utils@8.0.0(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4))(typescript@5.5.4)': dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a)) + '@eslint-community/eslint-utils': 4.4.0(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4)) '@typescript-eslint/scope-manager': 8.0.0 '@typescript-eslint/types': 8.0.0 '@typescript-eslint/typescript-estree': 8.0.0(typescript@5.5.4) - eslint: 9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a) + eslint: 9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4) transitivePeerDependencies: - supports-color - typescript @@ -3856,9 +3856,9 @@ snapshots: optionalDependencies: source-map: 0.6.1 - eslint-import-resolver-alias@1.1.2(eslint-plugin-import@2.29.1(@typescript-eslint/parser@8.0.0(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a))(typescript@5.5.4))(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a))): + eslint-import-resolver-alias@1.1.2(eslint-plugin-import@2.29.1(@typescript-eslint/parser@8.0.0(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4))(typescript@5.5.4))(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4))): dependencies: - eslint-plugin-import: 2.29.1(@typescript-eslint/parser@8.0.0(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a))(typescript@5.5.4))(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a)) + eslint-plugin-import: 2.29.1(@typescript-eslint/parser@8.0.0(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4))(typescript@5.5.4))(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4)) eslint-import-resolver-node@0.3.9: dependencies: @@ -3868,17 +3868,17 @@ snapshots: transitivePeerDependencies: - supports-color - eslint-module-utils@2.8.1(@typescript-eslint/parser@8.0.0(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a))(typescript@5.5.4))(eslint-import-resolver-node@0.3.9)(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a)): + eslint-module-utils@2.8.1(@typescript-eslint/parser@8.0.0(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4))(typescript@5.5.4))(eslint-import-resolver-node@0.3.9)(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4)): dependencies: debug: 3.2.7 optionalDependencies: - '@typescript-eslint/parser': 8.0.0(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a))(typescript@5.5.4) - eslint: 9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a) + '@typescript-eslint/parser': 8.0.0(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4))(typescript@5.5.4) + eslint: 9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4) eslint-import-resolver-node: 0.3.9 transitivePeerDependencies: - supports-color - eslint-plugin-import@2.29.1(@typescript-eslint/parser@8.0.0(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a))(typescript@5.5.4))(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a)): + eslint-plugin-import@2.29.1(@typescript-eslint/parser@8.0.0(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4))(typescript@5.5.4))(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4)): dependencies: array-includes: 3.1.8 array.prototype.findlastindex: 1.2.5 @@ -3886,9 +3886,9 @@ snapshots: array.prototype.flatmap: 1.3.2 debug: 3.2.7 doctrine: 2.1.0 - eslint: 9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a) + eslint: 9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4) eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.8.1(@typescript-eslint/parser@8.0.0(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a))(typescript@5.5.4))(eslint-import-resolver-node@0.3.9)(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a)) + eslint-module-utils: 2.8.1(@typescript-eslint/parser@8.0.0(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4))(typescript@5.5.4))(eslint-import-resolver-node@0.3.9)(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4)) hasown: 2.0.2 is-core-module: 2.15.0 is-glob: 4.0.3 @@ -3899,15 +3899,15 @@ snapshots: semver: 6.3.1 tsconfig-paths: 3.15.0 optionalDependencies: - '@typescript-eslint/parser': 8.0.0(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a))(typescript@5.5.4) + '@typescript-eslint/parser': 8.0.0(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4))(typescript@5.5.4) transitivePeerDependencies: - eslint-import-resolver-typescript - eslint-import-resolver-webpack - supports-color - eslint-plugin-path-alias@2.1.0(patch_hash=japuwsqfkulviwgkm4kd2oi3ky)(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a)): + eslint-plugin-path-alias@2.1.0(patch_hash=japuwsqfkulviwgkm4kd2oi3ky)(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4)): dependencies: - eslint: 9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a) + eslint: 9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4) find-pkg: 2.0.0 get-tsconfig: 4.7.5 nanomatch: 1.2.13 @@ -3916,16 +3916,16 @@ snapshots: eslint-plugin-simple-header@1.1.1: {} - eslint-plugin-simple-import-sort@12.1.1(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a)): + eslint-plugin-simple-import-sort@12.1.1(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4)): dependencies: - eslint: 9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a) + eslint: 9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4) - eslint-plugin-unused-imports@4.0.1(@typescript-eslint/eslint-plugin@8.0.0(@typescript-eslint/parser@8.0.0(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a))(typescript@5.5.4))(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a))(typescript@5.5.4))(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a)): + eslint-plugin-unused-imports@4.0.1(@typescript-eslint/eslint-plugin@8.0.0(@typescript-eslint/parser@8.0.0(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4))(typescript@5.5.4))(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4))(typescript@5.5.4))(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4)): dependencies: - eslint: 9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a) + eslint: 9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4) eslint-rule-composer: 0.3.0 optionalDependencies: - '@typescript-eslint/eslint-plugin': 8.0.0(@typescript-eslint/parser@8.0.0(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a))(typescript@5.5.4))(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a))(typescript@5.5.4) + '@typescript-eslint/eslint-plugin': 8.0.0(@typescript-eslint/parser@8.0.0(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4))(typescript@5.5.4))(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4))(typescript@5.5.4) eslint-rule-composer@0.3.0: {} @@ -3940,9 +3940,9 @@ snapshots: eslint-visitor-keys@4.0.0: {} - eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a): + eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4): dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a)) + '@eslint-community/eslint-utils': 4.4.0(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4)) '@eslint-community/regexpp': 4.11.0 '@eslint/config-array': 0.17.1 '@eslint/eslintrc': 3.1.0 @@ -5240,11 +5240,11 @@ snapshots: is-typed-array: 1.1.13 possible-typed-array-names: 1.0.0 - typescript-eslint@8.0.0(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a))(typescript@5.5.4): + typescript-eslint@8.0.0(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4))(typescript@5.5.4): dependencies: - '@typescript-eslint/eslint-plugin': 8.0.0(@typescript-eslint/parser@8.0.0(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a))(typescript@5.5.4))(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a))(typescript@5.5.4) - '@typescript-eslint/parser': 8.0.0(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a))(typescript@5.5.4) - '@typescript-eslint/utils': 8.0.0(eslint@9.8.0(patch_hash=pxhhii6sqtzo2kyx3geekthd3a))(typescript@5.5.4) + '@typescript-eslint/eslint-plugin': 8.0.0(@typescript-eslint/parser@8.0.0(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4))(typescript@5.5.4))(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4))(typescript@5.5.4) + '@typescript-eslint/parser': 8.0.0(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4))(typescript@5.5.4) + '@typescript-eslint/utils': 8.0.0(eslint@9.8.0(patch_hash=xm46kqcmdgzlmm4aifkfpxaho4))(typescript@5.5.4) optionalDependencies: typescript: 5.5.4 transitivePeerDependencies: diff --git a/src/plugins/_api/memberListDecorators.ts b/src/plugins/_api/memberListDecorators.ts index 8e5fe50a..0dba3608 100644 --- a/src/plugins/_api/memberListDecorators.ts +++ b/src/plugins/_api/memberListDecorators.ts @@ -31,7 +31,7 @@ export default definePlugin({ match: /let\{[^}]*lostPermissionTooltipText:\i[^}]*\}=(\i),/, replace: "$&vencordProps=$1," }, { - match: /#intl(?=.+?decorators:(\i)\(\)).+?\1=?\(\)=>.+?children:\[/, + match: /#{intl::GUILD_OWNER}(?=.+?decorators:(\i)\(\)).+?\1=?\(\)=>.+?children:\[/, replace: "$&...(typeof vencordProps=='undefined'?[]:Vencord.Api.MemberListDecorators.__getDecorators(vencordProps))," } ] diff --git a/src/plugins/_api/messageAccessories.ts b/src/plugins/_api/messageAccessories.ts index dbf36338..0ba2a031 100644 --- a/src/plugins/_api/messageAccessories.ts +++ b/src/plugins/_api/messageAccessories.ts @@ -25,7 +25,7 @@ export default definePlugin({ authors: [Devs.Cyn], patches: [ { - find: "#intl", + find: "#{intl::REMOVE_ATTACHMENT_BODY}", replacement: { match: /(?<=.container\)?,children:)(\[.+?\])/, replace: "Vencord.Api.MessageAccessories._modifyAccessories($1,this.props)", diff --git a/src/plugins/_api/messageDecorations.ts b/src/plugins/_api/messageDecorations.ts index a5fb50c6..fb63a6dd 100644 --- a/src/plugins/_api/messageDecorations.ts +++ b/src/plugins/_api/messageDecorations.ts @@ -27,7 +27,7 @@ export default definePlugin({ { find: '"Message Username"', replacement: { - match: /#intl.+?}\),\i(?=\])/, + match: /#{intl::GUILD_COMMUNICATION_DISABLED_BOTTOM_SHEET_TITLE}.+?}\),\i(?=\])/, replace: "$&,...Vencord.Api.MessageDecorations.__addDecorationsToMessage(arguments[0])" } } diff --git a/src/plugins/_api/messageEvents.ts b/src/plugins/_api/messageEvents.ts index a7ddaa49..0101b02c 100644 --- a/src/plugins/_api/messageEvents.ts +++ b/src/plugins/_api/messageEvents.ts @@ -25,7 +25,7 @@ export default definePlugin({ authors: [Devs.Arjix, Devs.hunt, Devs.Ven], patches: [ { - find: "#intl", + find: "#{intl::EDIT_TEXTAREA_HELP}", replacement: { match: /(?<=,channel:\i\}\)\.then\().+?(?=return \i\.content!==this\.props\.message\.content&&\i\((.+?)\))/, replace: (match, args) => "" + diff --git a/src/plugins/_api/messagePopover.ts b/src/plugins/_api/messagePopover.ts index c904017c..21e5accd 100644 --- a/src/plugins/_api/messagePopover.ts +++ b/src/plugins/_api/messagePopover.ts @@ -24,9 +24,9 @@ export default definePlugin({ description: "API to add buttons to message popovers.", authors: [Devs.KingFish, Devs.Ven, Devs.Nuckyz], patches: [{ - find: "#intl", + find: "#{intl::MESSAGE_UTILITIES_A11Y_LABEL}", replacement: { - match: /\.jsx\)\((\i\.\i),\{label:\i\.\i\.string\(\i\.\i#intl.{0,200}?"reply-self".{0,50}?\}\):null(?=,.+?message:(\i))/, + match: /\.jsx\)\((\i\.\i),\{label:\i\.\i\.string\(\i\.\i#{intl::MESSAGE_ACTION_REPLY}.{0,200}?"reply-self".{0,50}?\}\):null(?=,.+?message:(\i))/, replace: "$&,Vencord.Api.MessagePopover._buildPopoverElements($1,$2)" } }], diff --git a/src/plugins/_api/serverList.ts b/src/plugins/_api/serverList.ts index 6b14de70..6597c121 100644 --- a/src/plugins/_api/serverList.ts +++ b/src/plugins/_api/serverList.ts @@ -25,16 +25,16 @@ export default definePlugin({ description: "Api required for plugins that modify the server list", patches: [ { - find: "#intl", + find: "#{intl::DISCODO_DISABLED}", replacement: { - match: /(?<=#intl.+?return)(\(.{0,75}?tutorialContainer.+?}\))(?=}function)/, + match: /(?<=#{intl::DISCODO_DISABLED}.+?return)(\(.{0,75}?tutorialContainer.+?}\))(?=}function)/, replace: "[$1].concat(Vencord.Api.ServerList.renderAll(Vencord.Api.ServerList.ServerListRenderPosition.Above))" } }, { - find: "Messages.SERVERS,children", + find: "#{intl::SERVERS},children", replacement: { - match: /(?<=#intl\),children:)\i\.map\(\i\)/, + match: /(?<=#{intl::SERVERS}\),children:)\i\.map\(\i\)/, replace: "Vencord.Api.ServerList.renderAll(Vencord.Api.ServerList.ServerListRenderPosition.In).concat($&)" } } diff --git a/src/plugins/_core/settings.tsx b/src/plugins/_core/settings.tsx index c99e606f..939cf83a 100644 --- a/src/plugins/_core/settings.tsx +++ b/src/plugins/_core/settings.tsx @@ -57,7 +57,7 @@ export default definePlugin({ ] }, { - find: "#intl", + find: "#{intl::ACTIVITY_SETTINGS}", replacement: [ { match: /(?<=section:(.{0,50})\.DIVIDER\}\))([,;])(?=.{0,200}(\i)\.push.{0,100}label:(\i)\.header)/, @@ -70,7 +70,7 @@ export default definePlugin({ ] }, { - find: "#intl", + find: "#{intl::USER_SETTINGS_ACTIONS_MENU_LABEL}", replacement: { match: /(?<=function\((\i),\i\)\{)(?=let \i=Object.values\(\i.\i\).*?(\i\.\i)\.open\()/, replace: "$2.open($1);return;" diff --git a/src/plugins/_core/supportHelper.tsx b/src/plugins/_core/supportHelper.tsx index dee61a57..32647509 100644 --- a/src/plugins/_core/supportHelper.tsx +++ b/src/plugins/_core/supportHelper.tsx @@ -147,7 +147,7 @@ export default definePlugin({ settings, patches: [{ - find: "#intl", + find: "#{intl::BEGINNING_DM}", replacement: { match: /BEGINNING_DM\.format\(\{.+?\}\),(?=.{0,300}(\i)\.isMultiUserDM)/, replace: "$& $self.renderContributorDmWarningCard({ channel: $1 })," diff --git a/src/plugins/accountPanelServerProfile/index.tsx b/src/plugins/accountPanelServerProfile/index.tsx index dc95fabd..fcecffb1 100644 --- a/src/plugins/accountPanelServerProfile/index.tsx +++ b/src/plugins/accountPanelServerProfile/index.tsx @@ -69,7 +69,7 @@ export default definePlugin({ patches: [ { - find: "#intl", + find: "#{intl::ACCOUNT_SPEAKING_WHILE_MUTED}", group: true, replacement: [ { diff --git a/src/plugins/betterFolders/index.tsx b/src/plugins/betterFolders/index.tsx index 8a8de9d9..3af5af66 100644 --- a/src/plugins/betterFolders/index.tsx +++ b/src/plugins/betterFolders/index.tsx @@ -172,7 +172,7 @@ export default definePlugin({ // Disable expanding and collapsing folders transition in the normal GuildsBar sidebar { predicate: () => !settings.store.keepIcons, - match: /(?<=#intl.+?useTransition\)\()/, + match: /(?<=#{intl::SERVER_FOLDER_PLACEHOLDER}.+?useTransition\)\()/, replace: "$self.shouldShowTransition(arguments[0])&&" }, // If we are rendering the normal GuildsBar sidebar, we avoid rendering guilds from folders that are expanded @@ -205,7 +205,7 @@ export default definePlugin({ } }, { - find: "#intl", + find: "#{intl::DISCODO_DISABLED}", predicate: () => settings.store.closeAllHomeButton, replacement: { // Close all folders when clicking the home button diff --git a/src/plugins/decor/index.tsx b/src/plugins/decor/index.tsx index f3a28105..69a7a1a5 100644 --- a/src/plugins/decor/index.tsx +++ b/src/plugins/decor/index.tsx @@ -41,7 +41,7 @@ export default definePlugin({ { find: "DefaultCustomizationSections", replacement: { - match: /(?<=#intl\)},"decoration"\),)/, + match: /(?<=#{intl::USER_SETTINGS_AVATAR_DECORATION}\)},"decoration"\),)/, replace: "$self.DecorSection()," } }, diff --git a/src/plugins/friendsSince/index.tsx b/src/plugins/friendsSince/index.tsx index 5cb2f674..a2a1311d 100644 --- a/src/plugins/friendsSince/index.tsx +++ b/src/plugins/friendsSince/index.tsx @@ -26,7 +26,7 @@ export default definePlugin({ { find: ".PANEL}),nicknameIcons", replacement: { - match: /#intl,.{0,100}userId:(\i\.id)}\)}\)/, + match: /#{intl::USER_PROFILE_MEMBER_SINCE},.{0,100}userId:(\i\.id)}\)}\)/, replace: "$&,$self.FriendsSinceComponent({userId:$1,isSidebar:true})" } }, @@ -34,7 +34,7 @@ export default definePlugin({ { find: "action:\"PRESS_APP_CONNECTION\"", replacement: { - match: /#intl,.{0,100}userId:(\i\.id),.{0,100}}\)}\),/, + match: /#{intl::USER_PROFILE_MEMBER_SINCE},.{0,100}userId:(\i\.id),.{0,100}}\)}\),/, replace: "$&,$self.FriendsSinceComponent({userId:$1,isSidebar:false})," } } diff --git a/src/plugins/memberCount/index.tsx b/src/plugins/memberCount/index.tsx index 6809832a..67bbc4ce 100644 --- a/src/plugins/memberCount/index.tsx +++ b/src/plugins/memberCount/index.tsx @@ -74,7 +74,7 @@ export default definePlugin({ { find: ".invitesDisabledTooltip", replacement: { - match: /#intl.{0,100}(?=])/, + match: /#{intl::VIEW_AS_ROLES_MENTIONS_WARNING}.{0,100}(?=])/, replace: "$&,$self.renderTooltip(arguments[0].guild)" }, predicate: () => settings.store.toolTip diff --git a/src/plugins/noUnblockToJump/index.ts b/src/plugins/noUnblockToJump/index.ts index e2207880..cde0e19e 100644 --- a/src/plugins/noUnblockToJump/index.ts +++ b/src/plugins/noUnblockToJump/index.ts @@ -28,21 +28,21 @@ export default definePlugin({ { find: '.id,"Search Results"', replacement: { - match: /if\(.{1,10}\)(.{1,10}\.show\({.{1,50}#intl)/, + match: /if\(.{1,10}\)(.{1,10}\.show\({.{1,50}#{intl::UNBLOCK_TO_JUMP_TITLE})/, replace: "if(false)$1" } }, { find: "renderJumpButton()", replacement: { - match: /if\(.{1,10}\)(.{1,10}\.show\({.{1,50}#intl)/, + match: /if\(.{1,10}\)(.{1,10}\.show\({.{1,50}#{intl::UNBLOCK_TO_JUMP_TITLE})/, replace: "if(false)$1" } }, { find: "flash:!0,returnMessageId", replacement: { - match: /.\?(.{1,10}\.show\({.{1,50}#intl)/, + match: /.\?(.{1,10}\.show\({.{1,50}#{intl::UNBLOCK_TO_JUMP_TITLE})/, replace: "false?$1" } } diff --git a/src/plugins/volumeBooster/index.ts b/src/plugins/volumeBooster/index.ts index 36b4ce41..241111d4 100644 --- a/src/plugins/volumeBooster/index.ts +++ b/src/plugins/volumeBooster/index.ts @@ -57,7 +57,7 @@ export default definePlugin({ patches: [ // Change the max volume for sliders to allow for values above 200 ...[ - "#intl", + "#{intl::USER_VOLUME}", "currentVolume:" ].map(find => ({ find, diff --git a/src/plugins/webContextMenus.web/index.ts b/src/plugins/webContextMenus.web/index.ts index f5d71c28..4ed7e922 100644 --- a/src/plugins/webContextMenus.web/index.ts +++ b/src/plugins/webContextMenus.web/index.ts @@ -127,11 +127,11 @@ export default definePlugin({ replace: "return [true" }, { - match: /(?<=#intl,)action:/, + match: /(?<=#{intl::COPY_IMAGE_MENU_ITEM},)action:/, replace: "action:()=>$self.copyImage(arguments[0]),oldAction:" }, { - match: /(?<=#intl,)action:/, + match: /(?<=#{intl::SAVE_IMAGE_MENU_ITEM},)action:/, replace: "action:()=>$self.saveImage(arguments[0]),oldAction:" }, ] diff --git a/src/utils/patches.ts b/src/utils/patches.ts index b247dd13..855432cc 100644 --- a/src/utils/patches.ts +++ b/src/utils/patches.ts @@ -21,19 +21,20 @@ import { Patch, PatchReplacement, ReplaceFn } from "./types"; export function canonicalizeMatch(match: T): T { let partialCanon = typeof match === "string" ? match : match.source; - partialCanon = partialCanon.replaceAll(/#intl?<([A-Za-z_$][\w$]*)>/g, (_, key) => { + partialCanon = partialCanon.replaceAll(/#{intl::([A-Za-z_$][\w$]*)}/g, (_, key) => { const hashed = runtimeHashMessageKey(key); const isStr = typeof match === "string"; return /^[\d]/.test(hashed) || !/^[\w$]+$/.test(hashed) - ? isStr ? `["${hashed}` : `(?:\\["${hashed}"\\])` - : isStr ? `.${hashed}` : `(?:\\.${hashed})`; + ? isStr ? `["${hashed}` : String.raw`(?:\["${hashed}"\])` + : isStr ? `.${hashed}` : String.raw`(?:\.${hashed})`; }); - if (typeof match === "string") return partialCanon as T; + if (typeof match === "string") { + return partialCanon as T; + } - const canonSource = partialCanon - .replaceAll(String.raw`\i`, String.raw`(?:[A-Za-z_$][\w$]*)`); + const canonSource = partialCanon.replaceAll(String.raw`\i`, String.raw`(?:[A-Za-z_$][\w$]*)`); return new RegExp(canonSource, match.flags) as T; } From f2130453388451e76c7b0ed15eec740cfa0fa3bb Mon Sep 17 00:00:00 2001 From: Nuckyz <61953774+Nuckyz@users.noreply.github.com> Date: Sun, 3 Nov 2024 13:43:13 -0300 Subject: [PATCH 3/4] Fix more patches --- src/plugins/_api/serverList.ts | 2 +- src/plugins/alwaysAnimate/index.ts | 2 +- src/plugins/anonymiseFileNames/index.tsx | 4 ++-- src/plugins/banger/index.ts | 2 +- src/plugins/betterGifAltText/index.ts | 4 ++-- src/plugins/betterNotes/index.tsx | 4 ++-- src/plugins/betterSessions/index.tsx | 2 +- src/plugins/betterSettings/index.tsx | 4 ++-- src/plugins/copyFileContents/index.tsx | 2 +- src/plugins/crashHandler/index.ts | 2 +- src/plugins/disableCallIdle/index.ts | 2 +- src/plugins/fakeNitro/index.tsx | 6 +++--- src/plugins/fakeProfileThemes/index.tsx | 2 +- src/plugins/forceOwnerCrown/index.ts | 2 +- src/plugins/friendsSince/index.tsx | 4 ++-- src/plugins/gameActivityToggle/index.tsx | 2 +- src/plugins/greetStickerPicker/index.tsx | 2 +- src/plugins/ignoreActivities/index.tsx | 4 ++-- src/plugins/implicitRelationships/index.ts | 4 ++-- src/plugins/invisibleChat.desktop/index.tsx | 2 +- src/plugins/loadingQuotes/index.ts | 2 +- src/plugins/messageLogger/index.tsx | 4 ++-- src/plugins/moreUserTags/index.tsx | 6 +++--- src/plugins/noBlockedMessages/index.ts | 2 +- src/plugins/noOnboardingDelay/index.ts | 2 +- src/plugins/normalizeMessageLinks/index.ts | 2 +- src/plugins/pauseInvitesForever/index.tsx | 6 +++--- src/plugins/permissionFreeWill/index.ts | 4 ++-- src/plugins/replyTimestamp/index.tsx | 2 +- src/plugins/reverseImageSearch/index.tsx | 2 +- src/plugins/roleColorEverywhere/index.tsx | 4 ++-- src/plugins/shikiCodeblocks.desktop/index.ts | 2 +- src/plugins/showAllMessageButtons/index.ts | 2 +- src/plugins/showHiddenChannels/index.tsx | 10 +++++----- src/plugins/showHiddenThings/index.ts | 2 +- src/plugins/showTimeoutDuration/index.tsx | 4 ++-- src/plugins/sortFriendRequests/index.tsx | 2 +- src/plugins/startupTimings/index.tsx | 2 +- src/plugins/themeAttributes/index.ts | 2 +- src/plugins/unlockedAvatarZoom/index.ts | 2 +- src/plugins/userVoiceShow/index.tsx | 2 +- src/plugins/validReply/index.ts | 4 ++-- src/plugins/webContextMenus.web/index.ts | 4 ++-- 43 files changed, 66 insertions(+), 66 deletions(-) diff --git a/src/plugins/_api/serverList.ts b/src/plugins/_api/serverList.ts index 6597c121..dfd40de7 100644 --- a/src/plugins/_api/serverList.ts +++ b/src/plugins/_api/serverList.ts @@ -32,7 +32,7 @@ export default definePlugin({ } }, { - find: "#{intl::SERVERS},children", + find: "#{intl::SERVERS}),children", replacement: { match: /(?<=#{intl::SERVERS}\),children:)\i\.map\(\i\)/, replace: "Vencord.Api.ServerList.renderAll(Vencord.Api.ServerList.ServerListRenderPosition.In).concat($&)" diff --git a/src/plugins/alwaysAnimate/index.ts b/src/plugins/alwaysAnimate/index.ts index 20cb4f97..97593990 100644 --- a/src/plugins/alwaysAnimate/index.ts +++ b/src/plugins/alwaysAnimate/index.ts @@ -41,7 +41,7 @@ export default definePlugin({ }, { // Status emojis - find: ".Messages.GUILD_OWNER,", + find: "#{intl::GUILD_OWNER}", replacement: { match: /(?<=\.activityEmoji,.+?animate:)\i/, replace: "!0" diff --git a/src/plugins/anonymiseFileNames/index.tsx b/src/plugins/anonymiseFileNames/index.tsx index 0e97bc7f..21f4e5c8 100644 --- a/src/plugins/anonymiseFileNames/index.tsx +++ b/src/plugins/anonymiseFileNames/index.tsx @@ -86,9 +86,9 @@ export default definePlugin({ } }, { - find: ".Messages.ATTACHMENT_UTILITIES_SPOILER", + find: "#{intl::ATTACHMENT_UTILITIES_SPOILER}", replacement: { - match: /(?<=children:\[)(?=.{10,80}tooltip:.{0,100}\i\.\i\.Messages\.ATTACHMENT_UTILITIES_SPOILER)/, + match: /(?<=children:\[)(?=.{10,80}tooltip:.{0,100}#{intl::ATTACHMENT_UTILITIES_SPOILER})/, replace: "arguments[0].canEdit!==false?$self.renderIcon(arguments[0]):null," }, }, diff --git a/src/plugins/banger/index.ts b/src/plugins/banger/index.ts index eca80f9e..f13fd351 100644 --- a/src/plugins/banger/index.ts +++ b/src/plugins/banger/index.ts @@ -36,7 +36,7 @@ export default definePlugin({ settings, patches: [ { - find: "BAN_CONFIRM_TITLE.", + find: "#{intl::BAN_CONFIRM_TITLE}", replacement: { match: /src:\i\("?\d+"?\)/g, replace: "src:$self.source" diff --git a/src/plugins/betterGifAltText/index.ts b/src/plugins/betterGifAltText/index.ts index 55fa2252..5d9b188e 100644 --- a/src/plugins/betterGifAltText/index.ts +++ b/src/plugins/betterGifAltText/index.ts @@ -34,9 +34,9 @@ export default definePlugin({ }, }, { - find: ".Messages.GIF,", + find: "#{intl::GIF}", replacement: { - match: /alt:(\i)=(\i\.\i\.Messages\.GIF)(?=,[^}]*\}=(\i))/, + match: /alt:(\i)=(\i\.\i\.string\(\i\.\i#{intl::GIF}\))(?=,[^}]*\}=(\i))/, replace: // rename prop so we can always use default value "alt_$$:$1=$self.altify($3)||$2", diff --git a/src/plugins/betterNotes/index.tsx b/src/plugins/betterNotes/index.tsx index 63fcf647..68aa70c6 100644 --- a/src/plugins/betterNotes/index.tsx +++ b/src/plugins/betterNotes/index.tsx @@ -63,9 +63,9 @@ export default definePlugin({ } }, { - find: "Messages.NOTE_PLACEHOLDER", + find: "#{intl::NOTE_PLACEHOLDER}", replacement: { - match: /\.NOTE_PLACEHOLDER,/, + match: /#{intl::NOTE_PLACEHOLDER}\),/, replace: "$&spellCheck:!$self.noSpellCheck," } } diff --git a/src/plugins/betterSessions/index.tsx b/src/plugins/betterSessions/index.tsx index 598e0104..9347c398 100644 --- a/src/plugins/betterSessions/index.tsx +++ b/src/plugins/betterSessions/index.tsx @@ -60,7 +60,7 @@ export default definePlugin({ patches: [ { - find: "Messages.AUTH_SESSIONS_SESSION_LOG_OUT", + find: "#{intl::AUTH_SESSIONS_SESSION_LOG_OUT}", replacement: [ // Replace children with a single label with state { diff --git a/src/plugins/betterSettings/index.tsx b/src/plugins/betterSettings/index.tsx index f0dd89a7..15618faf 100644 --- a/src/plugins/betterSettings/index.tsx +++ b/src/plugins/betterSettings/index.tsx @@ -111,7 +111,7 @@ export default definePlugin({ predicate: () => settings.store.disableFade }, { // Load menu TOC eagerly - find: "Messages.USER_SETTINGS_WITH_BUILD_OVERRIDE.format", + find: "#{intl::USER_SETTINGS_WITH_BUILD_OVERRIDE}", replacement: { match: /(\i)\(this,"handleOpenSettingsContextMenu",.{0,100}?null!=\i&&.{0,100}?(await Promise\.all[^};]*?\)\)).*?,(?=\1\(this)/, replace: "$&(async ()=>$2)()," @@ -119,7 +119,7 @@ export default definePlugin({ predicate: () => settings.store.eagerLoad }, { // Settings cog context menu - find: "Messages.USER_SETTINGS_ACTIONS_MENU_LABEL", + find: "#{intl::USER_SETTINGS_ACTIONS_MENU_LABEL}", replacement: [ { match: /(EXPERIMENTS:.+?)(\(0,\i.\i\)\(\))(?=\.filter\(\i=>\{let\{section:\i\}=)/, diff --git a/src/plugins/copyFileContents/index.tsx b/src/plugins/copyFileContents/index.tsx index 13b64917..28b5bb92 100644 --- a/src/plugins/copyFileContents/index.tsx +++ b/src/plugins/copyFileContents/index.tsx @@ -25,7 +25,7 @@ export default definePlugin({ authors: [Devs.Obsidian, Devs.Nuckyz], patches: [ { - find: ".Messages.PREVIEW_BYTES_LEFT.format(", + find: "#{intl::PREVIEW_BYTES_LEFT}", replacement: { match: /\.footerGap.+?url:\i,fileName:\i,fileSize:\i}\),(?<=fileContents:(\i),bytesLeft:(\i).+?)/g, replace: "$&$self.addCopyButton({fileContents:$1,bytesLeft:$2})," diff --git a/src/plugins/crashHandler/index.ts b/src/plugins/crashHandler/index.ts index 221b115f..57703a56 100644 --- a/src/plugins/crashHandler/index.ts +++ b/src/plugins/crashHandler/index.ts @@ -67,7 +67,7 @@ export default definePlugin({ patches: [ { - find: ".Messages.ERRORS_UNEXPECTED_CRASH", + find: "#{intl:;ERRORS_UNEXPECTED_CRASH}", replacement: { match: /this\.setState\((.+?)\)/, replace: "$self.handleCrash(this,$1);" diff --git a/src/plugins/disableCallIdle/index.ts b/src/plugins/disableCallIdle/index.ts index c36fce6c..1fdc862c 100644 --- a/src/plugins/disableCallIdle/index.ts +++ b/src/plugins/disableCallIdle/index.ts @@ -27,7 +27,7 @@ export default definePlugin({ authors: [Devs.Nuckyz], patches: [ { - find: ".Messages.BOT_CALL_IDLE_DISCONNECT", + find: "#{intl::BOT_CALL_IDLE_DISCONNECT}", replacement: { match: /,?(?=\i\(this,"idleTimeout",new \i\.\i\))/, replace: ";return;" diff --git a/src/plugins/fakeNitro/index.tsx b/src/plugins/fakeNitro/index.tsx index ca348c61..087bb555 100644 --- a/src/plugins/fakeNitro/index.tsx +++ b/src/plugins/fakeNitro/index.tsx @@ -285,7 +285,7 @@ export default definePlugin({ }, // Remove boost requirements to stream with high quality { - find: "STREAM_FPS_OPTION.format", + find: "#{intl::STREAM_FPS_OPTION}", predicate: () => settings.store.enableStreamQualityBypass, replacement: { match: /guildPremiumTier:\i\.\i\.TIER_\d,?/g, @@ -356,7 +356,7 @@ export default definePlugin({ ] }, { - find: ".Messages.STICKER_POPOUT_UNJOINED_PRIVATE_GUILD_DESCRIPTION.format", + find: "#{intl::STICKER_POPOUT_UNJOINED_PRIVATE_GUILD_DESCRIPTION}", predicate: () => settings.store.transformStickers, replacement: [ { @@ -381,7 +381,7 @@ export default definePlugin({ } }, { - find: ".Messages.EMOJI_POPOUT_UNJOINED_DISCOVERABLE_GUILD_DESCRIPTION", + find: "#{intl::EMOJI_POPOUT_UNJOINED_DISCOVERABLE_GUILD_DESCRIPTION}", predicate: () => settings.store.transformEmojis, replacement: { // Add the fake nitro emoji notice diff --git a/src/plugins/fakeProfileThemes/index.tsx b/src/plugins/fakeProfileThemes/index.tsx index 708c961a..d546650b 100644 --- a/src/plugins/fakeProfileThemes/index.tsx +++ b/src/plugins/fakeProfileThemes/index.tsx @@ -126,7 +126,7 @@ export default definePlugin({ } }, { - find: ".USER_SETTINGS_RESET_PROFILE_THEME", + find: "#{intl::USER_SETTINGS_RESET_PROFILE_THEME}", replacement: { match: /RESET_PROFILE_THEME}\)(?<=color:(\i),.{0,500}?color:(\i),.{0,500}?)/, replace: "$&,$self.addCopy3y3Button({primary:$1,accent:$2})" diff --git a/src/plugins/forceOwnerCrown/index.ts b/src/plugins/forceOwnerCrown/index.ts index 444bfab3..b21de489 100644 --- a/src/plugins/forceOwnerCrown/index.ts +++ b/src/plugins/forceOwnerCrown/index.ts @@ -27,7 +27,7 @@ export default definePlugin({ authors: [Devs.D3SOX, Devs.Nickyux], patches: [ { - find: ".Messages.GUILD_OWNER,", + find: "#{intl::GUILD_OWNER}", replacement: { match: /,isOwner:(\i),/, replace: ",_isOwner:$1=$self.isGuildOwner(e)," diff --git a/src/plugins/friendsSince/index.tsx b/src/plugins/friendsSince/index.tsx index a2a1311d..0f4016ad 100644 --- a/src/plugins/friendsSince/index.tsx +++ b/src/plugins/friendsSince/index.tsx @@ -26,7 +26,7 @@ export default definePlugin({ { find: ".PANEL}),nicknameIcons", replacement: { - match: /#{intl::USER_PROFILE_MEMBER_SINCE},.{0,100}userId:(\i\.id)}\)}\)/, + match: /#{intl::USER_PROFILE_MEMBER_SINCE}\),.{0,100}userId:(\i\.id)}\)}\)/, replace: "$&,$self.FriendsSinceComponent({userId:$1,isSidebar:true})" } }, @@ -34,7 +34,7 @@ export default definePlugin({ { find: "action:\"PRESS_APP_CONNECTION\"", replacement: { - match: /#{intl::USER_PROFILE_MEMBER_SINCE},.{0,100}userId:(\i\.id),.{0,100}}\)}\),/, + match: /#{intl::USER_PROFILE_MEMBER_SINCE}\),.{0,100}userId:(\i\.id),.{0,100}}\)}\),/, replace: "$&,$self.FriendsSinceComponent({userId:$1,isSidebar:false})," } } diff --git a/src/plugins/gameActivityToggle/index.tsx b/src/plugins/gameActivityToggle/index.tsx index 7aeb470d..32d72fdb 100644 --- a/src/plugins/gameActivityToggle/index.tsx +++ b/src/plugins/gameActivityToggle/index.tsx @@ -92,7 +92,7 @@ export default definePlugin({ patches: [ { - find: ".Messages.ACCOUNT_SPEAKING_WHILE_MUTED", + find: "#{intl::ACCOUNT_SPEAKING_WHILE_MUTED}", replacement: { match: /this\.renderNameZone\(\).+?children:\[/, replace: "$&$self.GameActivityToggleButton()," diff --git a/src/plugins/greetStickerPicker/index.tsx b/src/plugins/greetStickerPicker/index.tsx index 438fa40c..3ab5fca4 100644 --- a/src/plugins/greetStickerPicker/index.tsx +++ b/src/plugins/greetStickerPicker/index.tsx @@ -166,7 +166,7 @@ export default definePlugin({ patches: [ { - find: "Messages.WELCOME_CTA_LABEL", + find: "#{intl::WELCOME_CTA_LABEL}", replacement: { match: /innerClassName:\i\.welcomeCTAButton,(?<={channel:\i,message:\i}=(\i).{0,400}?)/, replace: "$&onContextMenu:(vcEvent)=>$self.pickSticker(vcEvent, $1)," diff --git a/src/plugins/ignoreActivities/index.tsx b/src/plugins/ignoreActivities/index.tsx index 19f22e61..fac83687 100644 --- a/src/plugins/ignoreActivities/index.tsx +++ b/src/plugins/ignoreActivities/index.tsx @@ -260,9 +260,9 @@ export default definePlugin({ } }, { - find: ".Messages.SETTINGS_GAMES_TOGGLE_OVERLAY", + find: "#{intl::SETTINGS_GAMES_TOGGLE_OVERLAY}", replacement: { - match: /\.Messages\.SETTINGS_GAMES_TOGGLE_OVERLAY.+?}\(\),(?<={overlay:\i,.+?=(\i),.+?)(?=!(\i))/, + match: /#{intl::SETTINGS_GAMES_TOGGLE_OVERLAY}.+?}\(\),(?<={overlay:\i,.+?=(\i),.+?)(?=!(\i))/, replace: (m, props, nowPlaying) => `${m}$self.renderToggleGameActivityButton(${props},${nowPlaying}),` } }, diff --git a/src/plugins/implicitRelationships/index.ts b/src/plugins/implicitRelationships/index.ts index 7fefb39b..868e1355 100644 --- a/src/plugins/implicitRelationships/index.ts +++ b/src/plugins/implicitRelationships/index.ts @@ -32,7 +32,7 @@ export default definePlugin({ patches: [ // Counts header { - find: ".FRIENDS_ALL_HEADER", + find: "#{intl::FRIENDS_ALL_HEADER}", replacement: { match: /toString\(\)\}\);case (\i\.\i)\.BLOCKED/, replace: 'toString()});case $1.IMPLICIT:return "Implicit — "+arguments[1];case $1.BLOCKED' @@ -48,7 +48,7 @@ export default definePlugin({ }, // Sections header { - find: ".FRIENDS_SECTION_ONLINE", + find: "#{intl::FRIENDS_SECTION_ONLINE}", replacement: { match: /(\(0,\i\.jsx\)\(\i\.TabBar\.Item,\{id:\i\.\i)\.BLOCKED,className:([^\s]+?)\.item,children:\i\.\i\.Messages\.BLOCKED\}\)/, replace: "$1.IMPLICIT,className:$2.item,children:\"Implicit\"}),$&" diff --git a/src/plugins/invisibleChat.desktop/index.tsx b/src/plugins/invisibleChat.desktop/index.tsx index c7eb29e7..1af8f4e5 100644 --- a/src/plugins/invisibleChat.desktop/index.tsx +++ b/src/plugins/invisibleChat.desktop/index.tsx @@ -111,7 +111,7 @@ export default definePlugin({ patches: [ { // Indicator - find: ".Messages.MESSAGE_EDITED,", + find: "#{intl::MESSAGE_EDITED}", replacement: { match: /let\{className:\i,message:\i[^}]*\}=(\i)/, replace: "try {$1 && $self.INV_REGEX.test($1.message.content) ? $1.content.push($self.indicator()) : null } catch {};$&" diff --git a/src/plugins/loadingQuotes/index.ts b/src/plugins/loadingQuotes/index.ts index 7d85cc90..9bfc88a7 100644 --- a/src/plugins/loadingQuotes/index.ts +++ b/src/plugins/loadingQuotes/index.ts @@ -62,7 +62,7 @@ export default definePlugin({ patches: [ { - find: ".LOADING_DID_YOU_KNOW", + find: "#{intl::LOADING_DID_YOU_KNOW}", replacement: [ { match: /"_loadingText".+?(?=(\i)\[.{0,10}\.random)/, diff --git a/src/plugins/messageLogger/index.tsx b/src/plugins/messageLogger/index.tsx index a08aeccc..080be776 100644 --- a/src/plugins/messageLogger/index.tsx +++ b/src/plugins/messageLogger/index.tsx @@ -445,7 +445,7 @@ export default definePlugin({ { // Message content renderer - find: "Messages.MESSAGE_EDITED,\")\"", + find: "#{intl::MESSAGE_EDITED}", replacement: [ { // Render editHistory in the deepest div for message content @@ -497,7 +497,7 @@ export default definePlugin({ }, { // Message group rendering - find: "Messages.NEW_MESSAGES_ESTIMATED_WITH_DATE", + find: "#{intl::NEW_MESSAGES_ESTIMATED_WITH_DATE}", replacement: [ { match: /(\i).type===\i\.\i\.MESSAGE_GROUP_BLOCKED\|\|/, diff --git a/src/plugins/moreUserTags/index.tsx b/src/plugins/moreUserTags/index.tsx index 7a56131a..119d02c3 100644 --- a/src/plugins/moreUserTags/index.tsx +++ b/src/plugins/moreUserTags/index.tsx @@ -187,7 +187,7 @@ export default definePlugin({ } }, { - find: ".DISCORD_SYSTEM_MESSAGE_BOT_TAG_TOOLTIP_OFFICIAL,", + find: "#{intl::DISCORD_SYSTEM_MESSAGE_BOT_TAG_TOOLTIP_OFFICIAL}", replacement: [ // make the tag show the right text { @@ -217,7 +217,7 @@ export default definePlugin({ }, // in the member list { - find: ".Messages.GUILD_OWNER,", + find: "#{intl::GUILD_OWNER}", replacement: { match: /(?\i)=\(null==.{0,100}\.BOT;return null!=(?\i)&&\i\.bot/, replace: "$ = $self.getTag({user: $, channel: arguments[0].channel, origType: $.bot ? 0 : null, location: 'not-chat' }); return typeof $ === 'number'" @@ -232,7 +232,7 @@ export default definePlugin({ } }, { - find: ".Messages.USER_PROFILE_PRONOUNS", + find: "#{ìntl::USER_PROFILE_PRONOUNS}", replacement: { match: /(?=,hideBotTag:!0)/, replace: ",moreTags_channelId:arguments[0].moreTags_channelId" diff --git a/src/plugins/noBlockedMessages/index.ts b/src/plugins/noBlockedMessages/index.ts index d3b37b02..7884aa29 100644 --- a/src/plugins/noBlockedMessages/index.ts +++ b/src/plugins/noBlockedMessages/index.ts @@ -37,7 +37,7 @@ export default definePlugin({ authors: [Devs.rushii, Devs.Samu], patches: [ { - find: "Messages.BLOCKED_MESSAGES_HIDE", + find: "#{intl::BLOCKED_MESSAGES_HIDE}", replacement: [ { match: /let\{[^}]*collapsedReason[^}]*\}/, diff --git a/src/plugins/noOnboardingDelay/index.ts b/src/plugins/noOnboardingDelay/index.ts index 6211e97c..28510976 100644 --- a/src/plugins/noOnboardingDelay/index.ts +++ b/src/plugins/noOnboardingDelay/index.ts @@ -25,7 +25,7 @@ export default definePlugin({ authors: [Devs.nekohaxx], patches: [ { - find: "Messages.ONBOARDING_COVER_WELCOME_SUBTITLE", + find: "#{intl::ONBOARDING_COVER_WELCOME_SUBTITLE}", replacement: { match: "3e3", replace: "0" diff --git a/src/plugins/normalizeMessageLinks/index.ts b/src/plugins/normalizeMessageLinks/index.ts index cac36e65..82076ef2 100644 --- a/src/plugins/normalizeMessageLinks/index.ts +++ b/src/plugins/normalizeMessageLinks/index.ts @@ -13,7 +13,7 @@ export default definePlugin({ authors: [Devs.bb010g], patches: [ { - find: ".Messages.COPY_MESSAGE_LINK,", + find: "#{intl::COPY_MESSAGE_LINK}", replacement: { match: /\.concat\(location\.host\)/, replace: ".concat($self.normalizeHost(location.host))", diff --git a/src/plugins/pauseInvitesForever/index.tsx b/src/plugins/pauseInvitesForever/index.tsx index 666f0af8..ff292a6d 100644 --- a/src/plugins/pauseInvitesForever/index.tsx +++ b/src/plugins/pauseInvitesForever/index.tsx @@ -43,15 +43,15 @@ export default definePlugin({ patches: [ { - find: "Messages.GUILD_INVITE_DISABLE_ACTION_SHEET_DESCRIPTION", + find: "#{intl::GUILD_INVITE_DISABLE_ACTION_SHEET_DESCRIPTION}", group: true, replacement: [ { - match: /children:\i\.\i\.\i\.GUILD_INVITE_DISABLE_ACTION_SHEET_DESCRIPTION/, + match: /children:\i\.\i\.string\(\i\.\i#{intl::GUILD_INVITE_DISABLE_ACTION_SHEET_DESCRIPTION}\)/, replace: "children: $self.renderInvitesLabel({guildId:arguments[0].guildId,setChecked})", }, { - match: /\.INVITES_DISABLED\)(?=.+?\.Messages\.INVITES_PERMANENTLY_DISABLED_TIP.+?checked:(\i)).+?\[\1,(\i)\]=\i.useState\(\i\)/, + match: /\.INVITES_DISABLED\)(?=.+?#{intl::INVITES_PERMANENTLY_DISABLED_TIP}.+?checked:(\i)).+?\[\1,(\i)\]=\i.useState\(\i\)/, replace: "$&,setChecked=$2" } ] diff --git a/src/plugins/permissionFreeWill/index.ts b/src/plugins/permissionFreeWill/index.ts index 96e110b6..c45cbff6 100644 --- a/src/plugins/permissionFreeWill/index.ts +++ b/src/plugins/permissionFreeWill/index.ts @@ -32,7 +32,7 @@ export default definePlugin({ patches: [ // Permission lockout, just set the check to true { - find: ".STAGE_CHANNEL_CANNOT_OVERWRITE_PERMISSION", + find: "#{intl::STAGE_CHANNEL_CANNOT_OVERWRITE_PERMISSION}", replacement: [ { match: /case"DENY":.{0,50}if\((?=\i\.\i\.can)/, @@ -43,7 +43,7 @@ export default definePlugin({ }, // Onboarding, same thing but we need to prevent the check { - find: ".ONBOARDING_CHANNEL_THRESHOLD_WARNING", + find: "#{intl::ONBOARDING_CHANNEL_THRESHOLD_WARNING}", replacement: [ { match: /{(\i:function\(\){return \i},?){2}}/, diff --git a/src/plugins/replyTimestamp/index.tsx b/src/plugins/replyTimestamp/index.tsx index b0a01add..a50640e9 100644 --- a/src/plugins/replyTimestamp/index.tsx +++ b/src/plugins/replyTimestamp/index.tsx @@ -67,7 +67,7 @@ export default definePlugin({ patches: [ { - find: ".REPLY_QUOTE_MESSAGE_BLOCKED", + find: "#[intl::REPLY_QUOTE_MESSAGE_BLOCKED}", replacement: { match: /\.onClickReply,.+?}\),(?=\i,\i,\i\])/, replace: "$&$self.ReplyTimestamp(arguments[0])," diff --git a/src/plugins/reverseImageSearch/index.tsx b/src/plugins/reverseImageSearch/index.tsx index 728156b2..eb87240c 100644 --- a/src/plugins/reverseImageSearch/index.tsx +++ b/src/plugins/reverseImageSearch/index.tsx @@ -108,7 +108,7 @@ export default definePlugin({ patches: [ { - find: ".Messages.MESSAGE_ACTIONS_MENU_LABEL,shouldHideMediaOptions", + find: "#{intl::MESSAGE_ACTIONS_MENU_LABEL}", replacement: { match: /favoriteableType:\i,(?<=(\i)\.getAttribute\("data-type"\).+?)/, replace: (m, target) => `${m}reverseImageSearchType:${target}.getAttribute("data-role"),` diff --git a/src/plugins/roleColorEverywhere/index.tsx b/src/plugins/roleColorEverywhere/index.tsx index 108ed00c..204bc0be 100644 --- a/src/plugins/roleColorEverywhere/index.tsx +++ b/src/plugins/roleColorEverywhere/index.tsx @@ -104,7 +104,7 @@ export default definePlugin({ predicate: () => settings.store.memberList, }, { - find: ".Messages.THREAD_BROWSER_PRIVATE", + find: "#{intl::THREAD_BROWSER_PRIVATE}", replacement: [ { match: /children:\[\i," — ",\i\]/, @@ -132,7 +132,7 @@ export default definePlugin({ predicate: () => settings.store.reactorsList, }, { - find: '.Messages.MESSAGE_EDITED,")"', + find: "#{intl::MESSAGE_EDITED}", replacement: { match: /(?<=isUnsupported\]:(\i)\.isUnsupported\}\),)(?=children:\[)/, replace: "style:{color:$self.useMessageColor($1)}," diff --git a/src/plugins/shikiCodeblocks.desktop/index.ts b/src/plugins/shikiCodeblocks.desktop/index.ts index e6676a86..1092f89a 100644 --- a/src/plugins/shikiCodeblocks.desktop/index.ts +++ b/src/plugins/shikiCodeblocks.desktop/index.ts @@ -46,7 +46,7 @@ export default definePlugin({ } }, { - find: ".PREVIEW_NUM_LINES", + find: "#{intl::PREVIEW_NUM_LINES}", replacement: { match: /(?<=function \i\((\i)\)\{)(?=let\{text:\i,language:)/, replace: "return $self.renderHighlighter({lang:$1.language,content:$1.text});" diff --git a/src/plugins/showAllMessageButtons/index.ts b/src/plugins/showAllMessageButtons/index.ts index 44a5741c..1d689013 100644 --- a/src/plugins/showAllMessageButtons/index.ts +++ b/src/plugins/showAllMessageButtons/index.ts @@ -26,7 +26,7 @@ export default definePlugin({ patches: [ { - find: ".Messages.MESSAGE_UTILITIES_A11Y_LABEL", + find: "#{intl::MESSAGE_UTILITIES_A11Y_LABEL}", replacement: { match: /isExpanded:\i&&(.+?),/, replace: "isExpanded:$1," diff --git a/src/plugins/showHiddenChannels/index.tsx b/src/plugins/showHiddenChannels/index.tsx index d220d0c1..38730371 100644 --- a/src/plugins/showHiddenChannels/index.tsx +++ b/src/plugins/showHiddenChannels/index.tsx @@ -274,7 +274,7 @@ export default definePlugin({ } }, { - find: ".Messages.ROLE_REQUIRED_SINGLE_USER_MESSAGE", + find: "#{intl::ROLE_REQUIRED_SINGLE_USER_MESSAGE}", replacement: [ { // Change the role permission check to CONNECT if the channel is locked @@ -336,7 +336,7 @@ export default definePlugin({ ] }, { - find: ".Messages.CHANNEL_CALL_CURRENT_SPEAKER.format", + find: "#{intl::CHANNEL_CALL_CURRENT_SPEAKER}", replacement: [ { // Remove the divider and the open chat button for the HiddenChannelLockScreen @@ -351,7 +351,7 @@ export default definePlugin({ ] }, { - find: ".Messages.EMBEDDED_ACTIVITIES_DEVELOPER_ACTIVITY_SHELF_FETCH_ERROR", + find: "#{intl::EMBEDDED_ACTIVITIES_DEVELOPER_ACTIVITY_SHELF_FETCH_ERROR}", replacement: [ { // Render our HiddenChannelLockScreen component instead of the main voice channel component @@ -401,7 +401,7 @@ export default definePlugin({ ] }, { - find: ".Messages.STAGE_FULL_MODERATOR_TITLE", + find: "#{intl::STAGE_FULL_MODERATOR_TITLE}", replacement: [ { // Remove the divider and amount of users in stage channel components for the HiddenChannelLockScreen @@ -463,7 +463,7 @@ export default definePlugin({ ] }, { - find: ".Messages.FORM_LABEL_MUTED", + find: "#{intl::FORM_LABEL_MUTED}", replacement: { // Make GuildChannelStore.getChannels return hidden channels match: /(?<=getChannels\(\i)(?=\))/, diff --git a/src/plugins/showHiddenThings/index.ts b/src/plugins/showHiddenThings/index.ts index bab0b303..8fd6ef82 100644 --- a/src/plugins/showHiddenThings/index.ts +++ b/src/plugins/showHiddenThings/index.ts @@ -68,7 +68,7 @@ export default definePlugin({ }, // fixes a bug where Members page must be loaded to see highest role, why is Discord depending on MemberSafetyStore.getEnhancedMember for something that can be obtained here? { - find: "Messages.GUILD_MEMBER_MOD_VIEW_PERMISSION_GRANTED_BY_ARIA_LABEL,allowOverflow", + find: "#{intl::GUILD_MEMBER_MOD_VIEW_PERMISSION_GRANTED_BY_ARIA_LABEL}", predicate: () => settings.store.showModView, replacement: { match: /(role:)\i(?=,guildId.{0,100}role:(\i\[))/, diff --git a/src/plugins/showTimeoutDuration/index.tsx b/src/plugins/showTimeoutDuration/index.tsx index bfe80680..c0f5e918 100644 --- a/src/plugins/showTimeoutDuration/index.tsx +++ b/src/plugins/showTimeoutDuration/index.tsx @@ -65,10 +65,10 @@ export default definePlugin({ patches: [ { - find: ".GUILD_COMMUNICATION_DISABLED_ICON_TOOLTIP_BODY", + find: "#{intl::GUILD_COMMUNICATION_DISABLED_ICON_TOOLTIP_BODY}", replacement: [ { - match: /(\i)\.Tooltip,{(text:.{0,30}\.Messages\.GUILD_COMMUNICATION_DISABLED_ICON_TOOLTIP_BODY)/, + match: /(\i)\.Tooltip,{(text:.{0,30}#{intl::GUILD_COMMUNICATION_DISABLED_ICON_TOOLTIP_BODY}\))/, replace: "$self.TooltipWrapper,{message:arguments[0].message,$2" } ] diff --git a/src/plugins/sortFriendRequests/index.tsx b/src/plugins/sortFriendRequests/index.tsx index 64eb13fe..6ce1af14 100644 --- a/src/plugins/sortFriendRequests/index.tsx +++ b/src/plugins/sortFriendRequests/index.tsx @@ -45,7 +45,7 @@ export default definePlugin({ replace: "}).sortBy(row => $self.wrapSort(($1), row)).value()" } }, { - find: ".Messages.FRIEND_REQUEST_CANCEL", + find: "#{intl::FRIEND_REQUEST_CANCEL}", replacement: { predicate: () => settings.store.showDates, match: /subText:(\i)(?<=user:(\i).+?)/, diff --git a/src/plugins/startupTimings/index.tsx b/src/plugins/startupTimings/index.tsx index 5051fdf4..aabc786a 100644 --- a/src/plugins/startupTimings/index.tsx +++ b/src/plugins/startupTimings/index.tsx @@ -26,7 +26,7 @@ export default definePlugin({ description: "Adds Startup Timings to the Settings menu", authors: [Devs.Megu], patches: [{ - find: "Messages.ACTIVITY_SETTINGS", + find: "#{intl::ACTIVITY_SETTINGS}", replacement: { match: /(?<=}\)([,;])(\i\.settings)\.forEach.+?(\i)\.push.+}\)}\))/, replace: (_, commaOrSemi, settings, elements) => "" + diff --git a/src/plugins/themeAttributes/index.ts b/src/plugins/themeAttributes/index.ts index 2a613967..8e1e022b 100644 --- a/src/plugins/themeAttributes/index.ts +++ b/src/plugins/themeAttributes/index.ts @@ -38,7 +38,7 @@ export default definePlugin({ // add --avatar-url- css variable to avatar img elements // popout profiles { - find: ".LABEL_WITH_ONLINE_STATUS", + find: "#{intl::LABEL_WITH_ONLINE_STATUS}", replacement: { match: /src:null!=\i\?(\i).{1,50}"aria-hidden":!0/, replace: "$&,style:$self.getAvatarStyles($1)" diff --git a/src/plugins/unlockedAvatarZoom/index.ts b/src/plugins/unlockedAvatarZoom/index.ts index 08503eb8..79c20474 100644 --- a/src/plugins/unlockedAvatarZoom/index.ts +++ b/src/plugins/unlockedAvatarZoom/index.ts @@ -25,7 +25,7 @@ export default definePlugin({ settings, patches: [ { - find: ".Messages.AVATAR_UPLOAD_EDIT_MEDIA", + find: "#{intl::AVATAR_UPLOAD_EDIT_MEDIA}", replacement: { match: /maxValue:\d/, replace: "maxValue:$self.settings.store.zoomMultiplier", diff --git a/src/plugins/userVoiceShow/index.tsx b/src/plugins/userVoiceShow/index.tsx index 07b18c27..0c8e3048 100644 --- a/src/plugins/userVoiceShow/index.tsx +++ b/src/plugins/userVoiceShow/index.tsx @@ -57,7 +57,7 @@ export default definePlugin({ patches: [ // User Popout, Full Size Profile, Direct Messages Side Profile { - find: ".Messages.USER_PROFILE_LOAD_ERROR", + find: "#{intl::USER_PROFILE_LOAD_ERROR}", replacement: { match: /(\.fetchError.+?\?)null/, replace: (_, rest) => `${rest}$self.VoiceChannelIndicator({userId:arguments[0]?.userId,isProfile:true})` diff --git a/src/plugins/validReply/index.ts b/src/plugins/validReply/index.ts index b65496f4..4e2b6b71 100644 --- a/src/plugins/validReply/index.ts +++ b/src/plugins/validReply/index.ts @@ -37,9 +37,9 @@ export default definePlugin({ authors: [Devs.newwares], patches: [ { - find: "Messages.REPLY_QUOTE_MESSAGE_NOT_LOADED", + find: "#{intl::REPLY_QUOTE_MESSAGE_NOT_LOADED", replacement: { - match: /Messages\.REPLY_QUOTE_MESSAGE_NOT_LOADED/, + match: /#{intl::REPLY_QUOTE_MESSAGE_NOT_LOADED}\)/, replace: "$&,onMouseEnter:()=>$self.fetchReply(arguments[0])" } }, diff --git a/src/plugins/webContextMenus.web/index.ts b/src/plugins/webContextMenus.web/index.ts index 4ed7e922..3b2b58c0 100644 --- a/src/plugins/webContextMenus.web/index.ts +++ b/src/plugins/webContextMenus.web/index.ts @@ -127,11 +127,11 @@ export default definePlugin({ replace: "return [true" }, { - match: /(?<=#{intl::COPY_IMAGE_MENU_ITEM},)action:/, + match: /(?<=#{intl::COPY_IMAGE_MENU_ITEM}\),)action:/, replace: "action:()=>$self.copyImage(arguments[0]),oldAction:" }, { - match: /(?<=#{intl::SAVE_IMAGE_MENU_ITEM},)action:/, + match: /(?<=#{intl::SAVE_IMAGE_MENU_ITEM}\),)action:/, replace: "action:()=>$self.saveImage(arguments[0]),oldAction:" }, ] From aef8a1a8b72e8a945080238d6cbf7e50a83f153e Mon Sep 17 00:00:00 2001 From: Nuckyz <61953774+Nuckyz@users.noreply.github.com> Date: Sun, 3 Nov 2024 13:49:22 -0300 Subject: [PATCH 4/4] even more --- src/plugins/_api/serverList.ts | 2 +- src/plugins/crashHandler/index.ts | 2 +- src/plugins/disableCallIdle/index.ts | 2 +- src/plugins/permissionsViewer/index.tsx | 2 +- src/plugins/replyTimestamp/index.tsx | 2 +- src/plugins/showHiddenChannels/index.tsx | 2 +- src/plugins/validReply/index.ts | 2 +- src/plugins/webContextMenus.web/index.ts | 4 ++-- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/plugins/_api/serverList.ts b/src/plugins/_api/serverList.ts index dfd40de7..38bcfd90 100644 --- a/src/plugins/_api/serverList.ts +++ b/src/plugins/_api/serverList.ts @@ -32,7 +32,7 @@ export default definePlugin({ } }, { - find: "#{intl::SERVERS}),children", + find: '#{intl::SERVERS}"]),children', replacement: { match: /(?<=#{intl::SERVERS}\),children:)\i\.map\(\i\)/, replace: "Vencord.Api.ServerList.renderAll(Vencord.Api.ServerList.ServerListRenderPosition.In).concat($&)" diff --git a/src/plugins/crashHandler/index.ts b/src/plugins/crashHandler/index.ts index 57703a56..f6bc2c8b 100644 --- a/src/plugins/crashHandler/index.ts +++ b/src/plugins/crashHandler/index.ts @@ -67,7 +67,7 @@ export default definePlugin({ patches: [ { - find: "#{intl:;ERRORS_UNEXPECTED_CRASH}", + find: "#{intl::ERRORS_UNEXPECTED_CRASH}", replacement: { match: /this\.setState\((.+?)\)/, replace: "$self.handleCrash(this,$1);" diff --git a/src/plugins/disableCallIdle/index.ts b/src/plugins/disableCallIdle/index.ts index 1fdc862c..82ab56f2 100644 --- a/src/plugins/disableCallIdle/index.ts +++ b/src/plugins/disableCallIdle/index.ts @@ -27,7 +27,7 @@ export default definePlugin({ authors: [Devs.Nuckyz], patches: [ { - find: "#{intl::BOT_CALL_IDLE_DISCONNECT}", + find: "#{intl::BOT_CALL_IDLE_DISCONNECT_2}", replacement: { match: /,?(?=\i\(this,"idleTimeout",new \i\.\i\))/, replace: ";return;" diff --git a/src/plugins/permissionsViewer/index.tsx b/src/plugins/permissionsViewer/index.tsx index 7d6572df..20b0b191 100644 --- a/src/plugins/permissionsViewer/index.tsx +++ b/src/plugins/permissionsViewer/index.tsx @@ -170,7 +170,7 @@ export default definePlugin({ patches: [ { - find: ".VIEW_ALL_ROLES,", + find: "#{intl::VIEW_ALL_ROLES}", replacement: { match: /\.expandButton,.+?null,/, replace: "$&$self.ViewPermissionsButton(arguments[0])," diff --git a/src/plugins/replyTimestamp/index.tsx b/src/plugins/replyTimestamp/index.tsx index a50640e9..dc31dd88 100644 --- a/src/plugins/replyTimestamp/index.tsx +++ b/src/plugins/replyTimestamp/index.tsx @@ -67,7 +67,7 @@ export default definePlugin({ patches: [ { - find: "#[intl::REPLY_QUOTE_MESSAGE_BLOCKED}", + find: "#{intl::REPLY_QUOTE_MESSAGE_BLOCKED}", replacement: { match: /\.onClickReply,.+?}\),(?=\i,\i,\i\])/, replace: "$&$self.ReplyTimestamp(arguments[0])," diff --git a/src/plugins/showHiddenChannels/index.tsx b/src/plugins/showHiddenChannels/index.tsx index 38730371..ba367542 100644 --- a/src/plugins/showHiddenChannels/index.tsx +++ b/src/plugins/showHiddenChannels/index.tsx @@ -149,7 +149,7 @@ export default definePlugin({ } }, { - find: ".Messages.CHANNEL_TOOLTIP_DIRECTORY", + find: "#{intl::CHANNEL_TOOLTIP_DIRECTORY}", predicate: () => settings.store.showMode === ShowMode.LockIcon, replacement: { // Lock Icon diff --git a/src/plugins/validReply/index.ts b/src/plugins/validReply/index.ts index 4e2b6b71..989513d0 100644 --- a/src/plugins/validReply/index.ts +++ b/src/plugins/validReply/index.ts @@ -37,7 +37,7 @@ export default definePlugin({ authors: [Devs.newwares], patches: [ { - find: "#{intl::REPLY_QUOTE_MESSAGE_NOT_LOADED", + find: "#{intl::REPLY_QUOTE_MESSAGE_NOT_LOADED}", replacement: { match: /#{intl::REPLY_QUOTE_MESSAGE_NOT_LOADED}\)/, replace: "$&,onMouseEnter:()=>$self.fetchReply(arguments[0])" diff --git a/src/plugins/webContextMenus.web/index.ts b/src/plugins/webContextMenus.web/index.ts index 3b2b58c0..d3934bc2 100644 --- a/src/plugins/webContextMenus.web/index.ts +++ b/src/plugins/webContextMenus.web/index.ts @@ -202,14 +202,14 @@ export default definePlugin({ } }, { - find: ".Messages.SEARCH_WITH_GOOGLE", + find: "#{intl::SEARCH_WITH_GOOGLE}", replacement: { match: /\i\.isPlatformEmbedded/, replace: "true" } }, { - find: ".Messages.COPY,hint:", + find: "#{intl::COPY}),hint:", replacement: [ { match: /\i\.isPlatformEmbedded/,