mirror of
https://github.com/SteamDeckHomebrew/decky-frontend-lib.git
synced 2026-05-21 10:29:00 +02:00
Compare commits
14 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0d912eac88 | ||
|
|
789e16380f | ||
|
|
88b50bbc1e | ||
|
|
75f35882f2 | ||
|
|
23af4c0bb4 | ||
|
|
a074277bb5 | ||
|
|
fb49d64fd3 | ||
|
|
cfef1dc320 | ||
|
|
f6b4d6b254 | ||
|
|
0010a1fcee | ||
|
|
28cbc1cfe1 | ||
|
|
fe75dfb5f4 | ||
|
|
91c386a6cc | ||
|
|
bedb6b8bb9 |
49
CHANGELOG.md
49
CHANGELOG.md
@@ -1,3 +1,52 @@
|
|||||||
|
## [3.7.11](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.7.10...v3.7.11) (2022-10-28)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **package.json:** train wtf ([789e163](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/789e16380fd01a6b46188c7a1174a55c18c8dead))
|
||||||
|
|
||||||
|
## [3.7.10](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.7.9...v3.7.10) (2022-10-28)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **tabs:** shut up typescript ([75f3588](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/75f35882f27252e1255208953a6e801c68d5dcec))
|
||||||
|
|
||||||
|
## [3.7.9](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.7.8...v3.7.9) (2022-10-28)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **tabs:** fix on stable for real this time i think ([a074277](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/a074277bb58428a64295154ebf96aceb96e654a7))
|
||||||
|
|
||||||
|
## [3.7.8](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.7.7...v3.7.8) (2022-10-26)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **Field:** fix this time for real ([#44](https://github.com/SteamDeckHomebrew/decky-frontend-lib/issues/44)) ([cfef1dc](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/cfef1dc320a5f649d66c3af365cd6aa2d88e46ea))
|
||||||
|
|
||||||
|
## [3.7.7](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.7.6...v3.7.7) (2022-10-26)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **Field:** remove incompatible properties ([#42](https://github.com/SteamDeckHomebrew/decky-frontend-lib/issues/42)) ([0010a1f](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/0010a1fceedc417aa25b709d066341da97d42444))
|
||||||
|
|
||||||
|
## [3.7.6](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.7.5...v3.7.6) (2022-10-26)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **Field:** add override for onClick type ([#43](https://github.com/SteamDeckHomebrew/decky-frontend-lib/issues/43)) ([fe75dfb](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/fe75dfb5f4fb1ec9417cc07dc714c71820945748))
|
||||||
|
|
||||||
|
## [3.7.5](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.7.4...v3.7.5) (2022-10-26)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **Field:** add types for focusing field ([#41](https://github.com/SteamDeckHomebrew/decky-frontend-lib/issues/41)) ([bedb6b8](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/bedb6b8bb90e021a60e47a93709d6f48e0bd75c6))
|
||||||
|
|
||||||
## [3.7.4](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.7.3...v3.7.4) (2022-10-26)
|
## [3.7.4](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.7.3...v3.7.4) (2022-10-26)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "decky-frontend-lib",
|
"name": "decky-frontend-lib",
|
||||||
"version": "3.7.4",
|
"version": "3.7.11",
|
||||||
"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",
|
||||||
@@ -54,6 +54,7 @@
|
|||||||
"husky": "^8.0.1",
|
"husky": "^8.0.1",
|
||||||
"import-sort-style-module": "^6.0.0",
|
"import-sort-style-module": "^6.0.0",
|
||||||
"jest": "^27.5.1",
|
"jest": "^27.5.1",
|
||||||
|
"minimist": "^1.2.6",
|
||||||
"prettier": "^2.7.1",
|
"prettier": "^2.7.1",
|
||||||
"prettier-plugin-import-sort": "^0.0.7",
|
"prettier-plugin-import-sort": "^0.0.7",
|
||||||
"semantic-release": "^19.0.3",
|
"semantic-release": "^19.0.3",
|
||||||
@@ -78,8 +79,5 @@
|
|||||||
"style": "module",
|
"style": "module",
|
||||||
"parser": "typescript"
|
"parser": "typescript"
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"minimist": "^1.2.6"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
5
pnpm-lock.yaml
generated
5
pnpm-lock.yaml
generated
@@ -25,9 +25,6 @@ specifiers:
|
|||||||
typedoc-plugin-missing-exports: ^1.0.0
|
typedoc-plugin-missing-exports: ^1.0.0
|
||||||
typescript: ^4.6.3
|
typescript: ^4.6.3
|
||||||
|
|
||||||
dependencies:
|
|
||||||
minimist: 1.2.6
|
|
||||||
|
|
||||||
devDependencies:
|
devDependencies:
|
||||||
'@commitlint/cli': 17.0.2
|
'@commitlint/cli': 17.0.2
|
||||||
'@commitlint/config-conventional': 17.0.2
|
'@commitlint/config-conventional': 17.0.2
|
||||||
@@ -41,6 +38,7 @@ devDependencies:
|
|||||||
husky: 8.0.1
|
husky: 8.0.1
|
||||||
import-sort-style-module: 6.0.0
|
import-sort-style-module: 6.0.0
|
||||||
jest: 27.5.1
|
jest: 27.5.1
|
||||||
|
minimist: 1.2.6
|
||||||
prettier: 2.7.1
|
prettier: 2.7.1
|
||||||
prettier-plugin-import-sort: 0.0.7_prettier@2.7.1
|
prettier-plugin-import-sort: 0.0.7_prettier@2.7.1
|
||||||
semantic-release: 19.0.3
|
semantic-release: 19.0.3
|
||||||
@@ -3735,6 +3733,7 @@ packages:
|
|||||||
|
|
||||||
/minimist/1.2.6:
|
/minimist/1.2.6:
|
||||||
resolution: {integrity: sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==}
|
resolution: {integrity: sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==}
|
||||||
|
dev: true
|
||||||
|
|
||||||
/modify-values/1.0.1:
|
/modify-values/1.0.1:
|
||||||
resolution: {integrity: sha512-xV2bxeN6F7oYjZWTe/YPAy6MN2M+sL4u/Rlm2AHCIVGfo2p1yGmBHQ6vHehl4bRTZBdHu3TSkWdYgkwpYzAGSw==}
|
resolution: {integrity: sha512-xV2bxeN6F7oYjZWTe/YPAy6MN2M+sL4u/Rlm2AHCIVGfo2p1yGmBHQ6vHehl4bRTZBdHu3TSkWdYgkwpYzAGSw==}
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import { FC, HTMLAttributes, ReactNode, RefAttributes } from 'react';
|
import { FC, ReactNode, RefAttributes } from 'react';
|
||||||
|
|
||||||
import { findModuleChild } from '../webpack';
|
import { findModuleChild } from '../webpack';
|
||||||
import { FooterLegendProps } from './FooterLegend';
|
import { FooterLegendProps } from './FooterLegend';
|
||||||
|
|
||||||
export interface FieldProps extends HTMLAttributes<HTMLDivElement>, FooterLegendProps {
|
export interface FieldProps extends FooterLegendProps {
|
||||||
label?: ReactNode;
|
label?: ReactNode;
|
||||||
bottomSeparator?: 'standard' | 'thick' | 'none';
|
bottomSeparator?: 'standard' | 'thick' | 'none';
|
||||||
description?: ReactNode;
|
description?: ReactNode;
|
||||||
@@ -18,6 +18,9 @@ export interface FieldProps extends HTMLAttributes<HTMLDivElement>, FooterLegend
|
|||||||
highlightOnFocus?: boolean;
|
highlightOnFocus?: boolean;
|
||||||
indentLevel?: number;
|
indentLevel?: number;
|
||||||
verticalAlignment?: 'center' | 'none'; // Alligns inline label with children
|
verticalAlignment?: 'center' | 'none'; // Alligns inline label with children
|
||||||
|
focusable?: boolean; // Allows to get focus without any focusable children or on* callbacks
|
||||||
|
onActivate?: (e: CustomEvent | MouseEvent) => void;
|
||||||
|
onClick?: (e: CustomEvent | MouseEvent) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const Field = findModuleChild((m) => {
|
export const Field = findModuleChild((m) => {
|
||||||
|
|||||||
@@ -65,16 +65,11 @@ export interface TabsProps {
|
|||||||
autoFocusContents?: boolean;
|
autoFocusContents?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
declare global {
|
|
||||||
interface Window {
|
|
||||||
DeckyPluginLoader: any;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
let tabsComponent: any;
|
let tabsComponent: any;
|
||||||
|
|
||||||
const getTabs = async () => {
|
const getTabs = async () => {
|
||||||
if (tabsComponent) return tabsComponent;
|
if (tabsComponent) return tabsComponent;
|
||||||
|
// @ts-ignore
|
||||||
while (!window?.DeckyPluginLoader?.routerHook?.routes) {
|
while (!window?.DeckyPluginLoader?.routerHook?.routes) {
|
||||||
console.debug('[DFL:Tabs]: Waiting for Decky router...');
|
console.debug('[DFL:Tabs]: Waiting for Decky router...');
|
||||||
await sleep(500);
|
await sleep(500);
|
||||||
@@ -83,6 +78,7 @@ const getTabs = async () => {
|
|||||||
() => {
|
() => {
|
||||||
return findInReactTree(
|
return findInReactTree(
|
||||||
findInReactTree(
|
findInReactTree(
|
||||||
|
// @ts-ignore
|
||||||
window.DeckyPluginLoader.routerHook.routes
|
window.DeckyPluginLoader.routerHook.routes
|
||||||
.find((x: any) => x.props.path == '/library/app/:appid/achievements')
|
.find((x: any) => x.props.path == '/library/app/:appid/achievements')
|
||||||
.props.children.type(),
|
.props.children.type(),
|
||||||
@@ -109,27 +105,30 @@ try {
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
if (oldTabsModule) oldTabs = Object.values(oldTabsModule).find((x: any) => x?.type?.toString()?.includes("((function(") && x?.type?.toString()?.includes("[\"tabs\""));
|
if (oldTabsModule)
|
||||||
|
oldTabs = Object.values(oldTabsModule).find((x: any) => x?.type?.toString()?.includes('((function(){'));
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error("Error finding oldTabs:", e)
|
console.error('Error finding oldTabs:', e);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tabs component as used in the library and media tabs. See {@link TabsProps}
|
* Tabs component as used in the library and media tabs. See {@link TabsProps}
|
||||||
* Unlike other components in `decky-frontend-lib`, this requires Decky Loader to be running.
|
* Unlike other components in `decky-frontend-lib`, this requires Decky Loader to be running.
|
||||||
*/
|
*/
|
||||||
export const Tabs = oldTabs || ((props: TabsProps) => {
|
export const Tabs =
|
||||||
const found = tabsComponent;
|
oldTabs ||
|
||||||
const [tc, setTC] = useState<FC<TabsProps>>(found);
|
(((props: TabsProps) => {
|
||||||
useEffect(() => {
|
const found = tabsComponent;
|
||||||
if (found) return;
|
const [tc, setTC] = useState<FC<TabsProps>>(found);
|
||||||
(async () => {
|
useEffect(() => {
|
||||||
console.debug('[DFL:Tabs]: Finding component...');
|
if (found) return;
|
||||||
const t = await getTabs();
|
(async () => {
|
||||||
console.debug('[DFL:Tabs]: Found!');
|
console.debug('[DFL:Tabs]: Finding component...');
|
||||||
setTC(t);
|
const t = await getTabs();
|
||||||
})();
|
console.debug('[DFL:Tabs]: Found!');
|
||||||
}, []);
|
setTC(t);
|
||||||
console.log('tc', tc);
|
})();
|
||||||
return tc ? createElement(tc, props) : <SteamSpinner />;
|
}, []);
|
||||||
}) as FC<TabsProps>;
|
console.log('tc', tc);
|
||||||
|
return tc ? createElement(tc, props) : <SteamSpinner />;
|
||||||
|
}) as FC<TabsProps>);
|
||||||
|
|||||||
Reference in New Issue
Block a user