···11-- Fixes for latest Discord
22-- Added event for when the config is saved
11+## Core
22+33+- Updated mappings
44+- Fixed using remapped paths as patch finds not working
···77import MarkupUtils from "@moonlight-mod/wp/discord/modules/markup/MarkupUtils";
88import Flex from "@moonlight-mod/wp/discord/uikit/Flex";
99import {
1010- ThemeDarkIcon,
1110 Button,
1211 Text,
1312 ModalRoot,
···1918 openModal
2019} from "@moonlight-mod/wp/discord/components/common/index";
2120import MarkupClasses from "@moonlight-mod/wp/discord/modules/messages/web/Markup.css";
2121+import ThemeDarkIcon from "@moonlight-mod/wp/moonbase_ThemeDarkIcon";
22222323const strings: Record<UpdateState, string> = {
2424 [UpdateState.Ready]: "A new version of moonlight is available.",
···3030// Patches to simply remove a logger call
3131const stubPatches = [
3232 // "sh" is not a valid locale.
3333- ["is not a valid locale", /(.)\.error\(""\.concat\((.)," is not a valid locale\."\)\)/g],
3333+ ["is not a valid locale", /void (.)\.error\(""\.concat\((.)," is not a valid locale\."\)\)/g],
3434 ['"[BUILD INFO] Release Channel: "', /new .{1,2}\.Z\(\)\.log\("\[BUILD INFO\] Release Channel: ".+?\)\),/],
3535 ['.APP_NATIVE_CRASH,"Storage"', /console\.log\("AppCrashedFatalReport lastCrash:",.,.\);/],
3636- ['.APP_NATIVE_CRASH,"Storage"', 'console.log("AppCrashedFatalReport: getLastCrash not supported.");'],
3636+ ['.APP_NATIVE_CRASH,"Storage"', 'void console.log("AppCrashedFatalReport: getLastCrash not supported.")'],
3737 ['"[NATIVE INFO] ', /new .{1,2}\.Z\(\)\.log\("\[NATIVE INFO] .+?\)\);/],
3838 ['"Spellchecker"', /.\.info\("Switching to ".+?"\(unavailable\)"\);?/g],
3939 ['throw Error("Messages are still loading.");', /console\.warn\("Unsupported Locale",.\),/],
···121121}
122122123123export type Messages = {
124124+ /**
125125+ * Adds a component to the username of a message
126126+ */
124127 addToUsername: (id: string, component: React.FC<any>, anchor?: MessageUsernameAnchors, before?: boolean) => void;
128128+ /**
129129+ * Adds a component to the username badge area of a message (e.g. where role icons/new member badge is)
130130+ */
125131 addUsernameBadge: (
126132 id: string,
127133 component: React.FC<any>,
128134 anchor?: MessageUsernameBadgeAnchors,
129135 before?: boolean
130136 ) => void;
137137+ /**
138138+ * Adds a component to the end of a message header (e.g. silent indicator)
139139+ */
131140 addBadge: (id: string, component: React.FC<any>, anchor?: MessageBadgeAnchors, before?: boolean) => void;
132141 /**
142142+ * Adds a component to message accessories (e.g. embeds)
143143+ */
144144+ addAccessory: (id: string, component: React.FC<any>) => void;
145145+ /**
133146 * @private
134147 */
135148 _patchUsername: Patcher<any>;
···141154 * @private
142155 */
143156 _patchBadges: Patcher<any>;
157157+ /**
158158+ * @private
159159+ */
160160+ _patchAccessories: Patcher<any>;
144161};
145162//#endregion
+10-7
packages/types/src/coreExtensions/settings.ts
···77};
8899export type SettingsSection =
1010- | { section: "DIVIDER"; pos: number }
1111- | { section: "HEADER"; label: string; pos: number }
1010+ | { section: "DIVIDER"; pos: number | ((sections: SettingsSection[]) => number) }
1111+ | { section: "HEADER"; label: string; pos: number | ((sections: SettingsSection[]) => number) }
1212 | {
1313 section: string;
1414 label: string;
1515 color: string | null;
1616 element: React.FunctionComponent;
1717- pos: number;
1717+ pos: number | ((sections: SettingsSection[]) => number);
1818 notice?: NoticeProps;
1919+ onClick?: () => void;
1920 _moonlight_submenu?: () => ReactElement | ReactElement[];
2021 };
2122···3233 * @param color A color to use for the section
3334 * @param pos The position in the settings menu to place the section
3435 * @param notice A notice to display when in the section
3636+ * @param onClick A custom action to execute when clicked from the context menu
3537 */
3638 addSection: (
3739 section: string,
3840 label: string,
3941 element: React.FunctionComponent,
4042 color?: string | null,
4141- pos?: number,
4242- notice?: NoticeProps
4343+ pos?: number | ((sections: SettingsSection[]) => number),
4444+ notice?: NoticeProps,
4545+ onClick?: () => void
4346 ) => void;
44474548 /**
···5356 * Places a divider in the settings menu.
5457 * @param pos The position in the settings menu to place the divider
5558 */
5656- addDivider: (pos: number | null) => void;
5959+ addDivider: (pos: number | ((sections: SettingsSection[]) => number) | null) => void;
57605861 /**
5962 * Places a header in the settings menu.
6063 * @param pos The position in the settings menu to place the header
6164 */
6262- addHeader: (label: string, pos: number | null) => void;
6565+ addHeader: (label: string, pos: number | ((sections: SettingsSection[]) => number) | null) => void;
63666467 /**
6568 * @private
+1
packages/types/src/coreExtensions.ts
···77export * as AppPanels from "./coreExtensions/appPanels";
88export * as Commands from "./coreExtensions/commands";
99export * as ComponentEditor from "./coreExtensions/componentEditor";
1010+export * as Common from "./coreExtensions/common";
+4
packages/types/src/discord/require.ts
···11import { AppPanels } from "../coreExtensions/appPanels";
22import { Commands } from "../coreExtensions/commands";
33+import { ErrorBoundary, Icons } from "../coreExtensions/common";
34import { DMList, MemberList, Messages } from "../coreExtensions/componentEditor";
45import { ContextMenu, EvilItemParser } from "../coreExtensions/contextMenu";
56import { Markdown } from "../coreExtensions/markdown";
···1314declare function WebpackRequire(id: "appPanels_appPanels"): AppPanels;
14151516declare function WebpackRequire(id: "commands_commands"): Commands;
1717+1818+declare function WebpackRequire(id: "common_ErrorBoundary"): ErrorBoundary;
1919+declare function WebpackRequire(id: "common_icons"): Icons;
16201721declare function WebpackRequire(id: "componentEditor_dmList"): DMList;
1822declare function WebpackRequire(id: "componentEditor_memberList"): MemberList;
+1-1
packages/types/src/globals.ts
···1111 NodeEventType,
1212 NodeEventPayloads
1313} from "./core/event";
1414-import { MoonlightFS } from "./fs";
1414+import type { MoonlightFS } from "./fs";
15151616export type MoonlightHost = {
1717 config: Config;