mirror of
https://github.com/SteamDeckHomebrew/decky-frontend-lib.git
synced 2026-05-23 11:28:48 +02:00
Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
223739af25 | ||
|
|
95d977df45 | ||
|
|
0f2692a3f2 | ||
|
|
ebf496bf61 | ||
|
|
0a5170e412 | ||
|
|
11dd82bbb1 | ||
|
|
153bb209d1 | ||
|
|
e27b638d26 | ||
|
|
7d287f10d6 | ||
|
|
9925bc8cfb |
@@ -7,6 +7,7 @@
|
|||||||
"preset": "angular",
|
"preset": "angular",
|
||||||
"releaseRules": [
|
"releaseRules": [
|
||||||
{"type": "chore", "scope": "classes", "release": "patch"},
|
{"type": "chore", "scope": "classes", "release": "patch"},
|
||||||
|
{"type": "docs", "scope": "steamclient", "release": "patch"},
|
||||||
{"type": "*", "scope": "docs", "release": false}
|
{"type": "*", "scope": "docs", "release": false}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
28
CHANGELOG.md
28
CHANGELOG.md
@@ -1,3 +1,31 @@
|
|||||||
|
## [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)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **utils/react:** support react 18, add getReactRoot ([11dd82b](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/11dd82bbb1814ac4d2fa9d381372e325daba2558))
|
||||||
|
|
||||||
|
# [3.24.0](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.23.1...v3.24.0) (2023-12-03)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **static-classes:** add BasicAppDetailsSectionStylerClasses ([#99](https://github.com/SteamDeckHomebrew/decky-frontend-lib/issues/99)) ([e27b638](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/e27b638d26e41332b1554dbd55ca0c55a1821138))
|
||||||
|
|
||||||
## [3.23.1](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.23.0...v3.23.1) (2023-11-09)
|
## [3.23.1](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.23.0...v3.23.1) (2023-11-09)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "decky-frontend-lib",
|
"name": "decky-frontend-lib",
|
||||||
"version": "3.23.1",
|
"version": "3.24.3",
|
||||||
"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",
|
||||||
|
|||||||
@@ -136,7 +136,7 @@ try {
|
|||||||
InternalNavigators = findModuleChild((m: any) => {
|
InternalNavigators = findModuleChild((m: any) => {
|
||||||
if (typeof m !== 'object') return undefined;
|
if (typeof m !== 'object') return undefined;
|
||||||
for (let prop in m) {
|
for (let prop in m) {
|
||||||
if (m[prop]?.GetNavigator) {
|
if (m[prop]?.GetNavigator && m[prop]?.SetNavigator) {
|
||||||
return m[prop];
|
return m[prop];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -148,7 +148,7 @@ try {
|
|||||||
initInternalNavigators();
|
initInternalNavigators();
|
||||||
while (!InternalNavigators?.AppProperties) {
|
while (!InternalNavigators?.AppProperties) {
|
||||||
console.log('[DFL:Router]: Trying to init internal navigators again');
|
console.log('[DFL:Router]: Trying to init internal navigators again');
|
||||||
await sleep(100);
|
await sleep(2000);
|
||||||
initInternalNavigators();
|
initInternalNavigators();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -160,7 +160,7 @@ try {
|
|||||||
NavigateToAppProperties: InternalNavigators?.AppProperties || Router.NavigateToAppProperties?.bind(Router),
|
NavigateToAppProperties: InternalNavigators?.AppProperties || Router.NavigateToAppProperties?.bind(Router),
|
||||||
NavigateToExternalWeb: InternalNavigators?.ExternalWeb || Router.NavigateToExternalWeb?.bind(Router),
|
NavigateToExternalWeb: InternalNavigators?.ExternalWeb || Router.NavigateToExternalWeb?.bind(Router),
|
||||||
NavigateToInvites: InternalNavigators?.Invites || Router.NavigateToInvites?.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),
|
NavigateToLibraryTab: InternalNavigators?.LibraryTab || Router.NavigateToLibraryTab?.bind(Router),
|
||||||
NavigateToLayoutPreview: Router.NavigateToLayoutPreview?.bind(Router),
|
NavigateToLayoutPreview: Router.NavigateToLayoutPreview?.bind(Router),
|
||||||
NavigateToSteamWeb: Router.WindowStore?.GamepadUIMainWindowInstance?.NavigateToSteamWeb?.bind(
|
NavigateToSteamWeb: Router.WindowStore?.GamepadUIMainWindowInstance?.NavigateToSteamWeb?.bind(
|
||||||
|
|||||||
@@ -667,6 +667,32 @@ type MainMenuAppRunningClasses = Record<
|
|||||||
string
|
string
|
||||||
>;
|
>;
|
||||||
|
|
||||||
|
type BasicAppDetailsSectionStylerClasses = Record<
|
||||||
|
| "duration-app-launch"
|
||||||
|
| "headerPadding"
|
||||||
|
| "Header"
|
||||||
|
| "AppDetailsContent"
|
||||||
|
| "AppDetailsContainer"
|
||||||
|
| "AppDetailsRoot"
|
||||||
|
| "GameInfoContainer"
|
||||||
|
| "GameInfoQuickLinks"
|
||||||
|
| "GameInfoCollections"
|
||||||
|
| "CollectionsHeader"
|
||||||
|
| "PlaySection"
|
||||||
|
| "ActionRow"
|
||||||
|
| "AppDetailSectionList"
|
||||||
|
| "AppActionButton"
|
||||||
|
| "ActionButtonAndStatusPanel"
|
||||||
|
| "AppButtons"
|
||||||
|
| "InvertFocusedIcon"
|
||||||
|
| "DeckVerifiedFeedbackContainer"
|
||||||
|
| "DeckVerifiedFeedbackConfirmationContainer"
|
||||||
|
| "DeckVerifiedFeedbackButton"
|
||||||
|
| "DeckVerifiedFeedbackQuestion"
|
||||||
|
| "DeckVerifiedFeedbackConfirmation",
|
||||||
|
string
|
||||||
|
>;
|
||||||
|
|
||||||
export const quickAccessMenuClasses: QuickAccessMenuClasses = findModule(
|
export const quickAccessMenuClasses: QuickAccessMenuClasses = findModule(
|
||||||
(mod) => typeof mod === 'object' && mod?.Title?.includes('quickaccessmenu'),
|
(mod) => typeof mod === 'object' && mod?.Title?.includes('quickaccessmenu'),
|
||||||
);
|
);
|
||||||
@@ -716,4 +742,7 @@ export const achievementClasses: AchievementClasses = findModule(
|
|||||||
);
|
);
|
||||||
export const mainMenuAppRunningClasses: MainMenuAppRunningClasses = findModule(
|
export const mainMenuAppRunningClasses: MainMenuAppRunningClasses = findModule(
|
||||||
(mod) => typeof mod === 'object' && mod?.MainMenuAppRunning?.includes('mainmenuapprunning')
|
(mod) => typeof mod === 'object' && mod?.MainMenuAppRunning?.includes('mainmenuapprunning')
|
||||||
);
|
);
|
||||||
|
export const basicAppDetailsSectionStylerClasses: BasicAppDetailsSectionStylerClasses = findModule(
|
||||||
|
(mod) => typeof mod === 'object' && mod?.AppDetailsRoot?.includes('basicappdetailssectionstyler_')
|
||||||
|
);
|
||||||
|
|||||||
@@ -58,13 +58,25 @@ export function wrapReactClass(node: any, prop: any = 'type') {
|
|||||||
return node[prop];
|
return node[prop];
|
||||||
} else {
|
} else {
|
||||||
const cls = node[prop];
|
const cls = node[prop];
|
||||||
const wrappedCls = class extends cls { static __DECKY_WRAPPED = true; };
|
const wrappedCls = class extends cls {
|
||||||
|
static __DECKY_WRAPPED = true;
|
||||||
|
};
|
||||||
return (node[prop] = wrappedCls);
|
return (node[prop] = wrappedCls);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function getReactRoot(o: HTMLElement | Element | Node) {
|
||||||
|
return (
|
||||||
|
o[Object.keys(o).find((k) => k.startsWith('__reactContainer$')) as string] ||
|
||||||
|
o['_reactRootContainer']?._internalRoot?.current
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
export function getReactInstance(o: HTMLElement | Element | Node) {
|
export function getReactInstance(o: HTMLElement | Element | Node) {
|
||||||
return o[Object.keys(o).find((k) => k.startsWith('__reactInternalInstance')) as string];
|
return (
|
||||||
|
o[Object.keys(o).find((k) => k.startsWith('__reactFiber')) as string] ||
|
||||||
|
o[Object.keys(o).find((k) => k.startsWith('__reactInternalInstance')) as string]
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Based on https://github.com/GooseMod/GooseMod/blob/9ef146515a9e59ed4e25665ed365fd72fc0dcf23/src/util/react.js#L20
|
// Based on https://github.com/GooseMod/GooseMod/blob/9ef146515a9e59ed4e25665ed365fd72fc0dcf23/src/util/react.js#L20
|
||||||
|
|||||||
Reference in New Issue
Block a user