Update from upstream repository

This commit is contained in:
RobinRMC 2025-04-04 22:00:18 +02:00
commit 0b29a333c2
No known key found for this signature in database
GPG key ID: AC6D1EDC9ADED07B
23 changed files with 669 additions and 807 deletions

View file

@ -1,7 +1,7 @@
{ {
"name": "vencord", "name": "vencord",
"private": "true", "private": "true",
"version": "1.11.7", "version": "1.11.8",
"description": "Vencord+ is a fork of Vencord that adds unapproved plugins.", "description": "Vencord+ is a fork of Vencord that adds unapproved plugins.",
"homepage": "https://github.com/RobinRMC/VencordPlus#readme", "homepage": "https://github.com/RobinRMC/VencordPlus#readme",
"bugs": { "bugs": {
@ -28,8 +28,8 @@
"watchWeb": "pnpm buildWeb --watch", "watchWeb": "pnpm buildWeb --watch",
"generatePluginJson": "tsx scripts/generatePluginList.ts", "generatePluginJson": "tsx scripts/generatePluginList.ts",
"generateTypes": "tspc --emitDeclarationOnly --declaration --outDir packages/vencord-types --allowJs false", "generateTypes": "tspc --emitDeclarationOnly --declaration --outDir packages/vencord-types --allowJs false",
"inject": "node scripts/runInstaller.mjs", "inject": "node scripts/runInstaller.mjs -- --install",
"uninject": "node scripts/runInstaller.mjs", "uninject": "node scripts/runInstaller.mjs -- --uninstall",
"lint": "eslint", "lint": "eslint",
"lint-styles": "stylelint \"src/**/*.css\" --ignore-pattern src/userplugins", "lint-styles": "stylelint \"src/**/*.css\" --ignore-pattern src/userplugins",
"lint:fix": "pnpm lint --fix", "lint:fix": "pnpm lint --fix",
@ -44,22 +44,22 @@
"fflate": "^0.8.2", "fflate": "^0.8.2",
"gifenc": "github:mattdesl/gifenc#64842fca317b112a8590f8fef2bf3825da8f6fe3", "gifenc": "github:mattdesl/gifenc#64842fca317b112a8590f8fef2bf3825da8f6fe3",
"monaco-editor": "^0.52.2", "monaco-editor": "^0.52.2",
"nanoid": "^5.0.9", "nanoid": "^5.1.5",
"virtual-merge": "^1.0.1" "virtual-merge": "^1.0.1"
}, },
"devDependencies": { "devDependencies": {
"@stylistic/eslint-plugin": "^4.0.0", "@stylistic/eslint-plugin": "^4.2.0",
"@types/chrome": "^0.0.304", "@types/chrome": "^0.0.312",
"@types/diff": "^7.0.1", "@types/diff": "^7.0.2",
"@types/lodash": "^4.17.14", "@types/lodash": "^4.17.14",
"@types/node": "^22.10.5", "@types/node": "^22.13.13",
"@types/react": "^19.0.10", "@types/react": "^19.0.10",
"@types/react-dom": "^19.0.4", "@types/react-dom": "^19.0.4",
"@types/yazl": "^2.4.5", "@types/yazl": "^2.4.5",
"diff": "^7.0.0", "diff": "^7.0.0",
"discord-types": "^1.3.26", "discord-types": "^1.3.26",
"esbuild": "^0.25.0", "esbuild": "^0.25.1",
"eslint": "^9.20.1", "eslint": "9.20.1",
"eslint-import-resolver-alias": "^1.1.2", "eslint-import-resolver-alias": "^1.1.2",
"eslint-plugin-path-alias": "2.1.0", "eslint-plugin-path-alias": "2.1.0",
"eslint-plugin-react": "^7.37.3", "eslint-plugin-react": "^7.37.3",
@ -69,18 +69,18 @@
"highlight.js": "11.11.1", "highlight.js": "11.11.1",
"html-minifier-terser": "^7.2.0", "html-minifier-terser": "^7.2.0",
"moment": "^2.22.2", "moment": "^2.22.2",
"puppeteer-core": "^24.2.1", "puppeteer-core": "^24.4.0",
"standalone-electron-types": "^34.2.0", "standalone-electron-types": "^34.2.0",
"stylelint": "^16.12.0", "stylelint": "^16.17.0",
"stylelint-config-standard": "^37.0.0", "stylelint-config-standard": "^37.0.0",
"ts-patch": "^3.3.0", "ts-patch": "^3.3.0",
"ts-pattern": "^5.6.0", "ts-pattern": "^5.6.0",
"tsx": "^4.19.2", "tsx": "^4.19.3",
"type-fest": "^4.31.0", "type-fest": "^4.38.0",
"typed-emitter": "^2.1.0", "typed-emitter": "^2.1.0",
"typescript": "^5.7.2", "typescript": "^5.8.2",
"typescript-eslint": "^8.19.0", "typescript-eslint": "^8.28.0",
"typescript-transform-paths": "^3.5.3", "typescript-transform-paths": "^3.5.5",
"zip-local": "^0.3.5" "zip-local": "^0.3.5"
}, },
"packageManager": "pnpm@10.4.1", "packageManager": "pnpm@10.4.1",

1208
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..."); console.log("Now running Installer...");
const argStart = process.argv.indexOf("--");
const args = argStart === -1 ? [] : process.argv.slice(argStart + 1);
try { try {
execFileSync(installerBin, { execFileSync(installerBin, args, {
stdio: "inherit", stdio: "inherit",
env: { env: {
...process.env, ...process.env,

View file

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

View file

@ -115,7 +115,7 @@ function VencordSettings() {
<SpecialCard <SpecialCard
title="Donations" title="Donations"
subtitle="Thank you for donating!" subtitle="Thank you for donating!"
description="All Vencord users can see your badge! You can change it at any time by messaging @vending.machine." description="You can manage your perks at any time by messaging @vending.machine."
cardImage={VENNIE_DONATOR_IMAGE} cardImage={VENNIE_DONATOR_IMAGE}
backgroundImage={DONOR_BACKGROUND_IMAGE} backgroundImage={DONOR_BACKGROUND_IMAGE}
backgroundColor="#ED87A9" backgroundColor="#ED87A9"

View file

@ -11,6 +11,11 @@
box-sizing: border-box; box-sizing: border-box;
} }
.visual-refresh .vc-addon-card {
background-color: var(--card-primary-bg);
border: 1px solid var(--border-subtle);
}
.vc-addon-card-disabled { .vc-addon-card-disabled {
opacity: 0.6; opacity: 0.6;
} }
@ -21,6 +26,11 @@
box-shadow: var(--elevation-high); box-shadow: var(--elevation-high);
} }
.visual-refresh .vc-addon-card:hover {
/* same as non-hover, here to overwrite the non-refresh hover background */
background-color: var(--card-primary-bg);
}
.vc-addon-header { .vc-addon-header {
margin-top: auto; margin-top: auto;
display: flex; display: flex;

View file

@ -36,6 +36,14 @@
outline-offset: 2px; outline-offset: 2px;
} }
.visual-refresh .vc-settings-quickActions-pill {
background: var(--button-secondary-background);
}
.visual-refresh .vc-settings-quickActions-pill:hover {
background: var(--button-secondary-background-hover);
}
.vc-settings-quickActions-img { .vc-settings-quickActions-img {
width: 24px; width: 24px;
height: 24px; height: 24px;

View file

@ -32,7 +32,7 @@ export default definePlugin({
{ {
find: '"Message Username"', find: '"Message Username"',
replacement: { replacement: {
match: /#{intl::GUILD_COMMUNICATION_DISABLED_BOTTOM_SHEET_TITLE}.+?}\),\i(?=\])/, match: /#{intl::GUILD_COMMUNICATION_DISABLED_BOTTOM_SHEET_TITLE}.+?renderPopout:.+?(?=\])/,
replace: "$&,Vencord.Api.MessageDecorations.__addDecorationsToMessage(arguments[0])" replace: "$&,Vencord.Api.MessageDecorations.__addDecorationsToMessage(arguments[0])"
} }
} }

View file

@ -22,7 +22,7 @@ import ErrorBoundary from "@components/ErrorBoundary";
import { Flex } from "@components/Flex"; import { Flex } from "@components/Flex";
import { Link } from "@components/Link"; import { Link } from "@components/Link";
import { openUpdaterModal } from "@components/VencordSettings/UpdaterTab"; import { openUpdaterModal } from "@components/VencordSettings/UpdaterTab";
import { CONTRIB_ROLE_ID, Devs, DONOR_ROLE_ID, KNOWN_ISSUES_CHANNEL_ID, REGULAR_ROLE_ID, SUPPORT_CHANNEL_ID, VENBOT_USER_ID, VENCORD_GUILD_ID } from "@utils/constants"; import { CONTRIB_ROLE_ID, Devs, DONOR_ROLE_ID, KNOWN_ISSUES_CHANNEL_ID, REGULAR_ROLE_ID, SUPPORT_CATEGORY_ID, SUPPORT_CHANNEL_ID, VENBOT_USER_ID, VENCORD_GUILD_ID } from "@utils/constants";
import { sendMessage } from "@utils/discord"; import { sendMessage } from "@utils/discord";
import { Logger } from "@utils/Logger"; import { Logger } from "@utils/Logger";
import { Margins } from "@utils/margins"; import { Margins } from "@utils/margins";
@ -32,7 +32,8 @@ import { onlyOnce } from "@utils/onlyOnce";
import { makeCodeblock } from "@utils/text"; import { makeCodeblock } from "@utils/text";
import definePlugin from "@utils/types"; import definePlugin from "@utils/types";
import { checkForUpdates, isOutdated, update } from "@utils/updater"; 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 { Channel } from "discord-types/general";
import { JSX } from "react"; import { JSX } from "react";
import gitHash from "~git-hash"; import gitHash from "~git-hash";
@ -42,10 +43,8 @@ import SettingsPlugin from "./settings";
const CodeBlockRe = /```js\n(.+?)```/s; const CodeBlockRe = /```js\n(.+?)```/s;
const AllowedChannelIds = [ const AdditionalAllowedChannelIds = [
SUPPORT_CHANNEL_ID,
"1024286218801926184", // Vencord > #bot-spam "1024286218801926184", // Vencord > #bot-spam
"1033680203433660458", // Vencord > #v
]; ];
const TrustedRolesIds = [ const TrustedRolesIds = [
@ -58,6 +57,8 @@ const AsyncFunction = async function () { }.constructor;
const ShowCurrentGame = getUserSettingLazy<boolean>("status", "showCurrentGame")!; const ShowCurrentGame = getUserSettingLazy<boolean>("status", "showCurrentGame")!;
const isSupportAllowedChannel = (channel: Channel) => channel.parent_id === SUPPORT_CATEGORY_ID || AdditionalAllowedChannelIds.includes(channel.id);
async function forceUpdate() { async function forceUpdate() {
const outdated = await checkForUpdates(); const outdated = await checkForUpdates();
if (outdated) { if (outdated) {
@ -155,20 +156,21 @@ export default definePlugin({
{ {
name: "vencord-debug", name: "vencord-debug",
description: "Send Vencord+ debug info", description: "Send Vencord+ debug info",
predicate: ctx => isPluginDev(UserStore.getCurrentUser()?.id) || isSuncordPluginDev(UserStore.getCurrentUser()?.id) || isEquicordPluginDev(UserStore.getCurrentUser()?.id) || isPlusPluginDev(UserStore.getCurrentUser()?.id) || isPlusMt(UserStore.getCurrentUser()?.id) || AllowedChannelIds.includes(ctx.channel.id), predicate: ctx => isPluginDev(UserStore.getCurrentUser()?.id) || isSuncordPluginDev(UserStore.getCurrentUser()?.id) || isEquicordPluginDev(UserStore.getCurrentUser()?.id) || isPlusPluginDev(UserStore.getCurrentUser()?.id) || isPlusMt(UserStore.getCurrentUser()?.id) || isSupportAllowedChannel(ctx.channel),
execute: async () => ({ content: await generateDebugInfoMessage() }) execute: async () => ({ content: await generateDebugInfoMessage() })
}, },
{ {
name: "vencord-plugins", name: "vencord-plugins",
description: "Send Vencord+ plugin list", description: "Send Vencord+ plugin list",
predicate: ctx => isPluginDev(UserStore.getCurrentUser()?.id) || isSuncordPluginDev(UserStore.getCurrentUser()?.id) || isEquicordPluginDev(UserStore.getCurrentUser()?.id) || isPlusPluginDev(UserStore.getCurrentUser()?.id) || isPlusMt(UserStore.getCurrentUser()?.id) || AllowedChannelIds.includes(ctx.channel.id), predicate: ctx => isPluginDev(UserStore.getCurrentUser()?.id) || isSuncordPluginDev(UserStore.getCurrentUser()?.id) || isEquicordPluginDev(UserStore.getCurrentUser()?.id) || isPlusPluginDev(UserStore.getCurrentUser()?.id) || isPlusMt(UserStore.getCurrentUser()?.id) || isSupportAllowedChannel(ctx.channel),
execute: () => ({ content: generatePluginList() }) execute: () => ({ content: generatePluginList() })
} }
], ],
flux: { flux: {
async CHANNEL_SELECT({ channelId }) { async CHANNEL_SELECT({ channelId }) {
if (channelId !== SUPPORT_CHANNEL_ID) return; const isSupportChannel = channelId === SUPPORT_CHANNEL_ID || ChannelStore.getChannel(channelId)?.parent_id === SUPPORT_CATEGORY_ID;
if (!isSupportChannel) return;
const selfId = UserStore.getCurrentUser()?.id; const selfId = UserStore.getCurrentUser()?.id;
if (!selfId || isPluginDev(selfId) || isSuncordPluginDev(selfId) || isEquicordPluginDev(selfId) || isPlusPluginDev(selfId) || isPlusMt(selfId)) return; if (!selfId || isPluginDev(selfId) || isSuncordPluginDev(selfId) || isEquicordPluginDev(selfId) || isPlusPluginDev(selfId) || isPlusMt(selfId)) return;
@ -238,7 +240,7 @@ export default definePlugin({
!IS_UPDATER_DISABLED !IS_UPDATER_DISABLED
&& ( && (
(props.channel.id === KNOWN_ISSUES_CHANNEL_ID) || (props.channel.id === KNOWN_ISSUES_CHANNEL_ID) ||
(props.channel.id === SUPPORT_CHANNEL_ID && props.message.author.id === VENBOT_USER_ID) (props.channel.parent_id === SUPPORT_CATEGORY_ID && props.message.author.id === VENBOT_USER_ID)
) )
&& props.message.content?.includes("update"); && props.message.content?.includes("update");
@ -264,7 +266,7 @@ export default definePlugin({
); );
} }
if (props.channel.id === SUPPORT_CHANNEL_ID) { if (props.channel.parent_id === SUPPORT_CATEGORY_ID && PermissionStore.can(PermissionsBits.SEND_MESSAGES, props.channel)) {
if (props.message.content.includes("/vencord-debug") || props.message.content.includes("/vencord-plugins")) { if (props.message.content.includes("/vencord-debug") || props.message.content.includes("/vencord-plugins")) {
buttons.push( buttons.push(
<Button <Button

View file

@ -139,11 +139,12 @@ export default definePlugin({
// This is the very outer layer of the entire ui, so we can't wrap this in an ErrorBoundary // 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. // without possibly also catching unrelated errors of children.
// //
// Thus, we sanity check webpack modules & do this really hacky try catch to hopefully prevent hard crashes if something goes wrong. // Thus, we sanity check webpack modules
// try catch will only catch errors in the Layer function (hence why it's called as a plain function rather than a component), but
// not in children
Layer(props: LayerProps) { Layer(props: LayerProps) {
if (!FocusLock || !ComponentDispatch || !Classes) { try {
// @ts-ignore
[FocusLock.$$vencordInternal(), ComponentDispatch, Classes].forEach(e => e.test);
} catch {
new Logger("BetterSettings").error("Failed to find some components"); new Logger("BetterSettings").error("Failed to find some components");
return props.children; return props.children;
} }

View file

@ -5,7 +5,7 @@
*/ */
import { Flex } from "@components/Flex"; import { Flex } from "@components/Flex";
import { findByCodeLazy } from "@webpack"; import { findComponentByCodeLazy } from "@webpack";
import { Button, useEffect } from "@webpack/common"; import { Button, useEffect } from "@webpack/common";
import { useAuthorizationStore } from "../../lib/stores/AuthorizationStore"; import { useAuthorizationStore } from "../../lib/stores/AuthorizationStore";
@ -13,7 +13,7 @@ import { useCurrentUserDecorationsStore } from "../../lib/stores/CurrentUserDeco
import { cl } from "../"; import { cl } from "../";
import { openChangeDecorationModal } from "../modals/ChangeDecorationModal"; import { openChangeDecorationModal } from "../modals/ChangeDecorationModal";
const CustomizationSection = findByCodeLazy(".customizationSectionBackground"); const CustomizationSection = findComponentByCodeLazy(".customizationSectionBackground");
export interface DecorSectionProps { export interface DecorSectionProps {
hideTitle?: boolean; hideTitle?: boolean;

View file

@ -1,6 +1,6 @@
/* /*
* Vencord, a modification for Discord's desktop app * 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 * 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 * it under the terms of the GNU General Public License as published by
@ -26,10 +26,16 @@ export default definePlugin({
patches: [ patches: [
{ {
find: ".nsfwAllowed=null", find: ".nsfwAllowed=null",
replacement: { replacement: [
match: /(?<=\.nsfwAllowed=)null!==.+?(?=[,;])/, {
replace: "!0", match: /(?<=\.nsfwAllowed=)null!==.+?(?=[,;])/,
}, replace: "true",
}, },
{
match: /(?<=\.ageVerificationStatus=)null!==.+?(?=[,;])/,
replace: "3", // VERIFIED_ADULT
}
],
}
], ],
}); });

View file

@ -25,9 +25,19 @@ export default definePlugin({
authors: [Devs.botato], authors: [Devs.botato],
patches: [{ patches: [{
find: ".expandedFolderIconWrapper", find: ".expandedFolderIconWrapper",
replacement: [{ replacement: [
match: /\(\w\|\|\w\)&&(\(.{0,40}\(.{1,3}\.animated)/, // there are two elements, the first one is the plain folder icon
replace: "$1", // the second is the four guild preview icons
}] // always show this one (the plain icons)
{
match: /\(\i\|\|\i\)&&(\(.{0,40}\(\i\.animated)/,
replace: "$1",
},
// and never show this one (the guild preview icons)
{
match: /\(\i\|\|!\i\)&&(\(.{0,40}\(\i\.animated)/,
replace: "false&&$1",
}
]
}] }]
}); });

View file

@ -17,6 +17,7 @@
*/ */
import "./spotifyStyles.css"; import "./spotifyStyles.css";
import "./visualRefreshSpotifyStyles.css"; // TODO: merge with spotifyStyles.css and remove when old UI is discontinued
import { Settings } from "@api/Settings"; import { Settings } from "@api/Settings";
import { classNameFactory } from "@api/Styles"; import { classNameFactory } from "@api/Styles";
@ -307,8 +308,8 @@ function Info({ track }: { track: Track; }) {
{track.name} {track.name}
</Forms.FormText> </Forms.FormText>
{track.artists.some(a => a.name) && ( {track.artists.some(a => a.name) && (
<Forms.FormText variant="text-sm/normal" className={cl("ellipoverflow")}> <Forms.FormText variant="text-sm/normal" className={cl(["ellipoverflow", "secondary-song-info"])}>
by&nbsp; <span className={cl("song-info-prefix")}>by&nbsp;</span>
{track.artists.map((a, i) => ( {track.artists.map((a, i) => (
<React.Fragment key={a.name}> <React.Fragment key={a.name}>
<span <span
@ -325,8 +326,8 @@ function Info({ track }: { track: Track; }) {
</Forms.FormText> </Forms.FormText>
)} )}
{track.album.name && ( {track.album.name && (
<Forms.FormText variant="text-sm/normal" className={cl("ellipoverflow")}> <Forms.FormText variant="text-sm/normal" className={cl(["ellipoverflow", "secondary-song-info"])}>
on&nbsp; <span className={cl("song-info-prefix")}>on&nbsp;</span>
<span <span
id={cl("album-title")} id={cl("album-title")}
className={cl("album")} className={cl("album")}

View file

@ -32,7 +32,7 @@ function toggleHoverControls(value: boolean) {
export default definePlugin({ export default definePlugin({
name: "SpotifyControls", name: "SpotifyControls",
description: "Adds a Spotify player above the account panel", description: "Adds a Spotify player above the account panel",
authors: [Devs.Ven, Devs.afn, Devs.KraXen72, Devs.Av32000], authors: [Devs.Ven, Devs.afn, Devs.KraXen72, Devs.Av32000, Devs.nin0dev],
options: { options: {
hoverControls: { hoverControls: {
description: "Show controls on hover", description: "Show controls on hover",

View file

@ -2,7 +2,9 @@
padding: 0.375rem 0.5rem; padding: 0.375rem 0.5rem;
border-bottom: 1px solid var(--background-modifier-accent); border-bottom: 1px solid var(--background-modifier-accent);
--vc-spotify-green: #1db954; /* so custom themes can easily change it */ --vc-spotify-green: var(--spotify, #1db954); /* so custom themes can easily change it */
--vc-spotify-green-90: color-mix(in hsl, var(--vc-spotify-green), transparent 90%);
--vc-spotify-green-80: color-mix(in hsl, var(--vc-spotify-green), transparent 80%);
} }
.theme-light #vc-spotify-player { .theme-light #vc-spotify-player {

View file

@ -0,0 +1,77 @@
/* TODO: merge with spotifyStyles.css and remove when old UI is discontinued */
.visual-refresh {
#vc-spotify-player {
padding: 12px;
background: var(--bg-overlay-floating, var(--background-base-low, var(--background-secondary-alt)));
margin: 0;
border-top-left-radius: 10px;
border-top-right-radius: 10px;
}
.vc-spotify-song-info-prefix {
display: none;
}
.vc-spotify-artist, .vc-spotify-album {
color: var(--header-primary);
}
.vc-spotify-secondary-song-info {
font-size: 12px;
}
#vc-spotify-progress-bar {
position: relative;
color: var(--text-normal);
width: 100%;
}
#vc-spotify-progress-bar > [class^="slider"] {
flex-grow: 1;
width: 100%;
padding: 0 !important;
}
#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"] {
background-color: var(--interactive-active);
}
#vc-spotify-progress-bar > [class^="slider"]:hover [class^="barFill"] {
background-color: var(--vc-spotify-green);
}
#vc-spotify-progress-bar > [class^="slider"] [class^="grabber"] {
background-color: var(--interactive-active);
width: 16px !important;
height: 16px !important;
margin-top: calc(17px/-2 + var(--bar-offset)/2);
margin-left: -0.5px;
}
.vc-spotify-progress-time {
margin-top: 8px;
font-family: var(--font-code);
}
.vc-spotify-button-row {
margin-top: 14px;
}
.vc-spotify-button {
margin: 0 2px;
border-radius: var(--radius-sm);
}
.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 {
background-color: var(--vc-spotify-green-80);
}
}

View file

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

View file

@ -273,7 +273,7 @@ export default definePlugin({
muteMessage: { muteMessage: {
type: OptionType.STRING, type: OptionType.STRING,
description: "Mute Message (only self for now)", description: "Mute Message (only self for now)",
default: "{{USER}} Muted" default: "{{USER}} muted"
}, },
unmuteMessage: { unmuteMessage: {
type: OptionType.STRING, type: OptionType.STRING,

View file

@ -42,13 +42,16 @@ const settings = definePluginSettings({
addBack: { addBack: {
type: OptionType.BOOLEAN, type: OptionType.BOOLEAN,
description: "Add back the Discord context menus for images, links and the chat input bar", 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, // 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 // so disable this by default. Vesktop just doesn't, so we force enable it there
default: IS_VESKTOP, hidden: IS_VESKTOP,
restartNeeded: true
} }
}); });
const shouldAddBackMenus = () => IS_VESKTOP || settings.store.addBack;
const MEDIA_PROXY_URL = "https://media.discordapp.net"; const MEDIA_PROXY_URL = "https://media.discordapp.net";
const CDN_URL = "cdn.discordapp.com"; const CDN_URL = "cdn.discordapp.com";
@ -81,7 +84,7 @@ export default definePlugin({
settings, settings,
start() { start() {
if (settings.store.addBack) { if (shouldAddBackMenus()) {
window.removeEventListener("contextmenu", ctxMenuCallbacks.contextMenuCallbackWeb); window.removeEventListener("contextmenu", ctxMenuCallbacks.contextMenuCallbackWeb);
window.addEventListener("contextmenu", ctxMenuCallbacks.contextMenuCallbackNative); window.addEventListener("contextmenu", ctxMenuCallbacks.contextMenuCallbackNative);
this.changedListeners = true; this.changedListeners = true;
@ -144,7 +147,7 @@ export default definePlugin({
{ {
find: 'navId:"image-context"', find: 'navId:"image-context"',
all: true, all: true,
predicate: () => settings.store.addBack, predicate: shouldAddBackMenus,
replacement: { replacement: {
// return IS_DESKTOP ? React.createElement(Menu, ...) // return IS_DESKTOP ? React.createElement(Menu, ...)
match: /return \i\.\i(?=\?|&&)/, match: /return \i\.\i(?=\?|&&)/,
@ -155,7 +158,7 @@ export default definePlugin({
// Add back link context menu // Add back link context menu
{ {
find: '"interactionUsernameProfile"', find: '"interactionUsernameProfile"',
predicate: () => settings.store.addBack, predicate: shouldAddBackMenus,
replacement: { replacement: {
match: /if\((?="A"===\i\.tagName&&""!==\i\.textContent)/, match: /if\((?="A"===\i\.tagName&&""!==\i\.textContent)/,
replace: "if(false&&" replace: "if(false&&"
@ -165,7 +168,7 @@ export default definePlugin({
// Add back slate / text input context menu // Add back slate / text input context menu
{ {
find: 'getElementById("slate-toolbar"', find: 'getElementById("slate-toolbar"',
predicate: () => settings.store.addBack, predicate: shouldAddBackMenus,
replacement: { replacement: {
match: /(?<=handleContextMenu\(\i\)\{.{0,200}isPlatformEmbedded)\)/, match: /(?<=handleContextMenu\(\i\)\{.{0,200}isPlatformEmbedded)\)/,
replace: "||true)" replace: "||true)"
@ -173,7 +176,7 @@ export default definePlugin({
}, },
{ {
find: ".SLASH_COMMAND_SUGGESTIONS_TOGGLED,{", find: ".SLASH_COMMAND_SUGGESTIONS_TOGGLED,{",
predicate: () => settings.store.addBack, predicate: shouldAddBackMenus,
replacement: [ replacement: [
{ {
// if (!IS_DESKTOP) return null; // if (!IS_DESKTOP) return null;
@ -189,7 +192,7 @@ export default definePlugin({
}, },
{ {
find: '"add-to-dictionary"', find: '"add-to-dictionary"',
predicate: () => settings.store.addBack, predicate: shouldAddBackMenus,
replacement: { replacement: {
match: /let\{text:\i=""/, match: /let\{text:\i=""/,
replace: "return [null,null];$&" replace: "return [null,null];$&"

View file

@ -23,6 +23,7 @@ export const DONOR_ROLE_ID = "1042507929485586532";
export const CONTRIB_ROLE_ID = "1026534353167208489"; export const CONTRIB_ROLE_ID = "1026534353167208489";
export const REGULAR_ROLE_ID = "1026504932959977532"; export const REGULAR_ROLE_ID = "1026504932959977532";
export const SUPPORT_CHANNEL_ID = "1026515880080842772"; export const SUPPORT_CHANNEL_ID = "1026515880080842772";
export const SUPPORT_CATEGORY_ID = "1108135649699180705";
export const KNOWN_ISSUES_CHANNEL_ID = "1222936386626129920"; export const KNOWN_ISSUES_CHANNEL_ID = "1222936386626129920";
export interface Dev { export interface Dev {

View file

@ -25,7 +25,7 @@ import * as t from "./types/components";
const FormTitle = waitForComponent<t.FormTitle>("FormTitle", filters.componentByCode('["defaultMargin".concat', '="h5"')); const FormTitle = waitForComponent<t.FormTitle>("FormTitle", filters.componentByCode('["defaultMargin".concat', '="h5"'));
const FormText = waitForComponent<t.FormText>("FormText", filters.componentByCode(".SELECTABLE),", ".DISABLED:")); const FormText = waitForComponent<t.FormText>("FormText", filters.componentByCode(".SELECTABLE),", ".DISABLED:"));
const FormSection = waitForComponent<t.FormSection>("FormSection", filters.componentByCode(".titleId)&&")); const FormSection = waitForComponent<t.FormSection>("FormSection", filters.componentByCode(".titleId)"));
const FormDivider = waitForComponent<t.FormDivider>("FormDivider", filters.componentByCode(".divider,", ",style:", '"div"', /\.divider,\i\),style:/)); const FormDivider = waitForComponent<t.FormDivider>("FormDivider", filters.componentByCode(".divider,", ",style:", '"div"', /\.divider,\i\),style:/));
export const Forms = { export const Forms = {
@ -74,7 +74,7 @@ export const ScrollerNone = LazyComponent(() => createScroller(scrollerClasses.n
export const ScrollerThin = LazyComponent(() => createScroller(scrollerClasses.thin, scrollerClasses.fade, scrollerClasses.customTheme)); export const ScrollerThin = LazyComponent(() => createScroller(scrollerClasses.thin, scrollerClasses.fade, scrollerClasses.customTheme));
export const ScrollerAuto = LazyComponent(() => createScroller(scrollerClasses.auto, scrollerClasses.fade, scrollerClasses.customTheme)); export const ScrollerAuto = LazyComponent(() => createScroller(scrollerClasses.auto, scrollerClasses.fade, scrollerClasses.customTheme));
const { FocusLock_ } = mapMangledModuleLazy("attachTo:null!==", { const { FocusLock_ } = mapMangledModuleLazy('document.getElementById("app-mount"))', {
FocusLock_: filters.componentByCode(".containerRef") FocusLock_: filters.componentByCode(".containerRef")
}) as { }) as {
FocusLock_: t.FocusLock; FocusLock_: t.FocusLock;

View file

@ -16,7 +16,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. * 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"; 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; onChange?(value: string, name?: string): void;
placeholder?: string; placeholder?: string;
editable?: boolean; editable?: boolean;
maxLength?: number; /** defaults to 999. Pass null to disable this default */
maxLength?: number | null;
error?: string; error?: string;
inputClassName?: string; inputClassName?: string;
@ -257,13 +258,13 @@ export type TextInput = ComponentType<PropsWithChildren<{
/** TextInput.Sizes.DEFAULT */ /** TextInput.Sizes.DEFAULT */
size?: string; size?: string;
} & Omit<HTMLProps<HTMLInputElement>, "onChange">>> & { } & Omit<HTMLProps<HTMLInputElement>, "onChange" | "maxLength">>> & {
Sizes: Record<"DEFAULT" | "MINI", string>; 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; onChange(v: string): void;
}>>; }>;
interface SelectOption { interface SelectOption {
disabled?: boolean; disabled?: boolean;