mirror of
https://github.com/SteamDeckHomebrew/decky-frontend-lib.git
synced 2026-05-20 01:50:08 +02:00
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5aad952936 | ||
|
|
c2b0fad298 | ||
|
|
4d4cfedfe0 | ||
|
|
bb12921863 | ||
|
|
223739af25 | ||
|
|
95d977df45 | ||
|
|
0f2692a3f2 | ||
|
|
ebf496bf61 |
28
CHANGELOG.md
28
CHANGELOG.md
@@ -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)
|
||||
|
||||
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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>;
|
||||
|
||||
@@ -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>;
|
||||
|
||||
@@ -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>;
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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];
|
||||
}
|
||||
});
|
||||
@@ -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>;
|
||||
|
||||
Reference in New Issue
Block a user