stuff
This commit is contained in:
parent
35db700dff
commit
29e93e2bb9
|
@ -1688,9 +1688,9 @@ module.exports = (_ => {
|
|||
toasts.appendChild(data.toast);
|
||||
BDFDB.TimeUtils.timeout(_ => BDFDB.DOMUtils.removeClass(data.toast, BDFDB.disCN.toastopening));
|
||||
|
||||
let icon = data.config.avatar ? BDFDB.ReactUtils.createElement(Internal.LibraryComponents.AvatarComponents.default, {
|
||||
let icon = data.config.avatar ? BDFDB.ReactUtils.createElement(Internal.LibraryComponents.Avatars.Avatar, {
|
||||
src: data.config.avatar,
|
||||
size: Internal.LibraryComponents.AvatarComponents.Sizes.SIZE_24
|
||||
size: Internal.LibraryComponents.Avatars.Sizes.SIZE_24
|
||||
}) : ((data.config.icon || data.config.type && Internal.DiscordConstants.ToastIcons[data.config.type]) ? BDFDB.ReactUtils.createElement(Internal.LibraryComponents.SvgIcon, {
|
||||
name: data.config.type && Internal.DiscordConstants.ToastIcons[data.config.type] && Internal.LibraryComponents.SvgIcon.Names[Internal.DiscordConstants.ToastIcons[data.config.type]],
|
||||
iconSVG: data.config.icon,
|
||||
|
@ -8101,18 +8101,29 @@ module.exports = (_ => {
|
|||
get: function (_, item) {
|
||||
if (LibraryComponents[item]) return LibraryComponents[item];
|
||||
if (!InternalData.LibraryComponents[item] && !CustomComponents[item]) return "div";
|
||||
|
||||
if (InternalData.LibraryComponents[item]) {
|
||||
if (InternalData.LibraryComponents[item].name) LibraryComponents[item] = BDFDB.ModuleUtils.findByName(InternalData.LibraryComponents[item].name);
|
||||
else if (InternalData.LibraryComponents[item].strings) LibraryComponents[item] = BDFDB.ModuleUtils.findByString(InternalData.LibraryComponents[item].strings);
|
||||
else if (InternalData.LibraryComponents[item].props) LibraryComponents[item] = BDFDB.ModuleUtils.findByProperties(InternalData.LibraryComponents[item].props);
|
||||
let defaultExport = typeof InternalData.LibraryComponents[item].exported != "boolean" ? true : InternalData.LibraryComponents[item].exported;
|
||||
if (InternalData.LibraryComponents[item].props) LibraryComponents[item] = BDFDB.ModuleUtils.findByProperties(InternalData.LibraryComponents[item].props, {defaultExport});
|
||||
else if (InternalData.LibraryComponents[item].name) LibraryComponents[item] = BDFDB.ModuleUtils.findByName(InternalData.LibraryComponents[item].name, {defaultExport});
|
||||
else if (InternalData.LibraryComponents[item].strings) {
|
||||
if (InternalData.LibraryComponents[item].nonStrings) {
|
||||
LibraryComponents[item] = Internal.findModule("strings + nonStrings", JSON.stringify([InternalData.LibraryComponents[item].strings, InternalData.LibraryComponents[item].nonStrings].flat(10)), m => Internal.checkModuleStrings(m, InternalData.LibraryComponents[item].strings) && Internal.checkModuleStrings(m, InternalData.LibraryComponents[item].nonStrings, {hasNot: true}) && m, {defaultExport});
|
||||
}
|
||||
else LibraryComponents[item] = BDFDB.ModuleUtils.findByString(InternalData.LibraryComponents[item].strings, {defaultExport});
|
||||
}
|
||||
if (InternalData.LibraryComponents[item].value) LibraryComponents[item] = (LibraryComponents[item] || {})[InternalData.LibraryComponents[item].value];
|
||||
if (InternalData.LibraryComponents[item].assign) LibraryComponents[item] = Object.assign({}, LibraryComponents[item]);
|
||||
if (LibraryComponents[item] && InternalData.LibraryComponents[item].funcStrings) LibraryComponents[item] = (Object.entries(LibraryComponents[item]).find(n => {
|
||||
if (!n || !n[1]) return;
|
||||
let funcString = n[1].toString();
|
||||
return [InternalData.LibraryComponents[item].funcStrings].flat(10).filter(s => s && typeof s == "string").every(string => funcString.indexOf(string) > -1);
|
||||
}) || [])[1]
|
||||
if (LibraryComponents[item]) {
|
||||
if (InternalData.LibraryComponents[item].funcStrings) LibraryComponents[item] = (Object.entries(LibraryComponents[item]).find(n => {
|
||||
if (!n || !n[1]) return;
|
||||
let funcString = n[1].toString();
|
||||
return [InternalData.LibraryComponents[item].funcStrings].flat(10).filter(s => s && typeof s == "string").every(string => funcString.indexOf(string) > -1);
|
||||
}) || [])[1]
|
||||
if (InternalData.LibraryComponents[item].map) LibraryComponents[item] = Internal.mappifyModule(LibraryComponents[item], InternalData.LibraryComponents[item]);
|
||||
}
|
||||
}
|
||||
|
||||
if (CustomComponents[item]) LibraryComponents[item] = LibraryComponents[item] ? Object.assign({}, LibraryComponents[item], CustomComponents[item]) : CustomComponents[item];
|
||||
|
||||
const NativeComponent = LibraryComponents[item] && Internal.NativeSubComponents[item];
|
||||
|
@ -8326,8 +8337,8 @@ module.exports = (_ => {
|
|||
className = BDFDB.DOMUtils.formatClassName(avatar.props.className, className, BDFDB.disCN.bdfdbhasbadge, BDFDB.disCN.bdfdbbadgeavatar, BDFDB.disCN.bdfdbdev);
|
||||
}
|
||||
if (role) {
|
||||
if (avatar.type == "img") avatar = BDFDB.ReactUtils.createElement(Internal.LibraryComponents.AvatarComponents.default, Object.assign({}, avatar.props, {
|
||||
size: Internal.LibraryComponents.AvatarComponents.Sizes.SIZE_40
|
||||
if (avatar.type == "img") avatar = BDFDB.ReactUtils.createElement(Internal.LibraryComponents.Avatars.Avatar, Object.assign({}, avatar.props, {
|
||||
size: Internal.LibraryComponents.Avatars.Sizes.SIZE_40
|
||||
}));
|
||||
delete avatar.props.className;
|
||||
let newProps = {
|
||||
|
|
|
@ -391,7 +391,7 @@
|
|||
"Anchor": {"strings": ["anchorUnderlineOnHover", "noreferrer noopener"]},
|
||||
"Animations": {"props": ["Controller", "Spring"], "assign": true},
|
||||
"AppReferencePositionLayer": {"strings": ["\"onMount\"", "\"onUnmount\""], "funcStrings": ["createRef"]},
|
||||
"Avatars": {"strings": ["\"statusColor\"", "ONLINE", "isMobile"], "map": {
|
||||
"Avatars": {"strings": ["\"statusColor\"", "ONLINE", "isMobile"], "exported": false, "value": "exports", "map": {
|
||||
"AnimatedAvatar": ["compare"],
|
||||
"Avatar": ["statusColor"],
|
||||
"Sizes": ["SIZE_32"]
|
||||
|
|
|
@ -333,9 +333,9 @@ module.exports = (_ => {
|
|||
if (BDFDB.ReactUtils.findChild(parent, {props: [["className", BDFDB.disCN._displayserversaschannelsname]]})) return;
|
||||
let childEles = [
|
||||
[
|
||||
options.isDm && returnvalue.props.icon && BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.AvatarComponents.default, {
|
||||
options.isDm && returnvalue.props.icon && BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Avatars.Avatar, {
|
||||
src: returnvalue.props.icon,
|
||||
size: BDFDB.LibraryComponents.AvatarComponents.Sizes.SIZE_24
|
||||
size: BDFDB.LibraryComponents.Avatars.Sizes.SIZE_24
|
||||
}),
|
||||
options.badges,
|
||||
].flat(10).filter(n => n).map(badge => BDFDB.ReactUtils.createElement("div", {
|
||||
|
|
|
@ -363,10 +363,10 @@ module.exports = (_ => {
|
|||
label: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Flex, {
|
||||
children: !Object.keys(changedUsers).length ? BDFDB.LanguageUtils.LanguageStrings.NONE : Object.keys(changedUsers).filter(BDFDB.LibraryStores.UserStore.getUser).map(id => BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.TooltipContainer, {
|
||||
text: this.getUserData(id).username,
|
||||
children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.AvatarComponents.default, {
|
||||
children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Avatars.Avatar, {
|
||||
className: BDFDB.disCN.listavatar,
|
||||
src: this.getUserAvatar(id),
|
||||
size: BDFDB.LibraryComponents.AvatarComponents.Sizes.SIZE_32,
|
||||
size: BDFDB.LibraryComponents.Avatars.Sizes.SIZE_32,
|
||||
onClick: _ => this.openUserSettingsModal(BDFDB.LibraryStores.UserStore.getUser(id))
|
||||
})
|
||||
}))
|
||||
|
|
|
@ -171,10 +171,10 @@ module.exports = (_ => {
|
|||
className: BDFDB.disCN._friendnotificationslogtime,
|
||||
children: BDFDB.LibraryComponents.DateInput.format(_this.settings.dates.logDate, log.timestamp)
|
||||
}),
|
||||
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.AvatarComponents.default, {
|
||||
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Avatars.Avatar, {
|
||||
className: BDFDB.disCN._friendnotificationslogavatar,
|
||||
src: log.avatar,
|
||||
size: BDFDB.LibraryComponents.AvatarComponents.Sizes.SIZE_40
|
||||
size: BDFDB.LibraryComponents.Avatars.Sizes.SIZE_40
|
||||
}),
|
||||
_this.createStatusDot(log.status, log.mobile, {marginRight: 6}),
|
||||
BDFDB.ReactUtils.createElement("div", {
|
||||
|
@ -422,11 +422,11 @@ module.exports = (_ => {
|
|||
}
|
||||
},
|
||||
renderLabel: cardData => [
|
||||
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.AvatarComponents.default, {
|
||||
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Avatars.Avatar, {
|
||||
className: BDFDB.DOMUtils.formatClassName(BDFDB.disCN.listavatar, cardData.disabled && BDFDB.disCN.avatardisabled),
|
||||
src: BDFDB.UserUtils.getAvatar(cardData.id),
|
||||
status: BDFDB.UserUtils.getStatus(cardData.id),
|
||||
size: BDFDB.LibraryComponents.AvatarComponents.Sizes.SIZE_40,
|
||||
size: BDFDB.LibraryComponents.Avatars.Sizes.SIZE_40,
|
||||
onClick: _ => {
|
||||
let observed = this.getObservedData();
|
||||
let data = observed[type][cardData.id] || Object.assign({}, defaultSettings);
|
||||
|
|
Loading…
Reference in New Issue