diff --git a/package.json b/package.json index a7dca5793..057175f9c 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "vencord", "private": "true", - "version": "1.11.2", + "version": "1.11.3", "description": "The cutest Discord client mod", "homepage": "https://github.com/Vendicated/Vencord#readme", "bugs": { diff --git a/src/api/MemberListDecorators.tsx b/src/api/MemberListDecorators.tsx index 2199f4a6c..ab5a618bf 100644 --- a/src/api/MemberListDecorators.tsx +++ b/src/api/MemberListDecorators.tsx @@ -43,20 +43,21 @@ interface DecoratorProps { export type MemberListDecoratorFactory = (props: DecoratorProps) => JSX.Element | null; type OnlyIn = "guilds" | "dms"; -export const decorators = new Map(); +export const decoratorsFactories = new Map(); export function addMemberListDecorator(identifier: string, render: MemberListDecoratorFactory, onlyIn?: OnlyIn) { - decorators.set(identifier, { render, onlyIn }); + decoratorsFactories.set(identifier, { render, onlyIn }); } export function removeMemberListDecorator(identifier: string) { - decorators.delete(identifier); + decoratorsFactories.delete(identifier); } -export function __getDecorators(props: DecoratorProps): (JSX.Element | null)[] { +export function __getDecorators(props: DecoratorProps): JSX.Element { const isInGuild = !!(props.guildId); - return Array.from( - decorators.entries(), + + const decorators = Array.from( + decoratorsFactories.entries(), ([key, { render: Decorator, onlyIn }]) => { if ((onlyIn === "guilds" && !isInGuild) || (onlyIn === "dms" && isInGuild)) return null; @@ -68,4 +69,10 @@ export function __getDecorators(props: DecoratorProps): (JSX.Element | null)[] { ); } ); + + return ( +
+ {decorators} +
+ ); } diff --git a/src/api/MessageDecorations.tsx b/src/api/MessageDecorations.tsx index 740c95876..1b94c18d9 100644 --- a/src/api/MessageDecorations.tsx +++ b/src/api/MessageDecorations.tsx @@ -48,23 +48,29 @@ export interface MessageDecorationProps { } export type MessageDecorationFactory = (props: MessageDecorationProps) => JSX.Element | null; -export const decorations = new Map(); +export const decorationsFactories = new Map(); export function addMessageDecoration(identifier: string, decoration: MessageDecorationFactory) { - decorations.set(identifier, decoration); + decorationsFactories.set(identifier, decoration); } export function removeMessageDecoration(identifier: string) { - decorations.delete(identifier); + decorationsFactories.delete(identifier); } -export function __addDecorationsToMessage(props: MessageDecorationProps): (JSX.Element | null)[] { - return Array.from( - decorations.entries(), +export function __addDecorationsToMessage(props: MessageDecorationProps): JSX.Element { + const decorations = Array.from( + decorationsFactories.entries(), ([key, Decoration]) => ( ) ); + + return ( +
+ {decorations} +
+ ); } diff --git a/src/components/PluginSettings/PluginModal.tsx b/src/components/PluginSettings/PluginModal.tsx index 1252f52b6..a539e7ead 100644 --- a/src/components/PluginSettings/PluginModal.tsx +++ b/src/components/PluginSettings/PluginModal.tsx @@ -37,6 +37,7 @@ import { Constructor } from "type-fest"; import { PluginMeta } from "~plugins"; import { + ISettingCustomElementProps, ISettingElementProps, SettingArrayComponent, SettingBooleanComponent, @@ -75,7 +76,7 @@ function makeDummyUser(user: { username: string; id?: string; avatar?: string; } return newUser; } -const Components: Record>> = { +const Components: Record | ISettingCustomElementProps>> = { [OptionType.STRING]: SettingTextComponent, [OptionType.NUMBER]: SettingNumericComponent, [OptionType.BIGINT]: SettingNumericComponent, diff --git a/src/components/PluginSettings/components/SettingCustomComponent.tsx b/src/components/PluginSettings/components/SettingCustomComponent.tsx index af7192f3f..25e8c9c6a 100644 --- a/src/components/PluginSettings/components/SettingCustomComponent.tsx +++ b/src/components/PluginSettings/components/SettingCustomComponent.tsx @@ -18,8 +18,8 @@ import { PluginOptionComponent } from "@utils/types"; -import { ISettingElementProps } from "."; +import { ISettingCustomElementProps } from "."; -export function SettingCustomComponent({ option, onChange, onError }: ISettingElementProps) { +export function SettingCustomComponent({ option, onChange, onError }: ISettingCustomElementProps) { return option.component({ setValue: onChange, setError: onError, option }); } diff --git a/src/components/PluginSettings/components/index.ts b/src/components/PluginSettings/components/index.ts index 419c222b2..1ea661f32 100644 --- a/src/components/PluginSettings/components/index.ts +++ b/src/components/PluginSettings/components/index.ts @@ -18,7 +18,7 @@ import { DefinedSettings, PluginOptionBase } from "@utils/types"; -export interface ISettingElementProps { +interface ISettingElementPropsBase { option: T; onChange(newValue: any): void; pluginSettings: { @@ -30,6 +30,9 @@ export interface ISettingElementProps { definedSettings?: DefinedSettings; } +export type ISettingElementProps = ISettingElementPropsBase; +export type ISettingCustomElementProps> = ISettingElementPropsBase; + export * from "../../Badge"; export * from "./SettingArrayComponent"; export * from "./SettingBooleanComponent"; diff --git a/src/components/PluginSettings/index.tsx b/src/components/PluginSettings/index.tsx index 959a4d01e..371c3082c 100644 --- a/src/components/PluginSettings/index.tsx +++ b/src/components/PluginSettings/index.tsx @@ -69,7 +69,7 @@ function ReloadRequiredCard({ required }: { required: boolean; }) { Restart now to apply new plugins and their settings - @@ -158,8 +158,8 @@ export function PluginCard({ plugin, disabled, onRestartNeeded, onMouseEnter, on className={classes(ButtonClasses.button, cl("info-button"))} > {plugin.options && !isObjectEmpty(plugin.options) - ? - : } + ? + : } } /> diff --git a/src/components/PluginSettings/styles.css b/src/components/PluginSettings/styles.css index d3d182e58..a4f9aeee1 100644 --- a/src/components/PluginSettings/styles.css +++ b/src/components/PluginSettings/styles.css @@ -63,10 +63,7 @@ height: 8em; display: flex; flex-direction: column; -} - -.vc-plugins-info-card div { - line-height: 32px; + gap: 0.25em; } .vc-plugins-restart-card { @@ -76,11 +73,11 @@ color: var(--info-warning-text); } -.vc-plugins-restart-card button { +.vc-plugins-restart-button { margin-top: 0.5em; background: var(--info-warning-foreground) !important; } -.vc-plugins-info-button svg:not(:hover, :focus) { +.vc-plugins-info-icon:not(:hover, :focus) { color: var(--text-muted); } diff --git a/src/plugins/_api/chatButtons.ts b/src/plugins/_api/chatButtons.ts index 86ca195e0..184b01584 100644 --- a/src/plugins/_api/chatButtons.ts +++ b/src/plugins/_api/chatButtons.ts @@ -16,6 +16,7 @@ export default definePlugin({ { find: '"sticker")', replacement: { + // FIXME(Bundler change related): Remove old compatiblity once enough time has passed match: /return\((!)?\i\.\i(?:\|\||&&)(?=\(\i\.isDM.+?(\i)\.push)/, replace: (m, not, children) => not ? `${m}(Vencord.Api.ChatButtons._injectButtons(${children},arguments[0]),true)&&` diff --git a/src/plugins/_api/memberListDecorators.ts b/src/plugins/_api/memberListDecorators/index.tsx similarity index 83% rename from src/plugins/_api/memberListDecorators.ts rename to src/plugins/_api/memberListDecorators/index.tsx index 0dba3608f..39c82a1ed 100644 --- a/src/plugins/_api/memberListDecorators.ts +++ b/src/plugins/_api/memberListDecorators/index.tsx @@ -19,10 +19,15 @@ import { Devs } from "@utils/constants"; import definePlugin from "@utils/types"; +import managedStyle from "./style.css?managed"; + export default definePlugin({ name: "MemberListDecoratorsAPI", description: "API to add decorators to member list (both in servers and DMs)", authors: [Devs.TheSun, Devs.Ven], + + managedStyle, + patches: [ { find: ".lostPermission)", @@ -32,7 +37,7 @@ export default definePlugin({ replace: "$&vencordProps=$1," }, { match: /#{intl::GUILD_OWNER}(?=.+?decorators:(\i)\(\)).+?\1=?\(\)=>.+?children:\[/, - replace: "$&...(typeof vencordProps=='undefined'?[]:Vencord.Api.MemberListDecorators.__getDecorators(vencordProps))," + replace: "$&(typeof vencordProps=='undefined'?null:Vencord.Api.MemberListDecorators.__getDecorators(vencordProps))," } ] }, @@ -40,8 +45,8 @@ export default definePlugin({ find: "PrivateChannel.renderAvatar", replacement: { match: /decorators:(\i\.isSystemDM\(\))\?(.+?):null/, - replace: "decorators:[...Vencord.Api.MemberListDecorators.__getDecorators(arguments[0]), $1?$2:null]" + replace: "decorators:[Vencord.Api.MemberListDecorators.__getDecorators(arguments[0]),$1?$2:null]" } } - ], + ] }); diff --git a/src/plugins/_api/memberListDecorators/style.css b/src/plugins/_api/memberListDecorators/style.css new file mode 100644 index 000000000..bd4afda9d --- /dev/null +++ b/src/plugins/_api/memberListDecorators/style.css @@ -0,0 +1,11 @@ +.vc-member-list-decorators-wrapper { + display: flex; + align-items: center; + justify-content: center; + gap: 0.25em; +} + +.vc-member-list-decorators-wrapper:not(:empty) { + /* Margin to match default Discord decorators */ + margin-left: 0.25em; +} diff --git a/src/plugins/_api/messageDecorations.ts b/src/plugins/_api/messageDecorations/index.tsx similarity index 87% rename from src/plugins/_api/messageDecorations.ts rename to src/plugins/_api/messageDecorations/index.tsx index fb63a6dde..10866baea 100644 --- a/src/plugins/_api/messageDecorations.ts +++ b/src/plugins/_api/messageDecorations/index.tsx @@ -19,17 +19,22 @@ import { Devs } from "@utils/constants"; import definePlugin from "@utils/types"; +import managedStyle from "./style.css?managed"; + export default definePlugin({ name: "MessageDecorationsAPI", description: "API to add decorations to messages", authors: [Devs.TheSun], + + managedStyle, + patches: [ { find: '"Message Username"', replacement: { match: /#{intl::GUILD_COMMUNICATION_DISABLED_BOTTOM_SHEET_TITLE}.+?}\),\i(?=\])/, - replace: "$&,...Vencord.Api.MessageDecorations.__addDecorationsToMessage(arguments[0])" + replace: "$&,Vencord.Api.MessageDecorations.__addDecorationsToMessage(arguments[0])" } } - ], + ] }); diff --git a/src/plugins/_api/messageDecorations/style.css b/src/plugins/_api/messageDecorations/style.css new file mode 100644 index 000000000..5c13669c4 --- /dev/null +++ b/src/plugins/_api/messageDecorations/style.css @@ -0,0 +1,18 @@ +.vc-message-decorations-wrapper { + display: inline-flex; + align-items: center; + justify-content: center; + gap: 0.25em; +} + +.vc-message-decorations-wrapper:not(:empty) { + /* Margin to match default Discord decorators */ + margin-left: 0.25em; + + /* Align vertically */ + position: relative; + vertical-align: top; + top: 0.1rem; + height: calc(1rem + 4px); + max-height: calc(1rem + 4px) +} diff --git a/src/plugins/_api/messageEvents.ts b/src/plugins/_api/messageEvents.ts index 97ed1746d..9dfc55e27 100644 --- a/src/plugins/_api/messageEvents.ts +++ b/src/plugins/_api/messageEvents.ts @@ -37,12 +37,9 @@ export default definePlugin({ { find: ".handleSendMessage,onResize", replacement: { - // props.chatInputType...then((function(isMessageValid)... var parsedMessage = b.c.parse(channel,... var replyOptions = f.g.getSendMessageOptionsForReply(pendingReply); - // Lookbehind: validateMessage)({openWarningPopout:..., type: i.props.chatInputType, content: t, stickers: r, ...}).then((function(isMessageValid) - match: /(\{openWarningPopout:.{0,100}type:this.props.chatInputType.+?\.then\()(\i=>\{.+?let (\i)=\i\.\i\.parse\((\i),.+?let (\i)=\i\.\i\.getSendMessageOptions\(\{.+?\}\);)(?<=\)\(({.+?})\)\.then.+?)/, - // props.chatInputType...then((async function(isMessageValid)... var replyOptions = f.g.getSendMessageOptionsForReply(pendingReply); if(await Vencord.api...) return { shoudClear:true, shouldRefocus:true }; - replace: (_, rest1, rest2, parsedMessage, channel, replyOptions, extra) => "" + - `${rest1}async ${rest2}` + + // https://regex101.com/r/hBlXpl/1 + match: /let (\i)=\i\.\i\.parse\((\i),.+?let (\i)=\i\.\i\.getSendMessageOptions\(\{.+?\}\);(?<=\)\(({.+?})\)\.then.+?)/, + replace: (m, parsedMessage, channel, replyOptions, extra) => m + `if(await Vencord.Api.MessageEvents._handlePreSend(${channel}.id,${parsedMessage},${extra},${replyOptions}))` + "return{shouldClear:false,shouldRefocus:true};" } @@ -52,8 +49,7 @@ export default definePlugin({ replacement: { match: /let\{id:\i}=(\i),{id:\i}=(\i);return \i\.useCallback\((\i)=>\{/, replace: (m, message, channel, event) => - // the message param is shadowed by the event param, so need to alias them - `const vcMsg=${message},vcChan=${channel};${m}Vencord.Api.MessageEvents._handleClick(vcMsg, vcChan, ${event});` + `const vcMsg=${message},vcChan=${channel};${m}Vencord.Api.MessageEvents._handleClick(vcMsg,vcChan,${event});` } } ] diff --git a/src/plugins/_core/settings.tsx b/src/plugins/_core/settings.tsx index 75fa91470..f48f38e03 100644 --- a/src/plugins/_core/settings.tsx +++ b/src/plugins/_core/settings.tsx @@ -65,6 +65,7 @@ export default definePlugin({ replace: (_, sectionTypes, commaOrSemi, elements, element) => `${commaOrSemi} $self.addSettings(${elements}, ${element}, ${sectionTypes}) ${commaOrSemi}` }, { + // FIXME(Bundler change related): Remove old compatiblity once enough time has passed match: /({(?=.+?function (\i).{0,160}(\i)=\i\.useMemo.{0,140}return \i\.useMemo\(\(\)=>\i\(\3).+?(?:function\(\){return |\(\)=>))\2/, replace: (_, rest, settingsHook) => `${rest}$self.wrapSettingsHook(${settingsHook})` } diff --git a/src/plugins/alwaysAnimate/index.ts b/src/plugins/alwaysAnimate/index.ts index fc528466f..a5297445b 100644 --- a/src/plugins/alwaysAnimate/index.ts +++ b/src/plugins/alwaysAnimate/index.ts @@ -43,8 +43,8 @@ export default definePlugin({ // Status emojis find: "#{intl::GUILD_OWNER}),children:", replacement: { - match: /(?<=\.activityEmoji,.+?animate:)\i/, - replace: "!0" + match: /(\.CUSTOM_STATUS.+?animate:)\i/, + replace: (_, rest) => `${rest}!0` } }, { diff --git a/src/plugins/betterFolders/FolderSideBar.tsx b/src/plugins/betterFolders/FolderSideBar.tsx index 53d24ed93..5203b14d2 100644 --- a/src/plugins/betterFolders/FolderSideBar.tsx +++ b/src/plugins/betterFolders/FolderSideBar.tsx @@ -17,14 +17,13 @@ */ import ErrorBoundary from "@components/ErrorBoundary"; -import { findByPropsLazy, findComponentByCodeLazy, findStoreLazy } from "@webpack"; -import { useStateFromStores } from "@webpack/common"; +import { findComponentByCodeLazy, findStoreLazy } from "@webpack"; +import { Animations, useStateFromStores } from "@webpack/common"; import type { CSSProperties } from "react"; import { ExpandedGuildFolderStore, settings } from "."; const ChannelRTCStore = findStoreLazy("ChannelRTCStore"); -const Animations = findByPropsLazy("a", "animated", "useTransition"); const GuildsBar = findComponentByCodeLazy('("guildsnav")'); export default ErrorBoundary.wrap(guildsBarProps => { diff --git a/src/plugins/blurNsfw/index.ts b/src/plugins/blurNsfw/index.ts index 948de0ac6..c4023f098 100644 --- a/src/plugins/blurNsfw/index.ts +++ b/src/plugins/blurNsfw/index.ts @@ -24,14 +24,14 @@ let style: HTMLStyleElement; function setCss() { style.textContent = ` - .vc-nsfw-img [class^=imageWrapper] img, - .vc-nsfw-img [class^=wrapperPaused] video { + .vc-nsfw-img [class^=imageContainer], + .vc-nsfw-img [class^=wrapperPaused] { filter: blur(${Settings.plugins.BlurNSFW.blurAmount}px); transition: filter 0.2s; - } - .vc-nsfw-img [class^=imageWrapper]:hover img, - .vc-nsfw-img [class^=wrapperPaused]:hover video { - filter: unset; + + &:hover { + filter: blur(0); + } } `; } @@ -54,7 +54,7 @@ export default definePlugin({ options: { blurAmount: { type: OptionType.NUMBER, - description: "Blur Amount", + description: "Blur Amount (in pixels)", default: 10, onChange: setCss } diff --git a/src/plugins/clientTheme/clientTheme.css b/src/plugins/clientTheme/clientTheme.css index 64aefdcf5..795b5457e 100644 --- a/src/plugins/clientTheme/clientTheme.css +++ b/src/plugins/clientTheme/clientTheme.css @@ -1,29 +1,29 @@ -.client-theme-settings { +.vc-clientTheme-settings { display: flex; flex-direction: column; } -.client-theme-container { +.vc-clientTheme-container { display: flex; flex-direction: row; justify-content: space-between; } -.client-theme-settings-labels { +.vc-clientTheme-labels { display: flex; flex-direction: column; justify-content: flex-start; } -.client-theme-container > [class^="colorSwatch"] > [class^="swatch"] { +.vc-clientTheme-container [class^="swatch"] { border: thin solid var(--background-modifier-accent) !important; } -.client-theme-warning * { +.vc-clientTheme-warning-text { color: var(--text-danger); } -.client-theme-contrast-warning { +.vc-clientTheme-contrast-warning { background-color: var(--background-primary); padding: 0.5rem; border-radius: .5rem; diff --git a/src/plugins/clientTheme/index.tsx b/src/plugins/clientTheme/index.tsx index 4c1668aae..c7e0e50de 100644 --- a/src/plugins/clientTheme/index.tsx +++ b/src/plugins/clientTheme/index.tsx @@ -7,6 +7,7 @@ import "./clientTheme.css"; import { definePluginSettings } from "@api/Settings"; +import { classNameFactory } from "@api/Styles"; import { Devs } from "@utils/constants"; import { Margins } from "@utils/margins"; import { classes } from "@utils/misc"; @@ -14,6 +15,8 @@ import definePlugin, { OptionType, StartAt } from "@utils/types"; import { findByCodeLazy, findComponentByCodeLazy, findStoreLazy } from "@webpack"; import { Button, Forms, ThemeStore, useStateFromStores } from "@webpack/common"; +const cl = classNameFactory("vc-clientTheme-"); + const ColorPicker = findComponentByCodeLazy("#{intl::USER_SETTINGS_PROFILE_COLOR_SELECT_COLOR}", ".BACKGROUND_PRIMARY)"); const colorPresets = [ @@ -60,9 +63,9 @@ function ThemeSettings() { } return ( -
-
-
+
+
+
Theme Color Add a color to your Discord client theme
@@ -76,10 +79,10 @@ function ThemeSettings() { {(contrastWarning || nitroThemeEnabled) && (<>
-
- Warning, your theme won't look good: - {contrastWarning && Selected color won't contrast well with text} - {nitroThemeEnabled && Nitro themes aren't supported} +
+ Warning, your theme won't look good: + {contrastWarning && Selected color won't contrast well with text} + {nitroThemeEnabled && Nitro themes aren't supported}
{(contrastWarning && fixableContrast) && } {(nitroThemeEnabled) && } @@ -91,15 +94,12 @@ function ThemeSettings() { const settings = definePluginSettings({ color: { - description: "Color your Discord client theme will be based around. Light mode isn't supported", type: OptionType.COMPONENT, default: "313338", - component: () => + component: ThemeSettings }, resetColor: { - description: "Reset Theme Color", type: OptionType.COMPONENT, - default: "313338", component: () => ( + ) } }); diff --git a/src/plugins/messageLogger/deleteStyleText.css b/src/plugins/messageLogger/deleteStyleText.css index a4e9a93c1..a114b7de8 100644 --- a/src/plugins/messageLogger/deleteStyleText.css +++ b/src/plugins/messageLogger/deleteStyleText.css @@ -1,24 +1,8 @@ -/* Message content highlighting */ -.messagelogger-deleted [class*="contents"] > :is(div, h1, h2, h3, p) { - color: var(--status-danger, #f04747) !important; -} - -/* Markdown title highlighting */ -.messagelogger-deleted [class*="contents"] :is(h1, h2, h3) { - color: var(--status-danger, #f04747) !important; -} - -/* Bot "thinking" text highlighting */ -.messagelogger-deleted [class*="colorStandard"] { - color: var(--status-danger, #f04747) !important; -} - -/* Embed highlighting */ -.messagelogger-deleted article :is(div, span, h1, h2, h3, p) { - color: var(--status-danger, #f04747) !important; -} - -.messagelogger-deleted a { - color: var(--red-460, #be3535) !important; - text-decoration: underline; +.messagelogger-deleted { + --text-normal: var(--status-danger, #f04747); + --interactive-normal: var(--status-danger, #f04747); + --text-muted: var(--status-danger, #f04747); + --embed-title: var(--red-460, #be3535); + --text-link: var(--red-460, #be3535); + --header-primary: var(--red-460, #be3535); } diff --git a/src/plugins/messageLogger/index.tsx b/src/plugins/messageLogger/index.tsx index cbfa2aaf2..ae62379d3 100644 --- a/src/plugins/messageLogger/index.tsx +++ b/src/plugins/messageLogger/index.tsx @@ -442,15 +442,10 @@ export default definePlugin({ { // Attachment renderer find: ".removeMosaicItemHoverButton", - group: true, replacement: [ { - match: /(className:\i,item:\i),/, - replace: "$1,item: deleted," - }, - { - match: /\[\i\.obscured\]:.+?,/, - replace: "$& 'messagelogger-deleted-attachment': deleted," + match: /\[\i\.obscured\]:.+?,(?<=item:(\i).+?)/, + replace: '$&"messagelogger-deleted-attachment":$1.originalItem?.deleted,' } ] }, diff --git a/src/plugins/messageLogger/messageLogger.css b/src/plugins/messageLogger/messageLogger.css index 2759129d9..a76e98888 100644 --- a/src/plugins/messageLogger/messageLogger.css +++ b/src/plugins/messageLogger/messageLogger.css @@ -4,12 +4,12 @@ .messagelogger-deleted :is( - video, + .messagelogger-deleted-attachment, .emoji, [data-type="sticker"], - iframe, - .messagelogger-deleted-attachment, - [class|="inlineMediaEmbed"] + [class*="embedIframe"], + [class*="embedSpotify"], + [class*="imageContainer"] ) { filter: grayscale(1) !important; transition: 150ms filter ease-in-out; @@ -17,18 +17,14 @@ &[class*="hiddenMosaicItem_"] { filter: grayscale(1) blur(var(--custom-message-attachment-spoiler-blur-radius, 44px)) !important; } + + &:hover { + filter: grayscale(0) !important; + } } -.messagelogger-deleted -:is( - video, - .emoji, - [data-type="sticker"], - iframe, - .messagelogger-deleted-attachment, - [class|="inlineMediaEmbed"] -):hover { - filter: grayscale(0) !important; +.messagelogger-deleted [class*="spoilerWarning"] { + color: var(--status-danger); } .theme-dark .messagelogger-edited { diff --git a/src/plugins/messageTags/index.ts b/src/plugins/messageTags/index.ts index 5a5d03fdb..49e88c42d 100644 --- a/src/plugins/messageTags/index.ts +++ b/src/plugins/messageTags/index.ts @@ -89,7 +89,7 @@ export default definePlugin({ settings, async start() { - // TODO: Remove DataStore tags migration once enough time has passed + // TODO(OptionType.CUSTOM Related): Remove DataStore tags migration once enough time has passed const oldTags = await DataStore.get(DATA_KEY); if (oldTags != null) { // @ts-ignore diff --git a/src/plugins/noScreensharePreview/index.ts b/src/plugins/noScreensharePreview/index.ts deleted file mode 100644 index d4bb9c1eb..000000000 --- a/src/plugins/noScreensharePreview/index.ts +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Vencord, a modification for Discord's desktop app - * Copyright (c) 2022 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 - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . -*/ - -import { getUserSettingLazy } from "@api/UserSettings"; -import { Devs } from "@utils/constants"; -import definePlugin from "@utils/types"; - -const DisableStreamPreviews = getUserSettingLazy("voiceAndVideo", "disableStreamPreviews")!; - -// @TODO: Delete this plugin in the future -export default definePlugin({ - name: "NoScreensharePreview", - description: "Disables screenshare previews from being sent.", - authors: [Devs.Nuckyz], - - start() { - if (!DisableStreamPreviews.getSetting()) { - DisableStreamPreviews.updateSetting(true); - } - }, - - stop() { - if (DisableStreamPreviews.getSetting()) { - DisableStreamPreviews.updateSetting(false); - } - } -}); diff --git a/src/plugins/notificationVolume/index.ts b/src/plugins/notificationVolume/index.ts index bc3c7539d..d320d76f1 100644 --- a/src/plugins/notificationVolume/index.ts +++ b/src/plugins/notificationVolume/index.ts @@ -25,9 +25,9 @@ export default definePlugin({ settings, patches: [ { - find: "_ensureAudio(){", + find: "ensureAudio(){", replacement: { - match: /(?=Math\.min\(\i\.\i\.getOutputVolume\(\)\/100)/, + match: /(?=Math\.min\(\i\.\i\.getOutputVolume\(\)\/100)/g, replace: "$self.settings.store.notificationVolume/100*" }, }, diff --git a/src/plugins/openInApp/index.ts b/src/plugins/openInApp/index.ts index e344f1458..1c90b5290 100644 --- a/src/plugins/openInApp/index.ts +++ b/src/plugins/openInApp/index.ts @@ -100,6 +100,7 @@ export default definePlugin({ replace: "true" }, { + // FIXME(Bundler change related): Remove old compatiblity once enough time has passed match: /(!)?\(0,\i\.isDesktop\)\(\)/, replace: (_, not) => not ? "false" : "true" } diff --git a/src/plugins/permissionFreeWill/index.ts b/src/plugins/permissionFreeWill/index.ts index 510d9cb3b..8a6135145 100644 --- a/src/plugins/permissionFreeWill/index.ts +++ b/src/plugins/permissionFreeWill/index.ts @@ -46,6 +46,7 @@ export default definePlugin({ find: "#{intl::ONBOARDING_CHANNEL_THRESHOLD_WARNING}", replacement: [ { + // FIXME(Bundler change related): Remove old compatiblity once enough time has passed match: /{(?:\i:(?:function\(\){return |\(\)=>)\i}?,?){2}}/, replace: m => m.replaceAll(canonicalizeMatch(/(function\(\){return |\(\)=>)\i/g), "$1()=>Promise.resolve(true)") } diff --git a/src/plugins/permissionsViewer/components/RolesAndUsersPermissions.tsx b/src/plugins/permissionsViewer/components/RolesAndUsersPermissions.tsx index 341971ff8..02662fe97 100644 --- a/src/plugins/permissionsViewer/components/RolesAndUsersPermissions.tsx +++ b/src/plugins/permissionsViewer/components/RolesAndUsersPermissions.tsx @@ -157,7 +157,7 @@ function RolesAndUsersPermissionsComponent({ permissions, guild, modalProps, hea src={user.getAvatarURL(void 0, void 0, false)} /> )} - + { permission.type === PermissionType.Role ? role?.name ?? "Unknown Role" diff --git a/src/plugins/permissionsViewer/styles.css b/src/plugins/permissionsViewer/styles.css index b7e420964..2ca61025d 100644 --- a/src/plugins/permissionsViewer/styles.css +++ b/src/plugins/permissionsViewer/styles.css @@ -73,7 +73,7 @@ background-color: var(--background-modifier-selected); } -.vc-permviewer-modal-list-item > div { +.vc-permviewer-modal-list-item-text { text-overflow: ellipsis; white-space: nowrap; overflow: hidden; diff --git a/src/plugins/pinDms/data.ts b/src/plugins/pinDms/data.ts index 2f4a1156e..d689bd2af 100644 --- a/src/plugins/pinDms/data.ts +++ b/src/plugins/pinDms/data.ts @@ -155,7 +155,7 @@ export function moveChannel(channelId: string, direction: -1 | 1) { swapElementsInArray(category.channels, a, b); } -// TODO: Remove DataStore PinnedDms migration once enough time has passed +// TODO(OptionType.CUSTOM Related): Remove DataStore PinnedDms migration once enough time has passed async function migrateData() { if (Settings.plugins.PinDMs.dmSectioncollapsed != null) { settings.store.dmSectionCollapsed = Settings.plugins.PinDMs.dmSectioncollapsed; diff --git a/src/plugins/platformIndicators/index.tsx b/src/plugins/platformIndicators/index.tsx index 4612082f5..7829295a0 100644 --- a/src/plugins/platformIndicators/index.tsx +++ b/src/plugins/platformIndicators/index.tsx @@ -133,7 +133,7 @@ function getBadges({ userId }: BadgeUserArgs): ProfileBadge[] { })); } -const PlatformIndicator = ({ user, wantMargin = true, wantTopMargin = false, small = false }: { user: User; wantMargin?: boolean; wantTopMargin?: boolean; small?: boolean; }) => { +const PlatformIndicator = ({ user, small = false }: { user: User; small?: boolean; }) => { if (!user || user.bot) return null; ensureOwnStatus(user); @@ -155,11 +155,7 @@ const PlatformIndicator = ({ user, wantMargin = true, wantTopMargin = false, sma return ( {icons} @@ -190,7 +186,7 @@ const indicatorLocations = { description: "Inside messages", onEnable: () => addMessageDecoration("platform-indicator", props => - + ), onDisable: () => removeMessageDecoration("platform-indicator") diff --git a/src/plugins/quickReply/index.ts b/src/plugins/quickReply/index.ts index 4a7060c59..f6ca5b459 100644 --- a/src/plugins/quickReply/index.ts +++ b/src/plugins/quickReply/index.ts @@ -196,7 +196,7 @@ function nextReply(isUp: boolean) { channel, message, shouldMention: shouldMention(message), - showMentionToggle: channel.isPrivate() && message.author.id !== meId, + showMentionToggle: !channel.isPrivate() && message.author.id !== meId, _isQuickReply: true }); ComponentDispatch.dispatchToLastSubscribed("TEXTAREA_FOCUS"); diff --git a/src/plugins/reviewDB/auth.tsx b/src/plugins/reviewDB/auth.tsx index 4cd81f2ea..8d9789dd7 100644 --- a/src/plugins/reviewDB/auth.tsx +++ b/src/plugins/reviewDB/auth.tsx @@ -7,15 +7,12 @@ import { DataStore } from "@api/index"; import { Logger } from "@utils/Logger"; import { openModal } from "@utils/modal"; -import { findByPropsLazy } from "@webpack"; -import { showToast, Toasts, UserStore } from "@webpack/common"; +import { OAuth2AuthorizeModal, showToast, Toasts, UserStore } from "@webpack/common"; import { ReviewDBAuth } from "./entities"; const DATA_STORE_KEY = "rdb-auth"; -const { OAuth2AuthorizeModal } = findByPropsLazy("OAuth2AuthorizeModal"); - export let Auth: ReviewDBAuth = {}; export async function initAuth() { diff --git a/src/plugins/reviewDB/components/BlockedUserModal.tsx b/src/plugins/reviewDB/components/BlockedUserModal.tsx index 43c81eb52..8b8271746 100644 --- a/src/plugins/reviewDB/components/BlockedUserModal.tsx +++ b/src/plugins/reviewDB/components/BlockedUserModal.tsx @@ -39,7 +39,7 @@ function BlockedUser({ user, isBusy, setIsBusy }: { user: ReviewDBUser; isBusy: return (
- + {user.username} { diff --git a/src/plugins/reviewDB/components/ReviewModal.tsx b/src/plugins/reviewDB/components/ReviewModal.tsx index 71ac021f0..1485022da 100644 --- a/src/plugins/reviewDB/components/ReviewModal.tsx +++ b/src/plugins/reviewDB/components/ReviewModal.tsx @@ -65,7 +65,7 @@ function Modal({ modalProps, modalKey, discordId, name, type }: { modalProps: an -
+
{ownReview && ( ( diff --git a/src/plugins/reviewDB/style.css b/src/plugins/reviewDB/style.css index 190b8f620..c62c300e9 100644 --- a/src/plugins/reviewDB/style.css +++ b/src/plugins/reviewDB/style.css @@ -16,16 +16,11 @@ border: 1px solid var(--profile-message-input-border-color); } -.vc-rdb-modal-footer > div { +.vc-rdb-modal-footer-wrapper { width: 100%; margin: 6px 16px; } -/* When input becomes disabled(while sending review), input adds unneccesary padding to left, this prevents it */ -.vc-rdb-input > div > div { - padding-left: 0 !important; -} - .vc-rdb-placeholder { margin-bottom: 4px; font-weight: bold; @@ -69,7 +64,7 @@ border-radius: 8px; } -.vc-rdb-review-comment img { +.vc-rdb-review-comment [class*="avatar"] { vertical-align: text-top; } @@ -117,13 +112,13 @@ align-items: center; } -.vc-rdb-block-modal-row img { +.vc-rdb-block-modal-avatar { border-radius: 50%; height: 2em; width: 2em; } -.vc-rdb-block-modal img::before { +.vc-rdb-block-modal-avatar::before { content: ""; display: block; width: 100%; diff --git a/src/plugins/sendTimestamps/index.tsx b/src/plugins/sendTimestamps/index.tsx index 437df1a58..57b9de0df 100644 --- a/src/plugins/sendTimestamps/index.tsx +++ b/src/plugins/sendTimestamps/index.tsx @@ -68,15 +68,16 @@ function PickerModal({ rootProps, close }: { rootProps: ModalProps, close(): voi return ( - + Timestamp Picker - + setValue(e.currentTarget.value)} @@ -86,23 +87,25 @@ function PickerModal({ rootProps, close }: { rootProps: ModalProps, close(): voi /> Timestamp Format - ({ + label: m, + value: m + })) + } + isSelected={v => v === format} + select={v => setFormat(v)} + serialize={v => v} + renderOptionLabel={o => ( +
+ {Parser.parse(formatTimestamp(time, o.value))} +
+ )} + renderOptionValue={() => rendered} + /> +
Preview diff --git a/src/plugins/sendTimestamps/styles.css b/src/plugins/sendTimestamps/styles.css index 033d5c9d5..e7efbe59e 100644 --- a/src/plugins/sendTimestamps/styles.css +++ b/src/plugins/sendTimestamps/styles.css @@ -1,4 +1,4 @@ -.vc-st-modal-content input { +.vc-st-date-picker { background-color: var(--input-background); color: var(--text-normal); width: 95%; @@ -12,35 +12,28 @@ font-size: 100%; } -.vc-st-format-label, -.vc-st-format-label span { - background-color: transparent; -} - -.vc-st-modal-content [class|="select"] { +.vc-st-format-select { margin-bottom: 1em; + + --background-modifier-accent: transparent; } -.vc-st-modal-content [class|="select"] span { - background-color: var(--input-background); +.vc-st-format-label { + --background-modifier-accent: transparent; } .vc-st-modal-header { place-content: center space-between; } -.vc-st-modal-header h1 { +.vc-st-modal-title { margin: 0; } -.vc-st-modal-header button { +.vc-st-modal-close-button { padding: 0; } .vc-st-preview-text { margin-bottom: 1em; } - -.vc-st-button svg { - transform: scale(1.1) translateY(1px); -} diff --git a/src/plugins/serverInfo/GuildInfoModal.tsx b/src/plugins/serverInfo/GuildInfoModal.tsx index 14b7e1dc8..9f2d3008d 100644 --- a/src/plugins/serverInfo/GuildInfoModal.tsx +++ b/src/plugins/serverInfo/GuildInfoModal.tsx @@ -94,6 +94,7 @@ function GuildInfoModal({ guild }: GuildProps) {
{iconUrl ? openImageModal({ @@ -170,6 +171,7 @@ function Owner(guildId: string, owner: User) { return (
openImageModal({ diff --git a/src/plugins/serverInfo/styles.css b/src/plugins/serverInfo/styles.css index 8c88e4f40..274b7d138 100644 --- a/src/plugins/serverInfo/styles.css +++ b/src/plugins/serverInfo/styles.css @@ -21,7 +21,7 @@ margin: 0.5em; } -.vc-gp-header img { +.vc-gp-icon { width: 48px; height: 48px; cursor: pointer; @@ -82,7 +82,7 @@ gap: 0.2em; } -.vc-gp-owner img { +.vc-gp-owner-avatar { height: 20px; border-radius: 50%; cursor: pointer; diff --git a/src/plugins/shikiCodeblocks.desktop/components/Code.tsx b/src/plugins/shikiCodeblocks.desktop/components/Code.tsx index 8deca5882..2794234df 100644 --- a/src/plugins/shikiCodeblocks.desktop/components/Code.tsx +++ b/src/plugins/shikiCodeblocks.desktop/components/Code.tsx @@ -84,9 +84,9 @@ export const Code = ({ } const codeTableRows = lines.map((line, i) => ( - - {i + 1} - {line} + + {i + 1} + {line} )); diff --git a/src/plugins/shikiCodeblocks.desktop/components/Highlighter.tsx b/src/plugins/shikiCodeblocks.desktop/components/Highlighter.tsx index dd1401939..2d62af6e1 100644 --- a/src/plugins/shikiCodeblocks.desktop/components/Highlighter.tsx +++ b/src/plugins/shikiCodeblocks.desktop/components/Highlighter.tsx @@ -102,7 +102,7 @@ export const Highlighter = ({ color: themeBase.plainColor, }} > - +
); } diff --git a/src/plugins/showConnections/index.tsx b/src/plugins/showConnections/index.tsx index 46629c770..f99c0be96 100644 --- a/src/plugins/showConnections/index.tsx +++ b/src/plugins/showConnections/index.tsx @@ -125,7 +125,7 @@ function CompactConnectionComponent({ connection, theme }: { connection: Connect {connection.name} {connection.verified && } - + } key={connection.id} diff --git a/src/plugins/showConnections/styles.css b/src/plugins/showConnections/styles.css index cead5201c..5bb16e0fd 100644 --- a/src/plugins/showConnections/styles.css +++ b/src/plugins/showConnections/styles.css @@ -14,6 +14,6 @@ word-break: break-all; } -.vc-sc-tooltip svg { +.vc-sc-tooltip-icon { min-width: 16px; } diff --git a/src/plugins/showHiddenChannels/components/HiddenChannelLockScreen.tsx b/src/plugins/showHiddenChannels/components/HiddenChannelLockScreen.tsx index 15cd17c46..bbe286af5 100644 --- a/src/plugins/showHiddenChannels/components/HiddenChannelLockScreen.tsx +++ b/src/plugins/showHiddenChannels/components/HiddenChannelLockScreen.tsx @@ -18,6 +18,7 @@ import { Settings } from "@api/Settings"; import ErrorBoundary from "@components/ErrorBoundary"; +import { classes } from "@utils/misc"; import { formatDuration } from "@utils/text"; import { findByPropsLazy, findComponentByCodeLazy } from "@webpack"; import { EmojiStore, FluxDispatcher, GuildMemberStore, GuildStore, Parser, PermissionsBits, PermissionStore, SnowflakeUtils, Text, Timestamp, Tooltip, useEffect, useState } from "@webpack/common"; @@ -25,7 +26,7 @@ import type { Channel } from "discord-types/general"; import openRolesAndUsersPermissionsModal, { PermissionType, RoleOrUserPermission } from "../../permissionsViewer/components/RolesAndUsersPermissions"; import { sortPermissionOverwrites } from "../../permissionsViewer/utils"; -import { settings } from ".."; +import { cl, settings } from ".."; const enum SortOrderTypes { LATEST_ACTIVITY = 0, @@ -168,19 +169,19 @@ function HiddenChannelLockScreen({ channel }: { channel: ExtendedChannel; }) { }, [channelId]); return ( -
-
- +
+
+ -
- This is a {!PermissionStore.can(PermissionsBits.VIEW_CHANNEL, channel) ? "hidden" : "locked"} {ChannelTypesToChannelNames[type]} channel. +
+ This is a {!PermissionStore.can(PermissionsBits.VIEW_CHANNEL, channel) ? "hidden" : "locked"} {ChannelTypesToChannelNames[type]} channel {channel.isNSFW() && {({ onMouseLeave, onMouseEnter }) => ( 0 && ( -
+
{Parser.parseTopic(topic, false, { channelId })}
)} @@ -213,7 +214,6 @@ function HiddenChannelLockScreen({ channel }: { channel: ExtendedChannel; }) { } - {lastPinTimestamp && Last message pin: } @@ -247,7 +247,7 @@ function HiddenChannelLockScreen({ channel }: { channel: ExtendedChannel; }) { Default sort order: {SortOrderTypesToNames[defaultSortOrder]} } {defaultReactionEmoji != null && -
+
Default reaction emoji: {Parser.defaultRules[defaultReactionEmoji.emojiName ? "emoji" : "customEmoji"].react({ name: defaultReactionEmoji.emojiName @@ -258,29 +258,29 @@ function HiddenChannelLockScreen({ channel }: { channel: ExtendedChannel; }) { src: defaultReactionEmoji.emojiName ? EmojiUtils.getURL(defaultReactionEmoji.emojiName) : void 0 - }, void 0, { key: "0" })} + }, void 0, { key: 0 })}
} {channel.hasFlag(ChannelFlags.REQUIRE_TAG) && Posts on this forum require a tag to be set. } {availableTags && availableTags.length > 0 && -
+
Available tags: -
+
{availableTags.map(tag => )}
} -
-
- {Settings.plugins.PermissionsViewer.enabled && ( +
+
+ {Vencord.Plugins.isPluginEnabled("PermissionsViewer") && ( {({ onMouseLeave, onMouseEnter }) => (