Compare commits

...

2 Commits

Author SHA1 Message Date
semantic-release-bot
6441bde835 chore(release): 3.1.1 [CI SKIP] 2022-09-18 19:02:37 +00:00
AAGaming
29201fadaf fix(Button): add types to DialogButton
also remove useless Button component.
2022-09-18 15:01:44 -04:00
4 changed files with 17 additions and 19 deletions

View File

@@ -1,3 +1,10 @@
## [3.1.1](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.1.0...v3.1.1) (2022-09-18)
### Bug Fixes
* **Button:** add types to DialogButton ([29201fa](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/29201fadafff6bdaa0f8fe7d7806cfa88ec545ab))
# [3.1.0](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.0.0...v3.1.0) (2022-09-18) # [3.1.0](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.0.0...v3.1.0) (2022-09-18)

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{ {
"name": "decky-frontend-lib", "name": "decky-frontend-lib",
"version": "3.1.0", "version": "3.1.1",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "decky-frontend-lib", "name": "decky-frontend-lib",
"version": "3.1.0", "version": "3.1.1",
"license": "GPL-2.0-or-later", "license": "GPL-2.0-or-later",
"dependencies": { "dependencies": {
"minimist": "^1.2.6" "minimist": "^1.2.6"

View File

@@ -1,6 +1,6 @@
{ {
"name": "decky-frontend-lib", "name": "decky-frontend-lib",
"version": "3.1.0", "version": "3.1.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",

View File

@@ -2,29 +2,20 @@ import { CSSProperties, FC } from 'react';
import { CommonUIModule } from '../webpack'; import { CommonUIModule } from '../webpack';
export interface ButtonProps { export interface DialogButtonProps {
label?: string;
style: CSSProperties; style: CSSProperties;
className?: string; className?: string;
noFocusRing?: boolean; noFocusRing?: boolean;
disabled?: boolean; description?: string;
layout?: 'below';
onClick?(e: MouseEvent): void; onClick?(e: MouseEvent): void;
onPointerDown?(e: PointerEvent): void; disabled?: boolean;
onPointerUp?(e: PointerEvent): void; bottomSeparator?: boolean;
onPointerCancel?(e: PointerEvent): void;
onMouseDown?(e: PointerEvent): void;
onMouseUp?(e: MouseEvent): void;
onTouchStart?(e: TouchEvent): void;
onTouchEnd?(e: TouchEvent): void;
onTouchCancel?(e: TouchEvent): void;
onSubmit?(e: SubmitEvent): void;
} }
export const DialogButton = Object.values(CommonUIModule).find( export const DialogButton = Object.values(CommonUIModule).find(
(mod: any) => (mod: any) =>
mod?.render?.toString()?.includes('Object.assign({type:"button"') && mod?.render?.toString()?.includes('Object.assign({type:"button"') &&
mod?.render?.toString()?.includes('DialogButton'), mod?.render?.toString()?.includes('DialogButton'),
) as any; ) as FC<DialogButtonProps>;
// Button isn't exported, so call DialogButton to grab it
export const Button = DialogButton!.render({}).type as FC<ButtonProps>; // its actually a forwarded ref but that doesn't really matter in usage