From f0b7b04086b31900df09c44be2a005051ae8e0d9 Mon Sep 17 00:00:00 2001 From: thororen1234 <78185467+thororen1234@users.noreply.github.com> Date: Fri, 24 Apr 2026 11:41:23 -0400 Subject: [PATCH] most of the fixes --- packages/discord-types/src/components.d.ts | 1 + .../_api/profileCollections.ts | 2 +- .../betterBlockedUsers/index.tsx | 2 +- src/equicordplugins/betterInvites/index.tsx | 2 +- src/equicordplugins/clientSideBlock/index.tsx | 2 +- .../components.dev/components/index.tsx | 20 --- .../components/tabs/CalendarTab.tsx | 4 +- .../components/tabs/ChipTab.tsx | 4 +- .../components/tabs/ColorPickerTab.tsx | 23 ++-- .../components/tabs/ComboboxTab.tsx | 4 +- .../components/tabs/ErrorBoundaryTab.tsx | 4 +- .../components/tabs/RadioGroupTab.tsx | 4 +- .../components/tabs/SkeletonTab.tsx | 4 +- .../components/tabs/SwitchTab.tsx | 3 +- src/equicordplugins/components.dev/index.tsx | 121 ++++++++++++++++++ src/equicordplugins/declutter/index.tsx | 2 +- .../dragFavoriteEmotes/index.tsx | 2 +- src/equicordplugins/dragify/index.tsx | 6 +- .../equibopStreamFixes.equibop/index.tsx | 6 +- src/equicordplugins/holyNotes/index.tsx | 20 ++- src/equicordplugins/homeTyping/index.tsx | 2 +- src/equicordplugins/inviteDefaults/index.ts | 2 +- src/equicordplugins/questify/index.tsx | 2 +- src/equicordplugins/searchFix/index.tsx | 2 +- src/equicordplugins/sidebarChat/index.tsx | 7 +- src/equicordplugins/statusPresets/index.tsx | 14 +- src/equicordplugins/wallpaperFree/index.tsx | 2 +- src/equicordplugins/whosWatching/index.tsx | 4 +- src/plugins/moreQuickReactions/index.ts | 8 +- src/plugins/serverInfo/GuildInfoModal.tsx | 2 +- src/plugins/showMeYourName/index.tsx | 6 +- src/webpack/common/components.ts | 1 - src/webpack/common/utils.ts | 4 +- 33 files changed, 221 insertions(+), 71 deletions(-) diff --git a/packages/discord-types/src/components.d.ts b/packages/discord-types/src/components.d.ts index 8d0aa0ed4..5f341fd92 100644 --- a/packages/discord-types/src/components.d.ts +++ b/packages/discord-types/src/components.d.ts @@ -536,4 +536,5 @@ export type ColorPicker = ComponentType<{ suggestedColors?: string[]; label?: ReactNode; onChange(value: number | null): void; + disabled?: boolean; }>; diff --git a/src/equicordplugins/_api/profileCollections.ts b/src/equicordplugins/_api/profileCollections.ts index 388a76ad8..b61066380 100644 --- a/src/equicordplugins/_api/profileCollections.ts +++ b/src/equicordplugins/_api/profileCollections.ts @@ -13,7 +13,7 @@ export default definePlugin({ authors: [Devs.thororen], patches: [ { - find: /\.POPOUT,onClose:\i}\),nicknameIcons:.+?\.isProvisional/, + find: "#{intl::XcTHmQ::raw}", replacement: { match: /user:\i,widgets:.{0,100}?\}\),/, replace: "$&Vencord.Api.ProfileCollections.renderProfileCollections(arguments[0]),", diff --git a/src/equicordplugins/betterBlockedUsers/index.tsx b/src/equicordplugins/betterBlockedUsers/index.tsx index 995a7af10..39cba789e 100644 --- a/src/equicordplugins/betterBlockedUsers/index.tsx +++ b/src/equicordplugins/betterBlockedUsers/index.tsx @@ -24,7 +24,7 @@ export default definePlugin({ find: '"],{numberOfBlockedUsers:', replacement: [ { - match: /(?<=\}=(\i).*?\]\}\))/, + match: /(?<=listType:\i,numberOfUsers:\i\}=(\i).*?\]\}\))/, replace: ",$1.listType==='blocked'?$self.renderSearchInput():null" }, { diff --git a/src/equicordplugins/betterInvites/index.tsx b/src/equicordplugins/betterInvites/index.tsx index 1676df307..59f374a92 100644 --- a/src/equicordplugins/betterInvites/index.tsx +++ b/src/equicordplugins/betterInvites/index.tsx @@ -41,7 +41,7 @@ export default definePlugin({ find: "#{intl::xdCLeM::raw}", replacement: [ { - match: /profile:\i\}\),.{0,15}profile:\i/, + match: /profile:\i\}\),.{0,20}profile:\i(?=.{0,20}profile:\i)/, replace: "$&,invite:arguments[0].invite" } ] diff --git a/src/equicordplugins/clientSideBlock/index.tsx b/src/equicordplugins/clientSideBlock/index.tsx index 1aa51a646..6b783e758 100644 --- a/src/equicordplugins/clientSideBlock/index.tsx +++ b/src/equicordplugins/clientSideBlock/index.tsx @@ -225,7 +225,7 @@ export default definePlugin({ { find: "ACTIVE_NOW_COLUMN)", replacement: { - match: /(\i\.\i),\{(?=\}\)\])/, + match: /(\i),\{(?=\}\)\])/, replace: '"div",{children:$self.activeNowView($1())' } }, diff --git a/src/equicordplugins/components.dev/components/index.tsx b/src/equicordplugins/components.dev/components/index.tsx index d55c8b8dc..e20d627d8 100644 --- a/src/equicordplugins/components.dev/components/index.tsx +++ b/src/equicordplugins/components.dev/components/index.tsx @@ -34,10 +34,8 @@ import type { AnchorProps, AvatarProps, BadgeShapesType, - ChipProps, CircleBadgeProps, ClickableProps, - ColorPickerProps, ColorPickerWithSwatchesProps, ColorSwatchProps, ConfirmModalProps, @@ -52,18 +50,13 @@ import type { GuildIconProps, IconBadgeProps, LocalErrorBoundaryProps, - ManaBaseRadioGroupProps, ManaButtonProps, - ManaCalendarProps, ManaCheckboxGroupProps, ManaCheckboxProps, - ManaComboboxProps, - ManaDatePickerProps, ManaListboxProps, ManaPopoverProps, ManaRichTooltipProps, ManaSelectProps, - ManaSwitchProps, ManaTextAreaProps, ManaTextButtonProps, ManaTextInputProps, @@ -78,11 +71,8 @@ import type { PremiumBadgeProps, ProgressBarProps, SearchBarProps, - SimpleErrorBoundaryProps, - SkeletonProps, SliderProps, SpinnerComponent, - StandaloneRadioIndicatorProps, TextBadgeProps, TimestampProps, ToastData, @@ -121,21 +111,15 @@ export const Clickable = findByCodeLazy("ignoreKeyPress", "renderNonInteractive" export const ManaButton = findComponentByCodeLazy('"data-mana-component":"button"') as React.ComponentType; export const ManaTextButton = findComponentByCodeLazy('"data-mana-component":"text-button"') as React.ComponentType; -export const ManaSwitch = findComponentByCodeLazy('"data-mana-component":"switch"') as React.ComponentType; export const ManaTextInput = findComponentByCodeLazy('"data-mana-component":"text-input"') as React.ComponentType; export const ManaTextArea = findComponentByCodeLazy('"data-mana-component":"text-area"') as React.ComponentType; export const ManaCheckbox = findComponentByCodeLazy('"data-mana-component":"checkbox"') as React.ComponentType; export const ManaSelect = findComponentByCodeLazy('"data-mana-component":"select"') as React.ComponentType; -export const ManaCalendar = findComponentByCodeLazy('"data-mana-component":"calendar"') as React.ComponentType; -export const ManaDatePicker = findComponentByCodeLazy('"data-mana-component":"date-picker"') as React.ComponentType; export const ManaListbox = findComponentByCodeLazy('"data-mana-component":"listbox"') as React.ComponentType; export const ManaCheckboxGroup = findComponentByCodeLazy('"data-mana-component":"checkbox-group"') as React.ComponentType; -export const ManaBaseRadioGroup = findComponentByCodeLazy('"data-mana-component":"BaseRadioGroup"') as React.ComponentType; -export const ManaCombobox = findComponentByCodeLazy("itemToString", "multiSelect", "maxVisibleItems") as React.ComponentType; export const ManaTooltip = findComponentByCodeLazy("VoidTooltip cannot find DOM node") as React.ComponentType; export const ManaRichTooltip = findComponentByCodeLazy('"data-mana-component":"rich-tooltip"') as React.ComponentType; export const ManaPopover = findByCodeLazy("title", "body", "badge", "graphic", "actions", "textLink", "gradientColor", "popoverRef") as React.ComponentType; -export const StandaloneRadioIndicator = findComponentByCodeLazy("standaloneRadioIndicator", "animateIn", "animateOut") as React.ComponentType; export const Slider = findComponentByCodeLazy("stickToMarkers", "onMarkerRender", "grabberClassName") as React.ComponentType; export const Avatar = findComponentByCodeLazy("statusTooltip", "statusBackdropColor", "isSpeaking") as React.ComponentType; @@ -144,12 +128,9 @@ export const Spinner = findComponentByCodeLazy("spinningCircleSimple", "pulsingE export const SearchBar = findComponentByCodeLazy("#{intl::SEARCH}", "clearable", "autoComplete") as React.ComponentType; export const Paginator = findComponentByCodeLazy("#{intl::BACK}", "#{intl::NEXT}", "renderPageWrapper") as React.ComponentType; export const Notice = findComponentByCodeLazy("messageType", '="text-default"', '="text-sm/medium"') as React.ComponentType; -export const Chip = findComponentByCodeLazy('variant:"eyebrow"', "chip,") as React.ComponentType; -export const Skeleton = findComponentByCodeLazy("withHeader:t=!0,size:") as React.ComponentType; export const Accordion = findComponentByCodeLazy("scrollHeight)}", "onExpandedChange", "defaultExpanded") as React.ComponentType; export const Timestamp = findComponentByCodeLazy("#{intl::MESSAGE_EDITED_TIMESTAMP_A11Y_LABEL}", "isVisibleOnlyOnHover") as React.ComponentType; export const GuildIcon = findComponentByCodeLazy("Masks.CLAN_ICON,width", "acronymClassName") as React.ComponentType; -export const ColorPicker = findComponentByCodeLazy("#{intl::USER_SETTINGS_PROFILE_COLOR_SELECT_COLOR}", "showEyeDropper") as React.ComponentType; export const FocusLock = findComponentByCodeLazy(".containerRef,{keyboardModeEnabled:") as React.ComponentType; export const UserSummaryItem = findComponentByCodeLazy("popoutUserId") as React.ComponentType; @@ -366,5 +347,4 @@ export const ContextMenuApi: ContextMenuApiType = mapMangledModuleLazy('type:"CO }); export const ErrorBoundary = findComponentByCodeLazy("this.resetErrorBoundary", "onReset", "FallbackComponent") as React.ComponentType; -export const SimpleErrorBoundary = findComponentByCodeLazy("getDerivedStateFromError", "this.props.fallback") as React.ComponentType; export const LocalErrorBoundary = findComponentByCodeLazy("LocalErrorBoundary", "text-feedback-critical") as React.ComponentType; diff --git a/src/equicordplugins/components.dev/components/tabs/CalendarTab.tsx b/src/equicordplugins/components.dev/components/tabs/CalendarTab.tsx index fd1cb27be..a66d4d4a0 100644 --- a/src/equicordplugins/components.dev/components/tabs/CalendarTab.tsx +++ b/src/equicordplugins/components.dev/components/tabs/CalendarTab.tsx @@ -4,7 +4,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later */ -import { ManaCalendar, ManaDatePicker, useState } from ".."; +import { ManaCalendar, ManaDatePicker } from "@equicordplugins/components.dev"; + +import { useState } from ".."; import { DocPage, type PropDef } from "../DocPage"; const CALENDAR_PROPS: PropDef[] = [ diff --git a/src/equicordplugins/components.dev/components/tabs/ChipTab.tsx b/src/equicordplugins/components.dev/components/tabs/ChipTab.tsx index 4122b7c58..05fc15e22 100644 --- a/src/equicordplugins/components.dev/components/tabs/ChipTab.tsx +++ b/src/equicordplugins/components.dev/components/tabs/ChipTab.tsx @@ -4,7 +4,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later */ -import { Chip, Paragraph } from ".."; +import { Chip } from "@equicordplugins/components.dev"; + +import { Paragraph } from ".."; import { DocPage, type PropDef } from "../DocPage"; const CHIP_COLORS = ["blurple", "purple", "green", "orange", "yellow", "pink", "red", "gray"] as const; diff --git a/src/equicordplugins/components.dev/components/tabs/ColorPickerTab.tsx b/src/equicordplugins/components.dev/components/tabs/ColorPickerTab.tsx index a27c59346..37877bb37 100644 --- a/src/equicordplugins/components.dev/components/tabs/ColorPickerTab.tsx +++ b/src/equicordplugins/components.dev/components/tabs/ColorPickerTab.tsx @@ -4,7 +4,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later */ -import { ColorPicker, ColorPickerWithSwatches, ColorSwatch, DefaultColorButton, Paragraph, PresetColors, useState } from ".."; +import { ColorPicker } from "@webpack/common"; + +import { ColorPickerWithSwatches, ColorSwatch, DefaultColorButton, Paragraph, PresetColors, useState } from ".."; import { DocPage, type PropDef } from "../DocPage"; const DEFAULT_COLOR = 0x5865F2; @@ -58,29 +60,28 @@ const SWATCHES_PROPS: PropDef[] = [ ]; function BasicPickerDemo() { - const [color, setColor] = useState(DEFAULT_COLOR); + const [color, setColor] = useState(DEFAULT_COLOR); return ( <> - Selected: {intToHex(color)} + Selected: {color !== null ? intToHex(color) : DEFAULT_COLOR} ); } function EyeDropperDemo() { - const [color, setColor] = useState(DEFAULT_COLOR); + const [color, setColor] = useState(DEFAULT_COLOR); return ; } function SuggestedDemo() { - const [color, setColor] = useState(0xE74C3C); + const [color, setColor] = useState(0xE74C3C); return ( <> - Selected: {intToHex(color)} - Selected: {color !== null ? intToHex(color) : 0xE74C3C} (0x9B59B6); return ( <> - Selected: {intToHex(color)} + Selected: {color !== null ? intToHex(color) : 0x9B59B6} } renderCustomButton={() => ( diff --git a/src/equicordplugins/components.dev/components/tabs/ComboboxTab.tsx b/src/equicordplugins/components.dev/components/tabs/ComboboxTab.tsx index 581787451..40f5f5403 100644 --- a/src/equicordplugins/components.dev/components/tabs/ComboboxTab.tsx +++ b/src/equicordplugins/components.dev/components/tabs/ComboboxTab.tsx @@ -4,7 +4,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later */ -import { ManaCombobox, Paragraph, useState } from ".."; +import { ManaCombobox } from "@equicordplugins/components.dev"; + +import { Paragraph, useState } from ".."; import { DocPage, type PropDef } from "../DocPage"; const COMBOBOX_PROPS: PropDef[] = [ diff --git a/src/equicordplugins/components.dev/components/tabs/ErrorBoundaryTab.tsx b/src/equicordplugins/components.dev/components/tabs/ErrorBoundaryTab.tsx index 9a96f2cb7..af58ced98 100644 --- a/src/equicordplugins/components.dev/components/tabs/ErrorBoundaryTab.tsx +++ b/src/equicordplugins/components.dev/components/tabs/ErrorBoundaryTab.tsx @@ -4,7 +4,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later */ -import { Button, ErrorBoundary, LocalErrorBoundary, Paragraph, SimpleErrorBoundary, useState } from ".."; +import { SimpleErrorBoundary } from "@equicordplugins/components.dev"; + +import { Button, ErrorBoundary, LocalErrorBoundary, Paragraph, useState } from ".."; import { DocPage, type PropDef, type PropGroup } from "../DocPage"; function ThrowError(): never { diff --git a/src/equicordplugins/components.dev/components/tabs/RadioGroupTab.tsx b/src/equicordplugins/components.dev/components/tabs/RadioGroupTab.tsx index fc8852e52..900e1a56c 100644 --- a/src/equicordplugins/components.dev/components/tabs/RadioGroupTab.tsx +++ b/src/equicordplugins/components.dev/components/tabs/RadioGroupTab.tsx @@ -4,7 +4,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later */ -import { ManaBaseRadioGroup, RadioOption, StandaloneRadioIndicator, useState } from ".."; +import { ManaBaseRadioGroup, StandaloneRadioIndicator } from "@equicordplugins/components.dev"; + +import { RadioOption, useState } from ".."; import { DocPage, type PropDef, type PropGroup } from "../DocPage"; import { EquicordIcon } from "../icons/EquicordIcon"; diff --git a/src/equicordplugins/components.dev/components/tabs/SkeletonTab.tsx b/src/equicordplugins/components.dev/components/tabs/SkeletonTab.tsx index 386c23535..af6327d78 100644 --- a/src/equicordplugins/components.dev/components/tabs/SkeletonTab.tsx +++ b/src/equicordplugins/components.dev/components/tabs/SkeletonTab.tsx @@ -4,7 +4,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later */ -import { ManaButton, Skeleton, useState } from ".."; +import { Skeleton } from "@equicordplugins/components.dev"; + +import { ManaButton, useState } from ".."; import { DocPage, type PropDef } from "../DocPage"; const SKELETON_PROPS: PropDef[] = [ diff --git a/src/equicordplugins/components.dev/components/tabs/SwitchTab.tsx b/src/equicordplugins/components.dev/components/tabs/SwitchTab.tsx index 399041ddd..fa2f59a04 100644 --- a/src/equicordplugins/components.dev/components/tabs/SwitchTab.tsx +++ b/src/equicordplugins/components.dev/components/tabs/SwitchTab.tsx @@ -4,9 +4,10 @@ * SPDX-License-Identifier: GPL-3.0-or-later */ +import { ManaSwitch } from "@equicordplugins/components.dev"; import { findComponentByCodeLazy } from "@webpack"; -import { ManaSwitch, useState } from ".."; +import { useState } from ".."; import { DocPage, type PropDef, type PropGroup } from "../DocPage"; interface SwitchWithLabelProps { diff --git a/src/equicordplugins/components.dev/index.tsx b/src/equicordplugins/components.dev/index.tsx index 539ca46bb..333b1d2e1 100644 --- a/src/equicordplugins/components.dev/index.tsx +++ b/src/equicordplugins/components.dev/index.tsx @@ -13,14 +13,135 @@ import { removeFromArray } from "@utils/misc"; import definePlugin, { StartAt } from "@utils/types"; import { SettingsRouter } from "@webpack/common"; +import { ChipProps, ColorPickerProps, ManaBaseRadioGroupProps, ManaCalendarProps, ManaComboboxProps, ManaDatePickerProps, ManaSwitchProps, SimpleErrorBoundaryProps, SkeletonProps, StandaloneRadioIndicatorProps } from "./components"; import ComponentsTab from "./components/ComponentsTab"; +export let Skeleton: React.ComponentType; +export let Chip: React.ComponentType; +export let StandaloneRadioIndicator: React.ComponentType; +export let ManaCombobox: React.ComponentType; +export let ManaBaseRadioGroup: React.ComponentType; +export let ManaDatePicker: React.ComponentType; +export let ManaCalendar: React.ComponentType; +export let ManaSwitch: React.ComponentType; +export let SimpleErrorBoundary: React.ComponentType; +export let ColorPicker: React.ComponentType; + export default definePlugin({ name: "Components", description: "Adds a new tab to settings to browse Discord components.", tags: ["Appearance", "Customisation", "Console", "Developers", "Organisation"], authors: [Devs.prism], dependencies: ["Settings"], + patches: [ + { + find: /withHeader:\i=!0,size:/, + replacement: { + match: /(?=function (\i)\(\i\)\{.{0,50}withHeader:\i=!0)/, + replace: "$self.Skeleton=$1;" + } + }, + { + find: '="grayLight"}', + replacement: { + match: /(?=function (\i)\(\i\)\{.{0,25}="grayLight"\})/, + replace: "$self.Chip=$1;" + } + }, + { + find: ".standaloneRadioIndicator,", + replacement: { + match: /(?=function (\i)\(\i\)\{.{0,15}disabled:\i,isSelected:\i\})/, + replace: "$self.StandaloneRadioIndicator=$1;" + } + }, + { + find: "#{intl::AUTOCOMPLETE_NO_RESULTS_BODY}", + replacement: { + match: /(?<=data-listbox-item-id".*?itemToString:\i\}\);)(?=function (\i)\(\i\)\{)/, + replace: "$self.ManaCombobox=$1;" + } + }, + { + find: '"data-mana-component":"BaseRadioGroup"', + replacement: { + match: /(?=function (\i)\(\i\)\{.{0,400}"data-mana-component":"BaseRadioGroup")/, + replace: "$self.ManaBaseRadioGroup=$1;" + } + }, + { + find: '"data-mana-component":"date-picker"', + replacement: { + match: /(?=function (\i)\(\i\)\{.{0,60},placeholderValue:\i)/, + replace: "$self.ManaDatePicker=$1;" + } + }, + { + find: '"data-mana-component":"calendar"', + replacement: { + match: /(?=function (\i)\(\i\)\{.{0,400}"data-mana-component":"calendar")/, + replace: "$self.ManaCalendar=$1;" + } + }, + { + find: '"data-mana-component":"switch"', + replacement: { + match: /(?=function (\i)\(\i\)\{.{0,50}focusProps:\i,hasIcon:)/, + replace: "$self.ManaSwitch=$1;" + } + }, + { + find: '"data-mana-component":"switch"', + replacement: { + match: /(?=function (\i)\(\i\)\{.{0,50}focusProps:\i,hasIcon:)/, + replace: "$self.ManaSwitch=$1;" + } + }, + { + find: "#{intl::zksHZO::raw}", + replacement: { + match: /(?=class (\i).{0,90}getDerivedStateFromError)/, + replace: "$self.SimpleErrorBoundary=$1;" + } + }, + { + find: "#{intl::USER_SETTINGS_PROFILE_COLOR_SELECT_COLOR}),focusProps:", + replacement: { + match: /(?=function (\i)\(\i\)\{let\{onChange:\i,onClose:\i,[^}]+?showEyeDropper:)/, + replace: "$self.setColorPicker($1);" + } + }, + ], + set Skeleton(value: any) { + Skeleton = value; + }, + set Chip(value: any) { + Chip = value; + }, + set StandaloneRadioIndicator(value: any) { + StandaloneRadioIndicator = value; + }, + set ManaCombobox(value: any) { + ManaCombobox = value; + }, + set ManaBaseRadioGroup(value: any) { + ManaBaseRadioGroup = value; + }, + set ManaDatePicker(value: any) { + ManaDatePicker = value; + }, + set ManaCalendar(value: any) { + ManaCalendar = value; + }, + set ManaSwitch(value: any) { + ManaSwitch = value; + }, + set SimpleErrorBoundary(value: any) { + SimpleErrorBoundary = value; + }, + set ColorPicker(value: any) { + ColorPicker = value; + }, startAt: StartAt.WebpackReady, toolboxActions: { "Open Components Tab"() { diff --git a/src/equicordplugins/declutter/index.tsx b/src/equicordplugins/declutter/index.tsx index b5b8c79c2..c92aa7ae7 100644 --- a/src/equicordplugins/declutter/index.tsx +++ b/src/equicordplugins/declutter/index.tsx @@ -149,7 +149,7 @@ export default definePlugin({ // Nameplate find: ".MINI_PREVIEW,[", replacement: { - match: /function \i\((\i)\)\{(?=let\{nameplate:\i,hovered:\i,selected:\i,content:\i,placement:\i\}=)/, + match: /function \i\((\i)\)\{(?=let.{1,5}\{nameplate:\i,)/, replace: '$&if($1.placement!=="preview"&&$1.placement!=="mini_preview")return null;' }, predicate: () => settings.store.removeNameplate, diff --git a/src/equicordplugins/dragFavoriteEmotes/index.tsx b/src/equicordplugins/dragFavoriteEmotes/index.tsx index f727028ae..711308b2c 100644 --- a/src/equicordplugins/dragFavoriteEmotes/index.tsx +++ b/src/equicordplugins/dragFavoriteEmotes/index.tsx @@ -51,7 +51,7 @@ export default definePlugin({ find: "#{intl::EMOJI_FAVORITE_TOOLTIP}", replacement: [ { - match: /(ref:\i,children:)(\(0,\i.jsx\)\(\i.\i)/, + match: /(ref:\i,children:)(\(0,\i.jsxs?\)\(\i)/, replace: "$1arguments[0]?.collected?.isDragging?$self.dragItem():$2", }, { diff --git a/src/equicordplugins/dragify/index.tsx b/src/equicordplugins/dragify/index.tsx index bb1f3d63d..5cbd93dce 100644 --- a/src/equicordplugins/dragify/index.tsx +++ b/src/equicordplugins/dragify/index.tsx @@ -172,7 +172,7 @@ export default definePlugin({ }, // Voice channel rows (guild sidebar fallback - li wrapper) { - match: /(?<=getModeClass\(\),.{0,50})"data-dnd-name":.{0,25},children:\[/, + match: /(?<=this\.getModeClass\(\),.{0,50})"data-dnd-name":.{0,40},children:\[/g, replace: "draggable:!0,onDragStart:e=>$self.onChannelDragStart(e,{id:this?.props?.channel?.id,guild_id:this?.props?.channel?.guild_id}),$&" } ] @@ -181,7 +181,7 @@ export default definePlugin({ { find: "handleClickChat", replacement: { - match: /(?<=getModeClass\(\),.{0,50})"data-dnd-name":.{0,25},children:\[/, + 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}),$&" } }, @@ -199,7 +199,7 @@ export default definePlugin({ { find: "shouldShowThreadsPopout", replacement: { - match: /(?<=getClassName\(\).{0,50})"data-dnd-name":.{0,25},onMouseEnter:/, + match: /(?<=getClassName\(\).{0,50})"data-dnd-name":.{0,40},onMouseEnter:/, replace: "draggable:!0,onDragStart:e=>$self.onChannelDragStart(e,{id:this?.props?.channel?.id,guild_id:this?.props?.channel?.guild_id}),$&" } }, diff --git a/src/equicordplugins/equibopStreamFixes.equibop/index.tsx b/src/equicordplugins/equibopStreamFixes.equibop/index.tsx index 9c553eb46..f60c764e7 100644 --- a/src/equicordplugins/equibopStreamFixes.equibop/index.tsx +++ b/src/equicordplugins/equibopStreamFixes.equibop/index.tsx @@ -143,10 +143,10 @@ export default definePlugin({ }, // allow resolutions above 720p at 60fps { - find: ".RESOLUTION_720&&", + find: ",setIsForceShowSharingPopout:", replacement: { - match: /\i===\i\.\i\.RESOLUTION_720&&\i!==\i\.\i\.FPS_60/, - replace: "false", + match: /\i!==\i\.\i\.RESOLUTION_720\|\|\i===\i\.\i\.FPS_60/, + replace: "true", }, predicate: () => settings.store.removeResolutionCap, }, diff --git a/src/equicordplugins/holyNotes/index.tsx b/src/equicordplugins/holyNotes/index.tsx index 797f450d2..ec42c2d11 100644 --- a/src/equicordplugins/holyNotes/index.tsx +++ b/src/equicordplugins/holyNotes/index.tsx @@ -27,7 +27,7 @@ import { classNameFactory } from "@utils/css"; import { openModal } from "@utils/modal"; import definePlugin from "@utils/types"; import { Message } from "@vencord/discord-types"; -import { findByCodeLazy, findComponentByCodeLazy, findCssClassesLazy, findExportedComponentLazy } from "@webpack"; +import { findByCodeLazy, findCssClassesLazy, findExportedComponentLazy } from "@webpack"; import { ChannelStore, Menu } from "@webpack/common"; import { NoteModal } from "./components/modals/Notebook"; @@ -40,7 +40,6 @@ export const MessageRecord = findByCodeLazy("isEdited(){"); export const messageClasses = findCssClassesLazy("message", "groupStart", "cozyMessage"); export const resultsClasses = findCssClassesLazy("emptyResultsWrap", "emptyResultsContent", "errorImage", "emptyResultsText", "noResultsImage", "alt"); export const ChannelRecord = findByCodeLazy("computeLurkerPermissionsAllowList(){"); -export const ChannelMessage = findComponentByCodeLazy("Message must not be a thread"); const messageContextMenuPatch: NavContextMenuPatchCallback = (children, { message }: { message: Message; }) => { children.push( @@ -68,12 +67,29 @@ function ToolBarHeader() { ); } +let ChannelMessage; + export default definePlugin({ name: "HolyNotes", description: "Save messages as notes to revisit later", dependencies: ["MessagePopoverAPI", "HeaderBarAPI"], tags: ["Chat", "Organisation"], authors: [EquicordDevs.Wolfie], + patches: [ + { + find: "Message must not be a thread starter message", + replacement: [ + { + // Append messagelogger-deleted to classNames if deleted + match: /(?=let (\i)=\i\.memo\(function\(\i\)\{.{0,200}\.THREAD_STARTER_MESSAGE)/, + replace: "ChannelMessage=$1;" + }, + ], + } + ], + set ChannelMessage(value: any) { + ChannelMessage = value; + }, toolboxActions: { "Open Notes"() { diff --git a/src/equicordplugins/homeTyping/index.tsx b/src/equicordplugins/homeTyping/index.tsx index 0d652c337..b32cd8a9c 100644 --- a/src/equicordplugins/homeTyping/index.tsx +++ b/src/equicordplugins/homeTyping/index.tsx @@ -36,7 +36,7 @@ export default definePlugin({ replacement: [ { - match: /(\(0,\i.jsx\)\(\i.\i,{}\))/, + match: /(\(0,\i.jsxs?\)\(\i,{}\))/, replace: "arguments[0].user == null ? null : (vcIsTyping ? $self.TypingIcon() : $1)" }, // define isTyping earlier in the function so i dont bReAk ThE rUlEs Of HoOkS diff --git a/src/equicordplugins/inviteDefaults/index.ts b/src/equicordplugins/inviteDefaults/index.ts index 476651731..09845cc86 100644 --- a/src/equicordplugins/inviteDefaults/index.ts +++ b/src/equicordplugins/inviteDefaults/index.ts @@ -53,7 +53,7 @@ export default definePlugin({ find: ".GUILD_CREATE_INVITE_SUGGESTION,defaultMaxAge", replacement: [ { - match: /(?<=maxAge:)\i\?\?\i\?\?\i\.\i/, + match: /(?<=maxAge:)\i\?\?\i\?\?\i/, replace: "$self.settings.store.inviteDuration" }, { diff --git a/src/equicordplugins/questify/index.tsx b/src/equicordplugins/questify/index.tsx index c0c644506..2080dcf10 100644 --- a/src/equicordplugins/questify/index.tsx +++ b/src/equicordplugins/questify/index.tsx @@ -14,7 +14,7 @@ import ErrorBoundary from "@components/ErrorBoundary"; import { openPluginModal } from "@components/settings"; import { EquicordDevs } from "@utils/constants"; import { copyToClipboard } from "@utils/index"; -import definePlugin, { PluginNative, ReporterTestable, StartAt } from "@utils/types"; +import definePlugin, { PluginNative, StartAt } from "@utils/types"; import { findStoreLazy, onceReady } from "@webpack"; import { ContextMenuApi, Menu, NavigationRouter, RestAPI, useEffect, useState } from "@webpack/common"; import { JSX } from "react"; diff --git a/src/equicordplugins/searchFix/index.tsx b/src/equicordplugins/searchFix/index.tsx index f331c021b..301c1b14a 100644 --- a/src/equicordplugins/searchFix/index.tsx +++ b/src/equicordplugins/searchFix/index.tsx @@ -49,7 +49,7 @@ export default definePlugin({ match: /\i\.searchResultsQuery=(\i)/, replace: "$&,$self.main($1)" } - } + }, ], main(query) { if (query.offset > 5000) { diff --git a/src/equicordplugins/sidebarChat/index.tsx b/src/equicordplugins/sidebarChat/index.tsx index 7fb269d0f..27a03009f 100644 --- a/src/equicordplugins/sidebarChat/index.tsx +++ b/src/equicordplugins/sidebarChat/index.tsx @@ -338,7 +338,12 @@ export default definePlugin({ replace: "return [$1, vc_SidebarChat]}" }, { - match: /(case \i\.\i.+?return)(.+?);(?=.+?params\.messageId)(?<=guild_products".+?)/g, + match: /(?<=guild_products".+?)(case \i\.\i.+?return)(.+?\}\));(?=.+?params\.messageId)/g, + replace: "$1[$2, vc_SidebarChat];", + predicate: () => settings.store.patchCommunity + }, + { + match: /(case \i\.\i\.GAME_SERVERS:.*?\.CHANNEL.*?return)(.*?);/, replace: "$1[$2, vc_SidebarChat];", predicate: () => settings.store.patchCommunity } diff --git a/src/equicordplugins/statusPresets/index.tsx b/src/equicordplugins/statusPresets/index.tsx index 11c61f113..d21aced34 100644 --- a/src/equicordplugins/statusPresets/index.tsx +++ b/src/equicordplugins/statusPresets/index.tsx @@ -57,7 +57,7 @@ interface DiscordStatus { } // TODO: find clearCustomStatusHint original css/svg or replace -const PMenu = findComponentByCodeLazy("#{intl::MORE_OPTIONS}", ",renderSubmenu:"); +let PMenu; const EmojiComponent = findComponentByCodeLazy(/\.translateSurrogatesToInlineEmoji\(\i\.name\);/); const CustomStatusSettings = getUserSettingLazy("status", "customStatus")!; @@ -163,8 +163,18 @@ export default definePlugin({ match: /(,\{onClose:\i\}\))\]/, replace: "$1,$self.render()]" } - } + }, + { + find: "#{intl::MORE_OPTIONS}),...", + replacement: { + match: /(?<=targetElementRef:\i,spacing:.{0,150}className:\i\.\i,children:(\i)\(\)\}\)\})/, + replace: "$self.PMenu=$1;" + } + }, ], + set PMenu(value: any) { + PMenu = value; + }, render() { const status = CustomStatusSettings.getSetting(); return ( diff --git a/src/equicordplugins/wallpaperFree/index.tsx b/src/equicordplugins/wallpaperFree/index.tsx index 6cd0364c4..8e5c297db 100644 --- a/src/equicordplugins/wallpaperFree/index.tsx +++ b/src/equicordplugins/wallpaperFree/index.tsx @@ -40,7 +40,7 @@ export default definePlugin({ group: true, replacement: [ { - match: /return.{1,200},(?=keyboardModeEnabled)/, + match: /(?<=#{intl::CHANNEL_A11Y_LABEL};).{1,400},(?=keyboardModeEnabled:)/, replace: "const vcWallpaperFreeUrl=$self.WallpaperState(arguments[0].channel);$&vcWallpaperFreeUrl," }, { diff --git a/src/equicordplugins/whosWatching/index.tsx b/src/equicordplugins/whosWatching/index.tsx index e7dfe0020..fb31ca22f 100644 --- a/src/equicordplugins/whosWatching/index.tsx +++ b/src/equicordplugins/whosWatching/index.tsx @@ -94,9 +94,9 @@ export default definePlugin({ } }, { - find: "this.renderEmbeddedActivity()", + find: ",setIsForceShowSharingPopout:", replacement: { - match: /"div"(?=.{0,40}?,this.renderActions\(\))/, + match: /"div"(?=.{0,50}stream:\i,canGoLive:\i)/, replace: "$self.WrapperComponent" } } diff --git a/src/plugins/moreQuickReactions/index.ts b/src/plugins/moreQuickReactions/index.ts index 811b15c1b..4ac676a03 100644 --- a/src/plugins/moreQuickReactions/index.ts +++ b/src/plugins/moreQuickReactions/index.ts @@ -84,8 +84,12 @@ export default definePlugin({ }, // Override limit of emojis to display with offset hook. { - match: /(\i)\.length>4&&\((\i)\.length=4\);/, - replace: "let [moreQuickReactionsScrollValue,setMoreQuickReactionsScrollValue]=Vencord.Webpack.Common.React.useState(0);moreQuickReactionsScrollValue;" + match: /"MessageContextMenu"\},\{autoTrackExposure.{0,5}\}\),/, + replace: "$&[moreQuickReactionsScrollValue,setMoreQuickReactionsScrollValue]=Vencord.Webpack.Common.React.useState(0)," + }, + { + match: /\.length>4&&\(\i\.length=4\)/, + replace: "" }, // Add a custom class to identify the quick reactions have been modified and a CSS variable for the number of columns to display { diff --git a/src/plugins/serverInfo/GuildInfoModal.tsx b/src/plugins/serverInfo/GuildInfoModal.tsx index 886acd264..e9f67d1f0 100644 --- a/src/plugins/serverInfo/GuildInfoModal.tsx +++ b/src/plugins/serverInfo/GuildInfoModal.tsx @@ -20,7 +20,7 @@ import { FluxDispatcher, GuildChannelStore, GuildMemberStore, GuildRoleStore, Gu import { settings } from "."; const IconClasses = findCssClassesLazy("icon", "acronym", "childWrapper"); -const FriendRow = findComponentByCodeLazy("discriminatorClass:", ".isMobileOnline", "getAvatarURL"); +const FriendRow = findComponentByCodeLazy('"UserProfileMutualFriendRow"'); const cl = classNameFactory("vc-gp-"); diff --git a/src/plugins/showMeYourName/index.tsx b/src/plugins/showMeYourName/index.tsx index 425af5b03..338c0cd99 100644 --- a/src/plugins/showMeYourName/index.tsx +++ b/src/plugins/showMeYourName/index.tsx @@ -1139,7 +1139,7 @@ export default definePlugin({ // Attach the group ID to their messages to allow animating gradients within a group. find: "CUSTOM_GIFT?\"\":", replacement: { - match: /(isHovered:(\i).{0,1300})(let \i=\i.id===\i,\i=)/, + match: /(keyboardModeEnabled.{0,20}&&\i,\i=\i\|\|(\i).*?)(let \i=\i.id===\i,\i=)/, replace: "$1arguments[0].message.showMeYourNameGroupId=!!arguments[0].groupId?`g-${arguments[0].groupId}`:null;$self.handleHoveringMessage(arguments[0].message,$2);$3" }, }, @@ -1179,8 +1179,8 @@ export default definePlugin({ // Replace names in profile popouts. find: "shouldWrap:!0,loop:!0,inProfile:!0", replacement: { - match: /(tags:\i,)nickname:(\i)/, - replace: "$1showMeYourNameNickname:$2=$self.getTypingMemberListProfilesReactionsVoiceNameText({...arguments[0],type:\"profilesPopout\"})??(arguments[0].nickname)" + match: /displayName:(\i),(?=trailing:\i,|size:\i=|displayNameSize:\i)/g, + replace: "showMeYourNameNickname:$1=$self.getTypingMemberListProfilesReactionsVoiceNameText({...arguments[0],type:\"profilesPopout\"})??(arguments[0].nickname)," }, }, { diff --git a/src/webpack/common/components.ts b/src/webpack/common/components.ts index 9024f8705..0ec776516 100644 --- a/src/webpack/common/components.ts +++ b/src/webpack/common/components.ts @@ -74,7 +74,6 @@ export function setColorPicker(component: t.ColorPicker) { ColorPicker = component; } - export const UserSummaryItem = waitForComponent("UserSummaryItem", filters.componentByCode("defaultRenderUser", "showDefaultAvatarsForNullUsers")); export let createScroller: ((scrollbarClassName: string, fadeClassName: string, customThemeClassName: string) => t.ScrollerThin) | undefined; diff --git a/src/webpack/common/utils.ts b/src/webpack/common/utils.ts index a678c2626..b9f2ffca9 100644 --- a/src/webpack/common/utils.ts +++ b/src/webpack/common/utils.ts @@ -46,11 +46,11 @@ export const Constants: t.Constants = mapMangledModuleLazy('ME:"/users/@me"', { export const RestAPI: t.RestAPI = findLazy(m => typeof m === "object" && m.del && m.put); export const moment: typeof import("moment") = findByPropsLazy("parseTwoDigitYear"); -export const hljs: typeof import("highlight.js").default = findByPropsLazy("highlight", "registerLanguage"); +export const hljs: typeof import("highlight.js").default = findLazy(m => m.default?.highlight && m.default?.registerLanguage)?.default; export const useDrag = findByCodeLazy("useDrag::spec.begin was deprecated"); // you cant make a better finder i love that they remove display names sm -export const useDrop = findByCodeLazy(".options);return", ".collect,"); +export const useDrop = findByCodeLazy(".disconnectDropTarget()", ".dropTargetOptions="); export const { match, P }: { match: typeof TSPattern["match"], P: typeof TSPattern["P"]; } = mapMangledModuleLazy("@ts-pattern/matcher", { match: filters.byCode("return new"),