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:\i}\))]/,
19 replacement: "],arguments[0])"
20 }
21 ],
22 hardFail: true
23 },
24
25 // member list
26 {
27 find: ".lostPermission",
28 replace: [
29 {
30 match: /(?<=\(0,\i\.jsxs\)\(\i\.Fragment,{)children:(\[\i\(\),.+?\i\(\)])/,
31 replacement: (_, decorators) =>
32 `children:require("componentEditor_memberList").default._patchDecorators(${decorators},arguments[0])`
33 },
34 {
35 match: /name:null==\i\?\(0,\i\.jsx\)\("span"/,
36 replacement: (orig: string) =>
37 `children:require("componentEditor_memberList").default._patchItems([],arguments[0]),${orig}`
38 }
39 ]
40 },
41
42 // messages
43 {
44 find: '},"new-member")),',
45 replace: [
46 {
47 match: /(?<=\.BADGES]=)(\i);/,
48 replacement: (_, badges) =>
49 `require("componentEditor_messages").default._patchUsernameBadges(${badges},arguments[0]);`
50 },
51 {
52 match: /(?<=className:\i,)badges:(\i)/,
53 replacement: (_, badges) =>
54 `badges:require("componentEditor_messages").default._patchBadges(${badges},arguments[0])`
55 },
56 {
57 match: /(?<=username:\(0,\i\.jsxs\)\(\i\.Fragment,{)children:(\[.+?,\i])/,
58 replacement: (_, elements) =>
59 `children:require("componentEditor_messages").default._patchUsername(${elements},arguments[0])`
60 }
61 ]
62 }
63];
64
65export const webpackModules: Record<string, ExtensionWebpackModule> = {
66 dmList: {
67 dependencies: [{ id: "react" }]
68 },
69 memberList: {
70 dependencies: [{ id: "react" }]
71 },
72 messages: {
73 dependencies: [{ id: "react" }]
74 }
75};