mirror of
https://github.com/SteamDeckHomebrew/decky-frontend-lib.git
synced 2026-05-21 10:29:00 +02:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
66eb0cbbf3 | ||
|
|
6996e5424f | ||
|
|
ad643836f0 | ||
|
|
b39ba26b28 | ||
|
|
130dfa24c5 | ||
|
|
71babc82c8 |
14
CHANGELOG.md
14
CHANGELOG.md
@@ -1,3 +1,17 @@
|
|||||||
|
## [3.2.1](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.2.0...v3.2.1) (2022-09-24)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **modal:** update showModal types ([#27](https://github.com/SteamDeckHomebrew/decky-frontend-lib/issues/27)) ([6996e54](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/6996e5424f33467ef5bb93f47614058c127cb3ee))
|
||||||
|
|
||||||
|
# [3.2.0](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.1.4...v3.2.0) (2022-09-20)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **FooterLegend:** add GamepadEvent ([130dfa2](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/130dfa24c51c3a670cca9ebc38e4891618532bef))
|
||||||
|
|
||||||
## [3.1.4](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.1.3...v3.1.4) (2022-09-19)
|
## [3.1.4](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.1.3...v3.1.4) (2022-09-19)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "decky-frontend-lib",
|
"name": "decky-frontend-lib",
|
||||||
"version": "3.1.4",
|
"version": "3.2.1",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "decky-frontend-lib",
|
"name": "decky-frontend-lib",
|
||||||
"version": "3.1.4",
|
"version": "3.2.1",
|
||||||
"license": "GPL-2.0-or-later",
|
"license": "GPL-2.0-or-later",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"minimist": "^1.2.6"
|
"minimist": "^1.2.6"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "decky-frontend-lib",
|
"name": "decky-frontend-lib",
|
||||||
"version": "3.1.4",
|
"version": "3.2.1",
|
||||||
"description": "A library for building decky plugins",
|
"description": "A library for building decky plugins",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"types": "dist/index.d.ts",
|
"types": "dist/index.d.ts",
|
||||||
|
|||||||
@@ -1 +1,2 @@
|
|||||||
export * from './SuspensefulImage';
|
export * from './SuspensefulImage';
|
||||||
|
export * from './ColorPickerModal';
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
import { CSSProperties, FC, RefAttributes } from 'react';
|
import { CSSProperties, FC, RefAttributes } from 'react';
|
||||||
|
|
||||||
import { CommonUIModule } from '../webpack';
|
import { CommonUIModule } from '../webpack';
|
||||||
|
import { FooterLegendProps } from './FooterLegend';
|
||||||
|
|
||||||
export interface DialogButtonProps extends RefAttributes<HTMLDivElement> {
|
export interface DialogButtonProps extends RefAttributes<HTMLDivElement>, FooterLegendProps {
|
||||||
label?: string;
|
label?: string;
|
||||||
style?: CSSProperties;
|
style?: CSSProperties;
|
||||||
className?: string;
|
className?: string;
|
||||||
|
|||||||
@@ -1,3 +1,51 @@
|
|||||||
|
export enum GamepadButton {
|
||||||
|
INVALID,
|
||||||
|
OK,
|
||||||
|
CANCEL,
|
||||||
|
SECONDARY,
|
||||||
|
OPTIONS,
|
||||||
|
BUMPER_LEFT,
|
||||||
|
BUMPER_RIGHT,
|
||||||
|
TRIGGER_LEFT,
|
||||||
|
TRIGGER_RIGHT,
|
||||||
|
DIR_UP,
|
||||||
|
DIR_DOWN,
|
||||||
|
DIR_LEFT,
|
||||||
|
DIR_RIGHT,
|
||||||
|
SELECT,
|
||||||
|
START,
|
||||||
|
LSTICK_CLICK,
|
||||||
|
RSTICK_CLICK,
|
||||||
|
LSTICK_TOUCH,
|
||||||
|
RSTICK_TOUCH,
|
||||||
|
LPAD_TOUCH,
|
||||||
|
LPAD_CLICK,
|
||||||
|
RPAD_TOUCH,
|
||||||
|
RPAD_CLICK,
|
||||||
|
REAR_LEFT_UPPER,
|
||||||
|
REAR_LEFT_LOWER,
|
||||||
|
REAR_RIGHT_UPPER,
|
||||||
|
REAR_RIGHT_LOWER,
|
||||||
|
STEAM_GUIDE,
|
||||||
|
STEAM_QUICK_MENU
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum NavEntryPositionPreferences {
|
||||||
|
FIRST,
|
||||||
|
LAST,
|
||||||
|
MAINTAIN_X,
|
||||||
|
MAINTAIN_Y,
|
||||||
|
PREFERRED_CHILD
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface GamepadEventDetail {
|
||||||
|
button: number;
|
||||||
|
is_repeat?: boolean;
|
||||||
|
source: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export type GamepadEvent = CustomEvent<GamepadEventDetail>
|
||||||
|
|
||||||
export interface FooterLegendProps {
|
export interface FooterLegendProps {
|
||||||
actionDescriptionMap?: unknown;
|
actionDescriptionMap?: unknown;
|
||||||
onOKActionDescription?: string;
|
onOKActionDescription?: string;
|
||||||
@@ -5,14 +53,14 @@ export interface FooterLegendProps {
|
|||||||
onSecondaryActionDescription?: string;
|
onSecondaryActionDescription?: string;
|
||||||
onOptionsActionDescription?: string;
|
onOptionsActionDescription?: string;
|
||||||
onMenuActionDescription?: string;
|
onMenuActionDescription?: string;
|
||||||
onButtonDown?: () => void;
|
onButtonDown?: (evt: GamepadEvent) => void;
|
||||||
onButtonUp?: () => void;
|
onButtonUp?: (evt: GamepadEvent) => void;
|
||||||
onOKButton?: () => void;
|
onOKButton?: (evt: GamepadEvent) => void;
|
||||||
onCancelButton?: () => void;
|
onCancelButton?: (evt: GamepadEvent) => void;
|
||||||
onSecondaryButton?: () => void;
|
onSecondaryButton?: (evt: GamepadEvent) => void;
|
||||||
onOptionsButton?: () => void;
|
onOptionsButton?: (evt: GamepadEvent) => void;
|
||||||
onGamepadDirection?: () => void;
|
onGamepadDirection?: (evt: GamepadEvent) => void;
|
||||||
onGamepadFocus?: () => void;
|
onGamepadFocus?: (evt: GamepadEvent) => void;
|
||||||
onGamepadBlur?: () => void;
|
onGamepadBlur?: (evt: GamepadEvent) => void;
|
||||||
onMenuButton?: () => void;
|
onMenuButton?: (evt: GamepadEvent) => void;
|
||||||
}
|
}
|
||||||
@@ -1,9 +1,33 @@
|
|||||||
import { FC, ReactNode } from 'react';
|
import { FC, ReactNode } from 'react';
|
||||||
|
|
||||||
import { findModuleChild } from '../webpack';
|
import { findModuleChild } from '../webpack';
|
||||||
|
|
||||||
// TODO: there is another argument, figure out what it does
|
// All of the popout options + strTitle are related. Proper usage is not yet known...
|
||||||
export const showModal: (children: ReactNode, parent?: EventTarget) => void = findModuleChild((m) => {
|
export interface ShowModalProps {
|
||||||
|
browserContext?: unknown; // This is another Deck Object that is yet to be found
|
||||||
|
bForcePopOut?: boolean;
|
||||||
|
bHideActionIcons?: boolean;
|
||||||
|
bHideMainWindowForPopouts?: boolean;
|
||||||
|
bNeverPopOut?: boolean;
|
||||||
|
fnOnClose?: () => void; // Seems to be the same as "closeModal" callback, but only when the modal is a popout. Will no longer work after "Update" invocation!
|
||||||
|
popupHeight?: number;
|
||||||
|
popupWidth?: number;
|
||||||
|
promiseRenderComplete?: Promise<void>; // Invoked once the render is complete. Currently, it seems to be used as image loading success/error callback...
|
||||||
|
strTitle?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ShowModalResult {
|
||||||
|
// This method will not invoke any of the variations of "closeModal" callbacks!
|
||||||
|
Close: () => void;
|
||||||
|
|
||||||
|
// This method will replace the modal element completely and will not update the callback chains,
|
||||||
|
// meaning that "closeModal" and etc. will not automatically close the modal anymore (also "fnOnClose"
|
||||||
|
// will not be even called upon close anymore)! You have to manually call the "Close" method when, for example,
|
||||||
|
// the "closeModal" is invoked in the newly updated modal:
|
||||||
|
// <ModalRoot closeModal={() => { console.log("ABOUT TO CLOSE"); showModalRes.Close(); }} />
|
||||||
|
Update: (modal: ReactNode) => void;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const showModal: (modal: ReactNode, parent?: EventTarget, props?: ShowModalProps) => Promise<ShowModalResult> = 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 (typeof m[prop] === 'function' && m[prop].toString().includes('bHideMainWindowForPopouts:!0')) {
|
if (typeof m[prop] === 'function' && m[prop].toString().includes('bHideMainWindowForPopouts:!0')) {
|
||||||
@@ -46,4 +70,4 @@ export const ModalRoot = findModuleChild((m) => {
|
|||||||
return m[prop];
|
return m[prop];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}) as FC<ModalRootProps>;
|
}) as FC<ModalRootProps>;
|
||||||
|
|||||||
Reference in New Issue
Block a user