this repo has no description
1import { ExtensionWebpackModule, Patch } from "@moonlight-mod/types";
2
3export const patches: Patch[] = [
4 // dm list
5 {
6 find: ".interactiveSystemDM]:",
7 replace: [
8 {
9 match: /decorators:(\i\.isSystemDM\(\)\?\(0,\i\.jsx\)\(.+?verified:!0}\):null)/,
10 replacement: (_, decorators) =>
11 `decorators:require("componentEditor_dmList").default._patchDecorators([${decorators}],arguments[0])`
12 },
13 {
14 match: /(?<=selected:\i,)children:\[/,
15 replacement: 'children:require("componentEditor_dmList").default._patchItems(['
16 },
17 {
18 match: /(?<=(onMouseDown|nameplate):\i}\))]/,
19 replacement: "],arguments[0])"
20 }
21 ],
22 hardFail: true
23 },
24
25 // member list
26 {
27 find: ".lostPermission",
28 replace: [
29 {
30 match:
31 /(?<=\(0,\i\.jsxs\)\(\i\.Fragment,{)children:(\[\(0,\i\.jsx\)\(\i,{user:\i}\),.+?onClickPremiumGuildIcon:\i}\)])/,
32 replacement: (_, decorators) =>
33 `children:require("componentEditor_memberList").default._patchDecorators(${decorators},arguments[0])`
34 },
35 {
36 match: /name:null==\i\?\(0,\i\.jsx\)\("span"/,
37 replacement: (orig: string) =>
38 `children:require("componentEditor_memberList").default._patchItems([],arguments[0]),${orig}`
39 }
40 ]
41 },
42
43 // messages
44 {
45 find: '},"new-member")),',
46 replace: [
47 {
48 match: /(?<=\.BADGES](=|:))(\i)(;|})/,
49 replacement: (_, leading, badges, trailing) =>
50 `require("componentEditor_messages").default._patchUsernameBadges(${badges},arguments[0])${trailing}`
51 },
52 {
53 match: /(?<=className:\i,)badges:(\i)/,
54 replacement: (_, badges) =>
55 `badges:require("componentEditor_messages").default._patchBadges(${badges},arguments[0])`
56 },
57 {
58 match: /(?<=username:\(0,\i\.jsxs\)\(\i\.Fragment,{)children:(\[.+?])}\),usernameSpanId:/,
59 replacement: (_, elements) =>
60 `children:require("componentEditor_messages").default._patchUsername(${elements},arguments[0])}),usernameSpanId:`
61 }
62 ]
63 },
64 {
65 find: '.provider&&"Discord"===',
66 replace: {
67 match: /(?<=\.container\),)children:(\[.+?this\.renderSuppressConfirmModal\(\),.+?\])}\)/,
68 replacement: (_, elements) =>
69 `children:require("componentEditor_messages").default._patchAccessories(${elements},this.props)})`
70 }
71 }
72];
73
74export const webpackModules: Record<string, ExtensionWebpackModule> = {
75 dmList: {
76 dependencies: [{ id: "react" }]
77 },
78 memberList: {
79 dependencies: [{ id: "react" }]
80 },
81 messages: {
82 dependencies: [{ id: "react" }]
83 }
84};