mirror of
https://github.com/Vendicated/Vencord.git
synced 2024-09-19 22:20:34 +00:00
Compare commits
9 commits
ae2cf1245b
...
1c9cb02c78
Author | SHA1 | Date | |
---|---|---|---|
|
1c9cb02c78 | ||
|
225c673fb9 | ||
|
a0e10a2ad6 | ||
|
8afd79dd50 | ||
|
65c5897dc3 | ||
|
6cce8a8bc4 | ||
|
1848b16536 | ||
|
c572116b97 | ||
|
e26986f66a |
27 changed files with 274 additions and 240 deletions
|
@ -68,7 +68,7 @@
|
|||
"highlight.js": "11.8.0",
|
||||
"html-minifier-terser": "^7.2.0",
|
||||
"moment": "2.22.2",
|
||||
"puppeteer-core": "^23.3.1",
|
||||
"puppeteer-core": "^23.4.0",
|
||||
"standalone-electron-types": "^1.0.0",
|
||||
"stylelint": "^16.9.0",
|
||||
"stylelint-config-standard": "^36.0.1",
|
||||
|
@ -77,7 +77,7 @@
|
|||
"tsx": "^4.19.1",
|
||||
"type-fest": "^4.26.1",
|
||||
"typescript": "^5.6.2",
|
||||
"typescript-eslint": "^8.5.0",
|
||||
"typescript-eslint": "^8.6.0",
|
||||
"typescript-transform-paths": "^3.5.1",
|
||||
"zip-local": "^0.3.5"
|
||||
},
|
||||
|
@ -85,6 +85,7 @@
|
|||
"pnpm": {
|
||||
"patchedDependencies": {
|
||||
"@stylistic/eslint-plugin@2.8.0": "patches/@stylistic__eslint-plugin@2.8.0.patch",
|
||||
"@typescript-eslint/eslint-plugin@8.6.0": "patches/@typescript-eslint__eslint-plugin@8.6.0.patch",
|
||||
"eslint-plugin-path-alias@2.1.0": "patches/eslint-plugin-path-alias@2.1.0.patch",
|
||||
"eslint@9.10.0": "patches/eslint@9.10.0.patch",
|
||||
"standalone-electron-types@1.0.0": "patches/standalone-electron-types@1.0.0.patch",
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
"@stylistic/eslint-plugin": "^2.8.0",
|
||||
"@types/node": "^20.16.5",
|
||||
"@types/semver": "^7.5.8",
|
||||
"@typescript-eslint/typescript-estree": "^8.5.0",
|
||||
"@typescript-eslint/typescript-estree": "^8.6.0",
|
||||
"eslint": "^9.10.0",
|
||||
"eslint-plugin-check-file": "^2.8.0",
|
||||
"eslint-plugin-import-x": "^4.2.1",
|
||||
|
@ -40,11 +40,11 @@
|
|||
"eslint-plugin-simple-import-sort": "^12.1.1",
|
||||
"eslint-plugin-unicorn": "^55.0.0",
|
||||
"eslint-plugin-unused-imports": "^4.1.4",
|
||||
"puppeteer-core": "^23.3.1",
|
||||
"puppeteer-core": "^23.4.0",
|
||||
"semver": "^7.6.3",
|
||||
"tsx": "^4.19.1",
|
||||
"type-fest": "^4.26.1",
|
||||
"typescript": "^5.6.2",
|
||||
"typescript-eslint": "^8.5.0"
|
||||
"typescript-eslint": "^8.6.0"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -53,6 +53,7 @@ export declare class UserRecord<
|
|||
isNonUserBot(): boolean;
|
||||
isPhoneVerified(): boolean;
|
||||
isPomelo(): boolean;
|
||||
isProvisional(): boolean;
|
||||
isSystemUser(): boolean;
|
||||
isVerifiedBot(): boolean;
|
||||
removeGuildAvatarHash(guildId: string): this;
|
||||
|
|
File diff suppressed because one or more lines are too long
72
patches/@typescript-eslint__eslint-plugin@8.6.0.patch
Normal file
72
patches/@typescript-eslint__eslint-plugin@8.6.0.patch
Normal file
|
@ -0,0 +1,72 @@
|
|||
diff --git a/dist/rules/class-literal-property-style.js b/dist/rules/class-literal-property-style.js
|
||||
index 2454cd853753408dca5335cf7cf7eccbd28d5255..c8c0aef6ef8fa1ce8beafeed06e68ebf88c3ec87 100644
|
||||
--- a/dist/rules/class-literal-property-style.js
|
||||
+++ b/dist/rules/class-literal-property-style.js
|
||||
@@ -79,8 +79,7 @@ exports.default = (0, util_1.createRule)({
|
||||
function excludeAssignedProperty(node) {
|
||||
if ((0, util_1.isAssignee)(node)) {
|
||||
const { excludeSet } = propertiesInfoStack[propertiesInfoStack.length - 1];
|
||||
- const name = (0, util_1.getStaticStringValue)(node.property) ??
|
||||
- context.sourceCode.getText(node.property);
|
||||
+ const name = (0, util_1.getStaticMemberAccessValue)(node, context);
|
||||
if (name) {
|
||||
excludeSet.add(name);
|
||||
}
|
||||
diff --git a/dist/rules/class-methods-use-this.js b/dist/rules/class-methods-use-this.js
|
||||
index 6d4a871cb4f6f57b97c338a472ea77dc10841706..acaa45fde2a8a9a2f9702cc80737c1b0bcc078ee 100644
|
||||
--- a/dist/rules/class-methods-use-this.js
|
||||
+++ b/dist/rules/class-methods-use-this.js
|
||||
@@ -121,7 +121,7 @@ exports.default = (0, util_1.createRule)({
|
||||
}
|
||||
const hashIfNeeded = node.key.type === utils_1.AST_NODE_TYPES.PrivateIdentifier ? '#' : '';
|
||||
const name = (0, util_1.getStaticMemberAccessValue)(node, context);
|
||||
- return !exceptMethods.has(hashIfNeeded + (name ?? ''));
|
||||
+ return (typeof name !== 'string' || !exceptMethods.has(hashIfNeeded + name));
|
||||
}
|
||||
/**
|
||||
* Checks if we are leaving a function that is a method, and reports if 'this' has not been used.
|
||||
diff --git a/dist/util/isArrayMethodCallWithPredicate.js b/dist/util/isArrayMethodCallWithPredicate.js
|
||||
index eba71334f16a931ee51e9ad6d11cf4bba3c41a75..73a4044660d223450c54a9f9939631ad71562c05 100644
|
||||
--- a/dist/util/isArrayMethodCallWithPredicate.js
|
||||
+++ b/dist/util/isArrayMethodCallWithPredicate.js
|
||||
@@ -42,7 +42,7 @@ function isArrayMethodCallWithPredicate(context, services, node) {
|
||||
return false;
|
||||
}
|
||||
const staticAccessValue = (0, misc_1.getStaticMemberAccessValue)(node.callee, context);
|
||||
- if (!staticAccessValue || !ARRAY_PREDICATE_FUNCTIONS.has(staticAccessValue)) {
|
||||
+ if (!ARRAY_PREDICATE_FUNCTIONS.has(staticAccessValue)) {
|
||||
return false;
|
||||
}
|
||||
const checker = services.program.getTypeChecker();
|
||||
diff --git a/dist/util/misc.js b/dist/util/misc.js
|
||||
index 4b4d937ee0f1c6bd51de3d5c7fb931648642abf6..826dcee437f9df7d81168bd5229c79a769692d89 100644
|
||||
--- a/dist/util/misc.js
|
||||
+++ b/dist/util/misc.js
|
||||
@@ -198,13 +198,21 @@ function isParenlessArrowFunction(node, sourceCode) {
|
||||
}
|
||||
function getStaticMemberAccessValue(node, { sourceCode }) {
|
||||
const key = node.type === utils_1.AST_NODE_TYPES.MemberExpression ? node.property : node.key;
|
||||
- if (!node.computed) {
|
||||
- return key.type === utils_1.AST_NODE_TYPES.Literal
|
||||
- ? `${key.value}`
|
||||
- : key.name;
|
||||
+ const { type } = key;
|
||||
+ if (type === utils_1.AST_NODE_TYPES.Literal) {
|
||||
+ return String(key.value);
|
||||
}
|
||||
- const value = (0, astUtils_1.getStaticValue)(key, sourceCode.getScope(node))?.value;
|
||||
- return value == null ? undefined : `${value}`;
|
||||
+ if (!node.computed &&
|
||||
+ (type === utils_1.AST_NODE_TYPES.Identifier ||
|
||||
+ type === utils_1.AST_NODE_TYPES.PrivateIdentifier)) {
|
||||
+ return key.name;
|
||||
+ }
|
||||
+ const result = (0, astUtils_1.getStaticValue)(key, sourceCode.getScope(node));
|
||||
+ if (!result) {
|
||||
+ return undefined;
|
||||
+ }
|
||||
+ const { value } = result;
|
||||
+ return typeof value === 'symbol' ? value : String(value);
|
||||
}
|
||||
/**
|
||||
* Answers whether the member expression looks like
|
229
pnpm-lock.yaml
229
pnpm-lock.yaml
|
@ -27,6 +27,9 @@ patchedDependencies:
|
|||
'@stylistic/eslint-plugin@2.8.0':
|
||||
hash: hgabz23qzpdlfvbmkgegp3so3q
|
||||
path: patches/@stylistic__eslint-plugin@2.8.0.patch
|
||||
'@typescript-eslint/eslint-plugin@8.6.0':
|
||||
hash: rf3fsbgjxv7ylxpzkcvrp4lpfq
|
||||
path: patches/@typescript-eslint__eslint-plugin@8.6.0.patch
|
||||
eslint-plugin-path-alias@2.1.0:
|
||||
hash: japuwsqfkulviwgkm4kd2oi3ky
|
||||
path: patches/eslint-plugin-path-alias@2.1.0.patch
|
||||
|
@ -128,7 +131,7 @@ importers:
|
|||
version: 12.1.1(eslint@9.10.0(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))
|
||||
eslint-plugin-unused-imports:
|
||||
specifier: ^4.1.4
|
||||
version: 4.1.4(@typescript-eslint/eslint-plugin@8.6.0(@typescript-eslint/parser@8.6.0(eslint@9.10.0(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.6.2))(eslint@9.10.0(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.6.2))(eslint@9.10.0(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))
|
||||
version: 4.1.4(@typescript-eslint/eslint-plugin@8.6.0(patch_hash=rf3fsbgjxv7ylxpzkcvrp4lpfq)(@typescript-eslint/parser@8.6.0(eslint@9.10.0(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.6.2))(eslint@9.10.0(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.6.2))(eslint@9.10.0(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))
|
||||
highlight.js:
|
||||
specifier: 11.8.0
|
||||
version: 11.8.0
|
||||
|
@ -139,8 +142,8 @@ importers:
|
|||
specifier: 2.22.2
|
||||
version: 2.22.2
|
||||
puppeteer-core:
|
||||
specifier: ^23.3.1
|
||||
version: 23.3.1
|
||||
specifier: ^23.4.0
|
||||
version: 23.4.0
|
||||
standalone-electron-types:
|
||||
specifier: ^1.0.0
|
||||
version: 1.0.0(patch_hash=cvychuhjtbzvtowhc2efrgpqjq)
|
||||
|
@ -166,8 +169,8 @@ importers:
|
|||
specifier: ^5.6.2
|
||||
version: 5.6.2
|
||||
typescript-eslint:
|
||||
specifier: ^8.5.0
|
||||
version: 8.5.0(eslint@9.10.0(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.6.2)
|
||||
specifier: ^8.6.0
|
||||
version: 8.6.0(eslint@9.10.0(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.6.2)
|
||||
typescript-transform-paths:
|
||||
specifier: ^3.5.1
|
||||
version: 3.5.1(patch_hash=67beklx2y5qvw7iy3wqqxjhwr4)(typescript@5.6.2)
|
||||
|
@ -209,7 +212,7 @@ importers:
|
|||
specifier: ^7.5.8
|
||||
version: 7.5.8
|
||||
'@typescript-eslint/typescript-estree':
|
||||
specifier: ^8.5.0
|
||||
specifier: ^8.6.0
|
||||
version: 8.6.0(typescript@5.6.2)
|
||||
eslint:
|
||||
specifier: ^9.10.0
|
||||
|
@ -231,10 +234,10 @@ importers:
|
|||
version: 55.0.0(eslint@9.10.0(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))
|
||||
eslint-plugin-unused-imports:
|
||||
specifier: ^4.1.4
|
||||
version: 4.1.4(@typescript-eslint/eslint-plugin@8.6.0(@typescript-eslint/parser@8.5.0(eslint@9.10.0(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.6.2))(eslint@9.10.0(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.6.2))(eslint@9.10.0(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))
|
||||
version: 4.1.4(@typescript-eslint/eslint-plugin@8.6.0(patch_hash=rf3fsbgjxv7ylxpzkcvrp4lpfq)(@typescript-eslint/parser@8.6.0(eslint@9.10.0(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.6.2))(eslint@9.10.0(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.6.2))(eslint@9.10.0(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))
|
||||
puppeteer-core:
|
||||
specifier: ^23.3.1
|
||||
version: 23.3.1
|
||||
specifier: ^23.4.0
|
||||
version: 23.4.0
|
||||
semver:
|
||||
specifier: ^7.6.3
|
||||
version: 7.6.3
|
||||
|
@ -248,8 +251,8 @@ importers:
|
|||
specifier: ^5.6.2
|
||||
version: 5.6.2
|
||||
typescript-eslint:
|
||||
specifier: ^8.5.0
|
||||
version: 8.5.0(eslint@9.10.0(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.6.2)
|
||||
specifier: ^8.6.0
|
||||
version: 8.6.0(eslint@9.10.0(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.6.2)
|
||||
|
||||
packages/vencord-types:
|
||||
dependencies:
|
||||
|
@ -717,17 +720,6 @@ packages:
|
|||
'@types/yazl@2.4.5':
|
||||
resolution: {integrity: sha512-qpmPfx32HS7vlGJf7EsoM9qJnLZhXJBf1KH0hzfdc+D794rljQWh4H0I/UrZy+6Nhqn0l2jdBZXBGZtR1vnHqw==}
|
||||
|
||||
'@typescript-eslint/eslint-plugin@8.5.0':
|
||||
resolution: {integrity: sha512-lHS5hvz33iUFQKuPFGheAB84LwcJ60G8vKnEhnfcK1l8kGVLro2SFYW6K0/tj8FUhRJ0VHyg1oAfg50QGbPPHw==}
|
||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||
peerDependencies:
|
||||
'@typescript-eslint/parser': ^8.0.0 || ^8.0.0-alpha.0
|
||||
eslint: ^8.57.0 || ^9.0.0
|
||||
typescript: '*'
|
||||
peerDependenciesMeta:
|
||||
typescript:
|
||||
optional: true
|
||||
|
||||
'@typescript-eslint/eslint-plugin@8.6.0':
|
||||
resolution: {integrity: sha512-UOaz/wFowmoh2G6Mr9gw60B1mm0MzUtm6Ic8G2yM1Le6gyj5Loi/N+O5mocugRGY+8OeeKmkMmbxNqUCq3B4Sg==}
|
||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||
|
@ -739,16 +731,6 @@ packages:
|
|||
typescript:
|
||||
optional: true
|
||||
|
||||
'@typescript-eslint/parser@8.5.0':
|
||||
resolution: {integrity: sha512-gF77eNv0Xz2UJg/NbpWJ0kqAm35UMsvZf1GHj8D9MRFTj/V3tAciIWXfmPLsAAF/vUlpWPvUDyH1jjsr0cMVWw==}
|
||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||
peerDependencies:
|
||||
eslint: ^8.57.0 || ^9.0.0
|
||||
typescript: '*'
|
||||
peerDependenciesMeta:
|
||||
typescript:
|
||||
optional: true
|
||||
|
||||
'@typescript-eslint/parser@8.6.0':
|
||||
resolution: {integrity: sha512-eQcbCuA2Vmw45iGfcyG4y6rS7BhWfz9MQuk409WD47qMM+bKCGQWXxvoOs1DUp+T7UBMTtRTVT+kXr7Sh4O9Ow==}
|
||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||
|
@ -759,23 +741,10 @@ packages:
|
|||
typescript:
|
||||
optional: true
|
||||
|
||||
'@typescript-eslint/scope-manager@8.5.0':
|
||||
resolution: {integrity: sha512-06JOQ9Qgj33yvBEx6tpC8ecP9o860rsR22hWMEd12WcTRrfaFgHr2RB/CA/B+7BMhHkXT4chg2MyboGdFGawYg==}
|
||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||
|
||||
'@typescript-eslint/scope-manager@8.6.0':
|
||||
resolution: {integrity: sha512-ZuoutoS5y9UOxKvpc/GkvF4cuEmpokda4wRg64JEia27wX+PysIE9q+lzDtlHHgblwUWwo5/Qn+/WyTUvDwBHw==}
|
||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||
|
||||
'@typescript-eslint/type-utils@8.5.0':
|
||||
resolution: {integrity: sha512-N1K8Ix+lUM+cIDhL2uekVn/ZD7TZW+9/rwz8DclQpcQ9rk4sIL5CAlBC0CugWKREmDjBzI/kQqU4wkg46jWLYA==}
|
||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||
peerDependencies:
|
||||
typescript: '*'
|
||||
peerDependenciesMeta:
|
||||
typescript:
|
||||
optional: true
|
||||
|
||||
'@typescript-eslint/type-utils@8.6.0':
|
||||
resolution: {integrity: sha512-dtePl4gsuenXVwC7dVNlb4mGDcKjDT/Ropsk4za/ouMBPplCLyznIaR+W65mvCvsyS97dymoBRrioEXI7k0XIg==}
|
||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||
|
@ -785,23 +754,10 @@ packages:
|
|||
typescript:
|
||||
optional: true
|
||||
|
||||
'@typescript-eslint/types@8.5.0':
|
||||
resolution: {integrity: sha512-qjkormnQS5wF9pjSi6q60bKUHH44j2APxfh9TQRXK8wbYVeDYYdYJGIROL87LGZZ2gz3Rbmjc736qyL8deVtdw==}
|
||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||
|
||||
'@typescript-eslint/types@8.6.0':
|
||||
resolution: {integrity: sha512-rojqFZGd4MQxw33SrOy09qIDS8WEldM8JWtKQLAjf/X5mGSeEFh5ixQlxssMNyPslVIk9yzWqXCsV2eFhYrYUw==}
|
||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||
|
||||
'@typescript-eslint/typescript-estree@8.5.0':
|
||||
resolution: {integrity: sha512-vEG2Sf9P8BPQ+d0pxdfndw3xIXaoSjliG0/Ejk7UggByZPKXmJmw3GW5jV2gHNQNawBUyfahoSiCFVov0Ruf7Q==}
|
||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||
peerDependencies:
|
||||
typescript: '*'
|
||||
peerDependenciesMeta:
|
||||
typescript:
|
||||
optional: true
|
||||
|
||||
'@typescript-eslint/typescript-estree@8.6.0':
|
||||
resolution: {integrity: sha512-MOVAzsKJIPIlLK239l5s06YXjNqpKTVhBVDnqUumQJja5+Y94V3+4VUFRA0G60y2jNnTVwRCkhyGQpavfsbq/g==}
|
||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||
|
@ -811,22 +767,12 @@ packages:
|
|||
typescript:
|
||||
optional: true
|
||||
|
||||
'@typescript-eslint/utils@8.5.0':
|
||||
resolution: {integrity: sha512-6yyGYVL0e+VzGYp60wvkBHiqDWOpT63pdMV2CVG4LVDd5uR6q1qQN/7LafBZtAtNIn/mqXjsSeS5ggv/P0iECw==}
|
||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||
peerDependencies:
|
||||
eslint: ^8.57.0 || ^9.0.0
|
||||
|
||||
'@typescript-eslint/utils@8.6.0':
|
||||
resolution: {integrity: sha512-eNp9cWnYf36NaOVjkEUznf6fEgVy1TWpE0o52e4wtojjBx7D1UV2WAWGzR+8Y5lVFtpMLPwNbC67T83DWSph4A==}
|
||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||
peerDependencies:
|
||||
eslint: ^8.57.0 || ^9.0.0
|
||||
|
||||
'@typescript-eslint/visitor-keys@8.5.0':
|
||||
resolution: {integrity: sha512-yTPqMnbAZJNy2Xq2XU8AdtOW9tJIr+UQb64aXB9f3B1498Zx9JorVgFJcZpEc9UBuCCrdzKID2RGAMkYcDtZOw==}
|
||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||
|
||||
'@typescript-eslint/visitor-keys@8.6.0':
|
||||
resolution: {integrity: sha512-wapVFfZg9H0qOYh4grNVQiMklJGluQrOUiOhYRrQWhx7BY/+I1IYb8BczWNbbUpO+pqy0rDciv3lQH5E1bCLrg==}
|
||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||
|
@ -1147,8 +1093,8 @@ packages:
|
|||
resolution: {integrity: sha512-9YLIBURXj4DJMFALxXw9K3Y3rwb5Fk0X5/8ipCzaN84+gKxoHK43tVKRNakCQbiEx07E8Uwhuq21BpUagFhZ8w==}
|
||||
engines: {node: '>= 0.6.0'}
|
||||
|
||||
devtools-protocol@0.0.1330662:
|
||||
resolution: {integrity: sha512-pzh6YQ8zZfz3iKlCvgzVCu22NdpZ8hNmwU6WnQjNVquh0A9iVosPtNLWDwaWVGyrntQlltPFztTMK5Cg6lfCuw==}
|
||||
devtools-protocol@0.0.1342118:
|
||||
resolution: {integrity: sha512-75fMas7PkYNDTmDyb6PRJCH7ILmHLp+BhrZGeMsa4bCh40DTxgCz2NRy5UDzII4C5KuD0oBMZ9vXKhEl6UD/3w==}
|
||||
|
||||
diff@7.0.0:
|
||||
resolution: {integrity: sha512-PJWHUb1RFevKCwaFA9RlG5tCd+FO5iRh9A8HEtkmBH2Li03iJriB6m6JIN4rGz3K3JLawI7/veA1xzRKP6ISBw==}
|
||||
|
@ -2007,8 +1953,8 @@ packages:
|
|||
resolution: {integrity: sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==}
|
||||
engines: {node: '>=6'}
|
||||
|
||||
puppeteer-core@23.3.1:
|
||||
resolution: {integrity: sha512-m5gTpITEqqpSgAvPUI/Ch9igh5sNJV+BVVbqQMzqirRDVHDCkLGHaydEQZx2NZvSXdwCFrIV///cpSlX/uD0Sg==}
|
||||
puppeteer-core@23.4.0:
|
||||
resolution: {integrity: sha512-fqkIP5FOcb38jfBj/OcBz1wFaI9nk40uQKSORvnXws6wCbep2dg8yxZ3ddJxBIfQsxoiEOvnrykFinUScrB/ew==}
|
||||
engines: {node: '>=18'}
|
||||
|
||||
q@1.5.1:
|
||||
|
@ -2347,8 +2293,8 @@ packages:
|
|||
typed-query-selector@2.12.0:
|
||||
resolution: {integrity: sha512-SbklCd1F0EiZOyPiW192rrHZzZ5sBijB6xM+cpmrwDqObvdtunOHHIk9fCGsoK5JVIYXoyEp4iEdE3upFH3PAg==}
|
||||
|
||||
typescript-eslint@8.5.0:
|
||||
resolution: {integrity: sha512-uD+XxEoSIvqtm4KE97etm32Tn5MfaZWgWfMMREStLxR6JzvHkc2Tkj7zhTEK5XmtpTmKHNnG8Sot6qDfhHtR1Q==}
|
||||
typescript-eslint@8.6.0:
|
||||
resolution: {integrity: sha512-eEhhlxCEpCd4helh3AO1hk0UP2MvbRi9CtIAJTVPQjuSXOOO2jsEacNi4UdcJzZJbeuVg1gMhtZ8UYb+NFYPrA==}
|
||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||
peerDependencies:
|
||||
typescript: '*'
|
||||
|
@ -2834,44 +2780,7 @@ snapshots:
|
|||
dependencies:
|
||||
'@types/node': 20.16.5
|
||||
|
||||
'@typescript-eslint/eslint-plugin@8.5.0(@typescript-eslint/parser@8.5.0(eslint@9.10.0(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.6.2))(eslint@9.10.0(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.6.2)':
|
||||
dependencies:
|
||||
'@eslint-community/regexpp': 4.11.0
|
||||
'@typescript-eslint/parser': 8.5.0(eslint@9.10.0(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.6.2)
|
||||
'@typescript-eslint/scope-manager': 8.5.0
|
||||
'@typescript-eslint/type-utils': 8.5.0(eslint@9.10.0(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.6.2)
|
||||
'@typescript-eslint/utils': 8.5.0(eslint@9.10.0(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.6.2)
|
||||
'@typescript-eslint/visitor-keys': 8.5.0
|
||||
eslint: 9.10.0(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi)
|
||||
graphemer: 1.4.0
|
||||
ignore: 5.3.2
|
||||
natural-compare: 1.4.0
|
||||
ts-api-utils: 1.3.0(typescript@5.6.2)
|
||||
optionalDependencies:
|
||||
typescript: 5.6.2
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
'@typescript-eslint/eslint-plugin@8.6.0(@typescript-eslint/parser@8.5.0(eslint@9.10.0(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.6.2))(eslint@9.10.0(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.6.2)':
|
||||
dependencies:
|
||||
'@eslint-community/regexpp': 4.11.0
|
||||
'@typescript-eslint/parser': 8.5.0(eslint@9.10.0(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.6.2)
|
||||
'@typescript-eslint/scope-manager': 8.6.0
|
||||
'@typescript-eslint/type-utils': 8.6.0(eslint@9.10.0(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.6.2)
|
||||
'@typescript-eslint/utils': 8.6.0(eslint@9.10.0(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.6.2)
|
||||
'@typescript-eslint/visitor-keys': 8.6.0
|
||||
eslint: 9.10.0(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi)
|
||||
graphemer: 1.4.0
|
||||
ignore: 5.3.2
|
||||
natural-compare: 1.4.0
|
||||
ts-api-utils: 1.3.0(typescript@5.6.2)
|
||||
optionalDependencies:
|
||||
typescript: 5.6.2
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
optional: true
|
||||
|
||||
'@typescript-eslint/eslint-plugin@8.6.0(@typescript-eslint/parser@8.6.0(eslint@9.10.0(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.6.2))(eslint@9.10.0(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.6.2)':
|
||||
'@typescript-eslint/eslint-plugin@8.6.0(patch_hash=rf3fsbgjxv7ylxpzkcvrp4lpfq)(@typescript-eslint/parser@8.6.0(eslint@9.10.0(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.6.2))(eslint@9.10.0(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.6.2)':
|
||||
dependencies:
|
||||
'@eslint-community/regexpp': 4.11.0
|
||||
'@typescript-eslint/parser': 8.6.0(eslint@9.10.0(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.6.2)
|
||||
|
@ -2888,20 +2797,6 @@ snapshots:
|
|||
typescript: 5.6.2
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
optional: true
|
||||
|
||||
'@typescript-eslint/parser@8.5.0(eslint@9.10.0(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.6.2)':
|
||||
dependencies:
|
||||
'@typescript-eslint/scope-manager': 8.5.0
|
||||
'@typescript-eslint/types': 8.5.0
|
||||
'@typescript-eslint/typescript-estree': 8.5.0(typescript@5.6.2)
|
||||
'@typescript-eslint/visitor-keys': 8.5.0
|
||||
debug: 4.3.7
|
||||
eslint: 9.10.0(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi)
|
||||
optionalDependencies:
|
||||
typescript: 5.6.2
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
'@typescript-eslint/parser@8.6.0(eslint@9.10.0(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.6.2)':
|
||||
dependencies:
|
||||
|
@ -2915,30 +2810,12 @@ snapshots:
|
|||
typescript: 5.6.2
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
optional: true
|
||||
|
||||
'@typescript-eslint/scope-manager@8.5.0':
|
||||
dependencies:
|
||||
'@typescript-eslint/types': 8.5.0
|
||||
'@typescript-eslint/visitor-keys': 8.5.0
|
||||
|
||||
'@typescript-eslint/scope-manager@8.6.0':
|
||||
dependencies:
|
||||
'@typescript-eslint/types': 8.6.0
|
||||
'@typescript-eslint/visitor-keys': 8.6.0
|
||||
|
||||
'@typescript-eslint/type-utils@8.5.0(eslint@9.10.0(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.6.2)':
|
||||
dependencies:
|
||||
'@typescript-eslint/typescript-estree': 8.5.0(typescript@5.6.2)
|
||||
'@typescript-eslint/utils': 8.5.0(eslint@9.10.0(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.6.2)
|
||||
debug: 4.3.7
|
||||
ts-api-utils: 1.3.0(typescript@5.6.2)
|
||||
optionalDependencies:
|
||||
typescript: 5.6.2
|
||||
transitivePeerDependencies:
|
||||
- eslint
|
||||
- supports-color
|
||||
|
||||
'@typescript-eslint/type-utils@8.6.0(eslint@9.10.0(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.6.2)':
|
||||
dependencies:
|
||||
'@typescript-eslint/typescript-estree': 8.6.0(typescript@5.6.2)
|
||||
|
@ -2950,27 +2827,9 @@ snapshots:
|
|||
transitivePeerDependencies:
|
||||
- eslint
|
||||
- supports-color
|
||||
optional: true
|
||||
|
||||
'@typescript-eslint/types@8.5.0': {}
|
||||
|
||||
'@typescript-eslint/types@8.6.0': {}
|
||||
|
||||
'@typescript-eslint/typescript-estree@8.5.0(typescript@5.6.2)':
|
||||
dependencies:
|
||||
'@typescript-eslint/types': 8.5.0
|
||||
'@typescript-eslint/visitor-keys': 8.5.0
|
||||
debug: 4.3.7
|
||||
fast-glob: 3.3.2
|
||||
is-glob: 4.0.3
|
||||
minimatch: 9.0.5
|
||||
semver: 7.6.3
|
||||
ts-api-utils: 1.3.0(typescript@5.6.2)
|
||||
optionalDependencies:
|
||||
typescript: 5.6.2
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
'@typescript-eslint/typescript-estree@8.6.0(typescript@5.6.2)':
|
||||
dependencies:
|
||||
'@typescript-eslint/types': 8.6.0
|
||||
|
@ -2986,17 +2845,6 @@ snapshots:
|
|||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
'@typescript-eslint/utils@8.5.0(eslint@9.10.0(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.6.2)':
|
||||
dependencies:
|
||||
'@eslint-community/eslint-utils': 4.4.0(eslint@9.10.0(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))
|
||||
'@typescript-eslint/scope-manager': 8.5.0
|
||||
'@typescript-eslint/types': 8.5.0
|
||||
'@typescript-eslint/typescript-estree': 8.5.0(typescript@5.6.2)
|
||||
eslint: 9.10.0(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi)
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
- typescript
|
||||
|
||||
'@typescript-eslint/utils@8.6.0(eslint@9.10.0(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.6.2)':
|
||||
dependencies:
|
||||
'@eslint-community/eslint-utils': 4.4.0(eslint@9.10.0(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))
|
||||
|
@ -3008,11 +2856,6 @@ snapshots:
|
|||
- supports-color
|
||||
- typescript
|
||||
|
||||
'@typescript-eslint/visitor-keys@8.5.0':
|
||||
dependencies:
|
||||
'@typescript-eslint/types': 8.5.0
|
||||
eslint-visitor-keys: 3.4.3
|
||||
|
||||
'@typescript-eslint/visitor-keys@8.6.0':
|
||||
dependencies:
|
||||
'@typescript-eslint/types': 8.6.0
|
||||
|
@ -3194,9 +3037,9 @@ snapshots:
|
|||
ansi-styles: 4.3.0
|
||||
supports-color: 7.2.0
|
||||
|
||||
chromium-bidi@0.6.5(devtools-protocol@0.0.1330662):
|
||||
chromium-bidi@0.6.5(devtools-protocol@0.0.1342118):
|
||||
dependencies:
|
||||
devtools-protocol: 0.0.1330662
|
||||
devtools-protocol: 0.0.1342118
|
||||
mitt: 3.0.1
|
||||
urlpattern-polyfill: 10.0.0
|
||||
zod: 3.23.8
|
||||
|
@ -3322,7 +3165,7 @@ snapshots:
|
|||
|
||||
dependency-graph@0.9.0: {}
|
||||
|
||||
devtools-protocol@0.0.1330662: {}
|
||||
devtools-protocol@0.0.1342118: {}
|
||||
|
||||
diff@7.0.0: {}
|
||||
|
||||
|
@ -3495,17 +3338,11 @@ snapshots:
|
|||
semver: 7.6.3
|
||||
strip-indent: 3.0.0
|
||||
|
||||
eslint-plugin-unused-imports@4.1.4(@typescript-eslint/eslint-plugin@8.6.0(@typescript-eslint/parser@8.5.0(eslint@9.10.0(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.6.2))(eslint@9.10.0(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.6.2))(eslint@9.10.0(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi)):
|
||||
eslint-plugin-unused-imports@4.1.4(@typescript-eslint/eslint-plugin@8.6.0(patch_hash=rf3fsbgjxv7ylxpzkcvrp4lpfq)(@typescript-eslint/parser@8.6.0(eslint@9.10.0(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.6.2))(eslint@9.10.0(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.6.2))(eslint@9.10.0(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi)):
|
||||
dependencies:
|
||||
eslint: 9.10.0(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi)
|
||||
optionalDependencies:
|
||||
'@typescript-eslint/eslint-plugin': 8.6.0(@typescript-eslint/parser@8.5.0(eslint@9.10.0(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.6.2))(eslint@9.10.0(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.6.2)
|
||||
|
||||
eslint-plugin-unused-imports@4.1.4(@typescript-eslint/eslint-plugin@8.6.0(@typescript-eslint/parser@8.6.0(eslint@9.10.0(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.6.2))(eslint@9.10.0(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.6.2))(eslint@9.10.0(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi)):
|
||||
dependencies:
|
||||
eslint: 9.10.0(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi)
|
||||
optionalDependencies:
|
||||
'@typescript-eslint/eslint-plugin': 8.6.0(@typescript-eslint/parser@8.6.0(eslint@9.10.0(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.6.2))(eslint@9.10.0(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.6.2)
|
||||
'@typescript-eslint/eslint-plugin': 8.6.0(patch_hash=rf3fsbgjxv7ylxpzkcvrp4lpfq)(@typescript-eslint/parser@8.6.0(eslint@9.10.0(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.6.2))(eslint@9.10.0(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.6.2)
|
||||
|
||||
eslint-scope@8.0.2:
|
||||
dependencies:
|
||||
|
@ -4249,12 +4086,12 @@ snapshots:
|
|||
|
||||
punycode@2.1.1: {}
|
||||
|
||||
puppeteer-core@23.3.1:
|
||||
puppeteer-core@23.4.0:
|
||||
dependencies:
|
||||
'@puppeteer/browsers': 2.4.0
|
||||
chromium-bidi: 0.6.5(devtools-protocol@0.0.1330662)
|
||||
chromium-bidi: 0.6.5(devtools-protocol@0.0.1342118)
|
||||
debug: 4.3.7
|
||||
devtools-protocol: 0.0.1330662
|
||||
devtools-protocol: 0.0.1342118
|
||||
typed-query-selector: 2.12.0
|
||||
ws: 8.18.0
|
||||
transitivePeerDependencies:
|
||||
|
@ -4639,11 +4476,11 @@ snapshots:
|
|||
|
||||
typed-query-selector@2.12.0: {}
|
||||
|
||||
typescript-eslint@8.5.0(eslint@9.10.0(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.6.2):
|
||||
typescript-eslint@8.6.0(eslint@9.10.0(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.6.2):
|
||||
dependencies:
|
||||
'@typescript-eslint/eslint-plugin': 8.5.0(@typescript-eslint/parser@8.5.0(eslint@9.10.0(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.6.2))(eslint@9.10.0(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.6.2)
|
||||
'@typescript-eslint/parser': 8.5.0(eslint@9.10.0(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.6.2)
|
||||
'@typescript-eslint/utils': 8.5.0(eslint@9.10.0(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.6.2)
|
||||
'@typescript-eslint/eslint-plugin': 8.6.0(patch_hash=rf3fsbgjxv7ylxpzkcvrp4lpfq)(@typescript-eslint/parser@8.6.0(eslint@9.10.0(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.6.2))(eslint@9.10.0(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.6.2)
|
||||
'@typescript-eslint/parser': 8.6.0(eslint@9.10.0(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.6.2)
|
||||
'@typescript-eslint/utils': 8.6.0(eslint@9.10.0(patch_hash=wy5a2dwvtxac2ygzwebqqjurgi))(typescript@5.6.2)
|
||||
optionalDependencies:
|
||||
typescript: 5.6.2
|
||||
transitivePeerDependencies:
|
||||
|
|
|
@ -297,10 +297,10 @@ export default function PluginSettings() {
|
|||
|
||||
if (!pluginFilter(p)) continue;
|
||||
|
||||
const isRequired = p.required || depMap[p.name]?.some(d => settings.plugins[d]!.enabled);
|
||||
const isRequired = p.required || p.isDependency || depMap[p.name]?.some(d => settings.plugins[d]!.enabled);
|
||||
|
||||
if (isRequired) {
|
||||
const tooltipText = p.required
|
||||
const tooltipText = p.required || !depMap[p.name]
|
||||
? "This plugin is required for Vencord to function."
|
||||
: makeDependencyList(depMap[p.name]?.filter(d => settings.plugins[d]!.enabled));
|
||||
|
||||
|
|
|
@ -143,7 +143,7 @@ export default definePlugin({
|
|||
required: true,
|
||||
description: "Helps us provide support to you",
|
||||
authors: [Devs.Ven],
|
||||
dependencies: ["CommandsAPI", "UserSettingsAPI", "MessageAccessoriesAPI"],
|
||||
dependencies: ["UserSettingsAPI", "MessageAccessoriesAPI"],
|
||||
|
||||
settings,
|
||||
|
||||
|
|
|
@ -19,8 +19,8 @@ interface ActivityButton {
|
|||
|
||||
export interface TrackData {
|
||||
name: string;
|
||||
album: string;
|
||||
artist: string;
|
||||
album?: string;
|
||||
artist?: string;
|
||||
|
||||
appleMusicLink?: string;
|
||||
songLink?: string;
|
||||
|
@ -28,8 +28,8 @@ export interface TrackData {
|
|||
albumArtwork?: string;
|
||||
artistArtwork?: string;
|
||||
|
||||
playerPosition: number;
|
||||
duration: number;
|
||||
playerPosition?: number;
|
||||
duration?: number;
|
||||
}
|
||||
|
||||
const enum AssetImageType {
|
||||
|
@ -126,8 +126,8 @@ const settings = definePluginSettings({
|
|||
function customFormat(formatStr: string, data: TrackData) {
|
||||
return formatStr
|
||||
.replaceAll("{name}", data.name)
|
||||
.replaceAll("{album}", data.album)
|
||||
.replaceAll("{artist}", data.artist);
|
||||
.replaceAll("{album}", data.album ?? "")
|
||||
.replaceAll("{artist}", data.artist ?? "");
|
||||
}
|
||||
|
||||
async function getImageAsset(type: AssetImageType, data: TrackData) {
|
||||
|
@ -184,14 +184,16 @@ export default definePlugin({
|
|||
|
||||
const assets: ActivityAssets = {};
|
||||
|
||||
const isRadio = Number.isNaN(trackData.duration) && (trackData.playerPosition === 0);
|
||||
|
||||
if (settings.store.largeImageType !== AssetImageType.Disabled) {
|
||||
assets.large_image = largeImageAsset;
|
||||
assets.large_text = customFormat(settings.store.largeTextString, trackData);
|
||||
if (!isRadio) assets.large_text = customFormat(settings.store.largeTextString, trackData);
|
||||
}
|
||||
|
||||
if (settings.store.smallImageType !== AssetImageType.Disabled) {
|
||||
assets.small_image = smallImageAsset;
|
||||
assets.small_text = customFormat(settings.store.smallTextString, trackData);
|
||||
if (!isRadio) assets.small_text = customFormat(settings.store.smallTextString, trackData);
|
||||
}
|
||||
|
||||
const buttons: ActivityButton[] = [];
|
||||
|
@ -219,17 +221,17 @@ export default definePlugin({
|
|||
|
||||
name: customFormat(settings.store.nameString, trackData),
|
||||
details: customFormat(settings.store.detailsString, trackData),
|
||||
state: customFormat(settings.store.stateString, trackData),
|
||||
state: isRadio ? undefined : customFormat(settings.store.stateString, trackData),
|
||||
|
||||
timestamps: (settings.store.enableTimestamps ? {
|
||||
timestamps: (trackData.playerPosition && trackData.duration && settings.store.enableTimestamps) ? {
|
||||
start: Date.now() - (trackData.playerPosition * 1000),
|
||||
end: Date.now() - (trackData.playerPosition * 1000) + (trackData.duration * 1000),
|
||||
} : undefined),
|
||||
} : undefined,
|
||||
|
||||
assets,
|
||||
|
||||
buttons: buttons.length ? buttons.map(v => v.label) : undefined,
|
||||
metadata: { button_urls: buttons.length ? buttons.map(v => v.url) : undefined },
|
||||
buttons: !isRadio && buttons.length ? buttons.map(v => v.label) : undefined,
|
||||
metadata: !isRadio && buttons.length ? { button_urls: buttons.map(v => v.url) } : undefined,
|
||||
|
||||
type: settings.store.activityType,
|
||||
flags: ActivityFlags.INSTANCE,
|
||||
|
|
68
src/plugins/betterSettings/PluginsSubmenu.tsx
Normal file
68
src/plugins/betterSettings/PluginsSubmenu.tsx
Normal file
|
@ -0,0 +1,68 @@
|
|||
/*
|
||||
* Vencord, a Discord client mod
|
||||
* Copyright (c) 2024 Vendicated and contributors
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
import { openPluginModal } from "@components/PluginSettings/PluginModal";
|
||||
import { isObjectEmpty } from "@utils/misc";
|
||||
import { AlertActionCreators, i18n, Menu, useMemo, useState } from "@webpack/common";
|
||||
|
||||
import Plugins from "~plugins";
|
||||
|
||||
function onRestartNeeded() {
|
||||
AlertActionCreators.show({
|
||||
title: "Restart required",
|
||||
body: <p>You have changed settings that require a restart.</p>,
|
||||
confirmText: "Restart now",
|
||||
cancelText: "Later!",
|
||||
onConfirm: () => { location.reload(); }
|
||||
});
|
||||
}
|
||||
|
||||
export default function PluginsSubmenu() {
|
||||
const sortedPlugins = useMemo(() => Object.values(Plugins)
|
||||
.sort((a, b) => a.name.localeCompare(b.name)), []);
|
||||
const [query, setQuery] = useState("");
|
||||
|
||||
const search = query.toLowerCase();
|
||||
const include = (p: typeof Plugins[keyof typeof Plugins]) => (
|
||||
Vencord.Plugins.isPluginEnabled(p.name)
|
||||
&& p.options && !isObjectEmpty(p.options)
|
||||
&& (
|
||||
p.name.toLowerCase().includes(search)
|
||||
|| p.description.toLowerCase().includes(search)
|
||||
|| p.tags?.some(t => t.toLowerCase().includes(search))
|
||||
)
|
||||
);
|
||||
|
||||
const plugins = sortedPlugins.filter(include);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Menu.MenuControlItem
|
||||
id="vc-plugins-search"
|
||||
control={(props: any, ref: any) => (
|
||||
<Menu.MenuSearchControl
|
||||
{...props}
|
||||
query={query}
|
||||
onChange={setQuery}
|
||||
ref={ref}
|
||||
placeholder={i18n.Messages.SEARCH}
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
|
||||
{!!plugins.length && <Menu.MenuSeparator />}
|
||||
|
||||
{plugins.map(p => (
|
||||
<Menu.MenuItem
|
||||
key={p.name}
|
||||
id={p.name}
|
||||
label={p.name}
|
||||
action={() => { openPluginModal(p, onRestartNeeded); }}
|
||||
/>
|
||||
))}
|
||||
</>
|
||||
);
|
||||
}
|
|
@ -13,7 +13,9 @@ import { waitFor } from "@webpack";
|
|||
import { ComponentDispatch, FocusLock, i18n, Menu, useEffect, useRef } from "@webpack/common";
|
||||
import type { HTMLAttributes, ReactElement } from "react";
|
||||
|
||||
type SettingsEntry = { section: string; label: string; };
|
||||
import PluginsSubmenu from "./PluginsSubmenu";
|
||||
|
||||
interface SettingsEntry { section: string; label: string; }
|
||||
|
||||
const cl = classNameFactory("");
|
||||
let Classes: Record<string, string>;
|
||||
|
@ -118,13 +120,21 @@ export default definePlugin({
|
|||
},
|
||||
{ // Settings cog context menu
|
||||
find: "Messages.USER_SETTINGS_ACTIONS_MENU_LABEL",
|
||||
replacement: {
|
||||
match: /(EXPERIMENTS:.+?)(\(0,\i.\i\)\(\))(?=\.filter\(\i=>\{let\{section:\i\}=)/,
|
||||
replace: "$1$self.wrapMenu($2)"
|
||||
}
|
||||
}
|
||||
replacement: [
|
||||
{
|
||||
match: /(EXPERIMENTS:.+?)(\(0,\i.\i\)\(\))(?=\.filter\(\i=>\{let\{section:\i\}=)/,
|
||||
replace: "$1$self.wrapMenu($2)"
|
||||
},
|
||||
{
|
||||
match: /case \i\.\i\.DEVELOPER_OPTIONS:return \i;/,
|
||||
replace: "$&case 'VencordPlugins':return $self.PluginsSubmenu();"
|
||||
}
|
||||
]
|
||||
},
|
||||
],
|
||||
|
||||
PluginsSubmenu,
|
||||
|
||||
// This is the very outer layer of the entire ui, so we can't wrap this in an ErrorBoundary
|
||||
// without possibly also catching unrelated errors of children.
|
||||
//
|
||||
|
|
|
@ -126,7 +126,7 @@ export default definePlugin({
|
|||
}
|
||||
},
|
||||
{
|
||||
find: '"Handling ping: "',
|
||||
find: '"_handleLocalVideoDisabled: ',
|
||||
predicate: () => settings.store.disableNoisyLoggers,
|
||||
replacement: {
|
||||
match: /new \i\.\i\("RTCConnection\("\.concat.+?\)\)(?=,)/,
|
||||
|
|
|
@ -23,12 +23,13 @@ import { ErrorCard } from "@components/ErrorCard";
|
|||
import { Devs } from "@utils/constants";
|
||||
import { Margins } from "@utils/margins";
|
||||
import definePlugin, { OptionType } from "@utils/types";
|
||||
import { findByPropsLazy } from "@webpack";
|
||||
import { findByPropsLazy, findLazy } from "@webpack";
|
||||
import { Forms } from "@webpack/common";
|
||||
|
||||
import hideBugReport from "./hideBugReport.css?managed";
|
||||
|
||||
const KbdStyles: Record<string, string> = findByPropsLazy("key", "combo");
|
||||
const BugReporterExperiment = findLazy(m => m?.definition?.id === "2024-09_bug_reporter");
|
||||
|
||||
const settings = definePluginSettings({
|
||||
toolbarDevMenu: {
|
||||
|
@ -78,8 +79,8 @@ export default definePlugin({
|
|||
{
|
||||
find: "toolbar:function",
|
||||
replacement: {
|
||||
match: /\i\.isStaff\(\)/,
|
||||
replace: "true"
|
||||
match: /hasBugReporterAccess:(\i)/,
|
||||
replace: "_hasBugReporterAccess:$1=true"
|
||||
},
|
||||
predicate: () => settings.store.toolbarDevMenu
|
||||
},
|
||||
|
@ -91,10 +92,21 @@ export default definePlugin({
|
|||
match: /\i\.isDM\(\)\|\|\i\.isThread\(\)/,
|
||||
replace: "false",
|
||||
}
|
||||
},
|
||||
// enable option to always record clips even if you are not streaming
|
||||
{
|
||||
find: "isDecoupledGameClippingEnabled(){",
|
||||
replacement: {
|
||||
match: /\i\.isStaff\(\)/,
|
||||
replace: "true"
|
||||
}
|
||||
}
|
||||
],
|
||||
|
||||
start() { enableStyle(hideBugReport); },
|
||||
start() {
|
||||
if (!BugReporterExperiment.getCurrentConfig().hasBugReporterAccess)
|
||||
enableStyle(hideBugReport);
|
||||
},
|
||||
stop() { disableStyle(hideBugReport); },
|
||||
|
||||
settingsAboutComponent() {
|
||||
|
|
|
@ -25,7 +25,6 @@ export default definePlugin({
|
|||
name: "FriendInvites",
|
||||
description: "Create and manage friend invite links via slash commands (/create friend invite, /view friend invites, /revoke friend invites).",
|
||||
authors: [Devs.afn, Devs.Dziurwa],
|
||||
dependencies: ["CommandsAPI"],
|
||||
commands: [
|
||||
{
|
||||
name: "create friend invite",
|
||||
|
|
|
@ -105,6 +105,11 @@ for (const p of pluginsValues) if (isPluginEnabled(p.name)) {
|
|||
settings[d]!.enabled = true;
|
||||
dep.isDependency = true;
|
||||
});
|
||||
|
||||
if (p.commands?.length) {
|
||||
Plugins.CommandsAPI!.isDependency = true;
|
||||
settings.CommandsAPI!.enabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
for (const p of pluginsValues) {
|
||||
|
|
|
@ -86,7 +86,6 @@ export default definePlugin({
|
|||
default: true
|
||||
}
|
||||
},
|
||||
dependencies: ["CommandsAPI"],
|
||||
|
||||
async start() {
|
||||
for (const tag of await getTags())
|
||||
|
|
|
@ -33,7 +33,6 @@ export default definePlugin({
|
|||
name: "MoreCommands",
|
||||
description: "echo, lenny, mock",
|
||||
authors: [Devs.Arjix, Devs.echo, Devs.Samu],
|
||||
dependencies: ["CommandsAPI"],
|
||||
commands: [
|
||||
{
|
||||
name: "echo",
|
||||
|
|
|
@ -24,7 +24,6 @@ export default definePlugin({
|
|||
name: "MoreKaomoji",
|
||||
description: "Adds more Kaomoji to discord. ヽ(´▽`)/",
|
||||
authors: [Devs.JacobTm],
|
||||
dependencies: ["CommandsAPI"],
|
||||
commands: [
|
||||
{ name: "dissatisfaction", description: " >﹏<" },
|
||||
{ name: "smug", description: "ಠ_ಠ" },
|
||||
|
|
|
@ -89,7 +89,6 @@ export default definePlugin({
|
|||
name: "petpet",
|
||||
description: "Adds a /petpet slash command to create headpet gifs from any image",
|
||||
authors: [Devs.Ven],
|
||||
dependencies: ["CommandsAPI"],
|
||||
commands: [
|
||||
{
|
||||
inputType: ApplicationCommandInputType.BUILT_IN,
|
||||
|
|
|
@ -91,7 +91,7 @@ export default definePlugin({
|
|||
}
|
||||
},
|
||||
{
|
||||
find: ".PANEL,isInteractionSource:",
|
||||
find: ".PANEL,interactionType:",
|
||||
replacement: {
|
||||
match: /{profileType:\i\.\i\.PANEL,children:\[/,
|
||||
replace: "$&$self.BiteSizeReviewsButton({user:arguments[0].user}),"
|
||||
|
|
|
@ -91,7 +91,7 @@ export default definePlugin({
|
|||
name: "SilentTyping",
|
||||
authors: [Devs.Ven, Devs.Rini, Devs.ImBanana],
|
||||
description: "Hide that you are typing",
|
||||
dependencies: ["CommandsAPI", "ChatInputButtonAPI"],
|
||||
dependencies: ["ChatInputButtonAPI"],
|
||||
settings,
|
||||
contextMenus: {
|
||||
"textarea-context": ChatBarContextCheckbox
|
||||
|
|
|
@ -79,7 +79,6 @@ export default definePlugin({
|
|||
name: "SpotifyShareCommands",
|
||||
description: "Share your current Spotify track, album or artist via slash command (/track, /album, /artist)",
|
||||
authors: [Devs.katlyn],
|
||||
dependencies: ["CommandsAPI"],
|
||||
commands: [
|
||||
{
|
||||
name: "track",
|
||||
|
|
|
@ -74,13 +74,13 @@ export interface PluginDef {
|
|||
stop?: () => void;
|
||||
patches?: Omit<Patch, "plugin">[];
|
||||
/**
|
||||
* List of commands. If you specify these, you must add CommandsAPI to dependencies
|
||||
* List of commands that your plugin wants to register
|
||||
*/
|
||||
commands?: Command[];
|
||||
/**
|
||||
* A list of other plugins that your plugin depends on.
|
||||
* These will automatically be enabled and loaded before your plugin
|
||||
* Common examples are CommandsAPI, MessageEventsAPI...
|
||||
* Generally these will be API plugins
|
||||
*/
|
||||
dependencies?: string[];
|
||||
/**
|
||||
|
|
|
@ -29,6 +29,9 @@ export let Forms = {} as {
|
|||
FormText: t.FormText;
|
||||
};
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
||||
export let Icons = {} as t.Icons;
|
||||
|
||||
export let Card: t.Card;
|
||||
export let Button: t.Button;
|
||||
export let Switch: t.Switch;
|
||||
|
@ -87,4 +90,5 @@ waitFor(["FormItem", "Button"], m => {
|
|||
Heading
|
||||
} = m);
|
||||
Forms = m;
|
||||
Icons = m;
|
||||
});
|
||||
|
|
|
@ -19,6 +19,8 @@
|
|||
import type { Theme } from "@vencord/discord-types";
|
||||
import type { ComponentType, CSSProperties, FunctionComponent, HtmlHTMLAttributes, HTMLProps, JSX, Key, KeyboardEvent, MouseEvent, PropsWithChildren, PropsWithRef, ReactNode, Ref, RefObject } from "react";
|
||||
|
||||
import type { IconNames } from "./iconNames";
|
||||
|
||||
export type TextVariant = "heading-sm/normal" | "heading-sm/medium" | "heading-sm/semibold" | "heading-sm/bold" | "heading-md/normal" | "heading-md/medium" | "heading-md/semibold" | "heading-md/bold" | "heading-lg/normal" | "heading-lg/medium" | "heading-lg/semibold" | "heading-lg/bold" | "heading-xl/normal" | "heading-xl/medium" | "heading-xl/bold" | "heading-xxl/normal" | "heading-xxl/medium" | "heading-xxl/bold" | "eyebrow" | "heading-deprecated-14/normal" | "heading-deprecated-14/medium" | "heading-deprecated-14/bold" | "text-xxs/normal" | "text-xxs/medium" | "text-xxs/semibold" | "text-xxs/bold" | "text-xs/normal" | "text-xs/medium" | "text-xs/semibold" | "text-xs/bold" | "text-sm/normal" | "text-sm/medium" | "text-sm/semibold" | "text-sm/bold" | "text-md/normal" | "text-md/medium" | "text-md/semibold" | "text-md/bold" | "text-lg/normal" | "text-lg/medium" | "text-lg/semibold" | "text-lg/bold" | "display-sm" | "display-md" | "display-lg" | "code";
|
||||
export type FormTextTypes = Record<"DEFAULT" | "INPUT_PLACEHOLDER" | "DESCRIPTION" | "LABEL_BOLD" | "LABEL_SELECTED" | "LABEL_DESCRIPTOR" | "ERROR" | "SUCCESS", string>;
|
||||
export type HeadingTag = `h${1 | 2 | 3 | 4 | 5 | 6}`;
|
||||
|
@ -69,7 +71,7 @@ export type FormText = ComponentType<PropsWithChildren<{
|
|||
}> & TextProps> & { Types: FormTextTypes; };
|
||||
|
||||
export type Tooltip = ComponentType<{
|
||||
text: ReactNode;
|
||||
text: ReactNode | ComponentType;
|
||||
children: FunctionComponent<{
|
||||
onClick: () => void;
|
||||
onMouseEnter: () => void;
|
||||
|
@ -491,6 +493,13 @@ export type FocusLock = ComponentType<PropsWithChildren<{
|
|||
containerRef: RefObject<HTMLElement>;
|
||||
}>>;
|
||||
|
||||
export type Icon = ComponentType<JSX.IntrinsicElements["svg"] & {
|
||||
size?: string;
|
||||
colorClass?: string;
|
||||
} & Record<string, any>>;
|
||||
|
||||
export type Icons = Record<IconNames, Icon>;
|
||||
|
||||
export interface Tokens {
|
||||
colors: Record<string, {
|
||||
css: string;
|
||||
|
|
14
src/webpack/common/types/iconNames.ts
Normal file
14
src/webpack/common/types/iconNames.ts
Normal file
File diff suppressed because one or more lines are too long
|
@ -72,6 +72,11 @@ export interface Menu {
|
|||
onChange: (value: number) => void;
|
||||
renderValue?: (value: number) => string;
|
||||
}>;
|
||||
MenuSearchControl: RC<{
|
||||
query: string;
|
||||
onChange: (query: string) => void;
|
||||
placeholder?: string;
|
||||
}>;
|
||||
}
|
||||
|
||||
export interface ContextMenuApi {
|
||||
|
|
Loading…
Reference in a new issue