mirror of
https://github.com/Equicord/Equicord.git
synced 2025-05-10 17:35:37 +02:00
Merge remote-tracking branch 'upstream/dev' into dev
This commit is contained in:
commit
a1cc1bb826
15 changed files with 590 additions and 823 deletions
32
package.json
32
package.json
|
@ -26,8 +26,8 @@
|
||||||
"generatePluginJson": "tsx scripts/generatePluginList.ts",
|
"generatePluginJson": "tsx scripts/generatePluginList.ts",
|
||||||
"generateEquicordPluginJson": "tsx scripts/generateEquicordPluginList.ts",
|
"generateEquicordPluginJson": "tsx scripts/generateEquicordPluginList.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",
|
||||||
|
@ -50,26 +50,26 @@
|
||||||
"jsqr": "1.4.0",
|
"jsqr": "1.4.0",
|
||||||
"idb": "8.0.0",
|
"idb": "8.0.0",
|
||||||
"monaco-editor": "^0.52.2",
|
"monaco-editor": "^0.52.2",
|
||||||
"nanoid": "^5.0.9",
|
"nanoid": "^5.1.5",
|
||||||
"socket.io": "^4.8.1",
|
"socket.io": "^4.8.1",
|
||||||
"usercss-meta": "^0.12.0",
|
"usercss-meta": "^0.12.0",
|
||||||
"openai": "^4.30.0",
|
"openai": "^4.30.0",
|
||||||
"virtual-merge": "^1.0.1"
|
"virtual-merge": "^1.0.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@stylistic/eslint-plugin": "^4.0.0",
|
"@stylistic/eslint-plugin": "^4.2.0",
|
||||||
"@electron/asar": "^3.2.10",
|
"@electron/asar": "^3.2.10",
|
||||||
"@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-react": "^7.37.3",
|
"eslint-plugin-react": "^7.37.3",
|
||||||
"eslint-plugin-simple-header": "^1.2.1",
|
"eslint-plugin-simple-header": "^1.2.1",
|
||||||
|
@ -78,18 +78,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",
|
||||||
"zustand": "^3.7.2"
|
"zustand": "^3.7.2"
|
||||||
},
|
},
|
||||||
|
|
1261
pnpm-lock.yaml
generated
1261
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load diff
|
@ -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,
|
||||||
|
|
|
@ -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>}
|
||||||
|
|
|
@ -128,8 +128,8 @@ function EquicordSettings() {
|
||||||
isEquicordDonor(user?.id) && isVencordDonor(user?.id)
|
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."
|
? "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)
|
: isVencordDonor(user?.id)
|
||||||
? "All Vencord users can see your badge! You can change it at any time by messaging @vending.machine."
|
? "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 change it at any time by making a ticket in Equicord's server."
|
: "All Equicord users can see your badge! You can manage your perks by making a ticket in Equicord's server."
|
||||||
}
|
}
|
||||||
cardImage={VENNIE_DONATOR_IMAGE}
|
cardImage={VENNIE_DONATOR_IMAGE}
|
||||||
backgroundImage={DONOR_BACKGROUND_IMAGE}
|
backgroundImage={DONOR_BACKGROUND_IMAGE}
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.visual-refresh .vc-addon-card {
|
.visual-refresh .vc-addon-card {
|
||||||
background-color: var(--button-secondary-background);
|
background-color: var(--card-primary-bg);
|
||||||
border: 1px solid var(--border-subtle);
|
border: 1px solid var(--border-subtle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -27,7 +27,8 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.visual-refresh .vc-addon-card:hover {
|
.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 {
|
.vc-addon-header {
|
||||||
|
|
|
@ -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, 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 { 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,7 @@ 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 { JSX } from "react";
|
import { JSX } from "react";
|
||||||
|
|
||||||
import gitHash from "~git-hash";
|
import gitHash from "~git-hash";
|
||||||
|
@ -196,7 +196,8 @@ export default definePlugin({
|
||||||
|
|
||||||
flux: {
|
flux: {
|
||||||
async CHANNEL_SELECT({ channelId }) {
|
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;
|
const selfId = UserStore.getCurrentUser()?.id;
|
||||||
if (!selfId || isPluginDev(selfId) || isEquicordPluginDev(selfId)) return;
|
if (!selfId || isPluginDev(selfId) || isEquicordPluginDev(selfId)) return;
|
||||||
|
@ -281,11 +282,12 @@ export default definePlugin({
|
||||||
renderMessageAccessory(props) {
|
renderMessageAccessory(props) {
|
||||||
const buttons = [] as JSX.Element[];
|
const buttons = [] as JSX.Element[];
|
||||||
|
|
||||||
|
const equicordSupport = GuildMemberStore.getMember(GUILD_ID, props.message.author.id)?.roles?.includes(EQUCORD_HELPERS);
|
||||||
|
|
||||||
const shouldAddUpdateButton =
|
const shouldAddUpdateButton =
|
||||||
!IS_UPDATER_DISABLED
|
!IS_UPDATER_DISABLED
|
||||||
&& (
|
&& (
|
||||||
(props.channel.id === VC_KNOWN_ISSUES_CHANNEL_ID) ||
|
(props.channel.id === SUPPORT_CHANNEL_ID && equicordSupport)
|
||||||
(props.channel.id === VC_SUPPORT_CHANNEL_ID && props.message.author.id === VENBOT_USER_ID)
|
|
||||||
)
|
)
|
||||||
&& props.message.content?.includes("update");
|
&& 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")) {
|
if (props.message.content.includes("/equicord-debug") || props.message.content.includes("/equicord-plugins")) {
|
||||||
buttons.push(
|
buttons.push(
|
||||||
<Button
|
<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 || "");
|
const match = CodeBlockRe.exec(props.message.content || props.message.embeds[0]?.rawDescription || "");
|
||||||
if (match) {
|
if (match) {
|
||||||
buttons.push(
|
buttons.push(
|
||||||
|
|
|
@ -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,17 +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",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
find: ".ageVerificationStatus=null",
|
match: /(?<=\.ageVerificationStatus=)null!==.+?(?=[,;])/,
|
||||||
replacement: {
|
replace: "3", // VERIFIED_ADULT
|
||||||
match: /(?<=\.ageVerificationStatus=)null!==.+?(?=[,;])/,
|
}
|
||||||
replace: "3",
|
],
|
||||||
},
|
}
|
||||||
},
|
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
|
|
@ -30,12 +30,12 @@ export default definePlugin({
|
||||||
// the second is the four guild preview icons
|
// the second is the four guild preview icons
|
||||||
// always show this one (the plain 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",
|
replace: "$1",
|
||||||
},
|
},
|
||||||
// and never show this one (the guild preview icons)
|
// 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",
|
replace: "false&&$1",
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
|
@ -310,7 +310,6 @@ function Info({ track }: { track: Track; }) {
|
||||||
{track.artists.some(a => a.name) && (
|
{track.artists.some(a => a.name) && (
|
||||||
<Forms.FormText variant="text-sm/normal" className={cl(["ellipoverflow", "secondary-song-info"])}>
|
<Forms.FormText variant="text-sm/normal" className={cl(["ellipoverflow", "secondary-song-info"])}>
|
||||||
<span className={cl("song-info-prefix")}>by </span>
|
<span className={cl("song-info-prefix")}>by </span>
|
||||||
by
|
|
||||||
{track.artists.map((a, i) => (
|
{track.artists.map((a, i) => (
|
||||||
<React.Fragment key={a.name}>
|
<React.Fragment key={a.name}>
|
||||||
<span
|
<span
|
||||||
|
@ -329,7 +328,6 @@ function Info({ track }: { track: Track; }) {
|
||||||
{track.album.name && (
|
{track.album.name && (
|
||||||
<Forms.FormText variant="text-sm/normal" className={cl(["ellipoverflow", "secondary-song-info"])}>
|
<Forms.FormText variant="text-sm/normal" className={cl(["ellipoverflow", "secondary-song-info"])}>
|
||||||
<span className={cl("song-info-prefix")}>on </span>
|
<span className={cl("song-info-prefix")}>on </span>
|
||||||
on
|
|
||||||
<span
|
<span
|
||||||
id={cl("album-title")}
|
id={cl("album-title")}
|
||||||
className={cl("album")}
|
className={cl("album")}
|
||||||
|
|
|
@ -12,8 +12,7 @@
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.vc-spotify-artist,
|
.vc-spotify-artist, .vc-spotify-album {
|
||||||
.vc-spotify-album {
|
|
||||||
color: var(--header-primary);
|
color: var(--header-primary);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -27,26 +26,26 @@
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
#vc-spotify-progress-bar>[class^="slider"] {
|
#vc-spotify-progress-bar > [class^="slider"] {
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding: 0 !important;
|
padding: 0 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
#vc-spotify-progress-bar>[class^="slider"] [class^="bar"] {
|
#vc-spotify-progress-bar > [class^="slider"] [class^="bar"] {
|
||||||
height: 3px !important;
|
height: 3px !important;
|
||||||
top: calc(12px - 4px / 2 + var(--bar-offset));
|
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);
|
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);
|
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);
|
background-color: var(--interactive-active);
|
||||||
width: 16px !important;
|
width: 16px !important;
|
||||||
height: 16px !important;
|
height: 16px !important;
|
||||||
|
@ -68,15 +67,11 @@
|
||||||
border-radius: var(--radius-sm);
|
border-radius: var(--radius-sm);
|
||||||
}
|
}
|
||||||
|
|
||||||
.vc-spotify-repeat-context,
|
.vc-spotify-repeat-context, .vc-spotify-repeat-track, .vc-spotify-shuffle-on {
|
||||||
.vc-spotify-repeat-track,
|
|
||||||
.vc-spotify-shuffle-on {
|
|
||||||
background-color: var(--vc-spotify-green-90);
|
background-color: var(--vc-spotify-green-90);
|
||||||
}
|
}
|
||||||
|
|
||||||
.vc-spotify-repeat-context:hover,
|
.vc-spotify-repeat-context:hover, .vc-spotify-repeat-track:hover, .vc-spotify-shuffle-on:hover {
|
||||||
.vc-spotify-repeat-track:hover,
|
|
||||||
.vc-spotify-shuffle-on:hover {
|
|
||||||
background-color: var(--vc-spotify-green-80);
|
background-color: var(--vc-spotify-green-80);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,7 +55,7 @@ export default definePlugin({
|
||||||
],
|
],
|
||||||
|
|
||||||
getAvatarStyles(src: string | null) {
|
getAvatarStyles(src: string | null) {
|
||||||
if (src == null || 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 => [
|
||||||
|
|
|
@ -53,13 +53,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: result,
|
hidden: result,
|
||||||
restartNeeded: true
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const shouldAddBackMenus = () => result || 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";
|
||||||
|
|
||||||
|
@ -92,7 +95,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;
|
||||||
|
@ -155,7 +158,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(?=\?|&&)/,
|
||||||
|
@ -166,7 +169,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&&"
|
||||||
|
@ -176,7 +179,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)"
|
||||||
|
@ -184,7 +187,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;
|
||||||
|
@ -200,7 +203,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];$&"
|
||||||
|
|
|
@ -24,6 +24,7 @@ export const GUILD_ID = "1173279886065029291";
|
||||||
export const DONOR_ROLE_ID = "1173316879083896912";
|
export const DONOR_ROLE_ID = "1173316879083896912";
|
||||||
export const CONTRIB_ROLE_ID = "1222677964760682556";
|
export const CONTRIB_ROLE_ID = "1222677964760682556";
|
||||||
export const EQUICORD_TEAM = "1173520023239786538";
|
export const EQUICORD_TEAM = "1173520023239786538";
|
||||||
|
export const EQUCORD_HELPERS = "1326406112144265257";
|
||||||
export const EQUIBOP_CONTRIB_ROLE_ID = "1287079931645263968";
|
export const EQUIBOP_CONTRIB_ROLE_ID = "1287079931645263968";
|
||||||
export const VENCORD_CONTRIB_ROLE_ID = "1173343399470964856";
|
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_DONOR_ROLE_ID = "1042507929485586532";
|
||||||
export const VC_CONTRIB_ROLE_ID = "1026534353167208489";
|
export const VC_CONTRIB_ROLE_ID = "1026534353167208489";
|
||||||
export const VC_REGULAR_ROLE_ID = "1026504932959977532";
|
export const VC_REGULAR_ROLE_ID = "1026504932959977532";
|
||||||
|
export const VC_SUPPORT_CATEGORY_ID = "1108135649699180705";
|
||||||
export const VC_KNOWN_ISSUES_CHANNEL_ID = "1222936386626129920";
|
export const VC_KNOWN_ISSUES_CHANNEL_ID = "1222936386626129920";
|
||||||
|
|
||||||
export const GUILD_IDS = [GUILD_ID, VC_GUILD_ID];
|
export const GUILD_IDS = [GUILD_ID, VC_GUILD_ID];
|
||||||
|
|
12
src/webpack/common/types/components.d.ts
vendored
12
src/webpack/common/types/components.d.ts
vendored
|
@ -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,14 @@ 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;
|
||||||
}>>;
|
}>;
|
||||||
|
|
||||||
export interface SelectOption {
|
export interface SelectOption {
|
||||||
disabled?: boolean;
|
disabled?: boolean;
|
||||||
value: any;
|
value: any;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue