mirror of
https://github.com/SteamDeckHomebrew/decky-frontend-lib.git
synced 2026-05-22 10:58:46 +02:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
16ec1e3d2e | ||
|
|
db41e74cf9 | ||
|
|
6441bde835 | ||
|
|
29201fadaf |
14
CHANGELOG.md
14
CHANGELOG.md
@@ -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
4
package-lock.json
generated
@@ -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"
|
||||||
|
|||||||
@@ -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",
|
||||||
|
|||||||
@@ -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
|
|
||||||
Reference in New Issue
Block a user