mirror of
https://github.com/SteamDeckHomebrew/decky-frontend-lib.git
synced 2026-05-25 20:38:52 +02:00
Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d9150c2556 | ||
|
|
cd0635e94f | ||
|
|
443c7850d7 | ||
|
|
d24136ecb6 | ||
|
|
55507446cc | ||
|
|
925ea8c3ce | ||
|
|
14c5210931 | ||
|
|
cc29ddaf57 | ||
|
|
1e8979b641 | ||
|
|
7ba1229a4e | ||
|
|
4c2a715324 | ||
|
|
678ba216f1 |
42
CHANGELOG.md
42
CHANGELOG.md
@@ -1,3 +1,45 @@
|
|||||||
|
## [3.16.2](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.16.1...v3.16.2) (2022-12-11)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **Marquee:** replace default export with named export ([cd0635e](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/cd0635e94f98499f9f5fc24a7fd4b93efe7dfc38))
|
||||||
|
|
||||||
|
## [3.16.1](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.16.0...v3.16.1) (2022-12-11)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **FooterLegend:** change description types to ReactNode ([#62](https://github.com/SteamDeckHomebrew/decky-frontend-lib/issues/62)) ([d24136e](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/d24136ecb6b0c5239b68723e8f92a4822aa7b590))
|
||||||
|
|
||||||
|
# [3.16.0](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.15.0...v3.16.0) (2022-12-11)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **Marquee:** Add Marquee component ([#63](https://github.com/SteamDeckHomebrew/decky-frontend-lib/issues/63)) ([925ea8c](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/925ea8c3ceaaf6ff2f79b8808908a9b144a4fcff))
|
||||||
|
|
||||||
|
# [3.15.0](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.14.0...v3.15.0) (2022-12-11)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **Focusable:** add noFocusRing prop type ([#65](https://github.com/SteamDeckHomebrew/decky-frontend-lib/issues/65)) ([cc29dda](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/cc29ddaf578e21ab2abe1cd266f1d15debee0637))
|
||||||
|
|
||||||
|
# [3.14.0](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.13.0...v3.14.0) (2022-12-10)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **toast:** add showToast/playSound to ToastData ([#64](https://github.com/SteamDeckHomebrew/decky-frontend-lib/issues/64)) ([7ba1229](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/7ba1229a4e24fea587b96dc8b078200faf45ddee))
|
||||||
|
|
||||||
|
# [3.13.0](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.12.0...v3.13.0) (2022-11-29)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **Menu:** add more missing props ([#60](https://github.com/SteamDeckHomebrew/decky-frontend-lib/issues/60)) [CI SKIP] ([678ba21](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/678ba216f1e194986b0c391398e6f73536cd0102))
|
||||||
|
|
||||||
# [3.12.0](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.11.1...v3.12.0) (2022-11-28)
|
# [3.12.0](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.11.1...v3.12.0) (2022-11-28)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "decky-frontend-lib",
|
"name": "decky-frontend-lib",
|
||||||
"version": "3.12.0",
|
"version": "3.16.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",
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ export interface FocusableProps extends HTMLAttributes<HTMLDivElement>, FooterLe
|
|||||||
'flow-children'?: string;
|
'flow-children'?: string;
|
||||||
focusClassName?: string;
|
focusClassName?: string;
|
||||||
focusWithinClassName?: string;
|
focusWithinClassName?: string;
|
||||||
|
noFocusRing?: boolean;
|
||||||
onActivate?: (e: CustomEvent) => void;
|
onActivate?: (e: CustomEvent) => void;
|
||||||
onCancel?: (e: CustomEvent) => void;
|
onCancel?: (e: CustomEvent) => void;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
import { ReactNode } from 'react';
|
||||||
|
|
||||||
export enum GamepadButton {
|
export enum GamepadButton {
|
||||||
INVALID,
|
INVALID,
|
||||||
OK,
|
OK,
|
||||||
@@ -42,16 +44,16 @@ export interface GamepadEventDetail {
|
|||||||
source: number;
|
source: number;
|
||||||
}
|
}
|
||||||
export declare type ActionDescriptionMap = {
|
export declare type ActionDescriptionMap = {
|
||||||
[key in GamepadButton]?: string
|
[key in GamepadButton]?: ReactNode
|
||||||
}
|
}
|
||||||
export declare type GamepadEvent = CustomEvent<GamepadEventDetail>;
|
export declare type GamepadEvent = CustomEvent<GamepadEventDetail>;
|
||||||
export interface FooterLegendProps {
|
export interface FooterLegendProps {
|
||||||
actionDescriptionMap?: ActionDescriptionMap;
|
actionDescriptionMap?: ActionDescriptionMap;
|
||||||
onOKActionDescription?: string;
|
onOKActionDescription?: ReactNode;
|
||||||
onCancelActionDescription?: string;
|
onCancelActionDescription?: ReactNode;
|
||||||
onSecondaryActionDescription?: string;
|
onSecondaryActionDescription?: ReactNode;
|
||||||
onOptionsActionDescription?: string;
|
onOptionsActionDescription?: ReactNode;
|
||||||
onMenuActionDescription?: string;
|
onMenuActionDescription?: ReactNode;
|
||||||
onButtonDown?: (evt: GamepadEvent) => void;
|
onButtonDown?: (evt: GamepadEvent) => void;
|
||||||
onButtonUp?: (evt: GamepadEvent) => void;
|
onButtonUp?: (evt: GamepadEvent) => void;
|
||||||
onOKButton?: (evt: GamepadEvent) => void;
|
onOKButton?: (evt: GamepadEvent) => void;
|
||||||
|
|||||||
26
src/deck-components/Marquee.tsx
Normal file
26
src/deck-components/Marquee.tsx
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
import { CSSProperties, FC } from 'react';
|
||||||
|
|
||||||
|
import { findModuleChild } from '../webpack';
|
||||||
|
|
||||||
|
export interface MarqueeProps {
|
||||||
|
play?: boolean;
|
||||||
|
direction?: 'left' | 'right';
|
||||||
|
speed?: number;
|
||||||
|
delay?: number;
|
||||||
|
fadeLength?: number;
|
||||||
|
center?: boolean;
|
||||||
|
resetOnPause?: boolean;
|
||||||
|
style?: CSSProperties;
|
||||||
|
className?: string;
|
||||||
|
children: React.ReactNode;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const Marquee: FC<MarqueeProps> = findModuleChild((m) => {
|
||||||
|
if (typeof m !== 'object') return;
|
||||||
|
for (const prop in m) {
|
||||||
|
if (m[prop]?.toString && m[prop].toString().includes('.Marquee') && m[prop].toString().includes('--fade-length')) {
|
||||||
|
return m[prop];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
});
|
||||||
@@ -2,6 +2,7 @@ import { FC, ReactNode } from 'react';
|
|||||||
|
|
||||||
import { fakeRenderComponent } from '../utils';
|
import { fakeRenderComponent } from '../utils';
|
||||||
import { findModuleChild } from '../webpack';
|
import { findModuleChild } from '../webpack';
|
||||||
|
import { FooterLegendProps } from './FooterLegend';
|
||||||
|
|
||||||
export const showContextMenu: (children: ReactNode, parent?: EventTarget) => void = findModuleChild((m) => {
|
export const showContextMenu: (children: ReactNode, parent?: EventTarget) => void = findModuleChild((m) => {
|
||||||
if (typeof m !== 'object') return undefined;
|
if (typeof m !== 'object') return undefined;
|
||||||
@@ -12,7 +13,7 @@ export const showContextMenu: (children: ReactNode, parent?: EventTarget) => voi
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
export interface MenuProps {
|
export interface MenuProps extends FooterLegendProps {
|
||||||
label: string;
|
label: string;
|
||||||
onCancel?(): void;
|
onCancel?(): void;
|
||||||
cancelText?: string;
|
cancelText?: string;
|
||||||
@@ -49,13 +50,16 @@ export const MenuGroup: FC<MenuGroupProps> = findModuleChild((m) => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
export interface MenuItemProps {
|
export interface MenuItemProps extends FooterLegendProps {
|
||||||
bInteractableItem?: boolean;
|
bInteractableItem?: boolean;
|
||||||
onClick?(evt: Event): void;
|
onClick?(evt: Event): void;
|
||||||
onSelected?(evt: Event): void;
|
onSelected?(evt: Event): void;
|
||||||
onMouseEnter?(evt: MouseEvent): void;
|
onMouseEnter?(evt: MouseEvent): void;
|
||||||
onMoveRight?(): void;
|
onMoveRight?(): void;
|
||||||
|
selected?: boolean;
|
||||||
disabled?: boolean;
|
disabled?: boolean;
|
||||||
|
bPlayAudio?: boolean;
|
||||||
|
tone?: 'positive' | 'emphasis' | 'destructive';
|
||||||
children?: ReactNode;
|
children?: ReactNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ export * from './Field';
|
|||||||
export * from './Focusable';
|
export * from './Focusable';
|
||||||
export * from './FocusRing';
|
export * from './FocusRing';
|
||||||
export * from './FooterLegend';
|
export * from './FooterLegend';
|
||||||
|
export * from './Marquee';
|
||||||
export * from './Menu';
|
export * from './Menu';
|
||||||
export * from './Modal';
|
export * from './Modal';
|
||||||
export * from './Panel';
|
export * from './Panel';
|
||||||
|
|||||||
@@ -42,6 +42,10 @@ export interface ToastData {
|
|||||||
contentClassName?: string;
|
contentClassName?: string;
|
||||||
duration?: number;
|
duration?: number;
|
||||||
critical?: boolean;
|
critical?: boolean;
|
||||||
|
eType?: number;
|
||||||
|
sound?: number;
|
||||||
|
playSound?: boolean;
|
||||||
|
showToast?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface Toaster {
|
export interface Toaster {
|
||||||
|
|||||||
Reference in New Issue
Block a user