Merge remote-tracking branch 'upstream/dev' into dev

This commit is contained in:
thororen1234 2025-04-02 16:24:56 -04:00
commit a1cc1bb826
No known key found for this signature in database
15 changed files with 590 additions and 823 deletions

View file

@ -26,8 +26,8 @@
"generatePluginJson": "tsx scripts/generatePluginList.ts",
"generateEquicordPluginJson": "tsx scripts/generateEquicordPluginList.ts",
"generateTypes": "tspc --emitDeclarationOnly --declaration --outDir packages/vencord-types --allowJs false",
"inject": "node scripts/runInstaller.mjs",
"uninject": "node scripts/runInstaller.mjs",
"inject": "node scripts/runInstaller.mjs -- --install",
"uninject": "node scripts/runInstaller.mjs -- --uninstall",
"lint": "eslint",
"lint-styles": "stylelint \"src/**/*.css\" --ignore-pattern src/userplugins",
"lint:fix": "pnpm lint --fix",
@ -50,26 +50,26 @@
"jsqr": "1.4.0",
"idb": "8.0.0",
"monaco-editor": "^0.52.2",
"nanoid": "^5.0.9",
"nanoid": "^5.1.5",
"socket.io": "^4.8.1",
"usercss-meta": "^0.12.0",
"openai": "^4.30.0",
"virtual-merge": "^1.0.1"
},
"devDependencies": {
"@stylistic/eslint-plugin": "^4.0.0",
"@stylistic/eslint-plugin": "^4.2.0",
"@electron/asar": "^3.2.10",
"@types/chrome": "^0.0.304",
"@types/diff": "^7.0.1",
"@types/chrome": "^0.0.312",
"@types/diff": "^7.0.2",
"@types/lodash": "^4.17.14",
"@types/node": "^22.10.5",
"@types/node": "^22.13.13",
"@types/react": "^19.0.10",
"@types/react-dom": "^19.0.4",
"@types/yazl": "^2.4.5",
"diff": "^7.0.0",
"discord-types": "^1.3.26",
"esbuild": "^0.25.0",
"eslint": "^9.20.1",
"esbuild": "^0.25.1",
"eslint": "9.20.1",
"eslint-import-resolver-alias": "^1.1.2",
"eslint-plugin-react": "^7.37.3",
"eslint-plugin-simple-header": "^1.2.1",
@ -78,18 +78,18 @@
"highlight.js": "11.11.1",
"html-minifier-terser": "^7.2.0",
"moment": "^2.22.2",
"puppeteer-core": "^24.2.1",
"puppeteer-core": "^24.4.0",
"standalone-electron-types": "^34.2.0",
"stylelint": "^16.12.0",
"stylelint": "^16.17.0",
"stylelint-config-standard": "^37.0.0",
"ts-patch": "^3.3.0",
"ts-pattern": "^5.6.0",
"tsx": "^4.19.2",
"type-fest": "^4.31.0",
"tsx": "^4.19.3",
"type-fest": "^4.38.0",
"typed-emitter": "^2.1.0",
"typescript": "^5.7.2",
"typescript-eslint": "^8.19.0",
"typescript-transform-paths": "^3.5.3",
"typescript": "^5.8.2",
"typescript-eslint": "^8.28.0",
"typescript-transform-paths": "^3.5.5",
"zip-local": "^0.3.5",
"zustand": "^3.7.2"
},

1261
pnpm-lock.yaml generated

File diff suppressed because it is too large Load diff

View file

@ -118,8 +118,11 @@ const installerBin = await ensureBinary();
console.log("Now running Installer...");
const argStart = process.argv.indexOf("--");
const args = argStart === -1 ? [] : process.argv.slice(argStart + 1);
try {
execFileSync(installerBin, {
execFileSync(installerBin, args, {
stdio: "inherit",
env: {
...process.env,

View file

@ -51,6 +51,7 @@ export function SettingTextComponent({ option, pluginSettings, definedSettings,
onChange={handleChange}
placeholder={option.placeholder ?? "Enter a value"}
disabled={option.disabled?.call(definedSettings) ?? false}
maxLength={null}
{...option.componentProps}
/>
{error && <Forms.FormText style={{ color: "var(--text-danger)" }}>{error}</Forms.FormText>}

View file

@ -128,8 +128,8 @@ function EquicordSettings() {
isEquicordDonor(user?.id) && isVencordDonor(user?.id)
? "All Vencord users can see your Vencord donor badge, and Equicord users can see your Equicord donor badge. To change your Vencord donor badge, contact @vending.machine. For your Equicord donor badge, make a ticket in Equicord's server."
: isVencordDonor(user?.id)
? "All Vencord users can see your badge! You can change it at any time by messaging @vending.machine."
: "All Equicord users can see your badge! You can change it at any time by making a ticket in Equicord's server."
? "All Vencord users can see your badge! You can manage your perks by messaging @vending.machine."
: "All Equicord users can see your badge! You can manage your perks by making a ticket in Equicord's server."
}
cardImage={VENNIE_DONATOR_IMAGE}
backgroundImage={DONOR_BACKGROUND_IMAGE}

View file

@ -12,7 +12,7 @@
}
.visual-refresh .vc-addon-card {
background-color: var(--button-secondary-background);
background-color: var(--card-primary-bg);
border: 1px solid var(--border-subtle);
}
@ -27,7 +27,8 @@
}
.visual-refresh .vc-addon-card:hover {
background-color: var(--button-secondary-background-hover);
/* same as non-hover, here to overwrite the non-refresh hover background */
background-color: var(--card-primary-bg);
}
.vc-addon-header {

View file

@ -22,7 +22,7 @@ import ErrorBoundary from "@components/ErrorBoundary";
import { Flex } from "@components/Flex";
import { Link } from "@components/Link";
import { openUpdaterModal } from "@components/VencordSettings/UpdaterTab";
import { CONTRIB_ROLE_ID, Devs, DONOR_ROLE_ID, EQUIBOP_CONTRIB_ROLE_ID, EQUICORD_TEAM, GUILD_ID, SUPPORT_CHANNEL_ID, SUPPORT_CHANNEL_IDS, VC_CONTRIB_ROLE_ID, VC_DONOR_ROLE_ID, VC_GUILD_ID, VC_KNOWN_ISSUES_CHANNEL_ID, VC_REGULAR_ROLE_ID, VC_SUPPORT_CHANNEL_ID, VENBOT_USER_ID, VENCORD_CONTRIB_ROLE_ID } from "@utils/constants";
import { CONTRIB_ROLE_ID, Devs, DONOR_ROLE_ID, EQUCORD_HELPERS, EQUIBOP_CONTRIB_ROLE_ID, EQUICORD_TEAM, GUILD_ID, SUPPORT_CHANNEL_ID, VC_CONTRIB_ROLE_ID, VC_DONOR_ROLE_ID, VC_GUILD_ID, VC_REGULAR_ROLE_ID, VC_SUPPORT_CHANNEL_ID, VENCORD_CONTRIB_ROLE_ID } from "@utils/constants";
import { sendMessage } from "@utils/discord";
import { Logger } from "@utils/Logger";
import { Margins } from "@utils/margins";
@ -32,7 +32,7 @@ import { onlyOnce } from "@utils/onlyOnce";
import { makeCodeblock } from "@utils/text";
import definePlugin from "@utils/types";
import { checkForUpdates, isOutdated, update } from "@utils/updater";
import { Alerts, Button, Card, ChannelStore, Forms, GuildMemberStore, Parser, RelationshipStore, showToast, Text, Toasts, UserStore } from "@webpack/common";
import { Alerts, Button, Card, ChannelStore, Forms, GuildMemberStore, Parser, PermissionsBits, PermissionStore, RelationshipStore, showToast, Text, Toasts, UserStore } from "@webpack/common";
import { JSX } from "react";
import gitHash from "~git-hash";
@ -196,7 +196,8 @@ export default definePlugin({
flux: {
async CHANNEL_SELECT({ channelId }) {
if (!SUPPORT_CHANNEL_IDS.includes(channelId)) return;
const isSupportChannel = channelId === SUPPORT_CHANNEL_ID;
if (!isSupportChannel) return;
const selfId = UserStore.getCurrentUser()?.id;
if (!selfId || isPluginDev(selfId) || isEquicordPluginDev(selfId)) return;
@ -281,11 +282,12 @@ export default definePlugin({
renderMessageAccessory(props) {
const buttons = [] as JSX.Element[];
const equicordSupport = GuildMemberStore.getMember(GUILD_ID, props.message.author.id)?.roles?.includes(EQUCORD_HELPERS);
const shouldAddUpdateButton =
!IS_UPDATER_DISABLED
&& (
(props.channel.id === VC_KNOWN_ISSUES_CHANNEL_ID) ||
(props.channel.id === VC_SUPPORT_CHANNEL_ID && props.message.author.id === VENBOT_USER_ID)
(props.channel.id === SUPPORT_CHANNEL_ID && equicordSupport)
)
&& props.message.content?.includes("update");
@ -311,7 +313,7 @@ export default definePlugin({
);
}
if (props.channel.id === SUPPORT_CHANNEL_ID) {
if (props.channel.id === SUPPORT_CHANNEL_ID && PermissionStore.can(PermissionsBits.SEND_MESSAGES, props.channel)) {
if (props.message.content.includes("/equicord-debug") || props.message.content.includes("/equicord-plugins")) {
buttons.push(
<Button
@ -334,7 +336,7 @@ export default definePlugin({
);
}
if (props.message.author.id === VENBOT_USER_ID) {
if (equicordSupport) {
const match = CodeBlockRe.exec(props.message.content || props.message.embeds[0]?.rawDescription || "");
if (match) {
buttons.push(

View file

@ -1,6 +1,6 @@
/*
* Vencord, a modification for Discord's desktop app
* Copyright (c) 2022 Vendicated and contributors
* Copyright (c) 2025 Vendicated and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -26,17 +26,16 @@ export default definePlugin({
patches: [
{
find: ".nsfwAllowed=null",
replacement: {
match: /(?<=\.nsfwAllowed=)null!==.+?(?=[,;])/,
replace: "!0",
},
},
{
find: ".ageVerificationStatus=null",
replacement: {
match: /(?<=\.ageVerificationStatus=)null!==.+?(?=[,;])/,
replace: "3",
},
},
replacement: [
{
match: /(?<=\.nsfwAllowed=)null!==.+?(?=[,;])/,
replace: "true",
},
{
match: /(?<=\.ageVerificationStatus=)null!==.+?(?=[,;])/,
replace: "3", // VERIFIED_ADULT
}
],
}
],
});

View file

@ -30,12 +30,12 @@ export default definePlugin({
// the second is the four guild preview icons
// always show this one (the plain icons)
{
match: /\(\w\|\|\w\)&&(\(.{0,40}\(.{1,3}\.animated)/,
match: /\(\i\|\|\i\)&&(\(.{0,40}\(\i\.animated)/,
replace: "$1",
},
// and never show this one (the guild preview icons)
{
match: /\(\w\|\|!\w\)&&(\(.{0,40}\(.{1,3}\.animated)/,
match: /\(\i\|\|!\i\)&&(\(.{0,40}\(\i\.animated)/,
replace: "false&&$1",
}
]

View file

@ -310,7 +310,6 @@ function Info({ track }: { track: Track; }) {
{track.artists.some(a => a.name) && (
<Forms.FormText variant="text-sm/normal" className={cl(["ellipoverflow", "secondary-song-info"])}>
<span className={cl("song-info-prefix")}>by&nbsp;</span>
by&nbsp;
{track.artists.map((a, i) => (
<React.Fragment key={a.name}>
<span
@ -329,7 +328,6 @@ function Info({ track }: { track: Track; }) {
{track.album.name && (
<Forms.FormText variant="text-sm/normal" className={cl(["ellipoverflow", "secondary-song-info"])}>
<span className={cl("song-info-prefix")}>on&nbsp;</span>
on&nbsp;
<span
id={cl("album-title")}
className={cl("album")}

View file

@ -12,8 +12,7 @@
display: none;
}
.vc-spotify-artist,
.vc-spotify-album {
.vc-spotify-artist, .vc-spotify-album {
color: var(--header-primary);
}
@ -27,26 +26,26 @@
width: 100%;
}
#vc-spotify-progress-bar>[class^="slider"] {
#vc-spotify-progress-bar > [class^="slider"] {
flex-grow: 1;
width: 100%;
padding: 0 !important;
}
#vc-spotify-progress-bar>[class^="slider"] [class^="bar"] {
#vc-spotify-progress-bar > [class^="slider"] [class^="bar"] {
height: 3px !important;
top: calc(12px - 4px / 2 + var(--bar-offset));
}
#vc-spotify-progress-bar>[class^="slider"] [class^="barFill"] {
#vc-spotify-progress-bar > [class^="slider"] [class^="barFill"] {
background-color: var(--interactive-active);
}
#vc-spotify-progress-bar>[class^="slider"]:hover [class^="barFill"] {
#vc-spotify-progress-bar > [class^="slider"]:hover [class^="barFill"] {
background-color: var(--vc-spotify-green);
}
#vc-spotify-progress-bar>[class^="slider"] [class^="grabber"] {
#vc-spotify-progress-bar > [class^="slider"] [class^="grabber"] {
background-color: var(--interactive-active);
width: 16px !important;
height: 16px !important;
@ -68,15 +67,11 @@
border-radius: var(--radius-sm);
}
.vc-spotify-repeat-context,
.vc-spotify-repeat-track,
.vc-spotify-shuffle-on {
.vc-spotify-repeat-context, .vc-spotify-repeat-track, .vc-spotify-shuffle-on {
background-color: var(--vc-spotify-green-90);
}
.vc-spotify-repeat-context:hover,
.vc-spotify-repeat-track:hover,
.vc-spotify-shuffle-on:hover {
.vc-spotify-repeat-context:hover, .vc-spotify-repeat-track:hover, .vc-spotify-shuffle-on:hover {
background-color: var(--vc-spotify-green-80);
}
}

View file

@ -55,7 +55,7 @@ export default definePlugin({
],
getAvatarStyles(src: string | null) {
if (src == null || src.startsWith("data:")) return {};
if (!src || src.startsWith("data:")) return {};
return Object.fromEntries(
[128, 256, 512, 1024, 2048, 4096].map(size => [

View file

@ -53,13 +53,16 @@ const settings = definePluginSettings({
addBack: {
type: OptionType.BOOLEAN,
description: "Add back the Discord context menus for images, links and the chat input bar",
default: false,
restartNeeded: true,
// Web slate menu has proper spellcheck suggestions and image context menu is also pretty good,
// so disable this by default. Vesktop just doesn't, so enable by default
default: result,
restartNeeded: true
// so disable this by default. Vesktop just doesn't, so we force enable it there
hidden: result,
}
});
const shouldAddBackMenus = () => result || settings.store.addBack;
const MEDIA_PROXY_URL = "https://media.discordapp.net";
const CDN_URL = "cdn.discordapp.com";
@ -92,7 +95,7 @@ export default definePlugin({
settings,
start() {
if (settings.store.addBack) {
if (shouldAddBackMenus()) {
window.removeEventListener("contextmenu", ctxMenuCallbacks.contextMenuCallbackWeb);
window.addEventListener("contextmenu", ctxMenuCallbacks.contextMenuCallbackNative);
this.changedListeners = true;
@ -155,7 +158,7 @@ export default definePlugin({
{
find: 'navId:"image-context"',
all: true,
predicate: () => settings.store.addBack,
predicate: shouldAddBackMenus,
replacement: {
// return IS_DESKTOP ? React.createElement(Menu, ...)
match: /return \i\.\i(?=\?|&&)/,
@ -166,7 +169,7 @@ export default definePlugin({
// Add back link context menu
{
find: '"interactionUsernameProfile"',
predicate: () => settings.store.addBack,
predicate: shouldAddBackMenus,
replacement: {
match: /if\((?="A"===\i\.tagName&&""!==\i\.textContent)/,
replace: "if(false&&"
@ -176,7 +179,7 @@ export default definePlugin({
// Add back slate / text input context menu
{
find: 'getElementById("slate-toolbar"',
predicate: () => settings.store.addBack,
predicate: shouldAddBackMenus,
replacement: {
match: /(?<=handleContextMenu\(\i\)\{.{0,200}isPlatformEmbedded)\)/,
replace: "||true)"
@ -184,7 +187,7 @@ export default definePlugin({
},
{
find: ".SLASH_COMMAND_SUGGESTIONS_TOGGLED,{",
predicate: () => settings.store.addBack,
predicate: shouldAddBackMenus,
replacement: [
{
// if (!IS_DESKTOP) return null;
@ -200,7 +203,7 @@ export default definePlugin({
},
{
find: '"add-to-dictionary"',
predicate: () => settings.store.addBack,
predicate: shouldAddBackMenus,
replacement: {
match: /let\{text:\i=""/,
replace: "return [null,null];$&"

View file

@ -24,6 +24,7 @@ export const GUILD_ID = "1173279886065029291";
export const DONOR_ROLE_ID = "1173316879083896912";
export const CONTRIB_ROLE_ID = "1222677964760682556";
export const EQUICORD_TEAM = "1173520023239786538";
export const EQUCORD_HELPERS = "1326406112144265257";
export const EQUIBOP_CONTRIB_ROLE_ID = "1287079931645263968";
export const VENCORD_CONTRIB_ROLE_ID = "1173343399470964856";
@ -34,6 +35,7 @@ export const VENBOT_USER_ID = "1017176847865352332";
export const VC_DONOR_ROLE_ID = "1042507929485586532";
export const VC_CONTRIB_ROLE_ID = "1026534353167208489";
export const VC_REGULAR_ROLE_ID = "1026504932959977532";
export const VC_SUPPORT_CATEGORY_ID = "1108135649699180705";
export const VC_KNOWN_ISSUES_CHANNEL_ID = "1222936386626129920";
export const GUILD_IDS = [GUILD_ID, VC_GUILD_ID];

View file

@ -16,7 +16,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import type { ComponentPropsWithRef, ComponentType, CSSProperties, FunctionComponent, HtmlHTMLAttributes, HTMLProps, JSX, KeyboardEvent, MouseEvent, PointerEvent, PropsWithChildren, PropsWithRef, ReactNode, Ref } from "react";
import type { ComponentPropsWithRef, ComponentType, CSSProperties, FunctionComponent, HtmlHTMLAttributes, HTMLProps, JSX, KeyboardEvent, MouseEvent, PointerEvent, PropsWithChildren, ReactNode, Ref } from "react";
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";
@ -245,7 +245,8 @@ export type TextInput = ComponentType<PropsWithChildren<{
onChange?(value: string, name?: string): void;
placeholder?: string;
editable?: boolean;
maxLength?: number;
/** defaults to 999. Pass null to disable this default */
maxLength?: number | null;
error?: string;
inputClassName?: string;
@ -257,13 +258,14 @@ export type TextInput = ComponentType<PropsWithChildren<{
/** TextInput.Sizes.DEFAULT */
size?: string;
} & Omit<HTMLProps<HTMLInputElement>, "onChange">>> & {
} & Omit<HTMLProps<HTMLInputElement>, "onChange" | "maxLength">>> & {
Sizes: Record<"DEFAULT" | "MINI", string>;
};
export type TextArea = ComponentType<PropsWithRef<Omit<HTMLProps<HTMLTextAreaElement>, "onChange"> & {
export type TextArea = ComponentType<Omit<HTMLProps<HTMLTextAreaElement>, "onChange"> & {
onChange(v: string): void;
}>>;
}>;
export interface SelectOption {
disabled?: boolean;
value: any;