···11-# Core
22-- Updated mappings
11+## Core
3244-# Libraries
55-- Support for message accessories in Component Editor
66-- Settings sections now allow for a function to compute position (thanks @MeguminSama!)
77-- Error boundary component in Common
88-- `spacepack.lazyLoad` now supports `\i` in regular expressions
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",.\),/],
···11+import type { IconProps, IconSize } from "@moonlight-mod/mappings/discord/components/common/index";
22+13export type ErrorBoundaryProps = React.PropsWithChildren<{
24 noop?: boolean;
35 fallback?: React.FC<any>;
···911 error?: Error;
1012 componentStack?: string;
1113};
1414+1515+export type ErrorBoundary = React.ComponentClass<ErrorBoundaryProps, ErrorBoundaryState>;
1616+1717+export type ParsedIconProps = {
1818+ width: number;
1919+ height: number;
2020+ fill: string;
2121+ className: string;
2222+};
2323+2424+export interface Icons {
2525+ /**
2626+ * Parse icon props into their actual width/height.
2727+ * @param props The icon props
2828+ */
2929+ parseProps(props?: IconProps): ParsedIconProps;
3030+}
3131+3232+// Re-export so extension developers don't need to depend on mappings
3333+export type { IconProps, IconSize };
+4-1
packages/types/src/coreExtensions/settings.ts
···1616 element: React.FunctionComponent;
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,
···3941 element: React.FunctionComponent,
4042 color?: string | null,
4143 pos?: number | ((sections: SettingsSection[]) => number),
4242- notice?: NoticeProps
4444+ notice?: NoticeProps,
4545+ onClick?: () => void
4346 ) => void;
44474548 /**
+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;