@decky/ui 4.8.2 → 4.9.0

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.
@@ -27,3 +27,4 @@ export interface MenuItemProps extends FooterLegendProps {
27
27
  children?: ReactNode;
28
28
  }
29
29
  export declare const MenuItem: FC<MenuItemProps>;
30
+ export declare const MenuSeparator: FC;
@@ -5,3 +5,4 @@ export const Menu = findModuleExport((e) => e?.prototype?.HideIfSubmenu && e?.pr
5
5
  const MenuGoupModule = findModuleByExport(e => e?.prototype?.Focus && e?.prototype?.OnOKButton && e?.prototype?.render?.toString().includes?.(`"emphasis"==this.props.tone`));
6
6
  export const MenuGroup = MenuGoupModule && Object.values(MenuGoupModule).find((e) => typeof e == "function" && e?.toString?.()?.includes("bInGamepadUI:"));
7
7
  export const MenuItem = findModuleExport((e) => e?.render?.toString?.()?.includes('bPlayAudio:') || (e?.prototype?.OnOKButton && e?.prototype?.OnMouseEnter));
8
+ export const MenuSeparator = findModuleExport((e) => typeof e === 'function' && /className:.+?\.ContextMenuSeparator/.test(e.toString()));
@@ -13,7 +13,7 @@ export function findSP() {
13
13
  if (document.title == 'SP')
14
14
  return window;
15
15
  const navTrees = getGamepadNavigationTrees();
16
- return navTrees?.find((x) => x.m_ID == 'root_1_')?.Root?.Element?.ownerDocument?.defaultView;
16
+ return navTrees?.find((x) => x.m_ID == 'GamepadUI_Full_Root' || x.m_ID == 'root_1_')?.Root?.Element?.ownerDocument?.defaultView;
17
17
  }
18
18
  export function getFocusNavController() {
19
19
  return window.GamepadNavTree?.m_context?.m_controller || window.FocusNavController;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@decky/ui",
3
- "version": "4.8.2",
3
+ "version": "4.9.0",
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",
@@ -45,6 +45,10 @@ export const MenuItem: FC<MenuItemProps> = findModuleExport(
45
45
  e?.render?.toString?.()?.includes('bPlayAudio:') || (e?.prototype?.OnOKButton && e?.prototype?.OnMouseEnter),
46
46
  );
47
47
 
48
+ export const MenuSeparator: FC = findModuleExport(
49
+ (e: Export) => typeof e === 'function' && /className:.+?\.ContextMenuSeparator/.test(e.toString()),
50
+ );
51
+
48
52
  /*
49
53
  all().map(m => {
50
54
  if (typeof m !== "object") return undefined;
@@ -25,7 +25,7 @@ export function findSP(): Window {
25
25
  if (document.title == 'SP') return window;
26
26
  // new (SP as popup)
27
27
  const navTrees = getGamepadNavigationTrees();
28
- return navTrees?.find((x: any) => x.m_ID == 'root_1_')?.Root?.Element?.ownerDocument?.defaultView;
28
+ return navTrees?.find((x: any) => x.m_ID == 'GamepadUI_Full_Root' || x.m_ID == 'root_1_')?.Root?.Element?.ownerDocument?.defaultView;
29
29
  }
30
30
 
31
31
  /**