mirror of
https://github.com/SteamDeckHomebrew/decky-frontend-lib.git
synced 2026-06-05 09:06:56 +02:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0f2692a3f2 | ||
|
|
ebf496bf61 | ||
|
|
0a5170e412 | ||
|
|
11dd82bbb1 |
14
CHANGELOG.md
14
CHANGELOG.md
@@ -1,3 +1,17 @@
|
|||||||
|
## [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)
|
# [3.24.0](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.23.1...v3.24.0) (2023-12-03)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "decky-frontend-lib",
|
"name": "decky-frontend-lib",
|
||||||
"version": "3.24.0",
|
"version": "3.24.2",
|
||||||
"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];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -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(
|
||||||
|
|||||||
@@ -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