mirror of
https://github.com/SteamDeckHomebrew/decky-frontend-lib.git
synced 2026-05-21 10:29:00 +02:00
Compare commits
47 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d22d32677b | ||
|
|
30e319425b | ||
|
|
aebdfaa089 | ||
|
|
de914b1a35 | ||
|
|
4c4fda47e3 | ||
|
|
678084e4fd | ||
|
|
4f8f65d429 | ||
|
|
8a352d288d | ||
|
|
fd0d011cbf | ||
|
|
70219d90bc | ||
|
|
1ff9351f96 | ||
|
|
c256d341c8 | ||
|
|
c9b583945c | ||
|
|
c213204ff4 | ||
|
|
9128c1e7da | ||
|
|
a06650cf09 | ||
|
|
3170779c6b | ||
|
|
5ffa14bec8 | ||
|
|
ee51dc5fc0 | ||
|
|
b38ec17d8f | ||
|
|
8b54ee990e | ||
|
|
7e01781d40 | ||
|
|
2b31473614 | ||
|
|
8bfeae4b35 | ||
|
|
a7761321bc | ||
|
|
979a630f2b | ||
|
|
a4d1fcf086 | ||
|
|
e9e7f5c026 | ||
|
|
9a691cea09 | ||
|
|
44d9b90cdc | ||
|
|
585c3b8348 | ||
|
|
1287493b63 | ||
|
|
bf01a0184b | ||
|
|
fb5f043ba9 | ||
|
|
26f2c92dce | ||
|
|
01e53d4c13 | ||
|
|
18d341f82a | ||
|
|
3ca8c43a54 | ||
|
|
99353467ad | ||
|
|
b093ce93ba | ||
|
|
74a7cbaf94 | ||
|
|
8fb35e3c09 | ||
|
|
5d5cb31638 | ||
|
|
21f1e5f0af | ||
|
|
0fa43701a9 | ||
|
|
4d52eaea12 | ||
|
|
7e1182a83f |
116
CHANGELOG.md
116
CHANGELOG.md
@@ -1,3 +1,119 @@
|
|||||||
|
# [3.23.0](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.22.1...v3.23.0) (2023-10-11)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **static-classes:** add more css classes ([#94](https://github.com/SteamDeckHomebrew/decky-frontend-lib/issues/94)) ([30e3194](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/30e319425bd4b0ee481dd7bd3245dacd90806afb))
|
||||||
|
|
||||||
|
## [3.22.1](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.22.0...v3.22.1) (2023-10-10)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **useQuickAccessVisible:** use the "Page Visibility API" instead of focus/blur ([4c4fda4](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/4c4fda47e3d9fd936b493c5965634a0ff443014f))
|
||||||
|
|
||||||
|
# [3.22.0](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.21.8...v3.22.0) (2023-08-09)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* add patch indicator to prevent crashes ([3170779](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/3170779c6b3d02ea17f7b6c1fbd57e00498ffe4f))
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* add components found while working on tabmaster ([4f8f65d](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/4f8f65d42979149cc80b4a86545d3d0d9bf14bf3))
|
||||||
|
* add components found while working on tabmaster ([fd0d011](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/fd0d011cbf05790c5a1078970b5be72f9267402c))
|
||||||
|
|
||||||
|
## [3.21.8](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.21.7...v3.21.8) (2023-06-27)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* the typescript compiler was eating the enum ([c9b5839](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/c9b583945c1cb5267b41a821743590a841572abe))
|
||||||
|
|
||||||
|
## [3.21.7](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.21.6...v3.21.7) (2023-06-26)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* add patch indicator to prevent crashes ([#88](https://github.com/SteamDeckHomebrew/decky-frontend-lib/issues/88)) ([9128c1e](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/9128c1e7dadb98a8926d3dba9907a01cc78d90cf))
|
||||||
|
|
||||||
|
## [3.21.6](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.21.5...v3.21.6) (2023-06-22)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* reposition parameter for file picker V2 ([ee51dc5](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/ee51dc5fc0dd5bdc2b0b9e10aa27607fbe51f491))
|
||||||
|
|
||||||
|
## [3.21.5](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.21.4...v3.21.5) (2023-06-22)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* missing parameter ([8b54ee9](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/8b54ee990ee4d9b51174737979c35ab7ad92ed7a))
|
||||||
|
|
||||||
|
## [3.21.4](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.21.3...v3.21.4) (2023-06-22)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* move the new file picker api as v2 ([8bfeae4](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/8bfeae4b3593b2efa0aa075a0d9e0b5926cdf169))
|
||||||
|
|
||||||
|
## [3.21.3](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.21.2...v3.21.3) (2023-06-22)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* total is not needed as a return value to plugins ([979a630](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/979a630f2b02ac4a1ac19e38002244f9dfe97177))
|
||||||
|
|
||||||
|
## [3.21.2](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.21.1...v3.21.2) (2023-06-18)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **SidebarNavigation:** allow ReactNode for page title ([44d9b90](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/44d9b90cdcfb9e6441fdb1e4b21fe844f1f29fd5))
|
||||||
|
|
||||||
|
## [3.21.1](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.21.0...v3.21.1) (2023-05-28)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **reorderable-list:** open label type from string to ReactNode ([fb5f043](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/fb5f043ba9eeed0209960c8ae4ae597c2831b8c8))
|
||||||
|
|
||||||
|
# [3.21.0](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.20.7...v3.21.0) (2023-05-19)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **Utils:** return null when SP not found ([18d341f](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/18d341f82acf843ff830d1bf3d44678f3f2eda52))
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **StaticClasses:** add new GamepadUI classes ([3ca8c43](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/3ca8c43a542b1049c4e203ad186e555401fbfbfe))
|
||||||
|
|
||||||
|
## [3.20.7](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.20.6...v3.20.7) (2023-05-10)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **decky:** fix decky on latest beta ([74a7cba](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/74a7cbaf94538c68a01f5fa707935c4d21570c5f))
|
||||||
|
|
||||||
|
## [3.20.6](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.20.5...v3.20.6) (2023-04-29)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **QuickAccessTab:** set decky tab ID to 999 ([5d5cb31](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/5d5cb31638070deae9970a93c587b447d5e56559))
|
||||||
|
|
||||||
|
## [3.20.5](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.20.4...v3.20.5) (2023-04-04)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* reorderable list no longer toggles on backout ([7e1182a](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/7e1182a83f7fafbec6fe115a72f8b64b71c119a4))
|
||||||
|
|
||||||
## [3.20.4](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.20.3...v3.20.4) (2023-04-04)
|
## [3.20.4](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.20.3...v3.20.4) (2023-04-04)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
|
|
||||||
Library used to develop plugins used for use with [decky-loader](https://github.com/SteamDeckHomebrew/decky-loader).
|
Library used to develop plugins used for use with [decky-loader](https://github.com/SteamDeckHomebrew/decky-loader).
|
||||||
|
|
||||||
## Decky Loader Discord [](https://discord.gg/ZU74G2NJzk)
|
## Decky Loader Discord [](https://deckbrew.xyz/discord)
|
||||||
|
|
||||||
Please contact the developers here for questions and support that cannot be addressed via a Github issue.
|
Please [contact the developers here](https://deckbrew.xyz/discord) for questions and support that cannot be addressed via a Github issue.
|
||||||
|
|
||||||
## Developers and Contributors
|
## Developers and Contributors
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "decky-frontend-lib",
|
"name": "decky-frontend-lib",
|
||||||
"version": "3.20.4",
|
"version": "3.23.0",
|
||||||
"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,4 +1,4 @@
|
|||||||
import { Fragment, JSXElementConstructor, ReactElement, useEffect, useState } from 'react';
|
import { Fragment, JSXElementConstructor, ReactElement, ReactNode, useEffect, useState } from 'react';
|
||||||
|
|
||||||
import { Field, FieldProps, Focusable, GamepadButton } from '../deck-components';
|
import { Field, FieldProps, Focusable, GamepadButton } from '../deck-components';
|
||||||
|
|
||||||
@@ -9,7 +9,7 @@ import { Field, FieldProps, Focusable, GamepadButton } from '../deck-components'
|
|||||||
* @param position The position of this entry in the list.
|
* @param position The position of this entry in the list.
|
||||||
*/
|
*/
|
||||||
export type ReorderableEntry<T> = {
|
export type ReorderableEntry<T> = {
|
||||||
label: string;
|
label: ReactNode;
|
||||||
data?: T;
|
data?: T;
|
||||||
position: number;
|
position: number;
|
||||||
};
|
};
|
||||||
@@ -54,8 +54,9 @@ export function ReorderableList<T>(props: ReorderableListProps<T>) {
|
|||||||
|
|
||||||
function saveOnBackout(e: Event) {
|
function saveOnBackout(e: Event) {
|
||||||
const event = e as CustomEvent;
|
const event = e as CustomEvent;
|
||||||
if (event.detail.button == GamepadButton.CANCEL) {
|
if (event.detail.button == GamepadButton.CANCEL && reorderEnabled) {
|
||||||
toggleReorderEnabled();
|
setReorderEnabled(!reorderEnabled);
|
||||||
|
props.onSave(entryList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,14 +9,7 @@ function getQuickAccessWindow(): Window | null {
|
|||||||
/**
|
/**
|
||||||
* Returns state indicating the visibility of quick access menu.
|
* Returns state indicating the visibility of quick access menu.
|
||||||
*
|
*
|
||||||
* @remarks
|
* @returns `true` if quick access menu is visible and `false` otherwise.
|
||||||
* During development it is possible to open the quick access menu without giving it
|
|
||||||
* focus in some cases. In such cases, the quick access menu state is invisible.
|
|
||||||
*
|
|
||||||
* This seems to be impossible to replicate when running the deck normally. Even in
|
|
||||||
* the edge cases it always seems to have a focus.
|
|
||||||
*
|
|
||||||
* @returns `true` if quick access menu is visible (focused) and `false` otherwise.
|
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* import { VFC, useEffect } from "react";
|
* import { VFC, useEffect } from "react";
|
||||||
@@ -44,7 +37,10 @@ function getQuickAccessWindow(): Window | null {
|
|||||||
* };
|
* };
|
||||||
*/
|
*/
|
||||||
export function useQuickAccessVisible(): boolean {
|
export function useQuickAccessVisible(): boolean {
|
||||||
const [isVisible, setIsVisible] = useState(getQuickAccessWindow()?.document.hasFocus() ?? true);
|
// By default we say that document is not hidden, unless we know otherwise.
|
||||||
|
// This would cover the cases when Valve breaks something and the quick access window
|
||||||
|
// cannot be accessed anymore - the plugins that use this would continue working somewhat.
|
||||||
|
const [isHidden, setIsHidden] = useState(getQuickAccessWindow()?.document.hidden ?? false);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const quickAccessWindow = getQuickAccessWindow();
|
const quickAccessWindow = getQuickAccessWindow();
|
||||||
@@ -53,16 +49,12 @@ export function useQuickAccessVisible(): boolean {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const onBlur = () => setIsVisible(false);
|
const onVisibilityChange = () => setIsHidden(quickAccessWindow.document.hidden);
|
||||||
const onFocus = () => setIsVisible(true);
|
quickAccessWindow.addEventListener('visibilitychange', onVisibilityChange);
|
||||||
|
|
||||||
quickAccessWindow.addEventListener('blur', onBlur);
|
|
||||||
quickAccessWindow.addEventListener('focus', onFocus);
|
|
||||||
return () => {
|
return () => {
|
||||||
quickAccessWindow.removeEventListener('blur', onBlur);
|
quickAccessWindow.removeEventListener('visibilitychange', onVisibilityChange);
|
||||||
quickAccessWindow.removeEventListener('focus', onFocus);
|
|
||||||
};
|
};
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return isVisible;
|
return !isHidden;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,8 +41,8 @@ export const MenuGroup: FC<MenuGroupProps> = findModuleChild((m) => {
|
|||||||
|
|
||||||
for (let prop in m) {
|
for (let prop in m) {
|
||||||
if (
|
if (
|
||||||
(m[prop]?.toString()?.includes('bInGamepadUI:') &&
|
(m[prop]?.toString()?.includes?.('bInGamepadUI:') &&
|
||||||
fakeRenderComponent(() => m[prop]())?.type?.prototype?.RenderSubMenu) ||
|
fakeRenderComponent(() => m[prop]({overview: {appid: 7}}))?.type?.prototype?.RenderSubMenu) ||
|
||||||
(m[prop]?.prototype?.RenderSubMenu && m[prop]?.prototype?.ShowSubMenu)
|
(m[prop]?.prototype?.RenderSubMenu && m[prop]?.prototype?.ShowSubMenu)
|
||||||
) {
|
) {
|
||||||
return m[prop];
|
return m[prop];
|
||||||
|
|||||||
@@ -154,3 +154,16 @@ export const ModalRoot = (Object.values(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
})) as FC<ModalRootProps>;
|
})) as FC<ModalRootProps>;
|
||||||
|
|
||||||
|
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;
|
||||||
|
})
|
||||||
|
|
||||||
|
export const SimpleModal = ModalModule.SimpleModal as FC<SimpleModalProps>
|
||||||
|
export const ModalPosition = ModalModule.ModalPosition as FC<SimpleModalProps>
|
||||||
@@ -2,6 +2,11 @@ import { FC, ReactNode } from 'react';
|
|||||||
|
|
||||||
import { findModuleChild } from '../webpack';
|
import { findModuleChild } from '../webpack';
|
||||||
|
|
||||||
|
export const Panel: FC<{ children?: ReactNode; }> = findModuleChild((mod) => {
|
||||||
|
if (typeof mod !== 'object' || !mod.__esModule) return undefined;
|
||||||
|
return mod.Panel;
|
||||||
|
})
|
||||||
|
|
||||||
export interface PanelSectionProps {
|
export interface PanelSectionProps {
|
||||||
title?: string;
|
title?: string;
|
||||||
spinner?: boolean;
|
spinner?: boolean;
|
||||||
|
|||||||
@@ -15,7 +15,8 @@ export enum QuickAccessTab {
|
|||||||
Settings,
|
Settings,
|
||||||
Perf,
|
Perf,
|
||||||
Help,
|
Help,
|
||||||
Decky,
|
Music,
|
||||||
|
Decky = 999,
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum DisplayStatus {
|
export enum DisplayStatus {
|
||||||
|
|||||||
14
src/deck-components/Scroll.tsx
Normal file
14
src/deck-components/Scroll.tsx
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
import { FC, ReactNode } from "react";
|
||||||
|
import { findModuleChild, findModule } from "../webpack";
|
||||||
|
|
||||||
|
const ScrollingModule = findModule((mod) => {
|
||||||
|
if (typeof mod !== 'object' || !mod.__esModule) return undefined;
|
||||||
|
if (mod.ScrollPanel) return mod;
|
||||||
|
});
|
||||||
|
|
||||||
|
export const ScrollPanel: FC<{ children?: ReactNode; }> = ScrollingModule.ScrollPanel;
|
||||||
|
|
||||||
|
export const ScrollPanelGroup: FC<{ children?: ReactNode; }> = findModuleChild((mod) => {
|
||||||
|
if (typeof mod !== 'object' || !mod.__esModule) return undefined;
|
||||||
|
return mod.ScrollPanelGroup;
|
||||||
|
})
|
||||||
@@ -3,7 +3,7 @@ import { ReactNode, VFC } from 'react';
|
|||||||
import { Module, findModuleChild } from '../webpack';
|
import { Module, findModuleChild } from '../webpack';
|
||||||
|
|
||||||
export interface SidebarNavigationPage {
|
export interface SidebarNavigationPage {
|
||||||
title: string;
|
title: ReactNode;
|
||||||
content: ReactNode;
|
content: ReactNode;
|
||||||
icon?: ReactNode;
|
icon?: ReactNode;
|
||||||
visible?: boolean;
|
visible?: boolean;
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ export * from './TextField';
|
|||||||
export * from './Toggle';
|
export * from './Toggle';
|
||||||
export * from './ToggleField';
|
export * from './ToggleField';
|
||||||
export * from './SteamClient';
|
export * from './SteamClient';
|
||||||
|
export * from './Scroll';
|
||||||
|
|
||||||
import { AppDetails, LogoPosition, SteamAppOverview, SteamClient } from './SteamClient';
|
import { AppDetails, LogoPosition, SteamAppOverview, SteamClient } from './SteamClient';
|
||||||
|
|
||||||
|
|||||||
@@ -441,6 +441,232 @@ type AppDetailsClasses = Record<
|
|||||||
string
|
string
|
||||||
>;
|
>;
|
||||||
|
|
||||||
|
type GamepadUIClasses = Record<
|
||||||
|
| 'duration-app-launch'
|
||||||
|
| 'TransitionMenuDelay'
|
||||||
|
| 'PanelSection'
|
||||||
|
| 'PanelSectionTitle'
|
||||||
|
| 'Text'
|
||||||
|
| 'PanelSectionRow'
|
||||||
|
| 'Label'
|
||||||
|
| 'ComingSoon'
|
||||||
|
| 'LowBattery'
|
||||||
|
| 'ReallyLow'
|
||||||
|
| 'LowBatteryGauge'
|
||||||
|
| 'Remaining'
|
||||||
|
| 'EmptyNotifications'
|
||||||
|
| 'BatterySectionContainer'
|
||||||
|
| 'BatteryIcon'
|
||||||
|
| 'BatteryPercentageLabel'
|
||||||
|
| 'BatteryDetailsLabels'
|
||||||
|
| 'BatteryProjectedValue'
|
||||||
|
| 'BatteryProjectedLabel'
|
||||||
|
| 'ViewPlaceholder'
|
||||||
|
| 'FullHeight'
|
||||||
|
| 'Title'
|
||||||
|
| 'Container'
|
||||||
|
| 'Open'
|
||||||
|
| 'QuickAccessMenu'
|
||||||
|
| 'HeaderContainer'
|
||||||
|
| 'Menu'
|
||||||
|
| 'HeaderAndFooterVisible'
|
||||||
|
| 'TabContentColumn'
|
||||||
|
| 'Tabs'
|
||||||
|
| 'Tab'
|
||||||
|
| 'Selected'
|
||||||
|
| 'ItemFocusAnim-darkerGrey'
|
||||||
|
| 'ItemFocusAnim-darkerGrey-nocolor'
|
||||||
|
| 'VoiceTab'
|
||||||
|
| 'ItemFocusAnim-green'
|
||||||
|
| 'Blocked'
|
||||||
|
| 'TabPanelHidden'
|
||||||
|
| 'FriendsTitle'
|
||||||
|
| 'FriendsListTabPanel'
|
||||||
|
| 'PanelOuterNav'
|
||||||
|
| 'PanelExitAnchor'
|
||||||
|
| 'TabGroupPanel'
|
||||||
|
| 'FooterBoxShadow'
|
||||||
|
| 'AllTabContents'
|
||||||
|
| 'ContentTransition'
|
||||||
|
| 'ActiveTab'
|
||||||
|
| 'Up'
|
||||||
|
| 'Enter'
|
||||||
|
| 'EnterActive'
|
||||||
|
| 'Exit'
|
||||||
|
| 'ExitActive'
|
||||||
|
| 'Down'
|
||||||
|
| 'KeyboardButton'
|
||||||
|
| 'ItemFocusAnim-darkGrey'
|
||||||
|
| 'ItemFocusAnim-grey'
|
||||||
|
| 'ItemFocusAnimBorder-darkGrey'
|
||||||
|
| 'focusAnimation'
|
||||||
|
| 'hoverAnimation',
|
||||||
|
string
|
||||||
|
>;
|
||||||
|
|
||||||
|
type GamepadTabbedPageClasses = Record<
|
||||||
|
| 'duration-app-launch'
|
||||||
|
| 'headerHeight'
|
||||||
|
| 'contentPadding'
|
||||||
|
| 'GamepadTabbedPage'
|
||||||
|
| 'TabHeaderRowWrapper'
|
||||||
|
| 'Floating'
|
||||||
|
| 'TabRow'
|
||||||
|
| 'TabRowTabs'
|
||||||
|
| 'BleedGlyphs'
|
||||||
|
| 'TabsRowScroll'
|
||||||
|
| 'FixCenterAlignScroll'
|
||||||
|
| 'Tab'
|
||||||
|
| 'Selected'
|
||||||
|
| 'HasAddon'
|
||||||
|
| 'RightAddon'
|
||||||
|
| 'TabTitle'
|
||||||
|
| 'LeftAddon'
|
||||||
|
| 'TabCount'
|
||||||
|
| 'Active'
|
||||||
|
| 'TabBadge'
|
||||||
|
| 'TabCountBadge'
|
||||||
|
| 'TabRowSpacer'
|
||||||
|
| 'Glyphs'
|
||||||
|
| 'Show'
|
||||||
|
| 'TabContents'
|
||||||
|
| 'ContentTransition'
|
||||||
|
| 'TabContentsScroll'
|
||||||
|
| 'Right'
|
||||||
|
| 'Enter'
|
||||||
|
| 'EnterActive'
|
||||||
|
| 'Exit'
|
||||||
|
| 'ExitActive'
|
||||||
|
| 'Left'
|
||||||
|
| 'TabIcon',
|
||||||
|
string
|
||||||
|
>;
|
||||||
|
|
||||||
|
type GamepadContextMenuClasses = Record<
|
||||||
|
| "duration-app-launch"
|
||||||
|
| "BasicContextMenuModal"
|
||||||
|
| "BasicContextMenuHeader"
|
||||||
|
| "BasicContextMenuHeaderShrinkableSpacing"
|
||||||
|
| "BasicContextMenuContainer"
|
||||||
|
| "slideInAnimation"
|
||||||
|
| "contextMenu"
|
||||||
|
| "contextMenuContents"
|
||||||
|
| "hasSubMenu"
|
||||||
|
| "contextMenuFade"
|
||||||
|
| "contextMenuItem"
|
||||||
|
| "active"
|
||||||
|
| "Selected"
|
||||||
|
| "Focused"
|
||||||
|
| "Positive"
|
||||||
|
| "Emphasis"
|
||||||
|
| "Destructive"
|
||||||
|
| "Capitalized"
|
||||||
|
| "MenuSectionHeader"
|
||||||
|
| "UpperCase"
|
||||||
|
| "SubMenu"
|
||||||
|
| "ContextMenuSeparator"
|
||||||
|
| "Label"
|
||||||
|
| "Arrow"
|
||||||
|
| "ItemFocusAnim-darkerGrey-nocolor"
|
||||||
|
| "ItemFocusAnim-darkerGrey"
|
||||||
|
| "ItemFocusAnim-darkGrey"
|
||||||
|
| "ItemFocusAnim-grey"
|
||||||
|
| "ItemFocusAnimBorder-darkGrey"
|
||||||
|
| "ItemFocusAnim-green"
|
||||||
|
| "focusAnimation"
|
||||||
|
| "hoverAnimation",
|
||||||
|
string
|
||||||
|
>;
|
||||||
|
|
||||||
|
type AchievementClasses = Record<
|
||||||
|
| "nAchievementHeight"
|
||||||
|
| "nGlobalAchievementHeight"
|
||||||
|
| "nAchievementsListTitleHeight"
|
||||||
|
| "nAchievementGap"
|
||||||
|
| "AchievementList"
|
||||||
|
| "ListTitle"
|
||||||
|
| "AchievementListItemBase"
|
||||||
|
| "Container"
|
||||||
|
| "Content"
|
||||||
|
| "Right"
|
||||||
|
| "Footer"
|
||||||
|
| "AchievementTitle"
|
||||||
|
| "AchievementDescription"
|
||||||
|
| "AchievementGlobalPercentage"
|
||||||
|
| "InBody"
|
||||||
|
| "VerticalContent"
|
||||||
|
| "UnlockDate"
|
||||||
|
| "AlignEnd"
|
||||||
|
| "ProgressBar"
|
||||||
|
| "ProgressCount"
|
||||||
|
| "AchievementContent"
|
||||||
|
| "HiddenAchievementContent"
|
||||||
|
| "FriendAchievementFooter"
|
||||||
|
| "GlobalPercentage"
|
||||||
|
| "UserUnlockDateTime"
|
||||||
|
| "GlobalAchievementsListHeader"
|
||||||
|
| "SearchField"
|
||||||
|
| "Avatar"
|
||||||
|
| "HeaderText"
|
||||||
|
| "GlobalAchievementListItem"
|
||||||
|
| "UnlockContainer"
|
||||||
|
| "Info"
|
||||||
|
| "Title"
|
||||||
|
| "Description"
|
||||||
|
| "Percent"
|
||||||
|
| "ImageContainer"
|
||||||
|
| "ProgressFill"
|
||||||
|
| "SpoilerWarning"
|
||||||
|
| "Hidden"
|
||||||
|
| "ComparisonAchieverColumn"
|
||||||
|
| "ComparisonAchieverInfo"
|
||||||
|
| "ProgressContainer"
|
||||||
|
| "ProgressLabel"
|
||||||
|
| "Secondary"
|
||||||
|
| "AvatarContainer"
|
||||||
|
| "Unachieved",
|
||||||
|
string
|
||||||
|
>;
|
||||||
|
|
||||||
|
type MainMenuAppRunningClasses = Record<
|
||||||
|
| "duration-app-launch"
|
||||||
|
| "ScrollMask"
|
||||||
|
| "HideMask"
|
||||||
|
| "MainMenuAppRunning"
|
||||||
|
| "MenuOpen"
|
||||||
|
| "NavigationColumn"
|
||||||
|
| "ControllerColumnFocused"
|
||||||
|
| "NavColumnFocused"
|
||||||
|
| "NavigationBox"
|
||||||
|
| "NavigationMenuItem"
|
||||||
|
| "ItemFocusAnim-darkerGrey"
|
||||||
|
| "Active"
|
||||||
|
| "Disabled"
|
||||||
|
| "SwitchAppsTitle"
|
||||||
|
| "SelectableAppWindow"
|
||||||
|
| "ActiveDot"
|
||||||
|
| "NavigationMenuItemSeparator"
|
||||||
|
| "AppColumn"
|
||||||
|
| "FocusedColumn"
|
||||||
|
| "AppColumnContent"
|
||||||
|
| "ActiveContent"
|
||||||
|
| "CurrentGameBackground"
|
||||||
|
| "CurrentGameLogo"
|
||||||
|
| "OverlayAchievements"
|
||||||
|
| "Container"
|
||||||
|
| "OverlayGuides"
|
||||||
|
| "OverlayNotes"
|
||||||
|
| "OverlayInplaceBrowser"
|
||||||
|
| "ItemFocusAnim-darkerGrey-nocolor"
|
||||||
|
| "ItemFocusAnim-darkGrey"
|
||||||
|
| "ItemFocusAnim-grey"
|
||||||
|
| "ItemFocusAnimBorder-darkGrey"
|
||||||
|
| "ItemFocusAnim-green"
|
||||||
|
| "focusAnimation"
|
||||||
|
| "hoverAnimation",
|
||||||
|
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'),
|
||||||
);
|
);
|
||||||
@@ -459,7 +685,7 @@ export const gamepadDialogClasses: GamepadDialogClasses = findModule(
|
|||||||
(mod) => typeof mod === 'object' && mod?.GamepadDialogContent?.includes('gamepaddialog'),
|
(mod) => typeof mod === 'object' && mod?.GamepadDialogContent?.includes('gamepaddialog'),
|
||||||
);
|
);
|
||||||
export const quickAccessControlsClasses: QuickAccessControlsClasses = findModule(
|
export const quickAccessControlsClasses: QuickAccessControlsClasses = findModule(
|
||||||
(mod) => typeof mod === 'object' && mod?.PanelSection?.includes('quickaccesscontrols'),
|
(mod) => typeof mod === 'object' && typeof mod?.PanelSection === 'string' && mod?.PanelSection?.includes('quickaccesscontrols'),
|
||||||
);
|
);
|
||||||
export const updaterFieldClasses: UpdaterFieldClasses = findModule(
|
export const updaterFieldClasses: UpdaterFieldClasses = findModule(
|
||||||
(mod) => typeof mod === 'object' && mod?.OOBEUpdateStatusContainer?.includes('updaterfield'),
|
(mod) => typeof mod === 'object' && mod?.OOBEUpdateStatusContainer?.includes('updaterfield'),
|
||||||
@@ -476,3 +702,18 @@ export const appDetailsHeaderClasses: AppDetailsHeaderClasses = findModule(
|
|||||||
export const appDetailsClasses: AppDetailsClasses = findModule(
|
export const appDetailsClasses: AppDetailsClasses = findModule(
|
||||||
(mod) => typeof mod === 'object' && mod?.HeaderLoaded?.includes('appdetails_'),
|
(mod) => typeof mod === 'object' && mod?.HeaderLoaded?.includes('appdetails_'),
|
||||||
);
|
);
|
||||||
|
export const gamepadUIClasses: GamepadUIClasses = findModule(
|
||||||
|
(mod) => typeof mod === 'object' && mod?.BasicUiRoot?.includes('gamepadui_'),
|
||||||
|
);
|
||||||
|
export const gamepadTabbedPageClasses: GamepadTabbedPageClasses = findModule(
|
||||||
|
(mod) => typeof mod === 'object' && mod?.GamepadTabbedPage?.includes('gamepadtabbedpage_')
|
||||||
|
);
|
||||||
|
export const gamepadContextMenuClasses: GamepadContextMenuClasses = findModule(
|
||||||
|
(mod) => typeof mod === 'object' && mod?.BasicContextMenuModal?.includes('gamepadcontextmenu')
|
||||||
|
);
|
||||||
|
export const achievementClasses: AchievementClasses = findModule(
|
||||||
|
(mod) => typeof mod === 'object' && mod?.AchievementListItemBase?.includes('achievementslist')
|
||||||
|
);
|
||||||
|
export const mainMenuAppRunningClasses: MainMenuAppRunningClasses = findModule(
|
||||||
|
(mod) => typeof mod === 'object' && mod?.MainMenuAppRunning?.includes('mainmenuapprunning')
|
||||||
|
);
|
||||||
@@ -57,10 +57,26 @@ export interface FilePickerRes {
|
|||||||
realpath: string;
|
realpath: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const enum FileSelectionType {
|
||||||
|
FILE,
|
||||||
|
FOLDER,
|
||||||
|
}
|
||||||
|
|
||||||
export interface ServerAPI {
|
export interface ServerAPI {
|
||||||
routerHook: RouterHook;
|
routerHook: RouterHook;
|
||||||
toaster: Toaster;
|
toaster: Toaster;
|
||||||
openFilePicker(startPath: string, includeFiles?: boolean, regex?: RegExp): Promise<FilePickerRes>;
|
openFilePicker(startPath: string, includeFiles?: boolean, regex?: RegExp): Promise<FilePickerRes>;
|
||||||
|
openFilePickerV2(
|
||||||
|
select: FileSelectionType,
|
||||||
|
startPath: string,
|
||||||
|
includeFiles?: boolean,
|
||||||
|
includeFolders?: boolean,
|
||||||
|
filter?: RegExp | ((file: File) => boolean),
|
||||||
|
extensions?: string[],
|
||||||
|
showHiddenFiles?: boolean,
|
||||||
|
allowAllFiles?: boolean,
|
||||||
|
max?: number,
|
||||||
|
): Promise<FilePickerRes>;
|
||||||
callPluginMethod<TArgs = {}, TRes = {}>(methodName: string, args: TArgs): Promise<ServerResponse<TRes>>;
|
callPluginMethod<TArgs = {}, TRes = {}>(methodName: string, args: TArgs): Promise<ServerResponse<TRes>>;
|
||||||
callServerMethod<TArgs = {}, TRes = {}>(methodName: string, args: TArgs): Promise<ServerResponse<TRes>>;
|
callServerMethod<TArgs = {}, TRes = {}>(methodName: string, args: TArgs): Promise<ServerResponse<TRes>>;
|
||||||
fetchNoCors<TRes = {}>(url: RequestInfo, request?: RequestInit): Promise<ServerResponse<TRes>>;
|
fetchNoCors<TRes = {}>(url: RequestInfo, request?: RequestInit): Promise<ServerResponse<TRes>>;
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ export function findSP(): Window {
|
|||||||
if (document.title == 'SP') return window;
|
if (document.title == 'SP') return window;
|
||||||
// new (SP as popup)
|
// new (SP as popup)
|
||||||
const navTrees = getGamepadNavigationTrees();
|
const navTrees = getGamepadNavigationTrees();
|
||||||
return navTrees.find((x: any) => x.m_ID == 'root_1_').Root.Element.ownerDocument.defaultView;
|
return navTrees?.find((x: any) => x.m_ID == 'root_1_').Root.Element.ownerDocument.defaultView;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -38,5 +38,5 @@ export function getFocusNavController(): any {
|
|||||||
export function getGamepadNavigationTrees(): any {
|
export function getGamepadNavigationTrees(): any {
|
||||||
const focusNav = getFocusNavController();
|
const focusNav = getFocusNavController();
|
||||||
const context = focusNav.m_ActiveContext || focusNav.m_LastActiveContext;
|
const context = focusNav.m_ActiveContext || focusNav.m_LastActiveContext;
|
||||||
return context.m_rgGamepadNavigationTrees;
|
return context?.m_rgGamepadNavigationTrees;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,13 +46,21 @@ export function fakeRenderComponent(fun: Function, customHooks: any = {}): any {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function wrapReactType(node: any, prop: any = 'type') {
|
export function wrapReactType(node: any, prop: any = 'type') {
|
||||||
return (node[prop] = { ...node[prop] });
|
if (node[prop]?.__DECKY_WRAPPED) {
|
||||||
|
return node[prop];
|
||||||
|
} else {
|
||||||
|
return (node[prop] = { ...node[prop], __DECKY_WRAPPED: true });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function wrapReactClass(node: any, prop: any = 'type') {
|
export function wrapReactClass(node: any, prop: any = 'type') {
|
||||||
const cls = node[prop];
|
if (node[prop]?.__DECKY_WRAPPED) {
|
||||||
const wrappedCls = class extends cls {};
|
return node[prop];
|
||||||
return (node[prop] = wrappedCls);
|
} else {
|
||||||
|
const cls = node[prop];
|
||||||
|
const wrappedCls = class extends cls { static __DECKY_WRAPPED = true; };
|
||||||
|
return (node[prop] = wrappedCls);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getReactInstance(o: HTMLElement | Element | Node) {
|
export function getReactInstance(o: HTMLElement | Element | Node) {
|
||||||
|
|||||||
Reference in New Issue
Block a user