add some vc pr fixes
This commit is contained in:
parent
ce487d6ef8
commit
f4bef87da1
15 changed files with 115 additions and 72 deletions
16
packages/discord-types/src/classes.d.ts
vendored
16
packages/discord-types/src/classes.d.ts
vendored
|
|
@ -1,16 +0,0 @@
|
|||
export interface ButtonWrapperClasses {
|
||||
hoverScale: string;
|
||||
buttonWrapper: string;
|
||||
button: string;
|
||||
iconMask: string;
|
||||
buttonContent: string;
|
||||
icon: string;
|
||||
pulseIcon: string;
|
||||
pulseButton: string;
|
||||
notificationDot: string;
|
||||
sparkleContainer: string;
|
||||
sparkleStar: string;
|
||||
sparklePlus: string;
|
||||
sparkle: string;
|
||||
active: string;
|
||||
}
|
||||
|
|
@ -2,3 +2,29 @@
|
|||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
/* FIXME: bad name
|
||||
_7f7a2c5f23327d73 */
|
||||
.vc-chatbar-discord-button {
|
||||
opacity: .7;
|
||||
align-items: center;
|
||||
align-self: center;
|
||||
border-radius: 8px;
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
padding: 10px;
|
||||
|
||||
&:hover {
|
||||
background: hsl(0deg 0% 100% / 10%);
|
||||
opacity: 1
|
||||
}
|
||||
}
|
||||
|
||||
/* _3f4f204c3133fb93 */
|
||||
.vc-chatbar-button-wrapper {
|
||||
align-self: center;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
gap: 8px;
|
||||
}
|
||||
|
|
@ -7,17 +7,20 @@
|
|||
import "./ChatButton.css";
|
||||
|
||||
import ErrorBoundary from "@components/ErrorBoundary";
|
||||
import { classNameFactory } from "@utils/css";
|
||||
import { Logger } from "@utils/Logger";
|
||||
import { classes } from "@utils/misc";
|
||||
import { IconComponent } from "@utils/types";
|
||||
import { Channel } from "@vencord/discord-types";
|
||||
import { waitFor } from "@webpack";
|
||||
import { ButtonWrapperClasses, Clickable, Menu, Tooltip } from "@webpack/common";
|
||||
import { Clickable, Menu, Tooltip } from "@webpack/common";
|
||||
import { HTMLProps, JSX, MouseEventHandler, ReactNode } from "react";
|
||||
|
||||
import { addContextMenuPatch, findGroupChildrenByChildId } from "./ContextMenu";
|
||||
import { useSettings } from "./Settings";
|
||||
|
||||
const cl = classNameFactory("vc-chatbar-");
|
||||
|
||||
let ChannelTextAreaClasses: Record<"button" | "buttonContainer", string>;
|
||||
waitFor(["buttonContainer", "channelTextArea"], m => ChannelTextAreaClasses = m);
|
||||
|
||||
|
|
@ -140,18 +143,18 @@ export const ChatBarButton = ErrorBoundary.wrap((props: ChatBarButtonProps) => {
|
|||
return (
|
||||
<Tooltip text={props.tooltip}>
|
||||
{({ onMouseEnter, onMouseLeave }) => (
|
||||
<div className={`expression-picker-chat-input-button ${ChannelTextAreaClasses?.buttonContainer ?? ""} vc-chatbar-button`}>
|
||||
<div className={`expression-picker-chat-input-button ${ChannelTextAreaClasses?.buttonContainer ?? ""} ${cl("button")}`}>
|
||||
<Clickable
|
||||
aria-label={props.tooltip}
|
||||
onMouseEnter={onMouseEnter}
|
||||
onMouseLeave={onMouseLeave}
|
||||
className={classes(ButtonWrapperClasses?.button, ChannelTextAreaClasses?.button)}
|
||||
className={classes(cl("discord-button"), ChannelTextAreaClasses?.button)}
|
||||
onClick={props.onClick}
|
||||
onContextMenu={props.onContextMenu}
|
||||
onAuxClick={props.onAuxClick}
|
||||
{...props.buttonProps}
|
||||
>
|
||||
<div className={ButtonWrapperClasses?.buttonWrapper}>
|
||||
<div className={cl("button-wrapper")}>
|
||||
{props.children}
|
||||
</div>
|
||||
</Clickable>
|
||||
|
|
@ -174,7 +177,7 @@ addContextMenuPatch("textarea-context", (children, args) => {
|
|||
if (idx === -1) return;
|
||||
|
||||
group.splice(idx, 0,
|
||||
<Menu.MenuItem id="vc-chat-buttons" key="vencord-chat-buttons" label="Equicord Buttons">
|
||||
<Menu.MenuItem id="vc-chat-buttons" key="vencord-chat-buttons" label="Vencord Buttons">
|
||||
{buttons.map(([id]) => (
|
||||
<Menu.MenuCheckboxItem
|
||||
label={id}
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ import type { ComponentType, JSX, MouseEventHandler, ReactNode } from "react";
|
|||
|
||||
const logger = new Logger("HeaderBarAPI");
|
||||
|
||||
const HeaderBarIcon = findComponentByCodeLazy(".HEADER_BAR_BADGE_TOP:", '.iconBadge,"top"') as ComponentType<HeaderBarButtonProps>;
|
||||
const HeaderBarIcon = findComponentByCodeLazy(".HEADER_BAR_BADGE_TOP:", '"aria-haspopup":') as ComponentType<HeaderBarButtonProps>;
|
||||
|
||||
export interface HeaderBarButtonProps {
|
||||
/** The icon component to render inside the button */
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
import { ChatBarButton, ChatBarButtonFactory } from "@api/ChatButtons";
|
||||
import { cl } from "@equicordplugins/soundBoardLogger/utils";
|
||||
import { classes } from "@utils/misc";
|
||||
import { Button, ButtonWrapperClasses, Tooltip } from "@webpack/common";
|
||||
import { Button, Tooltip } from "@webpack/common";
|
||||
|
||||
import { openSoundBoardLog } from "./SoundBoardLog";
|
||||
|
||||
|
|
@ -45,11 +45,11 @@ export function IconWithTooltip({ text, icon, onClick }) {
|
|||
look={Button.Looks.FILLED}
|
||||
onMouseEnter={onMouseEnter}
|
||||
onMouseLeave={onMouseLeave}
|
||||
className={ButtonWrapperClasses.button}
|
||||
className={cl("discord-button")}
|
||||
onClick={onClick}
|
||||
style={{ padding: "0 4px" }}
|
||||
>
|
||||
<div className={ButtonWrapperClasses.buttonWrapper}>
|
||||
<div className={cl("button-wrapper")}>
|
||||
{icon}
|
||||
</div>
|
||||
</Button>
|
||||
|
|
|
|||
|
|
@ -122,4 +122,30 @@
|
|||
font-size: 100%;
|
||||
box-sizing: border-box;
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
/* FIXME: bad name
|
||||
_7f7a2c5f23327d73 */
|
||||
.vc-soundlog-discord-button {
|
||||
opacity: .7;
|
||||
align-items: center;
|
||||
align-self: center;
|
||||
border-radius: 8px;
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
padding: 10px;
|
||||
|
||||
&:hover {
|
||||
background: hsl(0deg 0% 100% / 10%);
|
||||
opacity: 1
|
||||
}
|
||||
}
|
||||
|
||||
/* _3f4f204c3133fb93 */
|
||||
.vc-soundlog-button-wrapper {
|
||||
align-self: center;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
gap: 8px;
|
||||
}
|
||||
|
|
@ -184,7 +184,10 @@ export default definePlugin({
|
|||
},
|
||||
// If we are rendering the Better Folders sidebar, we filter out everything but the Guild List from the Sidebar children
|
||||
{
|
||||
match: /unreadMentionsFixedFooter\].+?\}\)\]/,
|
||||
// match the bottom (NEW) footer
|
||||
// both the top and bottom one use barClassName
|
||||
// so we match the call to classNames that's only in the bottom one
|
||||
match: /\}\),barClassName:.+?\}\)\]/,
|
||||
replace: "$&.filter($self.makeGuildsBarSidebarFilter(!!arguments[0]?.isBetterFolders))"
|
||||
}
|
||||
]
|
||||
|
|
@ -218,7 +221,7 @@ export default definePlugin({
|
|||
// If we are rendering the normal GuildsBar sidebar, we make Discord think the folder is always collapsed to show better icons (the mini guild icons) and avoid transitions
|
||||
{
|
||||
predicate: () => settings.store.keepIcons,
|
||||
match: /(?<=let{folderNode:\i,setNodeRef:\i,.+?expanded:(\i),.+?;)(?=let)/,
|
||||
match: /(?<=let ?(?:\i,)*?{folderNode:\i,setNodeRef:\i,.+?expanded:(\i),.+?;)(?=let)/,
|
||||
replace: (_, isExpanded) => `${isExpanded}=!!arguments[0]?.isBetterFolders&&${isExpanded};`
|
||||
},
|
||||
// Disable expanding and collapsing folders transition in the normal GuildsBar sidebar
|
||||
|
|
@ -230,19 +233,19 @@ export default definePlugin({
|
|||
// If we are rendering the normal GuildsBar sidebar, we avoid rendering guilds from folders that are expanded
|
||||
{
|
||||
predicate: () => !settings.store.keepIcons,
|
||||
match: /folderGroupBackground.+?,(?=\i\(\(\i,\i,\i\)=>{let{key:.{0,70}"ul")(?<=selected:\i,expanded:(\i),.+?)/,
|
||||
replace: (m, isExpanded) => `${m}$self.shouldRenderContents(arguments[0],${isExpanded})?null:`
|
||||
match: /(?=\i\(\(\i,\i,\i\)=>{let{key:.{0,70}"ul")(?<=selected:\i,expanded:(\i),.+?)/,
|
||||
replace: (_, isExpanded) => `$self.shouldRenderContents(arguments[0],${isExpanded})?null:`
|
||||
},
|
||||
// Decide if we should render the expanded folder background if we are rendering the Better Folders sidebar
|
||||
{
|
||||
predicate: () => settings.store.showFolderIcon !== FolderIconDisplay.Always,
|
||||
match: /\.isExpanded\].{0,110}children:\[/,
|
||||
match: /--custom-folder-color.{0,110}?children:\[/,
|
||||
replace: "$&$self.shouldShowFolderIconAndBackground(!!arguments[0]?.isBetterFolders,arguments[0]?.betterFoldersExpandedIds)&&"
|
||||
},
|
||||
// Decide if we should render the expanded folder icon if we are rendering the Better Folders sidebar
|
||||
{
|
||||
predicate: () => settings.store.showFolderIcon !== FolderIconDisplay.Always,
|
||||
match: /(?<=\.folderGroupBackground.*?}\),)(?=\i,)/,
|
||||
match: /(?<="span",[^,]{0,50}?,)(?=\i,)/,
|
||||
replace: "!$self.shouldShowFolderIconAndBackground(!!arguments[0]?.isBetterFolders,arguments[0]?.betterFoldersExpandedIds)?null:"
|
||||
}
|
||||
]
|
||||
|
|
@ -258,12 +261,12 @@ export default definePlugin({
|
|||
// One is for visual refresh, one is not,
|
||||
// and each has a bunch of conditions &&ed in front of it.
|
||||
// Add the betterFolders sidebar to both, keeping the conditions Discord uses.
|
||||
match: /(?<=[[,])((?:!?\i&&)+)\(.{0,50}({className:\i\.guilds,themeOverride:\i})\)/g,
|
||||
match: /(?<=[[,])((?:!?\i&&)+)\(.{0,50}({className:\i\.\i,themeOverride:\i})\)/g,
|
||||
replace: (m, conditions, props) => `${m},${conditions}$self.FolderSideBar(${props})`
|
||||
},
|
||||
{
|
||||
// Add grid styles to fix aligment with other visual refresh elements
|
||||
match: /(?<=className:)\i\.base(?=,)/,
|
||||
match: /(?<=className:)\i\.\i(?=,"data-fullscreen")/,
|
||||
replace: `"${GRID_STYLE_NAME} "+$&`
|
||||
}
|
||||
]
|
||||
|
|
|
|||
|
|
@ -23,10 +23,8 @@ import ErrorBoundary from "@components/ErrorBoundary";
|
|||
import { NotesIcon, OpenExternalIcon } from "@components/Icons";
|
||||
import { TooltipContainer } from "@components/TooltipContainer";
|
||||
import { Devs } from "@utils/constants";
|
||||
import { classes } from "@utils/misc";
|
||||
import definePlugin from "@utils/types";
|
||||
import { Guild, User } from "@vencord/discord-types";
|
||||
import { findByPropsLazy } from "@webpack";
|
||||
import { Alerts, Clickable, Menu, Parser } from "@webpack/common";
|
||||
|
||||
import { Auth, initAuth, updateAuth } from "./auth";
|
||||
|
|
@ -34,9 +32,7 @@ import { openReviewsModal } from "./components/ReviewModal";
|
|||
import { NotificationType, ReviewType } from "./entities";
|
||||
import { getCurrentUserInfo, readNotification } from "./reviewDbApi";
|
||||
import { settings } from "./settings";
|
||||
import { showToast } from "./utils";
|
||||
|
||||
const BannerButtonClasses = findByPropsLazy("bannerButton");
|
||||
import { cl, showToast } from "./utils";
|
||||
|
||||
const guildPopoutPatch: NavContextMenuPatchCallback = (children, { guild }: { guild: Guild, onClose(): void; }) => {
|
||||
if (!guild) return;
|
||||
|
|
@ -154,7 +150,7 @@ export default definePlugin({
|
|||
<TooltipContainer text="View Reviews">
|
||||
<Clickable
|
||||
onClick={() => openReviewsModal(user.id, user.username, ReviewType.User)}
|
||||
className={classes(BannerButtonClasses.bannerButton)}
|
||||
className={cl("banner-button")}
|
||||
>
|
||||
<NotesIcon height={16} width={16} />
|
||||
</Clickable>
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@
|
|||
margin-top: 16px;
|
||||
}
|
||||
|
||||
.vc-rdb-review-container {
|
||||
.vc-rdb-review {
|
||||
padding-top: 8px !important;
|
||||
padding-bottom: 8px !important;
|
||||
padding-right: 32px !important;
|
||||
|
|
@ -131,3 +131,24 @@
|
|||
.vc-rdb-block-modal-unblock {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.vc-rdb-banner-button {
|
||||
align-items: center;
|
||||
background: var(--redesign-button-overlay-alpha-background);
|
||||
border: 1px solid var(--opacity-white-8);
|
||||
border-radius: 50%;
|
||||
box-sizing: border-box;
|
||||
color: var(--white);
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
height: var(--custom-button-button-sm-height);
|
||||
justify-content: center;
|
||||
transition: background 50ms ease-in;
|
||||
width: var(--custom-button-button-sm-height);
|
||||
|
||||
&:active,
|
||||
&:hover {
|
||||
background: var(--redesign-button-overlay-alpha-pressed-background);
|
||||
transition: background .15s ease-out
|
||||
}
|
||||
}
|
||||
|
|
@ -25,13 +25,10 @@ import { classNameFactory } from "@utils/css";
|
|||
import { classes } from "@utils/misc";
|
||||
import definePlugin, { OptionType } from "@utils/types";
|
||||
import type { Channel, Role } from "@vencord/discord-types";
|
||||
import { findByPropsLazy } from "@webpack";
|
||||
import { ChannelStore, PermissionsBits, PermissionStore, Tooltip } from "@webpack/common";
|
||||
|
||||
import HiddenChannelLockScreen from "./components/HiddenChannelLockScreen";
|
||||
|
||||
const ChannelListClasses = findByPropsLazy("modeMuted", "modeSelected", "unread", "icon");
|
||||
|
||||
export const cl = classNameFactory("vc-shc-");
|
||||
|
||||
const enum ShowMode {
|
||||
|
|
@ -566,7 +563,7 @@ export default definePlugin({
|
|||
|
||||
LockIcon: ErrorBoundary.wrap(() => (
|
||||
<svg
|
||||
className={ChannelListClasses.icon}
|
||||
className={cl("channel-list-icon")}
|
||||
height="18"
|
||||
width="20"
|
||||
viewBox="0 0 24 24"
|
||||
|
|
@ -583,7 +580,7 @@ export default definePlugin({
|
|||
<svg
|
||||
onMouseLeave={onMouseLeave}
|
||||
onMouseEnter={onMouseEnter}
|
||||
className={classes(ChannelListClasses.icon, cl("hidden-channel-icon"))}
|
||||
className={classes(cl("channel-list-icon"), cl("hidden-channel-icon"))}
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
|
|
@ -602,7 +599,7 @@ export default definePlugin({
|
|||
<svg
|
||||
onMouseLeave={onMouseLeave}
|
||||
onMouseEnter={onMouseEnter}
|
||||
className={ChannelListClasses.icon + " " + "shc-hidden-channel-icon"}
|
||||
className={cl("channel-list-icon") + " " + "shc-hidden-channel-icon"}
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
|
|
|
|||
|
|
@ -105,3 +105,13 @@
|
|||
margin-left: 6px;
|
||||
z-index: 0;
|
||||
}
|
||||
|
||||
/* rough copy of _3675bedf89a045e5
|
||||
FIXME: this does not account for the variety of different colors discord applies based on other classes */
|
||||
.vc-shc-channel-list-icon {
|
||||
color: var(--channel-icon);
|
||||
display: block;
|
||||
flex: 0 0 auto;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
}
|
||||
|
|
@ -27,7 +27,7 @@ import definePlugin, { OptionType } from "@utils/types";
|
|||
import { findComponentByCodeLazy } from "@webpack";
|
||||
import { GuildMemberStore, RelationshipStore, SelectedChannelStore, Tooltip, TypingStore, UserGuildSettingsStore, UserStore, UserSummaryItem, useStateFromStores } from "@webpack/common";
|
||||
|
||||
const ThreeDots = findComponentByCodeLazy(".dots,", "dotRadius:");
|
||||
const ThreeDots = findComponentByCodeLazy("Math.min(1,Math.max(", "dotRadius:");
|
||||
|
||||
const enum IndicatorMode {
|
||||
Dots = 1 << 0,
|
||||
|
|
|
|||
|
|
@ -209,8 +209,8 @@ export default definePlugin({
|
|||
{
|
||||
find: 'backgroundColor:"COMPLETE"',
|
||||
replacement: {
|
||||
match: /(\.banner,.+?),style:{(?=.+?backgroundImage:null!=(\i)\?"url\("\.concat\(\2,)/,
|
||||
replace: (_, rest, bannerSrc) => `${rest},onClick:()=>${bannerSrc}!=null&&$self.openBanner(${bannerSrc}),style:{cursor:${bannerSrc}!=null?"pointer":void 0,`
|
||||
match: /(?<=!1\),)style:{(?=.+?backgroundImage:null!=(\i)\?"url\("\.concat\(\1,)/,
|
||||
replace: (_, bannerSrc) => `onClick:()=>${bannerSrc}!=null&&$self.openBanner(${bannerSrc}),style:{cursor:${bannerSrc}!=null?"pointer":void 0,`
|
||||
}
|
||||
},
|
||||
// Group DMs top small & large icon
|
||||
|
|
|
|||
|
|
@ -1,22 +0,0 @@
|
|||
/*
|
||||
* Vencord, a modification for Discord's desktop app
|
||||
* Copyright (c) 2023 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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import * as t from "@vencord/discord-types";
|
||||
import { findByPropsLazy } from "@webpack";
|
||||
|
||||
export const ButtonWrapperClasses: t.ButtonWrapperClasses = findByPropsLazy("buttonWrapper", "buttonContent");
|
||||
|
|
@ -16,7 +16,6 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
export * from "./classes";
|
||||
export * from "./components";
|
||||
export * from "./menu";
|
||||
export * from "./react";
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue