Compare commits

..

4 Commits

Author SHA1 Message Date
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
semantic-release-bot
33aaf56f96 chore(release): 0.9.1 [CI SKIP] 2022-06-09 02:08:28 +00:00
AAGaming
dddb703a2e fix(SuspensefulImage): fix export 2022-06-08 22:07:51 -04:00
4 changed files with 31 additions and 15 deletions

View File

@@ -1,3 +1,17 @@
# [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)
### Bug Fixes
* **SuspensefulImage:** fix export ([dddb703](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/dddb703a2e712bf2e9d7e172a414c63ffd6a1cc9))
# [0.9.0](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v0.8.0...v0.9.0) (2022-06-09)

View File

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

View File

@@ -7,7 +7,7 @@ interface SuspensefulImageProps extends ImgHTMLAttributes<HTMLImageElement> {
suspenseHeight?: string | number;
}
const SuspensefulImage: FC<SuspensefulImageProps> = (props) => {
export const SuspensefulImage: FC<SuspensefulImageProps> = (props) => {
const [loading, setLoading] = useState(true);
const [error, setError] = useState(false);
@@ -38,6 +38,4 @@ const SuspensefulImage: FC<SuspensefulImageProps> = (props) => {
) : (
<img {...props} />
);
};
export default SuspensefulImage;
};

View File

@@ -1,15 +1,19 @@
import { ReactNode, VFC } from "react";
import { HTMLAttributes, ReactNode, 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?: () => void;
onCancel?: () => 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];
}
}
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>;