move props

This commit is contained in:
thororen1234 2026-01-23 16:15:36 -05:00
parent 75ec412817
commit 7a12753742
No known key found for this signature in database
18 changed files with 54 additions and 47 deletions

View file

@ -12,10 +12,10 @@ import { openUserProfile } from "@utils/discord";
import { classes } from "@utils/misc";
import definePlugin, { StartAt } from "@utils/types";
import { Guild } from "@vencord/discord-types";
import { findByPropsLazy } from "@webpack";
import { findByPropsLazy, findCssClassesLazy } from "@webpack";
import { Parser, Tooltip, UserStore } from "@webpack/common";
const AvatarStyles = findByPropsLazy("avatar", "zalgo");
const AvatarStyles = findCssClassesLazy("avatar", "zalgo");
const GuildManager = findByPropsLazy("joinGuild");
interface User {

View file

@ -10,7 +10,7 @@ import { Heading } from "@components/Heading";
import { Paragraph } from "@components/Paragraph";
import { TooltipContainer } from "@components/TooltipContainer";
import { proxyLazy } from "@utils/lazy";
import { filters, findByCodeLazy, findByPropsLazy, findComponentByCodeLazy, findLazy, mapMangledModuleLazy, waitFor, wreq } from "@webpack";
import { filters, findByCodeLazy, findByPropsLazy, findComponentByCodeLazy, findCssClassesLazy, findLazy, mapMangledModuleLazy, waitFor, wreq } from "@webpack";
import {
GuildStore,
ListScrollerAuto,
@ -280,7 +280,7 @@ export function Divider({ className, style, ...restProps }: React.ComponentProps
return <hr className={`vc-divider${className ? ` ${className}` : ""}`} style={style} {...restProps} />;
}
const CodeContainerClasses = findByPropsLazy("markup", "codeContainer");
const CodeContainerClasses = findCssClassesLazy("markup", "codeContainer");
export function InlineCode({ children }: { children: React.ReactNode; }) {
return (

View file

@ -4,13 +4,13 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import { findByPropsLazy } from "@webpack";
import { findCssClassesLazy } from "@webpack";
import { Parser } from "@webpack/common";
import { Paragraph } from "..";
import { SectionWrapper } from "../SectionWrapper";
const MarkupClasses = findByPropsLazy("markup", "codeContainer");
const MarkupClasses = findCssClassesLazy("markup", "codeContainer");
interface CodeBlockProps {
content: string;

View file

@ -9,13 +9,13 @@ import "./styles.css";
import ErrorBoundary from "@components/ErrorBoundary";
import { ModalCloseButton } from "@utils/modal";
import { Message } from "@vencord/discord-types";
import { findByPropsLazy } from "@webpack";
import { findCssClassesLazy } from "@webpack";
import { Paginator, React, useRef, useState } from "@webpack/common";
import { MutableRefObject } from "react";
import { jumper } from "./index";
const containerStyles = findByPropsLazy("containerBottom", "containerTop");
const containerStyles = findCssClassesLazy("containerBottom", "containerTop");
export default function ReplyNavigator({ replies }: { replies: Message[]; }) {
const [page, setPage] = useState(1);

View file

@ -21,13 +21,13 @@ import {
openModal,
} from "@utils/modal";
import { Guild } from "@vencord/discord-types";
import { findByPropsLazy } from "@webpack";
import { findCssClassesLazy } from "@webpack";
import { Button, IconUtils, useStateFromStores } from "@webpack/common";
import { SortedGuildStore } from "..";
const cl = classNameFactory("vc-hideservers-");
const IconClasses = findByPropsLazy("icon", "acronym", "childWrapper");
const IconClasses = findCssClassesLazy("icon", "acronym", "childWrapper");
function HiddenServersModal({ modalProps, close }: { modalProps: ModalProps; close(): void; }) {
const guilds = useStateFromStores([HiddenServersStore], () => HiddenServersStore.hiddenGuildsDetail());

View file

@ -6,10 +6,10 @@
import { SvgOverFlowIcon } from "@equicordplugins/holyNotes/components/icons/overFlowIcon";
import { classes } from "@utils/misc";
import { findByPropsLazy } from "@webpack";
import { findCssClassesLazy } from "@webpack";
import { Button, Clickable, Menu, Popout, React, useRef } from "@webpack/common";
const { overflowIcon } = findByPropsLazy("overflowIcon", "forceButtonsShow");
const { overflowIcon } = findCssClassesLazy("overflowIcon", "forceButtonsShow");
export function NoteBookTabs({ tabs, selectedTabId, onSelectTab }: { tabs: string[], selectedTabId: string, onSelectTab: (tab: string) => void; }) {
const tabBarRef = React.useRef<HTMLDivElement>(null);

View file

@ -12,10 +12,10 @@ import { HolyNotes } from "@equicordplugins/holyNotes/types";
import { copyToClipboard } from "@utils/clipboard";
import { classes } from "@utils/misc";
import { ModalProps } from "@utils/modal";
import { findByCodeLazy, findByPropsLazy, findComponentByCodeLazy } from "@webpack";
import { findByCodeLazy, findComponentByCodeLazy, findCssClassesLazy } from "@webpack";
import { ContextMenuApi, FluxDispatcher, Menu, NavigationRouter, React } from "@webpack/common";
const messageClasses = findByPropsLazy("message", "groupStart", "cozyMessage");
const messageClasses = findCssClassesLazy("message", "groupStart", "cozyMessage");
const Channel = findByCodeLazy("computeLurkerPermissionsAllowList(){");
const ChannelMessage = findComponentByCodeLazy("Message must not be a thread");

View file

@ -19,7 +19,7 @@ import { classes } from "@utils/misc";
import { useForceUpdater } from "@utils/react";
import definePlugin, { OptionType } from "@utils/types";
import { Message } from "@vencord/discord-types";
import { findByCodeLazy, findByPropsLazy } from "@webpack";
import { findByCodeLazy, findCssClassesLazy } from "@webpack";
import { Button, ChannelStore, FluxDispatcher, Select, SelectedChannelStore, TabBar, TextInput, Tooltip, UserStore, useState } from "@webpack/common";
import type { JSX, PropsWithChildren } from "react";
@ -30,9 +30,9 @@ let keywordEntries: Array<KeywordEntry> = [];
let keywordLog: Array<any> = [];
let interceptor: (e: any) => void;
const recentMentionsPopoutClass = findByPropsLazy("recentMentionsPopout");
const tabClass = findByPropsLazy("inboxTitle", "tab");
const buttonClass = findByPropsLazy("size36");
const recentMentionsPopoutClass = findCssClassesLazy("recentMentionsPopout");
const tabClass = findCssClassesLazy("inboxTitle", "tab", "expand", "expanded", "controlButton");
const buttonClass = findCssClassesLazy("size36", "size32", "tertiary", "button");
const Popout = findByCodeLazy("getProTip", "canCloseAllMessages:");
const createMessageRecord = findByCodeLazy(".createFromServer(", ".isBlockedForMessage", "messageReference:");
const KEYWORD_ENTRIES_KEY = "KeywordNotify_keywordEntries";

View file

@ -9,10 +9,10 @@ import { SpotifyLrcStore } from "@equicordplugins/musicControls/spotify/lyrics/p
import { SyncedLyric } from "@equicordplugins/musicControls/spotify/lyrics/providers/types";
import { SpotifyStore } from "@equicordplugins/musicControls/spotify/SpotifyStore";
import { classNameFactory } from "@utils/css";
import { findByPropsLazy } from "@webpack";
import { findCssClassesLazy } from "@webpack";
import { React, useEffect, useState, useStateFromStores } from "@webpack/common";
export const scrollClasses = findByPropsLazy("auto", "customTheme");
export const scrollClasses = findCssClassesLazy("auto", "customTheme");
export const cl = classNameFactory("vc-spotify-lyrics-");

View file

@ -9,10 +9,10 @@ import { TidalLrcStore } from "@equicordplugins/musicControls/tidal/lyrics/provi
import { EnhancedLyric } from "@equicordplugins/musicControls/tidal/lyrics/types";
import { TidalStore } from "@equicordplugins/musicControls/tidal/TidalStore";
import { classNameFactory } from "@utils/css";
import { findByPropsLazy } from "@webpack";
import { findCssClassesLazy } from "@webpack";
import { React, useEffect, useState, useStateFromStores } from "@webpack/common";
export const scrollClasses = findByPropsLazy("auto", "customTheme");
export const scrollClasses = findCssClassesLazy("auto", "customTheme");
export const cl = classNameFactory("eq-tidal-lyrics-");

View file

@ -8,10 +8,10 @@ import { addContextMenuPatch, removeContextMenuPatch } from "@api/ContextMenu";
import { ScreenshareIcon } from "@components/Icons";
import { Devs } from "@utils/constants";
import definePlugin from "@utils/types";
import { findByPropsLazy } from "@webpack";
import { findCssClassesLazy } from "@webpack";
import { Menu, UploadHandler } from "@webpack/common";
const OptionClasses = findByPropsLazy("optionName", "optionIcon", "optionLabel");
const OptionClasses = findCssClassesLazy("optionName", "optionIcon", "optionLabel");
let recoder: MediaRecorder;

View file

@ -4,14 +4,16 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import "./styles.css";
import { Devs, EquicordDevs } from "@utils/constants";
import { isEquicordPluginDev, isPluginDev } from "@utils/misc";
import definePlugin from "@utils/types";
import { findByPropsLazy, findComponentByCodeLazy } from "@webpack";
import { findComponentByCodeLazy, findCssClassesLazy } from "@webpack";
import badges from "plugins/_api/badges";
const roleIconClassName = findByPropsLazy("roleIcon", "separator").roleIcon;
const { roleIcon } = findCssClassesLazy("roleIcon", "separator");
const RoleIconComponent = findComponentByCodeLazy("#{intl::ROLE_ICON_ALT_TEXT}");
import "./styles.css";
import { User } from "@vencord/discord-types";
import { JSX } from "react";
@ -41,7 +43,7 @@ function CheckBadge({ badge, author }: { badge: string; author: User; }): JSX.El
{badges.getEquicordDonorBadges(author.id)?.map(badge => (
<RoleIconComponent
key={author.id}
className={roleIconClassName}
className={roleIcon}
name={badge.description}
size={20}
src={badge.iconSrc}
@ -53,7 +55,7 @@ function CheckBadge({ badge, author }: { badge: string; author: User; }): JSX.El
return isEquicordPluginDev(author.id) ? (
<span style={{ order: settings.store.EquicordContributorPosition }}>
<RoleIconComponent
className={roleIconClassName}
className={roleIcon}
name="Equicord Contributor"
size={20}
src={"https://equicord.org/assets/favicon.png"}
@ -66,7 +68,7 @@ function CheckBadge({ badge, author }: { badge: string; author: User; }): JSX.El
{badges.getDonorBadges(author.id)?.map(badge => (
<RoleIconComponent
key={author.id}
className={roleIconClassName}
className={roleIcon}
name={badge.description}
size={20}
src={badge.iconSrc}
@ -78,7 +80,7 @@ function CheckBadge({ badge, author }: { badge: string; author: User; }): JSX.El
return isPluginDev(author.id) ? (
<span style={{ order: settings.store.VencordContributorPosition }}>
<RoleIconComponent
className={roleIconClassName}
className={roleIcon}
name="Vencord Contributor"
size={20}
src={"https://cdn.discordapp.com/emojis/1092089799109775453.png"}
@ -92,7 +94,7 @@ function CheckBadge({ badge, author }: { badge: string; author: User; }): JSX.El
<RoleIconComponent
key={author.id}
className={roleIconClassName}
className={roleIcon}
name={badge[1]}
size={20}
src={`https://cdn.discordapp.com/badge-icons/${badge[2]}.png`}
@ -107,7 +109,7 @@ function CheckBadge({ badge, author }: { badge: string; author: User; }): JSX.El
return (author?.premiumType ?? 0) > 0 ? (
<span style={{ order: settings.store.DiscordNitroPosition }}>
<RoleIconComponent
className={roleIconClassName}
className={roleIcon}
name={
"Discord Nitro" +
(author.premiumType === 3 ? " Basic" : author.premiumType === 1 ? " Classic" : "")

View file

@ -9,7 +9,7 @@ import { classNameFactory } from "@utils/css";
import { LazyComponent } from "@utils/react";
import { saveFile } from "@utils/web";
import type { User } from "@vencord/discord-types";
import { findByCode, findByPropsLazy } from "@webpack";
import { findByCode, findByPropsLazy, findCssClassesLazy } from "@webpack";
import settings from "./settings";
@ -70,4 +70,4 @@ export function removeListener(fn): void {
// Taken from https://github.com/Vendicated/Vencord/blob/86e94343cca10b950f2dc8d18d496d6db9f3b728/src/components/PluginSettings/PluginModal.tsx#L45
export const UserSummaryItem = LazyComponent(() => findByCode("defaultRenderUser", "showDefaultAvatarsForNullUsers"));
export const AvatarStyles = findByPropsLazy("moreUsers", "emptyUser", "avatarContainer", "clickableAvatar");
export const AvatarStyles = findCssClassesLazy("moreUsers", "emptyUser", "avatarContainer", "clickableAvatar");

View file

@ -9,10 +9,15 @@ import { DataStore } from "@api/index";
import { definePluginSettings } from "@api/Settings";
import ErrorBoundary from "@components/ErrorBoundary";
import { Devs } from "@utils/constants";
import { classes } from "@utils/misc";
import definePlugin, { OptionType } from "@utils/types";
import { findCssClassesLazy } from "@webpack";
import { Button, Menu } from "@webpack/common";
import React, { ReactNode } from "react";
const CodeContainerClasses = findCssClassesLazy("markup", "codeContainer");
const MessageContentClasses = findCssClassesLazy("messageContent", "messageContentTrailingIcon");
const settings = definePluginSettings({
showGif: {
type: OptionType.BOOLEAN,
@ -51,7 +56,7 @@ function blockedComponentRender(sticker) {
if (showMessage) {
elements.push(
<div key="message" id="message-content-1205482612316184657" className={"markup_a7e664 messageContent__21e69"}><span>Blocked Sticker. ID: {sticker.id}, NAME: {sticker.name}</span></div>
<div key="message" id="vc-blocked-sticker" className={classes(CodeContainerClasses.markup, MessageContentClasses.messageContent)}><span>Blocked Sticker. ID: {sticker.id}, NAME: {sticker.name}</span></div>
);
}

View file

@ -14,7 +14,7 @@ import { Devs, EquicordDevs } from "@utils/constants";
import { openModal } from "@utils/modal";
import definePlugin, { OptionType } from "@utils/types";
import { Message, User } from "@vencord/discord-types";
import { findByPropsLazy } from "@webpack";
import { findByPropsLazy, findCssClassesLazy } from "@webpack";
import { Button, Menu, showToast, Toasts, Tooltip, useEffect, UserStore, useState } from "@webpack/common";
import { deleteTimezone, getTimezone, loadDatabaseTimezones, setUserDatabaseTimezone } from "./database";
@ -39,7 +39,7 @@ export function getSystemTimezone(): string {
return Intl.DateTimeFormat().resolvedOptions().timeZone;
}
const classes = findByPropsLazy("timestamp", "compact", "contentOnly");
const classes = findCssClassesLazy("timestamp", "compact", "contentOnly");
const locale = findByPropsLazy("getLocale");
export const settings = definePluginSettings({

View file

@ -16,7 +16,7 @@ import { Margins } from "@utils/margins";
import { classes } from "@utils/misc";
import definePlugin, { OptionType } from "@utils/types";
import { User } from "@vencord/discord-types";
import { findByPropsLazy, findComponentByCodeLazy, findStoreLazy } from "@webpack";
import { findComponentByCodeLazy, findCssClassesLazy, findStoreLazy } from "@webpack";
import { Clickable, RelationshipStore, Tooltip, UserStore, useStateFromStores } from "@webpack/common";
import { JSX } from "react";
@ -68,7 +68,7 @@ function Watching({ userIds, guildId }: WatchingProps): JSX.Element {
const ApplicationStreamingStore = findStoreLazy("ApplicationStreamingStore");
const UserSummaryItem = findComponentByCodeLazy("defaultRenderUser", "showDefaultAvatarsForNullUsers");
const AvatarStyles = findByPropsLazy("moreUsers", "emptyUser", "avatarContainer", "clickableAvatar");
const AvatarStyles = findCssClassesLazy("moreUsers", "emptyUser", "avatarContainer", "clickableAvatar");
export default definePlugin({
name: "WhosWatching",

View file

@ -53,7 +53,7 @@ export default definePlugin({
replacement: [
{
match: /(\.renderReactions\(\i\).+?className:)/,
replace: '$&(this.props.channel.nsfw?"vc-nsfw-img ":"")+'
replace: "$&(this.props.channel.nsfw || $self.settings.store.blurAllChannels ? ' vc-nsfw-img': '')+"
}
]
}

View file

@ -33,7 +33,7 @@ import ReviewBadge from "./ReviewBadge";
export default LazyComponent(() => {
// this is terrible, blame mantika
const p = filters.byProps;
const c = filters.byClassNames;
const [
{ cozyMessage, buttons, message, buttonsInner, groupStart },
{ container, isHeader },
@ -41,11 +41,11 @@ export default LazyComponent(() => {
buttonClasses,
botTag
] = findBulk(
p("cozyMessage"),
p("container", "isHeader"),
p("avatar", "zalgo"),
p("button", "wrapper", "selected"),
p("botTagRegular")
c("cozyMessage"),
c("container", "isHeader"),
c("avatar", "zalgo"),
c("button", "wrapper", "selected"),
c("botTagRegular")
);
const dateFormat = new Intl.DateTimeFormat();