Skip to content

Commit ed30e67

Browse files
authored
Merge branch 'main' into utc
2 parents 6aed0ac + 50f9a47 commit ed30e67

34 files changed

+105
-118
lines changed

cspell.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
"replug",
5757
"replugged",
5858
"scroller",
59+
"setsize",
5960
"signingkey",
6061
"Skema",
6162
"skus",

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "replugged",
3-
"version": "4.11.0",
3+
"version": "4.11.1",
44
"description": "A lightweight @discord client mod focused on simplicity and performance",
55
"license": "MIT",
66
"engines": {
@@ -57,7 +57,7 @@
5757
"adm-zip": "^0.5.16",
5858
"chalk": "^5.6.2",
5959
"codemirror": "^6.0.2",
60-
"discord-client-types": "^0.0.11",
60+
"discord-client-types": "^0.0.12",
6161
"esbuild": "^0.27.0",
6262
"esbuild-sass-plugin": "^3.3.1",
6363
"prompts": "^2.4.2",

pnpm-lock.yaml

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/renderer/coremods/badges/plaintextPatches.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export default [
77
replacements: [
88
// Add the "replugged-badge" class if it's our custom badge
99
{
10-
match: /src:null!=\(\i=(\i)\.iconSrc\).{15,30}?,className:\i\(\)\(\i\.badge,\i/,
10+
match: /src:null!=\(\i=(\i)\.iconSrc\).{15,30}?,className:\i\(\)\(\i\.\i,\i/,
1111
replace: `$&,{["replugged-badge"]:$1.component}`,
1212
},
1313
// Change to a div and add a children for our custom badge

src/renderer/coremods/commands/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ async function injectRepluggedSectionIcon(): Promise<void> {
9292

9393
async function injectApplicationCommandIndexStore(): Promise<void> {
9494
const applicationCommandIndexStoreMod = await waitForModule<Record<string, UseDiscoveryState>>(
95-
filters.bySource("APPLICATION_COMMAND_INDEX"),
95+
filters.bySource(".APPLICATION_COMMAND_CACHE_FETCH,"),
9696
);
9797
const useDiscoveryStateKey = getFunctionKeyBySource(
9898
applicationCommandIndexStoreMod,

src/renderer/coremods/experiments/plaintextPatches.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,10 @@ export default (generalSettings.get("experiments")
4949
: []),
5050
// Always return true for the 'isStaff' property in SettingRendererUtils
5151
alwaysTruePatch(`header:"Developer Only"`, /isStaff:\i/),
52-
// Add developer only settings to the UserSettingsCogContextMenu
53-
alwaysTruePatch(`layoutDebuggingEnabled,isStaff:`, "isStaff())===!0"),
5452
// Show the Playgrounds and Build Overrides menu items in the UserSettingsCogContextMenu
5553
alwaysTruePatch("user-settings-cog", /isStaff\(\)/g),
5654
// Show the ExperimentEmbed
57-
alwaysTruePatch(/className:\i\.experimentOverride,/, ".isStaffPersonal())"),
55+
alwaysTruePatch('"Clear Treatment ".concat(', ".isStaffPersonal())"),
5856
// Show the PlaygroundEmbed
5957
alwaysTruePatch("data-has-story", ".isStaffPersonal())"),
6058
// Show the Playgrounds tab in the UserSettingsCogContextMenu

src/renderer/coremods/installer/AddonEmbed.css

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,6 @@ div[class] .addon-embed-copied:hover {
1717
max-width: 210px;
1818
}
1919

20-
.replugged-addon-embed-button-tooltip {
21-
display: flex;
22-
flex: 1;
23-
}
24-
2520
.replugged-addon-embed-button {
2621
flex: 1;
2722
}

src/renderer/coremods/installer/AddonEmbed.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ import { React, classNames } from "@common";
22
import { t as discordT, intl } from "@common/i18n";
33
import { Button, Clickable, Text, Tooltip } from "@components";
44
import { Logger } from "@replugged";
5-
import { getByProps } from "@webpack";
5+
import { getBySource } from "@webpack";
66
import { t } from "src/renderer/modules/i18n";
7-
import { openExternal } from "src/renderer/util";
7+
import { mapClassNames, openExternal } from "src/renderer/util";
88
import type { CheckResultSuccess } from "src/types";
99
import { getSourceLink } from "../settings/pages";
1010
import { type InstallLinkProps, authorList, checkIsInstalled, getInfo, install } from "./util";
@@ -61,12 +61,13 @@ function Link({ className }: { className?: string }): React.ReactElement {
6161
}
6262

6363
const Icon = React.memo(({ className }: { className?: string }): React.ReactElement | null => {
64-
const svgMod = getByProps<SvgMod>("svgContentRight");
64+
const svgMod = getBySource<SvgMod>("svgContentRight_");
6565
if (!svgMod) {
6666
logger.error("Failed to get svgMod");
6767
return null;
6868
}
69-
const { svgContentRight, svgContentLines, svgContentLeft, svgDots, svgTag } = svgMod;
69+
const { svgContentRight, svgContentLines, svgContentLeft, svgDots, svgTag } =
70+
mapClassNames(svgMod);
7071

7172
return (
7273
<svg width="57" height="40" viewBox="0 0 57 40" fill="none" className={className}>
@@ -119,7 +120,7 @@ const Embed = React.memo(
119120
installClick: () => void;
120121
},
121122
): React.ReactElement | null => {
122-
const classMod = getByProps<ClassMod>("titleRegion");
123+
const classMod = getBySource<ClassMod>("titleRegion_");
123124
if (!classMod) {
124125
logger.error("Failed to find classMod");
125126
return null;
@@ -142,7 +143,7 @@ const Embed = React.memo(
142143
copyLink,
143144
copyLinkIcon,
144145
copied,
145-
} = classMod;
146+
} = mapClassNames(classMod);
146147

147148
return (
148149
<div className={wrapper}>
@@ -151,7 +152,7 @@ const Embed = React.memo(
151152
<div className={barLoader} />
152153
) : (
153154
<>
154-
<Tooltip text={props.authors} className="replugged-addon-embed-title-tooltip">
155+
<Tooltip text={props.authors}>
155156
<strong className={classNames(title, "replugged-addon-embed-title")}>
156157
{props.authors}
157158
</strong>
@@ -210,7 +211,6 @@ const Embed = React.memo(
210211
text={intl.formatToPlainString(t.REPLUGGED_ERROR_ALREADY_INSTALLED, {
211212
name: props.name,
212213
})}
213-
className="replugged-addon-embed-button-tooltip"
214214
shouldShow={props.isInstalled ? undefined : false}
215215
hideOnClick={false}>
216216
<Button

src/renderer/coremods/installer/util.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
import { marginStyles, modal } from "@common";
22
import { t as discordT, intl } from "@common/i18n";
33
import { ToastType, toast } from "@common/toast";
4-
import { Button, Notice } from "@components";
4+
import { Notice } from "@components";
55
import { Logger } from "@replugged";
66
import { generalSettings } from "src/renderer/managers/settings";
77
import { setUpdaterState } from "src/renderer/managers/updater";
88
import { t } from "src/renderer/modules/i18n";
9-
import { openExternal } from "src/renderer/util";
109
import type { AnyAddonManifest, CheckResultSuccess } from "src/types";
1110
import * as pluginManager from "../../managers/plugins";
1211
import * as themeManager from "../../managers/themes";
13-
import { getAddonType, getSourceLink, label } from "../settings/pages";
12+
import { getAddonType, label } from "../settings/pages";
1413

1514
const logger = Logger.coremod("Installer");
1615

@@ -226,7 +225,7 @@ export function authorList(authors: string[]): string {
226225
async function showInstallPrompt(
227226
manifest: AnyAddonManifest,
228227
source: InstallerSource | undefined,
229-
linkToStore = true,
228+
_linkToStore = true,
230229
): Promise<boolean | null> {
231230
let type: string;
232231
switch (manifest.type) {
@@ -245,7 +244,9 @@ async function showInstallPrompt(
245244
authors,
246245
});
247246

248-
const storeUrl = linkToStore ? getSourceLink(manifest) : undefined;
247+
// TODO: Fix this! Mana ConfirmModals do not support secondary confirm buttons
248+
249+
// const storeUrl = linkToStore ? getSourceLink(manifest) : undefined;
249250

250251
const res = await modal.confirm({
251252
title,
@@ -263,8 +264,8 @@ async function showInstallPrompt(
263264
),
264265
confirmText: intl.string(discordT.CONFIRM),
265266
cancelText: intl.string(discordT.CANCEL),
266-
secondaryConfirmText: storeUrl ? intl.string(t.REPLUGGED_INSTALLER_OPEN_STORE) : undefined,
267-
onConfirmSecondary: () => (storeUrl ? openExternal(storeUrl) : undefined),
267+
// secondaryConfirmText: storeUrl ? intl.string(t.REPLUGGED_INSTALLER_OPEN_STORE) : undefined,
268+
// onConfirmSecondary: () => (storeUrl ? openExternal(storeUrl) : undefined),
268269
});
269270

270271
return res;
@@ -357,7 +358,6 @@ export async function installFlow(
357358
}),
358359
confirmText: intl.string(discordT.ERRORS_RELOAD),
359360
cancelText: intl.string(discordT.CANCEL),
360-
confirmColor: Button.Colors.RED,
361361
})
362362
.then((answer) => {
363363
if (answer) {

src/renderer/coremods/language/index.tsx

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { intl } from "@common/i18n";
2-
import { Flex, Text } from "@components";
32
import { messagesLoader } from "i18n/en-US.messages";
43
import type React from "react";
54
import { t } from "../../modules/i18n";
@@ -11,22 +10,6 @@ export function getFormattedPercentage(locale: string): React.ReactNode {
1110
return intl.format(t.REPLUGGED_I18N_TRANSLATED_PERCENTAGE, { translated: Number(percentage) });
1211
}
1312

14-
export function _renderLabel({
15-
label,
16-
value,
17-
}: {
18-
label: string;
19-
localizedName: string;
20-
value: string;
21-
}): React.ReactElement {
22-
return (
23-
<Flex direction={Flex.Direction.VERTICAL}>
24-
<Text variant="text-md/normal">{label}</Text>
25-
<Text variant="text-xs/normal">{getFormattedPercentage(value)}</Text>
26-
</Flex>
27-
);
28-
}
29-
3013
export function start(): void {
3114
const totalStrCount = Object.keys(messagesLoader.messages[messagesLoader.defaultLocale]).length;
3215

0 commit comments

Comments
 (0)