mirror of
https://github.com/SteamDeckHomebrew/decky-frontend-lib.git
synced 2026-05-25 12:28:53 +02:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9b79f70ac7 | ||
|
|
d237bd48e4 | ||
|
|
f7d73b4dc3 | ||
|
|
9edb1e6b97 | ||
|
|
605e4f5eae |
@@ -1,7 +1,15 @@
|
|||||||
{
|
{
|
||||||
"branches": ["main", "dev"],
|
"branches": ["main", "dev"],
|
||||||
"plugins": [
|
"plugins": [
|
||||||
"@semantic-release/commit-analyzer",
|
[
|
||||||
|
"@semantic-release/commit-analyzer",
|
||||||
|
{
|
||||||
|
"preset": "angular",
|
||||||
|
"releaseRules": [
|
||||||
|
{"type": "chore", "scope": "classes", "release": "patch"}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
"@semantic-release/release-notes-generator",
|
"@semantic-release/release-notes-generator",
|
||||||
"@semantic-release/changelog",
|
"@semantic-release/changelog",
|
||||||
"@semantic-release/npm",
|
"@semantic-release/npm",
|
||||||
|
|||||||
@@ -1,3 +1,12 @@
|
|||||||
|
# [1.7.0](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v1.6.2...v1.7.0) (2022-08-17)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **utils:** add wrapReactClass ([d237bd4](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/d237bd48e4b9e6436d7daefdf70327875e9e940d))
|
||||||
|
|
||||||
|
## [1.6.2](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v1.6.1...v1.6.2) (2022-08-15)
|
||||||
|
|
||||||
## [1.6.1](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v1.6.0...v1.6.1) (2022-08-13)
|
## [1.6.1](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v1.6.0...v1.6.1) (2022-08-13)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "decky-frontend-lib",
|
"name": "decky-frontend-lib",
|
||||||
"version": "1.6.1",
|
"version": "1.7.0",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "decky-frontend-lib",
|
"name": "decky-frontend-lib",
|
||||||
"version": "1.6.1",
|
"version": "1.7.0",
|
||||||
"license": "GPL-2.0-or-later",
|
"license": "GPL-2.0-or-later",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"minimist": "^1.2.6"
|
"minimist": "^1.2.6"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "decky-frontend-lib",
|
"name": "decky-frontend-lib",
|
||||||
"version": "1.6.1",
|
"version": "1.7.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",
|
||||||
|
|||||||
@@ -63,6 +63,14 @@ type StaticClasses = Record<
|
|||||||
string
|
string
|
||||||
>;
|
>;
|
||||||
|
|
||||||
|
type ScrollClasses = Record<
|
||||||
|
| 'ScrollBoth'
|
||||||
|
| 'ScrollPanel'
|
||||||
|
| 'ScrollX'
|
||||||
|
| 'ScrollY',
|
||||||
|
string
|
||||||
|
>;
|
||||||
|
|
||||||
type GamepadDialogClasses = Record<
|
type GamepadDialogClasses = Record<
|
||||||
| 'duration-app-launch'
|
| 'duration-app-launch'
|
||||||
| 'GamepadDialogContent'
|
| 'GamepadDialogContent'
|
||||||
@@ -167,6 +175,16 @@ export const staticClasses: StaticClasses = findModule((mod) => {
|
|||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
export const scrollClasses: ScrollClasses = findModule((mod) => {
|
||||||
|
if (typeof mod !== 'object') return false;
|
||||||
|
|
||||||
|
if (mod.ScrollPanel && mod.ScrollY) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
|
||||||
export const gamepadDialogClasses: GamepadDialogClasses = findModule((mod) => {
|
export const gamepadDialogClasses: GamepadDialogClasses = findModule((mod) => {
|
||||||
if (typeof mod !== 'object') return false;
|
if (typeof mod !== 'object') return false;
|
||||||
|
|
||||||
|
|||||||
10
src/utils.ts
10
src/utils.ts
@@ -82,8 +82,14 @@ export function unpatch(obj: any, name: any): void {
|
|||||||
obj[name] = obj[name].__deckyOrig;
|
obj[name] = obj[name].__deckyOrig;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function wrapReactType(node: any) {
|
export function wrapReactType(node: any, prop?: any) {
|
||||||
return node.type = {...node.type}
|
return node[prop || "type"] = {...node[prop || "type"]};
|
||||||
|
}
|
||||||
|
|
||||||
|
export function wrapReactClass(node: any, prop?: any) {
|
||||||
|
const cls = node[prop || "type"];
|
||||||
|
const wrappedCls = class extends cls {};
|
||||||
|
return node[prop || "type"] = wrappedCls;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getReactInstance(o: HTMLElement | Element | Node) {
|
export function getReactInstance(o: HTMLElement | Element | Node) {
|
||||||
|
|||||||
Reference in New Issue
Block a user