This commit is contained in:
Mirco Wittrien 2022-11-22 00:32:47 +01:00
parent 05671871db
commit 0be9c31b6c
9 changed files with 82 additions and 190 deletions

View File

@ -6421,20 +6421,20 @@ module.exports = (_ => {
render() {
let color = BDFDB.ColorUtils.convert(this.props.role.colorString, "RGB") || Internal.DiscordConstants.Colors.PRIMARY_DARK_300;
return BDFDB.ReactUtils.createElement("li", {
className: BDFDB.DOMUtils.formatClassName(BDFDB.disCN.userpopoutrole, this.props.className),
className: BDFDB.DOMUtils.formatClassName(BDFDB.disCN.userrole, this.props.className),
style: {borderColor: BDFDB.ColorUtils.setAlpha(color, 0.6)},
onClick: this.handleClick.bind(this),
onContextMenu: this.handleContextMenu.bind(this),
children: [
!this.props.noCircle ? BDFDB.ReactUtils.createElement("div", {
className: BDFDB.disCN.userpopoutroleremovebutton,
className: BDFDB.disCN.userroleremovebutton,
children: BDFDB.ReactUtils.createElement("span", {
className: BDFDB.disCN.userpopoutrolecircle,
className: BDFDB.disCN.userrolecircle,
style: {backgroundColor: color}
})
}) : null,
BDFDB.ReactUtils.createElement("div", {
className: BDFDB.disCN.userpopoutrolename,
className: BDFDB.disCN.userrolename,
children: this.props.role.name
})
].filter(n => n)
@ -8072,8 +8072,7 @@ module.exports = (_ => {
after: [
"DiscordTag",
"UseCopyIdItem",
"UserPopoutAvatar",
"UserThemedPopoutAvatar"
"UserPopoutAvatar"
],
componentDidMount: [
"Account",
@ -8164,7 +8163,7 @@ module.exports = (_ => {
const user = BDFDB.ReactUtils.findValue(e.instance, "user");
if (!user) return;
const avatar = e.instance.props.section != Internal.DiscordConstants.AnalyticsSections.PROFILE_POPOUT && e.node.querySelector(BDFDB.dotCN.avatarwrapper);
const wrapper = e.node.querySelector(BDFDB.dotCNC.userpopout + BDFDB.dotCN.userprofile) || e.node;
const wrapper = e.node.querySelector(BDFDB.dotCNC.userpopoutouter + BDFDB.dotCN.userprofilemodal) || e.node;
if (avatar) Internal._processAvatarMount(user, avatar, wrapper);
};
Internal.processBlobMask = function (e) {
@ -8301,11 +8300,6 @@ module.exports = (_ => {
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {props: [["className", BDFDB.disCN.userpopoutavatarwrapper]]});
if (index > -1) children[index] = Internal._processAvatarRender(e.instance.props.user, children[index], e.instance) || children[index];
};
Internal.processUserThemedPopoutAvatar = function (e) {
if (!e.instance.props.user) return;
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {props: [["className", BDFDB.disCN.userpopoutthemedavatarwrapper]]});
if (index > -1) children[index] = Internal._processAvatarRender(e.instance.props.user, children[index], e.instance) || children[index];
};
MyReact.instanceKey = Object.keys(document.querySelector(BDFDB.dotCN.app) || {}).some(n => n.startsWith("__reactInternalInstance")) ? "_reactInternalFiber" : "_reactInternals";

View File

@ -3296,84 +3296,16 @@
"userbannerprofile": ["UserBanner", "profileBanner"],
"userbannerprofilepremium": ["UserBanner", "profileBannerPremium"],
"userinfodate": ["BDFDB", "userInfoDate"],
"userpopout": ["UserPopout", "userPopout"],
"userpopoutaboutme": ["UserPopoutHeader", "aboutMeSection"],
"userpopoutaboutmebody": ["UserPopoutHeader", "aboutMeBody"],
"userpopoutaboutmetitle": ["UserPopoutHeader", "aboutMeTitle"],
"userpopoutactivity": ["UserPopoutBody", "activity"],
"userpopoutavatar": ["UserPopoutHeader", "avatar"],
"userpopoutavatarbase": ["UserPopoutAvatarOld", "baseAvatar"],
"userpopoutavatarclickable": ["UserPopoutHeader", "clickable"],
"userpopoutavatarhint": ["UserPopoutHeader", "avatarHint"],
"userpopoutavatarhintinner": ["UserPopoutHeader", "avatarHintInner"],
"userpopoutavatarlarge": ["UserPopoutAvatarOld", "largeAvatar"],
"userpopoutavatarmini": ["UserPopoutAvatarOld", "miniAvatar"],
"userpopoutavatarpositionnormal": ["UserPopoutHeader", "avatarPositionNormal"],
"userpopoutavatarpositionpremium": ["UserPopoutHeader", "avatarPositionPremium"],
"userpopoutavatarwrappernonuserbot": ["UserPopoutHeader", "avatarWrapperNonUserBot"],
"userpopoutavatarwrapper": ["UserPopoutHeader", "avatarWrapper"],
"userpopoutavatarwrappernormal": ["UserPopoutHeader", "avatarWrapperNormal"],
"userpopoutbody": ["UserPopout", "body"],
"userpopoutbodyinnerwrapper": ["UserPopoutBody", "bodyInnerWrapper"],
"userpopoutbodytitle": ["UserPopoutBody", "bodyTitle"],
"userpopoutcustomstatus": ["UserPopoutHeader", "customStatus"],
"userpopoutcustomstatusemoji": ["UserPopoutHeader", "customStatusEmoji"],
"userpopoutcustomstatussoloemoji": ["UserPopoutHeader", "customStatusSoloEmoji"],
"userpopoutcustomstatustext": ["UserPopoutHeader", "customStatusText"],
"userpopoutdivider": ["UserPopout", "divider"],
"userpopoutfooter": ["UserPopoutFooter", "footer"],
"userpopoutheaderbottag": ["UserPopoutHeader", "headerBotTag"],
"userpopoutheaderbottagwithnickname": ["UserPopoutHeader", "headerBotTagWithNickname"],
"userpopoutheaderdiscriminatorbase": ["UserPopoutHeader", "discrimBase"],
"userpopoutheaderdiscriminatornonickname": ["UserPopoutHeader", "headerTagDiscriminatorNoNickname"],
"userpopoutheadernickname": ["UserPopoutHeader", "nickname"],
"userpopoutheadernormal": ["UserPopout", "headerNormal"],
"userpopoutheadertag": ["UserPopoutHeader", "headerTag"],
"userpopoutheadertagnonickname": ["UserPopoutHeader", "headerTagNoNickname"],
"userpopoutheadertagusernamebase": ["UserPopoutHeader", "headerTagUsernameBase"],
"userpopoutheadertagusernamenonickname": ["UserPopoutHeader", "headerTagUsernameNoNickname"],
"userpopoutheadertagwithnickname": ["UserPopoutHeader", "headerTagWithNickname"],
"userpopoutheadertext": ["UserPopoutHeader", "headerText"],
"userpopoutheadertop": ["UserPopoutHeader", "headerTop"],
"userpopoutheadertopwithcustomstatus": ["UserPopoutHeader", "headerTopWithCustomStatus"],
"userpopoutrole": ["Role", "role"],
"userpopoutrolecircle": ["RoleCircle", "roleCircle"],
"userpopoutrolelist": ["UserPopoutBody", "rolesList"],
"userpopoutrolename": ["Role", "roleName"],
"userpopoutroleremovebutton": ["Role", "roleRemoveButton"],
"userpopoutroles": ["Role", "root"],
"userpopoutsetidentitylink": ["UserPopout", "setIdentityLink"],
"userpopoutsection": ["UserPopoutSection", "section"],
"userpopoutsectionbody": ["UserPopoutSectionTitle", "body"],
"userpopoutsectionlast": ["UserPopoutSection", "lastSection"],
"userpopoutsectiontitle": ["UserPopoutSectionTitle", "title"],
"userpopoutthemedavatar": ["UserPopoutAvatar", "avatar"],
"userpopoutthemedavatarwrapper": ["UserPopoutAvatar", "avatarWrapper"],
"userpopoutusernamebottag": ["UserPopoutUsernameSection", "headerBotTag"],
"userpopoutusernamebottagwithnickname": ["UserPopoutUsernameSection", "headerBotTagWithNickname"],
"userpopoutusernamenickname": ["UserPopoutUsernameSection", "nickname"],
"userpopoutusernametagnousername": ["UserPopoutUsernameSection", "userTagUsernameNoNickname"],
"userpopoutusernametagusername": ["UserPopoutUsernameSection", "userTagUsernameBase"],
"userpopoutusernametagnonickname": ["UserPopoutUsernameSection", "userTagNoNickname"],
"userpopoutusernametagwithnickname": ["UserPopoutUsernameSection", "userTagWithNickname"],
"userpopoutusernametext": ["UserPopoutUsernameSection", "userText"],
"userprofile": ["UserProfile", "root"],
"userprofilebody": ["UserProfile", "body"],
"userprofilebottag": ["UserProfileHeader", "botTag"],
"userprofilecustomstatus": ["UserProfileHeader", "customStatus"],
"userprofilecustomstatusemoji": ["UserProfileHeader", "customStatusEmoji"],
"userprofilecustomstatustext": ["UserProfileHeader", "customStatusText"],
"userprofileheader": ["UserProfileHeader", "header"],
"userprofileinfosection": ["UserProfileInfoSection", "userInfoSection"],
"userprofileinfosectionheader": ["UserProfileInfoSection", "userInfoSectionHeader"],
"userprofileinfotext": ["UserProfileInfoSection", "userInfoText"],
"userprofilenametag": ["UserProfileHeader", "nameTag"],
"userprofiletopsection": ["UserProfile", "topSection"],
"userprofileusername": ["UserProfileHeader", "username"],
"username": ["NameTag", "username"],
"usernotepopout": ["UserPopoutBody", "note"],
"usernoteprofile": ["UserProfileInfoSection", "note"],
"usernotetextarea": ["NoteTextarea", "textarea"],
"userrole": ["Role", "role"],
"userrolecircle": ["RoleCircle", "roleCircle"],
"userrolelist": ["UserPopoutBody", "rolesList"],
"userrolename": ["Role", "roleName"],
"userroleremovebutton": ["Role", "roleRemoveButton"],
"userroles": ["Role", "root"],
"usersettingsappearancepreview": ["UserSettingsAppearancePreview", "preview"],
"usersettingsappearancepreviewcompact": ["UserSettingsAppearancePreview", "compactPreview"],
"usersettingsappearancepreviewfirst": ["UserSettingsAppearancePreview", "firstMessage"],

View File

@ -468,24 +468,6 @@ img:not([src]), img[src=""], img[src="null"] {
[REPLACE_CLASS_userpopoutheaderbottag] {
margin-top: 4px !important;
}
[REPLACE_CLASS_userinfodate] {
color: var(--header-secondary);
margin-top: 8px;
user-select: text;
}
[REPLACE_CLASS_userprofilenametag] + [REPLACE_CLASS_userinfodate],
[REPLACE_CLASS_userinfodate] + [REPLACE_CLASS_userinfodate] {
margin-top: 0;
}
[REPLACE_CLASS_userinfodate] + *:not([REPLACE_CLASS_userinfodate]) {
margin-top: 6px;
}
[REPLACE_CLASS_userprofile] [REPLACE_CLASS_userinfodate] {
margin-left: 16px;
}
[REPLACE_CLASS_userprofile] [REPLACE_CLASS_userinfodate]:last-child {
margin-bottom: 16px;
}
[REPLACE_CLASS_avatardisabled] {
filter: grayscale(100%) brightness(50%);

View File

@ -66,8 +66,7 @@ module.exports = (_ => {
"ChannelMembers",
"MemberListItem",
"MessageContent",
"UserPopoutBody",
"UserThemedPopoutBody"
"UserPopoutBody"
],
after: [
"RichRoleMention"
@ -256,10 +255,6 @@ module.exports = (_ => {
if (member) e.instance.props.colorString = member.colorString;
}
processUserThemedPopoutBody (e) {
if (e.instance.props.guild) e.instance.props.guild = this.changeRolesInGuild(e.instance.props.guild);
}
processUserPopoutBody (e) {
if (e.instance.props.guild) e.instance.props.guild = this.changeRolesInGuild(e.instance.props.guild);
}

View File

@ -73,70 +73,69 @@ module.exports = (_ => {
let connections = loadedUsers[this.props.user.id].filter(c => _this.settings.connections[c.type]);
if (!connections.length) return null;
let isLightTheme = (!this.props.theme || this.props.theme == "light") && BDFDB.DiscordUtils.getTheme() == BDFDB.disCN.themelight;
let children = [
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Heading, {
className: BDFDB.disCN.userpopoutsectiontitle,
variant: "eyebrow",
color: this.props.old ? "header-secondary" : null,
children: BDFDB.LanguageUtils.LanguageStrings.CONNECTIONS
}),
BDFDB.ReactUtils.createElement("div", {
className: BDFDB.disCN._showconnectionsconnections,
children: connections.map(c => {
let provider = BDFDB.LibraryModules.ConnectionProviderUtils.get(c.type);
let url = _this.settings.general.openWebpage && provider.getPlatformUserUrl && provider.getPlatformUserUrl(c);
return BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.TooltipContainer, {
text: `${provider.name}: ${c.name}`,
tooltipConfig: {backgroundColor: _this.settings.general.useColoredTooltips && BDFDB.ColorUtils.change(provider.color, -0.3), color: !_this.settings.general.useColoredTooltips || !provider.color ? "black" : null},
children: BDFDB.ReactUtils.createElement(!url ? "div" : BDFDB.LibraryComponents.Anchor, Object.assign(!url ? {} : {
href: url
}, {
className: BDFDB.DOMUtils.formatClassName(BDFDB.disCN._showconnectionsconnection, url && BDFDB.disCN.cursorpointer),
onContextMenu: event => {
BDFDB.ContextMenuUtils.open(_this, event, BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuGroup, {
children: [
BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuItem, {
label: BDFDB.LanguageUtils.LibraryStringsFormat("copy", BDFDB.LanguageUtils.LanguageStrings.USER_SETTINGS_LABEL_USERNAME),
id: BDFDB.ContextMenuUtils.createItemId(_this.name, "copy-name"),
action: _ => BDFDB.LibraryModules.WindowUtils.copy(c.name)
}),
url && BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuItem, {
label: BDFDB.LanguageUtils.LibraryStringsFormat("copy", BDFDB.LanguageUtils.LanguageStrings.SEARCH_ANSWER_HAS_LINK),
id: BDFDB.ContextMenuUtils.createItemId(_this.name, "copy-url"),
action: _ => BDFDB.LibraryModules.WindowUtils.copy(url)
})
]
}));
},
children: [
BDFDB.ReactUtils.createElement("img", {
className: BDFDB.disCN._showconnectionsicon,
alt: BDFDB.LanguageUtils.LanguageStringsFormat("IMG_ALT_LOGO", provider.name),
src: provider.icon[_this.settings.general.useColoredIcons ? (isLightTheme ? "lightSVG" : "darkSVG" ) : "whiteSVG"]
}),
_this.settings.general.showVerifiedBadge && c.verified && BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.TooltipContainer, {
text: BDFDB.LanguageUtils.LanguageStrings.CONNECTION_VERIFIED,
tooltipConfig: {color: "brand", type: "bottom"},
children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.FlowerStar, {
className: BDFDB.disCN._showconnectionsverifiedbadge,
size: "50%",
color: isLightTheme ? BDFDB.DiscordConstants.Colors.STATUS_GREY_200 : BDFDB.DiscordConstants.Colors.PRIMARY_DARK,
children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SvgIcon, {
name: BDFDB.LibraryComponents.SvgIcon.Names.CHECKMARK,
width: "70%",
height: "70%",
color: isLightTheme ? BDFDB.DiscordConstants.Colors.STATUS_GREY_500 : BDFDB.DiscordConstants.Colors.WHITE
return BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.UserPopoutSection, {
children: [
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Heading, {
className: BDFDB.disCN.userpopoutsectiontitle,
variant: "eyebrow",
color: null,
children: BDFDB.LanguageUtils.LanguageStrings.CONNECTIONS
}),
BDFDB.ReactUtils.createElement("div", {
className: BDFDB.disCN._showconnectionsconnections,
children: connections.map(c => {
let provider = BDFDB.LibraryModules.ConnectionProviderUtils.get(c.type);
let url = _this.settings.general.openWebpage && provider.getPlatformUserUrl && provider.getPlatformUserUrl(c);
return BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.TooltipContainer, {
text: `${provider.name}: ${c.name}`,
tooltipConfig: {backgroundColor: _this.settings.general.useColoredTooltips && BDFDB.ColorUtils.change(provider.color, -0.3), color: !_this.settings.general.useColoredTooltips || !provider.color ? "black" : null},
children: BDFDB.ReactUtils.createElement(!url ? "div" : BDFDB.LibraryComponents.Anchor, Object.assign(!url ? {} : {
href: url
}, {
className: BDFDB.DOMUtils.formatClassName(BDFDB.disCN._showconnectionsconnection, url && BDFDB.disCN.cursorpointer),
onContextMenu: event => {
BDFDB.ContextMenuUtils.open(_this, event, BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuGroup, {
children: [
BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuItem, {
label: BDFDB.LanguageUtils.LibraryStringsFormat("copy", BDFDB.LanguageUtils.LanguageStrings.USER_SETTINGS_LABEL_USERNAME),
id: BDFDB.ContextMenuUtils.createItemId(_this.name, "copy-name"),
action: _ => BDFDB.LibraryModules.WindowUtils.copy(c.name)
}),
url && BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuItem, {
label: BDFDB.LanguageUtils.LibraryStringsFormat("copy", BDFDB.LanguageUtils.LanguageStrings.SEARCH_ANSWER_HAS_LINK),
id: BDFDB.ContextMenuUtils.createItemId(_this.name, "copy-url"),
action: _ => BDFDB.LibraryModules.WindowUtils.copy(url)
})
]
}));
},
children: [
BDFDB.ReactUtils.createElement("img", {
className: BDFDB.disCN._showconnectionsicon,
alt: BDFDB.LanguageUtils.LanguageStringsFormat("IMG_ALT_LOGO", provider.name),
src: provider.icon[_this.settings.general.useColoredIcons ? (isLightTheme ? "lightSVG" : "darkSVG" ) : "whiteSVG"]
}),
_this.settings.general.showVerifiedBadge && c.verified && BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.TooltipContainer, {
text: BDFDB.LanguageUtils.LanguageStrings.CONNECTION_VERIFIED,
tooltipConfig: {color: "brand", type: "bottom"},
children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.FlowerStar, {
className: BDFDB.disCN._showconnectionsverifiedbadge,
size: "50%",
color: isLightTheme ? BDFDB.DiscordConstants.Colors.STATUS_GREY_200 : BDFDB.DiscordConstants.Colors.PRIMARY_DARK,
children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SvgIcon, {
name: BDFDB.LibraryComponents.SvgIcon.Names.CHECKMARK,
width: "70%",
height: "70%",
color: isLightTheme ? BDFDB.DiscordConstants.Colors.STATUS_GREY_500 : BDFDB.DiscordConstants.Colors.WHITE
})
})
})
})
]
}))
});
]
}))
});
})
})
})
];
return this.props.old ? children : BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.UserPopoutSection, {
children: children
]
});
}
};
@ -150,8 +149,7 @@ module.exports = (_ => {
this.modulePatches = {
after: [
"UserConnectionsSection",
"UserPopoutBody"
"UserConnectionsSection"
]
};
@ -251,15 +249,6 @@ module.exports = (_ => {
}, true)
];
}
processUserPopoutBody (e) {
if (!e.instance.props.user || e.instance.props.user.isNonUserBot()) return;
let bodyInner = BDFDB.ReactUtils.findChild(e.returnvalue, {props: [["className", BDFDB.disCN.userpopoutbodyinnerwrapper]]});
if (bodyInner) bodyInner.props.children.splice(bodyInner.props.children.length - 2, 0, BDFDB.ReactUtils.createElement(UserConnectionsComponents, {
old: true,
user: e.instance.props.user
}, true));
}
};
})(window.BDFDB_Global.PluginUtils.buildPlugin(changeLog));
})();

View File

@ -118,7 +118,7 @@ module.exports = (_ => {
display: inline-flex;
margin: 0 0 0 0.3rem;
}
${BDFDB.dotCNS._toproleseverywhererolestyle + BDFDB.dotCN.userpopoutrolecircle} {
${BDFDB.dotCNS._toproleseverywhererolestyle + BDFDB.dotCN.userrolecircle} {
flex: 0 0 auto;
}
`;

View File

@ -107,7 +107,7 @@ module.exports = (_ => {
};
this.css = `
${BDFDB.dotCNS.userpopoutfooter + BDFDB.dotCNS.flex + BDFDB.dotCN.inputwrapper} {
${BDFDB.dotCNS.userpopoutmessageinputcontainer + BDFDB.dotCNS.flex + BDFDB.dotCN.inputwrapper} {
flex: 1 1 auto;
}
`;

View File

@ -5332,15 +5332,15 @@ img[src="/assets/cef02719c12d8aaf38894c16dca7fbe6.svg"] { /* rolesettings addr
/* ---- 14.6. COLORPICKER ---- */
#app-mount .colorPickerCustom-1swUKF { /* popout wrapper */
#app-mount .customColorPicker-C_jddW { /* popout wrapper */
background-color: transparent;
box-shadow: 0 0 0 1px rgba(var(--transparencycolor), .3), 0 2px 10px 0 rgba(var(--transparencycolor), .3);
border: none;
border-radius: 3px;
overflow: hidden;
}
.colorPickerCustom-1swUKF::before,
.colorPickerCustom-1swUKF::after {
.customColorPicker-C_jddW::before,
.customColorPicker-C_jddW::after {
content: "";
position: absolute;
top: 0;
@ -5353,11 +5353,11 @@ img[src="/assets/cef02719c12d8aaf38894c16dca7fbe6.svg"] { /* rolesettings addr
pointer-events: none;
z-index: -1;
}
.colorPickerCustom-1swUKF::before {
.customColorPicker-C_jddW::before {
background: var(--popout) var(--popoutposition)/var(--popoutsize);
background-attachment: fixed;
}
.colorPickerCustom-1swUKF::after {
.customColorPicker-C_jddW::after {
background-color: rgba(var(--transparencycolor), calc(var(--transparencyalpha) + 0.35));
backdrop-filter: blur(var(--popoutblur));
}

View File

@ -805,7 +805,7 @@ html .iconBadge-2wi9r4 {
background-color: var(--background-modifier-selected);
}
#app-mount .colorPickerCustom-1swUKF {
#app-mount .customColorPicker-C_jddW {
background: var(--background-primary);
border-color: var(--background-tertiary);
}