@decky/ui 4.11.1 → 4.11.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Dialog.js +5 -2
- package/dist/components/ProgressBar.js +1 -1
- package/dist/components/Scroll.js +1 -1
- package/dist/components/Spinner.d.ts +1 -2
- package/dist/components/Spinner.js +1 -1
- package/dist/components/Tabs.js +1 -1
- package/dist/utils/react/fc.js +19 -0
- package/dist/webpack.js +1 -1
- package/package.json +2 -2
- package/src/components/Dialog.ts +11 -2
- package/src/components/ProgressBar.ts +2 -1
- package/src/components/Scroll.ts +2 -1
- package/src/components/Spinner.ts +2 -2
- package/src/components/Tabs.ts +1 -1
- package/src/utils/react/fc.ts +19 -0
- package/src/webpack.ts +1 -1
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { CommonUIModule } from '../webpack';
|
|
2
|
-
const CommonDialogDivs = Object.values(CommonUIModule).filter((m) => typeof m === 'object' &&
|
|
3
|
-
m?.render?.toString().includes('
|
|
2
|
+
const CommonDialogDivs = Object.values(CommonUIModule).filter((m) => typeof m === 'object' &&
|
|
3
|
+
(m?.render?.toString().includes('jsx)("div",{...') ||
|
|
4
|
+
m?.render?.toString().includes('jsx)("div",Object.assign({},')) ||
|
|
5
|
+
(m?.render?.toString().includes('createElement("div",{...') ||
|
|
6
|
+
m?.render?.toString().includes('createElement("div",Object.assign({},')));
|
|
4
7
|
const MappedDialogDivs = new Map(Object.values(CommonDialogDivs).map((m) => {
|
|
5
8
|
try {
|
|
6
9
|
const renderedDiv = m.render({});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { findModuleExport } from '../webpack';
|
|
2
2
|
import { createPropListRegex } from '../utils';
|
|
3
3
|
export const ProgressBar = findModuleExport((e) => e?.toString?.()?.includes('.ProgressBar,"standard"=='));
|
|
4
|
-
export const ProgressBarWithInfo = findModuleExport((e) => e?.toString?.()?.includes('.ProgressBarFieldStatus},'));
|
|
4
|
+
export const ProgressBarWithInfo = findModuleExport((e) => e?.toString?.()?.includes('.ProgressBarFieldStatus,children') || e?.toString?.()?.includes('.ProgressBarFieldStatus},'));
|
|
5
5
|
const progressBarItemRegex = createPropListRegex(["indeterminate", "nTransitionSec", "nProgress"]);
|
|
6
6
|
export const ProgressBarItem = findModuleExport((e) => e?.toString && progressBarItemRegex.test(e.toString()));
|
|
@@ -2,4 +2,4 @@ import { findModuleByExport, findModuleExport } from '../webpack';
|
|
|
2
2
|
const ScrollingModule = findModuleByExport((e) => e?.render?.toString?.().includes('{case"x":'));
|
|
3
3
|
const ScrollingModuleProps = ScrollingModule ? Object.values(ScrollingModule) : [];
|
|
4
4
|
export const ScrollPanel = ScrollingModuleProps.find((prop) => prop?.render?.toString?.().includes('{case"x":'));
|
|
5
|
-
export const ScrollPanelGroup = findModuleExport((e) => e?.render?.toString().includes('.FocusVisibleChild()),[])'));
|
|
5
|
+
export const ScrollPanelGroup = findModuleExport((e) => e?.render?.toString().includes('.FocusVisibleChild(),[])') || e?.render?.toString().includes('.FocusVisibleChild()),[])'));
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const Spinner: FC<SVGAttributes<SVGElement>>;
|
|
1
|
+
export declare const Spinner: any;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { IconsModule } from '../webpack';
|
|
2
|
-
export const Spinner = Object.values(IconsModule)?.find((mod) => mod?.toString && /Spinner\)}\)?,.\.createElement\(\"path\",{d:\"M18 /.test(mod.toString()));
|
|
2
|
+
export const Spinner = IconsModule && Object.values(IconsModule)?.find((mod) => mod?.toString && /Spinner\),children:\[\(0,\w+\.jsx\)\("path",\{d:"M18 /.test(mod.toString()) || /Spinner\)}\)?,.\.createElement\(\"path\",{d:\"M18 /.test(mod.toString()));
|
package/dist/components/Tabs.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { findModuleByExport } from '../webpack';
|
|
2
2
|
const tabsModule = findModuleByExport(e => e?.toString?.()?.includes(".TabRowTabs") && e?.toString?.()?.includes("activeTab:"));
|
|
3
|
-
export const Tabs = tabsModule && Object.values(tabsModule).find((e) => e?.type?.toString?.()?.includes("(
|
|
3
|
+
export const Tabs = tabsModule && Object.values(tabsModule).find((e) => e?.type?.toString?.()?.includes("(function()"));
|
package/dist/utils/react/fc.js
CHANGED
|
@@ -17,6 +17,9 @@ export function injectFCTrampoline(component, customHooks) {
|
|
|
17
17
|
};
|
|
18
18
|
component.prototype.isReactComponent = true;
|
|
19
19
|
let stubsApplied = false;
|
|
20
|
+
const patchJsx = window.SP_REACTDOM.version.startsWith("19.");
|
|
21
|
+
let oldJsx = window.SP_JSX?.jsx;
|
|
22
|
+
let oldJsxs = window.SP_JSX?.jsxs;
|
|
20
23
|
let oldCreateElement = window.SP_REACT.createElement;
|
|
21
24
|
const applyStubsIfNeeded = () => {
|
|
22
25
|
if (!stubsApplied) {
|
|
@@ -28,6 +31,18 @@ export function injectFCTrampoline(component, customHooks) {
|
|
|
28
31
|
loggingEnabled && console.trace("createElement trace");
|
|
29
32
|
return Object.create(component.prototype);
|
|
30
33
|
};
|
|
34
|
+
if (patchJsx) {
|
|
35
|
+
window.SP_JSX.jsx = () => {
|
|
36
|
+
loggingEnabled && logger.debug("jsx hook called");
|
|
37
|
+
loggingEnabled && console.trace("jsx trace");
|
|
38
|
+
return Object.create(component.prototype);
|
|
39
|
+
};
|
|
40
|
+
window.SP_JSX.jsxs = () => {
|
|
41
|
+
loggingEnabled && logger.debug("jsxs hook called");
|
|
42
|
+
loggingEnabled && console.trace("jsxs trace");
|
|
43
|
+
return Object.create(component.prototype);
|
|
44
|
+
};
|
|
45
|
+
}
|
|
31
46
|
}
|
|
32
47
|
};
|
|
33
48
|
const removeStubsIfNeeded = () => {
|
|
@@ -36,6 +51,10 @@ export function injectFCTrampoline(component, customHooks) {
|
|
|
36
51
|
stubsApplied = false;
|
|
37
52
|
removeHookStubs();
|
|
38
53
|
window.SP_REACT.createElement = oldCreateElement;
|
|
54
|
+
if (patchJsx) {
|
|
55
|
+
window.SP_JSX.jsx = oldJsx;
|
|
56
|
+
window.SP_JSX.jsxs = oldJsxs;
|
|
57
|
+
}
|
|
39
58
|
}
|
|
40
59
|
};
|
|
41
60
|
let renderHookStep = 0;
|
package/dist/webpack.js
CHANGED
|
@@ -117,5 +117,5 @@ export const CommonUIModule = findModule((m) => {
|
|
|
117
117
|
}
|
|
118
118
|
return false;
|
|
119
119
|
});
|
|
120
|
-
export const IconsModule = findModuleByExport((e) => e?.toString && /Spinner\)}\)?,.\.createElement\(\"path\",{d:\"M18 /.test(e.toString()));
|
|
120
|
+
export const IconsModule = findModuleByExport((e) => e?.toString && /Spinner\),children:\[\(0,\w+\.jsx\)\("path",\{d:"M18 /.test(e.toString()) || /Spinner\)}\)?,.\.createElement\(\"path\",{d:\"M18 /.test(e.toString()));
|
|
121
121
|
export const ReactRouter = findModuleByExport((e) => e.computeRootMatch);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@decky/ui",
|
|
3
|
-
"version": "4.11.
|
|
3
|
+
"version": "4.11.3",
|
|
4
4
|
"description": "A library for interacting with the Steam frontend in Decky plugins and elsewhere.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"minimist": "^1.2.8",
|
|
58
58
|
"prettier": "^3.6.2",
|
|
59
59
|
"prettier-plugin-import-sort": "^0.0.7",
|
|
60
|
-
"semantic-release": "^
|
|
60
|
+
"semantic-release": "^25.0.3",
|
|
61
61
|
"shx": "^0.3.4",
|
|
62
62
|
"ts-jest": "^29.4.1",
|
|
63
63
|
"typedoc": "^0.25.13",
|
package/src/components/Dialog.ts
CHANGED
|
@@ -52,8 +52,17 @@ export interface DialogButtonProps extends DialogCommonProps, FooterLegendProps
|
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
const CommonDialogDivs = Object.values(CommonUIModule).filter(
|
|
55
|
-
(m: any) => typeof m === 'object' &&
|
|
56
|
-
|
|
55
|
+
(m: any) => typeof m === 'object' &&
|
|
56
|
+
// New
|
|
57
|
+
(
|
|
58
|
+
m?.render?.toString().includes('jsx)("div",{...') ||
|
|
59
|
+
m?.render?.toString().includes('jsx)("div",Object.assign({},')
|
|
60
|
+
) ||
|
|
61
|
+
// Old
|
|
62
|
+
(
|
|
63
|
+
m?.render?.toString().includes('createElement("div",{...') ||
|
|
64
|
+
m?.render?.toString().includes('createElement("div",Object.assign({},')
|
|
65
|
+
)
|
|
57
66
|
);
|
|
58
67
|
const MappedDialogDivs = new Map(
|
|
59
68
|
Object.values(CommonDialogDivs).map((m: any) => {
|
|
@@ -28,7 +28,8 @@ export const ProgressBar = findModuleExport((e: Export) =>
|
|
|
28
28
|
) as FC<ProgressBarProps>;
|
|
29
29
|
|
|
30
30
|
export const ProgressBarWithInfo = findModuleExport((e: Export) =>
|
|
31
|
-
|
|
31
|
+
// new || old
|
|
32
|
+
e?.toString?.()?.includes('.ProgressBarFieldStatus,children') || e?.toString?.()?.includes('.ProgressBarFieldStatus},'),
|
|
32
33
|
) as FC<ProgressBarWithInfoProps>;
|
|
33
34
|
|
|
34
35
|
const progressBarItemRegex = createPropListRegex(["indeterminate", "nTransitionSec", "nProgress"]);
|
package/src/components/Scroll.ts
CHANGED
|
@@ -11,5 +11,6 @@ export const ScrollPanel = ScrollingModuleProps.find((prop: any) =>
|
|
|
11
11
|
) as FC<{ children?: ReactNode }>;
|
|
12
12
|
|
|
13
13
|
export const ScrollPanelGroup: FC<{ children?: ReactNode }> = findModuleExport((e: Export) =>
|
|
14
|
-
|
|
14
|
+
// new || old
|
|
15
|
+
e?.render?.toString().includes('.FocusVisibleChild(),[])') || e?.render?.toString().includes('.FocusVisibleChild()),[])'),
|
|
15
16
|
);
|
|
@@ -3,6 +3,6 @@ import { FC, SVGAttributes } from 'react';
|
|
|
3
3
|
import { IconsModule } from '../webpack';
|
|
4
4
|
|
|
5
5
|
// TODO type this and other icons?
|
|
6
|
-
export const Spinner = Object.values(IconsModule)?.find(
|
|
7
|
-
(mod: any) => mod?.toString && /Spinner\)}\)?,.\.createElement\(\"path\",{d:\"M18 /.test(mod.toString()),
|
|
6
|
+
export const Spinner = IconsModule && Object.values(IconsModule)?.find(
|
|
7
|
+
(mod: any) => mod?.toString && /Spinner\),children:\[\(0,\w+\.jsx\)\("path",\{d:"M18 /.test(mod.toString()) || /Spinner\)}\)?,.\.createElement\(\"path\",{d:\"M18 /.test(mod.toString()),
|
|
8
8
|
) as FC<SVGAttributes<SVGElement>>;
|
package/src/components/Tabs.ts
CHANGED
|
@@ -67,4 +67,4 @@ const tabsModule = findModuleByExport(e => e?.toString?.()?.includes(".TabRowTab
|
|
|
67
67
|
/**
|
|
68
68
|
* Tabs component as used in the library and media tabs. See {@link TabsProps}.
|
|
69
69
|
*/
|
|
70
|
-
export const Tabs = tabsModule && Object.values(tabsModule).find((e: any) => e?.type?.toString?.()?.includes("(
|
|
70
|
+
export const Tabs = tabsModule && Object.values(tabsModule).find((e: any) => e?.type?.toString?.()?.includes("(function()")) as FC<TabsProps>;
|
package/src/utils/react/fc.ts
CHANGED
|
@@ -42,6 +42,9 @@ export function injectFCTrampoline(component: FC, customHooks?: any): FCTrampoli
|
|
|
42
42
|
};
|
|
43
43
|
component.prototype.isReactComponent = true;
|
|
44
44
|
let stubsApplied = false;
|
|
45
|
+
const patchJsx = window.SP_REACTDOM.version.startsWith("19.");
|
|
46
|
+
let oldJsx = window.SP_JSX?.jsx;
|
|
47
|
+
let oldJsxs = window.SP_JSX?.jsxs;
|
|
45
48
|
let oldCreateElement = window.SP_REACT.createElement;
|
|
46
49
|
|
|
47
50
|
const applyStubsIfNeeded = () => {
|
|
@@ -55,6 +58,18 @@ export function injectFCTrampoline(component: FC, customHooks?: any): FCTrampoli
|
|
|
55
58
|
loggingEnabled && console.trace("createElement trace");
|
|
56
59
|
return Object.create(component.prototype);
|
|
57
60
|
};
|
|
61
|
+
if (patchJsx) {
|
|
62
|
+
window.SP_JSX.jsx = () => {
|
|
63
|
+
loggingEnabled && logger.debug("jsx hook called");
|
|
64
|
+
loggingEnabled && console.trace("jsx trace");
|
|
65
|
+
return Object.create(component.prototype);
|
|
66
|
+
}
|
|
67
|
+
window.SP_JSX.jsxs = () => {
|
|
68
|
+
loggingEnabled && logger.debug("jsxs hook called");
|
|
69
|
+
loggingEnabled && console.trace("jsxs trace");
|
|
70
|
+
return Object.create(component.prototype);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
58
73
|
}
|
|
59
74
|
}
|
|
60
75
|
|
|
@@ -64,6 +79,10 @@ export function injectFCTrampoline(component: FC, customHooks?: any): FCTrampoli
|
|
|
64
79
|
stubsApplied = false;
|
|
65
80
|
removeHookStubs();
|
|
66
81
|
window.SP_REACT.createElement = oldCreateElement;
|
|
82
|
+
if (patchJsx) {
|
|
83
|
+
window.SP_JSX.jsx = oldJsx;
|
|
84
|
+
window.SP_JSX.jsxs = oldJsxs;
|
|
85
|
+
}
|
|
67
86
|
}
|
|
68
87
|
}
|
|
69
88
|
|
package/src/webpack.ts
CHANGED
|
@@ -154,7 +154,7 @@ export const CommonUIModule = findModule((m: Module) => {
|
|
|
154
154
|
});
|
|
155
155
|
|
|
156
156
|
export const IconsModule = findModuleByExport(
|
|
157
|
-
(e) => e?.toString && /Spinner\)}\)?,.\.createElement\(\"path\",{d:\"M18 /.test(e.toString()),
|
|
157
|
+
(e) => e?.toString && /Spinner\),children:\[\(0,\w+\.jsx\)\("path",\{d:"M18 /.test(e.toString()) || /Spinner\)}\)?,.\.createElement\(\"path\",{d:\"M18 /.test(e.toString()),
|
|
158
158
|
);
|
|
159
159
|
|
|
160
160
|
export const ReactRouter = findModuleByExport((e) => e.computeRootMatch);
|