@decky/ui 4.10.2 → 4.10.4

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.
@@ -42,7 +42,7 @@ export interface ConfirmModalProps extends ModalRootProps {
42
42
  bMiddleDisabled?: boolean;
43
43
  }
44
44
  export declare const ConfirmModal: FC<ConfirmModalProps>;
45
- export declare const ModalRoot: FC<ModalRootProps>;
45
+ export declare const ModalRoot: any;
46
46
  interface SimpleModalProps {
47
47
  active?: boolean;
48
48
  children: ReactNode;
@@ -9,17 +9,18 @@ export const showModal = (modal, parent, props = {
9
9
  bHideActions: props.bHideActionIcons,
10
10
  });
11
11
  };
12
- export const ConfirmModal = findModuleExport((e) => !e?.prototype?.OK && e?.prototype?.Cancel && e?.prototype?.render);
13
- export const ModalRoot = Object.values(findModule((m) => {
14
- if (typeof m !== 'object')
15
- return false;
16
- for (let prop in m) {
17
- if (m[prop]?.m_mapModalManager && Object.values(m)?.find((x) => x?.type)) {
18
- return true;
12
+ export const ConfirmModal = findModuleExport((e) => e?.toString()?.includes('bUpdateDisabled') && e?.toString()?.includes('closeModal') && e?.toString()?.includes('onGamepadCancel'));
13
+ export const ModalRoot = findModuleExport((e) => typeof e === 'function' && e.toString().includes('Either closeModal or onCancel should be passed to GenericDialog. Classes: ')) ||
14
+ Object.values(findModule((m) => {
15
+ if (typeof m !== 'object')
16
+ return false;
17
+ for (let prop in m) {
18
+ if (m[prop]?.m_mapModalManager && Object.values(m)?.find((x) => x?.type)) {
19
+ return true;
20
+ }
19
21
  }
20
- }
21
- return false;
22
- }) || {})?.find((x) => x?.type?.toString?.()?.includes('((function(){'));
22
+ return false;
23
+ }) || {})?.find((x) => x?.type?.toString?.()?.includes('((function(){'));
23
24
  const [ModalModule, _ModalPosition] = findModuleDetailsByExport((e) => e?.toString().includes('.ModalPosition'), 5);
24
25
  const ModalModuleProps = ModalModule ? Object.values(ModalModule) : [];
25
26
  export const SimpleModal = ModalModuleProps.find((prop) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@decky/ui",
3
- "version": "4.10.2",
3
+ "version": "4.10.4",
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",
@@ -83,22 +83,26 @@ export interface ConfirmModalProps extends ModalRootProps {
83
83
  }
84
84
 
85
85
  export const ConfirmModal = findModuleExport(
86
- (e: Export) => !e?.prototype?.OK && e?.prototype?.Cancel && e?.prototype?.render,
86
+ (e: Export) => e?.toString()?.includes('bUpdateDisabled') && e?.toString()?.includes('closeModal') && e?.toString()?.includes('onGamepadCancel'),
87
87
  ) as FC<ConfirmModalProps>;
88
88
 
89
- export const ModalRoot = Object.values(
90
- findModule((m: any) => {
91
- if (typeof m !== 'object') return false;
92
-
93
- for (let prop in m) {
94
- if (m[prop]?.m_mapModalManager && Object.values(m)?.find((x: any) => x?.type)) {
95
- return true;
89
+ export const ModalRoot =
90
+ // new
91
+ findModuleExport((e: Export) => typeof e === 'function' && e.toString().includes('Either closeModal or onCancel should be passed to GenericDialog. Classes: ')) ||
92
+ // old
93
+ Object.values(
94
+ findModule((m: any) => {
95
+ if (typeof m !== 'object') return false;
96
+
97
+ for (let prop in m) {
98
+ if (m[prop]?.m_mapModalManager && Object.values(m)?.find((x: any) => x?.type)) {
99
+ return true;
100
+ }
96
101
  }
97
- }
98
102
 
99
- return false;
100
- }) || {},
101
- )?.find((x: any) => x?.type?.toString?.()?.includes('((function(){')) as FC<ModalRootProps>;
103
+ return false;
104
+ }) || {},
105
+ )?.find((x: any) => x?.type?.toString?.()?.includes('((function(){')) as FC<ModalRootProps>;
102
106
 
103
107
  interface SimpleModalProps {
104
108
  active?: boolean;