@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.
@@ -1,9 +1,7 @@
1
- import { fakeRenderComponent } from '../utils';
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
- export const MenuGroup = findModuleExport((e) => (e?.toString()?.includes?.('bInGamepadUI:') &&
7
- fakeRenderComponent(() => e({ overview: { appid: 7 } }), { useContext: () => ({ IN_GAMEPADUI: true }) })?.type?.prototype?.RenderSubMenu) ||
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@decky/ui",
3
- "version": "4.3.0",
3
+ "version": "4.3.1",
4
4
  "description": "A library for interacting with the Steam frontend in Decky plugins and elsewhere.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,7 +1,6 @@
1
1
  import { FC, ReactNode } from 'react';
2
2
 
3
- import { fakeRenderComponent } from '../utils';
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
- export const MenuGroup: FC<MenuGroupProps> = findModuleExport(
30
- (e: Export) =>
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;