mirror of
https://github.com/SteamDeckHomebrew/decky-frontend-lib.git
synced 2026-05-23 19:38:50 +02:00
Compare commits
22 Commits
file_picke
...
v3.22.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
678084e4fd | ||
|
|
4f8f65d429 | ||
|
|
8a352d288d | ||
|
|
fd0d011cbf | ||
|
|
70219d90bc | ||
|
|
1ff9351f96 | ||
|
|
c256d341c8 | ||
|
|
c9b583945c | ||
|
|
c213204ff4 | ||
|
|
9128c1e7da | ||
|
|
a06650cf09 | ||
|
|
3170779c6b | ||
|
|
5ffa14bec8 | ||
|
|
ee51dc5fc0 | ||
|
|
b38ec17d8f | ||
|
|
8b54ee990e | ||
|
|
7e01781d40 | ||
|
|
2b31473614 | ||
|
|
8bfeae4b35 | ||
|
|
a7761321bc | ||
|
|
979a630f2b | ||
|
|
a4d1fcf086 |
55
CHANGELOG.md
55
CHANGELOG.md
@@ -1,3 +1,58 @@
|
|||||||
|
# [3.22.0](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.21.8...v3.22.0) (2023-08-09)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* add patch indicator to prevent crashes ([3170779](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/3170779c6b3d02ea17f7b6c1fbd57e00498ffe4f))
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* add components found while working on tabmaster ([4f8f65d](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/4f8f65d42979149cc80b4a86545d3d0d9bf14bf3))
|
||||||
|
* add components found while working on tabmaster ([fd0d011](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/fd0d011cbf05790c5a1078970b5be72f9267402c))
|
||||||
|
|
||||||
|
## [3.21.8](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.21.7...v3.21.8) (2023-06-27)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* the typescript compiler was eating the enum ([c9b5839](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/c9b583945c1cb5267b41a821743590a841572abe))
|
||||||
|
|
||||||
|
## [3.21.7](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.21.6...v3.21.7) (2023-06-26)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* add patch indicator to prevent crashes ([#88](https://github.com/SteamDeckHomebrew/decky-frontend-lib/issues/88)) ([9128c1e](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/9128c1e7dadb98a8926d3dba9907a01cc78d90cf))
|
||||||
|
|
||||||
|
## [3.21.6](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.21.5...v3.21.6) (2023-06-22)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* reposition parameter for file picker V2 ([ee51dc5](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/ee51dc5fc0dd5bdc2b0b9e10aa27607fbe51f491))
|
||||||
|
|
||||||
|
## [3.21.5](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.21.4...v3.21.5) (2023-06-22)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* missing parameter ([8b54ee9](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/8b54ee990ee4d9b51174737979c35ab7ad92ed7a))
|
||||||
|
|
||||||
|
## [3.21.4](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.21.3...v3.21.4) (2023-06-22)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* move the new file picker api as v2 ([8bfeae4](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/8bfeae4b3593b2efa0aa075a0d9e0b5926cdf169))
|
||||||
|
|
||||||
|
## [3.21.3](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.21.2...v3.21.3) (2023-06-22)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* total is not needed as a return value to plugins ([979a630](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/979a630f2b02ac4a1ac19e38002244f9dfe97177))
|
||||||
|
|
||||||
## [3.21.2](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.21.1...v3.21.2) (2023-06-18)
|
## [3.21.2](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.21.1...v3.21.2) (2023-06-18)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "decky-frontend-lib",
|
"name": "decky-frontend-lib",
|
||||||
"version": "3.21.2",
|
"version": "3.22.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",
|
||||||
|
|||||||
@@ -154,3 +154,16 @@ export const ModalRoot = (Object.values(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
})) as FC<ModalRootProps>;
|
})) as FC<ModalRootProps>;
|
||||||
|
|
||||||
|
interface SimpleModalProps{
|
||||||
|
active?: boolean,
|
||||||
|
children: ReactNode
|
||||||
|
}
|
||||||
|
|
||||||
|
const ModalModule = findModule((mod) => {
|
||||||
|
if (typeof mod !== 'object' || !mod.__esModule) return undefined;
|
||||||
|
if (mod.SimpleModal && mod.ModalPosition) return mod;
|
||||||
|
})
|
||||||
|
|
||||||
|
export const SimpleModal = ModalModule.SimpleModal as FC<SimpleModalProps>
|
||||||
|
export const ModalPosition = ModalModule.ModalPosition as FC<SimpleModalProps>
|
||||||
@@ -2,6 +2,11 @@ import { FC, ReactNode } from 'react';
|
|||||||
|
|
||||||
import { findModuleChild } from '../webpack';
|
import { findModuleChild } from '../webpack';
|
||||||
|
|
||||||
|
export const Panel: FC<{ children?: ReactNode; }> = findModuleChild((mod) => {
|
||||||
|
if (typeof mod !== 'object' || !mod.__esModule) return undefined;
|
||||||
|
return mod.Panel;
|
||||||
|
})
|
||||||
|
|
||||||
export interface PanelSectionProps {
|
export interface PanelSectionProps {
|
||||||
title?: string;
|
title?: string;
|
||||||
spinner?: boolean;
|
spinner?: boolean;
|
||||||
|
|||||||
14
src/deck-components/Scroll.tsx
Normal file
14
src/deck-components/Scroll.tsx
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
import { FC, ReactNode } from "react";
|
||||||
|
import { findModuleChild, findModule } from "../webpack";
|
||||||
|
|
||||||
|
const ScrollingModule = findModule((mod) => {
|
||||||
|
if (typeof mod !== 'object' || !mod.__esModule) return undefined;
|
||||||
|
if (mod.ScrollPanel) return mod;
|
||||||
|
});
|
||||||
|
|
||||||
|
export const ScrollPanel: FC<{ children?: ReactNode; }> = ScrollingModule.ScrollPanel;
|
||||||
|
|
||||||
|
export const ScrollPanelGroup: FC<{ children?: ReactNode; }> = findModuleChild((mod) => {
|
||||||
|
if (typeof mod !== 'object' || !mod.__esModule) return undefined;
|
||||||
|
return mod.ScrollPanelGroup;
|
||||||
|
})
|
||||||
@@ -25,6 +25,7 @@ export * from './TextField';
|
|||||||
export * from './Toggle';
|
export * from './Toggle';
|
||||||
export * from './ToggleField';
|
export * from './ToggleField';
|
||||||
export * from './SteamClient';
|
export * from './SteamClient';
|
||||||
|
export * from './Scroll';
|
||||||
|
|
||||||
import { AppDetails, LogoPosition, SteamAppOverview, SteamClient } from './SteamClient';
|
import { AppDetails, LogoPosition, SteamAppOverview, SteamClient } from './SteamClient';
|
||||||
|
|
||||||
|
|||||||
@@ -55,17 +55,23 @@ export interface Toaster {
|
|||||||
export interface FilePickerRes {
|
export interface FilePickerRes {
|
||||||
path: string;
|
path: string;
|
||||||
realpath: string;
|
realpath: string;
|
||||||
total: number;
|
}
|
||||||
|
|
||||||
|
export const enum FileSelectionType {
|
||||||
|
FILE,
|
||||||
|
FOLDER,
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ServerAPI {
|
export interface ServerAPI {
|
||||||
routerHook: RouterHook;
|
routerHook: RouterHook;
|
||||||
toaster: Toaster;
|
toaster: Toaster;
|
||||||
openFilePicker(
|
openFilePicker(startPath: string, includeFiles?: boolean, regex?: RegExp): Promise<FilePickerRes>;
|
||||||
|
openFilePickerV2(
|
||||||
|
select: FileSelectionType,
|
||||||
startPath: string,
|
startPath: string,
|
||||||
includeFiles?: boolean,
|
includeFiles?: boolean,
|
||||||
filter?: RegExp | ((file: File) => boolean),
|
|
||||||
includeFolders?: boolean,
|
includeFolders?: boolean,
|
||||||
|
filter?: RegExp | ((file: File) => boolean),
|
||||||
extensions?: string[],
|
extensions?: string[],
|
||||||
showHiddenFiles?: boolean,
|
showHiddenFiles?: boolean,
|
||||||
allowAllFiles?: boolean,
|
allowAllFiles?: boolean,
|
||||||
|
|||||||
@@ -46,13 +46,21 @@ export function fakeRenderComponent(fun: Function, customHooks: any = {}): any {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function wrapReactType(node: any, prop: any = 'type') {
|
export function wrapReactType(node: any, prop: any = 'type') {
|
||||||
return (node[prop] = { ...node[prop] });
|
if (node[prop]?.__DECKY_WRAPPED) {
|
||||||
|
return node[prop];
|
||||||
|
} else {
|
||||||
|
return (node[prop] = { ...node[prop], __DECKY_WRAPPED: true });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function wrapReactClass(node: any, prop: any = 'type') {
|
export function wrapReactClass(node: any, prop: any = 'type') {
|
||||||
const cls = node[prop];
|
if (node[prop]?.__DECKY_WRAPPED) {
|
||||||
const wrappedCls = class extends cls {};
|
return node[prop];
|
||||||
return (node[prop] = wrappedCls);
|
} else {
|
||||||
|
const cls = node[prop];
|
||||||
|
const wrappedCls = class extends cls { static __DECKY_WRAPPED = true; };
|
||||||
|
return (node[prop] = wrappedCls);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getReactInstance(o: HTMLElement | Element | Node) {
|
export function getReactInstance(o: HTMLElement | Element | Node) {
|
||||||
|
|||||||
Reference in New Issue
Block a user