this repo has no description

Merge branch 'develop' into lunast

Changed files
+87 -57
packages
core-extensions
src
contextMenu
webpackModules
types
+1 -1
CHANGELOG.md
···
-
- Fixes for latest Discord
···
+
- core-extensions/contextMenu: Fix patches
+1 -1
package.json
···
{
"name": "moonlight",
-
"version": "1.0.9",
"description": "Yet another Discord mod",
"homepage": "https://moonlight-mod.github.io/",
"license": "LGPL-3.0-or-later",
···
{
"name": "moonlight",
+
"version": "1.0.10",
"description": "Yet another Discord mod",
"homepage": "https://moonlight-mod.github.io/",
"license": "LGPL-3.0-or-later",
+1 -2
packages/core-extensions/src/contextMenu/index.tsx
···
find: "Menu API only allows Items and groups of Items as children.",
replace: [
{
-
match:
-
/(?<=let{navId[^}]+?}=(.),(.)=function .\(.\){.+(?=,.=function))/,
replacement: (_, props, items) =>
`,__contextMenu=!${props}.__contextMenu_evilMenu&&require("contextMenu_contextMenu")._patchMenu(${props}, ${items})`
}
···
find: "Menu API only allows Items and groups of Items as children.",
replace: [
{
+
match: /(?<=let{navId[^}]+?}=(.),(.)=.\(.\))/,
replacement: (_, props, items) =>
`,__contextMenu=!${props}.__contextMenu_evilMenu&&require("contextMenu_contextMenu")._patchMenu(${props}, ${items})`
}
+5 -6
packages/core-extensions/src/contextMenu/webpackModules/evilMenu.ts
···
"Menu API only allows Items and groups of Items as children."
)[0].id
].toString();
-
code = code.replace(/,.=(?=function .\(.\){.+?,.=function)/, ";return ");
-
code = code.replace(/,(?=__contextMenu)/, ";let ");
const mod = new Function(
"module",
"exports",
···
);
const exp: any = {};
mod({}, exp, require);
-
const Menu = spacepack.findFunctionByStrings(
-
exp,
-
"Menu API only allows Items and groups of Items as children."
-
)!;
module.exports = (el: any) => {
return Menu({
children: el,
···
"Menu API only allows Items and groups of Items as children."
)[0].id
].toString();
+
code = code.replace(
+
/onSelect:(.)}=(.),.=(.\(.\)),/,
+
`onSelect:$1}=$2;return $3;let `
+
);
const mod = new Function(
"module",
"exports",
···
);
const exp: any = {};
mod({}, exp, require);
+
const Menu = spacepack.findFunctionByStrings(exp, "isUsingKeyboardNavigation")!;
module.exports = (el: any) => {
return Menu({
children: el,
+1 -1
packages/types/package.json
···
{
"name": "@moonlight-mod/types",
-
"version": "1.1.8",
"main": "./src/index.ts",
"types": "./src/index.ts",
"exports": {
···
{
"name": "@moonlight-mod/types",
+
"version": "1.1.9",
"main": "./src/index.ts",
"types": "./src/index.ts",
"exports": {
+23 -1
packages/types/src/coreExtensions.ts
···
export type CommonReact = typeof import("react");
export type CommonFlux = FluxDefault;
export type CommonComponents = CommonComponents_; // lol
-
export type CommonFluxDispatcher = Dispatcher<any>;
export * as Markdown from "./coreExtensions/markdown";
export * as ContextMenu from "./coreExtensions/contextMenu";
···
export type CommonReact = typeof import("react");
export type CommonFlux = FluxDefault;
export type CommonComponents = CommonComponents_; // lol
+
export type CommonFluxDispatcher = Dispatcher<any> & {
+
dispatch: (payload: any) => void;
+
isDispatching: () => boolean;
+
+
addInterceptor: (interceptor: (event: any) => boolean | undefined) => void;
+
+
flushWaitQueue: () => void;
+
wait: (callback: () => void) => void;
+
+
subscribe: (eventType: string, callback: (event: any) => void) => void;
+
unsubscribe: (eventType: string, callback: (event: any) => void) => void;
+
+
register: (
+
name: string,
+
actionHandlers: Record<string, (event: any) => void>,
+
storeDidChange: (event: any) => void,
+
band: number,
+
token: string
+
) => number;
+
+
createToken: () => string;
+
addDependencies: (id: string, deps: string[]) => void;
+
};
export * as Markdown from "./coreExtensions/markdown";
export * as ContextMenu from "./coreExtensions/contextMenu";
+55 -45
packages/types/src/coreExtensions/contextMenu.ts
···
color?: string;
children: React.ReactComponentElement<MenuElement>[];
}>;
-
export type MenuItem = React.FunctionComponent<{
-
id: any;
-
dontCloseOnActionIfHoldingShiftKey?: boolean;
-
} & ({
-
label: string;
-
subtext?: string;
-
color?: string;
-
hint?: string;
-
disabled?: boolean;
-
icon?: any;
-
showIconFirst?: boolean;
-
imageUrl?: string;
-
className?: string;
-
focusedClassName?: string;
-
subMenuIconClassName?: string;
-
action?: () => void;
-
onFocus?: () => void;
-
iconProps?: any;
-
sparkle?: any;
-
children?: React.ReactComponentElement<MenuElement>[];
-
onChildrenScroll?: any;
-
childRowHeight?: any;
-
listClassName?: string;
-
subMenuClassName?: string;
-
} | {
-
color?: string;
-
disabled?: boolean;
-
keepItemStyles?: boolean;
-
action?: () => void;
-
render: any;
-
navigable?: boolean;
-
})>;
export type MenuCheckboxItem = React.FunctionComponent<{
id: any;
label: string;
···
disabled?: boolean;
action?: () => void;
}>;
-
export type MenuControlItem = React.FunctionComponent<{
-
id: any;
-
label: string;
-
color?: string;
-
disabled?: boolean;
-
showDefaultFocus?: boolean;
-
} & ({
-
control: any;
-
} | {
-
control?: undefined;
-
interactive?: boolean;
-
children?: React.ReactComponentElement<MenuElement>[];
-
})>;
/* eslint-disable prettier/prettier */
export type ContextMenu = {
···
color?: string;
children: React.ReactComponentElement<MenuElement>[];
}>;
+
export type MenuItem = React.FunctionComponent<
+
{
+
id: any;
+
dontCloseOnActionIfHoldingShiftKey?: boolean;
+
} & (
+
| {
+
label: string;
+
subtext?: string;
+
color?: string;
+
hint?: string;
+
disabled?: boolean;
+
icon?: any;
+
showIconFirst?: boolean;
+
imageUrl?: string;
+
className?: string;
+
focusedClassName?: string;
+
subMenuIconClassName?: string;
+
action?: () => void;
+
onFocus?: () => void;
+
iconProps?: any;
+
sparkle?: any;
+
children?: React.ReactComponentElement<MenuElement>[];
+
onChildrenScroll?: any;
+
childRowHeight?: any;
+
listClassName?: string;
+
subMenuClassName?: string;
+
}
+
| {
+
color?: string;
+
disabled?: boolean;
+
keepItemStyles?: boolean;
+
action?: () => void;
+
render: any;
+
navigable?: boolean;
+
}
+
)
+
>;
export type MenuCheckboxItem = React.FunctionComponent<{
id: any;
label: string;
···
disabled?: boolean;
action?: () => void;
}>;
+
export type MenuControlItem = React.FunctionComponent<
+
{
+
id: any;
+
label: string;
+
color?: string;
+
disabled?: boolean;
+
showDefaultFocus?: boolean;
+
} & (
+
| {
+
control: any;
+
}
+
| {
+
control?: undefined;
+
interactive?: boolean;
+
children?: React.ReactComponentElement<MenuElement>[];
+
}
+
)
+
>;
/* eslint-disable prettier/prettier */
export type ContextMenu = {