mirror of
https://github.com/SteamDeckHomebrew/decky-frontend-lib.git
synced 2026-05-21 02:19:12 +02:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5aad952936 | ||
|
|
c2b0fad298 |
@@ -1,3 +1,10 @@
|
||||
## [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)
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "decky-frontend-lib",
|
||||
"version": "3.24.4",
|
||||
"version": "3.24.5",
|
||||
"description": "A library for building decky plugins",
|
||||
"main": "dist/index.js",
|
||||
"types": "dist/index.d.ts",
|
||||
|
||||
@@ -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>;
|
||||
|
||||
@@ -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];
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user