Compare commits

..

8 Commits

Author SHA1 Message Date
semantic-release-bot
33d224bc3f chore(release): 4.10.3 [CI SKIP] 2025-07-09 03:21:17 +00:00
shadow
aa0678c857 fix(modals): fix <ConfirmModal /> for new Steam beta (#123) 2025-07-08 23:20:45 -04:00
semantic-release-bot
39fdde9481 chore(release): 4.10.2 [CI SKIP] 2025-06-28 18:03:43 +00:00
AAGaming
a4627a70c5 fix(SteamClient): export shared types for enums 2025-06-28 14:03:04 -04:00
semantic-release-bot
1f6611a10f chore(release): 4.10.1 [CI SKIP] 2025-06-15 19:51:28 +00:00
TrainDoctor
c149711265 Merge pull request #119 from shdwmtr/main
fix: fix <Menu /> for new Steam beta
2025-06-15 12:50:57 -07:00
shadow
7a4c2af6ec chore: improve optional chaining && nullish coalescing 2025-06-15 16:31:26 -03:00
shadow
fc5cde95d6 fix: fix <Menu /> for new Steam Client Beta 2025-06-15 16:20:28 -03:00
5 changed files with 31 additions and 10 deletions

View File

@@ -1,3 +1,24 @@
## [4.10.3](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v4.10.2...v4.10.3) (2025-07-09)
### Bug Fixes
* **modals:** fix `<ConfirmModal />` for new Steam beta ([#123](https://github.com/SteamDeckHomebrew/decky-frontend-lib/issues/123)) ([aa0678c](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/aa0678c857e07f58de58e5d20565bf2718fff6dc))
## [4.10.2](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v4.10.1...v4.10.2) (2025-06-28)
### Bug Fixes
* **SteamClient:** export shared types for enums ([a4627a7](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/a4627a70c5a60a42cd39690b3b03f2c1d79ee3b4))
## [4.10.1](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v4.10.0...v4.10.1) (2025-06-15)
### Bug Fixes
* fix <Menu /> for new Steam Client Beta ([fc5cde9](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/fc5cde95d6475c82856769c86ab648dfb22a4b10))
# [4.10.0](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v4.9.2...v4.10.0) (2025-04-23)

View File

@@ -1,6 +1,6 @@
{
"name": "@decky/ui",
"version": "4.10.0",
"version": "4.10.3",
"description": "A library for interacting with the Steam frontend in Decky plugins and elsewhere.",
"main": "dist/index.js",
"types": "dist/index.d.ts",

View File

@@ -1,6 +1,6 @@
import { FC, ReactNode } from 'react';
import { Export, findModuleByExport, findModuleExport } from '../webpack';
import { Export, findModuleByExport, findModuleDetailsByExport, findModuleExport } from '../webpack';
import { FooterLegendProps } from './FooterLegend';
interface PopupCreationOptions {
@@ -134,9 +134,11 @@ export interface MenuProps extends FooterLegendProps {
children?: ReactNode;
}
export const Menu: FC<MenuProps> = findModuleExport(
(e: Export) => e?.prototype?.HideIfSubmenu && e?.prototype?.HideMenu,
);
const MenuModule = findModuleDetailsByExport((e: Export) => e?.render?.toString()?.includes('bPlayAudio:') || (e?.prototype?.OnOKButton && e?.prototype?.OnMouseEnter));
export const Menu: FC<MenuProps> =
findModuleExport((e: Export) => e?.prototype?.HideIfSubmenu && e?.prototype?.HideMenu) || // Legacy Menu
(Object.values(MenuModule?.[0] ?? {}).find((e) => e?.toString()?.includes?.(`useId`) && e?.toString()?.includes?.(`labelId`)) as FC<MenuProps>); // New Menu 6/15/2025
export interface MenuGroupProps {
label: string;
@@ -159,10 +161,7 @@ export interface MenuItemProps extends FooterLegendProps {
children?: ReactNode;
}
export const MenuItem: FC<MenuItemProps> = findModuleExport(
(e: Export) =>
e?.render?.toString?.()?.includes('bPlayAudio:') || (e?.prototype?.OnOKButton && e?.prototype?.OnMouseEnter),
);
export const MenuItem: FC<MenuItemProps> = MenuModule?.[1];
export const MenuSeparator: FC = findModuleExport(
(e: Export) => typeof e === 'function' && /className:.+?\.ContextMenuSeparator/.test(e.toString()),

View File

@@ -83,7 +83,7 @@ export interface ConfirmModalProps extends ModalRootProps {
}
export const ConfirmModal = findModuleExport(
(e: Export) => !e?.prototype?.OK && e?.prototype?.Cancel && e?.prototype?.render,
(e: Export) => e?.toString()?.includes('bUpdateDisabled') && e?.toString()?.includes('closeModal') && e?.toString()?.includes('onGamepadCancel'),
) as FC<ConfirmModalProps>;
export const ModalRoot = Object.values(

View File

@@ -1,4 +1,5 @@
import {SteamClient} from "./steam-client";
export * from "./steam-client/shared";
declare global {
var SteamClient: SteamClient;