Compare commits

...

11 Commits

Author SHA1 Message Date
semantic-release-bot
32d1303191 chore(release): 0.10.4 [CI SKIP] 2022-06-19 15:40:15 +00:00
AAGaming
1ce15d261f fix(plugin): correct return type on injectCssIntoTab 2022-06-19 11:39:35 -04:00
semantic-release-bot
bf52e0761c chore(release): 0.10.3 [CI SKIP] 2022-06-18 15:16:51 +00:00
AAGaming
823a2745f9 fix(ServerAPI): add injectCssIntoTab to serverAPI typings 2022-06-18 11:10:35 -04:00
semantic-release-bot
21f7874cab chore(release): 0.10.2 [CI SKIP] 2022-06-16 21:33:44 +00:00
AAGaming
077334e376 fix(Router): add NavigateBackOrOpenMenu() 2022-06-16 17:32:58 -04:00
semantic-release-bot
02f4c5c518 chore(release): 0.10.1 [CI SKIP] 2022-06-16 21:27:22 +00:00
AAGaming
f1e20cd0b5 fix(Focusable): add ref prop, fix event types 2022-06-16 17:26:31 -04:00
Jonas Dellinger
b5d9265705 chore(release): also include package-lock.json in release assets 2022-06-13 10:53:01 +02:00
semantic-release-bot
734ce33e1b chore(release): 0.10.0 [CI SKIP] 2022-06-10 20:57:30 +00:00
AAGaming
9beab5f7e9 feat(components): remove HorizontalFocus, add Focusable 2022-06-10 16:56:39 -04:00
7 changed files with 56 additions and 15 deletions

View File

@@ -9,7 +9,7 @@
[
"@semantic-release/git",
{
"assets": ["CHANGELOG.md", "package.json"],
"assets": ["CHANGELOG.md", "package.json", "package-lock.json"],
"message": "chore(release): ${nextRelease.version} [CI SKIP]"
}
]

View File

@@ -1,3 +1,38 @@
## [0.10.4](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v0.10.3...v0.10.4) (2022-06-19)
### Bug Fixes
* **plugin:** correct return type on injectCssIntoTab ([1ce15d2](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/1ce15d261f4726a2f8bdaff7c8a98497f2622969))
## [0.10.3](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v0.10.2...v0.10.3) (2022-06-18)
### Bug Fixes
* **ServerAPI:** add injectCssIntoTab to serverAPI typings ([823a274](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/823a2745f9717ed2d2a5d95e2ef25739bffc18c9))
## [0.10.2](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v0.10.1...v0.10.2) (2022-06-16)
### Bug Fixes
* **Router:** add NavigateBackOrOpenMenu() ([077334e](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/077334e376fb42283e094f0b57c818c580c6f7ba))
## [0.10.1](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v0.10.0...v0.10.1) (2022-06-16)
### Bug Fixes
* **Focusable:** add ref prop, fix event types ([f1e20cd](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/f1e20cd0b54622d634202c85cca920323e4df336))
# [0.10.0](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v0.9.1...v0.10.0) (2022-06-10)
### Features
* **components:** remove HorizontalFocus, add Focusable ([9beab5f](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/9beab5f7e913f2ef2a8a3047046a524d3007c3b8))
## [0.9.1](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v0.9.0...v0.9.1) (2022-06-09)

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "decky-frontend-lib",
"version": "0.0.6",
"version": "0.10.4",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "decky-frontend-lib",
"version": "0.0.6",
"version": "0.10.4",
"hasInstallScript": true,
"license": "GPL-2.0-or-later",
"devDependencies": {

View File

@@ -1,6 +1,6 @@
{
"name": "decky-frontend-lib",
"version": "0.9.1",
"version": "0.10.4",
"description": "A library for building decky plugins",
"main": "dist/index.js",
"types": "dist/index.d.ts",

View File

@@ -1,15 +1,19 @@
import { ReactNode, VFC } from "react";
import { HTMLAttributes, ReactNode, RefAttributes, VFC } from "react";
import { findModuleChild } from "../webpack";
export interface FocusableProps {
children: ReactNode;
export interface FocusableProps extends HTMLAttributes<HTMLDivElement> {
children: ReactNode;
"flow-children"?: string;
focusClassName?: string;
focusWithinClassName?: string;
onActivate?: (e: CustomEvent) => void;
onCancel?: (e: CustomEvent) => void;
}
export const HorizontalFocus = findModuleChild(m => {
if (typeof m !== "object") return undefined;
for (let prop in m) {
if (m[prop]?.toString()?.includes('"children","alignItems","spacing"')) {
return m[prop];
}
}
}) as VFC<FocusableProps>;
export const Focusable = findModuleChild((m) => {
if (typeof m !== 'object') return undefined;
for (let prop in m) {
if (m[prop]?.render?.toString()?.includes('["flow-children","onActivate","onCancel","focusClassName",'))
return m[prop];
}
}) as VFC<FocusableProps & RefAttributes<HTMLDivElement>>;

View File

@@ -22,6 +22,7 @@ export interface Router {
OpenQuickAccessMenu(quickAccessTab: QuickAccessTab): void;
GetQuickAccessTab(): QuickAccessTab;
Navigate(path: string): void;
NavigateBackOrOpenMenu(): void;
NavigateToExternalWeb(url: string): void;
NavigateToStore(): void;
ToggleSideMenu(sideMenu: SideMenu): void;

View File

@@ -31,6 +31,7 @@ export interface ServerAPI {
callServerMethod<TArgs = {}, TRes = {}>(methodName: string, args: TArgs): Promise<ServerResponse<TRes>>;
fetchNoCors<TRes = {}>(url: string, request: RequestInfo): Promise<ServerResponse<TRes>>;
executeInTab(tab: string, runAsync: boolean, code: string): Promise<unknown>;
injectCssIntoTab<TRes = string>(tab: string, style: string): Promise<ServerResponse<TRes>>;
removeCssFromTab(tab: string, cssId: string): Promise<unknown>;
}