diff --git a/src/equicordplugins/betterBlockedUsers/index.tsx b/src/equicordplugins/betterBlockedUsers/index.tsx index 39cba789e..56f05b627 100644 --- a/src/equicordplugins/betterBlockedUsers/index.tsx +++ b/src/equicordplugins/betterBlockedUsers/index.tsx @@ -28,7 +28,7 @@ export default definePlugin({ replace: ",$1.listType==='blocked'?$self.renderSearchInput():null" }, { - match: /(?<=userId:(\i).*?\}\)\]\}\),)(\(.*?loading:\i\}\))/, + match: /(?<=\{userId:(\i).*?\.globalName.{0,25}\}\)\]\}\),)(\(.*?loading:\i\}\))/, replace: "$self.renderUser($1,$2)", }, { diff --git a/src/equicordplugins/dragify/index.tsx b/src/equicordplugins/dragify/index.tsx index 5cbd93dce..1bb788f09 100644 --- a/src/equicordplugins/dragify/index.tsx +++ b/src/equicordplugins/dragify/index.tsx @@ -177,14 +177,6 @@ export default definePlugin({ } ] }, - // Voice channel rows (alternate voice list implementation) - { - find: "handleClickChat", - replacement: { - match: /(?<=getModeClass\(\),.{0,50})"data-dnd-name":.{0,49},children:\[/, - replace: "draggable:!0,onDragStart:e=>$self.onChannelDragStart(e,{id:this?.props?.channel?.id,guild_id:this?.props?.channel?.guild_id}),$&" - } - }, // Thread rows in channel list (sidebar thread items) { find: "__invalid_threadMainContent", diff --git a/src/equicordplugins/holyNotes/index.tsx b/src/equicordplugins/holyNotes/index.tsx index 182a12098..c4bc6e1ac 100644 --- a/src/equicordplugins/holyNotes/index.tsx +++ b/src/equicordplugins/holyNotes/index.tsx @@ -80,7 +80,7 @@ export default definePlugin({ replacement: [ { // Append messagelogger-deleted to classNames if deleted - match: /(?<=let (\i)=\i\.memo\(function\(\i\)\{.{0,200}\.THREAD_STARTER_MESSAGE.*?bg-flash-.{0,10}:\i\}\);)/, + match: /(?<=(\i)=\i\.memo\(function\(\i\)\{.{0,200}\.THREAD_STARTER_MESSAGE.*?bg-flash-.{0,10}:\i\}\);)/, replace: "ChannelMessage=$1;" }, ], diff --git a/src/equicordplugins/voiceMessageTranscriber.desktop/index.tsx b/src/equicordplugins/voiceMessageTranscriber.desktop/index.tsx index db2d8def3..2761e06a0 100644 --- a/src/equicordplugins/voiceMessageTranscriber.desktop/index.tsx +++ b/src/equicordplugins/voiceMessageTranscriber.desktop/index.tsx @@ -25,8 +25,8 @@ import { lodash, ScrollerAuto, SearchableSelect, useEffect, useRef, useState } f import { cl, decodeAudio, LANGUAGES, TranscriptionWorker } from "./utils"; const Native = VencordNative.pluginHelpers.VoiceMessageTranscriber as PluginNative; -const ManaBaseRadioGroup = findComponentByCodeLazy('"data-mana-component":"BaseRadioGroup"') as React.ComponentType; const ChannelListIcon = findComponentByCodeLazy("1-1-1ZM2 8a1"); +let ManaBaseRadioGroup: React.ComponentType; const settings = definePluginSettings({ selectedModel: { @@ -322,8 +322,18 @@ export default definePlugin({ match: /"source",{src:(\i).{0,700}duration:\i}\),/, replace: "$&$self.button($1)," } - } + }, + { + find: '"data-mana-component":"BaseRadioGroup"', + replacement: { + match: /(?=function (\i)\(\i\)\{.{0,400}"data-mana-component":"BaseRadioGroup")/, + replace: "$self.ManaBaseRadioGroup=$1;" + } + }, ], + set ManaBaseRadioGroup(value: any) { + ManaBaseRadioGroup = value; + }, settings, button(src: string) { diff --git a/src/equicordplugins/wallpaperFree/components/ctxmenu.tsx b/src/equicordplugins/wallpaperFree/components/ctxmenu.tsx deleted file mode 100644 index b476a3a8e..000000000 --- a/src/equicordplugins/wallpaperFree/components/ctxmenu.tsx +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Vencord, a Discord client mod - * Copyright (c) 2025 Vendicated and contributors - * SPDX-License-Identifier: GPL-3.0-or-later - */ - -import { NavContextMenuPatchCallback } from "@api/ContextMenu"; -import { WallpaperFreeStore } from "@equicordplugins/wallpaperFree/store"; -import { openModal } from "@utils/modal"; -import { ChannelStore, FluxDispatcher, Menu } from "@webpack/common"; - -import { SetWallpaperModal } from "./modal"; - -const addWallpaperMenu = (channelId?: string, guildId?: string) => { - const setWallpaper = (url?: string) => { - FluxDispatcher.dispatch({ - // @ts-ignore - type: "VC_WALLPAPER_FREE_CHANGE", - channelId, - guildId, - url, - }); - }; - - const initialUrl = channelId ? WallpaperFreeStore.getForChannel(channelId) : - guildId ? WallpaperFreeStore.getForGuild(guildId) : undefined; - - return ( - - openModal(props => )} - /> - - setWallpaper(void 0)} - /> - - ); -}; - -const UserContextPatch: NavContextMenuPatchCallback = (children, args) => { - if (!args.user) return; - const dmChannelId = ChannelStore.getDMFromUserId(args.user.id); - children.push(addWallpaperMenu(dmChannelId)); -}; - -const ChannelContextPatch: NavContextMenuPatchCallback = (children, args) => { - if (!args.channel) return; - children.push(addWallpaperMenu(args.channel.id)); -}; - -const GuildContextPatch: NavContextMenuPatchCallback = (children, args) => { - if (!args.guild) return; - children.push(addWallpaperMenu(void 0, args.guild.id)); -}; - -export { ChannelContextPatch, GuildContextPatch, UserContextPatch }; diff --git a/src/equicordplugins/wallpaperFree/components/modal.tsx b/src/equicordplugins/wallpaperFree/components/modal.tsx deleted file mode 100644 index 86ad0d602..000000000 --- a/src/equicordplugins/wallpaperFree/components/modal.tsx +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Vencord, a Discord client mod - * Copyright (c) 2025 Vendicated and contributors - * SPDX-License-Identifier: GPL-3.0-or-later - */ - -import { BaseText } from "@components/BaseText"; -import { ModalContent, ModalHeader, ModalProps, ModalRoot, ModalSize } from "@utils/modal"; -import { Button, TextInput, useState } from "@webpack/common"; - -interface Props { - props: ModalProps; - onSelect: (url: string) => void; - initialUrl: string | undefined; -} - -export function SetWallpaperModal({ props, onSelect, initialUrl }: Props) { - const [url, setUrl] = useState(initialUrl ?? ""); - - return ( - - - - Set wallpaper - - - -
- The image url - { - setUrl(u); - }} - autoFocus - /> - {url && ( - - )} -
- - -
-
-
-
- ); -} diff --git a/src/equicordplugins/wallpaperFree/components/util.tsx b/src/equicordplugins/wallpaperFree/components/util.tsx deleted file mode 100644 index c71e241f4..000000000 --- a/src/equicordplugins/wallpaperFree/components/util.tsx +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Vencord, a Discord client mod - * Copyright (c) 2025 Vendicated and contributors - * SPDX-License-Identifier: GPL-3.0-or-later - */ - -import { BaseText } from "@components/BaseText"; -import { WallpaperFreeStore } from "@equicordplugins/wallpaperFree/store"; -import { openModal } from "@utils/modal"; -import { makeCodeblock } from "@utils/text"; -import { Button, FluxDispatcher, Parser } from "@webpack/common"; - -import { SetWallpaperModal } from "./modal"; - -export function GlobalDefaultComponent() { - const setGlobal = (url?: string) => { - FluxDispatcher.dispatch({ - // @ts-ignore - type: "VC_WALLPAPER_FREE_CHANGE_GLOBAL", - url, - }); - }; - - return ( - <> - - - - - - - ); -} - -export function TipsComponent() { - const tipText = ` - .vc-wpfree-wp-container { - transform: scaleX(-1); /* flip it horizontally */ - filter: blur(4px); /* apply a blur */ - opacity: 0.7; /* self-explanatory */ - } - - /* If you don't like embeds being transparent */ - - [class*=embedFull__] { - background: var(--background-surface-high) !important; - } - - /* the same for codeblocks (or use ShikiCodeblocks) */ - - .hljs { - background-color: var(--background-base-lowest) !important; - }`; - return ( -
- {!IS_WEB && ( - <> - - you can use local files by having them in the vencord theme directory, and using the url vencord:///themes/filename.ext - - - - )} - {Parser.parse(makeCodeblock(tipText, "css"))} - -
- ); -} diff --git a/src/equicordplugins/wallpaperFree/index.tsx b/src/equicordplugins/wallpaperFree/index.tsx deleted file mode 100644 index 8e5c297db..000000000 --- a/src/equicordplugins/wallpaperFree/index.tsx +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Vencord, a Discord client mod - * Copyright (c) 2023 Vendicated and contributors - * SPDX-License-Identifier: GPL-3.0-or-later - */ - -import "./styles.css"; - -import { definePluginSettings } from "@api/Settings"; -import { Devs } from "@utils/constants"; -import definePlugin, { OptionType } from "@utils/types"; -import { Channel } from "@vencord/discord-types"; -import { useStateFromStores } from "@webpack/common"; - -import { ChannelContextPatch, GuildContextPatch, UserContextPatch } from "./components/ctxmenu"; -import { GlobalDefaultComponent, TipsComponent } from "./components/util"; -import { WallpaperFreeStore } from "./store"; - -export const settings = definePluginSettings({ - globalDefault: { - description: "Set a global default wallpaper for all channels.", - type: OptionType.COMPONENT, - component: GlobalDefaultComponent - }, - stylingTips: { - description: "", - type: OptionType.COMPONENT, - component: TipsComponent, - }, -}); - -export default definePlugin({ - name: "WallpaperFree", - authors: [Devs.Joona], - description: "Recreation of the old DM wallpaper experiment; Set a background image for any channel, user or server.", - tags: ["Appearance", "Chat", "Customisation"], - patches: [ - { - find: ".handleSendMessage,onResize", - group: true, - replacement: [ - { - match: /(?<=#{intl::CHANNEL_A11Y_LABEL};).{1,400},(?=keyboardModeEnabled:)/, - replace: "const vcWallpaperFreeUrl=$self.WallpaperState(arguments[0].channel);$&vcWallpaperFreeUrl," - }, - { - match: /}\)]}\)](?=.{1,30}messages-)/, - replace: "$&.toSpliced(0,0,$self.Wallpaper({url:this.props.vcWallpaperFreeUrl}))" - } - ] - } - ], - settings, - contextMenus: { - "user-context": UserContextPatch, - "channel-context": ChannelContextPatch, - "thread-context": ChannelContextPatch, - "gdm-context": ChannelContextPatch, - "guild-context": GuildContextPatch, - }, - Wallpaper({ url }: { url: string; }) { - // no we cant place the hook here - if (!url) return null; - - return
; - }, - WallpaperState(channel: Channel) { - return useStateFromStores([WallpaperFreeStore], () => WallpaperFreeStore.getUrl(channel)); - }, -}); diff --git a/src/equicordplugins/wallpaperFree/store.ts b/src/equicordplugins/wallpaperFree/store.ts deleted file mode 100644 index c26119b7a..000000000 --- a/src/equicordplugins/wallpaperFree/store.ts +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Vencord, a Discord client mod - * Copyright (c) 2024 Vendicated and contributors - * SPDX-License-Identifier: GPL-3.0-or-later - */ - -import { proxyLazy } from "@utils/lazy"; -import { Channel, FluxEmitter, FluxStore } from "@vencord/discord-types"; -import { Flux as FluxWP, FluxDispatcher } from "@webpack/common"; - -interface IFlux { - PersistedStore: typeof FluxStore; - Emitter: FluxEmitter; -} - -export const WallpaperFreeStore = proxyLazy(() => { - const wallpaperChannelMap: Map = new Map(); - const wallpaperGuildMap: Map = new Map(); - let globalDefault: string | undefined; - - class WallpaperFreeStore extends (FluxWP as unknown as IFlux).PersistedStore { - static persistKey = "WallpaperFreeStore"; - - // @ts-ignore - initialize(previous: { guildMap: Map, channelMap: Map, globalDefault: string; } | undefined) { - if (!previous) - return; - - wallpaperGuildMap.clear(); - wallpaperChannelMap.clear(); - for (const [channel, url] of previous.channelMap) { - wallpaperChannelMap.set(channel, url); - } - - for (const [guild, url] of previous.guildMap) { - wallpaperGuildMap.set(guild, url); - } - globalDefault = previous.globalDefault; - } - - getState() { - return { guildMap: Array.from(wallpaperGuildMap), channelMap: Array.from(wallpaperChannelMap), globalDefault }; - } - - getUrl(channel: Channel) { - return ( - wallpaperChannelMap.get(channel.id) ?? - wallpaperGuildMap.get(channel.guild_id) ?? - globalDefault - ); - } - - getForChannel(id: string) { return wallpaperChannelMap.get(id); } - - getForGuild(id: string) { return wallpaperGuildMap.get(id); } - - get globalDefault() { return globalDefault; } - } - - const store = new WallpaperFreeStore(FluxDispatcher, { - // @ts-ignore - VC_WALLPAPER_FREE_CHANGE({ guildId, channelId, url }: { guildId: string | undefined, channelId: string | undefined, url: string; }) { - guildId && wallpaperGuildMap.set(guildId, url); - channelId && wallpaperChannelMap.set(channelId, url); - store.emitChange(); - }, - - VC_WALLPAPER_FREE_CHANGE_GLOBAL({ url }: { url: string | undefined; }) { - globalDefault = url; - store.emitChange(); - }, - - VC_WALLPAPER_FREE_RESET() { - wallpaperChannelMap.clear(); - wallpaperGuildMap.clear(); - globalDefault = void 0; - store.emitChange(); - } - }); - - return store; -}); diff --git a/src/equicordplugins/wallpaperFree/styles.css b/src/equicordplugins/wallpaperFree/styles.css deleted file mode 100644 index 839cb1808..000000000 --- a/src/equicordplugins/wallpaperFree/styles.css +++ /dev/null @@ -1,7 +0,0 @@ -.vc-wpfree-wp-container { - background-position: 100% 100%; - background-repeat: no-repeat; - background-size: cover; - inset: 0; - position: absolute; -}