mirror of
https://github.com/SteamDeckHomebrew/decky-frontend-lib.git
synced 2026-05-24 20:08:54 +02:00
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
55507446cc | ||
|
|
925ea8c3ce | ||
|
|
14c5210931 | ||
|
|
cc29ddaf57 | ||
|
|
1e8979b641 | ||
|
|
7ba1229a4e | ||
|
|
4c2a715324 | ||
|
|
678ba216f1 |
28
CHANGELOG.md
28
CHANGELOG.md
@@ -1,3 +1,31 @@
|
|||||||
|
# [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.0",
|
||||||
"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;
|
||||||
}
|
}
|
||||||
|
|||||||
27
src/deck-components/Marquee.tsx
Normal file
27
src/deck-components/Marquee.tsx
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
import { FC, CSSProperties } 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;
|
||||||
|
}
|
||||||
|
|
||||||
|
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;
|
||||||
|
});
|
||||||
|
|
||||||
|
export default Marquee;
|
||||||
@@ -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