Compare commits

...

4 Commits

Author SHA1 Message Date
semantic-release-bot
16ec1e3d2e chore(release): 3.1.2 [CI SKIP] 2022-09-18 19:18:58 +00:00
AAGaming
db41e74cf9 fix(DialogButton): fix types, add ref types 2022-09-18 15:17:56 -04:00
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 26 additions and 21 deletions

View File

@@ -1,3 +1,17 @@
## [3.1.2](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.1.1...v3.1.2) (2022-09-18)
### Bug Fixes
* **DialogButton:** fix types, add ref types ([db41e74](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/db41e74cf9f584301e59556e64a5c2371df18ed0))
## [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.2",
"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.2",
"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.2",
"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

@@ -1,30 +1,21 @@
import { CSSProperties, FC } from 'react'; import { CSSProperties, FC, RefAttributes } from 'react';
import { CommonUIModule } from '../webpack'; import { CommonUIModule } from '../webpack';
export interface ButtonProps { export interface DialogButtonProps extends RefAttributes<HTMLButtonElement> {
style: CSSProperties; label?: string;
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