mirror of
https://github.com/SteamDeckHomebrew/decky-frontend-lib.git
synced 2026-05-21 10:29:00 +02:00
Compare commits
54 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4c2a715324 | ||
|
|
678ba216f1 | ||
|
|
07d15f5dca | ||
|
|
c84a091469 | ||
|
|
47fd13692f | ||
|
|
2ec9519b7d | ||
|
|
24606190e0 | ||
|
|
ed98d14b37 | ||
|
|
b882612dfa | ||
|
|
32291620b4 | ||
|
|
9b368c5f11 | ||
|
|
e167ef5a13 | ||
|
|
2f3df00967 | ||
|
|
215156d316 | ||
|
|
47d75db690 | ||
|
|
82768e0415 | ||
|
|
e44187fe4b | ||
|
|
72af32436e | ||
|
|
e1f64a38de | ||
|
|
82ed48761d | ||
|
|
a81c342d2a | ||
|
|
68d630262d | ||
|
|
0bb8c67cfa | ||
|
|
edd29e6c5a | ||
|
|
0ed054fae9 | ||
|
|
0d912eac88 | ||
|
|
789e16380f | ||
|
|
88b50bbc1e | ||
|
|
75f35882f2 | ||
|
|
23af4c0bb4 | ||
|
|
a074277bb5 | ||
|
|
9c72a55aff | ||
|
|
92ffc76075 | ||
|
|
fb49d64fd3 | ||
|
|
cfef1dc320 | ||
|
|
f6b4d6b254 | ||
|
|
0010a1fcee | ||
|
|
28cbc1cfe1 | ||
|
|
fe75dfb5f4 | ||
|
|
91c386a6cc | ||
|
|
bedb6b8bb9 | ||
|
|
ce3860f73b | ||
|
|
d8b10a2133 | ||
|
|
1581304dcb | ||
|
|
60ddf474e0 | ||
|
|
52ae328e2e | ||
|
|
aa0fad2ecf | ||
|
|
dab9071d1e | ||
|
|
189a90ba31 | ||
|
|
8509ae8f9a | ||
|
|
a6ebfdcd7d | ||
|
|
5f7655baaf | ||
|
|
bca2dcc9bd | ||
|
|
546a4da043 |
4
.github/workflows/release.yaml
vendored
4
.github/workflows/release.yaml
vendored
@@ -1,6 +1,7 @@
|
|||||||
name: Release
|
name: Release
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
pull_request:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
@@ -20,9 +21,12 @@ jobs:
|
|||||||
node-version: 16
|
node-version: 16
|
||||||
- name: Setup | Dependencies
|
- name: Setup | Dependencies
|
||||||
run: npm i -g pnpm && pnpm i --frozen-lockfile
|
run: npm i -g pnpm && pnpm i --frozen-lockfile
|
||||||
|
- name: Build
|
||||||
|
run: pnpm run build
|
||||||
- name: Test
|
- name: Test
|
||||||
run: pnpm run test
|
run: pnpm run test
|
||||||
- name: Release
|
- name: Release
|
||||||
|
if: github.event_name != 'pull_request'
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||||
|
|||||||
120
CHANGELOG.md
120
CHANGELOG.md
@@ -1,3 +1,123 @@
|
|||||||
|
# [3.13.0](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.12.0...v3.13.0) (2022-11-29)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **Menu:** add more missing props ([#60](https://github.com/SteamDeckHomebrew/decky-frontend-lib/issues/60)) [CI SKIP] ([678ba21](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/678ba216f1e194986b0c391398e6f73536cd0102))
|
||||||
|
|
||||||
|
# [3.12.0](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.11.1...v3.12.0) (2022-11-28)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **MenuItem:** add missing props ([#59](https://github.com/SteamDeckHomebrew/decky-frontend-lib/issues/59)) ([c84a091](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/c84a09146935f0942265b7a1e4aadc40e8cf22dc))
|
||||||
|
|
||||||
|
## [3.11.1](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.11.0...v3.11.1) (2022-11-20)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **Footer:** add types for ActionDescriptionMap ([2ec9519](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/2ec9519b7d6d1cc0d232853ce05a773953b37c5a))
|
||||||
|
|
||||||
|
# [3.11.0](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.10.0...v3.11.0) (2022-11-18)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **classes:** add "appDetailsClasses" ([#55](https://github.com/SteamDeckHomebrew/decky-frontend-lib/issues/55)) ([ed98d14](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/ed98d14b37cf09500afd88e7c8e9c03749119b38))
|
||||||
|
|
||||||
|
# [3.10.0](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.9.0...v3.10.0) (2022-11-18)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **classes:** add appDetailsHeaderClasses ([#54](https://github.com/SteamDeckHomebrew/decky-frontend-lib/issues/54)) ([3229162](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/32291620b403f8b65cf378343454a3f2668fb6ee))
|
||||||
|
|
||||||
|
# [3.9.0](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.8.0...v3.9.0) (2022-11-16)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **Dialog:** add "focusable" button prop ([#51](https://github.com/SteamDeckHomebrew/decky-frontend-lib/issues/51)) ([e167ef5](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/e167ef5a138a3edc004db2365334f8455c177132))
|
||||||
|
|
||||||
|
# [3.8.0](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.7.14...v3.8.0) (2022-11-11)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **routerhook:** add global components support ([215156d](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/215156d31688faac9028627379e5a3ac4d64ec46))
|
||||||
|
|
||||||
|
## [3.7.14](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.7.13...v3.7.14) (2022-11-05)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **Menu:** fix on Steam beta ([82768e0](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/82768e0415d084deb2af39beb3f9273a83e819de))
|
||||||
|
* **Modal:** fix on Steam beta ([e44187f](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/e44187fe4b9d3e3c9e94490669591599dc5246ba))
|
||||||
|
|
||||||
|
## [3.7.13](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.7.12...v3.7.13) (2022-11-02)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **useQuickAccessVisible:** make it work in beta ([#49](https://github.com/SteamDeckHomebrew/decky-frontend-lib/issues/49)) ([e1f64a3](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/e1f64a38de85073e5cea74ecea4b9cde9a783ecc))
|
||||||
|
|
||||||
|
## [3.7.12](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.7.11...v3.7.12) (2022-10-29)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **Item:** change title and description types to ReactNode ([0ed054f](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/0ed054fae972ffd36299b142bd693f80388480a6))
|
||||||
|
|
||||||
|
## [3.7.11](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.7.10...v3.7.11) (2022-10-28)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **package.json:** train wtf ([789e163](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/789e16380fd01a6b46188c7a1174a55c18c8dead))
|
||||||
|
|
||||||
|
## [3.7.10](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.7.9...v3.7.10) (2022-10-28)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **tabs:** shut up typescript ([75f3588](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/75f35882f27252e1255208953a6e801c68d5dcec))
|
||||||
|
|
||||||
|
## [3.7.9](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.7.8...v3.7.9) (2022-10-28)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **tabs:** fix on stable for real this time i think ([a074277](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/a074277bb58428a64295154ebf96aceb96e654a7))
|
||||||
|
|
||||||
|
## [3.7.8](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.7.7...v3.7.8) (2022-10-26)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **Field:** fix this time for real ([#44](https://github.com/SteamDeckHomebrew/decky-frontend-lib/issues/44)) ([cfef1dc](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/cfef1dc320a5f649d66c3af365cd6aa2d88e46ea))
|
||||||
|
|
||||||
|
## [3.7.7](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.7.6...v3.7.7) (2022-10-26)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **Field:** remove incompatible properties ([#42](https://github.com/SteamDeckHomebrew/decky-frontend-lib/issues/42)) ([0010a1f](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/0010a1fceedc417aa25b709d066341da97d42444))
|
||||||
|
|
||||||
|
## [3.7.6](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.7.5...v3.7.6) (2022-10-26)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **Field:** add override for onClick type ([#43](https://github.com/SteamDeckHomebrew/decky-frontend-lib/issues/43)) ([fe75dfb](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/fe75dfb5f4fb1ec9417cc07dc714c71820945748))
|
||||||
|
|
||||||
|
## [3.7.5](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.7.4...v3.7.5) (2022-10-26)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **Field:** add types for focusing field ([#41](https://github.com/SteamDeckHomebrew/decky-frontend-lib/issues/41)) ([bedb6b8](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/bedb6b8bb90e021a60e47a93709d6f48e0bd75c6))
|
||||||
|
|
||||||
## [3.7.4](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.7.3...v3.7.4) (2022-10-26)
|
## [3.7.4](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.7.3...v3.7.4) (2022-10-26)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "decky-frontend-lib",
|
"name": "decky-frontend-lib",
|
||||||
"version": "3.7.4",
|
"version": "3.13.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",
|
||||||
@@ -10,7 +10,6 @@
|
|||||||
"build": "shx rm -rf dist && tsc -b",
|
"build": "shx rm -rf dist && tsc -b",
|
||||||
"dev": "tsc -b -w",
|
"dev": "tsc -b -w",
|
||||||
"docs": "typedoc --tsconfig ./tsconfig.json src/**/*",
|
"docs": "typedoc --tsconfig ./tsconfig.json src/**/*",
|
||||||
"prepack": "npm run build",
|
|
||||||
"test": "echo 'No tests for now!'",
|
"test": "echo 'No tests for now!'",
|
||||||
"prepare": "husky install",
|
"prepare": "husky install",
|
||||||
"commit": "git-cz"
|
"commit": "git-cz"
|
||||||
@@ -54,6 +53,7 @@
|
|||||||
"husky": "^8.0.1",
|
"husky": "^8.0.1",
|
||||||
"import-sort-style-module": "^6.0.0",
|
"import-sort-style-module": "^6.0.0",
|
||||||
"jest": "^27.5.1",
|
"jest": "^27.5.1",
|
||||||
|
"minimist": "^1.2.6",
|
||||||
"prettier": "^2.7.1",
|
"prettier": "^2.7.1",
|
||||||
"prettier-plugin-import-sort": "^0.0.7",
|
"prettier-plugin-import-sort": "^0.0.7",
|
||||||
"semantic-release": "^19.0.3",
|
"semantic-release": "^19.0.3",
|
||||||
@@ -78,8 +78,5 @@
|
|||||||
"style": "module",
|
"style": "module",
|
||||||
"parser": "typescript"
|
"parser": "typescript"
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"minimist": "^1.2.6"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
5
pnpm-lock.yaml
generated
5
pnpm-lock.yaml
generated
@@ -25,9 +25,6 @@ specifiers:
|
|||||||
typedoc-plugin-missing-exports: ^1.0.0
|
typedoc-plugin-missing-exports: ^1.0.0
|
||||||
typescript: ^4.6.3
|
typescript: ^4.6.3
|
||||||
|
|
||||||
dependencies:
|
|
||||||
minimist: 1.2.6
|
|
||||||
|
|
||||||
devDependencies:
|
devDependencies:
|
||||||
'@commitlint/cli': 17.0.2
|
'@commitlint/cli': 17.0.2
|
||||||
'@commitlint/config-conventional': 17.0.2
|
'@commitlint/config-conventional': 17.0.2
|
||||||
@@ -41,6 +38,7 @@ devDependencies:
|
|||||||
husky: 8.0.1
|
husky: 8.0.1
|
||||||
import-sort-style-module: 6.0.0
|
import-sort-style-module: 6.0.0
|
||||||
jest: 27.5.1
|
jest: 27.5.1
|
||||||
|
minimist: 1.2.6
|
||||||
prettier: 2.7.1
|
prettier: 2.7.1
|
||||||
prettier-plugin-import-sort: 0.0.7_prettier@2.7.1
|
prettier-plugin-import-sort: 0.0.7_prettier@2.7.1
|
||||||
semantic-release: 19.0.3
|
semantic-release: 19.0.3
|
||||||
@@ -3735,6 +3733,7 @@ packages:
|
|||||||
|
|
||||||
/minimist/1.2.6:
|
/minimist/1.2.6:
|
||||||
resolution: {integrity: sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==}
|
resolution: {integrity: sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==}
|
||||||
|
dev: true
|
||||||
|
|
||||||
/modify-values/1.0.1:
|
/modify-values/1.0.1:
|
||||||
resolution: {integrity: sha512-xV2bxeN6F7oYjZWTe/YPAy6MN2M+sL4u/Rlm2AHCIVGfo2p1yGmBHQ6vHehl4bRTZBdHu3TSkWdYgkwpYzAGSw==}
|
resolution: {integrity: sha512-xV2bxeN6F7oYjZWTe/YPAy6MN2M+sL4u/Rlm2AHCIVGfo2p1yGmBHQ6vHehl4bRTZBdHu3TSkWdYgkwpYzAGSw==}
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
export * from './usequickaccessvisible';
|
export * from './useQuickAccessVisible';
|
||||||
|
|||||||
@@ -4,6 +4,16 @@ declare global {
|
|||||||
var FocusNavController: any;
|
var FocusNavController: any;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getQuickAccessWindow(): Window | null {
|
||||||
|
try {
|
||||||
|
const navTrees = FocusNavController?.m_ActiveContext?.m_rgGamepadNavigationTrees || FocusNavController?.m_rgGamepadNavigationTrees;
|
||||||
|
return navTrees?.find((tree: any) => tree?.id === "QuickAccess-NA")?.m_Root?.m_element?.ownerDocument.defaultView ?? null;
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns state indicating the visibility of quick access menu.
|
* Returns state indicating the visibility of quick access menu.
|
||||||
*
|
*
|
||||||
@@ -42,12 +52,10 @@ declare global {
|
|||||||
* };
|
* };
|
||||||
*/
|
*/
|
||||||
export function useQuickAccessVisible(): boolean {
|
export function useQuickAccessVisible(): boolean {
|
||||||
// Assuming that the component is rendered in QAM already, so true by default...
|
const [isVisible, setIsVisible] = useState(getQuickAccessWindow()?.document.hasFocus() ?? true);
|
||||||
const [isVisible, setIsVisible] = useState(true);
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const quickAccessWindow: Window | null =
|
const quickAccessWindow = getQuickAccessWindow();
|
||||||
FocusNavController?.GetGamepadNavTreeByID('QuickAccess-NA')?.m_Root?.m_element?.ownerDocument.defaultView ?? null;
|
|
||||||
if (quickAccessWindow === null) {
|
if (quickAccessWindow === null) {
|
||||||
console.error('Could not get window of QuickAccess menu!');
|
console.error('Could not get window of QuickAccess menu!');
|
||||||
return;
|
return;
|
||||||
@@ -9,8 +9,35 @@ export interface DialogCommonProps extends RefAttributes<HTMLDivElement> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface DialogButtonProps extends DialogCommonProps, FooterLegendProps {
|
export interface DialogButtonProps extends DialogCommonProps, FooterLegendProps {
|
||||||
|
/**
|
||||||
|
* Enables/disables the focus around the button.
|
||||||
|
*
|
||||||
|
* @note
|
||||||
|
* Default value depends on context, so setting it to `false` will enable it.
|
||||||
|
*/
|
||||||
noFocusRing?: boolean;
|
noFocusRing?: boolean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Disables the button - assigned `on*` methods will not be invoked if clicked.
|
||||||
|
*
|
||||||
|
* @note
|
||||||
|
* Depending on where it is, it might still get focus. In such case it can be
|
||||||
|
* partially disabled separately.
|
||||||
|
*
|
||||||
|
* @see focusable.
|
||||||
|
*/
|
||||||
disabled?: boolean;
|
disabled?: boolean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enables/disables the navigation based focus on button - you won't be able to navigate to
|
||||||
|
* it via the gamepad or keyboard.
|
||||||
|
*
|
||||||
|
* @note
|
||||||
|
* If set to `false`, it still can be clicked and **WILL** become focused until navigated away.
|
||||||
|
* Depending on the context of where the button is, even a disabled button can focused.
|
||||||
|
*/
|
||||||
|
focusable?: boolean;
|
||||||
|
|
||||||
onClick?(e: MouseEvent): void;
|
onClick?(e: MouseEvent): void;
|
||||||
onPointerDown?(e: PointerEvent): void;
|
onPointerDown?(e: PointerEvent): void;
|
||||||
onPointerUp?(e: PointerEvent): void;
|
onPointerUp?(e: PointerEvent): void;
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import { FC, HTMLAttributes, ReactNode, RefAttributes } from 'react';
|
import { FC, ReactNode, RefAttributes } from 'react';
|
||||||
|
|
||||||
import { findModuleChild } from '../webpack';
|
import { findModuleChild } from '../webpack';
|
||||||
import { FooterLegendProps } from './FooterLegend';
|
import { FooterLegendProps } from './FooterLegend';
|
||||||
|
|
||||||
export interface FieldProps extends HTMLAttributes<HTMLDivElement>, FooterLegendProps {
|
export interface FieldProps extends FooterLegendProps {
|
||||||
label?: ReactNode;
|
label?: ReactNode;
|
||||||
bottomSeparator?: 'standard' | 'thick' | 'none';
|
bottomSeparator?: 'standard' | 'thick' | 'none';
|
||||||
description?: ReactNode;
|
description?: ReactNode;
|
||||||
@@ -18,6 +18,9 @@ export interface FieldProps extends HTMLAttributes<HTMLDivElement>, FooterLegend
|
|||||||
highlightOnFocus?: boolean;
|
highlightOnFocus?: boolean;
|
||||||
indentLevel?: number;
|
indentLevel?: number;
|
||||||
verticalAlignment?: 'center' | 'none'; // Alligns inline label with children
|
verticalAlignment?: 'center' | 'none'; // Alligns inline label with children
|
||||||
|
focusable?: boolean; // Allows to get focus without any focusable children or on* callbacks
|
||||||
|
onActivate?: (e: CustomEvent | MouseEvent) => void;
|
||||||
|
onClick?: (e: CustomEvent | MouseEvent) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const Field = findModuleChild((m) => {
|
export const Field = findModuleChild((m) => {
|
||||||
|
|||||||
@@ -29,25 +29,24 @@ export enum GamepadButton {
|
|||||||
STEAM_GUIDE,
|
STEAM_GUIDE,
|
||||||
STEAM_QUICK_MENU,
|
STEAM_QUICK_MENU,
|
||||||
}
|
}
|
||||||
|
export declare enum NavEntryPositionPreferences {
|
||||||
export enum NavEntryPositionPreferences {
|
|
||||||
FIRST,
|
FIRST,
|
||||||
LAST,
|
LAST,
|
||||||
MAINTAIN_X,
|
MAINTAIN_X,
|
||||||
MAINTAIN_Y,
|
MAINTAIN_Y,
|
||||||
PREFERRED_CHILD,
|
PREFERRED_CHILD
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface GamepadEventDetail {
|
export interface GamepadEventDetail {
|
||||||
button: number;
|
button: number;
|
||||||
is_repeat?: boolean;
|
is_repeat?: boolean;
|
||||||
source: number;
|
source: number;
|
||||||
}
|
}
|
||||||
|
export declare type ActionDescriptionMap = {
|
||||||
export type GamepadEvent = CustomEvent<GamepadEventDetail>;
|
[key in GamepadButton]?: string
|
||||||
|
}
|
||||||
|
export declare type GamepadEvent = CustomEvent<GamepadEventDetail>;
|
||||||
export interface FooterLegendProps {
|
export interface FooterLegendProps {
|
||||||
actionDescriptionMap?: unknown;
|
actionDescriptionMap?: ActionDescriptionMap;
|
||||||
onOKActionDescription?: string;
|
onOKActionDescription?: string;
|
||||||
onCancelActionDescription?: string;
|
onCancelActionDescription?: string;
|
||||||
onSecondaryActionDescription?: string;
|
onSecondaryActionDescription?: string;
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import { ReactNode } from 'react';
|
import { ReactNode } from 'react';
|
||||||
|
|
||||||
export interface ItemProps {
|
export interface ItemProps {
|
||||||
label?: string;
|
label?: ReactNode;
|
||||||
description?: string;
|
description?: ReactNode;
|
||||||
layout?: 'below' | 'inline';
|
layout?: 'below' | 'inline';
|
||||||
icon?: ReactNode;
|
icon?: ReactNode;
|
||||||
bottomSeparator?: 'standard' | 'thick' | 'none';
|
bottomSeparator?: 'standard' | 'thick' | 'none';
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
import { FC, ReactNode } from 'react';
|
import { FC, ReactNode } from 'react';
|
||||||
|
|
||||||
|
import { fakeRenderComponent } from '../utils';
|
||||||
import { findModuleChild } from '../webpack';
|
import { findModuleChild } from '../webpack';
|
||||||
|
import { FooterLegendProps } from './FooterLegend';
|
||||||
|
|
||||||
export const showContextMenu: (children: ReactNode, parent?: EventTarget) => void = findModuleChild((m) => {
|
export const showContextMenu: (children: ReactNode, parent?: EventTarget) => void = findModuleChild((m) => {
|
||||||
if (typeof m !== 'object') return undefined;
|
if (typeof m !== 'object') return undefined;
|
||||||
@@ -11,7 +13,7 @@ export const showContextMenu: (children: ReactNode, parent?: EventTarget) => voi
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
export interface MenuProps {
|
export interface MenuProps extends FooterLegendProps {
|
||||||
label: string;
|
label: string;
|
||||||
onCancel?(): void;
|
onCancel?(): void;
|
||||||
cancelText?: string;
|
cancelText?: string;
|
||||||
@@ -38,15 +40,26 @@ export const MenuGroup: FC<MenuGroupProps> = findModuleChild((m) => {
|
|||||||
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]?.prototype?.RenderSubMenu && m[prop]?.prototype?.ShowSubMenu) {
|
if (
|
||||||
|
(m[prop]?.toString()?.includes('bInGamepadUI:') &&
|
||||||
|
fakeRenderComponent(() => m[prop]())?.type?.prototype?.RenderSubMenu) ||
|
||||||
|
(m[prop]?.prototype?.RenderSubMenu && m[prop]?.prototype?.ShowSubMenu)
|
||||||
|
) {
|
||||||
return m[prop];
|
return m[prop];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
export interface MenuItemProps {
|
export interface MenuItemProps extends FooterLegendProps {
|
||||||
onSelected?(): void;
|
bInteractableItem?: boolean;
|
||||||
|
onClick?(evt: Event): void;
|
||||||
|
onSelected?(evt: Event): void;
|
||||||
|
onMouseEnter?(evt: MouseEvent): void;
|
||||||
|
onMoveRight?(): void;
|
||||||
|
selected?: boolean;
|
||||||
disabled?: boolean;
|
disabled?: boolean;
|
||||||
|
bPlayAudio?: boolean;
|
||||||
|
tone?: 'positive' | 'emphasis' | 'destructive';
|
||||||
children?: ReactNode;
|
children?: ReactNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -54,7 +67,10 @@ export const MenuItem: FC<MenuItemProps> = findModuleChild((m) => {
|
|||||||
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]?.prototype?.OnOKButton && m[prop]?.prototype?.OnMouseEnter) {
|
if (
|
||||||
|
m[prop]?.render?.toString()?.includes('bPlayAudio:') ||
|
||||||
|
(m[prop]?.prototype?.OnOKButton && m[prop]?.prototype?.OnMouseEnter)
|
||||||
|
) {
|
||||||
return m[prop];
|
return m[prop];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { FC, ReactNode } from 'react';
|
import { FC, ReactNode } from 'react';
|
||||||
|
|
||||||
import { findSP } from '../utils';
|
import { findSP } from '../utils';
|
||||||
import { findModuleChild } from '../webpack';
|
import { findModule, findModuleChild } from '../webpack';
|
||||||
|
|
||||||
// All of the popout options + strTitle are related. Proper usage is not yet known...
|
// All of the popout options + strTitle are related. Proper usage is not yet known...
|
||||||
export interface ShowModalProps {
|
export interface ShowModalProps {
|
||||||
@@ -29,18 +29,57 @@ export interface ShowModalResult {
|
|||||||
Update: (modal: ReactNode) => void;
|
Update: (modal: ReactNode) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
const showModalRaw: (modal: ReactNode, parent?: EventTarget, props?: ShowModalProps) => Promise<ShowModalResult> =
|
const showModalRaw:
|
||||||
findModuleChild((m) => {
|
| ((
|
||||||
if (typeof m !== 'object') return undefined;
|
modal: ReactNode,
|
||||||
for (let prop in m) {
|
parent?: EventTarget,
|
||||||
if (typeof m[prop] === 'function' && m[prop].toString().includes('bHideMainWindowForPopouts:!0')) {
|
title?: string,
|
||||||
return m[prop];
|
props?: ShowModalProps,
|
||||||
}
|
unknown1?: unknown,
|
||||||
|
hideActions?: { bHideActions?: boolean },
|
||||||
|
modalManager?: unknown,
|
||||||
|
) => Promise<ShowModalResult>)
|
||||||
|
| void = findModuleChild((m) => {
|
||||||
|
if (typeof m !== 'object') return undefined;
|
||||||
|
for (let prop in m) {
|
||||||
|
if (
|
||||||
|
typeof m[prop] === 'function' &&
|
||||||
|
m[prop].toString().includes('props.bDisableBackgroundDismiss') &&
|
||||||
|
!m[prop]?.prototype?.Cancel
|
||||||
|
) {
|
||||||
|
return m[prop];
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
|
});
|
||||||
|
|
||||||
export const showModal = (modal: ReactNode, parent?: EventTarget, props?: ShowModalProps): Promise<ShowModalResult> => {
|
const oldShowModalRaw:
|
||||||
return showModalRaw(modal, parent || findSP(), props);
|
| ((modal: ReactNode, parent?: EventTarget, props?: ShowModalProps) => Promise<ShowModalResult>)
|
||||||
|
| void = findModuleChild((m) => {
|
||||||
|
if (typeof m !== 'object') return undefined;
|
||||||
|
for (let prop in m) {
|
||||||
|
if (typeof m[prop] === 'function' && m[prop].toString().includes('bHideMainWindowForPopouts:!0')) {
|
||||||
|
return m[prop];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
export const showModal = (
|
||||||
|
modal: ReactNode,
|
||||||
|
parent?: EventTarget,
|
||||||
|
props: ShowModalProps = {
|
||||||
|
strTitle: 'Decky Dialog',
|
||||||
|
bHideMainWindowForPopouts: false,
|
||||||
|
},
|
||||||
|
): Promise<ShowModalResult> => {
|
||||||
|
if (showModalRaw) {
|
||||||
|
return showModalRaw(modal, parent || findSP(), props.strTitle, props, undefined, {
|
||||||
|
bHideActions: props.bHideActionIcons,
|
||||||
|
});
|
||||||
|
} else if (oldShowModalRaw) {
|
||||||
|
return oldShowModalRaw(modal, parent || findSP(), props);
|
||||||
|
} else {
|
||||||
|
throw new Error('[DFL:Modals]: Cannot find showModal function');
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export interface ModalRootProps {
|
export interface ModalRootProps {
|
||||||
@@ -79,11 +118,26 @@ export const ConfirmModal = findModuleChild((m) => {
|
|||||||
}
|
}
|
||||||
}) as FC<ConfirmModalProps>;
|
}) as FC<ConfirmModalProps>;
|
||||||
|
|
||||||
export const ModalRoot = findModuleChild((m) => {
|
// new
|
||||||
if (typeof m !== 'object') return undefined;
|
export const ModalRoot = (Object.values(
|
||||||
for (let prop in m) {
|
findModule((m: any) => {
|
||||||
if (m[prop]?.prototype?.OK && m[prop]?.prototype?.Cancel && m[prop]?.prototype?.render) {
|
if (typeof m !== 'object') return false;
|
||||||
return m[prop];
|
|
||||||
|
for (let prop in m) {
|
||||||
|
if (m[prop]?.toString()?.includes('"ModalManager","DialogWrapper"')) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}) as FC<ModalRootProps>;
|
return false;
|
||||||
|
}) || {},
|
||||||
|
)?.find((x: any) => x?.type?.toString()?.includes('((function(){')) ||
|
||||||
|
// old
|
||||||
|
findModuleChild((m) => {
|
||||||
|
if (typeof m !== 'object') return undefined;
|
||||||
|
for (let prop in m) {
|
||||||
|
if (m[prop]?.prototype?.OK && m[prop]?.prototype?.Cancel && m[prop]?.prototype?.render) {
|
||||||
|
return m[prop];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})) as FC<ModalRootProps>;
|
||||||
|
|||||||
300
src/deck-components/SteamClient.ts
Normal file
300
src/deck-components/SteamClient.ts
Normal file
@@ -0,0 +1,300 @@
|
|||||||
|
export interface Apps {
|
||||||
|
RegisterForAppOverviewChanges: any;
|
||||||
|
RegisterForAppDetails: any;
|
||||||
|
RegisterForLocalizationChanges: any;
|
||||||
|
RegisterForWorkshopChanges: any;
|
||||||
|
RegisterForWorkshopItemDownloads: any;
|
||||||
|
GetLibraryBootstrapData: any;
|
||||||
|
RegisterForAchievementChanges: any;
|
||||||
|
GetFriendAchievementsForApp: any;
|
||||||
|
GetMyAchievementsForApp: any;
|
||||||
|
AddUserTagToApps: any;
|
||||||
|
RemoveUserTagFromApps: any;
|
||||||
|
ClearUserTagsOnApps: any;
|
||||||
|
ClearAndSetUserTagsOnApp: any;
|
||||||
|
SetAppHidden: any;
|
||||||
|
ResetHiddenState: any;
|
||||||
|
SetAppLaunchOptions: any;
|
||||||
|
SetAppResolutionOverride: any;
|
||||||
|
SetAppCurrentLanguage: any;
|
||||||
|
SetAppAutoUpdateBehavior: any;
|
||||||
|
SetAppBackgroundDownloadsBehavior: any;
|
||||||
|
ToggleAppFamilyBlockedState: any;
|
||||||
|
ToggleAppSteamCloudEnabled: any;
|
||||||
|
ToggleAppSteamCloudSyncOnSuspendEnabled: any;
|
||||||
|
ToggleOverrideResolutionForInternalDisplay: any;
|
||||||
|
ToggleEnableSteamOverlayForApp: any;
|
||||||
|
ToggleEnableDesktopTheatreForApp: any;
|
||||||
|
BrowseLocalFilesForApp: any;
|
||||||
|
BrowseScreenshotsForApp: any;
|
||||||
|
BrowseScreenshotForApp: any;
|
||||||
|
BackupFilesForApp: any;
|
||||||
|
VerifyFilesForApp: any;
|
||||||
|
CreateDesktopShortcutForApp: any;
|
||||||
|
JoinAppContentBeta: any;
|
||||||
|
JoinAppContentBetaByPassword: any;
|
||||||
|
GetAchievementsInTimeRange: any;
|
||||||
|
GetSubscribedWorkshopItems: any;
|
||||||
|
SubscribeWorkshopItem: any;
|
||||||
|
GetDownloadedWorkshopItems: any;
|
||||||
|
DownloadWorkshopItem: any;
|
||||||
|
SetLocalScreenshotCaption: any;
|
||||||
|
SetLocalScreenshotSpoiler: any;
|
||||||
|
GetDetailsForScreenshotUpload: any;
|
||||||
|
UploadLocalScreenshot: any;
|
||||||
|
DeleteLocalScreenshot: any;
|
||||||
|
GetScreenshotsInTimeRange: any;
|
||||||
|
GetFriendsWhoPlay: any;
|
||||||
|
RequestLegacyCDKeysForApp: any;
|
||||||
|
GetSoundtrackDetails: any;
|
||||||
|
GetStoreTagLocalization: any;
|
||||||
|
GetLaunchOptionsForApp: any;
|
||||||
|
GetResolutionOverrideForApp: any;
|
||||||
|
ScanForShortcuts: any;
|
||||||
|
GetAllShortcuts: any;
|
||||||
|
GetShortcutData: any;
|
||||||
|
AddShortcut: any;
|
||||||
|
RemoveShortcut: any;
|
||||||
|
InstallFlatpakAppAndCreateShortcut: any;
|
||||||
|
ListFlatpakApps: any;
|
||||||
|
UninstallFlatpakApp: any;
|
||||||
|
ShowControllerConfigurator: any;
|
||||||
|
SetThirdPartyControllerConfiguration: any;
|
||||||
|
ToggleAllowDesktopConfiguration: any;
|
||||||
|
SetControllerRumblePreference: any;
|
||||||
|
GetCachedAppDetails: any;
|
||||||
|
SetCachedAppDetails: any;
|
||||||
|
ReportLibraryAssetCacheMiss: any;
|
||||||
|
SaveAchievementProgressCache: any;
|
||||||
|
SetStreamingClientForApp: any;
|
||||||
|
SetCustomArtworkForApp: any;
|
||||||
|
ClearCustomArtworkForApp: any;
|
||||||
|
SetCustomLogoPositionForApp: any;
|
||||||
|
ClearCustomLogoPositionForApp: any;
|
||||||
|
RequestIconDataForApp: any;
|
||||||
|
SpecifyCompatTool: any;
|
||||||
|
GetAvailableCompatTools: any;
|
||||||
|
SetShortcutName: any;
|
||||||
|
SetShortcutExe: any;
|
||||||
|
SetShortcutStartDir: any;
|
||||||
|
SetShortcutLaunchOptions: any;
|
||||||
|
SetShortcutIsVR: any;
|
||||||
|
PromptToChangeShortcut: any;
|
||||||
|
PromptToSelectShortcutIcon: any;
|
||||||
|
InstallApp: any;
|
||||||
|
RunGame: any;
|
||||||
|
VerifyApp: any;
|
||||||
|
StreamGame: any;
|
||||||
|
CancelLaunch: any;
|
||||||
|
TerminateApp: any;
|
||||||
|
UninstallApps: any;
|
||||||
|
ShowStore: any;
|
||||||
|
SetDLCEnabled: any;
|
||||||
|
ContinueGameAction: any;
|
||||||
|
CancelGameAction: any;
|
||||||
|
GetActiveGameActions: any;
|
||||||
|
GetGameActionDetails: any;
|
||||||
|
GetGameActionForApp: any;
|
||||||
|
SkipShaderProcessing: any;
|
||||||
|
MarkEulaAccepted: any;
|
||||||
|
MarkEulaRejected: any;
|
||||||
|
LoadEula: any;
|
||||||
|
GetConflictingFileTimestamps: any;
|
||||||
|
GetCloudPendingRemoteOperations: any;
|
||||||
|
ClearProton: any;
|
||||||
|
RegisterForMarketingMessages: any;
|
||||||
|
FetchMarketingMessages: any;
|
||||||
|
MarkMarketingMessageSeen: any;
|
||||||
|
ReportMarketingMessageSeen: any;
|
||||||
|
RegisterForGameActionStart: any;
|
||||||
|
RegisterForGameActionEnd: any;
|
||||||
|
RegisterForGameActionTaskChange: any;
|
||||||
|
RegisterForGameActionUserRequest: any;
|
||||||
|
RegisterForGameActionShowError: any;
|
||||||
|
RegisterForGameActionShowUI: any;
|
||||||
|
OpenAppSettingsDialog: any;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface Window {
|
||||||
|
RegisterForExternalDisplayChanged: any;
|
||||||
|
SetManualDisplayScaleFactor: any;
|
||||||
|
SetAutoDisplayScale: any;
|
||||||
|
Minimize: any;
|
||||||
|
ProcessShuttingDown: any;
|
||||||
|
ToggleMaximize: any;
|
||||||
|
MoveTo: any;
|
||||||
|
ResizeTo: any;
|
||||||
|
SetMinSize: any;
|
||||||
|
SetResizeGrip: any;
|
||||||
|
SetComposition: any;
|
||||||
|
GamescopeBlur: any;
|
||||||
|
BringToFront: any;
|
||||||
|
SetForegroundWindow: any;
|
||||||
|
SetKeyFocus: any;
|
||||||
|
FlashWindow: any;
|
||||||
|
StopFlashWindow: any;
|
||||||
|
ShowWindow: any;
|
||||||
|
HideWindow: any;
|
||||||
|
SetWindowIcon: any;
|
||||||
|
GetWindowDimensions: any;
|
||||||
|
GetWindowRestoreDetails: any;
|
||||||
|
PositionWindowRelative: any;
|
||||||
|
GetMousePositionDetails: any;
|
||||||
|
IsWindowMinimized: any;
|
||||||
|
GetBrowserID: any;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface SteamClient {
|
||||||
|
Apps: Apps;
|
||||||
|
Browser: any;
|
||||||
|
BrowserView: any;
|
||||||
|
ClientNotifications: any;
|
||||||
|
Cloud: any;
|
||||||
|
Console: any;
|
||||||
|
Downloads: any;
|
||||||
|
FamilySharing: any;
|
||||||
|
FriendSettings: any;
|
||||||
|
Friends: any;
|
||||||
|
GameSessions: any;
|
||||||
|
Input: any;
|
||||||
|
InstallFolder: any;
|
||||||
|
Installs: any;
|
||||||
|
MachineStorage: any;
|
||||||
|
Messaging: any;
|
||||||
|
Notifications: any;
|
||||||
|
OpenVR: any;
|
||||||
|
Overlay: any;
|
||||||
|
Parental: any;
|
||||||
|
RegisterIFrameNavigatedCallback: any;
|
||||||
|
RemotePlay: any;
|
||||||
|
RoamingStorage: any;
|
||||||
|
Screenshots: any;
|
||||||
|
Settings: any;
|
||||||
|
SharedConnection: any;
|
||||||
|
Stats: any;
|
||||||
|
Storage: any;
|
||||||
|
Streaming: any;
|
||||||
|
System: any;
|
||||||
|
UI: any;
|
||||||
|
URL: any;
|
||||||
|
Updates: any;
|
||||||
|
User: any;
|
||||||
|
WebChat: any;
|
||||||
|
Window: Window;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface SteamShortcut {
|
||||||
|
appid: number;
|
||||||
|
data: {
|
||||||
|
bIsApplication: boolean;
|
||||||
|
strAppName: string;
|
||||||
|
strExePath: string;
|
||||||
|
strArguments: string;
|
||||||
|
strShortcutPath: string;
|
||||||
|
strSortAs: string;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @prop unAppID is not properly set by Steam for non-steam game shortcuts, so it defaults to 0 for them
|
||||||
|
*/
|
||||||
|
export interface LifetimeNotification {
|
||||||
|
unAppID: number;
|
||||||
|
nInstanceID: number;
|
||||||
|
bRunning: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export type AppAchievements = {
|
||||||
|
nAchieved: number;
|
||||||
|
nTotal: number;
|
||||||
|
vecAchievedHidden: any[];
|
||||||
|
vecHighlight: any[];
|
||||||
|
vecUnachieved: any[];
|
||||||
|
};
|
||||||
|
|
||||||
|
export type AppLanguages = {
|
||||||
|
strDisplayName: string;
|
||||||
|
strShortName: string;
|
||||||
|
};
|
||||||
|
|
||||||
|
export interface AppDetails {
|
||||||
|
achievements: AppAchievements;
|
||||||
|
bCanMoveInstallFolder: boolean;
|
||||||
|
bCloudAvailable: boolean;
|
||||||
|
bCloudEnabledForAccount: boolean;
|
||||||
|
bCloudEnabledForApp: boolean;
|
||||||
|
bCloudSyncOnSuspendAvailable: boolean;
|
||||||
|
bCloudSyncOnSuspendEnabled: boolean;
|
||||||
|
bCommunityMarketPresence: boolean;
|
||||||
|
bEnableAllowDesktopConfiguration: boolean;
|
||||||
|
bFreeRemovableLicense: boolean;
|
||||||
|
bHasAllLegacyCDKeys: boolean;
|
||||||
|
bHasAnyLocalContent: boolean;
|
||||||
|
bHasLockedPrivateBetas: boolean;
|
||||||
|
bIsExcludedFromSharing: boolean;
|
||||||
|
bIsSubscribedTo: boolean;
|
||||||
|
bOverlayEnabled: boolean;
|
||||||
|
bOverrideInternalResolution: boolean;
|
||||||
|
bRequiresLegacyCDKey: boolean;
|
||||||
|
bShortcutIsVR: boolean;
|
||||||
|
bShowCDKeyInMenus: boolean;
|
||||||
|
bShowControllerConfig: boolean;
|
||||||
|
bSupportsCDKeyCopyToClipboard: boolean;
|
||||||
|
bVRGameTheatreEnabled: boolean;
|
||||||
|
bWorkshopVisible: boolean;
|
||||||
|
eAppOwnershipFlags: number;
|
||||||
|
eAutoUpdateValue: number;
|
||||||
|
eBackgroundDownloads: number;
|
||||||
|
eCloudSync: number;
|
||||||
|
eControllerRumblePreference: number;
|
||||||
|
eDisplayStatus: number;
|
||||||
|
eEnableThirdPartyControllerConfiguration: number;
|
||||||
|
eSteamInputControllerMask: number;
|
||||||
|
iInstallFolder: number;
|
||||||
|
lDiskUsageBytes: number;
|
||||||
|
lDlcUsageBytes: number;
|
||||||
|
nBuildID: number;
|
||||||
|
nCompatToolPriority: number;
|
||||||
|
nPlaytimeForever: number;
|
||||||
|
nScreenshots: number;
|
||||||
|
rtLastTimePlayed: number;
|
||||||
|
rtLastUpdated: number;
|
||||||
|
rtPurchased: number;
|
||||||
|
selectedLanguage: {
|
||||||
|
strDisplayName: string;
|
||||||
|
strShortName: string;
|
||||||
|
};
|
||||||
|
strCloudBytesAvailable: string;
|
||||||
|
strCloudBytesUsed: string;
|
||||||
|
strCompatToolDisplayName: string;
|
||||||
|
strCompatToolName: string;
|
||||||
|
strDeveloperName: string;
|
||||||
|
strDeveloperURL: string;
|
||||||
|
strDisplayName: string;
|
||||||
|
strExternalSubscriptionURL: string;
|
||||||
|
strFlatpakAppID: string;
|
||||||
|
strHomepageURL: string;
|
||||||
|
strLaunchOptions: string;
|
||||||
|
strManualURL: string;
|
||||||
|
strOwnerSteamID: string;
|
||||||
|
strResolutionOverride: string;
|
||||||
|
strSelectedBeta: string;
|
||||||
|
strShortcutExe: string;
|
||||||
|
strShortcutLaunchOptions: string;
|
||||||
|
strShortcutStartDir: string;
|
||||||
|
strSteamDeckBlogURL: string;
|
||||||
|
unAppID: number;
|
||||||
|
vecBetas: any[];
|
||||||
|
vecDLC: any[];
|
||||||
|
vecDeckCompatTestResults: any[];
|
||||||
|
vecLanguages: AppLanguages[];
|
||||||
|
vecLegacyCDKeys: any[];
|
||||||
|
vecMusicAlbums: any[];
|
||||||
|
vecPlatforms: string[];
|
||||||
|
vecScreenShots: any[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface SteamAppOverview {
|
||||||
|
display_name: string;
|
||||||
|
gameid: string;
|
||||||
|
}
|
||||||
@@ -65,16 +65,11 @@ export interface TabsProps {
|
|||||||
autoFocusContents?: boolean;
|
autoFocusContents?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
declare global {
|
|
||||||
interface Window {
|
|
||||||
DeckyPluginLoader: any;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
let tabsComponent: any;
|
let tabsComponent: any;
|
||||||
|
|
||||||
const getTabs = async () => {
|
const getTabs = async () => {
|
||||||
if (tabsComponent) return tabsComponent;
|
if (tabsComponent) return tabsComponent;
|
||||||
|
// @ts-ignore
|
||||||
while (!window?.DeckyPluginLoader?.routerHook?.routes) {
|
while (!window?.DeckyPluginLoader?.routerHook?.routes) {
|
||||||
console.debug('[DFL:Tabs]: Waiting for Decky router...');
|
console.debug('[DFL:Tabs]: Waiting for Decky router...');
|
||||||
await sleep(500);
|
await sleep(500);
|
||||||
@@ -83,6 +78,7 @@ const getTabs = async () => {
|
|||||||
() => {
|
() => {
|
||||||
return findInReactTree(
|
return findInReactTree(
|
||||||
findInReactTree(
|
findInReactTree(
|
||||||
|
// @ts-ignore
|
||||||
window.DeckyPluginLoader.routerHook.routes
|
window.DeckyPluginLoader.routerHook.routes
|
||||||
.find((x: any) => x.props.path == '/library/app/:appid/achievements')
|
.find((x: any) => x.props.path == '/library/app/:appid/achievements')
|
||||||
.props.children.type(),
|
.props.children.type(),
|
||||||
@@ -109,27 +105,30 @@ try {
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
if (oldTabsModule) oldTabs = Object.values(oldTabsModule).find((x: any) => x?.type?.toString()?.includes("((function(") && x?.type?.toString()?.includes("[\"tabs\""));
|
if (oldTabsModule)
|
||||||
|
oldTabs = Object.values(oldTabsModule).find((x: any) => x?.type?.toString()?.includes('((function(){'));
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error("Error finding oldTabs:", e)
|
console.error('Error finding oldTabs:', e);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 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 = oldTabs || ((props: TabsProps) => {
|
export const Tabs =
|
||||||
const found = tabsComponent;
|
oldTabs ||
|
||||||
const [tc, setTC] = useState<FC<TabsProps>>(found);
|
(((props: TabsProps) => {
|
||||||
useEffect(() => {
|
const found = tabsComponent;
|
||||||
if (found) return;
|
const [tc, setTC] = useState<FC<TabsProps>>(found);
|
||||||
(async () => {
|
useEffect(() => {
|
||||||
console.debug('[DFL:Tabs]: Finding component...');
|
if (found) return;
|
||||||
const t = await getTabs();
|
(async () => {
|
||||||
console.debug('[DFL:Tabs]: Found!');
|
console.debug('[DFL:Tabs]: Finding component...');
|
||||||
setTC(t);
|
const t = await getTabs();
|
||||||
})();
|
console.debug('[DFL:Tabs]: Found!');
|
||||||
}, []);
|
setTC(t);
|
||||||
console.log('tc', tc);
|
})();
|
||||||
return tc ? createElement(tc, props) : <SteamSpinner />;
|
}, []);
|
||||||
}) as FC<TabsProps>;
|
console.log('tc', tc);
|
||||||
|
return tc ? createElement(tc, props) : <SteamSpinner />;
|
||||||
|
}) as FC<TabsProps>);
|
||||||
|
|||||||
@@ -21,3 +21,10 @@ export * from './Tabs';
|
|||||||
export * from './TextField';
|
export * from './TextField';
|
||||||
export * from './Toggle';
|
export * from './Toggle';
|
||||||
export * from './ToggleField';
|
export * from './ToggleField';
|
||||||
|
export * from './SteamClient';
|
||||||
|
|
||||||
|
import {SteamClient} from './SteamClient'
|
||||||
|
|
||||||
|
declare global {
|
||||||
|
var SteamClient: SteamClient;
|
||||||
|
}
|
||||||
|
|||||||
@@ -349,6 +349,98 @@ type GamepadSliderClasses = Record<
|
|||||||
string
|
string
|
||||||
>;
|
>;
|
||||||
|
|
||||||
|
type AppDetailsHeaderClasses = Record<
|
||||||
|
| 'AddBoxSizer'
|
||||||
|
| 'Background'
|
||||||
|
| 'Bottom'
|
||||||
|
| 'BottomCenter'
|
||||||
|
| 'BottomLeft'
|
||||||
|
| 'BottomRight'
|
||||||
|
| 'BoxSizer'
|
||||||
|
| 'BoxSizerButtonContainer'
|
||||||
|
| 'BoxSizerContainer'
|
||||||
|
| 'BoxSizerDelete'
|
||||||
|
| 'BoxSizerDragBox'
|
||||||
|
| 'BoxSizerEdge'
|
||||||
|
| 'BoxSizerGridBox'
|
||||||
|
| 'BoxSizerInfo'
|
||||||
|
| 'BoxSizerSettings'
|
||||||
|
| 'BoxSizerValidRegion'
|
||||||
|
| 'CenterCenter'
|
||||||
|
| 'DialogButton'
|
||||||
|
| 'EdgeDown'
|
||||||
|
| 'FallbackArt'
|
||||||
|
| 'Features'
|
||||||
|
| 'FullscreenEnterActive'
|
||||||
|
| 'FullscreenEnterDone'
|
||||||
|
| 'FullscreenEnterStart'
|
||||||
|
| 'FullscreenExitActive'
|
||||||
|
| 'FullscreenExitDone'
|
||||||
|
| 'FullscreenExitStart'
|
||||||
|
| 'HeaderBackgroundImage'
|
||||||
|
| 'ImgBlur'
|
||||||
|
| 'ImgBlurBackdrop'
|
||||||
|
| 'ImgContainer'
|
||||||
|
| 'ImgSrc'
|
||||||
|
| 'Left'
|
||||||
|
| 'Loaded'
|
||||||
|
| 'Middle'
|
||||||
|
| 'NoArt'
|
||||||
|
| 'PinBox'
|
||||||
|
| 'Right'
|
||||||
|
| 'SVGTitle'
|
||||||
|
| 'SaveBoxSizer'
|
||||||
|
| 'TextNameSpace'
|
||||||
|
| 'TitleImageContainer'
|
||||||
|
| 'TitleLogo'
|
||||||
|
| 'TitleSection'
|
||||||
|
| 'Top'
|
||||||
|
| 'TopCapsule'
|
||||||
|
| 'TopGradient'
|
||||||
|
| 'TopLeft'
|
||||||
|
| 'TopRight'
|
||||||
|
| 'UpperCenter'
|
||||||
|
| 'UpperLeft'
|
||||||
|
| 'duration-app-launch',
|
||||||
|
string
|
||||||
|
>;
|
||||||
|
|
||||||
|
type AppDetailsClasses = Record<
|
||||||
|
| 'BreakNarrow'
|
||||||
|
| 'BreakShort'
|
||||||
|
| 'BreakTall'
|
||||||
|
| 'BreakUltraWide'
|
||||||
|
| 'BreakWide'
|
||||||
|
| 'Container'
|
||||||
|
| 'GamepadUIBreakNarrow'
|
||||||
|
| 'GamepadUIBreakShort'
|
||||||
|
| 'GamepadUIBreakWide'
|
||||||
|
| 'Glassy'
|
||||||
|
| 'Header'
|
||||||
|
| 'HeaderLoaded'
|
||||||
|
| 'InnerContainer'
|
||||||
|
| 'ItemFocusAnim-darkGrey'
|
||||||
|
| 'ItemFocusAnim-darkerGrey'
|
||||||
|
| 'ItemFocusAnim-darkerGrey-nocolor'
|
||||||
|
| 'ItemFocusAnim-green'
|
||||||
|
| 'ItemFocusAnim-grey'
|
||||||
|
| 'ItemFocusAnimBorder-darkGrey'
|
||||||
|
| 'PlayBar'
|
||||||
|
| 'PreventScrolling'
|
||||||
|
| 'RightBreakNarrow'
|
||||||
|
| 'RightBreakUltraNarrow'
|
||||||
|
| 'RightBreakUltraWide'
|
||||||
|
| 'RightBreakWide'
|
||||||
|
| 'ScrollContainer'
|
||||||
|
| 'ShowPlayBar'
|
||||||
|
| 'Throbber'
|
||||||
|
| 'duration-app-launch'
|
||||||
|
| 'fadein'
|
||||||
|
| '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'),
|
||||||
);
|
);
|
||||||
@@ -378,3 +470,9 @@ export const playSectionClasses: PlaySectionClasses = findModule(
|
|||||||
export const gamepadSliderClasses: GamepadSliderClasses = findModule(
|
export const gamepadSliderClasses: GamepadSliderClasses = findModule(
|
||||||
(mod) => typeof mod === 'object' && mod?.SliderControlPanelGroup?.includes('gamepadslider'),
|
(mod) => typeof mod === 'object' && mod?.SliderControlPanelGroup?.includes('gamepadslider'),
|
||||||
);
|
);
|
||||||
|
export const appDetailsHeaderClasses: AppDetailsHeaderClasses = findModule(
|
||||||
|
(mod) => typeof mod === 'object' && mod?.TopCapsule?.includes('sharedappdetailsheader'),
|
||||||
|
);
|
||||||
|
export const appDetailsClasses: AppDetailsClasses = findModule(
|
||||||
|
(mod) => typeof mod === 'object' && mod?.HeaderLoaded?.includes('appdetails_'),
|
||||||
|
);
|
||||||
|
|||||||
@@ -26,8 +26,10 @@ export type RoutePatch = (route: RouteProps) => RouteProps;
|
|||||||
export interface RouterHook {
|
export interface RouterHook {
|
||||||
addRoute(path: string, component: ComponentType, props?: Omit<RouteProps, 'path' | 'children'>): void;
|
addRoute(path: string, component: ComponentType, props?: Omit<RouteProps, 'path' | 'children'>): void;
|
||||||
addPatch(path: string, patch: RoutePatch): RoutePatch;
|
addPatch(path: string, patch: RoutePatch): RoutePatch;
|
||||||
removePatch(path: string, patch: RoutePatch): void;
|
addGlobalComponent(name: string, component: ComponentType): void;
|
||||||
removeRoute(path: string): void;
|
removeRoute(path: string): void;
|
||||||
|
removePatch(path: string, patch: RoutePatch): void;
|
||||||
|
removeGlobalComponent(name: string): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ToastData {
|
export interface ToastData {
|
||||||
|
|||||||
Reference in New Issue
Block a user