mirror of
https://github.com/SteamDeckHomebrew/decky-frontend-lib.git
synced 2026-05-20 10:00:08 +02:00
Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7e7a325cd9 | ||
|
|
41d0555d31 | ||
|
|
716f947710 | ||
|
|
ed7ba9bbb6 | ||
|
|
c03db3e0d5 | ||
|
|
aef063d2e2 | ||
|
|
33e5d8541d | ||
|
|
9c34100215 | ||
|
|
a1507ac55b | ||
|
|
484a882015 | ||
|
|
d80c047580 |
21
CHANGELOG.md
21
CHANGELOG.md
@@ -1,3 +1,24 @@
|
||||
## [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)
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@decky/ui",
|
||||
"version": "4.8.3",
|
||||
"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:
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 {
|
||||
@@ -45,6 +164,10 @@ export const MenuItem: FC<MenuItemProps> = findModuleExport(
|
||||
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()),
|
||||
);
|
||||
|
||||
/*
|
||||
all().map(m => {
|
||||
if (typeof m !== "object") return undefined;
|
||||
|
||||
@@ -16,7 +16,7 @@ export interface SidebarNavigationPage {
|
||||
}
|
||||
|
||||
export interface SidebarNavigationProps {
|
||||
title?: string;
|
||||
title?: ReactNode;
|
||||
pages: (SidebarNavigationPage | 'separator')[];
|
||||
showTitle?: boolean;
|
||||
disableRouteReporting?: boolean;
|
||||
|
||||
Reference in New Issue
Block a user