mirror of
https://github.com/SteamDeckHomebrew/decky-frontend-lib.git
synced 2026-05-20 18:10:08 +02:00
Compare commits
33 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7e7a325cd9 | ||
|
|
41d0555d31 | ||
|
|
716f947710 | ||
|
|
ed7ba9bbb6 | ||
|
|
c03db3e0d5 | ||
|
|
aef063d2e2 | ||
|
|
33e5d8541d | ||
|
|
9c34100215 | ||
|
|
a1507ac55b | ||
|
|
484a882015 | ||
|
|
200125cb98 | ||
|
|
5ab8472ffe | ||
|
|
a43cd7f3c5 | ||
|
|
41401b1d01 | ||
|
|
8117693427 | ||
|
|
d80c047580 | ||
|
|
d6ecba605d | ||
|
|
bf58e08e4b | ||
|
|
e965816144 | ||
|
|
59ce9e450c | ||
|
|
980df687e7 | ||
|
|
bea9ac7774 | ||
|
|
063dedbbc1 | ||
|
|
723e2ff76e | ||
|
|
241b22cad7 | ||
|
|
93c59d8026 | ||
|
|
0f9fb5a3b8 | ||
|
|
8c6043b5a7 | ||
|
|
3aa07dc9ce | ||
|
|
3f335b3583 | ||
|
|
4c97097757 | ||
|
|
1ee43e86d6 | ||
|
|
db6ab9c448 |
2
.github/workflows/release.yaml
vendored
2
.github/workflows/release.yaml
vendored
@@ -4,7 +4,7 @@ on:
|
||||
pull_request:
|
||||
push:
|
||||
branches:
|
||||
- v4-dev
|
||||
- main
|
||||
|
||||
jobs:
|
||||
release:
|
||||
|
||||
84
CHANGELOG.md
84
CHANGELOG.md
@@ -1,3 +1,87 @@
|
||||
## [4.9.2](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v4.9.1...v4.9.2) (2025-03-29)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **SidebarNavigation:** change title to ReactNode type ([#117](https://github.com/SteamDeckHomebrew/decky-frontend-lib/issues/117)) ([41d0555](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/41d0555d314f9f68d3cdcc45f454f13b952b4581))
|
||||
|
||||
## [4.9.1](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v4.9.0...v4.9.1) (2025-01-29)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **Menu:** add missing arg to showContextMenu and document it ([c03db3e](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/c03db3e0d55f2ba14a8d82ba1380e9838769efe1))
|
||||
|
||||
# [4.9.0](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v4.8.3...v4.9.0) (2025-01-02)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* add MenuSeparator component ([484a882](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/484a882015ceb51c2c80e08151e79056e751ac15))
|
||||
|
||||
## [4.8.3](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v4.8.2...v4.8.3) (2024-12-14)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **utils:** add new nav root name ([a43cd7f](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/a43cd7f3c56a2e30e332417e5b4abde8f4492be1))
|
||||
|
||||
## [4.8.2](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v4.8.1...v4.8.2) (2024-11-20)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **Footer:** add missing focus/nav properties ([#113](https://github.com/SteamDeckHomebrew/decky-frontend-lib/issues/113)) ([8117693](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/8117693427e4dba2f3b5bd24f36704d8d5e65ae2))
|
||||
|
||||
## [4.8.1](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v4.8.0...v4.8.1) (2024-10-11)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **DialogCheckbox:** prevent some potential issues in dialogcheckbox ([bf58e08](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/bf58e08e4b5b183737c9ad43a858b642ce593f93))
|
||||
* prevent issues where toString may not be a function (what) ([e965816](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/e96581614471524cbf91bf962742df867ba3c3e9))
|
||||
|
||||
# [4.8.0](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v4.7.4...v4.8.0) (2024-10-05)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **components/Modal:** dont break in desktop ui ([bea9ac7](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/bea9ac777452b883c2f3f3ebf8510c22c4577cd0))
|
||||
* **components/Router:** dont break in desktop ui ([980df68](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/980df687e7b7bf389f478e831f992fb9475eeb15))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **utils/react:** add some window-related utils ([063dedb](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/063dedbbc1573a825571c675bf6bfa8a1bc1c6cd))
|
||||
|
||||
## [4.7.4](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v4.7.3...v4.7.4) (2024-10-04)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **DialogCheckbox:** don't access getters to prevent their side effects from breaking the component ([241b22c](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/241b22cad711621a1695dfd11da857f13c3fffdf))
|
||||
|
||||
## [4.7.3](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v4.7.2...v4.7.3) (2024-10-03)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **components:** fix missing components on oct 2 2024 beta ([0f9fb5a](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/0f9fb5a3b8ef4f9978025a28323ab080fb0e7a4c))
|
||||
|
||||
## [4.7.2](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v4.7.1...v4.7.2) (2024-09-16)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **utils:** fix potential race condition in findSP ([3aa07dc](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/3aa07dc9ce798ff8d1148424ee9e8a8bf2ba78c6))
|
||||
|
||||
## [4.7.1](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v4.7.0...v4.7.1) (2024-08-08)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **utils/react:** fix potential race condition in injectFCTrampoline ([4c97097](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/4c97097757919580a380b70785e6c161de6b03cc))
|
||||
|
||||
# [4.7.0](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v4.6.0...v4.7.0) (2024-07-28)
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@decky/ui",
|
||||
"version": "4.7.0",
|
||||
"version": "4.9.2",
|
||||
"description": "A library for interacting with the Steam frontend in Decky plugins and elsewhere.",
|
||||
"main": "dist/index.js",
|
||||
"types": "dist/index.d.ts",
|
||||
|
||||
102
pnpm-lock.yaml
generated
102
pnpm-lock.yaml
generated
@@ -16,13 +16,13 @@ importers:
|
||||
version: 19.2.2
|
||||
'@commitlint/cz-commitlint':
|
||||
specifier: ^19.2.0
|
||||
version: 19.2.0(@types/node@20.14.2)(commitizen@4.3.0)(inquirer@9.2.23)(typescript@5.4.5)
|
||||
version: 19.2.0(@types/node@20.14.2)(commitizen@4.3.0(@types/node@20.14.2)(typescript@5.4.5))(inquirer@9.2.23)(typescript@5.4.5)
|
||||
'@semantic-release/changelog':
|
||||
specifier: ^6.0.3
|
||||
version: 6.0.3(semantic-release@24.0.0)
|
||||
version: 6.0.3(semantic-release@24.0.0(typescript@5.4.5))
|
||||
'@semantic-release/git':
|
||||
specifier: ^10.0.1
|
||||
version: 10.0.1(semantic-release@24.0.0)
|
||||
version: 10.0.1(semantic-release@24.0.0(typescript@5.4.5))
|
||||
'@types/jest':
|
||||
specifier: ^29.5.12
|
||||
version: 29.5.12
|
||||
@@ -64,19 +64,19 @@ importers:
|
||||
version: 0.3.4
|
||||
ts-jest:
|
||||
specifier: ^29.1.4
|
||||
version: 29.1.4(@babel/core@7.24.7)(jest@29.7.0)(typescript@5.4.5)
|
||||
version: 29.1.4(@babel/core@7.24.7)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.24.7))(jest@29.7.0(@types/node@20.14.2))(typescript@5.4.5)
|
||||
typedoc:
|
||||
specifier: ^0.25.13
|
||||
version: 0.25.13(typescript@5.4.5)
|
||||
typedoc-plugin-mdn-links:
|
||||
specifier: ^3.1.29
|
||||
version: 3.1.29(typedoc@0.25.13)
|
||||
version: 3.1.29(typedoc@0.25.13(typescript@5.4.5))
|
||||
typedoc-plugin-missing-exports:
|
||||
specifier: ^2.3.0
|
||||
version: 2.3.0(typedoc@0.25.13)
|
||||
version: 2.3.0(typedoc@0.25.13(typescript@5.4.5))
|
||||
typedoc-wikijs-theme:
|
||||
specifier: ^1.0.5
|
||||
version: 1.0.5(typedoc-plugin-markdown@4.0.3)(typedoc@0.25.13)
|
||||
version: 1.0.5(typedoc-plugin-markdown@4.0.3(typedoc@0.25.13(typescript@5.4.5)))(typedoc@0.25.13(typescript@5.4.5))
|
||||
typescript:
|
||||
specifier: ^5.4.5
|
||||
version: 5.4.5
|
||||
@@ -999,8 +999,8 @@ packages:
|
||||
engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
|
||||
hasBin: true
|
||||
|
||||
cross-spawn@7.0.3:
|
||||
resolution: {integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==}
|
||||
cross-spawn@7.0.6:
|
||||
resolution: {integrity: sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==}
|
||||
engines: {node: '>= 8'}
|
||||
|
||||
crypto-random-string@4.0.0:
|
||||
@@ -2048,8 +2048,8 @@ packages:
|
||||
merge@2.1.1:
|
||||
resolution: {integrity: sha512-jz+Cfrg9GWOZbQAnDQ4hlVnQky+341Yk5ru8bZSe6sIDTCIg8n9i/u7hSQGSVOF3C7lH6mGtqjkiT9G4wFLL0w==}
|
||||
|
||||
micromatch@4.0.7:
|
||||
resolution: {integrity: sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==}
|
||||
micromatch@4.0.8:
|
||||
resolution: {integrity: sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==}
|
||||
engines: {node: '>=8.6'}
|
||||
|
||||
mime@4.0.3:
|
||||
@@ -3285,7 +3285,7 @@ snapshots:
|
||||
'@commitlint/types': 19.0.3
|
||||
ajv: 8.16.0
|
||||
|
||||
'@commitlint/cz-commitlint@19.2.0(@types/node@20.14.2)(commitizen@4.3.0)(inquirer@9.2.23)(typescript@5.4.5)':
|
||||
'@commitlint/cz-commitlint@19.2.0(@types/node@20.14.2)(commitizen@4.3.0(@types/node@20.14.2)(typescript@5.4.5))(inquirer@9.2.23)(typescript@5.4.5)':
|
||||
dependencies:
|
||||
'@commitlint/ensure': 19.0.3
|
||||
'@commitlint/load': 19.2.0(@types/node@20.14.2)(typescript@5.4.5)
|
||||
@@ -3335,7 +3335,7 @@ snapshots:
|
||||
'@commitlint/types': 19.0.3
|
||||
chalk: 5.3.0
|
||||
cosmiconfig: 9.0.0(typescript@5.4.5)
|
||||
cosmiconfig-typescript-loader: 5.0.0(@types/node@20.14.2)(cosmiconfig@9.0.0)(typescript@5.4.5)
|
||||
cosmiconfig-typescript-loader: 5.0.0(@types/node@20.14.2)(cosmiconfig@9.0.0(typescript@5.4.5))(typescript@5.4.5)
|
||||
lodash.isplainobject: 4.0.6
|
||||
lodash.merge: 4.6.2
|
||||
lodash.uniq: 4.5.0
|
||||
@@ -3434,7 +3434,7 @@ snapshots:
|
||||
jest-util: 29.7.0
|
||||
jest-validate: 29.7.0
|
||||
jest-watcher: 29.7.0
|
||||
micromatch: 4.0.7
|
||||
micromatch: 4.0.8
|
||||
pretty-format: 29.7.0
|
||||
slash: 3.0.0
|
||||
strip-ansi: 6.0.1
|
||||
@@ -3545,7 +3545,7 @@ snapshots:
|
||||
jest-haste-map: 29.7.0
|
||||
jest-regex-util: 29.6.3
|
||||
jest-util: 29.7.0
|
||||
micromatch: 4.0.7
|
||||
micromatch: 4.0.8
|
||||
pirates: 4.0.6
|
||||
slash: 3.0.0
|
||||
write-file-atomic: 4.0.2
|
||||
@@ -3666,7 +3666,7 @@ snapshots:
|
||||
|
||||
'@sec-ant/readable-stream@0.4.1': {}
|
||||
|
||||
'@semantic-release/changelog@6.0.3(semantic-release@24.0.0)':
|
||||
'@semantic-release/changelog@6.0.3(semantic-release@24.0.0(typescript@5.4.5))':
|
||||
dependencies:
|
||||
'@semantic-release/error': 3.0.0
|
||||
aggregate-error: 3.1.0
|
||||
@@ -3674,7 +3674,7 @@ snapshots:
|
||||
lodash: 4.17.21
|
||||
semantic-release: 24.0.0(typescript@5.4.5)
|
||||
|
||||
'@semantic-release/commit-analyzer@13.0.0(semantic-release@24.0.0)':
|
||||
'@semantic-release/commit-analyzer@13.0.0(semantic-release@24.0.0(typescript@5.4.5))':
|
||||
dependencies:
|
||||
conventional-changelog-angular: 8.0.0
|
||||
conventional-changelog-writer: 8.0.0
|
||||
@@ -3683,7 +3683,7 @@ snapshots:
|
||||
debug: 4.3.5
|
||||
import-from-esm: 1.3.4
|
||||
lodash-es: 4.17.21
|
||||
micromatch: 4.0.7
|
||||
micromatch: 4.0.8
|
||||
semantic-release: 24.0.0(typescript@5.4.5)
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
@@ -3692,7 +3692,7 @@ snapshots:
|
||||
|
||||
'@semantic-release/error@4.0.0': {}
|
||||
|
||||
'@semantic-release/git@10.0.1(semantic-release@24.0.0)':
|
||||
'@semantic-release/git@10.0.1(semantic-release@24.0.0(typescript@5.4.5))':
|
||||
dependencies:
|
||||
'@semantic-release/error': 3.0.0
|
||||
aggregate-error: 3.1.0
|
||||
@@ -3700,13 +3700,13 @@ snapshots:
|
||||
dir-glob: 3.0.1
|
||||
execa: 5.1.1
|
||||
lodash: 4.17.21
|
||||
micromatch: 4.0.7
|
||||
micromatch: 4.0.8
|
||||
p-reduce: 2.1.0
|
||||
semantic-release: 24.0.0(typescript@5.4.5)
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
'@semantic-release/github@10.0.6(semantic-release@24.0.0)':
|
||||
'@semantic-release/github@10.0.6(semantic-release@24.0.0(typescript@5.4.5))':
|
||||
dependencies:
|
||||
'@octokit/core': 6.1.2
|
||||
'@octokit/plugin-paginate-rest': 11.3.0(@octokit/core@6.1.2)
|
||||
@@ -3728,7 +3728,7 @@ snapshots:
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
'@semantic-release/npm@12.0.1(semantic-release@24.0.0)':
|
||||
'@semantic-release/npm@12.0.1(semantic-release@24.0.0(typescript@5.4.5))':
|
||||
dependencies:
|
||||
'@semantic-release/error': 4.0.0
|
||||
aggregate-error: 5.0.0
|
||||
@@ -3745,7 +3745,7 @@ snapshots:
|
||||
semver: 7.6.2
|
||||
tempy: 3.1.0
|
||||
|
||||
'@semantic-release/release-notes-generator@14.0.0(semantic-release@24.0.0)':
|
||||
'@semantic-release/release-notes-generator@14.0.0(semantic-release@24.0.0(typescript@5.4.5))':
|
||||
dependencies:
|
||||
conventional-changelog-angular: 8.0.0
|
||||
conventional-changelog-writer: 8.0.0
|
||||
@@ -4228,7 +4228,7 @@ snapshots:
|
||||
|
||||
core-util-is@1.0.3: {}
|
||||
|
||||
cosmiconfig-typescript-loader@5.0.0(@types/node@20.14.2)(cosmiconfig@9.0.0)(typescript@5.4.5):
|
||||
cosmiconfig-typescript-loader@5.0.0(@types/node@20.14.2)(cosmiconfig@9.0.0(typescript@5.4.5))(typescript@5.4.5):
|
||||
dependencies:
|
||||
'@types/node': 20.14.2
|
||||
cosmiconfig: 9.0.0(typescript@5.4.5)
|
||||
@@ -4248,6 +4248,7 @@ snapshots:
|
||||
import-fresh: 3.3.0
|
||||
js-yaml: 4.1.0
|
||||
parse-json: 5.2.0
|
||||
optionalDependencies:
|
||||
typescript: 5.4.5
|
||||
|
||||
create-jest@29.7.0(@types/node@20.14.2):
|
||||
@@ -4265,7 +4266,7 @@ snapshots:
|
||||
- supports-color
|
||||
- ts-node
|
||||
|
||||
cross-spawn@7.0.3:
|
||||
cross-spawn@7.0.6:
|
||||
dependencies:
|
||||
path-key: 3.1.1
|
||||
shebang-command: 2.0.0
|
||||
@@ -4463,7 +4464,7 @@ snapshots:
|
||||
|
||||
execa@5.1.1:
|
||||
dependencies:
|
||||
cross-spawn: 7.0.3
|
||||
cross-spawn: 7.0.6
|
||||
get-stream: 6.0.1
|
||||
human-signals: 2.1.0
|
||||
is-stream: 2.0.1
|
||||
@@ -4475,7 +4476,7 @@ snapshots:
|
||||
|
||||
execa@8.0.1:
|
||||
dependencies:
|
||||
cross-spawn: 7.0.3
|
||||
cross-spawn: 7.0.6
|
||||
get-stream: 8.0.1
|
||||
human-signals: 5.0.0
|
||||
is-stream: 3.0.0
|
||||
@@ -4488,7 +4489,7 @@ snapshots:
|
||||
execa@9.2.0:
|
||||
dependencies:
|
||||
'@sindresorhus/merge-streams': 4.0.0
|
||||
cross-spawn: 7.0.3
|
||||
cross-spawn: 7.0.6
|
||||
figures: 6.1.0
|
||||
get-stream: 9.0.1
|
||||
human-signals: 7.0.0
|
||||
@@ -4528,7 +4529,7 @@ snapshots:
|
||||
'@nodelib/fs.walk': 1.2.8
|
||||
glob-parent: 5.1.2
|
||||
merge2: 1.4.1
|
||||
micromatch: 4.0.7
|
||||
micromatch: 4.0.8
|
||||
|
||||
fast-json-stable-stringify@2.1.0: {}
|
||||
|
||||
@@ -4591,7 +4592,7 @@ snapshots:
|
||||
dependencies:
|
||||
detect-file: 1.0.0
|
||||
is-glob: 4.0.3
|
||||
micromatch: 4.0.7
|
||||
micromatch: 4.0.8
|
||||
resolve-dir: 1.0.1
|
||||
|
||||
for-each@0.3.3:
|
||||
@@ -5153,7 +5154,6 @@ snapshots:
|
||||
'@babel/core': 7.24.7
|
||||
'@jest/test-sequencer': 29.7.0
|
||||
'@jest/types': 29.6.3
|
||||
'@types/node': 20.14.2
|
||||
babel-jest: 29.7.0(@babel/core@7.24.7)
|
||||
chalk: 4.1.2
|
||||
ci-info: 3.9.0
|
||||
@@ -5168,11 +5168,13 @@ snapshots:
|
||||
jest-runner: 29.7.0
|
||||
jest-util: 29.7.0
|
||||
jest-validate: 29.7.0
|
||||
micromatch: 4.0.7
|
||||
micromatch: 4.0.8
|
||||
parse-json: 5.2.0
|
||||
pretty-format: 29.7.0
|
||||
slash: 3.0.0
|
||||
strip-json-comments: 3.1.1
|
||||
optionalDependencies:
|
||||
'@types/node': 20.14.2
|
||||
transitivePeerDependencies:
|
||||
- babel-plugin-macros
|
||||
- supports-color
|
||||
@@ -5218,7 +5220,7 @@ snapshots:
|
||||
jest-regex-util: 29.6.3
|
||||
jest-util: 29.7.0
|
||||
jest-worker: 29.7.0
|
||||
micromatch: 4.0.7
|
||||
micromatch: 4.0.8
|
||||
walker: 1.0.8
|
||||
optionalDependencies:
|
||||
fsevents: 2.3.3
|
||||
@@ -5242,7 +5244,7 @@ snapshots:
|
||||
'@types/stack-utils': 2.0.3
|
||||
chalk: 4.1.2
|
||||
graceful-fs: 4.2.11
|
||||
micromatch: 4.0.7
|
||||
micromatch: 4.0.8
|
||||
pretty-format: 29.7.0
|
||||
slash: 3.0.0
|
||||
stack-utils: 2.0.6
|
||||
@@ -5254,7 +5256,7 @@ snapshots:
|
||||
jest-util: 29.7.0
|
||||
|
||||
jest-pnp-resolver@1.2.3(jest-resolve@29.7.0):
|
||||
dependencies:
|
||||
optionalDependencies:
|
||||
jest-resolve: 29.7.0
|
||||
|
||||
jest-regex-util@29.6.3: {}
|
||||
@@ -5546,7 +5548,7 @@ snapshots:
|
||||
|
||||
merge@2.1.1: {}
|
||||
|
||||
micromatch@4.0.7:
|
||||
micromatch@4.0.8:
|
||||
dependencies:
|
||||
braces: 3.0.3
|
||||
picomatch: 2.3.1
|
||||
@@ -5939,11 +5941,11 @@ snapshots:
|
||||
|
||||
semantic-release@24.0.0(typescript@5.4.5):
|
||||
dependencies:
|
||||
'@semantic-release/commit-analyzer': 13.0.0(semantic-release@24.0.0)
|
||||
'@semantic-release/commit-analyzer': 13.0.0(semantic-release@24.0.0(typescript@5.4.5))
|
||||
'@semantic-release/error': 4.0.0
|
||||
'@semantic-release/github': 10.0.6(semantic-release@24.0.0)
|
||||
'@semantic-release/npm': 12.0.1(semantic-release@24.0.0)
|
||||
'@semantic-release/release-notes-generator': 14.0.0(semantic-release@24.0.0)
|
||||
'@semantic-release/github': 10.0.6(semantic-release@24.0.0(typescript@5.4.5))
|
||||
'@semantic-release/npm': 12.0.1(semantic-release@24.0.0(typescript@5.4.5))
|
||||
'@semantic-release/release-notes-generator': 14.0.0(semantic-release@24.0.0(typescript@5.4.5))
|
||||
aggregate-error: 5.0.0
|
||||
cosmiconfig: 9.0.0(typescript@5.4.5)
|
||||
debug: 4.3.5
|
||||
@@ -5959,7 +5961,7 @@ snapshots:
|
||||
lodash-es: 4.17.21
|
||||
marked: 12.0.2
|
||||
marked-terminal: 7.0.0(marked@12.0.2)
|
||||
micromatch: 4.0.7
|
||||
micromatch: 4.0.8
|
||||
p-each-series: 3.0.0
|
||||
p-reduce: 3.0.0
|
||||
read-package-up: 11.0.0
|
||||
@@ -6223,9 +6225,8 @@ snapshots:
|
||||
typedarray.prototype.slice: 1.0.3
|
||||
which-typed-array: 1.1.15
|
||||
|
||||
ts-jest@29.1.4(@babel/core@7.24.7)(jest@29.7.0)(typescript@5.4.5):
|
||||
ts-jest@29.1.4(@babel/core@7.24.7)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.24.7))(jest@29.7.0(@types/node@20.14.2))(typescript@5.4.5):
|
||||
dependencies:
|
||||
'@babel/core': 7.24.7
|
||||
bs-logger: 0.2.6
|
||||
fast-json-stable-stringify: 2.1.0
|
||||
jest: 29.7.0(@types/node@20.14.2)
|
||||
@@ -6236,6 +6237,11 @@ snapshots:
|
||||
semver: 7.6.2
|
||||
typescript: 5.4.5
|
||||
yargs-parser: 21.1.1
|
||||
optionalDependencies:
|
||||
'@babel/core': 7.24.7
|
||||
'@jest/transform': 29.7.0
|
||||
'@jest/types': 29.6.3
|
||||
babel-jest: 29.7.0(@babel/core@7.24.7)
|
||||
|
||||
tslib@2.6.3: {}
|
||||
|
||||
@@ -6290,22 +6296,22 @@ snapshots:
|
||||
typed-array-buffer: 1.0.2
|
||||
typed-array-byte-offset: 1.0.2
|
||||
|
||||
typedoc-plugin-markdown@4.0.3(typedoc@0.25.13):
|
||||
typedoc-plugin-markdown@4.0.3(typedoc@0.25.13(typescript@5.4.5)):
|
||||
dependencies:
|
||||
typedoc: 0.25.13(typescript@5.4.5)
|
||||
|
||||
typedoc-plugin-mdn-links@3.1.29(typedoc@0.25.13):
|
||||
typedoc-plugin-mdn-links@3.1.29(typedoc@0.25.13(typescript@5.4.5)):
|
||||
dependencies:
|
||||
typedoc: 0.25.13(typescript@5.4.5)
|
||||
|
||||
typedoc-plugin-missing-exports@2.3.0(typedoc@0.25.13):
|
||||
typedoc-plugin-missing-exports@2.3.0(typedoc@0.25.13(typescript@5.4.5)):
|
||||
dependencies:
|
||||
typedoc: 0.25.13(typescript@5.4.5)
|
||||
|
||||
typedoc-wikijs-theme@1.0.5(typedoc-plugin-markdown@4.0.3)(typedoc@0.25.13):
|
||||
typedoc-wikijs-theme@1.0.5(typedoc-plugin-markdown@4.0.3(typedoc@0.25.13(typescript@5.4.5)))(typedoc@0.25.13(typescript@5.4.5)):
|
||||
dependencies:
|
||||
typedoc: 0.25.13(typescript@5.4.5)
|
||||
typedoc-plugin-markdown: 4.0.3(typedoc@0.25.13)
|
||||
typedoc-plugin-markdown: 4.0.3(typedoc@0.25.13(typescript@5.4.5))
|
||||
|
||||
typedoc@0.25.13(typescript@5.4.5):
|
||||
dependencies:
|
||||
|
||||
@@ -78,11 +78,11 @@ export const DialogControlsSection = MappedDialogDivs.get('DialogControlsSection
|
||||
export const DialogControlsSectionHeader = MappedDialogDivs.get('DialogControlsSectionHeader') as FC<DialogCommonProps>;
|
||||
|
||||
export const DialogButtonPrimary = Object.values(CommonUIModule).find(
|
||||
(mod: any) => mod?.render?.toString()?.includes('"DialogButton","_DialogLayout","Primary"'),
|
||||
(mod: any) => mod?.render?.toString?.()?.includes('"DialogButton","_DialogLayout","Primary"'),
|
||||
) as FC<DialogButtonProps>;
|
||||
|
||||
export const DialogButtonSecondary = Object.values(CommonUIModule).find(
|
||||
(mod: any) => mod?.render?.toString()?.includes('"DialogButton","_DialogLayout","Secondary"')
|
||||
(mod: any) => mod?.render?.toString?.()?.includes('"DialogButton","_DialogLayout","Secondary"')
|
||||
) as FC<DialogButtonProps>;
|
||||
|
||||
// This is the "main" button. The Primary can act as a submit button,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { FC, ReactNode } from 'react';
|
||||
|
||||
import { findModule } from '../webpack';
|
||||
import { findModuleExport } from '../webpack';
|
||||
import { DialogCommonProps } from './Dialog';
|
||||
import { FooterLegendProps } from './FooterLegend';
|
||||
|
||||
@@ -18,19 +18,16 @@ export interface DialogCheckboxProps extends DialogCommonProps, FooterLegendProp
|
||||
onClick?(evt: Event): void;
|
||||
}
|
||||
|
||||
export const DialogCheckbox = Object.values(
|
||||
findModule((m: any) => {
|
||||
if (typeof m !== 'object') return false;
|
||||
for (const prop in m) {
|
||||
if (m[prop]?.prototype?.GetPanelElementProps) return true;
|
||||
}
|
||||
return false;
|
||||
}),
|
||||
).find(
|
||||
(m: any) =>
|
||||
m.contextType &&
|
||||
m.prototype?.render.toString().includes('fallback:') &&
|
||||
m?.prototype?.SetChecked &&
|
||||
m?.prototype?.Toggle &&
|
||||
m?.prototype?.GetPanelElementProps,
|
||||
// Do not access KeyDown, SetChecked, Toggle here as they are getters and accessing them outside of a render breaks them globally
|
||||
export const DialogCheckbox = findModuleExport(e =>
|
||||
e?.prototype &&
|
||||
typeof e?.prototype == "object" &&
|
||||
"GetPanelElementProps" in e?.prototype &&
|
||||
"SetChecked" in e?.prototype &&
|
||||
"Toggle" in e?.prototype &&
|
||||
// beta || stable as of oct 2 2024
|
||||
(e?.prototype?.render?.toString?.().includes('="DialogCheckbox"') || (
|
||||
e.contextType &&
|
||||
e.prototype?.render?.toString?.().includes('fallback:')
|
||||
))
|
||||
) as FC<DialogCheckboxProps>;
|
||||
|
||||
@@ -3,6 +3,7 @@ import { ReactNode, FC } from 'react';
|
||||
import { CommonUIModule } from '../webpack';
|
||||
import { ItemProps } from './Item';
|
||||
import { createPropListRegex } from '../utils';
|
||||
import type { ContextMenuPositionOptions } from './Menu';
|
||||
|
||||
export interface SingleDropdownOption {
|
||||
data: any;
|
||||
@@ -20,11 +21,6 @@ export interface MultiDropdownOption {
|
||||
|
||||
export type DropdownOption = SingleDropdownOption | MultiDropdownOption;
|
||||
|
||||
export interface DropdownMenuPositionOptions {
|
||||
[_: string]: unknown
|
||||
bMatchWidth?: boolean
|
||||
}
|
||||
|
||||
export interface DropdownProps {
|
||||
rgOptions: DropdownOption[];
|
||||
selectedOption: any;
|
||||
@@ -32,7 +28,7 @@ export interface DropdownProps {
|
||||
onMenuWillOpen?(showMenu: () => void): void;
|
||||
onMenuOpened?(): void;
|
||||
onChange?(data: SingleDropdownOption): void;
|
||||
contextMenuPositionOptions?: DropdownMenuPositionOptions;
|
||||
contextMenuPositionOptions?: ContextMenuPositionOptions;
|
||||
menuLabel?: string;
|
||||
strDefaultLabel?: string;
|
||||
renderButtonValue?(element: ReactNode): ReactNode;
|
||||
|
||||
@@ -11,5 +11,5 @@ export interface FocusRingProps {
|
||||
}
|
||||
|
||||
export const FocusRing = findModuleExport((e: Export) =>
|
||||
e?.toString()?.includes('.GetShowDebugFocusRing())'),
|
||||
e?.toString?.()?.includes('.GetShowDebugFocusRing())'),
|
||||
) as FC<FocusRingProps>;
|
||||
|
||||
@@ -31,11 +31,42 @@ export enum GamepadButton {
|
||||
STEAM_GUIDE,
|
||||
STEAM_QUICK_MENU,
|
||||
}
|
||||
export declare enum NavEntryPositionPreferences {
|
||||
export enum NavEntryPositionPreferences {
|
||||
/**
|
||||
* Always give focus to the first child element.
|
||||
*/
|
||||
FIRST,
|
||||
|
||||
/**
|
||||
* Always give focus to the last child element.
|
||||
*/
|
||||
LAST,
|
||||
|
||||
/**
|
||||
* Give focus to the child element that would maintain the flow in the X axis.
|
||||
*
|
||||
* Imagine you have a calculator window with 9 standard buttons.
|
||||
* You have 3 rows of buttons, with 3 buttons per row.
|
||||
* If you select button with number 8 and navigate down, the buttons
|
||||
* will be navigated in the following order 8->5->3.
|
||||
* The flow is maintained for the X axis while you're navigating the Y axis.
|
||||
*/
|
||||
MAINTAIN_X,
|
||||
|
||||
/**
|
||||
* Give focus to the child element that would maintain the flow in the Y axis.
|
||||
*
|
||||
* Imagine you have a calculator window with 9 standard buttons.
|
||||
* You have 3 columns of buttons, with 3 buttons per column.
|
||||
* If you select button with number 4 and navigate right, the buttons
|
||||
* will be navigated in the following order 4->5->6.
|
||||
* The flow is maintained for the Y axis while you're navigating the X axis.
|
||||
*/
|
||||
MAINTAIN_Y,
|
||||
|
||||
/**
|
||||
* Give focus to the first child element with `preferredFocus == true` prop.
|
||||
*/
|
||||
PREFERRED_CHILD,
|
||||
}
|
||||
export interface GamepadEventDetail {
|
||||
@@ -48,6 +79,25 @@ export declare type ActionDescriptionMap = {
|
||||
};
|
||||
export declare type GamepadEvent = CustomEvent<GamepadEventDetail>;
|
||||
export interface FooterLegendProps {
|
||||
/**
|
||||
* Navigation entry strategy to be used when gaining focus during navigation.
|
||||
*
|
||||
* This is meant to be used on a parent container that has children. Once the
|
||||
* container (e.g. Focusable) is navigated to and has children in it, the children
|
||||
* is then navigated to (focused) using the provided strategy.
|
||||
*
|
||||
* If no strategy is provided, it seems that the `NavEntryPositionPreferences.FIRST`
|
||||
* is used initialy, but for the next time the parent remembers previously focused
|
||||
* child and focused back on it instead.
|
||||
*/
|
||||
navEntryPreferPosition?: NavEntryPositionPreferences;
|
||||
|
||||
/**
|
||||
* Mark the element as the preferred child (to be focused) whenever the parent uses the
|
||||
* `NavEntryPositionPreferences.PREFERRED_CHILD` navigation strategy.
|
||||
*/
|
||||
preferredFocus?: boolean;
|
||||
|
||||
actionDescriptionMap?: ActionDescriptionMap;
|
||||
onOKActionDescription?: ReactNode;
|
||||
onCancelActionDescription?: ReactNode;
|
||||
|
||||
@@ -3,9 +3,128 @@ import { FC, ReactNode } from 'react';
|
||||
import { Export, findModuleByExport, findModuleExport } from '../webpack';
|
||||
import { FooterLegendProps } from './FooterLegend';
|
||||
|
||||
export const showContextMenu: (children: ReactNode, parent?: EventTarget) => void = findModuleExport(
|
||||
(e: Export) => typeof e === 'function' && e.toString().includes('GetContextMenuManagerFromWindow(')
|
||||
&& e.toString().includes('.CreateContextMenuInstance('),
|
||||
interface PopupCreationOptions {
|
||||
/**
|
||||
* Initially hidden, make it appear with {@link ContextMenuInstance.Show}.
|
||||
*/
|
||||
bCreateHidden?: boolean;
|
||||
|
||||
bModal?: boolean;
|
||||
|
||||
/**
|
||||
* Document title.
|
||||
*/
|
||||
title?: string;
|
||||
}
|
||||
|
||||
// Separate interface, since one of webpack module exports uses this exact object,
|
||||
// so maybe it could be reused elsewhere.
|
||||
interface MonitorOptions {
|
||||
targetMonitor: {
|
||||
flMonitorScale: number;
|
||||
nScreenLeft: number;
|
||||
nScreenTop: number;
|
||||
nScreenWidth: number;
|
||||
nScreenHeight: number;
|
||||
};
|
||||
flGamepadScale: number;
|
||||
}
|
||||
|
||||
export interface ContextMenuPositionOptions extends PopupCreationOptions, Partial<MonitorOptions> {
|
||||
/**
|
||||
* When {@link bForcePopup} is true, makes the window appear above everything else.
|
||||
*/
|
||||
bAlwaysOnTop?: boolean;
|
||||
|
||||
/**
|
||||
* Disables the mouse overlay, granting the ability to click anywhere while
|
||||
* the menu's active.
|
||||
*/
|
||||
bDisableMouseOverlay?: boolean;
|
||||
|
||||
/**
|
||||
* Disables the {@link bPreferPopTop} behavior.
|
||||
*/
|
||||
bDisablePopTop?: boolean;
|
||||
|
||||
bFitToWindow?: boolean;
|
||||
|
||||
/**
|
||||
* Forces the menu to open in a separate window instead of inside the parent.
|
||||
*/
|
||||
bForcePopup?: boolean;
|
||||
|
||||
/**
|
||||
* Like {@link bMatchWidth}, but don't shrink below the menu's minimum width.
|
||||
*/
|
||||
bGrowToElementWidth?: boolean;
|
||||
|
||||
/**
|
||||
* Match the parent's exact height.
|
||||
*/
|
||||
bMatchHeight?: boolean;
|
||||
|
||||
/**
|
||||
* Match the parent's exact width.
|
||||
*/
|
||||
bMatchWidth?: boolean;
|
||||
|
||||
bNoFocusWhenShown?: boolean;
|
||||
|
||||
/**
|
||||
* Makes the menu **invisible**, instead of getting removed from the DOM.
|
||||
*/
|
||||
bRetainOnHide?: boolean;
|
||||
|
||||
bScreenCoordinates?: boolean;
|
||||
|
||||
/**
|
||||
* Set to `true` to not account for the parent's width.
|
||||
*/
|
||||
bOverlapHorizontal?: boolean;
|
||||
|
||||
/**
|
||||
* Set to `true` to not account for the parent's height.
|
||||
*/
|
||||
bOverlapVertical?: boolean;
|
||||
|
||||
/**
|
||||
* Set to `true` to make the entire menu try to appear on the left side from
|
||||
* the parent.
|
||||
*/
|
||||
bPreferPopLeft?: boolean;
|
||||
|
||||
/**
|
||||
* Set to `true` to make the entire menu try to appear above the parent.
|
||||
*/
|
||||
bPreferPopTop?: boolean;
|
||||
|
||||
bShiftToFitWindow?: boolean;
|
||||
|
||||
// different window creation flags (StandaloneContextMenu vs PopupContextMenu)
|
||||
bStandalone?: boolean;
|
||||
|
||||
/**
|
||||
* Class name **replacement** for the container element, i.e. it replaces the
|
||||
* default class.
|
||||
*/
|
||||
strClassName?: string;
|
||||
}
|
||||
|
||||
interface ContextMenuInstance {
|
||||
Hide(): void;
|
||||
Show(): void;
|
||||
}
|
||||
|
||||
export const showContextMenu: (
|
||||
children: ReactNode,
|
||||
parent?: EventTarget,
|
||||
options?: ContextMenuPositionOptions,
|
||||
) => ContextMenuInstance = findModuleExport(
|
||||
(e: Export) =>
|
||||
typeof e === 'function' &&
|
||||
e.toString().includes('GetContextMenuManagerFromWindow(') &&
|
||||
e.toString().includes('.CreateContextMenuInstance('),
|
||||
);
|
||||
|
||||
export interface MenuProps extends FooterLegendProps {
|
||||
@@ -26,7 +145,7 @@ export interface MenuGroupProps {
|
||||
}
|
||||
|
||||
const MenuGoupModule = findModuleByExport(e => e?.prototype?.Focus && e?.prototype?.OnOKButton && e?.prototype?.render?.toString().includes?.(`"emphasis"==this.props.tone`));
|
||||
export const MenuGroup: FC<MenuGroupProps> = MenuGoupModule && Object.values(MenuGoupModule).find((e: Export) => typeof e == "function" && e?.toString()?.includes("bInGamepadUI:"));
|
||||
export const MenuGroup: FC<MenuGroupProps> = MenuGoupModule && Object.values(MenuGoupModule).find((e: Export) => typeof e == "function" && e?.toString?.()?.includes("bInGamepadUI:"));
|
||||
export interface MenuItemProps extends FooterLegendProps {
|
||||
bInteractableItem?: boolean;
|
||||
onClick?(evt: Event): void;
|
||||
@@ -42,7 +161,11 @@ export interface MenuItemProps extends FooterLegendProps {
|
||||
|
||||
export const MenuItem: FC<MenuItemProps> = findModuleExport(
|
||||
(e: Export) =>
|
||||
e?.render?.toString()?.includes('bPlayAudio:') || (e?.prototype?.OnOKButton && e?.prototype?.OnMouseEnter),
|
||||
e?.render?.toString?.()?.includes('bPlayAudio:') || (e?.prototype?.OnOKButton && e?.prototype?.OnMouseEnter),
|
||||
);
|
||||
|
||||
export const MenuSeparator: FC = findModuleExport(
|
||||
(e: Export) => typeof e === 'function' && /className:.+?\.ContextMenuSeparator/.test(e.toString()),
|
||||
);
|
||||
|
||||
/*
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { FC, ReactNode } from 'react';
|
||||
|
||||
import { findSP } from '../utils';
|
||||
import { Export, findModule, findModuleByExport, findModuleExport } from '../webpack';
|
||||
import { Export, findModule, findModuleDetailsByExport, findModuleExport } from '../webpack';
|
||||
|
||||
// All of the popout options + strTitle are related. Proper usage is not yet known...
|
||||
export interface ShowModalProps {
|
||||
@@ -50,7 +50,7 @@ export const showModal = (
|
||||
bHideMainWindowForPopouts: false,
|
||||
},
|
||||
): ShowModalResult => {
|
||||
return showModalRaw(modal, parent || findSP(), props.strTitle, props, undefined, {
|
||||
return showModalRaw(modal, parent || findSP() || window, props.strTitle, props, undefined, {
|
||||
bHideActions: props.bHideActionIcons,
|
||||
});
|
||||
};
|
||||
@@ -98,14 +98,14 @@ export const ModalRoot = Object.values(
|
||||
|
||||
return false;
|
||||
}) || {},
|
||||
)?.find((x: any) => x?.type?.toString()?.includes('((function(){')) as FC<ModalRootProps>;
|
||||
)?.find((x: any) => x?.type?.toString?.()?.includes('((function(){')) as FC<ModalRootProps>;
|
||||
|
||||
interface SimpleModalProps {
|
||||
active?: boolean;
|
||||
children: ReactNode;
|
||||
}
|
||||
|
||||
const ModalModule = findModuleByExport((e: Export) => e?.toString().includes('.ModalPosition,fallback:'), 5);
|
||||
const [ModalModule, _ModalPosition] = findModuleDetailsByExport((e: Export) => e?.toString().includes('.ModalPosition'), 5)
|
||||
|
||||
const ModalModuleProps = ModalModule ? Object.values(ModalModule) : [];
|
||||
|
||||
@@ -114,6 +114,4 @@ export const SimpleModal = ModalModuleProps.find((prop) => {
|
||||
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>;
|
||||
export const ModalPosition = _ModalPosition as FC<SimpleModalProps>;
|
||||
|
||||
@@ -22,5 +22,5 @@ export interface PanelSectionRowProps {
|
||||
children?: ReactNode;
|
||||
}
|
||||
export const PanelSectionRow = Object.values(mod).filter(
|
||||
(exp: any) => !exp?.toString()?.includes('.PanelSection'),
|
||||
(exp: any) => !exp?.toString?.()?.includes('.PanelSection'),
|
||||
)[0] as FC<PanelSectionRowProps>;
|
||||
|
||||
@@ -24,11 +24,11 @@ export interface ProgressBarWithInfoProps extends ProgressBarItemProps {
|
||||
}
|
||||
|
||||
export const ProgressBar = findModuleExport((e: Export) =>
|
||||
e?.toString()?.includes('.ProgressBar,"standard"=='),
|
||||
e?.toString?.()?.includes('.ProgressBar,"standard"=='),
|
||||
) as FC<ProgressBarProps>;
|
||||
|
||||
export const ProgressBarWithInfo = findModuleExport((e: Export) =>
|
||||
e?.toString()?.includes('.ProgressBarFieldStatus},'),
|
||||
e?.toString?.()?.includes('.ProgressBarFieldStatus},'),
|
||||
) as FC<ProgressBarWithInfoProps>;
|
||||
|
||||
const progressBarItemRegex = createPropListRegex(["indeterminate", "nTransitionSec", "nProgress"]);
|
||||
|
||||
@@ -16,7 +16,7 @@ export interface SidebarNavigationPage {
|
||||
}
|
||||
|
||||
export interface SidebarNavigationProps {
|
||||
title?: string;
|
||||
title?: ReactNode;
|
||||
pages: (SidebarNavigationPage | 'separator')[];
|
||||
showTitle?: boolean;
|
||||
disableRouteReporting?: boolean;
|
||||
|
||||
@@ -29,5 +29,6 @@ export interface SliderFieldProps extends ItemProps {
|
||||
}
|
||||
|
||||
export const SliderField = Object.values(CommonUIModule).find((mod: any) =>
|
||||
mod?.toString()?.includes('SliderField,fallback'),
|
||||
// stable || beta as of oct 2 2024
|
||||
mod?.toString?.()?.includes('SliderField,fallback') || mod?.toString?.()?.includes("SliderField\",")
|
||||
) as FC<SliderFieldProps>;
|
||||
|
||||
@@ -62,9 +62,9 @@ export interface TabsProps {
|
||||
autoFocusContents?: boolean;
|
||||
}
|
||||
|
||||
const tabsModule = findModuleByExport(e => e?.toString()?.includes(".TabRowTabs") && e?.toString()?.includes("activeTab:"));
|
||||
const tabsModule = findModuleByExport(e => e?.toString?.()?.includes(".TabRowTabs") && e?.toString?.()?.includes("activeTab:"));
|
||||
|
||||
/**
|
||||
* Tabs component as used in the library and media tabs. See {@link TabsProps}.
|
||||
*/
|
||||
export const Tabs = tabsModule && Object.values(tabsModule).find((e: any) => e?.type?.toString()?.includes("((function()")) as FC<TabsProps>;
|
||||
export const Tabs = tabsModule && Object.values(tabsModule).find((e: any) => e?.type?.toString?.()?.includes("((function()")) as FC<TabsProps>;
|
||||
|
||||
@@ -10,5 +10,5 @@ export interface ToggleProps {
|
||||
}
|
||||
|
||||
export const Toggle = Object.values(CommonUIModule).find((mod: any) =>
|
||||
mod?.render?.toString()?.includes('.ToggleOff)'),
|
||||
mod?.render?.toString?.()?.includes('.ToggleOff)'),
|
||||
) as FC<ToggleProps>;
|
||||
|
||||
@@ -11,5 +11,6 @@ export interface ToggleFieldProps extends ItemProps {
|
||||
}
|
||||
|
||||
export const ToggleField = Object.values(CommonUIModule).find((mod: any) =>
|
||||
mod?.render?.toString()?.includes('ToggleField,fallback'),
|
||||
// stable || beta as of oct 2 2024
|
||||
mod?.render?.toString?.()?.includes('ToggleField,fallback') || mod?.render?.toString?.()?.includes("ToggleField\",")
|
||||
) as FC<ToggleFieldProps>;
|
||||
|
||||
@@ -126,6 +126,7 @@ export interface Navigation {
|
||||
OpenQuickAccessMenu(quickAccessTab?: QuickAccessTab): void;
|
||||
OpenMainMenu(): void;
|
||||
OpenPowerMenu(unknown?: any): void;
|
||||
/** if calling this to perform navigation, call it after Navigate to prevent a race condition in desktop Big Picture mode that hides the overlay unintentionally */
|
||||
CloseSideMenus(): void;
|
||||
}
|
||||
|
||||
@@ -143,8 +144,8 @@ try {
|
||||
logger.warn("Navigation interface failed to call GetFocusedWindowInstance", e);
|
||||
}
|
||||
if (!win) {
|
||||
logger.warn("Navigation interface could not find any focused window. Falling back to GamepadUIMainWindowInstance");
|
||||
win = Router.WindowStore?.GamepadUIMainWindowInstance;
|
||||
logger.warn("Navigation interface could not find any focused window. Falling back to Main Window Instance");
|
||||
win = Router.WindowStore?.GamepadUIMainWindowInstance || Router?.WindowStore?.SteamUIWindows?.[0];
|
||||
}
|
||||
|
||||
if (win) {
|
||||
|
||||
@@ -25,7 +25,7 @@ export function findSP(): Window {
|
||||
if (document.title == 'SP') return window;
|
||||
// new (SP as popup)
|
||||
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 == 'GamepadUI_Full_Root' || x.m_ID == 'root_1_')?.Root?.Element?.ownerDocument?.defaultView;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -40,6 +40,6 @@ export function getFocusNavController(): any {
|
||||
*/
|
||||
export function getGamepadNavigationTrees(): any {
|
||||
const focusNav = getFocusNavController();
|
||||
const context = focusNav.m_ActiveContext || focusNav.m_LastActiveContext;
|
||||
const context = focusNav?.m_ActiveContext || focusNav?.m_LastActiveContext;
|
||||
return context?.m_rgGamepadNavigationTrees;
|
||||
}
|
||||
|
||||
@@ -52,6 +52,7 @@ export function injectFCTrampoline(component: FC, customHooks?: any): FCTrampoli
|
||||
// we have to redirect this to return an object with component's prototype as a constructor returning a value overrides its prototype
|
||||
window.SP_REACT.createElement = () => {
|
||||
loggingEnabled && logger.debug("createElement hook called");
|
||||
loggingEnabled && console.trace("createElement trace");
|
||||
return Object.create(component.prototype);
|
||||
};
|
||||
}
|
||||
@@ -66,12 +67,16 @@ export function injectFCTrampoline(component: FC, customHooks?: any): FCTrampoli
|
||||
}
|
||||
}
|
||||
|
||||
let renderHookStep = 0;
|
||||
|
||||
// Accessed two times, once directly before class instantiation, and again in some extra logic we don't need to worry about that we hanlde below just in case.
|
||||
Object.defineProperty(component, "contextType", {
|
||||
configurable: true,
|
||||
get: function () {
|
||||
loggingEnabled && logger.debug("get contexttype", this, stubsApplied);
|
||||
applyStubsIfNeeded();
|
||||
loggingEnabled && logger.debug("get contexttype", this, stubsApplied, renderHookStep);
|
||||
loggingEnabled && console.trace("contextType trace");
|
||||
if (renderHookStep == 0) renderHookStep = 1;
|
||||
else if (renderHookStep == 3) renderHookStep = 4;
|
||||
return this._contextType;
|
||||
},
|
||||
set: function (value) {
|
||||
@@ -79,16 +84,20 @@ export function injectFCTrampoline(component: FC, customHooks?: any): FCTrampoli
|
||||
}
|
||||
});
|
||||
|
||||
// Undoes the second contextType access we can't detect shortly before render before it's able to cause any damage
|
||||
Object.defineProperty(component, "getDerivedStateFromProps", {
|
||||
// Always accessed directly after contextType for the path we want to catch.
|
||||
Object.defineProperty(component, "contextTypes", {
|
||||
configurable: true,
|
||||
get: function () {
|
||||
loggingEnabled && logger.debug("get getDerivedStateFromProps", this, stubsApplied);
|
||||
removeStubsIfNeeded();
|
||||
return this._getDerivedStateFromProps;
|
||||
loggingEnabled && logger.debug("get contexttypes", this, stubsApplied, renderHookStep);
|
||||
loggingEnabled && console.trace("contextTypes trace");
|
||||
if (renderHookStep == 1) {
|
||||
renderHookStep = 2;
|
||||
applyStubsIfNeeded();
|
||||
};
|
||||
return this._contextTypes;
|
||||
},
|
||||
set: function (value) {
|
||||
this._getDerivedStateFromProps = value;
|
||||
this._contextTypes = value;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -99,11 +108,32 @@ export function injectFCTrampoline(component: FC, customHooks?: any): FCTrampoli
|
||||
return this._updater;
|
||||
},
|
||||
set: function (value) {
|
||||
loggingEnabled && logger.debug("set updater", this, value, stubsApplied);
|
||||
removeStubsIfNeeded();
|
||||
loggingEnabled && logger.debug("set updater", this, value, stubsApplied, renderHookStep);
|
||||
loggingEnabled && console.trace("updater trace");
|
||||
if (renderHookStep == 2) {
|
||||
renderHookStep = 0;
|
||||
removeStubsIfNeeded();
|
||||
}
|
||||
return this._updater = value;
|
||||
}
|
||||
});
|
||||
|
||||
// Prevents the second contextType+contextTypes access from leaving its hooks around
|
||||
Object.defineProperty(component, "getDerivedStateFromProps", {
|
||||
configurable: true,
|
||||
get: function () {
|
||||
loggingEnabled && logger.debug("get getDerivedStateFromProps", this, stubsApplied, renderHookStep);
|
||||
loggingEnabled && console.trace("getDerivedStateFromProps trace");
|
||||
if (renderHookStep == 2) {
|
||||
renderHookStep = 0;
|
||||
removeStubsIfNeeded();
|
||||
}
|
||||
return this._getDerivedStateFromProps;
|
||||
},
|
||||
set: function (value) {
|
||||
this._getDerivedStateFromProps = value;
|
||||
}
|
||||
});
|
||||
|
||||
return userComponent;
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
import * as React from 'react';
|
||||
import { Ref, useState } from 'react';
|
||||
|
||||
// this shouldn't need to be redeclared but it does for some reason
|
||||
|
||||
@@ -104,19 +105,15 @@ export function wrapReactClass(node: any, prop: any = 'type') {
|
||||
|
||||
export function getReactRoot(o: HTMLElement | Element | Node) {
|
||||
return (
|
||||
// @ts-expect-error 7053
|
||||
o[Object.keys(o).find((k) => k.startsWith('__reactContainer$')) as string] ||
|
||||
// @ts-expect-error 7053
|
||||
o['_reactRootContainer']?._internalRoot?.current
|
||||
(o as any)[Object.keys(o).find((k) => k.startsWith('__reactContainer$')) as string] ||
|
||||
(o as any)['_reactRootContainer']?._internalRoot?.current
|
||||
);
|
||||
}
|
||||
|
||||
export function getReactInstance(o: HTMLElement | Element | Node) {
|
||||
return (
|
||||
// @ts-expect-error 7053
|
||||
o[Object.keys(o).find((k) => k.startsWith('__reactFiber')) as string] ||
|
||||
// @ts-expect-error 7053
|
||||
o[Object.keys(o).find((k) => k.startsWith('__reactInternalInstance')) as string]
|
||||
(o as any)[Object.keys(o).find((k) => k.startsWith('__reactFiber')) as string] ||
|
||||
(o as any)[Object.keys(o).find((k) => k.startsWith('__reactInternalInstance')) as string]
|
||||
);
|
||||
}
|
||||
|
||||
@@ -154,3 +151,21 @@ export const findInReactTree = (node: any, filter: findInTreeFilter) =>
|
||||
// Specialised findInTree for React nodes
|
||||
walkable: ['props', 'children', 'child', 'sibling'],
|
||||
});
|
||||
|
||||
/**
|
||||
* Finds the parent window of a DOM element
|
||||
*/
|
||||
export function getParentWindow<WindowType = Window>(elem: HTMLElement | null): WindowType | null | undefined {
|
||||
return elem?.ownerDocument?.defaultView as any;
|
||||
}
|
||||
|
||||
/**
|
||||
* React hook to find the host window of a component
|
||||
* Pass the returned ref into a React element and window will be its host window.
|
||||
* @returns [ref, window]
|
||||
*/
|
||||
export function useWindowRef<RefElementType extends HTMLElement, WindowType = Window>(): [Ref<RefElementType>, WindowType | null | undefined] {
|
||||
const [win, setWin] = useState<WindowType | null | undefined>(null);
|
||||
|
||||
return [(elem) => setWin(getParentWindow<WindowType>(elem)), win];
|
||||
}
|
||||
Reference in New Issue
Block a user