diff --git a/src/plugins/betterSettings/index.tsx b/src/plugins/betterSettings/index.tsx index 079ec351e..484fdd5e7 100644 --- a/src/plugins/betterSettings/index.tsx +++ b/src/plugins/betterSettings/index.tsx @@ -101,8 +101,13 @@ export default definePlugin({ find: "this.renderArtisanalHack()", replacement: [ { // Fade in on layer - match: /(?<=\((\i),"contextType",\i\.\i\);)/, - replace: "$1=$self.Layer;", + // class Layer { + // static contextType = ...; + // ... + // } + // class OtherClass { + match: /(static contextType=\i\.\i;.+?})(?=class)(?<=class (\i).+?)/, + replace: (_, before, Layer) => `${before};${Layer}=$self.Layer;`, predicate: () => settings.store.disableFade }, { // Lazy-load contents @@ -129,8 +134,8 @@ export default definePlugin({ { // Load menu TOC eagerly find: "#{intl::USER_SETTINGS_WITH_BUILD_OVERRIDE}", replacement: { - match: /(\i)\(this,"handleOpenSettingsContextMenu",.{0,100}?null!=\i&&.{0,100}?(await [^};]*?\)\)).*?,(?=\1\(this)/, - replace: "$&(async ()=>$2)()," + match: /(?=handleOpenSettingsContextMenu=.{0,100}?null!=\i&&.{0,100}?(await [^};]*?\)\)))/, + replace: "_vencordBetterSettingsEagerLoad=(async ()=>$1)();" }, predicate: () => settings.store.eagerLoad }, diff --git a/src/plugins/experiments/index.tsx b/src/plugins/experiments/index.tsx index 9ee3f8f3e..cf5b8dae4 100644 --- a/src/plugins/experiments/index.tsx +++ b/src/plugins/experiments/index.tsx @@ -97,9 +97,10 @@ export default definePlugin({ }, // Enable experiment embed on sent experiment links { - find: "`Clear Treatment ${", + find: "Clear Treatment ", replacement: [ { + // TODO: stable compat optional chaining remove once some time has passed match: /\i\??\.isStaff\(\)/, replace: "true" }, diff --git a/src/plugins/fullUserInChatbox/index.tsx b/src/plugins/fullUserInChatbox/index.tsx index a9d4d61d9..9ac4f811d 100644 --- a/src/plugins/fullUserInChatbox/index.tsx +++ b/src/plugins/fullUserInChatbox/index.tsx @@ -28,7 +28,7 @@ export default definePlugin({ patches: [ { // Same find as RoleColorEverywhere chatbox mentions - find: ':"text":', + find: '"text":"locked"', replacement: { match: /(hidePersonalInformation\).+?)(if\(null!=\i\){.+?return \i)(?=})/, replace: "$1return $self.UserMentionComponent({...arguments[0],originalComponent:()=>{$2}});" diff --git a/src/plugins/platformIndicators/index.tsx b/src/plugins/platformIndicators/index.tsx index 645a82bc5..b2ed2043e 100644 --- a/src/plugins/platformIndicators/index.tsx +++ b/src/plugins/platformIndicators/index.tsx @@ -40,7 +40,6 @@ export interface Session { const SessionsStore = findStoreLazy("SessionsStore") as { getSessions(): Record; }; - const { useStatusFillColor } = mapMangledModuleLazy("translate(${.5625*", { useStatusFillColor: filters.byCode(".hex") }); diff --git a/src/plugins/roleColorEverywhere/index.tsx b/src/plugins/roleColorEverywhere/index.tsx index d9eb37002..c9340fc6f 100644 --- a/src/plugins/roleColorEverywhere/index.tsx +++ b/src/plugins/roleColorEverywhere/index.tsx @@ -93,7 +93,7 @@ export default definePlugin({ // Slate { // Same find as FullUserInChatbox - find: ':"text":', + find: '"text":"locked"', replacement: [ { match: /let\{id:(\i),guildId:\i,channelId:(\i)[^}]*\}.*?\.\i,{(?=children)/, diff --git a/src/plugins/showHiddenChannels/index.tsx b/src/plugins/showHiddenChannels/index.tsx index b3dbd206b..66ef9b806 100644 --- a/src/plugins/showHiddenChannels/index.tsx +++ b/src/plugins/showHiddenChannels/index.tsx @@ -250,19 +250,19 @@ export default definePlugin({ find: "Missing channel in Channel.renderHeaderToolbar", replacement: [ { - match: /renderHeaderToolbar=\(\)=>{.+?case \i\.\i\.GUILD_TEXT:(?=.+?(\i\.push.{0,50}channel:(\i)},"notifications"\)\)))(?<=isLurking:(\i).+?)/, + match: /renderHeaderToolbar(",|=)\(\)=>{.+?case \i\.\i\.GUILD_TEXT:(?=.+?(\i\.push.{0,50}channel:(\i)},"notifications"\)\)))(?<=isLurking:(\i).+?)/, replace: (m, pushNotificationButtonExpression, channel, isLurking) => `${m}if(!${isLurking}&&$self.isHiddenChannel(${channel})){${pushNotificationButtonExpression};break;}` }, { - match: /renderHeaderToolbar=\(\)=>{.+?case \i\.\i\.GUILD_MEDIA:(?=.+?(\i\.push.{0,40}channel:(\i)},"notifications"\)\)))(?<=isLurking:(\i).+?)/, + match: /renderHeaderToolbar(",|=)\(\)=>{.+?case \i\.\i\.GUILD_MEDIA:(?=.+?(\i\.push.{0,40}channel:(\i)},"notifications"\)\)))(?<=isLurking:(\i).+?)/, replace: (m, pushNotificationButtonExpression, channel, isLurking) => `${m}if(!${isLurking}&&$self.isHiddenChannel(${channel})){${pushNotificationButtonExpression};break;}` }, { - match: /renderMobileToolbar=\(\)=>{.+?case \i\.\i\.GUILD_DIRECTORY:(?<=let{channel:(\i).+?)/, + match: /renderMobileToolbar(",|=)\(\)=>{.+?case \i\.\i\.GUILD_DIRECTORY:(?<=let{channel:(\i).+?)/, replace: (m, channel) => `${m}if($self.isHiddenChannel(${channel}))break;` }, { - match: /(?<=renderHeaderBar=\(\)=>{.+?hideSearch:(\i)\.isDirectory\(\))/, + match: /(?<=renderHeaderBar(",|=)\(\)=>{.+?hideSearch:(\i)\.isDirectory\(\))/, replace: (_, channel) => `||$self.isHiddenChannel(${channel})` }, { @@ -352,6 +352,13 @@ export default definePlugin({ match: /\i>0(?=&&!\i&&!\i)/, replace: m => `($self.isHiddenChannel(typeof shcChannel!=="undefined"?shcChannel:void 0,true)?true:${m})` }, + { + // Show only the plus text without overflowed children amount + // if the overflow amount is <= 0 and the component is used inside the HiddenChannelLockScreen + match: /(?<=`\+\$\{)\i(?=\})/, + replace: overflowTextAmount => "" + + `$self.isHiddenChannel(typeof shcChannel!=="undefined"?shcChannel:void 0,true)&&(${overflowTextAmount}-1)<=0?"":${overflowTextAmount}` + }, { // Show only the plus text without overflowed children amount // if the overflow amount is <= 0 and the component is used inside the HiddenChannelLockScreen diff --git a/src/plugins/typingTweaks/index.tsx b/src/plugins/typingTweaks/index.tsx index 7cb4a0a5f..892c6147a 100644 --- a/src/plugins/typingTweaks/index.tsx +++ b/src/plugins/typingTweaks/index.tsx @@ -131,7 +131,7 @@ export default definePlugin({ replace: "$self.renderTypingUsers({ users: arguments[0]?.typingUserObjects, guildId: arguments[0]?.channel?.guild_id, children: $& })" }, { - match: /(?<=function \i\(\i\)\{)(?=[^}]+?\{channel:\i,isThreadCreation:\i=!1\})/, + match: /(?<=function \i\(\i\)\{)(?=[^}]+?\{channel:\i,isThreadCreation:\i=!1,...\i\})/, replace: "let typingUserObjects = $self.useTypingUsers(arguments[0]?.channel);" }, { diff --git a/src/utils/modal.tsx b/src/utils/modal.tsx index 3eee4ff03..7787c5f6f 100644 --- a/src/utils/modal.tsx +++ b/src/utils/modal.tsx @@ -101,7 +101,7 @@ interface Modals { }>; } -export const Modals: Modals = mapMangledModuleLazy(':"thin")', { +export const Modals: Modals = mapMangledModuleLazy('??"thin")', { ModalRoot: filters.componentByCode('.MODAL,"aria-labelledby":'), ModalHeader: filters.componentByCode(",id:"), ModalContent: filters.componentByCode("scrollbarType:"),