@decky/ui 4.3.0 → 4.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/components/Menu.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { findModuleExport } from '../webpack';
|
|
1
|
+
import { findModuleByExport, findModuleExport } from '../webpack';
|
|
3
2
|
export const showContextMenu = findModuleExport((e) => typeof e === 'function' && e.toString().includes('GetContextMenuManagerFromWindow(')
|
|
4
3
|
&& e.toString().includes('.CreateContextMenuInstance('));
|
|
5
4
|
export const Menu = findModuleExport((e) => e?.prototype?.HideIfSubmenu && e?.prototype?.HideMenu);
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
(e?.prototype?.RenderSubMenu && e?.prototype?.ShowSubMenu));
|
|
5
|
+
const MenuGoupModule = findModuleByExport(e => e?.prototype?.Focus && e?.prototype?.OnOKButton && e?.prototype?.render?.toString().includes?.(`"emphasis"==this.props.tone`));
|
|
6
|
+
export const MenuGroup = MenuGoupModule && Object.values(MenuGoupModule).find((e) => typeof e == "function" && e?.toString()?.includes("bInGamepadUI:"));
|
|
9
7
|
export const MenuItem = findModuleExport((e) => e?.render?.toString()?.includes('bPlayAudio:') || (e?.prototype?.OnOKButton && e?.prototype?.OnMouseEnter));
|
package/package.json
CHANGED
package/src/components/Menu.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { FC, ReactNode } from 'react';
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import { Export, findModuleExport } from '../webpack';
|
|
3
|
+
import { Export, findModuleByExport, findModuleExport } from '../webpack';
|
|
5
4
|
import { FooterLegendProps } from './FooterLegend';
|
|
6
5
|
|
|
7
6
|
export const showContextMenu: (children: ReactNode, parent?: EventTarget) => void = findModuleExport(
|
|
@@ -26,12 +25,8 @@ export interface MenuGroupProps {
|
|
|
26
25
|
children?: ReactNode;
|
|
27
26
|
}
|
|
28
27
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
(e?.toString()?.includes?.('bInGamepadUI:') &&
|
|
32
|
-
fakeRenderComponent(() => e({ overview: { appid: 7 } }), {useContext: () => ({IN_GAMEPADUI: true})})?.type?.prototype?.RenderSubMenu) ||
|
|
33
|
-
(e?.prototype?.RenderSubMenu && e?.prototype?.ShowSubMenu)
|
|
34
|
-
);
|
|
28
|
+
const MenuGoupModule = findModuleByExport(e => e?.prototype?.Focus && e?.prototype?.OnOKButton && e?.prototype?.render?.toString().includes?.(`"emphasis"==this.props.tone`));
|
|
29
|
+
export const MenuGroup: FC<MenuGroupProps> = MenuGoupModule && Object.values(MenuGoupModule).find((e: Export) => typeof e == "function" && e?.toString()?.includes("bInGamepadUI:"));
|
|
35
30
|
export interface MenuItemProps extends FooterLegendProps {
|
|
36
31
|
bInteractableItem?: boolean;
|
|
37
32
|
onClick?(evt: Event): void;
|