mirror of
https://github.com/SteamDeckHomebrew/decky-frontend-lib.git
synced 2026-05-22 02:48:48 +02:00
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6b3db72a14 | ||
|
|
58b69f0d6c | ||
|
|
c62102e993 | ||
|
|
2e66e5a555 | ||
|
|
ce525318d8 | ||
|
|
aac2d520a6 | ||
|
|
a656f4e57f | ||
|
|
0b50f2cf0b |
28
CHANGELOG.md
28
CHANGELOG.md
@@ -1,3 +1,31 @@
|
|||||||
|
## [3.18.8](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.18.7...v3.18.8) (2023-01-16)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **Navigation:** fix timing issue in decky-loader ([58b69f0](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/58b69f0d6c43356c4f0ed183802d5bf7fb80e978))
|
||||||
|
|
||||||
|
## [3.18.7](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.18.6...v3.18.7) (2023-01-16)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* un-break navigation on stable ([2e66e5a](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/2e66e5a555f44009d24e332eca82453ba930baf7))
|
||||||
|
|
||||||
|
## [3.18.6](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.18.5...v3.18.6) (2023-01-13)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **Router:** fix Navigation for the millionth time ([aac2d52](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/aac2d520a68b1074ba1ae988d6c92f7881a296d7))
|
||||||
|
|
||||||
|
## [3.18.5](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.18.4...v3.18.5) (2022-12-21)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* fixed prop interfaces ([#70](https://github.com/SteamDeckHomebrew/decky-frontend-lib/issues/70)) ([0b50f2c](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/0b50f2cf0baa76fc00aa0a41a8435d7a512bff19))
|
||||||
|
|
||||||
## [3.18.4](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.18.3...v3.18.4) (2022-12-16)
|
## [3.18.4](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.18.3...v3.18.4) (2022-12-16)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "decky-frontend-lib",
|
"name": "decky-frontend-lib",
|
||||||
"version": "3.18.4",
|
"version": "3.18.8",
|
||||||
"description": "A library for building decky plugins",
|
"description": "A library for building decky plugins",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"types": "dist/index.d.ts",
|
"types": "dist/index.d.ts",
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
import { FC } from 'react';
|
import { FC, ReactNode } from 'react';
|
||||||
|
|
||||||
import { findModuleChild } from '../webpack';
|
import { findModuleChild } from '../webpack';
|
||||||
|
|
||||||
export interface PanelSectionProps {
|
export interface PanelSectionProps {
|
||||||
title?: string;
|
title?: string;
|
||||||
spinner?: boolean;
|
spinner?: boolean;
|
||||||
|
children?: ReactNode
|
||||||
}
|
}
|
||||||
|
|
||||||
const [panelSection, mod] = findModuleChild((mod: any) => {
|
const [panelSection, mod] = findModuleChild((mod: any) => {
|
||||||
@@ -18,6 +19,10 @@ const [panelSection, mod] = findModuleChild((mod: any) => {
|
|||||||
|
|
||||||
export const PanelSection = panelSection as FC<PanelSectionProps>;
|
export const PanelSection = panelSection as FC<PanelSectionProps>;
|
||||||
|
|
||||||
|
export interface PanelSectionRowProps {
|
||||||
|
children?: ReactNode
|
||||||
|
}
|
||||||
|
|
||||||
export const PanelSectionRow = Object.values(mod).filter(
|
export const PanelSectionRow = Object.values(mod).filter(
|
||||||
(exp: any) => !exp?.toString()?.includes('.PanelSection'),
|
(exp: any) => !exp?.toString()?.includes('.PanelSection'),
|
||||||
)[0] as FC;
|
)[0] as FC<PanelSectionRowProps>;
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import { sleep } from '../utils';
|
||||||
import { Module, findModuleChild } from '../webpack';
|
import { Module, findModuleChild } from '../webpack';
|
||||||
|
|
||||||
export enum SideMenu {
|
export enum SideMenu {
|
||||||
@@ -125,32 +126,65 @@ export interface Navigation {
|
|||||||
CloseSideMenus(): void;
|
CloseSideMenus(): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const Navigation = {
|
export let Navigation = {} as Navigation;
|
||||||
Navigate: Router.Navigate.bind(Router),
|
|
||||||
NavigateBack: Router.WindowStore?.GamepadUIMainWindowInstance?.NavigateBack.bind(
|
try {
|
||||||
Router.WindowStore.GamepadUIMainWindowInstance,
|
(async () => {
|
||||||
),
|
// With how much Valve is changing these, you really shouldn't use them directly, instead see Navigation
|
||||||
NavigateToAppProperties: Router.NavigateToAppProperties.bind(Router),
|
let InternalNavigators: any;
|
||||||
NavigateToExternalWeb: Router.NavigateToExternalWeb.bind(Router),
|
function initInternalNavigators() {
|
||||||
NavigateToInvites: Router.NavigateToInvites.bind(Router),
|
try {
|
||||||
NavigateToChat: Router.NavigateToChat.bind(Router),
|
InternalNavigators = findModuleChild((m: any) => {
|
||||||
NavigateToLibraryTab: Router.NavigateToLibraryTab.bind(Router),
|
if (typeof m !== 'object') return undefined;
|
||||||
NavigateToLayoutPreview: Router.NavigateToLayoutPreview.bind(Router),
|
for (let prop in m) {
|
||||||
NavigateToSteamWeb: Router.WindowStore?.GamepadUIMainWindowInstance?.NavigateToSteamWeb.bind(
|
if (m[prop]?.GetNavigator) {
|
||||||
Router.WindowStore.GamepadUIMainWindowInstance,
|
return m[prop];
|
||||||
),
|
}
|
||||||
NavigateToWebRoute: Router.WindowStore?.GamepadUIMainWindowInstance?.NavigateToWebRoute.bind(
|
}
|
||||||
Router.WindowStore.GamepadUIMainWindowInstance,
|
})?.GetNavigator();
|
||||||
),
|
} catch (e) {
|
||||||
OpenSideMenu: Router.WindowStore?.GamepadUIMainWindowInstance?.MenuStore.OpenSideMenu.bind(
|
console.error('[DFL:Router]: Failed to init internal navigators, trying again');
|
||||||
Router.WindowStore.GamepadUIMainWindowInstance.MenuStore,
|
}
|
||||||
),
|
}
|
||||||
OpenQuickAccessMenu: Router.WindowStore?.GamepadUIMainWindowInstance?.MenuStore.OpenQuickAccessMenu.bind(
|
initInternalNavigators();
|
||||||
Router.WindowStore.GamepadUIMainWindowInstance.MenuStore,
|
while (!InternalNavigators?.AppProperties) {
|
||||||
),
|
console.log('[DFL:Router]: Trying to init internal navigators again');
|
||||||
OpenMainMenu: Router.WindowStore?.GamepadUIMainWindowInstance?.MenuStore.OpenMainMenu.bind(
|
await sleep(100);
|
||||||
Router.WindowStore.GamepadUIMainWindowInstance.MenuStore,
|
initInternalNavigators();
|
||||||
),
|
}
|
||||||
CloseSideMenus: Router.CloseSideMenus.bind(Router),
|
console.log("got navigators", InternalNavigators)
|
||||||
OpenPowerMenu: Router.OpenPowerMenu.bind(Router),
|
const newNavigation = {
|
||||||
} as Navigation;
|
Navigate: Router.Navigate.bind(Router),
|
||||||
|
NavigateBack: Router.WindowStore?.GamepadUIMainWindowInstance?.NavigateBack.bind(
|
||||||
|
Router.WindowStore.GamepadUIMainWindowInstance,
|
||||||
|
),
|
||||||
|
NavigateToAppProperties: InternalNavigators?.AppProperties || Router.NavigateToAppProperties.bind(Router),
|
||||||
|
NavigateToExternalWeb: Router.NavigateToExternalWeb.bind(Router),
|
||||||
|
NavigateToInvites: InternalNavigators?.Invites || Router.NavigateToInvites.bind(Router),
|
||||||
|
NavigateToChat: Router.NavigateToChat.bind(Router),
|
||||||
|
NavigateToLibraryTab: InternalNavigators?.LibraryTab || Router.NavigateToLibraryTab.bind(Router),
|
||||||
|
NavigateToLayoutPreview: Router.NavigateToLayoutPreview.bind(Router),
|
||||||
|
NavigateToSteamWeb: Router.WindowStore?.GamepadUIMainWindowInstance?.NavigateToSteamWeb.bind(
|
||||||
|
Router.WindowStore.GamepadUIMainWindowInstance,
|
||||||
|
),
|
||||||
|
NavigateToWebRoute: Router.WindowStore?.GamepadUIMainWindowInstance?.NavigateToWebRoute.bind(
|
||||||
|
Router.WindowStore.GamepadUIMainWindowInstance,
|
||||||
|
),
|
||||||
|
OpenSideMenu: Router.WindowStore?.GamepadUIMainWindowInstance?.MenuStore.OpenSideMenu.bind(
|
||||||
|
Router.WindowStore.GamepadUIMainWindowInstance.MenuStore,
|
||||||
|
),
|
||||||
|
OpenQuickAccessMenu: Router.WindowStore?.GamepadUIMainWindowInstance?.MenuStore.OpenQuickAccessMenu.bind(
|
||||||
|
Router.WindowStore.GamepadUIMainWindowInstance.MenuStore,
|
||||||
|
),
|
||||||
|
OpenMainMenu: Router.WindowStore?.GamepadUIMainWindowInstance?.MenuStore.OpenMainMenu.bind(
|
||||||
|
Router.WindowStore.GamepadUIMainWindowInstance.MenuStore,
|
||||||
|
),
|
||||||
|
CloseSideMenus: Router.CloseSideMenus.bind(Router),
|
||||||
|
OpenPowerMenu: Router.OpenPowerMenu.bind(Router),
|
||||||
|
} as Navigation;
|
||||||
|
|
||||||
|
Object.assign(Navigation, newNavigation);
|
||||||
|
})();
|
||||||
|
} catch (e) {
|
||||||
|
console.error('[DFL:Router]: Error initializing Navigation interface', e);
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user