Compare commits

...

8 Commits

Author SHA1 Message Date
semantic-release-bot
5aad952936 chore(release): 3.24.5 [CI SKIP] 2024-02-03 05:32:01 +00:00
AAGaming
c2b0fad298 fix(finds): make modal and scroll components work on latest betaa
THEY INCREASED THE MINIFIER PRESET AAAAAAAAAAAAAAAAAAAAAAAAAA
2024-02-03 00:31:29 -05:00
semantic-release-bot
4d4cfedfe0 chore(release): 3.24.4 [CI SKIP] 2024-01-22 19:56:22 +00:00
AAGaming
bb12921863 fix(types): fix incorrect as on many components leading to any types 2024-01-22 14:55:52 -05:00
semantic-release-bot
223739af25 chore(release): 3.24.3 [CI SKIP] 2024-01-20 03:44:07 +00:00
AAGaming
95d977df45 fix(router): wait 2s if internal navigators init fails 2024-01-19 22:43:38 -05:00
semantic-release-bot
0f2692a3f2 chore(release): 3.24.2 [CI SKIP] 2024-01-20 01:40:41 +00:00
Beebles
ebf496bf61 fix(navigation): Fix on chromium 109 (#100) 2024-01-19 18:40:11 -07:00
8 changed files with 85 additions and 32 deletions

View File

@@ -1,3 +1,31 @@
## [3.24.5](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.24.4...v3.24.5) (2024-02-03)
### Bug Fixes
* **finds:** make modal and scroll components work on latest betaa ([c2b0fad](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/c2b0fad298512aa8778c677275bd497bd8f7b00e))
## [3.24.4](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.24.3...v3.24.4) (2024-01-22)
### Bug Fixes
* **types:** fix incorrect `as` on many components leading to any types ([bb12921](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/bb129218634b77ddb1d73b0fe38a91898073707c))
## [3.24.3](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.24.2...v3.24.3) (2024-01-20)
### Bug Fixes
* **router:** wait 2s if internal navigators init fails ([95d977d](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/95d977df452d3b73b007c98854deab1842fa6fbf))
## [3.24.2](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.24.1...v3.24.2) (2024-01-20)
### Bug Fixes
* **navigation:** Fix on chromium 109 ([#100](https://github.com/SteamDeckHomebrew/decky-frontend-lib/issues/100)) ([ebf496b](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/ebf496bf61cffa1a5205b4a094fd2279011bffa9))
## [3.24.1](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.24.0...v3.24.1) (2023-12-13)

View File

@@ -1,6 +1,6 @@
{
"name": "decky-frontend-lib",
"version": "3.24.1",
"version": "3.24.5",
"description": "A library for building decky plugins",
"main": "dist/index.js",
"types": "dist/index.d.ts",

View File

@@ -8,9 +8,9 @@ export interface ButtonItemProps extends ItemProps {
disabled?: boolean;
}
export const ButtonItem =
CommonUIModule.ButtonField ||
(Object.values(CommonUIModule).find(
(CommonUIModule.ButtonField ||
Object.values(CommonUIModule).find(
(mod: any) =>
mod?.render?.toString()?.includes('"highlightOnFocus","childrenContainerWidth"') ||
mod?.render?.toString()?.includes('childrenContainerWidth:"min"'),
) as FC<ButtonItemProps>);
mod?.render?.toString()?.includes('childrenContainerWidth:"min"'),
)) as FC<ButtonItemProps>;

View File

@@ -155,15 +155,32 @@ export const ModalRoot = (Object.values(
}
})) as FC<ModalRootProps>;
interface SimpleModalProps{
active?: boolean,
children: ReactNode
interface SimpleModalProps {
active?: boolean;
children: ReactNode;
}
const ModalModule = findModule((mod) => {
if (typeof mod !== 'object' || !mod.__esModule) return undefined;
if (mod.SimpleModal && mod.ModalPosition) return mod;
})
const ModalModule = findModule((mod: any) => {
if (typeof mod !== 'object') return false;
for (let prop in mod) {
if (Object.keys(mod).length > 4 && mod[prop]?.toString().includes('.ModalPosition,fallback:')) return true;
}
return false;
});
// findModule((mod) => {
// if (typeof mod !== 'object' || !mod.__esModule) return undefined;
// if (mod.SimpleModal && mod.ModalPosition) return mod;
// })
export const SimpleModal = ModalModule.SimpleModal as FC<SimpleModalProps>
export const ModalPosition = ModalModule.ModalPosition as FC<SimpleModalProps>
const ModalModuleProps = ModalModule ? Object.values(ModalModule) : [];
// export const SimpleModal = ModalModule.SimpleModal as FC<SimpleModalProps>;
// export const ModalPosition = ModalModule.ModalPosition as FC<SimpleModalProps>;
export const SimpleModal = ModalModuleProps.find(prop => {
const string = prop?.toString()
return string?.includes(".ShowPortalModal()") && string?.includes(".OnElementReadyCallbacks.Register(")
}) as FC<SimpleModalProps>;
export const ModalPosition = ModalModuleProps.find(prop => prop?.toString().includes(".ModalPosition,fallback:")) as FC<SimpleModalProps>;

View File

@@ -29,5 +29,5 @@ export interface PanelSectionRowProps {
}
// New as of Feb 22 2023 Beta || Old
export const PanelSectionRow =
mod.PanelSectionRow ||
(Object.values(mod).filter((exp: any) => !exp?.toString()?.includes('.PanelSection'))[0] as FC<PanelSectionRowProps>);
(mod.PanelSectionRow ||
Object.values(mod).filter((exp: any) => !exp?.toString()?.includes('.PanelSection'))[0]) as FC<PanelSectionRowProps>;

View File

@@ -136,7 +136,7 @@ try {
InternalNavigators = findModuleChild((m: any) => {
if (typeof m !== 'object') return undefined;
for (let prop in m) {
if (m[prop]?.GetNavigator) {
if (m[prop]?.GetNavigator && m[prop]?.SetNavigator) {
return m[prop];
}
}
@@ -148,7 +148,7 @@ try {
initInternalNavigators();
while (!InternalNavigators?.AppProperties) {
console.log('[DFL:Router]: Trying to init internal navigators again');
await sleep(100);
await sleep(2000);
initInternalNavigators();
}
}
@@ -160,7 +160,7 @@ try {
NavigateToAppProperties: InternalNavigators?.AppProperties || Router.NavigateToAppProperties?.bind(Router),
NavigateToExternalWeb: InternalNavigators?.ExternalWeb || Router.NavigateToExternalWeb?.bind(Router),
NavigateToInvites: InternalNavigators?.Invites || Router.NavigateToInvites?.bind(Router),
NavigateToChat: Router.NavigateToChat?.bind(Router),
NavigateToChat: InternalNavigators?.Chat || Router.NavigateToChat?.bind(Router),
NavigateToLibraryTab: InternalNavigators?.LibraryTab || Router.NavigateToLibraryTab?.bind(Router),
NavigateToLayoutPreview: Router.NavigateToLayoutPreview?.bind(Router),
NavigateToSteamWeb: Router.WindowStore?.GamepadUIMainWindowInstance?.NavigateToSteamWeb?.bind(

View File

@@ -1,14 +1,22 @@
import { FC, ReactNode } from "react";
import { findModuleChild, findModule } from "../webpack";
import { FC, ReactNode } from 'react';
import { findModule, findModuleChild } from '../webpack';
const ScrollingModule = findModule((mod) => {
if (typeof mod !== 'object' || !mod.__esModule) return undefined;
if (mod.ScrollPanel) return mod;
if (typeof mod !== 'object') return false;
for (let prop in mod) {
if (mod[prop]?.render?.toString?.().includes("{case\"x\":")) return true;
}
return false;
});
export const ScrollPanel: FC<{ children?: ReactNode; }> = ScrollingModule.ScrollPanel;
const ScrollingModuleProps = ScrollingModule ? Object.values(ScrollingModule) : [];
export const ScrollPanelGroup: FC<{ children?: ReactNode; }> = findModuleChild((mod) => {
if (typeof mod !== 'object' || !mod.__esModule) return undefined;
return mod.ScrollPanelGroup;
})
export const ScrollPanel = ScrollingModuleProps.find((prop: any) => prop?.render?.toString?.().includes("{case\"x\":")) as FC<{ children?: ReactNode }>;
export const ScrollPanelGroup: FC<{ children?: ReactNode }> = findModuleChild((mod) => {
if (typeof mod !== 'object') return undefined;
for (let prop in mod) {
if (mod[prop]?.render?.toString().includes(".FocusVisibleChild()),[])")) return mod[prop];
}
});

View File

@@ -112,12 +112,12 @@ try {
}
/**
* Tabs component as used in the library and media tabs. See {@link TabsProps}
* Tabs component as used in the library and media tabs. See {@link TabsProps}.
* Unlike other components in `decky-frontend-lib`, this requires Decky Loader to be running.
*/
export const Tabs =
oldTabs ||
(((props: TabsProps) => {
(oldTabs ||
((props: TabsProps) => {
const found = tabsComponent;
const [tc, setTC] = useState<FC<TabsProps>>(found);
useEffect(() => {
@@ -131,4 +131,4 @@ export const Tabs =
}, []);
console.log('tc', tc);
return tc ? createElement(tc, props) : <SteamSpinner />;
}) as FC<TabsProps>);
})) as FC<TabsProps>;