mirror of
https://github.com/SteamDeckHomebrew/decky-frontend-lib.git
synced 2026-05-23 19:38:50 +02:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5aad952936 | ||
|
|
c2b0fad298 | ||
|
|
4d4cfedfe0 | ||
|
|
bb12921863 | ||
|
|
223739af25 | ||
|
|
95d977df45 |
21
CHANGELOG.md
21
CHANGELOG.md
@@ -1,3 +1,24 @@
|
|||||||
|
## [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)
|
## [3.24.2](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.24.1...v3.24.2) (2024-01-20)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "decky-frontend-lib",
|
"name": "decky-frontend-lib",
|
||||||
"version": "3.24.2",
|
"version": "3.24.5",
|
||||||
"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",
|
||||||
|
|||||||
@@ -8,9 +8,9 @@ export interface ButtonItemProps extends ItemProps {
|
|||||||
disabled?: boolean;
|
disabled?: boolean;
|
||||||
}
|
}
|
||||||
export const ButtonItem =
|
export const ButtonItem =
|
||||||
CommonUIModule.ButtonField ||
|
(CommonUIModule.ButtonField ||
|
||||||
(Object.values(CommonUIModule).find(
|
Object.values(CommonUIModule).find(
|
||||||
(mod: any) =>
|
(mod: any) =>
|
||||||
mod?.render?.toString()?.includes('"highlightOnFocus","childrenContainerWidth"') ||
|
mod?.render?.toString()?.includes('"highlightOnFocus","childrenContainerWidth"') ||
|
||||||
mod?.render?.toString()?.includes('childrenContainerWidth:"min"'),
|
mod?.render?.toString()?.includes('childrenContainerWidth:"min"'),
|
||||||
) as FC<ButtonItemProps>);
|
)) as FC<ButtonItemProps>;
|
||||||
|
|||||||
@@ -155,15 +155,32 @@ export const ModalRoot = (Object.values(
|
|||||||
}
|
}
|
||||||
})) as FC<ModalRootProps>;
|
})) as FC<ModalRootProps>;
|
||||||
|
|
||||||
interface SimpleModalProps{
|
interface SimpleModalProps {
|
||||||
active?: boolean,
|
active?: boolean;
|
||||||
children: ReactNode
|
children: ReactNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
const ModalModule = findModule((mod) => {
|
const ModalModule = findModule((mod: any) => {
|
||||||
if (typeof mod !== 'object' || !mod.__esModule) return undefined;
|
if (typeof mod !== 'object') return false;
|
||||||
if (mod.SimpleModal && mod.ModalPosition) return mod;
|
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>
|
const ModalModuleProps = ModalModule ? Object.values(ModalModule) : [];
|
||||||
export const ModalPosition = ModalModule.ModalPosition as FC<SimpleModalProps>
|
|
||||||
|
|
||||||
|
// 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
|
// New as of Feb 22 2023 Beta || Old
|
||||||
export const PanelSectionRow =
|
export const PanelSectionRow =
|
||||||
mod.PanelSectionRow ||
|
(mod.PanelSectionRow ||
|
||||||
(Object.values(mod).filter((exp: any) => !exp?.toString()?.includes('.PanelSection'))[0] as FC<PanelSectionRowProps>);
|
Object.values(mod).filter((exp: any) => !exp?.toString()?.includes('.PanelSection'))[0]) as FC<PanelSectionRowProps>;
|
||||||
|
|||||||
@@ -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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,14 +1,22 @@
|
|||||||
import { FC, ReactNode } from "react";
|
import { FC, ReactNode } from 'react';
|
||||||
import { findModuleChild, findModule } from "../webpack";
|
|
||||||
|
import { findModule, findModuleChild } from '../webpack';
|
||||||
|
|
||||||
const ScrollingModule = findModule((mod) => {
|
const ScrollingModule = findModule((mod) => {
|
||||||
if (typeof mod !== 'object' || !mod.__esModule) return undefined;
|
if (typeof mod !== 'object') return false;
|
||||||
if (mod.ScrollPanel) return mod;
|
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) => {
|
export const ScrollPanel = ScrollingModuleProps.find((prop: any) => prop?.render?.toString?.().includes("{case\"x\":")) as FC<{ children?: ReactNode }>;
|
||||||
if (typeof mod !== 'object' || !mod.__esModule) return undefined;
|
|
||||||
return mod.ScrollPanelGroup;
|
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.
|
* Unlike other components in `decky-frontend-lib`, this requires Decky Loader to be running.
|
||||||
*/
|
*/
|
||||||
export const Tabs =
|
export const Tabs =
|
||||||
oldTabs ||
|
(oldTabs ||
|
||||||
(((props: TabsProps) => {
|
((props: TabsProps) => {
|
||||||
const found = tabsComponent;
|
const found = tabsComponent;
|
||||||
const [tc, setTC] = useState<FC<TabsProps>>(found);
|
const [tc, setTC] = useState<FC<TabsProps>>(found);
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -131,4 +131,4 @@ export const Tabs =
|
|||||||
}, []);
|
}, []);
|
||||||
console.log('tc', tc);
|
console.log('tc', tc);
|
||||||
return tc ? createElement(tc, props) : <SteamSpinner />;
|
return tc ? createElement(tc, props) : <SteamSpinner />;
|
||||||
}) as FC<TabsProps>);
|
})) as FC<TabsProps>;
|
||||||
|
|||||||
Reference in New Issue
Block a user